diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c8bdb0372e..1b638fb1e4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,7 +2,6 @@ image: node:10 variables: NODE_ENV: ci - NEAR_PROTOS_DIR: nearcore/core/protos/protos HELLO_WASM_PATH: nearcore/tests/hello.wasm stages: @@ -13,7 +12,7 @@ test: tags: - gcloud script: - - git clone --depth 1 -b known-stable https://github.com/nearprotocol/nearcore.git nearcore + - git clone --depth 1 https://github.com/nearprotocol/nearcore.git nearcore - yarn - yarn build - (cd nearcore && ./scripts/build_wasm.sh) diff --git a/dist/nearlib.js b/dist/nearlib.js index a19bb7f184..5063a517ab 100644 --- a/dist/nearlib.js +++ b/dist/nearlib.js @@ -5,21 +5,18 @@ window.nearlib = require('./lib/index'); window.Buffer = Buffer; }).call(this,require("buffer").Buffer) -},{"./lib/index":6,"buffer":39,"error-polyfill":46}],2:[function(require,module,exports){ +},{"./lib/index":6,"buffer":31,"error-polyfill":38}],2:[function(require,module,exports){ (function (Buffer){ 'use strict'; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; Object.defineProperty(exports, "__esModule", { value: true }); -const bn_js_1 = __importDefault(require("bn.js")); const transaction_1 = require("./transaction"); const provider_1 = require("./providers/provider"); const serialize_1 = require("./utils/serialize"); +const key_pair_1 = require("./utils/key_pair"); // Default amount of tokens to be send with the function calls. Used to pay for the fees // incurred while running the contract execution. The unused amount will be refunded back to // the originator. -const DEFAULT_FUNC_CALL_AMOUNT = new bn_js_1.default(1000000000); +const DEFAULT_FUNC_CALL_AMOUNT = 1000000; // Default number of retries before giving up on a transactioin. const TX_STATUS_RETRY_NUMBER = 10; // Default wait until next retry in millis. @@ -31,18 +28,25 @@ function sleep(millis) { return new Promise(resolve => setTimeout(resolve, millis)); } class Account { - get ready() { - return this._ready || (this._ready = Promise.resolve(this.fetchState())); - } constructor(connection, accountId) { this.connection = connection; this.accountId = accountId; } + get ready() { + return this._ready || (this._ready = Promise.resolve(this.fetchState())); + } async fetchState() { - const state = await this.connection.provider.query(`account/${this.accountId}`, ''); - this._state = state; - this._state.amount = state.amount; - this._state.stake = state.stake; + this._state = await this.connection.provider.query(`account/${this.accountId}`, ''); + try { + const publicKey = (await this.connection.signer.getPublicKey(this.accountId, this.connection.networkId)).toString(); + this._accessKey = await this.connection.provider.query(`access_key/${this.accountId}/${publicKey}`, ''); + if (this._accessKey === null) { + throw new Error(`Failed to fetch access key for '${this.accountId}' with public key ${publicKey}`); + } + } + catch { + this._accessKey = null; + } } async state() { await this.ready; @@ -67,8 +71,13 @@ class Account { } throw new Error(`Exceeded ${TX_STATUS_RETRY_NUMBER} status check attempts for transaction ${serialize_1.base_encode(txHash)}.`); } - async signAndSendTransaction(transaction) { - const [txHash, signedTx] = await transaction_1.signTransaction(this.connection.signer, transaction, this.accountId, this.connection.networkId); + async signAndSendTransaction(receiverId, actions) { + await this.ready; + if (this._accessKey === null) { + throw new Error(`Can not sign transactions, initialize account with available public key in Signer.`); + } + const status = await this.connection.provider.status(); + const [txHash, signedTx] = await transaction_1.signTransaction(receiverId, ++this._accessKey.nonce, actions, serialize_1.base_decode(status.sync_info.latest_block_hash), this.connection.signer, this.accountId, this.connection.networkId); let result; try { result = await this.connection.provider.sendTransaction(signedTx); @@ -81,18 +90,12 @@ class Account { throw error; } } - const flatLogs = result.logs.reduce((acc, it) => acc.concat(it.lines), []); - if (transaction.hasOwnProperty('contractId')) { - this.printLogs(transaction['contractId'], flatLogs); - } - else if (transaction.hasOwnProperty('originator')) { - this.printLogs(transaction['originator'], flatLogs); - } + const flatLogs = result.transactions.reduce((acc, it) => acc.concat(it.result.logs), []); + this.printLogs(signedTx.transaction.receiverId, flatLogs); if (result.status === provider_1.FinalTransactionStatus.Failed) { - if (result.logs) { - console.warn(flatLogs); + if (flatLogs) { const errorMessage = flatLogs.find(it => it.startsWith('ABORT:')) || flatLogs.find(it => it.startsWith('Runtime error:')) || ''; - throw new Error(`Transaction ${result.logs[0].hash} failed. ${errorMessage}`); + throw new Error(`Transaction ${result.transactions[0].hash} failed. ${errorMessage}`); } } // TODO: if Tx is Unknown or Started. @@ -100,50 +103,43 @@ class Account { return result; } async createAndDeployContract(contractId, publicKey, data, amount) { - await this.createAccount(contractId, publicKey, amount); + const accessKey = transaction_1.fullAccessKey(); + await this.signAndSendTransaction(contractId, [transaction_1.createAccount(), transaction_1.transfer(amount), transaction_1.addKey(key_pair_1.PublicKey.from(publicKey), accessKey), transaction_1.deployContract(data)]); const contractAccount = new Account(this.connection, contractId); - await contractAccount.ready; - await contractAccount.deployContract(data); return contractAccount; } - async sendMoney(receiver, amount) { - await this.ready; - this._state.nonce++; - return this.signAndSendTransaction(transaction_1.sendMoney(this._state.nonce, this.accountId, receiver, amount)); + async sendMoney(receiverId, amount) { + return this.signAndSendTransaction(receiverId, [transaction_1.transfer(amount)]); } async createAccount(newAccountId, publicKey, amount) { - await this.ready; - this._state.nonce++; - return this.signAndSendTransaction(transaction_1.createAccount(this._state.nonce, this.accountId, newAccountId, publicKey, amount)); + const accessKey = transaction_1.fullAccessKey(); + return this.signAndSendTransaction(newAccountId, [transaction_1.createAccount(), transaction_1.transfer(amount), transaction_1.addKey(key_pair_1.PublicKey.from(publicKey), accessKey)]); } async deployContract(data) { - await this.ready; - this._state.nonce++; - return this.signAndSendTransaction(transaction_1.deployContract(this._state.nonce, this.accountId, data)); + return this.signAndSendTransaction(this.accountId, [transaction_1.deployContract(data)]); } - async functionCall(contractId, methodName, args, amount) { + async functionCall(contractId, methodName, args, gas, amount) { if (!args) { args = {}; } - await this.ready; - this._state.nonce++; - return this.signAndSendTransaction(transaction_1.functionCall(this._state.nonce, this.accountId, contractId, methodName, Buffer.from(JSON.stringify(args)), amount || DEFAULT_FUNC_CALL_AMOUNT)); + return this.signAndSendTransaction(contractId, [transaction_1.functionCall(methodName, Buffer.from(JSON.stringify(args)), gas || DEFAULT_FUNC_CALL_AMOUNT, amount)]); } - async addKey(publicKey, contractId, methodName, balanceOwner, amount) { - await this.ready; - this._state.nonce++; - const accessKey = contractId ? transaction_1.createAccessKey(contractId, methodName, balanceOwner, amount) : null; - return this.signAndSendTransaction(transaction_1.addKey(this._state.nonce, this.accountId, publicKey, accessKey)); + // TODO: expand this API to support more options. + async addKey(publicKey, contractId, methodName, amount) { + let accessKey; + if (contractId === null || contractId === undefined) { + accessKey = transaction_1.fullAccessKey(); + } + else { + accessKey = transaction_1.functionCallAccessKey(contractId, !methodName ? [] : [methodName], amount); + } + return this.signAndSendTransaction(this.accountId, [transaction_1.addKey(key_pair_1.PublicKey.from(publicKey), accessKey)]); } async deleteKey(publicKey) { - await this.ready; - this._state.nonce++; - return this.signAndSendTransaction(transaction_1.deleteKey(this._state.nonce, this.accountId, publicKey)); + return this.signAndSendTransaction(this.accountId, [transaction_1.deleteKey(key_pair_1.PublicKey.from(publicKey))]); } async stake(publicKey, amount) { - await this.ready; - this._state.nonce++; - return this.signAndSendTransaction(transaction_1.stake(this._state.nonce, this.accountId, amount, publicKey)); + return this.signAndSendTransaction(this.accountId, [transaction_1.stake(amount, key_pair_1.PublicKey.from(publicKey))]); } async viewFunction(contractId, methodName, args) { const result = await this.connection.provider.query(`call/${contractId}/${methodName}`, serialize_1.base_encode(JSON.stringify(args))); @@ -152,15 +148,25 @@ class Account { } return JSON.parse(Buffer.from(result.result).toString()); } - async getAccountDetails() { + /// Returns array of {access_key: AccessKey, public_key: PublicKey} items. + async getAccessKeys() { const response = await this.connection.provider.query(`access_key/${this.accountId}`, ''); + return response; + } + async getAccountDetails() { + // TODO: update the response value to return all the different keys, not just app keys. + // Also if we need this function, or getAccessKeys is good enough. + const accessKeys = await this.getAccessKeys(); const result = { authorizedApps: [], transactions: [] }; - Object.keys(response).forEach((key) => { - result.authorizedApps.push({ - contractId: response[key][1].contract_id, - amount: response[key][1].amount, - publicKey: serialize_1.base_encode(response[key][0]), - }); + accessKeys.map((item) => { + if (item.access_key.permission.FunctionCall !== undefined) { + const perm = item.access_key.permission.FunctionCall; + result.authorizedApps.push({ + contractId: perm.receiver_id, + amount: perm.allowance, + publicKey: item.public_key, + }); + } }); return result; } @@ -168,7 +174,7 @@ class Account { exports.Account = Account; }).call(this,require("buffer").Buffer) -},{"./providers/provider":17,"./transaction":19,"./utils/serialize":23,"bn.js":35,"buffer":39}],3:[function(require,module,exports){ +},{"./providers/provider":16,"./transaction":18,"./utils/key_pair":20,"./utils/serialize":22,"buffer":31}],3:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** @@ -234,7 +240,7 @@ class Connection { } exports.Connection = Connection; -},{"./providers":15,"./signer":18}],5:[function(require,module,exports){ +},{"./providers":14,"./signer":17}],5:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); const providers_1 = require("./providers"); @@ -263,7 +269,7 @@ class Contract { } exports.Contract = Contract; -},{"./providers":15}],6:[function(require,module,exports){ +},{"./providers":14}],6:[function(require,module,exports){ 'use strict'; var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; @@ -279,6 +285,8 @@ const utils = __importStar(require("./utils")); exports.utils = utils; const keyStores = __importStar(require("./key_stores")); exports.keyStores = keyStores; +const transactions = __importStar(require("./transaction")); +exports.transactions = transactions; const account_1 = require("./account"); exports.Account = account_1.Account; const accountCreator = __importStar(require("./account_creator")); @@ -297,7 +305,7 @@ exports.connect = near_1.connect; const wallet_account_1 = require("./wallet-account"); exports.WalletAccount = wallet_account_1.WalletAccount; -},{"./account":2,"./account_creator":3,"./connection":4,"./contract":5,"./key_stores":9,"./near":13,"./providers":15,"./signer":18,"./utils":20,"./utils/key_pair":21,"./wallet-account":25}],7:[function(require,module,exports){ +},{"./account":2,"./account_creator":3,"./connection":4,"./contract":5,"./key_stores":9,"./near":13,"./providers":14,"./signer":17,"./transaction":18,"./utils":19,"./utils/key_pair":20,"./wallet-account":24}],7:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); const keystore_1 = require("./keystore"); @@ -362,7 +370,7 @@ class BrowserLocalStorageKeyStore extends keystore_1.KeyStore { } exports.BrowserLocalStorageKeyStore = BrowserLocalStorageKeyStore; -},{"../utils/key_pair":21,"./keystore":10}],8:[function(require,module,exports){ +},{"../utils/key_pair":20,"./keystore":10}],8:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); const keystore_1 = require("./keystore"); @@ -403,8 +411,8 @@ class InMemoryKeyStore extends keystore_1.KeyStore { const result = new Array(); Object.keys(this.keys).forEach((key) => { const parts = key.split(':'); - if (parts[1] === networkId) { - result.push(parts[0]); + if (parts[parts.length - 1] === networkId) { + result.push(parts.slice(0, parts.length - 1).join(':')); } }); return result; @@ -412,7 +420,7 @@ class InMemoryKeyStore extends keystore_1.KeyStore { } exports.InMemoryKeyStore = InMemoryKeyStore; -},{"../utils/key_pair":21,"./keystore":10}],9:[function(require,module,exports){ +},{"../utils/key_pair":20,"./keystore":10}],9:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const keystore_1 = require("./keystore"); @@ -586,7 +594,7 @@ class UnencryptedFileSystemKeyStore extends keystore_1.KeyStore { } exports.UnencryptedFileSystemKeyStore = UnencryptedFileSystemKeyStore; -},{"../utils/key_pair":21,"./keystore":10,"fs":37,"util":86}],13:[function(require,module,exports){ +},{"../utils/key_pair":20,"./keystore":10,"fs":29,"util":67}],13:[function(require,module,exports){ "use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; @@ -641,17 +649,6 @@ class Near { const account = new account_1.Account(this.connection, options.sender); return new contract_1.Contract(account, contractId, options); } - /** - * Backwards compatibility method. Use `contractAccount.deployContract` or `yourAccount.createAndDeployContract` instead. - * @param contractId - * @param wasmByteArray - */ - async deployContract(contractId, wasmByteArray) { - console.warn('near.deployContract is deprecated. Use `contractAccount.deployContract` or `yourAccount.createAndDeployContract` instead.'); - const account = new account_1.Account(this.connection, contractId); - const result = await account.deployContract(wasmByteArray); - return result.logs[0].hash; - } /** * Backwards compatibility method. Use `yourAccount.sendMoney` instead. * @param amount @@ -662,7 +659,7 @@ class Near { console.warn('near.sendTokens is deprecated. Use `yourAccount.sendMoney` instead.'); const account = new account_1.Account(this.connection, originator); const result = await account.sendMoney(receiver, amount); - return result.logs[0].hash; + return result.transactions[0].hash; } } exports.Near = Near; @@ -673,7 +670,7 @@ async function connect(config) { const keyFile = await unencrypted_file_system_keystore_1.loadJsonFile(config.keyPath); if (keyFile.account_id) { // TODO: Only load key if network ID matches - const keyPair = new key_pair_1.KeyPairEd25519(keyFile.secret_key); + const keyPair = key_pair_1.KeyPair.fromString(keyFile.secret_key); const keyPathStore = new key_stores_1.InMemoryKeyStore(); await keyPathStore.setKey(config.networkId, keyFile.account_id, keyPair); if (!config.masterAccount) { @@ -691,7862 +688,2099 @@ async function connect(config) { } exports.connect = connect; -},{"./account":2,"./account_creator":3,"./connection":4,"./contract":5,"./key_stores":9,"./key_stores/unencrypted_file_system_keystore":12,"./utils/key_pair":21,"bn.js":35}],14:[function(require,module,exports){ -/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +},{"./account":2,"./account_creator":3,"./connection":4,"./contract":5,"./key_stores":9,"./key_stores/unencrypted_file_system_keystore":12,"./utils/key_pair":20,"bn.js":27}],14:[function(require,module,exports){ "use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const provider_1 = require("./provider"); +exports.Provider = provider_1.Provider; +exports.getTransactionLastResult = provider_1.getTransactionLastResult; +const json_rpc_provider_1 = require("./json-rpc-provider"); +exports.JsonRpcProvider = json_rpc_provider_1.JsonRpcProvider; -var $protobuf = require("protobufjs/minimal"); - -// Common aliases -var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; - -// Exported root namespace -var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {}); - -$root.CreateAccountTransaction = (function() { - - /** - * Properties of a CreateAccountTransaction. - * @exports ICreateAccountTransaction - * @interface ICreateAccountTransaction - * @property {number|Long|null} [nonce] CreateAccountTransaction nonce - * @property {string|null} [originator] CreateAccountTransaction originator - * @property {string|null} [newAccountId] CreateAccountTransaction newAccountId - * @property {IUint128|null} [amount] CreateAccountTransaction amount - * @property {Uint8Array|null} [publicKey] CreateAccountTransaction publicKey - */ - - /** - * Constructs a new CreateAccountTransaction. - * @exports CreateAccountTransaction - * @classdesc Represents a CreateAccountTransaction. - * @implements ICreateAccountTransaction - * @constructor - * @param {ICreateAccountTransaction=} [properties] Properties to set - */ - function CreateAccountTransaction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; +},{"./json-rpc-provider":15,"./provider":16}],15:[function(require,module,exports){ +(function (Buffer){ +'use strict'; +Object.defineProperty(exports, "__esModule", { value: true }); +const provider_1 = require("./provider"); +const web_1 = require("../utils/web"); +const serialize_1 = require("../utils/serialize"); +/// Keep ids unique across all connections. +let _nextId = 123; +class JsonRpcProvider extends provider_1.Provider { + constructor(url, network) { + super(); + // TODO: resolve network to url... + this.connection = { url }; } - - /** - * CreateAccountTransaction nonce. - * @member {number|Long} nonce - * @memberof CreateAccountTransaction - * @instance - */ - CreateAccountTransaction.prototype.nonce = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * CreateAccountTransaction originator. - * @member {string} originator - * @memberof CreateAccountTransaction - * @instance - */ - CreateAccountTransaction.prototype.originator = ""; - - /** - * CreateAccountTransaction newAccountId. - * @member {string} newAccountId - * @memberof CreateAccountTransaction - * @instance - */ - CreateAccountTransaction.prototype.newAccountId = ""; - - /** - * CreateAccountTransaction amount. - * @member {IUint128|null|undefined} amount - * @memberof CreateAccountTransaction - * @instance - */ - CreateAccountTransaction.prototype.amount = null; - - /** - * CreateAccountTransaction publicKey. - * @member {Uint8Array} publicKey - * @memberof CreateAccountTransaction - * @instance - */ - CreateAccountTransaction.prototype.publicKey = $util.newBuffer([]); - - /** - * Creates a new CreateAccountTransaction instance using the specified properties. - * @function create - * @memberof CreateAccountTransaction - * @static - * @param {ICreateAccountTransaction=} [properties] Properties to set - * @returns {CreateAccountTransaction} CreateAccountTransaction instance - */ - CreateAccountTransaction.create = function create(properties) { - return new CreateAccountTransaction(properties); - }; - - /** - * Encodes the specified CreateAccountTransaction message. Does not implicitly {@link CreateAccountTransaction.verify|verify} messages. - * @function encode - * @memberof CreateAccountTransaction - * @static - * @param {ICreateAccountTransaction} message CreateAccountTransaction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateAccountTransaction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.nonce != null && message.hasOwnProperty("nonce")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.nonce); - if (message.originator != null && message.hasOwnProperty("originator")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.originator); - if (message.newAccountId != null && message.hasOwnProperty("newAccountId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.newAccountId); - if (message.amount != null && message.hasOwnProperty("amount")) - $root.Uint128.encode(message.amount, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.publicKey != null && message.hasOwnProperty("publicKey")) - writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.publicKey); - return writer; - }; - - /** - * Encodes the specified CreateAccountTransaction message, length delimited. Does not implicitly {@link CreateAccountTransaction.verify|verify} messages. - * @function encodeDelimited - * @memberof CreateAccountTransaction - * @static - * @param {ICreateAccountTransaction} message CreateAccountTransaction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateAccountTransaction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateAccountTransaction message from the specified reader or buffer. - * @function decode - * @memberof CreateAccountTransaction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {CreateAccountTransaction} CreateAccountTransaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateAccountTransaction.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CreateAccountTransaction(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.nonce = reader.uint64(); - break; - case 2: - message.originator = reader.string(); - break; - case 3: - message.newAccountId = reader.string(); - break; - case 4: - message.amount = $root.Uint128.decode(reader, reader.uint32()); - break; - case 5: - message.publicKey = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } + async getNetwork() { + return { + name: 'test', + chainId: 'test' + }; + } + async status() { + return this.sendJsonRpc('status', []); + } + async sendTransaction(signedTransaction) { + const bytes = signedTransaction.encode(); + return this.sendJsonRpc('broadcast_tx_commit', [Buffer.from(bytes).toString('base64')]); + } + async txStatus(txHash) { + return this.sendJsonRpc('tx', [serialize_1.base_encode(txHash)]); + } + async query(path, data) { + const result = await this.sendJsonRpc('query', [path, data]); + if (result.error) { + throw new Error(`Quering ${path} failed: ${result.error}.\n${JSON.stringify(result, null, 2)}`); } - return message; - }; - - /** - * Decodes a CreateAccountTransaction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof CreateAccountTransaction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {CreateAccountTransaction} CreateAccountTransaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateAccountTransaction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateAccountTransaction message. - * @function verify - * @memberof CreateAccountTransaction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateAccountTransaction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.nonce != null && message.hasOwnProperty("nonce")) - if (!$util.isInteger(message.nonce) && !(message.nonce && $util.isInteger(message.nonce.low) && $util.isInteger(message.nonce.high))) - return "nonce: integer|Long expected"; - if (message.originator != null && message.hasOwnProperty("originator")) - if (!$util.isString(message.originator)) - return "originator: string expected"; - if (message.newAccountId != null && message.hasOwnProperty("newAccountId")) - if (!$util.isString(message.newAccountId)) - return "newAccountId: string expected"; - if (message.amount != null && message.hasOwnProperty("amount")) { - var error = $root.Uint128.verify(message.amount); - if (error) - return "amount." + error; + return result; + } + async block(height) { + return this.sendJsonRpc('block', [height]); + } + async sendJsonRpc(method, params) { + const request = { + method, + params, + id: (_nextId++), + jsonrpc: '2.0' + }; + const result = await web_1.fetchJson(this.connection, JSON.stringify(request)); + if (result.error) { + throw new Error(`[${result.error.code}] ${result.error.message}: ${result.error.data}`); } - if (message.publicKey != null && message.hasOwnProperty("publicKey")) - if (!(message.publicKey && typeof message.publicKey.length === "number" || $util.isString(message.publicKey))) - return "publicKey: buffer expected"; - return null; - }; + return result.result; + } +} +exports.JsonRpcProvider = JsonRpcProvider; - /** - * Creates a CreateAccountTransaction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof CreateAccountTransaction - * @static - * @param {Object.} object Plain object - * @returns {CreateAccountTransaction} CreateAccountTransaction - */ - CreateAccountTransaction.fromObject = function fromObject(object) { - if (object instanceof $root.CreateAccountTransaction) - return object; - var message = new $root.CreateAccountTransaction(); - if (object.nonce != null) - if ($util.Long) - (message.nonce = $util.Long.fromValue(object.nonce)).unsigned = true; - else if (typeof object.nonce === "string") - message.nonce = parseInt(object.nonce, 10); - else if (typeof object.nonce === "number") - message.nonce = object.nonce; - else if (typeof object.nonce === "object") - message.nonce = new $util.LongBits(object.nonce.low >>> 0, object.nonce.high >>> 0).toNumber(true); - if (object.originator != null) - message.originator = String(object.originator); - if (object.newAccountId != null) - message.newAccountId = String(object.newAccountId); - if (object.amount != null) { - if (typeof object.amount !== "object") - throw TypeError(".CreateAccountTransaction.amount: object expected"); - message.amount = $root.Uint128.fromObject(object.amount); +}).call(this,require("buffer").Buffer) +},{"../utils/serialize":22,"../utils/web":23,"./provider":16,"buffer":31}],16:[function(require,module,exports){ +(function (Buffer){ +'use strict'; +Object.defineProperty(exports, "__esModule", { value: true }); +var FinalTransactionStatus; +(function (FinalTransactionStatus) { + FinalTransactionStatus["Unknown"] = "Unknown"; + FinalTransactionStatus["Started"] = "Started"; + FinalTransactionStatus["Failed"] = "Failed"; + FinalTransactionStatus["Completed"] = "Completed"; +})(FinalTransactionStatus = exports.FinalTransactionStatus || (exports.FinalTransactionStatus = {})); +class Provider { +} +exports.Provider = Provider; +function getTransactionLastResult(txResult) { + for (let i = txResult.transactions.length - 1; i >= 0; --i) { + const r = txResult.transactions[i]; + if (r.result && r.result.result && r.result.result.length > 0) { + return JSON.parse(Buffer.from(r.result.result, 'base64').toString()); } - if (object.publicKey != null) - if (typeof object.publicKey === "string") - $util.base64.decode(object.publicKey, message.publicKey = $util.newBuffer($util.base64.length(object.publicKey)), 0); - else if (object.publicKey.length) - message.publicKey = object.publicKey; - return message; - }; + } + return null; +} +exports.getTransactionLastResult = getTransactionLastResult; +}).call(this,require("buffer").Buffer) +},{"buffer":31}],17:[function(require,module,exports){ +'use strict'; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const js_sha256_1 = __importDefault(require("js-sha256")); +const key_pair_1 = require("./utils/key_pair"); +/** + * General signing interface, can be used for in memory signing, RPC singing, external wallet, HSM, etc. + */ +class Signer { /** - * Creates a plain object from a CreateAccountTransaction message. Also converts values to other types if specified. - * @function toObject - * @memberof CreateAccountTransaction - * @static - * @param {CreateAccountTransaction} message CreateAccountTransaction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Signs given message, by first hashing with sha256. + * @param message message to sign. + * @param accountId accountId to use for signing. + * @param networkId network for this accontId. */ - CreateAccountTransaction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.nonce = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.nonce = options.longs === String ? "0" : 0; - object.originator = ""; - object.newAccountId = ""; - object.amount = null; - if (options.bytes === String) - object.publicKey = ""; - else { - object.publicKey = []; - if (options.bytes !== Array) - object.publicKey = $util.newBuffer(object.publicKey); - } + async signMessage(message, accountId, networkId) { + return this.signHash(new Uint8Array(js_sha256_1.default.sha256.array(message)), accountId, networkId); + } +} +exports.Signer = Signer; +/** + * Signs using in memory key store. + */ +class InMemorySigner extends Signer { + constructor(keyStore) { + super(); + this.keyStore = keyStore; + } + async createKey(accountId, networkId) { + const keyPair = key_pair_1.KeyPair.fromRandom('ed25519'); + await this.keyStore.setKey(networkId, accountId, keyPair); + return keyPair.getPublicKey(); + } + async getPublicKey(accountId, networkId) { + const keyPair = await this.keyStore.getKey(networkId, accountId); + return keyPair.getPublicKey(); + } + async signHash(hash, accountId, networkId) { + if (!accountId) { + throw new Error('InMemorySigner requires provided account id'); } - if (message.nonce != null && message.hasOwnProperty("nonce")) - if (typeof message.nonce === "number") - object.nonce = options.longs === String ? String(message.nonce) : message.nonce; - else - object.nonce = options.longs === String ? $util.Long.prototype.toString.call(message.nonce) : options.longs === Number ? new $util.LongBits(message.nonce.low >>> 0, message.nonce.high >>> 0).toNumber(true) : message.nonce; - if (message.originator != null && message.hasOwnProperty("originator")) - object.originator = message.originator; - if (message.newAccountId != null && message.hasOwnProperty("newAccountId")) - object.newAccountId = message.newAccountId; - if (message.amount != null && message.hasOwnProperty("amount")) - object.amount = $root.Uint128.toObject(message.amount, options); - if (message.publicKey != null && message.hasOwnProperty("publicKey")) - object.publicKey = options.bytes === String ? $util.base64.encode(message.publicKey, 0, message.publicKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.publicKey) : message.publicKey; - return object; - }; - - /** - * Converts this CreateAccountTransaction to JSON. - * @function toJSON - * @memberof CreateAccountTransaction - * @instance - * @returns {Object.} JSON object - */ - CreateAccountTransaction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return CreateAccountTransaction; -})(); - -$root.DeployContractTransaction = (function() { - - /** - * Properties of a DeployContractTransaction. - * @exports IDeployContractTransaction - * @interface IDeployContractTransaction - * @property {number|Long|null} [nonce] DeployContractTransaction nonce - * @property {string|null} [contractId] DeployContractTransaction contractId - * @property {Uint8Array|null} [wasmByteArray] DeployContractTransaction wasmByteArray - */ - - /** - * Constructs a new DeployContractTransaction. - * @exports DeployContractTransaction - * @classdesc Represents a DeployContractTransaction. - * @implements IDeployContractTransaction - * @constructor - * @param {IDeployContractTransaction=} [properties] Properties to set - */ - function DeployContractTransaction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + const keyPair = await this.keyStore.getKey(networkId, accountId); + if (keyPair === null) { + throw new Error(`Key for ${accountId} not found in ${networkId}`); + } + return keyPair.sign(hash); } +} +exports.InMemorySigner = InMemorySigner; - /** - * DeployContractTransaction nonce. - * @member {number|Long} nonce - * @memberof DeployContractTransaction - * @instance - */ - DeployContractTransaction.prototype.nonce = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * DeployContractTransaction contractId. - * @member {string} contractId - * @memberof DeployContractTransaction - * @instance - */ - DeployContractTransaction.prototype.contractId = ""; - - /** - * DeployContractTransaction wasmByteArray. - * @member {Uint8Array} wasmByteArray - * @memberof DeployContractTransaction - * @instance - */ - DeployContractTransaction.prototype.wasmByteArray = $util.newBuffer([]); - - /** - * Creates a new DeployContractTransaction instance using the specified properties. - * @function create - * @memberof DeployContractTransaction - * @static - * @param {IDeployContractTransaction=} [properties] Properties to set - * @returns {DeployContractTransaction} DeployContractTransaction instance - */ - DeployContractTransaction.create = function create(properties) { - return new DeployContractTransaction(properties); - }; - - /** - * Encodes the specified DeployContractTransaction message. Does not implicitly {@link DeployContractTransaction.verify|verify} messages. - * @function encode - * @memberof DeployContractTransaction - * @static - * @param {IDeployContractTransaction} message DeployContractTransaction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeployContractTransaction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.nonce != null && message.hasOwnProperty("nonce")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.nonce); - if (message.contractId != null && message.hasOwnProperty("contractId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.contractId); - if (message.wasmByteArray != null && message.hasOwnProperty("wasmByteArray")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.wasmByteArray); - return writer; - }; - - /** - * Encodes the specified DeployContractTransaction message, length delimited. Does not implicitly {@link DeployContractTransaction.verify|verify} messages. - * @function encodeDelimited - * @memberof DeployContractTransaction - * @static - * @param {IDeployContractTransaction} message DeployContractTransaction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeployContractTransaction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeployContractTransaction message from the specified reader or buffer. - * @function decode - * @memberof DeployContractTransaction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {DeployContractTransaction} DeployContractTransaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeployContractTransaction.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.DeployContractTransaction(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.nonce = reader.uint64(); - break; - case 2: - message.contractId = reader.string(); - break; - case 3: - message.wasmByteArray = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeployContractTransaction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof DeployContractTransaction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {DeployContractTransaction} DeployContractTransaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeployContractTransaction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeployContractTransaction message. - * @function verify - * @memberof DeployContractTransaction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeployContractTransaction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.nonce != null && message.hasOwnProperty("nonce")) - if (!$util.isInteger(message.nonce) && !(message.nonce && $util.isInteger(message.nonce.low) && $util.isInteger(message.nonce.high))) - return "nonce: integer|Long expected"; - if (message.contractId != null && message.hasOwnProperty("contractId")) - if (!$util.isString(message.contractId)) - return "contractId: string expected"; - if (message.wasmByteArray != null && message.hasOwnProperty("wasmByteArray")) - if (!(message.wasmByteArray && typeof message.wasmByteArray.length === "number" || $util.isString(message.wasmByteArray))) - return "wasmByteArray: buffer expected"; - return null; - }; +},{"./utils/key_pair":20,"js-sha256":50}],18:[function(require,module,exports){ +'use strict'; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const js_sha256_1 = __importDefault(require("js-sha256")); +const serialize_1 = require("./utils/serialize"); +const key_pair_1 = require("./utils/key_pair"); +class Enum { + constructor(properties) { + if (Object.keys(properties).length !== 1) { + throw new Error('Enum can only take single value'); + } + Object.keys(properties).map((key) => { + this[key] = properties[key]; + this.enum = key; + }); + } +} +class Assignable { + constructor(properties) { + Object.keys(properties).map((key) => { + this[key] = properties[key]; + }); + } +} +class FunctionCallPermission extends Assignable { +} +exports.FunctionCallPermission = FunctionCallPermission; +class FullAccessPermission extends Assignable { +} +exports.FullAccessPermission = FullAccessPermission; +class AccessKeyPermission extends Enum { +} +exports.AccessKeyPermission = AccessKeyPermission; +class AccessKey extends Assignable { +} +exports.AccessKey = AccessKey; +function fullAccessKey() { + return new AccessKey({ nonce: 0, permission: new AccessKeyPermission({ fullAccess: new FullAccessPermission({}) }) }); +} +exports.fullAccessKey = fullAccessKey; +function functionCallAccessKey(receiverId, methodNames, allowance) { + return new AccessKey({ nonce: 0, permission: new AccessKeyPermission({ functionCall: new FunctionCallPermission({ receiverId, allowance, methodNames }) }) }); +} +exports.functionCallAccessKey = functionCallAccessKey; +class IAction extends Assignable { +} +exports.IAction = IAction; +class CreateAccount extends IAction { +} +class DeployContract extends IAction { +} +class FunctionCall extends IAction { +} +class Transfer extends IAction { +} +class Stake extends IAction { +} +class AddKey extends IAction { +} +class DeleteKey extends IAction { +} +class DeleteAccount extends IAction { +} +function createAccount() { + return new Action({ createAccount: new CreateAccount({}) }); +} +exports.createAccount = createAccount; +function deployContract(code) { + return new Action({ deployContract: new DeployContract({ code }) }); +} +exports.deployContract = deployContract; +function functionCall(methodName, args, gas, deposit) { + return new Action({ functionCall: new FunctionCall({ methodName, args, gas, deposit }) }); +} +exports.functionCall = functionCall; +function transfer(deposit) { + return new Action({ transfer: new Transfer({ deposit }) }); +} +exports.transfer = transfer; +function stake(stake, publicKey) { + return new Action({ stake: new Stake({ stake, publicKey }) }); +} +exports.stake = stake; +function addKey(publicKey, accessKey) { + return new Action({ addKey: new AddKey({ publicKey, accessKey }) }); +} +exports.addKey = addKey; +function deleteKey(publicKey) { + return new Action({ deleteKey: new DeleteKey({ publicKey }) }); +} +exports.deleteKey = deleteKey; +function deleteAccount(beneficiaryId) { + return new Action({ deleteAccount: new DeleteAccount({ beneficiaryId }) }); +} +exports.deleteAccount = deleteAccount; +class Signature { + constructor(signature) { + this.keyType = key_pair_1.KeyType.ED25519; + this.data = signature; + } +} +class Transaction extends Assignable { +} +class SignedTransaction extends Assignable { + encode() { + return serialize_1.serialize(SCHEMA, this); + } +} +exports.SignedTransaction = SignedTransaction; +class Action extends Enum { +} +exports.Action = Action; +const SCHEMA = new Map([ + [Signature, { kind: 'struct', fields: [['keyType', 'u8'], ['data', [32]]] }], + [SignedTransaction, { kind: 'struct', fields: [['transaction', Transaction], ['signature', Signature]] }], + [Transaction, { kind: 'struct', fields: [['signerId', 'string'], ['publicKey', key_pair_1.PublicKey], ['nonce', 'u64'], ['receiverId', 'string'], ['blockHash', [32]], ['actions', [Action]]] }], + [key_pair_1.PublicKey, { + kind: 'struct', fields: [['keyType', 'u8'], ['data', [32]]] + }], + [AccessKey, { kind: 'struct', fields: [ + ['nonce', 'u64'], + ['permission', AccessKeyPermission], + ] }], + [AccessKeyPermission, { kind: 'enum', field: 'enum', values: [ + ['functionCall', FunctionCallPermission], + ['fullAccess', FullAccessPermission], + ] }], + [FunctionCallPermission, { kind: 'struct', fields: [ + ['allowance', { kind: 'option', type: 'u128' }], + ['receiverId', 'string'], + ['methodNames', ['string']], + ] }], + [FullAccessPermission, { kind: 'struct', fields: [] }], + [Action, { kind: 'enum', field: 'enum', values: [ + ['createAccount', CreateAccount], + ['deployContract', DeployContract], + ['functionCall', functionCall], + ['transfer', transfer], + ['stake', stake], + ['addKey', addKey], + ['deleteKey', deleteKey], + ['deleteAccount', deleteAccount], + ] }], + [CreateAccount, { kind: 'struct', fields: [] }], + [DeployContract, { kind: 'struct', fields: [['code', ['u8']]] }], + [FunctionCall, { kind: 'struct', fields: [['methodName', 'string'], ['args', ['u8']], ['gas', 'u64'], ['deposit', 'u128']] }], + [Transfer, { kind: 'struct', fields: [['deposit', 'u128']] }], + [Stake, { kind: 'struct', fields: [['stake', 'u128'], ['publicKey', key_pair_1.PublicKey]] }], + [AddKey, { kind: 'struct', fields: [['publicKey', key_pair_1.PublicKey], ['accessKey', AccessKey]] }], + [DeleteKey, { kind: 'struct', fields: [['publicKey', key_pair_1.PublicKey]] }], + [DeleteAccount, { kind: 'struct', fields: [['beneficiaryId', 'string']] }], +]); +async function signTransaction(receiverId, nonce, actions, blockHash, signer, accountId, networkId) { + const publicKey = await signer.getPublicKey(accountId, networkId); + const transaction = new Transaction({ signerId: accountId, publicKey, nonce, receiverId, actions, blockHash }); + const message = serialize_1.serialize(SCHEMA, transaction); + const hash = new Uint8Array(js_sha256_1.default.sha256.array(message)); + const signature = await signer.signHash(hash, accountId, networkId); + const signedTx = new SignedTransaction({ transaction, signature: new Signature(signature.signature) }); + return [hash, signedTx]; +} +exports.signTransaction = signTransaction; - /** - * Creates a DeployContractTransaction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof DeployContractTransaction - * @static - * @param {Object.} object Plain object - * @returns {DeployContractTransaction} DeployContractTransaction - */ - DeployContractTransaction.fromObject = function fromObject(object) { - if (object instanceof $root.DeployContractTransaction) - return object; - var message = new $root.DeployContractTransaction(); - if (object.nonce != null) - if ($util.Long) - (message.nonce = $util.Long.fromValue(object.nonce)).unsigned = true; - else if (typeof object.nonce === "string") - message.nonce = parseInt(object.nonce, 10); - else if (typeof object.nonce === "number") - message.nonce = object.nonce; - else if (typeof object.nonce === "object") - message.nonce = new $util.LongBits(object.nonce.low >>> 0, object.nonce.high >>> 0).toNumber(true); - if (object.contractId != null) - message.contractId = String(object.contractId); - if (object.wasmByteArray != null) - if (typeof object.wasmByteArray === "string") - $util.base64.decode(object.wasmByteArray, message.wasmByteArray = $util.newBuffer($util.base64.length(object.wasmByteArray)), 0); - else if (object.wasmByteArray.length) - message.wasmByteArray = object.wasmByteArray; - return message; - }; +},{"./utils/key_pair":20,"./utils/serialize":22,"js-sha256":50}],19:[function(require,module,exports){ +"use strict"; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const key_pair = __importStar(require("./key_pair")); +exports.key_pair = key_pair; +const network = __importStar(require("./network")); +exports.network = network; +const serialize = __importStar(require("./serialize")); +exports.serialize = serialize; +const web = __importStar(require("./web")); +exports.web = web; +const key_pair_1 = require("./key_pair"); +exports.KeyPair = key_pair_1.KeyPair; +exports.KeyPairEd25519 = key_pair_1.KeyPairEd25519; - /** - * Creates a plain object from a DeployContractTransaction message. Also converts values to other types if specified. - * @function toObject - * @memberof DeployContractTransaction - * @static - * @param {DeployContractTransaction} message DeployContractTransaction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeployContractTransaction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.nonce = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.nonce = options.longs === String ? "0" : 0; - object.contractId = ""; - if (options.bytes === String) - object.wasmByteArray = ""; - else { - object.wasmByteArray = []; - if (options.bytes !== Array) - object.wasmByteArray = $util.newBuffer(object.wasmByteArray); - } +},{"./key_pair":20,"./network":21,"./serialize":22,"./web":23}],20:[function(require,module,exports){ +'use strict'; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const tweetnacl_1 = __importDefault(require("tweetnacl")); +const serialize_1 = require("./serialize"); +/** All supported key types */ +var KeyType; +(function (KeyType) { + KeyType[KeyType["ED25519"] = 0] = "ED25519"; +})(KeyType = exports.KeyType || (exports.KeyType = {})); +function key_type_to_str(keyType) { + switch (keyType) { + case KeyType.ED25519: return 'ed25519'; + default: throw new Error(`Unknown key type ${keyType}`); + } +} +function str_to_key_type(keyType) { + switch (keyType.toLowerCase()) { + case 'ed25519': return KeyType.ED25519; + default: throw new Error(`Unknown key type ${keyType}`); + } +} +/** + * PublicKey representation that has type and bytes of the key. + */ +class PublicKey { + constructor(keyType, data) { + this.keyType = keyType; + this.data = data; + } + static from(value) { + if (typeof value === 'string') { + return PublicKey.fromString(value); } - if (message.nonce != null && message.hasOwnProperty("nonce")) - if (typeof message.nonce === "number") - object.nonce = options.longs === String ? String(message.nonce) : message.nonce; - else - object.nonce = options.longs === String ? $util.Long.prototype.toString.call(message.nonce) : options.longs === Number ? new $util.LongBits(message.nonce.low >>> 0, message.nonce.high >>> 0).toNumber(true) : message.nonce; - if (message.contractId != null && message.hasOwnProperty("contractId")) - object.contractId = message.contractId; - if (message.wasmByteArray != null && message.hasOwnProperty("wasmByteArray")) - object.wasmByteArray = options.bytes === String ? $util.base64.encode(message.wasmByteArray, 0, message.wasmByteArray.length) : options.bytes === Array ? Array.prototype.slice.call(message.wasmByteArray) : message.wasmByteArray; - return object; - }; - - /** - * Converts this DeployContractTransaction to JSON. - * @function toJSON - * @memberof DeployContractTransaction - * @instance - * @returns {Object.} JSON object - */ - DeployContractTransaction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return DeployContractTransaction; -})(); - -$root.FunctionCallTransaction = (function() { - - /** - * Properties of a FunctionCallTransaction. - * @exports IFunctionCallTransaction - * @interface IFunctionCallTransaction - * @property {number|Long|null} [nonce] FunctionCallTransaction nonce - * @property {string|null} [originator] FunctionCallTransaction originator - * @property {string|null} [contractId] FunctionCallTransaction contractId - * @property {Uint8Array|null} [methodName] FunctionCallTransaction methodName - * @property {Uint8Array|null} [args] FunctionCallTransaction args - * @property {IUint128|null} [amount] FunctionCallTransaction amount - */ - - /** - * Constructs a new FunctionCallTransaction. - * @exports FunctionCallTransaction - * @classdesc Represents a FunctionCallTransaction. - * @implements IFunctionCallTransaction - * @constructor - * @param {IFunctionCallTransaction=} [properties] Properties to set - */ - function FunctionCallTransaction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + return value; } - - /** - * FunctionCallTransaction nonce. - * @member {number|Long} nonce - * @memberof FunctionCallTransaction - * @instance - */ - FunctionCallTransaction.prototype.nonce = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * FunctionCallTransaction originator. - * @member {string} originator - * @memberof FunctionCallTransaction - * @instance - */ - FunctionCallTransaction.prototype.originator = ""; - - /** - * FunctionCallTransaction contractId. - * @member {string} contractId - * @memberof FunctionCallTransaction - * @instance - */ - FunctionCallTransaction.prototype.contractId = ""; - - /** - * FunctionCallTransaction methodName. - * @member {Uint8Array} methodName - * @memberof FunctionCallTransaction - * @instance - */ - FunctionCallTransaction.prototype.methodName = $util.newBuffer([]); - - /** - * FunctionCallTransaction args. - * @member {Uint8Array} args - * @memberof FunctionCallTransaction - * @instance - */ - FunctionCallTransaction.prototype.args = $util.newBuffer([]); - - /** - * FunctionCallTransaction amount. - * @member {IUint128|null|undefined} amount - * @memberof FunctionCallTransaction - * @instance - */ - FunctionCallTransaction.prototype.amount = null; - - /** - * Creates a new FunctionCallTransaction instance using the specified properties. - * @function create - * @memberof FunctionCallTransaction - * @static - * @param {IFunctionCallTransaction=} [properties] Properties to set - * @returns {FunctionCallTransaction} FunctionCallTransaction instance - */ - FunctionCallTransaction.create = function create(properties) { - return new FunctionCallTransaction(properties); - }; - - /** - * Encodes the specified FunctionCallTransaction message. Does not implicitly {@link FunctionCallTransaction.verify|verify} messages. - * @function encode - * @memberof FunctionCallTransaction - * @static - * @param {IFunctionCallTransaction} message FunctionCallTransaction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FunctionCallTransaction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.nonce != null && message.hasOwnProperty("nonce")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.nonce); - if (message.originator != null && message.hasOwnProperty("originator")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.originator); - if (message.contractId != null && message.hasOwnProperty("contractId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.contractId); - if (message.methodName != null && message.hasOwnProperty("methodName")) - writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.methodName); - if (message.args != null && message.hasOwnProperty("args")) - writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.args); - if (message.amount != null && message.hasOwnProperty("amount")) - $root.Uint128.encode(message.amount, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FunctionCallTransaction message, length delimited. Does not implicitly {@link FunctionCallTransaction.verify|verify} messages. - * @function encodeDelimited - * @memberof FunctionCallTransaction - * @static - * @param {IFunctionCallTransaction} message FunctionCallTransaction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FunctionCallTransaction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FunctionCallTransaction message from the specified reader or buffer. - * @function decode - * @memberof FunctionCallTransaction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {FunctionCallTransaction} FunctionCallTransaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FunctionCallTransaction.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.FunctionCallTransaction(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.nonce = reader.uint64(); - break; - case 2: - message.originator = reader.string(); - break; - case 3: - message.contractId = reader.string(); - break; - case 4: - message.methodName = reader.bytes(); - break; - case 5: - message.args = reader.bytes(); - break; - case 6: - message.amount = $root.Uint128.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } + static fromString(encodedKey) { + const parts = encodedKey.split(':'); + if (parts.length === 1) { + return new PublicKey(KeyType.ED25519, serialize_1.base_decode(parts[0])); } - return message; - }; - - /** - * Decodes a FunctionCallTransaction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof FunctionCallTransaction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {FunctionCallTransaction} FunctionCallTransaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FunctionCallTransaction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FunctionCallTransaction message. - * @function verify - * @memberof FunctionCallTransaction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FunctionCallTransaction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.nonce != null && message.hasOwnProperty("nonce")) - if (!$util.isInteger(message.nonce) && !(message.nonce && $util.isInteger(message.nonce.low) && $util.isInteger(message.nonce.high))) - return "nonce: integer|Long expected"; - if (message.originator != null && message.hasOwnProperty("originator")) - if (!$util.isString(message.originator)) - return "originator: string expected"; - if (message.contractId != null && message.hasOwnProperty("contractId")) - if (!$util.isString(message.contractId)) - return "contractId: string expected"; - if (message.methodName != null && message.hasOwnProperty("methodName")) - if (!(message.methodName && typeof message.methodName.length === "number" || $util.isString(message.methodName))) - return "methodName: buffer expected"; - if (message.args != null && message.hasOwnProperty("args")) - if (!(message.args && typeof message.args.length === "number" || $util.isString(message.args))) - return "args: buffer expected"; - if (message.amount != null && message.hasOwnProperty("amount")) { - var error = $root.Uint128.verify(message.amount); - if (error) - return "amount." + error; + else if (parts.length === 2) { + return new PublicKey(str_to_key_type(parts[0]), serialize_1.base_decode(parts[1])); } - return null; - }; - - /** - * Creates a FunctionCallTransaction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof FunctionCallTransaction - * @static - * @param {Object.} object Plain object - * @returns {FunctionCallTransaction} FunctionCallTransaction - */ - FunctionCallTransaction.fromObject = function fromObject(object) { - if (object instanceof $root.FunctionCallTransaction) - return object; - var message = new $root.FunctionCallTransaction(); - if (object.nonce != null) - if ($util.Long) - (message.nonce = $util.Long.fromValue(object.nonce)).unsigned = true; - else if (typeof object.nonce === "string") - message.nonce = parseInt(object.nonce, 10); - else if (typeof object.nonce === "number") - message.nonce = object.nonce; - else if (typeof object.nonce === "object") - message.nonce = new $util.LongBits(object.nonce.low >>> 0, object.nonce.high >>> 0).toNumber(true); - if (object.originator != null) - message.originator = String(object.originator); - if (object.contractId != null) - message.contractId = String(object.contractId); - if (object.methodName != null) - if (typeof object.methodName === "string") - $util.base64.decode(object.methodName, message.methodName = $util.newBuffer($util.base64.length(object.methodName)), 0); - else if (object.methodName.length) - message.methodName = object.methodName; - if (object.args != null) - if (typeof object.args === "string") - $util.base64.decode(object.args, message.args = $util.newBuffer($util.base64.length(object.args)), 0); - else if (object.args.length) - message.args = object.args; - if (object.amount != null) { - if (typeof object.amount !== "object") - throw TypeError(".FunctionCallTransaction.amount: object expected"); - message.amount = $root.Uint128.fromObject(object.amount); + else { + throw new Error('Invlaid encoded key format, must be :'); } - return message; - }; - - /** - * Creates a plain object from a FunctionCallTransaction message. Also converts values to other types if specified. - * @function toObject - * @memberof FunctionCallTransaction - * @static - * @param {FunctionCallTransaction} message FunctionCallTransaction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FunctionCallTransaction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.nonce = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.nonce = options.longs === String ? "0" : 0; - object.originator = ""; - object.contractId = ""; - if (options.bytes === String) - object.methodName = ""; - else { - object.methodName = []; - if (options.bytes !== Array) - object.methodName = $util.newBuffer(object.methodName); - } - if (options.bytes === String) - object.args = ""; - else { - object.args = []; - if (options.bytes !== Array) - object.args = $util.newBuffer(object.args); + } + toString() { + return `${key_type_to_str(this.keyType)}:${serialize_1.base_encode(this.data)}`; + } +} +exports.PublicKey = PublicKey; +class KeyPair { + static fromRandom(curve) { + switch (curve.toUpperCase()) { + case 'ED25519': return KeyPairEd25519.fromRandom(); + default: throw new Error(`Unknown curve ${curve}`); + } + } + static fromString(encodedKey) { + const parts = encodedKey.split(':'); + if (parts.length === 1) { + return new KeyPairEd25519(parts[0]); + } + else if (parts.length === 2) { + switch (parts[0].toUpperCase()) { + case 'ED25519': return new KeyPairEd25519(parts[1]); + default: throw new Error(`Unknown curve: ${parts[0]}`); } - object.amount = null; } - if (message.nonce != null && message.hasOwnProperty("nonce")) - if (typeof message.nonce === "number") - object.nonce = options.longs === String ? String(message.nonce) : message.nonce; - else - object.nonce = options.longs === String ? $util.Long.prototype.toString.call(message.nonce) : options.longs === Number ? new $util.LongBits(message.nonce.low >>> 0, message.nonce.high >>> 0).toNumber(true) : message.nonce; - if (message.originator != null && message.hasOwnProperty("originator")) - object.originator = message.originator; - if (message.contractId != null && message.hasOwnProperty("contractId")) - object.contractId = message.contractId; - if (message.methodName != null && message.hasOwnProperty("methodName")) - object.methodName = options.bytes === String ? $util.base64.encode(message.methodName, 0, message.methodName.length) : options.bytes === Array ? Array.prototype.slice.call(message.methodName) : message.methodName; - if (message.args != null && message.hasOwnProperty("args")) - object.args = options.bytes === String ? $util.base64.encode(message.args, 0, message.args.length) : options.bytes === Array ? Array.prototype.slice.call(message.args) : message.args; - if (message.amount != null && message.hasOwnProperty("amount")) - object.amount = $root.Uint128.toObject(message.amount, options); - return object; - }; - - /** - * Converts this FunctionCallTransaction to JSON. - * @function toJSON - * @memberof FunctionCallTransaction - * @instance - * @returns {Object.} JSON object - */ - FunctionCallTransaction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return FunctionCallTransaction; -})(); - -$root.SendMoneyTransaction = (function() { - + else { + throw new Error('Invalid encoded key format, must be :'); + } + } +} +exports.KeyPair = KeyPair; +/** + * This class provides key pair functionality for Ed25519 curve: + * generating key pairs, encoding key pairs, signing and verifying. + */ +class KeyPairEd25519 extends KeyPair { /** - * Properties of a SendMoneyTransaction. - * @exports ISendMoneyTransaction - * @interface ISendMoneyTransaction - * @property {number|Long|null} [nonce] SendMoneyTransaction nonce - * @property {string|null} [originator] SendMoneyTransaction originator - * @property {string|null} [receiver] SendMoneyTransaction receiver - * @property {IUint128|null} [amount] SendMoneyTransaction amount + * Construct an instance of key pair given a secret key. + * It's generally assumed that these are encoded in base58. + * @param {string} secretKey */ - + constructor(secretKey) { + super(); + const keyPair = tweetnacl_1.default.sign.keyPair.fromSecretKey(serialize_1.base_decode(secretKey)); + this.publicKey = new PublicKey(KeyType.ED25519, keyPair.publicKey); + this.secretKey = secretKey; + } /** - * Constructs a new SendMoneyTransaction. - * @exports SendMoneyTransaction - * @classdesc Represents a SendMoneyTransaction. - * @implements ISendMoneyTransaction - * @constructor - * @param {ISendMoneyTransaction=} [properties] Properties to set + * Generate a new random keypair. + * @example + * const keyRandom = KeyPair.fromRandom(); + * keyRandom.publicKey + * // returns [PUBLIC_KEY] + * + * keyRandom.secretKey + * // returns [SECRET_KEY] */ - function SendMoneyTransaction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + static fromRandom() { + const newKeyPair = tweetnacl_1.default.sign.keyPair(); + return new KeyPairEd25519(serialize_1.base_encode(newKeyPair.secretKey)); + } + sign(message) { + const signature = tweetnacl_1.default.sign.detached(message, serialize_1.base_decode(this.secretKey)); + return { signature, publicKey: this.publicKey }; + } + verify(message, signature) { + return tweetnacl_1.default.sign.detached.verify(message, signature, this.publicKey.data); + } + toString() { + return `ed25519:${this.secretKey}`; + } + getPublicKey() { + return this.publicKey; } +} +exports.KeyPairEd25519 = KeyPairEd25519; - /** - * SendMoneyTransaction nonce. - * @member {number|Long} nonce - * @memberof SendMoneyTransaction - * @instance - */ - SendMoneyTransaction.prototype.nonce = $util.Long ? $util.Long.fromBits(0,0,true) : 0; +},{"./serialize":22,"tweetnacl":61}],21:[function(require,module,exports){ +'use strict'; +Object.defineProperty(exports, "__esModule", { value: true }); - /** - * SendMoneyTransaction originator. - * @member {string} originator - * @memberof SendMoneyTransaction - * @instance - */ - SendMoneyTransaction.prototype.originator = ""; - - /** - * SendMoneyTransaction receiver. - * @member {string} receiver - * @memberof SendMoneyTransaction - * @instance - */ - SendMoneyTransaction.prototype.receiver = ""; - - /** - * SendMoneyTransaction amount. - * @member {IUint128|null|undefined} amount - * @memberof SendMoneyTransaction - * @instance - */ - SendMoneyTransaction.prototype.amount = null; - - /** - * Creates a new SendMoneyTransaction instance using the specified properties. - * @function create - * @memberof SendMoneyTransaction - * @static - * @param {ISendMoneyTransaction=} [properties] Properties to set - * @returns {SendMoneyTransaction} SendMoneyTransaction instance - */ - SendMoneyTransaction.create = function create(properties) { - return new SendMoneyTransaction(properties); - }; - - /** - * Encodes the specified SendMoneyTransaction message. Does not implicitly {@link SendMoneyTransaction.verify|verify} messages. - * @function encode - * @memberof SendMoneyTransaction - * @static - * @param {ISendMoneyTransaction} message SendMoneyTransaction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SendMoneyTransaction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.nonce != null && message.hasOwnProperty("nonce")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.nonce); - if (message.originator != null && message.hasOwnProperty("originator")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.originator); - if (message.receiver != null && message.hasOwnProperty("receiver")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.receiver); - if (message.amount != null && message.hasOwnProperty("amount")) - $root.Uint128.encode(message.amount, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SendMoneyTransaction message, length delimited. Does not implicitly {@link SendMoneyTransaction.verify|verify} messages. - * @function encodeDelimited - * @memberof SendMoneyTransaction - * @static - * @param {ISendMoneyTransaction} message SendMoneyTransaction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SendMoneyTransaction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SendMoneyTransaction message from the specified reader or buffer. - * @function decode - * @memberof SendMoneyTransaction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {SendMoneyTransaction} SendMoneyTransaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SendMoneyTransaction.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.SendMoneyTransaction(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.nonce = reader.uint64(); - break; - case 2: - message.originator = reader.string(); - break; - case 3: - message.receiver = reader.string(); - break; - case 4: - message.amount = $root.Uint128.decode(reader, reader.uint32()); +},{}],22:[function(require,module,exports){ +(function (Buffer){ +'use strict'; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const bs58_1 = __importDefault(require("bs58")); +const bn_js_1 = __importDefault(require("bn.js")); +function base_encode(value) { + if (typeof (value) === 'string') { + value = Buffer.from(value, 'utf8'); + } + return bs58_1.default.encode(Buffer.from(value)); +} +exports.base_encode = base_encode; +function base_decode(value) { + return bs58_1.default.decode(value); +} +exports.base_decode = base_decode; +const INITIAL_LENGTH = 1024; +/// Binary encoder. +class BinaryWriter { + constructor() { + this.buf = Buffer.alloc(INITIAL_LENGTH); + this.length = 0; + } + maybe_resize() { + if (this.buf.length < 16 + this.length) { + this.buf = Buffer.concat([this.buf, Buffer.alloc(INITIAL_LENGTH)]); + } + } + write_u8(value) { + this.maybe_resize(); + this.buf.writeUInt8(value, this.length); + this.length += 1; + } + write_u32(value) { + this.maybe_resize(); + this.buf.writeUInt32LE(value, this.length); + this.length += 4; + } + write_u64(value) { + this.maybe_resize(); + this.write_buffer(Buffer.from(new bn_js_1.default(value).toArray('le', 8))); + } + write_u128(value) { + this.maybe_resize(); + this.write_buffer(Buffer.from(new bn_js_1.default(value).toArray('le', 16))); + } + write_buffer(buffer) { + // Buffer.from is needed as this.buf.subarray can return plain Uint8Array in browser + this.buf = Buffer.concat([Buffer.from(this.buf.subarray(0, this.length)), buffer, Buffer.alloc(INITIAL_LENGTH)]); + this.length += buffer.length; + } + write_string(str) { + this.maybe_resize(); + const b = Buffer.from(str, 'utf8'); + this.write_u32(b.length); + this.write_buffer(b); + } + write_fixed_array(array) { + this.write_buffer(Buffer.from(array)); + } + write_array(array, fn) { + this.maybe_resize(); + this.write_u32(array.length); + for (const elem of array) { + this.maybe_resize(); + fn(elem); + } + } + toArray() { + return this.buf.subarray(0, this.length); + } +} +exports.BinaryWriter = BinaryWriter; +class BinaryReader { + constructor(buf) { + this.buf = buf; + this.offset = 0; + } + read_u8() { + const value = this.buf.readUInt8(this.offset); + this.offset += 1; + return value; + } + read_u32() { + const value = this.buf.readUInt32LE(this.offset); + this.offset += 4; + return value; + } + read_u64() { + const buf = this.read_buffer(8); + buf.reverse(); + return new bn_js_1.default(`${buf.toString('hex')}`, 16); + } + read_u128() { + const buf = this.read_buffer(16); + return new bn_js_1.default(buf); + } + read_buffer(len) { + const result = this.buf.slice(this.offset, this.offset + len); + this.offset += len; + return result; + } + read_string() { + const len = this.read_u32(); + return this.read_buffer(len).toString('utf8'); + } + read_fixed_array(len) { + return new Uint8Array(this.read_buffer(len)); + } + read_array(fn) { + const len = this.read_u32(); + const result = Array(); + for (let i = 0; i < len; ++i) { + result.push(fn()); + } + return result; + } +} +exports.BinaryReader = BinaryReader; +function serializeField(schema, value, fieldType, writer) { + if (typeof fieldType === 'string') { + writer[`write_${fieldType}`](value); + } + else if (fieldType instanceof Array) { + if (typeof fieldType[0] === 'number') { + writer.write_fixed_array(value); + } + else { + writer.write_array(value, (item) => { serializeField(schema, item, fieldType[0], writer); }); + } + } + else if (fieldType.kind !== undefined) { + switch (fieldType.kind) { + case 'option': { + if (value === null) { + writer.write_u8(0); + } + else { + writer.write_u8(1); + serializeField(schema, value, fieldType.type, writer); + } break; - default: - reader.skipType(tag & 7); + } + default: throw new Error(`FieldType ${fieldType} unrecognized`); + } + } + else { + serializeStruct(schema, value, writer); + } +} +function serializeStruct(schema, obj, writer) { + const structSchema = schema.get(obj.constructor); + if (!structSchema) { + throw new Error(`Class ${obj.constructor.name} is missing in schema`); + } + if (structSchema.kind === 'struct') { + structSchema.fields.map(([fieldName, fieldType]) => { + serializeField(schema, obj[fieldName], fieldType, writer); + }); + } + else if (structSchema.kind === 'enum') { + const name = obj[structSchema.field]; + for (let idx = 0; idx < structSchema.values.length; ++idx) { + const [fieldName, fieldType] = structSchema.values[idx]; + if (fieldName === name) { + writer.write_u8(idx); + serializeField(schema, obj[fieldName], fieldType, writer); break; } } - return message; - }; + } + else { + throw new Error(`Unexpected schema kind: ${structSchema.kind} for ${obj.constructor.name}`); + } +} +/// Serialize given object using schema of the form: +/// { class_name -> [ [field_name, field_type], .. ], .. } +function serialize(schema, obj) { + const writer = new BinaryWriter(); + serializeStruct(schema, obj, writer); + return writer.toArray(); +} +exports.serialize = serialize; +function deserializeField(schema, fieldType, reader) { + if (typeof fieldType === 'string') { + return reader[`read_${fieldType}`](); + } + else if (fieldType instanceof Array) { + if (typeof fieldType[0] === 'number') { + return reader.read_fixed_array(fieldType[0]); + } + else { + return reader.read_array(() => deserializeField(schema, fieldType[0], reader)); + } + } + else { + return deserializeStruct(schema, fieldType, reader); + } +} +function deserializeStruct(schema, classType, reader) { + const fields = schema.get(classType).fields.map(([fieldName, fieldType]) => { + return deserializeField(schema, fieldType, reader); + }); + return new classType(...fields); +} +/// Deserializes object from bytes using schema. +function deserialize(schema, classType, buffer) { + const reader = new BinaryReader(buffer); + return deserializeStruct(schema, classType, reader); +} +exports.deserialize = deserialize; + +}).call(this,require("buffer").Buffer) +},{"bn.js":27,"bs58":30,"buffer":31}],23:[function(require,module,exports){ +'use strict'; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const http_errors_1 = __importDefault(require("http-errors")); +const fetch = (typeof window === 'undefined' || window.name === 'nodejs') ? require('node-fetch') : window.fetch; +async function fetchJson(connection, json) { + let url = null; + if (typeof (connection) === 'string') { + url = connection; + } + else { + url = connection.url; + } + const response = await fetch(url, { + method: json ? 'POST' : 'GET', + body: json ? json : undefined, + headers: { 'Content-type': 'application/json; charset=utf-8' } + }); + if (!response.ok) { + throw http_errors_1.default(response.status, await response.text()); + } + return await response.json(); +} +exports.fetchJson = fetchJson; +},{"http-errors":47,"node-fetch":29}],24:[function(require,module,exports){ +'use strict'; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("./utils"); +const LOGIN_WALLET_URL_SUFFIX = '/login/'; +const LOCAL_STORAGE_KEY_SUFFIX = '_wallet_auth_key'; +const PENDING_ACCESS_KEY_PREFIX = 'pending_key'; // browser storage key for a pending access key (i.e. key has been generated but we are not sure it was added yet) +class WalletAccount { + constructor(near, appKeyPrefix) { + this._networkId = near.config.networkId; + this._walletBaseUrl = near.config.walletUrl; + appKeyPrefix = appKeyPrefix || near.config.contractName || 'default'; + this._authDataKey = appKeyPrefix + LOCAL_STORAGE_KEY_SUFFIX; + this._keyStore = near.connection.signer.keyStore; + this._authData = JSON.parse(window.localStorage.getItem(this._authDataKey) || '{}'); + if (!this.isSignedIn()) { + this._completeSignInWithAccessKey(); + } + } /** - * Decodes a SendMoneyTransaction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof SendMoneyTransaction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {SendMoneyTransaction} SendMoneyTransaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Returns true, if this WalletAccount is authorized with the wallet. + * @example + * walletAccount.isSignedIn(); */ - SendMoneyTransaction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - + isSignedIn() { + return !!this._authData.accountId; + } /** - * Verifies a SendMoneyTransaction message. - * @function verify - * @memberof SendMoneyTransaction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Returns authorized Account ID. + * @example + * walletAccount.getAccountId(); */ - SendMoneyTransaction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.nonce != null && message.hasOwnProperty("nonce")) - if (!$util.isInteger(message.nonce) && !(message.nonce && $util.isInteger(message.nonce.low) && $util.isInteger(message.nonce.high))) - return "nonce: integer|Long expected"; - if (message.originator != null && message.hasOwnProperty("originator")) - if (!$util.isString(message.originator)) - return "originator: string expected"; - if (message.receiver != null && message.hasOwnProperty("receiver")) - if (!$util.isString(message.receiver)) - return "receiver: string expected"; - if (message.amount != null && message.hasOwnProperty("amount")) { - var error = $root.Uint128.verify(message.amount); - if (error) - return "amount." + error; - } - return null; - }; - + getAccountId() { + return this._authData.accountId || ''; + } /** - * Creates a SendMoneyTransaction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof SendMoneyTransaction - * @static - * @param {Object.} object Plain object - * @returns {SendMoneyTransaction} SendMoneyTransaction + * Redirects current page to the wallet authentication page. + * @param {string} contractId contract ID of the application + * @param {string} title name of the application + * @param {string} successUrl url to redirect on success + * @param {string} failureUrl url to redirect on failure + * @example + * walletAccount.requestSignIn( + * myContractId, + * title, + * onSuccessHref, + * onFailureHref); */ - SendMoneyTransaction.fromObject = function fromObject(object) { - if (object instanceof $root.SendMoneyTransaction) - return object; - var message = new $root.SendMoneyTransaction(); - if (object.nonce != null) - if ($util.Long) - (message.nonce = $util.Long.fromValue(object.nonce)).unsigned = true; - else if (typeof object.nonce === "string") - message.nonce = parseInt(object.nonce, 10); - else if (typeof object.nonce === "number") - message.nonce = object.nonce; - else if (typeof object.nonce === "object") - message.nonce = new $util.LongBits(object.nonce.low >>> 0, object.nonce.high >>> 0).toNumber(true); - if (object.originator != null) - message.originator = String(object.originator); - if (object.receiver != null) - message.receiver = String(object.receiver); - if (object.amount != null) { - if (typeof object.amount !== "object") - throw TypeError(".SendMoneyTransaction.amount: object expected"); - message.amount = $root.Uint128.fromObject(object.amount); + async requestSignIn(contractId, title, successUrl, failureUrl) { + if (this.getAccountId() || await this._keyStore.getKey(this._networkId, this.getAccountId())) { + return Promise.resolve(); } - return message; - }; - + const currentUrl = new URL(window.location.href); + const newUrl = new URL(this._walletBaseUrl + LOGIN_WALLET_URL_SUFFIX); + newUrl.searchParams.set('title', title); + newUrl.searchParams.set('contract_id', contractId); + newUrl.searchParams.set('success_url', successUrl || currentUrl.href); + newUrl.searchParams.set('failure_url', failureUrl || currentUrl.href); + newUrl.searchParams.set('app_url', currentUrl.origin); + const accessKey = utils_1.KeyPair.fromRandom('ed25519'); + newUrl.searchParams.set('public_key', accessKey.getPublicKey().toString()); + await this._keyStore.setKey(this._networkId, PENDING_ACCESS_KEY_PREFIX + accessKey.getPublicKey(), accessKey); + window.location.assign(newUrl.toString()); + } /** - * Creates a plain object from a SendMoneyTransaction message. Also converts values to other types if specified. - * @function toObject - * @memberof SendMoneyTransaction - * @static - * @param {SendMoneyTransaction} message SendMoneyTransaction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Complete sign in for a given account id and public key. To be invoked by the app when getting a callback from the wallet. */ - SendMoneyTransaction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.nonce = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.nonce = options.longs === String ? "0" : 0; - object.originator = ""; - object.receiver = ""; - object.amount = null; + async _completeSignInWithAccessKey() { + const currentUrl = new URL(window.location.href); + const publicKey = currentUrl.searchParams.get('public_key') || ''; + const accountId = currentUrl.searchParams.get('account_id') || ''; + if (accountId && publicKey) { + this._authData = { + accountId + }; + window.localStorage.setItem(this._authDataKey, JSON.stringify(this._authData)); + await this._moveKeyFromTempToPermanent(accountId, publicKey); } - if (message.nonce != null && message.hasOwnProperty("nonce")) - if (typeof message.nonce === "number") - object.nonce = options.longs === String ? String(message.nonce) : message.nonce; - else - object.nonce = options.longs === String ? $util.Long.prototype.toString.call(message.nonce) : options.longs === Number ? new $util.LongBits(message.nonce.low >>> 0, message.nonce.high >>> 0).toNumber(true) : message.nonce; - if (message.originator != null && message.hasOwnProperty("originator")) - object.originator = message.originator; - if (message.receiver != null && message.hasOwnProperty("receiver")) - object.receiver = message.receiver; - if (message.amount != null && message.hasOwnProperty("amount")) - object.amount = $root.Uint128.toObject(message.amount, options); - return object; - }; - + } + async _moveKeyFromTempToPermanent(accountId, publicKey) { + const keyPair = await this._keyStore.getKey(this._networkId, PENDING_ACCESS_KEY_PREFIX + publicKey); + await this._keyStore.setKey(this._networkId, accountId, keyPair); + await this._keyStore.removeKey(this._networkId, PENDING_ACCESS_KEY_PREFIX + publicKey); + } /** - * Converts this SendMoneyTransaction to JSON. - * @function toJSON - * @memberof SendMoneyTransaction - * @instance - * @returns {Object.} JSON object + * Sign out from the current account + * @example + * walletAccount.signOut(); */ - SendMoneyTransaction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return SendMoneyTransaction; -})(); + signOut() { + this._authData = {}; + window.localStorage.removeItem(this._authDataKey); + } +} +exports.WalletAccount = WalletAccount; -$root.StakeTransaction = (function() { +},{"./utils":19}],25:[function(require,module,exports){ +// base-x encoding / decoding +// Copyright (c) 2018 base-x contributors +// Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp) +// Distributed under the MIT software license, see the accompanying +// file LICENSE or http://www.opensource.org/licenses/mit-license.php. - /** - * Properties of a StakeTransaction. - * @exports IStakeTransaction - * @interface IStakeTransaction - * @property {number|Long|null} [nonce] StakeTransaction nonce - * @property {string|null} [originator] StakeTransaction originator - * @property {IUint128|null} [amount] StakeTransaction amount - * @property {string|null} [publicKey] StakeTransaction publicKey - * @property {string|null} [blsPublicKey] StakeTransaction blsPublicKey - */ +const Buffer = require('safe-buffer').Buffer - /** - * Constructs a new StakeTransaction. - * @exports StakeTransaction - * @classdesc Represents a StakeTransaction. - * @implements IStakeTransaction - * @constructor - * @param {IStakeTransaction=} [properties] Properties to set - */ - function StakeTransaction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } +module.exports = function base (ALPHABET) { + if (ALPHABET.length >= 255) throw new TypeError('Alphabet too long') - /** - * StakeTransaction nonce. - * @member {number|Long} nonce - * @memberof StakeTransaction - * @instance - */ - StakeTransaction.prototype.nonce = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + const BASE_MAP = new Uint8Array(256) + BASE_MAP.fill(255) - /** - * StakeTransaction originator. - * @member {string} originator - * @memberof StakeTransaction - * @instance - */ - StakeTransaction.prototype.originator = ""; + for (let i = 0; i < ALPHABET.length; i++) { + const x = ALPHABET.charAt(i) + const xc = x.charCodeAt(0) - /** - * StakeTransaction amount. - * @member {IUint128|null|undefined} amount - * @memberof StakeTransaction - * @instance - */ - StakeTransaction.prototype.amount = null; + if (BASE_MAP[xc] !== 255) throw new TypeError(x + ' is ambiguous') + BASE_MAP[xc] = i + } - /** - * StakeTransaction publicKey. - * @member {string} publicKey - * @memberof StakeTransaction - * @instance - */ - StakeTransaction.prototype.publicKey = ""; + const BASE = ALPHABET.length + const LEADER = ALPHABET.charAt(0) + const FACTOR = Math.log(BASE) / Math.log(256) // log(BASE) / log(256), rounded up + const iFACTOR = Math.log(256) / Math.log(BASE) // log(256) / log(BASE), rounded up - /** - * StakeTransaction blsPublicKey. - * @member {string} blsPublicKey - * @memberof StakeTransaction - * @instance - */ - StakeTransaction.prototype.blsPublicKey = ""; + function encode (source) { + if (!Buffer.isBuffer(source)) throw new TypeError('Expected Buffer') + if (source.length === 0) return '' - /** - * Creates a new StakeTransaction instance using the specified properties. - * @function create - * @memberof StakeTransaction - * @static - * @param {IStakeTransaction=} [properties] Properties to set - * @returns {StakeTransaction} StakeTransaction instance - */ - StakeTransaction.create = function create(properties) { - return new StakeTransaction(properties); - }; + // Skip & count leading zeroes. + let zeroes = 0 + let length = 0 + let pbegin = 0 + const pend = source.length - /** - * Encodes the specified StakeTransaction message. Does not implicitly {@link StakeTransaction.verify|verify} messages. - * @function encode - * @memberof StakeTransaction - * @static - * @param {IStakeTransaction} message StakeTransaction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StakeTransaction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.nonce != null && message.hasOwnProperty("nonce")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.nonce); - if (message.originator != null && message.hasOwnProperty("originator")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.originator); - if (message.amount != null && message.hasOwnProperty("amount")) - $root.Uint128.encode(message.amount, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.publicKey != null && message.hasOwnProperty("publicKey")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.publicKey); - if (message.blsPublicKey != null && message.hasOwnProperty("blsPublicKey")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.blsPublicKey); - return writer; - }; + while (pbegin !== pend && source[pbegin] === 0) { + pbegin++ + zeroes++ + } - /** - * Encodes the specified StakeTransaction message, length delimited. Does not implicitly {@link StakeTransaction.verify|verify} messages. - * @function encodeDelimited - * @memberof StakeTransaction - * @static - * @param {IStakeTransaction} message StakeTransaction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StakeTransaction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + // Allocate enough space in big-endian base58 representation. + const size = ((pend - pbegin) * iFACTOR + 1) >>> 0 + const b58 = new Uint8Array(size) - /** - * Decodes a StakeTransaction message from the specified reader or buffer. - * @function decode - * @memberof StakeTransaction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {StakeTransaction} StakeTransaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StakeTransaction.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.StakeTransaction(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.nonce = reader.uint64(); - break; - case 2: - message.originator = reader.string(); - break; - case 3: - message.amount = $root.Uint128.decode(reader, reader.uint32()); - break; - case 4: - message.publicKey = reader.string(); - break; - case 5: - message.blsPublicKey = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + // Process the bytes. + while (pbegin !== pend) { + let carry = source[pbegin] - /** - * Decodes a StakeTransaction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof StakeTransaction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {StakeTransaction} StakeTransaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StakeTransaction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + // Apply "b58 = b58 * 256 + ch". + let i = 0 + for (let it = size - 1; (carry !== 0 || i < length) && (it !== -1); it--, i++) { + carry += (256 * b58[it]) >>> 0 + b58[it] = (carry % BASE) >>> 0 + carry = (carry / BASE) >>> 0 + } - /** - * Verifies a StakeTransaction message. - * @function verify - * @memberof StakeTransaction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StakeTransaction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.nonce != null && message.hasOwnProperty("nonce")) - if (!$util.isInteger(message.nonce) && !(message.nonce && $util.isInteger(message.nonce.low) && $util.isInteger(message.nonce.high))) - return "nonce: integer|Long expected"; - if (message.originator != null && message.hasOwnProperty("originator")) - if (!$util.isString(message.originator)) - return "originator: string expected"; - if (message.amount != null && message.hasOwnProperty("amount")) { - var error = $root.Uint128.verify(message.amount); - if (error) - return "amount." + error; - } - if (message.publicKey != null && message.hasOwnProperty("publicKey")) - if (!$util.isString(message.publicKey)) - return "publicKey: string expected"; - if (message.blsPublicKey != null && message.hasOwnProperty("blsPublicKey")) - if (!$util.isString(message.blsPublicKey)) - return "blsPublicKey: string expected"; - return null; - }; + if (carry !== 0) throw new Error('Non-zero carry') + length = i + pbegin++ + } - /** - * Creates a StakeTransaction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof StakeTransaction - * @static - * @param {Object.} object Plain object - * @returns {StakeTransaction} StakeTransaction - */ - StakeTransaction.fromObject = function fromObject(object) { - if (object instanceof $root.StakeTransaction) - return object; - var message = new $root.StakeTransaction(); - if (object.nonce != null) - if ($util.Long) - (message.nonce = $util.Long.fromValue(object.nonce)).unsigned = true; - else if (typeof object.nonce === "string") - message.nonce = parseInt(object.nonce, 10); - else if (typeof object.nonce === "number") - message.nonce = object.nonce; - else if (typeof object.nonce === "object") - message.nonce = new $util.LongBits(object.nonce.low >>> 0, object.nonce.high >>> 0).toNumber(true); - if (object.originator != null) - message.originator = String(object.originator); - if (object.amount != null) { - if (typeof object.amount !== "object") - throw TypeError(".StakeTransaction.amount: object expected"); - message.amount = $root.Uint128.fromObject(object.amount); - } - if (object.publicKey != null) - message.publicKey = String(object.publicKey); - if (object.blsPublicKey != null) - message.blsPublicKey = String(object.blsPublicKey); - return message; - }; + // Skip leading zeroes in base58 result. + let it = size - length + while (it !== size && b58[it] === 0) { + it++ + } - /** - * Creates a plain object from a StakeTransaction message. Also converts values to other types if specified. - * @function toObject - * @memberof StakeTransaction - * @static - * @param {StakeTransaction} message StakeTransaction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StakeTransaction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.nonce = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.nonce = options.longs === String ? "0" : 0; - object.originator = ""; - object.amount = null; - object.publicKey = ""; - object.blsPublicKey = ""; - } - if (message.nonce != null && message.hasOwnProperty("nonce")) - if (typeof message.nonce === "number") - object.nonce = options.longs === String ? String(message.nonce) : message.nonce; - else - object.nonce = options.longs === String ? $util.Long.prototype.toString.call(message.nonce) : options.longs === Number ? new $util.LongBits(message.nonce.low >>> 0, message.nonce.high >>> 0).toNumber(true) : message.nonce; - if (message.originator != null && message.hasOwnProperty("originator")) - object.originator = message.originator; - if (message.amount != null && message.hasOwnProperty("amount")) - object.amount = $root.Uint128.toObject(message.amount, options); - if (message.publicKey != null && message.hasOwnProperty("publicKey")) - object.publicKey = message.publicKey; - if (message.blsPublicKey != null && message.hasOwnProperty("blsPublicKey")) - object.blsPublicKey = message.blsPublicKey; - return object; - }; + // Translate the result into a string. + let str = LEADER.repeat(zeroes) + for (; it < size; ++it) str += ALPHABET.charAt(b58[it]) - /** - * Converts this StakeTransaction to JSON. - * @function toJSON - * @memberof StakeTransaction - * @instance - * @returns {Object.} JSON object - */ - StakeTransaction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return str + } - return StakeTransaction; -})(); + function decodeUnsafe (source) { + if (typeof source !== 'string') throw new TypeError('Expected String') + if (source.length === 0) return Buffer.alloc(0) -$root.SwapKeyTransaction = (function() { + let psz = 0 - /** - * Properties of a SwapKeyTransaction. - * @exports ISwapKeyTransaction - * @interface ISwapKeyTransaction - * @property {number|Long|null} [nonce] SwapKeyTransaction nonce - * @property {string|null} [originator] SwapKeyTransaction originator - * @property {Uint8Array|null} [curKey] SwapKeyTransaction curKey - * @property {Uint8Array|null} [newKey] SwapKeyTransaction newKey - */ + // Skip leading spaces. + if (source[psz] === ' ') return - /** - * Constructs a new SwapKeyTransaction. - * @exports SwapKeyTransaction - * @classdesc Represents a SwapKeyTransaction. - * @implements ISwapKeyTransaction - * @constructor - * @param {ISwapKeyTransaction=} [properties] Properties to set - */ - function SwapKeyTransaction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + // Skip and count leading '1's. + let zeroes = 0 + let length = 0 + while (source[psz] === LEADER) { + zeroes++ + psz++ } - /** - * SwapKeyTransaction nonce. - * @member {number|Long} nonce - * @memberof SwapKeyTransaction - * @instance - */ - SwapKeyTransaction.prototype.nonce = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * SwapKeyTransaction originator. - * @member {string} originator - * @memberof SwapKeyTransaction - * @instance - */ - SwapKeyTransaction.prototype.originator = ""; + // Allocate enough space in big-endian base256 representation. + const size = (((source.length - psz) * FACTOR) + 1) >>> 0 // log(58) / log(256), rounded up. + const b256 = new Uint8Array(size) - /** - * SwapKeyTransaction curKey. - * @member {Uint8Array} curKey - * @memberof SwapKeyTransaction - * @instance - */ - SwapKeyTransaction.prototype.curKey = $util.newBuffer([]); + // Process the characters. + while (source[psz]) { + // Decode character + let carry = BASE_MAP[source.charCodeAt(psz)] - /** - * SwapKeyTransaction newKey. - * @member {Uint8Array} newKey - * @memberof SwapKeyTransaction - * @instance - */ - SwapKeyTransaction.prototype.newKey = $util.newBuffer([]); + // Invalid character + if (carry === 255) return - /** - * Creates a new SwapKeyTransaction instance using the specified properties. - * @function create - * @memberof SwapKeyTransaction - * @static - * @param {ISwapKeyTransaction=} [properties] Properties to set - * @returns {SwapKeyTransaction} SwapKeyTransaction instance - */ - SwapKeyTransaction.create = function create(properties) { - return new SwapKeyTransaction(properties); - }; + let i = 0 + for (let it = size - 1; (carry !== 0 || i < length) && (it !== -1); it--, i++) { + carry += (BASE * b256[it]) >>> 0 + b256[it] = (carry % 256) >>> 0 + carry = (carry / 256) >>> 0 + } - /** - * Encodes the specified SwapKeyTransaction message. Does not implicitly {@link SwapKeyTransaction.verify|verify} messages. - * @function encode - * @memberof SwapKeyTransaction - * @static - * @param {ISwapKeyTransaction} message SwapKeyTransaction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SwapKeyTransaction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.nonce != null && message.hasOwnProperty("nonce")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.nonce); - if (message.originator != null && message.hasOwnProperty("originator")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.originator); - if (message.curKey != null && message.hasOwnProperty("curKey")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.curKey); - if (message.newKey != null && message.hasOwnProperty("newKey")) - writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.newKey); - return writer; - }; + if (carry !== 0) throw new Error('Non-zero carry') + length = i + psz++ + } - /** - * Encodes the specified SwapKeyTransaction message, length delimited. Does not implicitly {@link SwapKeyTransaction.verify|verify} messages. - * @function encodeDelimited - * @memberof SwapKeyTransaction - * @static - * @param {ISwapKeyTransaction} message SwapKeyTransaction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SwapKeyTransaction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + // Skip trailing spaces. + if (source[psz] === ' ') return - /** - * Decodes a SwapKeyTransaction message from the specified reader or buffer. - * @function decode - * @memberof SwapKeyTransaction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {SwapKeyTransaction} SwapKeyTransaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SwapKeyTransaction.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.SwapKeyTransaction(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.nonce = reader.uint64(); - break; - case 2: - message.originator = reader.string(); - break; - case 3: - message.curKey = reader.bytes(); - break; - case 4: - message.newKey = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + // Skip leading zeroes in b256. + let it = size - length + while (it !== size && b256[it] === 0) { + it++ + } - /** - * Decodes a SwapKeyTransaction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof SwapKeyTransaction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {SwapKeyTransaction} SwapKeyTransaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SwapKeyTransaction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + const vch = Buffer.allocUnsafe(zeroes + (size - it)) + vch.fill(0x00, 0, zeroes) - /** - * Verifies a SwapKeyTransaction message. - * @function verify - * @memberof SwapKeyTransaction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SwapKeyTransaction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.nonce != null && message.hasOwnProperty("nonce")) - if (!$util.isInteger(message.nonce) && !(message.nonce && $util.isInteger(message.nonce.low) && $util.isInteger(message.nonce.high))) - return "nonce: integer|Long expected"; - if (message.originator != null && message.hasOwnProperty("originator")) - if (!$util.isString(message.originator)) - return "originator: string expected"; - if (message.curKey != null && message.hasOwnProperty("curKey")) - if (!(message.curKey && typeof message.curKey.length === "number" || $util.isString(message.curKey))) - return "curKey: buffer expected"; - if (message.newKey != null && message.hasOwnProperty("newKey")) - if (!(message.newKey && typeof message.newKey.length === "number" || $util.isString(message.newKey))) - return "newKey: buffer expected"; - return null; - }; + let j = zeroes + while (it !== size) { + vch[j++] = b256[it++] + } - /** - * Creates a SwapKeyTransaction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof SwapKeyTransaction - * @static - * @param {Object.} object Plain object - * @returns {SwapKeyTransaction} SwapKeyTransaction - */ - SwapKeyTransaction.fromObject = function fromObject(object) { - if (object instanceof $root.SwapKeyTransaction) - return object; - var message = new $root.SwapKeyTransaction(); - if (object.nonce != null) - if ($util.Long) - (message.nonce = $util.Long.fromValue(object.nonce)).unsigned = true; - else if (typeof object.nonce === "string") - message.nonce = parseInt(object.nonce, 10); - else if (typeof object.nonce === "number") - message.nonce = object.nonce; - else if (typeof object.nonce === "object") - message.nonce = new $util.LongBits(object.nonce.low >>> 0, object.nonce.high >>> 0).toNumber(true); - if (object.originator != null) - message.originator = String(object.originator); - if (object.curKey != null) - if (typeof object.curKey === "string") - $util.base64.decode(object.curKey, message.curKey = $util.newBuffer($util.base64.length(object.curKey)), 0); - else if (object.curKey.length) - message.curKey = object.curKey; - if (object.newKey != null) - if (typeof object.newKey === "string") - $util.base64.decode(object.newKey, message.newKey = $util.newBuffer($util.base64.length(object.newKey)), 0); - else if (object.newKey.length) - message.newKey = object.newKey; - return message; - }; + return vch + } - /** - * Creates a plain object from a SwapKeyTransaction message. Also converts values to other types if specified. - * @function toObject - * @memberof SwapKeyTransaction - * @static - * @param {SwapKeyTransaction} message SwapKeyTransaction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SwapKeyTransaction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.nonce = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.nonce = options.longs === String ? "0" : 0; - object.originator = ""; - if (options.bytes === String) - object.curKey = ""; - else { - object.curKey = []; - if (options.bytes !== Array) - object.curKey = $util.newBuffer(object.curKey); - } - if (options.bytes === String) - object.newKey = ""; - else { - object.newKey = []; - if (options.bytes !== Array) - object.newKey = $util.newBuffer(object.newKey); - } - } - if (message.nonce != null && message.hasOwnProperty("nonce")) - if (typeof message.nonce === "number") - object.nonce = options.longs === String ? String(message.nonce) : message.nonce; - else - object.nonce = options.longs === String ? $util.Long.prototype.toString.call(message.nonce) : options.longs === Number ? new $util.LongBits(message.nonce.low >>> 0, message.nonce.high >>> 0).toNumber(true) : message.nonce; - if (message.originator != null && message.hasOwnProperty("originator")) - object.originator = message.originator; - if (message.curKey != null && message.hasOwnProperty("curKey")) - object.curKey = options.bytes === String ? $util.base64.encode(message.curKey, 0, message.curKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.curKey) : message.curKey; - if (message.newKey != null && message.hasOwnProperty("newKey")) - object.newKey = options.bytes === String ? $util.base64.encode(message.newKey, 0, message.newKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.newKey) : message.newKey; - return object; - }; + function decode (string) { + const buffer = decodeUnsafe(string) + if (buffer) return buffer - /** - * Converts this SwapKeyTransaction to JSON. - * @function toJSON - * @memberof SwapKeyTransaction - * @instance - * @returns {Object.} JSON object - */ - SwapKeyTransaction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + throw new Error('Non-base' + BASE + ' character') + } - return SwapKeyTransaction; -})(); + return { + encode: encode, + decodeUnsafe: decodeUnsafe, + decode: decode + } +} -$root.AddKeyTransaction = (function() { +},{"safe-buffer":56}],26:[function(require,module,exports){ +'use strict' - /** - * Properties of an AddKeyTransaction. - * @exports IAddKeyTransaction - * @interface IAddKeyTransaction - * @property {number|Long|null} [nonce] AddKeyTransaction nonce - * @property {string|null} [originator] AddKeyTransaction originator - * @property {Uint8Array|null} [newKey] AddKeyTransaction newKey - * @property {IAccessKey|null} [accessKey] AddKeyTransaction accessKey - */ +exports.byteLength = byteLength +exports.toByteArray = toByteArray +exports.fromByteArray = fromByteArray - /** - * Constructs a new AddKeyTransaction. - * @exports AddKeyTransaction - * @classdesc Represents an AddKeyTransaction. - * @implements IAddKeyTransaction - * @constructor - * @param {IAddKeyTransaction=} [properties] Properties to set - */ - function AddKeyTransaction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } +var lookup = [] +var revLookup = [] +var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array - /** - * AddKeyTransaction nonce. - * @member {number|Long} nonce - * @memberof AddKeyTransaction - * @instance - */ - AddKeyTransaction.prototype.nonce = $util.Long ? $util.Long.fromBits(0,0,true) : 0; +var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' +for (var i = 0, len = code.length; i < len; ++i) { + lookup[i] = code[i] + revLookup[code.charCodeAt(i)] = i +} - /** - * AddKeyTransaction originator. - * @member {string} originator - * @memberof AddKeyTransaction - * @instance - */ - AddKeyTransaction.prototype.originator = ""; +// Support decoding URL-safe base64 strings, as Node.js does. +// See: https://en.wikipedia.org/wiki/Base64#URL_applications +revLookup['-'.charCodeAt(0)] = 62 +revLookup['_'.charCodeAt(0)] = 63 - /** - * AddKeyTransaction newKey. - * @member {Uint8Array} newKey - * @memberof AddKeyTransaction - * @instance - */ - AddKeyTransaction.prototype.newKey = $util.newBuffer([]); +function getLens (b64) { + var len = b64.length - /** - * AddKeyTransaction accessKey. - * @member {IAccessKey|null|undefined} accessKey - * @memberof AddKeyTransaction - * @instance - */ - AddKeyTransaction.prototype.accessKey = null; + if (len % 4 > 0) { + throw new Error('Invalid string. Length must be a multiple of 4') + } - /** - * Creates a new AddKeyTransaction instance using the specified properties. - * @function create - * @memberof AddKeyTransaction - * @static - * @param {IAddKeyTransaction=} [properties] Properties to set - * @returns {AddKeyTransaction} AddKeyTransaction instance - */ - AddKeyTransaction.create = function create(properties) { - return new AddKeyTransaction(properties); - }; + // Trim off extra bytes after placeholder bytes are found + // See: https://github.com/beatgammit/base64-js/issues/42 + var validLen = b64.indexOf('=') + if (validLen === -1) validLen = len - /** - * Encodes the specified AddKeyTransaction message. Does not implicitly {@link AddKeyTransaction.verify|verify} messages. - * @function encode - * @memberof AddKeyTransaction - * @static - * @param {IAddKeyTransaction} message AddKeyTransaction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AddKeyTransaction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.nonce != null && message.hasOwnProperty("nonce")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.nonce); - if (message.originator != null && message.hasOwnProperty("originator")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.originator); - if (message.newKey != null && message.hasOwnProperty("newKey")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.newKey); - if (message.accessKey != null && message.hasOwnProperty("accessKey")) - $root.AccessKey.encode(message.accessKey, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; + var placeHoldersLen = validLen === len + ? 0 + : 4 - (validLen % 4) - /** - * Encodes the specified AddKeyTransaction message, length delimited. Does not implicitly {@link AddKeyTransaction.verify|verify} messages. - * @function encodeDelimited - * @memberof AddKeyTransaction - * @static - * @param {IAddKeyTransaction} message AddKeyTransaction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AddKeyTransaction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + return [validLen, placeHoldersLen] +} - /** - * Decodes an AddKeyTransaction message from the specified reader or buffer. - * @function decode - * @memberof AddKeyTransaction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {AddKeyTransaction} AddKeyTransaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AddKeyTransaction.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.AddKeyTransaction(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.nonce = reader.uint64(); - break; - case 2: - message.originator = reader.string(); - break; - case 3: - message.newKey = reader.bytes(); - break; - case 4: - message.accessKey = $root.AccessKey.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; +// base64 is 4/3 + up to two characters of the original data +function byteLength (b64) { + var lens = getLens(b64) + var validLen = lens[0] + var placeHoldersLen = lens[1] + return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen +} - /** - * Decodes an AddKeyTransaction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof AddKeyTransaction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {AddKeyTransaction} AddKeyTransaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AddKeyTransaction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; +function _byteLength (b64, validLen, placeHoldersLen) { + return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen +} - /** - * Verifies an AddKeyTransaction message. - * @function verify - * @memberof AddKeyTransaction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AddKeyTransaction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.nonce != null && message.hasOwnProperty("nonce")) - if (!$util.isInteger(message.nonce) && !(message.nonce && $util.isInteger(message.nonce.low) && $util.isInteger(message.nonce.high))) - return "nonce: integer|Long expected"; - if (message.originator != null && message.hasOwnProperty("originator")) - if (!$util.isString(message.originator)) - return "originator: string expected"; - if (message.newKey != null && message.hasOwnProperty("newKey")) - if (!(message.newKey && typeof message.newKey.length === "number" || $util.isString(message.newKey))) - return "newKey: buffer expected"; - if (message.accessKey != null && message.hasOwnProperty("accessKey")) { - var error = $root.AccessKey.verify(message.accessKey); - if (error) - return "accessKey." + error; - } - return null; - }; - - /** - * Creates an AddKeyTransaction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof AddKeyTransaction - * @static - * @param {Object.} object Plain object - * @returns {AddKeyTransaction} AddKeyTransaction - */ - AddKeyTransaction.fromObject = function fromObject(object) { - if (object instanceof $root.AddKeyTransaction) - return object; - var message = new $root.AddKeyTransaction(); - if (object.nonce != null) - if ($util.Long) - (message.nonce = $util.Long.fromValue(object.nonce)).unsigned = true; - else if (typeof object.nonce === "string") - message.nonce = parseInt(object.nonce, 10); - else if (typeof object.nonce === "number") - message.nonce = object.nonce; - else if (typeof object.nonce === "object") - message.nonce = new $util.LongBits(object.nonce.low >>> 0, object.nonce.high >>> 0).toNumber(true); - if (object.originator != null) - message.originator = String(object.originator); - if (object.newKey != null) - if (typeof object.newKey === "string") - $util.base64.decode(object.newKey, message.newKey = $util.newBuffer($util.base64.length(object.newKey)), 0); - else if (object.newKey.length) - message.newKey = object.newKey; - if (object.accessKey != null) { - if (typeof object.accessKey !== "object") - throw TypeError(".AddKeyTransaction.accessKey: object expected"); - message.accessKey = $root.AccessKey.fromObject(object.accessKey); - } - return message; - }; +function toByteArray (b64) { + var tmp + var lens = getLens(b64) + var validLen = lens[0] + var placeHoldersLen = lens[1] - /** - * Creates a plain object from an AddKeyTransaction message. Also converts values to other types if specified. - * @function toObject - * @memberof AddKeyTransaction - * @static - * @param {AddKeyTransaction} message AddKeyTransaction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AddKeyTransaction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.nonce = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.nonce = options.longs === String ? "0" : 0; - object.originator = ""; - if (options.bytes === String) - object.newKey = ""; - else { - object.newKey = []; - if (options.bytes !== Array) - object.newKey = $util.newBuffer(object.newKey); - } - object.accessKey = null; - } - if (message.nonce != null && message.hasOwnProperty("nonce")) - if (typeof message.nonce === "number") - object.nonce = options.longs === String ? String(message.nonce) : message.nonce; - else - object.nonce = options.longs === String ? $util.Long.prototype.toString.call(message.nonce) : options.longs === Number ? new $util.LongBits(message.nonce.low >>> 0, message.nonce.high >>> 0).toNumber(true) : message.nonce; - if (message.originator != null && message.hasOwnProperty("originator")) - object.originator = message.originator; - if (message.newKey != null && message.hasOwnProperty("newKey")) - object.newKey = options.bytes === String ? $util.base64.encode(message.newKey, 0, message.newKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.newKey) : message.newKey; - if (message.accessKey != null && message.hasOwnProperty("accessKey")) - object.accessKey = $root.AccessKey.toObject(message.accessKey, options); - return object; - }; + var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen)) - /** - * Converts this AddKeyTransaction to JSON. - * @function toJSON - * @memberof AddKeyTransaction - * @instance - * @returns {Object.} JSON object - */ - AddKeyTransaction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + var curByte = 0 - return AddKeyTransaction; -})(); + // if there are placeholders, only get up to the last complete 4 chars + var len = placeHoldersLen > 0 + ? validLen - 4 + : validLen -$root.DeleteKeyTransaction = (function() { + for (var i = 0; i < len; i += 4) { + tmp = + (revLookup[b64.charCodeAt(i)] << 18) | + (revLookup[b64.charCodeAt(i + 1)] << 12) | + (revLookup[b64.charCodeAt(i + 2)] << 6) | + revLookup[b64.charCodeAt(i + 3)] + arr[curByte++] = (tmp >> 16) & 0xFF + arr[curByte++] = (tmp >> 8) & 0xFF + arr[curByte++] = tmp & 0xFF + } - /** - * Properties of a DeleteKeyTransaction. - * @exports IDeleteKeyTransaction - * @interface IDeleteKeyTransaction - * @property {number|Long|null} [nonce] DeleteKeyTransaction nonce - * @property {string|null} [originator] DeleteKeyTransaction originator - * @property {Uint8Array|null} [curKey] DeleteKeyTransaction curKey - */ + if (placeHoldersLen === 2) { + tmp = + (revLookup[b64.charCodeAt(i)] << 2) | + (revLookup[b64.charCodeAt(i + 1)] >> 4) + arr[curByte++] = tmp & 0xFF + } - /** - * Constructs a new DeleteKeyTransaction. - * @exports DeleteKeyTransaction - * @classdesc Represents a DeleteKeyTransaction. - * @implements IDeleteKeyTransaction - * @constructor - * @param {IDeleteKeyTransaction=} [properties] Properties to set - */ - function DeleteKeyTransaction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + if (placeHoldersLen === 1) { + tmp = + (revLookup[b64.charCodeAt(i)] << 10) | + (revLookup[b64.charCodeAt(i + 1)] << 4) | + (revLookup[b64.charCodeAt(i + 2)] >> 2) + arr[curByte++] = (tmp >> 8) & 0xFF + arr[curByte++] = tmp & 0xFF + } - /** - * DeleteKeyTransaction nonce. - * @member {number|Long} nonce - * @memberof DeleteKeyTransaction - * @instance - */ - DeleteKeyTransaction.prototype.nonce = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + return arr +} - /** - * DeleteKeyTransaction originator. - * @member {string} originator - * @memberof DeleteKeyTransaction - * @instance - */ - DeleteKeyTransaction.prototype.originator = ""; +function tripletToBase64 (num) { + return lookup[num >> 18 & 0x3F] + + lookup[num >> 12 & 0x3F] + + lookup[num >> 6 & 0x3F] + + lookup[num & 0x3F] +} - /** - * DeleteKeyTransaction curKey. - * @member {Uint8Array} curKey - * @memberof DeleteKeyTransaction - * @instance - */ - DeleteKeyTransaction.prototype.curKey = $util.newBuffer([]); +function encodeChunk (uint8, start, end) { + var tmp + var output = [] + for (var i = start; i < end; i += 3) { + tmp = + ((uint8[i] << 16) & 0xFF0000) + + ((uint8[i + 1] << 8) & 0xFF00) + + (uint8[i + 2] & 0xFF) + output.push(tripletToBase64(tmp)) + } + return output.join('') +} - /** - * Creates a new DeleteKeyTransaction instance using the specified properties. - * @function create - * @memberof DeleteKeyTransaction - * @static - * @param {IDeleteKeyTransaction=} [properties] Properties to set - * @returns {DeleteKeyTransaction} DeleteKeyTransaction instance - */ - DeleteKeyTransaction.create = function create(properties) { - return new DeleteKeyTransaction(properties); - }; +function fromByteArray (uint8) { + var tmp + var len = uint8.length + var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes + var parts = [] + var maxChunkLength = 16383 // must be multiple of 3 - /** - * Encodes the specified DeleteKeyTransaction message. Does not implicitly {@link DeleteKeyTransaction.verify|verify} messages. - * @function encode - * @memberof DeleteKeyTransaction - * @static - * @param {IDeleteKeyTransaction} message DeleteKeyTransaction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteKeyTransaction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.nonce != null && message.hasOwnProperty("nonce")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.nonce); - if (message.originator != null && message.hasOwnProperty("originator")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.originator); - if (message.curKey != null && message.hasOwnProperty("curKey")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.curKey); - return writer; - }; + // go through the array every three bytes, we'll deal with trailing stuff later + for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) { + parts.push(encodeChunk( + uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength) + )) + } - /** - * Encodes the specified DeleteKeyTransaction message, length delimited. Does not implicitly {@link DeleteKeyTransaction.verify|verify} messages. - * @function encodeDelimited - * @memberof DeleteKeyTransaction - * @static - * @param {IDeleteKeyTransaction} message DeleteKeyTransaction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteKeyTransaction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + // pad the end with zeros, but make sure to not forget the extra bytes + if (extraBytes === 1) { + tmp = uint8[len - 1] + parts.push( + lookup[tmp >> 2] + + lookup[(tmp << 4) & 0x3F] + + '==' + ) + } else if (extraBytes === 2) { + tmp = (uint8[len - 2] << 8) + uint8[len - 1] + parts.push( + lookup[tmp >> 10] + + lookup[(tmp >> 4) & 0x3F] + + lookup[(tmp << 2) & 0x3F] + + '=' + ) + } - /** - * Decodes a DeleteKeyTransaction message from the specified reader or buffer. - * @function decode - * @memberof DeleteKeyTransaction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {DeleteKeyTransaction} DeleteKeyTransaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteKeyTransaction.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.DeleteKeyTransaction(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.nonce = reader.uint64(); - break; - case 2: - message.originator = reader.string(); - break; - case 3: - message.curKey = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + return parts.join('') +} - /** - * Decodes a DeleteKeyTransaction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof DeleteKeyTransaction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {DeleteKeyTransaction} DeleteKeyTransaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteKeyTransaction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; +},{}],27:[function(require,module,exports){ +(function (module, exports) { + 'use strict'; - /** - * Verifies a DeleteKeyTransaction message. - * @function verify - * @memberof DeleteKeyTransaction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteKeyTransaction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.nonce != null && message.hasOwnProperty("nonce")) - if (!$util.isInteger(message.nonce) && !(message.nonce && $util.isInteger(message.nonce.low) && $util.isInteger(message.nonce.high))) - return "nonce: integer|Long expected"; - if (message.originator != null && message.hasOwnProperty("originator")) - if (!$util.isString(message.originator)) - return "originator: string expected"; - if (message.curKey != null && message.hasOwnProperty("curKey")) - if (!(message.curKey && typeof message.curKey.length === "number" || $util.isString(message.curKey))) - return "curKey: buffer expected"; - return null; - }; + // Utils + function assert (val, msg) { + if (!val) throw new Error(msg || 'Assertion failed'); + } - /** - * Creates a DeleteKeyTransaction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof DeleteKeyTransaction - * @static - * @param {Object.} object Plain object - * @returns {DeleteKeyTransaction} DeleteKeyTransaction - */ - DeleteKeyTransaction.fromObject = function fromObject(object) { - if (object instanceof $root.DeleteKeyTransaction) - return object; - var message = new $root.DeleteKeyTransaction(); - if (object.nonce != null) - if ($util.Long) - (message.nonce = $util.Long.fromValue(object.nonce)).unsigned = true; - else if (typeof object.nonce === "string") - message.nonce = parseInt(object.nonce, 10); - else if (typeof object.nonce === "number") - message.nonce = object.nonce; - else if (typeof object.nonce === "object") - message.nonce = new $util.LongBits(object.nonce.low >>> 0, object.nonce.high >>> 0).toNumber(true); - if (object.originator != null) - message.originator = String(object.originator); - if (object.curKey != null) - if (typeof object.curKey === "string") - $util.base64.decode(object.curKey, message.curKey = $util.newBuffer($util.base64.length(object.curKey)), 0); - else if (object.curKey.length) - message.curKey = object.curKey; - return message; - }; + // Could use `inherits` module, but don't want to move from single file + // architecture yet. + function inherits (ctor, superCtor) { + ctor.super_ = superCtor; + var TempCtor = function () {}; + TempCtor.prototype = superCtor.prototype; + ctor.prototype = new TempCtor(); + ctor.prototype.constructor = ctor; + } - /** - * Creates a plain object from a DeleteKeyTransaction message. Also converts values to other types if specified. - * @function toObject - * @memberof DeleteKeyTransaction - * @static - * @param {DeleteKeyTransaction} message DeleteKeyTransaction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteKeyTransaction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.nonce = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.nonce = options.longs === String ? "0" : 0; - object.originator = ""; - if (options.bytes === String) - object.curKey = ""; - else { - object.curKey = []; - if (options.bytes !== Array) - object.curKey = $util.newBuffer(object.curKey); - } - } - if (message.nonce != null && message.hasOwnProperty("nonce")) - if (typeof message.nonce === "number") - object.nonce = options.longs === String ? String(message.nonce) : message.nonce; - else - object.nonce = options.longs === String ? $util.Long.prototype.toString.call(message.nonce) : options.longs === Number ? new $util.LongBits(message.nonce.low >>> 0, message.nonce.high >>> 0).toNumber(true) : message.nonce; - if (message.originator != null && message.hasOwnProperty("originator")) - object.originator = message.originator; - if (message.curKey != null && message.hasOwnProperty("curKey")) - object.curKey = options.bytes === String ? $util.base64.encode(message.curKey, 0, message.curKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.curKey) : message.curKey; - return object; - }; + // BN - /** - * Converts this DeleteKeyTransaction to JSON. - * @function toJSON - * @memberof DeleteKeyTransaction - * @instance - * @returns {Object.} JSON object - */ - DeleteKeyTransaction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + function BN (number, base, endian) { + if (BN.isBN(number)) { + return number; + } - return DeleteKeyTransaction; -})(); + this.negative = 0; + this.words = null; + this.length = 0; -$root.DeleteAccountTransaction = (function() { + // Reduction context + this.red = null; - /** - * Properties of a DeleteAccountTransaction. - * @exports IDeleteAccountTransaction - * @interface IDeleteAccountTransaction - * @property {number|Long|null} [nonce] DeleteAccountTransaction nonce - * @property {string|null} [originatorId] DeleteAccountTransaction originatorId - * @property {string|null} [receiverId] DeleteAccountTransaction receiverId - */ + if (number !== null) { + if (base === 'le' || base === 'be') { + endian = base; + base = 10; + } - /** - * Constructs a new DeleteAccountTransaction. - * @exports DeleteAccountTransaction - * @classdesc Represents a DeleteAccountTransaction. - * @implements IDeleteAccountTransaction - * @constructor - * @param {IDeleteAccountTransaction=} [properties] Properties to set - */ - function DeleteAccountTransaction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + this._init(number || 0, base || 10, endian || 'be'); } + } + if (typeof module === 'object') { + module.exports = BN; + } else { + exports.BN = BN; + } - /** - * DeleteAccountTransaction nonce. - * @member {number|Long} nonce - * @memberof DeleteAccountTransaction - * @instance - */ - DeleteAccountTransaction.prototype.nonce = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * DeleteAccountTransaction originatorId. - * @member {string} originatorId - * @memberof DeleteAccountTransaction - * @instance - */ - DeleteAccountTransaction.prototype.originatorId = ""; + BN.BN = BN; + BN.wordSize = 26; - /** - * DeleteAccountTransaction receiverId. - * @member {string} receiverId - * @memberof DeleteAccountTransaction - * @instance - */ - DeleteAccountTransaction.prototype.receiverId = ""; + var Buffer; + try { + Buffer = require('buffer').Buffer; + } catch (e) { + } - /** - * Creates a new DeleteAccountTransaction instance using the specified properties. - * @function create - * @memberof DeleteAccountTransaction - * @static - * @param {IDeleteAccountTransaction=} [properties] Properties to set - * @returns {DeleteAccountTransaction} DeleteAccountTransaction instance - */ - DeleteAccountTransaction.create = function create(properties) { - return new DeleteAccountTransaction(properties); - }; + BN.isBN = function isBN (num) { + if (num instanceof BN) { + return true; + } - /** - * Encodes the specified DeleteAccountTransaction message. Does not implicitly {@link DeleteAccountTransaction.verify|verify} messages. - * @function encode - * @memberof DeleteAccountTransaction - * @static - * @param {IDeleteAccountTransaction} message DeleteAccountTransaction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteAccountTransaction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.nonce != null && message.hasOwnProperty("nonce")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.nonce); - if (message.originatorId != null && message.hasOwnProperty("originatorId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.originatorId); - if (message.receiverId != null && message.hasOwnProperty("receiverId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.receiverId); - return writer; - }; + return num !== null && typeof num === 'object' && + num.constructor.wordSize === BN.wordSize && Array.isArray(num.words); + }; - /** - * Encodes the specified DeleteAccountTransaction message, length delimited. Does not implicitly {@link DeleteAccountTransaction.verify|verify} messages. - * @function encodeDelimited - * @memberof DeleteAccountTransaction - * @static - * @param {IDeleteAccountTransaction} message DeleteAccountTransaction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteAccountTransaction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + BN.max = function max (left, right) { + if (left.cmp(right) > 0) return left; + return right; + }; - /** - * Decodes a DeleteAccountTransaction message from the specified reader or buffer. - * @function decode - * @memberof DeleteAccountTransaction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {DeleteAccountTransaction} DeleteAccountTransaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteAccountTransaction.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.DeleteAccountTransaction(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.nonce = reader.uint64(); - break; - case 2: - message.originatorId = reader.string(); - break; - case 3: - message.receiverId = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + BN.min = function min (left, right) { + if (left.cmp(right) < 0) return left; + return right; + }; - /** - * Decodes a DeleteAccountTransaction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof DeleteAccountTransaction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {DeleteAccountTransaction} DeleteAccountTransaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteAccountTransaction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + BN.prototype._init = function init (number, base, endian) { + if (typeof number === 'number') { + return this._initNumber(number, base, endian); + } - /** - * Verifies a DeleteAccountTransaction message. - * @function verify - * @memberof DeleteAccountTransaction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteAccountTransaction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.nonce != null && message.hasOwnProperty("nonce")) - if (!$util.isInteger(message.nonce) && !(message.nonce && $util.isInteger(message.nonce.low) && $util.isInteger(message.nonce.high))) - return "nonce: integer|Long expected"; - if (message.originatorId != null && message.hasOwnProperty("originatorId")) - if (!$util.isString(message.originatorId)) - return "originatorId: string expected"; - if (message.receiverId != null && message.hasOwnProperty("receiverId")) - if (!$util.isString(message.receiverId)) - return "receiverId: string expected"; - return null; - }; + if (typeof number === 'object') { + return this._initArray(number, base, endian); + } - /** - * Creates a DeleteAccountTransaction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof DeleteAccountTransaction - * @static - * @param {Object.} object Plain object - * @returns {DeleteAccountTransaction} DeleteAccountTransaction - */ - DeleteAccountTransaction.fromObject = function fromObject(object) { - if (object instanceof $root.DeleteAccountTransaction) - return object; - var message = new $root.DeleteAccountTransaction(); - if (object.nonce != null) - if ($util.Long) - (message.nonce = $util.Long.fromValue(object.nonce)).unsigned = true; - else if (typeof object.nonce === "string") - message.nonce = parseInt(object.nonce, 10); - else if (typeof object.nonce === "number") - message.nonce = object.nonce; - else if (typeof object.nonce === "object") - message.nonce = new $util.LongBits(object.nonce.low >>> 0, object.nonce.high >>> 0).toNumber(true); - if (object.originatorId != null) - message.originatorId = String(object.originatorId); - if (object.receiverId != null) - message.receiverId = String(object.receiverId); - return message; - }; + if (base === 'hex') { + base = 16; + } + assert(base === (base | 0) && base >= 2 && base <= 36); - /** - * Creates a plain object from a DeleteAccountTransaction message. Also converts values to other types if specified. - * @function toObject - * @memberof DeleteAccountTransaction - * @static - * @param {DeleteAccountTransaction} message DeleteAccountTransaction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteAccountTransaction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.nonce = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.nonce = options.longs === String ? "0" : 0; - object.originatorId = ""; - object.receiverId = ""; - } - if (message.nonce != null && message.hasOwnProperty("nonce")) - if (typeof message.nonce === "number") - object.nonce = options.longs === String ? String(message.nonce) : message.nonce; - else - object.nonce = options.longs === String ? $util.Long.prototype.toString.call(message.nonce) : options.longs === Number ? new $util.LongBits(message.nonce.low >>> 0, message.nonce.high >>> 0).toNumber(true) : message.nonce; - if (message.originatorId != null && message.hasOwnProperty("originatorId")) - object.originatorId = message.originatorId; - if (message.receiverId != null && message.hasOwnProperty("receiverId")) - object.receiverId = message.receiverId; - return object; - }; + number = number.toString().replace(/\s+/g, ''); + var start = 0; + if (number[0] === '-') { + start++; + } - /** - * Converts this DeleteAccountTransaction to JSON. - * @function toJSON - * @memberof DeleteAccountTransaction - * @instance - * @returns {Object.} JSON object - */ - DeleteAccountTransaction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + if (base === 16) { + this._parseHex(number, start); + } else { + this._parseBase(number, base, start); + } - return DeleteAccountTransaction; -})(); + if (number[0] === '-') { + this.negative = 1; + } -$root.SignedTransaction = (function() { + this.strip(); - /** - * Properties of a SignedTransaction. - * @exports ISignedTransaction - * @interface ISignedTransaction - * @property {Uint8Array|null} [signature] SignedTransaction signature - * @property {google.protobuf.IBytesValue|null} [publicKey] SignedTransaction publicKey - * @property {ICreateAccountTransaction|null} [createAccount] SignedTransaction createAccount - * @property {IDeployContractTransaction|null} [deployContract] SignedTransaction deployContract - * @property {IFunctionCallTransaction|null} [functionCall] SignedTransaction functionCall - * @property {ISendMoneyTransaction|null} [sendMoney] SignedTransaction sendMoney - * @property {IStakeTransaction|null} [stake] SignedTransaction stake - * @property {ISwapKeyTransaction|null} [swapKey] SignedTransaction swapKey - * @property {IAddKeyTransaction|null} [addKey] SignedTransaction addKey - * @property {IDeleteKeyTransaction|null} [deleteKey] SignedTransaction deleteKey - * @property {IDeleteAccountTransaction|null} [deleteAccount] SignedTransaction deleteAccount - */ + if (endian !== 'le') return; - /** - * Constructs a new SignedTransaction. - * @exports SignedTransaction - * @classdesc Represents a SignedTransaction. - * @implements ISignedTransaction - * @constructor - * @param {ISignedTransaction=} [properties] Properties to set - */ - function SignedTransaction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + this._initArray(this.toArray(), base, endian); + }; + + BN.prototype._initNumber = function _initNumber (number, base, endian) { + if (number < 0) { + this.negative = 1; + number = -number; + } + if (number < 0x4000000) { + this.words = [ number & 0x3ffffff ]; + this.length = 1; + } else if (number < 0x10000000000000) { + this.words = [ + number & 0x3ffffff, + (number / 0x4000000) & 0x3ffffff + ]; + this.length = 2; + } else { + assert(number < 0x20000000000000); // 2 ^ 53 (unsafe) + this.words = [ + number & 0x3ffffff, + (number / 0x4000000) & 0x3ffffff, + 1 + ]; + this.length = 3; } - /** - * SignedTransaction signature. - * @member {Uint8Array} signature - * @memberof SignedTransaction - * @instance - */ - SignedTransaction.prototype.signature = $util.newBuffer([]); + if (endian !== 'le') return; - /** - * SignedTransaction publicKey. - * @member {google.protobuf.IBytesValue|null|undefined} publicKey - * @memberof SignedTransaction - * @instance - */ - SignedTransaction.prototype.publicKey = null; + // Reverse the bytes + this._initArray(this.toArray(), base, endian); + }; - /** - * SignedTransaction createAccount. - * @member {ICreateAccountTransaction|null|undefined} createAccount - * @memberof SignedTransaction - * @instance - */ - SignedTransaction.prototype.createAccount = null; + BN.prototype._initArray = function _initArray (number, base, endian) { + // Perhaps a Uint8Array + assert(typeof number.length === 'number'); + if (number.length <= 0) { + this.words = [ 0 ]; + this.length = 1; + return this; + } - /** - * SignedTransaction deployContract. - * @member {IDeployContractTransaction|null|undefined} deployContract - * @memberof SignedTransaction - * @instance - */ - SignedTransaction.prototype.deployContract = null; + this.length = Math.ceil(number.length / 3); + this.words = new Array(this.length); + for (var i = 0; i < this.length; i++) { + this.words[i] = 0; + } - /** - * SignedTransaction functionCall. - * @member {IFunctionCallTransaction|null|undefined} functionCall - * @memberof SignedTransaction - * @instance - */ - SignedTransaction.prototype.functionCall = null; + var j, w; + var off = 0; + if (endian === 'be') { + for (i = number.length - 1, j = 0; i >= 0; i -= 3) { + w = number[i] | (number[i - 1] << 8) | (number[i - 2] << 16); + this.words[j] |= (w << off) & 0x3ffffff; + this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff; + off += 24; + if (off >= 26) { + off -= 26; + j++; + } + } + } else if (endian === 'le') { + for (i = 0, j = 0; i < number.length; i += 3) { + w = number[i] | (number[i + 1] << 8) | (number[i + 2] << 16); + this.words[j] |= (w << off) & 0x3ffffff; + this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff; + off += 24; + if (off >= 26) { + off -= 26; + j++; + } + } + } + return this.strip(); + }; - /** - * SignedTransaction sendMoney. - * @member {ISendMoneyTransaction|null|undefined} sendMoney - * @memberof SignedTransaction - * @instance - */ - SignedTransaction.prototype.sendMoney = null; + function parseHex (str, start, end) { + var r = 0; + var len = Math.min(str.length, end); + for (var i = start; i < len; i++) { + var c = str.charCodeAt(i) - 48; - /** - * SignedTransaction stake. - * @member {IStakeTransaction|null|undefined} stake - * @memberof SignedTransaction - * @instance - */ - SignedTransaction.prototype.stake = null; + r <<= 4; - /** - * SignedTransaction swapKey. - * @member {ISwapKeyTransaction|null|undefined} swapKey - * @memberof SignedTransaction - * @instance - */ - SignedTransaction.prototype.swapKey = null; + // 'a' - 'f' + if (c >= 49 && c <= 54) { + r |= c - 49 + 0xa; - /** - * SignedTransaction addKey. - * @member {IAddKeyTransaction|null|undefined} addKey - * @memberof SignedTransaction - * @instance - */ - SignedTransaction.prototype.addKey = null; + // 'A' - 'F' + } else if (c >= 17 && c <= 22) { + r |= c - 17 + 0xa; - /** - * SignedTransaction deleteKey. - * @member {IDeleteKeyTransaction|null|undefined} deleteKey - * @memberof SignedTransaction - * @instance - */ - SignedTransaction.prototype.deleteKey = null; + // '0' - '9' + } else { + r |= c & 0xf; + } + } + return r; + } - /** - * SignedTransaction deleteAccount. - * @member {IDeleteAccountTransaction|null|undefined} deleteAccount - * @memberof SignedTransaction - * @instance - */ - SignedTransaction.prototype.deleteAccount = null; + BN.prototype._parseHex = function _parseHex (number, start) { + // Create possibly bigger array to ensure that it fits the number + this.length = Math.ceil((number.length - start) / 6); + this.words = new Array(this.length); + for (var i = 0; i < this.length; i++) { + this.words[i] = 0; + } - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + var j, w; + // Scan 24-bit chunks and add them to the number + var off = 0; + for (i = number.length - 6, j = 0; i >= start; i -= 6) { + w = parseHex(number, i, i + 6); + this.words[j] |= (w << off) & 0x3ffffff; + // NOTE: `0x3fffff` is intentional here, 26bits max shift + 24bit hex limb + this.words[j + 1] |= w >>> (26 - off) & 0x3fffff; + off += 24; + if (off >= 26) { + off -= 26; + j++; + } + } + if (i + 6 !== start) { + w = parseHex(number, start, i + 6); + this.words[j] |= (w << off) & 0x3ffffff; + this.words[j + 1] |= w >>> (26 - off) & 0x3fffff; + } + this.strip(); + }; - /** - * SignedTransaction body. - * @member {"createAccount"|"deployContract"|"functionCall"|"sendMoney"|"stake"|"swapKey"|"addKey"|"deleteKey"|"deleteAccount"|undefined} body - * @memberof SignedTransaction - * @instance - */ - Object.defineProperty(SignedTransaction.prototype, "body", { - get: $util.oneOfGetter($oneOfFields = ["createAccount", "deployContract", "functionCall", "sendMoney", "stake", "swapKey", "addKey", "deleteKey", "deleteAccount"]), - set: $util.oneOfSetter($oneOfFields) - }); + function parseBase (str, start, end, mul) { + var r = 0; + var len = Math.min(str.length, end); + for (var i = start; i < len; i++) { + var c = str.charCodeAt(i) - 48; - /** - * Creates a new SignedTransaction instance using the specified properties. - * @function create - * @memberof SignedTransaction - * @static - * @param {ISignedTransaction=} [properties] Properties to set - * @returns {SignedTransaction} SignedTransaction instance - */ - SignedTransaction.create = function create(properties) { - return new SignedTransaction(properties); - }; + r *= mul; - /** - * Encodes the specified SignedTransaction message. Does not implicitly {@link SignedTransaction.verify|verify} messages. - * @function encode - * @memberof SignedTransaction - * @static - * @param {ISignedTransaction} message SignedTransaction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SignedTransaction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.signature != null && message.hasOwnProperty("signature")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.signature); - if (message.createAccount != null && message.hasOwnProperty("createAccount")) - $root.CreateAccountTransaction.encode(message.createAccount, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.deployContract != null && message.hasOwnProperty("deployContract")) - $root.DeployContractTransaction.encode(message.deployContract, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.functionCall != null && message.hasOwnProperty("functionCall")) - $root.FunctionCallTransaction.encode(message.functionCall, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.sendMoney != null && message.hasOwnProperty("sendMoney")) - $root.SendMoneyTransaction.encode(message.sendMoney, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.stake != null && message.hasOwnProperty("stake")) - $root.StakeTransaction.encode(message.stake, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.swapKey != null && message.hasOwnProperty("swapKey")) - $root.SwapKeyTransaction.encode(message.swapKey, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.addKey != null && message.hasOwnProperty("addKey")) - $root.AddKeyTransaction.encode(message.addKey, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.deleteKey != null && message.hasOwnProperty("deleteKey")) - $root.DeleteKeyTransaction.encode(message.deleteKey, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.publicKey != null && message.hasOwnProperty("publicKey")) - $root.google.protobuf.BytesValue.encode(message.publicKey, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.deleteAccount != null && message.hasOwnProperty("deleteAccount")) - $root.DeleteAccountTransaction.encode(message.deleteAccount, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - return writer; - }; + // 'a' + if (c >= 49) { + r += c - 49 + 0xa; - /** - * Encodes the specified SignedTransaction message, length delimited. Does not implicitly {@link SignedTransaction.verify|verify} messages. - * @function encodeDelimited - * @memberof SignedTransaction - * @static - * @param {ISignedTransaction} message SignedTransaction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SignedTransaction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + // 'A' + } else if (c >= 17) { + r += c - 17 + 0xa; - /** - * Decodes a SignedTransaction message from the specified reader or buffer. - * @function decode - * @memberof SignedTransaction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {SignedTransaction} SignedTransaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SignedTransaction.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.SignedTransaction(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.signature = reader.bytes(); - break; - case 10: - message.publicKey = $root.google.protobuf.BytesValue.decode(reader, reader.uint32()); - break; - case 2: - message.createAccount = $root.CreateAccountTransaction.decode(reader, reader.uint32()); - break; - case 3: - message.deployContract = $root.DeployContractTransaction.decode(reader, reader.uint32()); - break; - case 4: - message.functionCall = $root.FunctionCallTransaction.decode(reader, reader.uint32()); - break; - case 5: - message.sendMoney = $root.SendMoneyTransaction.decode(reader, reader.uint32()); - break; - case 6: - message.stake = $root.StakeTransaction.decode(reader, reader.uint32()); - break; - case 7: - message.swapKey = $root.SwapKeyTransaction.decode(reader, reader.uint32()); - break; - case 8: - message.addKey = $root.AddKeyTransaction.decode(reader, reader.uint32()); - break; - case 9: - message.deleteKey = $root.DeleteKeyTransaction.decode(reader, reader.uint32()); - break; - case 11: - message.deleteAccount = $root.DeleteAccountTransaction.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + // '0' - '9' + } else { + r += c; + } + } + return r; + } - /** - * Decodes a SignedTransaction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof SignedTransaction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {SignedTransaction} SignedTransaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SignedTransaction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + BN.prototype._parseBase = function _parseBase (number, base, start) { + // Initialize as zero + this.words = [ 0 ]; + this.length = 1; - /** - * Verifies a SignedTransaction message. - * @function verify - * @memberof SignedTransaction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SignedTransaction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.signature != null && message.hasOwnProperty("signature")) - if (!(message.signature && typeof message.signature.length === "number" || $util.isString(message.signature))) - return "signature: buffer expected"; - if (message.publicKey != null && message.hasOwnProperty("publicKey")) { - var error = $root.google.protobuf.BytesValue.verify(message.publicKey); - if (error) - return "publicKey." + error; - } - if (message.createAccount != null && message.hasOwnProperty("createAccount")) { - properties.body = 1; - { - var error = $root.CreateAccountTransaction.verify(message.createAccount); - if (error) - return "createAccount." + error; - } - } - if (message.deployContract != null && message.hasOwnProperty("deployContract")) { - if (properties.body === 1) - return "body: multiple values"; - properties.body = 1; - { - var error = $root.DeployContractTransaction.verify(message.deployContract); - if (error) - return "deployContract." + error; - } - } - if (message.functionCall != null && message.hasOwnProperty("functionCall")) { - if (properties.body === 1) - return "body: multiple values"; - properties.body = 1; - { - var error = $root.FunctionCallTransaction.verify(message.functionCall); - if (error) - return "functionCall." + error; - } - } - if (message.sendMoney != null && message.hasOwnProperty("sendMoney")) { - if (properties.body === 1) - return "body: multiple values"; - properties.body = 1; - { - var error = $root.SendMoneyTransaction.verify(message.sendMoney); - if (error) - return "sendMoney." + error; - } - } - if (message.stake != null && message.hasOwnProperty("stake")) { - if (properties.body === 1) - return "body: multiple values"; - properties.body = 1; - { - var error = $root.StakeTransaction.verify(message.stake); - if (error) - return "stake." + error; - } - } - if (message.swapKey != null && message.hasOwnProperty("swapKey")) { - if (properties.body === 1) - return "body: multiple values"; - properties.body = 1; - { - var error = $root.SwapKeyTransaction.verify(message.swapKey); - if (error) - return "swapKey." + error; - } - } - if (message.addKey != null && message.hasOwnProperty("addKey")) { - if (properties.body === 1) - return "body: multiple values"; - properties.body = 1; - { - var error = $root.AddKeyTransaction.verify(message.addKey); - if (error) - return "addKey." + error; - } - } - if (message.deleteKey != null && message.hasOwnProperty("deleteKey")) { - if (properties.body === 1) - return "body: multiple values"; - properties.body = 1; - { - var error = $root.DeleteKeyTransaction.verify(message.deleteKey); - if (error) - return "deleteKey." + error; - } - } - if (message.deleteAccount != null && message.hasOwnProperty("deleteAccount")) { - if (properties.body === 1) - return "body: multiple values"; - properties.body = 1; - { - var error = $root.DeleteAccountTransaction.verify(message.deleteAccount); - if (error) - return "deleteAccount." + error; - } - } - return null; - }; + // Find length of limb in base + for (var limbLen = 0, limbPow = 1; limbPow <= 0x3ffffff; limbPow *= base) { + limbLen++; + } + limbLen--; + limbPow = (limbPow / base) | 0; - /** - * Creates a SignedTransaction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof SignedTransaction - * @static - * @param {Object.} object Plain object - * @returns {SignedTransaction} SignedTransaction - */ - SignedTransaction.fromObject = function fromObject(object) { - if (object instanceof $root.SignedTransaction) - return object; - var message = new $root.SignedTransaction(); - if (object.signature != null) - if (typeof object.signature === "string") - $util.base64.decode(object.signature, message.signature = $util.newBuffer($util.base64.length(object.signature)), 0); - else if (object.signature.length) - message.signature = object.signature; - if (object.publicKey != null) { - if (typeof object.publicKey !== "object") - throw TypeError(".SignedTransaction.publicKey: object expected"); - message.publicKey = $root.google.protobuf.BytesValue.fromObject(object.publicKey); - } - if (object.createAccount != null) { - if (typeof object.createAccount !== "object") - throw TypeError(".SignedTransaction.createAccount: object expected"); - message.createAccount = $root.CreateAccountTransaction.fromObject(object.createAccount); - } - if (object.deployContract != null) { - if (typeof object.deployContract !== "object") - throw TypeError(".SignedTransaction.deployContract: object expected"); - message.deployContract = $root.DeployContractTransaction.fromObject(object.deployContract); - } - if (object.functionCall != null) { - if (typeof object.functionCall !== "object") - throw TypeError(".SignedTransaction.functionCall: object expected"); - message.functionCall = $root.FunctionCallTransaction.fromObject(object.functionCall); - } - if (object.sendMoney != null) { - if (typeof object.sendMoney !== "object") - throw TypeError(".SignedTransaction.sendMoney: object expected"); - message.sendMoney = $root.SendMoneyTransaction.fromObject(object.sendMoney); - } - if (object.stake != null) { - if (typeof object.stake !== "object") - throw TypeError(".SignedTransaction.stake: object expected"); - message.stake = $root.StakeTransaction.fromObject(object.stake); - } - if (object.swapKey != null) { - if (typeof object.swapKey !== "object") - throw TypeError(".SignedTransaction.swapKey: object expected"); - message.swapKey = $root.SwapKeyTransaction.fromObject(object.swapKey); - } - if (object.addKey != null) { - if (typeof object.addKey !== "object") - throw TypeError(".SignedTransaction.addKey: object expected"); - message.addKey = $root.AddKeyTransaction.fromObject(object.addKey); - } - if (object.deleteKey != null) { - if (typeof object.deleteKey !== "object") - throw TypeError(".SignedTransaction.deleteKey: object expected"); - message.deleteKey = $root.DeleteKeyTransaction.fromObject(object.deleteKey); - } - if (object.deleteAccount != null) { - if (typeof object.deleteAccount !== "object") - throw TypeError(".SignedTransaction.deleteAccount: object expected"); - message.deleteAccount = $root.DeleteAccountTransaction.fromObject(object.deleteAccount); - } - return message; - }; - - /** - * Creates a plain object from a SignedTransaction message. Also converts values to other types if specified. - * @function toObject - * @memberof SignedTransaction - * @static - * @param {SignedTransaction} message SignedTransaction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SignedTransaction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.signature = ""; - else { - object.signature = []; - if (options.bytes !== Array) - object.signature = $util.newBuffer(object.signature); - } - object.publicKey = null; - } - if (message.signature != null && message.hasOwnProperty("signature")) - object.signature = options.bytes === String ? $util.base64.encode(message.signature, 0, message.signature.length) : options.bytes === Array ? Array.prototype.slice.call(message.signature) : message.signature; - if (message.createAccount != null && message.hasOwnProperty("createAccount")) { - object.createAccount = $root.CreateAccountTransaction.toObject(message.createAccount, options); - if (options.oneofs) - object.body = "createAccount"; - } - if (message.deployContract != null && message.hasOwnProperty("deployContract")) { - object.deployContract = $root.DeployContractTransaction.toObject(message.deployContract, options); - if (options.oneofs) - object.body = "deployContract"; - } - if (message.functionCall != null && message.hasOwnProperty("functionCall")) { - object.functionCall = $root.FunctionCallTransaction.toObject(message.functionCall, options); - if (options.oneofs) - object.body = "functionCall"; - } - if (message.sendMoney != null && message.hasOwnProperty("sendMoney")) { - object.sendMoney = $root.SendMoneyTransaction.toObject(message.sendMoney, options); - if (options.oneofs) - object.body = "sendMoney"; - } - if (message.stake != null && message.hasOwnProperty("stake")) { - object.stake = $root.StakeTransaction.toObject(message.stake, options); - if (options.oneofs) - object.body = "stake"; - } - if (message.swapKey != null && message.hasOwnProperty("swapKey")) { - object.swapKey = $root.SwapKeyTransaction.toObject(message.swapKey, options); - if (options.oneofs) - object.body = "swapKey"; - } - if (message.addKey != null && message.hasOwnProperty("addKey")) { - object.addKey = $root.AddKeyTransaction.toObject(message.addKey, options); - if (options.oneofs) - object.body = "addKey"; - } - if (message.deleteKey != null && message.hasOwnProperty("deleteKey")) { - object.deleteKey = $root.DeleteKeyTransaction.toObject(message.deleteKey, options); - if (options.oneofs) - object.body = "deleteKey"; - } - if (message.publicKey != null && message.hasOwnProperty("publicKey")) - object.publicKey = $root.google.protobuf.BytesValue.toObject(message.publicKey, options); - if (message.deleteAccount != null && message.hasOwnProperty("deleteAccount")) { - object.deleteAccount = $root.DeleteAccountTransaction.toObject(message.deleteAccount, options); - if (options.oneofs) - object.body = "deleteAccount"; - } - return object; - }; + var total = number.length - start; + var mod = total % limbLen; + var end = Math.min(total, total - mod) + start; - /** - * Converts this SignedTransaction to JSON. - * @function toJSON - * @memberof SignedTransaction - * @instance - * @returns {Object.} JSON object - */ - SignedTransaction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + var word = 0; + for (var i = start; i < end; i += limbLen) { + word = parseBase(number, i, i + limbLen, base); - return SignedTransaction; -})(); + this.imuln(limbPow); + if (this.words[0] + word < 0x4000000) { + this.words[0] += word; + } else { + this._iaddn(word); + } + } -$root.google = (function() { + if (mod !== 0) { + var pow = 1; + word = parseBase(number, i, number.length, base); - /** - * Namespace google. - * @exports google - * @namespace - */ - var google = {}; - - google.protobuf = (function() { - - /** - * Namespace protobuf. - * @memberof google - * @namespace - */ - var protobuf = {}; - - protobuf.DoubleValue = (function() { - - /** - * Properties of a DoubleValue. - * @memberof google.protobuf - * @interface IDoubleValue - * @property {number|null} [value] DoubleValue value - */ - - /** - * Constructs a new DoubleValue. - * @memberof google.protobuf - * @classdesc Represents a DoubleValue. - * @implements IDoubleValue - * @constructor - * @param {google.protobuf.IDoubleValue=} [properties] Properties to set - */ - function DoubleValue(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + for (i = 0; i < mod; i++) { + pow *= base; + } - /** - * DoubleValue value. - * @member {number} value - * @memberof google.protobuf.DoubleValue - * @instance - */ - DoubleValue.prototype.value = 0; - - /** - * Creates a new DoubleValue instance using the specified properties. - * @function create - * @memberof google.protobuf.DoubleValue - * @static - * @param {google.protobuf.IDoubleValue=} [properties] Properties to set - * @returns {google.protobuf.DoubleValue} DoubleValue instance - */ - DoubleValue.create = function create(properties) { - return new DoubleValue(properties); - }; + this.imuln(pow); + if (this.words[0] + word < 0x4000000) { + this.words[0] += word; + } else { + this._iaddn(word); + } + } + }; - /** - * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DoubleValue - * @static - * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DoubleValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && message.hasOwnProperty("value")) - writer.uint32(/* id 1, wireType 1 =*/9).double(message.value); - return writer; - }; + BN.prototype.copy = function copy (dest) { + dest.words = new Array(this.length); + for (var i = 0; i < this.length; i++) { + dest.words[i] = this.words[i]; + } + dest.length = this.length; + dest.negative = this.negative; + dest.red = this.red; + }; - /** - * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DoubleValue - * @static - * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DoubleValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + BN.prototype.clone = function clone () { + var r = new BN(null); + this.copy(r); + return r; + }; - /** - * Decodes a DoubleValue message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DoubleValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DoubleValue} DoubleValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DoubleValue.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DoubleValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.value = reader.double(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + BN.prototype._expand = function _expand (size) { + while (this.length < size) { + this.words[this.length++] = 0; + } + return this; + }; - /** - * Decodes a DoubleValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DoubleValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DoubleValue} DoubleValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DoubleValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + // Remove leading `0` from `this` + BN.prototype.strip = function strip () { + while (this.length > 1 && this.words[this.length - 1] === 0) { + this.length--; + } + return this._normSign(); + }; - /** - * Verifies a DoubleValue message. - * @function verify - * @memberof google.protobuf.DoubleValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DoubleValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value !== "number") - return "value: number expected"; - return null; - }; + BN.prototype._normSign = function _normSign () { + // -0 = 0 + if (this.length === 1 && this.words[0] === 0) { + this.negative = 0; + } + return this; + }; - /** - * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DoubleValue - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DoubleValue} DoubleValue - */ - DoubleValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DoubleValue) - return object; - var message = new $root.google.protobuf.DoubleValue(); - if (object.value != null) - message.value = Number(object.value); - return message; - }; + BN.prototype.inspect = function inspect () { + return (this.red ? ''; + }; - /** - * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DoubleValue - * @static - * @param {google.protobuf.DoubleValue} message DoubleValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DoubleValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = 0; - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; - return object; - }; + /* - /** - * Converts this DoubleValue to JSON. - * @function toJSON - * @memberof google.protobuf.DoubleValue - * @instance - * @returns {Object.} JSON object - */ - DoubleValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + var zeros = []; + var groupSizes = []; + var groupBases = []; - return DoubleValue; - })(); - - protobuf.FloatValue = (function() { - - /** - * Properties of a FloatValue. - * @memberof google.protobuf - * @interface IFloatValue - * @property {number|null} [value] FloatValue value - */ - - /** - * Constructs a new FloatValue. - * @memberof google.protobuf - * @classdesc Represents a FloatValue. - * @implements IFloatValue - * @constructor - * @param {google.protobuf.IFloatValue=} [properties] Properties to set - */ - function FloatValue(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + var s = ''; + var i = -1; + while (++i < BN.wordSize) { + zeros[i] = s; + s += '0'; + } + groupSizes[0] = 0; + groupSizes[1] = 0; + groupBases[0] = 0; + groupBases[1] = 0; + var base = 2 - 1; + while (++base < 36 + 1) { + var groupSize = 0; + var groupBase = 1; + while (groupBase < (1 << BN.wordSize) / base) { + groupBase *= base; + groupSize += 1; + } + groupSizes[base] = groupSize; + groupBases[base] = groupBase; + } - /** - * FloatValue value. - * @member {number} value - * @memberof google.protobuf.FloatValue - * @instance - */ - FloatValue.prototype.value = 0; - - /** - * Creates a new FloatValue instance using the specified properties. - * @function create - * @memberof google.protobuf.FloatValue - * @static - * @param {google.protobuf.IFloatValue=} [properties] Properties to set - * @returns {google.protobuf.FloatValue} FloatValue instance - */ - FloatValue.create = function create(properties) { - return new FloatValue(properties); - }; + */ - /** - * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FloatValue - * @static - * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FloatValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && message.hasOwnProperty("value")) - writer.uint32(/* id 1, wireType 5 =*/13).float(message.value); - return writer; - }; + var zeros = [ + '', + '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' + ]; - /** - * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FloatValue - * @static - * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FloatValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + var groupSizes = [ + 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 + ]; - /** - * Decodes a FloatValue message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FloatValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FloatValue} FloatValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FloatValue.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FloatValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.value = reader.float(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + var groupBases = [ + 0, 0, + 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216, + 43046721, 10000000, 19487171, 35831808, 62748517, 7529536, 11390625, + 16777216, 24137569, 34012224, 47045881, 64000000, 4084101, 5153632, + 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149, + 24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176 + ]; - /** - * Decodes a FloatValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FloatValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FloatValue} FloatValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FloatValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + BN.prototype.toString = function toString (base, padding) { + base = base || 10; + padding = padding | 0 || 1; - /** - * Verifies a FloatValue message. - * @function verify - * @memberof google.protobuf.FloatValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FloatValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value !== "number") - return "value: number expected"; - return null; - }; + var out; + if (base === 16 || base === 'hex') { + out = ''; + var off = 0; + var carry = 0; + for (var i = 0; i < this.length; i++) { + var w = this.words[i]; + var word = (((w << off) | carry) & 0xffffff).toString(16); + carry = (w >>> (24 - off)) & 0xffffff; + if (carry !== 0 || i !== this.length - 1) { + out = zeros[6 - word.length] + word + out; + } else { + out = word + out; + } + off += 2; + if (off >= 26) { + off -= 26; + i--; + } + } + if (carry !== 0) { + out = carry.toString(16) + out; + } + while (out.length % padding !== 0) { + out = '0' + out; + } + if (this.negative !== 0) { + out = '-' + out; + } + return out; + } - /** - * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FloatValue - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FloatValue} FloatValue - */ - FloatValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FloatValue) - return object; - var message = new $root.google.protobuf.FloatValue(); - if (object.value != null) - message.value = Number(object.value); - return message; - }; + if (base === (base | 0) && base >= 2 && base <= 36) { + // var groupSize = Math.floor(BN.wordSize * Math.LN2 / Math.log(base)); + var groupSize = groupSizes[base]; + // var groupBase = Math.pow(base, groupSize); + var groupBase = groupBases[base]; + out = ''; + var c = this.clone(); + c.negative = 0; + while (!c.isZero()) { + var r = c.modn(groupBase).toString(base); + c = c.idivn(groupBase); - /** - * Creates a plain object from a FloatValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FloatValue - * @static - * @param {google.protobuf.FloatValue} message FloatValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FloatValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = 0; - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; - return object; - }; + if (!c.isZero()) { + out = zeros[groupSize - r.length] + r + out; + } else { + out = r + out; + } + } + if (this.isZero()) { + out = '0' + out; + } + while (out.length % padding !== 0) { + out = '0' + out; + } + if (this.negative !== 0) { + out = '-' + out; + } + return out; + } - /** - * Converts this FloatValue to JSON. - * @function toJSON - * @memberof google.protobuf.FloatValue - * @instance - * @returns {Object.} JSON object - */ - FloatValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + assert(false, 'Base should be between 2 and 36'); + }; - return FloatValue; - })(); - - protobuf.Int64Value = (function() { - - /** - * Properties of an Int64Value. - * @memberof google.protobuf - * @interface IInt64Value - * @property {number|Long|null} [value] Int64Value value - */ - - /** - * Constructs a new Int64Value. - * @memberof google.protobuf - * @classdesc Represents an Int64Value. - * @implements IInt64Value - * @constructor - * @param {google.protobuf.IInt64Value=} [properties] Properties to set - */ - function Int64Value(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Int64Value value. - * @member {number|Long} value - * @memberof google.protobuf.Int64Value - * @instance - */ - Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Creates a new Int64Value instance using the specified properties. - * @function create - * @memberof google.protobuf.Int64Value - * @static - * @param {google.protobuf.IInt64Value=} [properties] Properties to set - * @returns {google.protobuf.Int64Value} Int64Value instance - */ - Int64Value.create = function create(properties) { - return new Int64Value(properties); - }; - - /** - * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Int64Value - * @static - * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Int64Value.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && message.hasOwnProperty("value")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.value); - return writer; - }; + BN.prototype.toNumber = function toNumber () { + var ret = this.words[0]; + if (this.length === 2) { + ret += this.words[1] * 0x4000000; + } else if (this.length === 3 && this.words[2] === 0x01) { + // NOTE: at this stage it is known that the top bit is set + ret += 0x10000000000000 + (this.words[1] * 0x4000000); + } else if (this.length > 2) { + assert(false, 'Number can only safely store up to 53 bits'); + } + return (this.negative !== 0) ? -ret : ret; + }; - /** - * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Int64Value - * @static - * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Int64Value.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + BN.prototype.toJSON = function toJSON () { + return this.toString(16); + }; - /** - * Decodes an Int64Value message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Int64Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Int64Value} Int64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Int64Value.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int64Value(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.value = reader.int64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + BN.prototype.toBuffer = function toBuffer (endian, length) { + assert(typeof Buffer !== 'undefined'); + return this.toArrayLike(Buffer, endian, length); + }; - /** - * Decodes an Int64Value message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Int64Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Int64Value} Int64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Int64Value.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + BN.prototype.toArray = function toArray (endian, length) { + return this.toArrayLike(Array, endian, length); + }; - /** - * Verifies an Int64Value message. - * @function verify - * @memberof google.protobuf.Int64Value - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Int64Value.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) - return "value: integer|Long expected"; - return null; - }; + BN.prototype.toArrayLike = function toArrayLike (ArrayType, endian, length) { + var byteLength = this.byteLength(); + var reqLength = length || Math.max(1, byteLength); + assert(byteLength <= reqLength, 'byte array longer than desired length'); + assert(reqLength > 0, 'Requested array length <= 0'); - /** - * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Int64Value - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Int64Value} Int64Value - */ - Int64Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Int64Value) - return object; - var message = new $root.google.protobuf.Int64Value(); - if (object.value != null) - if ($util.Long) - (message.value = $util.Long.fromValue(object.value)).unsigned = false; - else if (typeof object.value === "string") - message.value = parseInt(object.value, 10); - else if (typeof object.value === "number") - message.value = object.value; - else if (typeof object.value === "object") - message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(); - return message; - }; + this.strip(); + var littleEndian = endian === 'le'; + var res = new ArrayType(reqLength); - /** - * Creates a plain object from an Int64Value message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Int64Value - * @static - * @param {google.protobuf.Int64Value} message Int64Value - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Int64Value.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.value = options.longs === String ? "0" : 0; - if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value === "number") - object.value = options.longs === String ? String(message.value) : message.value; - else - object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber() : message.value; - return object; - }; + var b, i; + var q = this.clone(); + if (!littleEndian) { + // Assume big-endian + for (i = 0; i < reqLength - byteLength; i++) { + res[i] = 0; + } - /** - * Converts this Int64Value to JSON. - * @function toJSON - * @memberof google.protobuf.Int64Value - * @instance - * @returns {Object.} JSON object - */ - Int64Value.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + for (i = 0; !q.isZero(); i++) { + b = q.andln(0xff); + q.iushrn(8); - return Int64Value; - })(); - - protobuf.UInt64Value = (function() { - - /** - * Properties of a UInt64Value. - * @memberof google.protobuf - * @interface IUInt64Value - * @property {number|Long|null} [value] UInt64Value value - */ - - /** - * Constructs a new UInt64Value. - * @memberof google.protobuf - * @classdesc Represents a UInt64Value. - * @implements IUInt64Value - * @constructor - * @param {google.protobuf.IUInt64Value=} [properties] Properties to set - */ - function UInt64Value(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + res[reqLength - i - 1] = b; + } + } else { + for (i = 0; !q.isZero(); i++) { + b = q.andln(0xff); + q.iushrn(8); - /** - * UInt64Value value. - * @member {number|Long} value - * @memberof google.protobuf.UInt64Value - * @instance - */ - UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Creates a new UInt64Value instance using the specified properties. - * @function create - * @memberof google.protobuf.UInt64Value - * @static - * @param {google.protobuf.IUInt64Value=} [properties] Properties to set - * @returns {google.protobuf.UInt64Value} UInt64Value instance - */ - UInt64Value.create = function create(properties) { - return new UInt64Value(properties); - }; + res[i] = b; + } - /** - * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UInt64Value - * @static - * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UInt64Value.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && message.hasOwnProperty("value")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.value); - return writer; - }; + for (; i < reqLength; i++) { + res[i] = 0; + } + } - /** - * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UInt64Value - * @static - * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UInt64Value.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + return res; + }; - /** - * Decodes a UInt64Value message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UInt64Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UInt64Value} UInt64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UInt64Value.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt64Value(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.value = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + if (Math.clz32) { + BN.prototype._countBits = function _countBits (w) { + return 32 - Math.clz32(w); + }; + } else { + BN.prototype._countBits = function _countBits (w) { + var t = w; + var r = 0; + if (t >= 0x1000) { + r += 13; + t >>>= 13; + } + if (t >= 0x40) { + r += 7; + t >>>= 7; + } + if (t >= 0x8) { + r += 4; + t >>>= 4; + } + if (t >= 0x02) { + r += 2; + t >>>= 2; + } + return r + t; + }; + } - /** - * Decodes a UInt64Value message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UInt64Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UInt64Value} UInt64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UInt64Value.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + BN.prototype._zeroBits = function _zeroBits (w) { + // Short-cut + if (w === 0) return 26; - /** - * Verifies a UInt64Value message. - * @function verify - * @memberof google.protobuf.UInt64Value - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UInt64Value.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) - return "value: integer|Long expected"; - return null; - }; + var t = w; + var r = 0; + if ((t & 0x1fff) === 0) { + r += 13; + t >>>= 13; + } + if ((t & 0x7f) === 0) { + r += 7; + t >>>= 7; + } + if ((t & 0xf) === 0) { + r += 4; + t >>>= 4; + } + if ((t & 0x3) === 0) { + r += 2; + t >>>= 2; + } + if ((t & 0x1) === 0) { + r++; + } + return r; + }; - /** - * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UInt64Value - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UInt64Value} UInt64Value - */ - UInt64Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UInt64Value) - return object; - var message = new $root.google.protobuf.UInt64Value(); - if (object.value != null) - if ($util.Long) - (message.value = $util.Long.fromValue(object.value)).unsigned = true; - else if (typeof object.value === "string") - message.value = parseInt(object.value, 10); - else if (typeof object.value === "number") - message.value = object.value; - else if (typeof object.value === "object") - message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(true); - return message; - }; + // Return number of used bits in a BN + BN.prototype.bitLength = function bitLength () { + var w = this.words[this.length - 1]; + var hi = this._countBits(w); + return (this.length - 1) * 26 + hi; + }; - /** - * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UInt64Value - * @static - * @param {google.protobuf.UInt64Value} message UInt64Value - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UInt64Value.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.value = options.longs === String ? "0" : 0; - if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value === "number") - object.value = options.longs === String ? String(message.value) : message.value; - else - object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber(true) : message.value; - return object; - }; + function toBitArray (num) { + var w = new Array(num.bitLength()); - /** - * Converts this UInt64Value to JSON. - * @function toJSON - * @memberof google.protobuf.UInt64Value - * @instance - * @returns {Object.} JSON object - */ - UInt64Value.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + for (var bit = 0; bit < w.length; bit++) { + var off = (bit / 26) | 0; + var wbit = bit % 26; - return UInt64Value; - })(); - - protobuf.Int32Value = (function() { - - /** - * Properties of an Int32Value. - * @memberof google.protobuf - * @interface IInt32Value - * @property {number|null} [value] Int32Value value - */ - - /** - * Constructs a new Int32Value. - * @memberof google.protobuf - * @classdesc Represents an Int32Value. - * @implements IInt32Value - * @constructor - * @param {google.protobuf.IInt32Value=} [properties] Properties to set - */ - function Int32Value(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + w[bit] = (num.words[off] & (1 << wbit)) >>> wbit; + } - /** - * Int32Value value. - * @member {number} value - * @memberof google.protobuf.Int32Value - * @instance - */ - Int32Value.prototype.value = 0; - - /** - * Creates a new Int32Value instance using the specified properties. - * @function create - * @memberof google.protobuf.Int32Value - * @static - * @param {google.protobuf.IInt32Value=} [properties] Properties to set - * @returns {google.protobuf.Int32Value} Int32Value instance - */ - Int32Value.create = function create(properties) { - return new Int32Value(properties); - }; + return w; + } - /** - * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Int32Value - * @static - * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Int32Value.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && message.hasOwnProperty("value")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.value); - return writer; - }; + // Number of trailing zero bits + BN.prototype.zeroBits = function zeroBits () { + if (this.isZero()) return 0; - /** - * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Int32Value - * @static - * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Int32Value.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + var r = 0; + for (var i = 0; i < this.length; i++) { + var b = this._zeroBits(this.words[i]); + r += b; + if (b !== 26) break; + } + return r; + }; - /** - * Decodes an Int32Value message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Int32Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Int32Value} Int32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Int32Value.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int32Value(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.value = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + BN.prototype.byteLength = function byteLength () { + return Math.ceil(this.bitLength() / 8); + }; - /** - * Decodes an Int32Value message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Int32Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Int32Value} Int32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Int32Value.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + BN.prototype.toTwos = function toTwos (width) { + if (this.negative !== 0) { + return this.abs().inotn(width).iaddn(1); + } + return this.clone(); + }; - /** - * Verifies an Int32Value message. - * @function verify - * @memberof google.protobuf.Int32Value - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Int32Value.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isInteger(message.value)) - return "value: integer expected"; - return null; - }; + BN.prototype.fromTwos = function fromTwos (width) { + if (this.testn(width - 1)) { + return this.notn(width).iaddn(1).ineg(); + } + return this.clone(); + }; - /** - * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Int32Value - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Int32Value} Int32Value - */ - Int32Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Int32Value) - return object; - var message = new $root.google.protobuf.Int32Value(); - if (object.value != null) - message.value = object.value | 0; - return message; - }; + BN.prototype.isNeg = function isNeg () { + return this.negative !== 0; + }; - /** - * Creates a plain object from an Int32Value message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Int32Value - * @static - * @param {google.protobuf.Int32Value} message Int32Value - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Int32Value.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = 0; - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - return object; - }; + // Return negative clone of `this` + BN.prototype.neg = function neg () { + return this.clone().ineg(); + }; - /** - * Converts this Int32Value to JSON. - * @function toJSON - * @memberof google.protobuf.Int32Value - * @instance - * @returns {Object.} JSON object - */ - Int32Value.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + BN.prototype.ineg = function ineg () { + if (!this.isZero()) { + this.negative ^= 1; + } - return Int32Value; - })(); - - protobuf.UInt32Value = (function() { - - /** - * Properties of a UInt32Value. - * @memberof google.protobuf - * @interface IUInt32Value - * @property {number|null} [value] UInt32Value value - */ - - /** - * Constructs a new UInt32Value. - * @memberof google.protobuf - * @classdesc Represents a UInt32Value. - * @implements IUInt32Value - * @constructor - * @param {google.protobuf.IUInt32Value=} [properties] Properties to set - */ - function UInt32Value(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + return this; + }; - /** - * UInt32Value value. - * @member {number} value - * @memberof google.protobuf.UInt32Value - * @instance - */ - UInt32Value.prototype.value = 0; - - /** - * Creates a new UInt32Value instance using the specified properties. - * @function create - * @memberof google.protobuf.UInt32Value - * @static - * @param {google.protobuf.IUInt32Value=} [properties] Properties to set - * @returns {google.protobuf.UInt32Value} UInt32Value instance - */ - UInt32Value.create = function create(properties) { - return new UInt32Value(properties); - }; + // Or `num` with `this` in-place + BN.prototype.iuor = function iuor (num) { + while (this.length < num.length) { + this.words[this.length++] = 0; + } - /** - * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UInt32Value - * @static - * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UInt32Value.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && message.hasOwnProperty("value")) - writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.value); - return writer; - }; + for (var i = 0; i < num.length; i++) { + this.words[i] = this.words[i] | num.words[i]; + } - /** - * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UInt32Value - * @static - * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UInt32Value.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + return this.strip(); + }; - /** - * Decodes a UInt32Value message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UInt32Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UInt32Value} UInt32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UInt32Value.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt32Value(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.value = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + BN.prototype.ior = function ior (num) { + assert((this.negative | num.negative) === 0); + return this.iuor(num); + }; - /** - * Decodes a UInt32Value message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UInt32Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UInt32Value} UInt32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UInt32Value.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + // Or `num` with `this` + BN.prototype.or = function or (num) { + if (this.length > num.length) return this.clone().ior(num); + return num.clone().ior(this); + }; - /** - * Verifies a UInt32Value message. - * @function verify - * @memberof google.protobuf.UInt32Value - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UInt32Value.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isInteger(message.value)) - return "value: integer expected"; - return null; - }; + BN.prototype.uor = function uor (num) { + if (this.length > num.length) return this.clone().iuor(num); + return num.clone().iuor(this); + }; - /** - * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UInt32Value - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UInt32Value} UInt32Value - */ - UInt32Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UInt32Value) - return object; - var message = new $root.google.protobuf.UInt32Value(); - if (object.value != null) - message.value = object.value >>> 0; - return message; - }; + // And `num` with `this` in-place + BN.prototype.iuand = function iuand (num) { + // b = min-length(num, this) + var b; + if (this.length > num.length) { + b = num; + } else { + b = this; + } - /** - * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UInt32Value - * @static - * @param {google.protobuf.UInt32Value} message UInt32Value - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UInt32Value.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = 0; - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - return object; - }; + for (var i = 0; i < b.length; i++) { + this.words[i] = this.words[i] & num.words[i]; + } - /** - * Converts this UInt32Value to JSON. - * @function toJSON - * @memberof google.protobuf.UInt32Value - * @instance - * @returns {Object.} JSON object - */ - UInt32Value.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + this.length = b.length; - return UInt32Value; - })(); - - protobuf.BoolValue = (function() { - - /** - * Properties of a BoolValue. - * @memberof google.protobuf - * @interface IBoolValue - * @property {boolean|null} [value] BoolValue value - */ - - /** - * Constructs a new BoolValue. - * @memberof google.protobuf - * @classdesc Represents a BoolValue. - * @implements IBoolValue - * @constructor - * @param {google.protobuf.IBoolValue=} [properties] Properties to set - */ - function BoolValue(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + return this.strip(); + }; - /** - * BoolValue value. - * @member {boolean} value - * @memberof google.protobuf.BoolValue - * @instance - */ - BoolValue.prototype.value = false; - - /** - * Creates a new BoolValue instance using the specified properties. - * @function create - * @memberof google.protobuf.BoolValue - * @static - * @param {google.protobuf.IBoolValue=} [properties] Properties to set - * @returns {google.protobuf.BoolValue} BoolValue instance - */ - BoolValue.create = function create(properties) { - return new BoolValue(properties); - }; + BN.prototype.iand = function iand (num) { + assert((this.negative | num.negative) === 0); + return this.iuand(num); + }; - /** - * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. - * @function encode - * @memberof google.protobuf.BoolValue - * @static - * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BoolValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && message.hasOwnProperty("value")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.value); - return writer; - }; + // And `num` with `this` + BN.prototype.and = function and (num) { + if (this.length > num.length) return this.clone().iand(num); + return num.clone().iand(this); + }; - /** - * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.BoolValue - * @static - * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BoolValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + BN.prototype.uand = function uand (num) { + if (this.length > num.length) return this.clone().iuand(num); + return num.clone().iuand(this); + }; - /** - * Decodes a BoolValue message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.BoolValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.BoolValue} BoolValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BoolValue.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BoolValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.value = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + // Xor `num` with `this` in-place + BN.prototype.iuxor = function iuxor (num) { + // a.length > b.length + var a; + var b; + if (this.length > num.length) { + a = this; + b = num; + } else { + a = num; + b = this; + } - /** - * Decodes a BoolValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.BoolValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.BoolValue} BoolValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BoolValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + for (var i = 0; i < b.length; i++) { + this.words[i] = a.words[i] ^ b.words[i]; + } - /** - * Verifies a BoolValue message. - * @function verify - * @memberof google.protobuf.BoolValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BoolValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value !== "boolean") - return "value: boolean expected"; - return null; - }; + if (this !== a) { + for (; i < a.length; i++) { + this.words[i] = a.words[i]; + } + } - /** - * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.BoolValue - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.BoolValue} BoolValue - */ - BoolValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.BoolValue) - return object; - var message = new $root.google.protobuf.BoolValue(); - if (object.value != null) - message.value = Boolean(object.value); - return message; - }; + this.length = a.length; - /** - * Creates a plain object from a BoolValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.BoolValue - * @static - * @param {google.protobuf.BoolValue} message BoolValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BoolValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = false; - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - return object; - }; + return this.strip(); + }; - /** - * Converts this BoolValue to JSON. - * @function toJSON - * @memberof google.protobuf.BoolValue - * @instance - * @returns {Object.} JSON object - */ - BoolValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + BN.prototype.ixor = function ixor (num) { + assert((this.negative | num.negative) === 0); + return this.iuxor(num); + }; - return BoolValue; - })(); - - protobuf.StringValue = (function() { - - /** - * Properties of a StringValue. - * @memberof google.protobuf - * @interface IStringValue - * @property {string|null} [value] StringValue value - */ - - /** - * Constructs a new StringValue. - * @memberof google.protobuf - * @classdesc Represents a StringValue. - * @implements IStringValue - * @constructor - * @param {google.protobuf.IStringValue=} [properties] Properties to set - */ - function StringValue(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + // Xor `num` with `this` + BN.prototype.xor = function xor (num) { + if (this.length > num.length) return this.clone().ixor(num); + return num.clone().ixor(this); + }; - /** - * StringValue value. - * @member {string} value - * @memberof google.protobuf.StringValue - * @instance - */ - StringValue.prototype.value = ""; - - /** - * Creates a new StringValue instance using the specified properties. - * @function create - * @memberof google.protobuf.StringValue - * @static - * @param {google.protobuf.IStringValue=} [properties] Properties to set - * @returns {google.protobuf.StringValue} StringValue instance - */ - StringValue.create = function create(properties) { - return new StringValue(properties); - }; + BN.prototype.uxor = function uxor (num) { + if (this.length > num.length) return this.clone().iuxor(num); + return num.clone().iuxor(this); + }; - /** - * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. - * @function encode - * @memberof google.protobuf.StringValue - * @static - * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StringValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && message.hasOwnProperty("value")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); - return writer; - }; + // Not ``this`` with ``width`` bitwidth + BN.prototype.inotn = function inotn (width) { + assert(typeof width === 'number' && width >= 0); - /** - * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.StringValue - * @static - * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StringValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + var bytesNeeded = Math.ceil(width / 26) | 0; + var bitsLeft = width % 26; - /** - * Decodes a StringValue message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.StringValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.StringValue} StringValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StringValue.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.StringValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.value = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + // Extend the buffer with leading zeroes + this._expand(bytesNeeded); - /** - * Decodes a StringValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.StringValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.StringValue} StringValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StringValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + if (bitsLeft > 0) { + bytesNeeded--; + } - /** - * Verifies a StringValue message. - * @function verify - * @memberof google.protobuf.StringValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StringValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isString(message.value)) - return "value: string expected"; - return null; - }; + // Handle complete words + for (var i = 0; i < bytesNeeded; i++) { + this.words[i] = ~this.words[i] & 0x3ffffff; + } - /** - * Creates a StringValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.StringValue - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.StringValue} StringValue - */ - StringValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.StringValue) - return object; - var message = new $root.google.protobuf.StringValue(); - if (object.value != null) - message.value = String(object.value); - return message; - }; + // Handle the residue + if (bitsLeft > 0) { + this.words[i] = ~this.words[i] & (0x3ffffff >> (26 - bitsLeft)); + } - /** - * Creates a plain object from a StringValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.StringValue - * @static - * @param {google.protobuf.StringValue} message StringValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StringValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = ""; - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - return object; - }; + // And remove leading zeroes + return this.strip(); + }; - /** - * Converts this StringValue to JSON. - * @function toJSON - * @memberof google.protobuf.StringValue - * @instance - * @returns {Object.} JSON object - */ - StringValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + BN.prototype.notn = function notn (width) { + return this.clone().inotn(width); + }; - return StringValue; - })(); - - protobuf.BytesValue = (function() { - - /** - * Properties of a BytesValue. - * @memberof google.protobuf - * @interface IBytesValue - * @property {Uint8Array|null} [value] BytesValue value - */ - - /** - * Constructs a new BytesValue. - * @memberof google.protobuf - * @classdesc Represents a BytesValue. - * @implements IBytesValue - * @constructor - * @param {google.protobuf.IBytesValue=} [properties] Properties to set - */ - function BytesValue(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + // Set `bit` of `this` + BN.prototype.setn = function setn (bit, val) { + assert(typeof bit === 'number' && bit >= 0); - /** - * BytesValue value. - * @member {Uint8Array} value - * @memberof google.protobuf.BytesValue - * @instance - */ - BytesValue.prototype.value = $util.newBuffer([]); - - /** - * Creates a new BytesValue instance using the specified properties. - * @function create - * @memberof google.protobuf.BytesValue - * @static - * @param {google.protobuf.IBytesValue=} [properties] Properties to set - * @returns {google.protobuf.BytesValue} BytesValue instance - */ - BytesValue.create = function create(properties) { - return new BytesValue(properties); - }; + var off = (bit / 26) | 0; + var wbit = bit % 26; - /** - * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. - * @function encode - * @memberof google.protobuf.BytesValue - * @static - * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BytesValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && message.hasOwnProperty("value")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.value); - return writer; - }; + this._expand(off + 1); - /** - * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.BytesValue - * @static - * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BytesValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + if (val) { + this.words[off] = this.words[off] | (1 << wbit); + } else { + this.words[off] = this.words[off] & ~(1 << wbit); + } - /** - * Decodes a BytesValue message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.BytesValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.BytesValue} BytesValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BytesValue.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BytesValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.value = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + return this.strip(); + }; - /** - * Decodes a BytesValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.BytesValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.BytesValue} BytesValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BytesValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + // Add `num` to `this` in-place + BN.prototype.iadd = function iadd (num) { + var r; - /** - * Verifies a BytesValue message. - * @function verify - * @memberof google.protobuf.BytesValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BytesValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) - return "value: buffer expected"; - return null; - }; + // negative + positive + if (this.negative !== 0 && num.negative === 0) { + this.negative = 0; + r = this.isub(num); + this.negative ^= 1; + return this._normSign(); - /** - * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.BytesValue - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.BytesValue} BytesValue - */ - BytesValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.BytesValue) - return object; - var message = new $root.google.protobuf.BytesValue(); - if (object.value != null) - if (typeof object.value === "string") - $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); - else if (object.value.length) - message.value = object.value; - return message; - }; + // positive + negative + } else if (this.negative === 0 && num.negative !== 0) { + num.negative = 0; + r = this.isub(num); + num.negative = 1; + return r._normSign(); + } - /** - * Creates a plain object from a BytesValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.BytesValue - * @static - * @param {google.protobuf.BytesValue} message BytesValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BytesValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if (options.bytes === String) - object.value = ""; - else { - object.value = []; - if (options.bytes !== Array) - object.value = $util.newBuffer(object.value); - } - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; - return object; - }; + // a.length > b.length + var a, b; + if (this.length > num.length) { + a = this; + b = num; + } else { + a = num; + b = this; + } - /** - * Converts this BytesValue to JSON. - * @function toJSON - * @memberof google.protobuf.BytesValue - * @instance - * @returns {Object.} JSON object - */ - BytesValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + var carry = 0; + for (var i = 0; i < b.length; i++) { + r = (a.words[i] | 0) + (b.words[i] | 0) + carry; + this.words[i] = r & 0x3ffffff; + carry = r >>> 26; + } + for (; carry !== 0 && i < a.length; i++) { + r = (a.words[i] | 0) + carry; + this.words[i] = r & 0x3ffffff; + carry = r >>> 26; + } - return BytesValue; - })(); + this.length = a.length; + if (carry !== 0) { + this.words[this.length] = carry; + this.length++; + // Copy the rest of the words + } else if (a !== this) { + for (; i < a.length; i++) { + this.words[i] = a.words[i]; + } + } - return protobuf; - })(); + return this; + }; - return google; -})(); + // Add `num` to `this` + BN.prototype.add = function add (num) { + var res; + if (num.negative !== 0 && this.negative === 0) { + num.negative = 0; + res = this.sub(num); + num.negative ^= 1; + return res; + } else if (num.negative === 0 && this.negative !== 0) { + this.negative = 0; + res = num.sub(this); + this.negative = 1; + return res; + } -$root.AccessKey = (function() { + if (this.length > num.length) return this.clone().iadd(num); - /** - * Properties of an AccessKey. - * @exports IAccessKey - * @interface IAccessKey - * @property {IUint128|null} [amount] AccessKey amount - * @property {google.protobuf.IStringValue|null} [balanceOwner] AccessKey balanceOwner - * @property {google.protobuf.IStringValue|null} [contractId] AccessKey contractId - * @property {google.protobuf.IBytesValue|null} [methodName] AccessKey methodName - */ + return num.clone().iadd(this); + }; - /** - * Constructs a new AccessKey. - * @exports AccessKey - * @classdesc Represents an AccessKey. - * @implements IAccessKey - * @constructor - * @param {IAccessKey=} [properties] Properties to set - */ - function AccessKey(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + // Subtract `num` from `this` in-place + BN.prototype.isub = function isub (num) { + // this - (-num) = this + num + if (num.negative !== 0) { + num.negative = 0; + var r = this.iadd(num); + num.negative = 1; + return r._normSign(); + + // -this - num = -(this + num) + } else if (this.negative !== 0) { + this.negative = 0; + this.iadd(num); + this.negative = 1; + return this._normSign(); } - /** - * AccessKey amount. - * @member {IUint128|null|undefined} amount - * @memberof AccessKey - * @instance - */ - AccessKey.prototype.amount = null; + // At this point both numbers are positive + var cmp = this.cmp(num); - /** - * AccessKey balanceOwner. - * @member {google.protobuf.IStringValue|null|undefined} balanceOwner - * @memberof AccessKey - * @instance - */ - AccessKey.prototype.balanceOwner = null; + // Optimization - zeroify + if (cmp === 0) { + this.negative = 0; + this.length = 1; + this.words[0] = 0; + return this; + } - /** - * AccessKey contractId. - * @member {google.protobuf.IStringValue|null|undefined} contractId - * @memberof AccessKey - * @instance - */ - AccessKey.prototype.contractId = null; + // a > b + var a, b; + if (cmp > 0) { + a = this; + b = num; + } else { + a = num; + b = this; + } - /** - * AccessKey methodName. - * @member {google.protobuf.IBytesValue|null|undefined} methodName - * @memberof AccessKey - * @instance - */ - AccessKey.prototype.methodName = null; + var carry = 0; + for (var i = 0; i < b.length; i++) { + r = (a.words[i] | 0) - (b.words[i] | 0) + carry; + carry = r >> 26; + this.words[i] = r & 0x3ffffff; + } + for (; carry !== 0 && i < a.length; i++) { + r = (a.words[i] | 0) + carry; + carry = r >> 26; + this.words[i] = r & 0x3ffffff; + } - /** - * Creates a new AccessKey instance using the specified properties. - * @function create - * @memberof AccessKey - * @static - * @param {IAccessKey=} [properties] Properties to set - * @returns {AccessKey} AccessKey instance - */ - AccessKey.create = function create(properties) { - return new AccessKey(properties); - }; + // Copy rest of the words + if (carry === 0 && i < a.length && a !== this) { + for (; i < a.length; i++) { + this.words[i] = a.words[i]; + } + } - /** - * Encodes the specified AccessKey message. Does not implicitly {@link AccessKey.verify|verify} messages. - * @function encode - * @memberof AccessKey - * @static - * @param {IAccessKey} message AccessKey message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AccessKey.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.amount != null && message.hasOwnProperty("amount")) - $root.Uint128.encode(message.amount, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.balanceOwner != null && message.hasOwnProperty("balanceOwner")) - $root.google.protobuf.StringValue.encode(message.balanceOwner, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.contractId != null && message.hasOwnProperty("contractId")) - $root.google.protobuf.StringValue.encode(message.contractId, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.methodName != null && message.hasOwnProperty("methodName")) - $root.google.protobuf.BytesValue.encode(message.methodName, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; + this.length = Math.max(this.length, i); - /** - * Encodes the specified AccessKey message, length delimited. Does not implicitly {@link AccessKey.verify|verify} messages. - * @function encodeDelimited - * @memberof AccessKey - * @static - * @param {IAccessKey} message AccessKey message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AccessKey.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AccessKey message from the specified reader or buffer. - * @function decode - * @memberof AccessKey - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {AccessKey} AccessKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AccessKey.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.AccessKey(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.amount = $root.Uint128.decode(reader, reader.uint32()); - break; - case 2: - message.balanceOwner = $root.google.protobuf.StringValue.decode(reader, reader.uint32()); - break; - case 3: - message.contractId = $root.google.protobuf.StringValue.decode(reader, reader.uint32()); - break; - case 4: - message.methodName = $root.google.protobuf.BytesValue.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AccessKey message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof AccessKey - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {AccessKey} AccessKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AccessKey.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AccessKey message. - * @function verify - * @memberof AccessKey - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AccessKey.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.amount != null && message.hasOwnProperty("amount")) { - var error = $root.Uint128.verify(message.amount); - if (error) - return "amount." + error; - } - if (message.balanceOwner != null && message.hasOwnProperty("balanceOwner")) { - var error = $root.google.protobuf.StringValue.verify(message.balanceOwner); - if (error) - return "balanceOwner." + error; - } - if (message.contractId != null && message.hasOwnProperty("contractId")) { - var error = $root.google.protobuf.StringValue.verify(message.contractId); - if (error) - return "contractId." + error; - } - if (message.methodName != null && message.hasOwnProperty("methodName")) { - var error = $root.google.protobuf.BytesValue.verify(message.methodName); - if (error) - return "methodName." + error; - } - return null; - }; - - /** - * Creates an AccessKey message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof AccessKey - * @static - * @param {Object.} object Plain object - * @returns {AccessKey} AccessKey - */ - AccessKey.fromObject = function fromObject(object) { - if (object instanceof $root.AccessKey) - return object; - var message = new $root.AccessKey(); - if (object.amount != null) { - if (typeof object.amount !== "object") - throw TypeError(".AccessKey.amount: object expected"); - message.amount = $root.Uint128.fromObject(object.amount); - } - if (object.balanceOwner != null) { - if (typeof object.balanceOwner !== "object") - throw TypeError(".AccessKey.balanceOwner: object expected"); - message.balanceOwner = $root.google.protobuf.StringValue.fromObject(object.balanceOwner); - } - if (object.contractId != null) { - if (typeof object.contractId !== "object") - throw TypeError(".AccessKey.contractId: object expected"); - message.contractId = $root.google.protobuf.StringValue.fromObject(object.contractId); - } - if (object.methodName != null) { - if (typeof object.methodName !== "object") - throw TypeError(".AccessKey.methodName: object expected"); - message.methodName = $root.google.protobuf.BytesValue.fromObject(object.methodName); - } - return message; - }; - - /** - * Creates a plain object from an AccessKey message. Also converts values to other types if specified. - * @function toObject - * @memberof AccessKey - * @static - * @param {AccessKey} message AccessKey - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AccessKey.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.amount = null; - object.balanceOwner = null; - object.contractId = null; - object.methodName = null; - } - if (message.amount != null && message.hasOwnProperty("amount")) - object.amount = $root.Uint128.toObject(message.amount, options); - if (message.balanceOwner != null && message.hasOwnProperty("balanceOwner")) - object.balanceOwner = $root.google.protobuf.StringValue.toObject(message.balanceOwner, options); - if (message.contractId != null && message.hasOwnProperty("contractId")) - object.contractId = $root.google.protobuf.StringValue.toObject(message.contractId, options); - if (message.methodName != null && message.hasOwnProperty("methodName")) - object.methodName = $root.google.protobuf.BytesValue.toObject(message.methodName, options); - return object; - }; - - /** - * Converts this AccessKey to JSON. - * @function toJSON - * @memberof AccessKey - * @instance - * @returns {Object.} JSON object - */ - AccessKey.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return AccessKey; -})(); - -$root.Uint128 = (function() { - - /** - * Properties of an Uint128. - * @exports IUint128 - * @interface IUint128 - * @property {Uint8Array|null} [number] Uint128 number - */ - - /** - * Constructs a new Uint128. - * @exports Uint128 - * @classdesc Provides container for unsigned 128 bit integers. - * @implements IUint128 - * @constructor - * @param {IUint128=} [properties] Properties to set - */ - function Uint128(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Uint128 number. - * @member {Uint8Array} number - * @memberof Uint128 - * @instance - */ - Uint128.prototype.number = $util.newBuffer([]); - - /** - * Creates a new Uint128 instance using the specified properties. - * @function create - * @memberof Uint128 - * @static - * @param {IUint128=} [properties] Properties to set - * @returns {Uint128} Uint128 instance - */ - Uint128.create = function create(properties) { - return new Uint128(properties); - }; - - /** - * Encodes the specified Uint128 message. Does not implicitly {@link Uint128.verify|verify} messages. - * @function encode - * @memberof Uint128 - * @static - * @param {IUint128} message Uint128 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Uint128.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.number != null && message.hasOwnProperty("number")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.number); - return writer; - }; - - /** - * Encodes the specified Uint128 message, length delimited. Does not implicitly {@link Uint128.verify|verify} messages. - * @function encodeDelimited - * @memberof Uint128 - * @static - * @param {IUint128} message Uint128 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Uint128.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Uint128 message from the specified reader or buffer. - * @function decode - * @memberof Uint128 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {Uint128} Uint128 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Uint128.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Uint128(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.number = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Uint128 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof Uint128 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {Uint128} Uint128 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Uint128.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Uint128 message. - * @function verify - * @memberof Uint128 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Uint128.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!(message.number && typeof message.number.length === "number" || $util.isString(message.number))) - return "number: buffer expected"; - return null; - }; - - /** - * Creates an Uint128 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof Uint128 - * @static - * @param {Object.} object Plain object - * @returns {Uint128} Uint128 - */ - Uint128.fromObject = function fromObject(object) { - if (object instanceof $root.Uint128) - return object; - var message = new $root.Uint128(); - if (object.number != null) - if (typeof object.number === "string") - $util.base64.decode(object.number, message.number = $util.newBuffer($util.base64.length(object.number)), 0); - else if (object.number.length) - message.number = object.number; - return message; - }; - - /** - * Creates a plain object from an Uint128 message. Also converts values to other types if specified. - * @function toObject - * @memberof Uint128 - * @static - * @param {Uint128} message Uint128 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Uint128.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if (options.bytes === String) - object.number = ""; - else { - object.number = []; - if (options.bytes !== Array) - object.number = $util.newBuffer(object.number); - } - if (message.number != null && message.hasOwnProperty("number")) - object.number = options.bytes === String ? $util.base64.encode(message.number, 0, message.number.length) : options.bytes === Array ? Array.prototype.slice.call(message.number) : message.number; - return object; - }; - - /** - * Converts this Uint128 to JSON. - * @function toJSON - * @memberof Uint128 - * @instance - * @returns {Object.} JSON object - */ - Uint128.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Uint128; -})(); - -module.exports = $root; - -},{"protobufjs/minimal":64}],15:[function(require,module,exports){ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const provider_1 = require("./provider"); -exports.Provider = provider_1.Provider; -exports.getTransactionLastResult = provider_1.getTransactionLastResult; -const json_rpc_provider_1 = require("./json-rpc-provider"); -exports.JsonRpcProvider = json_rpc_provider_1.JsonRpcProvider; - -},{"./json-rpc-provider":16,"./provider":17}],16:[function(require,module,exports){ -(function (Buffer){ -'use strict'; -Object.defineProperty(exports, "__esModule", { value: true }); -const provider_1 = require("./provider"); -const web_1 = require("../utils/web"); -const serialize_1 = require("../utils/serialize"); -const protos_1 = require("../protos"); -/// Keep ids unique across all connections. -let _nextId = 123; -class JsonRpcProvider extends provider_1.Provider { - constructor(url, network) { - super(); - // TODO: resolve network to url... - this.connection = { url }; - } - async getNetwork() { - return { - name: 'test', - chainId: 'test' - }; - } - async status() { - return this.sendJsonRpc('status', []); - } - async sendTransaction(signedTransaction) { - const bytes = protos_1.SignedTransaction.encode(signedTransaction).finish(); - return this.sendJsonRpc('broadcast_tx_commit', [Buffer.from(bytes).toString('base64')]); - } - async txStatus(txHash) { - return this.sendJsonRpc('tx', [serialize_1.base_encode(txHash)]); - } - async query(path, data) { - const result = await this.sendJsonRpc('query', [path, data]); - if (result.error) { - throw new Error(`Quering ${path} failed: ${result.error}.\n${JSON.stringify(result, null, 2)}`); - } - return result; - } - async block(height) { - return this.sendJsonRpc('block', [height]); - } - async sendJsonRpc(method, params) { - const request = { - method, - params, - id: (_nextId++), - jsonrpc: '2.0' - }; - const result = await web_1.fetchJson(this.connection, JSON.stringify(request)); - if (result.error) { - throw new Error(`[${result.error.code}] ${result.error.message}: ${result.error.data}`); - } - return result.result; - } -} -exports.JsonRpcProvider = JsonRpcProvider; - -}).call(this,require("buffer").Buffer) -},{"../protos":14,"../utils/serialize":23,"../utils/web":24,"./provider":17,"buffer":39}],17:[function(require,module,exports){ -(function (Buffer){ -'use strict'; -Object.defineProperty(exports, "__esModule", { value: true }); -var FinalTransactionStatus; -(function (FinalTransactionStatus) { - FinalTransactionStatus["Unknown"] = "Unknown"; - FinalTransactionStatus["Started"] = "Started"; - FinalTransactionStatus["Failed"] = "Failed"; - FinalTransactionStatus["Completed"] = "Completed"; -})(FinalTransactionStatus = exports.FinalTransactionStatus || (exports.FinalTransactionStatus = {})); -class Provider { -} -exports.Provider = Provider; -function getTransactionLastResult(txResult) { - for (let i = txResult.logs.length - 1; i >= 0; --i) { - const r = txResult.logs[i]; - if (r.result && r.result.length > 0) { - return JSON.parse(Buffer.from(r.result).toString()); - } - } - return null; -} -exports.getTransactionLastResult = getTransactionLastResult; - -}).call(this,require("buffer").Buffer) -},{"buffer":39}],18:[function(require,module,exports){ -'use strict'; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const js_sha256_1 = __importDefault(require("js-sha256")); -const key_pair_1 = require("./utils/key_pair"); -/** - * General signing interface, can be used for in memory signing, RPC singing, external wallet, HSM, etc. - */ -class Signer { - /** - * Signs given message, by first hashing with sha256. - * @param message message to sign. - * @param accountId accountId to use for signing. - * @param networkId network for this accontId. - */ - async signMessage(message, accountId, networkId) { - return this.signHash(new Uint8Array(js_sha256_1.default.sha256.array(message)), accountId, networkId); - } -} -exports.Signer = Signer; -/** - * Signs using in memory key store. - */ -class InMemorySigner extends Signer { - constructor(keyStore) { - super(); - this.keyStore = keyStore; - } - async createKey(accountId, networkId) { - const keyPair = key_pair_1.KeyPair.fromRandom('ed25519'); - await this.keyStore.setKey(networkId, accountId, keyPair); - return keyPair.getPublicKey(); - } - async getPublicKey(accountId, networkId) { - const keyPair = await this.keyStore.getKey(networkId, accountId); - return keyPair.getPublicKey(); - } - async signHash(hash, accountId, networkId) { - if (!accountId) { - throw new Error('InMemorySigner requires provided account id'); - } - const keyPair = await this.keyStore.getKey(networkId, accountId); - if (keyPair === null) { - throw new Error(`Key for ${accountId} not found in ${networkId}`); - } - return keyPair.sign(hash); - } -} -exports.InMemorySigner = InMemorySigner; - -},{"./utils/key_pair":21,"js-sha256":58}],19:[function(require,module,exports){ -(function (Buffer){ -'use strict'; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const js_sha256_1 = __importDefault(require("js-sha256")); -const bn_js_1 = __importDefault(require("bn.js")); -const protos_1 = require("./protos"); -const serialize_1 = require("./utils/serialize"); -const TRANSACTION_FIELD_MAP = new Map([ - [protos_1.CreateAccountTransaction, 'createAccount'], - [protos_1.DeployContractTransaction, 'deployContract'], - [protos_1.FunctionCallTransaction, 'functionCall'], - [protos_1.SendMoneyTransaction, 'sendMoney'], - [protos_1.StakeTransaction, 'stake'], - [protos_1.SwapKeyTransaction, 'swapKey'], - [protos_1.AddKeyTransaction, 'addKey'], - [protos_1.DeleteKeyTransaction, 'deleteKey'], -]); -function bigInt(num) { - const number = new Uint8Array(new bn_js_1.default(num).toArray('le', 16)); - return new protos_1.Uint128({ number }); -} -function bignumHex2Dec(num) { - return new bn_js_1.default(num, 16).toString(10); -} -exports.bignumHex2Dec = bignumHex2Dec; -function createAccount(nonce, originator, newAccountId, publicKey, amount) { - return new protos_1.CreateAccountTransaction({ nonce, originator, newAccountId, publicKey: serialize_1.base_decode(publicKey), amount: bigInt(amount) }); -} -exports.createAccount = createAccount; -function deployContract(nonce, contractId, wasmByteArray) { - return new protos_1.DeployContractTransaction({ nonce, contractId, wasmByteArray }); -} -exports.deployContract = deployContract; -function functionCall(nonce, originator, contractId, methodName, args, amount) { - return new protos_1.FunctionCallTransaction({ nonce, originator, contractId, methodName: Buffer.from(methodName), args, amount: bigInt(amount) }); -} -exports.functionCall = functionCall; -function sendMoney(nonce, originator, receiver, amount) { - return new protos_1.SendMoneyTransaction({ nonce, originator, receiver, amount: bigInt(amount) }); -} -exports.sendMoney = sendMoney; -function stake(nonce, originator, amount, publicKey) { - return new protos_1.StakeTransaction({ nonce, originator, amount: bigInt(amount), publicKey, blsPublicKey: null }); -} -exports.stake = stake; -function swapKey(nonce, originator, curKey, newKey) { - return new protos_1.SwapKeyTransaction({ nonce, originator, curKey: serialize_1.base_decode(curKey), newKey: serialize_1.base_decode(newKey) }); -} -exports.swapKey = swapKey; -function createAccessKey(contractId, methodName, balanceOwner, amount) { - return new protos_1.AccessKey({ - contractId: contractId ? new protos_1.google.protobuf.StringValue({ value: contractId }) : null, - methodName: methodName ? new protos_1.google.protobuf.BytesValue({ value: Buffer.from(methodName) }) : null, - balanceOwner: balanceOwner ? new protos_1.google.protobuf.StringValue({ value: balanceOwner }) : null, - amount: bigInt(amount || new bn_js_1.default(0)), - }); -} -exports.createAccessKey = createAccessKey; -function addKey(nonce, originator, newKey, accessKey) { - return new protos_1.AddKeyTransaction({ nonce, originator, newKey: serialize_1.base_decode(newKey), accessKey }); -} -exports.addKey = addKey; -function deleteKey(nonce, originator, curKey) { - return new protos_1.DeleteKeyTransaction({ nonce, originator, curKey: serialize_1.base_decode(curKey) }); -} -exports.deleteKey = deleteKey; -function signedTransaction(transaction, signature) { - const fieldName = TRANSACTION_FIELD_MAP.get(transaction.constructor); - return new protos_1.SignedTransaction({ - signature: signature.signature, - publicKey: protos_1.google.protobuf.BytesValue.create({ value: serialize_1.base_decode(signature.publicKey) }), - [fieldName]: transaction, - }); -} -exports.signedTransaction = signedTransaction; -async function signTransaction(signer, transaction, accountId, networkId) { - const protoClass = transaction.constructor; - const message = protoClass.encode(transaction).finish(); - const hash = new Uint8Array(js_sha256_1.default.sha256.array(message)); - const signature = await signer.signHash(hash, accountId, networkId); - return [hash, signedTransaction(transaction, signature)]; -} -exports.signTransaction = signTransaction; - -}).call(this,require("buffer").Buffer) -},{"./protos":14,"./utils/serialize":23,"bn.js":35,"buffer":39,"js-sha256":58}],20:[function(require,module,exports){ -"use strict"; -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; - result["default"] = mod; - return result; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const key_pair = __importStar(require("./key_pair")); -exports.key_pair = key_pair; -const network = __importStar(require("./network")); -exports.network = network; -const serialize = __importStar(require("./serialize")); -exports.serialize = serialize; -const web = __importStar(require("./web")); -exports.web = web; -const key_pair_1 = require("./key_pair"); -exports.KeyPair = key_pair_1.KeyPair; -exports.KeyPairEd25519 = key_pair_1.KeyPairEd25519; - -},{"./key_pair":21,"./network":22,"./serialize":23,"./web":24}],21:[function(require,module,exports){ -'use strict'; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const tweetnacl_1 = __importDefault(require("tweetnacl")); -const serialize_1 = require("./serialize"); -class KeyPair { - static fromRandom(curve) { - switch (curve) { - case 'ed25519': return KeyPairEd25519.fromRandom(); - default: throw new Error(`Unknown curve ${curve}`); - } - } - static fromString(encodedKey) { - const parts = encodedKey.split(':'); - if (parts.length !== 2) { - throw new Error('Invalid encoded key format, must be :'); - } - switch (parts[0]) { - case 'ed25519': return new KeyPairEd25519(parts[1]); - default: throw new Error(`Unknown curve: ${parts[0]}`); - } - } -} -exports.KeyPair = KeyPair; -/** - * This class provides key pair functionality for Ed25519 curve: - * generating key pairs, encoding key pairs, signing and verifying. - */ -class KeyPairEd25519 extends KeyPair { - /** - * Construct an instance of key pair given a secret key. - * It's generally assumed that these are encoded in base58. - * @param {string} secretKey - */ - constructor(secretKey) { - super(); - const keyPair = tweetnacl_1.default.sign.keyPair.fromSecretKey(serialize_1.base_decode(secretKey)); - this.publicKey = serialize_1.base_encode(keyPair.publicKey); - this.secretKey = secretKey; - } - /** - * Generate a new random keypair. - * @example - * const keyRandom = KeyPair.fromRandom(); - * keyRandom.publicKey - * // returns [PUBLIC_KEY] - * - * keyRandom.secretKey - * // returns [SECRET_KEY] - */ - static fromRandom() { - const newKeyPair = tweetnacl_1.default.sign.keyPair(); - return new KeyPairEd25519(serialize_1.base_encode(newKeyPair.secretKey)); - } - sign(message) { - const signature = tweetnacl_1.default.sign.detached(message, serialize_1.base_decode(this.secretKey)); - return { signature, publicKey: this.publicKey }; - } - verify(message, signature) { - return tweetnacl_1.default.sign.detached.verify(message, signature, serialize_1.base_decode(this.publicKey)); - } - toString() { - return `ed25519:${this.secretKey}`; - } - getPublicKey() { - return this.publicKey; - } -} -exports.KeyPairEd25519 = KeyPairEd25519; - -},{"./serialize":23,"tweetnacl":80}],22:[function(require,module,exports){ -'use strict'; -Object.defineProperty(exports, "__esModule", { value: true }); - -},{}],23:[function(require,module,exports){ -(function (Buffer){ -'use strict'; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const bs58_1 = __importDefault(require("bs58")); -function base_encode(value) { - if (typeof (value) === 'string') { - value = Buffer.from(value, 'utf8'); - } - return bs58_1.default.encode(Buffer.from(value)); -} -exports.base_encode = base_encode; -function base_decode(value) { - return bs58_1.default.decode(value); -} -exports.base_decode = base_decode; - -}).call(this,require("buffer").Buffer) -},{"bs58":38,"buffer":39}],24:[function(require,module,exports){ -'use strict'; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const http_errors_1 = __importDefault(require("http-errors")); -const fetch = (typeof window === 'undefined' || window.name === 'nodejs') ? require('node-fetch') : window.fetch; -async function fetchJson(connection, json) { - let url = null; - if (typeof (connection) === 'string') { - url = connection; - } - else { - url = connection.url; - } - const response = await fetch(url, { - method: json ? 'POST' : 'GET', - body: json ? json : undefined, - headers: { 'Content-type': 'application/json; charset=utf-8' } - }); - if (!response.ok) { - throw http_errors_1.default(response.status, await response.text()); - } - return await response.json(); -} -exports.fetchJson = fetchJson; - -},{"http-errors":55,"node-fetch":37}],25:[function(require,module,exports){ -'use strict'; -Object.defineProperty(exports, "__esModule", { value: true }); -const utils_1 = require("./utils"); -const LOGIN_WALLET_URL_SUFFIX = '/login/'; -const LOCAL_STORAGE_KEY_SUFFIX = '_wallet_auth_key'; -const PENDING_ACCESS_KEY_PREFIX = 'pending_key'; // browser storage key for a pending access key (i.e. key has been generated but we are not sure it was added yet) -class WalletAccount { - constructor(near, appKeyPrefix) { - this._networkId = near.config.networkId; - this._walletBaseUrl = near.config.walletUrl; - appKeyPrefix = appKeyPrefix || near.config.contractName || 'default'; - this._authDataKey = appKeyPrefix + LOCAL_STORAGE_KEY_SUFFIX; - this._keyStore = near.connection.signer.keyStore; - this._authData = JSON.parse(window.localStorage.getItem(this._authDataKey) || '{}'); - if (!this.isSignedIn()) { - this._completeSignInWithAccessKey(); - } - } - /** - * Returns true, if this WalletAccount is authorized with the wallet. - * @example - * walletAccount.isSignedIn(); - */ - isSignedIn() { - return !!this._authData.accountId; - } - /** - * Returns authorized Account ID. - * @example - * walletAccount.getAccountId(); - */ - getAccountId() { - return this._authData.accountId || ''; - } - /** - * Redirects current page to the wallet authentication page. - * @param {string} contractId contract ID of the application - * @param {string} title name of the application - * @param {string} successUrl url to redirect on success - * @param {string} failureUrl url to redirect on failure - * @example - * walletAccount.requestSignIn( - * myContractId, - * title, - * onSuccessHref, - * onFailureHref); - */ - async requestSignIn(contractId, title, successUrl, failureUrl) { - if (this.getAccountId() || await this._keyStore.getKey(this._networkId, this.getAccountId())) { - return Promise.resolve(); - } - const currentUrl = new URL(window.location.href); - const newUrl = new URL(this._walletBaseUrl + LOGIN_WALLET_URL_SUFFIX); - newUrl.searchParams.set('title', title); - newUrl.searchParams.set('contract_id', contractId); - newUrl.searchParams.set('success_url', successUrl || currentUrl.href); - newUrl.searchParams.set('failure_url', failureUrl || currentUrl.href); - newUrl.searchParams.set('app_url', currentUrl.origin); - const accessKey = utils_1.KeyPair.fromRandom('ed25519'); - newUrl.searchParams.set('public_key', accessKey.getPublicKey()); - await this._keyStore.setKey(this._networkId, PENDING_ACCESS_KEY_PREFIX + accessKey.getPublicKey(), accessKey); - window.location.assign(newUrl.toString()); - } - /** - * Complete sign in for a given account id and public key. To be invoked by the app when getting a callback from the wallet. - */ - async _completeSignInWithAccessKey() { - const currentUrl = new URL(window.location.href); - const publicKey = currentUrl.searchParams.get('public_key') || ''; - const accountId = currentUrl.searchParams.get('account_id') || ''; - if (accountId && publicKey) { - this._authData = { - accountId - }; - window.localStorage.setItem(this._authDataKey, JSON.stringify(this._authData)); - await this._moveKeyFromTempToPermanent(accountId, publicKey); - } - } - async _moveKeyFromTempToPermanent(accountId, publicKey) { - const keyPair = await this._keyStore.getKey(this._networkId, PENDING_ACCESS_KEY_PREFIX + publicKey); - await this._keyStore.setKey(this._networkId, accountId, keyPair); - await this._keyStore.removeKey(this._networkId, PENDING_ACCESS_KEY_PREFIX + publicKey); - } - /** - * Sign out from the current account - * @example - * walletAccount.signOut(); - */ - signOut() { - this._authData = {}; - window.localStorage.removeItem(this._authDataKey); - } -} -exports.WalletAccount = WalletAccount; - -},{"./utils":20}],26:[function(require,module,exports){ -"use strict"; -module.exports = asPromise; - -/** - * Callback as used by {@link util.asPromise}. - * @typedef asPromiseCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {...*} params Additional arguments - * @returns {undefined} - */ - -/** - * Returns a promise from a node-style callback function. - * @memberof util - * @param {asPromiseCallback} fn Function to call - * @param {*} ctx Function context - * @param {...*} params Function arguments - * @returns {Promise<*>} Promisified function - */ -function asPromise(fn, ctx/*, varargs */) { - var params = new Array(arguments.length - 1), - offset = 0, - index = 2, - pending = true; - while (index < arguments.length) - params[offset++] = arguments[index++]; - return new Promise(function executor(resolve, reject) { - params[offset] = function callback(err/*, varargs */) { - if (pending) { - pending = false; - if (err) - reject(err); - else { - var params = new Array(arguments.length - 1), - offset = 0; - while (offset < params.length) - params[offset++] = arguments[offset]; - resolve.apply(null, params); - } - } - }; - try { - fn.apply(ctx || null, params); - } catch (err) { - if (pending) { - pending = false; - reject(err); - } - } - }); -} - -},{}],27:[function(require,module,exports){ -"use strict"; - -/** - * A minimal base64 implementation for number arrays. - * @memberof util - * @namespace - */ -var base64 = exports; - -/** - * Calculates the byte length of a base64 encoded string. - * @param {string} string Base64 encoded string - * @returns {number} Byte length - */ -base64.length = function length(string) { - var p = string.length; - if (!p) - return 0; - var n = 0; - while (--p % 4 > 1 && string.charAt(p) === "=") - ++n; - return Math.ceil(string.length * 3) / 4 - n; -}; - -// Base64 encoding table -var b64 = new Array(64); - -// Base64 decoding table -var s64 = new Array(123); - -// 65..90, 97..122, 48..57, 43, 47 -for (var i = 0; i < 64;) - s64[b64[i] = i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i - 59 | 43] = i++; - -/** - * Encodes a buffer to a base64 encoded string. - * @param {Uint8Array} buffer Source buffer - * @param {number} start Source start - * @param {number} end Source end - * @returns {string} Base64 encoded string - */ -base64.encode = function encode(buffer, start, end) { - var parts = null, - chunk = []; - var i = 0, // output index - j = 0, // goto index - t; // temporary - while (start < end) { - var b = buffer[start++]; - switch (j) { - case 0: - chunk[i++] = b64[b >> 2]; - t = (b & 3) << 4; - j = 1; - break; - case 1: - chunk[i++] = b64[t | b >> 4]; - t = (b & 15) << 2; - j = 2; - break; - case 2: - chunk[i++] = b64[t | b >> 6]; - chunk[i++] = b64[b & 63]; - j = 0; - break; - } - if (i > 8191) { - (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk)); - i = 0; - } - } - if (j) { - chunk[i++] = b64[t]; - chunk[i++] = 61; - if (j === 1) - chunk[i++] = 61; - } - if (parts) { - if (i) - parts.push(String.fromCharCode.apply(String, chunk.slice(0, i))); - return parts.join(""); - } - return String.fromCharCode.apply(String, chunk.slice(0, i)); -}; - -var invalidEncoding = "invalid encoding"; - -/** - * Decodes a base64 encoded string to a buffer. - * @param {string} string Source string - * @param {Uint8Array} buffer Destination buffer - * @param {number} offset Destination offset - * @returns {number} Number of bytes written - * @throws {Error} If encoding is invalid - */ -base64.decode = function decode(string, buffer, offset) { - var start = offset; - var j = 0, // goto index - t; // temporary - for (var i = 0; i < string.length;) { - var c = string.charCodeAt(i++); - if (c === 61 && j > 1) - break; - if ((c = s64[c]) === undefined) - throw Error(invalidEncoding); - switch (j) { - case 0: - t = c; - j = 1; - break; - case 1: - buffer[offset++] = t << 2 | (c & 48) >> 4; - t = c; - j = 2; - break; - case 2: - buffer[offset++] = (t & 15) << 4 | (c & 60) >> 2; - t = c; - j = 3; - break; - case 3: - buffer[offset++] = (t & 3) << 6 | c; - j = 0; - break; - } - } - if (j === 1) - throw Error(invalidEncoding); - return offset - start; -}; - -/** - * Tests if the specified string appears to be base64 encoded. - * @param {string} string String to test - * @returns {boolean} `true` if probably base64 encoded, otherwise false - */ -base64.test = function test(string) { - return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(string); -}; - -},{}],28:[function(require,module,exports){ -"use strict"; -module.exports = EventEmitter; - -/** - * Constructs a new event emitter instance. - * @classdesc A minimal event emitter. - * @memberof util - * @constructor - */ -function EventEmitter() { - - /** - * Registered listeners. - * @type {Object.} - * @private - */ - this._listeners = {}; -} - -/** - * Registers an event listener. - * @param {string} evt Event name - * @param {function} fn Listener - * @param {*} [ctx] Listener context - * @returns {util.EventEmitter} `this` - */ -EventEmitter.prototype.on = function on(evt, fn, ctx) { - (this._listeners[evt] || (this._listeners[evt] = [])).push({ - fn : fn, - ctx : ctx || this - }); - return this; -}; - -/** - * Removes an event listener or any matching listeners if arguments are omitted. - * @param {string} [evt] Event name. Removes all listeners if omitted. - * @param {function} [fn] Listener to remove. Removes all listeners of `evt` if omitted. - * @returns {util.EventEmitter} `this` - */ -EventEmitter.prototype.off = function off(evt, fn) { - if (evt === undefined) - this._listeners = {}; - else { - if (fn === undefined) - this._listeners[evt] = []; - else { - var listeners = this._listeners[evt]; - for (var i = 0; i < listeners.length;) - if (listeners[i].fn === fn) - listeners.splice(i, 1); - else - ++i; - } - } - return this; -}; - -/** - * Emits an event by calling its listeners with the specified arguments. - * @param {string} evt Event name - * @param {...*} args Arguments - * @returns {util.EventEmitter} `this` - */ -EventEmitter.prototype.emit = function emit(evt) { - var listeners = this._listeners[evt]; - if (listeners) { - var args = [], - i = 1; - for (; i < arguments.length;) - args.push(arguments[i++]); - for (i = 0; i < listeners.length;) - listeners[i].fn.apply(listeners[i++].ctx, args); - } - return this; -}; - -},{}],29:[function(require,module,exports){ -"use strict"; - -module.exports = factory(factory); - -/** - * Reads / writes floats / doubles from / to buffers. - * @name util.float - * @namespace - */ - -/** - * Writes a 32 bit float to a buffer using little endian byte order. - * @name util.float.writeFloatLE - * @function - * @param {number} val Value to write - * @param {Uint8Array} buf Target buffer - * @param {number} pos Target buffer offset - * @returns {undefined} - */ - -/** - * Writes a 32 bit float to a buffer using big endian byte order. - * @name util.float.writeFloatBE - * @function - * @param {number} val Value to write - * @param {Uint8Array} buf Target buffer - * @param {number} pos Target buffer offset - * @returns {undefined} - */ - -/** - * Reads a 32 bit float from a buffer using little endian byte order. - * @name util.float.readFloatLE - * @function - * @param {Uint8Array} buf Source buffer - * @param {number} pos Source buffer offset - * @returns {number} Value read - */ - -/** - * Reads a 32 bit float from a buffer using big endian byte order. - * @name util.float.readFloatBE - * @function - * @param {Uint8Array} buf Source buffer - * @param {number} pos Source buffer offset - * @returns {number} Value read - */ - -/** - * Writes a 64 bit double to a buffer using little endian byte order. - * @name util.float.writeDoubleLE - * @function - * @param {number} val Value to write - * @param {Uint8Array} buf Target buffer - * @param {number} pos Target buffer offset - * @returns {undefined} - */ - -/** - * Writes a 64 bit double to a buffer using big endian byte order. - * @name util.float.writeDoubleBE - * @function - * @param {number} val Value to write - * @param {Uint8Array} buf Target buffer - * @param {number} pos Target buffer offset - * @returns {undefined} - */ - -/** - * Reads a 64 bit double from a buffer using little endian byte order. - * @name util.float.readDoubleLE - * @function - * @param {Uint8Array} buf Source buffer - * @param {number} pos Source buffer offset - * @returns {number} Value read - */ - -/** - * Reads a 64 bit double from a buffer using big endian byte order. - * @name util.float.readDoubleBE - * @function - * @param {Uint8Array} buf Source buffer - * @param {number} pos Source buffer offset - * @returns {number} Value read - */ - -// Factory function for the purpose of node-based testing in modified global environments -function factory(exports) { - - // float: typed array - if (typeof Float32Array !== "undefined") (function() { - - var f32 = new Float32Array([ -0 ]), - f8b = new Uint8Array(f32.buffer), - le = f8b[3] === 128; - - function writeFloat_f32_cpy(val, buf, pos) { - f32[0] = val; - buf[pos ] = f8b[0]; - buf[pos + 1] = f8b[1]; - buf[pos + 2] = f8b[2]; - buf[pos + 3] = f8b[3]; - } - - function writeFloat_f32_rev(val, buf, pos) { - f32[0] = val; - buf[pos ] = f8b[3]; - buf[pos + 1] = f8b[2]; - buf[pos + 2] = f8b[1]; - buf[pos + 3] = f8b[0]; - } - - /* istanbul ignore next */ - exports.writeFloatLE = le ? writeFloat_f32_cpy : writeFloat_f32_rev; - /* istanbul ignore next */ - exports.writeFloatBE = le ? writeFloat_f32_rev : writeFloat_f32_cpy; - - function readFloat_f32_cpy(buf, pos) { - f8b[0] = buf[pos ]; - f8b[1] = buf[pos + 1]; - f8b[2] = buf[pos + 2]; - f8b[3] = buf[pos + 3]; - return f32[0]; - } - - function readFloat_f32_rev(buf, pos) { - f8b[3] = buf[pos ]; - f8b[2] = buf[pos + 1]; - f8b[1] = buf[pos + 2]; - f8b[0] = buf[pos + 3]; - return f32[0]; - } - - /* istanbul ignore next */ - exports.readFloatLE = le ? readFloat_f32_cpy : readFloat_f32_rev; - /* istanbul ignore next */ - exports.readFloatBE = le ? readFloat_f32_rev : readFloat_f32_cpy; - - // float: ieee754 - })(); else (function() { - - function writeFloat_ieee754(writeUint, val, buf, pos) { - var sign = val < 0 ? 1 : 0; - if (sign) - val = -val; - if (val === 0) - writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos); - else if (isNaN(val)) - writeUint(2143289344, buf, pos); - else if (val > 3.4028234663852886e+38) // +-Infinity - writeUint((sign << 31 | 2139095040) >>> 0, buf, pos); - else if (val < 1.1754943508222875e-38) // denormal - writeUint((sign << 31 | Math.round(val / 1.401298464324817e-45)) >>> 0, buf, pos); - else { - var exponent = Math.floor(Math.log(val) / Math.LN2), - mantissa = Math.round(val * Math.pow(2, -exponent) * 8388608) & 8388607; - writeUint((sign << 31 | exponent + 127 << 23 | mantissa) >>> 0, buf, pos); - } - } - - exports.writeFloatLE = writeFloat_ieee754.bind(null, writeUintLE); - exports.writeFloatBE = writeFloat_ieee754.bind(null, writeUintBE); - - function readFloat_ieee754(readUint, buf, pos) { - var uint = readUint(buf, pos), - sign = (uint >> 31) * 2 + 1, - exponent = uint >>> 23 & 255, - mantissa = uint & 8388607; - return exponent === 255 - ? mantissa - ? NaN - : sign * Infinity - : exponent === 0 // denormal - ? sign * 1.401298464324817e-45 * mantissa - : sign * Math.pow(2, exponent - 150) * (mantissa + 8388608); - } - - exports.readFloatLE = readFloat_ieee754.bind(null, readUintLE); - exports.readFloatBE = readFloat_ieee754.bind(null, readUintBE); - - })(); - - // double: typed array - if (typeof Float64Array !== "undefined") (function() { - - var f64 = new Float64Array([-0]), - f8b = new Uint8Array(f64.buffer), - le = f8b[7] === 128; - - function writeDouble_f64_cpy(val, buf, pos) { - f64[0] = val; - buf[pos ] = f8b[0]; - buf[pos + 1] = f8b[1]; - buf[pos + 2] = f8b[2]; - buf[pos + 3] = f8b[3]; - buf[pos + 4] = f8b[4]; - buf[pos + 5] = f8b[5]; - buf[pos + 6] = f8b[6]; - buf[pos + 7] = f8b[7]; - } - - function writeDouble_f64_rev(val, buf, pos) { - f64[0] = val; - buf[pos ] = f8b[7]; - buf[pos + 1] = f8b[6]; - buf[pos + 2] = f8b[5]; - buf[pos + 3] = f8b[4]; - buf[pos + 4] = f8b[3]; - buf[pos + 5] = f8b[2]; - buf[pos + 6] = f8b[1]; - buf[pos + 7] = f8b[0]; - } - - /* istanbul ignore next */ - exports.writeDoubleLE = le ? writeDouble_f64_cpy : writeDouble_f64_rev; - /* istanbul ignore next */ - exports.writeDoubleBE = le ? writeDouble_f64_rev : writeDouble_f64_cpy; - - function readDouble_f64_cpy(buf, pos) { - f8b[0] = buf[pos ]; - f8b[1] = buf[pos + 1]; - f8b[2] = buf[pos + 2]; - f8b[3] = buf[pos + 3]; - f8b[4] = buf[pos + 4]; - f8b[5] = buf[pos + 5]; - f8b[6] = buf[pos + 6]; - f8b[7] = buf[pos + 7]; - return f64[0]; - } - - function readDouble_f64_rev(buf, pos) { - f8b[7] = buf[pos ]; - f8b[6] = buf[pos + 1]; - f8b[5] = buf[pos + 2]; - f8b[4] = buf[pos + 3]; - f8b[3] = buf[pos + 4]; - f8b[2] = buf[pos + 5]; - f8b[1] = buf[pos + 6]; - f8b[0] = buf[pos + 7]; - return f64[0]; - } - - /* istanbul ignore next */ - exports.readDoubleLE = le ? readDouble_f64_cpy : readDouble_f64_rev; - /* istanbul ignore next */ - exports.readDoubleBE = le ? readDouble_f64_rev : readDouble_f64_cpy; - - // double: ieee754 - })(); else (function() { - - function writeDouble_ieee754(writeUint, off0, off1, val, buf, pos) { - var sign = val < 0 ? 1 : 0; - if (sign) - val = -val; - if (val === 0) { - writeUint(0, buf, pos + off0); - writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos + off1); - } else if (isNaN(val)) { - writeUint(0, buf, pos + off0); - writeUint(2146959360, buf, pos + off1); - } else if (val > 1.7976931348623157e+308) { // +-Infinity - writeUint(0, buf, pos + off0); - writeUint((sign << 31 | 2146435072) >>> 0, buf, pos + off1); - } else { - var mantissa; - if (val < 2.2250738585072014e-308) { // denormal - mantissa = val / 5e-324; - writeUint(mantissa >>> 0, buf, pos + off0); - writeUint((sign << 31 | mantissa / 4294967296) >>> 0, buf, pos + off1); - } else { - var exponent = Math.floor(Math.log(val) / Math.LN2); - if (exponent === 1024) - exponent = 1023; - mantissa = val * Math.pow(2, -exponent); - writeUint(mantissa * 4503599627370496 >>> 0, buf, pos + off0); - writeUint((sign << 31 | exponent + 1023 << 20 | mantissa * 1048576 & 1048575) >>> 0, buf, pos + off1); - } - } - } - - exports.writeDoubleLE = writeDouble_ieee754.bind(null, writeUintLE, 0, 4); - exports.writeDoubleBE = writeDouble_ieee754.bind(null, writeUintBE, 4, 0); - - function readDouble_ieee754(readUint, off0, off1, buf, pos) { - var lo = readUint(buf, pos + off0), - hi = readUint(buf, pos + off1); - var sign = (hi >> 31) * 2 + 1, - exponent = hi >>> 20 & 2047, - mantissa = 4294967296 * (hi & 1048575) + lo; - return exponent === 2047 - ? mantissa - ? NaN - : sign * Infinity - : exponent === 0 // denormal - ? sign * 5e-324 * mantissa - : sign * Math.pow(2, exponent - 1075) * (mantissa + 4503599627370496); - } - - exports.readDoubleLE = readDouble_ieee754.bind(null, readUintLE, 0, 4); - exports.readDoubleBE = readDouble_ieee754.bind(null, readUintBE, 4, 0); - - })(); - - return exports; -} - -// uint helpers - -function writeUintLE(val, buf, pos) { - buf[pos ] = val & 255; - buf[pos + 1] = val >>> 8 & 255; - buf[pos + 2] = val >>> 16 & 255; - buf[pos + 3] = val >>> 24; -} - -function writeUintBE(val, buf, pos) { - buf[pos ] = val >>> 24; - buf[pos + 1] = val >>> 16 & 255; - buf[pos + 2] = val >>> 8 & 255; - buf[pos + 3] = val & 255; -} - -function readUintLE(buf, pos) { - return (buf[pos ] - | buf[pos + 1] << 8 - | buf[pos + 2] << 16 - | buf[pos + 3] << 24) >>> 0; -} - -function readUintBE(buf, pos) { - return (buf[pos ] << 24 - | buf[pos + 1] << 16 - | buf[pos + 2] << 8 - | buf[pos + 3]) >>> 0; -} - -},{}],30:[function(require,module,exports){ -"use strict"; -module.exports = inquire; - -/** - * Requires a module only if available. - * @memberof util - * @param {string} moduleName Module to require - * @returns {?Object} Required module if available and not empty, otherwise `null` - */ -function inquire(moduleName) { - try { - var mod = eval("quire".replace(/^/,"re"))(moduleName); // eslint-disable-line no-eval - if (mod && (mod.length || Object.keys(mod).length)) - return mod; - } catch (e) {} // eslint-disable-line no-empty - return null; -} - -},{}],31:[function(require,module,exports){ -"use strict"; -module.exports = pool; - -/** - * An allocator as used by {@link util.pool}. - * @typedef PoolAllocator - * @type {function} - * @param {number} size Buffer size - * @returns {Uint8Array} Buffer - */ - -/** - * A slicer as used by {@link util.pool}. - * @typedef PoolSlicer - * @type {function} - * @param {number} start Start offset - * @param {number} end End offset - * @returns {Uint8Array} Buffer slice - * @this {Uint8Array} - */ - -/** - * A general purpose buffer pool. - * @memberof util - * @function - * @param {PoolAllocator} alloc Allocator - * @param {PoolSlicer} slice Slicer - * @param {number} [size=8192] Slab size - * @returns {PoolAllocator} Pooled allocator - */ -function pool(alloc, slice, size) { - var SIZE = size || 8192; - var MAX = SIZE >>> 1; - var slab = null; - var offset = SIZE; - return function pool_alloc(size) { - if (size < 1 || size > MAX) - return alloc(size); - if (offset + size > SIZE) { - slab = alloc(SIZE); - offset = 0; - } - var buf = slice.call(slab, offset, offset += size); - if (offset & 7) // align to 32 bit - offset = (offset | 7) + 1; - return buf; - }; -} - -},{}],32:[function(require,module,exports){ -"use strict"; - -/** - * A minimal UTF8 implementation for number arrays. - * @memberof util - * @namespace - */ -var utf8 = exports; - -/** - * Calculates the UTF8 byte length of a string. - * @param {string} string String - * @returns {number} Byte length - */ -utf8.length = function utf8_length(string) { - var len = 0, - c = 0; - for (var i = 0; i < string.length; ++i) { - c = string.charCodeAt(i); - if (c < 128) - len += 1; - else if (c < 2048) - len += 2; - else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) { - ++i; - len += 4; - } else - len += 3; - } - return len; -}; - -/** - * Reads UTF8 bytes as a string. - * @param {Uint8Array} buffer Source buffer - * @param {number} start Source start - * @param {number} end Source end - * @returns {string} String read - */ -utf8.read = function utf8_read(buffer, start, end) { - var len = end - start; - if (len < 1) - return ""; - var parts = null, - chunk = [], - i = 0, // char offset - t; // temporary - while (start < end) { - t = buffer[start++]; - if (t < 128) - chunk[i++] = t; - else if (t > 191 && t < 224) - chunk[i++] = (t & 31) << 6 | buffer[start++] & 63; - else if (t > 239 && t < 365) { - t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000; - chunk[i++] = 0xD800 + (t >> 10); - chunk[i++] = 0xDC00 + (t & 1023); - } else - chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63; - if (i > 8191) { - (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk)); - i = 0; - } - } - if (parts) { - if (i) - parts.push(String.fromCharCode.apply(String, chunk.slice(0, i))); - return parts.join(""); - } - return String.fromCharCode.apply(String, chunk.slice(0, i)); -}; - -/** - * Writes a string as UTF8 bytes. - * @param {string} string Source string - * @param {Uint8Array} buffer Destination buffer - * @param {number} offset Destination offset - * @returns {number} Bytes written - */ -utf8.write = function utf8_write(string, buffer, offset) { - var start = offset, - c1, // character 1 - c2; // character 2 - for (var i = 0; i < string.length; ++i) { - c1 = string.charCodeAt(i); - if (c1 < 128) { - buffer[offset++] = c1; - } else if (c1 < 2048) { - buffer[offset++] = c1 >> 6 | 192; - buffer[offset++] = c1 & 63 | 128; - } else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) { - c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF); - ++i; - buffer[offset++] = c1 >> 18 | 240; - buffer[offset++] = c1 >> 12 & 63 | 128; - buffer[offset++] = c1 >> 6 & 63 | 128; - buffer[offset++] = c1 & 63 | 128; - } else { - buffer[offset++] = c1 >> 12 | 224; - buffer[offset++] = c1 >> 6 & 63 | 128; - buffer[offset++] = c1 & 63 | 128; - } - } - return offset - start; -}; - -},{}],33:[function(require,module,exports){ -// base-x encoding / decoding -// Copyright (c) 2018 base-x contributors -// Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp) -// Distributed under the MIT software license, see the accompanying -// file LICENSE or http://www.opensource.org/licenses/mit-license.php. - -const Buffer = require('safe-buffer').Buffer - -module.exports = function base (ALPHABET) { - if (ALPHABET.length >= 255) throw new TypeError('Alphabet too long') - - const BASE_MAP = new Uint8Array(256) - BASE_MAP.fill(255) - - for (let i = 0; i < ALPHABET.length; i++) { - const x = ALPHABET.charAt(i) - const xc = x.charCodeAt(0) - - if (BASE_MAP[xc] !== 255) throw new TypeError(x + ' is ambiguous') - BASE_MAP[xc] = i - } - - const BASE = ALPHABET.length - const LEADER = ALPHABET.charAt(0) - const FACTOR = Math.log(BASE) / Math.log(256) // log(BASE) / log(256), rounded up - const iFACTOR = Math.log(256) / Math.log(BASE) // log(256) / log(BASE), rounded up - - function encode (source) { - if (!Buffer.isBuffer(source)) throw new TypeError('Expected Buffer') - if (source.length === 0) return '' - - // Skip & count leading zeroes. - let zeroes = 0 - let length = 0 - let pbegin = 0 - const pend = source.length - - while (pbegin !== pend && source[pbegin] === 0) { - pbegin++ - zeroes++ - } - - // Allocate enough space in big-endian base58 representation. - const size = ((pend - pbegin) * iFACTOR + 1) >>> 0 - const b58 = new Uint8Array(size) - - // Process the bytes. - while (pbegin !== pend) { - let carry = source[pbegin] - - // Apply "b58 = b58 * 256 + ch". - let i = 0 - for (let it = size - 1; (carry !== 0 || i < length) && (it !== -1); it--, i++) { - carry += (256 * b58[it]) >>> 0 - b58[it] = (carry % BASE) >>> 0 - carry = (carry / BASE) >>> 0 - } - - if (carry !== 0) throw new Error('Non-zero carry') - length = i - pbegin++ - } - - // Skip leading zeroes in base58 result. - let it = size - length - while (it !== size && b58[it] === 0) { - it++ - } - - // Translate the result into a string. - let str = LEADER.repeat(zeroes) - for (; it < size; ++it) str += ALPHABET.charAt(b58[it]) - - return str - } - - function decodeUnsafe (source) { - if (typeof source !== 'string') throw new TypeError('Expected String') - if (source.length === 0) return Buffer.alloc(0) - - let psz = 0 - - // Skip leading spaces. - if (source[psz] === ' ') return - - // Skip and count leading '1's. - let zeroes = 0 - let length = 0 - while (source[psz] === LEADER) { - zeroes++ - psz++ - } - - // Allocate enough space in big-endian base256 representation. - const size = (((source.length - psz) * FACTOR) + 1) >>> 0 // log(58) / log(256), rounded up. - const b256 = new Uint8Array(size) - - // Process the characters. - while (source[psz]) { - // Decode character - let carry = BASE_MAP[source.charCodeAt(psz)] - - // Invalid character - if (carry === 255) return - - let i = 0 - for (let it = size - 1; (carry !== 0 || i < length) && (it !== -1); it--, i++) { - carry += (BASE * b256[it]) >>> 0 - b256[it] = (carry % 256) >>> 0 - carry = (carry / 256) >>> 0 - } - - if (carry !== 0) throw new Error('Non-zero carry') - length = i - psz++ - } - - // Skip trailing spaces. - if (source[psz] === ' ') return - - // Skip leading zeroes in b256. - let it = size - length - while (it !== size && b256[it] === 0) { - it++ - } - - const vch = Buffer.allocUnsafe(zeroes + (size - it)) - vch.fill(0x00, 0, zeroes) - - let j = zeroes - while (it !== size) { - vch[j++] = b256[it++] - } - - return vch - } - - function decode (string) { - const buffer = decodeUnsafe(string) - if (buffer) return buffer - - throw new Error('Non-base' + BASE + ' character') - } - - return { - encode: encode, - decodeUnsafe: decodeUnsafe, - decode: decode - } -} - -},{"safe-buffer":75}],34:[function(require,module,exports){ -'use strict' - -exports.byteLength = byteLength -exports.toByteArray = toByteArray -exports.fromByteArray = fromByteArray - -var lookup = [] -var revLookup = [] -var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array - -var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' -for (var i = 0, len = code.length; i < len; ++i) { - lookup[i] = code[i] - revLookup[code.charCodeAt(i)] = i -} - -// Support decoding URL-safe base64 strings, as Node.js does. -// See: https://en.wikipedia.org/wiki/Base64#URL_applications -revLookup['-'.charCodeAt(0)] = 62 -revLookup['_'.charCodeAt(0)] = 63 - -function getLens (b64) { - var len = b64.length - - if (len % 4 > 0) { - throw new Error('Invalid string. Length must be a multiple of 4') - } - - // Trim off extra bytes after placeholder bytes are found - // See: https://github.com/beatgammit/base64-js/issues/42 - var validLen = b64.indexOf('=') - if (validLen === -1) validLen = len - - var placeHoldersLen = validLen === len - ? 0 - : 4 - (validLen % 4) - - return [validLen, placeHoldersLen] -} - -// base64 is 4/3 + up to two characters of the original data -function byteLength (b64) { - var lens = getLens(b64) - var validLen = lens[0] - var placeHoldersLen = lens[1] - return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen -} - -function _byteLength (b64, validLen, placeHoldersLen) { - return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen -} - -function toByteArray (b64) { - var tmp - var lens = getLens(b64) - var validLen = lens[0] - var placeHoldersLen = lens[1] - - var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen)) - - var curByte = 0 - - // if there are placeholders, only get up to the last complete 4 chars - var len = placeHoldersLen > 0 - ? validLen - 4 - : validLen - - for (var i = 0; i < len; i += 4) { - tmp = - (revLookup[b64.charCodeAt(i)] << 18) | - (revLookup[b64.charCodeAt(i + 1)] << 12) | - (revLookup[b64.charCodeAt(i + 2)] << 6) | - revLookup[b64.charCodeAt(i + 3)] - arr[curByte++] = (tmp >> 16) & 0xFF - arr[curByte++] = (tmp >> 8) & 0xFF - arr[curByte++] = tmp & 0xFF - } - - if (placeHoldersLen === 2) { - tmp = - (revLookup[b64.charCodeAt(i)] << 2) | - (revLookup[b64.charCodeAt(i + 1)] >> 4) - arr[curByte++] = tmp & 0xFF - } - - if (placeHoldersLen === 1) { - tmp = - (revLookup[b64.charCodeAt(i)] << 10) | - (revLookup[b64.charCodeAt(i + 1)] << 4) | - (revLookup[b64.charCodeAt(i + 2)] >> 2) - arr[curByte++] = (tmp >> 8) & 0xFF - arr[curByte++] = tmp & 0xFF - } - - return arr -} - -function tripletToBase64 (num) { - return lookup[num >> 18 & 0x3F] + - lookup[num >> 12 & 0x3F] + - lookup[num >> 6 & 0x3F] + - lookup[num & 0x3F] -} - -function encodeChunk (uint8, start, end) { - var tmp - var output = [] - for (var i = start; i < end; i += 3) { - tmp = - ((uint8[i] << 16) & 0xFF0000) + - ((uint8[i + 1] << 8) & 0xFF00) + - (uint8[i + 2] & 0xFF) - output.push(tripletToBase64(tmp)) - } - return output.join('') -} - -function fromByteArray (uint8) { - var tmp - var len = uint8.length - var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes - var parts = [] - var maxChunkLength = 16383 // must be multiple of 3 - - // go through the array every three bytes, we'll deal with trailing stuff later - for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) { - parts.push(encodeChunk( - uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength) - )) - } - - // pad the end with zeros, but make sure to not forget the extra bytes - if (extraBytes === 1) { - tmp = uint8[len - 1] - parts.push( - lookup[tmp >> 2] + - lookup[(tmp << 4) & 0x3F] + - '==' - ) - } else if (extraBytes === 2) { - tmp = (uint8[len - 2] << 8) + uint8[len - 1] - parts.push( - lookup[tmp >> 10] + - lookup[(tmp >> 4) & 0x3F] + - lookup[(tmp << 2) & 0x3F] + - '=' - ) - } - - return parts.join('') -} - -},{}],35:[function(require,module,exports){ -(function (module, exports) { - 'use strict'; - - // Utils - function assert (val, msg) { - if (!val) throw new Error(msg || 'Assertion failed'); - } - - // Could use `inherits` module, but don't want to move from single file - // architecture yet. - function inherits (ctor, superCtor) { - ctor.super_ = superCtor; - var TempCtor = function () {}; - TempCtor.prototype = superCtor.prototype; - ctor.prototype = new TempCtor(); - ctor.prototype.constructor = ctor; - } - - // BN - - function BN (number, base, endian) { - if (BN.isBN(number)) { - return number; - } - - this.negative = 0; - this.words = null; - this.length = 0; - - // Reduction context - this.red = null; - - if (number !== null) { - if (base === 'le' || base === 'be') { - endian = base; - base = 10; - } - - this._init(number || 0, base || 10, endian || 'be'); - } - } - if (typeof module === 'object') { - module.exports = BN; - } else { - exports.BN = BN; - } - - BN.BN = BN; - BN.wordSize = 26; - - var Buffer; - try { - Buffer = require('buffer').Buffer; - } catch (e) { - } - - BN.isBN = function isBN (num) { - if (num instanceof BN) { - return true; - } - - return num !== null && typeof num === 'object' && - num.constructor.wordSize === BN.wordSize && Array.isArray(num.words); - }; - - BN.max = function max (left, right) { - if (left.cmp(right) > 0) return left; - return right; - }; - - BN.min = function min (left, right) { - if (left.cmp(right) < 0) return left; - return right; - }; - - BN.prototype._init = function init (number, base, endian) { - if (typeof number === 'number') { - return this._initNumber(number, base, endian); - } - - if (typeof number === 'object') { - return this._initArray(number, base, endian); - } - - if (base === 'hex') { - base = 16; - } - assert(base === (base | 0) && base >= 2 && base <= 36); - - number = number.toString().replace(/\s+/g, ''); - var start = 0; - if (number[0] === '-') { - start++; - } - - if (base === 16) { - this._parseHex(number, start); - } else { - this._parseBase(number, base, start); - } - - if (number[0] === '-') { - this.negative = 1; - } - - this.strip(); - - if (endian !== 'le') return; - - this._initArray(this.toArray(), base, endian); - }; - - BN.prototype._initNumber = function _initNumber (number, base, endian) { - if (number < 0) { - this.negative = 1; - number = -number; - } - if (number < 0x4000000) { - this.words = [ number & 0x3ffffff ]; - this.length = 1; - } else if (number < 0x10000000000000) { - this.words = [ - number & 0x3ffffff, - (number / 0x4000000) & 0x3ffffff - ]; - this.length = 2; - } else { - assert(number < 0x20000000000000); // 2 ^ 53 (unsafe) - this.words = [ - number & 0x3ffffff, - (number / 0x4000000) & 0x3ffffff, - 1 - ]; - this.length = 3; - } - - if (endian !== 'le') return; - - // Reverse the bytes - this._initArray(this.toArray(), base, endian); - }; - - BN.prototype._initArray = function _initArray (number, base, endian) { - // Perhaps a Uint8Array - assert(typeof number.length === 'number'); - if (number.length <= 0) { - this.words = [ 0 ]; - this.length = 1; - return this; - } - - this.length = Math.ceil(number.length / 3); - this.words = new Array(this.length); - for (var i = 0; i < this.length; i++) { - this.words[i] = 0; - } - - var j, w; - var off = 0; - if (endian === 'be') { - for (i = number.length - 1, j = 0; i >= 0; i -= 3) { - w = number[i] | (number[i - 1] << 8) | (number[i - 2] << 16); - this.words[j] |= (w << off) & 0x3ffffff; - this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff; - off += 24; - if (off >= 26) { - off -= 26; - j++; - } - } - } else if (endian === 'le') { - for (i = 0, j = 0; i < number.length; i += 3) { - w = number[i] | (number[i + 1] << 8) | (number[i + 2] << 16); - this.words[j] |= (w << off) & 0x3ffffff; - this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff; - off += 24; - if (off >= 26) { - off -= 26; - j++; - } - } - } - return this.strip(); - }; - - function parseHex (str, start, end) { - var r = 0; - var len = Math.min(str.length, end); - for (var i = start; i < len; i++) { - var c = str.charCodeAt(i) - 48; - - r <<= 4; - - // 'a' - 'f' - if (c >= 49 && c <= 54) { - r |= c - 49 + 0xa; - - // 'A' - 'F' - } else if (c >= 17 && c <= 22) { - r |= c - 17 + 0xa; - - // '0' - '9' - } else { - r |= c & 0xf; - } - } - return r; - } - - BN.prototype._parseHex = function _parseHex (number, start) { - // Create possibly bigger array to ensure that it fits the number - this.length = Math.ceil((number.length - start) / 6); - this.words = new Array(this.length); - for (var i = 0; i < this.length; i++) { - this.words[i] = 0; - } - - var j, w; - // Scan 24-bit chunks and add them to the number - var off = 0; - for (i = number.length - 6, j = 0; i >= start; i -= 6) { - w = parseHex(number, i, i + 6); - this.words[j] |= (w << off) & 0x3ffffff; - // NOTE: `0x3fffff` is intentional here, 26bits max shift + 24bit hex limb - this.words[j + 1] |= w >>> (26 - off) & 0x3fffff; - off += 24; - if (off >= 26) { - off -= 26; - j++; - } - } - if (i + 6 !== start) { - w = parseHex(number, start, i + 6); - this.words[j] |= (w << off) & 0x3ffffff; - this.words[j + 1] |= w >>> (26 - off) & 0x3fffff; - } - this.strip(); - }; - - function parseBase (str, start, end, mul) { - var r = 0; - var len = Math.min(str.length, end); - for (var i = start; i < len; i++) { - var c = str.charCodeAt(i) - 48; - - r *= mul; - - // 'a' - if (c >= 49) { - r += c - 49 + 0xa; - - // 'A' - } else if (c >= 17) { - r += c - 17 + 0xa; - - // '0' - '9' - } else { - r += c; - } - } - return r; - } - - BN.prototype._parseBase = function _parseBase (number, base, start) { - // Initialize as zero - this.words = [ 0 ]; - this.length = 1; - - // Find length of limb in base - for (var limbLen = 0, limbPow = 1; limbPow <= 0x3ffffff; limbPow *= base) { - limbLen++; - } - limbLen--; - limbPow = (limbPow / base) | 0; - - var total = number.length - start; - var mod = total % limbLen; - var end = Math.min(total, total - mod) + start; - - var word = 0; - for (var i = start; i < end; i += limbLen) { - word = parseBase(number, i, i + limbLen, base); - - this.imuln(limbPow); - if (this.words[0] + word < 0x4000000) { - this.words[0] += word; - } else { - this._iaddn(word); - } - } - - if (mod !== 0) { - var pow = 1; - word = parseBase(number, i, number.length, base); - - for (i = 0; i < mod; i++) { - pow *= base; - } - - this.imuln(pow); - if (this.words[0] + word < 0x4000000) { - this.words[0] += word; - } else { - this._iaddn(word); - } - } - }; - - BN.prototype.copy = function copy (dest) { - dest.words = new Array(this.length); - for (var i = 0; i < this.length; i++) { - dest.words[i] = this.words[i]; - } - dest.length = this.length; - dest.negative = this.negative; - dest.red = this.red; - }; - - BN.prototype.clone = function clone () { - var r = new BN(null); - this.copy(r); - return r; - }; - - BN.prototype._expand = function _expand (size) { - while (this.length < size) { - this.words[this.length++] = 0; - } - return this; - }; - - // Remove leading `0` from `this` - BN.prototype.strip = function strip () { - while (this.length > 1 && this.words[this.length - 1] === 0) { - this.length--; - } - return this._normSign(); - }; - - BN.prototype._normSign = function _normSign () { - // -0 = 0 - if (this.length === 1 && this.words[0] === 0) { - this.negative = 0; - } - return this; - }; - - BN.prototype.inspect = function inspect () { - return (this.red ? ''; - }; - - /* - - var zeros = []; - var groupSizes = []; - var groupBases = []; - - var s = ''; - var i = -1; - while (++i < BN.wordSize) { - zeros[i] = s; - s += '0'; - } - groupSizes[0] = 0; - groupSizes[1] = 0; - groupBases[0] = 0; - groupBases[1] = 0; - var base = 2 - 1; - while (++base < 36 + 1) { - var groupSize = 0; - var groupBase = 1; - while (groupBase < (1 << BN.wordSize) / base) { - groupBase *= base; - groupSize += 1; - } - groupSizes[base] = groupSize; - groupBases[base] = groupBase; - } - - */ - - var zeros = [ - '', - '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' - ]; - - var groupSizes = [ - 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 - ]; - - var groupBases = [ - 0, 0, - 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216, - 43046721, 10000000, 19487171, 35831808, 62748517, 7529536, 11390625, - 16777216, 24137569, 34012224, 47045881, 64000000, 4084101, 5153632, - 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149, - 24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176 - ]; - - BN.prototype.toString = function toString (base, padding) { - base = base || 10; - padding = padding | 0 || 1; - - var out; - if (base === 16 || base === 'hex') { - out = ''; - var off = 0; - var carry = 0; - for (var i = 0; i < this.length; i++) { - var w = this.words[i]; - var word = (((w << off) | carry) & 0xffffff).toString(16); - carry = (w >>> (24 - off)) & 0xffffff; - if (carry !== 0 || i !== this.length - 1) { - out = zeros[6 - word.length] + word + out; - } else { - out = word + out; - } - off += 2; - if (off >= 26) { - off -= 26; - i--; - } - } - if (carry !== 0) { - out = carry.toString(16) + out; - } - while (out.length % padding !== 0) { - out = '0' + out; - } - if (this.negative !== 0) { - out = '-' + out; - } - return out; - } - - if (base === (base | 0) && base >= 2 && base <= 36) { - // var groupSize = Math.floor(BN.wordSize * Math.LN2 / Math.log(base)); - var groupSize = groupSizes[base]; - // var groupBase = Math.pow(base, groupSize); - var groupBase = groupBases[base]; - out = ''; - var c = this.clone(); - c.negative = 0; - while (!c.isZero()) { - var r = c.modn(groupBase).toString(base); - c = c.idivn(groupBase); - - if (!c.isZero()) { - out = zeros[groupSize - r.length] + r + out; - } else { - out = r + out; - } - } - if (this.isZero()) { - out = '0' + out; - } - while (out.length % padding !== 0) { - out = '0' + out; - } - if (this.negative !== 0) { - out = '-' + out; - } - return out; - } - - assert(false, 'Base should be between 2 and 36'); - }; - - BN.prototype.toNumber = function toNumber () { - var ret = this.words[0]; - if (this.length === 2) { - ret += this.words[1] * 0x4000000; - } else if (this.length === 3 && this.words[2] === 0x01) { - // NOTE: at this stage it is known that the top bit is set - ret += 0x10000000000000 + (this.words[1] * 0x4000000); - } else if (this.length > 2) { - assert(false, 'Number can only safely store up to 53 bits'); - } - return (this.negative !== 0) ? -ret : ret; - }; - - BN.prototype.toJSON = function toJSON () { - return this.toString(16); - }; - - BN.prototype.toBuffer = function toBuffer (endian, length) { - assert(typeof Buffer !== 'undefined'); - return this.toArrayLike(Buffer, endian, length); - }; - - BN.prototype.toArray = function toArray (endian, length) { - return this.toArrayLike(Array, endian, length); - }; - - BN.prototype.toArrayLike = function toArrayLike (ArrayType, endian, length) { - var byteLength = this.byteLength(); - var reqLength = length || Math.max(1, byteLength); - assert(byteLength <= reqLength, 'byte array longer than desired length'); - assert(reqLength > 0, 'Requested array length <= 0'); - - this.strip(); - var littleEndian = endian === 'le'; - var res = new ArrayType(reqLength); - - var b, i; - var q = this.clone(); - if (!littleEndian) { - // Assume big-endian - for (i = 0; i < reqLength - byteLength; i++) { - res[i] = 0; - } - - for (i = 0; !q.isZero(); i++) { - b = q.andln(0xff); - q.iushrn(8); - - res[reqLength - i - 1] = b; - } - } else { - for (i = 0; !q.isZero(); i++) { - b = q.andln(0xff); - q.iushrn(8); - - res[i] = b; - } - - for (; i < reqLength; i++) { - res[i] = 0; - } - } - - return res; - }; - - if (Math.clz32) { - BN.prototype._countBits = function _countBits (w) { - return 32 - Math.clz32(w); - }; - } else { - BN.prototype._countBits = function _countBits (w) { - var t = w; - var r = 0; - if (t >= 0x1000) { - r += 13; - t >>>= 13; - } - if (t >= 0x40) { - r += 7; - t >>>= 7; - } - if (t >= 0x8) { - r += 4; - t >>>= 4; - } - if (t >= 0x02) { - r += 2; - t >>>= 2; - } - return r + t; - }; - } - - BN.prototype._zeroBits = function _zeroBits (w) { - // Short-cut - if (w === 0) return 26; - - var t = w; - var r = 0; - if ((t & 0x1fff) === 0) { - r += 13; - t >>>= 13; - } - if ((t & 0x7f) === 0) { - r += 7; - t >>>= 7; - } - if ((t & 0xf) === 0) { - r += 4; - t >>>= 4; - } - if ((t & 0x3) === 0) { - r += 2; - t >>>= 2; - } - if ((t & 0x1) === 0) { - r++; - } - return r; - }; - - // Return number of used bits in a BN - BN.prototype.bitLength = function bitLength () { - var w = this.words[this.length - 1]; - var hi = this._countBits(w); - return (this.length - 1) * 26 + hi; - }; - - function toBitArray (num) { - var w = new Array(num.bitLength()); - - for (var bit = 0; bit < w.length; bit++) { - var off = (bit / 26) | 0; - var wbit = bit % 26; - - w[bit] = (num.words[off] & (1 << wbit)) >>> wbit; - } - - return w; - } - - // Number of trailing zero bits - BN.prototype.zeroBits = function zeroBits () { - if (this.isZero()) return 0; - - var r = 0; - for (var i = 0; i < this.length; i++) { - var b = this._zeroBits(this.words[i]); - r += b; - if (b !== 26) break; - } - return r; - }; - - BN.prototype.byteLength = function byteLength () { - return Math.ceil(this.bitLength() / 8); - }; - - BN.prototype.toTwos = function toTwos (width) { - if (this.negative !== 0) { - return this.abs().inotn(width).iaddn(1); - } - return this.clone(); - }; - - BN.prototype.fromTwos = function fromTwos (width) { - if (this.testn(width - 1)) { - return this.notn(width).iaddn(1).ineg(); - } - return this.clone(); - }; - - BN.prototype.isNeg = function isNeg () { - return this.negative !== 0; - }; - - // Return negative clone of `this` - BN.prototype.neg = function neg () { - return this.clone().ineg(); - }; - - BN.prototype.ineg = function ineg () { - if (!this.isZero()) { - this.negative ^= 1; - } - - return this; - }; - - // Or `num` with `this` in-place - BN.prototype.iuor = function iuor (num) { - while (this.length < num.length) { - this.words[this.length++] = 0; - } - - for (var i = 0; i < num.length; i++) { - this.words[i] = this.words[i] | num.words[i]; - } - - return this.strip(); - }; - - BN.prototype.ior = function ior (num) { - assert((this.negative | num.negative) === 0); - return this.iuor(num); - }; - - // Or `num` with `this` - BN.prototype.or = function or (num) { - if (this.length > num.length) return this.clone().ior(num); - return num.clone().ior(this); - }; - - BN.prototype.uor = function uor (num) { - if (this.length > num.length) return this.clone().iuor(num); - return num.clone().iuor(this); - }; - - // And `num` with `this` in-place - BN.prototype.iuand = function iuand (num) { - // b = min-length(num, this) - var b; - if (this.length > num.length) { - b = num; - } else { - b = this; - } - - for (var i = 0; i < b.length; i++) { - this.words[i] = this.words[i] & num.words[i]; - } - - this.length = b.length; - - return this.strip(); - }; - - BN.prototype.iand = function iand (num) { - assert((this.negative | num.negative) === 0); - return this.iuand(num); - }; - - // And `num` with `this` - BN.prototype.and = function and (num) { - if (this.length > num.length) return this.clone().iand(num); - return num.clone().iand(this); - }; - - BN.prototype.uand = function uand (num) { - if (this.length > num.length) return this.clone().iuand(num); - return num.clone().iuand(this); - }; - - // Xor `num` with `this` in-place - BN.prototype.iuxor = function iuxor (num) { - // a.length > b.length - var a; - var b; - if (this.length > num.length) { - a = this; - b = num; - } else { - a = num; - b = this; - } - - for (var i = 0; i < b.length; i++) { - this.words[i] = a.words[i] ^ b.words[i]; - } - - if (this !== a) { - for (; i < a.length; i++) { - this.words[i] = a.words[i]; - } - } - - this.length = a.length; - - return this.strip(); - }; - - BN.prototype.ixor = function ixor (num) { - assert((this.negative | num.negative) === 0); - return this.iuxor(num); - }; - - // Xor `num` with `this` - BN.prototype.xor = function xor (num) { - if (this.length > num.length) return this.clone().ixor(num); - return num.clone().ixor(this); - }; - - BN.prototype.uxor = function uxor (num) { - if (this.length > num.length) return this.clone().iuxor(num); - return num.clone().iuxor(this); - }; - - // Not ``this`` with ``width`` bitwidth - BN.prototype.inotn = function inotn (width) { - assert(typeof width === 'number' && width >= 0); - - var bytesNeeded = Math.ceil(width / 26) | 0; - var bitsLeft = width % 26; - - // Extend the buffer with leading zeroes - this._expand(bytesNeeded); - - if (bitsLeft > 0) { - bytesNeeded--; - } - - // Handle complete words - for (var i = 0; i < bytesNeeded; i++) { - this.words[i] = ~this.words[i] & 0x3ffffff; - } - - // Handle the residue - if (bitsLeft > 0) { - this.words[i] = ~this.words[i] & (0x3ffffff >> (26 - bitsLeft)); - } - - // And remove leading zeroes - return this.strip(); - }; - - BN.prototype.notn = function notn (width) { - return this.clone().inotn(width); - }; - - // Set `bit` of `this` - BN.prototype.setn = function setn (bit, val) { - assert(typeof bit === 'number' && bit >= 0); - - var off = (bit / 26) | 0; - var wbit = bit % 26; - - this._expand(off + 1); - - if (val) { - this.words[off] = this.words[off] | (1 << wbit); - } else { - this.words[off] = this.words[off] & ~(1 << wbit); - } - - return this.strip(); - }; - - // Add `num` to `this` in-place - BN.prototype.iadd = function iadd (num) { - var r; - - // negative + positive - if (this.negative !== 0 && num.negative === 0) { - this.negative = 0; - r = this.isub(num); - this.negative ^= 1; - return this._normSign(); - - // positive + negative - } else if (this.negative === 0 && num.negative !== 0) { - num.negative = 0; - r = this.isub(num); - num.negative = 1; - return r._normSign(); - } - - // a.length > b.length - var a, b; - if (this.length > num.length) { - a = this; - b = num; - } else { - a = num; - b = this; - } - - var carry = 0; - for (var i = 0; i < b.length; i++) { - r = (a.words[i] | 0) + (b.words[i] | 0) + carry; - this.words[i] = r & 0x3ffffff; - carry = r >>> 26; - } - for (; carry !== 0 && i < a.length; i++) { - r = (a.words[i] | 0) + carry; - this.words[i] = r & 0x3ffffff; - carry = r >>> 26; - } - - this.length = a.length; - if (carry !== 0) { - this.words[this.length] = carry; - this.length++; - // Copy the rest of the words - } else if (a !== this) { - for (; i < a.length; i++) { - this.words[i] = a.words[i]; - } - } - - return this; - }; - - // Add `num` to `this` - BN.prototype.add = function add (num) { - var res; - if (num.negative !== 0 && this.negative === 0) { - num.negative = 0; - res = this.sub(num); - num.negative ^= 1; - return res; - } else if (num.negative === 0 && this.negative !== 0) { - this.negative = 0; - res = num.sub(this); - this.negative = 1; - return res; - } - - if (this.length > num.length) return this.clone().iadd(num); - - return num.clone().iadd(this); - }; - - // Subtract `num` from `this` in-place - BN.prototype.isub = function isub (num) { - // this - (-num) = this + num - if (num.negative !== 0) { - num.negative = 0; - var r = this.iadd(num); - num.negative = 1; - return r._normSign(); - - // -this - num = -(this + num) - } else if (this.negative !== 0) { - this.negative = 0; - this.iadd(num); - this.negative = 1; - return this._normSign(); - } - - // At this point both numbers are positive - var cmp = this.cmp(num); - - // Optimization - zeroify - if (cmp === 0) { - this.negative = 0; - this.length = 1; - this.words[0] = 0; - return this; - } - - // a > b - var a, b; - if (cmp > 0) { - a = this; - b = num; - } else { - a = num; - b = this; - } - - var carry = 0; - for (var i = 0; i < b.length; i++) { - r = (a.words[i] | 0) - (b.words[i] | 0) + carry; - carry = r >> 26; - this.words[i] = r & 0x3ffffff; - } - for (; carry !== 0 && i < a.length; i++) { - r = (a.words[i] | 0) + carry; - carry = r >> 26; - this.words[i] = r & 0x3ffffff; - } - - // Copy rest of the words - if (carry === 0 && i < a.length && a !== this) { - for (; i < a.length; i++) { - this.words[i] = a.words[i]; - } - } - - this.length = Math.max(this.length, i); - - if (a !== this) { - this.negative = 1; - } + if (a !== this) { + this.negative = 1; + } return this.strip(); }; @@ -10993,17 +5227,17 @@ function fromByteArray (uint8) { }; })(typeof module === 'undefined' || module, this); -},{"buffer":36}],36:[function(require,module,exports){ +},{"buffer":28}],28:[function(require,module,exports){ -},{}],37:[function(require,module,exports){ -arguments[4][36][0].apply(exports,arguments) -},{"dup":36}],38:[function(require,module,exports){ +},{}],29:[function(require,module,exports){ +arguments[4][28][0].apply(exports,arguments) +},{"dup":28}],30:[function(require,module,exports){ var basex = require('base-x') var ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz' module.exports = basex(ALPHABET) -},{"base-x":33}],39:[function(require,module,exports){ +},{"base-x":25}],31:[function(require,module,exports){ (function (Buffer){ /*! * The buffer module from node.js, for the browser. @@ -12784,13 +7018,13 @@ function numberIsNaN (obj) { } }).call(this,require("buffer").Buffer) -},{"base64-js":34,"buffer":39,"ieee754":56}],40:[function(require,module,exports){ +},{"base64-js":26,"buffer":31,"ieee754":48}],32:[function(require,module,exports){ require(".").check("es5"); -},{".":41}],41:[function(require,module,exports){ +},{".":33}],33:[function(require,module,exports){ require("./lib/definitions"); module.exports = require("./lib"); -},{"./lib":44,"./lib/definitions":43}],42:[function(require,module,exports){ +},{"./lib":36,"./lib/definitions":35}],34:[function(require,module,exports){ var CapabilityDetector = function () { this.tests = {}; this.cache = {}; @@ -12820,7 +7054,7 @@ CapabilityDetector.prototype = { }; module.exports = CapabilityDetector; -},{}],43:[function(require,module,exports){ +},{}],35:[function(require,module,exports){ var capability = require("."), define = capability.define, test = capability.test; @@ -12889,7 +7123,7 @@ define("Error.prototype.stack", function () { return e.stack || e.stacktrace; } }); -},{".":44}],44:[function(require,module,exports){ +},{".":36}],36:[function(require,module,exports){ var CapabilityDetector = require("./CapabilityDetector"); var detector = new CapabilityDetector(); @@ -12906,7 +7140,7 @@ capability.check = function (name) { capability.test = capability; module.exports = capability; -},{"./CapabilityDetector":42}],45:[function(require,module,exports){ +},{"./CapabilityDetector":34}],37:[function(require,module,exports){ /*! * depd * Copyright(c) 2015 Douglas Christopher Wilson @@ -12985,9 +7219,9 @@ function wrapproperty (obj, prop, message) { } } -},{}],46:[function(require,module,exports){ +},{}],38:[function(require,module,exports){ module.exports = require("./lib"); -},{"./lib":47}],47:[function(require,module,exports){ +},{"./lib":39}],39:[function(require,module,exports){ require("capability/es5"); var capability = require("capability"); @@ -13001,7 +7235,7 @@ else polyfill = require("./unsupported"); module.exports = polyfill(); -},{"./non-v8/index":51,"./unsupported":53,"./v8":54,"capability":41,"capability/es5":40}],48:[function(require,module,exports){ +},{"./non-v8/index":43,"./unsupported":45,"./v8":46,"capability":33,"capability/es5":32}],40:[function(require,module,exports){ var Class = require("o3").Class, abstractMethod = require("o3").abstractMethod; @@ -13032,7 +7266,7 @@ var Frame = Class(Object, { }); module.exports = Frame; -},{"o3":59}],49:[function(require,module,exports){ +},{"o3":51}],41:[function(require,module,exports){ var Class = require("o3").Class, Frame = require("./Frame"), cache = require("u3").cache; @@ -13071,7 +7305,7 @@ module.exports = { return instance; }) }; -},{"./Frame":48,"o3":59,"u3":81}],50:[function(require,module,exports){ +},{"./Frame":40,"o3":51,"u3":62}],42:[function(require,module,exports){ var Class = require("o3").Class, abstractMethod = require("o3").abstractMethod, eachCombination = require("u3").eachCombination, @@ -13205,7 +7439,7 @@ module.exports = { return instance; }) }; -},{"capability":41,"o3":59,"u3":81}],51:[function(require,module,exports){ +},{"capability":33,"o3":51,"u3":62}],43:[function(require,module,exports){ var FrameStringSource = require("./FrameStringSource"), FrameStringParser = require("./FrameStringParser"), cache = require("u3").cache, @@ -13279,7 +7513,7 @@ module.exports = function () { prepareStackTrace: prepareStackTrace }; }; -},{"../prepareStackTrace":52,"./FrameStringParser":49,"./FrameStringSource":50,"u3":81}],52:[function(require,module,exports){ +},{"../prepareStackTrace":44,"./FrameStringParser":41,"./FrameStringSource":42,"u3":62}],44:[function(require,module,exports){ var prepareStackTrace = function (throwable, frames, warnings) { var string = ""; string += throwable.name || "Error"; @@ -13297,7 +7531,7 @@ var prepareStackTrace = function (throwable, frames, warnings) { }; module.exports = prepareStackTrace; -},{}],53:[function(require,module,exports){ +},{}],45:[function(require,module,exports){ var cache = require("u3").cache, prepareStackTrace = require("./prepareStackTrace"); @@ -13345,3124 +7579,1257 @@ module.exports = function () { }; return { - prepareStackTrace: prepareStackTrace - }; -}; -},{"./prepareStackTrace":52,"u3":81}],54:[function(require,module,exports){ -var prepareStackTrace = require("./prepareStackTrace"); - -module.exports = function () { - Error.getStackTrace = function (throwable) { - return throwable.stack; - }; - - return { - prepareStackTrace: prepareStackTrace - }; -}; -},{"./prepareStackTrace":52}],55:[function(require,module,exports){ -/*! - * http-errors - * Copyright(c) 2014 Jonathan Ong - * Copyright(c) 2016 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module dependencies. - * @private - */ - -var deprecate = require('depd')('http-errors') -var setPrototypeOf = require('setprototypeof') -var statuses = require('statuses') -var inherits = require('inherits') -var toIdentifier = require('toidentifier') - -/** - * Module exports. - * @public - */ - -module.exports = createError -module.exports.HttpError = createHttpErrorConstructor() - -// Populate exports for all constructors -populateConstructorExports(module.exports, statuses.codes, module.exports.HttpError) - -/** - * Get the code class of a status code. - * @private - */ - -function codeClass (status) { - return Number(String(status).charAt(0) + '00') -} - -/** - * Create a new HTTP Error. - * - * @returns {Error} - * @public - */ - -function createError () { - // so much arity going on ~_~ - var err - var msg - var status = 500 - var props = {} - for (var i = 0; i < arguments.length; i++) { - var arg = arguments[i] - if (arg instanceof Error) { - err = arg - status = err.status || err.statusCode || status - continue - } - switch (typeof arg) { - case 'string': - msg = arg - break - case 'number': - status = arg - if (i !== 0) { - deprecate('non-first-argument status code; replace with createError(' + arg + ', ...)') - } - break - case 'object': - props = arg - break - } - } - - if (typeof status === 'number' && (status < 400 || status >= 600)) { - deprecate('non-error status code; use only 4xx or 5xx status codes') - } - - if (typeof status !== 'number' || - (!statuses[status] && (status < 400 || status >= 600))) { - status = 500 - } - - // constructor - var HttpError = createError[status] || createError[codeClass(status)] - - if (!err) { - // create error - err = HttpError - ? new HttpError(msg) - : new Error(msg || statuses[status]) - Error.captureStackTrace(err, createError) - } - - if (!HttpError || !(err instanceof HttpError) || err.status !== status) { - // add properties to generic error - err.expose = status < 500 - err.status = err.statusCode = status - } - - for (var key in props) { - if (key !== 'status' && key !== 'statusCode') { - err[key] = props[key] - } - } - - return err -} - -/** - * Create HTTP error abstract base class. - * @private - */ - -function createHttpErrorConstructor () { - function HttpError () { - throw new TypeError('cannot construct abstract class') - } - - inherits(HttpError, Error) - - return HttpError -} - -/** - * Create a constructor for a client error. - * @private - */ - -function createClientErrorConstructor (HttpError, name, code) { - var className = name.match(/Error$/) ? name : name + 'Error' - - function ClientError (message) { - // create the error object - var msg = message != null ? message : statuses[code] - var err = new Error(msg) - - // capture a stack trace to the construction point - Error.captureStackTrace(err, ClientError) - - // adjust the [[Prototype]] - setPrototypeOf(err, ClientError.prototype) - - // redefine the error message - Object.defineProperty(err, 'message', { - enumerable: true, - configurable: true, - value: msg, - writable: true - }) - - // redefine the error name - Object.defineProperty(err, 'name', { - enumerable: false, - configurable: true, - value: className, - writable: true - }) - - return err - } - - inherits(ClientError, HttpError) - nameFunc(ClientError, className) - - ClientError.prototype.status = code - ClientError.prototype.statusCode = code - ClientError.prototype.expose = true - - return ClientError -} - -/** - * Create a constructor for a server error. - * @private - */ - -function createServerErrorConstructor (HttpError, name, code) { - var className = name.match(/Error$/) ? name : name + 'Error' - - function ServerError (message) { - // create the error object - var msg = message != null ? message : statuses[code] - var err = new Error(msg) - - // capture a stack trace to the construction point - Error.captureStackTrace(err, ServerError) - - // adjust the [[Prototype]] - setPrototypeOf(err, ServerError.prototype) - - // redefine the error message - Object.defineProperty(err, 'message', { - enumerable: true, - configurable: true, - value: msg, - writable: true - }) - - // redefine the error name - Object.defineProperty(err, 'name', { - enumerable: false, - configurable: true, - value: className, - writable: true - }) - - return err - } - - inherits(ServerError, HttpError) - nameFunc(ServerError, className) - - ServerError.prototype.status = code - ServerError.prototype.statusCode = code - ServerError.prototype.expose = false + prepareStackTrace: prepareStackTrace + }; +}; +},{"./prepareStackTrace":44,"u3":62}],46:[function(require,module,exports){ +var prepareStackTrace = require("./prepareStackTrace"); + +module.exports = function () { + Error.getStackTrace = function (throwable) { + return throwable.stack; + }; + + return { + prepareStackTrace: prepareStackTrace + }; +}; +},{"./prepareStackTrace":44}],47:[function(require,module,exports){ +/*! + * http-errors + * Copyright(c) 2014 Jonathan Ong + * Copyright(c) 2016 Douglas Christopher Wilson + * MIT Licensed + */ - return ServerError -} +'use strict' /** - * Set the name of a function, if possible. + * Module dependencies. * @private */ -function nameFunc (func, name) { - var desc = Object.getOwnPropertyDescriptor(func, 'name') - - if (desc && desc.configurable) { - desc.value = name - Object.defineProperty(func, 'name', desc) - } -} +var deprecate = require('depd')('http-errors') +var setPrototypeOf = require('setprototypeof') +var statuses = require('statuses') +var inherits = require('inherits') +var toIdentifier = require('toidentifier') /** - * Populate the exports object with constructors for every error class. - * @private + * Module exports. + * @public */ -function populateConstructorExports (exports, codes, HttpError) { - codes.forEach(function forEachCode (code) { - var CodeError - var name = toIdentifier(statuses[code]) - - switch (codeClass(code)) { - case 400: - CodeError = createClientErrorConstructor(HttpError, name, code) - break - case 500: - CodeError = createServerErrorConstructor(HttpError, name, code) - break - } - - if (CodeError) { - // export the constructor - exports[code] = CodeError - exports[name] = CodeError - } - }) - - // backwards-compatibility - exports["I'mateapot"] = deprecate.function(exports.ImATeapot, - '"I\'mateapot"; use "ImATeapot" instead') -} - -},{"depd":45,"inherits":57,"setprototypeof":76,"statuses":78,"toidentifier":79}],56:[function(require,module,exports){ -exports.read = function (buffer, offset, isLE, mLen, nBytes) { - var e, m - var eLen = (nBytes * 8) - mLen - 1 - var eMax = (1 << eLen) - 1 - var eBias = eMax >> 1 - var nBits = -7 - var i = isLE ? (nBytes - 1) : 0 - var d = isLE ? -1 : 1 - var s = buffer[offset + i] - - i += d +module.exports = createError +module.exports.HttpError = createHttpErrorConstructor() - e = s & ((1 << (-nBits)) - 1) - s >>= (-nBits) - nBits += eLen - for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {} +// Populate exports for all constructors +populateConstructorExports(module.exports, statuses.codes, module.exports.HttpError) - m = e & ((1 << (-nBits)) - 1) - e >>= (-nBits) - nBits += mLen - for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {} +/** + * Get the code class of a status code. + * @private + */ - if (e === 0) { - e = 1 - eBias - } else if (e === eMax) { - return m ? NaN : ((s ? -1 : 1) * Infinity) - } else { - m = m + Math.pow(2, mLen) - e = e - eBias - } - return (s ? -1 : 1) * m * Math.pow(2, e - mLen) +function codeClass (status) { + return Number(String(status).charAt(0) + '00') } -exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { - var e, m, c - var eLen = (nBytes * 8) - mLen - 1 - var eMax = (1 << eLen) - 1 - var eBias = eMax >> 1 - var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0) - var i = isLE ? 0 : (nBytes - 1) - var d = isLE ? 1 : -1 - var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0 - - value = Math.abs(value) - - if (isNaN(value) || value === Infinity) { - m = isNaN(value) ? 1 : 0 - e = eMax - } else { - e = Math.floor(Math.log(value) / Math.LN2) - if (value * (c = Math.pow(2, -e)) < 1) { - e-- - c *= 2 - } - if (e + eBias >= 1) { - value += rt / c - } else { - value += rt * Math.pow(2, 1 - eBias) - } - if (value * c >= 2) { - e++ - c /= 2 - } +/** + * Create a new HTTP Error. + * + * @returns {Error} + * @public + */ - if (e + eBias >= eMax) { - m = 0 - e = eMax - } else if (e + eBias >= 1) { - m = ((value * c) - 1) * Math.pow(2, mLen) - e = e + eBias - } else { - m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen) - e = 0 +function createError () { + // so much arity going on ~_~ + var err + var msg + var status = 500 + var props = {} + for (var i = 0; i < arguments.length; i++) { + var arg = arguments[i] + if (arg instanceof Error) { + err = arg + status = err.status || err.statusCode || status + continue } - } - - for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {} - - e = (e << mLen) | m - eLen += mLen - for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {} - - buffer[offset + i - d] |= s * 128 -} - -},{}],57:[function(require,module,exports){ -if (typeof Object.create === 'function') { - // implementation from standard node.js 'util' module - module.exports = function inherits(ctor, superCtor) { - if (superCtor) { - ctor.super_ = superCtor - ctor.prototype = Object.create(superCtor.prototype, { - constructor: { - value: ctor, - enumerable: false, - writable: true, - configurable: true + switch (typeof arg) { + case 'string': + msg = arg + break + case 'number': + status = arg + if (i !== 0) { + deprecate('non-first-argument status code; replace with createError(' + arg + ', ...)') } - }) - } - }; -} else { - // old school shim for old browsers - module.exports = function inherits(ctor, superCtor) { - if (superCtor) { - ctor.super_ = superCtor - var TempCtor = function () {} - TempCtor.prototype = superCtor.prototype - ctor.prototype = new TempCtor() - ctor.prototype.constructor = ctor + break + case 'object': + props = arg + break } } -} - -},{}],58:[function(require,module,exports){ -(function (process,global){ -/** - * [js-sha256]{@link https://github.com/emn178/js-sha256} - * - * @version 0.9.0 - * @author Chen, Yi-Cyuan [emn178@gmail.com] - * @copyright Chen, Yi-Cyuan 2014-2017 - * @license MIT - */ -/*jslint bitwise: true */ -(function () { - 'use strict'; - var ERROR = 'input is invalid type'; - var WINDOW = typeof window === 'object'; - var root = WINDOW ? window : {}; - if (root.JS_SHA256_NO_WINDOW) { - WINDOW = false; + if (typeof status === 'number' && (status < 400 || status >= 600)) { + deprecate('non-error status code; use only 4xx or 5xx status codes') } - var WEB_WORKER = !WINDOW && typeof self === 'object'; - var NODE_JS = !root.JS_SHA256_NO_NODE_JS && typeof process === 'object' && process.versions && process.versions.node; - if (NODE_JS) { - root = global; - } else if (WEB_WORKER) { - root = self; + + if (typeof status !== 'number' || + (!statuses[status] && (status < 400 || status >= 600))) { + status = 500 } - var COMMON_JS = !root.JS_SHA256_NO_COMMON_JS && typeof module === 'object' && module.exports; - var AMD = typeof define === 'function' && define.amd; - var ARRAY_BUFFER = !root.JS_SHA256_NO_ARRAY_BUFFER && typeof ArrayBuffer !== 'undefined'; - var HEX_CHARS = '0123456789abcdef'.split(''); - var EXTRA = [-2147483648, 8388608, 32768, 128]; - var SHIFT = [24, 16, 8, 0]; - var K = [ - 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, - 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, - 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, - 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, - 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, - 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, - 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, - 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 - ]; - var OUTPUT_TYPES = ['hex', 'array', 'digest', 'arrayBuffer']; - var blocks = []; + // constructor + var HttpError = createError[status] || createError[codeClass(status)] - if (root.JS_SHA256_NO_NODE_JS || !Array.isArray) { - Array.isArray = function (obj) { - return Object.prototype.toString.call(obj) === '[object Array]'; - }; + if (!err) { + // create error + err = HttpError + ? new HttpError(msg) + : new Error(msg || statuses[status]) + Error.captureStackTrace(err, createError) } - if (ARRAY_BUFFER && (root.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW || !ArrayBuffer.isView)) { - ArrayBuffer.isView = function (obj) { - return typeof obj === 'object' && obj.buffer && obj.buffer.constructor === ArrayBuffer; - }; + if (!HttpError || !(err instanceof HttpError) || err.status !== status) { + // add properties to generic error + err.expose = status < 500 + err.status = err.statusCode = status } - var createOutputMethod = function (outputType, is224) { - return function (message) { - return new Sha256(is224, true).update(message)[outputType](); - }; - }; - - var createMethod = function (is224) { - var method = createOutputMethod('hex', is224); - if (NODE_JS) { - method = nodeWrap(method, is224); - } - method.create = function () { - return new Sha256(is224); - }; - method.update = function (message) { - return method.create().update(message); - }; - for (var i = 0; i < OUTPUT_TYPES.length; ++i) { - var type = OUTPUT_TYPES[i]; - method[type] = createOutputMethod(type, is224); + for (var key in props) { + if (key !== 'status' && key !== 'statusCode') { + err[key] = props[key] } - return method; - }; + } - var nodeWrap = function (method, is224) { - var crypto = eval("require('crypto')"); - var Buffer = eval("require('buffer').Buffer"); - var algorithm = is224 ? 'sha224' : 'sha256'; - var nodeMethod = function (message) { - if (typeof message === 'string') { - return crypto.createHash(algorithm).update(message, 'utf8').digest('hex'); - } else { - if (message === null || message === undefined) { - throw new Error(ERROR); - } else if (message.constructor === ArrayBuffer) { - message = new Uint8Array(message); - } - } - if (Array.isArray(message) || ArrayBuffer.isView(message) || - message.constructor === Buffer) { - return crypto.createHash(algorithm).update(new Buffer(message)).digest('hex'); - } else { - return method(message); - } - }; - return nodeMethod; - }; + return err +} - var createHmacOutputMethod = function (outputType, is224) { - return function (key, message) { - return new HmacSha256(key, is224, true).update(message)[outputType](); - }; - }; +/** + * Create HTTP error abstract base class. + * @private + */ - var createHmacMethod = function (is224) { - var method = createHmacOutputMethod('hex', is224); - method.create = function (key) { - return new HmacSha256(key, is224); - }; - method.update = function (key, message) { - return method.create(key).update(message); - }; - for (var i = 0; i < OUTPUT_TYPES.length; ++i) { - var type = OUTPUT_TYPES[i]; - method[type] = createHmacOutputMethod(type, is224); - } - return method; - }; +function createHttpErrorConstructor () { + function HttpError () { + throw new TypeError('cannot construct abstract class') + } - function Sha256(is224, sharedMemory) { - if (sharedMemory) { - blocks[0] = blocks[16] = blocks[1] = blocks[2] = blocks[3] = - blocks[4] = blocks[5] = blocks[6] = blocks[7] = - blocks[8] = blocks[9] = blocks[10] = blocks[11] = - blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0; - this.blocks = blocks; - } else { - this.blocks = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; - } + inherits(HttpError, Error) - if (is224) { - this.h0 = 0xc1059ed8; - this.h1 = 0x367cd507; - this.h2 = 0x3070dd17; - this.h3 = 0xf70e5939; - this.h4 = 0xffc00b31; - this.h5 = 0x68581511; - this.h6 = 0x64f98fa7; - this.h7 = 0xbefa4fa4; - } else { // 256 - this.h0 = 0x6a09e667; - this.h1 = 0xbb67ae85; - this.h2 = 0x3c6ef372; - this.h3 = 0xa54ff53a; - this.h4 = 0x510e527f; - this.h5 = 0x9b05688c; - this.h6 = 0x1f83d9ab; - this.h7 = 0x5be0cd19; - } + return HttpError +} - this.block = this.start = this.bytes = this.hBytes = 0; - this.finalized = this.hashed = false; - this.first = true; - this.is224 = is224; - } +/** + * Create a constructor for a client error. + * @private + */ - Sha256.prototype.update = function (message) { - if (this.finalized) { - return; - } - var notString, type = typeof message; - if (type !== 'string') { - if (type === 'object') { - if (message === null) { - throw new Error(ERROR); - } else if (ARRAY_BUFFER && message.constructor === ArrayBuffer) { - message = new Uint8Array(message); - } else if (!Array.isArray(message)) { - if (!ARRAY_BUFFER || !ArrayBuffer.isView(message)) { - throw new Error(ERROR); - } - } - } else { - throw new Error(ERROR); - } - notString = true; - } - var code, index = 0, i, length = message.length, blocks = this.blocks; +function createClientErrorConstructor (HttpError, name, code) { + var className = name.match(/Error$/) ? name : name + 'Error' - while (index < length) { - if (this.hashed) { - this.hashed = false; - blocks[0] = this.block; - blocks[16] = blocks[1] = blocks[2] = blocks[3] = - blocks[4] = blocks[5] = blocks[6] = blocks[7] = - blocks[8] = blocks[9] = blocks[10] = blocks[11] = - blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0; - } + function ClientError (message) { + // create the error object + var msg = message != null ? message : statuses[code] + var err = new Error(msg) - if (notString) { - for (i = this.start; index < length && i < 64; ++index) { - blocks[i >> 2] |= message[index] << SHIFT[i++ & 3]; - } - } else { - for (i = this.start; index < length && i < 64; ++index) { - code = message.charCodeAt(index); - if (code < 0x80) { - blocks[i >> 2] |= code << SHIFT[i++ & 3]; - } else if (code < 0x800) { - blocks[i >> 2] |= (0xc0 | (code >> 6)) << SHIFT[i++ & 3]; - blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3]; - } else if (code < 0xd800 || code >= 0xe000) { - blocks[i >> 2] |= (0xe0 | (code >> 12)) << SHIFT[i++ & 3]; - blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3]; - blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3]; - } else { - code = 0x10000 + (((code & 0x3ff) << 10) | (message.charCodeAt(++index) & 0x3ff)); - blocks[i >> 2] |= (0xf0 | (code >> 18)) << SHIFT[i++ & 3]; - blocks[i >> 2] |= (0x80 | ((code >> 12) & 0x3f)) << SHIFT[i++ & 3]; - blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3]; - blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3]; - } - } - } + // capture a stack trace to the construction point + Error.captureStackTrace(err, ClientError) - this.lastByteIndex = i; - this.bytes += i - this.start; - if (i >= 64) { - this.block = blocks[16]; - this.start = i - 64; - this.hash(); - this.hashed = true; - } else { - this.start = i; - } - } - if (this.bytes > 4294967295) { - this.hBytes += this.bytes / 4294967296 << 0; - this.bytes = this.bytes % 4294967296; - } - return this; - }; + // adjust the [[Prototype]] + setPrototypeOf(err, ClientError.prototype) - Sha256.prototype.finalize = function () { - if (this.finalized) { - return; - } - this.finalized = true; - var blocks = this.blocks, i = this.lastByteIndex; - blocks[16] = this.block; - blocks[i >> 2] |= EXTRA[i & 3]; - this.block = blocks[16]; - if (i >= 56) { - if (!this.hashed) { - this.hash(); - } - blocks[0] = this.block; - blocks[16] = blocks[1] = blocks[2] = blocks[3] = - blocks[4] = blocks[5] = blocks[6] = blocks[7] = - blocks[8] = blocks[9] = blocks[10] = blocks[11] = - blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0; - } - blocks[14] = this.hBytes << 3 | this.bytes >>> 29; - blocks[15] = this.bytes << 3; - this.hash(); - }; + // redefine the error message + Object.defineProperty(err, 'message', { + enumerable: true, + configurable: true, + value: msg, + writable: true + }) + + // redefine the error name + Object.defineProperty(err, 'name', { + enumerable: false, + configurable: true, + value: className, + writable: true + }) + + return err + } + + inherits(ClientError, HttpError) + nameFunc(ClientError, className) + + ClientError.prototype.status = code + ClientError.prototype.statusCode = code + ClientError.prototype.expose = true - Sha256.prototype.hash = function () { - var a = this.h0, b = this.h1, c = this.h2, d = this.h3, e = this.h4, f = this.h5, g = this.h6, - h = this.h7, blocks = this.blocks, j, s0, s1, maj, t1, t2, ch, ab, da, cd, bc; + return ClientError +} - for (j = 16; j < 64; ++j) { - // rightrotate - t1 = blocks[j - 15]; - s0 = ((t1 >>> 7) | (t1 << 25)) ^ ((t1 >>> 18) | (t1 << 14)) ^ (t1 >>> 3); - t1 = blocks[j - 2]; - s1 = ((t1 >>> 17) | (t1 << 15)) ^ ((t1 >>> 19) | (t1 << 13)) ^ (t1 >>> 10); - blocks[j] = blocks[j - 16] + s0 + blocks[j - 7] + s1 << 0; - } +/** + * Create a constructor for a server error. + * @private + */ - bc = b & c; - for (j = 0; j < 64; j += 4) { - if (this.first) { - if (this.is224) { - ab = 300032; - t1 = blocks[0] - 1413257819; - h = t1 - 150054599 << 0; - d = t1 + 24177077 << 0; - } else { - ab = 704751109; - t1 = blocks[0] - 210244248; - h = t1 - 1521486534 << 0; - d = t1 + 143694565 << 0; - } - this.first = false; - } else { - s0 = ((a >>> 2) | (a << 30)) ^ ((a >>> 13) | (a << 19)) ^ ((a >>> 22) | (a << 10)); - s1 = ((e >>> 6) | (e << 26)) ^ ((e >>> 11) | (e << 21)) ^ ((e >>> 25) | (e << 7)); - ab = a & b; - maj = ab ^ (a & c) ^ bc; - ch = (e & f) ^ (~e & g); - t1 = h + s1 + ch + K[j] + blocks[j]; - t2 = s0 + maj; - h = d + t1 << 0; - d = t1 + t2 << 0; - } - s0 = ((d >>> 2) | (d << 30)) ^ ((d >>> 13) | (d << 19)) ^ ((d >>> 22) | (d << 10)); - s1 = ((h >>> 6) | (h << 26)) ^ ((h >>> 11) | (h << 21)) ^ ((h >>> 25) | (h << 7)); - da = d & a; - maj = da ^ (d & b) ^ ab; - ch = (h & e) ^ (~h & f); - t1 = g + s1 + ch + K[j + 1] + blocks[j + 1]; - t2 = s0 + maj; - g = c + t1 << 0; - c = t1 + t2 << 0; - s0 = ((c >>> 2) | (c << 30)) ^ ((c >>> 13) | (c << 19)) ^ ((c >>> 22) | (c << 10)); - s1 = ((g >>> 6) | (g << 26)) ^ ((g >>> 11) | (g << 21)) ^ ((g >>> 25) | (g << 7)); - cd = c & d; - maj = cd ^ (c & a) ^ da; - ch = (g & h) ^ (~g & e); - t1 = f + s1 + ch + K[j + 2] + blocks[j + 2]; - t2 = s0 + maj; - f = b + t1 << 0; - b = t1 + t2 << 0; - s0 = ((b >>> 2) | (b << 30)) ^ ((b >>> 13) | (b << 19)) ^ ((b >>> 22) | (b << 10)); - s1 = ((f >>> 6) | (f << 26)) ^ ((f >>> 11) | (f << 21)) ^ ((f >>> 25) | (f << 7)); - bc = b & c; - maj = bc ^ (b & d) ^ cd; - ch = (f & g) ^ (~f & h); - t1 = e + s1 + ch + K[j + 3] + blocks[j + 3]; - t2 = s0 + maj; - e = a + t1 << 0; - a = t1 + t2 << 0; - } +function createServerErrorConstructor (HttpError, name, code) { + var className = name.match(/Error$/) ? name : name + 'Error' - this.h0 = this.h0 + a << 0; - this.h1 = this.h1 + b << 0; - this.h2 = this.h2 + c << 0; - this.h3 = this.h3 + d << 0; - this.h4 = this.h4 + e << 0; - this.h5 = this.h5 + f << 0; - this.h6 = this.h6 + g << 0; - this.h7 = this.h7 + h << 0; - }; + function ServerError (message) { + // create the error object + var msg = message != null ? message : statuses[code] + var err = new Error(msg) - Sha256.prototype.hex = function () { - this.finalize(); + // capture a stack trace to the construction point + Error.captureStackTrace(err, ServerError) - var h0 = this.h0, h1 = this.h1, h2 = this.h2, h3 = this.h3, h4 = this.h4, h5 = this.h5, - h6 = this.h6, h7 = this.h7; + // adjust the [[Prototype]] + setPrototypeOf(err, ServerError.prototype) - var hex = HEX_CHARS[(h0 >> 28) & 0x0F] + HEX_CHARS[(h0 >> 24) & 0x0F] + - HEX_CHARS[(h0 >> 20) & 0x0F] + HEX_CHARS[(h0 >> 16) & 0x0F] + - HEX_CHARS[(h0 >> 12) & 0x0F] + HEX_CHARS[(h0 >> 8) & 0x0F] + - HEX_CHARS[(h0 >> 4) & 0x0F] + HEX_CHARS[h0 & 0x0F] + - HEX_CHARS[(h1 >> 28) & 0x0F] + HEX_CHARS[(h1 >> 24) & 0x0F] + - HEX_CHARS[(h1 >> 20) & 0x0F] + HEX_CHARS[(h1 >> 16) & 0x0F] + - HEX_CHARS[(h1 >> 12) & 0x0F] + HEX_CHARS[(h1 >> 8) & 0x0F] + - HEX_CHARS[(h1 >> 4) & 0x0F] + HEX_CHARS[h1 & 0x0F] + - HEX_CHARS[(h2 >> 28) & 0x0F] + HEX_CHARS[(h2 >> 24) & 0x0F] + - HEX_CHARS[(h2 >> 20) & 0x0F] + HEX_CHARS[(h2 >> 16) & 0x0F] + - HEX_CHARS[(h2 >> 12) & 0x0F] + HEX_CHARS[(h2 >> 8) & 0x0F] + - HEX_CHARS[(h2 >> 4) & 0x0F] + HEX_CHARS[h2 & 0x0F] + - HEX_CHARS[(h3 >> 28) & 0x0F] + HEX_CHARS[(h3 >> 24) & 0x0F] + - HEX_CHARS[(h3 >> 20) & 0x0F] + HEX_CHARS[(h3 >> 16) & 0x0F] + - HEX_CHARS[(h3 >> 12) & 0x0F] + HEX_CHARS[(h3 >> 8) & 0x0F] + - HEX_CHARS[(h3 >> 4) & 0x0F] + HEX_CHARS[h3 & 0x0F] + - HEX_CHARS[(h4 >> 28) & 0x0F] + HEX_CHARS[(h4 >> 24) & 0x0F] + - HEX_CHARS[(h4 >> 20) & 0x0F] + HEX_CHARS[(h4 >> 16) & 0x0F] + - HEX_CHARS[(h4 >> 12) & 0x0F] + HEX_CHARS[(h4 >> 8) & 0x0F] + - HEX_CHARS[(h4 >> 4) & 0x0F] + HEX_CHARS[h4 & 0x0F] + - HEX_CHARS[(h5 >> 28) & 0x0F] + HEX_CHARS[(h5 >> 24) & 0x0F] + - HEX_CHARS[(h5 >> 20) & 0x0F] + HEX_CHARS[(h5 >> 16) & 0x0F] + - HEX_CHARS[(h5 >> 12) & 0x0F] + HEX_CHARS[(h5 >> 8) & 0x0F] + - HEX_CHARS[(h5 >> 4) & 0x0F] + HEX_CHARS[h5 & 0x0F] + - HEX_CHARS[(h6 >> 28) & 0x0F] + HEX_CHARS[(h6 >> 24) & 0x0F] + - HEX_CHARS[(h6 >> 20) & 0x0F] + HEX_CHARS[(h6 >> 16) & 0x0F] + - HEX_CHARS[(h6 >> 12) & 0x0F] + HEX_CHARS[(h6 >> 8) & 0x0F] + - HEX_CHARS[(h6 >> 4) & 0x0F] + HEX_CHARS[h6 & 0x0F]; - if (!this.is224) { - hex += HEX_CHARS[(h7 >> 28) & 0x0F] + HEX_CHARS[(h7 >> 24) & 0x0F] + - HEX_CHARS[(h7 >> 20) & 0x0F] + HEX_CHARS[(h7 >> 16) & 0x0F] + - HEX_CHARS[(h7 >> 12) & 0x0F] + HEX_CHARS[(h7 >> 8) & 0x0F] + - HEX_CHARS[(h7 >> 4) & 0x0F] + HEX_CHARS[h7 & 0x0F]; - } - return hex; - }; + // redefine the error message + Object.defineProperty(err, 'message', { + enumerable: true, + configurable: true, + value: msg, + writable: true + }) - Sha256.prototype.toString = Sha256.prototype.hex; + // redefine the error name + Object.defineProperty(err, 'name', { + enumerable: false, + configurable: true, + value: className, + writable: true + }) - Sha256.prototype.digest = function () { - this.finalize(); + return err + } - var h0 = this.h0, h1 = this.h1, h2 = this.h2, h3 = this.h3, h4 = this.h4, h5 = this.h5, - h6 = this.h6, h7 = this.h7; + inherits(ServerError, HttpError) + nameFunc(ServerError, className) - var arr = [ - (h0 >> 24) & 0xFF, (h0 >> 16) & 0xFF, (h0 >> 8) & 0xFF, h0 & 0xFF, - (h1 >> 24) & 0xFF, (h1 >> 16) & 0xFF, (h1 >> 8) & 0xFF, h1 & 0xFF, - (h2 >> 24) & 0xFF, (h2 >> 16) & 0xFF, (h2 >> 8) & 0xFF, h2 & 0xFF, - (h3 >> 24) & 0xFF, (h3 >> 16) & 0xFF, (h3 >> 8) & 0xFF, h3 & 0xFF, - (h4 >> 24) & 0xFF, (h4 >> 16) & 0xFF, (h4 >> 8) & 0xFF, h4 & 0xFF, - (h5 >> 24) & 0xFF, (h5 >> 16) & 0xFF, (h5 >> 8) & 0xFF, h5 & 0xFF, - (h6 >> 24) & 0xFF, (h6 >> 16) & 0xFF, (h6 >> 8) & 0xFF, h6 & 0xFF - ]; - if (!this.is224) { - arr.push((h7 >> 24) & 0xFF, (h7 >> 16) & 0xFF, (h7 >> 8) & 0xFF, h7 & 0xFF); - } - return arr; - }; + ServerError.prototype.status = code + ServerError.prototype.statusCode = code + ServerError.prototype.expose = false - Sha256.prototype.array = Sha256.prototype.digest; + return ServerError +} - Sha256.prototype.arrayBuffer = function () { - this.finalize(); +/** + * Set the name of a function, if possible. + * @private + */ - var buffer = new ArrayBuffer(this.is224 ? 28 : 32); - var dataView = new DataView(buffer); - dataView.setUint32(0, this.h0); - dataView.setUint32(4, this.h1); - dataView.setUint32(8, this.h2); - dataView.setUint32(12, this.h3); - dataView.setUint32(16, this.h4); - dataView.setUint32(20, this.h5); - dataView.setUint32(24, this.h6); - if (!this.is224) { - dataView.setUint32(28, this.h7); - } - return buffer; - }; +function nameFunc (func, name) { + var desc = Object.getOwnPropertyDescriptor(func, 'name') - function HmacSha256(key, is224, sharedMemory) { - var i, type = typeof key; - if (type === 'string') { - var bytes = [], length = key.length, index = 0, code; - for (i = 0; i < length; ++i) { - code = key.charCodeAt(i); - if (code < 0x80) { - bytes[index++] = code; - } else if (code < 0x800) { - bytes[index++] = (0xc0 | (code >> 6)); - bytes[index++] = (0x80 | (code & 0x3f)); - } else if (code < 0xd800 || code >= 0xe000) { - bytes[index++] = (0xe0 | (code >> 12)); - bytes[index++] = (0x80 | ((code >> 6) & 0x3f)); - bytes[index++] = (0x80 | (code & 0x3f)); - } else { - code = 0x10000 + (((code & 0x3ff) << 10) | (key.charCodeAt(++i) & 0x3ff)); - bytes[index++] = (0xf0 | (code >> 18)); - bytes[index++] = (0x80 | ((code >> 12) & 0x3f)); - bytes[index++] = (0x80 | ((code >> 6) & 0x3f)); - bytes[index++] = (0x80 | (code & 0x3f)); - } - } - key = bytes; - } else { - if (type === 'object') { - if (key === null) { - throw new Error(ERROR); - } else if (ARRAY_BUFFER && key.constructor === ArrayBuffer) { - key = new Uint8Array(key); - } else if (!Array.isArray(key)) { - if (!ARRAY_BUFFER || !ArrayBuffer.isView(key)) { - throw new Error(ERROR); - } - } - } else { - throw new Error(ERROR); - } + if (desc && desc.configurable) { + desc.value = name + Object.defineProperty(func, 'name', desc) + } +} + +/** + * Populate the exports object with constructors for every error class. + * @private + */ + +function populateConstructorExports (exports, codes, HttpError) { + codes.forEach(function forEachCode (code) { + var CodeError + var name = toIdentifier(statuses[code]) + + switch (codeClass(code)) { + case 400: + CodeError = createClientErrorConstructor(HttpError, name, code) + break + case 500: + CodeError = createServerErrorConstructor(HttpError, name, code) + break } - if (key.length > 64) { - key = (new Sha256(is224, true)).update(key).array(); + if (CodeError) { + // export the constructor + exports[code] = CodeError + exports[name] = CodeError } + }) - var oKeyPad = [], iKeyPad = []; - for (i = 0; i < 64; ++i) { - var b = key[i] || 0; - oKeyPad[i] = 0x5c ^ b; - iKeyPad[i] = 0x36 ^ b; - } + // backwards-compatibility + exports["I'mateapot"] = deprecate.function(exports.ImATeapot, + '"I\'mateapot"; use "ImATeapot" instead') +} - Sha256.call(this, is224, sharedMemory); +},{"depd":37,"inherits":49,"setprototypeof":57,"statuses":59,"toidentifier":60}],48:[function(require,module,exports){ +exports.read = function (buffer, offset, isLE, mLen, nBytes) { + var e, m + var eLen = (nBytes * 8) - mLen - 1 + var eMax = (1 << eLen) - 1 + var eBias = eMax >> 1 + var nBits = -7 + var i = isLE ? (nBytes - 1) : 0 + var d = isLE ? -1 : 1 + var s = buffer[offset + i] - this.update(iKeyPad); - this.oKeyPad = oKeyPad; - this.inner = true; - this.sharedMemory = sharedMemory; - } - HmacSha256.prototype = new Sha256(); + i += d - HmacSha256.prototype.finalize = function () { - Sha256.prototype.finalize.call(this); - if (this.inner) { - this.inner = false; - var innerHash = this.array(); - Sha256.call(this, this.is224, this.sharedMemory); - this.update(this.oKeyPad); - this.update(innerHash); - Sha256.prototype.finalize.call(this); - } - }; + e = s & ((1 << (-nBits)) - 1) + s >>= (-nBits) + nBits += eLen + for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {} - var exports = createMethod(); - exports.sha256 = exports; - exports.sha224 = createMethod(true); - exports.sha256.hmac = createHmacMethod(); - exports.sha224.hmac = createHmacMethod(true); + m = e & ((1 << (-nBits)) - 1) + e >>= (-nBits) + nBits += mLen + for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {} - if (COMMON_JS) { - module.exports = exports; + if (e === 0) { + e = 1 - eBias + } else if (e === eMax) { + return m ? NaN : ((s ? -1 : 1) * Infinity) } else { - root.sha256 = exports.sha256; - root.sha224 = exports.sha224; - if (AMD) { - define(function () { - return exports; - }); - } + m = m + Math.pow(2, mLen) + e = e - eBias } -})(); + return (s ? -1 : 1) * m * Math.pow(2, e - mLen) +} -}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"_process":63}],59:[function(require,module,exports){ -require("capability/es5"); - -module.exports = require("./lib"); -},{"./lib":62,"capability/es5":40}],60:[function(require,module,exports){ -var Class = function () { - var options = Object.create({ - Source: Object, - config: {}, - buildArgs: [] - }); - - function checkOption(option) { - var key = "config"; - if (option instanceof Function) - key = "Source"; - else if (option instanceof Array) - key = "buildArgs"; - else if (option instanceof Object) - key = "config"; - else - throw new Error("Invalid configuration option."); - if (options.hasOwnProperty(key)) - throw new Error("Duplicated configuration option: " + key + "."); - options[key] = option; - } - - for (var index = 0, length = arguments.length; index < length; ++index) - checkOption(arguments[index]); - - var Source = options.Source, - config = options.config, - buildArgs = options.buildArgs; - - return (Source.extend || Class.extend).call(Source, config, buildArgs); -}; - -Class.factory = function () { - var Source = this; - return function () { - var instance = this; - if (instance.build instanceof Function) - instance.build.apply(instance, arguments); - if (instance.init instanceof Function) - instance.init.apply(instance, arguments); - }; -}; - -Class.extend = function (config, buildArgs) { - var Source = this; - if (!config) - config = {}; - var Subject; - if ((config.prototype instanceof Object) && config.prototype.constructor !== Object) - Subject = config.prototype.constructor; - else if (config.factory instanceof Function) - Subject = config.factory.call(Source); - Subject = (Source.clone || Class.clone).call(Source, Subject, buildArgs); - (Subject.merge || Class.merge).call(Subject, config); - return Subject; -}; - -Class.prototype.extend = function (config, buildArgs) { - var subject = this; - var instance = (subject.clone || Class.prototype.clone).apply(subject, buildArgs); - (instance.merge || Class.prototype.merge).call(instance, config); - return instance; -}; - -Class.clone = function (Subject, buildArgs) { - var Source = this; - if (!(Subject instanceof Function)) - Subject = (Source.factory || Class.factory).call(Source); - Subject.prototype = (Source.prototype.clone || Class.prototype.clone).apply(Source.prototype, buildArgs || []); - Subject.prototype.constructor = Subject; - for (var staticProperty in Source) - if (staticProperty !== "prototype") - Subject[staticProperty] = Source[staticProperty]; - return Subject; -}; - -Class.prototype.clone = function () { - var subject = this; - var instance = Object.create(subject); - if (instance.build instanceof Function) - instance.build.apply(instance, arguments); - return instance; -}; - -Class.merge = function (config) { - var Subject = this; - for (var staticProperty in config) - if (staticProperty !== "prototype") - Subject[staticProperty] = config[staticProperty]; - if (config.prototype instanceof Object) - (Subject.prototype.merge || Class.prototype.merge).call(Subject.prototype, config.prototype); - return Subject; -}; - -Class.prototype.merge = function (config) { - var subject = this; - for (var property in config) - if (property !== "constructor") - subject[property] = config[property]; - return subject; -}; - -Class.absorb = function (config) { - var Subject = this; - for (var staticProperty in config) - if (staticProperty !== "prototype" && (Subject[staticProperty] === undefined || Subject[staticProperty] === Function.prototype[staticProperty])) - Subject[staticProperty] = config[staticProperty]; - if (config.prototype instanceof Object) - (Subject.prototype.absorb || Class.prototype.absorb).call(Subject.prototype, config.prototype); - return Subject; -}; - -Class.prototype.absorb = function (config) { - var subject = this; - for (var property in config) - if (property !== "constructor" && (subject[property] === undefined || subject[property] === Object.prototype[property])) - subject[property] = config[property]; - return subject; -}; - -Class.getAncestor = function () { - var Source = this; - if (Source !== Source.prototype.constructor) - return Source.prototype.constructor; -}; - -Class.newInstance = function () { - var Subject = this; - var instance = Object.create(this.prototype); - Subject.apply(instance, arguments); - return instance; -}; - -module.exports = Class; -},{}],61:[function(require,module,exports){ -module.exports = function () { - throw new Error("Not implemented."); -}; -},{}],62:[function(require,module,exports){ -module.exports = { - Class: require("./Class"), - abstractMethod: require("./abstractMethod") -}; -},{"./Class":60,"./abstractMethod":61}],63:[function(require,module,exports){ -// shim for using process in browser -var process = module.exports = {}; +exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { + var e, m, c + var eLen = (nBytes * 8) - mLen - 1 + var eMax = (1 << eLen) - 1 + var eBias = eMax >> 1 + var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0) + var i = isLE ? 0 : (nBytes - 1) + var d = isLE ? 1 : -1 + var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0 + + value = Math.abs(value) + + if (isNaN(value) || value === Infinity) { + m = isNaN(value) ? 1 : 0 + e = eMax + } else { + e = Math.floor(Math.log(value) / Math.LN2) + if (value * (c = Math.pow(2, -e)) < 1) { + e-- + c *= 2 + } + if (e + eBias >= 1) { + value += rt / c + } else { + value += rt * Math.pow(2, 1 - eBias) + } + if (value * c >= 2) { + e++ + c /= 2 + } -// cached from whatever global is present so that test runners that stub it -// don't break things. But we need to wrap it in a try catch in case it is -// wrapped in strict mode code which doesn't define any globals. It's inside a -// function because try/catches deoptimize in certain engines. + if (e + eBias >= eMax) { + m = 0 + e = eMax + } else if (e + eBias >= 1) { + m = ((value * c) - 1) * Math.pow(2, mLen) + e = e + eBias + } else { + m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen) + e = 0 + } + } -var cachedSetTimeout; -var cachedClearTimeout; + for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {} -function defaultSetTimout() { - throw new Error('setTimeout has not been defined'); + e = (e << mLen) | m + eLen += mLen + for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {} + + buffer[offset + i - d] |= s * 128 } -function defaultClearTimeout () { - throw new Error('clearTimeout has not been defined'); + +},{}],49:[function(require,module,exports){ +if (typeof Object.create === 'function') { + // implementation from standard node.js 'util' module + module.exports = function inherits(ctor, superCtor) { + ctor.super_ = superCtor + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }); + }; +} else { + // old school shim for old browsers + module.exports = function inherits(ctor, superCtor) { + ctor.super_ = superCtor + var TempCtor = function () {} + TempCtor.prototype = superCtor.prototype + ctor.prototype = new TempCtor() + ctor.prototype.constructor = ctor + } } + +},{}],50:[function(require,module,exports){ +(function (process,global){ +/** + * [js-sha256]{@link https://github.com/emn178/js-sha256} + * + * @version 0.9.0 + * @author Chen, Yi-Cyuan [emn178@gmail.com] + * @copyright Chen, Yi-Cyuan 2014-2017 + * @license MIT + */ +/*jslint bitwise: true */ (function () { - try { - if (typeof setTimeout === 'function') { - cachedSetTimeout = setTimeout; - } else { - cachedSetTimeout = defaultSetTimout; - } - } catch (e) { - cachedSetTimeout = defaultSetTimout; - } - try { - if (typeof clearTimeout === 'function') { - cachedClearTimeout = clearTimeout; - } else { - cachedClearTimeout = defaultClearTimeout; - } - } catch (e) { - cachedClearTimeout = defaultClearTimeout; - } -} ()) -function runTimeout(fun) { - if (cachedSetTimeout === setTimeout) { - //normal enviroments in sane situations - return setTimeout(fun, 0); + 'use strict'; + + var ERROR = 'input is invalid type'; + var WINDOW = typeof window === 'object'; + var root = WINDOW ? window : {}; + if (root.JS_SHA256_NO_WINDOW) { + WINDOW = false; + } + var WEB_WORKER = !WINDOW && typeof self === 'object'; + var NODE_JS = !root.JS_SHA256_NO_NODE_JS && typeof process === 'object' && process.versions && process.versions.node; + if (NODE_JS) { + root = global; + } else if (WEB_WORKER) { + root = self; + } + var COMMON_JS = !root.JS_SHA256_NO_COMMON_JS && typeof module === 'object' && module.exports; + var AMD = typeof define === 'function' && define.amd; + var ARRAY_BUFFER = !root.JS_SHA256_NO_ARRAY_BUFFER && typeof ArrayBuffer !== 'undefined'; + var HEX_CHARS = '0123456789abcdef'.split(''); + var EXTRA = [-2147483648, 8388608, 32768, 128]; + var SHIFT = [24, 16, 8, 0]; + var K = [ + 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, + 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, + 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, + 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, + 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, + 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, + 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, + 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 + ]; + var OUTPUT_TYPES = ['hex', 'array', 'digest', 'arrayBuffer']; + + var blocks = []; + + if (root.JS_SHA256_NO_NODE_JS || !Array.isArray) { + Array.isArray = function (obj) { + return Object.prototype.toString.call(obj) === '[object Array]'; + }; + } + + if (ARRAY_BUFFER && (root.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW || !ArrayBuffer.isView)) { + ArrayBuffer.isView = function (obj) { + return typeof obj === 'object' && obj.buffer && obj.buffer.constructor === ArrayBuffer; + }; + } + + var createOutputMethod = function (outputType, is224) { + return function (message) { + return new Sha256(is224, true).update(message)[outputType](); + }; + }; + + var createMethod = function (is224) { + var method = createOutputMethod('hex', is224); + if (NODE_JS) { + method = nodeWrap(method, is224); } - // if setTimeout wasn't available but was latter defined - if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { - cachedSetTimeout = setTimeout; - return setTimeout(fun, 0); + method.create = function () { + return new Sha256(is224); + }; + method.update = function (message) { + return method.create().update(message); + }; + for (var i = 0; i < OUTPUT_TYPES.length; ++i) { + var type = OUTPUT_TYPES[i]; + method[type] = createOutputMethod(type, is224); } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedSetTimeout(fun, 0); - } catch(e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedSetTimeout.call(null, fun, 0); - } catch(e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error - return cachedSetTimeout.call(this, fun, 0); + return method; + }; + + var nodeWrap = function (method, is224) { + var crypto = eval("require('crypto')"); + var Buffer = eval("require('buffer').Buffer"); + var algorithm = is224 ? 'sha224' : 'sha256'; + var nodeMethod = function (message) { + if (typeof message === 'string') { + return crypto.createHash(algorithm).update(message, 'utf8').digest('hex'); + } else { + if (message === null || message === undefined) { + throw new Error(ERROR); + } else if (message.constructor === ArrayBuffer) { + message = new Uint8Array(message); } - } + } + if (Array.isArray(message) || ArrayBuffer.isView(message) || + message.constructor === Buffer) { + return crypto.createHash(algorithm).update(new Buffer(message)).digest('hex'); + } else { + return method(message); + } + }; + return nodeMethod; + }; + var createHmacOutputMethod = function (outputType, is224) { + return function (key, message) { + return new HmacSha256(key, is224, true).update(message)[outputType](); + }; + }; -} -function runClearTimeout(marker) { - if (cachedClearTimeout === clearTimeout) { - //normal enviroments in sane situations - return clearTimeout(marker); + var createHmacMethod = function (is224) { + var method = createHmacOutputMethod('hex', is224); + method.create = function (key) { + return new HmacSha256(key, is224); + }; + method.update = function (key, message) { + return method.create(key).update(message); + }; + for (var i = 0; i < OUTPUT_TYPES.length; ++i) { + var type = OUTPUT_TYPES[i]; + method[type] = createHmacOutputMethod(type, is224); } - // if clearTimeout wasn't available but was latter defined - if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { - cachedClearTimeout = clearTimeout; - return clearTimeout(marker); + return method; + }; + + function Sha256(is224, sharedMemory) { + if (sharedMemory) { + blocks[0] = blocks[16] = blocks[1] = blocks[2] = blocks[3] = + blocks[4] = blocks[5] = blocks[6] = blocks[7] = + blocks[8] = blocks[9] = blocks[10] = blocks[11] = + blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0; + this.blocks = blocks; + } else { + this.blocks = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedClearTimeout(marker); - } catch (e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedClearTimeout.call(null, marker); - } catch (e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. - // Some versions of I.E. have different rules for clearTimeout vs setTimeout - return cachedClearTimeout.call(this, marker); + + if (is224) { + this.h0 = 0xc1059ed8; + this.h1 = 0x367cd507; + this.h2 = 0x3070dd17; + this.h3 = 0xf70e5939; + this.h4 = 0xffc00b31; + this.h5 = 0x68581511; + this.h6 = 0x64f98fa7; + this.h7 = 0xbefa4fa4; + } else { // 256 + this.h0 = 0x6a09e667; + this.h1 = 0xbb67ae85; + this.h2 = 0x3c6ef372; + this.h3 = 0xa54ff53a; + this.h4 = 0x510e527f; + this.h5 = 0x9b05688c; + this.h6 = 0x1f83d9ab; + this.h7 = 0x5be0cd19; + } + + this.block = this.start = this.bytes = this.hBytes = 0; + this.finalized = this.hashed = false; + this.first = true; + this.is224 = is224; + } + + Sha256.prototype.update = function (message) { + if (this.finalized) { + return; + } + var notString, type = typeof message; + if (type !== 'string') { + if (type === 'object') { + if (message === null) { + throw new Error(ERROR); + } else if (ARRAY_BUFFER && message.constructor === ArrayBuffer) { + message = new Uint8Array(message); + } else if (!Array.isArray(message)) { + if (!ARRAY_BUFFER || !ArrayBuffer.isView(message)) { + throw new Error(ERROR); + } } + } else { + throw new Error(ERROR); + } + notString = true; } + var code, index = 0, i, length = message.length, blocks = this.blocks; + while (index < length) { + if (this.hashed) { + this.hashed = false; + blocks[0] = this.block; + blocks[16] = blocks[1] = blocks[2] = blocks[3] = + blocks[4] = blocks[5] = blocks[6] = blocks[7] = + blocks[8] = blocks[9] = blocks[10] = blocks[11] = + blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0; + } + if (notString) { + for (i = this.start; index < length && i < 64; ++index) { + blocks[i >> 2] |= message[index] << SHIFT[i++ & 3]; + } + } else { + for (i = this.start; index < length && i < 64; ++index) { + code = message.charCodeAt(index); + if (code < 0x80) { + blocks[i >> 2] |= code << SHIFT[i++ & 3]; + } else if (code < 0x800) { + blocks[i >> 2] |= (0xc0 | (code >> 6)) << SHIFT[i++ & 3]; + blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3]; + } else if (code < 0xd800 || code >= 0xe000) { + blocks[i >> 2] |= (0xe0 | (code >> 12)) << SHIFT[i++ & 3]; + blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3]; + blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3]; + } else { + code = 0x10000 + (((code & 0x3ff) << 10) | (message.charCodeAt(++index) & 0x3ff)); + blocks[i >> 2] |= (0xf0 | (code >> 18)) << SHIFT[i++ & 3]; + blocks[i >> 2] |= (0x80 | ((code >> 12) & 0x3f)) << SHIFT[i++ & 3]; + blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3]; + blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3]; + } + } + } -} -var queue = []; -var draining = false; -var currentQueue; -var queueIndex = -1; - -function cleanUpNextTick() { - if (!draining || !currentQueue) { - return; - } - draining = false; - if (currentQueue.length) { - queue = currentQueue.concat(queue); - } else { - queueIndex = -1; + this.lastByteIndex = i; + this.bytes += i - this.start; + if (i >= 64) { + this.block = blocks[16]; + this.start = i - 64; + this.hash(); + this.hashed = true; + } else { + this.start = i; + } } - if (queue.length) { - drainQueue(); + if (this.bytes > 4294967295) { + this.hBytes += this.bytes / 4294967296 << 0; + this.bytes = this.bytes % 4294967296; } -} + return this; + }; -function drainQueue() { - if (draining) { - return; + Sha256.prototype.finalize = function () { + if (this.finalized) { + return; } - var timeout = runTimeout(cleanUpNextTick); - draining = true; + this.finalized = true; + var blocks = this.blocks, i = this.lastByteIndex; + blocks[16] = this.block; + blocks[i >> 2] |= EXTRA[i & 3]; + this.block = blocks[16]; + if (i >= 56) { + if (!this.hashed) { + this.hash(); + } + blocks[0] = this.block; + blocks[16] = blocks[1] = blocks[2] = blocks[3] = + blocks[4] = blocks[5] = blocks[6] = blocks[7] = + blocks[8] = blocks[9] = blocks[10] = blocks[11] = + blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0; + } + blocks[14] = this.hBytes << 3 | this.bytes >>> 29; + blocks[15] = this.bytes << 3; + this.hash(); + }; - var len = queue.length; - while(len) { - currentQueue = queue; - queue = []; - while (++queueIndex < len) { - if (currentQueue) { - currentQueue[queueIndex].run(); - } - } - queueIndex = -1; - len = queue.length; + Sha256.prototype.hash = function () { + var a = this.h0, b = this.h1, c = this.h2, d = this.h3, e = this.h4, f = this.h5, g = this.h6, + h = this.h7, blocks = this.blocks, j, s0, s1, maj, t1, t2, ch, ab, da, cd, bc; + + for (j = 16; j < 64; ++j) { + // rightrotate + t1 = blocks[j - 15]; + s0 = ((t1 >>> 7) | (t1 << 25)) ^ ((t1 >>> 18) | (t1 << 14)) ^ (t1 >>> 3); + t1 = blocks[j - 2]; + s1 = ((t1 >>> 17) | (t1 << 15)) ^ ((t1 >>> 19) | (t1 << 13)) ^ (t1 >>> 10); + blocks[j] = blocks[j - 16] + s0 + blocks[j - 7] + s1 << 0; } - currentQueue = null; - draining = false; - runClearTimeout(timeout); -} -process.nextTick = function (fun) { - var args = new Array(arguments.length - 1); - if (arguments.length > 1) { - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; + bc = b & c; + for (j = 0; j < 64; j += 4) { + if (this.first) { + if (this.is224) { + ab = 300032; + t1 = blocks[0] - 1413257819; + h = t1 - 150054599 << 0; + d = t1 + 24177077 << 0; + } else { + ab = 704751109; + t1 = blocks[0] - 210244248; + h = t1 - 1521486534 << 0; + d = t1 + 143694565 << 0; } + this.first = false; + } else { + s0 = ((a >>> 2) | (a << 30)) ^ ((a >>> 13) | (a << 19)) ^ ((a >>> 22) | (a << 10)); + s1 = ((e >>> 6) | (e << 26)) ^ ((e >>> 11) | (e << 21)) ^ ((e >>> 25) | (e << 7)); + ab = a & b; + maj = ab ^ (a & c) ^ bc; + ch = (e & f) ^ (~e & g); + t1 = h + s1 + ch + K[j] + blocks[j]; + t2 = s0 + maj; + h = d + t1 << 0; + d = t1 + t2 << 0; + } + s0 = ((d >>> 2) | (d << 30)) ^ ((d >>> 13) | (d << 19)) ^ ((d >>> 22) | (d << 10)); + s1 = ((h >>> 6) | (h << 26)) ^ ((h >>> 11) | (h << 21)) ^ ((h >>> 25) | (h << 7)); + da = d & a; + maj = da ^ (d & b) ^ ab; + ch = (h & e) ^ (~h & f); + t1 = g + s1 + ch + K[j + 1] + blocks[j + 1]; + t2 = s0 + maj; + g = c + t1 << 0; + c = t1 + t2 << 0; + s0 = ((c >>> 2) | (c << 30)) ^ ((c >>> 13) | (c << 19)) ^ ((c >>> 22) | (c << 10)); + s1 = ((g >>> 6) | (g << 26)) ^ ((g >>> 11) | (g << 21)) ^ ((g >>> 25) | (g << 7)); + cd = c & d; + maj = cd ^ (c & a) ^ da; + ch = (g & h) ^ (~g & e); + t1 = f + s1 + ch + K[j + 2] + blocks[j + 2]; + t2 = s0 + maj; + f = b + t1 << 0; + b = t1 + t2 << 0; + s0 = ((b >>> 2) | (b << 30)) ^ ((b >>> 13) | (b << 19)) ^ ((b >>> 22) | (b << 10)); + s1 = ((f >>> 6) | (f << 26)) ^ ((f >>> 11) | (f << 21)) ^ ((f >>> 25) | (f << 7)); + bc = b & c; + maj = bc ^ (b & d) ^ cd; + ch = (f & g) ^ (~f & h); + t1 = e + s1 + ch + K[j + 3] + blocks[j + 3]; + t2 = s0 + maj; + e = a + t1 << 0; + a = t1 + t2 << 0; } - queue.push(new Item(fun, args)); - if (queue.length === 1 && !draining) { - runTimeout(drainQueue); - } -}; -// v8 likes predictible objects -function Item(fun, array) { - this.fun = fun; - this.array = array; -} -Item.prototype.run = function () { - this.fun.apply(null, this.array); -}; -process.title = 'browser'; -process.browser = true; -process.env = {}; -process.argv = []; -process.version = ''; // empty string to avoid regexp issues -process.versions = {}; + this.h0 = this.h0 + a << 0; + this.h1 = this.h1 + b << 0; + this.h2 = this.h2 + c << 0; + this.h3 = this.h3 + d << 0; + this.h4 = this.h4 + e << 0; + this.h5 = this.h5 + f << 0; + this.h6 = this.h6 + g << 0; + this.h7 = this.h7 + h << 0; + }; + + Sha256.prototype.hex = function () { + this.finalize(); + + var h0 = this.h0, h1 = this.h1, h2 = this.h2, h3 = this.h3, h4 = this.h4, h5 = this.h5, + h6 = this.h6, h7 = this.h7; + + var hex = HEX_CHARS[(h0 >> 28) & 0x0F] + HEX_CHARS[(h0 >> 24) & 0x0F] + + HEX_CHARS[(h0 >> 20) & 0x0F] + HEX_CHARS[(h0 >> 16) & 0x0F] + + HEX_CHARS[(h0 >> 12) & 0x0F] + HEX_CHARS[(h0 >> 8) & 0x0F] + + HEX_CHARS[(h0 >> 4) & 0x0F] + HEX_CHARS[h0 & 0x0F] + + HEX_CHARS[(h1 >> 28) & 0x0F] + HEX_CHARS[(h1 >> 24) & 0x0F] + + HEX_CHARS[(h1 >> 20) & 0x0F] + HEX_CHARS[(h1 >> 16) & 0x0F] + + HEX_CHARS[(h1 >> 12) & 0x0F] + HEX_CHARS[(h1 >> 8) & 0x0F] + + HEX_CHARS[(h1 >> 4) & 0x0F] + HEX_CHARS[h1 & 0x0F] + + HEX_CHARS[(h2 >> 28) & 0x0F] + HEX_CHARS[(h2 >> 24) & 0x0F] + + HEX_CHARS[(h2 >> 20) & 0x0F] + HEX_CHARS[(h2 >> 16) & 0x0F] + + HEX_CHARS[(h2 >> 12) & 0x0F] + HEX_CHARS[(h2 >> 8) & 0x0F] + + HEX_CHARS[(h2 >> 4) & 0x0F] + HEX_CHARS[h2 & 0x0F] + + HEX_CHARS[(h3 >> 28) & 0x0F] + HEX_CHARS[(h3 >> 24) & 0x0F] + + HEX_CHARS[(h3 >> 20) & 0x0F] + HEX_CHARS[(h3 >> 16) & 0x0F] + + HEX_CHARS[(h3 >> 12) & 0x0F] + HEX_CHARS[(h3 >> 8) & 0x0F] + + HEX_CHARS[(h3 >> 4) & 0x0F] + HEX_CHARS[h3 & 0x0F] + + HEX_CHARS[(h4 >> 28) & 0x0F] + HEX_CHARS[(h4 >> 24) & 0x0F] + + HEX_CHARS[(h4 >> 20) & 0x0F] + HEX_CHARS[(h4 >> 16) & 0x0F] + + HEX_CHARS[(h4 >> 12) & 0x0F] + HEX_CHARS[(h4 >> 8) & 0x0F] + + HEX_CHARS[(h4 >> 4) & 0x0F] + HEX_CHARS[h4 & 0x0F] + + HEX_CHARS[(h5 >> 28) & 0x0F] + HEX_CHARS[(h5 >> 24) & 0x0F] + + HEX_CHARS[(h5 >> 20) & 0x0F] + HEX_CHARS[(h5 >> 16) & 0x0F] + + HEX_CHARS[(h5 >> 12) & 0x0F] + HEX_CHARS[(h5 >> 8) & 0x0F] + + HEX_CHARS[(h5 >> 4) & 0x0F] + HEX_CHARS[h5 & 0x0F] + + HEX_CHARS[(h6 >> 28) & 0x0F] + HEX_CHARS[(h6 >> 24) & 0x0F] + + HEX_CHARS[(h6 >> 20) & 0x0F] + HEX_CHARS[(h6 >> 16) & 0x0F] + + HEX_CHARS[(h6 >> 12) & 0x0F] + HEX_CHARS[(h6 >> 8) & 0x0F] + + HEX_CHARS[(h6 >> 4) & 0x0F] + HEX_CHARS[h6 & 0x0F]; + if (!this.is224) { + hex += HEX_CHARS[(h7 >> 28) & 0x0F] + HEX_CHARS[(h7 >> 24) & 0x0F] + + HEX_CHARS[(h7 >> 20) & 0x0F] + HEX_CHARS[(h7 >> 16) & 0x0F] + + HEX_CHARS[(h7 >> 12) & 0x0F] + HEX_CHARS[(h7 >> 8) & 0x0F] + + HEX_CHARS[(h7 >> 4) & 0x0F] + HEX_CHARS[h7 & 0x0F]; + } + return hex; + }; -function noop() {} + Sha256.prototype.toString = Sha256.prototype.hex; -process.on = noop; -process.addListener = noop; -process.once = noop; -process.off = noop; -process.removeListener = noop; -process.removeAllListeners = noop; -process.emit = noop; -process.prependListener = noop; -process.prependOnceListener = noop; + Sha256.prototype.digest = function () { + this.finalize(); -process.listeners = function (name) { return [] } + var h0 = this.h0, h1 = this.h1, h2 = this.h2, h3 = this.h3, h4 = this.h4, h5 = this.h5, + h6 = this.h6, h7 = this.h7; -process.binding = function (name) { - throw new Error('process.binding is not supported'); -}; + var arr = [ + (h0 >> 24) & 0xFF, (h0 >> 16) & 0xFF, (h0 >> 8) & 0xFF, h0 & 0xFF, + (h1 >> 24) & 0xFF, (h1 >> 16) & 0xFF, (h1 >> 8) & 0xFF, h1 & 0xFF, + (h2 >> 24) & 0xFF, (h2 >> 16) & 0xFF, (h2 >> 8) & 0xFF, h2 & 0xFF, + (h3 >> 24) & 0xFF, (h3 >> 16) & 0xFF, (h3 >> 8) & 0xFF, h3 & 0xFF, + (h4 >> 24) & 0xFF, (h4 >> 16) & 0xFF, (h4 >> 8) & 0xFF, h4 & 0xFF, + (h5 >> 24) & 0xFF, (h5 >> 16) & 0xFF, (h5 >> 8) & 0xFF, h5 & 0xFF, + (h6 >> 24) & 0xFF, (h6 >> 16) & 0xFF, (h6 >> 8) & 0xFF, h6 & 0xFF + ]; + if (!this.is224) { + arr.push((h7 >> 24) & 0xFF, (h7 >> 16) & 0xFF, (h7 >> 8) & 0xFF, h7 & 0xFF); + } + return arr; + }; -process.cwd = function () { return '/' }; -process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); -}; -process.umask = function() { return 0; }; + Sha256.prototype.array = Sha256.prototype.digest; -},{}],64:[function(require,module,exports){ -// minimal library entry point. - -"use strict"; -module.exports = require("./src/index-minimal"); + Sha256.prototype.arrayBuffer = function () { + this.finalize(); -},{"./src/index-minimal":65}],65:[function(require,module,exports){ -"use strict"; -var protobuf = exports; - -/** - * Build type, one of `"full"`, `"light"` or `"minimal"`. - * @name build - * @type {string} - * @const - */ -protobuf.build = "minimal"; - -// Serialization -protobuf.Writer = require("./writer"); -protobuf.BufferWriter = require("./writer_buffer"); -protobuf.Reader = require("./reader"); -protobuf.BufferReader = require("./reader_buffer"); - -// Utility -protobuf.util = require("./util/minimal"); -protobuf.rpc = require("./rpc"); -protobuf.roots = require("./roots"); -protobuf.configure = configure; - -/* istanbul ignore next */ -/** - * Reconfigures the library according to the environment. - * @returns {undefined} - */ -function configure() { - protobuf.Reader._configure(protobuf.BufferReader); - protobuf.util._configure(); -} - -// Set up buffer utility according to the environment -protobuf.Writer._configure(protobuf.BufferWriter); -configure(); + var buffer = new ArrayBuffer(this.is224 ? 28 : 32); + var dataView = new DataView(buffer); + dataView.setUint32(0, this.h0); + dataView.setUint32(4, this.h1); + dataView.setUint32(8, this.h2); + dataView.setUint32(12, this.h3); + dataView.setUint32(16, this.h4); + dataView.setUint32(20, this.h5); + dataView.setUint32(24, this.h6); + if (!this.is224) { + dataView.setUint32(28, this.h7); + } + return buffer; + }; -},{"./reader":66,"./reader_buffer":67,"./roots":68,"./rpc":69,"./util/minimal":72,"./writer":73,"./writer_buffer":74}],66:[function(require,module,exports){ -"use strict"; -module.exports = Reader; - -var util = require("./util/minimal"); - -var BufferReader; // cyclic - -var LongBits = util.LongBits, - utf8 = util.utf8; - -/* istanbul ignore next */ -function indexOutOfRange(reader, writeLength) { - return RangeError("index out of range: " + reader.pos + " + " + (writeLength || 1) + " > " + reader.len); -} - -/** - * Constructs a new reader instance using the specified buffer. - * @classdesc Wire format reader using `Uint8Array` if available, otherwise `Array`. - * @constructor - * @param {Uint8Array} buffer Buffer to read from - */ -function Reader(buffer) { - - /** - * Read buffer. - * @type {Uint8Array} - */ - this.buf = buffer; - - /** - * Read buffer position. - * @type {number} - */ - this.pos = 0; - - /** - * Read buffer length. - * @type {number} - */ - this.len = buffer.length; -} - -var create_array = typeof Uint8Array !== "undefined" - ? function create_typed_array(buffer) { - if (buffer instanceof Uint8Array || Array.isArray(buffer)) - return new Reader(buffer); - throw Error("illegal buffer"); - } - /* istanbul ignore next */ - : function create_array(buffer) { - if (Array.isArray(buffer)) - return new Reader(buffer); - throw Error("illegal buffer"); - }; - -/** - * Creates a new reader using the specified buffer. - * @function - * @param {Uint8Array|Buffer} buffer Buffer to read from - * @returns {Reader|BufferReader} A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader} - * @throws {Error} If `buffer` is not a valid buffer - */ -Reader.create = util.Buffer - ? function create_buffer_setup(buffer) { - return (Reader.create = function create_buffer(buffer) { - return util.Buffer.isBuffer(buffer) - ? new BufferReader(buffer) - /* istanbul ignore next */ - : create_array(buffer); - })(buffer); - } - /* istanbul ignore next */ - : create_array; - -Reader.prototype._slice = util.Array.prototype.subarray || /* istanbul ignore next */ util.Array.prototype.slice; - -/** - * Reads a varint as an unsigned 32 bit value. - * @function - * @returns {number} Value read - */ -Reader.prototype.uint32 = (function read_uint32_setup() { - var value = 4294967295; // optimizer type-hint, tends to deopt otherwise (?!) - return function read_uint32() { - value = ( this.buf[this.pos] & 127 ) >>> 0; if (this.buf[this.pos++] < 128) return value; - value = (value | (this.buf[this.pos] & 127) << 7) >>> 0; if (this.buf[this.pos++] < 128) return value; - value = (value | (this.buf[this.pos] & 127) << 14) >>> 0; if (this.buf[this.pos++] < 128) return value; - value = (value | (this.buf[this.pos] & 127) << 21) >>> 0; if (this.buf[this.pos++] < 128) return value; - value = (value | (this.buf[this.pos] & 15) << 28) >>> 0; if (this.buf[this.pos++] < 128) return value; - - /* istanbul ignore if */ - if ((this.pos += 5) > this.len) { - this.pos = this.len; - throw indexOutOfRange(this, 10); - } - return value; - }; -})(); - -/** - * Reads a varint as a signed 32 bit value. - * @returns {number} Value read - */ -Reader.prototype.int32 = function read_int32() { - return this.uint32() | 0; -}; - -/** - * Reads a zig-zag encoded varint as a signed 32 bit value. - * @returns {number} Value read - */ -Reader.prototype.sint32 = function read_sint32() { - var value = this.uint32(); - return value >>> 1 ^ -(value & 1) | 0; -}; - -/* eslint-disable no-invalid-this */ - -function readLongVarint() { - // tends to deopt with local vars for octet etc. - var bits = new LongBits(0, 0); - var i = 0; - if (this.len - this.pos > 4) { // fast route (lo) - for (; i < 4; ++i) { - // 1st..4th - bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0; - if (this.buf[this.pos++] < 128) - return bits; - } - // 5th - bits.lo = (bits.lo | (this.buf[this.pos] & 127) << 28) >>> 0; - bits.hi = (bits.hi | (this.buf[this.pos] & 127) >> 4) >>> 0; - if (this.buf[this.pos++] < 128) - return bits; - i = 0; - } else { - for (; i < 3; ++i) { - /* istanbul ignore if */ - if (this.pos >= this.len) - throw indexOutOfRange(this); - // 1st..3th - bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0; - if (this.buf[this.pos++] < 128) - return bits; - } - // 4th - bits.lo = (bits.lo | (this.buf[this.pos++] & 127) << i * 7) >>> 0; - return bits; - } - if (this.len - this.pos > 4) { // fast route (hi) - for (; i < 5; ++i) { - // 6th..10th - bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0; - if (this.buf[this.pos++] < 128) - return bits; - } - } else { - for (; i < 5; ++i) { - /* istanbul ignore if */ - if (this.pos >= this.len) - throw indexOutOfRange(this); - // 6th..10th - bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0; - if (this.buf[this.pos++] < 128) - return bits; - } - } - /* istanbul ignore next */ - throw Error("invalid varint encoding"); -} - -/* eslint-enable no-invalid-this */ - -/** - * Reads a varint as a signed 64 bit value. - * @name Reader#int64 - * @function - * @returns {Long} Value read - */ - -/** - * Reads a varint as an unsigned 64 bit value. - * @name Reader#uint64 - * @function - * @returns {Long} Value read - */ - -/** - * Reads a zig-zag encoded varint as a signed 64 bit value. - * @name Reader#sint64 - * @function - * @returns {Long} Value read - */ - -/** - * Reads a varint as a boolean. - * @returns {boolean} Value read - */ -Reader.prototype.bool = function read_bool() { - return this.uint32() !== 0; -}; - -function readFixed32_end(buf, end) { // note that this uses `end`, not `pos` - return (buf[end - 4] - | buf[end - 3] << 8 - | buf[end - 2] << 16 - | buf[end - 1] << 24) >>> 0; -} - -/** - * Reads fixed 32 bits as an unsigned 32 bit integer. - * @returns {number} Value read - */ -Reader.prototype.fixed32 = function read_fixed32() { - - /* istanbul ignore if */ - if (this.pos + 4 > this.len) - throw indexOutOfRange(this, 4); - - return readFixed32_end(this.buf, this.pos += 4); -}; - -/** - * Reads fixed 32 bits as a signed 32 bit integer. - * @returns {number} Value read - */ -Reader.prototype.sfixed32 = function read_sfixed32() { - - /* istanbul ignore if */ - if (this.pos + 4 > this.len) - throw indexOutOfRange(this, 4); - - return readFixed32_end(this.buf, this.pos += 4) | 0; -}; - -/* eslint-disable no-invalid-this */ - -function readFixed64(/* this: Reader */) { - - /* istanbul ignore if */ - if (this.pos + 8 > this.len) - throw indexOutOfRange(this, 8); - - return new LongBits(readFixed32_end(this.buf, this.pos += 4), readFixed32_end(this.buf, this.pos += 4)); -} - -/* eslint-enable no-invalid-this */ - -/** - * Reads fixed 64 bits. - * @name Reader#fixed64 - * @function - * @returns {Long} Value read - */ - -/** - * Reads zig-zag encoded fixed 64 bits. - * @name Reader#sfixed64 - * @function - * @returns {Long} Value read - */ - -/** - * Reads a float (32 bit) as a number. - * @function - * @returns {number} Value read - */ -Reader.prototype.float = function read_float() { - - /* istanbul ignore if */ - if (this.pos + 4 > this.len) - throw indexOutOfRange(this, 4); - - var value = util.float.readFloatLE(this.buf, this.pos); - this.pos += 4; - return value; -}; - -/** - * Reads a double (64 bit float) as a number. - * @function - * @returns {number} Value read - */ -Reader.prototype.double = function read_double() { - - /* istanbul ignore if */ - if (this.pos + 8 > this.len) - throw indexOutOfRange(this, 4); - - var value = util.float.readDoubleLE(this.buf, this.pos); - this.pos += 8; - return value; -}; - -/** - * Reads a sequence of bytes preceeded by its length as a varint. - * @returns {Uint8Array} Value read - */ -Reader.prototype.bytes = function read_bytes() { - var length = this.uint32(), - start = this.pos, - end = this.pos + length; - - /* istanbul ignore if */ - if (end > this.len) - throw indexOutOfRange(this, length); - - this.pos += length; - if (Array.isArray(this.buf)) // plain array - return this.buf.slice(start, end); - return start === end // fix for IE 10/Win8 and others' subarray returning array of size 1 - ? new this.buf.constructor(0) - : this._slice.call(this.buf, start, end); -}; - -/** - * Reads a string preceeded by its byte length as a varint. - * @returns {string} Value read - */ -Reader.prototype.string = function read_string() { - var bytes = this.bytes(); - return utf8.read(bytes, 0, bytes.length); -}; - -/** - * Skips the specified number of bytes if specified, otherwise skips a varint. - * @param {number} [length] Length if known, otherwise a varint is assumed - * @returns {Reader} `this` - */ -Reader.prototype.skip = function skip(length) { - if (typeof length === "number") { - /* istanbul ignore if */ - if (this.pos + length > this.len) - throw indexOutOfRange(this, length); - this.pos += length; - } else { - do { - /* istanbul ignore if */ - if (this.pos >= this.len) - throw indexOutOfRange(this); - } while (this.buf[this.pos++] & 128); - } - return this; -}; - -/** - * Skips the next element of the specified wire type. - * @param {number} wireType Wire type received - * @returns {Reader} `this` - */ -Reader.prototype.skipType = function(wireType) { - switch (wireType) { - case 0: - this.skip(); - break; - case 1: - this.skip(8); - break; - case 2: - this.skip(this.uint32()); - break; - case 3: - while ((wireType = this.uint32() & 7) !== 4) { - this.skipType(wireType); - } - break; - case 5: - this.skip(4); - break; - - /* istanbul ignore next */ - default: - throw Error("invalid wire type " + wireType + " at offset " + this.pos); - } - return this; -}; - -Reader._configure = function(BufferReader_) { - BufferReader = BufferReader_; - - var fn = util.Long ? "toLong" : /* istanbul ignore next */ "toNumber"; - util.merge(Reader.prototype, { - - int64: function read_int64() { - return readLongVarint.call(this)[fn](false); - }, - - uint64: function read_uint64() { - return readLongVarint.call(this)[fn](true); - }, - - sint64: function read_sint64() { - return readLongVarint.call(this).zzDecode()[fn](false); - }, - - fixed64: function read_fixed64() { - return readFixed64.call(this)[fn](true); - }, - - sfixed64: function read_sfixed64() { - return readFixed64.call(this)[fn](false); - } - - }); -}; + function HmacSha256(key, is224, sharedMemory) { + var i, type = typeof key; + if (type === 'string') { + var bytes = [], length = key.length, index = 0, code; + for (i = 0; i < length; ++i) { + code = key.charCodeAt(i); + if (code < 0x80) { + bytes[index++] = code; + } else if (code < 0x800) { + bytes[index++] = (0xc0 | (code >> 6)); + bytes[index++] = (0x80 | (code & 0x3f)); + } else if (code < 0xd800 || code >= 0xe000) { + bytes[index++] = (0xe0 | (code >> 12)); + bytes[index++] = (0x80 | ((code >> 6) & 0x3f)); + bytes[index++] = (0x80 | (code & 0x3f)); + } else { + code = 0x10000 + (((code & 0x3ff) << 10) | (key.charCodeAt(++i) & 0x3ff)); + bytes[index++] = (0xf0 | (code >> 18)); + bytes[index++] = (0x80 | ((code >> 12) & 0x3f)); + bytes[index++] = (0x80 | ((code >> 6) & 0x3f)); + bytes[index++] = (0x80 | (code & 0x3f)); + } + } + key = bytes; + } else { + if (type === 'object') { + if (key === null) { + throw new Error(ERROR); + } else if (ARRAY_BUFFER && key.constructor === ArrayBuffer) { + key = new Uint8Array(key); + } else if (!Array.isArray(key)) { + if (!ARRAY_BUFFER || !ArrayBuffer.isView(key)) { + throw new Error(ERROR); + } + } + } else { + throw new Error(ERROR); + } + } -},{"./util/minimal":72}],67:[function(require,module,exports){ -"use strict"; -module.exports = BufferReader; - -// extends Reader -var Reader = require("./reader"); -(BufferReader.prototype = Object.create(Reader.prototype)).constructor = BufferReader; - -var util = require("./util/minimal"); - -/** - * Constructs a new buffer reader instance. - * @classdesc Wire format reader using node buffers. - * @extends Reader - * @constructor - * @param {Buffer} buffer Buffer to read from - */ -function BufferReader(buffer) { - Reader.call(this, buffer); - - /** - * Read buffer. - * @name BufferReader#buf - * @type {Buffer} - */ -} - -/* istanbul ignore else */ -if (util.Buffer) - BufferReader.prototype._slice = util.Buffer.prototype.slice; - -/** - * @override - */ -BufferReader.prototype.string = function read_string_buffer() { - var len = this.uint32(); // modifies pos - return this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + len, this.len)); -}; - -/** - * Reads a sequence of bytes preceeded by its length as a varint. - * @name BufferReader#bytes - * @function - * @returns {Buffer} Value read - */ - -},{"./reader":66,"./util/minimal":72}],68:[function(require,module,exports){ -"use strict"; -module.exports = {}; - -/** - * Named roots. - * This is where pbjs stores generated structures (the option `-r, --root` specifies a name). - * Can also be used manually to make roots available accross modules. - * @name roots - * @type {Object.} - * @example - * // pbjs -r myroot -o compiled.js ... - * - * // in another module: - * require("./compiled.js"); - * - * // in any subsequent module: - * var root = protobuf.roots["myroot"]; - */ - -},{}],69:[function(require,module,exports){ -"use strict"; - -/** - * Streaming RPC helpers. - * @namespace - */ -var rpc = exports; - -/** - * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets. - * @typedef RPCImpl - * @type {function} - * @param {Method|rpc.ServiceMethod,Message<{}>>} method Reflected or static method being called - * @param {Uint8Array} requestData Request data - * @param {RPCImplCallback} callback Callback function - * @returns {undefined} - * @example - * function rpcImpl(method, requestData, callback) { - * if (protobuf.util.lcFirst(method.name) !== "myMethod") // compatible with static code - * throw Error("no such method"); - * asynchronouslyObtainAResponse(requestData, function(err, responseData) { - * callback(err, responseData); - * }); - * } - */ - -/** - * Node-style callback as used by {@link RPCImpl}. - * @typedef RPCImplCallback - * @type {function} - * @param {Error|null} error Error, if any, otherwise `null` - * @param {Uint8Array|null} [response] Response data or `null` to signal end of stream, if there hasn't been an error - * @returns {undefined} - */ - -rpc.Service = require("./rpc/service"); + if (key.length > 64) { + key = (new Sha256(is224, true)).update(key).array(); + } -},{"./rpc/service":70}],70:[function(require,module,exports){ -"use strict"; -module.exports = Service; - -var util = require("../util/minimal"); - -// Extends EventEmitter -(Service.prototype = Object.create(util.EventEmitter.prototype)).constructor = Service; - -/** - * A service method callback as used by {@link rpc.ServiceMethod|ServiceMethod}. - * - * Differs from {@link RPCImplCallback} in that it is an actual callback of a service method which may not return `response = null`. - * @typedef rpc.ServiceMethodCallback - * @template TRes extends Message - * @type {function} - * @param {Error|null} error Error, if any - * @param {TRes} [response] Response message - * @returns {undefined} - */ - -/** - * A service method part of a {@link rpc.Service} as created by {@link Service.create}. - * @typedef rpc.ServiceMethod - * @template TReq extends Message - * @template TRes extends Message - * @type {function} - * @param {TReq|Properties} request Request message or plain object - * @param {rpc.ServiceMethodCallback} [callback] Node-style callback called with the error, if any, and the response message - * @returns {Promise>} Promise if `callback` has been omitted, otherwise `undefined` - */ - -/** - * Constructs a new RPC service instance. - * @classdesc An RPC service as returned by {@link Service#create}. - * @exports rpc.Service - * @extends util.EventEmitter - * @constructor - * @param {RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ -function Service(rpcImpl, requestDelimited, responseDelimited) { - - if (typeof rpcImpl !== "function") - throw TypeError("rpcImpl must be a function"); - - util.EventEmitter.call(this); - - /** - * RPC implementation. Becomes `null` once the service is ended. - * @type {RPCImpl|null} - */ - this.rpcImpl = rpcImpl; - - /** - * Whether requests are length-delimited. - * @type {boolean} - */ - this.requestDelimited = Boolean(requestDelimited); - - /** - * Whether responses are length-delimited. - * @type {boolean} - */ - this.responseDelimited = Boolean(responseDelimited); -} - -/** - * Calls a service method through {@link rpc.Service#rpcImpl|rpcImpl}. - * @param {Method|rpc.ServiceMethod} method Reflected or static method - * @param {Constructor} requestCtor Request constructor - * @param {Constructor} responseCtor Response constructor - * @param {TReq|Properties} request Request message or plain object - * @param {rpc.ServiceMethodCallback} callback Service callback - * @returns {undefined} - * @template TReq extends Message - * @template TRes extends Message - */ -Service.prototype.rpcCall = function rpcCall(method, requestCtor, responseCtor, request, callback) { - - if (!request) - throw TypeError("request must be specified"); - - var self = this; - if (!callback) - return util.asPromise(rpcCall, self, method, requestCtor, responseCtor, request); - - if (!self.rpcImpl) { - setTimeout(function() { callback(Error("already ended")); }, 0); - return undefined; - } - - try { - return self.rpcImpl( - method, - requestCtor[self.requestDelimited ? "encodeDelimited" : "encode"](request).finish(), - function rpcCallback(err, response) { - - if (err) { - self.emit("error", err, method); - return callback(err); - } - - if (response === null) { - self.end(/* endedByRPC */ true); - return undefined; - } - - if (!(response instanceof responseCtor)) { - try { - response = responseCtor[self.responseDelimited ? "decodeDelimited" : "decode"](response); - } catch (err) { - self.emit("error", err, method); - return callback(err); - } - } - - self.emit("data", response, method); - return callback(null, response); - } - ); - } catch (err) { - self.emit("error", err, method); - setTimeout(function() { callback(err); }, 0); - return undefined; - } -}; - -/** - * Ends this service and emits the `end` event. - * @param {boolean} [endedByRPC=false] Whether the service has been ended by the RPC implementation. - * @returns {rpc.Service} `this` - */ -Service.prototype.end = function end(endedByRPC) { - if (this.rpcImpl) { - if (!endedByRPC) // signal end to rpcImpl - this.rpcImpl(null, null, null); - this.rpcImpl = null; - this.emit("end").off(); - } - return this; -}; + var oKeyPad = [], iKeyPad = []; + for (i = 0; i < 64; ++i) { + var b = key[i] || 0; + oKeyPad[i] = 0x5c ^ b; + iKeyPad[i] = 0x36 ^ b; + } + + Sha256.call(this, is224, sharedMemory); + + this.update(iKeyPad); + this.oKeyPad = oKeyPad; + this.inner = true; + this.sharedMemory = sharedMemory; + } + HmacSha256.prototype = new Sha256(); -},{"../util/minimal":72}],71:[function(require,module,exports){ -"use strict"; -module.exports = LongBits; - -var util = require("../util/minimal"); - -/** - * Constructs new long bits. - * @classdesc Helper class for working with the low and high bits of a 64 bit value. - * @memberof util - * @constructor - * @param {number} lo Low 32 bits, unsigned - * @param {number} hi High 32 bits, unsigned - */ -function LongBits(lo, hi) { - - // note that the casts below are theoretically unnecessary as of today, but older statically - // generated converter code might still call the ctor with signed 32bits. kept for compat. - - /** - * Low bits. - * @type {number} - */ - this.lo = lo >>> 0; - - /** - * High bits. - * @type {number} - */ - this.hi = hi >>> 0; -} - -/** - * Zero bits. - * @memberof util.LongBits - * @type {util.LongBits} - */ -var zero = LongBits.zero = new LongBits(0, 0); - -zero.toNumber = function() { return 0; }; -zero.zzEncode = zero.zzDecode = function() { return this; }; -zero.length = function() { return 1; }; - -/** - * Zero hash. - * @memberof util.LongBits - * @type {string} - */ -var zeroHash = LongBits.zeroHash = "\0\0\0\0\0\0\0\0"; - -/** - * Constructs new long bits from the specified number. - * @param {number} value Value - * @returns {util.LongBits} Instance - */ -LongBits.fromNumber = function fromNumber(value) { - if (value === 0) - return zero; - var sign = value < 0; - if (sign) - value = -value; - var lo = value >>> 0, - hi = (value - lo) / 4294967296 >>> 0; - if (sign) { - hi = ~hi >>> 0; - lo = ~lo >>> 0; - if (++lo > 4294967295) { - lo = 0; - if (++hi > 4294967295) - hi = 0; - } - } - return new LongBits(lo, hi); -}; - -/** - * Constructs new long bits from a number, long or string. - * @param {Long|number|string} value Value - * @returns {util.LongBits} Instance - */ -LongBits.from = function from(value) { - if (typeof value === "number") - return LongBits.fromNumber(value); - if (util.isString(value)) { - /* istanbul ignore else */ - if (util.Long) - value = util.Long.fromString(value); - else - return LongBits.fromNumber(parseInt(value, 10)); - } - return value.low || value.high ? new LongBits(value.low >>> 0, value.high >>> 0) : zero; -}; - -/** - * Converts this long bits to a possibly unsafe JavaScript number. - * @param {boolean} [unsigned=false] Whether unsigned or not - * @returns {number} Possibly unsafe number - */ -LongBits.prototype.toNumber = function toNumber(unsigned) { - if (!unsigned && this.hi >>> 31) { - var lo = ~this.lo + 1 >>> 0, - hi = ~this.hi >>> 0; - if (!lo) - hi = hi + 1 >>> 0; - return -(lo + hi * 4294967296); - } - return this.lo + this.hi * 4294967296; -}; - -/** - * Converts this long bits to a long. - * @param {boolean} [unsigned=false] Whether unsigned or not - * @returns {Long} Long - */ -LongBits.prototype.toLong = function toLong(unsigned) { - return util.Long - ? new util.Long(this.lo | 0, this.hi | 0, Boolean(unsigned)) - /* istanbul ignore next */ - : { low: this.lo | 0, high: this.hi | 0, unsigned: Boolean(unsigned) }; -}; - -var charCodeAt = String.prototype.charCodeAt; - -/** - * Constructs new long bits from the specified 8 characters long hash. - * @param {string} hash Hash - * @returns {util.LongBits} Bits - */ -LongBits.fromHash = function fromHash(hash) { - if (hash === zeroHash) - return zero; - return new LongBits( - ( charCodeAt.call(hash, 0) - | charCodeAt.call(hash, 1) << 8 - | charCodeAt.call(hash, 2) << 16 - | charCodeAt.call(hash, 3) << 24) >>> 0 - , - ( charCodeAt.call(hash, 4) - | charCodeAt.call(hash, 5) << 8 - | charCodeAt.call(hash, 6) << 16 - | charCodeAt.call(hash, 7) << 24) >>> 0 - ); -}; - -/** - * Converts this long bits to a 8 characters long hash. - * @returns {string} Hash - */ -LongBits.prototype.toHash = function toHash() { - return String.fromCharCode( - this.lo & 255, - this.lo >>> 8 & 255, - this.lo >>> 16 & 255, - this.lo >>> 24 , - this.hi & 255, - this.hi >>> 8 & 255, - this.hi >>> 16 & 255, - this.hi >>> 24 - ); -}; - -/** - * Zig-zag encodes this long bits. - * @returns {util.LongBits} `this` - */ -LongBits.prototype.zzEncode = function zzEncode() { - var mask = this.hi >> 31; - this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0; - this.lo = ( this.lo << 1 ^ mask) >>> 0; - return this; -}; - -/** - * Zig-zag decodes this long bits. - * @returns {util.LongBits} `this` - */ -LongBits.prototype.zzDecode = function zzDecode() { - var mask = -(this.lo & 1); - this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0; - this.hi = ( this.hi >>> 1 ^ mask) >>> 0; - return this; -}; - -/** - * Calculates the length of this longbits when encoded as a varint. - * @returns {number} Length - */ -LongBits.prototype.length = function length() { - var part0 = this.lo, - part1 = (this.lo >>> 28 | this.hi << 4) >>> 0, - part2 = this.hi >>> 24; - return part2 === 0 - ? part1 === 0 - ? part0 < 16384 - ? part0 < 128 ? 1 : 2 - : part0 < 2097152 ? 3 : 4 - : part1 < 16384 - ? part1 < 128 ? 5 : 6 - : part1 < 2097152 ? 7 : 8 - : part2 < 128 ? 9 : 10; -}; + HmacSha256.prototype.finalize = function () { + Sha256.prototype.finalize.call(this); + if (this.inner) { + this.inner = false; + var innerHash = this.array(); + Sha256.call(this, this.is224, this.sharedMemory); + this.update(this.oKeyPad); + this.update(innerHash); + Sha256.prototype.finalize.call(this); + } + }; -},{"../util/minimal":72}],72:[function(require,module,exports){ -(function (global){ -"use strict"; -var util = exports; - -// used to return a Promise where callback is omitted -util.asPromise = require("@protobufjs/aspromise"); - -// converts to / from base64 encoded strings -util.base64 = require("@protobufjs/base64"); - -// base class of rpc.Service -util.EventEmitter = require("@protobufjs/eventemitter"); - -// float handling accross browsers -util.float = require("@protobufjs/float"); - -// requires modules optionally and hides the call from bundlers -util.inquire = require("@protobufjs/inquire"); - -// converts to / from utf8 encoded strings -util.utf8 = require("@protobufjs/utf8"); - -// provides a node-like buffer pool in the browser -util.pool = require("@protobufjs/pool"); - -// utility to work with the low and high bits of a 64 bit value -util.LongBits = require("./longbits"); - -// global object reference -util.global = typeof window !== "undefined" && window - || typeof global !== "undefined" && global - || typeof self !== "undefined" && self - || this; // eslint-disable-line no-invalid-this - -/** - * An immuable empty array. - * @memberof util - * @type {Array.<*>} - * @const - */ -util.emptyArray = Object.freeze ? Object.freeze([]) : /* istanbul ignore next */ []; // used on prototypes - -/** - * An immutable empty object. - * @type {Object} - * @const - */ -util.emptyObject = Object.freeze ? Object.freeze({}) : /* istanbul ignore next */ {}; // used on prototypes - -/** - * Whether running within node or not. - * @memberof util - * @type {boolean} - * @const - */ -util.isNode = Boolean(util.global.process && util.global.process.versions && util.global.process.versions.node); - -/** - * Tests if the specified value is an integer. - * @function - * @param {*} value Value to test - * @returns {boolean} `true` if the value is an integer - */ -util.isInteger = Number.isInteger || /* istanbul ignore next */ function isInteger(value) { - return typeof value === "number" && isFinite(value) && Math.floor(value) === value; -}; - -/** - * Tests if the specified value is a string. - * @param {*} value Value to test - * @returns {boolean} `true` if the value is a string - */ -util.isString = function isString(value) { - return typeof value === "string" || value instanceof String; -}; - -/** - * Tests if the specified value is a non-null object. - * @param {*} value Value to test - * @returns {boolean} `true` if the value is a non-null object - */ -util.isObject = function isObject(value) { - return value && typeof value === "object"; -}; - -/** - * Checks if a property on a message is considered to be present. - * This is an alias of {@link util.isSet}. - * @function - * @param {Object} obj Plain object or message instance - * @param {string} prop Property name - * @returns {boolean} `true` if considered to be present, otherwise `false` - */ -util.isset = - -/** - * Checks if a property on a message is considered to be present. - * @param {Object} obj Plain object or message instance - * @param {string} prop Property name - * @returns {boolean} `true` if considered to be present, otherwise `false` - */ -util.isSet = function isSet(obj, prop) { - var value = obj[prop]; - if (value != null && obj.hasOwnProperty(prop)) // eslint-disable-line eqeqeq, no-prototype-builtins - return typeof value !== "object" || (Array.isArray(value) ? value.length : Object.keys(value).length) > 0; - return false; -}; - -/** - * Any compatible Buffer instance. - * This is a minimal stand-alone definition of a Buffer instance. The actual type is that exported by node's typings. - * @interface Buffer - * @extends Uint8Array - */ - -/** - * Node's Buffer class if available. - * @type {Constructor} - */ -util.Buffer = (function() { - try { - var Buffer = util.inquire("buffer").Buffer; - // refuse to use non-node buffers if not explicitly assigned (perf reasons): - return Buffer.prototype.utf8Write ? Buffer : /* istanbul ignore next */ null; - } catch (e) { - /* istanbul ignore next */ - return null; - } -})(); - -// Internal alias of or polyfull for Buffer.from. -util._Buffer_from = null; - -// Internal alias of or polyfill for Buffer.allocUnsafe. -util._Buffer_allocUnsafe = null; - -/** - * Creates a new buffer of whatever type supported by the environment. - * @param {number|number[]} [sizeOrArray=0] Buffer size or number array - * @returns {Uint8Array|Buffer} Buffer - */ -util.newBuffer = function newBuffer(sizeOrArray) { - /* istanbul ignore next */ - return typeof sizeOrArray === "number" - ? util.Buffer - ? util._Buffer_allocUnsafe(sizeOrArray) - : new util.Array(sizeOrArray) - : util.Buffer - ? util._Buffer_from(sizeOrArray) - : typeof Uint8Array === "undefined" - ? sizeOrArray - : new Uint8Array(sizeOrArray); -}; - -/** - * Array implementation used in the browser. `Uint8Array` if supported, otherwise `Array`. - * @type {Constructor} - */ -util.Array = typeof Uint8Array !== "undefined" ? Uint8Array /* istanbul ignore next */ : Array; - -/** - * Any compatible Long instance. - * This is a minimal stand-alone definition of a Long instance. The actual type is that exported by long.js. - * @interface Long - * @property {number} low Low bits - * @property {number} high High bits - * @property {boolean} unsigned Whether unsigned or not - */ - -/** - * Long.js's Long class if available. - * @type {Constructor} - */ -util.Long = /* istanbul ignore next */ util.global.dcodeIO && /* istanbul ignore next */ util.global.dcodeIO.Long - || /* istanbul ignore next */ util.global.Long - || util.inquire("long"); - -/** - * Regular expression used to verify 2 bit (`bool`) map keys. - * @type {RegExp} - * @const - */ -util.key2Re = /^true|false|0|1$/; - -/** - * Regular expression used to verify 32 bit (`int32` etc.) map keys. - * @type {RegExp} - * @const - */ -util.key32Re = /^-?(?:0|[1-9][0-9]*)$/; - -/** - * Regular expression used to verify 64 bit (`int64` etc.) map keys. - * @type {RegExp} - * @const - */ -util.key64Re = /^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/; - -/** - * Converts a number or long to an 8 characters long hash string. - * @param {Long|number} value Value to convert - * @returns {string} Hash - */ -util.longToHash = function longToHash(value) { - return value - ? util.LongBits.from(value).toHash() - : util.LongBits.zeroHash; -}; - -/** - * Converts an 8 characters long hash string to a long or number. - * @param {string} hash Hash - * @param {boolean} [unsigned=false] Whether unsigned or not - * @returns {Long|number} Original value - */ -util.longFromHash = function longFromHash(hash, unsigned) { - var bits = util.LongBits.fromHash(hash); - if (util.Long) - return util.Long.fromBits(bits.lo, bits.hi, unsigned); - return bits.toNumber(Boolean(unsigned)); -}; - -/** - * Merges the properties of the source object into the destination object. - * @memberof util - * @param {Object.} dst Destination object - * @param {Object.} src Source object - * @param {boolean} [ifNotSet=false] Merges only if the key is not already set - * @returns {Object.} Destination object - */ -function merge(dst, src, ifNotSet) { // used by converters - for (var keys = Object.keys(src), i = 0; i < keys.length; ++i) - if (dst[keys[i]] === undefined || !ifNotSet) - dst[keys[i]] = src[keys[i]]; - return dst; -} - -util.merge = merge; - -/** - * Converts the first character of a string to lower case. - * @param {string} str String to convert - * @returns {string} Converted string - */ -util.lcFirst = function lcFirst(str) { - return str.charAt(0).toLowerCase() + str.substring(1); -}; - -/** - * Creates a custom error constructor. - * @memberof util - * @param {string} name Error name - * @returns {Constructor} Custom error constructor - */ -function newError(name) { - - function CustomError(message, properties) { - - if (!(this instanceof CustomError)) - return new CustomError(message, properties); - - // Error.call(this, message); - // ^ just returns a new error instance because the ctor can be called as a function + var exports = createMethod(); + exports.sha256 = exports; + exports.sha224 = createMethod(true); + exports.sha256.hmac = createHmacMethod(); + exports.sha224.hmac = createHmacMethod(true); + + if (COMMON_JS) { + module.exports = exports; + } else { + root.sha256 = exports.sha256; + root.sha224 = exports.sha224; + if (AMD) { + define(function () { + return exports; + }); + } + } +})(); + +}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"_process":55}],51:[function(require,module,exports){ +require("capability/es5"); - Object.defineProperty(this, "message", { get: function() { return message; } }); +module.exports = require("./lib"); +},{"./lib":54,"capability/es5":32}],52:[function(require,module,exports){ +var Class = function () { + var options = Object.create({ + Source: Object, + config: {}, + buildArgs: [] + }); - /* istanbul ignore next */ - if (Error.captureStackTrace) // node - Error.captureStackTrace(this, CustomError); + function checkOption(option) { + var key = "config"; + if (option instanceof Function) + key = "Source"; + else if (option instanceof Array) + key = "buildArgs"; + else if (option instanceof Object) + key = "config"; else - Object.defineProperty(this, "stack", { value: (new Error()).stack || "" }); - - if (properties) - merge(this, properties); + throw new Error("Invalid configuration option."); + if (options.hasOwnProperty(key)) + throw new Error("Duplicated configuration option: " + key + "."); + options[key] = option; } - (CustomError.prototype = Object.create(Error.prototype)).constructor = CustomError; - - Object.defineProperty(CustomError.prototype, "name", { get: function() { return name; } }); - - CustomError.prototype.toString = function toString() { - return this.name + ": " + this.message; - }; - - return CustomError; -} - -util.newError = newError; - -/** - * Constructs a new protocol error. - * @classdesc Error subclass indicating a protocol specifc error. - * @memberof util - * @extends Error - * @template T extends Message - * @constructor - * @param {string} message Error message - * @param {Object.} [properties] Additional properties - * @example - * try { - * MyMessage.decode(someBuffer); // throws if required fields are missing - * } catch (e) { - * if (e instanceof ProtocolError && e.instance) - * console.log("decoded so far: " + JSON.stringify(e.instance)); - * } - */ -util.ProtocolError = newError("ProtocolError"); - -/** - * So far decoded message instance. - * @name util.ProtocolError#instance - * @type {Message} - */ - -/** - * A OneOf getter as returned by {@link util.oneOfGetter}. - * @typedef OneOfGetter - * @type {function} - * @returns {string|undefined} Set field name, if any - */ - -/** - * Builds a getter for a oneof's present field name. - * @param {string[]} fieldNames Field names - * @returns {OneOfGetter} Unbound getter - */ -util.oneOfGetter = function getOneOf(fieldNames) { - var fieldMap = {}; - for (var i = 0; i < fieldNames.length; ++i) - fieldMap[fieldNames[i]] = 1; - - /** - * @returns {string|undefined} Set field name, if any - * @this Object - * @ignore - */ - return function() { // eslint-disable-line consistent-return - for (var keys = Object.keys(this), i = keys.length - 1; i > -1; --i) - if (fieldMap[keys[i]] === 1 && this[keys[i]] !== undefined && this[keys[i]] !== null) - return keys[i]; - }; -}; - -/** - * A OneOf setter as returned by {@link util.oneOfSetter}. - * @typedef OneOfSetter - * @type {function} - * @param {string|undefined} value Field name - * @returns {undefined} - */ - -/** - * Builds a setter for a oneof's present field name. - * @param {string[]} fieldNames Field names - * @returns {OneOfSetter} Unbound setter - */ -util.oneOfSetter = function setOneOf(fieldNames) { - - /** - * @param {string} name Field name - * @returns {undefined} - * @this Object - * @ignore - */ - return function(name) { - for (var i = 0; i < fieldNames.length; ++i) - if (fieldNames[i] !== name) - delete this[fieldNames[i]]; - }; -}; + for (var index = 0, length = arguments.length; index < length; ++index) + checkOption(arguments[index]); -/** - * Default conversion options used for {@link Message#toJSON} implementations. - * - * These options are close to proto3's JSON mapping with the exception that internal types like Any are handled just like messages. More precisely: - * - * - Longs become strings - * - Enums become string keys - * - Bytes become base64 encoded strings - * - (Sub-)Messages become plain objects - * - Maps become plain objects with all string keys - * - Repeated fields become arrays - * - NaN and Infinity for float and double fields become strings - * - * @type {IConversionOptions} - * @see https://developers.google.com/protocol-buffers/docs/proto3?hl=en#json - */ -util.toJSONOptions = { - longs: String, - enums: String, - bytes: String, - json: true -}; + var Source = options.Source, + config = options.config, + buildArgs = options.buildArgs; -// Sets up buffer utility according to the environment (called in index-minimal) -util._configure = function() { - var Buffer = util.Buffer; - /* istanbul ignore if */ - if (!Buffer) { - util._Buffer_from = util._Buffer_allocUnsafe = null; - return; - } - // because node 4.x buffers are incompatible & immutable - // see: https://github.com/dcodeIO/protobuf.js/pull/665 - util._Buffer_from = Buffer.from !== Uint8Array.from && Buffer.from || - /* istanbul ignore next */ - function Buffer_from(value, encoding) { - return new Buffer(value, encoding); - }; - util._Buffer_allocUnsafe = Buffer.allocUnsafe || - /* istanbul ignore next */ - function Buffer_allocUnsafe(size) { - return new Buffer(size); - }; + return (Source.extend || Class.extend).call(Source, config, buildArgs); }; - -}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"./longbits":71,"@protobufjs/aspromise":26,"@protobufjs/base64":27,"@protobufjs/eventemitter":28,"@protobufjs/float":29,"@protobufjs/inquire":30,"@protobufjs/pool":31,"@protobufjs/utf8":32}],73:[function(require,module,exports){ -"use strict"; -module.exports = Writer; - -var util = require("./util/minimal"); - -var BufferWriter; // cyclic - -var LongBits = util.LongBits, - base64 = util.base64, - utf8 = util.utf8; - -/** - * Constructs a new writer operation instance. - * @classdesc Scheduled writer operation. - * @constructor - * @param {function(*, Uint8Array, number)} fn Function to call - * @param {number} len Value byte length - * @param {*} val Value to write - * @ignore - */ -function Op(fn, len, val) { - - /** - * Function to call. - * @type {function(Uint8Array, number, *)} - */ - this.fn = fn; - - /** - * Value byte length. - * @type {number} - */ - this.len = len; - - /** - * Next operation. - * @type {Writer.Op|undefined} - */ - this.next = undefined; - - /** - * Value to write. - * @type {*} - */ - this.val = val; // type varies -} - -/* istanbul ignore next */ -function noop() {} // eslint-disable-line no-empty-function - -/** - * Constructs a new writer state instance. - * @classdesc Copied writer state. - * @memberof Writer - * @constructor - * @param {Writer} writer Writer to copy state from - * @ignore - */ -function State(writer) { - - /** - * Current head. - * @type {Writer.Op} - */ - this.head = writer.head; - - /** - * Current tail. - * @type {Writer.Op} - */ - this.tail = writer.tail; - - /** - * Current buffer length. - * @type {number} - */ - this.len = writer.len; - - /** - * Next state. - * @type {State|null} - */ - this.next = writer.states; -} -/** - * Constructs a new writer instance. - * @classdesc Wire format writer using `Uint8Array` if available, otherwise `Array`. - * @constructor - */ -function Writer() { - - /** - * Current length. - * @type {number} - */ - this.len = 0; - - /** - * Operations head. - * @type {Object} - */ - this.head = new Op(noop, 0, 0); - - /** - * Operations tail - * @type {Object} - */ - this.tail = this.head; - - /** - * Linked forked states. - * @type {Object|null} - */ - this.states = null; - - // When a value is written, the writer calculates its byte length and puts it into a linked - // list of operations to perform when finish() is called. This both allows us to allocate - // buffers of the exact required size and reduces the amount of work we have to do compared - // to first calculating over objects and then encoding over objects. In our case, the encoding - // part is just a linked list walk calling operations with already prepared values. -} - -/** - * Creates a new writer. - * @function - * @returns {BufferWriter|Writer} A {@link BufferWriter} when Buffers are supported, otherwise a {@link Writer} - */ -Writer.create = util.Buffer - ? function create_buffer_setup() { - return (Writer.create = function create_buffer() { - return new BufferWriter(); - })(); - } - /* istanbul ignore next */ - : function create_array() { - return new Writer(); +Class.factory = function () { + var Source = this; + return function () { + var instance = this; + if (instance.build instanceof Function) + instance.build.apply(instance, arguments); + if (instance.init instanceof Function) + instance.init.apply(instance, arguments); }; - -/** - * Allocates a buffer of the specified size. - * @param {number} size Buffer size - * @returns {Uint8Array} Buffer - */ -Writer.alloc = function alloc(size) { - return new util.Array(size); }; -// Use Uint8Array buffer pool in the browser, just like node does with buffers -/* istanbul ignore else */ -if (util.Array !== Array) - Writer.alloc = util.pool(Writer.alloc, util.Array.prototype.subarray); - -/** - * Pushes a new operation to the queue. - * @param {function(Uint8Array, number, *)} fn Function to call - * @param {number} len Value byte length - * @param {number} val Value to write - * @returns {Writer} `this` - * @private - */ -Writer.prototype._push = function push(fn, len, val) { - this.tail = this.tail.next = new Op(fn, len, val); - this.len += len; - return this; -}; - -function writeByte(val, buf, pos) { - buf[pos] = val & 255; -} - -function writeVarint32(val, buf, pos) { - while (val > 127) { - buf[pos++] = val & 127 | 128; - val >>>= 7; - } - buf[pos] = val; -} - -/** - * Constructs a new varint writer operation instance. - * @classdesc Scheduled varint writer operation. - * @extends Op - * @constructor - * @param {number} len Value byte length - * @param {number} val Value to write - * @ignore - */ -function VarintOp(len, val) { - this.len = len; - this.next = undefined; - this.val = val; -} - -VarintOp.prototype = Object.create(Op.prototype); -VarintOp.prototype.fn = writeVarint32; - -/** - * Writes an unsigned 32 bit value as a varint. - * @param {number} value Value to write - * @returns {Writer} `this` - */ -Writer.prototype.uint32 = function write_uint32(value) { - // here, the call to this.push has been inlined and a varint specific Op subclass is used. - // uint32 is by far the most frequently used operation and benefits significantly from this. - this.len += (this.tail = this.tail.next = new VarintOp( - (value = value >>> 0) - < 128 ? 1 - : value < 16384 ? 2 - : value < 2097152 ? 3 - : value < 268435456 ? 4 - : 5, - value)).len; - return this; -}; - -/** - * Writes a signed 32 bit value as a varint. - * @function - * @param {number} value Value to write - * @returns {Writer} `this` - */ -Writer.prototype.int32 = function write_int32(value) { - return value < 0 - ? this._push(writeVarint64, 10, LongBits.fromNumber(value)) // 10 bytes per spec - : this.uint32(value); -}; - -/** - * Writes a 32 bit value as a varint, zig-zag encoded. - * @param {number} value Value to write - * @returns {Writer} `this` - */ -Writer.prototype.sint32 = function write_sint32(value) { - return this.uint32((value << 1 ^ value >> 31) >>> 0); -}; - -function writeVarint64(val, buf, pos) { - while (val.hi) { - buf[pos++] = val.lo & 127 | 128; - val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0; - val.hi >>>= 7; - } - while (val.lo > 127) { - buf[pos++] = val.lo & 127 | 128; - val.lo = val.lo >>> 7; - } - buf[pos++] = val.lo; -} - -/** - * Writes an unsigned 64 bit value as a varint. - * @param {Long|number|string} value Value to write - * @returns {Writer} `this` - * @throws {TypeError} If `value` is a string and no long library is present. - */ -Writer.prototype.uint64 = function write_uint64(value) { - var bits = LongBits.from(value); - return this._push(writeVarint64, bits.length(), bits); -}; - -/** - * Writes a signed 64 bit value as a varint. - * @function - * @param {Long|number|string} value Value to write - * @returns {Writer} `this` - * @throws {TypeError} If `value` is a string and no long library is present. - */ -Writer.prototype.int64 = Writer.prototype.uint64; - -/** - * Writes a signed 64 bit value as a varint, zig-zag encoded. - * @param {Long|number|string} value Value to write - * @returns {Writer} `this` - * @throws {TypeError} If `value` is a string and no long library is present. - */ -Writer.prototype.sint64 = function write_sint64(value) { - var bits = LongBits.from(value).zzEncode(); - return this._push(writeVarint64, bits.length(), bits); -}; - -/** - * Writes a boolish value as a varint. - * @param {boolean} value Value to write - * @returns {Writer} `this` - */ -Writer.prototype.bool = function write_bool(value) { - return this._push(writeByte, 1, value ? 1 : 0); -}; - -function writeFixed32(val, buf, pos) { - buf[pos ] = val & 255; - buf[pos + 1] = val >>> 8 & 255; - buf[pos + 2] = val >>> 16 & 255; - buf[pos + 3] = val >>> 24; -} - -/** - * Writes an unsigned 32 bit value as fixed 32 bits. - * @param {number} value Value to write - * @returns {Writer} `this` - */ -Writer.prototype.fixed32 = function write_fixed32(value) { - return this._push(writeFixed32, 4, value >>> 0); -}; - -/** - * Writes a signed 32 bit value as fixed 32 bits. - * @function - * @param {number} value Value to write - * @returns {Writer} `this` - */ -Writer.prototype.sfixed32 = Writer.prototype.fixed32; - -/** - * Writes an unsigned 64 bit value as fixed 64 bits. - * @param {Long|number|string} value Value to write - * @returns {Writer} `this` - * @throws {TypeError} If `value` is a string and no long library is present. - */ -Writer.prototype.fixed64 = function write_fixed64(value) { - var bits = LongBits.from(value); - return this._push(writeFixed32, 4, bits.lo)._push(writeFixed32, 4, bits.hi); -}; - -/** - * Writes a signed 64 bit value as fixed 64 bits. - * @function - * @param {Long|number|string} value Value to write - * @returns {Writer} `this` - * @throws {TypeError} If `value` is a string and no long library is present. - */ -Writer.prototype.sfixed64 = Writer.prototype.fixed64; - -/** - * Writes a float (32 bit). - * @function - * @param {number} value Value to write - * @returns {Writer} `this` - */ -Writer.prototype.float = function write_float(value) { - return this._push(util.float.writeFloatLE, 4, value); -}; - -/** - * Writes a double (64 bit float). - * @function - * @param {number} value Value to write - * @returns {Writer} `this` - */ -Writer.prototype.double = function write_double(value) { - return this._push(util.float.writeDoubleLE, 8, value); -}; - -var writeBytes = util.Array.prototype.set - ? function writeBytes_set(val, buf, pos) { - buf.set(val, pos); // also works for plain array values - } - /* istanbul ignore next */ - : function writeBytes_for(val, buf, pos) { - for (var i = 0; i < val.length; ++i) - buf[pos + i] = val[i]; - }; - -/** - * Writes a sequence of bytes. - * @param {Uint8Array|string} value Buffer or base64 encoded string to write - * @returns {Writer} `this` - */ -Writer.prototype.bytes = function write_bytes(value) { - var len = value.length >>> 0; - if (!len) - return this._push(writeByte, 1, 0); - if (util.isString(value)) { - var buf = Writer.alloc(len = base64.length(value)); - base64.decode(value, buf, 0); - value = buf; - } - return this.uint32(len)._push(writeBytes, len, value); +Class.extend = function (config, buildArgs) { + var Source = this; + if (!config) + config = {}; + var Subject; + if ((config.prototype instanceof Object) && config.prototype.constructor !== Object) + Subject = config.prototype.constructor; + else if (config.factory instanceof Function) + Subject = config.factory.call(Source); + Subject = (Source.clone || Class.clone).call(Source, Subject, buildArgs); + (Subject.merge || Class.merge).call(Subject, config); + return Subject; }; -/** - * Writes a string. - * @param {string} value Value to write - * @returns {Writer} `this` - */ -Writer.prototype.string = function write_string(value) { - var len = utf8.length(value); - return len - ? this.uint32(len)._push(utf8.write, len, value) - : this._push(writeByte, 1, 0); +Class.prototype.extend = function (config, buildArgs) { + var subject = this; + var instance = (subject.clone || Class.prototype.clone).apply(subject, buildArgs); + (instance.merge || Class.prototype.merge).call(instance, config); + return instance; }; -/** - * Forks this writer's state by pushing it to a stack. - * Calling {@link Writer#reset|reset} or {@link Writer#ldelim|ldelim} resets the writer to the previous state. - * @returns {Writer} `this` - */ -Writer.prototype.fork = function fork() { - this.states = new State(this); - this.head = this.tail = new Op(noop, 0, 0); - this.len = 0; - return this; +Class.clone = function (Subject, buildArgs) { + var Source = this; + if (!(Subject instanceof Function)) + Subject = (Source.factory || Class.factory).call(Source); + Subject.prototype = (Source.prototype.clone || Class.prototype.clone).apply(Source.prototype, buildArgs || []); + Subject.prototype.constructor = Subject; + for (var staticProperty in Source) + if (staticProperty !== "prototype") + Subject[staticProperty] = Source[staticProperty]; + return Subject; }; -/** - * Resets this instance to the last state. - * @returns {Writer} `this` - */ -Writer.prototype.reset = function reset() { - if (this.states) { - this.head = this.states.head; - this.tail = this.states.tail; - this.len = this.states.len; - this.states = this.states.next; - } else { - this.head = this.tail = new Op(noop, 0, 0); - this.len = 0; - } - return this; +Class.prototype.clone = function () { + var subject = this; + var instance = Object.create(subject); + if (instance.build instanceof Function) + instance.build.apply(instance, arguments); + return instance; }; -/** - * Resets to the last state and appends the fork state's current write length as a varint followed by its operations. - * @returns {Writer} `this` - */ -Writer.prototype.ldelim = function ldelim() { - var head = this.head, - tail = this.tail, - len = this.len; - this.reset().uint32(len); - if (len) { - this.tail.next = head.next; // skip noop - this.tail = tail; - this.len += len; - } - return this; +Class.merge = function (config) { + var Subject = this; + for (var staticProperty in config) + if (staticProperty !== "prototype") + Subject[staticProperty] = config[staticProperty]; + if (config.prototype instanceof Object) + (Subject.prototype.merge || Class.prototype.merge).call(Subject.prototype, config.prototype); + return Subject; }; -/** - * Finishes the write operation. - * @returns {Uint8Array} Finished buffer - */ -Writer.prototype.finish = function finish() { - var head = this.head.next, // skip noop - buf = this.constructor.alloc(this.len), - pos = 0; - while (head) { - head.fn(head.val, buf, pos); - pos += head.len; - head = head.next; - } - // this.head = this.tail = null; - return buf; +Class.prototype.merge = function (config) { + var subject = this; + for (var property in config) + if (property !== "constructor") + subject[property] = config[property]; + return subject; }; -Writer._configure = function(BufferWriter_) { - BufferWriter = BufferWriter_; +Class.absorb = function (config) { + var Subject = this; + for (var staticProperty in config) + if (staticProperty !== "prototype" && (Subject[staticProperty] === undefined || Subject[staticProperty] === Function.prototype[staticProperty])) + Subject[staticProperty] = config[staticProperty]; + if (config.prototype instanceof Object) + (Subject.prototype.absorb || Class.prototype.absorb).call(Subject.prototype, config.prototype); + return Subject; }; - -},{"./util/minimal":72}],74:[function(require,module,exports){ -"use strict"; -module.exports = BufferWriter; - -// extends Writer -var Writer = require("./writer"); -(BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter; - -var util = require("./util/minimal"); -var Buffer = util.Buffer; - -/** - * Constructs a new buffer writer instance. - * @classdesc Wire format writer using node buffers. - * @extends Writer - * @constructor - */ -function BufferWriter() { - Writer.call(this); -} - -/** - * Allocates a buffer of the specified size. - * @param {number} size Buffer size - * @returns {Buffer} Buffer - */ -BufferWriter.alloc = function alloc_buffer(size) { - return (BufferWriter.alloc = util._Buffer_allocUnsafe)(size); +Class.prototype.absorb = function (config) { + var subject = this; + for (var property in config) + if (property !== "constructor" && (subject[property] === undefined || subject[property] === Object.prototype[property])) + subject[property] = config[property]; + return subject; }; -var writeBytesBuffer = Buffer && Buffer.prototype instanceof Uint8Array && Buffer.prototype.set.name === "set" - ? function writeBytesBuffer_set(val, buf, pos) { - buf.set(val, pos); // faster than copy (requires node >= 4 where Buffers extend Uint8Array and set is properly inherited) - // also works for plain array values - } - /* istanbul ignore next */ - : function writeBytesBuffer_copy(val, buf, pos) { - if (val.copy) // Buffer values - val.copy(buf, pos, 0, val.length); - else for (var i = 0; i < val.length;) // plain array values - buf[pos++] = val[i++]; - }; - -/** - * @override - */ -BufferWriter.prototype.bytes = function write_bytes_buffer(value) { - if (util.isString(value)) - value = util._Buffer_from(value, "base64"); - var len = value.length >>> 0; - this.uint32(len); - if (len) - this._push(writeBytesBuffer, len, value); - return this; +Class.getAncestor = function () { + var Source = this; + if (Source !== Source.prototype.constructor) + return Source.prototype.constructor; }; -function writeStringBuffer(val, buf, pos) { - if (val.length < 40) // plain js is faster for short strings (probably due to redundant assertions) - util.utf8.write(val, buf, pos); - else - buf.utf8Write(val, pos); -} - -/** - * @override - */ -BufferWriter.prototype.string = function write_string_buffer(value) { - var len = Buffer.byteLength(value); - this.uint32(len); - if (len) - this._push(writeStringBuffer, len, value); - return this; +Class.newInstance = function () { + var Subject = this; + var instance = Object.create(this.prototype); + Subject.apply(instance, arguments); + return instance; }; - -/** - * Finishes the write operation. - * @name BufferWriter#finish - * @function - * @returns {Buffer} Finished buffer - */ - -},{"./util/minimal":72,"./writer":73}],75:[function(require,module,exports){ +module.exports = Class; +},{}],53:[function(require,module,exports){ +module.exports = function () { + throw new Error("Not implemented."); +}; +},{}],54:[function(require,module,exports){ +module.exports = { + Class: require("./Class"), + abstractMethod: require("./abstractMethod") +}; +},{"./Class":52,"./abstractMethod":53}],55:[function(require,module,exports){ +// shim for using process in browser +var process = module.exports = {}; + +// cached from whatever global is present so that test runners that stub it +// don't break things. But we need to wrap it in a try catch in case it is +// wrapped in strict mode code which doesn't define any globals. It's inside a +// function because try/catches deoptimize in certain engines. + +var cachedSetTimeout; +var cachedClearTimeout; + +function defaultSetTimout() { + throw new Error('setTimeout has not been defined'); +} +function defaultClearTimeout () { + throw new Error('clearTimeout has not been defined'); +} +(function () { + try { + if (typeof setTimeout === 'function') { + cachedSetTimeout = setTimeout; + } else { + cachedSetTimeout = defaultSetTimout; + } + } catch (e) { + cachedSetTimeout = defaultSetTimout; + } + try { + if (typeof clearTimeout === 'function') { + cachedClearTimeout = clearTimeout; + } else { + cachedClearTimeout = defaultClearTimeout; + } + } catch (e) { + cachedClearTimeout = defaultClearTimeout; + } +} ()) +function runTimeout(fun) { + if (cachedSetTimeout === setTimeout) { + //normal enviroments in sane situations + return setTimeout(fun, 0); + } + // if setTimeout wasn't available but was latter defined + if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { + cachedSetTimeout = setTimeout; + return setTimeout(fun, 0); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedSetTimeout(fun, 0); + } catch(e){ + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedSetTimeout.call(null, fun, 0); + } catch(e){ + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error + return cachedSetTimeout.call(this, fun, 0); + } + } + + +} +function runClearTimeout(marker) { + if (cachedClearTimeout === clearTimeout) { + //normal enviroments in sane situations + return clearTimeout(marker); + } + // if clearTimeout wasn't available but was latter defined + if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { + cachedClearTimeout = clearTimeout; + return clearTimeout(marker); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedClearTimeout(marker); + } catch (e){ + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedClearTimeout.call(null, marker); + } catch (e){ + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. + // Some versions of I.E. have different rules for clearTimeout vs setTimeout + return cachedClearTimeout.call(this, marker); + } + } + + + +} +var queue = []; +var draining = false; +var currentQueue; +var queueIndex = -1; + +function cleanUpNextTick() { + if (!draining || !currentQueue) { + return; + } + draining = false; + if (currentQueue.length) { + queue = currentQueue.concat(queue); + } else { + queueIndex = -1; + } + if (queue.length) { + drainQueue(); + } +} + +function drainQueue() { + if (draining) { + return; + } + var timeout = runTimeout(cleanUpNextTick); + draining = true; + + var len = queue.length; + while(len) { + currentQueue = queue; + queue = []; + while (++queueIndex < len) { + if (currentQueue) { + currentQueue[queueIndex].run(); + } + } + queueIndex = -1; + len = queue.length; + } + currentQueue = null; + draining = false; + runClearTimeout(timeout); +} + +process.nextTick = function (fun) { + var args = new Array(arguments.length - 1); + if (arguments.length > 1) { + for (var i = 1; i < arguments.length; i++) { + args[i - 1] = arguments[i]; + } + } + queue.push(new Item(fun, args)); + if (queue.length === 1 && !draining) { + runTimeout(drainQueue); + } +}; + +// v8 likes predictible objects +function Item(fun, array) { + this.fun = fun; + this.array = array; +} +Item.prototype.run = function () { + this.fun.apply(null, this.array); +}; +process.title = 'browser'; +process.browser = true; +process.env = {}; +process.argv = []; +process.version = ''; // empty string to avoid regexp issues +process.versions = {}; + +function noop() {} + +process.on = noop; +process.addListener = noop; +process.once = noop; +process.off = noop; +process.removeListener = noop; +process.removeAllListeners = noop; +process.emit = noop; +process.prependListener = noop; +process.prependOnceListener = noop; + +process.listeners = function (name) { return [] } + +process.binding = function (name) { + throw new Error('process.binding is not supported'); +}; + +process.cwd = function () { return '/' }; +process.chdir = function (dir) { + throw new Error('process.chdir is not supported'); +}; +process.umask = function() { return 0; }; + +},{}],56:[function(require,module,exports){ /* eslint-disable node/no-deprecated-api */ var buffer = require('buffer') var Buffer = buffer.Buffer @@ -16526,7 +8893,7 @@ SafeBuffer.allocUnsafeSlow = function (size) { return buffer.SlowBuffer(size) } -},{"buffer":39}],76:[function(require,module,exports){ +},{"buffer":31}],57:[function(require,module,exports){ 'use strict' /* eslint no-proto: 0 */ module.exports = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array ? setProtoOf : mixinProperties) @@ -16545,7 +8912,7 @@ function mixinProperties (obj, proto) { return obj } -},{}],77:[function(require,module,exports){ +},{}],58:[function(require,module,exports){ module.exports={ "100": "Continue", "101": "Switching Protocols", @@ -16613,7 +8980,7 @@ module.exports={ "511": "Network Authentication Required" } -},{}],78:[function(require,module,exports){ +},{}],59:[function(require,module,exports){ /*! * statuses * Copyright(c) 2014 Jonathan Ong @@ -16728,7 +9095,7 @@ function status (code) { return n } -},{"./codes.json":77}],79:[function(require,module,exports){ +},{"./codes.json":58}],60:[function(require,module,exports){ /*! * toidentifier * Copyright(c) 2016 Douglas Christopher Wilson @@ -16760,7 +9127,7 @@ function toIdentifier (str) { .replace(/[^ _0-9a-z]/gi, '') } -},{}],80:[function(require,module,exports){ +},{}],61:[function(require,module,exports){ (function(nacl) { 'use strict'; @@ -19139,9 +11506,9 @@ nacl.setPRNG = function(fn) { })(typeof module !== 'undefined' && module.exports ? module.exports : (self.nacl = self.nacl || {})); -},{"crypto":36}],81:[function(require,module,exports){ -arguments[4][46][0].apply(exports,arguments) -},{"./lib":84,"dup":46}],82:[function(require,module,exports){ +},{"crypto":28}],62:[function(require,module,exports){ +arguments[4][38][0].apply(exports,arguments) +},{"./lib":65,"dup":38}],63:[function(require,module,exports){ var cache = function (fn) { var called = false, store; @@ -19163,7 +11530,7 @@ var cache = function (fn) { }; module.exports = cache; -},{}],83:[function(require,module,exports){ +},{}],64:[function(require,module,exports){ module.exports = function eachCombination(alternativesByDimension, callback, combination) { if (!combination) combination = []; @@ -19178,19 +11545,19 @@ module.exports = function eachCombination(alternativesByDimension, callback, com else callback.apply(null, combination); }; -},{}],84:[function(require,module,exports){ +},{}],65:[function(require,module,exports){ module.exports = { cache: require("./cache"), eachCombination: require("./eachCombination") }; -},{"./cache":82,"./eachCombination":83}],85:[function(require,module,exports){ +},{"./cache":63,"./eachCombination":64}],66:[function(require,module,exports){ module.exports = function isBuffer(arg) { return arg && typeof arg === 'object' && typeof arg.copy === 'function' && typeof arg.fill === 'function' && typeof arg.readUInt8 === 'function'; } -},{}],86:[function(require,module,exports){ +},{}],67:[function(require,module,exports){ (function (process,global){ // Copyright Joyent, Inc. and other Node contributors. // @@ -19780,4 +12147,4 @@ function hasOwnProperty(obj, prop) { } }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"./support/isBuffer":85,"_process":63,"inherits":57}]},{},[1]); +},{"./support/isBuffer":66,"_process":55,"inherits":49}]},{},[1]); diff --git a/dist/nearlib.min.js b/dist/nearlib.min.js index f4629c9555..4324ab3315 100644 --- a/dist/nearlib.min.js +++ b/dist/nearlib.min.js @@ -3,30 +3,30 @@ require("error-polyfill"),window.nearlib=require("./lib/index"),window.Buffer=Buffer; }).call(this,require("buffer").Buffer) -},{"./lib/index":6,"buffer":39,"error-polyfill":46}],2:[function(require,module,exports){ +},{"./lib/index":6,"buffer":31,"error-polyfill":38}],2:[function(require,module,exports){ (function (Buffer){ -"use strict";var __importDefault=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(exports,"__esModule",{value:!0});const bn_js_1=__importDefault(require("bn.js")),transaction_1=require("./transaction"),provider_1=require("./providers/provider"),serialize_1=require("./utils/serialize"),DEFAULT_FUNC_CALL_AMOUNT=new bn_js_1.default(1e9),TX_STATUS_RETRY_NUMBER=10,TX_STATUS_RETRY_WAIT=500,TX_STATUS_RETRY_WAIT_BACKOFF=1.5;function sleep(t){return new Promise(n=>setTimeout(n,t))}class Account{get ready(){return this._ready||(this._ready=Promise.resolve(this.fetchState()))}constructor(t,n){this.connection=t,this.accountId=n}async fetchState(){const t=await this.connection.provider.query(`account/${this.accountId}`,"");this._state=t,this._state.amount=t.amount,this._state.stake=t.stake}async state(){return await this.ready,this._state}printLogs(t,n){for(const e of n)console.log(`[${t}]: ${e}`)}async retryTxResult(t){let n,e=TX_STATUS_RETRY_WAIT;for(let s=0;st.concat(n.lines),[]);if(t.hasOwnProperty("contractId")?this.printLogs(t.contractId,a):t.hasOwnProperty("originator")&&this.printLogs(t.originator,a),s.status===provider_1.FinalTransactionStatus.Failed&&s.logs){console.warn(a);const t=a.find(t=>t.startsWith("ABORT:"))||a.find(t=>t.startsWith("Runtime error:"))||"";throw new Error(`Transaction ${s.logs[0].hash} failed. ${t}`)}return s}async createAndDeployContract(t,n,e,s){await this.createAccount(t,n,s);const a=new Account(this.connection,t);return await a.ready,await a.deployContract(e),a}async sendMoney(t,n){return await this.ready,this._state.nonce++,this.signAndSendTransaction(transaction_1.sendMoney(this._state.nonce,this.accountId,t,n))}async createAccount(t,n,e){return await this.ready,this._state.nonce++,this.signAndSendTransaction(transaction_1.createAccount(this._state.nonce,this.accountId,t,n,e))}async deployContract(t){return await this.ready,this._state.nonce++,this.signAndSendTransaction(transaction_1.deployContract(this._state.nonce,this.accountId,t))}async functionCall(t,n,e,s){return e||(e={}),await this.ready,this._state.nonce++,this.signAndSendTransaction(transaction_1.functionCall(this._state.nonce,this.accountId,t,n,Buffer.from(JSON.stringify(e)),s||DEFAULT_FUNC_CALL_AMOUNT))}async addKey(t,n,e,s,a){await this.ready,this._state.nonce++;const i=n?transaction_1.createAccessKey(n,e,s,a):null;return this.signAndSendTransaction(transaction_1.addKey(this._state.nonce,this.accountId,t,i))}async deleteKey(t){return await this.ready,this._state.nonce++,this.signAndSendTransaction(transaction_1.deleteKey(this._state.nonce,this.accountId,t))}async stake(t,n){return await this.ready,this._state.nonce++,this.signAndSendTransaction(transaction_1.stake(this._state.nonce,this.accountId,n,t))}async viewFunction(t,n,e){const s=await this.connection.provider.query(`call/${t}/${n}`,serialize_1.base_encode(JSON.stringify(e)));return s.logs&&this.printLogs(t,s.logs),JSON.parse(Buffer.from(s.result).toString())}async getAccountDetails(){const t=await this.connection.provider.query(`access_key/${this.accountId}`,""),n={authorizedApps:[],transactions:[]};return Object.keys(t).forEach(e=>{n.authorizedApps.push({contractId:t[e][1].contract_id,amount:t[e][1].amount,publicKey:serialize_1.base_encode(t[e][0])})}),n}}exports.Account=Account; +"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const transaction_1=require("./transaction"),provider_1=require("./providers/provider"),serialize_1=require("./utils/serialize"),key_pair_1=require("./utils/key_pair"),DEFAULT_FUNC_CALL_AMOUNT=1e6,TX_STATUS_RETRY_NUMBER=10,TX_STATUS_RETRY_WAIT=500,TX_STATUS_RETRY_WAIT_BACKOFF=1.5;function sleep(t){return new Promise(n=>setTimeout(n,t))}class Account{constructor(t,n){this.connection=t,this.accountId=n}get ready(){return this._ready||(this._ready=Promise.resolve(this.fetchState()))}async fetchState(){this._state=await this.connection.provider.query(`account/${this.accountId}`,"");try{const t=(await this.connection.signer.getPublicKey(this.accountId,this.connection.networkId)).toString();if(this._accessKey=await this.connection.provider.query(`access_key/${this.accountId}/${t}`,""),null===this._accessKey)throw new Error(`Failed to fetch access key for '${this.accountId}' with public key ${t}`)}catch{this._accessKey=null}}async state(){return await this.ready,this._state}printLogs(t,n){for(const e of n)console.log(`[${t}]: ${e}`)}async retryTxResult(t){let n,e=TX_STATUS_RETRY_WAIT;for(let s=0;st.concat(n.result.logs),[]);if(this.printLogs(a.transaction.receiverId,c),i.status===provider_1.FinalTransactionStatus.Failed&&c){const t=c.find(t=>t.startsWith("ABORT:"))||c.find(t=>t.startsWith("Runtime error:"))||"";throw new Error(`Transaction ${i.transactions[0].hash} failed. ${t}`)}return i}async createAndDeployContract(t,n,e,s){const a=transaction_1.fullAccessKey();return await this.signAndSendTransaction(t,[transaction_1.createAccount(),transaction_1.transfer(s),transaction_1.addKey(key_pair_1.PublicKey.from(n),a),transaction_1.deployContract(e)]),new Account(this.connection,t)}async sendMoney(t,n){return this.signAndSendTransaction(t,[transaction_1.transfer(n)])}async createAccount(t,n,e){const s=transaction_1.fullAccessKey();return this.signAndSendTransaction(t,[transaction_1.createAccount(),transaction_1.transfer(e),transaction_1.addKey(key_pair_1.PublicKey.from(n),s)])}async deployContract(t){return this.signAndSendTransaction(this.accountId,[transaction_1.deployContract(t)])}async functionCall(t,n,e,s,a){return e||(e={}),this.signAndSendTransaction(t,[transaction_1.functionCall(n,Buffer.from(JSON.stringify(e)),s||DEFAULT_FUNC_CALL_AMOUNT,a)])}async addKey(t,n,e,s){let a;return a=null==n?transaction_1.fullAccessKey():transaction_1.functionCallAccessKey(n,e?[e]:[],s),this.signAndSendTransaction(this.accountId,[transaction_1.addKey(key_pair_1.PublicKey.from(t),a)])}async deleteKey(t){return this.signAndSendTransaction(this.accountId,[transaction_1.deleteKey(key_pair_1.PublicKey.from(t))])}async stake(t,n){return this.signAndSendTransaction(this.accountId,[transaction_1.stake(n,key_pair_1.PublicKey.from(t))])}async viewFunction(t,n,e){const s=await this.connection.provider.query(`call/${t}/${n}`,serialize_1.base_encode(JSON.stringify(e)));return s.logs&&this.printLogs(t,s.logs),JSON.parse(Buffer.from(s.result).toString())}async getAccessKeys(){return await this.connection.provider.query(`access_key/${this.accountId}`,"")}async getAccountDetails(){const t=await this.getAccessKeys(),n={authorizedApps:[],transactions:[]};return t.map(t=>{if(void 0!==t.access_key.permission.FunctionCall){const e=t.access_key.permission.FunctionCall;n.authorizedApps.push({contractId:e.receiver_id,amount:e.allowance,publicKey:t.public_key})}}),n}}exports.Account=Account; }).call(this,require("buffer").Buffer) -},{"./providers/provider":17,"./transaction":19,"./utils/serialize":23,"bn.js":35,"buffer":39}],3:[function(require,module,exports){ +},{"./providers/provider":16,"./transaction":18,"./utils/key_pair":20,"./utils/serialize":22,"buffer":31}],3:[function(require,module,exports){ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});class AccountCreator{}exports.AccountCreator=AccountCreator;class LocalAccountCreator extends AccountCreator{constructor(t,c){super(),this.masterAccount=t,this.initialBalance=c}async createAccount(t,c){await this.masterAccount.createAccount(t,c,this.initialBalance)}}exports.LocalAccountCreator=LocalAccountCreator;class UrlAccountCreator extends AccountCreator{constructor(t,c){super(),this.connection=t,this.helperConnection={url:c}}async createAccount(t,c){}}exports.UrlAccountCreator=UrlAccountCreator; },{}],4:[function(require,module,exports){ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const providers_1=require("./providers"),signer_1=require("./signer");function getProvider(e){switch(e.type){case"JsonRpcProvider":return new providers_1.JsonRpcProvider(e.args.url);default:throw new Error(`Unknown provider type ${e.type}`)}}function getSigner(e,r){switch(r.type){case"InMemorySigner":return new signer_1.InMemorySigner(r.keyStore);default:throw new Error(`Unknown signer type ${r.type}`)}}class Connection{constructor(e,r,n){this.networkId=e,this.provider=r,this.signer=n}static fromConfig(e){const r=getProvider(e.provider),n=getSigner(e.networkId,e.signer);return new Connection(e.networkId,r,n)}}exports.Connection=Connection; -},{"./providers":15,"./signer":18}],5:[function(require,module,exports){ +},{"./providers":14,"./signer":17}],5:[function(require,module,exports){ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const providers_1=require("./providers");class Contract{constructor(t,e,c){this.account=t,this.contractId=e,c.viewMethods.forEach(t=>{Object.defineProperty(this,t,{writable:!1,value:async function(e){return this.account.viewFunction(this.contractId,t,e||{})}})}),c.changeMethods.forEach(t=>{Object.defineProperty(this,t,{writable:!1,value:async function(e){const c=await this.account.functionCall(this.contractId,t,e||{});return providers_1.getTransactionLastResult(c)}})})}}exports.Contract=Contract; -},{"./providers":15}],6:[function(require,module,exports){ -"use strict";var __importStar=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var t={};if(null!=r)for(var e in r)Object.hasOwnProperty.call(r,e)&&(t[e]=r[e]);return t.default=r,t};Object.defineProperty(exports,"__esModule",{value:!0});const providers=__importStar(require("./providers"));exports.providers=providers;const utils=__importStar(require("./utils"));exports.utils=utils;const keyStores=__importStar(require("./key_stores"));exports.keyStores=keyStores;const account_1=require("./account");exports.Account=account_1.Account;const accountCreator=__importStar(require("./account_creator"));exports.accountCreator=accountCreator;const connection_1=require("./connection");exports.Connection=connection_1.Connection;const signer_1=require("./signer");exports.Signer=signer_1.Signer,exports.InMemorySigner=signer_1.InMemorySigner;const contract_1=require("./contract");exports.Contract=contract_1.Contract;const key_pair_1=require("./utils/key_pair");exports.KeyPair=key_pair_1.KeyPair;const near_1=require("./near");exports.connect=near_1.connect;const wallet_account_1=require("./wallet-account");exports.WalletAccount=wallet_account_1.WalletAccount; +},{"./providers":14}],6:[function(require,module,exports){ +"use strict";var __importStar=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var t={};if(null!=r)for(var e in r)Object.hasOwnProperty.call(r,e)&&(t[e]=r[e]);return t.default=r,t};Object.defineProperty(exports,"__esModule",{value:!0});const providers=__importStar(require("./providers"));exports.providers=providers;const utils=__importStar(require("./utils"));exports.utils=utils;const keyStores=__importStar(require("./key_stores"));exports.keyStores=keyStores;const transactions=__importStar(require("./transaction"));exports.transactions=transactions;const account_1=require("./account");exports.Account=account_1.Account;const accountCreator=__importStar(require("./account_creator"));exports.accountCreator=accountCreator;const connection_1=require("./connection");exports.Connection=connection_1.Connection;const signer_1=require("./signer");exports.Signer=signer_1.Signer,exports.InMemorySigner=signer_1.InMemorySigner;const contract_1=require("./contract");exports.Contract=contract_1.Contract;const key_pair_1=require("./utils/key_pair");exports.KeyPair=key_pair_1.KeyPair;const near_1=require("./near");exports.connect=near_1.connect;const wallet_account_1=require("./wallet-account");exports.WalletAccount=wallet_account_1.WalletAccount; -},{"./account":2,"./account_creator":3,"./connection":4,"./contract":5,"./key_stores":9,"./near":13,"./providers":15,"./signer":18,"./utils":20,"./utils/key_pair":21,"./wallet-account":25}],7:[function(require,module,exports){ +},{"./account":2,"./account_creator":3,"./connection":4,"./contract":5,"./key_stores":9,"./near":13,"./providers":14,"./signer":17,"./transaction":18,"./utils":19,"./utils/key_pair":20,"./wallet-account":24}],7:[function(require,module,exports){ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const keystore_1=require("./keystore"),key_pair_1=require("../utils/key_pair"),LOCAL_STORAGE_KEY_PREFIX="nearlib:keystore:";class BrowserLocalStorageKeyStore extends keystore_1.KeyStore{constructor(e=window.localStorage,t=LOCAL_STORAGE_KEY_PREFIX){super(),this.localStorage=e,this.prefix=t}async setKey(e,t,r){this.localStorage.setItem(this.storageKeyForSecretKey(e,t),r.toString())}async getKey(e,t){const r=this.localStorage.getItem(this.storageKeyForSecretKey(e,t));return r?key_pair_1.KeyPair.fromString(r):null}async removeKey(e,t){this.localStorage.removeItem(this.storageKeyForSecretKey(e,t))}async clear(){for(const e of this.storageKeys())e.startsWith(this.prefix)&&this.localStorage.removeItem(e)}async getNetworks(){const e=new Set;for(const t of this.storageKeys())if(t.startsWith(this.prefix)){const r=t.substring(this.prefix.length).split(":");e.add(r[1])}return Array.from(e.values())}async getAccounts(e){const t=new Array;for(const r of this.storageKeys())if(r.startsWith(this.prefix)){const s=r.substring(this.prefix.length).split(":");s[1]===e&&t.push(s[0])}return t}storageKeyForSecretKey(e,t){return`${this.prefix}${t}:${e}`}*storageKeys(){for(let e=0;e{const t=s.split(":");e.add(t[1])}),Array.from(e.values())}async getAccounts(e){const s=new Array;return Object.keys(this.keys).forEach(t=>{const r=t.split(":");r[1]===e&&s.push(r[0])}),s}}exports.InMemoryKeyStore=InMemoryKeyStore; +},{"../utils/key_pair":20,"./keystore":10}],8:[function(require,module,exports){ +"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const keystore_1=require("./keystore"),key_pair_1=require("../utils/key_pair");class InMemoryKeyStore extends keystore_1.KeyStore{constructor(){super(),this.keys={}}async setKey(e,s,t){this.keys[`${s}:${e}`]=t.toString()}async getKey(e,s){const t=this.keys[`${s}:${e}`];return t?key_pair_1.KeyPair.fromString(t):null}async removeKey(e,s){delete this.keys[`${s}:${e}`]}async clear(){this.keys={}}async getNetworks(){const e=new Set;return Object.keys(this.keys).forEach(s=>{const t=s.split(":");e.add(t[1])}),Array.from(e.values())}async getAccounts(e){const s=new Array;return Object.keys(this.keys).forEach(t=>{const r=t.split(":");r[r.length-1]===e&&s.push(r.slice(0,r.length-1).join(":"))}),s}}exports.InMemoryKeyStore=InMemoryKeyStore; -},{"../utils/key_pair":21,"./keystore":10}],9:[function(require,module,exports){ +},{"../utils/key_pair":20,"./keystore":10}],9:[function(require,module,exports){ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const keystore_1=require("./keystore");exports.KeyStore=keystore_1.KeyStore;const in_memory_key_store_1=require("./in_memory_key_store");exports.InMemoryKeyStore=in_memory_key_store_1.InMemoryKeyStore;const browser_local_storage_key_store_1=require("./browser_local_storage_key_store");exports.BrowserLocalStorageKeyStore=browser_local_storage_key_store_1.BrowserLocalStorageKeyStore;const unencrypted_file_system_keystore_1=require("./unencrypted_file_system_keystore");exports.UnencryptedFileSystemKeyStore=unencrypted_file_system_keystore_1.UnencryptedFileSystemKeyStore;const merge_key_store_1=require("./merge_key_store");exports.MergeKeyStore=merge_key_store_1.MergeKeyStore; },{"./browser_local_storage_key_store":7,"./in_memory_key_store":8,"./keystore":10,"./merge_key_store":11,"./unencrypted_file_system_keystore":12}],10:[function(require,module,exports){ @@ -38,211 +38,150 @@ require("error-polyfill"),window.nearlib=require("./lib/index"),window.Buffer=Bu },{"./keystore":10}],12:[function(require,module,exports){ "use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0});const fs_1=__importDefault(require("fs")),util_1=require("util"),key_pair_1=require("../utils/key_pair"),keystore_1=require("./keystore"),promisify=e=>e?util_1.promisify(e):()=>{throw new Error("Trying to use unimplemented function. `fs` module not available in web build?")},exists=promisify(fs_1.default.exists),readFile=promisify(fs_1.default.readFile),writeFile=promisify(fs_1.default.writeFile),unlink=promisify(fs_1.default.unlink),readdir=promisify(fs_1.default.readdir),mkdir=promisify(fs_1.default.mkdir);async function loadJsonFile(e){const t=await readFile(e);return JSON.parse(t.toString())}async function ensureDir(e){try{await mkdir(e,{recursive:!0})}catch(e){if("EEXIST"!==e.code)throw e}}exports.loadJsonFile=loadJsonFile;class UnencryptedFileSystemKeyStore extends keystore_1.KeyStore{constructor(e){super(),this.keyDir=e}async setKey(e,t,i){await ensureDir(`${this.keyDir}/${e}`);const r={account_id:t,private_key:i.toString()};await writeFile(this.getKeyFilePath(e,t),JSON.stringify(r))}async getKey(e,t){if(!await exists(this.getKeyFilePath(e,t)))return null;const i=await loadJsonFile(this.getKeyFilePath(e,t));return key_pair_1.KeyPair.fromString(i.private_key)}async removeKey(e,t){await exists(this.getKeyFilePath(e,t))&&await unlink(this.getKeyFilePath(e,t))}async clear(){for(const e of await this.getNetworks())for(const t of await this.getAccounts(e))await this.removeKey(e,t)}getKeyFilePath(e,t){return`${this.keyDir}/${e}/${t}.json`}async getNetworks(){const e=await readdir(this.keyDir),t=new Array;return e.forEach(e=>{t.push(e)}),t}async getAccounts(e){if(!await exists(`${this.keyDir}/${e}`))return[];return(await readdir(`${this.keyDir}/${e}`)).filter(e=>e.endsWith(".json")).map(e=>e.replace(/.json$/,""))}}exports.UnencryptedFileSystemKeyStore=UnencryptedFileSystemKeyStore; -},{"../utils/key_pair":21,"./keystore":10,"fs":37,"util":86}],13:[function(require,module,exports){ -"use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0});const bn_js_1=__importDefault(require("bn.js")),account_1=require("./account"),connection_1=require("./connection"),contract_1=require("./contract"),unencrypted_file_system_keystore_1=require("./key_stores/unencrypted_file_system_keystore"),key_pair_1=require("./utils/key_pair"),account_creator_1=require("./account_creator"),key_stores_1=require("./key_stores");class Near{constructor(e){this.config=e,this.connection=connection_1.Connection.fromConfig({networkId:e.networkId,provider:{type:"JsonRpcProvider",args:{url:e.nodeUrl}},signer:{type:"InMemorySigner",keyStore:e.deps.keyStore}}),e.masterAccount?this.accountCreator=new account_creator_1.LocalAccountCreator(new account_1.Account(this.connection,e.masterAccount),new bn_js_1.default(e.initialBalance)||new bn_js_1.default(1e12)):e.helperUrl?this.accountCreator=new account_creator_1.UrlAccountCreator(this.connection,e.helperUrl):this.accountCreator=null}async account(e){const t=new account_1.Account(this.connection,e);return await t.state(),t}async createAccount(e,t){if(!this.accountCreator)throw new Error("Must specify account creator, either via masterAccount or helperUrl configuration settings.");return await this.accountCreator.createAccount(e,t),new account_1.Account(this.connection,e)}async loadContract(e,t){console.warn("near.loadContract is deprecated. Use `new nearlib.Contract(yourAccount, contractId, { viewMethods, changeMethods })` instead.");const n=new account_1.Account(this.connection,t.sender);return new contract_1.Contract(n,e,t)}async deployContract(e,t){console.warn("near.deployContract is deprecated. Use `contractAccount.deployContract` or `yourAccount.createAndDeployContract` instead.");const n=new account_1.Account(this.connection,e);return(await n.deployContract(t)).logs[0].hash}async sendTokens(e,t,n){console.warn("near.sendTokens is deprecated. Use `yourAccount.sendMoney` instead.");const c=new account_1.Account(this.connection,t);return(await c.sendMoney(n,e)).logs[0].hash}}async function connect(e){if(e.keyPath&&e.deps&&e.deps.keyStore)try{const t=await unencrypted_file_system_keystore_1.loadJsonFile(e.keyPath);if(t.account_id){const n=new key_pair_1.KeyPairEd25519(t.secret_key),c=new key_stores_1.InMemoryKeyStore;await c.setKey(e.networkId,t.account_id,n),e.masterAccount||(e.masterAccount=t.account_id),e.deps.keyStore=new key_stores_1.MergeKeyStore([e.deps.keyStore,c]),console.log(`Loaded master account ${t.account_id} key from ${e.keyPath} with public key = ${n.getPublicKey()}`)}}catch(t){console.warn(`Failed to load master account key from ${e.keyPath}: ${t}`)}return new Near(e)}exports.Near=Near,exports.connect=connect; +},{"../utils/key_pair":20,"./keystore":10,"fs":29,"util":67}],13:[function(require,module,exports){ +"use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0});const bn_js_1=__importDefault(require("bn.js")),account_1=require("./account"),connection_1=require("./connection"),contract_1=require("./contract"),unencrypted_file_system_keystore_1=require("./key_stores/unencrypted_file_system_keystore"),key_pair_1=require("./utils/key_pair"),account_creator_1=require("./account_creator"),key_stores_1=require("./key_stores");class Near{constructor(e){this.config=e,this.connection=connection_1.Connection.fromConfig({networkId:e.networkId,provider:{type:"JsonRpcProvider",args:{url:e.nodeUrl}},signer:{type:"InMemorySigner",keyStore:e.deps.keyStore}}),e.masterAccount?this.accountCreator=new account_creator_1.LocalAccountCreator(new account_1.Account(this.connection,e.masterAccount),new bn_js_1.default(e.initialBalance)||new bn_js_1.default(1e12)):e.helperUrl?this.accountCreator=new account_creator_1.UrlAccountCreator(this.connection,e.helperUrl):this.accountCreator=null}async account(e){const t=new account_1.Account(this.connection,e);return await t.state(),t}async createAccount(e,t){if(!this.accountCreator)throw new Error("Must specify account creator, either via masterAccount or helperUrl configuration settings.");return await this.accountCreator.createAccount(e,t),new account_1.Account(this.connection,e)}async loadContract(e,t){console.warn("near.loadContract is deprecated. Use `new nearlib.Contract(yourAccount, contractId, { viewMethods, changeMethods })` instead.");const n=new account_1.Account(this.connection,t.sender);return new contract_1.Contract(n,e,t)}async sendTokens(e,t,n){console.warn("near.sendTokens is deprecated. Use `yourAccount.sendMoney` instead.");const c=new account_1.Account(this.connection,t);return(await c.sendMoney(n,e)).transactions[0].hash}}async function connect(e){if(e.keyPath&&e.deps&&e.deps.keyStore)try{const t=await unencrypted_file_system_keystore_1.loadJsonFile(e.keyPath);if(t.account_id){const n=key_pair_1.KeyPair.fromString(t.secret_key),c=new key_stores_1.InMemoryKeyStore;await c.setKey(e.networkId,t.account_id,n),e.masterAccount||(e.masterAccount=t.account_id),e.deps.keyStore=new key_stores_1.MergeKeyStore([e.deps.keyStore,c]),console.log(`Loaded master account ${t.account_id} key from ${e.keyPath} with public key = ${n.getPublicKey()}`)}}catch(t){console.warn(`Failed to load master account key from ${e.keyPath}: ${t}`)}return new Near(e)}exports.Near=Near,exports.connect=connect; -},{"./account":2,"./account_creator":3,"./connection":4,"./contract":5,"./key_stores":9,"./key_stores/unencrypted_file_system_keystore":12,"./utils/key_pair":21,"bn.js":35}],14:[function(require,module,exports){ -"use strict";var $protobuf=require("protobufjs/minimal"),$Reader=$protobuf.Reader,$Writer=$protobuf.Writer,$util=$protobuf.util,$root=$protobuf.roots.default||($protobuf.roots.default={});$root.CreateAccountTransaction=function(){function e(e){if(e)for(var n=Object.keys(e),t=0;t>>3){case 1:o.nonce=e.uint64();break;case 2:o.originator=e.string();break;case 3:o.newAccountId=e.string();break;case 4:o.amount=$root.Uint128.decode(e,e.uint32());break;case 5:o.publicKey=e.bytes();break;default:e.skipType(7&r)}}return o},e.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.nonce&&e.hasOwnProperty("nonce")&&!($util.isInteger(e.nonce)||e.nonce&&$util.isInteger(e.nonce.low)&&$util.isInteger(e.nonce.high)))return"nonce: integer|Long expected";if(null!=e.originator&&e.hasOwnProperty("originator")&&!$util.isString(e.originator))return"originator: string expected";if(null!=e.newAccountId&&e.hasOwnProperty("newAccountId")&&!$util.isString(e.newAccountId))return"newAccountId: string expected";if(null!=e.amount&&e.hasOwnProperty("amount")){var n=$root.Uint128.verify(e.amount);if(n)return"amount."+n}return null!=e.publicKey&&e.hasOwnProperty("publicKey")&&!(e.publicKey&&"number"==typeof e.publicKey.length||$util.isString(e.publicKey))?"publicKey: buffer expected":null},e.fromObject=function(e){if(e instanceof $root.CreateAccountTransaction)return e;var n=new $root.CreateAccountTransaction;if(null!=e.nonce&&($util.Long?(n.nonce=$util.Long.fromValue(e.nonce)).unsigned=!0:"string"==typeof e.nonce?n.nonce=parseInt(e.nonce,10):"number"==typeof e.nonce?n.nonce=e.nonce:"object"==typeof e.nonce&&(n.nonce=new $util.LongBits(e.nonce.low>>>0,e.nonce.high>>>0).toNumber(!0))),null!=e.originator&&(n.originator=String(e.originator)),null!=e.newAccountId&&(n.newAccountId=String(e.newAccountId)),null!=e.amount){if("object"!=typeof e.amount)throw TypeError(".CreateAccountTransaction.amount: object expected");n.amount=$root.Uint128.fromObject(e.amount)}return null!=e.publicKey&&("string"==typeof e.publicKey?$util.base64.decode(e.publicKey,n.publicKey=$util.newBuffer($util.base64.length(e.publicKey)),0):e.publicKey.length&&(n.publicKey=e.publicKey)),n},e.toObject=function(e,n){n||(n={});var t={};if(n.defaults){if($util.Long){var o=new $util.Long(0,0,!0);t.nonce=n.longs===String?o.toString():n.longs===Number?o.toNumber():o}else t.nonce=n.longs===String?"0":0;t.originator="",t.newAccountId="",t.amount=null,n.bytes===String?t.publicKey="":(t.publicKey=[],n.bytes!==Array&&(t.publicKey=$util.newBuffer(t.publicKey)))}return null!=e.nonce&&e.hasOwnProperty("nonce")&&("number"==typeof e.nonce?t.nonce=n.longs===String?String(e.nonce):e.nonce:t.nonce=n.longs===String?$util.Long.prototype.toString.call(e.nonce):n.longs===Number?new $util.LongBits(e.nonce.low>>>0,e.nonce.high>>>0).toNumber(!0):e.nonce),null!=e.originator&&e.hasOwnProperty("originator")&&(t.originator=e.originator),null!=e.newAccountId&&e.hasOwnProperty("newAccountId")&&(t.newAccountId=e.newAccountId),null!=e.amount&&e.hasOwnProperty("amount")&&(t.amount=$root.Uint128.toObject(e.amount,n)),null!=e.publicKey&&e.hasOwnProperty("publicKey")&&(t.publicKey=n.bytes===String?$util.base64.encode(e.publicKey,0,e.publicKey.length):n.bytes===Array?Array.prototype.slice.call(e.publicKey):e.publicKey),t},e.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},e}(),$root.DeployContractTransaction=function(){function e(e){if(e)for(var n=Object.keys(e),t=0;t>>3){case 1:o.nonce=e.uint64();break;case 2:o.contractId=e.string();break;case 3:o.wasmByteArray=e.bytes();break;default:e.skipType(7&r)}}return o},e.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.nonce&&e.hasOwnProperty("nonce")&&!($util.isInteger(e.nonce)||e.nonce&&$util.isInteger(e.nonce.low)&&$util.isInteger(e.nonce.high))?"nonce: integer|Long expected":null!=e.contractId&&e.hasOwnProperty("contractId")&&!$util.isString(e.contractId)?"contractId: string expected":null!=e.wasmByteArray&&e.hasOwnProperty("wasmByteArray")&&!(e.wasmByteArray&&"number"==typeof e.wasmByteArray.length||$util.isString(e.wasmByteArray))?"wasmByteArray: buffer expected":null},e.fromObject=function(e){if(e instanceof $root.DeployContractTransaction)return e;var n=new $root.DeployContractTransaction;return null!=e.nonce&&($util.Long?(n.nonce=$util.Long.fromValue(e.nonce)).unsigned=!0:"string"==typeof e.nonce?n.nonce=parseInt(e.nonce,10):"number"==typeof e.nonce?n.nonce=e.nonce:"object"==typeof e.nonce&&(n.nonce=new $util.LongBits(e.nonce.low>>>0,e.nonce.high>>>0).toNumber(!0))),null!=e.contractId&&(n.contractId=String(e.contractId)),null!=e.wasmByteArray&&("string"==typeof e.wasmByteArray?$util.base64.decode(e.wasmByteArray,n.wasmByteArray=$util.newBuffer($util.base64.length(e.wasmByteArray)),0):e.wasmByteArray.length&&(n.wasmByteArray=e.wasmByteArray)),n},e.toObject=function(e,n){n||(n={});var t={};if(n.defaults){if($util.Long){var o=new $util.Long(0,0,!0);t.nonce=n.longs===String?o.toString():n.longs===Number?o.toNumber():o}else t.nonce=n.longs===String?"0":0;t.contractId="",n.bytes===String?t.wasmByteArray="":(t.wasmByteArray=[],n.bytes!==Array&&(t.wasmByteArray=$util.newBuffer(t.wasmByteArray)))}return null!=e.nonce&&e.hasOwnProperty("nonce")&&("number"==typeof e.nonce?t.nonce=n.longs===String?String(e.nonce):e.nonce:t.nonce=n.longs===String?$util.Long.prototype.toString.call(e.nonce):n.longs===Number?new $util.LongBits(e.nonce.low>>>0,e.nonce.high>>>0).toNumber(!0):e.nonce),null!=e.contractId&&e.hasOwnProperty("contractId")&&(t.contractId=e.contractId),null!=e.wasmByteArray&&e.hasOwnProperty("wasmByteArray")&&(t.wasmByteArray=n.bytes===String?$util.base64.encode(e.wasmByteArray,0,e.wasmByteArray.length):n.bytes===Array?Array.prototype.slice.call(e.wasmByteArray):e.wasmByteArray),t},e.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},e}(),$root.FunctionCallTransaction=function(){function e(e){if(e)for(var n=Object.keys(e),t=0;t>>3){case 1:o.nonce=e.uint64();break;case 2:o.originator=e.string();break;case 3:o.contractId=e.string();break;case 4:o.methodName=e.bytes();break;case 5:o.args=e.bytes();break;case 6:o.amount=$root.Uint128.decode(e,e.uint32());break;default:e.skipType(7&r)}}return o},e.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.nonce&&e.hasOwnProperty("nonce")&&!($util.isInteger(e.nonce)||e.nonce&&$util.isInteger(e.nonce.low)&&$util.isInteger(e.nonce.high)))return"nonce: integer|Long expected";if(null!=e.originator&&e.hasOwnProperty("originator")&&!$util.isString(e.originator))return"originator: string expected";if(null!=e.contractId&&e.hasOwnProperty("contractId")&&!$util.isString(e.contractId))return"contractId: string expected";if(null!=e.methodName&&e.hasOwnProperty("methodName")&&!(e.methodName&&"number"==typeof e.methodName.length||$util.isString(e.methodName)))return"methodName: buffer expected";if(null!=e.args&&e.hasOwnProperty("args")&&!(e.args&&"number"==typeof e.args.length||$util.isString(e.args)))return"args: buffer expected";if(null!=e.amount&&e.hasOwnProperty("amount")){var n=$root.Uint128.verify(e.amount);if(n)return"amount."+n}return null},e.fromObject=function(e){if(e instanceof $root.FunctionCallTransaction)return e;var n=new $root.FunctionCallTransaction;if(null!=e.nonce&&($util.Long?(n.nonce=$util.Long.fromValue(e.nonce)).unsigned=!0:"string"==typeof e.nonce?n.nonce=parseInt(e.nonce,10):"number"==typeof e.nonce?n.nonce=e.nonce:"object"==typeof e.nonce&&(n.nonce=new $util.LongBits(e.nonce.low>>>0,e.nonce.high>>>0).toNumber(!0))),null!=e.originator&&(n.originator=String(e.originator)),null!=e.contractId&&(n.contractId=String(e.contractId)),null!=e.methodName&&("string"==typeof e.methodName?$util.base64.decode(e.methodName,n.methodName=$util.newBuffer($util.base64.length(e.methodName)),0):e.methodName.length&&(n.methodName=e.methodName)),null!=e.args&&("string"==typeof e.args?$util.base64.decode(e.args,n.args=$util.newBuffer($util.base64.length(e.args)),0):e.args.length&&(n.args=e.args)),null!=e.amount){if("object"!=typeof e.amount)throw TypeError(".FunctionCallTransaction.amount: object expected");n.amount=$root.Uint128.fromObject(e.amount)}return n},e.toObject=function(e,n){n||(n={});var t={};if(n.defaults){if($util.Long){var o=new $util.Long(0,0,!0);t.nonce=n.longs===String?o.toString():n.longs===Number?o.toNumber():o}else t.nonce=n.longs===String?"0":0;t.originator="",t.contractId="",n.bytes===String?t.methodName="":(t.methodName=[],n.bytes!==Array&&(t.methodName=$util.newBuffer(t.methodName))),n.bytes===String?t.args="":(t.args=[],n.bytes!==Array&&(t.args=$util.newBuffer(t.args))),t.amount=null}return null!=e.nonce&&e.hasOwnProperty("nonce")&&("number"==typeof e.nonce?t.nonce=n.longs===String?String(e.nonce):e.nonce:t.nonce=n.longs===String?$util.Long.prototype.toString.call(e.nonce):n.longs===Number?new $util.LongBits(e.nonce.low>>>0,e.nonce.high>>>0).toNumber(!0):e.nonce),null!=e.originator&&e.hasOwnProperty("originator")&&(t.originator=e.originator),null!=e.contractId&&e.hasOwnProperty("contractId")&&(t.contractId=e.contractId),null!=e.methodName&&e.hasOwnProperty("methodName")&&(t.methodName=n.bytes===String?$util.base64.encode(e.methodName,0,e.methodName.length):n.bytes===Array?Array.prototype.slice.call(e.methodName):e.methodName),null!=e.args&&e.hasOwnProperty("args")&&(t.args=n.bytes===String?$util.base64.encode(e.args,0,e.args.length):n.bytes===Array?Array.prototype.slice.call(e.args):e.args),null!=e.amount&&e.hasOwnProperty("amount")&&(t.amount=$root.Uint128.toObject(e.amount,n)),t},e.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},e}(),$root.SendMoneyTransaction=function(){function e(e){if(e)for(var n=Object.keys(e),t=0;t>>3){case 1:o.nonce=e.uint64();break;case 2:o.originator=e.string();break;case 3:o.receiver=e.string();break;case 4:o.amount=$root.Uint128.decode(e,e.uint32());break;default:e.skipType(7&r)}}return o},e.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.nonce&&e.hasOwnProperty("nonce")&&!($util.isInteger(e.nonce)||e.nonce&&$util.isInteger(e.nonce.low)&&$util.isInteger(e.nonce.high)))return"nonce: integer|Long expected";if(null!=e.originator&&e.hasOwnProperty("originator")&&!$util.isString(e.originator))return"originator: string expected";if(null!=e.receiver&&e.hasOwnProperty("receiver")&&!$util.isString(e.receiver))return"receiver: string expected";if(null!=e.amount&&e.hasOwnProperty("amount")){var n=$root.Uint128.verify(e.amount);if(n)return"amount."+n}return null},e.fromObject=function(e){if(e instanceof $root.SendMoneyTransaction)return e;var n=new $root.SendMoneyTransaction;if(null!=e.nonce&&($util.Long?(n.nonce=$util.Long.fromValue(e.nonce)).unsigned=!0:"string"==typeof e.nonce?n.nonce=parseInt(e.nonce,10):"number"==typeof e.nonce?n.nonce=e.nonce:"object"==typeof e.nonce&&(n.nonce=new $util.LongBits(e.nonce.low>>>0,e.nonce.high>>>0).toNumber(!0))),null!=e.originator&&(n.originator=String(e.originator)),null!=e.receiver&&(n.receiver=String(e.receiver)),null!=e.amount){if("object"!=typeof e.amount)throw TypeError(".SendMoneyTransaction.amount: object expected");n.amount=$root.Uint128.fromObject(e.amount)}return n},e.toObject=function(e,n){n||(n={});var t={};if(n.defaults){if($util.Long){var o=new $util.Long(0,0,!0);t.nonce=n.longs===String?o.toString():n.longs===Number?o.toNumber():o}else t.nonce=n.longs===String?"0":0;t.originator="",t.receiver="",t.amount=null}return null!=e.nonce&&e.hasOwnProperty("nonce")&&("number"==typeof e.nonce?t.nonce=n.longs===String?String(e.nonce):e.nonce:t.nonce=n.longs===String?$util.Long.prototype.toString.call(e.nonce):n.longs===Number?new $util.LongBits(e.nonce.low>>>0,e.nonce.high>>>0).toNumber(!0):e.nonce),null!=e.originator&&e.hasOwnProperty("originator")&&(t.originator=e.originator),null!=e.receiver&&e.hasOwnProperty("receiver")&&(t.receiver=e.receiver),null!=e.amount&&e.hasOwnProperty("amount")&&(t.amount=$root.Uint128.toObject(e.amount,n)),t},e.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},e}(),$root.StakeTransaction=function(){function e(e){if(e)for(var n=Object.keys(e),t=0;t>>3){case 1:o.nonce=e.uint64();break;case 2:o.originator=e.string();break;case 3:o.amount=$root.Uint128.decode(e,e.uint32());break;case 4:o.publicKey=e.string();break;case 5:o.blsPublicKey=e.string();break;default:e.skipType(7&r)}}return o},e.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.nonce&&e.hasOwnProperty("nonce")&&!($util.isInteger(e.nonce)||e.nonce&&$util.isInteger(e.nonce.low)&&$util.isInteger(e.nonce.high)))return"nonce: integer|Long expected";if(null!=e.originator&&e.hasOwnProperty("originator")&&!$util.isString(e.originator))return"originator: string expected";if(null!=e.amount&&e.hasOwnProperty("amount")){var n=$root.Uint128.verify(e.amount);if(n)return"amount."+n}return null!=e.publicKey&&e.hasOwnProperty("publicKey")&&!$util.isString(e.publicKey)?"publicKey: string expected":null!=e.blsPublicKey&&e.hasOwnProperty("blsPublicKey")&&!$util.isString(e.blsPublicKey)?"blsPublicKey: string expected":null},e.fromObject=function(e){if(e instanceof $root.StakeTransaction)return e;var n=new $root.StakeTransaction;if(null!=e.nonce&&($util.Long?(n.nonce=$util.Long.fromValue(e.nonce)).unsigned=!0:"string"==typeof e.nonce?n.nonce=parseInt(e.nonce,10):"number"==typeof e.nonce?n.nonce=e.nonce:"object"==typeof e.nonce&&(n.nonce=new $util.LongBits(e.nonce.low>>>0,e.nonce.high>>>0).toNumber(!0))),null!=e.originator&&(n.originator=String(e.originator)),null!=e.amount){if("object"!=typeof e.amount)throw TypeError(".StakeTransaction.amount: object expected");n.amount=$root.Uint128.fromObject(e.amount)}return null!=e.publicKey&&(n.publicKey=String(e.publicKey)),null!=e.blsPublicKey&&(n.blsPublicKey=String(e.blsPublicKey)),n},e.toObject=function(e,n){n||(n={});var t={};if(n.defaults){if($util.Long){var o=new $util.Long(0,0,!0);t.nonce=n.longs===String?o.toString():n.longs===Number?o.toNumber():o}else t.nonce=n.longs===String?"0":0;t.originator="",t.amount=null,t.publicKey="",t.blsPublicKey=""}return null!=e.nonce&&e.hasOwnProperty("nonce")&&("number"==typeof e.nonce?t.nonce=n.longs===String?String(e.nonce):e.nonce:t.nonce=n.longs===String?$util.Long.prototype.toString.call(e.nonce):n.longs===Number?new $util.LongBits(e.nonce.low>>>0,e.nonce.high>>>0).toNumber(!0):e.nonce),null!=e.originator&&e.hasOwnProperty("originator")&&(t.originator=e.originator),null!=e.amount&&e.hasOwnProperty("amount")&&(t.amount=$root.Uint128.toObject(e.amount,n)),null!=e.publicKey&&e.hasOwnProperty("publicKey")&&(t.publicKey=e.publicKey),null!=e.blsPublicKey&&e.hasOwnProperty("blsPublicKey")&&(t.blsPublicKey=e.blsPublicKey),t},e.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},e}(),$root.SwapKeyTransaction=function(){function e(e){if(e)for(var n=Object.keys(e),t=0;t>>3){case 1:o.nonce=e.uint64();break;case 2:o.originator=e.string();break;case 3:o.curKey=e.bytes();break;case 4:o.newKey=e.bytes();break;default:e.skipType(7&r)}}return o},e.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.nonce&&e.hasOwnProperty("nonce")&&!($util.isInteger(e.nonce)||e.nonce&&$util.isInteger(e.nonce.low)&&$util.isInteger(e.nonce.high))?"nonce: integer|Long expected":null!=e.originator&&e.hasOwnProperty("originator")&&!$util.isString(e.originator)?"originator: string expected":null!=e.curKey&&e.hasOwnProperty("curKey")&&!(e.curKey&&"number"==typeof e.curKey.length||$util.isString(e.curKey))?"curKey: buffer expected":null!=e.newKey&&e.hasOwnProperty("newKey")&&!(e.newKey&&"number"==typeof e.newKey.length||$util.isString(e.newKey))?"newKey: buffer expected":null},e.fromObject=function(e){if(e instanceof $root.SwapKeyTransaction)return e;var n=new $root.SwapKeyTransaction;return null!=e.nonce&&($util.Long?(n.nonce=$util.Long.fromValue(e.nonce)).unsigned=!0:"string"==typeof e.nonce?n.nonce=parseInt(e.nonce,10):"number"==typeof e.nonce?n.nonce=e.nonce:"object"==typeof e.nonce&&(n.nonce=new $util.LongBits(e.nonce.low>>>0,e.nonce.high>>>0).toNumber(!0))),null!=e.originator&&(n.originator=String(e.originator)),null!=e.curKey&&("string"==typeof e.curKey?$util.base64.decode(e.curKey,n.curKey=$util.newBuffer($util.base64.length(e.curKey)),0):e.curKey.length&&(n.curKey=e.curKey)),null!=e.newKey&&("string"==typeof e.newKey?$util.base64.decode(e.newKey,n.newKey=$util.newBuffer($util.base64.length(e.newKey)),0):e.newKey.length&&(n.newKey=e.newKey)),n},e.toObject=function(e,n){n||(n={});var t={};if(n.defaults){if($util.Long){var o=new $util.Long(0,0,!0);t.nonce=n.longs===String?o.toString():n.longs===Number?o.toNumber():o}else t.nonce=n.longs===String?"0":0;t.originator="",n.bytes===String?t.curKey="":(t.curKey=[],n.bytes!==Array&&(t.curKey=$util.newBuffer(t.curKey))),n.bytes===String?t.newKey="":(t.newKey=[],n.bytes!==Array&&(t.newKey=$util.newBuffer(t.newKey)))}return null!=e.nonce&&e.hasOwnProperty("nonce")&&("number"==typeof e.nonce?t.nonce=n.longs===String?String(e.nonce):e.nonce:t.nonce=n.longs===String?$util.Long.prototype.toString.call(e.nonce):n.longs===Number?new $util.LongBits(e.nonce.low>>>0,e.nonce.high>>>0).toNumber(!0):e.nonce),null!=e.originator&&e.hasOwnProperty("originator")&&(t.originator=e.originator),null!=e.curKey&&e.hasOwnProperty("curKey")&&(t.curKey=n.bytes===String?$util.base64.encode(e.curKey,0,e.curKey.length):n.bytes===Array?Array.prototype.slice.call(e.curKey):e.curKey),null!=e.newKey&&e.hasOwnProperty("newKey")&&(t.newKey=n.bytes===String?$util.base64.encode(e.newKey,0,e.newKey.length):n.bytes===Array?Array.prototype.slice.call(e.newKey):e.newKey),t},e.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},e}(),$root.AddKeyTransaction=function(){function e(e){if(e)for(var n=Object.keys(e),t=0;t>>3){case 1:o.nonce=e.uint64();break;case 2:o.originator=e.string();break;case 3:o.newKey=e.bytes();break;case 4:o.accessKey=$root.AccessKey.decode(e,e.uint32());break;default:e.skipType(7&r)}}return o},e.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.nonce&&e.hasOwnProperty("nonce")&&!($util.isInteger(e.nonce)||e.nonce&&$util.isInteger(e.nonce.low)&&$util.isInteger(e.nonce.high)))return"nonce: integer|Long expected";if(null!=e.originator&&e.hasOwnProperty("originator")&&!$util.isString(e.originator))return"originator: string expected";if(null!=e.newKey&&e.hasOwnProperty("newKey")&&!(e.newKey&&"number"==typeof e.newKey.length||$util.isString(e.newKey)))return"newKey: buffer expected";if(null!=e.accessKey&&e.hasOwnProperty("accessKey")){var n=$root.AccessKey.verify(e.accessKey);if(n)return"accessKey."+n}return null},e.fromObject=function(e){if(e instanceof $root.AddKeyTransaction)return e;var n=new $root.AddKeyTransaction;if(null!=e.nonce&&($util.Long?(n.nonce=$util.Long.fromValue(e.nonce)).unsigned=!0:"string"==typeof e.nonce?n.nonce=parseInt(e.nonce,10):"number"==typeof e.nonce?n.nonce=e.nonce:"object"==typeof e.nonce&&(n.nonce=new $util.LongBits(e.nonce.low>>>0,e.nonce.high>>>0).toNumber(!0))),null!=e.originator&&(n.originator=String(e.originator)),null!=e.newKey&&("string"==typeof e.newKey?$util.base64.decode(e.newKey,n.newKey=$util.newBuffer($util.base64.length(e.newKey)),0):e.newKey.length&&(n.newKey=e.newKey)),null!=e.accessKey){if("object"!=typeof e.accessKey)throw TypeError(".AddKeyTransaction.accessKey: object expected");n.accessKey=$root.AccessKey.fromObject(e.accessKey)}return n},e.toObject=function(e,n){n||(n={});var t={};if(n.defaults){if($util.Long){var o=new $util.Long(0,0,!0);t.nonce=n.longs===String?o.toString():n.longs===Number?o.toNumber():o}else t.nonce=n.longs===String?"0":0;t.originator="",n.bytes===String?t.newKey="":(t.newKey=[],n.bytes!==Array&&(t.newKey=$util.newBuffer(t.newKey))),t.accessKey=null}return null!=e.nonce&&e.hasOwnProperty("nonce")&&("number"==typeof e.nonce?t.nonce=n.longs===String?String(e.nonce):e.nonce:t.nonce=n.longs===String?$util.Long.prototype.toString.call(e.nonce):n.longs===Number?new $util.LongBits(e.nonce.low>>>0,e.nonce.high>>>0).toNumber(!0):e.nonce),null!=e.originator&&e.hasOwnProperty("originator")&&(t.originator=e.originator),null!=e.newKey&&e.hasOwnProperty("newKey")&&(t.newKey=n.bytes===String?$util.base64.encode(e.newKey,0,e.newKey.length):n.bytes===Array?Array.prototype.slice.call(e.newKey):e.newKey),null!=e.accessKey&&e.hasOwnProperty("accessKey")&&(t.accessKey=$root.AccessKey.toObject(e.accessKey,n)),t},e.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},e}(),$root.DeleteKeyTransaction=function(){function e(e){if(e)for(var n=Object.keys(e),t=0;t>>3){case 1:o.nonce=e.uint64();break;case 2:o.originator=e.string();break;case 3:o.curKey=e.bytes();break;default:e.skipType(7&r)}}return o},e.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.nonce&&e.hasOwnProperty("nonce")&&!($util.isInteger(e.nonce)||e.nonce&&$util.isInteger(e.nonce.low)&&$util.isInteger(e.nonce.high))?"nonce: integer|Long expected":null!=e.originator&&e.hasOwnProperty("originator")&&!$util.isString(e.originator)?"originator: string expected":null!=e.curKey&&e.hasOwnProperty("curKey")&&!(e.curKey&&"number"==typeof e.curKey.length||$util.isString(e.curKey))?"curKey: buffer expected":null},e.fromObject=function(e){if(e instanceof $root.DeleteKeyTransaction)return e;var n=new $root.DeleteKeyTransaction;return null!=e.nonce&&($util.Long?(n.nonce=$util.Long.fromValue(e.nonce)).unsigned=!0:"string"==typeof e.nonce?n.nonce=parseInt(e.nonce,10):"number"==typeof e.nonce?n.nonce=e.nonce:"object"==typeof e.nonce&&(n.nonce=new $util.LongBits(e.nonce.low>>>0,e.nonce.high>>>0).toNumber(!0))),null!=e.originator&&(n.originator=String(e.originator)),null!=e.curKey&&("string"==typeof e.curKey?$util.base64.decode(e.curKey,n.curKey=$util.newBuffer($util.base64.length(e.curKey)),0):e.curKey.length&&(n.curKey=e.curKey)),n},e.toObject=function(e,n){n||(n={});var t={};if(n.defaults){if($util.Long){var o=new $util.Long(0,0,!0);t.nonce=n.longs===String?o.toString():n.longs===Number?o.toNumber():o}else t.nonce=n.longs===String?"0":0;t.originator="",n.bytes===String?t.curKey="":(t.curKey=[],n.bytes!==Array&&(t.curKey=$util.newBuffer(t.curKey)))}return null!=e.nonce&&e.hasOwnProperty("nonce")&&("number"==typeof e.nonce?t.nonce=n.longs===String?String(e.nonce):e.nonce:t.nonce=n.longs===String?$util.Long.prototype.toString.call(e.nonce):n.longs===Number?new $util.LongBits(e.nonce.low>>>0,e.nonce.high>>>0).toNumber(!0):e.nonce),null!=e.originator&&e.hasOwnProperty("originator")&&(t.originator=e.originator),null!=e.curKey&&e.hasOwnProperty("curKey")&&(t.curKey=n.bytes===String?$util.base64.encode(e.curKey,0,e.curKey.length):n.bytes===Array?Array.prototype.slice.call(e.curKey):e.curKey),t},e.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},e}(),$root.DeleteAccountTransaction=function(){function e(e){if(e)for(var n=Object.keys(e),t=0;t>>3){case 1:o.nonce=e.uint64();break;case 2:o.originatorId=e.string();break;case 3:o.receiverId=e.string();break;default:e.skipType(7&r)}}return o},e.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.nonce&&e.hasOwnProperty("nonce")&&!($util.isInteger(e.nonce)||e.nonce&&$util.isInteger(e.nonce.low)&&$util.isInteger(e.nonce.high))?"nonce: integer|Long expected":null!=e.originatorId&&e.hasOwnProperty("originatorId")&&!$util.isString(e.originatorId)?"originatorId: string expected":null!=e.receiverId&&e.hasOwnProperty("receiverId")&&!$util.isString(e.receiverId)?"receiverId: string expected":null},e.fromObject=function(e){if(e instanceof $root.DeleteAccountTransaction)return e;var n=new $root.DeleteAccountTransaction;return null!=e.nonce&&($util.Long?(n.nonce=$util.Long.fromValue(e.nonce)).unsigned=!0:"string"==typeof e.nonce?n.nonce=parseInt(e.nonce,10):"number"==typeof e.nonce?n.nonce=e.nonce:"object"==typeof e.nonce&&(n.nonce=new $util.LongBits(e.nonce.low>>>0,e.nonce.high>>>0).toNumber(!0))),null!=e.originatorId&&(n.originatorId=String(e.originatorId)),null!=e.receiverId&&(n.receiverId=String(e.receiverId)),n},e.toObject=function(e,n){n||(n={});var t={};if(n.defaults){if($util.Long){var o=new $util.Long(0,0,!0);t.nonce=n.longs===String?o.toString():n.longs===Number?o.toNumber():o}else t.nonce=n.longs===String?"0":0;t.originatorId="",t.receiverId=""}return null!=e.nonce&&e.hasOwnProperty("nonce")&&("number"==typeof e.nonce?t.nonce=n.longs===String?String(e.nonce):e.nonce:t.nonce=n.longs===String?$util.Long.prototype.toString.call(e.nonce):n.longs===Number?new $util.LongBits(e.nonce.low>>>0,e.nonce.high>>>0).toNumber(!0):e.nonce),null!=e.originatorId&&e.hasOwnProperty("originatorId")&&(t.originatorId=e.originatorId),null!=e.receiverId&&e.hasOwnProperty("receiverId")&&(t.receiverId=e.receiverId),t},e.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},e}(),$root.SignedTransaction=function(){function e(e){if(e)for(var n=Object.keys(e),t=0;t>>3){case 1:o.signature=e.bytes();break;case 10:o.publicKey=$root.google.protobuf.BytesValue.decode(e,e.uint32());break;case 2:o.createAccount=$root.CreateAccountTransaction.decode(e,e.uint32());break;case 3:o.deployContract=$root.DeployContractTransaction.decode(e,e.uint32());break;case 4:o.functionCall=$root.FunctionCallTransaction.decode(e,e.uint32());break;case 5:o.sendMoney=$root.SendMoneyTransaction.decode(e,e.uint32());break;case 6:o.stake=$root.StakeTransaction.decode(e,e.uint32());break;case 7:o.swapKey=$root.SwapKeyTransaction.decode(e,e.uint32());break;case 8:o.addKey=$root.AddKeyTransaction.decode(e,e.uint32());break;case 9:o.deleteKey=$root.DeleteKeyTransaction.decode(e,e.uint32());break;case 11:o.deleteAccount=$root.DeleteAccountTransaction.decode(e,e.uint32());break;default:e.skipType(7&r)}}return o},e.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";var n={};if(null!=e.signature&&e.hasOwnProperty("signature")&&!(e.signature&&"number"==typeof e.signature.length||$util.isString(e.signature)))return"signature: buffer expected";if(null!=e.publicKey&&e.hasOwnProperty("publicKey")&&(t=$root.google.protobuf.BytesValue.verify(e.publicKey)))return"publicKey."+t;if(null!=e.createAccount&&e.hasOwnProperty("createAccount")&&(n.body=1,t=$root.CreateAccountTransaction.verify(e.createAccount)))return"createAccount."+t;if(null!=e.deployContract&&e.hasOwnProperty("deployContract")){if(1===n.body)return"body: multiple values";if(n.body=1,t=$root.DeployContractTransaction.verify(e.deployContract))return"deployContract."+t}if(null!=e.functionCall&&e.hasOwnProperty("functionCall")){if(1===n.body)return"body: multiple values";if(n.body=1,t=$root.FunctionCallTransaction.verify(e.functionCall))return"functionCall."+t}if(null!=e.sendMoney&&e.hasOwnProperty("sendMoney")){if(1===n.body)return"body: multiple values";if(n.body=1,t=$root.SendMoneyTransaction.verify(e.sendMoney))return"sendMoney."+t}if(null!=e.stake&&e.hasOwnProperty("stake")){if(1===n.body)return"body: multiple values";if(n.body=1,t=$root.StakeTransaction.verify(e.stake))return"stake."+t}if(null!=e.swapKey&&e.hasOwnProperty("swapKey")){if(1===n.body)return"body: multiple values";if(n.body=1,t=$root.SwapKeyTransaction.verify(e.swapKey))return"swapKey."+t}if(null!=e.addKey&&e.hasOwnProperty("addKey")){if(1===n.body)return"body: multiple values";if(n.body=1,t=$root.AddKeyTransaction.verify(e.addKey))return"addKey."+t}if(null!=e.deleteKey&&e.hasOwnProperty("deleteKey")){if(1===n.body)return"body: multiple values";if(n.body=1,t=$root.DeleteKeyTransaction.verify(e.deleteKey))return"deleteKey."+t}if(null!=e.deleteAccount&&e.hasOwnProperty("deleteAccount")){if(1===n.body)return"body: multiple values";var t;if(n.body=1,t=$root.DeleteAccountTransaction.verify(e.deleteAccount))return"deleteAccount."+t}return null},e.fromObject=function(e){if(e instanceof $root.SignedTransaction)return e;var n=new $root.SignedTransaction;if(null!=e.signature&&("string"==typeof e.signature?$util.base64.decode(e.signature,n.signature=$util.newBuffer($util.base64.length(e.signature)),0):e.signature.length&&(n.signature=e.signature)),null!=e.publicKey){if("object"!=typeof e.publicKey)throw TypeError(".SignedTransaction.publicKey: object expected");n.publicKey=$root.google.protobuf.BytesValue.fromObject(e.publicKey)}if(null!=e.createAccount){if("object"!=typeof e.createAccount)throw TypeError(".SignedTransaction.createAccount: object expected");n.createAccount=$root.CreateAccountTransaction.fromObject(e.createAccount)}if(null!=e.deployContract){if("object"!=typeof e.deployContract)throw TypeError(".SignedTransaction.deployContract: object expected");n.deployContract=$root.DeployContractTransaction.fromObject(e.deployContract)}if(null!=e.functionCall){if("object"!=typeof e.functionCall)throw TypeError(".SignedTransaction.functionCall: object expected");n.functionCall=$root.FunctionCallTransaction.fromObject(e.functionCall)}if(null!=e.sendMoney){if("object"!=typeof e.sendMoney)throw TypeError(".SignedTransaction.sendMoney: object expected");n.sendMoney=$root.SendMoneyTransaction.fromObject(e.sendMoney)}if(null!=e.stake){if("object"!=typeof e.stake)throw TypeError(".SignedTransaction.stake: object expected");n.stake=$root.StakeTransaction.fromObject(e.stake)}if(null!=e.swapKey){if("object"!=typeof e.swapKey)throw TypeError(".SignedTransaction.swapKey: object expected");n.swapKey=$root.SwapKeyTransaction.fromObject(e.swapKey)}if(null!=e.addKey){if("object"!=typeof e.addKey)throw TypeError(".SignedTransaction.addKey: object expected");n.addKey=$root.AddKeyTransaction.fromObject(e.addKey)}if(null!=e.deleteKey){if("object"!=typeof e.deleteKey)throw TypeError(".SignedTransaction.deleteKey: object expected");n.deleteKey=$root.DeleteKeyTransaction.fromObject(e.deleteKey)}if(null!=e.deleteAccount){if("object"!=typeof e.deleteAccount)throw TypeError(".SignedTransaction.deleteAccount: object expected");n.deleteAccount=$root.DeleteAccountTransaction.fromObject(e.deleteAccount)}return n},e.toObject=function(e,n){n||(n={});var t={};return n.defaults&&(n.bytes===String?t.signature="":(t.signature=[],n.bytes!==Array&&(t.signature=$util.newBuffer(t.signature))),t.publicKey=null),null!=e.signature&&e.hasOwnProperty("signature")&&(t.signature=n.bytes===String?$util.base64.encode(e.signature,0,e.signature.length):n.bytes===Array?Array.prototype.slice.call(e.signature):e.signature),null!=e.createAccount&&e.hasOwnProperty("createAccount")&&(t.createAccount=$root.CreateAccountTransaction.toObject(e.createAccount,n),n.oneofs&&(t.body="createAccount")),null!=e.deployContract&&e.hasOwnProperty("deployContract")&&(t.deployContract=$root.DeployContractTransaction.toObject(e.deployContract,n),n.oneofs&&(t.body="deployContract")),null!=e.functionCall&&e.hasOwnProperty("functionCall")&&(t.functionCall=$root.FunctionCallTransaction.toObject(e.functionCall,n),n.oneofs&&(t.body="functionCall")),null!=e.sendMoney&&e.hasOwnProperty("sendMoney")&&(t.sendMoney=$root.SendMoneyTransaction.toObject(e.sendMoney,n),n.oneofs&&(t.body="sendMoney")),null!=e.stake&&e.hasOwnProperty("stake")&&(t.stake=$root.StakeTransaction.toObject(e.stake,n),n.oneofs&&(t.body="stake")),null!=e.swapKey&&e.hasOwnProperty("swapKey")&&(t.swapKey=$root.SwapKeyTransaction.toObject(e.swapKey,n),n.oneofs&&(t.body="swapKey")),null!=e.addKey&&e.hasOwnProperty("addKey")&&(t.addKey=$root.AddKeyTransaction.toObject(e.addKey,n),n.oneofs&&(t.body="addKey")),null!=e.deleteKey&&e.hasOwnProperty("deleteKey")&&(t.deleteKey=$root.DeleteKeyTransaction.toObject(e.deleteKey,n),n.oneofs&&(t.body="deleteKey")),null!=e.publicKey&&e.hasOwnProperty("publicKey")&&(t.publicKey=$root.google.protobuf.BytesValue.toObject(e.publicKey,n)),null!=e.deleteAccount&&e.hasOwnProperty("deleteAccount")&&(t.deleteAccount=$root.DeleteAccountTransaction.toObject(e.deleteAccount,n),n.oneofs&&(t.body="deleteAccount")),t},e.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},e}(),$root.google=function(){var e,n={};return n.protobuf=((e={}).DoubleValue=function(){function e(e){if(e)for(var n=Object.keys(e),t=0;t>>3){case 1:o.value=e.double();break;default:e.skipType(7&r)}}return o},e.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.value&&e.hasOwnProperty("value")&&"number"!=typeof e.value?"value: number expected":null},e.fromObject=function(e){if(e instanceof $root.google.protobuf.DoubleValue)return e;var n=new $root.google.protobuf.DoubleValue;return null!=e.value&&(n.value=Number(e.value)),n},e.toObject=function(e,n){n||(n={});var t={};return n.defaults&&(t.value=0),null!=e.value&&e.hasOwnProperty("value")&&(t.value=n.json&&!isFinite(e.value)?String(e.value):e.value),t},e.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},e}(),e.FloatValue=function(){function e(e){if(e)for(var n=Object.keys(e),t=0;t>>3){case 1:o.value=e.float();break;default:e.skipType(7&r)}}return o},e.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.value&&e.hasOwnProperty("value")&&"number"!=typeof e.value?"value: number expected":null},e.fromObject=function(e){if(e instanceof $root.google.protobuf.FloatValue)return e;var n=new $root.google.protobuf.FloatValue;return null!=e.value&&(n.value=Number(e.value)),n},e.toObject=function(e,n){n||(n={});var t={};return n.defaults&&(t.value=0),null!=e.value&&e.hasOwnProperty("value")&&(t.value=n.json&&!isFinite(e.value)?String(e.value):e.value),t},e.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},e}(),e.Int64Value=function(){function e(e){if(e)for(var n=Object.keys(e),t=0;t>>3){case 1:o.value=e.int64();break;default:e.skipType(7&r)}}return o},e.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.value&&e.hasOwnProperty("value")&&!($util.isInteger(e.value)||e.value&&$util.isInteger(e.value.low)&&$util.isInteger(e.value.high))?"value: integer|Long expected":null},e.fromObject=function(e){if(e instanceof $root.google.protobuf.Int64Value)return e;var n=new $root.google.protobuf.Int64Value;return null!=e.value&&($util.Long?(n.value=$util.Long.fromValue(e.value)).unsigned=!1:"string"==typeof e.value?n.value=parseInt(e.value,10):"number"==typeof e.value?n.value=e.value:"object"==typeof e.value&&(n.value=new $util.LongBits(e.value.low>>>0,e.value.high>>>0).toNumber())),n},e.toObject=function(e,n){n||(n={});var t={};if(n.defaults)if($util.Long){var o=new $util.Long(0,0,!1);t.value=n.longs===String?o.toString():n.longs===Number?o.toNumber():o}else t.value=n.longs===String?"0":0;return null!=e.value&&e.hasOwnProperty("value")&&("number"==typeof e.value?t.value=n.longs===String?String(e.value):e.value:t.value=n.longs===String?$util.Long.prototype.toString.call(e.value):n.longs===Number?new $util.LongBits(e.value.low>>>0,e.value.high>>>0).toNumber():e.value),t},e.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},e}(),e.UInt64Value=function(){function e(e){if(e)for(var n=Object.keys(e),t=0;t>>3){case 1:o.value=e.uint64();break;default:e.skipType(7&r)}}return o},e.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.value&&e.hasOwnProperty("value")&&!($util.isInteger(e.value)||e.value&&$util.isInteger(e.value.low)&&$util.isInteger(e.value.high))?"value: integer|Long expected":null},e.fromObject=function(e){if(e instanceof $root.google.protobuf.UInt64Value)return e;var n=new $root.google.protobuf.UInt64Value;return null!=e.value&&($util.Long?(n.value=$util.Long.fromValue(e.value)).unsigned=!0:"string"==typeof e.value?n.value=parseInt(e.value,10):"number"==typeof e.value?n.value=e.value:"object"==typeof e.value&&(n.value=new $util.LongBits(e.value.low>>>0,e.value.high>>>0).toNumber(!0))),n},e.toObject=function(e,n){n||(n={});var t={};if(n.defaults)if($util.Long){var o=new $util.Long(0,0,!0);t.value=n.longs===String?o.toString():n.longs===Number?o.toNumber():o}else t.value=n.longs===String?"0":0;return null!=e.value&&e.hasOwnProperty("value")&&("number"==typeof e.value?t.value=n.longs===String?String(e.value):e.value:t.value=n.longs===String?$util.Long.prototype.toString.call(e.value):n.longs===Number?new $util.LongBits(e.value.low>>>0,e.value.high>>>0).toNumber(!0):e.value),t},e.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},e}(),e.Int32Value=function(){function e(e){if(e)for(var n=Object.keys(e),t=0;t>>3){case 1:o.value=e.int32();break;default:e.skipType(7&r)}}return o},e.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.value&&e.hasOwnProperty("value")&&!$util.isInteger(e.value)?"value: integer expected":null},e.fromObject=function(e){if(e instanceof $root.google.protobuf.Int32Value)return e;var n=new $root.google.protobuf.Int32Value;return null!=e.value&&(n.value=0|e.value),n},e.toObject=function(e,n){n||(n={});var t={};return n.defaults&&(t.value=0),null!=e.value&&e.hasOwnProperty("value")&&(t.value=e.value),t},e.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},e}(),e.UInt32Value=function(){function e(e){if(e)for(var n=Object.keys(e),t=0;t>>3){case 1:o.value=e.uint32();break;default:e.skipType(7&r)}}return o},e.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.value&&e.hasOwnProperty("value")&&!$util.isInteger(e.value)?"value: integer expected":null},e.fromObject=function(e){if(e instanceof $root.google.protobuf.UInt32Value)return e;var n=new $root.google.protobuf.UInt32Value;return null!=e.value&&(n.value=e.value>>>0),n},e.toObject=function(e,n){n||(n={});var t={};return n.defaults&&(t.value=0),null!=e.value&&e.hasOwnProperty("value")&&(t.value=e.value),t},e.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},e}(),e.BoolValue=function(){function e(e){if(e)for(var n=Object.keys(e),t=0;t>>3){case 1:o.value=e.bool();break;default:e.skipType(7&r)}}return o},e.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.value&&e.hasOwnProperty("value")&&"boolean"!=typeof e.value?"value: boolean expected":null},e.fromObject=function(e){if(e instanceof $root.google.protobuf.BoolValue)return e;var n=new $root.google.protobuf.BoolValue;return null!=e.value&&(n.value=Boolean(e.value)),n},e.toObject=function(e,n){n||(n={});var t={};return n.defaults&&(t.value=!1),null!=e.value&&e.hasOwnProperty("value")&&(t.value=e.value),t},e.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},e}(),e.StringValue=function(){function e(e){if(e)for(var n=Object.keys(e),t=0;t>>3){case 1:o.value=e.string();break;default:e.skipType(7&r)}}return o},e.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.value&&e.hasOwnProperty("value")&&!$util.isString(e.value)?"value: string expected":null},e.fromObject=function(e){if(e instanceof $root.google.protobuf.StringValue)return e;var n=new $root.google.protobuf.StringValue;return null!=e.value&&(n.value=String(e.value)),n},e.toObject=function(e,n){n||(n={});var t={};return n.defaults&&(t.value=""),null!=e.value&&e.hasOwnProperty("value")&&(t.value=e.value),t},e.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},e}(),e.BytesValue=function(){function e(e){if(e)for(var n=Object.keys(e),t=0;t>>3){case 1:o.value=e.bytes();break;default:e.skipType(7&r)}}return o},e.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.value&&e.hasOwnProperty("value")&&!(e.value&&"number"==typeof e.value.length||$util.isString(e.value))?"value: buffer expected":null},e.fromObject=function(e){if(e instanceof $root.google.protobuf.BytesValue)return e;var n=new $root.google.protobuf.BytesValue;return null!=e.value&&("string"==typeof e.value?$util.base64.decode(e.value,n.value=$util.newBuffer($util.base64.length(e.value)),0):e.value.length&&(n.value=e.value)),n},e.toObject=function(e,n){n||(n={});var t={};return n.defaults&&(n.bytes===String?t.value="":(t.value=[],n.bytes!==Array&&(t.value=$util.newBuffer(t.value)))),null!=e.value&&e.hasOwnProperty("value")&&(t.value=n.bytes===String?$util.base64.encode(e.value,0,e.value.length):n.bytes===Array?Array.prototype.slice.call(e.value):e.value),t},e.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},e}(),e),n}(),$root.AccessKey=function(){function e(e){if(e)for(var n=Object.keys(e),t=0;t>>3){case 1:o.amount=$root.Uint128.decode(e,e.uint32());break;case 2:o.balanceOwner=$root.google.protobuf.StringValue.decode(e,e.uint32());break;case 3:o.contractId=$root.google.protobuf.StringValue.decode(e,e.uint32());break;case 4:o.methodName=$root.google.protobuf.BytesValue.decode(e,e.uint32());break;default:e.skipType(7&r)}}return o},e.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";var n;if(null!=e.amount&&e.hasOwnProperty("amount")&&(n=$root.Uint128.verify(e.amount)))return"amount."+n;if(null!=e.balanceOwner&&e.hasOwnProperty("balanceOwner")&&(n=$root.google.protobuf.StringValue.verify(e.balanceOwner)))return"balanceOwner."+n;if(null!=e.contractId&&e.hasOwnProperty("contractId")&&(n=$root.google.protobuf.StringValue.verify(e.contractId)))return"contractId."+n;if(null!=e.methodName&&e.hasOwnProperty("methodName")&&(n=$root.google.protobuf.BytesValue.verify(e.methodName)))return"methodName."+n;return null},e.fromObject=function(e){if(e instanceof $root.AccessKey)return e;var n=new $root.AccessKey;if(null!=e.amount){if("object"!=typeof e.amount)throw TypeError(".AccessKey.amount: object expected");n.amount=$root.Uint128.fromObject(e.amount)}if(null!=e.balanceOwner){if("object"!=typeof e.balanceOwner)throw TypeError(".AccessKey.balanceOwner: object expected");n.balanceOwner=$root.google.protobuf.StringValue.fromObject(e.balanceOwner)}if(null!=e.contractId){if("object"!=typeof e.contractId)throw TypeError(".AccessKey.contractId: object expected");n.contractId=$root.google.protobuf.StringValue.fromObject(e.contractId)}if(null!=e.methodName){if("object"!=typeof e.methodName)throw TypeError(".AccessKey.methodName: object expected");n.methodName=$root.google.protobuf.BytesValue.fromObject(e.methodName)}return n},e.toObject=function(e,n){n||(n={});var t={};return n.defaults&&(t.amount=null,t.balanceOwner=null,t.contractId=null,t.methodName=null),null!=e.amount&&e.hasOwnProperty("amount")&&(t.amount=$root.Uint128.toObject(e.amount,n)),null!=e.balanceOwner&&e.hasOwnProperty("balanceOwner")&&(t.balanceOwner=$root.google.protobuf.StringValue.toObject(e.balanceOwner,n)),null!=e.contractId&&e.hasOwnProperty("contractId")&&(t.contractId=$root.google.protobuf.StringValue.toObject(e.contractId,n)),null!=e.methodName&&e.hasOwnProperty("methodName")&&(t.methodName=$root.google.protobuf.BytesValue.toObject(e.methodName,n)),t},e.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},e}(),$root.Uint128=function(){function e(e){if(e)for(var n=Object.keys(e),t=0;t>>3){case 1:o.number=e.bytes();break;default:e.skipType(7&r)}}return o},e.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.number&&e.hasOwnProperty("number")&&!(e.number&&"number"==typeof e.number.length||$util.isString(e.number))?"number: buffer expected":null},e.fromObject=function(e){if(e instanceof $root.Uint128)return e;var n=new $root.Uint128;return null!=e.number&&("string"==typeof e.number?$util.base64.decode(e.number,n.number=$util.newBuffer($util.base64.length(e.number)),0):e.number.length&&(n.number=e.number)),n},e.toObject=function(e,n){n||(n={});var t={};return n.defaults&&(n.bytes===String?t.number="":(t.number=[],n.bytes!==Array&&(t.number=$util.newBuffer(t.number)))),null!=e.number&&e.hasOwnProperty("number")&&(t.number=n.bytes===String?$util.base64.encode(e.number,0,e.number.length):n.bytes===Array?Array.prototype.slice.call(e.number):e.number),t},e.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},e}(),module.exports=$root; - -},{"protobufjs/minimal":64}],15:[function(require,module,exports){ +},{"./account":2,"./account_creator":3,"./connection":4,"./contract":5,"./key_stores":9,"./key_stores/unencrypted_file_system_keystore":12,"./utils/key_pair":20,"bn.js":27}],14:[function(require,module,exports){ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const provider_1=require("./provider");exports.Provider=provider_1.Provider,exports.getTransactionLastResult=provider_1.getTransactionLastResult;const json_rpc_provider_1=require("./json-rpc-provider");exports.JsonRpcProvider=json_rpc_provider_1.JsonRpcProvider; -},{"./json-rpc-provider":16,"./provider":17}],16:[function(require,module,exports){ +},{"./json-rpc-provider":15,"./provider":16}],15:[function(require,module,exports){ (function (Buffer){ -"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const provider_1=require("./provider"),web_1=require("../utils/web"),serialize_1=require("../utils/serialize"),protos_1=require("../protos");let _nextId=123;class JsonRpcProvider extends provider_1.Provider{constructor(r,e){super(),this.connection={url:r}}async getNetwork(){return{name:"test",chainId:"test"}}async status(){return this.sendJsonRpc("status",[])}async sendTransaction(r){const e=protos_1.SignedTransaction.encode(r).finish();return this.sendJsonRpc("broadcast_tx_commit",[Buffer.from(e).toString("base64")])}async txStatus(r){return this.sendJsonRpc("tx",[serialize_1.base_encode(r)])}async query(r,e){const s=await this.sendJsonRpc("query",[r,e]);if(s.error)throw new Error(`Quering ${r} failed: ${s.error}.\n${JSON.stringify(s,null,2)}`);return s}async block(r){return this.sendJsonRpc("block",[r])}async sendJsonRpc(r,e){const s={method:r,params:e,id:_nextId++,jsonrpc:"2.0"},t=await web_1.fetchJson(this.connection,JSON.stringify(s));if(t.error)throw new Error(`[${t.error.code}] ${t.error.message}: ${t.error.data}`);return t.result}}exports.JsonRpcProvider=JsonRpcProvider; +"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const provider_1=require("./provider"),web_1=require("../utils/web"),serialize_1=require("../utils/serialize");let _nextId=123;class JsonRpcProvider extends provider_1.Provider{constructor(r,e){super(),this.connection={url:r}}async getNetwork(){return{name:"test",chainId:"test"}}async status(){return this.sendJsonRpc("status",[])}async sendTransaction(r){const e=r.encode();return this.sendJsonRpc("broadcast_tx_commit",[Buffer.from(e).toString("base64")])}async txStatus(r){return this.sendJsonRpc("tx",[serialize_1.base_encode(r)])}async query(r,e){const s=await this.sendJsonRpc("query",[r,e]);if(s.error)throw new Error(`Quering ${r} failed: ${s.error}.\n${JSON.stringify(s,null,2)}`);return s}async block(r){return this.sendJsonRpc("block",[r])}async sendJsonRpc(r,e){const s={method:r,params:e,id:_nextId++,jsonrpc:"2.0"},t=await web_1.fetchJson(this.connection,JSON.stringify(s));if(t.error)throw new Error(`[${t.error.code}] ${t.error.message}: ${t.error.data}`);return t.result}}exports.JsonRpcProvider=JsonRpcProvider; }).call(this,require("buffer").Buffer) -},{"../protos":14,"../utils/serialize":23,"../utils/web":24,"./provider":17,"buffer":39}],17:[function(require,module,exports){ +},{"../utils/serialize":22,"../utils/web":23,"./provider":16,"buffer":31}],16:[function(require,module,exports){ (function (Buffer){ -"use strict";var FinalTransactionStatus;Object.defineProperty(exports,"__esModule",{value:!0}),function(t){t.Unknown="Unknown",t.Started="Started",t.Failed="Failed",t.Completed="Completed"}(FinalTransactionStatus=exports.FinalTransactionStatus||(exports.FinalTransactionStatus={}));class Provider{}function getTransactionLastResult(t){for(let e=t.logs.length-1;e>=0;--e){const n=t.logs[e];if(n.result&&n.result.length>0)return JSON.parse(Buffer.from(n.result).toString())}return null}exports.Provider=Provider,exports.getTransactionLastResult=getTransactionLastResult; +"use strict";var FinalTransactionStatus;Object.defineProperty(exports,"__esModule",{value:!0}),function(t){t.Unknown="Unknown",t.Started="Started",t.Failed="Failed",t.Completed="Completed"}(FinalTransactionStatus=exports.FinalTransactionStatus||(exports.FinalTransactionStatus={}));class Provider{}function getTransactionLastResult(t){for(let e=t.transactions.length-1;e>=0;--e){const r=t.transactions[e];if(r.result&&r.result.result&&r.result.result.length>0)return JSON.parse(Buffer.from(r.result.result,"base64").toString())}return null}exports.Provider=Provider,exports.getTransactionLastResult=getTransactionLastResult; }).call(this,require("buffer").Buffer) -},{"buffer":39}],18:[function(require,module,exports){ +},{"buffer":31}],17:[function(require,module,exports){ "use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0});const js_sha256_1=__importDefault(require("js-sha256")),key_pair_1=require("./utils/key_pair");class Signer{async signMessage(e,r,t){return this.signHash(new Uint8Array(js_sha256_1.default.sha256.array(e)),r,t)}}exports.Signer=Signer;class InMemorySigner extends Signer{constructor(e){super(),this.keyStore=e}async createKey(e,r){const t=key_pair_1.KeyPair.fromRandom("ed25519");return await this.keyStore.setKey(r,e,t),t.getPublicKey()}async getPublicKey(e,r){return(await this.keyStore.getKey(r,e)).getPublicKey()}async signHash(e,r,t){if(!r)throw new Error("InMemorySigner requires provided account id");const s=await this.keyStore.getKey(t,r);if(null===s)throw new Error(`Key for ${r} not found in ${t}`);return s.sign(e)}}exports.InMemorySigner=InMemorySigner; -},{"./utils/key_pair":21,"js-sha256":58}],19:[function(require,module,exports){ -(function (Buffer){ -"use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0});const js_sha256_1=__importDefault(require("js-sha256")),bn_js_1=__importDefault(require("bn.js")),protos_1=require("./protos"),serialize_1=require("./utils/serialize"),TRANSACTION_FIELD_MAP=new Map([[protos_1.CreateAccountTransaction,"createAccount"],[protos_1.DeployContractTransaction,"deployContract"],[protos_1.FunctionCallTransaction,"functionCall"],[protos_1.SendMoneyTransaction,"sendMoney"],[protos_1.StakeTransaction,"stake"],[protos_1.SwapKeyTransaction,"swapKey"],[protos_1.AddKeyTransaction,"addKey"],[protos_1.DeleteKeyTransaction,"deleteKey"]]);function bigInt(e){const n=new Uint8Array(new bn_js_1.default(e).toArray("le",16));return new protos_1.Uint128({number:n})}function bignumHex2Dec(e){return new bn_js_1.default(e,16).toString(10)}function createAccount(e,n,t,o,r){return new protos_1.CreateAccountTransaction({nonce:e,originator:n,newAccountId:t,publicKey:serialize_1.base_decode(o),amount:bigInt(r)})}function deployContract(e,n,t){return new protos_1.DeployContractTransaction({nonce:e,contractId:n,wasmByteArray:t})}function functionCall(e,n,t,o,r,a){return new protos_1.FunctionCallTransaction({nonce:e,originator:n,contractId:t,methodName:Buffer.from(o),args:r,amount:bigInt(a)})}function sendMoney(e,n,t,o){return new protos_1.SendMoneyTransaction({nonce:e,originator:n,receiver:t,amount:bigInt(o)})}function stake(e,n,t,o){return new protos_1.StakeTransaction({nonce:e,originator:n,amount:bigInt(t),publicKey:o,blsPublicKey:null})}function swapKey(e,n,t,o){return new protos_1.SwapKeyTransaction({nonce:e,originator:n,curKey:serialize_1.base_decode(t),newKey:serialize_1.base_decode(o)})}function createAccessKey(e,n,t,o){return new protos_1.AccessKey({contractId:e?new protos_1.google.protobuf.StringValue({value:e}):null,methodName:n?new protos_1.google.protobuf.BytesValue({value:Buffer.from(n)}):null,balanceOwner:t?new protos_1.google.protobuf.StringValue({value:t}):null,amount:bigInt(o||new bn_js_1.default(0))})}function addKey(e,n,t,o){return new protos_1.AddKeyTransaction({nonce:e,originator:n,newKey:serialize_1.base_decode(t),accessKey:o})}function deleteKey(e,n,t){return new protos_1.DeleteKeyTransaction({nonce:e,originator:n,curKey:serialize_1.base_decode(t)})}function signedTransaction(e,n){const t=TRANSACTION_FIELD_MAP.get(e.constructor);return new protos_1.SignedTransaction({signature:n.signature,publicKey:protos_1.google.protobuf.BytesValue.create({value:serialize_1.base_decode(n.publicKey)}),[t]:e})}async function signTransaction(e,n,t,o){const r=n.constructor.encode(n).finish(),a=new Uint8Array(js_sha256_1.default.sha256.array(r));return[a,signedTransaction(n,await e.signHash(a,t,o))]}exports.bignumHex2Dec=bignumHex2Dec,exports.createAccount=createAccount,exports.deployContract=deployContract,exports.functionCall=functionCall,exports.sendMoney=sendMoney,exports.stake=stake,exports.swapKey=swapKey,exports.createAccessKey=createAccessKey,exports.addKey=addKey,exports.deleteKey=deleteKey,exports.signedTransaction=signedTransaction,exports.signTransaction=signTransaction; +},{"./utils/key_pair":20,"js-sha256":50}],18:[function(require,module,exports){ +"use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0});const js_sha256_1=__importDefault(require("js-sha256")),serialize_1=require("./utils/serialize"),key_pair_1=require("./utils/key_pair");class Enum{constructor(e){if(1!==Object.keys(e).length)throw new Error("Enum can only take single value");Object.keys(e).map(s=>{this[s]=e[s],this.enum=s})}}class Assignable{constructor(e){Object.keys(e).map(s=>{this[s]=e[s]})}}class FunctionCallPermission extends Assignable{}exports.FunctionCallPermission=FunctionCallPermission;class FullAccessPermission extends Assignable{}exports.FullAccessPermission=FullAccessPermission;class AccessKeyPermission extends Enum{}exports.AccessKeyPermission=AccessKeyPermission;class AccessKey extends Assignable{}function fullAccessKey(){return new AccessKey({nonce:0,permission:new AccessKeyPermission({fullAccess:new FullAccessPermission({})})})}function functionCallAccessKey(e,s,n){return new AccessKey({nonce:0,permission:new AccessKeyPermission({functionCall:new FunctionCallPermission({receiverId:e,allowance:n,methodNames:s})})})}exports.AccessKey=AccessKey,exports.fullAccessKey=fullAccessKey,exports.functionCallAccessKey=functionCallAccessKey;class IAction extends Assignable{}exports.IAction=IAction;class CreateAccount extends IAction{}class DeployContract extends IAction{}class FunctionCall extends IAction{}class Transfer extends IAction{}class Stake extends IAction{}class AddKey extends IAction{}class DeleteKey extends IAction{}class DeleteAccount extends IAction{}function createAccount(){return new Action({createAccount:new CreateAccount({})})}function deployContract(e){return new Action({deployContract:new DeployContract({code:e})})}function functionCall(e,s,n,t){return new Action({functionCall:new FunctionCall({methodName:e,args:s,gas:n,deposit:t})})}function transfer(e){return new Action({transfer:new Transfer({deposit:e})})}function stake(e,s){return new Action({stake:new Stake({stake:e,publicKey:s})})}function addKey(e,s){return new Action({addKey:new AddKey({publicKey:e,accessKey:s})})}function deleteKey(e){return new Action({deleteKey:new DeleteKey({publicKey:e})})}function deleteAccount(e){return new Action({deleteAccount:new DeleteAccount({beneficiaryId:e})})}exports.createAccount=createAccount,exports.deployContract=deployContract,exports.functionCall=functionCall,exports.transfer=transfer,exports.stake=stake,exports.addKey=addKey,exports.deleteKey=deleteKey,exports.deleteAccount=deleteAccount;class Signature{constructor(e){this.keyType=key_pair_1.KeyType.ED25519,this.data=e}}class Transaction extends Assignable{}class SignedTransaction extends Assignable{encode(){return serialize_1.serialize(SCHEMA,this)}}exports.SignedTransaction=SignedTransaction;class Action extends Enum{}exports.Action=Action;const SCHEMA=new Map([[Signature,{kind:"struct",fields:[["keyType","u8"],["data",[32]]]}],[SignedTransaction,{kind:"struct",fields:[["transaction",Transaction],["signature",Signature]]}],[Transaction,{kind:"struct",fields:[["signerId","string"],["publicKey",key_pair_1.PublicKey],["nonce","u64"],["receiverId","string"],["blockHash",[32]],["actions",[Action]]]}],[key_pair_1.PublicKey,{kind:"struct",fields:[["keyType","u8"],["data",[32]]]}],[AccessKey,{kind:"struct",fields:[["nonce","u64"],["permission",AccessKeyPermission]]}],[AccessKeyPermission,{kind:"enum",field:"enum",values:[["functionCall",FunctionCallPermission],["fullAccess",FullAccessPermission]]}],[FunctionCallPermission,{kind:"struct",fields:[["allowance",{kind:"option",type:"u128"}],["receiverId","string"],["methodNames",["string"]]]}],[FullAccessPermission,{kind:"struct",fields:[]}],[Action,{kind:"enum",field:"enum",values:[["createAccount",CreateAccount],["deployContract",DeployContract],["functionCall",functionCall],["transfer",transfer],["stake",stake],["addKey",addKey],["deleteKey",deleteKey],["deleteAccount",deleteAccount]]}],[CreateAccount,{kind:"struct",fields:[]}],[DeployContract,{kind:"struct",fields:[["code",["u8"]]]}],[FunctionCall,{kind:"struct",fields:[["methodName","string"],["args",["u8"]],["gas","u64"],["deposit","u128"]]}],[Transfer,{kind:"struct",fields:[["deposit","u128"]]}],[Stake,{kind:"struct",fields:[["stake","u128"],["publicKey",key_pair_1.PublicKey]]}],[AddKey,{kind:"struct",fields:[["publicKey",key_pair_1.PublicKey],["accessKey",AccessKey]]}],[DeleteKey,{kind:"struct",fields:[["publicKey",key_pair_1.PublicKey]]}],[DeleteAccount,{kind:"struct",fields:[["beneficiaryId","string"]]}]]);async function signTransaction(e,s,n,t,c,i,r){const a=await c.getPublicKey(i,r),o=new Transaction({signerId:i,publicKey:a,nonce:s,receiverId:e,actions:n,blockHash:t}),l=serialize_1.serialize(SCHEMA,o),u=new Uint8Array(js_sha256_1.default.sha256.array(l)),d=await c.signHash(u,i,r);return[u,new SignedTransaction({transaction:o,signature:new Signature(d.signature)})]}exports.signTransaction=signTransaction; -}).call(this,require("buffer").Buffer) -},{"./protos":14,"./utils/serialize":23,"bn.js":35,"buffer":39,"js-sha256":58}],20:[function(require,module,exports){ +},{"./utils/key_pair":20,"./utils/serialize":22,"js-sha256":50}],19:[function(require,module,exports){ "use strict";var __importStar=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(null!=r)for(var t in r)Object.hasOwnProperty.call(r,t)&&(e[t]=r[t]);return e.default=r,e};Object.defineProperty(exports,"__esModule",{value:!0});const key_pair=__importStar(require("./key_pair"));exports.key_pair=key_pair;const network=__importStar(require("./network"));exports.network=network;const serialize=__importStar(require("./serialize"));exports.serialize=serialize;const web=__importStar(require("./web"));exports.web=web;const key_pair_1=require("./key_pair");exports.KeyPair=key_pair_1.KeyPair,exports.KeyPairEd25519=key_pair_1.KeyPairEd25519; -},{"./key_pair":21,"./network":22,"./serialize":23,"./web":24}],21:[function(require,module,exports){ -"use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0});const tweetnacl_1=__importDefault(require("tweetnacl")),serialize_1=require("./serialize");class KeyPair{static fromRandom(e){switch(e){case"ed25519":return KeyPairEd25519.fromRandom();default:throw new Error(`Unknown curve ${e}`)}}static fromString(e){const t=e.split(":");if(2!==t.length)throw new Error("Invalid encoded key format, must be :");switch(t[0]){case"ed25519":return new KeyPairEd25519(t[1]);default:throw new Error(`Unknown curve: ${t[0]}`)}}}exports.KeyPair=KeyPair;class KeyPairEd25519 extends KeyPair{constructor(e){super();const t=tweetnacl_1.default.sign.keyPair.fromSecretKey(serialize_1.base_decode(e));this.publicKey=serialize_1.base_encode(t.publicKey),this.secretKey=e}static fromRandom(){const e=tweetnacl_1.default.sign.keyPair();return new KeyPairEd25519(serialize_1.base_encode(e.secretKey))}sign(e){return{signature:tweetnacl_1.default.sign.detached(e,serialize_1.base_decode(this.secretKey)),publicKey:this.publicKey}}verify(e,t){return tweetnacl_1.default.sign.detached.verify(e,t,serialize_1.base_decode(this.publicKey))}toString(){return`ed25519:${this.secretKey}`}getPublicKey(){return this.publicKey}}exports.KeyPairEd25519=KeyPairEd25519; +},{"./key_pair":20,"./network":21,"./serialize":22,"./web":23}],20:[function(require,module,exports){ +"use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0});const tweetnacl_1=__importDefault(require("tweetnacl")),serialize_1=require("./serialize");var KeyType;function key_type_to_str(e){switch(e){case KeyType.ED25519:return"ed25519";default:throw new Error(`Unknown key type ${e}`)}}function str_to_key_type(e){switch(e.toLowerCase()){case"ed25519":return KeyType.ED25519;default:throw new Error(`Unknown key type ${e}`)}}!function(e){e[e.ED25519=0]="ED25519"}(KeyType=exports.KeyType||(exports.KeyType={}));class PublicKey{constructor(e,t){this.keyType=e,this.data=t}static from(e){return"string"==typeof e?PublicKey.fromString(e):e}static fromString(e){const t=e.split(":");if(1===t.length)return new PublicKey(KeyType.ED25519,serialize_1.base_decode(t[0]));if(2===t.length)return new PublicKey(str_to_key_type(t[0]),serialize_1.base_decode(t[1]));throw new Error("Invlaid encoded key format, must be :")}toString(){return`${key_type_to_str(this.keyType)}:${serialize_1.base_encode(this.data)}`}}exports.PublicKey=PublicKey;class KeyPair{static fromRandom(e){switch(e.toUpperCase()){case"ED25519":return KeyPairEd25519.fromRandom();default:throw new Error(`Unknown curve ${e}`)}}static fromString(e){const t=e.split(":");if(1===t.length)return new KeyPairEd25519(t[0]);if(2!==t.length)throw new Error("Invalid encoded key format, must be :");switch(t[0].toUpperCase()){case"ED25519":return new KeyPairEd25519(t[1]);default:throw new Error(`Unknown curve: ${t[0]}`)}}}exports.KeyPair=KeyPair;class KeyPairEd25519 extends KeyPair{constructor(e){super();const t=tweetnacl_1.default.sign.keyPair.fromSecretKey(serialize_1.base_decode(e));this.publicKey=new PublicKey(KeyType.ED25519,t.publicKey),this.secretKey=e}static fromRandom(){const e=tweetnacl_1.default.sign.keyPair();return new KeyPairEd25519(serialize_1.base_encode(e.secretKey))}sign(e){return{signature:tweetnacl_1.default.sign.detached(e,serialize_1.base_decode(this.secretKey)),publicKey:this.publicKey}}verify(e,t){return tweetnacl_1.default.sign.detached.verify(e,t,this.publicKey.data)}toString(){return`ed25519:${this.secretKey}`}getPublicKey(){return this.publicKey}}exports.KeyPairEd25519=KeyPairEd25519; -},{"./serialize":23,"tweetnacl":80}],22:[function(require,module,exports){ +},{"./serialize":22,"tweetnacl":61}],21:[function(require,module,exports){ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}); -},{}],23:[function(require,module,exports){ +},{}],22:[function(require,module,exports){ (function (Buffer){ -"use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0});const bs58_1=__importDefault(require("bs58"));function base_encode(e){return"string"==typeof e&&(e=Buffer.from(e,"utf8")),bs58_1.default.encode(Buffer.from(e))}function base_decode(e){return bs58_1.default.decode(e)}exports.base_encode=base_encode,exports.base_decode=base_decode; +"use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0});const bs58_1=__importDefault(require("bs58")),bn_js_1=__importDefault(require("bn.js"));function base_encode(e){return"string"==typeof e&&(e=Buffer.from(e,"utf8")),bs58_1.default.encode(Buffer.from(e))}function base_decode(e){return bs58_1.default.decode(e)}exports.base_encode=base_encode,exports.base_decode=base_decode;const INITIAL_LENGTH=1024;class BinaryWriter{constructor(){this.buf=Buffer.alloc(INITIAL_LENGTH),this.length=0}maybe_resize(){this.buf.length<16+this.length&&(this.buf=Buffer.concat([this.buf,Buffer.alloc(INITIAL_LENGTH)]))}write_u8(e){this.maybe_resize(),this.buf.writeUInt8(e,this.length),this.length+=1}write_u32(e){this.maybe_resize(),this.buf.writeUInt32LE(e,this.length),this.length+=4}write_u64(e){this.maybe_resize(),this.write_buffer(Buffer.from(new bn_js_1.default(e).toArray("le",8)))}write_u128(e){this.maybe_resize(),this.write_buffer(Buffer.from(new bn_js_1.default(e).toArray("le",16)))}write_buffer(e){this.buf=Buffer.concat([Buffer.from(this.buf.subarray(0,this.length)),e,Buffer.alloc(INITIAL_LENGTH)]),this.length+=e.length}write_string(e){this.maybe_resize();const r=Buffer.from(e,"utf8");this.write_u32(r.length),this.write_buffer(r)}write_fixed_array(e){this.write_buffer(Buffer.from(e))}write_array(e,r){this.maybe_resize(),this.write_u32(e.length);for(const t of e)this.maybe_resize(),r(t)}toArray(){return this.buf.subarray(0,this.length)}}exports.BinaryWriter=BinaryWriter;class BinaryReader{constructor(e){this.buf=e,this.offset=0}read_u8(){const e=this.buf.readUInt8(this.offset);return this.offset+=1,e}read_u32(){const e=this.buf.readUInt32LE(this.offset);return this.offset+=4,e}read_u64(){const e=this.read_buffer(8);return e.reverse(),new bn_js_1.default(`${e.toString("hex")}`,16)}read_u128(){const e=this.read_buffer(16);return new bn_js_1.default(e)}read_buffer(e){const r=this.buf.slice(this.offset,this.offset+e);return this.offset+=e,r}read_string(){const e=this.read_u32();return this.read_buffer(e).toString("utf8")}read_fixed_array(e){return new Uint8Array(this.read_buffer(e))}read_array(e){const r=this.read_u32(),t=Array();for(let i=0;i{serializeField(e,r,t[0],i)});else if(void 0!==t.kind)switch(t.kind){case"option":null===r?i.write_u8(0):(i.write_u8(1),serializeField(e,r,t.type,i));break;default:throw new Error(`FieldType ${t} unrecognized`)}else serializeStruct(e,r,i)}function serializeStruct(e,r,t){const i=e.get(r.constructor);if(!i)throw new Error(`Class ${r.constructor.name} is missing in schema`);if("struct"===i.kind)i.fields.map(([i,s])=>{serializeField(e,r[i],s,t)});else{if("enum"!==i.kind)throw new Error(`Unexpected schema kind: ${i.kind} for ${r.constructor.name}`);{const s=r[i.field];for(let n=0;ndeserializeField(e,r[0],t)):deserializeStruct(e,r,t)}function deserializeStruct(e,r,t){return new r(...e.get(r).fields.map(([r,i])=>deserializeField(e,i,t)))}function deserialize(e,r,t){return deserializeStruct(e,r,new BinaryReader(t))}exports.BinaryReader=BinaryReader,exports.serialize=serialize,exports.deserialize=deserialize; }).call(this,require("buffer").Buffer) -},{"bs58":38,"buffer":39}],24:[function(require,module,exports){ +},{"bn.js":27,"bs58":30,"buffer":31}],23:[function(require,module,exports){ "use strict";var __importDefault=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(exports,"__esModule",{value:!0});const http_errors_1=__importDefault(require("http-errors")),fetch="undefined"==typeof window||"nodejs"===window.name?require("node-fetch"):window.fetch;async function fetchJson(t,e){let o=null;o="string"==typeof t?t:t.url;const r=await fetch(o,{method:e?"POST":"GET",body:e||void 0,headers:{"Content-type":"application/json; charset=utf-8"}});if(!r.ok)throw http_errors_1.default(r.status,await r.text());return await r.json()}exports.fetchJson=fetchJson; -},{"http-errors":55,"node-fetch":37}],25:[function(require,module,exports){ -"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const utils_1=require("./utils"),LOGIN_WALLET_URL_SUFFIX="/login/",LOCAL_STORAGE_KEY_SUFFIX="_wallet_auth_key",PENDING_ACCESS_KEY_PREFIX="pending_key";class WalletAccount{constructor(t,e){this._networkId=t.config.networkId,this._walletBaseUrl=t.config.walletUrl,e=e||t.config.contractName||"default",this._authDataKey=e+LOCAL_STORAGE_KEY_SUFFIX,this._keyStore=t.connection.signer.keyStore,this._authData=JSON.parse(window.localStorage.getItem(this._authDataKey)||"{}"),this.isSignedIn()||this._completeSignInWithAccessKey()}isSignedIn(){return!!this._authData.accountId}getAccountId(){return this._authData.accountId||""}async requestSignIn(t,e,a,s){if(this.getAccountId()||await this._keyStore.getKey(this._networkId,this.getAccountId()))return Promise.resolve();const i=new URL(window.location.href),o=new URL(this._walletBaseUrl+LOGIN_WALLET_URL_SUFFIX);o.searchParams.set("title",e),o.searchParams.set("contract_id",t),o.searchParams.set("success_url",a||i.href),o.searchParams.set("failure_url",s||i.href),o.searchParams.set("app_url",i.origin);const r=utils_1.KeyPair.fromRandom("ed25519");o.searchParams.set("public_key",r.getPublicKey()),await this._keyStore.setKey(this._networkId,PENDING_ACCESS_KEY_PREFIX+r.getPublicKey(),r),window.location.assign(o.toString())}async _completeSignInWithAccessKey(){const t=new URL(window.location.href),e=t.searchParams.get("public_key")||"",a=t.searchParams.get("account_id")||"";a&&e&&(this._authData={accountId:a},window.localStorage.setItem(this._authDataKey,JSON.stringify(this._authData)),await this._moveKeyFromTempToPermanent(a,e))}async _moveKeyFromTempToPermanent(t,e){const a=await this._keyStore.getKey(this._networkId,PENDING_ACCESS_KEY_PREFIX+e);await this._keyStore.setKey(this._networkId,t,a),await this._keyStore.removeKey(this._networkId,PENDING_ACCESS_KEY_PREFIX+e)}signOut(){this._authData={},window.localStorage.removeItem(this._authDataKey)}}exports.WalletAccount=WalletAccount; - -},{"./utils":20}],26:[function(require,module,exports){ -"use strict";function asPromise(e,n){for(var r=new Array(arguments.length-1),t=0,l=2,o=!0;l1&&"="===r.charAt(a);)++e;return Math.ceil(3*r.length)/4-e};for(var b64=new Array(64),s64=new Array(123),i=0;i<64;)s64[b64[i]=i<26?i+65:i<52?i+71:i<62?i-4:i-59|43]=i++;base64.encode=function(r,a,e){for(var i,n=null,t=[],o=0,s=0;a>2],i=(3&c)<<4,s=1;break;case 1:t[o++]=b64[i|c>>4],i=(15&c)<<2,s=2;break;case 2:t[o++]=b64[i|c>>6],t[o++]=b64[63&c],s=0}o>8191&&((n||(n=[])).push(String.fromCharCode.apply(String,t)),o=0)}return s&&(t[o++]=b64[i],t[o++]=61,1===s&&(t[o++]=61)),n?(o&&n.push(String.fromCharCode.apply(String,t.slice(0,o))),n.join("")):String.fromCharCode.apply(String,t.slice(0,o))};var invalidEncoding="invalid encoding";base64.decode=function(r,a,e){for(var i,n=e,t=0,o=0;o1)break;if(void 0===(s=s64[s]))throw Error(invalidEncoding);switch(t){case 0:i=s,t=1;break;case 1:a[e++]=i<<2|(48&s)>>4,i=s,t=2;break;case 2:a[e++]=(15&i)<<4|(60&s)>>2,i=s,t=3;break;case 3:a[e++]=(3&i)<<6|s,t=0}}if(1===t)throw Error(invalidEncoding);return e-n},base64.test=function(r){return/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(r)}; - -},{}],28:[function(require,module,exports){ -"use strict";function EventEmitter(){this._listeners={}}module.exports=EventEmitter,EventEmitter.prototype.on=function(t,e,i){return(this._listeners[t]||(this._listeners[t]=[])).push({fn:e,ctx:i||this}),this},EventEmitter.prototype.off=function(t,e){if(void 0===t)this._listeners={};else if(void 0===e)this._listeners[t]=[];else for(var i=this._listeners[t],s=0;s0?0:2147483648,e,r);else if(isNaN(t))n(2143289344,e,r);else if(t>3.4028234663852886e38)n((i<<31|2139095040)>>>0,e,r);else if(t<1.1754943508222875e-38)n((i<<31|Math.round(t/1.401298464324817e-45))>>>0,e,r);else{var a=Math.floor(Math.log(t)/Math.LN2);n((i<<31|a+127<<23|8388607&Math.round(t*Math.pow(2,-a)*8388608))>>>0,e,r)}}function e(n,t,e){var r=n(t,e),i=2*(r>>31)+1,a=r>>>23&255,o=8388607&r;return 255===a?o?NaN:i*(1/0):0===a?1.401298464324817e-45*i*o:i*Math.pow(2,a-150)*(o+8388608)}n.writeFloatLE=t.bind(null,writeUintLE),n.writeFloatBE=t.bind(null,writeUintBE),n.readFloatLE=e.bind(null,readUintLE),n.readFloatBE=e.bind(null,readUintBE)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),e=new Uint8Array(t.buffer),r=128===e[7];function i(n,r,i){t[0]=n,r[i]=e[0],r[i+1]=e[1],r[i+2]=e[2],r[i+3]=e[3],r[i+4]=e[4],r[i+5]=e[5],r[i+6]=e[6],r[i+7]=e[7]}function a(n,r,i){t[0]=n,r[i]=e[7],r[i+1]=e[6],r[i+2]=e[5],r[i+3]=e[4],r[i+4]=e[3],r[i+5]=e[2],r[i+6]=e[1],r[i+7]=e[0]}function o(n,r){return e[0]=n[r],e[1]=n[r+1],e[2]=n[r+2],e[3]=n[r+3],e[4]=n[r+4],e[5]=n[r+5],e[6]=n[r+6],e[7]=n[r+7],t[0]}function u(n,r){return e[7]=n[r],e[6]=n[r+1],e[5]=n[r+2],e[4]=n[r+3],e[3]=n[r+4],e[2]=n[r+5],e[1]=n[r+6],e[0]=n[r+7],t[0]}n.writeDoubleLE=r?i:a,n.writeDoubleBE=r?a:i,n.readDoubleLE=r?o:u,n.readDoubleBE=r?u:o}():function(){function t(n,t,e,r,i,a){var o=r<0?1:0;if(o&&(r=-r),0===r)n(0,i,a+t),n(1/r>0?0:2147483648,i,a+e);else if(isNaN(r))n(0,i,a+t),n(2146959360,i,a+e);else if(r>1.7976931348623157e308)n(0,i,a+t),n((o<<31|2146435072)>>>0,i,a+e);else{var u;if(r<2.2250738585072014e-308)n((u=r/5e-324)>>>0,i,a+t),n((o<<31|u/4294967296)>>>0,i,a+e);else{var l=Math.floor(Math.log(r)/Math.LN2);1024===l&&(l=1023),n(4503599627370496*(u=r*Math.pow(2,-l))>>>0,i,a+t),n((o<<31|l+1023<<20|1048576*u&1048575)>>>0,i,a+e)}}}function e(n,t,e,r,i){var a=n(r,i+t),o=n(r,i+e),u=2*(o>>31)+1,l=o>>>20&2047,f=4294967296*(1048575&o)+a;return 2047===l?f?NaN:u*(1/0):0===l?5e-324*u*f:u*Math.pow(2,l-1075)*(f+4503599627370496)}n.writeDoubleLE=t.bind(null,writeUintLE,0,4),n.writeDoubleBE=t.bind(null,writeUintBE,4,0),n.readDoubleLE=e.bind(null,readUintLE,0,4),n.readDoubleBE=e.bind(null,readUintBE,4,0)}(),n}function writeUintLE(n,t,e){t[e]=255&n,t[e+1]=n>>>8&255,t[e+2]=n>>>16&255,t[e+3]=n>>>24}function writeUintBE(n,t,e){t[e]=n>>>24,t[e+1]=n>>>16&255,t[e+2]=n>>>8&255,t[e+3]=255&n}function readUintLE(n,t){return(n[t]|n[t+1]<<8|n[t+2]<<16|n[t+3]<<24)>>>0}function readUintBE(n,t){return(n[t]<<24|n[t+1]<<16|n[t+2]<<8|n[t+3])>>>0}module.exports=factory(factory); - -},{}],30:[function(require,module,exports){ -"use strict";function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}module.exports=inquire; - -},{}],31:[function(require,module,exports){ -"use strict";function pool(r,n,o){var t=o||8192,u=t>>>1,l=null,e=t;return function(o){if(o<1||o>u)return r(o);e+o>t&&(l=r(t),e=0);var c=n.call(l,e,e+=o);return 7&e&&(e=1+(7|e)),c}}module.exports=pool; - -},{}],32:[function(require,module,exports){ -"use strict";var utf8=exports;utf8.length=function(r){for(var t=0,n=0,e=0;e191&&e<224?a[i++]=(31&e)<<6|63&r[t++]:e>239&&e<365?(e=((7&e)<<18|(63&r[t++])<<12|(63&r[t++])<<6|63&r[t++])-65536,a[i++]=55296+(e>>10),a[i++]=56320+(1023&e)):a[i++]=(15&e)<<12|(63&r[t++])<<6|63&r[t++],i>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,a)),i=0);return o?(i&&o.push(String.fromCharCode.apply(String,a.slice(0,i))),o.join("")):String.fromCharCode.apply(String,a.slice(0,i))},utf8.write=function(r,t,n){for(var e,o,a=n,i=0;i>6|192,t[n++]=63&e|128):55296==(64512&e)&&56320==(64512&(o=r.charCodeAt(i+1)))?(e=65536+((1023&e)<<10)+(1023&o),++i,t[n++]=e>>18|240,t[n++]=e>>12&63|128,t[n++]=e>>6&63|128,t[n++]=63&e|128):(t[n++]=e>>12|224,t[n++]=e>>6&63|128,t[n++]=63&e|128);return n-a}; +},{"http-errors":47,"node-fetch":29}],24:[function(require,module,exports){ +"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const utils_1=require("./utils"),LOGIN_WALLET_URL_SUFFIX="/login/",LOCAL_STORAGE_KEY_SUFFIX="_wallet_auth_key",PENDING_ACCESS_KEY_PREFIX="pending_key";class WalletAccount{constructor(t,e){this._networkId=t.config.networkId,this._walletBaseUrl=t.config.walletUrl,e=e||t.config.contractName||"default",this._authDataKey=e+LOCAL_STORAGE_KEY_SUFFIX,this._keyStore=t.connection.signer.keyStore,this._authData=JSON.parse(window.localStorage.getItem(this._authDataKey)||"{}"),this.isSignedIn()||this._completeSignInWithAccessKey()}isSignedIn(){return!!this._authData.accountId}getAccountId(){return this._authData.accountId||""}async requestSignIn(t,e,a,s){if(this.getAccountId()||await this._keyStore.getKey(this._networkId,this.getAccountId()))return Promise.resolve();const i=new URL(window.location.href),o=new URL(this._walletBaseUrl+LOGIN_WALLET_URL_SUFFIX);o.searchParams.set("title",e),o.searchParams.set("contract_id",t),o.searchParams.set("success_url",a||i.href),o.searchParams.set("failure_url",s||i.href),o.searchParams.set("app_url",i.origin);const r=utils_1.KeyPair.fromRandom("ed25519");o.searchParams.set("public_key",r.getPublicKey().toString()),await this._keyStore.setKey(this._networkId,PENDING_ACCESS_KEY_PREFIX+r.getPublicKey(),r),window.location.assign(o.toString())}async _completeSignInWithAccessKey(){const t=new URL(window.location.href),e=t.searchParams.get("public_key")||"",a=t.searchParams.get("account_id")||"";a&&e&&(this._authData={accountId:a},window.localStorage.setItem(this._authDataKey,JSON.stringify(this._authData)),await this._moveKeyFromTempToPermanent(a,e))}async _moveKeyFromTempToPermanent(t,e){const a=await this._keyStore.getKey(this._networkId,PENDING_ACCESS_KEY_PREFIX+e);await this._keyStore.setKey(this._networkId,t,a),await this._keyStore.removeKey(this._networkId,PENDING_ACCESS_KEY_PREFIX+e)}signOut(){this._authData={},window.localStorage.removeItem(this._authDataKey)}}exports.WalletAccount=WalletAccount; -},{}],33:[function(require,module,exports){ +},{"./utils":19}],25:[function(require,module,exports){ const Buffer=require("safe-buffer").Buffer;module.exports=function(r){if(r.length>=255)throw new TypeError("Alphabet too long");const e=new Uint8Array(256);e.fill(255);for(let t=0;t>>0,a=new Uint8Array(i);for(;r[f];){let o=e[r.charCodeAt(f)];if(255===o)return;let n=0;for(let r=i-1;(0!==o||n>>0,a[r]=o%256>>>0,o=o/256>>>0;if(0!==o)throw new Error("Non-zero carry");c=n,f++}if(" "===r[f])return;let h=i-c;for(;h!==i&&0===a[h];)h++;const u=Buffer.allocUnsafe(l+(i-h));u.fill(0,0,l);let s=l;for(;h!==i;)u[s++]=a[h++];return u}return{encode:function(e){if(!Buffer.isBuffer(e))throw new TypeError("Expected Buffer");if(0===e.length)return"";let n=0,l=0,c=0;const i=e.length;for(;c!==i&&0===e[c];)c++,n++;const a=(i-c)*f+1>>>0,h=new Uint8Array(a);for(;c!==i;){let r=e[c],o=0;for(let e=a-1;(0!==r||o>>0,h[e]=r%t>>>0,r=r/t>>>0;if(0!==r)throw new Error("Non-zero carry");l=o,c++}let u=a-l;for(;u!==a&&0===h[u];)u++;let s=o.repeat(n);for(;u0)throw new Error("Invalid string. Length must be a multiple of 4");var e=o.indexOf("=");return-1===e&&(e=r),[e,e===r?0:4-e%4]}function byteLength(o){var r=getLens(o),e=r[0],t=r[1];return 3*(e+t)/4-t}function _byteLength(o,r,e){return 3*(r+e)/4-e}function toByteArray(o){for(var r,e=getLens(o),t=e[0],n=e[1],u=new Arr(_byteLength(o,t,n)),p=0,a=n>0?t-4:t,h=0;h>16&255,u[p++]=r>>8&255,u[p++]=255&r;return 2===n&&(r=revLookup[o.charCodeAt(h)]<<2|revLookup[o.charCodeAt(h+1)]>>4,u[p++]=255&r),1===n&&(r=revLookup[o.charCodeAt(h)]<<10|revLookup[o.charCodeAt(h+1)]<<4|revLookup[o.charCodeAt(h+2)]>>2,u[p++]=r>>8&255,u[p++]=255&r),u}function tripletToBase64(o){return lookup[o>>18&63]+lookup[o>>12&63]+lookup[o>>6&63]+lookup[63&o]}function encodeChunk(o,r,e){for(var t,n=[],u=r;up?p:u+16383));return 1===t?(r=o[e-1],n.push(lookup[r>>2]+lookup[r<<4&63]+"==")):2===t&&(r=(o[e-2]<<8)+o[e-1],n.push(lookup[r>>10]+lookup[r>>4&63]+lookup[r<<2&63]+"=")),n.join("")}revLookup["-".charCodeAt(0)]=62,revLookup["_".charCodeAt(0)]=63; -},{}],35:[function(require,module,exports){ +},{}],27:[function(require,module,exports){ !function(t,i){"use strict";function r(t,i){if(!t)throw new Error(i||"Assertion failed")}function h(t,i){t.super_=i;var r=function(){};r.prototype=i.prototype,t.prototype=new r,t.prototype.constructor=t}function n(t,i,r){if(n.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==i&&"be"!==i||(r=i,i=10),this._init(t||0,i||10,r||"be"))}var e;"object"==typeof t?t.exports=n:i.BN=n,n.BN=n,n.wordSize=26;try{e=require("buffer").Buffer}catch(t){}function o(t,i,r){for(var h=0,n=Math.min(t.length,r),e=i;e=49&&o<=54?o-49+10:o>=17&&o<=22?o-17+10:15&o}return h}function s(t,i,r,h){for(var n=0,e=Math.min(t.length,r),o=i;o=49?s-49+10:s>=17?s-17+10:s}return n}n.isBN=function(t){return t instanceof n||null!==t&&"object"==typeof t&&t.constructor.wordSize===n.wordSize&&Array.isArray(t.words)},n.max=function(t,i){return t.cmp(i)>0?t:i},n.min=function(t,i){return t.cmp(i)<0?t:i},n.prototype._init=function(t,i,h){if("number"==typeof t)return this._initNumber(t,i,h);if("object"==typeof t)return this._initArray(t,i,h);"hex"===i&&(i=16),r(i===(0|i)&&i>=2&&i<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&n++,16===i?this._parseHex(t,n):this._parseBase(t,i,n),"-"===t[0]&&(this.negative=1),this.strip(),"le"===h&&this._initArray(this.toArray(),i,h)},n.prototype._initNumber=function(t,i,h){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):(r(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===h&&this._initArray(this.toArray(),i,h)},n.prototype._initArray=function(t,i,h){if(r("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)o=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[e]|=o<>>26-s&67108863,(s+=24)>=26&&(s-=26,e++);else if("le"===h)for(n=0,e=0;n>>26-s&67108863,(s+=24)>=26&&(s-=26,e++);return this.strip()},n.prototype._parseHex=function(t,i){this.length=Math.ceil((t.length-i)/6),this.words=new Array(this.length);for(var r=0;r=i;r-=6)n=o(t,r,r+6),this.words[h]|=n<>>26-e&4194303,(e+=24)>=26&&(e-=26,h++);r+6!==i&&(n=o(t,i,r+6),this.words[h]|=n<>>26-e&4194303),this.strip()},n.prototype._parseBase=function(t,i,r){this.words=[0],this.length=1;for(var h=0,n=1;n<=67108863;n*=i)h++;h--,n=n/i|0;for(var e=t.length-r,o=e%h,u=Math.min(e,e-o)+r,a=0,l=r;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},n.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},n.prototype.inspect=function(){return(this.red?""};var u=["","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"],a=[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 m(t,i,r){r.negative=i.negative^t.negative;var h=t.length+i.length|0;r.length=h,h=h-1|0;var n=0|t.words[0],e=0|i.words[0],o=n*e,s=67108863&o,u=o/67108864|0;r.words[0]=s;for(var a=1;a>>26,m=67108863&u,f=Math.min(a,i.length-1),d=Math.max(0,a-t.length+1);d<=f;d++){var p=a-d|0;l+=(o=(n=0|t.words[p])*(e=0|i.words[d])+m)/67108864|0,m=67108863&o}r.words[a]=0|m,u=0|l}return 0!==u?r.words[a]=0|u:r.length--,r.strip()}n.prototype.toString=function(t,i){var h;if(i=0|i||1,16===(t=t||10)||"hex"===t){h="";for(var n=0,e=0,o=0;o>>24-n&16777215)||o!==this.length-1?u[6-m.length]+m+h:m+h,(n+=2)>=26&&(n-=26,o--)}for(0!==e&&(h=e.toString(16)+h);h.length%i!=0;)h="0"+h;return 0!==this.negative&&(h="-"+h),h}if(t===(0|t)&&t>=2&&t<=36){var f=a[t],d=l[t];h="";var p=this.clone();for(p.negative=0;!p.isZero();){var M=p.modn(d).toString(t);h=(p=p.idivn(d)).isZero()?M+h:u[f-M.length]+M+h}for(this.isZero()&&(h="0"+h);h.length%i!=0;)h="0"+h;return 0!==this.negative&&(h="-"+h),h}r(!1,"Base should be between 2 and 36")},n.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&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},n.prototype.toJSON=function(){return this.toString(16)},n.prototype.toBuffer=function(t,i){return r(void 0!==e),this.toArrayLike(e,t,i)},n.prototype.toArray=function(t,i){return this.toArrayLike(Array,t,i)},n.prototype.toArrayLike=function(t,i,h){var n=this.byteLength(),e=h||Math.max(1,n);r(n<=e,"byte array longer than desired length"),r(e>0,"Requested array length <= 0"),this.strip();var o,s,u="le"===i,a=new t(e),l=this.clone();if(u){for(s=0;!l.isZero();s++)o=l.andln(255),l.iushrn(8),a[s]=o;for(;s=4096&&(r+=13,i>>>=13),i>=64&&(r+=7,i>>>=7),i>=8&&(r+=4,i>>>=4),i>=2&&(r+=2,i>>>=2),r+i},n.prototype._zeroBits=function(t){if(0===t)return 26;var i=t,r=0;return 0==(8191&i)&&(r+=13,i>>>=13),0==(127&i)&&(r+=7,i>>>=7),0==(15&i)&&(r+=4,i>>>=4),0==(3&i)&&(r+=2,i>>>=2),0==(1&i)&&r++,r},n.prototype.bitLength=function(){var t=this.words[this.length-1],i=this._countBits(t);return 26*(this.length-1)+i},n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,i=0;it.length?this.clone().ior(t):t.clone().ior(this)},n.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},n.prototype.iuand=function(t){var i;i=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},n.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},n.prototype.iuxor=function(t){var i,r;this.length>t.length?(i=this,r=t):(i=t,r=this);for(var h=0;ht.length?this.clone().ixor(t):t.clone().ixor(this)},n.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},n.prototype.inotn=function(t){r("number"==typeof t&&t>=0);var i=0|Math.ceil(t/26),h=t%26;this._expand(i),h>0&&i--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-h),this.strip()},n.prototype.notn=function(t){return this.clone().inotn(t)},n.prototype.setn=function(t,i){r("number"==typeof t&&t>=0);var h=t/26|0,n=t%26;return this._expand(h+1),this.words[h]=i?this.words[h]|1<t.length?(r=this,h=t):(r=t,h=this);for(var n=0,e=0;e>>26;for(;0!==n&&e>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;et.length?this.clone().iadd(t):t.clone().iadd(this)},n.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var i=this.iadd(t);return t.negative=1,i._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,h,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,h=t):(r=t,h=this);for(var e=0,o=0;o>26,this.words[o]=67108863&i;for(;0!==e&&o>26,this.words[o]=67108863&i;if(0===e&&o>>13,d=0|o[1],p=8191&d,M=d>>>13,v=0|o[2],g=8191&v,c=v>>>13,w=0|o[3],y=8191&w,b=w>>>13,_=0|o[4],k=8191&_,A=_>>>13,x=0|o[5],S=8191&x,Z=x>>>13,q=0|o[6],R=8191&q,B=q>>>13,N=0|o[7],L=8191&N,I=N>>>13,z=0|o[8],T=8191&z,E=z>>>13,O=0|o[9],j=8191&O,K=O>>>13,P=0|s[0],F=8191&P,C=P>>>13,D=0|s[1],H=8191&D,J=D>>>13,U=0|s[2],G=8191&U,Q=U>>>13,V=0|s[3],W=8191&V,X=V>>>13,Y=0|s[4],$=8191&Y,tt=Y>>>13,it=0|s[5],rt=8191&it,ht=it>>>13,nt=0|s[6],et=8191&nt,ot=nt>>>13,st=0|s[7],ut=8191&st,at=st>>>13,lt=0|s[8],mt=8191<,ft=lt>>>13,dt=0|s[9],pt=8191&dt,Mt=dt>>>13;r.negative=t.negative^i.negative,r.length=19;var vt=(a+(h=Math.imul(m,F))|0)+((8191&(n=(n=Math.imul(m,C))+Math.imul(f,F)|0))<<13)|0;a=((e=Math.imul(f,C))+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,h=Math.imul(p,F),n=(n=Math.imul(p,C))+Math.imul(M,F)|0,e=Math.imul(M,C);var gt=(a+(h=h+Math.imul(m,H)|0)|0)+((8191&(n=(n=n+Math.imul(m,J)|0)+Math.imul(f,H)|0))<<13)|0;a=((e=e+Math.imul(f,J)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,h=Math.imul(g,F),n=(n=Math.imul(g,C))+Math.imul(c,F)|0,e=Math.imul(c,C),h=h+Math.imul(p,H)|0,n=(n=n+Math.imul(p,J)|0)+Math.imul(M,H)|0,e=e+Math.imul(M,J)|0;var ct=(a+(h=h+Math.imul(m,G)|0)|0)+((8191&(n=(n=n+Math.imul(m,Q)|0)+Math.imul(f,G)|0))<<13)|0;a=((e=e+Math.imul(f,Q)|0)+(n>>>13)|0)+(ct>>>26)|0,ct&=67108863,h=Math.imul(y,F),n=(n=Math.imul(y,C))+Math.imul(b,F)|0,e=Math.imul(b,C),h=h+Math.imul(g,H)|0,n=(n=n+Math.imul(g,J)|0)+Math.imul(c,H)|0,e=e+Math.imul(c,J)|0,h=h+Math.imul(p,G)|0,n=(n=n+Math.imul(p,Q)|0)+Math.imul(M,G)|0,e=e+Math.imul(M,Q)|0;var wt=(a+(h=h+Math.imul(m,W)|0)|0)+((8191&(n=(n=n+Math.imul(m,X)|0)+Math.imul(f,W)|0))<<13)|0;a=((e=e+Math.imul(f,X)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,h=Math.imul(k,F),n=(n=Math.imul(k,C))+Math.imul(A,F)|0,e=Math.imul(A,C),h=h+Math.imul(y,H)|0,n=(n=n+Math.imul(y,J)|0)+Math.imul(b,H)|0,e=e+Math.imul(b,J)|0,h=h+Math.imul(g,G)|0,n=(n=n+Math.imul(g,Q)|0)+Math.imul(c,G)|0,e=e+Math.imul(c,Q)|0,h=h+Math.imul(p,W)|0,n=(n=n+Math.imul(p,X)|0)+Math.imul(M,W)|0,e=e+Math.imul(M,X)|0;var yt=(a+(h=h+Math.imul(m,$)|0)|0)+((8191&(n=(n=n+Math.imul(m,tt)|0)+Math.imul(f,$)|0))<<13)|0;a=((e=e+Math.imul(f,tt)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,h=Math.imul(S,F),n=(n=Math.imul(S,C))+Math.imul(Z,F)|0,e=Math.imul(Z,C),h=h+Math.imul(k,H)|0,n=(n=n+Math.imul(k,J)|0)+Math.imul(A,H)|0,e=e+Math.imul(A,J)|0,h=h+Math.imul(y,G)|0,n=(n=n+Math.imul(y,Q)|0)+Math.imul(b,G)|0,e=e+Math.imul(b,Q)|0,h=h+Math.imul(g,W)|0,n=(n=n+Math.imul(g,X)|0)+Math.imul(c,W)|0,e=e+Math.imul(c,X)|0,h=h+Math.imul(p,$)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(M,$)|0,e=e+Math.imul(M,tt)|0;var bt=(a+(h=h+Math.imul(m,rt)|0)|0)+((8191&(n=(n=n+Math.imul(m,ht)|0)+Math.imul(f,rt)|0))<<13)|0;a=((e=e+Math.imul(f,ht)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,h=Math.imul(R,F),n=(n=Math.imul(R,C))+Math.imul(B,F)|0,e=Math.imul(B,C),h=h+Math.imul(S,H)|0,n=(n=n+Math.imul(S,J)|0)+Math.imul(Z,H)|0,e=e+Math.imul(Z,J)|0,h=h+Math.imul(k,G)|0,n=(n=n+Math.imul(k,Q)|0)+Math.imul(A,G)|0,e=e+Math.imul(A,Q)|0,h=h+Math.imul(y,W)|0,n=(n=n+Math.imul(y,X)|0)+Math.imul(b,W)|0,e=e+Math.imul(b,X)|0,h=h+Math.imul(g,$)|0,n=(n=n+Math.imul(g,tt)|0)+Math.imul(c,$)|0,e=e+Math.imul(c,tt)|0,h=h+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,ht)|0)+Math.imul(M,rt)|0,e=e+Math.imul(M,ht)|0;var _t=(a+(h=h+Math.imul(m,et)|0)|0)+((8191&(n=(n=n+Math.imul(m,ot)|0)+Math.imul(f,et)|0))<<13)|0;a=((e=e+Math.imul(f,ot)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,h=Math.imul(L,F),n=(n=Math.imul(L,C))+Math.imul(I,F)|0,e=Math.imul(I,C),h=h+Math.imul(R,H)|0,n=(n=n+Math.imul(R,J)|0)+Math.imul(B,H)|0,e=e+Math.imul(B,J)|0,h=h+Math.imul(S,G)|0,n=(n=n+Math.imul(S,Q)|0)+Math.imul(Z,G)|0,e=e+Math.imul(Z,Q)|0,h=h+Math.imul(k,W)|0,n=(n=n+Math.imul(k,X)|0)+Math.imul(A,W)|0,e=e+Math.imul(A,X)|0,h=h+Math.imul(y,$)|0,n=(n=n+Math.imul(y,tt)|0)+Math.imul(b,$)|0,e=e+Math.imul(b,tt)|0,h=h+Math.imul(g,rt)|0,n=(n=n+Math.imul(g,ht)|0)+Math.imul(c,rt)|0,e=e+Math.imul(c,ht)|0,h=h+Math.imul(p,et)|0,n=(n=n+Math.imul(p,ot)|0)+Math.imul(M,et)|0,e=e+Math.imul(M,ot)|0;var kt=(a+(h=h+Math.imul(m,ut)|0)|0)+((8191&(n=(n=n+Math.imul(m,at)|0)+Math.imul(f,ut)|0))<<13)|0;a=((e=e+Math.imul(f,at)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,h=Math.imul(T,F),n=(n=Math.imul(T,C))+Math.imul(E,F)|0,e=Math.imul(E,C),h=h+Math.imul(L,H)|0,n=(n=n+Math.imul(L,J)|0)+Math.imul(I,H)|0,e=e+Math.imul(I,J)|0,h=h+Math.imul(R,G)|0,n=(n=n+Math.imul(R,Q)|0)+Math.imul(B,G)|0,e=e+Math.imul(B,Q)|0,h=h+Math.imul(S,W)|0,n=(n=n+Math.imul(S,X)|0)+Math.imul(Z,W)|0,e=e+Math.imul(Z,X)|0,h=h+Math.imul(k,$)|0,n=(n=n+Math.imul(k,tt)|0)+Math.imul(A,$)|0,e=e+Math.imul(A,tt)|0,h=h+Math.imul(y,rt)|0,n=(n=n+Math.imul(y,ht)|0)+Math.imul(b,rt)|0,e=e+Math.imul(b,ht)|0,h=h+Math.imul(g,et)|0,n=(n=n+Math.imul(g,ot)|0)+Math.imul(c,et)|0,e=e+Math.imul(c,ot)|0,h=h+Math.imul(p,ut)|0,n=(n=n+Math.imul(p,at)|0)+Math.imul(M,ut)|0,e=e+Math.imul(M,at)|0;var At=(a+(h=h+Math.imul(m,mt)|0)|0)+((8191&(n=(n=n+Math.imul(m,ft)|0)+Math.imul(f,mt)|0))<<13)|0;a=((e=e+Math.imul(f,ft)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,h=Math.imul(j,F),n=(n=Math.imul(j,C))+Math.imul(K,F)|0,e=Math.imul(K,C),h=h+Math.imul(T,H)|0,n=(n=n+Math.imul(T,J)|0)+Math.imul(E,H)|0,e=e+Math.imul(E,J)|0,h=h+Math.imul(L,G)|0,n=(n=n+Math.imul(L,Q)|0)+Math.imul(I,G)|0,e=e+Math.imul(I,Q)|0,h=h+Math.imul(R,W)|0,n=(n=n+Math.imul(R,X)|0)+Math.imul(B,W)|0,e=e+Math.imul(B,X)|0,h=h+Math.imul(S,$)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(Z,$)|0,e=e+Math.imul(Z,tt)|0,h=h+Math.imul(k,rt)|0,n=(n=n+Math.imul(k,ht)|0)+Math.imul(A,rt)|0,e=e+Math.imul(A,ht)|0,h=h+Math.imul(y,et)|0,n=(n=n+Math.imul(y,ot)|0)+Math.imul(b,et)|0,e=e+Math.imul(b,ot)|0,h=h+Math.imul(g,ut)|0,n=(n=n+Math.imul(g,at)|0)+Math.imul(c,ut)|0,e=e+Math.imul(c,at)|0,h=h+Math.imul(p,mt)|0,n=(n=n+Math.imul(p,ft)|0)+Math.imul(M,mt)|0,e=e+Math.imul(M,ft)|0;var xt=(a+(h=h+Math.imul(m,pt)|0)|0)+((8191&(n=(n=n+Math.imul(m,Mt)|0)+Math.imul(f,pt)|0))<<13)|0;a=((e=e+Math.imul(f,Mt)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,h=Math.imul(j,H),n=(n=Math.imul(j,J))+Math.imul(K,H)|0,e=Math.imul(K,J),h=h+Math.imul(T,G)|0,n=(n=n+Math.imul(T,Q)|0)+Math.imul(E,G)|0,e=e+Math.imul(E,Q)|0,h=h+Math.imul(L,W)|0,n=(n=n+Math.imul(L,X)|0)+Math.imul(I,W)|0,e=e+Math.imul(I,X)|0,h=h+Math.imul(R,$)|0,n=(n=n+Math.imul(R,tt)|0)+Math.imul(B,$)|0,e=e+Math.imul(B,tt)|0,h=h+Math.imul(S,rt)|0,n=(n=n+Math.imul(S,ht)|0)+Math.imul(Z,rt)|0,e=e+Math.imul(Z,ht)|0,h=h+Math.imul(k,et)|0,n=(n=n+Math.imul(k,ot)|0)+Math.imul(A,et)|0,e=e+Math.imul(A,ot)|0,h=h+Math.imul(y,ut)|0,n=(n=n+Math.imul(y,at)|0)+Math.imul(b,ut)|0,e=e+Math.imul(b,at)|0,h=h+Math.imul(g,mt)|0,n=(n=n+Math.imul(g,ft)|0)+Math.imul(c,mt)|0,e=e+Math.imul(c,ft)|0;var St=(a+(h=h+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,Mt)|0)+Math.imul(M,pt)|0))<<13)|0;a=((e=e+Math.imul(M,Mt)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,h=Math.imul(j,G),n=(n=Math.imul(j,Q))+Math.imul(K,G)|0,e=Math.imul(K,Q),h=h+Math.imul(T,W)|0,n=(n=n+Math.imul(T,X)|0)+Math.imul(E,W)|0,e=e+Math.imul(E,X)|0,h=h+Math.imul(L,$)|0,n=(n=n+Math.imul(L,tt)|0)+Math.imul(I,$)|0,e=e+Math.imul(I,tt)|0,h=h+Math.imul(R,rt)|0,n=(n=n+Math.imul(R,ht)|0)+Math.imul(B,rt)|0,e=e+Math.imul(B,ht)|0,h=h+Math.imul(S,et)|0,n=(n=n+Math.imul(S,ot)|0)+Math.imul(Z,et)|0,e=e+Math.imul(Z,ot)|0,h=h+Math.imul(k,ut)|0,n=(n=n+Math.imul(k,at)|0)+Math.imul(A,ut)|0,e=e+Math.imul(A,at)|0,h=h+Math.imul(y,mt)|0,n=(n=n+Math.imul(y,ft)|0)+Math.imul(b,mt)|0,e=e+Math.imul(b,ft)|0;var Zt=(a+(h=h+Math.imul(g,pt)|0)|0)+((8191&(n=(n=n+Math.imul(g,Mt)|0)+Math.imul(c,pt)|0))<<13)|0;a=((e=e+Math.imul(c,Mt)|0)+(n>>>13)|0)+(Zt>>>26)|0,Zt&=67108863,h=Math.imul(j,W),n=(n=Math.imul(j,X))+Math.imul(K,W)|0,e=Math.imul(K,X),h=h+Math.imul(T,$)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(E,$)|0,e=e+Math.imul(E,tt)|0,h=h+Math.imul(L,rt)|0,n=(n=n+Math.imul(L,ht)|0)+Math.imul(I,rt)|0,e=e+Math.imul(I,ht)|0,h=h+Math.imul(R,et)|0,n=(n=n+Math.imul(R,ot)|0)+Math.imul(B,et)|0,e=e+Math.imul(B,ot)|0,h=h+Math.imul(S,ut)|0,n=(n=n+Math.imul(S,at)|0)+Math.imul(Z,ut)|0,e=e+Math.imul(Z,at)|0,h=h+Math.imul(k,mt)|0,n=(n=n+Math.imul(k,ft)|0)+Math.imul(A,mt)|0,e=e+Math.imul(A,ft)|0;var qt=(a+(h=h+Math.imul(y,pt)|0)|0)+((8191&(n=(n=n+Math.imul(y,Mt)|0)+Math.imul(b,pt)|0))<<13)|0;a=((e=e+Math.imul(b,Mt)|0)+(n>>>13)|0)+(qt>>>26)|0,qt&=67108863,h=Math.imul(j,$),n=(n=Math.imul(j,tt))+Math.imul(K,$)|0,e=Math.imul(K,tt),h=h+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,ht)|0)+Math.imul(E,rt)|0,e=e+Math.imul(E,ht)|0,h=h+Math.imul(L,et)|0,n=(n=n+Math.imul(L,ot)|0)+Math.imul(I,et)|0,e=e+Math.imul(I,ot)|0,h=h+Math.imul(R,ut)|0,n=(n=n+Math.imul(R,at)|0)+Math.imul(B,ut)|0,e=e+Math.imul(B,at)|0,h=h+Math.imul(S,mt)|0,n=(n=n+Math.imul(S,ft)|0)+Math.imul(Z,mt)|0,e=e+Math.imul(Z,ft)|0;var Rt=(a+(h=h+Math.imul(k,pt)|0)|0)+((8191&(n=(n=n+Math.imul(k,Mt)|0)+Math.imul(A,pt)|0))<<13)|0;a=((e=e+Math.imul(A,Mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,h=Math.imul(j,rt),n=(n=Math.imul(j,ht))+Math.imul(K,rt)|0,e=Math.imul(K,ht),h=h+Math.imul(T,et)|0,n=(n=n+Math.imul(T,ot)|0)+Math.imul(E,et)|0,e=e+Math.imul(E,ot)|0,h=h+Math.imul(L,ut)|0,n=(n=n+Math.imul(L,at)|0)+Math.imul(I,ut)|0,e=e+Math.imul(I,at)|0,h=h+Math.imul(R,mt)|0,n=(n=n+Math.imul(R,ft)|0)+Math.imul(B,mt)|0,e=e+Math.imul(B,ft)|0;var Bt=(a+(h=h+Math.imul(S,pt)|0)|0)+((8191&(n=(n=n+Math.imul(S,Mt)|0)+Math.imul(Z,pt)|0))<<13)|0;a=((e=e+Math.imul(Z,Mt)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,h=Math.imul(j,et),n=(n=Math.imul(j,ot))+Math.imul(K,et)|0,e=Math.imul(K,ot),h=h+Math.imul(T,ut)|0,n=(n=n+Math.imul(T,at)|0)+Math.imul(E,ut)|0,e=e+Math.imul(E,at)|0,h=h+Math.imul(L,mt)|0,n=(n=n+Math.imul(L,ft)|0)+Math.imul(I,mt)|0,e=e+Math.imul(I,ft)|0;var Nt=(a+(h=h+Math.imul(R,pt)|0)|0)+((8191&(n=(n=n+Math.imul(R,Mt)|0)+Math.imul(B,pt)|0))<<13)|0;a=((e=e+Math.imul(B,Mt)|0)+(n>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,h=Math.imul(j,ut),n=(n=Math.imul(j,at))+Math.imul(K,ut)|0,e=Math.imul(K,at),h=h+Math.imul(T,mt)|0,n=(n=n+Math.imul(T,ft)|0)+Math.imul(E,mt)|0,e=e+Math.imul(E,ft)|0;var Lt=(a+(h=h+Math.imul(L,pt)|0)|0)+((8191&(n=(n=n+Math.imul(L,Mt)|0)+Math.imul(I,pt)|0))<<13)|0;a=((e=e+Math.imul(I,Mt)|0)+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,h=Math.imul(j,mt),n=(n=Math.imul(j,ft))+Math.imul(K,mt)|0,e=Math.imul(K,ft);var It=(a+(h=h+Math.imul(T,pt)|0)|0)+((8191&(n=(n=n+Math.imul(T,Mt)|0)+Math.imul(E,pt)|0))<<13)|0;a=((e=e+Math.imul(E,Mt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863;var zt=(a+(h=Math.imul(j,pt))|0)+((8191&(n=(n=Math.imul(j,Mt))+Math.imul(K,pt)|0))<<13)|0;return a=((e=Math.imul(K,Mt))+(n>>>13)|0)+(zt>>>26)|0,zt&=67108863,u[0]=vt,u[1]=gt,u[2]=ct,u[3]=wt,u[4]=yt,u[5]=bt,u[6]=_t,u[7]=kt,u[8]=At,u[9]=xt,u[10]=St,u[11]=Zt,u[12]=qt,u[13]=Rt,u[14]=Bt,u[15]=Nt,u[16]=Lt,u[17]=It,u[18]=zt,0!==a&&(u[19]=a,r.length++),r};function d(t,i,r){return(new p).mulp(t,i,r)}function p(t,i){this.x=t,this.y=i}Math.imul||(f=m),n.prototype.mulTo=function(t,i){var r=this.length+t.length;return 10===this.length&&10===t.length?f(this,t,i):r<63?m(this,t,i):r<1024?function(t,i,r){r.negative=i.negative^t.negative,r.length=t.length+i.length;for(var h=0,n=0,e=0;e>>26)|0)>>>26,o&=67108863}r.words[e]=s,h=o,o=n}return 0!==h?r.words[e]=h:r.length--,r.strip()}(this,t,i):d(this,t,i)},p.prototype.makeRBT=function(t){for(var i=new Array(t),r=n.prototype._countBits(t)-1,h=0;h>=1;return h},p.prototype.permute=function(t,i,r,h,n,e){for(var o=0;o>>=1)n++;return 1<>>=13,h[2*o+1]=8191&e,e>>>=13;for(o=2*i;o>=26,i+=n/67108864|0,i+=e>>>26,this.words[h]=67108863&e}return 0!==i&&(this.words[h]=i,this.length++),this},n.prototype.muln=function(t){return this.clone().imuln(t)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(t){var i=function(t){for(var i=new Array(t.bitLength()),r=0;r>>n}return i}(t);if(0===i.length)return new n(1);for(var r=this,h=0;h=0);var i,h=t%26,n=(t-h)/26,e=67108863>>>26-h<<26-h;if(0!==h){var o=0;for(i=0;i>>26-h}o&&(this.words[i]=o,this.length++)}if(0!==n){for(i=this.length-1;i>=0;i--)this.words[i+n]=this.words[i];for(i=0;i=0),n=i?(i-i%26)/26:0;var e=t%26,o=Math.min((t-e)/26,this.length),s=67108863^67108863>>>e<o)for(this.length-=o,a=0;a=0&&(0!==l||a>=n);a--){var m=0|this.words[a];this.words[a]=l<<26-e|m>>>e,l=m&s}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.ishrn=function(t,i,h){return r(0===this.negative),this.iushrn(t,i,h)},n.prototype.shln=function(t){return this.clone().ishln(t)},n.prototype.ushln=function(t){return this.clone().iushln(t)},n.prototype.shrn=function(t){return this.clone().ishrn(t)},n.prototype.ushrn=function(t){return this.clone().iushrn(t)},n.prototype.testn=function(t){r("number"==typeof t&&t>=0);var i=t%26,h=(t-i)/26,n=1<=0);var i=t%26,h=(t-i)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=h)return this;if(0!==i&&h++,this.length=Math.min(h,this.length),0!==i){var n=67108863^67108863>>>i<=67108864;i++)this.words[i]-=67108864,i===this.length-1?this.words[i+1]=1:this.words[i+1]++;return this.length=Math.max(this.length,i+1),this},n.prototype.isubn=function(t){if(r("number"==typeof t),r(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 i=0;i>26)-(u/67108864|0),this.words[n+h]=67108863&e}for(;n>26,this.words[n+h]=67108863&e;if(0===s)return this.strip();for(r(-1===s),s=0,n=0;n>26,this.words[n]=67108863&e;return this.negative=1,this.strip()},n.prototype._wordDiv=function(t,i){var r=(this.length,t.length),h=this.clone(),e=t,o=0|e.words[e.length-1];0!==(r=26-this._countBits(o))&&(e=e.ushln(r),h.iushln(r),o=0|e.words[e.length-1]);var s,u=h.length-e.length;if("mod"!==i){(s=new n(null)).length=u+1,s.words=new Array(s.length);for(var a=0;a=0;m--){var f=67108864*(0|h.words[e.length+m])+(0|h.words[e.length+m-1]);for(f=Math.min(f/o|0,67108863),h._ishlnsubmul(e,f,m);0!==h.negative;)f--,h.negative=0,h._ishlnsubmul(e,1,m),h.isZero()||(h.negative^=1);s&&(s.words[m]=f)}return s&&s.strip(),h.strip(),"div"!==i&&0!==r&&h.iushrn(r),{div:s||null,mod:h}},n.prototype.divmod=function(t,i,h){return r(!t.isZero()),this.isZero()?{div:new n(0),mod:new n(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,i),"mod"!==i&&(e=s.div.neg()),"div"!==i&&(o=s.mod.neg(),h&&0!==o.negative&&o.iadd(t)),{div:e,mod:o}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),i),"mod"!==i&&(e=s.div.neg()),{div:e,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),i),"div"!==i&&(o=s.mod.neg(),h&&0!==o.negative&&o.isub(t)),{div:s.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new n(0),mod:this}:1===t.length?"div"===i?{div:this.divn(t.words[0]),mod:null}:"mod"===i?{div:null,mod:new n(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new n(this.modn(t.words[0]))}:this._wordDiv(t,i);var e,o,s},n.prototype.div=function(t){return this.divmod(t,"div",!1).div},n.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},n.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},n.prototype.divRound=function(t){var i=this.divmod(t);if(i.mod.isZero())return i.div;var r=0!==i.div.negative?i.mod.isub(t):i.mod,h=t.ushrn(1),n=t.andln(1),e=r.cmp(h);return e<0||1===n&&0===e?i.div:0!==i.div.negative?i.div.isubn(1):i.div.iaddn(1)},n.prototype.modn=function(t){r(t<=67108863);for(var i=(1<<26)%t,h=0,n=this.length-1;n>=0;n--)h=(i*h+(0|this.words[n]))%t;return h},n.prototype.idivn=function(t){r(t<=67108863);for(var i=0,h=this.length-1;h>=0;h--){var n=(0|this.words[h])+67108864*i;this.words[h]=n/t|0,i=n%t}return this.strip()},n.prototype.divn=function(t){return this.clone().idivn(t)},n.prototype.egcd=function(t){r(0===t.negative),r(!t.isZero());var i=this,h=t.clone();i=0!==i.negative?i.umod(t):i.clone();for(var e=new n(1),o=new n(0),s=new n(0),u=new n(1),a=0;i.isEven()&&h.isEven();)i.iushrn(1),h.iushrn(1),++a;for(var l=h.clone(),m=i.clone();!i.isZero();){for(var f=0,d=1;0==(i.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(i.iushrn(f);f-- >0;)(e.isOdd()||o.isOdd())&&(e.iadd(l),o.isub(m)),e.iushrn(1),o.iushrn(1);for(var p=0,M=1;0==(h.words[0]&M)&&p<26;++p,M<<=1);if(p>0)for(h.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(l),u.isub(m)),s.iushrn(1),u.iushrn(1);i.cmp(h)>=0?(i.isub(h),e.isub(s),o.isub(u)):(h.isub(i),s.isub(e),u.isub(o))}return{a:s,b:u,gcd:h.iushln(a)}},n.prototype._invmp=function(t){r(0===t.negative),r(!t.isZero());var i=this,h=t.clone();i=0!==i.negative?i.umod(t):i.clone();for(var e,o=new n(1),s=new n(0),u=h.clone();i.cmpn(1)>0&&h.cmpn(1)>0;){for(var a=0,l=1;0==(i.words[0]&l)&&a<26;++a,l<<=1);if(a>0)for(i.iushrn(a);a-- >0;)o.isOdd()&&o.iadd(u),o.iushrn(1);for(var m=0,f=1;0==(h.words[0]&f)&&m<26;++m,f<<=1);if(m>0)for(h.iushrn(m);m-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);i.cmp(h)>=0?(i.isub(h),o.isub(s)):(h.isub(i),s.isub(o))}return(e=0===i.cmpn(1)?o:s).cmpn(0)<0&&e.iadd(t),e},n.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var i=this.clone(),r=t.clone();i.negative=0,r.negative=0;for(var h=0;i.isEven()&&r.isEven();h++)i.iushrn(1),r.iushrn(1);for(;;){for(;i.isEven();)i.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=i.cmp(r);if(n<0){var e=i;i=r,r=e}else if(0===n||0===r.cmpn(1))break;i.isub(r)}return r.iushln(h)},n.prototype.invm=function(t){return this.egcd(t).a.umod(t)},n.prototype.isEven=function(){return 0==(1&this.words[0])},n.prototype.isOdd=function(){return 1==(1&this.words[0])},n.prototype.andln=function(t){return this.words[0]&t},n.prototype.bincn=function(t){r("number"==typeof t);var i=t%26,h=(t-i)/26,n=1<>>26,s&=67108863,this.words[o]=s}return 0!==e&&(this.words[o]=e,this.length++),this},n.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},n.prototype.cmpn=function(t){var i,h=t<0;if(0!==this.negative&&!h)return-1;if(0===this.negative&&h)return 1;if(this.strip(),this.length>1)i=1;else{h&&(t=-t),r(t<=67108863,"Number is too big");var n=0|this.words[0];i=n===t?0:nt.length)return 1;if(this.length=0;r--){var h=0|this.words[r],n=0|t.words[r];if(h!==n){hn&&(i=1);break}}return i},n.prototype.gtn=function(t){return 1===this.cmpn(t)},n.prototype.gt=function(t){return 1===this.cmp(t)},n.prototype.gten=function(t){return this.cmpn(t)>=0},n.prototype.gte=function(t){return this.cmp(t)>=0},n.prototype.ltn=function(t){return-1===this.cmpn(t)},n.prototype.lt=function(t){return-1===this.cmp(t)},n.prototype.lten=function(t){return this.cmpn(t)<=0},n.prototype.lte=function(t){return this.cmp(t)<=0},n.prototype.eqn=function(t){return 0===this.cmpn(t)},n.prototype.eq=function(t){return 0===this.cmp(t)},n.red=function(t){return new b(t)},n.prototype.toRed=function(t){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},n.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(t){return this.red=t,this},n.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},n.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},n.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},n.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},n.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},n.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},n.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},n.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},n.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(t){return r(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 v(t,i){this.name=t,this.p=new n(i,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function g(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function c(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function y(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function b(t){if("string"==typeof t){var i=n._prime(t);this.m=i.p,this.prime=i}else r(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function _(t){b.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new n(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)}v.prototype._tmp=function(){var t=new n(null);return t.words=new Array(Math.ceil(this.n/13)),t},v.prototype.ireduce=function(t){var i,r=t;do{this.split(r,this.tmp),i=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(i>this.n);var h=i0?r.isub(this.p):r.strip(),r},v.prototype.split=function(t,i){t.iushrn(this.n,0,i)},v.prototype.imulK=function(t){return t.imul(this.k)},h(g,v),g.prototype.split=function(t,i){for(var r=Math.min(t.length,9),h=0;h>>22,n=e}n>>>=22,t.words[h-10]=n,0===n&&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 i=0,r=0;r>>=26,t.words[r]=n,i=h}return 0!==i&&(t.words[t.length++]=i),t},n._prime=function(t){if(M[t])return M[t];var i;if("k256"===t)i=new g;else if("p224"===t)i=new c;else if("p192"===t)i=new w;else{if("p25519"!==t)throw new Error("Unknown prime "+t);i=new y}return M[t]=i,i},b.prototype._verify1=function(t){r(0===t.negative,"red works only with positives"),r(t.red,"red works only with red numbers")},b.prototype._verify2=function(t,i){r(0==(t.negative|i.negative),"red works only with positives"),r(t.red&&t.red===i.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,i){this._verify2(t,i);var r=t.add(i);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},b.prototype.iadd=function(t,i){this._verify2(t,i);var r=t.iadd(i);return r.cmp(this.m)>=0&&r.isub(this.m),r},b.prototype.sub=function(t,i){this._verify2(t,i);var r=t.sub(i);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},b.prototype.isub=function(t,i){this._verify2(t,i);var r=t.isub(i);return r.cmpn(0)<0&&r.iadd(this.m),r},b.prototype.shl=function(t,i){return this._verify1(t),this.imod(t.ushln(i))},b.prototype.imul=function(t,i){return this._verify2(t,i),this.imod(t.imul(i))},b.prototype.mul=function(t,i){return this._verify2(t,i),this.imod(t.mul(i))},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 i=this.m.andln(3);if(r(i%2==1),3===i){var h=this.m.add(new n(1)).iushrn(2);return this.pow(t,h)}for(var e=this.m.subn(1),o=0;!e.isZero()&&0===e.andln(1);)o++,e.iushrn(1);r(!e.isZero());var s=new n(1).toRed(this),u=s.redNeg(),a=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new n(2*l*l).toRed(this);0!==this.pow(l,a).cmp(u);)l.redIAdd(u);for(var m=this.pow(l,e),f=this.pow(t,e.addn(1).iushrn(1)),d=this.pow(t,e),p=o;0!==d.cmp(s);){for(var M=d,v=0;0!==M.cmp(s);v++)M=M.redSqr();r(v=0;h--){for(var a=i.words[h],l=u-1;l>=0;l--){var m=a>>l&1;e!==r[0]&&(e=this.sqr(e)),0!==m||0!==o?(o<<=1,o|=m,(4===++s||0===h&&0===l)&&(e=this.mul(e,r[o]),s=0,o=0)):s=0}u=26}return e},b.prototype.convertTo=function(t){var i=t.umod(this.m);return i===t?i.clone():i},b.prototype.convertFrom=function(t){var i=t.clone();return i.red=null,i},n.mont=function(t){return new _(t)},h(_,b),_.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},_.prototype.convertFrom=function(t){var i=this.imod(t.mul(this.rinv));return i.red=null,i},_.prototype.imul=function(t,i){if(t.isZero()||i.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(i),h=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(h).iushrn(this.shift),e=n;return n.cmp(this.m)>=0?e=n.isub(this.m):n.cmpn(0)<0&&(e=n.iadd(this.m)),e._forceRed(this)},_.prototype.mul=function(t,i){if(t.isZero()||i.isZero())return new n(0)._forceRed(this);var r=t.mul(i),h=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),e=r.isub(h).iushrn(this.shift),o=e;return e.cmp(this.m)>=0?o=e.isub(this.m):e.cmpn(0)<0&&(o=e.iadd(this.m)),o._forceRed(this)},_.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}("undefined"==typeof module||module,this); -},{"buffer":36}],36:[function(require,module,exports){ +},{"buffer":28}],28:[function(require,module,exports){ -},{}],37:[function(require,module,exports){ +},{}],29:[function(require,module,exports){ -},{}],38:[function(require,module,exports){ +},{}],30:[function(require,module,exports){ var basex=require("base-x"),ALPHABET="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";module.exports=basex(ALPHABET); -},{"base-x":33}],39:[function(require,module,exports){ +},{"base-x":25}],31:[function(require,module,exports){ (function (Buffer){ "use strict";var base64=require("base64-js"),ieee754=require("ieee754");exports.Buffer=Buffer,exports.SlowBuffer=SlowBuffer,exports.INSPECT_MAX_BYTES=50;var K_MAX_LENGTH=2147483647;function typedArraySupport(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()}catch(e){return!1}}function createBuffer(e){if(e>K_MAX_LENGTH)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return t.__proto__=Buffer.prototype,t}function Buffer(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return allocUnsafe(e)}return from(e,t,r)}function from(e,t,r){if("string"==typeof e)return fromString(e,t);if(ArrayBuffer.isView(e))return fromArrayLike(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(isInstance(e,ArrayBuffer)||e&&isInstance(e.buffer,ArrayBuffer))return fromArrayBuffer(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return Buffer.from(n,t,r);var f=fromObject(e);if(f)return f;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return Buffer.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function assertSize(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function alloc(e,t,r){return assertSize(e),e<=0?createBuffer(e):void 0!==t?"string"==typeof r?createBuffer(e).fill(t,r):createBuffer(e).fill(t):createBuffer(e)}function allocUnsafe(e){return assertSize(e),createBuffer(e<0?0:0|checked(e))}function fromString(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!Buffer.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|byteLength(e,t),n=createBuffer(r),f=n.write(e,t);return f!==r&&(n=n.slice(0,f)),n}function fromArrayLike(e){for(var t=e.length<0?0:0|checked(e.length),r=createBuffer(t),n=0;n=K_MAX_LENGTH)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+K_MAX_LENGTH.toString(16)+" bytes");return 0|e}function SlowBuffer(e){return+e!=e&&(e=0),Buffer.alloc(+e)}function byteLength(e,t){if(Buffer.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||isInstance(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var f=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return utf8ToBytes(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return base64ToBytes(e).length;default:if(f)return n?-1:utf8ToBytes(e).length;t=(""+t).toLowerCase(),f=!0}}function slowToString(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return hexSlice(this,t,r);case"utf8":case"utf-8":return utf8Slice(this,t,r);case"ascii":return asciiSlice(this,t,r);case"latin1":case"binary":return latin1Slice(this,t,r);case"base64":return base64Slice(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function swap(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function bidirectionalIndexOf(e,t,r,n,f){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),numberIsNaN(r=+r)&&(r=f?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(f)return-1;r=e.length-1}else if(r<0){if(!f)return-1;r=0}if("string"==typeof t&&(t=Buffer.from(t,n)),Buffer.isBuffer(t))return 0===t.length?-1:arrayIndexOf(e,t,r,n,f);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?f?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):arrayIndexOf(e,[t],r,n,f);throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(e,t,r,n,f){var i,o=1,u=e.length,s=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,u/=2,s/=2,r/=2}function a(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(f){var h=-1;for(i=r;iu&&(r=u-s),i=r;i>=0;i--){for(var c=!0,l=0;lf&&(n=f):n=f;var i=t.length;n>i/2&&(n=i/2);for(var o=0;o239?4:a>223?3:a>191?2:1;if(f+c<=r)switch(c){case 1:a<128&&(h=a);break;case 2:128==(192&(i=e[f+1]))&&(s=(31&a)<<6|63&i)>127&&(h=s);break;case 3:i=e[f+1],o=e[f+2],128==(192&i)&&128==(192&o)&&(s=(15&a)<<12|(63&i)<<6|63&o)>2047&&(s<55296||s>57343)&&(h=s);break;case 4:i=e[f+1],o=e[f+2],u=e[f+3],128==(192&i)&&128==(192&o)&&128==(192&u)&&(s=(15&a)<<18|(63&i)<<12|(63&o)<<6|63&u)>65535&&s<1114112&&(h=s)}null===h?(h=65533,c=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),f+=c}return decodeCodePointsArray(n)}exports.kMaxLength=K_MAX_LENGTH,Buffer.TYPED_ARRAY_SUPPORT=typedArraySupport(),Buffer.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(Buffer.prototype,"parent",{enumerable:!0,get:function(){if(Buffer.isBuffer(this))return this.buffer}}),Object.defineProperty(Buffer.prototype,"offset",{enumerable:!0,get:function(){if(Buffer.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&Buffer[Symbol.species]===Buffer&&Object.defineProperty(Buffer,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),Buffer.poolSize=8192,Buffer.from=function(e,t,r){return from(e,t,r)},Buffer.prototype.__proto__=Uint8Array.prototype,Buffer.__proto__=Uint8Array,Buffer.alloc=function(e,t,r){return alloc(e,t,r)},Buffer.allocUnsafe=function(e){return allocUnsafe(e)},Buffer.allocUnsafeSlow=function(e){return allocUnsafe(e)},Buffer.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==Buffer.prototype},Buffer.compare=function(e,t){if(isInstance(e,Uint8Array)&&(e=Buffer.from(e,e.offset,e.byteLength)),isInstance(t,Uint8Array)&&(t=Buffer.from(t,t.offset,t.byteLength)),!Buffer.isBuffer(e)||!Buffer.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,n=t.length,f=0,i=Math.min(r,n);ft&&(e+=" ... "),""},Buffer.prototype.compare=function(e,t,r,n,f){if(isInstance(e,Uint8Array)&&(e=Buffer.from(e,e.offset,e.byteLength)),!Buffer.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===f&&(f=this.length),t<0||r>e.length||n<0||f>this.length)throw new RangeError("out of range index");if(n>=f&&t>=r)return 0;if(n>=f)return-1;if(t>=r)return 1;if(this===e)return 0;for(var i=(f>>>=0)-(n>>>=0),o=(r>>>=0)-(t>>>=0),u=Math.min(i,o),s=this.slice(n,f),a=e.slice(t,r),h=0;h>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var f=this.length-t;if((void 0===r||r>f)&&(r=f),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return hexWrite(this,e,t,r);case"utf8":case"utf-8":return utf8Write(this,e,t,r);case"ascii":return asciiWrite(this,e,t,r);case"latin1":case"binary":return latin1Write(this,e,t,r);case"base64":return base64Write(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},Buffer.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var MAX_ARGUMENTS_LENGTH=4096;function decodeCodePointsArray(e){var t=e.length;if(t<=MAX_ARGUMENTS_LENGTH)return String.fromCharCode.apply(String,e);for(var r="",n=0;nn)&&(r=n);for(var f="",i=t;ir)throw new RangeError("Trying to access beyond buffer length")}function checkInt(e,t,r,n,f,i){if(!Buffer.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>f||te.length)throw new RangeError("Index out of range")}function checkIEEE754(e,t,r,n,f,i){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function writeFloat(e,t,r,n,f){return t=+t,r>>>=0,f||checkIEEE754(e,t,r,4,3.4028234663852886e38,-3.4028234663852886e38),ieee754.write(e,t,r,n,23,4),r+4}function writeDouble(e,t,r,n,f){return t=+t,r>>>=0,f||checkIEEE754(e,t,r,8,1.7976931348623157e308,-1.7976931348623157e308),ieee754.write(e,t,r,n,52,8),r+8}Buffer.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t>>=0,t>>>=0,r||checkOffset(e,t,this.length);for(var n=this[e],f=1,i=0;++i>>=0,t>>>=0,r||checkOffset(e,t,this.length);for(var n=this[e+--t],f=1;t>0&&(f*=256);)n+=this[e+--t]*f;return n},Buffer.prototype.readUInt8=function(e,t){return e>>>=0,t||checkOffset(e,1,this.length),this[e]},Buffer.prototype.readUInt16LE=function(e,t){return e>>>=0,t||checkOffset(e,2,this.length),this[e]|this[e+1]<<8},Buffer.prototype.readUInt16BE=function(e,t){return e>>>=0,t||checkOffset(e,2,this.length),this[e]<<8|this[e+1]},Buffer.prototype.readUInt32LE=function(e,t){return e>>>=0,t||checkOffset(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},Buffer.prototype.readUInt32BE=function(e,t){return e>>>=0,t||checkOffset(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},Buffer.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||checkOffset(e,t,this.length);for(var n=this[e],f=1,i=0;++i=(f*=128)&&(n-=Math.pow(2,8*t)),n},Buffer.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||checkOffset(e,t,this.length);for(var n=t,f=1,i=this[e+--n];n>0&&(f*=256);)i+=this[e+--n]*f;return i>=(f*=128)&&(i-=Math.pow(2,8*t)),i},Buffer.prototype.readInt8=function(e,t){return e>>>=0,t||checkOffset(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},Buffer.prototype.readInt16LE=function(e,t){e>>>=0,t||checkOffset(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},Buffer.prototype.readInt16BE=function(e,t){e>>>=0,t||checkOffset(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},Buffer.prototype.readInt32LE=function(e,t){return e>>>=0,t||checkOffset(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},Buffer.prototype.readInt32BE=function(e,t){return e>>>=0,t||checkOffset(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},Buffer.prototype.readFloatLE=function(e,t){return e>>>=0,t||checkOffset(e,4,this.length),ieee754.read(this,e,!0,23,4)},Buffer.prototype.readFloatBE=function(e,t){return e>>>=0,t||checkOffset(e,4,this.length),ieee754.read(this,e,!1,23,4)},Buffer.prototype.readDoubleLE=function(e,t){return e>>>=0,t||checkOffset(e,8,this.length),ieee754.read(this,e,!0,52,8)},Buffer.prototype.readDoubleBE=function(e,t){return e>>>=0,t||checkOffset(e,8,this.length),ieee754.read(this,e,!1,52,8)},Buffer.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t>>>=0,r>>>=0,n)||checkInt(this,e,t,r,Math.pow(2,8*r)-1,0);var f=1,i=0;for(this[t]=255&e;++i>>=0,r>>>=0,n)||checkInt(this,e,t,r,Math.pow(2,8*r)-1,0);var f=r-1,i=1;for(this[t+f]=255&e;--f>=0&&(i*=256);)this[t+f]=e/i&255;return t+r},Buffer.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,1,255,0),this[t]=255&e,t+1},Buffer.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},Buffer.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},Buffer.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},Buffer.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},Buffer.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var f=Math.pow(2,8*r-1);checkInt(this,e,t,r,f-1,-f)}var i=0,o=1,u=0;for(this[t]=255&e;++i>0)-u&255;return t+r},Buffer.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var f=Math.pow(2,8*r-1);checkInt(this,e,t,r,f-1,-f)}var i=r-1,o=1,u=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===u&&0!==this[t+i+1]&&(u=1),this[t+i]=(e/o>>0)-u&255;return t+r},Buffer.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},Buffer.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},Buffer.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},Buffer.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},Buffer.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},Buffer.prototype.writeFloatLE=function(e,t,r){return writeFloat(this,e,t,!0,r)},Buffer.prototype.writeFloatBE=function(e,t,r){return writeFloat(this,e,t,!1,r)},Buffer.prototype.writeDoubleLE=function(e,t,r){return writeDouble(this,e,t,!0,r)},Buffer.prototype.writeDoubleBE=function(e,t,r){return writeDouble(this,e,t,!1,r)},Buffer.prototype.copy=function(e,t,r,n){if(!Buffer.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t=0;--i)e[i+t]=this[i+r];else Uint8Array.prototype.set.call(e,this.subarray(r,n),t);return f},Buffer.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!Buffer.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){var f=e.charCodeAt(0);("utf8"===n&&f<128||"latin1"===n)&&(e=f)}}else"number"==typeof e&&(e&=255);if(t<0||this.length>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i55295&&r<57344){if(!f){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&i.push(239,191,189);continue}f=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),f=r;continue}r=65536+(f-55296<<10|r-56320)}else f&&(t-=3)>-1&&i.push(239,191,189);if(f=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function asciiToBytes(e){for(var t=[],r=0;r>8,f=r%256,i.push(f),i.push(n);return i}function base64ToBytes(e){return base64.toByteArray(base64clean(e))}function blitBuffer(e,t,r,n){for(var f=0;f=t.length||f>=e.length);++f)t[f+r]=e[f];return f}function isInstance(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function numberIsNaN(e){return e!=e} }).call(this,require("buffer").Buffer) -},{"base64-js":34,"buffer":39,"ieee754":56}],40:[function(require,module,exports){ +},{"base64-js":26,"buffer":31,"ieee754":48}],32:[function(require,module,exports){ require(".").check("es5"); -},{".":41}],41:[function(require,module,exports){ +},{".":33}],33:[function(require,module,exports){ require("./lib/definitions"),module.exports=require("./lib"); -},{"./lib":44,"./lib/definitions":43}],42:[function(require,module,exports){ +},{"./lib":36,"./lib/definitions":35}],34:[function(require,module,exports){ var CapabilityDetector=function(){this.tests={},this.cache={}};CapabilityDetector.prototype={constructor:CapabilityDetector,define:function(t,i){if("string"!=typeof t||!(i instanceof Function))throw new Error("Invalid capability definition.");if(this.tests[t])throw new Error('Duplicated capability definition by "'+t+'".');this.tests[t]=i},check:function(t){if(!this.test(t))throw new Error('The current environment does not support "'+t+'", therefore we cannot continue.')},test:function(t){if(void 0!==this.cache[t])return this.cache[t];if(!this.tests[t])throw new Error('Unknown capability with name "'+t+'".');var i=this.tests[t];return this.cache[t]=!!i(),this.cache[t]}},module.exports=CapabilityDetector; -},{}],43:[function(require,module,exports){ +},{}],35:[function(require,module,exports){ var capability=require("."),define=capability.define,test=capability.test;define("strict mode",function(){return void 0===this}),define("arguments.callee.caller",function(){try{return function(){return arguments.callee.caller}()===arguments.callee}catch(e){return!1}}),define("es5",function(){return test("Array.prototype.forEach")&&test("Array.prototype.map")&&test("Function.prototype.bind")&&test("Object.create")&&test("Object.defineProperties")&&test("Object.defineProperty")&&test("Object.prototype.hasOwnProperty")}),define("Array.prototype.forEach",function(){return Array.prototype.forEach}),define("Array.prototype.map",function(){return Array.prototype.map}),define("Function.prototype.bind",function(){return Function.prototype.bind}),define("Object.create",function(){return Object.create}),define("Object.defineProperties",function(){return Object.defineProperties}),define("Object.defineProperty",function(){return Object.defineProperty}),define("Object.prototype.hasOwnProperty",function(){return Object.prototype.hasOwnProperty}),define("Error.captureStackTrace",function(){return Error.captureStackTrace}),define("Error.prototype.stack",function(){try{throw new Error}catch(e){return e.stack||e.stacktrace}}); -},{".":44}],44:[function(require,module,exports){ +},{".":36}],36:[function(require,module,exports){ var CapabilityDetector=require("./CapabilityDetector"),detector=new CapabilityDetector,capability=function(t){return detector.test(t)};capability.define=function(t,e){detector.define(t,e)},capability.check=function(t){detector.check(t)},capability.test=capability,module.exports=capability; -},{"./CapabilityDetector":42}],45:[function(require,module,exports){ +},{"./CapabilityDetector":34}],37:[function(require,module,exports){ "use strict";function depd(r){if(!r)throw new TypeError("argument namespace is required");function e(r){}return e._file=void 0,e._ignored=!0,e._namespace=r,e._traced=!1,e._warned=Object.create(null),e.function=wrapfunction,e.property=wrapproperty,e}function wrapfunction(r,e){if("function"!=typeof r)throw new TypeError("argument fn must be a function");return r}function wrapproperty(r,e,t){if(!r||"object"!=typeof r&&"function"!=typeof r)throw new TypeError("argument obj must be object");var o=Object.getOwnPropertyDescriptor(r,e);if(!o)throw new TypeError("must call property on owner object");if(!o.configurable)throw new TypeError("property must be configurable")}module.exports=depd; -},{}],46:[function(require,module,exports){ +},{}],38:[function(require,module,exports){ module.exports=require("./lib"); -},{"./lib":47}],47:[function(require,module,exports){ +},{"./lib":39}],39:[function(require,module,exports){ require("capability/es5");var polyfill,capability=require("capability");polyfill=capability("Error.captureStackTrace")?require("./v8"):capability("Error.prototype.stack")?require("./non-v8/index"):require("./unsupported"),module.exports=polyfill(); -},{"./non-v8/index":51,"./unsupported":53,"./v8":54,"capability":41,"capability/es5":40}],48:[function(require,module,exports){ +},{"./non-v8/index":43,"./unsupported":45,"./v8":46,"capability":33,"capability/es5":32}],40:[function(require,module,exports){ var Class=require("o3").Class,abstractMethod=require("o3").abstractMethod,Frame=Class(Object,{prototype:{init:Class.prototype.merge,frameString:void 0,toString:function(){return this.frameString},functionValue:void 0,getThis:abstractMethod,getTypeName:abstractMethod,getFunction:function(){return this.functionValue},getFunctionName:abstractMethod,getMethodName:abstractMethod,getFileName:abstractMethod,getLineNumber:abstractMethod,getColumnNumber:abstractMethod,getEvalOrigin:abstractMethod,isTopLevel:abstractMethod,isEval:abstractMethod,isNative:abstractMethod,isConstructor:abstractMethod}});module.exports=Frame; -},{"o3":59}],49:[function(require,module,exports){ +},{"o3":51}],41:[function(require,module,exports){ var Class=require("o3").Class,Frame=require("./Frame"),cache=require("u3").cache,FrameStringParser=Class(Object,{prototype:{stackParser:null,frameParser:null,locationParsers:null,constructor:function(e){Class.prototype.merge.call(this,e)},getFrames:function(e,r){for(var t=[],a=0,n=e.length;a=600)&&deprecate("non-error status code; use only 4xx or 5xx status codes"),("number"!=typeof t||!statuses[t]&&(t<400||t>=600))&&(t=500);var n=createError[t]||createError[codeClass(t)];for(var u in r||(r=n?new n(e):new Error(e||statuses[t]),Error.captureStackTrace(r,createError)),n&&r instanceof n&&r.status===t||(r.expose=t<500,r.status=r.statusCode=t),o)"status"!==u&&"statusCode"!==u&&(r[u]=o[u]);return r}function createHttpErrorConstructor(){function r(){throw new TypeError("cannot construct abstract class")}return inherits(r,Error),r}function createClientErrorConstructor(r,e,t){var o=e.match(/Error$/)?e:e+"Error";function a(r){var e=null!=r?r:statuses[t],s=new Error(e);return Error.captureStackTrace(s,a),setPrototypeOf(s,a.prototype),Object.defineProperty(s,"message",{enumerable:!0,configurable:!0,value:e,writable:!0}),Object.defineProperty(s,"name",{enumerable:!1,configurable:!0,value:o,writable:!0}),s}return inherits(a,r),nameFunc(a,o),a.prototype.status=t,a.prototype.statusCode=t,a.prototype.expose=!0,a}function createServerErrorConstructor(r,e,t){var o=e.match(/Error$/)?e:e+"Error";function a(r){var e=null!=r?r:statuses[t],s=new Error(e);return Error.captureStackTrace(s,a),setPrototypeOf(s,a.prototype),Object.defineProperty(s,"message",{enumerable:!0,configurable:!0,value:e,writable:!0}),Object.defineProperty(s,"name",{enumerable:!1,configurable:!0,value:o,writable:!0}),s}return inherits(a,r),nameFunc(a,o),a.prototype.status=t,a.prototype.statusCode=t,a.prototype.expose=!1,a}function nameFunc(r,e){var t=Object.getOwnPropertyDescriptor(r,"name");t&&t.configurable&&(t.value=e,Object.defineProperty(r,"name",t))}function populateConstructorExports(r,e,t){e.forEach(function(e){var o,a=toIdentifier(statuses[e]);switch(codeClass(e)){case 400:o=createClientErrorConstructor(t,a,e);break;case 500:o=createServerErrorConstructor(t,a,e)}o&&(r[e]=o,r[a]=o)}),r["I'mateapot"]=deprecate.function(r.ImATeapot,'"I\'mateapot"; use "ImATeapot" instead')}module.exports=createError,module.exports.HttpError=createHttpErrorConstructor(),populateConstructorExports(module.exports,statuses.codes,module.exports.HttpError); -},{"depd":45,"inherits":57,"setprototypeof":76,"statuses":78,"toidentifier":79}],56:[function(require,module,exports){ +},{"depd":37,"inherits":49,"setprototypeof":57,"statuses":59,"toidentifier":60}],48:[function(require,module,exports){ exports.read=function(a,o,t,r,h){var M,p,w=8*h-r-1,f=(1<>1,i=-7,N=t?h-1:0,n=t?-1:1,s=a[o+N];for(N+=n,M=s&(1<<-i)-1,s>>=-i,i+=w;i>0;M=256*M+a[o+N],N+=n,i-=8);for(p=M&(1<<-i)-1,M>>=-i,i+=r;i>0;p=256*p+a[o+N],N+=n,i-=8);if(0===M)M=1-e;else{if(M===f)return p?NaN:1/0*(s?-1:1);p+=Math.pow(2,r),M-=e}return(s?-1:1)*p*Math.pow(2,M-r)},exports.write=function(a,o,t,r,h,M){var p,w,f,e=8*M-h-1,i=(1<>1,n=23===h?Math.pow(2,-24)-Math.pow(2,-77):0,s=r?0:M-1,u=r?1:-1,l=o<0||0===o&&1/o<0?1:0;for(o=Math.abs(o),isNaN(o)||o===1/0?(w=isNaN(o)?1:0,p=i):(p=Math.floor(Math.log(o)/Math.LN2),o*(f=Math.pow(2,-p))<1&&(p--,f*=2),(o+=p+N>=1?n/f:n*Math.pow(2,1-N))*f>=2&&(p++,f/=2),p+N>=i?(w=0,p=i):p+N>=1?(w=(o*f-1)*Math.pow(2,h),p+=N):(w=o*Math.pow(2,N-1)*Math.pow(2,h),p=0));h>=8;a[t+s]=255&w,s+=u,w/=256,h-=8);for(p=p<0;a[t+s]=255&p,s+=u,p/=256,e-=8);a[t+s-u]|=128*l}; -},{}],57:[function(require,module,exports){ -"function"==typeof Object.create?module.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:module.exports=function(t,e){if(e){t.super_=e;var o=function(){};o.prototype=e.prototype,t.prototype=new o,t.prototype.constructor=t}}; +},{}],49:[function(require,module,exports){ +"function"==typeof Object.create?module.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:module.exports=function(t,e){t.super_=e;var o=function(){};o.prototype=e.prototype,t.prototype=new o,t.prototype.constructor=t}; -},{}],58:[function(require,module,exports){ +},{}],50:[function(require,module,exports){ (function (process,global){ !function(){"use strict";var ERROR="input is invalid type",WINDOW="object"==typeof window,root=WINDOW?window:{};root.JS_SHA256_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&"object"==typeof self,NODE_JS=!root.JS_SHA256_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node;NODE_JS?root=global:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_SHA256_NO_COMMON_JS&&"object"==typeof module&&module.exports,AMD="function"==typeof define&&define.amd,ARRAY_BUFFER=!root.JS_SHA256_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,HEX_CHARS="0123456789abcdef".split(""),EXTRA=[-2147483648,8388608,32768,128],SHIFT=[24,16,8,0],K=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],OUTPUT_TYPES=["hex","array","digest","arrayBuffer"],blocks=[];!root.JS_SHA256_NO_NODE_JS&&Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),!ARRAY_BUFFER||!root.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(t){return"object"==typeof t&&t.buffer&&t.buffer.constructor===ArrayBuffer});var createOutputMethod=function(t,h){return function(r){return new Sha256(h,!0).update(r)[t]()}},createMethod=function(t){var h=createOutputMethod("hex",t);NODE_JS&&(h=nodeWrap(h,t)),h.create=function(){return new Sha256(t)},h.update=function(t){return h.create().update(t)};for(var r=0;r>6,o[H++]=128|63&i):i<55296||i>=57344?(o[H++]=224|i>>12,o[H++]=128|i>>6&63,o[H++]=128|63&i):(i=65536+((1023&i)<<10|1023&t.charCodeAt(++e)),o[H++]=240|i>>18,o[H++]=128|i>>12&63,o[H++]=128|i>>6&63,o[H++]=128|63&i);t=o}else{if("object"!==s)throw new Error(ERROR);if(null===t)throw new Error(ERROR);if(ARRAY_BUFFER&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||ARRAY_BUFFER&&ArrayBuffer.isView(t)))throw new Error(ERROR)}t.length>64&&(t=new Sha256(h,!0).update(t).array());var n=[],S=[];for(e=0;e<64;++e){var c=t[e]||0;n[e]=92^c,S[e]=54^c}Sha256.call(this,h,r),this.update(S),this.oKeyPad=n,this.inner=!0,this.sharedMemory=r}Sha256.prototype.update=function(t){if(!this.finalized){var h,r=typeof t;if("string"!==r){if("object"!==r)throw new Error(ERROR);if(null===t)throw new Error(ERROR);if(ARRAY_BUFFER&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||ARRAY_BUFFER&&ArrayBuffer.isView(t)))throw new Error(ERROR);h=!0}for(var e,s,i=0,o=t.length,a=this.blocks;i>2]|=t[i]<>2]|=e<>2]|=(192|e>>6)<>2]|=(128|63&e)<=57344?(a[s>>2]|=(224|e>>12)<>2]|=(128|e>>6&63)<>2]|=(128|63&e)<>2]|=(240|e>>18)<>2]|=(128|e>>12&63)<>2]|=(128|e>>6&63)<>2]|=(128|63&e)<=64?(this.block=a[16],this.start=s-64,this.hash(),this.hashed=!0):this.start=s}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Sha256.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,h=this.lastByteIndex;t[16]=this.block,t[h>>2]|=EXTRA[3&h],this.block=t[16],h>=56&&(this.hashed||this.hash(),t[0]=this.block,t[16]=t[1]=t[2]=t[3]=t[4]=t[5]=t[6]=t[7]=t[8]=t[9]=t[10]=t[11]=t[12]=t[13]=t[14]=t[15]=0),t[14]=this.hBytes<<3|this.bytes>>>29,t[15]=this.bytes<<3,this.hash()}},Sha256.prototype.hash=function(){var t,h,r,e,s,i,o,a,H,n=this.h0,S=this.h1,c=this.h2,f=this.h3,A=this.h4,R=this.h5,u=this.h6,_=this.h7,E=this.blocks;for(t=16;t<64;++t)h=((s=E[t-15])>>>7|s<<25)^(s>>>18|s<<14)^s>>>3,r=((s=E[t-2])>>>17|s<<15)^(s>>>19|s<<13)^s>>>10,E[t]=E[t-16]+h+E[t-7]+r<<0;for(H=S&c,t=0;t<64;t+=4)this.first?(this.is224?(i=300032,_=(s=E[0]-1413257819)-150054599<<0,f=s+24177077<<0):(i=704751109,_=(s=E[0]-210244248)-1521486534<<0,f=s+143694565<<0),this.first=!1):(h=(n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10),e=(i=n&S)^n&c^H,_=f+(s=_+(r=(A>>>6|A<<26)^(A>>>11|A<<21)^(A>>>25|A<<7))+(A&R^~A&u)+K[t]+E[t])<<0,f=s+(h+e)<<0),h=(f>>>2|f<<30)^(f>>>13|f<<19)^(f>>>22|f<<10),e=(o=f&n)^f&S^i,u=c+(s=u+(r=(_>>>6|_<<26)^(_>>>11|_<<21)^(_>>>25|_<<7))+(_&A^~_&R)+K[t+1]+E[t+1])<<0,h=((c=s+(h+e)<<0)>>>2|c<<30)^(c>>>13|c<<19)^(c>>>22|c<<10),e=(a=c&f)^c&n^o,R=S+(s=R+(r=(u>>>6|u<<26)^(u>>>11|u<<21)^(u>>>25|u<<7))+(u&_^~u&A)+K[t+2]+E[t+2])<<0,h=((S=s+(h+e)<<0)>>>2|S<<30)^(S>>>13|S<<19)^(S>>>22|S<<10),e=(H=S&c)^S&f^a,A=n+(s=A+(r=(R>>>6|R<<26)^(R>>>11|R<<21)^(R>>>25|R<<7))+(R&u^~R&_)+K[t+3]+E[t+3])<<0,n=s+(h+e)<<0;this.h0=this.h0+n<<0,this.h1=this.h1+S<<0,this.h2=this.h2+c<<0,this.h3=this.h3+f<<0,this.h4=this.h4+A<<0,this.h5=this.h5+R<<0,this.h6=this.h6+u<<0,this.h7=this.h7+_<<0},Sha256.prototype.hex=function(){this.finalize();var t=this.h0,h=this.h1,r=this.h2,e=this.h3,s=this.h4,i=this.h5,o=this.h6,a=this.h7,H=HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[15&t]+HEX_CHARS[h>>28&15]+HEX_CHARS[h>>24&15]+HEX_CHARS[h>>20&15]+HEX_CHARS[h>>16&15]+HEX_CHARS[h>>12&15]+HEX_CHARS[h>>8&15]+HEX_CHARS[h>>4&15]+HEX_CHARS[15&h]+HEX_CHARS[r>>28&15]+HEX_CHARS[r>>24&15]+HEX_CHARS[r>>20&15]+HEX_CHARS[r>>16&15]+HEX_CHARS[r>>12&15]+HEX_CHARS[r>>8&15]+HEX_CHARS[r>>4&15]+HEX_CHARS[15&r]+HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>4&15]+HEX_CHARS[15&e]+HEX_CHARS[s>>28&15]+HEX_CHARS[s>>24&15]+HEX_CHARS[s>>20&15]+HEX_CHARS[s>>16&15]+HEX_CHARS[s>>12&15]+HEX_CHARS[s>>8&15]+HEX_CHARS[s>>4&15]+HEX_CHARS[15&s]+HEX_CHARS[i>>28&15]+HEX_CHARS[i>>24&15]+HEX_CHARS[i>>20&15]+HEX_CHARS[i>>16&15]+HEX_CHARS[i>>12&15]+HEX_CHARS[i>>8&15]+HEX_CHARS[i>>4&15]+HEX_CHARS[15&i]+HEX_CHARS[o>>28&15]+HEX_CHARS[o>>24&15]+HEX_CHARS[o>>20&15]+HEX_CHARS[o>>16&15]+HEX_CHARS[o>>12&15]+HEX_CHARS[o>>8&15]+HEX_CHARS[o>>4&15]+HEX_CHARS[15&o];return this.is224||(H+=HEX_CHARS[a>>28&15]+HEX_CHARS[a>>24&15]+HEX_CHARS[a>>20&15]+HEX_CHARS[a>>16&15]+HEX_CHARS[a>>12&15]+HEX_CHARS[a>>8&15]+HEX_CHARS[a>>4&15]+HEX_CHARS[15&a]),H},Sha256.prototype.toString=Sha256.prototype.hex,Sha256.prototype.digest=function(){this.finalize();var t=this.h0,h=this.h1,r=this.h2,e=this.h3,s=this.h4,i=this.h5,o=this.h6,a=this.h7,H=[t>>24&255,t>>16&255,t>>8&255,255&t,h>>24&255,h>>16&255,h>>8&255,255&h,r>>24&255,r>>16&255,r>>8&255,255&r,e>>24&255,e>>16&255,e>>8&255,255&e,s>>24&255,s>>16&255,s>>8&255,255&s,i>>24&255,i>>16&255,i>>8&255,255&i,o>>24&255,o>>16&255,o>>8&255,255&o];return this.is224||H.push(a>>24&255,a>>16&255,a>>8&255,255&a),H},Sha256.prototype.array=Sha256.prototype.digest,Sha256.prototype.arrayBuffer=function(){this.finalize();var t=new ArrayBuffer(this.is224?28:32),h=new DataView(t);return h.setUint32(0,this.h0),h.setUint32(4,this.h1),h.setUint32(8,this.h2),h.setUint32(12,this.h3),h.setUint32(16,this.h4),h.setUint32(20,this.h5),h.setUint32(24,this.h6),this.is224||h.setUint32(28,this.h7),t},HmacSha256.prototype=new Sha256,HmacSha256.prototype.finalize=function(){if(Sha256.prototype.finalize.call(this),this.inner){this.inner=!1;var t=this.array();Sha256.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(t),Sha256.prototype.finalize.call(this)}};var exports=createMethod();exports.sha256=exports,exports.sha224=createMethod(!0),exports.sha256.hmac=createHmacMethod(),exports.sha224.hmac=createHmacMethod(!0),COMMON_JS?module.exports=exports:(root.sha256=exports.sha256,root.sha224=exports.sha224,AMD&&define(function(){return exports}))}(); }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"_process":63}],59:[function(require,module,exports){ +},{"_process":55}],51:[function(require,module,exports){ require("capability/es5"),module.exports=require("./lib"); -},{"./lib":62,"capability/es5":40}],60:[function(require,module,exports){ +},{"./lib":54,"capability/es5":32}],52:[function(require,module,exports){ var Class=function(){var t=Object.create({Source:Object,config:{},buildArgs:[]});function o(o){var r="config";if(o instanceof Function)r="Source";else if(o instanceof Array)r="buildArgs";else{if(!(o instanceof Object))throw new Error("Invalid configuration option.");r="config"}if(t.hasOwnProperty(r))throw new Error("Duplicated configuration option: "+r+".");t[r]=o}for(var r=0,e=arguments.length;r1)for(var r=1;r "+t.len)}function Reader(t){this.buf=t,this.pos=0,this.len=t.length}var create_array="undefined"!=typeof Uint8Array?function(t){if(t instanceof Uint8Array||Array.isArray(t))return new Reader(t);throw Error("illegal buffer")}:function(t){if(Array.isArray(t))return new Reader(t);throw Error("illegal buffer")};function readLongVarint(){var t=new LongBits(0,0),i=0;if(!(this.len-this.pos>4)){for(;i<3;++i){if(this.pos>=this.len)throw indexOutOfRange(this);if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*i)>>>0,this.buf[this.pos++]<128)return t}return t.lo=(t.lo|(127&this.buf[this.pos++])<<7*i)>>>0,t}for(;i<4;++i)if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*i)>>>0,this.buf[this.pos++]<128)return t;if(t.lo=(t.lo|(127&this.buf[this.pos])<<28)>>>0,t.hi=(t.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return t;if(i=0,this.len-this.pos>4){for(;i<5;++i)if(t.hi=(t.hi|(127&this.buf[this.pos])<<7*i+3)>>>0,this.buf[this.pos++]<128)return t}else for(;i<5;++i){if(this.pos>=this.len)throw indexOutOfRange(this);if(t.hi=(t.hi|(127&this.buf[this.pos])<<7*i+3)>>>0,this.buf[this.pos++]<128)return t}throw Error("invalid varint encoding")}function readFixed32_end(t,i){return(t[i-4]|t[i-3]<<8|t[i-2]<<16|t[i-1]<<24)>>>0}function readFixed64(){if(this.pos+8>this.len)throw indexOutOfRange(this,8);return new LongBits(readFixed32_end(this.buf,this.pos+=4),readFixed32_end(this.buf,this.pos+=4))}Reader.create=util.Buffer?function(t){return(Reader.create=function(t){return util.Buffer.isBuffer(t)?new BufferReader(t):create_array(t)})(t)}:create_array,Reader.prototype._slice=util.Array.prototype.subarray||util.Array.prototype.slice,Reader.prototype.uint32=function(){var t=4294967295;return function(){if(t=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return t;if(t=(t|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return t;if(t=(t|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return t;if(t=(t|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return t;if(t=(t|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return t;if((this.pos+=5)>this.len)throw this.pos=this.len,indexOutOfRange(this,10);return t}}(),Reader.prototype.int32=function(){return 0|this.uint32()},Reader.prototype.sint32=function(){var t=this.uint32();return t>>>1^-(1&t)|0},Reader.prototype.bool=function(){return 0!==this.uint32()},Reader.prototype.fixed32=function(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);return readFixed32_end(this.buf,this.pos+=4)},Reader.prototype.sfixed32=function(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);return 0|readFixed32_end(this.buf,this.pos+=4)},Reader.prototype.float=function(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);var t=util.float.readFloatLE(this.buf,this.pos);return this.pos+=4,t},Reader.prototype.double=function(){if(this.pos+8>this.len)throw indexOutOfRange(this,4);var t=util.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,t},Reader.prototype.bytes=function(){var t=this.uint32(),i=this.pos,e=this.pos+t;if(e>this.len)throw indexOutOfRange(this,t);return this.pos+=t,Array.isArray(this.buf)?this.buf.slice(i,e):i===e?new this.buf.constructor(0):this._slice.call(this.buf,i,e)},Reader.prototype.string=function(){var t=this.bytes();return utf8.read(t,0,t.length)},Reader.prototype.skip=function(t){if("number"==typeof t){if(this.pos+t>this.len)throw indexOutOfRange(this,t);this.pos+=t}else do{if(this.pos>=this.len)throw indexOutOfRange(this)}while(128&this.buf[this.pos++]);return this},Reader.prototype.skipType=function(t){switch(t){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(t=7&this.uint32());)this.skipType(t);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+t+" at offset "+this.pos)}return this},Reader._configure=function(t){BufferReader=t;var i=util.Long?"toLong":"toNumber";util.merge(Reader.prototype,{int64:function(){return readLongVarint.call(this)[i](!1)},uint64:function(){return readLongVarint.call(this)[i](!0)},sint64:function(){return readLongVarint.call(this).zzDecode()[i](!1)},fixed64:function(){return readFixed64.call(this)[i](!0)},sfixed64:function(){return readFixed64.call(this)[i](!1)}})}; - -},{"./util/minimal":72}],67:[function(require,module,exports){ -"use strict";module.exports=BufferReader;var Reader=require("./reader");(BufferReader.prototype=Object.create(Reader.prototype)).constructor=BufferReader;var util=require("./util/minimal");function BufferReader(e){Reader.call(this,e)}util.Buffer&&(BufferReader.prototype._slice=util.Buffer.prototype.slice),BufferReader.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len))}; - -},{"./reader":66,"./util/minimal":72}],68:[function(require,module,exports){ -"use strict";module.exports={}; - -},{}],69:[function(require,module,exports){ -"use strict";var rpc=exports;rpc.Service=require("./rpc/service"); - -},{"./rpc/service":70}],70:[function(require,module,exports){ -"use strict";module.exports=Service;var util=require("../util/minimal");function Service(e,t,r){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");util.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(r)}(Service.prototype=Object.create(util.EventEmitter.prototype)).constructor=Service,Service.prototype.rpcCall=function e(t,r,i,n,o){if(!n)throw TypeError("request must be specified");var l=this;if(!o)return util.asPromise(e,l,t,r,i,n);if(l.rpcImpl)try{return l.rpcImpl(t,r[l.requestDelimited?"encodeDelimited":"encode"](n).finish(),function(e,r){if(e)return l.emit("error",e,t),o(e);if(null!==r){if(!(r instanceof i))try{r=i[l.responseDelimited?"decodeDelimited":"decode"](r)}catch(e){return l.emit("error",e,t),o(e)}return l.emit("data",r,t),o(null,r)}l.end(!0)})}catch(e){return l.emit("error",e,t),void setTimeout(function(){o(e)},0)}else setTimeout(function(){o(Error("already ended"))},0)},Service.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}; - -},{"../util/minimal":72}],71:[function(require,module,exports){ -"use strict";module.exports=LongBits;var util=require("../util/minimal");function LongBits(t,o){this.lo=t>>>0,this.hi=o>>>0}var zero=LongBits.zero=new LongBits(0,0);zero.toNumber=function(){return 0},zero.zzEncode=zero.zzDecode=function(){return this},zero.length=function(){return 1};var zeroHash=LongBits.zeroHash="\0\0\0\0\0\0\0\0";LongBits.fromNumber=function(t){if(0===t)return zero;var o=t<0;o&&(t=-t);var i=t>>>0,r=(t-i)/4294967296>>>0;return o&&(r=~r>>>0,i=~i>>>0,++i>4294967295&&(i=0,++r>4294967295&&(r=0))),new LongBits(i,r)},LongBits.from=function(t){if("number"==typeof t)return LongBits.fromNumber(t);if(util.isString(t)){if(!util.Long)return LongBits.fromNumber(parseInt(t,10));t=util.Long.fromString(t)}return t.low||t.high?new LongBits(t.low>>>0,t.high>>>0):zero},LongBits.prototype.toNumber=function(t){if(!t&&this.hi>>>31){var o=1+~this.lo>>>0,i=~this.hi>>>0;return o||(i=i+1>>>0),-(o+4294967296*i)}return this.lo+4294967296*this.hi},LongBits.prototype.toLong=function(t){return util.Long?new util.Long(0|this.lo,0|this.hi,Boolean(t)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(t)}};var charCodeAt=String.prototype.charCodeAt;LongBits.fromHash=function(t){return t===zeroHash?zero:new LongBits((charCodeAt.call(t,0)|charCodeAt.call(t,1)<<8|charCodeAt.call(t,2)<<16|charCodeAt.call(t,3)<<24)>>>0,(charCodeAt.call(t,4)|charCodeAt.call(t,5)<<8|charCodeAt.call(t,6)<<16|charCodeAt.call(t,7)<<24)>>>0)},LongBits.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},LongBits.prototype.zzEncode=function(){var t=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^t)>>>0,this.lo=(this.lo<<1^t)>>>0,this},LongBits.prototype.zzDecode=function(){var t=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^t)>>>0,this.hi=(this.hi>>>1^t)>>>0,this},LongBits.prototype.length=function(){var t=this.lo,o=(this.lo>>>28|this.hi<<4)>>>0,i=this.hi>>>24;return 0===i?0===o?t<16384?t<128?1:2:t<2097152?3:4:o<16384?o<128?5:6:o<2097152?7:8:i<128?9:10}; - -},{"../util/minimal":72}],72:[function(require,module,exports){ -(function (global){ -"use strict";var util=exports;function merge(t,e,r){for(var i=Object.keys(e),o=0;o0)},util.Buffer=function(){try{var t=util.inquire("buffer").Buffer;return t.prototype.utf8Write?t:null}catch(t){return null}}(),util._Buffer_from=null,util._Buffer_allocUnsafe=null,util.newBuffer=function(t){return"number"==typeof t?util.Buffer?util._Buffer_allocUnsafe(t):new util.Array(t):util.Buffer?util._Buffer_from(t):"undefined"==typeof Uint8Array?t:new Uint8Array(t)},util.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,util.Long=util.global.dcodeIO&&util.global.dcodeIO.Long||util.global.Long||util.inquire("long"),util.key2Re=/^true|false|0|1$/,util.key32Re=/^-?(?:0|[1-9][0-9]*)$/,util.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,util.longToHash=function(t){return t?util.LongBits.from(t).toHash():util.LongBits.zeroHash},util.longFromHash=function(t,e){var r=util.LongBits.fromHash(t);return util.Long?util.Long.fromBits(r.lo,r.hi,e):r.toNumber(Boolean(e))},util.merge=merge,util.lcFirst=function(t){return t.charAt(0).toLowerCase()+t.substring(1)},util.newError=newError,util.ProtocolError=newError("ProtocolError"),util.oneOfGetter=function(t){for(var e={},r=0;r-1;--r)if(1===e[t[r]]&&void 0!==this[t[r]]&&null!==this[t[r]])return t[r]}},util.oneOfSetter=function(t){return function(e){for(var r=0;r127;)i[r++]=127&t|128,t>>>=7;i[r]=t}function VarintOp(t,i){this.len=t,this.next=void 0,this.val=i}function writeVarint64(t,i,r){for(;t.hi;)i[r++]=127&t.lo|128,t.lo=(t.lo>>>7|t.hi<<25)>>>0,t.hi>>>=7;for(;t.lo>127;)i[r++]=127&t.lo|128,t.lo=t.lo>>>7;i[r++]=t.lo}function writeFixed32(t,i,r){i[r]=255&t,i[r+1]=t>>>8&255,i[r+2]=t>>>16&255,i[r+3]=t>>>24}Writer.create=util.Buffer?function(){return(Writer.create=function(){return new BufferWriter})()}:function(){return new Writer},Writer.alloc=function(t){return new util.Array(t)},util.Array!==Array&&(Writer.alloc=util.pool(Writer.alloc,util.Array.prototype.subarray)),Writer.prototype._push=function(t,i,r){return this.tail=this.tail.next=new Op(t,i,r),this.len+=i,this},VarintOp.prototype=Object.create(Op.prototype),VarintOp.prototype.fn=writeVarint32,Writer.prototype.uint32=function(t){return this.len+=(this.tail=this.tail.next=new VarintOp((t>>>=0)<128?1:t<16384?2:t<2097152?3:t<268435456?4:5,t)).len,this},Writer.prototype.int32=function(t){return t<0?this._push(writeVarint64,10,LongBits.fromNumber(t)):this.uint32(t)},Writer.prototype.sint32=function(t){return this.uint32((t<<1^t>>31)>>>0)},Writer.prototype.uint64=function(t){var i=LongBits.from(t);return this._push(writeVarint64,i.length(),i)},Writer.prototype.int64=Writer.prototype.uint64,Writer.prototype.sint64=function(t){var i=LongBits.from(t).zzEncode();return this._push(writeVarint64,i.length(),i)},Writer.prototype.bool=function(t){return this._push(writeByte,1,t?1:0)},Writer.prototype.fixed32=function(t){return this._push(writeFixed32,4,t>>>0)},Writer.prototype.sfixed32=Writer.prototype.fixed32,Writer.prototype.fixed64=function(t){var i=LongBits.from(t);return this._push(writeFixed32,4,i.lo)._push(writeFixed32,4,i.hi)},Writer.prototype.sfixed64=Writer.prototype.fixed64,Writer.prototype.float=function(t){return this._push(util.float.writeFloatLE,4,t)},Writer.prototype.double=function(t){return this._push(util.float.writeDoubleLE,8,t)};var writeBytes=util.Array.prototype.set?function(t,i,r){i.set(t,r)}:function(t,i,r){for(var e=0;e>>0;if(!i)return this._push(writeByte,1,0);if(util.isString(t)){var r=Writer.alloc(i=base64.length(t));base64.decode(t,r,0),t=r}return this.uint32(i)._push(writeBytes,i,t)},Writer.prototype.string=function(t){var i=utf8.length(t);return i?this.uint32(i)._push(utf8.write,i,t):this._push(writeByte,1,0)},Writer.prototype.fork=function(){return this.states=new State(this),this.head=this.tail=new Op(noop,0,0),this.len=0,this},Writer.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new Op(noop,0,0),this.len=0),this},Writer.prototype.ldelim=function(){var t=this.head,i=this.tail,r=this.len;return this.reset().uint32(r),r&&(this.tail.next=t.next,this.tail=i,this.len+=r),this},Writer.prototype.finish=function(){for(var t=this.head.next,i=this.constructor.alloc(this.len),r=0;t;)t.fn(t.val,i,r),r+=t.len,t=t.next;return i},Writer._configure=function(t){BufferWriter=t}; - -},{"./util/minimal":72}],74:[function(require,module,exports){ -"use strict";module.exports=BufferWriter;var Writer=require("./writer");(BufferWriter.prototype=Object.create(Writer.prototype)).constructor=BufferWriter;var util=require("./util/minimal"),Buffer=util.Buffer;function BufferWriter(){Writer.call(this)}BufferWriter.alloc=function(r){return(BufferWriter.alloc=util._Buffer_allocUnsafe)(r)};var writeBytesBuffer=Buffer&&Buffer.prototype instanceof Uint8Array&&"set"===Buffer.prototype.set.name?function(r,t,e){t.set(r,e)}:function(r,t,e){if(r.copy)r.copy(t,e,0,r.length);else for(var f=0;f>>0;return this.uint32(t),t&&this._push(writeBytesBuffer,t,r),this},BufferWriter.prototype.string=function(r){var t=Buffer.byteLength(r);return this.uint32(t),t&&this._push(writeStringBuffer,t,r),this}; - -},{"./util/minimal":72,"./writer":73}],75:[function(require,module,exports){ +},{}],56:[function(require,module,exports){ var buffer=require("buffer"),Buffer=buffer.Buffer;function copyProps(f,r){for(var e in f)r[e]=f[e]}function SafeBuffer(f,r,e){return Buffer(f,r,e)}Buffer.from&&Buffer.alloc&&Buffer.allocUnsafe&&Buffer.allocUnsafeSlow?module.exports=buffer:(copyProps(buffer,exports),exports.Buffer=SafeBuffer),copyProps(Buffer,SafeBuffer),SafeBuffer.from=function(f,r,e){if("number"==typeof f)throw new TypeError("Argument must not be a number");return Buffer(f,r,e)},SafeBuffer.alloc=function(f,r,e){if("number"!=typeof f)throw new TypeError("Argument must be a number");var u=Buffer(f);return void 0!==r?"string"==typeof e?u.fill(r,e):u.fill(r):u.fill(0),u},SafeBuffer.allocUnsafe=function(f){if("number"!=typeof f)throw new TypeError("Argument must be a number");return Buffer(f)},SafeBuffer.allocUnsafeSlow=function(f){if("number"!=typeof f)throw new TypeError("Argument must be a number");return buffer.SlowBuffer(f)}; -},{"buffer":39}],76:[function(require,module,exports){ +},{"buffer":31}],57:[function(require,module,exports){ "use strict";function setProtoOf(r,t){return r.__proto__=t,r}function mixinProperties(r,t){for(var o in t)r.hasOwnProperty(o)||(r[o]=t[o]);return r}module.exports=Object.setPrototypeOf||({__proto__:[]}instanceof Array?setProtoOf:mixinProperties); -},{}],77:[function(require,module,exports){ +},{}],58:[function(require,module,exports){ module.exports={ "100": "Continue", "101": "Switching Protocols", @@ -310,33 +249,33 @@ module.exports={ "511": "Network Authentication Required" } -},{}],78:[function(require,module,exports){ +},{}],59:[function(require,module,exports){ "use strict";var codes=require("./codes.json");function populateStatusesMap(t,s){var r=[];return Object.keys(s).forEach(function(e){var a=s[e],u=Number(e);t[u]=a,t[a]=u,t[a.toLowerCase()]=u,r.push(u)}),r}function status(t){if("number"==typeof t){if(!status[t])throw new Error("invalid status code: "+t);return t}if("string"!=typeof t)throw new TypeError("code must be a number or string");var s=parseInt(t,10);if(!isNaN(s)){if(!status[s])throw new Error("invalid status code: "+s);return s}if(!(s=status[t.toLowerCase()]))throw new Error('invalid status message: "'+t+'"');return s}module.exports=status,status.STATUS_CODES=codes,status.codes=populateStatusesMap(status,codes),status.redirect={300:!0,301:!0,302:!0,303:!0,305:!0,307:!0,308:!0},status.empty={204:!0,205:!0,304:!0},status.retry={502:!0,503:!0,504:!0}; -},{"./codes.json":77}],79:[function(require,module,exports){ +},{"./codes.json":58}],60:[function(require,module,exports){ function toIdentifier(e){return e.split(" ").map(function(e){return e.slice(0,1).toUpperCase()+e.slice(1)}).join("").replace(/[^ _0-9a-z]/gi,"")}module.exports=toIdentifier; -},{}],80:[function(require,module,exports){ +},{}],61:[function(require,module,exports){ !function(r){"use strict";var t=function(r){var t,n=new Float64Array(16);if(r)for(t=0;t>24&255,r[t+1]=n>>16&255,r[t+2]=n>>8&255,r[t+3]=255&n,r[t+4]=e>>24&255,r[t+5]=e>>16&255,r[t+6]=e>>8&255,r[t+7]=255&e}function v(r,t,n,e,o){var i,h=0;for(i=0;i>>8)-1}function w(r,t,n,e){return v(r,t,n,e,16)}function p(r,t,n,e){return v(r,t,n,e,32)}function b(r,t,n,e){!function(r,t,n,e){for(var o,i=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,h=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,a=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,f=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,s=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,u=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,c=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,y=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,l=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,v=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,w=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,p=255&n[16]|(255&n[17])<<8|(255&n[18])<<16|(255&n[19])<<24,b=255&n[20]|(255&n[21])<<8|(255&n[22])<<16|(255&n[23])<<24,g=255&n[24]|(255&n[25])<<8|(255&n[26])<<16|(255&n[27])<<24,_=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,A=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,U=i,d=h,E=a,x=f,M=s,m=u,B=c,S=y,K=l,Y=v,k=w,T=p,L=b,z=g,R=_,P=A,N=0;N<20;N+=2)U^=(o=(L^=(o=(K^=(o=(M^=(o=U+L|0)<<7|o>>>25)+U|0)<<9|o>>>23)+M|0)<<13|o>>>19)+K|0)<<18|o>>>14,m^=(o=(d^=(o=(z^=(o=(Y^=(o=m+d|0)<<7|o>>>25)+m|0)<<9|o>>>23)+Y|0)<<13|o>>>19)+z|0)<<18|o>>>14,k^=(o=(B^=(o=(E^=(o=(R^=(o=k+B|0)<<7|o>>>25)+k|0)<<9|o>>>23)+R|0)<<13|o>>>19)+E|0)<<18|o>>>14,P^=(o=(T^=(o=(S^=(o=(x^=(o=P+T|0)<<7|o>>>25)+P|0)<<9|o>>>23)+x|0)<<13|o>>>19)+S|0)<<18|o>>>14,U^=(o=(x^=(o=(E^=(o=(d^=(o=U+x|0)<<7|o>>>25)+U|0)<<9|o>>>23)+d|0)<<13|o>>>19)+E|0)<<18|o>>>14,m^=(o=(M^=(o=(S^=(o=(B^=(o=m+M|0)<<7|o>>>25)+m|0)<<9|o>>>23)+B|0)<<13|o>>>19)+S|0)<<18|o>>>14,k^=(o=(Y^=(o=(K^=(o=(T^=(o=k+Y|0)<<7|o>>>25)+k|0)<<9|o>>>23)+T|0)<<13|o>>>19)+K|0)<<18|o>>>14,P^=(o=(R^=(o=(z^=(o=(L^=(o=P+R|0)<<7|o>>>25)+P|0)<<9|o>>>23)+L|0)<<13|o>>>19)+z|0)<<18|o>>>14;U=U+i|0,d=d+h|0,E=E+a|0,x=x+f|0,M=M+s|0,m=m+u|0,B=B+c|0,S=S+y|0,K=K+l|0,Y=Y+v|0,k=k+w|0,T=T+p|0,L=L+b|0,z=z+g|0,R=R+_|0,P=P+A|0,r[0]=U>>>0&255,r[1]=U>>>8&255,r[2]=U>>>16&255,r[3]=U>>>24&255,r[4]=d>>>0&255,r[5]=d>>>8&255,r[6]=d>>>16&255,r[7]=d>>>24&255,r[8]=E>>>0&255,r[9]=E>>>8&255,r[10]=E>>>16&255,r[11]=E>>>24&255,r[12]=x>>>0&255,r[13]=x>>>8&255,r[14]=x>>>16&255,r[15]=x>>>24&255,r[16]=M>>>0&255,r[17]=M>>>8&255,r[18]=M>>>16&255,r[19]=M>>>24&255,r[20]=m>>>0&255,r[21]=m>>>8&255,r[22]=m>>>16&255,r[23]=m>>>24&255,r[24]=B>>>0&255,r[25]=B>>>8&255,r[26]=B>>>16&255,r[27]=B>>>24&255,r[28]=S>>>0&255,r[29]=S>>>8&255,r[30]=S>>>16&255,r[31]=S>>>24&255,r[32]=K>>>0&255,r[33]=K>>>8&255,r[34]=K>>>16&255,r[35]=K>>>24&255,r[36]=Y>>>0&255,r[37]=Y>>>8&255,r[38]=Y>>>16&255,r[39]=Y>>>24&255,r[40]=k>>>0&255,r[41]=k>>>8&255,r[42]=k>>>16&255,r[43]=k>>>24&255,r[44]=T>>>0&255,r[45]=T>>>8&255,r[46]=T>>>16&255,r[47]=T>>>24&255,r[48]=L>>>0&255,r[49]=L>>>8&255,r[50]=L>>>16&255,r[51]=L>>>24&255,r[52]=z>>>0&255,r[53]=z>>>8&255,r[54]=z>>>16&255,r[55]=z>>>24&255,r[56]=R>>>0&255,r[57]=R>>>8&255,r[58]=R>>>16&255,r[59]=R>>>24&255,r[60]=P>>>0&255,r[61]=P>>>8&255,r[62]=P>>>16&255,r[63]=P>>>24&255}(r,t,n,e)}function g(r,t,n,e){!function(r,t,n,e){for(var o,i=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,h=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,a=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,f=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,s=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,u=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,c=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,y=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,l=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,v=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,w=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,p=255&n[16]|(255&n[17])<<8|(255&n[18])<<16|(255&n[19])<<24,b=255&n[20]|(255&n[21])<<8|(255&n[22])<<16|(255&n[23])<<24,g=255&n[24]|(255&n[25])<<8|(255&n[26])<<16|(255&n[27])<<24,_=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,A=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,U=0;U<20;U+=2)i^=(o=(b^=(o=(l^=(o=(s^=(o=i+b|0)<<7|o>>>25)+i|0)<<9|o>>>23)+s|0)<<13|o>>>19)+l|0)<<18|o>>>14,u^=(o=(h^=(o=(g^=(o=(v^=(o=u+h|0)<<7|o>>>25)+u|0)<<9|o>>>23)+v|0)<<13|o>>>19)+g|0)<<18|o>>>14,w^=(o=(c^=(o=(a^=(o=(_^=(o=w+c|0)<<7|o>>>25)+w|0)<<9|o>>>23)+_|0)<<13|o>>>19)+a|0)<<18|o>>>14,A^=(o=(p^=(o=(y^=(o=(f^=(o=A+p|0)<<7|o>>>25)+A|0)<<9|o>>>23)+f|0)<<13|o>>>19)+y|0)<<18|o>>>14,i^=(o=(f^=(o=(a^=(o=(h^=(o=i+f|0)<<7|o>>>25)+i|0)<<9|o>>>23)+h|0)<<13|o>>>19)+a|0)<<18|o>>>14,u^=(o=(s^=(o=(y^=(o=(c^=(o=u+s|0)<<7|o>>>25)+u|0)<<9|o>>>23)+c|0)<<13|o>>>19)+y|0)<<18|o>>>14,w^=(o=(v^=(o=(l^=(o=(p^=(o=w+v|0)<<7|o>>>25)+w|0)<<9|o>>>23)+p|0)<<13|o>>>19)+l|0)<<18|o>>>14,A^=(o=(_^=(o=(g^=(o=(b^=(o=A+_|0)<<7|o>>>25)+A|0)<<9|o>>>23)+b|0)<<13|o>>>19)+g|0)<<18|o>>>14;r[0]=i>>>0&255,r[1]=i>>>8&255,r[2]=i>>>16&255,r[3]=i>>>24&255,r[4]=u>>>0&255,r[5]=u>>>8&255,r[6]=u>>>16&255,r[7]=u>>>24&255,r[8]=w>>>0&255,r[9]=w>>>8&255,r[10]=w>>>16&255,r[11]=w>>>24&255,r[12]=A>>>0&255,r[13]=A>>>8&255,r[14]=A>>>16&255,r[15]=A>>>24&255,r[16]=c>>>0&255,r[17]=c>>>8&255,r[18]=c>>>16&255,r[19]=c>>>24&255,r[20]=y>>>0&255,r[21]=y>>>8&255,r[22]=y>>>16&255,r[23]=y>>>24&255,r[24]=l>>>0&255,r[25]=l>>>8&255,r[26]=l>>>16&255,r[27]=l>>>24&255,r[28]=v>>>0&255,r[29]=v>>>8&255,r[30]=v>>>16&255,r[31]=v>>>24&255}(r,t,n,e)}var _=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function A(r,t,n,e,o,i,h){var a,f,s=new Uint8Array(16),u=new Uint8Array(64);for(f=0;f<16;f++)s[f]=0;for(f=0;f<8;f++)s[f]=i[f];for(;o>=64;){for(b(u,s,h,_),f=0;f<64;f++)r[t+f]=n[e+f]^u[f];for(a=1,f=8;f<16;f++)a=a+(255&s[f])|0,s[f]=255&a,a>>>=8;o-=64,t+=64,e+=64}if(o>0)for(b(u,s,h,_),f=0;f=64;){for(b(f,a,o,_),h=0;h<64;h++)r[t+h]=f[h];for(i=1,h=8;h<16;h++)i=i+(255&a[h])|0,a[h]=255&i,i>>>=8;n-=64,t+=64}if(n>0)for(b(f,a,o,_),h=0;h>>13|n<<3),e=255&r[4]|(255&r[5])<<8,this.r[2]=7939&(n>>>10|e<<6),o=255&r[6]|(255&r[7])<<8,this.r[3]=8191&(e>>>7|o<<9),i=255&r[8]|(255&r[9])<<8,this.r[4]=255&(o>>>4|i<<12),this.r[5]=i>>>1&8190,h=255&r[10]|(255&r[11])<<8,this.r[6]=8191&(i>>>14|h<<2),a=255&r[12]|(255&r[13])<<8,this.r[7]=8065&(h>>>11|a<<5),f=255&r[14]|(255&r[15])<<8,this.r[8]=8191&(a>>>8|f<<8),this.r[9]=f>>>5&127,this.pad[0]=255&r[16]|(255&r[17])<<8,this.pad[1]=255&r[18]|(255&r[19])<<8,this.pad[2]=255&r[20]|(255&r[21])<<8,this.pad[3]=255&r[22]|(255&r[23])<<8,this.pad[4]=255&r[24]|(255&r[25])<<8,this.pad[5]=255&r[26]|(255&r[27])<<8,this.pad[6]=255&r[28]|(255&r[29])<<8,this.pad[7]=255&r[30]|(255&r[31])<<8};function M(r,t,n,e,o,i){var h=new x(i);return h.update(n,e,o),h.finish(r,t),0}function m(r,t,n,e,o,i){var h=new Uint8Array(16);return M(h,0,n,e,o,i),w(r,t,h,0)}function B(r,t,n,e,o){var i;if(n<32)return-1;for(E(r,0,t,0,n,e,o),M(r,16,r,32,n-32,r),i=0;i<16;i++)r[i]=0;return 0}function S(r,t,n,e,o){var i,h=new Uint8Array(32);if(n<32)return-1;if(d(h,0,32,e,o),0!==m(t,16,t,32,n-32,h))return-1;for(E(r,0,t,0,n,e,o),i=0;i<32;i++)r[i]=0;return 0}function K(r,t){var n;for(n=0;n<16;n++)r[n]=0|t[n]}function Y(r){var t,n,e=1;for(t=0;t<16;t++)n=r[t]+e+65535,e=Math.floor(n/65536),r[t]=n-65536*e;r[0]+=e-1+37*(e-1)}function k(r,t,n){for(var e,o=~(n-1),i=0;i<16;i++)e=o&(r[i]^t[i]),r[i]^=e,t[i]^=e}function T(r,n){var e,o,i,h=t(),a=t();for(e=0;e<16;e++)a[e]=n[e];for(Y(a),Y(a),Y(a),o=0;o<2;o++){for(h[0]=a[0]-65517,e=1;e<15;e++)h[e]=a[e]-65535-(h[e-1]>>16&1),h[e-1]&=65535;h[15]=a[15]-32767-(h[14]>>16&1),i=h[15]>>16&1,h[14]&=65535,k(a,h,1-i)}for(e=0;e<16;e++)r[2*e]=255&a[e],r[2*e+1]=a[e]>>8}function L(r,t){var n=new Uint8Array(32),e=new Uint8Array(32);return T(n,r),T(e,t),p(n,0,e,0)}function z(r){var t=new Uint8Array(32);return T(t,r),1&t[0]}function R(r,t){var n;for(n=0;n<16;n++)r[n]=t[2*n]+(t[2*n+1]<<8);r[15]&=32767}function P(r,t,n){for(var e=0;e<16;e++)r[e]=t[e]+n[e]}function N(r,t,n){for(var e=0;e<16;e++)r[e]=t[e]-n[e]}function O(r,t,n){var e,o,i=0,h=0,a=0,f=0,s=0,u=0,c=0,y=0,l=0,v=0,w=0,p=0,b=0,g=0,_=0,A=0,U=0,d=0,E=0,x=0,M=0,m=0,B=0,S=0,K=0,Y=0,k=0,T=0,L=0,z=0,R=0,P=n[0],N=n[1],O=n[2],C=n[3],F=n[4],I=n[5],G=n[6],Z=n[7],q=n[8],V=n[9],X=n[10],D=n[11],j=n[12],H=n[13],J=n[14],Q=n[15];i+=(e=t[0])*P,h+=e*N,a+=e*O,f+=e*C,s+=e*F,u+=e*I,c+=e*G,y+=e*Z,l+=e*q,v+=e*V,w+=e*X,p+=e*D,b+=e*j,g+=e*H,_+=e*J,A+=e*Q,h+=(e=t[1])*P,a+=e*N,f+=e*O,s+=e*C,u+=e*F,c+=e*I,y+=e*G,l+=e*Z,v+=e*q,w+=e*V,p+=e*X,b+=e*D,g+=e*j,_+=e*H,A+=e*J,U+=e*Q,a+=(e=t[2])*P,f+=e*N,s+=e*O,u+=e*C,c+=e*F,y+=e*I,l+=e*G,v+=e*Z,w+=e*q,p+=e*V,b+=e*X,g+=e*D,_+=e*j,A+=e*H,U+=e*J,d+=e*Q,f+=(e=t[3])*P,s+=e*N,u+=e*O,c+=e*C,y+=e*F,l+=e*I,v+=e*G,w+=e*Z,p+=e*q,b+=e*V,g+=e*X,_+=e*D,A+=e*j,U+=e*H,d+=e*J,E+=e*Q,s+=(e=t[4])*P,u+=e*N,c+=e*O,y+=e*C,l+=e*F,v+=e*I,w+=e*G,p+=e*Z,b+=e*q,g+=e*V,_+=e*X,A+=e*D,U+=e*j,d+=e*H,E+=e*J,x+=e*Q,u+=(e=t[5])*P,c+=e*N,y+=e*O,l+=e*C,v+=e*F,w+=e*I,p+=e*G,b+=e*Z,g+=e*q,_+=e*V,A+=e*X,U+=e*D,d+=e*j,E+=e*H,x+=e*J,M+=e*Q,c+=(e=t[6])*P,y+=e*N,l+=e*O,v+=e*C,w+=e*F,p+=e*I,b+=e*G,g+=e*Z,_+=e*q,A+=e*V,U+=e*X,d+=e*D,E+=e*j,x+=e*H,M+=e*J,m+=e*Q,y+=(e=t[7])*P,l+=e*N,v+=e*O,w+=e*C,p+=e*F,b+=e*I,g+=e*G,_+=e*Z,A+=e*q,U+=e*V,d+=e*X,E+=e*D,x+=e*j,M+=e*H,m+=e*J,B+=e*Q,l+=(e=t[8])*P,v+=e*N,w+=e*O,p+=e*C,b+=e*F,g+=e*I,_+=e*G,A+=e*Z,U+=e*q,d+=e*V,E+=e*X,x+=e*D,M+=e*j,m+=e*H,B+=e*J,S+=e*Q,v+=(e=t[9])*P,w+=e*N,p+=e*O,b+=e*C,g+=e*F,_+=e*I,A+=e*G,U+=e*Z,d+=e*q,E+=e*V,x+=e*X,M+=e*D,m+=e*j,B+=e*H,S+=e*J,K+=e*Q,w+=(e=t[10])*P,p+=e*N,b+=e*O,g+=e*C,_+=e*F,A+=e*I,U+=e*G,d+=e*Z,E+=e*q,x+=e*V,M+=e*X,m+=e*D,B+=e*j,S+=e*H,K+=e*J,Y+=e*Q,p+=(e=t[11])*P,b+=e*N,g+=e*O,_+=e*C,A+=e*F,U+=e*I,d+=e*G,E+=e*Z,x+=e*q,M+=e*V,m+=e*X,B+=e*D,S+=e*j,K+=e*H,Y+=e*J,k+=e*Q,b+=(e=t[12])*P,g+=e*N,_+=e*O,A+=e*C,U+=e*F,d+=e*I,E+=e*G,x+=e*Z,M+=e*q,m+=e*V,B+=e*X,S+=e*D,K+=e*j,Y+=e*H,k+=e*J,T+=e*Q,g+=(e=t[13])*P,_+=e*N,A+=e*O,U+=e*C,d+=e*F,E+=e*I,x+=e*G,M+=e*Z,m+=e*q,B+=e*V,S+=e*X,K+=e*D,Y+=e*j,k+=e*H,T+=e*J,L+=e*Q,_+=(e=t[14])*P,A+=e*N,U+=e*O,d+=e*C,E+=e*F,x+=e*I,M+=e*G,m+=e*Z,B+=e*q,S+=e*V,K+=e*X,Y+=e*D,k+=e*j,T+=e*H,L+=e*J,z+=e*Q,A+=(e=t[15])*P,h+=38*(d+=e*O),a+=38*(E+=e*C),f+=38*(x+=e*F),s+=38*(M+=e*I),u+=38*(m+=e*G),c+=38*(B+=e*Z),y+=38*(S+=e*q),l+=38*(K+=e*V),v+=38*(Y+=e*X),w+=38*(k+=e*D),p+=38*(T+=e*j),b+=38*(L+=e*H),g+=38*(z+=e*J),_+=38*(R+=e*Q),i=(e=(i+=38*(U+=e*N))+(o=1)+65535)-65536*(o=Math.floor(e/65536)),h=(e=h+o+65535)-65536*(o=Math.floor(e/65536)),a=(e=a+o+65535)-65536*(o=Math.floor(e/65536)),f=(e=f+o+65535)-65536*(o=Math.floor(e/65536)),s=(e=s+o+65535)-65536*(o=Math.floor(e/65536)),u=(e=u+o+65535)-65536*(o=Math.floor(e/65536)),c=(e=c+o+65535)-65536*(o=Math.floor(e/65536)),y=(e=y+o+65535)-65536*(o=Math.floor(e/65536)),l=(e=l+o+65535)-65536*(o=Math.floor(e/65536)),v=(e=v+o+65535)-65536*(o=Math.floor(e/65536)),w=(e=w+o+65535)-65536*(o=Math.floor(e/65536)),p=(e=p+o+65535)-65536*(o=Math.floor(e/65536)),b=(e=b+o+65535)-65536*(o=Math.floor(e/65536)),g=(e=g+o+65535)-65536*(o=Math.floor(e/65536)),_=(e=_+o+65535)-65536*(o=Math.floor(e/65536)),A=(e=A+o+65535)-65536*(o=Math.floor(e/65536)),i=(e=(i+=o-1+37*(o-1))+(o=1)+65535)-65536*(o=Math.floor(e/65536)),h=(e=h+o+65535)-65536*(o=Math.floor(e/65536)),a=(e=a+o+65535)-65536*(o=Math.floor(e/65536)),f=(e=f+o+65535)-65536*(o=Math.floor(e/65536)),s=(e=s+o+65535)-65536*(o=Math.floor(e/65536)),u=(e=u+o+65535)-65536*(o=Math.floor(e/65536)),c=(e=c+o+65535)-65536*(o=Math.floor(e/65536)),y=(e=y+o+65535)-65536*(o=Math.floor(e/65536)),l=(e=l+o+65535)-65536*(o=Math.floor(e/65536)),v=(e=v+o+65535)-65536*(o=Math.floor(e/65536)),w=(e=w+o+65535)-65536*(o=Math.floor(e/65536)),p=(e=p+o+65535)-65536*(o=Math.floor(e/65536)),b=(e=b+o+65535)-65536*(o=Math.floor(e/65536)),g=(e=g+o+65535)-65536*(o=Math.floor(e/65536)),_=(e=_+o+65535)-65536*(o=Math.floor(e/65536)),A=(e=A+o+65535)-65536*(o=Math.floor(e/65536)),i+=o-1+37*(o-1),r[0]=i,r[1]=h,r[2]=a,r[3]=f,r[4]=s,r[5]=u,r[6]=c,r[7]=y,r[8]=l,r[9]=v,r[10]=w,r[11]=p,r[12]=b,r[13]=g,r[14]=_,r[15]=A}function C(r,t){O(r,t,t)}function F(r,n){var e,o=t();for(e=0;e<16;e++)o[e]=n[e];for(e=253;e>=0;e--)C(o,o),2!==e&&4!==e&&O(o,o,n);for(e=0;e<16;e++)r[e]=o[e]}function I(r,n,e){var o,i,h=new Uint8Array(32),f=new Float64Array(80),s=t(),u=t(),c=t(),y=t(),l=t(),v=t();for(i=0;i<31;i++)h[i]=n[i];for(h[31]=127&n[31]|64,h[0]&=248,R(f,e),i=0;i<16;i++)u[i]=f[i],y[i]=s[i]=c[i]=0;for(s[0]=y[0]=1,i=254;i>=0;--i)k(s,u,o=h[i>>>3]>>>(7&i)&1),k(c,y,o),P(l,s,c),N(s,s,c),P(c,u,y),N(u,u,y),C(y,l),C(v,s),O(s,c,s),O(c,u,l),P(l,s,c),N(s,s,c),C(u,s),N(c,y,v),O(s,c,a),P(s,s,y),O(c,c,s),O(s,y,v),O(y,u,f),C(u,l),k(s,u,o),k(c,y,o);for(i=0;i<16;i++)f[i+16]=s[i],f[i+32]=c[i],f[i+48]=u[i],f[i+64]=y[i];var w=f.subarray(32),p=f.subarray(16);return F(w,w),O(p,p,w),T(r,p),0}function G(r,t){return I(r,t,o)}function Z(r,t){return n(t,32),G(r,t)}function q(r,t,n){var o=new Uint8Array(32);return I(o,n,t),g(r,e,o,_)}x.prototype.blocks=function(r,t,n){for(var e,o,i,h,a,f,s,u,c,y,l,v,w,p,b,g,_,A,U,d=this.fin?0:2048,E=this.h[0],x=this.h[1],M=this.h[2],m=this.h[3],B=this.h[4],S=this.h[5],K=this.h[6],Y=this.h[7],k=this.h[8],T=this.h[9],L=this.r[0],z=this.r[1],R=this.r[2],P=this.r[3],N=this.r[4],O=this.r[5],C=this.r[6],F=this.r[7],I=this.r[8],G=this.r[9];n>=16;)y=c=0,y+=(E+=8191&(e=255&r[t+0]|(255&r[t+1])<<8))*L,y+=(x+=8191&(e>>>13|(o=255&r[t+2]|(255&r[t+3])<<8)<<3))*(5*G),y+=(M+=8191&(o>>>10|(i=255&r[t+4]|(255&r[t+5])<<8)<<6))*(5*I),y+=(m+=8191&(i>>>7|(h=255&r[t+6]|(255&r[t+7])<<8)<<9))*(5*F),c=(y+=(B+=8191&(h>>>4|(a=255&r[t+8]|(255&r[t+9])<<8)<<12))*(5*C))>>>13,y&=8191,y+=(S+=a>>>1&8191)*(5*O),y+=(K+=8191&(a>>>14|(f=255&r[t+10]|(255&r[t+11])<<8)<<2))*(5*N),y+=(Y+=8191&(f>>>11|(s=255&r[t+12]|(255&r[t+13])<<8)<<5))*(5*P),y+=(k+=8191&(s>>>8|(u=255&r[t+14]|(255&r[t+15])<<8)<<8))*(5*R),l=c+=(y+=(T+=u>>>5|d)*(5*z))>>>13,l+=E*z,l+=x*L,l+=M*(5*G),l+=m*(5*I),c=(l+=B*(5*F))>>>13,l&=8191,l+=S*(5*C),l+=K*(5*O),l+=Y*(5*N),l+=k*(5*P),c+=(l+=T*(5*R))>>>13,l&=8191,v=c,v+=E*R,v+=x*z,v+=M*L,v+=m*(5*G),c=(v+=B*(5*I))>>>13,v&=8191,v+=S*(5*F),v+=K*(5*C),v+=Y*(5*O),v+=k*(5*N),w=c+=(v+=T*(5*P))>>>13,w+=E*P,w+=x*R,w+=M*z,w+=m*L,c=(w+=B*(5*G))>>>13,w&=8191,w+=S*(5*I),w+=K*(5*F),w+=Y*(5*C),w+=k*(5*O),p=c+=(w+=T*(5*N))>>>13,p+=E*N,p+=x*P,p+=M*R,p+=m*z,c=(p+=B*L)>>>13,p&=8191,p+=S*(5*G),p+=K*(5*I),p+=Y*(5*F),p+=k*(5*C),b=c+=(p+=T*(5*O))>>>13,b+=E*O,b+=x*N,b+=M*P,b+=m*R,c=(b+=B*z)>>>13,b&=8191,b+=S*L,b+=K*(5*G),b+=Y*(5*I),b+=k*(5*F),g=c+=(b+=T*(5*C))>>>13,g+=E*C,g+=x*O,g+=M*N,g+=m*P,c=(g+=B*R)>>>13,g&=8191,g+=S*z,g+=K*L,g+=Y*(5*G),g+=k*(5*I),_=c+=(g+=T*(5*F))>>>13,_+=E*F,_+=x*C,_+=M*O,_+=m*N,c=(_+=B*P)>>>13,_&=8191,_+=S*R,_+=K*z,_+=Y*L,_+=k*(5*G),A=c+=(_+=T*(5*I))>>>13,A+=E*I,A+=x*F,A+=M*C,A+=m*O,c=(A+=B*N)>>>13,A&=8191,A+=S*P,A+=K*R,A+=Y*z,A+=k*L,U=c+=(A+=T*(5*G))>>>13,U+=E*G,U+=x*I,U+=M*F,U+=m*C,c=(U+=B*O)>>>13,U&=8191,U+=S*N,U+=K*P,U+=Y*R,U+=k*z,E=y=8191&(c=(c=((c+=(U+=T*L)>>>13)<<2)+c|0)+(y&=8191)|0),x=l+=c>>>=13,M=v&=8191,m=w&=8191,B=p&=8191,S=b&=8191,K=g&=8191,Y=_&=8191,k=A&=8191,T=U&=8191,t+=16,n-=16;this.h[0]=E,this.h[1]=x,this.h[2]=M,this.h[3]=m,this.h[4]=B,this.h[5]=S,this.h[6]=K,this.h[7]=Y,this.h[8]=k,this.h[9]=T},x.prototype.finish=function(r,t){var n,e,o,i,h=new Uint16Array(10);if(this.leftover){for(i=this.leftover,this.buffer[i++]=1;i<16;i++)this.buffer[i]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(n=this.h[1]>>>13,this.h[1]&=8191,i=2;i<10;i++)this.h[i]+=n,n=this.h[i]>>>13,this.h[i]&=8191;for(this.h[0]+=5*n,n=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=n,n=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=n,h[0]=this.h[0]+5,n=h[0]>>>13,h[0]&=8191,i=1;i<10;i++)h[i]=this.h[i]+n,n=h[i]>>>13,h[i]&=8191;for(h[9]-=8192,e=(1^n)-1,i=0;i<10;i++)h[i]&=e;for(e=~e,i=0;i<10;i++)this.h[i]=this.h[i]&e|h[i];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),o=this.h[0]+this.pad[0],this.h[0]=65535&o,i=1;i<8;i++)o=(this.h[i]+this.pad[i]|0)+(o>>>16)|0,this.h[i]=65535&o;r[t+0]=this.h[0]>>>0&255,r[t+1]=this.h[0]>>>8&255,r[t+2]=this.h[1]>>>0&255,r[t+3]=this.h[1]>>>8&255,r[t+4]=this.h[2]>>>0&255,r[t+5]=this.h[2]>>>8&255,r[t+6]=this.h[3]>>>0&255,r[t+7]=this.h[3]>>>8&255,r[t+8]=this.h[4]>>>0&255,r[t+9]=this.h[4]>>>8&255,r[t+10]=this.h[5]>>>0&255,r[t+11]=this.h[5]>>>8&255,r[t+12]=this.h[6]>>>0&255,r[t+13]=this.h[6]>>>8&255,r[t+14]=this.h[7]>>>0&255,r[t+15]=this.h[7]>>>8&255},x.prototype.update=function(r,t,n){var e,o;if(this.leftover){for((o=16-this.leftover)>n&&(o=n),e=0;e=16&&(o=n-n%16,this.blocks(r,t,o),t+=o,n-=o),n){for(e=0;e=128;){for(d=0;d<16;d++)E=8*d+H,Y[d]=n[E+0]<<24|n[E+1]<<16|n[E+2]<<8|n[E+3],k[d]=n[E+4]<<24|n[E+5]<<16|n[E+6]<<8|n[E+7];for(d=0;d<80;d++)if(o=T,i=L,h=z,a=R,f=P,s=N,u=O,C,y=F,l=I,v=G,w=Z,p=q,b=V,g=X,j,m=65535&(M=j),B=M>>>16,S=65535&(x=C),K=x>>>16,m+=65535&(M=(q>>>14|P<<18)^(q>>>18|P<<14)^(P>>>9|q<<23)),B+=M>>>16,S+=65535&(x=(P>>>14|q<<18)^(P>>>18|q<<14)^(q>>>9|P<<23)),K+=x>>>16,m+=65535&(M=q&V^~q&X),B+=M>>>16,S+=65535&(x=P&N^~P&O),K+=x>>>16,x=D[2*d],m+=65535&(M=D[2*d+1]),B+=M>>>16,S+=65535&x,K+=x>>>16,x=Y[d%16],B+=(M=k[d%16])>>>16,S+=65535&x,K+=x>>>16,S+=(B+=(m+=65535&M)>>>16)>>>16,m=65535&(M=U=65535&m|B<<16),B=M>>>16,S=65535&(x=A=65535&S|(K+=S>>>16)<<16),K=x>>>16,m+=65535&(M=(F>>>28|T<<4)^(T>>>2|F<<30)^(T>>>7|F<<25)),B+=M>>>16,S+=65535&(x=(T>>>28|F<<4)^(F>>>2|T<<30)^(F>>>7|T<<25)),K+=x>>>16,B+=(M=F&I^F&G^I&G)>>>16,S+=65535&(x=T&L^T&z^L&z),K+=x>>>16,c=65535&(S+=(B+=(m+=65535&M)>>>16)>>>16)|(K+=S>>>16)<<16,_=65535&m|B<<16,m=65535&(M=w),B=M>>>16,S=65535&(x=a),K=x>>>16,B+=(M=U)>>>16,S+=65535&(x=A),K+=x>>>16,L=o,z=i,R=h,P=a=65535&(S+=(B+=(m+=65535&M)>>>16)>>>16)|(K+=S>>>16)<<16,N=f,O=s,C=u,T=c,I=y,G=l,Z=v,q=w=65535&m|B<<16,V=p,X=b,j=g,F=_,d%16==15)for(E=0;E<16;E++)x=Y[E],m=65535&(M=k[E]),B=M>>>16,S=65535&x,K=x>>>16,x=Y[(E+9)%16],m+=65535&(M=k[(E+9)%16]),B+=M>>>16,S+=65535&x,K+=x>>>16,A=Y[(E+1)%16],m+=65535&(M=((U=k[(E+1)%16])>>>1|A<<31)^(U>>>8|A<<24)^(U>>>7|A<<25)),B+=M>>>16,S+=65535&(x=(A>>>1|U<<31)^(A>>>8|U<<24)^A>>>7),K+=x>>>16,A=Y[(E+14)%16],B+=(M=((U=k[(E+14)%16])>>>19|A<<13)^(A>>>29|U<<3)^(U>>>6|A<<26))>>>16,S+=65535&(x=(A>>>19|U<<13)^(U>>>29|A<<3)^A>>>6),K+=x>>>16,K+=(S+=(B+=(m+=65535&M)>>>16)>>>16)>>>16,Y[E]=65535&S|K<<16,k[E]=65535&m|B<<16;m=65535&(M=F),B=M>>>16,S=65535&(x=T),K=x>>>16,x=r[0],B+=(M=t[0])>>>16,S+=65535&x,K+=x>>>16,K+=(S+=(B+=(m+=65535&M)>>>16)>>>16)>>>16,r[0]=T=65535&S|K<<16,t[0]=F=65535&m|B<<16,m=65535&(M=I),B=M>>>16,S=65535&(x=L),K=x>>>16,x=r[1],B+=(M=t[1])>>>16,S+=65535&x,K+=x>>>16,K+=(S+=(B+=(m+=65535&M)>>>16)>>>16)>>>16,r[1]=L=65535&S|K<<16,t[1]=I=65535&m|B<<16,m=65535&(M=G),B=M>>>16,S=65535&(x=z),K=x>>>16,x=r[2],B+=(M=t[2])>>>16,S+=65535&x,K+=x>>>16,K+=(S+=(B+=(m+=65535&M)>>>16)>>>16)>>>16,r[2]=z=65535&S|K<<16,t[2]=G=65535&m|B<<16,m=65535&(M=Z),B=M>>>16,S=65535&(x=R),K=x>>>16,x=r[3],B+=(M=t[3])>>>16,S+=65535&x,K+=x>>>16,K+=(S+=(B+=(m+=65535&M)>>>16)>>>16)>>>16,r[3]=R=65535&S|K<<16,t[3]=Z=65535&m|B<<16,m=65535&(M=q),B=M>>>16,S=65535&(x=P),K=x>>>16,x=r[4],B+=(M=t[4])>>>16,S+=65535&x,K+=x>>>16,K+=(S+=(B+=(m+=65535&M)>>>16)>>>16)>>>16,r[4]=P=65535&S|K<<16,t[4]=q=65535&m|B<<16,m=65535&(M=V),B=M>>>16,S=65535&(x=N),K=x>>>16,x=r[5],B+=(M=t[5])>>>16,S+=65535&x,K+=x>>>16,K+=(S+=(B+=(m+=65535&M)>>>16)>>>16)>>>16,r[5]=N=65535&S|K<<16,t[5]=V=65535&m|B<<16,m=65535&(M=X),B=M>>>16,S=65535&(x=O),K=x>>>16,x=r[6],B+=(M=t[6])>>>16,S+=65535&x,K+=x>>>16,K+=(S+=(B+=(m+=65535&M)>>>16)>>>16)>>>16,r[6]=O=65535&S|K<<16,t[6]=X=65535&m|B<<16,m=65535&(M=j),B=M>>>16,S=65535&(x=C),K=x>>>16,x=r[7],B+=(M=t[7])>>>16,S+=65535&x,K+=x>>>16,K+=(S+=(B+=(m+=65535&M)>>>16)>>>16)>>>16,r[7]=C=65535&S|K<<16,t[7]=j=65535&m|B<<16,H+=128,e-=128}return e}function H(r,t,n){var e,o=new Int32Array(8),i=new Int32Array(8),h=new Uint8Array(256),a=n;for(o[0]=1779033703,o[1]=3144134277,o[2]=1013904242,o[3]=2773480762,o[4]=1359893119,o[5]=2600822924,o[6]=528734635,o[7]=1541459225,i[0]=4089235720,i[1]=2227873595,i[2]=4271175723,i[3]=1595750129,i[4]=2917565137,i[5]=725511199,i[6]=4215389547,i[7]=327033209,j(o,i,t,n),n%=128,e=0;e=0;--o)Q(r,t,e=n[o/8|0]>>(7&o)&1),J(t,r),J(r,r),Q(r,t,e)}function rr(r,n){var e=[t(),t(),t(),t()];K(e[0],u),K(e[1],c),K(e[2],h),O(e[3],u,c),$(r,e,n)}function tr(r,e,o){var i,h=new Uint8Array(64),a=[t(),t(),t(),t()];for(o||n(e,32),H(h,e,32),h[0]&=248,h[31]&=127,h[31]|=64,rr(a,h),W(r,a),i=0;i<32;i++)e[i+32]=r[i];return 0}var nr=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function er(r,t){var n,e,o,i;for(e=63;e>=32;--e){for(n=0,o=e-32,i=e-12;o>8,t[o]-=256*n;t[o]+=n,t[e]=0}for(n=0,o=0;o<32;o++)t[o]+=n-(t[31]>>4)*nr[o],n=t[o]>>8,t[o]&=255;for(o=0;o<32;o++)t[o]-=n*nr[o];for(e=0;e<32;e++)t[e+1]+=t[e]>>8,r[e]=255&t[e]}function or(r){var t,n=new Float64Array(64);for(t=0;t<64;t++)n[t]=r[t];for(t=0;t<64;t++)r[t]=0;er(r,n)}function ir(r,n,e,o){var i,h,a=new Uint8Array(64),f=new Uint8Array(64),s=new Uint8Array(64),u=new Float64Array(64),c=[t(),t(),t(),t()];H(a,o,32),a[0]&=248,a[31]&=127,a[31]|=64;var y=e+64;for(i=0;i=0;e--)C(o,o),1!==e&&O(o,o,n);for(e=0;e<16;e++)r[e]=o[e]}(e,e),O(e,e,a),O(e,e,s),O(e,e,s),O(r[0],e,s),C(o,r[0]),O(o,o,s),L(o,a)&&O(r[0],r[0],y),C(o,r[0]),O(o,o,s),L(o,a)?-1:(z(r[0])===n[31]>>7&&N(r[0],i,r[0]),O(r[3],r[0],r[1]),0)}function ar(r,n,e,o){var i,h=new Uint8Array(32),a=new Uint8Array(64),f=[t(),t(),t(),t()],s=[t(),t(),t(),t()];if(-1,e<64)return-1;if(hr(s,o))return-1;for(i=0;i=0},r.sign.keyPair=function(){var r=new Uint8Array(32),t=new Uint8Array(64);return tr(r,t),{publicKey:r,secretKey:t}},r.sign.keyPair.fromSecretKey=function(r){if(vr(r),64!==r.length)throw new Error("bad secret key size");for(var t=new Uint8Array(32),n=0;n=i)return e;switch(e){case"%s":return String(n[t++]);case"%d":return Number(n[t++]);case"%j":try{return JSON.stringify(n[t++])}catch(e){return"[Circular]"}default:return e}}),s=n[t];t=3&&(t.depth=arguments[2]),arguments.length>=4&&(t.colors=arguments[3]),isBoolean(r)?t.showHidden=r:r&&exports._extend(t,r),isUndefined(t.showHidden)&&(t.showHidden=!1),isUndefined(t.depth)&&(t.depth=2),isUndefined(t.colors)&&(t.colors=!1),isUndefined(t.customInspect)&&(t.customInspect=!0),t.colors&&(t.stylize=stylizeWithColor),formatValue(t,e,t.depth)}function stylizeWithColor(e,r){var t=inspect.styles[r];return t?"["+inspect.colors[t][0]+"m"+e+"["+inspect.colors[t][1]+"m":e}function stylizeNoColor(e,r){return e}function arrayToHash(e){var r={};return e.forEach(function(e,t){r[e]=!0}),r}function formatValue(e,r,t){if(e.customInspect&&r&&isFunction(r.inspect)&&r.inspect!==exports.inspect&&(!r.constructor||r.constructor.prototype!==r)){var n=r.inspect(t,e);return isString(n)||(n=formatValue(e,n,t)),n}var i=formatPrimitive(e,r);if(i)return i;var o=Object.keys(r),s=arrayToHash(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(r)),isError(r)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return formatError(r);if(0===o.length){if(isFunction(r)){var u=r.name?": "+r.name:"";return e.stylize("[Function"+u+"]","special")}if(isRegExp(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(isDate(r))return e.stylize(Date.prototype.toString.call(r),"date");if(isError(r))return formatError(r)}var c,a="",l=!1,p=["{","}"];(isArray(r)&&(l=!0,p=["[","]"]),isFunction(r))&&(a=" [Function"+(r.name?": "+r.name:"")+"]");return isRegExp(r)&&(a=" "+RegExp.prototype.toString.call(r)),isDate(r)&&(a=" "+Date.prototype.toUTCString.call(r)),isError(r)&&(a=" "+formatError(r)),0!==o.length||l&&0!=r.length?t<0?isRegExp(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),c=l?formatArray(e,r,t,s,o):o.map(function(n){return formatProperty(e,r,t,s,n,l)}),e.seen.pop(),reduceToSingleString(c,a,p)):p[0]+a+p[1]}function formatPrimitive(e,r){if(isUndefined(r))return e.stylize("undefined","undefined");if(isString(r)){var t="'"+JSON.stringify(r).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(t,"string")}return isNumber(r)?e.stylize(""+r,"number"):isBoolean(r)?e.stylize(""+r,"boolean"):isNull(r)?e.stylize("null","null"):void 0}function formatError(e){return"["+Error.prototype.toString.call(e)+"]"}function formatArray(e,r,t,n,i){for(var o=[],s=0,u=r.length;s-1&&(u=o?u.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+u.split("\n").map(function(e){return" "+e}).join("\n")):u=e.stylize("[Circular]","special")),isUndefined(s)){if(o&&i.match(/^\d+$/))return u;(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+u}function reduceToSingleString(e,r,t){return e.reduce(function(e,r){return 0,r.indexOf("\n")>=0&&0,e+r.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?t[0]+(""===r?"":r+"\n ")+" "+e.join(",\n ")+" "+t[1]:t[0]+r+" "+e.join(", ")+" "+t[1]}function isArray(e){return Array.isArray(e)}function isBoolean(e){return"boolean"==typeof e}function isNull(e){return null===e}function isNullOrUndefined(e){return null==e}function isNumber(e){return"number"==typeof e}function isString(e){return"string"==typeof e}function isSymbol(e){return"symbol"==typeof e}function isUndefined(e){return void 0===e}function isRegExp(e){return isObject(e)&&"[object RegExp]"===objectToString(e)}function isObject(e){return"object"==typeof e&&null!==e}function isDate(e){return isObject(e)&&"[object Date]"===objectToString(e)}function isError(e){return isObject(e)&&("[object Error]"===objectToString(e)||e instanceof Error)}function isFunction(e){return"function"==typeof e}function isPrimitive(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e}function objectToString(e){return Object.prototype.toString.call(e)}function pad(e){return e<10?"0"+e.toString(10):e.toString(10)}exports.debuglog=function(e){if(isUndefined(debugEnviron)&&(debugEnviron=process.env.NODE_DEBUG||""),e=e.toUpperCase(),!debugs[e])if(new RegExp("\\b"+e+"\\b","i").test(debugEnviron)){var r=process.pid;debugs[e]=function(){var t=exports.format.apply(exports,arguments);console.error("%s %d: %s",e,r,t)}}else debugs[e]=function(){};return debugs[e]},exports.inspect=inspect,inspect.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},inspect.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},exports.isArray=isArray,exports.isBoolean=isBoolean,exports.isNull=isNull,exports.isNullOrUndefined=isNullOrUndefined,exports.isNumber=isNumber,exports.isString=isString,exports.isSymbol=isSymbol,exports.isUndefined=isUndefined,exports.isRegExp=isRegExp,exports.isObject=isObject,exports.isDate=isDate,exports.isError=isError,exports.isFunction=isFunction,exports.isPrimitive=isPrimitive,exports.isBuffer=require("./support/isBuffer");var months=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function timestamp(){var e=new Date,r=[pad(e.getHours()),pad(e.getMinutes()),pad(e.getSeconds())].join(":");return[e.getDate(),months[e.getMonth()],r].join(" ")}function hasOwnProperty(e,r){return Object.prototype.hasOwnProperty.call(e,r)}exports.log=function(){console.log("%s - %s",timestamp(),exports.format.apply(exports,arguments))},exports.inherits=require("inherits"),exports._extend=function(e,r){if(!r||!isObject(r))return e;for(var t=Object.keys(r),n=t.length;n--;)e[t[n]]=r[t[n]];return e}; }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"./support/isBuffer":85,"_process":63,"inherits":57}]},{},[1]); +},{"./support/isBuffer":66,"_process":55,"inherits":49}]},{},[1]); diff --git a/docs/SUMMARY.md b/docs/SUMMARY.md index 7239c207e9..91ab8f124a 100644 --- a/docs/SUMMARY.md +++ b/docs/SUMMARY.md @@ -38,18 +38,42 @@ * [TotalWeight](interfaces/_providers_provider_.totalweight.md) * [Transaction](interfaces/_providers_provider_.transaction.md) * [TransactionLog](interfaces/_providers_provider_.transactionlog.md) + * [TransactionResult](interfaces/_providers_provider_.transactionresult.md) * ["signer"](modules/_signer_.md) * [InMemorySigner](classes/_signer_.inmemorysigner.md) * [Signer](classes/_signer_.signer.md) * ["transaction"](modules/_transaction_.md) + * [AccessKey](classes/_transaction_.accesskey.md) + * [AccessKeyPermission](classes/_transaction_.accesskeypermission.md) + * [Action](classes/_transaction_.action.md) + * [AddKey](classes/_transaction_.addkey.md) + * [Assignable](classes/_transaction_.assignable.md) + * [CreateAccount](classes/_transaction_.createaccount.md) + * [DeleteAccount](classes/_transaction_.deleteaccount.md) + * [DeleteKey](classes/_transaction_.deletekey.md) + * [DeployContract](classes/_transaction_.deploycontract.md) + * [Enum](classes/_transaction_.enum.md) + * [FullAccessPermission](classes/_transaction_.fullaccesspermission.md) + * [FunctionCall](classes/_transaction_.functioncall.md) + * [FunctionCallPermission](classes/_transaction_.functioncallpermission.md) + * [IAction](classes/_transaction_.iaction.md) + * [Signature](classes/_transaction_.signature.md) + * [SignedTransaction](classes/_transaction_.signedtransaction.md) + * [Stake](classes/_transaction_.stake.md) + * [Transaction](classes/_transaction_.transaction.md) + * [Transfer](classes/_transaction_.transfer.md) * ["utils/index"](modules/_utils_index_.md) * ["utils/key_pair"](modules/_utils_key_pair_.md) + * [KeyType](enums/_utils_key_pair_.keytype.md) * [KeyPair](classes/_utils_key_pair_.keypair.md) * [KeyPairEd25519](classes/_utils_key_pair_.keypaired25519.md) + * [PublicKey](classes/_utils_key_pair_.publickey.md) * [Signature](interfaces/_utils_key_pair_.signature.md) * ["utils/network"](modules/_utils_network_.md) * [Network](interfaces/_utils_network_.network.md) * ["utils/serialize"](modules/_utils_serialize_.md) + * [BinaryReader](classes/_utils_serialize_.binaryreader.md) + * [BinaryWriter](classes/_utils_serialize_.binarywriter.md) * ["utils/web"](modules/_utils_web_.md) * [ConnectionInfo](interfaces/_utils_web_.connectioninfo.md) * ["wallet-account"](modules/_wallet_account_.md) diff --git a/docs/classes/_account_.account.md b/docs/classes/_account_.account.md index 03e9913d28..d30b6fa495 100644 --- a/docs/classes/_account_.account.md +++ b/docs/classes/_account_.account.md @@ -12,7 +12,7 @@ ⊕ **new Account**(connection: *[Connection](_connection_.connection.md)*, accountId: *`string`*): [Account](_account_.account.md) -*Defined in [account.ts:46](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/account.ts#L46)* +*Defined in [account.ts:46](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/account.ts#L46)* **Parameters:** @@ -27,13 +27,22 @@ ___ # Properties + + +## `` _accessKey + +**● _accessKey**: *[AccessKey](_transaction_.accesskey.md)* + +*Defined in [account.ts:41](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/account.ts#L41)* + +___ ## `` _ready **● _ready**: *`Promise`<`void`>* -*Defined in [account.ts:43](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/account.ts#L43)* +*Defined in [account.ts:43](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/account.ts#L43)* ___ @@ -42,7 +51,7 @@ ___ **● _state**: *[AccountState](../interfaces/_account_.accountstate.md)* -*Defined in [account.ts:41](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/account.ts#L41)* +*Defined in [account.ts:40](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/account.ts#L40)* ___ @@ -51,7 +60,7 @@ ___ **● accountId**: *`string`* -*Defined in [account.ts:40](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/account.ts#L40)* +*Defined in [account.ts:39](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/account.ts#L39)* ___ @@ -60,7 +69,7 @@ ___ **● connection**: *[Connection](_connection_.connection.md)* -*Defined in [account.ts:39](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/account.ts#L39)* +*Defined in [account.ts:38](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/account.ts#L38)* ___ @@ -72,7 +81,7 @@ ___ **get ready**(): `Promise`<`void`> -*Defined in [account.ts:44](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/account.ts#L44)* +*Defined in [account.ts:44](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/account.ts#L44)* **Returns:** `Promise`<`void`> @@ -84,18 +93,17 @@ ___ ## addKey -▸ **addKey**(publicKey: *`string`*, contractId?: *`string`*, methodName?: *`string`*, balanceOwner?: *`string`*, amount?: *`BN`*): `Promise`<[FinalTransactionResult](../interfaces/_providers_provider_.finaltransactionresult.md)> +▸ **addKey**(publicKey: *`string` \| [PublicKey](_utils_key_pair_.publickey.md)*, contractId?: *`string`*, methodName?: *`string`*, amount?: *`BN`*): `Promise`<[FinalTransactionResult](../interfaces/_providers_provider_.finaltransactionresult.md)> -*Defined in [account.ts:155](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/account.ts#L155)* +*Defined in [account.ts:157](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/account.ts#L157)* **Parameters:** | Name | Type | | ------ | ------ | -| publicKey | `string` | +| publicKey | `string` \| [PublicKey](_utils_key_pair_.publickey.md) | | `Optional` contractId | `string` | | `Optional` methodName | `string` | -| `Optional` balanceOwner | `string` | | `Optional` amount | `BN` | **Returns:** `Promise`<[FinalTransactionResult](../interfaces/_providers_provider_.finaltransactionresult.md)> @@ -105,16 +113,16 @@ ___ ## createAccount -▸ **createAccount**(newAccountId: *`string`*, publicKey: *`string`*, amount: *`BN`*): `Promise`<[FinalTransactionResult](../interfaces/_providers_provider_.finaltransactionresult.md)> +▸ **createAccount**(newAccountId: *`string`*, publicKey: *`string` \| [PublicKey](_utils_key_pair_.publickey.md)*, amount: *`BN`*): `Promise`<[FinalTransactionResult](../interfaces/_providers_provider_.finaltransactionresult.md)> -*Defined in [account.ts:134](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/account.ts#L134)* +*Defined in [account.ts:140](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/account.ts#L140)* **Parameters:** | Name | Type | | ------ | ------ | | newAccountId | `string` | -| publicKey | `string` | +| publicKey | `string` \| [PublicKey](_utils_key_pair_.publickey.md) | | amount | `BN` | **Returns:** `Promise`<[FinalTransactionResult](../interfaces/_providers_provider_.finaltransactionresult.md)> @@ -124,16 +132,16 @@ ___ ## createAndDeployContract -▸ **createAndDeployContract**(contractId: *`string`*, publicKey: *`string`*, data: *`Uint8Array`*, amount: *`BN`*): `Promise`<[Account](_account_.account.md)> +▸ **createAndDeployContract**(contractId: *`string`*, publicKey: *`string` \| [PublicKey](_utils_key_pair_.publickey.md)*, data: *`Uint8Array`*, amount: *`BN`*): `Promise`<[Account](_account_.account.md)> -*Defined in [account.ts:120](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/account.ts#L120)* +*Defined in [account.ts:129](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/account.ts#L129)* **Parameters:** | Name | Type | | ------ | ------ | | contractId | `string` | -| publicKey | `string` | +| publicKey | `string` \| [PublicKey](_utils_key_pair_.publickey.md) | | data | `Uint8Array` | | amount | `BN` | @@ -144,15 +152,15 @@ ___ ## deleteKey -▸ **deleteKey**(publicKey: *`string`*): `Promise`<[FinalTransactionResult](../interfaces/_providers_provider_.finaltransactionresult.md)> +▸ **deleteKey**(publicKey: *`string` \| [PublicKey](_utils_key_pair_.publickey.md)*): `Promise`<[FinalTransactionResult](../interfaces/_providers_provider_.finaltransactionresult.md)> -*Defined in [account.ts:162](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/account.ts#L162)* +*Defined in [account.ts:167](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/account.ts#L167)* **Parameters:** | Name | Type | | ------ | ------ | -| publicKey | `string` | +| publicKey | `string` \| [PublicKey](_utils_key_pair_.publickey.md) | **Returns:** `Promise`<[FinalTransactionResult](../interfaces/_providers_provider_.finaltransactionresult.md)> @@ -163,7 +171,7 @@ ___ ▸ **deployContract**(data: *`Uint8Array`*): `Promise`<[FinalTransactionResult](../interfaces/_providers_provider_.finaltransactionresult.md)> -*Defined in [account.ts:140](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/account.ts#L140)* +*Defined in [account.ts:145](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/account.ts#L145)* **Parameters:** @@ -180,7 +188,7 @@ ___ ▸ **fetchState**(): `Promise`<`void`> -*Defined in [account.ts:53](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/account.ts#L53)* +*Defined in [account.ts:53](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/account.ts#L53)* **Returns:** `Promise`<`void`> @@ -189,9 +197,9 @@ ___ ## functionCall -▸ **functionCall**(contractId: *`string`*, methodName: *`string`*, args: *`any`*, amount?: *`BN`*): `Promise`<[FinalTransactionResult](../interfaces/_providers_provider_.finaltransactionresult.md)> +▸ **functionCall**(contractId: *`string`*, methodName: *`string`*, args: *`any`*, gas: *`number`*, amount?: *`BN`*): `Promise`<[FinalTransactionResult](../interfaces/_providers_provider_.finaltransactionresult.md)> -*Defined in [account.ts:146](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/account.ts#L146)* +*Defined in [account.ts:149](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/account.ts#L149)* **Parameters:** @@ -200,10 +208,22 @@ ___ | contractId | `string` | | methodName | `string` | | args | `any` | +| gas | `number` | | `Optional` amount | `BN` | **Returns:** `Promise`<[FinalTransactionResult](../interfaces/_providers_provider_.finaltransactionresult.md)> +___ + + +## getAccessKeys + +▸ **getAccessKeys**(): `Promise`<`any`> + +*Defined in [account.ts:184](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/account.ts#L184)* + +**Returns:** `Promise`<`any`> + ___ @@ -211,7 +231,7 @@ ___ ▸ **getAccountDetails**(): `Promise`<`any`> -*Defined in [account.ts:182](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/account.ts#L182)* +*Defined in [account.ts:189](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/account.ts#L189)* **Returns:** `Promise`<`any`> @@ -222,7 +242,7 @@ ___ ▸ **printLogs**(contractId: *`string`*, logs: *`string`[]*): `void` -*Defined in [account.ts:65](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/account.ts#L65)* +*Defined in [account.ts:71](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/account.ts#L71)* **Parameters:** @@ -240,7 +260,7 @@ ___ ▸ **retryTxResult**(txHash: *`Uint8Array`*): `Promise`<[FinalTransactionResult](../interfaces/_providers_provider_.finaltransactionresult.md)> -*Defined in [account.ts:71](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/account.ts#L71)* +*Defined in [account.ts:77](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/account.ts#L77)* **Parameters:** @@ -255,15 +275,15 @@ ___ ## sendMoney -▸ **sendMoney**(receiver: *`string`*, amount: *`BN`*): `Promise`<[FinalTransactionResult](../interfaces/_providers_provider_.finaltransactionresult.md)> +▸ **sendMoney**(receiverId: *`string`*, amount: *`BN`*): `Promise`<[FinalTransactionResult](../interfaces/_providers_provider_.finaltransactionresult.md)> -*Defined in [account.ts:128](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/account.ts#L128)* +*Defined in [account.ts:136](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/account.ts#L136)* **Parameters:** | Name | Type | | ------ | ------ | -| receiver | `string` | +| receiverId | `string` | | amount | `BN` | **Returns:** `Promise`<[FinalTransactionResult](../interfaces/_providers_provider_.finaltransactionresult.md)> @@ -273,15 +293,16 @@ ___ ## `` signAndSendTransaction -▸ **signAndSendTransaction**(transaction: *`any`*): `Promise`<[FinalTransactionResult](../interfaces/_providers_provider_.finaltransactionresult.md)> +▸ **signAndSendTransaction**(receiverId: *`string`*, actions: *[Action](_transaction_.action.md)[]*): `Promise`<[FinalTransactionResult](../interfaces/_providers_provider_.finaltransactionresult.md)> -*Defined in [account.ts:86](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/account.ts#L86)* +*Defined in [account.ts:92](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/account.ts#L92)* **Parameters:** | Name | Type | | ------ | ------ | -| transaction | `any` | +| receiverId | `string` | +| actions | [Action](_transaction_.action.md)[] | **Returns:** `Promise`<[FinalTransactionResult](../interfaces/_providers_provider_.finaltransactionresult.md)> @@ -290,15 +311,15 @@ ___ ## stake -▸ **stake**(publicKey: *`string`*, amount: *`BN`*): `Promise`<[FinalTransactionResult](../interfaces/_providers_provider_.finaltransactionresult.md)> +▸ **stake**(publicKey: *`string` \| [PublicKey](_utils_key_pair_.publickey.md)*, amount: *`BN`*): `Promise`<[FinalTransactionResult](../interfaces/_providers_provider_.finaltransactionresult.md)> -*Defined in [account.ts:168](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/account.ts#L168)* +*Defined in [account.ts:171](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/account.ts#L171)* **Parameters:** | Name | Type | | ------ | ------ | -| publicKey | `string` | +| publicKey | `string` \| [PublicKey](_utils_key_pair_.publickey.md) | | amount | `BN` | **Returns:** `Promise`<[FinalTransactionResult](../interfaces/_providers_provider_.finaltransactionresult.md)> @@ -310,7 +331,7 @@ ___ ▸ **state**(): `Promise`<[AccountState](../interfaces/_account_.accountstate.md)> -*Defined in [account.ts:60](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/account.ts#L60)* +*Defined in [account.ts:66](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/account.ts#L66)* **Returns:** `Promise`<[AccountState](../interfaces/_account_.accountstate.md)> @@ -321,7 +342,7 @@ ___ ▸ **viewFunction**(contractId: *`string`*, methodName: *`string`*, args: *`any`*): `Promise`<`any`> -*Defined in [account.ts:174](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/account.ts#L174)* +*Defined in [account.ts:175](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/account.ts#L175)* **Parameters:** diff --git a/docs/classes/_account_creator_.accountcreator.md b/docs/classes/_account_creator_.accountcreator.md index cf9d6dcc5e..ffbf582a2e 100644 --- a/docs/classes/_account_creator_.accountcreator.md +++ b/docs/classes/_account_creator_.accountcreator.md @@ -16,16 +16,16 @@ Account creator provides interface to specific implementation to acutally create ## `` createAccount -▸ **createAccount**(newAccountId: *`string`*, publicKey: *`string`*): `Promise`<`void`> +▸ **createAccount**(newAccountId: *`string`*, publicKey: *[PublicKey](_utils_key_pair_.publickey.md)*): `Promise`<`void`> -*Defined in [account_creator.ts:10](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/account_creator.ts#L10)* +*Defined in [account_creator.ts:11](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/account_creator.ts#L11)* **Parameters:** | Name | Type | | ------ | ------ | | newAccountId | `string` | -| publicKey | `string` | +| publicKey | [PublicKey](_utils_key_pair_.publickey.md) | **Returns:** `Promise`<`void`> diff --git a/docs/classes/_account_creator_.localaccountcreator.md b/docs/classes/_account_creator_.localaccountcreator.md index 0d13e4ac75..eb2aed99cc 100644 --- a/docs/classes/_account_creator_.localaccountcreator.md +++ b/docs/classes/_account_creator_.localaccountcreator.md @@ -14,7 +14,7 @@ ⊕ **new LocalAccountCreator**(masterAccount: *[Account](_account_.account.md)*, initialBalance: *`BN`*): [LocalAccountCreator](_account_creator_.localaccountcreator.md) -*Defined in [account_creator.ts:15](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/account_creator.ts#L15)* +*Defined in [account_creator.ts:16](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/account_creator.ts#L16)* **Parameters:** @@ -35,7 +35,7 @@ ___ **● initialBalance**: *`BN`* -*Defined in [account_creator.ts:15](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/account_creator.ts#L15)* +*Defined in [account_creator.ts:16](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/account_creator.ts#L16)* ___ @@ -44,7 +44,7 @@ ___ **● masterAccount**: *[Account](_account_.account.md)* -*Defined in [account_creator.ts:14](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/account_creator.ts#L14)* +*Defined in [account_creator.ts:15](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/account_creator.ts#L15)* ___ @@ -54,18 +54,18 @@ ___ ## createAccount -▸ **createAccount**(newAccountId: *`string`*, publicKey: *`string`*): `Promise`<`void`> +▸ **createAccount**(newAccountId: *`string`*, publicKey: *[PublicKey](_utils_key_pair_.publickey.md)*): `Promise`<`void`> *Overrides [AccountCreator](_account_creator_.accountcreator.md).[createAccount](_account_creator_.accountcreator.md#createaccount)* -*Defined in [account_creator.ts:23](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/account_creator.ts#L23)* +*Defined in [account_creator.ts:24](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/account_creator.ts#L24)* **Parameters:** | Name | Type | | ------ | ------ | | newAccountId | `string` | -| publicKey | `string` | +| publicKey | [PublicKey](_utils_key_pair_.publickey.md) | **Returns:** `Promise`<`void`> diff --git a/docs/classes/_account_creator_.urlaccountcreator.md b/docs/classes/_account_creator_.urlaccountcreator.md index 414bc2510e..f653b39919 100644 --- a/docs/classes/_account_creator_.urlaccountcreator.md +++ b/docs/classes/_account_creator_.urlaccountcreator.md @@ -14,7 +14,7 @@ ⊕ **new UrlAccountCreator**(connection: *[Connection](_connection_.connection.md)*, helperUrl: *`string`*): [UrlAccountCreator](_account_creator_.urlaccountcreator.md) -*Defined in [account_creator.ts:31](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/account_creator.ts#L31)* +*Defined in [account_creator.ts:32](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/account_creator.ts#L32)* **Parameters:** @@ -35,7 +35,7 @@ ___ **● connection**: *[Connection](_connection_.connection.md)* -*Defined in [account_creator.ts:30](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/account_creator.ts#L30)* +*Defined in [account_creator.ts:31](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/account_creator.ts#L31)* ___ @@ -44,7 +44,7 @@ ___ **● helperConnection**: *[ConnectionInfo](../interfaces/_utils_web_.connectioninfo.md)* -*Defined in [account_creator.ts:31](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/account_creator.ts#L31)* +*Defined in [account_creator.ts:32](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/account_creator.ts#L32)* ___ @@ -54,18 +54,18 @@ ___ ## createAccount -▸ **createAccount**(newAccountId: *`string`*, publicKey: *`string`*): `Promise`<`void`> +▸ **createAccount**(newAccountId: *`string`*, publicKey: *[PublicKey](_utils_key_pair_.publickey.md)*): `Promise`<`void`> *Overrides [AccountCreator](_account_creator_.accountcreator.md).[createAccount](_account_creator_.accountcreator.md#createaccount)* -*Defined in [account_creator.ts:39](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/account_creator.ts#L39)* +*Defined in [account_creator.ts:40](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/account_creator.ts#L40)* **Parameters:** | Name | Type | | ------ | ------ | | newAccountId | `string` | -| publicKey | `string` | +| publicKey | [PublicKey](_utils_key_pair_.publickey.md) | **Returns:** `Promise`<`void`> diff --git a/docs/classes/_connection_.connection.md b/docs/classes/_connection_.connection.md index cb4202754f..97e7156ad5 100644 --- a/docs/classes/_connection_.connection.md +++ b/docs/classes/_connection_.connection.md @@ -12,7 +12,7 @@ ⊕ **new Connection**(networkId: *`string`*, provider: *[Provider](_providers_provider_.provider.md)*, signer: *[Signer](_signer_.signer.md)*): [Connection](_connection_.connection.md) -*Defined in [connection.ts:25](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/connection.ts#L25)* +*Defined in [connection.ts:25](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/connection.ts#L25)* **Parameters:** @@ -34,7 +34,7 @@ ___ **● networkId**: *`string`* -*Defined in [connection.ts:23](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/connection.ts#L23)* +*Defined in [connection.ts:23](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/connection.ts#L23)* ___ @@ -43,7 +43,7 @@ ___ **● provider**: *[Provider](_providers_provider_.provider.md)* -*Defined in [connection.ts:24](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/connection.ts#L24)* +*Defined in [connection.ts:24](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/connection.ts#L24)* ___ @@ -52,7 +52,7 @@ ___ **● signer**: *[Signer](_signer_.signer.md)* -*Defined in [connection.ts:25](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/connection.ts#L25)* +*Defined in [connection.ts:25](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/connection.ts#L25)* ___ @@ -64,7 +64,7 @@ ___ ▸ **fromConfig**(config: *`any`*): [Connection](_connection_.connection.md) -*Defined in [connection.ts:33](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/connection.ts#L33)* +*Defined in [connection.ts:33](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/connection.ts#L33)* **Parameters:** diff --git a/docs/classes/_contract_.contract.md b/docs/classes/_contract_.contract.md index d832c5c88d..45470756d1 100644 --- a/docs/classes/_contract_.contract.md +++ b/docs/classes/_contract_.contract.md @@ -12,7 +12,7 @@ ⊕ **new Contract**(account: *[Account](_account_.account.md)*, contractId: *`string`*, options: *`object`*): [Contract](_contract_.contract.md) -*Defined in [contract.ts:8](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/contract.ts#L8)* +*Defined in [contract.ts:8](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/contract.ts#L8)* **Parameters:** @@ -39,7 +39,7 @@ ___ **● account**: *[Account](_account_.account.md)* -*Defined in [contract.ts:7](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/contract.ts#L7)* +*Defined in [contract.ts:7](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/contract.ts#L7)* ___ @@ -48,7 +48,7 @@ ___ **● contractId**: *`string`* -*Defined in [contract.ts:8](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/contract.ts#L8)* +*Defined in [contract.ts:8](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/contract.ts#L8)* ___ diff --git a/docs/classes/_key_stores_browser_local_storage_key_store_.browserlocalstoragekeystore.md b/docs/classes/_key_stores_browser_local_storage_key_store_.browserlocalstoragekeystore.md index 883f374178..f90c3b4e0c 100644 --- a/docs/classes/_key_stores_browser_local_storage_key_store_.browserlocalstoragekeystore.md +++ b/docs/classes/_key_stores_browser_local_storage_key_store_.browserlocalstoragekeystore.md @@ -14,7 +14,7 @@ ⊕ **new BrowserLocalStorageKeyStore**(localStorage?: *`any`*, prefix?: *`string`*): [BrowserLocalStorageKeyStore](_key_stores_browser_local_storage_key_store_.browserlocalstoragekeystore.md) -*Defined in [key_stores/browser_local_storage_key_store.ts:10](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/key_stores/browser_local_storage_key_store.ts#L10)* +*Defined in [key_stores/browser_local_storage_key_store.ts:10](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/key_stores/browser_local_storage_key_store.ts#L10)* **Parameters:** @@ -35,7 +35,7 @@ ___ **● localStorage**: *`any`* -*Defined in [key_stores/browser_local_storage_key_store.ts:9](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/key_stores/browser_local_storage_key_store.ts#L9)* +*Defined in [key_stores/browser_local_storage_key_store.ts:9](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/key_stores/browser_local_storage_key_store.ts#L9)* ___ @@ -44,7 +44,7 @@ ___ **● prefix**: *`string`* -*Defined in [key_stores/browser_local_storage_key_store.ts:10](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/key_stores/browser_local_storage_key_store.ts#L10)* +*Defined in [key_stores/browser_local_storage_key_store.ts:10](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/key_stores/browser_local_storage_key_store.ts#L10)* ___ @@ -58,7 +58,7 @@ ___ *Overrides [KeyStore](_key_stores_keystore_.keystore.md).[clear](_key_stores_keystore_.keystore.md#clear)* -*Defined in [key_stores/browser_local_storage_key_store.ts:34](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/key_stores/browser_local_storage_key_store.ts#L34)* +*Defined in [key_stores/browser_local_storage_key_store.ts:34](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/key_stores/browser_local_storage_key_store.ts#L34)* **Returns:** `Promise`<`void`> @@ -71,7 +71,7 @@ ___ *Overrides [KeyStore](_key_stores_keystore_.keystore.md).[getAccounts](_key_stores_keystore_.keystore.md#getaccounts)* -*Defined in [key_stores/browser_local_storage_key_store.ts:53](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/key_stores/browser_local_storage_key_store.ts#L53)* +*Defined in [key_stores/browser_local_storage_key_store.ts:53](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/key_stores/browser_local_storage_key_store.ts#L53)* **Parameters:** @@ -90,7 +90,7 @@ ___ *Overrides [KeyStore](_key_stores_keystore_.keystore.md).[getKey](_key_stores_keystore_.keystore.md#getkey)* -*Defined in [key_stores/browser_local_storage_key_store.ts:22](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/key_stores/browser_local_storage_key_store.ts#L22)* +*Defined in [key_stores/browser_local_storage_key_store.ts:22](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/key_stores/browser_local_storage_key_store.ts#L22)* **Parameters:** @@ -110,7 +110,7 @@ ___ *Overrides [KeyStore](_key_stores_keystore_.keystore.md).[getNetworks](_key_stores_keystore_.keystore.md#getnetworks)* -*Defined in [key_stores/browser_local_storage_key_store.ts:42](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/key_stores/browser_local_storage_key_store.ts#L42)* +*Defined in [key_stores/browser_local_storage_key_store.ts:42](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/key_stores/browser_local_storage_key_store.ts#L42)* **Returns:** `Promise`<`string`[]> @@ -123,7 +123,7 @@ ___ *Overrides [KeyStore](_key_stores_keystore_.keystore.md).[removeKey](_key_stores_keystore_.keystore.md#removekey)* -*Defined in [key_stores/browser_local_storage_key_store.ts:30](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/key_stores/browser_local_storage_key_store.ts#L30)* +*Defined in [key_stores/browser_local_storage_key_store.ts:30](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/key_stores/browser_local_storage_key_store.ts#L30)* **Parameters:** @@ -143,7 +143,7 @@ ___ *Overrides [KeyStore](_key_stores_keystore_.keystore.md).[setKey](_key_stores_keystore_.keystore.md#setkey)* -*Defined in [key_stores/browser_local_storage_key_store.ts:18](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/key_stores/browser_local_storage_key_store.ts#L18)* +*Defined in [key_stores/browser_local_storage_key_store.ts:18](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/key_stores/browser_local_storage_key_store.ts#L18)* **Parameters:** @@ -162,7 +162,7 @@ ___ ▸ **storageKeyForSecretKey**(networkId: *`string`*, accountId: *`string`*): `string` -*Defined in [key_stores/browser_local_storage_key_store.ts:66](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/key_stores/browser_local_storage_key_store.ts#L66)* +*Defined in [key_stores/browser_local_storage_key_store.ts:66](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/key_stores/browser_local_storage_key_store.ts#L66)* **Parameters:** @@ -180,7 +180,7 @@ ___ ▸ **storageKeys**(): `IterableIterator`<`string`> -*Defined in [key_stores/browser_local_storage_key_store.ts:70](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/key_stores/browser_local_storage_key_store.ts#L70)* +*Defined in [key_stores/browser_local_storage_key_store.ts:70](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/key_stores/browser_local_storage_key_store.ts#L70)* **Returns:** `IterableIterator`<`string`> diff --git a/docs/classes/_key_stores_in_memory_key_store_.inmemorykeystore.md b/docs/classes/_key_stores_in_memory_key_store_.inmemorykeystore.md index a38471fede..8fce789397 100644 --- a/docs/classes/_key_stores_in_memory_key_store_.inmemorykeystore.md +++ b/docs/classes/_key_stores_in_memory_key_store_.inmemorykeystore.md @@ -16,7 +16,7 @@ Simple in-memory keystore for testing purposes. ⊕ **new InMemoryKeyStore**(): [InMemoryKeyStore](_key_stores_in_memory_key_store_.inmemorykeystore.md) -*Defined in [key_stores/in_memory_key_store.ts:10](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/key_stores/in_memory_key_store.ts#L10)* +*Defined in [key_stores/in_memory_key_store.ts:10](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/key_stores/in_memory_key_store.ts#L10)* **Returns:** [InMemoryKeyStore](_key_stores_in_memory_key_store_.inmemorykeystore.md) @@ -30,7 +30,7 @@ ___ **● keys**: *`object`* -*Defined in [key_stores/in_memory_key_store.ts:10](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/key_stores/in_memory_key_store.ts#L10)* +*Defined in [key_stores/in_memory_key_store.ts:10](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/key_stores/in_memory_key_store.ts#L10)* #### Type declaration @@ -48,7 +48,7 @@ ___ *Overrides [KeyStore](_key_stores_keystore_.keystore.md).[clear](_key_stores_keystore_.keystore.md#clear)* -*Defined in [key_stores/in_memory_key_store.ts:33](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/key_stores/in_memory_key_store.ts#L33)* +*Defined in [key_stores/in_memory_key_store.ts:33](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/key_stores/in_memory_key_store.ts#L33)* **Returns:** `Promise`<`void`> @@ -61,7 +61,7 @@ ___ *Overrides [KeyStore](_key_stores_keystore_.keystore.md).[getAccounts](_key_stores_keystore_.keystore.md#getaccounts)* -*Defined in [key_stores/in_memory_key_store.ts:46](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/key_stores/in_memory_key_store.ts#L46)* +*Defined in [key_stores/in_memory_key_store.ts:46](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/key_stores/in_memory_key_store.ts#L46)* **Parameters:** @@ -80,7 +80,7 @@ ___ *Overrides [KeyStore](_key_stores_keystore_.keystore.md).[getKey](_key_stores_keystore_.keystore.md#getkey)* -*Defined in [key_stores/in_memory_key_store.ts:21](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/key_stores/in_memory_key_store.ts#L21)* +*Defined in [key_stores/in_memory_key_store.ts:21](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/key_stores/in_memory_key_store.ts#L21)* **Parameters:** @@ -100,7 +100,7 @@ ___ *Overrides [KeyStore](_key_stores_keystore_.keystore.md).[getNetworks](_key_stores_keystore_.keystore.md#getnetworks)* -*Defined in [key_stores/in_memory_key_store.ts:37](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/key_stores/in_memory_key_store.ts#L37)* +*Defined in [key_stores/in_memory_key_store.ts:37](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/key_stores/in_memory_key_store.ts#L37)* **Returns:** `Promise`<`string`[]> @@ -113,7 +113,7 @@ ___ *Overrides [KeyStore](_key_stores_keystore_.keystore.md).[removeKey](_key_stores_keystore_.keystore.md#removekey)* -*Defined in [key_stores/in_memory_key_store.ts:29](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/key_stores/in_memory_key_store.ts#L29)* +*Defined in [key_stores/in_memory_key_store.ts:29](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/key_stores/in_memory_key_store.ts#L29)* **Parameters:** @@ -133,7 +133,7 @@ ___ *Overrides [KeyStore](_key_stores_keystore_.keystore.md).[setKey](_key_stores_keystore_.keystore.md#setkey)* -*Defined in [key_stores/in_memory_key_store.ts:17](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/key_stores/in_memory_key_store.ts#L17)* +*Defined in [key_stores/in_memory_key_store.ts:17](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/key_stores/in_memory_key_store.ts#L17)* **Parameters:** diff --git a/docs/classes/_key_stores_keystore_.keystore.md b/docs/classes/_key_stores_keystore_.keystore.md index c895d6f1a9..04cff74256 100644 --- a/docs/classes/_key_stores_keystore_.keystore.md +++ b/docs/classes/_key_stores_keystore_.keystore.md @@ -22,7 +22,7 @@ Key store interface for `InMemorySigner`. ▸ **clear**(): `Promise`<`void`> -*Defined in [key_stores/keystore.ts:12](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/key_stores/keystore.ts#L12)* +*Defined in [key_stores/keystore.ts:12](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/key_stores/keystore.ts#L12)* **Returns:** `Promise`<`void`> @@ -33,7 +33,7 @@ ___ ▸ **getAccounts**(networkId: *`string`*): `Promise`<`string`[]> -*Defined in [key_stores/keystore.ts:14](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/key_stores/keystore.ts#L14)* +*Defined in [key_stores/keystore.ts:14](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/key_stores/keystore.ts#L14)* **Parameters:** @@ -50,7 +50,7 @@ ___ ▸ **getKey**(networkId: *`string`*, accountId: *`string`*): `Promise`<[KeyPair](_utils_key_pair_.keypair.md)> -*Defined in [key_stores/keystore.ts:10](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/key_stores/keystore.ts#L10)* +*Defined in [key_stores/keystore.ts:10](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/key_stores/keystore.ts#L10)* **Parameters:** @@ -68,7 +68,7 @@ ___ ▸ **getNetworks**(): `Promise`<`string`[]> -*Defined in [key_stores/keystore.ts:13](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/key_stores/keystore.ts#L13)* +*Defined in [key_stores/keystore.ts:13](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/key_stores/keystore.ts#L13)* **Returns:** `Promise`<`string`[]> @@ -79,7 +79,7 @@ ___ ▸ **removeKey**(networkId: *`string`*, accountId: *`string`*): `Promise`<`void`> -*Defined in [key_stores/keystore.ts:11](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/key_stores/keystore.ts#L11)* +*Defined in [key_stores/keystore.ts:11](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/key_stores/keystore.ts#L11)* **Parameters:** @@ -97,7 +97,7 @@ ___ ▸ **setKey**(networkId: *`string`*, accountId: *`string`*, keyPair: *[KeyPair](_utils_key_pair_.keypair.md)*): `Promise`<`void`> -*Defined in [key_stores/keystore.ts:9](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/key_stores/keystore.ts#L9)* +*Defined in [key_stores/keystore.ts:9](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/key_stores/keystore.ts#L9)* **Parameters:** diff --git a/docs/classes/_key_stores_merge_key_store_.mergekeystore.md b/docs/classes/_key_stores_merge_key_store_.mergekeystore.md index edf48d5590..dcec8710d3 100644 --- a/docs/classes/_key_stores_merge_key_store_.mergekeystore.md +++ b/docs/classes/_key_stores_merge_key_store_.mergekeystore.md @@ -16,7 +16,7 @@ Keystore which can be used to merge multiple key stores into one virtual key sto ⊕ **new MergeKeyStore**(keyStores: *[KeyStore](_key_stores_keystore_.keystore.md)[]*): [MergeKeyStore](_key_stores_merge_key_store_.mergekeystore.md) -*Defined in [key_stores/merge_key_store.ts:10](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/key_stores/merge_key_store.ts#L10)* +*Defined in [key_stores/merge_key_store.ts:10](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/key_stores/merge_key_store.ts#L10)* **Parameters:** @@ -36,7 +36,7 @@ ___ **● keyStores**: *[KeyStore](_key_stores_keystore_.keystore.md)[]* -*Defined in [key_stores/merge_key_store.ts:10](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/key_stores/merge_key_store.ts#L10)* +*Defined in [key_stores/merge_key_store.ts:10](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/key_stores/merge_key_store.ts#L10)* ___ @@ -50,7 +50,7 @@ ___ *Overrides [KeyStore](_key_stores_keystore_.keystore.md).[clear](_key_stores_keystore_.keystore.md#clear)* -*Defined in [key_stores/merge_key_store.ts:40](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/key_stores/merge_key_store.ts#L40)* +*Defined in [key_stores/merge_key_store.ts:40](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/key_stores/merge_key_store.ts#L40)* **Returns:** `Promise`<`void`> @@ -63,7 +63,7 @@ ___ *Overrides [KeyStore](_key_stores_keystore_.keystore.md).[getAccounts](_key_stores_keystore_.keystore.md#getaccounts)* -*Defined in [key_stores/merge_key_store.ts:56](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/key_stores/merge_key_store.ts#L56)* +*Defined in [key_stores/merge_key_store.ts:56](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/key_stores/merge_key_store.ts#L56)* **Parameters:** @@ -82,7 +82,7 @@ ___ *Overrides [KeyStore](_key_stores_keystore_.keystore.md).[getKey](_key_stores_keystore_.keystore.md#getkey)* -*Defined in [key_stores/merge_key_store.ts:24](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/key_stores/merge_key_store.ts#L24)* +*Defined in [key_stores/merge_key_store.ts:24](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/key_stores/merge_key_store.ts#L24)* **Parameters:** @@ -102,7 +102,7 @@ ___ *Overrides [KeyStore](_key_stores_keystore_.keystore.md).[getNetworks](_key_stores_keystore_.keystore.md#getnetworks)* -*Defined in [key_stores/merge_key_store.ts:46](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/key_stores/merge_key_store.ts#L46)* +*Defined in [key_stores/merge_key_store.ts:46](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/key_stores/merge_key_store.ts#L46)* **Returns:** `Promise`<`string`[]> @@ -115,7 +115,7 @@ ___ *Overrides [KeyStore](_key_stores_keystore_.keystore.md).[removeKey](_key_stores_keystore_.keystore.md#removekey)* -*Defined in [key_stores/merge_key_store.ts:34](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/key_stores/merge_key_store.ts#L34)* +*Defined in [key_stores/merge_key_store.ts:34](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/key_stores/merge_key_store.ts#L34)* **Parameters:** @@ -135,7 +135,7 @@ ___ *Overrides [KeyStore](_key_stores_keystore_.keystore.md).[setKey](_key_stores_keystore_.keystore.md#setkey)* -*Defined in [key_stores/merge_key_store.ts:20](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/key_stores/merge_key_store.ts#L20)* +*Defined in [key_stores/merge_key_store.ts:20](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/key_stores/merge_key_store.ts#L20)* **Parameters:** diff --git a/docs/classes/_key_stores_unencrypted_file_system_keystore_.unencryptedfilesystemkeystore.md b/docs/classes/_key_stores_unencrypted_file_system_keystore_.unencryptedfilesystemkeystore.md index 013d8ea5fd..4d635858d8 100644 --- a/docs/classes/_key_stores_unencrypted_file_system_keystore_.unencryptedfilesystemkeystore.md +++ b/docs/classes/_key_stores_unencrypted_file_system_keystore_.unencryptedfilesystemkeystore.md @@ -14,7 +14,7 @@ ⊕ **new UnencryptedFileSystemKeyStore**(keyDir: *`string`*): [UnencryptedFileSystemKeyStore](_key_stores_unencrypted_file_system_keystore_.unencryptedfilesystemkeystore.md) -*Defined in [key_stores/unencrypted_file_system_keystore.ts:47](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/key_stores/unencrypted_file_system_keystore.ts#L47)* +*Defined in [key_stores/unencrypted_file_system_keystore.ts:47](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/key_stores/unencrypted_file_system_keystore.ts#L47)* **Parameters:** @@ -34,7 +34,7 @@ ___ **● keyDir**: *`string`* -*Defined in [key_stores/unencrypted_file_system_keystore.ts:47](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/key_stores/unencrypted_file_system_keystore.ts#L47)* +*Defined in [key_stores/unencrypted_file_system_keystore.ts:47](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/key_stores/unencrypted_file_system_keystore.ts#L47)* ___ @@ -48,7 +48,7 @@ ___ *Overrides [KeyStore](_key_stores_keystore_.keystore.md).[clear](_key_stores_keystore_.keystore.md#clear)* -*Defined in [key_stores/unencrypted_file_system_keystore.ts:75](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/key_stores/unencrypted_file_system_keystore.ts#L75)* +*Defined in [key_stores/unencrypted_file_system_keystore.ts:75](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/key_stores/unencrypted_file_system_keystore.ts#L75)* **Returns:** `Promise`<`void`> @@ -61,7 +61,7 @@ ___ *Overrides [KeyStore](_key_stores_keystore_.keystore.md).[getAccounts](_key_stores_keystore_.keystore.md#getaccounts)* -*Defined in [key_stores/unencrypted_file_system_keystore.ts:96](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/key_stores/unencrypted_file_system_keystore.ts#L96)* +*Defined in [key_stores/unencrypted_file_system_keystore.ts:96](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/key_stores/unencrypted_file_system_keystore.ts#L96)* **Parameters:** @@ -80,7 +80,7 @@ ___ *Overrides [KeyStore](_key_stores_keystore_.keystore.md).[getKey](_key_stores_keystore_.keystore.md#getkey)* -*Defined in [key_stores/unencrypted_file_system_keystore.ts:60](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/key_stores/unencrypted_file_system_keystore.ts#L60)* +*Defined in [key_stores/unencrypted_file_system_keystore.ts:60](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/key_stores/unencrypted_file_system_keystore.ts#L60)* **Parameters:** @@ -98,7 +98,7 @@ ___ ▸ **getKeyFilePath**(networkId: *`string`*, accountId: *`string`*): `string` -*Defined in [key_stores/unencrypted_file_system_keystore.ts:83](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/key_stores/unencrypted_file_system_keystore.ts#L83)* +*Defined in [key_stores/unencrypted_file_system_keystore.ts:83](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/key_stores/unencrypted_file_system_keystore.ts#L83)* **Parameters:** @@ -118,7 +118,7 @@ ___ *Overrides [KeyStore](_key_stores_keystore_.keystore.md).[getNetworks](_key_stores_keystore_.keystore.md#getnetworks)* -*Defined in [key_stores/unencrypted_file_system_keystore.ts:87](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/key_stores/unencrypted_file_system_keystore.ts#L87)* +*Defined in [key_stores/unencrypted_file_system_keystore.ts:87](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/key_stores/unencrypted_file_system_keystore.ts#L87)* **Returns:** `Promise`<`string`[]> @@ -131,7 +131,7 @@ ___ *Overrides [KeyStore](_key_stores_keystore_.keystore.md).[removeKey](_key_stores_keystore_.keystore.md#removekey)* -*Defined in [key_stores/unencrypted_file_system_keystore.ts:69](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/key_stores/unencrypted_file_system_keystore.ts#L69)* +*Defined in [key_stores/unencrypted_file_system_keystore.ts:69](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/key_stores/unencrypted_file_system_keystore.ts#L69)* **Parameters:** @@ -151,7 +151,7 @@ ___ *Overrides [KeyStore](_key_stores_keystore_.keystore.md).[setKey](_key_stores_keystore_.keystore.md#setkey)* -*Defined in [key_stores/unencrypted_file_system_keystore.ts:54](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/key_stores/unencrypted_file_system_keystore.ts#L54)* +*Defined in [key_stores/unencrypted_file_system_keystore.ts:54](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/key_stores/unencrypted_file_system_keystore.ts#L54)* **Parameters:** diff --git a/docs/classes/_near_.near.md b/docs/classes/_near_.near.md index 562a846181..c457ee2bff 100644 --- a/docs/classes/_near_.near.md +++ b/docs/classes/_near_.near.md @@ -12,7 +12,7 @@ ⊕ **new Near**(config: *`any`*): [Near](_near_.near.md) -*Defined in [near.ts:14](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/near.ts#L14)* +*Defined in [near.ts:14](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/near.ts#L14)* **Parameters:** @@ -32,7 +32,7 @@ ___ **● accountCreator**: *[AccountCreator](_account_creator_.accountcreator.md)* -*Defined in [near.ts:14](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/near.ts#L14)* +*Defined in [near.ts:14](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/near.ts#L14)* ___ @@ -41,7 +41,7 @@ ___ **● config**: *`any`* -*Defined in [near.ts:12](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/near.ts#L12)* +*Defined in [near.ts:12](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/near.ts#L12)* ___ @@ -50,7 +50,7 @@ ___ **● connection**: *[Connection](_connection_.connection.md)* -*Defined in [near.ts:13](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/near.ts#L13)* +*Defined in [near.ts:13](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/near.ts#L13)* ___ @@ -62,7 +62,7 @@ ___ ▸ **account**(accountId: *`string`*): `Promise`<[Account](_account_.account.md)> -*Defined in [near.ts:33](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/near.ts#L33)* +*Defined in [near.ts:33](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/near.ts#L33)* **Parameters:** @@ -77,39 +77,19 @@ ___ ## createAccount -▸ **createAccount**(accountId: *`string`*, publicKey: *`string`*): `Promise`<[Account](_account_.account.md)> +▸ **createAccount**(accountId: *`string`*, publicKey: *[PublicKey](_utils_key_pair_.publickey.md)*): `Promise`<[Account](_account_.account.md)> -*Defined in [near.ts:39](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/near.ts#L39)* +*Defined in [near.ts:39](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/near.ts#L39)* **Parameters:** | Name | Type | | ------ | ------ | | accountId | `string` | -| publicKey | `string` | +| publicKey | [PublicKey](_utils_key_pair_.publickey.md) | **Returns:** `Promise`<[Account](_account_.account.md)> -___ - - -## deployContract - -▸ **deployContract**(contractId: *`string`*, wasmByteArray: *`Uint8Array`*): `Promise`<`string`> - -*Defined in [near.ts:63](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/near.ts#L63)* - -Backwards compatibility method. Use `contractAccount.deployContract` or `yourAccount.createAndDeployContract` instead. - -**Parameters:** - -| Name | Type | Description | -| ------ | ------ | ------ | -| contractId | `string` | \- | -| wasmByteArray | `Uint8Array` | | - -**Returns:** `Promise`<`string`> - ___ @@ -117,7 +97,7 @@ ___ ▸ **loadContract**(contractId: *`string`*, options: *`object`*): `Promise`<[Contract](_contract_.contract.md)> -*Defined in [near.ts:52](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/near.ts#L52)* +*Defined in [near.ts:52](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/near.ts#L52)* Backwards compatibility method. Use `new nearlib.Contract(yourAccount, contractId, { viewMethods, changeMethods })` instead. @@ -142,7 +122,7 @@ ___ ▸ **sendTokens**(amount: *`BN`*, originator: *`string`*, receiver: *`string`*): `Promise`<`string`> -*Defined in [near.ts:76](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/near.ts#L76)* +*Defined in [near.ts:64](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/near.ts#L64)* Backwards compatibility method. Use `yourAccount.sendMoney` instead. diff --git a/docs/classes/_providers_json_rpc_provider_.jsonrpcprovider.md b/docs/classes/_providers_json_rpc_provider_.jsonrpcprovider.md index 6ea722444d..28e8c9af98 100644 --- a/docs/classes/_providers_json_rpc_provider_.jsonrpcprovider.md +++ b/docs/classes/_providers_json_rpc_provider_.jsonrpcprovider.md @@ -14,7 +14,7 @@ ⊕ **new JsonRpcProvider**(url?: *`string`*, network?: *[Network](../interfaces/_utils_network_.network.md)*): [JsonRpcProvider](_providers_json_rpc_provider_.jsonrpcprovider.md) -*Defined in [providers/json-rpc-provider.ts:13](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/providers/json-rpc-provider.ts#L13)* +*Defined in [providers/json-rpc-provider.ts:13](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/providers/json-rpc-provider.ts#L13)* **Parameters:** @@ -35,7 +35,7 @@ ___ **● connection**: *[ConnectionInfo](../interfaces/_utils_web_.connectioninfo.md)* -*Defined in [providers/json-rpc-provider.ts:13](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/providers/json-rpc-provider.ts#L13)* +*Defined in [providers/json-rpc-provider.ts:13](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/providers/json-rpc-provider.ts#L13)* ___ @@ -49,7 +49,7 @@ ___ *Overrides [Provider](_providers_provider_.provider.md).[block](_providers_provider_.provider.md#block)* -*Defined in [providers/json-rpc-provider.ts:50](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/providers/json-rpc-provider.ts#L50)* +*Defined in [providers/json-rpc-provider.ts:50](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/providers/json-rpc-provider.ts#L50)* **Parameters:** @@ -68,7 +68,7 @@ ___ *Overrides [Provider](_providers_provider_.provider.md).[getNetwork](_providers_provider_.provider.md#getnetwork)* -*Defined in [providers/json-rpc-provider.ts:22](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/providers/json-rpc-provider.ts#L22)* +*Defined in [providers/json-rpc-provider.ts:22](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/providers/json-rpc-provider.ts#L22)* **Returns:** `Promise`<[Network](../interfaces/_utils_network_.network.md)> @@ -81,7 +81,7 @@ ___ *Overrides [Provider](_providers_provider_.provider.md).[query](_providers_provider_.provider.md#query)* -*Defined in [providers/json-rpc-provider.ts:42](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/providers/json-rpc-provider.ts#L42)* +*Defined in [providers/json-rpc-provider.ts:42](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/providers/json-rpc-provider.ts#L42)* **Parameters:** @@ -99,7 +99,7 @@ ___ ▸ **sendJsonRpc**(method: *`string`*, params: *`any`[]*): `Promise`<`any`> -*Defined in [providers/json-rpc-provider.ts:54](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/providers/json-rpc-provider.ts#L54)* +*Defined in [providers/json-rpc-provider.ts:54](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/providers/json-rpc-provider.ts#L54)* **Parameters:** @@ -115,17 +115,17 @@ ___ ## sendTransaction -▸ **sendTransaction**(signedTransaction: *`SignedTransaction`*): `Promise`<[FinalTransactionResult](../interfaces/_providers_provider_.finaltransactionresult.md)> +▸ **sendTransaction**(signedTransaction: *[SignedTransaction](_transaction_.signedtransaction.md)*): `Promise`<[FinalTransactionResult](../interfaces/_providers_provider_.finaltransactionresult.md)> *Overrides [Provider](_providers_provider_.provider.md).[sendTransaction](_providers_provider_.provider.md#sendtransaction)* -*Defined in [providers/json-rpc-provider.ts:33](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/providers/json-rpc-provider.ts#L33)* +*Defined in [providers/json-rpc-provider.ts:33](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/providers/json-rpc-provider.ts#L33)* **Parameters:** | Name | Type | | ------ | ------ | -| signedTransaction | `SignedTransaction` | +| signedTransaction | [SignedTransaction](_transaction_.signedtransaction.md) | **Returns:** `Promise`<[FinalTransactionResult](../interfaces/_providers_provider_.finaltransactionresult.md)> @@ -138,7 +138,7 @@ ___ *Overrides [Provider](_providers_provider_.provider.md).[status](_providers_provider_.provider.md#status)* -*Defined in [providers/json-rpc-provider.ts:29](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/providers/json-rpc-provider.ts#L29)* +*Defined in [providers/json-rpc-provider.ts:29](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/providers/json-rpc-provider.ts#L29)* **Returns:** `Promise`<[NodeStatusResult](../interfaces/_providers_provider_.nodestatusresult.md)> @@ -151,7 +151,7 @@ ___ *Overrides [Provider](_providers_provider_.provider.md).[txStatus](_providers_provider_.provider.md#txstatus)* -*Defined in [providers/json-rpc-provider.ts:38](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/providers/json-rpc-provider.ts#L38)* +*Defined in [providers/json-rpc-provider.ts:38](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/providers/json-rpc-provider.ts#L38)* **Parameters:** diff --git a/docs/classes/_providers_provider_.provider.md b/docs/classes/_providers_provider_.provider.md index cb352c5d31..ffdbe910d0 100644 --- a/docs/classes/_providers_provider_.provider.md +++ b/docs/classes/_providers_provider_.provider.md @@ -14,7 +14,7 @@ ▸ **block**(height: *`number`*): `Promise`<[BlockResult](../interfaces/_providers_provider_.blockresult.md)> -*Defined in [providers/provider.ts:75](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/providers/provider.ts#L75)* +*Defined in [providers/provider.ts:80](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/providers/provider.ts#L80)* **Parameters:** @@ -31,7 +31,7 @@ ___ ▸ **getNetwork**(): `Promise`<[Network](../interfaces/_utils_network_.network.md)> -*Defined in [providers/provider.ts:69](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/providers/provider.ts#L69)* +*Defined in [providers/provider.ts:74](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/providers/provider.ts#L74)* **Returns:** `Promise`<[Network](../interfaces/_utils_network_.network.md)> @@ -42,7 +42,7 @@ ___ ▸ **query**(path: *`string`*, data: *`string`*): `Promise`<`any`> -*Defined in [providers/provider.ts:74](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/providers/provider.ts#L74)* +*Defined in [providers/provider.ts:79](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/providers/provider.ts#L79)* **Parameters:** @@ -58,15 +58,15 @@ ___ ## `` sendTransaction -▸ **sendTransaction**(signedTransaction: *`SignedTransaction`*): `Promise`<[FinalTransactionResult](../interfaces/_providers_provider_.finaltransactionresult.md)> +▸ **sendTransaction**(signedTransaction: *[SignedTransaction](_transaction_.signedtransaction.md)*): `Promise`<[FinalTransactionResult](../interfaces/_providers_provider_.finaltransactionresult.md)> -*Defined in [providers/provider.ts:72](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/providers/provider.ts#L72)* +*Defined in [providers/provider.ts:77](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/providers/provider.ts#L77)* **Parameters:** | Name | Type | | ------ | ------ | -| signedTransaction | `SignedTransaction` | +| signedTransaction | [SignedTransaction](_transaction_.signedtransaction.md) | **Returns:** `Promise`<[FinalTransactionResult](../interfaces/_providers_provider_.finaltransactionresult.md)> @@ -77,7 +77,7 @@ ___ ▸ **status**(): `Promise`<[NodeStatusResult](../interfaces/_providers_provider_.nodestatusresult.md)> -*Defined in [providers/provider.ts:70](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/providers/provider.ts#L70)* +*Defined in [providers/provider.ts:75](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/providers/provider.ts#L75)* **Returns:** `Promise`<[NodeStatusResult](../interfaces/_providers_provider_.nodestatusresult.md)> @@ -88,7 +88,7 @@ ___ ▸ **txStatus**(txHash: *`Uint8Array`*): `Promise`<[FinalTransactionResult](../interfaces/_providers_provider_.finaltransactionresult.md)> -*Defined in [providers/provider.ts:73](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/providers/provider.ts#L73)* +*Defined in [providers/provider.ts:78](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/providers/provider.ts#L78)* **Parameters:** diff --git a/docs/classes/_signer_.inmemorysigner.md b/docs/classes/_signer_.inmemorysigner.md index d18e758a2c..936bb2f6ef 100644 --- a/docs/classes/_signer_.inmemorysigner.md +++ b/docs/classes/_signer_.inmemorysigner.md @@ -16,7 +16,7 @@ Signs using in memory key store. ⊕ **new InMemorySigner**(keyStore: *[KeyStore](_key_stores_keystore_.keystore.md)*): [InMemorySigner](_signer_.inmemorysigner.md) -*Defined in [signer.ts:47](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/signer.ts#L47)* +*Defined in [signer.ts:47](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/signer.ts#L47)* **Parameters:** @@ -36,7 +36,7 @@ ___ **● keyStore**: *[KeyStore](_key_stores_keystore_.keystore.md)* -*Defined in [signer.ts:47](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/signer.ts#L47)* +*Defined in [signer.ts:47](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/signer.ts#L47)* ___ @@ -46,11 +46,11 @@ ___ ## createKey -▸ **createKey**(accountId: *`string`*, networkId: *`string`*): `Promise`<`string`> +▸ **createKey**(accountId: *`string`*, networkId: *`string`*): `Promise`<[PublicKey](_utils_key_pair_.publickey.md)> *Overrides [Signer](_signer_.signer.md).[createKey](_signer_.signer.md#createkey)* -*Defined in [signer.ts:54](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/signer.ts#L54)* +*Defined in [signer.ts:54](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/signer.ts#L54)* **Parameters:** @@ -59,18 +59,18 @@ ___ | accountId | `string` | | networkId | `string` | -**Returns:** `Promise`<`string`> +**Returns:** `Promise`<[PublicKey](_utils_key_pair_.publickey.md)> ___ ## getPublicKey -▸ **getPublicKey**(accountId?: *`string`*, networkId?: *`string`*): `Promise`<`string`> +▸ **getPublicKey**(accountId?: *`string`*, networkId?: *`string`*): `Promise`<[PublicKey](_utils_key_pair_.publickey.md)> *Overrides [Signer](_signer_.signer.md).[getPublicKey](_signer_.signer.md#getpublickey)* -*Defined in [signer.ts:60](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/signer.ts#L60)* +*Defined in [signer.ts:60](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/signer.ts#L60)* **Parameters:** @@ -79,7 +79,7 @@ ___ | `Optional` accountId | `string` | | `Optional` networkId | `string` | -**Returns:** `Promise`<`string`> +**Returns:** `Promise`<[PublicKey](_utils_key_pair_.publickey.md)> ___ @@ -90,7 +90,7 @@ ___ *Overrides [Signer](_signer_.signer.md).[signHash](_signer_.signer.md#signhash)* -*Defined in [signer.ts:65](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/signer.ts#L65)* +*Defined in [signer.ts:65](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/signer.ts#L65)* **Parameters:** @@ -111,7 +111,7 @@ ___ *Inherited from [Signer](_signer_.signer.md).[signMessage](_signer_.signer.md#signmessage)* -*Defined in [signer.ts:38](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/signer.ts#L38)* +*Defined in [signer.ts:38](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/signer.ts#L38)* Signs given message, by first hashing with sha256. diff --git a/docs/classes/_signer_.signer.md b/docs/classes/_signer_.signer.md index f7b4d3daef..bf472e1ee4 100644 --- a/docs/classes/_signer_.signer.md +++ b/docs/classes/_signer_.signer.md @@ -14,9 +14,9 @@ General signing interface, can be used for in memory signing, RPC singing, exter ## `` createKey -▸ **createKey**(accountId: *`string`*, networkId?: *`string`*): `Promise`<`string`> +▸ **createKey**(accountId: *`string`*, networkId?: *`string`*): `Promise`<[PublicKey](_utils_key_pair_.publickey.md)> -*Defined in [signer.ts:15](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/signer.ts#L15)* +*Defined in [signer.ts:15](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/signer.ts#L15)* Creates new key and returns public key. @@ -27,16 +27,16 @@ Creates new key and returns public key. | accountId | `string` | | `Optional` networkId | `string` | -**Returns:** `Promise`<`string`> +**Returns:** `Promise`<[PublicKey](_utils_key_pair_.publickey.md)> ___ ## `` getPublicKey -▸ **getPublicKey**(accountId?: *`string`*, networkId?: *`string`*): `Promise`<`string`> +▸ **getPublicKey**(accountId?: *`string`*, networkId?: *`string`*): `Promise`<[PublicKey](_utils_key_pair_.publickey.md)> -*Defined in [signer.ts:22](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/signer.ts#L22)* +*Defined in [signer.ts:22](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/signer.ts#L22)* Returns public key for given account / network. @@ -47,7 +47,7 @@ Returns public key for given account / network. | `Optional` accountId | `string` | accountId to retrieve from. | | `Optional` networkId | `string` | network for this accountId. | -**Returns:** `Promise`<`string`> +**Returns:** `Promise`<[PublicKey](_utils_key_pair_.publickey.md)> ___ @@ -56,7 +56,7 @@ ___ ▸ **signHash**(hash: *`Uint8Array`*, accountId?: *`string`*, networkId?: *`string`*): `Promise`<[Signature](../interfaces/_utils_key_pair_.signature.md)> -*Defined in [signer.ts:30](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/signer.ts#L30)* +*Defined in [signer.ts:30](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/signer.ts#L30)* Signs given hash. @@ -77,7 +77,7 @@ ___ ▸ **signMessage**(message: *`Uint8Array`*, accountId?: *`string`*, networkId?: *`string`*): `Promise`<[Signature](../interfaces/_utils_key_pair_.signature.md)> -*Defined in [signer.ts:38](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/signer.ts#L38)* +*Defined in [signer.ts:38](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/signer.ts#L38)* Signs given message, by first hashing with sha256. diff --git a/docs/classes/_transaction_.accesskey.md b/docs/classes/_transaction_.accesskey.md new file mode 100644 index 0000000000..eb788d9837 --- /dev/null +++ b/docs/classes/_transaction_.accesskey.md @@ -0,0 +1,51 @@ + + +# Hierarchy + + [Assignable](_transaction_.assignable.md) + +**↳ AccessKey** + +# Constructors + + + +## constructor + +⊕ **new AccessKey**(properties: *`any`*): [AccessKey](_transaction_.accesskey.md) + +*Inherited from [Assignable](_transaction_.assignable.md).[constructor](_transaction_.assignable.md#constructor)* + +*Defined in [transaction.ts:24](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L24)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| properties | `any` | + +**Returns:** [AccessKey](_transaction_.accesskey.md) + +___ + +# Properties + + + +## nonce + +**● nonce**: *`number`* + +*Defined in [transaction.ts:46](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L46)* + +___ + + +## permission + +**● permission**: *[AccessKeyPermission](_transaction_.accesskeypermission.md)* + +*Defined in [transaction.ts:47](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L47)* + +___ + diff --git a/docs/classes/_transaction_.accesskeypermission.md b/docs/classes/_transaction_.accesskeypermission.md new file mode 100644 index 0000000000..3c1f2a0415 --- /dev/null +++ b/docs/classes/_transaction_.accesskeypermission.md @@ -0,0 +1,62 @@ + + +# Hierarchy + + [Enum](_transaction_.enum.md) + +**↳ AccessKeyPermission** + +# Constructors + + + +## constructor + +⊕ **new AccessKeyPermission**(properties: *`any`*): [AccessKeyPermission](_transaction_.accesskeypermission.md) + +*Inherited from [Enum](_transaction_.enum.md).[constructor](_transaction_.enum.md#constructor)* + +*Defined in [transaction.ts:11](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L11)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| properties | `any` | + +**Returns:** [AccessKeyPermission](_transaction_.accesskeypermission.md) + +___ + +# Properties + + + +## enum + +**● enum**: *`string`* + +*Inherited from [Enum](_transaction_.enum.md).[enum](_transaction_.enum.md#enum)* + +*Defined in [transaction.ts:11](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L11)* + +___ + + +## fullAccess + +**● fullAccess**: *[FullAccessPermission](_transaction_.fullaccesspermission.md)* + +*Defined in [transaction.ts:42](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L42)* + +___ + + +## functionCall + +**● functionCall**: *[FunctionCallPermission](_transaction_.functioncallpermission.md)* + +*Defined in [transaction.ts:41](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L41)* + +___ + diff --git a/docs/classes/_transaction_.action.md b/docs/classes/_transaction_.action.md new file mode 100644 index 0000000000..50acfd2f22 --- /dev/null +++ b/docs/classes/_transaction_.action.md @@ -0,0 +1,116 @@ + + +# Hierarchy + + [Enum](_transaction_.enum.md) + +**↳ Action** + +# Constructors + + + +## constructor + +⊕ **new Action**(properties: *`any`*): [Action](_transaction_.action.md) + +*Inherited from [Enum](_transaction_.enum.md).[constructor](_transaction_.enum.md#constructor)* + +*Defined in [transaction.ts:11](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L11)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| properties | `any` | + +**Returns:** [Action](_transaction_.action.md) + +___ + +# Properties + + + +## addKey + +**● addKey**: *[AddKey](_transaction_.addkey.md)* + +*Defined in [transaction.ts:135](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L135)* + +___ + + +## createAccount + +**● createAccount**: *[CreateAccount](_transaction_.createaccount.md)* + +*Defined in [transaction.ts:130](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L130)* + +___ + + +## deleteAccount + +**● deleteAccount**: *[DeleteAccount](_transaction_.deleteaccount.md)* + +*Defined in [transaction.ts:137](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L137)* + +___ + + +## deleteKey + +**● deleteKey**: *[DeleteKey](_transaction_.deletekey.md)* + +*Defined in [transaction.ts:136](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L136)* + +___ + + +## deployContract + +**● deployContract**: *[DeployContract](_transaction_.deploycontract.md)* + +*Defined in [transaction.ts:131](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L131)* + +___ + + +## enum + +**● enum**: *`string`* + +*Inherited from [Enum](_transaction_.enum.md).[enum](_transaction_.enum.md#enum)* + +*Defined in [transaction.ts:11](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L11)* + +___ + + +## functionCall + +**● functionCall**: *[FunctionCall](_transaction_.functioncall.md)* + +*Defined in [transaction.ts:132](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L132)* + +___ + + +## stake + +**● stake**: *[Stake](_transaction_.stake.md)* + +*Defined in [transaction.ts:134](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L134)* + +___ + + +## transfer + +**● transfer**: *[Transfer](_transaction_.transfer.md)* + +*Defined in [transaction.ts:133](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L133)* + +___ + diff --git a/docs/classes/_transaction_.addkey.md b/docs/classes/_transaction_.addkey.md new file mode 100644 index 0000000000..56bad6c940 --- /dev/null +++ b/docs/classes/_transaction_.addkey.md @@ -0,0 +1,51 @@ + + +# Hierarchy + +↳ [IAction](_transaction_.iaction.md) + +**↳ AddKey** + +# Constructors + + + +## constructor + +⊕ **new AddKey**(properties: *`any`*): [AddKey](_transaction_.addkey.md) + +*Inherited from [Assignable](_transaction_.assignable.md).[constructor](_transaction_.assignable.md#constructor)* + +*Defined in [transaction.ts:24](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L24)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| properties | `any` | + +**Returns:** [AddKey](_transaction_.addkey.md) + +___ + +# Properties + + + +## accessKey + +**● accessKey**: *[AccessKey](_transaction_.accesskey.md)* + +*Defined in [transaction.ts:65](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L65)* + +___ + + +## publicKey + +**● publicKey**: *[PublicKey](_utils_key_pair_.publickey.md)* + +*Defined in [transaction.ts:65](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L65)* + +___ + diff --git a/docs/classes/_transaction_.assignable.md b/docs/classes/_transaction_.assignable.md new file mode 100644 index 0000000000..3e431c6ae3 --- /dev/null +++ b/docs/classes/_transaction_.assignable.md @@ -0,0 +1,38 @@ + + +# Hierarchy + +**Assignable** + +↳ [FunctionCallPermission](_transaction_.functioncallpermission.md) + +↳ [FullAccessPermission](_transaction_.fullaccesspermission.md) + +↳ [AccessKey](_transaction_.accesskey.md) + +↳ [IAction](_transaction_.iaction.md) + +↳ [Transaction](_transaction_.transaction.md) + +↳ [SignedTransaction](_transaction_.signedtransaction.md) + +# Constructors + + + +## constructor + +⊕ **new Assignable**(properties: *`any`*): [Assignable](_transaction_.assignable.md) + +*Defined in [transaction.ts:24](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L24)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| properties | `any` | + +**Returns:** [Assignable](_transaction_.assignable.md) + +___ + diff --git a/docs/classes/_transaction_.createaccount.md b/docs/classes/_transaction_.createaccount.md new file mode 100644 index 0000000000..c70f9b63ba --- /dev/null +++ b/docs/classes/_transaction_.createaccount.md @@ -0,0 +1,30 @@ + + +# Hierarchy + +↳ [IAction](_transaction_.iaction.md) + +**↳ CreateAccount** + +# Constructors + + + +## constructor + +⊕ **new CreateAccount**(properties: *`any`*): [CreateAccount](_transaction_.createaccount.md) + +*Inherited from [Assignable](_transaction_.assignable.md).[constructor](_transaction_.assignable.md#constructor)* + +*Defined in [transaction.ts:24](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L24)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| properties | `any` | + +**Returns:** [CreateAccount](_transaction_.createaccount.md) + +___ + diff --git a/docs/classes/_transaction_.deleteaccount.md b/docs/classes/_transaction_.deleteaccount.md new file mode 100644 index 0000000000..74aec3e8fd --- /dev/null +++ b/docs/classes/_transaction_.deleteaccount.md @@ -0,0 +1,42 @@ + + +# Hierarchy + +↳ [IAction](_transaction_.iaction.md) + +**↳ DeleteAccount** + +# Constructors + + + +## constructor + +⊕ **new DeleteAccount**(properties: *`any`*): [DeleteAccount](_transaction_.deleteaccount.md) + +*Inherited from [Assignable](_transaction_.assignable.md).[constructor](_transaction_.assignable.md#constructor)* + +*Defined in [transaction.ts:24](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L24)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| properties | `any` | + +**Returns:** [DeleteAccount](_transaction_.deleteaccount.md) + +___ + +# Properties + + + +## beneficiaryId + +**● beneficiaryId**: *`string`* + +*Defined in [transaction.ts:67](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L67)* + +___ + diff --git a/docs/classes/_transaction_.deletekey.md b/docs/classes/_transaction_.deletekey.md new file mode 100644 index 0000000000..72f6fb2ca3 --- /dev/null +++ b/docs/classes/_transaction_.deletekey.md @@ -0,0 +1,42 @@ + + +# Hierarchy + +↳ [IAction](_transaction_.iaction.md) + +**↳ DeleteKey** + +# Constructors + + + +## constructor + +⊕ **new DeleteKey**(properties: *`any`*): [DeleteKey](_transaction_.deletekey.md) + +*Inherited from [Assignable](_transaction_.assignable.md).[constructor](_transaction_.assignable.md#constructor)* + +*Defined in [transaction.ts:24](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L24)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| properties | `any` | + +**Returns:** [DeleteKey](_transaction_.deletekey.md) + +___ + +# Properties + + + +## publicKey + +**● publicKey**: *[PublicKey](_utils_key_pair_.publickey.md)* + +*Defined in [transaction.ts:66](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L66)* + +___ + diff --git a/docs/classes/_transaction_.deploycontract.md b/docs/classes/_transaction_.deploycontract.md new file mode 100644 index 0000000000..b4b0145efb --- /dev/null +++ b/docs/classes/_transaction_.deploycontract.md @@ -0,0 +1,42 @@ + + +# Hierarchy + +↳ [IAction](_transaction_.iaction.md) + +**↳ DeployContract** + +# Constructors + + + +## constructor + +⊕ **new DeployContract**(properties: *`any`*): [DeployContract](_transaction_.deploycontract.md) + +*Inherited from [Assignable](_transaction_.assignable.md).[constructor](_transaction_.assignable.md#constructor)* + +*Defined in [transaction.ts:24](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L24)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| properties | `any` | + +**Returns:** [DeployContract](_transaction_.deploycontract.md) + +___ + +# Properties + + + +## code + +**● code**: *`Uint8Array`* + +*Defined in [transaction.ts:61](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L61)* + +___ + diff --git a/docs/classes/_transaction_.enum.md b/docs/classes/_transaction_.enum.md new file mode 100644 index 0000000000..b3f0982bef --- /dev/null +++ b/docs/classes/_transaction_.enum.md @@ -0,0 +1,42 @@ + + +# Hierarchy + +**Enum** + +↳ [AccessKeyPermission](_transaction_.accesskeypermission.md) + +↳ [Action](_transaction_.action.md) + +# Constructors + + + +## constructor + +⊕ **new Enum**(properties: *`any`*): [Enum](_transaction_.enum.md) + +*Defined in [transaction.ts:11](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L11)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| properties | `any` | + +**Returns:** [Enum](_transaction_.enum.md) + +___ + +# Properties + + + +## enum + +**● enum**: *`string`* + +*Defined in [transaction.ts:11](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L11)* + +___ + diff --git a/docs/classes/_transaction_.fullaccesspermission.md b/docs/classes/_transaction_.fullaccesspermission.md new file mode 100644 index 0000000000..6a78d6f74e --- /dev/null +++ b/docs/classes/_transaction_.fullaccesspermission.md @@ -0,0 +1,30 @@ + + +# Hierarchy + + [Assignable](_transaction_.assignable.md) + +**↳ FullAccessPermission** + +# Constructors + + + +## constructor + +⊕ **new FullAccessPermission**(properties: *`any`*): [FullAccessPermission](_transaction_.fullaccesspermission.md) + +*Inherited from [Assignable](_transaction_.assignable.md).[constructor](_transaction_.assignable.md#constructor)* + +*Defined in [transaction.ts:24](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L24)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| properties | `any` | + +**Returns:** [FullAccessPermission](_transaction_.fullaccesspermission.md) + +___ + diff --git a/docs/classes/_transaction_.functioncall.md b/docs/classes/_transaction_.functioncall.md new file mode 100644 index 0000000000..b1fe01de6c --- /dev/null +++ b/docs/classes/_transaction_.functioncall.md @@ -0,0 +1,69 @@ + + +# Hierarchy + +↳ [IAction](_transaction_.iaction.md) + +**↳ FunctionCall** + +# Constructors + + + +## constructor + +⊕ **new FunctionCall**(properties: *`any`*): [FunctionCall](_transaction_.functioncall.md) + +*Inherited from [Assignable](_transaction_.assignable.md).[constructor](_transaction_.assignable.md#constructor)* + +*Defined in [transaction.ts:24](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L24)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| properties | `any` | + +**Returns:** [FunctionCall](_transaction_.functioncall.md) + +___ + +# Properties + + + +## args + +**● args**: *`Uint8Array`* + +*Defined in [transaction.ts:62](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L62)* + +___ + + +## deposit + +**● deposit**: *`BN`* + +*Defined in [transaction.ts:62](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L62)* + +___ + + +## gas + +**● gas**: *`BN`* + +*Defined in [transaction.ts:62](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L62)* + +___ + + +## methodName + +**● methodName**: *`string`* + +*Defined in [transaction.ts:62](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L62)* + +___ + diff --git a/docs/classes/_transaction_.functioncallpermission.md b/docs/classes/_transaction_.functioncallpermission.md new file mode 100644 index 0000000000..64623aaa1f --- /dev/null +++ b/docs/classes/_transaction_.functioncallpermission.md @@ -0,0 +1,60 @@ + + +# Hierarchy + + [Assignable](_transaction_.assignable.md) + +**↳ FunctionCallPermission** + +# Constructors + + + +## constructor + +⊕ **new FunctionCallPermission**(properties: *`any`*): [FunctionCallPermission](_transaction_.functioncallpermission.md) + +*Inherited from [Assignable](_transaction_.assignable.md).[constructor](_transaction_.assignable.md#constructor)* + +*Defined in [transaction.ts:24](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L24)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| properties | `any` | + +**Returns:** [FunctionCallPermission](_transaction_.functioncallpermission.md) + +___ + +# Properties + + + +## `` allowance + +**● allowance**: *`BN`* + +*Defined in [transaction.ts:33](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L33)* + +___ + + +## methodNames + +**● methodNames**: *`String`[]* + +*Defined in [transaction.ts:35](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L35)* + +___ + + +## receiverId + +**● receiverId**: *`string`* + +*Defined in [transaction.ts:34](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L34)* + +___ + diff --git a/docs/classes/_transaction_.iaction.md b/docs/classes/_transaction_.iaction.md new file mode 100644 index 0000000000..000c6861c8 --- /dev/null +++ b/docs/classes/_transaction_.iaction.md @@ -0,0 +1,46 @@ + + +# Hierarchy + + [Assignable](_transaction_.assignable.md) + +**↳ IAction** + +↳ [CreateAccount](_transaction_.createaccount.md) + +↳ [DeployContract](_transaction_.deploycontract.md) + +↳ [FunctionCall](_transaction_.functioncall.md) + +↳ [Transfer](_transaction_.transfer.md) + +↳ [Stake](_transaction_.stake.md) + +↳ [AddKey](_transaction_.addkey.md) + +↳ [DeleteKey](_transaction_.deletekey.md) + +↳ [DeleteAccount](_transaction_.deleteaccount.md) + +# Constructors + + + +## constructor + +⊕ **new IAction**(properties: *`any`*): [IAction](_transaction_.iaction.md) + +*Inherited from [Assignable](_transaction_.assignable.md).[constructor](_transaction_.assignable.md#constructor)* + +*Defined in [transaction.ts:24](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L24)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| properties | `any` | + +**Returns:** [IAction](_transaction_.iaction.md) + +___ + diff --git a/docs/classes/_transaction_.signature.md b/docs/classes/_transaction_.signature.md new file mode 100644 index 0000000000..bf5ae9f4ca --- /dev/null +++ b/docs/classes/_transaction_.signature.md @@ -0,0 +1,47 @@ + + +# Hierarchy + +**Signature** + +# Constructors + + + +## constructor + +⊕ **new Signature**(signature: *`Uint8Array`*): [Signature](_transaction_.signature.md) + +*Defined in [transaction.ts:103](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L103)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| signature | `Uint8Array` | + +**Returns:** [Signature](_transaction_.signature.md) + +___ + +# Properties + + + +## data + +**● data**: *`Uint8Array`* + +*Defined in [transaction.ts:103](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L103)* + +___ + + +## keyType + +**● keyType**: *[KeyType](../enums/_utils_key_pair_.keytype.md)* + +*Defined in [transaction.ts:102](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L102)* + +___ + diff --git a/docs/classes/_transaction_.signedtransaction.md b/docs/classes/_transaction_.signedtransaction.md new file mode 100644 index 0000000000..7b89a0bc28 --- /dev/null +++ b/docs/classes/_transaction_.signedtransaction.md @@ -0,0 +1,65 @@ + + +# Hierarchy + + [Assignable](_transaction_.assignable.md) + +**↳ SignedTransaction** + +# Constructors + + + +## constructor + +⊕ **new SignedTransaction**(properties: *`any`*): [SignedTransaction](_transaction_.signedtransaction.md) + +*Inherited from [Assignable](_transaction_.assignable.md).[constructor](_transaction_.assignable.md#constructor)* + +*Defined in [transaction.ts:24](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L24)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| properties | `any` | + +**Returns:** [SignedTransaction](_transaction_.signedtransaction.md) + +___ + +# Properties + + + +## signature + +**● signature**: *[Signature](_transaction_.signature.md)* + +*Defined in [transaction.ts:122](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L122)* + +___ + + +## transaction + +**● transaction**: *[Transaction](_transaction_.transaction.md)* + +*Defined in [transaction.ts:121](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L121)* + +___ + +# Methods + + + +## encode + +▸ **encode**(): `Uint8Array` + +*Defined in [transaction.ts:124](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L124)* + +**Returns:** `Uint8Array` + +___ + diff --git a/docs/classes/_transaction_.stake.md b/docs/classes/_transaction_.stake.md new file mode 100644 index 0000000000..9cba556a6b --- /dev/null +++ b/docs/classes/_transaction_.stake.md @@ -0,0 +1,51 @@ + + +# Hierarchy + +↳ [IAction](_transaction_.iaction.md) + +**↳ Stake** + +# Constructors + + + +## constructor + +⊕ **new Stake**(properties: *`any`*): [Stake](_transaction_.stake.md) + +*Inherited from [Assignable](_transaction_.assignable.md).[constructor](_transaction_.assignable.md#constructor)* + +*Defined in [transaction.ts:24](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L24)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| properties | `any` | + +**Returns:** [Stake](_transaction_.stake.md) + +___ + +# Properties + + + +## publicKey + +**● publicKey**: *[PublicKey](_utils_key_pair_.publickey.md)* + +*Defined in [transaction.ts:64](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L64)* + +___ + + +## stake + +**● stake**: *`BN`* + +*Defined in [transaction.ts:64](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L64)* + +___ + diff --git a/docs/classes/_transaction_.transaction.md b/docs/classes/_transaction_.transaction.md new file mode 100644 index 0000000000..b0bc9df91d --- /dev/null +++ b/docs/classes/_transaction_.transaction.md @@ -0,0 +1,87 @@ + + +# Hierarchy + + [Assignable](_transaction_.assignable.md) + +**↳ Transaction** + +# Constructors + + + +## constructor + +⊕ **new Transaction**(properties: *`any`*): [Transaction](_transaction_.transaction.md) + +*Inherited from [Assignable](_transaction_.assignable.md).[constructor](_transaction_.assignable.md#constructor)* + +*Defined in [transaction.ts:24](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L24)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| properties | `any` | + +**Returns:** [Transaction](_transaction_.transaction.md) + +___ + +# Properties + + + +## actions + +**● actions**: *[Action](_transaction_.action.md)[]* + +*Defined in [transaction.ts:116](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L116)* + +___ + + +## blockHash + +**● blockHash**: *`Uint8Array`* + +*Defined in [transaction.ts:117](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L117)* + +___ + + +## nonce + +**● nonce**: *`number`* + +*Defined in [transaction.ts:114](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L114)* + +___ + + +## publicKey + +**● publicKey**: *[PublicKey](_utils_key_pair_.publickey.md)* + +*Defined in [transaction.ts:113](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L113)* + +___ + + +## receiverId + +**● receiverId**: *`string`* + +*Defined in [transaction.ts:115](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L115)* + +___ + + +## signerId + +**● signerId**: *`string`* + +*Defined in [transaction.ts:112](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L112)* + +___ + diff --git a/docs/classes/_transaction_.transfer.md b/docs/classes/_transaction_.transfer.md new file mode 100644 index 0000000000..664813a666 --- /dev/null +++ b/docs/classes/_transaction_.transfer.md @@ -0,0 +1,42 @@ + + +# Hierarchy + +↳ [IAction](_transaction_.iaction.md) + +**↳ Transfer** + +# Constructors + + + +## constructor + +⊕ **new Transfer**(properties: *`any`*): [Transfer](_transaction_.transfer.md) + +*Inherited from [Assignable](_transaction_.assignable.md).[constructor](_transaction_.assignable.md#constructor)* + +*Defined in [transaction.ts:24](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L24)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| properties | `any` | + +**Returns:** [Transfer](_transaction_.transfer.md) + +___ + +# Properties + + + +## deposit + +**● deposit**: *`BN`* + +*Defined in [transaction.ts:63](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L63)* + +___ + diff --git a/docs/classes/_utils_key_pair_.keypair.md b/docs/classes/_utils_key_pair_.keypair.md index 970175001c..940a5eefc7 100644 --- a/docs/classes/_utils_key_pair_.keypair.md +++ b/docs/classes/_utils_key_pair_.keypair.md @@ -12,11 +12,11 @@ ## `` getPublicKey -▸ **getPublicKey**(): `string` +▸ **getPublicKey**(): [PublicKey](_utils_key_pair_.publickey.md) -*Defined in [utils/key_pair.ts:17](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/utils/key_pair.ts#L17)* +*Defined in [utils/key_pair.ts:71](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/key_pair.ts#L71)* -**Returns:** `string` +**Returns:** [PublicKey](_utils_key_pair_.publickey.md) ___ @@ -25,7 +25,7 @@ ___ ▸ **sign**(message: *`Uint8Array`*): [Signature](../interfaces/_utils_key_pair_.signature.md) -*Defined in [utils/key_pair.ts:14](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/utils/key_pair.ts#L14)* +*Defined in [utils/key_pair.ts:68](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/key_pair.ts#L68)* **Parameters:** @@ -42,7 +42,7 @@ ___ ▸ **toString**(): `string` -*Defined in [utils/key_pair.ts:16](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/utils/key_pair.ts#L16)* +*Defined in [utils/key_pair.ts:70](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/key_pair.ts#L70)* **Returns:** `string` @@ -53,7 +53,7 @@ ___ ▸ **verify**(message: *`Uint8Array`*, signature: *`Uint8Array`*): `boolean` -*Defined in [utils/key_pair.ts:15](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/utils/key_pair.ts#L15)* +*Defined in [utils/key_pair.ts:69](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/key_pair.ts#L69)* **Parameters:** @@ -71,7 +71,7 @@ ___ ▸ **fromRandom**(curve: *`string`*): [KeyPair](_utils_key_pair_.keypair.md) -*Defined in [utils/key_pair.ts:19](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/utils/key_pair.ts#L19)* +*Defined in [utils/key_pair.ts:73](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/key_pair.ts#L73)* **Parameters:** @@ -88,7 +88,7 @@ ___ ▸ **fromString**(encodedKey: *`string`*): [KeyPair](_utils_key_pair_.keypair.md) -*Defined in [utils/key_pair.ts:26](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/utils/key_pair.ts#L26)* +*Defined in [utils/key_pair.ts:80](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/key_pair.ts#L80)* **Parameters:** diff --git a/docs/classes/_utils_key_pair_.keypaired25519.md b/docs/classes/_utils_key_pair_.keypaired25519.md index 76d9b8e3c5..1b4a482650 100644 --- a/docs/classes/_utils_key_pair_.keypaired25519.md +++ b/docs/classes/_utils_key_pair_.keypaired25519.md @@ -16,7 +16,7 @@ This class provides key pair functionality for Ed25519 curve: generating key pai ⊕ **new KeyPairEd25519**(secretKey: *`string`*): [KeyPairEd25519](_utils_key_pair_.keypaired25519.md) -*Defined in [utils/key_pair.ts:44](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/utils/key_pair.ts#L44)* +*Defined in [utils/key_pair.ts:101](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/key_pair.ts#L101)* Construct an instance of key pair given a secret key. It's generally assumed that these are encoded in base58. @@ -36,9 +36,9 @@ ___ ## publicKey -**● publicKey**: *`string`* +**● publicKey**: *[PublicKey](_utils_key_pair_.publickey.md)* -*Defined in [utils/key_pair.ts:43](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/utils/key_pair.ts#L43)* +*Defined in [utils/key_pair.ts:100](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/key_pair.ts#L100)* ___ @@ -47,7 +47,7 @@ ___ **● secretKey**: *`string`* -*Defined in [utils/key_pair.ts:44](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/utils/key_pair.ts#L44)* +*Defined in [utils/key_pair.ts:101](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/key_pair.ts#L101)* ___ @@ -57,13 +57,13 @@ ___ ## getPublicKey -▸ **getPublicKey**(): `string` +▸ **getPublicKey**(): [PublicKey](_utils_key_pair_.publickey.md) *Overrides [KeyPair](_utils_key_pair_.keypair.md).[getPublicKey](_utils_key_pair_.keypair.md#getpublickey)* -*Defined in [utils/key_pair.ts:86](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/utils/key_pair.ts#L86)* +*Defined in [utils/key_pair.ts:143](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/key_pair.ts#L143)* -**Returns:** `string` +**Returns:** [PublicKey](_utils_key_pair_.publickey.md) ___ @@ -74,7 +74,7 @@ ___ *Overrides [KeyPair](_utils_key_pair_.keypair.md).[sign](_utils_key_pair_.keypair.md#sign)* -*Defined in [utils/key_pair.ts:73](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/utils/key_pair.ts#L73)* +*Defined in [utils/key_pair.ts:130](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/key_pair.ts#L130)* **Parameters:** @@ -93,7 +93,7 @@ ___ *Overrides [KeyPair](_utils_key_pair_.keypair.md).[toString](_utils_key_pair_.keypair.md#tostring)* -*Defined in [utils/key_pair.ts:82](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/utils/key_pair.ts#L82)* +*Defined in [utils/key_pair.ts:139](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/key_pair.ts#L139)* **Returns:** `string` @@ -106,7 +106,7 @@ ___ *Overrides [KeyPair](_utils_key_pair_.keypair.md).[verify](_utils_key_pair_.keypair.md#verify)* -*Defined in [utils/key_pair.ts:78](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/utils/key_pair.ts#L78)* +*Defined in [utils/key_pair.ts:135](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/key_pair.ts#L135)* **Parameters:** @@ -126,7 +126,7 @@ ___ *Overrides [KeyPair](_utils_key_pair_.keypair.md).[fromRandom](_utils_key_pair_.keypair.md#fromrandom)* -*Defined in [utils/key_pair.ts:68](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/utils/key_pair.ts#L68)* +*Defined in [utils/key_pair.ts:125](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/key_pair.ts#L125)* Generate a new random keypair. @@ -145,7 +145,7 @@ ___ *Inherited from [KeyPair](_utils_key_pair_.keypair.md).[fromString](_utils_key_pair_.keypair.md#fromstring)* -*Defined in [utils/key_pair.ts:26](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/utils/key_pair.ts#L26)* +*Defined in [utils/key_pair.ts:80](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/key_pair.ts#L80)* **Parameters:** diff --git a/docs/classes/_utils_key_pair_.publickey.md b/docs/classes/_utils_key_pair_.publickey.md new file mode 100644 index 0000000000..8d3fb4c0c9 --- /dev/null +++ b/docs/classes/_utils_key_pair_.publickey.md @@ -0,0 +1,98 @@ + + +PublicKey representation that has type and bytes of the key. + +# Hierarchy + +**PublicKey** + +# Constructors + + + +## constructor + +⊕ **new PublicKey**(keyType: *[KeyType](../enums/_utils_key_pair_.keytype.md)*, data: *`Uint8Array`*): [PublicKey](_utils_key_pair_.publickey.md) + +*Defined in [utils/key_pair.ts:37](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/key_pair.ts#L37)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| keyType | [KeyType](../enums/_utils_key_pair_.keytype.md) | +| data | `Uint8Array` | + +**Returns:** [PublicKey](_utils_key_pair_.publickey.md) + +___ + +# Properties + + + +## data + +**● data**: *`Uint8Array`* + +*Defined in [utils/key_pair.ts:37](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/key_pair.ts#L37)* + +___ + + +## keyType + +**● keyType**: *[KeyType](../enums/_utils_key_pair_.keytype.md)* + +*Defined in [utils/key_pair.ts:36](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/key_pair.ts#L36)* + +___ + +# Methods + + + +## toString + +▸ **toString**(): `string` + +*Defined in [utils/key_pair.ts:62](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/key_pair.ts#L62)* + +**Returns:** `string` + +___ + + +## `` from + +▸ **from**(value: *`string` \| [PublicKey](_utils_key_pair_.publickey.md)*): [PublicKey](_utils_key_pair_.publickey.md) + +*Defined in [utils/key_pair.ts:44](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/key_pair.ts#L44)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| value | `string` \| [PublicKey](_utils_key_pair_.publickey.md) | + +**Returns:** [PublicKey](_utils_key_pair_.publickey.md) + +___ + + +## `` fromString + +▸ **fromString**(encodedKey: *`string`*): [PublicKey](_utils_key_pair_.publickey.md) + +*Defined in [utils/key_pair.ts:51](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/key_pair.ts#L51)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| encodedKey | `string` | + +**Returns:** [PublicKey](_utils_key_pair_.publickey.md) + +___ + diff --git a/docs/classes/_utils_serialize_.binaryreader.md b/docs/classes/_utils_serialize_.binaryreader.md new file mode 100644 index 0000000000..76f2980e44 --- /dev/null +++ b/docs/classes/_utils_serialize_.binaryreader.md @@ -0,0 +1,156 @@ + + +# Hierarchy + +**BinaryReader** + +# Constructors + + + +## constructor + +⊕ **new BinaryReader**(buf: *`Buffer`*): [BinaryReader](_utils_serialize_.binaryreader.md) + +*Defined in [utils/serialize.ts:92](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/serialize.ts#L92)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| buf | `Buffer` | + +**Returns:** [BinaryReader](_utils_serialize_.binaryreader.md) + +___ + +# Properties + + + +## buf + +**● buf**: *`Buffer`* + +*Defined in [utils/serialize.ts:91](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/serialize.ts#L91)* + +___ + + +## offset + +**● offset**: *`number`* + +*Defined in [utils/serialize.ts:92](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/serialize.ts#L92)* + +___ + +# Methods + + + +## read_array + +▸ **read_array**(fn: *`any`*): `any`[] + +*Defined in [utils/serialize.ts:137](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/serialize.ts#L137)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| fn | `any` | + +**Returns:** `any`[] + +___ + + +## `` read_buffer + +▸ **read_buffer**(len: *`number`*): `Buffer` + +*Defined in [utils/serialize.ts:122](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/serialize.ts#L122)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| len | `number` | + +**Returns:** `Buffer` + +___ + + +## read_fixed_array + +▸ **read_fixed_array**(len: *`number`*): `Uint8Array` + +*Defined in [utils/serialize.ts:133](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/serialize.ts#L133)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| len | `number` | + +**Returns:** `Uint8Array` + +___ + + +## read_string + +▸ **read_string**(): `string` + +*Defined in [utils/serialize.ts:128](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/serialize.ts#L128)* + +**Returns:** `string` + +___ + + +## read_u128 + +▸ **read_u128**(): `BN` + +*Defined in [utils/serialize.ts:117](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/serialize.ts#L117)* + +**Returns:** `BN` + +___ + + +## read_u32 + +▸ **read_u32**(): `number` + +*Defined in [utils/serialize.ts:105](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/serialize.ts#L105)* + +**Returns:** `number` + +___ + + +## read_u64 + +▸ **read_u64**(): `BN` + +*Defined in [utils/serialize.ts:111](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/serialize.ts#L111)* + +**Returns:** `BN` + +___ + + +## read_u8 + +▸ **read_u8**(): `number` + +*Defined in [utils/serialize.ts:99](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/serialize.ts#L99)* + +**Returns:** `number` + +___ + diff --git a/docs/classes/_utils_serialize_.binarywriter.md b/docs/classes/_utils_serialize_.binarywriter.md new file mode 100644 index 0000000000..555b440719 --- /dev/null +++ b/docs/classes/_utils_serialize_.binarywriter.md @@ -0,0 +1,203 @@ + + +# Hierarchy + +**BinaryWriter** + +# Constructors + + + +## constructor + +⊕ **new BinaryWriter**(): [BinaryWriter](_utils_serialize_.binarywriter.md) + +*Defined in [utils/serialize.ts:24](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/serialize.ts#L24)* + +**Returns:** [BinaryWriter](_utils_serialize_.binarywriter.md) + +___ + +# Properties + + + +## buf + +**● buf**: *`Buffer`* + +*Defined in [utils/serialize.ts:23](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/serialize.ts#L23)* + +___ + + +## length + +**● length**: *`number`* + +*Defined in [utils/serialize.ts:24](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/serialize.ts#L24)* + +___ + +# Methods + + + +## maybe_resize + +▸ **maybe_resize**(): `void` + +*Defined in [utils/serialize.ts:31](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/serialize.ts#L31)* + +**Returns:** `void` + +___ + + +## toArray + +▸ **toArray**(): `Uint8Array` + +*Defined in [utils/serialize.ts:85](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/serialize.ts#L85)* + +**Returns:** `Uint8Array` + +___ + + +## write_array + +▸ **write_array**(array: *`any`[]*, fn: *`any`*): `void` + +*Defined in [utils/serialize.ts:76](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/serialize.ts#L76)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| array | `any`[] | +| fn | `any` | + +**Returns:** `void` + +___ + + +## `` write_buffer + +▸ **write_buffer**(buffer: *`Buffer`*): `void` + +*Defined in [utils/serialize.ts:59](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/serialize.ts#L59)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| buffer | `Buffer` | + +**Returns:** `void` + +___ + + +## write_fixed_array + +▸ **write_fixed_array**(array: *`Uint8Array`*): `void` + +*Defined in [utils/serialize.ts:72](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/serialize.ts#L72)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| array | `Uint8Array` | + +**Returns:** `void` + +___ + + +## write_string + +▸ **write_string**(str: *`string`*): `void` + +*Defined in [utils/serialize.ts:65](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/serialize.ts#L65)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| str | `string` | + +**Returns:** `void` + +___ + + +## write_u128 + +▸ **write_u128**(value: *`BN`*): `void` + +*Defined in [utils/serialize.ts:54](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/serialize.ts#L54)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| value | `BN` | + +**Returns:** `void` + +___ + + +## write_u32 + +▸ **write_u32**(value: *`number`*): `void` + +*Defined in [utils/serialize.ts:43](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/serialize.ts#L43)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| value | `number` | + +**Returns:** `void` + +___ + + +## write_u64 + +▸ **write_u64**(value: *`BN`*): `void` + +*Defined in [utils/serialize.ts:49](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/serialize.ts#L49)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| value | `BN` | + +**Returns:** `void` + +___ + + +## write_u8 + +▸ **write_u8**(value: *`number`*): `void` + +*Defined in [utils/serialize.ts:37](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/serialize.ts#L37)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| value | `number` | + +**Returns:** `void` + +___ + diff --git a/docs/classes/_wallet_account_.walletaccount.md b/docs/classes/_wallet_account_.walletaccount.md index 4b59a1fce3..4b73253800 100644 --- a/docs/classes/_wallet_account_.walletaccount.md +++ b/docs/classes/_wallet_account_.walletaccount.md @@ -12,7 +12,7 @@ ⊕ **new WalletAccount**(near: *[Near](_near_.near.md)*, appKeyPrefix: *`string` \| `null`*): [WalletAccount](_wallet_account_.walletaccount.md) -*Defined in [wallet-account.ts:18](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/wallet-account.ts#L18)* +*Defined in [wallet-account.ts:18](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/wallet-account.ts#L18)* **Parameters:** @@ -33,7 +33,7 @@ ___ **● _authData**: *`any`* -*Defined in [wallet-account.ts:17](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/wallet-account.ts#L17)* +*Defined in [wallet-account.ts:17](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/wallet-account.ts#L17)* ___ @@ -42,7 +42,7 @@ ___ **● _authDataKey**: *`string`* -*Defined in [wallet-account.ts:15](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/wallet-account.ts#L15)* +*Defined in [wallet-account.ts:15](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/wallet-account.ts#L15)* ___ @@ -51,7 +51,7 @@ ___ **● _keyStore**: *[KeyStore](_key_stores_keystore_.keystore.md)* -*Defined in [wallet-account.ts:16](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/wallet-account.ts#L16)* +*Defined in [wallet-account.ts:16](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/wallet-account.ts#L16)* ___ @@ -60,7 +60,7 @@ ___ **● _networkId**: *`string`* -*Defined in [wallet-account.ts:18](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/wallet-account.ts#L18)* +*Defined in [wallet-account.ts:18](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/wallet-account.ts#L18)* ___ @@ -69,7 +69,7 @@ ___ **● _walletBaseUrl**: *`string`* -*Defined in [wallet-account.ts:14](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/wallet-account.ts#L14)* +*Defined in [wallet-account.ts:14](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/wallet-account.ts#L14)* ___ @@ -81,7 +81,7 @@ ___ ▸ **_completeSignInWithAccessKey**(): `Promise`<`void`> -*Defined in [wallet-account.ts:84](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/wallet-account.ts#L84)* +*Defined in [wallet-account.ts:84](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/wallet-account.ts#L84)* Complete sign in for a given account id and public key. To be invoked by the app when getting a callback from the wallet. @@ -94,7 +94,7 @@ ___ ▸ **_moveKeyFromTempToPermanent**(accountId: *`string`*, publicKey: *`string`*): `Promise`<`void`> -*Defined in [wallet-account.ts:97](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/wallet-account.ts#L97)* +*Defined in [wallet-account.ts:97](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/wallet-account.ts#L97)* **Parameters:** @@ -112,7 +112,7 @@ ___ ▸ **getAccountId**(): `any` -*Defined in [wallet-account.ts:46](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/wallet-account.ts#L46)* +*Defined in [wallet-account.ts:46](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/wallet-account.ts#L46)* Returns authorized Account ID. @@ -127,7 +127,7 @@ ___ ▸ **isSignedIn**(): `boolean` -*Defined in [wallet-account.ts:37](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/wallet-account.ts#L37)* +*Defined in [wallet-account.ts:37](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/wallet-account.ts#L37)* Returns true, if this WalletAccount is authorized with the wallet. @@ -142,7 +142,7 @@ ___ ▸ **requestSignIn**(contractId: *`string`*, title: *`string`*, successUrl: *`string`*, failureUrl: *`string`*): `Promise`<`void`> -*Defined in [wallet-account.ts:63](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/wallet-account.ts#L63)* +*Defined in [wallet-account.ts:63](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/wallet-account.ts#L63)* Redirects current page to the wallet authentication page. @@ -166,7 +166,7 @@ ___ ▸ **signOut**(): `void` -*Defined in [wallet-account.ts:108](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/wallet-account.ts#L108)* +*Defined in [wallet-account.ts:108](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/wallet-account.ts#L108)* Sign out from the current account diff --git a/docs/enums/_providers_provider_.finaltransactionstatus.md b/docs/enums/_providers_provider_.finaltransactionstatus.md index 813c0b5535..bc30fa703a 100644 --- a/docs/enums/_providers_provider_.finaltransactionstatus.md +++ b/docs/enums/_providers_provider_.finaltransactionstatus.md @@ -19,7 +19,7 @@ **Completed**: = "Completed" -*Defined in [providers/provider.ts:25](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/providers/provider.ts#L25)* +*Defined in [providers/provider.ts:25](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/providers/provider.ts#L25)* ___ @@ -28,7 +28,7 @@ ___ **Failed**: = "Failed" -*Defined in [providers/provider.ts:24](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/providers/provider.ts#L24)* +*Defined in [providers/provider.ts:24](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/providers/provider.ts#L24)* ___ @@ -37,7 +37,7 @@ ___ **Started**: = "Started" -*Defined in [providers/provider.ts:23](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/providers/provider.ts#L23)* +*Defined in [providers/provider.ts:23](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/providers/provider.ts#L23)* ___ @@ -46,7 +46,7 @@ ___ **Unknown**: = "Unknown" -*Defined in [providers/provider.ts:22](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/providers/provider.ts#L22)* +*Defined in [providers/provider.ts:22](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/providers/provider.ts#L22)* ___ diff --git a/docs/enums/_utils_key_pair_.keytype.md b/docs/enums/_utils_key_pair_.keytype.md new file mode 100644 index 0000000000..91370c7d11 --- /dev/null +++ b/docs/enums/_utils_key_pair_.keytype.md @@ -0,0 +1,24 @@ + + +All supported key types + +# Index + +### Enumeration members + +* [ED25519](_utils_key_pair_.keytype.md#ed25519) + +--- + +# Enumeration members + + + +## ED25519 + +**ED25519**: = 0 + +*Defined in [utils/key_pair.ts:15](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/key_pair.ts#L15)* + +___ + diff --git a/docs/interfaces/_account_.accountstate.md b/docs/interfaces/_account_.accountstate.md index dfa6d8a1da..48b015c549 100644 --- a/docs/interfaces/_account_.accountstate.md +++ b/docs/interfaces/_account_.accountstate.md @@ -12,7 +12,7 @@ **● account_id**: *`string`* -*Defined in [account.ts:30](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/account.ts#L30)* +*Defined in [account.ts:31](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/account.ts#L31)* ___ @@ -21,7 +21,7 @@ ___ **● amount**: *`string`* -*Defined in [account.ts:32](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/account.ts#L32)* +*Defined in [account.ts:32](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/account.ts#L32)* ___ @@ -30,34 +30,16 @@ ___ **● code_hash**: *`string`* -*Defined in [account.ts:35](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/account.ts#L35)* +*Defined in [account.ts:34](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/account.ts#L34)* ___ - + -## nonce +## staked -**● nonce**: *`number`* +**● staked**: *`string`* -*Defined in [account.ts:31](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/account.ts#L31)* - -___ - - -## public_keys - -**● public_keys**: *`Uint8Array`[]* - -*Defined in [account.ts:34](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/account.ts#L34)* - -___ - - -## stake - -**● stake**: *`string`* - -*Defined in [account.ts:33](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/account.ts#L33)* +*Defined in [account.ts:33](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/account.ts#L33)* ___ diff --git a/docs/interfaces/_key_stores_unencrypted_file_system_keystore_.accountinfo.md b/docs/interfaces/_key_stores_unencrypted_file_system_keystore_.accountinfo.md index a01d0901ea..afad17bb33 100644 --- a/docs/interfaces/_key_stores_unencrypted_file_system_keystore_.accountinfo.md +++ b/docs/interfaces/_key_stores_unencrypted_file_system_keystore_.accountinfo.md @@ -14,7 +14,7 @@ Format of the account stored on disk. **● account_id**: *`string`* -*Defined in [key_stores/unencrypted_file_system_keystore.ts:29](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/key_stores/unencrypted_file_system_keystore.ts#L29)* +*Defined in [key_stores/unencrypted_file_system_keystore.ts:29](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/key_stores/unencrypted_file_system_keystore.ts#L29)* ___ @@ -23,7 +23,7 @@ ___ **● private_key**: *`string`* -*Defined in [key_stores/unencrypted_file_system_keystore.ts:30](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/key_stores/unencrypted_file_system_keystore.ts#L30)* +*Defined in [key_stores/unencrypted_file_system_keystore.ts:30](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/key_stores/unencrypted_file_system_keystore.ts#L30)* ___ diff --git a/docs/interfaces/_providers_provider_.blockheader.md b/docs/interfaces/_providers_provider_.blockheader.md index 34ffa988e5..15e8e94bb5 100644 --- a/docs/interfaces/_providers_provider_.blockheader.md +++ b/docs/interfaces/_providers_provider_.blockheader.md @@ -12,7 +12,7 @@ **● approval_mask**: *`string`* -*Defined in [providers/provider.ts:45](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/providers/provider.ts#L45)* +*Defined in [providers/provider.ts:50](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/providers/provider.ts#L50)* ___ @@ -21,7 +21,7 @@ ___ **● approval_sigs**: *`string`* -*Defined in [providers/provider.ts:46](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/providers/provider.ts#L46)* +*Defined in [providers/provider.ts:51](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/providers/provider.ts#L51)* ___ @@ -30,7 +30,7 @@ ___ **● hash**: *`string`* -*Defined in [providers/provider.ts:47](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/providers/provider.ts#L47)* +*Defined in [providers/provider.ts:52](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/providers/provider.ts#L52)* ___ @@ -39,7 +39,7 @@ ___ **● height**: *`number`* -*Defined in [providers/provider.ts:48](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/providers/provider.ts#L48)* +*Defined in [providers/provider.ts:53](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/providers/provider.ts#L53)* ___ @@ -48,7 +48,7 @@ ___ **● prev_hash**: *`string`* -*Defined in [providers/provider.ts:49](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/providers/provider.ts#L49)* +*Defined in [providers/provider.ts:54](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/providers/provider.ts#L54)* ___ @@ -57,7 +57,7 @@ ___ **● prev_state_root**: *`string`* -*Defined in [providers/provider.ts:50](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/providers/provider.ts#L50)* +*Defined in [providers/provider.ts:55](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/providers/provider.ts#L55)* ___ @@ -66,7 +66,7 @@ ___ **● timestamp**: *`number`* -*Defined in [providers/provider.ts:51](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/providers/provider.ts#L51)* +*Defined in [providers/provider.ts:56](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/providers/provider.ts#L56)* ___ @@ -75,7 +75,7 @@ ___ **● total_weight**: *[TotalWeight](_providers_provider_.totalweight.md)* -*Defined in [providers/provider.ts:52](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/providers/provider.ts#L52)* +*Defined in [providers/provider.ts:57](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/providers/provider.ts#L57)* ___ @@ -84,7 +84,7 @@ ___ **● tx_root**: *`string`* -*Defined in [providers/provider.ts:53](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/providers/provider.ts#L53)* +*Defined in [providers/provider.ts:58](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/providers/provider.ts#L58)* ___ diff --git a/docs/interfaces/_providers_provider_.blockresult.md b/docs/interfaces/_providers_provider_.blockresult.md index 075e05bacc..7b6cf613b7 100644 --- a/docs/interfaces/_providers_provider_.blockresult.md +++ b/docs/interfaces/_providers_provider_.blockresult.md @@ -12,7 +12,7 @@ **● header**: *[BlockHeader](_providers_provider_.blockheader.md)* -*Defined in [providers/provider.ts:64](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/providers/provider.ts#L64)* +*Defined in [providers/provider.ts:69](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/providers/provider.ts#L69)* ___ @@ -21,7 +21,7 @@ ___ **● transactions**: *[Transaction](_providers_provider_.transaction.md)[]* -*Defined in [providers/provider.ts:65](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/providers/provider.ts#L65)* +*Defined in [providers/provider.ts:70](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/providers/provider.ts#L70)* ___ diff --git a/docs/interfaces/_providers_provider_.finaltransactionresult.md b/docs/interfaces/_providers_provider_.finaltransactionresult.md index f12202bf9d..832deb40e0 100644 --- a/docs/interfaces/_providers_provider_.finaltransactionresult.md +++ b/docs/interfaces/_providers_provider_.finaltransactionresult.md @@ -6,22 +6,22 @@ # Properties - + -## logs +## status -**● logs**: *[TransactionLog](_providers_provider_.transactionlog.md)[]* +**● status**: *[FinalTransactionStatus](../enums/_providers_provider_.finaltransactionstatus.md)* -*Defined in [providers/provider.ts:37](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/providers/provider.ts#L37)* +*Defined in [providers/provider.ts:41](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/providers/provider.ts#L41)* ___ - + -## status +## transactions -**● status**: *[FinalTransactionStatus](../enums/_providers_provider_.finaltransactionstatus.md)* +**● transactions**: *[TransactionLog](_providers_provider_.transactionlog.md)[]* -*Defined in [providers/provider.ts:36](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/providers/provider.ts#L36)* +*Defined in [providers/provider.ts:42](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/providers/provider.ts#L42)* ___ diff --git a/docs/interfaces/_providers_provider_.nodestatusresult.md b/docs/interfaces/_providers_provider_.nodestatusresult.md index 55d1d1d979..98d131b017 100644 --- a/docs/interfaces/_providers_provider_.nodestatusresult.md +++ b/docs/interfaces/_providers_provider_.nodestatusresult.md @@ -12,7 +12,7 @@ **● chain_id**: *`string`* -*Defined in [providers/provider.ts:15](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/providers/provider.ts#L15)* +*Defined in [providers/provider.ts:15](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/providers/provider.ts#L15)* ___ @@ -21,7 +21,7 @@ ___ **● rpc_addr**: *`string`* -*Defined in [providers/provider.ts:16](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/providers/provider.ts#L16)* +*Defined in [providers/provider.ts:16](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/providers/provider.ts#L16)* ___ @@ -30,7 +30,7 @@ ___ **● sync_info**: *[SyncInfo](_providers_provider_.syncinfo.md)* -*Defined in [providers/provider.ts:17](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/providers/provider.ts#L17)* +*Defined in [providers/provider.ts:17](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/providers/provider.ts#L17)* ___ @@ -39,7 +39,7 @@ ___ **● validators**: *`string`[]* -*Defined in [providers/provider.ts:18](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/providers/provider.ts#L18)* +*Defined in [providers/provider.ts:18](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/providers/provider.ts#L18)* ___ diff --git a/docs/interfaces/_providers_provider_.syncinfo.md b/docs/interfaces/_providers_provider_.syncinfo.md index 6363c514cd..5d3cb9bd10 100644 --- a/docs/interfaces/_providers_provider_.syncinfo.md +++ b/docs/interfaces/_providers_provider_.syncinfo.md @@ -12,7 +12,7 @@ **● latest_block_hash**: *`string`* -*Defined in [providers/provider.ts:7](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/providers/provider.ts#L7)* +*Defined in [providers/provider.ts:7](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/providers/provider.ts#L7)* ___ @@ -21,7 +21,7 @@ ___ **● latest_block_height**: *`number`* -*Defined in [providers/provider.ts:8](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/providers/provider.ts#L8)* +*Defined in [providers/provider.ts:8](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/providers/provider.ts#L8)* ___ @@ -30,7 +30,7 @@ ___ **● latest_block_time**: *`string`* -*Defined in [providers/provider.ts:9](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/providers/provider.ts#L9)* +*Defined in [providers/provider.ts:9](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/providers/provider.ts#L9)* ___ @@ -39,7 +39,7 @@ ___ **● latest_state_root**: *`string`* -*Defined in [providers/provider.ts:10](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/providers/provider.ts#L10)* +*Defined in [providers/provider.ts:10](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/providers/provider.ts#L10)* ___ @@ -48,7 +48,7 @@ ___ **● syncing**: *`boolean`* -*Defined in [providers/provider.ts:11](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/providers/provider.ts#L11)* +*Defined in [providers/provider.ts:11](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/providers/provider.ts#L11)* ___ diff --git a/docs/interfaces/_providers_provider_.totalweight.md b/docs/interfaces/_providers_provider_.totalweight.md index 4a7a479190..a7ec03f126 100644 --- a/docs/interfaces/_providers_provider_.totalweight.md +++ b/docs/interfaces/_providers_provider_.totalweight.md @@ -12,7 +12,7 @@ **● num**: *`number`* -*Defined in [providers/provider.ts:41](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/providers/provider.ts#L41)* +*Defined in [providers/provider.ts:46](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/providers/provider.ts#L46)* ___ diff --git a/docs/interfaces/_providers_provider_.transaction.md b/docs/interfaces/_providers_provider_.transaction.md index ab67086bf7..d6b6d0b096 100644 --- a/docs/interfaces/_providers_provider_.transaction.md +++ b/docs/interfaces/_providers_provider_.transaction.md @@ -12,7 +12,7 @@ **● body**: *`any`* -*Defined in [providers/provider.ts:60](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/providers/provider.ts#L60)* +*Defined in [providers/provider.ts:65](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/providers/provider.ts#L65)* ___ @@ -21,7 +21,7 @@ ___ **● hash**: *`string`* -*Defined in [providers/provider.ts:57](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/providers/provider.ts#L57)* +*Defined in [providers/provider.ts:62](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/providers/provider.ts#L62)* ___ @@ -30,7 +30,7 @@ ___ **● public_key**: *`string`* -*Defined in [providers/provider.ts:58](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/providers/provider.ts#L58)* +*Defined in [providers/provider.ts:63](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/providers/provider.ts#L63)* ___ @@ -39,7 +39,7 @@ ___ **● signature**: *`string`* -*Defined in [providers/provider.ts:59](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/providers/provider.ts#L59)* +*Defined in [providers/provider.ts:64](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/providers/provider.ts#L64)* ___ diff --git a/docs/interfaces/_providers_provider_.transactionlog.md b/docs/interfaces/_providers_provider_.transactionlog.md index 6fbf34e45c..a10cccd43b 100644 --- a/docs/interfaces/_providers_provider_.transactionlog.md +++ b/docs/interfaces/_providers_provider_.transactionlog.md @@ -12,34 +12,16 @@ **● hash**: *`string`* -*Defined in [providers/provider.ts:29](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/providers/provider.ts#L29)* - -___ - - -## lines - -**● lines**: *`string`[]* - -*Defined in [providers/provider.ts:30](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/providers/provider.ts#L30)* - -___ - - -## receipts - -**● receipts**: *`number`[][]* - -*Defined in [providers/provider.ts:31](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/providers/provider.ts#L31)* +*Defined in [providers/provider.ts:29](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/providers/provider.ts#L29)* ___ -## `` result +## result -**● result**: *`Uint8Array`* +**● result**: *[TransactionResult](_providers_provider_.transactionresult.md)* -*Defined in [providers/provider.ts:32](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/providers/provider.ts#L32)* +*Defined in [providers/provider.ts:30](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/providers/provider.ts#L30)* ___ diff --git a/docs/interfaces/_providers_provider_.transactionresult.md b/docs/interfaces/_providers_provider_.transactionresult.md new file mode 100644 index 0000000000..4eef54a529 --- /dev/null +++ b/docs/interfaces/_providers_provider_.transactionresult.md @@ -0,0 +1,45 @@ + + +# Hierarchy + +**TransactionResult** + +# Properties + + + +## logs + +**● logs**: *`string`[]* + +*Defined in [providers/provider.ts:35](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/providers/provider.ts#L35)* + +___ + + +## receipts + +**● receipts**: *`string`[]* + +*Defined in [providers/provider.ts:36](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/providers/provider.ts#L36)* + +___ + + +## `` result + +**● result**: *`string`* + +*Defined in [providers/provider.ts:37](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/providers/provider.ts#L37)* + +___ + + +## status + +**● status**: *`string`* + +*Defined in [providers/provider.ts:34](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/providers/provider.ts#L34)* + +___ + diff --git a/docs/interfaces/_utils_key_pair_.signature.md b/docs/interfaces/_utils_key_pair_.signature.md index d9bb488c57..1f04c3056e 100644 --- a/docs/interfaces/_utils_key_pair_.signature.md +++ b/docs/interfaces/_utils_key_pair_.signature.md @@ -10,9 +10,9 @@ ## publicKey -**● publicKey**: *`string`* +**● publicKey**: *[PublicKey](../classes/_utils_key_pair_.publickey.md)* -*Defined in [utils/key_pair.ts:10](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/utils/key_pair.ts#L10)* +*Defined in [utils/key_pair.ts:10](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/key_pair.ts#L10)* ___ @@ -21,7 +21,7 @@ ___ **● signature**: *`Uint8Array`* -*Defined in [utils/key_pair.ts:9](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/utils/key_pair.ts#L9)* +*Defined in [utils/key_pair.ts:9](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/key_pair.ts#L9)* ___ diff --git a/docs/interfaces/_utils_network_.network.md b/docs/interfaces/_utils_network_.network.md index 88b3c4d275..712cfff14b 100644 --- a/docs/interfaces/_utils_network_.network.md +++ b/docs/interfaces/_utils_network_.network.md @@ -12,7 +12,7 @@ **● _defaultProvider**: *`function`* -*Defined in [utils/network.ts:6](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/utils/network.ts#L6)* +*Defined in [utils/network.ts:6](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/network.ts#L6)* #### Type declaration ▸(providers: *`any`*): `any` @@ -32,7 +32,7 @@ ___ **● chainId**: *`string`* -*Defined in [utils/network.ts:5](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/utils/network.ts#L5)* +*Defined in [utils/network.ts:5](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/network.ts#L5)* ___ @@ -41,7 +41,7 @@ ___ **● name**: *`string`* -*Defined in [utils/network.ts:4](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/utils/network.ts#L4)* +*Defined in [utils/network.ts:4](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/network.ts#L4)* ___ diff --git a/docs/interfaces/_utils_web_.connectioninfo.md b/docs/interfaces/_utils_web_.connectioninfo.md index 9bf7a3d013..270ae7cb62 100644 --- a/docs/interfaces/_utils_web_.connectioninfo.md +++ b/docs/interfaces/_utils_web_.connectioninfo.md @@ -12,7 +12,7 @@ **● allowInsecure**: *`boolean`* -*Defined in [utils/web.ts:9](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/utils/web.ts#L9)* +*Defined in [utils/web.ts:9](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/web.ts#L9)* ___ @@ -21,7 +21,7 @@ ___ **● headers**: *`object`* -*Defined in [utils/web.ts:11](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/utils/web.ts#L11)* +*Defined in [utils/web.ts:11](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/web.ts#L11)* #### Type declaration @@ -34,7 +34,7 @@ ___ **● password**: *`string`* -*Defined in [utils/web.ts:8](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/utils/web.ts#L8)* +*Defined in [utils/web.ts:8](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/web.ts#L8)* ___ @@ -43,7 +43,7 @@ ___ **● timeout**: *`number`* -*Defined in [utils/web.ts:10](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/utils/web.ts#L10)* +*Defined in [utils/web.ts:10](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/web.ts#L10)* ___ @@ -52,7 +52,7 @@ ___ **● url**: *`string`* -*Defined in [utils/web.ts:6](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/utils/web.ts#L6)* +*Defined in [utils/web.ts:6](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/web.ts#L6)* ___ @@ -61,7 +61,7 @@ ___ **● user**: *`string`* -*Defined in [utils/web.ts:7](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/utils/web.ts#L7)* +*Defined in [utils/web.ts:7](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/web.ts#L7)* ___ diff --git a/docs/modules/_account_.md b/docs/modules/_account_.md index bffbe4a293..7ba2416f85 100644 --- a/docs/modules/_account_.md +++ b/docs/modules/_account_.md @@ -29,9 +29,9 @@ ## `` DEFAULT_FUNC_CALL_AMOUNT -**● DEFAULT_FUNC_CALL_AMOUNT**: *`BN`* = new BN(1000000000) +**● DEFAULT_FUNC_CALL_AMOUNT**: *`1000000`* = 1000000 -*Defined in [account.ts:13](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/account.ts#L13)* +*Defined in [account.ts:14](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/account.ts#L14)* ___ @@ -40,7 +40,7 @@ ___ **● TX_STATUS_RETRY_NUMBER**: *`10`* = 10 -*Defined in [account.ts:16](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/account.ts#L16)* +*Defined in [account.ts:17](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/account.ts#L17)* ___ @@ -49,7 +49,7 @@ ___ **● TX_STATUS_RETRY_WAIT**: *`500`* = 500 -*Defined in [account.ts:19](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/account.ts#L19)* +*Defined in [account.ts:20](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/account.ts#L20)* ___ @@ -58,7 +58,7 @@ ___ **● TX_STATUS_RETRY_WAIT_BACKOFF**: *`1.5`* = 1.5 -*Defined in [account.ts:22](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/account.ts#L22)* +*Defined in [account.ts:23](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/account.ts#L23)* ___ @@ -70,7 +70,7 @@ ___ ▸ **sleep**(millis: *`number`*): `Promise`<`any`> -*Defined in [account.ts:25](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/account.ts#L25)* +*Defined in [account.ts:26](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/account.ts#L26)* **Parameters:** diff --git a/docs/modules/_connection_.md b/docs/modules/_connection_.md index 81b457ec35..22417f994a 100644 --- a/docs/modules/_connection_.md +++ b/docs/modules/_connection_.md @@ -21,7 +21,7 @@ ▸ **getProvider**(config: *`any`*): [Provider](../classes/_providers_provider_.provider.md) -*Defined in [connection.ts:6](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/connection.ts#L6)* +*Defined in [connection.ts:6](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/connection.ts#L6)* **Parameters:** @@ -38,7 +38,7 @@ ___ ▸ **getSigner**(networkId: *`string`*, config: *`any`*): [Signer](../classes/_signer_.signer.md) -*Defined in [connection.ts:13](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/connection.ts#L13)* +*Defined in [connection.ts:13](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/connection.ts#L13)* **Parameters:** diff --git a/docs/modules/_key_stores_browser_local_storage_key_store_.md b/docs/modules/_key_stores_browser_local_storage_key_store_.md index 623139f03b..f48d2d8564 100644 --- a/docs/modules/_key_stores_browser_local_storage_key_store_.md +++ b/docs/modules/_key_stores_browser_local_storage_key_store_.md @@ -20,7 +20,7 @@ **● LOCAL_STORAGE_KEY_PREFIX**: *"nearlib:keystore:"* = "nearlib:keystore:" -*Defined in [key_stores/browser_local_storage_key_store.ts:6](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/key_stores/browser_local_storage_key_store.ts#L6)* +*Defined in [key_stores/browser_local_storage_key_store.ts:6](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/key_stores/browser_local_storage_key_store.ts#L6)* ___ diff --git a/docs/modules/_key_stores_unencrypted_file_system_keystore_.md b/docs/modules/_key_stores_unencrypted_file_system_keystore_.md index b2d71bf703..78262e7c6e 100644 --- a/docs/modules/_key_stores_unencrypted_file_system_keystore_.md +++ b/docs/modules/_key_stores_unencrypted_file_system_keystore_.md @@ -35,7 +35,7 @@ **● exists**: *`Function`* = promisify(fs.exists) -*Defined in [key_stores/unencrypted_file_system_keystore.ts:18](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/key_stores/unencrypted_file_system_keystore.ts#L18)* +*Defined in [key_stores/unencrypted_file_system_keystore.ts:18](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/key_stores/unencrypted_file_system_keystore.ts#L18)* ___ @@ -44,7 +44,7 @@ ___ **● mkdir**: *`Function`* = promisify(fs.mkdir) -*Defined in [key_stores/unencrypted_file_system_keystore.ts:23](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/key_stores/unencrypted_file_system_keystore.ts#L23)* +*Defined in [key_stores/unencrypted_file_system_keystore.ts:23](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/key_stores/unencrypted_file_system_keystore.ts#L23)* ___ @@ -53,7 +53,7 @@ ___ **● readFile**: *`Function`* = promisify(fs.readFile) -*Defined in [key_stores/unencrypted_file_system_keystore.ts:19](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/key_stores/unencrypted_file_system_keystore.ts#L19)* +*Defined in [key_stores/unencrypted_file_system_keystore.ts:19](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/key_stores/unencrypted_file_system_keystore.ts#L19)* ___ @@ -62,7 +62,7 @@ ___ **● readdir**: *`Function`* = promisify(fs.readdir) -*Defined in [key_stores/unencrypted_file_system_keystore.ts:22](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/key_stores/unencrypted_file_system_keystore.ts#L22)* +*Defined in [key_stores/unencrypted_file_system_keystore.ts:22](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/key_stores/unencrypted_file_system_keystore.ts#L22)* ___ @@ -71,7 +71,7 @@ ___ **● unlink**: *`Function`* = promisify(fs.unlink) -*Defined in [key_stores/unencrypted_file_system_keystore.ts:21](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/key_stores/unencrypted_file_system_keystore.ts#L21)* +*Defined in [key_stores/unencrypted_file_system_keystore.ts:21](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/key_stores/unencrypted_file_system_keystore.ts#L21)* ___ @@ -80,7 +80,7 @@ ___ **● writeFile**: *`Function`* = promisify(fs.writeFile) -*Defined in [key_stores/unencrypted_file_system_keystore.ts:20](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/key_stores/unencrypted_file_system_keystore.ts#L20)* +*Defined in [key_stores/unencrypted_file_system_keystore.ts:20](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/key_stores/unencrypted_file_system_keystore.ts#L20)* ___ @@ -92,7 +92,7 @@ ___ ▸ **ensureDir**(path: *`string`*): `Promise`<`void`> -*Defined in [key_stores/unencrypted_file_system_keystore.ts:38](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/key_stores/unencrypted_file_system_keystore.ts#L38)* +*Defined in [key_stores/unencrypted_file_system_keystore.ts:38](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/key_stores/unencrypted_file_system_keystore.ts#L38)* **Parameters:** @@ -109,7 +109,7 @@ ___ ▸ **loadJsonFile**(path: *`string`*): `Promise`<`any`> -*Defined in [key_stores/unencrypted_file_system_keystore.ts:33](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/key_stores/unencrypted_file_system_keystore.ts#L33)* +*Defined in [key_stores/unencrypted_file_system_keystore.ts:33](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/key_stores/unencrypted_file_system_keystore.ts#L33)* **Parameters:** @@ -126,7 +126,7 @@ ___ ▸ **promisify**(fn: *`any`*): `Function` -*Defined in [key_stores/unencrypted_file_system_keystore.ts:9](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/key_stores/unencrypted_file_system_keystore.ts#L9)* +*Defined in [key_stores/unencrypted_file_system_keystore.ts:9](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/key_stores/unencrypted_file_system_keystore.ts#L9)* **Parameters:** diff --git a/docs/modules/_near_.md b/docs/modules/_near_.md index 669d6359f4..2b44596520 100644 --- a/docs/modules/_near_.md +++ b/docs/modules/_near_.md @@ -20,7 +20,7 @@ ▸ **connect**(config: *`any`*): `Promise`<[Near](../classes/_near_.near.md)> -*Defined in [near.ts:84](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/near.ts#L84)* +*Defined in [near.ts:72](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/near.ts#L72)* **Parameters:** diff --git a/docs/modules/_providers_json_rpc_provider_.md b/docs/modules/_providers_json_rpc_provider_.md index e4f95fc739..6a6a30b007 100644 --- a/docs/modules/_providers_json_rpc_provider_.md +++ b/docs/modules/_providers_json_rpc_provider_.md @@ -20,7 +20,7 @@ **● _nextId**: *`number`* = 123 -*Defined in [providers/json-rpc-provider.ts:10](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/providers/json-rpc-provider.ts#L10)* +*Defined in [providers/json-rpc-provider.ts:10](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/providers/json-rpc-provider.ts#L10)* ___ diff --git a/docs/modules/_providers_provider_.md b/docs/modules/_providers_provider_.md index aeb468b249..cf02b44e85 100644 --- a/docs/modules/_providers_provider_.md +++ b/docs/modules/_providers_provider_.md @@ -20,6 +20,7 @@ * [TotalWeight](../interfaces/_providers_provider_.totalweight.md) * [Transaction](../interfaces/_providers_provider_.transaction.md) * [TransactionLog](../interfaces/_providers_provider_.transactionlog.md) +* [TransactionResult](../interfaces/_providers_provider_.transactionresult.md) ### Functions @@ -35,7 +36,7 @@ ▸ **getTransactionLastResult**(txResult: *[FinalTransactionResult](../interfaces/_providers_provider_.finaltransactionresult.md)*): `any` -*Defined in [providers/provider.ts:78](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/providers/provider.ts#L78)* +*Defined in [providers/provider.ts:83](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/providers/provider.ts#L83)* **Parameters:** diff --git a/docs/modules/_transaction_.md b/docs/modules/_transaction_.md index deef27b532..1efe4501bb 100644 --- a/docs/modules/_transaction_.md +++ b/docs/modules/_transaction_.md @@ -1,291 +1,321 @@ -# Type aliases - - - -## AllTransactions - -**Ƭ AllTransactions**: *`SendMoneyTransaction` \| `CreateAccountTransaction` \| `DeployContractTransaction` \| `FunctionCallTransaction` \| `StakeTransaction` \| `SwapKeyTransaction` \| `AddKeyTransaction` \| `DeleteKeyTransaction`* - -*Defined in [transaction.ts:26](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/transaction.ts#L26)* - -___ +# Index + +### Classes + +* [AccessKey](../classes/_transaction_.accesskey.md) +* [AccessKeyPermission](../classes/_transaction_.accesskeypermission.md) +* [Action](../classes/_transaction_.action.md) +* [AddKey](../classes/_transaction_.addkey.md) +* [Assignable](../classes/_transaction_.assignable.md) +* [CreateAccount](../classes/_transaction_.createaccount.md) +* [DeleteAccount](../classes/_transaction_.deleteaccount.md) +* [DeleteKey](../classes/_transaction_.deletekey.md) +* [DeployContract](../classes/_transaction_.deploycontract.md) +* [Enum](../classes/_transaction_.enum.md) +* [FullAccessPermission](../classes/_transaction_.fullaccesspermission.md) +* [FunctionCall](../classes/_transaction_.functioncall.md) +* [FunctionCallPermission](../classes/_transaction_.functioncallpermission.md) +* [IAction](../classes/_transaction_.iaction.md) +* [Signature](../classes/_transaction_.signature.md) +* [SignedTransaction](../classes/_transaction_.signedtransaction.md) +* [Stake](../classes/_transaction_.stake.md) +* [Transaction](../classes/_transaction_.transaction.md) +* [Transfer](../classes/_transaction_.transfer.md) + +### Variables + +* [SCHEMA](_transaction_.md#schema) + +### Functions + +* [addKey](_transaction_.md#addkey-1) +* [createAccount](_transaction_.md#createaccount-1) +* [deleteAccount](_transaction_.md#deleteaccount-1) +* [deleteKey](_transaction_.md#deletekey-1) +* [deployContract](_transaction_.md#deploycontract-1) +* [fullAccessKey](_transaction_.md#fullaccesskey) +* [functionCall](_transaction_.md#functioncall-1) +* [functionCallAccessKey](_transaction_.md#functioncallaccesskey) +* [signTransaction](_transaction_.md#signtransaction) +* [stake](_transaction_.md#stake-1) +* [transfer](_transaction_.md#transfer-1) + +--- # Variables - - -## `` TRANSACTION_FIELD_MAP - -**● TRANSACTION_FIELD_MAP**: *`Map`<`Function`, `string`>* = new Map([ - [CreateAccountTransaction, 'createAccount'], - [DeployContractTransaction, 'deployContract'], - [FunctionCallTransaction, 'functionCall'], - [SendMoneyTransaction, 'sendMoney'], - [StakeTransaction, 'stake'], - [SwapKeyTransaction, 'swapKey'], - [AddKeyTransaction, 'addKey'], - [DeleteKeyTransaction, 'deleteKey'], + + +## `` SCHEMA + +**● SCHEMA**: *`Map`<`Function`, `any`>* = new Map([ + [Signature, {kind: 'struct', fields: [ + ['keyType', 'u8'], + ['data', [32]] + ]}], + [SignedTransaction, {kind: 'struct', fields: [ + ['transaction', Transaction], + ['signature', Signature] + ]}], + [Transaction, { kind: 'struct', fields: [ + ['signerId', 'string'], + ['publicKey', PublicKey], + ['nonce', 'u64'], + ['receiverId', 'string'], + ['blockHash', [32]], + ['actions', [Action]] + ]}], + [PublicKey, { kind: 'struct', fields: [ + ['keyType', 'u8'], + ['data', [32]] + ]}], + [AccessKey, { kind: 'struct', fields: [ + ['nonce', 'u64'], + ['permission', AccessKeyPermission], + ]}], + [AccessKeyPermission, {kind: 'enum', field: 'enum', values: [ + ['functionCall', FunctionCallPermission], + ['fullAccess', FullAccessPermission], + ]}], + [FunctionCallPermission, {kind: 'struct', fields: [ + ['allowance', {kind: 'option', type: 'u128'}], + ['receiverId', 'string'], + ['methodNames', ['string']], + ]}], + [FullAccessPermission, {kind: 'struct', fields: []}], + [Action, {kind: 'enum', field: 'enum', values: [ + ['createAccount', CreateAccount], + ['deployContract', DeployContract], + ['functionCall', functionCall], + ['transfer', transfer], + ['stake', stake], + ['addKey', addKey], + ['deleteKey', deleteKey], + ['deleteAccount', deleteAccount], + ]}], + [CreateAccount, { kind: 'struct', fields: [] }], + [DeployContract, { kind: 'struct', fields: [ + ['code', ['u8']] + ]}], + [FunctionCall, { kind: 'struct', fields: [ + ['methodName', 'string'], + ['args', ['u8']], + ['gas', 'u64'], + ['deposit', 'u128'] + ]}], + [Transfer, { kind: 'struct', fields: [ + ['deposit', 'u128'] + ]}], + [Stake, { kind: 'struct', fields: [ + ['stake', 'u128'], + ['publicKey', PublicKey] + ]}], + [AddKey, { kind: 'struct', fields: [ + ['publicKey', PublicKey], + ['accessKey', AccessKey] + ]}], + [DeleteKey, { kind: 'struct', fields: [ + ['publicKey', PublicKey] + ]}], + [DeleteAccount, { kind: 'struct', fields: [ + ['beneficiaryId', 'string'] + ]}], ]) -*Defined in [transaction.ts:15](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/transaction.ts#L15)* +*Defined in [transaction.ts:140](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L140)* ___ # Functions - + ## addKey -▸ **addKey**(nonce: *`number`*, originator: *`string`*, newKey: *`string`*, accessKey: *`AccessKey`*): `AddKeyTransaction` +▸ **addKey**(publicKey: *[PublicKey](../classes/_utils_key_pair_.publickey.md)*, accessKey: *[AccessKey](../classes/_transaction_.accesskey.md)*): [Action](../classes/_transaction_.action.md) -*Defined in [transaction.ts:70](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/transaction.ts#L70)* +*Defined in [transaction.ts:89](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L89)* **Parameters:** | Name | Type | | ------ | ------ | -| nonce | `number` | -| originator | `string` | -| newKey | `string` | -| accessKey | `AccessKey` | +| publicKey | [PublicKey](../classes/_utils_key_pair_.publickey.md) | +| accessKey | [AccessKey](../classes/_transaction_.accesskey.md) | -**Returns:** `AddKeyTransaction` +**Returns:** [Action](../classes/_transaction_.action.md) ___ - - -## bigInt - -▸ **bigInt**(num: *`BN`*): `Uint128` + -*Defined in [transaction.ts:28](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/transaction.ts#L28)* +## createAccount -**Parameters:** +▸ **createAccount**(): [Action](../classes/_transaction_.action.md) -| Name | Type | -| ------ | ------ | -| num | `BN` | +*Defined in [transaction.ts:69](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L69)* -**Returns:** `Uint128` +**Returns:** [Action](../classes/_transaction_.action.md) ___ - + -## bignumHex2Dec +## deleteAccount -▸ **bignumHex2Dec**(num: *`string`*): `string` +▸ **deleteAccount**(beneficiaryId: *`string`*): [Action](../classes/_transaction_.action.md) -*Defined in [transaction.ts:33](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/transaction.ts#L33)* +*Defined in [transaction.ts:97](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L97)* **Parameters:** | Name | Type | | ------ | ------ | -| num | `string` | +| beneficiaryId | `string` | -**Returns:** `string` +**Returns:** [Action](../classes/_transaction_.action.md) ___ - + -## createAccessKey +## deleteKey -▸ **createAccessKey**(contractId?: *`string`*, methodName?: *`string`*, balanceOwner?: *`string`*, amount?: *`BN`*): `AccessKey` +▸ **deleteKey**(publicKey: *[PublicKey](../classes/_utils_key_pair_.publickey.md)*): [Action](../classes/_transaction_.action.md) -*Defined in [transaction.ts:61](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/transaction.ts#L61)* +*Defined in [transaction.ts:93](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L93)* **Parameters:** | Name | Type | | ------ | ------ | -| `Optional` contractId | `string` | -| `Optional` methodName | `string` | -| `Optional` balanceOwner | `string` | -| `Optional` amount | `BN` | +| publicKey | [PublicKey](../classes/_utils_key_pair_.publickey.md) | -**Returns:** `AccessKey` +**Returns:** [Action](../classes/_transaction_.action.md) ___ - - -## createAccount - -▸ **createAccount**(nonce: *`number`*, originator: *`string`*, newAccountId: *`string`*, publicKey: *`string`*, amount: *`BN`*): `CreateAccountTransaction` - -*Defined in [transaction.ts:37](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/transaction.ts#L37)* - -**Parameters:** + -| Name | Type | -| ------ | ------ | -| nonce | `number` | -| originator | `string` | -| newAccountId | `string` | -| publicKey | `string` | -| amount | `BN` | - -**Returns:** `CreateAccountTransaction` - -___ - - -## deleteKey +## deployContract -▸ **deleteKey**(nonce: *`number`*, originator: *`string`*, curKey: *`string`*): `DeleteKeyTransaction` +▸ **deployContract**(code: *`Uint8Array`*): [Action](../classes/_transaction_.action.md) -*Defined in [transaction.ts:74](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/transaction.ts#L74)* +*Defined in [transaction.ts:73](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L73)* **Parameters:** | Name | Type | | ------ | ------ | -| nonce | `number` | -| originator | `string` | -| curKey | `string` | +| code | `Uint8Array` | -**Returns:** `DeleteKeyTransaction` +**Returns:** [Action](../classes/_transaction_.action.md) ___ - - -## deployContract - -▸ **deployContract**(nonce: *`number`*, contractId: *`string`*, wasmByteArray: *`Uint8Array`*): `DeployContractTransaction` + -*Defined in [transaction.ts:41](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/transaction.ts#L41)* +## fullAccessKey -**Parameters:** +▸ **fullAccessKey**(): [AccessKey](../classes/_transaction_.accesskey.md) -| Name | Type | -| ------ | ------ | -| nonce | `number` | -| contractId | `string` | -| wasmByteArray | `Uint8Array` | +*Defined in [transaction.ts:50](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L50)* -**Returns:** `DeployContractTransaction` +**Returns:** [AccessKey](../classes/_transaction_.accesskey.md) ___ - + ## functionCall -▸ **functionCall**(nonce: *`number`*, originator: *`string`*, contractId: *`string`*, methodName: *`string`*, args: *`Uint8Array`*, amount: *`BN`*): `FunctionCallTransaction` +▸ **functionCall**(methodName: *`string`*, args: *`Uint8Array`*, gas: *`number`*, deposit: *`BN`*): [Action](../classes/_transaction_.action.md) -*Defined in [transaction.ts:45](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/transaction.ts#L45)* +*Defined in [transaction.ts:77](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L77)* **Parameters:** | Name | Type | | ------ | ------ | -| nonce | `number` | -| originator | `string` | -| contractId | `string` | | methodName | `string` | | args | `Uint8Array` | -| amount | `BN` | +| gas | `number` | +| deposit | `BN` | -**Returns:** `FunctionCallTransaction` +**Returns:** [Action](../classes/_transaction_.action.md) ___ - + -## sendMoney +## functionCallAccessKey -▸ **sendMoney**(nonce: *`number`*, originator: *`string`*, receiver: *`string`*, amount: *`BN`*): `SendMoneyTransaction` +▸ **functionCallAccessKey**(receiverId: *`string`*, methodNames: *`String`[]*, allowance?: *`BN`*): [AccessKey](../classes/_transaction_.accesskey.md) -*Defined in [transaction.ts:49](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/transaction.ts#L49)* +*Defined in [transaction.ts:54](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L54)* **Parameters:** | Name | Type | | ------ | ------ | -| nonce | `number` | -| originator | `string` | -| receiver | `string` | -| amount | `BN` | +| receiverId | `string` | +| methodNames | `String`[] | +| `Optional` allowance | `BN` | -**Returns:** `SendMoneyTransaction` +**Returns:** [AccessKey](../classes/_transaction_.accesskey.md) ___ ## signTransaction -▸ **signTransaction**(signer: *[Signer](../classes/_signer_.signer.md)*, transaction: *`any`*, accountId?: *`string`*, networkId?: *`string`*): `Promise`<[`Uint8Array`, `SignedTransaction`]> +▸ **signTransaction**(receiverId: *`string`*, nonce: *`number`*, actions: *[Action](../classes/_transaction_.action.md)[]*, blockHash: *`Uint8Array`*, signer: *[Signer](../classes/_signer_.signer.md)*, accountId?: *`string`*, networkId?: *`string`*): `Promise`<[`Uint8Array`, [SignedTransaction](../classes/_transaction_.signedtransaction.md)]> -*Defined in [transaction.ts:87](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/transaction.ts#L87)* +*Defined in [transaction.ts:214](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L214)* **Parameters:** | Name | Type | | ------ | ------ | +| receiverId | `string` | +| nonce | `number` | +| actions | [Action](../classes/_transaction_.action.md)[] | +| blockHash | `Uint8Array` | | signer | [Signer](../classes/_signer_.signer.md) | -| transaction | `any` | | `Optional` accountId | `string` | | `Optional` networkId | `string` | -**Returns:** `Promise`<[`Uint8Array`, `SignedTransaction`]> +**Returns:** `Promise`<[`Uint8Array`, [SignedTransaction](../classes/_transaction_.signedtransaction.md)]> ___ - - -## signedTransaction - -▸ **signedTransaction**(transaction: *[AllTransactions](_transaction_.md#alltransactions)*, signature: *[Signature](../interfaces/_utils_key_pair_.signature.md)*): `SignedTransaction` - -*Defined in [transaction.ts:78](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/transaction.ts#L78)* - -**Parameters:** - -| Name | Type | -| ------ | ------ | -| transaction | [AllTransactions](_transaction_.md#alltransactions) | -| signature | [Signature](../interfaces/_utils_key_pair_.signature.md) | - -**Returns:** `SignedTransaction` - -___ - + ## stake -▸ **stake**(nonce: *`number`*, originator: *`string`*, amount: *`BN`*, publicKey: *`string`*): `StakeTransaction` +▸ **stake**(stake: *`BN`*, publicKey: *[PublicKey](../classes/_utils_key_pair_.publickey.md)*): [Action](../classes/_transaction_.action.md) -*Defined in [transaction.ts:53](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/transaction.ts#L53)* +*Defined in [transaction.ts:85](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L85)* **Parameters:** | Name | Type | | ------ | ------ | -| nonce | `number` | -| originator | `string` | -| amount | `BN` | -| publicKey | `string` | +| stake | `BN` | +| publicKey | [PublicKey](../classes/_utils_key_pair_.publickey.md) | -**Returns:** `StakeTransaction` +**Returns:** [Action](../classes/_transaction_.action.md) ___ - + -## swapKey +## transfer -▸ **swapKey**(nonce: *`number`*, originator: *`string`*, curKey: *`string`*, newKey: *`string`*): `SwapKeyTransaction` +▸ **transfer**(deposit: *`BN`*): [Action](../classes/_transaction_.action.md) -*Defined in [transaction.ts:57](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/transaction.ts#L57)* +*Defined in [transaction.ts:81](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/transaction.ts#L81)* **Parameters:** | Name | Type | | ------ | ------ | -| nonce | `number` | -| originator | `string` | -| curKey | `string` | -| newKey | `string` | +| deposit | `BN` | -**Returns:** `SwapKeyTransaction` +**Returns:** [Action](../classes/_transaction_.action.md) ___ diff --git a/docs/modules/_utils_key_pair_.md b/docs/modules/_utils_key_pair_.md index 2b4424d625..fdaf9f3306 100644 --- a/docs/modules/_utils_key_pair_.md +++ b/docs/modules/_utils_key_pair_.md @@ -2,10 +2,15 @@ # Index +### Enumerations + +* [KeyType](../enums/_utils_key_pair_.keytype.md) + ### Classes * [KeyPair](../classes/_utils_key_pair_.keypair.md) * [KeyPairEd25519](../classes/_utils_key_pair_.keypaired25519.md) +* [PublicKey](../classes/_utils_key_pair_.publickey.md) ### Interfaces @@ -15,6 +20,11 @@ * [Arrayish](_utils_key_pair_.md#arrayish) +### Functions + +* [key_type_to_str](_utils_key_pair_.md#key_type_to_str) +* [str_to_key_type](_utils_key_pair_.md#str_to_key_type) + --- # Type aliases @@ -25,7 +35,44 @@ **Ƭ Arrayish**: *`string` \| `ArrayLike`<`number`>* -*Defined in [utils/key_pair.ts:6](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/utils/key_pair.ts#L6)* +*Defined in [utils/key_pair.ts:6](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/key_pair.ts#L6)* + +___ + +# Functions + + + +## key_type_to_str + +▸ **key_type_to_str**(keyType: *[KeyType](../enums/_utils_key_pair_.keytype.md)*): `String` + +*Defined in [utils/key_pair.ts:18](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/key_pair.ts#L18)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| keyType | [KeyType](../enums/_utils_key_pair_.keytype.md) | + +**Returns:** `String` + +___ + + +## str_to_key_type + +▸ **str_to_key_type**(keyType: *`string`*): [KeyType](../enums/_utils_key_pair_.keytype.md) + +*Defined in [utils/key_pair.ts:25](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/key_pair.ts#L25)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| keyType | `string` | + +**Returns:** [KeyType](../enums/_utils_key_pair_.keytype.md) ___ diff --git a/docs/modules/_utils_serialize_.md b/docs/modules/_utils_serialize_.md index 157861f97d..3e11207150 100644 --- a/docs/modules/_utils_serialize_.md +++ b/docs/modules/_utils_serialize_.md @@ -1,5 +1,57 @@ +# Index + +### Classes + +* [BinaryReader](../classes/_utils_serialize_.binaryreader.md) +* [BinaryWriter](../classes/_utils_serialize_.binarywriter.md) + +### Type aliases + +* [Schema](_utils_serialize_.md#schema) + +### Variables + +* [INITIAL_LENGTH](_utils_serialize_.md#initial_length) + +### Functions + +* [base_decode](_utils_serialize_.md#base_decode) +* [base_encode](_utils_serialize_.md#base_encode) +* [deserialize](_utils_serialize_.md#deserialize) +* [deserializeField](_utils_serialize_.md#deserializefield) +* [deserializeStruct](_utils_serialize_.md#deserializestruct) +* [serialize](_utils_serialize_.md#serialize) +* [serializeField](_utils_serialize_.md#serializefield) +* [serializeStruct](_utils_serialize_.md#serializestruct) + +--- + +# Type aliases + + + +## Schema + +**Ƭ Schema**: *`Map`<`Function`, `any`>* + +*Defined in [utils/serialize.ts:19](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/serialize.ts#L19)* + +___ + +# Variables + + + +## `` INITIAL_LENGTH + +**● INITIAL_LENGTH**: *`1024`* = 1024 + +*Defined in [utils/serialize.ts:17](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/serialize.ts#L17)* + +___ + # Functions @@ -8,7 +60,7 @@ ▸ **base_decode**(value: *`string`*): `Uint8Array` -*Defined in [utils/serialize.ts:12](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/utils/serialize.ts#L12)* +*Defined in [utils/serialize.ts:13](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/serialize.ts#L13)* **Parameters:** @@ -25,7 +77,7 @@ ___ ▸ **base_encode**(value: *`Uint8Array` \| `string`*): `string` -*Defined in [utils/serialize.ts:5](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/utils/serialize.ts#L5)* +*Defined in [utils/serialize.ts:6](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/serialize.ts#L6)* **Parameters:** @@ -36,4 +88,118 @@ ___ **Returns:** `string` ___ + + +## deserialize + +▸ **deserialize**(schema: *[Schema](_utils_serialize_.md#schema)*, classType: *`any`*, buffer: *`Buffer`*): `any` + +*Defined in [utils/serialize.ts:228](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/serialize.ts#L228)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| schema | [Schema](_utils_serialize_.md#schema) | +| classType | `any` | +| buffer | `Buffer` | + +**Returns:** `any` + +___ + + +## deserializeField + +▸ **deserializeField**(schema: *[Schema](_utils_serialize_.md#schema)*, fieldType: *`any`*, reader: *`any`*): `any` + +*Defined in [utils/serialize.ts:206](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/serialize.ts#L206)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| schema | [Schema](_utils_serialize_.md#schema) | +| fieldType | `any` | +| reader | `any` | + +**Returns:** `any` + +___ + + +## deserializeStruct + +▸ **deserializeStruct**(schema: *[Schema](_utils_serialize_.md#schema)*, classType: *`any`*, reader: *`any`*): `any` + +*Defined in [utils/serialize.ts:220](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/serialize.ts#L220)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| schema | [Schema](_utils_serialize_.md#schema) | +| classType | `any` | +| reader | `any` | + +**Returns:** `any` + +___ + + +## serialize + +▸ **serialize**(schema: *[Schema](_utils_serialize_.md#schema)*, obj: *`any`*): `Uint8Array` + +*Defined in [utils/serialize.ts:200](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/serialize.ts#L200)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| schema | [Schema](_utils_serialize_.md#schema) | +| obj | `any` | + +**Returns:** `Uint8Array` + +___ + + +## serializeField + +▸ **serializeField**(schema: *[Schema](_utils_serialize_.md#schema)*, value: *`any`*, fieldType: *`any`*, writer: *`any`*): `void` + +*Defined in [utils/serialize.ts:147](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/serialize.ts#L147)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| schema | [Schema](_utils_serialize_.md#schema) | +| value | `any` | +| fieldType | `any` | +| writer | `any` | + +**Returns:** `void` + +___ + + +## serializeStruct + +▸ **serializeStruct**(schema: *[Schema](_utils_serialize_.md#schema)*, obj: *`any`*, writer: *`any`*): `void` + +*Defined in [utils/serialize.ts:174](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/serialize.ts#L174)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| schema | [Schema](_utils_serialize_.md#schema) | +| obj | `any` | +| writer | `any` | + +**Returns:** `void` + +___ diff --git a/docs/modules/_utils_web_.md b/docs/modules/_utils_web_.md index abeec92b1f..652b09e67f 100644 --- a/docs/modules/_utils_web_.md +++ b/docs/modules/_utils_web_.md @@ -24,7 +24,7 @@ **● fetch**: *`any`* = (typeof window === 'undefined' || window.name === 'nodejs') ? require('node-fetch') : window.fetch -*Defined in [utils/web.ts:14](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/utils/web.ts#L14)* +*Defined in [utils/web.ts:14](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/web.ts#L14)* ___ @@ -36,7 +36,7 @@ ___ ▸ **fetchJson**(connection: *`string` \| [ConnectionInfo](../interfaces/_utils_web_.connectioninfo.md)*, json?: *`string`*): `Promise`<`any`> -*Defined in [utils/web.ts:16](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/utils/web.ts#L16)* +*Defined in [utils/web.ts:16](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/utils/web.ts#L16)* **Parameters:** diff --git a/docs/modules/_wallet_account_.md b/docs/modules/_wallet_account_.md index 0585f9011b..d243f29371 100644 --- a/docs/modules/_wallet_account_.md +++ b/docs/modules/_wallet_account_.md @@ -22,7 +22,7 @@ **● LOCAL_STORAGE_KEY_SUFFIX**: *"_wallet_auth_key"* = "_wallet_auth_key" -*Defined in [wallet-account.ts:10](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/wallet-account.ts#L10)* +*Defined in [wallet-account.ts:10](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/wallet-account.ts#L10)* ___ @@ -31,7 +31,7 @@ ___ **● LOGIN_WALLET_URL_SUFFIX**: *"/login/"* = "/login/" -*Defined in [wallet-account.ts:8](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/wallet-account.ts#L8)* +*Defined in [wallet-account.ts:8](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/wallet-account.ts#L8)* ___ @@ -40,7 +40,7 @@ ___ **● PENDING_ACCESS_KEY_PREFIX**: *"pending_key"* = "pending_key" -*Defined in [wallet-account.ts:11](https://github.com/nearprotocol/nearlib/blob/7e040fa/src.ts/wallet-account.ts#L11)* +*Defined in [wallet-account.ts:11](https://github.com/nearprotocol/nearlib/blob/ce23775/src.ts/wallet-account.ts#L11)* ___ diff --git a/lib/account.d.ts b/lib/account.d.ts index 9c27a79a6c..34d240d078 100644 --- a/lib/account.d.ts +++ b/lib/account.d.ts @@ -1,18 +1,18 @@ import BN from 'bn.js'; import { FinalTransactionResult } from './providers/provider'; import { Connection } from './connection'; +import { PublicKey } from './utils/key_pair'; export interface AccountState { account_id: string; - nonce: number; amount: string; - stake: string; - public_keys: Uint8Array[]; + staked: string; code_hash: string; } export declare class Account { readonly connection: Connection; readonly accountId: string; private _state; + private _accessKey; private _ready; protected readonly ready: Promise; constructor(connection: Connection, accountId: string); @@ -21,14 +21,15 @@ export declare class Account { private printLogs; private retryTxResult; private signAndSendTransaction; - createAndDeployContract(contractId: string, publicKey: string, data: Uint8Array, amount: BN): Promise; - sendMoney(receiver: string, amount: BN): Promise; - createAccount(newAccountId: string, publicKey: string, amount: BN): Promise; + createAndDeployContract(contractId: string, publicKey: string | PublicKey, data: Uint8Array, amount: BN): Promise; + sendMoney(receiverId: string, amount: BN): Promise; + createAccount(newAccountId: string, publicKey: string | PublicKey, amount: BN): Promise; deployContract(data: Uint8Array): Promise; - functionCall(contractId: string, methodName: string, args: any, amount?: BN): Promise; - addKey(publicKey: string, contractId?: string, methodName?: string, balanceOwner?: string, amount?: BN): Promise; - deleteKey(publicKey: string): Promise; - stake(publicKey: string, amount: BN): Promise; + functionCall(contractId: string, methodName: string, args: any, gas: number, amount?: BN): Promise; + addKey(publicKey: string | PublicKey, contractId?: string, methodName?: string, amount?: BN): Promise; + deleteKey(publicKey: string | PublicKey): Promise; + stake(publicKey: string | PublicKey, amount: BN): Promise; viewFunction(contractId: string, methodName: string, args: any): Promise; + getAccessKeys(): Promise; getAccountDetails(): Promise; } diff --git a/lib/account.js b/lib/account.js index 39fc1fe9fa..3aef6bd50d 100644 --- a/lib/account.js +++ b/lib/account.js @@ -1,16 +1,13 @@ 'use strict'; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; Object.defineProperty(exports, "__esModule", { value: true }); -const bn_js_1 = __importDefault(require("bn.js")); const transaction_1 = require("./transaction"); const provider_1 = require("./providers/provider"); const serialize_1 = require("./utils/serialize"); +const key_pair_1 = require("./utils/key_pair"); // Default amount of tokens to be send with the function calls. Used to pay for the fees // incurred while running the contract execution. The unused amount will be refunded back to // the originator. -const DEFAULT_FUNC_CALL_AMOUNT = new bn_js_1.default(1000000000); +const DEFAULT_FUNC_CALL_AMOUNT = 2000000; // Default number of retries before giving up on a transactioin. const TX_STATUS_RETRY_NUMBER = 10; // Default wait until next retry in millis. @@ -30,10 +27,17 @@ class Account { this.accountId = accountId; } async fetchState() { - const state = await this.connection.provider.query(`account/${this.accountId}`, ''); - this._state = state; - this._state.amount = state.amount; - this._state.stake = state.stake; + this._state = await this.connection.provider.query(`account/${this.accountId}`, ''); + try { + const publicKey = (await this.connection.signer.getPublicKey(this.accountId, this.connection.networkId)).toString(); + this._accessKey = await this.connection.provider.query(`access_key/${this.accountId}/${publicKey}`, ''); + if (this._accessKey === null) { + throw new Error(`Failed to fetch access key for '${this.accountId}' with public key ${publicKey}`); + } + } + catch { + this._accessKey = null; + } } async state() { await this.ready; @@ -58,8 +62,13 @@ class Account { } throw new Error(`Exceeded ${TX_STATUS_RETRY_NUMBER} status check attempts for transaction ${serialize_1.base_encode(txHash)}.`); } - async signAndSendTransaction(transaction) { - const [txHash, signedTx] = await transaction_1.signTransaction(this.connection.signer, transaction, this.accountId, this.connection.networkId); + async signAndSendTransaction(receiverId, actions) { + await this.ready; + if (this._accessKey === null) { + throw new Error(`Can not sign transactions, initialize account with available public key in Signer.`); + } + const status = await this.connection.provider.status(); + const [txHash, signedTx] = await transaction_1.signTransaction(receiverId, ++this._accessKey.nonce, actions, serialize_1.base_decode(status.sync_info.latest_block_hash), this.connection.signer, this.accountId, this.connection.networkId); let result; try { result = await this.connection.provider.sendTransaction(signedTx); @@ -72,18 +81,12 @@ class Account { throw error; } } - const flatLogs = result.logs.reduce((acc, it) => acc.concat(it.lines), []); - if (transaction.hasOwnProperty('contractId')) { - this.printLogs(transaction['contractId'], flatLogs); - } - else if (transaction.hasOwnProperty('originator')) { - this.printLogs(transaction['originator'], flatLogs); - } + const flatLogs = result.transactions.reduce((acc, it) => acc.concat(it.result.logs), []); + this.printLogs(signedTx.transaction.receiverId, flatLogs); if (result.status === provider_1.FinalTransactionStatus.Failed) { - if (result.logs) { - console.warn(flatLogs); + if (flatLogs) { const errorMessage = flatLogs.find(it => it.startsWith('ABORT:')) || flatLogs.find(it => it.startsWith('Runtime error:')) || ''; - throw new Error(`Transaction ${result.logs[0].hash} failed. ${errorMessage}`); + throw new Error(`Transaction ${result.transactions[0].hash} failed. ${errorMessage}`); } } // TODO: if Tx is Unknown or Started. @@ -91,50 +94,43 @@ class Account { return result; } async createAndDeployContract(contractId, publicKey, data, amount) { - await this.createAccount(contractId, publicKey, amount); + const accessKey = transaction_1.fullAccessKey(); + await this.signAndSendTransaction(contractId, [transaction_1.createAccount(), transaction_1.transfer(amount), transaction_1.addKey(key_pair_1.PublicKey.from(publicKey), accessKey), transaction_1.deployContract(data)]); const contractAccount = new Account(this.connection, contractId); - await contractAccount.ready; - await contractAccount.deployContract(data); return contractAccount; } - async sendMoney(receiver, amount) { - await this.ready; - this._state.nonce++; - return this.signAndSendTransaction(transaction_1.sendMoney(this._state.nonce, this.accountId, receiver, amount)); + async sendMoney(receiverId, amount) { + return this.signAndSendTransaction(receiverId, [transaction_1.transfer(amount)]); } async createAccount(newAccountId, publicKey, amount) { - await this.ready; - this._state.nonce++; - return this.signAndSendTransaction(transaction_1.createAccount(this._state.nonce, this.accountId, newAccountId, publicKey, amount)); + const accessKey = transaction_1.fullAccessKey(); + return this.signAndSendTransaction(newAccountId, [transaction_1.createAccount(), transaction_1.transfer(amount), transaction_1.addKey(key_pair_1.PublicKey.from(publicKey), accessKey)]); } async deployContract(data) { - await this.ready; - this._state.nonce++; - return this.signAndSendTransaction(transaction_1.deployContract(this._state.nonce, this.accountId, data)); + return this.signAndSendTransaction(this.accountId, [transaction_1.deployContract(data)]); } - async functionCall(contractId, methodName, args, amount) { + async functionCall(contractId, methodName, args, gas, amount) { if (!args) { args = {}; } - await this.ready; - this._state.nonce++; - return this.signAndSendTransaction(transaction_1.functionCall(this._state.nonce, this.accountId, contractId, methodName, Buffer.from(JSON.stringify(args)), amount || DEFAULT_FUNC_CALL_AMOUNT)); + return this.signAndSendTransaction(contractId, [transaction_1.functionCall(methodName, Buffer.from(JSON.stringify(args)), gas || DEFAULT_FUNC_CALL_AMOUNT, amount)]); } - async addKey(publicKey, contractId, methodName, balanceOwner, amount) { - await this.ready; - this._state.nonce++; - const accessKey = contractId ? transaction_1.createAccessKey(contractId, methodName, balanceOwner, amount) : null; - return this.signAndSendTransaction(transaction_1.addKey(this._state.nonce, this.accountId, publicKey, accessKey)); + // TODO: expand this API to support more options. + async addKey(publicKey, contractId, methodName, amount) { + let accessKey; + if (contractId === null || contractId === undefined) { + accessKey = transaction_1.fullAccessKey(); + } + else { + accessKey = transaction_1.functionCallAccessKey(contractId, !methodName ? [] : [methodName], amount); + } + return this.signAndSendTransaction(this.accountId, [transaction_1.addKey(key_pair_1.PublicKey.from(publicKey), accessKey)]); } async deleteKey(publicKey) { - await this.ready; - this._state.nonce++; - return this.signAndSendTransaction(transaction_1.deleteKey(this._state.nonce, this.accountId, publicKey)); + return this.signAndSendTransaction(this.accountId, [transaction_1.deleteKey(key_pair_1.PublicKey.from(publicKey))]); } async stake(publicKey, amount) { - await this.ready; - this._state.nonce++; - return this.signAndSendTransaction(transaction_1.stake(this._state.nonce, this.accountId, amount, publicKey)); + return this.signAndSendTransaction(this.accountId, [transaction_1.stake(amount, key_pair_1.PublicKey.from(publicKey))]); } async viewFunction(contractId, methodName, args) { const result = await this.connection.provider.query(`call/${contractId}/${methodName}`, serialize_1.base_encode(JSON.stringify(args))); @@ -143,15 +139,25 @@ class Account { } return JSON.parse(Buffer.from(result.result).toString()); } - async getAccountDetails() { + /// Returns array of {access_key: AccessKey, public_key: PublicKey} items. + async getAccessKeys() { const response = await this.connection.provider.query(`access_key/${this.accountId}`, ''); + return response; + } + async getAccountDetails() { + // TODO: update the response value to return all the different keys, not just app keys. + // Also if we need this function, or getAccessKeys is good enough. + const accessKeys = await this.getAccessKeys(); const result = { authorizedApps: [], transactions: [] }; - Object.keys(response).forEach((key) => { - result.authorizedApps.push({ - contractId: response[key][1].contract_id, - amount: response[key][1].amount, - publicKey: serialize_1.base_encode(response[key][0]), - }); + accessKeys.map((item) => { + if (item.access_key.permission.FunctionCall !== undefined) { + const perm = item.access_key.permission.FunctionCall; + result.authorizedApps.push({ + contractId: perm.receiver_id, + amount: perm.allowance, + publicKey: item.public_key, + }); + } }); return result; } diff --git a/lib/account_creator.d.ts b/lib/account_creator.d.ts index 9d49b4451a..8d0689531e 100644 --- a/lib/account_creator.d.ts +++ b/lib/account_creator.d.ts @@ -2,21 +2,22 @@ import BN from 'bn.js'; import { Connection } from './connection'; import { Account } from './account'; import { ConnectionInfo } from './utils/web'; +import { PublicKey } from './utils/key_pair'; /** * Account creator provides interface to specific implementation to acutally create account. */ export declare abstract class AccountCreator { - abstract createAccount(newAccountId: string, publicKey: string): Promise; + abstract createAccount(newAccountId: string, publicKey: PublicKey): Promise; } export declare class LocalAccountCreator extends AccountCreator { readonly masterAccount: Account; readonly initialBalance: BN; constructor(masterAccount: Account, initialBalance: BN); - createAccount(newAccountId: string, publicKey: string): Promise; + createAccount(newAccountId: string, publicKey: PublicKey): Promise; } export declare class UrlAccountCreator extends AccountCreator { readonly connection: Connection; readonly helperConnection: ConnectionInfo; constructor(connection: Connection, helperUrl: string); - createAccount(newAccountId: string, publicKey: string): Promise; + createAccount(newAccountId: string, publicKey: PublicKey): Promise; } diff --git a/lib/index.d.ts b/lib/index.d.ts index 7782bd345f..0ef891e0ea 100644 --- a/lib/index.d.ts +++ b/lib/index.d.ts @@ -1,6 +1,7 @@ import * as providers from './providers'; import * as utils from './utils'; import * as keyStores from './key_stores'; +import * as transactions from './transaction'; import { Account } from './account'; import * as accountCreator from './account_creator'; import { Connection } from './connection'; @@ -9,4 +10,4 @@ import { Contract } from './contract'; import { KeyPair } from './utils/key_pair'; import { connect } from './near'; import { WalletAccount } from './wallet-account'; -export { accountCreator, keyStores, providers, utils, Account, Connection, Contract, InMemorySigner, Signer, KeyPair, connect, WalletAccount }; +export { accountCreator, keyStores, providers, utils, transactions, Account, Connection, Contract, InMemorySigner, Signer, KeyPair, connect, WalletAccount }; diff --git a/lib/index.js b/lib/index.js index fd64720fb2..397a958829 100644 --- a/lib/index.js +++ b/lib/index.js @@ -13,6 +13,8 @@ const utils = __importStar(require("./utils")); exports.utils = utils; const keyStores = __importStar(require("./key_stores")); exports.keyStores = keyStores; +const transactions = __importStar(require("./transaction")); +exports.transactions = transactions; const account_1 = require("./account"); exports.Account = account_1.Account; const accountCreator = __importStar(require("./account_creator")); diff --git a/lib/key_stores/in_memory_key_store.js b/lib/key_stores/in_memory_key_store.js index a3446ba3b7..12285197f7 100644 --- a/lib/key_stores/in_memory_key_store.js +++ b/lib/key_stores/in_memory_key_store.js @@ -38,8 +38,8 @@ class InMemoryKeyStore extends keystore_1.KeyStore { const result = new Array(); Object.keys(this.keys).forEach((key) => { const parts = key.split(':'); - if (parts[1] === networkId) { - result.push(parts[0]); + if (parts[parts.length - 1] === networkId) { + result.push(parts.slice(0, parts.length - 1).join(':')); } }); return result; diff --git a/lib/near.d.ts b/lib/near.d.ts index ba5fdba730..7a18a64326 100644 --- a/lib/near.d.ts +++ b/lib/near.d.ts @@ -2,6 +2,7 @@ import BN from 'bn.js'; import { Account } from './account'; import { Connection } from './connection'; import { Contract } from './contract'; +import { PublicKey } from './utils/key_pair'; import { AccountCreator } from './account_creator'; export declare class Near { readonly config: any; @@ -9,7 +10,7 @@ export declare class Near { readonly accountCreator: AccountCreator; constructor(config: any); account(accountId: string): Promise; - createAccount(accountId: string, publicKey: string): Promise; + createAccount(accountId: string, publicKey: PublicKey): Promise; /** * Backwards compatibility method. Use `new nearlib.Contract(yourAccount, contractId, { viewMethods, changeMethods })` instead. * @param contractId @@ -20,12 +21,6 @@ export declare class Near { changeMethods: string[]; sender: string; }): Promise; - /** - * Backwards compatibility method. Use `contractAccount.deployContract` or `yourAccount.createAndDeployContract` instead. - * @param contractId - * @param wasmByteArray - */ - deployContract(contractId: string, wasmByteArray: Uint8Array): Promise; /** * Backwards compatibility method. Use `yourAccount.sendMoney` instead. * @param amount diff --git a/lib/near.js b/lib/near.js index 4c994d1884..9e7707d805 100644 --- a/lib/near.js +++ b/lib/near.js @@ -52,17 +52,6 @@ class Near { const account = new account_1.Account(this.connection, options.sender); return new contract_1.Contract(account, contractId, options); } - /** - * Backwards compatibility method. Use `contractAccount.deployContract` or `yourAccount.createAndDeployContract` instead. - * @param contractId - * @param wasmByteArray - */ - async deployContract(contractId, wasmByteArray) { - console.warn('near.deployContract is deprecated. Use `contractAccount.deployContract` or `yourAccount.createAndDeployContract` instead.'); - const account = new account_1.Account(this.connection, contractId); - const result = await account.deployContract(wasmByteArray); - return result.logs[0].hash; - } /** * Backwards compatibility method. Use `yourAccount.sendMoney` instead. * @param amount @@ -73,7 +62,7 @@ class Near { console.warn('near.sendTokens is deprecated. Use `yourAccount.sendMoney` instead.'); const account = new account_1.Account(this.connection, originator); const result = await account.sendMoney(receiver, amount); - return result.logs[0].hash; + return result.transactions[0].hash; } } exports.Near = Near; @@ -84,7 +73,7 @@ async function connect(config) { const keyFile = await unencrypted_file_system_keystore_1.loadJsonFile(config.keyPath); if (keyFile.account_id) { // TODO: Only load key if network ID matches - const keyPair = new key_pair_1.KeyPairEd25519(keyFile.secret_key); + const keyPair = key_pair_1.KeyPair.fromString(keyFile.secret_key); const keyPathStore = new key_stores_1.InMemoryKeyStore(); await keyPathStore.setKey(config.networkId, keyFile.account_id, keyPair); if (!config.masterAccount) { diff --git a/lib/protos.js b/lib/protos.js deleted file mode 100644 index cfebd68e0b..0000000000 --- a/lib/protos.js +++ /dev/null @@ -1,5300 +0,0 @@ -/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ -"use strict"; - -var $protobuf = require("protobufjs/minimal"); - -// Common aliases -var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; - -// Exported root namespace -var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {}); - -$root.CreateAccountTransaction = (function() { - - /** - * Properties of a CreateAccountTransaction. - * @exports ICreateAccountTransaction - * @interface ICreateAccountTransaction - * @property {number|Long|null} [nonce] CreateAccountTransaction nonce - * @property {string|null} [originator] CreateAccountTransaction originator - * @property {string|null} [newAccountId] CreateAccountTransaction newAccountId - * @property {IUint128|null} [amount] CreateAccountTransaction amount - * @property {Uint8Array|null} [publicKey] CreateAccountTransaction publicKey - */ - - /** - * Constructs a new CreateAccountTransaction. - * @exports CreateAccountTransaction - * @classdesc Represents a CreateAccountTransaction. - * @implements ICreateAccountTransaction - * @constructor - * @param {ICreateAccountTransaction=} [properties] Properties to set - */ - function CreateAccountTransaction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateAccountTransaction nonce. - * @member {number|Long} nonce - * @memberof CreateAccountTransaction - * @instance - */ - CreateAccountTransaction.prototype.nonce = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * CreateAccountTransaction originator. - * @member {string} originator - * @memberof CreateAccountTransaction - * @instance - */ - CreateAccountTransaction.prototype.originator = ""; - - /** - * CreateAccountTransaction newAccountId. - * @member {string} newAccountId - * @memberof CreateAccountTransaction - * @instance - */ - CreateAccountTransaction.prototype.newAccountId = ""; - - /** - * CreateAccountTransaction amount. - * @member {IUint128|null|undefined} amount - * @memberof CreateAccountTransaction - * @instance - */ - CreateAccountTransaction.prototype.amount = null; - - /** - * CreateAccountTransaction publicKey. - * @member {Uint8Array} publicKey - * @memberof CreateAccountTransaction - * @instance - */ - CreateAccountTransaction.prototype.publicKey = $util.newBuffer([]); - - /** - * Creates a new CreateAccountTransaction instance using the specified properties. - * @function create - * @memberof CreateAccountTransaction - * @static - * @param {ICreateAccountTransaction=} [properties] Properties to set - * @returns {CreateAccountTransaction} CreateAccountTransaction instance - */ - CreateAccountTransaction.create = function create(properties) { - return new CreateAccountTransaction(properties); - }; - - /** - * Encodes the specified CreateAccountTransaction message. Does not implicitly {@link CreateAccountTransaction.verify|verify} messages. - * @function encode - * @memberof CreateAccountTransaction - * @static - * @param {ICreateAccountTransaction} message CreateAccountTransaction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateAccountTransaction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.nonce != null && message.hasOwnProperty("nonce")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.nonce); - if (message.originator != null && message.hasOwnProperty("originator")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.originator); - if (message.newAccountId != null && message.hasOwnProperty("newAccountId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.newAccountId); - if (message.amount != null && message.hasOwnProperty("amount")) - $root.Uint128.encode(message.amount, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.publicKey != null && message.hasOwnProperty("publicKey")) - writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.publicKey); - return writer; - }; - - /** - * Encodes the specified CreateAccountTransaction message, length delimited. Does not implicitly {@link CreateAccountTransaction.verify|verify} messages. - * @function encodeDelimited - * @memberof CreateAccountTransaction - * @static - * @param {ICreateAccountTransaction} message CreateAccountTransaction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateAccountTransaction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateAccountTransaction message from the specified reader or buffer. - * @function decode - * @memberof CreateAccountTransaction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {CreateAccountTransaction} CreateAccountTransaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateAccountTransaction.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CreateAccountTransaction(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.nonce = reader.uint64(); - break; - case 2: - message.originator = reader.string(); - break; - case 3: - message.newAccountId = reader.string(); - break; - case 4: - message.amount = $root.Uint128.decode(reader, reader.uint32()); - break; - case 5: - message.publicKey = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateAccountTransaction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof CreateAccountTransaction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {CreateAccountTransaction} CreateAccountTransaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateAccountTransaction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateAccountTransaction message. - * @function verify - * @memberof CreateAccountTransaction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateAccountTransaction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.nonce != null && message.hasOwnProperty("nonce")) - if (!$util.isInteger(message.nonce) && !(message.nonce && $util.isInteger(message.nonce.low) && $util.isInteger(message.nonce.high))) - return "nonce: integer|Long expected"; - if (message.originator != null && message.hasOwnProperty("originator")) - if (!$util.isString(message.originator)) - return "originator: string expected"; - if (message.newAccountId != null && message.hasOwnProperty("newAccountId")) - if (!$util.isString(message.newAccountId)) - return "newAccountId: string expected"; - if (message.amount != null && message.hasOwnProperty("amount")) { - var error = $root.Uint128.verify(message.amount); - if (error) - return "amount." + error; - } - if (message.publicKey != null && message.hasOwnProperty("publicKey")) - if (!(message.publicKey && typeof message.publicKey.length === "number" || $util.isString(message.publicKey))) - return "publicKey: buffer expected"; - return null; - }; - - /** - * Creates a CreateAccountTransaction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof CreateAccountTransaction - * @static - * @param {Object.} object Plain object - * @returns {CreateAccountTransaction} CreateAccountTransaction - */ - CreateAccountTransaction.fromObject = function fromObject(object) { - if (object instanceof $root.CreateAccountTransaction) - return object; - var message = new $root.CreateAccountTransaction(); - if (object.nonce != null) - if ($util.Long) - (message.nonce = $util.Long.fromValue(object.nonce)).unsigned = true; - else if (typeof object.nonce === "string") - message.nonce = parseInt(object.nonce, 10); - else if (typeof object.nonce === "number") - message.nonce = object.nonce; - else if (typeof object.nonce === "object") - message.nonce = new $util.LongBits(object.nonce.low >>> 0, object.nonce.high >>> 0).toNumber(true); - if (object.originator != null) - message.originator = String(object.originator); - if (object.newAccountId != null) - message.newAccountId = String(object.newAccountId); - if (object.amount != null) { - if (typeof object.amount !== "object") - throw TypeError(".CreateAccountTransaction.amount: object expected"); - message.amount = $root.Uint128.fromObject(object.amount); - } - if (object.publicKey != null) - if (typeof object.publicKey === "string") - $util.base64.decode(object.publicKey, message.publicKey = $util.newBuffer($util.base64.length(object.publicKey)), 0); - else if (object.publicKey.length) - message.publicKey = object.publicKey; - return message; - }; - - /** - * Creates a plain object from a CreateAccountTransaction message. Also converts values to other types if specified. - * @function toObject - * @memberof CreateAccountTransaction - * @static - * @param {CreateAccountTransaction} message CreateAccountTransaction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateAccountTransaction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.nonce = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.nonce = options.longs === String ? "0" : 0; - object.originator = ""; - object.newAccountId = ""; - object.amount = null; - if (options.bytes === String) - object.publicKey = ""; - else { - object.publicKey = []; - if (options.bytes !== Array) - object.publicKey = $util.newBuffer(object.publicKey); - } - } - if (message.nonce != null && message.hasOwnProperty("nonce")) - if (typeof message.nonce === "number") - object.nonce = options.longs === String ? String(message.nonce) : message.nonce; - else - object.nonce = options.longs === String ? $util.Long.prototype.toString.call(message.nonce) : options.longs === Number ? new $util.LongBits(message.nonce.low >>> 0, message.nonce.high >>> 0).toNumber(true) : message.nonce; - if (message.originator != null && message.hasOwnProperty("originator")) - object.originator = message.originator; - if (message.newAccountId != null && message.hasOwnProperty("newAccountId")) - object.newAccountId = message.newAccountId; - if (message.amount != null && message.hasOwnProperty("amount")) - object.amount = $root.Uint128.toObject(message.amount, options); - if (message.publicKey != null && message.hasOwnProperty("publicKey")) - object.publicKey = options.bytes === String ? $util.base64.encode(message.publicKey, 0, message.publicKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.publicKey) : message.publicKey; - return object; - }; - - /** - * Converts this CreateAccountTransaction to JSON. - * @function toJSON - * @memberof CreateAccountTransaction - * @instance - * @returns {Object.} JSON object - */ - CreateAccountTransaction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return CreateAccountTransaction; -})(); - -$root.DeployContractTransaction = (function() { - - /** - * Properties of a DeployContractTransaction. - * @exports IDeployContractTransaction - * @interface IDeployContractTransaction - * @property {number|Long|null} [nonce] DeployContractTransaction nonce - * @property {string|null} [contractId] DeployContractTransaction contractId - * @property {Uint8Array|null} [wasmByteArray] DeployContractTransaction wasmByteArray - */ - - /** - * Constructs a new DeployContractTransaction. - * @exports DeployContractTransaction - * @classdesc Represents a DeployContractTransaction. - * @implements IDeployContractTransaction - * @constructor - * @param {IDeployContractTransaction=} [properties] Properties to set - */ - function DeployContractTransaction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeployContractTransaction nonce. - * @member {number|Long} nonce - * @memberof DeployContractTransaction - * @instance - */ - DeployContractTransaction.prototype.nonce = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * DeployContractTransaction contractId. - * @member {string} contractId - * @memberof DeployContractTransaction - * @instance - */ - DeployContractTransaction.prototype.contractId = ""; - - /** - * DeployContractTransaction wasmByteArray. - * @member {Uint8Array} wasmByteArray - * @memberof DeployContractTransaction - * @instance - */ - DeployContractTransaction.prototype.wasmByteArray = $util.newBuffer([]); - - /** - * Creates a new DeployContractTransaction instance using the specified properties. - * @function create - * @memberof DeployContractTransaction - * @static - * @param {IDeployContractTransaction=} [properties] Properties to set - * @returns {DeployContractTransaction} DeployContractTransaction instance - */ - DeployContractTransaction.create = function create(properties) { - return new DeployContractTransaction(properties); - }; - - /** - * Encodes the specified DeployContractTransaction message. Does not implicitly {@link DeployContractTransaction.verify|verify} messages. - * @function encode - * @memberof DeployContractTransaction - * @static - * @param {IDeployContractTransaction} message DeployContractTransaction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeployContractTransaction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.nonce != null && message.hasOwnProperty("nonce")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.nonce); - if (message.contractId != null && message.hasOwnProperty("contractId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.contractId); - if (message.wasmByteArray != null && message.hasOwnProperty("wasmByteArray")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.wasmByteArray); - return writer; - }; - - /** - * Encodes the specified DeployContractTransaction message, length delimited. Does not implicitly {@link DeployContractTransaction.verify|verify} messages. - * @function encodeDelimited - * @memberof DeployContractTransaction - * @static - * @param {IDeployContractTransaction} message DeployContractTransaction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeployContractTransaction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeployContractTransaction message from the specified reader or buffer. - * @function decode - * @memberof DeployContractTransaction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {DeployContractTransaction} DeployContractTransaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeployContractTransaction.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.DeployContractTransaction(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.nonce = reader.uint64(); - break; - case 2: - message.contractId = reader.string(); - break; - case 3: - message.wasmByteArray = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeployContractTransaction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof DeployContractTransaction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {DeployContractTransaction} DeployContractTransaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeployContractTransaction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeployContractTransaction message. - * @function verify - * @memberof DeployContractTransaction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeployContractTransaction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.nonce != null && message.hasOwnProperty("nonce")) - if (!$util.isInteger(message.nonce) && !(message.nonce && $util.isInteger(message.nonce.low) && $util.isInteger(message.nonce.high))) - return "nonce: integer|Long expected"; - if (message.contractId != null && message.hasOwnProperty("contractId")) - if (!$util.isString(message.contractId)) - return "contractId: string expected"; - if (message.wasmByteArray != null && message.hasOwnProperty("wasmByteArray")) - if (!(message.wasmByteArray && typeof message.wasmByteArray.length === "number" || $util.isString(message.wasmByteArray))) - return "wasmByteArray: buffer expected"; - return null; - }; - - /** - * Creates a DeployContractTransaction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof DeployContractTransaction - * @static - * @param {Object.} object Plain object - * @returns {DeployContractTransaction} DeployContractTransaction - */ - DeployContractTransaction.fromObject = function fromObject(object) { - if (object instanceof $root.DeployContractTransaction) - return object; - var message = new $root.DeployContractTransaction(); - if (object.nonce != null) - if ($util.Long) - (message.nonce = $util.Long.fromValue(object.nonce)).unsigned = true; - else if (typeof object.nonce === "string") - message.nonce = parseInt(object.nonce, 10); - else if (typeof object.nonce === "number") - message.nonce = object.nonce; - else if (typeof object.nonce === "object") - message.nonce = new $util.LongBits(object.nonce.low >>> 0, object.nonce.high >>> 0).toNumber(true); - if (object.contractId != null) - message.contractId = String(object.contractId); - if (object.wasmByteArray != null) - if (typeof object.wasmByteArray === "string") - $util.base64.decode(object.wasmByteArray, message.wasmByteArray = $util.newBuffer($util.base64.length(object.wasmByteArray)), 0); - else if (object.wasmByteArray.length) - message.wasmByteArray = object.wasmByteArray; - return message; - }; - - /** - * Creates a plain object from a DeployContractTransaction message. Also converts values to other types if specified. - * @function toObject - * @memberof DeployContractTransaction - * @static - * @param {DeployContractTransaction} message DeployContractTransaction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeployContractTransaction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.nonce = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.nonce = options.longs === String ? "0" : 0; - object.contractId = ""; - if (options.bytes === String) - object.wasmByteArray = ""; - else { - object.wasmByteArray = []; - if (options.bytes !== Array) - object.wasmByteArray = $util.newBuffer(object.wasmByteArray); - } - } - if (message.nonce != null && message.hasOwnProperty("nonce")) - if (typeof message.nonce === "number") - object.nonce = options.longs === String ? String(message.nonce) : message.nonce; - else - object.nonce = options.longs === String ? $util.Long.prototype.toString.call(message.nonce) : options.longs === Number ? new $util.LongBits(message.nonce.low >>> 0, message.nonce.high >>> 0).toNumber(true) : message.nonce; - if (message.contractId != null && message.hasOwnProperty("contractId")) - object.contractId = message.contractId; - if (message.wasmByteArray != null && message.hasOwnProperty("wasmByteArray")) - object.wasmByteArray = options.bytes === String ? $util.base64.encode(message.wasmByteArray, 0, message.wasmByteArray.length) : options.bytes === Array ? Array.prototype.slice.call(message.wasmByteArray) : message.wasmByteArray; - return object; - }; - - /** - * Converts this DeployContractTransaction to JSON. - * @function toJSON - * @memberof DeployContractTransaction - * @instance - * @returns {Object.} JSON object - */ - DeployContractTransaction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return DeployContractTransaction; -})(); - -$root.FunctionCallTransaction = (function() { - - /** - * Properties of a FunctionCallTransaction. - * @exports IFunctionCallTransaction - * @interface IFunctionCallTransaction - * @property {number|Long|null} [nonce] FunctionCallTransaction nonce - * @property {string|null} [originator] FunctionCallTransaction originator - * @property {string|null} [contractId] FunctionCallTransaction contractId - * @property {Uint8Array|null} [methodName] FunctionCallTransaction methodName - * @property {Uint8Array|null} [args] FunctionCallTransaction args - * @property {IUint128|null} [amount] FunctionCallTransaction amount - */ - - /** - * Constructs a new FunctionCallTransaction. - * @exports FunctionCallTransaction - * @classdesc Represents a FunctionCallTransaction. - * @implements IFunctionCallTransaction - * @constructor - * @param {IFunctionCallTransaction=} [properties] Properties to set - */ - function FunctionCallTransaction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FunctionCallTransaction nonce. - * @member {number|Long} nonce - * @memberof FunctionCallTransaction - * @instance - */ - FunctionCallTransaction.prototype.nonce = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * FunctionCallTransaction originator. - * @member {string} originator - * @memberof FunctionCallTransaction - * @instance - */ - FunctionCallTransaction.prototype.originator = ""; - - /** - * FunctionCallTransaction contractId. - * @member {string} contractId - * @memberof FunctionCallTransaction - * @instance - */ - FunctionCallTransaction.prototype.contractId = ""; - - /** - * FunctionCallTransaction methodName. - * @member {Uint8Array} methodName - * @memberof FunctionCallTransaction - * @instance - */ - FunctionCallTransaction.prototype.methodName = $util.newBuffer([]); - - /** - * FunctionCallTransaction args. - * @member {Uint8Array} args - * @memberof FunctionCallTransaction - * @instance - */ - FunctionCallTransaction.prototype.args = $util.newBuffer([]); - - /** - * FunctionCallTransaction amount. - * @member {IUint128|null|undefined} amount - * @memberof FunctionCallTransaction - * @instance - */ - FunctionCallTransaction.prototype.amount = null; - - /** - * Creates a new FunctionCallTransaction instance using the specified properties. - * @function create - * @memberof FunctionCallTransaction - * @static - * @param {IFunctionCallTransaction=} [properties] Properties to set - * @returns {FunctionCallTransaction} FunctionCallTransaction instance - */ - FunctionCallTransaction.create = function create(properties) { - return new FunctionCallTransaction(properties); - }; - - /** - * Encodes the specified FunctionCallTransaction message. Does not implicitly {@link FunctionCallTransaction.verify|verify} messages. - * @function encode - * @memberof FunctionCallTransaction - * @static - * @param {IFunctionCallTransaction} message FunctionCallTransaction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FunctionCallTransaction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.nonce != null && message.hasOwnProperty("nonce")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.nonce); - if (message.originator != null && message.hasOwnProperty("originator")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.originator); - if (message.contractId != null && message.hasOwnProperty("contractId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.contractId); - if (message.methodName != null && message.hasOwnProperty("methodName")) - writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.methodName); - if (message.args != null && message.hasOwnProperty("args")) - writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.args); - if (message.amount != null && message.hasOwnProperty("amount")) - $root.Uint128.encode(message.amount, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FunctionCallTransaction message, length delimited. Does not implicitly {@link FunctionCallTransaction.verify|verify} messages. - * @function encodeDelimited - * @memberof FunctionCallTransaction - * @static - * @param {IFunctionCallTransaction} message FunctionCallTransaction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FunctionCallTransaction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FunctionCallTransaction message from the specified reader or buffer. - * @function decode - * @memberof FunctionCallTransaction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {FunctionCallTransaction} FunctionCallTransaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FunctionCallTransaction.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.FunctionCallTransaction(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.nonce = reader.uint64(); - break; - case 2: - message.originator = reader.string(); - break; - case 3: - message.contractId = reader.string(); - break; - case 4: - message.methodName = reader.bytes(); - break; - case 5: - message.args = reader.bytes(); - break; - case 6: - message.amount = $root.Uint128.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FunctionCallTransaction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof FunctionCallTransaction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {FunctionCallTransaction} FunctionCallTransaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FunctionCallTransaction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FunctionCallTransaction message. - * @function verify - * @memberof FunctionCallTransaction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FunctionCallTransaction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.nonce != null && message.hasOwnProperty("nonce")) - if (!$util.isInteger(message.nonce) && !(message.nonce && $util.isInteger(message.nonce.low) && $util.isInteger(message.nonce.high))) - return "nonce: integer|Long expected"; - if (message.originator != null && message.hasOwnProperty("originator")) - if (!$util.isString(message.originator)) - return "originator: string expected"; - if (message.contractId != null && message.hasOwnProperty("contractId")) - if (!$util.isString(message.contractId)) - return "contractId: string expected"; - if (message.methodName != null && message.hasOwnProperty("methodName")) - if (!(message.methodName && typeof message.methodName.length === "number" || $util.isString(message.methodName))) - return "methodName: buffer expected"; - if (message.args != null && message.hasOwnProperty("args")) - if (!(message.args && typeof message.args.length === "number" || $util.isString(message.args))) - return "args: buffer expected"; - if (message.amount != null && message.hasOwnProperty("amount")) { - var error = $root.Uint128.verify(message.amount); - if (error) - return "amount." + error; - } - return null; - }; - - /** - * Creates a FunctionCallTransaction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof FunctionCallTransaction - * @static - * @param {Object.} object Plain object - * @returns {FunctionCallTransaction} FunctionCallTransaction - */ - FunctionCallTransaction.fromObject = function fromObject(object) { - if (object instanceof $root.FunctionCallTransaction) - return object; - var message = new $root.FunctionCallTransaction(); - if (object.nonce != null) - if ($util.Long) - (message.nonce = $util.Long.fromValue(object.nonce)).unsigned = true; - else if (typeof object.nonce === "string") - message.nonce = parseInt(object.nonce, 10); - else if (typeof object.nonce === "number") - message.nonce = object.nonce; - else if (typeof object.nonce === "object") - message.nonce = new $util.LongBits(object.nonce.low >>> 0, object.nonce.high >>> 0).toNumber(true); - if (object.originator != null) - message.originator = String(object.originator); - if (object.contractId != null) - message.contractId = String(object.contractId); - if (object.methodName != null) - if (typeof object.methodName === "string") - $util.base64.decode(object.methodName, message.methodName = $util.newBuffer($util.base64.length(object.methodName)), 0); - else if (object.methodName.length) - message.methodName = object.methodName; - if (object.args != null) - if (typeof object.args === "string") - $util.base64.decode(object.args, message.args = $util.newBuffer($util.base64.length(object.args)), 0); - else if (object.args.length) - message.args = object.args; - if (object.amount != null) { - if (typeof object.amount !== "object") - throw TypeError(".FunctionCallTransaction.amount: object expected"); - message.amount = $root.Uint128.fromObject(object.amount); - } - return message; - }; - - /** - * Creates a plain object from a FunctionCallTransaction message. Also converts values to other types if specified. - * @function toObject - * @memberof FunctionCallTransaction - * @static - * @param {FunctionCallTransaction} message FunctionCallTransaction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FunctionCallTransaction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.nonce = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.nonce = options.longs === String ? "0" : 0; - object.originator = ""; - object.contractId = ""; - if (options.bytes === String) - object.methodName = ""; - else { - object.methodName = []; - if (options.bytes !== Array) - object.methodName = $util.newBuffer(object.methodName); - } - if (options.bytes === String) - object.args = ""; - else { - object.args = []; - if (options.bytes !== Array) - object.args = $util.newBuffer(object.args); - } - object.amount = null; - } - if (message.nonce != null && message.hasOwnProperty("nonce")) - if (typeof message.nonce === "number") - object.nonce = options.longs === String ? String(message.nonce) : message.nonce; - else - object.nonce = options.longs === String ? $util.Long.prototype.toString.call(message.nonce) : options.longs === Number ? new $util.LongBits(message.nonce.low >>> 0, message.nonce.high >>> 0).toNumber(true) : message.nonce; - if (message.originator != null && message.hasOwnProperty("originator")) - object.originator = message.originator; - if (message.contractId != null && message.hasOwnProperty("contractId")) - object.contractId = message.contractId; - if (message.methodName != null && message.hasOwnProperty("methodName")) - object.methodName = options.bytes === String ? $util.base64.encode(message.methodName, 0, message.methodName.length) : options.bytes === Array ? Array.prototype.slice.call(message.methodName) : message.methodName; - if (message.args != null && message.hasOwnProperty("args")) - object.args = options.bytes === String ? $util.base64.encode(message.args, 0, message.args.length) : options.bytes === Array ? Array.prototype.slice.call(message.args) : message.args; - if (message.amount != null && message.hasOwnProperty("amount")) - object.amount = $root.Uint128.toObject(message.amount, options); - return object; - }; - - /** - * Converts this FunctionCallTransaction to JSON. - * @function toJSON - * @memberof FunctionCallTransaction - * @instance - * @returns {Object.} JSON object - */ - FunctionCallTransaction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return FunctionCallTransaction; -})(); - -$root.SendMoneyTransaction = (function() { - - /** - * Properties of a SendMoneyTransaction. - * @exports ISendMoneyTransaction - * @interface ISendMoneyTransaction - * @property {number|Long|null} [nonce] SendMoneyTransaction nonce - * @property {string|null} [originator] SendMoneyTransaction originator - * @property {string|null} [receiver] SendMoneyTransaction receiver - * @property {IUint128|null} [amount] SendMoneyTransaction amount - */ - - /** - * Constructs a new SendMoneyTransaction. - * @exports SendMoneyTransaction - * @classdesc Represents a SendMoneyTransaction. - * @implements ISendMoneyTransaction - * @constructor - * @param {ISendMoneyTransaction=} [properties] Properties to set - */ - function SendMoneyTransaction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SendMoneyTransaction nonce. - * @member {number|Long} nonce - * @memberof SendMoneyTransaction - * @instance - */ - SendMoneyTransaction.prototype.nonce = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * SendMoneyTransaction originator. - * @member {string} originator - * @memberof SendMoneyTransaction - * @instance - */ - SendMoneyTransaction.prototype.originator = ""; - - /** - * SendMoneyTransaction receiver. - * @member {string} receiver - * @memberof SendMoneyTransaction - * @instance - */ - SendMoneyTransaction.prototype.receiver = ""; - - /** - * SendMoneyTransaction amount. - * @member {IUint128|null|undefined} amount - * @memberof SendMoneyTransaction - * @instance - */ - SendMoneyTransaction.prototype.amount = null; - - /** - * Creates a new SendMoneyTransaction instance using the specified properties. - * @function create - * @memberof SendMoneyTransaction - * @static - * @param {ISendMoneyTransaction=} [properties] Properties to set - * @returns {SendMoneyTransaction} SendMoneyTransaction instance - */ - SendMoneyTransaction.create = function create(properties) { - return new SendMoneyTransaction(properties); - }; - - /** - * Encodes the specified SendMoneyTransaction message. Does not implicitly {@link SendMoneyTransaction.verify|verify} messages. - * @function encode - * @memberof SendMoneyTransaction - * @static - * @param {ISendMoneyTransaction} message SendMoneyTransaction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SendMoneyTransaction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.nonce != null && message.hasOwnProperty("nonce")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.nonce); - if (message.originator != null && message.hasOwnProperty("originator")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.originator); - if (message.receiver != null && message.hasOwnProperty("receiver")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.receiver); - if (message.amount != null && message.hasOwnProperty("amount")) - $root.Uint128.encode(message.amount, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SendMoneyTransaction message, length delimited. Does not implicitly {@link SendMoneyTransaction.verify|verify} messages. - * @function encodeDelimited - * @memberof SendMoneyTransaction - * @static - * @param {ISendMoneyTransaction} message SendMoneyTransaction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SendMoneyTransaction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SendMoneyTransaction message from the specified reader or buffer. - * @function decode - * @memberof SendMoneyTransaction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {SendMoneyTransaction} SendMoneyTransaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SendMoneyTransaction.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.SendMoneyTransaction(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.nonce = reader.uint64(); - break; - case 2: - message.originator = reader.string(); - break; - case 3: - message.receiver = reader.string(); - break; - case 4: - message.amount = $root.Uint128.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SendMoneyTransaction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof SendMoneyTransaction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {SendMoneyTransaction} SendMoneyTransaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SendMoneyTransaction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SendMoneyTransaction message. - * @function verify - * @memberof SendMoneyTransaction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SendMoneyTransaction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.nonce != null && message.hasOwnProperty("nonce")) - if (!$util.isInteger(message.nonce) && !(message.nonce && $util.isInteger(message.nonce.low) && $util.isInteger(message.nonce.high))) - return "nonce: integer|Long expected"; - if (message.originator != null && message.hasOwnProperty("originator")) - if (!$util.isString(message.originator)) - return "originator: string expected"; - if (message.receiver != null && message.hasOwnProperty("receiver")) - if (!$util.isString(message.receiver)) - return "receiver: string expected"; - if (message.amount != null && message.hasOwnProperty("amount")) { - var error = $root.Uint128.verify(message.amount); - if (error) - return "amount." + error; - } - return null; - }; - - /** - * Creates a SendMoneyTransaction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof SendMoneyTransaction - * @static - * @param {Object.} object Plain object - * @returns {SendMoneyTransaction} SendMoneyTransaction - */ - SendMoneyTransaction.fromObject = function fromObject(object) { - if (object instanceof $root.SendMoneyTransaction) - return object; - var message = new $root.SendMoneyTransaction(); - if (object.nonce != null) - if ($util.Long) - (message.nonce = $util.Long.fromValue(object.nonce)).unsigned = true; - else if (typeof object.nonce === "string") - message.nonce = parseInt(object.nonce, 10); - else if (typeof object.nonce === "number") - message.nonce = object.nonce; - else if (typeof object.nonce === "object") - message.nonce = new $util.LongBits(object.nonce.low >>> 0, object.nonce.high >>> 0).toNumber(true); - if (object.originator != null) - message.originator = String(object.originator); - if (object.receiver != null) - message.receiver = String(object.receiver); - if (object.amount != null) { - if (typeof object.amount !== "object") - throw TypeError(".SendMoneyTransaction.amount: object expected"); - message.amount = $root.Uint128.fromObject(object.amount); - } - return message; - }; - - /** - * Creates a plain object from a SendMoneyTransaction message. Also converts values to other types if specified. - * @function toObject - * @memberof SendMoneyTransaction - * @static - * @param {SendMoneyTransaction} message SendMoneyTransaction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SendMoneyTransaction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.nonce = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.nonce = options.longs === String ? "0" : 0; - object.originator = ""; - object.receiver = ""; - object.amount = null; - } - if (message.nonce != null && message.hasOwnProperty("nonce")) - if (typeof message.nonce === "number") - object.nonce = options.longs === String ? String(message.nonce) : message.nonce; - else - object.nonce = options.longs === String ? $util.Long.prototype.toString.call(message.nonce) : options.longs === Number ? new $util.LongBits(message.nonce.low >>> 0, message.nonce.high >>> 0).toNumber(true) : message.nonce; - if (message.originator != null && message.hasOwnProperty("originator")) - object.originator = message.originator; - if (message.receiver != null && message.hasOwnProperty("receiver")) - object.receiver = message.receiver; - if (message.amount != null && message.hasOwnProperty("amount")) - object.amount = $root.Uint128.toObject(message.amount, options); - return object; - }; - - /** - * Converts this SendMoneyTransaction to JSON. - * @function toJSON - * @memberof SendMoneyTransaction - * @instance - * @returns {Object.} JSON object - */ - SendMoneyTransaction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return SendMoneyTransaction; -})(); - -$root.StakeTransaction = (function() { - - /** - * Properties of a StakeTransaction. - * @exports IStakeTransaction - * @interface IStakeTransaction - * @property {number|Long|null} [nonce] StakeTransaction nonce - * @property {string|null} [originator] StakeTransaction originator - * @property {IUint128|null} [amount] StakeTransaction amount - * @property {string|null} [publicKey] StakeTransaction publicKey - * @property {string|null} [blsPublicKey] StakeTransaction blsPublicKey - */ - - /** - * Constructs a new StakeTransaction. - * @exports StakeTransaction - * @classdesc Represents a StakeTransaction. - * @implements IStakeTransaction - * @constructor - * @param {IStakeTransaction=} [properties] Properties to set - */ - function StakeTransaction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * StakeTransaction nonce. - * @member {number|Long} nonce - * @memberof StakeTransaction - * @instance - */ - StakeTransaction.prototype.nonce = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * StakeTransaction originator. - * @member {string} originator - * @memberof StakeTransaction - * @instance - */ - StakeTransaction.prototype.originator = ""; - - /** - * StakeTransaction amount. - * @member {IUint128|null|undefined} amount - * @memberof StakeTransaction - * @instance - */ - StakeTransaction.prototype.amount = null; - - /** - * StakeTransaction publicKey. - * @member {string} publicKey - * @memberof StakeTransaction - * @instance - */ - StakeTransaction.prototype.publicKey = ""; - - /** - * StakeTransaction blsPublicKey. - * @member {string} blsPublicKey - * @memberof StakeTransaction - * @instance - */ - StakeTransaction.prototype.blsPublicKey = ""; - - /** - * Creates a new StakeTransaction instance using the specified properties. - * @function create - * @memberof StakeTransaction - * @static - * @param {IStakeTransaction=} [properties] Properties to set - * @returns {StakeTransaction} StakeTransaction instance - */ - StakeTransaction.create = function create(properties) { - return new StakeTransaction(properties); - }; - - /** - * Encodes the specified StakeTransaction message. Does not implicitly {@link StakeTransaction.verify|verify} messages. - * @function encode - * @memberof StakeTransaction - * @static - * @param {IStakeTransaction} message StakeTransaction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StakeTransaction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.nonce != null && message.hasOwnProperty("nonce")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.nonce); - if (message.originator != null && message.hasOwnProperty("originator")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.originator); - if (message.amount != null && message.hasOwnProperty("amount")) - $root.Uint128.encode(message.amount, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.publicKey != null && message.hasOwnProperty("publicKey")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.publicKey); - if (message.blsPublicKey != null && message.hasOwnProperty("blsPublicKey")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.blsPublicKey); - return writer; - }; - - /** - * Encodes the specified StakeTransaction message, length delimited. Does not implicitly {@link StakeTransaction.verify|verify} messages. - * @function encodeDelimited - * @memberof StakeTransaction - * @static - * @param {IStakeTransaction} message StakeTransaction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StakeTransaction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StakeTransaction message from the specified reader or buffer. - * @function decode - * @memberof StakeTransaction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {StakeTransaction} StakeTransaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StakeTransaction.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.StakeTransaction(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.nonce = reader.uint64(); - break; - case 2: - message.originator = reader.string(); - break; - case 3: - message.amount = $root.Uint128.decode(reader, reader.uint32()); - break; - case 4: - message.publicKey = reader.string(); - break; - case 5: - message.blsPublicKey = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StakeTransaction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof StakeTransaction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {StakeTransaction} StakeTransaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StakeTransaction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StakeTransaction message. - * @function verify - * @memberof StakeTransaction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StakeTransaction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.nonce != null && message.hasOwnProperty("nonce")) - if (!$util.isInteger(message.nonce) && !(message.nonce && $util.isInteger(message.nonce.low) && $util.isInteger(message.nonce.high))) - return "nonce: integer|Long expected"; - if (message.originator != null && message.hasOwnProperty("originator")) - if (!$util.isString(message.originator)) - return "originator: string expected"; - if (message.amount != null && message.hasOwnProperty("amount")) { - var error = $root.Uint128.verify(message.amount); - if (error) - return "amount." + error; - } - if (message.publicKey != null && message.hasOwnProperty("publicKey")) - if (!$util.isString(message.publicKey)) - return "publicKey: string expected"; - if (message.blsPublicKey != null && message.hasOwnProperty("blsPublicKey")) - if (!$util.isString(message.blsPublicKey)) - return "blsPublicKey: string expected"; - return null; - }; - - /** - * Creates a StakeTransaction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof StakeTransaction - * @static - * @param {Object.} object Plain object - * @returns {StakeTransaction} StakeTransaction - */ - StakeTransaction.fromObject = function fromObject(object) { - if (object instanceof $root.StakeTransaction) - return object; - var message = new $root.StakeTransaction(); - if (object.nonce != null) - if ($util.Long) - (message.nonce = $util.Long.fromValue(object.nonce)).unsigned = true; - else if (typeof object.nonce === "string") - message.nonce = parseInt(object.nonce, 10); - else if (typeof object.nonce === "number") - message.nonce = object.nonce; - else if (typeof object.nonce === "object") - message.nonce = new $util.LongBits(object.nonce.low >>> 0, object.nonce.high >>> 0).toNumber(true); - if (object.originator != null) - message.originator = String(object.originator); - if (object.amount != null) { - if (typeof object.amount !== "object") - throw TypeError(".StakeTransaction.amount: object expected"); - message.amount = $root.Uint128.fromObject(object.amount); - } - if (object.publicKey != null) - message.publicKey = String(object.publicKey); - if (object.blsPublicKey != null) - message.blsPublicKey = String(object.blsPublicKey); - return message; - }; - - /** - * Creates a plain object from a StakeTransaction message. Also converts values to other types if specified. - * @function toObject - * @memberof StakeTransaction - * @static - * @param {StakeTransaction} message StakeTransaction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StakeTransaction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.nonce = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.nonce = options.longs === String ? "0" : 0; - object.originator = ""; - object.amount = null; - object.publicKey = ""; - object.blsPublicKey = ""; - } - if (message.nonce != null && message.hasOwnProperty("nonce")) - if (typeof message.nonce === "number") - object.nonce = options.longs === String ? String(message.nonce) : message.nonce; - else - object.nonce = options.longs === String ? $util.Long.prototype.toString.call(message.nonce) : options.longs === Number ? new $util.LongBits(message.nonce.low >>> 0, message.nonce.high >>> 0).toNumber(true) : message.nonce; - if (message.originator != null && message.hasOwnProperty("originator")) - object.originator = message.originator; - if (message.amount != null && message.hasOwnProperty("amount")) - object.amount = $root.Uint128.toObject(message.amount, options); - if (message.publicKey != null && message.hasOwnProperty("publicKey")) - object.publicKey = message.publicKey; - if (message.blsPublicKey != null && message.hasOwnProperty("blsPublicKey")) - object.blsPublicKey = message.blsPublicKey; - return object; - }; - - /** - * Converts this StakeTransaction to JSON. - * @function toJSON - * @memberof StakeTransaction - * @instance - * @returns {Object.} JSON object - */ - StakeTransaction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return StakeTransaction; -})(); - -$root.SwapKeyTransaction = (function() { - - /** - * Properties of a SwapKeyTransaction. - * @exports ISwapKeyTransaction - * @interface ISwapKeyTransaction - * @property {number|Long|null} [nonce] SwapKeyTransaction nonce - * @property {string|null} [originator] SwapKeyTransaction originator - * @property {Uint8Array|null} [curKey] SwapKeyTransaction curKey - * @property {Uint8Array|null} [newKey] SwapKeyTransaction newKey - */ - - /** - * Constructs a new SwapKeyTransaction. - * @exports SwapKeyTransaction - * @classdesc Represents a SwapKeyTransaction. - * @implements ISwapKeyTransaction - * @constructor - * @param {ISwapKeyTransaction=} [properties] Properties to set - */ - function SwapKeyTransaction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SwapKeyTransaction nonce. - * @member {number|Long} nonce - * @memberof SwapKeyTransaction - * @instance - */ - SwapKeyTransaction.prototype.nonce = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * SwapKeyTransaction originator. - * @member {string} originator - * @memberof SwapKeyTransaction - * @instance - */ - SwapKeyTransaction.prototype.originator = ""; - - /** - * SwapKeyTransaction curKey. - * @member {Uint8Array} curKey - * @memberof SwapKeyTransaction - * @instance - */ - SwapKeyTransaction.prototype.curKey = $util.newBuffer([]); - - /** - * SwapKeyTransaction newKey. - * @member {Uint8Array} newKey - * @memberof SwapKeyTransaction - * @instance - */ - SwapKeyTransaction.prototype.newKey = $util.newBuffer([]); - - /** - * Creates a new SwapKeyTransaction instance using the specified properties. - * @function create - * @memberof SwapKeyTransaction - * @static - * @param {ISwapKeyTransaction=} [properties] Properties to set - * @returns {SwapKeyTransaction} SwapKeyTransaction instance - */ - SwapKeyTransaction.create = function create(properties) { - return new SwapKeyTransaction(properties); - }; - - /** - * Encodes the specified SwapKeyTransaction message. Does not implicitly {@link SwapKeyTransaction.verify|verify} messages. - * @function encode - * @memberof SwapKeyTransaction - * @static - * @param {ISwapKeyTransaction} message SwapKeyTransaction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SwapKeyTransaction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.nonce != null && message.hasOwnProperty("nonce")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.nonce); - if (message.originator != null && message.hasOwnProperty("originator")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.originator); - if (message.curKey != null && message.hasOwnProperty("curKey")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.curKey); - if (message.newKey != null && message.hasOwnProperty("newKey")) - writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.newKey); - return writer; - }; - - /** - * Encodes the specified SwapKeyTransaction message, length delimited. Does not implicitly {@link SwapKeyTransaction.verify|verify} messages. - * @function encodeDelimited - * @memberof SwapKeyTransaction - * @static - * @param {ISwapKeyTransaction} message SwapKeyTransaction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SwapKeyTransaction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SwapKeyTransaction message from the specified reader or buffer. - * @function decode - * @memberof SwapKeyTransaction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {SwapKeyTransaction} SwapKeyTransaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SwapKeyTransaction.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.SwapKeyTransaction(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.nonce = reader.uint64(); - break; - case 2: - message.originator = reader.string(); - break; - case 3: - message.curKey = reader.bytes(); - break; - case 4: - message.newKey = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SwapKeyTransaction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof SwapKeyTransaction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {SwapKeyTransaction} SwapKeyTransaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SwapKeyTransaction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SwapKeyTransaction message. - * @function verify - * @memberof SwapKeyTransaction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SwapKeyTransaction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.nonce != null && message.hasOwnProperty("nonce")) - if (!$util.isInteger(message.nonce) && !(message.nonce && $util.isInteger(message.nonce.low) && $util.isInteger(message.nonce.high))) - return "nonce: integer|Long expected"; - if (message.originator != null && message.hasOwnProperty("originator")) - if (!$util.isString(message.originator)) - return "originator: string expected"; - if (message.curKey != null && message.hasOwnProperty("curKey")) - if (!(message.curKey && typeof message.curKey.length === "number" || $util.isString(message.curKey))) - return "curKey: buffer expected"; - if (message.newKey != null && message.hasOwnProperty("newKey")) - if (!(message.newKey && typeof message.newKey.length === "number" || $util.isString(message.newKey))) - return "newKey: buffer expected"; - return null; - }; - - /** - * Creates a SwapKeyTransaction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof SwapKeyTransaction - * @static - * @param {Object.} object Plain object - * @returns {SwapKeyTransaction} SwapKeyTransaction - */ - SwapKeyTransaction.fromObject = function fromObject(object) { - if (object instanceof $root.SwapKeyTransaction) - return object; - var message = new $root.SwapKeyTransaction(); - if (object.nonce != null) - if ($util.Long) - (message.nonce = $util.Long.fromValue(object.nonce)).unsigned = true; - else if (typeof object.nonce === "string") - message.nonce = parseInt(object.nonce, 10); - else if (typeof object.nonce === "number") - message.nonce = object.nonce; - else if (typeof object.nonce === "object") - message.nonce = new $util.LongBits(object.nonce.low >>> 0, object.nonce.high >>> 0).toNumber(true); - if (object.originator != null) - message.originator = String(object.originator); - if (object.curKey != null) - if (typeof object.curKey === "string") - $util.base64.decode(object.curKey, message.curKey = $util.newBuffer($util.base64.length(object.curKey)), 0); - else if (object.curKey.length) - message.curKey = object.curKey; - if (object.newKey != null) - if (typeof object.newKey === "string") - $util.base64.decode(object.newKey, message.newKey = $util.newBuffer($util.base64.length(object.newKey)), 0); - else if (object.newKey.length) - message.newKey = object.newKey; - return message; - }; - - /** - * Creates a plain object from a SwapKeyTransaction message. Also converts values to other types if specified. - * @function toObject - * @memberof SwapKeyTransaction - * @static - * @param {SwapKeyTransaction} message SwapKeyTransaction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SwapKeyTransaction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.nonce = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.nonce = options.longs === String ? "0" : 0; - object.originator = ""; - if (options.bytes === String) - object.curKey = ""; - else { - object.curKey = []; - if (options.bytes !== Array) - object.curKey = $util.newBuffer(object.curKey); - } - if (options.bytes === String) - object.newKey = ""; - else { - object.newKey = []; - if (options.bytes !== Array) - object.newKey = $util.newBuffer(object.newKey); - } - } - if (message.nonce != null && message.hasOwnProperty("nonce")) - if (typeof message.nonce === "number") - object.nonce = options.longs === String ? String(message.nonce) : message.nonce; - else - object.nonce = options.longs === String ? $util.Long.prototype.toString.call(message.nonce) : options.longs === Number ? new $util.LongBits(message.nonce.low >>> 0, message.nonce.high >>> 0).toNumber(true) : message.nonce; - if (message.originator != null && message.hasOwnProperty("originator")) - object.originator = message.originator; - if (message.curKey != null && message.hasOwnProperty("curKey")) - object.curKey = options.bytes === String ? $util.base64.encode(message.curKey, 0, message.curKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.curKey) : message.curKey; - if (message.newKey != null && message.hasOwnProperty("newKey")) - object.newKey = options.bytes === String ? $util.base64.encode(message.newKey, 0, message.newKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.newKey) : message.newKey; - return object; - }; - - /** - * Converts this SwapKeyTransaction to JSON. - * @function toJSON - * @memberof SwapKeyTransaction - * @instance - * @returns {Object.} JSON object - */ - SwapKeyTransaction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return SwapKeyTransaction; -})(); - -$root.AddKeyTransaction = (function() { - - /** - * Properties of an AddKeyTransaction. - * @exports IAddKeyTransaction - * @interface IAddKeyTransaction - * @property {number|Long|null} [nonce] AddKeyTransaction nonce - * @property {string|null} [originator] AddKeyTransaction originator - * @property {Uint8Array|null} [newKey] AddKeyTransaction newKey - * @property {IAccessKey|null} [accessKey] AddKeyTransaction accessKey - */ - - /** - * Constructs a new AddKeyTransaction. - * @exports AddKeyTransaction - * @classdesc Represents an AddKeyTransaction. - * @implements IAddKeyTransaction - * @constructor - * @param {IAddKeyTransaction=} [properties] Properties to set - */ - function AddKeyTransaction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AddKeyTransaction nonce. - * @member {number|Long} nonce - * @memberof AddKeyTransaction - * @instance - */ - AddKeyTransaction.prototype.nonce = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * AddKeyTransaction originator. - * @member {string} originator - * @memberof AddKeyTransaction - * @instance - */ - AddKeyTransaction.prototype.originator = ""; - - /** - * AddKeyTransaction newKey. - * @member {Uint8Array} newKey - * @memberof AddKeyTransaction - * @instance - */ - AddKeyTransaction.prototype.newKey = $util.newBuffer([]); - - /** - * AddKeyTransaction accessKey. - * @member {IAccessKey|null|undefined} accessKey - * @memberof AddKeyTransaction - * @instance - */ - AddKeyTransaction.prototype.accessKey = null; - - /** - * Creates a new AddKeyTransaction instance using the specified properties. - * @function create - * @memberof AddKeyTransaction - * @static - * @param {IAddKeyTransaction=} [properties] Properties to set - * @returns {AddKeyTransaction} AddKeyTransaction instance - */ - AddKeyTransaction.create = function create(properties) { - return new AddKeyTransaction(properties); - }; - - /** - * Encodes the specified AddKeyTransaction message. Does not implicitly {@link AddKeyTransaction.verify|verify} messages. - * @function encode - * @memberof AddKeyTransaction - * @static - * @param {IAddKeyTransaction} message AddKeyTransaction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AddKeyTransaction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.nonce != null && message.hasOwnProperty("nonce")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.nonce); - if (message.originator != null && message.hasOwnProperty("originator")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.originator); - if (message.newKey != null && message.hasOwnProperty("newKey")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.newKey); - if (message.accessKey != null && message.hasOwnProperty("accessKey")) - $root.AccessKey.encode(message.accessKey, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified AddKeyTransaction message, length delimited. Does not implicitly {@link AddKeyTransaction.verify|verify} messages. - * @function encodeDelimited - * @memberof AddKeyTransaction - * @static - * @param {IAddKeyTransaction} message AddKeyTransaction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AddKeyTransaction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AddKeyTransaction message from the specified reader or buffer. - * @function decode - * @memberof AddKeyTransaction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {AddKeyTransaction} AddKeyTransaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AddKeyTransaction.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.AddKeyTransaction(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.nonce = reader.uint64(); - break; - case 2: - message.originator = reader.string(); - break; - case 3: - message.newKey = reader.bytes(); - break; - case 4: - message.accessKey = $root.AccessKey.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AddKeyTransaction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof AddKeyTransaction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {AddKeyTransaction} AddKeyTransaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AddKeyTransaction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AddKeyTransaction message. - * @function verify - * @memberof AddKeyTransaction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AddKeyTransaction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.nonce != null && message.hasOwnProperty("nonce")) - if (!$util.isInteger(message.nonce) && !(message.nonce && $util.isInteger(message.nonce.low) && $util.isInteger(message.nonce.high))) - return "nonce: integer|Long expected"; - if (message.originator != null && message.hasOwnProperty("originator")) - if (!$util.isString(message.originator)) - return "originator: string expected"; - if (message.newKey != null && message.hasOwnProperty("newKey")) - if (!(message.newKey && typeof message.newKey.length === "number" || $util.isString(message.newKey))) - return "newKey: buffer expected"; - if (message.accessKey != null && message.hasOwnProperty("accessKey")) { - var error = $root.AccessKey.verify(message.accessKey); - if (error) - return "accessKey." + error; - } - return null; - }; - - /** - * Creates an AddKeyTransaction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof AddKeyTransaction - * @static - * @param {Object.} object Plain object - * @returns {AddKeyTransaction} AddKeyTransaction - */ - AddKeyTransaction.fromObject = function fromObject(object) { - if (object instanceof $root.AddKeyTransaction) - return object; - var message = new $root.AddKeyTransaction(); - if (object.nonce != null) - if ($util.Long) - (message.nonce = $util.Long.fromValue(object.nonce)).unsigned = true; - else if (typeof object.nonce === "string") - message.nonce = parseInt(object.nonce, 10); - else if (typeof object.nonce === "number") - message.nonce = object.nonce; - else if (typeof object.nonce === "object") - message.nonce = new $util.LongBits(object.nonce.low >>> 0, object.nonce.high >>> 0).toNumber(true); - if (object.originator != null) - message.originator = String(object.originator); - if (object.newKey != null) - if (typeof object.newKey === "string") - $util.base64.decode(object.newKey, message.newKey = $util.newBuffer($util.base64.length(object.newKey)), 0); - else if (object.newKey.length) - message.newKey = object.newKey; - if (object.accessKey != null) { - if (typeof object.accessKey !== "object") - throw TypeError(".AddKeyTransaction.accessKey: object expected"); - message.accessKey = $root.AccessKey.fromObject(object.accessKey); - } - return message; - }; - - /** - * Creates a plain object from an AddKeyTransaction message. Also converts values to other types if specified. - * @function toObject - * @memberof AddKeyTransaction - * @static - * @param {AddKeyTransaction} message AddKeyTransaction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AddKeyTransaction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.nonce = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.nonce = options.longs === String ? "0" : 0; - object.originator = ""; - if (options.bytes === String) - object.newKey = ""; - else { - object.newKey = []; - if (options.bytes !== Array) - object.newKey = $util.newBuffer(object.newKey); - } - object.accessKey = null; - } - if (message.nonce != null && message.hasOwnProperty("nonce")) - if (typeof message.nonce === "number") - object.nonce = options.longs === String ? String(message.nonce) : message.nonce; - else - object.nonce = options.longs === String ? $util.Long.prototype.toString.call(message.nonce) : options.longs === Number ? new $util.LongBits(message.nonce.low >>> 0, message.nonce.high >>> 0).toNumber(true) : message.nonce; - if (message.originator != null && message.hasOwnProperty("originator")) - object.originator = message.originator; - if (message.newKey != null && message.hasOwnProperty("newKey")) - object.newKey = options.bytes === String ? $util.base64.encode(message.newKey, 0, message.newKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.newKey) : message.newKey; - if (message.accessKey != null && message.hasOwnProperty("accessKey")) - object.accessKey = $root.AccessKey.toObject(message.accessKey, options); - return object; - }; - - /** - * Converts this AddKeyTransaction to JSON. - * @function toJSON - * @memberof AddKeyTransaction - * @instance - * @returns {Object.} JSON object - */ - AddKeyTransaction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return AddKeyTransaction; -})(); - -$root.DeleteKeyTransaction = (function() { - - /** - * Properties of a DeleteKeyTransaction. - * @exports IDeleteKeyTransaction - * @interface IDeleteKeyTransaction - * @property {number|Long|null} [nonce] DeleteKeyTransaction nonce - * @property {string|null} [originator] DeleteKeyTransaction originator - * @property {Uint8Array|null} [curKey] DeleteKeyTransaction curKey - */ - - /** - * Constructs a new DeleteKeyTransaction. - * @exports DeleteKeyTransaction - * @classdesc Represents a DeleteKeyTransaction. - * @implements IDeleteKeyTransaction - * @constructor - * @param {IDeleteKeyTransaction=} [properties] Properties to set - */ - function DeleteKeyTransaction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteKeyTransaction nonce. - * @member {number|Long} nonce - * @memberof DeleteKeyTransaction - * @instance - */ - DeleteKeyTransaction.prototype.nonce = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * DeleteKeyTransaction originator. - * @member {string} originator - * @memberof DeleteKeyTransaction - * @instance - */ - DeleteKeyTransaction.prototype.originator = ""; - - /** - * DeleteKeyTransaction curKey. - * @member {Uint8Array} curKey - * @memberof DeleteKeyTransaction - * @instance - */ - DeleteKeyTransaction.prototype.curKey = $util.newBuffer([]); - - /** - * Creates a new DeleteKeyTransaction instance using the specified properties. - * @function create - * @memberof DeleteKeyTransaction - * @static - * @param {IDeleteKeyTransaction=} [properties] Properties to set - * @returns {DeleteKeyTransaction} DeleteKeyTransaction instance - */ - DeleteKeyTransaction.create = function create(properties) { - return new DeleteKeyTransaction(properties); - }; - - /** - * Encodes the specified DeleteKeyTransaction message. Does not implicitly {@link DeleteKeyTransaction.verify|verify} messages. - * @function encode - * @memberof DeleteKeyTransaction - * @static - * @param {IDeleteKeyTransaction} message DeleteKeyTransaction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteKeyTransaction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.nonce != null && message.hasOwnProperty("nonce")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.nonce); - if (message.originator != null && message.hasOwnProperty("originator")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.originator); - if (message.curKey != null && message.hasOwnProperty("curKey")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.curKey); - return writer; - }; - - /** - * Encodes the specified DeleteKeyTransaction message, length delimited. Does not implicitly {@link DeleteKeyTransaction.verify|verify} messages. - * @function encodeDelimited - * @memberof DeleteKeyTransaction - * @static - * @param {IDeleteKeyTransaction} message DeleteKeyTransaction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteKeyTransaction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteKeyTransaction message from the specified reader or buffer. - * @function decode - * @memberof DeleteKeyTransaction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {DeleteKeyTransaction} DeleteKeyTransaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteKeyTransaction.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.DeleteKeyTransaction(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.nonce = reader.uint64(); - break; - case 2: - message.originator = reader.string(); - break; - case 3: - message.curKey = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteKeyTransaction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof DeleteKeyTransaction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {DeleteKeyTransaction} DeleteKeyTransaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteKeyTransaction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteKeyTransaction message. - * @function verify - * @memberof DeleteKeyTransaction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteKeyTransaction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.nonce != null && message.hasOwnProperty("nonce")) - if (!$util.isInteger(message.nonce) && !(message.nonce && $util.isInteger(message.nonce.low) && $util.isInteger(message.nonce.high))) - return "nonce: integer|Long expected"; - if (message.originator != null && message.hasOwnProperty("originator")) - if (!$util.isString(message.originator)) - return "originator: string expected"; - if (message.curKey != null && message.hasOwnProperty("curKey")) - if (!(message.curKey && typeof message.curKey.length === "number" || $util.isString(message.curKey))) - return "curKey: buffer expected"; - return null; - }; - - /** - * Creates a DeleteKeyTransaction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof DeleteKeyTransaction - * @static - * @param {Object.} object Plain object - * @returns {DeleteKeyTransaction} DeleteKeyTransaction - */ - DeleteKeyTransaction.fromObject = function fromObject(object) { - if (object instanceof $root.DeleteKeyTransaction) - return object; - var message = new $root.DeleteKeyTransaction(); - if (object.nonce != null) - if ($util.Long) - (message.nonce = $util.Long.fromValue(object.nonce)).unsigned = true; - else if (typeof object.nonce === "string") - message.nonce = parseInt(object.nonce, 10); - else if (typeof object.nonce === "number") - message.nonce = object.nonce; - else if (typeof object.nonce === "object") - message.nonce = new $util.LongBits(object.nonce.low >>> 0, object.nonce.high >>> 0).toNumber(true); - if (object.originator != null) - message.originator = String(object.originator); - if (object.curKey != null) - if (typeof object.curKey === "string") - $util.base64.decode(object.curKey, message.curKey = $util.newBuffer($util.base64.length(object.curKey)), 0); - else if (object.curKey.length) - message.curKey = object.curKey; - return message; - }; - - /** - * Creates a plain object from a DeleteKeyTransaction message. Also converts values to other types if specified. - * @function toObject - * @memberof DeleteKeyTransaction - * @static - * @param {DeleteKeyTransaction} message DeleteKeyTransaction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteKeyTransaction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.nonce = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.nonce = options.longs === String ? "0" : 0; - object.originator = ""; - if (options.bytes === String) - object.curKey = ""; - else { - object.curKey = []; - if (options.bytes !== Array) - object.curKey = $util.newBuffer(object.curKey); - } - } - if (message.nonce != null && message.hasOwnProperty("nonce")) - if (typeof message.nonce === "number") - object.nonce = options.longs === String ? String(message.nonce) : message.nonce; - else - object.nonce = options.longs === String ? $util.Long.prototype.toString.call(message.nonce) : options.longs === Number ? new $util.LongBits(message.nonce.low >>> 0, message.nonce.high >>> 0).toNumber(true) : message.nonce; - if (message.originator != null && message.hasOwnProperty("originator")) - object.originator = message.originator; - if (message.curKey != null && message.hasOwnProperty("curKey")) - object.curKey = options.bytes === String ? $util.base64.encode(message.curKey, 0, message.curKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.curKey) : message.curKey; - return object; - }; - - /** - * Converts this DeleteKeyTransaction to JSON. - * @function toJSON - * @memberof DeleteKeyTransaction - * @instance - * @returns {Object.} JSON object - */ - DeleteKeyTransaction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return DeleteKeyTransaction; -})(); - -$root.DeleteAccountTransaction = (function() { - - /** - * Properties of a DeleteAccountTransaction. - * @exports IDeleteAccountTransaction - * @interface IDeleteAccountTransaction - * @property {number|Long|null} [nonce] DeleteAccountTransaction nonce - * @property {string|null} [originatorId] DeleteAccountTransaction originatorId - * @property {string|null} [receiverId] DeleteAccountTransaction receiverId - */ - - /** - * Constructs a new DeleteAccountTransaction. - * @exports DeleteAccountTransaction - * @classdesc Represents a DeleteAccountTransaction. - * @implements IDeleteAccountTransaction - * @constructor - * @param {IDeleteAccountTransaction=} [properties] Properties to set - */ - function DeleteAccountTransaction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteAccountTransaction nonce. - * @member {number|Long} nonce - * @memberof DeleteAccountTransaction - * @instance - */ - DeleteAccountTransaction.prototype.nonce = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * DeleteAccountTransaction originatorId. - * @member {string} originatorId - * @memberof DeleteAccountTransaction - * @instance - */ - DeleteAccountTransaction.prototype.originatorId = ""; - - /** - * DeleteAccountTransaction receiverId. - * @member {string} receiverId - * @memberof DeleteAccountTransaction - * @instance - */ - DeleteAccountTransaction.prototype.receiverId = ""; - - /** - * Creates a new DeleteAccountTransaction instance using the specified properties. - * @function create - * @memberof DeleteAccountTransaction - * @static - * @param {IDeleteAccountTransaction=} [properties] Properties to set - * @returns {DeleteAccountTransaction} DeleteAccountTransaction instance - */ - DeleteAccountTransaction.create = function create(properties) { - return new DeleteAccountTransaction(properties); - }; - - /** - * Encodes the specified DeleteAccountTransaction message. Does not implicitly {@link DeleteAccountTransaction.verify|verify} messages. - * @function encode - * @memberof DeleteAccountTransaction - * @static - * @param {IDeleteAccountTransaction} message DeleteAccountTransaction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteAccountTransaction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.nonce != null && message.hasOwnProperty("nonce")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.nonce); - if (message.originatorId != null && message.hasOwnProperty("originatorId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.originatorId); - if (message.receiverId != null && message.hasOwnProperty("receiverId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.receiverId); - return writer; - }; - - /** - * Encodes the specified DeleteAccountTransaction message, length delimited. Does not implicitly {@link DeleteAccountTransaction.verify|verify} messages. - * @function encodeDelimited - * @memberof DeleteAccountTransaction - * @static - * @param {IDeleteAccountTransaction} message DeleteAccountTransaction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteAccountTransaction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteAccountTransaction message from the specified reader or buffer. - * @function decode - * @memberof DeleteAccountTransaction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {DeleteAccountTransaction} DeleteAccountTransaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteAccountTransaction.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.DeleteAccountTransaction(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.nonce = reader.uint64(); - break; - case 2: - message.originatorId = reader.string(); - break; - case 3: - message.receiverId = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteAccountTransaction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof DeleteAccountTransaction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {DeleteAccountTransaction} DeleteAccountTransaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteAccountTransaction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteAccountTransaction message. - * @function verify - * @memberof DeleteAccountTransaction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteAccountTransaction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.nonce != null && message.hasOwnProperty("nonce")) - if (!$util.isInteger(message.nonce) && !(message.nonce && $util.isInteger(message.nonce.low) && $util.isInteger(message.nonce.high))) - return "nonce: integer|Long expected"; - if (message.originatorId != null && message.hasOwnProperty("originatorId")) - if (!$util.isString(message.originatorId)) - return "originatorId: string expected"; - if (message.receiverId != null && message.hasOwnProperty("receiverId")) - if (!$util.isString(message.receiverId)) - return "receiverId: string expected"; - return null; - }; - - /** - * Creates a DeleteAccountTransaction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof DeleteAccountTransaction - * @static - * @param {Object.} object Plain object - * @returns {DeleteAccountTransaction} DeleteAccountTransaction - */ - DeleteAccountTransaction.fromObject = function fromObject(object) { - if (object instanceof $root.DeleteAccountTransaction) - return object; - var message = new $root.DeleteAccountTransaction(); - if (object.nonce != null) - if ($util.Long) - (message.nonce = $util.Long.fromValue(object.nonce)).unsigned = true; - else if (typeof object.nonce === "string") - message.nonce = parseInt(object.nonce, 10); - else if (typeof object.nonce === "number") - message.nonce = object.nonce; - else if (typeof object.nonce === "object") - message.nonce = new $util.LongBits(object.nonce.low >>> 0, object.nonce.high >>> 0).toNumber(true); - if (object.originatorId != null) - message.originatorId = String(object.originatorId); - if (object.receiverId != null) - message.receiverId = String(object.receiverId); - return message; - }; - - /** - * Creates a plain object from a DeleteAccountTransaction message. Also converts values to other types if specified. - * @function toObject - * @memberof DeleteAccountTransaction - * @static - * @param {DeleteAccountTransaction} message DeleteAccountTransaction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteAccountTransaction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.nonce = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.nonce = options.longs === String ? "0" : 0; - object.originatorId = ""; - object.receiverId = ""; - } - if (message.nonce != null && message.hasOwnProperty("nonce")) - if (typeof message.nonce === "number") - object.nonce = options.longs === String ? String(message.nonce) : message.nonce; - else - object.nonce = options.longs === String ? $util.Long.prototype.toString.call(message.nonce) : options.longs === Number ? new $util.LongBits(message.nonce.low >>> 0, message.nonce.high >>> 0).toNumber(true) : message.nonce; - if (message.originatorId != null && message.hasOwnProperty("originatorId")) - object.originatorId = message.originatorId; - if (message.receiverId != null && message.hasOwnProperty("receiverId")) - object.receiverId = message.receiverId; - return object; - }; - - /** - * Converts this DeleteAccountTransaction to JSON. - * @function toJSON - * @memberof DeleteAccountTransaction - * @instance - * @returns {Object.} JSON object - */ - DeleteAccountTransaction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return DeleteAccountTransaction; -})(); - -$root.SignedTransaction = (function() { - - /** - * Properties of a SignedTransaction. - * @exports ISignedTransaction - * @interface ISignedTransaction - * @property {Uint8Array|null} [signature] SignedTransaction signature - * @property {google.protobuf.IBytesValue|null} [publicKey] SignedTransaction publicKey - * @property {ICreateAccountTransaction|null} [createAccount] SignedTransaction createAccount - * @property {IDeployContractTransaction|null} [deployContract] SignedTransaction deployContract - * @property {IFunctionCallTransaction|null} [functionCall] SignedTransaction functionCall - * @property {ISendMoneyTransaction|null} [sendMoney] SignedTransaction sendMoney - * @property {IStakeTransaction|null} [stake] SignedTransaction stake - * @property {ISwapKeyTransaction|null} [swapKey] SignedTransaction swapKey - * @property {IAddKeyTransaction|null} [addKey] SignedTransaction addKey - * @property {IDeleteKeyTransaction|null} [deleteKey] SignedTransaction deleteKey - * @property {IDeleteAccountTransaction|null} [deleteAccount] SignedTransaction deleteAccount - */ - - /** - * Constructs a new SignedTransaction. - * @exports SignedTransaction - * @classdesc Represents a SignedTransaction. - * @implements ISignedTransaction - * @constructor - * @param {ISignedTransaction=} [properties] Properties to set - */ - function SignedTransaction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SignedTransaction signature. - * @member {Uint8Array} signature - * @memberof SignedTransaction - * @instance - */ - SignedTransaction.prototype.signature = $util.newBuffer([]); - - /** - * SignedTransaction publicKey. - * @member {google.protobuf.IBytesValue|null|undefined} publicKey - * @memberof SignedTransaction - * @instance - */ - SignedTransaction.prototype.publicKey = null; - - /** - * SignedTransaction createAccount. - * @member {ICreateAccountTransaction|null|undefined} createAccount - * @memberof SignedTransaction - * @instance - */ - SignedTransaction.prototype.createAccount = null; - - /** - * SignedTransaction deployContract. - * @member {IDeployContractTransaction|null|undefined} deployContract - * @memberof SignedTransaction - * @instance - */ - SignedTransaction.prototype.deployContract = null; - - /** - * SignedTransaction functionCall. - * @member {IFunctionCallTransaction|null|undefined} functionCall - * @memberof SignedTransaction - * @instance - */ - SignedTransaction.prototype.functionCall = null; - - /** - * SignedTransaction sendMoney. - * @member {ISendMoneyTransaction|null|undefined} sendMoney - * @memberof SignedTransaction - * @instance - */ - SignedTransaction.prototype.sendMoney = null; - - /** - * SignedTransaction stake. - * @member {IStakeTransaction|null|undefined} stake - * @memberof SignedTransaction - * @instance - */ - SignedTransaction.prototype.stake = null; - - /** - * SignedTransaction swapKey. - * @member {ISwapKeyTransaction|null|undefined} swapKey - * @memberof SignedTransaction - * @instance - */ - SignedTransaction.prototype.swapKey = null; - - /** - * SignedTransaction addKey. - * @member {IAddKeyTransaction|null|undefined} addKey - * @memberof SignedTransaction - * @instance - */ - SignedTransaction.prototype.addKey = null; - - /** - * SignedTransaction deleteKey. - * @member {IDeleteKeyTransaction|null|undefined} deleteKey - * @memberof SignedTransaction - * @instance - */ - SignedTransaction.prototype.deleteKey = null; - - /** - * SignedTransaction deleteAccount. - * @member {IDeleteAccountTransaction|null|undefined} deleteAccount - * @memberof SignedTransaction - * @instance - */ - SignedTransaction.prototype.deleteAccount = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * SignedTransaction body. - * @member {"createAccount"|"deployContract"|"functionCall"|"sendMoney"|"stake"|"swapKey"|"addKey"|"deleteKey"|"deleteAccount"|undefined} body - * @memberof SignedTransaction - * @instance - */ - Object.defineProperty(SignedTransaction.prototype, "body", { - get: $util.oneOfGetter($oneOfFields = ["createAccount", "deployContract", "functionCall", "sendMoney", "stake", "swapKey", "addKey", "deleteKey", "deleteAccount"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new SignedTransaction instance using the specified properties. - * @function create - * @memberof SignedTransaction - * @static - * @param {ISignedTransaction=} [properties] Properties to set - * @returns {SignedTransaction} SignedTransaction instance - */ - SignedTransaction.create = function create(properties) { - return new SignedTransaction(properties); - }; - - /** - * Encodes the specified SignedTransaction message. Does not implicitly {@link SignedTransaction.verify|verify} messages. - * @function encode - * @memberof SignedTransaction - * @static - * @param {ISignedTransaction} message SignedTransaction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SignedTransaction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.signature != null && message.hasOwnProperty("signature")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.signature); - if (message.createAccount != null && message.hasOwnProperty("createAccount")) - $root.CreateAccountTransaction.encode(message.createAccount, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.deployContract != null && message.hasOwnProperty("deployContract")) - $root.DeployContractTransaction.encode(message.deployContract, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.functionCall != null && message.hasOwnProperty("functionCall")) - $root.FunctionCallTransaction.encode(message.functionCall, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.sendMoney != null && message.hasOwnProperty("sendMoney")) - $root.SendMoneyTransaction.encode(message.sendMoney, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.stake != null && message.hasOwnProperty("stake")) - $root.StakeTransaction.encode(message.stake, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.swapKey != null && message.hasOwnProperty("swapKey")) - $root.SwapKeyTransaction.encode(message.swapKey, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.addKey != null && message.hasOwnProperty("addKey")) - $root.AddKeyTransaction.encode(message.addKey, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.deleteKey != null && message.hasOwnProperty("deleteKey")) - $root.DeleteKeyTransaction.encode(message.deleteKey, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.publicKey != null && message.hasOwnProperty("publicKey")) - $root.google.protobuf.BytesValue.encode(message.publicKey, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.deleteAccount != null && message.hasOwnProperty("deleteAccount")) - $root.DeleteAccountTransaction.encode(message.deleteAccount, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SignedTransaction message, length delimited. Does not implicitly {@link SignedTransaction.verify|verify} messages. - * @function encodeDelimited - * @memberof SignedTransaction - * @static - * @param {ISignedTransaction} message SignedTransaction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SignedTransaction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SignedTransaction message from the specified reader or buffer. - * @function decode - * @memberof SignedTransaction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {SignedTransaction} SignedTransaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SignedTransaction.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.SignedTransaction(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.signature = reader.bytes(); - break; - case 10: - message.publicKey = $root.google.protobuf.BytesValue.decode(reader, reader.uint32()); - break; - case 2: - message.createAccount = $root.CreateAccountTransaction.decode(reader, reader.uint32()); - break; - case 3: - message.deployContract = $root.DeployContractTransaction.decode(reader, reader.uint32()); - break; - case 4: - message.functionCall = $root.FunctionCallTransaction.decode(reader, reader.uint32()); - break; - case 5: - message.sendMoney = $root.SendMoneyTransaction.decode(reader, reader.uint32()); - break; - case 6: - message.stake = $root.StakeTransaction.decode(reader, reader.uint32()); - break; - case 7: - message.swapKey = $root.SwapKeyTransaction.decode(reader, reader.uint32()); - break; - case 8: - message.addKey = $root.AddKeyTransaction.decode(reader, reader.uint32()); - break; - case 9: - message.deleteKey = $root.DeleteKeyTransaction.decode(reader, reader.uint32()); - break; - case 11: - message.deleteAccount = $root.DeleteAccountTransaction.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SignedTransaction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof SignedTransaction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {SignedTransaction} SignedTransaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SignedTransaction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SignedTransaction message. - * @function verify - * @memberof SignedTransaction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SignedTransaction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.signature != null && message.hasOwnProperty("signature")) - if (!(message.signature && typeof message.signature.length === "number" || $util.isString(message.signature))) - return "signature: buffer expected"; - if (message.publicKey != null && message.hasOwnProperty("publicKey")) { - var error = $root.google.protobuf.BytesValue.verify(message.publicKey); - if (error) - return "publicKey." + error; - } - if (message.createAccount != null && message.hasOwnProperty("createAccount")) { - properties.body = 1; - { - var error = $root.CreateAccountTransaction.verify(message.createAccount); - if (error) - return "createAccount." + error; - } - } - if (message.deployContract != null && message.hasOwnProperty("deployContract")) { - if (properties.body === 1) - return "body: multiple values"; - properties.body = 1; - { - var error = $root.DeployContractTransaction.verify(message.deployContract); - if (error) - return "deployContract." + error; - } - } - if (message.functionCall != null && message.hasOwnProperty("functionCall")) { - if (properties.body === 1) - return "body: multiple values"; - properties.body = 1; - { - var error = $root.FunctionCallTransaction.verify(message.functionCall); - if (error) - return "functionCall." + error; - } - } - if (message.sendMoney != null && message.hasOwnProperty("sendMoney")) { - if (properties.body === 1) - return "body: multiple values"; - properties.body = 1; - { - var error = $root.SendMoneyTransaction.verify(message.sendMoney); - if (error) - return "sendMoney." + error; - } - } - if (message.stake != null && message.hasOwnProperty("stake")) { - if (properties.body === 1) - return "body: multiple values"; - properties.body = 1; - { - var error = $root.StakeTransaction.verify(message.stake); - if (error) - return "stake." + error; - } - } - if (message.swapKey != null && message.hasOwnProperty("swapKey")) { - if (properties.body === 1) - return "body: multiple values"; - properties.body = 1; - { - var error = $root.SwapKeyTransaction.verify(message.swapKey); - if (error) - return "swapKey." + error; - } - } - if (message.addKey != null && message.hasOwnProperty("addKey")) { - if (properties.body === 1) - return "body: multiple values"; - properties.body = 1; - { - var error = $root.AddKeyTransaction.verify(message.addKey); - if (error) - return "addKey." + error; - } - } - if (message.deleteKey != null && message.hasOwnProperty("deleteKey")) { - if (properties.body === 1) - return "body: multiple values"; - properties.body = 1; - { - var error = $root.DeleteKeyTransaction.verify(message.deleteKey); - if (error) - return "deleteKey." + error; - } - } - if (message.deleteAccount != null && message.hasOwnProperty("deleteAccount")) { - if (properties.body === 1) - return "body: multiple values"; - properties.body = 1; - { - var error = $root.DeleteAccountTransaction.verify(message.deleteAccount); - if (error) - return "deleteAccount." + error; - } - } - return null; - }; - - /** - * Creates a SignedTransaction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof SignedTransaction - * @static - * @param {Object.} object Plain object - * @returns {SignedTransaction} SignedTransaction - */ - SignedTransaction.fromObject = function fromObject(object) { - if (object instanceof $root.SignedTransaction) - return object; - var message = new $root.SignedTransaction(); - if (object.signature != null) - if (typeof object.signature === "string") - $util.base64.decode(object.signature, message.signature = $util.newBuffer($util.base64.length(object.signature)), 0); - else if (object.signature.length) - message.signature = object.signature; - if (object.publicKey != null) { - if (typeof object.publicKey !== "object") - throw TypeError(".SignedTransaction.publicKey: object expected"); - message.publicKey = $root.google.protobuf.BytesValue.fromObject(object.publicKey); - } - if (object.createAccount != null) { - if (typeof object.createAccount !== "object") - throw TypeError(".SignedTransaction.createAccount: object expected"); - message.createAccount = $root.CreateAccountTransaction.fromObject(object.createAccount); - } - if (object.deployContract != null) { - if (typeof object.deployContract !== "object") - throw TypeError(".SignedTransaction.deployContract: object expected"); - message.deployContract = $root.DeployContractTransaction.fromObject(object.deployContract); - } - if (object.functionCall != null) { - if (typeof object.functionCall !== "object") - throw TypeError(".SignedTransaction.functionCall: object expected"); - message.functionCall = $root.FunctionCallTransaction.fromObject(object.functionCall); - } - if (object.sendMoney != null) { - if (typeof object.sendMoney !== "object") - throw TypeError(".SignedTransaction.sendMoney: object expected"); - message.sendMoney = $root.SendMoneyTransaction.fromObject(object.sendMoney); - } - if (object.stake != null) { - if (typeof object.stake !== "object") - throw TypeError(".SignedTransaction.stake: object expected"); - message.stake = $root.StakeTransaction.fromObject(object.stake); - } - if (object.swapKey != null) { - if (typeof object.swapKey !== "object") - throw TypeError(".SignedTransaction.swapKey: object expected"); - message.swapKey = $root.SwapKeyTransaction.fromObject(object.swapKey); - } - if (object.addKey != null) { - if (typeof object.addKey !== "object") - throw TypeError(".SignedTransaction.addKey: object expected"); - message.addKey = $root.AddKeyTransaction.fromObject(object.addKey); - } - if (object.deleteKey != null) { - if (typeof object.deleteKey !== "object") - throw TypeError(".SignedTransaction.deleteKey: object expected"); - message.deleteKey = $root.DeleteKeyTransaction.fromObject(object.deleteKey); - } - if (object.deleteAccount != null) { - if (typeof object.deleteAccount !== "object") - throw TypeError(".SignedTransaction.deleteAccount: object expected"); - message.deleteAccount = $root.DeleteAccountTransaction.fromObject(object.deleteAccount); - } - return message; - }; - - /** - * Creates a plain object from a SignedTransaction message. Also converts values to other types if specified. - * @function toObject - * @memberof SignedTransaction - * @static - * @param {SignedTransaction} message SignedTransaction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SignedTransaction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.signature = ""; - else { - object.signature = []; - if (options.bytes !== Array) - object.signature = $util.newBuffer(object.signature); - } - object.publicKey = null; - } - if (message.signature != null && message.hasOwnProperty("signature")) - object.signature = options.bytes === String ? $util.base64.encode(message.signature, 0, message.signature.length) : options.bytes === Array ? Array.prototype.slice.call(message.signature) : message.signature; - if (message.createAccount != null && message.hasOwnProperty("createAccount")) { - object.createAccount = $root.CreateAccountTransaction.toObject(message.createAccount, options); - if (options.oneofs) - object.body = "createAccount"; - } - if (message.deployContract != null && message.hasOwnProperty("deployContract")) { - object.deployContract = $root.DeployContractTransaction.toObject(message.deployContract, options); - if (options.oneofs) - object.body = "deployContract"; - } - if (message.functionCall != null && message.hasOwnProperty("functionCall")) { - object.functionCall = $root.FunctionCallTransaction.toObject(message.functionCall, options); - if (options.oneofs) - object.body = "functionCall"; - } - if (message.sendMoney != null && message.hasOwnProperty("sendMoney")) { - object.sendMoney = $root.SendMoneyTransaction.toObject(message.sendMoney, options); - if (options.oneofs) - object.body = "sendMoney"; - } - if (message.stake != null && message.hasOwnProperty("stake")) { - object.stake = $root.StakeTransaction.toObject(message.stake, options); - if (options.oneofs) - object.body = "stake"; - } - if (message.swapKey != null && message.hasOwnProperty("swapKey")) { - object.swapKey = $root.SwapKeyTransaction.toObject(message.swapKey, options); - if (options.oneofs) - object.body = "swapKey"; - } - if (message.addKey != null && message.hasOwnProperty("addKey")) { - object.addKey = $root.AddKeyTransaction.toObject(message.addKey, options); - if (options.oneofs) - object.body = "addKey"; - } - if (message.deleteKey != null && message.hasOwnProperty("deleteKey")) { - object.deleteKey = $root.DeleteKeyTransaction.toObject(message.deleteKey, options); - if (options.oneofs) - object.body = "deleteKey"; - } - if (message.publicKey != null && message.hasOwnProperty("publicKey")) - object.publicKey = $root.google.protobuf.BytesValue.toObject(message.publicKey, options); - if (message.deleteAccount != null && message.hasOwnProperty("deleteAccount")) { - object.deleteAccount = $root.DeleteAccountTransaction.toObject(message.deleteAccount, options); - if (options.oneofs) - object.body = "deleteAccount"; - } - return object; - }; - - /** - * Converts this SignedTransaction to JSON. - * @function toJSON - * @memberof SignedTransaction - * @instance - * @returns {Object.} JSON object - */ - SignedTransaction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return SignedTransaction; -})(); - -$root.google = (function() { - - /** - * Namespace google. - * @exports google - * @namespace - */ - var google = {}; - - google.protobuf = (function() { - - /** - * Namespace protobuf. - * @memberof google - * @namespace - */ - var protobuf = {}; - - protobuf.DoubleValue = (function() { - - /** - * Properties of a DoubleValue. - * @memberof google.protobuf - * @interface IDoubleValue - * @property {number|null} [value] DoubleValue value - */ - - /** - * Constructs a new DoubleValue. - * @memberof google.protobuf - * @classdesc Represents a DoubleValue. - * @implements IDoubleValue - * @constructor - * @param {google.protobuf.IDoubleValue=} [properties] Properties to set - */ - function DoubleValue(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DoubleValue value. - * @member {number} value - * @memberof google.protobuf.DoubleValue - * @instance - */ - DoubleValue.prototype.value = 0; - - /** - * Creates a new DoubleValue instance using the specified properties. - * @function create - * @memberof google.protobuf.DoubleValue - * @static - * @param {google.protobuf.IDoubleValue=} [properties] Properties to set - * @returns {google.protobuf.DoubleValue} DoubleValue instance - */ - DoubleValue.create = function create(properties) { - return new DoubleValue(properties); - }; - - /** - * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DoubleValue - * @static - * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DoubleValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && message.hasOwnProperty("value")) - writer.uint32(/* id 1, wireType 1 =*/9).double(message.value); - return writer; - }; - - /** - * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DoubleValue - * @static - * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DoubleValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DoubleValue message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DoubleValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DoubleValue} DoubleValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DoubleValue.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DoubleValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.value = reader.double(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DoubleValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DoubleValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DoubleValue} DoubleValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DoubleValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DoubleValue message. - * @function verify - * @memberof google.protobuf.DoubleValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DoubleValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value !== "number") - return "value: number expected"; - return null; - }; - - /** - * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DoubleValue - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DoubleValue} DoubleValue - */ - DoubleValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DoubleValue) - return object; - var message = new $root.google.protobuf.DoubleValue(); - if (object.value != null) - message.value = Number(object.value); - return message; - }; - - /** - * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DoubleValue - * @static - * @param {google.protobuf.DoubleValue} message DoubleValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DoubleValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = 0; - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; - return object; - }; - - /** - * Converts this DoubleValue to JSON. - * @function toJSON - * @memberof google.protobuf.DoubleValue - * @instance - * @returns {Object.} JSON object - */ - DoubleValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return DoubleValue; - })(); - - protobuf.FloatValue = (function() { - - /** - * Properties of a FloatValue. - * @memberof google.protobuf - * @interface IFloatValue - * @property {number|null} [value] FloatValue value - */ - - /** - * Constructs a new FloatValue. - * @memberof google.protobuf - * @classdesc Represents a FloatValue. - * @implements IFloatValue - * @constructor - * @param {google.protobuf.IFloatValue=} [properties] Properties to set - */ - function FloatValue(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FloatValue value. - * @member {number} value - * @memberof google.protobuf.FloatValue - * @instance - */ - FloatValue.prototype.value = 0; - - /** - * Creates a new FloatValue instance using the specified properties. - * @function create - * @memberof google.protobuf.FloatValue - * @static - * @param {google.protobuf.IFloatValue=} [properties] Properties to set - * @returns {google.protobuf.FloatValue} FloatValue instance - */ - FloatValue.create = function create(properties) { - return new FloatValue(properties); - }; - - /** - * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FloatValue - * @static - * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FloatValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && message.hasOwnProperty("value")) - writer.uint32(/* id 1, wireType 5 =*/13).float(message.value); - return writer; - }; - - /** - * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FloatValue - * @static - * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FloatValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FloatValue message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FloatValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FloatValue} FloatValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FloatValue.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FloatValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.value = reader.float(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FloatValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FloatValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FloatValue} FloatValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FloatValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FloatValue message. - * @function verify - * @memberof google.protobuf.FloatValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FloatValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value !== "number") - return "value: number expected"; - return null; - }; - - /** - * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FloatValue - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FloatValue} FloatValue - */ - FloatValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FloatValue) - return object; - var message = new $root.google.protobuf.FloatValue(); - if (object.value != null) - message.value = Number(object.value); - return message; - }; - - /** - * Creates a plain object from a FloatValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FloatValue - * @static - * @param {google.protobuf.FloatValue} message FloatValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FloatValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = 0; - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; - return object; - }; - - /** - * Converts this FloatValue to JSON. - * @function toJSON - * @memberof google.protobuf.FloatValue - * @instance - * @returns {Object.} JSON object - */ - FloatValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return FloatValue; - })(); - - protobuf.Int64Value = (function() { - - /** - * Properties of an Int64Value. - * @memberof google.protobuf - * @interface IInt64Value - * @property {number|Long|null} [value] Int64Value value - */ - - /** - * Constructs a new Int64Value. - * @memberof google.protobuf - * @classdesc Represents an Int64Value. - * @implements IInt64Value - * @constructor - * @param {google.protobuf.IInt64Value=} [properties] Properties to set - */ - function Int64Value(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Int64Value value. - * @member {number|Long} value - * @memberof google.protobuf.Int64Value - * @instance - */ - Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Creates a new Int64Value instance using the specified properties. - * @function create - * @memberof google.protobuf.Int64Value - * @static - * @param {google.protobuf.IInt64Value=} [properties] Properties to set - * @returns {google.protobuf.Int64Value} Int64Value instance - */ - Int64Value.create = function create(properties) { - return new Int64Value(properties); - }; - - /** - * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Int64Value - * @static - * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Int64Value.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && message.hasOwnProperty("value")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.value); - return writer; - }; - - /** - * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Int64Value - * @static - * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Int64Value.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Int64Value message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Int64Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Int64Value} Int64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Int64Value.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int64Value(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.value = reader.int64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Int64Value message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Int64Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Int64Value} Int64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Int64Value.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Int64Value message. - * @function verify - * @memberof google.protobuf.Int64Value - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Int64Value.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) - return "value: integer|Long expected"; - return null; - }; - - /** - * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Int64Value - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Int64Value} Int64Value - */ - Int64Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Int64Value) - return object; - var message = new $root.google.protobuf.Int64Value(); - if (object.value != null) - if ($util.Long) - (message.value = $util.Long.fromValue(object.value)).unsigned = false; - else if (typeof object.value === "string") - message.value = parseInt(object.value, 10); - else if (typeof object.value === "number") - message.value = object.value; - else if (typeof object.value === "object") - message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from an Int64Value message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Int64Value - * @static - * @param {google.protobuf.Int64Value} message Int64Value - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Int64Value.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.value = options.longs === String ? "0" : 0; - if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value === "number") - object.value = options.longs === String ? String(message.value) : message.value; - else - object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber() : message.value; - return object; - }; - - /** - * Converts this Int64Value to JSON. - * @function toJSON - * @memberof google.protobuf.Int64Value - * @instance - * @returns {Object.} JSON object - */ - Int64Value.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Int64Value; - })(); - - protobuf.UInt64Value = (function() { - - /** - * Properties of a UInt64Value. - * @memberof google.protobuf - * @interface IUInt64Value - * @property {number|Long|null} [value] UInt64Value value - */ - - /** - * Constructs a new UInt64Value. - * @memberof google.protobuf - * @classdesc Represents a UInt64Value. - * @implements IUInt64Value - * @constructor - * @param {google.protobuf.IUInt64Value=} [properties] Properties to set - */ - function UInt64Value(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UInt64Value value. - * @member {number|Long} value - * @memberof google.protobuf.UInt64Value - * @instance - */ - UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Creates a new UInt64Value instance using the specified properties. - * @function create - * @memberof google.protobuf.UInt64Value - * @static - * @param {google.protobuf.IUInt64Value=} [properties] Properties to set - * @returns {google.protobuf.UInt64Value} UInt64Value instance - */ - UInt64Value.create = function create(properties) { - return new UInt64Value(properties); - }; - - /** - * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UInt64Value - * @static - * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UInt64Value.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && message.hasOwnProperty("value")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.value); - return writer; - }; - - /** - * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UInt64Value - * @static - * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UInt64Value.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a UInt64Value message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UInt64Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UInt64Value} UInt64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UInt64Value.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt64Value(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.value = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a UInt64Value message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UInt64Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UInt64Value} UInt64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UInt64Value.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a UInt64Value message. - * @function verify - * @memberof google.protobuf.UInt64Value - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UInt64Value.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) - return "value: integer|Long expected"; - return null; - }; - - /** - * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UInt64Value - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UInt64Value} UInt64Value - */ - UInt64Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UInt64Value) - return object; - var message = new $root.google.protobuf.UInt64Value(); - if (object.value != null) - if ($util.Long) - (message.value = $util.Long.fromValue(object.value)).unsigned = true; - else if (typeof object.value === "string") - message.value = parseInt(object.value, 10); - else if (typeof object.value === "number") - message.value = object.value; - else if (typeof object.value === "object") - message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UInt64Value - * @static - * @param {google.protobuf.UInt64Value} message UInt64Value - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UInt64Value.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.value = options.longs === String ? "0" : 0; - if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value === "number") - object.value = options.longs === String ? String(message.value) : message.value; - else - object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber(true) : message.value; - return object; - }; - - /** - * Converts this UInt64Value to JSON. - * @function toJSON - * @memberof google.protobuf.UInt64Value - * @instance - * @returns {Object.} JSON object - */ - UInt64Value.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return UInt64Value; - })(); - - protobuf.Int32Value = (function() { - - /** - * Properties of an Int32Value. - * @memberof google.protobuf - * @interface IInt32Value - * @property {number|null} [value] Int32Value value - */ - - /** - * Constructs a new Int32Value. - * @memberof google.protobuf - * @classdesc Represents an Int32Value. - * @implements IInt32Value - * @constructor - * @param {google.protobuf.IInt32Value=} [properties] Properties to set - */ - function Int32Value(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Int32Value value. - * @member {number} value - * @memberof google.protobuf.Int32Value - * @instance - */ - Int32Value.prototype.value = 0; - - /** - * Creates a new Int32Value instance using the specified properties. - * @function create - * @memberof google.protobuf.Int32Value - * @static - * @param {google.protobuf.IInt32Value=} [properties] Properties to set - * @returns {google.protobuf.Int32Value} Int32Value instance - */ - Int32Value.create = function create(properties) { - return new Int32Value(properties); - }; - - /** - * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Int32Value - * @static - * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Int32Value.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && message.hasOwnProperty("value")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.value); - return writer; - }; - - /** - * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Int32Value - * @static - * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Int32Value.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Int32Value message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Int32Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Int32Value} Int32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Int32Value.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int32Value(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.value = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Int32Value message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Int32Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Int32Value} Int32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Int32Value.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Int32Value message. - * @function verify - * @memberof google.protobuf.Int32Value - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Int32Value.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isInteger(message.value)) - return "value: integer expected"; - return null; - }; - - /** - * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Int32Value - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Int32Value} Int32Value - */ - Int32Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Int32Value) - return object; - var message = new $root.google.protobuf.Int32Value(); - if (object.value != null) - message.value = object.value | 0; - return message; - }; - - /** - * Creates a plain object from an Int32Value message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Int32Value - * @static - * @param {google.protobuf.Int32Value} message Int32Value - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Int32Value.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = 0; - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - return object; - }; - - /** - * Converts this Int32Value to JSON. - * @function toJSON - * @memberof google.protobuf.Int32Value - * @instance - * @returns {Object.} JSON object - */ - Int32Value.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Int32Value; - })(); - - protobuf.UInt32Value = (function() { - - /** - * Properties of a UInt32Value. - * @memberof google.protobuf - * @interface IUInt32Value - * @property {number|null} [value] UInt32Value value - */ - - /** - * Constructs a new UInt32Value. - * @memberof google.protobuf - * @classdesc Represents a UInt32Value. - * @implements IUInt32Value - * @constructor - * @param {google.protobuf.IUInt32Value=} [properties] Properties to set - */ - function UInt32Value(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UInt32Value value. - * @member {number} value - * @memberof google.protobuf.UInt32Value - * @instance - */ - UInt32Value.prototype.value = 0; - - /** - * Creates a new UInt32Value instance using the specified properties. - * @function create - * @memberof google.protobuf.UInt32Value - * @static - * @param {google.protobuf.IUInt32Value=} [properties] Properties to set - * @returns {google.protobuf.UInt32Value} UInt32Value instance - */ - UInt32Value.create = function create(properties) { - return new UInt32Value(properties); - }; - - /** - * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UInt32Value - * @static - * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UInt32Value.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && message.hasOwnProperty("value")) - writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.value); - return writer; - }; - - /** - * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UInt32Value - * @static - * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UInt32Value.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a UInt32Value message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UInt32Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UInt32Value} UInt32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UInt32Value.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt32Value(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.value = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a UInt32Value message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UInt32Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UInt32Value} UInt32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UInt32Value.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a UInt32Value message. - * @function verify - * @memberof google.protobuf.UInt32Value - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UInt32Value.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isInteger(message.value)) - return "value: integer expected"; - return null; - }; - - /** - * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UInt32Value - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UInt32Value} UInt32Value - */ - UInt32Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UInt32Value) - return object; - var message = new $root.google.protobuf.UInt32Value(); - if (object.value != null) - message.value = object.value >>> 0; - return message; - }; - - /** - * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UInt32Value - * @static - * @param {google.protobuf.UInt32Value} message UInt32Value - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UInt32Value.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = 0; - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - return object; - }; - - /** - * Converts this UInt32Value to JSON. - * @function toJSON - * @memberof google.protobuf.UInt32Value - * @instance - * @returns {Object.} JSON object - */ - UInt32Value.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return UInt32Value; - })(); - - protobuf.BoolValue = (function() { - - /** - * Properties of a BoolValue. - * @memberof google.protobuf - * @interface IBoolValue - * @property {boolean|null} [value] BoolValue value - */ - - /** - * Constructs a new BoolValue. - * @memberof google.protobuf - * @classdesc Represents a BoolValue. - * @implements IBoolValue - * @constructor - * @param {google.protobuf.IBoolValue=} [properties] Properties to set - */ - function BoolValue(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BoolValue value. - * @member {boolean} value - * @memberof google.protobuf.BoolValue - * @instance - */ - BoolValue.prototype.value = false; - - /** - * Creates a new BoolValue instance using the specified properties. - * @function create - * @memberof google.protobuf.BoolValue - * @static - * @param {google.protobuf.IBoolValue=} [properties] Properties to set - * @returns {google.protobuf.BoolValue} BoolValue instance - */ - BoolValue.create = function create(properties) { - return new BoolValue(properties); - }; - - /** - * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. - * @function encode - * @memberof google.protobuf.BoolValue - * @static - * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BoolValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && message.hasOwnProperty("value")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.value); - return writer; - }; - - /** - * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.BoolValue - * @static - * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BoolValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BoolValue message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.BoolValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.BoolValue} BoolValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BoolValue.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BoolValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.value = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BoolValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.BoolValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.BoolValue} BoolValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BoolValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BoolValue message. - * @function verify - * @memberof google.protobuf.BoolValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BoolValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value !== "boolean") - return "value: boolean expected"; - return null; - }; - - /** - * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.BoolValue - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.BoolValue} BoolValue - */ - BoolValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.BoolValue) - return object; - var message = new $root.google.protobuf.BoolValue(); - if (object.value != null) - message.value = Boolean(object.value); - return message; - }; - - /** - * Creates a plain object from a BoolValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.BoolValue - * @static - * @param {google.protobuf.BoolValue} message BoolValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BoolValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = false; - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - return object; - }; - - /** - * Converts this BoolValue to JSON. - * @function toJSON - * @memberof google.protobuf.BoolValue - * @instance - * @returns {Object.} JSON object - */ - BoolValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return BoolValue; - })(); - - protobuf.StringValue = (function() { - - /** - * Properties of a StringValue. - * @memberof google.protobuf - * @interface IStringValue - * @property {string|null} [value] StringValue value - */ - - /** - * Constructs a new StringValue. - * @memberof google.protobuf - * @classdesc Represents a StringValue. - * @implements IStringValue - * @constructor - * @param {google.protobuf.IStringValue=} [properties] Properties to set - */ - function StringValue(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * StringValue value. - * @member {string} value - * @memberof google.protobuf.StringValue - * @instance - */ - StringValue.prototype.value = ""; - - /** - * Creates a new StringValue instance using the specified properties. - * @function create - * @memberof google.protobuf.StringValue - * @static - * @param {google.protobuf.IStringValue=} [properties] Properties to set - * @returns {google.protobuf.StringValue} StringValue instance - */ - StringValue.create = function create(properties) { - return new StringValue(properties); - }; - - /** - * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. - * @function encode - * @memberof google.protobuf.StringValue - * @static - * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StringValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && message.hasOwnProperty("value")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); - return writer; - }; - - /** - * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.StringValue - * @static - * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StringValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StringValue message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.StringValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.StringValue} StringValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StringValue.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.StringValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.value = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StringValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.StringValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.StringValue} StringValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StringValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StringValue message. - * @function verify - * @memberof google.protobuf.StringValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StringValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isString(message.value)) - return "value: string expected"; - return null; - }; - - /** - * Creates a StringValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.StringValue - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.StringValue} StringValue - */ - StringValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.StringValue) - return object; - var message = new $root.google.protobuf.StringValue(); - if (object.value != null) - message.value = String(object.value); - return message; - }; - - /** - * Creates a plain object from a StringValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.StringValue - * @static - * @param {google.protobuf.StringValue} message StringValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StringValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = ""; - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - return object; - }; - - /** - * Converts this StringValue to JSON. - * @function toJSON - * @memberof google.protobuf.StringValue - * @instance - * @returns {Object.} JSON object - */ - StringValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return StringValue; - })(); - - protobuf.BytesValue = (function() { - - /** - * Properties of a BytesValue. - * @memberof google.protobuf - * @interface IBytesValue - * @property {Uint8Array|null} [value] BytesValue value - */ - - /** - * Constructs a new BytesValue. - * @memberof google.protobuf - * @classdesc Represents a BytesValue. - * @implements IBytesValue - * @constructor - * @param {google.protobuf.IBytesValue=} [properties] Properties to set - */ - function BytesValue(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BytesValue value. - * @member {Uint8Array} value - * @memberof google.protobuf.BytesValue - * @instance - */ - BytesValue.prototype.value = $util.newBuffer([]); - - /** - * Creates a new BytesValue instance using the specified properties. - * @function create - * @memberof google.protobuf.BytesValue - * @static - * @param {google.protobuf.IBytesValue=} [properties] Properties to set - * @returns {google.protobuf.BytesValue} BytesValue instance - */ - BytesValue.create = function create(properties) { - return new BytesValue(properties); - }; - - /** - * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. - * @function encode - * @memberof google.protobuf.BytesValue - * @static - * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BytesValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && message.hasOwnProperty("value")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.value); - return writer; - }; - - /** - * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.BytesValue - * @static - * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BytesValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BytesValue message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.BytesValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.BytesValue} BytesValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BytesValue.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BytesValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.value = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BytesValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.BytesValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.BytesValue} BytesValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BytesValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BytesValue message. - * @function verify - * @memberof google.protobuf.BytesValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BytesValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) - return "value: buffer expected"; - return null; - }; - - /** - * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.BytesValue - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.BytesValue} BytesValue - */ - BytesValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.BytesValue) - return object; - var message = new $root.google.protobuf.BytesValue(); - if (object.value != null) - if (typeof object.value === "string") - $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); - else if (object.value.length) - message.value = object.value; - return message; - }; - - /** - * Creates a plain object from a BytesValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.BytesValue - * @static - * @param {google.protobuf.BytesValue} message BytesValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BytesValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if (options.bytes === String) - object.value = ""; - else { - object.value = []; - if (options.bytes !== Array) - object.value = $util.newBuffer(object.value); - } - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; - return object; - }; - - /** - * Converts this BytesValue to JSON. - * @function toJSON - * @memberof google.protobuf.BytesValue - * @instance - * @returns {Object.} JSON object - */ - BytesValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return BytesValue; - })(); - - return protobuf; - })(); - - return google; -})(); - -$root.AccessKey = (function() { - - /** - * Properties of an AccessKey. - * @exports IAccessKey - * @interface IAccessKey - * @property {IUint128|null} [amount] AccessKey amount - * @property {google.protobuf.IStringValue|null} [balanceOwner] AccessKey balanceOwner - * @property {google.protobuf.IStringValue|null} [contractId] AccessKey contractId - * @property {google.protobuf.IBytesValue|null} [methodName] AccessKey methodName - */ - - /** - * Constructs a new AccessKey. - * @exports AccessKey - * @classdesc Represents an AccessKey. - * @implements IAccessKey - * @constructor - * @param {IAccessKey=} [properties] Properties to set - */ - function AccessKey(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AccessKey amount. - * @member {IUint128|null|undefined} amount - * @memberof AccessKey - * @instance - */ - AccessKey.prototype.amount = null; - - /** - * AccessKey balanceOwner. - * @member {google.protobuf.IStringValue|null|undefined} balanceOwner - * @memberof AccessKey - * @instance - */ - AccessKey.prototype.balanceOwner = null; - - /** - * AccessKey contractId. - * @member {google.protobuf.IStringValue|null|undefined} contractId - * @memberof AccessKey - * @instance - */ - AccessKey.prototype.contractId = null; - - /** - * AccessKey methodName. - * @member {google.protobuf.IBytesValue|null|undefined} methodName - * @memberof AccessKey - * @instance - */ - AccessKey.prototype.methodName = null; - - /** - * Creates a new AccessKey instance using the specified properties. - * @function create - * @memberof AccessKey - * @static - * @param {IAccessKey=} [properties] Properties to set - * @returns {AccessKey} AccessKey instance - */ - AccessKey.create = function create(properties) { - return new AccessKey(properties); - }; - - /** - * Encodes the specified AccessKey message. Does not implicitly {@link AccessKey.verify|verify} messages. - * @function encode - * @memberof AccessKey - * @static - * @param {IAccessKey} message AccessKey message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AccessKey.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.amount != null && message.hasOwnProperty("amount")) - $root.Uint128.encode(message.amount, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.balanceOwner != null && message.hasOwnProperty("balanceOwner")) - $root.google.protobuf.StringValue.encode(message.balanceOwner, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.contractId != null && message.hasOwnProperty("contractId")) - $root.google.protobuf.StringValue.encode(message.contractId, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.methodName != null && message.hasOwnProperty("methodName")) - $root.google.protobuf.BytesValue.encode(message.methodName, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified AccessKey message, length delimited. Does not implicitly {@link AccessKey.verify|verify} messages. - * @function encodeDelimited - * @memberof AccessKey - * @static - * @param {IAccessKey} message AccessKey message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AccessKey.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AccessKey message from the specified reader or buffer. - * @function decode - * @memberof AccessKey - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {AccessKey} AccessKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AccessKey.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.AccessKey(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.amount = $root.Uint128.decode(reader, reader.uint32()); - break; - case 2: - message.balanceOwner = $root.google.protobuf.StringValue.decode(reader, reader.uint32()); - break; - case 3: - message.contractId = $root.google.protobuf.StringValue.decode(reader, reader.uint32()); - break; - case 4: - message.methodName = $root.google.protobuf.BytesValue.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AccessKey message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof AccessKey - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {AccessKey} AccessKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AccessKey.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AccessKey message. - * @function verify - * @memberof AccessKey - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AccessKey.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.amount != null && message.hasOwnProperty("amount")) { - var error = $root.Uint128.verify(message.amount); - if (error) - return "amount." + error; - } - if (message.balanceOwner != null && message.hasOwnProperty("balanceOwner")) { - var error = $root.google.protobuf.StringValue.verify(message.balanceOwner); - if (error) - return "balanceOwner." + error; - } - if (message.contractId != null && message.hasOwnProperty("contractId")) { - var error = $root.google.protobuf.StringValue.verify(message.contractId); - if (error) - return "contractId." + error; - } - if (message.methodName != null && message.hasOwnProperty("methodName")) { - var error = $root.google.protobuf.BytesValue.verify(message.methodName); - if (error) - return "methodName." + error; - } - return null; - }; - - /** - * Creates an AccessKey message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof AccessKey - * @static - * @param {Object.} object Plain object - * @returns {AccessKey} AccessKey - */ - AccessKey.fromObject = function fromObject(object) { - if (object instanceof $root.AccessKey) - return object; - var message = new $root.AccessKey(); - if (object.amount != null) { - if (typeof object.amount !== "object") - throw TypeError(".AccessKey.amount: object expected"); - message.amount = $root.Uint128.fromObject(object.amount); - } - if (object.balanceOwner != null) { - if (typeof object.balanceOwner !== "object") - throw TypeError(".AccessKey.balanceOwner: object expected"); - message.balanceOwner = $root.google.protobuf.StringValue.fromObject(object.balanceOwner); - } - if (object.contractId != null) { - if (typeof object.contractId !== "object") - throw TypeError(".AccessKey.contractId: object expected"); - message.contractId = $root.google.protobuf.StringValue.fromObject(object.contractId); - } - if (object.methodName != null) { - if (typeof object.methodName !== "object") - throw TypeError(".AccessKey.methodName: object expected"); - message.methodName = $root.google.protobuf.BytesValue.fromObject(object.methodName); - } - return message; - }; - - /** - * Creates a plain object from an AccessKey message. Also converts values to other types if specified. - * @function toObject - * @memberof AccessKey - * @static - * @param {AccessKey} message AccessKey - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AccessKey.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.amount = null; - object.balanceOwner = null; - object.contractId = null; - object.methodName = null; - } - if (message.amount != null && message.hasOwnProperty("amount")) - object.amount = $root.Uint128.toObject(message.amount, options); - if (message.balanceOwner != null && message.hasOwnProperty("balanceOwner")) - object.balanceOwner = $root.google.protobuf.StringValue.toObject(message.balanceOwner, options); - if (message.contractId != null && message.hasOwnProperty("contractId")) - object.contractId = $root.google.protobuf.StringValue.toObject(message.contractId, options); - if (message.methodName != null && message.hasOwnProperty("methodName")) - object.methodName = $root.google.protobuf.BytesValue.toObject(message.methodName, options); - return object; - }; - - /** - * Converts this AccessKey to JSON. - * @function toJSON - * @memberof AccessKey - * @instance - * @returns {Object.} JSON object - */ - AccessKey.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return AccessKey; -})(); - -$root.Uint128 = (function() { - - /** - * Properties of an Uint128. - * @exports IUint128 - * @interface IUint128 - * @property {Uint8Array|null} [number] Uint128 number - */ - - /** - * Constructs a new Uint128. - * @exports Uint128 - * @classdesc Provides container for unsigned 128 bit integers. - * @implements IUint128 - * @constructor - * @param {IUint128=} [properties] Properties to set - */ - function Uint128(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Uint128 number. - * @member {Uint8Array} number - * @memberof Uint128 - * @instance - */ - Uint128.prototype.number = $util.newBuffer([]); - - /** - * Creates a new Uint128 instance using the specified properties. - * @function create - * @memberof Uint128 - * @static - * @param {IUint128=} [properties] Properties to set - * @returns {Uint128} Uint128 instance - */ - Uint128.create = function create(properties) { - return new Uint128(properties); - }; - - /** - * Encodes the specified Uint128 message. Does not implicitly {@link Uint128.verify|verify} messages. - * @function encode - * @memberof Uint128 - * @static - * @param {IUint128} message Uint128 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Uint128.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.number != null && message.hasOwnProperty("number")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.number); - return writer; - }; - - /** - * Encodes the specified Uint128 message, length delimited. Does not implicitly {@link Uint128.verify|verify} messages. - * @function encodeDelimited - * @memberof Uint128 - * @static - * @param {IUint128} message Uint128 message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Uint128.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Uint128 message from the specified reader or buffer. - * @function decode - * @memberof Uint128 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {Uint128} Uint128 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Uint128.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Uint128(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.number = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Uint128 message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof Uint128 - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {Uint128} Uint128 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Uint128.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Uint128 message. - * @function verify - * @memberof Uint128 - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Uint128.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!(message.number && typeof message.number.length === "number" || $util.isString(message.number))) - return "number: buffer expected"; - return null; - }; - - /** - * Creates an Uint128 message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof Uint128 - * @static - * @param {Object.} object Plain object - * @returns {Uint128} Uint128 - */ - Uint128.fromObject = function fromObject(object) { - if (object instanceof $root.Uint128) - return object; - var message = new $root.Uint128(); - if (object.number != null) - if (typeof object.number === "string") - $util.base64.decode(object.number, message.number = $util.newBuffer($util.base64.length(object.number)), 0); - else if (object.number.length) - message.number = object.number; - return message; - }; - - /** - * Creates a plain object from an Uint128 message. Also converts values to other types if specified. - * @function toObject - * @memberof Uint128 - * @static - * @param {Uint128} message Uint128 - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Uint128.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if (options.bytes === String) - object.number = ""; - else { - object.number = []; - if (options.bytes !== Array) - object.number = $util.newBuffer(object.number); - } - if (message.number != null && message.hasOwnProperty("number")) - object.number = options.bytes === String ? $util.base64.encode(message.number, 0, message.number.length) : options.bytes === Array ? Array.prototype.slice.call(message.number) : message.number; - return object; - }; - - /** - * Converts this Uint128 to JSON. - * @function toJSON - * @memberof Uint128 - * @instance - * @returns {Object.} JSON object - */ - Uint128.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Uint128; -})(); - -module.exports = $root; diff --git a/lib/providers/json-rpc-provider.d.ts b/lib/providers/json-rpc-provider.d.ts index e6ad34a09a..cf42d0b764 100644 --- a/lib/providers/json-rpc-provider.d.ts +++ b/lib/providers/json-rpc-provider.d.ts @@ -1,7 +1,7 @@ import { Provider, FinalTransactionResult, NodeStatusResult, BlockResult } from './provider'; import { Network } from '../utils/network'; import { ConnectionInfo } from '../utils/web'; -import { SignedTransaction } from '../protos'; +import { SignedTransaction } from '../transaction'; export declare class JsonRpcProvider extends Provider { readonly connection: ConnectionInfo; constructor(url?: string, network?: Network); diff --git a/lib/providers/json-rpc-provider.js b/lib/providers/json-rpc-provider.js index 263c0266a7..3177c77062 100644 --- a/lib/providers/json-rpc-provider.js +++ b/lib/providers/json-rpc-provider.js @@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true }); const provider_1 = require("./provider"); const web_1 = require("../utils/web"); const serialize_1 = require("../utils/serialize"); -const protos_1 = require("../protos"); /// Keep ids unique across all connections. let _nextId = 123; class JsonRpcProvider extends provider_1.Provider { @@ -22,7 +21,7 @@ class JsonRpcProvider extends provider_1.Provider { return this.sendJsonRpc('status', []); } async sendTransaction(signedTransaction) { - const bytes = protos_1.SignedTransaction.encode(signedTransaction).finish(); + const bytes = signedTransaction.encode(); return this.sendJsonRpc('broadcast_tx_commit', [Buffer.from(bytes).toString('base64')]); } async txStatus(txHash) { diff --git a/lib/providers/provider.d.ts b/lib/providers/provider.d.ts index 863b78062e..55d093d1f9 100644 --- a/lib/providers/provider.d.ts +++ b/lib/providers/provider.d.ts @@ -1,5 +1,5 @@ import { Network } from '../utils/network'; -import { SignedTransaction } from '../protos'; +import { SignedTransaction } from '../transaction'; export interface SyncInfo { latest_block_hash: string; latest_block_height: number; @@ -21,13 +21,17 @@ export declare enum FinalTransactionStatus { } export interface TransactionLog { hash: string; - lines: string[]; - receipts: number[][]; - result?: Uint8Array; + result: TransactionResult; +} +export interface TransactionResult { + status: string; + logs: string[]; + receipts: string[]; + result?: string; } export interface FinalTransactionResult { status: FinalTransactionStatus; - logs: TransactionLog[]; + transactions: TransactionLog[]; } export interface TotalWeight { num: number; diff --git a/lib/providers/provider.js b/lib/providers/provider.js index 0fa6df1a93..3e6d6bf31f 100644 --- a/lib/providers/provider.js +++ b/lib/providers/provider.js @@ -11,10 +11,10 @@ class Provider { } exports.Provider = Provider; function getTransactionLastResult(txResult) { - for (let i = txResult.logs.length - 1; i >= 0; --i) { - const r = txResult.logs[i]; - if (r.result && r.result.length > 0) { - return JSON.parse(Buffer.from(r.result).toString()); + for (let i = txResult.transactions.length - 1; i >= 0; --i) { + const r = txResult.transactions[i]; + if (r.result && r.result.result && r.result.result.length > 0) { + return JSON.parse(Buffer.from(r.result.result, 'base64').toString()); } } return null; diff --git a/lib/signer.d.ts b/lib/signer.d.ts index 318e0459e5..623e039d27 100644 --- a/lib/signer.d.ts +++ b/lib/signer.d.ts @@ -1,4 +1,4 @@ -import { Signature } from './utils/key_pair'; +import { Signature, PublicKey } from './utils/key_pair'; import { KeyStore } from './key_stores'; /** * General signing interface, can be used for in memory signing, RPC singing, external wallet, HSM, etc. @@ -7,13 +7,13 @@ export declare abstract class Signer { /** * Creates new key and returns public key. */ - abstract createKey(accountId: string, networkId?: string): Promise; + abstract createKey(accountId: string, networkId?: string): Promise; /** * Returns public key for given account / network. * @param accountId accountId to retrieve from. * @param networkId network for this accountId. */ - abstract getPublicKey(accountId?: string, networkId?: string): Promise; + abstract getPublicKey(accountId?: string, networkId?: string): Promise; /** * Signs given hash. * @param hash hash to sign. @@ -35,7 +35,7 @@ export declare abstract class Signer { export declare class InMemorySigner extends Signer { readonly keyStore: KeyStore; constructor(keyStore: KeyStore); - createKey(accountId: string, networkId: string): Promise; - getPublicKey(accountId?: string, networkId?: string): Promise; + createKey(accountId: string, networkId: string): Promise; + getPublicKey(accountId?: string, networkId?: string): Promise; signHash(hash: Uint8Array, accountId?: string, networkId?: string): Promise; } diff --git a/lib/transaction.d.ts b/lib/transaction.d.ts index a698ddeefa..e845459b15 100644 --- a/lib/transaction.d.ts +++ b/lib/transaction.d.ts @@ -1,17 +1,96 @@ import BN from 'bn.js'; -import { SendMoneyTransaction, CreateAccountTransaction, SignedTransaction, DeployContractTransaction, FunctionCallTransaction, StakeTransaction, SwapKeyTransaction, AddKeyTransaction, DeleteKeyTransaction, AccessKey } from './protos'; -import { Signature } from './utils/key_pair'; +import { KeyType, PublicKey } from './utils/key_pair'; import { Signer } from './signer'; -export declare type AllTransactions = SendMoneyTransaction | CreateAccountTransaction | DeployContractTransaction | FunctionCallTransaction | StakeTransaction | SwapKeyTransaction | AddKeyTransaction | DeleteKeyTransaction; -export declare function bignumHex2Dec(num: string): string; -export declare function createAccount(nonce: number, originator: string, newAccountId: string, publicKey: string, amount: BN): CreateAccountTransaction; -export declare function deployContract(nonce: number, contractId: string, wasmByteArray: Uint8Array): DeployContractTransaction; -export declare function functionCall(nonce: number, originator: string, contractId: string, methodName: string, args: Uint8Array, amount: BN): FunctionCallTransaction; -export declare function sendMoney(nonce: number, originator: string, receiver: string, amount: BN): SendMoneyTransaction; -export declare function stake(nonce: number, originator: string, amount: BN, publicKey: string): StakeTransaction; -export declare function swapKey(nonce: number, originator: string, curKey: string, newKey: string): SwapKeyTransaction; -export declare function createAccessKey(contractId?: string, methodName?: string, balanceOwner?: string, amount?: BN): AccessKey; -export declare function addKey(nonce: number, originator: string, newKey: string, accessKey: AccessKey): AddKeyTransaction; -export declare function deleteKey(nonce: number, originator: string, curKey: string): DeleteKeyTransaction; -export declare function signedTransaction(transaction: AllTransactions, signature: Signature): SignedTransaction; -export declare function signTransaction(signer: Signer, transaction: any, accountId?: string, networkId?: string): Promise<[Uint8Array, SignedTransaction]>; +declare class Enum { + enum: string; + constructor(properties: any); +} +declare class Assignable { + constructor(properties: any); +} +export declare class FunctionCallPermission extends Assignable { + allowance?: BN; + receiverId: string; + methodNames: String[]; +} +export declare class FullAccessPermission extends Assignable { +} +export declare class AccessKeyPermission extends Enum { + functionCall: FunctionCallPermission; + fullAccess: FullAccessPermission; +} +export declare class AccessKey extends Assignable { + nonce: number; + permission: AccessKeyPermission; +} +export declare function fullAccessKey(): AccessKey; +export declare function functionCallAccessKey(receiverId: string, methodNames: String[], allowance?: BN): AccessKey; +export declare class IAction extends Assignable { +} +declare class CreateAccount extends IAction { +} +declare class DeployContract extends IAction { + code: Uint8Array; +} +declare class FunctionCall extends IAction { + methodName: string; + args: Uint8Array; + gas: BN; + deposit: BN; +} +declare class Transfer extends IAction { + deposit: BN; +} +declare class Stake extends IAction { + stake: BN; + publicKey: PublicKey; +} +declare class AddKey extends IAction { + publicKey: PublicKey; + accessKey: AccessKey; +} +declare class DeleteKey extends IAction { + publicKey: PublicKey; +} +declare class DeleteAccount extends IAction { + beneficiaryId: string; +} +export declare function createAccount(): Action; +export declare function deployContract(code: Uint8Array): Action; +export declare function functionCall(methodName: string, args: Uint8Array, gas: number, deposit: BN): Action; +export declare function transfer(deposit: BN): Action; +export declare function stake(stake: BN, publicKey: PublicKey): Action; +export declare function addKey(publicKey: PublicKey, accessKey: AccessKey): Action; +export declare function deleteKey(publicKey: PublicKey): Action; +export declare function deleteAccount(beneficiaryId: string): Action; +declare class Signature { + keyType: KeyType; + data: Uint8Array; + constructor(signature: Uint8Array); +} +export declare class Transaction extends Assignable { + signerId: string; + publicKey: PublicKey; + nonce: number; + receiverId: string; + actions: Action[]; + blockHash: Uint8Array; +} +export declare class SignedTransaction extends Assignable { + transaction: Transaction; + signature: Signature; + encode(): Uint8Array; +} +export declare class Action extends Enum { + createAccount: CreateAccount; + deployContract: DeployContract; + functionCall: FunctionCall; + transfer: Transfer; + stake: Stake; + addKey: AddKey; + deleteKey: DeleteKey; + deleteAccount: DeleteAccount; +} +export declare const SCHEMA: Map; +export declare function signTransaction(receiverId: string, nonce: number, actions: Action[], blockHash: Uint8Array, signer: Signer, accountId?: string, networkId?: string): Promise<[Uint8Array, SignedTransaction]>; +export {}; diff --git a/lib/transaction.js b/lib/transaction.js index 8069bf6807..4876b6b78f 100644 --- a/lib/transaction.js +++ b/lib/transaction.js @@ -4,82 +4,195 @@ var __importDefault = (this && this.__importDefault) || function (mod) { }; Object.defineProperty(exports, "__esModule", { value: true }); const js_sha256_1 = __importDefault(require("js-sha256")); -const bn_js_1 = __importDefault(require("bn.js")); -const protos_1 = require("./protos"); const serialize_1 = require("./utils/serialize"); -const TRANSACTION_FIELD_MAP = new Map([ - [protos_1.CreateAccountTransaction, 'createAccount'], - [protos_1.DeployContractTransaction, 'deployContract'], - [protos_1.FunctionCallTransaction, 'functionCall'], - [protos_1.SendMoneyTransaction, 'sendMoney'], - [protos_1.StakeTransaction, 'stake'], - [protos_1.SwapKeyTransaction, 'swapKey'], - [protos_1.AddKeyTransaction, 'addKey'], - [protos_1.DeleteKeyTransaction, 'deleteKey'], -]); -function bigInt(num) { - const number = new Uint8Array(new bn_js_1.default(num).toArray('le', 16)); - return new protos_1.Uint128({ number }); +const key_pair_1 = require("./utils/key_pair"); +class Enum { + constructor(properties) { + if (Object.keys(properties).length !== 1) { + throw new Error('Enum can only take single value'); + } + Object.keys(properties).map((key) => { + this[key] = properties[key]; + this.enum = key; + }); + } +} +class Assignable { + constructor(properties) { + Object.keys(properties).map((key) => { + this[key] = properties[key]; + }); + } +} +class FunctionCallPermission extends Assignable { +} +exports.FunctionCallPermission = FunctionCallPermission; +class FullAccessPermission extends Assignable { +} +exports.FullAccessPermission = FullAccessPermission; +class AccessKeyPermission extends Enum { +} +exports.AccessKeyPermission = AccessKeyPermission; +class AccessKey extends Assignable { +} +exports.AccessKey = AccessKey; +function fullAccessKey() { + return new AccessKey({ nonce: 0, permission: new AccessKeyPermission({ fullAccess: new FullAccessPermission({}) }) }); +} +exports.fullAccessKey = fullAccessKey; +function functionCallAccessKey(receiverId, methodNames, allowance) { + return new AccessKey({ nonce: 0, permission: new AccessKeyPermission({ functionCall: new FunctionCallPermission({ receiverId, allowance, methodNames }) }) }); +} +exports.functionCallAccessKey = functionCallAccessKey; +class IAction extends Assignable { +} +exports.IAction = IAction; +class CreateAccount extends IAction { +} +class DeployContract extends IAction { } -function bignumHex2Dec(num) { - return new bn_js_1.default(num, 16).toString(10); +class FunctionCall extends IAction { } -exports.bignumHex2Dec = bignumHex2Dec; -function createAccount(nonce, originator, newAccountId, publicKey, amount) { - return new protos_1.CreateAccountTransaction({ nonce, originator, newAccountId, publicKey: serialize_1.base_decode(publicKey), amount: bigInt(amount) }); +class Transfer extends IAction { +} +class Stake extends IAction { +} +class AddKey extends IAction { +} +class DeleteKey extends IAction { +} +class DeleteAccount extends IAction { +} +function createAccount() { + return new Action({ createAccount: new CreateAccount({}) }); } exports.createAccount = createAccount; -function deployContract(nonce, contractId, wasmByteArray) { - return new protos_1.DeployContractTransaction({ nonce, contractId, wasmByteArray }); +function deployContract(code) { + return new Action({ deployContract: new DeployContract({ code }) }); } exports.deployContract = deployContract; -function functionCall(nonce, originator, contractId, methodName, args, amount) { - return new protos_1.FunctionCallTransaction({ nonce, originator, contractId, methodName: Buffer.from(methodName), args, amount: bigInt(amount) }); +function functionCall(methodName, args, gas, deposit) { + return new Action({ functionCall: new FunctionCall({ methodName, args, gas, deposit }) }); } exports.functionCall = functionCall; -function sendMoney(nonce, originator, receiver, amount) { - return new protos_1.SendMoneyTransaction({ nonce, originator, receiver, amount: bigInt(amount) }); +function transfer(deposit) { + return new Action({ transfer: new Transfer({ deposit }) }); } -exports.sendMoney = sendMoney; -function stake(nonce, originator, amount, publicKey) { - return new protos_1.StakeTransaction({ nonce, originator, amount: bigInt(amount), publicKey, blsPublicKey: null }); +exports.transfer = transfer; +function stake(stake, publicKey) { + return new Action({ stake: new Stake({ stake, publicKey }) }); } exports.stake = stake; -function swapKey(nonce, originator, curKey, newKey) { - return new protos_1.SwapKeyTransaction({ nonce, originator, curKey: serialize_1.base_decode(curKey), newKey: serialize_1.base_decode(newKey) }); -} -exports.swapKey = swapKey; -function createAccessKey(contractId, methodName, balanceOwner, amount) { - return new protos_1.AccessKey({ - contractId: contractId ? new protos_1.google.protobuf.StringValue({ value: contractId }) : null, - methodName: methodName ? new protos_1.google.protobuf.BytesValue({ value: Buffer.from(methodName) }) : null, - balanceOwner: balanceOwner ? new protos_1.google.protobuf.StringValue({ value: balanceOwner }) : null, - amount: bigInt(amount || new bn_js_1.default(0)), - }); -} -exports.createAccessKey = createAccessKey; -function addKey(nonce, originator, newKey, accessKey) { - return new protos_1.AddKeyTransaction({ nonce, originator, newKey: serialize_1.base_decode(newKey), accessKey }); +function addKey(publicKey, accessKey) { + return new Action({ addKey: new AddKey({ publicKey, accessKey }) }); } exports.addKey = addKey; -function deleteKey(nonce, originator, curKey) { - return new protos_1.DeleteKeyTransaction({ nonce, originator, curKey: serialize_1.base_decode(curKey) }); +function deleteKey(publicKey) { + return new Action({ deleteKey: new DeleteKey({ publicKey }) }); } exports.deleteKey = deleteKey; -function signedTransaction(transaction, signature) { - const fieldName = TRANSACTION_FIELD_MAP.get(transaction.constructor); - return new protos_1.SignedTransaction({ - signature: signature.signature, - publicKey: protos_1.google.protobuf.BytesValue.create({ value: serialize_1.base_decode(signature.publicKey) }), - [fieldName]: transaction, - }); -} -exports.signedTransaction = signedTransaction; -async function signTransaction(signer, transaction, accountId, networkId) { - const protoClass = transaction.constructor; - const message = protoClass.encode(transaction).finish(); +function deleteAccount(beneficiaryId) { + return new Action({ deleteAccount: new DeleteAccount({ beneficiaryId }) }); +} +exports.deleteAccount = deleteAccount; +class Signature { + constructor(signature) { + this.keyType = key_pair_1.KeyType.ED25519; + this.data = signature; + } +} +class Transaction extends Assignable { +} +exports.Transaction = Transaction; +class SignedTransaction extends Assignable { + encode() { + return serialize_1.serialize(exports.SCHEMA, this); + } +} +exports.SignedTransaction = SignedTransaction; +class Action extends Enum { +} +exports.Action = Action; +exports.SCHEMA = new Map([ + [Signature, { kind: 'struct', fields: [ + ['keyType', 'u8'], + ['data', [32]] + ] }], + [SignedTransaction, { kind: 'struct', fields: [ + ['transaction', Transaction], + ['signature', Signature] + ] }], + [Transaction, { kind: 'struct', fields: [ + ['signerId', 'string'], + ['publicKey', key_pair_1.PublicKey], + ['nonce', 'u64'], + ['receiverId', 'string'], + ['blockHash', [32]], + ['actions', [Action]] + ] }], + [key_pair_1.PublicKey, { kind: 'struct', fields: [ + ['keyType', 'u8'], + ['data', [32]] + ] }], + [AccessKey, { kind: 'struct', fields: [ + ['nonce', 'u64'], + ['permission', AccessKeyPermission], + ] }], + [AccessKeyPermission, { kind: 'enum', field: 'enum', values: [ + ['functionCall', FunctionCallPermission], + ['fullAccess', FullAccessPermission], + ] }], + [FunctionCallPermission, { kind: 'struct', fields: [ + ['allowance', { kind: 'option', type: 'u128' }], + ['receiverId', 'string'], + ['methodNames', ['string']], + ] }], + [FullAccessPermission, { kind: 'struct', fields: [] }], + [Action, { kind: 'enum', field: 'enum', values: [ + ['createAccount', CreateAccount], + ['deployContract', DeployContract], + ['functionCall', functionCall], + ['transfer', transfer], + ['stake', stake], + ['addKey', addKey], + ['deleteKey', deleteKey], + ['deleteAccount', deleteAccount], + ] }], + [CreateAccount, { kind: 'struct', fields: [] }], + [DeployContract, { kind: 'struct', fields: [ + ['code', ['u8']] + ] }], + [FunctionCall, { kind: 'struct', fields: [ + ['methodName', 'string'], + ['args', ['u8']], + ['gas', 'u64'], + ['deposit', 'u128'] + ] }], + [Transfer, { kind: 'struct', fields: [ + ['deposit', 'u128'] + ] }], + [Stake, { kind: 'struct', fields: [ + ['stake', 'u128'], + ['publicKey', key_pair_1.PublicKey] + ] }], + [AddKey, { kind: 'struct', fields: [ + ['publicKey', key_pair_1.PublicKey], + ['accessKey', AccessKey] + ] }], + [DeleteKey, { kind: 'struct', fields: [ + ['publicKey', key_pair_1.PublicKey] + ] }], + [DeleteAccount, { kind: 'struct', fields: [ + ['beneficiaryId', 'string'] + ] }], +]); +async function signTransaction(receiverId, nonce, actions, blockHash, signer, accountId, networkId) { + const publicKey = await signer.getPublicKey(accountId, networkId); + const transaction = new Transaction({ signerId: accountId, publicKey, nonce, receiverId, actions, blockHash }); + const message = serialize_1.serialize(exports.SCHEMA, transaction); const hash = new Uint8Array(js_sha256_1.default.sha256.array(message)); const signature = await signer.signHash(hash, accountId, networkId); - return [hash, signedTransaction(transaction, signature)]; + const signedTx = new SignedTransaction({ transaction, signature: new Signature(signature.signature) }); + return [hash, signedTx]; } exports.signTransaction = signTransaction; diff --git a/lib/utils/index.d.ts b/lib/utils/index.d.ts index a04688ce0b..ba4623633c 100644 --- a/lib/utils/index.d.ts +++ b/lib/utils/index.d.ts @@ -2,5 +2,5 @@ import * as key_pair from './key_pair'; import * as network from './network'; import * as serialize from './serialize'; import * as web from './web'; -import { KeyPair, KeyPairEd25519 } from './key_pair'; -export { key_pair, network, serialize, web, KeyPair, KeyPairEd25519 }; +import { PublicKey, KeyPair, KeyPairEd25519 } from './key_pair'; +export { key_pair, network, serialize, web, PublicKey, KeyPair, KeyPairEd25519 }; diff --git a/lib/utils/index.js b/lib/utils/index.js index e17f5098b8..7b5b56c94d 100644 --- a/lib/utils/index.js +++ b/lib/utils/index.js @@ -16,5 +16,6 @@ exports.serialize = serialize; const web = __importStar(require("./web")); exports.web = web; const key_pair_1 = require("./key_pair"); +exports.PublicKey = key_pair_1.PublicKey; exports.KeyPair = key_pair_1.KeyPair; exports.KeyPairEd25519 = key_pair_1.KeyPairEd25519; diff --git a/lib/utils/key_pair.d.ts b/lib/utils/key_pair.d.ts index b1262a7255..3b0745ead5 100644 --- a/lib/utils/key_pair.d.ts +++ b/lib/utils/key_pair.d.ts @@ -1,13 +1,28 @@ export declare type Arrayish = string | ArrayLike; export interface Signature { signature: Uint8Array; - publicKey: string; + publicKey: PublicKey; +} +/** All supported key types */ +export declare enum KeyType { + ED25519 = 0 +} +/** + * PublicKey representation that has type and bytes of the key. + */ +export declare class PublicKey { + keyType: KeyType; + data: Uint8Array; + constructor(keyType: KeyType, data: Uint8Array); + static from(value: string | PublicKey): PublicKey; + static fromString(encodedKey: string): PublicKey; + toString(): string; } export declare abstract class KeyPair { abstract sign(message: Uint8Array): Signature; abstract verify(message: Uint8Array, signature: Uint8Array): boolean; abstract toString(): string; - abstract getPublicKey(): string; + abstract getPublicKey(): PublicKey; static fromRandom(curve: string): KeyPair; static fromString(encodedKey: string): KeyPair; } @@ -16,7 +31,7 @@ export declare abstract class KeyPair { * generating key pairs, encoding key pairs, signing and verifying. */ export declare class KeyPairEd25519 extends KeyPair { - readonly publicKey: string; + readonly publicKey: PublicKey; readonly secretKey: string; /** * Construct an instance of key pair given a secret key. @@ -38,5 +53,5 @@ export declare class KeyPairEd25519 extends KeyPair { sign(message: Uint8Array): Signature; verify(message: Uint8Array, signature: Uint8Array): boolean; toString(): string; - getPublicKey(): string; + getPublicKey(): PublicKey; } diff --git a/lib/utils/key_pair.js b/lib/utils/key_pair.js index 3e2bf545b9..ea9bb75b79 100644 --- a/lib/utils/key_pair.js +++ b/lib/utils/key_pair.js @@ -5,21 +5,74 @@ var __importDefault = (this && this.__importDefault) || function (mod) { Object.defineProperty(exports, "__esModule", { value: true }); const tweetnacl_1 = __importDefault(require("tweetnacl")); const serialize_1 = require("./serialize"); +/** All supported key types */ +var KeyType; +(function (KeyType) { + KeyType[KeyType["ED25519"] = 0] = "ED25519"; +})(KeyType = exports.KeyType || (exports.KeyType = {})); +function key_type_to_str(keyType) { + switch (keyType) { + case KeyType.ED25519: return 'ed25519'; + default: throw new Error(`Unknown key type ${keyType}`); + } +} +function str_to_key_type(keyType) { + switch (keyType.toLowerCase()) { + case 'ed25519': return KeyType.ED25519; + default: throw new Error(`Unknown key type ${keyType}`); + } +} +/** + * PublicKey representation that has type and bytes of the key. + */ +class PublicKey { + constructor(keyType, data) { + this.keyType = keyType; + this.data = data; + } + static from(value) { + if (typeof value === 'string') { + return PublicKey.fromString(value); + } + return value; + } + static fromString(encodedKey) { + const parts = encodedKey.split(':'); + if (parts.length === 1) { + return new PublicKey(KeyType.ED25519, serialize_1.base_decode(parts[0])); + } + else if (parts.length === 2) { + return new PublicKey(str_to_key_type(parts[0]), serialize_1.base_decode(parts[1])); + } + else { + throw new Error('Invlaid encoded key format, must be :'); + } + } + toString() { + return `${key_type_to_str(this.keyType)}:${serialize_1.base_encode(this.data)}`; + } +} +exports.PublicKey = PublicKey; class KeyPair { static fromRandom(curve) { - switch (curve) { - case 'ed25519': return KeyPairEd25519.fromRandom(); + switch (curve.toUpperCase()) { + case 'ED25519': return KeyPairEd25519.fromRandom(); default: throw new Error(`Unknown curve ${curve}`); } } static fromString(encodedKey) { const parts = encodedKey.split(':'); - if (parts.length !== 2) { - throw new Error('Invalid encoded key format, must be :'); + if (parts.length === 1) { + return new KeyPairEd25519(parts[0]); } - switch (parts[0]) { - case 'ed25519': return new KeyPairEd25519(parts[1]); - default: throw new Error(`Unknown curve: ${parts[0]}`); + else if (parts.length === 2) { + switch (parts[0].toUpperCase()) { + case 'ED25519': return new KeyPairEd25519(parts[1]); + default: throw new Error(`Unknown curve: ${parts[0]}`); + } + } + else { + throw new Error('Invalid encoded key format, must be :'); } } } @@ -37,7 +90,7 @@ class KeyPairEd25519 extends KeyPair { constructor(secretKey) { super(); const keyPair = tweetnacl_1.default.sign.keyPair.fromSecretKey(serialize_1.base_decode(secretKey)); - this.publicKey = serialize_1.base_encode(keyPair.publicKey); + this.publicKey = new PublicKey(KeyType.ED25519, keyPair.publicKey); this.secretKey = secretKey; } /** @@ -59,7 +112,7 @@ class KeyPairEd25519 extends KeyPair { return { signature, publicKey: this.publicKey }; } verify(message, signature) { - return tweetnacl_1.default.sign.detached.verify(message, signature, serialize_1.base_decode(this.publicKey)); + return tweetnacl_1.default.sign.detached.verify(message, signature, this.publicKey.data); } toString() { return `ed25519:${this.secretKey}`; diff --git a/lib/utils/serialize.d.ts b/lib/utils/serialize.d.ts index 7c0f356196..c0fa4fc110 100644 --- a/lib/utils/serialize.d.ts +++ b/lib/utils/serialize.d.ts @@ -1,2 +1,35 @@ +/// +import BN from 'bn.js'; export declare function base_encode(value: Uint8Array | string): string; export declare function base_decode(value: string): Uint8Array; +export declare type Schema = Map; +export declare class BinaryWriter { + buf: Buffer; + length: number; + constructor(); + maybe_resize(): void; + write_u8(value: number): void; + write_u32(value: number): void; + write_u64(value: BN): void; + write_u128(value: BN): void; + private write_buffer; + write_string(str: string): void; + write_fixed_array(array: Uint8Array): void; + write_array(array: any[], fn: any): void; + toArray(): Uint8Array; +} +export declare class BinaryReader { + buf: Buffer; + offset: number; + constructor(buf: Buffer); + read_u8(): number; + read_u32(): number; + read_u64(): BN; + read_u128(): BN; + private read_buffer; + read_string(): string; + read_fixed_array(len: number): Uint8Array; + read_array(fn: any): any[]; +} +export declare function serialize(schema: Schema, obj: any): Uint8Array; +export declare function deserialize(schema: Schema, classType: any, buffer: Buffer): any; diff --git a/lib/utils/serialize.js b/lib/utils/serialize.js index d31435b140..ac38cd9f34 100644 --- a/lib/utils/serialize.js +++ b/lib/utils/serialize.js @@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) { }; Object.defineProperty(exports, "__esModule", { value: true }); const bs58_1 = __importDefault(require("bs58")); +const bn_js_1 = __importDefault(require("bn.js")); function base_encode(value) { if (typeof (value) === 'string') { value = Buffer.from(value, 'utf8'); @@ -15,3 +16,198 @@ function base_decode(value) { return bs58_1.default.decode(value); } exports.base_decode = base_decode; +const INITIAL_LENGTH = 1024; +/// Binary encoder. +class BinaryWriter { + constructor() { + this.buf = Buffer.alloc(INITIAL_LENGTH); + this.length = 0; + } + maybe_resize() { + if (this.buf.length < 16 + this.length) { + this.buf = Buffer.concat([this.buf, Buffer.alloc(INITIAL_LENGTH)]); + } + } + write_u8(value) { + this.maybe_resize(); + this.buf.writeUInt8(value, this.length); + this.length += 1; + } + write_u32(value) { + this.maybe_resize(); + this.buf.writeUInt32LE(value, this.length); + this.length += 4; + } + write_u64(value) { + this.maybe_resize(); + this.write_buffer(Buffer.from(new bn_js_1.default(value).toArray('le', 8))); + } + write_u128(value) { + this.maybe_resize(); + this.write_buffer(Buffer.from(new bn_js_1.default(value).toArray('le', 16))); + } + write_buffer(buffer) { + // Buffer.from is needed as this.buf.subarray can return plain Uint8Array in browser + this.buf = Buffer.concat([Buffer.from(this.buf.subarray(0, this.length)), buffer, Buffer.alloc(INITIAL_LENGTH)]); + this.length += buffer.length; + } + write_string(str) { + this.maybe_resize(); + const b = Buffer.from(str, 'utf8'); + this.write_u32(b.length); + this.write_buffer(b); + } + write_fixed_array(array) { + this.write_buffer(Buffer.from(array)); + } + write_array(array, fn) { + this.maybe_resize(); + this.write_u32(array.length); + for (const elem of array) { + this.maybe_resize(); + fn(elem); + } + } + toArray() { + return this.buf.subarray(0, this.length); + } +} +exports.BinaryWriter = BinaryWriter; +class BinaryReader { + constructor(buf) { + this.buf = buf; + this.offset = 0; + } + read_u8() { + const value = this.buf.readUInt8(this.offset); + this.offset += 1; + return value; + } + read_u32() { + const value = this.buf.readUInt32LE(this.offset); + this.offset += 4; + return value; + } + read_u64() { + const buf = this.read_buffer(8); + buf.reverse(); + return new bn_js_1.default(`${buf.toString('hex')}`, 16); + } + read_u128() { + const buf = this.read_buffer(16); + return new bn_js_1.default(buf); + } + read_buffer(len) { + const result = this.buf.slice(this.offset, this.offset + len); + this.offset += len; + return result; + } + read_string() { + const len = this.read_u32(); + return this.read_buffer(len).toString('utf8'); + } + read_fixed_array(len) { + return new Uint8Array(this.read_buffer(len)); + } + read_array(fn) { + const len = this.read_u32(); + const result = Array(); + for (let i = 0; i < len; ++i) { + result.push(fn()); + } + return result; + } +} +exports.BinaryReader = BinaryReader; +function serializeField(schema, value, fieldType, writer) { + if (typeof fieldType === 'string') { + writer[`write_${fieldType}`](value); + } + else if (fieldType instanceof Array) { + if (typeof fieldType[0] === 'number') { + writer.write_fixed_array(value); + } + else { + writer.write_array(value, (item) => { serializeField(schema, item, fieldType[0], writer); }); + } + } + else if (fieldType.kind !== undefined) { + switch (fieldType.kind) { + case 'option': { + if (value === null) { + writer.write_u8(0); + } + else { + writer.write_u8(1); + serializeField(schema, value, fieldType.type, writer); + } + break; + } + default: throw new Error(`FieldType ${fieldType} unrecognized`); + } + } + else { + serializeStruct(schema, value, writer); + } +} +function serializeStruct(schema, obj, writer) { + const structSchema = schema.get(obj.constructor); + if (!structSchema) { + throw new Error(`Class ${obj.constructor.name} is missing in schema`); + } + if (structSchema.kind === 'struct') { + structSchema.fields.map(([fieldName, fieldType]) => { + serializeField(schema, obj[fieldName], fieldType, writer); + }); + } + else if (structSchema.kind === 'enum') { + const name = obj[structSchema.field]; + for (let idx = 0; idx < structSchema.values.length; ++idx) { + const [fieldName, fieldType] = structSchema.values[idx]; + if (fieldName === name) { + writer.write_u8(idx); + serializeField(schema, obj[fieldName], fieldType, writer); + break; + } + } + } + else { + throw new Error(`Unexpected schema kind: ${structSchema.kind} for ${obj.constructor.name}`); + } +} +/// Serialize given object using schema of the form: +/// { class_name -> [ [field_name, field_type], .. ], .. } +function serialize(schema, obj) { + const writer = new BinaryWriter(); + serializeStruct(schema, obj, writer); + return writer.toArray(); +} +exports.serialize = serialize; +function deserializeField(schema, fieldType, reader) { + if (typeof fieldType === 'string') { + return reader[`read_${fieldType}`](); + } + else if (fieldType instanceof Array) { + if (typeof fieldType[0] === 'number') { + return reader.read_fixed_array(fieldType[0]); + } + else { + return reader.read_array(() => deserializeField(schema, fieldType[0], reader)); + } + } + else { + return deserializeStruct(schema, fieldType, reader); + } +} +function deserializeStruct(schema, classType, reader) { + const fields = schema.get(classType).fields.map(([fieldName, fieldType]) => { + return deserializeField(schema, fieldType, reader); + }); + return new classType(...fields); +} +/// Deserializes object from bytes using schema. +function deserialize(schema, classType, buffer) { + const reader = new BinaryReader(buffer); + return deserializeStruct(schema, classType, reader); +} +exports.deserialize = deserialize; diff --git a/lib/wallet-account.js b/lib/wallet-account.js index adb2ed8b68..965ffc4917 100644 --- a/lib/wallet-account.js +++ b/lib/wallet-account.js @@ -57,7 +57,7 @@ class WalletAccount { newUrl.searchParams.set('failure_url', failureUrl || currentUrl.href); newUrl.searchParams.set('app_url', currentUrl.origin); const accessKey = utils_1.KeyPair.fromRandom('ed25519'); - newUrl.searchParams.set('public_key', accessKey.getPublicKey()); + newUrl.searchParams.set('public_key', accessKey.getPublicKey().toString()); await this._keyStore.setKey(this._networkId, PENDING_ACCESS_KEY_PREFIX + accessKey.getPublicKey(), accessKey); window.location.assign(newUrl.toString()); } diff --git a/package.json b/package.json index b4d9a94bc9..5c79ed7f07 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nearlib", "description": "Javascript library to interact with NEAR blockchain", - "version": "0.12.1", + "version": "0.13.0", "repository": { "type": "git", "url": "git@:nearprotocol/nearcore.git" @@ -17,13 +17,12 @@ "http-errors": "^1.7.2", "js-sha256": "^0.9.0", "node-fetch": "^2.3.0", - "protobufjs": "^6.8.8", + "tslint": "^5.18.0", "tweetnacl": "^1.0.1", "typescript": "^3.5.1" }, "devDependencies": { "@types/bs58": "^4.0.0", - "@types/google-protobuf": "^3.2.7", "@types/http-errors": "^1.6.1", "browserify": "^16.2.3", "documentation": "^9.1.1", @@ -45,13 +44,12 @@ "keywords": [], "license": "MIT", "scripts": { - "generate-protos": "scripts/generate_js_transaction_proto.sh", "dist": "yarn browserify && yarn doc", "browserify": "browserify browser-exports.js -i node-fetch -o dist/nearlib.js && browserify browser-exports.js -i node-fetch -g uglifyify -o dist/nearlib.min.js", "prepublish": "not-in-install && (yarn build && yarn browserify) || in-install", "compile": "tsc -p ./tsconfig.json", - "dev": "yarn compile -- -w", - "build": "yarn generate-protos && yarn compile", + "dev": "yarn compile -w", + "build": "yarn compile", "pretest": "yarn build", "test": "jest test --runInBand", "lint": "eslint test && tslint -p ./tsconfig.json -t codeFrame", diff --git a/protos-utils.js b/protos-utils.js deleted file mode 100644 index 044ddd8ab6..0000000000 --- a/protos-utils.js +++ /dev/null @@ -1,14 +0,0 @@ -const protos = require('./protos'); - -const TRANSACTION_FIELD_MAP = new Map([ - [protos.CreateAccountTransaction, 'createAccount'], - [protos.DeployContractTransaction, 'deployContract'], - [protos.FunctionCallTransaction, 'functionCall'], - [protos.SendMoneyTransaction, 'sendMoney'], - [protos.StakeTransaction, 'stake'], - [protos.SwapKeyTransaction, 'swapKey'], - [protos.AddKeyTransaction, 'addKey'], - [protos.DeleteKeyTransaction, 'deleteKey'], -]); - -module.exports.getTransactionFieldName = (transactionProto) => TRANSACTION_FIELD_MAP.get(transactionProto.constructor); diff --git a/scripts/generate_js_transaction_proto.sh b/scripts/generate_js_transaction_proto.sh deleted file mode 100755 index 2f77c1e0a3..0000000000 --- a/scripts/generate_js_transaction_proto.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env bash -set -ex - -NEAR_PROTOS_DIR="${NEAR_PROTOS_DIR:-../nearcore/core/protos/protos}" -NEARLIB_DIR="$(npm prefix)" -PROTOC_GEN_TS_PATH="$(yarn bin)/protoc-gen-ts" - -pbjs -t static-module \ - -w commonjs \ - -o "${NEARLIB_DIR}/lib/protos.js" \ - ${NEAR_PROTOS_DIR}/signed_transaction.proto \ - ${NEAR_PROTOS_DIR}/wrappers.proto \ - ${NEAR_PROTOS_DIR}/uint128.proto \ - ${NEAR_PROTOS_DIR}/access_key.proto - -pbts -o "${NEARLIB_DIR}/src.ts/protos.d.ts" "${NEARLIB_DIR}/lib/protos.js" diff --git a/src.ts/account.ts b/src.ts/account.ts index bf19644bd2..7ab8b437bf 100644 --- a/src.ts/account.ts +++ b/src.ts/account.ts @@ -1,16 +1,17 @@ 'use strict'; import BN from 'bn.js'; -import { sendMoney, createAccount, signTransaction, deployContract, - addKey, functionCall, createAccessKey, deleteKey, stake } from './transaction'; +import { Action, transfer, createAccount, signTransaction, deployContract, + addKey, functionCall, fullAccessKey, functionCallAccessKey, deleteKey, stake, AccessKey } from './transaction'; import { FinalTransactionResult, FinalTransactionStatus } from './providers/provider'; import { Connection } from './connection'; -import { base_encode } from './utils/serialize'; +import {base_decode, base_encode} from './utils/serialize'; +import { PublicKey } from './utils/key_pair'; // Default amount of tokens to be send with the function calls. Used to pay for the fees // incurred while running the contract execution. The unused amount will be refunded back to // the originator. -const DEFAULT_FUNC_CALL_AMOUNT = new BN(1000000000); +const DEFAULT_FUNC_CALL_AMOUNT = 2000000; // Default number of retries before giving up on a transactioin. const TX_STATUS_RETRY_NUMBER = 10; @@ -28,10 +29,8 @@ function sleep(millis: number): Promise { export interface AccountState { account_id: string; - nonce: number; amount: string; - stake: string; - public_keys: Uint8Array[]; + staked: string; code_hash: string; } @@ -39,6 +38,7 @@ export class Account { readonly connection: Connection; readonly accountId: string; private _state: AccountState; + private _accessKey: AccessKey; private _ready: Promise; protected get ready(): Promise { @@ -51,10 +51,16 @@ export class Account { } async fetchState(): Promise { - const state = await this.connection.provider.query(`account/${this.accountId}`, ''); - this._state = state; - this._state.amount = state.amount; - this._state.stake = state.stake; + this._state = await this.connection.provider.query(`account/${this.accountId}`, ''); + try { + const publicKey = (await this.connection.signer.getPublicKey(this.accountId, this.connection.networkId)).toString(); + this._accessKey = await this.connection.provider.query(`access_key/${this.accountId}/${publicKey}`, ''); + if (this._accessKey === null) { + throw new Error(`Failed to fetch access key for '${this.accountId}' with public key ${publicKey}`); + } + } catch { + this._accessKey = null; + } } async state(): Promise { @@ -83,9 +89,17 @@ export class Account { throw new Error(`Exceeded ${TX_STATUS_RETRY_NUMBER} status check attempts for transaction ${base_encode(txHash)}.`); } - private async signAndSendTransaction(transaction: any): Promise { + private async signAndSendTransaction(receiverId: string, actions: Action[]): Promise { + await this.ready; + if (this._accessKey === null) { + throw new Error(`Can not sign transactions, initialize account with available public key in Signer.`); + } + + const status = await this.connection.provider.status(); + const [txHash, signedTx] = await signTransaction( - this.connection.signer, transaction, this.accountId, this.connection.networkId); + receiverId, ++this._accessKey.nonce, actions, base_decode(status.sync_info.latest_block_hash), this.connection.signer, this.accountId, this.connection.networkId + ); let result; try { @@ -98,18 +112,13 @@ export class Account { } } - const flatLogs = result.logs.reduce((acc, it) => acc.concat(it.lines), []); - if (transaction.hasOwnProperty('contractId')) { - this.printLogs(transaction['contractId'], flatLogs); - } else if (transaction.hasOwnProperty('originator')) { - this.printLogs(transaction['originator'], flatLogs); - } + const flatLogs = result.transactions.reduce((acc, it) => acc.concat(it.result.logs), []); + this.printLogs(signedTx.transaction.receiverId, flatLogs); if (result.status === FinalTransactionStatus.Failed) { - if (result.logs) { - console.warn(flatLogs); + if (flatLogs) { const errorMessage = flatLogs.find(it => it.startsWith('ABORT:')) || flatLogs.find(it => it.startsWith('Runtime error:')) || ''; - throw new Error(`Transaction ${result.logs[0].hash} failed. ${errorMessage}`); + throw new Error(`Transaction ${result.transactions[0].hash} failed. ${errorMessage}`); } } // TODO: if Tx is Unknown or Started. @@ -117,58 +126,50 @@ export class Account { return result; } - async createAndDeployContract(contractId: string, publicKey: string, data: Uint8Array, amount: BN): Promise { - await this.createAccount(contractId, publicKey, amount); + async createAndDeployContract(contractId: string, publicKey: string | PublicKey, data: Uint8Array, amount: BN): Promise { + const accessKey = fullAccessKey(); + await this.signAndSendTransaction(contractId, [createAccount(), transfer(amount), addKey(PublicKey.from(publicKey), accessKey), deployContract(data)]); const contractAccount = new Account(this.connection, contractId); - await contractAccount.ready; - await contractAccount.deployContract(data); return contractAccount; } - async sendMoney(receiver: string, amount: BN): Promise { - await this.ready; - this._state.nonce++; - return this.signAndSendTransaction(sendMoney(this._state.nonce, this.accountId, receiver, amount)); + async sendMoney(receiverId: string, amount: BN): Promise { + return this.signAndSendTransaction(receiverId, [transfer(amount)]); } - async createAccount(newAccountId: string, publicKey: string, amount: BN): Promise { - await this.ready; - this._state.nonce++; - return this.signAndSendTransaction(createAccount(this._state.nonce, this.accountId, newAccountId, publicKey, amount)); + async createAccount(newAccountId: string, publicKey: string | PublicKey, amount: BN): Promise { + const accessKey = fullAccessKey(); + return this.signAndSendTransaction(newAccountId, [createAccount(), transfer(amount), addKey(PublicKey.from(publicKey), accessKey)]); } async deployContract(data: Uint8Array): Promise { - await this.ready; - this._state.nonce++; - return this.signAndSendTransaction(deployContract(this._state.nonce, this.accountId, data)); + return this.signAndSendTransaction(this.accountId, [deployContract(data)]); } - async functionCall(contractId: string, methodName: string, args: any, amount?: BN): Promise { + async functionCall(contractId: string, methodName: string, args: any, gas: number, amount?: BN): Promise { if (!args) { args = {}; } - await this.ready; - this._state.nonce++; - return this.signAndSendTransaction(functionCall(this._state.nonce, this.accountId, contractId, methodName, Buffer.from(JSON.stringify(args)), amount || DEFAULT_FUNC_CALL_AMOUNT)); + return this.signAndSendTransaction(contractId, [functionCall(methodName, Buffer.from(JSON.stringify(args)), gas || DEFAULT_FUNC_CALL_AMOUNT, amount)]); } - async addKey(publicKey: string, contractId?: string, methodName?: string, balanceOwner?: string, amount?: BN): Promise { - await this.ready; - this._state.nonce++; - const accessKey = contractId ? createAccessKey(contractId, methodName, balanceOwner, amount) : null; - return this.signAndSendTransaction(addKey(this._state.nonce, this.accountId, publicKey, accessKey)); + // TODO: expand this API to support more options. + async addKey(publicKey: string | PublicKey, contractId?: string, methodName?: string, amount?: BN): Promise { + let accessKey; + if (contractId === null || contractId === undefined) { + accessKey = fullAccessKey(); + } else { + accessKey = functionCallAccessKey(contractId, !methodName ? [] : [methodName], amount); + } + return this.signAndSendTransaction(this.accountId, [addKey(PublicKey.from(publicKey), accessKey)]); } - async deleteKey(publicKey: string): Promise { - await this.ready; - this._state.nonce++; - return this.signAndSendTransaction(deleteKey(this._state.nonce, this.accountId, publicKey)); + async deleteKey(publicKey: string | PublicKey): Promise { + return this.signAndSendTransaction(this.accountId, [deleteKey(PublicKey.from(publicKey))]); } - async stake(publicKey: string, amount: BN): Promise { - await this.ready; - this._state.nonce++; - return this.signAndSendTransaction(stake(this._state.nonce, this.accountId, amount, publicKey)); + async stake(publicKey: string | PublicKey, amount: BN): Promise { + return this.signAndSendTransaction(this.accountId, [stake(amount, PublicKey.from(publicKey))]); } async viewFunction(contractId: string, methodName: string, args: any): Promise { @@ -179,15 +180,26 @@ export class Account { return JSON.parse(Buffer.from(result.result).toString()); } - async getAccountDetails(): Promise { + /// Returns array of {access_key: AccessKey, public_key: PublicKey} items. + async getAccessKeys(): Promise { const response = await this.connection.provider.query(`access_key/${this.accountId}`, ''); + return response; + } + + async getAccountDetails(): Promise { + // TODO: update the response value to return all the different keys, not just app keys. + // Also if we need this function, or getAccessKeys is good enough. + const accessKeys = await this.getAccessKeys(); const result: any = { authorizedApps: [], transactions: [] }; - Object.keys(response).forEach((key) => { - result.authorizedApps.push({ - contractId: response[key][1].contract_id, - amount: response[key][1].amount, - publicKey: base_encode(response[key][0]), - }); + accessKeys.map((item) => { + if (item.access_key.permission.FunctionCall !== undefined) { + const perm = item.access_key.permission.FunctionCall; + result.authorizedApps.push({ + contractId: perm.receiver_id, + amount: perm.allowance, + publicKey: item.public_key, + }); + } }); return result; } diff --git a/src.ts/account_creator.ts b/src.ts/account_creator.ts index 6352056623..e315a903ff 100644 --- a/src.ts/account_creator.ts +++ b/src.ts/account_creator.ts @@ -2,12 +2,13 @@ import BN from 'bn.js'; import { Connection } from './connection'; import { Account } from './account'; import { ConnectionInfo } from './utils/web'; +import { PublicKey } from './utils/key_pair'; /** * Account creator provides interface to specific implementation to acutally create account. */ export abstract class AccountCreator { - abstract async createAccount(newAccountId: string, publicKey: string): Promise; + abstract async createAccount(newAccountId: string, publicKey: PublicKey): Promise; } export class LocalAccountCreator extends AccountCreator { @@ -20,7 +21,7 @@ export class LocalAccountCreator extends AccountCreator { this.initialBalance = initialBalance; } - async createAccount(newAccountId: string, publicKey: string): Promise { + async createAccount(newAccountId: string, publicKey: PublicKey): Promise { await this.masterAccount.createAccount(newAccountId, publicKey, this.initialBalance); // TODO: check the response here for status and raise if didn't complete. } @@ -36,7 +37,7 @@ export class UrlAccountCreator extends AccountCreator { this.helperConnection = { url: helperUrl }; } - async createAccount(newAccountId: string, publicKey: string): Promise { + async createAccount(newAccountId: string, publicKey: PublicKey): Promise { // TODO: hit url to create account. } } diff --git a/src.ts/index.ts b/src.ts/index.ts index a1ddcf4986..3379115c12 100644 --- a/src.ts/index.ts +++ b/src.ts/index.ts @@ -3,6 +3,7 @@ import * as providers from './providers'; import * as utils from './utils'; import * as keyStores from './key_stores'; +import * as transactions from './transaction'; import { Account } from './account'; import * as accountCreator from './account_creator'; @@ -19,6 +20,7 @@ export { keyStores, providers, utils, + transactions, Account, Connection, diff --git a/src.ts/key_stores/in_memory_key_store.ts b/src.ts/key_stores/in_memory_key_store.ts index 55d233a9ec..7909a7e464 100644 --- a/src.ts/key_stores/in_memory_key_store.ts +++ b/src.ts/key_stores/in_memory_key_store.ts @@ -47,8 +47,8 @@ export class InMemoryKeyStore extends KeyStore { const result = new Array(); Object.keys(this.keys).forEach((key) => { const parts = key.split(':'); - if (parts[1] === networkId) { - result.push(parts[0]); + if (parts[parts.length - 1] === networkId) { + result.push(parts.slice(0, parts.length - 1).join(':')); } }); return result; diff --git a/src.ts/near.ts b/src.ts/near.ts index 819ee804d3..7e6e765c0a 100644 --- a/src.ts/near.ts +++ b/src.ts/near.ts @@ -4,7 +4,7 @@ import { Account } from './account'; import { Connection } from './connection'; import { Contract } from './contract'; import { loadJsonFile } from './key_stores/unencrypted_file_system_keystore'; -import { KeyPairEd25519 } from './utils/key_pair'; +import { KeyPair, PublicKey } from './utils/key_pair'; import { AccountCreator, LocalAccountCreator, UrlAccountCreator } from './account_creator'; import { InMemoryKeyStore, MergeKeyStore } from './key_stores'; @@ -36,7 +36,7 @@ export class Near { return account; } - async createAccount(accountId: string, publicKey: string): Promise { + async createAccount(accountId: string, publicKey: PublicKey): Promise { if (!this.accountCreator) { throw new Error('Must specify account creator, either via masterAccount or helperUrl configuration settings.'); } @@ -55,18 +55,6 @@ export class Near { return new Contract(account, contractId, options); } - /** - * Backwards compatibility method. Use `contractAccount.deployContract` or `yourAccount.createAndDeployContract` instead. - * @param contractId - * @param wasmByteArray - */ - async deployContract(contractId: string, wasmByteArray: Uint8Array): Promise { - console.warn('near.deployContract is deprecated. Use `contractAccount.deployContract` or `yourAccount.createAndDeployContract` instead.'); - const account = new Account(this.connection, contractId); - const result = await account.deployContract(wasmByteArray); - return result.logs[0].hash; - } - /** * Backwards compatibility method. Use `yourAccount.sendMoney` instead. * @param amount @@ -77,7 +65,7 @@ export class Near { console.warn('near.sendTokens is deprecated. Use `yourAccount.sendMoney` instead.'); const account = new Account(this.connection, originator); const result = await account.sendMoney(receiver, amount); - return result.logs[0].hash; + return result.transactions[0].hash; } } @@ -88,7 +76,7 @@ export async function connect(config: any): Promise { const keyFile = await loadJsonFile(config.keyPath); if (keyFile.account_id) { // TODO: Only load key if network ID matches - const keyPair = new KeyPairEd25519(keyFile.secret_key); + const keyPair = KeyPair.fromString(keyFile.secret_key); const keyPathStore = new InMemoryKeyStore(); await keyPathStore.setKey(config.networkId, keyFile.account_id, keyPair); if (!config.masterAccount) { diff --git a/src.ts/protos.d.ts b/src.ts/protos.d.ts deleted file mode 100644 index f79fc9f679..0000000000 --- a/src.ts/protos.d.ts +++ /dev/null @@ -1,2147 +0,0 @@ -import * as $protobuf from "protobufjs"; -/** Properties of a CreateAccountTransaction. */ -export interface ICreateAccountTransaction { - - /** CreateAccountTransaction nonce */ - nonce?: (number|Long|null); - - /** CreateAccountTransaction originator */ - originator?: (string|null); - - /** CreateAccountTransaction newAccountId */ - newAccountId?: (string|null); - - /** CreateAccountTransaction amount */ - amount?: (IUint128|null); - - /** CreateAccountTransaction publicKey */ - publicKey?: (Uint8Array|null); -} - -/** Represents a CreateAccountTransaction. */ -export class CreateAccountTransaction implements ICreateAccountTransaction { - - /** - * Constructs a new CreateAccountTransaction. - * @param [properties] Properties to set - */ - constructor(properties?: ICreateAccountTransaction); - - /** CreateAccountTransaction nonce. */ - public nonce: (number|Long); - - /** CreateAccountTransaction originator. */ - public originator: string; - - /** CreateAccountTransaction newAccountId. */ - public newAccountId: string; - - /** CreateAccountTransaction amount. */ - public amount?: (IUint128|null); - - /** CreateAccountTransaction publicKey. */ - public publicKey: Uint8Array; - - /** - * Creates a new CreateAccountTransaction instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateAccountTransaction instance - */ - public static create(properties?: ICreateAccountTransaction): CreateAccountTransaction; - - /** - * Encodes the specified CreateAccountTransaction message. Does not implicitly {@link CreateAccountTransaction.verify|verify} messages. - * @param message CreateAccountTransaction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ICreateAccountTransaction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateAccountTransaction message, length delimited. Does not implicitly {@link CreateAccountTransaction.verify|verify} messages. - * @param message CreateAccountTransaction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ICreateAccountTransaction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateAccountTransaction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateAccountTransaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): CreateAccountTransaction; - - /** - * Decodes a CreateAccountTransaction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateAccountTransaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): CreateAccountTransaction; - - /** - * Verifies a CreateAccountTransaction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateAccountTransaction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateAccountTransaction - */ - public static fromObject(object: { [k: string]: any }): CreateAccountTransaction; - - /** - * Creates a plain object from a CreateAccountTransaction message. Also converts values to other types if specified. - * @param message CreateAccountTransaction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: CreateAccountTransaction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateAccountTransaction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; -} - -/** Properties of a DeployContractTransaction. */ -export interface IDeployContractTransaction { - - /** DeployContractTransaction nonce */ - nonce?: (number|Long|null); - - /** DeployContractTransaction contractId */ - contractId?: (string|null); - - /** DeployContractTransaction wasmByteArray */ - wasmByteArray?: (Uint8Array|null); -} - -/** Represents a DeployContractTransaction. */ -export class DeployContractTransaction implements IDeployContractTransaction { - - /** - * Constructs a new DeployContractTransaction. - * @param [properties] Properties to set - */ - constructor(properties?: IDeployContractTransaction); - - /** DeployContractTransaction nonce. */ - public nonce: (number|Long); - - /** DeployContractTransaction contractId. */ - public contractId: string; - - /** DeployContractTransaction wasmByteArray. */ - public wasmByteArray: Uint8Array; - - /** - * Creates a new DeployContractTransaction instance using the specified properties. - * @param [properties] Properties to set - * @returns DeployContractTransaction instance - */ - public static create(properties?: IDeployContractTransaction): DeployContractTransaction; - - /** - * Encodes the specified DeployContractTransaction message. Does not implicitly {@link DeployContractTransaction.verify|verify} messages. - * @param message DeployContractTransaction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: IDeployContractTransaction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeployContractTransaction message, length delimited. Does not implicitly {@link DeployContractTransaction.verify|verify} messages. - * @param message DeployContractTransaction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: IDeployContractTransaction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeployContractTransaction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeployContractTransaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): DeployContractTransaction; - - /** - * Decodes a DeployContractTransaction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeployContractTransaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): DeployContractTransaction; - - /** - * Verifies a DeployContractTransaction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeployContractTransaction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeployContractTransaction - */ - public static fromObject(object: { [k: string]: any }): DeployContractTransaction; - - /** - * Creates a plain object from a DeployContractTransaction message. Also converts values to other types if specified. - * @param message DeployContractTransaction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: DeployContractTransaction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeployContractTransaction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; -} - -/** Properties of a FunctionCallTransaction. */ -export interface IFunctionCallTransaction { - - /** FunctionCallTransaction nonce */ - nonce?: (number|Long|null); - - /** FunctionCallTransaction originator */ - originator?: (string|null); - - /** FunctionCallTransaction contractId */ - contractId?: (string|null); - - /** FunctionCallTransaction methodName */ - methodName?: (Uint8Array|null); - - /** FunctionCallTransaction args */ - args?: (Uint8Array|null); - - /** FunctionCallTransaction amount */ - amount?: (IUint128|null); -} - -/** Represents a FunctionCallTransaction. */ -export class FunctionCallTransaction implements IFunctionCallTransaction { - - /** - * Constructs a new FunctionCallTransaction. - * @param [properties] Properties to set - */ - constructor(properties?: IFunctionCallTransaction); - - /** FunctionCallTransaction nonce. */ - public nonce: (number|Long); - - /** FunctionCallTransaction originator. */ - public originator: string; - - /** FunctionCallTransaction contractId. */ - public contractId: string; - - /** FunctionCallTransaction methodName. */ - public methodName: Uint8Array; - - /** FunctionCallTransaction args. */ - public args: Uint8Array; - - /** FunctionCallTransaction amount. */ - public amount?: (IUint128|null); - - /** - * Creates a new FunctionCallTransaction instance using the specified properties. - * @param [properties] Properties to set - * @returns FunctionCallTransaction instance - */ - public static create(properties?: IFunctionCallTransaction): FunctionCallTransaction; - - /** - * Encodes the specified FunctionCallTransaction message. Does not implicitly {@link FunctionCallTransaction.verify|verify} messages. - * @param message FunctionCallTransaction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: IFunctionCallTransaction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FunctionCallTransaction message, length delimited. Does not implicitly {@link FunctionCallTransaction.verify|verify} messages. - * @param message FunctionCallTransaction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: IFunctionCallTransaction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FunctionCallTransaction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FunctionCallTransaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): FunctionCallTransaction; - - /** - * Decodes a FunctionCallTransaction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FunctionCallTransaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): FunctionCallTransaction; - - /** - * Verifies a FunctionCallTransaction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FunctionCallTransaction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FunctionCallTransaction - */ - public static fromObject(object: { [k: string]: any }): FunctionCallTransaction; - - /** - * Creates a plain object from a FunctionCallTransaction message. Also converts values to other types if specified. - * @param message FunctionCallTransaction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: FunctionCallTransaction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FunctionCallTransaction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; -} - -/** Properties of a SendMoneyTransaction. */ -export interface ISendMoneyTransaction { - - /** SendMoneyTransaction nonce */ - nonce?: (number|Long|null); - - /** SendMoneyTransaction originator */ - originator?: (string|null); - - /** SendMoneyTransaction receiver */ - receiver?: (string|null); - - /** SendMoneyTransaction amount */ - amount?: (IUint128|null); -} - -/** Represents a SendMoneyTransaction. */ -export class SendMoneyTransaction implements ISendMoneyTransaction { - - /** - * Constructs a new SendMoneyTransaction. - * @param [properties] Properties to set - */ - constructor(properties?: ISendMoneyTransaction); - - /** SendMoneyTransaction nonce. */ - public nonce: (number|Long); - - /** SendMoneyTransaction originator. */ - public originator: string; - - /** SendMoneyTransaction receiver. */ - public receiver: string; - - /** SendMoneyTransaction amount. */ - public amount?: (IUint128|null); - - /** - * Creates a new SendMoneyTransaction instance using the specified properties. - * @param [properties] Properties to set - * @returns SendMoneyTransaction instance - */ - public static create(properties?: ISendMoneyTransaction): SendMoneyTransaction; - - /** - * Encodes the specified SendMoneyTransaction message. Does not implicitly {@link SendMoneyTransaction.verify|verify} messages. - * @param message SendMoneyTransaction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ISendMoneyTransaction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SendMoneyTransaction message, length delimited. Does not implicitly {@link SendMoneyTransaction.verify|verify} messages. - * @param message SendMoneyTransaction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ISendMoneyTransaction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SendMoneyTransaction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SendMoneyTransaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): SendMoneyTransaction; - - /** - * Decodes a SendMoneyTransaction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SendMoneyTransaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): SendMoneyTransaction; - - /** - * Verifies a SendMoneyTransaction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SendMoneyTransaction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SendMoneyTransaction - */ - public static fromObject(object: { [k: string]: any }): SendMoneyTransaction; - - /** - * Creates a plain object from a SendMoneyTransaction message. Also converts values to other types if specified. - * @param message SendMoneyTransaction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: SendMoneyTransaction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SendMoneyTransaction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; -} - -/** Properties of a StakeTransaction. */ -export interface IStakeTransaction { - - /** StakeTransaction nonce */ - nonce?: (number|Long|null); - - /** StakeTransaction originator */ - originator?: (string|null); - - /** StakeTransaction amount */ - amount?: (IUint128|null); - - /** StakeTransaction publicKey */ - publicKey?: (string|null); - - /** StakeTransaction blsPublicKey */ - blsPublicKey?: (string|null); -} - -/** Represents a StakeTransaction. */ -export class StakeTransaction implements IStakeTransaction { - - /** - * Constructs a new StakeTransaction. - * @param [properties] Properties to set - */ - constructor(properties?: IStakeTransaction); - - /** StakeTransaction nonce. */ - public nonce: (number|Long); - - /** StakeTransaction originator. */ - public originator: string; - - /** StakeTransaction amount. */ - public amount?: (IUint128|null); - - /** StakeTransaction publicKey. */ - public publicKey: string; - - /** StakeTransaction blsPublicKey. */ - public blsPublicKey: string; - - /** - * Creates a new StakeTransaction instance using the specified properties. - * @param [properties] Properties to set - * @returns StakeTransaction instance - */ - public static create(properties?: IStakeTransaction): StakeTransaction; - - /** - * Encodes the specified StakeTransaction message. Does not implicitly {@link StakeTransaction.verify|verify} messages. - * @param message StakeTransaction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: IStakeTransaction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified StakeTransaction message, length delimited. Does not implicitly {@link StakeTransaction.verify|verify} messages. - * @param message StakeTransaction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: IStakeTransaction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a StakeTransaction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns StakeTransaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): StakeTransaction; - - /** - * Decodes a StakeTransaction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns StakeTransaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): StakeTransaction; - - /** - * Verifies a StakeTransaction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a StakeTransaction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StakeTransaction - */ - public static fromObject(object: { [k: string]: any }): StakeTransaction; - - /** - * Creates a plain object from a StakeTransaction message. Also converts values to other types if specified. - * @param message StakeTransaction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: StakeTransaction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this StakeTransaction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; -} - -/** Properties of a SwapKeyTransaction. */ -export interface ISwapKeyTransaction { - - /** SwapKeyTransaction nonce */ - nonce?: (number|Long|null); - - /** SwapKeyTransaction originator */ - originator?: (string|null); - - /** SwapKeyTransaction curKey */ - curKey?: (Uint8Array|null); - - /** SwapKeyTransaction newKey */ - newKey?: (Uint8Array|null); -} - -/** Represents a SwapKeyTransaction. */ -export class SwapKeyTransaction implements ISwapKeyTransaction { - - /** - * Constructs a new SwapKeyTransaction. - * @param [properties] Properties to set - */ - constructor(properties?: ISwapKeyTransaction); - - /** SwapKeyTransaction nonce. */ - public nonce: (number|Long); - - /** SwapKeyTransaction originator. */ - public originator: string; - - /** SwapKeyTransaction curKey. */ - public curKey: Uint8Array; - - /** SwapKeyTransaction newKey. */ - public newKey: Uint8Array; - - /** - * Creates a new SwapKeyTransaction instance using the specified properties. - * @param [properties] Properties to set - * @returns SwapKeyTransaction instance - */ - public static create(properties?: ISwapKeyTransaction): SwapKeyTransaction; - - /** - * Encodes the specified SwapKeyTransaction message. Does not implicitly {@link SwapKeyTransaction.verify|verify} messages. - * @param message SwapKeyTransaction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ISwapKeyTransaction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SwapKeyTransaction message, length delimited. Does not implicitly {@link SwapKeyTransaction.verify|verify} messages. - * @param message SwapKeyTransaction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ISwapKeyTransaction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SwapKeyTransaction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SwapKeyTransaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): SwapKeyTransaction; - - /** - * Decodes a SwapKeyTransaction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SwapKeyTransaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): SwapKeyTransaction; - - /** - * Verifies a SwapKeyTransaction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SwapKeyTransaction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SwapKeyTransaction - */ - public static fromObject(object: { [k: string]: any }): SwapKeyTransaction; - - /** - * Creates a plain object from a SwapKeyTransaction message. Also converts values to other types if specified. - * @param message SwapKeyTransaction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: SwapKeyTransaction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SwapKeyTransaction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; -} - -/** Properties of an AddKeyTransaction. */ -export interface IAddKeyTransaction { - - /** AddKeyTransaction nonce */ - nonce?: (number|Long|null); - - /** AddKeyTransaction originator */ - originator?: (string|null); - - /** AddKeyTransaction newKey */ - newKey?: (Uint8Array|null); - - /** AddKeyTransaction accessKey */ - accessKey?: (IAccessKey|null); -} - -/** Represents an AddKeyTransaction. */ -export class AddKeyTransaction implements IAddKeyTransaction { - - /** - * Constructs a new AddKeyTransaction. - * @param [properties] Properties to set - */ - constructor(properties?: IAddKeyTransaction); - - /** AddKeyTransaction nonce. */ - public nonce: (number|Long); - - /** AddKeyTransaction originator. */ - public originator: string; - - /** AddKeyTransaction newKey. */ - public newKey: Uint8Array; - - /** AddKeyTransaction accessKey. */ - public accessKey?: (IAccessKey|null); - - /** - * Creates a new AddKeyTransaction instance using the specified properties. - * @param [properties] Properties to set - * @returns AddKeyTransaction instance - */ - public static create(properties?: IAddKeyTransaction): AddKeyTransaction; - - /** - * Encodes the specified AddKeyTransaction message. Does not implicitly {@link AddKeyTransaction.verify|verify} messages. - * @param message AddKeyTransaction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: IAddKeyTransaction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AddKeyTransaction message, length delimited. Does not implicitly {@link AddKeyTransaction.verify|verify} messages. - * @param message AddKeyTransaction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: IAddKeyTransaction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AddKeyTransaction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AddKeyTransaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): AddKeyTransaction; - - /** - * Decodes an AddKeyTransaction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AddKeyTransaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): AddKeyTransaction; - - /** - * Verifies an AddKeyTransaction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AddKeyTransaction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AddKeyTransaction - */ - public static fromObject(object: { [k: string]: any }): AddKeyTransaction; - - /** - * Creates a plain object from an AddKeyTransaction message. Also converts values to other types if specified. - * @param message AddKeyTransaction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: AddKeyTransaction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AddKeyTransaction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; -} - -/** Properties of a DeleteKeyTransaction. */ -export interface IDeleteKeyTransaction { - - /** DeleteKeyTransaction nonce */ - nonce?: (number|Long|null); - - /** DeleteKeyTransaction originator */ - originator?: (string|null); - - /** DeleteKeyTransaction curKey */ - curKey?: (Uint8Array|null); -} - -/** Represents a DeleteKeyTransaction. */ -export class DeleteKeyTransaction implements IDeleteKeyTransaction { - - /** - * Constructs a new DeleteKeyTransaction. - * @param [properties] Properties to set - */ - constructor(properties?: IDeleteKeyTransaction); - - /** DeleteKeyTransaction nonce. */ - public nonce: (number|Long); - - /** DeleteKeyTransaction originator. */ - public originator: string; - - /** DeleteKeyTransaction curKey. */ - public curKey: Uint8Array; - - /** - * Creates a new DeleteKeyTransaction instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteKeyTransaction instance - */ - public static create(properties?: IDeleteKeyTransaction): DeleteKeyTransaction; - - /** - * Encodes the specified DeleteKeyTransaction message. Does not implicitly {@link DeleteKeyTransaction.verify|verify} messages. - * @param message DeleteKeyTransaction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: IDeleteKeyTransaction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteKeyTransaction message, length delimited. Does not implicitly {@link DeleteKeyTransaction.verify|verify} messages. - * @param message DeleteKeyTransaction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: IDeleteKeyTransaction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteKeyTransaction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteKeyTransaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): DeleteKeyTransaction; - - /** - * Decodes a DeleteKeyTransaction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteKeyTransaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): DeleteKeyTransaction; - - /** - * Verifies a DeleteKeyTransaction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteKeyTransaction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteKeyTransaction - */ - public static fromObject(object: { [k: string]: any }): DeleteKeyTransaction; - - /** - * Creates a plain object from a DeleteKeyTransaction message. Also converts values to other types if specified. - * @param message DeleteKeyTransaction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: DeleteKeyTransaction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteKeyTransaction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; -} - -/** Properties of a DeleteAccountTransaction. */ -export interface IDeleteAccountTransaction { - - /** DeleteAccountTransaction nonce */ - nonce?: (number|Long|null); - - /** DeleteAccountTransaction originatorId */ - originatorId?: (string|null); - - /** DeleteAccountTransaction receiverId */ - receiverId?: (string|null); -} - -/** Represents a DeleteAccountTransaction. */ -export class DeleteAccountTransaction implements IDeleteAccountTransaction { - - /** - * Constructs a new DeleteAccountTransaction. - * @param [properties] Properties to set - */ - constructor(properties?: IDeleteAccountTransaction); - - /** DeleteAccountTransaction nonce. */ - public nonce: (number|Long); - - /** DeleteAccountTransaction originatorId. */ - public originatorId: string; - - /** DeleteAccountTransaction receiverId. */ - public receiverId: string; - - /** - * Creates a new DeleteAccountTransaction instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteAccountTransaction instance - */ - public static create(properties?: IDeleteAccountTransaction): DeleteAccountTransaction; - - /** - * Encodes the specified DeleteAccountTransaction message. Does not implicitly {@link DeleteAccountTransaction.verify|verify} messages. - * @param message DeleteAccountTransaction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: IDeleteAccountTransaction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteAccountTransaction message, length delimited. Does not implicitly {@link DeleteAccountTransaction.verify|verify} messages. - * @param message DeleteAccountTransaction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: IDeleteAccountTransaction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteAccountTransaction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteAccountTransaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): DeleteAccountTransaction; - - /** - * Decodes a DeleteAccountTransaction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteAccountTransaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): DeleteAccountTransaction; - - /** - * Verifies a DeleteAccountTransaction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteAccountTransaction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteAccountTransaction - */ - public static fromObject(object: { [k: string]: any }): DeleteAccountTransaction; - - /** - * Creates a plain object from a DeleteAccountTransaction message. Also converts values to other types if specified. - * @param message DeleteAccountTransaction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: DeleteAccountTransaction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteAccountTransaction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; -} - -/** Properties of a SignedTransaction. */ -export interface ISignedTransaction { - - /** SignedTransaction signature */ - signature?: (Uint8Array|null); - - /** SignedTransaction publicKey */ - publicKey?: (google.protobuf.IBytesValue|null); - - /** SignedTransaction createAccount */ - createAccount?: (ICreateAccountTransaction|null); - - /** SignedTransaction deployContract */ - deployContract?: (IDeployContractTransaction|null); - - /** SignedTransaction functionCall */ - functionCall?: (IFunctionCallTransaction|null); - - /** SignedTransaction sendMoney */ - sendMoney?: (ISendMoneyTransaction|null); - - /** SignedTransaction stake */ - stake?: (IStakeTransaction|null); - - /** SignedTransaction swapKey */ - swapKey?: (ISwapKeyTransaction|null); - - /** SignedTransaction addKey */ - addKey?: (IAddKeyTransaction|null); - - /** SignedTransaction deleteKey */ - deleteKey?: (IDeleteKeyTransaction|null); - - /** SignedTransaction deleteAccount */ - deleteAccount?: (IDeleteAccountTransaction|null); -} - -/** Represents a SignedTransaction. */ -export class SignedTransaction implements ISignedTransaction { - - /** - * Constructs a new SignedTransaction. - * @param [properties] Properties to set - */ - constructor(properties?: ISignedTransaction); - - /** SignedTransaction signature. */ - public signature: Uint8Array; - - /** SignedTransaction publicKey. */ - public publicKey?: (google.protobuf.IBytesValue|null); - - /** SignedTransaction createAccount. */ - public createAccount?: (ICreateAccountTransaction|null); - - /** SignedTransaction deployContract. */ - public deployContract?: (IDeployContractTransaction|null); - - /** SignedTransaction functionCall. */ - public functionCall?: (IFunctionCallTransaction|null); - - /** SignedTransaction sendMoney. */ - public sendMoney?: (ISendMoneyTransaction|null); - - /** SignedTransaction stake. */ - public stake?: (IStakeTransaction|null); - - /** SignedTransaction swapKey. */ - public swapKey?: (ISwapKeyTransaction|null); - - /** SignedTransaction addKey. */ - public addKey?: (IAddKeyTransaction|null); - - /** SignedTransaction deleteKey. */ - public deleteKey?: (IDeleteKeyTransaction|null); - - /** SignedTransaction deleteAccount. */ - public deleteAccount?: (IDeleteAccountTransaction|null); - - /** SignedTransaction body. */ - public body?: ("createAccount"|"deployContract"|"functionCall"|"sendMoney"|"stake"|"swapKey"|"addKey"|"deleteKey"|"deleteAccount"); - - /** - * Creates a new SignedTransaction instance using the specified properties. - * @param [properties] Properties to set - * @returns SignedTransaction instance - */ - public static create(properties?: ISignedTransaction): SignedTransaction; - - /** - * Encodes the specified SignedTransaction message. Does not implicitly {@link SignedTransaction.verify|verify} messages. - * @param message SignedTransaction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ISignedTransaction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SignedTransaction message, length delimited. Does not implicitly {@link SignedTransaction.verify|verify} messages. - * @param message SignedTransaction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ISignedTransaction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SignedTransaction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SignedTransaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): SignedTransaction; - - /** - * Decodes a SignedTransaction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SignedTransaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): SignedTransaction; - - /** - * Verifies a SignedTransaction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SignedTransaction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SignedTransaction - */ - public static fromObject(object: { [k: string]: any }): SignedTransaction; - - /** - * Creates a plain object from a SignedTransaction message. Also converts values to other types if specified. - * @param message SignedTransaction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: SignedTransaction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SignedTransaction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; -} - -/** Namespace google. */ -export namespace google { - - /** Namespace protobuf. */ - namespace protobuf { - - /** Properties of a DoubleValue. */ - interface IDoubleValue { - - /** DoubleValue value */ - value?: (number|null); - } - - /** Represents a DoubleValue. */ - class DoubleValue implements IDoubleValue { - - /** - * Constructs a new DoubleValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDoubleValue); - - /** DoubleValue value. */ - public value: number; - - /** - * Creates a new DoubleValue instance using the specified properties. - * @param [properties] Properties to set - * @returns DoubleValue instance - */ - public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; - - /** - * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. - * @param message DoubleValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. - * @param message DoubleValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DoubleValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DoubleValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DoubleValue; - - /** - * Decodes a DoubleValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DoubleValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DoubleValue; - - /** - * Verifies a DoubleValue message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DoubleValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DoubleValue; - - /** - * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. - * @param message DoubleValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DoubleValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DoubleValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a FloatValue. */ - interface IFloatValue { - - /** FloatValue value */ - value?: (number|null); - } - - /** Represents a FloatValue. */ - class FloatValue implements IFloatValue { - - /** - * Constructs a new FloatValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFloatValue); - - /** FloatValue value. */ - public value: number; - - /** - * Creates a new FloatValue instance using the specified properties. - * @param [properties] Properties to set - * @returns FloatValue instance - */ - public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; - - /** - * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. - * @param message FloatValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. - * @param message FloatValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FloatValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FloatValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FloatValue; - - /** - * Decodes a FloatValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FloatValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FloatValue; - - /** - * Verifies a FloatValue message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FloatValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FloatValue; - - /** - * Creates a plain object from a FloatValue message. Also converts values to other types if specified. - * @param message FloatValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FloatValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FloatValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an Int64Value. */ - interface IInt64Value { - - /** Int64Value value */ - value?: (number|Long|null); - } - - /** Represents an Int64Value. */ - class Int64Value implements IInt64Value { - - /** - * Constructs a new Int64Value. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IInt64Value); - - /** Int64Value value. */ - public value: (number|Long); - - /** - * Creates a new Int64Value instance using the specified properties. - * @param [properties] Properties to set - * @returns Int64Value instance - */ - public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; - - /** - * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. - * @param message Int64Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. - * @param message Int64Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Int64Value message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Int64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Int64Value; - - /** - * Decodes an Int64Value message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Int64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Int64Value; - - /** - * Verifies an Int64Value message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Int64Value - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Int64Value; - - /** - * Creates a plain object from an Int64Value message. Also converts values to other types if specified. - * @param message Int64Value - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Int64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Int64Value to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a UInt64Value. */ - interface IUInt64Value { - - /** UInt64Value value */ - value?: (number|Long|null); - } - - /** Represents a UInt64Value. */ - class UInt64Value implements IUInt64Value { - - /** - * Constructs a new UInt64Value. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IUInt64Value); - - /** UInt64Value value. */ - public value: (number|Long); - - /** - * Creates a new UInt64Value instance using the specified properties. - * @param [properties] Properties to set - * @returns UInt64Value instance - */ - public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; - - /** - * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. - * @param message UInt64Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. - * @param message UInt64Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a UInt64Value message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UInt64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UInt64Value; - - /** - * Decodes a UInt64Value message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UInt64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UInt64Value; - - /** - * Verifies a UInt64Value message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UInt64Value - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UInt64Value; - - /** - * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. - * @param message UInt64Value - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UInt64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UInt64Value to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an Int32Value. */ - interface IInt32Value { - - /** Int32Value value */ - value?: (number|null); - } - - /** Represents an Int32Value. */ - class Int32Value implements IInt32Value { - - /** - * Constructs a new Int32Value. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IInt32Value); - - /** Int32Value value. */ - public value: number; - - /** - * Creates a new Int32Value instance using the specified properties. - * @param [properties] Properties to set - * @returns Int32Value instance - */ - public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; - - /** - * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. - * @param message Int32Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. - * @param message Int32Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Int32Value message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Int32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Int32Value; - - /** - * Decodes an Int32Value message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Int32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Int32Value; - - /** - * Verifies an Int32Value message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Int32Value - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Int32Value; - - /** - * Creates a plain object from an Int32Value message. Also converts values to other types if specified. - * @param message Int32Value - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Int32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Int32Value to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a UInt32Value. */ - interface IUInt32Value { - - /** UInt32Value value */ - value?: (number|null); - } - - /** Represents a UInt32Value. */ - class UInt32Value implements IUInt32Value { - - /** - * Constructs a new UInt32Value. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IUInt32Value); - - /** UInt32Value value. */ - public value: number; - - /** - * Creates a new UInt32Value instance using the specified properties. - * @param [properties] Properties to set - * @returns UInt32Value instance - */ - public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; - - /** - * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. - * @param message UInt32Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. - * @param message UInt32Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a UInt32Value message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UInt32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UInt32Value; - - /** - * Decodes a UInt32Value message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UInt32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UInt32Value; - - /** - * Verifies a UInt32Value message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UInt32Value - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UInt32Value; - - /** - * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. - * @param message UInt32Value - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UInt32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UInt32Value to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a BoolValue. */ - interface IBoolValue { - - /** BoolValue value */ - value?: (boolean|null); - } - - /** Represents a BoolValue. */ - class BoolValue implements IBoolValue { - - /** - * Constructs a new BoolValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IBoolValue); - - /** BoolValue value. */ - public value: boolean; - - /** - * Creates a new BoolValue instance using the specified properties. - * @param [properties] Properties to set - * @returns BoolValue instance - */ - public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; - - /** - * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. - * @param message BoolValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. - * @param message BoolValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BoolValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BoolValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.BoolValue; - - /** - * Decodes a BoolValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BoolValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.BoolValue; - - /** - * Verifies a BoolValue message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BoolValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.BoolValue; - - /** - * Creates a plain object from a BoolValue message. Also converts values to other types if specified. - * @param message BoolValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.BoolValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BoolValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a StringValue. */ - interface IStringValue { - - /** StringValue value */ - value?: (string|null); - } - - /** Represents a StringValue. */ - class StringValue implements IStringValue { - - /** - * Constructs a new StringValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IStringValue); - - /** StringValue value. */ - public value: string; - - /** - * Creates a new StringValue instance using the specified properties. - * @param [properties] Properties to set - * @returns StringValue instance - */ - public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; - - /** - * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. - * @param message StringValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. - * @param message StringValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a StringValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns StringValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.StringValue; - - /** - * Decodes a StringValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns StringValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.StringValue; - - /** - * Verifies a StringValue message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a StringValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StringValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.StringValue; - - /** - * Creates a plain object from a StringValue message. Also converts values to other types if specified. - * @param message StringValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.StringValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this StringValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a BytesValue. */ - interface IBytesValue { - - /** BytesValue value */ - value?: (Uint8Array|null); - } - - /** Represents a BytesValue. */ - class BytesValue implements IBytesValue { - - /** - * Constructs a new BytesValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IBytesValue); - - /** BytesValue value. */ - public value: Uint8Array; - - /** - * Creates a new BytesValue instance using the specified properties. - * @param [properties] Properties to set - * @returns BytesValue instance - */ - public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; - - /** - * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. - * @param message BytesValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. - * @param message BytesValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BytesValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BytesValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.BytesValue; - - /** - * Decodes a BytesValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BytesValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.BytesValue; - - /** - * Verifies a BytesValue message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BytesValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.BytesValue; - - /** - * Creates a plain object from a BytesValue message. Also converts values to other types if specified. - * @param message BytesValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.BytesValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BytesValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } -} - -/** Properties of an AccessKey. */ -export interface IAccessKey { - - /** AccessKey amount */ - amount?: (IUint128|null); - - /** AccessKey balanceOwner */ - balanceOwner?: (google.protobuf.IStringValue|null); - - /** AccessKey contractId */ - contractId?: (google.protobuf.IStringValue|null); - - /** AccessKey methodName */ - methodName?: (google.protobuf.IBytesValue|null); -} - -/** Represents an AccessKey. */ -export class AccessKey implements IAccessKey { - - /** - * Constructs a new AccessKey. - * @param [properties] Properties to set - */ - constructor(properties?: IAccessKey); - - /** AccessKey amount. */ - public amount?: (IUint128|null); - - /** AccessKey balanceOwner. */ - public balanceOwner?: (google.protobuf.IStringValue|null); - - /** AccessKey contractId. */ - public contractId?: (google.protobuf.IStringValue|null); - - /** AccessKey methodName. */ - public methodName?: (google.protobuf.IBytesValue|null); - - /** - * Creates a new AccessKey instance using the specified properties. - * @param [properties] Properties to set - * @returns AccessKey instance - */ - public static create(properties?: IAccessKey): AccessKey; - - /** - * Encodes the specified AccessKey message. Does not implicitly {@link AccessKey.verify|verify} messages. - * @param message AccessKey message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: IAccessKey, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AccessKey message, length delimited. Does not implicitly {@link AccessKey.verify|verify} messages. - * @param message AccessKey message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: IAccessKey, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AccessKey message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AccessKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): AccessKey; - - /** - * Decodes an AccessKey message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AccessKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): AccessKey; - - /** - * Verifies an AccessKey message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AccessKey message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AccessKey - */ - public static fromObject(object: { [k: string]: any }): AccessKey; - - /** - * Creates a plain object from an AccessKey message. Also converts values to other types if specified. - * @param message AccessKey - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: AccessKey, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AccessKey to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; -} - -/** Properties of an Uint128. */ -export interface IUint128 { - - /** Uint128 number */ - number?: (Uint8Array|null); -} - -/** Provides container for unsigned 128 bit integers. */ -export class Uint128 implements IUint128 { - - /** - * Constructs a new Uint128. - * @param [properties] Properties to set - */ - constructor(properties?: IUint128); - - /** Uint128 number. */ - public number: Uint8Array; - - /** - * Creates a new Uint128 instance using the specified properties. - * @param [properties] Properties to set - * @returns Uint128 instance - */ - public static create(properties?: IUint128): Uint128; - - /** - * Encodes the specified Uint128 message. Does not implicitly {@link Uint128.verify|verify} messages. - * @param message Uint128 message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: IUint128, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Uint128 message, length delimited. Does not implicitly {@link Uint128.verify|verify} messages. - * @param message Uint128 message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: IUint128, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Uint128 message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Uint128 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Uint128; - - /** - * Decodes an Uint128 message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Uint128 - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): Uint128; - - /** - * Verifies an Uint128 message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Uint128 message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Uint128 - */ - public static fromObject(object: { [k: string]: any }): Uint128; - - /** - * Creates a plain object from an Uint128 message. Also converts values to other types if specified. - * @param message Uint128 - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: Uint128, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Uint128 to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; -} diff --git a/src.ts/providers/json-rpc-provider.ts b/src.ts/providers/json-rpc-provider.ts index be1926ca51..ed98d24f0f 100644 --- a/src.ts/providers/json-rpc-provider.ts +++ b/src.ts/providers/json-rpc-provider.ts @@ -4,7 +4,7 @@ import { Provider, FinalTransactionResult, NodeStatusResult, BlockResult } from import { Network } from '../utils/network'; import { ConnectionInfo, fetchJson } from '../utils/web'; import { base_encode } from '../utils/serialize'; -import { SignedTransaction } from '../protos'; +import { SignedTransaction } from '../transaction'; /// Keep ids unique across all connections. let _nextId = 123; @@ -31,7 +31,7 @@ export class JsonRpcProvider extends Provider { } async sendTransaction(signedTransaction: SignedTransaction): Promise { - const bytes = SignedTransaction.encode(signedTransaction).finish(); + const bytes = signedTransaction.encode(); return this.sendJsonRpc('broadcast_tx_commit', [Buffer.from(bytes).toString('base64')]); } diff --git a/src.ts/providers/provider.ts b/src.ts/providers/provider.ts index da57e575b6..13f4f22f32 100644 --- a/src.ts/providers/provider.ts +++ b/src.ts/providers/provider.ts @@ -1,7 +1,7 @@ 'use strict'; import { Network } from '../utils/network'; -import { SignedTransaction } from '../protos'; +import { SignedTransaction } from '../transaction'; export interface SyncInfo { latest_block_hash: string; @@ -27,14 +27,19 @@ export enum FinalTransactionStatus { export interface TransactionLog { hash: string; - lines: string[]; - receipts: number[][]; - result?: Uint8Array; + result: TransactionResult; +} + +export interface TransactionResult { + status: string; + logs: string[]; + receipts: string[]; + result?: string; } export interface FinalTransactionResult { status: FinalTransactionStatus; - logs: TransactionLog[]; + transactions: TransactionLog[]; } export interface TotalWeight { @@ -76,10 +81,10 @@ export abstract class Provider { } export function getTransactionLastResult(txResult: FinalTransactionResult): any { - for (let i = txResult.logs.length - 1; i >= 0; --i) { - const r = txResult.logs[i]; - if (r.result && r.result.length > 0) { - return JSON.parse(Buffer.from(r.result).toString()); + for (let i = txResult.transactions.length - 1; i >= 0; --i) { + const r = txResult.transactions[i]; + if (r.result && r.result.result && r.result.result.length > 0) { + return JSON.parse(Buffer.from(r.result.result, 'base64').toString()); } } return null; diff --git a/src.ts/signer.ts b/src.ts/signer.ts index 141bd2fa98..9bf29e8619 100644 --- a/src.ts/signer.ts +++ b/src.ts/signer.ts @@ -1,7 +1,7 @@ 'use strict'; import sha256 from 'js-sha256'; -import { Signature, KeyPair } from './utils/key_pair'; +import { Signature, KeyPair, PublicKey } from './utils/key_pair'; import { KeyStore } from './key_stores'; /** @@ -12,14 +12,14 @@ export abstract class Signer { /** * Creates new key and returns public key. */ - abstract async createKey(accountId: string, networkId?: string): Promise; + abstract async createKey(accountId: string, networkId?: string): Promise; /** * Returns public key for given account / network. * @param accountId accountId to retrieve from. * @param networkId network for this accountId. */ - abstract async getPublicKey(accountId?: string, networkId?: string): Promise; + abstract async getPublicKey(accountId?: string, networkId?: string): Promise; /** * Signs given hash. @@ -51,13 +51,13 @@ export class InMemorySigner extends Signer { this.keyStore = keyStore; } - async createKey(accountId: string, networkId: string): Promise { + async createKey(accountId: string, networkId: string): Promise { const keyPair = KeyPair.fromRandom('ed25519'); await this.keyStore.setKey(networkId, accountId, keyPair); return keyPair.getPublicKey(); } - async getPublicKey(accountId?: string, networkId?: string): Promise { + async getPublicKey(accountId?: string, networkId?: string): Promise { const keyPair = await this.keyStore.getKey(networkId, accountId); return keyPair.getPublicKey(); } diff --git a/src.ts/transaction.ts b/src.ts/transaction.ts index 8bb629bbf9..27823c7265 100644 --- a/src.ts/transaction.ts +++ b/src.ts/transaction.ts @@ -3,91 +3,220 @@ import sha256 from 'js-sha256'; import BN from 'bn.js'; -import { Uint128, SendMoneyTransaction, CreateAccountTransaction, - SignedTransaction, DeployContractTransaction, FunctionCallTransaction, - StakeTransaction, SwapKeyTransaction, AddKeyTransaction, - DeleteKeyTransaction, AccessKey, - google} from './protos'; -import { base_decode } from './utils/serialize'; -import { Signature } from './utils/key_pair'; +import { serialize } from './utils/serialize'; +import { KeyType, PublicKey } from './utils/key_pair'; import { Signer } from './signer'; -const TRANSACTION_FIELD_MAP = new Map([ - [CreateAccountTransaction, 'createAccount'], - [DeployContractTransaction, 'deployContract'], - [FunctionCallTransaction, 'functionCall'], - [SendMoneyTransaction, 'sendMoney'], - [StakeTransaction, 'stake'], - [SwapKeyTransaction, 'swapKey'], - [AddKeyTransaction, 'addKey'], - [DeleteKeyTransaction, 'deleteKey'], -]); +class Enum { + enum: string; + + constructor(properties: any) { + if (Object.keys(properties).length !== 1) { + throw new Error('Enum can only take single value'); + } + Object.keys(properties).map((key: string) => { + (this as any)[key] = properties[key]; + this.enum = key; + }); + } +} + +class Assignable { + constructor(properties: any) { + Object.keys(properties).map((key: any) => { + (this as any)[key] = properties[key]; + }); + } +} + +export class FunctionCallPermission extends Assignable { + allowance?: BN; + receiverId: string; + methodNames: String[]; +} + +export class FullAccessPermission extends Assignable {} + +export class AccessKeyPermission extends Enum { + functionCall: FunctionCallPermission; + fullAccess: FullAccessPermission; +} + +export class AccessKey extends Assignable { + nonce: number; + permission: AccessKeyPermission; +} + +export function fullAccessKey(): AccessKey { + return new AccessKey({ nonce: 0, permission: new AccessKeyPermission({fullAccess: new FullAccessPermission({})}) }); +} + +export function functionCallAccessKey(receiverId: string, methodNames: String[], allowance?: BN): AccessKey { + return new AccessKey({ nonce: 0, permission: new AccessKeyPermission({functionCall: new FunctionCallPermission({receiverId, allowance, methodNames})})}); +} -export type AllTransactions = SendMoneyTransaction | CreateAccountTransaction | DeployContractTransaction | FunctionCallTransaction | StakeTransaction | SwapKeyTransaction | AddKeyTransaction | DeleteKeyTransaction; +export class IAction extends Assignable {} -function bigInt(num: BN): Uint128 { - const number = new Uint8Array(new BN(num).toArray('le', 16)); - return new Uint128({ number }); +class CreateAccount extends IAction {} +class DeployContract extends IAction { code: Uint8Array; } +class FunctionCall extends IAction { methodName: string; args: Uint8Array; gas: BN; deposit: BN; } +class Transfer extends IAction { deposit: BN; } +class Stake extends IAction { stake: BN; publicKey: PublicKey; } +class AddKey extends IAction { publicKey: PublicKey; accessKey: AccessKey; } +class DeleteKey extends IAction { publicKey: PublicKey; } +class DeleteAccount extends IAction { beneficiaryId: string; } + +export function createAccount(): Action { + return new Action({createAccount: new CreateAccount({}) }); } -export function bignumHex2Dec(num: string): string { - return new BN(num, 16).toString(10); +export function deployContract(code: Uint8Array): Action { + return new Action({ deployContract: new DeployContract({code}) }); } -export function createAccount(nonce: number, originator: string, newAccountId: string, publicKey: string, amount: BN): CreateAccountTransaction { - return new CreateAccountTransaction({nonce, originator, newAccountId, publicKey: base_decode(publicKey), amount: bigInt(amount)}); +export function functionCall(methodName: string, args: Uint8Array, gas: number, deposit: BN): Action { + return new Action({functionCall: new FunctionCall({methodName, args, gas, deposit }) }); } -export function deployContract(nonce: number, contractId: string, wasmByteArray: Uint8Array): DeployContractTransaction { - return new DeployContractTransaction({nonce, contractId, wasmByteArray}); +export function transfer(deposit: BN): Action { + return new Action({transfer: new Transfer({ deposit }) }); } -export function functionCall(nonce: number, originator: string, contractId: string, methodName: string, args: Uint8Array, amount: BN): FunctionCallTransaction { - return new FunctionCallTransaction({nonce, originator, contractId, methodName: Buffer.from(methodName), args, amount: bigInt(amount) }); +export function stake(stake: BN, publicKey: PublicKey): Action { + return new Action({stake: new Stake({ stake, publicKey }) }); } -export function sendMoney(nonce: number, originator: string, receiver: string, amount: BN): SendMoneyTransaction { - return new SendMoneyTransaction({ nonce, originator, receiver, amount: bigInt(amount) }); +export function addKey(publicKey: PublicKey, accessKey: AccessKey): Action { + return new Action({addKey: new AddKey({ publicKey, accessKey}) }); } -export function stake(nonce: number, originator: string, amount: BN, publicKey: string): StakeTransaction { - return new StakeTransaction({ nonce, originator, amount: bigInt(amount), publicKey, blsPublicKey: null }); +export function deleteKey(publicKey: PublicKey): Action { + return new Action({deleteKey: new DeleteKey({ publicKey }) }); } -export function swapKey(nonce: number, originator: string, curKey: string, newKey: string): SwapKeyTransaction { - return new SwapKeyTransaction({ nonce, originator, curKey: base_decode(curKey), newKey: base_decode(newKey) }); +export function deleteAccount(beneficiaryId: string): Action { + return new Action({deleteAccount: new DeleteAccount({ beneficiaryId }) }); } -export function createAccessKey(contractId?: string, methodName?: string, balanceOwner?: string, amount?: BN): AccessKey { - return new AccessKey({ - contractId: contractId ? new google.protobuf.StringValue({ value: contractId }) : null, - methodName: methodName ? new google.protobuf.BytesValue({ value: Buffer.from(methodName) }) : null, - balanceOwner: balanceOwner ? new google.protobuf.StringValue({ value: balanceOwner }) : null, - amount: bigInt(amount || new BN(0)), - }); +class Signature { + keyType: KeyType; + data: Uint8Array; + + constructor(signature: Uint8Array) { + this.keyType = KeyType.ED25519; + this.data = signature; + } } -export function addKey(nonce: number, originator: string, newKey: string, accessKey: AccessKey): AddKeyTransaction { - return new AddKeyTransaction({ nonce, originator, newKey: base_decode(newKey), accessKey}); +export class Transaction extends Assignable { + signerId: string; + publicKey: PublicKey; + nonce: number; + receiverId: string; + actions: Action[]; + blockHash: Uint8Array; } -export function deleteKey(nonce: number, originator: string, curKey: string): DeleteKeyTransaction { - return new DeleteKeyTransaction({ nonce, originator, curKey: base_decode(curKey) }); +export class SignedTransaction extends Assignable { + transaction: Transaction; + signature: Signature; + + encode(): Uint8Array { + return serialize(SCHEMA, this); + } } -export function signedTransaction(transaction: AllTransactions, signature: Signature): SignedTransaction { - const fieldName = TRANSACTION_FIELD_MAP.get(transaction.constructor); - return new SignedTransaction({ - signature: signature.signature, - publicKey: google.protobuf.BytesValue.create({ value: base_decode(signature.publicKey) }), - [fieldName]: transaction, - }); +export class Action extends Enum { + createAccount: CreateAccount; + deployContract: DeployContract; + functionCall: FunctionCall; + transfer: Transfer; + stake: Stake; + addKey: AddKey; + deleteKey: DeleteKey; + deleteAccount: DeleteAccount; } -export async function signTransaction(signer: Signer, transaction: any, accountId?: string, networkId?: string): Promise<[Uint8Array, SignedTransaction]> { - const protoClass = transaction.constructor; - const message = protoClass.encode(transaction).finish(); +export const SCHEMA = new Map([ + [Signature, {kind: 'struct', fields: [ + ['keyType', 'u8'], + ['data', [32]] + ]}], + [SignedTransaction, {kind: 'struct', fields: [ + ['transaction', Transaction], + ['signature', Signature] + ]}], + [Transaction, { kind: 'struct', fields: [ + ['signerId', 'string'], + ['publicKey', PublicKey], + ['nonce', 'u64'], + ['receiverId', 'string'], + ['blockHash', [32]], + ['actions', [Action]] + ]}], + [PublicKey, { kind: 'struct', fields: [ + ['keyType', 'u8'], + ['data', [32]] + ]}], + [AccessKey, { kind: 'struct', fields: [ + ['nonce', 'u64'], + ['permission', AccessKeyPermission], + ]}], + [AccessKeyPermission, {kind: 'enum', field: 'enum', values: [ + ['functionCall', FunctionCallPermission], + ['fullAccess', FullAccessPermission], + ]}], + [FunctionCallPermission, {kind: 'struct', fields: [ + ['allowance', {kind: 'option', type: 'u128'}], + ['receiverId', 'string'], + ['methodNames', ['string']], + ]}], + [FullAccessPermission, {kind: 'struct', fields: []}], + [Action, {kind: 'enum', field: 'enum', values: [ + ['createAccount', CreateAccount], + ['deployContract', DeployContract], + ['functionCall', functionCall], + ['transfer', transfer], + ['stake', stake], + ['addKey', addKey], + ['deleteKey', deleteKey], + ['deleteAccount', deleteAccount], + ]}], + [CreateAccount, { kind: 'struct', fields: [] }], + [DeployContract, { kind: 'struct', fields: [ + ['code', ['u8']] + ]}], + [FunctionCall, { kind: 'struct', fields: [ + ['methodName', 'string'], + ['args', ['u8']], + ['gas', 'u64'], + ['deposit', 'u128'] + ]}], + [Transfer, { kind: 'struct', fields: [ + ['deposit', 'u128'] + ]}], + [Stake, { kind: 'struct', fields: [ + ['stake', 'u128'], + ['publicKey', PublicKey] + ]}], + [AddKey, { kind: 'struct', fields: [ + ['publicKey', PublicKey], + ['accessKey', AccessKey] + ]}], + [DeleteKey, { kind: 'struct', fields: [ + ['publicKey', PublicKey] + ]}], + [DeleteAccount, { kind: 'struct', fields: [ + ['beneficiaryId', 'string'] + ]}], +]); + +export async function signTransaction(receiverId: string, nonce: number, actions: Action[], blockHash: Uint8Array, signer: Signer, accountId?: string, networkId?: string): Promise<[Uint8Array, SignedTransaction]> { + const publicKey = await signer.getPublicKey(accountId, networkId); + const transaction = new Transaction({ signerId: accountId, publicKey, nonce, receiverId, actions, blockHash }); + const message = serialize(SCHEMA, transaction); const hash = new Uint8Array(sha256.sha256.array(message)); const signature = await signer.signHash(hash, accountId, networkId); - return [hash, signedTransaction(transaction, signature)]; + const signedTx = new SignedTransaction({transaction, signature: new Signature(signature.signature) }); + return [hash, signedTx]; } diff --git a/src.ts/utils/index.ts b/src.ts/utils/index.ts index 35a3b45885..22476342a3 100644 --- a/src.ts/utils/index.ts +++ b/src.ts/utils/index.ts @@ -4,7 +4,7 @@ import * as network from './network'; import * as serialize from './serialize'; import * as web from './web'; -import { KeyPair, KeyPairEd25519 } from './key_pair'; +import { PublicKey, KeyPair, KeyPairEd25519 } from './key_pair'; export { key_pair, @@ -12,6 +12,7 @@ export { serialize, web, + PublicKey, KeyPair, KeyPairEd25519 }; diff --git a/src.ts/utils/key_pair.ts b/src.ts/utils/key_pair.ts index 2eff5bf004..da8a0b1b51 100644 --- a/src.ts/utils/key_pair.ts +++ b/src.ts/utils/key_pair.ts @@ -7,31 +7,88 @@ export type Arrayish = string | ArrayLike; export interface Signature { signature: Uint8Array; - publicKey: string; + publicKey: PublicKey; +} + +/** All supported key types */ +export enum KeyType { + ED25519 = 0, +} + +function key_type_to_str(keyType: KeyType): String { + switch (keyType) { + case KeyType.ED25519: return 'ed25519'; + default: throw new Error(`Unknown key type ${keyType}`); + } +} + +function str_to_key_type(keyType: string): KeyType { + switch (keyType.toLowerCase()) { + case 'ed25519': return KeyType.ED25519; + default: throw new Error(`Unknown key type ${keyType}`); + } +} + +/** + * PublicKey representation that has type and bytes of the key. + */ +export class PublicKey { + keyType: KeyType; + data: Uint8Array; + + constructor(keyType: KeyType, data: Uint8Array) { + this.keyType = keyType; + this.data = data; + } + + static from(value: string | PublicKey): PublicKey { + if (typeof value === 'string') { + return PublicKey.fromString(value); + } + return value; + } + + static fromString(encodedKey: string): PublicKey { + const parts = encodedKey.split(':'); + if (parts.length === 1) { + return new PublicKey(KeyType.ED25519, base_decode(parts[0])); + } else if (parts.length === 2) { + return new PublicKey(str_to_key_type(parts[0]), base_decode(parts[1])); + } else { + throw new Error('Invlaid encoded key format, must be :'); + } + } + + toString(): string { + return `${key_type_to_str(this.keyType)}:${base_encode(this.data)}`; + } } export abstract class KeyPair { abstract sign(message: Uint8Array): Signature; abstract verify(message: Uint8Array, signature: Uint8Array): boolean; abstract toString(): string; - abstract getPublicKey(): string; + abstract getPublicKey(): PublicKey; static fromRandom(curve: string): KeyPair { - switch (curve) { - case 'ed25519': return KeyPairEd25519.fromRandom(); + switch (curve.toUpperCase()) { + case 'ED25519': return KeyPairEd25519.fromRandom(); default: throw new Error(`Unknown curve ${curve}`); } } static fromString(encodedKey: string): KeyPair { const parts = encodedKey.split(':'); - if (parts.length !== 2) { + if (parts.length === 1) { + return new KeyPairEd25519(parts[0]); + } else if (parts.length === 2) { + switch (parts[0].toUpperCase()) { + case 'ED25519': return new KeyPairEd25519(parts[1]); + default: throw new Error(`Unknown curve: ${parts[0]}`); + } + } else { throw new Error('Invalid encoded key format, must be :'); } - switch (parts[0]) { - case 'ed25519': return new KeyPairEd25519(parts[1]); - default: throw new Error(`Unknown curve: ${parts[0]}`); - } } } @@ -40,7 +97,7 @@ export abstract class KeyPair { * generating key pairs, encoding key pairs, signing and verifying. */ export class KeyPairEd25519 extends KeyPair { - readonly publicKey: string; + readonly publicKey: PublicKey; readonly secretKey: string; /** @@ -51,7 +108,7 @@ export class KeyPairEd25519 extends KeyPair { constructor(secretKey: string) { super(); const keyPair = nacl.sign.keyPair.fromSecretKey(base_decode(secretKey)); - this.publicKey = base_encode(keyPair.publicKey); + this.publicKey = new PublicKey(KeyType.ED25519, keyPair.publicKey); this.secretKey = secretKey; } @@ -76,14 +133,14 @@ export class KeyPairEd25519 extends KeyPair { } verify(message: Uint8Array, signature: Uint8Array): boolean { - return nacl.sign.detached.verify(message, signature, base_decode(this.publicKey)); + return nacl.sign.detached.verify(message, signature, this.publicKey.data); } toString(): string { return `ed25519:${this.secretKey}`; } - getPublicKey(): string { + getPublicKey(): PublicKey { return this.publicKey; } } diff --git a/src.ts/utils/serialize.ts b/src.ts/utils/serialize.ts index 78f3827c00..4672c7fb53 100644 --- a/src.ts/utils/serialize.ts +++ b/src.ts/utils/serialize.ts @@ -1,6 +1,7 @@ 'use strict'; import bs58 from 'bs58'; +import BN from 'bn.js'; export function base_encode(value: Uint8Array | string): string { if (typeof(value) === 'string') { @@ -12,3 +13,219 @@ export function base_encode(value: Uint8Array | string): string { export function base_decode(value: string): Uint8Array { return bs58.decode(value); } + +const INITIAL_LENGTH = 1024; + +export type Schema = Map; + +/// Binary encoder. +export class BinaryWriter { + buf: Buffer; + length: number; + + public constructor() { + this.buf = Buffer.alloc(INITIAL_LENGTH); + this.length = 0; + } + + maybe_resize() { + if (this.buf.length < 16 + this.length) { + this.buf = Buffer.concat([this.buf, Buffer.alloc(INITIAL_LENGTH)]); + } + } + + public write_u8(value: number) { + this.maybe_resize(); + this.buf.writeUInt8(value, this.length); + this.length += 1; + } + + public write_u32(value: number) { + this.maybe_resize(); + this.buf.writeUInt32LE(value, this.length); + this.length += 4; + } + + public write_u64(value: BN) { + this.maybe_resize(); + this.write_buffer(Buffer.from(new BN(value).toArray('le', 8))); + } + + public write_u128(value: BN) { + this.maybe_resize(); + this.write_buffer(Buffer.from(new BN(value).toArray('le', 16))); + } + + private write_buffer(buffer: Buffer) { + // Buffer.from is needed as this.buf.subarray can return plain Uint8Array in browser + this.buf = Buffer.concat([Buffer.from(this.buf.subarray(0, this.length)), buffer, Buffer.alloc(INITIAL_LENGTH)]); + this.length += buffer.length; + } + + public write_string(str: string) { + this.maybe_resize(); + const b = Buffer.from(str, 'utf8'); + this.write_u32(b.length); + this.write_buffer(b); + } + + public write_fixed_array(array: Uint8Array) { + this.write_buffer(Buffer.from(array)); + } + + public write_array(array: any[], fn: any) { + this.maybe_resize(); + this.write_u32(array.length); + for (const elem of array) { + this.maybe_resize(); + fn(elem); + } + } + + public toArray(): Uint8Array { + return this.buf.subarray(0, this.length); + } +} + +export class BinaryReader { + buf: Buffer; + offset: number; + + public constructor(buf: Buffer) { + this.buf = buf; + this.offset = 0; + } + + read_u8(): number { + const value = this.buf.readUInt8(this.offset); + this.offset += 1; + return value; + } + + read_u32(): number { + const value = this.buf.readUInt32LE(this.offset); + this.offset += 4; + return value; + } + + read_u64(): BN { + const buf = this.read_buffer(8); + buf.reverse(); + return new BN(`${buf.toString('hex')}`, 16); + } + + read_u128(): BN { + const buf = this.read_buffer(16); + return new BN(buf); + } + + private read_buffer(len: number): Buffer { + const result = this.buf.slice(this.offset, this.offset + len); + this.offset += len; + return result; + } + + read_string(): string { + const len = this.read_u32(); + return this.read_buffer(len).toString('utf8'); + } + + read_fixed_array(len: number): Uint8Array { + return new Uint8Array(this.read_buffer(len)); + } + + read_array(fn: any): any[] { + const len = this.read_u32(); + const result = Array(); + for (let i = 0; i < len; ++i) { + result.push(fn()); + } + return result; + } +} + +function serializeField(schema: Schema, value: any, fieldType: any, writer: any) { + if (typeof fieldType === 'string') { + writer[`write_${fieldType}`](value); + } else if (fieldType instanceof Array) { + if (typeof fieldType[0] === 'number') { + writer.write_fixed_array(value); + } else { + writer.write_array(value, (item: any) => { serializeField(schema, item, fieldType[0], writer); }); + } + } else if (fieldType.kind !== undefined) { + switch (fieldType.kind) { + case 'option': { + if (value === null) { + writer.write_u8(0); + } else { + writer.write_u8(1); + serializeField(schema, value, fieldType.type, writer); + } + break; + } + default: throw new Error(`FieldType ${fieldType} unrecognized`); + } + } else { + serializeStruct(schema, value, writer); + } +} + +function serializeStruct(schema: Schema, obj: any, writer: any) { + const structSchema = schema.get(obj.constructor); + if (!structSchema) { + throw new Error(`Class ${obj.constructor.name} is missing in schema`); + } + if (structSchema.kind === 'struct') { + structSchema.fields.map(([fieldName, fieldType]: [any, any]) => { + serializeField(schema, obj[fieldName], fieldType, writer); + }); + } else if (structSchema.kind === 'enum') { + const name = obj[structSchema.field]; + for (let idx = 0; idx < structSchema.values.length; ++idx) { + const [fieldName, fieldType]: [any, any] = structSchema.values[idx]; + if (fieldName === name) { + writer.write_u8(idx); + serializeField(schema, obj[fieldName], fieldType, writer); + break; + } + } + } else { + throw new Error(`Unexpected schema kind: ${structSchema.kind} for ${obj.constructor.name}`); + } +} + +/// Serialize given object using schema of the form: +/// { class_name -> [ [field_name, field_type], .. ], .. } +export function serialize(schema: Schema, obj: any): Uint8Array { + const writer = new BinaryWriter(); + serializeStruct(schema, obj, writer); + return writer.toArray(); +} + +function deserializeField(schema: Schema, fieldType: any, reader: any): any { + if (typeof fieldType === 'string') { + return reader[`read_${fieldType}`](); + } else if (fieldType instanceof Array) { + if (typeof fieldType[0] === 'number') { + return reader.read_fixed_array(fieldType[0]); + } else { + return reader.read_array(() => deserializeField(schema, fieldType[0], reader)); + } + } else { + return deserializeStruct(schema, fieldType, reader); + } +} + +function deserializeStruct(schema: Schema, classType: any, reader: any) { + const fields = schema.get(classType).fields.map(([fieldName, fieldType]: [any, any]) => { + return deserializeField(schema, fieldType, reader); + }); + return new classType(...fields); +} + +/// Deserializes object from bytes using schema. +export function deserialize(schema: Schema, classType: any, buffer: Buffer): any { + const reader = new BinaryReader(buffer); + return deserializeStruct(schema, classType, reader); +} diff --git a/src.ts/wallet-account.ts b/src.ts/wallet-account.ts index b3ed09066b..34b89d302b 100644 --- a/src.ts/wallet-account.ts +++ b/src.ts/wallet-account.ts @@ -73,7 +73,7 @@ export class WalletAccount { newUrl.searchParams.set('failure_url', failureUrl || currentUrl.href); newUrl.searchParams.set('app_url', currentUrl.origin); const accessKey = KeyPair.fromRandom('ed25519'); - newUrl.searchParams.set('public_key', accessKey.getPublicKey()); + newUrl.searchParams.set('public_key', accessKey.getPublicKey().toString()); await this._keyStore.setKey(this._networkId, PENDING_ACCESS_KEY_PREFIX + accessKey.getPublicKey(), accessKey); window.location.assign(newUrl.toString()); } diff --git a/test/account.access_key.test.js b/test/account.access_key.test.js index 895a5373ea..d981c8f695 100644 --- a/test/account.access_key.test.js +++ b/test/account.access_key.test.js @@ -1,4 +1,3 @@ - const BN = require('bn.js'); const nearlib = require('../lib/index'); const testUtils = require('./test-utils'); @@ -24,7 +23,7 @@ beforeEach(async () => { test('make function call using access key', async() => { const keyPair = nearlib.utils.KeyPair.fromRandom('ed25519'); - await workingAccount.addKey(keyPair.getPublicKey(), contractId, '', '', 400000); + await workingAccount.addKey(keyPair.getPublicKey(), contractId, '', 10000000); // Override in the key store the workingAccount key to the given access key. await nearjs.connection.signer.keyStore.setKey(testUtils.networkId, workingAccount.accountId, keyPair); @@ -35,32 +34,33 @@ test('make function call using access key', async() => { test('remove access key no longer works', async() => { const keyPair = nearlib.utils.KeyPair.fromRandom('ed25519'); - await workingAccount.addKey(keyPair.getPublicKey(), contractId, '', '', 400000); - await workingAccount.deleteKey(keyPair.getPublicKey()); + let publicKey = keyPair.getPublicKey(); + await workingAccount.addKey(publicKey, contractId, '', 400000); + await workingAccount.deleteKey(publicKey); // Override in the key store the workingAccount key to the given access key. await nearjs.connection.signer.keyStore.setKey(testUtils.networkId, workingAccount.accountId, keyPair); - await expect(contract.setValue({ value: 'test' })).rejects.toThrow(/\[-32000\] Server error: Transaction is not signed with a public key of the originator .+/); + await expect(contract.setValue({ value: 'test' })).rejects.toThrow(new RegExp(`\\[-32000\\] Server error: Signer "${workingAccount.accountId}" doesn't have access key with the given public_key ${publicKey}`)); }); test('view account details after adding access keys', async() => { const keyPair = nearlib.utils.KeyPair.fromRandom('ed25519'); - await workingAccount.addKey(keyPair.getPublicKey(), contractId, '', '', 1000000000); + await workingAccount.addKey(keyPair.getPublicKey(), contractId, '', 1000000000); const contract2 = await testUtils.deployContract(workingAccount, 'test_contract2_' + Date.now()); const keyPair2 = nearlib.utils.KeyPair.fromRandom('ed25519'); - await workingAccount.addKey(keyPair2.getPublicKey(), contract2.contractId, '', '', 2000000000); + await workingAccount.addKey(keyPair2.getPublicKey(), contract2.contractId, '', 2000000000); const details = await workingAccount.getAccountDetails(); const expectedResult = { authorizedApps: [{ contractId: contractId, amount: '1000000000', - publicKey: keyPair.getPublicKey(), + publicKey: keyPair.getPublicKey().toString(), }, { contractId: contract2.contractId, amount: '2000000000', - publicKey: keyPair2.getPublicKey(), + publicKey: keyPair2.getPublicKey().toString(), }], transactions: [] }; @@ -69,10 +69,10 @@ test('view account details after adding access keys', async() => { test('loading account after adding a full key', async() => { const keyPair = nearlib.utils.KeyPair.fromRandom('ed25519'); - await workingAccount.addKey(keyPair.getPublicKey(), '', '', '', 1000000000); + await workingAccount.addKey(keyPair.getPublicKey()); - await workingAccount.fetchState(); + let accessKeys = await workingAccount.getAccessKeys(); - expect(workingAccount._state.public_keys.length).toBe(2); - expect(workingAccount._state.public_keys.includes(keyPair.getPublicKey())).toBe(true); + expect(accessKeys.length).toBe(2); + expect(accessKeys.map((item) => item.public_key).includes(keyPair.getPublicKey().toString())).toBe(true); }); diff --git a/test/account.test.js b/test/account.test.js index c7474e50ae..da87682c7d 100644 --- a/test/account.test.js +++ b/test/account.test.js @@ -18,7 +18,7 @@ beforeAll(async () => { test('view pre-defined account works and returns correct name', async () => { let status = await workingAccount.state(); - expect(status.account_id).toEqual(workingAccount.accountId); + expect(status.code_hash).toEqual('11111111111111111111111111111111'); }); test('create account and then view account returns the created account', async () => { @@ -27,8 +27,7 @@ test('create account and then view account returns the created account', async ( await workingAccount.createAccount(newAccountName, newAccountPublicKey, testUtils.INITIAL_BALANCE); const newAccount = new nearlib.Account(nearjs.connection, newAccountName); const state = await newAccount.state(); - const expectedState = { nonce: 0, account_id: newAccountName, amount: testUtils.INITIAL_BALANCE.toString(), stake: '0', code_hash: 'GKot5hBsd81kMupNCXHaqbhv3huEbxAFMLnpcX2hniwn', public_keys: state.public_keys }; - expect(state).toMatchObject(expectedState); + expect(state.amount).toEqual(testUtils.INITIAL_BALANCE.toString()); }); test('send money', async() => { @@ -70,7 +69,7 @@ describe('with deploy contract', () => { beforeAll(async () => { const newPublicKey = await nearjs.connection.signer.createKey(contractId, testUtils.networkId); const data = [...fs.readFileSync(HELLO_WASM_PATH)]; - await workingAccount.createAndDeployContract(contractId, newPublicKey, data, new BN(100000)); + await workingAccount.createAndDeployContract(contractId, newPublicKey, data, new BN(1000000)); contract = new nearlib.Contract(workingAccount, contractId, { viewMethods: ['hello', 'getValue', 'getAllKeys', 'returnHiWithLogs'], changeMethods: ['setValue', 'generateLogs', 'triggerAssert', 'testSetRemove'] @@ -101,7 +100,7 @@ describe('with deploy contract', () => { expect(nearlib.providers.getTransactionLastResult(result2)).toEqual(setCallValue); expect(await workingAccount.viewFunction(contractId, 'getValue', {})).toEqual(setCallValue); }); - + test('make function calls via contract', async() => { const result = await contract.hello({ name: 'trex' }); expect(result).toEqual('hello trex'); @@ -127,8 +126,8 @@ describe('with deploy contract', () => { await expect(contract.triggerAssert()).rejects.toThrow(/Transaction .+ failed.+expected to fail.+/); expect(logs.length).toBe(3); expect(logs[0]).toEqual(`[${contractId}]: LOG: log before assert`); - expect(logs[1]).toMatch(new RegExp(`^\\[${contractId}\\]: ABORT: "expected to fail" filename: "../out/main.ts" line: \\d+ col: \\d+$`)); - expect(logs[2]).toEqual(`[${contractId}]: Runtime error: wasm async call execution failed with error: Runtime(AssertFailed)`); + expect(logs[1]).toMatch(new RegExp(`^\\[${contractId}\\]: ABORT: "expected to fail" filename: "assembly/main.ts" line: \\d+ col: \\d+$`)); + expect(logs[2]).toEqual(`[${contractId}]: Runtime error: wasm async call execution failed with error: WasmerCallError("Smart contract has explicitly invoked \`panic\`.")`); }); test('test set/remove', async () => { diff --git a/test/config.js b/test/config.js index 92b0e3a961..791edd0ad7 100644 --- a/test/config.js +++ b/test/config.js @@ -26,6 +26,12 @@ module.exports = function getConfig(env) { nodeUrl: 'http://shared-test.nearprotocol.com:3030', masterAccount: 'test.near', }; + case 'ci-staging': + return { + networkId: 'shared-test-staging', + nodeUrl: 'http://staging-shared-test.nearprotocol.com:3030', + masterAccount: 'test.near', + }; default: throw Error(`Unconfigured environment '${env}'. Can be configured in test/config.js.`); } diff --git a/test/key_pair.test.js b/test/key_pair.test.js index 4a9f62702f..c327c21485 100644 --- a/test/key_pair.test.js +++ b/test/key_pair.test.js @@ -4,7 +4,7 @@ const { sha256 } = require('js-sha256'); test('test sign and verify', async () => { const keyPair = new nearlib.utils.key_pair.KeyPairEd25519('26x56YPzPDro5t2smQfGcYAPy3j7R2jB2NUb7xKbAGK23B6x4WNQPh3twb6oDksFov5X8ts5CtntUNbpQpAKFdbR'); - expect(keyPair.publicKey).toEqual('AYWv9RAN1hpSQA4p1DLhCNnpnNXwxhfH9qeHN8B4nJ59'); + expect(keyPair.publicKey.toString()).toEqual('ed25519:AYWv9RAN1hpSQA4p1DLhCNnpnNXwxhfH9qeHN8B4nJ59'); const message = new Uint8Array(sha256.array('message')); const signature = keyPair.sign(message); expect(nearlib.utils.serialize.base_encode(signature.signature)).toEqual('26gFr4xth7W9K7HPWAxq3BLsua8oTy378mC1MYFiEXHBBpeBjP8WmJEJo8XTBowetvqbRshcQEtBUdwQcAqDyP8T'); @@ -19,11 +19,15 @@ test('test sign and verify with random', async () => { test('test from secret', async () => { const keyPair = new nearlib.utils.key_pair.KeyPairEd25519('5JueXZhEEVqGVT5powZ5twyPP8wrap2K7RdAYGGdjBwiBdd7Hh6aQxMP1u3Ma9Yanq1nEv32EW7u8kUJsZ6f315C'); - expect(keyPair.publicKey).toEqual('EWrekY1deMND7N3Q7Dixxj12wD7AVjFRt2H9q21QHUSW'); + expect(keyPair.publicKey.toString()).toEqual('ed25519:EWrekY1deMND7N3Q7Dixxj12wD7AVjFRt2H9q21QHUSW'); }); test('convert to string', async () => { const keyPair = nearlib.utils.key_pair.KeyPairEd25519.fromRandom(); const newKeyPair = nearlib.utils.key_pair.KeyPair.fromString(keyPair.toString()); expect(newKeyPair.secretKey).toEqual(keyPair.secretKey); + + const keyString = 'ed25519:2wyRcSwSuHtRVmkMCGjPwnzZmQLeXLzLLyED1NDMt4BjnKgQL6tF85yBx6Jr26D2dUNeC716RBoTxntVHsegogYw'; + const keyPair2 = nearlib.utils.key_pair.KeyPair.fromString(keyString); + expect(keyPair2.toString()).toEqual(keyString); }); diff --git a/test/promise.test.js b/test/promise.test.js index 35b5d9b144..235d57e4fd 100644 --- a/test/promise.test.js +++ b/test/promise.test.js @@ -11,7 +11,7 @@ beforeAll(async () => { workingAccount = await testUtils.createAccount(await nearjs.account(testUtils.testAccountName), { amount: testUtils.INITIAL_BALANCE.mul(new BN(100)) }); }); -describe('with promises', () => { +describe('with promises', () => { let contract, contract1, contract2; let oldLog; let logs; @@ -37,7 +37,7 @@ describe('with promises', () => { console.log = oldLog; }); - // -> means async call + // -> means async call // => means callback test('single promise, no callback (A->B)', async () => { @@ -45,10 +45,12 @@ describe('with promises', () => { receiver: contractName1, methodName: 'callbackWithName', args: null, - balance: 500000000, + gas: 300000, + balance: 0, callback: null, callbackArgs: null, callbackBalance: 0, + callbackGas: 0, }}); const lastResult = await contract1.getLastResult(); expect(lastResult).toEqual({ @@ -62,10 +64,12 @@ describe('with promises', () => { receiver: contractName1, methodName: 'callbackWithName', args: null, - balance: 500000000, + gas: 300000, + balance: 0, callback: 'callbackWithName', callbackArgs: null, - callbackBalance: 100000000, + callbackBalance: 0, + callbackGas: 200000, }}); const lastResult1 = await contract1.getLastResult(); expect(lastResult1).toEqual({ @@ -90,15 +94,19 @@ describe('with promises', () => { receiver: contractName2, methodName: 'callbackWithName', args: null, - balance: 100000000, + gas: 100000, + balance: 0, callback: null, callbackArgs: null, callbackBalance: 0, + callbackGas: 100000, }, - balance: 500000000, + gas: 300000, + balance: 0, callback: null, callbackArgs: null, callbackBalance: 0, + callbackGas: 300000, }}); const lastResult2 = await contract2.getLastResult(); expect(lastResult2).toEqual({ @@ -115,15 +123,19 @@ describe('with promises', () => { receiver: contractName2, methodName: 'callbackWithName', args: null, - balance: 200000000, + gas: 200000, + balance: 0, callback: 'callbackWithName', callbackArgs: null, - callbackBalance: 100000000, + callbackBalance: 0, + callbackGas: 200000, }, - balance: 500000000, + gas: 500000, + balance: 0, callback: 'callbackWithName', callbackArgs: null, - callbackBalance: 100000000, + callbackBalance: 0, + callbackGas: 300000, }}); const lastResult2 = await contract2.getLastResult(); expect(lastResult2).toEqual({ @@ -156,15 +168,19 @@ describe('with promises', () => { receiver: contractName, methodName: 'callbackWithName', args: null, - balance: 200000000, + gas: 200000, + balance: 0, callback: 'callbackWithName', callbackArgs: null, - callbackBalance: 100000000, + callbackBalance: 0, + callbackGas: 200000, }, - balance: 500000000, + gas: 500000, + balance: 0, callback: 'callbackWithName', callbackArgs: null, - callbackBalance: 100000000, + callbackBalance: 0, + callbackGas: 300000, }}); const lastResult1 = await contract1.getLastResult(); expect(lastResult1).toEqual({ @@ -195,15 +211,19 @@ describe('with promises', () => { receiver: contractName2, methodName: 'callbackWithName', args: null, - balance: 100000000, + gas: 200000, + balance: 0, callback: null, callbackArgs: null, callbackBalance: 0, + callbackGas: 200000, }, - balance: 500000000, + gas: 500000, + balance: 0, callback: 'callbackWithName', callbackArgs: null, - callbackBalance: 100000000, + callbackBalance: 0, + callbackGas: 300000 }}); const lastResult2 = await contract2.getLastResult(); expect(lastResult2).toEqual({ @@ -219,52 +239,4 @@ describe('with promises', () => { n: contractName, }); }); - - test('single promise with callback using deposit (empty method name) (A->B=>A)', async () => { - await contract.callPromise({args: { - receiver: contractName1, - methodName: '', // Deposit (no execution) - args: null, - balance: 500000000, - callback: 'callbackWithName', - callbackArgs: null, - callbackBalance: 100000000, - }}); - const lastResult = await contract.getLastResult(); - expect(lastResult).toEqual({ - rs: [{ - ok: true, - r: null, - }], - n: contractName, - }); - }); - - test('2 promises with 1 skipped callbacks using deposit (empty method name) (A->B->C=>A)', async () => { - await contract.callPromise({args: { - receiver: contractName1, - methodName: 'callPromise', - args: { - receiver: contractName2, - methodName: '', // Deposit (no execution) - args: null, - balance: 0, - callback: null, - callbackArgs: null, - callbackBalance: 0, - }, - balance: 500000000, - callback: 'callbackWithName', - callbackArgs: null, - callbackBalance: 100000000, - }}); - const lastResult = await contract.getLastResult(); - expect(lastResult).toEqual({ - rs: [{ - ok: true, - r: null, - }], - n: contractName, - }); - }); }); diff --git a/test/providers.test.js b/test/providers.test.js index c2aeaa8149..9bee5ff436 100644 --- a/test/providers.test.js +++ b/test/providers.test.js @@ -19,16 +19,16 @@ test('json rpc query account', async () => { const config = Object.assign(require('./config')(process.env.NODE_ENV || 'test')); const provider = new nearlib.providers.JsonRpcProvider(config.nodeUrl); let response = await provider.query('account/test.near', ''); - expect(response.account_id).toEqual('test.near'); + expect(response.code_hash).toEqual('11111111111111111111111111111111'); }); test('final tx result', async() => { const result = { status: 'Complete', - logs: [ - {hash: '11111', lines: [], receipts: [], result: null }, - { hash: '11111', lines: [], receipts: [], result: [123, 125] }, - { hash: '11111', lines: [], receipts: [], result: null }, + transactions: [ + { hash: '11111', result: { status: 'completed', logs: [], receipts: [], result: null } }, + { hash: '11111', result: { status: 'completed', logs: [], receipts: [], result: 'e30=' } }, + { hash: '11111', result: { status: 'completed', logs: [], receipts: [], result: null } }, ] }; expect(nearlib.providers.getTransactionLastResult(result)).toEqual({}); diff --git a/test/serialize.test.js b/test/serialize.test.js new file mode 100644 index 0000000000..7bb9b2ab41 --- /dev/null +++ b/test/serialize.test.js @@ -0,0 +1,75 @@ + +const nearlib = require('../lib/index'); + +class Test { + constructor(x, y, z, q) { + this.x = x; + this.y = y; + this.z = z; + this.q = q; + } +} + +test('serialize object', async () => { + const value = new Test(255, 20, '123', [1, 2, 3]); + const schema = new Map([[Test, {kind: 'struct', fields: [['x', 'u8'], ['y', 'u64'], ['z', 'string'], ['q', [3]]] }]]); + let buf = nearlib.utils.serialize.serialize(schema, value); + let new_value = nearlib.utils.serialize.deserialize(schema, Test, buf); + expect(new_value.x).toEqual(255); + expect(new_value.y.toString()).toEqual('20'); + expect(new_value.z).toEqual('123'); + expect(new_value.q).toEqual(new Uint8Array([1, 2, 3])); +}); + +test('serialize and sign multi-action tx', async() => { + const keyStore = new nearlib.keyStores.InMemoryKeyStore(); + const keyPair = nearlib.utils.KeyPair.fromString('ed25519:2wyRcSwSuHtRVmkMCGjPwnzZmQLeXLzLLyED1NDMt4BjnKgQL6tF85yBx6Jr26D2dUNeC716RBoTxntVHsegogYw'); + await keyStore.setKey('test', 'test.near', keyPair); + const publicKey = keyPair.publicKey; + const actions = [ + nearlib.transactions.createAccount(), + nearlib.transactions.deployContract(new Uint8Array([1, 2, 3])), + nearlib.transactions.functionCall('qqq', new Uint8Array([1, 2, 3]), 1000, 1000000), + nearlib.transactions.transfer(123), + nearlib.transactions.stake(1000000, publicKey), + nearlib.transactions.addKey(publicKey, nearlib.transactions.functionCallAccessKey('zzz', ['www'], null)), + nearlib.transactions.deleteKey(publicKey), + nearlib.transactions.deleteAccount('123') + ]; + const blockHash = nearlib.utils.serialize.base_decode('244ZQ9cgj3CQ6bWBdytfrJMuMQ1jdXLFGnr4HhvtCTnM'); + let [hash] = await nearlib.transactions.signTransaction('123', 1, actions, blockHash, new nearlib.InMemorySigner(keyStore), 'test.near', 'test'); + expect(nearlib.utils.serialize.base_encode(hash)).toEqual('Fo3MJ9XzKjnKuDuQKhDAC6fra5H2UWawRejFSEpPNk3Y'); +}); + +test('serialize transfer tx', async() => { + const actions = [ + nearlib.transactions.transfer(1), + ]; + const blockHash = nearlib.utils.serialize.base_decode('244ZQ9cgj3CQ6bWBdytfrJMuMQ1jdXLFGnr4HhvtCTnM'); + const transaction = new nearlib.transactions.Transaction({ + signerId: 'test.near', + publicKey: nearlib.utils.PublicKey.fromString('Anu7LYDfpLtkP7E16LT9imXF694BdQaa9ufVkQiwTQxC'), + nonce: 1, + receiverId: 'whatever.near', + actions, + blockHash + }); + const serialized = nearlib.utils.serialize.serialize(nearlib.transactions.SCHEMA, transaction); + expect(serialized.toString('hex')).toEqual('09000000746573742e6e65617200917b3d268d4b58f7fec1b150bd68d69be3ee5d4cc39855e341538465bb77860d01000000000000000d00000077686174657665722e6e6561720fa473fd26901df296be6adc4cc4df34d040efa2435224b6986910e630c2fef6010000000301000000000000000000000000000000'); +}); + +test('serialize and sign transfer tx', async() => { + const keyStore = new nearlib.keyStores.InMemoryKeyStore(); + const keyPair = nearlib.utils.KeyPair.fromString('ed25519:3hoMW1HvnRLSFCLZnvPzWeoGwtdHzke34B2cTHM8rhcbG3TbuLKtShTv3DvyejnXKXKBiV7YPkLeqUHN1ghnqpFv'); + await keyStore.setKey('test', 'test.near', keyPair); + const actions = [ + nearlib.transactions.transfer(1), + ]; + const blockHash = nearlib.utils.serialize.base_decode('244ZQ9cgj3CQ6bWBdytfrJMuMQ1jdXLFGnr4HhvtCTnM'); + + let [, signedTx] = await nearlib.transactions.signTransaction('whatever.near', 1, actions, blockHash, new nearlib.InMemorySigner(keyStore), 'test.near', 'test'); + + expect(Buffer.from(signedTx.signature.data).toString('base64')).toEqual('lpqDMyGG7pdV5IOTJVJYBuGJo9LSu0tHYOlEQ+l+HE8i3u7wBZqOlxMQDtpuGRRNp+ig735TmyBwi6HY0CG9AQ=='); + const serialized = nearlib.utils.serialize.serialize(nearlib.transactions.SCHEMA, signedTx); + expect(serialized.toString('base64')).toEqual('CQAAAHRlc3QubmVhcgCRez0mjUtY9/7BsVC9aNab4+5dTMOYVeNBU4Rlu3eGDQEAAAAAAAAADQAAAHdoYXRldmVyLm5lYXIPpHP9JpAd8pa+atxMxN800EDvokNSJLaYaRDmMML+9gEAAAADAQAAAAAAAAAAAAAAAAAAAACWmoMzIYbul1Xkg5MlUlgG4Ymj0tK7S0dg6URD6X4cTyLe7vAFmo6XExAO2m4ZFE2n6KDvflObIHCLodjQIb0B'); +}); diff --git a/test/test-utils.js b/test/test-utils.js index 95bd28d9e9..55d65538a2 100644 --- a/test/test-utils.js +++ b/test/test-utils.js @@ -33,7 +33,7 @@ async function createAccount(masterAccount, options = { amount: INITIAL_BALANCE, return new nearlib.Account(masterAccount.connection, newAccountName); } -async function deployContract(workingAccount, contractId, options = { amount: new BN(100000) }) { +async function deployContract(workingAccount, contractId, options = { amount: new BN(10000000) }) { const newPublicKey = await workingAccount.connection.signer.createKey(contractId, networkId); const data = [...(await fs.readFile(HELLO_WASM_PATH))]; await workingAccount.createAndDeployContract(contractId, newPublicKey, data, options.amount); diff --git a/test/wallet-account.test.js b/test/wallet-account.test.js index 83dd7e202d..b2b8f82afc 100644 --- a/test/wallet-account.test.js +++ b/test/wallet-account.test.js @@ -55,7 +55,7 @@ it('can request sign in', async () => { contract_id: 'signInContract', success_url: 'http://example.com/success', failure_url: 'http://example.com/fail', - public_key: (await keyStore.getKey('networkId', accounts[0])).publicKey + public_key: (await keyStore.getKey('networkId', accounts[0])).publicKey.toString() } }); }); diff --git a/tsconfig.json b/tsconfig.json index b752f2721a..70129643d1 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -16,12 +16,11 @@ "pretty": false, "forceConsistentCasingInFileNames": true, "noFallthroughCasesInSwitch": true, - "noImplicitAny": true, + "noImplicitAny": false, "noImplicitReturns": true, "noUnusedLocals": true }, "files": [ "./src.ts/index.ts", - "./src.ts/protos.d.ts" ] } diff --git a/yarn.lock b/yarn.lock new file mode 100644 index 0000000000..958811393c --- /dev/null +++ b/yarn.lock @@ -0,0 +1,7334 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@babel/code-frame@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0.tgz#06e2ab19bdb535385559aabb5ba59729482800f8" + integrity sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA== + dependencies: + "@babel/highlight" "^7.0.0" + +"@babel/core@^7.1.0", "@babel/core@^7.1.2": + version "7.4.5" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.4.5.tgz#081f97e8ffca65a9b4b0fdc7e274e703f000c06a" + integrity sha512-OvjIh6aqXtlsA8ujtGKfC7LYWksYSX8yQcM8Ay3LuvVeQ63lcOKgoZWVqcpFwkd29aYU9rVx7jxhfhiEDV9MZA== + dependencies: + "@babel/code-frame" "^7.0.0" + "@babel/generator" "^7.4.4" + "@babel/helpers" "^7.4.4" + "@babel/parser" "^7.4.5" + "@babel/template" "^7.4.4" + "@babel/traverse" "^7.4.5" + "@babel/types" "^7.4.4" + convert-source-map "^1.1.0" + debug "^4.1.0" + json5 "^2.1.0" + lodash "^4.17.11" + resolve "^1.3.2" + semver "^5.4.1" + source-map "^0.5.0" + +"@babel/generator@^7.1.3", "@babel/generator@^7.4.0", "@babel/generator@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.4.4.tgz#174a215eb843fc392c7edcaabeaa873de6e8f041" + integrity sha512-53UOLK6TVNqKxf7RUh8NE851EHRxOOeVXKbK2bivdb+iziMyk03Sr4eaE9OELCbyZAAafAKPDwF2TPUES5QbxQ== + dependencies: + "@babel/types" "^7.4.4" + jsesc "^2.5.1" + lodash "^4.17.11" + source-map "^0.5.0" + trim-right "^1.0.1" + +"@babel/helper-annotate-as-pure@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.0.0.tgz#323d39dd0b50e10c7c06ca7d7638e6864d8c5c32" + integrity sha512-3UYcJUj9kvSLbLbUIfQTqzcy5VX7GRZ/CCDrnOaZorFFM01aXp1+GJwuFGV4NDDoAS+mOUyHcO6UD/RfqOks3Q== + dependencies: + "@babel/types" "^7.0.0" + +"@babel/helper-builder-binary-assignment-operator-visitor@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.1.0.tgz#6b69628dfe4087798e0c4ed98e3d4a6b2fbd2f5f" + integrity sha512-qNSR4jrmJ8M1VMM9tibvyRAHXQs2PmaksQF7c1CGJNipfe3D8p+wgNwgso/P2A2r2mdgBWAXljNWR0QRZAMW8w== + dependencies: + "@babel/helper-explode-assignable-expression" "^7.1.0" + "@babel/types" "^7.0.0" + +"@babel/helper-builder-react-jsx@^7.3.0": + version "7.3.0" + resolved "https://registry.yarnpkg.com/@babel/helper-builder-react-jsx/-/helper-builder-react-jsx-7.3.0.tgz#a1ac95a5d2b3e88ae5e54846bf462eeb81b318a4" + integrity sha512-MjA9KgwCuPEkQd9ncSXvSyJ5y+j2sICHyrI0M3L+6fnS4wMSNDc1ARXsbTfbb2cXHn17VisSnU/sHFTCxVxSMw== + dependencies: + "@babel/types" "^7.3.0" + esutils "^2.0.0" + +"@babel/helper-call-delegate@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/helper-call-delegate/-/helper-call-delegate-7.4.4.tgz#87c1f8ca19ad552a736a7a27b1c1fcf8b1ff1f43" + integrity sha512-l79boDFJ8S1c5hvQvG+rc+wHw6IuH7YldmRKsYtpbawsxURu/paVy57FZMomGK22/JckepaikOkY0MoAmdyOlQ== + dependencies: + "@babel/helper-hoist-variables" "^7.4.4" + "@babel/traverse" "^7.4.4" + "@babel/types" "^7.4.4" + +"@babel/helper-create-class-features-plugin@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.4.4.tgz#fc3d690af6554cc9efc607364a82d48f58736dba" + integrity sha512-UbBHIa2qeAGgyiNR9RszVF7bUHEdgS4JAUNT8SiqrAN6YJVxlOxeLr5pBzb5kan302dejJ9nla4RyKcR1XT6XA== + dependencies: + "@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.4" + "@babel/helper-split-export-declaration" "^7.4.4" + +"@babel/helper-define-map@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/helper-define-map/-/helper-define-map-7.4.4.tgz#6969d1f570b46bdc900d1eba8e5d59c48ba2c12a" + integrity sha512-IX3Ln8gLhZpSuqHJSnTNBWGDE9kdkTEWl21A/K7PQ00tseBwbqCHTvNLHSBd9M0R5rER4h5Rsvj9vw0R5SieBg== + dependencies: + "@babel/helper-function-name" "^7.1.0" + "@babel/types" "^7.4.4" + lodash "^4.17.11" + +"@babel/helper-explode-assignable-expression@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.1.0.tgz#537fa13f6f1674df745b0c00ec8fe4e99681c8f6" + integrity sha512-NRQpfHrJ1msCHtKjbzs9YcMmJZOg6mQMmGRB+hbamEdG5PNpaSm95275VD92DvJKuyl0s2sFiDmMZ+EnnvufqA== + dependencies: + "@babel/traverse" "^7.1.0" + "@babel/types" "^7.0.0" + +"@babel/helper-function-name@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.1.0.tgz#a0ceb01685f73355d4360c1247f582bfafc8ff53" + integrity sha512-A95XEoCpb3TO+KZzJ4S/5uW5fNe26DjBGqf1o9ucyLyCmi1dXq/B3c8iaWTfBk3VvetUxl16e8tIrd5teOCfGw== + dependencies: + "@babel/helper-get-function-arity" "^7.0.0" + "@babel/template" "^7.1.0" + "@babel/types" "^7.0.0" + +"@babel/helper-get-function-arity@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0.tgz#83572d4320e2a4657263734113c42868b64e49c3" + integrity sha512-r2DbJeg4svYvt3HOS74U4eWKsUAMRH01Z1ds1zx8KNTPtpTL5JAsdFv8BNyOpVqdFhHkkRDIg5B4AsxmkjAlmQ== + dependencies: + "@babel/types" "^7.0.0" + +"@babel/helper-hoist-variables@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.4.4.tgz#0298b5f25c8c09c53102d52ac4a98f773eb2850a" + integrity sha512-VYk2/H/BnYbZDDg39hr3t2kKyifAm1W6zHRfhx8jGjIHpQEBv9dry7oQ2f3+J703TLu69nYdxsovl0XYfcnK4w== + dependencies: + "@babel/types" "^7.4.4" + +"@babel/helper-member-expression-to-functions@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.0.0.tgz#8cd14b0a0df7ff00f009e7d7a436945f47c7a16f" + integrity sha512-avo+lm/QmZlv27Zsi0xEor2fKcqWG56D5ae9dzklpIaY7cQMK5N8VSpaNVPPagiqmy7LrEjK1IWdGMOqPu5csg== + dependencies: + "@babel/types" "^7.0.0" + +"@babel/helper-module-imports@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.0.0.tgz#96081b7111e486da4d2cd971ad1a4fe216cc2e3d" + integrity sha512-aP/hlLq01DWNEiDg4Jn23i+CXxW/owM4WpDLFUbpjxe4NS3BhLVZQ5i7E0ZrxuQ/vwekIeciyamgB1UIYxxM6A== + dependencies: + "@babel/types" "^7.0.0" + +"@babel/helper-module-transforms@^7.1.0", "@babel/helper-module-transforms@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.4.4.tgz#96115ea42a2f139e619e98ed46df6019b94414b8" + integrity sha512-3Z1yp8TVQf+B4ynN7WoHPKS8EkdTbgAEy0nU0rs/1Kw4pDgmvYH3rz3aI11KgxKCba2cn7N+tqzV1mY2HMN96w== + dependencies: + "@babel/helper-module-imports" "^7.0.0" + "@babel/helper-simple-access" "^7.1.0" + "@babel/helper-split-export-declaration" "^7.4.4" + "@babel/template" "^7.4.4" + "@babel/types" "^7.4.4" + lodash "^4.17.11" + +"@babel/helper-optimise-call-expression@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.0.0.tgz#a2920c5702b073c15de51106200aa8cad20497d5" + integrity sha512-u8nd9NQePYNQV8iPWu/pLLYBqZBa4ZaY1YWRFMuxrid94wKI1QNt67NEZ7GAe5Kc/0LLScbim05xZFWkAdrj9g== + dependencies: + "@babel/types" "^7.0.0" + +"@babel/helper-plugin-utils@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.0.0.tgz#bbb3fbee98661c569034237cc03967ba99b4f250" + integrity sha512-CYAOUCARwExnEixLdB6sDm2dIJ/YgEAKDM1MOeMeZu9Ld/bDgVo8aiWrXwcY7OBh+1Ea2uUcVRcxKk0GJvW7QA== + +"@babel/helper-regex@^7.0.0", "@babel/helper-regex@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/helper-regex/-/helper-regex-7.4.4.tgz#a47e02bc91fb259d2e6727c2a30013e3ac13c4a2" + integrity sha512-Y5nuB/kESmR3tKjU8Nkn1wMGEx1tjJX076HBMeL3XLQCu6vA/YRzuTW0bbb+qRnXvQGn+d6Rx953yffl8vEy7Q== + dependencies: + lodash "^4.17.11" + +"@babel/helper-remap-async-to-generator@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.1.0.tgz#361d80821b6f38da75bd3f0785ece20a88c5fe7f" + integrity sha512-3fOK0L+Fdlg8S5al8u/hWE6vhufGSn0bN09xm2LXMy//REAF8kDCrYoOBKYmA8m5Nom+sV9LyLCwrFynA8/slg== + dependencies: + "@babel/helper-annotate-as-pure" "^7.0.0" + "@babel/helper-wrap-function" "^7.1.0" + "@babel/template" "^7.1.0" + "@babel/traverse" "^7.1.0" + "@babel/types" "^7.0.0" + +"@babel/helper-replace-supers@^7.1.0", "@babel/helper-replace-supers@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.4.4.tgz#aee41783ebe4f2d3ab3ae775e1cc6f1a90cefa27" + integrity sha512-04xGEnd+s01nY1l15EuMS1rfKktNF+1CkKmHoErDppjAAZL+IUBZpzT748x262HF7fibaQPhbvWUl5HeSt1EXg== + dependencies: + "@babel/helper-member-expression-to-functions" "^7.0.0" + "@babel/helper-optimise-call-expression" "^7.0.0" + "@babel/traverse" "^7.4.4" + "@babel/types" "^7.4.4" + +"@babel/helper-simple-access@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.1.0.tgz#65eeb954c8c245beaa4e859da6188f39d71e585c" + integrity sha512-Vk+78hNjRbsiu49zAPALxTb+JUQCz1aolpd8osOF16BGnLtseD21nbHgLPGUwrXEurZgiCOUmvs3ExTu4F5x6w== + dependencies: + "@babel/template" "^7.1.0" + "@babel/types" "^7.0.0" + +"@babel/helper-split-export-declaration@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.4.4.tgz#ff94894a340be78f53f06af038b205c49d993677" + integrity sha512-Ro/XkzLf3JFITkW6b+hNxzZ1n5OQ80NvIUdmHspih1XAhtN3vPTuUFT4eQnela+2MaZ5ulH+iyP513KJrxbN7Q== + dependencies: + "@babel/types" "^7.4.4" + +"@babel/helper-wrap-function@^7.1.0", "@babel/helper-wrap-function@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.2.0.tgz#c4e0012445769e2815b55296ead43a958549f6fa" + integrity sha512-o9fP1BZLLSrYlxYEYyl2aS+Flun5gtjTIG8iln+XuEzQTs0PLagAGSXUcqruJwD5fM48jzIEggCKpIfWTcR7pQ== + dependencies: + "@babel/helper-function-name" "^7.1.0" + "@babel/template" "^7.1.0" + "@babel/traverse" "^7.1.0" + "@babel/types" "^7.2.0" + +"@babel/helpers@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.4.4.tgz#868b0ef59c1dd4e78744562d5ce1b59c89f2f2a5" + integrity sha512-igczbR/0SeuPR8RFfC7tGrbdTbFL3QTvH6D+Z6zNxnTe//GyqmtHmDkzrqDmyZ3eSwPqB/LhyKoU5DXsp+Vp2A== + dependencies: + "@babel/template" "^7.4.4" + "@babel/traverse" "^7.4.4" + "@babel/types" "^7.4.4" + +"@babel/highlight@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0.tgz#f710c38c8d458e6dd9a201afb637fcb781ce99e4" + integrity sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw== + dependencies: + chalk "^2.0.0" + esutils "^2.0.2" + js-tokens "^4.0.0" + +"@babel/parser@7.1.3": + version "7.1.3" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.1.3.tgz#2c92469bac2b7fbff810b67fca07bd138b48af77" + integrity sha512-gqmspPZOMW3MIRb9HlrnbZHXI1/KHTOroBwN1NcLL6pWxzqzEKGvRTq0W/PxS45OtQGbaFikSQpkS5zbnsQm2w== + +"@babel/parser@^7.1.0", "@babel/parser@^7.4.3", "@babel/parser@^7.4.4", "@babel/parser@^7.4.5": + version "7.4.5" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.4.5.tgz#04af8d5d5a2b044a2a1bffacc1e5e6673544e872" + integrity sha512-9mUqkL1FF5T7f0WDFfAoDdiMVPWsdD1gZYzSnaXsxUCUqzuch/8of9G3VUSNiZmMBoRxT3neyVsqeiL/ZPcjew== + +"@babel/plugin-proposal-async-generator-functions@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.2.0.tgz#b289b306669dce4ad20b0252889a15768c9d417e" + integrity sha512-+Dfo/SCQqrwx48ptLVGLdE39YtWRuKc/Y9I5Fy0P1DDBB9lsAHpjcEJQt+4IifuSOSTLBKJObJqMvaO1pIE8LQ== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-remap-async-to-generator" "^7.1.0" + "@babel/plugin-syntax-async-generators" "^7.2.0" + +"@babel/plugin-proposal-class-properties@^7.1.0": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.4.4.tgz#93a6486eed86d53452ab9bab35e368e9461198ce" + integrity sha512-WjKTI8g8d5w1Bc9zgwSz2nfrsNQsXcCf9J9cdCvrJV6RF56yztwm4TmJC0MgJ9tvwO9gUA/mcYe89bLdGfiXFg== + dependencies: + "@babel/helper-create-class-features-plugin" "^7.4.4" + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-proposal-decorators@^7.1.2": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-decorators/-/plugin-proposal-decorators-7.4.4.tgz#de9b2a1a8ab0196f378e2a82f10b6e2a36f21cc0" + integrity sha512-z7MpQz3XC/iQJWXH9y+MaWcLPNSMY9RQSthrLzak8R8hCj0fuyNk+Dzi9kfNe/JxxlWQ2g7wkABbgWjW36MTcw== + dependencies: + "@babel/helper-create-class-features-plugin" "^7.4.4" + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-syntax-decorators" "^7.2.0" + +"@babel/plugin-proposal-do-expressions@^7.0.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-do-expressions/-/plugin-proposal-do-expressions-7.2.0.tgz#7abf56d27125f2b040c9cb0ab03119cf117128a9" + integrity sha512-2bWN48zQHf/W5T8XvemGQJSi8hzhIo7y4kv/RiA08UcMLQ73lkTknhlaFGf1HjCJzG8FGopgsq6pSe1C+10fPg== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-syntax-do-expressions" "^7.2.0" + +"@babel/plugin-proposal-export-default-from@^7.0.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-export-default-from/-/plugin-proposal-export-default-from-7.2.0.tgz#737b0da44b9254b6152fe29bb99c64e5691f6f68" + integrity sha512-NVfNe7F6nsasG1FnvcFxh2FN0l04ZNe75qTOAVOILWPam0tw9a63RtT/Dab8dPjedZa4fTQaQ83yMMywF9OSug== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-syntax-export-default-from" "^7.2.0" + +"@babel/plugin-proposal-export-namespace-from@^7.0.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.2.0.tgz#308fd4d04ff257fc3e4be090550840eeabad5dd9" + integrity sha512-DZUxbHYxQ5fUFIkMEnh75ogEdBLPfL+mQUqrO2hNY2LGm+tqFnxE924+mhAcCOh/8za8AaZsWHbq6bBoS3TAzA== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-syntax-export-namespace-from" "^7.2.0" + +"@babel/plugin-proposal-function-bind@^7.0.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-function-bind/-/plugin-proposal-function-bind-7.2.0.tgz#94dc2cdc505cafc4e225c0014335a01648056bf7" + integrity sha512-qOFJ/eX1Is78sywwTxDcsntLOdb5ZlHVVqUz5xznq8ldAfOVIyZzp1JE2rzHnaksZIhrqMrwIpQL/qcEprnVbw== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-syntax-function-bind" "^7.2.0" + +"@babel/plugin-proposal-function-sent@^7.1.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-function-sent/-/plugin-proposal-function-sent-7.2.0.tgz#f707d78551f49162e152d477fba32357341915d1" + integrity sha512-qQBDKRSCu1wGJi3jbngs18vrujVQA4F+OkSuIQYRhE6y19jcPzeEIGOc683mCQXDUR3BQCz8JyCupIwv+IRFmA== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-wrap-function" "^7.2.0" + "@babel/plugin-syntax-function-sent" "^7.2.0" + +"@babel/plugin-proposal-json-strings@^7.0.0", "@babel/plugin-proposal-json-strings@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.2.0.tgz#568ecc446c6148ae6b267f02551130891e29f317" + integrity sha512-MAFV1CA/YVmYwZG0fBQyXhmj0BHCB5egZHCKWIFVv/XCxAeVGIHfos3SwDck4LvCllENIAg7xMKOG5kH0dzyUg== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-syntax-json-strings" "^7.2.0" + +"@babel/plugin-proposal-logical-assignment-operators@^7.0.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.2.0.tgz#8a5cea6c42a7c87446959e02fff5fad012c56f57" + integrity sha512-0w797xwdPXKk0m3Js74hDi0mCTZplIu93MOSfb1ZLd/XFe3abWypx1QknVk0J+ohnsjYpvjH4Gwfo2i3RicB6Q== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-syntax-logical-assignment-operators" "^7.2.0" + +"@babel/plugin-proposal-nullish-coalescing-operator@^7.0.0": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.4.4.tgz#41c360d59481d88e0ce3a3f837df10121a769b39" + integrity sha512-Amph7Epui1Dh/xxUxS2+K22/MUi6+6JVTvy3P58tja3B6yKTSjwwx0/d83rF7551D6PVSSoplQb8GCwqec7HRw== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-syntax-nullish-coalescing-operator" "^7.2.0" + +"@babel/plugin-proposal-numeric-separator@^7.0.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.2.0.tgz#646854daf4cd22fd6733f6076013a936310443ac" + integrity sha512-DohMOGDrZiMKS7LthjUZNNcWl8TAf5BZDwZAH4wpm55FuJTHgfqPGdibg7rZDmont/8Yg0zA03IgT6XLeP+4sg== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-syntax-numeric-separator" "^7.2.0" + +"@babel/plugin-proposal-object-rest-spread@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.4.4.tgz#1ef173fcf24b3e2df92a678f027673b55e7e3005" + integrity sha512-dMBG6cSPBbHeEBdFXeQ2QLc5gUpg4Vkaz8octD4aoW/ISO+jBOcsuxYL7bsb5WSu8RLP6boxrBIALEHgoHtO9g== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-syntax-object-rest-spread" "^7.2.0" + +"@babel/plugin-proposal-optional-catch-binding@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.2.0.tgz#135d81edb68a081e55e56ec48541ece8065c38f5" + integrity sha512-mgYj3jCcxug6KUcX4OBoOJz3CMrwRfQELPQ5560F70YQUBZB7uac9fqaWamKR1iWUzGiK2t0ygzjTScZnVz75g== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-syntax-optional-catch-binding" "^7.2.0" + +"@babel/plugin-proposal-optional-chaining@^7.0.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.2.0.tgz#ae454f4c21c6c2ce8cb2397dc332ae8b420c5441" + integrity sha512-ea3Q6edZC/55wEBVZAEz42v528VulyO0eir+7uky/sT4XRcdkWJcFi1aPtitTlwUzGnECWJNExWww1SStt+yWw== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-syntax-optional-chaining" "^7.2.0" + +"@babel/plugin-proposal-pipeline-operator@^7.0.0": + version "7.3.2" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-pipeline-operator/-/plugin-proposal-pipeline-operator-7.3.2.tgz#cc6be43c8455422f2faca39b9355558f0bff5a3f" + integrity sha512-wuzx8U/KZLJYoqU6joiaKY0PixHuYZ3Vxys+wPahNAZEEm+EDb1eTc19DuJob3BdxYSD9PWPbwyoRbhkdoYErg== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-syntax-pipeline-operator" "^7.3.0" + +"@babel/plugin-proposal-throw-expressions@^7.0.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-throw-expressions/-/plugin-proposal-throw-expressions-7.2.0.tgz#2d9e452d370f139000e51db65d0a85dc60c64739" + integrity sha512-adsydM8DQF4i5DLNO4ySAU5VtHTPewOtNBV3u7F4lNMPADFF9bWQ+iDtUUe8+033cYCUz+bFlQdXQJmJOwoLpw== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-syntax-throw-expressions" "^7.2.0" + +"@babel/plugin-proposal-unicode-property-regex@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.4.4.tgz#501ffd9826c0b91da22690720722ac7cb1ca9c78" + integrity sha512-j1NwnOqMG9mFUOH58JTFsA/+ZYzQLUZ/drqWUqxCYLGeu2JFZL8YrNC9hBxKmWtAuOCHPcRpgv7fhap09Fb4kA== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-regex" "^7.4.4" + regexpu-core "^4.5.4" + +"@babel/plugin-syntax-async-generators@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.2.0.tgz#69e1f0db34c6f5a0cf7e2b3323bf159a76c8cb7f" + integrity sha512-1ZrIRBv2t0GSlcwVoQ6VgSLpLgiN/FVQUzt9znxo7v2Ov4jJrs8RY8tv0wvDmFN3qIdMKWrmMMW6yZ0G19MfGg== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-syntax-decorators@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-decorators/-/plugin-syntax-decorators-7.2.0.tgz#c50b1b957dcc69e4b1127b65e1c33eef61570c1b" + integrity sha512-38QdqVoXdHUQfTpZo3rQwqQdWtCn5tMv4uV6r2RMfTqNBuv4ZBhz79SfaQWKTVmxHjeFv/DnXVC/+agHCklYWA== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-syntax-do-expressions@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-do-expressions/-/plugin-syntax-do-expressions-7.2.0.tgz#f3d4b01be05ecde2892086d7cfd5f1fa1ead5a2a" + integrity sha512-/u4rJ+XEmZkIhspVuKRS+7WLvm7Dky9j9TvGK5IgId8B3FKir9MG+nQxDZ9xLn10QMBvW58dZ6ABe2juSmARjg== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-syntax-dynamic-import@^7.0.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.2.0.tgz#69c159ffaf4998122161ad8ebc5e6d1f55df8612" + integrity sha512-mVxuJ0YroI/h/tbFTPGZR8cv6ai+STMKNBq0f8hFxsxWjl94qqhsb+wXbpNMDPU3cfR1TIsVFzU3nXyZMqyK4w== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-syntax-export-default-from@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-export-default-from/-/plugin-syntax-export-default-from-7.2.0.tgz#edd83b7adc2e0d059e2467ca96c650ab6d2f3820" + integrity sha512-c7nqUnNST97BWPtoe+Ssi+fJukc9P9/JMZ71IOMNQWza2E+Psrd46N6AEvtw6pqK+gt7ChjXyrw4SPDO79f3Lw== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-syntax-export-namespace-from@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.2.0.tgz#8d257838c6b3b779db52c0224443459bd27fb039" + integrity sha512-1zGA3UNch6A+A11nIzBVEaE3DDJbjfB+eLIcf0GGOh/BJr/8NxL3546MGhV/r0RhH4xADFIEso39TKCfEMlsGA== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-syntax-flow@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-flow/-/plugin-syntax-flow-7.2.0.tgz#a765f061f803bc48f240c26f8747faf97c26bf7c" + integrity sha512-r6YMuZDWLtLlu0kqIim5o/3TNRAlWb073HwT3e2nKf9I8IIvOggPrnILYPsrrKilmn/mYEMCf/Z07w3yQJF6dg== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-syntax-function-bind@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-function-bind/-/plugin-syntax-function-bind-7.2.0.tgz#68fe85b0c0da67125f87bf239c68051b06c66309" + integrity sha512-/WzU1lLU2l0wDfB42Wkg6tahrmtBbiD8C4H6EGSX0M4GAjzN6JiOpq/Uh8G6GSoR6lPMvhjM0MNiV6znj6y/zg== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-syntax-function-sent@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-function-sent/-/plugin-syntax-function-sent-7.2.0.tgz#91474d4d400604e4c6cbd4d77cd6cb3b8565576c" + integrity sha512-2MOVuJ6IMAifp2cf0RFkHQaOvHpbBYyWCvgtF/WVqXhTd7Bgtov8iXVCadLXp2FN1BrI2EFl+JXuwXy0qr3KoQ== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-syntax-import-meta@^7.0.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.2.0.tgz#2333ef4b875553a3bcd1e93f8ebc09f5b9213a40" + integrity sha512-Hq6kFSZD7+PHkmBN8bCpHR6J8QEoCuEV/B38AIQscYjgMZkGlXB7cHNFzP5jR4RCh5545yP1ujHdmO7hAgKtBA== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-syntax-json-strings@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.2.0.tgz#72bd13f6ffe1d25938129d2a186b11fd62951470" + integrity sha512-5UGYnMSLRE1dqqZwug+1LISpA403HzlSfsg6P9VXU6TBjcSHeNlw4DxDx7LgpF+iKZoOG/+uzqoRHTdcUpiZNg== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-syntax-jsx@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.2.0.tgz#0b85a3b4bc7cdf4cc4b8bf236335b907ca22e7c7" + integrity sha512-VyN4QANJkRW6lDBmENzRszvZf3/4AXaj9YR7GwrWeeN9tEBPuXbmDYVU9bYBN0D70zCWVwUy0HWq2553VCb6Hw== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-syntax-logical-assignment-operators@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.2.0.tgz#fcab7388530e96c6f277ce494c55caa6c141fcfb" + integrity sha512-l/NKSlrnvd73/EL540t9hZhcSo4TULBrIPs9Palju8Oc/A8DXDO+xQf04whfeuZLpi8AuIvCAdpKmmubLN4EfQ== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-syntax-nullish-coalescing-operator@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.2.0.tgz#f75083dfd5ade73e783db729bbd87e7b9efb7624" + integrity sha512-lRCEaKE+LTxDQtgbYajI04ddt6WW0WJq57xqkAZ+s11h4YgfRHhVA/Y2VhfPzzFD4qeLHWg32DMp9HooY4Kqlg== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-syntax-numeric-separator@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.2.0.tgz#7470fe070c2944469a756752a69a6963135018be" + integrity sha512-DroeVNkO/BnGpL2R7+ZNZqW+E24aR/4YWxP3Qb15d6lPU8KDzF8HlIUIRCOJRn4X77/oyW4mJY+7FHfY82NLtQ== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-syntax-object-rest-spread@^7.0.0", "@babel/plugin-syntax-object-rest-spread@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.2.0.tgz#3b7a3e733510c57e820b9142a6579ac8b0dfad2e" + integrity sha512-t0JKGgqk2We+9may3t0xDdmneaXmyxq0xieYcKHxIsrJO64n1OiMWNUtc5gQK1PA0NpdCRrtZp4z+IUaKugrSA== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-syntax-optional-catch-binding@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.2.0.tgz#a94013d6eda8908dfe6a477e7f9eda85656ecf5c" + integrity sha512-bDe4xKNhb0LI7IvZHiA13kff0KEfaGX/Hv4lMA9+7TEc63hMNvfKo6ZFpXhKuEp+II/q35Gc4NoMeDZyaUbj9w== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-syntax-optional-chaining@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.2.0.tgz#a59d6ae8c167e7608eaa443fda9fa8fa6bf21dff" + integrity sha512-HtGCtvp5Uq/jH/WNUPkK6b7rufnCPLLlDAFN7cmACoIjaOOiXxUt3SswU5loHqrhtqTsa/WoLQ1OQ1AGuZqaWA== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-syntax-pipeline-operator@^7.3.0": + version "7.3.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-pipeline-operator/-/plugin-syntax-pipeline-operator-7.3.0.tgz#06146d1cd0da3bb5f8354f9ec17f13e007182709" + integrity sha512-LAa3ZcOAyfPOUDTp0W5EiXGSAFh1vz9sD8yY7sZzWzEkZdIC404pqBP60Yfu9GJDj0ggh+UTQY6EYlIDXVr0/Q== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-syntax-throw-expressions@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-throw-expressions/-/plugin-syntax-throw-expressions-7.2.0.tgz#79001ee2afe1b174b1733cdc2fc69c9a46a0f1f8" + integrity sha512-ngwynuqu1Rx0JUS9zxSDuPgW1K8TyVZCi2hHehrL4vyjqE7RGoNHWlZsS7KQT2vw9Yjk4YLa0+KldBXTRdPLRg== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-arrow-functions@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.2.0.tgz#9aeafbe4d6ffc6563bf8f8372091628f00779550" + integrity sha512-ER77Cax1+8/8jCB9fo4Ud161OZzWN5qawi4GusDuRLcDbDG+bIGYY20zb2dfAFdTRGzrfq2xZPvF0R64EHnimg== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-async-to-generator@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.4.4.tgz#a3f1d01f2f21cadab20b33a82133116f14fb5894" + integrity sha512-YiqW2Li8TXmzgbXw+STsSqPBPFnGviiaSp6CYOq55X8GQ2SGVLrXB6pNid8HkqkZAzOH6knbai3snhP7v0fNwA== + dependencies: + "@babel/helper-module-imports" "^7.0.0" + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-remap-async-to-generator" "^7.1.0" + +"@babel/plugin-transform-block-scoped-functions@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.2.0.tgz#5d3cc11e8d5ddd752aa64c9148d0db6cb79fd190" + integrity sha512-ntQPR6q1/NKuphly49+QiQiTN0O63uOwjdD6dhIjSWBI5xlrbUFh720TIpzBhpnrLfv2tNH/BXvLIab1+BAI0w== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-block-scoping@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.4.4.tgz#c13279fabf6b916661531841a23c4b7dae29646d" + integrity sha512-jkTUyWZcTrwxu5DD4rWz6rDB5Cjdmgz6z7M7RLXOJyCUkFBawssDGcGh8M/0FTSB87avyJI1HsTwUXp9nKA1PA== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + lodash "^4.17.11" + +"@babel/plugin-transform-classes@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.4.4.tgz#0ce4094cdafd709721076d3b9c38ad31ca715eb6" + integrity sha512-/e44eFLImEGIpL9qPxSRat13I5QNRgBLu2hOQJCF7VLy/otSM/sypV1+XaIw5+502RX/+6YaSAPmldk+nhHDPw== + dependencies: + "@babel/helper-annotate-as-pure" "^7.0.0" + "@babel/helper-define-map" "^7.4.4" + "@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.4" + "@babel/helper-split-export-declaration" "^7.4.4" + globals "^11.1.0" + +"@babel/plugin-transform-computed-properties@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.2.0.tgz#83a7df6a658865b1c8f641d510c6f3af220216da" + integrity sha512-kP/drqTxY6Xt3NNpKiMomfgkNn4o7+vKxK2DDKcBG9sHj51vHqMBGy8wbDS/J4lMxnqs153/T3+DmCEAkC5cpA== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-destructuring@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.4.4.tgz#9d964717829cc9e4b601fc82a26a71a4d8faf20f" + integrity sha512-/aOx+nW0w8eHiEHm+BTERB2oJn5D127iye/SUQl7NjHy0lf+j7h4MKMMSOwdazGq9OxgiNADncE+SRJkCxjZpQ== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-dotall-regex@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.4.4.tgz#361a148bc951444312c69446d76ed1ea8e4450c3" + integrity sha512-P05YEhRc2h53lZDjRPk/OektxCVevFzZs2Gfjd545Wde3k+yFDbXORgl2e0xpbq8mLcKJ7Idss4fAg0zORN/zg== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-regex" "^7.4.4" + regexpu-core "^4.5.4" + +"@babel/plugin-transform-duplicate-keys@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.2.0.tgz#d952c4930f312a4dbfff18f0b2914e60c35530b3" + integrity sha512-q+yuxW4DsTjNceUiTzK0L+AfQ0zD9rWaTLiUqHA8p0gxx7lu1EylenfzjeIWNkPy6e/0VG/Wjw9uf9LueQwLOw== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-exponentiation-operator@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.2.0.tgz#a63868289e5b4007f7054d46491af51435766008" + integrity sha512-umh4hR6N7mu4Elq9GG8TOu9M0bakvlsREEC+ialrQN6ABS4oDQ69qJv1VtR3uxlKMCQMCvzk7vr17RHKcjx68A== + dependencies: + "@babel/helper-builder-binary-assignment-operator-visitor" "^7.1.0" + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-flow-strip-types@^7.0.0": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-flow-strip-types/-/plugin-transform-flow-strip-types-7.4.4.tgz#d267a081f49a8705fc9146de0768c6b58dccd8f7" + integrity sha512-WyVedfeEIILYEaWGAUWzVNyqG4sfsNooMhXWsu/YzOvVGcsnPb5PguysjJqI3t3qiaYj0BR8T2f5njdjTGe44Q== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-syntax-flow" "^7.2.0" + +"@babel/plugin-transform-for-of@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.4.4.tgz#0267fc735e24c808ba173866c6c4d1440fc3c556" + integrity sha512-9T/5Dlr14Z9TIEXLXkt8T1DU7F24cbhwhMNUziN3hB1AXoZcdzPcTiKGRn/6iOymDqtTKWnr/BtRKN9JwbKtdQ== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-function-name@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.4.4.tgz#e1436116abb0610c2259094848754ac5230922ad" + integrity sha512-iU9pv7U+2jC9ANQkKeNF6DrPy4GBa4NWQtl6dHB4Pb3izX2JOEvDTFarlNsBj/63ZEzNNIAMs3Qw4fNCcSOXJA== + dependencies: + "@babel/helper-function-name" "^7.1.0" + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-literals@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.2.0.tgz#690353e81f9267dad4fd8cfd77eafa86aba53ea1" + integrity sha512-2ThDhm4lI4oV7fVQ6pNNK+sx+c/GM5/SaML0w/r4ZB7sAneD/piDJtwdKlNckXeyGK7wlwg2E2w33C/Hh+VFCg== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-member-expression-literals@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.2.0.tgz#fa10aa5c58a2cb6afcf2c9ffa8cb4d8b3d489a2d" + integrity sha512-HiU3zKkSU6scTidmnFJ0bMX8hz5ixC93b4MHMiYebmk2lUVNGOboPsqQvx5LzooihijUoLR/v7Nc1rbBtnc7FA== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-modules-amd@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.2.0.tgz#82a9bce45b95441f617a24011dc89d12da7f4ee6" + integrity sha512-mK2A8ucqz1qhrdqjS9VMIDfIvvT2thrEsIQzbaTdc5QFzhDjQv2CkJJ5f6BXIkgbmaoax3zBr2RyvV/8zeoUZw== + dependencies: + "@babel/helper-module-transforms" "^7.1.0" + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-modules-commonjs@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.4.4.tgz#0bef4713d30f1d78c2e59b3d6db40e60192cac1e" + integrity sha512-4sfBOJt58sEo9a2BQXnZq+Q3ZTSAUXyK3E30o36BOGnJ+tvJ6YSxF0PG6kERvbeISgProodWuI9UVG3/FMY6iw== + dependencies: + "@babel/helper-module-transforms" "^7.4.4" + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-simple-access" "^7.1.0" + +"@babel/plugin-transform-modules-systemjs@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.4.4.tgz#dc83c5665b07d6c2a7b224c00ac63659ea36a405" + integrity sha512-MSiModfILQc3/oqnG7NrP1jHaSPryO6tA2kOMmAQApz5dayPxWiHqmq4sWH2xF5LcQK56LlbKByCd8Aah/OIkQ== + dependencies: + "@babel/helper-hoist-variables" "^7.4.4" + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-modules-umd@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.2.0.tgz#7678ce75169f0877b8eb2235538c074268dd01ae" + integrity sha512-BV3bw6MyUH1iIsGhXlOK6sXhmSarZjtJ/vMiD9dNmpY8QXFFQTj+6v92pcfy1iqa8DeAfJFwoxcrS/TUZda6sw== + dependencies: + "@babel/helper-module-transforms" "^7.1.0" + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-named-capturing-groups-regex@^7.4.5": + version "7.4.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.4.5.tgz#9d269fd28a370258199b4294736813a60bbdd106" + integrity sha512-z7+2IsWafTBbjNsOxU/Iv5CvTJlr5w4+HGu1HovKYTtgJ362f7kBcQglkfmlspKKZ3bgrbSGvLfNx++ZJgCWsg== + dependencies: + regexp-tree "^0.1.6" + +"@babel/plugin-transform-new-target@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.4.4.tgz#18d120438b0cc9ee95a47f2c72bc9768fbed60a5" + integrity sha512-r1z3T2DNGQwwe2vPGZMBNjioT2scgWzK9BCnDEh+46z8EEwXBq24uRzd65I7pjtugzPSj921aM15RpESgzsSuA== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-object-super@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.2.0.tgz#b35d4c10f56bab5d650047dad0f1d8e8814b6598" + integrity sha512-VMyhPYZISFZAqAPVkiYb7dUe2AsVi2/wCT5+wZdsNO31FojQJa9ns40hzZ6U9f50Jlq4w6qwzdBB2uwqZ00ebg== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-replace-supers" "^7.1.0" + +"@babel/plugin-transform-parameters@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.4.4.tgz#7556cf03f318bd2719fe4c922d2d808be5571e16" + integrity sha512-oMh5DUO1V63nZcu/ZVLQFqiihBGo4OpxJxR1otF50GMeCLiRx5nUdtokd+u9SuVJrvvuIh9OosRFPP4pIPnwmw== + dependencies: + "@babel/helper-call-delegate" "^7.4.4" + "@babel/helper-get-function-arity" "^7.0.0" + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-property-literals@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.2.0.tgz#03e33f653f5b25c4eb572c98b9485055b389e905" + integrity sha512-9q7Dbk4RhgcLp8ebduOpCbtjh7C0itoLYHXd9ueASKAG/is5PQtMR5VJGka9NKqGhYEGn5ITahd4h9QeBMylWQ== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-react-display-name@^7.0.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-display-name/-/plugin-transform-react-display-name-7.2.0.tgz#ebfaed87834ce8dc4279609a4f0c324c156e3eb0" + integrity sha512-Htf/tPa5haZvRMiNSQSFifK12gtr/8vwfr+A9y69uF0QcU77AVu4K7MiHEkTxF7lQoHOL0F9ErqgfNEAKgXj7A== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-react-jsx-self@^7.0.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.2.0.tgz#461e21ad9478f1031dd5e276108d027f1b5240ba" + integrity sha512-v6S5L/myicZEy+jr6ielB0OR8h+EH/1QFx/YJ7c7Ua+7lqsjj/vW6fD5FR9hB/6y7mGbfT4vAURn3xqBxsUcdg== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-syntax-jsx" "^7.2.0" + +"@babel/plugin-transform-react-jsx-source@^7.0.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.2.0.tgz#20c8c60f0140f5dd3cd63418d452801cf3f7180f" + integrity sha512-A32OkKTp4i5U6aE88GwwcuV4HAprUgHcTq0sSafLxjr6AW0QahrCRCjxogkbbcdtpbXkuTOlgpjophCxb6sh5g== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-syntax-jsx" "^7.2.0" + +"@babel/plugin-transform-react-jsx@^7.0.0": + version "7.3.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.3.0.tgz#f2cab99026631c767e2745a5368b331cfe8f5290" + integrity sha512-a/+aRb7R06WcKvQLOu4/TpjKOdvVEKRLWFpKcNuHhiREPgGRB4TQJxq07+EZLS8LFVYpfq1a5lDUnuMdcCpBKg== + dependencies: + "@babel/helper-builder-react-jsx" "^7.3.0" + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-syntax-jsx" "^7.2.0" + +"@babel/plugin-transform-regenerator@^7.4.5": + version "7.4.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.4.5.tgz#629dc82512c55cee01341fb27bdfcb210354680f" + integrity sha512-gBKRh5qAaCWntnd09S8QC7r3auLCqq5DI6O0DlfoyDjslSBVqBibrMdsqO+Uhmx3+BlOmE/Kw1HFxmGbv0N9dA== + dependencies: + regenerator-transform "^0.14.0" + +"@babel/plugin-transform-reserved-words@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.2.0.tgz#4792af87c998a49367597d07fedf02636d2e1634" + integrity sha512-fz43fqW8E1tAB3DKF19/vxbpib1fuyCwSPE418ge5ZxILnBhWyhtPgz8eh1RCGGJlwvksHkyxMxh0eenFi+kFw== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-shorthand-properties@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.2.0.tgz#6333aee2f8d6ee7e28615457298934a3b46198f0" + integrity sha512-QP4eUM83ha9zmYtpbnyjTLAGKQritA5XW/iG9cjtuOI8s1RuL/3V6a3DeSHfKutJQ+ayUfeZJPcnCYEQzaPQqg== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-spread@^7.2.0": + version "7.2.2" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.2.2.tgz#3103a9abe22f742b6d406ecd3cd49b774919b406" + integrity sha512-KWfky/58vubwtS0hLqEnrWJjsMGaOeSBn90Ezn5Jeg9Z8KKHmELbP1yGylMlm5N6TPKeY9A2+UaSYLdxahg01w== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-sticky-regex@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.2.0.tgz#a1e454b5995560a9c1e0d537dfc15061fd2687e1" + integrity sha512-KKYCoGaRAf+ckH8gEL3JHUaFVyNHKe3ASNsZ+AlktgHevvxGigoIttrEJb8iKN03Q7Eazlv1s6cx2B2cQ3Jabw== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-regex" "^7.0.0" + +"@babel/plugin-transform-template-literals@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.4.4.tgz#9d28fea7bbce637fb7612a0750989d8321d4bcb0" + integrity sha512-mQrEC4TWkhLN0z8ygIvEL9ZEToPhG5K7KDW3pzGqOfIGZ28Jb0POUkeWcoz8HnHvhFy6dwAT1j8OzqN8s804+g== + dependencies: + "@babel/helper-annotate-as-pure" "^7.0.0" + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-typeof-symbol@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.2.0.tgz#117d2bcec2fbf64b4b59d1f9819894682d29f2b2" + integrity sha512-2LNhETWYxiYysBtrBTqL8+La0jIoQQnIScUJc74OYvUGRmkskNY4EzLCnjHBzdmb38wqtTaixpo1NctEcvMDZw== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-unicode-regex@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.4.4.tgz#ab4634bb4f14d36728bf5978322b35587787970f" + integrity sha512-il+/XdNw01i93+M9J9u4T7/e/Ue/vWfNZE4IRUQjplu2Mqb/AFTDimkw2tdEdSH50wuQXZAbXSql0UphQke+vA== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-regex" "^7.4.4" + regexpu-core "^4.5.4" + +"@babel/preset-env@^7.1.0": + version "7.4.5" + resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.4.5.tgz#2fad7f62983d5af563b5f3139242755884998a58" + integrity sha512-f2yNVXM+FsR5V8UwcFeIHzHWgnhXg3NpRmy0ADvALpnhB0SLbCvrCRr4BLOUYbQNLS+Z0Yer46x9dJXpXewI7w== + dependencies: + "@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.4" + "@babel/plugin-proposal-optional-catch-binding" "^7.2.0" + "@babel/plugin-proposal-unicode-property-regex" "^7.4.4" + "@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.4" + "@babel/plugin-transform-block-scoped-functions" "^7.2.0" + "@babel/plugin-transform-block-scoping" "^7.4.4" + "@babel/plugin-transform-classes" "^7.4.4" + "@babel/plugin-transform-computed-properties" "^7.2.0" + "@babel/plugin-transform-destructuring" "^7.4.4" + "@babel/plugin-transform-dotall-regex" "^7.4.4" + "@babel/plugin-transform-duplicate-keys" "^7.2.0" + "@babel/plugin-transform-exponentiation-operator" "^7.2.0" + "@babel/plugin-transform-for-of" "^7.4.4" + "@babel/plugin-transform-function-name" "^7.4.4" + "@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.4.4" + "@babel/plugin-transform-modules-systemjs" "^7.4.4" + "@babel/plugin-transform-modules-umd" "^7.2.0" + "@babel/plugin-transform-named-capturing-groups-regex" "^7.4.5" + "@babel/plugin-transform-new-target" "^7.4.4" + "@babel/plugin-transform-object-super" "^7.2.0" + "@babel/plugin-transform-parameters" "^7.4.4" + "@babel/plugin-transform-property-literals" "^7.2.0" + "@babel/plugin-transform-regenerator" "^7.4.5" + "@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.4.4" + "@babel/plugin-transform-typeof-symbol" "^7.2.0" + "@babel/plugin-transform-unicode-regex" "^7.4.4" + "@babel/types" "^7.4.4" + browserslist "^4.6.0" + core-js-compat "^3.1.1" + invariant "^2.2.2" + js-levenshtein "^1.1.3" + semver "^5.5.0" + +"@babel/preset-flow@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/preset-flow/-/preset-flow-7.0.0.tgz#afd764835d9535ec63d8c7d4caf1c06457263da2" + integrity sha512-bJOHrYOPqJZCkPVbG1Lot2r5OSsB+iUOaxiHdlOeB1yPWS6evswVHwvkDLZ54WTaTRIk89ds0iHmGZSnxlPejQ== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-transform-flow-strip-types" "^7.0.0" + +"@babel/preset-react@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/preset-react/-/preset-react-7.0.0.tgz#e86b4b3d99433c7b3e9e91747e2653958bc6b3c0" + integrity sha512-oayxyPS4Zj+hF6Et11BwuBkmpgT/zMxyuZgFrMeZID6Hdh3dGlk4sHCAhdBCpuCKW2ppBfl2uCCetlrUIJRY3w== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-transform-react-display-name" "^7.0.0" + "@babel/plugin-transform-react-jsx" "^7.0.0" + "@babel/plugin-transform-react-jsx-self" "^7.0.0" + "@babel/plugin-transform-react-jsx-source" "^7.0.0" + +"@babel/preset-stage-0@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/preset-stage-0/-/preset-stage-0-7.0.0.tgz#999aaec79ee8f0a763042c68c06539c97c6e0646" + integrity sha512-FBMd0IiARPtH5aaOFUVki6evHiJQiY0pFy7fizyRF7dtwc+el3nwpzvhb9qBNzceG1OIJModG1xpE0DDFjPXwA== + +"@babel/template@^7.1.0", "@babel/template@^7.4.0", "@babel/template@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.4.4.tgz#f4b88d1225689a08f5bc3a17483545be9e4ed237" + integrity sha512-CiGzLN9KgAvgZsnivND7rkA+AeJ9JB0ciPOD4U59GKbQP2iQl+olF1l76kJOupqidozfZ32ghwBEJDhnk9MEcw== + dependencies: + "@babel/code-frame" "^7.0.0" + "@babel/parser" "^7.4.4" + "@babel/types" "^7.4.4" + +"@babel/traverse@^7.1.0", "@babel/traverse@^7.1.4", "@babel/traverse@^7.4.3", "@babel/traverse@^7.4.4", "@babel/traverse@^7.4.5": + version "7.4.5" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.4.5.tgz#4e92d1728fd2f1897dafdd321efbff92156c3216" + integrity sha512-Vc+qjynwkjRmIFGxy0KYoPj4FdVDxLej89kMHFsWScq999uX+pwcX4v9mWRjW0KcAYTPAuVQl2LKP1wEVLsp+A== + dependencies: + "@babel/code-frame" "^7.0.0" + "@babel/generator" "^7.4.4" + "@babel/helper-function-name" "^7.1.0" + "@babel/helper-split-export-declaration" "^7.4.4" + "@babel/parser" "^7.4.5" + "@babel/types" "^7.4.4" + debug "^4.1.0" + globals "^11.1.0" + lodash "^4.17.11" + +"@babel/types@^7.0.0", "@babel/types@^7.1.3", "@babel/types@^7.2.0", "@babel/types@^7.3.0", "@babel/types@^7.4.0", "@babel/types@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.4.4.tgz#8db9e9a629bb7c29370009b4b779ed93fe57d5f0" + integrity sha512-dOllgYdnEFOebhkKCjzSVFqw/PmmB8pH6RGOWkY4GsboQNd47b1fBThBSwlHAq9alF9vc1M3+6oqR47R50L0tQ== + dependencies: + esutils "^2.0.2" + lodash "^4.17.11" + to-fast-properties "^2.0.0" + +"@cnakazawa/watch@^1.0.3": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@cnakazawa/watch/-/watch-1.0.3.tgz#099139eaec7ebf07a27c1786a3ff64f39464d2ef" + integrity sha512-r5160ogAvGyHsal38Kux7YYtodEKOj89RGb28ht1jh3SJb08VwRwAKKJL0bGb04Zd/3r9FL3BFIc3bBidYffCA== + dependencies: + exec-sh "^0.3.2" + minimist "^1.2.0" + +"@jest/console@^24.7.1": + version "24.7.1" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-24.7.1.tgz#32a9e42535a97aedfe037e725bd67e954b459545" + integrity sha512-iNhtIy2M8bXlAOULWVTUxmnelTLFneTNEkHCgPmgd+zNwy9zVddJ6oS5rZ9iwoscNdT5mMwUd0C51v/fSlzItg== + dependencies: + "@jest/source-map" "^24.3.0" + chalk "^2.0.1" + slash "^2.0.0" + +"@jest/core@^24.8.0": + version "24.8.0" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-24.8.0.tgz#fbbdcd42a41d0d39cddbc9f520c8bab0c33eed5b" + integrity sha512-R9rhAJwCBQzaRnrRgAdVfnglUuATXdwTRsYqs6NMdVcAl5euG8LtWDe+fVkN27YfKVBW61IojVsXKaOmSnqd/A== + dependencies: + "@jest/console" "^24.7.1" + "@jest/reporters" "^24.8.0" + "@jest/test-result" "^24.8.0" + "@jest/transform" "^24.8.0" + "@jest/types" "^24.8.0" + ansi-escapes "^3.0.0" + chalk "^2.0.1" + exit "^0.1.2" + graceful-fs "^4.1.15" + jest-changed-files "^24.8.0" + jest-config "^24.8.0" + jest-haste-map "^24.8.0" + jest-message-util "^24.8.0" + jest-regex-util "^24.3.0" + jest-resolve-dependencies "^24.8.0" + jest-runner "^24.8.0" + jest-runtime "^24.8.0" + jest-snapshot "^24.8.0" + jest-util "^24.8.0" + jest-validate "^24.8.0" + jest-watcher "^24.8.0" + micromatch "^3.1.10" + p-each-series "^1.0.0" + pirates "^4.0.1" + realpath-native "^1.1.0" + rimraf "^2.5.4" + strip-ansi "^5.0.0" + +"@jest/environment@^24.8.0": + version "24.8.0" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-24.8.0.tgz#0342261383c776bdd652168f68065ef144af0eac" + integrity sha512-vlGt2HLg7qM+vtBrSkjDxk9K0YtRBi7HfRFaDxoRtyi+DyVChzhF20duvpdAnKVBV6W5tym8jm0U9EfXbDk1tw== + dependencies: + "@jest/fake-timers" "^24.8.0" + "@jest/transform" "^24.8.0" + "@jest/types" "^24.8.0" + jest-mock "^24.8.0" + +"@jest/fake-timers@^24.8.0": + version "24.8.0" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-24.8.0.tgz#2e5b80a4f78f284bcb4bd5714b8e10dd36a8d3d1" + integrity sha512-2M4d5MufVXwi6VzZhJ9f5S/wU4ud2ck0kxPof1Iz3zWx6Y+V2eJrES9jEktB6O3o/oEyk+il/uNu9PvASjWXQw== + dependencies: + "@jest/types" "^24.8.0" + jest-message-util "^24.8.0" + jest-mock "^24.8.0" + +"@jest/reporters@^24.8.0": + version "24.8.0" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-24.8.0.tgz#075169cd029bddec54b8f2c0fc489fd0b9e05729" + integrity sha512-eZ9TyUYpyIIXfYCrw0UHUWUvE35vx5I92HGMgS93Pv7du+GHIzl+/vh8Qj9MCWFK/4TqyttVBPakWMOfZRIfxw== + dependencies: + "@jest/environment" "^24.8.0" + "@jest/test-result" "^24.8.0" + "@jest/transform" "^24.8.0" + "@jest/types" "^24.8.0" + chalk "^2.0.1" + exit "^0.1.2" + glob "^7.1.2" + istanbul-lib-coverage "^2.0.2" + istanbul-lib-instrument "^3.0.1" + istanbul-lib-report "^2.0.4" + istanbul-lib-source-maps "^3.0.1" + istanbul-reports "^2.1.1" + jest-haste-map "^24.8.0" + jest-resolve "^24.8.0" + jest-runtime "^24.8.0" + jest-util "^24.8.0" + jest-worker "^24.6.0" + node-notifier "^5.2.1" + slash "^2.0.0" + source-map "^0.6.0" + string-length "^2.0.0" + +"@jest/source-map@^24.3.0": + version "24.3.0" + resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-24.3.0.tgz#563be3aa4d224caf65ff77edc95cd1ca4da67f28" + integrity sha512-zALZt1t2ou8le/crCeeiRYzvdnTzaIlpOWaet45lNSqNJUnXbppUUFR4ZUAlzgDmKee4Q5P/tKXypI1RiHwgag== + dependencies: + callsites "^3.0.0" + graceful-fs "^4.1.15" + source-map "^0.6.0" + +"@jest/test-result@^24.8.0": + version "24.8.0" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-24.8.0.tgz#7675d0aaf9d2484caa65e048d9b467d160f8e9d3" + integrity sha512-+YdLlxwizlfqkFDh7Mc7ONPQAhA4YylU1s529vVM1rsf67vGZH/2GGm5uO8QzPeVyaVMobCQ7FTxl38QrKRlng== + dependencies: + "@jest/console" "^24.7.1" + "@jest/types" "^24.8.0" + "@types/istanbul-lib-coverage" "^2.0.0" + +"@jest/test-sequencer@^24.8.0": + version "24.8.0" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-24.8.0.tgz#2f993bcf6ef5eb4e65e8233a95a3320248cf994b" + integrity sha512-OzL/2yHyPdCHXEzhoBuq37CE99nkme15eHkAzXRVqthreWZamEMA0WoetwstsQBCXABhczpK03JNbc4L01vvLg== + dependencies: + "@jest/test-result" "^24.8.0" + jest-haste-map "^24.8.0" + jest-runner "^24.8.0" + jest-runtime "^24.8.0" + +"@jest/transform@^24.8.0": + version "24.8.0" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-24.8.0.tgz#628fb99dce4f9d254c6fd9341e3eea262e06fef5" + integrity sha512-xBMfFUP7TortCs0O+Xtez2W7Zu1PLH9bvJgtraN1CDST6LBM/eTOZ9SfwS/lvV8yOfcDpFmwf9bq5cYbXvqsvA== + dependencies: + "@babel/core" "^7.1.0" + "@jest/types" "^24.8.0" + babel-plugin-istanbul "^5.1.0" + chalk "^2.0.1" + convert-source-map "^1.4.0" + fast-json-stable-stringify "^2.0.0" + graceful-fs "^4.1.15" + jest-haste-map "^24.8.0" + jest-regex-util "^24.3.0" + jest-util "^24.8.0" + micromatch "^3.1.10" + realpath-native "^1.1.0" + slash "^2.0.0" + source-map "^0.6.1" + write-file-atomic "2.4.1" + +"@jest/types@^24.8.0": + version "24.8.0" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-24.8.0.tgz#f31e25948c58f0abd8c845ae26fcea1491dea7ad" + integrity sha512-g17UxVr2YfBtaMUxn9u/4+siG1ptg9IGYAYwvpwn61nBg779RXnjE/m7CxYcIzEt0AbHZZAHSEZNhkE2WxURVg== + dependencies: + "@types/istanbul-lib-coverage" "^2.0.0" + "@types/istanbul-reports" "^1.1.1" + "@types/yargs" "^12.0.9" + +"@types/babel__core@^7.1.0": + version "7.1.2" + resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.2.tgz#608c74f55928033fce18b99b213c16be4b3d114f" + integrity sha512-cfCCrFmiGY/yq0NuKNxIQvZFy9kY/1immpSpTngOnyIbD4+eJOG5mxphhHDv3CHL9GltO4GcKr54kGBg3RNdbg== + dependencies: + "@babel/parser" "^7.1.0" + "@babel/types" "^7.0.0" + "@types/babel__generator" "*" + "@types/babel__template" "*" + "@types/babel__traverse" "*" + +"@types/babel__generator@*": + version "7.0.2" + resolved "https://registry.yarnpkg.com/@types/babel__generator/-/babel__generator-7.0.2.tgz#d2112a6b21fad600d7674274293c85dce0cb47fc" + integrity sha512-NHcOfab3Zw4q5sEE2COkpfXjoE7o+PmqD9DQW4koUT3roNxwziUdXGnRndMat/LJNUtePwn1TlP4do3uoe3KZQ== + dependencies: + "@babel/types" "^7.0.0" + +"@types/babel__template@*": + version "7.0.2" + resolved "https://registry.yarnpkg.com/@types/babel__template/-/babel__template-7.0.2.tgz#4ff63d6b52eddac1de7b975a5223ed32ecea9307" + integrity sha512-/K6zCpeW7Imzgab2bLkLEbz0+1JlFSrUMdw7KoIIu+IUdu51GWaBZpd3y1VXGVXzynvGa4DaIaxNZHiON3GXUg== + dependencies: + "@babel/parser" "^7.1.0" + "@babel/types" "^7.0.0" + +"@types/babel__traverse@*", "@types/babel__traverse@^7.0.6": + version "7.0.7" + resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.0.7.tgz#2496e9ff56196cc1429c72034e07eab6121b6f3f" + integrity sha512-CeBpmX1J8kWLcDEnI3Cl2Eo6RfbGvzUctA+CjZUhOKDFbLfcr7fc4usEqLNWetrlJd7RhAkyYe2czXop4fICpw== + dependencies: + "@babel/types" "^7.3.0" + +"@types/base-x@*": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@types/base-x/-/base-x-3.0.0.tgz#a1365259d1d3fa3ff973ab543192a6bdd4cb2f90" + integrity sha512-vnqSlpsv9uFX5/z8GyKWAfWHhLGJDBkrgRRsnxlsX23DHOlNyqP/eHQiv4TwnYcZULzQIxaWA/xRWU9Dyy4qzw== + dependencies: + "@types/node" "*" + +"@types/bn.js@^4.11.5": + version "4.11.5" + resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-4.11.5.tgz#40e36197433f78f807524ec623afcf0169ac81dc" + integrity sha512-AEAZcIZga0JgVMHNtl1CprA/hXX7/wPt79AgR4XqaDt7jyj3QWYw6LPoOiznPtugDmlubUnAahMs2PFxGcQrng== + dependencies: + "@types/node" "*" + +"@types/bs58@^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/@types/bs58/-/bs58-4.0.0.tgz#baec75cb007b419ede3ec6b3410d2c8f14c92fc5" + integrity sha512-gYX+MHD4G/R+YGYwdhG5gbJj4LsEQGr3Vg6gVDAbe7xC5Bn8dNNG2Lpo6uDX/rT5dE7VBj0rGEFuV8L0AEx4Rg== + dependencies: + "@types/base-x" "*" + +"@types/events@*": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@types/events/-/events-3.0.0.tgz#2862f3f58a9a7f7c3e78d79f130dd4d71c25c2a7" + integrity sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g== + +"@types/fs-extra@^5.0.3": + version "5.1.0" + resolved "https://registry.yarnpkg.com/@types/fs-extra/-/fs-extra-5.1.0.tgz#2a325ef97901504a3828718c390d34b8426a10a1" + integrity sha512-AInn5+UBFIK9FK5xc9yP5e3TQSPNNgjHByqYcj9g5elVBnDQcQL7PlO1CIRy2gWlbwK7UPYqi7vRvFA44dCmYQ== + dependencies: + "@types/node" "*" + +"@types/glob@*": + version "7.1.1" + resolved "https://registry.yarnpkg.com/@types/glob/-/glob-7.1.1.tgz#aa59a1c6e3fbc421e07ccd31a944c30eba521575" + integrity sha512-1Bh06cbWJUHMC97acuD6UMG29nMt0Aqz1vF3guLfG+kHHJhy3AyohZFFxYk2f7Q1SQIrNwvncxAE0N/9s70F2w== + dependencies: + "@types/events" "*" + "@types/minimatch" "*" + "@types/node" "*" + +"@types/handlebars@^4.0.38": + version "4.1.0" + resolved "https://registry.yarnpkg.com/@types/handlebars/-/handlebars-4.1.0.tgz#3fcce9bf88f85fe73dc932240ab3fb682c624850" + integrity sha512-gq9YweFKNNB1uFK71eRqsd4niVkXrxHugqWFQkeLRJvGjnxsLr16bYtcsG4tOFwmYi0Bax+wCkbf1reUfdl4kA== + dependencies: + handlebars "*" + +"@types/highlight.js@^9.12.3": + version "9.12.3" + resolved "https://registry.yarnpkg.com/@types/highlight.js/-/highlight.js-9.12.3.tgz#b672cfaac25cbbc634a0fd92c515f66faa18dbca" + integrity sha512-pGF/zvYOACZ/gLGWdQH8zSwteQS1epp68yRcVLJMgUck/MjEn/FBYmPub9pXT8C1e4a8YZfHo1CKyV8q1vKUnQ== + +"@types/http-errors@^1.6.1": + version "1.6.1" + resolved "https://registry.yarnpkg.com/@types/http-errors/-/http-errors-1.6.1.tgz#367744a6c04b833383f497f647cc3690b0cd4055" + integrity sha512-s+RHKSGc3r0m3YEE2UXomJYrpQaY9cDmNDLU2XvG1/LAZsQ7y8emYkTLfcw/ByDtcsTyRQKwr76Bj4PkN2hfWg== + +"@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz#42995b446db9a48a11a07ec083499a860e9138ff" + integrity sha512-hRJD2ahnnpLgsj6KWMYSrmXkM3rm2Dl1qkx6IOFD5FnuNPXJIG5L0dhgKXCYTRMGzU4n0wImQ/xfmRc4POUFlg== + +"@types/istanbul-lib-report@*": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@types/istanbul-lib-report/-/istanbul-lib-report-1.1.1.tgz#e5471e7fa33c61358dd38426189c037a58433b8c" + integrity sha512-3BUTyMzbZa2DtDI2BkERNC6jJw2Mr2Y0oGI7mRxYNBPxppbtEK1F66u3bKwU2g+wxwWI7PAoRpJnOY1grJqzHg== + dependencies: + "@types/istanbul-lib-coverage" "*" + +"@types/istanbul-reports@^1.1.1": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@types/istanbul-reports/-/istanbul-reports-1.1.1.tgz#7a8cbf6a406f36c8add871625b278eaf0b0d255a" + integrity sha512-UpYjBi8xefVChsCoBpKShdxTllC9pwISirfoZsUa2AAdQg/Jd2KQGtSbw+ya7GPo7x/wAPlH6JBhKhAsXUEZNA== + dependencies: + "@types/istanbul-lib-coverage" "*" + "@types/istanbul-lib-report" "*" + +"@types/lodash@^4.14.110": + version "4.14.134" + resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.134.tgz#9032b440122db3a2a56200e91191996161dde5b9" + integrity sha512-2/O0khFUCFeDlbi7sZ7ZFRCcT812fAeOLm7Ev4KbwASkZ575TDrDcY7YyaoHdTOzKcNbfiwLYZqPmoC4wadrsw== + +"@types/marked@^0.4.0": + version "0.4.2" + resolved "https://registry.yarnpkg.com/@types/marked/-/marked-0.4.2.tgz#64a89e53ea37f61cc0f3ee1732c555c2dbf6452f" + integrity sha512-cDB930/7MbzaGF6U3IwSQp6XBru8xWajF5PV2YZZeV8DyiliTuld11afVztGI9+yJZ29il5E+NpGA6ooV/Cjkg== + +"@types/minimatch@*", "@types/minimatch@3.0.3": + version "3.0.3" + resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d" + integrity sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA== + +"@types/node@*": + version "12.0.8" + resolved "https://registry.yarnpkg.com/@types/node/-/node-12.0.8.tgz#551466be11b2adc3f3d47156758f610bd9f6b1d8" + integrity sha512-b8bbUOTwzIY3V5vDTY1fIJ+ePKDUBqt2hC2woVGotdQQhG/2Sh62HOKHrT7ab+VerXAcPyAiTEipPu/FsreUtg== + +"@types/shelljs@^0.8.0": + version "0.8.5" + resolved "https://registry.yarnpkg.com/@types/shelljs/-/shelljs-0.8.5.tgz#1e507b2f6d1f893269bd3e851ec24419ef9beeea" + integrity sha512-bZgjwIWu9gHCjirKJoOlLzGi5N0QgZ5t7EXEuoqyWCHTuSddURXo3FOBYDyRPNOWzZ6NbkLvZnVkn483Y/tvcQ== + dependencies: + "@types/glob" "*" + "@types/node" "*" + +"@types/stack-utils@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-1.0.1.tgz#0a851d3bd96498fa25c33ab7278ed3bd65f06c3e" + integrity sha512-l42BggppR6zLmpfU6fq9HEa2oGPEI8yrSPL3GITjfRInppYFahObbIQOQK3UGxEnyQpltZLaPe75046NOZQikw== + +"@types/unist@^2.0.2": + version "2.0.3" + resolved "https://registry.yarnpkg.com/@types/unist/-/unist-2.0.3.tgz#9c088679876f374eb5983f150d4787aa6fb32d7e" + integrity sha512-FvUupuM3rlRsRtCN+fDudtmytGO6iHJuuRKS1Ss0pG5z8oX0diNEw94UEL7hgDbpN94rgaK5R7sWm6RrSkZuAQ== + +"@types/yargs@^12.0.2", "@types/yargs@^12.0.9": + version "12.0.12" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-12.0.12.tgz#45dd1d0638e8c8f153e87d296907659296873916" + integrity sha512-SOhuU4wNBxhhTHxYaiG5NY4HBhDIDnJF60GU+2LqHAdKKer86//e4yg69aENCtQ04n0ovz+tq2YPME5t5yp4pw== + +JSONStream@^1.0.3: + version "1.3.5" + resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.5.tgz#3208c1f08d3a4d99261ab64f92302bc15e111ca0" + integrity sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ== + dependencies: + jsonparse "^1.2.0" + through ">=2.2.7 <3" + +abab@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.0.tgz#aba0ab4c5eee2d4c79d3487d85450fb2376ebb0f" + integrity sha512-sY5AXXVZv4Y1VACTtR11UJCPHHudgY5i26Qj5TypE6DKlIApbwb5uqhXcJ5UUGbvZNRh7EeIoW+LrJumBsKp7w== + +abbrev@1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" + integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== + +acorn-dynamic-import@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/acorn-dynamic-import/-/acorn-dynamic-import-4.0.0.tgz#482210140582a36b83c3e342e1cfebcaa9240948" + integrity sha512-d3OEjQV4ROpoflsnUA8HozoIR504TFxNivYEUi6uwz0IYhBkTDXGuWlNdMtybRt3nqVx/L6XqMt0FxkXuWKZhw== + +acorn-globals@^4.1.0: + version "4.3.2" + resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-4.3.2.tgz#4e2c2313a597fd589720395f6354b41cd5ec8006" + integrity sha512-BbzvZhVtZP+Bs1J1HcwrQe8ycfO0wStkSGxuul3He3GkHOIZ6eTqOkPuw9IP1X3+IkOo4wiJmwkobzXYz4wewQ== + dependencies: + acorn "^6.0.1" + acorn-walk "^6.0.1" + +acorn-jsx@^5.0.0: + version "5.0.1" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.0.1.tgz#32a064fd925429216a09b141102bfdd185fae40e" + integrity sha512-HJ7CfNHrfJLlNTzIEUTj43LNWGkqpRLxm3YjAlcD0ACydk9XynzYsCBHxut+iqt+1aBXkx9UP/w/ZqMr13XIzg== + +acorn-node@^1.2.0, acorn-node@^1.3.0, acorn-node@^1.5.2, acorn-node@^1.6.1: + version "1.7.0" + resolved "https://registry.yarnpkg.com/acorn-node/-/acorn-node-1.7.0.tgz#aac6a559d27af6176b076ab6fb13c5974c213e3b" + integrity sha512-XhahLSsCB6X6CJbe+uNu3Mn9sJBNFxtBN9NLgAOQovfS6Kh0lDUtmlclhjn9CvEK7A7YyRU13PXlNcpSiLI9Yw== + dependencies: + acorn "^6.1.1" + acorn-dynamic-import "^4.0.0" + acorn-walk "^6.1.1" + xtend "^4.0.1" + +acorn-walk@^6.0.1, acorn-walk@^6.1.1: + version "6.1.1" + resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-6.1.1.tgz#d363b66f5fac5f018ff9c3a1e7b6f8e310cc3913" + integrity sha512-OtUw6JUTgxA2QoqqmrmQ7F2NYqiBPi/L2jqHyFtllhOUvXYQXf0Z1CYUinIfyT4bTCGmrA7gX9FvHA81uzCoVw== + +acorn@^5.2.1, acorn@^5.5.3: + version "5.7.3" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.3.tgz#67aa231bf8812974b85235a96771eb6bd07ea279" + integrity sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw== + +acorn@^6.0.1, acorn@^6.0.7, acorn@^6.1.1: + version "6.1.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.1.1.tgz#7d25ae05bb8ad1f9b699108e1094ecd7884adc1f" + integrity sha512-jPTiwtOxaHNaAPg/dmrJ/beuzLRnXtB0kQPQ8JpotKJgTB6rX6c8mlf315941pyjBSaPg8NHXS9fhP4u17DpGA== + +ajv@^6.5.5, ajv@^6.9.1: + version "6.10.0" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.10.0.tgz#90d0d54439da587cd7e843bfb7045f50bd22bdf1" + integrity sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg== + dependencies: + fast-deep-equal "^2.0.1" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.4.1" + uri-js "^4.2.2" + +ansi-escapes@^3.0.0, ansi-escapes@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.2.0.tgz#8780b98ff9dbf5638152d1f1fe5c1d7b4442976b" + integrity sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ== + +ansi-html@^0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/ansi-html/-/ansi-html-0.0.7.tgz#813584021962a9e9e6fd039f940d12f56ca7859e" + integrity sha1-gTWEAhliqenm/QOflA0S9WynhZ4= + +ansi-regex@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= + +ansi-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" + integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= + +ansi-regex@^4.0.0, ansi-regex@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997" + integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg== + +ansi-styles@^2.0.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" + integrity sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4= + +ansi-styles@^3.2.0, ansi-styles@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== + dependencies: + color-convert "^1.9.0" + +anymatch@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb" + integrity sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw== + dependencies: + micromatch "^3.1.4" + normalize-path "^2.1.1" + +append-buffer@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/append-buffer/-/append-buffer-1.0.2.tgz#d8220cf466081525efea50614f3de6514dfa58f1" + integrity sha1-2CIM9GYIFSXv6lBhTz3mUU36WPE= + dependencies: + buffer-equal "^1.0.0" + +aproba@^1.0.3: + version "1.2.0" + resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" + integrity sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw== + +are-we-there-yet@~1.1.2: + version "1.1.5" + resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz#4b35c2944f062a8bfcda66410760350fe9ddfc21" + integrity sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w== + dependencies: + delegates "^1.0.0" + readable-stream "^2.0.6" + +argparse@^1.0.7: + version "1.0.10" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" + integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== + dependencies: + sprintf-js "~1.0.2" + +arr-diff@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" + integrity sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA= + +arr-flatten@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" + integrity sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg== + +arr-union@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" + integrity sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ= + +array-equal@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/array-equal/-/array-equal-1.0.0.tgz#8c2a5ef2472fd9ea742b04c77a75093ba2757c93" + integrity sha1-jCpe8kcv2ep0KwTHenUJO6J1fJM= + +array-filter@~0.0.0: + version "0.0.1" + resolved "https://registry.yarnpkg.com/array-filter/-/array-filter-0.0.1.tgz#7da8cf2e26628ed732803581fd21f67cacd2eeec" + integrity sha1-fajPLiZijtcygDWB/SH2fKzS7uw= + +array-map@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/array-map/-/array-map-0.0.0.tgz#88a2bab73d1cf7bcd5c1b118a003f66f665fa662" + integrity sha1-iKK6tz0c97zVwbEYoAP2b2ZfpmI= + +array-reduce@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/array-reduce/-/array-reduce-0.0.0.tgz#173899d3ffd1c7d9383e4479525dbe278cab5f2b" + integrity sha1-FziZ0//Rx9k4PkR5Ul2+J4yrXys= + +array-unique@^0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" + integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg= + +asn1.js@^4.0.0: + version "4.10.1" + resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-4.10.1.tgz#b9c2bf5805f1e64aadeed6df3a2bfafb5a73f5a0" + integrity sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw== + dependencies: + bn.js "^4.0.0" + inherits "^2.0.1" + minimalistic-assert "^1.0.0" + +asn1@~0.2.3: + version "0.2.4" + resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136" + integrity sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg== + dependencies: + safer-buffer "~2.1.0" + +assert-plus@1.0.0, assert-plus@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" + integrity sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU= + +assert@^1.4.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/assert/-/assert-1.5.0.tgz#55c109aaf6e0aefdb3dc4b71240c70bf574b18eb" + integrity sha512-EDsgawzwoun2CZkCgtxJbv392v4nbk9XDD06zI+kQYoBM/3RBWLlEyJARDOmhAAosBjWACEkKL6S+lIZtcAubA== + dependencies: + object-assign "^4.1.1" + util "0.10.3" + +assign-symbols@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" + integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= + +astral-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9" + integrity sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg== + +async-each@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.3.tgz#b727dbf87d7651602f06f4d4ac387f47d91b0cbf" + integrity sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ== + +async-limiter@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.0.tgz#78faed8c3d074ab81f22b4e985d79e8738f720f8" + integrity sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg== + +asynckit@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" + integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= + +atob@^2.1.1: + version "2.1.2" + resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" + integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== + +aws-sign2@~0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" + integrity sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg= + +aws4@^1.8.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f" + integrity sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ== + +babel-jest@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-24.8.0.tgz#5c15ff2b28e20b0f45df43fe6b7f2aae93dba589" + integrity sha512-+5/kaZt4I9efoXzPlZASyK/lN9qdRKmmUav9smVc0ruPQD7IsfucQ87gpOE8mn2jbDuS6M/YOW6n3v9ZoIfgnw== + dependencies: + "@jest/transform" "^24.8.0" + "@jest/types" "^24.8.0" + "@types/babel__core" "^7.1.0" + babel-plugin-istanbul "^5.1.0" + babel-preset-jest "^24.6.0" + chalk "^2.4.2" + slash "^2.0.0" + +babel-plugin-istanbul@^5.1.0: + version "5.1.4" + resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-5.1.4.tgz#841d16b9a58eeb407a0ddce622ba02fe87a752ba" + integrity sha512-dySz4VJMH+dpndj0wjJ8JPs/7i1TdSPb1nRrn56/92pKOF9VKC1FMFJmMXjzlGGusnCAqujP6PBCiKq0sVA+YQ== + dependencies: + find-up "^3.0.0" + istanbul-lib-instrument "^3.3.0" + test-exclude "^5.2.3" + +babel-plugin-jest-hoist@^24.6.0: + version "24.6.0" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-24.6.0.tgz#f7f7f7ad150ee96d7a5e8e2c5da8319579e78019" + integrity sha512-3pKNH6hMt9SbOv0F3WVmy5CWQ4uogS3k0GY5XLyQHJ9EGpAT9XWkFd2ZiXXtkwFHdAHa5j7w7kfxSP5lAIwu7w== + dependencies: + "@types/babel__traverse" "^7.0.6" + +babel-preset-jest@^24.6.0: + version "24.6.0" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-24.6.0.tgz#66f06136eefce87797539c0d63f1769cc3915984" + integrity sha512-pdZqLEdmy1ZK5kyRUfvBb2IfTPb2BUvIJczlPspS8fWmBQslNNDBqVfh7BW5leOVJMDZKzjD8XEyABTk6gQ5yw== + dependencies: + "@babel/plugin-syntax-object-rest-spread" "^7.0.0" + babel-plugin-jest-hoist "^24.6.0" + +babelify@^10.0.0: + version "10.0.0" + resolved "https://registry.yarnpkg.com/babelify/-/babelify-10.0.0.tgz#fe73b1a22583f06680d8d072e25a1e0d1d1d7fb5" + integrity sha512-X40FaxyH7t3X+JFAKvb1H9wooWKLRCi8pg3m8poqtdZaIng+bjzp9RvKQCvRjF9isHiPkXspbbXT/zwXLtwgwg== + +bail@^1.0.0: + version "1.0.4" + resolved "https://registry.yarnpkg.com/bail/-/bail-1.0.4.tgz#7181b66d508aa3055d3f6c13f0a0c720641dde9b" + integrity sha512-S8vuDB4w6YpRhICUDET3guPlQpaJl7od94tpZ0Fvnyp+MKW/HyDTcRDck+29C9g+d/qQHnddRH3+94kZdrW0Ww== + +balanced-match@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= + +base-x@^3.0.2: + version "3.0.5" + resolved "https://registry.yarnpkg.com/base-x/-/base-x-3.0.5.tgz#d3ada59afed05b921ab581ec3112e6444ba0795a" + integrity sha512-C3picSgzPSLE+jW3tcBzJoGwitOtazb5B+5YmAxZm2ybmTi9LNgAtDO/jjVEBZwHoXmDBZ9m/IELj3elJVRBcA== + dependencies: + safe-buffer "^5.0.1" + +base64-js@^1.0.2: + version "1.3.0" + resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.0.tgz#cab1e6118f051095e58b5281aea8c1cd22bfc0e3" + integrity sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw== + +base@^0.11.1: + version "0.11.2" + resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" + integrity sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg== + dependencies: + cache-base "^1.0.1" + class-utils "^0.3.5" + component-emitter "^1.2.1" + define-property "^1.0.0" + isobject "^3.0.1" + mixin-deep "^1.2.0" + pascalcase "^0.1.1" + +bcrypt-pbkdf@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" + integrity sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4= + dependencies: + tweetnacl "^0.14.3" + +binary-extensions@^1.0.0: + version "1.13.1" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.13.1.tgz#598afe54755b2868a5330d2aff9d4ebb53209b65" + integrity sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw== + +bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.11.5, bn.js@^4.4.0: + version "4.11.8" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f" + integrity sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA== + +body@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/body/-/body-5.1.0.tgz#e4ba0ce410a46936323367609ecb4e6553125069" + integrity sha1-5LoM5BCkaTYyM2dgnstOZVMSUGk= + dependencies: + continuable-cache "^0.3.1" + error "^7.0.0" + raw-body "~1.1.0" + safe-json-parse "~1.0.1" + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +braces@^2.3.1, braces@^2.3.2: + version "2.3.2" + resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" + integrity sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w== + dependencies: + arr-flatten "^1.1.0" + array-unique "^0.3.2" + extend-shallow "^2.0.1" + fill-range "^4.0.0" + isobject "^3.0.1" + repeat-element "^1.1.2" + snapdragon "^0.8.1" + snapdragon-node "^2.0.1" + split-string "^3.0.2" + to-regex "^3.0.1" + +brorand@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" + integrity sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8= + +browser-pack@^6.0.1: + version "6.1.0" + resolved "https://registry.yarnpkg.com/browser-pack/-/browser-pack-6.1.0.tgz#c34ba10d0b9ce162b5af227c7131c92c2ecd5774" + integrity sha512-erYug8XoqzU3IfcU8fUgyHqyOXqIE4tUTTQ+7mqUjQlvnXkOO6OlT9c/ZoJVHYoAaqGxr09CN53G7XIsO4KtWA== + dependencies: + JSONStream "^1.0.3" + combine-source-map "~0.8.0" + defined "^1.0.0" + safe-buffer "^5.1.1" + through2 "^2.0.0" + umd "^3.0.0" + +browser-process-hrtime@^0.1.2: + version "0.1.3" + resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-0.1.3.tgz#616f00faef1df7ec1b5bf9cfe2bdc3170f26c7b4" + integrity sha512-bRFnI4NnjO6cnyLmOV/7PVoDEMJChlcfN0z4s1YMBY989/SvlfMI1lgCnkFUs53e9gQF+w7qu7XdllSTiSl8Aw== + +browser-resolve@^1.11.0, browser-resolve@^1.11.3, browser-resolve@^1.7.0: + version "1.11.3" + resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-1.11.3.tgz#9b7cbb3d0f510e4cb86bdbd796124d28b5890af6" + integrity sha512-exDi1BYWB/6raKHmDTCicQfTkqwN5fioMFV4j8BsfMU4R2DK/QfZfK7kOVkmWCNANf0snkBzqGqAJBao9gZMdQ== + dependencies: + resolve "1.1.7" + +browserify-aes@^1.0.0, browserify-aes@^1.0.4: + version "1.2.0" + resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.2.0.tgz#326734642f403dabc3003209853bb70ad428ef48" + integrity sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA== + dependencies: + buffer-xor "^1.0.3" + cipher-base "^1.0.0" + create-hash "^1.1.0" + evp_bytestokey "^1.0.3" + inherits "^2.0.1" + safe-buffer "^5.0.1" + +browserify-cipher@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/browserify-cipher/-/browserify-cipher-1.0.1.tgz#8d6474c1b870bfdabcd3bcfcc1934a10e94f15f0" + integrity sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w== + dependencies: + browserify-aes "^1.0.4" + browserify-des "^1.0.0" + evp_bytestokey "^1.0.0" + +browserify-des@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/browserify-des/-/browserify-des-1.0.2.tgz#3af4f1f59839403572f1c66204375f7a7f703e9c" + integrity sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A== + dependencies: + cipher-base "^1.0.1" + des.js "^1.0.0" + inherits "^2.0.1" + safe-buffer "^5.1.2" + +browserify-rsa@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/browserify-rsa/-/browserify-rsa-4.0.1.tgz#21e0abfaf6f2029cf2fafb133567a701d4135524" + integrity sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ= + dependencies: + bn.js "^4.1.0" + randombytes "^2.0.1" + +browserify-sign@^4.0.0: + version "4.0.4" + resolved "https://registry.yarnpkg.com/browserify-sign/-/browserify-sign-4.0.4.tgz#aa4eb68e5d7b658baa6bf6a57e630cbd7a93d298" + integrity sha1-qk62jl17ZYuqa/alfmMMvXqT0pg= + dependencies: + bn.js "^4.1.1" + browserify-rsa "^4.0.0" + create-hash "^1.1.0" + create-hmac "^1.1.2" + elliptic "^6.0.0" + inherits "^2.0.1" + parse-asn1 "^5.0.0" + +browserify-zlib@~0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/browserify-zlib/-/browserify-zlib-0.2.0.tgz#2869459d9aa3be245fe8fe2ca1f46e2e7f54d73f" + integrity sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA== + dependencies: + pako "~1.0.5" + +browserify@^16.2.3: + version "16.2.3" + resolved "https://registry.yarnpkg.com/browserify/-/browserify-16.2.3.tgz#7ee6e654ba4f92bce6ab3599c3485b1cc7a0ad0b" + integrity sha512-zQt/Gd1+W+IY+h/xX2NYMW4orQWhqSwyV+xsblycTtpOuB27h1fZhhNQuipJ4t79ohw4P4mMem0jp/ZkISQtjQ== + dependencies: + JSONStream "^1.0.3" + assert "^1.4.0" + browser-pack "^6.0.1" + browser-resolve "^1.11.0" + browserify-zlib "~0.2.0" + buffer "^5.0.2" + cached-path-relative "^1.0.0" + concat-stream "^1.6.0" + console-browserify "^1.1.0" + constants-browserify "~1.0.0" + crypto-browserify "^3.0.0" + defined "^1.0.0" + deps-sort "^2.0.0" + domain-browser "^1.2.0" + duplexer2 "~0.1.2" + events "^2.0.0" + glob "^7.1.0" + has "^1.0.0" + htmlescape "^1.1.0" + https-browserify "^1.0.0" + inherits "~2.0.1" + insert-module-globals "^7.0.0" + labeled-stream-splicer "^2.0.0" + mkdirp "^0.5.0" + module-deps "^6.0.0" + os-browserify "~0.3.0" + parents "^1.0.1" + path-browserify "~0.0.0" + process "~0.11.0" + punycode "^1.3.2" + querystring-es3 "~0.2.0" + read-only-stream "^2.0.0" + readable-stream "^2.0.2" + resolve "^1.1.4" + shasum "^1.0.0" + shell-quote "^1.6.1" + stream-browserify "^2.0.0" + stream-http "^2.0.0" + string_decoder "^1.1.1" + subarg "^1.0.0" + syntax-error "^1.1.1" + through2 "^2.0.0" + timers-browserify "^1.0.1" + tty-browserify "0.0.1" + url "~0.11.0" + util "~0.10.1" + vm-browserify "^1.0.0" + xtend "^4.0.0" + +browserslist@^4.6.0: + version "4.6.2" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.6.2.tgz#574c665950915c2ac73a4594b8537a9eba26203f" + integrity sha512-2neU/V0giQy9h3XMPwLhEY3+Ao0uHSwHvU8Q1Ea6AgLVL1sXbX3dzPrJ8NWe5Hi4PoTkCYXOtVR9rfRLI0J/8Q== + dependencies: + caniuse-lite "^1.0.30000974" + electron-to-chromium "^1.3.150" + node-releases "^1.1.23" + +bs58@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/bs58/-/bs58-4.0.1.tgz#be161e76c354f6f788ae4071f63f34e8c4f0a42a" + integrity sha1-vhYedsNU9veIrkBx9j806MTwpCo= + dependencies: + base-x "^3.0.2" + +bser@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/bser/-/bser-2.0.0.tgz#9ac78d3ed5d915804fd87acb158bc797147a1719" + integrity sha1-mseNPtXZFYBP2HrLFYvHlxR6Fxk= + dependencies: + node-int64 "^0.4.0" + +buffer-equal@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/buffer-equal/-/buffer-equal-1.0.0.tgz#59616b498304d556abd466966b22eeda3eca5fbe" + integrity sha1-WWFrSYME1Var1GaWayLu2j7KX74= + +buffer-from@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" + integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== + +buffer-shims@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/buffer-shims/-/buffer-shims-1.0.0.tgz#9978ce317388c649ad8793028c3477ef044a8b51" + integrity sha1-mXjOMXOIxkmth5MCjDR37wRKi1E= + +buffer-xor@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" + integrity sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk= + +buffer@^5.0.2: + version "5.2.1" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.2.1.tgz#dd57fa0f109ac59c602479044dca7b8b3d0b71d6" + integrity sha512-c+Ko0loDaFfuPWiL02ls9Xd3GO3cPVmUobQ6t3rXNUk304u6hGq+8N/kFi+QEIKhzK3uwolVhLzszmfLmMLnqg== + dependencies: + base64-js "^1.0.2" + ieee754 "^1.1.4" + +builtin-modules@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" + integrity sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8= + +builtin-status-codes@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz#85982878e21b98e1c66425e03d0174788f569ee8" + integrity sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug= + +bytes@1: + version "1.0.0" + resolved "https://registry.yarnpkg.com/bytes/-/bytes-1.0.0.tgz#3569ede8ba34315fab99c3e92cb04c7220de1fa8" + integrity sha1-NWnt6Lo0MV+rmcPpLLBMciDeH6g= + +cache-base@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" + integrity sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ== + dependencies: + collection-visit "^1.0.0" + component-emitter "^1.2.1" + get-value "^2.0.6" + has-value "^1.0.0" + isobject "^3.0.1" + set-value "^2.0.0" + to-object-path "^0.3.0" + union-value "^1.0.0" + unset-value "^1.0.0" + +cached-path-relative@^1.0.0, cached-path-relative@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/cached-path-relative/-/cached-path-relative-1.0.2.tgz#a13df4196d26776220cc3356eb147a52dba2c6db" + integrity sha512-5r2GqsoEb4qMTTN9J+WzXfjov+hjxT+j3u5K+kIVNIwAd99DLCJE9pBIMP1qVeybV6JiijL385Oz0DcYxfbOIg== + +callsites@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" + integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== + +camelcase@^5.0.0: + version "5.3.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" + integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== + +caniuse-lite@^1.0.30000974: + version "1.0.30000974" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000974.tgz#b7afe14ee004e97ce6dc73e3f878290a12928ad8" + integrity sha512-xc3rkNS/Zc3CmpMKuczWEdY2sZgx09BkAxfvkxlAEBTqcMHeL8QnPqhKse+5sRTi3nrw2pJwToD2WvKn1Uhvww== + +capability@^0.2.5: + version "0.2.5" + resolved "https://registry.yarnpkg.com/capability/-/capability-0.2.5.tgz#51ad87353f1936ffd77f2f21c74633a4dea88801" + integrity sha1-Ua2HNT8ZNv/Xfy8hx0YzpN6oiAE= + +capture-exit@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/capture-exit/-/capture-exit-2.0.0.tgz#fb953bfaebeb781f62898239dabb426d08a509a4" + integrity sha512-PiT/hQmTonHhl/HFGN+Lx3JJUznrVYJ3+AQsnthneZbvW7x+f08Tk7yLJTLEOUvBTbduLeeBkxEaYXUOUrRq6g== + dependencies: + rsvp "^4.8.4" + +caseless@~0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" + integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= + +ccount@^1.0.0: + version "1.0.4" + resolved "https://registry.yarnpkg.com/ccount/-/ccount-1.0.4.tgz#9cf2de494ca84060a2a8d2854edd6dfb0445f386" + integrity sha512-fpZ81yYfzentuieinmGnphk0pLkOTMm6MZdVqwd77ROvhko6iujLNGrHH5E7utq3ygWklwfmwuG+A7P+NpqT6w== + +chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.0, chalk@^2.4.2: + version "2.4.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" + integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + +character-entities-html4@^1.0.0: + version "1.1.3" + resolved "https://registry.yarnpkg.com/character-entities-html4/-/character-entities-html4-1.1.3.tgz#5ce6e01618e47048ac22f34f7f39db5c6fd679ef" + integrity sha512-SwnyZ7jQBCRHELk9zf2CN5AnGEc2nA+uKMZLHvcqhpPprjkYhiLn0DywMHgN5ttFZuITMATbh68M6VIVKwJbcg== + +character-entities-legacy@^1.0.0: + version "1.1.3" + resolved "https://registry.yarnpkg.com/character-entities-legacy/-/character-entities-legacy-1.1.3.tgz#3c729991d9293da0ede6dddcaf1f2ce1009ee8b4" + integrity sha512-YAxUpPoPwxYFsslbdKkhrGnXAtXoHNgYjlBM3WMXkWGTl5RsY3QmOyhwAgL8Nxm9l5LBThXGawxKPn68y6/fww== + +character-entities@^1.0.0: + version "1.2.3" + resolved "https://registry.yarnpkg.com/character-entities/-/character-entities-1.2.3.tgz#bbed4a52fe7ef98cc713c6d80d9faa26916d54e6" + integrity sha512-yB4oYSAa9yLcGyTbB4ItFwHw43QHdH129IJ5R+WvxOkWlyFnR5FAaBNnUq4mcxsTVZGh28bHoeTHMKXH1wZf3w== + +character-reference-invalid@^1.0.0: + version "1.1.3" + resolved "https://registry.yarnpkg.com/character-reference-invalid/-/character-reference-invalid-1.1.3.tgz#1647f4f726638d3ea4a750cf5d1975c1c7919a85" + integrity sha512-VOq6PRzQBam/8Jm6XBGk2fNEnHXAdGd6go0rtd4weAGECBamHDwwCQSOT12TACIYUZegUXnV6xBXqUssijtxIg== + +chardet@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" + integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== + +chokidar@^2.0.4: + version "2.1.6" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.1.6.tgz#b6cad653a929e244ce8a834244164d241fa954c5" + integrity sha512-V2jUo67OKkc6ySiRpJrjlpJKl9kDuG+Xb8VgsGzb+aEouhgS1D0weyPU4lEzdAcsCAvrih2J2BqyXqHWvVLw5g== + dependencies: + anymatch "^2.0.0" + async-each "^1.0.1" + braces "^2.3.2" + glob-parent "^3.1.0" + inherits "^2.0.3" + is-binary-path "^1.0.0" + is-glob "^4.0.0" + normalize-path "^3.0.0" + path-is-absolute "^1.0.0" + readdirp "^2.2.1" + upath "^1.1.1" + optionalDependencies: + fsevents "^1.2.7" + +chownr@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.1.tgz#54726b8b8fff4df053c42187e801fb4412df1494" + integrity sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g== + +ci-info@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" + integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== + +cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.4.tgz#8760e4ecc272f4c363532f926d874aae2c1397de" + integrity sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q== + dependencies: + inherits "^2.0.1" + safe-buffer "^5.0.1" + +class-utils@^0.3.5: + version "0.3.6" + resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" + integrity sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg== + dependencies: + arr-union "^3.1.0" + define-property "^0.2.5" + isobject "^3.0.0" + static-extend "^0.1.1" + +cli-cursor@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" + integrity sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU= + dependencies: + restore-cursor "^2.0.0" + +cli-width@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.0.tgz#ff19ede8a9a5e579324147b0c11f0fbcbabed639" + integrity sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk= + +cliui@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-4.1.0.tgz#348422dbe82d800b3022eef4f6ac10bf2e4d1b49" + integrity sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ== + dependencies: + string-width "^2.1.1" + strip-ansi "^4.0.0" + wrap-ansi "^2.0.0" + +clone-buffer@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/clone-buffer/-/clone-buffer-1.0.0.tgz#e3e25b207ac4e701af721e2cb5a16792cac3dc58" + integrity sha1-4+JbIHrE5wGvch4staFnksrD3Fg= + +clone-stats@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/clone-stats/-/clone-stats-1.0.0.tgz#b3782dff8bb5474e18b9b6bf0fdfe782f8777680" + integrity sha1-s3gt/4u1R04Yuba/D9/ngvh3doA= + +clone@^2.1.1: + version "2.1.2" + resolved "https://registry.yarnpkg.com/clone/-/clone-2.1.2.tgz#1b7f4b9f591f1e8f83670401600345a02887435f" + integrity sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18= + +cloneable-readable@^1.0.0: + version "1.1.3" + resolved "https://registry.yarnpkg.com/cloneable-readable/-/cloneable-readable-1.1.3.tgz#120a00cb053bfb63a222e709f9683ea2e11d8cec" + integrity sha512-2EF8zTQOxYq70Y4XKtorQupqF0m49MBz2/yf5Bj+MHjvpG3Hy7sImifnqD6UA+TKYxeSV+u6qqQPawN5UvnpKQ== + dependencies: + inherits "^2.0.1" + process-nextick-args "^2.0.0" + readable-stream "^2.3.5" + +co@^4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" + integrity sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ= + +code-point-at@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" + integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= + +collapse-white-space@^1.0.0, collapse-white-space@^1.0.2: + version "1.0.5" + resolved "https://registry.yarnpkg.com/collapse-white-space/-/collapse-white-space-1.0.5.tgz#c2495b699ab1ed380d29a1091e01063e75dbbe3a" + integrity sha512-703bOOmytCYAX9cXYqoikYIx6twmFCXsnzRQheBcTG3nzKYBR4P/+wkYeH+Mvj7qUz8zZDtdyzbxfnEi/kYzRQ== + +collection-visit@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" + integrity sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA= + dependencies: + map-visit "^1.0.0" + object-visit "^1.0.0" + +color-convert@^1.9.0: + version "1.9.3" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" + integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== + dependencies: + color-name "1.1.3" + +color-name@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= + +combine-source-map@^0.8.0, combine-source-map@~0.8.0: + version "0.8.0" + resolved "https://registry.yarnpkg.com/combine-source-map/-/combine-source-map-0.8.0.tgz#a58d0df042c186fcf822a8e8015f5450d2d79a8b" + integrity sha1-pY0N8ELBhvz4IqjoAV9UUNLXmos= + dependencies: + convert-source-map "~1.1.0" + inline-source-map "~0.6.0" + lodash.memoize "~3.0.3" + source-map "~0.5.3" + +combined-stream@^1.0.6, combined-stream@~1.0.6: + version "1.0.8" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" + integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== + dependencies: + delayed-stream "~1.0.0" + +comma-separated-tokens@^1.0.1: + version "1.0.7" + resolved "https://registry.yarnpkg.com/comma-separated-tokens/-/comma-separated-tokens-1.0.7.tgz#419cd7fb3258b1ed838dc0953167a25e152f5b59" + integrity sha512-Jrx3xsP4pPv4AwJUDWY9wOXGtwPXARej6Xd99h4TUGotmf8APuquKMpK+dnD3UgyxK7OEWaisjZz+3b5jtL6xQ== + +commander@^2.12.1, commander@^2.19.0, commander@~2.20.0: + version "2.20.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.0.tgz#d58bb2b5c1ee8f87b0d340027e9e94e222c5a422" + integrity sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ== + +component-emitter@^1.2.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0" + integrity sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg== + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= + +concat-stream@^1.6.0, concat-stream@^1.6.1, concat-stream@~1.6.0: + version "1.6.2" + resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34" + integrity sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw== + dependencies: + buffer-from "^1.0.0" + inherits "^2.0.3" + readable-stream "^2.2.2" + typedarray "^0.0.6" + +concat-stream@~1.5.0: + version "1.5.2" + resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.5.2.tgz#708978624d856af41a5a741defdd261da752c266" + integrity sha1-cIl4Yk2FavQaWnQd790mHadSwmY= + dependencies: + inherits "~2.0.1" + readable-stream "~2.0.0" + typedarray "~0.0.5" + +console-browserify@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/console-browserify/-/console-browserify-1.1.0.tgz#f0241c45730a9fc6323b206dbf38edc741d0bb10" + integrity sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA= + dependencies: + date-now "^0.1.4" + +console-control-strings@^1.0.0, console-control-strings@~1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" + integrity sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4= + +constants-browserify@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/constants-browserify/-/constants-browserify-1.0.0.tgz#c20b96d8c617748aaf1c16021760cd27fcb8cb75" + integrity sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U= + +continuable-cache@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/continuable-cache/-/continuable-cache-0.3.1.tgz#bd727a7faed77e71ff3985ac93351a912733ad0f" + integrity sha1-vXJ6f67XfnH/OYWskzUakSczrQ8= + +convert-source-map@^1.1.0, convert-source-map@^1.4.0, convert-source-map@^1.5.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.6.0.tgz#51b537a8c43e0f04dec1993bffcdd504e758ac20" + integrity sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A== + dependencies: + safe-buffer "~5.1.1" + +convert-source-map@~1.1.0: + version "1.1.3" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.1.3.tgz#4829c877e9fe49b3161f3bf3673888e204699860" + integrity sha1-SCnId+n+SbMWHzvzZziI4gRpmGA= + +copy-descriptor@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" + integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= + +core-js-compat@^3.1.1: + version "3.1.3" + resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.1.3.tgz#0cc3ba4c7f62928c2837e1cffbe8dc78b4f1ae14" + integrity sha512-EP018pVhgwsKHz3YoN1hTq49aRe+h017Kjz0NQz3nXV0cCRMvH3fLQl+vEPGr4r4J5sk4sU3tUC7U1aqTCeJeA== + dependencies: + browserslist "^4.6.0" + core-js-pure "3.1.3" + semver "^6.1.0" + +core-js-pure@3.1.3: + version "3.1.3" + resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.1.3.tgz#4c90752d5b9471f641514f3728f51c1e0783d0b5" + integrity sha512-k3JWTrcQBKqjkjI0bkfXS0lbpWPxYuHWfMMjC1VDmzU4Q58IwSbuXSo99YO/hUHlw/EB4AlfA2PVxOGkrIq6dA== + +core-util-is@1.0.2, core-util-is@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" + integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= + +create-ecdh@^4.0.0: + version "4.0.3" + resolved "https://registry.yarnpkg.com/create-ecdh/-/create-ecdh-4.0.3.tgz#c9111b6f33045c4697f144787f9254cdc77c45ff" + integrity sha512-GbEHQPMOswGpKXM9kCWVrremUcBmjteUaQ01T9rkKCPDXfUHX0IoP9LpHYo2NPFampa4e+/pFDc3jQdxrxQLaw== + dependencies: + bn.js "^4.1.0" + elliptic "^6.0.0" + +create-hash@^1.1.0, create-hash@^1.1.2: + version "1.2.0" + resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.2.0.tgz#889078af11a63756bcfb59bd221996be3a9ef196" + integrity sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg== + dependencies: + cipher-base "^1.0.1" + inherits "^2.0.1" + md5.js "^1.3.4" + ripemd160 "^2.0.1" + sha.js "^2.4.0" + +create-hmac@^1.1.0, create-hmac@^1.1.2, create-hmac@^1.1.4: + version "1.1.7" + resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.7.tgz#69170c78b3ab957147b2b8b04572e47ead2243ff" + integrity sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg== + dependencies: + cipher-base "^1.0.3" + create-hash "^1.1.0" + inherits "^2.0.1" + ripemd160 "^2.0.0" + safe-buffer "^5.0.1" + sha.js "^2.4.8" + +cross-spawn@^6.0.0, cross-spawn@^6.0.5: + version "6.0.5" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" + integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ== + dependencies: + nice-try "^1.0.4" + path-key "^2.0.1" + semver "^5.5.0" + shebang-command "^1.2.0" + which "^1.2.9" + +crypto-browserify@^3.0.0: + version "3.12.0" + resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.12.0.tgz#396cf9f3137f03e4b8e532c58f698254e00f80ec" + integrity sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg== + dependencies: + browserify-cipher "^1.0.0" + browserify-sign "^4.0.0" + create-ecdh "^4.0.0" + create-hash "^1.1.0" + create-hmac "^1.1.0" + diffie-hellman "^5.0.0" + inherits "^2.0.1" + pbkdf2 "^3.0.3" + public-encrypt "^4.0.0" + randombytes "^2.0.0" + randomfill "^1.0.3" + +cssom@0.3.x, "cssom@>= 0.3.2 < 0.4.0": + version "0.3.6" + resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.6.tgz#f85206cee04efa841f3c5982a74ba96ab20d65ad" + integrity sha512-DtUeseGk9/GBW0hl0vVPpU22iHL6YB5BUX7ml1hB+GMpo0NX5G4voX3kdWiMSEguFtcW3Vh3djqNF4aIe6ne0A== + +cssstyle@^1.0.0: + version "1.2.2" + resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-1.2.2.tgz#427ea4d585b18624f6fdbf9de7a2a1a3ba713077" + integrity sha512-43wY3kl1CVQSvL7wUY1qXkxVGkStjpkDmVjiIKX8R97uhajy8Bybay78uOtqvh7Q5GK75dNPfW0geWjE6qQQow== + dependencies: + cssom "0.3.x" + +dash-ast@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/dash-ast/-/dash-ast-1.0.0.tgz#12029ba5fb2f8aa6f0a861795b23c1b4b6c27d37" + integrity sha512-Vy4dx7gquTeMcQR/hDkYLGUnwVil6vk4FOOct+djUnHOUWt+zJPJAaRIXaAFkPXtJjvlY7o3rfRu0/3hpnwoUA== + +dashdash@^1.12.0: + version "1.14.1" + resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" + integrity sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA= + dependencies: + assert-plus "^1.0.0" + +data-urls@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-1.1.0.tgz#15ee0582baa5e22bb59c77140da8f9c76963bbfe" + integrity sha512-YTWYI9se1P55u58gL5GkQHW4P6VJBJ5iBT+B5a7i2Tjadhv52paJG0qHX4A0OR6/t52odI64KP2YvFpkDOi3eQ== + dependencies: + abab "^2.0.0" + whatwg-mimetype "^2.2.0" + whatwg-url "^7.0.0" + +date-now@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/date-now/-/date-now-0.1.4.tgz#eaf439fd4d4848ad74e5cc7dbef200672b9e345b" + integrity sha1-6vQ5/U1ISK105cx9vvIAZyueNFs= + +de-indent@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/de-indent/-/de-indent-1.0.2.tgz#b2038e846dc33baa5796128d0804b455b8c1e21d" + integrity sha1-sgOOhG3DO6pXlhKNCAS0VbjB4h0= + +debug@^2.2.0, debug@^2.3.3: + version "2.6.9" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" + integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== + dependencies: + ms "2.0.0" + +debug@^3.1.0, debug@^3.2.6: + version "3.2.6" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" + integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ== + dependencies: + ms "^2.1.1" + +debug@^4.0.1, debug@^4.1.0, debug@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" + integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw== + dependencies: + ms "^2.1.1" + +decamelize@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" + integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= + +decode-uri-component@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" + integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU= + +deep-extend@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" + integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== + +deep-is@~0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" + integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= + +define-properties@^1.1.2: + version "1.1.3" + resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1" + integrity sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ== + dependencies: + object-keys "^1.0.12" + +define-property@^0.2.5: + version "0.2.5" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" + integrity sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY= + dependencies: + is-descriptor "^0.1.0" + +define-property@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6" + integrity sha1-dp66rz9KY6rTr56NMEybvnm/sOY= + dependencies: + is-descriptor "^1.0.0" + +define-property@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d" + integrity sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ== + dependencies: + is-descriptor "^1.0.2" + isobject "^3.0.1" + +defined@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/defined/-/defined-1.0.0.tgz#c98d9bcef75674188e110969151199e39b1fa693" + integrity sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM= + +delayed-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk= + +delegates@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" + integrity sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o= + +depd@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" + integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak= + +deps-sort@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/deps-sort/-/deps-sort-2.0.0.tgz#091724902e84658260eb910748cccd1af6e21fb5" + integrity sha1-CRckkC6EZYJg65EHSMzNGvbiH7U= + dependencies: + JSONStream "^1.0.3" + shasum "^1.0.0" + subarg "^1.0.0" + through2 "^2.0.0" + +des.js@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/des.js/-/des.js-1.0.0.tgz#c074d2e2aa6a8a9a07dbd61f9a15c2cd83ec8ecc" + integrity sha1-wHTS4qpqipoH29YfmhXCzYPsjsw= + dependencies: + inherits "^2.0.1" + minimalistic-assert "^1.0.0" + +detab@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/detab/-/detab-2.0.2.tgz#074970d1a807b045d0258a4235df5928dd683561" + integrity sha512-Q57yPrxScy816TTE1P/uLRXLDKjXhvYTbfxS/e6lPD+YrqghbsMlGB9nQzj/zVtSPaF0DFPSdO916EWO4sQUyQ== + dependencies: + repeat-string "^1.5.4" + +detect-libc@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" + integrity sha1-+hN8S9aY7fVc1c0CrFWfkaTEups= + +detect-newline@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-2.1.0.tgz#f41f1c10be4b00e87b5f13da680759f2c5bfd3e2" + integrity sha1-9B8cEL5LAOh7XxPaaAdZ8sW/0+I= + +detective@^4.0.0: + version "4.7.1" + resolved "https://registry.yarnpkg.com/detective/-/detective-4.7.1.tgz#0eca7314338442febb6d65da54c10bb1c82b246e" + integrity sha512-H6PmeeUcZloWtdt4DAkFyzFL94arpHr3NOwwmVILFiy+9Qd4JTxxXrzfyGk/lmct2qVGBwTSwSXagqu2BxmWig== + dependencies: + acorn "^5.2.1" + defined "^1.0.0" + +detective@^5.0.2: + version "5.2.0" + resolved "https://registry.yarnpkg.com/detective/-/detective-5.2.0.tgz#feb2a77e85b904ecdea459ad897cc90a99bd2a7b" + integrity sha512-6SsIx+nUUbuK0EthKjv0zrdnajCCXVYGmbYYiYjFVpzcjwEs/JMDZ8tPRG29J/HhN56t3GJp2cGSWDRjjot8Pg== + dependencies: + acorn-node "^1.6.1" + defined "^1.0.0" + minimist "^1.1.1" + +diff-sequences@^24.3.0: + version "24.3.0" + resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-24.3.0.tgz#0f20e8a1df1abddaf4d9c226680952e64118b975" + integrity sha512-xLqpez+Zj9GKSnPWS0WZw1igGocZ+uua8+y+5dDNTT934N3QuY1sp2LkHzwiaYQGz60hMq0pjAshdeXm5VUOEw== + +diff@^1.3.2: + version "1.4.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-1.4.0.tgz#7f28d2eb9ee7b15a97efd89ce63dcfdaa3ccbabf" + integrity sha1-fyjS657nsVqX79ic5j3P2qPMur8= + +diff@^3.2.0: + version "3.5.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" + integrity sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA== + +diffie-hellman@^5.0.0: + version "5.0.3" + resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.3.tgz#40e8ee98f55a2149607146921c63e1ae5f3d2875" + integrity sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg== + dependencies: + bn.js "^4.1.0" + miller-rabin "^4.0.0" + randombytes "^2.0.0" + +disparity@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/disparity/-/disparity-2.0.0.tgz#57ddacb47324ae5f58d2cc0da886db4ce9eeb718" + integrity sha1-V92stHMkrl9Y0swNqIbbTOnutxg= + dependencies: + ansi-styles "^2.0.1" + diff "^1.3.2" + +doctrine-temporary-fork@2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/doctrine-temporary-fork/-/doctrine-temporary-fork-2.0.1.tgz#23f0b6275c65f48893324b02338178e496b2e4bf" + integrity sha512-+GQh3niRkKtSr7cKDo8po+NHkJZyC2Ebwvjz9fvq0ReQr9kIDS6BY9MDrzx+KbbLxvSj3vD/eUaeIoURHzEAFQ== + dependencies: + esutils "^2.0.2" + +doctrine@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" + integrity sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w== + dependencies: + esutils "^2.0.2" + +documentation@^9.1.1: + version "9.3.1" + resolved "https://registry.yarnpkg.com/documentation/-/documentation-9.3.1.tgz#2f0598e208bb689cfefc351bf6cd26a58ef2f022" + integrity sha512-egP7WcZLCNjYwIo97iArQ51/bCpLTOKEQaqPrvGVM2q0zo+JMy5tc+BpuVDtswW39YvP083L7EHrvyhfjol7ww== + dependencies: + "@babel/core" "^7.1.2" + "@babel/generator" "^7.1.3" + "@babel/parser" "7.1.3" + "@babel/plugin-proposal-class-properties" "^7.1.0" + "@babel/plugin-proposal-decorators" "^7.1.2" + "@babel/plugin-proposal-do-expressions" "^7.0.0" + "@babel/plugin-proposal-export-default-from" "^7.0.0" + "@babel/plugin-proposal-export-namespace-from" "^7.0.0" + "@babel/plugin-proposal-function-bind" "^7.0.0" + "@babel/plugin-proposal-function-sent" "^7.1.0" + "@babel/plugin-proposal-json-strings" "^7.0.0" + "@babel/plugin-proposal-logical-assignment-operators" "^7.0.0" + "@babel/plugin-proposal-nullish-coalescing-operator" "^7.0.0" + "@babel/plugin-proposal-numeric-separator" "^7.0.0" + "@babel/plugin-proposal-optional-chaining" "^7.0.0" + "@babel/plugin-proposal-pipeline-operator" "^7.0.0" + "@babel/plugin-proposal-throw-expressions" "^7.0.0" + "@babel/plugin-syntax-dynamic-import" "^7.0.0" + "@babel/plugin-syntax-import-meta" "^7.0.0" + "@babel/preset-env" "^7.1.0" + "@babel/preset-flow" "^7.0.0" + "@babel/preset-react" "^7.0.0" + "@babel/preset-stage-0" "^7.0.0" + "@babel/traverse" "^7.1.4" + "@babel/types" "^7.1.3" + ansi-html "^0.0.7" + babelify "^10.0.0" + chalk "^2.3.0" + chokidar "^2.0.4" + concat-stream "^1.6.0" + disparity "^2.0.0" + doctrine-temporary-fork "2.0.1" + get-port "^4.0.0" + git-url-parse "^10.0.1" + github-slugger "1.2.0" + glob "^7.1.2" + globals-docs "^2.4.0" + highlight.js "^9.15.5" + js-yaml "^3.10.0" + lodash "^4.17.10" + mdast-util-inject "^1.1.0" + micromatch "^3.1.5" + mime "^2.2.0" + module-deps-sortable "5.0.0" + parse-filepath "^1.0.2" + pify "^4.0.0" + read-pkg-up "^4.0.0" + remark "^9.0.0" + remark-html "^8.0.0" + remark-reference-links "^4.0.1" + remark-toc "^5.0.0" + remote-origin-url "0.4.0" + resolve "^1.8.1" + stream-array "^1.1.2" + strip-json-comments "^2.0.1" + tiny-lr "^1.1.0" + unist-builder "^1.0.2" + unist-util-visit "^1.3.0" + vfile "^3.0.0" + vfile-reporter "^5.0.0" + vfile-sort "^2.1.0" + vinyl "^2.1.0" + vinyl-fs "^3.0.2" + vue-template-compiler "^2.5.16" + yargs "^12.0.2" + +domain-browser@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.2.0.tgz#3d31f50191a6749dd1375a7f522e823d42e54eda" + integrity sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA== + +domexception@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/domexception/-/domexception-1.0.1.tgz#937442644ca6a31261ef36e3ec677fe805582c90" + integrity sha512-raigMkn7CJNNo6Ihro1fzG7wr3fHuYVytzquZKX5n0yizGsTcYgzdIUwj1X9pK0VvjeihV+XiclP+DjwbsSKug== + dependencies: + webidl-conversions "^4.0.2" + +duplexer2@^0.1.2, duplexer2@~0.1.0, duplexer2@~0.1.2: + version "0.1.4" + resolved "https://registry.yarnpkg.com/duplexer2/-/duplexer2-0.1.4.tgz#8b12dab878c0d69e3e7891051662a32fc6bddcc1" + integrity sha1-ixLauHjA1p4+eJEFFmKjL8a93ME= + dependencies: + readable-stream "^2.0.2" + +duplexify@^3.6.0: + version "3.7.1" + resolved "https://registry.yarnpkg.com/duplexify/-/duplexify-3.7.1.tgz#2a4df5317f6ccfd91f86d6fd25d8d8a103b88309" + integrity sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g== + dependencies: + end-of-stream "^1.0.0" + inherits "^2.0.1" + readable-stream "^2.0.0" + stream-shift "^1.0.0" + +ecc-jsbn@~0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" + integrity sha1-OoOpBOVDUyh4dMVkt1SThoSamMk= + dependencies: + jsbn "~0.1.0" + safer-buffer "^2.1.0" + +electron-to-chromium@^1.3.150: + version "1.3.157" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.157.tgz#6211d69e8c4ee18df8c84e74e8644bcafc09486c" + integrity sha512-vxGi3lOGqlupuogZxJOMfu+Q1vaOlG6XbsblWw8XnUZSr/ptbt3D6jhHT5LJPZuFUpKhbEo1u4QipivSory1Kg== + +elliptic@^6.0.0: + version "6.4.1" + resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.4.1.tgz#c2d0b7776911b86722c632c3c06c60f2f819939a" + integrity sha512-BsXLz5sqX8OHcsh7CqBMztyXARmGQ3LWPtGjJi6DiJHq5C/qvi9P3OqgswKSDftbu8+IoI/QDTAm2fFnQ9SZSQ== + dependencies: + 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" + +"emoji-regex@>=6.0.0 <=6.1.1": + version "6.1.1" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-6.1.1.tgz#c6cd0ec1b0642e2a3c67a1137efc5e796da4f88e" + integrity sha1-xs0OwbBkLio8Z6ETfvxeeW2k+I4= + +emoji-regex@^7.0.1: + version "7.0.3" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" + integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA== + +end-of-stream@^1.0.0, end-of-stream@^1.1.0: + version "1.4.1" + resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.1.tgz#ed29634d19baba463b6ce6b80a37213eab71ec43" + integrity sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q== + dependencies: + once "^1.4.0" + +error-ex@^1.3.1: + version "1.3.2" + resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" + integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== + dependencies: + is-arrayish "^0.2.1" + +error-polyfill@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/error-polyfill/-/error-polyfill-0.1.2.tgz#05b27de7d126cbc9d42a96f45faab28a98a0b28b" + integrity sha512-8uhnXlJuhFkmIfhw2tAHtWQGpXcw5rrc0dhuY3bhn8tBHvh6l0oL9VJvR2suqx9eltglKKhVPv8luPQy+UxLTA== + dependencies: + capability "^0.2.5" + o3 "^1.0.3" + u3 "^0.1.0" + +error@^7.0.0: + version "7.0.2" + resolved "https://registry.yarnpkg.com/error/-/error-7.0.2.tgz#a5f75fff4d9926126ddac0ea5dc38e689153cb02" + integrity sha1-pfdf/02ZJhJt2sDqXcOOaJFTywI= + dependencies: + string-template "~0.2.1" + xtend "~4.0.0" + +es-abstract@^1.5.1: + version "1.13.0" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.13.0.tgz#ac86145fdd5099d8dd49558ccba2eaf9b88e24e9" + integrity sha512-vDZfg/ykNxQVwup/8E1BZhVzFfBxs9NqMzGcvIJrqg5k2/5Za2bWo40dK2J1pgLngZ7c+Shh8lwYtLGyrwPutg== + dependencies: + es-to-primitive "^1.2.0" + function-bind "^1.1.1" + has "^1.0.3" + is-callable "^1.1.4" + is-regex "^1.0.4" + object-keys "^1.0.12" + +es-to-primitive@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.0.tgz#edf72478033456e8dda8ef09e00ad9650707f377" + integrity sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg== + dependencies: + is-callable "^1.1.4" + is-date-object "^1.0.1" + is-symbol "^1.0.2" + +escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= + +escodegen@^1.9.1: + version "1.11.1" + resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.11.1.tgz#c485ff8d6b4cdb89e27f4a856e91f118401ca510" + integrity sha512-JwiqFD9KdGVVpeuRa68yU3zZnBEOcPs0nKW7wZzXky8Z7tffdYUHbe11bPCV5jYlK6DVdKLWLm0f5I/QlL0Kmw== + dependencies: + esprima "^3.1.3" + estraverse "^4.2.0" + esutils "^2.0.2" + optionator "^0.8.1" + optionalDependencies: + source-map "~0.6.1" + +eslint-scope@^4.0.3: + version "4.0.3" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-4.0.3.tgz#ca03833310f6889a3264781aa82e63eb9cfe7848" + integrity sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg== + dependencies: + esrecurse "^4.1.0" + estraverse "^4.1.1" + +eslint-utils@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.3.1.tgz#9a851ba89ee7c460346f97cf8939c7298827e512" + integrity sha512-Z7YjnIldX+2XMcjr7ZkgEsOj/bREONV60qYeB/bjMAqqqZ4zxKyWX+BOUkdmRmA9riiIPVvo5x86m5elviOk0Q== + +eslint-visitor-keys@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d" + integrity sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ== + +eslint@^5.14.0: + version "5.16.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-5.16.0.tgz#a1e3ac1aae4a3fbd8296fcf8f7ab7314cbb6abea" + integrity sha512-S3Rz11i7c8AA5JPv7xAH+dOyq/Cu/VXHiHXBPOU1k/JAM5dXqQPt3qcrhpHSorXmrpu2g0gkIBVXAqCpzfoZIg== + dependencies: + "@babel/code-frame" "^7.0.0" + ajv "^6.9.1" + chalk "^2.1.0" + cross-spawn "^6.0.5" + debug "^4.0.1" + doctrine "^3.0.0" + eslint-scope "^4.0.3" + eslint-utils "^1.3.1" + eslint-visitor-keys "^1.0.0" + espree "^5.0.1" + esquery "^1.0.1" + esutils "^2.0.2" + file-entry-cache "^5.0.1" + functional-red-black-tree "^1.0.1" + glob "^7.1.2" + globals "^11.7.0" + ignore "^4.0.6" + import-fresh "^3.0.0" + imurmurhash "^0.1.4" + inquirer "^6.2.2" + js-yaml "^3.13.0" + json-stable-stringify-without-jsonify "^1.0.1" + levn "^0.3.0" + lodash "^4.17.11" + minimatch "^3.0.4" + mkdirp "^0.5.1" + natural-compare "^1.4.0" + optionator "^0.8.2" + path-is-inside "^1.0.2" + progress "^2.0.0" + regexpp "^2.0.1" + semver "^5.5.1" + strip-ansi "^4.0.0" + strip-json-comments "^2.0.1" + table "^5.2.3" + text-table "^0.2.0" + +espree@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/espree/-/espree-5.0.1.tgz#5d6526fa4fc7f0788a5cf75b15f30323e2f81f7a" + integrity sha512-qWAZcWh4XE/RwzLJejfcofscgMc9CamR6Tn1+XRXNzrvUSSbiAjGOI/fggztjIi7y9VLPqnICMIPiGyr8JaZ0A== + dependencies: + acorn "^6.0.7" + acorn-jsx "^5.0.0" + eslint-visitor-keys "^1.0.0" + +esprima@^3.1.3: + version "3.1.3" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" + integrity sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM= + +esprima@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" + integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== + +esquery@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.0.1.tgz#406c51658b1f5991a5f9b62b1dc25b00e3e5c708" + integrity sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA== + dependencies: + estraverse "^4.0.0" + +esrecurse@^4.1.0: + version "4.2.1" + resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.2.1.tgz#007a3b9fdbc2b3bb87e4879ea19c92fdbd3942cf" + integrity sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ== + dependencies: + estraverse "^4.1.0" + +estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1, estraverse@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" + integrity sha1-De4/7TH81GlhjOc0IJn8GvoL2xM= + +esutils@^2.0.0, esutils@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" + integrity sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs= + +events@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/events/-/events-2.1.0.tgz#2a9a1e18e6106e0e812aa9ebd4a819b3c29c0ba5" + integrity sha512-3Zmiobend8P9DjmKAty0Era4jV8oJ0yGYe2nJJAxgymF9+N8F2m0hhZiMoWtcfepExzNKZumFU3ksdQbInGWCg== + +evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz#7fcbdb198dc71959432efe13842684e0525acb02" + integrity sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA== + dependencies: + md5.js "^1.3.4" + safe-buffer "^5.1.1" + +exec-sh@^0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/exec-sh/-/exec-sh-0.3.2.tgz#6738de2eb7c8e671d0366aea0b0db8c6f7d7391b" + integrity sha512-9sLAvzhI5nc8TpuQUh4ahMdCrWT00wPWz7j47/emR5+2qEfoZP5zzUXvx+vdx+H6ohhnsYC31iX04QLYJK8zTg== + +execa@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-1.0.0.tgz#c6236a5bb4df6d6f15e88e7f017798216749ddd8" + integrity sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA== + dependencies: + cross-spawn "^6.0.0" + get-stream "^4.0.0" + is-stream "^1.1.0" + npm-run-path "^2.0.0" + p-finally "^1.0.0" + signal-exit "^3.0.0" + strip-eof "^1.0.0" + +exit@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" + integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= + +expand-brackets@^2.1.4: + version "2.1.4" + resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" + integrity sha1-t3c14xXOMPa27/D4OwQVGiJEliI= + dependencies: + debug "^2.3.3" + define-property "^0.2.5" + extend-shallow "^2.0.1" + posix-character-classes "^0.1.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +expect@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/expect/-/expect-24.8.0.tgz#471f8ec256b7b6129ca2524b2a62f030df38718d" + integrity sha512-/zYvP8iMDrzaaxHVa724eJBCKqSHmO0FA7EDkBiRHxg6OipmMn1fN+C8T9L9K8yr7UONkOifu6+LLH+z76CnaA== + dependencies: + "@jest/types" "^24.8.0" + ansi-styles "^3.2.0" + jest-get-type "^24.8.0" + jest-matcher-utils "^24.8.0" + jest-message-util "^24.8.0" + jest-regex-util "^24.3.0" + +extend-shallow@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" + integrity sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8= + dependencies: + is-extendable "^0.1.0" + +extend-shallow@^3.0.0, extend-shallow@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8" + integrity sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg= + dependencies: + assign-symbols "^1.0.0" + is-extendable "^1.0.1" + +extend@^1.2.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/extend/-/extend-1.3.0.tgz#d1516fb0ff5624d2ebf9123ea1dac5a1994004f8" + integrity sha1-0VFvsP9WJNLr+RI+odrFoZlABPg= + +extend@^3.0.0, extend@~3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" + integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== + +external-editor@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-3.0.3.tgz#5866db29a97826dbe4bf3afd24070ead9ea43a27" + integrity sha512-bn71H9+qWoOQKyZDo25mOMVpSmXROAsTJVVVYzrrtol3d4y+AsKjf4Iwl2Q+IuT0kFSQ1qo166UuIwqYq7mGnA== + dependencies: + chardet "^0.7.0" + iconv-lite "^0.4.24" + tmp "^0.0.33" + +extglob@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" + integrity sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw== + dependencies: + array-unique "^0.3.2" + define-property "^1.0.0" + expand-brackets "^2.1.4" + extend-shallow "^2.0.1" + fragment-cache "^0.2.1" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +extsprintf@1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" + integrity sha1-lpGEQOMEGnpBT4xS48V06zw+HgU= + +extsprintf@^1.2.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" + integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8= + +fast-deep-equal@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49" + integrity sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk= + +fast-json-stable-stringify@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" + integrity sha1-1RQsDK7msRifh9OnYREGT4bIu/I= + +fast-levenshtein@~2.0.4: + version "2.0.6" + resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" + integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= + +faye-websocket@~0.10.0: + version "0.10.0" + resolved "https://registry.yarnpkg.com/faye-websocket/-/faye-websocket-0.10.0.tgz#4e492f8d04dfb6f89003507f6edbf2d501e7c6f4" + integrity sha1-TkkvjQTftviQA1B/btvy1QHnxvQ= + dependencies: + websocket-driver ">=0.5.1" + +fb-watchman@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.0.tgz#54e9abf7dfa2f26cd9b1636c588c1afc05de5d58" + integrity sha1-VOmr99+i8mzZsWNsWIwa/AXeXVg= + dependencies: + bser "^2.0.0" + +figures@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" + integrity sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI= + dependencies: + escape-string-regexp "^1.0.5" + +file-entry-cache@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-5.0.1.tgz#ca0f6efa6dd3d561333fb14515065c2fafdf439c" + integrity sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g== + dependencies: + flat-cache "^2.0.1" + +fill-range@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" + integrity sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc= + dependencies: + extend-shallow "^2.0.1" + is-number "^3.0.0" + repeat-string "^1.6.1" + to-regex-range "^2.1.0" + +find-up@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73" + integrity sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg== + dependencies: + locate-path "^3.0.0" + +flat-cache@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-2.0.1.tgz#5d296d6f04bda44a4630a301413bdbc2ec085ec0" + integrity sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA== + dependencies: + flatted "^2.0.0" + rimraf "2.6.3" + write "1.0.3" + +flatted@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.0.tgz#55122b6536ea496b4b44893ee2608141d10d9916" + integrity sha512-R+H8IZclI8AAkSBRQJLVOsxwAoHd6WC40b4QTNWIjzAa6BXOBfQcM587MXDTVPeYaopFNWHUFLx7eNmHDSxMWg== + +flush-write-stream@^1.0.2: + version "1.1.1" + resolved "https://registry.yarnpkg.com/flush-write-stream/-/flush-write-stream-1.1.1.tgz#8dd7d873a1babc207d94ead0c2e0e44276ebf2e8" + integrity sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w== + dependencies: + inherits "^2.0.3" + readable-stream "^2.3.6" + +for-in@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" + integrity sha1-gQaNKVqBQuwKxybG4iAMMPttXoA= + +forever-agent@~0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" + integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE= + +form-data@~2.3.2: + version "2.3.3" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" + integrity sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.6" + mime-types "^2.1.12" + +fragment-cache@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" + integrity sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk= + dependencies: + map-cache "^0.2.2" + +fs-extra@^7.0.0: + version "7.0.1" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9" + integrity sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw== + dependencies: + graceful-fs "^4.1.2" + jsonfile "^4.0.0" + universalify "^0.1.0" + +fs-minipass@^1.2.5: + version "1.2.6" + resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.6.tgz#2c5cc30ded81282bfe8a0d7c7c1853ddeb102c07" + integrity sha512-crhvyXcMejjv3Z5d2Fa9sf5xLYVCF5O1c71QxbVnbLsmYMBEvDAftewesN/HhY03YRoA7zOMxjNGrF5svGaaeQ== + dependencies: + minipass "^2.2.1" + +fs-mkdirp-stream@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs-mkdirp-stream/-/fs-mkdirp-stream-1.0.0.tgz#0b7815fc3201c6a69e14db98ce098c16935259eb" + integrity sha1-C3gV/DIBxqaeFNuYzgmMFpNSWes= + dependencies: + graceful-fs "^4.1.11" + through2 "^2.0.3" + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= + +fsevents@^1.2.7: + version "1.2.9" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.9.tgz#3f5ed66583ccd6f400b5a00db6f7e861363e388f" + integrity sha512-oeyj2H3EjjonWcFjD5NvZNE9Rqe4UW+nQBU2HNeKw0koVLEFIhtyETyAakeAM3de7Z/SW5kcA+fZUait9EApnw== + dependencies: + nan "^2.12.1" + node-pre-gyp "^0.12.0" + +function-bind@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" + integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== + +functional-red-black-tree@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" + integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= + +gauge@~2.7.3: + version "2.7.4" + resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" + integrity sha1-LANAXHU4w51+s3sxcCLjJfsBi/c= + dependencies: + aproba "^1.0.3" + console-control-strings "^1.0.0" + has-unicode "^2.0.0" + object-assign "^4.1.0" + signal-exit "^3.0.0" + string-width "^1.0.1" + strip-ansi "^3.0.1" + wide-align "^1.1.0" + +get-assigned-identifiers@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/get-assigned-identifiers/-/get-assigned-identifiers-1.2.0.tgz#6dbf411de648cbaf8d9169ebb0d2d576191e2ff1" + integrity sha512-mBBwmeGTrxEMO4pMaaf/uUEFHnYtwr8FTe8Y/mer4rcV/bye0qGm6pw1bGZFGStxC5O76c5ZAVBGnqHmOaJpdQ== + +get-caller-file@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a" + integrity sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w== + +get-port@^4.0.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/get-port/-/get-port-4.2.0.tgz#e37368b1e863b7629c43c5a323625f95cf24b119" + integrity sha512-/b3jarXkH8KJoOMQc3uVGHASwGLPq3gSFJ7tgJm2diza+bydJPTGOibin2steecKeOylE8oY2JERlVWkAJO6yw== + +get-stream@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5" + integrity sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w== + dependencies: + pump "^3.0.0" + +get-value@^2.0.3, get-value@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" + integrity sha1-3BXKHGcjh8p2vTesCjlbogQqLCg= + +getpass@^0.1.1: + version "0.1.7" + resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" + integrity sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo= + dependencies: + assert-plus "^1.0.0" + +git-up@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/git-up/-/git-up-2.1.0.tgz#2f14cfe78327e7c4a2b92fcac7bfc674fdfad40c" + integrity sha512-MJgwfcSd9qxgDyEYpRU/CDxNpUadrK80JHuEQDG4Urn0m7tpSOgCBrtiSIa9S9KH8Tbuo/TN8SSQmJBvsw1HkA== + dependencies: + is-ssh "^1.3.0" + parse-url "^3.0.2" + +git-url-parse@^10.0.1: + version "10.1.0" + resolved "https://registry.yarnpkg.com/git-url-parse/-/git-url-parse-10.1.0.tgz#a27813218f8777e91d15f1c121b83bf14721b67e" + integrity sha512-goZOORAtFjU1iG+4zZgWq+N7It09PqS3Xsy43ZwhP5unDD0tTSmXTpqULHodMdJXGejm3COwXIhIRT6Z8DYVZQ== + dependencies: + git-up "^2.0.0" + +github-slugger@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/github-slugger/-/github-slugger-1.2.0.tgz#8ada3286fd046d8951c3c952a8d7854cfd90fd9a" + integrity sha512-wIaa75k1vZhyPm9yWrD08A5Xnx/V+RmzGrpjQuLemGKSb77Qukiaei58Bogrl/LZSADDfPzKJX8jhLs4CRTl7Q== + dependencies: + emoji-regex ">=6.0.0 <=6.1.1" + +github-slugger@^1.0.0, github-slugger@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/github-slugger/-/github-slugger-1.2.1.tgz#47e904e70bf2dccd0014748142d31126cfd49508" + integrity sha512-SsZUjg/P03KPzQBt7OxJPasGw6NRO5uOgiZ5RGXVud5iSIZ0eNZeNp5rTwCxtavrRUa/A77j8mePVc5lEvk0KQ== + dependencies: + emoji-regex ">=6.0.0 <=6.1.1" + +glob-parent@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-3.1.0.tgz#9e6af6299d8d3bd2bd40430832bd113df906c5ae" + integrity sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4= + dependencies: + is-glob "^3.1.0" + path-dirname "^1.0.0" + +glob-stream@^6.1.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/glob-stream/-/glob-stream-6.1.0.tgz#7045c99413b3eb94888d83ab46d0b404cc7bdde4" + integrity sha1-cEXJlBOz65SIjYOrRtC0BMx73eQ= + dependencies: + extend "^3.0.0" + glob "^7.1.1" + glob-parent "^3.1.0" + is-negated-glob "^1.0.0" + ordered-read-streams "^1.0.0" + pumpify "^1.3.5" + readable-stream "^2.1.5" + remove-trailing-separator "^1.0.1" + to-absolute-glob "^2.0.0" + unique-stream "^2.0.2" + +glob@^7.0.0, glob@^7.1.0, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3: + version "7.1.4" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.4.tgz#aa608a2f6c577ad357e1ae5a5c26d9a8d1969255" + integrity sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +globals-docs@^2.4.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/globals-docs/-/globals-docs-2.4.0.tgz#f2c647544eb6161c7c38452808e16e693c2dafbb" + integrity sha512-B69mWcqCmT3jNYmSxRxxOXWfzu3Go8NQXPfl2o0qPd1EEFhwW0dFUg9ztTu915zPQzqwIhWAlw6hmfIcCK4kkQ== + +globals@^11.1.0, globals@^11.7.0: + version "11.12.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" + integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== + +google-protobuf@^3.6.1: + version "3.9.1" + resolved "https://registry.yarnpkg.com/google-protobuf/-/google-protobuf-3.9.1.tgz#87e6a16b7fb16405b515a6c6622d5ace45578d86" + integrity sha512-tkz7SVwBktFbqFK3teXFUY/VM57+mbUgV9bSD+sZH1ocHJ7uk7BfEWMRdU24dd0ciUDokreA7ghH2fYFIczQdw== + +graceful-fs@^4.0.0, graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6: + version "4.1.15" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.15.tgz#ffb703e1066e8a0eeaa4c8b80ba9253eeefbfb00" + integrity sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA== + +growly@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081" + integrity sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE= + +handlebars@*, handlebars@^4.0.6, handlebars@^4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.1.2.tgz#b6b37c1ced0306b221e094fc7aca3ec23b131b67" + integrity sha512-nvfrjqvt9xQ8Z/w0ijewdD/vvWDTOweBUm96NTr66Wfvo1mJenBLwcYmPs3TIBP5ruzYGD7Hx/DaM9RmhroGPw== + dependencies: + neo-async "^2.6.0" + optimist "^0.6.1" + source-map "^0.6.1" + optionalDependencies: + uglify-js "^3.1.4" + +har-schema@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" + integrity sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI= + +har-validator@~5.1.0: + version "5.1.3" + resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.3.tgz#1ef89ebd3e4996557675eed9893110dc350fa080" + integrity sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g== + dependencies: + ajv "^6.5.5" + har-schema "^2.0.0" + +has-flag@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= + +has-symbols@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.0.tgz#ba1a8f1af2a0fc39650f5c850367704122063b44" + integrity sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q= + +has-unicode@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" + integrity sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk= + +has-value@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" + integrity sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8= + dependencies: + get-value "^2.0.3" + has-values "^0.1.4" + isobject "^2.0.0" + +has-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177" + integrity sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc= + dependencies: + get-value "^2.0.6" + has-values "^1.0.0" + isobject "^3.0.0" + +has-values@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" + integrity sha1-bWHeldkd/Km5oCCJrThL/49it3E= + +has-values@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f" + integrity sha1-lbC2P+whRmGab+V/51Yo1aOe/k8= + dependencies: + is-number "^3.0.0" + kind-of "^4.0.0" + +has@^1.0.0, has@^1.0.1, has@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" + integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== + dependencies: + function-bind "^1.1.1" + +hash-base@^3.0.0: + version "3.0.4" + resolved "https://registry.yarnpkg.com/hash-base/-/hash-base-3.0.4.tgz#5fc8686847ecd73499403319a6b0a3f3f6ae4918" + integrity sha1-X8hoaEfs1zSZQDMZprCj8/auSRg= + dependencies: + inherits "^2.0.1" + safe-buffer "^5.0.1" + +hash.js@^1.0.0, hash.js@^1.0.3: + version "1.1.7" + resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.7.tgz#0babca538e8d4ee4a0f8988d68866537a003cf42" + integrity sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA== + dependencies: + inherits "^2.0.3" + minimalistic-assert "^1.0.1" + +hast-util-is-element@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/hast-util-is-element/-/hast-util-is-element-1.0.3.tgz#423b4b26fe8bf1f25950fe052e9ce8f83fd5f6a4" + integrity sha512-C62CVn7jbjp89yOhhy7vrkSaB7Vk906Gtcw/Ihd+Iufnq+2pwOZjdPmpzpKLWJXPJBMDX3wXg4FqmdOayPcewA== + +hast-util-sanitize@^1.0.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/hast-util-sanitize/-/hast-util-sanitize-1.3.1.tgz#4e60d66336bd67e52354d581967467029a933f2e" + integrity sha512-AIeKHuHx0Wk45nSkGVa2/ujQYTksnDl8gmmKo/mwQi7ag7IBZ8cM3nJ2G86SajbjGP/HRpud6kMkPtcM2i0Tlw== + dependencies: + xtend "^4.0.1" + +hast-util-to-html@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/hast-util-to-html/-/hast-util-to-html-4.0.1.tgz#3666b05afb62bd69f8f5e6c94db04dea19438e2a" + integrity sha512-2emzwyf0xEsc4TBIPmDJmBttIw8R4SXAJiJZoiRR/s47ODYWgOqNoDbf2SJAbMbfNdFWMiCSOrI3OVnX6Qq2Mg== + dependencies: + ccount "^1.0.0" + comma-separated-tokens "^1.0.1" + hast-util-is-element "^1.0.0" + hast-util-whitespace "^1.0.0" + html-void-elements "^1.0.0" + property-information "^4.0.0" + space-separated-tokens "^1.0.0" + stringify-entities "^1.0.1" + unist-util-is "^2.0.0" + xtend "^4.0.1" + +hast-util-whitespace@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/hast-util-whitespace/-/hast-util-whitespace-1.0.3.tgz#6d161b307bd0693b5ec000c7c7e8b5445109ee34" + integrity sha512-AlkYiLTTwPOyxZ8axq2/bCwRUPjIPBfrHkXuCR92B38b3lSdU22R5F/Z4DL6a2kxWpekWq1w6Nj48tWat6GeRA== + +he@^1.1.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" + integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== + +highlight.js@^9.13.1, highlight.js@^9.15.5: + version "9.15.8" + resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-9.15.8.tgz#f344fda123f36f1a65490e932cf90569e4999971" + integrity sha512-RrapkKQWwE+wKdF73VsOa2RQdIoO3mxwJ4P8mhbI6KYJUraUHRKM5w5zQQKXNk0xNL4UVRdulV9SBJcmzJNzVA== + +hmac-drbg@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" + integrity sha1-0nRXAQJabHdabFRXk+1QL8DGSaE= + dependencies: + hash.js "^1.0.3" + minimalistic-assert "^1.0.0" + minimalistic-crypto-utils "^1.0.1" + +hosted-git-info@^2.1.4: + version "2.7.1" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.7.1.tgz#97f236977bd6e125408930ff6de3eec6281ec047" + integrity sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w== + +html-encoding-sniffer@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz#e70d84b94da53aa375e11fe3a351be6642ca46f8" + integrity sha512-71lZziiDnsuabfdYiUeWdCVyKuqwWi23L8YeIgV9jSSZHCtb6wB1BKWooH7L3tn4/FuZJMVWyNaIDr4RGmaSYw== + dependencies: + whatwg-encoding "^1.0.1" + +html-void-elements@^1.0.0: + version "1.0.4" + resolved "https://registry.yarnpkg.com/html-void-elements/-/html-void-elements-1.0.4.tgz#95e8bb5ecd6b88766569c2645f2b5f1591db9ba5" + integrity sha512-yMk3naGPLrfvUV9TdDbuYXngh/TpHbA6TrOw3HL9kS8yhwx7i309BReNg7CbAJXGE+UMJ6je5OqJ7lC63o6YuQ== + +htmlescape@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/htmlescape/-/htmlescape-1.1.1.tgz#3a03edc2214bca3b66424a3e7959349509cb0351" + integrity sha1-OgPtwiFLyjtmQko+eVk0lQnLA1E= + +http-errors@^1.7.2: + version "1.7.2" + resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.2.tgz#4f5029cf13239f31036e5b2e55292bcfbcc85c8f" + integrity sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg== + dependencies: + depd "~1.1.2" + inherits "2.0.3" + setprototypeof "1.1.1" + statuses ">= 1.5.0 < 2" + toidentifier "1.0.0" + +http-parser-js@>=0.4.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/http-parser-js/-/http-parser-js-0.5.0.tgz#d65edbede84349d0dc30320815a15d39cc3cbbd8" + integrity sha512-cZdEF7r4gfRIq7ezX9J0T+kQmJNOub71dWbgAXVHDct80TKP4MCETtZQ31xyv38UwgzkWPYF/Xc0ge55dW9Z9w== + +http-signature@~1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" + integrity sha1-muzZJRFHcvPZW2WmCruPfBj7rOE= + dependencies: + assert-plus "^1.0.0" + jsprim "^1.2.2" + sshpk "^1.7.0" + +https-browserify@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73" + integrity sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM= + +iconv-lite@0.4.24, iconv-lite@^0.4.24, iconv-lite@^0.4.4: + version "0.4.24" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" + integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== + dependencies: + safer-buffer ">= 2.1.2 < 3" + +ieee754@^1.1.4: + version "1.1.13" + resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.13.tgz#ec168558e95aa181fd87d37f55c32bbcb6708b84" + integrity sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg== + +ignore-walk@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-3.0.1.tgz#a83e62e7d272ac0e3b551aaa82831a19b69f82f8" + integrity sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ== + dependencies: + minimatch "^3.0.4" + +ignore@^4.0.6: + version "4.0.6" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" + integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== + +import-fresh@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.0.0.tgz#a3d897f420cab0e671236897f75bc14b4885c390" + integrity sha512-pOnA9tfM3Uwics+SaBLCNyZZZbK+4PTu0OPZtLlMIrv17EdBoC15S9Kn8ckJ9TZTyKb3ywNE5y1yeDxxGA7nTQ== + dependencies: + parent-module "^1.0.0" + resolve-from "^4.0.0" + +import-local@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/import-local/-/import-local-2.0.0.tgz#55070be38a5993cf18ef6db7e961f5bee5c5a09d" + integrity sha512-b6s04m3O+s3CGSbqDIyP4R6aAwAeYlVq9+WUWep6iHa8ETRf9yei1U48C5MmfJmV9AiLYYBKPMq/W+/WRpQmCQ== + dependencies: + pkg-dir "^3.0.0" + resolve-cwd "^2.0.0" + +imurmurhash@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" + integrity sha1-khi5srkoojixPcT7a21XbyMUU+o= + +in-publish@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/in-publish/-/in-publish-2.0.0.tgz#e20ff5e3a2afc2690320b6dc552682a9c7fadf51" + integrity sha1-4g/146KvwmkDILbcVSaCqcf631E= + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2, inherits@2.0.3, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.1, inherits@~2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= + +inherits@2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.1.tgz#b17d08d326b4423e568eff719f91b0b1cbdf69f1" + integrity sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE= + +ini@^1.3.3, ini@~1.3.0: + version "1.3.5" + resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" + integrity sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw== + +inline-source-map@~0.6.0: + version "0.6.2" + resolved "https://registry.yarnpkg.com/inline-source-map/-/inline-source-map-0.6.2.tgz#f9393471c18a79d1724f863fa38b586370ade2a5" + integrity sha1-+Tk0ccGKedFyT4Y/o4tYY3Ct4qU= + dependencies: + source-map "~0.5.3" + +inquirer@^6.2.2: + version "6.3.1" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-6.3.1.tgz#7a413b5e7950811013a3db491c61d1f3b776e8e7" + integrity sha512-MmL624rfkFt4TG9y/Jvmt8vdmOo836U7Y0Hxr2aFk3RelZEGX4Igk0KabWrcaaZaTv9uzglOqWh1Vly+FAWAXA== + dependencies: + ansi-escapes "^3.2.0" + chalk "^2.4.2" + cli-cursor "^2.1.0" + cli-width "^2.0.0" + external-editor "^3.0.3" + figures "^2.0.0" + lodash "^4.17.11" + mute-stream "0.0.7" + run-async "^2.2.0" + rxjs "^6.4.0" + string-width "^2.1.0" + strip-ansi "^5.1.0" + through "^2.3.6" + +insert-module-globals@^7.0.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/insert-module-globals/-/insert-module-globals-7.2.0.tgz#ec87e5b42728479e327bd5c5c71611ddfb4752ba" + integrity sha512-VE6NlW+WGn2/AeOMd496AHFYmE7eLKkUY6Ty31k4og5vmA3Fjuwe9v6ifH6Xx/Hz27QvdoMoviw1/pqWRB09Sw== + dependencies: + JSONStream "^1.0.3" + acorn-node "^1.5.2" + combine-source-map "^0.8.0" + concat-stream "^1.6.1" + is-buffer "^1.1.0" + path-is-absolute "^1.0.1" + process "~0.11.0" + through2 "^2.0.0" + undeclared-identifiers "^1.1.2" + xtend "^4.0.0" + +interpret@^1.0.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.2.0.tgz#d5061a6224be58e8083985f5014d844359576296" + integrity sha512-mT34yGKMNceBQUoVn7iCDKDntA7SC6gycMAWzGx1z/CMCTV7b2AAtXlo3nRyHZ1FelRkQbQjprHSYGwzLtkVbw== + +invariant@^2.2.2, invariant@^2.2.4: + version "2.2.4" + resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" + integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA== + dependencies: + loose-envify "^1.0.0" + +invert-kv@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-2.0.0.tgz#7393f5afa59ec9ff5f67a27620d11c226e3eec02" + integrity sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA== + +is-absolute@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-absolute/-/is-absolute-1.0.0.tgz#395e1ae84b11f26ad1795e73c17378e48a301576" + integrity sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA== + dependencies: + is-relative "^1.0.0" + is-windows "^1.0.1" + +is-accessor-descriptor@^0.1.6: + version "0.1.6" + resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" + integrity sha1-qeEss66Nh2cn7u84Q/igiXtcmNY= + dependencies: + kind-of "^3.0.2" + +is-accessor-descriptor@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656" + integrity sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ== + dependencies: + kind-of "^6.0.0" + +is-alphabetical@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/is-alphabetical/-/is-alphabetical-1.0.3.tgz#eb04cc47219a8895d8450ace4715abff2258a1f8" + integrity sha512-eEMa6MKpHFzw38eKm56iNNi6GJ7lf6aLLio7Kr23sJPAECscgRtZvOBYybejWDQ2bM949Y++61PY+udzj5QMLA== + +is-alphanumeric@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-alphanumeric/-/is-alphanumeric-1.0.0.tgz#4a9cef71daf4c001c1d81d63d140cf53fd6889f4" + integrity sha1-Spzvcdr0wAHB2B1j0UDPU/1oifQ= + +is-alphanumerical@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/is-alphanumerical/-/is-alphanumerical-1.0.3.tgz#57ae21c374277b3defe0274c640a5704b8f6657c" + integrity sha512-A1IGAPO5AW9vSh7omxIlOGwIqEvpW/TA+DksVOPM5ODuxKlZS09+TEM1E3275lJqO2oJ38vDpeAL3DCIiHE6eA== + dependencies: + is-alphabetical "^1.0.0" + is-decimal "^1.0.0" + +is-arrayish@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" + integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= + +is-binary-path@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898" + integrity sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg= + dependencies: + binary-extensions "^1.0.0" + +is-buffer@^1.1.0, is-buffer@^1.1.4, is-buffer@^1.1.5: + version "1.1.6" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" + integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== + +is-buffer@^2.0.0: + version "2.0.3" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-2.0.3.tgz#4ecf3fcf749cbd1e472689e109ac66261a25e725" + integrity sha512-U15Q7MXTuZlrbymiz95PJpZxu8IlipAp4dtS3wOdgPXx3mqBnslrWU14kxfHB+Py/+2PVKSr37dMAgM2A4uArw== + +is-callable@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.4.tgz#1e1adf219e1eeb684d691f9d6a05ff0d30a24d75" + integrity sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA== + +is-ci@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-2.0.0.tgz#6bc6334181810e04b5c22b3d589fdca55026404c" + integrity sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w== + dependencies: + ci-info "^2.0.0" + +is-data-descriptor@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" + integrity sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y= + dependencies: + kind-of "^3.0.2" + +is-data-descriptor@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7" + integrity sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ== + dependencies: + kind-of "^6.0.0" + +is-date-object@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.1.tgz#9aa20eb6aeebbff77fbd33e74ca01b33581d3a16" + integrity sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY= + +is-decimal@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/is-decimal/-/is-decimal-1.0.3.tgz#381068759b9dc807d8c0dc0bfbae2b68e1da48b7" + integrity sha512-bvLSwoDg2q6Gf+E2LEPiklHZxxiSi3XAh4Mav65mKqTfCO1HM3uBs24TjEH8iJX3bbDdLXKJXBTmGzuTUuAEjQ== + +is-descriptor@^0.1.0: + version "0.1.6" + resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" + integrity sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg== + dependencies: + is-accessor-descriptor "^0.1.6" + is-data-descriptor "^0.1.4" + kind-of "^5.0.0" + +is-descriptor@^1.0.0, is-descriptor@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec" + integrity sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg== + dependencies: + is-accessor-descriptor "^1.0.0" + is-data-descriptor "^1.0.0" + kind-of "^6.0.2" + +is-extendable@^0.1.0, is-extendable@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" + integrity sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik= + +is-extendable@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4" + integrity sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA== + dependencies: + is-plain-object "^2.0.4" + +is-extglob@^2.1.0, is-extglob@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= + +is-fullwidth-code-point@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" + integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs= + dependencies: + number-is-nan "^1.0.0" + +is-fullwidth-code-point@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" + integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= + +is-generator-fn@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-generator-fn/-/is-generator-fn-2.1.0.tgz#7d140adc389aaf3011a8f2a2a4cfa6faadffb118" + integrity sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ== + +is-glob@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-3.1.0.tgz#7ba5ae24217804ac70707b96922567486cc3e84a" + integrity sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo= + dependencies: + is-extglob "^2.1.0" + +is-glob@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" + integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== + dependencies: + is-extglob "^2.1.1" + +is-hexadecimal@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/is-hexadecimal/-/is-hexadecimal-1.0.3.tgz#e8a426a69b6d31470d3a33a47bb825cda02506ee" + integrity sha512-zxQ9//Q3D/34poZf8fiy3m3XVpbQc7ren15iKqrTtLPwkPD/t3Scy9Imp63FujULGxuK0ZlCwoo5xNpktFgbOA== + +is-negated-glob@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-negated-glob/-/is-negated-glob-1.0.0.tgz#6910bca5da8c95e784b5751b976cf5a10fee36d2" + integrity sha1-aRC8pdqMleeEtXUbl2z1oQ/uNtI= + +is-number@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" + integrity sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU= + dependencies: + kind-of "^3.0.2" + +is-plain-obj@^1.0.0, is-plain-obj@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" + integrity sha1-caUMhCnfync8kqOQpKA7OfzVHT4= + +is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" + integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== + dependencies: + isobject "^3.0.1" + +is-promise@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa" + integrity sha1-eaKp7OfwlugPNtKy87wWwf9L8/o= + +is-regex@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.4.tgz#5517489b547091b0930e095654ced25ee97e9491" + integrity sha1-VRdIm1RwkbCTDglWVM7SXul+lJE= + dependencies: + has "^1.0.1" + +is-relative@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-relative/-/is-relative-1.0.0.tgz#a1bb6935ce8c5dba1e8b9754b9b2dcc020e2260d" + integrity sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA== + dependencies: + is-unc-path "^1.0.0" + +is-ssh@^1.3.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/is-ssh/-/is-ssh-1.3.1.tgz#f349a8cadd24e65298037a522cf7520f2e81a0f3" + integrity sha512-0eRIASHZt1E68/ixClI8bp2YK2wmBPVWEismTs6M+M099jKgrzl/3E976zIbImSIob48N2/XGe9y7ZiYdImSlg== + dependencies: + protocols "^1.1.0" + +is-stream@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" + integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= + +is-symbol@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.2.tgz#a055f6ae57192caee329e7a860118b497a950f38" + integrity sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw== + dependencies: + has-symbols "^1.0.0" + +is-typedarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" + integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo= + +is-unc-path@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-unc-path/-/is-unc-path-1.0.0.tgz#d731e8898ed090a12c352ad2eaed5095ad322c9d" + integrity sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ== + dependencies: + unc-path-regex "^0.1.2" + +is-utf8@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" + integrity sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI= + +is-valid-glob@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-valid-glob/-/is-valid-glob-1.0.0.tgz#29bf3eff701be2d4d315dbacc39bc39fe8f601aa" + integrity sha1-Kb8+/3Ab4tTTFdusw5vDn+j2Aao= + +is-whitespace-character@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/is-whitespace-character/-/is-whitespace-character-1.0.3.tgz#b3ad9546d916d7d3ffa78204bca0c26b56257fac" + integrity sha512-SNPgMLz9JzPccD3nPctcj8sZlX9DAMJSKH8bP7Z6bohCwuNgX8xbWr1eTAYXX9Vpi/aSn8Y1akL9WgM3t43YNQ== + +is-windows@^1.0.1, is-windows@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" + integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== + +is-word-character@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/is-word-character/-/is-word-character-1.0.3.tgz#264d15541cbad0ba833d3992c34e6b40873b08aa" + integrity sha512-0wfcrFgOOOBdgRNT9H33xe6Zi6yhX/uoc4U8NBZGeQQB0ctU1dnlNTyL9JM2646bHDTpsDm1Brb3VPoCIMrd/A== + +is-wsl@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-1.1.0.tgz#1f16e4aa22b04d1336b66188a66af3c600c3a66d" + integrity sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0= + +isarray@1.0.0, isarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= + +isobject@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" + integrity sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk= + dependencies: + isarray "1.0.0" + +isobject@^3.0.0, isobject@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" + integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= + +isstream@~0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" + integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo= + +istanbul-lib-coverage@^2.0.2, istanbul-lib-coverage@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz#675f0ab69503fad4b1d849f736baaca803344f49" + integrity sha512-8aXznuEPCJvGnMSRft4udDRDtb1V3pkQkMMI5LI+6HuQz5oQ4J2UFn1H82raA3qJtyOLkkwVqICBQkjnGtn5mA== + +istanbul-lib-instrument@^3.0.1, istanbul-lib-instrument@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-3.3.0.tgz#a5f63d91f0bbc0c3e479ef4c5de027335ec6d630" + integrity sha512-5nnIN4vo5xQZHdXno/YDXJ0G+I3dAm4XgzfSVTPLQpj/zAV2dV6Juy0yaf10/zrJOJeHoN3fraFe+XRq2bFVZA== + dependencies: + "@babel/generator" "^7.4.0" + "@babel/parser" "^7.4.3" + "@babel/template" "^7.4.0" + "@babel/traverse" "^7.4.3" + "@babel/types" "^7.4.0" + istanbul-lib-coverage "^2.0.5" + semver "^6.0.0" + +istanbul-lib-report@^2.0.4: + version "2.0.8" + resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-2.0.8.tgz#5a8113cd746d43c4889eba36ab10e7d50c9b4f33" + integrity sha512-fHBeG573EIihhAblwgxrSenp0Dby6tJMFR/HvlerBsrCTD5bkUuoNtn3gVh29ZCS824cGGBPn7Sg7cNk+2xUsQ== + dependencies: + istanbul-lib-coverage "^2.0.5" + make-dir "^2.1.0" + supports-color "^6.1.0" + +istanbul-lib-source-maps@^3.0.1: + version "3.0.6" + resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-3.0.6.tgz#284997c48211752ec486253da97e3879defba8c8" + integrity sha512-R47KzMtDJH6X4/YW9XTx+jrLnZnscW4VpNN+1PViSYTejLVPWv7oov+Duf8YQSPyVRUvueQqz1TcsC6mooZTXw== + dependencies: + debug "^4.1.1" + istanbul-lib-coverage "^2.0.5" + make-dir "^2.1.0" + rimraf "^2.6.3" + source-map "^0.6.1" + +istanbul-reports@^2.1.1: + version "2.2.6" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-2.2.6.tgz#7b4f2660d82b29303a8fe6091f8ca4bf058da1af" + integrity sha512-SKi4rnMyLBKe0Jy2uUdx28h8oG7ph2PPuQPvIAh31d+Ci+lSiEu4C+h3oBPuJ9+mPKhOyW0M8gY4U5NM1WLeXA== + dependencies: + handlebars "^4.1.2" + +jest-changed-files@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-24.8.0.tgz#7e7eb21cf687587a85e50f3d249d1327e15b157b" + integrity sha512-qgANC1Yrivsq+UrLXsvJefBKVoCsKB0Hv+mBb6NMjjZ90wwxCDmU3hsCXBya30cH+LnPYjwgcU65i6yJ5Nfuug== + dependencies: + "@jest/types" "^24.8.0" + execa "^1.0.0" + throat "^4.0.0" + +jest-cli@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-24.8.0.tgz#b075ac914492ed114fa338ade7362a301693e989" + integrity sha512-+p6J00jSMPQ116ZLlHJJvdf8wbjNbZdeSX9ptfHX06/MSNaXmKihQzx5vQcw0q2G6JsdVkUIdWbOWtSnaYs3yA== + dependencies: + "@jest/core" "^24.8.0" + "@jest/test-result" "^24.8.0" + "@jest/types" "^24.8.0" + chalk "^2.0.1" + exit "^0.1.2" + import-local "^2.0.0" + is-ci "^2.0.0" + jest-config "^24.8.0" + jest-util "^24.8.0" + jest-validate "^24.8.0" + prompts "^2.0.1" + realpath-native "^1.1.0" + yargs "^12.0.2" + +jest-config@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-24.8.0.tgz#77db3d265a6f726294687cbbccc36f8a76ee0f4f" + integrity sha512-Czl3Nn2uEzVGsOeaewGWoDPD8GStxCpAe0zOYs2x2l0fZAgPbCr3uwUkgNKV3LwE13VXythM946cd5rdGkkBZw== + dependencies: + "@babel/core" "^7.1.0" + "@jest/test-sequencer" "^24.8.0" + "@jest/types" "^24.8.0" + babel-jest "^24.8.0" + chalk "^2.0.1" + glob "^7.1.1" + jest-environment-jsdom "^24.8.0" + jest-environment-node "^24.8.0" + jest-get-type "^24.8.0" + jest-jasmine2 "^24.8.0" + jest-regex-util "^24.3.0" + jest-resolve "^24.8.0" + jest-util "^24.8.0" + jest-validate "^24.8.0" + micromatch "^3.1.10" + pretty-format "^24.8.0" + realpath-native "^1.1.0" + +jest-diff@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-24.8.0.tgz#146435e7d1e3ffdf293d53ff97e193f1d1546172" + integrity sha512-wxetCEl49zUpJ/bvUmIFjd/o52J+yWcoc5ZyPq4/W1LUKGEhRYDIbP1KcF6t+PvqNrGAFk4/JhtxDq/Nnzs66g== + dependencies: + chalk "^2.0.1" + diff-sequences "^24.3.0" + jest-get-type "^24.8.0" + pretty-format "^24.8.0" + +jest-docblock@^24.3.0: + version "24.3.0" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-24.3.0.tgz#b9c32dac70f72e4464520d2ba4aec02ab14db5dd" + integrity sha512-nlANmF9Yq1dufhFlKG9rasfQlrY7wINJbo3q01tu56Jv5eBU5jirylhF2O5ZBnLxzOVBGRDz/9NAwNyBtG4Nyg== + dependencies: + detect-newline "^2.1.0" + +jest-each@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-24.8.0.tgz#a05fd2bf94ddc0b1da66c6d13ec2457f35e52775" + integrity sha512-NrwK9gaL5+XgrgoCsd9svsoWdVkK4gnvyhcpzd6m487tXHqIdYeykgq3MKI1u4I+5Zf0tofr70at9dWJDeb+BA== + dependencies: + "@jest/types" "^24.8.0" + chalk "^2.0.1" + jest-get-type "^24.8.0" + jest-util "^24.8.0" + pretty-format "^24.8.0" + +jest-environment-jsdom@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-24.8.0.tgz#300f6949a146cabe1c9357ad9e9ecf9f43f38857" + integrity sha512-qbvgLmR7PpwjoFjM/sbuqHJt/NCkviuq9vus9NBn/76hhSidO+Z6Bn9tU8friecegbJL8gzZQEMZBQlFWDCwAQ== + dependencies: + "@jest/environment" "^24.8.0" + "@jest/fake-timers" "^24.8.0" + "@jest/types" "^24.8.0" + jest-mock "^24.8.0" + jest-util "^24.8.0" + jsdom "^11.5.1" + +jest-environment-node@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-24.8.0.tgz#d3f726ba8bc53087a60e7a84ca08883a4c892231" + integrity sha512-vIGUEScd1cdDgR6sqn2M08sJTRLQp6Dk/eIkCeO4PFHxZMOgy+uYLPMC4ix3PEfM5Au/x3uQ/5Tl0DpXXZsJ/Q== + dependencies: + "@jest/environment" "^24.8.0" + "@jest/fake-timers" "^24.8.0" + "@jest/types" "^24.8.0" + jest-mock "^24.8.0" + jest-util "^24.8.0" + +jest-get-type@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-24.8.0.tgz#a7440de30b651f5a70ea3ed7ff073a32dfe646fc" + integrity sha512-RR4fo8jEmMD9zSz2nLbs2j0zvPpk/KCEz3a62jJWbd2ayNo0cb+KFRxPHVhE4ZmgGJEQp0fosmNz84IfqM8cMQ== + +jest-haste-map@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-24.8.0.tgz#51794182d877b3ddfd6e6d23920e3fe72f305800" + integrity sha512-ZBPRGHdPt1rHajWelXdqygIDpJx8u3xOoLyUBWRW28r3tagrgoepPrzAozW7kW9HrQfhvmiv1tncsxqHJO1onQ== + dependencies: + "@jest/types" "^24.8.0" + anymatch "^2.0.0" + fb-watchman "^2.0.0" + graceful-fs "^4.1.15" + invariant "^2.2.4" + jest-serializer "^24.4.0" + jest-util "^24.8.0" + jest-worker "^24.6.0" + micromatch "^3.1.10" + sane "^4.0.3" + walker "^1.0.7" + optionalDependencies: + fsevents "^1.2.7" + +jest-jasmine2@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-24.8.0.tgz#a9c7e14c83dd77d8b15e820549ce8987cc8cd898" + integrity sha512-cEky88npEE5LKd5jPpTdDCLvKkdyklnaRycBXL6GNmpxe41F0WN44+i7lpQKa/hcbXaQ+rc9RMaM4dsebrYong== + dependencies: + "@babel/traverse" "^7.1.0" + "@jest/environment" "^24.8.0" + "@jest/test-result" "^24.8.0" + "@jest/types" "^24.8.0" + chalk "^2.0.1" + co "^4.6.0" + expect "^24.8.0" + is-generator-fn "^2.0.0" + jest-each "^24.8.0" + jest-matcher-utils "^24.8.0" + jest-message-util "^24.8.0" + jest-runtime "^24.8.0" + jest-snapshot "^24.8.0" + jest-util "^24.8.0" + pretty-format "^24.8.0" + throat "^4.0.0" + +jest-leak-detector@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-24.8.0.tgz#c0086384e1f650c2d8348095df769f29b48e6980" + integrity sha512-cG0yRSK8A831LN8lIHxI3AblB40uhv0z+SsQdW3GoMMVcK+sJwrIIyax5tu3eHHNJ8Fu6IMDpnLda2jhn2pD/g== + dependencies: + pretty-format "^24.8.0" + +jest-matcher-utils@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-24.8.0.tgz#2bce42204c9af12bde46f83dc839efe8be832495" + integrity sha512-lex1yASY51FvUuHgm0GOVj7DCYEouWSlIYmCW7APSqB9v8mXmKSn5+sWVF0MhuASG0bnYY106/49JU1FZNl5hw== + dependencies: + chalk "^2.0.1" + jest-diff "^24.8.0" + jest-get-type "^24.8.0" + pretty-format "^24.8.0" + +jest-message-util@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-24.8.0.tgz#0d6891e72a4beacc0292b638685df42e28d6218b" + integrity sha512-p2k71rf/b6ns8btdB0uVdljWo9h0ovpnEe05ZKWceQGfXYr4KkzgKo3PBi8wdnd9OtNh46VpNIJynUn/3MKm1g== + dependencies: + "@babel/code-frame" "^7.0.0" + "@jest/test-result" "^24.8.0" + "@jest/types" "^24.8.0" + "@types/stack-utils" "^1.0.1" + chalk "^2.0.1" + micromatch "^3.1.10" + slash "^2.0.0" + stack-utils "^1.0.1" + +jest-mock@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-24.8.0.tgz#2f9d14d37699e863f1febf4e4d5a33b7fdbbde56" + integrity sha512-6kWugwjGjJw+ZkK4mDa0Df3sDlUTsV47MSrT0nGQ0RBWJbpODDQ8MHDVtGtUYBne3IwZUhtB7elxHspU79WH3A== + dependencies: + "@jest/types" "^24.8.0" + +jest-pnp-resolver@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.1.tgz#ecdae604c077a7fbc70defb6d517c3c1c898923a" + integrity sha512-pgFw2tm54fzgYvc/OHrnysABEObZCUNFnhjoRjaVOCN8NYc032/gVjPaHD4Aq6ApkSieWtfKAFQtmDKAmhupnQ== + +jest-regex-util@^24.3.0: + version "24.3.0" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-24.3.0.tgz#d5a65f60be1ae3e310d5214a0307581995227b36" + integrity sha512-tXQR1NEOyGlfylyEjg1ImtScwMq8Oh3iJbGTjN7p0J23EuVX1MA8rwU69K4sLbCmwzgCUbVkm0FkSF9TdzOhtg== + +jest-resolve-dependencies@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-24.8.0.tgz#19eec3241f2045d3f990dba331d0d7526acff8e0" + integrity sha512-hyK1qfIf/krV+fSNyhyJeq3elVMhK9Eijlwy+j5jqmZ9QsxwKBiP6qukQxaHtK8k6zql/KYWwCTQ+fDGTIJauw== + dependencies: + "@jest/types" "^24.8.0" + jest-regex-util "^24.3.0" + jest-snapshot "^24.8.0" + +jest-resolve@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-24.8.0.tgz#84b8e5408c1f6a11539793e2b5feb1b6e722439f" + integrity sha512-+hjSzi1PoRvnuOICoYd5V/KpIQmkAsfjFO71458hQ2Whi/yf1GDeBOFj8Gxw4LrApHsVJvn5fmjcPdmoUHaVKw== + dependencies: + "@jest/types" "^24.8.0" + browser-resolve "^1.11.3" + chalk "^2.0.1" + jest-pnp-resolver "^1.2.1" + realpath-native "^1.1.0" + +jest-runner@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-24.8.0.tgz#4f9ae07b767db27b740d7deffad0cf67ccb4c5bb" + integrity sha512-utFqC5BaA3JmznbissSs95X1ZF+d+4WuOWwpM9+Ak356YtMhHE/GXUondZdcyAAOTBEsRGAgH/0TwLzfI9h7ow== + dependencies: + "@jest/console" "^24.7.1" + "@jest/environment" "^24.8.0" + "@jest/test-result" "^24.8.0" + "@jest/types" "^24.8.0" + chalk "^2.4.2" + exit "^0.1.2" + graceful-fs "^4.1.15" + jest-config "^24.8.0" + jest-docblock "^24.3.0" + jest-haste-map "^24.8.0" + jest-jasmine2 "^24.8.0" + jest-leak-detector "^24.8.0" + jest-message-util "^24.8.0" + jest-resolve "^24.8.0" + jest-runtime "^24.8.0" + jest-util "^24.8.0" + jest-worker "^24.6.0" + source-map-support "^0.5.6" + throat "^4.0.0" + +jest-runtime@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-24.8.0.tgz#05f94d5b05c21f6dc54e427cd2e4980923350620" + integrity sha512-Mq0aIXhvO/3bX44ccT+czU1/57IgOMyy80oM0XR/nyD5zgBcesF84BPabZi39pJVA6UXw+fY2Q1N+4BiVUBWOA== + dependencies: + "@jest/console" "^24.7.1" + "@jest/environment" "^24.8.0" + "@jest/source-map" "^24.3.0" + "@jest/transform" "^24.8.0" + "@jest/types" "^24.8.0" + "@types/yargs" "^12.0.2" + chalk "^2.0.1" + exit "^0.1.2" + glob "^7.1.3" + graceful-fs "^4.1.15" + jest-config "^24.8.0" + jest-haste-map "^24.8.0" + jest-message-util "^24.8.0" + jest-mock "^24.8.0" + jest-regex-util "^24.3.0" + jest-resolve "^24.8.0" + jest-snapshot "^24.8.0" + jest-util "^24.8.0" + jest-validate "^24.8.0" + realpath-native "^1.1.0" + slash "^2.0.0" + strip-bom "^3.0.0" + yargs "^12.0.2" + +jest-serializer@^24.4.0: + version "24.4.0" + resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-24.4.0.tgz#f70c5918c8ea9235ccb1276d232e459080588db3" + integrity sha512-k//0DtglVstc1fv+GY/VHDIjrtNjdYvYjMlbLUed4kxrE92sIUewOi5Hj3vrpB8CXfkJntRPDRjCrCvUhBdL8Q== + +jest-snapshot@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-24.8.0.tgz#3bec6a59da2ff7bc7d097a853fb67f9d415cb7c6" + integrity sha512-5ehtWoc8oU9/cAPe6fez6QofVJLBKyqkY2+TlKTOf0VllBB/mqUNdARdcjlZrs9F1Cv+/HKoCS/BknT0+tmfPg== + dependencies: + "@babel/types" "^7.0.0" + "@jest/types" "^24.8.0" + chalk "^2.0.1" + expect "^24.8.0" + jest-diff "^24.8.0" + jest-matcher-utils "^24.8.0" + jest-message-util "^24.8.0" + jest-resolve "^24.8.0" + mkdirp "^0.5.1" + natural-compare "^1.4.0" + pretty-format "^24.8.0" + semver "^5.5.0" + +jest-util@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-24.8.0.tgz#41f0e945da11df44cc76d64ffb915d0716f46cd1" + integrity sha512-DYZeE+XyAnbNt0BG1OQqKy/4GVLPtzwGx5tsnDrFcax36rVE3lTA5fbvgmbVPUZf9w77AJ8otqR4VBbfFJkUZA== + dependencies: + "@jest/console" "^24.7.1" + "@jest/fake-timers" "^24.8.0" + "@jest/source-map" "^24.3.0" + "@jest/test-result" "^24.8.0" + "@jest/types" "^24.8.0" + callsites "^3.0.0" + chalk "^2.0.1" + graceful-fs "^4.1.15" + is-ci "^2.0.0" + mkdirp "^0.5.1" + slash "^2.0.0" + source-map "^0.6.0" + +jest-validate@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-24.8.0.tgz#624c41533e6dfe356ffadc6e2423a35c2d3b4849" + integrity sha512-+/N7VOEMW1Vzsrk3UWBDYTExTPwf68tavEPKDnJzrC6UlHtUDU/fuEdXqFoHzv9XnQ+zW6X3qMZhJ3YexfeLDA== + dependencies: + "@jest/types" "^24.8.0" + camelcase "^5.0.0" + chalk "^2.0.1" + jest-get-type "^24.8.0" + leven "^2.1.0" + pretty-format "^24.8.0" + +jest-watcher@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-24.8.0.tgz#58d49915ceddd2de85e238f6213cef1c93715de4" + integrity sha512-SBjwHt5NedQoVu54M5GEx7cl7IGEFFznvd/HNT8ier7cCAx/Qgu9ZMlaTQkvK22G1YOpcWBLQPFSImmxdn3DAw== + dependencies: + "@jest/test-result" "^24.8.0" + "@jest/types" "^24.8.0" + "@types/yargs" "^12.0.9" + ansi-escapes "^3.0.0" + chalk "^2.0.1" + jest-util "^24.8.0" + string-length "^2.0.0" + +jest-worker@^24.6.0: + version "24.6.0" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-24.6.0.tgz#7f81ceae34b7cde0c9827a6980c35b7cdc0161b3" + integrity sha512-jDwgW5W9qGNvpI1tNnvajh0a5IE/PuGLFmHk6aR/BZFz8tSgGw17GsDPXAJ6p91IvYDjOw8GpFbvvZGAK+DPQQ== + dependencies: + merge-stream "^1.0.1" + supports-color "^6.1.0" + +jest@^24.1.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest/-/jest-24.8.0.tgz#d5dff1984d0d1002196e9b7f12f75af1b2809081" + integrity sha512-o0HM90RKFRNWmAWvlyV8i5jGZ97pFwkeVoGvPW1EtLTgJc2+jcuqcbbqcSZLE/3f2S5pt0y2ZBETuhpWNl1Reg== + dependencies: + import-local "^2.0.0" + jest-cli "^24.8.0" + +js-levenshtein@^1.1.3: + version "1.1.6" + resolved "https://registry.yarnpkg.com/js-levenshtein/-/js-levenshtein-1.1.6.tgz#c6cee58eb3550372df8deb85fad5ce66ce01d59d" + integrity sha512-X2BB11YZtrRqY4EnQcLX5Rh373zbK4alC1FW7D7MBhL2gtcC17cTnr6DmfHZeS0s2rTHjUTMMHfG7gO8SSdw+g== + +js-sha256@^0.9.0: + version "0.9.0" + resolved "https://registry.yarnpkg.com/js-sha256/-/js-sha256-0.9.0.tgz#0b89ac166583e91ef9123644bd3c5334ce9d0966" + integrity sha512-sga3MHh9sgQN2+pJ9VYZ+1LPwXOxuBJBA5nrR5/ofPfuiJBE2hnjsaN8se8JznOmGLN2p49Pe5U/ttafcs/apA== + +"js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== + +js-yaml@^3.10.0, js-yaml@^3.13.0, js-yaml@^3.13.1: + version "3.13.1" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847" + integrity sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw== + dependencies: + argparse "^1.0.7" + esprima "^4.0.0" + +jsbn@~0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" + integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM= + +jsdom@^11.5.1, jsdom@^11.9.0: + version "11.12.0" + resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-11.12.0.tgz#1a80d40ddd378a1de59656e9e6dc5a3ba8657bc8" + integrity sha512-y8Px43oyiBM13Zc1z780FrfNLJCXTL40EWlty/LXUtcjykRBNgLlCjWXpfSPBl2iv+N7koQN+dvqszHZgT/Fjw== + dependencies: + abab "^2.0.0" + acorn "^5.5.3" + acorn-globals "^4.1.0" + array-equal "^1.0.0" + cssom ">= 0.3.2 < 0.4.0" + cssstyle "^1.0.0" + data-urls "^1.0.0" + domexception "^1.0.1" + escodegen "^1.9.1" + html-encoding-sniffer "^1.0.2" + left-pad "^1.3.0" + nwsapi "^2.0.7" + parse5 "4.0.0" + pn "^1.1.0" + request "^2.87.0" + request-promise-native "^1.0.5" + sax "^1.2.4" + symbol-tree "^3.2.2" + tough-cookie "^2.3.4" + w3c-hr-time "^1.0.1" + webidl-conversions "^4.0.2" + whatwg-encoding "^1.0.3" + whatwg-mimetype "^2.1.0" + whatwg-url "^6.4.1" + ws "^5.2.0" + xml-name-validator "^3.0.0" + +jsesc@^2.5.1: + version "2.5.2" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" + integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== + +jsesc@~0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" + integrity sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0= + +json-parse-better-errors@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" + integrity sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw== + +json-schema-traverse@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" + integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== + +json-schema@0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" + integrity sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM= + +json-stable-stringify-without-jsonify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" + integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= + +json-stable-stringify@~0.0.0: + version "0.0.1" + resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-0.0.1.tgz#611c23e814db375527df851193db59dd2af27f45" + integrity sha1-YRwj6BTbN1Un34URk9tZ3Sryf0U= + dependencies: + jsonify "~0.0.0" + +json-stringify-safe@~5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" + integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= + +json5@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/json5/-/json5-2.1.0.tgz#e7a0c62c48285c628d20a10b85c89bb807c32850" + integrity sha512-8Mh9h6xViijj36g7Dxi+Y4S6hNGV96vcJZr/SrlHh1LR/pEn/8j/+qIBbs44YKl69Lrfctp4QD+AdWLTMqEZAQ== + dependencies: + minimist "^1.2.0" + +jsonfile@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" + integrity sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss= + optionalDependencies: + graceful-fs "^4.1.6" + +jsonify@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" + integrity sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM= + +jsonparse@^1.2.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280" + integrity sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA= + +jsprim@^1.2.2: + version "1.4.1" + resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" + integrity sha1-MT5mvB5cwG5Di8G3SZwuXFastqI= + dependencies: + assert-plus "1.0.0" + extsprintf "1.3.0" + json-schema "0.2.3" + verror "1.10.0" + +kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: + version "3.2.2" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" + integrity sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ= + dependencies: + is-buffer "^1.1.5" + +kind-of@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" + integrity sha1-IIE989cSkosgc3hpGkUGb65y3Vc= + dependencies: + is-buffer "^1.1.5" + +kind-of@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" + integrity sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw== + +kind-of@^6.0.0, kind-of@^6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051" + integrity sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA== + +kleur@^3.0.2: + version "3.0.3" + resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" + integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w== + +labeled-stream-splicer@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/labeled-stream-splicer/-/labeled-stream-splicer-2.0.2.tgz#42a41a16abcd46fd046306cf4f2c3576fffb1c21" + integrity sha512-Ca4LSXFFZUjPScRaqOcFxneA0VpKZr4MMYCljyQr4LIewTLb3Y0IUTIsnBBsVubIeEfxeSZpSjSsRM8APEQaAw== + dependencies: + inherits "^2.0.1" + stream-splicer "^2.0.0" + +lazystream@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/lazystream/-/lazystream-1.0.0.tgz#f6995fe0f820392f61396be89462407bb77168e4" + integrity sha1-9plf4PggOS9hOWvolGJAe7dxaOQ= + dependencies: + readable-stream "^2.0.5" + +lcid@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/lcid/-/lcid-2.0.0.tgz#6ef5d2df60e52f82eb228a4c373e8d1f397253cf" + integrity sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA== + dependencies: + invert-kv "^2.0.0" + +lead@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/lead/-/lead-1.0.0.tgz#6f14f99a37be3a9dd784f5495690e5903466ee42" + integrity sha1-bxT5mje+Op3XhPVJVpDlkDRm7kI= + dependencies: + flush-write-stream "^1.0.2" + +left-pad@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/left-pad/-/left-pad-1.3.0.tgz#5b8a3a7765dfe001261dde915589e782f8c94d1e" + integrity sha512-XI5MPzVNApjAyhQzphX8BkmKsKUxD4LdyK24iZeQGinBN9yTQT3bFlCBy/aVx2HrNcqQGsdot8ghrjyrvMCoEA== + +leven@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/leven/-/leven-2.1.0.tgz#c2e7a9f772094dee9d34202ae8acce4687875580" + integrity sha1-wuep93IJTe6dNCAq6KzORoeHVYA= + +levn@^0.3.0, levn@~0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" + integrity sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4= + dependencies: + prelude-ls "~1.1.2" + type-check "~0.3.2" + +livereload-js@^2.3.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/livereload-js/-/livereload-js-2.4.0.tgz#447c31cf1ea9ab52fc20db615c5ddf678f78009c" + integrity sha512-XPQH8Z2GDP/Hwz2PCDrh2mth4yFejwA1OZ/81Ti3LgKyhDcEjsSsqFWZojHG0va/duGd+WyosY7eXLDoOyqcPw== + +load-json-file@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-4.0.0.tgz#2f5f45ab91e33216234fd53adab668eb4ec0993b" + integrity sha1-L19Fq5HjMhYjT9U62rZo607AmTs= + dependencies: + graceful-fs "^4.1.2" + parse-json "^4.0.0" + pify "^3.0.0" + strip-bom "^3.0.0" + +localstorage-memory@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/localstorage-memory/-/localstorage-memory-1.0.3.tgz#566b37968fe0c4d76ba36a6da564fa613945ca72" + integrity sha512-t9P8WB6DcVttbw/W4PIE8HOqum8Qlvx5SjR6oInwR9Uia0EEmyUeBh7S+weKByW+l/f45Bj4L/dgZikGFDM6ng== + +locate-path@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-3.0.0.tgz#dbec3b3ab759758071b58fe59fc41871af21400e" + integrity sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A== + dependencies: + p-locate "^3.0.0" + path-exists "^3.0.0" + +lodash.memoize@~3.0.3: + version "3.0.4" + resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-3.0.4.tgz#2dcbd2c287cbc0a55cc42328bd0c736150d53e3f" + integrity sha1-LcvSwofLwKVcxCMovQxzYVDVPj8= + +lodash.sortby@^4.7.0: + version "4.7.0" + resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" + integrity sha1-7dFMgk4sycHgsKG0K7UhBRakJDg= + +lodash@^4.17.10, lodash@^4.17.11: + version "4.17.11" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" + integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg== + +longest-streak@^2.0.1: + version "2.0.3" + resolved "https://registry.yarnpkg.com/longest-streak/-/longest-streak-2.0.3.tgz#3de7a3f47ee18e9074ded8575b5c091f5d0a4105" + integrity sha512-9lz5IVdpwsKLMzQi0MQ+oD9EA0mIGcWYP7jXMTZVXP8D42PwuAk+M/HBFYQoxt1G5OR8m7aSIgb1UymfWGBWEw== + +loose-envify@^1.0.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" + integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== + dependencies: + js-tokens "^3.0.0 || ^4.0.0" + +make-dir@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-2.1.0.tgz#5f0310e18b8be898cc07009295a30ae41e91e6f5" + integrity sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA== + dependencies: + pify "^4.0.1" + semver "^5.6.0" + +makeerror@1.0.x: + version "1.0.11" + resolved "https://registry.yarnpkg.com/makeerror/-/makeerror-1.0.11.tgz#e01a5c9109f2af79660e4e8b9587790184f5a96c" + integrity sha1-4BpckQnyr3lmDk6LlYd5AYT1qWw= + dependencies: + tmpl "1.0.x" + +map-age-cleaner@^0.1.1: + version "0.1.3" + resolved "https://registry.yarnpkg.com/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz#7d583a7306434c055fe474b0f45078e6e1b4b92a" + integrity sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w== + dependencies: + p-defer "^1.0.0" + +map-cache@^0.2.0, map-cache@^0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" + integrity sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8= + +map-visit@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" + integrity sha1-7Nyo8TFE5mDxtb1B8S80edmN+48= + dependencies: + object-visit "^1.0.0" + +markdown-escapes@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/markdown-escapes/-/markdown-escapes-1.0.3.tgz#6155e10416efaafab665d466ce598216375195f5" + integrity sha512-XUi5HJhhV5R74k8/0H2oCbCiYf/u4cO/rX8tnGkRvrqhsr5BRNU6Mg0yt/8UIx1iIS8220BNJsDb7XnILhLepw== + +markdown-table@^1.1.0: + version "1.1.3" + resolved "https://registry.yarnpkg.com/markdown-table/-/markdown-table-1.1.3.tgz#9fcb69bcfdb8717bfd0398c6ec2d93036ef8de60" + integrity sha512-1RUZVgQlpJSPWYbFSpmudq5nHY1doEIv89gBtF0s4gW1GF2XorxcA/70M5vq7rLv0a6mhOUccRsqkwhwLCIQ2Q== + +marked@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/marked/-/marked-0.4.0.tgz#9ad2c2a7a1791f10a852e0112f77b571dce10c66" + integrity sha512-tMsdNBgOsrUophCAFQl0XPe6Zqk/uy9gnue+jIIKhykO51hxyu6uNx7zBPy0+y/WKYVZZMspV9YeXLNdKk+iYw== + +md5.js@^1.3.4: + version "1.3.5" + resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f" + integrity sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg== + dependencies: + hash-base "^3.0.0" + inherits "^2.0.1" + safe-buffer "^5.1.2" + +mdast-util-compact@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/mdast-util-compact/-/mdast-util-compact-1.0.3.tgz#98a25cc8a7865761a41477b3a87d1dcef0b1e79d" + integrity sha512-nRiU5GpNy62rZppDKbLwhhtw5DXoFMqw9UNZFmlPsNaQCZ//WLjGKUwWMdJrUH+Se7UvtO2gXtAMe0g/N+eI5w== + dependencies: + unist-util-visit "^1.1.0" + +mdast-util-definitions@^1.2.0: + version "1.2.4" + resolved "https://registry.yarnpkg.com/mdast-util-definitions/-/mdast-util-definitions-1.2.4.tgz#2b54ad4eecaff9d9fcb6bf6f9f6b68b232d77ca7" + integrity sha512-HfUArPog1j4Z78Xlzy9Q4aHLnrF/7fb57cooTHypyGoe2XFNbcx/kWZDoOz+ra8CkUzvg3+VHV434yqEd1DRmA== + dependencies: + unist-util-visit "^1.0.0" + +mdast-util-inject@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/mdast-util-inject/-/mdast-util-inject-1.1.0.tgz#db06b8b585be959a2dcd2f87f472ba9b756f3675" + integrity sha1-2wa4tYW+lZotzS+H9HK6m3VvNnU= + dependencies: + mdast-util-to-string "^1.0.0" + +mdast-util-to-hast@^3.0.0: + version "3.0.4" + resolved "https://registry.yarnpkg.com/mdast-util-to-hast/-/mdast-util-to-hast-3.0.4.tgz#132001b266031192348d3366a6b011f28e54dc40" + integrity sha512-/eIbly2YmyVgpJNo+bFLLMCI1XgolO/Ffowhf+pHDq3X4/V6FntC9sGQCDLM147eTS+uSXv5dRzJyFn+o0tazA== + dependencies: + collapse-white-space "^1.0.0" + detab "^2.0.0" + mdast-util-definitions "^1.2.0" + mdurl "^1.0.1" + trim "0.0.1" + trim-lines "^1.0.0" + unist-builder "^1.0.1" + unist-util-generated "^1.1.0" + unist-util-position "^3.0.0" + unist-util-visit "^1.1.0" + xtend "^4.0.1" + +mdast-util-to-string@^1.0.0, mdast-util-to-string@^1.0.5: + version "1.0.6" + resolved "https://registry.yarnpkg.com/mdast-util-to-string/-/mdast-util-to-string-1.0.6.tgz#7d85421021343b33de1552fc71cb8e5b4ae7536d" + integrity sha512-868pp48gUPmZIhfKrLbaDneuzGiw3OTDjHc5M1kAepR2CWBJ+HpEsm252K4aXdiP5coVZaJPOqGtVU6Po8xnXg== + +mdast-util-toc@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/mdast-util-toc/-/mdast-util-toc-3.1.0.tgz#395eeb877f067f9d2165d990d77c7eea6f740934" + integrity sha512-Za0hqL1PqWrvxGtA/3NH9D5nhGAUS9grMM4obEAz5+zsk1RIw/vWUchkaoDLNdrwk05A0CSC5eEXng36/1qE5w== + dependencies: + github-slugger "^1.2.1" + mdast-util-to-string "^1.0.5" + unist-util-is "^2.1.2" + unist-util-visit "^1.1.0" + +mdurl@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/mdurl/-/mdurl-1.0.1.tgz#fe85b2ec75a59037f2adfec100fd6c601761152e" + integrity sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4= + +mem@^4.0.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/mem/-/mem-4.3.0.tgz#461af497bc4ae09608cdb2e60eefb69bff744178" + integrity sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w== + dependencies: + map-age-cleaner "^0.1.1" + mimic-fn "^2.0.0" + p-is-promise "^2.0.0" + +merge-stream@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-1.0.1.tgz#4041202d508a342ba00174008df0c251b8c135e1" + integrity sha1-QEEgLVCKNCugAXQAjfDCUbjBNeE= + dependencies: + readable-stream "^2.0.1" + +micromatch@^3.1.10, micromatch@^3.1.4, micromatch@^3.1.5: + version "3.1.10" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" + integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg== + dependencies: + arr-diff "^4.0.0" + array-unique "^0.3.2" + braces "^2.3.1" + define-property "^2.0.2" + extend-shallow "^3.0.2" + extglob "^2.0.4" + fragment-cache "^0.2.1" + kind-of "^6.0.2" + nanomatch "^1.2.9" + object.pick "^1.3.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.2" + +miller-rabin@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/miller-rabin/-/miller-rabin-4.0.1.tgz#f080351c865b0dc562a8462966daa53543c78a4d" + integrity sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA== + dependencies: + bn.js "^4.0.0" + brorand "^1.0.1" + +mime-db@1.40.0: + version "1.40.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.40.0.tgz#a65057e998db090f732a68f6c276d387d4126c32" + integrity sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA== + +mime-types@^2.1.12, mime-types@~2.1.19: + version "2.1.24" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.24.tgz#b6f8d0b3e951efb77dedeca194cff6d16f676f81" + integrity sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ== + dependencies: + mime-db "1.40.0" + +mime@^2.2.0: + version "2.4.4" + resolved "https://registry.yarnpkg.com/mime/-/mime-2.4.4.tgz#bd7b91135fc6b01cde3e9bae33d659b63d8857e5" + integrity sha512-LRxmNwziLPT828z+4YkNzloCFC2YM4wrB99k+AV5ZbEyfGNWfG8SO1FUXLmLDBSo89NrJZ4DIWeLjy1CHGhMGA== + +mimic-fn@^1.0.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" + integrity sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ== + +mimic-fn@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" + integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== + +minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" + integrity sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A== + +minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" + integrity sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo= + +minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== + dependencies: + brace-expansion "^1.1.7" + +minimist@0.0.8: + version "0.0.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" + integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= + +minimist@^1.1.0, minimist@^1.1.1, minimist@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" + integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ= + +minimist@~0.0.1: + version "0.0.10" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf" + integrity sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8= + +minipass@^2.2.1, minipass@^2.3.5: + version "2.3.5" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.3.5.tgz#cacebe492022497f656b0f0f51e2682a9ed2d848" + integrity sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA== + dependencies: + safe-buffer "^5.1.2" + yallist "^3.0.0" + +minizlib@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.2.1.tgz#dd27ea6136243c7c880684e8672bb3a45fd9b614" + integrity sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA== + dependencies: + minipass "^2.2.1" + +mixin-deep@^1.2.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.1.tgz#a49e7268dce1a0d9698e45326c5626df3543d0fe" + integrity sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ== + dependencies: + for-in "^1.0.2" + is-extendable "^1.0.1" + +mkdirp@^0.5.0, mkdirp@^0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" + integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= + dependencies: + minimist "0.0.8" + +module-deps-sortable@5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/module-deps-sortable/-/module-deps-sortable-5.0.0.tgz#99db5bb08f7eab55e4c31f6b7c722c6a2144ba74" + integrity sha512-bnGGeghQmz/t/6771/KC4FmxpVm126iR6AAzzq4N6hVZQVl4+ZZBv+VF3PJmDyxXtVtgcgTSSP7NL+jq1QAHrg== + dependencies: + JSONStream "^1.0.3" + browser-resolve "^1.7.0" + cached-path-relative "^1.0.0" + concat-stream "~1.5.0" + defined "^1.0.0" + detective "^4.0.0" + duplexer2 "^0.1.2" + inherits "^2.0.1" + readable-stream "^2.0.2" + resolve "^1.1.3" + stream-combiner2 "^1.1.1" + subarg "^1.0.0" + through2 "^2.0.0" + xtend "^4.0.0" + +module-deps@^6.0.0: + version "6.2.1" + resolved "https://registry.yarnpkg.com/module-deps/-/module-deps-6.2.1.tgz#cfe558784060e926824f474b4e647287837cda50" + integrity sha512-UnEn6Ah36Tu4jFiBbJVUtt0h+iXqxpLqDvPS8nllbw5RZFmNJ1+Mz5BjYnM9ieH80zyxHkARGLnMIHlPK5bu6A== + dependencies: + JSONStream "^1.0.3" + browser-resolve "^1.7.0" + cached-path-relative "^1.0.2" + concat-stream "~1.6.0" + defined "^1.0.0" + detective "^5.0.2" + duplexer2 "^0.1.2" + inherits "^2.0.1" + parents "^1.0.0" + readable-stream "^2.0.2" + resolve "^1.4.0" + stream-combiner2 "^1.1.1" + subarg "^1.0.0" + through2 "^2.0.0" + xtend "^4.0.0" + +ms@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= + +ms@^2.1.1: + version "2.1.2" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" + integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== + +mute-stream@0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" + integrity sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s= + +nan@^2.12.1: + version "2.14.0" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.0.tgz#7818f722027b2459a86f0295d434d1fc2336c52c" + integrity sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg== + +nanomatch@^1.2.9: + version "1.2.13" + resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" + integrity sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA== + dependencies: + arr-diff "^4.0.0" + array-unique "^0.3.2" + define-property "^2.0.2" + extend-shallow "^3.0.2" + fragment-cache "^0.2.1" + is-windows "^1.0.2" + kind-of "^6.0.2" + object.pick "^1.3.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +natural-compare@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" + integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= + +needle@^2.2.1: + version "2.4.0" + resolved "https://registry.yarnpkg.com/needle/-/needle-2.4.0.tgz#6833e74975c444642590e15a750288c5f939b57c" + integrity sha512-4Hnwzr3mi5L97hMYeNl8wRW/Onhy4nUKR/lVemJ8gJedxxUyBLm9kkrDColJvoSfwi0jCNhD+xCdOtiGDQiRZg== + dependencies: + debug "^3.2.6" + iconv-lite "^0.4.4" + sax "^1.2.4" + +neo-async@^2.6.0: + version "2.6.1" + resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.1.tgz#ac27ada66167fa8849a6addd837f6b189ad2081c" + integrity sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw== + +nice-try@^1.0.4: + version "1.0.5" + resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" + integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== + +node-fetch@^2.3.0: + version "2.6.0" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.0.tgz#e633456386d4aa55863f676a7ab0daa8fdecb0fd" + integrity sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA== + +node-int64@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" + integrity sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs= + +node-modules-regexp@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz#8d9dbe28964a4ac5712e9131642107c71e90ec40" + integrity sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA= + +node-notifier@^5.2.1: + version "5.4.0" + resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-5.4.0.tgz#7b455fdce9f7de0c63538297354f3db468426e6a" + integrity sha512-SUDEb+o71XR5lXSTyivXd9J7fCloE3SyP4lSgt3lU2oSANiox+SxlNRGPjDKrwU1YN3ix2KN/VGGCg0t01rttQ== + dependencies: + growly "^1.3.0" + is-wsl "^1.1.0" + semver "^5.5.0" + shellwords "^0.1.1" + which "^1.3.0" + +node-pre-gyp@^0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.12.0.tgz#39ba4bb1439da030295f899e3b520b7785766149" + integrity sha512-4KghwV8vH5k+g2ylT+sLTjy5wmUOb9vPhnM8NHvRf9dHmnW/CndrFXy2aRPaPST6dugXSdHXfeaHQm77PIz/1A== + dependencies: + detect-libc "^1.0.2" + mkdirp "^0.5.1" + needle "^2.2.1" + nopt "^4.0.1" + npm-packlist "^1.1.6" + npmlog "^4.0.2" + rc "^1.2.7" + rimraf "^2.6.1" + semver "^5.3.0" + tar "^4" + +node-releases@^1.1.23: + version "1.1.23" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.23.tgz#de7409f72de044a2fa59c097f436ba89c39997f0" + integrity sha512-uq1iL79YjfYC0WXoHbC/z28q/9pOl8kSHaXdWmAAc8No+bDwqkZbzIJz55g/MUsPgSGm9LZ7QSUbzTcH5tz47w== + dependencies: + semver "^5.3.0" + +nopt@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d" + integrity sha1-0NRoWv1UFRk8jHUFYC0NF81kR00= + dependencies: + abbrev "1" + osenv "^0.1.4" + +normalize-package-data@^2.3.2: + version "2.5.0" + resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" + integrity sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA== + dependencies: + hosted-git-info "^2.1.4" + resolve "^1.10.0" + semver "2 || 3 || 4 || 5" + validate-npm-package-license "^3.0.1" + +normalize-path@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" + integrity sha1-GrKLVW4Zg2Oowab35vogE3/mrtk= + dependencies: + remove-trailing-separator "^1.0.1" + +normalize-path@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" + integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== + +normalize-url@^1.9.1: + version "1.9.1" + resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-1.9.1.tgz#2cc0d66b31ea23036458436e3620d85954c66c3c" + integrity sha1-LMDWazHqIwNkWENuNiDYWVTGbDw= + dependencies: + object-assign "^4.0.1" + prepend-http "^1.0.0" + query-string "^4.1.0" + sort-keys "^1.0.0" + +now-and-later@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/now-and-later/-/now-and-later-2.0.1.tgz#8e579c8685764a7cc02cb680380e94f43ccb1f7c" + integrity sha512-KGvQ0cB70AQfg107Xvs/Fbu+dGmZoTRJp2TaPwcwQm3/7PteUyN2BCgk8KBMPGBUXZdVwyWS8fDCGFygBm19UQ== + dependencies: + once "^1.3.2" + +npm-bundled@^1.0.1: + version "1.0.6" + resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.0.6.tgz#e7ba9aadcef962bb61248f91721cd932b3fe6bdd" + integrity sha512-8/JCaftHwbd//k6y2rEWp6k1wxVfpFzB6t1p825+cUb7Ym2XQfhwIC5KwhrvzZRJu+LtDE585zVaS32+CGtf0g== + +npm-packlist@^1.1.6: + version "1.4.1" + resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.4.1.tgz#19064cdf988da80ea3cee45533879d90192bbfbc" + integrity sha512-+TcdO7HJJ8peiiYhvPxsEDhF3PJFGUGRcFsGve3vxvxdcpO2Z4Z7rkosRM0kWj6LfbK/P0gu3dzk5RU1ffvFcw== + dependencies: + ignore-walk "^3.0.1" + npm-bundled "^1.0.1" + +npm-run-path@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" + integrity sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8= + dependencies: + path-key "^2.0.0" + +npmlog@^4.0.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" + integrity sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg== + dependencies: + are-we-there-yet "~1.1.2" + console-control-strings "~1.1.0" + gauge "~2.7.3" + set-blocking "~2.0.0" + +number-is-nan@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" + integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= + +nwsapi@^2.0.7: + version "2.1.4" + resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.1.4.tgz#e006a878db23636f8e8a67d33ca0e4edf61a842f" + integrity sha512-iGfd9Y6SFdTNldEy2L0GUhcarIutFmk+MPWIn9dmj8NMIup03G08uUF2KGbbmv/Ux4RT0VZJoP/sVbWA6d/VIw== + +o3@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/o3/-/o3-1.0.3.tgz#192ce877a882dfa6751f0412a865fafb2da1dac0" + integrity sha1-GSzod6iC36Z1HwQSqGX6+y2h2sA= + dependencies: + capability "^0.2.5" + +oauth-sign@~0.9.0: + version "0.9.0" + resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" + integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== + +object-assign@^4.0.1, object-assign@^4.1.0, object-assign@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= + +object-copy@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" + integrity sha1-fn2Fi3gb18mRpBupde04EnVOmYw= + dependencies: + copy-descriptor "^0.1.0" + define-property "^0.2.5" + kind-of "^3.0.3" + +object-keys@^1.0.11, object-keys@^1.0.12: + version "1.1.1" + resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" + integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== + +object-visit@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" + integrity sha1-95xEk68MU3e1n+OdOV5BBC3QRbs= + dependencies: + isobject "^3.0.0" + +object.assign@^4.0.4: + version "4.1.0" + resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.0.tgz#968bf1100d7956bb3ca086f006f846b3bc4008da" + integrity sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w== + dependencies: + define-properties "^1.1.2" + function-bind "^1.1.1" + has-symbols "^1.0.0" + object-keys "^1.0.11" + +object.getownpropertydescriptors@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz#8758c846f5b407adab0f236e0986f14b051caa16" + integrity sha1-h1jIRvW0B62rDyNuCYbxSwUcqhY= + dependencies: + define-properties "^1.1.2" + es-abstract "^1.5.1" + +object.pick@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" + integrity sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c= + dependencies: + isobject "^3.0.1" + +once@^1.3.0, once@^1.3.1, once@^1.3.2, once@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= + dependencies: + wrappy "1" + +onetime@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4" + integrity sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ= + dependencies: + mimic-fn "^1.0.0" + +optimist@^0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686" + integrity sha1-2j6nRob6IaGaERwybpDrFaAZZoY= + dependencies: + minimist "~0.0.1" + wordwrap "~0.0.2" + +optionator@^0.8.1, optionator@^0.8.2: + version "0.8.2" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" + integrity sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q= + dependencies: + deep-is "~0.1.3" + fast-levenshtein "~2.0.4" + levn "~0.3.0" + prelude-ls "~1.1.2" + type-check "~0.3.2" + wordwrap "~1.0.0" + +ordered-read-streams@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/ordered-read-streams/-/ordered-read-streams-1.0.1.tgz#77c0cb37c41525d64166d990ffad7ec6a0e1363e" + integrity sha1-d8DLN8QVJdZBZtmQ/61+xqDhNj4= + dependencies: + readable-stream "^2.0.1" + +os-browserify@~0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/os-browserify/-/os-browserify-0.3.0.tgz#854373c7f5c2315914fc9bfc6bd8238fdda1ec27" + integrity sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc= + +os-homedir@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" + integrity sha1-/7xJiDNuDoM94MFox+8VISGqf7M= + +os-locale@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-3.1.0.tgz#a802a6ee17f24c10483ab9935719cef4ed16bf1a" + integrity sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q== + dependencies: + execa "^1.0.0" + lcid "^2.0.0" + mem "^4.0.0" + +os-tmpdir@^1.0.0, os-tmpdir@~1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" + integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= + +osenv@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410" + integrity sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g== + dependencies: + os-homedir "^1.0.0" + os-tmpdir "^1.0.0" + +p-defer@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-defer/-/p-defer-1.0.0.tgz#9f6eb182f6c9aa8cd743004a7d4f96b196b0fb0c" + integrity sha1-n26xgvbJqozXQwBKfU+WsZaw+ww= + +p-each-series@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-each-series/-/p-each-series-1.0.0.tgz#930f3d12dd1f50e7434457a22cd6f04ac6ad7f71" + integrity sha1-kw89Et0fUOdDRFeiLNbwSsatf3E= + dependencies: + p-reduce "^1.0.0" + +p-finally@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" + integrity sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4= + +p-is-promise@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/p-is-promise/-/p-is-promise-2.1.0.tgz#918cebaea248a62cf7ffab8e3bca8c5f882fc42e" + integrity sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg== + +p-limit@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.2.0.tgz#417c9941e6027a9abcba5092dd2904e255b5fbc2" + integrity sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ== + dependencies: + p-try "^2.0.0" + +p-locate@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-3.0.0.tgz#322d69a05c0264b25997d9f40cd8a891ab0064a4" + integrity sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ== + dependencies: + p-limit "^2.0.0" + +p-reduce@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-reduce/-/p-reduce-1.0.0.tgz#18c2b0dd936a4690a529f8231f58a0fdb6a47dfa" + integrity sha1-GMKw3ZNqRpClKfgjH1ig/bakffo= + +p-try@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" + integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== + +pako@~1.0.5: + version "1.0.10" + resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.10.tgz#4328badb5086a426aa90f541977d4955da5c9732" + integrity sha512-0DTvPVU3ed8+HNXOu5Bs+o//Mbdj9VNQMUOe9oKCwh8l0GNwpTDMKCWbRjgtD291AWnkAgkqA/LOnQS8AmS1tw== + +parent-module@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" + integrity sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g== + dependencies: + callsites "^3.0.0" + +parents@^1.0.0, parents@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/parents/-/parents-1.0.1.tgz#fedd4d2bf193a77745fe71e371d73c3307d9c751" + integrity sha1-/t1NK/GTp3dF/nHjcdc8MwfZx1E= + dependencies: + path-platform "~0.11.15" + +parse-asn1@^5.0.0: + version "5.1.4" + resolved "https://registry.yarnpkg.com/parse-asn1/-/parse-asn1-5.1.4.tgz#37f6628f823fbdeb2273b4d540434a22f3ef1fcc" + integrity sha512-Qs5duJcuvNExRfFZ99HDD3z4mAi3r9Wl/FOjEOijlxwCZs7E7mW2vjTpgQ4J8LpTF8x5v+1Vn5UQFejmWT11aw== + dependencies: + asn1.js "^4.0.0" + browserify-aes "^1.0.0" + create-hash "^1.1.0" + evp_bytestokey "^1.0.0" + pbkdf2 "^3.0.3" + safe-buffer "^5.1.1" + +parse-entities@^1.0.2, parse-entities@^1.1.0: + version "1.2.2" + resolved "https://registry.yarnpkg.com/parse-entities/-/parse-entities-1.2.2.tgz#c31bf0f653b6661354f8973559cb86dd1d5edf50" + integrity sha512-NzfpbxW/NPrzZ/yYSoQxyqUZMZXIdCfE0OIN4ESsnptHJECoUk3FZktxNuzQf4tjt5UEopnxpYJbvYuxIFDdsg== + dependencies: + character-entities "^1.0.0" + character-entities-legacy "^1.0.0" + character-reference-invalid "^1.0.0" + is-alphanumerical "^1.0.0" + is-decimal "^1.0.0" + is-hexadecimal "^1.0.0" + +parse-filepath@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/parse-filepath/-/parse-filepath-1.0.2.tgz#a632127f53aaf3d15876f5872f3ffac763d6c891" + integrity sha1-pjISf1Oq89FYdvWHLz/6x2PWyJE= + dependencies: + is-absolute "^1.0.0" + map-cache "^0.2.0" + path-root "^0.1.1" + +parse-git-config@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/parse-git-config/-/parse-git-config-0.2.0.tgz#272833fdd15fea146fb75d336d236b963b6ff706" + integrity sha1-Jygz/dFf6hRvt10zbSNrljtv9wY= + dependencies: + ini "^1.3.3" + +parse-json@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0" + integrity sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA= + dependencies: + error-ex "^1.3.1" + json-parse-better-errors "^1.0.1" + +parse-path@^3.0.1: + version "3.0.4" + resolved "https://registry.yarnpkg.com/parse-path/-/parse-path-3.0.4.tgz#a48b7b529da41f34d9d1428602a39b29fc7180e4" + integrity sha512-wP70vtwv2DyrM2YoA7ZHVv4zIXa4P7dGgHlj+VwyXNDduLLVJ7NMY1zsFxjUUJ3DAwJLupGb1H5gMDDiNlJaxw== + dependencies: + is-ssh "^1.3.0" + protocols "^1.4.0" + +parse-url@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/parse-url/-/parse-url-3.0.2.tgz#602787a7063a795d72b8673197505e72f60610be" + integrity sha1-YCeHpwY6eV1yuGcxl1BecvYGEL4= + dependencies: + is-ssh "^1.3.0" + normalize-url "^1.9.1" + parse-path "^3.0.1" + protocols "^1.4.0" + +parse5@4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/parse5/-/parse5-4.0.0.tgz#6d78656e3da8d78b4ec0b906f7c08ef1dfe3f608" + integrity sha512-VrZ7eOd3T1Fk4XWNXMgiGBK/z0MG48BWG2uQNU4I72fkQuKUTZpl+u9k+CxEG0twMVzSmXEEz12z5Fnw1jIQFA== + +pascalcase@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" + integrity sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ= + +path-browserify@~0.0.0: + version "0.0.1" + resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-0.0.1.tgz#e6c4ddd7ed3aa27c68a20cc4e50e1a4ee83bbc4a" + integrity sha512-BapA40NHICOS+USX9SN4tyhq+A2RrN/Ws5F0Z5aMHDp98Fl86lX8Oti8B7uN93L4Ifv4fHOEA+pQw87gmMO/lQ== + +path-dirname@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0" + integrity sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA= + +path-exists@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" + integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU= + +path-is-absolute@^1.0.0, path-is-absolute@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= + +path-is-inside@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" + integrity sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM= + +path-key@^2.0.0, path-key@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" + integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= + +path-parse@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" + integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== + +path-platform@~0.11.15: + version "0.11.15" + resolved "https://registry.yarnpkg.com/path-platform/-/path-platform-0.11.15.tgz#e864217f74c36850f0852b78dc7bf7d4a5721bf2" + integrity sha1-6GQhf3TDaFDwhSt43Hv31KVyG/I= + +path-root-regex@^0.1.0: + version "0.1.2" + resolved "https://registry.yarnpkg.com/path-root-regex/-/path-root-regex-0.1.2.tgz#bfccdc8df5b12dc52c8b43ec38d18d72c04ba96d" + integrity sha1-v8zcjfWxLcUsi0PsONGNcsBLqW0= + +path-root@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/path-root/-/path-root-0.1.1.tgz#9a4a6814cac1c0cd73360a95f32083c8ea4745b7" + integrity sha1-mkpoFMrBwM1zNgqV8yCDyOpHRbc= + dependencies: + path-root-regex "^0.1.0" + +path-type@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-3.0.0.tgz#cef31dc8e0a1a3bb0d105c0cd97cf3bf47f4e36f" + integrity sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg== + dependencies: + pify "^3.0.0" + +pbkdf2@^3.0.3: + version "3.0.17" + resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.0.17.tgz#976c206530617b14ebb32114239f7b09336e93a6" + integrity sha512-U/il5MsrZp7mGg3mSQfn742na2T+1/vHDCG5/iTI3X9MKUuYUZVLQhyRsg06mCgDBTd57TxzgZt7P+fYfjRLtA== + dependencies: + create-hash "^1.1.2" + create-hmac "^1.1.4" + ripemd160 "^2.0.1" + safe-buffer "^5.0.1" + sha.js "^2.4.8" + +performance-now@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" + integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= + +pify@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" + integrity sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY= + +pify@^4.0.0, pify@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/pify/-/pify-4.0.1.tgz#4b2cd25c50d598735c50292224fd8c6df41e3231" + integrity sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g== + +pirates@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.1.tgz#643a92caf894566f91b2b986d2c66950a8e2fb87" + integrity sha512-WuNqLTbMI3tmfef2TKxlQmAiLHKtFhlsCZnPIpuv2Ow0RDVO8lfy1Opf4NUzlMXLjPl+Men7AuVdX6TA+s+uGA== + dependencies: + node-modules-regexp "^1.0.0" + +pkg-dir@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-3.0.0.tgz#2749020f239ed990881b1f71210d51eb6523bea3" + integrity sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw== + dependencies: + find-up "^3.0.0" + +pn@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/pn/-/pn-1.1.0.tgz#e2f4cef0e219f463c179ab37463e4e1ecdccbafb" + integrity sha512-2qHaIQr2VLRFoxe2nASzsV6ef4yOOH+Fi9FBOVH6cqeSgUnoyySPZkxzLuzd+RYOQTRpROA0ztTMqxROKSb/nA== + +posix-character-classes@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" + integrity sha1-AerA/jta9xoqbAL+q7jB/vfgDqs= + +prelude-ls@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" + integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= + +prepend-http@^1.0.0: + version "1.0.4" + resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc" + integrity sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw= + +pretty-format@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-24.8.0.tgz#8dae7044f58db7cb8be245383b565a963e3c27f2" + integrity sha512-P952T7dkrDEplsR+TuY7q3VXDae5Sr7zmQb12JU/NDQa/3CH7/QW0yvqLcGN6jL+zQFKaoJcPc+yJxMTGmosqw== + dependencies: + "@jest/types" "^24.8.0" + ansi-regex "^4.0.0" + ansi-styles "^3.2.0" + react-is "^16.8.4" + +private@^0.1.6: + version "0.1.8" + resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" + integrity sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg== + +process-nextick-args@^2.0.0, process-nextick-args@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa" + integrity sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw== + +process-nextick-args@~1.0.6: + version "1.0.7" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3" + integrity sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M= + +process@~0.11.0: + version "0.11.10" + resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" + integrity sha1-czIwDoQBYb2j5podHZGn1LwW8YI= + +progress@^2.0.0: + version "2.0.3" + resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" + integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== + +prompts@^2.0.1: + version "2.1.0" + resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.1.0.tgz#bf90bc71f6065d255ea2bdc0fe6520485c1b45db" + integrity sha512-+x5TozgqYdOwWsQFZizE/Tra3fKvAoy037kOyU6cgz84n8f6zxngLOV4O32kTwt9FcLCxAqw0P/c8rOr9y+Gfg== + dependencies: + kleur "^3.0.2" + sisteransi "^1.0.0" + +property-information@^4.0.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/property-information/-/property-information-4.2.0.tgz#f0e66e07cbd6fed31d96844d958d153ad3eb486e" + integrity sha512-TlgDPagHh+eBKOnH2VYvk8qbwsCG/TAJdmTL7f1PROUcSO8qt/KSmShEQ/OKvock8X9tFjtqjCScyOkkkvIKVQ== + dependencies: + xtend "^4.0.1" + +protocols@^1.1.0, protocols@^1.4.0: + version "1.4.7" + resolved "https://registry.yarnpkg.com/protocols/-/protocols-1.4.7.tgz#95f788a4f0e979b291ffefcf5636ad113d037d32" + integrity sha512-Fx65lf9/YDn3hUX08XUc0J8rSux36rEsyiv21ZGUC1mOyeM3lTRpZLcrm8aAolzS4itwVfm7TAPyxC2E5zd6xg== + +psl@^1.1.24, psl@^1.1.28: + version "1.1.32" + resolved "https://registry.yarnpkg.com/psl/-/psl-1.1.32.tgz#3f132717cf2f9c169724b2b6caf373cf694198db" + integrity sha512-MHACAkHpihU/REGGPLj4sEfc/XKW2bheigvHO1dUqjaKigMp1C8+WLQYRGgeKFMsw5PMfegZcaN8IDXK/cD0+g== + +public-encrypt@^4.0.0: + version "4.0.3" + resolved "https://registry.yarnpkg.com/public-encrypt/-/public-encrypt-4.0.3.tgz#4fcc9d77a07e48ba7527e7cbe0de33d0701331e0" + integrity sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q== + dependencies: + bn.js "^4.1.0" + browserify-rsa "^4.0.0" + create-hash "^1.1.0" + parse-asn1 "^5.0.0" + randombytes "^2.0.1" + safe-buffer "^5.1.2" + +pump@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/pump/-/pump-2.0.1.tgz#12399add6e4cf7526d973cbc8b5ce2e2908b3909" + integrity sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA== + dependencies: + end-of-stream "^1.1.0" + once "^1.3.1" + +pump@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64" + integrity sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww== + dependencies: + end-of-stream "^1.1.0" + once "^1.3.1" + +pumpify@^1.3.5: + version "1.5.1" + resolved "https://registry.yarnpkg.com/pumpify/-/pumpify-1.5.1.tgz#36513be246ab27570b1a374a5ce278bfd74370ce" + integrity sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ== + dependencies: + duplexify "^3.6.0" + inherits "^2.0.3" + pump "^2.0.0" + +punycode@1.3.2: + version "1.3.2" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d" + integrity sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0= + +punycode@^1.3.2, punycode@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" + integrity sha1-wNWmOycYgArY4esPpSachN1BhF4= + +punycode@^2.1.0, punycode@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" + integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== + +qs@^6.4.0: + version "6.7.0" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.7.0.tgz#41dc1a015e3d581f1621776be31afb2876a9b1bc" + integrity sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ== + +qs@~6.5.2: + version "6.5.2" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" + integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== + +query-string@^4.1.0: + version "4.3.4" + resolved "https://registry.yarnpkg.com/query-string/-/query-string-4.3.4.tgz#bbb693b9ca915c232515b228b1a02b609043dbeb" + integrity sha1-u7aTucqRXCMlFbIosaArYJBD2+s= + dependencies: + object-assign "^4.1.0" + strict-uri-encode "^1.0.0" + +querystring-es3@~0.2.0: + version "0.2.1" + resolved "https://registry.yarnpkg.com/querystring-es3/-/querystring-es3-0.2.1.tgz#9ec61f79049875707d69414596fd907a4d711e73" + integrity sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM= + +querystring@0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620" + integrity sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA= + +randombytes@^2.0.0, randombytes@^2.0.1, randombytes@^2.0.5: + version "2.1.0" + resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" + integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== + dependencies: + safe-buffer "^5.1.0" + +randomfill@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/randomfill/-/randomfill-1.0.4.tgz#c92196fc86ab42be983f1bf31778224931d61458" + integrity sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw== + dependencies: + randombytes "^2.0.5" + safe-buffer "^5.1.0" + +raw-body@~1.1.0: + version "1.1.7" + resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-1.1.7.tgz#1d027c2bfa116acc6623bca8f00016572a87d425" + integrity sha1-HQJ8K/oRasxmI7yo8AAWVyqH1CU= + dependencies: + bytes "1" + string_decoder "0.10" + +rc@^1.2.7: + version "1.2.8" + resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" + integrity sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw== + dependencies: + deep-extend "^0.6.0" + ini "~1.3.0" + minimist "^1.2.0" + strip-json-comments "~2.0.1" + +react-is@^16.8.4: + version "16.8.6" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.8.6.tgz#5bbc1e2d29141c9fbdfed456343fe2bc430a6a16" + integrity sha512-aUk3bHfZ2bRSVFFbbeVS4i+lNPZr3/WM5jT2J5omUVV1zzcs1nAaf3l51ctA5FFvCRbhrH0bdAsRRQddFJZPtA== + +read-only-stream@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/read-only-stream/-/read-only-stream-2.0.0.tgz#2724fd6a8113d73764ac288d4386270c1dbf17f0" + integrity sha1-JyT9aoET1zdkrCiNQ4YnDB2/F/A= + dependencies: + readable-stream "^2.0.2" + +read-pkg-up@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-4.0.0.tgz#1b221c6088ba7799601c808f91161c66e58f8978" + integrity sha512-6etQSH7nJGsK0RbG/2TeDzZFa8shjQ1um+SwQQ5cwKy0dhSXdOncEhb1CPpvQG4h7FyOV6EB6YlV0yJvZQNAkA== + dependencies: + find-up "^3.0.0" + read-pkg "^3.0.0" + +read-pkg@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-3.0.0.tgz#9cbc686978fee65d16c00e2b19c237fcf6e38389" + integrity sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k= + dependencies: + load-json-file "^4.0.0" + normalize-package-data "^2.3.2" + path-type "^3.0.0" + +readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.5, readable-stream@^2.0.6, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.3, readable-stream@^2.3.5, readable-stream@^2.3.6, readable-stream@~2.3.6: + version "2.3.6" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" + integrity sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw== + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.3" + isarray "~1.0.0" + process-nextick-args "~2.0.0" + safe-buffer "~5.1.1" + string_decoder "~1.1.1" + util-deprecate "~1.0.1" + +readable-stream@~2.0.0: + version "2.0.6" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.0.6.tgz#8f90341e68a53ccc928788dacfcd11b36eb9b78e" + integrity sha1-j5A0HmilPMySh4jaz80Rs265t44= + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.1" + isarray "~1.0.0" + process-nextick-args "~1.0.6" + string_decoder "~0.10.x" + util-deprecate "~1.0.1" + +readable-stream@~2.1.0: + version "2.1.5" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.1.5.tgz#66fa8b720e1438b364681f2ad1a63c618448c9d0" + integrity sha1-ZvqLcg4UOLNkaB8q0aY8YYRIydA= + dependencies: + buffer-shims "^1.0.0" + core-util-is "~1.0.0" + inherits "~2.0.1" + isarray "~1.0.0" + process-nextick-args "~1.0.6" + string_decoder "~0.10.x" + util-deprecate "~1.0.1" + +readdirp@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.2.1.tgz#0e87622a3325aa33e892285caf8b4e846529a525" + integrity sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ== + dependencies: + graceful-fs "^4.1.11" + micromatch "^3.1.10" + readable-stream "^2.0.2" + +realpath-native@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/realpath-native/-/realpath-native-1.1.0.tgz#2003294fea23fb0672f2476ebe22fcf498a2d65c" + integrity sha512-wlgPA6cCIIg9gKz0fgAPjnzh4yR/LnXovwuo9hvyGvx3h8nX4+/iLZplfUWasXpqD8BdnGnP5njOFjkUwPzvjA== + dependencies: + util.promisify "^1.0.0" + +rechoir@^0.6.2: + version "0.6.2" + resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384" + integrity sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q= + dependencies: + resolve "^1.1.6" + +regenerate-unicode-properties@^8.0.2: + version "8.1.0" + resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-8.1.0.tgz#ef51e0f0ea4ad424b77bf7cb41f3e015c70a3f0e" + integrity sha512-LGZzkgtLY79GeXLm8Dp0BVLdQlWICzBnJz/ipWUgo59qBaZ+BHtq51P2q1uVZlppMuUAT37SDk39qUbjTWB7bA== + dependencies: + regenerate "^1.4.0" + +regenerate@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.0.tgz#4a856ec4b56e4077c557589cae85e7a4c8869a11" + integrity sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg== + +regenerator-transform@^0.14.0: + version "0.14.0" + resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.14.0.tgz#2ca9aaf7a2c239dd32e4761218425b8c7a86ecaf" + integrity sha512-rtOelq4Cawlbmq9xuMR5gdFmv7ku/sFoB7sRiywx7aq53bc52b4j6zvH7Te1Vt/X2YveDKnCGUbioieU7FEL3w== + dependencies: + private "^0.1.6" + +regex-not@^1.0.0, regex-not@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" + integrity sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A== + dependencies: + extend-shallow "^3.0.2" + safe-regex "^1.1.0" + +regexp-tree@^0.1.6: + version "0.1.10" + resolved "https://registry.yarnpkg.com/regexp-tree/-/regexp-tree-0.1.10.tgz#d837816a039c7af8a8d64d7a7c3cf6a1d93450bc" + integrity sha512-K1qVSbcedffwuIslMwpe6vGlj+ZXRnGkvjAtFHfDZZZuEdA/h0dxljAPu9vhUo6Rrx2U2AwJ+nSQ6hK+lrP5MQ== + +regexpp@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.1.tgz#8d19d31cf632482b589049f8281f93dbcba4d07f" + integrity sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw== + +regexpu-core@^4.5.4: + version "4.5.4" + resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-4.5.4.tgz#080d9d02289aa87fe1667a4f5136bc98a6aebaae" + integrity sha512-BtizvGtFQKGPUcTy56o3nk1bGRp4SZOTYrDtGNlqCQufptV5IkkLN6Emw+yunAJjzf+C9FQFtvq7IoA3+oMYHQ== + dependencies: + 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@^0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.5.0.tgz#a7634dc08f89209c2049adda3525711fb97265dd" + integrity sha512-RnIrLhrXCX5ow/E5/Mh2O4e/oa1/jW0eaBKTSy3LaCj+M3Bqvm97GWDp2yUtzIs4LEn65zR2yiYGFqb2ApnzDA== + +regjsparser@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.6.0.tgz#f1e6ae8b7da2bae96c99399b868cd6c933a2ba9c" + integrity sha512-RQ7YyokLiQBomUJuUG8iGVvkgOLxwyZM8k6d3q5SAXpg4r5TZJZigKFvC6PpD+qQ98bCDC5YelPeA3EucDoNeQ== + dependencies: + jsesc "~0.5.0" + +remark-html@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/remark-html/-/remark-html-8.0.0.tgz#9fcb859a6f3cb40f3ef15402950f1a62ec301b3a" + integrity sha512-3V2391GL3hxKhrkzYOyfPpxJ6taIKLCfuLVqumeWQOk3H9nTtSQ8St8kMYkBVIEAquXN1chT83qJ/2lAW+dpEg== + dependencies: + hast-util-sanitize "^1.0.0" + hast-util-to-html "^4.0.0" + mdast-util-to-hast "^3.0.0" + xtend "^4.0.1" + +remark-parse@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/remark-parse/-/remark-parse-5.0.0.tgz#4c077f9e499044d1d5c13f80d7a98cf7b9285d95" + integrity sha512-b3iXszZLH1TLoyUzrATcTQUZrwNl1rE70rVdSruJFlDaJ9z5aMkhrG43Pp68OgfHndL/ADz6V69Zow8cTQu+JA== + dependencies: + collapse-white-space "^1.0.2" + is-alphabetical "^1.0.0" + is-decimal "^1.0.0" + is-whitespace-character "^1.0.0" + is-word-character "^1.0.0" + markdown-escapes "^1.0.0" + parse-entities "^1.1.0" + repeat-string "^1.5.4" + state-toggle "^1.0.0" + trim "0.0.1" + trim-trailing-lines "^1.0.0" + unherit "^1.0.4" + unist-util-remove-position "^1.0.0" + vfile-location "^2.0.0" + xtend "^4.0.1" + +remark-reference-links@^4.0.1: + version "4.0.3" + resolved "https://registry.yarnpkg.com/remark-reference-links/-/remark-reference-links-4.0.3.tgz#eb51ad4fddb009199f98ac403d0558d732e2df89" + integrity sha512-Q9d7JaK5r0JDBo3TInfrodBuI3xulI8htCr8jlX+0oXosF3GaebJbo5y228VYFoV6xJ+syDukkUGMKNlwSJWjQ== + dependencies: + unist-util-visit "^1.0.0" + +remark-slug@^5.0.0: + version "5.1.1" + resolved "https://registry.yarnpkg.com/remark-slug/-/remark-slug-5.1.1.tgz#eb5dba0cf779487ef7ddf65c735ba4d4ca017542" + integrity sha512-r591rdoDPJkSSAVvEaTVUkqbMp7c7AyZfif14V0Dp66GQkOHzaPAS6wyhawSbqpS0ZdTnfJS+TltFoxzi6bdIA== + dependencies: + github-slugger "^1.0.0" + mdast-util-to-string "^1.0.0" + unist-util-visit "^1.0.0" + +remark-stringify@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/remark-stringify/-/remark-stringify-5.0.0.tgz#336d3a4d4a6a3390d933eeba62e8de4bd280afba" + integrity sha512-Ws5MdA69ftqQ/yhRF9XhVV29mhxbfGhbz0Rx5bQH+oJcNhhSM6nCu1EpLod+DjrFGrU0BMPs+czVmJZU7xiS7w== + dependencies: + ccount "^1.0.0" + is-alphanumeric "^1.0.0" + is-decimal "^1.0.0" + is-whitespace-character "^1.0.0" + longest-streak "^2.0.1" + markdown-escapes "^1.0.0" + markdown-table "^1.1.0" + mdast-util-compact "^1.0.0" + parse-entities "^1.0.2" + repeat-string "^1.5.4" + state-toggle "^1.0.0" + stringify-entities "^1.0.1" + unherit "^1.0.4" + xtend "^4.0.1" + +remark-toc@^5.0.0: + version "5.1.1" + resolved "https://registry.yarnpkg.com/remark-toc/-/remark-toc-5.1.1.tgz#8c229d6f834cdb43fde6685e2d43248d3fc82d78" + integrity sha512-vCPW4YOsm2CfyuScdktM9KDnJXVHJsd/ZeRtst+dnBU3B3KKvt8bc+bs5syJjyptAHfqo7H+5Uhz+2blWBfwow== + dependencies: + mdast-util-toc "^3.0.0" + remark-slug "^5.0.0" + +remark@^9.0.0: + version "9.0.0" + resolved "https://registry.yarnpkg.com/remark/-/remark-9.0.0.tgz#c5cfa8ec535c73a67c4b0f12bfdbd3a67d8b2f60" + integrity sha512-amw8rGdD5lHbMEakiEsllmkdBP+/KpjW/PRK6NSGPZKCQowh0BT4IWXDAkRMyG3SB9dKPXWMviFjNusXzXNn3A== + dependencies: + remark-parse "^5.0.0" + remark-stringify "^5.0.0" + unified "^6.0.0" + +remote-origin-url@0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/remote-origin-url/-/remote-origin-url-0.4.0.tgz#4d3e2902f34e2d37d1c263d87710b77eb4086a30" + integrity sha1-TT4pAvNOLTfRwmPYdxC3frQIajA= + dependencies: + parse-git-config "^0.2.0" + +remove-bom-buffer@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/remove-bom-buffer/-/remove-bom-buffer-3.0.0.tgz#c2bf1e377520d324f623892e33c10cac2c252b53" + integrity sha512-8v2rWhaakv18qcvNeli2mZ/TMTL2nEyAKRvzo1WtnZBl15SHyEhrCu2/xKlJyUFKHiHgfXIyuY6g2dObJJycXQ== + dependencies: + is-buffer "^1.1.5" + is-utf8 "^0.2.1" + +remove-bom-stream@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/remove-bom-stream/-/remove-bom-stream-1.2.0.tgz#05f1a593f16e42e1fb90ebf59de8e569525f9523" + integrity sha1-BfGlk/FuQuH7kOv1nejlaVJflSM= + dependencies: + remove-bom-buffer "^3.0.0" + safe-buffer "^5.1.0" + through2 "^2.0.3" + +remove-trailing-separator@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" + integrity sha1-wkvOKig62tW8P1jg1IJJuSN52O8= + +repeat-element@^1.1.2: + version "1.1.3" + resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.3.tgz#782e0d825c0c5a3bb39731f84efee6b742e6b1ce" + integrity sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g== + +repeat-string@^1.5.0, repeat-string@^1.5.4, repeat-string@^1.6.1: + version "1.6.1" + resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" + integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc= + +replace-ext@1.0.0, replace-ext@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/replace-ext/-/replace-ext-1.0.0.tgz#de63128373fcbf7c3ccfa4de5a480c45a67958eb" + integrity sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs= + +request-promise-core@1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/request-promise-core/-/request-promise-core-1.1.2.tgz#339f6aababcafdb31c799ff158700336301d3346" + integrity sha512-UHYyq1MO8GsefGEt7EprS8UrXsm1TxEvFUX1IMTuSLU2Rh7fTIdFtl8xD7JiEYiWU2dl+NYAjCTksTehQUxPag== + dependencies: + lodash "^4.17.11" + +request-promise-native@^1.0.5: + version "1.0.7" + resolved "https://registry.yarnpkg.com/request-promise-native/-/request-promise-native-1.0.7.tgz#a49868a624bdea5069f1251d0a836e0d89aa2c59" + integrity sha512-rIMnbBdgNViL37nZ1b3L/VfPOpSi0TqVDQPAvO6U14lMzOLrt5nilxCQqtDKhZeDiW0/hkCXGoQjhgJd/tCh6w== + dependencies: + request-promise-core "1.1.2" + stealthy-require "^1.1.1" + tough-cookie "^2.3.3" + +request@^2.87.0: + version "2.88.0" + resolved "https://registry.yarnpkg.com/request/-/request-2.88.0.tgz#9c2fca4f7d35b592efe57c7f0a55e81052124fef" + integrity sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg== + dependencies: + aws-sign2 "~0.7.0" + aws4 "^1.8.0" + caseless "~0.12.0" + combined-stream "~1.0.6" + extend "~3.0.2" + forever-agent "~0.6.1" + form-data "~2.3.2" + har-validator "~5.1.0" + http-signature "~1.2.0" + is-typedarray "~1.0.0" + isstream "~0.1.2" + json-stringify-safe "~5.0.1" + mime-types "~2.1.19" + oauth-sign "~0.9.0" + performance-now "^2.1.0" + qs "~6.5.2" + safe-buffer "^5.1.2" + tough-cookie "~2.4.3" + tunnel-agent "^0.6.0" + uuid "^3.3.2" + +require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= + +require-main-filename@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" + integrity sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE= + +require-main-filename@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" + integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== + +resolve-cwd@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-2.0.0.tgz#00a9f7387556e27038eae232caa372a6a59b665a" + integrity sha1-AKn3OHVW4nA46uIyyqNypqWbZlo= + dependencies: + resolve-from "^3.0.0" + +resolve-from@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-3.0.0.tgz#b22c7af7d9d6881bc8b6e653335eebcb0a188748" + integrity sha1-six699nWiBvItuZTM17rywoYh0g= + +resolve-from@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" + integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== + +resolve-options@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/resolve-options/-/resolve-options-1.1.0.tgz#32bb9e39c06d67338dc9378c0d6d6074566ad131" + integrity sha1-MrueOcBtZzONyTeMDW1gdFZq0TE= + dependencies: + value-or-function "^3.0.0" + +resolve-url@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" + integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= + +resolve@1.1.7: + version "1.1.7" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" + integrity sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs= + +resolve@^1.1.3, resolve@^1.1.4, resolve@^1.1.6, resolve@^1.10.0, resolve@^1.3.2, resolve@^1.4.0, resolve@^1.8.1: + version "1.11.1" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.11.1.tgz#ea10d8110376982fef578df8fc30b9ac30a07a3e" + integrity sha512-vIpgF6wfuJOZI7KKKSP+HmiKggadPQAdsp5HiC1mvqnfp0gF1vdwgBWZIdrVft9pgqoMFQN+R7BSWZiBxx+BBw== + dependencies: + path-parse "^1.0.6" + +restore-cursor@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" + integrity sha1-n37ih/gv0ybU/RYpI9YhKe7g368= + dependencies: + onetime "^2.0.0" + signal-exit "^3.0.2" + +ret@~0.1.10: + version "0.1.15" + resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" + integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== + +rimraf@2.6.3, rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.3: + version "2.6.3" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" + integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA== + dependencies: + glob "^7.1.3" + +ripemd160@^2.0.0, ripemd160@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.2.tgz#a1c1a6f624751577ba5d07914cbc92850585890c" + integrity sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA== + dependencies: + hash-base "^3.0.0" + inherits "^2.0.1" + +rsvp@^4.8.4: + version "4.8.5" + resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-4.8.5.tgz#c8f155311d167f68f21e168df71ec5b083113734" + integrity sha512-nfMOlASu9OnRJo1mbEk2cz0D56a1MBNrJ7orjRZQG10XDyuvwksKbuXNp6qa+kbn839HwjwhBzhFmdsaEAfauA== + +run-async@^2.2.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.3.0.tgz#0371ab4ae0bdd720d4166d7dfda64ff7a445a6c0" + integrity sha1-A3GrSuC91yDUFm19/aZP96RFpsA= + dependencies: + is-promise "^2.1.0" + +rxjs@^6.4.0: + version "6.5.2" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.5.2.tgz#2e35ce815cd46d84d02a209fb4e5921e051dbec7" + integrity sha512-HUb7j3kvb7p7eCUHE3FqjoDsC1xfZQ4AHFWfTKSpZ+sAhhz5X1WX0ZuUqWbzB2QhSLp3DoLUG+hMdEDKqWo2Zg== + dependencies: + tslib "^1.9.0" + +safe-buffer@>=5.1.1, safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: + version "5.1.2" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" + integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== + +safe-json-parse@~1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/safe-json-parse/-/safe-json-parse-1.0.1.tgz#3e76723e38dfdda13c9b1d29a1e07ffee4b30b57" + integrity sha1-PnZyPjjf3aE8mx0poeB//uSzC1c= + +safe-regex@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" + integrity sha1-QKNmnzsHfR6UPURinhV91IAjvy4= + dependencies: + ret "~0.1.10" + +"safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: + version "2.1.2" + resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== + +sane@^4.0.3: + version "4.1.0" + resolved "https://registry.yarnpkg.com/sane/-/sane-4.1.0.tgz#ed881fd922733a6c461bc189dc2b6c006f3ffded" + integrity sha512-hhbzAgTIX8O7SHfp2c8/kREfEn4qO/9q8C9beyY6+tvZ87EpoZ3i1RIEvp27YBswnNbY9mWd6paKVmKbAgLfZA== + dependencies: + "@cnakazawa/watch" "^1.0.3" + anymatch "^2.0.0" + capture-exit "^2.0.0" + exec-sh "^0.3.2" + execa "^1.0.0" + fb-watchman "^2.0.0" + micromatch "^3.1.4" + minimist "^1.1.1" + walker "~1.0.5" + +sax@^1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" + integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw== + +"semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.4.1, semver@^5.5.0, semver@^5.5.1, semver@^5.6.0: + version "5.7.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.0.tgz#790a7cf6fea5459bac96110b29b60412dc8ff96b" + integrity sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA== + +semver@^6.0.0, semver@^6.1.0: + version "6.1.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-6.1.1.tgz#53f53da9b30b2103cd4f15eab3a18ecbcb210c9b" + integrity sha512-rWYq2e5iYW+fFe/oPPtYJxYgjBm8sC4rmoGdUOgBB7VnwKt6HrL793l2voH1UlsyYZpJ4g0wfjnTEO1s1NP2eQ== + +set-blocking@^2.0.0, set-blocking@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" + integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= + +set-value@^0.4.3: + version "0.4.3" + resolved "https://registry.yarnpkg.com/set-value/-/set-value-0.4.3.tgz#7db08f9d3d22dc7f78e53af3c3bf4666ecdfccf1" + integrity sha1-fbCPnT0i3H945Trzw79GZuzfzPE= + dependencies: + extend-shallow "^2.0.1" + is-extendable "^0.1.1" + is-plain-object "^2.0.1" + to-object-path "^0.3.0" + +set-value@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.0.tgz#71ae4a88f0feefbbf52d1ea604f3fb315ebb6274" + integrity sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg== + dependencies: + extend-shallow "^2.0.1" + is-extendable "^0.1.1" + is-plain-object "^2.0.3" + split-string "^3.0.1" + +setprototypeof@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.1.tgz#7e95acb24aa92f5885e0abef5ba131330d4ae683" + integrity sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw== + +sha.js@^2.4.0, sha.js@^2.4.8, sha.js@~2.4.4: + version "2.4.11" + resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.11.tgz#37a5cf0b81ecbc6943de109ba2960d1b26584ae7" + integrity sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ== + dependencies: + inherits "^2.0.1" + safe-buffer "^5.0.1" + +shasum@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/shasum/-/shasum-1.0.2.tgz#e7012310d8f417f4deb5712150e5678b87ae565f" + integrity sha1-5wEjENj0F/TetXEhUOVni4euVl8= + dependencies: + json-stable-stringify "~0.0.0" + sha.js "~2.4.4" + +shebang-command@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" + integrity sha1-RKrGW2lbAzmJaMOfNj/uXer98eo= + dependencies: + shebang-regex "^1.0.0" + +shebang-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" + integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= + +shell-quote@^1.6.1: + version "1.6.1" + resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.6.1.tgz#f4781949cce402697127430ea3b3c5476f481767" + integrity sha1-9HgZSczkAmlxJ0MOo7PFR29IF2c= + dependencies: + array-filter "~0.0.0" + array-map "~0.0.0" + array-reduce "~0.0.0" + jsonify "~0.0.0" + +shelljs@^0.8.2: + version "0.8.3" + resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.3.tgz#a7f3319520ebf09ee81275b2368adb286659b097" + integrity sha512-fc0BKlAWiLpwZljmOvAOTE/gXawtCoNrP5oaY7KIaQbbyHeQVg01pSEuEGvGh3HEdBU4baCD7wQBwADmM/7f7A== + dependencies: + glob "^7.0.0" + interpret "^1.0.0" + rechoir "^0.6.2" + +shellwords@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b" + integrity sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww== + +signal-exit@^3.0.0, signal-exit@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" + integrity sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0= + +simple-concat@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/simple-concat/-/simple-concat-1.0.0.tgz#7344cbb8b6e26fb27d66b2fc86f9f6d5997521c6" + integrity sha1-c0TLuLbib7J9ZrL8hvn21Zl1IcY= + +sisteransi@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.0.tgz#77d9622ff909080f1c19e5f4a1df0c1b0a27b88c" + integrity sha512-N+z4pHB4AmUv0SjveWRd6q1Nj5w62m5jodv+GD8lvmbY/83T/rpbJGZOnK5T149OldDj4Db07BSv9xY4K6NTPQ== + +slash@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44" + integrity sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A== + +slice-ansi@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-2.1.0.tgz#cacd7693461a637a5788d92a7dd4fba068e81636" + integrity sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ== + dependencies: + ansi-styles "^3.2.0" + astral-regex "^1.0.0" + is-fullwidth-code-point "^2.0.0" + +snapdragon-node@^2.0.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" + integrity sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw== + dependencies: + define-property "^1.0.0" + isobject "^3.0.0" + snapdragon-util "^3.0.1" + +snapdragon-util@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2" + integrity sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ== + dependencies: + kind-of "^3.2.0" + +snapdragon@^0.8.1: + version "0.8.2" + resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d" + integrity sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg== + dependencies: + base "^0.11.1" + debug "^2.2.0" + define-property "^0.2.5" + extend-shallow "^2.0.1" + map-cache "^0.2.2" + source-map "^0.5.6" + source-map-resolve "^0.5.0" + use "^3.1.0" + +sort-keys@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/sort-keys/-/sort-keys-1.1.2.tgz#441b6d4d346798f1b4e49e8920adfba0e543f9ad" + integrity sha1-RBttTTRnmPG05J6JIK37oOVD+a0= + dependencies: + is-plain-obj "^1.0.0" + +source-map-resolve@^0.5.0: + version "0.5.2" + resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.2.tgz#72e2cc34095543e43b2c62b2c4c10d4a9054f259" + integrity sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA== + dependencies: + atob "^2.1.1" + decode-uri-component "^0.2.0" + resolve-url "^0.2.1" + source-map-url "^0.4.0" + urix "^0.1.0" + +source-map-support@^0.5.6, source-map-support@~0.5.10: + version "0.5.12" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.12.tgz#b4f3b10d51857a5af0138d3ce8003b201613d599" + integrity sha512-4h2Pbvyy15EE02G+JOZpUCmqWJuqrs+sEkzewTm++BPi7Hvn/HwcqLAcNxYAyI0x13CpPPn+kMjl+hplXMHITQ== + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + +source-map-url@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" + integrity sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM= + +source-map@^0.5.0, source-map@^0.5.6, source-map@~0.5.3: + version "0.5.7" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" + integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= + +source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== + +space-separated-tokens@^1.0.0: + version "1.1.4" + resolved "https://registry.yarnpkg.com/space-separated-tokens/-/space-separated-tokens-1.1.4.tgz#27910835ae00d0adfcdbd0ad7e611fb9544351fa" + integrity sha512-UyhMSmeIqZrQn2UdjYpxEkwY9JUrn8pP+7L4f91zRzOQuI8MF1FGLfYU9DKCYeLdo7LXMxwrX5zKFy7eeeVHuA== + +spdx-correct@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.0.tgz#fb83e504445268f154b074e218c87c003cd31df4" + integrity sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q== + dependencies: + spdx-expression-parse "^3.0.0" + spdx-license-ids "^3.0.0" + +spdx-exceptions@^2.1.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz#2ea450aee74f2a89bfb94519c07fcd6f41322977" + integrity sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA== + +spdx-expression-parse@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz#99e119b7a5da00e05491c9fa338b7904823b41d0" + integrity sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg== + dependencies: + spdx-exceptions "^2.1.0" + spdx-license-ids "^3.0.0" + +spdx-license-ids@^3.0.0: + version "3.0.4" + resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.4.tgz#75ecd1a88de8c184ef015eafb51b5b48bfd11bb1" + integrity sha512-7j8LYJLeY/Yb6ACbQ7F76qy5jHkp0U6jgBfJsk97bwWlVUnUWsAgpyaCvo17h0/RQGnQ036tVDomiwoI4pDkQA== + +split-string@^3.0.1, split-string@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" + integrity sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw== + dependencies: + extend-shallow "^3.0.0" + +sprintf-js@~1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" + integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= + +sshpk@^1.7.0: + version "1.16.1" + resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.16.1.tgz#fb661c0bef29b39db40769ee39fa70093d6f6877" + integrity sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg== + dependencies: + asn1 "~0.2.3" + assert-plus "^1.0.0" + bcrypt-pbkdf "^1.0.0" + dashdash "^1.12.0" + ecc-jsbn "~0.1.1" + getpass "^0.1.1" + jsbn "~0.1.0" + safer-buffer "^2.0.2" + tweetnacl "~0.14.0" + +stack-utils@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-1.0.2.tgz#33eba3897788558bebfc2db059dc158ec36cebb8" + integrity sha512-MTX+MeG5U994cazkjd/9KNAapsHnibjMLnfXodlkXw76JEea0UiNzrqidzo1emMwk7w5Qhc9jd4Bn9TBb1MFwA== + +state-toggle@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/state-toggle/-/state-toggle-1.0.2.tgz#75e93a61944116b4959d665c8db2d243631d6ddc" + integrity sha512-8LpelPGR0qQM4PnfLiplOQNJcIN1/r2Gy0xKB2zKnIW2YzPMt2sR4I/+gtPjhN7Svh9kw+zqEg2SFwpBO9iNiw== + +static-extend@^0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" + integrity sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY= + dependencies: + define-property "^0.2.5" + object-copy "^0.1.0" + +"statuses@>= 1.5.0 < 2": + version "1.5.0" + resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" + integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow= + +stealthy-require@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b" + integrity sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks= + +stream-array@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/stream-array/-/stream-array-1.1.2.tgz#9e5f7345f2137c30ee3b498b9114e80b52bb7eb5" + integrity sha1-nl9zRfITfDDuO0mLkRToC1K7frU= + dependencies: + readable-stream "~2.1.0" + +stream-browserify@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/stream-browserify/-/stream-browserify-2.0.2.tgz#87521d38a44aa7ee91ce1cd2a47df0cb49dd660b" + integrity sha512-nX6hmklHs/gr2FuxYDltq8fJA1GDlxKQCz8O/IM4atRqBH8OORmBNgfvW5gG10GT/qQ9u0CzIvr2X5Pkt6ntqg== + dependencies: + inherits "~2.0.1" + readable-stream "^2.0.2" + +stream-combiner2@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/stream-combiner2/-/stream-combiner2-1.1.1.tgz#fb4d8a1420ea362764e21ad4780397bebcb41cbe" + integrity sha1-+02KFCDqNidk4hrUeAOXvry0HL4= + dependencies: + duplexer2 "~0.1.0" + readable-stream "^2.0.2" + +stream-http@^2.0.0: + version "2.8.3" + resolved "https://registry.yarnpkg.com/stream-http/-/stream-http-2.8.3.tgz#b2d242469288a5a27ec4fe8933acf623de6514fc" + integrity sha512-+TSkfINHDo4J+ZobQLWiMouQYB+UVYFttRA94FpEzzJ7ZdqcL4uUUQ7WkdkI4DSozGmgBUE/a47L+38PenXhUw== + dependencies: + builtin-status-codes "^3.0.0" + inherits "^2.0.1" + readable-stream "^2.3.6" + to-arraybuffer "^1.0.0" + xtend "^4.0.0" + +stream-shift@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/stream-shift/-/stream-shift-1.0.0.tgz#d5c752825e5367e786f78e18e445ea223a155952" + integrity sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI= + +stream-splicer@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/stream-splicer/-/stream-splicer-2.0.1.tgz#0b13b7ee2b5ac7e0609a7463d83899589a363fcd" + integrity sha512-Xizh4/NPuYSyAXyT7g8IvdJ9HJpxIGL9PjyhtywCZvvP0OPIdqyrr4dMikeuvY8xahpdKEBlBTySe583totajg== + dependencies: + inherits "^2.0.1" + readable-stream "^2.0.2" + +strict-uri-encode@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713" + integrity sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM= + +string-length@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/string-length/-/string-length-2.0.0.tgz#d40dbb686a3ace960c1cffca562bf2c45f8363ed" + integrity sha1-1A27aGo6zpYMHP/KVivyxF+DY+0= + dependencies: + astral-regex "^1.0.0" + strip-ansi "^4.0.0" + +string-template@~0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/string-template/-/string-template-0.2.1.tgz#42932e598a352d01fc22ec3367d9d84eec6c9add" + integrity sha1-QpMuWYo1LQH8IuwzZ9nYTuxsmt0= + +string-width@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" + integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M= + dependencies: + code-point-at "^1.0.0" + is-fullwidth-code-point "^1.0.0" + strip-ansi "^3.0.0" + +"string-width@^1.0.2 || 2", string-width@^2.0.0, string-width@^2.1.0, string-width@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" + integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== + dependencies: + is-fullwidth-code-point "^2.0.0" + strip-ansi "^4.0.0" + +string-width@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961" + integrity sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w== + dependencies: + emoji-regex "^7.0.1" + is-fullwidth-code-point "^2.0.0" + strip-ansi "^5.1.0" + +string_decoder@0.10, string_decoder@~0.10.x: + version "0.10.31" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" + integrity sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ= + +string_decoder@^1.1.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.2.0.tgz#fe86e738b19544afe70469243b2a1ee9240eae8d" + integrity sha512-6YqyX6ZWEYguAxgZzHGL7SsCeGx3V2TtOTqZz1xSTSWnqsbWwbptafNyvf/ACquZUXV3DANr5BDIwNYe1mN42w== + dependencies: + safe-buffer "~5.1.0" + +string_decoder@~1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" + integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== + dependencies: + safe-buffer "~5.1.0" + +stringify-entities@^1.0.1: + version "1.3.2" + resolved "https://registry.yarnpkg.com/stringify-entities/-/stringify-entities-1.3.2.tgz#a98417e5471fd227b3e45d3db1861c11caf668f7" + integrity sha512-nrBAQClJAPN2p+uGCVJRPIPakKeKWZ9GtBCmormE7pWOSlHat7+x5A8gx85M7HM5Dt0BP3pP5RhVW77WdbJJ3A== + dependencies: + character-entities-html4 "^1.0.0" + character-entities-legacy "^1.0.0" + is-alphanumerical "^1.0.0" + is-hexadecimal "^1.0.0" + +strip-ansi@^3.0.0, strip-ansi@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= + dependencies: + ansi-regex "^2.0.0" + +strip-ansi@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" + integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8= + dependencies: + ansi-regex "^3.0.0" + +strip-ansi@^5.0.0, strip-ansi@^5.1.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" + integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== + dependencies: + ansi-regex "^4.1.0" + +strip-bom@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" + integrity sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM= + +strip-eof@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" + integrity sha1-u0P/VZim6wXYm1n80SnJgzE2Br8= + +strip-json-comments@^2.0.1, strip-json-comments@~2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" + integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= + +subarg@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/subarg/-/subarg-1.0.0.tgz#f62cf17581e996b48fc965699f54c06ae268b8d2" + integrity sha1-9izxdYHplrSPyWVpn1TAauJouNI= + dependencies: + minimist "^1.1.0" + +supports-color@^5.0.0, supports-color@^5.3.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" + integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== + dependencies: + has-flag "^3.0.0" + +supports-color@^6.1.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-6.1.0.tgz#0764abc69c63d5ac842dd4867e8d025e880df8f3" + integrity sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ== + dependencies: + has-flag "^3.0.0" + +symbol-tree@^3.2.2: + version "3.2.2" + resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.2.tgz#ae27db38f660a7ae2e1c3b7d1bc290819b8519e6" + integrity sha1-rifbOPZgp64uHDt9G8KQgZuFGeY= + +syntax-error@^1.1.1: + version "1.4.0" + resolved "https://registry.yarnpkg.com/syntax-error/-/syntax-error-1.4.0.tgz#2d9d4ff5c064acb711594a3e3b95054ad51d907c" + integrity sha512-YPPlu67mdnHGTup2A8ff7BC2Pjq0e0Yp/IyTFN03zWO0RcK07uLcbi7C2KpGR2FvWbaB0+bfE27a+sBKebSo7w== + dependencies: + acorn-node "^1.2.0" + +table@^5.2.3: + version "5.4.0" + resolved "https://registry.yarnpkg.com/table/-/table-5.4.0.tgz#d772a3216e68829920a41a32c18eda286c95d780" + integrity sha512-nHFDrxmbrkU7JAFKqKbDJXfzrX2UBsWmrieXFTGxiI5e4ncg3VqsZeI4EzNmX0ncp4XNGVeoxIWJXfCIXwrsvw== + dependencies: + ajv "^6.9.1" + lodash "^4.17.11" + slice-ansi "^2.1.0" + string-width "^3.0.0" + +tar@^4: + version "4.4.10" + resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.10.tgz#946b2810b9a5e0b26140cf78bea6b0b0d689eba1" + integrity sha512-g2SVs5QIxvo6OLp0GudTqEf05maawKUxXru104iaayWA09551tFCTI8f1Asb4lPfkBr91k07iL4c11XO3/b0tA== + dependencies: + chownr "^1.1.1" + fs-minipass "^1.2.5" + minipass "^2.3.5" + minizlib "^1.2.1" + mkdirp "^0.5.0" + safe-buffer "^5.1.2" + yallist "^3.0.3" + +terser@^3.7.5: + version "3.17.0" + resolved "https://registry.yarnpkg.com/terser/-/terser-3.17.0.tgz#f88ffbeda0deb5637f9d24b0da66f4e15ab10cb2" + integrity sha512-/FQzzPJmCpjAH9Xvk2paiWrFq+5M6aVOf+2KRbwhByISDX/EujxsK+BAvrhb6H+2rtrLCHK9N01wO014vrIwVQ== + dependencies: + commander "^2.19.0" + source-map "~0.6.1" + source-map-support "~0.5.10" + +test-exclude@^5.2.3: + version "5.2.3" + resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-5.2.3.tgz#c3d3e1e311eb7ee405e092dac10aefd09091eac0" + integrity sha512-M+oxtseCFO3EDtAaGH7iiej3CBkzXqFMbzqYAACdzKui4eZA+pq3tZEwChvOdNfa7xxy8BfbmgJSIr43cC/+2g== + dependencies: + glob "^7.1.3" + minimatch "^3.0.4" + read-pkg-up "^4.0.0" + require-main-filename "^2.0.0" + +text-table@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" + integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= + +throat@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/throat/-/throat-4.1.0.tgz#89037cbc92c56ab18926e6ba4cbb200e15672a6a" + integrity sha1-iQN8vJLFarGJJua6TLsgDhVnKmo= + +through2-filter@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/through2-filter/-/through2-filter-3.0.0.tgz#700e786df2367c2c88cd8aa5be4cf9c1e7831254" + integrity sha512-jaRjI2WxN3W1V8/FMZ9HKIBXixtiqs3SQSX4/YGIiP3gL6djW48VoZq9tDqeCWs3MT8YY5wb/zli8VW8snY1CA== + dependencies: + through2 "~2.0.0" + xtend "~4.0.0" + +through2@^2.0.0, through2@^2.0.3, through2@~2.0.0: + version "2.0.5" + resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.5.tgz#01c1e39eb31d07cb7d03a96a70823260b23132cd" + integrity sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ== + dependencies: + readable-stream "~2.3.6" + xtend "~4.0.1" + +"through@>=2.2.7 <3", through@^2.3.6, through@~2.3.4: + version "2.3.8" + resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" + integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= + +timers-browserify@^1.0.1: + version "1.4.2" + resolved "https://registry.yarnpkg.com/timers-browserify/-/timers-browserify-1.4.2.tgz#c9c58b575be8407375cb5e2462dacee74359f41d" + integrity sha1-ycWLV1voQHN1y14kYtrO50NZ9B0= + dependencies: + process "~0.11.0" + +tiny-lr@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/tiny-lr/-/tiny-lr-1.1.1.tgz#9fa547412f238fedb068ee295af8b682c98b2aab" + integrity sha512-44yhA3tsaRoMOjQQ+5v5mVdqef+kH6Qze9jTpqtVufgYjYt08zyZAwNwwVBj3i1rJMnR52IxOW0LK0vBzgAkuA== + dependencies: + body "^5.1.0" + debug "^3.1.0" + faye-websocket "~0.10.0" + livereload-js "^2.3.0" + object-assign "^4.1.0" + qs "^6.4.0" + +tmp@^0.0.33: + version "0.0.33" + resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" + integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw== + dependencies: + os-tmpdir "~1.0.2" + +tmpl@1.0.x: + version "1.0.4" + resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.4.tgz#23640dd7b42d00433911140820e5cf440e521dd1" + integrity sha1-I2QN17QtAEM5ERQIIOXPRA5SHdE= + +to-absolute-glob@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/to-absolute-glob/-/to-absolute-glob-2.0.2.tgz#1865f43d9e74b0822db9f145b78cff7d0f7c849b" + integrity sha1-GGX0PZ50sIItufFFt4z/fQ98hJs= + dependencies: + is-absolute "^1.0.0" + is-negated-glob "^1.0.0" + +to-arraybuffer@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz#7d229b1fcc637e466ca081180836a7aabff83f43" + integrity sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M= + +to-fast-properties@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" + integrity sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4= + +to-object-path@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" + integrity sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68= + dependencies: + kind-of "^3.0.2" + +to-regex-range@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" + integrity sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg= + dependencies: + is-number "^3.0.0" + repeat-string "^1.6.1" + +to-regex@^3.0.1, to-regex@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" + integrity sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw== + dependencies: + define-property "^2.0.2" + extend-shallow "^3.0.2" + regex-not "^1.0.2" + safe-regex "^1.1.0" + +to-through@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/to-through/-/to-through-2.0.0.tgz#fc92adaba072647bc0b67d6b03664aa195093af6" + integrity sha1-/JKtq6ByZHvAtn1rA2ZKoZUJOvY= + dependencies: + through2 "^2.0.3" + +toidentifier@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.0.tgz#7e1be3470f1e77948bc43d94a3c8f4d7752ba553" + integrity sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw== + +tough-cookie@^2.3.3, tough-cookie@^2.3.4: + version "2.5.0" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2" + integrity sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g== + dependencies: + psl "^1.1.28" + punycode "^2.1.1" + +tough-cookie@~2.4.3: + version "2.4.3" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.4.3.tgz#53f36da3f47783b0925afa06ff9f3b165280f781" + integrity sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ== + dependencies: + psl "^1.1.24" + punycode "^1.4.1" + +tr46@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-1.0.1.tgz#a8b13fd6bfd2489519674ccde55ba3693b706d09" + integrity sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk= + dependencies: + punycode "^2.1.0" + +trim-lines@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/trim-lines/-/trim-lines-1.1.2.tgz#c8adbdbdae21bb5c2766240a661f693afe23e59b" + integrity sha512-3GOuyNeTqk3FAqc3jOJtw7FTjYl94XBR5aD9QnDbK/T4CA9sW/J0l9RoaRPE9wyPP7NF331qnHnvJFBJ+IDkmQ== + +trim-right@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" + integrity sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM= + +trim-trailing-lines@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/trim-trailing-lines/-/trim-trailing-lines-1.1.2.tgz#d2f1e153161152e9f02fabc670fb40bec2ea2e3a" + integrity sha512-MUjYItdrqqj2zpcHFTkMa9WAv4JHTI6gnRQGPFLrt5L9a6tRMiDnIqYl8JBvu2d2Tc3lWJKQwlGCp0K8AvCM+Q== + +trim@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/trim/-/trim-0.0.1.tgz#5858547f6b290757ee95cccc666fb50084c460dd" + integrity sha1-WFhUf2spB1fulczMZm+1AITEYN0= + +trough@^1.0.0: + version "1.0.4" + resolved "https://registry.yarnpkg.com/trough/-/trough-1.0.4.tgz#3b52b1f13924f460c3fbfd0df69b587dbcbc762e" + integrity sha512-tdzBRDGWcI1OpPVmChbdSKhvSVurznZ8X36AYURAcl+0o2ldlCY2XPzyXNNxwJwwyIU+rIglTCG4kxtNKBQH7Q== + +ts-protoc-gen@^0.10.0: + version "0.10.0" + resolved "https://registry.yarnpkg.com/ts-protoc-gen/-/ts-protoc-gen-0.10.0.tgz#f708d99be59ad0be6bdce6f4fe893ec41757d2c9" + integrity sha512-EEbgDWNHK3CvcNhmib94I4HMO23qLddjLRdXW8EUE11VJxbi3n5J0l2DiX/L1pijOaPTkbEoRK+zQinKgKGqsw== + dependencies: + google-protobuf "^3.6.1" + +tslib@^1.8.0, tslib@^1.8.1, tslib@^1.9.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a" + integrity sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ== + +tslint@^5.18.0: + version "5.18.0" + resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.18.0.tgz#f61a6ddcf372344ac5e41708095bbf043a147ac6" + integrity sha512-Q3kXkuDEijQ37nXZZLKErssQVnwCV/+23gFEMROi8IlbaBG6tXqLPQJ5Wjcyt/yHPKBC+hD5SzuGaMora+ZS6w== + dependencies: + "@babel/code-frame" "^7.0.0" + builtin-modules "^1.1.1" + chalk "^2.3.0" + commander "^2.12.1" + diff "^3.2.0" + glob "^7.1.1" + js-yaml "^3.13.1" + minimatch "^3.0.4" + mkdirp "^0.5.1" + resolve "^1.3.2" + semver "^5.3.0" + tslib "^1.8.0" + tsutils "^2.29.0" + +tsutils@^2.29.0: + version "2.29.0" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.29.0.tgz#32b488501467acbedd4b85498673a0812aca0b99" + integrity sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA== + dependencies: + tslib "^1.8.1" + +tty-browserify@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.1.tgz#3f05251ee17904dfd0677546670db9651682b811" + integrity sha512-C3TaO7K81YvjCgQH9Q1S3R3P3BtN3RIM8n+OvX4il1K1zgE8ZhI0op7kClgkxtutIE8hQrcrHBXvIheqKUUCxw== + +tunnel-agent@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" + integrity sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0= + dependencies: + safe-buffer "^5.0.1" + +turndown@^5.0.3: + version "5.0.3" + resolved "https://registry.yarnpkg.com/turndown/-/turndown-5.0.3.tgz#a1350b66155d7891f10e451432170b0f7cd7449a" + integrity sha512-popfGXEiedpq6F5saRIAThKxq/bbEPVFnsDnUdjaDGIre9f3/OL9Yi/yPbPcZ7RYUDpekghr666bBfZPrwNnhQ== + dependencies: + jsdom "^11.9.0" + +tweetnacl@^0.14.3, tweetnacl@~0.14.0: + version "0.14.5" + resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" + integrity sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q= + +tweetnacl@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-1.0.1.tgz#2594d42da73cd036bd0d2a54683dd35a6b55ca17" + integrity sha512-kcoMoKTPYnoeS50tzoqjPY3Uv9axeuuFAZY9M/9zFnhoVvRfxz9K29IMPD7jGmt2c8SW7i3gT9WqDl2+nV7p4A== + +type-check@~0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" + integrity sha1-WITKtRLPHTVeP7eE8wgEsrUg23I= + dependencies: + prelude-ls "~1.1.2" + +typedarray@^0.0.6, typedarray@~0.0.5: + version "0.0.6" + resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" + integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= + +typedoc-default-themes@^0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/typedoc-default-themes/-/typedoc-default-themes-0.5.0.tgz#6dc2433e78ed8bea8e887a3acde2f31785bd6227" + integrity sha1-bcJDPnjti+qOiHo6zeLzF4W9Yic= + +typedoc-plugin-markdown@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/typedoc-plugin-markdown/-/typedoc-plugin-markdown-1.2.1.tgz#919128812e82133240a316ac194ec93bbe244a35" + integrity sha512-zOjoCaCWvgVca920IDSytkGQd1sFSztNKGGWWcYq4JWqmeklOWvYy5QODIeTeAcUeYsP9FZ5Ov7BU8WJk5Ypig== + dependencies: + turndown "^5.0.3" + +typedoc@^0.14.2: + version "0.14.2" + resolved "https://registry.yarnpkg.com/typedoc/-/typedoc-0.14.2.tgz#769f457f4f9e4bdb8b5f3b177c86b6a31d8c3dc3" + integrity sha512-aEbgJXV8/KqaVhcedT7xG6d2r+mOvB5ep3eIz1KuB5sc4fDYXcepEEMdU7XSqLFO5hVPu0nllHi1QxX2h/QlpQ== + dependencies: + "@types/fs-extra" "^5.0.3" + "@types/handlebars" "^4.0.38" + "@types/highlight.js" "^9.12.3" + "@types/lodash" "^4.14.110" + "@types/marked" "^0.4.0" + "@types/minimatch" "3.0.3" + "@types/shelljs" "^0.8.0" + fs-extra "^7.0.0" + handlebars "^4.0.6" + highlight.js "^9.13.1" + lodash "^4.17.10" + marked "^0.4.0" + minimatch "^3.0.0" + progress "^2.0.0" + shelljs "^0.8.2" + typedoc-default-themes "^0.5.0" + typescript "3.2.x" + +typescript@3.2.x: + version "3.2.4" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.2.4.tgz#c585cb952912263d915b462726ce244ba510ef3d" + integrity sha512-0RNDbSdEokBeEAkgNbxJ+BLwSManFy9TeXz8uW+48j/xhEXv1ePME60olyzw2XzUqUBNAYFeJadIqAgNqIACwg== + +typescript@^3.5.1: + version "3.5.1" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.5.1.tgz#ba72a6a600b2158139c5dd8850f700e231464202" + integrity sha512-64HkdiRv1yYZsSe4xC1WVgamNigVYjlssIoaH2HcZF0+ijsk5YK2g0G34w9wJkze8+5ow4STd22AynfO6ZYYLw== + +u3@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/u3/-/u3-0.1.0.tgz#0060927663b68353c539cda99e9511d6687edd9d" + integrity sha1-AGCSdmO2g1PFOc2pnpUR1mh+3Z0= + +uglify-js@^3.1.4: + version "3.6.0" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.6.0.tgz#704681345c53a8b2079fb6cec294b05ead242ff5" + integrity sha512-W+jrUHJr3DXKhrsS7NUVxn3zqMOFn0hL/Ei6v0anCIMoKC93TjcflTagwIHLW7SfMFfiQuktQyFVCFHGUE0+yg== + dependencies: + commander "~2.20.0" + source-map "~0.6.1" + +uglifyify@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/uglifyify/-/uglifyify-5.0.1.tgz#70b1d8b413c410348c8e35e7f8bd1330a422d5f6" + integrity sha512-PO44rgExvwj3rkK0UzenHVnPU18drBy9x9HOUmgkuRh6K2KIsDqrB5LqxGtjybgGTOS1JeP8SBc+TN5rhiva6w== + dependencies: + convert-source-map "~1.1.0" + extend "^1.2.1" + minimatch "^3.0.2" + terser "^3.7.5" + through "~2.3.4" + +umd@^3.0.0: + version "3.0.3" + resolved "https://registry.yarnpkg.com/umd/-/umd-3.0.3.tgz#aa9fe653c42b9097678489c01000acb69f0b26cf" + integrity sha512-4IcGSufhFshvLNcMCV80UnQVlZ5pMOC8mvNPForqwA4+lzYQuetTESLDQkeLmihq8bRcnpbQa48Wb8Lh16/xow== + +unc-path-regex@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/unc-path-regex/-/unc-path-regex-0.1.2.tgz#e73dd3d7b0d7c5ed86fbac6b0ae7d8c6a69d50fa" + integrity sha1-5z3T17DXxe2G+6xrCufYxqadUPo= + +undeclared-identifiers@^1.1.2: + version "1.1.3" + resolved "https://registry.yarnpkg.com/undeclared-identifiers/-/undeclared-identifiers-1.1.3.tgz#9254c1d37bdac0ac2b52de4b6722792d2a91e30f" + integrity sha512-pJOW4nxjlmfwKApE4zvxLScM/njmwj/DiUBv7EabwE4O8kRUy+HIwxQtZLBPll/jx1LJyBcqNfB3/cpv9EZwOw== + dependencies: + acorn-node "^1.3.0" + dash-ast "^1.0.0" + get-assigned-identifiers "^1.2.0" + simple-concat "^1.0.0" + xtend "^4.0.1" + +unherit@^1.0.4: + version "1.1.2" + resolved "https://registry.yarnpkg.com/unherit/-/unherit-1.1.2.tgz#14f1f397253ee4ec95cec167762e77df83678449" + integrity sha512-W3tMnpaMG7ZY6xe/moK04U9fBhi6wEiCYHUW5Mop/wQHf12+79EQGwxYejNdhEz2mkqkBlGwm7pxmgBKMVUj0w== + dependencies: + inherits "^2.0.1" + xtend "^4.0.1" + +unicode-canonical-property-names-ecmascript@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz#2619800c4c825800efdd8343af7dd9933cbe2818" + integrity sha512-jDrNnXWHd4oHiTZnx/ZG7gtUTVp+gCcTTKr8L0HjlwphROEW3+Him+IpvC+xcJEFegapiMZyZe02CyuOnRmbnQ== + +unicode-match-property-ecmascript@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-1.0.4.tgz#8ed2a32569961bce9227d09cd3ffbb8fed5f020c" + integrity sha512-L4Qoh15vTfntsn4P1zqnHulG0LdXgjSO035fEpdtp6YxXhMT51Q6vgM5lYdG/5X3MjS+k/Y9Xw4SFCY9IkR0rg== + dependencies: + unicode-canonical-property-names-ecmascript "^1.0.4" + unicode-property-aliases-ecmascript "^1.0.4" + +unicode-match-property-value-ecmascript@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.1.0.tgz#5b4b426e08d13a80365e0d657ac7a6c1ec46a277" + integrity sha512-hDTHvaBk3RmFzvSl0UVrUmC3PuW9wKVnpoUDYH0JDkSIovzw+J5viQmeYHxVSBptubnr7PbH2e0fnpDRQnQl5g== + +unicode-property-aliases-ecmascript@^1.0.4: + version "1.0.5" + resolved "https://registry.yarnpkg.com/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.0.5.tgz#a9cc6cc7ce63a0a3023fc99e341b94431d405a57" + integrity sha512-L5RAqCfXqAwR3RriF8pM0lU0w4Ryf/GgzONwi6KnL1taJQa7x1TCxdJnILX59WIGOwR57IVxn7Nej0fz1Ny6fw== + +unified@^6.0.0: + version "6.2.0" + resolved "https://registry.yarnpkg.com/unified/-/unified-6.2.0.tgz#7fbd630f719126d67d40c644b7e3f617035f6dba" + integrity sha512-1k+KPhlVtqmG99RaTbAv/usu85fcSRu3wY8X+vnsEhIxNP5VbVIDiXnLqyKIG+UMdyTg0ZX9EI6k2AfjJkHPtA== + dependencies: + bail "^1.0.0" + extend "^3.0.0" + is-plain-obj "^1.1.0" + trough "^1.0.0" + vfile "^2.0.0" + x-is-string "^0.1.0" + +union-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.0.tgz#5c71c34cb5bad5dcebe3ea0cd08207ba5aa1aea4" + integrity sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ= + dependencies: + arr-union "^3.1.0" + get-value "^2.0.6" + is-extendable "^0.1.1" + set-value "^0.4.3" + +unique-stream@^2.0.2: + version "2.3.1" + resolved "https://registry.yarnpkg.com/unique-stream/-/unique-stream-2.3.1.tgz#c65d110e9a4adf9a6c5948b28053d9a8d04cbeac" + integrity sha512-2nY4TnBE70yoxHkDli7DMazpWiP7xMdCYqU2nBRO0UB+ZpEkGsSija7MvmvnZFUeC+mrgiUfcHSr3LmRFIg4+A== + dependencies: + json-stable-stringify-without-jsonify "^1.0.1" + through2-filter "^3.0.0" + +unist-builder@^1.0.1, unist-builder@^1.0.2: + version "1.0.4" + resolved "https://registry.yarnpkg.com/unist-builder/-/unist-builder-1.0.4.tgz#e1808aed30bd72adc3607f25afecebef4dd59e17" + integrity sha512-v6xbUPP7ILrT15fHGrNyHc1Xda8H3xVhP7/HAIotHOhVPjH5dCXA097C3Rry1Q2O+HbOLCao4hfPB+EYEjHgVg== + dependencies: + object-assign "^4.1.0" + +unist-util-generated@^1.1.0: + version "1.1.4" + resolved "https://registry.yarnpkg.com/unist-util-generated/-/unist-util-generated-1.1.4.tgz#2261c033d9fc23fae41872cdb7663746e972c1a7" + integrity sha512-SA7Sys3h3X4AlVnxHdvN/qYdr4R38HzihoEVY2Q2BZu8NHWDnw5OGcC/tXWjQfd4iG+M6qRFNIRGqJmp2ez4Ww== + +unist-util-is@^2.0.0, unist-util-is@^2.1.2: + version "2.1.3" + resolved "https://registry.yarnpkg.com/unist-util-is/-/unist-util-is-2.1.3.tgz#459182db31f4742fceaea88d429693cbf0043d20" + integrity sha512-4WbQX2iwfr/+PfM4U3zd2VNXY+dWtZsN1fLnWEi2QQXA4qyDYAZcDMfXUX0Cu6XZUHHAO9q4nyxxLT4Awk1qUA== + +unist-util-is@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/unist-util-is/-/unist-util-is-3.0.0.tgz#d9e84381c2468e82629e4a5be9d7d05a2dd324cd" + integrity sha512-sVZZX3+kspVNmLWBPAB6r+7D9ZgAFPNWm66f7YNb420RlQSbn+n8rG8dGZSkrER7ZIXGQYNm5pqC3v3HopH24A== + +unist-util-position@^3.0.0: + version "3.0.3" + resolved "https://registry.yarnpkg.com/unist-util-position/-/unist-util-position-3.0.3.tgz#fff942b879538b242096c148153826664b1ca373" + integrity sha512-28EpCBYFvnMeq9y/4w6pbnFmCUfzlsc41NJui5c51hOFjBA1fejcwc+5W4z2+0ECVbScG3dURS3JTVqwenzqZw== + +unist-util-remove-position@^1.0.0: + version "1.1.3" + resolved "https://registry.yarnpkg.com/unist-util-remove-position/-/unist-util-remove-position-1.1.3.tgz#d91aa8b89b30cb38bad2924da11072faa64fd972" + integrity sha512-CtszTlOjP2sBGYc2zcKA/CvNdTdEs3ozbiJ63IPBxh8iZg42SCCb8m04f8z2+V1aSk5a7BxbZKEdoDjadmBkWA== + dependencies: + unist-util-visit "^1.1.0" + +unist-util-stringify-position@^1.0.0, unist-util-stringify-position@^1.1.1: + version "1.1.2" + resolved "https://registry.yarnpkg.com/unist-util-stringify-position/-/unist-util-stringify-position-1.1.2.tgz#3f37fcf351279dcbca7480ab5889bb8a832ee1c6" + integrity sha512-pNCVrk64LZv1kElr0N1wPiHEUoXNVFERp+mlTg/s9R5Lwg87f9bM/3sQB99w+N9D/qnM9ar3+AKDBwo/gm/iQQ== + +unist-util-stringify-position@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/unist-util-stringify-position/-/unist-util-stringify-position-2.0.1.tgz#de2a2bc8d3febfa606652673a91455b6a36fb9f3" + integrity sha512-Zqlf6+FRI39Bah8Q6ZnNGrEHUhwJOkHde2MHVk96lLyftfJJckaPslKgzhVcviXj8KcE9UJM9F+a4JEiBUTYgA== + dependencies: + "@types/unist" "^2.0.2" + +unist-util-visit-parents@^2.0.0: + version "2.1.2" + resolved "https://registry.yarnpkg.com/unist-util-visit-parents/-/unist-util-visit-parents-2.1.2.tgz#25e43e55312166f3348cae6743588781d112c1e9" + integrity sha512-DyN5vD4NE3aSeB+PXYNKxzGsfocxp6asDc2XXE3b0ekO2BaRUpBicbbUygfSvYfUz1IkmjFR1YF7dPklraMZ2g== + dependencies: + unist-util-is "^3.0.0" + +unist-util-visit@^1.0.0, unist-util-visit@^1.1.0, unist-util-visit@^1.3.0: + version "1.4.1" + resolved "https://registry.yarnpkg.com/unist-util-visit/-/unist-util-visit-1.4.1.tgz#4724aaa8486e6ee6e26d7ff3c8685960d560b1e3" + integrity sha512-AvGNk7Bb//EmJZyhtRUnNMEpId/AZ5Ph/KUpTI09WHQuDZHKovQ1oEv3mfmKpWKtoMzyMC4GLBm1Zy5k12fjIw== + dependencies: + unist-util-visit-parents "^2.0.0" + +universalify@^0.1.0: + version "0.1.2" + resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" + integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== + +unset-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" + integrity sha1-g3aHP30jNRef+x5vw6jtDfyKtVk= + dependencies: + has-value "^0.3.1" + isobject "^3.0.0" + +upath@^1.1.1: + version "1.1.2" + resolved "https://registry.yarnpkg.com/upath/-/upath-1.1.2.tgz#3db658600edaeeccbe6db5e684d67ee8c2acd068" + integrity sha512-kXpym8nmDmlCBr7nKdIx8P2jNBa+pBpIUFRnKJ4dr8htyYGJFokkr2ZvERRtUN+9SY+JqXouNgUPtv6JQva/2Q== + +uri-js@^4.2.2: + version "4.2.2" + resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0" + integrity sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ== + dependencies: + punycode "^2.1.0" + +urix@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" + integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI= + +url@~0.11.0: + version "0.11.0" + resolved "https://registry.yarnpkg.com/url/-/url-0.11.0.tgz#3838e97cfc60521eb73c525a8e55bfdd9e2e28f1" + integrity sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE= + dependencies: + punycode "1.3.2" + querystring "0.2.0" + +use@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" + integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ== + +util-deprecate@~1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= + +util.promisify@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/util.promisify/-/util.promisify-1.0.0.tgz#440f7165a459c9a16dc145eb8e72f35687097030" + integrity sha512-i+6qA2MPhvoKLuxnJNpXAGhg7HphQOSUq2LKMZD0m15EiskXUkMvKdF4Uui0WYeCUGea+o2cw/ZuwehtfsrNkA== + dependencies: + define-properties "^1.1.2" + object.getownpropertydescriptors "^2.0.3" + +util@0.10.3: + version "0.10.3" + resolved "https://registry.yarnpkg.com/util/-/util-0.10.3.tgz#7afb1afe50805246489e3db7fe0ed379336ac0f9" + integrity sha1-evsa/lCAUkZInj23/g7TeTNqwPk= + dependencies: + inherits "2.0.1" + +util@~0.10.1: + version "0.10.4" + resolved "https://registry.yarnpkg.com/util/-/util-0.10.4.tgz#3aa0125bfe668a4672de58857d3ace27ecb76901" + integrity sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A== + dependencies: + inherits "2.0.3" + +uuid@^3.3.2: + version "3.3.2" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" + integrity sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA== + +validate-npm-package-license@^3.0.1: + version "3.0.4" + resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" + integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew== + dependencies: + spdx-correct "^3.0.0" + spdx-expression-parse "^3.0.0" + +value-or-function@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/value-or-function/-/value-or-function-3.0.0.tgz#1c243a50b595c1be54a754bfece8563b9ff8d813" + integrity sha1-HCQ6ULWVwb5Up1S/7OhWO5/42BM= + +verror@1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" + integrity sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA= + dependencies: + assert-plus "^1.0.0" + core-util-is "1.0.2" + extsprintf "^1.2.0" + +vfile-location@^2.0.0: + version "2.0.5" + resolved "https://registry.yarnpkg.com/vfile-location/-/vfile-location-2.0.5.tgz#c83eb02f8040228a8d2b3f10e485be3e3433e0a2" + integrity sha512-Pa1ey0OzYBkLPxPZI3d9E+S4BmvfVwNAAXrrqGbwTVXWaX2p9kM1zZ+n35UtVM06shmWKH4RPRN8KI80qE3wNQ== + +vfile-message@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/vfile-message/-/vfile-message-1.1.1.tgz#5833ae078a1dfa2d96e9647886cd32993ab313e1" + integrity sha512-1WmsopSGhWt5laNir+633LszXvZ+Z/lxveBf6yhGsqnQIhlhzooZae7zV6YVM1Sdkw68dtAW3ow0pOdPANugvA== + dependencies: + unist-util-stringify-position "^1.1.1" + +vfile-reporter@^5.0.0: + version "5.1.2" + resolved "https://registry.yarnpkg.com/vfile-reporter/-/vfile-reporter-5.1.2.tgz#80f1db5cbe8f9c12f2f30cce3e2cd18353a48519" + integrity sha512-b15sTuss1wOPWVlyWOvu+n6wGJ/eTYngz3uqMLimQvxZ+Q5oFQGYZZP1o3dR9sk58G5+wej0UPCZSwQBX/mzrQ== + dependencies: + repeat-string "^1.5.0" + string-width "^2.0.0" + supports-color "^5.0.0" + unist-util-stringify-position "^2.0.0" + vfile-sort "^2.1.2" + vfile-statistics "^1.1.0" + +vfile-sort@^2.1.0, vfile-sort@^2.1.2: + version "2.2.1" + resolved "https://registry.yarnpkg.com/vfile-sort/-/vfile-sort-2.2.1.tgz#74e714f9175618cdae96bcaedf1a3dc711d87567" + integrity sha512-5dt7xEhC44h0uRQKhbM2JAe0z/naHphIZlMOygtMBM9Nn0pZdaX5fshhwWit9wvsuP8t/wp43nTDRRErO1WK8g== + +vfile-statistics@^1.1.0: + version "1.1.3" + resolved "https://registry.yarnpkg.com/vfile-statistics/-/vfile-statistics-1.1.3.tgz#e9c87071997fbcb4243764d2c3805e0bb0820c60" + integrity sha512-CstaK/ebTz1W3Qp41Bt9Lj/2DmumFsCwC2sKahDNSPh0mPh7/UyMLCoU8ZBX34CRU0d61B4W41yIFsV0NKMZeA== + +vfile@^2.0.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/vfile/-/vfile-2.3.0.tgz#e62d8e72b20e83c324bc6c67278ee272488bf84a" + integrity sha512-ASt4mBUHcTpMKD/l5Q+WJXNtshlWxOogYyGYYrg4lt/vuRjC1EFQtlAofL5VmtVNIZJzWYFJjzGWZ0Gw8pzW1w== + dependencies: + is-buffer "^1.1.4" + replace-ext "1.0.0" + unist-util-stringify-position "^1.0.0" + vfile-message "^1.0.0" + +vfile@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/vfile/-/vfile-3.0.1.tgz#47331d2abe3282424f4a4bb6acd20a44c4121803" + integrity sha512-y7Y3gH9BsUSdD4KzHsuMaCzRjglXN0W2EcMf0gpvu6+SbsGhMje7xDc8AEoeXy6mIwCKMI6BkjMsRjzQbhMEjQ== + dependencies: + is-buffer "^2.0.0" + replace-ext "1.0.0" + unist-util-stringify-position "^1.0.0" + vfile-message "^1.0.0" + +vinyl-fs@^3.0.2: + version "3.0.3" + resolved "https://registry.yarnpkg.com/vinyl-fs/-/vinyl-fs-3.0.3.tgz#c85849405f67428feabbbd5c5dbdd64f47d31bc7" + integrity sha512-vIu34EkyNyJxmP0jscNzWBSygh7VWhqun6RmqVfXePrOwi9lhvRs//dOaGOTRUQr4tx7/zd26Tk5WeSVZitgng== + dependencies: + fs-mkdirp-stream "^1.0.0" + glob-stream "^6.1.0" + graceful-fs "^4.0.0" + is-valid-glob "^1.0.0" + lazystream "^1.0.0" + lead "^1.0.0" + object.assign "^4.0.4" + pumpify "^1.3.5" + readable-stream "^2.3.3" + remove-bom-buffer "^3.0.0" + remove-bom-stream "^1.2.0" + resolve-options "^1.1.0" + through2 "^2.0.0" + to-through "^2.0.0" + value-or-function "^3.0.0" + vinyl "^2.0.0" + vinyl-sourcemap "^1.1.0" + +vinyl-sourcemap@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/vinyl-sourcemap/-/vinyl-sourcemap-1.1.0.tgz#92a800593a38703a8cdb11d8b300ad4be63b3e16" + integrity sha1-kqgAWTo4cDqM2xHYswCtS+Y7PhY= + dependencies: + append-buffer "^1.0.2" + convert-source-map "^1.5.0" + graceful-fs "^4.1.6" + normalize-path "^2.1.1" + now-and-later "^2.0.0" + remove-bom-buffer "^3.0.0" + vinyl "^2.0.0" + +vinyl@^2.0.0, vinyl@^2.1.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/vinyl/-/vinyl-2.2.0.tgz#d85b07da96e458d25b2ffe19fece9f2caa13ed86" + integrity sha512-MBH+yP0kC/GQ5GwBqrTPTzEfiiLjta7hTtvQtbxBgTeSXsmKQRQecjibMbxIXzVT3Y9KJK+drOz1/k+vsu8Nkg== + dependencies: + clone "^2.1.1" + clone-buffer "^1.0.0" + clone-stats "^1.0.0" + cloneable-readable "^1.0.0" + remove-trailing-separator "^1.0.1" + replace-ext "^1.0.0" + +vm-browserify@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-1.1.0.tgz#bd76d6a23323e2ca8ffa12028dc04559c75f9019" + integrity sha512-iq+S7vZJE60yejDYM0ek6zg308+UZsdtPExWP9VZoCFCz1zkJoXFnAX7aZfd/ZwrkidzdUZL0C/ryW+JwAiIGw== + +vue-template-compiler@^2.5.16: + version "2.6.10" + resolved "https://registry.yarnpkg.com/vue-template-compiler/-/vue-template-compiler-2.6.10.tgz#323b4f3495f04faa3503337a82f5d6507799c9cc" + integrity sha512-jVZkw4/I/HT5ZMvRnhv78okGusqe0+qH2A0Em0Cp8aq78+NK9TII263CDVz2QXZsIT+yyV/gZc/j/vlwa+Epyg== + dependencies: + de-indent "^1.0.2" + he "^1.1.0" + +w3c-hr-time@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/w3c-hr-time/-/w3c-hr-time-1.0.1.tgz#82ac2bff63d950ea9e3189a58a65625fedf19045" + integrity sha1-gqwr/2PZUOqeMYmlimViX+3xkEU= + dependencies: + browser-process-hrtime "^0.1.2" + +walker@^1.0.7, walker@~1.0.5: + version "1.0.7" + resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.7.tgz#2f7f9b8fd10d677262b18a884e28d19618e028fb" + integrity sha1-L3+bj9ENZ3JisYqITijRlhjgKPs= + dependencies: + makeerror "1.0.x" + +webidl-conversions@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad" + integrity sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg== + +websocket-driver@>=0.5.1: + version "0.7.1" + resolved "https://registry.yarnpkg.com/websocket-driver/-/websocket-driver-0.7.1.tgz#d58fa3269f51e480f5af051db7f5c5c1a1092d20" + integrity sha512-EC4YX5LEHtiB1XjaCh6++35jGaFmhT7687pySyCfPX9bB8Quw7+Fpx8gSCpkD78tPjalxuoOm8TtTz8K4dAQEg== + dependencies: + http-parser-js ">=0.4.0" + safe-buffer ">=5.1.1" + websocket-extensions ">=0.1.1" + +websocket-extensions@>=0.1.1: + version "0.1.3" + resolved "https://registry.yarnpkg.com/websocket-extensions/-/websocket-extensions-0.1.3.tgz#5d2ff22977003ec687a4b87073dfbbac146ccf29" + integrity sha512-nqHUnMXmBzT0w570r2JpJxfiSD1IzoI+HGVdd3aZ0yNi3ngvQ4jv1dtHt5VGxfI2yj5yqImPhOK4vmIh2xMbGg== + +whatwg-encoding@^1.0.1, whatwg-encoding@^1.0.3: + version "1.0.5" + resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz#5abacf777c32166a51d085d6b4f3e7d27113ddb0" + integrity sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw== + dependencies: + iconv-lite "0.4.24" + +whatwg-mimetype@^2.1.0, whatwg-mimetype@^2.2.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz#3d4b1e0312d2079879f826aff18dbeeca5960fbf" + integrity sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g== + +whatwg-url@^6.4.1: + version "6.5.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-6.5.0.tgz#f2df02bff176fd65070df74ad5ccbb5a199965a8" + integrity sha512-rhRZRqx/TLJQWUpQ6bmrt2UV4f0HCQ463yQuONJqC6fO2VoEb1pTYddbe59SkYq87aoM5A3bdhMZiUiVws+fzQ== + dependencies: + lodash.sortby "^4.7.0" + tr46 "^1.0.1" + webidl-conversions "^4.0.2" + +whatwg-url@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-7.0.0.tgz#fde926fa54a599f3adf82dff25a9f7be02dc6edd" + integrity sha512-37GeVSIJ3kn1JgKyjiYNmSLP1yzbpb29jdmwBSgkD9h40/hyrR/OifpVUndji3tmwGgD8qpw7iQu3RSbCrBpsQ== + dependencies: + lodash.sortby "^4.7.0" + tr46 "^1.0.1" + webidl-conversions "^4.0.2" + +which-module@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" + integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= + +which@^1.2.9, which@^1.3.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" + integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== + dependencies: + isexe "^2.0.0" + +wide-align@^1.1.0: + version "1.1.3" + resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" + integrity sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA== + dependencies: + string-width "^1.0.2 || 2" + +wordwrap@~0.0.2: + version "0.0.3" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" + integrity sha1-o9XabNXAvAAI03I0u68b7WMFkQc= + +wordwrap@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" + integrity sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus= + +wrap-ansi@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" + integrity sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU= + dependencies: + string-width "^1.0.1" + strip-ansi "^3.0.1" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= + +write-file-atomic@2.4.1: + version "2.4.1" + resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-2.4.1.tgz#d0b05463c188ae804396fd5ab2a370062af87529" + integrity sha512-TGHFeZEZMnv+gBFRfjAcxL5bPHrsGKtnb4qsFAws7/vlh+QfwAaySIw4AXP9ZskTTh5GWu3FLuJhsWVdiJPGvg== + dependencies: + graceful-fs "^4.1.11" + imurmurhash "^0.1.4" + signal-exit "^3.0.2" + +write@1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/write/-/write-1.0.3.tgz#0800e14523b923a387e415123c865616aae0f5c3" + integrity sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig== + dependencies: + mkdirp "^0.5.1" + +ws@^5.2.0: + version "5.2.2" + resolved "https://registry.yarnpkg.com/ws/-/ws-5.2.2.tgz#dffef14866b8e8dc9133582514d1befaf96e980f" + integrity sha512-jaHFD6PFv6UgoIVda6qZllptQsMlDEJkTQcybzzXDYM1XO9Y8em691FGMPmM46WGyLU4z9KMgQN+qrux/nhlHA== + dependencies: + async-limiter "~1.0.0" + +x-is-string@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/x-is-string/-/x-is-string-0.1.0.tgz#474b50865af3a49a9c4657f05acd145458f77d82" + integrity sha1-R0tQhlrzpJqcRlfwWs0UVFj3fYI= + +xml-name-validator@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a" + integrity sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw== + +xtend@^4.0.0, xtend@^4.0.1, xtend@~4.0.0, xtend@~4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" + integrity sha1-pcbVMr5lbiPbgg77lDofBJmNY68= + +"y18n@^3.2.1 || ^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b" + integrity sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w== + +yallist@^3.0.0, yallist@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.0.3.tgz#b4b049e314be545e3ce802236d6cd22cd91c3de9" + integrity sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A== + +yargs-parser@^11.1.1: + version "11.1.1" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-11.1.1.tgz#879a0865973bca9f6bab5cbdf3b1c67ec7d3bcf4" + integrity sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ== + dependencies: + camelcase "^5.0.0" + decamelize "^1.2.0" + +yargs@^12.0.2: + version "12.0.5" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-12.0.5.tgz#05f5997b609647b64f66b81e3b4b10a368e7ad13" + integrity sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw== + dependencies: + cliui "^4.0.0" + decamelize "^1.2.0" + find-up "^3.0.0" + get-caller-file "^1.0.1" + os-locale "^3.0.0" + require-directory "^2.1.1" + require-main-filename "^1.0.1" + set-blocking "^2.0.0" + string-width "^2.0.0" + which-module "^2.0.0" + y18n "^3.2.1 || ^4.0.0" + yargs-parser "^11.1.1"