From 183ea82292cf8c4b7b0322f8c8f2411bb733ef95 Mon Sep 17 00:00:00 2001 From: Tadej Vengust Date: Wed, 27 Mar 2019 11:51:45 +0100 Subject: [PATCH 01/22] Update packages normalizeAddress so it can be overriden. --- .../src/core/ledger.ts | 38 +++++++++++-------- .../src/core/provider.ts | 21 +++++++--- .../src/core/gateway.ts | 30 ++++++++++++--- .../src/core/ledger.ts | 29 +++++++++----- 4 files changed, 81 insertions(+), 37 deletions(-) diff --git a/packages/0xcert-ethereum-asset-ledger/src/core/ledger.ts b/packages/0xcert-ethereum-asset-ledger/src/core/ledger.ts index 9f089f197..74806b95b 100644 --- a/packages/0xcert-ethereum-asset-ledger/src/core/ledger.ts +++ b/packages/0xcert-ethereum-asset-ledger/src/core/ledger.ts @@ -68,7 +68,7 @@ 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._id = this.normalizeAddress(id); this._provider = provider; } @@ -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.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.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.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.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.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.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.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.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.normalizeAddress(recipe.senderId); + const receiverId = this.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.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.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.normalizeAddress(accountId); + operatorId = this.normalizeAddress(operatorId as string); return isApprovedForAll(this, accountId, operatorId); } @@ -381,4 +381,12 @@ export class AssetLedger implements AssetLedgerBase { : 2; // OrderGatewayProxy.NFTOKEN_TRANSFER; } + /** + * Normalizes the Ethereum address. + * NOTE: This method is here to easily extend the class for related platforms + * such as Wanchain. + */ + protected normalizeAddress(address: string): string { + return normalizeAddress(address); + } } diff --git a/packages/0xcert-ethereum-generic-provider/src/core/provider.ts b/packages/0xcert-ethereum-generic-provider/src/core/provider.ts index c4b55b859..2b11465e3 100644 --- a/packages/0xcert-ethereum-generic-provider/src/core/provider.ts +++ b/packages/0xcert-ethereum-generic-provider/src/core/provider.ts @@ -142,7 +142,7 @@ export class GenericProvider extends EventEmitter implements ProviderBase { * Sets and normalizes account ID. */ public set accountId(id: string) { - id = normalizeAddress(id); + id = this.normalizeAddress(id); if (!this.isCurrentAccount(id)) { this.emit(ProviderEvent.ACCOUNT_CHANGE, id, this._accountId); // must be before the new account is set @@ -162,7 +162,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.normalizeAddress(id)); } /** @@ -176,7 +176,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.normalizeAddress(id); } /** @@ -232,7 +232,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.normalizeAddress(a)); } /** @@ -250,14 +250,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.normalizeAddress(accountId); } /** * Returns true if the provided ledgerId is unsafe recipient address. */ public isUnsafeRecipientId(ledgerId: string) { - const normalizedLedgerId = normalizeAddress(ledgerId); + const normalizedLedgerId = this.normalizeAddress(ledgerId); return !!this.unsafeRecipientIds.find((id) => id === normalizedLedgerId); } @@ -339,4 +339,13 @@ export class GenericProvider extends EventEmitter implements ProviderBase { return this._id; } + /** + * Normalizes the Ethereum address. + * NOTE: This method is here to easily extend the class for related platforms + * such as Wanchain. + */ + protected normalizeAddress(address: string): string { + return normalizeAddress(address); + } + } diff --git a/packages/0xcert-ethereum-order-gateway/src/core/gateway.ts b/packages/0xcert-ethereum-order-gateway/src/core/gateway.ts index 66e300651..2fa015a58 100644 --- a/packages/0xcert-ethereum-order-gateway/src/core/gateway.ts +++ b/packages/0xcert-ethereum-order-gateway/src/core/gateway.ts @@ -41,7 +41,7 @@ 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._id = this.normalizeAddress(id || provider.orderGatewayId); this._provider = provider; } @@ -64,7 +64,7 @@ export class OrderGateway implements OrderGatewayBase { * @param order Order data. */ public async claim(order: Order): Promise { - order = normalizeOrderIds(order); + order = this.normalizeOrderIds(order); if (this._provider.signMethod == SignMethod.PERSONAL_SIGN) { return claimPersonalSign(this, order); @@ -79,7 +79,7 @@ export class OrderGateway implements OrderGatewayBase { * @param claim Claim data. */ public async perform(order: Order, claim: string): Promise { - order = normalizeOrderIds(order); + order = this.normalizeOrderIds(order); return perform(this, order, claim); } @@ -89,7 +89,7 @@ export class OrderGateway implements OrderGatewayBase { * @param order Order data. */ public async cancel(order: Order): Promise { - order = normalizeOrderIds(order); + order = this.normalizeOrderIds(order); return cancel(this, order); } @@ -108,7 +108,7 @@ export class OrderGateway implements OrderGatewayBase { * @param claim Claim data. */ public async isValidSignature(order: Order, claim: string) { - order = normalizeOrderIds(order); + order = this.normalizeOrderIds(order); return isValidSignature(this, order, claim); } @@ -118,9 +118,27 @@ export class OrderGateway implements OrderGatewayBase { * @param order Order data. */ public async getOrderDataClaim(order: Order) { - order = normalizeOrderIds(order); + order = this.normalizeOrderIds(order); return getOrderDataClaim(this, order); } + /** + * Normalizes the Ethereum address. + * NOTE: This method is here to easily extend the class for related platforms + * such as Wanchain. + */ + protected normalizeAddress(address: string): string { + return normalizeAddress(address); + } + + /** + * Normalizes the Ethereum addresses of an order. + * NOTE: This method is here to easily extend the class for related platforms + * such as Wanchain. + */ + protected normalizeOrderIds(order: Order): Order { + return normalizeOrderIds(order); + } + } diff --git a/packages/0xcert-ethereum-value-ledger/src/core/ledger.ts b/packages/0xcert-ethereum-value-ledger/src/core/ledger.ts index 0d6d78467..f8dd4dbc1 100644 --- a/packages/0xcert-ethereum-value-ledger/src/core/ledger.ts +++ b/packages/0xcert-ethereum-value-ledger/src/core/ledger.ts @@ -49,7 +49,7 @@ export class ValueLedger implements ValueLedgerBase { * @param id Address of the erc20 smart contract. */ public constructor(provider: GenericProvider, id: string) { - this._id = normalizeAddress(id); + this._id = this.normalizeAddress(id); this._provider = provider; } @@ -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.normalizeAddress(accountId); + spenderId = this.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.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.normalizeAddress(accountId); + spenderId = this.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.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.normalizeAddress(accountId as string); return approveAccount(this, accountId, '0'); } @@ -157,12 +157,21 @@ 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.normalizeAddress(recipe.senderId); + const receiverId = this.normalizeAddress(recipe.receiverId); return recipe.senderId ? transferFrom(this, senderId, receiverId, recipe.value) : transfer(this, receiverId, recipe.value); } + /** + * Normalizes the Ethereum address. + * NOTE: This method is here to easily extend the class for related platforms + * such as Wanchain. + */ + protected normalizeAddress(address: string): string { + return normalizeAddress(address); + } + } From 6e14733d8805c074e26896f1dc2041612a2e2511 Mon Sep 17 00:00:00 2001 From: Tadej Vengust Date: Wed, 27 Mar 2019 11:52:05 +0100 Subject: [PATCH 02/22] Add additional tests. --- packages/0xcert-ethereum-http-provider/src/tests/index.test.ts | 2 ++ .../0xcert-ethereum-metamask-provider/src/tests/index.test.ts | 2 ++ packages/0xcert-ethereum-order-gateway/src/tests/index.test.ts | 1 + packages/0xcert-ethereum-value-ledger/src/index.ts | 1 + 4 files changed, 6 insertions(+) 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/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/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-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'; From 3face39c1e4c4f0372aa97a7d88172c2cb3cab0d Mon Sep 17 00:00:00 2001 From: Tadej Vengust Date: Wed, 27 Mar 2019 11:56:44 +0100 Subject: [PATCH 03/22] Add wanchain utils. --- packages/0xcert-wanchain-utils/README.md | 74 +++++ packages/0xcert-wanchain-utils/nodemon.json | 4 + packages/0xcert-wanchain-utils/package.json | 76 ++++++ packages/0xcert-wanchain-utils/src/index.ts | 1 + .../src/lib/normalize-address.ts | 23 ++ .../src/tests/normalize-address.test.ts | 16 ++ packages/0xcert-wanchain-utils/tsconfig.json | 12 + packages/0xcert-wanchain-utils/tslint.json | 253 ++++++++++++++++++ 8 files changed, 459 insertions(+) create mode 100644 packages/0xcert-wanchain-utils/README.md create mode 100644 packages/0xcert-wanchain-utils/nodemon.json create mode 100644 packages/0xcert-wanchain-utils/package.json create mode 100644 packages/0xcert-wanchain-utils/src/index.ts create mode 100644 packages/0xcert-wanchain-utils/src/lib/normalize-address.ts create mode 100644 packages/0xcert-wanchain-utils/src/tests/normalize-address.test.ts create mode 100644 packages/0xcert-wanchain-utils/tsconfig.json create mode 100644 packages/0xcert-wanchain-utils/tslint.json 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..3e3edd5f5 --- /dev/null +++ b/packages/0xcert-wanchain-utils/package.json @@ -0,0 +1,76 @@ +{ + "name": "@0xcert/wanchain-utils", + "version": "1.1.0-beta0", + "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": { + "@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..d641cb556 --- /dev/null +++ b/packages/0xcert-wanchain-utils/src/index.ts @@ -0,0 +1 @@ +export * from './lib/normalize-address'; diff --git a/packages/0xcert-wanchain-utils/src/lib/normalize-address.ts b/packages/0xcert-wanchain-utils/src/lib/normalize-address.ts new file mode 100644 index 000000000..91d8136e0 --- /dev/null +++ b/packages/0xcert-wanchain-utils/src/lib/normalize-address.ts @@ -0,0 +1,23 @@ +import { normalizeAddress as normalizeEthereumAddress } from '@0xcert/ethereum-utils/dist/lib/normalize-address'; + +/** + * Converts Wanchain address to checksum format. + * NOTE: Wanchain uses basically the same mechanism, you only have to inverse + * lower and upper case on characters. + */ +export function normalizeAddress(address: string): string { + if (!address) { + return null; + } + + 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..910bbbdfd --- /dev/null +++ b/packages/0xcert-wanchain-utils/src/tests/normalize-address.test.ts @@ -0,0 +1,16 @@ +import { Spec } from '@hayspec/spec'; +import { normalizeAddress } from '../lib/normalize-address'; + +const spec = new Spec(); + +spec.test('normalize address', (ctx) => { + console.log(normalizeAddress('0xE96D860C8BBB30F6831E6E65D327295B7A0C524F')); + ctx.is(normalizeAddress('0xE96D860C8BBB30F6831E6E65D327295B7A0C524F'), '0xE96d860c8bbb30f6831e6e65D327295b7a0c524F'); + ctx.is(normalizeAddress('0xe96d860c8bbb30f6831e6e65d327295b7a0c524f'), '0xE96d860c8bbb30f6831e6e65D327295b7a0c524F'); + ctx.is(normalizeAddress('0xE96d860c8bbb30f6831e6e65D327295b7a0c524F'), '0xE96d860c8bbb30f6831e6e65D327295b7a0c524F'); + ctx.is(normalizeAddress('E96d860c8bbb30f6831e6e65D327295b7a0c524F'), '0xE96d860c8bbb30f6831e6e65D327295b7a0c524F'); + ctx.is(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 + } +} From f997635f4ffd9c1a8e50b90e2a723f493b89c66d Mon Sep 17 00:00:00 2001 From: Tadej Vengust Date: Wed, 27 Mar 2019 11:57:14 +0100 Subject: [PATCH 04/22] Add wanchain http provider. --- .../0xcert-wanchain-http-provider/README.md | 7 + .../nodemon.json | 4 + .../package.json | 78 ++++++ .../src/core/provider.ts | 16 ++ .../src/index.ts | 3 + .../src/tests/index.test.ts | 12 + ...et-network-version-instance-method.test.ts | 22 ++ .../provider/send-instance-method.test.ts | 25 ++ .../tsconfig.json | 12 + .../0xcert-wanchain-http-provider/tslint.json | 253 ++++++++++++++++++ 10 files changed, 432 insertions(+) create mode 100644 packages/0xcert-wanchain-http-provider/README.md create mode 100644 packages/0xcert-wanchain-http-provider/nodemon.json create mode 100644 packages/0xcert-wanchain-http-provider/package.json create mode 100644 packages/0xcert-wanchain-http-provider/src/core/provider.ts create mode 100644 packages/0xcert-wanchain-http-provider/src/index.ts create mode 100644 packages/0xcert-wanchain-http-provider/src/tests/index.test.ts create mode 100644 packages/0xcert-wanchain-http-provider/src/tests/provider/get-network-version-instance-method.test.ts create mode 100644 packages/0xcert-wanchain-http-provider/src/tests/provider/send-instance-method.test.ts create mode 100644 packages/0xcert-wanchain-http-provider/tsconfig.json create mode 100644 packages/0xcert-wanchain-http-provider/tslint.json 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..c78880574 --- /dev/null +++ b/packages/0xcert-wanchain-http-provider/package.json @@ -0,0 +1,78 @@ +{ + "name": "@0xcert/wanchain-http-provider", + "version": "1.1.0-beta0", + "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-http-provider": "1.0.1", + "@0xcert/wanchain-utils": "1.1.0-beta0" + } +} 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..05f2bf453 --- /dev/null +++ b/packages/0xcert-wanchain-http-provider/src/core/provider.ts @@ -0,0 +1,16 @@ +import * as ethereum from '@0xcert/ethereum-http-provider'; +import { normalizeAddress } from '@0xcert/wanchain-utils'; + +/** + * HTTP RPC client. + */ +export class HttpProvider extends ethereum.HttpProvider { + + /** + * OVERRIDE: Normalizes the Wanchain address. + */ + protected normalizeAddress(address: string): string { + return normalizeAddress(address); + } + +} 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..46fb926f2 --- /dev/null +++ b/packages/0xcert-wanchain-http-provider/src/index.ts @@ -0,0 +1,3 @@ +export { MutationEvent, ProviderEvent, ProviderIssue, ProviderError, parseError, MutationStatus, + Mutation, GenericProvider, SignMethod } from '@0xcert/ethereum-http-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/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 + } +} From 7d1c891060a126d8887448001dbeb2cf92fc5a55 Mon Sep 17 00:00:00 2001 From: Tadej Vengust Date: Wed, 27 Mar 2019 11:57:35 +0100 Subject: [PATCH 05/22] Add wanchain value ledger. --- .../0xcert-wanchain-value-ledger/README.md | 7 + .../0xcert-wanchain-value-ledger/nodemon.json | 4 + .../0xcert-wanchain-value-ledger/package.json | 78 ++++++ .../src/core/ledger.ts | 16 ++ .../0xcert-wanchain-value-ledger/src/index.ts | 2 + .../src/tests/index.test.ts | 10 + .../tsconfig.json | 12 + .../0xcert-wanchain-value-ledger/tslint.json | 253 ++++++++++++++++++ 8 files changed, 382 insertions(+) create mode 100644 packages/0xcert-wanchain-value-ledger/README.md create mode 100644 packages/0xcert-wanchain-value-ledger/nodemon.json create mode 100644 packages/0xcert-wanchain-value-ledger/package.json create mode 100644 packages/0xcert-wanchain-value-ledger/src/core/ledger.ts create mode 100644 packages/0xcert-wanchain-value-ledger/src/index.ts create mode 100644 packages/0xcert-wanchain-value-ledger/src/tests/index.test.ts create mode 100644 packages/0xcert-wanchain-value-ledger/tsconfig.json create mode 100644 packages/0xcert-wanchain-value-ledger/tslint.json 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..63d143014 --- /dev/null +++ b/packages/0xcert-wanchain-value-ledger/package.json @@ -0,0 +1,78 @@ +{ + "name": "@0xcert/wanchain-value-ledger", + "version": "1.1.0-beta0", + "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.0.1", + "@0xcert/wanchain-utils": "1.1.0-beta0" + } +} 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..dabf26839 --- /dev/null +++ b/packages/0xcert-wanchain-value-ledger/src/core/ledger.ts @@ -0,0 +1,16 @@ +import * as ethereum from '@0xcert/ethereum-value-ledger'; +import { normalizeAddress } from '@0xcert/wanchain-utils'; + +/** + * Wanchain value ledger implementation. + */ +export class ValueLedger extends ethereum.ValueLedger { + + /** + * OVERRIDE: Normalizes the Wanchain address. + */ + protected normalizeAddress(address: string): string { + return normalizeAddress(address); + } + +} 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 + } +} From e0dc96583dbb24ac8bd86d3048c5c256a56f47bc Mon Sep 17 00:00:00 2001 From: Tadej Vengust Date: Wed, 27 Mar 2019 11:57:51 +0100 Subject: [PATCH 06/22] Add wanchain asset ledger. --- .../0xcert-wanchain-asset-ledger/README.md | 7 + .../0xcert-wanchain-asset-ledger/nodemon.json | 4 + .../0xcert-wanchain-asset-ledger/package.json | 78 ++++++ .../src/core/ledger.ts | 16 ++ .../0xcert-wanchain-asset-ledger/src/index.ts | 5 + .../tsconfig.json | 12 + .../0xcert-wanchain-asset-ledger/tslint.json | 253 ++++++++++++++++++ 7 files changed, 375 insertions(+) create mode 100644 packages/0xcert-wanchain-asset-ledger/README.md create mode 100644 packages/0xcert-wanchain-asset-ledger/nodemon.json create mode 100644 packages/0xcert-wanchain-asset-ledger/package.json create mode 100644 packages/0xcert-wanchain-asset-ledger/src/core/ledger.ts create mode 100644 packages/0xcert-wanchain-asset-ledger/src/index.ts create mode 100644 packages/0xcert-wanchain-asset-ledger/tsconfig.json create mode 100644 packages/0xcert-wanchain-asset-ledger/tslint.json 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..ccc953e2a --- /dev/null +++ b/packages/0xcert-wanchain-asset-ledger/package.json @@ -0,0 +1,78 @@ +{ + "name": "@0xcert/wanchain-asset-ledger", + "version": "1.1.0-beta0", + "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": { + "@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.0.1", + "@0xcert/wanchain-utils": "1.1.0-beta0" + } +} 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..c8b3dbf0f --- /dev/null +++ b/packages/0xcert-wanchain-asset-ledger/src/core/ledger.ts @@ -0,0 +1,16 @@ +import * as ethereum from '@0xcert/ethereum-asset-ledger'; +import { normalizeAddress } from '@0xcert/wanchain-utils'; + +/** + * Wanchain asset ledger implementation. + */ +export class AssetLedger extends ethereum.AssetLedger { + + /** + * OVERRIDE: Normalizes the Wanchain address. + */ + protected normalizeAddress(address: string): string { + return normalizeAddress(address); + } + +} 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/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 + } +} From 4d69435105c461ce3a5fcc36215d3dac2bc1815e Mon Sep 17 00:00:00 2001 From: Tadej Vengust Date: Wed, 27 Mar 2019 11:58:15 +0100 Subject: [PATCH 07/22] Add wanchain order gateway. --- .../src/tests/index.test.ts | 13 + .../CHANGELOG.json | 17 ++ .../CHANGELOG.md | 14 + .../0xcert-wanchain-order-gateway/README.md | 7 + .../nodemon.json | 4 + .../package.json | 78 ++++++ .../src/core/gateway.ts | 28 ++ .../src/index.ts | 2 + .../src/lib/order.ts | 18 ++ .../src/tests/index.test.ts | 11 + .../tsconfig.json | 12 + .../0xcert-wanchain-order-gateway/tslint.json | 253 ++++++++++++++++++ 12 files changed, 457 insertions(+) create mode 100644 packages/0xcert-wanchain-asset-ledger/src/tests/index.test.ts create mode 100644 packages/0xcert-wanchain-order-gateway/CHANGELOG.json create mode 100644 packages/0xcert-wanchain-order-gateway/CHANGELOG.md create mode 100644 packages/0xcert-wanchain-order-gateway/README.md create mode 100644 packages/0xcert-wanchain-order-gateway/nodemon.json create mode 100644 packages/0xcert-wanchain-order-gateway/package.json create mode 100644 packages/0xcert-wanchain-order-gateway/src/core/gateway.ts create mode 100644 packages/0xcert-wanchain-order-gateway/src/index.ts create mode 100644 packages/0xcert-wanchain-order-gateway/src/lib/order.ts create mode 100644 packages/0xcert-wanchain-order-gateway/src/tests/index.test.ts create mode 100644 packages/0xcert-wanchain-order-gateway/tsconfig.json create mode 100644 packages/0xcert-wanchain-order-gateway/tslint.json 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-order-gateway/CHANGELOG.json b/packages/0xcert-wanchain-order-gateway/CHANGELOG.json new file mode 100644 index 000000000..ca7c9ca44 --- /dev/null +++ b/packages/0xcert-wanchain-order-gateway/CHANGELOG.json @@ -0,0 +1,17 @@ +{ + "name": "@0xcert/ethereum-order-gateway", + "entries": [ + { + "version": "1.0.1", + "tag": "@0xcert/ethereum-order-gateway_v1.0.1", + "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..4eb8936e1 --- /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.0.1 +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..f788970d7 --- /dev/null +++ b/packages/0xcert-wanchain-order-gateway/package.json @@ -0,0 +1,78 @@ +{ + "name": "@0xcert/wanchain-order-gateway", + "version": "1.1.0-beta0", + "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.0.1", + "@0xcert/wanchain-utils": "1.1.0-beta0" + } +} 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..880c3d6e8 --- /dev/null +++ b/packages/0xcert-wanchain-order-gateway/src/core/gateway.ts @@ -0,0 +1,28 @@ +import * as ethereum from '@0xcert/ethereum-order-gateway'; +import { normalizeAddress } from '@0xcert/wanchain-utils'; +import { normalizeOrderIds } from '../lib/order'; + +/** + * Wanchain order gateway implementation. + */ +export class OrderGateway extends ethereum.OrderGateway { + + /** + * Normalizes the Ethereum address. + * NOTE: This method is here to easily extend the class for related platforms + * such as Wanchain. + */ + protected normalizeAddress(address: string): string { + return normalizeAddress(address); + } + + /** + * Normalizes the Ethereum addresses of an order. + * NOTE: This method is here to easily extend the class for related platforms + * such as Wanchain. + */ + protected normalizeOrderIds(order: ethereum.Order): ethereum.Order { + return normalizeOrderIds(order); + } + +} 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/lib/order.ts b/packages/0xcert-wanchain-order-gateway/src/lib/order.ts new file mode 100644 index 000000000..5a7d0a3b3 --- /dev/null +++ b/packages/0xcert-wanchain-order-gateway/src/lib/order.ts @@ -0,0 +1,18 @@ +import { Order } from '@0xcert/ethereum-order-gateway'; +import { normalizeAddress } from '@0xcert/wanchain-utils'; + +/** + * Normalizes order IDs and returns a new order object. + * @param order Order instance. + */ +export function normalizeOrderIds(order: Order): Order { + order = JSON.parse(JSON.stringify(order)); + order.makerId = normalizeAddress(order.makerId); + order.takerId = normalizeAddress(order.takerId); + order.actions.forEach((action) => { + action.ledgerId = normalizeAddress(action.ledgerId); + action.receiverId = normalizeAddress(action.receiverId); + action.senderId = normalizeAddress(action.senderId); + }); + return order; +} 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 + } +} From 708ec19f466e5d804e929d9917eb82436e1d96bc Mon Sep 17 00:00:00 2001 From: Tadej Vengust Date: Wed, 27 Mar 2019 11:58:49 +0100 Subject: [PATCH 08/22] Update rush with new packages. --- common/config/rush/npm-shrinkwrap.json | 1267 +++++++++++++----------- rush.json | 25 + 2 files changed, 731 insertions(+), 561 deletions(-) diff --git a/common/config/rush/npm-shrinkwrap.json b/common/config/rush/npm-shrinkwrap.json index f4ac7b026..de3b850b9 100644 --- a/common/config/rush/npm-shrinkwrap.json +++ b/common/config/rush/npm-shrinkwrap.json @@ -21,17 +21,17 @@ } }, "@babel/core": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.4.0.tgz", - "integrity": "sha512-Dzl7U0/T69DFOTwqz/FJdnOSWS57NpjNfCwMKHABr589Lg8uX1RrlBIJ7L5Dubt/xkLsx0xH5EBFzlBVes1ayA==", + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.3.4.tgz", + "integrity": "sha512-jRsuseXBo9pN197KnDwhhaaBzyZr2oIcLHHTt2oDdQrej5Qp57dCCJafWx5ivU8/alEYDpssYqv1MUqcxwQlrA==", "requires": { "@babel/code-frame": "^7.0.0", - "@babel/generator": "^7.4.0", - "@babel/helpers": "^7.4.0", - "@babel/parser": "^7.4.0", - "@babel/template": "^7.4.0", - "@babel/traverse": "^7.4.0", - "@babel/types": "^7.4.0", + "@babel/generator": "^7.3.4", + "@babel/helpers": "^7.2.0", + "@babel/parser": "^7.3.4", + "@babel/template": "^7.2.2", + "@babel/traverse": "^7.3.4", + "@babel/types": "^7.3.4", "convert-source-map": "^1.1.0", "debug": "^4.1.0", "json5": "^2.1.0", @@ -48,15 +48,23 @@ "requires": { "ms": "^2.1.1" } + }, + "json5": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.0.tgz", + "integrity": "sha512-8Mh9h6xViijj36g7Dxi+Y4S6hNGV96vcJZr/SrlHh1LR/pEn/8j/+qIBbs44YKl69Lrfctp4QD+AdWLTMqEZAQ==", + "requires": { + "minimist": "^1.2.0" + } } } }, "@babel/generator": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.4.0.tgz", - "integrity": "sha512-/v5I+a1jhGSKLgZDcmAUZ4K/VePi43eRkUs3yePW1HB1iANOD5tqJXwGSG4BZhSksP8J9ejSlwGeTiiOFZOrXQ==", + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.3.4.tgz", + "integrity": "sha512-8EXhHRFqlVVWXPezBW5keTiQi/rJMQTg/Y9uVCEZ0CAF3PKtCCaVRnp64Ii1ujhkoDhhF1fVsImoN4yJ2uz4Wg==", "requires": { - "@babel/types": "^7.4.0", + "@babel/types": "^7.3.4", "jsesc": "^2.5.1", "lodash": "^4.17.11", "source-map": "^0.5.0", @@ -81,36 +89,36 @@ } }, "@babel/helper-call-delegate": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/@babel/helper-call-delegate/-/helper-call-delegate-7.4.0.tgz", - "integrity": "sha512-SdqDfbVdNQCBp3WhK2mNdDvHd3BD6qbmIc43CAyjnsfCmgHMeqgDcM3BzY2lchi7HBJGJ2CVdynLWbezaE4mmQ==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@babel/helper-call-delegate/-/helper-call-delegate-7.1.0.tgz", + "integrity": "sha512-YEtYZrw3GUK6emQHKthltKNZwszBcHK58Ygcis+gVUrF4/FmTVr5CCqQNSfmvg2y+YDEANyYoaLz/SHsnusCwQ==", "requires": { - "@babel/helper-hoist-variables": "^7.4.0", - "@babel/traverse": "^7.4.0", - "@babel/types": "^7.4.0" + "@babel/helper-hoist-variables": "^7.0.0", + "@babel/traverse": "^7.1.0", + "@babel/types": "^7.0.0" } }, "@babel/helper-create-class-features-plugin": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.4.0.tgz", - "integrity": "sha512-2K8NohdOT7P6Vyp23QH4w2IleP8yG3UJsbRKwA4YP6H8fErcLkFuuEEqbF2/BYBKSNci/FWJiqm6R3VhM/QHgw==", + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.3.4.tgz", + "integrity": "sha512-uFpzw6L2omjibjxa8VGZsJUPL5wJH0zzGKpoz0ccBkzIa6C8kWNUbiBmQ0rgOKWlHJ6qzmfa6lTiGchiV8SC+g==", "requires": { "@babel/helper-function-name": "^7.1.0", "@babel/helper-member-expression-to-functions": "^7.0.0", "@babel/helper-optimise-call-expression": "^7.0.0", "@babel/helper-plugin-utils": "^7.0.0", - "@babel/helper-replace-supers": "^7.4.0", - "@babel/helper-split-export-declaration": "^7.4.0" + "@babel/helper-replace-supers": "^7.3.4", + "@babel/helper-split-export-declaration": "^7.0.0" } }, "@babel/helper-define-map": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/@babel/helper-define-map/-/helper-define-map-7.4.0.tgz", - "integrity": "sha512-wAhQ9HdnLIywERVcSvX40CEJwKdAa1ID4neI9NXQPDOHwwA+57DqwLiPEVy2AIyWzAk0CQ8qx4awO0VUURwLtA==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@babel/helper-define-map/-/helper-define-map-7.1.0.tgz", + "integrity": "sha512-yPPcW8dc3gZLN+U1mhYV91QU3n5uTbx7DUdf8NnPbjS0RMwBuHi9Xt2MUgppmNz7CJxTBWsGczTiEp1CSOTPRg==", "requires": { "@babel/helper-function-name": "^7.1.0", - "@babel/types": "^7.4.0", - "lodash": "^4.17.11" + "@babel/types": "^7.0.0", + "lodash": "^4.17.10" } }, "@babel/helper-explode-assignable-expression": { @@ -141,11 +149,11 @@ } }, "@babel/helper-hoist-variables": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.4.0.tgz", - "integrity": "sha512-/NErCuoe/et17IlAQFKWM24qtyYYie7sFIrW/tIQXpck6vAu2hhtYYsKLBWQV+BQZMbcIYPU/QMYuTufrY4aQw==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.0.0.tgz", + "integrity": "sha512-Ggv5sldXUeSKsuzLkddtyhyHe2YantsxWKNi7A+7LeD12ExRDWTRk29JCXpaHPAbMaIPZSil7n+lq78WY2VY7w==", "requires": { - "@babel/types": "^7.4.0" + "@babel/types": "^7.0.0" } }, "@babel/helper-member-expression-to-functions": { @@ -211,14 +219,14 @@ } }, "@babel/helper-replace-supers": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.4.0.tgz", - "integrity": "sha512-PVwCVnWWAgnal+kJ+ZSAphzyl58XrFeSKSAJRiqg5QToTsjL+Xu1f9+RJ+d+Q0aPhPfBGaYfkox66k86thxNSg==", + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.3.4.tgz", + "integrity": "sha512-pvObL9WVf2ADs+ePg0jrqlhHoxRXlOa+SHRHzAXIz2xkYuOHfGl+fKxPMaS4Fq+uje8JQPobnertBBvyrWnQ1A==", "requires": { "@babel/helper-member-expression-to-functions": "^7.0.0", "@babel/helper-optimise-call-expression": "^7.0.0", - "@babel/traverse": "^7.4.0", - "@babel/types": "^7.4.0" + "@babel/traverse": "^7.3.4", + "@babel/types": "^7.3.4" } }, "@babel/helper-simple-access": { @@ -231,11 +239,11 @@ } }, "@babel/helper-split-export-declaration": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.4.0.tgz", - "integrity": "sha512-7Cuc6JZiYShaZnybDmfwhY4UYHzI6rlqhWjaIqbsJGsIqPimEYy5uh3akSRLMg65LSdSEnJ8a8/bWQN6u2oMGw==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.0.0.tgz", + "integrity": "sha512-MXkOJqva62dfC0w85mEf/LucPPS/1+04nmmRMPEBUB++hiiThQ2zPtX/mEWQ3mtzCEjIJvPY8nuwxXtQeQwUag==", "requires": { - "@babel/types": "^7.4.0" + "@babel/types": "^7.0.0" } }, "@babel/helper-wrap-function": { @@ -250,13 +258,13 @@ } }, "@babel/helpers": { - "version": "7.4.2", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.4.2.tgz", - "integrity": "sha512-gQR1eQeroDzFBikhrCccm5Gs2xBjZ57DNjGbqTaHo911IpmSxflOQWMAHPw/TXk8L3isv7s9lYzUkexOeTQUYg==", + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.3.1.tgz", + "integrity": "sha512-Q82R3jKsVpUV99mgX50gOPCWwco9Ec5Iln/8Vyu4osNIOQgSrd9RFrQeUvmvddFNoLwMyOUWU+5ckioEKpDoGA==", "requires": { - "@babel/template": "^7.4.0", - "@babel/traverse": "^7.4.0", - "@babel/types": "^7.4.0" + "@babel/template": "^7.1.2", + "@babel/traverse": "^7.1.5", + "@babel/types": "^7.3.0" } }, "@babel/highlight": { @@ -270,9 +278,9 @@ } }, "@babel/parser": { - "version": "7.4.2", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.4.2.tgz", - "integrity": "sha512-9fJTDipQFvlfSVdD/JBtkiY0br9BtfvW2R8wo6CX/Ej2eMuV0gWPk1M67Mt3eggQvBqYW1FCEk8BN7WvGm/g5g==" + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.3.4.tgz", + "integrity": "sha512-tXZCqWtlOOP4wgCp6RjRvLmfuhnqTLy9VHwRochJBCP2nDm27JnnuFEnXFASVyQNHk36jD1tAammsCEEqgscIQ==" }, "@babel/plugin-proposal-async-generator-functions": { "version": "7.2.0", @@ -285,20 +293,20 @@ } }, "@babel/plugin-proposal-class-properties": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.4.0.tgz", - "integrity": "sha512-t2ECPNOXsIeK1JxJNKmgbzQtoG27KIlVE61vTqX0DKR9E9sZlVVxWUtEW9D5FlZ8b8j7SBNCHY47GgPKCKlpPg==", + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.3.4.tgz", + "integrity": "sha512-lUf8D3HLs4yYlAo8zjuneLvfxN7qfKv1Yzbj5vjqaqMJxgJA3Ipwp4VUJ+OrOdz53Wbww6ahwB8UhB2HQyLotA==", "requires": { - "@babel/helper-create-class-features-plugin": "^7.4.0", + "@babel/helper-create-class-features-plugin": "^7.3.4", "@babel/helper-plugin-utils": "^7.0.0" } }, "@babel/plugin-proposal-decorators": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-decorators/-/plugin-proposal-decorators-7.4.0.tgz", - "integrity": "sha512-d08TLmXeK/XbgCo7ZeZ+JaeZDtDai/2ctapTRsWWkkmy7G/cqz8DQN/HlWG7RR4YmfXxmExsbU3SuCjlM7AtUg==", + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-decorators/-/plugin-proposal-decorators-7.3.0.tgz", + "integrity": "sha512-3W/oCUmsO43FmZIqermmq6TKaRSYhmh/vybPfVFwQWdSb8xwki38uAIvknCRzuyHRuYfCYmJzL9or1v0AffPjg==", "requires": { - "@babel/helper-create-class-features-plugin": "^7.4.0", + "@babel/helper-create-class-features-plugin": "^7.3.0", "@babel/helper-plugin-utils": "^7.0.0", "@babel/plugin-syntax-decorators": "^7.2.0" } @@ -313,9 +321,9 @@ } }, "@babel/plugin-proposal-object-rest-spread": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.4.0.tgz", - "integrity": "sha512-uTNi8pPYyUH2eWHyYWWSYJKwKg34hhgl4/dbejEjL+64OhbHjTX7wEVWMQl82tEmdDsGeu77+s8HHLS627h6OQ==", + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.3.4.tgz", + "integrity": "sha512-j7VQmbbkA+qrzNqbKHrBsW3ddFnOeva6wzSe/zB7T+xaxGc+RCpwo44wCmRixAIGRoIpmVgvzFzNJqQcO3/9RA==", "requires": { "@babel/helper-plugin-utils": "^7.0.0", "@babel/plugin-syntax-object-rest-spread": "^7.2.0" @@ -331,13 +339,46 @@ } }, "@babel/plugin-proposal-unicode-property-regex": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.4.0.tgz", - "integrity": "sha512-h/KjEZ3nK9wv1P1FSNb9G079jXrNYR0Ko+7XkOx85+gM24iZbPn0rh4vCftk+5QKY7y1uByFataBTmX7irEF1w==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.2.0.tgz", + "integrity": "sha512-LvRVYb7kikuOtIoUeWTkOxQEV1kYvL5B6U3iWEGCzPNRus1MzJweFqORTj+0jkxozkTSYNJozPOddxmqdqsRpw==", "requires": { "@babel/helper-plugin-utils": "^7.0.0", "@babel/helper-regex": "^7.0.0", - "regexpu-core": "^4.5.4" + "regexpu-core": "^4.2.0" + }, + "dependencies": { + "jsesc": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=" + }, + "regexpu-core": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.5.4.tgz", + "integrity": "sha512-BtizvGtFQKGPUcTy56o3nk1bGRp4SZOTYrDtGNlqCQufptV5IkkLN6Emw+yunAJjzf+C9FQFtvq7IoA3+oMYHQ==", + "requires": { + "regenerate": "^1.4.0", + "regenerate-unicode-properties": "^8.0.2", + "regjsgen": "^0.5.0", + "regjsparser": "^0.6.0", + "unicode-match-property-ecmascript": "^1.0.4", + "unicode-match-property-value-ecmascript": "^1.1.0" + } + }, + "regjsgen": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.5.0.tgz", + "integrity": "sha512-RnIrLhrXCX5ow/E5/Mh2O4e/oa1/jW0eaBKTSy3LaCj+M3Bqvm97GWDp2yUtzIs4LEn65zR2yiYGFqb2ApnzDA==" + }, + "regjsparser": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.0.tgz", + "integrity": "sha512-RQ7YyokLiQBomUJuUG8iGVvkgOLxwyZM8k6d3q5SAXpg4r5TZJZigKFvC6PpD+qQ98bCDC5YelPeA3EucDoNeQ==", + "requires": { + "jsesc": "~0.5.0" + } + } } }, "@babel/plugin-syntax-async-generators": { @@ -405,9 +446,9 @@ } }, "@babel/plugin-transform-async-to-generator": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.4.0.tgz", - "integrity": "sha512-EeaFdCeUULM+GPFEsf7pFcNSxM7hYjoj5fiYbyuiXobW4JhFnjAv9OWzNwHyHcKoPNpAfeRDuW6VyaXEDUBa7g==", + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.3.4.tgz", + "integrity": "sha512-Y7nCzv2fw/jEZ9f678MuKdMo99MFDJMT/PvD9LisrR5JDFcJH6vYeH6RnjVt3p5tceyGRvTtEN0VOlU+rgHZjA==", "requires": { "@babel/helper-module-imports": "^7.0.0", "@babel/helper-plugin-utils": "^7.0.0", @@ -423,26 +464,26 @@ } }, "@babel/plugin-transform-block-scoping": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.4.0.tgz", - "integrity": "sha512-AWyt3k+fBXQqt2qb9r97tn3iBwFpiv9xdAiG+Gr2HpAZpuayvbL55yWrsV3MyHvXk/4vmSiedhDRl1YI2Iy5nQ==", + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.3.4.tgz", + "integrity": "sha512-blRr2O8IOZLAOJklXLV4WhcEzpYafYQKSGT3+R26lWG41u/FODJuBggehtOwilVAcFu393v3OFj+HmaE6tVjhA==", "requires": { "@babel/helper-plugin-utils": "^7.0.0", "lodash": "^4.17.11" } }, "@babel/plugin-transform-classes": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.4.0.tgz", - "integrity": "sha512-XGg1Mhbw4LDmrO9rSTNe+uI79tQPdGs0YASlxgweYRLZqo/EQktjaOV4tchL/UZbM0F+/94uOipmdNGoaGOEYg==", + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.3.4.tgz", + "integrity": "sha512-J9fAvCFBkXEvBimgYxCjvaVDzL6thk0j0dBvCeZmIUDBwyt+nv6HfbImsSrWsYXfDNDivyANgJlFXDUWRTZBuA==", "requires": { "@babel/helper-annotate-as-pure": "^7.0.0", - "@babel/helper-define-map": "^7.4.0", + "@babel/helper-define-map": "^7.1.0", "@babel/helper-function-name": "^7.1.0", "@babel/helper-optimise-call-expression": "^7.0.0", "@babel/helper-plugin-utils": "^7.0.0", - "@babel/helper-replace-supers": "^7.4.0", - "@babel/helper-split-export-declaration": "^7.4.0", + "@babel/helper-replace-supers": "^7.3.4", + "@babel/helper-split-export-declaration": "^7.0.0", "globals": "^11.1.0" } }, @@ -455,9 +496,9 @@ } }, "@babel/plugin-transform-destructuring": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.4.0.tgz", - "integrity": "sha512-HySkoatyYTY3ZwLI8GGvkRWCFrjAGXUHur5sMecmCIdIharnlcWWivOqDJI76vvmVZfzwb6G08NREsrY96RhGQ==", + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.3.2.tgz", + "integrity": "sha512-Lrj/u53Ufqxl/sGxyjsJ2XNtNuEjDyjpqdhMNh5aZ+XFOdThL46KBj27Uem4ggoezSYBxKWAil6Hu8HtwqesYw==", "requires": { "@babel/helper-plugin-utils": "^7.0.0" } @@ -470,6 +511,39 @@ "@babel/helper-plugin-utils": "^7.0.0", "@babel/helper-regex": "^7.0.0", "regexpu-core": "^4.1.3" + }, + "dependencies": { + "jsesc": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=" + }, + "regexpu-core": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.5.4.tgz", + "integrity": "sha512-BtizvGtFQKGPUcTy56o3nk1bGRp4SZOTYrDtGNlqCQufptV5IkkLN6Emw+yunAJjzf+C9FQFtvq7IoA3+oMYHQ==", + "requires": { + "regenerate": "^1.4.0", + "regenerate-unicode-properties": "^8.0.2", + "regjsgen": "^0.5.0", + "regjsparser": "^0.6.0", + "unicode-match-property-ecmascript": "^1.0.4", + "unicode-match-property-value-ecmascript": "^1.1.0" + } + }, + "regjsgen": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.5.0.tgz", + "integrity": "sha512-RnIrLhrXCX5ow/E5/Mh2O4e/oa1/jW0eaBKTSy3LaCj+M3Bqvm97GWDp2yUtzIs4LEn65zR2yiYGFqb2ApnzDA==" + }, + "regjsparser": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.0.tgz", + "integrity": "sha512-RQ7YyokLiQBomUJuUG8iGVvkgOLxwyZM8k6d3q5SAXpg4r5TZJZigKFvC6PpD+qQ98bCDC5YelPeA3EucDoNeQ==", + "requires": { + "jsesc": "~0.5.0" + } + } } }, "@babel/plugin-transform-duplicate-keys": { @@ -490,9 +564,9 @@ } }, "@babel/plugin-transform-for-of": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.4.0.tgz", - "integrity": "sha512-vWdfCEYLlYSxbsKj5lGtzA49K3KANtb8qCPQ1em07txJzsBwY+cKJzBHizj5fl3CCx7vt+WPdgDLTHmydkbQSQ==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.2.0.tgz", + "integrity": "sha512-Kz7Mt0SsV2tQk6jG5bBv5phVbkd0gd27SgYD4hH1aLMJRchM0dzHaXvrWhVZ+WxAlDoAKZ7Uy3jVTW2mKXQ1WQ==", "requires": { "@babel/helper-plugin-utils": "^7.0.0" } @@ -524,9 +598,9 @@ } }, "@babel/plugin-transform-modules-commonjs": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.4.0.tgz", - "integrity": "sha512-iWKAooAkipG7g1IY0eah7SumzfnIT3WNhT4uYB2kIsvHnNSB6MDYVa5qyICSwaTBDBY2c4SnJ3JtEa6ltJd6Jw==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.2.0.tgz", + "integrity": "sha512-V6y0uaUQrQPXUrmj+hgnks8va2L0zcZymeU7TtWEgdRLNkceafKXEduv7QzgQAE4lT+suwooG9dC7LFhdRAbVQ==", "requires": { "@babel/helper-module-transforms": "^7.1.0", "@babel/helper-plugin-utils": "^7.0.0", @@ -534,11 +608,11 @@ } }, "@babel/plugin-transform-modules-systemjs": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.4.0.tgz", - "integrity": "sha512-gjPdHmqiNhVoBqus5qK60mWPp1CmYWp/tkh11mvb0rrys01HycEGD7NvvSoKXlWEfSM9TcL36CpsK8ElsADptQ==", + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.3.4.tgz", + "integrity": "sha512-VZ4+jlGOF36S7TjKs8g4ojp4MEI+ebCQZdswWb/T9I4X84j8OtFAyjXjt/M16iIm5RIZn0UMQgg/VgIwo/87vw==", "requires": { - "@babel/helper-hoist-variables": "^7.4.0", + "@babel/helper-hoist-variables": "^7.0.0", "@babel/helper-plugin-utils": "^7.0.0" } }, @@ -552,17 +626,17 @@ } }, "@babel/plugin-transform-named-capturing-groups-regex": { - "version": "7.4.2", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.4.2.tgz", - "integrity": "sha512-NsAuliSwkL3WO2dzWTOL1oZJHm0TM8ZY8ZSxk2ANyKkt5SQlToGA4pzctmq1BEjoacurdwZ3xp2dCQWJkME0gQ==", + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.3.0.tgz", + "integrity": "sha512-NxIoNVhk9ZxS+9lSoAQ/LM0V2UEvARLttEHUrRDGKFaAxOYQcrkN/nLRE+BbbicCAvZPl7wMP0X60HsHE5DtQw==", "requires": { "regexp-tree": "^0.1.0" } }, "@babel/plugin-transform-new-target": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.4.0.tgz", - "integrity": "sha512-6ZKNgMQmQmrEX/ncuCwnnw1yVGoaOW5KpxNhoWI7pCQdA0uZ0HqHGqenCUIENAnxRjy2WwNQ30gfGdIgqJXXqw==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.0.0.tgz", + "integrity": "sha512-yin069FYjah+LbqfGeTfzIBODex/e++Yfa0rH0fpfam9uTbuEeEOx5GLGr210ggOV77mVRNoeqSYqeuaqSzVSw==", "requires": { "@babel/helper-plugin-utils": "^7.0.0" } @@ -577,27 +651,37 @@ } }, "@babel/plugin-transform-parameters": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.4.0.tgz", - "integrity": "sha512-Xqv6d1X+doyiuCGDoVJFtlZx0onAX0tnc3dY8w71pv/O0dODAbusVv2Ale3cGOwfiyi895ivOBhYa9DhAM8dUA==", + "version": "7.3.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.3.3.tgz", + "integrity": "sha512-IrIP25VvXWu/VlBWTpsjGptpomtIkYrN/3aDp4UKm7xK6UxZY88kcJ1UwETbzHAlwN21MnNfwlar0u8y3KpiXw==", "requires": { - "@babel/helper-call-delegate": "^7.4.0", + "@babel/helper-call-delegate": "^7.1.0", "@babel/helper-get-function-arity": "^7.0.0", "@babel/helper-plugin-utils": "^7.0.0" } }, "@babel/plugin-transform-regenerator": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.4.0.tgz", - "integrity": "sha512-SZ+CgL4F0wm4npojPU6swo/cK4FcbLgxLd4cWpHaNXY/NJ2dpahODCqBbAwb2rDmVszVb3SSjnk9/vik3AYdBw==", + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.3.4.tgz", + "integrity": "sha512-hvJg8EReQvXT6G9H2MvNPXkv9zK36Vxa1+csAVTpE1J3j0zlHplw76uudEbJxgvqZzAq9Yh45FLD4pk5mKRFQA==", "requires": { "regenerator-transform": "^0.13.4" + }, + "dependencies": { + "regenerator-transform": { + "version": "0.13.4", + "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.13.4.tgz", + "integrity": "sha512-T0QMBjK3J0MtxjPmdIMXm72Wvj2Abb0Bd4HADdfijwMdoIsyQZ6fWC7kDFhk2YinBBEMZDL7Y7wh0J1sGx3S4A==", + "requires": { + "private": "^0.1.6" + } + } } }, "@babel/plugin-transform-runtime": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.4.0.tgz", - "integrity": "sha512-1uv2h9wnRj98XX3g0l4q+O3jFM6HfayKup7aIu4pnnlzGz0H+cYckGBC74FZIWJXJSXAmeJ9Yu5Gg2RQpS4hWg==", + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.3.4.tgz", + "integrity": "sha512-PaoARuztAdd5MgeVjAxnIDAIUet5KpogqaefQvPOmPYCxYoaPhautxDh3aO8a4xHsKgT/b9gSxR0BKK1MIewPA==", "requires": { "@babel/helper-module-imports": "^7.0.0", "@babel/helper-plugin-utils": "^7.0.0", @@ -655,89 +739,155 @@ "@babel/helper-plugin-utils": "^7.0.0", "@babel/helper-regex": "^7.0.0", "regexpu-core": "^4.1.3" + }, + "dependencies": { + "jsesc": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=" + }, + "regexpu-core": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.5.4.tgz", + "integrity": "sha512-BtizvGtFQKGPUcTy56o3nk1bGRp4SZOTYrDtGNlqCQufptV5IkkLN6Emw+yunAJjzf+C9FQFtvq7IoA3+oMYHQ==", + "requires": { + "regenerate": "^1.4.0", + "regenerate-unicode-properties": "^8.0.2", + "regjsgen": "^0.5.0", + "regjsparser": "^0.6.0", + "unicode-match-property-ecmascript": "^1.0.4", + "unicode-match-property-value-ecmascript": "^1.1.0" + } + }, + "regjsgen": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.5.0.tgz", + "integrity": "sha512-RnIrLhrXCX5ow/E5/Mh2O4e/oa1/jW0eaBKTSy3LaCj+M3Bqvm97GWDp2yUtzIs4LEn65zR2yiYGFqb2ApnzDA==" + }, + "regjsparser": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.0.tgz", + "integrity": "sha512-RQ7YyokLiQBomUJuUG8iGVvkgOLxwyZM8k6d3q5SAXpg4r5TZJZigKFvC6PpD+qQ98bCDC5YelPeA3EucDoNeQ==", + "requires": { + "jsesc": "~0.5.0" + } + } + } + }, + "@babel/polyfill": { + "version": "7.2.5", + "resolved": "https://registry.npmjs.org/@babel/polyfill/-/polyfill-7.2.5.tgz", + "integrity": "sha512-8Y/t3MWThtMLYr0YNC/Q76tqN1w30+b0uQMeFUYauG2UGTR19zyUtFrAzT23zNtBxPp+LbE5E/nwV/q/r3y6ug==", + "requires": { + "core-js": "^2.5.7", + "regenerator-runtime": "^0.12.0" + }, + "dependencies": { + "regenerator-runtime": { + "version": "0.12.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.12.1.tgz", + "integrity": "sha512-odxIc1/vDlo4iZcfXqRYFj0vpXFNoGdKMAUieAlFYO6m/nl5e9KR/beGf41z4a1FI+aQgtjhuaSlDxQ0hmkrHg==" + } } }, "@babel/preset-env": { - "version": "7.4.2", - "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.4.2.tgz", - "integrity": "sha512-OEz6VOZaI9LW08CWVS3d9g/0jZA6YCn1gsKIy/fut7yZCJti5Lm1/Hi+uo/U+ODm7g4I6gULrCP+/+laT8xAsA==", + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.3.4.tgz", + "integrity": "sha512-2mwqfYMK8weA0g0uBKOt4FE3iEodiHy9/CW0b+nWXcbL+pGzLx8ESYc+j9IIxr6LTDHWKgPm71i9smo02bw+gA==", "requires": { "@babel/helper-module-imports": "^7.0.0", "@babel/helper-plugin-utils": "^7.0.0", "@babel/plugin-proposal-async-generator-functions": "^7.2.0", "@babel/plugin-proposal-json-strings": "^7.2.0", - "@babel/plugin-proposal-object-rest-spread": "^7.4.0", + "@babel/plugin-proposal-object-rest-spread": "^7.3.4", "@babel/plugin-proposal-optional-catch-binding": "^7.2.0", - "@babel/plugin-proposal-unicode-property-regex": "^7.4.0", + "@babel/plugin-proposal-unicode-property-regex": "^7.2.0", "@babel/plugin-syntax-async-generators": "^7.2.0", "@babel/plugin-syntax-json-strings": "^7.2.0", "@babel/plugin-syntax-object-rest-spread": "^7.2.0", "@babel/plugin-syntax-optional-catch-binding": "^7.2.0", "@babel/plugin-transform-arrow-functions": "^7.2.0", - "@babel/plugin-transform-async-to-generator": "^7.4.0", + "@babel/plugin-transform-async-to-generator": "^7.3.4", "@babel/plugin-transform-block-scoped-functions": "^7.2.0", - "@babel/plugin-transform-block-scoping": "^7.4.0", - "@babel/plugin-transform-classes": "^7.4.0", + "@babel/plugin-transform-block-scoping": "^7.3.4", + "@babel/plugin-transform-classes": "^7.3.4", "@babel/plugin-transform-computed-properties": "^7.2.0", - "@babel/plugin-transform-destructuring": "^7.4.0", + "@babel/plugin-transform-destructuring": "^7.2.0", "@babel/plugin-transform-dotall-regex": "^7.2.0", "@babel/plugin-transform-duplicate-keys": "^7.2.0", "@babel/plugin-transform-exponentiation-operator": "^7.2.0", - "@babel/plugin-transform-for-of": "^7.4.0", + "@babel/plugin-transform-for-of": "^7.2.0", "@babel/plugin-transform-function-name": "^7.2.0", "@babel/plugin-transform-literals": "^7.2.0", "@babel/plugin-transform-modules-amd": "^7.2.0", - "@babel/plugin-transform-modules-commonjs": "^7.4.0", - "@babel/plugin-transform-modules-systemjs": "^7.4.0", + "@babel/plugin-transform-modules-commonjs": "^7.2.0", + "@babel/plugin-transform-modules-systemjs": "^7.3.4", "@babel/plugin-transform-modules-umd": "^7.2.0", - "@babel/plugin-transform-named-capturing-groups-regex": "^7.4.2", - "@babel/plugin-transform-new-target": "^7.4.0", + "@babel/plugin-transform-named-capturing-groups-regex": "^7.3.0", + "@babel/plugin-transform-new-target": "^7.0.0", "@babel/plugin-transform-object-super": "^7.2.0", - "@babel/plugin-transform-parameters": "^7.4.0", - "@babel/plugin-transform-regenerator": "^7.4.0", + "@babel/plugin-transform-parameters": "^7.2.0", + "@babel/plugin-transform-regenerator": "^7.3.4", "@babel/plugin-transform-shorthand-properties": "^7.2.0", "@babel/plugin-transform-spread": "^7.2.0", "@babel/plugin-transform-sticky-regex": "^7.2.0", "@babel/plugin-transform-template-literals": "^7.2.0", "@babel/plugin-transform-typeof-symbol": "^7.2.0", "@babel/plugin-transform-unicode-regex": "^7.2.0", - "@babel/types": "^7.4.0", - "browserslist": "^4.4.2", - "core-js-compat": "^3.0.0", + "browserslist": "^4.3.4", "invariant": "^2.2.2", "js-levenshtein": "^1.1.3", "semver": "^5.3.0" + }, + "dependencies": { + "browserslist": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.4.2.tgz", + "integrity": "sha512-ISS/AIAiHERJ3d45Fz0AVYKkgcy+F/eJHzKEvv1j0wwKGKD9T3BrwKr/5g45L+Y4XIK5PlTqefHciRFcfE1Jxg==", + "requires": { + "caniuse-lite": "^1.0.30000939", + "electron-to-chromium": "^1.3.113", + "node-releases": "^1.1.8" + } + } } }, "@babel/runtime": { - "version": "7.4.2", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.4.2.tgz", - "integrity": "sha512-7Bl2rALb7HpvXFL7TETNzKSAeBVCPHELzc0C//9FCxN8nsiueWSJBqaF+2oIJScyILStASR/Cx5WMkXGYTiJFA==", + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.3.4.tgz", + "integrity": "sha512-IvfvnMdSaLBateu0jfsYIpZTxAc2cKEXEMiezGGN75QcBcecDUKd3PgLAncT0oOgxKy8dd8hrJKj9MfzgfZd6g==", "requires": { - "regenerator-runtime": "^0.13.2" + "regenerator-runtime": "^0.12.0" + }, + "dependencies": { + "regenerator-runtime": { + "version": "0.12.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.12.1.tgz", + "integrity": "sha512-odxIc1/vDlo4iZcfXqRYFj0vpXFNoGdKMAUieAlFYO6m/nl5e9KR/beGf41z4a1FI+aQgtjhuaSlDxQ0hmkrHg==" + } } }, "@babel/template": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.4.0.tgz", - "integrity": "sha512-SOWwxxClTTh5NdbbYZ0BmaBVzxzTh2tO/TeLTbF6MO6EzVhHTnff8CdBXx3mEtazFBoysmEM6GU/wF+SuSx4Fw==", + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.2.2.tgz", + "integrity": "sha512-zRL0IMM02AUDwghf5LMSSDEz7sBCO2YnNmpg3uWTZj/v1rcG2BmQUvaGU8GhU8BvfMh1k2KIAYZ7Ji9KXPUg7g==", "requires": { "@babel/code-frame": "^7.0.0", - "@babel/parser": "^7.4.0", - "@babel/types": "^7.4.0" + "@babel/parser": "^7.2.2", + "@babel/types": "^7.2.2" } }, "@babel/traverse": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.4.0.tgz", - "integrity": "sha512-/DtIHKfyg2bBKnIN+BItaIlEg5pjAnzHOIQe5w+rHAw/rg9g0V7T4rqPX8BJPfW11kt3koyjAnTNwCzb28Y1PA==", + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.3.4.tgz", + "integrity": "sha512-TvTHKp6471OYEcE/91uWmhR6PrrYywQntCHSaZ8CM8Vmp+pjAusal4nGB2WCCQd0rvI7nOMKn9GnbcvTUz3/ZQ==", "requires": { "@babel/code-frame": "^7.0.0", - "@babel/generator": "^7.4.0", + "@babel/generator": "^7.3.4", "@babel/helper-function-name": "^7.1.0", - "@babel/helper-split-export-declaration": "^7.4.0", - "@babel/parser": "^7.4.0", - "@babel/types": "^7.4.0", + "@babel/helper-split-export-declaration": "^7.0.0", + "@babel/parser": "^7.3.4", + "@babel/types": "^7.3.4", "debug": "^4.1.0", "globals": "^11.1.0", "lodash": "^4.17.11" @@ -754,9 +904,9 @@ } }, "@babel/types": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.4.0.tgz", - "integrity": "sha512-aPvkXyU2SPOnztlgo8n9cEiXW755mgyvueUPcpStqdzoSPm0fjO0vQBjLkt3JKJW7ufikfcnMTTPsN1xaTsBPA==", + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.3.4.tgz", + "integrity": "sha512-WEkp8MsLftM7O/ty580wAmZzN1nDmCACc5+jFzUt+GUFNNIi3LdRlueYz0YIlmJhlZx1QYDMZL5vdWCL0fNjFQ==", "requires": { "esutils": "^2.0.2", "lodash": "^4.17.11", @@ -830,47 +980,40 @@ "integrity": "sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw==" }, "@nuxt/babel-preset-app": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/@nuxt/babel-preset-app/-/babel-preset-app-2.5.1.tgz", - "integrity": "sha512-5LWXz5rtxrtEtghvdyaZ17Y6SnS/+8LQsfguJ7HYpljZkadZrQNs01AaLnnkpwvp9CejVNI0T8hslliw23ylvg==", + "version": "2.4.5", + "resolved": "https://registry.npmjs.org/@nuxt/babel-preset-app/-/babel-preset-app-2.4.5.tgz", + "integrity": "sha512-Pfpp9++AjTLSvr0EQY00SPacSxw6nvIgARVTiFG8xEkqzUzChx1xz424u4e8mKhu3qEgj9ldcF5iKC5A87RYkw==", "requires": { - "@babel/core": "^7.4.0", - "@babel/plugin-proposal-class-properties": "^7.4.0", - "@babel/plugin-proposal-decorators": "^7.4.0", + "@babel/core": "^7.2.2", + "@babel/plugin-proposal-class-properties": "^7.3.0", + "@babel/plugin-proposal-decorators": "^7.3.0", "@babel/plugin-syntax-dynamic-import": "^7.2.0", - "@babel/plugin-transform-runtime": "^7.4.0", - "@babel/preset-env": "^7.4.2", - "@babel/runtime": "^7.4.2", - "@vue/babel-preset-jsx": "^1.0.0-beta.2", - "core-js": "^2.6.5" + "@babel/plugin-transform-runtime": "^7.2.0", + "@babel/preset-env": "^7.3.1", + "@babel/runtime": "^7.3.1", + "@vue/babel-preset-jsx": "^1.0.0-beta.2" } }, "@nuxt/builder": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/@nuxt/builder/-/builder-2.5.1.tgz", - "integrity": "sha512-h/GT4qoyN7yHxY4JsIgmWpDf5lfpwTBszJaf4nu0AOJyGqMP8sbj5K8X6TzRVjKJeF1dcDNJFFeGJomSNJIFzA==", - "requires": { - "@nuxt/devalue": "^1.2.2", - "@nuxt/utils": "2.5.1", - "@nuxt/vue-app": "2.5.1", - "chokidar": "^2.1.2", - "consola": "^2.5.7", + "version": "2.4.5", + "resolved": "https://registry.npmjs.org/@nuxt/builder/-/builder-2.4.5.tgz", + "integrity": "sha512-WPgNmDK7UgInCNECl13u6tJ9woC8c1ToPXgEfqL0pTZWlztqOyGXMcXaQnI0n1QKsqQPWFUfNAtztAum7xZLpw==", + "requires": { + "@nuxt/devalue": "^1.2.0", + "@nuxt/utils": "2.4.5", + "@nuxt/vue-app": "2.4.5", + "chokidar": "^2.0.4", + "consola": "^2.3.2", "fs-extra": "^7.0.1", "glob": "^7.1.3", "hash-sum": "^1.0.2", - "ignore": "^5.0.6", "lodash": "^4.17.11", "pify": "^4.0.1", "semver": "^5.6.0", "serialize-javascript": "^1.6.1", - "upath": "^1.1.2" + "upath": "^1.1.0" }, "dependencies": { - "ignore": { - "version": "5.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.0.6.tgz", - "integrity": "sha512-/+hp3kUf/Csa32ktIaj0OlRqQxrgs30n62M90UBpNd9k+ENEch5S+hmbW3DtcJGz3sYFTh4F3A6fQ0q7KWsp4w==" - }, "pify": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", @@ -879,70 +1022,66 @@ } }, "@nuxt/cli": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/@nuxt/cli/-/cli-2.5.1.tgz", - "integrity": "sha512-BHe90Ove6mCV3XRyNmGWiYbXx0OT/moUu1+rR89PTOzBugmf1v/tH3tdUfeDKC/d3sa52fktjVcv9JEo6QIESw==", + "version": "2.4.5", + "resolved": "https://registry.npmjs.org/@nuxt/cli/-/cli-2.4.5.tgz", + "integrity": "sha512-mBrh8sZySEx4v6IqAgdq9aPY6JKl0m3BREt90anV8w+63YMmNHRFizGdWyEgq/6YUrCvuCua2RvJCZphBdnhFQ==", "requires": { - "@nuxt/config": "2.5.1", - "@nuxt/utils": "2.5.1", + "@nuxt/config": "2.4.5", "boxen": "^3.0.0", "chalk": "^2.4.2", - "consola": "^2.5.7", - "esm": "^3.2.20", + "consola": "^2.3.2", + "esm": "^3.2.3", "execa": "^1.0.0", "exit": "^0.1.2", "minimist": "^1.2.0", - "opener": "1.5.1", "pretty-bytes": "^5.1.0", "std-env": "^2.2.1", - "wrap-ansi": "^5.0.0" + "wrap-ansi": "^4.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==", + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" + "ansi-regex": "^3.0.0" } }, "wrap-ansi": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.0.0.tgz", - "integrity": "sha512-3ThemJUfTTju0SKG2gjGExzGRHxT5l/KEM5sff3TQReaVWe/bFTiF1GEr8DKr/j0LxGt8qPzx0yhd2RLyqgy2Q==", + "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==", "requires": { "ansi-styles": "^3.2.0", - "string-width": "^3.0.0", - "strip-ansi": "^5.0.0" + "string-width": "^2.1.1", + "strip-ansi": "^4.0.0" } } } }, "@nuxt/config": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/@nuxt/config/-/config-2.5.1.tgz", - "integrity": "sha512-v2Q24xzkrs5S9fmRrRFpjwHEFNPWYDZPL9xcgJDEKL9ngPnSJpo2NCrvH57thkGaAqWJF1KqCKGx7LZX1UmVVg==", + "version": "2.4.5", + "resolved": "https://registry.npmjs.org/@nuxt/config/-/config-2.4.5.tgz", + "integrity": "sha512-Yn1FqOVG7Si+clikYg5ILAxDWfTlweKULzZDtAZriWjQPg0D2sJ9VWV+mdggPQfyn+n4mvPvD4BEIyzvKVaXdg==", "requires": { - "@nuxt/utils": "2.5.1", - "consola": "^2.5.7", + "@nuxt/utils": "2.4.5", + "consola": "^2.3.2", "std-env": "^2.2.1" } }, "@nuxt/core": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/@nuxt/core/-/core-2.5.1.tgz", - "integrity": "sha512-BPGJDRG39utDwCZYbevichsQxsULYjsiOB5DcY80o4JcaDPh49WWfqqrPXgfbK2e2cNlpF6ng/+vGke03kS1Uw==", - "requires": { - "@nuxt/config": "2.5.1", - "@nuxt/devalue": "^1.2.2", - "@nuxt/server": "2.5.1", - "@nuxt/utils": "2.5.1", - "@nuxt/vue-renderer": "2.5.1", - "consola": "^2.5.7", + "version": "2.4.5", + "resolved": "https://registry.npmjs.org/@nuxt/core/-/core-2.4.5.tgz", + "integrity": "sha512-2hjyLRLmLMkG+9e1bhLmeU+ow4Ph5lPrArW8BPBNohO4Oxjzb/A3UUO6UhMMA24/9+qsBQT6rwsQ0WA66UCpJA==", + "requires": { + "@nuxt/config": "2.4.5", + "@nuxt/devalue": "^1.2.0", + "@nuxt/server": "2.4.5", + "@nuxt/utils": "2.4.5", + "@nuxt/vue-renderer": "2.4.5", + "consola": "^2.3.2", "debug": "^4.1.1", - "esm": "^3.2.20", + "esm": "^3.2.3", "fs-extra": "^7.0.1", "hash-sum": "^1.0.2", "std-env": "^2.2.1" @@ -959,9 +1098,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.1", + "resolved": "https://registry.npmjs.org/@nuxt/devalue/-/devalue-1.2.1.tgz", + "integrity": "sha512-lNhY8yo9rc/FME52sUyQcs07wjTQ4QS8geFgBI5R/Zg60rq7CruG54qi5Za1m+mVvrJvhW24Jyu0Sq3lwfe3cg==", "requires": { "consola": "^2.5.6" } @@ -978,38 +1117,17 @@ } }, "@nuxt/generator": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/@nuxt/generator/-/generator-2.5.1.tgz", - "integrity": "sha512-ao4qWJHnYmVjKjLYwFnZAaWSRFmMXaPk/poJ5mby+5mErynC+KNuN1MBDmSlv48lmR4XIJkMQ/B0UADrxBbMAA==", + "version": "2.4.5", + "resolved": "https://registry.npmjs.org/@nuxt/generator/-/generator-2.4.5.tgz", + "integrity": "sha512-DUi8BnoGiuBN1jVe3J8QZNR68IvD/xhE6fX3vgcBylaeKTL5kC7h+CBnQ2w30bFQpsdmjWcaitTzdklvrm44Tg==", "requires": { - "@nuxt/utils": "2.5.1", + "@nuxt/utils": "2.4.5", "chalk": "^2.4.2", - "consola": "^2.5.7", + "consola": "^2.3.2", "fs-extra": "^7.0.1", "html-minifier": "^3.5.21" } }, - "@nuxt/loading-screen": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/@nuxt/loading-screen/-/loading-screen-0.1.2.tgz", - "integrity": "sha512-IsSySwZ5nHF34RUdsTEElvx/dLP8uBDTek1xL5vuqgBL+4hsanbBPMhz2B9XSkCLM0wrqKORaZAfY1ZYXmHajA==", - "requires": { - "connect": "^3.6.6", - "fs-extra": "^7.0.1", - "serve-static": "^1.13.2", - "ws": "^6.2.0" - }, - "dependencies": { - "ws": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.0.tgz", - "integrity": "sha512-deZYUNlt2O4buFCa3t5bKLf8A7FPP/TVjwOeVNpw818Ma5nk4MLXls2eoEGS39o8119QIYxTrTDoPQ5B/gTD6w==", - "requires": { - "async-limiter": "~1.0.0" - } - } - } - }, "@nuxt/opencollective": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/@nuxt/opencollective/-/opencollective-0.2.1.tgz", @@ -1021,26 +1139,26 @@ } }, "@nuxt/server": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/@nuxt/server/-/server-2.5.1.tgz", - "integrity": "sha512-pTNSkrF86aTvt9+WmQhrQQsddG89sa98vBDV4vTqnCvnfzZm8hHIwD6Aw6zaF3aFR0aUTJTc4K8+0qYhjdW+ug==", + "version": "2.4.5", + "resolved": "https://registry.npmjs.org/@nuxt/server/-/server-2.4.5.tgz", + "integrity": "sha512-bJAA53xS5JV80mGjVcZRffU2FA/qL6diLyMAykO9MdTB8OOo6onLssWXH0Rl/89uWfs+z4iVXUpZsv9nMdhL0w==", "requires": { - "@nuxt/config": "2.5.1", - "@nuxt/utils": "2.5.1", + "@nuxt/config": "2.4.5", + "@nuxt/utils": "2.4.5", "@nuxtjs/youch": "^4.2.3", "chalk": "^2.4.2", - "compression": "^1.7.4", + "compression": "^1.7.3", "connect": "^3.6.6", - "consola": "^2.5.7", + "consola": "^2.3.2", "etag": "^1.8.1", "fresh": "^0.5.2", "fs-extra": "^7.0.1", "ip": "^1.1.5", "launch-editor-middleware": "^2.2.1", - "on-headers": "^1.0.2", + "on-headers": "^1.0.1", "pify": "^4.0.1", "semver": "^5.6.0", - "serve-placeholder": "^1.2.1", + "serve-placeholder": "^1.1.1", "serve-static": "^1.13.2", "server-destroy": "^1.0.1", "ua-parser-js": "^0.7.19" @@ -1054,46 +1172,40 @@ } }, "@nuxt/utils": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/@nuxt/utils/-/utils-2.5.1.tgz", - "integrity": "sha512-hrpHh8fF6ir4lDXAGhl5AGF7puJEkAipnvLNGAtdbtMVPEBvSNIyynKf93ECgFpxbUU2+npmx/V1LibaiMRQog==", + "version": "2.4.5", + "resolved": "https://registry.npmjs.org/@nuxt/utils/-/utils-2.4.5.tgz", + "integrity": "sha512-/FLBP1KFwBKIaq7ht7YBrhdHG9l1uSg2B3egZdVoVLbK+Uj10uZ+XeaU+IIpC4S+hLc1FY3WTjdCb2GHp91oIw==", "requires": { - "consola": "^2.5.7", - "fs-extra": "^7.0.1", - "hash-sum": "^1.0.2", - "proper-lockfile": "^4.1.0", - "serialize-javascript": "^1.6.1", - "signal-exit": "^3.0.2" + "consola": "^2.3.2", + "serialize-javascript": "^1.6.1" } }, "@nuxt/vue-app": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/@nuxt/vue-app/-/vue-app-2.5.1.tgz", - "integrity": "sha512-gbtYQTNP0n+vZF2ISM5NJvxG09qUN2OEZ1z1qqQqRygRtbz8NSbh1EaB2UT1lUjTpZBAFuwuez3GAqTkZVXZSQ==", + "version": "2.4.5", + "resolved": "https://registry.npmjs.org/@nuxt/vue-app/-/vue-app-2.4.5.tgz", + "integrity": "sha512-dtcT7KDrZEAc3imCc+JEeJ4Lqgbf5ZfjKLXjzUCj3tk16OG7wR4H4bKcDLcHv63S+DTHuCaYOtzcHn44p6jTCQ==", "requires": { - "node-fetch": "^2.3.0", - "unfetch": "^4.1.0", - "vue": "^2.6.10", + "vue": "^2.5.22", "vue-meta": "^1.5.8", "vue-no-ssr": "^1.1.1", "vue-router": "^3.0.2", - "vue-template-compiler": "^2.6.10", + "vue-template-compiler": "^2.5.22", "vuex": "^3.1.0" } }, "@nuxt/vue-renderer": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/@nuxt/vue-renderer/-/vue-renderer-2.5.1.tgz", - "integrity": "sha512-XQfXMVT1wla+ugwKITqIvQryBcfPxZGvhWcv2uCOu1yQexUrjvr+jDvY3MWagJ/YnErRoIWof0RHHhiE/yfy5g==", + "version": "2.4.5", + "resolved": "https://registry.npmjs.org/@nuxt/vue-renderer/-/vue-renderer-2.4.5.tgz", + "integrity": "sha512-NsS0ZHV/HEWAbzOBXiwbhcdb1KJFj8ucma+gnbfw/rIh5hgufqAxs4btt3U0ma/i3Bm0nQo+doZAWtl/HJX6mQ==", "requires": { - "@nuxt/devalue": "^1.2.2", - "@nuxt/utils": "2.5.1", - "consola": "^2.5.7", + "@nuxt/devalue": "^1.2.0", + "@nuxt/utils": "2.4.5", + "consola": "^2.3.2", "fs-extra": "^7.0.1", "lru-cache": "^5.1.1", - "vue": "^2.6.10", + "vue": "^2.5.22", "vue-meta": "^1.5.8", - "vue-server-renderer": "^2.6.10" + "vue-server-renderer": "^2.5.22" }, "dependencies": { "lru-cache": { @@ -1112,23 +1224,24 @@ } }, "@nuxt/webpack": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/@nuxt/webpack/-/webpack-2.5.1.tgz", - "integrity": "sha512-FjAzphxBQKAtwJLNJhUynD/qOq2LxfuXUr2GRlvaBg8N0GSV33tCeMRirwdBGU7QgKNBIIEA7XXOTWbe0/wc5Q==", + "version": "2.4.5", + "resolved": "https://registry.npmjs.org/@nuxt/webpack/-/webpack-2.4.5.tgz", + "integrity": "sha512-UXC9Yw4PMIBDqGR9eB11G6v7YpahgJq4llz4ybDnWMVxOJR+yAOw5jD+8AGSBDDo/apSJ/LgzJX2TIOtopx+LA==", "requires": { - "@babel/core": "^7.4.0", - "@nuxt/babel-preset-app": "2.5.1", + "@babel/core": "^7.2.2", + "@babel/polyfill": "^7.2.5", + "@nuxt/babel-preset-app": "2.4.5", "@nuxt/friendly-errors-webpack-plugin": "^2.4.0", - "@nuxt/utils": "2.5.1", + "@nuxt/utils": "2.4.5", "babel-loader": "^8.0.5", "cache-loader": "^2.0.1", - "caniuse-lite": "^1.0.30000951", + "caniuse-lite": "^1.0.30000932", "chalk": "^2.4.2", - "consola": "^2.5.7", - "css-loader": "^2.1.1", - "cssnano": "^4.1.10", + "consola": "^2.3.2", + "css-loader": "^2.1.0", + "cssnano": "^4.1.8", "eventsource-polyfill": "^0.9.6", - "extract-css-chunks-webpack-plugin": "^4.0.1", + "extract-css-chunks-webpack-plugin": "^3.3.2", "file-loader": "^3.0.1", "fs-extra": "^7.0.1", "glob": "^7.1.3", @@ -1142,18 +1255,18 @@ "postcss-import": "^12.0.1", "postcss-import-resolver": "^1.1.0", "postcss-loader": "^3.0.0", - "postcss-preset-env": "^6.6.0", + "postcss-preset-env": "^6.5.0", "postcss-url": "^8.0.0", "std-env": "^2.2.1", "style-resources-loader": "^1.2.1", - "terser-webpack-plugin": "^1.2.3", + "terser-webpack-plugin": "^1.2.2", "thread-loader": "^1.2.0", "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-dev-middleware": "^3.6.1", + "vue-loader": "^15.6.2", + "webpack": "^4.29.2", + "webpack-bundle-analyzer": "^3.0.3", + "webpack-dev-middleware": "^3.5.1", "webpack-hot-middleware": "^2.24.3", "webpack-node-externals": "^1.7.2", "webpackbar": "^3.1.5" @@ -1451,6 +1564,66 @@ "typescript": "^3.1.1" } }, + "@rush-temp/wanchain-asset-ledger": { + "version": "file:projects/wanchain-asset-ledger.tgz", + "integrity": "sha512-FuRM5xg6vuaHDbDHK+iOcAsH05xDlXnH9mRS88B1E6NjdWdFx/mjFtWszFqAXdIGlrgyqc8vEwbcsJz4I6OXIg==", + "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-wnEE8cG6I6DHrLMLewchpYObvkP/rFue8fdFwhP8ZUnULu8vY8RJJ2eFtZZp07UHhiocf+Fc2jK1ggTgOJtz9A==", + "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-bDUh1xW2kdSlHXV/5EpGkOnOwrrqHDu2Ff8P/UjGxe6dQ0Lp4wzcS+irgRc/8hh1j4QJ8GMpQT1ogDPTDF1MTA==", + "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-0S+ck6CmLPQgzBHxPA5UBdiXjui2V3hFdnKUo2NpecyA8f6rbPPXs2Enr2pz0GuE2CkyypPxHsWlA2euRMDvTg==", + "requires": { + "@0xcert/ethereum-utils": "1.2.0", + "@hayspec/cli": "^0.8.3", + "@hayspec/spec": "^0.8.3", + "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-ApG/hEPBAbP9BQlfEaAwCn6ThAnTStARwAKExBH1CJuHFcIngwRSm6shDI+2eQNe8tiZLVG6mw0UbPKAOoF0Bg==", + "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-WbYOYueghl4Hv+QiV5HJgCY3LgG7B+Z63HkRHwuvgoXiXK6mvlnjxXmNqgDPlDYseMolvr4xMbAQEMd9l6xiHA==", @@ -1572,82 +1745,82 @@ } }, "@types/node": { - "version": "10.14.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.14.2.tgz", - "integrity": "sha512-Y1kCfTShKcJH4CsG5+m5RMA+0tQKa8TrxyMczy0zE8QeDKbuOAJMF8JRM5ouCFyakaSoAhhgy2beCSKLVz+daw==" + "version": "10.14.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.14.1.tgz", + "integrity": "sha512-Rymt08vh1GaW4vYB6QP61/5m/CFLGnFZP++bJpWbiNxceNa6RBipDmb413jvtSf/R1gg5a/jQVl2jY4XVRscEA==" }, "@types/q": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/@types/q/-/q-1.5.2.tgz", - "integrity": "sha512-ce5d3q03Ex0sy4R14722Rmt6MT07Ua+k4FwDfdcToYJcMKNtRVQvJ6JCAPdAmAnbRb6CsX6aYb9m96NGod9uTw==" + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/@types/q/-/q-1.5.1.tgz", + "integrity": "sha512-eqz8c/0kwNi/OEHQfvIuJVLTst3in0e7uTKeuY+WL/zfKn0xVujOTp42bS/vUUokhK5P2BppLd9JXMOMHcgbjA==" }, "@vue/babel-helper-vue-jsx-merge-props": { - "version": "1.0.0-beta.3", - "resolved": "https://registry.npmjs.org/@vue/babel-helper-vue-jsx-merge-props/-/babel-helper-vue-jsx-merge-props-1.0.0-beta.3.tgz", - "integrity": "sha512-cbFQnd3dDPsfWuxbWW2phynX2zsckwC4GfAkcE1QH1lZL2ZAD2V97xY3BmvTowMkjeFObRKQt1P3KKA6AoB0hQ==" + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/@vue/babel-helper-vue-jsx-merge-props/-/babel-helper-vue-jsx-merge-props-1.0.0-beta.2.tgz", + "integrity": "sha512-Yj92Q1GcGjjctecBfnBmVqKSlMdyZaVq10hlZB4HSd1DJgu4cWgpEImJSzcJRUCZmas6UigwE7f4IjJuQs+JvQ==" }, "@vue/babel-plugin-transform-vue-jsx": { - "version": "1.0.0-beta.3", - "resolved": "https://registry.npmjs.org/@vue/babel-plugin-transform-vue-jsx/-/babel-plugin-transform-vue-jsx-1.0.0-beta.3.tgz", - "integrity": "sha512-yn+j2B/2aEagaxXrMSK3qcAJnlidfXg9v+qmytqrjUXc4zfi8QVC/b4zCev1FDmTip06/cs/csENA4law6Xhpg==", + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/@vue/babel-plugin-transform-vue-jsx/-/babel-plugin-transform-vue-jsx-1.0.0-beta.2.tgz", + "integrity": "sha512-fvAymRZAPHitomRE+jIipWRj0STXNSMqeOSdOFu9Ffjqg9WGOxSdCjORxexManfZ2y5QDv7gzI1xfgprsK3nlw==", "requires": { "@babel/helper-module-imports": "^7.0.0", "@babel/plugin-syntax-jsx": "^7.2.0", - "@vue/babel-helper-vue-jsx-merge-props": "^1.0.0-beta.3", + "@vue/babel-helper-vue-jsx-merge-props": "^1.0.0-beta.2", "html-tags": "^2.0.0", "lodash.kebabcase": "^4.1.1", "svg-tags": "^1.0.0" } }, "@vue/babel-preset-jsx": { - "version": "1.0.0-beta.3", - "resolved": "https://registry.npmjs.org/@vue/babel-preset-jsx/-/babel-preset-jsx-1.0.0-beta.3.tgz", - "integrity": "sha512-qMKGRorTI/0nE83nLEM7MyQiBZUqc62sZyjkBdVaaU7S61MHI8RKHPtbLMMZlWXb2NCJ0fQci8xJWUK5JE+TFA==", + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/@vue/babel-preset-jsx/-/babel-preset-jsx-1.0.0-beta.2.tgz", + "integrity": "sha512-nZoAKBR/h6iPMQ66ieQcIdlpPBmqhtUUcgjBS541jIVxSog1rwzrc00jlsuecLonzUMWPU0PabyitsG74vhN1w==", "requires": { - "@vue/babel-helper-vue-jsx-merge-props": "^1.0.0-beta.3", - "@vue/babel-plugin-transform-vue-jsx": "^1.0.0-beta.3", - "@vue/babel-sugar-functional-vue": "^1.0.0-beta.3", - "@vue/babel-sugar-inject-h": "^1.0.0-beta.3", - "@vue/babel-sugar-v-model": "^1.0.0-beta.3", - "@vue/babel-sugar-v-on": "^1.0.0-beta.3" + "@vue/babel-helper-vue-jsx-merge-props": "^1.0.0-beta.2", + "@vue/babel-plugin-transform-vue-jsx": "^1.0.0-beta.2", + "@vue/babel-sugar-functional-vue": "^1.0.0-beta.2", + "@vue/babel-sugar-inject-h": "^1.0.0-beta.2", + "@vue/babel-sugar-v-model": "^1.0.0-beta.2", + "@vue/babel-sugar-v-on": "^1.0.0-beta.2" } }, "@vue/babel-sugar-functional-vue": { - "version": "1.0.0-beta.3", - "resolved": "https://registry.npmjs.org/@vue/babel-sugar-functional-vue/-/babel-sugar-functional-vue-1.0.0-beta.3.tgz", - "integrity": "sha512-CBIa0sQWn3vfBS2asfTgv0WwdyKvNTKtE/cCfulZ7MiewLBh0RlvvSmdK9BIMTiHErdeZNSGUGlU6JuSHLyYkQ==", + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/@vue/babel-sugar-functional-vue/-/babel-sugar-functional-vue-1.0.0-beta.2.tgz", + "integrity": "sha512-5qvi4hmExgjtrESDk0vflL69dIxkDAukJcYH9o4663E8Nh12Jpbmr+Ja8WmgkAPtTVhk90UVcVUFCCZLHBmhkQ==", "requires": { "@babel/plugin-syntax-jsx": "^7.2.0" } }, "@vue/babel-sugar-inject-h": { - "version": "1.0.0-beta.3", - "resolved": "https://registry.npmjs.org/@vue/babel-sugar-inject-h/-/babel-sugar-inject-h-1.0.0-beta.3.tgz", - "integrity": "sha512-HKMBMmFfdK9GBp3rX2bHIwILBdgc5F3ahmCB72keJxzaAQrgDAnD+ho70exUge+inAGlNF34WsQcGPElTf9QZg==", + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/@vue/babel-sugar-inject-h/-/babel-sugar-inject-h-1.0.0-beta.2.tgz", + "integrity": "sha512-qGXZ6yE+1trk82xCVJ9j3shsgI+R2ePj3+o8b2Ee7JNaRqQvMfTwpgx5BRlk4q1+CTjvYexdqBS+q4Kg7sSxcg==", "requires": { "@babel/plugin-syntax-jsx": "^7.2.0" } }, "@vue/babel-sugar-v-model": { - "version": "1.0.0-beta.3", - "resolved": "https://registry.npmjs.org/@vue/babel-sugar-v-model/-/babel-sugar-v-model-1.0.0-beta.3.tgz", - "integrity": "sha512-et39eTEh7zW4wfZoSl9Jf0/n2r9OTT8U02LtSbXsjgYcqaDQFusN0+n7tw4bnOqvnnSVjEp7bVsQCWwykC3Wgg==", + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/@vue/babel-sugar-v-model/-/babel-sugar-v-model-1.0.0-beta.2.tgz", + "integrity": "sha512-63US3IMEtATJzzK2le/Na53Sk2bp3LHfwZ8eMFwbTaz6e2qeV9frBl3ZYaha64ghT4IDSbrDXUmm0J09EAzFfA==", "requires": { "@babel/plugin-syntax-jsx": "^7.2.0", - "@vue/babel-helper-vue-jsx-merge-props": "^1.0.0-beta.3", - "@vue/babel-plugin-transform-vue-jsx": "^1.0.0-beta.3", + "@vue/babel-helper-vue-jsx-merge-props": "^1.0.0-beta.2", + "@vue/babel-plugin-transform-vue-jsx": "^1.0.0-beta.2", "camelcase": "^5.0.0", "html-tags": "^2.0.0", "svg-tags": "^1.0.0" } }, "@vue/babel-sugar-v-on": { - "version": "1.0.0-beta.3", - "resolved": "https://registry.npmjs.org/@vue/babel-sugar-v-on/-/babel-sugar-v-on-1.0.0-beta.3.tgz", - "integrity": "sha512-F+GapxCiy50jf2Q2B4exw+KYBzlGdeKMAMW1Dbvb0Oa59SA0CH6tsUOIAsXb0A05jwwg/of0LaVeo+4aLefVxQ==", + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/@vue/babel-sugar-v-on/-/babel-sugar-v-on-1.0.0-beta.2.tgz", + "integrity": "sha512-XH/m3k11EKdMY0MrTg4+hQv8BFM8juzHT95chYkgxDmvDdVJnSCuf9+mcysEJttWD4PVuUGN7EHoIWsIhC0dRw==", "requires": { "@babel/plugin-syntax-jsx": "^7.2.0", - "@vue/babel-plugin-transform-vue-jsx": "^1.0.0-beta.3", + "@vue/babel-plugin-transform-vue-jsx": "^1.0.0-beta.2", "camelcase": "^5.0.0" } }, @@ -1682,11 +1855,6 @@ "uniq": "^1.0.1" } }, - "prettier": { - "version": "1.16.3", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.16.3.tgz", - "integrity": "sha512-kn/GU6SMRYPxUakNXhpP0EedT/KmaPzr0H5lIsDogrykbaxOpOfAFfk5XA7DZrJyMAv1wlMV3CPcZruGXVVUZw==" - }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -2122,9 +2290,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.1", + "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz", + "integrity": "sha1-GdOGodntxufByF04iu28xW0zYC0=" }, "async-limiter": { "version": "1.0.0", @@ -2142,16 +2310,28 @@ "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==" }, "autoprefixer": { - "version": "9.5.0", - "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-9.5.0.tgz", - "integrity": "sha512-hMKcyHsZn5+qL6AUeP3c8OyuteZ4VaUlg+fWbyl8z7PqsKHF/Bf8/px3K6AT8aMzDkBo8Bc11245MM+itDBOxQ==", + "version": "9.4.10", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-9.4.10.tgz", + "integrity": "sha512-XR8XZ09tUrrSzgSlys4+hy5r2/z4Jp7Ag3pHm31U4g/CTccYPOVe19AkaJ4ey/vRd1sfj+5TtuD6I0PXtutjvQ==", "requires": { "browserslist": "^4.4.2", - "caniuse-lite": "^1.0.30000947", + "caniuse-lite": "^1.0.30000940", "normalize-range": "^0.1.2", "num2fraction": "^1.2.2", "postcss": "^7.0.14", "postcss-value-parser": "^3.3.1" + }, + "dependencies": { + "browserslist": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.4.2.tgz", + "integrity": "sha512-ISS/AIAiHERJ3d45Fz0AVYKkgcy+F/eJHzKEvv1j0wwKGKD9T3BrwKr/5g45L+Y4XIK5PlTqefHciRFcfE1Jxg==", + "requires": { + "caniuse-lite": "^1.0.30000939", + "electron-to-chromium": "^1.3.113", + "node-releases": "^1.1.8" + } + } } }, "aws-sign2": { @@ -2543,16 +2723,6 @@ "pako": "~1.0.5" } }, - "browserslist": { - "version": "4.5.2", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.5.2.tgz", - "integrity": "sha512-zmJVLiKLrzko0iszd/V4SsjTaomFeoVzQGYYOYgRgsbh7WNh95RgDB0CmBdFWYs/3MyFSt69NypjL/h3iaddKQ==", - "requires": { - "caniuse-lite": "^1.0.30000951", - "electron-to-chromium": "^1.3.116", - "node-releases": "^1.1.11" - } - }, "buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.2.1.tgz", @@ -2729,12 +2899,24 @@ "caniuse-lite": "^1.0.0", "lodash.memoize": "^4.1.2", "lodash.uniq": "^4.5.0" + }, + "dependencies": { + "browserslist": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.4.2.tgz", + "integrity": "sha512-ISS/AIAiHERJ3d45Fz0AVYKkgcy+F/eJHzKEvv1j0wwKGKD9T3BrwKr/5g45L+Y4XIK5PlTqefHciRFcfE1Jxg==", + "requires": { + "caniuse-lite": "^1.0.30000939", + "electron-to-chromium": "^1.3.113", + "node-releases": "^1.1.8" + } + } } }, "caniuse-lite": { - "version": "1.0.30000951", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000951.tgz", - "integrity": "sha512-eRhP+nQ6YUkIcNQ6hnvdhMkdc7n3zadog0KXNRxAZTT2kHjUb1yGn71OrPhSn8MOvlX97g5CR97kGVj8fMsXWg==" + "version": "1.0.30000946", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000946.tgz", + "integrity": "sha512-ZVXtMoZ3Mfq69Ikv587Av+5lwGVJsG98QKUucVmtFBf0tl1kOCfLQ5o6Z2zBNis4Mx3iuH77WxEUpdP6t7f2CQ==" }, "caseless": { "version": "0.12.0", @@ -2993,15 +3175,15 @@ } }, "compression": { - "version": "1.7.4", - "resolved": "https://registry.npmjs.org/compression/-/compression-1.7.4.tgz", - "integrity": "sha512-jaSIDzP9pZVS4ZfQ+TzvtiWhdpFhE2RDHz8QJkpX9SIpLq88VueF5jJw6t+6CUQcAoA6t+x89MLrWAqpfDE8iQ==", + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/compression/-/compression-1.7.3.tgz", + "integrity": "sha512-HSjyBG5N1Nnz7tF2+O7A9XUhyjru71/fwgNb7oIsEVHR0WShfs2tIS/EySLgiTe98aOK18YDlMXpzjCXY/n9mg==", "requires": { "accepts": "~1.3.5", "bytes": "3.0.0", - "compressible": "~2.0.16", + "compressible": "~2.0.14", "debug": "2.6.9", - "on-headers": "~1.0.2", + "on-headers": "~1.0.1", "safe-buffer": "5.1.2", "vary": "~1.1.2" }, @@ -3083,9 +3265,9 @@ } }, "consola": { - "version": "2.5.7", - "resolved": "https://registry.npmjs.org/consola/-/consola-2.5.7.tgz", - "integrity": "sha512-KZteEB71fuSoSDgJoYEo/dIvwofWMU/bI/n+wusLYHPp+c7KcxBGZ0P8CzTCko2Jp0xsrbLjmLuUo4jyIWa6vQ==" + "version": "2.5.6", + "resolved": "https://registry.npmjs.org/consola/-/consola-2.5.6.tgz", + "integrity": "sha512-DN0j6ewiNWkT09G3ZoyyzN3pSYrjxWcx49+mHu+oDI5dvW5vzmyuzYsqGS79+yQserH9ymJQbGzeqUejfssr8w==" }, "console-browserify": { "version": "1.1.0", @@ -3164,29 +3346,6 @@ "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.5.tgz", "integrity": "sha512-klh/kDpwX8hryYL14M9w/xei6vrv6sE8gTHDG7/T/+SEovB/G4ejwcfE/CBzO6Edsu+OETZMZ3wcX/EjUkrl5A==" }, - "core-js-compat": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.0.0.tgz", - "integrity": "sha512-W/Ppz34uUme3LmXWjMgFlYyGnbo1hd9JvA0LNQ4EmieqVjg2GPYbj3H6tcdP2QGPGWdRKUqZVbVKLNIFVs/HiA==", - "requires": { - "browserslist": "^4.5.1", - "core-js": "3.0.0", - "core-js-pure": "3.0.0", - "semver": "^5.6.0" - }, - "dependencies": { - "core-js": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.0.0.tgz", - "integrity": "sha512-WBmxlgH2122EzEJ6GH8o9L/FeoUKxxxZ6q6VUxoTlsE4EvbTWKJb447eyVxTEuq0LpXjlq/kCB2qgBvsYRkLvQ==" - } - } - }, - "core-js-pure": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.0.0.tgz", - "integrity": "sha512-yPiS3fQd842RZDgo/TAKGgS0f3p2nxssF1H65DIZvZv0Od5CygP8puHXn3IQiM/39VAvgCbdaMQpresrbGgt9g==" - }, "core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", @@ -3732,11 +3891,6 @@ "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz", "integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=" }, - "detect-indent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-5.0.0.tgz", - "integrity": "sha1-OHHMCmoALow+Wzz38zYmRnXwa50=" - }, "diff": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", @@ -3858,9 +4012,9 @@ "integrity": "sha512-0xy4A/twfrRCnkhfk8ErDi5DqdAsAqeGxht4xkCUrsvhhbQNs7E+4jV0CN7+NKIY0aHE72+XvqtBIXzD31ZbXQ==" }, "electron-to-chromium": { - "version": "1.3.119", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.119.tgz", - "integrity": "sha512-3mtqcAWa4HgG+Djh/oNXlPH0cOH6MmtwxN1nHSaReb9P0Vn51qYPqYwLeoSuAX9loU1wrOBhFbiX3CkeIxPfgg==" + "version": "1.3.115", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.115.tgz", + "integrity": "sha512-mN2qeapQWdi2B9uddxTZ4nl80y46hbyKY5Wt9Yjih+QZFQLdaujEDK4qJky35WhyxMzHF3ZY41Lgjd2BPDuBhg==" }, "elliptic": { "version": "6.4.1", @@ -4070,6 +4224,15 @@ "ms": "^2.1.1" } }, + "eslint-scope": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", + "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==", + "requires": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + } + }, "import-fresh": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.0.0.tgz", @@ -4095,9 +4258,9 @@ } }, "eslint-scope": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", - "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.2.tgz", + "integrity": "sha512-5q1+B/ogmHl8+paxtOKx38Z8LtWkVGuNt3+GQNErqwLl6ViNp/gdJGMCjZNxZ8j/VYjDNZ2Fo+eQc1TAVPIzbg==", "requires": { "esrecurse": "^4.1.0", "estraverse": "^4.1.1" @@ -4114,9 +4277,9 @@ "integrity": "sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ==" }, "esm": { - "version": "3.2.20", - "resolved": "https://registry.npmjs.org/esm/-/esm-3.2.20.tgz", - "integrity": "sha512-NA92qDA8C/qGX/xMinDGa3+cSPs4wQoFxskRrSnDo/9UloifhONFm4sl4G+JsyCqM007z2K+BfQlH5rMta4K1Q==" + "version": "3.2.16", + "resolved": "https://registry.npmjs.org/esm/-/esm-3.2.16.tgz", + "integrity": "sha512-iACZMQvYFc66Y7QC+vD3oGA/fFsPA/IQwewRJ3K0gbMV52E59pdko02kF2TfVdtp5aHO62PHxL6fxtHJmhm3NQ==" }, "espree": { "version": "5.0.1", @@ -4520,13 +4683,13 @@ } }, "extract-css-chunks-webpack-plugin": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/extract-css-chunks-webpack-plugin/-/extract-css-chunks-webpack-plugin-4.0.1.tgz", - "integrity": "sha512-axin0Qz65T4ZQl8FEGW1ZN31kwUJOO7CoiWv0aTupYjmmQdtr56qsW061MuLglzTNwDKTcSe7KbtuzMZ5uc3Cw==", + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/extract-css-chunks-webpack-plugin/-/extract-css-chunks-webpack-plugin-3.3.3.tgz", + "integrity": "sha512-4DYo3jna9ov81rdKtE1U2cirb3ERoWhHldzRxZWx3Q5i5Dm6U+mmfon7PmaKDuh6+xySVOqtlXrZyJY2V4tc+g==", "requires": { "loader-utils": "^1.1.0", "lodash": "^4.17.11", - "normalize-url": "^3.0.0", + "normalize-url": "^3.3.0", "schema-utils": "^1.0.0", "webpack-sources": "^1.1.0" } @@ -7364,24 +7527,8 @@ "version": "git+https://github.com/ethereumjs/ethereumjs-abi.git#d84a96796079c8595a0c78accd1e7709f2277215", "from": "git+https://github.com/ethereumjs/ethereumjs-abi.git", "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" - } - } + "bn.js": "^4.10.0", + "ethereumjs-util": "^5.0.0" } }, "ethereumjs-block": { @@ -11067,24 +11214,8 @@ "version": "git+https://github.com/ethereumjs/ethereumjs-abi.git#d84a96796079c8595a0c78accd1e7709f2277215", "from": "git+https://github.com/ethereumjs/ethereumjs-abi.git", "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" - } - } + "bn.js": "^4.10.0", + "ethereumjs-util": "^5.0.0" } }, "ethereumjs-block": { @@ -11754,11 +11885,6 @@ "resolved": "https://registry.npmjs.org/big.js/-/big.js-3.2.0.tgz", "integrity": "sha512-+hN/Zh2D08Mx65pZ/4g5bsmNiZUuChDiQfTUQ7qJr4/kuopCr88xZsAXv6mBoZEsUI4OuGHlX59qE94K2mMW8Q==" }, - "json5": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", - "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=" - }, "loader-utils": { "version": "0.2.17", "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-0.2.17.tgz", @@ -12311,9 +12437,9 @@ "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" }, "js-yaml": { - "version": "3.13.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.0.tgz", - "integrity": "sha512-pZZoSxcCYco+DIKBTimr67J6Hy+EYGZDY/HCWC+iAEA9h1ByhMXAIVUXMcMFpOCxQ/xjXmPI2MkDL5HRm5eFrQ==", + "version": "3.12.2", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.2.tgz", + "integrity": "sha512-QHn/Lh/7HhZ/Twc7vJYQTkjuCa0kaCcDcjK5Zlk2rvnUpy7DxMJ23+Jc2dcyvltwQVg1nygAVlB2oRDFHoRS5Q==", "requires": { "argparse": "^1.0.7", "esprima": "^4.0.0" @@ -12355,12 +12481,9 @@ "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" }, "json5": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.0.tgz", - "integrity": "sha512-8Mh9h6xViijj36g7Dxi+Y4S6hNGV96vcJZr/SrlHh1LR/pEn/8j/+qIBbs44YKl69Lrfctp4QD+AdWLTMqEZAQ==", - "requires": { - "minimist": "^1.2.0" - } + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", + "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=" }, "jsonfile": { "version": "4.0.0", @@ -12926,9 +13049,9 @@ } }, "nan": { - "version": "2.13.1", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.13.1.tgz", - "integrity": "sha512-I6YB/YEuDeUZMmhscXKxGgZlFnhsn5y0hgOZBadkzfTRrZBtJDZeg6eQf7PYMIEclwmorTKK8GztsyOUSVBREA==" + "version": "2.12.1", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.12.1.tgz", + "integrity": "sha512-JY7V6lRkStKcKTvHO5NVSQRv+RV+FIL5pvDoLiAtSL9pKlC5x9PKQcZDsq7m4FO4d57mkhC6Z+QhAh3Jdk5JFw==" }, "nano-json-stream-parser": { "version": "0.1.2", @@ -13054,9 +13177,9 @@ "integrity": "sha512-UdS4swXs85fCGWWf6t6DMGgpN/vnlKeSGEQ7hJcrs7PBFoxoKLmibc3QRb7fwiYsjdL7PX8iI/TMSlZ90dgHhQ==" }, "node-releases": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.11.tgz", - "integrity": "sha512-8v1j5KfP+s5WOTa1spNUAOfreajQPN12JXbRR0oDE+YrJBQCXBnNqUDj27EKpPLOoSiU3tKi3xGPB+JaOdUEQQ==", + "version": "1.1.10", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.10.tgz", + "integrity": "sha512-KbUPCpfoBvb3oBkej9+nrU0/7xPlVhmhhUJ1PZqwIP5/1dJkRWKWD3OONjo6M2J7tSCBtDCumLwwqeI+DWWaLQ==", "requires": { "semver": "^5.3.0" } @@ -13119,17 +13242,16 @@ } }, "nuxt": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/nuxt/-/nuxt-2.5.1.tgz", - "integrity": "sha512-tmj8czAaFyyb5eDuOlNHqR5vqoru1BKadinrwmO543G1hJS22oeB5LpWXuLbVrXIWWQhMWfwjznDGok0wM1nwQ==", - "requires": { - "@nuxt/builder": "2.5.1", - "@nuxt/cli": "2.5.1", - "@nuxt/core": "2.5.1", - "@nuxt/generator": "2.5.1", - "@nuxt/loading-screen": "^0.1.2", + "version": "2.4.5", + "resolved": "https://registry.npmjs.org/nuxt/-/nuxt-2.4.5.tgz", + "integrity": "sha512-y2p0q58C8yyNr8zg9wEx5ZNhAYe0sbMXHeproGiCKXc2GW7TR6KtZ9/9IBeVlz7HwvoZW+VXIt2m/oecI9IbqQ==", + "requires": { + "@nuxt/builder": "2.4.5", + "@nuxt/cli": "2.4.5", + "@nuxt/core": "2.4.5", + "@nuxt/generator": "2.4.5", "@nuxt/opencollective": "^0.2.1", - "@nuxt/webpack": "2.5.1" + "@nuxt/webpack": "2.4.5" } }, "nyc": { @@ -14378,9 +14500,9 @@ } }, "p-try": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.1.0.tgz", - "integrity": "sha512-H2RyIJ7+A3rjkwKC2l5GGtU4H1vkxKCAGsWasNVd0Set+6i4znxbWy6/j16YDPJDWxhsgZiKAstMEP8wCdSpjA==" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.0.0.tgz", + "integrity": "sha512-hMp0onDKIajHfIkdRk3P4CdCmErkYAxxDtP3Wx/4nZ3aGlau2VKh3mZpcuFkH27WQkL/3WBCPOktzA9ZOAnMQQ==" }, "pako": { "version": "1.0.10", @@ -14695,6 +14817,18 @@ "has": "^1.0.0", "postcss": "^7.0.0", "postcss-value-parser": "^3.0.0" + }, + "dependencies": { + "browserslist": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.4.2.tgz", + "integrity": "sha512-ISS/AIAiHERJ3d45Fz0AVYKkgcy+F/eJHzKEvv1j0wwKGKD9T3BrwKr/5g45L+Y4XIK5PlTqefHciRFcfE1Jxg==", + "requires": { + "caniuse-lite": "^1.0.30000939", + "electron-to-chromium": "^1.3.113", + "node-releases": "^1.1.8" + } + } } }, "postcss-convert-values": { @@ -14977,6 +15111,16 @@ "vendors": "^1.0.0" }, "dependencies": { + "browserslist": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.4.2.tgz", + "integrity": "sha512-ISS/AIAiHERJ3d45Fz0AVYKkgcy+F/eJHzKEvv1j0wwKGKD9T3BrwKr/5g45L+Y4XIK5PlTqefHciRFcfE1Jxg==", + "requires": { + "caniuse-lite": "^1.0.30000939", + "electron-to-chromium": "^1.3.113", + "node-releases": "^1.1.8" + } + }, "postcss-selector-parser": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-3.1.1.tgz", @@ -15020,6 +15164,18 @@ "postcss": "^7.0.0", "postcss-value-parser": "^3.0.0", "uniqs": "^2.0.0" + }, + "dependencies": { + "browserslist": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.4.2.tgz", + "integrity": "sha512-ISS/AIAiHERJ3d45Fz0AVYKkgcy+F/eJHzKEvv1j0wwKGKD9T3BrwKr/5g45L+Y4XIK5PlTqefHciRFcfE1Jxg==", + "requires": { + "caniuse-lite": "^1.0.30000939", + "electron-to-chromium": "^1.3.113", + "node-releases": "^1.1.8" + } + } } }, "postcss-minify-selectors": { @@ -15157,6 +15313,18 @@ "browserslist": "^4.0.0", "postcss": "^7.0.0", "postcss-value-parser": "^3.0.0" + }, + "dependencies": { + "browserslist": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.4.2.tgz", + "integrity": "sha512-ISS/AIAiHERJ3d45Fz0AVYKkgcy+F/eJHzKEvv1j0wwKGKD9T3BrwKr/5g45L+Y4XIK5PlTqefHciRFcfE1Jxg==", + "requires": { + "caniuse-lite": "^1.0.30000939", + "electron-to-chromium": "^1.3.113", + "node-releases": "^1.1.8" + } + } } }, "postcss-normalize-url": { @@ -15256,6 +15424,18 @@ "postcss-replace-overflow-wrap": "^3.0.0", "postcss-selector-matches": "^4.0.0", "postcss-selector-not": "^4.0.0" + }, + "dependencies": { + "browserslist": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.4.2.tgz", + "integrity": "sha512-ISS/AIAiHERJ3d45Fz0AVYKkgcy+F/eJHzKEvv1j0wwKGKD9T3BrwKr/5g45L+Y4XIK5PlTqefHciRFcfE1Jxg==", + "requires": { + "caniuse-lite": "^1.0.30000939", + "electron-to-chromium": "^1.3.113", + "node-releases": "^1.1.8" + } + } } }, "postcss-pseudo-class-any-link": { @@ -15293,6 +15473,18 @@ "caniuse-api": "^3.0.0", "has": "^1.0.0", "postcss": "^7.0.0" + }, + "dependencies": { + "browserslist": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.4.2.tgz", + "integrity": "sha512-ISS/AIAiHERJ3d45Fz0AVYKkgcy+F/eJHzKEvv1j0wwKGKD9T3BrwKr/5g45L+Y4XIK5PlTqefHciRFcfE1Jxg==", + "requires": { + "caniuse-lite": "^1.0.30000939", + "electron-to-chromium": "^1.3.113", + "node-releases": "^1.1.8" + } + } } }, "postcss-reduce-transforms": { @@ -15408,10 +15600,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==", - "optional": true + "version": "1.16.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.16.3.tgz", + "integrity": "sha512-kn/GU6SMRYPxUakNXhpP0EedT/KmaPzr0H5lIsDogrykbaxOpOfAFfk5XA7DZrJyMAv1wlMV3CPcZruGXVVUZw==" }, "pretty-bytes": { "version": "5.1.0", @@ -15462,16 +15653,6 @@ "resolved": "https://registry.npmjs.org/promised-timeout/-/promised-timeout-0.5.1.tgz", "integrity": "sha1-Vr2Y64xZ5ZTa6FVRvFRFHNRYTCM=" }, - "proper-lockfile": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/proper-lockfile/-/proper-lockfile-4.1.0.tgz", - "integrity": "sha512-5FGLP4Dehcwd1bOPyQhWKUosdIbL9r7F6uvBYhlsJAsGSwFk4nGtrS1Poqj6cKU2XXgqkqfDw2h0JdNjd8IgIQ==", - "requires": { - "graceful-fs": "^4.1.11", - "retry": "^0.12.0", - "signal-exit": "^3.0.2" - } - }, "proxy-addr": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.4.tgz", @@ -15667,19 +15848,6 @@ "regenerate": "^1.4.0" } }, - "regenerator-runtime": { - "version": "0.13.2", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.2.tgz", - "integrity": "sha512-S/TQAZJO+D3m9xeN1WTI8dLKBBiRgXBlTJvbWjCThHWZj9EvHK70Ff50/tYj2J/fvBY6JtFVwRuazHN2E7M9BA==" - }, - "regenerator-transform": { - "version": "0.13.4", - "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.13.4.tgz", - "integrity": "sha512-T0QMBjK3J0MtxjPmdIMXm72Wvj2Abb0Bd4HADdfijwMdoIsyQZ6fWC7kDFhk2YinBBEMZDL7Y7wh0J1sGx3S4A==", - "requires": { - "private": "^0.1.6" - } - }, "regex-not": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", @@ -15699,39 +15867,6 @@ "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==" }, - "regexpu-core": { - "version": "4.5.4", - "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.5.4.tgz", - "integrity": "sha512-BtizvGtFQKGPUcTy56o3nk1bGRp4SZOTYrDtGNlqCQufptV5IkkLN6Emw+yunAJjzf+C9FQFtvq7IoA3+oMYHQ==", - "requires": { - "regenerate": "^1.4.0", - "regenerate-unicode-properties": "^8.0.2", - "regjsgen": "^0.5.0", - "regjsparser": "^0.6.0", - "unicode-match-property-ecmascript": "^1.0.4", - "unicode-match-property-value-ecmascript": "^1.1.0" - } - }, - "regjsgen": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.5.0.tgz", - "integrity": "sha512-RnIrLhrXCX5ow/E5/Mh2O4e/oa1/jW0eaBKTSy3LaCj+M3Bqvm97GWDp2yUtzIs4LEn65zR2yiYGFqb2ApnzDA==" - }, - "regjsparser": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.0.tgz", - "integrity": "sha512-RQ7YyokLiQBomUJuUG8iGVvkgOLxwyZM8k6d3q5SAXpg4r5TZJZigKFvC6PpD+qQ98bCDC5YelPeA3EucDoNeQ==", - "requires": { - "jsesc": "~0.5.0" - }, - "dependencies": { - "jsesc": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", - "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=" - } - } - }, "relateurl": { "version": "0.2.7", "resolved": "https://registry.npmjs.org/relateurl/-/relateurl-0.2.7.tgz", @@ -15890,11 +16025,6 @@ "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==" }, - "retry": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", - "integrity": "sha1-G0KmJmoh8HQh0bC1S33BZ7AcATs=" - }, "rgb-regex": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/rgb-regex/-/rgb-regex-1.0.1.tgz", @@ -16780,9 +16910,9 @@ } }, "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.1.0.tgz", + "integrity": "sha512-TjxrkPONqO2Z8QDCpeE2j6n0M6EwxzyDgzEeGp+FbdvaJAt//ClYi6W5my+3ROlC/hZX2KACUwDfK49Ka5eDvg==", "requires": { "ansi-regex": "^4.1.0" }, @@ -16842,6 +16972,16 @@ "postcss-selector-parser": "^3.0.0" }, "dependencies": { + "browserslist": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.4.2.tgz", + "integrity": "sha512-ISS/AIAiHERJ3d45Fz0AVYKkgcy+F/eJHzKEvv1j0wwKGKD9T3BrwKr/5g45L+Y4XIK5PlTqefHciRFcfE1Jxg==", + "requires": { + "caniuse-lite": "^1.0.30000939", + "electron-to-chromium": "^1.3.113", + "node-releases": "^1.1.8" + } + }, "postcss-selector-parser": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-3.1.1.tgz", @@ -17373,9 +17513,9 @@ } }, "typescript": { - "version": "3.3.4000", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.3.4000.tgz", - "integrity": "sha512-jjOcCZvpkl2+z7JFn0yBOoLQyLoIkNZAs/fYJkUG6VKy6zLPHJGfQJYFHzibB6GJaF/8QrcECtlQ5cpvRHSMEA==" + "version": "3.3.3333", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.3.3333.tgz", + "integrity": "sha512-JjSKsAfuHBE/fB2oZ8NxtRTk5iGcg6hkYXMnZ3Wc+b2RSqejEqTaem11mHASMnFilHrax3sLK0GDzcJrekZYLw==" }, "ua-parser-js": { "version": "0.7.19", @@ -17383,14 +17523,19 @@ "integrity": "sha512-T3PVJ6uz8i0HzPxOF9SWzWAlfN/DavlpQqepn22xgve/5QecC+XMCAtmUNnY7C9StehaV6exjUCI801lOI7QlQ==" }, "uglify-js": { - "version": "3.4.10", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.4.10.tgz", - "integrity": "sha512-Y2VsbPVs0FIshJztycsO2SfPk7/KAF/T72qzv9u5EpQ4kB2hQoHlhNQTsNyy6ul7lQtqJN/AoWeS23OzEiEFxw==", + "version": "3.4.9", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.4.9.tgz", + "integrity": "sha512-8CJsbKOtEbnJsTyv6LE6m6ZKniqMiFWmm9sRbopbkGs3gMPPfd3Fh8iIA4Ykv5MgaTbqHr4BaoGLJLZNhsrW1Q==", "requires": { - "commander": "~2.19.0", + "commander": "~2.17.1", "source-map": "~0.6.1" }, "dependencies": { + "commander": { + "version": "2.17.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.17.1.tgz", + "integrity": "sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg==" + }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -17417,11 +17562,6 @@ "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.8.3.tgz", "integrity": "sha1-Tz+1OxBuYJf8+ctBCfKl6b36UCI=" }, - "unfetch": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/unfetch/-/unfetch-4.1.0.tgz", - "integrity": "sha512-crP/n3eAPUJxZXM9T80/yv0YhkTEx2K1D3h7D1AJM6fzsWZrxdyRuLN0JH/dkZh1LNH8LxCnBzoPFCPbb2iGpg==" - }, "unicode-canonical-property-names-ecmascript": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz", @@ -17710,9 +17850,9 @@ } }, "vue": { - "version": "2.6.10", - "resolved": "https://registry.npmjs.org/vue/-/vue-2.6.10.tgz", - "integrity": "sha512-ImThpeNU9HbdZL3utgMCq0oiMzAkt1mcgy3/E6zWC/G6AaQoeuFdsl9nDhTDU3X1R6FK7nsIUuRACVcjI+A2GQ==" + "version": "2.6.8", + "resolved": "https://registry.npmjs.org/vue/-/vue-2.6.8.tgz", + "integrity": "sha512-+vp9lEC2Kt3yom673pzg1J7T1NVGuGzO9j8Wxno+rQN2WYVBX2pyo/RGQ3fXCLh2Pk76Skw/laAPCuBuEQ4diw==" }, "vue-hot-reload-api": { "version": "2.3.3", @@ -17753,9 +17893,9 @@ "integrity": "sha512-opKtsxjp9eOcFWdp6xLQPLmRGgfM932Tl56U9chYTnoWqKxQ8M20N7AkdEbM5beUh6wICoFGYugAX9vQjyJLFg==" }, "vue-server-renderer": { - "version": "2.6.10", - "resolved": "https://registry.npmjs.org/vue-server-renderer/-/vue-server-renderer-2.6.10.tgz", - "integrity": "sha512-UYoCEutBpKzL2fKCwx8zlRtRtwxbPZXKTqbl2iIF4yRZUNO/ovrHyDAJDljft0kd+K0tZhN53XRHkgvCZoIhug==", + "version": "2.6.8", + "resolved": "https://registry.npmjs.org/vue-server-renderer/-/vue-server-renderer-2.6.8.tgz", + "integrity": "sha512-aiN2Fz3Sw35KRDQYqSSdsWjOtYcDWpm8rjcf3oSf/iiwFF/i1Q9UjDWvxQv4mbqVRBXGhdoICClQ005IZJoVbQ==", "requires": { "chalk": "^1.1.3", "hash-sum": "^1.0.2", @@ -17819,9 +17959,9 @@ } }, "vue-template-compiler": { - "version": "2.6.10", - "resolved": "https://registry.npmjs.org/vue-template-compiler/-/vue-template-compiler-2.6.10.tgz", - "integrity": "sha512-jVZkw4/I/HT5ZMvRnhv78okGusqe0+qH2A0Em0Cp8aq78+NK9TII263CDVz2QXZsIT+yyV/gZc/j/vlwa+Epyg==", + "version": "2.6.8", + "resolved": "https://registry.npmjs.org/vue-template-compiler/-/vue-template-compiler-2.6.8.tgz", + "integrity": "sha512-SwWKANE5ee+oJg+dEJmsdxsxWYICPsNwk68+1AFjOS8l0O/Yz2845afuJtFqf3UjS/vXG7ECsPeHHEAD65Cjng==", "requires": { "de-indent": "^1.0.2", "he": "^1.1.0" @@ -18202,9 +18342,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.2.3", + "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-3.2.3.tgz", + "integrity": "sha512-Ik3SjV6uJtWIAN5jp5ZuBMWEAaP5E4V78XJ2nI+paFPh8v4HPSwo/myN0r29Xc/6ZKnd2IdrAlpSgNOu2CDQ6Q==", "requires": { "chalk": "^2.4.1", "cross-spawn": "^6.0.5", @@ -18216,7 +18356,7 @@ "loader-utils": "^1.1.0", "supports-color": "^5.5.0", "v8-compile-cache": "^2.0.2", - "yargs": "^12.0.5" + "yargs": "^12.0.4" }, "dependencies": { "enhanced-resolve": { @@ -18477,6 +18617,11 @@ "write-file-atomic": "^2.0.0" }, "dependencies": { + "detect-indent": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-5.0.0.tgz", + "integrity": "sha1-OHHMCmoALow+Wzz38zYmRnXwa50=" + }, "pify": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", diff --git a/rush.json b/rush.json index 40754f032..f86b0fdcd 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" } ] } From 4a2dc4edd4ed7eacabcc00edc4fc1e8b9533f029 Mon Sep 17 00:00:00 2001 From: Tadej Vengust Date: Wed, 27 Mar 2019 11:58:58 +0100 Subject: [PATCH 09/22] Update readme. --- README.md | 33 +++++++++++++++++---------------- assets/wanchain.png | Bin 0 -> 25354 bytes 2 files changed, 17 insertions(+), 16 deletions(-) create mode 100644 assets/wanchain.png diff --git a/README.md b/README.md index 0dcc8f595..291c86e17 100644 --- a/README.md +++ b/README.md @@ -10,36 +10,37 @@ 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) ## Contributing diff --git a/assets/wanchain.png b/assets/wanchain.png new file mode 100644 index 0000000000000000000000000000000000000000..c02fc165e73ca8f9f9effde720d08d6d116d84fd GIT binary patch literal 25354 zcmeIabySpH7xzDsQc8(Px709ngNSr@BQY~H4Bf2~(jnd5N;il!NSBC!NVk+U{O~UC zo9BL5&sx9t{pVfGS`+*1^WFQpK4+hEoom*b2~?01$3P`O1pojTk`f|HSMRM?PoBGQ zSFZ@TcYUwkP^=|1?EnBYoS)A-fP^IctF{xyOm7E;RXY5a==; z1-yqysm%_B7>ITd2?q{eDy!CZJ0O4=a5Qn|fA{M&5EEcMtwj-Q{LL$>fRRoe6%z}9 z4Xqt!^yY>W5~WvPxFf;`$mDU^<@a7eCR1qZXoqhz2KYvQs&V#KxkDyFbkG4nc%3Jq z=Zy<5QzDWfap#jKKm>6(n%^4;ub&8%?nU~v2;k4k$A0v_>5jgI+PKA|_jdq$ZC?9X zXWGW!W|OfcduBcN@c@7k5KujZF5dsLx{P%%`|`+kFLG(=j`z03F~6vmlvzrbHq(F% zHlne#Wyk9c%S|2ct78~iIUyv!3wZhcTeU?M1DW7`1y0Xi>{FkddT*L#Z6kLCg%m{g zl9(k1R53Psz~Fm7R)oQqB*FUk%s;iFSbg_>B8(YI+h#zMB_WE38~5Us#%sf9Lt@Sh z)TvS&HyeQe;LCaL5WAX}g*AbvD`KQ6V9af18BBy1U$NYUqXr+#+-3NXf{8=&@(Grh z2)2y~T!b(L=eSMSkVjD}8cVh9UPjDOAh%c&4HKqrn{I|bKG}1eR0-5>YQ!uiQ>jqO z_AIVPQeqKoUAV0NN%D9R=3P={eqZD{BXhf@7i7y4-R15n3e73J#D#y&Au6+z{ZjcG zT{kWwlqLJ6($oC(QDrS!;^_5gs~)r-ar)$*+}C;IDqLom4)m&0ed$a&B^hdphf0L` zo1^QaBx_^`3?bqp>6$}2rY#j3TBw%yisRItPRa5~@k!T9u4gu8j;spTJ(`Xu5edu8 z9eFsYK2$wSxKg~&lunYdlf7z9-> zTc0$Zy#EQtO%zJr`HC$*s)KGp#rB?Uznv>LX|0)#bP33bmn*g2uik&Er?JQmOJ?hbV zdGAzYRNYmn=z~-XR73N>s6A3zEc~4BS7?-9qBNcB`m|CnB;BZB=`D>igVI#KqgZjQ z{2bwq$Fb6d?FG|?re~@*6EhA1+Aw0aFTAf@OIlsRiSvQULG9Yu+T+psSGei<%o=fY zIt=_&4b*4sVot$_aak-3ougs3oJ);jFFIsHH1J_o5DSjB;3V7-SMQWwFUPwjEXPg6&Av<14gj(;R%z)}QUQs9%D_V4Ta5@cIWd_TsUyBn_s+mj2BImVW^Nunx}>#aq@<8! zoTO^*Sv<5htZ%B{_L$folEzXqb?OS%@zyTYlGvWN_I(DnTBd4WB9x;@;yB8#IB?m= z)@)mE|G;#iaz6Vyv}yX4Zl`F+eFM5cz4v+ZV07vO-?Urvp){#B>8k<7)WfEdrXY9i zb6QUyPioKP3$qL5^TIPyM0}(ygi%CvBwi$@yA~K3h_8@}@7EC*5i(+wV345O+|$Gz zCh5UQ#@2dp!u^p|25X!(A_rnL<@N`?k1Z-y%FY<=YS-5<*ciwEn8e2#o*oQ}Y; zWR~v2hpte%GrIDejl^B1p2udEqv!cc%6qw0q735lVI?7+r1KAz@kWUGm>d;1vbl?E zDr%OT#oX=BwvN(GFGe`!))Tk58=X&z9~rSN_17>fn;R{C#3_$9mNX)kOQUY1+K@hC zM2Q`h@WXzAQ%!YG$|E~5YXJJZ%yv>J(oIQocm#5|P_}S^dl-#D2cMsk{~#YU>^@R3 z{5%^u8z%3Sij`9O7)-@RQ%)Wf|0djlQ5(odS?^Ibvr$`Kzo52j=;9P=-rte*R5Z`f zi7A4QvYJOe{P9425-jCX*Hhj{{Ha5WKhKcey#dwaM1jLy{$3Y`Wr1W;=F3jRQN&?H zOEe5TCf!fvU2a36?QP%M+AXDnV{n114Csts>Z2Rk!KPbWq6g7=)!U4BpgovpsDc^7dS*v;AE`|? zOgit?^`#an6B7S5K`H`<@(k`8;;lv7%ZgF{SZ+vQIB zeUs%KMYq?E6wkn$R>jlV_01dIGb4>$wlKG1JIhVMWDoQ8uDY{2pYxGJJ%O)IX|*$T zp5iawrSFs7TOxJ;q5MI<`ra!NGd@N^9j~^9u9(cTOzIGk`G$^`oY9=ErJAJ@FnQ-^ ztuI=k7Z!VaDf393h4Oi+8g7vuWh)C^`Nz3_T8qUXx!j~J%fvCqOPP&$!p*2Dz5%}! z0WYSnU*hj=hbk{m50Ey0b)EYpy3?K`Ef-4w;(IQ55;PAI=S$`#e9Nt8+O%d{nQbmS z(QTeGA*Xj(@3|%RJw%%8@$^O=$H92=)CkOJHe!0UInm{CtkKu4^$?A8kR+O4#YJOB zVp*~8EnYLHJ)cAB%FcT2nRCzlY2)zBa`WQFkJ`5@DBF_l%ICS2=ReLnk>QX^1QUN0 zZP%V1e-HXLtLinoJAAen@ucCRh995r)1lOk*}_2qR|4!u1My{*C9UDgP<@e8>$bF@ ziRY(N#k10R<&U|!t#*QJg6f{7N5i`u`|B?viXyOTMab^}6aeAf-S5{00HAwc^$s?*3x`0Kd!34G*R{*9Gsz%+N_qAiCuP(cFyx^*HDjrT5 zGdBYOyey_F8ul8pGQ41zC6fUJW(Z|+wzR(5GXenoPn@j{z~)eUGDE1bsg(f5c6~Di znJGkoLY+gFS=Ra))WlT6)fTGkDyIT=H3#!RD4qzS@;mch1+awL8<06$T3FffItx(z z7MJ(x^Ur1w1=(+1?9Bxzp8iZorXj09_6%kVCF5Y?0D_rWS;)9}m{>SCxVTsu$yk|L z*g?!JAQm0kdu=WlM@>g z%+?sh!o$M@VrB)gvI4Jq0PS3?>_r`~j^vLs``3ha zDlXPgkP_4m=3onkiaJ8A>?!~4ARyqs;#fP_TKvWb0tP`Xpq5t>yQ_m|`PW0R{_|$x zFZn+X<1hDrJ$rjoqhEvb5A9FSf0aR8}22=QOlAMZ0;sDVAqRs{yL z5d6K$e%iN$Yva-CAR(AFV zR$!>4h~U+^Gntw~csW>^IgNM>xqv)iZU~T_8^QuK;DoRNc?^s=xtTc)xD262zn$bi z<^K^{1O|5aSxQ%-f1mmg82BpuUj@R;Y`|s+1@jmHd03diKo%A*FpwL}VgNKSWai@L zG=MUL*$w_o^tWLDkx1Uw^lD`?u=rb_pXUO(N@idL0kbnRa{>){t^%_gadQ9-*_n-i zhO9gsTm}#xE-1I*pDF$&%zvbkFtxj?Czrp~*;Tduw)QAPZT{K%r^CYZw>8Atz}61> zb7~4u{5d!OT6F$eQ+{fGo8r6%;Ge6HAoyniLm~X2f3*HOtiP0h$V~rpIR7^UzsLWZ z{J-aLGJ#s%RQ|t*`mNW04`K&1vUf7Dg+4XDs*wL}ZvGzkpTg@2_(4C{YYWr=3qxUN z;Q0S~zpAdjDpUCVn=(NWQ#)%5 z1DC&x|K|Oh`sW3X_iCNFs(FLo<~IvJ=s()7_t*HjURXH%)}M=&`RV~;`T6>X^zZKL zQq7yCe|KM({!*%1nc54o{*mok^WRiIufn{)p;W%wFhT`6IXKuj_(9j3uPYQxouL*Q zBBobY3cH^x9t+Q(qU)Z2RciiHa&Y~T?Kk1y9DfLZucW{2?S5M%es8_nIbLmAL4WO9 z|6~35YoYx=`Qg_Y{hy3_E!J(4Yd~%`Z*kqs=bHBx*EJwFo42@b=5x(^i|ZPYo6TEX zH}kpXy~TA6$j#<0uABK>^WNgR2IOY*7T3*uu6b{9T?2Bnd5i02KG(drxUK=Y*}TPd zGoNeTTU^(G+-%4?=7xtKyEf~aox=4n)ephH6S;ex43TRbIp5;>l%=o&0AbI z^SS1|#dQtH&E_qxoB3Sx-r~9jam-OT5j_ZHVRAUB)0xNhci&3lXM8jzdKTUefBg;=YIXJFPp7M2d2$Uba9;gFlngAPBntpoIsgE6X#l_v8UVoO z0RUhv0RYUC001n3002(XDR5pH03eZ-6nU!R{CUH}G+KA;%}n)SZEK>rimIe)wu_K3 zS)0BPp4g`jX8^jRwVNZ~am3c*gWL(JUCLH1IZykf{?z`pF$SAle|tkdq!*i(JdJj8KUASW(uwZ%%u^-x*d8*!#xI=-+O^3fsTEmSO5uGL> z3BX2t7Kr~IVxq^b&5MIn?NC_)+j)eVM~|RD3;Je)C5iSl3-B^78o;fO>C5d2Wp#F@ zb#~9w3jSc+`He3&r}_XAo9p3A5TLq35jmsxVkVI_|8uZ}2!aW%Z4tHrkA}yJ%4U0{ z23Tt}UdS?=GF3C7F&E_KP(QmGPsL50Zf?U!VH$()qe7|QK(b8)Iv-HZUKX!mvZ4o) ze6UyuJ!(Q)8#P}?tuYtf+M3y@ONw$ZDYZQVP)HiDmUA}IrAf(ns{%#K%<0|r)Am13 zekS{LkW>^Ia98)gKuV8kXCc8?{8FrscS&{lMS2Qtq_@9g@pOlp!st@Dnv#h z)J#ANJ-z}q^|!kfPBb-_N28g~#>(Ns8lzpQBe_dpj;r9tS3mH!xgPsDJ>(JT;gT6F z_*Bs`rQH{+{?L)JZ;==?jqDYiu)enmmdy6-Mob&p9Rv};9e$OFRP^XA(xgda_&F8z zg;5_f@1(#dH|G+xT)G5UUmJMhLq_lfT#_n;2&GPUqVqy@ExIemYqUTwABgZ0z^ zQ6GP}J#Sx7G?Mc^B0)u|RBo*_7H2>%#12oT z0cUdK)n|}79UM9RSm3J8-3`4%rjUoNAt?zM*Icu!z&&@&y6B4EHIJ%%wCgePpps~k zNglRhzqQgo^Cf<@mmo|cK;kJWE~;QPHi}K#V$l;7as)N%@JQjnNQhmn;5Y2>EVxMg z{VyVC#-|;gY!-=6eC>OJr;!}q$j9- zx~RW66lhYDL!45d)7MDxc;d)bHf5q>c_f9B3~uL?NRog-QxOs0?5O+%UjAmB}OEjmRTi-`sT9mXuUYdEZ)zN^4pZ5Th zq50K#UY}6AHl1B_e(cl$x6fK+T!fYI|~P=D#`TsW^tosm~o)jnwZq|zO1;f1L8)F z(7miwtvZ!p1A!6CsXV)d>f+A@*qX|4^qS6*ypQ0Dw3ls{_~KT2C1xMQhBX0jJ5K5+ z!pn4J zJb!td3rfakIE~j4Of>5=;x|}uGyYG9Nw z7I;#r%Z;749_7KIvVM+>&jFYuxz@c%j&6naq8MW*lta5Ly1%$THj@d3gH2F1ihuxE z_z?cE;SR!k8_qoR$arWutDCI6$!>)JcC_XlrABP>*n#7eTuxkUzm&^RRKUG_fC8&z zKNV)aF9LHB>T4jD5K{RXkMul!G@(ljiWC7Bi+&bLXNNtFFkkd2{UbCAZw@4t?lClE z>gCe%0LFn zdvq~F*a@{H?5n8QN8>~~0Th^Oewa(Cd59X(@j_(bd?2N74bA2B)HKM7%seocdQ5%X zm{DIMM3ok^JBW#U(_R&1FGn`Gkh`*@;ue_ryxo;_R)5szzbH(qcq*OiUEv_Ww zWL)2*Wi}|#n6`6we#cm{%#BTLf`b^~9?Q44%F(M8v!K)#*vdv@D<`M+10y)5FnygH z1y3Ry3wP4KVv(!ZWc&Lx;>#Cz7XaKGx=%RxRTB9-N3e$v~FX@ zG&7cpN}vW-Y{5axPNbq?3`oaFZ+b>tX^jMK}rUebYH!~r1{n4ci3w~HQH~s*4xzuE@ zE{!B|K;~|E7)W}yCA4y6Nq2EyZ*qJho-$3Tx_QQK$*q~^YmRnVp66j=?Mx^h9Ma<+ zubp-H0n*gxkq#)FG$ThutW1f%lpZHyk0xNNRSl!o_eJ!Q;7 zP?Pjk?H>U$@HLgquiYZgri(yx&VvQ)&l>kPm64GyzwN+VG%$``ZmL%wI^hc8r_fy< z;G8-UC$D_0QKM5BSutgm^$|Q|rss`CPp{n%Gzx7FH_Sqi zUI5%JYOr;-F4JgmoG)k^m%$!&kfW$){;+CU0VGZ-NyZ1ts=w%OP)EZl5mU2oAR>B{ zAAmAtmxI?40-@nmLkSDTL!)!xEn|v5B%##$~|D)iEA;^!bTW zuQ40x^VvmwWFgG9+{Xp5;IXMSB7YmA(FbHEv=E|BuKgu_8>5_=(>~(f&&ueSCi;+* z0g|cHsAQO$nE{8ez-wKaUOIU&HNv8+prtQ!LL=naJBVLS!Bgl5@=^!|hd#aY$=ObK zOSkLz7x&(rY(St?sm|0BZsN@7Ic_TTmXwYRqCkRYnqf}Fq=lkG%|{y!y?khZBK-!H zC;Z%qj}vpvY6%`k5o-`9m5>m|(-|p8WDsb8!9wP3GPK-vUU{6%Kg`UTJf;(v!1(kJ zA+y^Q^+W9=1a>&o$OFNbCzUv1P5jJiC6-gHF53?06K{1tC+whnLBMHzhR(Ib8|A2N zn?leJap(LZ6S{EvoGF!N$-ToNBwjYbbk?*xo7esR#!=tA+h>pL@1 zQJtLy29Q)i_WhNuD81$b)Y+%N*QCx{A(!X-bA}eYY?CDNT>F&=71cS)P5zi^N@)yy zY#zWzQy-VoAIy$Tm8>s)LD1PXC-`IG;~cN!VM6oRD#wM9hxK!_7?J&%61;B> zv(f{HrD6BZS0=eq1(-F$L>j+D%r@@qrYon`n;tx_E@{fBX4|CZi2Z2nY&VA4D2tJY ziuHgeRgO-jatGS7Q$U{(@Gj(XReN~1xW44EuUiU!gWY!blk@gM`6d=!377h?&``Xq zbBSEA$ao(zZ?3+7Ru8i5jGL>#Bb(}n4tT63 zb9>L^!H1HWa-NCr9kAMTF$2q|2PZ!np(|j_8w!-sV+cGV%h;kWHb1RT2qnVSt8=TBOPEYr6S-INlg5;>TEbe%lO#&70ZxX zBn$BSB;}z2B@yzTGUl)FWV>kb^@0^A{sY9*%BZiBq%hSBInv$$!01nd#+ZY_SnT=v z*gH!Hz1qW_IWNrK=MR%a}2}WbvOmgZ8N|kopCq9r^8*~XJi3;=o8}}c{!PXmjc=|mdY`5t_}WaB zHMO#3aH^F?7G)PB*6kg&mDkIohsvu8hqM&6Ws$v%C`KALz!%OY8Bge$)hVC*5a?&P zs9;noT>7BXS|*elNBhAPt~ba&ta&~T5-7A_wqWwXtWTu&M^}))*Z%(8ME^L-Xp9p^ zkTAT1St-=KoGDHQ%|dW}wCMCxO8Hw-!p3<&2fg!^t9yoG8T9vx4(v2aYT|gPEz4bX zF~OKv3rSyFANJJS^t+YQfNtg=r^sx3I2jhflRS1mFGItkA|{T z>n!ocGJ5nY(uciwdHYu8)h;S8fx+S?l01N`t9sjg&+6?r;LHaH`~y2G@8tl>1*6JD zFx|f4cn>!-jrJ(3jaE{G6?M^nQhs}i^{q}%CLf61=(8RMI8@$#N2m`IhC3Q3WpqoM|h zC7EF`y>@SJQ!{J5jtu-XU6dzUWR`L_fthz%)wMKBKwjygS=Tll|xrOhKy$^z4Y;5TbeTy4H04-l<>7c#Rq2xD8V z)@g886%u_Qvw+#-LqwE>3P^3J#^hB2y-PvUjzKjvM1CL9l26&HT(XXI(33pz zwqd)~{FG1IS3;;QxIAico4>}*x(r>Bc3)>xYqo6G&BvTVi;R2~x)K9GH|?!El@BE* zCLl~HkyW)Er=B&D=@*%%Q=X|?j(R`aBGiRlp2S zL_(*N;AqLm)-;@(%z2a$%3vT-{!mO(+j?&;1zHSCB4R*__B`(TJ}cOC8dPm12X~CP ztR8?18O6pMS4HqE8@qg@Ju+#@y?-F#8C5Yz6X(9iMV z^p#T5J+0OAw#0U#dYxf<#Eu~-AC8a*NQjdPK;||<4yQeVlAU(1WXN{+ zbaRo!UL(a7^lsrOKbl44x%VwAHDMrkBwhs*+s>?v;PO!1QFn4`txgO;Q!u`c9C~j_ z*&_bwhjO4e1waN*pImG3ljln{4g$ORYUr%E&rzV_zcPr@$_KWy`fhz(8Z%bnKX zsW79$%jphpzWky{Y6vKVh@vZE`uToB1?)R4z?w2nR~sMq_alrn9g{Xs$I7}`U{m>U zgo;wmtAfe%ELpcS@(83kf?vExqolOEzn?CVPo)zYj$w&EnU(R;*?sm$h;fJXlSvob zIx1zhA72MAggfNxExg0ODAhXdt&KZKqZNB3k9Uj>;!!$)LkZC*X$mui@Wm^cL*WQt z+E@U+`_4BfO0-W#=df7vlf@r9rs5AAZ51VU2xEzp40t zUs0gu98=&QT~{kcC4*z`qVI_bA}2!47z}vc(L^YuU~soKqEfMVE!=9u^6DCt!UxlF z8#zfaIxzD&zE3I1&&Co_k=y8IrBm;4UM8-`fAXmi9(f=pr*Qm`dy#;K$_fiWPeHN# zY?fKKHe)Zr?$FMvzf)?l#_JdM9A(&(e#&>Pi6@+N20pXDNQ|DKUMJiMmMoo*;@o^HMTY#1 zC3v2o)43=I3x5A~Ht}rJdPh>M%hq>mmf#o6C4N=dcU9mWdwfQH724sxOAvv(Sekt9 z^EIpK2e52#(^y)(CR}eWEBub^WOeZU!`zTQYmc7+KaL20Z=WVx$vTT$C^@(y;wYed z=aWyXU+~D6hE{~sNv;mIwbF!+#v&9pJMtzU^H0XyAvp7PZM9A>sgesnqEKiBQAi9X zj#v`9KJn^R9ns8$U?i?r9Bc}d>|>FR&Ihly6u#_lmJuXO*eM*d$>>ogpb&$gA*xo zBD<>7#Fr;QQ?M`2-}=(?;}a@-%HJ9LC}KSbsJnMiogG!X4wLq{s9Pk}npTyFzq+5+ z0brtW3OThjx=By?l~~L;sXHwy)6^p44lO+$sS;1(g zYI1(4P7I1V2zI*bKcPZtdic#@TGP_rPbEzd+_|*a%d7oD3JUfzS0_izGd~*9KACVh z0TC1Mb1D{!#%-%Tz>d+Fi#BWFFz3@^lM_a-+6NtXPECk-_W09;EcxLDEAf zGvfnRv-^RB;||No(H~3&Eu|%%24*HENTE|N)<@F6#1)}>nP3YXJ?|9vJlmgJzL%1c zkF>xo>?h);eYWkf{-dvV%2@iaHab@dGMmi{iokAPP_X?FD}kXJk6kY~(4%GXfDwy@ zD~mCKO~{lHQe(hb1!#Vgs-pVvga#XiBY_e)AsLO{H!(^8s$J;IrbktS|L$C*W9rC7kcjw5r||)4coTYK`Y@_t;0Oslf7iF zj-WSdq(vKNU1eGDk$26-2u}RXz}S{ba3~SvuZxIi$1hGqJhoNNrOnYU&(^EIGk_$P__B}>?n4~a6)Vcrqn_XjGx$ zW4?|PbdHd(q`_48@-UUh_3NkZLE&f&pdjqqWtfemd?O0@QF6Z8+FZ|;+N^;PQlaAn zWWQYb;ITi$e8wtnJu}TXZg)Y_v54MD(}UVKbk(aQEDm4u(}(5dVpB*b@&{?7s3U7g z0<26AwpOLR8m6Yg4@W}p*qf9&TG$(b<)yWy>(bpB1z%l z9M7?hJ*3G%Z74#+E=G;1an(+&t>-Fl}CAg&pOQnhEZu5EM0P<*QC+(apcy zkQmepC#;{|iY_NIbSVtJ{wv$KHm8P5LF(x>&mSjhEJeugutFHFDFd8gRPvN<&g4uYK%@ zjKVaf#s{)~wJB+bAu}{{vz_nDa1%X}pL`6TUM5e2T5dLBbUY%>ma3hi7j-zK@Pk0x z=m~RJm8QtBXn6Dnb~#lj*-%kO#!BvE=_dl3v+6?xQ#uP`Vy+D

o?zs>Ksd5P<5Z zyP;^|!g+Is&)usQknc-Ayra%mrtzMLw(|+U;CYuqDc-OHar~^_o8wPqNo=t7bL~Kf zpn3S Date: Wed, 27 Mar 2019 12:55:10 +0100 Subject: [PATCH 10/22] Add wanchain to webpack. --- packages/0xcert-webpack/package.json | 16 ++++++++++------ .../src/0xcert-wanchain-asset-ledger.js | 6 ++++++ .../src/0xcert-wanchain-http-provider.js | 6 ++++++ .../src/0xcert-wanchain-order-gateway.js | 6 ++++++ .../src/0xcert-wanchain-value-ledger.js | 6 ++++++ packages/0xcert-webpack/src/0xcert-wanchain.js | 9 +++++++++ packages/0xcert-webpack/webpack.config.js | 5 +++++ 7 files changed, 48 insertions(+), 6 deletions(-) create mode 100644 packages/0xcert-webpack/src/0xcert-wanchain-asset-ledger.js create mode 100644 packages/0xcert-webpack/src/0xcert-wanchain-http-provider.js create mode 100644 packages/0xcert-webpack/src/0xcert-wanchain-order-gateway.js create mode 100644 packages/0xcert-webpack/src/0xcert-wanchain-value-ledger.js create mode 100644 packages/0xcert-webpack/src/0xcert-wanchain.js diff --git a/packages/0xcert-webpack/package.json b/packages/0xcert-webpack/package.json index 9a64b2c38..b50780b74 100644 --- a/packages/0xcert-webpack/package.json +++ b/packages/0xcert-webpack/package.json @@ -9,12 +9,16 @@ }, "license": "MIT", "devDependencies": { - "@0xcert/cert": "1.0.1", - "@0xcert/ethereum-asset-ledger": "1.0.1", - "@0xcert/ethereum-http-provider": "1.0.1", - "@0xcert/ethereum-metamask-provider": "1.0.1", - "@0xcert/ethereum-order-gateway": "1.0.1", - "@0xcert/ethereum-value-ledger": "1.0.1", + "@0xcert/cert": "1.1.0-alpha0", + "@0xcert/ethereum-asset-ledger": "1.1.0-alpha0", + "@0xcert/ethereum-http-provider": "1.1.0-alpha0", + "@0xcert/ethereum-metamask-provider": "1.1.0-alpha0", + "@0xcert/ethereum-order-gateway": "1.1.0-alpha0", + "@0xcert/ethereum-value-ledger": "1.1.0-alpha0", + "@0xcert/wanchain-asset-ledger": "1.1.0-alpha0", + "@0xcert/wanchain-http-provider": "1.1.0-alpha0", + "@0xcert/wanchain-order-gateway": "1.1.0-alpha0", + "@0xcert/wanchain-value-ledger": "1.1.0-alpha0", "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`, From 76c649433a8f88cce63ae746aee7cdc478944a0f Mon Sep 17 00:00:00 2001 From: Tadej Vengust Date: Wed, 27 Mar 2019 12:55:38 +0100 Subject: [PATCH 11/22] Contributing typo. --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e20bb785d..a839c96bb 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -50,7 +50,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. @@ -73,7 +73,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. From 2d63e47ca04344eac5ec8593ff5f3fce27ff56f5 Mon Sep 17 00:00:00 2001 From: Tadej Vengust Date: Wed, 27 Mar 2019 12:55:51 +0100 Subject: [PATCH 12/22] Readme structure update. --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 291c86e17..93a0a3815 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,6 @@ To learn more about the 0xcert Framework, the Protocol, and the 0xcert news, ple | 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-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/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. ### Wanchain | Package | Version | Description @@ -41,6 +40,9 @@ To learn more about the 0xcert Framework, the Protocol, and the 0xcert news, ple | 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. +### Plugins + +| 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 From cbe60fbb00970682bd128aeeabfe4dec79ceab99 Mon Sep 17 00:00:00 2001 From: Tadej Vengust Date: Wed, 27 Mar 2019 13:06:58 +0100 Subject: [PATCH 13/22] Webpack build. --- dist/0xcert-cert.min.js | 2 +- dist/0xcert-ethereum-asset-ledger.min.js | 4 ++-- dist/0xcert-ethereum-http-provider.min.js | 4 ++-- dist/0xcert-ethereum-metamask-provider.min.js | 4 ++-- dist/0xcert-ethereum-order-gateway.min.js | 4 ++-- dist/0xcert-ethereum-value-ledger.min.js | 4 ++-- dist/0xcert-ethereum.min.js | 4 ++-- dist/0xcert-wanchain-asset-ledger.min.js | 10 ++++++++++ dist/0xcert-wanchain-http-provider.min.js | 10 ++++++++++ dist/0xcert-wanchain-order-gateway.min.js | 10 ++++++++++ dist/0xcert-wanchain-value-ledger.min.js | 10 ++++++++++ dist/0xcert-wanchain.min.js | 10 ++++++++++ 12 files changed, 63 insertions(+), 13 deletions(-) create mode 100644 dist/0xcert-wanchain-asset-ledger.min.js create mode 100644 dist/0xcert-wanchain-http-provider.min.js create mode 100644 dist/0xcert-wanchain-order-gateway.min.js create mode 100644 dist/0xcert-wanchain-value-ledger.min.js create mode 100644 dist/0xcert-wanchain.min.js diff --git a/dist/0xcert-cert.min.js b/dist/0xcert-cert.min.js index 9eeb4f4b2..c2af1a045 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(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}},93: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(94))},94: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(95),r=n(16),s=n(97);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},95: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(96))},96: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})}}},97: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=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(30)),n(r(5)),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(7)),n(r(6)),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 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(6)),n(r(29)),n(r(7)),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});const n=r(8);e.normalizeAddress=function(t){return t?n.getAddress(t):null}},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(9)),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,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,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,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(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,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(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,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(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,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(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,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(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,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(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,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(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,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(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,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,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(9)),a=r(2),h=r(11),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(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,z,V,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,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,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,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<,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^~lt&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]=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(8),u=r(10),a=r(2),h=r(40),l=r(11),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){ /** * [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"],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,z,V,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,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,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,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<,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^~lt&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]=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(10);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(5),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._startedthis.normalizeAddress(t))}get orderGatewayId(){return this._orderGatewayId||null}set orderGatewayId(t){this._orderGatewayId=this.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.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.normalizeAddress(t)}isUnsafeRecipientId(t){const e=this.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}normalizeAddress(t){return i.normalizeAddress(t)}}},,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(50))},,,function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new 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(51),u=r(52),a=r(53),h=r(54),l=r(55),c=r(56),d=r(57),f=r(58),p=r(59),v=r(60),m=r(61),y=r(62),g=r(63),w=r(64),M=r(65),_=r(66),b=r(68),A=r(69),E=r(70),x=r(71),T=r(72),N=r(73),I=r(74),P=r(75);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=this.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=this.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.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.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.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.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.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=this.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.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=this.normalizeAddress(t.senderId),r=this.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.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.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.normalizeAddress(t),e=this.normalizeAddress(e),I.default(this,t,e)})}getProxyId(){return-1===this.provider.unsafeRecipientIds.indexOf(this.id)?3:2}normalizeAddress(t){return i.normalizeAddress(t)}}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(45),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(67),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(45),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(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..38daa6378 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=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(30)),n(r(5)),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(7)),n(r(6)),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(6)),n(r(29)),n(r(7)),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});const n=r(8);e.normalizeAddress=function(t){return t?n.getAddress(t):null}},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(9)),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(9)),a=r(2),h=r(11),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(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(8),u=r(10),a=r(2),h=r(40),l=r(11),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){ /** * [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(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(10);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(5),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._startedthis.normalizeAddress(t))}get orderGatewayId(){return this._orderGatewayId||null}set orderGatewayId(t){this._orderGatewayId=this.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.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.normalizeAddress(t)}isUnsafeRecipientId(t){const e=this.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}normalizeAddress(t){return i.normalizeAddress(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(1)),n(r(99))},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},,,,,,,,,,function(t,e,r){window.$0xcert=window.$0xcert||{},Object.assign(window.$0xcert,r(98))}]); \ 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..f397c5738 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(i){if(e[i])return e[i].exports;var n=e[i]={i:i,l:!1,exports:{}};return t[i].call(n.exports,n,n.exports,r),n.l=!0,n.exports}r.m=t,r.c=e,r.d=function(t,e,i){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},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 i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)r.d(i,n,function(e){return t[e]}.bind(null,n));return i},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=110)}([function(t,e,r){"use strict";function i(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),i(r(30)),i(r(5)),i(r(41))},function(t,e,r){"use strict";function i(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),i(r(7)),i(r(6)),i(r(12)),i(r(42)),i(r(43)),i(r(14))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(4);function n(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&&i.throwError("cannot convert null value to array",i.INVALID_ARGUMENT,{arg:"value",value:t}),n(t)&&(t=t.toHexString()),"string"==typeof t){var e=t.match(/^(0x)?[0-9a-fA-F]*$/);e||i.throwError("invalid hexidecimal string",i.INVALID_ARGUMENT,{arg:"value",value:t}),"0x"!==e[1]&&i.throwError("hex string must have 0x prefix",i.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 i.throwError("invalid hexlify value",null,{arg:"value",value:t}),"never"}function f(t,e){for(h(t)||i.throwError("invalid hex string",i.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,n="0x",o="0x";if((e=t)&&null!=e.r&&null!=e.s){null==t.v&&null==t.recoveryParam&&i.throwError("at least on of recoveryParam or v must be specified",i.INVALID_ARGUMENT,{argument:"signature",value:t}),n=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");n=c(a.slice(0,32)),o=c(a.slice(32,64)),27!==(r=a[64])&&28!==r&&(r=27+r%2)}return{r:n,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)||i.throwError("invalid hex data",i.INVALID_ARGUMENT,{arg:"value",value:t}),t.length%2!=0&&i.throwError("hex data length must be even",i.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)||i.throwError("invalid hex string",i.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 i(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),i(r(6)),i(r(29)),i(r(7)),i(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 i=!1,n=!1;function o(t,r,i){if(n)throw new Error("unknown error");r||(r=e.UNKNOWN_ERROR),i||(i={});var o=[];Object.keys(i).forEach(function(t){try{o.push(t+"="+JSON.stringify(i[t]))}catch(e){o.push(t+"="+JSON.stringify(i[t].toString()))}});var s=t;o.length&&(t+=" ("+o.join(", ")+")");var u=new Error(t);throw u.reason=s,u.code=r,Object.keys(i).forEach(function(t){u[t]=i[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,i){i||(i=""),tr&&o("too many arguments"+i,e.UNEXPECTED_ARGUMENT,{count:t,expectedCount:r})},e.setCensorship=function(t,r){i&&o("error censorship permanent",e.UNSUPPORTED_OPERATION,{operation:"setCersorship"}),n=!!t,i=!!r}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=r(8);e.normalizeAddress=function(t){return t?i.getAddress(t):null}},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 i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var n=i(r(9)),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),i=0;i<40;i++)r[i]=e[i].charCodeAt(0);r=o.arrayify(s.keccak256(r));for(var n=0;n<40;n+=2)r[n>>1]>>4>=8&&(e[n]=e[n].toUpperCase()),(15&r[n>>1])>=8&&(e[n+1]=e[n+1].toUpperCase());return"0x"+e.join("")}for(var l={},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 i=String(98-parseInt(e,10)%97);i.length<2;)i="0"+i;return i}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 n.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 n.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 i(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s=r(33).Buffer}catch(t){}function u(t,e,r){for(var i=0,n=Math.min(t.length,r),o=e;o=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return i}function a(t,e,r,i){for(var n=0,o=Math.min(t.length,r),s=e;s=49?u-49+10:u>=17?u-17+10:u}return n}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&n++,16===e?this._parseHex(t,n):this._parseBase(t,e,n),"-"===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):(i(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(i("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 n=0;n=0;n-=3)s=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=s<>>26-u&67108863,(u+=24)>=26&&(u-=26,o++);else if("le"===r)for(n=0,o=0;n>>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)n=u(t,r,r+6),this.words[i]|=n<>>26-o&4194303,(o+=24)>=26&&(o-=26,i++);r+6!==e&&(n=u(t,e,r+6),this.words[i]|=n<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,s=o%i,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 i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,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=(n=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 n=0,o=0,s=0;s>>24-n&16777215)||s!==this.length-1?h[6-a.length]+a+r:a+r,(n+=2)>=26&&(n-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var 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}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return i(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var s,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 i=0;it.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,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,it=et>>>13,nt=0|u[6],ot=8191&nt,st=nt>>>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+(i=Math.imul(c,F))|0)+((8191&(n=(n=Math.imul(c,V))+Math.imul(f,F)|0))<<13)|0;h=((o=Math.imul(f,V))+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(p,F),n=(n=Math.imul(p,V))+Math.imul(m,F)|0,o=Math.imul(m,V);var gt=(h+(i=i+Math.imul(c,z)|0)|0)+((8191&(n=(n=n+Math.imul(c,q)|0)+Math.imul(f,z)|0))<<13)|0;h=((o=o+Math.imul(f,q)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(g,F),n=(n=Math.imul(g,V))+Math.imul(y,F)|0,o=Math.imul(y,V),i=i+Math.imul(p,z)|0,n=(n=n+Math.imul(p,q)|0)+Math.imul(m,z)|0,o=o+Math.imul(m,q)|0;var yt=(h+(i=i+Math.imul(c,K)|0)|0)+((8191&(n=(n=n+Math.imul(c,$)|0)+Math.imul(f,K)|0))<<13)|0;h=((o=o+Math.imul(f,$)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(M,F),n=(n=Math.imul(M,V))+Math.imul(_,F)|0,o=Math.imul(_,V),i=i+Math.imul(g,z)|0,n=(n=n+Math.imul(g,q)|0)+Math.imul(y,z)|0,o=o+Math.imul(y,q)|0,i=i+Math.imul(p,K)|0,n=(n=n+Math.imul(p,$)|0)+Math.imul(m,K)|0,o=o+Math.imul(m,$)|0;var wt=(h+(i=i+Math.imul(c,J)|0)|0)+((8191&(n=(n=n+Math.imul(c,X)|0)+Math.imul(f,J)|0))<<13)|0;h=((o=o+Math.imul(f,X)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(E,F),n=(n=Math.imul(E,V))+Math.imul(A,F)|0,o=Math.imul(A,V),i=i+Math.imul(M,z)|0,n=(n=n+Math.imul(M,q)|0)+Math.imul(_,z)|0,o=o+Math.imul(_,q)|0,i=i+Math.imul(g,K)|0,n=(n=n+Math.imul(g,$)|0)+Math.imul(y,K)|0,o=o+Math.imul(y,$)|0,i=i+Math.imul(p,J)|0,n=(n=n+Math.imul(p,X)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,X)|0;var Mt=(h+(i=i+Math.imul(c,Q)|0)|0)+((8191&(n=(n=n+Math.imul(c,tt)|0)+Math.imul(f,Q)|0))<<13)|0;h=((o=o+Math.imul(f,tt)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(T,F),n=(n=Math.imul(T,V))+Math.imul(I,F)|0,o=Math.imul(I,V),i=i+Math.imul(E,z)|0,n=(n=n+Math.imul(E,q)|0)+Math.imul(A,z)|0,o=o+Math.imul(A,q)|0,i=i+Math.imul(M,K)|0,n=(n=n+Math.imul(M,$)|0)+Math.imul(_,K)|0,o=o+Math.imul(_,$)|0,i=i+Math.imul(g,J)|0,n=(n=n+Math.imul(g,X)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,X)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var _t=(h+(i=i+Math.imul(c,rt)|0)|0)+((8191&(n=(n=n+Math.imul(c,it)|0)+Math.imul(f,rt)|0))<<13)|0;h=((o=o+Math.imul(f,it)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(S,F),n=(n=Math.imul(S,V))+Math.imul(R,F)|0,o=Math.imul(R,V),i=i+Math.imul(T,z)|0,n=(n=n+Math.imul(T,q)|0)+Math.imul(I,z)|0,o=o+Math.imul(I,q)|0,i=i+Math.imul(E,K)|0,n=(n=n+Math.imul(E,$)|0)+Math.imul(A,K)|0,o=o+Math.imul(A,$)|0,i=i+Math.imul(M,J)|0,n=(n=n+Math.imul(M,X)|0)+Math.imul(_,J)|0,o=o+Math.imul(_,X)|0,i=i+Math.imul(g,Q)|0,n=(n=n+Math.imul(g,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,it)|0;var bt=(h+(i=i+Math.imul(c,ot)|0)|0)+((8191&(n=(n=n+Math.imul(c,st)|0)+Math.imul(f,ot)|0))<<13)|0;h=((o=o+Math.imul(f,st)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(L,F),n=(n=Math.imul(L,V))+Math.imul(P,F)|0,o=Math.imul(P,V),i=i+Math.imul(S,z)|0,n=(n=n+Math.imul(S,q)|0)+Math.imul(R,z)|0,o=o+Math.imul(R,q)|0,i=i+Math.imul(T,K)|0,n=(n=n+Math.imul(T,$)|0)+Math.imul(I,K)|0,o=o+Math.imul(I,$)|0,i=i+Math.imul(E,J)|0,n=(n=n+Math.imul(E,X)|0)+Math.imul(A,J)|0,o=o+Math.imul(A,X)|0,i=i+Math.imul(M,Q)|0,n=(n=n+Math.imul(M,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,i=i+Math.imul(g,rt)|0,n=(n=n+Math.imul(g,it)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,it)|0,i=i+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var Et=(h+(i=i+Math.imul(c,at)|0)|0)+((8191&(n=(n=n+Math.imul(c,ht)|0)+Math.imul(f,at)|0))<<13)|0;h=((o=o+Math.imul(f,ht)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(C,F),n=(n=Math.imul(C,V))+Math.imul(U,F)|0,o=Math.imul(U,V),i=i+Math.imul(L,z)|0,n=(n=n+Math.imul(L,q)|0)+Math.imul(P,z)|0,o=o+Math.imul(P,q)|0,i=i+Math.imul(S,K)|0,n=(n=n+Math.imul(S,$)|0)+Math.imul(R,K)|0,o=o+Math.imul(R,$)|0,i=i+Math.imul(T,J)|0,n=(n=n+Math.imul(T,X)|0)+Math.imul(I,J)|0,o=o+Math.imul(I,X)|0,i=i+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,tt)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,tt)|0,i=i+Math.imul(M,rt)|0,n=(n=n+Math.imul(M,it)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,it)|0,i=i+Math.imul(g,ot)|0,n=(n=n+Math.imul(g,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0,i=i+Math.imul(p,at)|0,n=(n=n+Math.imul(p,ht)|0)+Math.imul(m,at)|0,o=o+Math.imul(m,ht)|0;var At=(h+(i=i+Math.imul(c,ct)|0)|0)+((8191&(n=(n=n+Math.imul(c,ft)|0)+Math.imul(f,ct)|0))<<13)|0;h=((o=o+Math.imul(f,ft)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(G,F),n=(n=Math.imul(G,V))+Math.imul(D,F)|0,o=Math.imul(D,V),i=i+Math.imul(C,z)|0,n=(n=n+Math.imul(C,q)|0)+Math.imul(U,z)|0,o=o+Math.imul(U,q)|0,i=i+Math.imul(L,K)|0,n=(n=n+Math.imul(L,$)|0)+Math.imul(P,K)|0,o=o+Math.imul(P,$)|0,i=i+Math.imul(S,J)|0,n=(n=n+Math.imul(S,X)|0)+Math.imul(R,J)|0,o=o+Math.imul(R,X)|0,i=i+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,tt)|0,i=i+Math.imul(E,rt)|0,n=(n=n+Math.imul(E,it)|0)+Math.imul(A,rt)|0,o=o+Math.imul(A,it)|0,i=i+Math.imul(M,ot)|0,n=(n=n+Math.imul(M,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,i=i+Math.imul(g,at)|0,n=(n=n+Math.imul(g,ht)|0)+Math.imul(y,at)|0,o=o+Math.imul(y,ht)|0,i=i+Math.imul(p,ct)|0,n=(n=n+Math.imul(p,ft)|0)+Math.imul(m,ct)|0,o=o+Math.imul(m,ft)|0;var Nt=(h+(i=i+Math.imul(c,pt)|0)|0)+((8191&(n=(n=n+Math.imul(c,mt)|0)+Math.imul(f,pt)|0))<<13)|0;h=((o=o+Math.imul(f,mt)|0)+(n>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,i=Math.imul(G,z),n=(n=Math.imul(G,q))+Math.imul(D,z)|0,o=Math.imul(D,q),i=i+Math.imul(C,K)|0,n=(n=n+Math.imul(C,$)|0)+Math.imul(U,K)|0,o=o+Math.imul(U,$)|0,i=i+Math.imul(L,J)|0,n=(n=n+Math.imul(L,X)|0)+Math.imul(P,J)|0,o=o+Math.imul(P,X)|0,i=i+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,i=i+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(I,rt)|0,o=o+Math.imul(I,it)|0,i=i+Math.imul(E,ot)|0,n=(n=n+Math.imul(E,st)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,st)|0,i=i+Math.imul(M,at)|0,n=(n=n+Math.imul(M,ht)|0)+Math.imul(_,at)|0,o=o+Math.imul(_,ht)|0,i=i+Math.imul(g,ct)|0,n=(n=n+Math.imul(g,ft)|0)+Math.imul(y,ct)|0,o=o+Math.imul(y,ft)|0;var Tt=(h+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;h=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(G,K),n=(n=Math.imul(G,$))+Math.imul(D,K)|0,o=Math.imul(D,$),i=i+Math.imul(C,J)|0,n=(n=n+Math.imul(C,X)|0)+Math.imul(U,J)|0,o=o+Math.imul(U,X)|0,i=i+Math.imul(L,Q)|0,n=(n=n+Math.imul(L,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,i=i+Math.imul(S,rt)|0,n=(n=n+Math.imul(S,it)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,it)|0,i=i+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,st)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,st)|0,i=i+Math.imul(E,at)|0,n=(n=n+Math.imul(E,ht)|0)+Math.imul(A,at)|0,o=o+Math.imul(A,ht)|0,i=i+Math.imul(M,ct)|0,n=(n=n+Math.imul(M,ft)|0)+Math.imul(_,ct)|0,o=o+Math.imul(_,ft)|0;var It=(h+(i=i+Math.imul(g,pt)|0)|0)+((8191&(n=(n=n+Math.imul(g,mt)|0)+Math.imul(y,pt)|0))<<13)|0;h=((o=o+Math.imul(y,mt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(G,J),n=(n=Math.imul(G,X))+Math.imul(D,J)|0,o=Math.imul(D,X),i=i+Math.imul(C,Q)|0,n=(n=n+Math.imul(C,tt)|0)+Math.imul(U,Q)|0,o=o+Math.imul(U,tt)|0,i=i+Math.imul(L,rt)|0,n=(n=n+Math.imul(L,it)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,it)|0,i=i+Math.imul(S,ot)|0,n=(n=n+Math.imul(S,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,i=i+Math.imul(T,at)|0,n=(n=n+Math.imul(T,ht)|0)+Math.imul(I,at)|0,o=o+Math.imul(I,ht)|0,i=i+Math.imul(E,ct)|0,n=(n=n+Math.imul(E,ft)|0)+Math.imul(A,ct)|0,o=o+Math.imul(A,ft)|0;var xt=(h+(i=i+Math.imul(M,pt)|0)|0)+((8191&(n=(n=n+Math.imul(M,mt)|0)+Math.imul(_,pt)|0))<<13)|0;h=((o=o+Math.imul(_,mt)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(G,Q),n=(n=Math.imul(G,tt))+Math.imul(D,Q)|0,o=Math.imul(D,tt),i=i+Math.imul(C,rt)|0,n=(n=n+Math.imul(C,it)|0)+Math.imul(U,rt)|0,o=o+Math.imul(U,it)|0,i=i+Math.imul(L,ot)|0,n=(n=n+Math.imul(L,st)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,st)|0,i=i+Math.imul(S,at)|0,n=(n=n+Math.imul(S,ht)|0)+Math.imul(R,at)|0,o=o+Math.imul(R,ht)|0,i=i+Math.imul(T,ct)|0,n=(n=n+Math.imul(T,ft)|0)+Math.imul(I,ct)|0,o=o+Math.imul(I,ft)|0;var St=(h+(i=i+Math.imul(E,pt)|0)|0)+((8191&(n=(n=n+Math.imul(E,mt)|0)+Math.imul(A,pt)|0))<<13)|0;h=((o=o+Math.imul(A,mt)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(G,rt),n=(n=Math.imul(G,it))+Math.imul(D,rt)|0,o=Math.imul(D,it),i=i+Math.imul(C,ot)|0,n=(n=n+Math.imul(C,st)|0)+Math.imul(U,ot)|0,o=o+Math.imul(U,st)|0,i=i+Math.imul(L,at)|0,n=(n=n+Math.imul(L,ht)|0)+Math.imul(P,at)|0,o=o+Math.imul(P,ht)|0,i=i+Math.imul(S,ct)|0,n=(n=n+Math.imul(S,ft)|0)+Math.imul(R,ct)|0,o=o+Math.imul(R,ft)|0;var Rt=(h+(i=i+Math.imul(T,pt)|0)|0)+((8191&(n=(n=n+Math.imul(T,mt)|0)+Math.imul(I,pt)|0))<<13)|0;h=((o=o+Math.imul(I,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(G,ot),n=(n=Math.imul(G,st))+Math.imul(D,ot)|0,o=Math.imul(D,st),i=i+Math.imul(C,at)|0,n=(n=n+Math.imul(C,ht)|0)+Math.imul(U,at)|0,o=o+Math.imul(U,ht)|0,i=i+Math.imul(L,ct)|0,n=(n=n+Math.imul(L,ft)|0)+Math.imul(P,ct)|0,o=o+Math.imul(P,ft)|0;var Ot=(h+(i=i+Math.imul(S,pt)|0)|0)+((8191&(n=(n=n+Math.imul(S,mt)|0)+Math.imul(R,pt)|0))<<13)|0;h=((o=o+Math.imul(R,mt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,i=Math.imul(G,at),n=(n=Math.imul(G,ht))+Math.imul(D,at)|0,o=Math.imul(D,ht),i=i+Math.imul(C,ct)|0,n=(n=n+Math.imul(C,ft)|0)+Math.imul(U,ct)|0,o=o+Math.imul(U,ft)|0;var Lt=(h+(i=i+Math.imul(L,pt)|0)|0)+((8191&(n=(n=n+Math.imul(L,mt)|0)+Math.imul(P,pt)|0))<<13)|0;h=((o=o+Math.imul(P,mt)|0)+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,i=Math.imul(G,ct),n=(n=Math.imul(G,ft))+Math.imul(D,ct)|0,o=Math.imul(D,ft);var Pt=(h+(i=i+Math.imul(C,pt)|0)|0)+((8191&(n=(n=n+Math.imul(C,mt)|0)+Math.imul(U,pt)|0))<<13)|0;h=((o=o+Math.imul(U,mt)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863;var kt=(h+(i=Math.imul(G,pt))|0)+((8191&(n=(n=Math.imul(G,mt))+Math.imul(D,pt)|0))<<13)|0;return h=((o=Math.imul(D,mt))+(n>>>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 i=0,n=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=u,i=s,s=n}return 0!==i?r.words[o]=i: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,i=0;i>=1;return i},m.prototype.permute=function(t,e,r,i,n,o){for(var s=0;s>>=1)n++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s>=26,e+=n/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>n}return e}(t);if(0===e.length)return new o(1);for(var r=this,i=0;i=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),u=67108863^67108863>>>o<s)for(this.length-=s,h=0;h=0&&(0!==l||h>=n);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 i(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(a/67108864|0),this.words[n+r]=67108863&o}for(;n>26,this.words[n+r]=67108863&o;if(0===u)return this.strip();for(i(-1===u),u=0,n=0;n>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,s=0|n.words[n.length-1];0!==(r=26-this._countBits(s))&&(n=n.ushln(r),i.iushln(r),s=0|n.words[n.length-1]);var u,a=i.length-n.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|i.words[n.length+c])+(0|i.words[n.length+c-1]);for(f=Math.min(f/s|0,67108863),i._ishlnsubmul(n,f,c);0!==i.negative;)f--,i.negative=0,i._ishlnsubmul(n,1,c),i.isZero()||(i.negative^=1);u&&(u.words[c]=f)}return u&&u.strip(),i.strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:u||null,mod:i}},o.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(u=this.neg().divmod(t,e),"mod"!==e&&(n=u.div.neg()),"div"!==e&&(s=u.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:n,mod:s}):0===this.negative&&0!==t.negative?(u=this.divmod(t.neg(),e),"mod"!==e&&(n=u.div.neg()),{div:n,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 n,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,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},o.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),s=new o(0),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;)(n.isOdd()||s.isOdd())&&(n.iadd(l),s.isub(c)),n.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),n.isub(u),s.isub(a)):(r.isub(e),u.isub(n),a.isub(s))}return{a:u,b:a,gcd:r.iushln(h)}},o.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,s=new o(1),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(n=0===e.cmpn(1)?s:u).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<>>26,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),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){in&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new b(t)},o.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var 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 i(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 i=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)},n(y,g),y.prototype.split=function(t,e){for(var r=Math.min(t.length,9),i=0;i>>22,n=o}n>>>=22,t.words[i-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(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){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},b.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},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(i(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),s=0;!n.isZero()&&0===n.andln(1);)s++,n.iushrn(1);i(!n.isZero());var 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,n),f=this.pow(t,n.addn(1).iushrn(1)),d=this.pow(t,n),p=s;0!==d.cmp(u);){for(var m=d,v=0;0!==m.cmp(u);v++)m=m.redSqr();i(v=0;i--){for(var h=e.words[i],l=a-1;l>=0;l--){var c=h>>l&1;n!==r[0]&&(n=this.sqr(n)),0!==c||0!==s?(s<<=1,s|=c,(4===++u||0===i&&0===l)&&(n=this.mul(n,r[s]),u=0,s=0)):u=0}a=26}return n},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)},n(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),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},E.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},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 i,n=this&&this.__extends||(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},function(t,e){function r(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__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(2),h=r(11),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 i=t.call(this)||this;if(c.checkNew(i,e),"string"==typeof r)a.isHexString(r)?("0x"==r&&(r="0x0"),h.defineReadOnly(i,"_hex",r)):"-"===r[0]&&a.isHexString(r.substring(1))?h.defineReadOnly(i,"_hex",r):r.match(/^-?[0-9]*$/)?(""==r&&(r="0"),h.defineReadOnly(i,"_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(i,"_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(i,"_hex",r._hex):r.toHexString?h.defineReadOnly(i,"_hex",d(p(r.toHexString()))):a.isArrayish(r)?h.defineReadOnly(i,"_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 i}return n(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 i=JSON.stringify(r);Object.defineProperty(t,e,{enumerable:!0,get:function(){return JSON.parse(i)}})},e.resolveProperties=function(t){var e={},r=[];return Object.keys(t).forEach(function(i){var n=t[i];n instanceof Promise?r.push(n.then(function(t){return e[i]=t,null})):e[i]=n}),Promise.all(r).then(function(){return e})},e.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 i=r(3);e.parseError=function(t){return t instanceof i.ProviderError?t:new i.ProviderError(i.ProviderIssue.GENERAL,t)}},function(t,e,r){"use strict";var i,n="object"==typeof Reflect?Reflect:null,o=n&&"function"==typeof n.apply?n.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};i=n&&"function"==typeof n.ownKeys?n.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,i){var n,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]=i?[r,s]:[s,r]:i?s.unshift(r):s.push(r),(n=h(t))>0&&s.length>n&&!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 i={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},n=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=n[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,n=o;break}if(n<0)return this;0===n?r.shift():function(t,e){for(;e+1=0;i--)this.removeListener(t,e[i]);return this},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?i(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 i=new(r(31).AbiCoder);e.encodeParameters=function(t,e){return i.encode(t,e)},e.decodeParameters=function(t,e){return i.decode(t,e)}},function(t,e,r){"use strict";var i,n=this&&this.__extends||(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},function(t,e){function r(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var s=r(8),u=r(10),a=r(2),h=r(40),l=r(11),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 i={type:"",name:"",state:{allowType:!0}},n=i,o=0;o1){var n=r[1].match(m);if(""!=n[1].trim()||""!=n[3].trim())throw new Error("unexpected tokens");j(n[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,i,n){this.coerceFunc=t,this.name=e,this.type=r,this.localName=i,this.dynamic=n}}(),_=function(t){function e(e){var r=t.call(this,e.coerceFunc,e.name,e.type,void 0,e.dynamic)||this;return l.defineReadOnly(r,"coder",e),r}return n(e,t),e.prototype.encode=function(t){return this.coder.encode(t)},e.prototype.decode=function(t,e){return this.coder.decode(t,e)},e}(M),b=function(t){function e(e,r){return t.call(this,e,"null","",r,!1)||this}return n(e,t),e.prototype.encode=function(t){return 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,i,n){var o=this,s=(i?"int":"uint")+8*r;return(o=t.call(this,e,s,s,n,!1)||this).size=r,o.signed=i,o}return n(e,t),e.prototype.encode=function(t){try{var e=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?i:"")+"]",u=-1===i||r.dynamic;return(o=t.call(this,e,"array",s,n,u)||this).coder=r,o.length=i,o}return n(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 i=[],n=0;n256||n%8!=0)&&c.throwError("invalid "+r[1]+" bit length",c.INVALID_ARGUMENT,{arg:"param",value:e}),new E(t,n/8,"int"===r[1],e.name);if(r=e.type.match(f))return(0===(n=parseInt(r[1]))||n>32)&&c.throwError("invalid bytes length",c.INVALID_ARGUMENT,{arg:"param",value:e}),new T(t,n,e.name);if(r=e.type.match(p)){var n=parseInt(r[2]||"-1");return(e=l.jsonCopy(e)).type=r[1],new C(t,D(t,e),n,e.name)}return"tuple"===e.type.substring(0,5)?function(t,e,r){e||(e=[]);var i=[];return e.forEach(function(e){i.push(D(t,e))}),new U(t,i,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 i=r(35),n=r(2);e.keccak256=function(t){return"0x"+i.keccak_256(n.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 i="object"==typeof window?window:{};!i.JS_SHA3_NO_NODE_JS&&"object"==typeof e&&e.versions&&e.versions.node&&(i=r);for(var n=!i.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(i){return new _(t,e,t).update(i)[r]()}},c=function(t,e,r){return function(i,n){return new _(t,e,n).update(i)[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 i=0;i>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var i=0;i<50;++i)this.s[i]=0}_.prototype.update=function(t){var e="string"!=typeof t;e&&t.constructor===ArrayBuffer&&(t=new Uint8Array(t));for(var r,i,n=t.length,o=this.blocks,u=this.byteCount,a=this.blockCount,h=0,l=this.s;h>2]|=t[h]<>2]|=i<>2]|=(192|i>>6)<>2]|=(128|63&i)<=57344?(o[r>>2]|=(224|i>>12)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<>2]|=(240|i>>18)<>2]|=(128|i>>12&63)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<=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 n&&(t=r[s],n>0&&(a+=o[t>>4&15]+o[15&t]),n>1&&(a+=o[t>>12&15]+o[t>>8&15]),n>2&&(a+=o[t>>20&15]+o[t>>16&15])),a},_.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,i=this.outputBlocks,n=this.extraBytes,o=0,s=0,u=this.outputBits>>3;t=n?new ArrayBuffer(i+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(i)}return o&&(t=u<<2,e=i[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,i,n,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,it,nt,ot,st,ut,at,ht,lt;for(i=0;i<48;i+=2)n=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],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=n^(h<<1|l>>>31),r=o^(l<<1|h>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=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^(n<<1|o>>>31),r=f^(o<<1|n>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,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,it=t[17]<<23|t[16]>>>9,nt=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^~it&ot,t[41]=rt^~nt&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]=it^~ot&ut,t[43]=nt^~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&it,t[49]=lt^~rt&nt,t[0]^=u[i],t[1]^=u[i+1]};if(n)t.exports=p;else for(v=0;v1)for(var r=1;r>=8;return e}function o(t,e,r){for(var i=0,n=0;ne+1+i)throw new Error("invalid rlp")}return{consumed:1+i,result:n}}function u(t,e){if(0===t.length)throw new Error("invalid rlp data");if(t[e]>=248){if(e+1+(r=t[e]-247)>t.length)throw new Error("too short");if(e+1+r+(n=o(t,e+1,r))>t.length)throw new Error("to short");return s(t,e,e+1+r,r+n)}if(t[e]>=192){if(e+1+(n=t[e]-192)>t.length)throw new Error("invalid rlp data");return s(t,e,e+1,n)}if(t[e]>=184){var r;if(e+1+(r=t[e]-183)>t.length)throw new Error("invalid rlp data");if(e+1+r+(n=o(t,e+1,r))>t.length)throw new Error("invalid rlp data");return{consumed:1+r+n,result:i.hexlify(t.slice(e+1+r,e+1+r+n))}}if(t[e]>=128){var n;if(e+1+(n=t[e]-128)>t.length)throw new Error("invlaid rlp data");return{consumed:1+n,result:i.hexlify(t.slice(e+1,e+1+n))}}return{consumed:1,result:i.hexlify(t[e])}}e.encode=function(t){return i.hexlify(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=n(r.length)).unshift(247+o.length),o.concat(r))}var o,s=Array.prototype.slice.call(i.arrayify(e));return 1===s.length&&s[0]<=127?s:s.length<=55?(s.unshift(128+s.length),s):((o=n(s.length)).unshift(183+o.length),o.concat(s))}(t))},e.decode=function(t){var e=i.arrayify(t),r=u(e,0);if(r.consumed!==e.length)throw new Error("invalid rlp data");return r.result}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){return function(){}}();e.BigNumber=i;var n=function(){return function(){}}();e.Indexed=n;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 i,n=r(2);!function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"}(i=e.UnicodeNormalizationForm||(e.UnicodeNormalizationForm={})),e.toUtf8Bytes=function(t,e){void 0===e&&(e=i.current),e!=i.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 n.arrayify(r)},e.toUtf8String=function(t){t=n.arrayify(t);for(var e="",r=0;r>7!=0){if(i>>6!=2){var o=null;if(i>>5==6)o=1;else if(i>>4==14)o=2;else if(i>>3==30)o=3;else if(i>>2==62)o=4;else{if(i>>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=i&(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(i)}return e}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(10);e.BigNumber=i.BigNumber,e.bigNumberify=i.bigNumberify},function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))(function(n,o){function s(t){try{a(i.next(t))}catch(t){o(t)}}function u(t){try{a(i.throw(t))}catch(t){o(t)}}function a(t){t.done?n(t.value):new r(function(e){e(t.value)}).then(s,u)}a((i=i.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const n=r(5),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 i(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 i(this,void 0,void 0,function*(){const t=yield this.getTransactionObject();if(!t||t.to&&"0x0"!==t.to||(t.to=yield this.getTransactionReceipt().then(t=>t?t.contractAddress:null)),t&&t.to){if(this._senderId=n.normalizeAddress(t.from),this._receiverId=n.normalizeAddress(t.to),this._confirmations=yield this.getLastBlock().then(e=>e-parseInt(t.blockNumber||e)).then(t=>t<0?0:t),this._confirmations>=this._provider.requiredConfirmations)return this._status=u.COMPLETED,this.emit(o.MutationEvent.COMPLETE,this);this.emit(o.MutationEvent.CONFIRM,this)}-1===this._provider.mutationTimeout||Date.now()-this._startedthis.normalizeAddress(t))}get orderGatewayId(){return this._orderGatewayId||null}set orderGatewayId(t){this._orderGatewayId=this.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 i(this,void 0,void 0,function*(){return(yield this.post({method:"eth_accounts",params:[]})).result.map(t=>this.normalizeAddress(t))})}getNetworkVersion(){return i(this,void 0,void 0,function*(){return(yield this.post({method:"net_version",params:[]})).result})}isCurrentAccount(t){return this.accountId===this.normalizeAddress(t)}isUnsafeRecipientId(t){const e=this.normalizeAddress(t);return!!this.unsafeRecipientIds.find(t=>t===e)}post(t){return i(this,void 0,void 0,function*(){const e=Object.assign({},t);if("eth_sendTransaction"===e.method&&e.params.length){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 i(this,void 0,void 0,function*(){const e=Object.assign({jsonrpc:"2.0",id:t.id||this.getNextId(),params:[]},t);return new Promise((t,r)=>{this._client.send(e,(i,n)=>i?r(i):n.error?r(n.error):n.id!==e.id?r("Invalid RPC id"):t(n))}).catch(t=>{throw u.parseError(t)})})}getNextId(){return this._id++,this._id}normalizeAddress(t){return n.normalizeAddress(t)}}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,r){window.$0xcert=window.$0xcert||{},Object.assign(window.$0xcert,r(111))},function(t,e,r){"use strict";function i(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),i(r(1)),i(r(112))},function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))(function(n,o){function s(t){try{a(i.next(t))}catch(t){o(t)}}function u(t){try{a(i.throw(t))}catch(t){o(t)}}function a(t){t.done?n(t.value):new r(function(e){e(t.value)}).then(s,u)}a((i=i.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const n=r(1);class o extends n.GenericProvider{static getInstance(){return new o}constructor(t){super(Object.assign({},t,{signMethod:n.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 i(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 i(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 i(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 i(this,void 0,void 0,function*(){const t=yield this.getNetworkVersion();t!==this._networkVersion&&(this.emit(n.ProviderEvent.NETWORK_CHANGE,t,this._networkVersion),this._networkVersion=t),this.accountId=yield this.getAvailableAccounts().then(t=>t[0]),setTimeout(()=>this.installEvents(),1e3)})}}e.MetamaskProvider=o}]); \ 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..4090e5714 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=113)}([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(5)),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(7)),n(r(6)),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(6)),n(r(29)),n(r(7)),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});const n=r(8);e.normalizeAddress=function(t){return t?n.getAddress(t):null}},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(9)),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,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,z=D>>>13,V=0|u[1],Z=8191&V,q=V>>>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,z))+Math.imul(f,B)|0))<<13)|0;h=((o=Math.imul(f,z))+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(p,B),i=(i=Math.imul(p,z))+Math.imul(m,B)|0,o=Math.imul(m,z);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,z))+Math.imul(g,B)|0,o=Math.imul(g,z),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,z))+Math.imul(_,B)|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,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,z))+Math.imul(A,B)|0,o=Math.imul(A,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,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,z))+Math.imul(I,B)|0,o=Math.imul(I,z),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(O,B),i=(i=Math.imul(O,z))+Math.imul(S,B)|0,o=Math.imul(S,z),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,z))+Math.imul(k,B)|0,o=Math.imul(k,z),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,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,z))+Math.imul(j,B)|0,o=Math.imul(j,z),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,K)|0,i=(i=i+Math.imul(O,H)|0)+Math.imul(S,K)|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(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,z))+Math.imul(F,B)|0,o=Math.imul(F,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(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(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(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(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,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(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,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(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(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(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(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(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]=It,a[12]=xt,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(2),h=r(11),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(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(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){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,O,S,R,P,k,L,C,j,U,G,F,D,B,z,V,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,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,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,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,z=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&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^~O&R,t[13]=x^~S&P,t[22]=U^~F&B,t[23]=G^~D&z,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]=O^~R&k,t[15]=S^~P&L,t[24]=F^~B&V,t[25]=D^~z&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^~V&C,t[27]=z^~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]=V^~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(8),u=r(10),a=r(2),h=r(40),l=r(11),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){ /** * [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,O,S,R,P,k,L,C,j,U,G,F,D,B,z,V,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,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,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,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,z=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&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^~O&R,t[13]=x^~S&P,t[22]=U^~F&B,t[23]=G^~D&z,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]=O^~R&k,t[15]=S^~P&L,t[24]=F^~B&V,t[25]=D^~z&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^~V&C,t[27]=z^~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]=V^~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(10);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(5),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._startedthis.normalizeAddress(t))}get orderGatewayId(){return this._orderGatewayId||null}set orderGatewayId(t){this._orderGatewayId=this.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.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.normalizeAddress(t)}isUnsafeRecipientId(t){const e=this.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}normalizeAddress(t){return i.normalizeAddress(t)}}},,,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(76)),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(1),o=r(0),s=r(15),u=r(77),a=r(78),h=r(79),l=r(80),c=r(81),f=r(82),d=r(83);class p{static getInstance(t,e){return new p(t,e)}constructor(t,e){this._id=this.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=this.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=this.normalizeOrderIds(t),a.default(this,t,e)})}cancel(t){return n(this,void 0,void 0,function*(){return t=this.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=this.normalizeOrderIds(t),d.default(this,t,e)})}getOrderDataClaim(t){return n(this,void 0,void 0,function*(){return t=this.normalizeOrderIds(t),c.default(this,t)})}normalizeAddress(t){return o.normalizeAddress(t)}normalizeOrderIds(t){return s.normalizeOrderIds(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(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..bd8444e8b 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=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(30)),n(r(5)),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(7)),n(r(6)),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(6)),n(r(29)),n(r(7)),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});const n=r(8);e.normalizeAddress=function(t){return t?n.getAddress(t):null}},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(9)),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(9)),a=r(2),h=r(11),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(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(8),u=r(10),a=r(2),h=r(40),l=r(11),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){ /** * [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(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(10);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(5),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._startedthis.normalizeAddress(t))}get orderGatewayId(){return this._orderGatewayId||null}set orderGatewayId(t){this._orderGatewayId=this.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.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.normalizeAddress(t)}isUnsafeRecipientId(t){const e=this.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}normalizeAddress(t){return i.normalizeAddress(t)}}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,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(85))},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new 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(86),u=r(87),a=r(88),h=r(89),l=r(90),c=r(91),f=r(92);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=this.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=this.normalizeAddress(t),e=this.normalizeAddress(e),l.default(this,t,e)})}getBalance(t){return n(this,void 0,void 0,function*(){return t=this.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.normalizeAddress(e),r=this.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.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.normalizeAddress(t),s.default(this,t,"0")})}transferValue(t){return n(this,void 0,void 0,function*(){const e=this.normalizeAddress(t.senderId),r=this.normalizeAddress(t.receiverId);return t.senderId?h.default(this,e,r,t.value):a.default(this,r,t.value)})}normalizeAddress(t){return i.normalizeAddress(t)}}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(84))}]); \ No newline at end of file diff --git a/dist/0xcert-ethereum.min.js b/dist/0xcert-ethereum.min.js index 67fe3a214..3799caca3 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(30)),n(r(5)),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(7)),n(r(6)),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(6)),n(r(29)),n(r(7)),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});const n=r(8);e.normalizeAddress=function(t){return t?n.getAddress(t):null}},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(9)),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],z=8191&F,B=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,z))|0)+((8191&(i=(i=Math.imul(l,B))+Math.imul(d,z)|0))<<13)|0;h=((o=Math.imul(d,B))+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(p,z),i=(i=Math.imul(p,B))+Math.imul(v,z)|0,o=Math.imul(v,B);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,z),i=(i=Math.imul(y,B))+Math.imul(g,z)|0,o=Math.imul(g,B),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(_,z),i=(i=Math.imul(_,B))+Math.imul(M,z)|0,o=Math.imul(M,B),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,z),i=(i=Math.imul(A,B))+Math.imul(E,z)|0,o=Math.imul(E,B),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,z),i=(i=Math.imul(P,B))+Math.imul(T,z)|0,o=Math.imul(T,B),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,z),i=(i=Math.imul(N,B))+Math.imul(O,z)|0,o=Math.imul(O,B),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,z),i=(i=Math.imul(R,B))+Math.imul(k,z)|0,o=Math.imul(k,B),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,z),i=(i=Math.imul(j,B))+Math.imul(C,z)|0,o=Math.imul(C,B),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,z),i=(i=Math.imul(G,B))+Math.imul(D,z)|0,o=Math.imul(D,B),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(9)),a=r(2),h=r(11),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(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(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 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,z,B,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,z=t[38]<<8|t[39]>>>24,B=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&z,t[23]=G^~F&B,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^~z&V,t[25]=F^~B&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]=z^~V&j,t[27]=B^~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(8),u=r(10),a=r(2),h=r(40),c=r(11),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){ /** * [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],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,z,B,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,z=t[38]<<8|t[39]>>>24,B=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&z,t[23]=G^~F&B,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^~z&V,t[25]=F^~B&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]=z^~V&j,t[27]=B^~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(10);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(5),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._startedthis.normalizeAddress(t))}get orderGatewayId(){return this._orderGatewayId||null}set orderGatewayId(t){this._orderGatewayId=this.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.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.normalizeAddress(t)}isUnsafeRecipientId(t){const e=this.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}normalizeAddress(t){return i.normalizeAddress(t)}}},,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});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(50))},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(76)),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(3),s=r(51),u=r(52),a=r(53),h=r(54),c=r(55),l=r(56),d=r(57),f=r(58),p=r(59),v=r(60),m=r(61),y=r(62),g=r(63),w=r(64),_=r(65),M=r(66),b=r(68),A=r(69),E=r(70),x=r(71),P=r(72),T=r(73),I=r(74),N=r(75);class O{static deploy(t,e){return n(this,void 0,void 0,function*(){return a.default(t,e)})}static getInstance(t,e){return new O(t,e)}constructor(t,e){this._id=this.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=this.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.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.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.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.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.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.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.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.normalizeAddress(t.senderId),r=this.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.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.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.normalizeAddress(t),e=this.normalizeAddress(e),I.default(this,t,e)})}getProxyId(){return-1===this.provider.unsafeRecipientIds.indexOf(this.id)?3:2}normalizeAddress(t){return i.normalizeAddress(t)}}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(45),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(67),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(45),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";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new 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(77),a=r(78),h=r(79),c=r(80),l=r(81),d=r(82),f=r(83);class p{static getInstance(t,e){return new p(t,e)}constructor(t,e){this._id=this.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=this.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=this.normalizeOrderIds(t),a.default(this,t,e)})}cancel(t){return n(this,void 0,void 0,function*(){return t=this.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=this.normalizeOrderIds(t),f.default(this,t,e)})}getOrderDataClaim(t){return n(this,void 0,void 0,function*(){return t=this.normalizeOrderIds(t),l.default(this,t)})}normalizeAddress(t){return o.normalizeAddress(t)}normalizeOrderIds(t){return s.normalizeOrderIds(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(85))},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new 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(86),u=r(87),a=r(88),h=r(89),c=r(90),l=r(91),d=r(92);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=this.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=this.normalizeAddress(t),e=this.normalizeAddress(e),c.default(this,t,e)})}getBalance(t){return n(this,void 0,void 0,function*(){return t=this.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=this.normalizeAddress(e),r=this.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=this.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.normalizeAddress(t),s.default(this,t,"0")})}transferValue(t){return n(this,void 0,void 0,function*(){const e=this.normalizeAddress(t.senderId),r=this.normalizeAddress(t.receiverId);return t.senderId?h.default(this,e,r,t.value):a.default(this,r,t.value)})}normalizeAddress(t){return i.normalizeAddress(t)}}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){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}(r(94))},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new 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(95),o=r(16),s=r(97);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(96))},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]+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(6)),n(r(29)),n(r(7)),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});const n=r(8);e.normalizeAddress=function(t){return t?n.getAddress(t):null}},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(9)),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,O=I>>>13,S=0|s[7],R=8191&S,L=S>>>13,C=0|s[8],k=8191&C,j=C>>>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,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,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(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,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(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,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(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,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(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,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(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,z))+Math.imul(O,F)|0,o=Math.imul(O,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(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,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(O,Z)|0,o=o+Math.imul(O,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(k,F),i=(i=Math.imul(k,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(O,H)|0,o=o+Math.imul(O,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,z))+Math.imul(D,F)|0,o=Math.imul(D,z),n=n+Math.imul(k,Z)|0,i=(i=i+Math.imul(k,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(O,J)|0,o=o+Math.imul(O,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(k,H)|0,i=(i=i+Math.imul(k,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(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(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(k,J)|0,i=(i=i+Math.imul(k,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(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(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(k,Q)|0,i=(i=i+Math.imul(k,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(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(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(k,rt)|0,i=(i=i+Math.imul(k,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(O,at)|0,o=o+Math.imul(O,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(k,ot)|0,i=(i=i+Math.imul(k,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(O,ct)|0,o=o+Math.imul(O,dt)|0;var Ot=(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)+(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(k,at)|0,i=(i=i+Math.imul(k,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 St=(h+(n=n+Math.imul(P,pt)|0)|0)+((8191&(i=(i=i+Math.imul(P,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(k,ct)|0,i=(i=i+Math.imul(k,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(k,pt)|0)|0)+((8191&(i=(i=i+Math.imul(k,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 Ct=(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)+(Ct>>>26)|0,Ct&=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]=Ot,a[15]=St,a[16]=Rt,a[17]=Lt,a[18]=Ct,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(9)),a=r(2),h=r(11),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(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,O,S,R,L,C,k,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,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,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,k=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,S=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,C=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&O,t[20]=k^~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&S,t[13]=I^~O&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^~S&L,t[15]=O^~R&C,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<,t[6]=_^~A&v,t[7]=b^~E&m,t[16]=S^~L&x,t[17]=R^~C&T,t[26]=F^~V&k,t[27]=z^~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]=C^~T&I,t[28]=V^~k&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(8),u=r(10),a=r(2),h=r(40),l=r(11),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 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 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){ +/** + * [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]()}},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,O,S,R,L,C,k,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,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,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,k=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,S=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,C=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&O,t[20]=k^~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&S,t[13]=I^~O&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^~S&L,t[15]=O^~R&C,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<,t[6]=_^~A&v,t[7]=b^~E&m,t[16]=S^~L&x,t[17]=R^~C&T,t[26]=F^~V&k,t[27]=z^~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]=C^~T&I,t[28]=V^~k&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(10);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(5),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._startedthis.normalizeAddress(t))}get orderGatewayId(){return this._orderGatewayId||null}set orderGatewayId(t){this._orderGatewayId=this.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.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.normalizeAddress(t)}isUnsafeRecipientId(t){const e=this.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}normalizeAddress(t){return i.normalizeAddress(t)}}},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";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(50))},,function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(5);e.normalizeAddress=function(t){return t?["0x",...(t=n.normalizeAddress(t.toLowerCase())).substr(2).split("").map(t=>t==t.toLowerCase()?t.toUpperCase():t.toLowerCase())].join(""):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(51),u=r(52),a=r(53),h=r(54),l=r(55),c=r(56),d=r(57),f=r(58),p=r(59),v=r(60),m=r(61),y=r(62),g=r(63),w=r(64),M=r(65),_=r(66),b=r(68),A=r(69),E=r(70),x=r(71),T=r(72),N=r(73),I=r(74),P=r(75);class O{static deploy(t,e){return n(this,void 0,void 0,function*(){return a.default(t,e)})}static getInstance(t,e){return new O(t,e)}constructor(t,e){this._id=this.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=this.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.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.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.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.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.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=this.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.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=this.normalizeAddress(t.senderId),r=this.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.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.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.normalizeAddress(t),e=this.normalizeAddress(e),I.default(this,t,e)})}getProxyId(){return-1===this.provider.unsafeRecipientIds.indexOf(this.id)?3:2}normalizeAddress(t){return i.normalizeAddress(t)}}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(45),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(67),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(45),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";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(101))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(47),i=r(44);e.AssetLedger=class extends n.AssetLedger{normalizeAddress(t){return i.normalizeAddress(t)}}},,,,,,,,,,,,,,function(t,e,r){window.$0xcert=window.$0xcert||{},Object.assign(window.$0xcert,r(100))}]); \ 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..f4f0e1527 --- /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=116)}([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(5)),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(7)),n(r(6)),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(6)),n(r(29)),n(r(7)),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});const n=r(8);e.normalizeAddress=function(t){return t?n.getAddress(t):null}},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(9)),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,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,H=0|u[2],$=8191&H,K=H>>>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,$)|0)|0)+((8191&(i=(i=i+Math.imul(c,K)|0)+Math.imul(f,$)|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,$)|0,i=(i=i+Math.imul(p,K)|0)+Math.imul(m,$)|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,$)|0,i=(i=i+Math.imul(y,K)|0)+Math.imul(g,$)|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,$)|0,i=(i=i+Math.imul(M,K)|0)+Math.imul(_,$)|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,$)|0,i=(i=i+Math.imul(E,K)|0)+Math.imul(A,$)|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,$)|0,i=(i=i+Math.imul(T,K)|0)+Math.imul(I,$)|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,$)|0,i=(i=i+Math.imul(O,K)|0)+Math.imul(S,$)|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,$)|0,i=(i=i+Math.imul(P,K)|0)+Math.imul(L,$)|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,$)|0,i=(i=i+Math.imul(C,K)|0)+Math.imul(j,$)|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,$),i=(i=Math.imul(G,K))+Math.imul(D,$)|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(2),h=r(11),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(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,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],$=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,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^~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^~$&J,t[31]=H^~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]=$^~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&H,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&$,t[39]=tt^~H&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(8),u=r(10),a=r(2),h=r(40),l=r(11),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,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){ +/** + * [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],$=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,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^~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^~$&J,t[31]=H^~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]=$^~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&H,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&$,t[39]=tt^~H&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(10);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(5),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._startedthis.normalizeAddress(t))}get orderGatewayId(){return this._orderGatewayId||null}set orderGatewayId(t){this._orderGatewayId=this.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.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.normalizeAddress(t)}isUnsafeRecipientId(t){const e=this.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}normalizeAddress(t){return i.normalizeAddress(t)}}},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";Object.defineProperty(e,"__esModule",{value:!0});const n=r(5);e.normalizeAddress=function(t){return t?["0x",...(t=n.normalizeAddress(t.toLowerCase())).substr(2).split("").map(t=>t==t.toLowerCase()?t.toUpperCase():t.toLowerCase())].join(""):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(1)),n(r(99))},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},,,,,,,,,,,,,,,,,function(t,e,r){window.$0xcert=window.$0xcert||{},Object.assign(window.$0xcert,r(117))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(98);e.MutationEvent=n.MutationEvent,e.ProviderEvent=n.ProviderEvent,e.ProviderIssue=n.ProviderIssue,e.ProviderError=n.ProviderError,e.parseError=n.parseError,e.MutationStatus=n.MutationStatus,e.Mutation=n.Mutation,e.GenericProvider=n.GenericProvider,e.SignMethod=n.SignMethod,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(98),i=r(44);e.HttpProvider=class extends n.HttpProvider{normalizeAddress(t){return i.normalizeAddress(t)}}}]); \ 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..572f7b1f0 --- /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(30)),n(r(5)),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(7)),n(r(6)),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(6)),n(r(29)),n(r(7)),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});const n=r(8);e.normalizeAddress=function(t){return t?n.getAddress(t):null}},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(9)),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],I=8191&N,T=N>>>13,x=0|s[6],O=8191&x,S=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,z=D>>>13,V=0|u[1],Z=8191&V,q=V>>>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,z))+Math.imul(f,B)|0))<<13)|0;h=((o=Math.imul(f,z))+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(p,B),i=(i=Math.imul(p,z))+Math.imul(m,B)|0,o=Math.imul(m,z);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,z))+Math.imul(g,B)|0,o=Math.imul(g,z),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,z))+Math.imul(_,B)|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,$)|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,z))+Math.imul(A,B)|0,o=Math.imul(A,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,$)|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(I,B),i=(i=Math.imul(I,z))+Math.imul(T,B)|0,o=Math.imul(T,z),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,z))+Math.imul(S,B)|0,o=Math.imul(S,z),n=n+Math.imul(I,Z)|0,i=(i=i+Math.imul(I,q)|0)+Math.imul(T,Z)|0,o=o+Math.imul(T,q)|0,n=n+Math.imul(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,z))+Math.imul(k,B)|0,o=Math.imul(k,z),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(I,$)|0,i=(i=i+Math.imul(I,H)|0)+Math.imul(T,$)|0,o=o+Math.imul(T,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,z))+Math.imul(j,B)|0,o=Math.imul(j,z),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(I,X)|0,i=(i=i+Math.imul(I,W)|0)+Math.imul(T,X)|0,o=o+Math.imul(T,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,z))+Math.imul(F,B)|0,o=Math.imul(F,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(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(I,Q)|0,i=(i=i+Math.imul(I,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(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(I,rt)|0,i=(i=i+Math.imul(I,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 It=(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)+(It>>>26)|0,It&=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(I,ot)|0,i=(i=i+Math.imul(I,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,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(I,at)|0,i=(i=i+Math.imul(I,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 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(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(I,ct)|0,i=(i=i+Math.imul(I,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(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(I,pt)|0)|0)+((8191&(i=(i=i+Math.imul(I,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(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]=It,a[11]=Tt,a[12]=xt,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(2),h=r(11),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(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(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){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,I,T,x,O,S,R,P,k,L,C,j,U,G,F,D,B,z,V,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,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,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,I=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,T=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,z=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]=I^~x&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]=T^~O&R,t[13]=x^~S&P,t[22]=U^~F&B,t[23]=G^~D&z,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&V,t[25]=D^~z&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&I,t[26]=B^~V&C,t[27]=z^~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&T,t[19]=L^~I&x,t[28]=V^~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(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(8),u=r(10),a=r(2),h=r(40),l=r(11),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 I(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){ +/** + * [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,I,T,x,O,S,R,P,k,L,C,j,U,G,F,D,B,z,V,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,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,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,I=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,T=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,z=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]=I^~x&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]=T^~O&R,t[13]=x^~S&P,t[22]=U^~F&B,t[23]=G^~D&z,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&V,t[25]=D^~z&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&I,t[26]=B^~V&C,t[27]=z^~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&T,t[19]=L^~I&x,t[28]=V^~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(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(10);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(5),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._startedthis.normalizeAddress(t))}get orderGatewayId(){return this._orderGatewayId||null}set orderGatewayId(t){this._orderGatewayId=this.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.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.normalizeAddress(t)}isUnsafeRecipientId(t){const e=this.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}normalizeAddress(t){return i.normalizeAddress(t)}}},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";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(76)),n(r(46))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(5);e.normalizeAddress=function(t){return t?["0x",...(t=n.normalizeAddress(t.toLowerCase())).substr(2).split("").map(t=>t==t.toLowerCase()?t.toUpperCase():t.toLowerCase())].join(""):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(1),o=r(0),s=r(15),u=r(77),a=r(78),h=r(79),l=r(80),c=r(81),f=r(82),d=r(83);class p{static getInstance(t,e){return new p(t,e)}constructor(t,e){this._id=this.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=this.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=this.normalizeOrderIds(t),a.default(this,t,e)})}cancel(t){return n(this,void 0,void 0,function*(){return t=this.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=this.normalizeOrderIds(t),d.default(this,t,e)})}getOrderDataClaim(t){return n(this,void 0,void 0,function*(){return t=this.normalizeOrderIds(t),c.default(this,t)})}normalizeAddress(t){return o.normalizeAddress(t)}normalizeOrderIds(t){return s.normalizeOrderIds(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){"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(103))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(48),i=r(44),o=r(104);e.OrderGateway=class extends n.OrderGateway{normalizeAddress(t){return i.normalizeAddress(t)}normalizeOrderIds(t){return o.normalizeOrderIds(t)}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(44);e.normalizeOrderIds=function(t){return(t=JSON.parse(JSON.stringify(t))).makerId=n.normalizeAddress(t.makerId),t.takerId=n.normalizeAddress(t.takerId),t.actions.forEach(t=>{t.ledgerId=n.normalizeAddress(t.ledgerId),t.receiverId=n.normalizeAddress(t.receiverId),t.senderId=n.normalizeAddress(t.senderId)}),t}},,,,,,,,,,,,,,,function(t,e,r){window.$0xcert=window.$0xcert||{},Object.assign(window.$0xcert,r(102))}]); \ 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..0494e5021 --- /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(30)),n(r(5)),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(7)),n(r(6)),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(6)),n(r(29)),n(r(7)),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});const n=r(8);e.normalizeAddress=function(t){return t?n.getAddress(t):null}},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(9)),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],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(2),h=r(11),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(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,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(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(8),u=r(10),a=r(2),h=r(40),l=r(11),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){ +/** + * [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(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(10);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(5),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._startedthis.normalizeAddress(t))}get orderGatewayId(){return this._orderGatewayId||null}set orderGatewayId(t){this._orderGatewayId=this.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.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.normalizeAddress(t)}isUnsafeRecipientId(t){const e=this.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}normalizeAddress(t){return i.normalizeAddress(t)}}},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";Object.defineProperty(e,"__esModule",{value:!0});const n=r(5);e.normalizeAddress=function(t){return t?["0x",...(t=n.normalizeAddress(t.toLowerCase())).substr(2).split("").map(t=>t==t.toLowerCase()?t.toUpperCase():t.toLowerCase())].join(""):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(85))},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new 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(86),u=r(87),a=r(88),h=r(89),l=r(90),c=r(91),f=r(92);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=this.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=this.normalizeAddress(t),e=this.normalizeAddress(e),l.default(this,t,e)})}getBalance(t){return n(this,void 0,void 0,function*(){return t=this.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.normalizeAddress(e),r=this.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.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.normalizeAddress(t),s.default(this,t,"0")})}transferValue(t){return n(this,void 0,void 0,function*(){const e=this.normalizeAddress(t.senderId),r=this.normalizeAddress(t.receiverId);return t.senderId?h.default(this,e,r,t.value):a.default(this,r,t.value)})}normalizeAddress(t){return i.normalizeAddress(t)}}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){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}(r(106))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(84),i=r(44);e.ValueLedger=class extends n.ValueLedger{normalizeAddress(t){return i.normalizeAddress(t)}}},,,,,,,,,,,,,,function(t,e,r){window.$0xcert=window.$0xcert||{},Object.assign(window.$0xcert,r(105))}]); \ 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..cc1694042 --- /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(30)),n(r(5)),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(7)),n(r(6)),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(6)),n(r(29)),n(r(7)),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});const n=r(8);e.normalizeAddress=function(t){return t?n.getAddress(t):null}},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(9)),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,b=w>>>13,M=0|s[4],A=8191&M,E=M>>>13,x=0|s[5],P=8191&x,I=x>>>13,T=0|s[6],O=8191&T,N=T>>>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,z=G>>>13,D=0|u[0],F=8191&D,B=D>>>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,F))|0)+((8191&(i=(i=Math.imul(l,B))+Math.imul(d,F)|0))<<13)|0;h=((o=Math.imul(d,B))+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(p,F),i=(i=Math.imul(p,B))+Math.imul(v,F)|0,o=Math.imul(v,B);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,F),i=(i=Math.imul(y,B))+Math.imul(g,F)|0,o=Math.imul(g,B),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(_,F),i=(i=Math.imul(_,B))+Math.imul(b,F)|0,o=Math.imul(b,B),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,F),i=(i=Math.imul(A,B))+Math.imul(E,F)|0,o=Math.imul(E,B),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=(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,F),i=(i=Math.imul(P,B))+Math.imul(I,F)|0,o=Math.imul(I,B),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=(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)+(bt>>>26)|0,bt&=67108863,n=Math.imul(O,F),i=(i=Math.imul(O,B))+Math.imul(N,F)|0,o=Math.imul(N,B),n=n+Math.imul(P,Z)|0,i=(i=i+Math.imul(P,$)|0)+Math.imul(I,Z)|0,o=o+Math.imul(I,$)|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=(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)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(R,F),i=(i=Math.imul(R,B))+Math.imul(L,F)|0,o=Math.imul(L,B),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(I,q)|0,o=o+Math.imul(I,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=(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(k,F),i=(i=Math.imul(k,B))+Math.imul(C,F)|0,o=Math.imul(C,B),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(I,X)|0,o=o+Math.imul(I,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,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(U,F),i=(i=Math.imul(U,B))+Math.imul(z,F)|0,o=Math.imul(z,B),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(I,Q)|0,o=o+Math.imul(I,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,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(U,Z),i=(i=Math.imul(U,$))+Math.imul(z,Z)|0,o=Math.imul(z,$),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(I,rt)|0,o=o+Math.imul(I,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(b,at)|0,o=o+Math.imul(b,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(U,q),i=(i=Math.imul(U,H))+Math.imul(z,q)|0,o=Math.imul(z,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(I,ot)|0,o=o+Math.imul(I,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(b,lt)|0,o=o+Math.imul(b,dt)|0;var It=(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)+(It>>>26)|0,It&=67108863,n=Math.imul(U,X),i=(i=Math.imul(U,W))+Math.imul(z,X)|0,o=Math.imul(z,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,ht)|0)+Math.imul(I,at)|0,o=o+Math.imul(I,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 Tt=(h+(n=n+Math.imul(_,pt)|0)|0)+((8191&(i=(i=i+Math.imul(_,vt)|0)+Math.imul(b,pt)|0))<<13)|0;h=((o=o+Math.imul(b,vt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(U,Q),i=(i=Math.imul(U,tt))+Math.imul(z,Q)|0,o=Math.imul(z,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,ht)|0)+Math.imul(N,at)|0,o=o+Math.imul(N,ht)|0,n=n+Math.imul(P,lt)|0,i=(i=i+Math.imul(P,dt)|0)+Math.imul(I,lt)|0,o=o+Math.imul(I,dt)|0;var Ot=(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)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(U,rt),i=(i=Math.imul(U,nt))+Math.imul(z,rt)|0,o=Math.imul(z,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,ht)|0)+Math.imul(L,at)|0,o=o+Math.imul(L,ht)|0,n=n+Math.imul(O,lt)|0,i=(i=i+Math.imul(O,dt)|0)+Math.imul(N,lt)|0,o=o+Math.imul(N,dt)|0;var Nt=(h+(n=n+Math.imul(P,pt)|0)|0)+((8191&(i=(i=i+Math.imul(P,vt)|0)+Math.imul(I,pt)|0))<<13)|0;h=((o=o+Math.imul(I,vt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,n=Math.imul(U,ot),i=(i=Math.imul(U,st))+Math.imul(z,ot)|0,o=Math.imul(z,st),n=n+Math.imul(k,at)|0,i=(i=i+Math.imul(k,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(L,lt)|0,o=o+Math.imul(L,dt)|0;var St=(h+(n=n+Math.imul(O,pt)|0)|0)+((8191&(i=(i=i+Math.imul(O,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(U,at),i=(i=Math.imul(U,ht))+Math.imul(z,at)|0,o=Math.imul(z,ht),n=n+Math.imul(k,lt)|0,i=(i=i+Math.imul(k,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(L,pt)|0))<<13)|0;h=((o=o+Math.imul(L,vt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(U,lt),i=(i=Math.imul(U,dt))+Math.imul(z,lt)|0,o=Math.imul(z,dt);var Lt=(h+(n=n+Math.imul(k,pt)|0)|0)+((8191&(i=(i=i+Math.imul(k,vt)|0)+Math.imul(C,pt)|0))<<13)|0;h=((o=o+Math.imul(C,vt)|0)+(i>>>13)|0)+(Lt>>>26)|0,Lt&=67108863;var jt=(h+(n=Math.imul(U,pt))|0)+((8191&(i=(i=Math.imul(U,vt))+Math.imul(z,pt)|0))<<13)|0;return h=((o=Math.imul(z,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]=It,a[12]=Tt,a[13]=Ot,a[14]=Nt,a[15]=St,a[16]=Rt,a[17]=Lt,a[18]=jt,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 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(),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},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(2),h=r(11),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(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(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 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,_,b,M,A,E,x,P,I,T,O,N,S,R,L,j,k,C,G,U,z,D,F,B,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,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,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,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,z=t[26]<<25|t[27]>>>7,D=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,I=t[18]<<20|t[19]>>>12,T=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,B=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^~I&O,t[11]=P^~T&N,t[20]=k^~G&z,t[21]=C^~U&D,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]=I^~O&S,t[13]=T^~N&R,t[22]=G^~z&F,t[23]=U^~D&B,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]=z^~F&V,t[25]=D^~B&Z,t[34]=J^~W&Q,t[35]=X^~Y&tt,t[44]=ot^~ut&ht,t[45]=st^~at&ct,t[6]=b^~A&v,t[7]=M^~E&m,t[16]=S^~L&x,t[17]=R^~j&P,t[26]=F^~V&k,t[27]=B^~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]=L^~x&I,t[19]=j^~P&T,t[28]=V^~k&G,t[29]=Z^~C&U,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(8),u=r(10),a=r(2),h=r(40),c=r(11),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");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 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=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 k(t,z(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(z(t,e))}),new C(t,n,r)}(t,e.components,e.name):""===e.type?new M(t,e.name):(l.throwError("invalid type",l.INVALID_ARGUMENT,{arg:"type",value:e.type}),null)}var D=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(z(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(z(this.coerceFunc,e))},this),new C(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){ +/** + * [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 b(t,e,t).update(n)[r]()}},l=function(t,e,r){return function(n,i){return new b(t,e,i).update(n)[r]()}},d=function(t,e){var r=c(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,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&&(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,h,c,l,d,f,p,v,m,y,g,w,_,b,M,A,E,x,P,I,T,O,N,S,R,L,j,k,C,G,U,z,D,F,B,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,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,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,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,z=t[26]<<25|t[27]>>>7,D=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,I=t[18]<<20|t[19]>>>12,T=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,B=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^~I&O,t[11]=P^~T&N,t[20]=k^~G&z,t[21]=C^~U&D,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]=I^~O&S,t[13]=T^~N&R,t[22]=G^~z&F,t[23]=U^~D&B,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]=z^~F&V,t[25]=D^~B&Z,t[34]=J^~W&Q,t[35]=X^~Y&tt,t[44]=ot^~ut&ht,t[45]=st^~at&ct,t[6]=b^~A&v,t[7]=M^~E&m,t[16]=S^~L&x,t[17]=R^~j&P,t[26]=F^~V&k,t[27]=B^~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]=L^~x&I,t[19]=j^~P&T,t[28]=V^~k&G,t[29]=Z^~C&U,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(10);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(5),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._startedthis.normalizeAddress(t))}get orderGatewayId(){return this._orderGatewayId||null}set orderGatewayId(t){this._orderGatewayId=this.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.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.normalizeAddress(t)}isUnsafeRecipientId(t){const e=this.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}normalizeAddress(t){return i.normalizeAddress(t)}}},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";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});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(50))},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(76)),n(r(46))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(5);e.normalizeAddress=function(t){return t?["0x",...(t=n.normalizeAddress(t.toLowerCase())).substr(2).split("").map(t=>t==t.toLowerCase()?t.toUpperCase():t.toLowerCase())].join(""):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(51),u=r(52),a=r(53),h=r(54),c=r(55),l=r(56),d=r(57),f=r(58),p=r(59),v=r(60),m=r(61),y=r(62),g=r(63),w=r(64),_=r(65),b=r(66),M=r(68),A=r(69),E=r(70),x=r(71),P=r(72),I=r(73),T=r(74),O=r(75);class N{static deploy(t,e){return n(this,void 0,void 0,function*(){return a.default(t,e)})}static getInstance(t,e){return new N(t,e)}constructor(t,e){this._id=this.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=this.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.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 I.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.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.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.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.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.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.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.normalizeAddress(t.senderId),r=this.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.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.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.normalizeAddress(t),e=this.normalizeAddress(e),T.default(this,t,e)})}getProxyId(){return-1===this.provider.unsafeRecipientIds.indexOf(this.id)?3:2}normalizeAddress(t){return i.normalizeAddress(t)}}e.AssetLedger=N},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new 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(45),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(67),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(45),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";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new 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(77),a=r(78),h=r(79),c=r(80),l=r(81),d=r(82),f=r(83);class p{static getInstance(t,e){return new p(t,e)}constructor(t,e){this._id=this.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=this.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=this.normalizeOrderIds(t),a.default(this,t,e)})}cancel(t){return n(this,void 0,void 0,function*(){return t=this.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=this.normalizeOrderIds(t),f.default(this,t,e)})}getOrderDataClaim(t){return n(this,void 0,void 0,function*(){return t=this.normalizeOrderIds(t),l.default(this,t)})}normalizeAddress(t){return o.normalizeAddress(t)}normalizeOrderIds(t){return s.normalizeOrderIds(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(85))},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new 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(86),u=r(87),a=r(88),h=r(89),c=r(90),l=r(91),d=r(92);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=this.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=this.normalizeAddress(t),e=this.normalizeAddress(e),c.default(this,t,e)})}getBalance(t){return n(this,void 0,void 0,function*(){return t=this.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=this.normalizeAddress(e),r=this.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=this.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.normalizeAddress(t),s.default(this,t,"0")})}transferValue(t){return n(this,void 0,void 0,function*(){const e=this.normalizeAddress(t.senderId),r=this.normalizeAddress(t.receiverId);return t.senderId?h.default(this,e,r,t.value):a.default(this,r,t.value)})}normalizeAddress(t){return i.normalizeAddress(t)}}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){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}(r(94))},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new 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(95),o=r(16),s=r(97);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(96))},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{t.ledgerId=n.normalizeAddress(t.ledgerId),t.receiverId=n.normalizeAddress(t.receiverId),t.senderId=n.normalizeAddress(t.senderId)}),t}},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(106))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(84),i=r(44);e.ValueLedger=class extends n.ValueLedger{normalizeAddress(t){return i.normalizeAddress(t)}}},,,,,,,,,,,,,,,,function(t,e,r){window.$0xcert=window.$0xcert||{},Object.assign(window.$0xcert,r(93),r(100),r(102),r(105))}]); \ No newline at end of file From 8cacb4a026377471d76709195b54c5ab733a4803 Mon Sep 17 00:00:00 2001 From: Tadej Vengust Date: Wed, 27 Mar 2019 13:07:21 +0100 Subject: [PATCH 14/22] Version bump to 1.1.0-alpha0. --- common/config/rush/npm-shrinkwrap.json | 44 +-- common/config/rush/version-policies.json | 2 +- conventions/.vuepress/package-lock.json | 308 ++++++++-------- docs/.vuepress/package-lock.json | 346 +++++++++--------- packages/0xcert-cert/CHANGELOG.json | 4 +- packages/0xcert-cert/CHANGELOG.md | 2 +- packages/0xcert-cert/package.json | 8 +- packages/0xcert-conventions/CHANGELOG.json | 4 +- packages/0xcert-conventions/CHANGELOG.md | 2 +- packages/0xcert-conventions/package.json | 4 +- .../CHANGELOG.json | 4 +- .../0xcert-ethereum-asset-ledger/CHANGELOG.md | 2 +- .../0xcert-ethereum-asset-ledger/package.json | 12 +- .../CHANGELOG.json | 4 +- .../CHANGELOG.md | 2 +- .../package.json | 4 +- .../CHANGELOG.json | 4 +- .../CHANGELOG.md | 2 +- .../package.json | 4 +- .../CHANGELOG.json | 4 +- .../CHANGELOG.md | 2 +- .../package.json | 6 +- .../CHANGELOG.json | 4 +- .../CHANGELOG.md | 2 +- .../package.json | 8 +- .../CHANGELOG.json | 4 +- .../CHANGELOG.md | 2 +- .../package.json | 6 +- .../CHANGELOG.json | 4 +- .../CHANGELOG.md | 2 +- .../package.json | 12 +- .../CHANGELOG.json | 4 +- .../CHANGELOG.md | 2 +- .../package.json | 10 +- .../CHANGELOG.json | 4 +- .../CHANGELOG.md | 2 +- .../package.json | 10 +- .../0xcert-ethereum-sandbox/CHANGELOG.json | 4 +- packages/0xcert-ethereum-sandbox/CHANGELOG.md | 2 +- packages/0xcert-ethereum-sandbox/package.json | 12 +- .../CHANGELOG.json | 4 +- .../CHANGELOG.md | 2 +- .../package.json | 2 +- .../CHANGELOG.json | 4 +- .../0xcert-ethereum-value-ledger/CHANGELOG.md | 2 +- .../0xcert-ethereum-value-ledger/package.json | 12 +- .../CHANGELOG.json | 4 +- .../CHANGELOG.md | 2 +- .../package.json | 6 +- packages/0xcert-merkle/CHANGELOG.json | 4 +- packages/0xcert-merkle/CHANGELOG.md | 2 +- packages/0xcert-merkle/package.json | 4 +- packages/0xcert-scaffold/CHANGELOG.json | 4 +- packages/0xcert-scaffold/CHANGELOG.md | 2 +- packages/0xcert-scaffold/package.json | 2 +- packages/0xcert-utils/CHANGELOG.json | 4 +- packages/0xcert-utils/CHANGELOG.md | 2 +- packages/0xcert-utils/package.json | 2 +- packages/0xcert-vue-example/package.json | 14 +- packages/0xcert-vue-plugin/CHANGELOG.json | 4 +- packages/0xcert-vue-plugin/CHANGELOG.md | 2 +- packages/0xcert-vue-plugin/package.json | 4 +- .../0xcert-wanchain-asset-ledger/package.json | 6 +- .../package.json | 6 +- .../CHANGELOG.json | 4 +- .../CHANGELOG.md | 2 +- .../package.json | 6 +- packages/0xcert-wanchain-utils/package.json | 2 +- .../0xcert-wanchain-value-ledger/package.json | 6 +- 69 files changed, 494 insertions(+), 494 deletions(-) diff --git a/common/config/rush/npm-shrinkwrap.json b/common/config/rush/npm-shrinkwrap.json index de3b850b9..31e27d318 100644 --- a/common/config/rush/npm-shrinkwrap.json +++ b/common/config/rush/npm-shrinkwrap.json @@ -1291,7 +1291,7 @@ }, "@rush-temp/cert": { "version": "file:projects/cert.tgz", - "integrity": "sha512-nfVKLvCQ1fh+F0RqBKz8h6flit9NWwZsic5JVxMezvvnHTjYIxA6p4DPRnl0V1VFSqlvvINYcqFkQcocu9AGyQ==", + "integrity": "sha512-15OLIEcaz1QJB3fERoy3AALLAuiIlRn5TvGuViflA8QjJHrgFZychoJIIN1ipwss3zxDO9TR8nX+Mm3ZiUYZ4g==", "requires": { "@hayspec/cli": "^0.8.3", "@hayspec/spec": "^0.8.3", @@ -1303,7 +1303,7 @@ }, "@rush-temp/conventions": { "version": "file:projects/conventions.tgz", - "integrity": "sha512-lWYwncHO5gfK3lgIaYr8qWIgforAugbKGa8t7Xc1dP2GDetJIc+DnwXrREZmY6SiGpfQ9qgUCMbmDbz7KaDRLg==", + "integrity": "sha512-XetH6D3QUT8JJUeyK91xOOvIRCjp3zChKAaaHnLT8gFa5h90VdR4Uy+U5EJ8UsP2nXQ/QzkammHBepz60Eh/Ag==", "requires": { "@hayspec/cli": "^0.8.3", "@hayspec/spec": "^0.8.3", @@ -1315,7 +1315,7 @@ }, "@rush-temp/ethereum-asset-ledger": { "version": "file:projects/ethereum-asset-ledger.tgz", - "integrity": "sha512-4frT9+J6YxMAu0trmwK41/eUmRLl9XqKAU4CxpuYCzhFlUwLETItiCJavAQGYU6VLzDpt+j+CgBYS95aVrwuWA==", + "integrity": "sha512-qrOAfhLgNNdK+G3IKj7fUOPgAszu+lGQqUHzHdnmL0LdYA1WzdGIWzAACMbZJjGk/6XDyqatWSDZnhoLEXL48Q==", "requires": { "@0xcert/ethereum-utils": "1.2.0", "@specron/cli": "^0.5.6", @@ -1330,7 +1330,7 @@ }, "@rush-temp/ethereum-erc20-contracts": { "version": "file:projects/ethereum-erc20-contracts.tgz", - "integrity": "sha512-5ifh1idXOuO/7Hmjj7NRNXfksfUgedVRBCJekWYd8ntpxAx3QG01zX53gJjsVfL1MFtY0gVphhWu1+pR7JCZIQ==", + "integrity": "sha512-U31ksI4JKXn99ZcA0AriCh4lWwFyE6f4Fc3fFt5rQO6BqAEtPmePc/XTAFblYntuPN2vnwRl5dFkdpxPvd+6og==", "requires": { "@specron/cli": "^0.5.6", "@specron/spec": "^0.5.6", @@ -1344,7 +1344,7 @@ }, "@rush-temp/ethereum-erc721-contracts": { "version": "file:projects/ethereum-erc721-contracts.tgz", - "integrity": "sha512-45xj5Mr8aNeWaK90tbd2vUr9XN9c8iXZIBsQniXm2sgpxuOv9flv35xdFzUvys09feIJhow42Vwf9GwHfJ/IfQ==", + "integrity": "sha512-+7QCGjQNENTPIWT34nbY9P2G0QTxQU1b8GqEE3A96yLCB31lFQBZH4fsrQKJ/oCKGKeDT6S1s+kvJREbcOToAA==", "requires": { "@specron/cli": "^0.5.6", "@specron/spec": "^0.5.6", @@ -1358,7 +1358,7 @@ }, "@rush-temp/ethereum-generic-provider": { "version": "file:projects/ethereum-generic-provider.tgz", - "integrity": "sha512-am3li7qy/68PYfivy8uSIoXTN7SQc0BpHKW1PWWH0Mnchgce8dGorjSiBUvaynWHNrW6Epy2bCdjWtHf53eSFA==", + "integrity": "sha512-9ybHPozZ4C1oaZsdg66QDQhXO9ObScPrsJzSjrSJpmusrLtN+SRjKG7eXFPyqdWJTxzLJAjmQNNX8ZNoxh7Ulw==", "requires": { "@0xcert/ethereum-utils": "1.2.0", "@specron/cli": "^0.5.6", @@ -1376,7 +1376,7 @@ }, "@rush-temp/ethereum-http-provider": { "version": "file:projects/ethereum-http-provider.tgz", - "integrity": "sha512-Xr4H5UeRrUPlHP9bU1UuDWepdRT+ymdkgiA8qx1MF/BN0TfQGTBJA4YGJMC76hNEU8xIAUC0lBBbTY1pJe9evQ==", + "integrity": "sha512-zSQKQlbN+uPTIaBuYpWRNF0skVRHOS/+pMAx2wmixFDegPcXhgcNAlRU1g1j9zRiI36xv+9DAzpscBulC30oOQ==", "requires": { "@specron/cli": "^0.5.6", "@specron/spec": "^0.5.6", @@ -1390,7 +1390,7 @@ }, "@rush-temp/ethereum-metamask-provider": { "version": "file:projects/ethereum-metamask-provider.tgz", - "integrity": "sha512-nIbs9pYj0AZgFCnO1ZYZR+BHjsacavUc7d/b0dmBEH2kuLe6U+HWLjOMw9N7EdWqOVjXiOCRETfqC+ayshYB0g==", + "integrity": "sha512-64gpZveMWCVitsnsdD2WGxKhatpE+xqun4GWdOeco5Ypu2ODMmBoYMSmJJHBbalXLR1XWOmqLRYtyWWxnD2+iw==", "requires": { "@specron/cli": "^0.5.6", "@specron/spec": "^0.5.6", @@ -1404,7 +1404,7 @@ }, "@rush-temp/ethereum-order-gateway": { "version": "file:projects/ethereum-order-gateway.tgz", - "integrity": "sha512-UfhZPVdaeneerJYvzRJKFPjmB/nGLxjf5q9q7QH0ig3lK4ok1W5nv7EfHgkF1DydauGJREOT/+6lUOyg5+/n5Q==", + "integrity": "sha512-oNyi1z9gMJBuQbq2CMhaco14g2pPBTyYZCsFuFT6guYBws25tx73uMB8E2HdSxBwnTNMn4zMWbW7PDrRf8HbrA==", "requires": { "@0xcert/ethereum-utils": "1.2.0", "@specron/cli": "^0.5.6", @@ -1419,7 +1419,7 @@ }, "@rush-temp/ethereum-order-gateway-contracts": { "version": "file:projects/ethereum-order-gateway-contracts.tgz", - "integrity": "sha512-9uAEHbt2+SKScpwIkJVcZkfU9fcU4T7DAc/uyxHpxoS2SN04fDbE9Q0wDIYhuWTadbiLmunFoINmP567GNC6TA==", + "integrity": "sha512-rlvTpTmnosnuVYt6h6njYVfyjPp4XEWYBdQp+5lZJBEZE8WpW6Yb/NbXMCa2k+9gcXmocg7w6+mz7PdsgdT5ig==", "requires": { "@specron/cli": "^0.5.6", "@specron/spec": "^0.5.6", @@ -1433,7 +1433,7 @@ }, "@rush-temp/ethereum-proxy-contracts": { "version": "file:projects/ethereum-proxy-contracts.tgz", - "integrity": "sha512-VqNSUpfQw3ab6aQWbohNh+4eX96UonnBuux/IFDaZl5YDvoMSEZJh5gk14i5zE+b3Sro9jGn+krPBeJha99MiQ==", + "integrity": "sha512-lVzTBUccqqz7jFxJF3g+gnFBQu0Cn4ptw1cLwme2+EkCUCGGYmQhO0yAcDz/2JjWtFX1jdTDUL2GvQrkwAKy0g==", "requires": { "@0xcert/ethereum-utils": "1.2.0", "@specron/cli": "^0.5.6", @@ -1448,7 +1448,7 @@ }, "@rush-temp/ethereum-sandbox": { "version": "file:projects/ethereum-sandbox.tgz", - "integrity": "sha512-pNiBFgE0O3WaLlv/tRVIjyWTdZpb5csnDjRK8mehD/hy7i4QCOgfveILua4gVsGdBkIdufyWXXNAlbHh22HEUw==", + "integrity": "sha512-RGnlXj5IdI28Rk8NfwLbrpfQVgHTf60RlGgcKsFGFBXUlOQyZ/I0CEVbj3ZJxw6t1CSSKDOAQo1zPKP4NuNJGA==", "requires": { "@hayspec/cli": "^0.8.3", "@hayspec/spec": "^0.8.3", @@ -1478,7 +1478,7 @@ }, "@rush-temp/ethereum-value-ledger": { "version": "file:projects/ethereum-value-ledger.tgz", - "integrity": "sha512-TD4lgoezPNMRkj2EqmbPX1gaHhOkP9p+3Uz7loK2MW5iuUMguD9nDsX+rVGoi7Heyq97/EXTdxkqiFxRyri8CA==", + "integrity": "sha512-jkuZLvx2Nf3Sy9XV9J/Io79AyTNI6XnQDML2/9W5Mc4rQXqpRBqkmmTOb2hAlU6T7ILP2SHmit+imwQ6KRaLrw==", "requires": { "@0xcert/ethereum-utils": "1.2.0", "@specron/cli": "^0.5.6", @@ -1493,7 +1493,7 @@ }, "@rush-temp/ethereum-xcert-contracts": { "version": "file:projects/ethereum-xcert-contracts.tgz", - "integrity": "sha512-BaV8luPLIP1XhpU/tFleSwNv5CUhrQMt0razjwVhyspA3vx+SpQuofgP4R9mf4TqSulrVH/YIfMhaG5PKrcEaA==", + "integrity": "sha512-PKYj3LESpIuzxKFNIC3Mtne7dsIqA6RPzz7CgJD/rcmqSWZ4kYVhU+jSgq1H9Z0EsRq0LXxP+l//kXFEdcjYIg==", "requires": { "@specron/cli": "^0.5.6", "@specron/spec": "^0.5.6", @@ -1507,7 +1507,7 @@ }, "@rush-temp/merkle": { "version": "file:projects/merkle.tgz", - "integrity": "sha512-Af+wV5UM+rbZ6o95OsUU5z4hHKlooaoYV3ZaTsIUx44AaN3UXmqXIVCiSR2XhaFULnz3VvAMneienIyDwHQdIA==", + "integrity": "sha512-ZjTre04CXP8K442vEMOi9M6C9E8T17sEPorJn4ZvtZraaZmvz9sXw/BCDnFT1decr+GAeJD81ZeaawRPfgqoqA==", "requires": { "@hayspec/cli": "^0.8.3", "@hayspec/spec": "^0.8.3", @@ -1547,14 +1547,14 @@ }, "@rush-temp/vue-example": { "version": "file:projects/vue-example.tgz", - "integrity": "sha512-WiDWQ5Fcepjz3yH1zov6sM3UgONr7TXnfJXDDRiz2Uk2TUq1JfbykNhsIerhLWpvKiwWHTQTDULPjD94etsRug==", + "integrity": "sha512-A89uENDnvMj70q+8AkI6Xt5wegDAwB+OIBNuCG7li4yclWXAfNYKWLMYqAdVvNXUkawyYDZsaAdnv3R6kHsGYw==", "requires": { "nuxt": "^2.3.1" } }, "@rush-temp/vue-plugin": { "version": "file:projects/vue-plugin.tgz", - "integrity": "sha512-1AwQZEPceB6WUPe8t05loeDgKWCH1q1xjbK5hiNJxEWT1UpoGTgjx91o7uJNVW8UOVdMoHa26Mg2Q/8ucw3z9Q==", + "integrity": "sha512-kmE3IdRoxayaPL+RM8WI5Fjzun9qjsxmszcWPLiAgouwBOSBDtaj6ZlDoyfoXdrJ0NyF64EabXhbLW9ZEXLzEw==", "requires": { "@hayspec/cli": "^0.8.3", "@hayspec/spec": "^0.8.3", @@ -1566,7 +1566,7 @@ }, "@rush-temp/wanchain-asset-ledger": { "version": "file:projects/wanchain-asset-ledger.tgz", - "integrity": "sha512-FuRM5xg6vuaHDbDHK+iOcAsH05xDlXnH9mRS88B1E6NjdWdFx/mjFtWszFqAXdIGlrgyqc8vEwbcsJz4I6OXIg==", + "integrity": "sha512-vz3UwUzqbH4KSZfpqGDOB7TC1Pm6sygpDUlXUxgmp/QWSZTpC5BjFulAaFfKbBbsAj0zsb/puvm3wZ/WJz7qpw==", "requires": { "@hayspec/cli": "^0.8.3", "@hayspec/spec": "^0.8.3", @@ -1578,7 +1578,7 @@ }, "@rush-temp/wanchain-http-provider": { "version": "file:projects/wanchain-http-provider.tgz", - "integrity": "sha512-wnEE8cG6I6DHrLMLewchpYObvkP/rFue8fdFwhP8ZUnULu8vY8RJJ2eFtZZp07UHhiocf+Fc2jK1ggTgOJtz9A==", + "integrity": "sha512-BNkwhLx1q2eTvi6Yp0pau9dTNtxe8F72rJpV2bCQh7c9GMMoRe3WM4NsgQleecH7WsJethrWY5uSCHDUBBlZVw==", "requires": { "@hayspec/cli": "^0.8.3", "@hayspec/spec": "^0.8.3", @@ -1590,7 +1590,7 @@ }, "@rush-temp/wanchain-order-gateway": { "version": "file:projects/wanchain-order-gateway.tgz", - "integrity": "sha512-bDUh1xW2kdSlHXV/5EpGkOnOwrrqHDu2Ff8P/UjGxe6dQ0Lp4wzcS+irgRc/8hh1j4QJ8GMpQT1ogDPTDF1MTA==", + "integrity": "sha512-tud97EpIrnxOcKIKD6X1zx6Yy3eOW5pOS8vW9rpiwkJ8MnlvuHfoVLlo07K2Vz7d5hV74Bf9IpzDT2tVwF4Ofg==", "requires": { "@hayspec/cli": "^0.8.3", "@hayspec/spec": "^0.8.3", @@ -1614,7 +1614,7 @@ }, "@rush-temp/wanchain-value-ledger": { "version": "file:projects/wanchain-value-ledger.tgz", - "integrity": "sha512-ApG/hEPBAbP9BQlfEaAwCn6ThAnTStARwAKExBH1CJuHFcIngwRSm6shDI+2eQNe8tiZLVG6mw0UbPKAOoF0Bg==", + "integrity": "sha512-mk8sKUmzfKKaTPIpjbWtncOXkp3N6ju16NbwvPqW+ZE3RWB2F++OkAJcYcCG+Ta08EOVzAhgp8TyjqE5CfyaQA==", "requires": { "@hayspec/cli": "^0.8.3", "@hayspec/spec": "^0.8.3", @@ -1626,7 +1626,7 @@ }, "@rush-temp/webpack": { "version": "file:projects/webpack.tgz", - "integrity": "sha512-WbYOYueghl4Hv+QiV5HJgCY3LgG7B+Z63HkRHwuvgoXiXK6mvlnjxXmNqgDPlDYseMolvr4xMbAQEMd9l6xiHA==", + "integrity": "sha512-p6NG8ranDtCYLeDvm7AfcEqf+x9ha2n8RQebGjF+lRXvdrKzB/s9m/tNYMop4Uc6v/BsYTh76a94SclROjaJSQ==", "requires": { "webpack": "^4.25.0", "webpack-cli": "^3.1.2" diff --git a/common/config/rush/version-policies.json b/common/config/rush/version-policies.json index 37c47c224..8d6b06e2d 100644 --- a/common/config/rush/version-policies.json +++ b/common/config/rush/version-policies.json @@ -2,7 +2,7 @@ { "policyName": "patchAll", "definitionName": "lockStepVersion", - "version": "1.0.1", + "version": "1.1.0-alpha0", "nextBump": "patch" } ] diff --git a/conventions/.vuepress/package-lock.json b/conventions/.vuepress/package-lock.json index 7cd18f079..5dbbf61df 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.1.0-alpha0" } }, "@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.1.0-alpha0", "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.1.0-alpha0", + "uniq": "^1.1.0-alpha0" } }, "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.1.0-alpha03", "postcss-loader": "^2.1.5", "toml": "^2.3.3", - "url-loader": "^1.0.1", + "url-loader": "^1.1.0-alpha0", "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.1.0-alpha0", + "resolved": "https://registry.npmjs.org/ajv-errors/-/ajv-errors-1.1.0-alpha0.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.1.0-alpha01", "querystring-es3": "^0.2.1", - "reduce": "^1.0.1", + "reduce": "^1.1.0-alpha0", "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.1.0-alpha0", + "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.1.0-alpha0.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.1.0-alpha0" } } } @@ -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.1.0-alpha00", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.1.0-alpha00.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.1.0-alpha0" } }, "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.1.0-alpha0", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.1.0-alpha0.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.1.0-alpha0", + "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.1.0-alpha0.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.1.0-alpha0", "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.1.0-alpha0", "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.1.0-alpha0", + "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.1.0-alpha0.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.1.0-alpha0", "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.1.0-alpha0", "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.1.0-alpha0", + "promise-inflight": "^1.1.0-alpha0", "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.1.0-alpha0", + "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.1.0-alpha0.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.1.0-alpha0", + "resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.1.0-alpha0.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.1.0-alpha0", "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.1.0-alpha0" } }, "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.1.0-alpha0", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.1.0-alpha0.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.1.0-alpha0", "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.1.0-alpha0", "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.1.0-alpha0", "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.1.0-alpha0", "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.1.0-alpha0" } }, "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.1.0-alpha0", "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.1.0-alpha0", "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.1.0-alpha0", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.1.0-alpha0.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.1.0-alpha02" } }, "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.1.0-alpha0", "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.1.0-alpha0", "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.1.0-alpha0", "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.1.0-alpha0", "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.1.0-alpha0" } }, "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.1.0-alpha02" } }, "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.1.0-alpha0", "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.1.0-alpha0", "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.1.0-alpha0", "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.1.0-alpha0" }, "dependencies": { "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "version": "1.1.0-alpha0", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.1.0-alpha0.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.1.0-alpha0", "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.1.0-alpha00", + "resolved": "https://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.1.0-alpha00.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.1.0-alpha0", "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.1.0-alpha0" } }, "npmlog": { @@ -4154,7 +4154,7 @@ } }, "number-is-nan": { - "version": "1.0.1", + "version": "1.1.0-alpha0", "bundled": true, "optional": true }, @@ -4191,7 +4191,7 @@ } }, "path-is-absolute": { - "version": "1.0.1", + "version": "1.1.0-alpha0", "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.1.0-alpha0" } }, "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.1.0-alpha0", "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.1.0-alpha0" } }, "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.1.0-alpha0", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.1.0-alpha0.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.1.0-alpha0" } }, "hoek": { @@ -4609,7 +4609,7 @@ "integrity": "sha1-TNnhq9QpQUbnZ55B14mHMrAse/0=", "requires": { "mkdirp": "0.3.0", - "nopt": "1.0.10" + "nopt": "1.1.0-alpha00" }, "dependencies": { "mkdirp": { @@ -4679,7 +4679,7 @@ "requires": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" + "util-deprecate": "^1.1.0-alpha0" } } } @@ -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.1.0-alpha0", + "resolved": "https://registry.npmjs.org/indexes-of/-/indexes-of-1.1.0-alpha0.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.1.0-alpha0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.1.0-alpha0.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.1.0-alpha0", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.1.0-alpha0.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.1.0-alpha0", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.1.0-alpha0.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.1.0-alpha0", + "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.1.0-alpha0.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.1.0-alpha0", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.1.0-alpha0.tgz", "integrity": "sha1-jvW33lBDej/cprToZe96pVy0gDY=", "requires": { - "path-is-inside": "^1.0.1" + "path-is-inside": "^1.1.0-alpha0" } }, "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.1.0-alpha0" } }, "is-regexp": { @@ -5242,8 +5242,8 @@ } }, "killable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/killable/-/killable-1.0.1.tgz", + "version": "1.1.0-alpha0", + "resolved": "https://registry.npmjs.org/killable/-/killable-1.1.0-alpha0.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.1.0-alpha0" } }, "load-script": { @@ -5293,12 +5293,12 @@ "requires": { "big.js": "^5.2.2", "emojis-list": "^2.0.0", - "json5": "^1.0.1" + "json5": "^1.1.0-alpha0" }, "dependencies": { "json5": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "version": "1.1.0-alpha0", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.1.0-alpha0.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.1.0-alpha0", "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.1.0-alpha0", + "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.1.0-alpha0.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.1.0-alpha0", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.1.0-alpha0.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.1.0-alpha0" } }, "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.1.0-alpha0", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.1.0-alpha0.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.1.0-alpha0", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.1.0-alpha0.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.1.0-alpha0" }, "dependencies": { "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "version": "1.1.0-alpha0", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.1.0-alpha0.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.1.0-alpha0", + "resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.1.0-alpha0.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.1.0-alpha00", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.1.0-alpha00.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.1.0-alpha0", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.1.0-alpha0.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.1.0-alpha0", + "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.1.0-alpha0.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.1.0-alpha01" } }, "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.1.0-alpha00", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.1.0-alpha00.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.1.0-alpha0" } }, "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.1.0-alpha0", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.1.0-alpha0.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.1.0-alpha0", "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.1.0-alpha0", "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.1.0-alpha0", "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.1.0-alpha0", + "resolved": "https://registry.npmjs.org/postcss-reduce-initial/-/postcss-reduce-initial-1.1.0-alpha0.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.1.0-alpha0", "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.1.0-alpha0", + "uniq": "^1.1.0-alpha0" } }, "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.1.0-alpha0", "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.1.0-alpha0", "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.1.0-alpha0", + "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.1.0-alpha0.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.1.0-alpha0", + "resolved": "https://registry.npmjs.org/prr/-/prr-1.1.0-alpha0.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.1.0-alpha0" } }, "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.1.0-alpha0" }, "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.1.0-alpha0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.1.0-alpha0.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.1.0-alpha0" } } } @@ -8976,7 +8976,7 @@ "dev": true, "requires": { "get-own-enumerable-property-symbols": "^3.0.0", - "is-obj": "^1.0.1", + "is-obj": "^1.1.0-alpha0", "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.1.0-alpha0", "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.1.0-alpha0", + "promise-inflight": "^1.1.0-alpha0", "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.1.0-alpha0", + "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.1.0-alpha0.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.1.0-alpha0", + "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.1.0-alpha0.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.1.0-alpha0", + "resolved": "https://registry.npmjs.org/uniq/-/uniq-1.1.0-alpha0.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.1.0-alpha0", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.1.0-alpha0.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.1.0-alpha0", "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.1.0-alpha0", "os-locale": "^3.0.0", "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", + "require-main-filename": "^1.1.0-alpha0", "set-blocking": "^2.0.0", "string-width": "^2.0.0", "which-module": "^2.0.0", diff --git a/docs/.vuepress/package-lock.json b/docs/.vuepress/package-lock.json index fa51a0959..b9cf760c1 100644 --- a/docs/.vuepress/package-lock.json +++ b/docs/.vuepress/package-lock.json @@ -51,7 +51,7 @@ "jsesc": "^2.5.1", "lodash": "^4.17.11", "source-map": "^0.5.0", - "trim-right": "^1.0.1" + "trim-right": "^1.1.0-alpha0" } }, "@babel/helper-annotate-as-pure": { @@ -766,7 +766,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.1.0-alpha0", "glob-to-regexp": "^0.3.0" } }, @@ -909,8 +909,8 @@ "integrity": "sha512-w+zLE5Jhg6Liz8+rQOWEAwtwkyqpfnmsinXjXg6cY7YIONZZtgvE0v2O0uhQBs0peNomOJwWRKt6JBfTdTd3OQ==", "requires": { "cssesc": "^2.0.0", - "indexes-of": "^1.0.1", - "uniq": "^1.0.1" + "indexes-of": "^1.1.0-alpha0", + "uniq": "^1.1.0-alpha0" } }, "source-map": { @@ -959,10 +959,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.1.0-alpha03", "postcss-loader": "^2.1.5", "toml": "^2.3.3", - "url-loader": "^1.0.1", + "url-loader": "^1.1.0-alpha0", "vue": "^2.5.16", "vue-loader": "^15.2.4", "vue-router": "^3.0.2", @@ -1301,8 +1301,8 @@ } }, "ajv-errors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/ajv-errors/-/ajv-errors-1.0.1.tgz", + "version": "1.1.0-alpha0", + "resolved": "https://registry.npmjs.org/ajv-errors/-/ajv-errors-1.1.0-alpha0.tgz", "integrity": "sha512-DCRfO/4nQ+89p/RK43i8Ezd41EqdGIU4ld7nGF8OQ14oc/we5rEntLCUa7+jrn3nn83BosfwZA0wb4pon2o8iQ==" }, "ajv-keywords": { @@ -1325,9 +1325,9 @@ "inherits": "^2.0.1", "isarray": "^2.0.1", "load-script": "^1.0.0", - "object-keys": "^1.0.11", + "object-keys": "^1.1.0-alpha01", "querystring-es3": "^0.2.1", - "reduce": "^1.0.1", + "reduce": "^1.1.0-alpha0", "semver": "^5.1.0", "tunnel-agent": "^0.6.0" }, @@ -1363,8 +1363,8 @@ "integrity": "sha1-l6ERlkmyEa0zaR2fn0hqjsn74KM=" }, "amdefine": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", + "version": "1.1.0-alpha0", + "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.1.0-alpha0.tgz", "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=" }, "ansi-colors": { @@ -1409,7 +1409,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.1.0-alpha0" } } } @@ -1430,8 +1430,8 @@ } }, "argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "version": "1.1.0-alpha00", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.1.0-alpha00.tgz", "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "requires": { "sprintf-js": "~1.0.2" @@ -1468,7 +1468,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.1.0-alpha0" } }, "array-uniq": { @@ -1482,8 +1482,8 @@ "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=" }, "arrify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "version": "1.1.0-alpha0", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.1.0-alpha0.tgz", "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=" }, "asn1": { @@ -1543,8 +1543,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.1.0-alpha0", + "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.1.0-alpha0.tgz", "integrity": "sha1-GdOGodntxufByF04iu28xW0zYC0=" }, "async-foreach": { @@ -1731,7 +1731,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.1.0-alpha0", "class-utils": "^0.3.5", "component-emitter": "^1.2.1", "define-property": "^1.0.0", @@ -1861,7 +1861,7 @@ "integrity": "sha1-jokKGD2O6aI5OzhExpGkK897yfU=", "requires": { "array-flatten": "^2.1.0", - "deep-equal": "^1.0.1", + "deep-equal": "^1.1.0-alpha0", "dns-equal": "^1.0.0", "dns-txt": "^2.0.2", "multicast-dns": "^6.0.1", @@ -1928,8 +1928,8 @@ } }, "browserify-cipher": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", + "version": "1.1.0-alpha0", + "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.1.0-alpha0.tgz", "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", "requires": { "browserify-aes": "^1.0.4", @@ -1942,7 +1942,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.1.0-alpha0", "des.js": "^1.0.0", "inherits": "^2.0.1", "safe-buffer": "^5.1.2" @@ -2035,14 +2035,14 @@ "integrity": "sha512-Dph0MzuH+rTQzGPNT9fAnrPmMmjKfST6trxJeK7NQuHRaVw24VzPRWTmg9MpcwOVQZO0E1FBICUlFeNaKPIfHA==", "requires": { "bluebird": "^3.5.1", - "chownr": "^1.0.1", + "chownr": "^1.1.0-alpha0", "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.1.0-alpha0", + "promise-inflight": "^1.1.0-alpha0", "rimraf": "^2.6.2", "ssri": "^5.2.4", "unique-filename": "^1.1.0", @@ -2066,8 +2066,8 @@ } }, "cache-base": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", + "version": "1.1.0-alpha0", + "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.1.0-alpha0.tgz", "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", "requires": { "collection-visit": "^1.0.0", @@ -2093,8 +2093,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.1.0-alpha0", + "resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.1.0-alpha0.tgz", "integrity": "sha1-JtII6onje1y95gJQoV8DHBak1ms=" }, "camel-case": { @@ -2182,7 +2182,7 @@ "integrity": "sha512-IwXUx0FXc5ibYmPC2XeEj5mpXoV66sR+t3jqu2NS2GYwCktt3KF1/Qqjws/NkegajBA4RbZ5+DDwlOiJsxDHEg==", "requires": { "anymatch": "^2.0.0", - "async-each": "^1.0.1", + "async-each": "^1.1.0-alpha0", "braces": "^2.3.2", "fsevents": "^1.2.7", "glob-parent": "^3.1.0", @@ -2411,7 +2411,7 @@ "requires": { "color": "^0.11.0", "css-color-names": "0.0.4", - "has": "^1.0.1" + "has": "^1.1.0-alpha0" } }, "colors": { @@ -2439,8 +2439,8 @@ "dev": true }, "commondir": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "version": "1.1.0-alpha0", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.1.0-alpha0.tgz", "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=" }, "component-emitter": { @@ -2465,7 +2465,7 @@ "bytes": "3.0.0", "compressible": "~2.0.14", "debug": "2.6.9", - "on-headers": "~1.0.1", + "on-headers": "~1.1.0-alpha0", "safe-buffer": "5.1.2", "vary": "~1.1.2" }, @@ -2610,7 +2610,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.1.0-alpha0", "make-dir": "^1.0.0", "pkg-dir": "^2.0.0" } @@ -2628,7 +2628,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.1.0-alpha0", "dir-glob": "^2.0.0", "glob": "^7.1.2", "ignore": "^3.3.5", @@ -2711,7 +2711,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.1.0-alpha0", "inherits": "^2.0.1", "md5.js": "^1.3.4", "ripemd160": "^2.0.1", @@ -2850,7 +2850,7 @@ "boolbase": "~1.0.0", "css-what": "2.1", "domutils": "1.5.1", - "nth-check": "~1.0.1" + "nth-check": "~1.1.0-alpha0" } }, "css-selector-tokenizer": { @@ -2911,7 +2911,7 @@ "autoprefixer": "^6.3.1", "decamelize": "^1.1.2", "defined": "^1.0.0", - "has": "^1.0.1", + "has": "^1.1.0-alpha0", "object-assign": "^4.0.1", "postcss": "^5.0.14", "postcss-calc": "^5.2.0", @@ -2927,7 +2927,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.1.0-alpha0", "postcss-minify-params": "^1.0.4", "postcss-minify-selectors": "^2.0.4", "postcss-normalize-charset": "^1.1.0", @@ -3029,7 +3029,7 @@ "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=", "dev": true, "requires": { - "array-find-index": "^1.0.1" + "array-find-index": "^1.1.0-alpha0" } }, "cyclist": { @@ -3074,8 +3074,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.1.0-alpha0", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.1.0-alpha0.tgz", "integrity": "sha1-9dJgKStmDghO/0zbyfCK0yR0SLU=" }, "deepmerge": { @@ -3097,7 +3097,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.1.0-alpha02" } }, "define-property": { @@ -3160,7 +3160,7 @@ "resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz", "integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=", "requires": { - "array-union": "^1.0.1", + "array-union": "^1.1.0-alpha0", "glob": "^7.0.3", "object-assign": "^4.0.1", "pify": "^2.0.0", @@ -3237,7 +3237,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.1.0-alpha0", "path-type": "^3.0.0" } }, @@ -3272,7 +3272,7 @@ "autocomplete.js": "0.33.0", "hogan.js": "^3.0.2", "request": "^2.87.0", - "stack-utils": "^1.0.1", + "stack-utils": "^1.1.0-alpha0", "to-factory": "^1.0.0", "zepto": "^1.2.0" } @@ -3362,7 +3362,7 @@ "integrity": "sha512-BsXLz5sqX8OHcsh7CqBMztyXARmGQ3LWPtGjJi6DiJHq5C/qvi9P3OqgswKSDftbu8+IoI/QDTAm2fFnQ9SZSQ==", "requires": { "bn.js": "^4.4.0", - "brorand": "^1.0.1", + "brorand": "^1.1.0-alpha0", "hash.js": "^1.0.0", "hmac-drbg": "^1.0.0", "inherits": "^2.0.1", @@ -3417,7 +3417,7 @@ "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.7.tgz", "integrity": "sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg==", "requires": { - "prr": "~1.0.1" + "prr": "~1.1.0-alpha0" } }, "error-ex": { @@ -3438,7 +3438,7 @@ "has": "^1.0.3", "is-callable": "^1.1.4", "is-regex": "^1.0.4", - "object-keys": "^1.0.12" + "object-keys": "^1.1.0-alpha02" } }, "es-to-primitive": { @@ -3447,7 +3447,7 @@ "integrity": "sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg==", "requires": { "is-callable": "^1.1.4", - "is-date-object": "^1.0.1", + "is-date-object": "^1.1.0-alpha0", "is-symbol": "^1.0.2" } }, @@ -3608,7 +3608,7 @@ "etag": "~1.8.1", "finalhandler": "1.1.1", "fresh": "0.5.2", - "merge-descriptors": "1.0.1", + "merge-descriptors": "1.1.0-alpha0", "methods": "~1.1.2", "on-finished": "~2.3.0", "parseurl": "~1.3.2", @@ -3622,7 +3622,7 @@ "setprototypeof": "1.1.0", "statuses": "~1.4.0", "type-is": "~1.6.16", - "utils-merge": "1.0.1", + "utils-merge": "1.1.0-alpha0", "vary": "~1.1.2" }, "dependencies": { @@ -3657,12 +3657,12 @@ "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", "requires": { "assign-symbols": "^1.0.0", - "is-extendable": "^1.0.1" + "is-extendable": "^1.1.0-alpha0" }, "dependencies": { "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "version": "1.1.0-alpha0", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.1.0-alpha0.tgz", "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", "requires": { "is-plain-object": "^2.0.4" @@ -3847,7 +3847,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.1.0-alpha0", "make-dir": "^1.0.0", "pkg-dir": "^3.0.0" } @@ -3893,7 +3893,7 @@ "integrity": "sha1-xjMy9BXO3EsE2/5wz4NklMU8tEs=", "dev": true, "requires": { - "for-in": "^1.0.1" + "for-in": "^1.1.0-alpha0" } }, "foreach": { @@ -3954,8 +3954,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.1.0-alpha00", + "resolved": "https://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.1.0-alpha00.tgz", "integrity": "sha1-tH31NJPvkR33VzHnCp3tAYnbQMk=", "requires": { "graceful-fs": "^4.1.2", @@ -4088,7 +4088,7 @@ "has-unicode": "^2.0.0", "object-assign": "^4.1.0", "signal-exit": "^3.0.0", - "string-width": "^1.0.1", + "string-width": "^1.1.0-alpha0", "strip-ansi": "^3.0.1", "wide-align": "^1.1.0" } @@ -4249,7 +4249,7 @@ "optional": true, "requires": { "ignore-walk": "^3.0.1", - "npm-bundled": "^1.0.1" + "npm-bundled": "^1.1.0-alpha0" } }, "npmlog": { @@ -4264,7 +4264,7 @@ } }, "number-is-nan": { - "version": "1.0.1", + "version": "1.1.0-alpha0", "bundled": true, "optional": true }, @@ -4301,7 +4301,7 @@ } }, "path-is-absolute": { - "version": "1.0.1", + "version": "1.1.0-alpha0", "bundled": true, "optional": true }, @@ -4339,7 +4339,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.1.0-alpha0" } }, "rimraf": { @@ -4451,8 +4451,8 @@ } }, "fstream": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.11.tgz", + "version": "1.1.0-alpha01", + "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.1.0-alpha01.tgz", "integrity": "sha1-XB+x8RdHcRTwYyoOtLcbPLD9MXE=", "dev": true, "requires": { @@ -4478,7 +4478,7 @@ "has-unicode": "^2.0.0", "object-assign": "^4.1.0", "signal-exit": "^3.0.0", - "string-width": "^1.0.1", + "string-width": "^1.1.0-alpha0", "strip-ansi": "^3.0.1", "wide-align": "^1.1.0" }, @@ -4626,7 +4626,7 @@ "resolved": "https://registry.npmjs.org/globby/-/globby-8.0.2.tgz", "integrity": "sha512-yTzMmKygLp8RUpG1Ymu2VXPSJQZjNAZPD4ywgYEaG7e4tBJeUQBO8OpXrf1RCNcEs5alsoJYPAMiIHP0cmeC7w==", "requires": { - "array-union": "^1.0.1", + "array-union": "^1.1.0-alpha0", "dir-glob": "2.0.0", "fast-glob": "^2.0.2", "glob": "^7.1.2", @@ -4771,7 +4771,7 @@ "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", "requires": { "inherits": "^2.0.3", - "minimalistic-assert": "^1.0.1" + "minimalistic-assert": "^1.1.0-alpha0" } }, "he": { @@ -4780,13 +4780,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.1.0-alpha0", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.1.0-alpha0.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.1.0-alpha0" } }, "hoek": { @@ -4801,7 +4801,7 @@ "integrity": "sha1-TNnhq9QpQUbnZ55B14mHMrAse/0=", "requires": { "mkdirp": "0.3.0", - "nopt": "1.0.10" + "nopt": "1.1.0-alpha00" }, "dependencies": { "mkdirp": { @@ -4877,7 +4877,7 @@ "requires": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" + "util-deprecate": "^1.1.0-alpha0" } } } @@ -5026,8 +5026,8 @@ } }, "indexes-of": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/indexes-of/-/indexes-of-1.0.1.tgz", + "version": "1.1.0-alpha0", + "resolved": "https://registry.npmjs.org/indexes-of/-/indexes-of-1.1.0-alpha0.tgz", "integrity": "sha1-8w9xbI4r00bHtn0985FVZqfAVgc=" }, "indexof": { @@ -5122,8 +5122,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.1.0-alpha0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.1.0-alpha0.tgz", "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", "requires": { "binary-extensions": "^1.0.0" @@ -5166,8 +5166,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.1.0-alpha0", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.1.0-alpha0.tgz", "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=" }, "is-descriptor": { @@ -5243,8 +5243,8 @@ } }, "is-obj": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", + "version": "1.1.0-alpha0", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.1.0-alpha0.tgz", "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=", "dev": true }, @@ -5254,19 +5254,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.1.0-alpha0", + "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.1.0-alpha0.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.1.0-alpha0", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.1.0-alpha0.tgz", "integrity": "sha1-jvW33lBDej/cprToZe96pVy0gDY=", "requires": { - "path-is-inside": "^1.0.1" + "path-is-inside": "^1.1.0-alpha0" } }, "is-plain-obj": { @@ -5287,7 +5287,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.1.0-alpha0" } }, "is-regexp": { @@ -5470,8 +5470,8 @@ } }, "killable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/killable/-/killable-1.0.1.tgz", + "version": "1.1.0-alpha0", + "resolved": "https://registry.npmjs.org/killable/-/killable-1.1.0-alpha0.tgz", "integrity": "sha512-LzqtLKlUwirEUyl/nicirVmNiPvYs7l5n8wOPP7fyJVpUPkvCnW/vuiXGpylGUlnPDnB7311rARzAt3Mhswpjg==" }, "kind-of": { @@ -5501,7 +5501,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.1.0-alpha0" } }, "load-json-file": { @@ -5551,12 +5551,12 @@ "requires": { "big.js": "^5.2.2", "emojis-list": "^2.0.0", - "json5": "^1.0.1" + "json5": "^1.1.0-alpha0" }, "dependencies": { "json5": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "version": "1.1.0-alpha0", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.1.0-alpha0.tgz", "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", "requires": { "minimist": "^1.2.0" @@ -5745,8 +5745,8 @@ "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=" }, "map-obj": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", + "version": "1.1.0-alpha0", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.1.0-alpha0.tgz", "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", "dev": true }, @@ -5766,7 +5766,7 @@ "argparse": "^1.0.7", "entities": "~1.1.1", "linkify-it": "^2.0.0", - "mdurl": "^1.0.1", + "mdurl": "^1.1.0-alpha0", "uc.micro": "^1.0.5" } }, @@ -5809,8 +5809,8 @@ } }, "mdurl": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", + "version": "1.1.0-alpha0", + "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.1.0-alpha0.tgz", "integrity": "sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4=" }, "media-typer": { @@ -5846,18 +5846,18 @@ "camelcase-keys": "^2.0.0", "decamelize": "^1.1.2", "loud-rejection": "^1.0.0", - "map-obj": "^1.0.1", + "map-obj": "^1.1.0-alpha0", "minimist": "^1.1.3", "normalize-package-data": "^2.3.4", "object-assign": "^4.0.1", - "read-pkg-up": "^1.0.1", + "read-pkg-up": "^1.1.0-alpha0", "redent": "^1.0.0", "trim-newlines": "^1.0.0" } }, "merge-descriptors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "version": "1.1.0-alpha0", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.1.0-alpha0.tgz", "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" }, "merge-source-map": { @@ -5911,7 +5911,7 @@ "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", "requires": { "bn.js": "^4.0.0", - "brorand": "^1.0.1" + "brorand": "^1.1.0-alpha0" } }, "mime": { @@ -5968,13 +5968,13 @@ } }, "minimalistic-assert": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "version": "1.1.0-alpha0", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.1.0-alpha0.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.1.0-alpha0", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.1.0-alpha0.tgz", "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=" }, "minimatch": { @@ -6013,12 +6013,12 @@ "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", "requires": { "for-in": "^1.0.2", - "is-extendable": "^1.0.1" + "is-extendable": "^1.1.0-alpha0" }, "dependencies": { "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "version": "1.1.0-alpha0", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.1.0-alpha0.tgz", "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", "requires": { "is-plain-object": "^2.0.4" @@ -6060,8 +6060,8 @@ } }, "move-concurrently": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz", + "version": "1.1.0-alpha0", + "resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.1.0-alpha0.tgz", "integrity": "sha1-viwAX9oy4LKa8fBdfEszIUxwH5I=", "requires": { "aproba": "^1.1.1", @@ -6305,8 +6305,8 @@ } }, "nopt": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", + "version": "1.1.0-alpha00", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.1.0-alpha00.tgz", "integrity": "sha1-bd0hvSoxQXuScn3Vhfim83YI6+4=", "requires": { "abbrev": "1" @@ -6384,8 +6384,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.1.0-alpha0", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.1.0-alpha0.tgz", "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" }, "oauth-sign": { @@ -6432,8 +6432,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.1.0-alpha0", + "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.1.0-alpha0.tgz", "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", "requires": { "isobject": "^3.0.0" @@ -6447,7 +6447,7 @@ "define-properties": "^1.1.2", "function-bind": "^1.1.1", "has-symbols": "^1.0.0", - "object-keys": "^1.0.11" + "object-keys": "^1.1.0-alpha01" } }, "object.getownpropertydescriptors": { @@ -6605,8 +6605,8 @@ "integrity": "sha512-hMp0onDKIajHfIkdRk3P4CdCmErkYAxxDtP3Wx/4nZ3aGlau2VKh3mZpcuFkH27WQkL/3WBCPOktzA9ZOAnMQQ==" }, "pako": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.10.tgz", + "version": "1.1.0-alpha00", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.1.0-alpha00.tgz", "integrity": "sha512-0DTvPVU3ed8+HNXOu5Bs+o//Mbdj9VNQMUOe9oKCwh8l0GNwpTDMKCWbRjgtD291AWnkAgkqA/LOnQS8AmS1tw==" }, "parallel-transform": { @@ -6646,7 +6646,7 @@ "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", "requires": { "error-ex": "^1.3.1", - "json-parse-better-errors": "^1.0.1" + "json-parse-better-errors": "^1.1.0-alpha0" } }, "parseurl": { @@ -6675,8 +6675,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.1.0-alpha0", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.1.0-alpha0.tgz", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" }, "path-is-inside": { @@ -7350,7 +7350,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.1.0-alpha0", "postcss": "^5.0.10", "postcss-value-parser": "^3.1.1" }, @@ -7663,7 +7663,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.1.0-alpha0", "postcss": "^5.0.2", "postcss-value-parser": "^3.0.2", "uniqs": "^2.0.0" @@ -7725,7 +7725,7 @@ "integrity": "sha1-ssapjAByz5G5MtGkllCBFDEXNb8=", "requires": { "alphanum-sort": "^1.0.2", - "has": "^1.0.1", + "has": "^1.1.0-alpha0", "postcss": "^5.0.14", "postcss-selector-parser": "^2.0.0" }, @@ -8053,8 +8053,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.1.0-alpha0", + "resolved": "https://registry.npmjs.org/postcss-reduce-initial/-/postcss-reduce-initial-1.1.0-alpha0.tgz", "integrity": "sha1-aPgGlfBF0IJjqHmtJA343WT2ROo=", "requires": { "postcss": "^5.0.4" @@ -8115,7 +8115,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.1.0-alpha0", "postcss": "^5.0.8", "postcss-value-parser": "^3.0.1" }, @@ -8176,8 +8176,8 @@ "integrity": "sha1-+UN3iGBsPJrO4W/+jYsWKX8nu5A=", "requires": { "flatten": "^1.0.2", - "indexes-of": "^1.0.1", - "uniq": "^1.0.1" + "indexes-of": "^1.1.0-alpha0", + "uniq": "^1.1.0-alpha0" } }, "postcss-svgo": { @@ -8246,7 +8246,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.1.0-alpha0", "postcss": "^5.0.4", "uniqs": "^2.0.0" }, @@ -8311,7 +8311,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.1.0-alpha0", "postcss": "^5.0.4", "uniqs": "^2.0.0" }, @@ -8420,8 +8420,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.1.0-alpha0", + "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.1.0-alpha0.tgz", "integrity": "sha1-mEcocL8igTL8vdhoEputEsPAKeM=" }, "proxy-addr": { @@ -8434,8 +8434,8 @@ } }, "prr": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", + "version": "1.1.0-alpha0", + "resolved": "https://registry.npmjs.org/prr/-/prr-1.1.0-alpha0.tgz", "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=" }, "pseudomap": { @@ -8583,8 +8583,8 @@ } }, "read-pkg-up": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", + "version": "1.1.0-alpha0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.1.0-alpha0.tgz", "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", "dev": true, "requires": { @@ -8624,7 +8624,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.1.0-alpha0" } }, "readdirp": { @@ -8644,7 +8644,7 @@ "dev": true, "requires": { "indent-string": "^2.1.0", - "strip-indent": "^1.0.1" + "strip-indent": "^1.1.0-alpha0" } }, "reduce": { @@ -8662,7 +8662,7 @@ "requires": { "balanced-match": "^0.4.2", "math-expression-evaluator": "^1.2.14", - "reduce-function-call": "^1.0.1" + "reduce-function-call": "^1.1.0-alpha0" }, "dependencies": { "balanced-match": { @@ -8845,8 +8845,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.1.0-alpha0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.1.0-alpha0.tgz", "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=" }, "requires-port": { @@ -8961,7 +8961,7 @@ "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", "dev": true, "requires": { - "string-width": "^1.0.1", + "string-width": "^1.1.0-alpha0", "strip-ansi": "^3.0.1", "wrap-ansi": "^2.0.0" } @@ -9031,11 +9031,11 @@ "camelcase": "^3.0.0", "cliui": "^3.2.0", "decamelize": "^1.1.1", - "get-caller-file": "^1.0.1", + "get-caller-file": "^1.1.0-alpha0", "os-locale": "^1.4.0", - "read-pkg-up": "^1.0.1", + "read-pkg-up": "^1.1.0-alpha0", "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", + "require-main-filename": "^1.1.0-alpha0", "set-blocking": "^2.0.0", "string-width": "^1.0.2", "which-module": "^1.0.0", @@ -9061,7 +9061,7 @@ "dev": true, "requires": { "clone-deep": "^2.0.1", - "loader-utils": "^1.0.1", + "loader-utils": "^1.1.0-alpha0", "lodash.tail": "^4.1.1", "neo-async": "^2.5.0", "pify": "^3.0.0", @@ -9601,7 +9601,7 @@ "requires": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" + "util-deprecate": "^1.1.0-alpha0" } } } @@ -9768,7 +9768,7 @@ "dev": true, "requires": { "get-own-enumerable-property-symbols": "^3.0.0", - "is-obj": "^1.0.1", + "is-obj": "^1.1.0-alpha0", "is-regexp": "^1.0.0" } }, @@ -9810,8 +9810,8 @@ "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=" }, "strip-indent": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz", + "version": "1.1.0-alpha0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.1.0-alpha0.tgz", "integrity": "sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI=", "dev": true, "requires": { @@ -9887,7 +9887,7 @@ "resolved": "https://registry.npmjs.org/svgo/-/svgo-0.7.2.tgz", "integrity": "sha1-n1dyQTlSE1xv779Ar+ak+qiLS7U=", "requires": { - "coa": "~1.0.1", + "coa": "~1.1.0-alpha0", "colors": "~1.1.2", "csso": "~2.3.1", "js-yaml": "~3.7.0", @@ -9991,8 +9991,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.1.0-alpha0", + "promise-inflight": "^1.1.0-alpha0", "rimraf": "^2.6.2", "ssri": "^6.0.1", "unique-filename": "^1.1.1", @@ -10084,8 +10084,8 @@ "optional": true }, "to-arraybuffer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", + "version": "1.1.0-alpha0", + "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.1.0-alpha0.tgz", "integrity": "sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M=" }, "to-factory": { @@ -10178,8 +10178,8 @@ "dev": true }, "trim-right": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", + "version": "1.1.0-alpha0", + "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.1.0-alpha0.tgz", "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=" }, "true-case-path": { @@ -10306,8 +10306,8 @@ } }, "uniq": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/uniq/-/uniq-1.0.1.tgz", + "version": "1.1.0-alpha0", + "resolved": "https://registry.npmjs.org/uniq/-/uniq-1.1.0-alpha0.tgz", "integrity": "sha1-sxxa6CVIRKOoKBVBzisEuGWnNP8=" }, "uniqs": { @@ -10480,8 +10480,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.1.0-alpha0", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.1.0-alpha0.tgz", "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" }, "uuid": { @@ -11102,7 +11102,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.1.0-alpha0", "strip-ansi": "^3.0.1" }, "dependencies": { @@ -11159,10 +11159,10 @@ "cliui": "^4.0.0", "decamelize": "^2.0.0", "find-up": "^3.0.0", - "get-caller-file": "^1.0.1", + "get-caller-file": "^1.1.0-alpha0", "os-locale": "^3.0.0", "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", + "require-main-filename": "^1.1.0-alpha0", "set-blocking": "^2.0.0", "string-width": "^2.0.0", "which-module": "^2.0.0", diff --git a/packages/0xcert-cert/CHANGELOG.json b/packages/0xcert-cert/CHANGELOG.json index 644480b91..e0548ac16 100644 --- a/packages/0xcert-cert/CHANGELOG.json +++ b/packages/0xcert-cert/CHANGELOG.json @@ -2,8 +2,8 @@ "name": "@0xcert/cert", "entries": [ { - "version": "1.0.1", - "tag": "@0xcert/cert_v1.0.1", + "version": "1.1.0-alpha0", + "tag": "@0xcert/cert_v1.1.0-alpha0", "date": "Fri, 22 Mar 2019 09:48:00 GMT", "comments": {} } diff --git a/packages/0xcert-cert/CHANGELOG.md b/packages/0xcert-cert/CHANGELOG.md index 1e8028f35..564efebd4 100644 --- a/packages/0xcert-cert/CHANGELOG.md +++ b/packages/0xcert-cert/CHANGELOG.md @@ -2,7 +2,7 @@ This log was last generated on Fri, 22 Mar 2019 09:48:00 GMT and should not be manually modified. -## 1.0.1 +## 1.1.0-alpha0 Fri, 22 Mar 2019 09:48:00 GMT *Initial release* diff --git a/packages/0xcert-cert/package.json b/packages/0xcert-cert/package.json index 3a41b2b31..ff7e004e6 100644 --- a/packages/0xcert-cert/package.json +++ b/packages/0xcert-cert/package.json @@ -1,6 +1,6 @@ { "name": "@0xcert/cert", - "version": "1.0.1", + "version": "1.1.0-alpha0", "description": "Asset certification module for 0xcert Framework.", "main": "./dist/index.js", "types": "./dist/index.d.ts", @@ -72,8 +72,8 @@ "typescript": "^3.1.1" }, "dependencies": { - "@0xcert/utils": "1.0.1", - "@0xcert/merkle": "1.0.1", - "@0xcert/conventions": "1.0.1" + "@0xcert/utils": "1.1.0-alpha0", + "@0xcert/merkle": "1.1.0-alpha0", + "@0xcert/conventions": "1.1.0-alpha0" } } diff --git a/packages/0xcert-conventions/CHANGELOG.json b/packages/0xcert-conventions/CHANGELOG.json index e212e2f4b..342a31c4f 100644 --- a/packages/0xcert-conventions/CHANGELOG.json +++ b/packages/0xcert-conventions/CHANGELOG.json @@ -2,8 +2,8 @@ "name": "@0xcert/conventions", "entries": [ { - "version": "1.0.1", - "tag": "@0xcert/conventions_v1.0.1", + "version": "1.1.0-alpha0", + "tag": "@0xcert/conventions_v1.1.0-alpha0", "date": "Fri, 22 Mar 2019 09:48:00 GMT", "comments": {} } diff --git a/packages/0xcert-conventions/CHANGELOG.md b/packages/0xcert-conventions/CHANGELOG.md index c564787f7..e91ec906d 100644 --- a/packages/0xcert-conventions/CHANGELOG.md +++ b/packages/0xcert-conventions/CHANGELOG.md @@ -2,7 +2,7 @@ This log was last generated on Fri, 22 Mar 2019 09:48:00 GMT and should not be manually modified. -## 1.0.1 +## 1.1.0-alpha0 Fri, 22 Mar 2019 09:48:00 GMT *Initial release* diff --git a/packages/0xcert-conventions/package.json b/packages/0xcert-conventions/package.json index 1c3500bdd..9089e5e95 100644 --- a/packages/0xcert-conventions/package.json +++ b/packages/0xcert-conventions/package.json @@ -1,6 +1,6 @@ { "name": "@0xcert/conventions", - "version": "1.0.1", + "version": "1.1.0-alpha0", "description": "Module with implementation of all confirmed conventions.", "main": "./dist/index.js", "types": "./dist/index.d.ts", @@ -64,7 +64,7 @@ ], "license": "MIT", "devDependencies": { - "@0xcert/utils": "1.0.1", + "@0xcert/utils": "1.1.0-alpha0", "@hayspec/cli": "^0.8.3", "@hayspec/spec": "^0.8.3", "ajv": "^6.7.0", diff --git a/packages/0xcert-ethereum-asset-ledger/CHANGELOG.json b/packages/0xcert-ethereum-asset-ledger/CHANGELOG.json index e7f4ed728..1b4ef1b47 100644 --- a/packages/0xcert-ethereum-asset-ledger/CHANGELOG.json +++ b/packages/0xcert-ethereum-asset-ledger/CHANGELOG.json @@ -2,8 +2,8 @@ "name": "@0xcert/ethereum-asset-ledger", "entries": [ { - "version": "1.0.1", - "tag": "@0xcert/ethereum-asset-ledger_v1.0.1", + "version": "1.1.0-alpha0", + "tag": "@0xcert/ethereum-asset-ledger_v1.1.0-alpha0", "date": "Fri, 22 Mar 2019 09:48:00 GMT", "comments": {} } diff --git a/packages/0xcert-ethereum-asset-ledger/CHANGELOG.md b/packages/0xcert-ethereum-asset-ledger/CHANGELOG.md index 80582453c..2a64868f3 100644 --- a/packages/0xcert-ethereum-asset-ledger/CHANGELOG.md +++ b/packages/0xcert-ethereum-asset-ledger/CHANGELOG.md @@ -2,7 +2,7 @@ This log was last generated on Fri, 22 Mar 2019 09:48:00 GMT and should not be manually modified. -## 1.0.1 +## 1.1.0-alpha0 Fri, 22 Mar 2019 09:48:00 GMT *Initial release* diff --git a/packages/0xcert-ethereum-asset-ledger/package.json b/packages/0xcert-ethereum-asset-ledger/package.json index 08b95e635..a2bfc815b 100644 --- a/packages/0xcert-ethereum-asset-ledger/package.json +++ b/packages/0xcert-ethereum-asset-ledger/package.json @@ -1,6 +1,6 @@ { "name": "@0xcert/ethereum-asset-ledger", - "version": "1.0.1", + "version": "1.1.0-alpha0", "description": "Asset ledger module for asset management on the Ethereum blockchain.", "main": "./dist/index.js", "types": "./dist/index.d.ts", @@ -67,8 +67,8 @@ ], "license": "MIT", "devDependencies": { - "@0xcert/ethereum-sandbox": "1.0.1", - "@0xcert/ethereum-order-gateway": "1.0.1", + "@0xcert/ethereum-sandbox": "1.1.0-alpha0", + "@0xcert/ethereum-order-gateway": "1.1.0-alpha0", "@specron/cli": "^0.5.6", "@specron/spec": "^0.5.6", "nyc": "^13.1.0", @@ -79,9 +79,9 @@ "web3": "1.0.0-beta.37" }, "dependencies": { - "@0xcert/ethereum-generic-provider": "1.0.1", + "@0xcert/ethereum-generic-provider": "1.1.0-alpha0", "@0xcert/ethereum-utils": "1.2.0", - "@0xcert/scaffold": "1.0.1", - "@0xcert/utils": "1.0.1" + "@0xcert/scaffold": "1.1.0-alpha0", + "@0xcert/utils": "1.1.0-alpha0" } } diff --git a/packages/0xcert-ethereum-erc20-contracts/CHANGELOG.json b/packages/0xcert-ethereum-erc20-contracts/CHANGELOG.json index 50f52fde3..ca8d065a8 100644 --- a/packages/0xcert-ethereum-erc20-contracts/CHANGELOG.json +++ b/packages/0xcert-ethereum-erc20-contracts/CHANGELOG.json @@ -2,8 +2,8 @@ "name": "@0xcert/ethereum-erc20-contracts", "entries": [ { - "version": "1.0.1", - "tag": "@0xcert/ethereum-erc20-contracts_v1.0.1", + "version": "1.1.0-alpha0", + "tag": "@0xcert/ethereum-erc20-contracts_v1.1.0-alpha0", "date": "Fri, 22 Mar 2019 09:48:00 GMT", "comments": {} } diff --git a/packages/0xcert-ethereum-erc20-contracts/CHANGELOG.md b/packages/0xcert-ethereum-erc20-contracts/CHANGELOG.md index b0aa25c63..e33443562 100644 --- a/packages/0xcert-ethereum-erc20-contracts/CHANGELOG.md +++ b/packages/0xcert-ethereum-erc20-contracts/CHANGELOG.md @@ -2,7 +2,7 @@ This log was last generated on Fri, 22 Mar 2019 09:48:00 GMT and should not be manually modified. -## 1.0.1 +## 1.1.0-alpha0 Fri, 22 Mar 2019 09:48:00 GMT *Initial release* diff --git a/packages/0xcert-ethereum-erc20-contracts/package.json b/packages/0xcert-ethereum-erc20-contracts/package.json index f8d48623a..c94d7790e 100644 --- a/packages/0xcert-ethereum-erc20-contracts/package.json +++ b/packages/0xcert-ethereum-erc20-contracts/package.json @@ -1,6 +1,6 @@ { "name": "@0xcert/ethereum-erc20-contracts", - "version": "1.0.1", + "version": "1.1.0-alpha0", "description": "Smart contract implementation of the ERC-20 standard on the Ethereum blockchain.", "scripts": { "build": "npm run clean && npx specron compile && npx tsc", @@ -63,7 +63,7 @@ ], "license": "MIT", "devDependencies": { - "@0xcert/ethereum-utils-contracts": "1.0.1", + "@0xcert/ethereum-utils-contracts": "1.1.0-alpha0", "@specron/cli": "^0.5.6", "@specron/spec": "^0.5.6", "solc": "0.5.6", diff --git a/packages/0xcert-ethereum-erc721-contracts/CHANGELOG.json b/packages/0xcert-ethereum-erc721-contracts/CHANGELOG.json index 3b5f9346f..2d44e036f 100644 --- a/packages/0xcert-ethereum-erc721-contracts/CHANGELOG.json +++ b/packages/0xcert-ethereum-erc721-contracts/CHANGELOG.json @@ -2,8 +2,8 @@ "name": "@0xcert/ethereum-erc721-contracts", "entries": [ { - "version": "1.0.1", - "tag": "@0xcert/ethereum-erc721-contracts_v1.0.1", + "version": "1.1.0-alpha0", + "tag": "@0xcert/ethereum-erc721-contracts_v1.1.0-alpha0", "date": "Fri, 22 Mar 2019 09:48:00 GMT", "comments": {} }, diff --git a/packages/0xcert-ethereum-erc721-contracts/CHANGELOG.md b/packages/0xcert-ethereum-erc721-contracts/CHANGELOG.md index a44a6a1d0..bd8c02da6 100644 --- a/packages/0xcert-ethereum-erc721-contracts/CHANGELOG.md +++ b/packages/0xcert-ethereum-erc721-contracts/CHANGELOG.md @@ -2,7 +2,7 @@ This log was last generated on Fri, 22 Mar 2019 09:48:00 GMT and should not be manually modified. -## 1.0.1 +## 1.1.0-alpha0 Fri, 22 Mar 2019 09:48:00 GMT *Version update only* diff --git a/packages/0xcert-ethereum-erc721-contracts/package.json b/packages/0xcert-ethereum-erc721-contracts/package.json index 46107f348..fad6ec3df 100644 --- a/packages/0xcert-ethereum-erc721-contracts/package.json +++ b/packages/0xcert-ethereum-erc721-contracts/package.json @@ -1,6 +1,6 @@ { "name": "@0xcert/ethereum-erc721-contracts", - "version": "1.0.1", + "version": "1.1.0-alpha0", "description": "Smart contract implementation of the ERC-721 standard on the Ethereum blockchain.", "scripts": { "build": "npm run clean && npx specron compile && npx tsc", @@ -63,7 +63,7 @@ ], "license": "MIT", "devDependencies": { - "@0xcert/ethereum-utils-contracts": "1.0.1", + "@0xcert/ethereum-utils-contracts": "1.1.0-alpha0", "@specron/cli": "^0.5.6", "@specron/spec": "^0.5.6", "solc": "0.5.6", diff --git a/packages/0xcert-ethereum-generic-provider/CHANGELOG.json b/packages/0xcert-ethereum-generic-provider/CHANGELOG.json index 1d0b9b951..c05f16289 100644 --- a/packages/0xcert-ethereum-generic-provider/CHANGELOG.json +++ b/packages/0xcert-ethereum-generic-provider/CHANGELOG.json @@ -2,8 +2,8 @@ "name": "@0xcert/ethereum-generic-provider", "entries": [ { - "version": "1.0.1", - "tag": "@0xcert/ethereum-generic-provider_v1.0.1", + "version": "1.1.0-alpha0", + "tag": "@0xcert/ethereum-generic-provider_v1.1.0-alpha0", "date": "Fri, 22 Mar 2019 09:48:00 GMT", "comments": {} } diff --git a/packages/0xcert-ethereum-generic-provider/CHANGELOG.md b/packages/0xcert-ethereum-generic-provider/CHANGELOG.md index de022bf57..3fa548a9a 100644 --- a/packages/0xcert-ethereum-generic-provider/CHANGELOG.md +++ b/packages/0xcert-ethereum-generic-provider/CHANGELOG.md @@ -2,7 +2,7 @@ This log was last generated on Fri, 22 Mar 2019 09:48:00 GMT and should not be manually modified. -## 1.0.1 +## 1.1.0-alpha0 Fri, 22 Mar 2019 09:48:00 GMT *Initial release* diff --git a/packages/0xcert-ethereum-generic-provider/package.json b/packages/0xcert-ethereum-generic-provider/package.json index 2de26f9f5..99b1d8864 100644 --- a/packages/0xcert-ethereum-generic-provider/package.json +++ b/packages/0xcert-ethereum-generic-provider/package.json @@ -1,6 +1,6 @@ { "name": "@0xcert/ethereum-generic-provider", - "version": "1.0.1", + "version": "1.1.0-alpha0", "description": "Basic implementation of communication provider for the Ethereum blockchain.", "main": "./dist/index.js", "types": "./dist/index.d.ts", @@ -67,7 +67,7 @@ ], "license": "MIT", "devDependencies": { - "@0xcert/ethereum-sandbox": "1.0.1", + "@0xcert/ethereum-sandbox": "1.1.0-alpha0", "@types/node": "^10.12.24", "@specron/cli": "^0.5.6", "@specron/spec": "^0.5.6", @@ -81,7 +81,7 @@ }, "dependencies": { "@0xcert/ethereum-utils": "1.2.0", - "@0xcert/scaffold": "1.0.1", + "@0xcert/scaffold": "1.1.0-alpha0", "events": "^3.0.0" } } diff --git a/packages/0xcert-ethereum-http-provider/CHANGELOG.json b/packages/0xcert-ethereum-http-provider/CHANGELOG.json index 63240a015..acfeaa2d4 100644 --- a/packages/0xcert-ethereum-http-provider/CHANGELOG.json +++ b/packages/0xcert-ethereum-http-provider/CHANGELOG.json @@ -2,8 +2,8 @@ "name": "@0xcert/ethereum-http-provider", "entries": [ { - "version": "1.0.1", - "tag": "@0xcert/ethereum-http-provider_v1.0.1", + "version": "1.1.0-alpha0", + "tag": "@0xcert/ethereum-http-provider_v1.1.0-alpha0", "date": "Fri, 22 Mar 2019 09:48:00 GMT", "comments": {} } diff --git a/packages/0xcert-ethereum-http-provider/CHANGELOG.md b/packages/0xcert-ethereum-http-provider/CHANGELOG.md index d9eee7cc0..d52c4bca8 100644 --- a/packages/0xcert-ethereum-http-provider/CHANGELOG.md +++ b/packages/0xcert-ethereum-http-provider/CHANGELOG.md @@ -2,7 +2,7 @@ This log was last generated on Fri, 22 Mar 2019 09:48:00 GMT and should not be manually modified. -## 1.0.1 +## 1.1.0-alpha0 Fri, 22 Mar 2019 09:48:00 GMT *Initial release* diff --git a/packages/0xcert-ethereum-http-provider/package.json b/packages/0xcert-ethereum-http-provider/package.json index 05c03b866..9a183ddff 100644 --- a/packages/0xcert-ethereum-http-provider/package.json +++ b/packages/0xcert-ethereum-http-provider/package.json @@ -1,6 +1,6 @@ { "name": "@0xcert/ethereum-http-provider", - "version": "1.0.1", + "version": "1.1.0-alpha0", "description": "Implementation of HTTP communication provider for the Ethereum blockchain.", "main": "./dist/index.js", "types": "./dist/index.d.ts", @@ -67,7 +67,7 @@ ], "license": "MIT", "devDependencies": { - "@0xcert/ethereum-sandbox": "1.0.1", + "@0xcert/ethereum-sandbox": "1.1.0-alpha0", "@specron/cli": "^0.5.6", "@specron/spec": "^0.5.6", "nyc": "^13.1.0", @@ -78,7 +78,7 @@ "web3": "1.0.0-beta.37" }, "dependencies": { - "@0xcert/ethereum-generic-provider": "1.0.1", - "@0xcert/utils": "1.0.1" + "@0xcert/ethereum-generic-provider": "1.1.0-alpha0", + "@0xcert/utils": "1.1.0-alpha0" } } diff --git a/packages/0xcert-ethereum-metamask-provider/CHANGELOG.json b/packages/0xcert-ethereum-metamask-provider/CHANGELOG.json index 7d5d69d83..2eb6c8cd2 100644 --- a/packages/0xcert-ethereum-metamask-provider/CHANGELOG.json +++ b/packages/0xcert-ethereum-metamask-provider/CHANGELOG.json @@ -2,8 +2,8 @@ "name": "@0xcert/ethereum-metamask-provider", "entries": [ { - "version": "1.0.1", - "tag": "@0xcert/ethereum-metamask-provider_v1.0.1", + "version": "1.1.0-alpha0", + "tag": "@0xcert/ethereum-metamask-provider_v1.1.0-alpha0", "date": "Fri, 22 Mar 2019 09:48:00 GMT", "comments": {} } diff --git a/packages/0xcert-ethereum-metamask-provider/CHANGELOG.md b/packages/0xcert-ethereum-metamask-provider/CHANGELOG.md index 612d8c387..6b203feaf 100644 --- a/packages/0xcert-ethereum-metamask-provider/CHANGELOG.md +++ b/packages/0xcert-ethereum-metamask-provider/CHANGELOG.md @@ -2,7 +2,7 @@ This log was last generated on Fri, 22 Mar 2019 09:48:00 GMT and should not be manually modified. -## 1.0.1 +## 1.1.0-alpha0 Fri, 22 Mar 2019 09:48:00 GMT *Initial release* diff --git a/packages/0xcert-ethereum-metamask-provider/package.json b/packages/0xcert-ethereum-metamask-provider/package.json index ede057423..120b12432 100644 --- a/packages/0xcert-ethereum-metamask-provider/package.json +++ b/packages/0xcert-ethereum-metamask-provider/package.json @@ -1,6 +1,6 @@ { "name": "@0xcert/ethereum-metamask-provider", - "version": "1.0.1", + "version": "1.1.0-alpha0", "description": "Implementation of MetaMask communication provider for the Ethereum blockchain.", "main": "./dist/index.js", "types": "./dist/index.d.ts", @@ -67,7 +67,7 @@ ], "license": "MIT", "devDependencies": { - "@0xcert/ethereum-sandbox": "1.0.1", + "@0xcert/ethereum-sandbox": "1.1.0-alpha0", "@specron/cli": "^0.5.6", "@specron/spec": "^0.5.6", "nyc": "^13.1.0", @@ -78,6 +78,6 @@ "web3": "1.0.0-beta.37" }, "dependencies": { - "@0xcert/ethereum-generic-provider": "1.0.1" + "@0xcert/ethereum-generic-provider": "1.1.0-alpha0" } } diff --git a/packages/0xcert-ethereum-order-gateway-contracts/CHANGELOG.json b/packages/0xcert-ethereum-order-gateway-contracts/CHANGELOG.json index a3de13866..5a4e5a28e 100644 --- a/packages/0xcert-ethereum-order-gateway-contracts/CHANGELOG.json +++ b/packages/0xcert-ethereum-order-gateway-contracts/CHANGELOG.json @@ -2,8 +2,8 @@ "name": "@0xcert/ethereum-order-gateway-contracts", "entries": [ { - "version": "1.0.1", - "tag": "@0xcert/ethereum-order-gateway-contracts_v1.0.1", + "version": "1.1.0-alpha0", + "tag": "@0xcert/ethereum-order-gateway-contracts_v1.1.0-alpha0", "date": "Fri, 22 Mar 2019 09:48:00 GMT", "comments": {} }, diff --git a/packages/0xcert-ethereum-order-gateway-contracts/CHANGELOG.md b/packages/0xcert-ethereum-order-gateway-contracts/CHANGELOG.md index f1b6bf7cd..e5e906252 100644 --- a/packages/0xcert-ethereum-order-gateway-contracts/CHANGELOG.md +++ b/packages/0xcert-ethereum-order-gateway-contracts/CHANGELOG.md @@ -2,7 +2,7 @@ This log was last generated on Fri, 22 Mar 2019 09:48:00 GMT and should not be manually modified. -## 1.0.1 +## 1.1.0-alpha0 Fri, 22 Mar 2019 09:48:00 GMT *Version update only* diff --git a/packages/0xcert-ethereum-order-gateway-contracts/package.json b/packages/0xcert-ethereum-order-gateway-contracts/package.json index d0a838dbf..6699e45b2 100644 --- a/packages/0xcert-ethereum-order-gateway-contracts/package.json +++ b/packages/0xcert-ethereum-order-gateway-contracts/package.json @@ -1,6 +1,6 @@ { "name": "@0xcert/ethereum-order-gateway-contracts", - "version": "1.0.1", + "version": "1.1.0-alpha0", "description": "Smart contracts used by the order gateway on the Ethereum blockchain.", "scripts": { "build": "npm run clean && npx specron compile && npx tsc", @@ -73,11 +73,11 @@ ], "license": "MIT", "devDependencies": { - "@0xcert/ethereum-utils-contracts": "1.0.1", - "@0xcert/ethereum-erc20-contracts": "1.0.1", - "@0xcert/ethereum-erc721-contracts": "1.0.1", - "@0xcert/ethereum-xcert-contracts": "1.0.1", - "@0xcert/ethereum-proxy-contracts": "1.0.1", + "@0xcert/ethereum-utils-contracts": "1.1.0-alpha0", + "@0xcert/ethereum-erc20-contracts": "1.1.0-alpha0", + "@0xcert/ethereum-erc721-contracts": "1.1.0-alpha0", + "@0xcert/ethereum-xcert-contracts": "1.1.0-alpha0", + "@0xcert/ethereum-proxy-contracts": "1.1.0-alpha0", "@specron/cli": "^0.5.6", "@specron/spec": "^0.5.6", "solc": "0.5.6", diff --git a/packages/0xcert-ethereum-order-gateway/CHANGELOG.json b/packages/0xcert-ethereum-order-gateway/CHANGELOG.json index ca7c9ca44..ce98bcfbe 100644 --- a/packages/0xcert-ethereum-order-gateway/CHANGELOG.json +++ b/packages/0xcert-ethereum-order-gateway/CHANGELOG.json @@ -2,8 +2,8 @@ "name": "@0xcert/ethereum-order-gateway", "entries": [ { - "version": "1.0.1", - "tag": "@0xcert/ethereum-order-gateway_v1.0.1", + "version": "1.1.0-alpha0", + "tag": "@0xcert/ethereum-order-gateway_v1.1.0-alpha0", "date": "Fri, 22 Mar 2019 09:48:00 GMT", "comments": {} }, diff --git a/packages/0xcert-ethereum-order-gateway/CHANGELOG.md b/packages/0xcert-ethereum-order-gateway/CHANGELOG.md index 4eb8936e1..2e89afa0e 100644 --- a/packages/0xcert-ethereum-order-gateway/CHANGELOG.md +++ b/packages/0xcert-ethereum-order-gateway/CHANGELOG.md @@ -2,7 +2,7 @@ This log was last generated on Fri, 22 Mar 2019 09:48:00 GMT and should not be manually modified. -## 1.0.1 +## 1.1.0-alpha0 Fri, 22 Mar 2019 09:48:00 GMT *Version update only* diff --git a/packages/0xcert-ethereum-order-gateway/package.json b/packages/0xcert-ethereum-order-gateway/package.json index 836e037d0..f0b33a508 100644 --- a/packages/0xcert-ethereum-order-gateway/package.json +++ b/packages/0xcert-ethereum-order-gateway/package.json @@ -1,6 +1,6 @@ { "name": "@0xcert/ethereum-order-gateway", - "version": "1.0.1", + "version": "1.1.0-alpha0", "description": "Order gateway module for executing atomic operations on the Ethereum blockchain.", "main": "./dist/index.js", "types": "./dist/index.d.ts", @@ -67,7 +67,7 @@ ], "license": "MIT", "devDependencies": { - "@0xcert/ethereum-sandbox": "1.0.1", + "@0xcert/ethereum-sandbox": "1.1.0-alpha0", "@specron/cli": "^0.5.6", "@specron/spec": "^0.5.6", "nyc": "^13.1.0", @@ -78,9 +78,9 @@ "web3": "1.0.0-beta.37" }, "dependencies": { - "@0xcert/ethereum-generic-provider": "1.0.1", + "@0xcert/ethereum-generic-provider": "1.1.0-alpha0", "@0xcert/ethereum-utils": "1.2.0", - "@0xcert/scaffold": "1.0.1", - "@0xcert/utils": "1.0.1" + "@0xcert/scaffold": "1.1.0-alpha0", + "@0xcert/utils": "1.1.0-alpha0" } } diff --git a/packages/0xcert-ethereum-proxy-contracts/CHANGELOG.json b/packages/0xcert-ethereum-proxy-contracts/CHANGELOG.json index 6fc8f1ab2..ba4ccbacf 100644 --- a/packages/0xcert-ethereum-proxy-contracts/CHANGELOG.json +++ b/packages/0xcert-ethereum-proxy-contracts/CHANGELOG.json @@ -2,8 +2,8 @@ "name": "@0xcert/ethereum-proxy-contracts", "entries": [ { - "version": "1.0.1", - "tag": "@0xcert/ethereum-proxy-contracts_v1.0.1", + "version": "1.1.0-alpha0", + "tag": "@0xcert/ethereum-proxy-contracts_v1.1.0-alpha0", "date": "Fri, 22 Mar 2019 09:48:00 GMT", "comments": {} }, diff --git a/packages/0xcert-ethereum-proxy-contracts/CHANGELOG.md b/packages/0xcert-ethereum-proxy-contracts/CHANGELOG.md index 61dd045fe..cdcb52492 100644 --- a/packages/0xcert-ethereum-proxy-contracts/CHANGELOG.md +++ b/packages/0xcert-ethereum-proxy-contracts/CHANGELOG.md @@ -2,7 +2,7 @@ This log was last generated on Fri, 22 Mar 2019 09:48:00 GMT and should not be manually modified. -## 1.0.1 +## 1.1.0-alpha0 Fri, 22 Mar 2019 09:48:00 GMT *Version update only* diff --git a/packages/0xcert-ethereum-proxy-contracts/package.json b/packages/0xcert-ethereum-proxy-contracts/package.json index f426c6d8d..eec037da8 100644 --- a/packages/0xcert-ethereum-proxy-contracts/package.json +++ b/packages/0xcert-ethereum-proxy-contracts/package.json @@ -1,6 +1,6 @@ { "name": "@0xcert/ethereum-proxy-contracts", - "version": "1.0.1", + "version": "1.1.0-alpha0", "description": "Proxy smart contracts used by the order gateway when communicating with the Ethereum blockchain.", "scripts": { "build": "npm run clean && npx specron compile && npx tsc", @@ -64,10 +64,10 @@ "license": "MIT", "devDependencies": { "@0xcert/ethereum-utils": "1.2.0", - "@0xcert/ethereum-utils-contracts": "1.0.1", - "@0xcert/ethereum-erc20-contracts": "1.0.1", - "@0xcert/ethereum-erc721-contracts": "1.0.1", - "@0xcert/ethereum-xcert-contracts": "1.0.1", + "@0xcert/ethereum-utils-contracts": "1.1.0-alpha0", + "@0xcert/ethereum-erc20-contracts": "1.1.0-alpha0", + "@0xcert/ethereum-erc721-contracts": "1.1.0-alpha0", + "@0xcert/ethereum-xcert-contracts": "1.1.0-alpha0", "@specron/cli": "^0.5.6", "@specron/spec": "^0.5.6", "solc": "0.5.6", diff --git a/packages/0xcert-ethereum-sandbox/CHANGELOG.json b/packages/0xcert-ethereum-sandbox/CHANGELOG.json index acc420377..02869febe 100644 --- a/packages/0xcert-ethereum-sandbox/CHANGELOG.json +++ b/packages/0xcert-ethereum-sandbox/CHANGELOG.json @@ -2,8 +2,8 @@ "name": "@0xcert/ethereum-sandbox", "entries": [ { - "version": "1.0.1", - "tag": "@0xcert/ethereum-sandbox_v1.0.1", + "version": "1.1.0-alpha0", + "tag": "@0xcert/ethereum-sandbox_v1.1.0-alpha0", "date": "Fri, 22 Mar 2019 09:48:00 GMT", "comments": {} }, diff --git a/packages/0xcert-ethereum-sandbox/CHANGELOG.md b/packages/0xcert-ethereum-sandbox/CHANGELOG.md index 3984e169e..11dd57c2d 100644 --- a/packages/0xcert-ethereum-sandbox/CHANGELOG.md +++ b/packages/0xcert-ethereum-sandbox/CHANGELOG.md @@ -2,7 +2,7 @@ This log was last generated on Fri, 22 Mar 2019 09:48:00 GMT and should not be manually modified. -## 1.0.1 +## 1.1.0-alpha0 Fri, 22 Mar 2019 09:48:00 GMT *Version update only* diff --git a/packages/0xcert-ethereum-sandbox/package.json b/packages/0xcert-ethereum-sandbox/package.json index 391b5f6e9..762ca3b3a 100644 --- a/packages/0xcert-ethereum-sandbox/package.json +++ b/packages/0xcert-ethereum-sandbox/package.json @@ -1,6 +1,6 @@ { "name": "@0xcert/ethereum-sandbox", - "version": "1.0.1", + "version": "1.1.0-alpha0", "description": "Test server for local running testing of modules on the Ethereum blockchain.", "main": "./dist/index.js", "types": "./dist/index.d.ts", @@ -76,10 +76,10 @@ "web3": "1.0.0-beta.37" }, "dependencies": { - "@0xcert/ethereum-order-gateway-contracts": "1.0.1", - "@0xcert/ethereum-erc20-contracts": "1.0.1", - "@0xcert/ethereum-erc721-contracts": "1.0.1", - "@0xcert/ethereum-proxy-contracts": "1.0.1", - "@0xcert/ethereum-xcert-contracts": "1.0.1" + "@0xcert/ethereum-order-gateway-contracts": "1.1.0-alpha0", + "@0xcert/ethereum-erc20-contracts": "1.1.0-alpha0", + "@0xcert/ethereum-erc721-contracts": "1.1.0-alpha0", + "@0xcert/ethereum-proxy-contracts": "1.1.0-alpha0", + "@0xcert/ethereum-xcert-contracts": "1.1.0-alpha0" } } diff --git a/packages/0xcert-ethereum-utils-contracts/CHANGELOG.json b/packages/0xcert-ethereum-utils-contracts/CHANGELOG.json index c21e41335..7780562de 100644 --- a/packages/0xcert-ethereum-utils-contracts/CHANGELOG.json +++ b/packages/0xcert-ethereum-utils-contracts/CHANGELOG.json @@ -2,8 +2,8 @@ "name": "@0xcert/ethereum-utils-contracts", "entries": [ { - "version": "1.0.1", - "tag": "@0xcert/ethereum-utils-contracts_v1.0.1", + "version": "1.1.0-alpha0", + "tag": "@0xcert/ethereum-utils-contracts_v1.1.0-alpha0", "date": "Fri, 22 Mar 2019 09:48:00 GMT", "comments": {} }, diff --git a/packages/0xcert-ethereum-utils-contracts/CHANGELOG.md b/packages/0xcert-ethereum-utils-contracts/CHANGELOG.md index 1c36bab6a..10a2508eb 100644 --- a/packages/0xcert-ethereum-utils-contracts/CHANGELOG.md +++ b/packages/0xcert-ethereum-utils-contracts/CHANGELOG.md @@ -2,7 +2,7 @@ This log was last generated on Fri, 22 Mar 2019 09:48:00 GMT and should not be manually modified. -## 1.0.1 +## 1.1.0-alpha0 Fri, 22 Mar 2019 09:48:00 GMT *Version update only* diff --git a/packages/0xcert-ethereum-utils-contracts/package.json b/packages/0xcert-ethereum-utils-contracts/package.json index 23e17ef28..1c4a9bda7 100644 --- a/packages/0xcert-ethereum-utils-contracts/package.json +++ b/packages/0xcert-ethereum-utils-contracts/package.json @@ -1,7 +1,7 @@ { "name": "@0xcert/ethereum-utils-contracts", "description": "General utility module with helper smart contracts.", - "version": "1.0.1", + "version": "1.1.0-alpha0", "scripts": { "build": "npm run clean && npx specron compile && npx tsc", "clean": "rm -Rf ./build", diff --git a/packages/0xcert-ethereum-value-ledger/CHANGELOG.json b/packages/0xcert-ethereum-value-ledger/CHANGELOG.json index b87e1ddce..548057a7c 100644 --- a/packages/0xcert-ethereum-value-ledger/CHANGELOG.json +++ b/packages/0xcert-ethereum-value-ledger/CHANGELOG.json @@ -2,8 +2,8 @@ "name": "@0xcert/ethereum-value-ledger", "entries": [ { - "version": "1.0.1", - "tag": "@0xcert/ethereum-value-ledger_v1.0.1", + "version": "1.1.0-alpha0", + "tag": "@0xcert/ethereum-value-ledger_v1.1.0-alpha0", "date": "Fri, 22 Mar 2019 09:48:00 GMT", "comments": {} } diff --git a/packages/0xcert-ethereum-value-ledger/CHANGELOG.md b/packages/0xcert-ethereum-value-ledger/CHANGELOG.md index 588b11bc1..dbd618977 100644 --- a/packages/0xcert-ethereum-value-ledger/CHANGELOG.md +++ b/packages/0xcert-ethereum-value-ledger/CHANGELOG.md @@ -2,7 +2,7 @@ This log was last generated on Fri, 22 Mar 2019 09:48:00 GMT and should not be manually modified. -## 1.0.1 +## 1.1.0-alpha0 Fri, 22 Mar 2019 09:48:00 GMT *Initial release* diff --git a/packages/0xcert-ethereum-value-ledger/package.json b/packages/0xcert-ethereum-value-ledger/package.json index d9d28fea5..d3fb2ca4b 100644 --- a/packages/0xcert-ethereum-value-ledger/package.json +++ b/packages/0xcert-ethereum-value-ledger/package.json @@ -1,6 +1,6 @@ { "name": "@0xcert/ethereum-value-ledger", - "version": "1.0.1", + "version": "1.1.0-alpha0", "description": "Value ledger module for currency management on the Ethereum blockchain.", "main": "./dist/index.js", "types": "./dist/index.d.ts", @@ -67,8 +67,8 @@ ], "license": "MIT", "devDependencies": { - "@0xcert/ethereum-order-gateway": "1.0.1", - "@0xcert/ethereum-sandbox": "1.0.1", + "@0xcert/ethereum-order-gateway": "1.1.0-alpha0", + "@0xcert/ethereum-sandbox": "1.1.0-alpha0", "@specron/cli": "^0.5.6", "@specron/spec": "^0.5.6", "nyc": "^13.1.0", @@ -79,9 +79,9 @@ "web3": "1.0.0-beta.37" }, "dependencies": { - "@0xcert/ethereum-generic-provider": "1.0.1", + "@0xcert/ethereum-generic-provider": "1.1.0-alpha0", "@0xcert/ethereum-utils": "1.2.0", - "@0xcert/scaffold": "1.0.1", - "@0xcert/utils": "1.0.1" + "@0xcert/scaffold": "1.1.0-alpha0", + "@0xcert/utils": "1.1.0-alpha0" } } diff --git a/packages/0xcert-ethereum-xcert-contracts/CHANGELOG.json b/packages/0xcert-ethereum-xcert-contracts/CHANGELOG.json index 618323661..91c14038d 100644 --- a/packages/0xcert-ethereum-xcert-contracts/CHANGELOG.json +++ b/packages/0xcert-ethereum-xcert-contracts/CHANGELOG.json @@ -2,8 +2,8 @@ "name": "@0xcert/ethereum-xcert-contracts", "entries": [ { - "version": "1.0.1", - "tag": "@0xcert/ethereum-xcert-contracts_v1.0.1", + "version": "1.1.0-alpha0", + "tag": "@0xcert/ethereum-xcert-contracts_v1.1.0-alpha0", "date": "Fri, 22 Mar 2019 09:48:00 GMT", "comments": {} }, diff --git a/packages/0xcert-ethereum-xcert-contracts/CHANGELOG.md b/packages/0xcert-ethereum-xcert-contracts/CHANGELOG.md index edccede41..e247f5afe 100644 --- a/packages/0xcert-ethereum-xcert-contracts/CHANGELOG.md +++ b/packages/0xcert-ethereum-xcert-contracts/CHANGELOG.md @@ -2,7 +2,7 @@ This log was last generated on Fri, 22 Mar 2019 09:48:00 GMT and should not be manually modified. -## 1.0.1 +## 1.1.0-alpha0 Fri, 22 Mar 2019 09:48:00 GMT *Version update only* diff --git a/packages/0xcert-ethereum-xcert-contracts/package.json b/packages/0xcert-ethereum-xcert-contracts/package.json index ad5049194..9c0a5ffe9 100644 --- a/packages/0xcert-ethereum-xcert-contracts/package.json +++ b/packages/0xcert-ethereum-xcert-contracts/package.json @@ -1,7 +1,7 @@ { "name": "@0xcert/ethereum-xcert-contracts", "description": "Smart contracts used by the Asset ledger on the Ethereum blockchain.", - "version": "1.0.1", + "version": "1.1.0-alpha0", "scripts": { "build": "npm run clean && npx specron compile && npx tsc", "clean": "rm -Rf ./build", @@ -61,8 +61,8 @@ ], "license": "MIT", "devDependencies": { - "@0xcert/ethereum-utils-contracts": "1.0.1", - "@0xcert/ethereum-erc721-contracts": "1.0.1", + "@0xcert/ethereum-utils-contracts": "1.1.0-alpha0", + "@0xcert/ethereum-erc721-contracts": "1.1.0-alpha0", "@specron/cli": "^0.5.6", "@specron/spec": "^0.5.6", "solc": "0.5.6", diff --git a/packages/0xcert-merkle/CHANGELOG.json b/packages/0xcert-merkle/CHANGELOG.json index 8c6e077f6..2b0083f4d 100644 --- a/packages/0xcert-merkle/CHANGELOG.json +++ b/packages/0xcert-merkle/CHANGELOG.json @@ -2,8 +2,8 @@ "name": "@0xcert/merkle", "entries": [ { - "version": "1.0.1", - "tag": "@0xcert/merkle_v1.0.1", + "version": "1.1.0-alpha0", + "tag": "@0xcert/merkle_v1.1.0-alpha0", "date": "Fri, 22 Mar 2019 09:48:00 GMT", "comments": {} }, diff --git a/packages/0xcert-merkle/CHANGELOG.md b/packages/0xcert-merkle/CHANGELOG.md index 7395f723f..2759d9632 100644 --- a/packages/0xcert-merkle/CHANGELOG.md +++ b/packages/0xcert-merkle/CHANGELOG.md @@ -2,7 +2,7 @@ This log was last generated on Fri, 22 Mar 2019 09:48:00 GMT and should not be manually modified. -## 1.0.1 +## 1.1.0-alpha0 Fri, 22 Mar 2019 09:48:00 GMT *Version update only* diff --git a/packages/0xcert-merkle/package.json b/packages/0xcert-merkle/package.json index f41932736..4ec34efd0 100644 --- a/packages/0xcert-merkle/package.json +++ b/packages/0xcert-merkle/package.json @@ -1,6 +1,6 @@ { "name": "@0xcert/merkle", - "version": "1.0.1", + "version": "1.1.0-alpha0", "description": "Implementation of basic functions of binary Merkle tree.", "main": "./dist/index.js", "types": "./dist/index.d.ts", @@ -64,7 +64,7 @@ ], "license": "MIT", "devDependencies": { - "@0xcert/utils": "1.0.1", + "@0xcert/utils": "1.1.0-alpha0", "@hayspec/cli": "^0.8.3", "@hayspec/spec": "^0.8.3", "nyc": "^13.1.0", diff --git a/packages/0xcert-scaffold/CHANGELOG.json b/packages/0xcert-scaffold/CHANGELOG.json index 097252f0c..bd262f366 100644 --- a/packages/0xcert-scaffold/CHANGELOG.json +++ b/packages/0xcert-scaffold/CHANGELOG.json @@ -2,8 +2,8 @@ "name": "@0xcert/scaffold", "entries": [ { - "version": "1.0.1", - "tag": "@0xcert/scaffold_v1.0.1", + "version": "1.1.0-alpha0", + "tag": "@0xcert/scaffold_v1.1.0-alpha0", "date": "Fri, 22 Mar 2019 09:48:00 GMT", "comments": {} }, diff --git a/packages/0xcert-scaffold/CHANGELOG.md b/packages/0xcert-scaffold/CHANGELOG.md index fc232b74f..506aaf889 100644 --- a/packages/0xcert-scaffold/CHANGELOG.md +++ b/packages/0xcert-scaffold/CHANGELOG.md @@ -2,7 +2,7 @@ This log was last generated on Fri, 22 Mar 2019 09:48:00 GMT and should not be manually modified. -## 1.0.1 +## 1.1.0-alpha0 Fri, 22 Mar 2019 09:48:00 GMT *Version update only* diff --git a/packages/0xcert-scaffold/package.json b/packages/0xcert-scaffold/package.json index c98fa7a3f..b2682ca83 100644 --- a/packages/0xcert-scaffold/package.json +++ b/packages/0xcert-scaffold/package.json @@ -1,6 +1,6 @@ { "name": "@0xcert/scaffold", - "version": "1.0.1", + "version": "1.1.0-alpha0", "description": "Overarching module with types, enums, and interfaces for easier development of interoperable modules.", "main": "./dist/index.js", "types": "./dist/index.d.ts", diff --git a/packages/0xcert-utils/CHANGELOG.json b/packages/0xcert-utils/CHANGELOG.json index f5a237c77..07bc096e7 100644 --- a/packages/0xcert-utils/CHANGELOG.json +++ b/packages/0xcert-utils/CHANGELOG.json @@ -2,8 +2,8 @@ "name": "@0xcert/utils", "entries": [ { - "version": "1.0.1", - "tag": "@0xcert/utils_v1.0.1", + "version": "1.1.0-alpha0", + "tag": "@0xcert/utils_v1.1.0-alpha0", "date": "Fri, 22 Mar 2019 09:48:00 GMT", "comments": {} }, diff --git a/packages/0xcert-utils/CHANGELOG.md b/packages/0xcert-utils/CHANGELOG.md index 1199e02d4..464d4919b 100644 --- a/packages/0xcert-utils/CHANGELOG.md +++ b/packages/0xcert-utils/CHANGELOG.md @@ -2,7 +2,7 @@ This log was last generated on Fri, 22 Mar 2019 09:48:00 GMT and should not be manually modified. -## 1.0.1 +## 1.1.0-alpha0 Fri, 22 Mar 2019 09:48:00 GMT *Version update only* diff --git a/packages/0xcert-utils/package.json b/packages/0xcert-utils/package.json index dfc2d7e3b..7b922511f 100644 --- a/packages/0xcert-utils/package.json +++ b/packages/0xcert-utils/package.json @@ -1,6 +1,6 @@ { "name": "@0xcert/utils", - "version": "1.0.1", + "version": "1.1.0-alpha0", "description": "General utility module with common helper functions.", "main": "./dist/index.js", "types": "./dist/index.d.ts", diff --git a/packages/0xcert-vue-example/package.json b/packages/0xcert-vue-example/package.json index bc0cc5216..25c34b8d2 100644 --- a/packages/0xcert-vue-example/package.json +++ b/packages/0xcert-vue-example/package.json @@ -8,13 +8,13 @@ "test": "" }, "dependencies": { - "@0xcert/cert": "1.0.1", - "@0xcert/conventions": "1.0.1", - "@0xcert/ethereum-asset-ledger": "1.0.1", - "@0xcert/ethereum-order-gateway": "1.0.1", - "@0xcert/ethereum-value-ledger": "1.0.1", - "@0xcert/ethereum-metamask-provider": "1.0.1", - "@0xcert/vue-plugin": "1.0.1", + "@0xcert/cert": "1.1.0-alpha0", + "@0xcert/conventions": "1.1.0-alpha0", + "@0xcert/ethereum-asset-ledger": "1.1.0-alpha0", + "@0xcert/ethereum-order-gateway": "1.1.0-alpha0", + "@0xcert/ethereum-value-ledger": "1.1.0-alpha0", + "@0xcert/ethereum-metamask-provider": "1.1.0-alpha0", + "@0xcert/vue-plugin": "1.1.0-alpha0", "nuxt": "^2.3.1" } } diff --git a/packages/0xcert-vue-plugin/CHANGELOG.json b/packages/0xcert-vue-plugin/CHANGELOG.json index 38cc0cf26..b576f26ff 100644 --- a/packages/0xcert-vue-plugin/CHANGELOG.json +++ b/packages/0xcert-vue-plugin/CHANGELOG.json @@ -2,8 +2,8 @@ "name": "@0xcert/vue-plugin", "entries": [ { - "version": "1.0.1", - "tag": "@0xcert/vue-plugin_v1.0.1", + "version": "1.1.0-alpha0", + "tag": "@0xcert/vue-plugin_v1.1.0-alpha0", "date": "Fri, 22 Mar 2019 09:48:00 GMT", "comments": {} } diff --git a/packages/0xcert-vue-plugin/CHANGELOG.md b/packages/0xcert-vue-plugin/CHANGELOG.md index f7fa1f3d3..edec6d402 100644 --- a/packages/0xcert-vue-plugin/CHANGELOG.md +++ b/packages/0xcert-vue-plugin/CHANGELOG.md @@ -2,7 +2,7 @@ This log was last generated on Fri, 22 Mar 2019 09:48:00 GMT and should not be manually modified. -## 1.0.1 +## 1.1.0-alpha0 Fri, 22 Mar 2019 09:48:00 GMT *Initial release* diff --git a/packages/0xcert-vue-plugin/package.json b/packages/0xcert-vue-plugin/package.json index 1a277da95..463157b98 100644 --- a/packages/0xcert-vue-plugin/package.json +++ b/packages/0xcert-vue-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@0xcert/vue-plugin", - "version": "1.0.1", + "version": "1.1.0-alpha0", "description": "Implementation of VueJS plug-in.", "main": "./dist/index.js", "types": "./dist/index.d.ts", @@ -72,6 +72,6 @@ "typescript": "^3.1.1" }, "dependencies": { - "@0xcert/scaffold": "1.0.1" + "@0xcert/scaffold": "1.1.0-alpha0" } } diff --git a/packages/0xcert-wanchain-asset-ledger/package.json b/packages/0xcert-wanchain-asset-ledger/package.json index ccc953e2a..0228a1021 100644 --- a/packages/0xcert-wanchain-asset-ledger/package.json +++ b/packages/0xcert-wanchain-asset-ledger/package.json @@ -1,6 +1,6 @@ { "name": "@0xcert/wanchain-asset-ledger", - "version": "1.1.0-beta0", + "version": "1.1.0-alpha0", "description": "Asset ledger module for asset management on the Wanchain blockchain.", "main": "./dist/index.js", "types": "./dist/index.d.ts", @@ -72,7 +72,7 @@ "typescript": "^3.1.1" }, "dependencies": { - "@0xcert/ethereum-asset-ledger": "1.0.1", - "@0xcert/wanchain-utils": "1.1.0-beta0" + "@0xcert/ethereum-asset-ledger": "1.1.0-alpha0", + "@0xcert/wanchain-utils": "1.1.0-alpha0" } } diff --git a/packages/0xcert-wanchain-http-provider/package.json b/packages/0xcert-wanchain-http-provider/package.json index c78880574..86fd5773e 100644 --- a/packages/0xcert-wanchain-http-provider/package.json +++ b/packages/0xcert-wanchain-http-provider/package.json @@ -1,6 +1,6 @@ { "name": "@0xcert/wanchain-http-provider", - "version": "1.1.0-beta0", + "version": "1.1.0-alpha0", "description": "Implementation of HTTP communication provider for the Wanchain blockchain.", "main": "./dist/index.js", "types": "./dist/index.d.ts", @@ -72,7 +72,7 @@ "typescript": "^3.1.1" }, "dependencies": { - "@0xcert/ethereum-http-provider": "1.0.1", - "@0xcert/wanchain-utils": "1.1.0-beta0" + "@0xcert/ethereum-http-provider": "1.1.0-alpha0", + "@0xcert/wanchain-utils": "1.1.0-alpha0" } } diff --git a/packages/0xcert-wanchain-order-gateway/CHANGELOG.json b/packages/0xcert-wanchain-order-gateway/CHANGELOG.json index ca7c9ca44..ce98bcfbe 100644 --- a/packages/0xcert-wanchain-order-gateway/CHANGELOG.json +++ b/packages/0xcert-wanchain-order-gateway/CHANGELOG.json @@ -2,8 +2,8 @@ "name": "@0xcert/ethereum-order-gateway", "entries": [ { - "version": "1.0.1", - "tag": "@0xcert/ethereum-order-gateway_v1.0.1", + "version": "1.1.0-alpha0", + "tag": "@0xcert/ethereum-order-gateway_v1.1.0-alpha0", "date": "Fri, 22 Mar 2019 09:48:00 GMT", "comments": {} }, diff --git a/packages/0xcert-wanchain-order-gateway/CHANGELOG.md b/packages/0xcert-wanchain-order-gateway/CHANGELOG.md index 4eb8936e1..2e89afa0e 100644 --- a/packages/0xcert-wanchain-order-gateway/CHANGELOG.md +++ b/packages/0xcert-wanchain-order-gateway/CHANGELOG.md @@ -2,7 +2,7 @@ This log was last generated on Fri, 22 Mar 2019 09:48:00 GMT and should not be manually modified. -## 1.0.1 +## 1.1.0-alpha0 Fri, 22 Mar 2019 09:48:00 GMT *Version update only* diff --git a/packages/0xcert-wanchain-order-gateway/package.json b/packages/0xcert-wanchain-order-gateway/package.json index f788970d7..632ff0836 100644 --- a/packages/0xcert-wanchain-order-gateway/package.json +++ b/packages/0xcert-wanchain-order-gateway/package.json @@ -1,6 +1,6 @@ { "name": "@0xcert/wanchain-order-gateway", - "version": "1.1.0-beta0", + "version": "1.1.0-alpha0", "description": "Order gateway module for executing atomic operations on the Wanchain blockchain.", "main": "./dist/index.js", "types": "./dist/index.d.ts", @@ -72,7 +72,7 @@ "typescript": "^3.1.1" }, "dependencies": { - "@0xcert/ethereum-order-gateway": "1.0.1", - "@0xcert/wanchain-utils": "1.1.0-beta0" + "@0xcert/ethereum-order-gateway": "1.1.0-alpha0", + "@0xcert/wanchain-utils": "1.1.0-alpha0" } } diff --git a/packages/0xcert-wanchain-utils/package.json b/packages/0xcert-wanchain-utils/package.json index 3e3edd5f5..c62aa97e0 100644 --- a/packages/0xcert-wanchain-utils/package.json +++ b/packages/0xcert-wanchain-utils/package.json @@ -1,6 +1,6 @@ { "name": "@0xcert/wanchain-utils", - "version": "1.1.0-beta0", + "version": "1.1.0-alpha0", "description": "General Wanchain utility module with helper functions for the Wanchain blockchain.", "main": "./dist/index.js", "types": "./dist/index.d.ts", diff --git a/packages/0xcert-wanchain-value-ledger/package.json b/packages/0xcert-wanchain-value-ledger/package.json index 63d143014..e527a0b38 100644 --- a/packages/0xcert-wanchain-value-ledger/package.json +++ b/packages/0xcert-wanchain-value-ledger/package.json @@ -1,6 +1,6 @@ { "name": "@0xcert/wanchain-value-ledger", - "version": "1.1.0-beta0", + "version": "1.1.0-alpha0", "description": "Value ledger module for currency management on the Wanchain blockchain.", "main": "./dist/index.js", "types": "./dist/index.d.ts", @@ -72,7 +72,7 @@ "typescript": "^3.1.1" }, "dependencies": { - "@0xcert/ethereum-value-ledger": "1.0.1", - "@0xcert/wanchain-utils": "1.1.0-beta0" + "@0xcert/ethereum-value-ledger": "1.1.0-alpha0", + "@0xcert/wanchain-utils": "1.1.0-alpha0" } } From 9efa6dd5ee8d9134d415380bab77987c2a1abf3d Mon Sep 17 00:00:00 2001 From: Tadej Vengust Date: Wed, 27 Mar 2019 13:12:17 +0100 Subject: [PATCH 15/22] Fix readme style. --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 93a0a3815..f1503528c 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,8 @@ To learn more about the 0xcert Framework, the Protocol, and the 0xcert news, ple | 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. ### 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 From ac14232c1c9f05bbcffef794ce6900346e960ced Mon Sep 17 00:00:00 2001 From: Tadej Vengust Date: Thu, 28 Mar 2019 09:24:47 +0100 Subject: [PATCH 16/22] Fix static get instance to support extended classes. --- packages/0xcert-ethereum-asset-ledger/src/core/ledger.ts | 2 +- packages/0xcert-ethereum-http-provider/src/core/provider.ts | 2 +- packages/0xcert-ethereum-metamask-provider/src/core/provider.ts | 2 +- packages/0xcert-ethereum-order-gateway/src/core/gateway.ts | 2 +- packages/0xcert-ethereum-value-ledger/src/core/ledger.ts | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/0xcert-ethereum-asset-ledger/src/core/ledger.ts b/packages/0xcert-ethereum-asset-ledger/src/core/ledger.ts index 74806b95b..f5c9bf0eb 100644 --- a/packages/0xcert-ethereum-asset-ledger/src/core/ledger.ts +++ b/packages/0xcert-ethereum-asset-ledger/src/core/ledger.ts @@ -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); } /** 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-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-order-gateway/src/core/gateway.ts b/packages/0xcert-ethereum-order-gateway/src/core/gateway.ts index 2fa015a58..60a32ac40 100644 --- a/packages/0xcert-ethereum-order-gateway/src/core/gateway.ts +++ b/packages/0xcert-ethereum-order-gateway/src/core/gateway.ts @@ -32,7 +32,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); } /** diff --git a/packages/0xcert-ethereum-value-ledger/src/core/ledger.ts b/packages/0xcert-ethereum-value-ledger/src/core/ledger.ts index f8dd4dbc1..05a2ff0f1 100644 --- a/packages/0xcert-ethereum-value-ledger/src/core/ledger.ts +++ b/packages/0xcert-ethereum-value-ledger/src/core/ledger.ts @@ -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); } /** From 57aa03f44688d1e65cca813b1cbebf8cfe957c49 Mon Sep 17 00:00:00 2001 From: Tadej Vengust Date: Thu, 28 Mar 2019 09:31:26 +0100 Subject: [PATCH 17/22] Temporary solution for address abi encoding until ethers.js version 5. --- .../src/tests/core/ledger.test.ts | 16 ++++++++++++ .../src/lib/normalize-address.ts | 25 ++++++++++++------- .../src/tests/normalize-address.test.ts | 11 ++++---- 3 files changed, 37 insertions(+), 15 deletions(-) create mode 100644 packages/0xcert-wanchain-asset-ledger/src/tests/core/ledger.test.ts diff --git a/packages/0xcert-wanchain-asset-ledger/src/tests/core/ledger.test.ts b/packages/0xcert-wanchain-asset-ledger/src/tests/core/ledger.test.ts new file mode 100644 index 000000000..705ec2047 --- /dev/null +++ b/packages/0xcert-wanchain-asset-ledger/src/tests/core/ledger.test.ts @@ -0,0 +1,16 @@ +import { Spec } from '@hayspec/spec'; +import { AssetLedger } from '../..'; + +const spec = new Spec(); + +spec.test('Check normalize address override', (ctx) => { + const ledger1 = new AssetLedger(null, '0xE96D860C8BBB30F6831E6E65D327295B7A0C524F'); + ctx.is(ledger1.id, '0xe96d860c8bbb30f6831e6e65d327295b7a0c524f'); + // ctx.is(ledger1.id, '0xE96d860c8bbb30f6831e6e65D327295b7a0c524F'); + + const ledger2 = AssetLedger.getInstance(null, '0xE96D860C8BBB30F6831E6E65D327295B7A0C524F'); + ctx.is(ledger2.id, '0xe96d860c8bbb30f6831e6e65d327295b7a0c524f'); + // ctx.is(ledger2.id, '0xE96d860c8bbb30f6831e6e65D327295b7a0c524F'); +}); + +export default spec; diff --git a/packages/0xcert-wanchain-utils/src/lib/normalize-address.ts b/packages/0xcert-wanchain-utils/src/lib/normalize-address.ts index 91d8136e0..9e6905f76 100644 --- a/packages/0xcert-wanchain-utils/src/lib/normalize-address.ts +++ b/packages/0xcert-wanchain-utils/src/lib/normalize-address.ts @@ -10,14 +10,21 @@ export function normalizeAddress(address: string): string { return null; } - address = normalizeEthereumAddress(address.toLowerCase()); + // We are using ethers.js for encoding ABI calls. This means that if we send in a wanchain address, + // ethers.js will throw an error. Ethers.js 5.0 with subclassing will be available in the following + // weeks. Up till then we just make the address lowercase and let Ethers.js do its thing. Because of + // this there is a danger of making a transaction to an ethereum address since there is no checksum check. - return [ - '0x', - ...address.substr(2).split('').map((character) => { - return character == character.toLowerCase() - ? character.toUpperCase() - : character.toLowerCase(); - }), - ].join(''); + 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 index 910bbbdfd..0d967adf0 100644 --- a/packages/0xcert-wanchain-utils/src/tests/normalize-address.test.ts +++ b/packages/0xcert-wanchain-utils/src/tests/normalize-address.test.ts @@ -4,13 +4,12 @@ import { normalizeAddress } from '../lib/normalize-address'; const spec = new Spec(); spec.test('normalize address', (ctx) => { - console.log(normalizeAddress('0xE96D860C8BBB30F6831E6E65D327295B7A0C524F')); - ctx.is(normalizeAddress('0xE96D860C8BBB30F6831E6E65D327295B7A0C524F'), '0xE96d860c8bbb30f6831e6e65D327295b7a0c524F'); - ctx.is(normalizeAddress('0xe96d860c8bbb30f6831e6e65d327295b7a0c524f'), '0xE96d860c8bbb30f6831e6e65D327295b7a0c524F'); - ctx.is(normalizeAddress('0xE96d860c8bbb30f6831e6e65D327295b7a0c524F'), '0xE96d860c8bbb30f6831e6e65D327295b7a0c524F'); - ctx.is(normalizeAddress('E96d860c8bbb30f6831e6e65D327295b7a0c524F'), '0xE96d860c8bbb30f6831e6e65D327295b7a0c524F'); + // ctx.is(normalizeAddress('0xE96D860C8BBB30F6831E6E65D327295B7A0C524F'), '0xE96d860c8bbb30f6831e6e65D327295b7a0c524F'); + // ctx.is(normalizeAddress('0xe96d860c8bbb30f6831e6e65d327295b7a0c524f'), '0xE96d860c8bbb30f6831e6e65D327295b7a0c524F'); + // ctx.is(normalizeAddress('0xE96d860c8bbb30f6831e6e65D327295b7a0c524F'), '0xE96d860c8bbb30f6831e6e65D327295b7a0c524F'); + // ctx.is(normalizeAddress('E96d860c8bbb30f6831e6e65D327295b7a0c524F'), '0xE96d860c8bbb30f6831e6e65D327295b7a0c524F'); ctx.is(normalizeAddress(null), null); - ctx.throws(() => normalizeAddress('dfg')); + // ctx.throws(() => normalizeAddress('dfg')); }); export default spec; From 1f69e7c5e0ff9c59b6adf940f4c45d3b4730e2e9 Mon Sep 17 00:00:00 2001 From: Tadej Vengust Date: Thu, 28 Mar 2019 15:42:58 +0100 Subject: [PATCH 18/22] Add wanchain documentation. --- docs/api/wanchain.md | 2018 ++++++++++++++++++++++++++++++++++++++++++ docs/index.md | 1 + 2 files changed, 2019 insertions(+) create mode 100644 docs/api/wanchain.md diff --git a/docs/api/wanchain.md b/docs/api/wanchain.md new file mode 100644 index 000000000..7b911f1b9 --- /dev/null +++ b/docs/api/wanchain.md @@ -0,0 +1,2018 @@ +# API / Wanchain + +## HTTP provider + +HTTP provider uses HTTP and HTTPS protocol for communication with the Wanchain node. It is used mostly for querying and mutating data but does not support subscriptions. + +::: warning +Don't forget to manually unlock your account before performing a mutation. +::: + +### HttpProvider(options) + +A `class` providing communication with the Wanchain blockchain using the HTTP/HTTPS protocol. + +**Arguments** + +| Argument | Description +|-|- +| options.accountId | [required] A `string` representing the Wanchain account that will perform actions. +| options.assetLedgerSource | A `string` representing the URL to the compiled ERC-721 related smart contract definition file. +| options.cache | A `string` representing request cache type. It defaults to `no-cache`. Please see more details [here](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch). +| options.credentials | A `string` representing request credentials. It defaults to `omit`. Please see more details [here](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch). +| options.headers | An `object` of request headers. Please see more details [here](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch). +| options.mode | A `string` representing request mode. It defaults to `same-origin`. Please see more details [here](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch). +| options.mutationTimeout | A `number` representing the number of milliseconds in which a mutation times out. Defaults to `3600000`. You can set it to `-1` for disable timeout. +| options.orderGatewayId | A `string` representing an Wanchain address of the [order gateway](/#public-addresses). +| options.redirect | A `string` representing request redirect mode. It defaults to `follow`. Please see more details [here](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch). +| options.requiredConfirmations | An `integer` represeting the number of confirmations needed for mutations to be considered confirmed. It defaults to `1`. +| options.signMethod | An `integer` representing the signature type. The available options are `0` (eth_sign) or `2` (EIP-712) or `3` (perosnal_sign). It defaults to `0`. +| options.unsafeRecipientIds | A list of `strings` representing smart contract addresses that do not support safe ERC-721 transfers. +| options.url | [required] A `string` representing the URL to the Wanchain node's JSON RPC. +| options.valueLedgerSource | A `string` representing the URL to the compiled ERC-20 related smart contract definition file. + +**Usage** + +```ts +import { HttpProvider } from '@0xcert/wachain-http-provider'; + +const provider = new HttpProvider({ + accountId: '0x...', + url: 'https://connection-to-wanchain-rpc-node/', +}); +``` + +::: warning +Please note, when using [Infra](http://infra.wanchainx.exchange/), only queries are supported. +::: + +### assetLedgerSource + +A class instance `variable` holding a `string` which represents the URL to the compiled ERC-721 related smart contract definition file. This file is used when deploying new asset ledgers to the network. + +### getAvailableAccounts() + +An `asynchronous` class instance `function` which returns currently available Wanchain wallet addresses. + +**Result:** + +A list of `strings` representing Wanchain account IDs. + +**Example:** + +```ts +// perform query +const accountIds = await provider.getAvailableAccounts(); +``` + +### getInstance(options) + +A static class `function` that returns a new instance of the HttpProvider class (alias for `new HttpProvider`). + +**Arguments** + +See the class [constructor](#http-provider) for details. + +**Usage** + +```ts +import { HttpProvider } from '@0xcert/wanchain-http-provider'; + +// create provider instance +const provider = HttpProvider.getInstance(); +``` + +### getNetworkVersion() + +An `asynchronous` class instance `function` which returns Wanchain network version (e.g. `1` for Wanchain Mainnet). + +**Result:** + +A `string` representing Wanchain network version. + +**Example:** + +```ts +// perform query +const version = await provider.getNetworkVersion(); +``` + +### isCurrentAccount(accountId) + +A `synchronous` class instance `function` which returns `true` when the provided `accountId` maches the currently set account ID. + +**Arguments:** + +| Argument | Description +|-|- +| accountId | [required] A `string` representing Wanchain account address. + +**Result:** + +A `boolean` which tells if the `accountId` maches the currently set account ID. + +**Example:** + +```ts +// wanchain wallet address +const walletId = '0x...'; + +// perform query +const maches = provider.isCurrentAccount(walletId); +``` + +### isSupported() + +A `synchronous` class instance `function` which returns `true` when the provider is supported by the environment. + +**Result:** + +A `boolean` which tells if the provider can be used. + +**Example:** + +```ts +// perform query +const isSupported = provider.isSupported(); +``` + +### isUnsafeRecipientId(ledgerId) + +A `synchronous` class instance `function` which returns `true` when the provided `ledgerId` is listed among unsafe recipient ids on the provided. + +**Arguments:** + +| Argument | Description +|-|- +| ledgerId | [required] A `string` representing an address of the ERC-721 related smart contract on the Wanchain blockchain. + +**Result:** + +A `boolean` which tells if the `id` is unsafe recipient. + +**Example:** + +```ts +// unsafe recipient address +const unsafeId = '0x...'; + +// perform query +const isUnsafe = provider.isUnsafeRecipientId(unsafeId); +``` + +**See also:** + +[unsafeRecipientIds](#unsaferecipientids-2) + +### mutationTimeout + +A class instance `variable` holding an `integer` number of milliseconds in which a mutation times out. + +### on(event, handler); + +A `synchronous` class instance `function` which attaches a new event handler. + +**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:** + +[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 an 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 an 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 an 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 an 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 an 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 an 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 an 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 an 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 an 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 an 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:

+
From b66b99a52403fe42b9f7e41aea182e34fcabc963 Mon Sep 17 00:00:00 2001 From: Tadej Vengust Date: Fri, 29 Mar 2019 11:05:15 +0100 Subject: [PATCH 19/22] Typo fixes. --- docs/api/wanchain.md | 28 +++++++++---------- .../src/lib/normalize-address.ts | 6 ++-- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/docs/api/wanchain.md b/docs/api/wanchain.md index 7b911f1b9..2f9354781 100644 --- a/docs/api/wanchain.md +++ b/docs/api/wanchain.md @@ -23,7 +23,7 @@ A `class` providing communication with the Wanchain blockchain using the HTTP/HT | options.headers | An `object` of request headers. Please see more details [here](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch). | options.mode | A `string` representing request mode. It defaults to `same-origin`. Please see more details [here](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch). | options.mutationTimeout | A `number` representing the number of milliseconds in which a mutation times out. Defaults to `3600000`. You can set it to `-1` for disable timeout. -| options.orderGatewayId | A `string` representing an Wanchain address of the [order gateway](/#public-addresses). +| options.orderGatewayId | A `string` representing a Wanchain address of the [order gateway](/#public-addresses). | options.redirect | A `string` representing request redirect mode. It defaults to `follow`. Please see more details [here](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch). | options.requiredConfirmations | An `integer` represeting the number of confirmations needed for mutations to be considered confirmed. It defaults to `1`. | options.signMethod | An `integer` representing the signature type. The available options are `0` (eth_sign) or `2` (EIP-712) or `3` (perosnal_sign). It defaults to `0`. @@ -255,7 +255,7 @@ provider.off(ProviderEvent.NETWORK_CHANGE); ### orderGatewayId -A class instance `variable` holding a `string` which represents an Wanchain address of the [order gateway](/#public-addresses). +A class instance `variable` holding a `string` which represents a Wanchain address of the [order gateway](/#public-addresses). ### requiredConfirmations @@ -307,7 +307,7 @@ A `class` which handles transaction-related operations on the Wanchain blockchai | Argument | Description |-|-|- -| mutationId | [required] A `string` representing a hash string of an Wanchain transaction. +| mutationId | [required] A `string` representing a hash string of a Wanchain transaction. | provider | [required] An instance of an HTTP provider. **Usage** @@ -388,7 +388,7 @@ mutation.forget(); ### id -A class instance `variable` holding a `string` which represents a hash of an Wanchain transaction. +A class instance `variable` holding a `string` which represents a hash of a Wanchain transaction. ### isCompleted() @@ -513,7 +513,7 @@ mutation.off(MutationEvent.ERROR); ### receiverId -A class instance `variable` holding a `string` which represents an Wanchain account address that plays the role of a receiver. +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. @@ -521,7 +521,7 @@ When you are deploying a new ledger, this variable represents the ledger ID and ### senderId -A class instance `variable` holding a `string` which represents an Wanchain account address that plays the role of a sender. +A class instance `variable` holding a `string` which represents a Wanchain account address that plays the role of a sender. ## Mutation events @@ -618,7 +618,7 @@ Multiple operators can exist. | Argument | Description |-|- -| accountId | [required] A `string` representing an Wanchain account address or an instance of the `OrderGateway` class that will receive new management permissions on this ledger. +| 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:** @@ -653,7 +653,7 @@ The `CREATE_ASSET` ledger ability is needed to perform this function. |-|- | 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 an Wanchain account address that will receive the new asset. +| recipe.receiverId | [required] A `string` representing a Wanchain account address that will receive the new asset. **Result:** @@ -882,7 +882,7 @@ 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`. +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`. @@ -992,7 +992,7 @@ const accountId = await ledger.getAssetAccount(assetId); ### getAssetIdAt(index) -An `asynchronous` class instance `function` which returns the asset id at specified `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`. @@ -1006,7 +1006,7 @@ The function might fail on some third party ERC721 contracts. If the token contr **Result:** -A `number` representing the asset id. +A `number` representing the asset ID. **Example:** @@ -1116,7 +1116,7 @@ The `MANAGE_ABILITIES` super ability of the ledger is required to perform this f | Argument | Description |-|- -| accountId | [required] A `string` representing an Wanchain account address or an instance of the `OrderGateway` class that will receive new management permissions on this ledger. +| 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:** @@ -1847,7 +1847,7 @@ This operation must be executed by the maker of the order. |-|- | 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 an Wanchain account address which makes the order. It defaults to the `accountId` of a provider. +| 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. @@ -1919,7 +1919,7 @@ This operation must be executed by the taker of the order. | 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 an Wanchain account address which makes the order. It defaults to the `accountId` of a provider. +| 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. diff --git a/packages/0xcert-wanchain-utils/src/lib/normalize-address.ts b/packages/0xcert-wanchain-utils/src/lib/normalize-address.ts index 9e6905f76..6e1002875 100644 --- a/packages/0xcert-wanchain-utils/src/lib/normalize-address.ts +++ b/packages/0xcert-wanchain-utils/src/lib/normalize-address.ts @@ -10,10 +10,10 @@ export function normalizeAddress(address: string): string { return null; } - // We are using ethers.js for encoding ABI calls. This means that if we send in a wanchain address, + // 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. Up till then we just make the address lowercase and let Ethers.js do its thing. Because of - // this there is a danger of making a transaction to an ethereum address since there is no checksum check. + // 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(); From fbeb7e580fb0e02c6cdae8a78ac06837d124b53e Mon Sep 17 00:00:00 2001 From: Tadej Vengust Date: Tue, 9 Apr 2019 08:56:15 +0200 Subject: [PATCH 20/22] Refactor encoding for simpler overrides. --- common/config/rush/npm-shrinkwrap.json | 1876 +++++++++-------- common/config/rush/version-policies.json | 2 +- conventions/.vuepress/package-lock.json | 308 +-- dist/0xcert-cert.min.js | 2 +- dist/0xcert-ethereum-asset-ledger.min.js | 4 +- dist/0xcert-ethereum-http-provider.min.js | 4 +- dist/0xcert-ethereum-metamask-provider.min.js | 4 +- dist/0xcert-ethereum-order-gateway.min.js | 4 +- dist/0xcert-ethereum-value-ledger.min.js | 4 +- dist/0xcert-ethereum.min.js | 4 +- dist/0xcert-wanchain-asset-ledger.min.js | 4 +- dist/0xcert-wanchain-http-provider.min.js | 4 +- dist/0xcert-wanchain-order-gateway.min.js | 4 +- dist/0xcert-wanchain-value-ledger.min.js | 4 +- dist/0xcert-wanchain.min.js | 4 +- docs/.vuepress/package-lock.json | 346 +-- packages/0xcert-cert/CHANGELOG.json | 4 +- packages/0xcert-cert/CHANGELOG.md | 2 +- packages/0xcert-cert/package.json | 8 +- packages/0xcert-conventions/CHANGELOG.json | 4 +- packages/0xcert-conventions/CHANGELOG.md | 2 +- packages/0xcert-conventions/package.json | 4 +- .../CHANGELOG.json | 4 +- .../0xcert-ethereum-asset-ledger/CHANGELOG.md | 2 +- .../0xcert-ethereum-asset-ledger/package.json | 12 +- .../src/core/ledger.ts | 40 +- .../src/mutations/approve-account.ts | 3 +- .../src/mutations/create-asset.ts | 3 +- .../src/mutations/deploy.ts | 3 +- .../src/mutations/destroy-asset.ts | 3 +- .../src/mutations/grant-abilities.ts | 3 +- .../src/mutations/revoke-abilities.ts | 3 +- .../src/mutations/revoke-asset.ts | 3 +- .../src/mutations/safe-transfer.ts | 3 +- .../src/mutations/set-approval-for-all.ts | 3 +- .../src/mutations/set-enabled.ts | 3 +- .../src/mutations/transfer.ts | 3 +- .../src/mutations/update-asset.ts | 3 +- .../src/mutations/update.ts | 3 +- .../src/queries/get-abilities.ts | 5 +- .../src/queries/get-account-asset-id-at.ts | 5 +- .../src/queries/get-approved-account.ts | 5 +- .../src/queries/get-asset-account.ts | 5 +- .../src/queries/get-asset-id-at.ts | 5 +- .../src/queries/get-asset.ts | 5 +- .../src/queries/get-balance.ts | 5 +- .../src/queries/get-capabilities.ts | 5 +- .../src/queries/get-info.ts | 5 +- .../src/queries/is-approved-for-all.ts | 5 +- .../src/queries/is-enabled.ts | 5 +- .../src/queries/kitty-index-to-approved.ts | 5 +- .../CHANGELOG.json | 4 +- .../CHANGELOG.md | 2 +- .../package.json | 4 +- .../CHANGELOG.json | 4 +- .../CHANGELOG.md | 2 +- .../package.json | 4 +- .../CHANGELOG.json | 4 +- .../CHANGELOG.md | 2 +- .../package.json | 6 +- .../src/core/provider.ts | 34 +- .../CHANGELOG.json | 4 +- .../CHANGELOG.md | 2 +- .../package.json | 8 +- .../CHANGELOG.json | 4 +- .../CHANGELOG.md | 2 +- .../package.json | 6 +- .../CHANGELOG.json | 4 +- .../CHANGELOG.md | 2 +- .../package.json | 12 +- .../CHANGELOG.json | 4 +- .../CHANGELOG.md | 2 +- .../package.json | 10 +- .../src/core/gateway.ts | 31 +- .../src/lib/order.ts | 16 +- .../src/mutations/cancel.ts | 3 +- .../src/mutations/perform.ts | 3 +- .../src/queries/get-order-data-claim.ts | 5 +- .../src/queries/get-proxy-account-id.ts | 5 +- .../src/queries/is-valid-signature.ts | 5 +- .../order/normalize-order-ids-method.test.ts | 3 +- .../CHANGELOG.json | 4 +- .../CHANGELOG.md | 2 +- .../package.json | 10 +- .../0xcert-ethereum-sandbox/CHANGELOG.json | 4 +- packages/0xcert-ethereum-sandbox/CHANGELOG.md | 2 +- packages/0xcert-ethereum-sandbox/package.json | 12 +- .../CHANGELOG.json | 4 +- .../CHANGELOG.md | 2 +- .../package.json | 2 +- packages/0xcert-ethereum-utils/src/index.ts | 2 + .../0xcert-ethereum-utils/src/lib/encoder.ts | 35 + .../0xcert-ethereum-utils/src/types/utils.ts | 22 + .../CHANGELOG.json | 4 +- .../0xcert-ethereum-value-ledger/CHANGELOG.md | 2 +- .../0xcert-ethereum-value-ledger/package.json | 12 +- .../src/core/ledger.ts | 31 +- .../src/mutations/approve-account.ts | 3 +- .../src/mutations/deploy.ts | 3 +- .../src/mutations/transfer-from.ts | 3 +- .../src/mutations/transfer.ts | 3 +- .../src/queries/get-allowance.ts | 5 +- .../src/queries/get-balance.ts | 5 +- .../src/queries/get-info.ts | 5 +- .../CHANGELOG.json | 4 +- .../CHANGELOG.md | 2 +- .../package.json | 6 +- packages/0xcert-merkle/CHANGELOG.json | 4 +- packages/0xcert-merkle/CHANGELOG.md | 2 +- packages/0xcert-merkle/package.json | 4 +- packages/0xcert-scaffold/CHANGELOG.json | 4 +- packages/0xcert-scaffold/CHANGELOG.md | 2 +- packages/0xcert-scaffold/package.json | 2 +- packages/0xcert-utils/CHANGELOG.json | 4 +- packages/0xcert-utils/CHANGELOG.md | 2 +- packages/0xcert-utils/package.json | 2 +- packages/0xcert-vue-example/package.json | 14 +- packages/0xcert-vue-plugin/CHANGELOG.json | 4 +- packages/0xcert-vue-plugin/CHANGELOG.md | 2 +- packages/0xcert-vue-plugin/package.json | 4 +- .../0xcert-wanchain-asset-ledger/package.json | 6 +- .../src/core/ledger.ts | 12 +- .../src/tests/core/ledger.test.ts | 16 - .../package.json | 7 +- .../src/core/provider.ts | 139 +- .../src/index.ts | 3 +- .../tests/provider/normalize-address.test.ts | 22 + .../CHANGELOG.json | 4 +- .../CHANGELOG.md | 2 +- .../package.json | 5 +- .../src/core/gateway.ts | 24 +- .../src/lib/order.ts | 18 - packages/0xcert-wanchain-utils/package.json | 3 +- packages/0xcert-wanchain-utils/src/index.ts | 2 +- .../0xcert-wanchain-utils/src/lib/encoder.ts | 55 + .../src/lib/normalize-address.ts | 30 - .../src/tests/normalize-address.test.ts | 5 +- .../0xcert-wanchain-value-ledger/package.json | 5 +- .../src/core/ledger.ts | 12 +- packages/0xcert-webpack/package.json | 20 +- rush.json | 10 +- 141 files changed, 1849 insertions(+), 1746 deletions(-) create mode 100644 packages/0xcert-ethereum-utils/src/lib/encoder.ts create mode 100644 packages/0xcert-ethereum-utils/src/types/utils.ts delete mode 100644 packages/0xcert-wanchain-asset-ledger/src/tests/core/ledger.test.ts create mode 100644 packages/0xcert-wanchain-http-provider/src/tests/provider/normalize-address.test.ts delete mode 100644 packages/0xcert-wanchain-order-gateway/src/lib/order.ts create mode 100644 packages/0xcert-wanchain-utils/src/lib/encoder.ts delete mode 100644 packages/0xcert-wanchain-utils/src/lib/normalize-address.ts diff --git a/common/config/rush/npm-shrinkwrap.json b/common/config/rush/npm-shrinkwrap.json index 31e27d318..cdc8f1df1 100644 --- a/common/config/rush/npm-shrinkwrap.json +++ b/common/config/rush/npm-shrinkwrap.json @@ -4,14 +4,6 @@ "lockfileVersion": 1, "requires": true, "dependencies": { - "@0xcert/ethereum-utils": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@0xcert/ethereum-utils/-/ethereum-utils-1.2.0.tgz", - "integrity": "sha512-f5FhDciuyrqBdjAtTX10upLNB4hBYaQmActwcUlj7Hh9ZR9RRHMbqA7AzGB+Mo2bf+PuELLy9kRjosYZZNY3GQ==", - "requires": { - "ethers": "4.0.0-beta.1" - } - }, "@babel/code-frame": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0.tgz", @@ -21,17 +13,17 @@ } }, "@babel/core": { - "version": "7.3.4", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.3.4.tgz", - "integrity": "sha512-jRsuseXBo9pN197KnDwhhaaBzyZr2oIcLHHTt2oDdQrej5Qp57dCCJafWx5ivU8/alEYDpssYqv1MUqcxwQlrA==", + "version": "7.4.3", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.4.3.tgz", + "integrity": "sha512-oDpASqKFlbspQfzAE7yaeTmdljSH2ADIvBlb0RwbStltTuWa0+7CCI1fYVINNv9saHPa1W7oaKeuNuKj+RQCvA==", "requires": { "@babel/code-frame": "^7.0.0", - "@babel/generator": "^7.3.4", - "@babel/helpers": "^7.2.0", - "@babel/parser": "^7.3.4", - "@babel/template": "^7.2.2", - "@babel/traverse": "^7.3.4", - "@babel/types": "^7.3.4", + "@babel/generator": "^7.4.0", + "@babel/helpers": "^7.4.3", + "@babel/parser": "^7.4.3", + "@babel/template": "^7.4.0", + "@babel/traverse": "^7.4.3", + "@babel/types": "^7.4.0", "convert-source-map": "^1.1.0", "debug": "^4.1.0", "json5": "^2.1.0", @@ -48,23 +40,15 @@ "requires": { "ms": "^2.1.1" } - }, - "json5": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.0.tgz", - "integrity": "sha512-8Mh9h6xViijj36g7Dxi+Y4S6hNGV96vcJZr/SrlHh1LR/pEn/8j/+qIBbs44YKl69Lrfctp4QD+AdWLTMqEZAQ==", - "requires": { - "minimist": "^1.2.0" - } } } }, "@babel/generator": { - "version": "7.3.4", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.3.4.tgz", - "integrity": "sha512-8EXhHRFqlVVWXPezBW5keTiQi/rJMQTg/Y9uVCEZ0CAF3PKtCCaVRnp64Ii1ujhkoDhhF1fVsImoN4yJ2uz4Wg==", + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.4.0.tgz", + "integrity": "sha512-/v5I+a1jhGSKLgZDcmAUZ4K/VePi43eRkUs3yePW1HB1iANOD5tqJXwGSG4BZhSksP8J9ejSlwGeTiiOFZOrXQ==", "requires": { - "@babel/types": "^7.3.4", + "@babel/types": "^7.4.0", "jsesc": "^2.5.1", "lodash": "^4.17.11", "source-map": "^0.5.0", @@ -89,36 +73,36 @@ } }, "@babel/helper-call-delegate": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/@babel/helper-call-delegate/-/helper-call-delegate-7.1.0.tgz", - "integrity": "sha512-YEtYZrw3GUK6emQHKthltKNZwszBcHK58Ygcis+gVUrF4/FmTVr5CCqQNSfmvg2y+YDEANyYoaLz/SHsnusCwQ==", + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/@babel/helper-call-delegate/-/helper-call-delegate-7.4.0.tgz", + "integrity": "sha512-SdqDfbVdNQCBp3WhK2mNdDvHd3BD6qbmIc43CAyjnsfCmgHMeqgDcM3BzY2lchi7HBJGJ2CVdynLWbezaE4mmQ==", "requires": { - "@babel/helper-hoist-variables": "^7.0.0", - "@babel/traverse": "^7.1.0", - "@babel/types": "^7.0.0" + "@babel/helper-hoist-variables": "^7.4.0", + "@babel/traverse": "^7.4.0", + "@babel/types": "^7.4.0" } }, "@babel/helper-create-class-features-plugin": { - "version": "7.3.4", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.3.4.tgz", - "integrity": "sha512-uFpzw6L2omjibjxa8VGZsJUPL5wJH0zzGKpoz0ccBkzIa6C8kWNUbiBmQ0rgOKWlHJ6qzmfa6lTiGchiV8SC+g==", + "version": "7.4.3", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.4.3.tgz", + "integrity": "sha512-UMl3TSpX11PuODYdWGrUeW6zFkdYhDn7wRLrOuNVM6f9L+S9CzmDXYyrp3MTHcwWjnzur1f/Op8A7iYZWya2Yg==", "requires": { "@babel/helper-function-name": "^7.1.0", "@babel/helper-member-expression-to-functions": "^7.0.0", "@babel/helper-optimise-call-expression": "^7.0.0", "@babel/helper-plugin-utils": "^7.0.0", - "@babel/helper-replace-supers": "^7.3.4", - "@babel/helper-split-export-declaration": "^7.0.0" + "@babel/helper-replace-supers": "^7.4.0", + "@babel/helper-split-export-declaration": "^7.4.0" } }, "@babel/helper-define-map": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/@babel/helper-define-map/-/helper-define-map-7.1.0.tgz", - "integrity": "sha512-yPPcW8dc3gZLN+U1mhYV91QU3n5uTbx7DUdf8NnPbjS0RMwBuHi9Xt2MUgppmNz7CJxTBWsGczTiEp1CSOTPRg==", + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/@babel/helper-define-map/-/helper-define-map-7.4.0.tgz", + "integrity": "sha512-wAhQ9HdnLIywERVcSvX40CEJwKdAa1ID4neI9NXQPDOHwwA+57DqwLiPEVy2AIyWzAk0CQ8qx4awO0VUURwLtA==", "requires": { "@babel/helper-function-name": "^7.1.0", - "@babel/types": "^7.0.0", - "lodash": "^4.17.10" + "@babel/types": "^7.4.0", + "lodash": "^4.17.11" } }, "@babel/helper-explode-assignable-expression": { @@ -149,11 +133,11 @@ } }, "@babel/helper-hoist-variables": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.0.0.tgz", - "integrity": "sha512-Ggv5sldXUeSKsuzLkddtyhyHe2YantsxWKNi7A+7LeD12ExRDWTRk29JCXpaHPAbMaIPZSil7n+lq78WY2VY7w==", + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.4.0.tgz", + "integrity": "sha512-/NErCuoe/et17IlAQFKWM24qtyYYie7sFIrW/tIQXpck6vAu2hhtYYsKLBWQV+BQZMbcIYPU/QMYuTufrY4aQw==", "requires": { - "@babel/types": "^7.0.0" + "@babel/types": "^7.4.0" } }, "@babel/helper-member-expression-to-functions": { @@ -173,16 +157,16 @@ } }, "@babel/helper-module-transforms": { - "version": "7.2.2", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.2.2.tgz", - "integrity": "sha512-YRD7I6Wsv+IHuTPkAmAS4HhY0dkPobgLftHp0cRGZSdrRvmZY8rFvae/GVu3bD00qscuvK3WPHB3YdNpBXUqrA==", + "version": "7.4.3", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.4.3.tgz", + "integrity": "sha512-H88T9IySZW25anu5uqyaC1DaQre7ofM+joZtAaO2F8NBdFfupH0SZ4gKjgSFVcvtx/aAirqA9L9Clio2heYbZA==", "requires": { "@babel/helper-module-imports": "^7.0.0", "@babel/helper-simple-access": "^7.1.0", "@babel/helper-split-export-declaration": "^7.0.0", "@babel/template": "^7.2.2", "@babel/types": "^7.2.2", - "lodash": "^4.17.10" + "lodash": "^4.17.11" } }, "@babel/helper-optimise-call-expression": { @@ -199,11 +183,11 @@ "integrity": "sha512-CYAOUCARwExnEixLdB6sDm2dIJ/YgEAKDM1MOeMeZu9Ld/bDgVo8aiWrXwcY7OBh+1Ea2uUcVRcxKk0GJvW7QA==" }, "@babel/helper-regex": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/helper-regex/-/helper-regex-7.0.0.tgz", - "integrity": "sha512-TR0/N0NDCcUIUEbqV6dCO+LptmmSQFQ7q70lfcEB4URsjD0E1HzicrwUH+ap6BAQ2jhCX9Q4UqZy4wilujWlkg==", + "version": "7.4.3", + "resolved": "https://registry.npmjs.org/@babel/helper-regex/-/helper-regex-7.4.3.tgz", + "integrity": "sha512-hnoq5u96pLCfgjXuj8ZLX3QQ+6nAulS+zSgi6HulUwFbEruRAKwbGLU5OvXkE14L8XW6XsQEKsIDfgthKLRAyA==", "requires": { - "lodash": "^4.17.10" + "lodash": "^4.17.11" } }, "@babel/helper-remap-async-to-generator": { @@ -219,14 +203,14 @@ } }, "@babel/helper-replace-supers": { - "version": "7.3.4", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.3.4.tgz", - "integrity": "sha512-pvObL9WVf2ADs+ePg0jrqlhHoxRXlOa+SHRHzAXIz2xkYuOHfGl+fKxPMaS4Fq+uje8JQPobnertBBvyrWnQ1A==", + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.4.0.tgz", + "integrity": "sha512-PVwCVnWWAgnal+kJ+ZSAphzyl58XrFeSKSAJRiqg5QToTsjL+Xu1f9+RJ+d+Q0aPhPfBGaYfkox66k86thxNSg==", "requires": { "@babel/helper-member-expression-to-functions": "^7.0.0", "@babel/helper-optimise-call-expression": "^7.0.0", - "@babel/traverse": "^7.3.4", - "@babel/types": "^7.3.4" + "@babel/traverse": "^7.4.0", + "@babel/types": "^7.4.0" } }, "@babel/helper-simple-access": { @@ -239,11 +223,11 @@ } }, "@babel/helper-split-export-declaration": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.0.0.tgz", - "integrity": "sha512-MXkOJqva62dfC0w85mEf/LucPPS/1+04nmmRMPEBUB++hiiThQ2zPtX/mEWQ3mtzCEjIJvPY8nuwxXtQeQwUag==", + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.4.0.tgz", + "integrity": "sha512-7Cuc6JZiYShaZnybDmfwhY4UYHzI6rlqhWjaIqbsJGsIqPimEYy5uh3akSRLMg65LSdSEnJ8a8/bWQN6u2oMGw==", "requires": { - "@babel/types": "^7.0.0" + "@babel/types": "^7.4.0" } }, "@babel/helper-wrap-function": { @@ -258,13 +242,13 @@ } }, "@babel/helpers": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.3.1.tgz", - "integrity": "sha512-Q82R3jKsVpUV99mgX50gOPCWwco9Ec5Iln/8Vyu4osNIOQgSrd9RFrQeUvmvddFNoLwMyOUWU+5ckioEKpDoGA==", + "version": "7.4.3", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.4.3.tgz", + "integrity": "sha512-BMh7X0oZqb36CfyhvtbSmcWc3GXocfxv3yNsAEuM0l+fAqSO22rQrUpijr3oE/10jCTrB6/0b9kzmG4VetCj8Q==", "requires": { - "@babel/template": "^7.1.2", - "@babel/traverse": "^7.1.5", - "@babel/types": "^7.3.0" + "@babel/template": "^7.4.0", + "@babel/traverse": "^7.4.3", + "@babel/types": "^7.4.0" } }, "@babel/highlight": { @@ -278,9 +262,9 @@ } }, "@babel/parser": { - "version": "7.3.4", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.3.4.tgz", - "integrity": "sha512-tXZCqWtlOOP4wgCp6RjRvLmfuhnqTLy9VHwRochJBCP2nDm27JnnuFEnXFASVyQNHk36jD1tAammsCEEqgscIQ==" + "version": "7.4.3", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.4.3.tgz", + "integrity": "sha512-gxpEUhTS1sGA63EGQGuA+WESPR/6tz6ng7tSHFCmaTJK/cGK8y37cBTspX+U2xCAue2IQVvF6Z0oigmjwD8YGQ==" }, "@babel/plugin-proposal-async-generator-functions": { "version": "7.2.0", @@ -293,20 +277,20 @@ } }, "@babel/plugin-proposal-class-properties": { - "version": "7.3.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.3.4.tgz", - "integrity": "sha512-lUf8D3HLs4yYlAo8zjuneLvfxN7qfKv1Yzbj5vjqaqMJxgJA3Ipwp4VUJ+OrOdz53Wbww6ahwB8UhB2HQyLotA==", + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.4.0.tgz", + "integrity": "sha512-t2ECPNOXsIeK1JxJNKmgbzQtoG27KIlVE61vTqX0DKR9E9sZlVVxWUtEW9D5FlZ8b8j7SBNCHY47GgPKCKlpPg==", "requires": { - "@babel/helper-create-class-features-plugin": "^7.3.4", + "@babel/helper-create-class-features-plugin": "^7.4.0", "@babel/helper-plugin-utils": "^7.0.0" } }, "@babel/plugin-proposal-decorators": { - "version": "7.3.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-decorators/-/plugin-proposal-decorators-7.3.0.tgz", - "integrity": "sha512-3W/oCUmsO43FmZIqermmq6TKaRSYhmh/vybPfVFwQWdSb8xwki38uAIvknCRzuyHRuYfCYmJzL9or1v0AffPjg==", + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-decorators/-/plugin-proposal-decorators-7.4.0.tgz", + "integrity": "sha512-d08TLmXeK/XbgCo7ZeZ+JaeZDtDai/2ctapTRsWWkkmy7G/cqz8DQN/HlWG7RR4YmfXxmExsbU3SuCjlM7AtUg==", "requires": { - "@babel/helper-create-class-features-plugin": "^7.3.0", + "@babel/helper-create-class-features-plugin": "^7.4.0", "@babel/helper-plugin-utils": "^7.0.0", "@babel/plugin-syntax-decorators": "^7.2.0" } @@ -321,9 +305,9 @@ } }, "@babel/plugin-proposal-object-rest-spread": { - "version": "7.3.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.3.4.tgz", - "integrity": "sha512-j7VQmbbkA+qrzNqbKHrBsW3ddFnOeva6wzSe/zB7T+xaxGc+RCpwo44wCmRixAIGRoIpmVgvzFzNJqQcO3/9RA==", + "version": "7.4.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.4.3.tgz", + "integrity": "sha512-xC//6DNSSHVjq8O2ge0dyYlhshsH4T7XdCVoxbi5HzLYWfsC5ooFlJjrXk8RcAT+hjHAK9UjBXdylzSoDK3t4g==", "requires": { "@babel/helper-plugin-utils": "^7.0.0", "@babel/plugin-syntax-object-rest-spread": "^7.2.0" @@ -339,46 +323,13 @@ } }, "@babel/plugin-proposal-unicode-property-regex": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.2.0.tgz", - "integrity": "sha512-LvRVYb7kikuOtIoUeWTkOxQEV1kYvL5B6U3iWEGCzPNRus1MzJweFqORTj+0jkxozkTSYNJozPOddxmqdqsRpw==", + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.4.0.tgz", + "integrity": "sha512-h/KjEZ3nK9wv1P1FSNb9G079jXrNYR0Ko+7XkOx85+gM24iZbPn0rh4vCftk+5QKY7y1uByFataBTmX7irEF1w==", "requires": { "@babel/helper-plugin-utils": "^7.0.0", "@babel/helper-regex": "^7.0.0", - "regexpu-core": "^4.2.0" - }, - "dependencies": { - "jsesc": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", - "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=" - }, - "regexpu-core": { - "version": "4.5.4", - "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.5.4.tgz", - "integrity": "sha512-BtizvGtFQKGPUcTy56o3nk1bGRp4SZOTYrDtGNlqCQufptV5IkkLN6Emw+yunAJjzf+C9FQFtvq7IoA3+oMYHQ==", - "requires": { - "regenerate": "^1.4.0", - "regenerate-unicode-properties": "^8.0.2", - "regjsgen": "^0.5.0", - "regjsparser": "^0.6.0", - "unicode-match-property-ecmascript": "^1.0.4", - "unicode-match-property-value-ecmascript": "^1.1.0" - } - }, - "regjsgen": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.5.0.tgz", - "integrity": "sha512-RnIrLhrXCX5ow/E5/Mh2O4e/oa1/jW0eaBKTSy3LaCj+M3Bqvm97GWDp2yUtzIs4LEn65zR2yiYGFqb2ApnzDA==" - }, - "regjsparser": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.0.tgz", - "integrity": "sha512-RQ7YyokLiQBomUJuUG8iGVvkgOLxwyZM8k6d3q5SAXpg4r5TZJZigKFvC6PpD+qQ98bCDC5YelPeA3EucDoNeQ==", - "requires": { - "jsesc": "~0.5.0" - } - } + "regexpu-core": "^4.5.4" } }, "@babel/plugin-syntax-async-generators": { @@ -446,9 +397,9 @@ } }, "@babel/plugin-transform-async-to-generator": { - "version": "7.3.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.3.4.tgz", - "integrity": "sha512-Y7nCzv2fw/jEZ9f678MuKdMo99MFDJMT/PvD9LisrR5JDFcJH6vYeH6RnjVt3p5tceyGRvTtEN0VOlU+rgHZjA==", + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.4.0.tgz", + "integrity": "sha512-EeaFdCeUULM+GPFEsf7pFcNSxM7hYjoj5fiYbyuiXobW4JhFnjAv9OWzNwHyHcKoPNpAfeRDuW6VyaXEDUBa7g==", "requires": { "@babel/helper-module-imports": "^7.0.0", "@babel/helper-plugin-utils": "^7.0.0", @@ -464,26 +415,26 @@ } }, "@babel/plugin-transform-block-scoping": { - "version": "7.3.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.3.4.tgz", - "integrity": "sha512-blRr2O8IOZLAOJklXLV4WhcEzpYafYQKSGT3+R26lWG41u/FODJuBggehtOwilVAcFu393v3OFj+HmaE6tVjhA==", + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.4.0.tgz", + "integrity": "sha512-AWyt3k+fBXQqt2qb9r97tn3iBwFpiv9xdAiG+Gr2HpAZpuayvbL55yWrsV3MyHvXk/4vmSiedhDRl1YI2Iy5nQ==", "requires": { "@babel/helper-plugin-utils": "^7.0.0", "lodash": "^4.17.11" } }, "@babel/plugin-transform-classes": { - "version": "7.3.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.3.4.tgz", - "integrity": "sha512-J9fAvCFBkXEvBimgYxCjvaVDzL6thk0j0dBvCeZmIUDBwyt+nv6HfbImsSrWsYXfDNDivyANgJlFXDUWRTZBuA==", + "version": "7.4.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.4.3.tgz", + "integrity": "sha512-PUaIKyFUDtG6jF5DUJOfkBdwAS/kFFV3XFk7Nn0a6vR7ZT8jYw5cGtIlat77wcnd0C6ViGqo/wyNf4ZHytF/nQ==", "requires": { "@babel/helper-annotate-as-pure": "^7.0.0", - "@babel/helper-define-map": "^7.1.0", + "@babel/helper-define-map": "^7.4.0", "@babel/helper-function-name": "^7.1.0", "@babel/helper-optimise-call-expression": "^7.0.0", "@babel/helper-plugin-utils": "^7.0.0", - "@babel/helper-replace-supers": "^7.3.4", - "@babel/helper-split-export-declaration": "^7.0.0", + "@babel/helper-replace-supers": "^7.4.0", + "@babel/helper-split-export-declaration": "^7.4.0", "globals": "^11.1.0" } }, @@ -496,54 +447,21 @@ } }, "@babel/plugin-transform-destructuring": { - "version": "7.3.2", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.3.2.tgz", - "integrity": "sha512-Lrj/u53Ufqxl/sGxyjsJ2XNtNuEjDyjpqdhMNh5aZ+XFOdThL46KBj27Uem4ggoezSYBxKWAil6Hu8HtwqesYw==", + "version": "7.4.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.4.3.tgz", + "integrity": "sha512-rVTLLZpydDFDyN4qnXdzwoVpk1oaXHIvPEOkOLyr88o7oHxVc/LyrnDx+amuBWGOwUb7D1s/uLsKBNTx08htZg==", "requires": { "@babel/helper-plugin-utils": "^7.0.0" } }, "@babel/plugin-transform-dotall-regex": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.2.0.tgz", - "integrity": "sha512-sKxnyHfizweTgKZf7XsXu/CNupKhzijptfTM+bozonIuyVrLWVUvYjE2bhuSBML8VQeMxq4Mm63Q9qvcvUcciQ==", + "version": "7.4.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.4.3.tgz", + "integrity": "sha512-9Arc2I0AGynzXRR/oPdSALv3k0rM38IMFyto7kOCwb5F9sLUt2Ykdo3V9yUPR+Bgr4kb6bVEyLkPEiBhzcTeoA==", "requires": { "@babel/helper-plugin-utils": "^7.0.0", - "@babel/helper-regex": "^7.0.0", - "regexpu-core": "^4.1.3" - }, - "dependencies": { - "jsesc": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", - "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=" - }, - "regexpu-core": { - "version": "4.5.4", - "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.5.4.tgz", - "integrity": "sha512-BtizvGtFQKGPUcTy56o3nk1bGRp4SZOTYrDtGNlqCQufptV5IkkLN6Emw+yunAJjzf+C9FQFtvq7IoA3+oMYHQ==", - "requires": { - "regenerate": "^1.4.0", - "regenerate-unicode-properties": "^8.0.2", - "regjsgen": "^0.5.0", - "regjsparser": "^0.6.0", - "unicode-match-property-ecmascript": "^1.0.4", - "unicode-match-property-value-ecmascript": "^1.1.0" - } - }, - "regjsgen": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.5.0.tgz", - "integrity": "sha512-RnIrLhrXCX5ow/E5/Mh2O4e/oa1/jW0eaBKTSy3LaCj+M3Bqvm97GWDp2yUtzIs4LEn65zR2yiYGFqb2ApnzDA==" - }, - "regjsparser": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.0.tgz", - "integrity": "sha512-RQ7YyokLiQBomUJuUG8iGVvkgOLxwyZM8k6d3q5SAXpg4r5TZJZigKFvC6PpD+qQ98bCDC5YelPeA3EucDoNeQ==", - "requires": { - "jsesc": "~0.5.0" - } - } + "@babel/helper-regex": "^7.4.3", + "regexpu-core": "^4.5.4" } }, "@babel/plugin-transform-duplicate-keys": { @@ -564,17 +482,17 @@ } }, "@babel/plugin-transform-for-of": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.2.0.tgz", - "integrity": "sha512-Kz7Mt0SsV2tQk6jG5bBv5phVbkd0gd27SgYD4hH1aLMJRchM0dzHaXvrWhVZ+WxAlDoAKZ7Uy3jVTW2mKXQ1WQ==", + "version": "7.4.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.4.3.tgz", + "integrity": "sha512-UselcZPwVWNSURnqcfpnxtMehrb8wjXYOimlYQPBnup/Zld426YzIhNEvuRsEWVHfESIECGrxoI6L5QqzuLH5Q==", "requires": { "@babel/helper-plugin-utils": "^7.0.0" } }, "@babel/plugin-transform-function-name": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.2.0.tgz", - "integrity": "sha512-kWgksow9lHdvBC2Z4mxTsvc7YdY7w/V6B2vy9cTIPtLEE9NhwoWivaxdNM/S37elu5bqlLP/qOY906LukO9lkQ==", + "version": "7.4.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.4.3.tgz", + "integrity": "sha512-uT5J/3qI/8vACBR9I1GlAuU/JqBtWdfCrynuOkrWG6nCDieZd5przB1vfP59FRHBZQ9DC2IUfqr/xKqzOD5x0A==", "requires": { "@babel/helper-function-name": "^7.1.0", "@babel/helper-plugin-utils": "^7.0.0" @@ -588,6 +506,14 @@ "@babel/helper-plugin-utils": "^7.0.0" } }, + "@babel/plugin-transform-member-expression-literals": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.2.0.tgz", + "integrity": "sha512-HiU3zKkSU6scTidmnFJ0bMX8hz5ixC93b4MHMiYebmk2lUVNGOboPsqQvx5LzooihijUoLR/v7Nc1rbBtnc7FA==", + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, "@babel/plugin-transform-modules-amd": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.2.0.tgz", @@ -598,21 +524,21 @@ } }, "@babel/plugin-transform-modules-commonjs": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.2.0.tgz", - "integrity": "sha512-V6y0uaUQrQPXUrmj+hgnks8va2L0zcZymeU7TtWEgdRLNkceafKXEduv7QzgQAE4lT+suwooG9dC7LFhdRAbVQ==", + "version": "7.4.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.4.3.tgz", + "integrity": "sha512-sMP4JqOTbMJMimqsSZwYWsMjppD+KRyDIUVW91pd7td0dZKAvPmhCaxhOzkzLParKwgQc7bdL9UNv+rpJB0HfA==", "requires": { - "@babel/helper-module-transforms": "^7.1.0", + "@babel/helper-module-transforms": "^7.4.3", "@babel/helper-plugin-utils": "^7.0.0", "@babel/helper-simple-access": "^7.1.0" } }, "@babel/plugin-transform-modules-systemjs": { - "version": "7.3.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.3.4.tgz", - "integrity": "sha512-VZ4+jlGOF36S7TjKs8g4ojp4MEI+ebCQZdswWb/T9I4X84j8OtFAyjXjt/M16iIm5RIZn0UMQgg/VgIwo/87vw==", + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.4.0.tgz", + "integrity": "sha512-gjPdHmqiNhVoBqus5qK60mWPp1CmYWp/tkh11mvb0rrys01HycEGD7NvvSoKXlWEfSM9TcL36CpsK8ElsADptQ==", "requires": { - "@babel/helper-hoist-variables": "^7.0.0", + "@babel/helper-hoist-variables": "^7.4.0", "@babel/helper-plugin-utils": "^7.0.0" } }, @@ -626,17 +552,17 @@ } }, "@babel/plugin-transform-named-capturing-groups-regex": { - "version": "7.3.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.3.0.tgz", - "integrity": "sha512-NxIoNVhk9ZxS+9lSoAQ/LM0V2UEvARLttEHUrRDGKFaAxOYQcrkN/nLRE+BbbicCAvZPl7wMP0X60HsHE5DtQw==", + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.4.2.tgz", + "integrity": "sha512-NsAuliSwkL3WO2dzWTOL1oZJHm0TM8ZY8ZSxk2ANyKkt5SQlToGA4pzctmq1BEjoacurdwZ3xp2dCQWJkME0gQ==", "requires": { "regexp-tree": "^0.1.0" } }, "@babel/plugin-transform-new-target": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.0.0.tgz", - "integrity": "sha512-yin069FYjah+LbqfGeTfzIBODex/e++Yfa0rH0fpfam9uTbuEeEOx5GLGr210ggOV77mVRNoeqSYqeuaqSzVSw==", + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.4.0.tgz", + "integrity": "sha512-6ZKNgMQmQmrEX/ncuCwnnw1yVGoaOW5KpxNhoWI7pCQdA0uZ0HqHGqenCUIENAnxRjy2WwNQ30gfGdIgqJXXqw==", "requires": { "@babel/helper-plugin-utils": "^7.0.0" } @@ -651,37 +577,43 @@ } }, "@babel/plugin-transform-parameters": { - "version": "7.3.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.3.3.tgz", - "integrity": "sha512-IrIP25VvXWu/VlBWTpsjGptpomtIkYrN/3aDp4UKm7xK6UxZY88kcJ1UwETbzHAlwN21MnNfwlar0u8y3KpiXw==", + "version": "7.4.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.4.3.tgz", + "integrity": "sha512-ULJYC2Vnw96/zdotCZkMGr2QVfKpIT/4/K+xWWY0MbOJyMZuk660BGkr3bEKWQrrciwz6xpmft39nA4BF7hJuA==", "requires": { - "@babel/helper-call-delegate": "^7.1.0", + "@babel/helper-call-delegate": "^7.4.0", "@babel/helper-get-function-arity": "^7.0.0", "@babel/helper-plugin-utils": "^7.0.0" } }, + "@babel/plugin-transform-property-literals": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.2.0.tgz", + "integrity": "sha512-9q7Dbk4RhgcLp8ebduOpCbtjh7C0itoLYHXd9ueASKAG/is5PQtMR5VJGka9NKqGhYEGn5ITahd4h9QeBMylWQ==", + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, "@babel/plugin-transform-regenerator": { - "version": "7.3.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.3.4.tgz", - "integrity": "sha512-hvJg8EReQvXT6G9H2MvNPXkv9zK36Vxa1+csAVTpE1J3j0zlHplw76uudEbJxgvqZzAq9Yh45FLD4pk5mKRFQA==", + "version": "7.4.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.4.3.tgz", + "integrity": "sha512-kEzotPuOpv6/iSlHroCDydPkKYw7tiJGKlmYp6iJn4a6C/+b2FdttlJsLKYxolYHgotTJ5G5UY5h0qey5ka3+A==", "requires": { "regenerator-transform": "^0.13.4" - }, - "dependencies": { - "regenerator-transform": { - "version": "0.13.4", - "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.13.4.tgz", - "integrity": "sha512-T0QMBjK3J0MtxjPmdIMXm72Wvj2Abb0Bd4HADdfijwMdoIsyQZ6fWC7kDFhk2YinBBEMZDL7Y7wh0J1sGx3S4A==", - "requires": { - "private": "^0.1.6" - } - } + } + }, + "@babel/plugin-transform-reserved-words": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.2.0.tgz", + "integrity": "sha512-fz43fqW8E1tAB3DKF19/vxbpib1fuyCwSPE418ge5ZxILnBhWyhtPgz8eh1RCGGJlwvksHkyxMxh0eenFi+kFw==", + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" } }, "@babel/plugin-transform-runtime": { - "version": "7.3.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.3.4.tgz", - "integrity": "sha512-PaoARuztAdd5MgeVjAxnIDAIUet5KpogqaefQvPOmPYCxYoaPhautxDh3aO8a4xHsKgT/b9gSxR0BKK1MIewPA==", + "version": "7.4.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.4.3.tgz", + "integrity": "sha512-7Q61bU+uEI7bCUFReT1NKn7/X6sDQsZ7wL1sJ9IYMAO7cI+eg6x9re1cEw2fCRMbbTVyoeUKWSV1M6azEfKCfg==", "requires": { "@babel/helper-module-imports": "^7.0.0", "@babel/helper-plugin-utils": "^7.0.0", @@ -732,162 +664,99 @@ } }, "@babel/plugin-transform-unicode-regex": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.2.0.tgz", - "integrity": "sha512-m48Y0lMhrbXEJnVUaYly29jRXbQ3ksxPrS1Tg8t+MHqzXhtBYAvI51euOBaoAlZLPHsieY9XPVMf80a5x0cPcA==", + "version": "7.4.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.4.3.tgz", + "integrity": "sha512-lnSNgkVjL8EMtnE8eSS7t2ku8qvKH3eqNf/IwIfnSPUqzgqYmRwzdsQWv4mNQAN9Nuo6Gz1Y0a4CSmdpu1Pp6g==", "requires": { "@babel/helper-plugin-utils": "^7.0.0", - "@babel/helper-regex": "^7.0.0", - "regexpu-core": "^4.1.3" - }, - "dependencies": { - "jsesc": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", - "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=" - }, - "regexpu-core": { - "version": "4.5.4", - "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.5.4.tgz", - "integrity": "sha512-BtizvGtFQKGPUcTy56o3nk1bGRp4SZOTYrDtGNlqCQufptV5IkkLN6Emw+yunAJjzf+C9FQFtvq7IoA3+oMYHQ==", - "requires": { - "regenerate": "^1.4.0", - "regenerate-unicode-properties": "^8.0.2", - "regjsgen": "^0.5.0", - "regjsparser": "^0.6.0", - "unicode-match-property-ecmascript": "^1.0.4", - "unicode-match-property-value-ecmascript": "^1.1.0" - } - }, - "regjsgen": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.5.0.tgz", - "integrity": "sha512-RnIrLhrXCX5ow/E5/Mh2O4e/oa1/jW0eaBKTSy3LaCj+M3Bqvm97GWDp2yUtzIs4LEn65zR2yiYGFqb2ApnzDA==" - }, - "regjsparser": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.0.tgz", - "integrity": "sha512-RQ7YyokLiQBomUJuUG8iGVvkgOLxwyZM8k6d3q5SAXpg4r5TZJZigKFvC6PpD+qQ98bCDC5YelPeA3EucDoNeQ==", - "requires": { - "jsesc": "~0.5.0" - } - } - } - }, - "@babel/polyfill": { - "version": "7.2.5", - "resolved": "https://registry.npmjs.org/@babel/polyfill/-/polyfill-7.2.5.tgz", - "integrity": "sha512-8Y/t3MWThtMLYr0YNC/Q76tqN1w30+b0uQMeFUYauG2UGTR19zyUtFrAzT23zNtBxPp+LbE5E/nwV/q/r3y6ug==", - "requires": { - "core-js": "^2.5.7", - "regenerator-runtime": "^0.12.0" - }, - "dependencies": { - "regenerator-runtime": { - "version": "0.12.1", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.12.1.tgz", - "integrity": "sha512-odxIc1/vDlo4iZcfXqRYFj0vpXFNoGdKMAUieAlFYO6m/nl5e9KR/beGf41z4a1FI+aQgtjhuaSlDxQ0hmkrHg==" - } + "@babel/helper-regex": "^7.4.3", + "regexpu-core": "^4.5.4" } }, "@babel/preset-env": { - "version": "7.3.4", - "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.3.4.tgz", - "integrity": "sha512-2mwqfYMK8weA0g0uBKOt4FE3iEodiHy9/CW0b+nWXcbL+pGzLx8ESYc+j9IIxr6LTDHWKgPm71i9smo02bw+gA==", + "version": "7.4.3", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.4.3.tgz", + "integrity": "sha512-FYbZdV12yHdJU5Z70cEg0f6lvtpZ8jFSDakTm7WXeJbLXh4R0ztGEu/SW7G1nJ2ZvKwDhz8YrbA84eYyprmGqw==", "requires": { "@babel/helper-module-imports": "^7.0.0", "@babel/helper-plugin-utils": "^7.0.0", "@babel/plugin-proposal-async-generator-functions": "^7.2.0", "@babel/plugin-proposal-json-strings": "^7.2.0", - "@babel/plugin-proposal-object-rest-spread": "^7.3.4", + "@babel/plugin-proposal-object-rest-spread": "^7.4.3", "@babel/plugin-proposal-optional-catch-binding": "^7.2.0", - "@babel/plugin-proposal-unicode-property-regex": "^7.2.0", + "@babel/plugin-proposal-unicode-property-regex": "^7.4.0", "@babel/plugin-syntax-async-generators": "^7.2.0", "@babel/plugin-syntax-json-strings": "^7.2.0", "@babel/plugin-syntax-object-rest-spread": "^7.2.0", "@babel/plugin-syntax-optional-catch-binding": "^7.2.0", "@babel/plugin-transform-arrow-functions": "^7.2.0", - "@babel/plugin-transform-async-to-generator": "^7.3.4", + "@babel/plugin-transform-async-to-generator": "^7.4.0", "@babel/plugin-transform-block-scoped-functions": "^7.2.0", - "@babel/plugin-transform-block-scoping": "^7.3.4", - "@babel/plugin-transform-classes": "^7.3.4", + "@babel/plugin-transform-block-scoping": "^7.4.0", + "@babel/plugin-transform-classes": "^7.4.3", "@babel/plugin-transform-computed-properties": "^7.2.0", - "@babel/plugin-transform-destructuring": "^7.2.0", - "@babel/plugin-transform-dotall-regex": "^7.2.0", + "@babel/plugin-transform-destructuring": "^7.4.3", + "@babel/plugin-transform-dotall-regex": "^7.4.3", "@babel/plugin-transform-duplicate-keys": "^7.2.0", "@babel/plugin-transform-exponentiation-operator": "^7.2.0", - "@babel/plugin-transform-for-of": "^7.2.0", - "@babel/plugin-transform-function-name": "^7.2.0", + "@babel/plugin-transform-for-of": "^7.4.3", + "@babel/plugin-transform-function-name": "^7.4.3", "@babel/plugin-transform-literals": "^7.2.0", + "@babel/plugin-transform-member-expression-literals": "^7.2.0", "@babel/plugin-transform-modules-amd": "^7.2.0", - "@babel/plugin-transform-modules-commonjs": "^7.2.0", - "@babel/plugin-transform-modules-systemjs": "^7.3.4", + "@babel/plugin-transform-modules-commonjs": "^7.4.3", + "@babel/plugin-transform-modules-systemjs": "^7.4.0", "@babel/plugin-transform-modules-umd": "^7.2.0", - "@babel/plugin-transform-named-capturing-groups-regex": "^7.3.0", - "@babel/plugin-transform-new-target": "^7.0.0", + "@babel/plugin-transform-named-capturing-groups-regex": "^7.4.2", + "@babel/plugin-transform-new-target": "^7.4.0", "@babel/plugin-transform-object-super": "^7.2.0", - "@babel/plugin-transform-parameters": "^7.2.0", - "@babel/plugin-transform-regenerator": "^7.3.4", + "@babel/plugin-transform-parameters": "^7.4.3", + "@babel/plugin-transform-property-literals": "^7.2.0", + "@babel/plugin-transform-regenerator": "^7.4.3", + "@babel/plugin-transform-reserved-words": "^7.2.0", "@babel/plugin-transform-shorthand-properties": "^7.2.0", "@babel/plugin-transform-spread": "^7.2.0", "@babel/plugin-transform-sticky-regex": "^7.2.0", "@babel/plugin-transform-template-literals": "^7.2.0", "@babel/plugin-transform-typeof-symbol": "^7.2.0", - "@babel/plugin-transform-unicode-regex": "^7.2.0", - "browserslist": "^4.3.4", + "@babel/plugin-transform-unicode-regex": "^7.4.3", + "@babel/types": "^7.4.0", + "browserslist": "^4.5.2", + "core-js-compat": "^3.0.0", "invariant": "^2.2.2", "js-levenshtein": "^1.1.3", - "semver": "^5.3.0" - }, - "dependencies": { - "browserslist": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.4.2.tgz", - "integrity": "sha512-ISS/AIAiHERJ3d45Fz0AVYKkgcy+F/eJHzKEvv1j0wwKGKD9T3BrwKr/5g45L+Y4XIK5PlTqefHciRFcfE1Jxg==", - "requires": { - "caniuse-lite": "^1.0.30000939", - "electron-to-chromium": "^1.3.113", - "node-releases": "^1.1.8" - } - } + "semver": "^5.5.0" } }, "@babel/runtime": { - "version": "7.3.4", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.3.4.tgz", - "integrity": "sha512-IvfvnMdSaLBateu0jfsYIpZTxAc2cKEXEMiezGGN75QcBcecDUKd3PgLAncT0oOgxKy8dd8hrJKj9MfzgfZd6g==", + "version": "7.4.3", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.4.3.tgz", + "integrity": "sha512-9lsJwJLxDh/T3Q3SZszfWOTkk3pHbkmH+3KY+zwIDmsNlxsumuhS2TH3NIpktU4kNvfzy+k3eLT7aTJSPTo0OA==", "requires": { - "regenerator-runtime": "^0.12.0" - }, - "dependencies": { - "regenerator-runtime": { - "version": "0.12.1", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.12.1.tgz", - "integrity": "sha512-odxIc1/vDlo4iZcfXqRYFj0vpXFNoGdKMAUieAlFYO6m/nl5e9KR/beGf41z4a1FI+aQgtjhuaSlDxQ0hmkrHg==" - } + "regenerator-runtime": "^0.13.2" } }, "@babel/template": { - "version": "7.2.2", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.2.2.tgz", - "integrity": "sha512-zRL0IMM02AUDwghf5LMSSDEz7sBCO2YnNmpg3uWTZj/v1rcG2BmQUvaGU8GhU8BvfMh1k2KIAYZ7Ji9KXPUg7g==", + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.4.0.tgz", + "integrity": "sha512-SOWwxxClTTh5NdbbYZ0BmaBVzxzTh2tO/TeLTbF6MO6EzVhHTnff8CdBXx3mEtazFBoysmEM6GU/wF+SuSx4Fw==", "requires": { "@babel/code-frame": "^7.0.0", - "@babel/parser": "^7.2.2", - "@babel/types": "^7.2.2" + "@babel/parser": "^7.4.0", + "@babel/types": "^7.4.0" } }, "@babel/traverse": { - "version": "7.3.4", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.3.4.tgz", - "integrity": "sha512-TvTHKp6471OYEcE/91uWmhR6PrrYywQntCHSaZ8CM8Vmp+pjAusal4nGB2WCCQd0rvI7nOMKn9GnbcvTUz3/ZQ==", + "version": "7.4.3", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.4.3.tgz", + "integrity": "sha512-HmA01qrtaCwwJWpSKpA948cBvU5BrmviAief/b3AVw936DtcdsTexlbyzNuDnthwhOQ37xshn7hvQaEQk7ISYQ==", "requires": { "@babel/code-frame": "^7.0.0", - "@babel/generator": "^7.3.4", + "@babel/generator": "^7.4.0", "@babel/helper-function-name": "^7.1.0", - "@babel/helper-split-export-declaration": "^7.0.0", - "@babel/parser": "^7.3.4", - "@babel/types": "^7.3.4", + "@babel/helper-split-export-declaration": "^7.4.0", + "@babel/parser": "^7.4.3", + "@babel/types": "^7.4.0", "debug": "^4.1.0", "globals": "^11.1.0", "lodash": "^4.17.11" @@ -904,9 +773,9 @@ } }, "@babel/types": { - "version": "7.3.4", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.3.4.tgz", - "integrity": "sha512-WEkp8MsLftM7O/ty580wAmZzN1nDmCACc5+jFzUt+GUFNNIi3LdRlueYz0YIlmJhlZx1QYDMZL5vdWCL0fNjFQ==", + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.4.0.tgz", + "integrity": "sha512-aPvkXyU2SPOnztlgo8n9cEiXW755mgyvueUPcpStqdzoSPm0fjO0vQBjLkt3JKJW7ufikfcnMTTPsN1xaTsBPA==", "requires": { "esutils": "^2.0.2", "lodash": "^4.17.11", @@ -980,108 +849,125 @@ "integrity": "sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw==" }, "@nuxt/babel-preset-app": { - "version": "2.4.5", - "resolved": "https://registry.npmjs.org/@nuxt/babel-preset-app/-/babel-preset-app-2.4.5.tgz", - "integrity": "sha512-Pfpp9++AjTLSvr0EQY00SPacSxw6nvIgARVTiFG8xEkqzUzChx1xz424u4e8mKhu3qEgj9ldcF5iKC5A87RYkw==", + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/@nuxt/babel-preset-app/-/babel-preset-app-2.6.1.tgz", + "integrity": "sha512-cRHeg4oQSKTjgJph8od5frNVSGCAGfEFerDC5ZX0xqthGfeWE8a0pL00w5Y1R33zYDQlEkNk5u4y/Xfipz2JgA==", "requires": { - "@babel/core": "^7.2.2", - "@babel/plugin-proposal-class-properties": "^7.3.0", - "@babel/plugin-proposal-decorators": "^7.3.0", + "@babel/core": "^7.4.3", + "@babel/plugin-proposal-class-properties": "^7.4.0", + "@babel/plugin-proposal-decorators": "^7.4.0", "@babel/plugin-syntax-dynamic-import": "^7.2.0", - "@babel/plugin-transform-runtime": "^7.2.0", - "@babel/preset-env": "^7.3.1", - "@babel/runtime": "^7.3.1", - "@vue/babel-preset-jsx": "^1.0.0-beta.2" + "@babel/plugin-transform-runtime": "^7.4.3", + "@babel/preset-env": "^7.4.3", + "@babel/runtime": "^7.4.3", + "@vue/babel-preset-jsx": "^1.0.0-beta.3", + "core-js": "^2.6.5" } }, "@nuxt/builder": { - "version": "2.4.5", - "resolved": "https://registry.npmjs.org/@nuxt/builder/-/builder-2.4.5.tgz", - "integrity": "sha512-WPgNmDK7UgInCNECl13u6tJ9woC8c1ToPXgEfqL0pTZWlztqOyGXMcXaQnI0n1QKsqQPWFUfNAtztAum7xZLpw==", - "requires": { - "@nuxt/devalue": "^1.2.0", - "@nuxt/utils": "2.4.5", - "@nuxt/vue-app": "2.4.5", - "chokidar": "^2.0.4", - "consola": "^2.3.2", + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/@nuxt/builder/-/builder-2.6.1.tgz", + "integrity": "sha512-NvoBx6+8p91fxYEQ7AUO1nEbDPYIVQ4LVlXXgiR9N3Jrl92AE6LtER6uMs1K2z9FdkMnEDbYaCnczU/0xYaJTg==", + "requires": { + "@nuxt/devalue": "^1.2.2", + "@nuxt/utils": "2.6.1", + "@nuxt/vue-app": "2.6.1", + "chokidar": "^2.1.5", + "consola": "^2.5.8", "fs-extra": "^7.0.1", "glob": "^7.1.3", "hash-sum": "^1.0.2", + "ignore": "^5.0.6", "lodash": "^4.17.11", "pify": "^4.0.1", - "semver": "^5.6.0", + "semver": "^6.0.0", "serialize-javascript": "^1.6.1", - "upath": "^1.1.0" + "upath": "^1.1.2" }, "dependencies": { + "ignore": { + "version": "5.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.0.6.tgz", + "integrity": "sha512-/+hp3kUf/Csa32ktIaj0OlRqQxrgs30n62M90UBpNd9k+ENEch5S+hmbW3DtcJGz3sYFTh4F3A6fQ0q7KWsp4w==" + }, "pify": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==" + }, + "semver": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.0.0.tgz", + "integrity": "sha512-0UewU+9rFapKFnlbirLi3byoOuhrSsli/z/ihNnvM24vgF+8sNBiI1LZPBSH9wJKUwaUbw+s3hToDLCXkrghrQ==" } } }, "@nuxt/cli": { - "version": "2.4.5", - "resolved": "https://registry.npmjs.org/@nuxt/cli/-/cli-2.4.5.tgz", - "integrity": "sha512-mBrh8sZySEx4v6IqAgdq9aPY6JKl0m3BREt90anV8w+63YMmNHRFizGdWyEgq/6YUrCvuCua2RvJCZphBdnhFQ==", + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/@nuxt/cli/-/cli-2.6.1.tgz", + "integrity": "sha512-Cy77LeVmXz9g7LJIU2pOVbKsKy6Alxl55gKLMqsrs8AmyqNa5Eu2aDuAP5uqoOUcrw46T6Szv0qW0yzcwW13Nw==", "requires": { - "@nuxt/config": "2.4.5", + "@nuxt/config": "2.6.1", + "@nuxt/utils": "2.6.1", "boxen": "^3.0.0", "chalk": "^2.4.2", - "consola": "^2.3.2", - "esm": "^3.2.3", + "consola": "^2.5.8", + "esm": "3.2.20", "execa": "^1.0.0", "exit": "^0.1.2", + "fs-extra": "^7.0.1", "minimist": "^1.2.0", + "opener": "1.5.1", "pretty-bytes": "^5.1.0", "std-env": "^2.2.1", - "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=", + "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": { - "ansi-regex": "^3.0.0" + "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" } } } }, "@nuxt/config": { - "version": "2.4.5", - "resolved": "https://registry.npmjs.org/@nuxt/config/-/config-2.4.5.tgz", - "integrity": "sha512-Yn1FqOVG7Si+clikYg5ILAxDWfTlweKULzZDtAZriWjQPg0D2sJ9VWV+mdggPQfyn+n4mvPvD4BEIyzvKVaXdg==", + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/@nuxt/config/-/config-2.6.1.tgz", + "integrity": "sha512-BIkT9ma6zQ1X/TY8F6hUWBEuJ6ie70VIF/5qjuIaTXEETNQEMSRIugO2mh6pTGCX8gEm2x6Yj91gL0uqF0pjQQ==", "requires": { - "@nuxt/utils": "2.4.5", - "consola": "^2.3.2", + "@nuxt/utils": "2.6.1", + "consola": "^2.5.8", "std-env": "^2.2.1" } }, "@nuxt/core": { - "version": "2.4.5", - "resolved": "https://registry.npmjs.org/@nuxt/core/-/core-2.4.5.tgz", - "integrity": "sha512-2hjyLRLmLMkG+9e1bhLmeU+ow4Ph5lPrArW8BPBNohO4Oxjzb/A3UUO6UhMMA24/9+qsBQT6rwsQ0WA66UCpJA==", - "requires": { - "@nuxt/config": "2.4.5", - "@nuxt/devalue": "^1.2.0", - "@nuxt/server": "2.4.5", - "@nuxt/utils": "2.4.5", - "@nuxt/vue-renderer": "2.4.5", - "consola": "^2.3.2", + "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", "debug": "^4.1.1", - "esm": "^3.2.3", + "esm": "3.2.20", "fs-extra": "^7.0.1", "hash-sum": "^1.0.2", "std-env": "^2.2.1" @@ -1098,9 +984,9 @@ } }, "@nuxt/devalue": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@nuxt/devalue/-/devalue-1.2.1.tgz", - "integrity": "sha512-lNhY8yo9rc/FME52sUyQcs07wjTQ4QS8geFgBI5R/Zg60rq7CruG54qi5Za1m+mVvrJvhW24Jyu0Sq3lwfe3cg==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@nuxt/devalue/-/devalue-1.2.2.tgz", + "integrity": "sha512-T3S20YKOG0bzhvFRuGWqXLjqnwTczvRns5BgzHKRosijWHjl6tOpWCIr+2PFC5YQ3gTE4c5ZOLG5wOEcMLvn1w==", "requires": { "consola": "^2.5.6" } @@ -1117,21 +1003,42 @@ } }, "@nuxt/generator": { - "version": "2.4.5", - "resolved": "https://registry.npmjs.org/@nuxt/generator/-/generator-2.4.5.tgz", - "integrity": "sha512-DUi8BnoGiuBN1jVe3J8QZNR68IvD/xhE6fX3vgcBylaeKTL5kC7h+CBnQ2w30bFQpsdmjWcaitTzdklvrm44Tg==", + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/@nuxt/generator/-/generator-2.6.1.tgz", + "integrity": "sha512-F+SfHdUv/EBLcHOb8YTvVrtPbggdJ/4n28RWbML4O3kQqDATw9NT1rW5TznFFNCARa6IJqrKNFcE/zeYee4eBg==", "requires": { - "@nuxt/utils": "2.4.5", + "@nuxt/utils": "2.6.1", "chalk": "^2.4.2", - "consola": "^2.3.2", + "consola": "^2.5.8", "fs-extra": "^7.0.1", - "html-minifier": "^3.5.21" + "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==", + "requires": { + "connect": "^3.6.6", + "fs-extra": "^7.0.1", + "serve-static": "^1.13.2", + "ws": "^6.2.0" + }, + "dependencies": { + "ws": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.1.tgz", + "integrity": "sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA==", + "requires": { + "async-limiter": "~1.0.0" + } + } } }, "@nuxt/opencollective": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/@nuxt/opencollective/-/opencollective-0.2.1.tgz", - "integrity": "sha512-NP2VSUKRFGutbhWeKgIU0MnY4fmpH8UWxxwTJNPurCQ5BeWhOxp+Gp5ltO39P/Et/J2GYGb3+ALNqZJ+5cGBBw==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@nuxt/opencollective/-/opencollective-0.2.2.tgz", + "integrity": "sha512-ie50SpS47L+0gLsW4yP23zI/PtjsDRglyozX2G09jeiUazC1AJlGPZo0JUs9iuCDUoIgsDEf66y7/bSfig0BpA==", "requires": { "chalk": "^2.4.1", "consola": "^2.3.0", @@ -1139,26 +1046,26 @@ } }, "@nuxt/server": { - "version": "2.4.5", - "resolved": "https://registry.npmjs.org/@nuxt/server/-/server-2.4.5.tgz", - "integrity": "sha512-bJAA53xS5JV80mGjVcZRffU2FA/qL6diLyMAykO9MdTB8OOo6onLssWXH0Rl/89uWfs+z4iVXUpZsv9nMdhL0w==", + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/@nuxt/server/-/server-2.6.1.tgz", + "integrity": "sha512-jiCHS6TU0yZVm5TwCWQPi/nm7nVI4i4CRm2mTc+IP0Lesr6aOSi/oyaiFoDF2an163v3mIQU0JuDgnSX8zkuVw==", "requires": { - "@nuxt/config": "2.4.5", - "@nuxt/utils": "2.4.5", + "@nuxt/config": "2.6.1", + "@nuxt/utils": "2.6.1", "@nuxtjs/youch": "^4.2.3", "chalk": "^2.4.2", - "compression": "^1.7.3", + "compression": "^1.7.4", "connect": "^3.6.6", - "consola": "^2.3.2", + "consola": "^2.5.8", "etag": "^1.8.1", "fresh": "^0.5.2", "fs-extra": "^7.0.1", "ip": "^1.1.5", "launch-editor-middleware": "^2.2.1", - "on-headers": "^1.0.1", + "on-headers": "^1.0.2", "pify": "^4.0.1", - "semver": "^5.6.0", - "serve-placeholder": "^1.1.1", + "semver": "^6.0.0", + "serve-placeholder": "^1.2.1", "serve-static": "^1.13.2", "server-destroy": "^1.0.1", "ua-parser-js": "^0.7.19" @@ -1168,44 +1075,55 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==" + }, + "semver": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.0.0.tgz", + "integrity": "sha512-0UewU+9rFapKFnlbirLi3byoOuhrSsli/z/ihNnvM24vgF+8sNBiI1LZPBSH9wJKUwaUbw+s3hToDLCXkrghrQ==" } } }, "@nuxt/utils": { - "version": "2.4.5", - "resolved": "https://registry.npmjs.org/@nuxt/utils/-/utils-2.4.5.tgz", - "integrity": "sha512-/FLBP1KFwBKIaq7ht7YBrhdHG9l1uSg2B3egZdVoVLbK+Uj10uZ+XeaU+IIpC4S+hLc1FY3WTjdCb2GHp91oIw==", + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/@nuxt/utils/-/utils-2.6.1.tgz", + "integrity": "sha512-lCCAa7E1tRHvXMDd37GXfV92edc0VPKye2Z5/res6uZ1dWORhSnYMqeszmnKjpNiEjTOpMW6lNOjKncrjc4PeQ==", "requires": { - "consola": "^2.3.2", - "serialize-javascript": "^1.6.1" + "consola": "^2.5.8", + "fs-extra": "^7.0.1", + "hash-sum": "^1.0.2", + "proper-lockfile": "^4.1.1", + "serialize-javascript": "^1.6.1", + "signal-exit": "^3.0.2" } }, "@nuxt/vue-app": { - "version": "2.4.5", - "resolved": "https://registry.npmjs.org/@nuxt/vue-app/-/vue-app-2.4.5.tgz", - "integrity": "sha512-dtcT7KDrZEAc3imCc+JEeJ4Lqgbf5ZfjKLXjzUCj3tk16OG7wR4H4bKcDLcHv63S+DTHuCaYOtzcHn44p6jTCQ==", + "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==", "requires": { - "vue": "^2.5.22", - "vue-meta": "^1.5.8", + "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-template-compiler": "^2.5.22", + "vue-template-compiler": "^2.6.10", "vuex": "^3.1.0" } }, "@nuxt/vue-renderer": { - "version": "2.4.5", - "resolved": "https://registry.npmjs.org/@nuxt/vue-renderer/-/vue-renderer-2.4.5.tgz", - "integrity": "sha512-NsS0ZHV/HEWAbzOBXiwbhcdb1KJFj8ucma+gnbfw/rIh5hgufqAxs4btt3U0ma/i3Bm0nQo+doZAWtl/HJX6mQ==", + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/@nuxt/vue-renderer/-/vue-renderer-2.6.1.tgz", + "integrity": "sha512-ioCXah0tL5laRAHtwV5iQ2tlRE97Z/dW/byiaVEUBdkxKFMsSZw12SD3d2zM67Tx8e8/LpVCKUTigLzBkZr9Gg==", "requires": { - "@nuxt/devalue": "^1.2.0", - "@nuxt/utils": "2.4.5", - "consola": "^2.3.2", + "@nuxt/devalue": "^1.2.2", + "@nuxt/utils": "2.6.1", + "consola": "^2.5.8", "fs-extra": "^7.0.1", "lru-cache": "^5.1.1", - "vue": "^2.5.22", - "vue-meta": "^1.5.8", - "vue-server-renderer": "^2.5.22" + "vue": "^2.6.10", + "vue-meta": "^1.6.0", + "vue-server-renderer": "^2.6.10" }, "dependencies": { "lru-cache": { @@ -1224,24 +1142,23 @@ } }, "@nuxt/webpack": { - "version": "2.4.5", - "resolved": "https://registry.npmjs.org/@nuxt/webpack/-/webpack-2.4.5.tgz", - "integrity": "sha512-UXC9Yw4PMIBDqGR9eB11G6v7YpahgJq4llz4ybDnWMVxOJR+yAOw5jD+8AGSBDDo/apSJ/LgzJX2TIOtopx+LA==", + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/@nuxt/webpack/-/webpack-2.6.1.tgz", + "integrity": "sha512-hvY/wXqGzlIdYveDDMeWluFW9drpiU0PujFQoIdeFW6r03RHKPr3nUVD6Hhs7y4PoT3ob+DWbdm0T1EvA74AIg==", "requires": { - "@babel/core": "^7.2.2", - "@babel/polyfill": "^7.2.5", - "@nuxt/babel-preset-app": "2.4.5", + "@babel/core": "^7.4.3", + "@nuxt/babel-preset-app": "2.6.1", "@nuxt/friendly-errors-webpack-plugin": "^2.4.0", - "@nuxt/utils": "2.4.5", + "@nuxt/utils": "2.6.1", "babel-loader": "^8.0.5", "cache-loader": "^2.0.1", - "caniuse-lite": "^1.0.30000932", + "caniuse-lite": "^1.0.30000957", "chalk": "^2.4.2", - "consola": "^2.3.2", - "css-loader": "^2.1.0", - "cssnano": "^4.1.8", + "consola": "^2.5.8", + "css-loader": "^2.1.1", + "cssnano": "^4.1.10", "eventsource-polyfill": "^0.9.6", - "extract-css-chunks-webpack-plugin": "^3.3.2", + "extract-css-chunks-webpack-plugin": "^4.3.0", "file-loader": "^3.0.1", "fs-extra": "^7.0.1", "glob": "^7.1.3", @@ -1253,20 +1170,20 @@ "pify": "^4.0.1", "postcss": "^7.0.14", "postcss-import": "^12.0.1", - "postcss-import-resolver": "^1.1.0", + "postcss-import-resolver": "^1.2.2", "postcss-loader": "^3.0.0", - "postcss-preset-env": "^6.5.0", + "postcss-preset-env": "^6.6.0", "postcss-url": "^8.0.0", "std-env": "^2.2.1", "style-resources-loader": "^1.2.1", - "terser-webpack-plugin": "^1.2.2", + "terser-webpack-plugin": "^1.2.3", "thread-loader": "^1.2.0", "time-fix-plugin": "^2.0.5", "url-loader": "^1.1.2", - "vue-loader": "^15.6.2", - "webpack": "^4.29.2", - "webpack-bundle-analyzer": "^3.0.3", - "webpack-dev-middleware": "^3.5.1", + "vue-loader": "^15.7.0", + "webpack": "^4.29.6", + "webpack-bundle-analyzer": "^3.1.0", + "webpack-dev-middleware": "^3.6.2", "webpack-hot-middleware": "^2.24.3", "webpack-node-externals": "^1.7.2", "webpackbar": "^3.1.5" @@ -1291,7 +1208,7 @@ }, "@rush-temp/cert": { "version": "file:projects/cert.tgz", - "integrity": "sha512-15OLIEcaz1QJB3fERoy3AALLAuiIlRn5TvGuViflA8QjJHrgFZychoJIIN1ipwss3zxDO9TR8nX+Mm3ZiUYZ4g==", + "integrity": "sha512-OKNUc8I2dnqc7UxnWysVQUOdqX/HzcP2tg+IEt8Y8kTLeQbKZVOD3JnhHAaOl9v8LupjiTj6VQOSDolDxCkMsA==", "requires": { "@hayspec/cli": "^0.8.3", "@hayspec/spec": "^0.8.3", @@ -1303,7 +1220,7 @@ }, "@rush-temp/conventions": { "version": "file:projects/conventions.tgz", - "integrity": "sha512-XetH6D3QUT8JJUeyK91xOOvIRCjp3zChKAaaHnLT8gFa5h90VdR4Uy+U5EJ8UsP2nXQ/QzkammHBepz60Eh/Ag==", + "integrity": "sha512-OvFrinqbTJAsSCSzZ0YLeoPwEwMUmDEPs1WzKmBewaNhuczotuVVybnNJd/Tb+6DmpCqx3A3wc0xIh9HR79EjA==", "requires": { "@hayspec/cli": "^0.8.3", "@hayspec/spec": "^0.8.3", @@ -1315,9 +1232,8 @@ }, "@rush-temp/ethereum-asset-ledger": { "version": "file:projects/ethereum-asset-ledger.tgz", - "integrity": "sha512-qrOAfhLgNNdK+G3IKj7fUOPgAszu+lGQqUHzHdnmL0LdYA1WzdGIWzAACMbZJjGk/6XDyqatWSDZnhoLEXL48Q==", + "integrity": "sha512-stGi4YLKmmeG5n4KZmTSZlsKxIYOd0l/LuH5KgI9Nues/KzB35+yoclzNdT+aGAPfGZCaLIOVp9QFDa46dzVQg==", "requires": { - "@0xcert/ethereum-utils": "1.2.0", "@specron/cli": "^0.5.6", "@specron/spec": "^0.5.6", "nyc": "^13.1.0", @@ -1330,7 +1246,7 @@ }, "@rush-temp/ethereum-erc20-contracts": { "version": "file:projects/ethereum-erc20-contracts.tgz", - "integrity": "sha512-U31ksI4JKXn99ZcA0AriCh4lWwFyE6f4Fc3fFt5rQO6BqAEtPmePc/XTAFblYntuPN2vnwRl5dFkdpxPvd+6og==", + "integrity": "sha512-i9Y3m8y3GvO7XevcqTJC7fQCXW9sWmKUTLkAl93rsTU22rs3Y6uucXnah/36Bnv33cstQJSkmYJ4iXuB18xVEA==", "requires": { "@specron/cli": "^0.5.6", "@specron/spec": "^0.5.6", @@ -1344,7 +1260,7 @@ }, "@rush-temp/ethereum-erc721-contracts": { "version": "file:projects/ethereum-erc721-contracts.tgz", - "integrity": "sha512-+7QCGjQNENTPIWT34nbY9P2G0QTxQU1b8GqEE3A96yLCB31lFQBZH4fsrQKJ/oCKGKeDT6S1s+kvJREbcOToAA==", + "integrity": "sha512-bkylQ0TaThLOnf7LDOXTQfnKCCX8EkVaApnTy1wru+WL8OfzsCaMD3HksN8ISRE3XjyG6by4E4RwkcDmpA4cAA==", "requires": { "@specron/cli": "^0.5.6", "@specron/spec": "^0.5.6", @@ -1358,9 +1274,8 @@ }, "@rush-temp/ethereum-generic-provider": { "version": "file:projects/ethereum-generic-provider.tgz", - "integrity": "sha512-9ybHPozZ4C1oaZsdg66QDQhXO9ObScPrsJzSjrSJpmusrLtN+SRjKG7eXFPyqdWJTxzLJAjmQNNX8ZNoxh7Ulw==", + "integrity": "sha512-sr483sf8Va5PUXJMoGRWM8zUXSBLKkdJhhK0AP3dbdxZHyPtiLmSJtYofNGK5AI7kr3q1Tv5/JJgzVN7ZPuqzg==", "requires": { - "@0xcert/ethereum-utils": "1.2.0", "@specron/cli": "^0.5.6", "@specron/spec": "^0.5.6", "@types/node": "^10.12.24", @@ -1376,7 +1291,7 @@ }, "@rush-temp/ethereum-http-provider": { "version": "file:projects/ethereum-http-provider.tgz", - "integrity": "sha512-zSQKQlbN+uPTIaBuYpWRNF0skVRHOS/+pMAx2wmixFDegPcXhgcNAlRU1g1j9zRiI36xv+9DAzpscBulC30oOQ==", + "integrity": "sha512-mph46Auz2eeguHYIKzzTNfLHvqD5InazMY68BH+2Vo7djzJH2WTblYJI+P2Li3BTLvrYz7PD1C6KjBrAadsRMw==", "requires": { "@specron/cli": "^0.5.6", "@specron/spec": "^0.5.6", @@ -1390,7 +1305,7 @@ }, "@rush-temp/ethereum-metamask-provider": { "version": "file:projects/ethereum-metamask-provider.tgz", - "integrity": "sha512-64gpZveMWCVitsnsdD2WGxKhatpE+xqun4GWdOeco5Ypu2ODMmBoYMSmJJHBbalXLR1XWOmqLRYtyWWxnD2+iw==", + "integrity": "sha512-VIT7UjGQzIjJ1zNfIKihZ7zTRNR7lsJS5s8ogaw0dhEuacYQBM+RLEJz81lLUq4ueOcM7ejUxubQVNyAB3ZYRA==", "requires": { "@specron/cli": "^0.5.6", "@specron/spec": "^0.5.6", @@ -1404,9 +1319,8 @@ }, "@rush-temp/ethereum-order-gateway": { "version": "file:projects/ethereum-order-gateway.tgz", - "integrity": "sha512-oNyi1z9gMJBuQbq2CMhaco14g2pPBTyYZCsFuFT6guYBws25tx73uMB8E2HdSxBwnTNMn4zMWbW7PDrRf8HbrA==", + "integrity": "sha512-Tn/xDqx6/oY8ep9p9wrsJsniQAr6Tu6mt5YKHdanWk1AsK2VBXkrGw3IXWyVPRl39MAImiRBngBsFRmXd0yZog==", "requires": { - "@0xcert/ethereum-utils": "1.2.0", "@specron/cli": "^0.5.6", "@specron/spec": "^0.5.6", "nyc": "^13.1.0", @@ -1419,7 +1333,7 @@ }, "@rush-temp/ethereum-order-gateway-contracts": { "version": "file:projects/ethereum-order-gateway-contracts.tgz", - "integrity": "sha512-rlvTpTmnosnuVYt6h6njYVfyjPp4XEWYBdQp+5lZJBEZE8WpW6Yb/NbXMCa2k+9gcXmocg7w6+mz7PdsgdT5ig==", + "integrity": "sha512-g1ejhzgDUmBxpY7Xqx0iIKhpQQSyWC0gMlnvv0l97yBwSvOBH63POLVQug2/Tgm3nHBeYEFlwoNz/9ZKeOF6sA==", "requires": { "@specron/cli": "^0.5.6", "@specron/spec": "^0.5.6", @@ -1433,9 +1347,8 @@ }, "@rush-temp/ethereum-proxy-contracts": { "version": "file:projects/ethereum-proxy-contracts.tgz", - "integrity": "sha512-lVzTBUccqqz7jFxJF3g+gnFBQu0Cn4ptw1cLwme2+EkCUCGGYmQhO0yAcDz/2JjWtFX1jdTDUL2GvQrkwAKy0g==", + "integrity": "sha512-Af7Em94R6yUUnqLn+qeMfadehJGnj8RaYZIznWQi+89UiGfjKWIRE8/0UVepXSLd1czYhmY8C+KmzT0Es29Ifg==", "requires": { - "@0xcert/ethereum-utils": "1.2.0", "@specron/cli": "^0.5.6", "@specron/spec": "^0.5.6", "solc": "0.5.6", @@ -1448,7 +1361,7 @@ }, "@rush-temp/ethereum-sandbox": { "version": "file:projects/ethereum-sandbox.tgz", - "integrity": "sha512-RGnlXj5IdI28Rk8NfwLbrpfQVgHTf60RlGgcKsFGFBXUlOQyZ/I0CEVbj3ZJxw6t1CSSKDOAQo1zPKP4NuNJGA==", + "integrity": "sha512-5u9hvCoQL8shmePAIHodIJ+b1xz/QyBOtgPgS9bj69OlRucIcHlOrWF9US/nc2FdjtGj48mjxgus20YS2ckFUw==", "requires": { "@hayspec/cli": "^0.8.3", "@hayspec/spec": "^0.8.3", @@ -1462,6 +1375,18 @@ "web3": "1.0.0-beta.37" } }, + "@rush-temp/ethereum-utils": { + "version": "file:projects/ethereum-utils.tgz", + "integrity": "sha512-qkrdKaHSJ37DHzQGzOE4baCK+eRJ5uTUG09k+DrUuxwsdwNIDWX6m7nHCp0pG282XIe7PfAzt4OwcI07CgdApA==", + "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/ethereum-utils-contracts": { "version": "file:projects/ethereum-utils-contracts.tgz", "integrity": "sha512-vBi8MHckY/1c4sB2iq3P4xgKAHoAXyHGti54sPSuPL9swgSRiesLf+PyiK8bFn7CweEy/M9NpgmJg+PvlFFUKA==", @@ -1478,9 +1403,8 @@ }, "@rush-temp/ethereum-value-ledger": { "version": "file:projects/ethereum-value-ledger.tgz", - "integrity": "sha512-jkuZLvx2Nf3Sy9XV9J/Io79AyTNI6XnQDML2/9W5Mc4rQXqpRBqkmmTOb2hAlU6T7ILP2SHmit+imwQ6KRaLrw==", + "integrity": "sha512-BguxEkdtc1Jx/xh4XLtx5UNm3yxZsSpcJgxs3F9y2KSw/UUEEkNDuBCw7hPvTk2yxGULjyCHvOmRMFxvmz0H6w==", "requires": { - "@0xcert/ethereum-utils": "1.2.0", "@specron/cli": "^0.5.6", "@specron/spec": "^0.5.6", "nyc": "^13.1.0", @@ -1493,7 +1417,7 @@ }, "@rush-temp/ethereum-xcert-contracts": { "version": "file:projects/ethereum-xcert-contracts.tgz", - "integrity": "sha512-PKYj3LESpIuzxKFNIC3Mtne7dsIqA6RPzz7CgJD/rcmqSWZ4kYVhU+jSgq1H9Z0EsRq0LXxP+l//kXFEdcjYIg==", + "integrity": "sha512-UJydP7lJs4owkUhAHOsdTadvKn3KSCEznxvDLrcKiE68Aw3sLLKkdoVYk90JAHHAM5Wi2dP5Bb4qv5V07DIzhg==", "requires": { "@specron/cli": "^0.5.6", "@specron/spec": "^0.5.6", @@ -1507,7 +1431,7 @@ }, "@rush-temp/merkle": { "version": "file:projects/merkle.tgz", - "integrity": "sha512-ZjTre04CXP8K442vEMOi9M6C9E8T17sEPorJn4ZvtZraaZmvz9sXw/BCDnFT1decr+GAeJD81ZeaawRPfgqoqA==", + "integrity": "sha512-kgjSi1/QxS/UBwIgKPReIbxTtIiH9vG9IjGRTcVg0xWtEIW2oQV5FMUnNw6Jx2owElGUYw5LpdojytsWRsFxiw==", "requires": { "@hayspec/cli": "^0.8.3", "@hayspec/spec": "^0.8.3", @@ -1547,14 +1471,14 @@ }, "@rush-temp/vue-example": { "version": "file:projects/vue-example.tgz", - "integrity": "sha512-A89uENDnvMj70q+8AkI6Xt5wegDAwB+OIBNuCG7li4yclWXAfNYKWLMYqAdVvNXUkawyYDZsaAdnv3R6kHsGYw==", + "integrity": "sha512-JBUZIFQl4o+pljNDXxT7wit8YMxB93HD3plHM5xc4zq5kWiDrzAaOO2JOG5DNTDgzWA30KzyNkzhxiacvCZC6Q==", "requires": { "nuxt": "^2.3.1" } }, "@rush-temp/vue-plugin": { "version": "file:projects/vue-plugin.tgz", - "integrity": "sha512-kmE3IdRoxayaPL+RM8WI5Fjzun9qjsxmszcWPLiAgouwBOSBDtaj6ZlDoyfoXdrJ0NyF64EabXhbLW9ZEXLzEw==", + "integrity": "sha512-FPK8jPEsWD0jE1HjCrvhLXKawSZ7PKH4nX302l2E9JWo+cWLeUtg+x7sjTowssHT5THXNDW0HdU7gD6bjmttdg==", "requires": { "@hayspec/cli": "^0.8.3", "@hayspec/spec": "^0.8.3", @@ -1566,7 +1490,7 @@ }, "@rush-temp/wanchain-asset-ledger": { "version": "file:projects/wanchain-asset-ledger.tgz", - "integrity": "sha512-vz3UwUzqbH4KSZfpqGDOB7TC1Pm6sygpDUlXUxgmp/QWSZTpC5BjFulAaFfKbBbsAj0zsb/puvm3wZ/WJz7qpw==", + "integrity": "sha512-C6C27FJ77t+AEkMwhBWlF8/nD1g8lvtbRKOaP/O0IkPNM+CwSgvV+c1TbXZF/pZNJIpBZzjvFJ1zbKdhzfw0kQ==", "requires": { "@hayspec/cli": "^0.8.3", "@hayspec/spec": "^0.8.3", @@ -1578,7 +1502,7 @@ }, "@rush-temp/wanchain-http-provider": { "version": "file:projects/wanchain-http-provider.tgz", - "integrity": "sha512-BNkwhLx1q2eTvi6Yp0pau9dTNtxe8F72rJpV2bCQh7c9GMMoRe3WM4NsgQleecH7WsJethrWY5uSCHDUBBlZVw==", + "integrity": "sha512-2tQZLXfQOMNQ50k9zx7DAxvpHBttFwU4555kGb1ebDv7ttA1d1i9N36zN4vTtTWiqULyUMPMnt9qcBEI6fPuoQ==", "requires": { "@hayspec/cli": "^0.8.3", "@hayspec/spec": "^0.8.3", @@ -1590,7 +1514,7 @@ }, "@rush-temp/wanchain-order-gateway": { "version": "file:projects/wanchain-order-gateway.tgz", - "integrity": "sha512-tud97EpIrnxOcKIKD6X1zx6Yy3eOW5pOS8vW9rpiwkJ8MnlvuHfoVLlo07K2Vz7d5hV74Bf9IpzDT2tVwF4Ofg==", + "integrity": "sha512-6ttqN9kIPjtlePbSnHFTfV94qSLV9SrfEGbfbuw5btGzZ3BU8YyD4BcLqxQJHZ88ofBfOno+ZLSnmL6zf+u7zA==", "requires": { "@hayspec/cli": "^0.8.3", "@hayspec/spec": "^0.8.3", @@ -1602,11 +1526,11 @@ }, "@rush-temp/wanchain-utils": { "version": "file:projects/wanchain-utils.tgz", - "integrity": "sha512-0S+ck6CmLPQgzBHxPA5UBdiXjui2V3hFdnKUo2NpecyA8f6rbPPXs2Enr2pz0GuE2CkyypPxHsWlA2euRMDvTg==", + "integrity": "sha512-bWC9dVXsyDG2d+vWgmYPDslROhhamv/Wo949F5jOABx3Ag+5bMX6Kk3b2XWN7gC5XgZunECpi8VulrkKJ8Iugw==", "requires": { - "@0xcert/ethereum-utils": "1.2.0", "@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" @@ -1614,7 +1538,7 @@ }, "@rush-temp/wanchain-value-ledger": { "version": "file:projects/wanchain-value-ledger.tgz", - "integrity": "sha512-mk8sKUmzfKKaTPIpjbWtncOXkp3N6ju16NbwvPqW+ZE3RWB2F++OkAJcYcCG+Ta08EOVzAhgp8TyjqE5CfyaQA==", + "integrity": "sha512-whZ+knTvtcEIuUcF5fzBaloLxXHnrvPl6opFdThyu0xvh7K5CybbRa2KbLtP3jYgiRQNptmgQdwcW1UfZR3saQ==", "requires": { "@hayspec/cli": "^0.8.3", "@hayspec/spec": "^0.8.3", @@ -1626,7 +1550,7 @@ }, "@rush-temp/webpack": { "version": "file:projects/webpack.tgz", - "integrity": "sha512-p6NG8ranDtCYLeDvm7AfcEqf+x9ha2n8RQebGjF+lRXvdrKzB/s9m/tNYMop4Uc6v/BsYTh76a94SclROjaJSQ==", + "integrity": "sha512-s0CgK3rX7vatgwWo7hs5mh4Z+rIX0Wbi204r9QEZ2U0vERU/T/EKIXa1SHCRfUR1/sgdlg5xW9OtjUPLi2xx1w==", "requires": { "webpack": "^4.25.0", "webpack-cli": "^3.1.2" @@ -1745,82 +1669,82 @@ } }, "@types/node": { - "version": "10.14.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.14.1.tgz", - "integrity": "sha512-Rymt08vh1GaW4vYB6QP61/5m/CFLGnFZP++bJpWbiNxceNa6RBipDmb413jvtSf/R1gg5a/jQVl2jY4XVRscEA==" + "version": "10.14.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.14.4.tgz", + "integrity": "sha512-DT25xX/YgyPKiHFOpNuANIQIVvYEwCWXgK2jYYwqgaMrYE6+tq+DtmMwlD3drl6DJbUwtlIDnn0d7tIn/EbXBg==" }, "@types/q": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/@types/q/-/q-1.5.1.tgz", - "integrity": "sha512-eqz8c/0kwNi/OEHQfvIuJVLTst3in0e7uTKeuY+WL/zfKn0xVujOTp42bS/vUUokhK5P2BppLd9JXMOMHcgbjA==" + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/@types/q/-/q-1.5.2.tgz", + "integrity": "sha512-ce5d3q03Ex0sy4R14722Rmt6MT07Ua+k4FwDfdcToYJcMKNtRVQvJ6JCAPdAmAnbRb6CsX6aYb9m96NGod9uTw==" }, "@vue/babel-helper-vue-jsx-merge-props": { - "version": "1.0.0-beta.2", - "resolved": "https://registry.npmjs.org/@vue/babel-helper-vue-jsx-merge-props/-/babel-helper-vue-jsx-merge-props-1.0.0-beta.2.tgz", - "integrity": "sha512-Yj92Q1GcGjjctecBfnBmVqKSlMdyZaVq10hlZB4HSd1DJgu4cWgpEImJSzcJRUCZmas6UigwE7f4IjJuQs+JvQ==" + "version": "1.0.0-beta.3", + "resolved": "https://registry.npmjs.org/@vue/babel-helper-vue-jsx-merge-props/-/babel-helper-vue-jsx-merge-props-1.0.0-beta.3.tgz", + "integrity": "sha512-cbFQnd3dDPsfWuxbWW2phynX2zsckwC4GfAkcE1QH1lZL2ZAD2V97xY3BmvTowMkjeFObRKQt1P3KKA6AoB0hQ==" }, "@vue/babel-plugin-transform-vue-jsx": { - "version": "1.0.0-beta.2", - "resolved": "https://registry.npmjs.org/@vue/babel-plugin-transform-vue-jsx/-/babel-plugin-transform-vue-jsx-1.0.0-beta.2.tgz", - "integrity": "sha512-fvAymRZAPHitomRE+jIipWRj0STXNSMqeOSdOFu9Ffjqg9WGOxSdCjORxexManfZ2y5QDv7gzI1xfgprsK3nlw==", + "version": "1.0.0-beta.3", + "resolved": "https://registry.npmjs.org/@vue/babel-plugin-transform-vue-jsx/-/babel-plugin-transform-vue-jsx-1.0.0-beta.3.tgz", + "integrity": "sha512-yn+j2B/2aEagaxXrMSK3qcAJnlidfXg9v+qmytqrjUXc4zfi8QVC/b4zCev1FDmTip06/cs/csENA4law6Xhpg==", "requires": { "@babel/helper-module-imports": "^7.0.0", "@babel/plugin-syntax-jsx": "^7.2.0", - "@vue/babel-helper-vue-jsx-merge-props": "^1.0.0-beta.2", + "@vue/babel-helper-vue-jsx-merge-props": "^1.0.0-beta.3", "html-tags": "^2.0.0", "lodash.kebabcase": "^4.1.1", "svg-tags": "^1.0.0" } }, "@vue/babel-preset-jsx": { - "version": "1.0.0-beta.2", - "resolved": "https://registry.npmjs.org/@vue/babel-preset-jsx/-/babel-preset-jsx-1.0.0-beta.2.tgz", - "integrity": "sha512-nZoAKBR/h6iPMQ66ieQcIdlpPBmqhtUUcgjBS541jIVxSog1rwzrc00jlsuecLonzUMWPU0PabyitsG74vhN1w==", + "version": "1.0.0-beta.3", + "resolved": "https://registry.npmjs.org/@vue/babel-preset-jsx/-/babel-preset-jsx-1.0.0-beta.3.tgz", + "integrity": "sha512-qMKGRorTI/0nE83nLEM7MyQiBZUqc62sZyjkBdVaaU7S61MHI8RKHPtbLMMZlWXb2NCJ0fQci8xJWUK5JE+TFA==", "requires": { - "@vue/babel-helper-vue-jsx-merge-props": "^1.0.0-beta.2", - "@vue/babel-plugin-transform-vue-jsx": "^1.0.0-beta.2", - "@vue/babel-sugar-functional-vue": "^1.0.0-beta.2", - "@vue/babel-sugar-inject-h": "^1.0.0-beta.2", - "@vue/babel-sugar-v-model": "^1.0.0-beta.2", - "@vue/babel-sugar-v-on": "^1.0.0-beta.2" + "@vue/babel-helper-vue-jsx-merge-props": "^1.0.0-beta.3", + "@vue/babel-plugin-transform-vue-jsx": "^1.0.0-beta.3", + "@vue/babel-sugar-functional-vue": "^1.0.0-beta.3", + "@vue/babel-sugar-inject-h": "^1.0.0-beta.3", + "@vue/babel-sugar-v-model": "^1.0.0-beta.3", + "@vue/babel-sugar-v-on": "^1.0.0-beta.3" } }, "@vue/babel-sugar-functional-vue": { - "version": "1.0.0-beta.2", - "resolved": "https://registry.npmjs.org/@vue/babel-sugar-functional-vue/-/babel-sugar-functional-vue-1.0.0-beta.2.tgz", - "integrity": "sha512-5qvi4hmExgjtrESDk0vflL69dIxkDAukJcYH9o4663E8Nh12Jpbmr+Ja8WmgkAPtTVhk90UVcVUFCCZLHBmhkQ==", + "version": "1.0.0-beta.3", + "resolved": "https://registry.npmjs.org/@vue/babel-sugar-functional-vue/-/babel-sugar-functional-vue-1.0.0-beta.3.tgz", + "integrity": "sha512-CBIa0sQWn3vfBS2asfTgv0WwdyKvNTKtE/cCfulZ7MiewLBh0RlvvSmdK9BIMTiHErdeZNSGUGlU6JuSHLyYkQ==", "requires": { "@babel/plugin-syntax-jsx": "^7.2.0" } }, "@vue/babel-sugar-inject-h": { - "version": "1.0.0-beta.2", - "resolved": "https://registry.npmjs.org/@vue/babel-sugar-inject-h/-/babel-sugar-inject-h-1.0.0-beta.2.tgz", - "integrity": "sha512-qGXZ6yE+1trk82xCVJ9j3shsgI+R2ePj3+o8b2Ee7JNaRqQvMfTwpgx5BRlk4q1+CTjvYexdqBS+q4Kg7sSxcg==", + "version": "1.0.0-beta.3", + "resolved": "https://registry.npmjs.org/@vue/babel-sugar-inject-h/-/babel-sugar-inject-h-1.0.0-beta.3.tgz", + "integrity": "sha512-HKMBMmFfdK9GBp3rX2bHIwILBdgc5F3ahmCB72keJxzaAQrgDAnD+ho70exUge+inAGlNF34WsQcGPElTf9QZg==", "requires": { "@babel/plugin-syntax-jsx": "^7.2.0" } }, "@vue/babel-sugar-v-model": { - "version": "1.0.0-beta.2", - "resolved": "https://registry.npmjs.org/@vue/babel-sugar-v-model/-/babel-sugar-v-model-1.0.0-beta.2.tgz", - "integrity": "sha512-63US3IMEtATJzzK2le/Na53Sk2bp3LHfwZ8eMFwbTaz6e2qeV9frBl3ZYaha64ghT4IDSbrDXUmm0J09EAzFfA==", + "version": "1.0.0-beta.3", + "resolved": "https://registry.npmjs.org/@vue/babel-sugar-v-model/-/babel-sugar-v-model-1.0.0-beta.3.tgz", + "integrity": "sha512-et39eTEh7zW4wfZoSl9Jf0/n2r9OTT8U02LtSbXsjgYcqaDQFusN0+n7tw4bnOqvnnSVjEp7bVsQCWwykC3Wgg==", "requires": { "@babel/plugin-syntax-jsx": "^7.2.0", - "@vue/babel-helper-vue-jsx-merge-props": "^1.0.0-beta.2", - "@vue/babel-plugin-transform-vue-jsx": "^1.0.0-beta.2", + "@vue/babel-helper-vue-jsx-merge-props": "^1.0.0-beta.3", + "@vue/babel-plugin-transform-vue-jsx": "^1.0.0-beta.3", "camelcase": "^5.0.0", "html-tags": "^2.0.0", "svg-tags": "^1.0.0" } }, "@vue/babel-sugar-v-on": { - "version": "1.0.0-beta.2", - "resolved": "https://registry.npmjs.org/@vue/babel-sugar-v-on/-/babel-sugar-v-on-1.0.0-beta.2.tgz", - "integrity": "sha512-XH/m3k11EKdMY0MrTg4+hQv8BFM8juzHT95chYkgxDmvDdVJnSCuf9+mcysEJttWD4PVuUGN7EHoIWsIhC0dRw==", + "version": "1.0.0-beta.3", + "resolved": "https://registry.npmjs.org/@vue/babel-sugar-v-on/-/babel-sugar-v-on-1.0.0-beta.3.tgz", + "integrity": "sha512-F+GapxCiy50jf2Q2B4exw+KYBzlGdeKMAMW1Dbvb0Oa59SA0CH6tsUOIAsXb0A05jwwg/of0LaVeo+4aLefVxQ==", "requires": { "@babel/plugin-syntax-jsx": "^7.2.0", - "@vue/babel-plugin-transform-vue-jsx": "^1.0.0-beta.2", + "@vue/babel-plugin-transform-vue-jsx": "^1.0.0-beta.3", "camelcase": "^5.0.0" } }, @@ -1855,6 +1779,11 @@ "uniq": "^1.0.1" } }, + "prettier": { + "version": "1.16.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.16.3.tgz", + "integrity": "sha512-kn/GU6SMRYPxUakNXhpP0EedT/KmaPzr0H5lIsDogrykbaxOpOfAFfk5XA7DZrJyMAv1wlMV3CPcZruGXVVUZw==" + }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -2290,9 +2219,9 @@ } }, "async-each": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz", - "integrity": "sha1-GdOGodntxufByF04iu28xW0zYC0=" + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.2.tgz", + "integrity": "sha512-6xrbvN0MOBKSJDdonmSSz2OwFSgxRaVtBDes26mj9KIGtDo+g9xosFRSC+i1gQh2oAN/tQ62AI/pGZGQjVOiRg==" }, "async-limiter": { "version": "1.0.0", @@ -2310,28 +2239,16 @@ "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==" }, "autoprefixer": { - "version": "9.4.10", - "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-9.4.10.tgz", - "integrity": "sha512-XR8XZ09tUrrSzgSlys4+hy5r2/z4Jp7Ag3pHm31U4g/CTccYPOVe19AkaJ4ey/vRd1sfj+5TtuD6I0PXtutjvQ==", + "version": "9.5.1", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-9.5.1.tgz", + "integrity": "sha512-KJSzkStUl3wP0D5sdMlP82Q52JLy5+atf2MHAre48+ckWkXgixmfHyWmA77wFDy6jTHU6mIgXv6hAQ2mf1PjJQ==", "requires": { - "browserslist": "^4.4.2", - "caniuse-lite": "^1.0.30000940", + "browserslist": "^4.5.4", + "caniuse-lite": "^1.0.30000957", "normalize-range": "^0.1.2", "num2fraction": "^1.2.2", "postcss": "^7.0.14", "postcss-value-parser": "^3.3.1" - }, - "dependencies": { - "browserslist": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.4.2.tgz", - "integrity": "sha512-ISS/AIAiHERJ3d45Fz0AVYKkgcy+F/eJHzKEvv1j0wwKGKD9T3BrwKr/5g45L+Y4XIK5PlTqefHciRFcfE1Jxg==", - "requires": { - "caniuse-lite": "^1.0.30000939", - "electron-to-chromium": "^1.3.113", - "node-releases": "^1.1.8" - } - } } }, "aws-sign2": { @@ -2501,9 +2418,9 @@ "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==" }, "binary-extensions": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.0.tgz", - "integrity": "sha512-EgmjVLMn22z7eGGv3kcnHwSnJXmFHjISTY9E/S5lIcTD3Oxw05QTcBLNkJFzcb3cNueUdF/IN4U+d78V0zO8Hw==" + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz", + "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==" }, "bindings": { "version": "1.2.1", @@ -2528,9 +2445,9 @@ } }, "bluebird": { - "version": "3.5.3", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.3.tgz", - "integrity": "sha512-/qKPUQlaW1OyR51WeCPBvRnAlnZFUJkCSG5HzGnuIqhgyJtF+T94lFnn33eiazjRm2LAHVy2guNnaq48X9SJuw==" + "version": "3.5.4", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.4.tgz", + "integrity": "sha512-FG+nFEZChJrbQ9tIccIfZJBz3J7mLrAhxakAbnrJWn8d7aKOC+LWifa0G+p4ZqKp4y13T7juYvdhq9NzKdsrjw==" }, "bn.js": { "version": "4.11.8", @@ -2583,16 +2500,17 @@ "integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24=" }, "boxen": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/boxen/-/boxen-3.0.0.tgz", - "integrity": "sha512-6BI51DCC62Ylgv78Kfn+MHkyPwSlhulks+b+wz7bK1vsTFgbSEy/E1DOxx1wjf/0YdkrfPUMh9NoaW419M7csQ==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/boxen/-/boxen-3.1.0.tgz", + "integrity": "sha512-WiP53arM6cU2STTBYQ2we3viJkDqkthMYaTFnmXPZ/v3S4h43H5MHWpw5d85SgmHiYO/Y+2PoyXO8nTEURXNJA==", "requires": { "ansi-align": "^3.0.0", - "camelcase": "^5.0.0", + "camelcase": "^5.3.1", "chalk": "^2.4.2", - "cli-boxes": "^2.0.0", + "cli-boxes": "^2.1.0", "string-width": "^3.0.0", "term-size": "^1.2.0", + "type-fest": "^0.3.0", "widest-line": "^2.0.0" }, "dependencies": { @@ -2699,6 +2617,13 @@ "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": { @@ -2723,6 +2648,16 @@ "pako": "~1.0.5" } }, + "browserslist": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.5.4.tgz", + "integrity": "sha512-rAjx494LMjqKnMPhFkuLmLp8JWEX0o8ADTGeAbOqaF+XCvYLreZrG5uVjnPBlAQ8REZK4pzXGvp0bWgrFtKaag==", + "requires": { + "caniuse-lite": "^1.0.30000955", + "electron-to-chromium": "^1.3.122", + "node-releases": "^1.1.13" + } + }, "buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.2.1.tgz", @@ -2886,9 +2821,9 @@ } }, "camelcase": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.2.0.tgz", - "integrity": "sha512-IXFsBS2pC+X0j0N/GE7Dm7j3bsEBp+oTpb7F50dwEVX7rf3IgwO9XatnegTsDtniKCUtEJH4fSU6Asw7uoVLfQ==" + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==" }, "caniuse-api": { "version": "3.0.0", @@ -2899,24 +2834,12 @@ "caniuse-lite": "^1.0.0", "lodash.memoize": "^4.1.2", "lodash.uniq": "^4.5.0" - }, - "dependencies": { - "browserslist": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.4.2.tgz", - "integrity": "sha512-ISS/AIAiHERJ3d45Fz0AVYKkgcy+F/eJHzKEvv1j0wwKGKD9T3BrwKr/5g45L+Y4XIK5PlTqefHciRFcfE1Jxg==", - "requires": { - "caniuse-lite": "^1.0.30000939", - "electron-to-chromium": "^1.3.113", - "node-releases": "^1.1.8" - } - } } }, "caniuse-lite": { - "version": "1.0.30000946", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000946.tgz", - "integrity": "sha512-ZVXtMoZ3Mfq69Ikv587Av+5lwGVJsG98QKUucVmtFBf0tl1kOCfLQ5o6Z2zBNis4Mx3iuH77WxEUpdP6t7f2CQ==" + "version": "1.0.30000957", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000957.tgz", + "integrity": "sha512-8wxNrjAzyiHcLXN/iunskqQnJquQQ6VX8JHfW5kLgAPRSiSuKZiNfmIkP5j7jgyXqAQBSoXyJxfnbCFS0ThSiQ==" }, "caseless": { "version": "0.12.0", @@ -2944,9 +2867,9 @@ "integrity": "sha512-YbulWHdfP99UfZ73NcUDlNJhEIDgm9Doq9GhpyXbF+7Aegi3CVV7qqMCKTTqJxlvEvnQBp9IA+dxsGN6xK/nSg==" }, "chokidar": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.2.tgz", - "integrity": "sha512-IwXUx0FXc5ibYmPC2XeEj5mpXoV66sR+t3jqu2NS2GYwCktt3KF1/Qqjws/NkegajBA4RbZ5+DDwlOiJsxDHEg==", + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.5.tgz", + "integrity": "sha512-i0TprVWp+Kj4WRPtInjexJ8Q+BqTE909VpH8xVhXrJkoc5QC8VO9TryGOqTr+2hljzc1sC62t22h5tZePodM/A==", "requires": { "anymatch": "^2.0.0", "async-each": "^1.0.1", @@ -2959,7 +2882,7 @@ "normalize-path": "^3.0.0", "path-is-absolute": "^1.0.0", "readdirp": "^2.2.1", - "upath": "^1.1.0" + "upath": "^1.1.1" } }, "chownr": { @@ -3026,9 +2949,9 @@ } }, "cli-boxes": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-2.0.0.tgz", - "integrity": "sha512-P46J1Wf3BVD0E5plybtf6g/NtHYAUlOIt7w3ou/Ova/p7dJPdukPV4yp+BF8dpmnnk45XlMzn+x9kfzyucKzrg==" + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-2.1.0.tgz", + "integrity": "sha512-V9gkudTUk+iZGUYvI6qNwD9XbEc0mJiQEjYT5/+RLhN/3GgSTjIAsltAIA+idbCEAdAQw//uaXRHBp+CETPjuA==" }, "cli-color": { "version": "1.4.0", @@ -3152,9 +3075,9 @@ "integrity": "sha512-PM54PkseWbiiD/mMsbvW351/u+dafwTJ0ye2qB60G1aGQP9j3xK2gmMDc+R34L3nDtx4qMCitXT75mkbkGJDLw==" }, "commander": { - "version": "2.19.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.19.0.tgz", - "integrity": "sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg==" + "version": "2.20.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz", + "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==" }, "commondir": { "version": "1.0.1", @@ -3175,15 +3098,15 @@ } }, "compression": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/compression/-/compression-1.7.3.tgz", - "integrity": "sha512-HSjyBG5N1Nnz7tF2+O7A9XUhyjru71/fwgNb7oIsEVHR0WShfs2tIS/EySLgiTe98aOK18YDlMXpzjCXY/n9mg==", + "version": "1.7.4", + "resolved": "https://registry.npmjs.org/compression/-/compression-1.7.4.tgz", + "integrity": "sha512-jaSIDzP9pZVS4ZfQ+TzvtiWhdpFhE2RDHz8QJkpX9SIpLq88VueF5jJw6t+6CUQcAoA6t+x89MLrWAqpfDE8iQ==", "requires": { "accepts": "~1.3.5", "bytes": "3.0.0", - "compressible": "~2.0.14", + "compressible": "~2.0.16", "debug": "2.6.9", - "on-headers": "~1.0.1", + "on-headers": "~1.0.2", "safe-buffer": "5.1.2", "vary": "~1.1.2" }, @@ -3265,9 +3188,9 @@ } }, "consola": { - "version": "2.5.6", - "resolved": "https://registry.npmjs.org/consola/-/consola-2.5.6.tgz", - "integrity": "sha512-DN0j6ewiNWkT09G3ZoyyzN3pSYrjxWcx49+mHu+oDI5dvW5vzmyuzYsqGS79+yQserH9ymJQbGzeqUejfssr8w==" + "version": "2.5.8", + "resolved": "https://registry.npmjs.org/consola/-/consola-2.5.8.tgz", + "integrity": "sha512-fYv1M0rNJw4h0CZUx8PX02Px7xQhA+vNHpV8DBCGMoozp2Io/vrSXhhEothaRnSt7VMR0rj2pt9KKLXa5amrCw==" }, "console-browserify": { "version": "1.1.0", @@ -3346,6 +3269,34 @@ "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.5.tgz", "integrity": "sha512-klh/kDpwX8hryYL14M9w/xei6vrv6sE8gTHDG7/T/+SEovB/G4ejwcfE/CBzO6Edsu+OETZMZ3wcX/EjUkrl5A==" }, + "core-js-compat": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.0.1.tgz", + "integrity": "sha512-2pC3e+Ht/1/gD7Sim/sqzvRplMiRnFQVlPpDVaHtY9l7zZP7knamr3VRD6NyGfHd84MrDC0tAM9ulNxYMW0T3g==", + "requires": { + "browserslist": "^4.5.4", + "core-js": "3.0.1", + "core-js-pure": "3.0.1", + "semver": "^6.0.0" + }, + "dependencies": { + "core-js": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.0.1.tgz", + "integrity": "sha512-sco40rF+2KlE0ROMvydjkrVMMG1vYilP2ALoRXcYR4obqbYIuV3Bg+51GEDW+HF8n7NRA+iaA4qD0nD9lo9mew==" + }, + "semver": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.0.0.tgz", + "integrity": "sha512-0UewU+9rFapKFnlbirLi3byoOuhrSsli/z/ihNnvM24vgF+8sNBiI1LZPBSH9wJKUwaUbw+s3hToDLCXkrghrQ==" + } + } + }, + "core-js-pure": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.0.1.tgz", + "integrity": "sha512-mSxeQ6IghKW3MoyF4cz19GJ1cMm7761ON+WObSyLfTu/Jn3x7w4NwNFnrZxgl4MTSvYYepVLNuRtlB4loMwJ5g==" + }, "core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", @@ -3361,14 +3312,13 @@ } }, "cosmiconfig": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.1.0.tgz", - "integrity": "sha512-kCNPvthka8gvLtzAxQXvWo4FxqRB+ftRZyPZNuab5ngvM9Y7yw7hbEysglptLgpkGX9nAOKTBVkHUAe8xtYR6Q==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.2.0.tgz", + "integrity": "sha512-nxt+Nfc3JAqf4WIWd0jXLjTJZmsPLrA9DDc4nRw2KFJQJK7DNooqSXrNI7tzLG50CF8axczly5UV929tBmh/7g==", "requires": { "import-fresh": "^2.0.0", "is-directory": "^0.3.1", - "js-yaml": "^3.9.0", - "lodash.get": "^4.4.2", + "js-yaml": "^3.13.0", "parse-json": "^4.0.0" } }, @@ -3891,6 +3841,11 @@ "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz", "integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=" }, + "detect-indent": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-5.0.0.tgz", + "integrity": "sha1-OHHMCmoALow+Wzz38zYmRnXwa50=" + }, "diff": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", @@ -4012,22 +3967,19 @@ "integrity": "sha512-0xy4A/twfrRCnkhfk8ErDi5DqdAsAqeGxht4xkCUrsvhhbQNs7E+4jV0CN7+NKIY0aHE72+XvqtBIXzD31ZbXQ==" }, "electron-to-chromium": { - "version": "1.3.115", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.115.tgz", - "integrity": "sha512-mN2qeapQWdi2B9uddxTZ4nl80y46hbyKY5Wt9Yjih+QZFQLdaujEDK4qJky35WhyxMzHF3ZY41Lgjd2BPDuBhg==" + "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==" }, "elliptic": { - "version": "6.4.1", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.4.1.tgz", - "integrity": "sha512-BsXLz5sqX8OHcsh7CqBMztyXARmGQ3LWPtGjJi6DiJHq5C/qvi9P3OqgswKSDftbu8+IoI/QDTAm2fFnQ9SZSQ==", + "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", - "hmac-drbg": "^1.0.0", - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.0" + "inherits": "^2.0.1" } }, "emoji-regex": { @@ -4174,9 +4126,9 @@ "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" }, "eslint": { - "version": "5.15.3", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.15.3.tgz", - "integrity": "sha512-vMGi0PjCHSokZxE0NLp2VneGw5sio7SSiDNgIUn2tC0XkWJRNOIoHIg3CliLVfXnJsiHxGAYrkw0PieAu8+KYQ==", + "version": "5.16.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.16.0.tgz", + "integrity": "sha512-S3Rz11i7c8AA5JPv7xAH+dOyq/Cu/VXHiHXBPOU1k/JAM5dXqQPt3qcrhpHSorXmrpu2g0gkIBVXAqCpzfoZIg==", "requires": { "@babel/code-frame": "^7.0.0", "ajv": "^6.9.1", @@ -4198,7 +4150,7 @@ "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", "inquirer": "^6.2.2", - "js-yaml": "^3.12.0", + "js-yaml": "^3.13.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.3.0", "lodash": "^4.17.11", @@ -4224,15 +4176,6 @@ "ms": "^2.1.1" } }, - "eslint-scope": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", - "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==", - "requires": { - "esrecurse": "^4.1.0", - "estraverse": "^4.1.1" - } - }, "import-fresh": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.0.0.tgz", @@ -4258,9 +4201,9 @@ } }, "eslint-scope": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.2.tgz", - "integrity": "sha512-5q1+B/ogmHl8+paxtOKx38Z8LtWkVGuNt3+GQNErqwLl6ViNp/gdJGMCjZNxZ8j/VYjDNZ2Fo+eQc1TAVPIzbg==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", + "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==", "requires": { "esrecurse": "^4.1.0", "estraverse": "^4.1.1" @@ -4277,9 +4220,9 @@ "integrity": "sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ==" }, "esm": { - "version": "3.2.16", - "resolved": "https://registry.npmjs.org/esm/-/esm-3.2.16.tgz", - "integrity": "sha512-iACZMQvYFc66Y7QC+vD3oGA/fFsPA/IQwewRJ3K0gbMV52E59pdko02kF2TfVdtp5aHO62PHxL6fxtHJmhm3NQ==" + "version": "3.2.20", + "resolved": "https://registry.npmjs.org/esm/-/esm-3.2.20.tgz", + "integrity": "sha512-NA92qDA8C/qGX/xMinDGa3+cSPs4wQoFxskRrSnDo/9UloifhONFm4sl4G+JsyCqM007z2K+BfQlH5rMta4K1Q==" }, "espree": { "version": "5.0.1", @@ -4334,13 +4277,6 @@ "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": { @@ -4355,62 +4291,41 @@ "servify": "^0.1.12", "ws": "^3.0.0", "xhr-request-promise": "^0.1.2" - } - }, - "ethers": { - "version": "4.0.0-beta.1", - "resolved": "https://registry.npmjs.org/ethers/-/ethers-4.0.0-beta.1.tgz", - "integrity": "sha512-SoYhktEbLxf+fiux5SfCEwdzWENMvgIbMZD90I62s4GZD9nEjgEWy8ZboI3hck193Vs0bDoTohDISx84f2H2tw==", - "requires": { - "@types/node": "^10.3.2", - "aes-js": "3.0.0", - "bn.js": "^4.4.0", - "elliptic": "6.3.3", - "hash.js": "1.1.3", - "js-sha3": "0.5.7", - "scrypt-js": "2.0.3", - "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=", + "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" - } - }, - "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" + "hmac-drbg": "^1.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^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=" } } }, + "ethers": { + "version": "4.0.0-beta.1", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-4.0.0-beta.1.tgz", + "integrity": "sha512-SoYhktEbLxf+fiux5SfCEwdzWENMvgIbMZD90I62s4GZD9nEjgEWy8ZboI3hck193Vs0bDoTohDISx84f2H2tw==", + "requires": { + "@types/node": "^10.3.2", + "aes-js": "3.0.0", + "bn.js": "^4.4.0", + "elliptic": "6.3.3", + "hash.js": "1.1.3", + "js-sha3": "0.5.7", + "scrypt-js": "2.0.3", + "setimmediate": "1.0.4", + "uuid": "2.0.1", + "xmlhttprequest": "1.8.0" + } + }, "ethjs-unit": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/ethjs-unit/-/ethjs-unit-0.1.6.tgz", @@ -4683,15 +4598,32 @@ } }, "extract-css-chunks-webpack-plugin": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/extract-css-chunks-webpack-plugin/-/extract-css-chunks-webpack-plugin-3.3.3.tgz", - "integrity": "sha512-4DYo3jna9ov81rdKtE1U2cirb3ERoWhHldzRxZWx3Q5i5Dm6U+mmfon7PmaKDuh6+xySVOqtlXrZyJY2V4tc+g==", + "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==", "requires": { "loader-utils": "^1.1.0", "lodash": "^4.17.11", - "normalize-url": "^3.3.0", + "normalize-url": "^2.0.1", "schema-utils": "^1.0.0", "webpack-sources": "^1.1.0" + }, + "dependencies": { + "normalize-url": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-2.0.1.tgz", + "integrity": "sha512-D6MUW4K/VzoJ4rJ01JFKxDrtY1v9wrgzCX5f2qj/lzH1m/lW6MhUZFKerVsnyjOhOsYzI9Kqqak+10l4LvLpMw==", + "requires": { + "prepend-http": "^2.0.0", + "query-string": "^5.0.1", + "sort-keys": "^2.0.0" + } + }, + "prepend-http": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", + "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=" + } } }, "extsprintf": { @@ -7527,8 +7459,24 @@ "version": "git+https://github.com/ethereumjs/ethereumjs-abi.git#d84a96796079c8595a0c78accd1e7709f2277215", "from": "git+https://github.com/ethereumjs/ethereumjs-abi.git", "requires": { - "bn.js": "^4.10.0", - "ethereumjs-util": "^5.0.0" + "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": { @@ -11214,8 +11162,24 @@ "version": "git+https://github.com/ethereumjs/ethereumjs-abi.git#d84a96796079c8595a0c78accd1e7709f2277215", "from": "git+https://github.com/ethereumjs/ethereumjs-abi.git", "requires": { - "bn.js": "^4.10.0", - "ethereumjs-util": "^5.0.0" + "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": { @@ -11779,12 +11743,12 @@ "integrity": "sha1-M7QHd3VMZDJXPBIMw4CLvRDUfwQ=" }, "hash.js": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", - "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "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.1" + "minimalistic-assert": "^1.0.0" } }, "he": { @@ -11841,24 +11805,17 @@ "integrity": "sha1-DfKTUfByEWNRXfueVUPl9u7VFi8=" }, "html-minifier": { - "version": "3.5.21", - "resolved": "https://registry.npmjs.org/html-minifier/-/html-minifier-3.5.21.tgz", - "integrity": "sha512-LKUKwuJDhxNa3uf/LPR/KVjm/l3rBqtYeCOAekvG8F1vItxMUpueGd94i/asDDr8/1u7InxzFA5EeGjhhG5mMA==", - "requires": { - "camel-case": "3.0.x", - "clean-css": "4.2.x", - "commander": "2.17.x", - "he": "1.2.x", - "param-case": "2.1.x", - "relateurl": "0.2.x", - "uglify-js": "3.4.x" - }, - "dependencies": { - "commander": { - "version": "2.17.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.17.1.tgz", - "integrity": "sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg==" - } + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/html-minifier/-/html-minifier-4.0.0.tgz", + "integrity": "sha512-aoGxanpFPLg7MkIl/DDFYtb0iWz7jMFGqFhvEDZga6/4QTjneiD8I/NXL1x5aaoCp7FSIT6h/OhykDdPsbtMig==", + "requires": { + "camel-case": "^3.0.0", + "clean-css": "^4.2.1", + "commander": "^2.19.0", + "he": "^1.2.0", + "param-case": "^2.1.1", + "relateurl": "^0.2.7", + "uglify-js": "^3.5.1" } }, "html-tags": { @@ -11885,6 +11842,30 @@ "resolved": "https://registry.npmjs.org/big.js/-/big.js-3.2.0.tgz", "integrity": "sha512-+hN/Zh2D08Mx65pZ/4g5bsmNiZUuChDiQfTUQ7qJr4/kuopCr88xZsAXv6mBoZEsUI4OuGHlX59qE94K2mMW8Q==" }, + "commander": { + "version": "2.17.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.17.1.tgz", + "integrity": "sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg==" + }, + "html-minifier": { + "version": "3.5.21", + "resolved": "https://registry.npmjs.org/html-minifier/-/html-minifier-3.5.21.tgz", + "integrity": "sha512-LKUKwuJDhxNa3uf/LPR/KVjm/l3rBqtYeCOAekvG8F1vItxMUpueGd94i/asDDr8/1u7InxzFA5EeGjhhG5mMA==", + "requires": { + "camel-case": "3.0.x", + "clean-css": "4.2.x", + "commander": "2.17.x", + "he": "1.2.x", + "param-case": "2.1.x", + "relateurl": "0.2.x", + "uglify-js": "3.4.x" + } + }, + "json5": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", + "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=" + }, "loader-utils": { "version": "0.2.17", "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-0.2.17.tgz", @@ -11895,6 +11876,27 @@ "json5": "^0.5.0", "object-assign": "^4.0.1" } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" + }, + "uglify-js": { + "version": "3.4.10", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.4.10.tgz", + "integrity": "sha512-Y2VsbPVs0FIshJztycsO2SfPk7/KAF/T72qzv9u5EpQ4kB2hQoHlhNQTsNyy6ul7lQtqJN/AoWeS23OzEiEFxw==", + "requires": { + "commander": "~2.19.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==" + } + } } } }, @@ -11912,9 +11914,9 @@ }, "dependencies": { "readable-stream": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.2.0.tgz", - "integrity": "sha512-RV20kLjdmpZuTF1INEb9IA3L68Nmi+Ri7ppZqo78wj//Pn62fCoJyV9zalccNzDD/OuJpMG4f+pfMl8+L6QdGw==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.3.0.tgz", + "integrity": "sha512-EsI+s3k3XsW+fU8fQACLN59ky34AZ14LoeVZpYwmZvldCFo0r0gnelwF2TcMjLor/BTL5aDJVBMkss0dthToPw==", "requires": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", @@ -11991,9 +11993,9 @@ } }, "ieee754": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.12.tgz", - "integrity": "sha512-GguP+DRY+pJ3soyIiGPTvdiVXjZ+DbXOxGpXn3eMvNW4x4irjqXm4wHKscC+TfxSJ0yw/S1F24tqdMNsMZTiLA==" + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", + "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==" }, "iferr": { "version": "0.1.5", @@ -12256,9 +12258,9 @@ "integrity": "sha1-Es+5i2W1fdPRk6MSH19uL0N2ArU=" }, "is-glob": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.0.tgz", - "integrity": "sha1-lSHHaEXMJhCoUgPd8ICpWML/q8A=", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", "requires": { "is-extglob": "^2.1.1" } @@ -12427,9 +12429,9 @@ "integrity": "sha512-X2BB11YZtrRqY4EnQcLX5Rh373zbK4alC1FW7D7MBhL2gtcC17cTnr6DmfHZeS0s2rTHjUTMMHfG7gO8SSdw+g==" }, "js-sha3": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.6.1.tgz", - "integrity": "sha1-W4n3enR3Z5h39YxKB1JAk0sflcA=" + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.5.7.tgz", + "integrity": "sha1-DU/9gALVMzqrr0oj7tL2N0yfKOc=" }, "js-tokens": { "version": "4.0.0", @@ -12437,9 +12439,9 @@ "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" }, "js-yaml": { - "version": "3.12.2", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.2.tgz", - "integrity": "sha512-QHn/Lh/7HhZ/Twc7vJYQTkjuCa0kaCcDcjK5Zlk2rvnUpy7DxMJ23+Jc2dcyvltwQVg1nygAVlB2oRDFHoRS5Q==", + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", + "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", "requires": { "argparse": "^1.0.7", "esprima": "^4.0.0" @@ -12481,9 +12483,12 @@ "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" }, "json5": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", - "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=" + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.0.tgz", + "integrity": "sha512-8Mh9h6xViijj36g7Dxi+Y4S6hNGV96vcJZr/SrlHh1LR/pEn/8j/+qIBbs44YKl69Lrfctp4QD+AdWLTMqEZAQ==", + "requires": { + "minimist": "^1.2.0" + } }, "jsonfile": { "version": "4.0.0", @@ -12629,11 +12634,6 @@ "resolved": "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz", "integrity": "sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0=" }, - "lodash.get": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", - "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=" - }, "lodash.isplainobject": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", @@ -12778,9 +12778,9 @@ "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" }, "mem": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/mem/-/mem-4.2.0.tgz", - "integrity": "sha512-5fJxa68urlY0Ir8ijatKa3eRz5lwXnRCTvo9+TbTGAuTFJOwpGcY0X05moBd0nW45965Njt4CDI2GFQoG8DvqA==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/mem/-/mem-4.3.0.tgz", + "integrity": "sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w==", "requires": { "map-age-cleaner": "^0.1.1", "mimic-fn": "^2.0.0", @@ -12788,9 +12788,9 @@ }, "dependencies": { "mimic-fn": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.0.0.tgz", - "integrity": "sha512-jbex9Yd/3lmICXwYT6gA/j2mNQGU48wCh/VzRd+/Y/PjYQtlg1gLMdZqvu9s/xH7qKvngxRObl56XZR609IMbA==" + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==" } } }, @@ -13049,9 +13049,9 @@ } }, "nan": { - "version": "2.12.1", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.12.1.tgz", - "integrity": "sha512-JY7V6lRkStKcKTvHO5NVSQRv+RV+FIL5pvDoLiAtSL9pKlC5x9PKQcZDsq7m4FO4d57mkhC6Z+QhAh3Jdk5JFw==" + "version": "2.13.2", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.13.2.tgz", + "integrity": "sha512-TghvYc72wlMGMVMluVo9WRJc0mB8KxxF/gZ4YYFy7V2ZQX9l7rgbPg7vjS9mt6U5HXODVFVI2bOduCzwOMv/lw==" }, "nano-json-stream-parser": { "version": "0.1.2", @@ -13110,9 +13110,9 @@ } }, "node-addon-api": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-1.6.2.tgz", - "integrity": "sha512-479Bjw9nTE5DdBSZZWprFryHGjUaQC31y1wHo19We/k0BZlrmhqQitWoUL0cD8+scljCbIUL+E58oRDEakdGGA==" + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-1.6.3.tgz", + "integrity": "sha512-FXWH6mqjWgU8ewuahp4spec8LkroFZK2NicOv6bNwZC3kcwZUI8LeZdG80UzTSLLhK4T7MsgNwlYDVRlDdfTDg==" }, "node-fetch": { "version": "2.3.0", @@ -13177,9 +13177,9 @@ "integrity": "sha512-UdS4swXs85fCGWWf6t6DMGgpN/vnlKeSGEQ7hJcrs7PBFoxoKLmibc3QRb7fwiYsjdL7PX8iI/TMSlZ90dgHhQ==" }, "node-releases": { - "version": "1.1.10", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.10.tgz", - "integrity": "sha512-KbUPCpfoBvb3oBkej9+nrU0/7xPlVhmhhUJ1PZqwIP5/1dJkRWKWD3OONjo6M2J7tSCBtDCumLwwqeI+DWWaLQ==", + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.13.tgz", + "integrity": "sha512-fKZGviSXR6YvVPyc011NHuJDSD8gFQvLPmc2d2V3BS4gr52ycyQ1Xzs7a8B+Ax3Ni/W+5h1h4SqmzeoA8WZRmA==", "requires": { "semver": "^5.3.0" } @@ -13242,16 +13242,17 @@ } }, "nuxt": { - "version": "2.4.5", - "resolved": "https://registry.npmjs.org/nuxt/-/nuxt-2.4.5.tgz", - "integrity": "sha512-y2p0q58C8yyNr8zg9wEx5ZNhAYe0sbMXHeproGiCKXc2GW7TR6KtZ9/9IBeVlz7HwvoZW+VXIt2m/oecI9IbqQ==", + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/nuxt/-/nuxt-2.6.1.tgz", + "integrity": "sha512-YS1XFerFZAM2C9wTh9zxbKaMrNZDFLWk2WiK9MaBvSMoT24+SXpnRLH550/etwTUVJTp7orjiKGeMLN5d6UwHQ==", "requires": { - "@nuxt/builder": "2.4.5", - "@nuxt/cli": "2.4.5", - "@nuxt/core": "2.4.5", - "@nuxt/generator": "2.4.5", - "@nuxt/opencollective": "^0.2.1", - "@nuxt/webpack": "2.4.5" + "@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", + "@nuxt/opencollective": "^0.2.2", + "@nuxt/webpack": "2.6.1" } }, "nyc": { @@ -14331,9 +14332,9 @@ } }, "object-keys": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.0.tgz", - "integrity": "sha512-6OO5X1+2tYkNyNEx6TsCxEqFfRWaqx6EtMiSbGrw8Ob8v9Ne+Hl8rBAgLBZn5wjEz3s/s6U1WXFUFOcxxAwUpg==" + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" }, "object-visit": { "version": "1.0.1", @@ -14471,9 +14472,9 @@ "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=" }, "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==" + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.1.0.tgz", + "integrity": "sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg==" }, "p-limit": { "version": "2.2.0", @@ -14500,9 +14501,9 @@ } }, "p-try": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.0.0.tgz", - "integrity": "sha512-hMp0onDKIajHfIkdRk3P4CdCmErkYAxxDtP3Wx/4nZ3aGlau2VKh3mZpcuFkH27WQkL/3WBCPOktzA9ZOAnMQQ==" + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==" }, "pako": { "version": "1.0.10", @@ -14528,17 +14529,17 @@ } }, "parent-module": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.0.tgz", - "integrity": "sha512-8Mf5juOMmiE4FcmzYc4IaiS9L3+9paz2KOiXzkRviCP6aDmN49Hz6EMWz0lGNp9pX80GvvAuLADtyGfW/Em3TA==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", "requires": { "callsites": "^3.0.0" }, "dependencies": { "callsites": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.0.0.tgz", - "integrity": "sha512-tWnkwu9YEq2uzlBDI4RcLn8jrFvF9AOi8PxDNU3hZZjJcjkcRAq3vCI+vZcg1SuxISDYe86k9VZFwAxDiJGoAw==" + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==" } } }, @@ -14780,12 +14781,12 @@ } }, "postcss-color-hex-alpha": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/postcss-color-hex-alpha/-/postcss-color-hex-alpha-5.0.2.tgz", - "integrity": "sha512-8bIOzQMGdZVifoBQUJdw+yIY00omBd2EwkJXepQo9cjp1UOHHHoeRDeSzTP6vakEpaRc6GAIOfvcQR7jBYaG5Q==", + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/postcss-color-hex-alpha/-/postcss-color-hex-alpha-5.0.3.tgz", + "integrity": "sha512-PF4GDel8q3kkreVXKLAGNpHKilXsZ6xuu+mOQMHWHLPNyjiUBOr75sp5ZKJfmv1MCus5/DWUGcK9hm6qHEnXYw==", "requires": { - "postcss": "^7.0.2", - "postcss-values-parser": "^2.0.0" + "postcss": "^7.0.14", + "postcss-values-parser": "^2.0.1" } }, "postcss-color-mod-function": { @@ -14817,18 +14818,6 @@ "has": "^1.0.0", "postcss": "^7.0.0", "postcss-value-parser": "^3.0.0" - }, - "dependencies": { - "browserslist": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.4.2.tgz", - "integrity": "sha512-ISS/AIAiHERJ3d45Fz0AVYKkgcy+F/eJHzKEvv1j0wwKGKD9T3BrwKr/5g45L+Y4XIK5PlTqefHciRFcfE1Jxg==", - "requires": { - "caniuse-lite": "^1.0.30000939", - "electron-to-chromium": "^1.3.113", - "node-releases": "^1.1.8" - } - } } }, "postcss-convert-values": { @@ -14841,20 +14830,20 @@ } }, "postcss-custom-media": { - "version": "7.0.7", - "resolved": "https://registry.npmjs.org/postcss-custom-media/-/postcss-custom-media-7.0.7.tgz", - "integrity": "sha512-bWPCdZKdH60wKOTG4HKEgxWnZVjAIVNOJDvi3lkuTa90xo/K0YHa2ZnlKLC5e2qF8qCcMQXt0yzQITBp8d0OFA==", + "version": "7.0.8", + "resolved": "https://registry.npmjs.org/postcss-custom-media/-/postcss-custom-media-7.0.8.tgz", + "integrity": "sha512-c9s5iX0Ge15o00HKbuRuTqNndsJUbaXdiNsksnVH8H4gdc+zbLzr/UasOwNG6CTDpLFekVY4672eWdiiWu2GUg==", "requires": { - "postcss": "^7.0.5" + "postcss": "^7.0.14" } }, "postcss-custom-properties": { - "version": "8.0.9", - "resolved": "https://registry.npmjs.org/postcss-custom-properties/-/postcss-custom-properties-8.0.9.tgz", - "integrity": "sha512-/Lbn5GP2JkKhgUO2elMs4NnbUJcvHX4AaF5nuJDaNkd2chYW1KA5qtOGGgdkBEWcXtKSQfHXzT7C6grEVyb13w==", + "version": "8.0.10", + "resolved": "https://registry.npmjs.org/postcss-custom-properties/-/postcss-custom-properties-8.0.10.tgz", + "integrity": "sha512-GDL0dyd7++goDR4SSasYdRNNvp4Gqy1XMzcCnTijiph7VB27XXpJ8bW/AI0i2VSBZ55TpdGhMr37kMSpRfYD0Q==", "requires": { - "postcss": "^7.0.5", - "postcss-values-parser": "^2.0.0" + "postcss": "^7.0.14", + "postcss-values-parser": "^2.0.1" } }, "postcss-custom-selectors": { @@ -15012,9 +15001,9 @@ } }, "postcss-import-resolver": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/postcss-import-resolver/-/postcss-import-resolver-1.1.0.tgz", - "integrity": "sha512-GPIrMNh1ySSdA+BhTyWEv247KIW7WmPRWzvVMgGYR5YBWXAkj+iCdETmdyVQxakQRSLVTwfUibrOejxegka/OQ==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/postcss-import-resolver/-/postcss-import-resolver-1.2.2.tgz", + "integrity": "sha512-8YVRutQbYvQvuQxZHQaRm3/vi/UvYIGH4HxPvgW0zs4MSWC6rjM77qC6sYP/h8Pzj1j7H8GUOSFHRBZ+umI2ig==", "requires": { "enhanced-resolve": "^3.4.1" } @@ -15111,16 +15100,6 @@ "vendors": "^1.0.0" }, "dependencies": { - "browserslist": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.4.2.tgz", - "integrity": "sha512-ISS/AIAiHERJ3d45Fz0AVYKkgcy+F/eJHzKEvv1j0wwKGKD9T3BrwKr/5g45L+Y4XIK5PlTqefHciRFcfE1Jxg==", - "requires": { - "caniuse-lite": "^1.0.30000939", - "electron-to-chromium": "^1.3.113", - "node-releases": "^1.1.8" - } - }, "postcss-selector-parser": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-3.1.1.tgz", @@ -15164,18 +15143,6 @@ "postcss": "^7.0.0", "postcss-value-parser": "^3.0.0", "uniqs": "^2.0.0" - }, - "dependencies": { - "browserslist": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.4.2.tgz", - "integrity": "sha512-ISS/AIAiHERJ3d45Fz0AVYKkgcy+F/eJHzKEvv1j0wwKGKD9T3BrwKr/5g45L+Y4XIK5PlTqefHciRFcfE1Jxg==", - "requires": { - "caniuse-lite": "^1.0.30000939", - "electron-to-chromium": "^1.3.113", - "node-releases": "^1.1.8" - } - } } }, "postcss-minify-selectors": { @@ -15313,18 +15280,6 @@ "browserslist": "^4.0.0", "postcss": "^7.0.0", "postcss-value-parser": "^3.0.0" - }, - "dependencies": { - "browserslist": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.4.2.tgz", - "integrity": "sha512-ISS/AIAiHERJ3d45Fz0AVYKkgcy+F/eJHzKEvv1j0wwKGKD9T3BrwKr/5g45L+Y4XIK5PlTqefHciRFcfE1Jxg==", - "requires": { - "caniuse-lite": "^1.0.30000939", - "electron-to-chromium": "^1.3.113", - "node-releases": "^1.1.8" - } - } } }, "postcss-normalize-url": { @@ -15424,18 +15379,6 @@ "postcss-replace-overflow-wrap": "^3.0.0", "postcss-selector-matches": "^4.0.0", "postcss-selector-not": "^4.0.0" - }, - "dependencies": { - "browserslist": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.4.2.tgz", - "integrity": "sha512-ISS/AIAiHERJ3d45Fz0AVYKkgcy+F/eJHzKEvv1j0wwKGKD9T3BrwKr/5g45L+Y4XIK5PlTqefHciRFcfE1Jxg==", - "requires": { - "caniuse-lite": "^1.0.30000939", - "electron-to-chromium": "^1.3.113", - "node-releases": "^1.1.8" - } - } } }, "postcss-pseudo-class-any-link": { @@ -15473,18 +15416,6 @@ "caniuse-api": "^3.0.0", "has": "^1.0.0", "postcss": "^7.0.0" - }, - "dependencies": { - "browserslist": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.4.2.tgz", - "integrity": "sha512-ISS/AIAiHERJ3d45Fz0AVYKkgcy+F/eJHzKEvv1j0wwKGKD9T3BrwKr/5g45L+Y4XIK5PlTqefHciRFcfE1Jxg==", - "requires": { - "caniuse-lite": "^1.0.30000939", - "electron-to-chromium": "^1.3.113", - "node-releases": "^1.1.8" - } - } } }, "postcss-reduce-transforms": { @@ -15568,9 +15499,9 @@ }, "dependencies": { "mime": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.0.tgz", - "integrity": "sha512-ikBcWwyqXQSHKtciCcctu9YfPbFYZ4+gbHEmE0Q8jzcTYQg5dHCr3g2wwAZjPoJfQVXZq6KXAjpXOTf5/cjT7w==" + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.2.tgz", + "integrity": "sha512-zJBfZDkwRu+j3Pdd2aHsR5GfH2jIWhmL1ZzBoc+X+3JEti2hbArWcyJ+1laC1D2/U/W1a/+Cegj0/OnEU2ybjg==" } } }, @@ -15600,9 +15531,10 @@ "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=" }, "prettier": { - "version": "1.16.3", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.16.3.tgz", - "integrity": "sha512-kn/GU6SMRYPxUakNXhpP0EedT/KmaPzr0H5lIsDogrykbaxOpOfAFfk5XA7DZrJyMAv1wlMV3CPcZruGXVVUZw==" + "version": "1.16.4", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.16.4.tgz", + "integrity": "sha512-ZzWuos7TI5CKUeQAtFd6Zhm2s6EpAD/ZLApIhsF9pRvRtM1RFo61dM/4MSRUA0SuLugA/zgrZD8m0BaY46Og7g==", + "optional": true }, "pretty-bytes": { "version": "5.1.0", @@ -15653,6 +15585,16 @@ "resolved": "https://registry.npmjs.org/promised-timeout/-/promised-timeout-0.5.1.tgz", "integrity": "sha1-Vr2Y64xZ5ZTa6FVRvFRFHNRYTCM=" }, + "proper-lockfile": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/proper-lockfile/-/proper-lockfile-4.1.1.tgz", + "integrity": "sha512-1w6rxXodisVpn7QYvLk706mzprPTAPCYAqxMvctmPN3ekuRk/kuGkGc82pangZiAt4R3lwSuUzheTTn0/Yb7Zg==", + "requires": { + "graceful-fs": "^4.1.11", + "retry": "^0.12.0", + "signal-exit": "^3.0.2" + } + }, "proxy-addr": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.4.tgz", @@ -15848,6 +15790,19 @@ "regenerate": "^1.4.0" } }, + "regenerator-runtime": { + "version": "0.13.2", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.2.tgz", + "integrity": "sha512-S/TQAZJO+D3m9xeN1WTI8dLKBBiRgXBlTJvbWjCThHWZj9EvHK70Ff50/tYj2J/fvBY6JtFVwRuazHN2E7M9BA==" + }, + "regenerator-transform": { + "version": "0.13.4", + "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.13.4.tgz", + "integrity": "sha512-T0QMBjK3J0MtxjPmdIMXm72Wvj2Abb0Bd4HADdfijwMdoIsyQZ6fWC7kDFhk2YinBBEMZDL7Y7wh0J1sGx3S4A==", + "requires": { + "private": "^0.1.6" + } + }, "regex-not": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", @@ -15867,6 +15822,39 @@ "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==" }, + "regexpu-core": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.5.4.tgz", + "integrity": "sha512-BtizvGtFQKGPUcTy56o3nk1bGRp4SZOTYrDtGNlqCQufptV5IkkLN6Emw+yunAJjzf+C9FQFtvq7IoA3+oMYHQ==", + "requires": { + "regenerate": "^1.4.0", + "regenerate-unicode-properties": "^8.0.2", + "regjsgen": "^0.5.0", + "regjsparser": "^0.6.0", + "unicode-match-property-ecmascript": "^1.0.4", + "unicode-match-property-value-ecmascript": "^1.1.0" + } + }, + "regjsgen": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.5.0.tgz", + "integrity": "sha512-RnIrLhrXCX5ow/E5/Mh2O4e/oa1/jW0eaBKTSy3LaCj+M3Bqvm97GWDp2yUtzIs4LEn65zR2yiYGFqb2ApnzDA==" + }, + "regjsparser": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.0.tgz", + "integrity": "sha512-RQ7YyokLiQBomUJuUG8iGVvkgOLxwyZM8k6d3q5SAXpg4r5TZJZigKFvC6PpD+qQ98bCDC5YelPeA3EucDoNeQ==", + "requires": { + "jsesc": "~0.5.0" + }, + "dependencies": { + "jsesc": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=" + } + } + }, "relateurl": { "version": "0.2.7", "resolved": "https://registry.npmjs.org/relateurl/-/relateurl-0.2.7.tgz", @@ -15959,6 +15947,13 @@ "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": { @@ -16025,6 +16020,11 @@ "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==" }, + "retry": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", + "integrity": "sha1-G0KmJmoh8HQh0bC1S33BZ7AcATs=" + }, "rgb-regex": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/rgb-regex/-/rgb-regex-1.0.1.tgz", @@ -16158,9 +16158,9 @@ } }, "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", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", + "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==" }, "send": { "version": "0.16.2", @@ -16270,9 +16270,9 @@ } }, "setimmediate": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", - "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=" + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.4.tgz", + "integrity": "sha1-IOgd5iLUoCWIzgyNqJc8vPHTE48=" }, "setprototypeof": { "version": "1.1.0", @@ -16910,9 +16910,9 @@ } }, "strip-ansi": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.1.0.tgz", - "integrity": "sha512-TjxrkPONqO2Z8QDCpeE2j6n0M6EwxzyDgzEeGp+FbdvaJAt//ClYi6W5my+3ROlC/hZX2KACUwDfK49Ka5eDvg==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", "requires": { "ansi-regex": "^4.1.0" }, @@ -16972,16 +16972,6 @@ "postcss-selector-parser": "^3.0.0" }, "dependencies": { - "browserslist": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.4.2.tgz", - "integrity": "sha512-ISS/AIAiHERJ3d45Fz0AVYKkgcy+F/eJHzKEvv1j0wwKGKD9T3BrwKr/5g45L+Y4XIK5PlTqefHciRFcfE1Jxg==", - "requires": { - "caniuse-lite": "^1.0.30000939", - "electron-to-chromium": "^1.3.113", - "node-releases": "^1.1.8" - } - }, "postcss-selector-parser": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-3.1.1.tgz", @@ -17034,9 +17024,9 @@ "integrity": "sha1-WPcc7jvVGbWdSyqEO2x95krAR2Q=" }, "svgo": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/svgo/-/svgo-1.2.0.tgz", - "integrity": "sha512-xBfxJxfk4UeVN8asec9jNxHiv3UAMv/ujwBWGYvQhhMb2u3YTGKkiybPcLFDLq7GLLWE9wa73e0/m8L5nTzQbw==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/svgo/-/svgo-1.2.1.tgz", + "integrity": "sha512-Y1+LyT4/y1ms4/0yxPMSlvx6dIbgklE9w8CIOnfeoFGB74MEkq8inSfEr6NhocTaFbyYp0a1dvNgRKGRmEBlzA==", "requires": { "chalk": "^2.4.1", "coa": "^2.0.2", @@ -17045,7 +17035,7 @@ "css-tree": "1.0.0-alpha.28", "css-url-regex": "^1.1.0", "csso": "^3.5.1", - "js-yaml": "^3.12.0", + "js-yaml": "^3.13.0", "mkdirp": "~0.5.1", "object.values": "^1.1.0", "sax": "~1.2.4", @@ -17090,6 +17080,11 @@ "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=" } } }, @@ -17437,9 +17432,9 @@ "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==" }, "tslint": { - "version": "5.14.0", - "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.14.0.tgz", - "integrity": "sha512-IUla/ieHVnB8Le7LdQFRGlVJid2T/gaJe5VkjzRVSRR6pA2ODYrnfR1hmxi+5+au9l50jBwpbBL34txgv4NnTQ==", + "version": "5.15.0", + "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.15.0.tgz", + "integrity": "sha512-6bIEujKR21/3nyeoX2uBnE8s+tMXCQXhqMmaIPJpHmXJoBJPTLcI7/VHRtUwMhnLVdwLqqY3zmd8Dxqa5CVdJA==", "requires": { "babel-code-frame": "^6.22.0", "builtin-modules": "^1.1.1", @@ -17447,7 +17442,7 @@ "commander": "^2.12.1", "diff": "^3.2.0", "glob": "^7.1.1", - "js-yaml": "^3.7.0", + "js-yaml": "^3.13.0", "minimatch": "^3.0.4", "mkdirp": "^0.5.1", "resolve": "^1.3.2", @@ -17490,6 +17485,11 @@ "prelude-ls": "~1.1.2" } }, + "type-fest": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.3.0.tgz", + "integrity": "sha512-fg3sfdDdJDtdHLUpeGsf/fLyG1aapk6zgFiYG5+MDUPybGrJemH4SLk5tP7hGRe8ntxjg0q5LYW53b6YpJIQ9Q==" + }, "type-is": { "version": "1.6.16", "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.16.tgz", @@ -17513,9 +17513,9 @@ } }, "typescript": { - "version": "3.3.3333", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.3.3333.tgz", - "integrity": "sha512-JjSKsAfuHBE/fB2oZ8NxtRTk5iGcg6hkYXMnZ3Wc+b2RSqejEqTaem11mHASMnFilHrax3sLK0GDzcJrekZYLw==" + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.4.2.tgz", + "integrity": "sha512-Og2Vn6Mk7JAuWA1hQdDQN/Ekm/SchX80VzLhjKN9ETYrIepBFAd8PkOdOTK2nKt0FCkmMZKBJvQ1dV1gIxPu/A==" }, "ua-parser-js": { "version": "0.7.19", @@ -17523,18 +17523,18 @@ "integrity": "sha512-T3PVJ6uz8i0HzPxOF9SWzWAlfN/DavlpQqepn22xgve/5QecC+XMCAtmUNnY7C9StehaV6exjUCI801lOI7QlQ==" }, "uglify-js": { - "version": "3.4.9", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.4.9.tgz", - "integrity": "sha512-8CJsbKOtEbnJsTyv6LE6m6ZKniqMiFWmm9sRbopbkGs3gMPPfd3Fh8iIA4Ykv5MgaTbqHr4BaoGLJLZNhsrW1Q==", + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.5.3.tgz", + "integrity": "sha512-rIQPT2UMDnk4jRX+w4WO84/pebU2jiLsjgIyrCktYgSvx28enOE3iYQMr+BD1rHiitWnDmpu0cY/LfIEpKcjcw==", "requires": { - "commander": "~2.17.1", + "commander": "~2.19.0", "source-map": "~0.6.1" }, "dependencies": { "commander": { - "version": "2.17.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.17.1.tgz", - "integrity": "sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg==" + "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", @@ -17562,6 +17562,11 @@ "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.8.3.tgz", "integrity": "sha1-Tz+1OxBuYJf8+ctBCfKl6b36UCI=" }, + "unfetch": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/unfetch/-/unfetch-4.1.0.tgz", + "integrity": "sha512-crP/n3eAPUJxZXM9T80/yv0YhkTEx2K1D3h7D1AJM6fzsWZrxdyRuLN0JH/dkZh1LNH8LxCnBzoPFCPbb2iGpg==" + }, "unicode-canonical-property-names-ecmascript": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz", @@ -17745,9 +17750,9 @@ }, "dependencies": { "mime": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.0.tgz", - "integrity": "sha512-ikBcWwyqXQSHKtciCcctu9YfPbFYZ4+gbHEmE0Q8jzcTYQg5dHCr3g2wwAZjPoJfQVXZq6KXAjpXOTf5/cjT7w==" + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.2.tgz", + "integrity": "sha512-zJBfZDkwRu+j3Pdd2aHsR5GfH2jIWhmL1ZzBoc+X+3JEti2hbArWcyJ+1laC1D2/U/W1a/+Cegj0/OnEU2ybjg==" } } }, @@ -17812,9 +17817,9 @@ "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" }, "uuid": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", - "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-2.0.1.tgz", + "integrity": "sha1-wqMN7bPlNdcsz4LjQ5QaULqFM6w=" }, "v8-compile-cache": { "version": "2.0.2", @@ -17850,9 +17855,9 @@ } }, "vue": { - "version": "2.6.8", - "resolved": "https://registry.npmjs.org/vue/-/vue-2.6.8.tgz", - "integrity": "sha512-+vp9lEC2Kt3yom673pzg1J7T1NVGuGzO9j8Wxno+rQN2WYVBX2pyo/RGQ3fXCLh2Pk76Skw/laAPCuBuEQ4diw==" + "version": "2.6.10", + "resolved": "https://registry.npmjs.org/vue/-/vue-2.6.10.tgz", + "integrity": "sha512-ImThpeNU9HbdZL3utgMCq0oiMzAkt1mcgy3/E6zWC/G6AaQoeuFdsl9nDhTDU3X1R6FK7nsIUuRACVcjI+A2GQ==" }, "vue-hot-reload-api": { "version": "2.3.3", @@ -17872,11 +17877,11 @@ } }, "vue-meta": { - "version": "1.5.8", - "resolved": "https://registry.npmjs.org/vue-meta/-/vue-meta-1.5.8.tgz", - "integrity": "sha512-cF/ADL1kA8Gn6wfSx0+kYIPAmJ49y9R0QlMS9tg5ddDDZWaZMZ0rveFWaTOKr0eabUV/H3D9ip68Xt9f5SFbyA==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/vue-meta/-/vue-meta-1.6.0.tgz", + "integrity": "sha512-LLHejsOYbJiSEDSgZvjHB3fFY7lUxsDFLkuSqf5eBohEvhhddBTOHa3heoFTcI5sxsZSZt26uUzoLVe4CT6Y4A==", "requires": { - "deepmerge": "^3.0.0", + "deepmerge": "^3.2.0", "lodash.isplainobject": "^4.0.6", "lodash.uniqueid": "^4.0.1", "object-assign": "^4.1.1" @@ -17893,9 +17898,9 @@ "integrity": "sha512-opKtsxjp9eOcFWdp6xLQPLmRGgfM932Tl56U9chYTnoWqKxQ8M20N7AkdEbM5beUh6wICoFGYugAX9vQjyJLFg==" }, "vue-server-renderer": { - "version": "2.6.8", - "resolved": "https://registry.npmjs.org/vue-server-renderer/-/vue-server-renderer-2.6.8.tgz", - "integrity": "sha512-aiN2Fz3Sw35KRDQYqSSdsWjOtYcDWpm8rjcf3oSf/iiwFF/i1Q9UjDWvxQv4mbqVRBXGhdoICClQ005IZJoVbQ==", + "version": "2.6.10", + "resolved": "https://registry.npmjs.org/vue-server-renderer/-/vue-server-renderer-2.6.10.tgz", + "integrity": "sha512-UYoCEutBpKzL2fKCwx8zlRtRtwxbPZXKTqbl2iIF4yRZUNO/ovrHyDAJDljft0kd+K0tZhN53XRHkgvCZoIhug==", "requires": { "chalk": "^1.1.3", "hash-sum": "^1.0.2", @@ -17959,9 +17964,9 @@ } }, "vue-template-compiler": { - "version": "2.6.8", - "resolved": "https://registry.npmjs.org/vue-template-compiler/-/vue-template-compiler-2.6.8.tgz", - "integrity": "sha512-SwWKANE5ee+oJg+dEJmsdxsxWYICPsNwk68+1AFjOS8l0O/Yz2845afuJtFqf3UjS/vXG7ECsPeHHEAD65Cjng==", + "version": "2.6.10", + "resolved": "https://registry.npmjs.org/vue-template-compiler/-/vue-template-compiler-2.6.10.tgz", + "integrity": "sha512-jVZkw4/I/HT5ZMvRnhv78okGusqe0+qH2A0Em0Cp8aq78+NK9TII263CDVz2QXZsIT+yyV/gZc/j/vlwa+Epyg==", "requires": { "de-indent": "^1.0.2", "he": "^1.1.0" @@ -18122,6 +18127,20 @@ "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", @@ -18131,11 +18150,6 @@ "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=" } } }, @@ -18312,9 +18326,9 @@ } }, "webpack-bundle-analyzer": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/webpack-bundle-analyzer/-/webpack-bundle-analyzer-3.1.0.tgz", - "integrity": "sha512-nyDyWEs7C6DZlgvu1pR1zzJfIWSiGPbtaByZr8q+Fd2xp70FuM/8ngCJzj3Er1TYRLSFmp1F1OInbEm4DZH8NA==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/webpack-bundle-analyzer/-/webpack-bundle-analyzer-3.2.0.tgz", + "integrity": "sha512-F6bwrg5TBb9HsHZCltH1L5F091ELQ+/i67MEH7jWkYRvVp53eONNneGaIXSdOQUiXUyd3RnkITWRfWvSVQGnZQ==", "requires": { "acorn": "^6.0.7", "acorn-walk": "^6.1.1", @@ -18332,9 +18346,9 @@ }, "dependencies": { "ws": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.0.tgz", - "integrity": "sha512-deZYUNlt2O4buFCa3t5bKLf8A7FPP/TVjwOeVNpw818Ma5nk4MLXls2eoEGS39o8119QIYxTrTDoPQ5B/gTD6w==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.1.tgz", + "integrity": "sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA==", "requires": { "async-limiter": "~1.0.0" } @@ -18342,9 +18356,9 @@ } }, "webpack-cli": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-3.2.3.tgz", - "integrity": "sha512-Ik3SjV6uJtWIAN5jp5ZuBMWEAaP5E4V78XJ2nI+paFPh8v4HPSwo/myN0r29Xc/6ZKnd2IdrAlpSgNOu2CDQ6Q==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-3.3.0.tgz", + "integrity": "sha512-t1M7G4z5FhHKJ92WRKwZ1rtvi7rHc0NZoZRbSkol0YKl4HvcC8+DsmGDmK7MmZxHSAetHagiOsjOB6MmzC2TUw==", "requires": { "chalk": "^2.4.1", "cross-spawn": "^6.0.5", @@ -18356,7 +18370,7 @@ "loader-utils": "^1.1.0", "supports-color": "^5.5.0", "v8-compile-cache": "^2.0.2", - "yargs": "^12.0.4" + "yargs": "^12.0.5" }, "dependencies": { "enhanced-resolve": { @@ -18372,9 +18386,9 @@ } }, "webpack-dev-middleware": { - "version": "3.6.1", - "resolved": "https://registry.npmjs.org/webpack-dev-middleware/-/webpack-dev-middleware-3.6.1.tgz", - "integrity": "sha512-XQmemun8QJexMEvNFbD2BIg4eSKrmSIMrTfnl2nql2Sc6OGAYFyb8rwuYrCjl/IiEYYuyTEiimMscu7EXji/Dw==", + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/webpack-dev-middleware/-/webpack-dev-middleware-3.6.2.tgz", + "integrity": "sha512-A47I5SX60IkHrMmZUlB0ZKSWi29TZTcPz7cha1Z75yYOsgWh/1AcPmQEbC8ZIbU3A1ytSv1PMU0PyPz2Lmz2jg==", "requires": { "memory-fs": "^0.4.1", "mime": "^2.3.1", @@ -18383,9 +18397,9 @@ }, "dependencies": { "mime": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.0.tgz", - "integrity": "sha512-ikBcWwyqXQSHKtciCcctu9YfPbFYZ4+gbHEmE0Q8jzcTYQg5dHCr3g2wwAZjPoJfQVXZq6KXAjpXOTf5/cjT7w==" + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.2.tgz", + "integrity": "sha512-zJBfZDkwRu+j3Pdd2aHsR5GfH2jIWhmL1ZzBoc+X+3JEti2hbArWcyJ+1laC1D2/U/W1a/+Cegj0/OnEU2ybjg==" } } }, @@ -18422,6 +18436,13 @@ "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": { @@ -18617,11 +18638,6 @@ "write-file-atomic": "^2.0.0" }, "dependencies": { - "detect-indent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-5.0.0.tgz", - "integrity": "sha1-OHHMCmoALow+Wzz38zYmRnXwa50=" - }, "pify": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", diff --git a/common/config/rush/version-policies.json b/common/config/rush/version-policies.json index 8d6b06e2d..ea25ca995 100644 --- a/common/config/rush/version-policies.json +++ b/common/config/rush/version-policies.json @@ -2,7 +2,7 @@ { "policyName": "patchAll", "definitionName": "lockStepVersion", - "version": "1.1.0-alpha0", + "version": "1.2.0", "nextBump": "patch" } ] diff --git a/conventions/.vuepress/package-lock.json b/conventions/.vuepress/package-lock.json index 5dbbf61df..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.1.0-alpha0" + "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.1.0-alpha0", + "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.1.0-alpha0", - "uniq": "^1.1.0-alpha0" + "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.1.0-alpha03", + "portfinder": "^1.2.03", "postcss-loader": "^2.1.5", "toml": "^2.3.3", - "url-loader": "^1.1.0-alpha0", + "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.1.0-alpha0", - "resolved": "https://registry.npmjs.org/ajv-errors/-/ajv-errors-1.1.0-alpha0.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.1.0-alpha01", + "object-keys": "^1.2.01", "querystring-es3": "^0.2.1", - "reduce": "^1.1.0-alpha0", + "reduce": "^1.2.0", "semver": "^5.1.0", "tunnel-agent": "^0.6.0" }, @@ -1343,8 +1343,8 @@ "integrity": "sha1-l6ERlkmyEa0zaR2fn0hqjsn74KM=" }, "amdefine": { - "version": "1.1.0-alpha0", - "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.1.0-alpha0.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.1.0-alpha0" + "remove-trailing-separator": "^1.2.0" } } } @@ -1400,8 +1400,8 @@ "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==" }, "argparse": { - "version": "1.1.0-alpha00", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.1.0-alpha00.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.1.0-alpha0" + "array-uniq": "^1.2.0" } }, "array-uniq": { @@ -1446,8 +1446,8 @@ "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=" }, "arrify": { - "version": "1.1.0-alpha0", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.1.0-alpha0.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.1.0-alpha0", - "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.1.0-alpha0.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.1.0-alpha0", + "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.1.0-alpha0", + "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.1.0-alpha0", - "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.1.0-alpha0.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.1.0-alpha0", + "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.1.0-alpha0", + "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.1.0-alpha0", - "promise-inflight": "^1.1.0-alpha0", + "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.1.0-alpha0", - "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.1.0-alpha0.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.1.0-alpha0", - "resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.1.0-alpha0.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.1.0-alpha0", + "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.1.0-alpha0" + "has": "^1.2.0" } }, "colors": { @@ -2349,8 +2349,8 @@ "dev": true }, "commondir": { - "version": "1.1.0-alpha0", - "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.1.0-alpha0.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.1.0-alpha0", + "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.1.0-alpha0", + "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.1.0-alpha0", + "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.1.0-alpha0", + "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.1.0-alpha0" + "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.1.0-alpha0", + "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.1.0-alpha0", + "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.1.0-alpha0", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.1.0-alpha0.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.1.0-alpha02" + "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.1.0-alpha0", + "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.1.0-alpha0", + "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.1.0-alpha0", + "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.1.0-alpha0", + "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.1.0-alpha0" + "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.1.0-alpha02" + "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.1.0-alpha0", + "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.1.0-alpha0", + "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.1.0-alpha0", + "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.1.0-alpha0" + "is-extendable": "^1.2.0" }, "dependencies": { "is-extendable": { - "version": "1.1.0-alpha0", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.1.0-alpha0.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.1.0-alpha0", + "commondir": "^1.2.0", "make-dir": "^1.0.0", "pkg-dir": "^3.0.0" } @@ -3844,8 +3844,8 @@ } }, "fs-write-stream-atomic": { - "version": "1.1.0-alpha00", - "resolved": "https://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.1.0-alpha00.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.1.0-alpha0", + "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.1.0-alpha0" + "npm-bundled": "^1.2.0" } }, "npmlog": { @@ -4154,7 +4154,7 @@ } }, "number-is-nan": { - "version": "1.1.0-alpha0", + "version": "1.2.0", "bundled": true, "optional": true }, @@ -4191,7 +4191,7 @@ } }, "path-is-absolute": { - "version": "1.1.0-alpha0", + "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.1.0-alpha0" + "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.1.0-alpha0", + "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.1.0-alpha0" + "minimalistic-assert": "^1.2.0" } }, "he": { @@ -4588,13 +4588,13 @@ "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==" }, "hmac-drbg": { - "version": "1.1.0-alpha0", - "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.1.0-alpha0.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.1.0-alpha0" + "minimalistic-crypto-utils": "^1.2.0" } }, "hoek": { @@ -4609,7 +4609,7 @@ "integrity": "sha1-TNnhq9QpQUbnZ55B14mHMrAse/0=", "requires": { "mkdirp": "0.3.0", - "nopt": "1.1.0-alpha00" + "nopt": "1.2.00" }, "dependencies": { "mkdirp": { @@ -4679,7 +4679,7 @@ "requires": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", - "util-deprecate": "^1.1.0-alpha0" + "util-deprecate": "^1.2.0" } } } @@ -4813,8 +4813,8 @@ "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=" }, "indexes-of": { - "version": "1.1.0-alpha0", - "resolved": "https://registry.npmjs.org/indexes-of/-/indexes-of-1.1.0-alpha0.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.1.0-alpha0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.1.0-alpha0.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.1.0-alpha0", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.1.0-alpha0.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.1.0-alpha0", - "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.1.0-alpha0.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.1.0-alpha0", - "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.1.0-alpha0.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.1.0-alpha0", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.1.0-alpha0.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.1.0-alpha0" + "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.1.0-alpha0" + "has": "^1.2.0" } }, "is-regexp": { @@ -5242,8 +5242,8 @@ } }, "killable": { - "version": "1.1.0-alpha0", - "resolved": "https://registry.npmjs.org/killable/-/killable-1.1.0-alpha0.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.1.0-alpha0" + "uc.micro": "^1.2.0" } }, "load-script": { @@ -5293,12 +5293,12 @@ "requires": { "big.js": "^5.2.2", "emojis-list": "^2.0.0", - "json5": "^1.1.0-alpha0" + "json5": "^1.2.0" }, "dependencies": { "json5": { - "version": "1.1.0-alpha0", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.1.0-alpha0.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.1.0-alpha0", + "mdurl": "^1.2.0", "uc.micro": "^1.0.5" } }, @@ -5517,8 +5517,8 @@ } }, "mdurl": { - "version": "1.1.0-alpha0", - "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.1.0-alpha0.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.1.0-alpha0", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.1.0-alpha0.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.1.0-alpha0" + "brorand": "^1.2.0" } }, "mime": { @@ -5658,13 +5658,13 @@ } }, "minimalistic-assert": { - "version": "1.1.0-alpha0", - "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.1.0-alpha0.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.1.0-alpha0", - "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.1.0-alpha0.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.1.0-alpha0" + "is-extendable": "^1.2.0" }, "dependencies": { "is-extendable": { - "version": "1.1.0-alpha0", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.1.0-alpha0.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.1.0-alpha0", - "resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.1.0-alpha0.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.1.0-alpha00", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.1.0-alpha00.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.1.0-alpha0", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.1.0-alpha0.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.1.0-alpha0", - "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.1.0-alpha0.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.1.0-alpha01" + "object-keys": "^1.2.01" } }, "object.getownpropertydescriptors": { @@ -6115,8 +6115,8 @@ "integrity": "sha512-hMp0onDKIajHfIkdRk3P4CdCmErkYAxxDtP3Wx/4nZ3aGlau2VKh3mZpcuFkH27WQkL/3WBCPOktzA9ZOAnMQQ==" }, "pako": { - "version": "1.1.0-alpha00", - "resolved": "https://registry.npmjs.org/pako/-/pako-1.1.0-alpha00.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.1.0-alpha0" + "json-parse-better-errors": "^1.2.0" } }, "parseurl": { @@ -6185,8 +6185,8 @@ "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=" }, "path-is-absolute": { - "version": "1.1.0-alpha0", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.1.0-alpha0.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.1.0-alpha0", + "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.1.0-alpha0", + "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.1.0-alpha0", + "has": "^1.2.0", "postcss": "^5.0.14", "postcss-selector-parser": "^2.0.0" }, @@ -7563,8 +7563,8 @@ } }, "postcss-reduce-initial": { - "version": "1.1.0-alpha0", - "resolved": "https://registry.npmjs.org/postcss-reduce-initial/-/postcss-reduce-initial-1.1.0-alpha0.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.1.0-alpha0", + "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.1.0-alpha0", - "uniq": "^1.1.0-alpha0" + "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.1.0-alpha0", + "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.1.0-alpha0", + "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.1.0-alpha0", - "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.1.0-alpha0.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.1.0-alpha0", - "resolved": "https://registry.npmjs.org/prr/-/prr-1.1.0-alpha0.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.1.0-alpha0" + "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.1.0-alpha0" + "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.1.0-alpha0", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.1.0-alpha0.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.1.0-alpha0" + "util-deprecate": "^1.2.0" } } } @@ -8976,7 +8976,7 @@ "dev": true, "requires": { "get-own-enumerable-property-symbols": "^3.0.0", - "is-obj": "^1.1.0-alpha0", + "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.1.0-alpha0", + "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.1.0-alpha0", - "promise-inflight": "^1.1.0-alpha0", + "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.1.0-alpha0", - "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.1.0-alpha0.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.1.0-alpha0", - "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.1.0-alpha0.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.1.0-alpha0", - "resolved": "https://registry.npmjs.org/uniq/-/uniq-1.1.0-alpha0.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.1.0-alpha0", - "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.1.0-alpha0.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.1.0-alpha0", + "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.1.0-alpha0", + "get-caller-file": "^1.2.0", "os-locale": "^3.0.0", "require-directory": "^2.1.1", - "require-main-filename": "^1.1.0-alpha0", + "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 c2af1a045..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=107)}({107:function(e,t,n){window.$0xcert=window.$0xcert||{},Object.assign(window.$0xcert,n(93))},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}},93: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(94))},94: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(95),r=n(16),s=n(97);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},95: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(96))},96: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})}}},97: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(6)),n(r(29)),n(r(7)),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});const n=r(8);e.normalizeAddress=function(t){return t?n.getAddress(t):null}},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(9)),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,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,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,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(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,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(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,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(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,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(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,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(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,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(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,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(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,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(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,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,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(9)),a=r(2),h=r(11),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(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,z,V,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,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,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,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<,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^~lt&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]=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(8),u=r(10),a=r(2),h=r(40),l=r(11),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,z,V,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,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,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,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<,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^~lt&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]=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(10);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(5),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._startedthis.normalizeAddress(t))}get orderGatewayId(){return this._orderGatewayId||null}set orderGatewayId(t){this._orderGatewayId=this.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.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.normalizeAddress(t)}isUnsafeRecipientId(t){const e=this.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}normalizeAddress(t){return i.normalizeAddress(t)}}},,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(50))},,,function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new 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(51),u=r(52),a=r(53),h=r(54),l=r(55),c=r(56),d=r(57),f=r(58),p=r(59),v=r(60),m=r(61),y=r(62),g=r(63),w=r(64),M=r(65),_=r(66),b=r(68),A=r(69),E=r(70),x=r(71),T=r(72),N=r(73),I=r(74),P=r(75);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=this.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=this.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.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.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.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.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.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=this.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.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=this.normalizeAddress(t.senderId),r=this.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.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.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.normalizeAddress(t),e=this.normalizeAddress(e),I.default(this,t,e)})}getProxyId(){return-1===this.provider.unsafeRecipientIds.indexOf(this.id)?3:2}normalizeAddress(t){return i.normalizeAddress(t)}}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(45),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(67),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(45),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(47))}]); \ 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 38daa6378..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=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(30)),n(r(5)),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(7)),n(r(6)),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(6)),n(r(29)),n(r(7)),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});const n=r(8);e.normalizeAddress=function(t){return t?n.getAddress(t):null}},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(9)),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(9)),a=r(2),h=r(11),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(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(8),u=r(10),a=r(2),h=r(40),l=r(11),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(10);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(5),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._startedthis.normalizeAddress(t))}get orderGatewayId(){return this._orderGatewayId||null}set orderGatewayId(t){this._orderGatewayId=this.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.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.normalizeAddress(t)}isUnsafeRecipientId(t){const e=this.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}normalizeAddress(t){return i.normalizeAddress(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(1)),n(r(99))},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},,,,,,,,,,function(t,e,r){window.$0xcert=window.$0xcert||{},Object.assign(window.$0xcert,r(98))}]); \ 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 f397c5738..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(i){if(e[i])return e[i].exports;var n=e[i]={i:i,l:!1,exports:{}};return t[i].call(n.exports,n,n.exports,r),n.l=!0,n.exports}r.m=t,r.c=e,r.d=function(t,e,i){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},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 i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)r.d(i,n,function(e){return t[e]}.bind(null,n));return i},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=110)}([function(t,e,r){"use strict";function i(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),i(r(30)),i(r(5)),i(r(41))},function(t,e,r){"use strict";function i(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),i(r(7)),i(r(6)),i(r(12)),i(r(42)),i(r(43)),i(r(14))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(4);function n(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&&i.throwError("cannot convert null value to array",i.INVALID_ARGUMENT,{arg:"value",value:t}),n(t)&&(t=t.toHexString()),"string"==typeof t){var e=t.match(/^(0x)?[0-9a-fA-F]*$/);e||i.throwError("invalid hexidecimal string",i.INVALID_ARGUMENT,{arg:"value",value:t}),"0x"!==e[1]&&i.throwError("hex string must have 0x prefix",i.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 i.throwError("invalid hexlify value",null,{arg:"value",value:t}),"never"}function f(t,e){for(h(t)||i.throwError("invalid hex string",i.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,n="0x",o="0x";if((e=t)&&null!=e.r&&null!=e.s){null==t.v&&null==t.recoveryParam&&i.throwError("at least on of recoveryParam or v must be specified",i.INVALID_ARGUMENT,{argument:"signature",value:t}),n=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");n=c(a.slice(0,32)),o=c(a.slice(32,64)),27!==(r=a[64])&&28!==r&&(r=27+r%2)}return{r:n,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)||i.throwError("invalid hex data",i.INVALID_ARGUMENT,{arg:"value",value:t}),t.length%2!=0&&i.throwError("hex data length must be even",i.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)||i.throwError("invalid hex string",i.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 i(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),i(r(6)),i(r(29)),i(r(7)),i(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 i=!1,n=!1;function o(t,r,i){if(n)throw new Error("unknown error");r||(r=e.UNKNOWN_ERROR),i||(i={});var o=[];Object.keys(i).forEach(function(t){try{o.push(t+"="+JSON.stringify(i[t]))}catch(e){o.push(t+"="+JSON.stringify(i[t].toString()))}});var s=t;o.length&&(t+=" ("+o.join(", ")+")");var u=new Error(t);throw u.reason=s,u.code=r,Object.keys(i).forEach(function(t){u[t]=i[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,i){i||(i=""),tr&&o("too many arguments"+i,e.UNEXPECTED_ARGUMENT,{count:t,expectedCount:r})},e.setCensorship=function(t,r){i&&o("error censorship permanent",e.UNSUPPORTED_OPERATION,{operation:"setCersorship"}),n=!!t,i=!!r}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=r(8);e.normalizeAddress=function(t){return t?i.getAddress(t):null}},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 i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var n=i(r(9)),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),i=0;i<40;i++)r[i]=e[i].charCodeAt(0);r=o.arrayify(s.keccak256(r));for(var n=0;n<40;n+=2)r[n>>1]>>4>=8&&(e[n]=e[n].toUpperCase()),(15&r[n>>1])>=8&&(e[n+1]=e[n+1].toUpperCase());return"0x"+e.join("")}for(var l={},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 i=String(98-parseInt(e,10)%97);i.length<2;)i="0"+i;return i}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 n.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 n.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 i(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s=r(33).Buffer}catch(t){}function u(t,e,r){for(var i=0,n=Math.min(t.length,r),o=e;o=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return i}function a(t,e,r,i){for(var n=0,o=Math.min(t.length,r),s=e;s=49?u-49+10:u>=17?u-17+10:u}return n}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&n++,16===e?this._parseHex(t,n):this._parseBase(t,e,n),"-"===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):(i(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(i("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 n=0;n=0;n-=3)s=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=s<>>26-u&67108863,(u+=24)>=26&&(u-=26,o++);else if("le"===r)for(n=0,o=0;n>>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)n=u(t,r,r+6),this.words[i]|=n<>>26-o&4194303,(o+=24)>=26&&(o-=26,i++);r+6!==e&&(n=u(t,e,r+6),this.words[i]|=n<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,s=o%i,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 i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,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=(n=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 n=0,o=0,s=0;s>>24-n&16777215)||s!==this.length-1?h[6-a.length]+a+r:a+r,(n+=2)>=26&&(n-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var 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}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return i(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var s,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 i=0;it.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,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,it=et>>>13,nt=0|u[6],ot=8191&nt,st=nt>>>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+(i=Math.imul(c,F))|0)+((8191&(n=(n=Math.imul(c,V))+Math.imul(f,F)|0))<<13)|0;h=((o=Math.imul(f,V))+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(p,F),n=(n=Math.imul(p,V))+Math.imul(m,F)|0,o=Math.imul(m,V);var gt=(h+(i=i+Math.imul(c,z)|0)|0)+((8191&(n=(n=n+Math.imul(c,q)|0)+Math.imul(f,z)|0))<<13)|0;h=((o=o+Math.imul(f,q)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(g,F),n=(n=Math.imul(g,V))+Math.imul(y,F)|0,o=Math.imul(y,V),i=i+Math.imul(p,z)|0,n=(n=n+Math.imul(p,q)|0)+Math.imul(m,z)|0,o=o+Math.imul(m,q)|0;var yt=(h+(i=i+Math.imul(c,K)|0)|0)+((8191&(n=(n=n+Math.imul(c,$)|0)+Math.imul(f,K)|0))<<13)|0;h=((o=o+Math.imul(f,$)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(M,F),n=(n=Math.imul(M,V))+Math.imul(_,F)|0,o=Math.imul(_,V),i=i+Math.imul(g,z)|0,n=(n=n+Math.imul(g,q)|0)+Math.imul(y,z)|0,o=o+Math.imul(y,q)|0,i=i+Math.imul(p,K)|0,n=(n=n+Math.imul(p,$)|0)+Math.imul(m,K)|0,o=o+Math.imul(m,$)|0;var wt=(h+(i=i+Math.imul(c,J)|0)|0)+((8191&(n=(n=n+Math.imul(c,X)|0)+Math.imul(f,J)|0))<<13)|0;h=((o=o+Math.imul(f,X)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(E,F),n=(n=Math.imul(E,V))+Math.imul(A,F)|0,o=Math.imul(A,V),i=i+Math.imul(M,z)|0,n=(n=n+Math.imul(M,q)|0)+Math.imul(_,z)|0,o=o+Math.imul(_,q)|0,i=i+Math.imul(g,K)|0,n=(n=n+Math.imul(g,$)|0)+Math.imul(y,K)|0,o=o+Math.imul(y,$)|0,i=i+Math.imul(p,J)|0,n=(n=n+Math.imul(p,X)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,X)|0;var Mt=(h+(i=i+Math.imul(c,Q)|0)|0)+((8191&(n=(n=n+Math.imul(c,tt)|0)+Math.imul(f,Q)|0))<<13)|0;h=((o=o+Math.imul(f,tt)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(T,F),n=(n=Math.imul(T,V))+Math.imul(I,F)|0,o=Math.imul(I,V),i=i+Math.imul(E,z)|0,n=(n=n+Math.imul(E,q)|0)+Math.imul(A,z)|0,o=o+Math.imul(A,q)|0,i=i+Math.imul(M,K)|0,n=(n=n+Math.imul(M,$)|0)+Math.imul(_,K)|0,o=o+Math.imul(_,$)|0,i=i+Math.imul(g,J)|0,n=(n=n+Math.imul(g,X)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,X)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var _t=(h+(i=i+Math.imul(c,rt)|0)|0)+((8191&(n=(n=n+Math.imul(c,it)|0)+Math.imul(f,rt)|0))<<13)|0;h=((o=o+Math.imul(f,it)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(S,F),n=(n=Math.imul(S,V))+Math.imul(R,F)|0,o=Math.imul(R,V),i=i+Math.imul(T,z)|0,n=(n=n+Math.imul(T,q)|0)+Math.imul(I,z)|0,o=o+Math.imul(I,q)|0,i=i+Math.imul(E,K)|0,n=(n=n+Math.imul(E,$)|0)+Math.imul(A,K)|0,o=o+Math.imul(A,$)|0,i=i+Math.imul(M,J)|0,n=(n=n+Math.imul(M,X)|0)+Math.imul(_,J)|0,o=o+Math.imul(_,X)|0,i=i+Math.imul(g,Q)|0,n=(n=n+Math.imul(g,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,it)|0;var bt=(h+(i=i+Math.imul(c,ot)|0)|0)+((8191&(n=(n=n+Math.imul(c,st)|0)+Math.imul(f,ot)|0))<<13)|0;h=((o=o+Math.imul(f,st)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(L,F),n=(n=Math.imul(L,V))+Math.imul(P,F)|0,o=Math.imul(P,V),i=i+Math.imul(S,z)|0,n=(n=n+Math.imul(S,q)|0)+Math.imul(R,z)|0,o=o+Math.imul(R,q)|0,i=i+Math.imul(T,K)|0,n=(n=n+Math.imul(T,$)|0)+Math.imul(I,K)|0,o=o+Math.imul(I,$)|0,i=i+Math.imul(E,J)|0,n=(n=n+Math.imul(E,X)|0)+Math.imul(A,J)|0,o=o+Math.imul(A,X)|0,i=i+Math.imul(M,Q)|0,n=(n=n+Math.imul(M,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,i=i+Math.imul(g,rt)|0,n=(n=n+Math.imul(g,it)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,it)|0,i=i+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var Et=(h+(i=i+Math.imul(c,at)|0)|0)+((8191&(n=(n=n+Math.imul(c,ht)|0)+Math.imul(f,at)|0))<<13)|0;h=((o=o+Math.imul(f,ht)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(C,F),n=(n=Math.imul(C,V))+Math.imul(U,F)|0,o=Math.imul(U,V),i=i+Math.imul(L,z)|0,n=(n=n+Math.imul(L,q)|0)+Math.imul(P,z)|0,o=o+Math.imul(P,q)|0,i=i+Math.imul(S,K)|0,n=(n=n+Math.imul(S,$)|0)+Math.imul(R,K)|0,o=o+Math.imul(R,$)|0,i=i+Math.imul(T,J)|0,n=(n=n+Math.imul(T,X)|0)+Math.imul(I,J)|0,o=o+Math.imul(I,X)|0,i=i+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,tt)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,tt)|0,i=i+Math.imul(M,rt)|0,n=(n=n+Math.imul(M,it)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,it)|0,i=i+Math.imul(g,ot)|0,n=(n=n+Math.imul(g,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0,i=i+Math.imul(p,at)|0,n=(n=n+Math.imul(p,ht)|0)+Math.imul(m,at)|0,o=o+Math.imul(m,ht)|0;var At=(h+(i=i+Math.imul(c,ct)|0)|0)+((8191&(n=(n=n+Math.imul(c,ft)|0)+Math.imul(f,ct)|0))<<13)|0;h=((o=o+Math.imul(f,ft)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(G,F),n=(n=Math.imul(G,V))+Math.imul(D,F)|0,o=Math.imul(D,V),i=i+Math.imul(C,z)|0,n=(n=n+Math.imul(C,q)|0)+Math.imul(U,z)|0,o=o+Math.imul(U,q)|0,i=i+Math.imul(L,K)|0,n=(n=n+Math.imul(L,$)|0)+Math.imul(P,K)|0,o=o+Math.imul(P,$)|0,i=i+Math.imul(S,J)|0,n=(n=n+Math.imul(S,X)|0)+Math.imul(R,J)|0,o=o+Math.imul(R,X)|0,i=i+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,tt)|0,i=i+Math.imul(E,rt)|0,n=(n=n+Math.imul(E,it)|0)+Math.imul(A,rt)|0,o=o+Math.imul(A,it)|0,i=i+Math.imul(M,ot)|0,n=(n=n+Math.imul(M,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,i=i+Math.imul(g,at)|0,n=(n=n+Math.imul(g,ht)|0)+Math.imul(y,at)|0,o=o+Math.imul(y,ht)|0,i=i+Math.imul(p,ct)|0,n=(n=n+Math.imul(p,ft)|0)+Math.imul(m,ct)|0,o=o+Math.imul(m,ft)|0;var Nt=(h+(i=i+Math.imul(c,pt)|0)|0)+((8191&(n=(n=n+Math.imul(c,mt)|0)+Math.imul(f,pt)|0))<<13)|0;h=((o=o+Math.imul(f,mt)|0)+(n>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,i=Math.imul(G,z),n=(n=Math.imul(G,q))+Math.imul(D,z)|0,o=Math.imul(D,q),i=i+Math.imul(C,K)|0,n=(n=n+Math.imul(C,$)|0)+Math.imul(U,K)|0,o=o+Math.imul(U,$)|0,i=i+Math.imul(L,J)|0,n=(n=n+Math.imul(L,X)|0)+Math.imul(P,J)|0,o=o+Math.imul(P,X)|0,i=i+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,i=i+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(I,rt)|0,o=o+Math.imul(I,it)|0,i=i+Math.imul(E,ot)|0,n=(n=n+Math.imul(E,st)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,st)|0,i=i+Math.imul(M,at)|0,n=(n=n+Math.imul(M,ht)|0)+Math.imul(_,at)|0,o=o+Math.imul(_,ht)|0,i=i+Math.imul(g,ct)|0,n=(n=n+Math.imul(g,ft)|0)+Math.imul(y,ct)|0,o=o+Math.imul(y,ft)|0;var Tt=(h+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;h=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(G,K),n=(n=Math.imul(G,$))+Math.imul(D,K)|0,o=Math.imul(D,$),i=i+Math.imul(C,J)|0,n=(n=n+Math.imul(C,X)|0)+Math.imul(U,J)|0,o=o+Math.imul(U,X)|0,i=i+Math.imul(L,Q)|0,n=(n=n+Math.imul(L,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,i=i+Math.imul(S,rt)|0,n=(n=n+Math.imul(S,it)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,it)|0,i=i+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,st)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,st)|0,i=i+Math.imul(E,at)|0,n=(n=n+Math.imul(E,ht)|0)+Math.imul(A,at)|0,o=o+Math.imul(A,ht)|0,i=i+Math.imul(M,ct)|0,n=(n=n+Math.imul(M,ft)|0)+Math.imul(_,ct)|0,o=o+Math.imul(_,ft)|0;var It=(h+(i=i+Math.imul(g,pt)|0)|0)+((8191&(n=(n=n+Math.imul(g,mt)|0)+Math.imul(y,pt)|0))<<13)|0;h=((o=o+Math.imul(y,mt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(G,J),n=(n=Math.imul(G,X))+Math.imul(D,J)|0,o=Math.imul(D,X),i=i+Math.imul(C,Q)|0,n=(n=n+Math.imul(C,tt)|0)+Math.imul(U,Q)|0,o=o+Math.imul(U,tt)|0,i=i+Math.imul(L,rt)|0,n=(n=n+Math.imul(L,it)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,it)|0,i=i+Math.imul(S,ot)|0,n=(n=n+Math.imul(S,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,i=i+Math.imul(T,at)|0,n=(n=n+Math.imul(T,ht)|0)+Math.imul(I,at)|0,o=o+Math.imul(I,ht)|0,i=i+Math.imul(E,ct)|0,n=(n=n+Math.imul(E,ft)|0)+Math.imul(A,ct)|0,o=o+Math.imul(A,ft)|0;var xt=(h+(i=i+Math.imul(M,pt)|0)|0)+((8191&(n=(n=n+Math.imul(M,mt)|0)+Math.imul(_,pt)|0))<<13)|0;h=((o=o+Math.imul(_,mt)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(G,Q),n=(n=Math.imul(G,tt))+Math.imul(D,Q)|0,o=Math.imul(D,tt),i=i+Math.imul(C,rt)|0,n=(n=n+Math.imul(C,it)|0)+Math.imul(U,rt)|0,o=o+Math.imul(U,it)|0,i=i+Math.imul(L,ot)|0,n=(n=n+Math.imul(L,st)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,st)|0,i=i+Math.imul(S,at)|0,n=(n=n+Math.imul(S,ht)|0)+Math.imul(R,at)|0,o=o+Math.imul(R,ht)|0,i=i+Math.imul(T,ct)|0,n=(n=n+Math.imul(T,ft)|0)+Math.imul(I,ct)|0,o=o+Math.imul(I,ft)|0;var St=(h+(i=i+Math.imul(E,pt)|0)|0)+((8191&(n=(n=n+Math.imul(E,mt)|0)+Math.imul(A,pt)|0))<<13)|0;h=((o=o+Math.imul(A,mt)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(G,rt),n=(n=Math.imul(G,it))+Math.imul(D,rt)|0,o=Math.imul(D,it),i=i+Math.imul(C,ot)|0,n=(n=n+Math.imul(C,st)|0)+Math.imul(U,ot)|0,o=o+Math.imul(U,st)|0,i=i+Math.imul(L,at)|0,n=(n=n+Math.imul(L,ht)|0)+Math.imul(P,at)|0,o=o+Math.imul(P,ht)|0,i=i+Math.imul(S,ct)|0,n=(n=n+Math.imul(S,ft)|0)+Math.imul(R,ct)|0,o=o+Math.imul(R,ft)|0;var Rt=(h+(i=i+Math.imul(T,pt)|0)|0)+((8191&(n=(n=n+Math.imul(T,mt)|0)+Math.imul(I,pt)|0))<<13)|0;h=((o=o+Math.imul(I,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(G,ot),n=(n=Math.imul(G,st))+Math.imul(D,ot)|0,o=Math.imul(D,st),i=i+Math.imul(C,at)|0,n=(n=n+Math.imul(C,ht)|0)+Math.imul(U,at)|0,o=o+Math.imul(U,ht)|0,i=i+Math.imul(L,ct)|0,n=(n=n+Math.imul(L,ft)|0)+Math.imul(P,ct)|0,o=o+Math.imul(P,ft)|0;var Ot=(h+(i=i+Math.imul(S,pt)|0)|0)+((8191&(n=(n=n+Math.imul(S,mt)|0)+Math.imul(R,pt)|0))<<13)|0;h=((o=o+Math.imul(R,mt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,i=Math.imul(G,at),n=(n=Math.imul(G,ht))+Math.imul(D,at)|0,o=Math.imul(D,ht),i=i+Math.imul(C,ct)|0,n=(n=n+Math.imul(C,ft)|0)+Math.imul(U,ct)|0,o=o+Math.imul(U,ft)|0;var Lt=(h+(i=i+Math.imul(L,pt)|0)|0)+((8191&(n=(n=n+Math.imul(L,mt)|0)+Math.imul(P,pt)|0))<<13)|0;h=((o=o+Math.imul(P,mt)|0)+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,i=Math.imul(G,ct),n=(n=Math.imul(G,ft))+Math.imul(D,ct)|0,o=Math.imul(D,ft);var Pt=(h+(i=i+Math.imul(C,pt)|0)|0)+((8191&(n=(n=n+Math.imul(C,mt)|0)+Math.imul(U,pt)|0))<<13)|0;h=((o=o+Math.imul(U,mt)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863;var kt=(h+(i=Math.imul(G,pt))|0)+((8191&(n=(n=Math.imul(G,mt))+Math.imul(D,pt)|0))<<13)|0;return h=((o=Math.imul(D,mt))+(n>>>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 i=0,n=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=u,i=s,s=n}return 0!==i?r.words[o]=i: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,i=0;i>=1;return i},m.prototype.permute=function(t,e,r,i,n,o){for(var s=0;s>>=1)n++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s>=26,e+=n/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>n}return e}(t);if(0===e.length)return new o(1);for(var r=this,i=0;i=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),u=67108863^67108863>>>o<s)for(this.length-=s,h=0;h=0&&(0!==l||h>=n);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 i(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(a/67108864|0),this.words[n+r]=67108863&o}for(;n>26,this.words[n+r]=67108863&o;if(0===u)return this.strip();for(i(-1===u),u=0,n=0;n>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,s=0|n.words[n.length-1];0!==(r=26-this._countBits(s))&&(n=n.ushln(r),i.iushln(r),s=0|n.words[n.length-1]);var u,a=i.length-n.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|i.words[n.length+c])+(0|i.words[n.length+c-1]);for(f=Math.min(f/s|0,67108863),i._ishlnsubmul(n,f,c);0!==i.negative;)f--,i.negative=0,i._ishlnsubmul(n,1,c),i.isZero()||(i.negative^=1);u&&(u.words[c]=f)}return u&&u.strip(),i.strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:u||null,mod:i}},o.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(u=this.neg().divmod(t,e),"mod"!==e&&(n=u.div.neg()),"div"!==e&&(s=u.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:n,mod:s}):0===this.negative&&0!==t.negative?(u=this.divmod(t.neg(),e),"mod"!==e&&(n=u.div.neg()),{div:n,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 n,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,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},o.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),s=new o(0),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;)(n.isOdd()||s.isOdd())&&(n.iadd(l),s.isub(c)),n.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),n.isub(u),s.isub(a)):(r.isub(e),u.isub(n),a.isub(s))}return{a:u,b:a,gcd:r.iushln(h)}},o.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,s=new o(1),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(n=0===e.cmpn(1)?s:u).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<>>26,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),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){in&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new b(t)},o.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var 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 i(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 i=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)},n(y,g),y.prototype.split=function(t,e){for(var r=Math.min(t.length,9),i=0;i>>22,n=o}n>>>=22,t.words[i-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(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){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},b.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},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(i(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),s=0;!n.isZero()&&0===n.andln(1);)s++,n.iushrn(1);i(!n.isZero());var 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,n),f=this.pow(t,n.addn(1).iushrn(1)),d=this.pow(t,n),p=s;0!==d.cmp(u);){for(var m=d,v=0;0!==m.cmp(u);v++)m=m.redSqr();i(v=0;i--){for(var h=e.words[i],l=a-1;l>=0;l--){var c=h>>l&1;n!==r[0]&&(n=this.sqr(n)),0!==c||0!==s?(s<<=1,s|=c,(4===++u||0===i&&0===l)&&(n=this.mul(n,r[s]),u=0,s=0)):u=0}a=26}return n},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)},n(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),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},E.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},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 i,n=this&&this.__extends||(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},function(t,e){function r(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__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(2),h=r(11),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 i=t.call(this)||this;if(c.checkNew(i,e),"string"==typeof r)a.isHexString(r)?("0x"==r&&(r="0x0"),h.defineReadOnly(i,"_hex",r)):"-"===r[0]&&a.isHexString(r.substring(1))?h.defineReadOnly(i,"_hex",r):r.match(/^-?[0-9]*$/)?(""==r&&(r="0"),h.defineReadOnly(i,"_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(i,"_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(i,"_hex",r._hex):r.toHexString?h.defineReadOnly(i,"_hex",d(p(r.toHexString()))):a.isArrayish(r)?h.defineReadOnly(i,"_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 i}return n(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 i=JSON.stringify(r);Object.defineProperty(t,e,{enumerable:!0,get:function(){return JSON.parse(i)}})},e.resolveProperties=function(t){var e={},r=[];return Object.keys(t).forEach(function(i){var n=t[i];n instanceof Promise?r.push(n.then(function(t){return e[i]=t,null})):e[i]=n}),Promise.all(r).then(function(){return e})},e.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 i=r(3);e.parseError=function(t){return t instanceof i.ProviderError?t:new i.ProviderError(i.ProviderIssue.GENERAL,t)}},function(t,e,r){"use strict";var i,n="object"==typeof Reflect?Reflect:null,o=n&&"function"==typeof n.apply?n.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};i=n&&"function"==typeof n.ownKeys?n.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,i){var n,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]=i?[r,s]:[s,r]:i?s.unshift(r):s.push(r),(n=h(t))>0&&s.length>n&&!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 i={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},n=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=n[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,n=o;break}if(n<0)return this;0===n?r.shift():function(t,e){for(;e+1=0;i--)this.removeListener(t,e[i]);return this},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?i(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 i=new(r(31).AbiCoder);e.encodeParameters=function(t,e){return i.encode(t,e)},e.decodeParameters=function(t,e){return i.decode(t,e)}},function(t,e,r){"use strict";var i,n=this&&this.__extends||(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},function(t,e){function r(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var s=r(8),u=r(10),a=r(2),h=r(40),l=r(11),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 i={type:"",name:"",state:{allowType:!0}},n=i,o=0;o1){var n=r[1].match(m);if(""!=n[1].trim()||""!=n[3].trim())throw new Error("unexpected tokens");j(n[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,i,n){this.coerceFunc=t,this.name=e,this.type=r,this.localName=i,this.dynamic=n}}(),_=function(t){function e(e){var r=t.call(this,e.coerceFunc,e.name,e.type,void 0,e.dynamic)||this;return l.defineReadOnly(r,"coder",e),r}return n(e,t),e.prototype.encode=function(t){return this.coder.encode(t)},e.prototype.decode=function(t,e){return this.coder.decode(t,e)},e}(M),b=function(t){function e(e,r){return t.call(this,e,"null","",r,!1)||this}return n(e,t),e.prototype.encode=function(t){return 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,i,n){var o=this,s=(i?"int":"uint")+8*r;return(o=t.call(this,e,s,s,n,!1)||this).size=r,o.signed=i,o}return n(e,t),e.prototype.encode=function(t){try{var e=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?i:"")+"]",u=-1===i||r.dynamic;return(o=t.call(this,e,"array",s,n,u)||this).coder=r,o.length=i,o}return n(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 i=[],n=0;n256||n%8!=0)&&c.throwError("invalid "+r[1]+" bit length",c.INVALID_ARGUMENT,{arg:"param",value:e}),new E(t,n/8,"int"===r[1],e.name);if(r=e.type.match(f))return(0===(n=parseInt(r[1]))||n>32)&&c.throwError("invalid bytes length",c.INVALID_ARGUMENT,{arg:"param",value:e}),new T(t,n,e.name);if(r=e.type.match(p)){var n=parseInt(r[2]||"-1");return(e=l.jsonCopy(e)).type=r[1],new C(t,D(t,e),n,e.name)}return"tuple"===e.type.substring(0,5)?function(t,e,r){e||(e=[]);var i=[];return e.forEach(function(e){i.push(D(t,e))}),new U(t,i,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 i=r(35),n=r(2);e.keccak256=function(t){return"0x"+i.keccak_256(n.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 i="object"==typeof window?window:{};!i.JS_SHA3_NO_NODE_JS&&"object"==typeof e&&e.versions&&e.versions.node&&(i=r);for(var n=!i.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(i){return new _(t,e,t).update(i)[r]()}},c=function(t,e,r){return function(i,n){return new _(t,e,n).update(i)[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 i=0;i>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var i=0;i<50;++i)this.s[i]=0}_.prototype.update=function(t){var e="string"!=typeof t;e&&t.constructor===ArrayBuffer&&(t=new Uint8Array(t));for(var r,i,n=t.length,o=this.blocks,u=this.byteCount,a=this.blockCount,h=0,l=this.s;h>2]|=t[h]<>2]|=i<>2]|=(192|i>>6)<>2]|=(128|63&i)<=57344?(o[r>>2]|=(224|i>>12)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<>2]|=(240|i>>18)<>2]|=(128|i>>12&63)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<=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 n&&(t=r[s],n>0&&(a+=o[t>>4&15]+o[15&t]),n>1&&(a+=o[t>>12&15]+o[t>>8&15]),n>2&&(a+=o[t>>20&15]+o[t>>16&15])),a},_.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,i=this.outputBlocks,n=this.extraBytes,o=0,s=0,u=this.outputBits>>3;t=n?new ArrayBuffer(i+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(i)}return o&&(t=u<<2,e=i[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,i,n,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,it,nt,ot,st,ut,at,ht,lt;for(i=0;i<48;i+=2)n=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],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=n^(h<<1|l>>>31),r=o^(l<<1|h>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=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^(n<<1|o>>>31),r=f^(o<<1|n>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,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,it=t[17]<<23|t[16]>>>9,nt=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^~it&ot,t[41]=rt^~nt&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]=it^~ot&ut,t[43]=nt^~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&it,t[49]=lt^~rt&nt,t[0]^=u[i],t[1]^=u[i+1]};if(n)t.exports=p;else for(v=0;v1)for(var r=1;r>=8;return e}function o(t,e,r){for(var i=0,n=0;ne+1+i)throw new Error("invalid rlp")}return{consumed:1+i,result:n}}function u(t,e){if(0===t.length)throw new Error("invalid rlp data");if(t[e]>=248){if(e+1+(r=t[e]-247)>t.length)throw new Error("too short");if(e+1+r+(n=o(t,e+1,r))>t.length)throw new Error("to short");return s(t,e,e+1+r,r+n)}if(t[e]>=192){if(e+1+(n=t[e]-192)>t.length)throw new Error("invalid rlp data");return s(t,e,e+1,n)}if(t[e]>=184){var r;if(e+1+(r=t[e]-183)>t.length)throw new Error("invalid rlp data");if(e+1+r+(n=o(t,e+1,r))>t.length)throw new Error("invalid rlp data");return{consumed:1+r+n,result:i.hexlify(t.slice(e+1+r,e+1+r+n))}}if(t[e]>=128){var n;if(e+1+(n=t[e]-128)>t.length)throw new Error("invlaid rlp data");return{consumed:1+n,result:i.hexlify(t.slice(e+1,e+1+n))}}return{consumed:1,result:i.hexlify(t[e])}}e.encode=function(t){return i.hexlify(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=n(r.length)).unshift(247+o.length),o.concat(r))}var o,s=Array.prototype.slice.call(i.arrayify(e));return 1===s.length&&s[0]<=127?s:s.length<=55?(s.unshift(128+s.length),s):((o=n(s.length)).unshift(183+o.length),o.concat(s))}(t))},e.decode=function(t){var e=i.arrayify(t),r=u(e,0);if(r.consumed!==e.length)throw new Error("invalid rlp data");return r.result}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){return function(){}}();e.BigNumber=i;var n=function(){return function(){}}();e.Indexed=n;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 i,n=r(2);!function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"}(i=e.UnicodeNormalizationForm||(e.UnicodeNormalizationForm={})),e.toUtf8Bytes=function(t,e){void 0===e&&(e=i.current),e!=i.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 n.arrayify(r)},e.toUtf8String=function(t){t=n.arrayify(t);for(var e="",r=0;r>7!=0){if(i>>6!=2){var o=null;if(i>>5==6)o=1;else if(i>>4==14)o=2;else if(i>>3==30)o=3;else if(i>>2==62)o=4;else{if(i>>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=i&(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(i)}return e}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(10);e.BigNumber=i.BigNumber,e.bigNumberify=i.bigNumberify},function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))(function(n,o){function s(t){try{a(i.next(t))}catch(t){o(t)}}function u(t){try{a(i.throw(t))}catch(t){o(t)}}function a(t){t.done?n(t.value):new r(function(e){e(t.value)}).then(s,u)}a((i=i.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const n=r(5),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 i(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 i(this,void 0,void 0,function*(){const t=yield this.getTransactionObject();if(!t||t.to&&"0x0"!==t.to||(t.to=yield this.getTransactionReceipt().then(t=>t?t.contractAddress:null)),t&&t.to){if(this._senderId=n.normalizeAddress(t.from),this._receiverId=n.normalizeAddress(t.to),this._confirmations=yield this.getLastBlock().then(e=>e-parseInt(t.blockNumber||e)).then(t=>t<0?0:t),this._confirmations>=this._provider.requiredConfirmations)return this._status=u.COMPLETED,this.emit(o.MutationEvent.COMPLETE,this);this.emit(o.MutationEvent.CONFIRM,this)}-1===this._provider.mutationTimeout||Date.now()-this._startedthis.normalizeAddress(t))}get orderGatewayId(){return this._orderGatewayId||null}set orderGatewayId(t){this._orderGatewayId=this.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 i(this,void 0,void 0,function*(){return(yield this.post({method:"eth_accounts",params:[]})).result.map(t=>this.normalizeAddress(t))})}getNetworkVersion(){return i(this,void 0,void 0,function*(){return(yield this.post({method:"net_version",params:[]})).result})}isCurrentAccount(t){return this.accountId===this.normalizeAddress(t)}isUnsafeRecipientId(t){const e=this.normalizeAddress(t);return!!this.unsafeRecipientIds.find(t=>t===e)}post(t){return i(this,void 0,void 0,function*(){const e=Object.assign({},t);if("eth_sendTransaction"===e.method&&e.params.length){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 i(this,void 0,void 0,function*(){const e=Object.assign({jsonrpc:"2.0",id:t.id||this.getNextId(),params:[]},t);return new Promise((t,r)=>{this._client.send(e,(i,n)=>i?r(i):n.error?r(n.error):n.id!==e.id?r("Invalid RPC id"):t(n))}).catch(t=>{throw u.parseError(t)})})}getNextId(){return this._id++,this._id}normalizeAddress(t){return n.normalizeAddress(t)}}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,r){window.$0xcert=window.$0xcert||{},Object.assign(window.$0xcert,r(111))},function(t,e,r){"use strict";function i(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),i(r(1)),i(r(112))},function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))(function(n,o){function s(t){try{a(i.next(t))}catch(t){o(t)}}function u(t){try{a(i.throw(t))}catch(t){o(t)}}function a(t){t.done?n(t.value):new r(function(e){e(t.value)}).then(s,u)}a((i=i.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const n=r(1);class o extends n.GenericProvider{static getInstance(){return new o}constructor(t){super(Object.assign({},t,{signMethod:n.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 i(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 i(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 i(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 i(this,void 0,void 0,function*(){const t=yield this.getNetworkVersion();t!==this._networkVersion&&(this.emit(n.ProviderEvent.NETWORK_CHANGE,t,this._networkVersion),this._networkVersion=t),this.accountId=yield this.getAvailableAccounts().then(t=>t[0]),setTimeout(()=>this.installEvents(),1e3)})}}e.MetamaskProvider=o}]); \ 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 4090e5714..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=113)}([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(5)),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(7)),n(r(6)),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(6)),n(r(29)),n(r(7)),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});const n=r(8);e.normalizeAddress=function(t){return t?n.getAddress(t):null}},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(9)),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,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,z=D>>>13,V=0|u[1],Z=8191&V,q=V>>>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,z))+Math.imul(f,B)|0))<<13)|0;h=((o=Math.imul(f,z))+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(p,B),i=(i=Math.imul(p,z))+Math.imul(m,B)|0,o=Math.imul(m,z);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,z))+Math.imul(g,B)|0,o=Math.imul(g,z),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,z))+Math.imul(_,B)|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,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,z))+Math.imul(A,B)|0,o=Math.imul(A,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,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,z))+Math.imul(I,B)|0,o=Math.imul(I,z),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(O,B),i=(i=Math.imul(O,z))+Math.imul(S,B)|0,o=Math.imul(S,z),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,z))+Math.imul(k,B)|0,o=Math.imul(k,z),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,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,z))+Math.imul(j,B)|0,o=Math.imul(j,z),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,K)|0,i=(i=i+Math.imul(O,H)|0)+Math.imul(S,K)|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(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,z))+Math.imul(F,B)|0,o=Math.imul(F,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(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(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(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(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,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(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,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(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(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(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(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(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]=It,a[12]=xt,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(2),h=r(11),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(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(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){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,O,S,R,P,k,L,C,j,U,G,F,D,B,z,V,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,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,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,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,z=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&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^~O&R,t[13]=x^~S&P,t[22]=U^~F&B,t[23]=G^~D&z,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]=O^~R&k,t[15]=S^~P&L,t[24]=F^~B&V,t[25]=D^~z&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^~V&C,t[27]=z^~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]=V^~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(8),u=r(10),a=r(2),h=r(40),l=r(11),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,O,S,R,P,k,L,C,j,U,G,F,D,B,z,V,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,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,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,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,z=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&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^~O&R,t[13]=x^~S&P,t[22]=U^~F&B,t[23]=G^~D&z,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]=O^~R&k,t[15]=S^~P&L,t[24]=F^~B&V,t[25]=D^~z&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^~V&C,t[27]=z^~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]=V^~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(10);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(5),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._startedthis.normalizeAddress(t))}get orderGatewayId(){return this._orderGatewayId||null}set orderGatewayId(t){this._orderGatewayId=this.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.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.normalizeAddress(t)}isUnsafeRecipientId(t){const e=this.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}normalizeAddress(t){return i.normalizeAddress(t)}}},,,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(76)),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(1),o=r(0),s=r(15),u=r(77),a=r(78),h=r(79),l=r(80),c=r(81),f=r(82),d=r(83);class p{static getInstance(t,e){return new p(t,e)}constructor(t,e){this._id=this.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=this.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=this.normalizeOrderIds(t),a.default(this,t,e)})}cancel(t){return n(this,void 0,void 0,function*(){return t=this.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=this.normalizeOrderIds(t),d.default(this,t,e)})}getOrderDataClaim(t){return n(this,void 0,void 0,function*(){return t=this.normalizeOrderIds(t),c.default(this,t)})}normalizeAddress(t){return o.normalizeAddress(t)}normalizeOrderIds(t){return s.normalizeOrderIds(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(48))}]); \ 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 bd8444e8b..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=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(30)),n(r(5)),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(7)),n(r(6)),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(6)),n(r(29)),n(r(7)),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});const n=r(8);e.normalizeAddress=function(t){return t?n.getAddress(t):null}},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(9)),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(9)),a=r(2),h=r(11),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(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(8),u=r(10),a=r(2),h=r(40),l=r(11),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(10);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(5),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._startedthis.normalizeAddress(t))}get orderGatewayId(){return this._orderGatewayId||null}set orderGatewayId(t){this._orderGatewayId=this.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.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.normalizeAddress(t)}isUnsafeRecipientId(t){const e=this.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}normalizeAddress(t){return i.normalizeAddress(t)}}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,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(85))},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new 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(86),u=r(87),a=r(88),h=r(89),l=r(90),c=r(91),f=r(92);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=this.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=this.normalizeAddress(t),e=this.normalizeAddress(e),l.default(this,t,e)})}getBalance(t){return n(this,void 0,void 0,function*(){return t=this.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.normalizeAddress(e),r=this.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.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.normalizeAddress(t),s.default(this,t,"0")})}transferValue(t){return n(this,void 0,void 0,function*(){const e=this.normalizeAddress(t.senderId),r=this.normalizeAddress(t.receiverId);return t.senderId?h.default(this,e,r,t.value):a.default(this,r,t.value)})}normalizeAddress(t){return i.normalizeAddress(t)}}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(84))}]); \ 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 3799caca3..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=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(30)),n(r(5)),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(7)),n(r(6)),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(6)),n(r(29)),n(r(7)),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});const n=r(8);e.normalizeAddress=function(t){return t?n.getAddress(t):null}},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(9)),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],z=8191&F,B=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,z))|0)+((8191&(i=(i=Math.imul(l,B))+Math.imul(d,z)|0))<<13)|0;h=((o=Math.imul(d,B))+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(p,z),i=(i=Math.imul(p,B))+Math.imul(v,z)|0,o=Math.imul(v,B);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,z),i=(i=Math.imul(y,B))+Math.imul(g,z)|0,o=Math.imul(g,B),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(_,z),i=(i=Math.imul(_,B))+Math.imul(M,z)|0,o=Math.imul(M,B),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,z),i=(i=Math.imul(A,B))+Math.imul(E,z)|0,o=Math.imul(E,B),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,z),i=(i=Math.imul(P,B))+Math.imul(T,z)|0,o=Math.imul(T,B),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,z),i=(i=Math.imul(N,B))+Math.imul(O,z)|0,o=Math.imul(O,B),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,z),i=(i=Math.imul(R,B))+Math.imul(k,z)|0,o=Math.imul(k,B),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,z),i=(i=Math.imul(j,B))+Math.imul(C,z)|0,o=Math.imul(C,B),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,z),i=(i=Math.imul(G,B))+Math.imul(D,z)|0,o=Math.imul(D,B),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(9)),a=r(2),h=r(11),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(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(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 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,z,B,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,z=t[38]<<8|t[39]>>>24,B=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&z,t[23]=G^~F&B,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^~z&V,t[25]=F^~B&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]=z^~V&j,t[27]=B^~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(8),u=r(10),a=r(2),h=r(40),c=r(11),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,z,B,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,z=t[38]<<8|t[39]>>>24,B=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&z,t[23]=G^~F&B,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^~z&V,t[25]=F^~B&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]=z^~V&j,t[27]=B^~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(10);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(5),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._startedthis.normalizeAddress(t))}get orderGatewayId(){return this._orderGatewayId||null}set orderGatewayId(t){this._orderGatewayId=this.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.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.normalizeAddress(t)}isUnsafeRecipientId(t){const e=this.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}normalizeAddress(t){return i.normalizeAddress(t)}}},,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});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(50))},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(76)),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(3),s=r(51),u=r(52),a=r(53),h=r(54),c=r(55),l=r(56),d=r(57),f=r(58),p=r(59),v=r(60),m=r(61),y=r(62),g=r(63),w=r(64),_=r(65),M=r(66),b=r(68),A=r(69),E=r(70),x=r(71),P=r(72),T=r(73),I=r(74),N=r(75);class O{static deploy(t,e){return n(this,void 0,void 0,function*(){return a.default(t,e)})}static getInstance(t,e){return new O(t,e)}constructor(t,e){this._id=this.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=this.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.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.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.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.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.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.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.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.normalizeAddress(t.senderId),r=this.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.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.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.normalizeAddress(t),e=this.normalizeAddress(e),I.default(this,t,e)})}getProxyId(){return-1===this.provider.unsafeRecipientIds.indexOf(this.id)?3:2}normalizeAddress(t){return i.normalizeAddress(t)}}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(45),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(67),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(45),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";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new 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(77),a=r(78),h=r(79),c=r(80),l=r(81),d=r(82),f=r(83);class p{static getInstance(t,e){return new p(t,e)}constructor(t,e){this._id=this.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=this.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=this.normalizeOrderIds(t),a.default(this,t,e)})}cancel(t){return n(this,void 0,void 0,function*(){return t=this.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=this.normalizeOrderIds(t),f.default(this,t,e)})}getOrderDataClaim(t){return n(this,void 0,void 0,function*(){return t=this.normalizeOrderIds(t),l.default(this,t)})}normalizeAddress(t){return o.normalizeAddress(t)}normalizeOrderIds(t){return s.normalizeOrderIds(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(85))},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new 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(86),u=r(87),a=r(88),h=r(89),c=r(90),l=r(91),d=r(92);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=this.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=this.normalizeAddress(t),e=this.normalizeAddress(e),c.default(this,t,e)})}getBalance(t){return n(this,void 0,void 0,function*(){return t=this.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=this.normalizeAddress(e),r=this.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=this.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.normalizeAddress(t),s.default(this,t,"0")})}transferValue(t){return n(this,void 0,void 0,function*(){const e=this.normalizeAddress(t.senderId),r=this.normalizeAddress(t.receiverId);return t.senderId?h.default(this,e,r,t.value):a.default(this,r,t.value)})}normalizeAddress(t){return i.normalizeAddress(t)}}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){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}(r(94))},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new 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(95),o=r(16),s=r(97);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(96))},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>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]+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(6)),n(r(29)),n(r(7)),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});const n=r(8);e.normalizeAddress=function(t){return t?n.getAddress(t):null}},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(9)),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,O=I>>>13,S=0|s[7],R=8191&S,L=S>>>13,C=0|s[8],k=8191&C,j=C>>>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,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,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(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,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(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,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(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,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(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,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(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,z))+Math.imul(O,F)|0,o=Math.imul(O,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(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,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(O,Z)|0,o=o+Math.imul(O,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(k,F),i=(i=Math.imul(k,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(O,H)|0,o=o+Math.imul(O,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,z))+Math.imul(D,F)|0,o=Math.imul(D,z),n=n+Math.imul(k,Z)|0,i=(i=i+Math.imul(k,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(O,J)|0,o=o+Math.imul(O,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(k,H)|0,i=(i=i+Math.imul(k,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(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(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(k,J)|0,i=(i=i+Math.imul(k,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(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(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(k,Q)|0,i=(i=i+Math.imul(k,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(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(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(k,rt)|0,i=(i=i+Math.imul(k,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(O,at)|0,o=o+Math.imul(O,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(k,ot)|0,i=(i=i+Math.imul(k,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(O,ct)|0,o=o+Math.imul(O,dt)|0;var Ot=(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)+(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(k,at)|0,i=(i=i+Math.imul(k,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 St=(h+(n=n+Math.imul(P,pt)|0)|0)+((8191&(i=(i=i+Math.imul(P,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(k,ct)|0,i=(i=i+Math.imul(k,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(k,pt)|0)|0)+((8191&(i=(i=i+Math.imul(k,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 Ct=(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)+(Ct>>>26)|0,Ct&=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]=Ot,a[15]=St,a[16]=Rt,a[17]=Lt,a[18]=Ct,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(9)),a=r(2),h=r(11),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(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,O,S,R,L,C,k,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,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,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,k=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,S=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,C=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&O,t[20]=k^~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&S,t[13]=I^~O&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^~S&L,t[15]=O^~R&C,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<,t[6]=_^~A&v,t[7]=b^~E&m,t[16]=S^~L&x,t[17]=R^~C&T,t[26]=F^~V&k,t[27]=z^~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]=C^~T&I,t[28]=V^~k&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(8),u=r(10),a=r(2),h=r(40),l=r(11),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 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 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=113)}([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,O,S,R,L,C,k,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,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,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,k=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,S=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,C=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&O,t[20]=k^~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&S,t[13]=I^~O&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^~S&L,t[15]=O^~R&C,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<,t[6]=_^~A&v,t[7]=b^~E&m,t[16]=S^~L&x,t[17]=R^~C&T,t[26]=F^~V&k,t[27]=z^~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]=C^~T&I,t[28]=V^~k&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(10);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(5),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._startedthis.normalizeAddress(t))}get orderGatewayId(){return this._orderGatewayId||null}set orderGatewayId(t){this._orderGatewayId=this.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.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.normalizeAddress(t)}isUnsafeRecipientId(t){const e=this.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}normalizeAddress(t){return i.normalizeAddress(t)}}},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";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(50))},,function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(5);e.normalizeAddress=function(t){return t?["0x",...(t=n.normalizeAddress(t.toLowerCase())).substr(2).split("").map(t=>t==t.toLowerCase()?t.toUpperCase():t.toLowerCase())].join(""):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(51),u=r(52),a=r(53),h=r(54),l=r(55),c=r(56),d=r(57),f=r(58),p=r(59),v=r(60),m=r(61),y=r(62),g=r(63),w=r(64),M=r(65),_=r(66),b=r(68),A=r(69),E=r(70),x=r(71),T=r(72),N=r(73),I=r(74),P=r(75);class O{static deploy(t,e){return n(this,void 0,void 0,function*(){return a.default(t,e)})}static getInstance(t,e){return new O(t,e)}constructor(t,e){this._id=this.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=this.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.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.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.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.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.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=this.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.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=this.normalizeAddress(t.senderId),r=this.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.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.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.normalizeAddress(t),e=this.normalizeAddress(e),I.default(this,t,e)})}getProxyId(){return-1===this.provider.unsafeRecipientIds.indexOf(this.id)?3:2}normalizeAddress(t){return i.normalizeAddress(t)}}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(45),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(67),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(45),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";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(101))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(47),i=r(44);e.AssetLedger=class extends n.AssetLedger{normalizeAddress(t){return i.normalizeAddress(t)}}},,,,,,,,,,,,,,function(t,e,r){window.$0xcert=window.$0xcert||{},Object.assign(window.$0xcert,r(100))}]); \ 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){"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 index f4f0e1527..8eb9cbf11 100644 --- a/dist/0xcert-wanchain-http-provider.min.js +++ b/dist/0xcert-wanchain-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=116)}([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(5)),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(7)),n(r(6)),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(6)),n(r(29)),n(r(7)),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});const n=r(8);e.normalizeAddress=function(t){return t?n.getAddress(t):null}},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(9)),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,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,H=0|u[2],$=8191&H,K=H>>>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,$)|0)|0)+((8191&(i=(i=i+Math.imul(c,K)|0)+Math.imul(f,$)|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,$)|0,i=(i=i+Math.imul(p,K)|0)+Math.imul(m,$)|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,$)|0,i=(i=i+Math.imul(y,K)|0)+Math.imul(g,$)|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,$)|0,i=(i=i+Math.imul(M,K)|0)+Math.imul(_,$)|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,$)|0,i=(i=i+Math.imul(E,K)|0)+Math.imul(A,$)|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,$)|0,i=(i=i+Math.imul(T,K)|0)+Math.imul(I,$)|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,$)|0,i=(i=i+Math.imul(O,K)|0)+Math.imul(S,$)|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,$)|0,i=(i=i+Math.imul(P,K)|0)+Math.imul(L,$)|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,$)|0,i=(i=i+Math.imul(C,K)|0)+Math.imul(j,$)|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,$),i=(i=Math.imul(G,K))+Math.imul(D,$)|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(2),h=r(11),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(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,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],$=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,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^~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^~$&J,t[31]=H^~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]=$^~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&H,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&$,t[39]=tt^~H&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(8),u=r(10),a=r(2),h=r(40),l=r(11),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,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=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} * @@ -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,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],$=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,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^~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^~$&J,t[31]=H^~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]=$^~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&H,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&$,t[39]=tt^~H&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(10);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(5),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._startedthis.normalizeAddress(t))}get orderGatewayId(){return this._orderGatewayId||null}set orderGatewayId(t){this._orderGatewayId=this.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.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.normalizeAddress(t)}isUnsafeRecipientId(t){const e=this.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}normalizeAddress(t){return i.normalizeAddress(t)}}},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";Object.defineProperty(e,"__esModule",{value:!0});const n=r(5);e.normalizeAddress=function(t){return t?["0x",...(t=n.normalizeAddress(t.toLowerCase())).substr(2).split("").map(t=>t==t.toLowerCase()?t.toUpperCase():t.toLowerCase())].join(""):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(1)),n(r(99))},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},,,,,,,,,,,,,,,,,function(t,e,r){window.$0xcert=window.$0xcert||{},Object.assign(window.$0xcert,r(117))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(98);e.MutationEvent=n.MutationEvent,e.ProviderEvent=n.ProviderEvent,e.ProviderIssue=n.ProviderIssue,e.ProviderError=n.ProviderError,e.parseError=n.parseError,e.MutationStatus=n.MutationStatus,e.Mutation=n.Mutation,e.GenericProvider=n.GenericProvider,e.SignMethod=n.SignMethod,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(98),i=r(44);e.HttpProvider=class extends n.HttpProvider{normalizeAddress(t){return i.normalizeAddress(t)}}}]); \ 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,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 index 572f7b1f0..ae543f168 100644 --- a/dist/0xcert-wanchain-order-gateway.min.js +++ b/dist/0xcert-wanchain-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=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(30)),n(r(5)),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(7)),n(r(6)),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(6)),n(r(29)),n(r(7)),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});const n=r(8);e.normalizeAddress=function(t){return t?n.getAddress(t):null}},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(9)),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],I=8191&N,T=N>>>13,x=0|s[6],O=8191&x,S=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,z=D>>>13,V=0|u[1],Z=8191&V,q=V>>>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,z))+Math.imul(f,B)|0))<<13)|0;h=((o=Math.imul(f,z))+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(p,B),i=(i=Math.imul(p,z))+Math.imul(m,B)|0,o=Math.imul(m,z);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,z))+Math.imul(g,B)|0,o=Math.imul(g,z),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,z))+Math.imul(_,B)|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,$)|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,z))+Math.imul(A,B)|0,o=Math.imul(A,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,$)|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(I,B),i=(i=Math.imul(I,z))+Math.imul(T,B)|0,o=Math.imul(T,z),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,z))+Math.imul(S,B)|0,o=Math.imul(S,z),n=n+Math.imul(I,Z)|0,i=(i=i+Math.imul(I,q)|0)+Math.imul(T,Z)|0,o=o+Math.imul(T,q)|0,n=n+Math.imul(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,z))+Math.imul(k,B)|0,o=Math.imul(k,z),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(I,$)|0,i=(i=i+Math.imul(I,H)|0)+Math.imul(T,$)|0,o=o+Math.imul(T,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,z))+Math.imul(j,B)|0,o=Math.imul(j,z),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(I,X)|0,i=(i=i+Math.imul(I,W)|0)+Math.imul(T,X)|0,o=o+Math.imul(T,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,z))+Math.imul(F,B)|0,o=Math.imul(F,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(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(I,Q)|0,i=(i=i+Math.imul(I,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(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(I,rt)|0,i=(i=i+Math.imul(I,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 It=(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)+(It>>>26)|0,It&=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(I,ot)|0,i=(i=i+Math.imul(I,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,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(I,at)|0,i=(i=i+Math.imul(I,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 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(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(I,ct)|0,i=(i=i+Math.imul(I,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(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(I,pt)|0)|0)+((8191&(i=(i=i+Math.imul(I,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(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]=It,a[11]=Tt,a[12]=xt,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(2),h=r(11),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(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(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){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,I,T,x,O,S,R,P,k,L,C,j,U,G,F,D,B,z,V,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,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,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,I=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,T=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,z=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]=I^~x&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]=T^~O&R,t[13]=x^~S&P,t[22]=U^~F&B,t[23]=G^~D&z,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&V,t[25]=D^~z&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&I,t[26]=B^~V&C,t[27]=z^~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&T,t[19]=L^~I&x,t[28]=V^~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(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(8),u=r(10),a=r(2),h=r(40),l=r(11),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 I(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=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} * @@ -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,I,T,x,O,S,R,P,k,L,C,j,U,G,F,D,B,z,V,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,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,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,I=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,T=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,z=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]=I^~x&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]=T^~O&R,t[13]=x^~S&P,t[22]=U^~F&B,t[23]=G^~D&z,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&V,t[25]=D^~z&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&I,t[26]=B^~V&C,t[27]=z^~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&T,t[19]=L^~I&x,t[28]=V^~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(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(10);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(5),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._startedthis.normalizeAddress(t))}get orderGatewayId(){return this._orderGatewayId||null}set orderGatewayId(t){this._orderGatewayId=this.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.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.normalizeAddress(t)}isUnsafeRecipientId(t){const e=this.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}normalizeAddress(t){return i.normalizeAddress(t)}}},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";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(76)),n(r(46))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(5);e.normalizeAddress=function(t){return t?["0x",...(t=n.normalizeAddress(t.toLowerCase())).substr(2).split("").map(t=>t==t.toLowerCase()?t.toUpperCase():t.toLowerCase())].join(""):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(1),o=r(0),s=r(15),u=r(77),a=r(78),h=r(79),l=r(80),c=r(81),f=r(82),d=r(83);class p{static getInstance(t,e){return new p(t,e)}constructor(t,e){this._id=this.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=this.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=this.normalizeOrderIds(t),a.default(this,t,e)})}cancel(t){return n(this,void 0,void 0,function*(){return t=this.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=this.normalizeOrderIds(t),d.default(this,t,e)})}getOrderDataClaim(t){return n(this,void 0,void 0,function*(){return t=this.normalizeOrderIds(t),c.default(this,t)})}normalizeAddress(t){return o.normalizeAddress(t)}normalizeOrderIds(t){return s.normalizeOrderIds(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){"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(103))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(48),i=r(44),o=r(104);e.OrderGateway=class extends n.OrderGateway{normalizeAddress(t){return i.normalizeAddress(t)}normalizeOrderIds(t){return o.normalizeOrderIds(t)}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(44);e.normalizeOrderIds=function(t){return(t=JSON.parse(JSON.stringify(t))).makerId=n.normalizeAddress(t.makerId),t.takerId=n.normalizeAddress(t.takerId),t.actions.forEach(t=>{t.ledgerId=n.normalizeAddress(t.ledgerId),t.receiverId=n.normalizeAddress(t.receiverId),t.senderId=n.normalizeAddress(t.senderId)}),t}},,,,,,,,,,,,,,,function(t,e,r){window.$0xcert=window.$0xcert||{},Object.assign(window.$0xcert,r(102))}]); \ 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,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 index 0494e5021..db34150e3 100644 --- a/dist/0xcert-wanchain-value-ledger.min.js +++ b/dist/0xcert-wanchain-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=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(30)),n(r(5)),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(7)),n(r(6)),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(6)),n(r(29)),n(r(7)),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});const n=r(8);e.normalizeAddress=function(t){return t?n.getAddress(t):null}},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(9)),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],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(2),h=r(11),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(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,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(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(8),u=r(10),a=r(2),h=r(40),l=r(11),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=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} * @@ -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,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(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(10);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(5),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._startedthis.normalizeAddress(t))}get orderGatewayId(){return this._orderGatewayId||null}set orderGatewayId(t){this._orderGatewayId=this.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.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.normalizeAddress(t)}isUnsafeRecipientId(t){const e=this.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}normalizeAddress(t){return i.normalizeAddress(t)}}},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";Object.defineProperty(e,"__esModule",{value:!0});const n=r(5);e.normalizeAddress=function(t){return t?["0x",...(t=n.normalizeAddress(t.toLowerCase())).substr(2).split("").map(t=>t==t.toLowerCase()?t.toUpperCase():t.toLowerCase())].join(""):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(85))},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new 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(86),u=r(87),a=r(88),h=r(89),l=r(90),c=r(91),f=r(92);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=this.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=this.normalizeAddress(t),e=this.normalizeAddress(e),l.default(this,t,e)})}getBalance(t){return n(this,void 0,void 0,function*(){return t=this.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.normalizeAddress(e),r=this.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.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.normalizeAddress(t),s.default(this,t,"0")})}transferValue(t){return n(this,void 0,void 0,function*(){const e=this.normalizeAddress(t.senderId),r=this.normalizeAddress(t.receiverId);return t.senderId?h.default(this,e,r,t.value):a.default(this,r,t.value)})}normalizeAddress(t){return i.normalizeAddress(t)}}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){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}(r(106))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(84),i=r(44);e.ValueLedger=class extends n.ValueLedger{normalizeAddress(t){return i.normalizeAddress(t)}}},,,,,,,,,,,,,,function(t,e,r){window.$0xcert=window.$0xcert||{},Object.assign(window.$0xcert,r(105))}]); \ 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,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 index cc1694042..4835bc4d7 100644 --- a/dist/0xcert-wanchain.min.js +++ b/dist/0xcert-wanchain.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=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(30)),n(r(5)),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(7)),n(r(6)),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(6)),n(r(29)),n(r(7)),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});const n=r(8);e.normalizeAddress=function(t){return t?n.getAddress(t):null}},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(9)),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,b=w>>>13,M=0|s[4],A=8191&M,E=M>>>13,x=0|s[5],P=8191&x,I=x>>>13,T=0|s[6],O=8191&T,N=T>>>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,z=G>>>13,D=0|u[0],F=8191&D,B=D>>>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,F))|0)+((8191&(i=(i=Math.imul(l,B))+Math.imul(d,F)|0))<<13)|0;h=((o=Math.imul(d,B))+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(p,F),i=(i=Math.imul(p,B))+Math.imul(v,F)|0,o=Math.imul(v,B);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,F),i=(i=Math.imul(y,B))+Math.imul(g,F)|0,o=Math.imul(g,B),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(_,F),i=(i=Math.imul(_,B))+Math.imul(b,F)|0,o=Math.imul(b,B),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,F),i=(i=Math.imul(A,B))+Math.imul(E,F)|0,o=Math.imul(E,B),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=(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,F),i=(i=Math.imul(P,B))+Math.imul(I,F)|0,o=Math.imul(I,B),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=(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)+(bt>>>26)|0,bt&=67108863,n=Math.imul(O,F),i=(i=Math.imul(O,B))+Math.imul(N,F)|0,o=Math.imul(N,B),n=n+Math.imul(P,Z)|0,i=(i=i+Math.imul(P,$)|0)+Math.imul(I,Z)|0,o=o+Math.imul(I,$)|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=(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)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(R,F),i=(i=Math.imul(R,B))+Math.imul(L,F)|0,o=Math.imul(L,B),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(I,q)|0,o=o+Math.imul(I,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=(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(k,F),i=(i=Math.imul(k,B))+Math.imul(C,F)|0,o=Math.imul(C,B),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(I,X)|0,o=o+Math.imul(I,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,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(U,F),i=(i=Math.imul(U,B))+Math.imul(z,F)|0,o=Math.imul(z,B),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(I,Q)|0,o=o+Math.imul(I,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,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(U,Z),i=(i=Math.imul(U,$))+Math.imul(z,Z)|0,o=Math.imul(z,$),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(I,rt)|0,o=o+Math.imul(I,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(b,at)|0,o=o+Math.imul(b,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(U,q),i=(i=Math.imul(U,H))+Math.imul(z,q)|0,o=Math.imul(z,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(I,ot)|0,o=o+Math.imul(I,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(b,lt)|0,o=o+Math.imul(b,dt)|0;var It=(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)+(It>>>26)|0,It&=67108863,n=Math.imul(U,X),i=(i=Math.imul(U,W))+Math.imul(z,X)|0,o=Math.imul(z,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,ht)|0)+Math.imul(I,at)|0,o=o+Math.imul(I,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 Tt=(h+(n=n+Math.imul(_,pt)|0)|0)+((8191&(i=(i=i+Math.imul(_,vt)|0)+Math.imul(b,pt)|0))<<13)|0;h=((o=o+Math.imul(b,vt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(U,Q),i=(i=Math.imul(U,tt))+Math.imul(z,Q)|0,o=Math.imul(z,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,ht)|0)+Math.imul(N,at)|0,o=o+Math.imul(N,ht)|0,n=n+Math.imul(P,lt)|0,i=(i=i+Math.imul(P,dt)|0)+Math.imul(I,lt)|0,o=o+Math.imul(I,dt)|0;var Ot=(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)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(U,rt),i=(i=Math.imul(U,nt))+Math.imul(z,rt)|0,o=Math.imul(z,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,ht)|0)+Math.imul(L,at)|0,o=o+Math.imul(L,ht)|0,n=n+Math.imul(O,lt)|0,i=(i=i+Math.imul(O,dt)|0)+Math.imul(N,lt)|0,o=o+Math.imul(N,dt)|0;var Nt=(h+(n=n+Math.imul(P,pt)|0)|0)+((8191&(i=(i=i+Math.imul(P,vt)|0)+Math.imul(I,pt)|0))<<13)|0;h=((o=o+Math.imul(I,vt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,n=Math.imul(U,ot),i=(i=Math.imul(U,st))+Math.imul(z,ot)|0,o=Math.imul(z,st),n=n+Math.imul(k,at)|0,i=(i=i+Math.imul(k,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(L,lt)|0,o=o+Math.imul(L,dt)|0;var St=(h+(n=n+Math.imul(O,pt)|0)|0)+((8191&(i=(i=i+Math.imul(O,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(U,at),i=(i=Math.imul(U,ht))+Math.imul(z,at)|0,o=Math.imul(z,ht),n=n+Math.imul(k,lt)|0,i=(i=i+Math.imul(k,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(L,pt)|0))<<13)|0;h=((o=o+Math.imul(L,vt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(U,lt),i=(i=Math.imul(U,dt))+Math.imul(z,lt)|0,o=Math.imul(z,dt);var Lt=(h+(n=n+Math.imul(k,pt)|0)|0)+((8191&(i=(i=i+Math.imul(k,vt)|0)+Math.imul(C,pt)|0))<<13)|0;h=((o=o+Math.imul(C,vt)|0)+(i>>>13)|0)+(Lt>>>26)|0,Lt&=67108863;var jt=(h+(n=Math.imul(U,pt))|0)+((8191&(i=(i=Math.imul(U,vt))+Math.imul(z,pt)|0))<<13)|0;return h=((o=Math.imul(z,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]=It,a[12]=Tt,a[13]=Ot,a[14]=Nt,a[15]=St,a[16]=Rt,a[17]=Lt,a[18]=jt,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 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(),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},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(2),h=r(11),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(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(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 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,_,b,M,A,E,x,P,I,T,O,N,S,R,L,j,k,C,G,U,z,D,F,B,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,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,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,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,z=t[26]<<25|t[27]>>>7,D=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,I=t[18]<<20|t[19]>>>12,T=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,B=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^~I&O,t[11]=P^~T&N,t[20]=k^~G&z,t[21]=C^~U&D,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]=I^~O&S,t[13]=T^~N&R,t[22]=G^~z&F,t[23]=U^~D&B,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]=z^~F&V,t[25]=D^~B&Z,t[34]=J^~W&Q,t[35]=X^~Y&tt,t[44]=ot^~ut&ht,t[45]=st^~at&ct,t[6]=b^~A&v,t[7]=M^~E&m,t[16]=S^~L&x,t[17]=R^~j&P,t[26]=F^~V&k,t[27]=B^~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]=L^~x&I,t[19]=j^~P&T,t[28]=V^~k&G,t[29]=Z^~C&U,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(8),u=r(10),a=r(2),h=r(40),c=r(11),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");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 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=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 k(t,z(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(z(t,e))}),new C(t,n,r)}(t,e.components,e.name):""===e.type?new M(t,e.name):(l.throwError("invalid type",l.INVALID_ARGUMENT,{arg:"type",value:e.type}),null)}var D=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(z(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(z(this.coerceFunc,e))},this),new C(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=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} * @@ -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 b(t,e,t).update(n)[r]()}},l=function(t,e,r){return function(n,i){return new b(t,e,i).update(n)[r]()}},d=function(t,e){var r=c(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,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&&(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,h,c,l,d,f,p,v,m,y,g,w,_,b,M,A,E,x,P,I,T,O,N,S,R,L,j,k,C,G,U,z,D,F,B,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,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,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,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,z=t[26]<<25|t[27]>>>7,D=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,I=t[18]<<20|t[19]>>>12,T=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,B=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^~I&O,t[11]=P^~T&N,t[20]=k^~G&z,t[21]=C^~U&D,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]=I^~O&S,t[13]=T^~N&R,t[22]=G^~z&F,t[23]=U^~D&B,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]=z^~F&V,t[25]=D^~B&Z,t[34]=J^~W&Q,t[35]=X^~Y&tt,t[44]=ot^~ut&ht,t[45]=st^~at&ct,t[6]=b^~A&v,t[7]=M^~E&m,t[16]=S^~L&x,t[17]=R^~j&P,t[26]=F^~V&k,t[27]=B^~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]=L^~x&I,t[19]=j^~P&T,t[28]=V^~k&G,t[29]=Z^~C&U,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(10);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(5),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._startedthis.normalizeAddress(t))}get orderGatewayId(){return this._orderGatewayId||null}set orderGatewayId(t){this._orderGatewayId=this.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.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.normalizeAddress(t)}isUnsafeRecipientId(t){const e=this.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}normalizeAddress(t){return i.normalizeAddress(t)}}},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";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});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(50))},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(76)),n(r(46))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(5);e.normalizeAddress=function(t){return t?["0x",...(t=n.normalizeAddress(t.toLowerCase())).substr(2).split("").map(t=>t==t.toLowerCase()?t.toUpperCase():t.toLowerCase())].join(""):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(51),u=r(52),a=r(53),h=r(54),c=r(55),l=r(56),d=r(57),f=r(58),p=r(59),v=r(60),m=r(61),y=r(62),g=r(63),w=r(64),_=r(65),b=r(66),M=r(68),A=r(69),E=r(70),x=r(71),P=r(72),I=r(73),T=r(74),O=r(75);class N{static deploy(t,e){return n(this,void 0,void 0,function*(){return a.default(t,e)})}static getInstance(t,e){return new N(t,e)}constructor(t,e){this._id=this.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=this.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.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 I.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.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.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.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.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.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.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.normalizeAddress(t.senderId),r=this.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.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.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.normalizeAddress(t),e=this.normalizeAddress(e),T.default(this,t,e)})}getProxyId(){return-1===this.provider.unsafeRecipientIds.indexOf(this.id)?3:2}normalizeAddress(t){return i.normalizeAddress(t)}}e.AssetLedger=N},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new 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(45),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(67),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(45),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";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new 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(77),a=r(78),h=r(79),c=r(80),l=r(81),d=r(82),f=r(83);class p{static getInstance(t,e){return new p(t,e)}constructor(t,e){this._id=this.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=this.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=this.normalizeOrderIds(t),a.default(this,t,e)})}cancel(t){return n(this,void 0,void 0,function*(){return t=this.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=this.normalizeOrderIds(t),f.default(this,t,e)})}getOrderDataClaim(t){return n(this,void 0,void 0,function*(){return t=this.normalizeOrderIds(t),l.default(this,t)})}normalizeAddress(t){return o.normalizeAddress(t)}normalizeOrderIds(t){return s.normalizeOrderIds(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(85))},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new 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(86),u=r(87),a=r(88),h=r(89),c=r(90),l=r(91),d=r(92);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=this.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=this.normalizeAddress(t),e=this.normalizeAddress(e),c.default(this,t,e)})}getBalance(t){return n(this,void 0,void 0,function*(){return t=this.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=this.normalizeAddress(e),r=this.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=this.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.normalizeAddress(t),s.default(this,t,"0")})}transferValue(t){return n(this,void 0,void 0,function*(){const e=this.normalizeAddress(t.senderId),r=this.normalizeAddress(t.receiverId);return t.senderId?h.default(this,e,r,t.value):a.default(this,r,t.value)})}normalizeAddress(t){return i.normalizeAddress(t)}}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){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}(r(94))},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new 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(95),o=r(16),s=r(97);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(96))},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{t.ledgerId=n.normalizeAddress(t.ledgerId),t.receiverId=n.normalizeAddress(t.receiverId),t.senderId=n.normalizeAddress(t.senderId)}),t}},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(106))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(84),i=r(44);e.ValueLedger=class extends n.ValueLedger{normalizeAddress(t){return i.normalizeAddress(t)}}},,,,,,,,,,,,,,,,function(t,e,r){window.$0xcert=window.$0xcert||{},Object.assign(window.$0xcert,r(93),r(100),r(102),r(105))}]); \ 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 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 { - accountId = this.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 = this.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 = this.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 = this.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 = this.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 = this.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 = this.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 = this.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 = this.normalizeAddress(recipe.senderId); - const receiverId = this.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 = this.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 = this.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 = this.normalizeAddress(accountId); - operatorId = this.normalizeAddress(operatorId as string); + accountId = this._provider.encoder.normalizeAddress(accountId); + operatorId = this._provider.encoder.normalizeAddress(operatorId as string); return isApprovedForAll(this, accountId, operatorId); } @@ -381,12 +381,4 @@ export class AssetLedger implements AssetLedgerBase { : 2; // OrderGatewayProxy.NFTOKEN_TRANSFER; } - /** - * Normalizes the Ethereum address. - * NOTE: This method is here to easily extend the class for related platforms - * such as Wanchain. - */ - protected normalizeAddress(address: string): string { - return normalizeAddress(address); - } } 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.json b/packages/0xcert-ethereum-erc20-contracts/CHANGELOG.json index ca8d065a8..9459e1c5d 100644 --- a/packages/0xcert-ethereum-erc20-contracts/CHANGELOG.json +++ b/packages/0xcert-ethereum-erc20-contracts/CHANGELOG.json @@ -2,8 +2,8 @@ "name": "@0xcert/ethereum-erc20-contracts", "entries": [ { - "version": "1.1.0-alpha0", - "tag": "@0xcert/ethereum-erc20-contracts_v1.1.0-alpha0", + "version": "1.2.0", + "tag": "@0xcert/ethereum-erc20-contracts_v1.2.0", "date": "Fri, 22 Mar 2019 09:48:00 GMT", "comments": {} } diff --git a/packages/0xcert-ethereum-erc20-contracts/CHANGELOG.md b/packages/0xcert-ethereum-erc20-contracts/CHANGELOG.md index e33443562..ede5aa02f 100644 --- a/packages/0xcert-ethereum-erc20-contracts/CHANGELOG.md +++ b/packages/0xcert-ethereum-erc20-contracts/CHANGELOG.md @@ -2,7 +2,7 @@ This log was last generated on Fri, 22 Mar 2019 09:48:00 GMT and should not be manually modified. -## 1.1.0-alpha0 +## 1.2.0 Fri, 22 Mar 2019 09:48:00 GMT *Initial release* diff --git a/packages/0xcert-ethereum-erc20-contracts/package.json b/packages/0xcert-ethereum-erc20-contracts/package.json index c94d7790e..a5c057d57 100644 --- a/packages/0xcert-ethereum-erc20-contracts/package.json +++ b/packages/0xcert-ethereum-erc20-contracts/package.json @@ -1,6 +1,6 @@ { "name": "@0xcert/ethereum-erc20-contracts", - "version": "1.1.0-alpha0", + "version": "1.2.0", "description": "Smart contract implementation of the ERC-20 standard on the Ethereum blockchain.", "scripts": { "build": "npm run clean && npx specron compile && npx tsc", @@ -63,7 +63,7 @@ ], "license": "MIT", "devDependencies": { - "@0xcert/ethereum-utils-contracts": "1.1.0-alpha0", + "@0xcert/ethereum-utils-contracts": "1.2.0", "@specron/cli": "^0.5.6", "@specron/spec": "^0.5.6", "solc": "0.5.6", diff --git a/packages/0xcert-ethereum-erc721-contracts/CHANGELOG.json b/packages/0xcert-ethereum-erc721-contracts/CHANGELOG.json index 2d44e036f..a860ee17f 100644 --- a/packages/0xcert-ethereum-erc721-contracts/CHANGELOG.json +++ b/packages/0xcert-ethereum-erc721-contracts/CHANGELOG.json @@ -2,8 +2,8 @@ "name": "@0xcert/ethereum-erc721-contracts", "entries": [ { - "version": "1.1.0-alpha0", - "tag": "@0xcert/ethereum-erc721-contracts_v1.1.0-alpha0", + "version": "1.2.0", + "tag": "@0xcert/ethereum-erc721-contracts_v1.2.0", "date": "Fri, 22 Mar 2019 09:48:00 GMT", "comments": {} }, diff --git a/packages/0xcert-ethereum-erc721-contracts/CHANGELOG.md b/packages/0xcert-ethereum-erc721-contracts/CHANGELOG.md index bd8c02da6..ac92810b8 100644 --- a/packages/0xcert-ethereum-erc721-contracts/CHANGELOG.md +++ b/packages/0xcert-ethereum-erc721-contracts/CHANGELOG.md @@ -2,7 +2,7 @@ This log was last generated on Fri, 22 Mar 2019 09:48:00 GMT and should not be manually modified. -## 1.1.0-alpha0 +## 1.2.0 Fri, 22 Mar 2019 09:48:00 GMT *Version update only* diff --git a/packages/0xcert-ethereum-erc721-contracts/package.json b/packages/0xcert-ethereum-erc721-contracts/package.json index fad6ec3df..d9cd7c59a 100644 --- a/packages/0xcert-ethereum-erc721-contracts/package.json +++ b/packages/0xcert-ethereum-erc721-contracts/package.json @@ -1,6 +1,6 @@ { "name": "@0xcert/ethereum-erc721-contracts", - "version": "1.1.0-alpha0", + "version": "1.2.0", "description": "Smart contract implementation of the ERC-721 standard on the Ethereum blockchain.", "scripts": { "build": "npm run clean && npx specron compile && npx tsc", @@ -63,7 +63,7 @@ ], "license": "MIT", "devDependencies": { - "@0xcert/ethereum-utils-contracts": "1.1.0-alpha0", + "@0xcert/ethereum-utils-contracts": "1.2.0", "@specron/cli": "^0.5.6", "@specron/spec": "^0.5.6", "solc": "0.5.6", diff --git a/packages/0xcert-ethereum-generic-provider/CHANGELOG.json b/packages/0xcert-ethereum-generic-provider/CHANGELOG.json index c05f16289..6b9c85d47 100644 --- a/packages/0xcert-ethereum-generic-provider/CHANGELOG.json +++ b/packages/0xcert-ethereum-generic-provider/CHANGELOG.json @@ -2,8 +2,8 @@ "name": "@0xcert/ethereum-generic-provider", "entries": [ { - "version": "1.1.0-alpha0", - "tag": "@0xcert/ethereum-generic-provider_v1.1.0-alpha0", + "version": "1.2.0", + "tag": "@0xcert/ethereum-generic-provider_v1.2.0", "date": "Fri, 22 Mar 2019 09:48:00 GMT", "comments": {} } diff --git a/packages/0xcert-ethereum-generic-provider/CHANGELOG.md b/packages/0xcert-ethereum-generic-provider/CHANGELOG.md index 3fa548a9a..0f0d15bf8 100644 --- a/packages/0xcert-ethereum-generic-provider/CHANGELOG.md +++ b/packages/0xcert-ethereum-generic-provider/CHANGELOG.md @@ -2,7 +2,7 @@ This log was last generated on Fri, 22 Mar 2019 09:48:00 GMT and should not be manually modified. -## 1.1.0-alpha0 +## 1.2.0 Fri, 22 Mar 2019 09:48:00 GMT *Initial release* diff --git a/packages/0xcert-ethereum-generic-provider/package.json b/packages/0xcert-ethereum-generic-provider/package.json index 99b1d8864..f0e4717c2 100644 --- a/packages/0xcert-ethereum-generic-provider/package.json +++ b/packages/0xcert-ethereum-generic-provider/package.json @@ -1,6 +1,6 @@ { "name": "@0xcert/ethereum-generic-provider", - "version": "1.1.0-alpha0", + "version": "1.2.0", "description": "Basic implementation of communication provider for the Ethereum blockchain.", "main": "./dist/index.js", "types": "./dist/index.d.ts", @@ -67,7 +67,7 @@ ], "license": "MIT", "devDependencies": { - "@0xcert/ethereum-sandbox": "1.1.0-alpha0", + "@0xcert/ethereum-sandbox": "1.2.0", "@types/node": "^10.12.24", "@specron/cli": "^0.5.6", "@specron/spec": "^0.5.6", @@ -81,7 +81,7 @@ }, "dependencies": { "@0xcert/ethereum-utils": "1.2.0", - "@0xcert/scaffold": "1.1.0-alpha0", + "@0xcert/scaffold": "1.2.0", "events": "^3.0.0" } } diff --git a/packages/0xcert-ethereum-generic-provider/src/core/provider.ts b/packages/0xcert-ethereum-generic-provider/src/core/provider.ts index 2b11465e3..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 = this.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) => this.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 = this.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) => this.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 === this.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 = this.normalizeAddress(ledgerId); + const normalizedLedgerId = this.encoder.normalizeAddress(ledgerId); return !!this.unsafeRecipientIds.find((id) => id === normalizedLedgerId); } @@ -339,13 +350,4 @@ export class GenericProvider extends EventEmitter implements ProviderBase { return this._id; } - /** - * Normalizes the Ethereum address. - * NOTE: This method is here to easily extend the class for related platforms - * such as Wanchain. - */ - protected normalizeAddress(address: string): string { - return normalizeAddress(address); - } - } diff --git a/packages/0xcert-ethereum-http-provider/CHANGELOG.json b/packages/0xcert-ethereum-http-provider/CHANGELOG.json index acfeaa2d4..50460aec5 100644 --- a/packages/0xcert-ethereum-http-provider/CHANGELOG.json +++ b/packages/0xcert-ethereum-http-provider/CHANGELOG.json @@ -2,8 +2,8 @@ "name": "@0xcert/ethereum-http-provider", "entries": [ { - "version": "1.1.0-alpha0", - "tag": "@0xcert/ethereum-http-provider_v1.1.0-alpha0", + "version": "1.2.0", + "tag": "@0xcert/ethereum-http-provider_v1.2.0", "date": "Fri, 22 Mar 2019 09:48:00 GMT", "comments": {} } diff --git a/packages/0xcert-ethereum-http-provider/CHANGELOG.md b/packages/0xcert-ethereum-http-provider/CHANGELOG.md index d52c4bca8..aa150e5ac 100644 --- a/packages/0xcert-ethereum-http-provider/CHANGELOG.md +++ b/packages/0xcert-ethereum-http-provider/CHANGELOG.md @@ -2,7 +2,7 @@ This log was last generated on Fri, 22 Mar 2019 09:48:00 GMT and should not be manually modified. -## 1.1.0-alpha0 +## 1.2.0 Fri, 22 Mar 2019 09:48:00 GMT *Initial release* diff --git a/packages/0xcert-ethereum-http-provider/package.json b/packages/0xcert-ethereum-http-provider/package.json index 9a183ddff..d13675007 100644 --- a/packages/0xcert-ethereum-http-provider/package.json +++ b/packages/0xcert-ethereum-http-provider/package.json @@ -1,6 +1,6 @@ { "name": "@0xcert/ethereum-http-provider", - "version": "1.1.0-alpha0", + "version": "1.2.0", "description": "Implementation of HTTP communication provider for the Ethereum blockchain.", "main": "./dist/index.js", "types": "./dist/index.d.ts", @@ -67,7 +67,7 @@ ], "license": "MIT", "devDependencies": { - "@0xcert/ethereum-sandbox": "1.1.0-alpha0", + "@0xcert/ethereum-sandbox": "1.2.0", "@specron/cli": "^0.5.6", "@specron/spec": "^0.5.6", "nyc": "^13.1.0", @@ -78,7 +78,7 @@ "web3": "1.0.0-beta.37" }, "dependencies": { - "@0xcert/ethereum-generic-provider": "1.1.0-alpha0", - "@0xcert/utils": "1.1.0-alpha0" + "@0xcert/ethereum-generic-provider": "1.2.0", + "@0xcert/utils": "1.2.0" } } diff --git a/packages/0xcert-ethereum-metamask-provider/CHANGELOG.json b/packages/0xcert-ethereum-metamask-provider/CHANGELOG.json index 2eb6c8cd2..b6b9f0c6d 100644 --- a/packages/0xcert-ethereum-metamask-provider/CHANGELOG.json +++ b/packages/0xcert-ethereum-metamask-provider/CHANGELOG.json @@ -2,8 +2,8 @@ "name": "@0xcert/ethereum-metamask-provider", "entries": [ { - "version": "1.1.0-alpha0", - "tag": "@0xcert/ethereum-metamask-provider_v1.1.0-alpha0", + "version": "1.2.0", + "tag": "@0xcert/ethereum-metamask-provider_v1.2.0", "date": "Fri, 22 Mar 2019 09:48:00 GMT", "comments": {} } diff --git a/packages/0xcert-ethereum-metamask-provider/CHANGELOG.md b/packages/0xcert-ethereum-metamask-provider/CHANGELOG.md index 6b203feaf..499afd0c9 100644 --- a/packages/0xcert-ethereum-metamask-provider/CHANGELOG.md +++ b/packages/0xcert-ethereum-metamask-provider/CHANGELOG.md @@ -2,7 +2,7 @@ This log was last generated on Fri, 22 Mar 2019 09:48:00 GMT and should not be manually modified. -## 1.1.0-alpha0 +## 1.2.0 Fri, 22 Mar 2019 09:48:00 GMT *Initial release* diff --git a/packages/0xcert-ethereum-metamask-provider/package.json b/packages/0xcert-ethereum-metamask-provider/package.json index 120b12432..420c4486b 100644 --- a/packages/0xcert-ethereum-metamask-provider/package.json +++ b/packages/0xcert-ethereum-metamask-provider/package.json @@ -1,6 +1,6 @@ { "name": "@0xcert/ethereum-metamask-provider", - "version": "1.1.0-alpha0", + "version": "1.2.0", "description": "Implementation of MetaMask communication provider for the Ethereum blockchain.", "main": "./dist/index.js", "types": "./dist/index.d.ts", @@ -67,7 +67,7 @@ ], "license": "MIT", "devDependencies": { - "@0xcert/ethereum-sandbox": "1.1.0-alpha0", + "@0xcert/ethereum-sandbox": "1.2.0", "@specron/cli": "^0.5.6", "@specron/spec": "^0.5.6", "nyc": "^13.1.0", @@ -78,6 +78,6 @@ "web3": "1.0.0-beta.37" }, "dependencies": { - "@0xcert/ethereum-generic-provider": "1.1.0-alpha0" + "@0xcert/ethereum-generic-provider": "1.2.0" } } diff --git a/packages/0xcert-ethereum-order-gateway-contracts/CHANGELOG.json b/packages/0xcert-ethereum-order-gateway-contracts/CHANGELOG.json index 5a4e5a28e..6b2ebee3d 100644 --- a/packages/0xcert-ethereum-order-gateway-contracts/CHANGELOG.json +++ b/packages/0xcert-ethereum-order-gateway-contracts/CHANGELOG.json @@ -2,8 +2,8 @@ "name": "@0xcert/ethereum-order-gateway-contracts", "entries": [ { - "version": "1.1.0-alpha0", - "tag": "@0xcert/ethereum-order-gateway-contracts_v1.1.0-alpha0", + "version": "1.2.0", + "tag": "@0xcert/ethereum-order-gateway-contracts_v1.2.0", "date": "Fri, 22 Mar 2019 09:48:00 GMT", "comments": {} }, diff --git a/packages/0xcert-ethereum-order-gateway-contracts/CHANGELOG.md b/packages/0xcert-ethereum-order-gateway-contracts/CHANGELOG.md index e5e906252..0a85f89c7 100644 --- a/packages/0xcert-ethereum-order-gateway-contracts/CHANGELOG.md +++ b/packages/0xcert-ethereum-order-gateway-contracts/CHANGELOG.md @@ -2,7 +2,7 @@ This log was last generated on Fri, 22 Mar 2019 09:48:00 GMT and should not be manually modified. -## 1.1.0-alpha0 +## 1.2.0 Fri, 22 Mar 2019 09:48:00 GMT *Version update only* diff --git a/packages/0xcert-ethereum-order-gateway-contracts/package.json b/packages/0xcert-ethereum-order-gateway-contracts/package.json index 6699e45b2..b8b2d9c02 100644 --- a/packages/0xcert-ethereum-order-gateway-contracts/package.json +++ b/packages/0xcert-ethereum-order-gateway-contracts/package.json @@ -1,6 +1,6 @@ { "name": "@0xcert/ethereum-order-gateway-contracts", - "version": "1.1.0-alpha0", + "version": "1.2.0", "description": "Smart contracts used by the order gateway on the Ethereum blockchain.", "scripts": { "build": "npm run clean && npx specron compile && npx tsc", @@ -73,11 +73,11 @@ ], "license": "MIT", "devDependencies": { - "@0xcert/ethereum-utils-contracts": "1.1.0-alpha0", - "@0xcert/ethereum-erc20-contracts": "1.1.0-alpha0", - "@0xcert/ethereum-erc721-contracts": "1.1.0-alpha0", - "@0xcert/ethereum-xcert-contracts": "1.1.0-alpha0", - "@0xcert/ethereum-proxy-contracts": "1.1.0-alpha0", + "@0xcert/ethereum-utils-contracts": "1.2.0", + "@0xcert/ethereum-erc20-contracts": "1.2.0", + "@0xcert/ethereum-erc721-contracts": "1.2.0", + "@0xcert/ethereum-xcert-contracts": "1.2.0", + "@0xcert/ethereum-proxy-contracts": "1.2.0", "@specron/cli": "^0.5.6", "@specron/spec": "^0.5.6", "solc": "0.5.6", diff --git a/packages/0xcert-ethereum-order-gateway/CHANGELOG.json b/packages/0xcert-ethereum-order-gateway/CHANGELOG.json index ce98bcfbe..57fa83134 100644 --- a/packages/0xcert-ethereum-order-gateway/CHANGELOG.json +++ b/packages/0xcert-ethereum-order-gateway/CHANGELOG.json @@ -2,8 +2,8 @@ "name": "@0xcert/ethereum-order-gateway", "entries": [ { - "version": "1.1.0-alpha0", - "tag": "@0xcert/ethereum-order-gateway_v1.1.0-alpha0", + "version": "1.2.0", + "tag": "@0xcert/ethereum-order-gateway_v1.2.0", "date": "Fri, 22 Mar 2019 09:48:00 GMT", "comments": {} }, diff --git a/packages/0xcert-ethereum-order-gateway/CHANGELOG.md b/packages/0xcert-ethereum-order-gateway/CHANGELOG.md index 2e89afa0e..b2eb448ac 100644 --- a/packages/0xcert-ethereum-order-gateway/CHANGELOG.md +++ b/packages/0xcert-ethereum-order-gateway/CHANGELOG.md @@ -2,7 +2,7 @@ This log was last generated on Fri, 22 Mar 2019 09:48:00 GMT and should not be manually modified. -## 1.1.0-alpha0 +## 1.2.0 Fri, 22 Mar 2019 09:48:00 GMT *Version update only* diff --git a/packages/0xcert-ethereum-order-gateway/package.json b/packages/0xcert-ethereum-order-gateway/package.json index f0b33a508..0ebb2fec5 100644 --- a/packages/0xcert-ethereum-order-gateway/package.json +++ b/packages/0xcert-ethereum-order-gateway/package.json @@ -1,6 +1,6 @@ { "name": "@0xcert/ethereum-order-gateway", - "version": "1.1.0-alpha0", + "version": "1.2.0", "description": "Order gateway module for executing atomic operations on the Ethereum blockchain.", "main": "./dist/index.js", "types": "./dist/index.d.ts", @@ -67,7 +67,7 @@ ], "license": "MIT", "devDependencies": { - "@0xcert/ethereum-sandbox": "1.1.0-alpha0", + "@0xcert/ethereum-sandbox": "1.2.0", "@specron/cli": "^0.5.6", "@specron/spec": "^0.5.6", "nyc": "^13.1.0", @@ -78,9 +78,9 @@ "web3": "1.0.0-beta.37" }, "dependencies": { - "@0xcert/ethereum-generic-provider": "1.1.0-alpha0", + "@0xcert/ethereum-generic-provider": "1.2.0", "@0xcert/ethereum-utils": "1.2.0", - "@0xcert/scaffold": "1.1.0-alpha0", - "@0xcert/utils": "1.1.0-alpha0" + "@0xcert/scaffold": "1.2.0", + "@0xcert/utils": "1.2.0" } } diff --git a/packages/0xcert-ethereum-order-gateway/src/core/gateway.ts b/packages/0xcert-ethereum-order-gateway/src/core/gateway.ts index 60a32ac40..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'; @@ -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 = this.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 = this.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 = this.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 = this.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 = this.normalizeOrderIds(order); + order = normalizeOrderIds(order, this._provider); return isValidSignature(this, order, claim); } @@ -118,27 +117,9 @@ export class OrderGateway implements OrderGatewayBase { * @param order Order data. */ public async getOrderDataClaim(order: Order) { - order = this.normalizeOrderIds(order); + order = normalizeOrderIds(order, this._provider); return getOrderDataClaim(this, order); } - /** - * Normalizes the Ethereum address. - * NOTE: This method is here to easily extend the class for related platforms - * such as Wanchain. - */ - protected normalizeAddress(address: string): string { - return normalizeAddress(address); - } - - /** - * Normalizes the Ethereum addresses of an order. - * NOTE: This method is here to easily extend the class for related platforms - * such as Wanchain. - */ - protected normalizeOrderIds(order: Order): Order { - return normalizeOrderIds(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/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.json b/packages/0xcert-ethereum-proxy-contracts/CHANGELOG.json index ba4ccbacf..8b7b150c8 100644 --- a/packages/0xcert-ethereum-proxy-contracts/CHANGELOG.json +++ b/packages/0xcert-ethereum-proxy-contracts/CHANGELOG.json @@ -2,8 +2,8 @@ "name": "@0xcert/ethereum-proxy-contracts", "entries": [ { - "version": "1.1.0-alpha0", - "tag": "@0xcert/ethereum-proxy-contracts_v1.1.0-alpha0", + "version": "1.2.0", + "tag": "@0xcert/ethereum-proxy-contracts_v1.2.0", "date": "Fri, 22 Mar 2019 09:48:00 GMT", "comments": {} }, diff --git a/packages/0xcert-ethereum-proxy-contracts/CHANGELOG.md b/packages/0xcert-ethereum-proxy-contracts/CHANGELOG.md index cdcb52492..7d0e41a68 100644 --- a/packages/0xcert-ethereum-proxy-contracts/CHANGELOG.md +++ b/packages/0xcert-ethereum-proxy-contracts/CHANGELOG.md @@ -2,7 +2,7 @@ This log was last generated on Fri, 22 Mar 2019 09:48:00 GMT and should not be manually modified. -## 1.1.0-alpha0 +## 1.2.0 Fri, 22 Mar 2019 09:48:00 GMT *Version update only* diff --git a/packages/0xcert-ethereum-proxy-contracts/package.json b/packages/0xcert-ethereum-proxy-contracts/package.json index eec037da8..3974f77be 100644 --- a/packages/0xcert-ethereum-proxy-contracts/package.json +++ b/packages/0xcert-ethereum-proxy-contracts/package.json @@ -1,6 +1,6 @@ { "name": "@0xcert/ethereum-proxy-contracts", - "version": "1.1.0-alpha0", + "version": "1.2.0", "description": "Proxy smart contracts used by the order gateway when communicating with the Ethereum blockchain.", "scripts": { "build": "npm run clean && npx specron compile && npx tsc", @@ -64,10 +64,10 @@ "license": "MIT", "devDependencies": { "@0xcert/ethereum-utils": "1.2.0", - "@0xcert/ethereum-utils-contracts": "1.1.0-alpha0", - "@0xcert/ethereum-erc20-contracts": "1.1.0-alpha0", - "@0xcert/ethereum-erc721-contracts": "1.1.0-alpha0", - "@0xcert/ethereum-xcert-contracts": "1.1.0-alpha0", + "@0xcert/ethereum-utils-contracts": "1.2.0", + "@0xcert/ethereum-erc20-contracts": "1.2.0", + "@0xcert/ethereum-erc721-contracts": "1.2.0", + "@0xcert/ethereum-xcert-contracts": "1.2.0", "@specron/cli": "^0.5.6", "@specron/spec": "^0.5.6", "solc": "0.5.6", diff --git a/packages/0xcert-ethereum-sandbox/CHANGELOG.json b/packages/0xcert-ethereum-sandbox/CHANGELOG.json index 02869febe..2aac8477a 100644 --- a/packages/0xcert-ethereum-sandbox/CHANGELOG.json +++ b/packages/0xcert-ethereum-sandbox/CHANGELOG.json @@ -2,8 +2,8 @@ "name": "@0xcert/ethereum-sandbox", "entries": [ { - "version": "1.1.0-alpha0", - "tag": "@0xcert/ethereum-sandbox_v1.1.0-alpha0", + "version": "1.2.0", + "tag": "@0xcert/ethereum-sandbox_v1.2.0", "date": "Fri, 22 Mar 2019 09:48:00 GMT", "comments": {} }, diff --git a/packages/0xcert-ethereum-sandbox/CHANGELOG.md b/packages/0xcert-ethereum-sandbox/CHANGELOG.md index 11dd57c2d..c205e3e3e 100644 --- a/packages/0xcert-ethereum-sandbox/CHANGELOG.md +++ b/packages/0xcert-ethereum-sandbox/CHANGELOG.md @@ -2,7 +2,7 @@ This log was last generated on Fri, 22 Mar 2019 09:48:00 GMT and should not be manually modified. -## 1.1.0-alpha0 +## 1.2.0 Fri, 22 Mar 2019 09:48:00 GMT *Version update only* diff --git a/packages/0xcert-ethereum-sandbox/package.json b/packages/0xcert-ethereum-sandbox/package.json index 762ca3b3a..a8a78883a 100644 --- a/packages/0xcert-ethereum-sandbox/package.json +++ b/packages/0xcert-ethereum-sandbox/package.json @@ -1,6 +1,6 @@ { "name": "@0xcert/ethereum-sandbox", - "version": "1.1.0-alpha0", + "version": "1.2.0", "description": "Test server for local running testing of modules on the Ethereum blockchain.", "main": "./dist/index.js", "types": "./dist/index.d.ts", @@ -76,10 +76,10 @@ "web3": "1.0.0-beta.37" }, "dependencies": { - "@0xcert/ethereum-order-gateway-contracts": "1.1.0-alpha0", - "@0xcert/ethereum-erc20-contracts": "1.1.0-alpha0", - "@0xcert/ethereum-erc721-contracts": "1.1.0-alpha0", - "@0xcert/ethereum-proxy-contracts": "1.1.0-alpha0", - "@0xcert/ethereum-xcert-contracts": "1.1.0-alpha0" + "@0xcert/ethereum-order-gateway-contracts": "1.2.0", + "@0xcert/ethereum-erc20-contracts": "1.2.0", + "@0xcert/ethereum-erc721-contracts": "1.2.0", + "@0xcert/ethereum-proxy-contracts": "1.2.0", + "@0xcert/ethereum-xcert-contracts": "1.2.0" } } diff --git a/packages/0xcert-ethereum-utils-contracts/CHANGELOG.json b/packages/0xcert-ethereum-utils-contracts/CHANGELOG.json index 7780562de..f418356be 100644 --- a/packages/0xcert-ethereum-utils-contracts/CHANGELOG.json +++ b/packages/0xcert-ethereum-utils-contracts/CHANGELOG.json @@ -2,8 +2,8 @@ "name": "@0xcert/ethereum-utils-contracts", "entries": [ { - "version": "1.1.0-alpha0", - "tag": "@0xcert/ethereum-utils-contracts_v1.1.0-alpha0", + "version": "1.2.0", + "tag": "@0xcert/ethereum-utils-contracts_v1.2.0", "date": "Fri, 22 Mar 2019 09:48:00 GMT", "comments": {} }, diff --git a/packages/0xcert-ethereum-utils-contracts/CHANGELOG.md b/packages/0xcert-ethereum-utils-contracts/CHANGELOG.md index 10a2508eb..eb3045b20 100644 --- a/packages/0xcert-ethereum-utils-contracts/CHANGELOG.md +++ b/packages/0xcert-ethereum-utils-contracts/CHANGELOG.md @@ -2,7 +2,7 @@ This log was last generated on Fri, 22 Mar 2019 09:48:00 GMT and should not be manually modified. -## 1.1.0-alpha0 +## 1.2.0 Fri, 22 Mar 2019 09:48:00 GMT *Version update only* diff --git a/packages/0xcert-ethereum-utils-contracts/package.json b/packages/0xcert-ethereum-utils-contracts/package.json index 1c4a9bda7..3911b79a4 100644 --- a/packages/0xcert-ethereum-utils-contracts/package.json +++ b/packages/0xcert-ethereum-utils-contracts/package.json @@ -1,7 +1,7 @@ { "name": "@0xcert/ethereum-utils-contracts", "description": "General utility module with helper smart contracts.", - "version": "1.1.0-alpha0", + "version": "1.2.0", "scripts": { "build": "npm run clean && npx specron compile && npx tsc", "clean": "rm -Rf ./build", 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.json b/packages/0xcert-ethereum-value-ledger/CHANGELOG.json index 548057a7c..4e4b79453 100644 --- a/packages/0xcert-ethereum-value-ledger/CHANGELOG.json +++ b/packages/0xcert-ethereum-value-ledger/CHANGELOG.json @@ -2,8 +2,8 @@ "name": "@0xcert/ethereum-value-ledger", "entries": [ { - "version": "1.1.0-alpha0", - "tag": "@0xcert/ethereum-value-ledger_v1.1.0-alpha0", + "version": "1.2.0", + "tag": "@0xcert/ethereum-value-ledger_v1.2.0", "date": "Fri, 22 Mar 2019 09:48:00 GMT", "comments": {} } diff --git a/packages/0xcert-ethereum-value-ledger/CHANGELOG.md b/packages/0xcert-ethereum-value-ledger/CHANGELOG.md index dbd618977..c7c651ef4 100644 --- a/packages/0xcert-ethereum-value-ledger/CHANGELOG.md +++ b/packages/0xcert-ethereum-value-ledger/CHANGELOG.md @@ -2,7 +2,7 @@ This log was last generated on Fri, 22 Mar 2019 09:48:00 GMT and should not be manually modified. -## 1.1.0-alpha0 +## 1.2.0 Fri, 22 Mar 2019 09:48:00 GMT *Initial release* diff --git a/packages/0xcert-ethereum-value-ledger/package.json b/packages/0xcert-ethereum-value-ledger/package.json index d3fb2ca4b..4b121406f 100644 --- a/packages/0xcert-ethereum-value-ledger/package.json +++ b/packages/0xcert-ethereum-value-ledger/package.json @@ -1,6 +1,6 @@ { "name": "@0xcert/ethereum-value-ledger", - "version": "1.1.0-alpha0", + "version": "1.2.0", "description": "Value ledger module for currency management on the Ethereum blockchain.", "main": "./dist/index.js", "types": "./dist/index.d.ts", @@ -67,8 +67,8 @@ ], "license": "MIT", "devDependencies": { - "@0xcert/ethereum-order-gateway": "1.1.0-alpha0", - "@0xcert/ethereum-sandbox": "1.1.0-alpha0", + "@0xcert/ethereum-order-gateway": "1.2.0", + "@0xcert/ethereum-sandbox": "1.2.0", "@specron/cli": "^0.5.6", "@specron/spec": "^0.5.6", "nyc": "^13.1.0", @@ -79,9 +79,9 @@ "web3": "1.0.0-beta.37" }, "dependencies": { - "@0xcert/ethereum-generic-provider": "1.1.0-alpha0", + "@0xcert/ethereum-generic-provider": "1.2.0", "@0xcert/ethereum-utils": "1.2.0", - "@0xcert/scaffold": "1.1.0-alpha0", - "@0xcert/utils": "1.1.0-alpha0" + "@0xcert/scaffold": "1.2.0", + "@0xcert/utils": "1.2.0" } } diff --git a/packages/0xcert-ethereum-value-ledger/src/core/ledger.ts b/packages/0xcert-ethereum-value-ledger/src/core/ledger.ts index 05a2ff0f1..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'; @@ -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 = this.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 = this.normalizeAddress(accountId); - spenderId = this.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 = this.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 = this.normalizeAddress(accountId); - spenderId = this.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 = this.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 = this.normalizeAddress(accountId as string); + accountId = this._provider.encoder.normalizeAddress(accountId as string); return approveAccount(this, accountId, '0'); } @@ -157,21 +157,12 @@ export class ValueLedger implements ValueLedgerBase { * @param recipe Data needed for the transfer. */ public async transferValue(recipe: ValueLedgerTransferRecipe): Promise { - const senderId = this.normalizeAddress(recipe.senderId); - const receiverId = this.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) : transfer(this, receiverId, recipe.value); } - /** - * Normalizes the Ethereum address. - * NOTE: This method is here to easily extend the class for related platforms - * such as Wanchain. - */ - protected normalizeAddress(address: string): string { - return normalizeAddress(address); - } - } 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.json b/packages/0xcert-ethereum-xcert-contracts/CHANGELOG.json index 91c14038d..46f49c6f0 100644 --- a/packages/0xcert-ethereum-xcert-contracts/CHANGELOG.json +++ b/packages/0xcert-ethereum-xcert-contracts/CHANGELOG.json @@ -2,8 +2,8 @@ "name": "@0xcert/ethereum-xcert-contracts", "entries": [ { - "version": "1.1.0-alpha0", - "tag": "@0xcert/ethereum-xcert-contracts_v1.1.0-alpha0", + "version": "1.2.0", + "tag": "@0xcert/ethereum-xcert-contracts_v1.2.0", "date": "Fri, 22 Mar 2019 09:48:00 GMT", "comments": {} }, diff --git a/packages/0xcert-ethereum-xcert-contracts/CHANGELOG.md b/packages/0xcert-ethereum-xcert-contracts/CHANGELOG.md index e247f5afe..bd9eb3e83 100644 --- a/packages/0xcert-ethereum-xcert-contracts/CHANGELOG.md +++ b/packages/0xcert-ethereum-xcert-contracts/CHANGELOG.md @@ -2,7 +2,7 @@ This log was last generated on Fri, 22 Mar 2019 09:48:00 GMT and should not be manually modified. -## 1.1.0-alpha0 +## 1.2.0 Fri, 22 Mar 2019 09:48:00 GMT *Version update only* diff --git a/packages/0xcert-ethereum-xcert-contracts/package.json b/packages/0xcert-ethereum-xcert-contracts/package.json index 9c0a5ffe9..ede67c2fa 100644 --- a/packages/0xcert-ethereum-xcert-contracts/package.json +++ b/packages/0xcert-ethereum-xcert-contracts/package.json @@ -1,7 +1,7 @@ { "name": "@0xcert/ethereum-xcert-contracts", "description": "Smart contracts used by the Asset ledger on the Ethereum blockchain.", - "version": "1.1.0-alpha0", + "version": "1.2.0", "scripts": { "build": "npm run clean && npx specron compile && npx tsc", "clean": "rm -Rf ./build", @@ -61,8 +61,8 @@ ], "license": "MIT", "devDependencies": { - "@0xcert/ethereum-utils-contracts": "1.1.0-alpha0", - "@0xcert/ethereum-erc721-contracts": "1.1.0-alpha0", + "@0xcert/ethereum-utils-contracts": "1.2.0", + "@0xcert/ethereum-erc721-contracts": "1.2.0", "@specron/cli": "^0.5.6", "@specron/spec": "^0.5.6", "solc": "0.5.6", diff --git a/packages/0xcert-merkle/CHANGELOG.json b/packages/0xcert-merkle/CHANGELOG.json index 2b0083f4d..511879c64 100644 --- a/packages/0xcert-merkle/CHANGELOG.json +++ b/packages/0xcert-merkle/CHANGELOG.json @@ -2,8 +2,8 @@ "name": "@0xcert/merkle", "entries": [ { - "version": "1.1.0-alpha0", - "tag": "@0xcert/merkle_v1.1.0-alpha0", + "version": "1.2.0", + "tag": "@0xcert/merkle_v1.2.0", "date": "Fri, 22 Mar 2019 09:48:00 GMT", "comments": {} }, diff --git a/packages/0xcert-merkle/CHANGELOG.md b/packages/0xcert-merkle/CHANGELOG.md index 2759d9632..986256c66 100644 --- a/packages/0xcert-merkle/CHANGELOG.md +++ b/packages/0xcert-merkle/CHANGELOG.md @@ -2,7 +2,7 @@ This log was last generated on Fri, 22 Mar 2019 09:48:00 GMT and should not be manually modified. -## 1.1.0-alpha0 +## 1.2.0 Fri, 22 Mar 2019 09:48:00 GMT *Version update only* diff --git a/packages/0xcert-merkle/package.json b/packages/0xcert-merkle/package.json index 4ec34efd0..92114d5bc 100644 --- a/packages/0xcert-merkle/package.json +++ b/packages/0xcert-merkle/package.json @@ -1,6 +1,6 @@ { "name": "@0xcert/merkle", - "version": "1.1.0-alpha0", + "version": "1.2.0", "description": "Implementation of basic functions of binary Merkle tree.", "main": "./dist/index.js", "types": "./dist/index.d.ts", @@ -64,7 +64,7 @@ ], "license": "MIT", "devDependencies": { - "@0xcert/utils": "1.1.0-alpha0", + "@0xcert/utils": "1.2.0", "@hayspec/cli": "^0.8.3", "@hayspec/spec": "^0.8.3", "nyc": "^13.1.0", diff --git a/packages/0xcert-scaffold/CHANGELOG.json b/packages/0xcert-scaffold/CHANGELOG.json index bd262f366..c03f3c2f8 100644 --- a/packages/0xcert-scaffold/CHANGELOG.json +++ b/packages/0xcert-scaffold/CHANGELOG.json @@ -2,8 +2,8 @@ "name": "@0xcert/scaffold", "entries": [ { - "version": "1.1.0-alpha0", - "tag": "@0xcert/scaffold_v1.1.0-alpha0", + "version": "1.2.0", + "tag": "@0xcert/scaffold_v1.2.0", "date": "Fri, 22 Mar 2019 09:48:00 GMT", "comments": {} }, diff --git a/packages/0xcert-scaffold/CHANGELOG.md b/packages/0xcert-scaffold/CHANGELOG.md index 506aaf889..8e0c1801a 100644 --- a/packages/0xcert-scaffold/CHANGELOG.md +++ b/packages/0xcert-scaffold/CHANGELOG.md @@ -2,7 +2,7 @@ This log was last generated on Fri, 22 Mar 2019 09:48:00 GMT and should not be manually modified. -## 1.1.0-alpha0 +## 1.2.0 Fri, 22 Mar 2019 09:48:00 GMT *Version update only* diff --git a/packages/0xcert-scaffold/package.json b/packages/0xcert-scaffold/package.json index b2682ca83..3ac3783ab 100644 --- a/packages/0xcert-scaffold/package.json +++ b/packages/0xcert-scaffold/package.json @@ -1,6 +1,6 @@ { "name": "@0xcert/scaffold", - "version": "1.1.0-alpha0", + "version": "1.2.0", "description": "Overarching module with types, enums, and interfaces for easier development of interoperable modules.", "main": "./dist/index.js", "types": "./dist/index.d.ts", diff --git a/packages/0xcert-utils/CHANGELOG.json b/packages/0xcert-utils/CHANGELOG.json index 07bc096e7..54f24cdc7 100644 --- a/packages/0xcert-utils/CHANGELOG.json +++ b/packages/0xcert-utils/CHANGELOG.json @@ -2,8 +2,8 @@ "name": "@0xcert/utils", "entries": [ { - "version": "1.1.0-alpha0", - "tag": "@0xcert/utils_v1.1.0-alpha0", + "version": "1.2.0", + "tag": "@0xcert/utils_v1.2.0", "date": "Fri, 22 Mar 2019 09:48:00 GMT", "comments": {} }, diff --git a/packages/0xcert-utils/CHANGELOG.md b/packages/0xcert-utils/CHANGELOG.md index 464d4919b..690c5a1d9 100644 --- a/packages/0xcert-utils/CHANGELOG.md +++ b/packages/0xcert-utils/CHANGELOG.md @@ -2,7 +2,7 @@ This log was last generated on Fri, 22 Mar 2019 09:48:00 GMT and should not be manually modified. -## 1.1.0-alpha0 +## 1.2.0 Fri, 22 Mar 2019 09:48:00 GMT *Version update only* diff --git a/packages/0xcert-utils/package.json b/packages/0xcert-utils/package.json index 7b922511f..44a0bd441 100644 --- a/packages/0xcert-utils/package.json +++ b/packages/0xcert-utils/package.json @@ -1,6 +1,6 @@ { "name": "@0xcert/utils", - "version": "1.1.0-alpha0", + "version": "1.2.0", "description": "General utility module with common helper functions.", "main": "./dist/index.js", "types": "./dist/index.d.ts", diff --git a/packages/0xcert-vue-example/package.json b/packages/0xcert-vue-example/package.json index 25c34b8d2..efe29b9ad 100644 --- a/packages/0xcert-vue-example/package.json +++ b/packages/0xcert-vue-example/package.json @@ -8,13 +8,13 @@ "test": "" }, "dependencies": { - "@0xcert/cert": "1.1.0-alpha0", - "@0xcert/conventions": "1.1.0-alpha0", - "@0xcert/ethereum-asset-ledger": "1.1.0-alpha0", - "@0xcert/ethereum-order-gateway": "1.1.0-alpha0", - "@0xcert/ethereum-value-ledger": "1.1.0-alpha0", - "@0xcert/ethereum-metamask-provider": "1.1.0-alpha0", - "@0xcert/vue-plugin": "1.1.0-alpha0", + "@0xcert/cert": "1.2.0", + "@0xcert/conventions": "1.2.0", + "@0xcert/ethereum-asset-ledger": "1.2.0", + "@0xcert/ethereum-order-gateway": "1.2.0", + "@0xcert/ethereum-value-ledger": "1.2.0", + "@0xcert/ethereum-metamask-provider": "1.2.0", + "@0xcert/vue-plugin": "1.2.0", "nuxt": "^2.3.1" } } diff --git a/packages/0xcert-vue-plugin/CHANGELOG.json b/packages/0xcert-vue-plugin/CHANGELOG.json index b576f26ff..dd2ccf5fe 100644 --- a/packages/0xcert-vue-plugin/CHANGELOG.json +++ b/packages/0xcert-vue-plugin/CHANGELOG.json @@ -2,8 +2,8 @@ "name": "@0xcert/vue-plugin", "entries": [ { - "version": "1.1.0-alpha0", - "tag": "@0xcert/vue-plugin_v1.1.0-alpha0", + "version": "1.2.0", + "tag": "@0xcert/vue-plugin_v1.2.0", "date": "Fri, 22 Mar 2019 09:48:00 GMT", "comments": {} } diff --git a/packages/0xcert-vue-plugin/CHANGELOG.md b/packages/0xcert-vue-plugin/CHANGELOG.md index edec6d402..c42544c33 100644 --- a/packages/0xcert-vue-plugin/CHANGELOG.md +++ b/packages/0xcert-vue-plugin/CHANGELOG.md @@ -2,7 +2,7 @@ This log was last generated on Fri, 22 Mar 2019 09:48:00 GMT and should not be manually modified. -## 1.1.0-alpha0 +## 1.2.0 Fri, 22 Mar 2019 09:48:00 GMT *Initial release* diff --git a/packages/0xcert-vue-plugin/package.json b/packages/0xcert-vue-plugin/package.json index 463157b98..d4e08466e 100644 --- a/packages/0xcert-vue-plugin/package.json +++ b/packages/0xcert-vue-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@0xcert/vue-plugin", - "version": "1.1.0-alpha0", + "version": "1.2.0", "description": "Implementation of VueJS plug-in.", "main": "./dist/index.js", "types": "./dist/index.d.ts", @@ -72,6 +72,6 @@ "typescript": "^3.1.1" }, "dependencies": { - "@0xcert/scaffold": "1.1.0-alpha0" + "@0xcert/scaffold": "1.2.0" } } diff --git a/packages/0xcert-wanchain-asset-ledger/package.json b/packages/0xcert-wanchain-asset-ledger/package.json index 0228a1021..ec77c7e31 100644 --- a/packages/0xcert-wanchain-asset-ledger/package.json +++ b/packages/0xcert-wanchain-asset-ledger/package.json @@ -1,6 +1,6 @@ { "name": "@0xcert/wanchain-asset-ledger", - "version": "1.1.0-alpha0", + "version": "1.2.0", "description": "Asset ledger module for asset management on the Wanchain blockchain.", "main": "./dist/index.js", "types": "./dist/index.d.ts", @@ -64,6 +64,7 @@ ], "license": "MIT", "devDependencies": { + "@0xcert/ethereum-generic-provider": "1.2.0", "@hayspec/cli": "^0.8.3", "@hayspec/spec": "^0.8.3", "nyc": "^13.1.0", @@ -72,7 +73,6 @@ "typescript": "^3.1.1" }, "dependencies": { - "@0xcert/ethereum-asset-ledger": "1.1.0-alpha0", - "@0xcert/wanchain-utils": "1.1.0-alpha0" + "@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 index c8b3dbf0f..8ece5f08b 100644 --- a/packages/0xcert-wanchain-asset-ledger/src/core/ledger.ts +++ b/packages/0xcert-wanchain-asset-ledger/src/core/ledger.ts @@ -1,16 +1,6 @@ import * as ethereum from '@0xcert/ethereum-asset-ledger'; -import { normalizeAddress } from '@0xcert/wanchain-utils'; /** * Wanchain asset ledger implementation. */ -export class AssetLedger extends ethereum.AssetLedger { - - /** - * OVERRIDE: Normalizes the Wanchain address. - */ - protected normalizeAddress(address: string): string { - return normalizeAddress(address); - } - -} +export class AssetLedger extends ethereum.AssetLedger { } diff --git a/packages/0xcert-wanchain-asset-ledger/src/tests/core/ledger.test.ts b/packages/0xcert-wanchain-asset-ledger/src/tests/core/ledger.test.ts deleted file mode 100644 index 705ec2047..000000000 --- a/packages/0xcert-wanchain-asset-ledger/src/tests/core/ledger.test.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Spec } from '@hayspec/spec'; -import { AssetLedger } from '../..'; - -const spec = new Spec(); - -spec.test('Check normalize address override', (ctx) => { - const ledger1 = new AssetLedger(null, '0xE96D860C8BBB30F6831E6E65D327295B7A0C524F'); - ctx.is(ledger1.id, '0xe96d860c8bbb30f6831e6e65d327295b7a0c524f'); - // ctx.is(ledger1.id, '0xE96d860c8bbb30f6831e6e65D327295b7a0c524F'); - - const ledger2 = AssetLedger.getInstance(null, '0xE96D860C8BBB30F6831E6E65D327295B7A0C524F'); - ctx.is(ledger2.id, '0xe96d860c8bbb30f6831e6e65d327295b7a0c524f'); - // ctx.is(ledger2.id, '0xE96d860c8bbb30f6831e6e65D327295b7a0c524F'); -}); - -export default spec; diff --git a/packages/0xcert-wanchain-http-provider/package.json b/packages/0xcert-wanchain-http-provider/package.json index 86fd5773e..14986e488 100644 --- a/packages/0xcert-wanchain-http-provider/package.json +++ b/packages/0xcert-wanchain-http-provider/package.json @@ -1,6 +1,6 @@ { "name": "@0xcert/wanchain-http-provider", - "version": "1.1.0-alpha0", + "version": "1.2.0", "description": "Implementation of HTTP communication provider for the Wanchain blockchain.", "main": "./dist/index.js", "types": "./dist/index.d.ts", @@ -72,7 +72,8 @@ "typescript": "^3.1.1" }, "dependencies": { - "@0xcert/ethereum-http-provider": "1.1.0-alpha0", - "@0xcert/wanchain-utils": "1.1.0-alpha0" + "@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 index 05f2bf453..8bad29943 100644 --- a/packages/0xcert-wanchain-http-provider/src/core/provider.ts +++ b/packages/0xcert-wanchain-http-provider/src/core/provider.ts @@ -1,16 +1,143 @@ -import * as ethereum from '@0xcert/ethereum-http-provider'; -import { normalizeAddress } from '@0xcert/wanchain-utils'; +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 ethereum.HttpProvider { +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; + } /** - * OVERRIDE: Normalizes the Wanchain address. + * Sends the RPC call. */ - protected normalizeAddress(address: string): string { - return normalizeAddress(address); + 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 index 46fb926f2..8c0e5caa9 100644 --- a/packages/0xcert-wanchain-http-provider/src/index.ts +++ b/packages/0xcert-wanchain-http-provider/src/index.ts @@ -1,3 +1,2 @@ -export { MutationEvent, ProviderEvent, ProviderIssue, ProviderError, parseError, MutationStatus, - Mutation, GenericProvider, SignMethod } from '@0xcert/ethereum-http-provider'; +export * from '@0xcert/ethereum-generic-provider'; export * from './core/provider'; 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-order-gateway/CHANGELOG.json b/packages/0xcert-wanchain-order-gateway/CHANGELOG.json index ce98bcfbe..57fa83134 100644 --- a/packages/0xcert-wanchain-order-gateway/CHANGELOG.json +++ b/packages/0xcert-wanchain-order-gateway/CHANGELOG.json @@ -2,8 +2,8 @@ "name": "@0xcert/ethereum-order-gateway", "entries": [ { - "version": "1.1.0-alpha0", - "tag": "@0xcert/ethereum-order-gateway_v1.1.0-alpha0", + "version": "1.2.0", + "tag": "@0xcert/ethereum-order-gateway_v1.2.0", "date": "Fri, 22 Mar 2019 09:48:00 GMT", "comments": {} }, diff --git a/packages/0xcert-wanchain-order-gateway/CHANGELOG.md b/packages/0xcert-wanchain-order-gateway/CHANGELOG.md index 2e89afa0e..b2eb448ac 100644 --- a/packages/0xcert-wanchain-order-gateway/CHANGELOG.md +++ b/packages/0xcert-wanchain-order-gateway/CHANGELOG.md @@ -2,7 +2,7 @@ This log was last generated on Fri, 22 Mar 2019 09:48:00 GMT and should not be manually modified. -## 1.1.0-alpha0 +## 1.2.0 Fri, 22 Mar 2019 09:48:00 GMT *Version update only* diff --git a/packages/0xcert-wanchain-order-gateway/package.json b/packages/0xcert-wanchain-order-gateway/package.json index 632ff0836..493c2f448 100644 --- a/packages/0xcert-wanchain-order-gateway/package.json +++ b/packages/0xcert-wanchain-order-gateway/package.json @@ -1,6 +1,6 @@ { "name": "@0xcert/wanchain-order-gateway", - "version": "1.1.0-alpha0", + "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", @@ -72,7 +72,6 @@ "typescript": "^3.1.1" }, "dependencies": { - "@0xcert/ethereum-order-gateway": "1.1.0-alpha0", - "@0xcert/wanchain-utils": "1.1.0-alpha0" + "@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 index 880c3d6e8..386338e24 100644 --- a/packages/0xcert-wanchain-order-gateway/src/core/gateway.ts +++ b/packages/0xcert-wanchain-order-gateway/src/core/gateway.ts @@ -1,28 +1,6 @@ import * as ethereum from '@0xcert/ethereum-order-gateway'; -import { normalizeAddress } from '@0xcert/wanchain-utils'; -import { normalizeOrderIds } from '../lib/order'; /** * Wanchain order gateway implementation. */ -export class OrderGateway extends ethereum.OrderGateway { - - /** - * Normalizes the Ethereum address. - * NOTE: This method is here to easily extend the class for related platforms - * such as Wanchain. - */ - protected normalizeAddress(address: string): string { - return normalizeAddress(address); - } - - /** - * Normalizes the Ethereum addresses of an order. - * NOTE: This method is here to easily extend the class for related platforms - * such as Wanchain. - */ - protected normalizeOrderIds(order: ethereum.Order): ethereum.Order { - return normalizeOrderIds(order); - } - -} +export class OrderGateway extends ethereum.OrderGateway {} diff --git a/packages/0xcert-wanchain-order-gateway/src/lib/order.ts b/packages/0xcert-wanchain-order-gateway/src/lib/order.ts deleted file mode 100644 index 5a7d0a3b3..000000000 --- a/packages/0xcert-wanchain-order-gateway/src/lib/order.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { Order } from '@0xcert/ethereum-order-gateway'; -import { normalizeAddress } from '@0xcert/wanchain-utils'; - -/** - * Normalizes order IDs and returns a new order object. - * @param order Order instance. - */ -export function normalizeOrderIds(order: Order): Order { - order = JSON.parse(JSON.stringify(order)); - order.makerId = normalizeAddress(order.makerId); - order.takerId = normalizeAddress(order.takerId); - order.actions.forEach((action) => { - action.ledgerId = normalizeAddress(action.ledgerId); - action.receiverId = normalizeAddress(action.receiverId); - action.senderId = normalizeAddress(action.senderId); - }); - return order; -} diff --git a/packages/0xcert-wanchain-utils/package.json b/packages/0xcert-wanchain-utils/package.json index c62aa97e0..238eae13b 100644 --- a/packages/0xcert-wanchain-utils/package.json +++ b/packages/0xcert-wanchain-utils/package.json @@ -1,6 +1,6 @@ { "name": "@0xcert/wanchain-utils", - "version": "1.1.0-alpha0", + "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", @@ -71,6 +71,7 @@ "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 index d641cb556..db0ca8add 100644 --- a/packages/0xcert-wanchain-utils/src/index.ts +++ b/packages/0xcert-wanchain-utils/src/index.ts @@ -1 +1 @@ -export * from './lib/normalize-address'; +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/lib/normalize-address.ts b/packages/0xcert-wanchain-utils/src/lib/normalize-address.ts deleted file mode 100644 index 6e1002875..000000000 --- a/packages/0xcert-wanchain-utils/src/lib/normalize-address.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { normalizeAddress as normalizeEthereumAddress } from '@0xcert/ethereum-utils/dist/lib/normalize-address'; - -/** - * Converts Wanchain address to checksum format. - * NOTE: Wanchain uses basically the same mechanism, you only have to inverse - * lower and upper case on characters. - */ -export function 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 index 0d967adf0..05c16e92f 100644 --- a/packages/0xcert-wanchain-utils/src/tests/normalize-address.test.ts +++ b/packages/0xcert-wanchain-utils/src/tests/normalize-address.test.ts @@ -1,14 +1,15 @@ import { Spec } from '@hayspec/spec'; -import { normalizeAddress } from '../lib/normalize-address'; +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(normalizeAddress(null), null); + ctx.is(encoder.normalizeAddress(null), null); // ctx.throws(() => normalizeAddress('dfg')); }); diff --git a/packages/0xcert-wanchain-value-ledger/package.json b/packages/0xcert-wanchain-value-ledger/package.json index e527a0b38..0ca15a7a2 100644 --- a/packages/0xcert-wanchain-value-ledger/package.json +++ b/packages/0xcert-wanchain-value-ledger/package.json @@ -1,6 +1,6 @@ { "name": "@0xcert/wanchain-value-ledger", - "version": "1.1.0-alpha0", + "version": "1.2.0", "description": "Value ledger module for currency management on the Wanchain blockchain.", "main": "./dist/index.js", "types": "./dist/index.d.ts", @@ -72,7 +72,6 @@ "typescript": "^3.1.1" }, "dependencies": { - "@0xcert/ethereum-value-ledger": "1.1.0-alpha0", - "@0xcert/wanchain-utils": "1.1.0-alpha0" + "@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 index dabf26839..d7c496281 100644 --- a/packages/0xcert-wanchain-value-ledger/src/core/ledger.ts +++ b/packages/0xcert-wanchain-value-ledger/src/core/ledger.ts @@ -1,16 +1,6 @@ import * as ethereum from '@0xcert/ethereum-value-ledger'; -import { normalizeAddress } from '@0xcert/wanchain-utils'; /** * Wanchain value ledger implementation. */ -export class ValueLedger extends ethereum.ValueLedger { - - /** - * OVERRIDE: Normalizes the Wanchain address. - */ - protected normalizeAddress(address: string): string { - return normalizeAddress(address); - } - -} +export class ValueLedger extends ethereum.ValueLedger {} diff --git a/packages/0xcert-webpack/package.json b/packages/0xcert-webpack/package.json index b50780b74..834f00278 100644 --- a/packages/0xcert-webpack/package.json +++ b/packages/0xcert-webpack/package.json @@ -9,16 +9,16 @@ }, "license": "MIT", "devDependencies": { - "@0xcert/cert": "1.1.0-alpha0", - "@0xcert/ethereum-asset-ledger": "1.1.0-alpha0", - "@0xcert/ethereum-http-provider": "1.1.0-alpha0", - "@0xcert/ethereum-metamask-provider": "1.1.0-alpha0", - "@0xcert/ethereum-order-gateway": "1.1.0-alpha0", - "@0xcert/ethereum-value-ledger": "1.1.0-alpha0", - "@0xcert/wanchain-asset-ledger": "1.1.0-alpha0", - "@0xcert/wanchain-http-provider": "1.1.0-alpha0", - "@0xcert/wanchain-order-gateway": "1.1.0-alpha0", - "@0xcert/wanchain-value-ledger": "1.1.0-alpha0", + "@0xcert/cert": "1.2.0", + "@0xcert/ethereum-asset-ledger": "1.2.0", + "@0xcert/ethereum-http-provider": "1.2.0", + "@0xcert/ethereum-metamask-provider": "1.2.0", + "@0xcert/ethereum-order-gateway": "1.2.0", + "@0xcert/ethereum-value-ledger": "1.2.0", + "@0xcert/wanchain-asset-ledger": "1.2.0", + "@0xcert/wanchain-http-provider": "1.2.0", + "@0xcert/wanchain-order-gateway": "1.2.0", + "@0xcert/wanchain-value-ledger": "1.2.0", "webpack": "^4.25.0", "webpack-cli": "^3.1.2" } diff --git a/rush.json b/rush.json index f86b0fdcd..680048456 100644 --- a/rush.json +++ b/rush.json @@ -97,11 +97,11 @@ "projectFolder": "packages/0xcert-ethereum-sandbox", "versionPolicyName": "patchAll" }, - // { - // "packageName": "@0xcert/ethereum-utils", - // "projectFolder": "packages/0xcert-ethereum-utils", - // "versionPolicyName": "patchAll" - // }, + { + "packageName": "@0xcert/ethereum-utils", + "projectFolder": "packages/0xcert-ethereum-utils", + "versionPolicyName": "patchAll" + }, { "packageName": "@0xcert/ethereum-utils-contracts", "projectFolder": "packages/0xcert-ethereum-utils-contracts", From 414ca3cb1596ccb55a30972d56d741c1512946b9 Mon Sep 17 00:00:00 2001 From: Tadej Vengust Date: Wed, 10 Apr 2019 15:01:53 +0200 Subject: [PATCH 21/22] Version bump to 1.2.0-alpha0. --- CONTRIBUTING.md | 2 +- common/config/rush/version-policies.json | 2 +- common/scripts/install-run.js | 2 +- packages/0xcert-cert/CHANGELOG.json | 4 ++-- packages/0xcert-cert/CHANGELOG.md | 2 +- packages/0xcert-cert/package.json | 8 ++++---- packages/0xcert-conventions/CHANGELOG.json | 4 ++-- packages/0xcert-conventions/CHANGELOG.md | 2 +- packages/0xcert-conventions/package.json | 4 ++-- .../CHANGELOG.json | 4 ++-- .../0xcert-ethereum-asset-ledger/CHANGELOG.md | 2 +- .../0xcert-ethereum-asset-ledger/package.json | 14 ++++++------- .../CHANGELOG.json | 4 ++-- .../CHANGELOG.md | 2 +- .../package.json | 4 ++-- .../CHANGELOG.json | 4 ++-- .../CHANGELOG.md | 2 +- .../package.json | 4 ++-- .../CHANGELOG.json | 4 ++-- .../CHANGELOG.md | 2 +- .../package.json | 8 ++++---- .../CHANGELOG.json | 4 ++-- .../CHANGELOG.md | 2 +- .../package.json | 8 ++++---- .../CHANGELOG.json | 4 ++-- .../CHANGELOG.md | 2 +- .../package.json | 6 +++--- .../CHANGELOG.json | 4 ++-- .../CHANGELOG.md | 2 +- .../package.json | 12 +++++------ .../CHANGELOG.json | 4 ++-- .../CHANGELOG.md | 2 +- .../package.json | 12 +++++------ .../CHANGELOG.json | 4 ++-- .../CHANGELOG.md | 2 +- .../package.json | 12 +++++------ .../0xcert-ethereum-sandbox/CHANGELOG.json | 4 ++-- packages/0xcert-ethereum-sandbox/CHANGELOG.md | 2 +- packages/0xcert-ethereum-sandbox/package.json | 12 +++++------ .../CHANGELOG.json | 4 ++-- .../CHANGELOG.md | 2 +- .../package.json | 2 +- packages/0xcert-ethereum-utils/package.json | 2 +- .../CHANGELOG.json | 4 ++-- .../0xcert-ethereum-value-ledger/CHANGELOG.md | 2 +- .../0xcert-ethereum-value-ledger/package.json | 14 ++++++------- .../CHANGELOG.json | 4 ++-- .../CHANGELOG.md | 2 +- .../package.json | 6 +++--- packages/0xcert-merkle/CHANGELOG.json | 4 ++-- packages/0xcert-merkle/CHANGELOG.md | 2 +- packages/0xcert-merkle/package.json | 4 ++-- packages/0xcert-scaffold/CHANGELOG.json | 4 ++-- packages/0xcert-scaffold/CHANGELOG.md | 2 +- packages/0xcert-scaffold/package.json | 2 +- packages/0xcert-utils/CHANGELOG.json | 4 ++-- packages/0xcert-utils/CHANGELOG.md | 2 +- packages/0xcert-utils/package.json | 2 +- packages/0xcert-vue-example/package.json | 14 ++++++------- packages/0xcert-vue-plugin/CHANGELOG.json | 4 ++-- packages/0xcert-vue-plugin/CHANGELOG.md | 2 +- packages/0xcert-vue-plugin/package.json | 4 ++-- .../0xcert-wanchain-asset-ledger/package.json | 6 +++--- .../package.json | 8 ++++---- .../CHANGELOG.json | 4 ++-- .../CHANGELOG.md | 2 +- .../package.json | 4 ++-- packages/0xcert-wanchain-utils/package.json | 4 ++-- .../0xcert-wanchain-value-ledger/package.json | 4 ++-- packages/0xcert-webpack/package.json | 20 +++++++++---------- 70 files changed, 163 insertions(+), 163 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a839c96bb..d0688bf97 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -43,7 +43,7 @@ Please follow the [TypeScript coding guidelines](https://github.com/Microsoft/Ty The release manager will publish packages to NPM using these commands. -**WARNING**: We used `@0xcert/ethereum-utils` package before and now have version inconsistency problem. The package is released as version 1.2.0 and is not part of the Rush configuration until we reach the actual 1.2.0 version of the framework. Make sure you re-include that package (inside rush.json) after 1.2.0 is released! +**WARNING**: We used `@0xcert/ethereum-utils` package before and now have version inconsistency problem. The package is released as version 1.2.0-alpha0 and is not part of the Rush configuration until we reach the actual 1.2.0-alpha0 version of the framework. Make sure you re-include that package (inside rush.json) after 1.2.0-alpha0 is released! ```sh $ rush version --bump --override-bump minor diff --git a/common/config/rush/version-policies.json b/common/config/rush/version-policies.json index ea25ca995..b24b682d0 100644 --- a/common/config/rush/version-policies.json +++ b/common/config/rush/version-policies.json @@ -2,7 +2,7 @@ { "policyName": "patchAll", "definitionName": "lockStepVersion", - "version": "1.2.0", + "version": "1.2.0-alpha0", "nextBump": "patch" } ] diff --git a/common/scripts/install-run.js b/common/scripts/install-run.js index ca6ece73f..b40da4ffb 100644 --- a/common/scripts/install-run.js +++ b/common/scripts/install-run.js @@ -369,7 +369,7 @@ function runWithErrorAndStatusCode(fn) { } exports.runWithErrorAndStatusCode = runWithErrorAndStatusCode; function run() { - const [nodePath, /* Ex: /bin/node */ scriptPath, /* /repo/common/scripts/install-run-rush.js */ rawPackageSpecifier, /* qrcode@^1.2.0 */ packageBinName, /* qrcode */ ...packageBinArgs /* [-f, myproject/lib] */] = process.argv; + const [nodePath, /* Ex: /bin/node */ scriptPath, /* /repo/common/scripts/install-run-rush.js */ rawPackageSpecifier, /* qrcode@^1.2.0-alpha0 */ packageBinName, /* qrcode */ ...packageBinArgs /* [-f, myproject/lib] */] = process.argv; if (!nodePath) { throw new Error('Unexpected exception: could not detect node path'); } diff --git a/packages/0xcert-cert/CHANGELOG.json b/packages/0xcert-cert/CHANGELOG.json index 30b10c941..df2e9ebf0 100644 --- a/packages/0xcert-cert/CHANGELOG.json +++ b/packages/0xcert-cert/CHANGELOG.json @@ -2,8 +2,8 @@ "name": "@0xcert/cert", "entries": [ { - "version": "1.2.0", - "tag": "@0xcert/cert_v1.2.0", + "version": "1.2.0-alpha0", + "tag": "@0xcert/cert_v1.2.0-alpha0", "date": "Fri, 22 Mar 2019 09:48:00 GMT", "comments": {} } diff --git a/packages/0xcert-cert/CHANGELOG.md b/packages/0xcert-cert/CHANGELOG.md index 67e69d80a..97ad0a394 100644 --- a/packages/0xcert-cert/CHANGELOG.md +++ b/packages/0xcert-cert/CHANGELOG.md @@ -2,7 +2,7 @@ This log was last generated on Fri, 22 Mar 2019 09:48:00 GMT and should not be manually modified. -## 1.2.0 +## 1.2.0-alpha0 Fri, 22 Mar 2019 09:48:00 GMT *Initial release* diff --git a/packages/0xcert-cert/package.json b/packages/0xcert-cert/package.json index de3aeafca..d7e3e57d4 100644 --- a/packages/0xcert-cert/package.json +++ b/packages/0xcert-cert/package.json @@ -1,6 +1,6 @@ { "name": "@0xcert/cert", - "version": "1.2.0", + "version": "1.2.0-alpha0", "description": "Asset certification module for 0xcert Framework.", "main": "./dist/index.js", "types": "./dist/index.d.ts", @@ -72,8 +72,8 @@ "typescript": "^3.1.1" }, "dependencies": { - "@0xcert/utils": "1.2.0", - "@0xcert/merkle": "1.2.0", - "@0xcert/conventions": "1.2.0" + "@0xcert/utils": "1.2.0-alpha0", + "@0xcert/merkle": "1.2.0-alpha0", + "@0xcert/conventions": "1.2.0-alpha0" } } diff --git a/packages/0xcert-conventions/CHANGELOG.json b/packages/0xcert-conventions/CHANGELOG.json index 53e878719..a8364adc8 100644 --- a/packages/0xcert-conventions/CHANGELOG.json +++ b/packages/0xcert-conventions/CHANGELOG.json @@ -2,8 +2,8 @@ "name": "@0xcert/conventions", "entries": [ { - "version": "1.2.0", - "tag": "@0xcert/conventions_v1.2.0", + "version": "1.2.0-alpha0", + "tag": "@0xcert/conventions_v1.2.0-alpha0", "date": "Fri, 22 Mar 2019 09:48:00 GMT", "comments": {} } diff --git a/packages/0xcert-conventions/CHANGELOG.md b/packages/0xcert-conventions/CHANGELOG.md index 2bab5a6ce..eafa26592 100644 --- a/packages/0xcert-conventions/CHANGELOG.md +++ b/packages/0xcert-conventions/CHANGELOG.md @@ -2,7 +2,7 @@ This log was last generated on Fri, 22 Mar 2019 09:48:00 GMT and should not be manually modified. -## 1.2.0 +## 1.2.0-alpha0 Fri, 22 Mar 2019 09:48:00 GMT *Initial release* diff --git a/packages/0xcert-conventions/package.json b/packages/0xcert-conventions/package.json index b4f32e6c8..aed240a2d 100644 --- a/packages/0xcert-conventions/package.json +++ b/packages/0xcert-conventions/package.json @@ -1,6 +1,6 @@ { "name": "@0xcert/conventions", - "version": "1.2.0", + "version": "1.2.0-alpha0", "description": "Module with implementation of all confirmed conventions.", "main": "./dist/index.js", "types": "./dist/index.d.ts", @@ -64,7 +64,7 @@ ], "license": "MIT", "devDependencies": { - "@0xcert/utils": "1.2.0", + "@0xcert/utils": "1.2.0-alpha0", "@hayspec/cli": "^0.8.3", "@hayspec/spec": "^0.8.3", "ajv": "^6.7.0", diff --git a/packages/0xcert-ethereum-asset-ledger/CHANGELOG.json b/packages/0xcert-ethereum-asset-ledger/CHANGELOG.json index 39678901d..23f0287eb 100644 --- a/packages/0xcert-ethereum-asset-ledger/CHANGELOG.json +++ b/packages/0xcert-ethereum-asset-ledger/CHANGELOG.json @@ -2,8 +2,8 @@ "name": "@0xcert/ethereum-asset-ledger", "entries": [ { - "version": "1.2.0", - "tag": "@0xcert/ethereum-asset-ledger_v1.2.0", + "version": "1.2.0-alpha0", + "tag": "@0xcert/ethereum-asset-ledger_v1.2.0-alpha0", "date": "Fri, 22 Mar 2019 09:48:00 GMT", "comments": {} } diff --git a/packages/0xcert-ethereum-asset-ledger/CHANGELOG.md b/packages/0xcert-ethereum-asset-ledger/CHANGELOG.md index 5b9214424..cc9f74051 100644 --- a/packages/0xcert-ethereum-asset-ledger/CHANGELOG.md +++ b/packages/0xcert-ethereum-asset-ledger/CHANGELOG.md @@ -2,7 +2,7 @@ This log was last generated on Fri, 22 Mar 2019 09:48:00 GMT and should not be manually modified. -## 1.2.0 +## 1.2.0-alpha0 Fri, 22 Mar 2019 09:48:00 GMT *Initial release* diff --git a/packages/0xcert-ethereum-asset-ledger/package.json b/packages/0xcert-ethereum-asset-ledger/package.json index 33f40a073..f07a5485b 100644 --- a/packages/0xcert-ethereum-asset-ledger/package.json +++ b/packages/0xcert-ethereum-asset-ledger/package.json @@ -1,6 +1,6 @@ { "name": "@0xcert/ethereum-asset-ledger", - "version": "1.2.0", + "version": "1.2.0-alpha0", "description": "Asset ledger module for asset management on the Ethereum blockchain.", "main": "./dist/index.js", "types": "./dist/index.d.ts", @@ -67,8 +67,8 @@ ], "license": "MIT", "devDependencies": { - "@0xcert/ethereum-sandbox": "1.2.0", - "@0xcert/ethereum-order-gateway": "1.2.0", + "@0xcert/ethereum-sandbox": "1.2.0-alpha0", + "@0xcert/ethereum-order-gateway": "1.2.0-alpha0", "@specron/cli": "^0.5.6", "@specron/spec": "^0.5.6", "nyc": "^13.1.0", @@ -79,9 +79,9 @@ "web3": "1.0.0-beta.37" }, "dependencies": { - "@0xcert/ethereum-generic-provider": "1.2.0", - "@0xcert/ethereum-utils": "1.2.0", - "@0xcert/scaffold": "1.2.0", - "@0xcert/utils": "1.2.0" + "@0xcert/ethereum-generic-provider": "1.2.0-alpha0", + "@0xcert/ethereum-utils": "1.2.0-alpha0", + "@0xcert/scaffold": "1.2.0-alpha0", + "@0xcert/utils": "1.2.0-alpha0" } } diff --git a/packages/0xcert-ethereum-erc20-contracts/CHANGELOG.json b/packages/0xcert-ethereum-erc20-contracts/CHANGELOG.json index 9459e1c5d..72bca5c9d 100644 --- a/packages/0xcert-ethereum-erc20-contracts/CHANGELOG.json +++ b/packages/0xcert-ethereum-erc20-contracts/CHANGELOG.json @@ -2,8 +2,8 @@ "name": "@0xcert/ethereum-erc20-contracts", "entries": [ { - "version": "1.2.0", - "tag": "@0xcert/ethereum-erc20-contracts_v1.2.0", + "version": "1.2.0-alpha0", + "tag": "@0xcert/ethereum-erc20-contracts_v1.2.0-alpha0", "date": "Fri, 22 Mar 2019 09:48:00 GMT", "comments": {} } diff --git a/packages/0xcert-ethereum-erc20-contracts/CHANGELOG.md b/packages/0xcert-ethereum-erc20-contracts/CHANGELOG.md index ede5aa02f..4b9207d4e 100644 --- a/packages/0xcert-ethereum-erc20-contracts/CHANGELOG.md +++ b/packages/0xcert-ethereum-erc20-contracts/CHANGELOG.md @@ -2,7 +2,7 @@ This log was last generated on Fri, 22 Mar 2019 09:48:00 GMT and should not be manually modified. -## 1.2.0 +## 1.2.0-alpha0 Fri, 22 Mar 2019 09:48:00 GMT *Initial release* diff --git a/packages/0xcert-ethereum-erc20-contracts/package.json b/packages/0xcert-ethereum-erc20-contracts/package.json index a5c057d57..1f6621474 100644 --- a/packages/0xcert-ethereum-erc20-contracts/package.json +++ b/packages/0xcert-ethereum-erc20-contracts/package.json @@ -1,6 +1,6 @@ { "name": "@0xcert/ethereum-erc20-contracts", - "version": "1.2.0", + "version": "1.2.0-alpha0", "description": "Smart contract implementation of the ERC-20 standard on the Ethereum blockchain.", "scripts": { "build": "npm run clean && npx specron compile && npx tsc", @@ -63,7 +63,7 @@ ], "license": "MIT", "devDependencies": { - "@0xcert/ethereum-utils-contracts": "1.2.0", + "@0xcert/ethereum-utils-contracts": "1.2.0-alpha0", "@specron/cli": "^0.5.6", "@specron/spec": "^0.5.6", "solc": "0.5.6", diff --git a/packages/0xcert-ethereum-erc721-contracts/CHANGELOG.json b/packages/0xcert-ethereum-erc721-contracts/CHANGELOG.json index a860ee17f..1384492bf 100644 --- a/packages/0xcert-ethereum-erc721-contracts/CHANGELOG.json +++ b/packages/0xcert-ethereum-erc721-contracts/CHANGELOG.json @@ -2,8 +2,8 @@ "name": "@0xcert/ethereum-erc721-contracts", "entries": [ { - "version": "1.2.0", - "tag": "@0xcert/ethereum-erc721-contracts_v1.2.0", + "version": "1.2.0-alpha0", + "tag": "@0xcert/ethereum-erc721-contracts_v1.2.0-alpha0", "date": "Fri, 22 Mar 2019 09:48:00 GMT", "comments": {} }, diff --git a/packages/0xcert-ethereum-erc721-contracts/CHANGELOG.md b/packages/0xcert-ethereum-erc721-contracts/CHANGELOG.md index ac92810b8..e62191ec2 100644 --- a/packages/0xcert-ethereum-erc721-contracts/CHANGELOG.md +++ b/packages/0xcert-ethereum-erc721-contracts/CHANGELOG.md @@ -2,7 +2,7 @@ This log was last generated on Fri, 22 Mar 2019 09:48:00 GMT and should not be manually modified. -## 1.2.0 +## 1.2.0-alpha0 Fri, 22 Mar 2019 09:48:00 GMT *Version update only* diff --git a/packages/0xcert-ethereum-erc721-contracts/package.json b/packages/0xcert-ethereum-erc721-contracts/package.json index d9cd7c59a..788a3a6a0 100644 --- a/packages/0xcert-ethereum-erc721-contracts/package.json +++ b/packages/0xcert-ethereum-erc721-contracts/package.json @@ -1,6 +1,6 @@ { "name": "@0xcert/ethereum-erc721-contracts", - "version": "1.2.0", + "version": "1.2.0-alpha0", "description": "Smart contract implementation of the ERC-721 standard on the Ethereum blockchain.", "scripts": { "build": "npm run clean && npx specron compile && npx tsc", @@ -63,7 +63,7 @@ ], "license": "MIT", "devDependencies": { - "@0xcert/ethereum-utils-contracts": "1.2.0", + "@0xcert/ethereum-utils-contracts": "1.2.0-alpha0", "@specron/cli": "^0.5.6", "@specron/spec": "^0.5.6", "solc": "0.5.6", diff --git a/packages/0xcert-ethereum-generic-provider/CHANGELOG.json b/packages/0xcert-ethereum-generic-provider/CHANGELOG.json index 6b9c85d47..6e72fdfb2 100644 --- a/packages/0xcert-ethereum-generic-provider/CHANGELOG.json +++ b/packages/0xcert-ethereum-generic-provider/CHANGELOG.json @@ -2,8 +2,8 @@ "name": "@0xcert/ethereum-generic-provider", "entries": [ { - "version": "1.2.0", - "tag": "@0xcert/ethereum-generic-provider_v1.2.0", + "version": "1.2.0-alpha0", + "tag": "@0xcert/ethereum-generic-provider_v1.2.0-alpha0", "date": "Fri, 22 Mar 2019 09:48:00 GMT", "comments": {} } diff --git a/packages/0xcert-ethereum-generic-provider/CHANGELOG.md b/packages/0xcert-ethereum-generic-provider/CHANGELOG.md index 0f0d15bf8..21e975277 100644 --- a/packages/0xcert-ethereum-generic-provider/CHANGELOG.md +++ b/packages/0xcert-ethereum-generic-provider/CHANGELOG.md @@ -2,7 +2,7 @@ This log was last generated on Fri, 22 Mar 2019 09:48:00 GMT and should not be manually modified. -## 1.2.0 +## 1.2.0-alpha0 Fri, 22 Mar 2019 09:48:00 GMT *Initial release* diff --git a/packages/0xcert-ethereum-generic-provider/package.json b/packages/0xcert-ethereum-generic-provider/package.json index f0e4717c2..0143ced40 100644 --- a/packages/0xcert-ethereum-generic-provider/package.json +++ b/packages/0xcert-ethereum-generic-provider/package.json @@ -1,6 +1,6 @@ { "name": "@0xcert/ethereum-generic-provider", - "version": "1.2.0", + "version": "1.2.0-alpha0", "description": "Basic implementation of communication provider for the Ethereum blockchain.", "main": "./dist/index.js", "types": "./dist/index.d.ts", @@ -67,7 +67,7 @@ ], "license": "MIT", "devDependencies": { - "@0xcert/ethereum-sandbox": "1.2.0", + "@0xcert/ethereum-sandbox": "1.2.0-alpha0", "@types/node": "^10.12.24", "@specron/cli": "^0.5.6", "@specron/spec": "^0.5.6", @@ -80,8 +80,8 @@ "web3": "1.0.0-beta.37" }, "dependencies": { - "@0xcert/ethereum-utils": "1.2.0", - "@0xcert/scaffold": "1.2.0", + "@0xcert/ethereum-utils": "1.2.0-alpha0", + "@0xcert/scaffold": "1.2.0-alpha0", "events": "^3.0.0" } } diff --git a/packages/0xcert-ethereum-http-provider/CHANGELOG.json b/packages/0xcert-ethereum-http-provider/CHANGELOG.json index 50460aec5..37ab4d969 100644 --- a/packages/0xcert-ethereum-http-provider/CHANGELOG.json +++ b/packages/0xcert-ethereum-http-provider/CHANGELOG.json @@ -2,8 +2,8 @@ "name": "@0xcert/ethereum-http-provider", "entries": [ { - "version": "1.2.0", - "tag": "@0xcert/ethereum-http-provider_v1.2.0", + "version": "1.2.0-alpha0", + "tag": "@0xcert/ethereum-http-provider_v1.2.0-alpha0", "date": "Fri, 22 Mar 2019 09:48:00 GMT", "comments": {} } diff --git a/packages/0xcert-ethereum-http-provider/CHANGELOG.md b/packages/0xcert-ethereum-http-provider/CHANGELOG.md index aa150e5ac..25d6540d2 100644 --- a/packages/0xcert-ethereum-http-provider/CHANGELOG.md +++ b/packages/0xcert-ethereum-http-provider/CHANGELOG.md @@ -2,7 +2,7 @@ This log was last generated on Fri, 22 Mar 2019 09:48:00 GMT and should not be manually modified. -## 1.2.0 +## 1.2.0-alpha0 Fri, 22 Mar 2019 09:48:00 GMT *Initial release* diff --git a/packages/0xcert-ethereum-http-provider/package.json b/packages/0xcert-ethereum-http-provider/package.json index d13675007..57a534a19 100644 --- a/packages/0xcert-ethereum-http-provider/package.json +++ b/packages/0xcert-ethereum-http-provider/package.json @@ -1,6 +1,6 @@ { "name": "@0xcert/ethereum-http-provider", - "version": "1.2.0", + "version": "1.2.0-alpha0", "description": "Implementation of HTTP communication provider for the Ethereum blockchain.", "main": "./dist/index.js", "types": "./dist/index.d.ts", @@ -67,7 +67,7 @@ ], "license": "MIT", "devDependencies": { - "@0xcert/ethereum-sandbox": "1.2.0", + "@0xcert/ethereum-sandbox": "1.2.0-alpha0", "@specron/cli": "^0.5.6", "@specron/spec": "^0.5.6", "nyc": "^13.1.0", @@ -78,7 +78,7 @@ "web3": "1.0.0-beta.37" }, "dependencies": { - "@0xcert/ethereum-generic-provider": "1.2.0", - "@0xcert/utils": "1.2.0" + "@0xcert/ethereum-generic-provider": "1.2.0-alpha0", + "@0xcert/utils": "1.2.0-alpha0" } } diff --git a/packages/0xcert-ethereum-metamask-provider/CHANGELOG.json b/packages/0xcert-ethereum-metamask-provider/CHANGELOG.json index b6b9f0c6d..c92a405d2 100644 --- a/packages/0xcert-ethereum-metamask-provider/CHANGELOG.json +++ b/packages/0xcert-ethereum-metamask-provider/CHANGELOG.json @@ -2,8 +2,8 @@ "name": "@0xcert/ethereum-metamask-provider", "entries": [ { - "version": "1.2.0", - "tag": "@0xcert/ethereum-metamask-provider_v1.2.0", + "version": "1.2.0-alpha0", + "tag": "@0xcert/ethereum-metamask-provider_v1.2.0-alpha0", "date": "Fri, 22 Mar 2019 09:48:00 GMT", "comments": {} } diff --git a/packages/0xcert-ethereum-metamask-provider/CHANGELOG.md b/packages/0xcert-ethereum-metamask-provider/CHANGELOG.md index 499afd0c9..ae5207340 100644 --- a/packages/0xcert-ethereum-metamask-provider/CHANGELOG.md +++ b/packages/0xcert-ethereum-metamask-provider/CHANGELOG.md @@ -2,7 +2,7 @@ This log was last generated on Fri, 22 Mar 2019 09:48:00 GMT and should not be manually modified. -## 1.2.0 +## 1.2.0-alpha0 Fri, 22 Mar 2019 09:48:00 GMT *Initial release* diff --git a/packages/0xcert-ethereum-metamask-provider/package.json b/packages/0xcert-ethereum-metamask-provider/package.json index 420c4486b..5d52f9894 100644 --- a/packages/0xcert-ethereum-metamask-provider/package.json +++ b/packages/0xcert-ethereum-metamask-provider/package.json @@ -1,6 +1,6 @@ { "name": "@0xcert/ethereum-metamask-provider", - "version": "1.2.0", + "version": "1.2.0-alpha0", "description": "Implementation of MetaMask communication provider for the Ethereum blockchain.", "main": "./dist/index.js", "types": "./dist/index.d.ts", @@ -67,7 +67,7 @@ ], "license": "MIT", "devDependencies": { - "@0xcert/ethereum-sandbox": "1.2.0", + "@0xcert/ethereum-sandbox": "1.2.0-alpha0", "@specron/cli": "^0.5.6", "@specron/spec": "^0.5.6", "nyc": "^13.1.0", @@ -78,6 +78,6 @@ "web3": "1.0.0-beta.37" }, "dependencies": { - "@0xcert/ethereum-generic-provider": "1.2.0" + "@0xcert/ethereum-generic-provider": "1.2.0-alpha0" } } diff --git a/packages/0xcert-ethereum-order-gateway-contracts/CHANGELOG.json b/packages/0xcert-ethereum-order-gateway-contracts/CHANGELOG.json index 6b2ebee3d..34c8554e9 100644 --- a/packages/0xcert-ethereum-order-gateway-contracts/CHANGELOG.json +++ b/packages/0xcert-ethereum-order-gateway-contracts/CHANGELOG.json @@ -2,8 +2,8 @@ "name": "@0xcert/ethereum-order-gateway-contracts", "entries": [ { - "version": "1.2.0", - "tag": "@0xcert/ethereum-order-gateway-contracts_v1.2.0", + "version": "1.2.0-alpha0", + "tag": "@0xcert/ethereum-order-gateway-contracts_v1.2.0-alpha0", "date": "Fri, 22 Mar 2019 09:48:00 GMT", "comments": {} }, diff --git a/packages/0xcert-ethereum-order-gateway-contracts/CHANGELOG.md b/packages/0xcert-ethereum-order-gateway-contracts/CHANGELOG.md index 0a85f89c7..3025546c4 100644 --- a/packages/0xcert-ethereum-order-gateway-contracts/CHANGELOG.md +++ b/packages/0xcert-ethereum-order-gateway-contracts/CHANGELOG.md @@ -2,7 +2,7 @@ This log was last generated on Fri, 22 Mar 2019 09:48:00 GMT and should not be manually modified. -## 1.2.0 +## 1.2.0-alpha0 Fri, 22 Mar 2019 09:48:00 GMT *Version update only* diff --git a/packages/0xcert-ethereum-order-gateway-contracts/package.json b/packages/0xcert-ethereum-order-gateway-contracts/package.json index b8b2d9c02..a46246d8b 100644 --- a/packages/0xcert-ethereum-order-gateway-contracts/package.json +++ b/packages/0xcert-ethereum-order-gateway-contracts/package.json @@ -1,6 +1,6 @@ { "name": "@0xcert/ethereum-order-gateway-contracts", - "version": "1.2.0", + "version": "1.2.0-alpha0", "description": "Smart contracts used by the order gateway on the Ethereum blockchain.", "scripts": { "build": "npm run clean && npx specron compile && npx tsc", @@ -73,11 +73,11 @@ ], "license": "MIT", "devDependencies": { - "@0xcert/ethereum-utils-contracts": "1.2.0", - "@0xcert/ethereum-erc20-contracts": "1.2.0", - "@0xcert/ethereum-erc721-contracts": "1.2.0", - "@0xcert/ethereum-xcert-contracts": "1.2.0", - "@0xcert/ethereum-proxy-contracts": "1.2.0", + "@0xcert/ethereum-utils-contracts": "1.2.0-alpha0", + "@0xcert/ethereum-erc20-contracts": "1.2.0-alpha0", + "@0xcert/ethereum-erc721-contracts": "1.2.0-alpha0", + "@0xcert/ethereum-xcert-contracts": "1.2.0-alpha0", + "@0xcert/ethereum-proxy-contracts": "1.2.0-alpha0", "@specron/cli": "^0.5.6", "@specron/spec": "^0.5.6", "solc": "0.5.6", diff --git a/packages/0xcert-ethereum-order-gateway/CHANGELOG.json b/packages/0xcert-ethereum-order-gateway/CHANGELOG.json index 57fa83134..c5878a50d 100644 --- a/packages/0xcert-ethereum-order-gateway/CHANGELOG.json +++ b/packages/0xcert-ethereum-order-gateway/CHANGELOG.json @@ -2,8 +2,8 @@ "name": "@0xcert/ethereum-order-gateway", "entries": [ { - "version": "1.2.0", - "tag": "@0xcert/ethereum-order-gateway_v1.2.0", + "version": "1.2.0-alpha0", + "tag": "@0xcert/ethereum-order-gateway_v1.2.0-alpha0", "date": "Fri, 22 Mar 2019 09:48:00 GMT", "comments": {} }, diff --git a/packages/0xcert-ethereum-order-gateway/CHANGELOG.md b/packages/0xcert-ethereum-order-gateway/CHANGELOG.md index b2eb448ac..c899792fb 100644 --- a/packages/0xcert-ethereum-order-gateway/CHANGELOG.md +++ b/packages/0xcert-ethereum-order-gateway/CHANGELOG.md @@ -2,7 +2,7 @@ This log was last generated on Fri, 22 Mar 2019 09:48:00 GMT and should not be manually modified. -## 1.2.0 +## 1.2.0-alpha0 Fri, 22 Mar 2019 09:48:00 GMT *Version update only* diff --git a/packages/0xcert-ethereum-order-gateway/package.json b/packages/0xcert-ethereum-order-gateway/package.json index 0ebb2fec5..c77a735de 100644 --- a/packages/0xcert-ethereum-order-gateway/package.json +++ b/packages/0xcert-ethereum-order-gateway/package.json @@ -1,6 +1,6 @@ { "name": "@0xcert/ethereum-order-gateway", - "version": "1.2.0", + "version": "1.2.0-alpha0", "description": "Order gateway module for executing atomic operations on the Ethereum blockchain.", "main": "./dist/index.js", "types": "./dist/index.d.ts", @@ -67,7 +67,7 @@ ], "license": "MIT", "devDependencies": { - "@0xcert/ethereum-sandbox": "1.2.0", + "@0xcert/ethereum-sandbox": "1.2.0-alpha0", "@specron/cli": "^0.5.6", "@specron/spec": "^0.5.6", "nyc": "^13.1.0", @@ -78,9 +78,9 @@ "web3": "1.0.0-beta.37" }, "dependencies": { - "@0xcert/ethereum-generic-provider": "1.2.0", - "@0xcert/ethereum-utils": "1.2.0", - "@0xcert/scaffold": "1.2.0", - "@0xcert/utils": "1.2.0" + "@0xcert/ethereum-generic-provider": "1.2.0-alpha0", + "@0xcert/ethereum-utils": "1.2.0-alpha0", + "@0xcert/scaffold": "1.2.0-alpha0", + "@0xcert/utils": "1.2.0-alpha0" } } diff --git a/packages/0xcert-ethereum-proxy-contracts/CHANGELOG.json b/packages/0xcert-ethereum-proxy-contracts/CHANGELOG.json index 8b7b150c8..66ec49479 100644 --- a/packages/0xcert-ethereum-proxy-contracts/CHANGELOG.json +++ b/packages/0xcert-ethereum-proxy-contracts/CHANGELOG.json @@ -2,8 +2,8 @@ "name": "@0xcert/ethereum-proxy-contracts", "entries": [ { - "version": "1.2.0", - "tag": "@0xcert/ethereum-proxy-contracts_v1.2.0", + "version": "1.2.0-alpha0", + "tag": "@0xcert/ethereum-proxy-contracts_v1.2.0-alpha0", "date": "Fri, 22 Mar 2019 09:48:00 GMT", "comments": {} }, diff --git a/packages/0xcert-ethereum-proxy-contracts/CHANGELOG.md b/packages/0xcert-ethereum-proxy-contracts/CHANGELOG.md index 7d0e41a68..90a9c42ac 100644 --- a/packages/0xcert-ethereum-proxy-contracts/CHANGELOG.md +++ b/packages/0xcert-ethereum-proxy-contracts/CHANGELOG.md @@ -2,7 +2,7 @@ This log was last generated on Fri, 22 Mar 2019 09:48:00 GMT and should not be manually modified. -## 1.2.0 +## 1.2.0-alpha0 Fri, 22 Mar 2019 09:48:00 GMT *Version update only* diff --git a/packages/0xcert-ethereum-proxy-contracts/package.json b/packages/0xcert-ethereum-proxy-contracts/package.json index 3974f77be..5742e71ee 100644 --- a/packages/0xcert-ethereum-proxy-contracts/package.json +++ b/packages/0xcert-ethereum-proxy-contracts/package.json @@ -1,6 +1,6 @@ { "name": "@0xcert/ethereum-proxy-contracts", - "version": "1.2.0", + "version": "1.2.0-alpha0", "description": "Proxy smart contracts used by the order gateway when communicating with the Ethereum blockchain.", "scripts": { "build": "npm run clean && npx specron compile && npx tsc", @@ -63,11 +63,11 @@ ], "license": "MIT", "devDependencies": { - "@0xcert/ethereum-utils": "1.2.0", - "@0xcert/ethereum-utils-contracts": "1.2.0", - "@0xcert/ethereum-erc20-contracts": "1.2.0", - "@0xcert/ethereum-erc721-contracts": "1.2.0", - "@0xcert/ethereum-xcert-contracts": "1.2.0", + "@0xcert/ethereum-utils": "1.2.0-alpha0", + "@0xcert/ethereum-utils-contracts": "1.2.0-alpha0", + "@0xcert/ethereum-erc20-contracts": "1.2.0-alpha0", + "@0xcert/ethereum-erc721-contracts": "1.2.0-alpha0", + "@0xcert/ethereum-xcert-contracts": "1.2.0-alpha0", "@specron/cli": "^0.5.6", "@specron/spec": "^0.5.6", "solc": "0.5.6", diff --git a/packages/0xcert-ethereum-sandbox/CHANGELOG.json b/packages/0xcert-ethereum-sandbox/CHANGELOG.json index 2aac8477a..0e8fa119a 100644 --- a/packages/0xcert-ethereum-sandbox/CHANGELOG.json +++ b/packages/0xcert-ethereum-sandbox/CHANGELOG.json @@ -2,8 +2,8 @@ "name": "@0xcert/ethereum-sandbox", "entries": [ { - "version": "1.2.0", - "tag": "@0xcert/ethereum-sandbox_v1.2.0", + "version": "1.2.0-alpha0", + "tag": "@0xcert/ethereum-sandbox_v1.2.0-alpha0", "date": "Fri, 22 Mar 2019 09:48:00 GMT", "comments": {} }, diff --git a/packages/0xcert-ethereum-sandbox/CHANGELOG.md b/packages/0xcert-ethereum-sandbox/CHANGELOG.md index c205e3e3e..9ffafbc48 100644 --- a/packages/0xcert-ethereum-sandbox/CHANGELOG.md +++ b/packages/0xcert-ethereum-sandbox/CHANGELOG.md @@ -2,7 +2,7 @@ This log was last generated on Fri, 22 Mar 2019 09:48:00 GMT and should not be manually modified. -## 1.2.0 +## 1.2.0-alpha0 Fri, 22 Mar 2019 09:48:00 GMT *Version update only* diff --git a/packages/0xcert-ethereum-sandbox/package.json b/packages/0xcert-ethereum-sandbox/package.json index a8a78883a..f5a8bdce7 100644 --- a/packages/0xcert-ethereum-sandbox/package.json +++ b/packages/0xcert-ethereum-sandbox/package.json @@ -1,6 +1,6 @@ { "name": "@0xcert/ethereum-sandbox", - "version": "1.2.0", + "version": "1.2.0-alpha0", "description": "Test server for local running testing of modules on the Ethereum blockchain.", "main": "./dist/index.js", "types": "./dist/index.d.ts", @@ -76,10 +76,10 @@ "web3": "1.0.0-beta.37" }, "dependencies": { - "@0xcert/ethereum-order-gateway-contracts": "1.2.0", - "@0xcert/ethereum-erc20-contracts": "1.2.0", - "@0xcert/ethereum-erc721-contracts": "1.2.0", - "@0xcert/ethereum-proxy-contracts": "1.2.0", - "@0xcert/ethereum-xcert-contracts": "1.2.0" + "@0xcert/ethereum-order-gateway-contracts": "1.2.0-alpha0", + "@0xcert/ethereum-erc20-contracts": "1.2.0-alpha0", + "@0xcert/ethereum-erc721-contracts": "1.2.0-alpha0", + "@0xcert/ethereum-proxy-contracts": "1.2.0-alpha0", + "@0xcert/ethereum-xcert-contracts": "1.2.0-alpha0" } } diff --git a/packages/0xcert-ethereum-utils-contracts/CHANGELOG.json b/packages/0xcert-ethereum-utils-contracts/CHANGELOG.json index f418356be..058187f3c 100644 --- a/packages/0xcert-ethereum-utils-contracts/CHANGELOG.json +++ b/packages/0xcert-ethereum-utils-contracts/CHANGELOG.json @@ -2,8 +2,8 @@ "name": "@0xcert/ethereum-utils-contracts", "entries": [ { - "version": "1.2.0", - "tag": "@0xcert/ethereum-utils-contracts_v1.2.0", + "version": "1.2.0-alpha0", + "tag": "@0xcert/ethereum-utils-contracts_v1.2.0-alpha0", "date": "Fri, 22 Mar 2019 09:48:00 GMT", "comments": {} }, diff --git a/packages/0xcert-ethereum-utils-contracts/CHANGELOG.md b/packages/0xcert-ethereum-utils-contracts/CHANGELOG.md index eb3045b20..3c1a1eee5 100644 --- a/packages/0xcert-ethereum-utils-contracts/CHANGELOG.md +++ b/packages/0xcert-ethereum-utils-contracts/CHANGELOG.md @@ -2,7 +2,7 @@ This log was last generated on Fri, 22 Mar 2019 09:48:00 GMT and should not be manually modified. -## 1.2.0 +## 1.2.0-alpha0 Fri, 22 Mar 2019 09:48:00 GMT *Version update only* diff --git a/packages/0xcert-ethereum-utils-contracts/package.json b/packages/0xcert-ethereum-utils-contracts/package.json index 3911b79a4..ce3a89197 100644 --- a/packages/0xcert-ethereum-utils-contracts/package.json +++ b/packages/0xcert-ethereum-utils-contracts/package.json @@ -1,7 +1,7 @@ { "name": "@0xcert/ethereum-utils-contracts", "description": "General utility module with helper smart contracts.", - "version": "1.2.0", + "version": "1.2.0-alpha0", "scripts": { "build": "npm run clean && npx specron compile && npx tsc", "clean": "rm -Rf ./build", diff --git a/packages/0xcert-ethereum-utils/package.json b/packages/0xcert-ethereum-utils/package.json index 39edca541..468e1aa7c 100644 --- a/packages/0xcert-ethereum-utils/package.json +++ b/packages/0xcert-ethereum-utils/package.json @@ -1,6 +1,6 @@ { "name": "@0xcert/ethereum-utils", - "version": "1.2.0", + "version": "1.2.0-alpha0", "description": "General Ethereum utility module with helper functions for the Ethereum blockchain.", "main": "./dist/index.js", "types": "./dist/index.d.ts", diff --git a/packages/0xcert-ethereum-value-ledger/CHANGELOG.json b/packages/0xcert-ethereum-value-ledger/CHANGELOG.json index 4e4b79453..6e88b5b86 100644 --- a/packages/0xcert-ethereum-value-ledger/CHANGELOG.json +++ b/packages/0xcert-ethereum-value-ledger/CHANGELOG.json @@ -2,8 +2,8 @@ "name": "@0xcert/ethereum-value-ledger", "entries": [ { - "version": "1.2.0", - "tag": "@0xcert/ethereum-value-ledger_v1.2.0", + "version": "1.2.0-alpha0", + "tag": "@0xcert/ethereum-value-ledger_v1.2.0-alpha0", "date": "Fri, 22 Mar 2019 09:48:00 GMT", "comments": {} } diff --git a/packages/0xcert-ethereum-value-ledger/CHANGELOG.md b/packages/0xcert-ethereum-value-ledger/CHANGELOG.md index c7c651ef4..d9280984c 100644 --- a/packages/0xcert-ethereum-value-ledger/CHANGELOG.md +++ b/packages/0xcert-ethereum-value-ledger/CHANGELOG.md @@ -2,7 +2,7 @@ This log was last generated on Fri, 22 Mar 2019 09:48:00 GMT and should not be manually modified. -## 1.2.0 +## 1.2.0-alpha0 Fri, 22 Mar 2019 09:48:00 GMT *Initial release* diff --git a/packages/0xcert-ethereum-value-ledger/package.json b/packages/0xcert-ethereum-value-ledger/package.json index 4b121406f..c117b4f11 100644 --- a/packages/0xcert-ethereum-value-ledger/package.json +++ b/packages/0xcert-ethereum-value-ledger/package.json @@ -1,6 +1,6 @@ { "name": "@0xcert/ethereum-value-ledger", - "version": "1.2.0", + "version": "1.2.0-alpha0", "description": "Value ledger module for currency management on the Ethereum blockchain.", "main": "./dist/index.js", "types": "./dist/index.d.ts", @@ -67,8 +67,8 @@ ], "license": "MIT", "devDependencies": { - "@0xcert/ethereum-order-gateway": "1.2.0", - "@0xcert/ethereum-sandbox": "1.2.0", + "@0xcert/ethereum-order-gateway": "1.2.0-alpha0", + "@0xcert/ethereum-sandbox": "1.2.0-alpha0", "@specron/cli": "^0.5.6", "@specron/spec": "^0.5.6", "nyc": "^13.1.0", @@ -79,9 +79,9 @@ "web3": "1.0.0-beta.37" }, "dependencies": { - "@0xcert/ethereum-generic-provider": "1.2.0", - "@0xcert/ethereum-utils": "1.2.0", - "@0xcert/scaffold": "1.2.0", - "@0xcert/utils": "1.2.0" + "@0xcert/ethereum-generic-provider": "1.2.0-alpha0", + "@0xcert/ethereum-utils": "1.2.0-alpha0", + "@0xcert/scaffold": "1.2.0-alpha0", + "@0xcert/utils": "1.2.0-alpha0" } } diff --git a/packages/0xcert-ethereum-xcert-contracts/CHANGELOG.json b/packages/0xcert-ethereum-xcert-contracts/CHANGELOG.json index 46f49c6f0..89404ade8 100644 --- a/packages/0xcert-ethereum-xcert-contracts/CHANGELOG.json +++ b/packages/0xcert-ethereum-xcert-contracts/CHANGELOG.json @@ -2,8 +2,8 @@ "name": "@0xcert/ethereum-xcert-contracts", "entries": [ { - "version": "1.2.0", - "tag": "@0xcert/ethereum-xcert-contracts_v1.2.0", + "version": "1.2.0-alpha0", + "tag": "@0xcert/ethereum-xcert-contracts_v1.2.0-alpha0", "date": "Fri, 22 Mar 2019 09:48:00 GMT", "comments": {} }, diff --git a/packages/0xcert-ethereum-xcert-contracts/CHANGELOG.md b/packages/0xcert-ethereum-xcert-contracts/CHANGELOG.md index bd9eb3e83..a5a07de8e 100644 --- a/packages/0xcert-ethereum-xcert-contracts/CHANGELOG.md +++ b/packages/0xcert-ethereum-xcert-contracts/CHANGELOG.md @@ -2,7 +2,7 @@ This log was last generated on Fri, 22 Mar 2019 09:48:00 GMT and should not be manually modified. -## 1.2.0 +## 1.2.0-alpha0 Fri, 22 Mar 2019 09:48:00 GMT *Version update only* diff --git a/packages/0xcert-ethereum-xcert-contracts/package.json b/packages/0xcert-ethereum-xcert-contracts/package.json index ede67c2fa..f4dd780e2 100644 --- a/packages/0xcert-ethereum-xcert-contracts/package.json +++ b/packages/0xcert-ethereum-xcert-contracts/package.json @@ -1,7 +1,7 @@ { "name": "@0xcert/ethereum-xcert-contracts", "description": "Smart contracts used by the Asset ledger on the Ethereum blockchain.", - "version": "1.2.0", + "version": "1.2.0-alpha0", "scripts": { "build": "npm run clean && npx specron compile && npx tsc", "clean": "rm -Rf ./build", @@ -61,8 +61,8 @@ ], "license": "MIT", "devDependencies": { - "@0xcert/ethereum-utils-contracts": "1.2.0", - "@0xcert/ethereum-erc721-contracts": "1.2.0", + "@0xcert/ethereum-utils-contracts": "1.2.0-alpha0", + "@0xcert/ethereum-erc721-contracts": "1.2.0-alpha0", "@specron/cli": "^0.5.6", "@specron/spec": "^0.5.6", "solc": "0.5.6", diff --git a/packages/0xcert-merkle/CHANGELOG.json b/packages/0xcert-merkle/CHANGELOG.json index 511879c64..67c7af221 100644 --- a/packages/0xcert-merkle/CHANGELOG.json +++ b/packages/0xcert-merkle/CHANGELOG.json @@ -2,8 +2,8 @@ "name": "@0xcert/merkle", "entries": [ { - "version": "1.2.0", - "tag": "@0xcert/merkle_v1.2.0", + "version": "1.2.0-alpha0", + "tag": "@0xcert/merkle_v1.2.0-alpha0", "date": "Fri, 22 Mar 2019 09:48:00 GMT", "comments": {} }, diff --git a/packages/0xcert-merkle/CHANGELOG.md b/packages/0xcert-merkle/CHANGELOG.md index 986256c66..359e23e5b 100644 --- a/packages/0xcert-merkle/CHANGELOG.md +++ b/packages/0xcert-merkle/CHANGELOG.md @@ -2,7 +2,7 @@ This log was last generated on Fri, 22 Mar 2019 09:48:00 GMT and should not be manually modified. -## 1.2.0 +## 1.2.0-alpha0 Fri, 22 Mar 2019 09:48:00 GMT *Version update only* diff --git a/packages/0xcert-merkle/package.json b/packages/0xcert-merkle/package.json index 92114d5bc..3bd6cb1d6 100644 --- a/packages/0xcert-merkle/package.json +++ b/packages/0xcert-merkle/package.json @@ -1,6 +1,6 @@ { "name": "@0xcert/merkle", - "version": "1.2.0", + "version": "1.2.0-alpha0", "description": "Implementation of basic functions of binary Merkle tree.", "main": "./dist/index.js", "types": "./dist/index.d.ts", @@ -64,7 +64,7 @@ ], "license": "MIT", "devDependencies": { - "@0xcert/utils": "1.2.0", + "@0xcert/utils": "1.2.0-alpha0", "@hayspec/cli": "^0.8.3", "@hayspec/spec": "^0.8.3", "nyc": "^13.1.0", diff --git a/packages/0xcert-scaffold/CHANGELOG.json b/packages/0xcert-scaffold/CHANGELOG.json index c03f3c2f8..3656a04c7 100644 --- a/packages/0xcert-scaffold/CHANGELOG.json +++ b/packages/0xcert-scaffold/CHANGELOG.json @@ -2,8 +2,8 @@ "name": "@0xcert/scaffold", "entries": [ { - "version": "1.2.0", - "tag": "@0xcert/scaffold_v1.2.0", + "version": "1.2.0-alpha0", + "tag": "@0xcert/scaffold_v1.2.0-alpha0", "date": "Fri, 22 Mar 2019 09:48:00 GMT", "comments": {} }, diff --git a/packages/0xcert-scaffold/CHANGELOG.md b/packages/0xcert-scaffold/CHANGELOG.md index 8e0c1801a..ad2cc2bc7 100644 --- a/packages/0xcert-scaffold/CHANGELOG.md +++ b/packages/0xcert-scaffold/CHANGELOG.md @@ -2,7 +2,7 @@ This log was last generated on Fri, 22 Mar 2019 09:48:00 GMT and should not be manually modified. -## 1.2.0 +## 1.2.0-alpha0 Fri, 22 Mar 2019 09:48:00 GMT *Version update only* diff --git a/packages/0xcert-scaffold/package.json b/packages/0xcert-scaffold/package.json index 3ac3783ab..119781384 100644 --- a/packages/0xcert-scaffold/package.json +++ b/packages/0xcert-scaffold/package.json @@ -1,6 +1,6 @@ { "name": "@0xcert/scaffold", - "version": "1.2.0", + "version": "1.2.0-alpha0", "description": "Overarching module with types, enums, and interfaces for easier development of interoperable modules.", "main": "./dist/index.js", "types": "./dist/index.d.ts", diff --git a/packages/0xcert-utils/CHANGELOG.json b/packages/0xcert-utils/CHANGELOG.json index 54f24cdc7..0c895f180 100644 --- a/packages/0xcert-utils/CHANGELOG.json +++ b/packages/0xcert-utils/CHANGELOG.json @@ -2,8 +2,8 @@ "name": "@0xcert/utils", "entries": [ { - "version": "1.2.0", - "tag": "@0xcert/utils_v1.2.0", + "version": "1.2.0-alpha0", + "tag": "@0xcert/utils_v1.2.0-alpha0", "date": "Fri, 22 Mar 2019 09:48:00 GMT", "comments": {} }, diff --git a/packages/0xcert-utils/CHANGELOG.md b/packages/0xcert-utils/CHANGELOG.md index 690c5a1d9..c28343203 100644 --- a/packages/0xcert-utils/CHANGELOG.md +++ b/packages/0xcert-utils/CHANGELOG.md @@ -2,7 +2,7 @@ This log was last generated on Fri, 22 Mar 2019 09:48:00 GMT and should not be manually modified. -## 1.2.0 +## 1.2.0-alpha0 Fri, 22 Mar 2019 09:48:00 GMT *Version update only* diff --git a/packages/0xcert-utils/package.json b/packages/0xcert-utils/package.json index 44a0bd441..fd2dafd44 100644 --- a/packages/0xcert-utils/package.json +++ b/packages/0xcert-utils/package.json @@ -1,6 +1,6 @@ { "name": "@0xcert/utils", - "version": "1.2.0", + "version": "1.2.0-alpha0", "description": "General utility module with common helper functions.", "main": "./dist/index.js", "types": "./dist/index.d.ts", diff --git a/packages/0xcert-vue-example/package.json b/packages/0xcert-vue-example/package.json index efe29b9ad..9d91fcd30 100644 --- a/packages/0xcert-vue-example/package.json +++ b/packages/0xcert-vue-example/package.json @@ -8,13 +8,13 @@ "test": "" }, "dependencies": { - "@0xcert/cert": "1.2.0", - "@0xcert/conventions": "1.2.0", - "@0xcert/ethereum-asset-ledger": "1.2.0", - "@0xcert/ethereum-order-gateway": "1.2.0", - "@0xcert/ethereum-value-ledger": "1.2.0", - "@0xcert/ethereum-metamask-provider": "1.2.0", - "@0xcert/vue-plugin": "1.2.0", + "@0xcert/cert": "1.2.0-alpha0", + "@0xcert/conventions": "1.2.0-alpha0", + "@0xcert/ethereum-asset-ledger": "1.2.0-alpha0", + "@0xcert/ethereum-order-gateway": "1.2.0-alpha0", + "@0xcert/ethereum-value-ledger": "1.2.0-alpha0", + "@0xcert/ethereum-metamask-provider": "1.2.0-alpha0", + "@0xcert/vue-plugin": "1.2.0-alpha0", "nuxt": "^2.3.1" } } diff --git a/packages/0xcert-vue-plugin/CHANGELOG.json b/packages/0xcert-vue-plugin/CHANGELOG.json index dd2ccf5fe..ec8c22fed 100644 --- a/packages/0xcert-vue-plugin/CHANGELOG.json +++ b/packages/0xcert-vue-plugin/CHANGELOG.json @@ -2,8 +2,8 @@ "name": "@0xcert/vue-plugin", "entries": [ { - "version": "1.2.0", - "tag": "@0xcert/vue-plugin_v1.2.0", + "version": "1.2.0-alpha0", + "tag": "@0xcert/vue-plugin_v1.2.0-alpha0", "date": "Fri, 22 Mar 2019 09:48:00 GMT", "comments": {} } diff --git a/packages/0xcert-vue-plugin/CHANGELOG.md b/packages/0xcert-vue-plugin/CHANGELOG.md index c42544c33..2e389697e 100644 --- a/packages/0xcert-vue-plugin/CHANGELOG.md +++ b/packages/0xcert-vue-plugin/CHANGELOG.md @@ -2,7 +2,7 @@ This log was last generated on Fri, 22 Mar 2019 09:48:00 GMT and should not be manually modified. -## 1.2.0 +## 1.2.0-alpha0 Fri, 22 Mar 2019 09:48:00 GMT *Initial release* diff --git a/packages/0xcert-vue-plugin/package.json b/packages/0xcert-vue-plugin/package.json index d4e08466e..653822864 100644 --- a/packages/0xcert-vue-plugin/package.json +++ b/packages/0xcert-vue-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@0xcert/vue-plugin", - "version": "1.2.0", + "version": "1.2.0-alpha0", "description": "Implementation of VueJS plug-in.", "main": "./dist/index.js", "types": "./dist/index.d.ts", @@ -72,6 +72,6 @@ "typescript": "^3.1.1" }, "dependencies": { - "@0xcert/scaffold": "1.2.0" + "@0xcert/scaffold": "1.2.0-alpha0" } } diff --git a/packages/0xcert-wanchain-asset-ledger/package.json b/packages/0xcert-wanchain-asset-ledger/package.json index ec77c7e31..abb50dec5 100644 --- a/packages/0xcert-wanchain-asset-ledger/package.json +++ b/packages/0xcert-wanchain-asset-ledger/package.json @@ -1,6 +1,6 @@ { "name": "@0xcert/wanchain-asset-ledger", - "version": "1.2.0", + "version": "1.2.0-alpha0", "description": "Asset ledger module for asset management on the Wanchain blockchain.", "main": "./dist/index.js", "types": "./dist/index.d.ts", @@ -64,7 +64,7 @@ ], "license": "MIT", "devDependencies": { - "@0xcert/ethereum-generic-provider": "1.2.0", + "@0xcert/ethereum-generic-provider": "1.2.0-alpha0", "@hayspec/cli": "^0.8.3", "@hayspec/spec": "^0.8.3", "nyc": "^13.1.0", @@ -73,6 +73,6 @@ "typescript": "^3.1.1" }, "dependencies": { - "@0xcert/ethereum-asset-ledger": "1.2.0" + "@0xcert/ethereum-asset-ledger": "1.2.0-alpha0" } } diff --git a/packages/0xcert-wanchain-http-provider/package.json b/packages/0xcert-wanchain-http-provider/package.json index 14986e488..cb0d81d51 100644 --- a/packages/0xcert-wanchain-http-provider/package.json +++ b/packages/0xcert-wanchain-http-provider/package.json @@ -1,6 +1,6 @@ { "name": "@0xcert/wanchain-http-provider", - "version": "1.2.0", + "version": "1.2.0-alpha0", "description": "Implementation of HTTP communication provider for the Wanchain blockchain.", "main": "./dist/index.js", "types": "./dist/index.d.ts", @@ -72,8 +72,8 @@ "typescript": "^3.1.1" }, "dependencies": { - "@0xcert/ethereum-generic-provider": "1.2.0", - "@0xcert/wanchain-utils": "1.2.0", - "@0xcert/utils": "1.2.0" + "@0xcert/ethereum-generic-provider": "1.2.0-alpha0", + "@0xcert/wanchain-utils": "1.2.0-alpha0", + "@0xcert/utils": "1.2.0-alpha0" } } diff --git a/packages/0xcert-wanchain-order-gateway/CHANGELOG.json b/packages/0xcert-wanchain-order-gateway/CHANGELOG.json index 57fa83134..c5878a50d 100644 --- a/packages/0xcert-wanchain-order-gateway/CHANGELOG.json +++ b/packages/0xcert-wanchain-order-gateway/CHANGELOG.json @@ -2,8 +2,8 @@ "name": "@0xcert/ethereum-order-gateway", "entries": [ { - "version": "1.2.0", - "tag": "@0xcert/ethereum-order-gateway_v1.2.0", + "version": "1.2.0-alpha0", + "tag": "@0xcert/ethereum-order-gateway_v1.2.0-alpha0", "date": "Fri, 22 Mar 2019 09:48:00 GMT", "comments": {} }, diff --git a/packages/0xcert-wanchain-order-gateway/CHANGELOG.md b/packages/0xcert-wanchain-order-gateway/CHANGELOG.md index b2eb448ac..c899792fb 100644 --- a/packages/0xcert-wanchain-order-gateway/CHANGELOG.md +++ b/packages/0xcert-wanchain-order-gateway/CHANGELOG.md @@ -2,7 +2,7 @@ This log was last generated on Fri, 22 Mar 2019 09:48:00 GMT and should not be manually modified. -## 1.2.0 +## 1.2.0-alpha0 Fri, 22 Mar 2019 09:48:00 GMT *Version update only* diff --git a/packages/0xcert-wanchain-order-gateway/package.json b/packages/0xcert-wanchain-order-gateway/package.json index 493c2f448..bca613e77 100644 --- a/packages/0xcert-wanchain-order-gateway/package.json +++ b/packages/0xcert-wanchain-order-gateway/package.json @@ -1,6 +1,6 @@ { "name": "@0xcert/wanchain-order-gateway", - "version": "1.2.0", + "version": "1.2.0-alpha0", "description": "Order gateway module for executing atomic operations on the Wanchain blockchain.", "main": "./dist/index.js", "types": "./dist/index.d.ts", @@ -72,6 +72,6 @@ "typescript": "^3.1.1" }, "dependencies": { - "@0xcert/ethereum-order-gateway": "1.2.0" + "@0xcert/ethereum-order-gateway": "1.2.0-alpha0" } } diff --git a/packages/0xcert-wanchain-utils/package.json b/packages/0xcert-wanchain-utils/package.json index 238eae13b..b994d591b 100644 --- a/packages/0xcert-wanchain-utils/package.json +++ b/packages/0xcert-wanchain-utils/package.json @@ -1,6 +1,6 @@ { "name": "@0xcert/wanchain-utils", - "version": "1.2.0", + "version": "1.2.0-alpha0", "description": "General Wanchain utility module with helper functions for the Wanchain blockchain.", "main": "./dist/index.js", "types": "./dist/index.d.ts", @@ -72,6 +72,6 @@ }, "dependencies": { "ethers": "4.0.0-beta.1", - "@0xcert/ethereum-utils": "1.2.0" + "@0xcert/ethereum-utils": "1.2.0-alpha0" } } diff --git a/packages/0xcert-wanchain-value-ledger/package.json b/packages/0xcert-wanchain-value-ledger/package.json index 0ca15a7a2..ec9691bc3 100644 --- a/packages/0xcert-wanchain-value-ledger/package.json +++ b/packages/0xcert-wanchain-value-ledger/package.json @@ -1,6 +1,6 @@ { "name": "@0xcert/wanchain-value-ledger", - "version": "1.2.0", + "version": "1.2.0-alpha0", "description": "Value ledger module for currency management on the Wanchain blockchain.", "main": "./dist/index.js", "types": "./dist/index.d.ts", @@ -72,6 +72,6 @@ "typescript": "^3.1.1" }, "dependencies": { - "@0xcert/ethereum-value-ledger": "1.2.0" + "@0xcert/ethereum-value-ledger": "1.2.0-alpha0" } } diff --git a/packages/0xcert-webpack/package.json b/packages/0xcert-webpack/package.json index 834f00278..51f4f70e5 100644 --- a/packages/0xcert-webpack/package.json +++ b/packages/0xcert-webpack/package.json @@ -9,16 +9,16 @@ }, "license": "MIT", "devDependencies": { - "@0xcert/cert": "1.2.0", - "@0xcert/ethereum-asset-ledger": "1.2.0", - "@0xcert/ethereum-http-provider": "1.2.0", - "@0xcert/ethereum-metamask-provider": "1.2.0", - "@0xcert/ethereum-order-gateway": "1.2.0", - "@0xcert/ethereum-value-ledger": "1.2.0", - "@0xcert/wanchain-asset-ledger": "1.2.0", - "@0xcert/wanchain-http-provider": "1.2.0", - "@0xcert/wanchain-order-gateway": "1.2.0", - "@0xcert/wanchain-value-ledger": "1.2.0", + "@0xcert/cert": "1.2.0-alpha0", + "@0xcert/ethereum-asset-ledger": "1.2.0-alpha0", + "@0xcert/ethereum-http-provider": "1.2.0-alpha0", + "@0xcert/ethereum-metamask-provider": "1.2.0-alpha0", + "@0xcert/ethereum-order-gateway": "1.2.0-alpha0", + "@0xcert/ethereum-value-ledger": "1.2.0-alpha0", + "@0xcert/wanchain-asset-ledger": "1.2.0-alpha0", + "@0xcert/wanchain-http-provider": "1.2.0-alpha0", + "@0xcert/wanchain-order-gateway": "1.2.0-alpha0", + "@0xcert/wanchain-value-ledger": "1.2.0-alpha0", "webpack": "^4.25.0", "webpack-cli": "^3.1.2" } From 5e4fbcc8ee8d37f9fd2e77c5b9533286c8d05bba Mon Sep 17 00:00:00 2001 From: Tadej Vengust Date: Thu, 11 Apr 2019 10:13:25 +0200 Subject: [PATCH 22/22] Fix wrong version. --- common/scripts/install-run.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/scripts/install-run.js b/common/scripts/install-run.js index b40da4ffb..ca6ece73f 100644 --- a/common/scripts/install-run.js +++ b/common/scripts/install-run.js @@ -369,7 +369,7 @@ function runWithErrorAndStatusCode(fn) { } exports.runWithErrorAndStatusCode = runWithErrorAndStatusCode; function run() { - const [nodePath, /* Ex: /bin/node */ scriptPath, /* /repo/common/scripts/install-run-rush.js */ rawPackageSpecifier, /* qrcode@^1.2.0-alpha0 */ packageBinName, /* qrcode */ ...packageBinArgs /* [-f, myproject/lib] */] = process.argv; + const [nodePath, /* Ex: /bin/node */ scriptPath, /* /repo/common/scripts/install-run-rush.js */ rawPackageSpecifier, /* qrcode@^1.2.0 */ packageBinName, /* qrcode */ ...packageBinArgs /* [-f, myproject/lib] */] = process.argv; if (!nodePath) { throw new Error('Unexpected exception: could not detect node path'); }