From 7b1b4fdb64082e43dcdd2d436f388fbae7b163fb Mon Sep 17 00:00:00 2001 From: zhangyouxin Date: Fri, 14 Jan 2022 09:30:59 +0800 Subject: [PATCH 1/3] feat: integrate ckb-js-toolkit --- Makefile | 2 + packages/core/.gitignore | 4 + packages/core/LICENSE | 21 + packages/core/README.md | 442 +++ packages/core/images/toolkit.svg | 3 + packages/core/index.d.ts | 162 + packages/core/lib/ckb-js-toolkit.esm.js | 1 + packages/core/lib/ckb-js-toolkit.node.js | 2 + packages/core/lib/ckb-js-toolkit.node.js.map | 1 + packages/core/lib/ckb-js-toolkit.umd.js | 1 + packages/core/package-lock.json | 2689 +++++++++++++++++ packages/core/package.json | 38 + packages/core/rollup.config.js | 57 + packages/core/src/cell_collectors/index.js | 1 + .../core/src/cell_collectors/rpc_collector.js | 77 + packages/core/src/index.js | 8 + packages/core/src/normalizers.js | 268 ++ packages/core/src/reader.js | 93 + packages/core/src/rpc.js | 117 + packages/core/src/transaction_dumper.js | 102 + packages/core/src/transformers.js | 317 ++ packages/core/src/validators.js | 406 +++ packages/core/testfiles/blockchain.umd.js | 1345 +++++++++ packages/core/tests/serializers.js | 435 +++ packages/core/tests/transformers.js | 649 ++++ packages/core/tests/validators.js | 625 ++++ yarn.lock | 584 +++- 27 files changed, 8409 insertions(+), 41 deletions(-) create mode 100644 packages/core/.gitignore create mode 100644 packages/core/LICENSE create mode 100644 packages/core/README.md create mode 100644 packages/core/images/toolkit.svg create mode 100644 packages/core/index.d.ts create mode 100644 packages/core/lib/ckb-js-toolkit.esm.js create mode 100644 packages/core/lib/ckb-js-toolkit.node.js create mode 100644 packages/core/lib/ckb-js-toolkit.node.js.map create mode 100644 packages/core/lib/ckb-js-toolkit.umd.js create mode 100644 packages/core/package-lock.json create mode 100644 packages/core/package.json create mode 100644 packages/core/rollup.config.js create mode 100644 packages/core/src/cell_collectors/index.js create mode 100644 packages/core/src/cell_collectors/rpc_collector.js create mode 100644 packages/core/src/index.js create mode 100644 packages/core/src/normalizers.js create mode 100644 packages/core/src/reader.js create mode 100644 packages/core/src/rpc.js create mode 100644 packages/core/src/transaction_dumper.js create mode 100644 packages/core/src/transformers.js create mode 100644 packages/core/src/validators.js create mode 100644 packages/core/testfiles/blockchain.umd.js create mode 100644 packages/core/tests/serializers.js create mode 100644 packages/core/tests/transformers.js create mode 100644 packages/core/tests/validators.js diff --git a/Makefile b/Makefile index 7acf13783..89daf2de7 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,7 @@ build: yarn workspace @ckb-lumos/hd-cache build yarn workspace @ckb-lumos/ckb-indexer build yarn workspace @ckb-lumos/lumos build + yarn workspace @ckb-lumos/core build build-release: build yarn workspace @ckb-lumos/lumos build:umd @@ -23,6 +24,7 @@ test: yarn workspace @ckb-lumos/indexer test yarn workspace @ckb-lumos/transaction-manager test yarn workspace @ckb-lumos/rpc test + yarn workspace @ckb-lumos/core test test-coverage: yarn c8 --reporter=cobertura --reporter=html --clean -o coverage make test diff --git a/packages/core/.gitignore b/packages/core/.gitignore new file mode 100644 index 000000000..8bba70a62 --- /dev/null +++ b/packages/core/.gitignore @@ -0,0 +1,4 @@ +node_modules/ +build/ +lib/ +dist/ \ No newline at end of file diff --git a/packages/core/LICENSE b/packages/core/LICENSE new file mode 100644 index 000000000..d10177c1c --- /dev/null +++ b/packages/core/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Xuejie Xiao + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/core/README.md b/packages/core/README.md new file mode 100644 index 000000000..992d78937 --- /dev/null +++ b/packages/core/README.md @@ -0,0 +1,442 @@ +ckb-js-toolkit +============== + +JavaScript toolkit for Nervos CKB. It contains a series of independent tools that can aid develoment of CKB dapps. This is different from a normal CKB SDK, since it tries to minimize the work done in an SDK, while providing more utlities that could be handy. + +# Design Goals + +The toolkit here is built with specific design goals, if some of the design feels quirky to you, you might want to revisit this section to see if there is some tradeoff involved. + +## Version Stability + +One design goal here is the stability of the toolkit, meaning the toolkit version you use can stay unchanged unless one of the following conditions is met: + +* A security vulnerability occurs +* A fork happens in CKB + +## Code Compatibility + +In the meantime, we also want to ensure code compatibility: we might upgrade the toolkit from time to time with new features. But when you are upgrading the toolkit version, you shouldn't expect any code breaks. Sometimes this might be infeasible, such as when security bugs or forks happen, but for the vast majority of the changes, we do want to ensure code compatibility at all costs. + +And before you ask, personally I don't trust in [Semantic Versioning](https://semver.org/). I do want to ensure code compatibility with all my efforts regardless of the specific part changed in the version number. + +## Runtime type checking + +This might be a controversial one: with the whole JavaScript world moving into static typed languages such as TypeScript, ReasonML, etc. I'm building the toolkit here with plain JavaScript doing runtime type checking. This is because none of existing static typed languages in the JavaScript world provide decent type checking stories when you are calling the code from JavaScript. I've seen too many times that a piece of code runs `JSON.parse` on some user input data, then cast the resulting object directly to a TypeScript object, ignoring all the interface checks. If all you use in TypeScript in your project, that won't be a problem, but for a CKB Toolkit built for JavaScript, not TypeScript, nor ReasonML. I want to consider the case that some people would want to use JavaScript directly to call the code in the toolkit. That's why I'm opting for pure JavaScript in this project with runtime checking code. Speed is not much of a concern here, security is a huge concern. + +In the future we might certainly provide TypeScript typing files(and maybe also ReasonML definition files), but that is just a different metric. Runtime type checking is still a critical aspect in this project. + +# Table Of Contents + +* [RPC](#rpc) +* [Reader](#reader) +* [Utility Functions](#utility-functions) + + [Validators](#validators) + + [Transformers](#transformers) + + [Normalizers](#normalizers) +* [Cell Collectors](#cell-collectors) + +# RPC + +RPC class provides a way to make RPC calls directly to CKB. It works by utilizing [Proxy object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy) so the toolkit can cope with new RPCs naturally in CKB. This is an example of `Code Compatibility` design goal. + +``` +node --experimental-repl-await +Welcome to Node.js v13.9.0. +Type ".help" for more information. +> const toolkit = require("ckb-js-toolkit") +> const rpc = new toolkit.RPC("http://127.0.0.1:9115/rpc") +> await rpc.get_blockchain_info() +{ + alerts: [], + chain: 'ckb', + difficulty: '0x5bb23548f6795', + epoch: '0x708047900028b', + is_initial_block_download: true, + median_time: '0x170aee25ea5' +} +> await rpc.get_tip_header() +{ + compact_target: '0x1a2cab56', + dao: '0x1a7930d4812eeb308acafdfe3cf1230088a770976aef78000032f12fbd5f0107', + epoch: '0x708047900028b', + hash: '0x1d0c693d8a78c9e2294ac7304934c635d7b65274fcdf46d5ce3d13ed66768cfd', + nonce: '0xe2b8ce400000000000000194cf350200', + number: '0xfcaf2', + parent_hash: '0x9cf27f050122efb35c362d105d980062d8ea29a8e0f86ec6a4ea06178a5a0381', + proposals_hash: '0x0000000000000000000000000000000000000000000000000000000000000000', + timestamp: '0x170aee486ee', + transactions_root: '0x16c74b3272430f1a89bb2fca39a571bf7a1bffecb314de528b6cbe9ba0f5d280', + uncles_hash: '0x0000000000000000000000000000000000000000000000000000000000000000', + version: '0x0' +} +> await rpc.get_header_by_number("0x12") +{ + compact_target: '0x1a08a97e', + dao: '0x18a6312eb520a12e8e552ee0f286230026c8799e8500000000bc29f1c9fefe06', + epoch: '0x6cf0012000000', + hash: '0xbc00f447149004a38a8f7347dcd0a2050a2f10f4b926325d797c0f3e0d10f99b', + nonce: '0x93317ca10000055400000000ba7e0100', + number: '0x12', + parent_hash: '0x4a191e12132587e852ddc30c73008426da6322a7def06ee153682afdceab16e7', + proposals_hash: '0x0000000000000000000000000000000000000000000000000000000000000000', + timestamp: '0x16e71002eff', + transactions_root: '0xcc05a6b1fc20464d4f07a40611f2cab00618ff66cc271ccee9a9fe5b4ea96a45', + uncles_hash: '0x0000000000000000000000000000000000000000000000000000000000000000', + version: '0x0' +} +``` + +Please refer to [CKB's RPC documentation](https://github.com/nervosnetwork/ckb/tree/develop/rpc) for more details on different RPCs. All values accepted by the RPC module has to be JSON ready values(such as hex strings or objects) following CKB's JSONRPC formatting rules. See [Validators](#validators) and [Transformers](#transformers) sections below on how the toolkit can aid the conversion work. + +# Reader + +Reader class serves a unique purpose: depending on sources of data, we might get values in different formats: + +* Hex string might be provided in CKB RPC responses +* ArrayBuffer might be provided by CKB syscalls +* Raw string might also be used for coding convenience + +One big question, is how we can manage all those different data formats? How can we ensure we can convert them to the correct hex format beforing sending them to CKB's RPC? Reader class serves this purpose: + +``` +node --experimental-repl-await +Welcome to Node.js v13.9.0. +Type ".help" for more information. +> const toolkit = require("ckb-js-toolkit"); +undefined +> const { Reader } = toolkit; +undefined +> const reader1 = new Reader("0x31323334") +undefined +> const arraybuffer = new ArrayBuffer(4) +undefined +> const view = new DataView(arraybuffer) +undefined +> view.setUint8(0, 0x31) +undefined +> view.setUint8(1, 0x32) +undefined +> view.setUint8(2, 0x33) +undefined +> view.setUint8(3, 0x34) +undefined +> const reader2 = new Reader(arraybuffer) +undefined +> const reader3 = Reader.fromRawString("1234") +undefined +> reader1.serializeJson() +'0x31323334' +> reader2.serializeJson() +'0x31323334' +> reader3.serializeJson() +'0x31323334' +``` + +Here we are setting `reader1`, `reader2` and `reader3` using differnet methods, the result here stays the same no matter what format the source data uses. Later in the [Transformers](#transformers) section we will see how we can combine Reader with transformers for a unified coding experience. + +# Utility Functions + +The toolkit doesn't provide pre-defined models on common constructs. Instead, it is defined to let you have your own model, and work with it. For example, typical Web project probably has models defined from an ORM over a SQL database. I don't want you to have both a cell data structure defined in your ORM, and in the toolkit. We wanta to take a different path here: you only need to define the data structure once, whether it's defined from an ORM, or defined as an ECMAScript class with methods customed to your project. All you need to do, is to follow rules defined by transformers, you will be able to use the utility functions defined here. + +The diagram below illustrates the relations between the utility functions: + +![Utility Function Relations](images/toolkit.svg) + +`Normalizers`, `Transformers` and `Validators` are included in this repository. `Denormalizers` are kept in the more experimental [ckb-js-toolkit-contrib](https://github.com/xxuejie/ckb-js-toolkit-contrib) project for now, and might be moved here once it is stablized. `Serializers` and `Deserializers` refer to JavaScript source generated by the [moleculec-es](https://github.com/xxuejie/moleculec-es) project. In most cases, you don't have to use `moleculec-es` directly, a ready-to-use file has been put in [ckb-js-toolkit-contrib](https://github.com/xxuejie/ckb-js-toolkit-contrib/blob/master/src/blockchain.js). + +There is one exception here: `Deserializers` are not functions actually, they are [classes](https://github.com/xxuejie/ckb-js-toolkit-contrib/blob/747db7616116a3d5511f633f71b0415b53e83060/src/blockchain.js#L691) that is constructed from ArrayBuffer to better leverage molecule's zero copy design. + +You might also notice there is no conversions from JSON Ready Object to objects in your own data structures. This part will have to be implemented by yourself if needed. + +## Validators + +### Overview + +Validator is an example of the `Runtime type checking` design goal, it provides a series of functions are provided here to validate that a JSON object follows required format for a CKB data structure, such as script, outpoint, transaction, block, etc. So when you have prepared the values required by the RPC class, you can pass the value through the validators here, to ensure they are of the correct format. + +First, let's look at one example: + +``` +node --experimental-repl-await +Welcome to Node.js v13.9.0. +Type ".help" for more information. +> const toolkit = require("ckb-js-toolkit") +> const rpc = new toolkit.RPC("http://127.0.0.1:9115/rpc") +> const transaction = (await rpc.get_transaction("0x71a7ba8fc96349fea0ed3a5c47992e3b4084b031a42264a018e0072e8172e46c")).transaction +> toolkit.validators.ValidateTransaction(transaction) +Uncaught: +Error: transaction does not have correct keys! Required keys: [cell_deps, header_deps, inputs, outputs, outputs_data, version, witnesses], optional keys: [], actual keys: [cell_deps, hash, header_deps, inputs, outputs, outputs_data, version, witnesses] +> delete transaction.hash +> transaction +{ + cell_deps: [ + { dep_type: 'code', out_point: [Object] }, + { dep_type: 'code', out_point: [Object] } + ], + header_deps: [], + inputs: [ { previous_output: [Object], since: '0x0' } ], + outputs: [ + { capacity: '0x2b95fd500', lock: [Object], type: null }, + { capacity: '0x2b95fd500', lock: [Object], type: null } + ], + outputs_data: [ + '0x02000000e2fb199810d49a4d8beec56718ba2593b665db9d52299a0f9e6e75416d73ff5c03000000e2fb199810d49a4d8beec56718ba2593b665db9d52299a0f9e6e75416d73ff5c01000000', + '0x02000000e2fb199810d49a4d8beec56718ba2593b665db9d52299a0f9e6e75416d73ff5c03000000e2fb199810d49a4d8beec56718ba2593b665db9d52299a0f9e6e75416d73ff5c04000000' + ], + version: '0x0', + witnesses: [ + '0x3ed693609d3ff7049415d33a2fff8eed581cf2790fae4785e27793330cfd55a6109b84a94494eae64217339bc9aafdf4e6453964c90e6752d96e20d127ca874901' + ] +} +> toolkit.validators.ValidateTransaction(transaction) +undefined +> transaction.outputs[1].lock.args = 123 +123 +> toolkit.validators.ValidateTransaction(transaction) +Uncaught Error: transaction.outputs[1].lock.args must be a hex string! + at nt (/home/ubuntu/code/ckb-js-toolkit/dist/ckb-js-toolkit.node.js:1:46599) + at st (/home/ubuntu/code/ckb-js-toolkit/dist/ckb-js-toolkit.node.js:1:47003) + at lt (/home/ubuntu/code/ckb-js-toolkit/dist/ckb-js-toolkit.node.js:1:47614) + at /home/ubuntu/code/ckb-js-toolkit/dist/ckb-js-toolkit.node.js:1:48132 + at ct (/home/ubuntu/code/ckb-js-toolkit/dist/ckb-js-toolkit.node.js:1:48073) + at ht (/home/ubuntu/code/ckb-js-toolkit/dist/ckb-js-toolkit.node.js:1:48343) + at Object.dt [as ValidateTransaction] (/home/ubuntu/code/ckb-js-toolkit/dist/ckb-js-toolkit.node.js:1:48755) +``` + +From the example above, we can deduce some insights: + +* Validator function will check if given object has correct keys for each field required in the object. For example, a transaction object do not need `hash` field, but CKB's RPC response contains this field, hence the first validator invocation fails. Later when we delete the `hash` key, the object passes all validation. +* By default validator function recursively check all fields to make sure they follow the correct format. In the above example, the validator would signal error when we change `args` field of one output's lock script to `123`, which is an invalid value. You will also notice that the error message generated in this case is: `transaction.outputs[1].lock.args must be a hex string!`, it contains the full path of the error value: `transaction.outputs[1].lock.args`. + +Notice you are not required to use validator functions in your dapp: if you are familiar with CKB's data structure, you are perfectly good ignoring all validator functions, and ensure the objects are in correct format yourself. But I personally I believe validators are gonna be a very handy component in your toolbox when you run into formatting errors in your dapp. + +### Function prototypes + +For each CKB data structure, we have prepared a validator function, which means right now the following functions are available: + +* [ValidateScript](https://github.com/xxuejie/ckb-js-toolkit/blob/48eb43f10da07d30ebc9411c7a0714905ef9164f/src/validators.js#L65) +* [ValidateOutPoint](https://github.com/xxuejie/ckb-js-toolkit/blob/48eb43f10da07d30ebc9411c7a0714905ef9164f/src/validators.js#L83) +* [ValidateCellInput](https://github.com/xxuejie/ckb-js-toolkit/blob/48eb43f10da07d30ebc9411c7a0714905ef9164f/src/validators.js#L92) +* [ValidateCellOutput](https://github.com/xxuejie/ckb-js-toolkit/blob/48eb43f10da07d30ebc9411c7a0714905ef9164f/src/validators.js#L106) +* [ValidateCellDep](https://github.com/xxuejie/ckb-js-toolkit/blob/48eb43f10da07d30ebc9411c7a0714905ef9164f/src/validators.js#L125) +* [ValidateRawTransaction](https://github.com/xxuejie/ckb-js-toolkit/blob/48eb43f10da07d30ebc9411c7a0714905ef9164f/src/validators.js#L195) +* [ValidateTransaction](https://github.com/xxuejie/ckb-js-toolkit/blob/48eb43f10da07d30ebc9411c7a0714905ef9164f/src/validators.js#L215) +* [ValidateRawHeader](https://github.com/xxuejie/ckb-js-toolkit/blob/48eb43f10da07d30ebc9411c7a0714905ef9164f/src/validators.js#L255) +* [ValidateHeader](https://github.com/xxuejie/ckb-js-toolkit/blob/48eb43f10da07d30ebc9411c7a0714905ef9164f/src/validators.js#L279) +* [ValidateUncleBlock](https://github.com/xxuejie/ckb-js-toolkit/blob/48eb43f10da07d30ebc9411c7a0714905ef9164f/src/validators.js#L316) +* [ValidateBlock](https://github.com/xxuejie/ckb-js-toolkit/blob/48eb43f10da07d30ebc9411c7a0714905ef9164f/src/validators.js#L335) +* [ValidateCellbaseWitness](https://github.com/xxuejie/ckb-js-toolkit/blob/48eb43f10da07d30ebc9411c7a0714905ef9164f/src/validators.js#L371) +* [ValidateWitnessArgs](https://github.com/xxuejie/ckb-js-toolkit/blob/48eb43f10da07d30ebc9411c7a0714905ef9164f/src/validators.js#L385) + +Each validator function uses exactly the same function prototype as below: + +```js +function validate(value, { nestedValidation = true, debugPath = "" } = {}) +``` + +`value` here contains the JSON object to check against. `nestedValidation` controls if nested validation is performed. For example, when you are validating the structure of a transaction, you can use this flag to control whether you want to validate transaction itself, or if you want to do recursive validation on all the included fields, such as inputs, outputs, etc. `debugPath` here is a value used to generate full value path in error messages, in 99% of the cases, you can safely ignore this value and just use the default ones. + +The validator functions here would throw errors in case validation fails, otherwise the validation is considered successful. Return values of vaildator functions shall not be used. + +## Transformers + +### Overview + +Transformer also provides a series of functions much like validators do, but transformers serve a different purpose: while RPC accepts JSON ready values such as strings or plain objects, you might not want the same thing in your dapps. Chances are you have some custom classes that wrap a CKB cell or even a CKB transaction, and will need separate processing work to transform the values into the final formats. Another case might be that you are leveraging the Reader class introduced above a lot, and you need to transform the very inner `args` part of cell outputs in your current transaction before you can send it to the RPC. Transformers fill in exactly this role: they help us transform custom data formats following a very single rule to the formats acceptable by CKB RPCs. This might sound quite abstract here, let's also look at one example. First, let's prepare a supporting commonjs JavaScript file: + +``` +$ cat << EOF > test.js +class Script { + constructor(code_hash, args) { + this.code_hash = code_hash; + this.args = args; + } + + serializeJson() { + return { + code_hash: this.code_hash, + hash_type: "data", + args: this.args + }; + } +} + +module.exports = Script; +EOF +``` + +Here we are defining a custom class wrapping Script. We can now see how transformers will help us use the wrapper class: + +``` +node --experimental-repl-await +Welcome to Node.js v13.9.0. +Type ".help" for more information. +> const toolkit = require("ckb-js-toolkit"); +undefined +> const Script = require("./test.js"); +undefined +> const script = new Script(new toolkit.Reader("0x71a7ba8fc96349fea0ed3a5c47992e3b4084b031a42264a018e0072e8172e46c"), "0x") +undefined +> script +Script { + code_hash: a { + string: '0x71a7ba8fc96349fea0ed3a5c47992e3b4084b031a42264a018e0072e8172e46c' + }, + args: '0x' +} +> toolkit.validators.ValidateScript(script) +Uncaught: +Error: script does not have correct keys! Required keys: [args, code_hash, hash_type], optional keys: [], actual keys: [args, code_hash] +> const transformedScript = toolkit.transformers.TransformScript(script) +undefined +> transformedScript +{ + code_hash: '0x71a7ba8fc96349fea0ed3a5c47992e3b4084b031a42264a018e0072e8172e46c', + hash_type: 'data', + args: '0x' +} +> toolkit.validators.ValidateScript(transformedScript) +undefined +``` + +If we pass objects instantiated from Script class directly, validator functions will fail, and so will CKB RPC(even if we haven't tested it here). However, if we pass the objects into transformer functions, the transformed value will have the correct format required by CKB's RPC. This shows that you can use whatever data format you want in your dapp, as long as it can be transformed to correct format by the transformers, you can largely ignore CKB's format rules in your dapp. + +Of course, not any format can be transformed by transformer functions here. You might already noticed the `serializeJson` function included in the `Script` class, this is exactly how transformer functions work on. What's not so obvious, here, is that transformer functions will recursively invoke `serializeJson` on nested entities to make sure all sub-fields are also transformed properly. For example, the `code_hash` passed to Script object here, is actually a Reader instance, while `serializeJson` of Script class ignored the type of `code_hash`, transformer functions also perform the necessary transformation, which converts Reader object into hex strings. + +Unlike validators, we expect you to heavily rely on transformers in your dapps. These days it will be very unlikely that people use plain old JavaScript objects to store data, we tend to use all kinds of abstractions that help us organize our code better. + +### Function prototypes + +For each CKB data structure, we have prepared a transformer function, which means right now the following functions are available: + +* [TransformScript](https://github.com/xxuejie/ckb-js-toolkit/blob/48eb43f10da07d30ebc9411c7a0714905ef9164f/src/transformers.js#L44) +* [TransformOutPoint](https://github.com/xxuejie/ckb-js-toolkit/blob/48eb43f10da07d30ebc9411c7a0714905ef9164f/src/transformers.js#L62) +* [TransformCellInput](https://github.com/xxuejie/ckb-js-toolkit/blob/48eb43f10da07d30ebc9411c7a0714905ef9164f/src/transformers.js#L88) +* [TransformCellOutput](https://github.com/xxuejie/ckb-js-toolkit/blob/48eb43f10da07d30ebc9411c7a0714905ef9164f/src/transformers.js#L105) +* [TransformCellDep](https://github.com/xxuejie/ckb-js-toolkit/blob/48eb43f10da07d30ebc9411c7a0714905ef9164f/src/transformers.js#L123) +* [TransformRawTransaction](https://github.com/xxuejie/ckb-js-toolkit/blob/48eb43f10da07d30ebc9411c7a0714905ef9164f/src/transformers.js#L148) +* [TransformTransaction](https://github.com/xxuejie/ckb-js-toolkit/blob/48eb43f10da07d30ebc9411c7a0714905ef9164f/src/transformers.js#L169) +* [TransformRawHeader](https://github.com/xxuejie/ckb-js-toolkit/blob/48eb43f10da07d30ebc9411c7a0714905ef9164f/src/transformers.js#L191) +* [TransformHeader](https://github.com/xxuejie/ckb-js-toolkit/blob/48eb43f10da07d30ebc9411c7a0714905ef9164f/src/transformers.js#L216) +* [TransformUncleBlock](https://github.com/xxuejie/ckb-js-toolkit/blob/48eb43f10da07d30ebc9411c7a0714905ef9164f/src/transformers.js#L242) +* [TransformBlock](https://github.com/xxuejie/ckb-js-toolkit/blob/48eb43f10da07d30ebc9411c7a0714905ef9164f/src/transformers.js#L259) +* [TransformCellbaseWitness](https://github.com/xxuejie/ckb-js-toolkit/blob/48eb43f10da07d30ebc9411c7a0714905ef9164f/src/transformers.js#L278) +* [TransformWitnessArgs](https://github.com/xxuejie/ckb-js-toolkit/blob/48eb43f10da07d30ebc9411c7a0714905ef9164f/src/transformers.js#L295) + +Each transformer function uses exactly the same function prototype as below: + +```js +function transform(value, { validation = true, debugPath = "" } = {}) +``` + +`value` here contains the value to perform transformation(see next section for transformation rules). `validation` controls if validators should also be called after transformation. `debugPath` works like the same value in validators, and could safely be ignored in 99% of the cases. + +### Transformation Rules + +Transformer functions use the following transformation rules: + +* If the provide value is an object with method `serializeJson`, invoke the method and use the return value to replace provided value; +* Check if the value is an object, throw error if it is not; +* Remove all extra keys that should not exist for the type of current value object; +* For each field in the object, apply the transformation rules recursively. + +### Note on Reader class + +We have already provided `serializeJson` method for all instances of the Reader class, that means you can freely use Reader class in your code. As long as you apply transformer functions before sending the values to CKB RPC, all the Reader objects will be transformed to correct hex strings. + +## Normalizers + +### Overview + +Normalizers serve a different purpose: in addition to the molecule serialization format, CKB still encodes certain domain specific knowledge to interpret the data. This brings a gap between the JSON data structure used in CKB RPC, and the molecule serialized formats used internally. If you are only using CKB RPC, you probably will not use this package, but if you need to work with CKB in a deeper level(for example, if you are writing a smart contract in JavaScript), chances are you might need this package. + +A sample usage for this package can be seen in the included [tests](https://github.com/xxuejie/ckb-js-toolkit/blob/master/tests/serializers.js). A normalizer function takes plain JavaScript object that can be validated by validator function, it then emits another transformed plain JavaScript object which can be serialized by [moleculec-es](https://github.com/xxuejie/moleculec-es) into serialized ArrayBuffer data in molecule format. + +### Function prototypes + +For each CKB data structure, we have prepared a normalizer function, which means right now the following functions are available: + +* [NormalizeScript](https://github.com/xxuejie/ckb-js-toolkit/blob/d17eda8dc41689b14913500332085d9a9ae85a01/src/normalizers.js#L71) +* [NormalizeOutPoint](https://github.com/xxuejie/ckb-js-toolkit/blob/d17eda8dc41689b14913500332085d9a9ae85a01/src/normalizers.js#L92) +* [NormalizeCellInput](https://github.com/xxuejie/ckb-js-toolkit/blob/d17eda8dc41689b14913500332085d9a9ae85a01/src/normalizers.js#L107) +* [NormalizeCellOutput](https://github.com/xxuejie/ckb-js-toolkit/blob/d17eda8dc41689b14913500332085d9a9ae85a01/src/normalizers.js#L117) +* [NormalizeCellDep](https://github.com/xxuejie/ckb-js-toolkit/blob/d17eda8dc41689b14913500332085d9a9ae85a01/src/normalizers.js#L133) +* [NormalizeRawTransaction](https://github.com/xxuejie/ckb-js-toolkit/blob/d17eda8dc41689b14913500332085d9a9ae85a01/src/normalizers.js#L161) +* [NormalizeTransaction](https://github.com/xxuejie/ckb-js-toolkit/blob/d17eda8dc41689b14913500332085d9a9ae85a01/src/normalizers.js#L175) +* [NormalizeRawHeader](https://github.com/xxuejie/ckb-js-toolkit/blob/d17eda8dc41689b14913500332085d9a9ae85a01/src/normalizers.js#L189) +* [NormalizeHeader](https://github.com/xxuejie/ckb-js-toolkit/blob/d17eda8dc41689b14913500332085d9a9ae85a01/src/normalizers.js#L207) +* [NormalizeUncleBlock](https://github.com/xxuejie/ckb-js-toolkit/blob/d17eda8dc41689b14913500332085d9a9ae85a01/src/normalizers.js#L218) +* [NormalizeBlock](https://github.com/xxuejie/ckb-js-toolkit/blob/d17eda8dc41689b14913500332085d9a9ae85a01/src/normalizers.js#L228) +* [NormalizeCellbaseWitness](https://github.com/xxuejie/ckb-js-toolkit/blob/d17eda8dc41689b14913500332085d9a9ae85a01/src/normalizers.js#L237) +* [NormalizeWitnessArgs](https://github.com/xxuejie/ckb-js-toolkit/blob/d17eda8dc41689b14913500332085d9a9ae85a01/src/normalizers.js#L247) + +Each normalizer function uses exactly the same function prototype as below: + +```js +function transform(value, { debugPath = "" } = {}) +``` + +`value` here contains the value which can be validated by corresponding validator function. `debugPath` works like the same value in validators, and could safely be ignored in 99% of the cases. + +# Cell Collectors + +One extremely typical tasks in CKB, is to index and query cells with certain properties, such as live cells with the same lock script hash. Cell collectors has been provided in the toolkit to aid this task. + +As usual, first let's see an example: + +``` +node --experimental-repl-await +Welcome to Node.js v13.9.0. +Type ".help" for more information. +> const toolkit = require("ckb-js-toolkit"); +undefined +> const rpc = new toolkit.RPC("http://127.0.0.1:9115/rpc") +undefined +> const collector = new toolkit.cell_collectors.RPCCollector(rpc, "0x7c7232c0af4a7261674a45e14916f926ecec64b911f539e573fb4bb7817d001e") +undefined +> for await (const cell of collector.collect()) { console.log(cell); } +{ + cell_output: { + capacity: '0x3faa252260000', + lock: { + args: '0xfa3afa2134319f9471cf21024f032831bc4651ad', + code_hash: '0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8', + hash_type: 'type' + }, + type: null + }, + out_point: { + index: '0x7', + tx_hash: '0xe2fb199810d49a4d8beec56718ba2593b665db9d52299a0f9e6e75416d73ff5c' + }, + block_hash: '0x92b197aa1fba0f63633922c61c92375c9c074a93e85963554f5499fe1450d0e5', + data: null, + block_number: '0x0' +} +``` + +Here we are using [RPCCollector](https://github.com/xxuejie/ckb-js-toolkit/blob/master/src/cell_collectors/rpc_collector.js) to scan CKB via RPCs, and gather all live cells satisfying a given lock script hash. Notice [async iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/asyncIterator) is leveraged here to provide a clean API to the end users. + +## Collector Interface + +A cell collector should satisfy the following rules: + +* It should provide a `collect` method that returns an async iterator; +* The async iterator should generate plain JavaScript objects with the following fields: + + `cell_output`: CellOutput object that can be validated by `ValidateCellOutput` + + `out_point`: OutPoint object that can be validated by `ValidateOutPoint` + + `block_hash`: A 66-byte long hex string containing block header hash + * `data`: An optional hex string containing cell data, depending on the specific cell collector, this could be omitted, in which case `null` should be used here. + +In the above example we are only showing RPCCollector, there might be many different implementations of cell collectors, assuming they satisfy the above rules. In the future we might add more cell collector implementations here, and you are also welcome to create your own implementations of cell collectors. + +One additional note here, is that even though RPCCollector above only gathers cells with the same lock script hash, this is not the case for your custom cell collectors. The only true requirement of a cell collector, is the async iterator interface. You can use any filtering logic in your cell collector, for example, you can gather by type script hash, or by lock script code hash, or you can even call external services, such as [animagus](https://github.com/xxuejie/animagus) to provide you with the cells to use. + +## Collector Index + +### RPCCollector + +RPCCollector uses [get_cells_by_lock_hash](https://github.com/nervosnetwork/ckb/tree/develop/rpc#get_cells_by_lock_hash) to fetch matched live cells via CKB RPC. It only allows fetching live cells matching provided lock script hash, and can be controlled to either provide or omit cell data. + +Note RPCCollector is a naive implementation, meaning it would do the full scanning every time you call `collect`. This means it could be quite slow, and you should never use it in production. It is only used here for demostration purposes. diff --git a/packages/core/images/toolkit.svg b/packages/core/images/toolkit.svg new file mode 100644 index 000000000..25a3ee275 --- /dev/null +++ b/packages/core/images/toolkit.svg @@ -0,0 +1,3 @@ + + +
Your Own Object
Camel or snake case
Your Own Object...
JSON Ready Object
Snake case
JSON Ready Object...
CKB
RPC
CKB...
Transformers
Transformers
Validators
Validators
Molecule Ready Object
Snake case
Molecule Ready Objec...
Normalizers
Normalizers
ArrayBuffer
ArrayBuffer
Serializers
Serializers
Denormalizers
Denormalizers
Molecule Object
over ArrayBuffer
Molecule Object...
Deserializers
Deserializers
CKB
Hasher
CKB...
Viewer does not support full SVG 1.1
\ No newline at end of file diff --git a/packages/core/index.d.ts b/packages/core/index.d.ts new file mode 100644 index 000000000..6d772ce37 --- /dev/null +++ b/packages/core/index.d.ts @@ -0,0 +1,162 @@ +import JSBI from "jsbi"; + +export class Reader { + constructor(reader: string | ArrayBuffer | Reader); + static fromRawString(s: string): Reader; + + length(): number; + indexAt(i: number): number; + toArrayBuffer(): ArrayBuffer; + serializeJson(): string; +} + +export type RPCValue = any; +export type RPCSyncHandler = (...params: RPCValue[]) => RPCValue; +export type RPCHandler = (...params: RPCValue[]) => Promise; + +export class BatchRPCMethods { + send: RPCHandler; +} + +export class BatchRPCProxy { + [method: string]: RPCSyncHandler; +} + +export type BatchRPC = BatchRPCMethods & BatchRPCProxy; + +export class RPCMethods { + batch: () => BatchRPC; +} + +export class RPCProxy { + [method: string]: RPCHandler; +} + +export class RPC { + /** + * To preserve compatibility, we still provide the default constructor + * but it cannot tell if you are calling the sync method batch, or other + * async methods. You will need to distinguish between them yourself. + */ + constructor(uri: string, options?: object); + [method: string]: RPCHandler | RPCSyncHandler; + + static create(uri: string): RPCMethods & RPCProxy; +} + +export function HexStringToBigInt(hexString: string): JSBI; +export function BigIntToHexString(i: JSBI): string; + +export interface ValidatorOptions { + nestedValidation?: boolean; + debugPath?: string; +} +type ValidatorFunction = (value: object, options?: ValidatorOptions) => void; + +export namespace validators { + const ValidateScript: ValidatorFunction; + const ValidateOutPoint: ValidatorFunction; + const ValidateCellInput: ValidatorFunction; + const ValidateCellOutput: ValidatorFunction; + const ValidateCellDep: ValidatorFunction; + const ValidateRawTransaction: ValidatorFunction; + const ValidateTransaction: ValidatorFunction; + const ValidateRawHeader: ValidatorFunction; + const ValidateHeader: ValidatorFunction; + const ValidateUncleBlock: ValidatorFunction; + const ValidateBlock: ValidatorFunction; + const ValidateCellbaseWitness: ValidatorFunction; + const ValidateWitnessArgs: ValidatorFunction; +} + +export interface TransformerOptions { + validation?: boolean; + debugPath?: string; +} +type TransformerFunction = ( + value: object, + options?: TransformerOptions +) => object; + +export namespace transformers { + const TransformScript: TransformerFunction; + const TransformOutPoint: TransformerFunction; + const TransformCellInput: TransformerFunction; + const TransformCellOutput: TransformerFunction; + const TransformCellDep: TransformerFunction; + const TransformRawTransaction: TransformerFunction; + const TransformTransaction: TransformerFunction; + const TransformRawHeader: TransformerFunction; + const TransformHeader: TransformerFunction; + const TransformUncleBlock: TransformerFunction; + const TransformBlock: TransformerFunction; + const TransformCellbaseWitness: TransformerFunction; + const TransformWitnessArgs: TransformerFunction; +} + +export interface NormalizerOptions { + debugPath?: string; +} +type NormalizerFunction = ( + value: object, + options?: NormalizerOptions +) => object; + +export namespace normalizers { + const NormalizeScript: NormalizerFunction; + const NormalizeOutPoint: NormalizerFunction; + const NormalizeCellInput: NormalizerFunction; + const NormalizeCellOutput: NormalizerFunction; + const NormalizeCellDep: NormalizerFunction; + const NormalizeRawTransaction: NormalizerFunction; + const NormalizeTransaction: NormalizerFunction; + const NormalizeRawHeader: NormalizerFunction; + const NormalizeHeader: NormalizerFunction; + const NormalizeUncleBlock: NormalizerFunction; + const NormalizeBlock: NormalizerFunction; + const NormalizeCellbaseWitness: NormalizerFunction; + const NormalizeWitnessArgs: NormalizerFunction; +} + +export interface Cell { + cell_output: object; + out_point: object; + block_hash: string; + data?: string; + block_number?: string; +} + +export interface CellCollectorResults { + [Symbol.asyncIterator](): AsyncIterator; +} + +export interface CellCollector { + collect(): CellCollectorResults; +} + +export namespace cell_collectors { + interface RPCCollectorOptions { + skipCellWithContent?: boolean; + loadData?: boolean; + } + + class RPCCollector implements CellCollector { + constructor(rpc: RPC, lockHash: string, options?: RPCCollectorOptions); + + collect(): CellCollectorResults; + } +} + +export type DepGroupUnpacker = (data: Reader) => Array; +export interface TransactionDumperOptions { + validateTransaction?: boolean; + depGroupUnpacker?: DepGroupUnpacker; +} + +export class TransactionDumper { + constructor(rpc: RPC, options?: TransactionDumperOptions); + + dump(tx: object): Promise; +} + +export const VERSION: string; diff --git a/packages/core/lib/ckb-js-toolkit.esm.js b/packages/core/lib/ckb-js-toolkit.esm.js new file mode 100644 index 000000000..2178aed57 --- /dev/null +++ b/packages/core/lib/ckb-js-toolkit.esm.js @@ -0,0 +1 @@ +class t{constructor(t){this.view=new DataView(t)}length(){return this.view.byteLength}indexAt(t){return this.view.getUint8(t)}toArrayBuffer(){return this.view.buffer}serializeJson(){return"0x"+Array.prototype.map.call(new Uint8Array(this.view.buffer),(t=>("00"+t.toString(16)).slice(-2))).join("")}}class e{constructor(t){this.string=t}length(){return this.string.length/2-1}indexAt(t){return parseInt(this.string.substr(2+2*t,2),16)}toArrayBuffer(){const t=new ArrayBuffer(this.length()),e=new DataView(t);for(let t=0;t255)throw new Error("fromRawString can only accept UTF-8 raw string!");n.setUint8(t,r)}return new t(r)}}var n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function i(t,e,r){return t(r={path:e,exports:{},require:function(t,e){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==e&&r.path)}},r.exports),r.exports}var o=i((function(t,e){t.exports=function(){function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}function e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){for(var r,n=0;nt.length)&&(e=t.length);for(var r=0,n=Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw o}}}}var v=function(r){var o=Math.abs,a=Math.max,u=Math.imul,s=Math.clz32;function _(t,r){var n;if(e(this,_),t>_.__kMaxLength)throw new RangeError("Maximum BigInt size exceeded");return(n=l.call(this,t)).sign=r,n}i(_,r);var l=h(_);return n(_,[{key:"toDebugString",value:function(){var t,e=["BigInt["],r=p(this);try{for(r.s();!(t=r.n()).done;){var n=t.value;e.push((n?(n>>>0).toString(16):n)+", ")}}catch(t){r.e(t)}finally{r.f()}return e.push("]"),e.join("")}},{key:"toString",value:function(){var t=0t||36this.length&&(r=this.length);for(var n=65535&t,i=t>>>16,o=0,a=65535&e,s=e>>>16,_=0;_>>16,h=u(f,n),g=u(f,i),d=u(c,n),p=u(c,i),v=a+(65535&h),y=s+o+(v>>>16)+(h>>>16)+(65535&g)+(65535&d);o=(a=(g>>>16)+(d>>>16)+(65535&p)+(y>>>16))>>>16,a&=65535,s=p>>>16,this.__setDigit(_,65535&v|y<<16)}if(0!==o||0!==a||0!==s)throw new Error("implementation bug")}},{key:"__inplaceAdd",value:function(t,e,r){for(var n,i=0,o=0;o>>16,this.__setHalfDigit(e+o,n);return i}},{key:"__inplaceSub",value:function(t,e,r){var n=0;if(1&e){e>>=1;for(var i=this.__digit(e),o=65535&i,a=0;a>>1;a++){var u=t.__digit(a),s=(i>>>16)-(65535&u)-n;n=1&s>>>16,this.__setDigit(e+a,s<<16|65535&o),n=1&(o=(65535&(i=this.__digit(e+a+1)))-(u>>>16)-n)>>>16}var _=t.__digit(a),l=(i>>>16)-(65535&_)-n;if(n=1&l>>>16,this.__setDigit(e+a,l<<16|65535&o),e+a+1>=this.length)throw new RangeError("out of bounds");0==(1&r)&&(n=1&(o=(65535&(i=this.__digit(e+a+1)))-(_>>>16)-n)>>>16,this.__setDigit(e+t.length,4294901760&i|65535&o))}else{e>>=1;for(var f=0;f>>16)-(h>>>16)-(n=1&g>>>16);n=1&d>>>16,this.__setDigit(e+f,d<<16|65535&g)}var p=this.__digit(e+f),v=t.__digit(f),y=(65535&p)-(65535&v)-n;n=1&y>>>16;var b=0;0==(1&r)&&(n=1&(b=(p>>>16)-(v>>>16)-n)>>>16),this.__setDigit(e+f,b<<16|65535&y)}return n}},{key:"__inplaceRightShift",value:function(t){if(0!==t){for(var e,r=this.__digit(0)>>>t,n=this.length-1,i=0;i>>t;this.__setDigit(n,r)}}},{key:"__digit",value:function(t){return this[t]}},{key:"__unsignedDigit",value:function(t){return this[t]>>>0}},{key:"__setDigit",value:function(t,e){this[t]=0|e}},{key:"__setDigitGrow",value:function(t,e){this[t]=0|e}},{key:"__halfDigitLength",value:function(){var t=this.length;return 65535>=this.__unsignedDigit(t-1)?2*t-1:2*t}},{key:"__halfDigit",value:function(t){return 65535&this[t>>>1]>>>((1&t)<<4)}},{key:"__setHalfDigit",value:function(t,e){var r=t>>>1,n=this.__digit(r),i=1&t?65535&n|e<<16:4294901760&n|65535&e;this.__setDigit(r,i)}}],[{key:"BigInt",value:function(e){var r=Math.floor,n=Number.isFinite;if("number"==typeof e){if(0===e)return _.__zero();if((0|e)===e)return 0>e?_.__oneDigit(-e,!0):_.__oneDigit(e,!1);if(!n(e)||r(e)!==e)throw new RangeError("The number "+e+" cannot be converted to BigInt because it is not an integer");return _.__fromDouble(e)}if("string"==typeof e){var i=_.__fromString(e);if(null===i)throw new SyntaxError("Cannot convert "+e+" to a BigInt");return i}if("boolean"==typeof e)return!0===e?_.__oneDigit(1,!1):_.__zero();if("object"===t(e)){if(e.constructor===_)return e;var o=_.__toPrimitive(e);return _.BigInt(o)}throw new TypeError("Cannot convert "+e+" to a BigInt")}},{key:"toNumber",value:function(t){var e=t.length;if(0===e)return 0;if(1===e){var r=t.__unsignedDigit(0);return t.sign?-r:r}var n=t.__digit(e-1),i=s(n),o=32*e-i;if(1024>>=12;var h=f-12,g=12<=f?0:u<<20+f,d=20+f;0>>32-h,g=u<>>32-d,d-=32);var p=_.__decideRounding(t,d,l,u);if((1===p||0===p&&1==(1&g))&&0==(g=g+1>>>0)&&0!=++c>>>20&&(c=0,1023<++a))return t.sign?-1/0:1/0;var v=t.sign?-2147483648:0;return a=a+1023<<20,_.__kBitConversionInts[1]=v|a|c,_.__kBitConversionInts[0]=g,_.__kBitConversionDouble[0]}},{key:"unaryMinus",value:function(t){if(0===t.length)return t;var e=t.__copy();return e.sign=!t.sign,e}},{key:"bitwiseNot",value:function(t){return t.sign?_.__absoluteSubOne(t).__trim():_.__absoluteAddOne(t,!0)}},{key:"exponentiate",value:function(t,e){if(e.sign)throw new RangeError("Exponent must be positive");if(0===e.length)return _.__oneDigit(1,!1);if(0===t.length)return t;if(1===t.length&&1===t.__digit(0))return t.sign&&0==(1&e.__digit(0))?_.unaryMinus(t):t;if(1=_.__kMaxLengthBits)throw new RangeError("BigInt too big");if(1===t.length&&2===t.__digit(0)){var n=1+(r>>>5),i=new _(n,t.sign&&0!=(1&r));i.__initializeDigits();var o=1<<(31&r);return i.__setDigit(n-1,o),i}var a=null,u=t;for(0!=(1&r)&&(a=t),r>>=1;0!==r;r>>=1)u=_.multiply(u,u),0!=(1&r)&&(a=null===a?u:_.multiply(a,u));return a}},{key:"multiply",value:function(t,e){if(0===t.length)return t;if(0===e.length)return e;var r=t.length+e.length;32<=t.__clzmsd()+e.__clzmsd()&&r--;var n=new _(r,t.sign!==e.sign);n.__initializeDigits();for(var i=0;i_.__absoluteCompare(t,e))return _.__zero();var r,n=t.sign!==e.sign,i=e.__unsignedDigit(0);if(1===e.length&&65535>=i){if(1===i)return n===t.sign?t:_.unaryMinus(t);r=_.__absoluteDivSmall(t,i,null)}else r=_.__absoluteDivLarge(t,e,!0,!1);return r.sign=n,r.__trim()}},{key:"remainder",value:function(t,e){if(0===e.length)throw new RangeError("Division by zero");if(0>_.__absoluteCompare(t,e))return t;var r=e.__unsignedDigit(0);if(1===e.length&&65535>=r){if(1===r)return _.__zero();var n=_.__absoluteModSmall(t,r);return 0===n?_.__zero():_.__oneDigit(n,t.sign)}var i=_.__absoluteDivLarge(t,e,!1,!0);return i.sign=t.sign,i.__trim()}},{key:"add",value:function(t,e){var r=t.sign;return r===e.sign?_.__absoluteAdd(t,e,r):0<=_.__absoluteCompare(t,e)?_.__absoluteSub(t,e,r):_.__absoluteSub(e,t,!r)}},{key:"subtract",value:function(t,e){var r=t.sign;return r===e.sign?0<=_.__absoluteCompare(t,e)?_.__absoluteSub(t,e,r):_.__absoluteSub(e,t,!r):_.__absoluteAdd(t,e,r)}},{key:"leftShift",value:function(t,e){return 0===e.length||0===t.length?t:e.sign?_.__rightShiftByAbsolute(t,e):_.__leftShiftByAbsolute(t,e)}},{key:"signedRightShift",value:function(t,e){return 0===e.length||0===t.length?t:e.sign?_.__leftShiftByAbsolute(t,e):_.__rightShiftByAbsolute(t,e)}},{key:"unsignedRightShift",value:function(){throw new TypeError("BigInts have no unsigned right shift; use >> instead")}},{key:"lessThan",value:function(t,e){return 0>_.__compareToBigInt(t,e)}},{key:"lessThanOrEqual",value:function(t,e){return 0>=_.__compareToBigInt(t,e)}},{key:"greaterThan",value:function(t,e){return 0<_.__compareToBigInt(t,e)}},{key:"greaterThanOrEqual",value:function(t,e){return 0<=_.__compareToBigInt(t,e)}},{key:"equal",value:function(t,e){if(t.sign!==e.sign)return!1;if(t.length!==e.length)return!1;for(var r=0;r=_.__kMaxLengthBits)return e;var r=t+31>>>5;if(e.length_.__kMaxLengthBits)throw new RangeError("BigInt too big");return _.__truncateAndSubFromPowerOfTwo(t,e,!1)}if(t>=_.__kMaxLengthBits)return e;var r=t+31>>>5;if(e.length>>n)return e}return _.__truncateToNBits(t,e)}},{key:"ADD",value:function(t,e){if(t=_.__toPrimitive(t),e=_.__toPrimitive(e),"string"==typeof t)return"string"!=typeof e&&(e=e.toString()),t+e;if("string"==typeof e)return t.toString()+e;if(t=_.__toNumeric(t),e=_.__toNumeric(e),_.__isBigInt(t)&&_.__isBigInt(e))return _.add(t,e);if("number"==typeof t&&"number"==typeof e)return t+e;throw new TypeError("Cannot mix BigInt and other types, use explicit conversions")}},{key:"LT",value:function(t,e){return _.__compare(t,e,0)}},{key:"LE",value:function(t,e){return _.__compare(t,e,1)}},{key:"GT",value:function(t,e){return _.__compare(t,e,2)}},{key:"GE",value:function(t,e){return _.__compare(t,e,3)}},{key:"EQ",value:function(e,r){for(;;){if(_.__isBigInt(e))return _.__isBigInt(r)?_.equal(e,r):_.EQ(r,e);if("number"==typeof e){if(_.__isBigInt(r))return _.__equalToNumber(r,e);if("object"!==t(r))return e==r;r=_.__toPrimitive(r)}else if("string"==typeof e){if(_.__isBigInt(r))return null!==(e=_.__fromString(e))&&_.equal(e,r);if("object"!==t(r))return e==r;r=_.__toPrimitive(r)}else if("boolean"==typeof e){if(_.__isBigInt(r))return _.__equalToNumber(r,+e);if("object"!==t(r))return e==r;r=_.__toPrimitive(r)}else if("symbol"===t(e)){if(_.__isBigInt(r))return!1;if("object"!==t(r))return e==r;r=_.__toPrimitive(r)}else{if("object"!==t(e))return e==r;if("object"===t(r)&&r.constructor!==_)return e==r;e=_.__toPrimitive(e)}}}},{key:"NE",value:function(t,e){return!_.EQ(t,e)}},{key:"__zero",value:function(){return new _(0,!1)}},{key:"__oneDigit",value:function(t,e){var r=new _(1,e);return r.__setDigit(0,t),r}},{key:"__decideRounding",value:function(t,e,r,n){if(0e)i=-e-1;else{if(0===r)return-1;r--,n=t.__digit(r),i=31}var o=1<>>20)-1023,n=1+(r>>>5),i=new _(n,0>t),o=1048575&_.__kBitConversionInts[1]|1048576,a=_.__kBitConversionInts[0],u=20,s=31&r,l=0;if(s>>f,o=o<<32-f|a>>>f,a<<=32-f}else if(s===u)l=32,e=o,o=a;else{var c=s-u;l=32-c,e=o<>>32-c,o=a<=t&&9<=t)||(159>=t?32==t:131071>=t?160==t||5760==t:196607>=t?10>=(t&=131071)||40==t||41==t||47==t||95==t||4096==t:65279==t)}},{key:"__fromString",value:function(t){var e=11073741824/u)return null;var l=new _(31+(u*a+s>>>_.__kBitsPerCharTableShift)>>>5,!1),f=10>e?e:10,c=10>=_.__kBitsPerCharTableShift;var h=[],g=[],d=!1;do{for(var p,v=0,y=0;;){if(p=void 0,o-48>>>0>>0>>0>>0>>_.__kBitsPerCharTableShift+5;l.__inplaceMultiplyAdd(D,k,P)}while(!b)}if(i!==n){if(!_.__isWhitespace(o))return null;for(i++;i>>s-(o-=32))}if(0!==i){if(n>=t.length)throw new Error("implementation bug");t.__setDigit(n++,i)}for(;n>>1)+(85&n))>>>2)+(51&n))>>>4)+(15&n),o=e-1,a=t.__digit(r-1),u=0|(32*r-s(a)+i-1)/i;if(t.sign&&u++,268435456>>v,h=32-v;h>=i;)l[f--]=_.__kConversionChars[c&o],c>>>=i,h-=i}var y=(c|a<>>i-h;0!==c;)l[f--]=_.__kConversionChars[c&o],c>>>=i;if(t.sign&&(l[f--]="-"),-1!==f)throw new Error("implementation bug");return l.join("")}},{key:"__toStringGeneric",value:function(t,e,r){var n=t.length;if(0===n)return"";if(1===n){var i=t.__unsignedDigit(0).toString(e);return!1===r&&t.sign&&(i="-"+i),i}var o,a,u=32*n-s(t.__digit(n-1)),l=_.__kMaxBitsPerChar[e]-1,f=u*_.__kBitsPerCharTableMultiplier,c=1+(f=0|(f+=l-1)/l)>>1,h=_.exponentiate(_.__oneDigit(e,!1),_.__oneDigit(c,!1)),g=h.__unsignedDigit(0);if(1===h.length&&65535>=g){(o=new _(t.length,!1)).__initializeDigits();for(var d,p=0,v=2*t.length-1;0<=v;v--)d=p<<16|t.__halfDigit(v),o.__setHalfDigit(v,0|d/g),p=0|d%g;a=p.toString(e)}else{var y=_.__absoluteDivLarge(t,h,!0,!0);o=y.quotient;var b=y.remainder.__trim();a=_.__toStringGeneric(b,e,!0)}o.__trim();for(var m=_.__toStringGeneric(o,e,!0);a.lengthn?_.__absoluteLess(r):0}},{key:"__compareToNumber",value:function(t,e){if(!0|e){var r=t.sign,n=0>e;if(r!==n)return _.__unequalSign(r);if(0===t.length){if(n)throw new Error("implementation bug");return 0===e?0:-1}if(1i?_.__absoluteGreater(r):ae)return _.__unequalSign(r);if(0===e)throw new Error("implementation bug: should be handled elsewhere");if(0===t.length)return-1;_.__kBitConversionDouble[0]=e;var n=2047&_.__kBitConversionInts[1]>>>20;if(2047==n)throw new Error("implementation bug: handled elsewhere");var i=n-1023;if(0>i)return _.__absoluteGreater(r);var o=t.length,a=t.__digit(o-1),u=s(a),l=32*o-u,f=i+1;if(lf)return _.__absoluteGreater(r);var c=1048576|1048575&_.__kBitConversionInts[1],h=_.__kBitConversionInts[0],g=20,d=31-u;if(d!==(l-1)%31)throw new Error("implementation bug");var p,v=0;if(d>>y,c=c<<32-y|h>>>y,h<<=32-y}else if(d===g)v=32,p=c,c=h;else{var b=d-g;v=32-b,p=c<>>32-b,c=h<>>=0)>(p>>>=0))return _.__absoluteGreater(r);if(a>>0,c=h,h=0):p=0;var w=t.__unsignedDigit(m);if(w>p)return _.__absoluteGreater(r);if(we&&t.__unsignedDigit(0)===o(e):0===_.__compareToDouble(t,e)}},{key:"__comparisonResultToBool",value:function(t,e){switch(e){case 0:return 0>t;case 1:return 0>=t;case 2:return 0e;case 3:return t>=e}if(_.__isBigInt(t)&&"string"==typeof e)return null!==(e=_.__fromString(e))&&_.__comparisonResultToBool(_.__compareToBigInt(t,e),r);if("string"==typeof t&&_.__isBigInt(e))return null!==(t=_.__fromString(t))&&_.__comparisonResultToBool(_.__compareToBigInt(t,e),r);if(t=_.__toNumeric(t),e=_.__toNumeric(e),_.__isBigInt(t)){if(_.__isBigInt(e))return _.__comparisonResultToBool(_.__compareToBigInt(t,e),r);if("number"!=typeof e)throw new Error("implementation bug");return _.__comparisonResultToBool(_.__compareToNumber(t,e),r)}if("number"!=typeof t)throw new Error("implementation bug");if(_.__isBigInt(e))return _.__comparisonResultToBool(_.__compareToNumber(e,t),2^r);if("number"!=typeof e)throw new Error("implementation bug");return 0===r?te:3===r?t>=e:void 0}},{key:"__absoluteAdd",value:function(t,e,r){if(t.length>>16)+(u>>>16)+(l>>>16);o=f>>>16,i.__setDigit(a,65535&l|f<<16)}for(;a>>16)+(h>>>16);o=g>>>16,i.__setDigit(a,65535&h|g<<16)}return a>>16)-(u>>>16)-(i=1&s>>>16);i=1&l>>>16,n.__setDigit(o,65535&s|l<<16)}for(;o>>16)-(i=1&c>>>16);i=1&h>>>16,n.__setDigit(o,65535&c|h<<16)}return n.__trim()}},{key:"__absoluteAddOne",value:function(t,e){var r=2n?0:t.__unsignedDigit(n)>e.__unsignedDigit(n)?1:-1}},{key:"__multiplyAccumulate",value:function(t,e,r,n){if(0!==e){for(var i=65535&e,o=e>>>16,a=0,s=0,_=0,l=0;l>>16,g=t.__digit(l),d=65535&g,p=g>>>16,v=u(d,i),y=u(d,o),b=u(p,i),m=u(p,o);a=(s=(y>>>16)+(b>>>16)+(65535&m)+(a=(h+=_+a+((c+=s+(65535&v))>>>16)+(v>>>16)+(65535&y)+(65535&b))>>>16))>>>16,s&=65535,_=m>>>16,f=65535&c|h<<16,r.__setDigit(n,f)}for(;0!==a||0!==s||0!==_;n++){var w=r.__digit(n),k=(65535&w)+s,D=(w>>>16)+(k>>>16)+_+a;s=0,_=0,a=D>>>16,w=65535&k|D<<16,r.__setDigit(n,w)}}}},{key:"__internalMultiplyAdd",value:function(t,e,r,n,i){for(var o=r,a=0,s=0;s>>16;var c=u(_>>>16,e),h=(65535&c)+(l>>>16)+o;o=h>>>16,a=c>>>16,i.__setDigit(s,h<<16|65535&f)}if(i.length>n)for(i.__setDigit(n++,o+a);n>>0,a=0|o/e,u=0|(o=((n=0|o%e)<<16|t.__halfDigit(i-1))>>>0)/e;n=0|o%e,r.__setDigit(i>>>1,a<<16|u)}return r}},{key:"__absoluteModSmall",value:function(t,e){for(var r=0,n=2*t.length-1;0<=n;n--)r=0|((r<<16|t.__halfDigit(n))>>>0)%e;return r}},{key:"__absoluteDivLarge",value:function(t,e,r,n){var i=e.__halfDigitLength(),o=e.length,a=t.__halfDigitLength()-i,s=null;r&&(s=new _(a+2>>>1,!1)).__initializeDigits();var l=new _(i+2>>>1,!1);l.__initializeDigits();var f=_.__clz16(e.__halfDigit(i-1));0>>0;p=0|y/h;for(var b=0|y%h,m=e.__halfDigit(i-2),w=c.__halfDigit(d+i-2);u(p,m)>>>0>(b<<16|w)>>>0&&(p--,!(65535<(b+=h))););}_.__internalMultiplyAdd(e,p,0,o,l);var k=c.__inplaceSub(l,d,i+1);0!==k&&(k=c.__inplaceAdd(e,d,i),c.__setHalfDigit(d+i,c.__halfDigit(d+i)+k),p--),r&&(1&d?g=p<<16:s.__setDigit(d>>>1,g|p))}return n?(c.__inplaceRightShift(f),r?{quotient:s,remainder:c}:c):r?s:void 0}},{key:"__clz16",value:function(t){return s(t)-16}},{key:"__specialLeftShift",value:function(t,e,r){var n=t.length,i=new _(n+r,!1);if(0===e){for(var o=0;o>>32-e;return 0r)throw new RangeError("BigInt too big");var n=r>>>5,i=31&r,o=t.length,a=0!==i&&0!=t.__digit(o-1)>>>32-i,u=o+n+(a?1:0),s=new _(u,t.sign);if(0===i){for(var l=0;l>>32-i;if(a)s.__setDigit(o+n,f);else if(0!==f)throw new Error("implementation bug")}return s.__trim()}},{key:"__rightShiftByAbsolute",value:function(t,e){var r=t.length,n=t.sign,i=_.__toShiftAmount(e);if(0>i)return _.__rightShiftByMaximum(n);var o=i>>>5,a=31&i,u=r-o;if(0>=u)return _.__rightShiftByMaximum(n);var s=!1;if(n)if(0!=(t.__digit(o)&(1<>>a,d=r-o-1,p=0;p>>a;f.__setDigit(d,g)}return s&&(f=_.__absoluteAddOne(f,!0,f)),f.__trim()}},{key:"__rightShiftByMaximum",value:function(t){return t?_.__oneDigit(1,!0):_.__zero()}},{key:"__toShiftAmount",value:function(t){if(1_.__kMaxLengthBits?-1:e}},{key:"__toPrimitive",value:function(e){var r=1>>5,n=new _(r,e.sign),i=r-1,o=0;o>>u}return n.__setDigit(i,a),n.__trim()}},{key:"__truncateAndSubFromPowerOfTwo",value:function(t,e,r){for(var n=Math.min,i=t+31>>>5,o=new _(i,r),a=0,u=i-1,s=0,l=n(u,e.length);a>>16)-(s=1&c>>>16);s=1&h>>>16,o.__setDigit(a,65535&c|h<<16)}for(;a>>16)-(s=1&v>>>16)<<16}else{var y=32-p,b=1<<32-y,m=(65535&b)-(65535&(d=d<>>y))-s;g=65535&m|(b>>>16)-(d>>>16)-(s=1&m>>>16)<<16,g&=b-1}return o.__setDigit(u,g),o.__trim()}},{key:"__digitPow",value:function(t,e){for(var r=1;0>>=1,t*=t;return r}}]),_}(l(Array));return v.__kMaxLength=33554432,v.__kMaxLengthBits=v.__kMaxLength<<5,v.__kMaxBitsPerChar=[0,0,32,51,64,75,83,90,96,102,107,111,115,119,122,126,128,131,134,136,139,141,143,145,147,149,151,153,154,156,158,159,160,162,163,165,166],v.__kBitsPerCharTableShift=5,v.__kBitsPerCharTableMultiplier=1<a)throw new Error(u);let s=i.filter((t=>!r.includes(t)));if(i.length-s.length!==o)throw new Error(u);if(s.find((t=>!n.includes(t))))throw new Error(u)}function u(t,e){if(!/^0x([0-9a-fA-F][0-9a-fA-F])*$/.test(e))throw new Error(`${t} must be a hex string!`)}function s(t,e){if(u(t,e),66!=e.length)throw new Error(`${t} must be a hex string of 66 bytes long!`)}function _(t,e){if("0x0"!==e&&!/^0x[1-9a-fA-F][0-9a-fA-F]*$/.test(e))throw new Error(`${t} must be a hex integer!`)}function l(t,{nestedValidation:e=!0,debugPath:r="script"}={}){if(a(r,t,["code_hash","hash_type","args"],[]),s(`${r}.code_hash`,t.code_hash),u(`${r}.args`,t.args),"data"!==t.hash_type&&"type"!==t.hash_type)throw new Error(`${r}.hash_type must be either data or type!`)}function f(t,{nestedValidation:e=!0,debugPath:r="out_point"}={}){a(r,t,["tx_hash","index"],[]),s(`${r}.tx_hash`,t.tx_hash),_(`${r}.index`,t.index)}function c(t,{nestedValidation:e=!0,debugPath:r="cell_input"}={}){a(r,t,["since","previous_output"],[]),_(`${r}.since`,t.since),e&&f(t.previous_output,{debugPath:`${r}.previous_output`})}function h(t,{nestedValidation:e=!0,debugPath:r="cell_output"}={}){a(r,t,["capacity","lock"],["type"]),_(`${r}.capacity`,t.capacity),e&&(l(t.lock,{debugPath:`${r}.lock`}),t.type&&l(t.type,{debugPath:`${r}.type`}))}function g(t,{nestedValidation:e=!0,debugPath:r="cell_dep"}={}){if(a(r,t,["out_point","dep_type"],[]),"code"!==t.dep_type&&"dep_group"!==t.dep_type)throw new Error(`${r}.dep_type must be either code or dep_group!`);e&&f(t.out_point,{debugPath:`${r}.out_point`})}function d(t,e,r,n){if(!Array.isArray(e))throw new Error(`${t} is not an array!`);if(n)for(let n=0;n=r.outputs.length)throw new Error(`Transaction ${t.tx_hash} does not have output ${n}!`);const i={output:r.outputs[n],data:r.outputs_data[n]};return"committed"===e.tx_status.status&&(i.header=e.tx_status.block_hash),i}}var S=i((function(t,e){var r=function(t){function e(){this.fetch=!1,this.DOMException=t.DOMException}return e.prototype=t,new e}("undefined"!=typeof self?self:n);!function(t){!function(e){var r="URLSearchParams"in t,n="Symbol"in t&&"iterator"in Symbol,i="FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),o="FormData"in t,a="ArrayBuffer"in t;if(a)var u=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],s=ArrayBuffer.isView||function(t){return t&&u.indexOf(Object.prototype.toString.call(t))>-1};function _(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function l(t){return"string"!=typeof t&&(t=String(t)),t}function f(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return n&&(e[Symbol.iterator]=function(){return e}),e}function c(t){this.map={},t instanceof c?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function h(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function g(t){return new Promise((function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}}))}function d(t){var e=new FileReader,r=g(e);return e.readAsArrayBuffer(t),r}function p(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function v(){return this.bodyUsed=!1,this._initBody=function(t){var e;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:i&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:o&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:r&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():a&&i&&((e=t)&&DataView.prototype.isPrototypeOf(e))?(this._bodyArrayBuffer=p(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a&&(ArrayBuffer.prototype.isPrototypeOf(t)||s(t))?this._bodyArrayBuffer=p(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var t=h(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?h(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(d)}),this.text=function(){var t,e,r,n=h(this);if(n)return n;if(this._bodyBlob)return t=this._bodyBlob,e=new FileReader,r=g(e),e.readAsText(t),r;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=new Array(e.length),n=0;n-1?n:r),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function m(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var r=t.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(n),decodeURIComponent(i))}})),e}function w(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new c(e.headers),this.url=e.url||"",this._initBody(t)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},v.call(b.prototype),v.call(w.prototype),w.prototype.clone=function(){return new w(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new c(this.headers),url:this.url})},w.error=function(){var t=new w(null,{status:0,statusText:""});return t.type="error",t};var k=[301,302,303,307,308];w.redirect=function(t,e){if(-1===k.indexOf(e))throw new RangeError("Invalid status code");return new w(null,{status:e,headers:{location:t}})},e.DOMException=t.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(t,e){this.message=t,this.name=e;var r=Error(t);this.stack=r.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function D(t,r){return new Promise((function(n,o){var a=new b(t,r);if(a.signal&&a.signal.aborted)return o(new e.DOMException("Aborted","AbortError"));var u=new XMLHttpRequest;function s(){u.abort()}u.onload=function(){var t,e,r={status:u.status,statusText:u.statusText,headers:(t=u.getAllResponseHeaders()||"",e=new c,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var r=t.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();e.append(n,i)}})),e)};r.url="responseURL"in u?u.responseURL:r.headers.get("X-Request-URL");var i="response"in u?u.response:u.responseText;n(new w(i,r))},u.onerror=function(){o(new TypeError("Network request failed"))},u.ontimeout=function(){o(new TypeError("Network request failed"))},u.onabort=function(){o(new e.DOMException("Aborted","AbortError"))},u.open(a.method,a.url,!0),"include"===a.credentials?u.withCredentials=!0:"omit"===a.credentials&&(u.withCredentials=!1),"responseType"in u&&i&&(u.responseType="blob"),a.headers.forEach((function(t,e){u.setRequestHeader(e,t)})),a.signal&&(a.signal.addEventListener("abort",s),u.onreadystatechange=function(){4===u.readyState&&a.signal.removeEventListener("abort",s)}),u.send(void 0===a._bodyInit?null:a._bodyInit)}))}D.polyfill=!0,t.fetch||(t.fetch=D,t.Headers=c,t.Request=b,t.Response=w),e.Headers=c,e.Request=b,e.Response=w,e.fetch=D}({})}(r),delete r.fetch.polyfill,(e=r.fetch).default=r.fetch,e.fetch=r.fetch,e.Headers=r.Headers,e.Request=r.Request,e.Response=r.Response,t.exports=e}));function O(t,e){e=e||{};const r=Object.assign({},e.headers||{},t.headers||{});return Object.assign({},e,t,{headers:r})}const x={get:(t,e,r)=>"send"===e?async()=>{const e=await S(t.uri,O({method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify(t.payload)},t.defaultOptions));return await e.json()}:(...n)=>{const i=t.id;return t.id=t.id+1,t.payload.push({jsonrpc:"2.0",id:i,method:e,params:n}),r}},$={get:(t,e)=>"batch"===e?()=>new Proxy({id:Math.round(1e7*Math.random()),payload:[],uri:t.uri,defaultOptions:t.defaultOptions},x):async(...r)=>{const n=Math.round(1e7*Math.random()),i=await S(t.uri,O({method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:n,method:e,params:r})},t.defaultOptions)),o=await i.json();if(o.id!==n)throw new Error("JSONRPCError: response ID does not match request ID!");if(o.error)throw new Error(`JSONRPCError: server error ${JSON.stringify(o.error)}`);return o.result}};class C{constructor(t,e={}){return this.uri=t,this.defaultOptions=e,new Proxy(this,$)}static create(t){return new C(t)}}function I(t){return o.BigInt(t)}function j(t){return"0x"+t.toString(16)}function R(t){return function(e,r){if(!(r instanceof ArrayBuffer)){let n=j(o.BigInt(r)).substr(2);if(n.length%2!=0&&(n="0"+n),n.length/2>t)throw new Error(`${e} is ${n.length/2} bytes long, expected length is ${t}!`);const i=new DataView(new ArrayBuffer(t));for(let t=0;t0&&n.byteLength!==t)throw new Error(`${e} has invalid length ${n.byteLength}, required: ${t}`);return n}}function M(t,e,r){const n={};for(const[i,o]of Object.entries(r)){const r=e[i];if(!r)throw new Error(`${t} is missing ${i}!`);n[i]=o(`${t}.${i}`,r)}return n}function N(t,{debugPath:e="script"}={}){return M(e,t,{code_hash:z(32),hash_type:function(t,e){switch(e){case"data":return 0;case"type":return 1;case 0:case 1:return e;default:throw new Error(`${t}.hash_type has invalid value: ${e}`)}},args:z(-1)})}function L(t,{debugPath:e="out_point"}={}){return M(e,t,{tx_hash:z(32),index:R(4)})}function U(t){return function(e,r){return t(r,{debugPath:e})}}function q(t,{debugPath:e="cell_input"}={}){return M(e,t,{since:R(8),previous_output:U(L)})}function V(t,{debugPath:e="cell_output"}={}){const r=M(e,t,{capacity:R(8),lock:U(N)});return t.type&&(r.type_=N(t.type,{debugPath:`${e}.type`})),r}function F(t,{debugPath:e="cell_dep"}={}){return M(e,t,{out_point:U(L),dep_type:function(t,e){switch(e){case"code":return 0;case"dep_group":return 1;case 0:case 1:return e;default:throw new Error(`${t}.dep_type has invalid value: ${e}`)}}})}function G(t){return function(e,r){return r.map(((r,n)=>t(`${e}[${n}]`,r)))}}function H(t,{debugPath:e="raw_transaction"}={}){return M(e,t,{version:R(4),cell_deps:G(U(F)),header_deps:G(z(32)),inputs:G(U(q)),outputs:G(U(V)),outputs_data:G(z(-1))})}function W(t,{debugPath:e="transaction"}={}){const r=H(t,{debugPath:`(raw)${e}`}),n=M(e,t,{witnesses:G(z(-1))});return n.raw=r,n}function J(t,{debugPath:e="raw_header"}={}){return M(e,t,{version:R(4),compact_target:R(4),timestamp:R(8),number:R(8),epoch:R(8),parent_hash:z(32),transactions_root:z(32),proposals_hash:z(32),uncles_hash:z(32),dao:z(32)})}function X(t,{debugPath:e="header"}={}){const r=J(t,{debugPath:`(raw)${e}`}),n=M(e,t,{nonce:R(16)});return n.raw=r,n}function Q(t,{debugPath:e="uncle_block"}={}){return M(e,t,{header:U(X),proposals:G(z(10))})}var K=Object.freeze({__proto__:null,NormalizeScript:N,NormalizeOutPoint:L,NormalizeCellInput:q,NormalizeCellOutput:V,NormalizeCellDep:F,NormalizeRawTransaction:H,NormalizeTransaction:W,NormalizeRawHeader:J,NormalizeHeader:X,NormalizeUncleBlock:Q,NormalizeBlock:function(t,{debugPath:e="block"}={}){return M(e,t,{header:U(X),uncles:G(U(Q)),transactions:G(U(W)),proposals:G(z(10))})},NormalizeCellbaseWitness:function(t,{debugPath:e="cellbase_witness"}={}){return M(e,t,{lock:U(N),message:z(-1)})},NormalizeWitnessArgs:function(t,{debugPath:e="witness_args"}={}){const r={};return t.lock&&(r.lock=z(-1)(`${e}.lock`,t.lock)),t.input_type&&(r.input_type=z(-1)(`${e}.input_type`,t.input_type)),t.output_type&&(r.output_type=z(-1)(`${e}.output_type`,t.output_type)),r}});function Y(t,e){return e instanceof Object&&e.serializeJson instanceof Function?e.serializeJson.call(e):e}function Z(t,e,r){if(!((e=Y(0,e))instanceof Object))throw new Error(`Transformed ${t} is not an object!`);const n={};for(const[i,o]of Object.entries(r)){let r=e[i];if(!r){r=e[i.replace(/(_[a-z])/g,(t=>t.toUpperCase().replace("_","")))]}r&&(n[i]=o(`${t}.${i}`,r))}return n}function tt(t,{validation:e=!0,debugPath:r="script"}={}){return t=Z(r,t,{code_hash:Y,hash_type:Y,args:Y}),e&&l(t,{debugPath:`(transformed) ${r}`}),t}function et(t,{validation:e=!0,debugPath:r="out_point"}={}){return t=Z(r,t,{tx_hash:Y,index:Y}),e&&f(t,{debugPath:`(transformed) ${r}`}),t}function rt(t){return function(e,r){return t(r,{validation:!1,debugPath:e})}}function nt(t,{validation:e=!0,debugPath:r="cell_input"}={}){return t=Z(r,t,{since:Y,previous_output:rt(et)}),e&&c(t,{debugPath:`(transformed) ${r}`}),t}function it(t,{validation:e=!0,debugPath:r="cell_output"}={}){return t=Z(r,t,{capacity:Y,lock:rt(tt),type:rt(tt)}),e&&h(t,{debugPath:`(transformed) ${r}`}),t}function ot(t,{validation:e=!0,debugPath:r="cell_dep"}={}){return t=Z(r,t,{out_point:rt(et),dep_type:Y}),e&&g(t,{debugPath:`(transformed) ${r}`}),t}function at(t){return function(e,r){return r.map(((r,n)=>t(`${e}[${n}]`,r)))}}function ut(t,{validation:e=!0,debugPath:r="transaction"}={}){return t=Z(r,t,{version:Y,cell_deps:at(rt(ot)),header_deps:at(Y),inputs:at(rt(nt)),outputs:at(rt(it)),outputs_data:at(Y),witnesses:at(Y)}),e&&b(t,{debugPath:`(transformed) ${r}`}),t}function st(t,{validation:e=!0,debugPath:r="header"}={}){return t=Z(r,t,{version:Y,compact_target:Y,timestamp:Y,number:Y,epoch:Y,parent_hash:Y,transactions_root:Y,proposals_hash:Y,uncles_hash:Y,dao:Y,nonce:Y}),e&&w(t,{debugPath:`(transformed) ${r}`}),t}function _t(t,{validation:e=!0,debugPath:r="uncle_block"}={}){return t=Z(r,t,{header:rt(st),proposals:at(Y)}),e&&D(t,{debugPath:`(transformed) ${r}`}),t}var lt=Object.freeze({__proto__:null,TransformScript:tt,TransformOutPoint:et,TransformCellInput:nt,TransformCellOutput:it,TransformCellDep:ot,TransformRawTransaction:function(t,{validation:e=!0,debugPath:r="raw_transaction"}={}){return t=Z(r,t,{version:Y,cell_deps:at(rt(ot)),header_deps:at(Y),inputs:at(rt(nt)),outputs:at(rt(it)),outputs_data:at(Y)}),e&&y(t,{debugPath:`(transformed) ${r}`}),t},TransformTransaction:ut,TransformRawHeader:function(t,{validation:e=!0,debugPath:r="raw_header"}={}){return t=Z(r,t,{version:Y,compact_target:Y,timestamp:Y,number:Y,epoch:Y,parent_hash:Y,transactions_root:Y,proposals_hash:Y,uncles_hash:Y,dao:Y}),e&&m(t,{debugPath:`(transformed) ${r}`}),t},TransformHeader:st,TransformUncleBlock:_t,TransformBlock:function(t,{validation:e=!0,debugPath:r="block"}={}){return t=Z(r,t,{header:rt(st),uncles:at(rt(_t)),transactions:at(rt(ut)),proposals:at(Y)}),e&&B(t,{debugPath:`(transformed) ${r}`}),t},TransformCellbaseWitness:function(t,{validation:e=!0,debugPath:r="cellbase_witness"}={}){return t=Z(r,t,{lock:rt(tt),message:Y}),e&&P(t,{debugPath:`(transformed) ${r}`}),t},TransformWitnessArgs:function(t,{validation:e=!0,debugPath:r="witness_args"}={}){return t=Z(r,t,{lock:Y,input_type:Y,output_type:Y}),e&&A(t,{debugPath:`(transformed) ${r}`}),t}});var ft=Object.freeze({__proto__:null,RPCCollector:class{constructor(t,e,{skipCellWithContent:n=!0,loadData:i=!1,loadBlockNumber:o=!0}={}){this.rpc=t,this.lockHash=new r(e).serializeJson(),this.skipCellWithContent=n,this.loadData=i,this.loadBlockNumber=o}async*collect(){const t=I(await this.rpc.get_tip_block_number());let e=o.BigInt(0);for(;o.lessThanOrEqual(e,t);){let r=o.add(e,o.BigInt(100));o.greaterThan(r,t)&&(r=t);const n=await this.rpc.get_cells_by_lock_hash(this.lockHash,j(e),j(r));for(const t of n){if(this.skipCellWithContent&&(t.type||o.greaterThan(I(t.output_data_len),o.BigInt(100))))continue;let e=null;if(this.loadData){e=(await this.rpc.get_live_cell(t.out_point,!0)).cell.data.content}let r=null;if(this.loadBlockNumber){r=(await this.rpc.get_header(t.block_hash)).number}yield{cellbase:t.cellbase,cell_output:{capacity:t.capacity,lock:t.lock,type:t.type},out_point:t.out_point,block_hash:t.block_hash,data:e,output_data_len:t.output_data_len,block_number:r}}e=o.add(r,o.BigInt(1))}}}});const ct="0.10.2";export{j as BigIntToHexString,I as HexStringToBigInt,C as RPC,r as Reader,E as TransactionDumper,ct as VERSION,ft as cell_collectors,K as normalizers,lt as transformers,T as validators}; diff --git a/packages/core/lib/ckb-js-toolkit.node.js b/packages/core/lib/ckb-js-toolkit.node.js new file mode 100644 index 000000000..19618e699 --- /dev/null +++ b/packages/core/lib/ckb-js-toolkit.node.js @@ -0,0 +1,2 @@ +"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("stream"),e=require("http"),r=require("url"),n=require("https"),i=require("zlib");function o(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var s=o(t),a=o(e),u=o(r),l=o(n),c=o(i);class _{constructor(t){this.view=new DataView(t)}length(){return this.view.byteLength}indexAt(t){return this.view.getUint8(t)}toArrayBuffer(){return this.view.buffer}serializeJson(){return"0x"+Array.prototype.map.call(new Uint8Array(this.view.buffer),(t=>("00"+t.toString(16)).slice(-2))).join("")}}class f{constructor(t){this.string=t}length(){return this.string.length/2-1}indexAt(t){return parseInt(this.string.substr(2+2*t,2),16)}toArrayBuffer(){const t=new ArrayBuffer(this.length()),e=new DataView(t);for(let t=0;t255)throw new Error("fromRawString can only accept UTF-8 raw string!");r.setUint8(e,n)}return new _(e)}}class g extends Array{constructor(t,e){if(t>g.__kMaxLength)throw new RangeError("Maximum BigInt size exceeded");super(t),this.sign=e}static BigInt(t){var e=Math.floor,r=Number.isFinite;if("number"==typeof t){if(0===t)return g.__zero();if((0|t)===t)return 0>t?g.__oneDigit(-t,!0):g.__oneDigit(t,!1);if(!r(t)||e(t)!==t)throw new RangeError("The number "+t+" cannot be converted to BigInt because it is not an integer");return g.__fromDouble(t)}if("string"==typeof t){const e=g.__fromString(t);if(null===e)throw new SyntaxError("Cannot convert "+t+" to a BigInt");return e}if("boolean"==typeof t)return!0===t?g.__oneDigit(1,!1):g.__zero();if("object"==typeof t){if(t.constructor===g)return t;const e=g.__toPrimitive(t);return g.BigInt(e)}throw new TypeError("Cannot convert "+t+" to a BigInt")}toDebugString(){const t=["BigInt["];for(const e of this)t.push((e?(e>>>0).toString(16):e)+", ");return t.push("]"),t.join("")}toString(t=10){if(2>t||36>>=12;const _=l-12;let f=12<=l?0:a<<20+l,h=20+l;0<_&&0>>32-_,f=a<<_,h=_),0>>32-h,h-=32);const d=g.__decideRounding(t,h,u,a);if((1===d||0===d&&1==(1&f))&&(f=f+1>>>0,0===f&&(c++,0!=c>>>20&&(c=0,s++,1023=g.__kMaxLengthBits)throw new RangeError("BigInt too big");if(1===t.length&&2===t.__digit(0)){const e=1+(r>>>5),n=t.sign&&0!=(1&r),i=new g(e,n);i.__initializeDigits();const o=1<<(31&r);return i.__setDigit(e-1,o),i}let n=null,i=t;for(0!=(1&r)&&(n=t),r>>=1;0!==r;r>>=1)i=g.multiply(i,i),0!=(1&r)&&(n=null===n?i:g.multiply(n,i));return n}static multiply(t,e){if(0===t.length)return t;if(0===e.length)return e;let r=t.length+e.length;32<=t.__clzmsd()+e.__clzmsd()&&r--;const n=new g(r,t.sign!==e.sign);n.__initializeDigits();for(let r=0;rg.__absoluteCompare(t,e))return g.__zero();const r=t.sign!==e.sign,n=e.__unsignedDigit(0);let i;if(1===e.length&&65535>=n){if(1===n)return r===t.sign?t:g.unaryMinus(t);i=g.__absoluteDivSmall(t,n,null)}else i=g.__absoluteDivLarge(t,e,!0,!1);return i.sign=r,i.__trim()}static remainder(t,e){if(0===e.length)throw new RangeError("Division by zero");if(0>g.__absoluteCompare(t,e))return t;const r=e.__unsignedDigit(0);if(1===e.length&&65535>=r){if(1===r)return g.__zero();const e=g.__absoluteModSmall(t,r);return 0===e?g.__zero():g.__oneDigit(e,t.sign)}const n=g.__absoluteDivLarge(t,e,!1,!0);return n.sign=t.sign,n.__trim()}static add(t,e){const r=t.sign;return r===e.sign?g.__absoluteAdd(t,e,r):0<=g.__absoluteCompare(t,e)?g.__absoluteSub(t,e,r):g.__absoluteSub(e,t,!r)}static subtract(t,e){const r=t.sign;return r===e.sign?0<=g.__absoluteCompare(t,e)?g.__absoluteSub(t,e,r):g.__absoluteSub(e,t,!r):g.__absoluteAdd(t,e,r)}static leftShift(t,e){return 0===e.length||0===t.length?t:e.sign?g.__rightShiftByAbsolute(t,e):g.__leftShiftByAbsolute(t,e)}static signedRightShift(t,e){return 0===e.length||0===t.length?t:e.sign?g.__leftShiftByAbsolute(t,e):g.__rightShiftByAbsolute(t,e)}static unsignedRightShift(){throw new TypeError("BigInts have no unsigned right shift; use >> instead")}static lessThan(t,e){return 0>g.__compareToBigInt(t,e)}static lessThanOrEqual(t,e){return 0>=g.__compareToBigInt(t,e)}static greaterThan(t,e){return 0=g.__kMaxLengthBits)return e;const r=t+31>>>5;if(e.lengthg.__kMaxLengthBits)throw new RangeError("BigInt too big");return g.__truncateAndSubFromPowerOfTwo(t,e,!1)}if(t>=g.__kMaxLengthBits)return e;const r=t+31>>>5;if(e.length>>n)return e}return g.__truncateToNBits(t,e)}static ADD(t,e){if(t=g.__toPrimitive(t),e=g.__toPrimitive(e),"string"==typeof t)return"string"!=typeof e&&(e=e.toString()),t+e;if("string"==typeof e)return t.toString()+e;if(t=g.__toNumeric(t),e=g.__toNumeric(e),g.__isBigInt(t)&&g.__isBigInt(e))return g.add(t,e);if("number"==typeof t&&"number"==typeof e)return t+e;throw new TypeError("Cannot mix BigInt and other types, use explicit conversions")}static LT(t,e){return g.__compare(t,e,0)}static LE(t,e){return g.__compare(t,e,1)}static GT(t,e){return g.__compare(t,e,2)}static GE(t,e){return g.__compare(t,e,3)}static EQ(t,e){for(;;){if(g.__isBigInt(t))return g.__isBigInt(e)?g.equal(t,e):g.EQ(e,t);if("number"==typeof t){if(g.__isBigInt(e))return g.__equalToNumber(e,t);if("object"!=typeof e)return t==e;e=g.__toPrimitive(e)}else if("string"==typeof t){if(g.__isBigInt(e))return null!==(t=g.__fromString(t))&&g.equal(t,e);if("object"!=typeof e)return t==e;e=g.__toPrimitive(e)}else if("boolean"==typeof t){if(g.__isBigInt(e))return g.__equalToNumber(e,+t);if("object"!=typeof e)return t==e;e=g.__toPrimitive(e)}else if("symbol"==typeof t){if(g.__isBigInt(e))return!1;if("object"!=typeof e)return t==e;e=g.__toPrimitive(e)}else{if("object"!=typeof t)return t==e;if("object"==typeof e&&e.constructor!==g)return t==e;t=g.__toPrimitive(t)}}}static NE(t,e){return!g.EQ(t,e)}static __zero(){return new g(0,!1)}static __oneDigit(t,e){const r=new g(1,e);return r.__setDigit(0,t),r}__copy(){const t=new g(this.length,this.sign);for(let e=0;ee)i=-e-1;else{if(0===r)return-1;r--,n=t.__digit(r),i=31}let o=1<>>20)-1023,r=1+(e>>>5),n=new g(r,0>t);let i=1048575&g.__kBitConversionInts[1]|1048576,o=g.__kBitConversionInts[0];const s=31&e;let a,u=0;if(s<20){const t=20-s;u=t+32,a=i>>>t,i=i<<32-t|o>>>t,o<<=32-t}else if(20===s)u=32,a=i,i=o;else{const t=s-20;u=32-t,a=i<>>32-t,i=o<=t&&9<=t)||(159>=t?32==t:131071>=t?160==t||5760==t:196607>=t?10>=(t&=131071)||40==t||41==t||47==t||95==t||4096==t:65279==t)}static __fromString(t,e=0){let r=0;const n=t.length;let i=0;if(i===n)return g.__zero();let o=t.charCodeAt(i);for(;g.__isWhitespace(o);){if(++i===n)return g.__zero();o=t.charCodeAt(i)}if(43===o){if(++i===n)return null;o=t.charCodeAt(i),r=1}else if(45===o){if(++i===n)return null;o=t.charCodeAt(i),r=-1}if(0===e){if(e=10,48===o){if(++i===n)return g.__zero();if(o=t.charCodeAt(i),88===o||120===o){if(e=16,++i===n)return null;o=t.charCodeAt(i)}else if(79===o||111===o){if(e=8,++i===n)return null;o=t.charCodeAt(i)}else if(66===o||98===o){if(e=2,++i===n)return null;o=t.charCodeAt(i)}}}else if(16===e&&48===o){if(++i===n)return g.__zero();if(o=t.charCodeAt(i),88===o||120===o){if(++i===n)return null;o=t.charCodeAt(i)}}for(;48===o;){if(++i===n)return g.__zero();o=t.charCodeAt(i)}const s=n-i;let a=g.__kMaxBitsPerChar[e],u=g.__kBitsPerCharTableMultiplier-1;if(s>1073741824/a)return null;const l=a*s+u>>>g.__kBitsPerCharTableShift,c=new g(l+31>>>5,!1),_=10>e?e:10,f=10>=g.__kBitsPerCharTableShift;const e=[],r=[];let s=!1;do{let u=0,l=0;for(;;){let e;if(o-48>>>0<_)e=o-48;else{if(!((32|o)-97>>>0>>0<_)a=o-48;else{if(!((32|o)-97>>>0>>g.__kBitsPerCharTableShift+5;c.__inplaceMultiplyAdd(h,l,d)}while(!r)}if(i!==n){if(!g.__isWhitespace(o))return null;for(i++;i>>u-o)}if(0!==i){if(n>=t.length)throw new Error("implementation bug");t.__setDigit(n++,i)}for(;n>>1)+(85&i),i=(51&i>>>2)+(51&i),i=(15&i>>>4)+(15&i);const o=i,s=e-1,a=t.__digit(n-1);let u=0|(32*n-r(a)+o-1)/o;if(t.sign&&u++,268435456>>i,f=32-i;f>=o;)l[c--]=g.__kConversionChars[_&s],_>>>=o,f-=o}const h=(_|a<>>o-f;0!==_;)l[c--]=g.__kConversionChars[_&s],_>>>=o;if(t.sign&&(l[c--]="-"),-1!=c)throw new Error("implementation bug");return l.join("")}static __toStringGeneric(t,e,r){var n=Math.clz32;const i=t.length;if(0===i)return"";if(1===i){let n=t.__unsignedDigit(0).toString(e);return!1===r&&t.sign&&(n="-"+n),n}const o=32*i-n(t.__digit(i-1)),s=g.__kMaxBitsPerChar[e]-1;let a=o*g.__kBitsPerCharTableMultiplier;a+=s-1,a=0|a/s;const u=a+1>>1,l=g.exponentiate(g.__oneDigit(e,!1),g.__oneDigit(u,!1));let c,_;const f=l.__unsignedDigit(0);if(1===l.length&&65535>=f){c=new g(t.length,!1),c.__initializeDigits();let r=0;for(let e=2*t.length-1;0<=e;e--){const n=r<<16|t.__halfDigit(e);c.__setHalfDigit(e,0|n/f),r=0|n%f}_=r.toString(e)}else{const r=g.__absoluteDivLarge(t,l,!0,!0);c=r.quotient;const n=r.remainder.__trim();_=g.__toStringGeneric(n,e,!0)}c.__trim();let h=g.__toStringGeneric(c,e,!0);for(;_.lengthn?g.__absoluteLess(r):0}static __compareToNumber(t,e){if(!0|e){const r=t.sign,n=0>e;if(r!==n)return g.__unequalSign(r);if(0===t.length){if(n)throw new Error("implementation bug");return 0===e?0:-1}if(1i?g.__absoluteGreater(r):oe)return g.__unequalSign(n);if(0===e)throw new Error("implementation bug: should be handled elsewhere");if(0===t.length)return-1;g.__kBitConversionDouble[0]=e;const i=2047&g.__kBitConversionInts[1]>>>20;if(2047==i)throw new Error("implementation bug: handled elsewhere");const o=i-1023;if(0>o)return g.__absoluteGreater(n);const s=t.length;let a=t.__digit(s-1);const u=r(a),l=32*s-u,c=o+1;if(lc)return g.__absoluteGreater(n);let _=1048576|1048575&g.__kBitConversionInts[1],f=g.__kBitConversionInts[0];const h=31-u;if(h!==(l-1)%31)throw new Error("implementation bug");let d,p=0;if(20>h){const t=20-h;p=t+32,d=_>>>t,_=_<<32-t|f>>>t,f<<=32-t}else if(20===h)p=32,d=_,_=f;else{const t=h-20;p=32-t,d=_<>>32-t,_=f<>>=0,d>>>=0,a>d)return g.__absoluteGreater(n);if(a>>0,_=f,f=0):d=0;const r=t.__unsignedDigit(e);if(r>d)return g.__absoluteGreater(n);if(re&&t.__unsignedDigit(0)===r(e):0===g.__compareToDouble(t,e)}static __comparisonResultToBool(t,e){switch(e){case 0:return 0>t;case 1:return 0>=t;case 2:return 0e;case 3:return t>=e}if(g.__isBigInt(t)&&"string"==typeof e)return null!==(e=g.__fromString(e))&&g.__comparisonResultToBool(g.__compareToBigInt(t,e),r);if("string"==typeof t&&g.__isBigInt(e))return null!==(t=g.__fromString(t))&&g.__comparisonResultToBool(g.__compareToBigInt(t,e),r);if(t=g.__toNumeric(t),e=g.__toNumeric(e),g.__isBigInt(t)){if(g.__isBigInt(e))return g.__comparisonResultToBool(g.__compareToBigInt(t,e),r);if("number"!=typeof e)throw new Error("implementation bug");return g.__comparisonResultToBool(g.__compareToNumber(t,e),r)}if("number"!=typeof t)throw new Error("implementation bug");if(g.__isBigInt(e))return g.__comparisonResultToBool(g.__compareToNumber(e,t),2^r);if("number"!=typeof e)throw new Error("implementation bug");return 0===r?te:3===r?t>=e:void 0}__clzmsd(){return Math.clz32(this[this.length-1])}static __absoluteAdd(t,e,r){if(t.length>>16)+(r>>>16)+(a>>>16);o=u>>>16,i.__setDigit(s,65535&a|u<<16)}for(;s>>16)+(r>>>16);o=n>>>16,i.__setDigit(s,65535&r|n<<16)}return s>>16;const u=(r>>>16)-(s>>>16)-i;i=1&u>>>16,n.__setDigit(o,65535&a|u<<16)}for(;o>>16;const s=(e>>>16)-i;i=1&s>>>16,n.__setDigit(o,65535&r|s<<16)}return n.__trim()}static __absoluteAddOne(t,e,r=null){const n=t.length;null===r?r=new g(n,e):r.sign=e;let i=!0;for(let e,o=0;on?0:t.__unsignedDigit(n)>e.__unsignedDigit(n)?1:-1}static __multiplyAccumulate(t,e,r,n){var i=Math.imul;if(0===e)return;const o=65535&e,s=e>>>16;let a=0,u=0,l=0;for(let e=0;e>>16;const h=t.__digit(e),g=65535&h,d=h>>>16,p=i(g,o),b=i(g,s),m=i(d,o),y=i(d,s);_+=u+(65535&p),f+=l+a+(_>>>16)+(p>>>16)+(65535&b)+(65535&m),a=f>>>16,u=(b>>>16)+(m>>>16)+(65535&y)+a,a=u>>>16,u&=65535,l=y>>>16,c=65535&_|f<<16,r.__setDigit(n,c)}for(;0!=a||0!==u||0!==l;n++){let t=r.__digit(n);const e=(65535&t)+u,i=(t>>>16)+(e>>>16)+l+a;u=0,l=0,a=i>>>16,t=65535&e|i<<16,r.__setDigit(n,t)}}static __internalMultiplyAdd(t,e,r,n,i){var o=Math.imul;let s=r,a=0;for(let r=0;r>>16;const c=o(n>>>16,e),_=(65535&c)+(u>>>16)+s;s=_>>>16,a=c>>>16,i.__setDigit(r,_<<16|65535&l)}if(i.length>n)for(i.__setDigit(n++,s+a);nthis.length&&(r=this.length);const i=65535&t,o=t>>>16;let s=0,a=65535&e,u=e>>>16;for(let t=0;t>>16,c=n(r,i),_=n(r,o),f=n(l,i),h=n(l,o),g=a+(65535&c),d=u+s+(g>>>16)+(c>>>16)+(65535&_)+(65535&f);a=(_>>>16)+(f>>>16)+(65535&h)+(d>>>16),s=a>>>16,a&=65535,u=h>>>16,this.__setDigit(t,65535&g|d<<16)}if(0!=s||0!==a||0!==u)throw new Error("implementation bug")}static __absoluteDivSmall(t,e,r){null===r&&(r=new g(t.length,!1));let n=0;for(let i,o=2*t.length-1;0<=o;o-=2){i=(n<<16|t.__halfDigit(o))>>>0;const s=0|i/e;n=0|i%e,i=(n<<16|t.__halfDigit(o-1))>>>0;const a=0|i/e;n=0|i%e,r.__setDigit(o>>>1,s<<16|a)}return r}static __absoluteModSmall(t,e){let r=0;for(let n=2*t.length-1;0<=n;n--){r=0|((r<<16|t.__halfDigit(n))>>>0)%e}return r}static __absoluteDivLarge(t,e,r,n){var i=Math.imul;const o=e.__halfDigitLength(),s=e.length,a=t.__halfDigitLength()-o;let u=null;r&&(u=new g(a+2>>>1,!1),u.__initializeDigits());const l=new g(o+2>>>1,!1);l.__initializeDigits();const c=g.__clz16(e.__halfDigit(o-1));0>>0;t=0|r/f;let s=0|r%f;const u=e.__halfDigit(o-2),l=_.__halfDigit(n+o-2);for(;i(t,u)>>>0>(s<<16|l)>>>0&&(t--,s+=f,!(65535>>1,h|t))}return n?(_.__inplaceRightShift(c),r?{quotient:u,remainder:_}:_):r?u:void 0}static __clz16(t){return Math.clz32(t)-16}__inplaceAdd(t,e,r){let n=0;for(let i=0;i>>16,this.__setHalfDigit(e+i,r)}return n}__inplaceSub(t,e,r){let n=0;if(1&e){e>>=1;let i=this.__digit(e),o=65535&i,s=0;for(;s>>1;s++){const r=t.__digit(s),a=(i>>>16)-(65535&r)-n;n=1&a>>>16,this.__setDigit(e+s,a<<16|65535&o),i=this.__digit(e+s+1),o=(65535&i)-(r>>>16)-n,n=1&o>>>16}const a=t.__digit(s),u=(i>>>16)-(65535&a)-n;if(n=1&u>>>16,this.__setDigit(e+s,u<<16|65535&o),e+s+1>=this.length)throw new RangeError("out of bounds");0==(1&r)&&(i=this.__digit(e+s+1),o=(65535&i)-(a>>>16)-n,n=1&o>>>16,this.__setDigit(e+t.length,4294901760&i|65535&o))}else{e>>=1;let i=0;for(;i>>16;const a=(r>>>16)-(o>>>16)-n;n=1&a>>>16,this.__setDigit(e+i,a<<16|65535&s)}const o=this.__digit(e+i),s=t.__digit(i),a=(65535&o)-(65535&s)-n;n=1&a>>>16;let u=0;0==(1&r)&&(u=(o>>>16)-(s>>>16)-n,n=1&u>>>16),this.__setDigit(e+i,u<<16|65535&a)}return n}__inplaceRightShift(t){if(0===t)return;let e=this.__digit(0)>>>t;const r=this.length-1;for(let n=0;n>>t}this.__setDigit(r,e)}static __specialLeftShift(t,e,r){const n=t.length,i=new g(n+r,!1);if(0===e){for(let e=0;e>>32-e}return 0r)throw new RangeError("BigInt too big");const n=r>>>5,i=31&r,o=t.length,s=0!==i&&0!=t.__digit(o-1)>>>32-i,a=o+n+(s?1:0),u=new g(a,t.sign);if(0===i){let e=0;for(;e>>32-i}if(s)u.__setDigit(o+n,e);else if(0!==e)throw new Error("implementation bug")}return u.__trim()}static __rightShiftByAbsolute(t,e){const r=t.length,n=t.sign,i=g.__toShiftAmount(e);if(0>i)return g.__rightShiftByMaximum(n);const o=i>>>5,s=31&i;let a=r-o;if(0>=a)return g.__rightShiftByMaximum(n);let u=!1;if(n)if(0!=(t.__digit(o)&(1<>>s;const n=r-o-1;for(let r=0;r>>s}l.__setDigit(n,e)}return u&&(l=g.__absoluteAddOne(l,!0,l)),l.__trim()}static __rightShiftByMaximum(t){return t?g.__oneDigit(1,!0):g.__zero()}static __toShiftAmount(t){if(1g.__kMaxLengthBits?-1:e}static __toPrimitive(t,e="default"){if("object"!=typeof t)return t;if(t.constructor===g)return t;const r=t[Symbol.toPrimitive];if(r){const t=r(e);if("object"!=typeof t)return t;throw new TypeError("Cannot convert object to primitive value")}const n=t.valueOf;if(n){const e=n.call(t);if("object"!=typeof e)return e}const i=t.toString;if(i){const e=i.call(t);if("object"!=typeof e)return e}throw new TypeError("Cannot convert object to primitive value")}static __toNumeric(t){return g.__isBigInt(t)?t:+t}static __isBigInt(t){return"object"==typeof t&&t.constructor===g}static __truncateToNBits(t,e){const r=t+31>>>5,n=new g(r,e.sign),i=r-1;for(let t=0;t>>e}return n.__setDigit(i,o),n.__trim()}static __truncateAndSubFromPowerOfTwo(t,e,r){var n=Math.min;const i=t+31>>>5,o=new g(i,r);let s=0;const a=i-1;let u=0;for(const t=n(a,e.length);s>>16;const n=0-(t>>>16)-u;u=1&n>>>16,o.__setDigit(s,65535&r|n<<16)}for(;s>>16;_=65535&t|0-(l>>>16)-u<<16}else{const t=32-c;l=l<>>t;const e=1<<32-t,r=(65535&e)-(65535&l)-u;u=1&r>>>16;_=65535&r|(e>>>16)-(l>>>16)-u<<16,_&=e-1}return o.__setDigit(a,_),o.__trim()}__digit(t){return this[t]}__unsignedDigit(t){return this[t]>>>0}__setDigit(t,e){this[t]=0|e}__setDigitGrow(t,e){this[t]=0|e}__halfDigitLength(){const t=this.length;return 65535>=this.__unsignedDigit(t-1)?2*t-1:2*t}__halfDigit(t){return 65535&this[t>>>1]>>>((1&t)<<4)}__setHalfDigit(t,e){const r=t>>>1,n=this.__digit(r),i=1&t?65535&n|e<<16:4294901760&n|65535&e;this.__setDigit(r,i)}static __digitPow(t,e){let r=1;for(;0>>=1,t*=t;return r}}function d(t,e,r,n=[]){!function(t,e){if(!(e instanceof Object))throw new Error(`${t} is not an object!`)}(t,e);const i=Object.keys(e).sort(),o=r.length,s=r.length+n.length,a=`${t} does not have correct keys! Required keys: [${r.sort().join(", ")}], optional keys: [${n.sort().join(", ")}], actual keys: [${i.join(", ")}]`;if(i.lengths)throw new Error(a);let u=i.filter((t=>!r.includes(t)));if(i.length-u.length!==o)throw new Error(a);if(u.find((t=>!n.includes(t))))throw new Error(a)}function p(t,e){if(!/^0x([0-9a-fA-F][0-9a-fA-F])*$/.test(e))throw new Error(`${t} must be a hex string!`)}function b(t,e){if(p(t,e),66!=e.length)throw new Error(`${t} must be a hex string of 66 bytes long!`)}function m(t,e){if("0x0"!==e&&!/^0x[1-9a-fA-F][0-9a-fA-F]*$/.test(e))throw new Error(`${t} must be a hex integer!`)}function y(t,{nestedValidation:e=!0,debugPath:r="script"}={}){if(d(r,t,["code_hash","hash_type","args"],[]),b(`${r}.code_hash`,t.code_hash),p(`${r}.args`,t.args),"data"!==t.hash_type&&"type"!==t.hash_type)throw new Error(`${r}.hash_type must be either data or type!`)}function w(t,{nestedValidation:e=!0,debugPath:r="out_point"}={}){d(r,t,["tx_hash","index"],[]),b(`${r}.tx_hash`,t.tx_hash),m(`${r}.index`,t.index)}function v(t,{nestedValidation:e=!0,debugPath:r="cell_input"}={}){d(r,t,["since","previous_output"],[]),m(`${r}.since`,t.since),e&&w(t.previous_output,{debugPath:`${r}.previous_output`})}function B(t,{nestedValidation:e=!0,debugPath:r="cell_output"}={}){d(r,t,["capacity","lock"],["type"]),m(`${r}.capacity`,t.capacity),e&&(y(t.lock,{debugPath:`${r}.lock`}),t.type&&y(t.type,{debugPath:`${r}.type`}))}function P(t,{nestedValidation:e=!0,debugPath:r="cell_dep"}={}){if(d(r,t,["out_point","dep_type"],[]),"code"!==t.dep_type&&"dep_group"!==t.dep_type)throw new Error(`${r}.dep_type must be either code or dep_group!`);e&&w(t.out_point,{debugPath:`${r}.out_point`})}function D(t,e,r,n){if(!Array.isArray(e))throw new Error(`${t} is not an array!`);if(n)for(let n=0;n1&&void 0!==arguments[1]?arguments[1]:{},n=r.size;let i=void 0===n?0:n;var o=r.timeout;let a=void 0===o?0:o;null==t?t=null:J(t)?t=Buffer.from(t.toString()):X(t)||Buffer.isBuffer(t)||("[object ArrayBuffer]"===Object.prototype.toString.call(t)?t=Buffer.from(t):ArrayBuffer.isView(t)?t=Buffer.from(t.buffer,t.byteOffset,t.byteLength):t instanceof s.default||(t=Buffer.from(String(t)))),this[H]={body:t,disturbed:!1,error:null},this.size=i,this.timeout=a,t instanceof s.default&&t.on("error",(function(t){const r="AbortError"===t.name?t:new U(`Invalid response body while trying to fetch ${e.url}: ${t.message}`,"system",t);e[H].error=r}))}function W(){var t=this;if(this[H].disturbed)return G.Promise.reject(new TypeError(`body used already for: ${this.url}`));if(this[H].disturbed=!0,this[H].error)return G.Promise.reject(this[H].error);let e=this.body;if(null===e)return G.Promise.resolve(Buffer.alloc(0));if(X(e)&&(e=e.stream()),Buffer.isBuffer(e))return G.Promise.resolve(e);if(!(e instanceof s.default))return G.Promise.resolve(Buffer.alloc(0));let r=[],n=0,i=!1;return new G.Promise((function(o,s){let a;t.timeout&&(a=setTimeout((function(){i=!0,s(new U(`Response timeout while trying to fetch ${t.url} (over ${t.timeout}ms)`,"body-timeout"))}),t.timeout)),e.on("error",(function(e){"AbortError"===e.name?(i=!0,s(e)):s(new U(`Invalid response body while trying to fetch ${t.url}: ${e.message}`,"system",e))})),e.on("data",(function(e){if(!i&&null!==e){if(t.size&&n+e.length>t.size)return i=!0,void s(new U(`content size at ${t.url} over limit: ${t.size}`,"max-size"));n+=e.length,r.push(e)}})),e.on("end",(function(){if(!i){clearTimeout(a);try{o(Buffer.concat(r,n))}catch(e){s(new U(`Could not create Buffer from response body for ${t.url}: ${e.message}`,"system",e))}}}))}))}function J(t){return"object"==typeof t&&"function"==typeof t.append&&"function"==typeof t.delete&&"function"==typeof t.get&&"function"==typeof t.getAll&&"function"==typeof t.has&&"function"==typeof t.set&&("URLSearchParams"===t.constructor.name||"[object URLSearchParams]"===Object.prototype.toString.call(t)||"function"==typeof t.sort)}function X(t){return"object"==typeof t&&"function"==typeof t.arrayBuffer&&"string"==typeof t.type&&"function"==typeof t.stream&&"function"==typeof t.constructor&&"string"==typeof t.constructor.name&&/^(Blob|File)$/.test(t.constructor.name)&&/^(Blob|File)$/.test(t[Symbol.toStringTag])}function Q(t){let e,r,n=t.body;if(t.bodyUsed)throw new Error("cannot clone body after it is used");return n instanceof s.default&&"function"!=typeof n.getBoundary&&(e=new F,r=new F,n.pipe(e),n.pipe(r),t[H].body=e,n=r),n}function Z(t){return null===t?null:"string"==typeof t?"text/plain;charset=UTF-8":J(t)?"application/x-www-form-urlencoded;charset=UTF-8":X(t)?t.type||null:Buffer.isBuffer(t)||"[object ArrayBuffer]"===Object.prototype.toString.call(t)||ArrayBuffer.isView(t)?null:"function"==typeof t.getBoundary?`multipart/form-data;boundary=${t.getBoundary()}`:t instanceof s.default?null:"text/plain;charset=UTF-8"}function K(t){const e=t.body;return null===e?0:X(e)?e.size:Buffer.isBuffer(e)?e.length:e&&"function"==typeof e.getLengthSync&&(e._lengthRetrievers&&0==e._lengthRetrievers.length||e.hasKnownLength&&e.hasKnownLength())?e.getLengthSync():null}G.prototype={get body(){return this[H].body},get bodyUsed(){return this[H].disturbed},arrayBuffer(){return W.call(this).then((function(t){return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}))},blob(){let t=this.headers&&this.headers.get("content-type")||"";return W.call(this).then((function(e){return Object.assign(new q([],{type:t.toLowerCase()}),{[L]:e})}))},json(){var t=this;return W.call(this).then((function(e){try{return JSON.parse(e.toString())}catch(e){return G.Promise.reject(new U(`invalid json response body at ${t.url} reason: ${e.message}`,"invalid-json"))}}))},text(){return W.call(this).then((function(t){return t.toString()}))},buffer(){return W.call(this)},textConverted(){var t=this;return W.call(this).then((function(e){return function(t,e){if("function"!=typeof V)throw new Error("The package `encoding` must be installed to use the textConverted() function");const r=e.get("content-type");let n,i,o="utf-8";r&&(n=/charset=([^;]*)/i.exec(r));i=t.slice(0,1024).toString(),!n&&i&&(n=/0&&void 0!==arguments[0]?arguments[0]:void 0;if(this[it]=Object.create(null),t instanceof ot){const e=t.raw(),r=Object.keys(e);for(const t of r)for(const r of e[t])this.append(t,r)}else if(null==t);else{if("object"!=typeof t)throw new TypeError("Provided initializer must be an object");{const e=t[Symbol.iterator];if(null!=e){if("function"!=typeof e)throw new TypeError("Header pairs must be iterable");const r=[];for(const e of t){if("object"!=typeof e||"function"!=typeof e[Symbol.iterator])throw new TypeError("Each header pair must be iterable");r.push(Array.from(e))}for(const t of r){if(2!==t.length)throw new TypeError("Each header pair must be a name/value tuple");this.append(t[0],t[1])}}else for(const e of Object.keys(t)){const r=t[e];this.append(e,r)}}}}get(t){et(t=`${t}`);const e=nt(this[it],t);return void 0===e?null:this[it][e].join(", ")}forEach(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,r=st(this),n=0;for(;n1&&void 0!==arguments[1]?arguments[1]:"key+value";const r=Object.keys(t[it]).sort();return r.map("key"===e?function(t){return t.toLowerCase()}:"value"===e?function(e){return t[it][e].join(", ")}:function(e){return[e.toLowerCase(),t[it][e].join(", ")]})}ot.prototype.entries=ot.prototype[Symbol.iterator],Object.defineProperty(ot.prototype,Symbol.toStringTag,{value:"Headers",writable:!1,enumerable:!1,configurable:!0}),Object.defineProperties(ot.prototype,{get:{enumerable:!0},forEach:{enumerable:!0},set:{enumerable:!0},append:{enumerable:!0},has:{enumerable:!0},delete:{enumerable:!0},keys:{enumerable:!0},values:{enumerable:!0},entries:{enumerable:!0}});const at=Symbol("internal");function ut(t,e){const r=Object.create(lt);return r[at]={target:t,kind:e,index:0},r}const lt=Object.setPrototypeOf({next(){if(!this||Object.getPrototypeOf(this)!==lt)throw new TypeError("Value of `this` is not a HeadersIterator");var t=this[at];const e=t.target,r=t.kind,n=t.index,i=st(e,r);return n>=i.length?{value:void 0,done:!0}:(this[at].index=n+1,{value:i[n],done:!1})}},Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));function ct(t){const e=Object.assign({__proto__:null},t[it]),r=nt(t[it],"Host");return void 0!==r&&(e[r]=e[r][0]),e}Object.defineProperty(lt,Symbol.toStringTag,{value:"HeadersIterator",writable:!1,enumerable:!1,configurable:!0});const _t=Symbol("Response internals"),ft=a.default.STATUS_CODES;class ht{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};G.call(this,t,e);const r=e.status||200,n=new ot(e.headers);if(null!=t&&!n.has("Content-Type")){const e=Z(t);e&&n.append("Content-Type",e)}this[_t]={url:e.url,status:r,statusText:e.statusText||ft[r],headers:n,counter:e.counter}}get url(){return this[_t].url||""}get status(){return this[_t].status}get ok(){return this[_t].status>=200&&this[_t].status<300}get redirected(){return this[_t].counter>0}get statusText(){return this[_t].statusText}get headers(){return this[_t].headers}clone(){return new ht(Q(this),{url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected})}}G.mixIn(ht.prototype),Object.defineProperties(ht.prototype,{url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}}),Object.defineProperty(ht.prototype,Symbol.toStringTag,{value:"Response",writable:!1,enumerable:!1,configurable:!0});const gt=Symbol("Request internals"),dt=u.default.parse,pt=u.default.format,bt="destroy"in s.default.Readable.prototype;function mt(t){return"object"==typeof t&&"object"==typeof t[gt]}class yt{constructor(t){let e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};mt(t)?e=dt(t.url):(e=t&&t.href?dt(t.href):dt(`${t}`),t={});let n=r.method||t.method||"GET";if(n=n.toUpperCase(),(null!=r.body||mt(t)&&null!==t.body)&&("GET"===n||"HEAD"===n))throw new TypeError("Request with GET/HEAD method cannot have body");let i=null!=r.body?r.body:mt(t)&&null!==t.body?Q(t):null;G.call(this,i,{timeout:r.timeout||t.timeout||0,size:r.size||t.size||0});const o=new ot(r.headers||t.headers||{});if(null!=i&&!o.has("Content-Type")){const t=Z(i);t&&o.append("Content-Type",t)}let s=mt(t)?t.signal:null;if("signal"in r&&(s=r.signal),null!=s&&!function(t){const e=t&&"object"==typeof t&&Object.getPrototypeOf(t);return!(!e||"AbortSignal"!==e.constructor.name)}(s))throw new TypeError("Expected signal to be an instanceof AbortSignal");this[gt]={method:n,redirect:r.redirect||t.redirect||"follow",headers:o,parsedURL:e,signal:s},this.follow=void 0!==r.follow?r.follow:void 0!==t.follow?t.follow:20,this.compress=void 0!==r.compress?r.compress:void 0===t.compress||t.compress,this.counter=r.counter||t.counter||0,this.agent=r.agent||t.agent}get method(){return this[gt].method}get url(){return pt(this[gt].parsedURL)}get headers(){return this[gt].headers}get redirect(){return this[gt].redirect}get signal(){return this[gt].signal}clone(){return new yt(this)}}function wt(t){Error.call(this,t),this.type="aborted",this.message=t,Error.captureStackTrace(this,this.constructor)}G.mixIn(yt.prototype),Object.defineProperty(yt.prototype,Symbol.toStringTag,{value:"Request",writable:!1,enumerable:!1,configurable:!0}),Object.defineProperties(yt.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0}}),wt.prototype=Object.create(Error.prototype),wt.prototype.constructor=wt,wt.prototype.name="AbortError";const vt=s.default.PassThrough,Bt=u.default.resolve;function Pt(t,e){if(!Pt.Promise)throw new Error("native promise missing, set fetch.Promise to your favorite alternative");return G.Promise=Pt.Promise,new Pt.Promise((function(r,n){const i=new yt(t,e),o=function(t){const e=t[gt].parsedURL,r=new ot(t[gt].headers);if(r.has("Accept")||r.set("Accept","*/*"),!e.protocol||!e.hostname)throw new TypeError("Only absolute URLs are supported");if(!/^https?:$/.test(e.protocol))throw new TypeError("Only HTTP(S) protocols are supported");if(t.signal&&t.body instanceof s.default.Readable&&!bt)throw new Error("Cancellation of streamed requests with AbortSignal is not supported in node < 8");let n=null;if(null==t.body&&/^(POST|PUT)$/i.test(t.method)&&(n="0"),null!=t.body){const e=K(t);"number"==typeof e&&(n=String(e))}n&&r.set("Content-Length",n),r.has("User-Agent")||r.set("User-Agent","node-fetch/1.0 (+https://github.com/bitinn/node-fetch)"),t.compress&&!r.has("Accept-Encoding")&&r.set("Accept-Encoding","gzip,deflate");let i=t.agent;return"function"==typeof i&&(i=i(e)),r.has("Connection")||i||r.set("Connection","close"),Object.assign({},e,{method:t.method,headers:ct(r),agent:i})}(i),u=("https:"===o.protocol?l.default:a.default).request,_=i.signal;let f=null;const h=function(){let t=new wt("The user aborted a request.");n(t),i.body&&i.body instanceof s.default.Readable&&i.body.destroy(t),f&&f.body&&f.body.emit("error",t)};if(_&&_.aborted)return void h();const g=function(){h(),b()},d=u(o);let p;function b(){d.abort(),_&&_.removeEventListener("abort",g),clearTimeout(p)}_&&_.addEventListener("abort",g),i.timeout&&d.once("socket",(function(t){p=setTimeout((function(){n(new U(`network timeout at: ${i.url}`,"request-timeout")),b()}),i.timeout)})),d.on("error",(function(t){n(new U(`request to ${i.url} failed, reason: ${t.message}`,"system",t)),b()})),d.on("response",(function(t){clearTimeout(p);const e=function(t){const e=new ot;for(const r of Object.keys(t))if(!Y.test(r))if(Array.isArray(t[r]))for(const n of t[r])tt.test(n)||(void 0===e[it][r]?e[it][r]=[n]:e[it][r].push(n));else tt.test(t[r])||(e[it][r]=[t[r]]);return e}(t.headers);if(Pt.isRedirect(t.statusCode)){const o=e.get("Location"),s=null===o?null:Bt(i.url,o);switch(i.redirect){case"error":return n(new U(`uri requested responds with a redirect, redirect mode is set to error: ${i.url}`,"no-redirect")),void b();case"manual":if(null!==s)try{e.set("Location",s)}catch(t){n(t)}break;case"follow":if(null===s)break;if(i.counter>=i.follow)return n(new U(`maximum redirect reached at: ${i.url}`,"max-redirect")),void b();const o={headers:new ot(i.headers),follow:i.follow,counter:i.counter+1,agent:i.agent,compress:i.compress,method:i.method,body:i.body,signal:i.signal,timeout:i.timeout,size:i.size};return 303!==t.statusCode&&i.body&&null===K(i)?(n(new U("Cannot follow redirect with body being a readable stream","unsupported-redirect")),void b()):(303!==t.statusCode&&(301!==t.statusCode&&302!==t.statusCode||"POST"!==i.method)||(o.method="GET",o.body=void 0,o.headers.delete("content-length")),r(Pt(new yt(s,o))),void b())}}t.once("end",(function(){_&&_.removeEventListener("abort",g)}));let o=t.pipe(new vt);const s={url:i.url,status:t.statusCode,statusText:t.statusMessage,headers:e,size:i.size,timeout:i.timeout,counter:i.counter},a=e.get("Content-Encoding");if(!i.compress||"HEAD"===i.method||null===a||204===t.statusCode||304===t.statusCode)return f=new ht(o,s),void r(f);const u={flush:c.default.Z_SYNC_FLUSH,finishFlush:c.default.Z_SYNC_FLUSH};if("gzip"==a||"x-gzip"==a)return o=o.pipe(c.default.createGunzip(u)),f=new ht(o,s),void r(f);if("deflate"!=a&&"x-deflate"!=a){if("br"==a&&"function"==typeof c.default.createBrotliDecompress)return o=o.pipe(c.default.createBrotliDecompress()),f=new ht(o,s),void r(f);f=new ht(o,s),r(f)}else{t.pipe(new vt).once("data",(function(t){o=8==(15&t[0])?o.pipe(c.default.createInflate()):o.pipe(c.default.createInflateRaw()),f=new ht(o,s),r(f)}))}})),function(t,e){const r=e.body;null===r?t.end():X(r)?r.stream().pipe(t):Buffer.isBuffer(r)?(t.write(r),t.end()):r.pipe(t)}(d,i)}))}Pt.isRedirect=function(t){return 301===t||302===t||303===t||307===t||308===t},Pt.Promise=global.Promise;var Dt,St,Tt,$t=R(Object.freeze({__proto__:null,default:Pt,Headers:ot,Request:yt,Response:ht,FetchError:U})),kt=(Dt=function(t,e){var r=$t.default||$t,n=function(t,e){return/^\/\//.test(t)&&(t="https:"+t),r.call(this,t,e)};t.exports=e=n,e.fetch=n,e.Headers=$t.Headers,e.Request=$t.Request,e.Response=$t.Response,e.default=n},Dt(Tt={path:St,exports:{},require:function(t,e){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==e&&Tt.path)}},Tt.exports),Tt.exports);function xt(t,e){e=e||{};const r=Object.assign({},e.headers||{},t.headers||{});return Object.assign({},e,t,{headers:r})}const Ot={get:(t,e,r)=>"send"===e?async()=>{const e=await kt(t.uri,xt({method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify(t.payload)},t.defaultOptions));return await e.json()}:(...n)=>{const i=t.id;return t.id=t.id+1,t.payload.push({jsonrpc:"2.0",id:i,method:e,params:n}),r}},Et={get:(t,e)=>"batch"===e?()=>new Proxy({id:Math.round(1e7*Math.random()),payload:[],uri:t.uri,defaultOptions:t.defaultOptions},Ot):async(...r)=>{const n=Math.round(1e7*Math.random()),i=await kt(t.uri,xt({method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:n,method:e,params:r})},t.defaultOptions)),o=await i.json();if(o.id!==n)throw new Error("JSONRPCError: response ID does not match request ID!");if(o.error)throw new Error(`JSONRPCError: server error ${JSON.stringify(o.error)}`);return o.result}};class Ct{constructor(t,e={}){return this.uri=t,this.defaultOptions=e,new Proxy(this,Et)}static create(t){return new Ct(t)}}function At(t){return g.BigInt(t)}function jt(t){return"0x"+t.toString(16)}function zt(t){return function(e,r){if(!(r instanceof ArrayBuffer)){let n=jt(g.BigInt(r)).substr(2);if(n.length%2!=0&&(n="0"+n),n.length/2>t)throw new Error(`${e} is ${n.length/2} bytes long, expected length is ${t}!`);const i=new DataView(new ArrayBuffer(t));for(let t=0;t0&&r.byteLength!==t)throw new Error(`${e} has invalid length ${r.byteLength}, required: ${t}`);return r}}function Rt(t,e,r){const n={};for(const[i,o]of Object.entries(r)){const r=e[i];if(!r)throw new Error(`${t} is missing ${i}!`);n[i]=o(`${t}.${i}`,r)}return n}function Mt(t,{debugPath:e="script"}={}){return Rt(e,t,{code_hash:It(32),hash_type:function(t,e){switch(e){case"data":return 0;case"type":return 1;case 0:case 1:return e;default:throw new Error(`${t}.hash_type has invalid value: ${e}`)}},args:It(-1)})}function Lt(t,{debugPath:e="out_point"}={}){return Rt(e,t,{tx_hash:It(32),index:zt(4)})}function Nt(t){return function(e,r){return t(r,{debugPath:e})}}function qt(t,{debugPath:e="cell_input"}={}){return Rt(e,t,{since:zt(8),previous_output:Nt(Lt)})}function Ut(t,{debugPath:e="cell_output"}={}){const r=Rt(e,t,{capacity:zt(8),lock:Nt(Mt)});return t.type&&(r.type_=Mt(t.type,{debugPath:`${e}.type`})),r}function Vt(t,{debugPath:e="cell_dep"}={}){return Rt(e,t,{out_point:Nt(Lt),dep_type:function(t,e){switch(e){case"code":return 0;case"dep_group":return 1;case 0:case 1:return e;default:throw new Error(`${t}.dep_type has invalid value: ${e}`)}}})}function Ht(t){return function(e,r){return r.map(((r,n)=>t(`${e}[${n}]`,r)))}}function Ft(t,{debugPath:e="raw_transaction"}={}){return Rt(e,t,{version:zt(4),cell_deps:Ht(Nt(Vt)),header_deps:Ht(It(32)),inputs:Ht(Nt(qt)),outputs:Ht(Nt(Ut)),outputs_data:Ht(It(-1))})}function Gt(t,{debugPath:e="transaction"}={}){const r=Ft(t,{debugPath:`(raw)${e}`}),n=Rt(e,t,{witnesses:Ht(It(-1))});return n.raw=r,n}function Wt(t,{debugPath:e="raw_header"}={}){return Rt(e,t,{version:zt(4),compact_target:zt(4),timestamp:zt(8),number:zt(8),epoch:zt(8),parent_hash:It(32),transactions_root:It(32),proposals_hash:It(32),uncles_hash:It(32),dao:It(32)})}function Jt(t,{debugPath:e="header"}={}){const r=Wt(t,{debugPath:`(raw)${e}`}),n=Rt(e,t,{nonce:zt(16)});return n.raw=r,n}function Xt(t,{debugPath:e="uncle_block"}={}){return Rt(e,t,{header:Nt(Jt),proposals:Ht(It(10))})}var Qt=Object.freeze({__proto__:null,NormalizeScript:Mt,NormalizeOutPoint:Lt,NormalizeCellInput:qt,NormalizeCellOutput:Ut,NormalizeCellDep:Vt,NormalizeRawTransaction:Ft,NormalizeTransaction:Gt,NormalizeRawHeader:Wt,NormalizeHeader:Jt,NormalizeUncleBlock:Xt,NormalizeBlock:function(t,{debugPath:e="block"}={}){return Rt(e,t,{header:Nt(Jt),uncles:Ht(Nt(Xt)),transactions:Ht(Nt(Gt)),proposals:Ht(It(10))})},NormalizeCellbaseWitness:function(t,{debugPath:e="cellbase_witness"}={}){return Rt(e,t,{lock:Nt(Mt),message:It(-1)})},NormalizeWitnessArgs:function(t,{debugPath:e="witness_args"}={}){const r={};return t.lock&&(r.lock=It(-1)(`${e}.lock`,t.lock)),t.input_type&&(r.input_type=It(-1)(`${e}.input_type`,t.input_type)),t.output_type&&(r.output_type=It(-1)(`${e}.output_type`,t.output_type)),r}});function Zt(t,e){return e instanceof Object&&e.serializeJson instanceof Function?e.serializeJson.call(e):e}function Kt(t,e,r){if(!((e=Zt(0,e))instanceof Object))throw new Error(`Transformed ${t} is not an object!`);const n={};for(const[i,o]of Object.entries(r)){let r=e[i];if(!r){r=e[i.replace(/(_[a-z])/g,(t=>t.toUpperCase().replace("_","")))]}r&&(n[i]=o(`${t}.${i}`,r))}return n}function Yt(t,{validation:e=!0,debugPath:r="script"}={}){return t=Kt(r,t,{code_hash:Zt,hash_type:Zt,args:Zt}),e&&y(t,{debugPath:`(transformed) ${r}`}),t}function te(t,{validation:e=!0,debugPath:r="out_point"}={}){return t=Kt(r,t,{tx_hash:Zt,index:Zt}),e&&w(t,{debugPath:`(transformed) ${r}`}),t}function ee(t){return function(e,r){return t(r,{validation:!1,debugPath:e})}}function re(t,{validation:e=!0,debugPath:r="cell_input"}={}){return t=Kt(r,t,{since:Zt,previous_output:ee(te)}),e&&v(t,{debugPath:`(transformed) ${r}`}),t}function ne(t,{validation:e=!0,debugPath:r="cell_output"}={}){return t=Kt(r,t,{capacity:Zt,lock:ee(Yt),type:ee(Yt)}),e&&B(t,{debugPath:`(transformed) ${r}`}),t}function ie(t,{validation:e=!0,debugPath:r="cell_dep"}={}){return t=Kt(r,t,{out_point:ee(te),dep_type:Zt}),e&&P(t,{debugPath:`(transformed) ${r}`}),t}function oe(t){return function(e,r){return r.map(((r,n)=>t(`${e}[${n}]`,r)))}}function se(t,{validation:e=!0,debugPath:r="transaction"}={}){return t=Kt(r,t,{version:Zt,cell_deps:oe(ee(ie)),header_deps:oe(Zt),inputs:oe(ee(re)),outputs:oe(ee(ne)),outputs_data:oe(Zt),witnesses:oe(Zt)}),e&&k(t,{debugPath:`(transformed) ${r}`}),t}function ae(t,{validation:e=!0,debugPath:r="header"}={}){return t=Kt(r,t,{version:Zt,compact_target:Zt,timestamp:Zt,number:Zt,epoch:Zt,parent_hash:Zt,transactions_root:Zt,proposals_hash:Zt,uncles_hash:Zt,dao:Zt,nonce:Zt}),e&&O(t,{debugPath:`(transformed) ${r}`}),t}function ue(t,{validation:e=!0,debugPath:r="uncle_block"}={}){return t=Kt(r,t,{header:ee(ae),proposals:oe(Zt)}),e&&C(t,{debugPath:`(transformed) ${r}`}),t}var le=Object.freeze({__proto__:null,TransformScript:Yt,TransformOutPoint:te,TransformCellInput:re,TransformCellOutput:ne,TransformCellDep:ie,TransformRawTransaction:function(t,{validation:e=!0,debugPath:r="raw_transaction"}={}){return t=Kt(r,t,{version:Zt,cell_deps:oe(ee(ie)),header_deps:oe(Zt),inputs:oe(ee(re)),outputs:oe(ee(ne)),outputs_data:oe(Zt)}),e&&$(t,{debugPath:`(transformed) ${r}`}),t},TransformTransaction:se,TransformRawHeader:function(t,{validation:e=!0,debugPath:r="raw_header"}={}){return t=Kt(r,t,{version:Zt,compact_target:Zt,timestamp:Zt,number:Zt,epoch:Zt,parent_hash:Zt,transactions_root:Zt,proposals_hash:Zt,uncles_hash:Zt,dao:Zt}),e&&x(t,{debugPath:`(transformed) ${r}`}),t},TransformHeader:ae,TransformUncleBlock:ue,TransformBlock:function(t,{validation:e=!0,debugPath:r="block"}={}){return t=Kt(r,t,{header:ee(ae),uncles:oe(ee(ue)),transactions:oe(ee(se)),proposals:oe(Zt)}),e&&A(t,{debugPath:`(transformed) ${r}`}),t},TransformCellbaseWitness:function(t,{validation:e=!0,debugPath:r="cellbase_witness"}={}){return t=Kt(r,t,{lock:ee(Yt),message:Zt}),e&&j(t,{debugPath:`(transformed) ${r}`}),t},TransformWitnessArgs:function(t,{validation:e=!0,debugPath:r="witness_args"}={}){return t=Kt(r,t,{lock:Zt,input_type:Zt,output_type:Zt}),e&&z(t,{debugPath:`(transformed) ${r}`}),t}});var ce=Object.freeze({__proto__:null,RPCCollector:class{constructor(t,e,{skipCellWithContent:r=!0,loadData:n=!1,loadBlockNumber:i=!0}={}){this.rpc=t,this.lockHash=new h(e).serializeJson(),this.skipCellWithContent=r,this.loadData=n,this.loadBlockNumber=i}async*collect(){const t=At(await this.rpc.get_tip_block_number());let e=g.BigInt(0);for(;g.lessThanOrEqual(e,t);){let r=g.add(e,g.BigInt(100));g.greaterThan(r,t)&&(r=t);const n=await this.rpc.get_cells_by_lock_hash(this.lockHash,jt(e),jt(r));for(const t of n){if(this.skipCellWithContent&&(t.type||g.greaterThan(At(t.output_data_len),g.BigInt(100))))continue;let e=null;if(this.loadData){e=(await this.rpc.get_live_cell(t.out_point,!0)).cell.data.content}let r=null;if(this.loadBlockNumber){r=(await this.rpc.get_header(t.block_hash)).number}yield{cellbase:t.cellbase,cell_output:{capacity:t.capacity,lock:t.lock,type:t.type},out_point:t.out_point,block_hash:t.block_hash,data:e,output_data_len:t.output_data_len,block_number:r}}e=g.add(r,g.BigInt(1))}}}});exports.BigIntToHexString=jt,exports.HexStringToBigInt=At,exports.RPC=Ct,exports.Reader=h,exports.TransactionDumper=class{constructor(t,{validateTransaction:e=!0,depGroupUnpacker:r=null}={}){this.rpc=t,this.validateTransaction=e,this.depGroupUnpacker=r}async dumpByHash(t){const e=(await this.rpc.get_transaction(t)).transaction;return delete e.hash,await this.dump(e)}async dump(t){this.validateTransaction&&k(t);const e=[];for(const r of t.inputs){const{output:t,data:n,header:i}=await this._resolveOutPoint(r.previous_output);e.push({input:r,output:t,data:n,header:i})}const r=[];for(const e of t.cell_deps){const{output:t,data:n,header:i}=await this._resolveOutPoint(e.out_point);if(r.push({cell_dep:e,output:t,data:n,header:i}),"dep_group"===e.dep_type){if(!this.depGroupUnpacker)throw new Error("depGroupUnpacker must be provided when the transaction contains dep_group!");const t=this.depGroupUnpacker(new h(n));for(const e of t){w(e);const{output:t,data:n,header:i}=await this._resolveOutPoint(e);r.push({cell_dep:{out_point:e,dep_type:"code"},output:t,data:n,header:i})}}}const n=[];for(const e of t.header_deps)n.push(await this.rpc.get_header(e));return JSON.stringify({mock_info:{inputs:e,cell_deps:r,header_deps:n},tx:t})}async _resolveOutPoint(t){const e=await this.rpc.get_transaction(t.tx_hash);if(!e||!e.transaction)throw new Error(`Transaction ${t.tx_hash} cannot be found!`);const r=e.transaction,n=g.toNumber(g.BigInt(t.index));if(n>=r.outputs.length)throw new Error(`Transaction ${t.tx_hash} does not have output ${n}!`);const i={output:r.outputs[n],data:r.outputs_data[n]};return"committed"===e.tx_status.status&&(i.header=e.tx_status.block_hash),i}},exports.VERSION="0.10.2",exports.cell_collectors=ce,exports.normalizers=Qt,exports.transformers=le,exports.validators=I; +//# sourceMappingURL=ckb-js-toolkit.node.js.map diff --git a/packages/core/lib/ckb-js-toolkit.node.js.map b/packages/core/lib/ckb-js-toolkit.node.js.map new file mode 100644 index 000000000..65f13e91b --- /dev/null +++ b/packages/core/lib/ckb-js-toolkit.node.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ckb-js-toolkit.node.js","sources":["../src/reader.js","../../../node_modules/jsbi/dist/jsbi.mjs","../src/validators.js","../../../node_modules/node-fetch/lib/index.mjs","../../../node_modules/cross-fetch/dist/node-ponyfill.js","../src/rpc.js","../src/normalizers.js","../src/transformers.js","../src/cell_collectors/rpc_collector.js","../src/transaction_dumper.js","../src/index.js"],"sourcesContent":["class ArrayBufferReader {\n constructor(buffer) {\n this.view = new DataView(buffer);\n }\n\n length() {\n return this.view.byteLength;\n }\n\n indexAt(i) {\n return this.view.getUint8(i);\n }\n\n toArrayBuffer() {\n return this.view.buffer;\n }\n\n serializeJson() {\n return (\n \"0x\" +\n Array.prototype.map\n .call(new Uint8Array(this.view.buffer), x =>\n (\"00\" + x.toString(16)).slice(-2)\n )\n .join(\"\")\n );\n }\n}\n\nclass HexStringReader {\n constructor(string) {\n this.string = string;\n }\n\n length() {\n return this.string.length / 2 - 1;\n }\n\n indexAt(i) {\n return parseInt(this.string.substr(2 + i * 2, 2), 16);\n }\n\n toArrayBuffer() {\n const buffer = new ArrayBuffer(this.length());\n const view = new DataView(buffer);\n\n for (let i = 0; i < this.length(); i++) {\n view.setUint8(i, this.indexAt(i));\n }\n return buffer;\n }\n\n serializeJson() {\n return this.string;\n }\n}\n\nexport class Reader {\n constructor(input) {\n if (\n input instanceof HexStringReader ||\n input instanceof ArrayBufferReader\n ) {\n return input;\n }\n if (typeof input === \"string\") {\n if (!input.startsWith(\"0x\") || input.length % 2 != 0) {\n throw new Error(\n \"Hex string must start with 0x, and has even numbered length!\"\n );\n }\n return new HexStringReader(input);\n }\n if (input instanceof ArrayBuffer) {\n return new ArrayBufferReader(input);\n }\n throw new Error(\"Reader can only accept hex string or ArrayBuffer!\");\n }\n\n static fromRawString(string) {\n const buffer = new ArrayBuffer(string.length);\n const view = new DataView(buffer);\n\n for (let i = 0; i < string.length; i++) {\n const c = string.charCodeAt(i);\n if (c > 0xff) {\n throw new Error(\"fromRawString can only accept UTF-8 raw string!\");\n }\n view.setUint8(i, c);\n }\n return new ArrayBufferReader(buffer);\n }\n}\n","class JSBI extends Array{constructor(a,b){if(a>JSBI.__kMaxLength)throw new RangeError(\"Maximum BigInt size exceeded\");super(a),this.sign=b}static BigInt(a){var b=Math.floor,c=Number.isFinite;if(\"number\"==typeof a){if(0===a)return JSBI.__zero();if((0|a)===a)return 0>a?JSBI.__oneDigit(-a,!0):JSBI.__oneDigit(a,!1);if(!c(a)||b(a)!==a)throw new RangeError(\"The number \"+a+\" cannot be converted to BigInt because it is not an integer\");return JSBI.__fromDouble(a)}if(\"string\"==typeof a){const b=JSBI.__fromString(a);if(null===b)throw new SyntaxError(\"Cannot convert \"+a+\" to a BigInt\");return b}if(\"boolean\"==typeof a)return!0===a?JSBI.__oneDigit(1,!1):JSBI.__zero();if(\"object\"==typeof a){if(a.constructor===JSBI)return a;const b=JSBI.__toPrimitive(a);return JSBI.BigInt(b)}throw new TypeError(\"Cannot convert \"+a+\" to a BigInt\")}toDebugString(){const a=[\"BigInt[\"];for(const b of this)a.push((b?(b>>>0).toString(16):b)+\", \");return a.push(\"]\"),a.join(\"\")}toString(a=10){if(2>a||36>>=12;const l=j-12;let m=12<=j?0:h<<20+j,n=20+j;0>>32-l,m=h<>>32-n,n-=32);const o=JSBI.__decideRounding(a,n,i,h);if((1===o||0===o&&1==(1&m))&&(m=m+1>>>0,0===m&&(k++,0!=k>>>20&&(k=0,g++,1023=JSBI.__kMaxLengthBits)throw new RangeError(\"BigInt too big\");if(1===a.length&&2===a.__digit(0)){const b=1+(c>>>5),d=a.sign&&0!=(1&c),e=new JSBI(b,d);e.__initializeDigits();const f=1<<(31&c);return e.__setDigit(b-1,f),e}let d=null,e=a;for(0!=(1&c)&&(d=a),c>>=1;0!==c;c>>=1)e=JSBI.multiply(e,e),0!=(1&c)&&(null===d?d=e:d=JSBI.multiply(d,e));return d}static multiply(a,b){if(0===a.length)return a;if(0===b.length)return b;let c=a.length+b.length;32<=a.__clzmsd()+b.__clzmsd()&&c--;const d=new JSBI(c,a.sign!==b.sign);d.__initializeDigits();for(let c=0;cJSBI.__absoluteCompare(a,b))return JSBI.__zero();const c=a.sign!==b.sign,d=b.__unsignedDigit(0);let e;if(1===b.length&&65535>=d){if(1===d)return c===a.sign?a:JSBI.unaryMinus(a);e=JSBI.__absoluteDivSmall(a,d,null)}else e=JSBI.__absoluteDivLarge(a,b,!0,!1);return e.sign=c,e.__trim()}static remainder(a,b){if(0===b.length)throw new RangeError(\"Division by zero\");if(0>JSBI.__absoluteCompare(a,b))return a;const c=b.__unsignedDigit(0);if(1===b.length&&65535>=c){if(1===c)return JSBI.__zero();const b=JSBI.__absoluteModSmall(a,c);return 0===b?JSBI.__zero():JSBI.__oneDigit(b,a.sign)}const d=JSBI.__absoluteDivLarge(a,b,!1,!0);return d.sign=a.sign,d.__trim()}static add(a,b){const c=a.sign;return c===b.sign?JSBI.__absoluteAdd(a,b,c):0<=JSBI.__absoluteCompare(a,b)?JSBI.__absoluteSub(a,b,c):JSBI.__absoluteSub(b,a,!c)}static subtract(a,b){const c=a.sign;return c===b.sign?0<=JSBI.__absoluteCompare(a,b)?JSBI.__absoluteSub(a,b,c):JSBI.__absoluteSub(b,a,!c):JSBI.__absoluteAdd(a,b,c)}static leftShift(a,b){return 0===b.length||0===a.length?a:b.sign?JSBI.__rightShiftByAbsolute(a,b):JSBI.__leftShiftByAbsolute(a,b)}static signedRightShift(a,b){return 0===b.length||0===a.length?a:b.sign?JSBI.__leftShiftByAbsolute(a,b):JSBI.__rightShiftByAbsolute(a,b)}static unsignedRightShift(){throw new TypeError(\"BigInts have no unsigned right shift; use >> instead\")}static lessThan(a,b){return 0>JSBI.__compareToBigInt(a,b)}static lessThanOrEqual(a,b){return 0>=JSBI.__compareToBigInt(a,b)}static greaterThan(a,b){return 0=JSBI.__kMaxLengthBits)return b;const c=a+31>>>5;if(b.lengthJSBI.__kMaxLengthBits)throw new RangeError(\"BigInt too big\");return JSBI.__truncateAndSubFromPowerOfTwo(a,b,!1)}if(a>=JSBI.__kMaxLengthBits)return b;const c=a+31>>>5;if(b.length>>d)return b}return JSBI.__truncateToNBits(a,b)}static ADD(a,b){if(a=JSBI.__toPrimitive(a),b=JSBI.__toPrimitive(b),\"string\"==typeof a)return\"string\"!=typeof b&&(b=b.toString()),a+b;if(\"string\"==typeof b)return a.toString()+b;if(a=JSBI.__toNumeric(a),b=JSBI.__toNumeric(b),JSBI.__isBigInt(a)&&JSBI.__isBigInt(b))return JSBI.add(a,b);if(\"number\"==typeof a&&\"number\"==typeof b)return a+b;throw new TypeError(\"Cannot mix BigInt and other types, use explicit conversions\")}static LT(a,b){return JSBI.__compare(a,b,0)}static LE(a,b){return JSBI.__compare(a,b,1)}static GT(a,b){return JSBI.__compare(a,b,2)}static GE(a,b){return JSBI.__compare(a,b,3)}static EQ(a,b){for(;;){if(JSBI.__isBigInt(a))return JSBI.__isBigInt(b)?JSBI.equal(a,b):JSBI.EQ(b,a);if(\"number\"==typeof a){if(JSBI.__isBigInt(b))return JSBI.__equalToNumber(b,a);if(\"object\"!=typeof b)return a==b;b=JSBI.__toPrimitive(b)}else if(\"string\"==typeof a){if(JSBI.__isBigInt(b))return a=JSBI.__fromString(a),null!==a&&JSBI.equal(a,b);if(\"object\"!=typeof b)return a==b;b=JSBI.__toPrimitive(b)}else if(\"boolean\"==typeof a){if(JSBI.__isBigInt(b))return JSBI.__equalToNumber(b,+a);if(\"object\"!=typeof b)return a==b;b=JSBI.__toPrimitive(b)}else if(\"symbol\"==typeof a){if(JSBI.__isBigInt(b))return!1;if(\"object\"!=typeof b)return a==b;b=JSBI.__toPrimitive(b)}else if(\"object\"==typeof a){if(\"object\"==typeof b&&b.constructor!==JSBI)return a==b;a=JSBI.__toPrimitive(a)}else return a==b}}static NE(a,b){return!JSBI.EQ(a,b)}static __zero(){return new JSBI(0,!1)}static __oneDigit(a,b){const c=new JSBI(1,b);return c.__setDigit(0,a),c}__copy(){const a=new JSBI(this.length,this.sign);for(let b=0;bb)e=-b-1;else{if(0===c)return-1;c--,d=a.__digit(c),e=31}let f=1<>>20,c=b-1023,d=(c>>>5)+1,e=new JSBI(d,0>a);let f=1048575&JSBI.__kBitConversionInts[1]|1048576,g=JSBI.__kBitConversionInts[0];const h=20,i=31&c;let j,k=0;if(i<20){const a=h-i;k=a+32,j=f>>>a,f=f<<32-a|g>>>a,g<<=32-a}else if(i===20)k=32,j=f,f=g;else{const a=i-h;k=32-a,j=f<>>32-a,f=g<=a&&9<=a)||(159>=a?32==a:131071>=a?160==a||5760==a:196607>=a?(a&=131071,10>=a||40==a||41==a||47==a||95==a||4096==a):65279==a)}static __fromString(a,b=0){let c=0;const e=a.length;let f=0;if(f===e)return JSBI.__zero();let g=a.charCodeAt(f);for(;JSBI.__isWhitespace(g);){if(++f===e)return JSBI.__zero();g=a.charCodeAt(f)}if(43===g){if(++f===e)return null;g=a.charCodeAt(f),c=1}else if(45===g){if(++f===e)return null;g=a.charCodeAt(f),c=-1}if(0===b){if(b=10,48===g){if(++f===e)return JSBI.__zero();if(g=a.charCodeAt(f),88===g||120===g){if(b=16,++f===e)return null;g=a.charCodeAt(f)}else if(79===g||111===g){if(b=8,++f===e)return null;g=a.charCodeAt(f)}else if(66===g||98===g){if(b=2,++f===e)return null;g=a.charCodeAt(f)}}}else if(16===b&&48===g){if(++f===e)return JSBI.__zero();if(g=a.charCodeAt(f),88===g||120===g){if(++f===e)return null;g=a.charCodeAt(f)}}for(;48===g;){if(++f===e)return JSBI.__zero();g=a.charCodeAt(f)}const h=e-f;let i=JSBI.__kMaxBitsPerChar[b],j=JSBI.__kBitsPerCharTableMultiplier-1;if(h>1073741824/i)return null;const k=i*h+j>>>JSBI.__kBitsPerCharTableShift,l=new JSBI(k+31>>>5,!1),n=10>b?b:10,o=10>=JSBI.__kBitsPerCharTableShift;const b=[],c=[];let d=!1;do{let h=0,j=0;for(;;){let b;if(g-48>>>0>>0>>0>>0>>JSBI.__kBitsPerCharTableShift+5;l.__inplaceMultiplyAdd(p,k,q)}while(!c)}if(f!==e){if(!JSBI.__isWhitespace(g))return null;for(f++;f>>i-f)}if(0!==e){if(d>=a.length)throw new Error(\"implementation bug\");a.__setDigit(d++,e)}for(;d>>1)+(85&e),e=(51&e>>>2)+(51&e),e=(15&e>>>4)+(15&e);const f=e,g=b-1,h=a.__digit(d-1),i=c(h);let j=0|(32*d-i+f-1)/f;if(a.sign&&j++,268435456>>e,n=32-e;n>=f;)k[l--]=JSBI.__kConversionChars[m&g],m>>>=f,n-=f}const o=(m|h<>>f-n;0!==m;)k[l--]=JSBI.__kConversionChars[m&g],m>>>=f;if(a.sign&&(k[l--]=\"-\"),-1!=l)throw new Error(\"implementation bug\");return k.join(\"\")}static __toStringGeneric(a,b,c){var d=Math.clz32;const e=a.length;if(0===e)return\"\";if(1===e){let d=a.__unsignedDigit(0).toString(b);return!1===c&&a.sign&&(d=\"-\"+d),d}const f=32*e-d(a.__digit(e-1)),g=JSBI.__kMaxBitsPerChar[b],h=g-1;let i=f*JSBI.__kBitsPerCharTableMultiplier;i+=h-1,i=0|i/h;const j=i+1>>1,k=JSBI.exponentiate(JSBI.__oneDigit(b,!1),JSBI.__oneDigit(j,!1));let l,m;const n=k.__unsignedDigit(0);if(1===k.length&&65535>=n){l=new JSBI(a.length,!1),l.__initializeDigits();let c=0;for(let b=2*a.length-1;0<=b;b--){const d=c<<16|a.__halfDigit(b);l.__setHalfDigit(b,0|d/n),c=0|d%n}m=c.toString(b)}else{const c=JSBI.__absoluteDivLarge(a,k,!0,!0);l=c.quotient;const d=c.remainder.__trim();m=JSBI.__toStringGeneric(d,b,!0)}l.__trim();let o=JSBI.__toStringGeneric(l,b,!0);for(;m.lengthd?JSBI.__absoluteLess(c):0}static __compareToNumber(a,b){if(b|!0){const c=a.sign,d=0>b;if(c!==d)return JSBI.__unequalSign(c);if(0===a.length){if(d)throw new Error(\"implementation bug\");return 0===b?0:-1}if(1e?JSBI.__absoluteGreater(c):fb)return JSBI.__unequalSign(d);if(0===b)throw new Error(\"implementation bug: should be handled elsewhere\");if(0===a.length)return-1;JSBI.__kBitConversionDouble[0]=b;const e=2047&JSBI.__kBitConversionInts[1]>>>20;if(2047==e)throw new Error(\"implementation bug: handled elsewhere\");const f=e-1023;if(0>f)return JSBI.__absoluteGreater(d);const g=a.length;let h=a.__digit(g-1);const i=c(h),j=32*g-i,k=f+1;if(jk)return JSBI.__absoluteGreater(d);let l=1048576|1048575&JSBI.__kBitConversionInts[1],m=JSBI.__kBitConversionInts[0];const n=20,o=31-i;if(o!==(j-1)%31)throw new Error(\"implementation bug\");let p,q=0;if(20>o){const a=n-o;q=a+32,p=l>>>a,l=l<<32-a|m>>>a,m<<=32-a}else if(20===o)q=32,p=l,l=m;else{const a=o-n;q=32-a,p=l<>>32-a,l=m<>>=0,p>>>=0,h>p)return JSBI.__absoluteGreater(d);if(h>>0,l=m,m=0):p=0;const b=a.__unsignedDigit(c);if(b>p)return JSBI.__absoluteGreater(d);if(bb&&a.__unsignedDigit(0)===c(b):0===JSBI.__compareToDouble(a,b)}static __comparisonResultToBool(a,b){switch(b){case 0:return 0>a;case 1:return 0>=a;case 2:return 0b;case 3:return a>=b;}if(JSBI.__isBigInt(a)&&\"string\"==typeof b)return b=JSBI.__fromString(b),null!==b&&JSBI.__comparisonResultToBool(JSBI.__compareToBigInt(a,b),c);if(\"string\"==typeof a&&JSBI.__isBigInt(b))return a=JSBI.__fromString(a),null!==a&&JSBI.__comparisonResultToBool(JSBI.__compareToBigInt(a,b),c);if(a=JSBI.__toNumeric(a),b=JSBI.__toNumeric(b),JSBI.__isBigInt(a)){if(JSBI.__isBigInt(b))return JSBI.__comparisonResultToBool(JSBI.__compareToBigInt(a,b),c);if(\"number\"!=typeof b)throw new Error(\"implementation bug\");return JSBI.__comparisonResultToBool(JSBI.__compareToNumber(a,b),c)}if(\"number\"!=typeof a)throw new Error(\"implementation bug\");if(JSBI.__isBigInt(b))return JSBI.__comparisonResultToBool(JSBI.__compareToNumber(b,a),2^c);if(\"number\"!=typeof b)throw new Error(\"implementation bug\");return 0===c?ab:3===c?a>=b:void 0}__clzmsd(){return Math.clz32(this[this.length-1])}static __absoluteAdd(a,b,c){if(a.length>>16)+(c>>>16)+(h>>>16);f=i>>>16,e.__setDigit(g,65535&h|i<<16)}for(;g>>16)+(c>>>16);f=d>>>16,e.__setDigit(g,65535&c|d<<16)}return g>>16;const i=(c>>>16)-(g>>>16)-e;e=1&i>>>16,d.__setDigit(f,65535&h|i<<16)}for(;f>>16;const g=(b>>>16)-e;e=1&g>>>16,d.__setDigit(f,65535&c|g<<16)}return d.__trim()}static __absoluteAddOne(a,b,c=null){const d=a.length;null===c?c=new JSBI(d,b):c.sign=b;let e=!0;for(let f,g=0;gd?0:a.__unsignedDigit(d)>b.__unsignedDigit(d)?1:-1}static __multiplyAccumulate(a,b,c,d){var e=Math.imul;if(0===b)return;const f=65535&b,g=b>>>16;let h=0,j=0,k=0;for(let l=0;l>>16;const n=a.__digit(l),o=65535&n,p=n>>>16,q=e(o,f),r=e(o,g),s=e(p,f),t=e(p,g);i+=j+(65535&q),m+=k+h+(i>>>16)+(q>>>16)+(65535&r)+(65535&s),h=m>>>16,j=(r>>>16)+(s>>>16)+(65535&t)+h,h=j>>>16,j&=65535,k=t>>>16,b=65535&i|m<<16,c.__setDigit(d,b)}for(;0!=h||0!==j||0!==k;d++){let a=c.__digit(d);const b=(65535&a)+j,e=(a>>>16)+(b>>>16)+k+h;j=0,k=0,h=e>>>16,a=65535&b|e<<16,c.__setDigit(d,a)}}static __internalMultiplyAdd(a,b,c,d,e){var f=Math.imul;let g=c,h=0;for(let j=0;j>>16;const k=f(c>>>16,b),l=(65535&k)+(d>>>16)+g;g=l>>>16,h=k>>>16,e.__setDigit(j,l<<16|65535&i)}if(e.length>d)for(e.__setDigit(d++,g+h);dthis.length&&(c=this.length);const f=65535&a,g=a>>>16;let h=0,j=65535&b,k=b>>>16;for(let l=0;l>>16,d=e(b,f),i=e(b,g),m=e(c,f),n=e(c,g),o=j+(65535&d),p=k+h+(o>>>16)+(d>>>16)+(65535&i)+(65535&m);j=(i>>>16)+(m>>>16)+(65535&n)+(p>>>16),h=j>>>16,j&=65535,k=n>>>16;this.__setDigit(l,65535&o|p<<16)}if(0!=h||0!==j||0!==k)throw new Error(\"implementation bug\")}static __absoluteDivSmall(a,b,c){null===c&&(c=new JSBI(a.length,!1));let d=0;for(let e,f=2*a.length-1;0<=f;f-=2){e=(d<<16|a.__halfDigit(f))>>>0;const g=0|e/b;d=0|e%b,e=(d<<16|a.__halfDigit(f-1))>>>0;const h=0|e/b;d=0|e%b,c.__setDigit(f>>>1,g<<16|h)}return c}static __absoluteModSmall(a,b){let c=0;for(let d=2*a.length-1;0<=d;d--){const e=(c<<16|a.__halfDigit(d))>>>0;c=0|e%b}return c}static __absoluteDivLarge(a,b,d,e){var f=Math.imul;const g=b.__halfDigitLength(),h=b.length,c=a.__halfDigitLength()-g;let i=null;d&&(i=new JSBI(c+2>>>1,!1),i.__initializeDigits());const k=new JSBI(g+2>>>1,!1);k.__initializeDigits();const l=JSBI.__clz16(b.__halfDigit(g-1));0>>0;l=0|c/n;let d=0|c%n;const e=b.__halfDigit(g-2),h=m.__halfDigit(p+g-2);for(;f(l,e)>>>0>(d<<16|h)>>>0&&(l--,d+=n,!(65535>>1,o|l))}return e?(m.__inplaceRightShift(l),d?{quotient:i,remainder:m}:m):d?i:void 0}static __clz16(a){return Math.clz32(a)-16}__inplaceAdd(a,b,c){let d=0;for(let e=0;e>>16,this.__setHalfDigit(b+e,c)}return d}__inplaceSub(a,b,c){let d=0;if(1&b){b>>=1;let e=this.__digit(b),f=65535&e,g=0;for(;g>>1;g++){const c=a.__digit(g),h=(e>>>16)-(65535&c)-d;d=1&h>>>16,this.__setDigit(b+g,h<<16|65535&f),e=this.__digit(b+g+1),f=(65535&e)-(c>>>16)-d,d=1&f>>>16}const h=a.__digit(g),i=(e>>>16)-(65535&h)-d;d=1&i>>>16,this.__setDigit(b+g,i<<16|65535&f);if(b+g+1>=this.length)throw new RangeError(\"out of bounds\");0==(1&c)&&(e=this.__digit(b+g+1),f=(65535&e)-(h>>>16)-d,d=1&f>>>16,this.__setDigit(b+a.length,4294901760&e|65535&f))}else{b>>=1;let e=0;for(;e>>16;const h=(c>>>16)-(f>>>16)-d;d=1&h>>>16,this.__setDigit(b+e,h<<16|65535&g)}const f=this.__digit(b+e),g=a.__digit(e),h=(65535&f)-(65535&g)-d;d=1&h>>>16;let i=0;0==(1&c)&&(i=(f>>>16)-(g>>>16)-d,d=1&i>>>16),this.__setDigit(b+e,i<<16|65535&h)}return d}__inplaceRightShift(a){if(0===a)return;let b=this.__digit(0)>>>a;const c=this.length-1;for(let e=0;e>>a}this.__setDigit(c,b)}static __specialLeftShift(a,b,c){const d=a.length,e=new JSBI(d+c,!1);if(0===b){for(let b=0;b>>32-b}return 0c)throw new RangeError(\"BigInt too big\");const e=c>>>5,f=31&c,g=a.length,h=0!==f&&0!=a.__digit(g-1)>>>32-f,j=g+e+(h?1:0),k=new JSBI(j,a.sign);if(0===f){let b=0;for(;b>>32-f}if(h)k.__setDigit(g+e,b);else if(0!==b)throw new Error(\"implementation bug\")}return k.__trim()}static __rightShiftByAbsolute(a,b){const c=a.length,d=a.sign,e=JSBI.__toShiftAmount(b);if(0>e)return JSBI.__rightShiftByMaximum(d);const f=e>>>5,g=31&e;let h=c-f;if(0>=h)return JSBI.__rightShiftByMaximum(d);let i=!1;if(d){if(0!=(a.__digit(f)&(1<>>g;const d=c-f-1;for(let c=0;c>>g}j.__setDigit(d,b)}return i&&(j=JSBI.__absoluteAddOne(j,!0,j)),j.__trim()}static __rightShiftByMaximum(a){return a?JSBI.__oneDigit(1,!0):JSBI.__zero()}static __toShiftAmount(a){if(1JSBI.__kMaxLengthBits?-1:b}static __toPrimitive(a,b=\"default\"){if(\"object\"!=typeof a)return a;if(a.constructor===JSBI)return a;const c=a[Symbol.toPrimitive];if(c){const a=c(b);if(\"object\"!=typeof a)return a;throw new TypeError(\"Cannot convert object to primitive value\")}const d=a.valueOf;if(d){const b=d.call(a);if(\"object\"!=typeof b)return b}const e=a.toString;if(e){const b=e.call(a);if(\"object\"!=typeof b)return b}throw new TypeError(\"Cannot convert object to primitive value\")}static __toNumeric(a){return JSBI.__isBigInt(a)?a:+a}static __isBigInt(a){return\"object\"==typeof a&&a.constructor===JSBI}static __truncateToNBits(a,b){const c=a+31>>>5,d=new JSBI(c,b.sign),e=c-1;for(let c=0;c>>b}return d.__setDigit(e,f),d.__trim()}static __truncateAndSubFromPowerOfTwo(a,b,c){var d=Math.min;const e=a+31>>>5,f=new JSBI(e,c);let g=0;const h=e-1;let j=0;for(const e=d(h,b.length);g>>16;const d=0-(a>>>16)-j;j=1&d>>>16,f.__setDigit(g,65535&c|d<<16)}for(;g>>16;const b=0-(k>>>16)-j;m=65535&a|b<<16}else{const a=32-l;k=k<>>a;const b=1<<32-a,c=(65535&b)-(65535&k)-j;j=1&c>>>16;const d=(b>>>16)-(k>>>16)-j;m=65535&c|d<<16,m&=b-1}return f.__setDigit(h,m),f.__trim()}__digit(a){return this[a]}__unsignedDigit(a){return this[a]>>>0}__setDigit(a,b){this[a]=0|b}__setDigitGrow(a,b){this[a]=0|b}__halfDigitLength(){const a=this.length;return 65535>=this.__unsignedDigit(a-1)?2*a-1:2*a}__halfDigit(a){return 65535&this[a>>>1]>>>((1&a)<<4)}__setHalfDigit(a,b){const c=a>>>1,d=this.__digit(c),e=1&a?65535&d|b<<16:4294901760&d|65535&b;this.__setDigit(c,e)}static __digitPow(a,b){let c=1;for(;0>>=1,a*=a;return c}}JSBI.__kMaxLength=33554432,JSBI.__kMaxLengthBits=JSBI.__kMaxLength<<5,JSBI.__kMaxBitsPerChar=[0,0,32,51,64,75,83,90,96,102,107,111,115,119,122,126,128,131,134,136,139,141,143,145,147,149,151,153,154,156,158,159,160,162,163,165,166],JSBI.__kBitsPerCharTableShift=5,JSBI.__kBitsPerCharTableMultiplier=1< maximalLength\n ) {\n throw new Error(errorMessage);\n }\n let optionalProvidedKeys = providedKeys.filter(\n key => !expectedKeys.includes(key)\n );\n if (providedKeys.length - optionalProvidedKeys.length !== requiredLength) {\n throw new Error(errorMessage);\n }\n if (optionalProvidedKeys.find(key => !optionalKeys.includes(key))) {\n throw new Error(errorMessage);\n }\n}\n\nfunction assertHexString(debugPath, string) {\n if (!/^0x([0-9a-fA-F][0-9a-fA-F])*$/.test(string)) {\n throw new Error(`${debugPath} must be a hex string!`);\n }\n}\n\nfunction assertHash(debugPath, hash) {\n assertHexString(debugPath, hash);\n if (hash.length != 66) {\n throw new Error(`${debugPath} must be a hex string of 66 bytes long!`);\n }\n}\n\nfunction assertInteger(debugPath, i) {\n if (i === \"0x0\") {\n return;\n }\n if (!/^0x[1-9a-fA-F][0-9a-fA-F]*$/.test(i)) {\n throw new Error(`${debugPath} must be a hex integer!`);\n }\n}\n\nexport function ValidateScript(\n script,\n { nestedValidation = true, debugPath = \"script\" } = {}\n) {\n assertObjectWithKeys(\n debugPath,\n script,\n [\"code_hash\", \"hash_type\", \"args\"],\n []\n );\n assertHash(`${debugPath}.code_hash`, script.code_hash);\n assertHexString(`${debugPath}.args`, script.args);\n\n if (script.hash_type !== \"data\" && script.hash_type !== \"type\") {\n throw new Error(`${debugPath}.hash_type must be either data or type!`);\n }\n}\n\nexport function ValidateOutPoint(\n outPoint,\n { nestedValidation = true, debugPath = \"out_point\" } = {}\n) {\n assertObjectWithKeys(debugPath, outPoint, [\"tx_hash\", \"index\"], []);\n assertHash(`${debugPath}.tx_hash`, outPoint.tx_hash);\n assertInteger(`${debugPath}.index`, outPoint.index);\n}\n\nexport function ValidateCellInput(\n cellInput,\n { nestedValidation = true, debugPath = \"cell_input\" } = {}\n) {\n assertObjectWithKeys(debugPath, cellInput, [\"since\", \"previous_output\"], []);\n assertInteger(`${debugPath}.since`, cellInput.since);\n\n if (nestedValidation) {\n ValidateOutPoint(cellInput.previous_output, {\n debugPath: `${debugPath}.previous_output`\n });\n }\n}\n\nexport function ValidateCellOutput(\n cellOutput,\n { nestedValidation = true, debugPath = \"cell_output\" } = {}\n) {\n assertObjectWithKeys(debugPath, cellOutput, [\"capacity\", \"lock\"], [\"type\"]);\n assertInteger(`${debugPath}.capacity`, cellOutput.capacity);\n\n if (nestedValidation) {\n ValidateScript(cellOutput.lock, {\n debugPath: `${debugPath}.lock`\n });\n if (cellOutput.type) {\n ValidateScript(cellOutput.type, {\n debugPath: `${debugPath}.type`\n });\n }\n }\n}\n\nexport function ValidateCellDep(\n cellDep,\n { nestedValidation = true, debugPath = \"cell_dep\" } = {}\n) {\n assertObjectWithKeys(debugPath, cellDep, [\"out_point\", \"dep_type\"], []);\n if (cellDep.dep_type !== \"code\" && cellDep.dep_type !== \"dep_group\") {\n throw new Error(`${debugPath}.dep_type must be either code or dep_group!`);\n }\n\n if (nestedValidation) {\n ValidateOutPoint(cellDep.out_point, {\n debugPath: `${debugPath}.out_point`\n });\n }\n}\n\nfunction assertArray(debugPath, array, validateFunction, nestedValidation) {\n if (!Array.isArray(array)) {\n throw new Error(`${debugPath} is not an array!`);\n }\n if (nestedValidation) {\n for (let i = 0; i < array.length; i++) {\n validateFunction(`${debugPath}[${i}]`, array[i]);\n }\n }\n}\n\nfunction toAssert(validateFunction, nestedValidation) {\n return function(debugPath, value) {\n validateFunction(value, {\n nestedValidation: nestedValidation,\n debugPath: debugPath\n });\n };\n}\n\nfunction assertCommonTransaction(debugPath, rawTransaction, nestedValidation) {\n assertInteger(`${debugPath}.version`, rawTransaction.version);\n assertArray(\n `${debugPath}.cell_deps`,\n rawTransaction.cell_deps,\n toAssert(ValidateCellDep, nestedValidation),\n nestedValidation\n );\n assertArray(\n `${debugPath}.header_deps`,\n rawTransaction.header_deps,\n assertHash,\n nestedValidation\n );\n assertArray(\n `${debugPath}.inputs`,\n rawTransaction.inputs,\n toAssert(ValidateCellInput, nestedValidation),\n nestedValidation\n );\n assertArray(\n `${debugPath}.outputs`,\n rawTransaction.outputs,\n toAssert(ValidateCellOutput, nestedValidation),\n nestedValidation\n );\n assertArray(\n `${debugPath}.outputs_data`,\n rawTransaction.outputs_data,\n assertHexString,\n nestedValidation\n );\n}\n\nexport function ValidateRawTransaction(\n rawTransaction,\n { nestedValidation = true, debugPath = \"raw_transaction\" } = {}\n) {\n assertObjectWithKeys(\n debugPath,\n rawTransaction,\n [\n \"version\",\n \"cell_deps\",\n \"header_deps\",\n \"inputs\",\n \"outputs\",\n \"outputs_data\"\n ],\n []\n );\n assertCommonTransaction(debugPath, rawTransaction, nestedValidation);\n}\n\nexport function ValidateTransaction(\n transaction,\n { nestedValidation = true, debugPath = \"transaction\" } = {}\n) {\n assertObjectWithKeys(\n debugPath,\n transaction,\n [\n \"version\",\n \"cell_deps\",\n \"header_deps\",\n \"inputs\",\n \"outputs\",\n \"outputs_data\",\n \"witnesses\"\n ],\n []\n );\n assertCommonTransaction(debugPath, transaction, nestedValidation);\n assertArray(\n `${debugPath}.witnesses`,\n transaction.witnesses,\n assertHexString,\n nestedValidation\n );\n}\n\nfunction assertCommonHeader(debugPath, rawHeader) {\n assertInteger(`${debugPath}.version`, rawHeader.version);\n assertInteger(`${debugPath}.compact_target`, rawHeader.compact_target);\n assertInteger(`${debugPath}.timestamp`, rawHeader.timestamp);\n assertInteger(`${debugPath}.number`, rawHeader.number);\n assertInteger(`${debugPath}.epoch`, rawHeader.epoch);\n assertHash(`${debugPath}.parent_hash`, rawHeader.parent_hash);\n assertHash(`${debugPath}.transactions_root`, rawHeader.transactions_root);\n assertHash(`${debugPath}.proposals_hash`, rawHeader.proposals_hash);\n assertHash(`${debugPath}.uncles_hash`, rawHeader.uncles_hash);\n assertHash(`${debugPath}.dao`, rawHeader.dao);\n}\n\nexport function ValidateRawHeader(\n rawHeader,\n { nestedValidation = true, debugPath = \"raw_header\" } = {}\n) {\n assertObjectWithKeys(\n debugPath,\n rawHeader,\n [\n \"version\",\n \"compact_target\",\n \"timestamp\",\n \"number\",\n \"epoch\",\n \"parent_hash\",\n \"transactions_root\",\n \"proposals_hash\",\n \"uncles_hash\",\n \"dao\"\n ],\n []\n );\n assertCommonHeader(debugPath, rawHeader);\n}\n\nexport function ValidateHeader(\n header,\n { nestedValidation = true, debugPath = \"header\" } = {}\n) {\n assertObjectWithKeys(\n debugPath,\n header,\n [\n \"version\",\n \"compact_target\",\n \"timestamp\",\n \"number\",\n \"epoch\",\n \"parent_hash\",\n \"transactions_root\",\n \"proposals_hash\",\n \"uncles_hash\",\n \"dao\",\n \"nonce\"\n ],\n []\n );\n assertHexString(`${debugPath}.nonce`, header.nonce);\n if (header.nonce.length != 34) {\n throw new Error(\n `${debugPath}.nonce must be a hex string of 34 bytes long!`\n );\n }\n}\n\nfunction assertProposalShortId(debugPath, shortId) {\n assertHexString(debugPath, shortId);\n if (shortId.length != 22) {\n throw new Error(`${debugPath} must be a hex string of 22 bytes long!`);\n }\n}\n\nexport function ValidateUncleBlock(\n uncleBlock,\n { nestedValidation = true, debugPath = \"uncle_block\" } = {}\n) {\n assertObjectWithKeys(debugPath, uncleBlock, [\"header\", \"proposals\"], []);\n\n if (nestedValidation) {\n ValidateHeader(uncleBlock.header, {\n debugPath: `${debugPath}.header`\n });\n }\n assertArray(\n `${debugPath}.proposals`,\n uncleBlock.proposals,\n assertProposalShortId,\n nestedValidation\n );\n}\n\nexport function ValidateBlock(\n block,\n { nestedValidation = true, debugPath = \"block\" } = {}\n) {\n assertObjectWithKeys(\n debugPath,\n block,\n [\"header\", \"uncles\", \"transactions\", \"proposals\"],\n []\n );\n\n if (nestedValidation) {\n ValidateHeader(block.header, {\n debugPath: `${debugPath}.header`\n });\n }\n assertArray(\n `${debugPath}.uncles`,\n block.uncles,\n toAssert(ValidateUncleBlock, nestedValidation),\n nestedValidation\n );\n assertArray(\n `${debugPath}.transactions`,\n block.transactions,\n toAssert(ValidateTransaction, nestedValidation),\n nestedValidation\n );\n assertArray(\n `${debugPath}.proposals`,\n block.proposals,\n assertProposalShortId,\n nestedValidation\n );\n}\n\nexport function ValidateCellbaseWitness(\n cellbaseWitness,\n { nestedValidation = true, debugPath = \"cellbase_witness\" } = {}\n) {\n assertObjectWithKeys(debugPath, cellbaseWitness, [\"lock\", \"message\"], []);\n assertHexString(`${debugPath}.message`, cellbaseWitness.message);\n\n if (nestedValidation) {\n ValidateScript(cellbaseWitness.lock, {\n debugPath: `${debugPath}.lock`\n });\n }\n}\n\nexport function ValidateWitnessArgs(\n witnessArgs,\n { nestedValidation = true, debugPath = \"witness_args\" } = {}\n) {\n assertObjectWithKeys(\n debugPath,\n witnessArgs,\n [],\n [\"lock\", \"input_type\", \"output_type\"]\n );\n\n if (witnessArgs.lock) {\n assertHexString(`${debugPath}.lock`, witnessArgs.lock);\n }\n if (witnessArgs.input_type) {\n assertHexString(`${debugPath}.input_type`, witnessArgs.input_type);\n }\n if (witnessArgs.output_type) {\n assertHexString(`${debugPath}.output_type`, witnessArgs.output_type);\n }\n}\n","import Stream from 'stream';\nimport http from 'http';\nimport Url from 'url';\nimport https from 'https';\nimport zlib from 'zlib';\n\n// Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js\n\n// fix for \"Readable\" isn't a named export issue\nconst Readable = Stream.Readable;\n\nconst BUFFER = Symbol('buffer');\nconst TYPE = Symbol('type');\n\nclass Blob {\n\tconstructor() {\n\t\tthis[TYPE] = '';\n\n\t\tconst blobParts = arguments[0];\n\t\tconst options = arguments[1];\n\n\t\tconst buffers = [];\n\t\tlet size = 0;\n\n\t\tif (blobParts) {\n\t\t\tconst a = blobParts;\n\t\t\tconst length = Number(a.length);\n\t\t\tfor (let i = 0; i < length; i++) {\n\t\t\t\tconst element = a[i];\n\t\t\t\tlet buffer;\n\t\t\t\tif (element instanceof Buffer) {\n\t\t\t\t\tbuffer = element;\n\t\t\t\t} else if (ArrayBuffer.isView(element)) {\n\t\t\t\t\tbuffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength);\n\t\t\t\t} else if (element instanceof ArrayBuffer) {\n\t\t\t\t\tbuffer = Buffer.from(element);\n\t\t\t\t} else if (element instanceof Blob) {\n\t\t\t\t\tbuffer = element[BUFFER];\n\t\t\t\t} else {\n\t\t\t\t\tbuffer = Buffer.from(typeof element === 'string' ? element : String(element));\n\t\t\t\t}\n\t\t\t\tsize += buffer.length;\n\t\t\t\tbuffers.push(buffer);\n\t\t\t}\n\t\t}\n\n\t\tthis[BUFFER] = Buffer.concat(buffers);\n\n\t\tlet type = options && options.type !== undefined && String(options.type).toLowerCase();\n\t\tif (type && !/[^\\u0020-\\u007E]/.test(type)) {\n\t\t\tthis[TYPE] = type;\n\t\t}\n\t}\n\tget size() {\n\t\treturn this[BUFFER].length;\n\t}\n\tget type() {\n\t\treturn this[TYPE];\n\t}\n\ttext() {\n\t\treturn Promise.resolve(this[BUFFER].toString());\n\t}\n\tarrayBuffer() {\n\t\tconst buf = this[BUFFER];\n\t\tconst ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\treturn Promise.resolve(ab);\n\t}\n\tstream() {\n\t\tconst readable = new Readable();\n\t\treadable._read = function () {};\n\t\treadable.push(this[BUFFER]);\n\t\treadable.push(null);\n\t\treturn readable;\n\t}\n\ttoString() {\n\t\treturn '[object Blob]';\n\t}\n\tslice() {\n\t\tconst size = this.size;\n\n\t\tconst start = arguments[0];\n\t\tconst end = arguments[1];\n\t\tlet relativeStart, relativeEnd;\n\t\tif (start === undefined) {\n\t\t\trelativeStart = 0;\n\t\t} else if (start < 0) {\n\t\t\trelativeStart = Math.max(size + start, 0);\n\t\t} else {\n\t\t\trelativeStart = Math.min(start, size);\n\t\t}\n\t\tif (end === undefined) {\n\t\t\trelativeEnd = size;\n\t\t} else if (end < 0) {\n\t\t\trelativeEnd = Math.max(size + end, 0);\n\t\t} else {\n\t\t\trelativeEnd = Math.min(end, size);\n\t\t}\n\t\tconst span = Math.max(relativeEnd - relativeStart, 0);\n\n\t\tconst buffer = this[BUFFER];\n\t\tconst slicedBuffer = buffer.slice(relativeStart, relativeStart + span);\n\t\tconst blob = new Blob([], { type: arguments[2] });\n\t\tblob[BUFFER] = slicedBuffer;\n\t\treturn blob;\n\t}\n}\n\nObject.defineProperties(Blob.prototype, {\n\tsize: { enumerable: true },\n\ttype: { enumerable: true },\n\tslice: { enumerable: true }\n});\n\nObject.defineProperty(Blob.prototype, Symbol.toStringTag, {\n\tvalue: 'Blob',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\n/**\n * fetch-error.js\n *\n * FetchError interface for operational errors\n */\n\n/**\n * Create FetchError instance\n *\n * @param String message Error message for human\n * @param String type Error type for machine\n * @param String systemError For Node.js system error\n * @return FetchError\n */\nfunction FetchError(message, type, systemError) {\n Error.call(this, message);\n\n this.message = message;\n this.type = type;\n\n // when err.type is `system`, err.code contains system error code\n if (systemError) {\n this.code = this.errno = systemError.code;\n }\n\n // hide custom error implementation details from end-users\n Error.captureStackTrace(this, this.constructor);\n}\n\nFetchError.prototype = Object.create(Error.prototype);\nFetchError.prototype.constructor = FetchError;\nFetchError.prototype.name = 'FetchError';\n\nlet convert;\ntry {\n\tconvert = require('encoding').convert;\n} catch (e) {}\n\nconst INTERNALS = Symbol('Body internals');\n\n// fix an issue where \"PassThrough\" isn't a named export for node <10\nconst PassThrough = Stream.PassThrough;\n\n/**\n * Body mixin\n *\n * Ref: https://fetch.spec.whatwg.org/#body\n *\n * @param Stream body Readable stream\n * @param Object opts Response options\n * @return Void\n */\nfunction Body(body) {\n\tvar _this = this;\n\n\tvar _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n\t _ref$size = _ref.size;\n\n\tlet size = _ref$size === undefined ? 0 : _ref$size;\n\tvar _ref$timeout = _ref.timeout;\n\tlet timeout = _ref$timeout === undefined ? 0 : _ref$timeout;\n\n\tif (body == null) {\n\t\t// body is undefined or null\n\t\tbody = null;\n\t} else if (isURLSearchParams(body)) {\n\t\t// body is a URLSearchParams\n\t\tbody = Buffer.from(body.toString());\n\t} else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {\n\t\t// body is ArrayBuffer\n\t\tbody = Buffer.from(body);\n\t} else if (ArrayBuffer.isView(body)) {\n\t\t// body is ArrayBufferView\n\t\tbody = Buffer.from(body.buffer, body.byteOffset, body.byteLength);\n\t} else if (body instanceof Stream) ; else {\n\t\t// none of the above\n\t\t// coerce to string then buffer\n\t\tbody = Buffer.from(String(body));\n\t}\n\tthis[INTERNALS] = {\n\t\tbody,\n\t\tdisturbed: false,\n\t\terror: null\n\t};\n\tthis.size = size;\n\tthis.timeout = timeout;\n\n\tif (body instanceof Stream) {\n\t\tbody.on('error', function (err) {\n\t\t\tconst error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err);\n\t\t\t_this[INTERNALS].error = error;\n\t\t});\n\t}\n}\n\nBody.prototype = {\n\tget body() {\n\t\treturn this[INTERNALS].body;\n\t},\n\n\tget bodyUsed() {\n\t\treturn this[INTERNALS].disturbed;\n\t},\n\n\t/**\n * Decode response as ArrayBuffer\n *\n * @return Promise\n */\n\tarrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t},\n\n\t/**\n * Return raw response as Blob\n *\n * @return Promise\n */\n\tblob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t},\n\n\t/**\n * Decode response as json\n *\n * @return Promise\n */\n\tjson() {\n\t\tvar _this2 = this;\n\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\ttry {\n\t\t\t\treturn JSON.parse(buffer.toString());\n\t\t\t} catch (err) {\n\t\t\t\treturn Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json'));\n\t\t\t}\n\t\t});\n\t},\n\n\t/**\n * Decode response as text\n *\n * @return Promise\n */\n\ttext() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t},\n\n\t/**\n * Decode response as buffer (non-spec api)\n *\n * @return Promise\n */\n\tbuffer() {\n\t\treturn consumeBody.call(this);\n\t},\n\n\t/**\n * Decode response as text, while automatically detecting the encoding and\n * trying to decode to UTF-8 (non-spec api)\n *\n * @return Promise\n */\n\ttextConverted() {\n\t\tvar _this3 = this;\n\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn convertBody(buffer, _this3.headers);\n\t\t});\n\t}\n};\n\n// In browsers, all properties are enumerable.\nObject.defineProperties(Body.prototype, {\n\tbody: { enumerable: true },\n\tbodyUsed: { enumerable: true },\n\tarrayBuffer: { enumerable: true },\n\tblob: { enumerable: true },\n\tjson: { enumerable: true },\n\ttext: { enumerable: true }\n});\n\nBody.mixIn = function (proto) {\n\tfor (const name of Object.getOwnPropertyNames(Body.prototype)) {\n\t\t// istanbul ignore else: future proof\n\t\tif (!(name in proto)) {\n\t\t\tconst desc = Object.getOwnPropertyDescriptor(Body.prototype, name);\n\t\t\tObject.defineProperty(proto, name, desc);\n\t\t}\n\t}\n};\n\n/**\n * Consume and convert an entire Body to a Buffer.\n *\n * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body\n *\n * @return Promise\n */\nfunction consumeBody() {\n\tvar _this4 = this;\n\n\tif (this[INTERNALS].disturbed) {\n\t\treturn Body.Promise.reject(new TypeError(`body used already for: ${this.url}`));\n\t}\n\n\tthis[INTERNALS].disturbed = true;\n\n\tif (this[INTERNALS].error) {\n\t\treturn Body.Promise.reject(this[INTERNALS].error);\n\t}\n\n\tlet body = this.body;\n\n\t// body is null\n\tif (body === null) {\n\t\treturn Body.Promise.resolve(Buffer.alloc(0));\n\t}\n\n\t// body is blob\n\tif (isBlob(body)) {\n\t\tbody = body.stream();\n\t}\n\n\t// body is buffer\n\tif (Buffer.isBuffer(body)) {\n\t\treturn Body.Promise.resolve(body);\n\t}\n\n\t// istanbul ignore if: should never happen\n\tif (!(body instanceof Stream)) {\n\t\treturn Body.Promise.resolve(Buffer.alloc(0));\n\t}\n\n\t// body is stream\n\t// get ready to actually consume the body\n\tlet accum = [];\n\tlet accumBytes = 0;\n\tlet abort = false;\n\n\treturn new Body.Promise(function (resolve, reject) {\n\t\tlet resTimeout;\n\n\t\t// allow timeout on slow response body\n\t\tif (_this4.timeout) {\n\t\t\tresTimeout = setTimeout(function () {\n\t\t\t\tabort = true;\n\t\t\t\treject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout'));\n\t\t\t}, _this4.timeout);\n\t\t}\n\n\t\t// handle stream errors\n\t\tbody.on('error', function (err) {\n\t\t\tif (err.name === 'AbortError') {\n\t\t\t\t// if the request was aborted, reject with this Error\n\t\t\t\tabort = true;\n\t\t\t\treject(err);\n\t\t\t} else {\n\t\t\t\t// other errors, such as incorrect content-encoding\n\t\t\t\treject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err));\n\t\t\t}\n\t\t});\n\n\t\tbody.on('data', function (chunk) {\n\t\t\tif (abort || chunk === null) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (_this4.size && accumBytes + chunk.length > _this4.size) {\n\t\t\t\tabort = true;\n\t\t\t\treject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size'));\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\taccumBytes += chunk.length;\n\t\t\taccum.push(chunk);\n\t\t});\n\n\t\tbody.on('end', function () {\n\t\t\tif (abort) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tclearTimeout(resTimeout);\n\n\t\t\ttry {\n\t\t\t\tresolve(Buffer.concat(accum, accumBytes));\n\t\t\t} catch (err) {\n\t\t\t\t// handle streams that have accumulated too much data (issue #414)\n\t\t\t\treject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err));\n\t\t\t}\n\t\t});\n\t});\n}\n\n/**\n * Detect buffer encoding and convert to target encoding\n * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding\n *\n * @param Buffer buffer Incoming buffer\n * @param String encoding Target encoding\n * @return String\n */\nfunction convertBody(buffer, headers) {\n\tif (typeof convert !== 'function') {\n\t\tthrow new Error('The package `encoding` must be installed to use the textConverted() function');\n\t}\n\n\tconst ct = headers.get('content-type');\n\tlet charset = 'utf-8';\n\tlet res, str;\n\n\t// header\n\tif (ct) {\n\t\tres = /charset=([^;]*)/i.exec(ct);\n\t}\n\n\t// no charset in content type, peek at response body for at most 1024 bytes\n\tstr = buffer.slice(0, 1024).toString();\n\n\t// html5\n\tif (!res && str) {\n\t\tres = / 0 && arguments[0] !== undefined ? arguments[0] : undefined;\n\n\t\tthis[MAP] = Object.create(null);\n\n\t\tif (init instanceof Headers) {\n\t\t\tconst rawHeaders = init.raw();\n\t\t\tconst headerNames = Object.keys(rawHeaders);\n\n\t\t\tfor (const headerName of headerNames) {\n\t\t\t\tfor (const value of rawHeaders[headerName]) {\n\t\t\t\t\tthis.append(headerName, value);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\t// We don't worry about converting prop to ByteString here as append()\n\t\t// will handle it.\n\t\tif (init == null) ; else if (typeof init === 'object') {\n\t\t\tconst method = init[Symbol.iterator];\n\t\t\tif (method != null) {\n\t\t\t\tif (typeof method !== 'function') {\n\t\t\t\t\tthrow new TypeError('Header pairs must be iterable');\n\t\t\t\t}\n\n\t\t\t\t// sequence>\n\t\t\t\t// Note: per spec we have to first exhaust the lists then process them\n\t\t\t\tconst pairs = [];\n\t\t\t\tfor (const pair of init) {\n\t\t\t\t\tif (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') {\n\t\t\t\t\t\tthrow new TypeError('Each header pair must be iterable');\n\t\t\t\t\t}\n\t\t\t\t\tpairs.push(Array.from(pair));\n\t\t\t\t}\n\n\t\t\t\tfor (const pair of pairs) {\n\t\t\t\t\tif (pair.length !== 2) {\n\t\t\t\t\t\tthrow new TypeError('Each header pair must be a name/value tuple');\n\t\t\t\t\t}\n\t\t\t\t\tthis.append(pair[0], pair[1]);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// record\n\t\t\t\tfor (const key of Object.keys(init)) {\n\t\t\t\t\tconst value = init[key];\n\t\t\t\t\tthis.append(key, value);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new TypeError('Provided initializer must be an object');\n\t\t}\n\t}\n\n\t/**\n * Return combined header value given name\n *\n * @param String name Header name\n * @return Mixed\n */\n\tget(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\tconst key = find(this[MAP], name);\n\t\tif (key === undefined) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn this[MAP][key].join(', ');\n\t}\n\n\t/**\n * Iterate over all headers\n *\n * @param Function callback Executed for each item with parameters (value, name, thisArg)\n * @param Boolean thisArg `this` context for callback function\n * @return Void\n */\n\tforEach(callback) {\n\t\tlet thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;\n\n\t\tlet pairs = getHeaders(this);\n\t\tlet i = 0;\n\t\twhile (i < pairs.length) {\n\t\t\tvar _pairs$i = pairs[i];\n\t\t\tconst name = _pairs$i[0],\n\t\t\t value = _pairs$i[1];\n\n\t\t\tcallback.call(thisArg, value, name, this);\n\t\t\tpairs = getHeaders(this);\n\t\t\ti++;\n\t\t}\n\t}\n\n\t/**\n * Overwrite header values given name\n *\n * @param String name Header name\n * @param String value Header value\n * @return Void\n */\n\tset(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}\n\n\t/**\n * Append a value onto existing header\n *\n * @param String name Header name\n * @param String value Header value\n * @return Void\n */\n\tappend(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tif (key !== undefined) {\n\t\t\tthis[MAP][key].push(value);\n\t\t} else {\n\t\t\tthis[MAP][name] = [value];\n\t\t}\n\t}\n\n\t/**\n * Check for header name existence\n *\n * @param String name Header name\n * @return Boolean\n */\n\thas(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\treturn find(this[MAP], name) !== undefined;\n\t}\n\n\t/**\n * Delete all header values given name\n *\n * @param String name Header name\n * @return Void\n */\n\tdelete(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\tconst key = find(this[MAP], name);\n\t\tif (key !== undefined) {\n\t\t\tdelete this[MAP][key];\n\t\t}\n\t}\n\n\t/**\n * Return raw headers (non-spec api)\n *\n * @return Object\n */\n\traw() {\n\t\treturn this[MAP];\n\t}\n\n\t/**\n * Get an iterator on keys.\n *\n * @return Iterator\n */\n\tkeys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}\n\n\t/**\n * Get an iterator on values.\n *\n * @return Iterator\n */\n\tvalues() {\n\t\treturn createHeadersIterator(this, 'value');\n\t}\n\n\t/**\n * Get an iterator on entries.\n *\n * This is the default iterator of the Headers object.\n *\n * @return Iterator\n */\n\t[Symbol.iterator]() {\n\t\treturn createHeadersIterator(this, 'key+value');\n\t}\n}\nHeaders.prototype.entries = Headers.prototype[Symbol.iterator];\n\nObject.defineProperty(Headers.prototype, Symbol.toStringTag, {\n\tvalue: 'Headers',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\nObject.defineProperties(Headers.prototype, {\n\tget: { enumerable: true },\n\tforEach: { enumerable: true },\n\tset: { enumerable: true },\n\tappend: { enumerable: true },\n\thas: { enumerable: true },\n\tdelete: { enumerable: true },\n\tkeys: { enumerable: true },\n\tvalues: { enumerable: true },\n\tentries: { enumerable: true }\n});\n\nfunction getHeaders(headers) {\n\tlet kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value';\n\n\tconst keys = Object.keys(headers[MAP]).sort();\n\treturn keys.map(kind === 'key' ? function (k) {\n\t\treturn k.toLowerCase();\n\t} : kind === 'value' ? function (k) {\n\t\treturn headers[MAP][k].join(', ');\n\t} : function (k) {\n\t\treturn [k.toLowerCase(), headers[MAP][k].join(', ')];\n\t});\n}\n\nconst INTERNAL = Symbol('internal');\n\nfunction createHeadersIterator(target, kind) {\n\tconst iterator = Object.create(HeadersIteratorPrototype);\n\titerator[INTERNAL] = {\n\t\ttarget,\n\t\tkind,\n\t\tindex: 0\n\t};\n\treturn iterator;\n}\n\nconst HeadersIteratorPrototype = Object.setPrototypeOf({\n\tnext() {\n\t\t// istanbul ignore if\n\t\tif (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) {\n\t\t\tthrow new TypeError('Value of `this` is not a HeadersIterator');\n\t\t}\n\n\t\tvar _INTERNAL = this[INTERNAL];\n\t\tconst target = _INTERNAL.target,\n\t\t kind = _INTERNAL.kind,\n\t\t index = _INTERNAL.index;\n\n\t\tconst values = getHeaders(target, kind);\n\t\tconst len = values.length;\n\t\tif (index >= len) {\n\t\t\treturn {\n\t\t\t\tvalue: undefined,\n\t\t\t\tdone: true\n\t\t\t};\n\t\t}\n\n\t\tthis[INTERNAL].index = index + 1;\n\n\t\treturn {\n\t\t\tvalue: values[index],\n\t\t\tdone: false\n\t\t};\n\t}\n}, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));\n\nObject.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, {\n\tvalue: 'HeadersIterator',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\n/**\n * Export the Headers object in a form that Node.js can consume.\n *\n * @param Headers headers\n * @return Object\n */\nfunction exportNodeCompatibleHeaders(headers) {\n\tconst obj = Object.assign({ __proto__: null }, headers[MAP]);\n\n\t// http.request() only supports string as Host header. This hack makes\n\t// specifying custom Host header possible.\n\tconst hostHeaderKey = find(headers[MAP], 'Host');\n\tif (hostHeaderKey !== undefined) {\n\t\tobj[hostHeaderKey] = obj[hostHeaderKey][0];\n\t}\n\n\treturn obj;\n}\n\n/**\n * Create a Headers object from an object of headers, ignoring those that do\n * not conform to HTTP grammar productions.\n *\n * @param Object obj Object of headers\n * @return Headers\n */\nfunction createHeadersLenient(obj) {\n\tconst headers = new Headers();\n\tfor (const name of Object.keys(obj)) {\n\t\tif (invalidTokenRegex.test(name)) {\n\t\t\tcontinue;\n\t\t}\n\t\tif (Array.isArray(obj[name])) {\n\t\t\tfor (const val of obj[name]) {\n\t\t\t\tif (invalidHeaderCharRegex.test(val)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (headers[MAP][name] === undefined) {\n\t\t\t\t\theaders[MAP][name] = [val];\n\t\t\t\t} else {\n\t\t\t\t\theaders[MAP][name].push(val);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (!invalidHeaderCharRegex.test(obj[name])) {\n\t\t\theaders[MAP][name] = [obj[name]];\n\t\t}\n\t}\n\treturn headers;\n}\n\nconst INTERNALS$1 = Symbol('Response internals');\n\n// fix an issue where \"STATUS_CODES\" aren't a named export for node <10\nconst STATUS_CODES = http.STATUS_CODES;\n\n/**\n * Response class\n *\n * @param Stream body Readable stream\n * @param Object opts Response options\n * @return Void\n */\nclass Response {\n\tconstructor() {\n\t\tlet body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n\t\tlet opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n\t\tBody.call(this, body, opts);\n\n\t\tconst status = opts.status || 200;\n\t\tconst headers = new Headers(opts.headers);\n\n\t\tif (body != null && !headers.has('Content-Type')) {\n\t\t\tconst contentType = extractContentType(body);\n\t\t\tif (contentType) {\n\t\t\t\theaders.append('Content-Type', contentType);\n\t\t\t}\n\t\t}\n\n\t\tthis[INTERNALS$1] = {\n\t\t\turl: opts.url,\n\t\t\tstatus,\n\t\t\tstatusText: opts.statusText || STATUS_CODES[status],\n\t\t\theaders,\n\t\t\tcounter: opts.counter\n\t\t};\n\t}\n\n\tget url() {\n\t\treturn this[INTERNALS$1].url || '';\n\t}\n\n\tget status() {\n\t\treturn this[INTERNALS$1].status;\n\t}\n\n\t/**\n * Convenience property representing if the request ended normally\n */\n\tget ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}\n\n\tget redirected() {\n\t\treturn this[INTERNALS$1].counter > 0;\n\t}\n\n\tget statusText() {\n\t\treturn this[INTERNALS$1].statusText;\n\t}\n\n\tget headers() {\n\t\treturn this[INTERNALS$1].headers;\n\t}\n\n\t/**\n * Clone this response\n *\n * @return Response\n */\n\tclone() {\n\t\treturn new Response(clone(this), {\n\t\t\turl: this.url,\n\t\t\tstatus: this.status,\n\t\t\tstatusText: this.statusText,\n\t\t\theaders: this.headers,\n\t\t\tok: this.ok,\n\t\t\tredirected: this.redirected\n\t\t});\n\t}\n}\n\nBody.mixIn(Response.prototype);\n\nObject.defineProperties(Response.prototype, {\n\turl: { enumerable: true },\n\tstatus: { enumerable: true },\n\tok: { enumerable: true },\n\tredirected: { enumerable: true },\n\tstatusText: { enumerable: true },\n\theaders: { enumerable: true },\n\tclone: { enumerable: true }\n});\n\nObject.defineProperty(Response.prototype, Symbol.toStringTag, {\n\tvalue: 'Response',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\nconst INTERNALS$2 = Symbol('Request internals');\n\n// fix an issue where \"format\", \"parse\" aren't a named export for node <10\nconst parse_url = Url.parse;\nconst format_url = Url.format;\n\nconst streamDestructionSupported = 'destroy' in Stream.Readable.prototype;\n\n/**\n * Check if a value is an instance of Request.\n *\n * @param Mixed input\n * @return Boolean\n */\nfunction isRequest(input) {\n\treturn typeof input === 'object' && typeof input[INTERNALS$2] === 'object';\n}\n\nfunction isAbortSignal(signal) {\n\tconst proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal);\n\treturn !!(proto && proto.constructor.name === 'AbortSignal');\n}\n\n/**\n * Request class\n *\n * @param Mixed input Url or Request instance\n * @param Object init Custom options\n * @return Void\n */\nclass Request {\n\tconstructor(input) {\n\t\tlet init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n\t\tlet parsedURL;\n\n\t\t// normalize input\n\t\tif (!isRequest(input)) {\n\t\t\tif (input && input.href) {\n\t\t\t\t// in order to support Node.js' Url objects; though WHATWG's URL objects\n\t\t\t\t// will fall into this branch also (since their `toString()` will return\n\t\t\t\t// `href` property anyway)\n\t\t\t\tparsedURL = parse_url(input.href);\n\t\t\t} else {\n\t\t\t\t// coerce input to a string before attempting to parse\n\t\t\t\tparsedURL = parse_url(`${input}`);\n\t\t\t}\n\t\t\tinput = {};\n\t\t} else {\n\t\t\tparsedURL = parse_url(input.url);\n\t\t}\n\n\t\tlet method = init.method || input.method || 'GET';\n\t\tmethod = method.toUpperCase();\n\n\t\tif ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) {\n\t\t\tthrow new TypeError('Request with GET/HEAD method cannot have body');\n\t\t}\n\n\t\tlet inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null;\n\n\t\tBody.call(this, inputBody, {\n\t\t\ttimeout: init.timeout || input.timeout || 0,\n\t\t\tsize: init.size || input.size || 0\n\t\t});\n\n\t\tconst headers = new Headers(init.headers || input.headers || {});\n\n\t\tif (inputBody != null && !headers.has('Content-Type')) {\n\t\t\tconst contentType = extractContentType(inputBody);\n\t\t\tif (contentType) {\n\t\t\t\theaders.append('Content-Type', contentType);\n\t\t\t}\n\t\t}\n\n\t\tlet signal = isRequest(input) ? input.signal : null;\n\t\tif ('signal' in init) signal = init.signal;\n\n\t\tif (signal != null && !isAbortSignal(signal)) {\n\t\t\tthrow new TypeError('Expected signal to be an instanceof AbortSignal');\n\t\t}\n\n\t\tthis[INTERNALS$2] = {\n\t\t\tmethod,\n\t\t\tredirect: init.redirect || input.redirect || 'follow',\n\t\t\theaders,\n\t\t\tparsedURL,\n\t\t\tsignal\n\t\t};\n\n\t\t// node-fetch-only options\n\t\tthis.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20;\n\t\tthis.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true;\n\t\tthis.counter = init.counter || input.counter || 0;\n\t\tthis.agent = init.agent || input.agent;\n\t}\n\n\tget method() {\n\t\treturn this[INTERNALS$2].method;\n\t}\n\n\tget url() {\n\t\treturn format_url(this[INTERNALS$2].parsedURL);\n\t}\n\n\tget headers() {\n\t\treturn this[INTERNALS$2].headers;\n\t}\n\n\tget redirect() {\n\t\treturn this[INTERNALS$2].redirect;\n\t}\n\n\tget signal() {\n\t\treturn this[INTERNALS$2].signal;\n\t}\n\n\t/**\n * Clone this request\n *\n * @return Request\n */\n\tclone() {\n\t\treturn new Request(this);\n\t}\n}\n\nBody.mixIn(Request.prototype);\n\nObject.defineProperty(Request.prototype, Symbol.toStringTag, {\n\tvalue: 'Request',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\nObject.defineProperties(Request.prototype, {\n\tmethod: { enumerable: true },\n\turl: { enumerable: true },\n\theaders: { enumerable: true },\n\tredirect: { enumerable: true },\n\tclone: { enumerable: true },\n\tsignal: { enumerable: true }\n});\n\n/**\n * Convert a Request to Node.js http request options.\n *\n * @param Request A Request instance\n * @return Object The options object to be passed to http.request\n */\nfunction getNodeRequestOptions(request) {\n\tconst parsedURL = request[INTERNALS$2].parsedURL;\n\tconst headers = new Headers(request[INTERNALS$2].headers);\n\n\t// fetch step 1.3\n\tif (!headers.has('Accept')) {\n\t\theaders.set('Accept', '*/*');\n\t}\n\n\t// Basic fetch\n\tif (!parsedURL.protocol || !parsedURL.hostname) {\n\t\tthrow new TypeError('Only absolute URLs are supported');\n\t}\n\n\tif (!/^https?:$/.test(parsedURL.protocol)) {\n\t\tthrow new TypeError('Only HTTP(S) protocols are supported');\n\t}\n\n\tif (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) {\n\t\tthrow new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8');\n\t}\n\n\t// HTTP-network-or-cache fetch steps 2.4-2.7\n\tlet contentLengthValue = null;\n\tif (request.body == null && /^(POST|PUT)$/i.test(request.method)) {\n\t\tcontentLengthValue = '0';\n\t}\n\tif (request.body != null) {\n\t\tconst totalBytes = getTotalBytes(request);\n\t\tif (typeof totalBytes === 'number') {\n\t\t\tcontentLengthValue = String(totalBytes);\n\t\t}\n\t}\n\tif (contentLengthValue) {\n\t\theaders.set('Content-Length', contentLengthValue);\n\t}\n\n\t// HTTP-network-or-cache fetch step 2.11\n\tif (!headers.has('User-Agent')) {\n\t\theaders.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)');\n\t}\n\n\t// HTTP-network-or-cache fetch step 2.15\n\tif (request.compress && !headers.has('Accept-Encoding')) {\n\t\theaders.set('Accept-Encoding', 'gzip,deflate');\n\t}\n\n\tlet agent = request.agent;\n\tif (typeof agent === 'function') {\n\t\tagent = agent(parsedURL);\n\t}\n\n\tif (!headers.has('Connection') && !agent) {\n\t\theaders.set('Connection', 'close');\n\t}\n\n\t// HTTP-network fetch step 4.2\n\t// chunked encoding is handled by Node.js\n\n\treturn Object.assign({}, parsedURL, {\n\t\tmethod: request.method,\n\t\theaders: exportNodeCompatibleHeaders(headers),\n\t\tagent\n\t});\n}\n\n/**\n * abort-error.js\n *\n * AbortError interface for cancelled requests\n */\n\n/**\n * Create AbortError instance\n *\n * @param String message Error message for human\n * @return AbortError\n */\nfunction AbortError(message) {\n Error.call(this, message);\n\n this.type = 'aborted';\n this.message = message;\n\n // hide custom error implementation details from end-users\n Error.captureStackTrace(this, this.constructor);\n}\n\nAbortError.prototype = Object.create(Error.prototype);\nAbortError.prototype.constructor = AbortError;\nAbortError.prototype.name = 'AbortError';\n\n// fix an issue where \"PassThrough\", \"resolve\" aren't a named export for node <10\nconst PassThrough$1 = Stream.PassThrough;\nconst resolve_url = Url.resolve;\n\n/**\n * Fetch function\n *\n * @param Mixed url Absolute url or Request instance\n * @param Object opts Fetch options\n * @return Promise\n */\nfunction fetch(url, opts) {\n\n\t// allow custom promise\n\tif (!fetch.Promise) {\n\t\tthrow new Error('native promise missing, set fetch.Promise to your favorite alternative');\n\t}\n\n\tBody.Promise = fetch.Promise;\n\n\t// wrap http.request into fetch\n\treturn new fetch.Promise(function (resolve, reject) {\n\t\t// build request object\n\t\tconst request = new Request(url, opts);\n\t\tconst options = getNodeRequestOptions(request);\n\n\t\tconst send = (options.protocol === 'https:' ? https : http).request;\n\t\tconst signal = request.signal;\n\n\t\tlet response = null;\n\n\t\tconst abort = function abort() {\n\t\t\tlet error = new AbortError('The user aborted a request.');\n\t\t\treject(error);\n\t\t\tif (request.body && request.body instanceof Stream.Readable) {\n\t\t\t\trequest.body.destroy(error);\n\t\t\t}\n\t\t\tif (!response || !response.body) return;\n\t\t\tresponse.body.emit('error', error);\n\t\t};\n\n\t\tif (signal && signal.aborted) {\n\t\t\tabort();\n\t\t\treturn;\n\t\t}\n\n\t\tconst abortAndFinalize = function abortAndFinalize() {\n\t\t\tabort();\n\t\t\tfinalize();\n\t\t};\n\n\t\t// send request\n\t\tconst req = send(options);\n\t\tlet reqTimeout;\n\n\t\tif (signal) {\n\t\t\tsignal.addEventListener('abort', abortAndFinalize);\n\t\t}\n\n\t\tfunction finalize() {\n\t\t\treq.abort();\n\t\t\tif (signal) signal.removeEventListener('abort', abortAndFinalize);\n\t\t\tclearTimeout(reqTimeout);\n\t\t}\n\n\t\tif (request.timeout) {\n\t\t\treq.once('socket', function (socket) {\n\t\t\t\treqTimeout = setTimeout(function () {\n\t\t\t\t\treject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout'));\n\t\t\t\t\tfinalize();\n\t\t\t\t}, request.timeout);\n\t\t\t});\n\t\t}\n\n\t\treq.on('error', function (err) {\n\t\t\treject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));\n\t\t\tfinalize();\n\t\t});\n\n\t\treq.on('response', function (res) {\n\t\t\tclearTimeout(reqTimeout);\n\n\t\t\tconst headers = createHeadersLenient(res.headers);\n\n\t\t\t// HTTP fetch step 5\n\t\t\tif (fetch.isRedirect(res.statusCode)) {\n\t\t\t\t// HTTP fetch step 5.2\n\t\t\t\tconst location = headers.get('Location');\n\n\t\t\t\t// HTTP fetch step 5.3\n\t\t\t\tconst locationURL = location === null ? null : resolve_url(request.url, location);\n\n\t\t\t\t// HTTP fetch step 5.5\n\t\t\t\tswitch (request.redirect) {\n\t\t\t\t\tcase 'error':\n\t\t\t\t\t\treject(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${request.url}`, 'no-redirect'));\n\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\treturn;\n\t\t\t\t\tcase 'manual':\n\t\t\t\t\t\t// node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL.\n\t\t\t\t\t\tif (locationURL !== null) {\n\t\t\t\t\t\t\t// handle corrupted header\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\theaders.set('Location', locationURL);\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\t// istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request\n\t\t\t\t\t\t\t\treject(err);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'follow':\n\t\t\t\t\t\t// HTTP-redirect fetch step 2\n\t\t\t\t\t\tif (locationURL === null) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 5\n\t\t\t\t\t\tif (request.counter >= request.follow) {\n\t\t\t\t\t\t\treject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect'));\n\t\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 6 (counter increment)\n\t\t\t\t\t\t// Create a new Request object.\n\t\t\t\t\t\tconst requestOpts = {\n\t\t\t\t\t\t\theaders: new Headers(request.headers),\n\t\t\t\t\t\t\tfollow: request.follow,\n\t\t\t\t\t\t\tcounter: request.counter + 1,\n\t\t\t\t\t\t\tagent: request.agent,\n\t\t\t\t\t\t\tcompress: request.compress,\n\t\t\t\t\t\t\tmethod: request.method,\n\t\t\t\t\t\t\tbody: request.body,\n\t\t\t\t\t\t\tsignal: request.signal,\n\t\t\t\t\t\t\ttimeout: request.timeout,\n\t\t\t\t\t\t\tsize: request.size\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 9\n\t\t\t\t\t\tif (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {\n\t\t\t\t\t\t\treject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));\n\t\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 11\n\t\t\t\t\t\tif (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') {\n\t\t\t\t\t\t\trequestOpts.method = 'GET';\n\t\t\t\t\t\t\trequestOpts.body = undefined;\n\t\t\t\t\t\t\trequestOpts.headers.delete('content-length');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 15\n\t\t\t\t\t\tresolve(fetch(new Request(locationURL, requestOpts)));\n\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// prepare response\n\t\t\tres.once('end', function () {\n\t\t\t\tif (signal) signal.removeEventListener('abort', abortAndFinalize);\n\t\t\t});\n\t\t\tlet body = res.pipe(new PassThrough$1());\n\n\t\t\tconst response_options = {\n\t\t\t\turl: request.url,\n\t\t\t\tstatus: res.statusCode,\n\t\t\t\tstatusText: res.statusMessage,\n\t\t\t\theaders: headers,\n\t\t\t\tsize: request.size,\n\t\t\t\ttimeout: request.timeout,\n\t\t\t\tcounter: request.counter\n\t\t\t};\n\n\t\t\t// HTTP-network fetch step 12.1.1.3\n\t\t\tconst codings = headers.get('Content-Encoding');\n\n\t\t\t// HTTP-network fetch step 12.1.1.4: handle content codings\n\n\t\t\t// in following scenarios we ignore compression support\n\t\t\t// 1. compression support is disabled\n\t\t\t// 2. HEAD request\n\t\t\t// 3. no Content-Encoding header\n\t\t\t// 4. no content response (204)\n\t\t\t// 5. content not modified response (304)\n\t\t\tif (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) {\n\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// For Node v6+\n\t\t\t// Be less strict when decoding compressed responses, since sometimes\n\t\t\t// servers send slightly invalid responses that are still accepted\n\t\t\t// by common browsers.\n\t\t\t// Always using Z_SYNC_FLUSH is what cURL does.\n\t\t\tconst zlibOptions = {\n\t\t\t\tflush: zlib.Z_SYNC_FLUSH,\n\t\t\t\tfinishFlush: zlib.Z_SYNC_FLUSH\n\t\t\t};\n\n\t\t\t// for gzip\n\t\t\tif (codings == 'gzip' || codings == 'x-gzip') {\n\t\t\t\tbody = body.pipe(zlib.createGunzip(zlibOptions));\n\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// for deflate\n\t\t\tif (codings == 'deflate' || codings == 'x-deflate') {\n\t\t\t\t// handle the infamous raw deflate response from old servers\n\t\t\t\t// a hack for old IIS and Apache servers\n\t\t\t\tconst raw = res.pipe(new PassThrough$1());\n\t\t\t\traw.once('data', function (chunk) {\n\t\t\t\t\t// see http://stackoverflow.com/questions/37519828\n\t\t\t\t\tif ((chunk[0] & 0x0F) === 0x08) {\n\t\t\t\t\t\tbody = body.pipe(zlib.createInflate());\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbody = body.pipe(zlib.createInflateRaw());\n\t\t\t\t\t}\n\t\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\t\tresolve(response);\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// for br\n\t\t\tif (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') {\n\t\t\t\tbody = body.pipe(zlib.createBrotliDecompress());\n\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// otherwise, use response as-is\n\t\t\tresponse = new Response(body, response_options);\n\t\t\tresolve(response);\n\t\t});\n\n\t\twriteToStream(req, request);\n\t});\n}\n/**\n * Redirect code matching\n *\n * @param Number code Status code\n * @return Boolean\n */\nfetch.isRedirect = function (code) {\n\treturn code === 301 || code === 302 || code === 303 || code === 307 || code === 308;\n};\n\n// expose Promise\nfetch.Promise = global.Promise;\n\nexport default fetch;\nexport { Headers, Request, Response, FetchError };\n","var nodeFetch = require('node-fetch')\nvar realFetch = nodeFetch.default || nodeFetch\n\nvar fetch = function (url, options) {\n // Support schemaless URIs on the server for parity with the browser.\n // Ex: //github.com/ -> https://github.com/\n if (/^\\/\\//.test(url)) {\n url = 'https:' + url\n }\n return realFetch.call(this, url, options)\n}\n\nmodule.exports = exports = fetch\nexports.fetch = fetch\nexports.Headers = nodeFetch.Headers\nexports.Request = nodeFetch.Request\nexports.Response = nodeFetch.Response\n\n// Needed for TypeScript consumers without esModuleInterop.\nexports.default = fetch\n","import fetch from \"cross-fetch\";\nimport JSBI from \"jsbi\";\n\nfunction mergeOptions(overrideOptions, defaultOptions) {\n defaultOptions = defaultOptions || {};\n const headers = Object.assign(\n {},\n defaultOptions.headers || {},\n overrideOptions.headers || {}\n );\n return Object.assign({}, defaultOptions, overrideOptions, {\n headers: headers\n });\n}\n\nconst batchHandler = {\n get: (target, method, receiver) => {\n if (method === \"send\") {\n return async () => {\n const response = await fetch(\n target.uri,\n mergeOptions(\n {\n method: \"post\",\n headers: {\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify(target.payload)\n },\n target.defaultOptions\n )\n );\n return await response.json();\n };\n }\n return (...params) => {\n const id = target.id;\n target.id = target.id + 1;\n target.payload.push({\n jsonrpc: \"2.0\",\n id: id,\n method: method,\n params: params\n });\n return receiver;\n };\n }\n};\n\nconst handler = {\n get: (target, method) => {\n if (method === \"batch\") {\n return () => {\n return new Proxy(\n {\n id: Math.round(Math.random() * 10000000),\n payload: [],\n uri: target.uri,\n defaultOptions: target.defaultOptions\n },\n batchHandler\n );\n };\n }\n return async (...params) => {\n const id = Math.round(Math.random() * 10000000);\n const response = await fetch(\n target.uri,\n mergeOptions(\n {\n method: \"post\",\n headers: {\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({\n jsonrpc: \"2.0\",\n id: id,\n method: method,\n params: params\n })\n },\n target.defaultOptions\n )\n );\n const data = await response.json();\n if (data.id !== id) {\n throw new Error(\"JSONRPCError: response ID does not match request ID!\");\n }\n if (data.error) {\n throw new Error(\n `JSONRPCError: server error ${JSON.stringify(data.error)}`\n );\n }\n return data.result;\n };\n }\n};\n\nexport class RPC {\n constructor(uri, defaultOptions = {}) {\n this.uri = uri;\n this.defaultOptions = defaultOptions;\n return new Proxy(this, handler);\n }\n\n static create(uri) {\n return new RPC(uri);\n }\n}\n\nexport function HexStringToBigInt(hexString) {\n return JSBI.BigInt(hexString);\n}\n\nexport function BigIntToHexString(bigInt) {\n return \"0x\" + bigInt.toString(16);\n}\n","// This package provides normalizer functions. Even though CKB uses molecule\n// as the serialization layer. There is still CKB specific knowledge that does\n// not belong in molecule. For example, all numbers in CKB protocols are\n// serialized using little endian format. This package tries to encode such\n// knowledge. The goal here, is that you are free to use whatever types that\n// makes most sense to represent the values. As long as you pass your object\n// through the normalizers here, molecule should be able to serialize the values\n// into correct formats required by CKB.\n//\n// Note this is only used when you need to deal with CKB structures in molecule\n// format. If you are using RPCs or GraphQL to interact with CKB, chances are you\n// will not need this package.\nimport JSBI from \"jsbi\";\nimport { Reader } from \"./reader\";\nimport { BigIntToHexString } from \"./rpc\";\n\nfunction normalizeHexNumber(length) {\n return function(debugPath, value) {\n if (!(value instanceof ArrayBuffer)) {\n let intValue = BigIntToHexString(JSBI.BigInt(value)).substr(2);\n if (intValue.length % 2 !== 0) {\n intValue = \"0\" + intValue;\n }\n if (intValue.length / 2 > length) {\n throw new Error(\n `${debugPath} is ${intValue.length /\n 2} bytes long, expected length is ${length}!`\n );\n }\n const view = new DataView(new ArrayBuffer(length));\n for (let i = 0; i < intValue.length / 2; i++) {\n const start = intValue.length - (i + 1) * 2;\n view.setUint8(i, parseInt(intValue.substr(start, 2), 16));\n }\n value = view.buffer;\n }\n if (value.byteLength < length) {\n const array = new Uint8Array(length);\n array.set(new Uint8Array(value), 0);\n value = array.buffer;\n }\n return value;\n };\n}\n\nfunction normalizeRawData(length) {\n return function(debugPath, value) {\n value = new Reader(value).toArrayBuffer();\n if (length > 0 && value.byteLength !== length) {\n throw new Error(\n `${debugPath} has invalid length ${value.byteLength}, required: ${length}`\n );\n }\n return value;\n };\n}\n\nfunction normalizeObject(debugPath, object, keys) {\n const result = {};\n\n for (const [key, f] of Object.entries(keys)) {\n const value = object[key];\n if (!value) {\n throw new Error(`${debugPath} is missing ${key}!`);\n }\n result[key] = f(`${debugPath}.${key}`, value);\n }\n return result;\n}\n\nexport function NormalizeScript(script, { debugPath = \"script\" } = {}) {\n return normalizeObject(debugPath, script, {\n code_hash: normalizeRawData(32),\n hash_type: function(debugPath, value) {\n switch (value) {\n case \"data\":\n return 0;\n case \"type\":\n return 1;\n case 0:\n return value;\n case 1:\n return value;\n default:\n throw new Error(`${debugPath}.hash_type has invalid value: ${value}`);\n }\n },\n args: normalizeRawData(-1)\n });\n}\n\nexport function NormalizeOutPoint(outPoint, { debugPath = \"out_point\" } = {}) {\n return normalizeObject(debugPath, outPoint, {\n tx_hash: normalizeRawData(32),\n index: normalizeHexNumber(4)\n });\n}\n\nfunction toNormalize(normalize) {\n return function(debugPath, value) {\n return normalize(value, {\n debugPath\n });\n };\n}\n\nexport function NormalizeCellInput(\n cellInput,\n { debugPath = \"cell_input\" } = {}\n) {\n return normalizeObject(debugPath, cellInput, {\n since: normalizeHexNumber(8),\n previous_output: toNormalize(NormalizeOutPoint)\n });\n}\n\nexport function NormalizeCellOutput(\n cellOutput,\n { debugPath = \"cell_output\" } = {}\n) {\n const result = normalizeObject(debugPath, cellOutput, {\n capacity: normalizeHexNumber(8),\n lock: toNormalize(NormalizeScript)\n });\n if (cellOutput.type) {\n result.type_ = NormalizeScript(cellOutput.type, {\n debugPath: `${debugPath}.type`\n });\n }\n return result;\n}\n\nexport function NormalizeCellDep(cellDep, { debugPath = \"cell_dep\" } = {}) {\n return normalizeObject(debugPath, cellDep, {\n out_point: toNormalize(NormalizeOutPoint),\n dep_type: function(debugPath, value) {\n switch (value) {\n case \"code\":\n return 0;\n case \"dep_group\":\n return 1;\n case 0:\n return value;\n case 1:\n return value;\n default:\n throw new Error(`${debugPath}.dep_type has invalid value: ${value}`);\n }\n }\n });\n}\n\nfunction toNormalizeArray(normalizeFunction) {\n return function(debugPath, array) {\n return array.map((item, i) => {\n return normalizeFunction(`${debugPath}[${i}]`, item);\n });\n };\n}\n\nexport function NormalizeRawTransaction(\n rawTransaction,\n { debugPath = \"raw_transaction\" } = {}\n) {\n return normalizeObject(debugPath, rawTransaction, {\n version: normalizeHexNumber(4),\n cell_deps: toNormalizeArray(toNormalize(NormalizeCellDep)),\n header_deps: toNormalizeArray(normalizeRawData(32)),\n inputs: toNormalizeArray(toNormalize(NormalizeCellInput)),\n outputs: toNormalizeArray(toNormalize(NormalizeCellOutput)),\n outputs_data: toNormalizeArray(normalizeRawData(-1))\n });\n}\n\nexport function NormalizeTransaction(\n transaction,\n { debugPath = \"transaction\" } = {}\n) {\n const rawTransaction = NormalizeRawTransaction(transaction, {\n debugPath: `(raw)${debugPath}`\n });\n const result = normalizeObject(debugPath, transaction, {\n witnesses: toNormalizeArray(normalizeRawData(-1))\n });\n result.raw = rawTransaction;\n return result;\n}\n\nexport function NormalizeRawHeader(\n rawHeader,\n { debugPath = \"raw_header\" } = {}\n) {\n return normalizeObject(debugPath, rawHeader, {\n version: normalizeHexNumber(4),\n compact_target: normalizeHexNumber(4),\n timestamp: normalizeHexNumber(8),\n number: normalizeHexNumber(8),\n epoch: normalizeHexNumber(8),\n parent_hash: normalizeRawData(32),\n transactions_root: normalizeRawData(32),\n proposals_hash: normalizeRawData(32),\n uncles_hash: normalizeRawData(32),\n dao: normalizeRawData(32)\n });\n}\n\nexport function NormalizeHeader(header, { debugPath = \"header\" } = {}) {\n const rawHeader = NormalizeRawHeader(header, {\n debugPath: `(raw)${debugPath}`\n });\n const result = normalizeObject(debugPath, header, {\n nonce: normalizeHexNumber(16)\n });\n result.raw = rawHeader;\n return result;\n}\n\nexport function NormalizeUncleBlock(\n uncleBlock,\n { debugPath = \"uncle_block\" } = {}\n) {\n return normalizeObject(debugPath, uncleBlock, {\n header: toNormalize(NormalizeHeader),\n proposals: toNormalizeArray(normalizeRawData(10))\n });\n}\n\nexport function NormalizeBlock(block, { debugPath = \"block\" } = {}) {\n return normalizeObject(debugPath, block, {\n header: toNormalize(NormalizeHeader),\n uncles: toNormalizeArray(toNormalize(NormalizeUncleBlock)),\n transactions: toNormalizeArray(toNormalize(NormalizeTransaction)),\n proposals: toNormalizeArray(normalizeRawData(10))\n });\n}\n\nexport function NormalizeCellbaseWitness(\n cellbaseWitness,\n { debugPath = \"cellbase_witness\" } = {}\n) {\n return normalizeObject(debugPath, cellbaseWitness, {\n lock: toNormalize(NormalizeScript),\n message: normalizeRawData(-1)\n });\n}\n\nexport function NormalizeWitnessArgs(\n witnessArgs,\n { debugPath = \"witness_args\" } = {}\n) {\n const result = {};\n if (witnessArgs.lock) {\n result.lock = normalizeRawData(-1)(`${debugPath}.lock`, witnessArgs.lock);\n }\n if (witnessArgs.input_type) {\n result.input_type = normalizeRawData(-1)(\n `${debugPath}.input_type`,\n witnessArgs.input_type\n );\n }\n if (witnessArgs.output_type) {\n result.output_type = normalizeRawData(-1)(\n `${debugPath}.output_type`,\n witnessArgs.output_type\n );\n }\n return result;\n}\n","// This package provides transformer functions that transform JavaScript objects\n// into JSON ready objects that can be passed to RPC. It following the following\n// rules:\n//\n// 1. If the specified object has a serializeJson method, it would invoke this\n// method and use the result to replace current object.\n// 2. It then restricts the keys of the object to keys required by the specified\n// entity(i.e., a Script would only have code_hash, hash_type, args keys),for each\n// sub-field, it then recursively perform the steps here from step 1.\n// 3. It then optionally run validator functions to ensure the resulting object\n// follows specified rules.\n//\n// Note rule 1 here provides the flexibility in defining your own structures: you\n// could define a class containing custom data structures, then provide a\n// serializeJson that transforms the custom one into the rigid data structure\n// required by CKB. You can also leverage the Reader class we provide as much as\n// possible. Since Reader class does provide serializeJson methods, transformers\n// here will transform them to valid hex strings required by CKB.\nimport * as validators from \"./validators\";\n\nfunction invokeSerializeJson(debugPath, value) {\n if (value instanceof Object && value.serializeJson instanceof Function) {\n return value.serializeJson.call(value);\n }\n return value;\n}\n\nfunction transformObject(debugPath, object, keys) {\n object = invokeSerializeJson(debugPath, object);\n if (!(object instanceof Object)) {\n throw new Error(`Transformed ${debugPath} is not an object!`);\n }\n const result = {};\n\n for (const [key, f] of Object.entries(keys)) {\n let value = object[key];\n if (!value) {\n const camelKey = key.replace(/(_[a-z])/g, group =>\n group.toUpperCase().replace(\"_\", \"\")\n );\n value = object[camelKey];\n }\n if (value) {\n result[key] = f(`${debugPath}.${key}`, value);\n }\n }\n return result;\n}\n\nexport function TransformScript(\n script,\n { validation = true, debugPath = \"script\" } = {}\n) {\n script = transformObject(debugPath, script, {\n code_hash: invokeSerializeJson,\n hash_type: invokeSerializeJson,\n args: invokeSerializeJson\n });\n\n if (validation) {\n validators.ValidateScript(script, {\n debugPath: `(transformed) ${debugPath}`\n });\n }\n return script;\n}\n\nexport function TransformOutPoint(\n outPoint,\n { validation = true, debugPath = \"out_point\" } = {}\n) {\n outPoint = transformObject(debugPath, outPoint, {\n tx_hash: invokeSerializeJson,\n index: invokeSerializeJson\n });\n\n if (validation) {\n validators.ValidateOutPoint(outPoint, {\n debugPath: `(transformed) ${debugPath}`\n });\n }\n return outPoint;\n}\n\nfunction toInvoke(transform) {\n return function(debugPath, value) {\n return transform(value, {\n validation: false,\n debugPath\n });\n };\n}\n\nexport function TransformCellInput(\n cellInput,\n { validation = true, debugPath = \"cell_input\" } = {}\n) {\n cellInput = transformObject(debugPath, cellInput, {\n since: invokeSerializeJson,\n previous_output: toInvoke(TransformOutPoint)\n });\n\n if (validation) {\n validators.ValidateCellInput(cellInput, {\n debugPath: `(transformed) ${debugPath}`\n });\n }\n return cellInput;\n}\n\nexport function TransformCellOutput(\n cellOutput,\n { validation = true, debugPath = \"cell_output\" } = {}\n) {\n cellOutput = transformObject(debugPath, cellOutput, {\n capacity: invokeSerializeJson,\n lock: toInvoke(TransformScript),\n type: toInvoke(TransformScript)\n });\n\n if (validation) {\n validators.ValidateCellOutput(cellOutput, {\n debugPath: `(transformed) ${debugPath}`\n });\n }\n return cellOutput;\n}\n\nexport function TransformCellDep(\n cellDep,\n { validation = true, debugPath = \"cell_dep\" } = {}\n) {\n cellDep = transformObject(debugPath, cellDep, {\n out_point: toInvoke(TransformOutPoint),\n dep_type: invokeSerializeJson\n });\n\n if (validation) {\n validators.ValidateCellDep(cellDep, {\n debugPath: `(transformed) ${debugPath}`\n });\n }\n return cellDep;\n}\n\nfunction toInvokeArray(invokeFunction) {\n return function(debugPath, array) {\n return array.map((item, i) => {\n return invokeFunction(`${debugPath}[${i}]`, item);\n });\n };\n}\n\nexport function TransformRawTransaction(\n rawTransaction,\n { validation = true, debugPath = \"raw_transaction\" } = {}\n) {\n rawTransaction = transformObject(debugPath, rawTransaction, {\n version: invokeSerializeJson,\n cell_deps: toInvokeArray(toInvoke(TransformCellDep)),\n header_deps: toInvokeArray(invokeSerializeJson),\n inputs: toInvokeArray(toInvoke(TransformCellInput)),\n outputs: toInvokeArray(toInvoke(TransformCellOutput)),\n outputs_data: toInvokeArray(invokeSerializeJson)\n });\n\n if (validation) {\n validators.ValidateRawTransaction(rawTransaction, {\n debugPath: `(transformed) ${debugPath}`\n });\n }\n return rawTransaction;\n}\n\nexport function TransformTransaction(\n transaction,\n { validation = true, debugPath = \"transaction\" } = {}\n) {\n transaction = transformObject(debugPath, transaction, {\n version: invokeSerializeJson,\n cell_deps: toInvokeArray(toInvoke(TransformCellDep)),\n header_deps: toInvokeArray(invokeSerializeJson),\n inputs: toInvokeArray(toInvoke(TransformCellInput)),\n outputs: toInvokeArray(toInvoke(TransformCellOutput)),\n outputs_data: toInvokeArray(invokeSerializeJson),\n witnesses: toInvokeArray(invokeSerializeJson)\n });\n\n if (validation) {\n validators.ValidateTransaction(transaction, {\n debugPath: `(transformed) ${debugPath}`\n });\n }\n return transaction;\n}\n\nexport function TransformRawHeader(\n rawHeader,\n { validation = true, debugPath = \"raw_header\" } = {}\n) {\n rawHeader = transformObject(debugPath, rawHeader, {\n version: invokeSerializeJson,\n compact_target: invokeSerializeJson,\n timestamp: invokeSerializeJson,\n number: invokeSerializeJson,\n epoch: invokeSerializeJson,\n parent_hash: invokeSerializeJson,\n transactions_root: invokeSerializeJson,\n proposals_hash: invokeSerializeJson,\n uncles_hash: invokeSerializeJson,\n dao: invokeSerializeJson\n });\n\n if (validation) {\n validators.ValidateRawHeader(rawHeader, {\n debugPath: `(transformed) ${debugPath}`\n });\n }\n return rawHeader;\n}\n\nexport function TransformHeader(\n header,\n { validation = true, debugPath = \"header\" } = {}\n) {\n header = transformObject(debugPath, header, {\n version: invokeSerializeJson,\n compact_target: invokeSerializeJson,\n timestamp: invokeSerializeJson,\n number: invokeSerializeJson,\n epoch: invokeSerializeJson,\n parent_hash: invokeSerializeJson,\n transactions_root: invokeSerializeJson,\n proposals_hash: invokeSerializeJson,\n uncles_hash: invokeSerializeJson,\n dao: invokeSerializeJson,\n nonce: invokeSerializeJson\n });\n\n if (validation) {\n validators.ValidateHeader(header, {\n debugPath: `(transformed) ${debugPath}`\n });\n }\n return header;\n}\n\nexport function TransformUncleBlock(\n uncleBlock,\n { validation = true, debugPath = \"uncle_block\" } = {}\n) {\n uncleBlock = transformObject(debugPath, uncleBlock, {\n header: toInvoke(TransformHeader),\n proposals: toInvokeArray(invokeSerializeJson)\n });\n\n if (validation) {\n validators.ValidateUncleBlock(uncleBlock, {\n debugPath: `(transformed) ${debugPath}`\n });\n }\n return uncleBlock;\n}\n\nexport function TransformBlock(\n block,\n { validation = true, debugPath = \"block\" } = {}\n) {\n block = transformObject(debugPath, block, {\n header: toInvoke(TransformHeader),\n uncles: toInvokeArray(toInvoke(TransformUncleBlock)),\n transactions: toInvokeArray(toInvoke(TransformTransaction)),\n proposals: toInvokeArray(invokeSerializeJson)\n });\n\n if (validation) {\n validators.ValidateBlock(block, {\n debugPath: `(transformed) ${debugPath}`\n });\n }\n return block;\n}\n\nexport function TransformCellbaseWitness(\n cellbaseWitness,\n { validation = true, debugPath = \"cellbase_witness\" } = {}\n) {\n cellbaseWitness = transformObject(debugPath, cellbaseWitness, {\n lock: toInvoke(TransformScript),\n message: invokeSerializeJson\n });\n\n if (validation) {\n validators.ValidateCellbaseWitness(cellbaseWitness, {\n debugPath: `(transformed) ${debugPath}`\n });\n }\n return cellbaseWitness;\n}\n\nexport function TransformWitnessArgs(\n witnessArgs,\n { validation = true, debugPath = \"witness_args\" } = {}\n) {\n witnessArgs = transformObject(debugPath, witnessArgs, {\n lock: invokeSerializeJson,\n input_type: invokeSerializeJson,\n output_type: invokeSerializeJson\n });\n\n if (validation) {\n validators.ValidateWitnessArgs(witnessArgs, {\n debugPath: `(transformed) ${debugPath}`\n });\n }\n return witnessArgs;\n}\n","import JSBI from \"jsbi\";\nimport { Reader } from \"../reader\";\nimport { HexStringToBigInt, BigIntToHexString } from \"../rpc\";\n\nexport class RPCCollector {\n constructor(\n rpc,\n lockHash,\n {\n skipCellWithContent = true,\n loadData = false,\n loadBlockNumber = true\n } = {}\n ) {\n this.rpc = rpc;\n this.lockHash = new Reader(lockHash).serializeJson();\n this.skipCellWithContent = skipCellWithContent;\n this.loadData = loadData;\n this.loadBlockNumber = loadBlockNumber;\n }\n\n async *collect() {\n const to = HexStringToBigInt(await this.rpc.get_tip_block_number());\n let currentFrom = JSBI.BigInt(0);\n while (JSBI.lessThanOrEqual(currentFrom, to)) {\n let currentTo = JSBI.add(currentFrom, JSBI.BigInt(100));\n if (JSBI.greaterThan(currentTo, to)) {\n currentTo = to;\n }\n const cells = await this.rpc.get_cells_by_lock_hash(\n this.lockHash,\n BigIntToHexString(currentFrom),\n BigIntToHexString(currentTo)\n );\n for (const cell of cells) {\n if (this.skipCellWithContent) {\n if (\n cell.type ||\n JSBI.greaterThan(\n HexStringToBigInt(cell.output_data_len),\n JSBI.BigInt(100)\n )\n ) {\n continue;\n }\n }\n let data = null;\n if (this.loadData) {\n const cellWithData = await this.rpc.get_live_cell(\n cell.out_point,\n true\n );\n data = cellWithData.cell.data.content;\n }\n let block_number = null;\n if (this.loadBlockNumber) {\n const header = await this.rpc.get_header(cell.block_hash);\n block_number = header.number;\n }\n yield {\n cellbase: cell.cellbase,\n cell_output: {\n capacity: cell.capacity,\n lock: cell.lock,\n type: cell.type\n },\n out_point: cell.out_point,\n block_hash: cell.block_hash,\n data: data,\n output_data_len: cell.output_data_len,\n block_number\n };\n }\n currentFrom = JSBI.add(currentTo, JSBI.BigInt(1));\n }\n }\n}\n","import JSBI from \"jsbi\";\nimport { Reader } from \"./reader\";\nimport { ValidateTransaction, ValidateOutPoint } from \"./validators\";\n\nexport class TransactionDumper {\n constructor(\n rpc,\n { validateTransaction = true, depGroupUnpacker = null } = {}\n ) {\n this.rpc = rpc;\n this.validateTransaction = validateTransaction;\n this.depGroupUnpacker = depGroupUnpacker;\n }\n\n async dumpByHash(txHash) {\n const tx = (await this.rpc.get_transaction(txHash)).transaction;\n delete tx.hash;\n return await this.dump(tx);\n }\n\n async dump(tx) {\n if (this.validateTransaction) {\n ValidateTransaction(tx);\n }\n const mockInputs = [];\n for (const input of tx.inputs) {\n const { output, data, header } = await this._resolveOutPoint(\n input.previous_output\n );\n mockInputs.push({ input, output, data, header });\n }\n const mockCellDeps = [];\n for (const cellDep of tx.cell_deps) {\n const { output, data, header } = await this._resolveOutPoint(\n cellDep.out_point\n );\n mockCellDeps.push({\n cell_dep: cellDep,\n output,\n data,\n header\n });\n if (cellDep.dep_type === \"dep_group\") {\n if (!this.depGroupUnpacker) {\n throw new Error(\n \"depGroupUnpacker must be provided when the transaction contains dep_group!\"\n );\n }\n const outPoints = this.depGroupUnpacker(new Reader(data));\n for (const outPoint of outPoints) {\n ValidateOutPoint(outPoint);\n const { output, data, header } = await this._resolveOutPoint(\n outPoint\n );\n mockCellDeps.push({\n cell_dep: {\n out_point: outPoint,\n dep_type: \"code\"\n },\n output,\n data,\n header\n });\n }\n }\n }\n const mockHeaderDeps = [];\n for (const headerDep of tx.header_deps) {\n mockHeaderDeps.push(await this.rpc.get_header(headerDep));\n }\n return JSON.stringify({\n mock_info: {\n inputs: mockInputs,\n cell_deps: mockCellDeps,\n header_deps: mockHeaderDeps\n },\n tx\n });\n }\n\n async _resolveOutPoint(out_point) {\n const txStatus = await this.rpc.get_transaction(out_point.tx_hash);\n if (!txStatus || !txStatus.transaction) {\n throw new Error(`Transaction ${out_point.tx_hash} cannot be found!`);\n }\n const tx = txStatus.transaction;\n const index = JSBI.toNumber(JSBI.BigInt(out_point.index));\n if (index >= tx.outputs.length) {\n throw new Error(\n `Transaction ${out_point.tx_hash} does not have output ${index}!`\n );\n }\n const data = {\n output: tx.outputs[index],\n data: tx.outputs_data[index]\n };\n if (txStatus.tx_status.status === \"committed\") {\n data.header = txStatus.tx_status.block_hash;\n }\n return data;\n }\n}\n","export { Reader } from \"./reader.js\";\nexport { TransactionDumper } from \"./transaction_dumper.js\";\nexport { RPC, HexStringToBigInt, BigIntToHexString } from \"./rpc.js\";\nexport * as normalizers from \"./normalizers\";\nexport * as transformers from \"./transformers\";\nexport * as validators from \"./validators\";\nexport * as cell_collectors from \"./cell_collectors\";\nexport const VERSION = \"__development_build__\";\n"],"names":["ArrayBufferReader","constructor","buffer","this","view","DataView","length","byteLength","indexAt","i","getUint8","toArrayBuffer","serializeJson","Array","prototype","map","call","Uint8Array","x","toString","slice","join","HexStringReader","string","parseInt","substr","ArrayBuffer","setUint8","Reader","input","startsWith","Error","static","c","charCodeAt","JSBI","a","b","__kMaxLength","RangeError","super","sign","Math","floor","Number","isFinite","__zero","__oneDigit","__fromDouble","__fromString","SyntaxError","__toPrimitive","BigInt","TypeError","toDebugString","push","__toStringBasePowerOfTwo","__toStringGeneric","clz32","__unsignedDigit","d","__digit","e","f","Infinity","g","h","j","k","l","m","n","o","__decideRounding","p","__kBitConversionInts","__kBitConversionDouble","__copy","__absoluteSubOne","__trim","__absoluteAddOne","unaryMinus","__kMaxLengthBits","__initializeDigits","__setDigit","multiply","__clzmsd","__multiplyAccumulate","__absoluteCompare","__absoluteDivSmall","__absoluteDivLarge","__absoluteModSmall","__absoluteAdd","__absoluteSub","__rightShiftByAbsolute","__leftShiftByAbsolute","__compareToBigInt","equal","max","__absoluteAnd","__absoluteOr","__absoluteAndNot","__absoluteXor","__truncateToNBits","__truncateAndSubFromPowerOfTwo","__toNumeric","__isBigInt","add","__compare","EQ","__equalToNumber","pop","__isWhitespace","__kMaxBitsPerChar","__kBitsPerCharTableMultiplier","__kBitsPerCharTableShift","__fillFromParts","q","__inplaceMultiplyAdd","__kConversionChars","exponentiate","__halfDigit","__setHalfDigit","quotient","remainder","__unequalSign","__absoluteGreater","__absoluteLess","abs","__compareToDouble","__comparisonResultToBool","__compareToNumber","__setDigitGrow","imul","r","s","t","__halfDigitLength","__clz16","__specialLeftShift","__internalMultiplyAdd","__inplaceSub","__inplaceAdd","__inplaceRightShift","__toShiftAmount","__rightShiftByMaximum","Symbol","toPrimitive","valueOf","min","assertObjectWithKeys","debugPath","object","expectedKeys","optionalKeys","Object","assertObject","providedKeys","keys","sort","requiredLength","maximalLength","errorMessage","optionalProvidedKeys","filter","key","includes","find","assertHexString","test","assertHash","hash","assertInteger","ValidateScript","script","nestedValidation","code_hash","args","hash_type","ValidateOutPoint","outPoint","tx_hash","index","ValidateCellInput","cellInput","since","previous_output","ValidateCellOutput","cellOutput","capacity","lock","type","ValidateCellDep","cellDep","dep_type","out_point","assertArray","array","validateFunction","isArray","toAssert","value","assertCommonTransaction","rawTransaction","version","cell_deps","header_deps","inputs","outputs","outputs_data","ValidateRawTransaction","ValidateTransaction","transaction","witnesses","ValidateRawHeader","rawHeader","compact_target","timestamp","number","epoch","parent_hash","transactions_root","proposals_hash","uncles_hash","dao","assertCommonHeader","ValidateHeader","header","nonce","assertProposalShortId","shortId","ValidateUncleBlock","uncleBlock","proposals","ValidateBlock","block","uncles","transactions","ValidateCellbaseWitness","cellbaseWitness","message","ValidateWitnessArgs","witnessArgs","input_type","output_type","__kBitConversionBuffer","Float64Array","Int32Array","Readable","Stream","BUFFER","TYPE","Blob","blobParts","arguments","options","buffers","size","element","Buffer","isView","from","byteOffset","String","concat","undefined","toLowerCase","text","Promise","resolve","arrayBuffer","buf","ab","stream","readable","_read","start","end","relativeStart","relativeEnd","span","slicedBuffer","blob","FetchError","systemError","code","errno","captureStackTrace","convert","defineProperties","enumerable","defineProperty","toStringTag","writable","configurable","create","name","require","INTERNALS","PassThrough","Body","body","_this","_ref","_ref$size","_ref$timeout","timeout","isURLSearchParams","isBlob","isBuffer","disturbed","error","on","err","url","consumeBody","_this4","reject","alloc","accum","accumBytes","abort","resTimeout","setTimeout","chunk","clearTimeout","obj","append","delete","get","getAll","has","set","clone","instance","p1","p2","bodyUsed","getBoundary","pipe","extractContentType","getTotalBytes","getLengthSync","_lengthRetrievers","hasKnownLength","then","ct","headers","assign","json","_this2","JSON","parse","textConverted","_this3","res","str","charset","exec","convertBody","mixIn","proto","getOwnPropertyNames","desc","getOwnPropertyDescriptor","global","invalidTokenRegex","invalidHeaderCharRegex","validateName","validateValue","MAP","Headers","init","rawHeaders","raw","headerNames","headerName","method","iterator","pairs","pair","forEach","callback","thisArg","getHeaders","_pairs$i","createHeadersIterator","values","kind","entries","INTERNAL","target","HeadersIteratorPrototype","setPrototypeOf","next","getPrototypeOf","_INTERNAL","done","exportNodeCompatibleHeaders","__proto__","hostHeaderKey","INTERNALS$1","STATUS_CODES","http","Response","opts","status","contentType","statusText","counter","ok","redirected","INTERNALS$2","parse_url","Url","format_url","format","streamDestructionSupported","isRequest","Request","parsedURL","href","toUpperCase","inputBody","signal","isAbortSignal","redirect","follow","compress","agent","AbortError","PassThrough$1","resolve_url","fetch","request","protocol","hostname","contentLengthValue","totalBytes","getNodeRequestOptions","send","https","response","destroy","emit","aborted","abortAndFinalize","finalize","req","reqTimeout","removeEventListener","addEventListener","once","socket","val","createHeadersLenient","isRedirect","statusCode","location","locationURL","requestOpts","response_options","statusMessage","codings","zlibOptions","flush","zlib","Z_SYNC_FLUSH","finishFlush","createGunzip","createBrotliDecompress","createInflate","createInflateRaw","dest","write","writeToStream","realFetch","nodeFetch","default","module","exports","mergeOptions","overrideOptions","defaultOptions","batchHandler","receiver","async","uri","stringify","payload","params","id","jsonrpc","handler","Proxy","round","random","data","result","RPC","HexStringToBigInt","hexString","BigIntToHexString","bigInt","normalizeHexNumber","intValue","normalizeRawData","normalizeObject","NormalizeScript","NormalizeOutPoint","toNormalize","normalize","NormalizeCellInput","NormalizeCellOutput","type_","NormalizeCellDep","toNormalizeArray","normalizeFunction","item","NormalizeRawTransaction","NormalizeTransaction","NormalizeRawHeader","NormalizeHeader","NormalizeUncleBlock","invokeSerializeJson","Function","transformObject","replace","group","TransformScript","validation","validators.ValidateScript","TransformOutPoint","validators.ValidateOutPoint","toInvoke","transform","TransformCellInput","validators.ValidateCellInput","TransformCellOutput","validators.ValidateCellOutput","TransformCellDep","validators.ValidateCellDep","toInvokeArray","invokeFunction","TransformTransaction","validators.ValidateTransaction","TransformHeader","validators.ValidateHeader","TransformUncleBlock","validators.ValidateUncleBlock","validators.ValidateRawTransaction","validators.ValidateRawHeader","validators.ValidateBlock","validators.ValidateCellbaseWitness","validators.ValidateWitnessArgs","rpc","lockHash","skipCellWithContent","loadData","loadBlockNumber","to","get_tip_block_number","currentFrom","lessThanOrEqual","currentTo","greaterThan","cells","get_cells_by_lock_hash","cell","output_data_len","get_live_cell","content","block_number","get_header","block_hash","cellbase","cell_output","validateTransaction","depGroupUnpacker","txHash","tx","get_transaction","dump","mockInputs","output","_resolveOutPoint","mockCellDeps","cell_dep","outPoints","mockHeaderDeps","headerDep","mock_info","txStatus","toNumber","tx_status"],"mappings":"mRAAA,MAAMA,EACJC,YAAYC,GACVC,KAAKC,KAAO,IA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AAO/O,KAAKyI,UAAU,CACpBuG,UAAW,CACThY,OAAQwX,EACR1X,UAAW6X,EACX5X,YAAa+X,GAEfT,GAAAA,IAIJ9F,uBAAuBnS,GACrB,MAAM6Y,QAAiB7kB,KAAKwiB,IAAI0B,gBAAgBlY,EAAUd,SAC1D,IAAK2Z,IAAaA,EAAS5X,YACzB,MAAM,IAAIrL,MAAM,eAAeoK,EAAUd,4BAE3C,MAAM+Y,EAAKY,EAAS5X,YACd9B,EAAQnJ,EAAK8iB,SAAS9iB,EAAKiB,OAAO+I,EAAUb,QAClD,GAAIA,GAAS8Y,EAAGpX,QAAQ1M,OACtB,MAAM,IAAIyB,MACR,eAAeoK,EAAUd,gCAAgCC,MAG7D,MAAM2T,EAAO,CACXuF,OAAQJ,EAAGpX,QAAQ1B,GACnB2T,KAAMmF,EAAGnX,aAAa3B,IAKxB,MAHkC,cAA9B0Z,EAASE,UAAU5L,SACrB2F,EAAK9Q,OAAS6W,EAASE,UAAUpB,YAE5B7E,oBC5FY"} \ No newline at end of file diff --git a/packages/core/lib/ckb-js-toolkit.umd.js b/packages/core/lib/ckb-js-toolkit.umd.js new file mode 100644 index 000000000..cc6338a8a --- /dev/null +++ b/packages/core/lib/ckb-js-toolkit.umd.js @@ -0,0 +1 @@ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).CKBJSToolkit={})}(this,(function(t){"use strict";class e{constructor(t){this.view=new DataView(t)}length(){return this.view.byteLength}indexAt(t){return this.view.getUint8(t)}toArrayBuffer(){return this.view.buffer}serializeJson(){return"0x"+Array.prototype.map.call(new Uint8Array(this.view.buffer),(t=>("00"+t.toString(16)).slice(-2))).join("")}}class r{constructor(t){this.string=t}length(){return this.string.length/2-1}indexAt(t){return parseInt(this.string.substr(2+2*t,2),16)}toArrayBuffer(){const t=new ArrayBuffer(this.length()),e=new DataView(t);for(let t=0;t255)throw new Error("fromRawString can only accept UTF-8 raw string!");n.setUint8(e,r)}return new e(r)}}var i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function o(t,e,r){return t(r={path:e,exports:{},require:function(t,e){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==e&&r.path)}},r.exports),r.exports}var a=o((function(t,e){t.exports=function(){function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}function e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){for(var r,n=0;nt.length)&&(e=t.length);for(var r=0,n=Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw o}}}}var v=function(r){var o=Math.abs,a=Math.max,u=Math.imul,s=Math.clz32;function _(t,r){var n;if(e(this,_),t>_.__kMaxLength)throw new RangeError("Maximum BigInt size exceeded");return(n=l.call(this,t)).sign=r,n}i(_,r);var l=h(_);return n(_,[{key:"toDebugString",value:function(){var t,e=["BigInt["],r=p(this);try{for(r.s();!(t=r.n()).done;){var n=t.value;e.push((n?(n>>>0).toString(16):n)+", ")}}catch(t){r.e(t)}finally{r.f()}return e.push("]"),e.join("")}},{key:"toString",value:function(){var t=0t||36this.length&&(r=this.length);for(var n=65535&t,i=t>>>16,o=0,a=65535&e,s=e>>>16,_=0;_>>16,h=u(f,n),g=u(f,i),d=u(c,n),p=u(c,i),v=a+(65535&h),y=s+o+(v>>>16)+(h>>>16)+(65535&g)+(65535&d);o=(a=(g>>>16)+(d>>>16)+(65535&p)+(y>>>16))>>>16,a&=65535,s=p>>>16,this.__setDigit(_,65535&v|y<<16)}if(0!==o||0!==a||0!==s)throw new Error("implementation bug")}},{key:"__inplaceAdd",value:function(t,e,r){for(var n,i=0,o=0;o>>16,this.__setHalfDigit(e+o,n);return i}},{key:"__inplaceSub",value:function(t,e,r){var n=0;if(1&e){e>>=1;for(var i=this.__digit(e),o=65535&i,a=0;a>>1;a++){var u=t.__digit(a),s=(i>>>16)-(65535&u)-n;n=1&s>>>16,this.__setDigit(e+a,s<<16|65535&o),n=1&(o=(65535&(i=this.__digit(e+a+1)))-(u>>>16)-n)>>>16}var _=t.__digit(a),l=(i>>>16)-(65535&_)-n;if(n=1&l>>>16,this.__setDigit(e+a,l<<16|65535&o),e+a+1>=this.length)throw new RangeError("out of bounds");0==(1&r)&&(n=1&(o=(65535&(i=this.__digit(e+a+1)))-(_>>>16)-n)>>>16,this.__setDigit(e+t.length,4294901760&i|65535&o))}else{e>>=1;for(var f=0;f>>16)-(h>>>16)-(n=1&g>>>16);n=1&d>>>16,this.__setDigit(e+f,d<<16|65535&g)}var p=this.__digit(e+f),v=t.__digit(f),y=(65535&p)-(65535&v)-n;n=1&y>>>16;var b=0;0==(1&r)&&(n=1&(b=(p>>>16)-(v>>>16)-n)>>>16),this.__setDigit(e+f,b<<16|65535&y)}return n}},{key:"__inplaceRightShift",value:function(t){if(0!==t){for(var e,r=this.__digit(0)>>>t,n=this.length-1,i=0;i>>t;this.__setDigit(n,r)}}},{key:"__digit",value:function(t){return this[t]}},{key:"__unsignedDigit",value:function(t){return this[t]>>>0}},{key:"__setDigit",value:function(t,e){this[t]=0|e}},{key:"__setDigitGrow",value:function(t,e){this[t]=0|e}},{key:"__halfDigitLength",value:function(){var t=this.length;return 65535>=this.__unsignedDigit(t-1)?2*t-1:2*t}},{key:"__halfDigit",value:function(t){return 65535&this[t>>>1]>>>((1&t)<<4)}},{key:"__setHalfDigit",value:function(t,e){var r=t>>>1,n=this.__digit(r),i=1&t?65535&n|e<<16:4294901760&n|65535&e;this.__setDigit(r,i)}}],[{key:"BigInt",value:function(e){var r=Math.floor,n=Number.isFinite;if("number"==typeof e){if(0===e)return _.__zero();if((0|e)===e)return 0>e?_.__oneDigit(-e,!0):_.__oneDigit(e,!1);if(!n(e)||r(e)!==e)throw new RangeError("The number "+e+" cannot be converted to BigInt because it is not an integer");return _.__fromDouble(e)}if("string"==typeof e){var i=_.__fromString(e);if(null===i)throw new SyntaxError("Cannot convert "+e+" to a BigInt");return i}if("boolean"==typeof e)return!0===e?_.__oneDigit(1,!1):_.__zero();if("object"===t(e)){if(e.constructor===_)return e;var o=_.__toPrimitive(e);return _.BigInt(o)}throw new TypeError("Cannot convert "+e+" to a BigInt")}},{key:"toNumber",value:function(t){var e=t.length;if(0===e)return 0;if(1===e){var r=t.__unsignedDigit(0);return t.sign?-r:r}var n=t.__digit(e-1),i=s(n),o=32*e-i;if(1024>>=12;var h=f-12,g=12<=f?0:u<<20+f,d=20+f;0>>32-h,g=u<>>32-d,d-=32);var p=_.__decideRounding(t,d,l,u);if((1===p||0===p&&1==(1&g))&&0==(g=g+1>>>0)&&0!=++c>>>20&&(c=0,1023<++a))return t.sign?-1/0:1/0;var v=t.sign?-2147483648:0;return a=a+1023<<20,_.__kBitConversionInts[1]=v|a|c,_.__kBitConversionInts[0]=g,_.__kBitConversionDouble[0]}},{key:"unaryMinus",value:function(t){if(0===t.length)return t;var e=t.__copy();return e.sign=!t.sign,e}},{key:"bitwiseNot",value:function(t){return t.sign?_.__absoluteSubOne(t).__trim():_.__absoluteAddOne(t,!0)}},{key:"exponentiate",value:function(t,e){if(e.sign)throw new RangeError("Exponent must be positive");if(0===e.length)return _.__oneDigit(1,!1);if(0===t.length)return t;if(1===t.length&&1===t.__digit(0))return t.sign&&0==(1&e.__digit(0))?_.unaryMinus(t):t;if(1=_.__kMaxLengthBits)throw new RangeError("BigInt too big");if(1===t.length&&2===t.__digit(0)){var n=1+(r>>>5),i=new _(n,t.sign&&0!=(1&r));i.__initializeDigits();var o=1<<(31&r);return i.__setDigit(n-1,o),i}var a=null,u=t;for(0!=(1&r)&&(a=t),r>>=1;0!==r;r>>=1)u=_.multiply(u,u),0!=(1&r)&&(a=null===a?u:_.multiply(a,u));return a}},{key:"multiply",value:function(t,e){if(0===t.length)return t;if(0===e.length)return e;var r=t.length+e.length;32<=t.__clzmsd()+e.__clzmsd()&&r--;var n=new _(r,t.sign!==e.sign);n.__initializeDigits();for(var i=0;i_.__absoluteCompare(t,e))return _.__zero();var r,n=t.sign!==e.sign,i=e.__unsignedDigit(0);if(1===e.length&&65535>=i){if(1===i)return n===t.sign?t:_.unaryMinus(t);r=_.__absoluteDivSmall(t,i,null)}else r=_.__absoluteDivLarge(t,e,!0,!1);return r.sign=n,r.__trim()}},{key:"remainder",value:function(t,e){if(0===e.length)throw new RangeError("Division by zero");if(0>_.__absoluteCompare(t,e))return t;var r=e.__unsignedDigit(0);if(1===e.length&&65535>=r){if(1===r)return _.__zero();var n=_.__absoluteModSmall(t,r);return 0===n?_.__zero():_.__oneDigit(n,t.sign)}var i=_.__absoluteDivLarge(t,e,!1,!0);return i.sign=t.sign,i.__trim()}},{key:"add",value:function(t,e){var r=t.sign;return r===e.sign?_.__absoluteAdd(t,e,r):0<=_.__absoluteCompare(t,e)?_.__absoluteSub(t,e,r):_.__absoluteSub(e,t,!r)}},{key:"subtract",value:function(t,e){var r=t.sign;return r===e.sign?0<=_.__absoluteCompare(t,e)?_.__absoluteSub(t,e,r):_.__absoluteSub(e,t,!r):_.__absoluteAdd(t,e,r)}},{key:"leftShift",value:function(t,e){return 0===e.length||0===t.length?t:e.sign?_.__rightShiftByAbsolute(t,e):_.__leftShiftByAbsolute(t,e)}},{key:"signedRightShift",value:function(t,e){return 0===e.length||0===t.length?t:e.sign?_.__leftShiftByAbsolute(t,e):_.__rightShiftByAbsolute(t,e)}},{key:"unsignedRightShift",value:function(){throw new TypeError("BigInts have no unsigned right shift; use >> instead")}},{key:"lessThan",value:function(t,e){return 0>_.__compareToBigInt(t,e)}},{key:"lessThanOrEqual",value:function(t,e){return 0>=_.__compareToBigInt(t,e)}},{key:"greaterThan",value:function(t,e){return 0<_.__compareToBigInt(t,e)}},{key:"greaterThanOrEqual",value:function(t,e){return 0<=_.__compareToBigInt(t,e)}},{key:"equal",value:function(t,e){if(t.sign!==e.sign)return!1;if(t.length!==e.length)return!1;for(var r=0;r=_.__kMaxLengthBits)return e;var r=t+31>>>5;if(e.length_.__kMaxLengthBits)throw new RangeError("BigInt too big");return _.__truncateAndSubFromPowerOfTwo(t,e,!1)}if(t>=_.__kMaxLengthBits)return e;var r=t+31>>>5;if(e.length>>n)return e}return _.__truncateToNBits(t,e)}},{key:"ADD",value:function(t,e){if(t=_.__toPrimitive(t),e=_.__toPrimitive(e),"string"==typeof t)return"string"!=typeof e&&(e=e.toString()),t+e;if("string"==typeof e)return t.toString()+e;if(t=_.__toNumeric(t),e=_.__toNumeric(e),_.__isBigInt(t)&&_.__isBigInt(e))return _.add(t,e);if("number"==typeof t&&"number"==typeof e)return t+e;throw new TypeError("Cannot mix BigInt and other types, use explicit conversions")}},{key:"LT",value:function(t,e){return _.__compare(t,e,0)}},{key:"LE",value:function(t,e){return _.__compare(t,e,1)}},{key:"GT",value:function(t,e){return _.__compare(t,e,2)}},{key:"GE",value:function(t,e){return _.__compare(t,e,3)}},{key:"EQ",value:function(e,r){for(;;){if(_.__isBigInt(e))return _.__isBigInt(r)?_.equal(e,r):_.EQ(r,e);if("number"==typeof e){if(_.__isBigInt(r))return _.__equalToNumber(r,e);if("object"!==t(r))return e==r;r=_.__toPrimitive(r)}else if("string"==typeof e){if(_.__isBigInt(r))return null!==(e=_.__fromString(e))&&_.equal(e,r);if("object"!==t(r))return e==r;r=_.__toPrimitive(r)}else if("boolean"==typeof e){if(_.__isBigInt(r))return _.__equalToNumber(r,+e);if("object"!==t(r))return e==r;r=_.__toPrimitive(r)}else if("symbol"===t(e)){if(_.__isBigInt(r))return!1;if("object"!==t(r))return e==r;r=_.__toPrimitive(r)}else{if("object"!==t(e))return e==r;if("object"===t(r)&&r.constructor!==_)return e==r;e=_.__toPrimitive(e)}}}},{key:"NE",value:function(t,e){return!_.EQ(t,e)}},{key:"__zero",value:function(){return new _(0,!1)}},{key:"__oneDigit",value:function(t,e){var r=new _(1,e);return r.__setDigit(0,t),r}},{key:"__decideRounding",value:function(t,e,r,n){if(0e)i=-e-1;else{if(0===r)return-1;r--,n=t.__digit(r),i=31}var o=1<>>20)-1023,n=1+(r>>>5),i=new _(n,0>t),o=1048575&_.__kBitConversionInts[1]|1048576,a=_.__kBitConversionInts[0],u=20,s=31&r,l=0;if(s>>f,o=o<<32-f|a>>>f,a<<=32-f}else if(s===u)l=32,e=o,o=a;else{var c=s-u;l=32-c,e=o<>>32-c,o=a<=t&&9<=t)||(159>=t?32==t:131071>=t?160==t||5760==t:196607>=t?10>=(t&=131071)||40==t||41==t||47==t||95==t||4096==t:65279==t)}},{key:"__fromString",value:function(t){var e=11073741824/u)return null;var l=new _(31+(u*a+s>>>_.__kBitsPerCharTableShift)>>>5,!1),f=10>e?e:10,c=10>=_.__kBitsPerCharTableShift;var h=[],g=[],d=!1;do{for(var p,v=0,y=0;;){if(p=void 0,o-48>>>0>>0>>0>>0>>_.__kBitsPerCharTableShift+5;l.__inplaceMultiplyAdd(D,k,P)}while(!b)}if(i!==n){if(!_.__isWhitespace(o))return null;for(i++;i>>s-(o-=32))}if(0!==i){if(n>=t.length)throw new Error("implementation bug");t.__setDigit(n++,i)}for(;n>>1)+(85&n))>>>2)+(51&n))>>>4)+(15&n),o=e-1,a=t.__digit(r-1),u=0|(32*r-s(a)+i-1)/i;if(t.sign&&u++,268435456>>v,h=32-v;h>=i;)l[f--]=_.__kConversionChars[c&o],c>>>=i,h-=i}var y=(c|a<>>i-h;0!==c;)l[f--]=_.__kConversionChars[c&o],c>>>=i;if(t.sign&&(l[f--]="-"),-1!==f)throw new Error("implementation bug");return l.join("")}},{key:"__toStringGeneric",value:function(t,e,r){var n=t.length;if(0===n)return"";if(1===n){var i=t.__unsignedDigit(0).toString(e);return!1===r&&t.sign&&(i="-"+i),i}var o,a,u=32*n-s(t.__digit(n-1)),l=_.__kMaxBitsPerChar[e]-1,f=u*_.__kBitsPerCharTableMultiplier,c=1+(f=0|(f+=l-1)/l)>>1,h=_.exponentiate(_.__oneDigit(e,!1),_.__oneDigit(c,!1)),g=h.__unsignedDigit(0);if(1===h.length&&65535>=g){(o=new _(t.length,!1)).__initializeDigits();for(var d,p=0,v=2*t.length-1;0<=v;v--)d=p<<16|t.__halfDigit(v),o.__setHalfDigit(v,0|d/g),p=0|d%g;a=p.toString(e)}else{var y=_.__absoluteDivLarge(t,h,!0,!0);o=y.quotient;var b=y.remainder.__trim();a=_.__toStringGeneric(b,e,!0)}o.__trim();for(var m=_.__toStringGeneric(o,e,!0);a.lengthn?_.__absoluteLess(r):0}},{key:"__compareToNumber",value:function(t,e){if(!0|e){var r=t.sign,n=0>e;if(r!==n)return _.__unequalSign(r);if(0===t.length){if(n)throw new Error("implementation bug");return 0===e?0:-1}if(1i?_.__absoluteGreater(r):ae)return _.__unequalSign(r);if(0===e)throw new Error("implementation bug: should be handled elsewhere");if(0===t.length)return-1;_.__kBitConversionDouble[0]=e;var n=2047&_.__kBitConversionInts[1]>>>20;if(2047==n)throw new Error("implementation bug: handled elsewhere");var i=n-1023;if(0>i)return _.__absoluteGreater(r);var o=t.length,a=t.__digit(o-1),u=s(a),l=32*o-u,f=i+1;if(lf)return _.__absoluteGreater(r);var c=1048576|1048575&_.__kBitConversionInts[1],h=_.__kBitConversionInts[0],g=20,d=31-u;if(d!==(l-1)%31)throw new Error("implementation bug");var p,v=0;if(d>>y,c=c<<32-y|h>>>y,h<<=32-y}else if(d===g)v=32,p=c,c=h;else{var b=d-g;v=32-b,p=c<>>32-b,c=h<>>=0)>(p>>>=0))return _.__absoluteGreater(r);if(a>>0,c=h,h=0):p=0;var w=t.__unsignedDigit(m);if(w>p)return _.__absoluteGreater(r);if(we&&t.__unsignedDigit(0)===o(e):0===_.__compareToDouble(t,e)}},{key:"__comparisonResultToBool",value:function(t,e){switch(e){case 0:return 0>t;case 1:return 0>=t;case 2:return 0e;case 3:return t>=e}if(_.__isBigInt(t)&&"string"==typeof e)return null!==(e=_.__fromString(e))&&_.__comparisonResultToBool(_.__compareToBigInt(t,e),r);if("string"==typeof t&&_.__isBigInt(e))return null!==(t=_.__fromString(t))&&_.__comparisonResultToBool(_.__compareToBigInt(t,e),r);if(t=_.__toNumeric(t),e=_.__toNumeric(e),_.__isBigInt(t)){if(_.__isBigInt(e))return _.__comparisonResultToBool(_.__compareToBigInt(t,e),r);if("number"!=typeof e)throw new Error("implementation bug");return _.__comparisonResultToBool(_.__compareToNumber(t,e),r)}if("number"!=typeof t)throw new Error("implementation bug");if(_.__isBigInt(e))return _.__comparisonResultToBool(_.__compareToNumber(e,t),2^r);if("number"!=typeof e)throw new Error("implementation bug");return 0===r?te:3===r?t>=e:void 0}},{key:"__absoluteAdd",value:function(t,e,r){if(t.length>>16)+(u>>>16)+(l>>>16);o=f>>>16,i.__setDigit(a,65535&l|f<<16)}for(;a>>16)+(h>>>16);o=g>>>16,i.__setDigit(a,65535&h|g<<16)}return a>>16)-(u>>>16)-(i=1&s>>>16);i=1&l>>>16,n.__setDigit(o,65535&s|l<<16)}for(;o>>16)-(i=1&c>>>16);i=1&h>>>16,n.__setDigit(o,65535&c|h<<16)}return n.__trim()}},{key:"__absoluteAddOne",value:function(t,e){var r=2n?0:t.__unsignedDigit(n)>e.__unsignedDigit(n)?1:-1}},{key:"__multiplyAccumulate",value:function(t,e,r,n){if(0!==e){for(var i=65535&e,o=e>>>16,a=0,s=0,_=0,l=0;l>>16,g=t.__digit(l),d=65535&g,p=g>>>16,v=u(d,i),y=u(d,o),b=u(p,i),m=u(p,o);a=(s=(y>>>16)+(b>>>16)+(65535&m)+(a=(h+=_+a+((c+=s+(65535&v))>>>16)+(v>>>16)+(65535&y)+(65535&b))>>>16))>>>16,s&=65535,_=m>>>16,f=65535&c|h<<16,r.__setDigit(n,f)}for(;0!==a||0!==s||0!==_;n++){var w=r.__digit(n),k=(65535&w)+s,D=(w>>>16)+(k>>>16)+_+a;s=0,_=0,a=D>>>16,w=65535&k|D<<16,r.__setDigit(n,w)}}}},{key:"__internalMultiplyAdd",value:function(t,e,r,n,i){for(var o=r,a=0,s=0;s>>16;var c=u(_>>>16,e),h=(65535&c)+(l>>>16)+o;o=h>>>16,a=c>>>16,i.__setDigit(s,h<<16|65535&f)}if(i.length>n)for(i.__setDigit(n++,o+a);n>>0,a=0|o/e,u=0|(o=((n=0|o%e)<<16|t.__halfDigit(i-1))>>>0)/e;n=0|o%e,r.__setDigit(i>>>1,a<<16|u)}return r}},{key:"__absoluteModSmall",value:function(t,e){for(var r=0,n=2*t.length-1;0<=n;n--)r=0|((r<<16|t.__halfDigit(n))>>>0)%e;return r}},{key:"__absoluteDivLarge",value:function(t,e,r,n){var i=e.__halfDigitLength(),o=e.length,a=t.__halfDigitLength()-i,s=null;r&&(s=new _(a+2>>>1,!1)).__initializeDigits();var l=new _(i+2>>>1,!1);l.__initializeDigits();var f=_.__clz16(e.__halfDigit(i-1));0>>0;p=0|y/h;for(var b=0|y%h,m=e.__halfDigit(i-2),w=c.__halfDigit(d+i-2);u(p,m)>>>0>(b<<16|w)>>>0&&(p--,!(65535<(b+=h))););}_.__internalMultiplyAdd(e,p,0,o,l);var k=c.__inplaceSub(l,d,i+1);0!==k&&(k=c.__inplaceAdd(e,d,i),c.__setHalfDigit(d+i,c.__halfDigit(d+i)+k),p--),r&&(1&d?g=p<<16:s.__setDigit(d>>>1,g|p))}return n?(c.__inplaceRightShift(f),r?{quotient:s,remainder:c}:c):r?s:void 0}},{key:"__clz16",value:function(t){return s(t)-16}},{key:"__specialLeftShift",value:function(t,e,r){var n=t.length,i=new _(n+r,!1);if(0===e){for(var o=0;o>>32-e;return 0r)throw new RangeError("BigInt too big");var n=r>>>5,i=31&r,o=t.length,a=0!==i&&0!=t.__digit(o-1)>>>32-i,u=o+n+(a?1:0),s=new _(u,t.sign);if(0===i){for(var l=0;l>>32-i;if(a)s.__setDigit(o+n,f);else if(0!==f)throw new Error("implementation bug")}return s.__trim()}},{key:"__rightShiftByAbsolute",value:function(t,e){var r=t.length,n=t.sign,i=_.__toShiftAmount(e);if(0>i)return _.__rightShiftByMaximum(n);var o=i>>>5,a=31&i,u=r-o;if(0>=u)return _.__rightShiftByMaximum(n);var s=!1;if(n)if(0!=(t.__digit(o)&(1<>>a,d=r-o-1,p=0;p>>a;f.__setDigit(d,g)}return s&&(f=_.__absoluteAddOne(f,!0,f)),f.__trim()}},{key:"__rightShiftByMaximum",value:function(t){return t?_.__oneDigit(1,!0):_.__zero()}},{key:"__toShiftAmount",value:function(t){if(1_.__kMaxLengthBits?-1:e}},{key:"__toPrimitive",value:function(e){var r=1>>5,n=new _(r,e.sign),i=r-1,o=0;o>>u}return n.__setDigit(i,a),n.__trim()}},{key:"__truncateAndSubFromPowerOfTwo",value:function(t,e,r){for(var n=Math.min,i=t+31>>>5,o=new _(i,r),a=0,u=i-1,s=0,l=n(u,e.length);a>>16)-(s=1&c>>>16);s=1&h>>>16,o.__setDigit(a,65535&c|h<<16)}for(;a>>16)-(s=1&v>>>16)<<16}else{var y=32-p,b=1<<32-y,m=(65535&b)-(65535&(d=d<>>y))-s;g=65535&m|(b>>>16)-(d>>>16)-(s=1&m>>>16)<<16,g&=b-1}return o.__setDigit(u,g),o.__trim()}},{key:"__digitPow",value:function(t,e){for(var r=1;0>>=1,t*=t;return r}}]),_}(l(Array));return v.__kMaxLength=33554432,v.__kMaxLengthBits=v.__kMaxLength<<5,v.__kMaxBitsPerChar=[0,0,32,51,64,75,83,90,96,102,107,111,115,119,122,126,128,131,134,136,139,141,143,145,147,149,151,153,154,156,158,159,160,162,163,165,166],v.__kBitsPerCharTableShift=5,v.__kBitsPerCharTableMultiplier=1<a)throw new Error(u);let s=i.filter((t=>!r.includes(t)));if(i.length-s.length!==o)throw new Error(u);if(s.find((t=>!n.includes(t))))throw new Error(u)}function s(t,e){if(!/^0x([0-9a-fA-F][0-9a-fA-F])*$/.test(e))throw new Error(`${t} must be a hex string!`)}function _(t,e){if(s(t,e),66!=e.length)throw new Error(`${t} must be a hex string of 66 bytes long!`)}function l(t,e){if("0x0"!==e&&!/^0x[1-9a-fA-F][0-9a-fA-F]*$/.test(e))throw new Error(`${t} must be a hex integer!`)}function f(t,{nestedValidation:e=!0,debugPath:r="script"}={}){if(u(r,t,["code_hash","hash_type","args"],[]),_(`${r}.code_hash`,t.code_hash),s(`${r}.args`,t.args),"data"!==t.hash_type&&"type"!==t.hash_type)throw new Error(`${r}.hash_type must be either data or type!`)}function c(t,{nestedValidation:e=!0,debugPath:r="out_point"}={}){u(r,t,["tx_hash","index"],[]),_(`${r}.tx_hash`,t.tx_hash),l(`${r}.index`,t.index)}function h(t,{nestedValidation:e=!0,debugPath:r="cell_input"}={}){u(r,t,["since","previous_output"],[]),l(`${r}.since`,t.since),e&&c(t.previous_output,{debugPath:`${r}.previous_output`})}function g(t,{nestedValidation:e=!0,debugPath:r="cell_output"}={}){u(r,t,["capacity","lock"],["type"]),l(`${r}.capacity`,t.capacity),e&&(f(t.lock,{debugPath:`${r}.lock`}),t.type&&f(t.type,{debugPath:`${r}.type`}))}function d(t,{nestedValidation:e=!0,debugPath:r="cell_dep"}={}){if(u(r,t,["out_point","dep_type"],[]),"code"!==t.dep_type&&"dep_group"!==t.dep_type)throw new Error(`${r}.dep_type must be either code or dep_group!`);e&&c(t.out_point,{debugPath:`${r}.out_point`})}function p(t,e,r,n){if(!Array.isArray(e))throw new Error(`${t} is not an array!`);if(n)for(let n=0;n-1};function _(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function l(t){return"string"!=typeof t&&(t=String(t)),t}function f(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return n&&(e[Symbol.iterator]=function(){return e}),e}function c(t){this.map={},t instanceof c?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function h(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function g(t){return new Promise((function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}}))}function d(t){var e=new FileReader,r=g(e);return e.readAsArrayBuffer(t),r}function p(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function v(){return this.bodyUsed=!1,this._initBody=function(t){var e;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:i&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:o&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:r&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():a&&i&&((e=t)&&DataView.prototype.isPrototypeOf(e))?(this._bodyArrayBuffer=p(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a&&(ArrayBuffer.prototype.isPrototypeOf(t)||s(t))?this._bodyArrayBuffer=p(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var t=h(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?h(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(d)}),this.text=function(){var t,e,r,n=h(this);if(n)return n;if(this._bodyBlob)return t=this._bodyBlob,e=new FileReader,r=g(e),e.readAsText(t),r;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=new Array(e.length),n=0;n-1?n:r),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function m(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var r=t.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(n),decodeURIComponent(i))}})),e}function w(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new c(e.headers),this.url=e.url||"",this._initBody(t)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},v.call(b.prototype),v.call(w.prototype),w.prototype.clone=function(){return new w(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new c(this.headers),url:this.url})},w.error=function(){var t=new w(null,{status:0,statusText:""});return t.type="error",t};var k=[301,302,303,307,308];w.redirect=function(t,e){if(-1===k.indexOf(e))throw new RangeError("Invalid status code");return new w(null,{status:e,headers:{location:t}})},e.DOMException=t.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(t,e){this.message=t,this.name=e;var r=Error(t);this.stack=r.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function D(t,r){return new Promise((function(n,o){var a=new b(t,r);if(a.signal&&a.signal.aborted)return o(new e.DOMException("Aborted","AbortError"));var u=new XMLHttpRequest;function s(){u.abort()}u.onload=function(){var t,e,r={status:u.status,statusText:u.statusText,headers:(t=u.getAllResponseHeaders()||"",e=new c,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var r=t.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();e.append(n,i)}})),e)};r.url="responseURL"in u?u.responseURL:r.headers.get("X-Request-URL");var i="response"in u?u.response:u.responseText;n(new w(i,r))},u.onerror=function(){o(new TypeError("Network request failed"))},u.ontimeout=function(){o(new TypeError("Network request failed"))},u.onabort=function(){o(new e.DOMException("Aborted","AbortError"))},u.open(a.method,a.url,!0),"include"===a.credentials?u.withCredentials=!0:"omit"===a.credentials&&(u.withCredentials=!1),"responseType"in u&&i&&(u.responseType="blob"),a.headers.forEach((function(t,e){u.setRequestHeader(e,t)})),a.signal&&(a.signal.addEventListener("abort",s),u.onreadystatechange=function(){4===u.readyState&&a.signal.removeEventListener("abort",s)}),u.send(void 0===a._bodyInit?null:a._bodyInit)}))}D.polyfill=!0,t.fetch||(t.fetch=D,t.Headers=c,t.Request=b,t.Response=w),e.Headers=c,e.Request=b,e.Response=w,e.fetch=D}({})}(r),delete r.fetch.polyfill,(e=r.fetch).default=r.fetch,e.fetch=r.fetch,e.Headers=r.Headers,e.Request=r.Request,e.Response=r.Response,t.exports=e}));function x(t,e){e=e||{};const r=Object.assign({},e.headers||{},t.headers||{});return Object.assign({},e,t,{headers:r})}const O={get:(t,e,r)=>"send"===e?async()=>{const e=await E(t.uri,x({method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify(t.payload)},t.defaultOptions));return await e.json()}:(...n)=>{const i=t.id;return t.id=t.id+1,t.payload.push({jsonrpc:"2.0",id:i,method:e,params:n}),r}},C={get:(t,e)=>"batch"===e?()=>new Proxy({id:Math.round(1e7*Math.random()),payload:[],uri:t.uri,defaultOptions:t.defaultOptions},O):async(...r)=>{const n=Math.round(1e7*Math.random()),i=await E(t.uri,x({method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:n,method:e,params:r})},t.defaultOptions)),o=await i.json();if(o.id!==n)throw new Error("JSONRPCError: response ID does not match request ID!");if(o.error)throw new Error(`JSONRPCError: server error ${JSON.stringify(o.error)}`);return o.result}};class ${constructor(t,e={}){return this.uri=t,this.defaultOptions=e,new Proxy(this,C)}static create(t){return new $(t)}}function I(t){return a.BigInt(t)}function j(t){return"0x"+t.toString(16)}function R(t){return function(e,r){if(!(r instanceof ArrayBuffer)){let n=j(a.BigInt(r)).substr(2);if(n.length%2!=0&&(n="0"+n),n.length/2>t)throw new Error(`${e} is ${n.length/2} bytes long, expected length is ${t}!`);const i=new DataView(new ArrayBuffer(t));for(let t=0;t0&&r.byteLength!==t)throw new Error(`${e} has invalid length ${r.byteLength}, required: ${t}`);return r}}function M(t,e,r){const n={};for(const[i,o]of Object.entries(r)){const r=e[i];if(!r)throw new Error(`${t} is missing ${i}!`);n[i]=o(`${t}.${i}`,r)}return n}function N(t,{debugPath:e="script"}={}){return M(e,t,{code_hash:z(32),hash_type:function(t,e){switch(e){case"data":return 0;case"type":return 1;case 0:case 1:return e;default:throw new Error(`${t}.hash_type has invalid value: ${e}`)}},args:z(-1)})}function L(t,{debugPath:e="out_point"}={}){return M(e,t,{tx_hash:z(32),index:R(4)})}function U(t){return function(e,r){return t(r,{debugPath:e})}}function V(t,{debugPath:e="cell_input"}={}){return M(e,t,{since:R(8),previous_output:U(L)})}function q(t,{debugPath:e="cell_output"}={}){const r=M(e,t,{capacity:R(8),lock:U(N)});return t.type&&(r.type_=N(t.type,{debugPath:`${e}.type`})),r}function F(t,{debugPath:e="cell_dep"}={}){return M(e,t,{out_point:U(L),dep_type:function(t,e){switch(e){case"code":return 0;case"dep_group":return 1;case 0:case 1:return e;default:throw new Error(`${t}.dep_type has invalid value: ${e}`)}}})}function H(t){return function(e,r){return r.map(((r,n)=>t(`${e}[${n}]`,r)))}}function G(t,{debugPath:e="raw_transaction"}={}){return M(e,t,{version:R(4),cell_deps:H(U(F)),header_deps:H(z(32)),inputs:H(U(V)),outputs:H(U(q)),outputs_data:H(z(-1))})}function W(t,{debugPath:e="transaction"}={}){const r=G(t,{debugPath:`(raw)${e}`}),n=M(e,t,{witnesses:H(z(-1))});return n.raw=r,n}function J(t,{debugPath:e="raw_header"}={}){return M(e,t,{version:R(4),compact_target:R(4),timestamp:R(8),number:R(8),epoch:R(8),parent_hash:z(32),transactions_root:z(32),proposals_hash:z(32),uncles_hash:z(32),dao:z(32)})}function X(t,{debugPath:e="header"}={}){const r=J(t,{debugPath:`(raw)${e}`}),n=M(e,t,{nonce:R(16)});return n.raw=r,n}function Q(t,{debugPath:e="uncle_block"}={}){return M(e,t,{header:U(X),proposals:H(z(10))})}var K=Object.freeze({__proto__:null,NormalizeScript:N,NormalizeOutPoint:L,NormalizeCellInput:V,NormalizeCellOutput:q,NormalizeCellDep:F,NormalizeRawTransaction:G,NormalizeTransaction:W,NormalizeRawHeader:J,NormalizeHeader:X,NormalizeUncleBlock:Q,NormalizeBlock:function(t,{debugPath:e="block"}={}){return M(e,t,{header:U(X),uncles:H(U(Q)),transactions:H(U(W)),proposals:H(z(10))})},NormalizeCellbaseWitness:function(t,{debugPath:e="cellbase_witness"}={}){return M(e,t,{lock:U(N),message:z(-1)})},NormalizeWitnessArgs:function(t,{debugPath:e="witness_args"}={}){const r={};return t.lock&&(r.lock=z(-1)(`${e}.lock`,t.lock)),t.input_type&&(r.input_type=z(-1)(`${e}.input_type`,t.input_type)),t.output_type&&(r.output_type=z(-1)(`${e}.output_type`,t.output_type)),r}});function Y(t,e){return e instanceof Object&&e.serializeJson instanceof Function?e.serializeJson.call(e):e}function Z(t,e,r){if(!((e=Y(0,e))instanceof Object))throw new Error(`Transformed ${t} is not an object!`);const n={};for(const[i,o]of Object.entries(r)){let r=e[i];if(!r){r=e[i.replace(/(_[a-z])/g,(t=>t.toUpperCase().replace("_","")))]}r&&(n[i]=o(`${t}.${i}`,r))}return n}function tt(t,{validation:e=!0,debugPath:r="script"}={}){return t=Z(r,t,{code_hash:Y,hash_type:Y,args:Y}),e&&f(t,{debugPath:`(transformed) ${r}`}),t}function et(t,{validation:e=!0,debugPath:r="out_point"}={}){return t=Z(r,t,{tx_hash:Y,index:Y}),e&&c(t,{debugPath:`(transformed) ${r}`}),t}function rt(t){return function(e,r){return t(r,{validation:!1,debugPath:e})}}function nt(t,{validation:e=!0,debugPath:r="cell_input"}={}){return t=Z(r,t,{since:Y,previous_output:rt(et)}),e&&h(t,{debugPath:`(transformed) ${r}`}),t}function it(t,{validation:e=!0,debugPath:r="cell_output"}={}){return t=Z(r,t,{capacity:Y,lock:rt(tt),type:rt(tt)}),e&&g(t,{debugPath:`(transformed) ${r}`}),t}function ot(t,{validation:e=!0,debugPath:r="cell_dep"}={}){return t=Z(r,t,{out_point:rt(et),dep_type:Y}),e&&d(t,{debugPath:`(transformed) ${r}`}),t}function at(t){return function(e,r){return r.map(((r,n)=>t(`${e}[${n}]`,r)))}}function ut(t,{validation:e=!0,debugPath:r="transaction"}={}){return t=Z(r,t,{version:Y,cell_deps:at(rt(ot)),header_deps:at(Y),inputs:at(rt(nt)),outputs:at(rt(it)),outputs_data:at(Y),witnesses:at(Y)}),e&&m(t,{debugPath:`(transformed) ${r}`}),t}function st(t,{validation:e=!0,debugPath:r="header"}={}){return t=Z(r,t,{version:Y,compact_target:Y,timestamp:Y,number:Y,epoch:Y,parent_hash:Y,transactions_root:Y,proposals_hash:Y,uncles_hash:Y,dao:Y,nonce:Y}),e&&k(t,{debugPath:`(transformed) ${r}`}),t}function _t(t,{validation:e=!0,debugPath:r="uncle_block"}={}){return t=Z(r,t,{header:rt(st),proposals:at(Y)}),e&&B(t,{debugPath:`(transformed) ${r}`}),t}var lt=Object.freeze({__proto__:null,TransformScript:tt,TransformOutPoint:et,TransformCellInput:nt,TransformCellOutput:it,TransformCellDep:ot,TransformRawTransaction:function(t,{validation:e=!0,debugPath:r="raw_transaction"}={}){return t=Z(r,t,{version:Y,cell_deps:at(rt(ot)),header_deps:at(Y),inputs:at(rt(nt)),outputs:at(rt(it)),outputs_data:at(Y)}),e&&b(t,{debugPath:`(transformed) ${r}`}),t},TransformTransaction:ut,TransformRawHeader:function(t,{validation:e=!0,debugPath:r="raw_header"}={}){return t=Z(r,t,{version:Y,compact_target:Y,timestamp:Y,number:Y,epoch:Y,parent_hash:Y,transactions_root:Y,proposals_hash:Y,uncles_hash:Y,dao:Y}),e&&w(t,{debugPath:`(transformed) ${r}`}),t},TransformHeader:st,TransformUncleBlock:_t,TransformBlock:function(t,{validation:e=!0,debugPath:r="block"}={}){return t=Z(r,t,{header:rt(st),uncles:at(rt(_t)),transactions:at(rt(ut)),proposals:at(Y)}),e&&P(t,{debugPath:`(transformed) ${r}`}),t},TransformCellbaseWitness:function(t,{validation:e=!0,debugPath:r="cellbase_witness"}={}){return t=Z(r,t,{lock:rt(tt),message:Y}),e&&A(t,{debugPath:`(transformed) ${r}`}),t},TransformWitnessArgs:function(t,{validation:e=!0,debugPath:r="witness_args"}={}){return t=Z(r,t,{lock:Y,input_type:Y,output_type:Y}),e&&T(t,{debugPath:`(transformed) ${r}`}),t}});var ft=Object.freeze({__proto__:null,RPCCollector:class{constructor(t,e,{skipCellWithContent:r=!0,loadData:i=!1,loadBlockNumber:o=!0}={}){this.rpc=t,this.lockHash=new n(e).serializeJson(),this.skipCellWithContent=r,this.loadData=i,this.loadBlockNumber=o}async*collect(){const t=I(await this.rpc.get_tip_block_number());let e=a.BigInt(0);for(;a.lessThanOrEqual(e,t);){let r=a.add(e,a.BigInt(100));a.greaterThan(r,t)&&(r=t);const n=await this.rpc.get_cells_by_lock_hash(this.lockHash,j(e),j(r));for(const t of n){if(this.skipCellWithContent&&(t.type||a.greaterThan(I(t.output_data_len),a.BigInt(100))))continue;let e=null;if(this.loadData){e=(await this.rpc.get_live_cell(t.out_point,!0)).cell.data.content}let r=null;if(this.loadBlockNumber){r=(await this.rpc.get_header(t.block_hash)).number}yield{cellbase:t.cellbase,cell_output:{capacity:t.capacity,lock:t.lock,type:t.type},out_point:t.out_point,block_hash:t.block_hash,data:e,output_data_len:t.output_data_len,block_number:r}}e=a.add(r,a.BigInt(1))}}}});t.BigIntToHexString=j,t.HexStringToBigInt=I,t.RPC=$,t.Reader=n,t.TransactionDumper=class{constructor(t,{validateTransaction:e=!0,depGroupUnpacker:r=null}={}){this.rpc=t,this.validateTransaction=e,this.depGroupUnpacker=r}async dumpByHash(t){const e=(await this.rpc.get_transaction(t)).transaction;return delete e.hash,await this.dump(e)}async dump(t){this.validateTransaction&&m(t);const e=[];for(const r of t.inputs){const{output:t,data:n,header:i}=await this._resolveOutPoint(r.previous_output);e.push({input:r,output:t,data:n,header:i})}const r=[];for(const e of t.cell_deps){const{output:t,data:i,header:o}=await this._resolveOutPoint(e.out_point);if(r.push({cell_dep:e,output:t,data:i,header:o}),"dep_group"===e.dep_type){if(!this.depGroupUnpacker)throw new Error("depGroupUnpacker must be provided when the transaction contains dep_group!");const t=this.depGroupUnpacker(new n(i));for(const e of t){c(e);const{output:t,data:n,header:i}=await this._resolveOutPoint(e);r.push({cell_dep:{out_point:e,dep_type:"code"},output:t,data:n,header:i})}}}const i=[];for(const e of t.header_deps)i.push(await this.rpc.get_header(e));return JSON.stringify({mock_info:{inputs:e,cell_deps:r,header_deps:i},tx:t})}async _resolveOutPoint(t){const e=await this.rpc.get_transaction(t.tx_hash);if(!e||!e.transaction)throw new Error(`Transaction ${t.tx_hash} cannot be found!`);const r=e.transaction,n=a.toNumber(a.BigInt(t.index));if(n>=r.outputs.length)throw new Error(`Transaction ${t.tx_hash} does not have output ${n}!`);const i={output:r.outputs[n],data:r.outputs_data[n]};return"committed"===e.tx_status.status&&(i.header=e.tx_status.block_hash),i}},t.VERSION="0.10.2",t.cell_collectors=ft,t.normalizers=K,t.transformers=lt,t.validators=S,Object.defineProperty(t,"__esModule",{value:!0})})); diff --git a/packages/core/package-lock.json b/packages/core/package-lock.json new file mode 100644 index 000000000..ee42d6752 --- /dev/null +++ b/packages/core/package-lock.json @@ -0,0 +1,2689 @@ +{ + "name": "ckb-js-toolkit", + "version": "0.10.2", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@babel/code-frame": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz", + "integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==", + "dev": true, + "requires": { + "@babel/highlight": "^7.8.3" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz", + "integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==", + "dev": true + }, + "@babel/highlight": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.8.3.tgz", + "integrity": "sha512-PX4y5xQUvy0fnEVHrYOarRPXVWafSjTW9T0Hab8gVIawpl2Sj0ORyrygANq+KjcNlSSTw0YCLSNA8OyZ1I4yEg==", + "dev": true, + "requires": { + "chalk": "^2.0.0", + "esutils": "^2.0.2", + "js-tokens": "^4.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "@concordance/react": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@concordance/react/-/react-2.0.0.tgz", + "integrity": "sha512-huLSkUuM2/P+U0uy2WwlKuixMsTODD8p4JVQBI4VKeopkiN0C7M3N9XYVawb4M+4spN5RrO/eLhk7KoQX6nsfA==", + "dev": true, + "requires": { + "arrify": "^1.0.1" + }, + "dependencies": { + "arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "dev": true + } + } + }, + "@nodelib/fs.scandir": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz", + "integrity": "sha512-eGmwYQn3gxo4r7jdQnkrrN6bY478C3P+a/y72IJukF8LjB6ZHeB3c+Ehacj3sYeSmUXGlnA67/PmbM9CVwL7Dw==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "2.0.3", + "run-parallel": "^1.1.9" + } + }, + "@nodelib/fs.stat": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.3.tgz", + "integrity": "sha512-bQBFruR2TAwoevBEd/NWMoAAtNGzTRgdrqnYCc7dhzfoNvqPzLyqlEQnzZ3kVnNrSp25iyxE00/3h2fqGAGArA==", + "dev": true + }, + "@nodelib/fs.walk": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.4.tgz", + "integrity": "sha512-1V9XOY4rDW0rehzbrcqAmHnz8e7SKvX27gh8Gt2WgB0+pdzdiLV83p72kZPU+jvMbS1qU5mauP2iOvO8rhmurQ==", + "dev": true, + "requires": { + "@nodelib/fs.scandir": "2.1.3", + "fastq": "^1.6.0" + } + }, + "@rollup/plugin-commonjs": { + "version": "15.0.0", + "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-15.0.0.tgz", + "integrity": "sha512-8uAdikHqVyrT32w1zB9VhW6uGwGjhKgnDNP4pQJsjdnyF4FgCj6/bmv24c7v2CuKhq32CcyCwRzMPEElaKkn0w==", + "dev": true, + "requires": { + "@rollup/pluginutils": "^3.1.0", + "commondir": "^1.0.1", + "estree-walker": "^2.0.1", + "glob": "^7.1.6", + "is-reference": "^1.2.1", + "magic-string": "^0.25.7", + "resolve": "^1.17.0" + }, + "dependencies": { + "resolve": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", + "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", + "dev": true, + "requires": { + "path-parse": "^1.0.6" + } + } + } + }, + "@rollup/plugin-node-resolve": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-9.0.0.tgz", + "integrity": "sha512-gPz+utFHLRrd41WMP13Jq5mqqzHL3OXrfj3/MkSyB6UBIcuNt9j60GCbarzMzdf1VHFpOxfQh/ez7wyadLMqkg==", + "dev": true, + "requires": { + "@rollup/pluginutils": "^3.1.0", + "@types/resolve": "1.17.1", + "builtin-modules": "^3.1.0", + "deepmerge": "^4.2.2", + "is-module": "^1.0.0", + "resolve": "^1.17.0" + }, + "dependencies": { + "resolve": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", + "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", + "dev": true, + "requires": { + "path-parse": "^1.0.6" + } + } + } + }, + "@rollup/plugin-replace": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/@rollup/plugin-replace/-/plugin-replace-2.3.3.tgz", + "integrity": "sha512-XPmVXZ7IlaoWaJLkSCDaa0Y6uVo5XQYHhiMFzOd5qSv5rE+t/UJToPIOE56flKIxBFQI27ONsxb7dqHnwSsjKQ==", + "dev": true, + "requires": { + "@rollup/pluginutils": "^3.0.8", + "magic-string": "^0.25.5" + } + }, + "@rollup/pluginutils": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.1.0.tgz", + "integrity": "sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==", + "dev": true, + "requires": { + "@types/estree": "0.0.39", + "estree-walker": "^1.0.1", + "picomatch": "^2.2.2" + }, + "dependencies": { + "estree-walker": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-1.0.1.tgz", + "integrity": "sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==", + "dev": true + }, + "picomatch": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", + "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", + "dev": true + } + } + }, + "@sindresorhus/is": { + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz", + "integrity": "sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ==", + "dev": true + }, + "@szmarczak/http-timer": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-1.1.2.tgz", + "integrity": "sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA==", + "dev": true, + "requires": { + "defer-to-connect": "^1.0.1" + } + }, + "@types/color-name": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", + "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==", + "dev": true + }, + "@types/estree": { + "version": "0.0.39", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", + "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", + "dev": true + }, + "@types/events": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz", + "integrity": "sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g==", + "dev": true + }, + "@types/glob": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.1.tgz", + "integrity": "sha512-1Bh06cbWJUHMC97acuD6UMG29nMt0Aqz1vF3guLfG+kHHJhy3AyohZFFxYk2f7Q1SQIrNwvncxAE0N/9s70F2w==", + "dev": true, + "requires": { + "@types/events": "*", + "@types/minimatch": "*", + "@types/node": "*" + } + }, + "@types/minimatch": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz", + "integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==", + "dev": true + }, + "@types/node": { + "version": "13.7.7", + "resolved": "https://registry.npmjs.org/@types/node/-/node-13.7.7.tgz", + "integrity": "sha512-Uo4chgKbnPNlxQwoFmYIwctkQVkMMmsAoGGU4JKwLuvBefF0pCq4FybNSnfkfRCpC7ZW7kttcC/TrRtAJsvGtg==", + "dev": true + }, + "@types/normalize-package-data": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz", + "integrity": "sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA==", + "dev": true + }, + "@types/resolve": { + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.17.1.tgz", + "integrity": "sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "aggregate-error": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.0.1.tgz", + "integrity": "sha512-quoaXsZ9/BLNae5yiNoUz+Nhkwz83GhWwtYFglcjEQB2NDHCIpApbqXxIFnm4Pq/Nvhrsq5sYJFyohrrxnTGAA==", + "dev": true, + "requires": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + } + }, + "ansi-align": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.0.tgz", + "integrity": "sha512-ZpClVKqXN3RGBmKibdfWzqCY4lnjEuoNzU5T0oEFpfd/z5qJHVarukridD4juLO2FXMiwUQxr9WqQtaYa8XRYw==", + "dev": true, + "requires": { + "string-width": "^3.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true + }, + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "anymatch": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", + "integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==", + "dev": true, + "requires": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + } + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "array-find-index": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", + "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=", + "dev": true + }, + "array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true + }, + "arrgv": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/arrgv/-/arrgv-1.0.2.tgz", + "integrity": "sha512-a4eg4yhp7mmruZDQFqVMlxNRFGi/i1r87pt8SDHy0/I8PqSXoUTlWZRdAZo0VXgvEARcujbtTk8kiZRi1uDGRw==", + "dev": true + }, + "arrify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", + "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==", + "dev": true + }, + "astral-regex": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", + "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", + "dev": true + }, + "ava": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/ava/-/ava-3.5.0.tgz", + "integrity": "sha512-o+xq1RgAZrQ7GX5nddTNeYbUDogwlBoa/Hnt+b1ciCLLxSOj5U6ZFblLNBSKwHtP1X/8R06bmzvX47jmlVu9KQ==", + "dev": true, + "requires": { + "@concordance/react": "^2.0.0", + "ansi-styles": "^4.2.1", + "arrgv": "^1.0.2", + "arrify": "^2.0.1", + "chalk": "^3.0.0", + "chokidar": "^3.3.1", + "chunkd": "^2.0.1", + "ci-parallel-vars": "^1.0.0", + "clean-stack": "^2.2.0", + "clean-yaml-object": "^0.1.0", + "cli-cursor": "^3.1.0", + "cli-truncate": "^2.1.0", + "code-excerpt": "^2.1.1", + "common-path-prefix": "^3.0.0", + "concordance": "^4.0.0", + "convert-source-map": "^1.7.0", + "currently-unhandled": "^0.4.1", + "debug": "^4.1.1", + "del": "^5.1.0", + "emittery": "^0.5.1", + "equal-length": "^1.0.0", + "figures": "^3.1.0", + "globby": "^11.0.0", + "ignore-by-default": "^1.0.0", + "import-local": "^3.0.2", + "indent-string": "^4.0.0", + "is-ci": "^2.0.0", + "is-error": "^2.2.2", + "is-plain-object": "^3.0.0", + "is-promise": "^2.1.0", + "lodash": "^4.17.15", + "matcher": "^2.1.0", + "md5-hex": "^3.0.1", + "ms": "^2.1.2", + "ora": "^4.0.3", + "p-map": "^3.0.0", + "picomatch": "^2.2.1", + "pkg-conf": "^3.1.0", + "plur": "^4.0.0", + "pretty-ms": "^6.0.0", + "read-pkg": "^5.2.0", + "resolve-cwd": "^3.0.0", + "slash": "^3.0.0", + "source-map-support": "^0.5.16", + "stack-utils": "^2.0.1", + "strip-ansi": "^6.0.0", + "supertap": "^1.0.0", + "temp-dir": "^2.0.0", + "trim-off-newlines": "^1.0.1", + "update-notifier": "^4.1.0", + "write-file-atomic": "^3.0.1", + "yargs": "^15.1.0" + } + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "binary-extensions": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.0.0.tgz", + "integrity": "sha512-Phlt0plgpIIBOGTT/ehfFnbNlfsDEiqmzE2KRXoX1bLIlir4X/MR+zSyBEkL05ffWgnRSf/DXv+WrUAVr93/ow==", + "dev": true + }, + "blueimp-md5": { + "version": "2.12.0", + "resolved": "https://registry.npmjs.org/blueimp-md5/-/blueimp-md5-2.12.0.tgz", + "integrity": "sha512-zo+HIdIhzojv6F1siQPqPFROyVy7C50KzHv/k/Iz+BtvtVzSHXiMXOpq2wCfNkeBqdCv+V8XOV96tsEt2W/3rQ==", + "dev": true + }, + "boxen": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/boxen/-/boxen-4.2.0.tgz", + "integrity": "sha512-eB4uT9RGzg2odpER62bBwSLvUeGC+WbRjjyyFhGsKnc8wp/m0+hQsMUvUe3H2V0D5vw0nBdO1hCJoZo5mKeuIQ==", + "dev": true, + "requires": { + "ansi-align": "^3.0.0", + "camelcase": "^5.3.1", + "chalk": "^3.0.0", + "cli-boxes": "^2.2.0", + "string-width": "^4.1.0", + "term-size": "^2.1.0", + "type-fest": "^0.8.1", + "widest-line": "^3.1.0" + }, + "dependencies": { + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true + } + } + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, + "buffer-from": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", + "dev": true + }, + "builtin-modules": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.1.0.tgz", + "integrity": "sha512-k0KL0aWZuBt2lrxrcASWDfwOLMnodeQjodT/1SxEQAXsHANgo6ZC/VEaSEHCXt7aSTZ4/4H5LKa+tBXmW7Vtvw==", + "dev": true + }, + "cacheable-request": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-6.1.0.tgz", + "integrity": "sha512-Oj3cAGPCqOZX7Rz64Uny2GYAZNliQSqfbePrgAQ1wKAihYmCUnraBtJtKcGR4xz7wF+LoJC+ssFZvv5BgF9Igg==", + "dev": true, + "requires": { + "clone-response": "^1.0.2", + "get-stream": "^5.1.0", + "http-cache-semantics": "^4.0.0", + "keyv": "^3.0.0", + "lowercase-keys": "^2.0.0", + "normalize-url": "^4.1.0", + "responselike": "^1.0.2" + }, + "dependencies": { + "get-stream": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.1.0.tgz", + "integrity": "sha512-EXr1FOzrzTfGeL0gQdeFEvOMm2mzMOglyiOXSTpPC+iAjAKftbr3jpCMWynogwYnM+eSj9sHGc6wjIcDvYiygw==", + "dev": true, + "requires": { + "pump": "^3.0.0" + } + }, + "lowercase-keys": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", + "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==", + "dev": true + } + } + }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, + "chalk": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", + "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "chokidar": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.3.1.tgz", + "integrity": "sha512-4QYCEWOcK3OJrxwvyyAOxFuhpvOVCYkr33LPfFNBjAD/w3sEzWsp2BUOkI4l9bHvWioAd0rc6NlHUOEaWkTeqg==", + "dev": true, + "requires": { + "anymatch": "~3.1.1", + "braces": "~3.0.2", + "fsevents": "~2.1.2", + "glob-parent": "~5.1.0", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.3.0" + } + }, + "chunkd": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/chunkd/-/chunkd-2.0.1.tgz", + "integrity": "sha512-7d58XsFmOq0j6el67Ug9mHf9ELUXsQXYJBkyxhH/k+6Ke0qXRnv0kbemx+Twc6fRJ07C49lcbdgm9FL1Ei/6SQ==", + "dev": true + }, + "ci-info": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", + "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", + "dev": true + }, + "ci-parallel-vars": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/ci-parallel-vars/-/ci-parallel-vars-1.0.0.tgz", + "integrity": "sha512-u6dx20FBXm+apMi+5x7UVm6EH7BL1gc4XrcnQewjcB7HWRcor/V5qWc3RG2HwpgDJ26gIi2DSEu3B7sXynAw/g==", + "dev": true + }, + "clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "dev": true + }, + "clean-yaml-object": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/clean-yaml-object/-/clean-yaml-object-0.1.0.tgz", + "integrity": "sha1-Y/sRDcLOGoTcIfbZM0h20BCui2g=", + "dev": true + }, + "cli-boxes": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-2.2.0.tgz", + "integrity": "sha512-gpaBrMAizVEANOpfZp/EEUixTXDyGt7DFzdK5hU+UbWt/J0lB0w20ncZj59Z9a93xHb9u12zF5BS6i9RKbtg4w==", + "dev": true + }, + "cli-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", + "dev": true, + "requires": { + "restore-cursor": "^3.1.0" + } + }, + "cli-spinners": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.2.0.tgz", + "integrity": "sha512-tgU3fKwzYjiLEQgPMD9Jt+JjHVL9kW93FiIMX/l7rivvOD4/LL0Mf7gda3+4U2KJBloybwgj5KEoQgGRioMiKQ==", + "dev": true + }, + "cli-truncate": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-2.1.0.tgz", + "integrity": "sha512-n8fOixwDD6b/ObinzTrp1ZKFzbgvKZvuz/TvejnLn1aQfC6r52XEx85FmuC+3HI+JM7coBRXUvNqEU2PHVrHpg==", + "dev": true, + "requires": { + "slice-ansi": "^3.0.0", + "string-width": "^4.2.0" + } + }, + "cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "dev": true, + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "clone": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", + "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=", + "dev": true + }, + "clone-response": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz", + "integrity": "sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws=", + "dev": true, + "requires": { + "mimic-response": "^1.0.0" + } + }, + "code-excerpt": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/code-excerpt/-/code-excerpt-2.1.1.tgz", + "integrity": "sha512-tJLhH3EpFm/1x7heIW0hemXJTUU5EWl2V0EIX558jp05Mt1U6DVryCgkp3l37cxqs+DNbNgxG43SkwJXpQ14Jw==", + "dev": true, + "requires": { + "convert-to-spaces": "^1.0.1" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true + }, + "common-path-prefix": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/common-path-prefix/-/common-path-prefix-3.0.0.tgz", + "integrity": "sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==", + "dev": true + }, + "commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "concordance": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/concordance/-/concordance-4.0.0.tgz", + "integrity": "sha512-l0RFuB8RLfCS0Pt2Id39/oCPykE01pyxgAFypWTlaGRgvLkZrtczZ8atEHpTeEIW+zYWXTBuA9cCSeEOScxReQ==", + "dev": true, + "requires": { + "date-time": "^2.1.0", + "esutils": "^2.0.2", + "fast-diff": "^1.1.2", + "js-string-escape": "^1.0.1", + "lodash.clonedeep": "^4.5.0", + "lodash.flattendeep": "^4.4.0", + "lodash.islength": "^4.0.1", + "lodash.merge": "^4.6.1", + "md5-hex": "^2.0.0", + "semver": "^5.5.1", + "well-known-symbols": "^2.0.0" + }, + "dependencies": { + "md5-hex": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/md5-hex/-/md5-hex-2.0.0.tgz", + "integrity": "sha1-0FiOnxx0lUSS7NJKwKxs6ZfZLjM=", + "dev": true, + "requires": { + "md5-o-matic": "^0.1.1" + } + } + } + }, + "configstore": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/configstore/-/configstore-5.0.1.tgz", + "integrity": "sha512-aMKprgk5YhBNyH25hj8wGt2+D52Sw1DRRIzqBwLp2Ya9mFmY8KPvvtvmna8SxVR9JMZ4kzMD68N22vlaRpkeFA==", + "dev": true, + "requires": { + "dot-prop": "^5.2.0", + "graceful-fs": "^4.1.2", + "make-dir": "^3.0.0", + "unique-string": "^2.0.0", + "write-file-atomic": "^3.0.0", + "xdg-basedir": "^4.0.0" + } + }, + "convert-source-map": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", + "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.1" + } + }, + "convert-to-spaces": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/convert-to-spaces/-/convert-to-spaces-1.0.2.tgz", + "integrity": "sha1-fj5Iu+bZl7FBfdyihoIEtNPYVxU=", + "dev": true + }, + "cross-fetch": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.0.6.tgz", + "integrity": "sha512-KBPUbqgFjzWlVcURG+Svp9TlhA5uliYtiNx/0r8nv0pdypeQCRJ9IaSIc3q/x3q8t3F75cHuwxVql1HFGHCNJQ==", + "requires": { + "node-fetch": "2.6.1" + } + }, + "crypto-random-string": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-2.0.0.tgz", + "integrity": "sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA==", + "dev": true + }, + "currently-unhandled": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", + "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=", + "dev": true, + "requires": { + "array-find-index": "^1.0.1" + } + }, + "date-time": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/date-time/-/date-time-2.1.0.tgz", + "integrity": "sha512-/9+C44X7lot0IeiyfgJmETtRMhBidBYM2QFFIkGa0U1k+hSyY87Nw7PY3eDqpvCBm7I3WCSfPeZskW/YYq6m4g==", + "dev": true, + "requires": { + "time-zone": "^1.0.0" + } + }, + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true + }, + "decompress-response": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz", + "integrity": "sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=", + "dev": true, + "requires": { + "mimic-response": "^1.0.0" + } + }, + "deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "dev": true + }, + "deepmerge": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", + "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==", + "dev": true + }, + "defaults": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz", + "integrity": "sha1-xlYFHpgX2f8I7YgUd/P+QBnz730=", + "dev": true, + "requires": { + "clone": "^1.0.2" + } + }, + "defer-to-connect": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-1.1.3.tgz", + "integrity": "sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ==", + "dev": true + }, + "del": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/del/-/del-5.1.0.tgz", + "integrity": "sha512-wH9xOVHnczo9jN2IW68BabcecVPxacIA3g/7z6vhSU/4stOKQzeCRK0yD0A24WiAAUJmmVpWqrERcTxnLo3AnA==", + "dev": true, + "requires": { + "globby": "^10.0.1", + "graceful-fs": "^4.2.2", + "is-glob": "^4.0.1", + "is-path-cwd": "^2.2.0", + "is-path-inside": "^3.0.1", + "p-map": "^3.0.0", + "rimraf": "^3.0.0", + "slash": "^3.0.0" + }, + "dependencies": { + "globby": { + "version": "10.0.2", + "resolved": "https://registry.npmjs.org/globby/-/globby-10.0.2.tgz", + "integrity": "sha512-7dUi7RvCoT/xast/o/dLN53oqND4yk0nsHkhRgn9w65C4PofCLOoJ39iSOg+qVDdWQPIEj+eszMHQ+aLVwwQSg==", + "dev": true, + "requires": { + "@types/glob": "^7.1.1", + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.0.3", + "glob": "^7.1.3", + "ignore": "^5.1.1", + "merge2": "^1.2.3", + "slash": "^3.0.0" + } + } + } + }, + "dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "requires": { + "path-type": "^4.0.0" + } + }, + "dot-prop": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.2.0.tgz", + "integrity": "sha512-uEUyaDKoSQ1M4Oq8l45hSE26SnTxL6snNnqvK/VWx5wJhmff5z0FUVJDKDanor/6w3kzE3i7XZOk+7wC0EXr1A==", + "dev": true, + "requires": { + "is-obj": "^2.0.0" + } + }, + "duplexer3": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", + "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=", + "dev": true + }, + "emittery": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.5.1.tgz", + "integrity": "sha512-sYZXNHH9PhTfs98ROEFVC3bLiR8KSqXQsEHIwZ9J6H0RaQObC3JYq4G8IvDd0b45/LxfGKYBpmaUN4LiKytaNw==", + "dev": true + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "dev": true, + "requires": { + "once": "^1.4.0" + } + }, + "equal-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/equal-length/-/equal-length-1.0.1.tgz", + "integrity": "sha1-IcoRLUirJLTh5//A5TOdMf38J0w=", + "dev": true + }, + "error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "requires": { + "is-arrayish": "^0.2.1" + } + }, + "escape-goat": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/escape-goat/-/escape-goat-2.1.1.tgz", + "integrity": "sha512-8/uIhbG12Csjy2JEW7D9pHbreaVaS/OpN3ycnyvElTdwM5n6GY6W6e2IPemfvGZeUMqZ9A/3GqIZMgKnBhAw/Q==", + "dev": true + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "estree-walker": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.1.tgz", + "integrity": "sha512-tF0hv+Yi2Ot1cwj9eYHtxC0jB9bmjacjQs6ZBTj82H8JwUywFuc+7E83NWfNMwHXZc11mjfFcVXPe9gEP4B8dg==", + "dev": true + }, + "esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true + }, + "fast-diff": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.2.0.tgz", + "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==", + "dev": true + }, + "fast-glob": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.2.tgz", + "integrity": "sha512-UDV82o4uQyljznxwMxyVRJgZZt3O5wENYojjzbaGEGZgeOxkLFf+V4cnUD+krzb2F72E18RhamkMZ7AdeggF7A==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.0", + "merge2": "^1.3.0", + "micromatch": "^4.0.2", + "picomatch": "^2.2.1" + } + }, + "fastq": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.6.1.tgz", + "integrity": "sha512-mpIH5sKYueh3YyeJwqtVo8sORi0CgtmkVbK6kZStpQlZBYQuTzG2CZ7idSiJuA7bY0SFCWUc5WIs+oYumGCQNw==", + "dev": true, + "requires": { + "reusify": "^1.0.4" + } + }, + "figures": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", + "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", + "dev": true, + "requires": { + "escape-string-regexp": "^1.0.5" + } + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "fsevents": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.2.tgz", + "integrity": "sha512-R4wDiBwZ0KzpgOWetKDug1FZcYhqYnUYKtfZYt4mD5SBz76q0KR4Q9o7GIPamsVPGmW3EYPPJ0dOOjvx32ldZA==", + "dev": true, + "optional": true + }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true + }, + "get-stream": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "dev": true, + "requires": { + "pump": "^3.0.0" + } + }, + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dev": true, + "requires": { + "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" + } + }, + "glob-parent": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.0.tgz", + "integrity": "sha512-qjtRgnIVmOfnKUE3NJAQEdk+lKrxfw8t5ke7SXtfMTHcjsBfOfWXCQfdb30zfDoZQ2IRSIiidmjtbHZPZ++Ihw==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "global-dirs": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-2.0.1.tgz", + "integrity": "sha512-5HqUqdhkEovj2Of/ms3IeS/EekcO54ytHRLV4PEY2rhRwrHXLQjeVEES0Lhka0xwNDtGYn58wyC4s5+MHsOO6A==", + "dev": true, + "requires": { + "ini": "^1.3.5" + } + }, + "globby": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.0.tgz", + "integrity": "sha512-iuehFnR3xu5wBBtm4xi0dMe92Ob87ufyu/dHwpDYfbcpYpIbrO5OnS8M1vWvrBhSGEJ3/Ecj7gnX76P8YxpPEg==", + "dev": true, + "requires": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.1.1", + "ignore": "^5.1.4", + "merge2": "^1.3.0", + "slash": "^3.0.0" + } + }, + "got": { + "version": "9.6.0", + "resolved": "https://registry.npmjs.org/got/-/got-9.6.0.tgz", + "integrity": "sha512-R7eWptXuGYxwijs0eV+v3o6+XH1IqVK8dJOEecQfTmkncw9AV4dcw/Dhxi8MdlqPthxxpZyizMzyg8RTmEsG+Q==", + "dev": true, + "requires": { + "@sindresorhus/is": "^0.14.0", + "@szmarczak/http-timer": "^1.1.2", + "cacheable-request": "^6.0.0", + "decompress-response": "^3.3.0", + "duplexer3": "^0.1.4", + "get-stream": "^4.1.0", + "lowercase-keys": "^1.0.1", + "mimic-response": "^1.0.1", + "p-cancelable": "^1.0.0", + "to-readable-stream": "^1.0.0", + "url-parse-lax": "^3.0.0" + } + }, + "graceful-fs": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz", + "integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "has-yarn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/has-yarn/-/has-yarn-2.1.0.tgz", + "integrity": "sha512-UqBRqi4ju7T+TqGNdqAO0PaSVGsDGJUBQvk9eUWNGRY1CFGDzYhLWoM7JQEemnlvVcv/YEmc2wNW8BC24EnUsw==", + "dev": true + }, + "hosted-git-info": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", + "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", + "dev": true + }, + "http-cache-semantics": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz", + "integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==", + "dev": true + }, + "ignore": { + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.4.tgz", + "integrity": "sha512-MzbUSahkTW1u7JpKKjY7LCARd1fU5W2rLdxlM4kdkayuCwZImjkpluF9CM1aLewYJguPDqewLam18Y6AU69A8A==", + "dev": true + }, + "ignore-by-default": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", + "integrity": "sha1-SMptcvbGo68Aqa1K5odr44ieKwk=", + "dev": true + }, + "import-lazy": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-2.1.0.tgz", + "integrity": "sha1-BWmOPUXIjo1+nZLLBYTnfwlvPkM=", + "dev": true + }, + "import-local": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.0.2.tgz", + "integrity": "sha512-vjL3+w0oulAVZ0hBHnxa/Nm5TAurf9YLQJDhqRZyqb+VKGOB6LU8t9H1Nr5CIo16vh9XfJTOoHwU0B71S557gA==", + "dev": true, + "requires": { + "pkg-dir": "^4.2.0", + "resolve-cwd": "^3.0.0" + } + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, + "indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "dev": true + }, + "irregular-plurals": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/irregular-plurals/-/irregular-plurals-3.2.0.tgz", + "integrity": "sha512-YqTdPLfwP7YFN0SsD3QUVCkm9ZG2VzOXv3DOrw5G5mkMbVwptTwVcFv7/C0vOpBmgTxAeTG19XpUs1E522LW9Q==", + "dev": true + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "requires": { + "binary-extensions": "^2.0.0" + } + }, + "is-ci": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", + "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==", + "dev": true, + "requires": { + "ci-info": "^2.0.0" + } + }, + "is-error": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/is-error/-/is-error-2.2.2.tgz", + "integrity": "sha512-IOQqts/aHWbiisY5DuPJQ0gcbvaLFCa7fBa9xoLfxBZvQ+ZI/Zh9xoI7Gk+G64N0FdK4AbibytHht2tWgpJWLg==", + "dev": true + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-installed-globally": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.3.1.tgz", + "integrity": "sha512-oiEcGoQbGc+3/iijAijrK2qFpkNoNjsHOm/5V5iaeydyrS/hnwaRCEgH5cpW0P3T1lSjV5piB7S5b5lEugNLhg==", + "dev": true, + "requires": { + "global-dirs": "^2.0.1", + "is-path-inside": "^3.0.1" + } + }, + "is-interactive": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz", + "integrity": "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==", + "dev": true + }, + "is-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz", + "integrity": "sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE=", + "dev": true + }, + "is-npm": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-4.0.0.tgz", + "integrity": "sha512-96ECIfh9xtDDlPylNPXhzjsykHsMJZ18ASpaWzQyBr4YRTcVjUvzaHayDAES2oU/3KpljhHUjtSRNiDwi0F0ig==", + "dev": true + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "is-obj": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", + "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==", + "dev": true + }, + "is-path-cwd": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-2.2.0.tgz", + "integrity": "sha512-w942bTcih8fdJPJmQHFzkS76NEP8Kzzvmw92cXsazb8intwLqPibPPdXf4ANdKV3rYMuuQYGIWtvz9JilB3NFQ==", + "dev": true + }, + "is-path-inside": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.2.tgz", + "integrity": "sha512-/2UGPSgmtqwo1ktx8NDHjuPwZWmHhO+gj0f93EkhLB5RgW9RZevWYYlIkS6zePc6U2WpOdQYIwHe9YC4DWEBVg==", + "dev": true + }, + "is-plain-object": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-3.0.0.tgz", + "integrity": "sha512-tZIpofR+P05k8Aocp7UI/2UTa9lTJSebCXpFFoR9aibpokDj/uXBsJ8luUu0tTVYKkMU6URDUuOfJZ7koewXvg==", + "dev": true, + "requires": { + "isobject": "^4.0.0" + } + }, + "is-promise": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", + "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", + "dev": true + }, + "is-reference": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.2.1.tgz", + "integrity": "sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==", + "dev": true, + "requires": { + "@types/estree": "*" + } + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true + }, + "is-yarn-global": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/is-yarn-global/-/is-yarn-global-0.3.0.tgz", + "integrity": "sha512-VjSeb/lHmkoyd8ryPVIKvOCn4D1koMqY+vqyjjUfc3xyKtP4dYOxM44sZrnqQSzSds3xyOrUTLTC9LVCVgLngw==", + "dev": true + }, + "isobject": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-4.0.0.tgz", + "integrity": "sha512-S/2fF5wH8SJA/kmwr6HYhK/RI/OkhD84k8ntalo0iJjZikgq1XFvR5M8NPT1x5F7fBwCG3qHfnzeP/Vh/ZxCUA==", + "dev": true + }, + "jest-worker": { + "version": "26.3.0", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.3.0.tgz", + "integrity": "sha512-Vmpn2F6IASefL+DVBhPzI2J9/GJUsqzomdeN+P+dK8/jKxbh8R3BtFnx3FIta7wYlPU62cpJMJQo4kuOowcMnw==", + "dev": true, + "requires": { + "@types/node": "*", + "merge-stream": "^2.0.0", + "supports-color": "^7.0.0" + } + }, + "js-string-escape": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/js-string-escape/-/js-string-escape-1.0.1.tgz", + "integrity": "sha1-4mJbrbwNZ8dTPp7cEGjFh65BN+8=", + "dev": true + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "js-yaml": { + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", + "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "jsbi": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/jsbi/-/jsbi-3.1.2.tgz", + "integrity": "sha512-5nDXo1X9QVaXK/Cpb5VECV9ss1QPbjUuk1qSruHB1PK/g39Sd414K4nci99ElFDZv0vzxDEnKn3o49/Tn9Yagw==" + }, + "json-buffer": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz", + "integrity": "sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg=", + "dev": true + }, + "json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true + }, + "keyv": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-3.1.0.tgz", + "integrity": "sha512-9ykJ/46SN/9KPM/sichzQ7OvXyGDYKGTaDlKMGCAlg2UK8KRy4jb0d8sFc+0Tt0YYnThq8X2RZgCg74RPxgcVA==", + "dev": true, + "requires": { + "json-buffer": "3.0.0" + } + }, + "latest-version": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-5.1.0.tgz", + "integrity": "sha512-weT+r0kTkRQdCdYCNtkMwWXQTMEswKrFBkm4ckQOMVhhqhIMI1UT2hMj+1iigIhgSZm5gTmrRXBNoGUgaTY1xA==", + "dev": true, + "requires": { + "package-json": "^6.3.0" + } + }, + "lines-and-columns": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz", + "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=", + "dev": true + }, + "load-json-file": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-5.3.0.tgz", + "integrity": "sha512-cJGP40Jc/VXUsp8/OrnyKyTZ1y6v/dphm3bioS+RrKXjK2BB6wHUd6JptZEFDGgGahMT+InnZO5i1Ei9mpC8Bw==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.15", + "parse-json": "^4.0.0", + "pify": "^4.0.1", + "strip-bom": "^3.0.0", + "type-fest": "^0.3.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "lodash": { + "version": "4.17.19", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", + "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==", + "dev": true + }, + "lodash.clonedeep": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", + "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=", + "dev": true + }, + "lodash.flattendeep": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz", + "integrity": "sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI=", + "dev": true + }, + "lodash.islength": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lodash.islength/-/lodash.islength-4.0.1.tgz", + "integrity": "sha1-Tpho1FJXXXUK/9NYyXlUPcIO1Xc=", + "dev": true + }, + "lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, + "log-symbols": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-3.0.0.tgz", + "integrity": "sha512-dSkNGuI7iG3mfvDzUuYZyvk5dD9ocYCYzNU6CYDE6+Xqd+gwme6Z00NS3dUh8mq/73HaEtT7m6W+yUPtU6BZnQ==", + "dev": true, + "requires": { + "chalk": "^2.4.2" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "lowercase-keys": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", + "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==", + "dev": true + }, + "magic-string": { + "version": "0.25.7", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz", + "integrity": "sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA==", + "dev": true, + "requires": { + "sourcemap-codec": "^1.4.4" + } + }, + "make-dir": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.0.2.tgz", + "integrity": "sha512-rYKABKutXa6vXTXhoV18cBE7PaewPXHe/Bdq4v+ZLMhxbWApkFFplT0LcbMW+6BbjnQXzZ/sAvSE/JdguApG5w==", + "dev": true, + "requires": { + "semver": "^6.0.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "matcher": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/matcher/-/matcher-2.1.0.tgz", + "integrity": "sha512-o+nZr+vtJtgPNklyeUKkkH42OsK8WAfdgaJE2FNxcjLPg+5QbeEoT6vRj8Xq/iv18JlQ9cmKsEu0b94ixWf1YQ==", + "dev": true, + "requires": { + "escape-string-regexp": "^2.0.0" + }, + "dependencies": { + "escape-string-regexp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", + "dev": true + } + } + }, + "md5-hex": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/md5-hex/-/md5-hex-3.0.1.tgz", + "integrity": "sha512-BUiRtTtV39LIJwinWBjqVsU9xhdnz7/i889V859IBFpuqGAj6LuOvHv5XLbgZ2R7ptJoJaEcxkv88/h25T7Ciw==", + "dev": true, + "requires": { + "blueimp-md5": "^2.10.0" + } + }, + "md5-o-matic": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/md5-o-matic/-/md5-o-matic-0.1.1.tgz", + "integrity": "sha1-givM1l4RfFFPqxdrJZRdVBAKA8M=", + "dev": true + }, + "merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true + }, + "merge2": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.3.0.tgz", + "integrity": "sha512-2j4DAdlBOkiSZIsaXk4mTE3sRS02yBHAtfy127xRV3bQUFqXkjHCHLW6Scv7DwNRbIWNHH8zpnz9zMaKXIdvYw==", + "dev": true + }, + "micromatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", + "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", + "dev": true, + "requires": { + "braces": "^3.0.1", + "picomatch": "^2.0.5" + } + }, + "mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true + }, + "mimic-response": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", + "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==", + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "mute-stream": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", + "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", + "dev": true + }, + "node-fetch": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", + "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==" + }, + "normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true + }, + "normalize-url": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.0.tgz", + "integrity": "sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ==", + "dev": true + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "onetime": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.0.tgz", + "integrity": "sha512-5NcSkPHhwTVFIQN+TUqXoS5+dlElHXdpAWu9I0HP20YOtIi+aZ0Ct82jdlILDxjLEAWwvm+qj1m6aEtsDVmm6Q==", + "dev": true, + "requires": { + "mimic-fn": "^2.1.0" + } + }, + "ora": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/ora/-/ora-4.0.3.tgz", + "integrity": "sha512-fnDebVFyz309A73cqCipVL1fBZewq4vwgSHfxh43vVy31mbyoQ8sCH3Oeaog/owYOs/lLlGVPCISQonTneg6Pg==", + "dev": true, + "requires": { + "chalk": "^3.0.0", + "cli-cursor": "^3.1.0", + "cli-spinners": "^2.2.0", + "is-interactive": "^1.0.0", + "log-symbols": "^3.0.0", + "mute-stream": "0.0.8", + "strip-ansi": "^6.0.0", + "wcwidth": "^1.0.1" + } + }, + "p-cancelable": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-1.1.0.tgz", + "integrity": "sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw==", + "dev": true + }, + "p-limit": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.2.tgz", + "integrity": "sha512-WGR+xHecKTr7EbUEhyLSh5Dube9JtdiG78ufaeLxTgpudf/20KqyMioIUZJAezlTIi6evxuoUs9YXc11cU+yzQ==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "p-map": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", + "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", + "dev": true, + "requires": { + "aggregate-error": "^3.0.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "package-json": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/package-json/-/package-json-6.5.0.tgz", + "integrity": "sha512-k3bdm2n25tkyxcjSKzB5x8kfVxlMdgsbPr0GkZcwHsLpba6cBjqCt1KlcChKEvxHIcTB1FVMuwoijZ26xex5MQ==", + "dev": true, + "requires": { + "got": "^9.6.0", + "registry-auth-token": "^4.0.0", + "registry-url": "^5.0.0", + "semver": "^6.2.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "dev": true, + "requires": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + } + }, + "parse-ms": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-2.1.0.tgz", + "integrity": "sha512-kHt7kzLoS9VBZfUsiKjv43mr91ea+U05EyKkEtqp7vNbHxmaVuEqN7XxeEVnGrMtYOAxGrDElSi96K7EgO1zCA==", + "dev": true + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "dev": true + }, + "path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true + }, + "picomatch": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.1.tgz", + "integrity": "sha512-ISBaA8xQNmwELC7eOjqFKMESB2VIqt4PPDD0nsS95b/9dZXvVKOlz9keMSnoGGKcOHXfTvDD6WMaRoSc9UuhRA==", + "dev": true + }, + "pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "dev": true + }, + "pkg-conf": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/pkg-conf/-/pkg-conf-3.1.0.tgz", + "integrity": "sha512-m0OTbR/5VPNPqO1ph6Fqbj7Hv6QU7gR/tQW40ZqrL1rjgCU85W6C1bJn0BItuJqnR98PWzw7Z8hHeChD1WrgdQ==", + "dev": true, + "requires": { + "find-up": "^3.0.0", + "load-json-file": "^5.2.0" + }, + "dependencies": { + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + } + } + }, + "pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "requires": { + "find-up": "^4.0.0" + } + }, + "plur": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/plur/-/plur-4.0.0.tgz", + "integrity": "sha512-4UGewrYgqDFw9vV6zNV+ADmPAUAfJPKtGvb/VdpQAx25X5f3xXdGdyOEVFwkl8Hl/tl7+xbeHqSEM+D5/TirUg==", + "dev": true, + "requires": { + "irregular-plurals": "^3.2.0" + } + }, + "prepend-http": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", + "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=", + "dev": true + }, + "prettier": { + "version": "1.19.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.19.1.tgz", + "integrity": "sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==", + "dev": true + }, + "pretty-ms": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-6.0.1.tgz", + "integrity": "sha512-ke4njoVmlotekHlHyCZ3wI/c5AMT8peuHs8rKJqekj/oR5G8lND2dVpicFlUz5cbZgE290vvkMuDwfj/OcW1kw==", + "dev": true, + "requires": { + "parse-ms": "^2.1.0" + } + }, + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "pupa": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pupa/-/pupa-2.0.1.tgz", + "integrity": "sha512-hEJH0s8PXLY/cdXh66tNEQGndDrIKNqNC5xmrysZy3i5C3oEoLna7YAOad+7u125+zH1HNXUmGEkrhb3c2VriA==", + "dev": true, + "requires": { + "escape-goat": "^2.0.0" + } + }, + "randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "requires": { + "safe-buffer": "^5.1.0" + } + }, + "rc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "dev": true, + "requires": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + } + }, + "read-pkg": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", + "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", + "dev": true, + "requires": { + "@types/normalize-package-data": "^2.4.0", + "normalize-package-data": "^2.5.0", + "parse-json": "^5.0.0", + "type-fest": "^0.6.0" + }, + "dependencies": { + "parse-json": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.0.0.tgz", + "integrity": "sha512-OOY5b7PAEFV0E2Fir1KOkxchnZNCdowAJgQ5NuxjpBKTRP3pQhwkrkxqQjeoKJ+fO7bCpmIZaogI4eZGDMEGOw==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1", + "lines-and-columns": "^1.1.6" + } + }, + "type-fest": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", + "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", + "dev": true + } + } + }, + "readdirp": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.3.0.tgz", + "integrity": "sha512-zz0pAkSPOXXm1viEwygWIPSPkcBYjW1xU5j/JBh5t9bGCJwa6f9+BJa6VaB2g+b55yVrmXzqkyLf4xaWYM0IkQ==", + "dev": true, + "requires": { + "picomatch": "^2.0.7" + } + }, + "registry-auth-token": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-4.1.1.tgz", + "integrity": "sha512-9bKS7nTl9+/A1s7tnPeGrUpRcVY+LUh7bfFgzpndALdPfXQBfQV77rQVtqgUV3ti4vc/Ik81Ex8UJDWDQ12zQA==", + "dev": true, + "requires": { + "rc": "^1.2.8" + } + }, + "registry-url": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-5.1.0.tgz", + "integrity": "sha512-8acYXXTI0AkQv6RAOjE3vOaIXZkT9wo4LOFbBKYQEEnnMNBpKqdUrI6S4NT0KPIo/WVvJ5tE/X5LF/TQUf0ekw==", + "dev": true, + "requires": { + "rc": "^1.2.8" + } + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "dev": true + }, + "require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "dev": true + }, + "resolve": { + "version": "1.15.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.15.1.tgz", + "integrity": "sha512-84oo6ZTtoTUpjgNEr5SJyzQhzL72gaRodsSfyxC/AXRvwu0Yse9H8eF9IpGo7b8YetZhlI6v7ZQ6bKBFV/6S7w==", + "dev": true, + "requires": { + "path-parse": "^1.0.6" + } + }, + "resolve-cwd": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", + "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", + "dev": true, + "requires": { + "resolve-from": "^5.0.0" + } + }, + "resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true + }, + "responselike": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/responselike/-/responselike-1.0.2.tgz", + "integrity": "sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec=", + "dev": true, + "requires": { + "lowercase-keys": "^1.0.0" + } + }, + "restore-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", + "dev": true, + "requires": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + } + }, + "reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true + }, + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "rollup": { + "version": "2.26.11", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.26.11.tgz", + "integrity": "sha512-xyfxxhsE6hW57xhfL1I+ixH8l2bdoIMaAecdQiWF3N7IgJEMu99JG+daBiSZQjnBpzFxa0/xZm+3pbCdAQehHw==", + "dev": true, + "requires": { + "fsevents": "~2.1.2" + } + }, + "rollup-plugin-terser": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/rollup-plugin-terser/-/rollup-plugin-terser-7.0.2.tgz", + "integrity": "sha512-w3iIaU4OxcF52UUXiZNsNeuXIMDvFrr+ZXK6bFZ0Q60qyVfq4uLptoS4bbq3paG3x216eQllFZX7zt6TIImguQ==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.10.4", + "jest-worker": "^26.2.1", + "serialize-javascript": "^4.0.0", + "terser": "^5.0.0" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz", + "integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==", + "dev": true, + "requires": { + "@babel/highlight": "^7.10.4" + } + }, + "@babel/highlight": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", + "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.10.4", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "run-parallel": { + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.9.tgz", + "integrity": "sha512-DEqnSRTDw/Tc3FXf49zedI638Z9onwUotBMiUFKmrO2sdFKIbXamXGQ3Axd4qgphxKB4kw/qP1w5kTxnfU1B9Q==", + "dev": true + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + }, + "semver-diff": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-3.1.1.tgz", + "integrity": "sha512-GX0Ix/CJcHyB8c4ykpHGIAvLyOwOobtM/8d+TQkAd81/bEjgPHrfba41Vpesr7jX/t8Uh+R3EX9eAS5be+jQYg==", + "dev": true, + "requires": { + "semver": "^6.3.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "serialize-error": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/serialize-error/-/serialize-error-2.1.0.tgz", + "integrity": "sha1-ULZ51WNc34Rme9yOWa9OW4HV9go=", + "dev": true + }, + "serialize-javascript": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-4.0.0.tgz", + "integrity": "sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw==", + "dev": true, + "requires": { + "randombytes": "^2.1.0" + } + }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "dev": true + }, + "signal-exit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "dev": true + }, + "slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true + }, + "slice-ansi": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-3.0.0.tgz", + "integrity": "sha512-pSyv7bSTC7ig9Dcgbw9AuRNUb5k5V6oDudjZoMBSr13qpLBG7tB+zgCkARjq7xIUgdz5P1Qe8u+rSGdouOOIyQ==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "source-map-support": { + "version": "0.5.16", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.16.tgz", + "integrity": "sha512-efyLRJDr68D9hBBNIPWFjhpFzURh+KJykQwvMyW5UiZzYwoF6l4YMMDIJJEyFWxWCqfyxLzz6tSfUFR+kXXsVQ==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "sourcemap-codec": { + "version": "1.4.8", + "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", + "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==", + "dev": true + }, + "spdx-correct": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", + "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", + "dev": true, + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", + "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==", + "dev": true + }, + "spdx-expression-parse": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", + "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", + "dev": true, + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz", + "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==", + "dev": true + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "stack-utils": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.1.tgz", + "integrity": "sha512-BvBTnHGm8boe+HiJFqP19ywEsGlfQAKqW78pbfvUuzCbUuxPPUyLrH5dYFY+Xn9IpLY3b5ZmMcl8jAqXB4wddg==", + "dev": true, + "requires": { + "escape-string-regexp": "^2.0.0" + }, + "dependencies": { + "escape-string-regexp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", + "dev": true + } + } + }, + "string-width": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + } + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "dev": true + }, + "supertap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supertap/-/supertap-1.0.0.tgz", + "integrity": "sha512-HZJ3geIMPgVwKk2VsmO5YHqnnJYl6bV5A9JW2uzqV43WmpgliNEYbuvukfor7URpaqpxuw3CfZ3ONdVbZjCgIA==", + "dev": true, + "requires": { + "arrify": "^1.0.1", + "indent-string": "^3.2.0", + "js-yaml": "^3.10.0", + "serialize-error": "^2.1.0", + "strip-ansi": "^4.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "dev": true + }, + "indent-string": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", + "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=", + "dev": true + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + } + } + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + }, + "temp-dir": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/temp-dir/-/temp-dir-2.0.0.tgz", + "integrity": "sha512-aoBAniQmmwtcKp/7BzsH8Cxzv8OL736p7v1ihGb5e9DJ9kTwGWHrQrVB5+lfVDzfGrdRzXch+ig7LHaY1JTOrg==", + "dev": true + }, + "term-size": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/term-size/-/term-size-2.2.0.tgz", + "integrity": "sha512-a6sumDlzyHVJWb8+YofY4TW112G6p2FCPEAFk+59gIYHv3XHRhm9ltVQ9kli4hNWeQBwSpe8cRN25x0ROunMOw==", + "dev": true + }, + "terser": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.3.1.tgz", + "integrity": "sha512-yD80f4hdwCWTH5mojzxe1q8bN1oJbsK/vfJGLcPZM/fl+/jItIVNKhFIHqqR71OipFWMLgj3Kc+GIp6CeIqfnA==", + "dev": true, + "requires": { + "commander": "^2.20.0", + "source-map": "~0.6.1", + "source-map-support": "~0.5.12" + } + }, + "time-zone": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/time-zone/-/time-zone-1.0.0.tgz", + "integrity": "sha1-mcW/VZWJZq9tBtg73zgA3IL67F0=", + "dev": true + }, + "to-readable-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/to-readable-stream/-/to-readable-stream-1.0.0.tgz", + "integrity": "sha512-Iq25XBt6zD5npPhlLVXGFN3/gyR2/qODcKNNyTMd4vbm39HUaOiAM4PMq0eMVC/Tkxz+Zjdsc55g9yyz+Yq00Q==", + "dev": true + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + }, + "trim-off-newlines": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/trim-off-newlines/-/trim-off-newlines-1.0.1.tgz", + "integrity": "sha1-n5up2e+odkw4dpi8v+sshI8RrbM=", + "dev": true + }, + "type-fest": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.3.1.tgz", + "integrity": "sha512-cUGJnCdr4STbePCgqNFbpVNCepa+kAVohJs1sLhxzdH+gnEoOd8VhbYa7pD3zZYGiURWM2xzEII3fQcRizDkYQ==", + "dev": true + }, + "typedarray-to-buffer": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", + "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", + "dev": true, + "requires": { + "is-typedarray": "^1.0.0" + } + }, + "unique-string": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-2.0.0.tgz", + "integrity": "sha512-uNaeirEPvpZWSgzwsPGtU2zVSTrn/8L5q/IexZmH0eH6SA73CmAA5U4GwORTxQAZs95TAXLNqeLoPPNO5gZfWg==", + "dev": true, + "requires": { + "crypto-random-string": "^2.0.0" + } + }, + "update-notifier": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-4.1.0.tgz", + "integrity": "sha512-w3doE1qtI0/ZmgeoDoARmI5fjDoT93IfKgEGqm26dGUOh8oNpaSTsGNdYRN/SjOuo10jcJGwkEL3mroKzktkew==", + "dev": true, + "requires": { + "boxen": "^4.2.0", + "chalk": "^3.0.0", + "configstore": "^5.0.1", + "has-yarn": "^2.1.0", + "import-lazy": "^2.1.0", + "is-ci": "^2.0.0", + "is-installed-globally": "^0.3.1", + "is-npm": "^4.0.0", + "is-yarn-global": "^0.3.0", + "latest-version": "^5.0.0", + "pupa": "^2.0.1", + "semver-diff": "^3.1.1", + "xdg-basedir": "^4.0.0" + } + }, + "url-parse-lax": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-3.0.0.tgz", + "integrity": "sha1-FrXK/Afb42dsGxmZF3gj1lA6yww=", + "dev": true, + "requires": { + "prepend-http": "^2.0.0" + } + }, + "validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "requires": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "wcwidth": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", + "integrity": "sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g=", + "dev": true, + "requires": { + "defaults": "^1.0.3" + } + }, + "well-known-symbols": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/well-known-symbols/-/well-known-symbols-2.0.0.tgz", + "integrity": "sha512-ZMjC3ho+KXo0BfJb7JgtQ5IBuvnShdlACNkKkdsqBmYw3bPAaJfPeYUo6tLUaT5tG/Gkh7xkpBhKRQ9e7pyg9Q==", + "dev": true + }, + "which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", + "dev": true + }, + "widest-line": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz", + "integrity": "sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg==", + "dev": true, + "requires": { + "string-width": "^4.0.0" + } + }, + "wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "write-file-atomic": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", + "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", + "dev": true, + "requires": { + "imurmurhash": "^0.1.4", + "is-typedarray": "^1.0.0", + "signal-exit": "^3.0.2", + "typedarray-to-buffer": "^3.1.5" + } + }, + "xdg-basedir": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-4.0.0.tgz", + "integrity": "sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q==", + "dev": true + }, + "y18n": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", + "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", + "dev": true + }, + "yargs": { + "version": "15.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "dev": true, + "requires": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" + }, + "dependencies": { + "yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + } + } + } +} diff --git a/packages/core/package.json b/packages/core/package.json new file mode 100644 index 000000000..4b8735527 --- /dev/null +++ b/packages/core/package.json @@ -0,0 +1,38 @@ +{ + "name": "ckb-js-toolkit", + "version": "0.10.2", + "description": "JavaScript toolkits used to build dapps for Nervos CKB", + "main": "dist/ckb-js-toolkit.node.js", + "browser": "dist/ckb-js-toolkit.esm.js", + "types": "index.d.ts", + "repository": { + "type": "git", + "url": "https://github.com/xxuejie/ckb-js-toolkit.git" + }, + "files": [ + "index.d.ts", + "dist" + ], + "scripts": { + "build": "rollup -c --environment BUILD:production", + "test": "rollup -c --environment BUILD:development && ava", + "fmt": "prettier --write \"{src,tests}/**/*.js\" index.d.ts", + "lint": "eslint -c ../../.eslintrc.js \"{src,tests}/**/*.js\"", + "update-test-files": "curl -L https://raw.githubusercontent.com/nervosnetwork/ckb/27c36a55e6358fd04153ec3da4638b6e10660da6/util/types/schemas/blockchain.mol -o testfiles/blockchain.mol && moleculec --language - --schema-file testfiles/blockchain.mol --format json > testfiles/blockchain.json && moleculec-es -inputFile testfiles/blockchain.json -outputFile testfiles/blockchain.esm.js && rollup -f umd -i testfiles/blockchain.esm.js -o testfiles/blockchain.umd.js --name Blockchain && rm testfiles/blockchain.mol testfiles/blockchain.json testfiles/blockchain.esm.js" + }, + "author": "Xuejie Xiao", + "license": "MIT", + "dependencies": { + "cross-fetch": "^3.0.6", + "jsbi": "^3.1.2" + }, + "devDependencies": { + "@rollup/plugin-commonjs": "^15.0.0", + "@rollup/plugin-node-resolve": "^9.0.0", + "@rollup/plugin-replace": "^2.3.3", + "ava": "^3.5.0", + "prettier": "1.19.1", + "rollup": "^2.22.0", + "rollup-plugin-terser": "^7.0.2" + } +} diff --git a/packages/core/rollup.config.js b/packages/core/rollup.config.js new file mode 100644 index 000000000..1a78fdd38 --- /dev/null +++ b/packages/core/rollup.config.js @@ -0,0 +1,57 @@ +import resolve from "@rollup/plugin-node-resolve"; +import commonjs from "@rollup/plugin-commonjs"; +import replace from "@rollup/plugin-replace"; +import { terser } from "rollup-plugin-terser"; + +import * as package_json from "./package.json"; + +const isProduction = process.env.BUILD === 'production'; +const outputFolder = isProduction ? "lib" : "build"; +const sourcemap = !isProduction; + +module.exports = [ + { + input: "src/index.js", + output: { + file: outputFolder + "/ckb-js-toolkit.node.js", + format: "cjs", + sourcemap: true + }, + plugins: [ + replace({__development_build__: package_json.version}), + resolve({preferBuiltins: true}), + commonjs(), + isProduction && terser() + ] + }, + // TODO: do we need sourcemap for UMD and ESM versions? + { + input: "src/index.js", + output: { + file: outputFolder + "/ckb-js-toolkit.umd.js", + format: "umd", + name: "CKBJSToolkit", + sourcemap: sourcemap + }, + plugins: [ + replace({__development_build__: package_json.version}), + resolve({browser: true, preferBuiltins: false}), + commonjs(), + isProduction && terser() + ] + }, + { + input: "src/index.js", + output: { + file: outputFolder + "/ckb-js-toolkit.esm.js", + format: "esm", + sourcemap: sourcemap + }, + plugins: [ + replace({__development_build__: package_json.version}), + resolve({browser: true, preferBuiltins: false}), + commonjs(), + isProduction && terser() + ] + } +]; diff --git a/packages/core/src/cell_collectors/index.js b/packages/core/src/cell_collectors/index.js new file mode 100644 index 000000000..825acff85 --- /dev/null +++ b/packages/core/src/cell_collectors/index.js @@ -0,0 +1 @@ +export { RPCCollector } from "./rpc_collector"; diff --git a/packages/core/src/cell_collectors/rpc_collector.js b/packages/core/src/cell_collectors/rpc_collector.js new file mode 100644 index 000000000..3649610d0 --- /dev/null +++ b/packages/core/src/cell_collectors/rpc_collector.js @@ -0,0 +1,77 @@ +import JSBI from "jsbi"; +import { Reader } from "../reader"; +import { HexStringToBigInt, BigIntToHexString } from "../rpc"; + +export class RPCCollector { + constructor( + rpc, + lockHash, + { + skipCellWithContent = true, + loadData = false, + loadBlockNumber = true + } = {} + ) { + this.rpc = rpc; + this.lockHash = new Reader(lockHash).serializeJson(); + this.skipCellWithContent = skipCellWithContent; + this.loadData = loadData; + this.loadBlockNumber = loadBlockNumber; + } + + async *collect() { + const to = HexStringToBigInt(await this.rpc.get_tip_block_number()); + let currentFrom = JSBI.BigInt(0); + while (JSBI.lessThanOrEqual(currentFrom, to)) { + let currentTo = JSBI.add(currentFrom, JSBI.BigInt(100)); + if (JSBI.greaterThan(currentTo, to)) { + currentTo = to; + } + const cells = await this.rpc.get_cells_by_lock_hash( + this.lockHash, + BigIntToHexString(currentFrom), + BigIntToHexString(currentTo) + ); + for (const cell of cells) { + if (this.skipCellWithContent) { + if ( + cell.type || + JSBI.greaterThan( + HexStringToBigInt(cell.output_data_len), + JSBI.BigInt(100) + ) + ) { + continue; + } + } + let data = null; + if (this.loadData) { + const cellWithData = await this.rpc.get_live_cell( + cell.out_point, + true + ); + data = cellWithData.cell.data.content; + } + let block_number = null; + if (this.loadBlockNumber) { + const header = await this.rpc.get_header(cell.block_hash); + block_number = header.number; + } + yield { + cellbase: cell.cellbase, + cell_output: { + capacity: cell.capacity, + lock: cell.lock, + type: cell.type + }, + out_point: cell.out_point, + block_hash: cell.block_hash, + data: data, + output_data_len: cell.output_data_len, + block_number + }; + } + currentFrom = JSBI.add(currentTo, JSBI.BigInt(1)); + } + } +} diff --git a/packages/core/src/index.js b/packages/core/src/index.js new file mode 100644 index 000000000..31daadc3b --- /dev/null +++ b/packages/core/src/index.js @@ -0,0 +1,8 @@ +export { Reader } from "./reader.js"; +export { TransactionDumper } from "./transaction_dumper.js"; +export { RPC, HexStringToBigInt, BigIntToHexString } from "./rpc.js"; +export * as normalizers from "./normalizers"; +export * as transformers from "./transformers"; +export * as validators from "./validators"; +export * as cell_collectors from "./cell_collectors"; +export const VERSION = "__development_build__"; diff --git a/packages/core/src/normalizers.js b/packages/core/src/normalizers.js new file mode 100644 index 000000000..4f0eaced0 --- /dev/null +++ b/packages/core/src/normalizers.js @@ -0,0 +1,268 @@ +// This package provides normalizer functions. Even though CKB uses molecule +// as the serialization layer. There is still CKB specific knowledge that does +// not belong in molecule. For example, all numbers in CKB protocols are +// serialized using little endian format. This package tries to encode such +// knowledge. The goal here, is that you are free to use whatever types that +// makes most sense to represent the values. As long as you pass your object +// through the normalizers here, molecule should be able to serialize the values +// into correct formats required by CKB. +// +// Note this is only used when you need to deal with CKB structures in molecule +// format. If you are using RPCs or GraphQL to interact with CKB, chances are you +// will not need this package. +import JSBI from "jsbi"; +import { Reader } from "./reader"; +import { BigIntToHexString } from "./rpc"; + +function normalizeHexNumber(length) { + return function(debugPath, value) { + if (!(value instanceof ArrayBuffer)) { + let intValue = BigIntToHexString(JSBI.BigInt(value)).substr(2); + if (intValue.length % 2 !== 0) { + intValue = "0" + intValue; + } + if (intValue.length / 2 > length) { + throw new Error( + `${debugPath} is ${intValue.length / + 2} bytes long, expected length is ${length}!` + ); + } + const view = new DataView(new ArrayBuffer(length)); + for (let i = 0; i < intValue.length / 2; i++) { + const start = intValue.length - (i + 1) * 2; + view.setUint8(i, parseInt(intValue.substr(start, 2), 16)); + } + value = view.buffer; + } + if (value.byteLength < length) { + const array = new Uint8Array(length); + array.set(new Uint8Array(value), 0); + value = array.buffer; + } + return value; + }; +} + +function normalizeRawData(length) { + return function(debugPath, value) { + value = new Reader(value).toArrayBuffer(); + if (length > 0 && value.byteLength !== length) { + throw new Error( + `${debugPath} has invalid length ${value.byteLength}, required: ${length}` + ); + } + return value; + }; +} + +function normalizeObject(debugPath, object, keys) { + const result = {}; + + for (const [key, f] of Object.entries(keys)) { + const value = object[key]; + if (!value) { + throw new Error(`${debugPath} is missing ${key}!`); + } + result[key] = f(`${debugPath}.${key}`, value); + } + return result; +} + +export function NormalizeScript(script, { debugPath = "script" } = {}) { + return normalizeObject(debugPath, script, { + code_hash: normalizeRawData(32), + hash_type: function(debugPath, value) { + switch (value) { + case "data": + return 0; + case "type": + return 1; + case 0: + return value; + case 1: + return value; + default: + throw new Error(`${debugPath}.hash_type has invalid value: ${value}`); + } + }, + args: normalizeRawData(-1) + }); +} + +export function NormalizeOutPoint(outPoint, { debugPath = "out_point" } = {}) { + return normalizeObject(debugPath, outPoint, { + tx_hash: normalizeRawData(32), + index: normalizeHexNumber(4) + }); +} + +function toNormalize(normalize) { + return function(debugPath, value) { + return normalize(value, { + debugPath + }); + }; +} + +export function NormalizeCellInput( + cellInput, + { debugPath = "cell_input" } = {} +) { + return normalizeObject(debugPath, cellInput, { + since: normalizeHexNumber(8), + previous_output: toNormalize(NormalizeOutPoint) + }); +} + +export function NormalizeCellOutput( + cellOutput, + { debugPath = "cell_output" } = {} +) { + const result = normalizeObject(debugPath, cellOutput, { + capacity: normalizeHexNumber(8), + lock: toNormalize(NormalizeScript) + }); + if (cellOutput.type) { + result.type_ = NormalizeScript(cellOutput.type, { + debugPath: `${debugPath}.type` + }); + } + return result; +} + +export function NormalizeCellDep(cellDep, { debugPath = "cell_dep" } = {}) { + return normalizeObject(debugPath, cellDep, { + out_point: toNormalize(NormalizeOutPoint), + dep_type: function(debugPath, value) { + switch (value) { + case "code": + return 0; + case "dep_group": + return 1; + case 0: + return value; + case 1: + return value; + default: + throw new Error(`${debugPath}.dep_type has invalid value: ${value}`); + } + } + }); +} + +function toNormalizeArray(normalizeFunction) { + return function(debugPath, array) { + return array.map((item, i) => { + return normalizeFunction(`${debugPath}[${i}]`, item); + }); + }; +} + +export function NormalizeRawTransaction( + rawTransaction, + { debugPath = "raw_transaction" } = {} +) { + return normalizeObject(debugPath, rawTransaction, { + version: normalizeHexNumber(4), + cell_deps: toNormalizeArray(toNormalize(NormalizeCellDep)), + header_deps: toNormalizeArray(normalizeRawData(32)), + inputs: toNormalizeArray(toNormalize(NormalizeCellInput)), + outputs: toNormalizeArray(toNormalize(NormalizeCellOutput)), + outputs_data: toNormalizeArray(normalizeRawData(-1)) + }); +} + +export function NormalizeTransaction( + transaction, + { debugPath = "transaction" } = {} +) { + const rawTransaction = NormalizeRawTransaction(transaction, { + debugPath: `(raw)${debugPath}` + }); + const result = normalizeObject(debugPath, transaction, { + witnesses: toNormalizeArray(normalizeRawData(-1)) + }); + result.raw = rawTransaction; + return result; +} + +export function NormalizeRawHeader( + rawHeader, + { debugPath = "raw_header" } = {} +) { + return normalizeObject(debugPath, rawHeader, { + version: normalizeHexNumber(4), + compact_target: normalizeHexNumber(4), + timestamp: normalizeHexNumber(8), + number: normalizeHexNumber(8), + epoch: normalizeHexNumber(8), + parent_hash: normalizeRawData(32), + transactions_root: normalizeRawData(32), + proposals_hash: normalizeRawData(32), + uncles_hash: normalizeRawData(32), + dao: normalizeRawData(32) + }); +} + +export function NormalizeHeader(header, { debugPath = "header" } = {}) { + const rawHeader = NormalizeRawHeader(header, { + debugPath: `(raw)${debugPath}` + }); + const result = normalizeObject(debugPath, header, { + nonce: normalizeHexNumber(16) + }); + result.raw = rawHeader; + return result; +} + +export function NormalizeUncleBlock( + uncleBlock, + { debugPath = "uncle_block" } = {} +) { + return normalizeObject(debugPath, uncleBlock, { + header: toNormalize(NormalizeHeader), + proposals: toNormalizeArray(normalizeRawData(10)) + }); +} + +export function NormalizeBlock(block, { debugPath = "block" } = {}) { + return normalizeObject(debugPath, block, { + header: toNormalize(NormalizeHeader), + uncles: toNormalizeArray(toNormalize(NormalizeUncleBlock)), + transactions: toNormalizeArray(toNormalize(NormalizeTransaction)), + proposals: toNormalizeArray(normalizeRawData(10)) + }); +} + +export function NormalizeCellbaseWitness( + cellbaseWitness, + { debugPath = "cellbase_witness" } = {} +) { + return normalizeObject(debugPath, cellbaseWitness, { + lock: toNormalize(NormalizeScript), + message: normalizeRawData(-1) + }); +} + +export function NormalizeWitnessArgs( + witnessArgs, + { debugPath = "witness_args" } = {} +) { + const result = {}; + if (witnessArgs.lock) { + result.lock = normalizeRawData(-1)(`${debugPath}.lock`, witnessArgs.lock); + } + if (witnessArgs.input_type) { + result.input_type = normalizeRawData(-1)( + `${debugPath}.input_type`, + witnessArgs.input_type + ); + } + if (witnessArgs.output_type) { + result.output_type = normalizeRawData(-1)( + `${debugPath}.output_type`, + witnessArgs.output_type + ); + } + return result; +} diff --git a/packages/core/src/reader.js b/packages/core/src/reader.js new file mode 100644 index 000000000..f8f73bf69 --- /dev/null +++ b/packages/core/src/reader.js @@ -0,0 +1,93 @@ +class ArrayBufferReader { + constructor(buffer) { + this.view = new DataView(buffer); + } + + length() { + return this.view.byteLength; + } + + indexAt(i) { + return this.view.getUint8(i); + } + + toArrayBuffer() { + return this.view.buffer; + } + + serializeJson() { + return ( + "0x" + + Array.prototype.map + .call(new Uint8Array(this.view.buffer), x => + ("00" + x.toString(16)).slice(-2) + ) + .join("") + ); + } +} + +class HexStringReader { + constructor(string) { + this.string = string; + } + + length() { + return this.string.length / 2 - 1; + } + + indexAt(i) { + return parseInt(this.string.substr(2 + i * 2, 2), 16); + } + + toArrayBuffer() { + const buffer = new ArrayBuffer(this.length()); + const view = new DataView(buffer); + + for (let i = 0; i < this.length(); i++) { + view.setUint8(i, this.indexAt(i)); + } + return buffer; + } + + serializeJson() { + return this.string; + } +} + +export class Reader { + constructor(input) { + if ( + input instanceof HexStringReader || + input instanceof ArrayBufferReader + ) { + return input; + } + if (typeof input === "string") { + if (!input.startsWith("0x") || input.length % 2 != 0) { + throw new Error( + "Hex string must start with 0x, and has even numbered length!" + ); + } + return new HexStringReader(input); + } + if (input instanceof ArrayBuffer) { + return new ArrayBufferReader(input); + } + throw new Error("Reader can only accept hex string or ArrayBuffer!"); + } + + static fromRawString(string) { + const buffer = new ArrayBuffer(string.length); + const view = new DataView(buffer); + + for (let i = 0; i < string.length; i++) { + const c = string.charCodeAt(i); + if (c > 0xff) { + throw new Error("fromRawString can only accept UTF-8 raw string!"); + } + view.setUint8(i, c); + } + return new ArrayBufferReader(buffer); + } +} diff --git a/packages/core/src/rpc.js b/packages/core/src/rpc.js new file mode 100644 index 000000000..495f0b091 --- /dev/null +++ b/packages/core/src/rpc.js @@ -0,0 +1,117 @@ +import fetch from "cross-fetch"; +import JSBI from "jsbi"; + +function mergeOptions(overrideOptions, defaultOptions) { + defaultOptions = defaultOptions || {}; + const headers = Object.assign( + {}, + defaultOptions.headers || {}, + overrideOptions.headers || {} + ); + return Object.assign({}, defaultOptions, overrideOptions, { + headers: headers + }); +} + +const batchHandler = { + get: (target, method, receiver) => { + if (method === "send") { + return async () => { + const response = await fetch( + target.uri, + mergeOptions( + { + method: "post", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(target.payload) + }, + target.defaultOptions + ) + ); + return await response.json(); + }; + } + return (...params) => { + const id = target.id; + target.id = target.id + 1; + target.payload.push({ + jsonrpc: "2.0", + id: id, + method: method, + params: params + }); + return receiver; + }; + } +}; + +const handler = { + get: (target, method) => { + if (method === "batch") { + return () => { + return new Proxy( + { + id: Math.round(Math.random() * 10000000), + payload: [], + uri: target.uri, + defaultOptions: target.defaultOptions + }, + batchHandler + ); + }; + } + return async (...params) => { + const id = Math.round(Math.random() * 10000000); + const response = await fetch( + target.uri, + mergeOptions( + { + method: "post", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify({ + jsonrpc: "2.0", + id: id, + method: method, + params: params + }) + }, + target.defaultOptions + ) + ); + const data = await response.json(); + if (data.id !== id) { + throw new Error("JSONRPCError: response ID does not match request ID!"); + } + if (data.error) { + throw new Error( + `JSONRPCError: server error ${JSON.stringify(data.error)}` + ); + } + return data.result; + }; + } +}; + +export class RPC { + constructor(uri, defaultOptions = {}) { + this.uri = uri; + this.defaultOptions = defaultOptions; + return new Proxy(this, handler); + } + + static create(uri) { + return new RPC(uri); + } +} + +export function HexStringToBigInt(hexString) { + return JSBI.BigInt(hexString); +} + +export function BigIntToHexString(bigInt) { + return "0x" + bigInt.toString(16); +} diff --git a/packages/core/src/transaction_dumper.js b/packages/core/src/transaction_dumper.js new file mode 100644 index 000000000..dba3c78b8 --- /dev/null +++ b/packages/core/src/transaction_dumper.js @@ -0,0 +1,102 @@ +import JSBI from "jsbi"; +import { Reader } from "./reader"; +import { ValidateTransaction, ValidateOutPoint } from "./validators"; + +export class TransactionDumper { + constructor( + rpc, + { validateTransaction = true, depGroupUnpacker = null } = {} + ) { + this.rpc = rpc; + this.validateTransaction = validateTransaction; + this.depGroupUnpacker = depGroupUnpacker; + } + + async dumpByHash(txHash) { + const tx = (await this.rpc.get_transaction(txHash)).transaction; + delete tx.hash; + return await this.dump(tx); + } + + async dump(tx) { + if (this.validateTransaction) { + ValidateTransaction(tx); + } + const mockInputs = []; + for (const input of tx.inputs) { + const { output, data, header } = await this._resolveOutPoint( + input.previous_output + ); + mockInputs.push({ input, output, data, header }); + } + const mockCellDeps = []; + for (const cellDep of tx.cell_deps) { + const { output, data, header } = await this._resolveOutPoint( + cellDep.out_point + ); + mockCellDeps.push({ + cell_dep: cellDep, + output, + data, + header + }); + if (cellDep.dep_type === "dep_group") { + if (!this.depGroupUnpacker) { + throw new Error( + "depGroupUnpacker must be provided when the transaction contains dep_group!" + ); + } + const outPoints = this.depGroupUnpacker(new Reader(data)); + for (const outPoint of outPoints) { + ValidateOutPoint(outPoint); + const { output, data, header } = await this._resolveOutPoint( + outPoint + ); + mockCellDeps.push({ + cell_dep: { + out_point: outPoint, + dep_type: "code" + }, + output, + data, + header + }); + } + } + } + const mockHeaderDeps = []; + for (const headerDep of tx.header_deps) { + mockHeaderDeps.push(await this.rpc.get_header(headerDep)); + } + return JSON.stringify({ + mock_info: { + inputs: mockInputs, + cell_deps: mockCellDeps, + header_deps: mockHeaderDeps + }, + tx + }); + } + + async _resolveOutPoint(out_point) { + const txStatus = await this.rpc.get_transaction(out_point.tx_hash); + if (!txStatus || !txStatus.transaction) { + throw new Error(`Transaction ${out_point.tx_hash} cannot be found!`); + } + const tx = txStatus.transaction; + const index = JSBI.toNumber(JSBI.BigInt(out_point.index)); + if (index >= tx.outputs.length) { + throw new Error( + `Transaction ${out_point.tx_hash} does not have output ${index}!` + ); + } + const data = { + output: tx.outputs[index], + data: tx.outputs_data[index] + }; + if (txStatus.tx_status.status === "committed") { + data.header = txStatus.tx_status.block_hash; + } + return data; + } +} diff --git a/packages/core/src/transformers.js b/packages/core/src/transformers.js new file mode 100644 index 000000000..ccab151fb --- /dev/null +++ b/packages/core/src/transformers.js @@ -0,0 +1,317 @@ +// This package provides transformer functions that transform JavaScript objects +// into JSON ready objects that can be passed to RPC. It following the following +// rules: +// +// 1. If the specified object has a serializeJson method, it would invoke this +// method and use the result to replace current object. +// 2. It then restricts the keys of the object to keys required by the specified +// entity(i.e., a Script would only have code_hash, hash_type, args keys),for each +// sub-field, it then recursively perform the steps here from step 1. +// 3. It then optionally run validator functions to ensure the resulting object +// follows specified rules. +// +// Note rule 1 here provides the flexibility in defining your own structures: you +// could define a class containing custom data structures, then provide a +// serializeJson that transforms the custom one into the rigid data structure +// required by CKB. You can also leverage the Reader class we provide as much as +// possible. Since Reader class does provide serializeJson methods, transformers +// here will transform them to valid hex strings required by CKB. +import * as validators from "./validators"; + +function invokeSerializeJson(debugPath, value) { + if (value instanceof Object && value.serializeJson instanceof Function) { + return value.serializeJson.call(value); + } + return value; +} + +function transformObject(debugPath, object, keys) { + object = invokeSerializeJson(debugPath, object); + if (!(object instanceof Object)) { + throw new Error(`Transformed ${debugPath} is not an object!`); + } + const result = {}; + + for (const [key, f] of Object.entries(keys)) { + let value = object[key]; + if (!value) { + const camelKey = key.replace(/(_[a-z])/g, group => + group.toUpperCase().replace("_", "") + ); + value = object[camelKey]; + } + if (value) { + result[key] = f(`${debugPath}.${key}`, value); + } + } + return result; +} + +export function TransformScript( + script, + { validation = true, debugPath = "script" } = {} +) { + script = transformObject(debugPath, script, { + code_hash: invokeSerializeJson, + hash_type: invokeSerializeJson, + args: invokeSerializeJson + }); + + if (validation) { + validators.ValidateScript(script, { + debugPath: `(transformed) ${debugPath}` + }); + } + return script; +} + +export function TransformOutPoint( + outPoint, + { validation = true, debugPath = "out_point" } = {} +) { + outPoint = transformObject(debugPath, outPoint, { + tx_hash: invokeSerializeJson, + index: invokeSerializeJson + }); + + if (validation) { + validators.ValidateOutPoint(outPoint, { + debugPath: `(transformed) ${debugPath}` + }); + } + return outPoint; +} + +function toInvoke(transform) { + return function(debugPath, value) { + return transform(value, { + validation: false, + debugPath + }); + }; +} + +export function TransformCellInput( + cellInput, + { validation = true, debugPath = "cell_input" } = {} +) { + cellInput = transformObject(debugPath, cellInput, { + since: invokeSerializeJson, + previous_output: toInvoke(TransformOutPoint) + }); + + if (validation) { + validators.ValidateCellInput(cellInput, { + debugPath: `(transformed) ${debugPath}` + }); + } + return cellInput; +} + +export function TransformCellOutput( + cellOutput, + { validation = true, debugPath = "cell_output" } = {} +) { + cellOutput = transformObject(debugPath, cellOutput, { + capacity: invokeSerializeJson, + lock: toInvoke(TransformScript), + type: toInvoke(TransformScript) + }); + + if (validation) { + validators.ValidateCellOutput(cellOutput, { + debugPath: `(transformed) ${debugPath}` + }); + } + return cellOutput; +} + +export function TransformCellDep( + cellDep, + { validation = true, debugPath = "cell_dep" } = {} +) { + cellDep = transformObject(debugPath, cellDep, { + out_point: toInvoke(TransformOutPoint), + dep_type: invokeSerializeJson + }); + + if (validation) { + validators.ValidateCellDep(cellDep, { + debugPath: `(transformed) ${debugPath}` + }); + } + return cellDep; +} + +function toInvokeArray(invokeFunction) { + return function(debugPath, array) { + return array.map((item, i) => { + return invokeFunction(`${debugPath}[${i}]`, item); + }); + }; +} + +export function TransformRawTransaction( + rawTransaction, + { validation = true, debugPath = "raw_transaction" } = {} +) { + rawTransaction = transformObject(debugPath, rawTransaction, { + version: invokeSerializeJson, + cell_deps: toInvokeArray(toInvoke(TransformCellDep)), + header_deps: toInvokeArray(invokeSerializeJson), + inputs: toInvokeArray(toInvoke(TransformCellInput)), + outputs: toInvokeArray(toInvoke(TransformCellOutput)), + outputs_data: toInvokeArray(invokeSerializeJson) + }); + + if (validation) { + validators.ValidateRawTransaction(rawTransaction, { + debugPath: `(transformed) ${debugPath}` + }); + } + return rawTransaction; +} + +export function TransformTransaction( + transaction, + { validation = true, debugPath = "transaction" } = {} +) { + transaction = transformObject(debugPath, transaction, { + version: invokeSerializeJson, + cell_deps: toInvokeArray(toInvoke(TransformCellDep)), + header_deps: toInvokeArray(invokeSerializeJson), + inputs: toInvokeArray(toInvoke(TransformCellInput)), + outputs: toInvokeArray(toInvoke(TransformCellOutput)), + outputs_data: toInvokeArray(invokeSerializeJson), + witnesses: toInvokeArray(invokeSerializeJson) + }); + + if (validation) { + validators.ValidateTransaction(transaction, { + debugPath: `(transformed) ${debugPath}` + }); + } + return transaction; +} + +export function TransformRawHeader( + rawHeader, + { validation = true, debugPath = "raw_header" } = {} +) { + rawHeader = transformObject(debugPath, rawHeader, { + version: invokeSerializeJson, + compact_target: invokeSerializeJson, + timestamp: invokeSerializeJson, + number: invokeSerializeJson, + epoch: invokeSerializeJson, + parent_hash: invokeSerializeJson, + transactions_root: invokeSerializeJson, + proposals_hash: invokeSerializeJson, + uncles_hash: invokeSerializeJson, + dao: invokeSerializeJson + }); + + if (validation) { + validators.ValidateRawHeader(rawHeader, { + debugPath: `(transformed) ${debugPath}` + }); + } + return rawHeader; +} + +export function TransformHeader( + header, + { validation = true, debugPath = "header" } = {} +) { + header = transformObject(debugPath, header, { + version: invokeSerializeJson, + compact_target: invokeSerializeJson, + timestamp: invokeSerializeJson, + number: invokeSerializeJson, + epoch: invokeSerializeJson, + parent_hash: invokeSerializeJson, + transactions_root: invokeSerializeJson, + proposals_hash: invokeSerializeJson, + uncles_hash: invokeSerializeJson, + dao: invokeSerializeJson, + nonce: invokeSerializeJson + }); + + if (validation) { + validators.ValidateHeader(header, { + debugPath: `(transformed) ${debugPath}` + }); + } + return header; +} + +export function TransformUncleBlock( + uncleBlock, + { validation = true, debugPath = "uncle_block" } = {} +) { + uncleBlock = transformObject(debugPath, uncleBlock, { + header: toInvoke(TransformHeader), + proposals: toInvokeArray(invokeSerializeJson) + }); + + if (validation) { + validators.ValidateUncleBlock(uncleBlock, { + debugPath: `(transformed) ${debugPath}` + }); + } + return uncleBlock; +} + +export function TransformBlock( + block, + { validation = true, debugPath = "block" } = {} +) { + block = transformObject(debugPath, block, { + header: toInvoke(TransformHeader), + uncles: toInvokeArray(toInvoke(TransformUncleBlock)), + transactions: toInvokeArray(toInvoke(TransformTransaction)), + proposals: toInvokeArray(invokeSerializeJson) + }); + + if (validation) { + validators.ValidateBlock(block, { + debugPath: `(transformed) ${debugPath}` + }); + } + return block; +} + +export function TransformCellbaseWitness( + cellbaseWitness, + { validation = true, debugPath = "cellbase_witness" } = {} +) { + cellbaseWitness = transformObject(debugPath, cellbaseWitness, { + lock: toInvoke(TransformScript), + message: invokeSerializeJson + }); + + if (validation) { + validators.ValidateCellbaseWitness(cellbaseWitness, { + debugPath: `(transformed) ${debugPath}` + }); + } + return cellbaseWitness; +} + +export function TransformWitnessArgs( + witnessArgs, + { validation = true, debugPath = "witness_args" } = {} +) { + witnessArgs = transformObject(debugPath, witnessArgs, { + lock: invokeSerializeJson, + input_type: invokeSerializeJson, + output_type: invokeSerializeJson + }); + + if (validation) { + validators.ValidateWitnessArgs(witnessArgs, { + debugPath: `(transformed) ${debugPath}` + }); + } + return witnessArgs; +} diff --git a/packages/core/src/validators.js b/packages/core/src/validators.js new file mode 100644 index 000000000..2c45e7765 --- /dev/null +++ b/packages/core/src/validators.js @@ -0,0 +1,406 @@ +/* eslint-disable @typescript-eslint/no-unused-vars */ +// This package provides validator functions that check JSON objects are +// following the correct format, so we can submit them to CKB via RPC +// directly + +function assertObject(debugPath, object) { + if (!(object instanceof Object)) { + throw new Error(`${debugPath} is not an object!`); + } +} + +function assertObjectWithKeys( + debugPath, + object, + expectedKeys, + optionalKeys = [] +) { + assertObject(debugPath, object); + const providedKeys = Object.keys(object).sort(); + const requiredLength = expectedKeys.length; + const maximalLength = expectedKeys.length + optionalKeys.length; + const errorMessage = `${debugPath} does not have correct keys! Required keys: [${expectedKeys + .sort() + .join(", ")}], optional keys: [${optionalKeys + .sort() + .join(", ")}], actual keys: [${providedKeys.join(", ")}]`; + if ( + providedKeys.length < requiredLength || + providedKeys.length > maximalLength + ) { + throw new Error(errorMessage); + } + let optionalProvidedKeys = providedKeys.filter( + key => !expectedKeys.includes(key) + ); + if (providedKeys.length - optionalProvidedKeys.length !== requiredLength) { + throw new Error(errorMessage); + } + if (optionalProvidedKeys.find(key => !optionalKeys.includes(key))) { + throw new Error(errorMessage); + } +} + +function assertHexString(debugPath, string) { + if (!/^0x([0-9a-fA-F][0-9a-fA-F])*$/.test(string)) { + throw new Error(`${debugPath} must be a hex string!`); + } +} + +function assertHash(debugPath, hash) { + assertHexString(debugPath, hash); + if (hash.length != 66) { + throw new Error(`${debugPath} must be a hex string of 66 bytes long!`); + } +} + +function assertInteger(debugPath, i) { + if (i === "0x0") { + return; + } + if (!/^0x[1-9a-fA-F][0-9a-fA-F]*$/.test(i)) { + throw new Error(`${debugPath} must be a hex integer!`); + } +} + +export function ValidateScript( + script, + { nestedValidation = true, debugPath = "script" } = {} +) { + assertObjectWithKeys( + debugPath, + script, + ["code_hash", "hash_type", "args"], + [] + ); + assertHash(`${debugPath}.code_hash`, script.code_hash); + assertHexString(`${debugPath}.args`, script.args); + + if (script.hash_type !== "data" && script.hash_type !== "type") { + throw new Error(`${debugPath}.hash_type must be either data or type!`); + } +} + +export function ValidateOutPoint( + outPoint, + { nestedValidation = true, debugPath = "out_point" } = {} +) { + assertObjectWithKeys(debugPath, outPoint, ["tx_hash", "index"], []); + assertHash(`${debugPath}.tx_hash`, outPoint.tx_hash); + assertInteger(`${debugPath}.index`, outPoint.index); +} + +export function ValidateCellInput( + cellInput, + { nestedValidation = true, debugPath = "cell_input" } = {} +) { + assertObjectWithKeys(debugPath, cellInput, ["since", "previous_output"], []); + assertInteger(`${debugPath}.since`, cellInput.since); + + if (nestedValidation) { + ValidateOutPoint(cellInput.previous_output, { + debugPath: `${debugPath}.previous_output` + }); + } +} + +export function ValidateCellOutput( + cellOutput, + { nestedValidation = true, debugPath = "cell_output" } = {} +) { + assertObjectWithKeys(debugPath, cellOutput, ["capacity", "lock"], ["type"]); + assertInteger(`${debugPath}.capacity`, cellOutput.capacity); + + if (nestedValidation) { + ValidateScript(cellOutput.lock, { + debugPath: `${debugPath}.lock` + }); + if (cellOutput.type) { + ValidateScript(cellOutput.type, { + debugPath: `${debugPath}.type` + }); + } + } +} + +export function ValidateCellDep( + cellDep, + { nestedValidation = true, debugPath = "cell_dep" } = {} +) { + assertObjectWithKeys(debugPath, cellDep, ["out_point", "dep_type"], []); + if (cellDep.dep_type !== "code" && cellDep.dep_type !== "dep_group") { + throw new Error(`${debugPath}.dep_type must be either code or dep_group!`); + } + + if (nestedValidation) { + ValidateOutPoint(cellDep.out_point, { + debugPath: `${debugPath}.out_point` + }); + } +} + +function assertArray(debugPath, array, validateFunction, nestedValidation) { + if (!Array.isArray(array)) { + throw new Error(`${debugPath} is not an array!`); + } + if (nestedValidation) { + for (let i = 0; i < array.length; i++) { + validateFunction(`${debugPath}[${i}]`, array[i]); + } + } +} + +function toAssert(validateFunction, nestedValidation) { + return function(debugPath, value) { + validateFunction(value, { + nestedValidation: nestedValidation, + debugPath: debugPath + }); + }; +} + +function assertCommonTransaction(debugPath, rawTransaction, nestedValidation) { + assertInteger(`${debugPath}.version`, rawTransaction.version); + assertArray( + `${debugPath}.cell_deps`, + rawTransaction.cell_deps, + toAssert(ValidateCellDep, nestedValidation), + nestedValidation + ); + assertArray( + `${debugPath}.header_deps`, + rawTransaction.header_deps, + assertHash, + nestedValidation + ); + assertArray( + `${debugPath}.inputs`, + rawTransaction.inputs, + toAssert(ValidateCellInput, nestedValidation), + nestedValidation + ); + assertArray( + `${debugPath}.outputs`, + rawTransaction.outputs, + toAssert(ValidateCellOutput, nestedValidation), + nestedValidation + ); + assertArray( + `${debugPath}.outputs_data`, + rawTransaction.outputs_data, + assertHexString, + nestedValidation + ); +} + +export function ValidateRawTransaction( + rawTransaction, + { nestedValidation = true, debugPath = "raw_transaction" } = {} +) { + assertObjectWithKeys( + debugPath, + rawTransaction, + [ + "version", + "cell_deps", + "header_deps", + "inputs", + "outputs", + "outputs_data" + ], + [] + ); + assertCommonTransaction(debugPath, rawTransaction, nestedValidation); +} + +export function ValidateTransaction( + transaction, + { nestedValidation = true, debugPath = "transaction" } = {} +) { + assertObjectWithKeys( + debugPath, + transaction, + [ + "version", + "cell_deps", + "header_deps", + "inputs", + "outputs", + "outputs_data", + "witnesses" + ], + [] + ); + assertCommonTransaction(debugPath, transaction, nestedValidation); + assertArray( + `${debugPath}.witnesses`, + transaction.witnesses, + assertHexString, + nestedValidation + ); +} + +function assertCommonHeader(debugPath, rawHeader) { + assertInteger(`${debugPath}.version`, rawHeader.version); + assertInteger(`${debugPath}.compact_target`, rawHeader.compact_target); + assertInteger(`${debugPath}.timestamp`, rawHeader.timestamp); + assertInteger(`${debugPath}.number`, rawHeader.number); + assertInteger(`${debugPath}.epoch`, rawHeader.epoch); + assertHash(`${debugPath}.parent_hash`, rawHeader.parent_hash); + assertHash(`${debugPath}.transactions_root`, rawHeader.transactions_root); + assertHash(`${debugPath}.proposals_hash`, rawHeader.proposals_hash); + assertHash(`${debugPath}.uncles_hash`, rawHeader.uncles_hash); + assertHash(`${debugPath}.dao`, rawHeader.dao); +} + +export function ValidateRawHeader( + rawHeader, + { nestedValidation = true, debugPath = "raw_header" } = {} +) { + assertObjectWithKeys( + debugPath, + rawHeader, + [ + "version", + "compact_target", + "timestamp", + "number", + "epoch", + "parent_hash", + "transactions_root", + "proposals_hash", + "uncles_hash", + "dao" + ], + [] + ); + assertCommonHeader(debugPath, rawHeader); +} + +export function ValidateHeader( + header, + { nestedValidation = true, debugPath = "header" } = {} +) { + assertObjectWithKeys( + debugPath, + header, + [ + "version", + "compact_target", + "timestamp", + "number", + "epoch", + "parent_hash", + "transactions_root", + "proposals_hash", + "uncles_hash", + "dao", + "nonce" + ], + [] + ); + assertHexString(`${debugPath}.nonce`, header.nonce); + if (header.nonce.length != 34) { + throw new Error( + `${debugPath}.nonce must be a hex string of 34 bytes long!` + ); + } +} + +function assertProposalShortId(debugPath, shortId) { + assertHexString(debugPath, shortId); + if (shortId.length != 22) { + throw new Error(`${debugPath} must be a hex string of 22 bytes long!`); + } +} + +export function ValidateUncleBlock( + uncleBlock, + { nestedValidation = true, debugPath = "uncle_block" } = {} +) { + assertObjectWithKeys(debugPath, uncleBlock, ["header", "proposals"], []); + + if (nestedValidation) { + ValidateHeader(uncleBlock.header, { + debugPath: `${debugPath}.header` + }); + } + assertArray( + `${debugPath}.proposals`, + uncleBlock.proposals, + assertProposalShortId, + nestedValidation + ); +} + +export function ValidateBlock( + block, + { nestedValidation = true, debugPath = "block" } = {} +) { + assertObjectWithKeys( + debugPath, + block, + ["header", "uncles", "transactions", "proposals"], + [] + ); + + if (nestedValidation) { + ValidateHeader(block.header, { + debugPath: `${debugPath}.header` + }); + } + assertArray( + `${debugPath}.uncles`, + block.uncles, + toAssert(ValidateUncleBlock, nestedValidation), + nestedValidation + ); + assertArray( + `${debugPath}.transactions`, + block.transactions, + toAssert(ValidateTransaction, nestedValidation), + nestedValidation + ); + assertArray( + `${debugPath}.proposals`, + block.proposals, + assertProposalShortId, + nestedValidation + ); +} + +export function ValidateCellbaseWitness( + cellbaseWitness, + { nestedValidation = true, debugPath = "cellbase_witness" } = {} +) { + assertObjectWithKeys(debugPath, cellbaseWitness, ["lock", "message"], []); + assertHexString(`${debugPath}.message`, cellbaseWitness.message); + + if (nestedValidation) { + ValidateScript(cellbaseWitness.lock, { + debugPath: `${debugPath}.lock` + }); + } +} + +export function ValidateWitnessArgs( + witnessArgs, + { nestedValidation = true, debugPath = "witness_args" } = {} +) { + assertObjectWithKeys( + debugPath, + witnessArgs, + [], + ["lock", "input_type", "output_type"] + ); + + if (witnessArgs.lock) { + assertHexString(`${debugPath}.lock`, witnessArgs.lock); + } + if (witnessArgs.input_type) { + assertHexString(`${debugPath}.input_type`, witnessArgs.input_type); + } + if (witnessArgs.output_type) { + assertHexString(`${debugPath}.output_type`, witnessArgs.output_type); + } +} diff --git a/packages/core/testfiles/blockchain.umd.js b/packages/core/testfiles/blockchain.umd.js new file mode 100644 index 000000000..599216749 --- /dev/null +++ b/packages/core/testfiles/blockchain.umd.js @@ -0,0 +1,1345 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (global = global || self, factory(global.Blockchain = {})); +}(this, (function (exports) { 'use strict'; + + function dataLengthError(actual, required) { + throw new Error(`Invalid data length! Required: ${required}, actual: ${actual}`); + } + + function assertDataLength(actual, required) { + if (actual !== required) { + dataLengthError(actual, required); + } + } + + function assertArrayBuffer(reader) { + if (reader instanceof Object && reader.toArrayBuffer instanceof Function) { + reader = reader.toArrayBuffer(); + } + if (!(reader instanceof ArrayBuffer)) { + throw new Error("Provided value must be an ArrayBuffer or can be transformed into ArrayBuffer!"); + } + return reader; + } + + function verifyAndExtractOffsets(view, expectedFieldCount, compatible) { + if (view.byteLength < 4) { + dataLengthError(view.byteLength, ">4"); + } + const requiredByteLength = view.getUint32(0, true); + assertDataLength(view.byteLength, requiredByteLength); + if (requiredByteLength === 4) { + return [requiredByteLength]; + } + if (requiredByteLength < 8) { + dataLengthError(view.byteLength, ">8"); + } + const firstOffset = view.getUint32(4, true); + if (firstOffset % 4 !== 0 || firstOffset < 8) { + throw new Error(`Invalid first offset: ${firstOffset}`); + } + const itemCount = firstOffset / 4 - 1; + if (itemCount < expectedFieldCount) { + throw new Error(`Item count not enough! Required: ${expectedFieldCount}, actual: ${itemCount}`); + } else if ((!compatible) && itemCount > expectedFieldCount) { + throw new Error(`Item count is more than required! Required: ${expectedFieldCount}, actual: ${itemCount}`); + } + if (requiredByteLength < firstOffset) { + throw new Error(`First offset is larger than byte length: ${firstOffset}`); + } + const offsets = []; + for (let i = 0; i < itemCount; i++) { + const start = 4 + i * 4; + offsets.push(view.getUint32(start, true)); + } + offsets.push(requiredByteLength); + for (let i = 0; i < offsets.length - 1; i++) { + if (offsets[i] > offsets[i + 1]) { + throw new Error(`Offset index ${i}: ${offsets[i]} is larger than offset index ${i + 1}: ${offsets[i + 1]}`); + } + } + return offsets; + } + + function serializeTable(buffers) { + const itemCount = buffers.length; + let totalSize = 4 * (itemCount + 1); + const offsets = []; + + for (let i = 0; i < itemCount; i++) { + offsets.push(totalSize); + totalSize += buffers[i].byteLength; + } + + const buffer = new ArrayBuffer(totalSize); + const array = new Uint8Array(buffer); + const view = new DataView(buffer); + + view.setUint32(0, totalSize, true); + for (let i = 0; i < itemCount; i++) { + view.setUint32(4 + i * 4, offsets[i], true); + array.set(new Uint8Array(buffers[i]), offsets[i]); + } + return buffer; + } + class Uint32 { + constructor(reader, { validate = true } = {}) { + this.view = new DataView(assertArrayBuffer(reader)); + if (validate) { + this.validate(); + } + } + + validate(compatible = false) { + assertDataLength(this.view.byteLength, 4); + } + + indexAt(i) { + return this.view.getUint8(i); + } + + raw() { + return this.view.buffer; + } + + toBigEndianUint32() { + return this.view.getUint32(0, false); + } + + toLittleEndianUint32() { + return this.view.getUint32(0, true); + } + + static size() { + return 4; + } + } + + function SerializeUint32(value) { + const buffer = assertArrayBuffer(value); + assertDataLength(buffer.byteLength, 4); + return buffer; + } + + class Uint64 { + constructor(reader, { validate = true } = {}) { + this.view = new DataView(assertArrayBuffer(reader)); + if (validate) { + this.validate(); + } + } + + validate(compatible = false) { + assertDataLength(this.view.byteLength, 8); + } + + indexAt(i) { + return this.view.getUint8(i); + } + + raw() { + return this.view.buffer; + } + + toBigEndianBigUint64() { + return this.view.getBigUint64(0, false); + } + + toLittleEndianBigUint64() { + return this.view.getUint64(0, true); + } + + static size() { + return 8; + } + } + + function SerializeUint64(value) { + const buffer = assertArrayBuffer(value); + assertDataLength(buffer.byteLength, 8); + return buffer; + } + + class Uint128 { + constructor(reader, { validate = true } = {}) { + this.view = new DataView(assertArrayBuffer(reader)); + if (validate) { + this.validate(); + } + } + + validate(compatible = false) { + assertDataLength(this.view.byteLength, 16); + } + + indexAt(i) { + return this.view.getUint8(i); + } + + raw() { + return this.view.buffer; + } + + static size() { + return 16; + } + } + + function SerializeUint128(value) { + const buffer = assertArrayBuffer(value); + assertDataLength(buffer.byteLength, 16); + return buffer; + } + + class Byte32 { + constructor(reader, { validate = true } = {}) { + this.view = new DataView(assertArrayBuffer(reader)); + if (validate) { + this.validate(); + } + } + + validate(compatible = false) { + assertDataLength(this.view.byteLength, 32); + } + + indexAt(i) { + return this.view.getUint8(i); + } + + raw() { + return this.view.buffer; + } + + static size() { + return 32; + } + } + + function SerializeByte32(value) { + const buffer = assertArrayBuffer(value); + assertDataLength(buffer.byteLength, 32); + return buffer; + } + + class Uint256 { + constructor(reader, { validate = true } = {}) { + this.view = new DataView(assertArrayBuffer(reader)); + if (validate) { + this.validate(); + } + } + + validate(compatible = false) { + assertDataLength(this.view.byteLength, 32); + } + + indexAt(i) { + return this.view.getUint8(i); + } + + raw() { + return this.view.buffer; + } + + static size() { + return 32; + } + } + + function SerializeUint256(value) { + const buffer = assertArrayBuffer(value); + assertDataLength(buffer.byteLength, 32); + return buffer; + } + + class Bytes { + constructor(reader, { validate = true } = {}) { + this.view = new DataView(assertArrayBuffer(reader)); + if (validate) { + this.validate(); + } + } + + validate(compatible = false) { + if (this.view.byteLength < 4) { + dataLengthError(this.view.byteLength, ">4"); + } + const requiredByteLength = this.length() + 4; + assertDataLength(this.view.byteLength, requiredByteLength); + } + + raw() { + return this.view.buffer.slice(4); + } + + indexAt(i) { + return this.view.getUint8(4 + i); + } + + length() { + return this.view.getUint32(0, true); + } + } + + function SerializeBytes(value) { + const item = assertArrayBuffer(value); + const array = new Uint8Array(4 + item.byteLength); + (new DataView(array.buffer)).setUint32(0, item.byteLength, true); + array.set(new Uint8Array(item), 4); + return array.buffer; + } + + class BytesOpt { + constructor(reader, { validate = true } = {}) { + this.view = new DataView(assertArrayBuffer(reader)); + if (validate) { + this.validate(); + } + } + + validate(compatible = false) { + if (this.hasValue()) { + this.value().validate(compatible); + } + } + + value() { + return new Bytes(this.view.buffer, { validate: false }); + } + + hasValue() { + return this.view.byteLength > 0; + } + } + + function SerializeBytesOpt(value) { + if (value) { + return SerializeBytes(value); + } else { + return new ArrayBuffer(0); + } + } + + class BytesVec { + constructor(reader, { validate = true } = {}) { + this.view = new DataView(assertArrayBuffer(reader)); + if (validate) { + this.validate(); + } + } + + validate(compatible = false) { + const offsets = verifyAndExtractOffsets(this.view, 0, true); + for (let i = 0; i < len(offsets) - 1; i++) { + new Bytes(this.view.buffer.slice(offsets[i], offsets[i + 1]), { validate: false }).validate(); + } + } + + length() { + if (this.view.byteLength < 8) { + return 0; + } else { + return this.view.getUint32(4, true) / 4 - 1; + } + } + + indexAt(i) { + const start = 4 + i * 4; + const offset = this.view.getUint32(start, true); + let offset_end = this.view.byteLength; + if (i + 1 < this.length()) { + offset_end = this.view.getUint32(start + 4, true); + } + return new Bytes(this.view.buffer.slice(offset, offset_end), { validate: false }); + } + } + + function SerializeBytesVec(value) { + return serializeTable(value.map(item => SerializeBytes(item))); + } + + class Byte32Vec { + constructor(reader, { validate = true } = {}) { + this.view = new DataView(assertArrayBuffer(reader)); + if (validate) { + this.validate(); + } + } + + validate(compatible = false) { + if (this.view.byteLength < 4) { + dataLengthError(this.view.byteLength, ">4"); + } + const requiredByteLength = this.length() * Byte32.size() + 4; + assertDataLength(this.view.byteLength, requiredByteLength); + for (let i = 0; i < 0; i++) { + const item = this.indexAt(i); + item.validate(compatible); + } + } + + indexAt(i) { + return new Byte32(this.view.buffer.slice(4 + i * Byte32.size(), 4 + (i + 1) * Byte32.size()), { validate: false }); + } + + length() { + return this.view.getUint32(0, true); + } + } + + function SerializeByte32Vec(value) { + const array = new Uint8Array(4 + Byte32.size() * value.length); + (new DataView(array.buffer)).setUint32(0, value.length, true); + for (let i = 0; i < value.length; i++) { + const itemBuffer = SerializeByte32(value[i]); + array.set(new Uint8Array(itemBuffer), 4 + i * Byte32.size()); + } + return array.buffer; + } + + class ScriptOpt { + constructor(reader, { validate = true } = {}) { + this.view = new DataView(assertArrayBuffer(reader)); + if (validate) { + this.validate(); + } + } + + validate(compatible = false) { + if (this.hasValue()) { + this.value().validate(compatible); + } + } + + value() { + return new Script(this.view.buffer, { validate: false }); + } + + hasValue() { + return this.view.byteLength > 0; + } + } + + function SerializeScriptOpt(value) { + if (value) { + return SerializeScript(value); + } else { + return new ArrayBuffer(0); + } + } + + class ProposalShortId { + constructor(reader, { validate = true } = {}) { + this.view = new DataView(assertArrayBuffer(reader)); + if (validate) { + this.validate(); + } + } + + validate(compatible = false) { + assertDataLength(this.view.byteLength, 10); + } + + indexAt(i) { + return this.view.getUint8(i); + } + + raw() { + return this.view.buffer; + } + + static size() { + return 10; + } + } + + function SerializeProposalShortId(value) { + const buffer = assertArrayBuffer(value); + assertDataLength(buffer.byteLength, 10); + return buffer; + } + + class UncleBlockVec { + constructor(reader, { validate = true } = {}) { + this.view = new DataView(assertArrayBuffer(reader)); + if (validate) { + this.validate(); + } + } + + validate(compatible = false) { + const offsets = verifyAndExtractOffsets(this.view, 0, true); + for (let i = 0; i < len(offsets) - 1; i++) { + new UncleBlock(this.view.buffer.slice(offsets[i], offsets[i + 1]), { validate: false }).validate(); + } + } + + length() { + if (this.view.byteLength < 8) { + return 0; + } else { + return this.view.getUint32(4, true) / 4 - 1; + } + } + + indexAt(i) { + const start = 4 + i * 4; + const offset = this.view.getUint32(start, true); + let offset_end = this.view.byteLength; + if (i + 1 < this.length()) { + offset_end = this.view.getUint32(start + 4, true); + } + return new UncleBlock(this.view.buffer.slice(offset, offset_end), { validate: false }); + } + } + + function SerializeUncleBlockVec(value) { + return serializeTable(value.map(item => SerializeUncleBlock(item))); + } + + class TransactionVec { + constructor(reader, { validate = true } = {}) { + this.view = new DataView(assertArrayBuffer(reader)); + if (validate) { + this.validate(); + } + } + + validate(compatible = false) { + const offsets = verifyAndExtractOffsets(this.view, 0, true); + for (let i = 0; i < len(offsets) - 1; i++) { + new Transaction(this.view.buffer.slice(offsets[i], offsets[i + 1]), { validate: false }).validate(); + } + } + + length() { + if (this.view.byteLength < 8) { + return 0; + } else { + return this.view.getUint32(4, true) / 4 - 1; + } + } + + indexAt(i) { + const start = 4 + i * 4; + const offset = this.view.getUint32(start, true); + let offset_end = this.view.byteLength; + if (i + 1 < this.length()) { + offset_end = this.view.getUint32(start + 4, true); + } + return new Transaction(this.view.buffer.slice(offset, offset_end), { validate: false }); + } + } + + function SerializeTransactionVec(value) { + return serializeTable(value.map(item => SerializeTransaction(item))); + } + + class ProposalShortIdVec { + constructor(reader, { validate = true } = {}) { + this.view = new DataView(assertArrayBuffer(reader)); + if (validate) { + this.validate(); + } + } + + validate(compatible = false) { + if (this.view.byteLength < 4) { + dataLengthError(this.view.byteLength, ">4"); + } + const requiredByteLength = this.length() * ProposalShortId.size() + 4; + assertDataLength(this.view.byteLength, requiredByteLength); + for (let i = 0; i < 0; i++) { + const item = this.indexAt(i); + item.validate(compatible); + } + } + + indexAt(i) { + return new ProposalShortId(this.view.buffer.slice(4 + i * ProposalShortId.size(), 4 + (i + 1) * ProposalShortId.size()), { validate: false }); + } + + length() { + return this.view.getUint32(0, true); + } + } + + function SerializeProposalShortIdVec(value) { + const array = new Uint8Array(4 + ProposalShortId.size() * value.length); + (new DataView(array.buffer)).setUint32(0, value.length, true); + for (let i = 0; i < value.length; i++) { + const itemBuffer = SerializeProposalShortId(value[i]); + array.set(new Uint8Array(itemBuffer), 4 + i * ProposalShortId.size()); + } + return array.buffer; + } + + class CellDepVec { + constructor(reader, { validate = true } = {}) { + this.view = new DataView(assertArrayBuffer(reader)); + if (validate) { + this.validate(); + } + } + + validate(compatible = false) { + if (this.view.byteLength < 4) { + dataLengthError(this.view.byteLength, ">4"); + } + const requiredByteLength = this.length() * CellDep.size() + 4; + assertDataLength(this.view.byteLength, requiredByteLength); + for (let i = 0; i < 0; i++) { + const item = this.indexAt(i); + item.validate(compatible); + } + } + + indexAt(i) { + return new CellDep(this.view.buffer.slice(4 + i * CellDep.size(), 4 + (i + 1) * CellDep.size()), { validate: false }); + } + + length() { + return this.view.getUint32(0, true); + } + } + + function SerializeCellDepVec(value) { + const array = new Uint8Array(4 + CellDep.size() * value.length); + (new DataView(array.buffer)).setUint32(0, value.length, true); + for (let i = 0; i < value.length; i++) { + const itemBuffer = SerializeCellDep(value[i]); + array.set(new Uint8Array(itemBuffer), 4 + i * CellDep.size()); + } + return array.buffer; + } + + class CellInputVec { + constructor(reader, { validate = true } = {}) { + this.view = new DataView(assertArrayBuffer(reader)); + if (validate) { + this.validate(); + } + } + + validate(compatible = false) { + if (this.view.byteLength < 4) { + dataLengthError(this.view.byteLength, ">4"); + } + const requiredByteLength = this.length() * CellInput.size() + 4; + assertDataLength(this.view.byteLength, requiredByteLength); + for (let i = 0; i < 0; i++) { + const item = this.indexAt(i); + item.validate(compatible); + } + } + + indexAt(i) { + return new CellInput(this.view.buffer.slice(4 + i * CellInput.size(), 4 + (i + 1) * CellInput.size()), { validate: false }); + } + + length() { + return this.view.getUint32(0, true); + } + } + + function SerializeCellInputVec(value) { + const array = new Uint8Array(4 + CellInput.size() * value.length); + (new DataView(array.buffer)).setUint32(0, value.length, true); + for (let i = 0; i < value.length; i++) { + const itemBuffer = SerializeCellInput(value[i]); + array.set(new Uint8Array(itemBuffer), 4 + i * CellInput.size()); + } + return array.buffer; + } + + class CellOutputVec { + constructor(reader, { validate = true } = {}) { + this.view = new DataView(assertArrayBuffer(reader)); + if (validate) { + this.validate(); + } + } + + validate(compatible = false) { + const offsets = verifyAndExtractOffsets(this.view, 0, true); + for (let i = 0; i < len(offsets) - 1; i++) { + new CellOutput(this.view.buffer.slice(offsets[i], offsets[i + 1]), { validate: false }).validate(); + } + } + + length() { + if (this.view.byteLength < 8) { + return 0; + } else { + return this.view.getUint32(4, true) / 4 - 1; + } + } + + indexAt(i) { + const start = 4 + i * 4; + const offset = this.view.getUint32(start, true); + let offset_end = this.view.byteLength; + if (i + 1 < this.length()) { + offset_end = this.view.getUint32(start + 4, true); + } + return new CellOutput(this.view.buffer.slice(offset, offset_end), { validate: false }); + } + } + + function SerializeCellOutputVec(value) { + return serializeTable(value.map(item => SerializeCellOutput(item))); + } + + class Script { + constructor(reader, { validate = true } = {}) { + this.view = new DataView(assertArrayBuffer(reader)); + if (validate) { + this.validate(); + } + } + + validate(compatible = false) { + const offsets = verifyAndExtractOffsets(this.view, 0, true); + new Byte32(this.view.buffer.slice(offsets[0], offsets[1]), { validate: false }).validate(); + if (offsets[2] - offsets[1] !== 1) { + throw new Error(`Invalid offset for hash_type: ${offsets[1]} - ${offsets[2]}`) + } + new Bytes(this.view.buffer.slice(offsets[2], offsets[3]), { validate: false }).validate(); + } + + getCodeHash() { + const start = 4; + const offset = this.view.getUint32(start, true); + const offset_end = this.view.getUint32(start + 4, true); + return new Byte32(this.view.buffer.slice(offset, offset_end), { validate: false }); + } + + getHashType() { + const start = 8; + const offset = this.view.getUint32(start, true); + const offset_end = this.view.getUint32(start + 4, true); + return new DataView(this.view.buffer.slice(offset, offset_end)).getUint8(0); + } + + getArgs() { + const start = 12; + const offset = this.view.getUint32(start, true); + const offset_end = this.view.byteLength; + return new Bytes(this.view.buffer.slice(offset, offset_end), { validate: false }); + } + } + + function SerializeScript(value) { + const buffers = []; + buffers.push(SerializeByte32(value.code_hash)); + const hashTypeView = new DataView(new ArrayBuffer(1)); + hashTypeView.setUint8(0, value.hash_type); + buffers.push(hashTypeView.buffer); + buffers.push(SerializeBytes(value.args)); + return serializeTable(buffers); + } + + class OutPoint { + constructor(reader, { validate = true } = {}) { + this.view = new DataView(assertArrayBuffer(reader)); + if (validate) { + this.validate(); + } + } + + getTxHash() { + return new Byte32(this.view.buffer.slice(0, Byte32.size()), { validate: false }); + } + + getIndex() { + return new Uint32(this.view.buffer.slice(0 + Byte32.size(), Uint32.size()), { validate: false }); + } + + validate(compatible = false) { + assertDataLength(this.view.byteLength, this.size()); + this.getTxHash().validate(compatible); + this.getIndex().validate(compatible); + } + static size() { + return 0 + Byte32.size() + Uint32.size(); + } + } + + function SerializeOutPoint(value) { + const array = new Uint8Array(0 + Byte32.size() + Uint32.size()); + array.set(new Uint8Array(SerializeByte32(value.tx_hash)), 0); + array.set(new Uint8Array(SerializeUint32(value.index)), 0 + Byte32.size()); + return array.buffer; + } + + class CellInput { + constructor(reader, { validate = true } = {}) { + this.view = new DataView(assertArrayBuffer(reader)); + if (validate) { + this.validate(); + } + } + + getSince() { + return new Uint64(this.view.buffer.slice(0, Uint64.size()), { validate: false }); + } + + getPreviousOutput() { + return new OutPoint(this.view.buffer.slice(0 + Uint64.size(), OutPoint.size()), { validate: false }); + } + + validate(compatible = false) { + assertDataLength(this.view.byteLength, this.size()); + this.getSince().validate(compatible); + this.getPreviousOutput().validate(compatible); + } + static size() { + return 0 + Uint64.size() + OutPoint.size(); + } + } + + function SerializeCellInput(value) { + const array = new Uint8Array(0 + Uint64.size() + OutPoint.size()); + array.set(new Uint8Array(SerializeUint64(value.since)), 0); + array.set(new Uint8Array(SerializeOutPoint(value.previous_output)), 0 + Uint64.size()); + return array.buffer; + } + + class CellOutput { + constructor(reader, { validate = true } = {}) { + this.view = new DataView(assertArrayBuffer(reader)); + if (validate) { + this.validate(); + } + } + + validate(compatible = false) { + const offsets = verifyAndExtractOffsets(this.view, 0, true); + new Uint64(this.view.buffer.slice(offsets[0], offsets[1]), { validate: false }).validate(); + new Script(this.view.buffer.slice(offsets[1], offsets[2]), { validate: false }).validate(); + new ScriptOpt(this.view.buffer.slice(offsets[2], offsets[3]), { validate: false }).validate(); + } + + getCapacity() { + const start = 4; + const offset = this.view.getUint32(start, true); + const offset_end = this.view.getUint32(start + 4, true); + return new Uint64(this.view.buffer.slice(offset, offset_end), { validate: false }); + } + + getLock() { + const start = 8; + const offset = this.view.getUint32(start, true); + const offset_end = this.view.getUint32(start + 4, true); + return new Script(this.view.buffer.slice(offset, offset_end), { validate: false }); + } + + getType() { + const start = 12; + const offset = this.view.getUint32(start, true); + const offset_end = this.view.byteLength; + return new ScriptOpt(this.view.buffer.slice(offset, offset_end), { validate: false }); + } + } + + function SerializeCellOutput(value) { + const buffers = []; + buffers.push(SerializeUint64(value.capacity)); + buffers.push(SerializeScript(value.lock)); + buffers.push(SerializeScriptOpt(value.type_)); + return serializeTable(buffers); + } + + class CellDep { + constructor(reader, { validate = true } = {}) { + this.view = new DataView(assertArrayBuffer(reader)); + if (validate) { + this.validate(); + } + } + + getOutPoint() { + return new OutPoint(this.view.buffer.slice(0, OutPoint.size()), { validate: false }); + } + + getDepType() { + return this.view.getUint8(0 + OutPoint.size()); + } + + validate(compatible = false) { + assertDataLength(this.view.byteLength, this.size()); + this.getOutPoint().validate(compatible); + } + static size() { + return 0 + OutPoint.size() + 1; + } + } + + function SerializeCellDep(value) { + const array = new Uint8Array(0 + OutPoint.size() + 1); + const view = new DataView(array.buffer); + array.set(new Uint8Array(SerializeOutPoint(value.out_point)), 0); + view.setUint8(0 + OutPoint.size(), value.dep_type); + return array.buffer; + } + + class RawTransaction { + constructor(reader, { validate = true } = {}) { + this.view = new DataView(assertArrayBuffer(reader)); + if (validate) { + this.validate(); + } + } + + validate(compatible = false) { + const offsets = verifyAndExtractOffsets(this.view, 0, true); + new Uint32(this.view.buffer.slice(offsets[0], offsets[1]), { validate: false }).validate(); + new CellDepVec(this.view.buffer.slice(offsets[1], offsets[2]), { validate: false }).validate(); + new Byte32Vec(this.view.buffer.slice(offsets[2], offsets[3]), { validate: false }).validate(); + new CellInputVec(this.view.buffer.slice(offsets[3], offsets[4]), { validate: false }).validate(); + new CellOutputVec(this.view.buffer.slice(offsets[4], offsets[5]), { validate: false }).validate(); + new BytesVec(this.view.buffer.slice(offsets[5], offsets[6]), { validate: false }).validate(); + } + + getVersion() { + const start = 4; + const offset = this.view.getUint32(start, true); + const offset_end = this.view.getUint32(start + 4, true); + return new Uint32(this.view.buffer.slice(offset, offset_end), { validate: false }); + } + + getCellDeps() { + const start = 8; + const offset = this.view.getUint32(start, true); + const offset_end = this.view.getUint32(start + 4, true); + return new CellDepVec(this.view.buffer.slice(offset, offset_end), { validate: false }); + } + + getHeaderDeps() { + const start = 12; + const offset = this.view.getUint32(start, true); + const offset_end = this.view.getUint32(start + 4, true); + return new Byte32Vec(this.view.buffer.slice(offset, offset_end), { validate: false }); + } + + getInputs() { + const start = 16; + const offset = this.view.getUint32(start, true); + const offset_end = this.view.getUint32(start + 4, true); + return new CellInputVec(this.view.buffer.slice(offset, offset_end), { validate: false }); + } + + getOutputs() { + const start = 20; + const offset = this.view.getUint32(start, true); + const offset_end = this.view.getUint32(start + 4, true); + return new CellOutputVec(this.view.buffer.slice(offset, offset_end), { validate: false }); + } + + getOutputsData() { + const start = 24; + const offset = this.view.getUint32(start, true); + const offset_end = this.view.byteLength; + return new BytesVec(this.view.buffer.slice(offset, offset_end), { validate: false }); + } + } + + function SerializeRawTransaction(value) { + const buffers = []; + buffers.push(SerializeUint32(value.version)); + buffers.push(SerializeCellDepVec(value.cell_deps)); + buffers.push(SerializeByte32Vec(value.header_deps)); + buffers.push(SerializeCellInputVec(value.inputs)); + buffers.push(SerializeCellOutputVec(value.outputs)); + buffers.push(SerializeBytesVec(value.outputs_data)); + return serializeTable(buffers); + } + + class Transaction { + constructor(reader, { validate = true } = {}) { + this.view = new DataView(assertArrayBuffer(reader)); + if (validate) { + this.validate(); + } + } + + validate(compatible = false) { + const offsets = verifyAndExtractOffsets(this.view, 0, true); + new RawTransaction(this.view.buffer.slice(offsets[0], offsets[1]), { validate: false }).validate(); + new BytesVec(this.view.buffer.slice(offsets[1], offsets[2]), { validate: false }).validate(); + } + + getRaw() { + const start = 4; + const offset = this.view.getUint32(start, true); + const offset_end = this.view.getUint32(start + 4, true); + return new RawTransaction(this.view.buffer.slice(offset, offset_end), { validate: false }); + } + + getWitnesses() { + const start = 8; + const offset = this.view.getUint32(start, true); + const offset_end = this.view.byteLength; + return new BytesVec(this.view.buffer.slice(offset, offset_end), { validate: false }); + } + } + + function SerializeTransaction(value) { + const buffers = []; + buffers.push(SerializeRawTransaction(value.raw)); + buffers.push(SerializeBytesVec(value.witnesses)); + return serializeTable(buffers); + } + + class RawHeader { + constructor(reader, { validate = true } = {}) { + this.view = new DataView(assertArrayBuffer(reader)); + if (validate) { + this.validate(); + } + } + + getVersion() { + return new Uint32(this.view.buffer.slice(0, Uint32.size()), { validate: false }); + } + + getCompactTarget() { + return new Uint32(this.view.buffer.slice(0 + Uint32.size(), Uint32.size()), { validate: false }); + } + + getTimestamp() { + return new Uint64(this.view.buffer.slice(0 + Uint32.size() + Uint32.size(), Uint64.size()), { validate: false }); + } + + getNumber() { + return new Uint64(this.view.buffer.slice(0 + Uint32.size() + Uint32.size() + Uint64.size(), Uint64.size()), { validate: false }); + } + + getEpoch() { + return new Uint64(this.view.buffer.slice(0 + Uint32.size() + Uint32.size() + Uint64.size() + Uint64.size(), Uint64.size()), { validate: false }); + } + + getParentHash() { + return new Byte32(this.view.buffer.slice(0 + Uint32.size() + Uint32.size() + Uint64.size() + Uint64.size() + Uint64.size(), Byte32.size()), { validate: false }); + } + + getTransactionsRoot() { + return new Byte32(this.view.buffer.slice(0 + Uint32.size() + Uint32.size() + Uint64.size() + Uint64.size() + Uint64.size() + Byte32.size(), Byte32.size()), { validate: false }); + } + + getProposalsHash() { + return new Byte32(this.view.buffer.slice(0 + Uint32.size() + Uint32.size() + Uint64.size() + Uint64.size() + Uint64.size() + Byte32.size() + Byte32.size(), Byte32.size()), { validate: false }); + } + + getUnclesHash() { + return new Byte32(this.view.buffer.slice(0 + Uint32.size() + Uint32.size() + Uint64.size() + Uint64.size() + Uint64.size() + Byte32.size() + Byte32.size() + Byte32.size(), Byte32.size()), { validate: false }); + } + + getDao() { + return new Byte32(this.view.buffer.slice(0 + Uint32.size() + Uint32.size() + Uint64.size() + Uint64.size() + Uint64.size() + Byte32.size() + Byte32.size() + Byte32.size() + Byte32.size(), Byte32.size()), { validate: false }); + } + + validate(compatible = false) { + assertDataLength(this.view.byteLength, this.size()); + this.getVersion().validate(compatible); + this.getCompactTarget().validate(compatible); + this.getTimestamp().validate(compatible); + this.getNumber().validate(compatible); + this.getEpoch().validate(compatible); + this.getParentHash().validate(compatible); + this.getTransactionsRoot().validate(compatible); + this.getProposalsHash().validate(compatible); + this.getUnclesHash().validate(compatible); + this.getDao().validate(compatible); + } + static size() { + return 0 + Uint32.size() + Uint32.size() + Uint64.size() + Uint64.size() + Uint64.size() + Byte32.size() + Byte32.size() + Byte32.size() + Byte32.size() + Byte32.size(); + } + } + + function SerializeRawHeader(value) { + const array = new Uint8Array(0 + Uint32.size() + Uint32.size() + Uint64.size() + Uint64.size() + Uint64.size() + Byte32.size() + Byte32.size() + Byte32.size() + Byte32.size() + Byte32.size()); + array.set(new Uint8Array(SerializeUint32(value.version)), 0); + array.set(new Uint8Array(SerializeUint32(value.compact_target)), 0 + Uint32.size()); + array.set(new Uint8Array(SerializeUint64(value.timestamp)), 0 + Uint32.size() + Uint32.size()); + array.set(new Uint8Array(SerializeUint64(value.number)), 0 + Uint32.size() + Uint32.size() + Uint64.size()); + array.set(new Uint8Array(SerializeUint64(value.epoch)), 0 + Uint32.size() + Uint32.size() + Uint64.size() + Uint64.size()); + array.set(new Uint8Array(SerializeByte32(value.parent_hash)), 0 + Uint32.size() + Uint32.size() + Uint64.size() + Uint64.size() + Uint64.size()); + array.set(new Uint8Array(SerializeByte32(value.transactions_root)), 0 + Uint32.size() + Uint32.size() + Uint64.size() + Uint64.size() + Uint64.size() + Byte32.size()); + array.set(new Uint8Array(SerializeByte32(value.proposals_hash)), 0 + Uint32.size() + Uint32.size() + Uint64.size() + Uint64.size() + Uint64.size() + Byte32.size() + Byte32.size()); + array.set(new Uint8Array(SerializeByte32(value.uncles_hash)), 0 + Uint32.size() + Uint32.size() + Uint64.size() + Uint64.size() + Uint64.size() + Byte32.size() + Byte32.size() + Byte32.size()); + array.set(new Uint8Array(SerializeByte32(value.dao)), 0 + Uint32.size() + Uint32.size() + Uint64.size() + Uint64.size() + Uint64.size() + Byte32.size() + Byte32.size() + Byte32.size() + Byte32.size()); + return array.buffer; + } + + class Header { + constructor(reader, { validate = true } = {}) { + this.view = new DataView(assertArrayBuffer(reader)); + if (validate) { + this.validate(); + } + } + + getRaw() { + return new RawHeader(this.view.buffer.slice(0, RawHeader.size()), { validate: false }); + } + + getNonce() { + return new Uint128(this.view.buffer.slice(0 + RawHeader.size(), Uint128.size()), { validate: false }); + } + + validate(compatible = false) { + assertDataLength(this.view.byteLength, this.size()); + this.getRaw().validate(compatible); + this.getNonce().validate(compatible); + } + static size() { + return 0 + RawHeader.size() + Uint128.size(); + } + } + + function SerializeHeader(value) { + const array = new Uint8Array(0 + RawHeader.size() + Uint128.size()); + array.set(new Uint8Array(SerializeRawHeader(value.raw)), 0); + array.set(new Uint8Array(SerializeUint128(value.nonce)), 0 + RawHeader.size()); + return array.buffer; + } + + class UncleBlock { + constructor(reader, { validate = true } = {}) { + this.view = new DataView(assertArrayBuffer(reader)); + if (validate) { + this.validate(); + } + } + + validate(compatible = false) { + const offsets = verifyAndExtractOffsets(this.view, 0, true); + new Header(this.view.buffer.slice(offsets[0], offsets[1]), { validate: false }).validate(); + new ProposalShortIdVec(this.view.buffer.slice(offsets[1], offsets[2]), { validate: false }).validate(); + } + + getHeader() { + const start = 4; + const offset = this.view.getUint32(start, true); + const offset_end = this.view.getUint32(start + 4, true); + return new Header(this.view.buffer.slice(offset, offset_end), { validate: false }); + } + + getProposals() { + const start = 8; + const offset = this.view.getUint32(start, true); + const offset_end = this.view.byteLength; + return new ProposalShortIdVec(this.view.buffer.slice(offset, offset_end), { validate: false }); + } + } + + function SerializeUncleBlock(value) { + const buffers = []; + buffers.push(SerializeHeader(value.header)); + buffers.push(SerializeProposalShortIdVec(value.proposals)); + return serializeTable(buffers); + } + + class Block { + constructor(reader, { validate = true } = {}) { + this.view = new DataView(assertArrayBuffer(reader)); + if (validate) { + this.validate(); + } + } + + validate(compatible = false) { + const offsets = verifyAndExtractOffsets(this.view, 0, true); + new Header(this.view.buffer.slice(offsets[0], offsets[1]), { validate: false }).validate(); + new UncleBlockVec(this.view.buffer.slice(offsets[1], offsets[2]), { validate: false }).validate(); + new TransactionVec(this.view.buffer.slice(offsets[2], offsets[3]), { validate: false }).validate(); + new ProposalShortIdVec(this.view.buffer.slice(offsets[3], offsets[4]), { validate: false }).validate(); + } + + getHeader() { + const start = 4; + const offset = this.view.getUint32(start, true); + const offset_end = this.view.getUint32(start + 4, true); + return new Header(this.view.buffer.slice(offset, offset_end), { validate: false }); + } + + getUncles() { + const start = 8; + const offset = this.view.getUint32(start, true); + const offset_end = this.view.getUint32(start + 4, true); + return new UncleBlockVec(this.view.buffer.slice(offset, offset_end), { validate: false }); + } + + getTransactions() { + const start = 12; + const offset = this.view.getUint32(start, true); + const offset_end = this.view.getUint32(start + 4, true); + return new TransactionVec(this.view.buffer.slice(offset, offset_end), { validate: false }); + } + + getProposals() { + const start = 16; + const offset = this.view.getUint32(start, true); + const offset_end = this.view.byteLength; + return new ProposalShortIdVec(this.view.buffer.slice(offset, offset_end), { validate: false }); + } + } + + function SerializeBlock(value) { + const buffers = []; + buffers.push(SerializeHeader(value.header)); + buffers.push(SerializeUncleBlockVec(value.uncles)); + buffers.push(SerializeTransactionVec(value.transactions)); + buffers.push(SerializeProposalShortIdVec(value.proposals)); + return serializeTable(buffers); + } + + class CellbaseWitness { + constructor(reader, { validate = true } = {}) { + this.view = new DataView(assertArrayBuffer(reader)); + if (validate) { + this.validate(); + } + } + + validate(compatible = false) { + const offsets = verifyAndExtractOffsets(this.view, 0, true); + new Script(this.view.buffer.slice(offsets[0], offsets[1]), { validate: false }).validate(); + new Bytes(this.view.buffer.slice(offsets[1], offsets[2]), { validate: false }).validate(); + } + + getLock() { + const start = 4; + const offset = this.view.getUint32(start, true); + const offset_end = this.view.getUint32(start + 4, true); + return new Script(this.view.buffer.slice(offset, offset_end), { validate: false }); + } + + getMessage() { + const start = 8; + const offset = this.view.getUint32(start, true); + const offset_end = this.view.byteLength; + return new Bytes(this.view.buffer.slice(offset, offset_end), { validate: false }); + } + } + + function SerializeCellbaseWitness(value) { + const buffers = []; + buffers.push(SerializeScript(value.lock)); + buffers.push(SerializeBytes(value.message)); + return serializeTable(buffers); + } + + class WitnessArgs { + constructor(reader, { validate = true } = {}) { + this.view = new DataView(assertArrayBuffer(reader)); + if (validate) { + this.validate(); + } + } + + validate(compatible = false) { + const offsets = verifyAndExtractOffsets(this.view, 0, true); + new BytesOpt(this.view.buffer.slice(offsets[0], offsets[1]), { validate: false }).validate(); + new BytesOpt(this.view.buffer.slice(offsets[1], offsets[2]), { validate: false }).validate(); + new BytesOpt(this.view.buffer.slice(offsets[2], offsets[3]), { validate: false }).validate(); + } + + getLock() { + const start = 4; + const offset = this.view.getUint32(start, true); + const offset_end = this.view.getUint32(start + 4, true); + return new BytesOpt(this.view.buffer.slice(offset, offset_end), { validate: false }); + } + + getInputType() { + const start = 8; + const offset = this.view.getUint32(start, true); + const offset_end = this.view.getUint32(start + 4, true); + return new BytesOpt(this.view.buffer.slice(offset, offset_end), { validate: false }); + } + + getOutputType() { + const start = 12; + const offset = this.view.getUint32(start, true); + const offset_end = this.view.byteLength; + return new BytesOpt(this.view.buffer.slice(offset, offset_end), { validate: false }); + } + } + + function SerializeWitnessArgs(value) { + const buffers = []; + buffers.push(SerializeBytesOpt(value.lock)); + buffers.push(SerializeBytesOpt(value.input_type)); + buffers.push(SerializeBytesOpt(value.output_type)); + return serializeTable(buffers); + } + + exports.Block = Block; + exports.Byte32 = Byte32; + exports.Byte32Vec = Byte32Vec; + exports.Bytes = Bytes; + exports.BytesOpt = BytesOpt; + exports.BytesVec = BytesVec; + exports.CellDep = CellDep; + exports.CellDepVec = CellDepVec; + exports.CellInput = CellInput; + exports.CellInputVec = CellInputVec; + exports.CellOutput = CellOutput; + exports.CellOutputVec = CellOutputVec; + exports.CellbaseWitness = CellbaseWitness; + exports.Header = Header; + exports.OutPoint = OutPoint; + exports.ProposalShortId = ProposalShortId; + exports.ProposalShortIdVec = ProposalShortIdVec; + exports.RawHeader = RawHeader; + exports.RawTransaction = RawTransaction; + exports.Script = Script; + exports.ScriptOpt = ScriptOpt; + exports.SerializeBlock = SerializeBlock; + exports.SerializeByte32 = SerializeByte32; + exports.SerializeByte32Vec = SerializeByte32Vec; + exports.SerializeBytes = SerializeBytes; + exports.SerializeBytesOpt = SerializeBytesOpt; + exports.SerializeBytesVec = SerializeBytesVec; + exports.SerializeCellDep = SerializeCellDep; + exports.SerializeCellDepVec = SerializeCellDepVec; + exports.SerializeCellInput = SerializeCellInput; + exports.SerializeCellInputVec = SerializeCellInputVec; + exports.SerializeCellOutput = SerializeCellOutput; + exports.SerializeCellOutputVec = SerializeCellOutputVec; + exports.SerializeCellbaseWitness = SerializeCellbaseWitness; + exports.SerializeHeader = SerializeHeader; + exports.SerializeOutPoint = SerializeOutPoint; + exports.SerializeProposalShortId = SerializeProposalShortId; + exports.SerializeProposalShortIdVec = SerializeProposalShortIdVec; + exports.SerializeRawHeader = SerializeRawHeader; + exports.SerializeRawTransaction = SerializeRawTransaction; + exports.SerializeScript = SerializeScript; + exports.SerializeScriptOpt = SerializeScriptOpt; + exports.SerializeTransaction = SerializeTransaction; + exports.SerializeTransactionVec = SerializeTransactionVec; + exports.SerializeUint128 = SerializeUint128; + exports.SerializeUint256 = SerializeUint256; + exports.SerializeUint32 = SerializeUint32; + exports.SerializeUint64 = SerializeUint64; + exports.SerializeUncleBlock = SerializeUncleBlock; + exports.SerializeUncleBlockVec = SerializeUncleBlockVec; + exports.SerializeWitnessArgs = SerializeWitnessArgs; + exports.Transaction = Transaction; + exports.TransactionVec = TransactionVec; + exports.Uint128 = Uint128; + exports.Uint256 = Uint256; + exports.Uint32 = Uint32; + exports.Uint64 = Uint64; + exports.UncleBlock = UncleBlock; + exports.UncleBlockVec = UncleBlockVec; + exports.WitnessArgs = WitnessArgs; + + Object.defineProperty(exports, '__esModule', { value: true }); + +}))); diff --git a/packages/core/tests/serializers.js b/packages/core/tests/serializers.js new file mode 100644 index 000000000..efa06982d --- /dev/null +++ b/packages/core/tests/serializers.js @@ -0,0 +1,435 @@ +const test = require("ava"); +const { normalizers, Reader } = require("../build/ckb-js-toolkit.node.js"); +const CKB = require("../testfiles/blockchain.umd.js"); + +test("normalize and serialize script", t => { + const value = { + code_hash: + "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8", + args: "0xaabbccdd44332211", + hash_type: "type" + }; + const normalizedValue = normalizers.NormalizeScript(value); + const serializedValue = CKB.SerializeScript(normalizedValue); + const serializedHex = new Reader(serializedValue).serializeJson(); + t.deepEqual( + serializedHex, + "0x3d0000001000000030000000310000009bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce80108000000aabbccdd44332211" + ); +}); + +test("normalize and serialize script with integer hash type", t => { + const value = { + code_hash: + "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8", + args: "0xaabbccdd44332211", + hash_type: 1 + }; + const normalizedValue = normalizers.NormalizeScript(value); + const serializedValue = CKB.SerializeScript(normalizedValue); + const serializedHex = new Reader(serializedValue).serializeJson(); + t.deepEqual( + serializedHex, + "0x3d0000001000000030000000310000009bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce80108000000aabbccdd44332211" + ); +}); + +test("normalize invalid script", t => { + const value = { + code_hash: + "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8", + args: "0xaabbccdd4433221", + hash_type: "type" + }; + t.throws(() => { + normalizers.NormalizeScript(value); + }); +}); + +test("normalize invalid script type", t => { + const value = { + code_hash: + "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8", + args: "0xaabbccdd44332211", + hash_type: "invalidtype" + }; + t.throws(() => { + normalizers.NormalizeScript(value); + }); +}); + +test("normalize and serialize outpoint", t => { + const value = { + tx_hash: + "0x4565f957aa65ca5d094ede05cbeaedcee70f5a71200ae2e31b643d2952c929bc", + index: 3 + }; + const normalizedValue = normalizers.NormalizeOutPoint(value); + const serializedValue = CKB.SerializeOutPoint(normalizedValue); + const serializedHex = new Reader(serializedValue).serializeJson(); + t.deepEqual( + serializedHex, + "0x4565f957aa65ca5d094ede05cbeaedcee70f5a71200ae2e31b643d2952c929bc03000000" + ); +}); + +test("normalize and serialize outpoint with hex number", t => { + const value = { + tx_hash: + "0x4565f957aa65ca5d094ede05cbeaedcee70f5a71200ae2e31b643d2952c929bc", + index: "0x3" + }; + const normalizedValue = normalizers.NormalizeOutPoint(value); + const serializedValue = CKB.SerializeOutPoint(normalizedValue); + const serializedHex = new Reader(serializedValue).serializeJson(); + t.deepEqual( + serializedHex, + "0x4565f957aa65ca5d094ede05cbeaedcee70f5a71200ae2e31b643d2952c929bc03000000" + ); +}); + +test("normalize invalid outpoint", t => { + const value = { + tx_hash: + "0x4565f957aa65ca5d094ede05cbeaedcee70f5a71200ae2e31b643d2952c929bc", + index: "0x123412341" + }; + t.throws(() => { + normalizers.NormalizeOutPoint(value); + }); +}); + +test("normalize and serialize cellinput", t => { + const value = { + since: "0x60a0001234", + previous_output: { + tx_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", + index: "0x10" + } + }; + const normalizedValue = normalizers.NormalizeCellInput(value); + const serializedValue = CKB.SerializeCellInput(normalizedValue); + const serializedHex = new Reader(serializedValue).serializeJson(); + t.deepEqual( + serializedHex, + "0x341200a060000000a98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da10000000" + ); +}); + +test("normalize invalid cellinput", t => { + const value = { + since: "0x60a0001234", + previous_output: "hahah" + }; + t.throws(() => { + normalizers.NormalizeCellInput(value); + }); +}); + +test("normalize and serialize celloutput", t => { + const value = { + capacity: "0x10", + lock: { + code_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", + args: "0x1234", + hash_type: "data" + }, + type: { + code_hash: + "0xa98c57135830e1b900000000f6c4b8870828199a786b26f09f7dec4bc27a73db", + args: "0x", + hash_type: "type" + } + }; + const normalizedValue = normalizers.NormalizeCellOutput(value); + const serializedValue = CKB.SerializeCellOutput(normalizedValue); + const serializedHex = new Reader(serializedValue).serializeJson(); + t.deepEqual( + serializedHex, + "0x8400000010000000180000004f000000100000000000000037000000100000003000000031000000a98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da0002000000123435000000100000003000000031000000a98c57135830e1b900000000f6c4b8870828199a786b26f09f7dec4bc27a73db0100000000" + ); +}); + +test("normalize and serialize celloutput without type", t => { + const value = { + capacity: "0x10", + lock: { + code_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", + args: "0x1234", + hash_type: "data" + } + }; + const normalizedValue = normalizers.NormalizeCellOutput(value); + const serializedValue = CKB.SerializeCellOutput(normalizedValue); + const serializedHex = new Reader(serializedValue).serializeJson(); + t.deepEqual( + serializedHex, + "0x4f00000010000000180000004f000000100000000000000037000000100000003000000031000000a98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da00020000001234" + ); +}); + +test("normalize invalid celloutput", t => { + const value = { + capacity: "0x102030405060708090", + lock: { + code_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", + args: "0x1234", + hash_type: "data" + } + }; + t.throws(() => { + normalizers.NormalizeCellOutput(value); + }); +}); + +test("normalize and serialize celldep", t => { + const value = { + dep_type: "code", + out_point: { + tx_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", + index: "0x11" + } + }; + const normalizedValue = normalizers.NormalizeCellDep(value); + const serializedValue = CKB.SerializeCellDep(normalizedValue); + const serializedHex = new Reader(serializedValue).serializeJson(); + t.deepEqual( + serializedHex, + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da1100000000" + ); +}); + +test("normalize and serialize transaction", t => { + const value = { + version: "0x0", + cell_deps: [ + { + dep_type: "code", + out_point: { + tx_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a7300", + index: "0x0" + } + } + ], + header_deps: [ + "0xb39d53656421d1532dd995a0924441ca8f43052bc2b7740a0e814a488a8214d6" + ], + inputs: [ + { + since: "0x10", + previous_output: { + tx_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a7301", + index: "0x2" + } + } + ], + outputs: [ + { + capacity: "0x1234", + lock: { + code_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a7302", + args: "0x1234", + hash_type: "data" + } + } + ], + outputs_data: ["0xabcdef"], + witnesses: ["0x31313131"] + }; + const normalizedValue = normalizers.NormalizeTransaction(value); + const serializedValue = CKB.SerializeTransaction(normalizedValue); + const serializedHex = new Reader(serializedValue).serializeJson(); + t.deepEqual( + serializedHex, + "0x1f0100000c0000000f010000030100001c00000020000000490000006d0000009d000000f40000000000000001000000a98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a7300000000000001000000b39d53656421d1532dd995a0924441ca8f43052bc2b7740a0e814a488a8214d6010000001000000000000000a98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73010200000057000000080000004f00000010000000180000004f000000341200000000000037000000100000003000000031000000a98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a7302000200000012340f0000000800000003000000abcdef10000000080000000400000031313131" + ); +}); + +test("normalize and serialize header", t => { + const value = { + compact_target: "0x1a2d3494", + number: "0xfb1bc", + parent_hash: + "0x3134874027b9b2b17391d2fa545344b10bd8b8c49d9ea47d55a447d01142b21b", + nonce: "0x449b385049af131a0000001584a00100", + timestamp: "0x170aba663c3", + transactions_root: + "0x68a83c880eb942396d22020aa83343906986f66418e9b8a4488f2866ecc4e86a", + proposals_hash: + "0x0000000000000000000000000000000000000000000000000000000000000000", + uncles_hash: + "0x0000000000000000000000000000000000000000000000000000000000000000", + version: "0x0", + epoch: "0x7080612000287", + dao: "0x40b4d9a3ddc9e730736c7342a2f023001240f362253b780000b6ca2f1e790107" + }; + const normalizedValue = normalizers.NormalizeHeader(value); + const serializedValue = CKB.SerializeHeader(normalizedValue); + const serializedHex = new Reader(serializedValue).serializeJson(); + t.deepEqual( + serializedHex, + "0x0000000094342d1ac363a6ab70010000bcb10f000000000087020012060807003134874027b9b2b17391d2fa545344b10bd8b8c49d9ea47d55a447d01142b21b68a83c880eb942396d22020aa83343906986f66418e9b8a4488f2866ecc4e86a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040b4d9a3ddc9e730736c7342a2f023001240f362253b780000b6ca2f1e7901070001a084150000001a13af4950389b44" + ); +}); + +test("normalize and serialize uncle block", t => { + const value = { + header: { + compact_target: "0x1a2d3494", + number: "0xfb1bc", + parent_hash: + "0x3134874027b9b2b17391d2fa545344b10bd8b8c49d9ea47d55a447d01142b21b", + nonce: "0x449b385049af131a0000001584a00100", + timestamp: "0x170aba663c3", + transactions_root: + "0x68a83c880eb942396d22020aa83343906986f66418e9b8a4488f2866ecc4e86a", + proposals_hash: + "0x0000000000000000000000000000000000000000000000000000000000000000", + uncles_hash: + "0x0000000000000000000000000000000000000000000000000000000000000000", + version: "0x0", + epoch: "0x7080612000287", + dao: "0x40b4d9a3ddc9e730736c7342a2f023001240f362253b780000b6ca2f1e790107" + }, + proposals: ["0x12345678901234567890", "0xabcdeabcdeabcdeabcde"] + }; + const normalizedValue = normalizers.NormalizeUncleBlock(value); + const serializedValue = CKB.SerializeUncleBlock(normalizedValue); + const serializedHex = new Reader(serializedValue).serializeJson(); + t.deepEqual( + serializedHex, + "0xf40000000c000000dc0000000000000094342d1ac363a6ab70010000bcb10f000000000087020012060807003134874027b9b2b17391d2fa545344b10bd8b8c49d9ea47d55a447d01142b21b68a83c880eb942396d22020aa83343906986f66418e9b8a4488f2866ecc4e86a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040b4d9a3ddc9e730736c7342a2f023001240f362253b780000b6ca2f1e7901070001a084150000001a13af4950389b440200000012345678901234567890abcdeabcdeabcdeabcde" + ); +}); + +test("normalize and serialize block", t => { + const value = { + header: { + compact_target: "0x1a2d3494", + number: "0xfb1bc", + parent_hash: + "0x3134874027b9b2b17391d2fa545344b10bd8b8c49d9ea47d55a447d01142b21b", + nonce: "0x449b385049af131a0000001584a00100", + timestamp: "0x170aba663c3", + transactions_root: + "0x68a83c880eb942396d22020aa83343906986f66418e9b8a4488f2866ecc4e86a", + proposals_hash: + "0x0000000000000000000000000000000000000000000000000000000000000000", + uncles_hash: + "0x0000000000000000000000000000000000000000000000000000000000000000", + version: "0x0", + epoch: "0x7080612000287", + dao: "0x40b4d9a3ddc9e730736c7342a2f023001240f362253b780000b6ca2f1e790107" + }, + transactions: [ + { + version: "0x0", + cell_deps: [ + { + dep_type: "code", + out_point: { + tx_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a7300", + index: "0x0" + } + } + ], + header_deps: [ + "0xb39d53656421d1532dd995a0924441ca8f43052bc2b7740a0e814a488a8214d6" + ], + inputs: [ + { + since: "0x10", + previous_output: { + tx_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a7301", + index: "0x2" + } + } + ], + outputs: [ + { + capacity: "0x1234", + lock: { + code_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a7302", + args: "0x1234", + hash_type: "data" + } + } + ], + outputs_data: ["0xabcdef"], + witnesses: ["0x1111"] + } + ], + uncles: [], + proposals: ["0x12345678901234567890", "0xabcdeabcdeabcdeabcde"] + }; + const normalizedValue = normalizers.NormalizeBlock(value); + const serializedValue = CKB.SerializeBlock(normalizedValue); + const serializedHex = new Reader(serializedValue).serializeJson(); + t.deepEqual( + serializedHex, + "0x2502000014000000e4000000e80000000d0200000000000094342d1ac363a6ab70010000bcb10f000000000087020012060807003134874027b9b2b17391d2fa545344b10bd8b8c49d9ea47d55a447d01142b21b68a83c880eb942396d22020aa83343906986f66418e9b8a4488f2866ecc4e86a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040b4d9a3ddc9e730736c7342a2f023001240f362253b780000b6ca2f1e7901070001a084150000001a13af4950389b440400000025010000080000001d0100000c0000000f010000030100001c00000020000000490000006d0000009d000000f40000000000000001000000a98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a7300000000000001000000b39d53656421d1532dd995a0924441ca8f43052bc2b7740a0e814a488a8214d6010000001000000000000000a98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73010200000057000000080000004f00000010000000180000004f000000341200000000000037000000100000003000000031000000a98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a7302000200000012340f0000000800000003000000abcdef0e000000080000000200000011110200000012345678901234567890abcdeabcdeabcdeabcde" + ); +}); + +test("normalize and serialize cellbase witness", t => { + const value = { + lock: { + code_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", + args: "0x1234", + hash_type: "data" + }, + message: "0x1234abcdef" + }; + const normalizedValue = normalizers.NormalizeCellbaseWitness(value); + const serializedValue = CKB.SerializeCellbaseWitness(normalizedValue); + const serializedHex = new Reader(serializedValue).serializeJson(); + t.deepEqual( + serializedHex, + "0x4c0000000c0000004300000037000000100000003000000031000000a98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da00020000001234050000001234abcdef" + ); +}); + +test("normalize and serialize witness args", t => { + const value = { + lock: "0x1234", + input_type: "0x4678", + output_type: "0x2312" + }; + const normalizedValue = normalizers.NormalizeWitnessArgs(value); + const serializedValue = CKB.SerializeWitnessArgs(normalizedValue); + const serializedHex = new Reader(serializedValue).serializeJson(); + t.deepEqual( + serializedHex, + "0x2200000010000000160000001c000000020000001234020000004678020000002312" + ); +}); + +test("normalize and serialize empty witness args", t => { + const value = {}; + const normalizedValue = normalizers.NormalizeWitnessArgs(value); + const serializedValue = CKB.SerializeWitnessArgs(normalizedValue); + const serializedHex = new Reader(serializedValue).serializeJson(); + t.deepEqual(serializedHex, "0x10000000100000001000000010000000"); +}); + +test("normalize and serialize only one witness args", t => { + const value = { + lock: "0x1234" + }; + const normalizedValue = normalizers.NormalizeWitnessArgs(value); + const serializedValue = CKB.SerializeWitnessArgs(normalizedValue); + const serializedHex = new Reader(serializedValue).serializeJson(); + t.deepEqual(serializedHex, "0x16000000100000001600000016000000020000001234"); +}); diff --git a/packages/core/tests/transformers.js b/packages/core/tests/transformers.js new file mode 100644 index 000000000..8c85e58bf --- /dev/null +++ b/packages/core/tests/transformers.js @@ -0,0 +1,649 @@ +const test = require("ava"); +const { transformers, Reader } = require("../build/ckb-js-toolkit.node.js"); + +test("transform script", t => { + const s = transformers.TransformScript({ + code_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", + args: Reader.fromRawString("args1234"), + hash_type: { + serializeJson: () => "data" + } + }); + + t.deepEqual(s, { + code_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", + args: "0x6172677331323334", + hash_type: "data" + }); +}); + +test("transform camel case script", t => { + const s = transformers.TransformScript({ + codeHash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", + args: Reader.fromRawString("args1234"), + hashType: { + serializeJson: () => "data" + } + }); + + t.deepEqual(s, { + code_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", + args: "0x6172677331323334", + hash_type: "data" + }); +}); + +test("transform plain script", t => { + const s = transformers.TransformScript({ + code_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", + args: "0x1234", + hash_type: "data" + }); + + t.deepEqual(s, { + code_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", + args: "0x1234", + hash_type: "data" + }); +}); + +test("transform invalid script", t => { + t.throws(() => { + transformers.TransformScript({ + code_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", + args: "0xgghh", + hash_type: "data" + }); + }); +}); + +test("transform invalid script but do not validate", t => { + const s = transformers.TransformScript( + { + code_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", + args: "0xgghh", + hash_type: "data" + }, + { validation: false } + ); + + t.deepEqual(s, { + code_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", + args: "0xgghh", + hash_type: "data" + }); +}); + +test("transform outpoint", t => { + const o = transformers.TransformOutPoint({ + tx_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", + index: "0x0" + }); + + t.deepEqual(o, { + tx_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", + index: "0x0" + }); +}); + +test("transform outpoint more fields", t => { + const o = transformers.TransformOutPoint({ + tx_hash: { + serializeJson: () => + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", + anotherfield: "not used" + }, + index: "0x10", + unneeded: "unneeded field" + }); + + t.deepEqual(o, { + tx_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", + index: "0x10" + }); +}); + +test("correct cellinput", t => { + const v = transformers.TransformCellInput({ + since: "0x0", + previous_output: { + tx_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", + index: new Reader("0x10") + } + }); + + t.deepEqual(v, { + since: "0x0", + previous_output: { + tx_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", + index: "0x10" + } + }); +}); + +test("correct cellinput with serialize function using this", t => { + const v = transformers.TransformCellInput({ + since: "0x0", + previous_output: { + value: { + tx_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", + index: "0x10" + }, + serializeJson: function() { + return this.value; + } + } + }); + + t.deepEqual(v, { + since: "0x0", + previous_output: { + tx_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", + index: "0x10" + } + }); +}); + +test("invalid cellinput", t => { + t.throws(() => { + transformers.TransformCellInput({ + since: "0x0", + previous_output: { + tx_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", + index: new Reader("0x00") + } + }); + }); +}); + +test("celloutput with type", t => { + const v = transformers.TransformCellOutput({ + capacity: "0x10", + lock: { + value: { + code_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", + args: new Reader("0x1234"), + hash_type: "data" + }, + serializeJson: function() { + return this.value; + } + }, + type: { + code_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", + args: "0x", + hash_type: "type" + } + }); + + t.deepEqual(v, { + capacity: "0x10", + lock: { + code_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", + args: "0x1234", + hash_type: "data" + }, + type: { + code_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", + args: "0x", + hash_type: "type" + } + }); +}); + +test("celloutput", t => { + const v = transformers.TransformCellOutput({ + capacity: "0x1024", + lock: { + code_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", + args: "0x", + hash_type: "type" + } + }); + + t.deepEqual(v, { + capacity: "0x1024", + lock: { + code_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", + args: "0x", + hash_type: "type" + } + }); +}); + +test("celloutput invalid lock but skip validation", t => { + const v = transformers.TransformCellOutput( + { + capacity: "0x1024", + type: { + code_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", + args: "0x", + hash_type: "type" + }, + unused: "value" + }, + { validation: false } + ); + + t.deepEqual(v, { + capacity: "0x1024", + type: { + code_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", + args: "0x", + hash_type: "type" + } + }); +}); + +test("celloutput invalid lock", t => { + t.throws(() => { + transformers.TransformCellOutput({ + capacity: "0x1024", + type: { + code_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", + args: "0x", + hash_type: "type" + } + }); + }); +}); + +test("correct celldep", t => { + const v = transformers.TransformCellDep({ + dep_type: { + serializeJson: () => { + return "code"; + } + }, + out_point: { + tx_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", + index: "0x0" + } + }); + + t.deepEqual(v, { + dep_type: "code", + out_point: { + tx_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", + index: "0x0" + } + }); +}); + +class DummyValueHolder { + constructor(value) { + this.value = value; + } + + serializeJson() { + return this.value; + } +} + +test("correct transaction", t => { + const v = transformers.TransformTransaction({ + version: "0x0", + cell_deps: [ + { + dep_type: "code", + out_point: { + tx_hash: { + value: "0xa98c57135830e1b91345948df6c4b887082819", + serializeJson: function() { + return this.value + "9a786b26f09f7dec4bc27a7300"; + } + }, + index: "0x0" + }, + redundant_key: "unused value" + } + ], + header_deps: [ + "0xb39d53656421d1532dd995a0924441ca8f43052bc2b7740a0e814a488a8214d6" + ], + inputs: [ + { + since: new DummyValueHolder("0x10"), + previous_output: { + tx_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a7301", + index: { + serializeJson: () => { + return "0x2"; + } + } + } + } + ], + outputs: [ + { + capacity: "0x1234", + lock: { + code_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a7302", + args: new Reader("0x1234"), + hash_type: "data" + } + } + ], + outputs_data: ["0xabcdef"], + witnesses: [Reader.fromRawString("1111")] + }); + + t.deepEqual(v, { + version: "0x0", + cell_deps: [ + { + dep_type: "code", + out_point: { + tx_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a7300", + index: "0x0" + } + } + ], + header_deps: [ + "0xb39d53656421d1532dd995a0924441ca8f43052bc2b7740a0e814a488a8214d6" + ], + inputs: [ + { + since: "0x10", + previous_output: { + tx_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a7301", + index: "0x2" + } + } + ], + outputs: [ + { + capacity: "0x1234", + lock: { + code_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a7302", + args: "0x1234", + hash_type: "data" + } + } + ], + outputs_data: ["0xabcdef"], + witnesses: ["0x31313131"] + }); +}); + +test("correct header", t => { + const v = transformers.TransformHeader({ + compact_target: "0x1a2d3494", + number: "0xfb1bc", + parent_hash: + "0x3134874027b9b2b17391d2fa545344b10bd8b8c49d9ea47d55a447d01142b21b", + nonce: "0x449b385049af131a0000001584a00100", + timestamp: "0x170aba663c3", + transactions_root: new Reader( + "0x68a83c880eb942396d22020aa83343906986f66418e9b8a4488f2866ecc4e86a" + ), + proposals_hash: + "0x0000000000000000000000000000000000000000000000000000000000000000", + uncles_hash: + "0x0000000000000000000000000000000000000000000000000000000000000000", + version: "0x0", + epoch: "0x7080612000287", + dao: "0x40b4d9a3ddc9e730736c7342a2f023001240f362253b780000b6ca2f1e790107" + }); + + t.deepEqual(v, { + compact_target: "0x1a2d3494", + number: "0xfb1bc", + parent_hash: + "0x3134874027b9b2b17391d2fa545344b10bd8b8c49d9ea47d55a447d01142b21b", + nonce: "0x449b385049af131a0000001584a00100", + timestamp: "0x170aba663c3", + transactions_root: + "0x68a83c880eb942396d22020aa83343906986f66418e9b8a4488f2866ecc4e86a", + proposals_hash: + "0x0000000000000000000000000000000000000000000000000000000000000000", + uncles_hash: + "0x0000000000000000000000000000000000000000000000000000000000000000", + version: "0x0", + epoch: "0x7080612000287", + dao: "0x40b4d9a3ddc9e730736c7342a2f023001240f362253b780000b6ca2f1e790107" + }); +}); + +test("invalid header", t => { + t.throws(() => { + transformers.TransformHeader({ + compact_target: "0x1a2d3494", + number: "0xfb1bc", + parent_hash: + "0x3134874027b9b2b17391d2fa545344b10bd8b8c49d9ea47d55a447d01142b21b", + nonce: "0x449b385049af131a0000001584a00100", + timestamp: new Reader("0x170aba663c3"), + transactions_root: + "0x68a83c880eb942396d22020aa83343906986f66418e9b8a4488f2866ecc4e86a", + proposals_hash: + "0x0000000000000000000000000000000000000000000000000000000000000000", + uncles_hash: + "0x0000000000000000000000000000000000000000000000000000000000000000", + version: "0x0", + epoch: "0x7080612000287a", + dao: "0x40b4d9a3ddc9e730736c7342a2f023001240f362253b780000b6ca2f1e790107" + }); + }); +}); + +test("correct block", t => { + const v = transformers.TransformBlock({ + header: { + compact_target: "0x1a2d3494", + number: "0xfb1bc", + parent_hash: + "0x3134874027b9b2b17391d2fa545344b10bd8b8c49d9ea47d55a447d01142b21b", + nonce: "0x449b385049af131a0000001584a00100", + timestamp: "0x170aba663c3", + transactions_root: + "0x68a83c880eb942396d22020aa83343906986f66418e9b8a4488f2866ecc4e86a", + proposals_hash: + "0x0000000000000000000000000000000000000000000000000000000000000000", + uncles_hash: + "0x0000000000000000000000000000000000000000000000000000000000000000", + version: "0x0", + epoch: "0x7080612000287", + dao: "0x40b4d9a3ddc9e730736c7342a2f023001240f362253b780000b6ca2f1e790107" + }, + transactions: [ + { + version: "0x0", + cell_deps: [ + { + dep_type: "code", + out_point: { + tx_hash: new Reader( + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a7300" + ), + index: "0x0" + } + } + ], + header_deps: [ + "0xb39d53656421d1532dd995a0924441ca8f43052bc2b7740a0e814a488a8214d6" + ], + inputs: [ + { + since: "0x10", + previous_output: { + tx_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a7301", + index: "0x2" + } + } + ], + outputs: [ + { + capacity: "0x1234", + lock: { + code_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a7302", + args: "0x1234", + hash_type: { + serializeJson: () => { + return "data"; + } + } + } + } + ], + outputs_data: ["0xabcdef"], + witnesses: ["0x1111"] + } + ], + uncles: [], + proposals: ["0x12345678901234567890", "0xabcdeabcdeabcdeabcde"] + }); + + t.deepEqual(v, { + header: { + compact_target: "0x1a2d3494", + number: "0xfb1bc", + parent_hash: + "0x3134874027b9b2b17391d2fa545344b10bd8b8c49d9ea47d55a447d01142b21b", + nonce: "0x449b385049af131a0000001584a00100", + timestamp: "0x170aba663c3", + transactions_root: + "0x68a83c880eb942396d22020aa83343906986f66418e9b8a4488f2866ecc4e86a", + proposals_hash: + "0x0000000000000000000000000000000000000000000000000000000000000000", + uncles_hash: + "0x0000000000000000000000000000000000000000000000000000000000000000", + version: "0x0", + epoch: "0x7080612000287", + dao: "0x40b4d9a3ddc9e730736c7342a2f023001240f362253b780000b6ca2f1e790107" + }, + transactions: [ + { + version: "0x0", + cell_deps: [ + { + dep_type: "code", + out_point: { + tx_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a7300", + index: "0x0" + } + } + ], + header_deps: [ + "0xb39d53656421d1532dd995a0924441ca8f43052bc2b7740a0e814a488a8214d6" + ], + inputs: [ + { + since: "0x10", + previous_output: { + tx_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a7301", + index: "0x2" + } + } + ], + outputs: [ + { + capacity: "0x1234", + lock: { + code_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a7302", + args: "0x1234", + hash_type: "data" + } + } + ], + outputs_data: ["0xabcdef"], + witnesses: ["0x1111"] + } + ], + uncles: [], + proposals: ["0x12345678901234567890", "0xabcdeabcdeabcdeabcde"] + }); +}); + +test("correct cellbase witness", t => { + const v = transformers.TransformCellbaseWitness({ + lock: { + code_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", + args: "0x1234", + hash_type: "data", + unneeded1: "unneeded1" + }, + message: "0x1234abcdef", + unneeded2: 2 + }); + + t.deepEqual(v, { + lock: { + code_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", + args: "0x1234", + hash_type: "data" + }, + message: "0x1234abcdef" + }); +}); + +test("correct witness args", t => { + const v = transformers.TransformWitnessArgs({ + lock: "0x1234", + input_type: "0x4678", + output_type: "0x2312" + }); + + t.deepEqual(v, { + lock: "0x1234", + input_type: "0x4678", + output_type: "0x2312" + }); +}); + +test("empty witness args", t => { + const v = transformers.TransformWitnessArgs({}); + + t.deepEqual(v, {}); +}); + +test("only one witness args", t => { + const v = transformers.TransformWitnessArgs({ + lock: "0x1234", + unneeded: "unneeded123" + }); + + t.deepEqual(v, { + lock: "0x1234" + }); +}); diff --git a/packages/core/tests/validators.js b/packages/core/tests/validators.js new file mode 100644 index 000000000..dbc334a32 --- /dev/null +++ b/packages/core/tests/validators.js @@ -0,0 +1,625 @@ +const test = require("ava"); +const { validators } = require("../build/ckb-js-toolkit.node.js"); + +test("correct script should pass validation", t => { + validators.ValidateScript({ + code_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", + args: "0x1234", + hash_type: "data" + }); + t.pass(); +}); + +test("correct script with empty args", t => { + validators.ValidateScript({ + code_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", + args: "0x", + hash_type: "type" + }); + t.pass(); +}); + +test("script that is not object", t => { + t.throws(() => { + validators.ValidateScript("i am a script, trust me"); + }); +}); + +test("script with invalid code hash", t => { + t.throws(() => { + validators.ValidateScript({ + code_hash: "0xa98c57135830e1b913", + args: "0x", + hash_type: "type" + }); + }); +}); + +test("script with invalid args", t => { + t.throws(() => { + validators.ValidateScript({ + code_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", + args: "0xthisisnothex", + hash_type: "type" + }); + }); +}); + +test("script with invalid hash type", t => { + t.throws(() => { + validators.ValidateScript({ + code_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", + args: "0x", + hash_type: "code" + }); + }); +}); + +test("correct outpoint", t => { + validators.ValidateOutPoint({ + tx_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", + index: "0x0" + }); + t.pass(); +}); + +test("correct outpoint with positive number", t => { + validators.ValidateOutPoint({ + tx_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", + index: "0x101" + }); + t.pass(); +}); + +test("outpoint with zero leaded invalid number", t => { + t.throws(() => { + validators.ValidateOutPoint({ + tx_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", + index: "0x010" + }); + }); +}); + +test("outpoint with invalid hex number", t => { + t.throws(() => { + validators.ValidateOutPoint({ + tx_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", + index: "0xgg1" + }); + }); +}); + +test("correct cellinput", t => { + validators.ValidateCellInput({ + since: "0x10", + previous_output: { + tx_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", + index: "0x0" + } + }); + t.pass(); +}); + +test("cellinput with invalid since", t => { + t.throws(() => { + validators.ValidateCellInput({ + since: "0x0001", + previous_output: { + tx_hash: "0xa98c57135830e1b91345948df", + index: "0x0" + } + }); + }); +}); + +test("cellinput with invalid outpoint", t => { + t.throws(() => { + validators.ValidateCellInput({ + since: "0x0", + previous_output: { + tx_hash: "0xa98c57135830e1b91345948df", + index: "0x0" + } + }); + }); +}); + +test("cellinput with invalid outpoint but skip nested validation", t => { + validators.ValidateCellInput( + { + since: "0x0", + previous_output: { + tx_hash: "0xa98c57135830e1b91345948df", + index: "0x0" + } + }, + { nestedValidation: false } + ); + t.pass(); +}); + +test("correct celloutput", t => { + validators.ValidateCellOutput({ + capacity: "0x10", + lock: { + code_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", + args: "0x1234", + hash_type: "data" + } + }); + t.pass(); +}); + +test("correct celloutput with type", t => { + validators.ValidateCellOutput({ + capacity: "0x10", + lock: { + code_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", + args: "0x1234", + hash_type: "data" + }, + type: { + code_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", + args: "0x", + hash_type: "type" + } + }); + t.pass(); +}); + +test("celloutput with invalid capacity", t => { + t.throws(() => { + validators.ValidateCellOutput({ + capacity: "0xggg", + lock: { + code_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", + args: "0x1234", + hash_type: "data" + } + }); + }); +}); + +test("celloutput with invalid lock", t => { + t.throws(() => { + validators.ValidateCellOutput({ + capacity: "0x10", + lock: { + invalid: "lock" + } + }); + }); +}); + +test("celloutput with invalid lock but skips validation", t => { + validators.ValidateCellOutput( + { + capacity: "0x10", + lock: { + invalid: "lock" + } + }, + { nestedValidation: false } + ); + t.pass(); +}); + +test("correct celldep", t => { + validators.ValidateCellDep({ + dep_type: "code", + out_point: { + tx_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", + index: "0x0" + } + }); + t.pass(); +}); + +test("celldep with invalid dep type", t => { + t.throws(() => { + validators.ValidateCellDep({ + dep_type: "data", + out_point: { + tx_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", + index: "0x0" + } + }); + }); +}); + +test("celldep with invalid out point", t => { + t.throws(() => { + validators.ValidateCellDep({ + dep_type: "dep_group", + out_point: "invalid out point" + }); + }); +}); + +test("celldep with invalid out point but skips validation", t => { + validators.ValidateCellDep( + { + dep_type: "dep_group", + out_point: "invalid out point" + }, + { nestedValidation: false } + ); + t.pass(); +}); + +test("correct raw transaction", t => { + validators.ValidateRawTransaction({ + version: "0x0", + cell_deps: [ + { + dep_type: "code", + out_point: { + tx_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a7300", + index: "0x0" + } + } + ], + header_deps: [ + "0xb39d53656421d1532dd995a0924441ca8f43052bc2b7740a0e814a488a8214d6" + ], + inputs: [ + { + since: "0x10", + previous_output: { + tx_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a7301", + index: "0x2" + } + } + ], + outputs: [ + { + capacity: "0x1234", + lock: { + code_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a7302", + args: "0x1234", + hash_type: "data" + } + } + ], + outputs_data: ["0xabcdef"] + }); + t.pass(); +}); + +test("invalid raw transaction", t => { + t.throws(() => { + validators.ValidateRawTransaction({ + version: "0x0", + cell_deps: "invalid", + header_deps: [ + "0xb39d53656421d1532dd995a0924441ca8f43052bc2b7740a0e814a488a8214d6" + ], + inputs: [ + { + since: "0x10", + previous_output: { + tx_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a7301", + index: "0x2" + } + } + ], + outputs: [ + { + capacity: "0x1234", + lock: { + code_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a7302", + args: "0x1234", + hash_type: "data" + } + } + ], + outputs_data: ["0xabcdef"] + }); + }); +}); + +test("correct transaction", t => { + validators.ValidateTransaction({ + version: "0x0", + cell_deps: [ + { + dep_type: "code", + out_point: { + tx_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a7300", + index: "0x0" + } + } + ], + header_deps: [ + "0xb39d53656421d1532dd995a0924441ca8f43052bc2b7740a0e814a488a8214d6" + ], + inputs: [ + { + since: "0x10", + previous_output: { + tx_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a7301", + index: "0x2" + } + } + ], + outputs: [ + { + capacity: "0x1234", + lock: { + code_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a7302", + args: "0x1234", + hash_type: "data" + } + } + ], + outputs_data: ["0xabcdef"], + witnesses: ["0x1111"] + }); + t.pass(); +}); + +test("correct header", t => { + validators.ValidateHeader({ + compact_target: "0x1a2d3494", + number: "0xfb1bc", + parent_hash: + "0x3134874027b9b2b17391d2fa545344b10bd8b8c49d9ea47d55a447d01142b21b", + nonce: "0x449b385049af131a0000001584a00100", + timestamp: "0x170aba663c3", + transactions_root: + "0x68a83c880eb942396d22020aa83343906986f66418e9b8a4488f2866ecc4e86a", + proposals_hash: + "0x0000000000000000000000000000000000000000000000000000000000000000", + uncles_hash: + "0x0000000000000000000000000000000000000000000000000000000000000000", + version: "0x0", + epoch: "0x7080612000287", + dao: "0x40b4d9a3ddc9e730736c7342a2f023001240f362253b780000b6ca2f1e790107" + }); + t.pass(); +}); + +test("invalid header", t => { + t.throws(() => { + validators.ValidateHeader({ + compact_target: "0x1a2d3494", + number: "0xfb1bc", + parent_hash: + "0x3134874027b9b2b17391d2fa545344b10bd8b8c49d9ea47d55a447d01142b21b", + nonce: "0x449b385049af131a0000001584a0", + timestamp: "0x170aba663c3", + transactions_root: + "0x68a83c880eb942396d22020aa83343906986f66418e9b8a4488f2866ecc4e86a", + proposals_hash: + "0x0000000000000000000000000000000000000000000000000000000000000000", + uncles_hash: + "0x0000000000000000000000000000000000000000000000000000000000000000", + version: "0x0", + epoch: "0x7080612000287", + dao: "0x40b4d9a3ddc9e730736c7342a2f023001240f362253b780000b6ca2f1e790107" + }); + }); +}); + +test("invalid raw header", t => { + t.throws(() => { + validators.ValidateRawHeader({ + compact_target: "0x1a2d3494", + number: "0xfb1bc", + parent_hash: + "0x3134874027b9b2b17391d2fa545344b10bd8b8c49d9ea47d55a447d01142b21b", + nonce: "0x449b385049af131a0000001584a00100", + timestamp: "0x170aba663c3", + transactions_root: + "0x68a83c880eb942396d22020aa83343906986f66418e9b8a4488f2866ecc4e86a", + proposals_hash: + "0x0000000000000000000000000000000000000000000000000000000000000000", + uncles_hash: + "0x0000000000000000000000000000000000000000000000000000000000000000", + version: "0x0", + epoch: "0x7080612000287", + dao: "0x40b4d9a3ddc9e730736c7342a2f023001240f362253b780000b6ca2f1e790107" + }); + }); +}); + +test("validate uncle block", t => { + validators.ValidateUncleBlock({ + header: { + compact_target: "0x1a2d3494", + number: "0xfb1bc", + parent_hash: + "0x3134874027b9b2b17391d2fa545344b10bd8b8c49d9ea47d55a447d01142b21b", + nonce: "0x449b385049af131a0000001584a00100", + timestamp: "0x170aba663c3", + transactions_root: + "0x68a83c880eb942396d22020aa83343906986f66418e9b8a4488f2866ecc4e86a", + proposals_hash: + "0x0000000000000000000000000000000000000000000000000000000000000000", + uncles_hash: + "0x0000000000000000000000000000000000000000000000000000000000000000", + version: "0x0", + epoch: "0x7080612000287", + dao: "0x40b4d9a3ddc9e730736c7342a2f023001240f362253b780000b6ca2f1e790107" + }, + proposals: ["0x12345678901234567890", "0xabcdeabcdeabcdeabcde"] + }); + t.pass(); +}); + +test("validate invalid uncle block", t => { + t.throws(() => { + validators.ValidateUncleBlock({ + header: { + compact_target: "0x1a2d3494", + number: "0xfb1bc", + parent_hash: + "0x3134874027b9b2b17391d2fa545344b10bd8b8c49d9ea47d55a447d01142b21b", + nonce: "0x449b385049af131a0000001584a00100", + timestamp: "0x170aba663c3", + transactions_root: + "0x68a83c880eb942396d22020aa83343906986f66418e9b8a4488f2866ecc4e86a", + proposals_hash: + "0x0000000000000000000000000000000000000000000000000000000000000000", + uncles_hash: + "0x0000000000000000000000000000000000000000000000000000000000000000", + version: "0x0", + epoch: "0x7080612000287", + dao: + "0x40b4d9a3ddc9e730736c7342a2f023001240f362253b780000b6ca2f1e790107" + }, + proposals: ["0x12345678901234567890", "0xabcdeabcdeab"] + }); + }); +}); + +test("validate invalid uncle block but skips nested validation", t => { + validators.ValidateUncleBlock( + { + header: 123123, + proposals: ["0x12345678901234567890"] + }, + { nestedValidation: false } + ); + t.pass(); +}); + +test("validate block", t => { + validators.ValidateBlock({ + header: { + compact_target: "0x1a2d3494", + number: "0xfb1bc", + parent_hash: + "0x3134874027b9b2b17391d2fa545344b10bd8b8c49d9ea47d55a447d01142b21b", + nonce: "0x449b385049af131a0000001584a00100", + timestamp: "0x170aba663c3", + transactions_root: + "0x68a83c880eb942396d22020aa83343906986f66418e9b8a4488f2866ecc4e86a", + proposals_hash: + "0x0000000000000000000000000000000000000000000000000000000000000000", + uncles_hash: + "0x0000000000000000000000000000000000000000000000000000000000000000", + version: "0x0", + epoch: "0x7080612000287", + dao: "0x40b4d9a3ddc9e730736c7342a2f023001240f362253b780000b6ca2f1e790107" + }, + transactions: [ + { + version: "0x0", + cell_deps: [ + { + dep_type: "code", + out_point: { + tx_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a7300", + index: "0x0" + } + } + ], + header_deps: [ + "0xb39d53656421d1532dd995a0924441ca8f43052bc2b7740a0e814a488a8214d6" + ], + inputs: [ + { + since: "0x10", + previous_output: { + tx_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a7301", + index: "0x2" + } + } + ], + outputs: [ + { + capacity: "0x1234", + lock: { + code_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a7302", + args: "0x1234", + hash_type: "data" + } + } + ], + outputs_data: ["0xabcdef"], + witnesses: ["0x1111"] + } + ], + uncles: [], + proposals: ["0x12345678901234567890", "0xabcdeabcdeabcdeabcde"] + }); + t.pass(); +}); + +test("correct cellbase witness", t => { + validators.ValidateCellbaseWitness({ + lock: { + code_hash: + "0xa98c57135830e1b91345948df6c4b8870828199a786b26f09f7dec4bc27a73da", + args: "0x1234", + hash_type: "data" + }, + message: "0x1234abcdef" + }); + t.pass(); +}); + +test("correct witness args", t => { + validators.ValidateWitnessArgs({ + lock: "0x1234", + input_type: "0x4678", + output_type: "0x2312" + }); + t.pass(); +}); + +test("empty witness args", t => { + validators.ValidateWitnessArgs({}); + t.pass(); +}); + +test("only one witness args", t => { + validators.ValidateWitnessArgs({ + lock: "0x1234" + }); + t.pass(); +}); + +test("invalid witness args", t => { + t.throws(() => { + validators.ValidateWitnessArgs({ + lock: "0x1234", + invalidkey: "0x1232" + }); + }); +}); + +test("invalid witness args content", t => { + t.throws(() => { + validators.ValidateWitnessArgs({ + lock: "0x1234gg" + }); + }); +}); diff --git a/yarn.lock b/yarn.lock index 2115b9a97..7673f659a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -48,6 +48,13 @@ dependencies: "@babel/highlight" "^7.10.1" +"@babel/code-frame@^7.10.4", "@babel/code-frame@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.16.7.tgz#44416b6bd7624b998f5b1af5d470856c40138789" + integrity sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg== + dependencies: + "@babel/highlight" "^7.16.7" + "@babel/code-frame@^7.16.0", "@babel/code-frame@^7.8.3": version "7.16.0" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.16.0.tgz#0dfc80309beec8411e65e706461c408b0bb9b431" @@ -55,13 +62,6 @@ dependencies: "@babel/highlight" "^7.16.0" -"@babel/code-frame@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.16.7.tgz#44416b6bd7624b998f5b1af5d470856c40138789" - integrity sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg== - dependencies: - "@babel/highlight" "^7.16.7" - "@babel/compat-data@^7.13.11", "@babel/compat-data@^7.16.0", "@babel/compat-data@^7.16.4": version "7.16.4" resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.16.4.tgz#081d6bbc336ec5c2435c6346b2ae1fb98b5ac68e" @@ -2101,6 +2101,48 @@ dependencies: "@octokit/openapi-types" "^11.2.0" +"@rollup/plugin-commonjs@^15.0.0": + version "15.1.0" + resolved "https://registry.yarnpkg.com/@rollup/plugin-commonjs/-/plugin-commonjs-15.1.0.tgz#1e7d076c4f1b2abf7e65248570e555defc37c238" + integrity sha512-xCQqz4z/o0h2syQ7d9LskIMvBSH4PX5PjYdpSSvgS+pQik3WahkQVNWg3D8XJeYjZoVWnIUQYDghuEMRGrmQYQ== + dependencies: + "@rollup/pluginutils" "^3.1.0" + commondir "^1.0.1" + estree-walker "^2.0.1" + glob "^7.1.6" + is-reference "^1.2.1" + magic-string "^0.25.7" + resolve "^1.17.0" + +"@rollup/plugin-node-resolve@^9.0.0": + version "9.0.0" + resolved "https://registry.yarnpkg.com/@rollup/plugin-node-resolve/-/plugin-node-resolve-9.0.0.tgz#39bd0034ce9126b39c1699695f440b4b7d2b62e6" + integrity sha512-gPz+utFHLRrd41WMP13Jq5mqqzHL3OXrfj3/MkSyB6UBIcuNt9j60GCbarzMzdf1VHFpOxfQh/ez7wyadLMqkg== + dependencies: + "@rollup/pluginutils" "^3.1.0" + "@types/resolve" "1.17.1" + builtin-modules "^3.1.0" + deepmerge "^4.2.2" + is-module "^1.0.0" + resolve "^1.17.0" + +"@rollup/plugin-replace@^2.3.3": + version "2.4.2" + resolved "https://registry.yarnpkg.com/@rollup/plugin-replace/-/plugin-replace-2.4.2.tgz#a2d539314fbc77c244858faa523012825068510a" + integrity sha512-IGcu+cydlUMZ5En85jxHH4qj2hta/11BHq95iHEyb2sbgiN0eCdzvUcHw5gt9pBL5lTi4JDYJ1acCoMGpTvEZg== + dependencies: + "@rollup/pluginutils" "^3.1.0" + magic-string "^0.25.7" + +"@rollup/pluginutils@^3.1.0": + version "3.1.0" + resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-3.1.0.tgz#706b4524ee6dc8b103b3c995533e5ad680c02b9b" + integrity sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg== + dependencies: + "@types/estree" "0.0.39" + estree-walker "^1.0.1" + picomatch "^2.2.2" + "@sindresorhus/is@^0.14.0": version "0.14.0" resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.14.0.tgz#9fb3a3cf3132328151f353de4632e01e52102bea" @@ -2276,6 +2318,11 @@ resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.44.tgz#980cc5a29a3ef3bea6ff1f7d021047d7ea575e21" integrity sha512-iaIVzr+w2ZJ5HkidlZ3EJM8VTZb2MJLCjw3V+505yVts0gRC4UMvjw0d1HPtGqI/HQC/KdsYtayfzl+AXY2R8g== +"@types/estree@0.0.39": + version "0.0.39" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f" + integrity sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw== + "@types/estree@^0.0.50": version "0.0.50" resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.50.tgz#1e0caa9364d3fccd2931c3ed96fdbeaa5d4cca83" @@ -2396,6 +2443,13 @@ "@types/scheduler" "*" csstype "^3.0.2" +"@types/resolve@1.17.1": + version "1.17.1" + resolved "https://registry.yarnpkg.com/@types/resolve/-/resolve-1.17.1.tgz#3afd6ad8967c77e4376c598a82ddd58f46ec45d6" + integrity sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw== + dependencies: + "@types/node" "*" + "@types/scheduler@*": version "0.16.2" resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.2.tgz#1a62f89525723dde24ba1b01b092bf5df8ad4d39" @@ -2665,7 +2719,7 @@ acorn-walk@^7.1.1: resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-7.1.1.tgz#345f0dffad5c735e7373d2fec9a1023e6a44b83e" integrity sha512-wdlPY2tm/9XBr7QkKlq0WQVgiuGTX6YWPyRyBviSoScBuLfTVQhvwg6wJ369GJ/1nPfTLMfnrFIfjqVg6d+jQQ== -acorn-walk@^8.1.1: +acorn-walk@^8.0.0, acorn-walk@^8.1.1: version "8.2.0" resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.2.0.tgz#741210f2e2426454508853a2f44d0ab83b7f69c1" integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA== @@ -2675,6 +2729,11 @@ acorn@^7.1.0, acorn@^7.1.1, acorn@^7.2.0: resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.2.0.tgz#17ea7e40d7c8640ff54a694c889c26f31704effe" integrity sha512-apwXVmYVpQ34m/i71vrApRrRKCWQnZZF1+npOD0WV5xZFfwWOmKGQ2RWlfdy9vWITsenisM8M0Qeq8agcFHNiQ== +acorn@^8.0.4: + version "8.7.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.7.0.tgz#90951fde0f8f09df93549481e5fc141445b791cf" + integrity sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ== + acorn@^8.4.1: version "8.5.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.5.0.tgz#4512ccb99b3698c752591e9bb4472e38ad43cee2" @@ -2780,6 +2839,11 @@ ansi-styles@^4.0.0, ansi-styles@^4.1.0, ansi-styles@^4.2.1: "@types/color-name" "^1.1.1" color-convert "^2.0.1" +ansi-styles@^5.0.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-5.2.0.tgz#07449690ad45777d1924ac2abb2fc8895dba836b" + integrity sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA== + ansicolors@~0.3.2: version "0.3.2" resolved "https://registry.yarnpkg.com/ansicolors/-/ansicolors-0.3.2.tgz#665597de86a9ffe3aa9bfbe6cae5c6ea426b4979" @@ -2977,6 +3041,68 @@ atob@^2.1.2: resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== +ava@^3.5.0: + version "3.15.0" + resolved "https://registry.yarnpkg.com/ava/-/ava-3.15.0.tgz#a239658ab1de8a29a243cc902e6b42e4574de2f0" + integrity sha512-HGAnk1SHPk4Sx6plFAUkzV/XC1j9+iQhOzt4vBly18/yo0AV8Oytx7mtJd/CR8igCJ5p160N/Oo/cNJi2uSeWA== + dependencies: + "@concordance/react" "^2.0.0" + acorn "^8.0.4" + acorn-walk "^8.0.0" + ansi-styles "^5.0.0" + arrgv "^1.0.2" + arrify "^2.0.1" + callsites "^3.1.0" + chalk "^4.1.0" + chokidar "^3.4.3" + chunkd "^2.0.1" + ci-info "^2.0.0" + ci-parallel-vars "^1.0.1" + clean-yaml-object "^0.1.0" + cli-cursor "^3.1.0" + cli-truncate "^2.1.0" + code-excerpt "^3.0.0" + common-path-prefix "^3.0.0" + concordance "^5.0.1" + convert-source-map "^1.7.0" + currently-unhandled "^0.4.1" + debug "^4.3.1" + del "^6.0.0" + emittery "^0.8.0" + equal-length "^1.0.0" + figures "^3.2.0" + globby "^11.0.1" + ignore-by-default "^2.0.0" + import-local "^3.0.2" + indent-string "^4.0.0" + is-error "^2.2.2" + is-plain-object "^5.0.0" + is-promise "^4.0.0" + lodash "^4.17.20" + matcher "^3.0.0" + md5-hex "^3.0.1" + mem "^8.0.0" + ms "^2.1.3" + ora "^5.2.0" + p-event "^4.2.0" + p-map "^4.0.0" + picomatch "^2.2.2" + pkg-conf "^3.1.0" + plur "^4.0.0" + pretty-ms "^7.0.1" + read-pkg "^5.2.0" + resolve-cwd "^3.0.0" + slash "^3.0.0" + source-map-support "^0.5.19" + stack-utils "^2.0.3" + strip-ansi "^6.0.0" + supertap "^2.0.0" + temp-dir "^2.0.0" + trim-off-newlines "^1.0.1" + update-notifier "^5.0.1" + write-file-atomic "^3.0.3" + yargs "^16.2.0" + ava@^3.8.2: version "3.8.2" resolved "https://registry.yarnpkg.com/ava/-/ava-3.8.2.tgz#877c9eb861763a185bbabd54f359e1fbe57d1754" @@ -3129,6 +3255,15 @@ binary-extensions@^2.0.0: resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.0.0.tgz#23c0df14f6a88077f5f986c0d167ec03c3d5537c" integrity sha512-Phlt0plgpIIBOGTT/ehfFnbNlfsDEiqmzE2KRXoX1bLIlir4X/MR+zSyBEkL05ffWgnRSf/DXv+WrUAVr93/ow== +bl@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/bl/-/bl-4.1.0.tgz#451535264182bec2fbbc83a62ab98cf11d9f7b3a" + integrity sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w== + dependencies: + buffer "^5.5.0" + inherits "^2.0.4" + readable-stream "^3.4.0" + blake2b-wasm@^1.1.0: version "1.1.7" resolved "https://registry.yarnpkg.com/blake2b-wasm/-/blake2b-wasm-1.1.7.tgz#e4d075da10068e5d4c3ec1fb9accc4d186c55d81" @@ -3194,6 +3329,20 @@ boxen@^4.2.0: type-fest "^0.8.1" widest-line "^3.1.0" +boxen@^5.0.0: + version "5.1.2" + resolved "https://registry.yarnpkg.com/boxen/-/boxen-5.1.2.tgz#788cb686fc83c1f486dfa8a40c68fc2b831d2b50" + integrity sha512-9gYgQKXx+1nP8mP7CzFyaUARhg7D3n1dF/FnErWmu9l6JvGpNUN278h0aSb+QjoiKSWG+iZ3uHrcqk0qrY9RQQ== + dependencies: + ansi-align "^3.0.0" + camelcase "^6.2.0" + chalk "^4.1.0" + cli-boxes "^2.2.1" + string-width "^4.2.2" + type-fest "^0.20.2" + widest-line "^3.1.0" + wrap-ansi "^7.0.0" + brace-expansion@^1.1.7: version "1.1.11" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" @@ -3324,6 +3473,14 @@ buffer@5.6.0: base64-js "^1.0.2" ieee754 "^1.1.4" +buffer@^5.5.0: + version "5.7.1" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.7.1.tgz#ba62e7c13133053582197160851a8f648e99eed0" + integrity sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ== + dependencies: + base64-js "^1.3.1" + ieee754 "^1.1.13" + buffer@^6.0.3: version "6.0.3" resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.3.tgz#2ace578459cc8fbe2a70aaa8f52ee63b6a74c6c6" @@ -3332,6 +3489,11 @@ buffer@^6.0.3: base64-js "^1.3.1" ieee754 "^1.2.1" +builtin-modules@^3.1.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-3.2.0.tgz#45d5db99e7ee5e6bc4f362e008bf917ab5049887" + integrity sha512-lGzLKcioL90C7wMczpkY0n/oART3MbBa8R9OFGE1rJxoVI86u4WAGfEk8Wjv10eKSyTHVGkSo3bvBylCEtk7LA== + builtins@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/builtins/-/builtins-1.0.3.tgz#cb94faeb61c8696451db36534e1422f94f0aee88" @@ -3449,6 +3611,11 @@ camelcase@^5.0.0, camelcase@^5.3.1: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== +camelcase@^6.2.0: + version "6.3.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" + integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== + caniuse-lite@^1.0.30001280: version "1.0.30001282" resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001282.tgz#38c781ee0a90ccfe1fe7fefd00e43f5ffdcb96fd" @@ -3539,7 +3706,7 @@ chokidar@^3.4.0: optionalDependencies: fsevents "~2.1.2" -chokidar@^3.4.2: +chokidar@^3.4.2, chokidar@^3.4.3: version "3.5.2" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.2.tgz#dba3976fcadb016f66fd365021d91600d01c1e75" integrity sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ== @@ -3584,6 +3751,11 @@ ci-parallel-vars@^1.0.0: resolved "https://registry.yarnpkg.com/ci-parallel-vars/-/ci-parallel-vars-1.0.0.tgz#af97729ed1c7381911ca37bcea263d62638701b3" integrity sha512-u6dx20FBXm+apMi+5x7UVm6EH7BL1gc4XrcnQewjcB7HWRcor/V5qWc3RG2HwpgDJ26gIi2DSEu3B7sXynAw/g== +ci-parallel-vars@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/ci-parallel-vars/-/ci-parallel-vars-1.0.1.tgz#e87ff0625ccf9d286985b29b4ada8485ca9ffbc2" + integrity sha512-uvzpYrpmidaoxvIQHM+rKSrigjOe9feHYbw4uOI2gdfe1C3xIlxO+kVXq83WQWNniTf8bAxVpy+cQeFQsMERKg== + 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" @@ -3592,14 +3764,6 @@ cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: inherits "^2.0.1" safe-buffer "^5.0.1" -ckb-js-toolkit@^0.10.2: - version "0.10.2" - resolved "https://registry.yarnpkg.com/ckb-js-toolkit/-/ckb-js-toolkit-0.10.2.tgz#d616eaef315babe797ea9ee7a271c51f82fe5a80" - integrity sha512-hVfIH5OBYibAssTag68zVhuUdqB4Iu3EqbCJrOsePpW+TryvqdmvGca2RQyGm0h6fhVK6RuNuKQ8rSdq/cjgUg== - dependencies: - cross-fetch "^3.0.6" - jsbi "^3.1.2" - ckb-js-toolkit@^0.9.2: version "0.9.2" resolved "https://registry.yarnpkg.com/ckb-js-toolkit/-/ckb-js-toolkit-0.9.2.tgz#c80eb98dc25099241e97bb025ac1566b896bbd49" @@ -3633,6 +3797,11 @@ cli-boxes@^2.2.0: resolved "https://registry.yarnpkg.com/cli-boxes/-/cli-boxes-2.2.0.tgz#538ecae8f9c6ca508e3c3c95b453fe93cb4c168d" integrity sha512-gpaBrMAizVEANOpfZp/EEUixTXDyGt7DFzdK5hU+UbWt/J0lB0w20ncZj59Z9a93xHb9u12zF5BS6i9RKbtg4w== +cli-boxes@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/cli-boxes/-/cli-boxes-2.2.1.tgz#ddd5035d25094fce220e9cab40a45840a440318f" + integrity sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw== + cli-cursor@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" @@ -3652,6 +3821,11 @@ cli-spinners@^2.2.0: resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-2.3.0.tgz#0632239a4b5aa4c958610142c34bb7a651fc8df5" integrity sha512-Xs2Hf2nzrvJMFKimOR7YR0QwZ8fc0u98kdtwN1eNAZzNQgH3vK2pXzff6GJtKh7S5hoJ87ECiAiZFS2fb5Ii2w== +cli-spinners@^2.5.0: + version "2.6.1" + resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-2.6.1.tgz#adc954ebe281c37a6319bfa401e6dd2488ffb70d" + integrity sha512-x/5fWmGMnbKQAaNwN+UZlV79qBLM9JFnJuJ03gIi5whrob0xV0ofNVHy9DhwGdsMJQc2OKv0oGmLzvaqvAVv+g== + cli-truncate@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/cli-truncate/-/cli-truncate-2.1.0.tgz#c39e28bf05edcde5be3b98992a22deed5a2b93c7" @@ -3723,6 +3897,13 @@ code-excerpt@^2.1.1: dependencies: convert-to-spaces "^1.0.1" +code-excerpt@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/code-excerpt/-/code-excerpt-3.0.0.tgz#fcfb6748c03dba8431c19f5474747fad3f250f10" + integrity sha512-VHNTVhd7KsLGOqfX3SyeO8RyYPMp1GJOg194VITk04WMYCv4plV68YWe6TJZxd9MhobjtpMRnVky01gqZsalaw== + dependencies: + convert-to-spaces "^1.0.1" + 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" @@ -3836,6 +4017,11 @@ common-path-prefix@^3.0.0: resolved "https://registry.yarnpkg.com/common-path-prefix/-/common-path-prefix-3.0.0.tgz#7d007a7e07c58c4b4d5f433131a19141b29f11e0" integrity sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w== +commondir@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" + integrity sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs= + compare-func@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/compare-func/-/compare-func-2.0.0.tgz#fb65e75edbddfd2e568554e8b5b05fff7a51fcb3" @@ -3881,6 +4067,20 @@ concordance@^4.0.0: semver "^5.5.1" well-known-symbols "^2.0.0" +concordance@^5.0.1: + version "5.0.4" + resolved "https://registry.yarnpkg.com/concordance/-/concordance-5.0.4.tgz#9896073261adced72f88d60e4d56f8efc4bbbbd2" + integrity sha512-OAcsnTEYu1ARJqWVGwf4zh4JDfHZEaSNlNccFmt8YjB2l/n19/PF2viLINHc57vO4FKIAFl2FWASIGZZWZ2Kxw== + dependencies: + date-time "^3.1.0" + esutils "^2.0.3" + fast-diff "^1.2.0" + js-string-escape "^1.0.1" + lodash "^4.17.15" + md5-hex "^3.0.1" + semver "^7.3.2" + well-known-symbols "^2.0.0" + config-chain@^1.1.12: version "1.1.13" resolved "https://registry.yarnpkg.com/config-chain/-/config-chain-1.1.13.tgz#fad0795aa6a6cdaff9ed1b68e9dff94372c232f4" @@ -4192,6 +4392,13 @@ date-time@^2.1.0: dependencies: time-zone "^1.0.0" +date-time@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/date-time/-/date-time-3.1.0.tgz#0d1e934d170579f481ed8df1e2b8ff70ee845e1e" + integrity sha512-uqCUKXE5q1PNBXjPqvwhwJf9SwMoAHBgWJ6DcrnS5o+W2JOiIILl0JEdVD8SGujrNS02GGxgwAg2PN2zONgtjg== + dependencies: + time-zone "^1.0.0" + dateformat@^3.0.0: version "3.0.3" resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-3.0.3.tgz#a6e37499a4d9a9cf85ef5872044d62901c9889ae" @@ -4342,6 +4549,20 @@ del@^5.1.0: rimraf "^3.0.0" slash "^3.0.0" +del@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/del/-/del-6.0.0.tgz#0b40d0332cea743f1614f818be4feb717714c952" + integrity sha512-1shh9DQ23L16oXSZKB2JxpL7iMy2E0S9d517ptA1P8iw0alkPtQcrKH7ru31rYtKwF499HkTu+DRzq3TCKDFRQ== + dependencies: + globby "^11.0.1" + graceful-fs "^4.2.4" + is-glob "^4.0.1" + is-path-cwd "^2.2.0" + is-path-inside "^3.0.2" + p-map "^4.0.0" + rimraf "^3.0.2" + slash "^3.0.0" + delayed-stream@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" @@ -4521,6 +4742,11 @@ emittery@^0.6.0: resolved "https://registry.yarnpkg.com/emittery/-/emittery-0.6.0.tgz#e85312468d77c3ed9a6adf43bb57d34849e0c95a" integrity sha512-6EMRGr9KzYWp8DzHFZsKVZBsMO6QhAeHMeHND8rhyBNCHKMLpgW9tZv40bwN3rAIKRS5CxcK8oLRKUJSB9h7yQ== +emittery@^0.8.0: + version "0.8.1" + resolved "https://registry.yarnpkg.com/emittery/-/emittery-0.8.1.tgz#bb23cc86d03b30aa75a7f734819dee2e1ba70860" + integrity sha512-uDfvUjVrfGJJhymx/kz6prltenw1u7WrCg1oa94zYY8xxVpLLUu045LAT0dhDZdXG58/EpPL/5kA180fQ/qudg== + emoji-regex@^7.0.1: version "7.0.3" resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" @@ -4780,7 +5006,17 @@ estraverse@^5.2.0: resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== -esutils@^2.0.2: +estree-walker@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-1.0.1.tgz#31bc5d612c96b704106b477e6dd5d8aa138cb700" + integrity sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg== + +estree-walker@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-2.0.2.tgz#52f010178c2a4c117a7757cfe942adb7d2da4cac" + integrity sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w== + +esutils@^2.0.2, esutils@^2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== @@ -4946,7 +5182,7 @@ fast-deep-equal@^3.1.1: resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz#545145077c501491e33b15ec408c294376e94ae4" integrity sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA== -fast-diff@^1.1.2: +fast-diff@^1.1.2, fast-diff@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03" integrity sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w== @@ -4963,6 +5199,17 @@ fast-glob@^3.0.3, fast-glob@^3.1.1: micromatch "^4.0.2" picomatch "^2.2.1" +fast-glob@^3.2.9: + version "3.2.10" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.10.tgz#2734f83baa7f43b7fd41e13bc34438f4ffe284ee" + integrity sha512-s9nFhFnvR63wls6/kM88kQqDhMu0AfdjqouE2l5GVQPbqLgyFjjU5ry/r2yKsJxpb9Py1EYNqieFrmMaX4v++A== + dependencies: + "@nodelib/fs.stat" "^2.0.2" + "@nodelib/fs.walk" "^1.2.3" + glob-parent "^5.1.2" + merge2 "^1.3.0" + micromatch "^4.0.4" + fast-json-stable-stringify@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" @@ -5412,7 +5659,7 @@ gitconfiglocal@^1.0.0: dependencies: ini "^1.3.2" -glob-parent@^5.0.0, glob-parent@^5.1.0, glob-parent@^5.1.1, glob-parent@~5.1.0, glob-parent@~5.1.2: +glob-parent@^5.0.0, glob-parent@^5.1.0, glob-parent@^5.1.1, glob-parent@^5.1.2, glob-parent@~5.1.0, glob-parent@~5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== @@ -5455,6 +5702,13 @@ global-dirs@^2.0.1: dependencies: ini "^1.3.5" +global-dirs@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/global-dirs/-/global-dirs-3.0.0.tgz#70a76fe84ea315ab37b1f5576cbde7d48ef72686" + integrity sha512-v8ho2DS5RiCjftj1nD9NmnfaOzTdud7RRnVd9kFNOjqZbISlx5DQ+OrTkywgd0dIt7oFCvKetZSHoHcP3sDdiA== + dependencies: + ini "2.0.0" + global-modules@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/global-modules/-/global-modules-1.0.0.tgz#6d770f0eb523ac78164d72b5e71a8877265cc3ea" @@ -5513,6 +5767,18 @@ globby@^11.0.0: merge2 "^1.3.0" slash "^3.0.0" +globby@^11.0.1: + version "11.1.0" + resolved "https://registry.yarnpkg.com/globby/-/globby-11.1.0.tgz#bd4be98bb042f83d796f7e3811991fbe82a0d34b" + integrity sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g== + dependencies: + array-union "^2.1.0" + dir-glob "^3.0.1" + fast-glob "^3.2.9" + ignore "^5.2.0" + merge2 "^1.4.1" + slash "^3.0.0" + globby@^11.0.2: version "11.0.4" resolved "https://registry.yarnpkg.com/globby/-/globby-11.0.4.tgz#2cbaff77c2f2a62e71e9b2813a67b97a3a3001a5" @@ -5808,21 +6074,26 @@ iconv-lite@^0.6.2: dependencies: safer-buffer ">= 2.1.2 < 3.0.0" +ieee754@^1.1.13, ieee754@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" + integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== + 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== -ieee754@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" - integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== - ignore-by-default@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/ignore-by-default/-/ignore-by-default-1.0.1.tgz#48ca6d72f6c6a3af00a9ad4ae6876be3889e2b09" integrity sha1-SMptcvbGo68Aqa1K5odr44ieKwk= +ignore-by-default@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ignore-by-default/-/ignore-by-default-2.0.0.tgz#537092018540640459569fe7c8c7a408af581146" + integrity sha512-+mQSgMRiFD3L3AOxLYOCxjIq4OnAmo5CIuC+lj5ehCJcPtV++QacEV7FdpzvYxH6DaOySWzQU6RR0lPLy37ckA== + ignore-walk@^3.0.1: version "3.0.3" resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-3.0.3.tgz#017e2447184bfeade7c238e4aefdd1e8f95b1e37" @@ -5847,6 +6118,11 @@ ignore@^5.1.1, ignore@^5.1.4: resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.8.tgz#f150a8b50a34289b33e22f5889abd4d8016f0e57" integrity sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw== +ignore@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.0.tgz#6d3bac8fa7fe0d45d9f9be7bac2fc279577e345a" + integrity sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ== + immutable@^4.0.0-rc.12: version "4.0.0-rc.12" resolved "https://registry.yarnpkg.com/immutable/-/immutable-4.0.0-rc.12.tgz#ca59a7e4c19ae8d9bf74a97bdf0f6e2f2a5d0217" @@ -5919,6 +6195,11 @@ inherits@2.0.3: resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= +ini@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ini/-/ini-2.0.0.tgz#e5fd556ecdd5726be978fa1001862eacb0a94bc5" + integrity sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA== + ini@^1.3.2, ini@^1.3.4, ini@^1.3.5, ini@~1.3.0: version "1.3.8" resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c" @@ -6207,6 +6488,14 @@ is-installed-globally@^0.3.1: global-dirs "^2.0.1" is-path-inside "^3.0.1" +is-installed-globally@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/is-installed-globally/-/is-installed-globally-0.4.0.tgz#9a0fd407949c30f86eb6959ef1b7994ed0b7b520" + integrity sha512-iwGqO3J21aaSkC7jWnHP/difazwS7SFeIqxv6wEtLU8Y5KlzFTjyqcSIT0d8s4+dDhKytsk9PJZ2BkS5eZwQRQ== + dependencies: + global-dirs "^3.0.0" + is-path-inside "^3.0.2" + is-interactive@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-interactive/-/is-interactive-1.0.0.tgz#cea6e6ae5c870a7b0a0004070b7b587e0252912e" @@ -6217,6 +6506,11 @@ is-lambda@^1.0.1: resolved "https://registry.yarnpkg.com/is-lambda/-/is-lambda-1.0.1.tgz#3d9877899e6a53efc0160504cde15f82e6f061d5" integrity sha1-PZh3iZ5qU+/AFgUEzeFfgubwYdU= +is-module@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-module/-/is-module-1.0.0.tgz#3258fb69f78c14d5b815d664336b4cffb6441591" + integrity sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE= + is-negative-zero@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.1.tgz#3de746c18dda2319241a53675908d8f766f11c24" @@ -6227,6 +6521,11 @@ is-npm@^4.0.0: resolved "https://registry.yarnpkg.com/is-npm/-/is-npm-4.0.0.tgz#c90dd8380696df87a7a6d823c20d0b12bbe3c84d" integrity sha512-96ECIfh9xtDDlPylNPXhzjsykHsMJZ18ASpaWzQyBr4YRTcVjUvzaHayDAES2oU/3KpljhHUjtSRNiDwi0F0ig== +is-npm@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/is-npm/-/is-npm-5.0.0.tgz#43e8d65cc56e1b67f8d47262cf667099193f45a8" + integrity sha512-WW/rQLOazUq+ST/bCAVBp/2oMERWLsR7OrKyt052dNDk4DHcDE0/7QSXITlmi+VBcV13DfIbysG3tZJm5RfdBA== + is-number-object@^1.0.4: version "1.0.6" resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.6.tgz#6a7aaf838c7f0686a50b4553f7e54a96494e89f0" @@ -6261,6 +6560,11 @@ is-path-inside@^3.0.1: resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.2.tgz#f5220fc82a3e233757291dddc9c5877f2a1f3017" integrity sha512-/2UGPSgmtqwo1ktx8NDHjuPwZWmHhO+gj0f93EkhLB5RgW9RZevWYYlIkS6zePc6U2WpOdQYIwHe9YC4DWEBVg== +is-path-inside@^3.0.2: + version "3.0.3" + resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.3.tgz#d231362e53a07ff2b0e0ea7fed049161ffd16283" + integrity sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ== + 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" @@ -6300,6 +6604,13 @@ is-property@^1.0.2: resolved "https://registry.yarnpkg.com/is-property/-/is-property-1.0.2.tgz#57fe1c4e48474edd65b09911f26b1cd4095dda84" integrity sha1-V/4cTkhHTt1lsJkR8msc1Ald2oQ= +is-reference@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/is-reference/-/is-reference-1.2.1.tgz#8b2dac0b371f4bc994fdeaba9eb542d03002d0b7" + integrity sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ== + dependencies: + "@types/estree" "*" + is-regex@^1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958" @@ -6365,6 +6676,11 @@ is-unc-path@^1.0.0: dependencies: unc-path-regex "^0.1.2" +is-unicode-supported@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz#3f26c76a809593b52bfa2ecb5710ed2779b522a7" + integrity sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw== + is-weakref@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/is-weakref/-/is-weakref-1.0.1.tgz#842dba4ec17fa9ac9850df2d6efbc1737274f2a2" @@ -6441,6 +6757,15 @@ istanbul-reports@^3.0.2: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" +jest-worker@^26.2.1: + version "26.6.2" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-26.6.2.tgz#7f72cbc4d643c365e27b9fd775f9d0eaa9c7a8ed" + integrity sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ== + dependencies: + "@types/node" "*" + merge-stream "^2.0.0" + supports-color "^7.0.0" + jest-worker@^27.0.6: version "27.3.1" resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.3.1.tgz#0def7feae5b8042be38479799aeb7b5facac24b2" @@ -6473,6 +6798,14 @@ js-yaml@^3.10.0, js-yaml@^3.13.1: argparse "^1.0.7" esprima "^4.0.0" +js-yaml@^3.14.0: + version "3.14.1" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" + integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== + dependencies: + argparse "^1.0.7" + esprima "^4.0.0" + jsbi@^3.1.2: version "3.1.3" resolved "https://registry.yarnpkg.com/jsbi/-/jsbi-3.1.3.tgz#f024b340032f7c7caaa6ca4b32b55e8d33f6e897" @@ -6641,7 +6974,7 @@ knex@^0.21.1: uuid "^7.0.3" v8flags "^3.1.3" -latest-version@^5.0.0: +latest-version@^5.0.0, latest-version@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/latest-version/-/latest-version-5.1.0.tgz#119dfe908fe38d15dfa43ecd13fa12ec8832face" integrity sha512-weT+r0kTkRQdCdYCNtkMwWXQTMEswKrFBkm4ckQOMVhhqhIMI1UT2hMj+1iigIhgSZm5gTmrRXBNoGUgaTY1xA== @@ -6846,7 +7179,7 @@ lodash.templatesettings@^4.0.0: dependencies: lodash._reinterpolate "^3.0.0" -lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.3.0, lodash@^4.7.0: +lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.3.0, lodash@^4.7.0: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -6858,6 +7191,14 @@ log-symbols@^3.0.0: dependencies: chalk "^2.4.2" +log-symbols@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-4.1.0.tgz#3fbdbb95b4683ac9fc785111e792e558d4abd503" + integrity sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg== + dependencies: + chalk "^4.1.0" + is-unicode-supported "^0.1.0" + long@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/long/-/long-4.0.0.tgz#9a7b71cfb7d361a194ea555241c92f7468d5bf28" @@ -6907,6 +7248,13 @@ lunr@^2.3.8: resolved "https://registry.yarnpkg.com/lunr/-/lunr-2.3.8.tgz#a8b89c31f30b5a044b97d2d28e2da191b6ba2072" integrity sha512-oxMeX/Y35PNFuZoHp+jUj5OSEmLCaIH4KTFJh7a93cHBoFmpw2IoPs22VIz7vyO2YUnx2Tn9dzIwO2P/4quIRg== +magic-string@^0.25.7: + version "0.25.7" + resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.25.7.tgz#3f497d6fd34c669c6798dcb821f2ef31f5445051" + integrity sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA== + dependencies: + sourcemap-codec "^1.4.4" + make-dir@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-2.1.0.tgz#5f0310e18b8be898cc07009295a30ae41e91e6f5" @@ -7059,6 +7407,14 @@ mem@^6.1.0: map-age-cleaner "^0.1.3" mimic-fn "^3.0.0" +mem@^8.0.0: + version "8.1.1" + resolved "https://registry.yarnpkg.com/mem/-/mem-8.1.1.tgz#cf118b357c65ab7b7e0817bdf00c8062297c0122" + integrity sha512-qFCFUDs7U3b8mBDPyz5EToEKoAkgCzqquIgi9nkkR9bixxOVOre+09lbuH7+9Kn2NFpm56M3GUWVbU2hQgdACA== + dependencies: + map-age-cleaner "^0.1.3" + mimic-fn "^3.1.0" + memfs@^3.1.2: version "3.3.0" resolved "https://registry.yarnpkg.com/memfs/-/memfs-3.3.0.tgz#4da2d1fc40a04b170a56622c7164c6be2c4cbef2" @@ -7098,7 +7454,7 @@ merge-stream@^2.0.0: resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== -merge2@^1.2.3, merge2@^1.3.0: +merge2@^1.2.3, merge2@^1.3.0, merge2@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== @@ -7127,7 +7483,7 @@ micromatch@^3.0.4: snapdragon "^0.8.1" to-regex "^3.0.2" -micromatch@^4.0.0: +micromatch@^4.0.0, micromatch@^4.0.4: version "4.0.4" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.4.tgz#896d519dfe9db25fce94ceb7a500919bf881ebf9" integrity sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg== @@ -7207,6 +7563,11 @@ mimic-fn@^3.0.0: resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-3.0.0.tgz#76044cfa8818bbf6999c5c9acadf2d3649b14b4b" integrity sha512-PiVO95TKvhiwgSwg1IdLYlCTdul38yZxZMIcnDSFIBUm4BNZha2qpQ4GpJ++15bHoKDtrW2D69lMfFwdFYtNZQ== +mimic-fn@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-3.1.0.tgz#65755145bbf3e36954b949c16450427451d5ca74" + integrity sha512-Ysbi9uYW9hFyfrThdDEQuykN4Ey6BuwPD2kpI5ES/nFTDn/98yxYNLZJcgUAKPT/mcrLLKaGzJR9YVxJrIdASQ== + mimic-response@^1.0.0, mimic-response@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b" @@ -7374,7 +7735,7 @@ ms@2.1.2, ms@^2.1.1, ms@^2.1.2: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== -ms@^2.0.0: +ms@^2.0.0, ms@^2.1.3: version "2.1.3" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== @@ -7935,6 +8296,21 @@ ora@^4.0.4: strip-ansi "^6.0.0" wcwidth "^1.0.1" +ora@^5.2.0: + version "5.4.1" + resolved "https://registry.yarnpkg.com/ora/-/ora-5.4.1.tgz#1b2678426af4ac4a509008e5e4ac9e9959db9e18" + integrity sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ== + dependencies: + bl "^4.1.0" + chalk "^4.1.0" + cli-cursor "^3.1.0" + cli-spinners "^2.5.0" + is-interactive "^1.0.0" + is-unicode-supported "^0.1.0" + log-symbols "^4.1.0" + strip-ansi "^6.0.0" + wcwidth "^1.0.1" + os-homedir@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" @@ -7963,6 +8339,13 @@ p-defer@^1.0.0: resolved "https://registry.yarnpkg.com/p-defer/-/p-defer-1.0.0.tgz#9f6eb182f6c9aa8cd743004a7d4f96b196b0fb0c" integrity sha1-n26xgvbJqozXQwBKfU+WsZaw+ww= +p-event@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/p-event/-/p-event-4.2.0.tgz#af4b049c8acd91ae81083ebd1e6f5cae2044c1b5" + integrity sha512-KXatOjCRXXkSePPb1Nbi0p0m+gQAwdlbhi4wQKJPI1HsMQS9g+Sqp2o+QHziPr7eYJyOZet836KoHEVM1mwOrQ== + dependencies: + p-timeout "^3.1.0" + p-finally@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" @@ -8054,7 +8437,7 @@ p-reduce@^2.0.0, p-reduce@^2.1.0: resolved "https://registry.yarnpkg.com/p-reduce/-/p-reduce-2.1.0.tgz#09408da49507c6c274faa31f28df334bc712b64a" integrity sha512-2USApvnsutq8uoxZBGbbWM0JIYLiEMJ9RlaN7fAzVNb9OZN0SHjjTTfIcb667XynS5Y1VhwDJVDa72TnPzAYWw== -p-timeout@^3.2.0: +p-timeout@^3.1.0, p-timeout@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/p-timeout/-/p-timeout-3.2.0.tgz#c7e17abc971d2a7962ef83626b35d635acf23dfe" integrity sha512-rhIwUycgwwKcP9yTOOFK/AKsAopjjCakVqLHePO3CC6Mir1Z99xT+R63jZxAT5lFZLa2inS5h+ZS2GvR99/FBg== @@ -8362,6 +8745,11 @@ prepend-http@^2.0.0: resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897" integrity sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc= +prettier@1.19.1: + version "1.19.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb" + integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew== + prettier@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.0.5.tgz#d6d56282455243f2f92cc1716692c08aa31522d4" @@ -8374,6 +8762,13 @@ pretty-ms@^7.0.0: dependencies: parse-ms "^2.1.0" +pretty-ms@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/pretty-ms/-/pretty-ms-7.0.1.tgz#7d903eaab281f7d8e03c66f867e239dc32fb73e8" + integrity sha512-973driJZvxiGOQ5ONsFhOF/DtzPMOMtgC11kCpUrPGMTgqp2q/1gwzCquocrN33is0VZ5GFHXZYMM9l6h67v2Q== + dependencies: + parse-ms "^2.1.0" + process-nextick-args@~2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" @@ -8464,6 +8859,13 @@ pupa@^2.0.1: dependencies: escape-goat "^2.0.0" +pupa@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/pupa/-/pupa-2.1.1.tgz#f5e8fd4afc2c5d97828faa523549ed8744a20d62" + integrity sha512-l1jNAspIBSFqbT+y+5FosojNpVpF94nlI+wDUpqP9enwOTfHx9f0gh5nB96vl+6yTpsJsypeNrwfzPrKuHB41A== + dependencies: + escape-goat "^2.0.0" + q@^1.5.1: version "1.5.1" resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7" @@ -8660,7 +9062,7 @@ read@1, read@~1.0.1: dependencies: mute-stream "~0.0.4" -readable-stream@3, readable-stream@^3.0.0, readable-stream@^3.0.2, readable-stream@^3.6.0: +readable-stream@3, readable-stream@^3.0.0, readable-stream@^3.0.2, readable-stream@^3.4.0, readable-stream@^3.6.0: version "3.6.0" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== @@ -8898,7 +9300,7 @@ resolve@^1.1.6, resolve@^1.1.7, resolve@^1.10.0: dependencies: path-parse "^1.0.6" -resolve@^1.14.2, resolve@^1.9.0: +resolve@^1.14.2, resolve@^1.17.0, resolve@^1.9.0: version "1.21.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.21.0.tgz#b51adc97f3472e6a5cf4444d34bc9d6b9037591f" integrity sha512-3wCbTpk5WJlyE4mSOtDLhqQmGFi0/TD9VPwmiolnk8U0wRgMEktqCXd3vy5buTO3tljvalNvKrjHEfrd2WpEKA== @@ -8974,6 +9376,16 @@ ripemd160@^2.0.0, ripemd160@^2.0.1: hash-base "^3.0.0" inherits "^2.0.1" +rollup-plugin-terser@^7.0.2: + version "7.0.2" + resolved "https://registry.yarnpkg.com/rollup-plugin-terser/-/rollup-plugin-terser-7.0.2.tgz#e8fbba4869981b2dc35ae7e8a502d5c6c04d324d" + integrity sha512-w3iIaU4OxcF52UUXiZNsNeuXIMDvFrr+ZXK6bFZ0Q60qyVfq4uLptoS4bbq3paG3x216eQllFZX7zt6TIImguQ== + dependencies: + "@babel/code-frame" "^7.10.4" + jest-worker "^26.2.1" + serialize-javascript "^4.0.0" + terser "^5.0.0" + rollup@^1.32.0: version "1.32.1" resolved "https://registry.yarnpkg.com/rollup/-/rollup-1.32.1.tgz#4480e52d9d9e2ae4b46ba0d9ddeaf3163940f9c4" @@ -8983,6 +9395,13 @@ rollup@^1.32.0: "@types/node" "*" acorn "^7.1.0" +rollup@^2.22.0: + version "2.63.0" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.63.0.tgz#fe2f7fec2133f3fab9e022b9ac245628d817c6bb" + integrity sha512-nps0idjmD+NXl6OREfyYXMn/dar3WGcyKn+KBzPdaLecub3x/LrId0wUcthcr8oZUAcZAR8NKcfGGFlNgGL1kQ== + optionalDependencies: + fsevents "~2.3.2" + rsvp@^3.5.0: version "3.6.2" resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-3.6.2.tgz#2e96491599a96cde1b515d5674a8f7a91452926a" @@ -9145,6 +9564,20 @@ serialize-error@^2.1.0: resolved "https://registry.yarnpkg.com/serialize-error/-/serialize-error-2.1.0.tgz#50b679d5635cdf84667bdc8e59af4e5b81d5f60a" integrity sha1-ULZ51WNc34Rme9yOWa9OW4HV9go= +serialize-error@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/serialize-error/-/serialize-error-7.0.1.tgz#f1360b0447f61ffb483ec4157c737fab7d778e18" + integrity sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw== + dependencies: + type-fest "^0.13.1" + +serialize-javascript@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-4.0.0.tgz#b525e1238489a5ecfc42afacc3fe99e666f4b1aa" + integrity sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw== + dependencies: + randombytes "^2.1.0" + serialize-javascript@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.0.tgz#efae5d88f45d7924141da8b5c3a7a7e663fefeb8" @@ -9441,6 +9874,11 @@ source-map@^0.7.3, source-map@~0.7.2: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383" integrity sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ== +sourcemap-codec@^1.4.4: + version "1.4.8" + resolved "https://registry.yarnpkg.com/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz#ea804bd94857402e6992d05a38ef1ae35a9ab4c4" + integrity sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA== + spdx-correct@^3.0.0: version "3.1.1" resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.1.tgz#dece81ac9c1e6713e5f7d1b6f17d468fa53d89a9" @@ -9532,6 +9970,13 @@ stack-utils@^2.0.2: dependencies: escape-string-regexp "^2.0.0" +stack-utils@^2.0.3: + version "2.0.5" + resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-2.0.5.tgz#d25265fca995154659dbbfba3b49254778d2fdd5" + integrity sha512-xrQcmYhOsn/1kX+Vraq+7j4oE2j/6BFscZ0etmYg81xuM8Gq0022Pxb8+IqgOFUIaxHs0KaSb7T1+OegiNrNFA== + dependencies: + escape-string-regexp "^2.0.0" + static-extend@^0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" @@ -9585,6 +10030,15 @@ string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0: is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.0" +string-width@^4.2.2: + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + string.prototype.padend@^3.0.0: version "3.1.3" resolved "https://registry.yarnpkg.com/string.prototype.padend/-/string.prototype.padend-3.1.3.tgz#997a6de12c92c7cb34dc8a201a6c53d9bd88a5f1" @@ -9652,6 +10106,13 @@ strip-ansi@^6.0.0: dependencies: ansi-regex "^5.0.0" +strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + strip-bom@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" @@ -9704,6 +10165,17 @@ supertap@^1.0.0: serialize-error "^2.1.0" strip-ansi "^4.0.0" +supertap@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/supertap/-/supertap-2.0.0.tgz#8b587d6e14b8e885fa5183a9c45abf429feb9f7f" + integrity sha512-jRzcXlCeDYvKoZGA5oRhYyR3jUIYu0enkSxtmAgHRlD7HwrovTpH4bDSi0py9FtuA8si9cW/fKommJHuaoDHJA== + dependencies: + arrify "^2.0.1" + indent-string "^4.0.0" + js-yaml "^3.14.0" + serialize-error "^7.0.1" + strip-ansi "^6.0.0" + supports-color@^4.0.0: version "4.5.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-4.5.0.tgz#be7a0de484dec5c5cddf8b3d59125044912f635b" @@ -9718,6 +10190,13 @@ supports-color@^5.3.0: dependencies: has-flag "^3.0.0" +supports-color@^7.0.0, supports-color@^7.2.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" + integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== + dependencies: + has-flag "^4.0.0" + supports-color@^7.1.0: version "7.1.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.1.0.tgz#68e32591df73e25ad1c4b49108a2ec507962bfd1" @@ -9725,13 +10204,6 @@ supports-color@^7.1.0: dependencies: has-flag "^4.0.0" -supports-color@^7.2.0: - version "7.2.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" - integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== - dependencies: - has-flag "^4.0.0" - supports-color@^8.0.0: version "8.1.1" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" @@ -9842,7 +10314,7 @@ terser-webpack-plugin@^5.1.3: source-map "^0.6.1" terser "^5.7.2" -terser@^5.7.2: +terser@^5.0.0, terser@^5.7.2: version "5.10.0" resolved "https://registry.yarnpkg.com/terser/-/terser-5.10.0.tgz#b86390809c0389105eb0a0b62397563096ddafcc" integrity sha512-AMmF99DMfEDiRJfxfY5jj5wNH/bYO09cniSqhfoyxc8sFoYIgkJy86G04UoZU5VjlpnplVu0K6Tx6E9b5+DlHA== @@ -10084,11 +10556,21 @@ type-fest@^0.11.0: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.11.0.tgz#97abf0872310fed88a5c466b25681576145e33f1" integrity sha512-OdjXJxnCN1AvyLSzeKIgXTXxV+99ZuXl3Hpo9XpJAv9MBcHrrJOQ5kV7ypXOuQie+AmWG25hLbiKdwYTifzcfQ== +type-fest@^0.13.1: + version "0.13.1" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.13.1.tgz#0172cb5bce80b0bd542ea348db50c7e21834d934" + integrity sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg== + type-fest@^0.18.0: version "0.18.1" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.18.1.tgz#db4bc151a4a2cf4eebf9add5db75508db6cc841f" integrity sha512-OIAYXk8+ISY+qTOwkHtKqzAuxchoMiD9Udx+FSGQDuiRR+PJKJHc2NJAXlbhkGwTt/4/nKZxELY1w3ReWOL8mw== +type-fest@^0.20.2: + version "0.20.2" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4" + integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== + type-fest@^0.3.0: version "0.3.1" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.3.1.tgz#63d00d204e059474fe5e1b7c011112bbd1dc29e1" @@ -10310,6 +10792,26 @@ update-notifier@^4.1.0: semver-diff "^3.1.1" xdg-basedir "^4.0.0" +update-notifier@^5.0.1: + version "5.1.0" + resolved "https://registry.yarnpkg.com/update-notifier/-/update-notifier-5.1.0.tgz#4ab0d7c7f36a231dd7316cf7729313f0214d9ad9" + integrity sha512-ItnICHbeMh9GqUy31hFPrD1kcuZ3rpxDZbf4KUDavXwS0bW5m7SLbDQpGX3UYr072cbrF5hFUs3r5tUsPwjfHw== + dependencies: + boxen "^5.0.0" + chalk "^4.1.0" + configstore "^5.0.1" + has-yarn "^2.1.0" + import-lazy "^2.1.0" + is-ci "^2.0.0" + is-installed-globally "^0.4.0" + is-npm "^5.0.0" + is-yarn-global "^0.3.0" + latest-version "^5.1.0" + pupa "^2.1.1" + semver "^7.3.4" + semver-diff "^3.1.1" + xdg-basedir "^4.0.0" + uri-js@^4.2.2: version "4.2.2" resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0" From 644ee2a7e4d970ab72387e6b817c3e9a7546c7d7 Mon Sep 17 00:00:00 2001 From: beiqian Date: Fri, 14 Jan 2022 16:06:31 +0800 Subject: [PATCH 2/3] ignore lib --- packages/core/lib/ckb-js-toolkit.esm.js | 1 - packages/core/lib/ckb-js-toolkit.node.js | 2 -- packages/core/lib/ckb-js-toolkit.node.js.map | 1 - packages/core/lib/ckb-js-toolkit.umd.js | 1 - 4 files changed, 5 deletions(-) delete mode 100644 packages/core/lib/ckb-js-toolkit.esm.js delete mode 100644 packages/core/lib/ckb-js-toolkit.node.js delete mode 100644 packages/core/lib/ckb-js-toolkit.node.js.map delete mode 100644 packages/core/lib/ckb-js-toolkit.umd.js diff --git a/packages/core/lib/ckb-js-toolkit.esm.js b/packages/core/lib/ckb-js-toolkit.esm.js deleted file mode 100644 index 2178aed57..000000000 --- a/packages/core/lib/ckb-js-toolkit.esm.js +++ /dev/null @@ -1 +0,0 @@ -class t{constructor(t){this.view=new DataView(t)}length(){return this.view.byteLength}indexAt(t){return this.view.getUint8(t)}toArrayBuffer(){return this.view.buffer}serializeJson(){return"0x"+Array.prototype.map.call(new Uint8Array(this.view.buffer),(t=>("00"+t.toString(16)).slice(-2))).join("")}}class e{constructor(t){this.string=t}length(){return this.string.length/2-1}indexAt(t){return parseInt(this.string.substr(2+2*t,2),16)}toArrayBuffer(){const t=new ArrayBuffer(this.length()),e=new DataView(t);for(let t=0;t255)throw new Error("fromRawString can only accept UTF-8 raw string!");n.setUint8(t,r)}return new t(r)}}var n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function i(t,e,r){return t(r={path:e,exports:{},require:function(t,e){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==e&&r.path)}},r.exports),r.exports}var o=i((function(t,e){t.exports=function(){function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}function e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){for(var r,n=0;nt.length)&&(e=t.length);for(var r=0,n=Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw o}}}}var v=function(r){var o=Math.abs,a=Math.max,u=Math.imul,s=Math.clz32;function _(t,r){var n;if(e(this,_),t>_.__kMaxLength)throw new RangeError("Maximum BigInt size exceeded");return(n=l.call(this,t)).sign=r,n}i(_,r);var l=h(_);return n(_,[{key:"toDebugString",value:function(){var t,e=["BigInt["],r=p(this);try{for(r.s();!(t=r.n()).done;){var n=t.value;e.push((n?(n>>>0).toString(16):n)+", ")}}catch(t){r.e(t)}finally{r.f()}return e.push("]"),e.join("")}},{key:"toString",value:function(){var t=0t||36this.length&&(r=this.length);for(var n=65535&t,i=t>>>16,o=0,a=65535&e,s=e>>>16,_=0;_>>16,h=u(f,n),g=u(f,i),d=u(c,n),p=u(c,i),v=a+(65535&h),y=s+o+(v>>>16)+(h>>>16)+(65535&g)+(65535&d);o=(a=(g>>>16)+(d>>>16)+(65535&p)+(y>>>16))>>>16,a&=65535,s=p>>>16,this.__setDigit(_,65535&v|y<<16)}if(0!==o||0!==a||0!==s)throw new Error("implementation bug")}},{key:"__inplaceAdd",value:function(t,e,r){for(var n,i=0,o=0;o>>16,this.__setHalfDigit(e+o,n);return i}},{key:"__inplaceSub",value:function(t,e,r){var n=0;if(1&e){e>>=1;for(var i=this.__digit(e),o=65535&i,a=0;a>>1;a++){var u=t.__digit(a),s=(i>>>16)-(65535&u)-n;n=1&s>>>16,this.__setDigit(e+a,s<<16|65535&o),n=1&(o=(65535&(i=this.__digit(e+a+1)))-(u>>>16)-n)>>>16}var _=t.__digit(a),l=(i>>>16)-(65535&_)-n;if(n=1&l>>>16,this.__setDigit(e+a,l<<16|65535&o),e+a+1>=this.length)throw new RangeError("out of bounds");0==(1&r)&&(n=1&(o=(65535&(i=this.__digit(e+a+1)))-(_>>>16)-n)>>>16,this.__setDigit(e+t.length,4294901760&i|65535&o))}else{e>>=1;for(var f=0;f>>16)-(h>>>16)-(n=1&g>>>16);n=1&d>>>16,this.__setDigit(e+f,d<<16|65535&g)}var p=this.__digit(e+f),v=t.__digit(f),y=(65535&p)-(65535&v)-n;n=1&y>>>16;var b=0;0==(1&r)&&(n=1&(b=(p>>>16)-(v>>>16)-n)>>>16),this.__setDigit(e+f,b<<16|65535&y)}return n}},{key:"__inplaceRightShift",value:function(t){if(0!==t){for(var e,r=this.__digit(0)>>>t,n=this.length-1,i=0;i>>t;this.__setDigit(n,r)}}},{key:"__digit",value:function(t){return this[t]}},{key:"__unsignedDigit",value:function(t){return this[t]>>>0}},{key:"__setDigit",value:function(t,e){this[t]=0|e}},{key:"__setDigitGrow",value:function(t,e){this[t]=0|e}},{key:"__halfDigitLength",value:function(){var t=this.length;return 65535>=this.__unsignedDigit(t-1)?2*t-1:2*t}},{key:"__halfDigit",value:function(t){return 65535&this[t>>>1]>>>((1&t)<<4)}},{key:"__setHalfDigit",value:function(t,e){var r=t>>>1,n=this.__digit(r),i=1&t?65535&n|e<<16:4294901760&n|65535&e;this.__setDigit(r,i)}}],[{key:"BigInt",value:function(e){var r=Math.floor,n=Number.isFinite;if("number"==typeof e){if(0===e)return _.__zero();if((0|e)===e)return 0>e?_.__oneDigit(-e,!0):_.__oneDigit(e,!1);if(!n(e)||r(e)!==e)throw new RangeError("The number "+e+" cannot be converted to BigInt because it is not an integer");return _.__fromDouble(e)}if("string"==typeof e){var i=_.__fromString(e);if(null===i)throw new SyntaxError("Cannot convert "+e+" to a BigInt");return i}if("boolean"==typeof e)return!0===e?_.__oneDigit(1,!1):_.__zero();if("object"===t(e)){if(e.constructor===_)return e;var o=_.__toPrimitive(e);return _.BigInt(o)}throw new TypeError("Cannot convert "+e+" to a BigInt")}},{key:"toNumber",value:function(t){var e=t.length;if(0===e)return 0;if(1===e){var r=t.__unsignedDigit(0);return t.sign?-r:r}var n=t.__digit(e-1),i=s(n),o=32*e-i;if(1024>>=12;var h=f-12,g=12<=f?0:u<<20+f,d=20+f;0>>32-h,g=u<>>32-d,d-=32);var p=_.__decideRounding(t,d,l,u);if((1===p||0===p&&1==(1&g))&&0==(g=g+1>>>0)&&0!=++c>>>20&&(c=0,1023<++a))return t.sign?-1/0:1/0;var v=t.sign?-2147483648:0;return a=a+1023<<20,_.__kBitConversionInts[1]=v|a|c,_.__kBitConversionInts[0]=g,_.__kBitConversionDouble[0]}},{key:"unaryMinus",value:function(t){if(0===t.length)return t;var e=t.__copy();return e.sign=!t.sign,e}},{key:"bitwiseNot",value:function(t){return t.sign?_.__absoluteSubOne(t).__trim():_.__absoluteAddOne(t,!0)}},{key:"exponentiate",value:function(t,e){if(e.sign)throw new RangeError("Exponent must be positive");if(0===e.length)return _.__oneDigit(1,!1);if(0===t.length)return t;if(1===t.length&&1===t.__digit(0))return t.sign&&0==(1&e.__digit(0))?_.unaryMinus(t):t;if(1=_.__kMaxLengthBits)throw new RangeError("BigInt too big");if(1===t.length&&2===t.__digit(0)){var n=1+(r>>>5),i=new _(n,t.sign&&0!=(1&r));i.__initializeDigits();var o=1<<(31&r);return i.__setDigit(n-1,o),i}var a=null,u=t;for(0!=(1&r)&&(a=t),r>>=1;0!==r;r>>=1)u=_.multiply(u,u),0!=(1&r)&&(a=null===a?u:_.multiply(a,u));return a}},{key:"multiply",value:function(t,e){if(0===t.length)return t;if(0===e.length)return e;var r=t.length+e.length;32<=t.__clzmsd()+e.__clzmsd()&&r--;var n=new _(r,t.sign!==e.sign);n.__initializeDigits();for(var i=0;i_.__absoluteCompare(t,e))return _.__zero();var r,n=t.sign!==e.sign,i=e.__unsignedDigit(0);if(1===e.length&&65535>=i){if(1===i)return n===t.sign?t:_.unaryMinus(t);r=_.__absoluteDivSmall(t,i,null)}else r=_.__absoluteDivLarge(t,e,!0,!1);return r.sign=n,r.__trim()}},{key:"remainder",value:function(t,e){if(0===e.length)throw new RangeError("Division by zero");if(0>_.__absoluteCompare(t,e))return t;var r=e.__unsignedDigit(0);if(1===e.length&&65535>=r){if(1===r)return _.__zero();var n=_.__absoluteModSmall(t,r);return 0===n?_.__zero():_.__oneDigit(n,t.sign)}var i=_.__absoluteDivLarge(t,e,!1,!0);return i.sign=t.sign,i.__trim()}},{key:"add",value:function(t,e){var r=t.sign;return r===e.sign?_.__absoluteAdd(t,e,r):0<=_.__absoluteCompare(t,e)?_.__absoluteSub(t,e,r):_.__absoluteSub(e,t,!r)}},{key:"subtract",value:function(t,e){var r=t.sign;return r===e.sign?0<=_.__absoluteCompare(t,e)?_.__absoluteSub(t,e,r):_.__absoluteSub(e,t,!r):_.__absoluteAdd(t,e,r)}},{key:"leftShift",value:function(t,e){return 0===e.length||0===t.length?t:e.sign?_.__rightShiftByAbsolute(t,e):_.__leftShiftByAbsolute(t,e)}},{key:"signedRightShift",value:function(t,e){return 0===e.length||0===t.length?t:e.sign?_.__leftShiftByAbsolute(t,e):_.__rightShiftByAbsolute(t,e)}},{key:"unsignedRightShift",value:function(){throw new TypeError("BigInts have no unsigned right shift; use >> instead")}},{key:"lessThan",value:function(t,e){return 0>_.__compareToBigInt(t,e)}},{key:"lessThanOrEqual",value:function(t,e){return 0>=_.__compareToBigInt(t,e)}},{key:"greaterThan",value:function(t,e){return 0<_.__compareToBigInt(t,e)}},{key:"greaterThanOrEqual",value:function(t,e){return 0<=_.__compareToBigInt(t,e)}},{key:"equal",value:function(t,e){if(t.sign!==e.sign)return!1;if(t.length!==e.length)return!1;for(var r=0;r=_.__kMaxLengthBits)return e;var r=t+31>>>5;if(e.length_.__kMaxLengthBits)throw new RangeError("BigInt too big");return _.__truncateAndSubFromPowerOfTwo(t,e,!1)}if(t>=_.__kMaxLengthBits)return e;var r=t+31>>>5;if(e.length>>n)return e}return _.__truncateToNBits(t,e)}},{key:"ADD",value:function(t,e){if(t=_.__toPrimitive(t),e=_.__toPrimitive(e),"string"==typeof t)return"string"!=typeof e&&(e=e.toString()),t+e;if("string"==typeof e)return t.toString()+e;if(t=_.__toNumeric(t),e=_.__toNumeric(e),_.__isBigInt(t)&&_.__isBigInt(e))return _.add(t,e);if("number"==typeof t&&"number"==typeof e)return t+e;throw new TypeError("Cannot mix BigInt and other types, use explicit conversions")}},{key:"LT",value:function(t,e){return _.__compare(t,e,0)}},{key:"LE",value:function(t,e){return _.__compare(t,e,1)}},{key:"GT",value:function(t,e){return _.__compare(t,e,2)}},{key:"GE",value:function(t,e){return _.__compare(t,e,3)}},{key:"EQ",value:function(e,r){for(;;){if(_.__isBigInt(e))return _.__isBigInt(r)?_.equal(e,r):_.EQ(r,e);if("number"==typeof e){if(_.__isBigInt(r))return _.__equalToNumber(r,e);if("object"!==t(r))return e==r;r=_.__toPrimitive(r)}else if("string"==typeof e){if(_.__isBigInt(r))return null!==(e=_.__fromString(e))&&_.equal(e,r);if("object"!==t(r))return e==r;r=_.__toPrimitive(r)}else if("boolean"==typeof e){if(_.__isBigInt(r))return _.__equalToNumber(r,+e);if("object"!==t(r))return e==r;r=_.__toPrimitive(r)}else if("symbol"===t(e)){if(_.__isBigInt(r))return!1;if("object"!==t(r))return e==r;r=_.__toPrimitive(r)}else{if("object"!==t(e))return e==r;if("object"===t(r)&&r.constructor!==_)return e==r;e=_.__toPrimitive(e)}}}},{key:"NE",value:function(t,e){return!_.EQ(t,e)}},{key:"__zero",value:function(){return new _(0,!1)}},{key:"__oneDigit",value:function(t,e){var r=new _(1,e);return r.__setDigit(0,t),r}},{key:"__decideRounding",value:function(t,e,r,n){if(0e)i=-e-1;else{if(0===r)return-1;r--,n=t.__digit(r),i=31}var o=1<>>20)-1023,n=1+(r>>>5),i=new _(n,0>t),o=1048575&_.__kBitConversionInts[1]|1048576,a=_.__kBitConversionInts[0],u=20,s=31&r,l=0;if(s>>f,o=o<<32-f|a>>>f,a<<=32-f}else if(s===u)l=32,e=o,o=a;else{var c=s-u;l=32-c,e=o<>>32-c,o=a<=t&&9<=t)||(159>=t?32==t:131071>=t?160==t||5760==t:196607>=t?10>=(t&=131071)||40==t||41==t||47==t||95==t||4096==t:65279==t)}},{key:"__fromString",value:function(t){var e=11073741824/u)return null;var l=new _(31+(u*a+s>>>_.__kBitsPerCharTableShift)>>>5,!1),f=10>e?e:10,c=10>=_.__kBitsPerCharTableShift;var h=[],g=[],d=!1;do{for(var p,v=0,y=0;;){if(p=void 0,o-48>>>0>>0>>0>>0>>_.__kBitsPerCharTableShift+5;l.__inplaceMultiplyAdd(D,k,P)}while(!b)}if(i!==n){if(!_.__isWhitespace(o))return null;for(i++;i>>s-(o-=32))}if(0!==i){if(n>=t.length)throw new Error("implementation bug");t.__setDigit(n++,i)}for(;n>>1)+(85&n))>>>2)+(51&n))>>>4)+(15&n),o=e-1,a=t.__digit(r-1),u=0|(32*r-s(a)+i-1)/i;if(t.sign&&u++,268435456>>v,h=32-v;h>=i;)l[f--]=_.__kConversionChars[c&o],c>>>=i,h-=i}var y=(c|a<>>i-h;0!==c;)l[f--]=_.__kConversionChars[c&o],c>>>=i;if(t.sign&&(l[f--]="-"),-1!==f)throw new Error("implementation bug");return l.join("")}},{key:"__toStringGeneric",value:function(t,e,r){var n=t.length;if(0===n)return"";if(1===n){var i=t.__unsignedDigit(0).toString(e);return!1===r&&t.sign&&(i="-"+i),i}var o,a,u=32*n-s(t.__digit(n-1)),l=_.__kMaxBitsPerChar[e]-1,f=u*_.__kBitsPerCharTableMultiplier,c=1+(f=0|(f+=l-1)/l)>>1,h=_.exponentiate(_.__oneDigit(e,!1),_.__oneDigit(c,!1)),g=h.__unsignedDigit(0);if(1===h.length&&65535>=g){(o=new _(t.length,!1)).__initializeDigits();for(var d,p=0,v=2*t.length-1;0<=v;v--)d=p<<16|t.__halfDigit(v),o.__setHalfDigit(v,0|d/g),p=0|d%g;a=p.toString(e)}else{var y=_.__absoluteDivLarge(t,h,!0,!0);o=y.quotient;var b=y.remainder.__trim();a=_.__toStringGeneric(b,e,!0)}o.__trim();for(var m=_.__toStringGeneric(o,e,!0);a.lengthn?_.__absoluteLess(r):0}},{key:"__compareToNumber",value:function(t,e){if(!0|e){var r=t.sign,n=0>e;if(r!==n)return _.__unequalSign(r);if(0===t.length){if(n)throw new Error("implementation bug");return 0===e?0:-1}if(1i?_.__absoluteGreater(r):ae)return _.__unequalSign(r);if(0===e)throw new Error("implementation bug: should be handled elsewhere");if(0===t.length)return-1;_.__kBitConversionDouble[0]=e;var n=2047&_.__kBitConversionInts[1]>>>20;if(2047==n)throw new Error("implementation bug: handled elsewhere");var i=n-1023;if(0>i)return _.__absoluteGreater(r);var o=t.length,a=t.__digit(o-1),u=s(a),l=32*o-u,f=i+1;if(lf)return _.__absoluteGreater(r);var c=1048576|1048575&_.__kBitConversionInts[1],h=_.__kBitConversionInts[0],g=20,d=31-u;if(d!==(l-1)%31)throw new Error("implementation bug");var p,v=0;if(d>>y,c=c<<32-y|h>>>y,h<<=32-y}else if(d===g)v=32,p=c,c=h;else{var b=d-g;v=32-b,p=c<>>32-b,c=h<>>=0)>(p>>>=0))return _.__absoluteGreater(r);if(a>>0,c=h,h=0):p=0;var w=t.__unsignedDigit(m);if(w>p)return _.__absoluteGreater(r);if(we&&t.__unsignedDigit(0)===o(e):0===_.__compareToDouble(t,e)}},{key:"__comparisonResultToBool",value:function(t,e){switch(e){case 0:return 0>t;case 1:return 0>=t;case 2:return 0e;case 3:return t>=e}if(_.__isBigInt(t)&&"string"==typeof e)return null!==(e=_.__fromString(e))&&_.__comparisonResultToBool(_.__compareToBigInt(t,e),r);if("string"==typeof t&&_.__isBigInt(e))return null!==(t=_.__fromString(t))&&_.__comparisonResultToBool(_.__compareToBigInt(t,e),r);if(t=_.__toNumeric(t),e=_.__toNumeric(e),_.__isBigInt(t)){if(_.__isBigInt(e))return _.__comparisonResultToBool(_.__compareToBigInt(t,e),r);if("number"!=typeof e)throw new Error("implementation bug");return _.__comparisonResultToBool(_.__compareToNumber(t,e),r)}if("number"!=typeof t)throw new Error("implementation bug");if(_.__isBigInt(e))return _.__comparisonResultToBool(_.__compareToNumber(e,t),2^r);if("number"!=typeof e)throw new Error("implementation bug");return 0===r?te:3===r?t>=e:void 0}},{key:"__absoluteAdd",value:function(t,e,r){if(t.length>>16)+(u>>>16)+(l>>>16);o=f>>>16,i.__setDigit(a,65535&l|f<<16)}for(;a>>16)+(h>>>16);o=g>>>16,i.__setDigit(a,65535&h|g<<16)}return a>>16)-(u>>>16)-(i=1&s>>>16);i=1&l>>>16,n.__setDigit(o,65535&s|l<<16)}for(;o>>16)-(i=1&c>>>16);i=1&h>>>16,n.__setDigit(o,65535&c|h<<16)}return n.__trim()}},{key:"__absoluteAddOne",value:function(t,e){var r=2n?0:t.__unsignedDigit(n)>e.__unsignedDigit(n)?1:-1}},{key:"__multiplyAccumulate",value:function(t,e,r,n){if(0!==e){for(var i=65535&e,o=e>>>16,a=0,s=0,_=0,l=0;l>>16,g=t.__digit(l),d=65535&g,p=g>>>16,v=u(d,i),y=u(d,o),b=u(p,i),m=u(p,o);a=(s=(y>>>16)+(b>>>16)+(65535&m)+(a=(h+=_+a+((c+=s+(65535&v))>>>16)+(v>>>16)+(65535&y)+(65535&b))>>>16))>>>16,s&=65535,_=m>>>16,f=65535&c|h<<16,r.__setDigit(n,f)}for(;0!==a||0!==s||0!==_;n++){var w=r.__digit(n),k=(65535&w)+s,D=(w>>>16)+(k>>>16)+_+a;s=0,_=0,a=D>>>16,w=65535&k|D<<16,r.__setDigit(n,w)}}}},{key:"__internalMultiplyAdd",value:function(t,e,r,n,i){for(var o=r,a=0,s=0;s>>16;var c=u(_>>>16,e),h=(65535&c)+(l>>>16)+o;o=h>>>16,a=c>>>16,i.__setDigit(s,h<<16|65535&f)}if(i.length>n)for(i.__setDigit(n++,o+a);n>>0,a=0|o/e,u=0|(o=((n=0|o%e)<<16|t.__halfDigit(i-1))>>>0)/e;n=0|o%e,r.__setDigit(i>>>1,a<<16|u)}return r}},{key:"__absoluteModSmall",value:function(t,e){for(var r=0,n=2*t.length-1;0<=n;n--)r=0|((r<<16|t.__halfDigit(n))>>>0)%e;return r}},{key:"__absoluteDivLarge",value:function(t,e,r,n){var i=e.__halfDigitLength(),o=e.length,a=t.__halfDigitLength()-i,s=null;r&&(s=new _(a+2>>>1,!1)).__initializeDigits();var l=new _(i+2>>>1,!1);l.__initializeDigits();var f=_.__clz16(e.__halfDigit(i-1));0>>0;p=0|y/h;for(var b=0|y%h,m=e.__halfDigit(i-2),w=c.__halfDigit(d+i-2);u(p,m)>>>0>(b<<16|w)>>>0&&(p--,!(65535<(b+=h))););}_.__internalMultiplyAdd(e,p,0,o,l);var k=c.__inplaceSub(l,d,i+1);0!==k&&(k=c.__inplaceAdd(e,d,i),c.__setHalfDigit(d+i,c.__halfDigit(d+i)+k),p--),r&&(1&d?g=p<<16:s.__setDigit(d>>>1,g|p))}return n?(c.__inplaceRightShift(f),r?{quotient:s,remainder:c}:c):r?s:void 0}},{key:"__clz16",value:function(t){return s(t)-16}},{key:"__specialLeftShift",value:function(t,e,r){var n=t.length,i=new _(n+r,!1);if(0===e){for(var o=0;o>>32-e;return 0r)throw new RangeError("BigInt too big");var n=r>>>5,i=31&r,o=t.length,a=0!==i&&0!=t.__digit(o-1)>>>32-i,u=o+n+(a?1:0),s=new _(u,t.sign);if(0===i){for(var l=0;l>>32-i;if(a)s.__setDigit(o+n,f);else if(0!==f)throw new Error("implementation bug")}return s.__trim()}},{key:"__rightShiftByAbsolute",value:function(t,e){var r=t.length,n=t.sign,i=_.__toShiftAmount(e);if(0>i)return _.__rightShiftByMaximum(n);var o=i>>>5,a=31&i,u=r-o;if(0>=u)return _.__rightShiftByMaximum(n);var s=!1;if(n)if(0!=(t.__digit(o)&(1<>>a,d=r-o-1,p=0;p>>a;f.__setDigit(d,g)}return s&&(f=_.__absoluteAddOne(f,!0,f)),f.__trim()}},{key:"__rightShiftByMaximum",value:function(t){return t?_.__oneDigit(1,!0):_.__zero()}},{key:"__toShiftAmount",value:function(t){if(1_.__kMaxLengthBits?-1:e}},{key:"__toPrimitive",value:function(e){var r=1>>5,n=new _(r,e.sign),i=r-1,o=0;o>>u}return n.__setDigit(i,a),n.__trim()}},{key:"__truncateAndSubFromPowerOfTwo",value:function(t,e,r){for(var n=Math.min,i=t+31>>>5,o=new _(i,r),a=0,u=i-1,s=0,l=n(u,e.length);a>>16)-(s=1&c>>>16);s=1&h>>>16,o.__setDigit(a,65535&c|h<<16)}for(;a>>16)-(s=1&v>>>16)<<16}else{var y=32-p,b=1<<32-y,m=(65535&b)-(65535&(d=d<>>y))-s;g=65535&m|(b>>>16)-(d>>>16)-(s=1&m>>>16)<<16,g&=b-1}return o.__setDigit(u,g),o.__trim()}},{key:"__digitPow",value:function(t,e){for(var r=1;0>>=1,t*=t;return r}}]),_}(l(Array));return v.__kMaxLength=33554432,v.__kMaxLengthBits=v.__kMaxLength<<5,v.__kMaxBitsPerChar=[0,0,32,51,64,75,83,90,96,102,107,111,115,119,122,126,128,131,134,136,139,141,143,145,147,149,151,153,154,156,158,159,160,162,163,165,166],v.__kBitsPerCharTableShift=5,v.__kBitsPerCharTableMultiplier=1<a)throw new Error(u);let s=i.filter((t=>!r.includes(t)));if(i.length-s.length!==o)throw new Error(u);if(s.find((t=>!n.includes(t))))throw new Error(u)}function u(t,e){if(!/^0x([0-9a-fA-F][0-9a-fA-F])*$/.test(e))throw new Error(`${t} must be a hex string!`)}function s(t,e){if(u(t,e),66!=e.length)throw new Error(`${t} must be a hex string of 66 bytes long!`)}function _(t,e){if("0x0"!==e&&!/^0x[1-9a-fA-F][0-9a-fA-F]*$/.test(e))throw new Error(`${t} must be a hex integer!`)}function l(t,{nestedValidation:e=!0,debugPath:r="script"}={}){if(a(r,t,["code_hash","hash_type","args"],[]),s(`${r}.code_hash`,t.code_hash),u(`${r}.args`,t.args),"data"!==t.hash_type&&"type"!==t.hash_type)throw new Error(`${r}.hash_type must be either data or type!`)}function f(t,{nestedValidation:e=!0,debugPath:r="out_point"}={}){a(r,t,["tx_hash","index"],[]),s(`${r}.tx_hash`,t.tx_hash),_(`${r}.index`,t.index)}function c(t,{nestedValidation:e=!0,debugPath:r="cell_input"}={}){a(r,t,["since","previous_output"],[]),_(`${r}.since`,t.since),e&&f(t.previous_output,{debugPath:`${r}.previous_output`})}function h(t,{nestedValidation:e=!0,debugPath:r="cell_output"}={}){a(r,t,["capacity","lock"],["type"]),_(`${r}.capacity`,t.capacity),e&&(l(t.lock,{debugPath:`${r}.lock`}),t.type&&l(t.type,{debugPath:`${r}.type`}))}function g(t,{nestedValidation:e=!0,debugPath:r="cell_dep"}={}){if(a(r,t,["out_point","dep_type"],[]),"code"!==t.dep_type&&"dep_group"!==t.dep_type)throw new Error(`${r}.dep_type must be either code or dep_group!`);e&&f(t.out_point,{debugPath:`${r}.out_point`})}function d(t,e,r,n){if(!Array.isArray(e))throw new Error(`${t} is not an array!`);if(n)for(let n=0;n=r.outputs.length)throw new Error(`Transaction ${t.tx_hash} does not have output ${n}!`);const i={output:r.outputs[n],data:r.outputs_data[n]};return"committed"===e.tx_status.status&&(i.header=e.tx_status.block_hash),i}}var S=i((function(t,e){var r=function(t){function e(){this.fetch=!1,this.DOMException=t.DOMException}return e.prototype=t,new e}("undefined"!=typeof self?self:n);!function(t){!function(e){var r="URLSearchParams"in t,n="Symbol"in t&&"iterator"in Symbol,i="FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),o="FormData"in t,a="ArrayBuffer"in t;if(a)var u=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],s=ArrayBuffer.isView||function(t){return t&&u.indexOf(Object.prototype.toString.call(t))>-1};function _(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function l(t){return"string"!=typeof t&&(t=String(t)),t}function f(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return n&&(e[Symbol.iterator]=function(){return e}),e}function c(t){this.map={},t instanceof c?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function h(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function g(t){return new Promise((function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}}))}function d(t){var e=new FileReader,r=g(e);return e.readAsArrayBuffer(t),r}function p(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function v(){return this.bodyUsed=!1,this._initBody=function(t){var e;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:i&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:o&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:r&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():a&&i&&((e=t)&&DataView.prototype.isPrototypeOf(e))?(this._bodyArrayBuffer=p(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a&&(ArrayBuffer.prototype.isPrototypeOf(t)||s(t))?this._bodyArrayBuffer=p(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var t=h(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?h(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(d)}),this.text=function(){var t,e,r,n=h(this);if(n)return n;if(this._bodyBlob)return t=this._bodyBlob,e=new FileReader,r=g(e),e.readAsText(t),r;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=new Array(e.length),n=0;n-1?n:r),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function m(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var r=t.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(n),decodeURIComponent(i))}})),e}function w(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new c(e.headers),this.url=e.url||"",this._initBody(t)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},v.call(b.prototype),v.call(w.prototype),w.prototype.clone=function(){return new w(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new c(this.headers),url:this.url})},w.error=function(){var t=new w(null,{status:0,statusText:""});return t.type="error",t};var k=[301,302,303,307,308];w.redirect=function(t,e){if(-1===k.indexOf(e))throw new RangeError("Invalid status code");return new w(null,{status:e,headers:{location:t}})},e.DOMException=t.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(t,e){this.message=t,this.name=e;var r=Error(t);this.stack=r.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function D(t,r){return new Promise((function(n,o){var a=new b(t,r);if(a.signal&&a.signal.aborted)return o(new e.DOMException("Aborted","AbortError"));var u=new XMLHttpRequest;function s(){u.abort()}u.onload=function(){var t,e,r={status:u.status,statusText:u.statusText,headers:(t=u.getAllResponseHeaders()||"",e=new c,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var r=t.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();e.append(n,i)}})),e)};r.url="responseURL"in u?u.responseURL:r.headers.get("X-Request-URL");var i="response"in u?u.response:u.responseText;n(new w(i,r))},u.onerror=function(){o(new TypeError("Network request failed"))},u.ontimeout=function(){o(new TypeError("Network request failed"))},u.onabort=function(){o(new e.DOMException("Aborted","AbortError"))},u.open(a.method,a.url,!0),"include"===a.credentials?u.withCredentials=!0:"omit"===a.credentials&&(u.withCredentials=!1),"responseType"in u&&i&&(u.responseType="blob"),a.headers.forEach((function(t,e){u.setRequestHeader(e,t)})),a.signal&&(a.signal.addEventListener("abort",s),u.onreadystatechange=function(){4===u.readyState&&a.signal.removeEventListener("abort",s)}),u.send(void 0===a._bodyInit?null:a._bodyInit)}))}D.polyfill=!0,t.fetch||(t.fetch=D,t.Headers=c,t.Request=b,t.Response=w),e.Headers=c,e.Request=b,e.Response=w,e.fetch=D}({})}(r),delete r.fetch.polyfill,(e=r.fetch).default=r.fetch,e.fetch=r.fetch,e.Headers=r.Headers,e.Request=r.Request,e.Response=r.Response,t.exports=e}));function O(t,e){e=e||{};const r=Object.assign({},e.headers||{},t.headers||{});return Object.assign({},e,t,{headers:r})}const x={get:(t,e,r)=>"send"===e?async()=>{const e=await S(t.uri,O({method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify(t.payload)},t.defaultOptions));return await e.json()}:(...n)=>{const i=t.id;return t.id=t.id+1,t.payload.push({jsonrpc:"2.0",id:i,method:e,params:n}),r}},$={get:(t,e)=>"batch"===e?()=>new Proxy({id:Math.round(1e7*Math.random()),payload:[],uri:t.uri,defaultOptions:t.defaultOptions},x):async(...r)=>{const n=Math.round(1e7*Math.random()),i=await S(t.uri,O({method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:n,method:e,params:r})},t.defaultOptions)),o=await i.json();if(o.id!==n)throw new Error("JSONRPCError: response ID does not match request ID!");if(o.error)throw new Error(`JSONRPCError: server error ${JSON.stringify(o.error)}`);return o.result}};class C{constructor(t,e={}){return this.uri=t,this.defaultOptions=e,new Proxy(this,$)}static create(t){return new C(t)}}function I(t){return o.BigInt(t)}function j(t){return"0x"+t.toString(16)}function R(t){return function(e,r){if(!(r instanceof ArrayBuffer)){let n=j(o.BigInt(r)).substr(2);if(n.length%2!=0&&(n="0"+n),n.length/2>t)throw new Error(`${e} is ${n.length/2} bytes long, expected length is ${t}!`);const i=new DataView(new ArrayBuffer(t));for(let t=0;t0&&n.byteLength!==t)throw new Error(`${e} has invalid length ${n.byteLength}, required: ${t}`);return n}}function M(t,e,r){const n={};for(const[i,o]of Object.entries(r)){const r=e[i];if(!r)throw new Error(`${t} is missing ${i}!`);n[i]=o(`${t}.${i}`,r)}return n}function N(t,{debugPath:e="script"}={}){return M(e,t,{code_hash:z(32),hash_type:function(t,e){switch(e){case"data":return 0;case"type":return 1;case 0:case 1:return e;default:throw new Error(`${t}.hash_type has invalid value: ${e}`)}},args:z(-1)})}function L(t,{debugPath:e="out_point"}={}){return M(e,t,{tx_hash:z(32),index:R(4)})}function U(t){return function(e,r){return t(r,{debugPath:e})}}function q(t,{debugPath:e="cell_input"}={}){return M(e,t,{since:R(8),previous_output:U(L)})}function V(t,{debugPath:e="cell_output"}={}){const r=M(e,t,{capacity:R(8),lock:U(N)});return t.type&&(r.type_=N(t.type,{debugPath:`${e}.type`})),r}function F(t,{debugPath:e="cell_dep"}={}){return M(e,t,{out_point:U(L),dep_type:function(t,e){switch(e){case"code":return 0;case"dep_group":return 1;case 0:case 1:return e;default:throw new Error(`${t}.dep_type has invalid value: ${e}`)}}})}function G(t){return function(e,r){return r.map(((r,n)=>t(`${e}[${n}]`,r)))}}function H(t,{debugPath:e="raw_transaction"}={}){return M(e,t,{version:R(4),cell_deps:G(U(F)),header_deps:G(z(32)),inputs:G(U(q)),outputs:G(U(V)),outputs_data:G(z(-1))})}function W(t,{debugPath:e="transaction"}={}){const r=H(t,{debugPath:`(raw)${e}`}),n=M(e,t,{witnesses:G(z(-1))});return n.raw=r,n}function J(t,{debugPath:e="raw_header"}={}){return M(e,t,{version:R(4),compact_target:R(4),timestamp:R(8),number:R(8),epoch:R(8),parent_hash:z(32),transactions_root:z(32),proposals_hash:z(32),uncles_hash:z(32),dao:z(32)})}function X(t,{debugPath:e="header"}={}){const r=J(t,{debugPath:`(raw)${e}`}),n=M(e,t,{nonce:R(16)});return n.raw=r,n}function Q(t,{debugPath:e="uncle_block"}={}){return M(e,t,{header:U(X),proposals:G(z(10))})}var K=Object.freeze({__proto__:null,NormalizeScript:N,NormalizeOutPoint:L,NormalizeCellInput:q,NormalizeCellOutput:V,NormalizeCellDep:F,NormalizeRawTransaction:H,NormalizeTransaction:W,NormalizeRawHeader:J,NormalizeHeader:X,NormalizeUncleBlock:Q,NormalizeBlock:function(t,{debugPath:e="block"}={}){return M(e,t,{header:U(X),uncles:G(U(Q)),transactions:G(U(W)),proposals:G(z(10))})},NormalizeCellbaseWitness:function(t,{debugPath:e="cellbase_witness"}={}){return M(e,t,{lock:U(N),message:z(-1)})},NormalizeWitnessArgs:function(t,{debugPath:e="witness_args"}={}){const r={};return t.lock&&(r.lock=z(-1)(`${e}.lock`,t.lock)),t.input_type&&(r.input_type=z(-1)(`${e}.input_type`,t.input_type)),t.output_type&&(r.output_type=z(-1)(`${e}.output_type`,t.output_type)),r}});function Y(t,e){return e instanceof Object&&e.serializeJson instanceof Function?e.serializeJson.call(e):e}function Z(t,e,r){if(!((e=Y(0,e))instanceof Object))throw new Error(`Transformed ${t} is not an object!`);const n={};for(const[i,o]of Object.entries(r)){let r=e[i];if(!r){r=e[i.replace(/(_[a-z])/g,(t=>t.toUpperCase().replace("_","")))]}r&&(n[i]=o(`${t}.${i}`,r))}return n}function tt(t,{validation:e=!0,debugPath:r="script"}={}){return t=Z(r,t,{code_hash:Y,hash_type:Y,args:Y}),e&&l(t,{debugPath:`(transformed) ${r}`}),t}function et(t,{validation:e=!0,debugPath:r="out_point"}={}){return t=Z(r,t,{tx_hash:Y,index:Y}),e&&f(t,{debugPath:`(transformed) ${r}`}),t}function rt(t){return function(e,r){return t(r,{validation:!1,debugPath:e})}}function nt(t,{validation:e=!0,debugPath:r="cell_input"}={}){return t=Z(r,t,{since:Y,previous_output:rt(et)}),e&&c(t,{debugPath:`(transformed) ${r}`}),t}function it(t,{validation:e=!0,debugPath:r="cell_output"}={}){return t=Z(r,t,{capacity:Y,lock:rt(tt),type:rt(tt)}),e&&h(t,{debugPath:`(transformed) ${r}`}),t}function ot(t,{validation:e=!0,debugPath:r="cell_dep"}={}){return t=Z(r,t,{out_point:rt(et),dep_type:Y}),e&&g(t,{debugPath:`(transformed) ${r}`}),t}function at(t){return function(e,r){return r.map(((r,n)=>t(`${e}[${n}]`,r)))}}function ut(t,{validation:e=!0,debugPath:r="transaction"}={}){return t=Z(r,t,{version:Y,cell_deps:at(rt(ot)),header_deps:at(Y),inputs:at(rt(nt)),outputs:at(rt(it)),outputs_data:at(Y),witnesses:at(Y)}),e&&b(t,{debugPath:`(transformed) ${r}`}),t}function st(t,{validation:e=!0,debugPath:r="header"}={}){return t=Z(r,t,{version:Y,compact_target:Y,timestamp:Y,number:Y,epoch:Y,parent_hash:Y,transactions_root:Y,proposals_hash:Y,uncles_hash:Y,dao:Y,nonce:Y}),e&&w(t,{debugPath:`(transformed) ${r}`}),t}function _t(t,{validation:e=!0,debugPath:r="uncle_block"}={}){return t=Z(r,t,{header:rt(st),proposals:at(Y)}),e&&D(t,{debugPath:`(transformed) ${r}`}),t}var lt=Object.freeze({__proto__:null,TransformScript:tt,TransformOutPoint:et,TransformCellInput:nt,TransformCellOutput:it,TransformCellDep:ot,TransformRawTransaction:function(t,{validation:e=!0,debugPath:r="raw_transaction"}={}){return t=Z(r,t,{version:Y,cell_deps:at(rt(ot)),header_deps:at(Y),inputs:at(rt(nt)),outputs:at(rt(it)),outputs_data:at(Y)}),e&&y(t,{debugPath:`(transformed) ${r}`}),t},TransformTransaction:ut,TransformRawHeader:function(t,{validation:e=!0,debugPath:r="raw_header"}={}){return t=Z(r,t,{version:Y,compact_target:Y,timestamp:Y,number:Y,epoch:Y,parent_hash:Y,transactions_root:Y,proposals_hash:Y,uncles_hash:Y,dao:Y}),e&&m(t,{debugPath:`(transformed) ${r}`}),t},TransformHeader:st,TransformUncleBlock:_t,TransformBlock:function(t,{validation:e=!0,debugPath:r="block"}={}){return t=Z(r,t,{header:rt(st),uncles:at(rt(_t)),transactions:at(rt(ut)),proposals:at(Y)}),e&&B(t,{debugPath:`(transformed) ${r}`}),t},TransformCellbaseWitness:function(t,{validation:e=!0,debugPath:r="cellbase_witness"}={}){return t=Z(r,t,{lock:rt(tt),message:Y}),e&&P(t,{debugPath:`(transformed) ${r}`}),t},TransformWitnessArgs:function(t,{validation:e=!0,debugPath:r="witness_args"}={}){return t=Z(r,t,{lock:Y,input_type:Y,output_type:Y}),e&&A(t,{debugPath:`(transformed) ${r}`}),t}});var ft=Object.freeze({__proto__:null,RPCCollector:class{constructor(t,e,{skipCellWithContent:n=!0,loadData:i=!1,loadBlockNumber:o=!0}={}){this.rpc=t,this.lockHash=new r(e).serializeJson(),this.skipCellWithContent=n,this.loadData=i,this.loadBlockNumber=o}async*collect(){const t=I(await this.rpc.get_tip_block_number());let e=o.BigInt(0);for(;o.lessThanOrEqual(e,t);){let r=o.add(e,o.BigInt(100));o.greaterThan(r,t)&&(r=t);const n=await this.rpc.get_cells_by_lock_hash(this.lockHash,j(e),j(r));for(const t of n){if(this.skipCellWithContent&&(t.type||o.greaterThan(I(t.output_data_len),o.BigInt(100))))continue;let e=null;if(this.loadData){e=(await this.rpc.get_live_cell(t.out_point,!0)).cell.data.content}let r=null;if(this.loadBlockNumber){r=(await this.rpc.get_header(t.block_hash)).number}yield{cellbase:t.cellbase,cell_output:{capacity:t.capacity,lock:t.lock,type:t.type},out_point:t.out_point,block_hash:t.block_hash,data:e,output_data_len:t.output_data_len,block_number:r}}e=o.add(r,o.BigInt(1))}}}});const ct="0.10.2";export{j as BigIntToHexString,I as HexStringToBigInt,C as RPC,r as Reader,E as TransactionDumper,ct as VERSION,ft as cell_collectors,K as normalizers,lt as transformers,T as validators}; diff --git a/packages/core/lib/ckb-js-toolkit.node.js b/packages/core/lib/ckb-js-toolkit.node.js deleted file mode 100644 index 19618e699..000000000 --- a/packages/core/lib/ckb-js-toolkit.node.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("stream"),e=require("http"),r=require("url"),n=require("https"),i=require("zlib");function o(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var s=o(t),a=o(e),u=o(r),l=o(n),c=o(i);class _{constructor(t){this.view=new DataView(t)}length(){return this.view.byteLength}indexAt(t){return this.view.getUint8(t)}toArrayBuffer(){return this.view.buffer}serializeJson(){return"0x"+Array.prototype.map.call(new Uint8Array(this.view.buffer),(t=>("00"+t.toString(16)).slice(-2))).join("")}}class f{constructor(t){this.string=t}length(){return this.string.length/2-1}indexAt(t){return parseInt(this.string.substr(2+2*t,2),16)}toArrayBuffer(){const t=new ArrayBuffer(this.length()),e=new DataView(t);for(let t=0;t255)throw new Error("fromRawString can only accept UTF-8 raw string!");r.setUint8(e,n)}return new _(e)}}class g extends Array{constructor(t,e){if(t>g.__kMaxLength)throw new RangeError("Maximum BigInt size exceeded");super(t),this.sign=e}static BigInt(t){var e=Math.floor,r=Number.isFinite;if("number"==typeof t){if(0===t)return g.__zero();if((0|t)===t)return 0>t?g.__oneDigit(-t,!0):g.__oneDigit(t,!1);if(!r(t)||e(t)!==t)throw new RangeError("The number "+t+" cannot be converted to BigInt because it is not an integer");return g.__fromDouble(t)}if("string"==typeof t){const e=g.__fromString(t);if(null===e)throw new SyntaxError("Cannot convert "+t+" to a BigInt");return e}if("boolean"==typeof t)return!0===t?g.__oneDigit(1,!1):g.__zero();if("object"==typeof t){if(t.constructor===g)return t;const e=g.__toPrimitive(t);return g.BigInt(e)}throw new TypeError("Cannot convert "+t+" to a BigInt")}toDebugString(){const t=["BigInt["];for(const e of this)t.push((e?(e>>>0).toString(16):e)+", ");return t.push("]"),t.join("")}toString(t=10){if(2>t||36>>=12;const _=l-12;let f=12<=l?0:a<<20+l,h=20+l;0<_&&0>>32-_,f=a<<_,h=_),0>>32-h,h-=32);const d=g.__decideRounding(t,h,u,a);if((1===d||0===d&&1==(1&f))&&(f=f+1>>>0,0===f&&(c++,0!=c>>>20&&(c=0,s++,1023=g.__kMaxLengthBits)throw new RangeError("BigInt too big");if(1===t.length&&2===t.__digit(0)){const e=1+(r>>>5),n=t.sign&&0!=(1&r),i=new g(e,n);i.__initializeDigits();const o=1<<(31&r);return i.__setDigit(e-1,o),i}let n=null,i=t;for(0!=(1&r)&&(n=t),r>>=1;0!==r;r>>=1)i=g.multiply(i,i),0!=(1&r)&&(n=null===n?i:g.multiply(n,i));return n}static multiply(t,e){if(0===t.length)return t;if(0===e.length)return e;let r=t.length+e.length;32<=t.__clzmsd()+e.__clzmsd()&&r--;const n=new g(r,t.sign!==e.sign);n.__initializeDigits();for(let r=0;rg.__absoluteCompare(t,e))return g.__zero();const r=t.sign!==e.sign,n=e.__unsignedDigit(0);let i;if(1===e.length&&65535>=n){if(1===n)return r===t.sign?t:g.unaryMinus(t);i=g.__absoluteDivSmall(t,n,null)}else i=g.__absoluteDivLarge(t,e,!0,!1);return i.sign=r,i.__trim()}static remainder(t,e){if(0===e.length)throw new RangeError("Division by zero");if(0>g.__absoluteCompare(t,e))return t;const r=e.__unsignedDigit(0);if(1===e.length&&65535>=r){if(1===r)return g.__zero();const e=g.__absoluteModSmall(t,r);return 0===e?g.__zero():g.__oneDigit(e,t.sign)}const n=g.__absoluteDivLarge(t,e,!1,!0);return n.sign=t.sign,n.__trim()}static add(t,e){const r=t.sign;return r===e.sign?g.__absoluteAdd(t,e,r):0<=g.__absoluteCompare(t,e)?g.__absoluteSub(t,e,r):g.__absoluteSub(e,t,!r)}static subtract(t,e){const r=t.sign;return r===e.sign?0<=g.__absoluteCompare(t,e)?g.__absoluteSub(t,e,r):g.__absoluteSub(e,t,!r):g.__absoluteAdd(t,e,r)}static leftShift(t,e){return 0===e.length||0===t.length?t:e.sign?g.__rightShiftByAbsolute(t,e):g.__leftShiftByAbsolute(t,e)}static signedRightShift(t,e){return 0===e.length||0===t.length?t:e.sign?g.__leftShiftByAbsolute(t,e):g.__rightShiftByAbsolute(t,e)}static unsignedRightShift(){throw new TypeError("BigInts have no unsigned right shift; use >> instead")}static lessThan(t,e){return 0>g.__compareToBigInt(t,e)}static lessThanOrEqual(t,e){return 0>=g.__compareToBigInt(t,e)}static greaterThan(t,e){return 0=g.__kMaxLengthBits)return e;const r=t+31>>>5;if(e.lengthg.__kMaxLengthBits)throw new RangeError("BigInt too big");return g.__truncateAndSubFromPowerOfTwo(t,e,!1)}if(t>=g.__kMaxLengthBits)return e;const r=t+31>>>5;if(e.length>>n)return e}return g.__truncateToNBits(t,e)}static ADD(t,e){if(t=g.__toPrimitive(t),e=g.__toPrimitive(e),"string"==typeof t)return"string"!=typeof e&&(e=e.toString()),t+e;if("string"==typeof e)return t.toString()+e;if(t=g.__toNumeric(t),e=g.__toNumeric(e),g.__isBigInt(t)&&g.__isBigInt(e))return g.add(t,e);if("number"==typeof t&&"number"==typeof e)return t+e;throw new TypeError("Cannot mix BigInt and other types, use explicit conversions")}static LT(t,e){return g.__compare(t,e,0)}static LE(t,e){return g.__compare(t,e,1)}static GT(t,e){return g.__compare(t,e,2)}static GE(t,e){return g.__compare(t,e,3)}static EQ(t,e){for(;;){if(g.__isBigInt(t))return g.__isBigInt(e)?g.equal(t,e):g.EQ(e,t);if("number"==typeof t){if(g.__isBigInt(e))return g.__equalToNumber(e,t);if("object"!=typeof e)return t==e;e=g.__toPrimitive(e)}else if("string"==typeof t){if(g.__isBigInt(e))return null!==(t=g.__fromString(t))&&g.equal(t,e);if("object"!=typeof e)return t==e;e=g.__toPrimitive(e)}else if("boolean"==typeof t){if(g.__isBigInt(e))return g.__equalToNumber(e,+t);if("object"!=typeof e)return t==e;e=g.__toPrimitive(e)}else if("symbol"==typeof t){if(g.__isBigInt(e))return!1;if("object"!=typeof e)return t==e;e=g.__toPrimitive(e)}else{if("object"!=typeof t)return t==e;if("object"==typeof e&&e.constructor!==g)return t==e;t=g.__toPrimitive(t)}}}static NE(t,e){return!g.EQ(t,e)}static __zero(){return new g(0,!1)}static __oneDigit(t,e){const r=new g(1,e);return r.__setDigit(0,t),r}__copy(){const t=new g(this.length,this.sign);for(let e=0;ee)i=-e-1;else{if(0===r)return-1;r--,n=t.__digit(r),i=31}let o=1<>>20)-1023,r=1+(e>>>5),n=new g(r,0>t);let i=1048575&g.__kBitConversionInts[1]|1048576,o=g.__kBitConversionInts[0];const s=31&e;let a,u=0;if(s<20){const t=20-s;u=t+32,a=i>>>t,i=i<<32-t|o>>>t,o<<=32-t}else if(20===s)u=32,a=i,i=o;else{const t=s-20;u=32-t,a=i<>>32-t,i=o<=t&&9<=t)||(159>=t?32==t:131071>=t?160==t||5760==t:196607>=t?10>=(t&=131071)||40==t||41==t||47==t||95==t||4096==t:65279==t)}static __fromString(t,e=0){let r=0;const n=t.length;let i=0;if(i===n)return g.__zero();let o=t.charCodeAt(i);for(;g.__isWhitespace(o);){if(++i===n)return g.__zero();o=t.charCodeAt(i)}if(43===o){if(++i===n)return null;o=t.charCodeAt(i),r=1}else if(45===o){if(++i===n)return null;o=t.charCodeAt(i),r=-1}if(0===e){if(e=10,48===o){if(++i===n)return g.__zero();if(o=t.charCodeAt(i),88===o||120===o){if(e=16,++i===n)return null;o=t.charCodeAt(i)}else if(79===o||111===o){if(e=8,++i===n)return null;o=t.charCodeAt(i)}else if(66===o||98===o){if(e=2,++i===n)return null;o=t.charCodeAt(i)}}}else if(16===e&&48===o){if(++i===n)return g.__zero();if(o=t.charCodeAt(i),88===o||120===o){if(++i===n)return null;o=t.charCodeAt(i)}}for(;48===o;){if(++i===n)return g.__zero();o=t.charCodeAt(i)}const s=n-i;let a=g.__kMaxBitsPerChar[e],u=g.__kBitsPerCharTableMultiplier-1;if(s>1073741824/a)return null;const l=a*s+u>>>g.__kBitsPerCharTableShift,c=new g(l+31>>>5,!1),_=10>e?e:10,f=10>=g.__kBitsPerCharTableShift;const e=[],r=[];let s=!1;do{let u=0,l=0;for(;;){let e;if(o-48>>>0<_)e=o-48;else{if(!((32|o)-97>>>0>>0<_)a=o-48;else{if(!((32|o)-97>>>0>>g.__kBitsPerCharTableShift+5;c.__inplaceMultiplyAdd(h,l,d)}while(!r)}if(i!==n){if(!g.__isWhitespace(o))return null;for(i++;i>>u-o)}if(0!==i){if(n>=t.length)throw new Error("implementation bug");t.__setDigit(n++,i)}for(;n>>1)+(85&i),i=(51&i>>>2)+(51&i),i=(15&i>>>4)+(15&i);const o=i,s=e-1,a=t.__digit(n-1);let u=0|(32*n-r(a)+o-1)/o;if(t.sign&&u++,268435456>>i,f=32-i;f>=o;)l[c--]=g.__kConversionChars[_&s],_>>>=o,f-=o}const h=(_|a<>>o-f;0!==_;)l[c--]=g.__kConversionChars[_&s],_>>>=o;if(t.sign&&(l[c--]="-"),-1!=c)throw new Error("implementation bug");return l.join("")}static __toStringGeneric(t,e,r){var n=Math.clz32;const i=t.length;if(0===i)return"";if(1===i){let n=t.__unsignedDigit(0).toString(e);return!1===r&&t.sign&&(n="-"+n),n}const o=32*i-n(t.__digit(i-1)),s=g.__kMaxBitsPerChar[e]-1;let a=o*g.__kBitsPerCharTableMultiplier;a+=s-1,a=0|a/s;const u=a+1>>1,l=g.exponentiate(g.__oneDigit(e,!1),g.__oneDigit(u,!1));let c,_;const f=l.__unsignedDigit(0);if(1===l.length&&65535>=f){c=new g(t.length,!1),c.__initializeDigits();let r=0;for(let e=2*t.length-1;0<=e;e--){const n=r<<16|t.__halfDigit(e);c.__setHalfDigit(e,0|n/f),r=0|n%f}_=r.toString(e)}else{const r=g.__absoluteDivLarge(t,l,!0,!0);c=r.quotient;const n=r.remainder.__trim();_=g.__toStringGeneric(n,e,!0)}c.__trim();let h=g.__toStringGeneric(c,e,!0);for(;_.lengthn?g.__absoluteLess(r):0}static __compareToNumber(t,e){if(!0|e){const r=t.sign,n=0>e;if(r!==n)return g.__unequalSign(r);if(0===t.length){if(n)throw new Error("implementation bug");return 0===e?0:-1}if(1i?g.__absoluteGreater(r):oe)return g.__unequalSign(n);if(0===e)throw new Error("implementation bug: should be handled elsewhere");if(0===t.length)return-1;g.__kBitConversionDouble[0]=e;const i=2047&g.__kBitConversionInts[1]>>>20;if(2047==i)throw new Error("implementation bug: handled elsewhere");const o=i-1023;if(0>o)return g.__absoluteGreater(n);const s=t.length;let a=t.__digit(s-1);const u=r(a),l=32*s-u,c=o+1;if(lc)return g.__absoluteGreater(n);let _=1048576|1048575&g.__kBitConversionInts[1],f=g.__kBitConversionInts[0];const h=31-u;if(h!==(l-1)%31)throw new Error("implementation bug");let d,p=0;if(20>h){const t=20-h;p=t+32,d=_>>>t,_=_<<32-t|f>>>t,f<<=32-t}else if(20===h)p=32,d=_,_=f;else{const t=h-20;p=32-t,d=_<>>32-t,_=f<>>=0,d>>>=0,a>d)return g.__absoluteGreater(n);if(a>>0,_=f,f=0):d=0;const r=t.__unsignedDigit(e);if(r>d)return g.__absoluteGreater(n);if(re&&t.__unsignedDigit(0)===r(e):0===g.__compareToDouble(t,e)}static __comparisonResultToBool(t,e){switch(e){case 0:return 0>t;case 1:return 0>=t;case 2:return 0e;case 3:return t>=e}if(g.__isBigInt(t)&&"string"==typeof e)return null!==(e=g.__fromString(e))&&g.__comparisonResultToBool(g.__compareToBigInt(t,e),r);if("string"==typeof t&&g.__isBigInt(e))return null!==(t=g.__fromString(t))&&g.__comparisonResultToBool(g.__compareToBigInt(t,e),r);if(t=g.__toNumeric(t),e=g.__toNumeric(e),g.__isBigInt(t)){if(g.__isBigInt(e))return g.__comparisonResultToBool(g.__compareToBigInt(t,e),r);if("number"!=typeof e)throw new Error("implementation bug");return g.__comparisonResultToBool(g.__compareToNumber(t,e),r)}if("number"!=typeof t)throw new Error("implementation bug");if(g.__isBigInt(e))return g.__comparisonResultToBool(g.__compareToNumber(e,t),2^r);if("number"!=typeof e)throw new Error("implementation bug");return 0===r?te:3===r?t>=e:void 0}__clzmsd(){return Math.clz32(this[this.length-1])}static __absoluteAdd(t,e,r){if(t.length>>16)+(r>>>16)+(a>>>16);o=u>>>16,i.__setDigit(s,65535&a|u<<16)}for(;s>>16)+(r>>>16);o=n>>>16,i.__setDigit(s,65535&r|n<<16)}return s>>16;const u=(r>>>16)-(s>>>16)-i;i=1&u>>>16,n.__setDigit(o,65535&a|u<<16)}for(;o>>16;const s=(e>>>16)-i;i=1&s>>>16,n.__setDigit(o,65535&r|s<<16)}return n.__trim()}static __absoluteAddOne(t,e,r=null){const n=t.length;null===r?r=new g(n,e):r.sign=e;let i=!0;for(let e,o=0;on?0:t.__unsignedDigit(n)>e.__unsignedDigit(n)?1:-1}static __multiplyAccumulate(t,e,r,n){var i=Math.imul;if(0===e)return;const o=65535&e,s=e>>>16;let a=0,u=0,l=0;for(let e=0;e>>16;const h=t.__digit(e),g=65535&h,d=h>>>16,p=i(g,o),b=i(g,s),m=i(d,o),y=i(d,s);_+=u+(65535&p),f+=l+a+(_>>>16)+(p>>>16)+(65535&b)+(65535&m),a=f>>>16,u=(b>>>16)+(m>>>16)+(65535&y)+a,a=u>>>16,u&=65535,l=y>>>16,c=65535&_|f<<16,r.__setDigit(n,c)}for(;0!=a||0!==u||0!==l;n++){let t=r.__digit(n);const e=(65535&t)+u,i=(t>>>16)+(e>>>16)+l+a;u=0,l=0,a=i>>>16,t=65535&e|i<<16,r.__setDigit(n,t)}}static __internalMultiplyAdd(t,e,r,n,i){var o=Math.imul;let s=r,a=0;for(let r=0;r>>16;const c=o(n>>>16,e),_=(65535&c)+(u>>>16)+s;s=_>>>16,a=c>>>16,i.__setDigit(r,_<<16|65535&l)}if(i.length>n)for(i.__setDigit(n++,s+a);nthis.length&&(r=this.length);const i=65535&t,o=t>>>16;let s=0,a=65535&e,u=e>>>16;for(let t=0;t>>16,c=n(r,i),_=n(r,o),f=n(l,i),h=n(l,o),g=a+(65535&c),d=u+s+(g>>>16)+(c>>>16)+(65535&_)+(65535&f);a=(_>>>16)+(f>>>16)+(65535&h)+(d>>>16),s=a>>>16,a&=65535,u=h>>>16,this.__setDigit(t,65535&g|d<<16)}if(0!=s||0!==a||0!==u)throw new Error("implementation bug")}static __absoluteDivSmall(t,e,r){null===r&&(r=new g(t.length,!1));let n=0;for(let i,o=2*t.length-1;0<=o;o-=2){i=(n<<16|t.__halfDigit(o))>>>0;const s=0|i/e;n=0|i%e,i=(n<<16|t.__halfDigit(o-1))>>>0;const a=0|i/e;n=0|i%e,r.__setDigit(o>>>1,s<<16|a)}return r}static __absoluteModSmall(t,e){let r=0;for(let n=2*t.length-1;0<=n;n--){r=0|((r<<16|t.__halfDigit(n))>>>0)%e}return r}static __absoluteDivLarge(t,e,r,n){var i=Math.imul;const o=e.__halfDigitLength(),s=e.length,a=t.__halfDigitLength()-o;let u=null;r&&(u=new g(a+2>>>1,!1),u.__initializeDigits());const l=new g(o+2>>>1,!1);l.__initializeDigits();const c=g.__clz16(e.__halfDigit(o-1));0>>0;t=0|r/f;let s=0|r%f;const u=e.__halfDigit(o-2),l=_.__halfDigit(n+o-2);for(;i(t,u)>>>0>(s<<16|l)>>>0&&(t--,s+=f,!(65535>>1,h|t))}return n?(_.__inplaceRightShift(c),r?{quotient:u,remainder:_}:_):r?u:void 0}static __clz16(t){return Math.clz32(t)-16}__inplaceAdd(t,e,r){let n=0;for(let i=0;i>>16,this.__setHalfDigit(e+i,r)}return n}__inplaceSub(t,e,r){let n=0;if(1&e){e>>=1;let i=this.__digit(e),o=65535&i,s=0;for(;s>>1;s++){const r=t.__digit(s),a=(i>>>16)-(65535&r)-n;n=1&a>>>16,this.__setDigit(e+s,a<<16|65535&o),i=this.__digit(e+s+1),o=(65535&i)-(r>>>16)-n,n=1&o>>>16}const a=t.__digit(s),u=(i>>>16)-(65535&a)-n;if(n=1&u>>>16,this.__setDigit(e+s,u<<16|65535&o),e+s+1>=this.length)throw new RangeError("out of bounds");0==(1&r)&&(i=this.__digit(e+s+1),o=(65535&i)-(a>>>16)-n,n=1&o>>>16,this.__setDigit(e+t.length,4294901760&i|65535&o))}else{e>>=1;let i=0;for(;i>>16;const a=(r>>>16)-(o>>>16)-n;n=1&a>>>16,this.__setDigit(e+i,a<<16|65535&s)}const o=this.__digit(e+i),s=t.__digit(i),a=(65535&o)-(65535&s)-n;n=1&a>>>16;let u=0;0==(1&r)&&(u=(o>>>16)-(s>>>16)-n,n=1&u>>>16),this.__setDigit(e+i,u<<16|65535&a)}return n}__inplaceRightShift(t){if(0===t)return;let e=this.__digit(0)>>>t;const r=this.length-1;for(let n=0;n>>t}this.__setDigit(r,e)}static __specialLeftShift(t,e,r){const n=t.length,i=new g(n+r,!1);if(0===e){for(let e=0;e>>32-e}return 0r)throw new RangeError("BigInt too big");const n=r>>>5,i=31&r,o=t.length,s=0!==i&&0!=t.__digit(o-1)>>>32-i,a=o+n+(s?1:0),u=new g(a,t.sign);if(0===i){let e=0;for(;e>>32-i}if(s)u.__setDigit(o+n,e);else if(0!==e)throw new Error("implementation bug")}return u.__trim()}static __rightShiftByAbsolute(t,e){const r=t.length,n=t.sign,i=g.__toShiftAmount(e);if(0>i)return g.__rightShiftByMaximum(n);const o=i>>>5,s=31&i;let a=r-o;if(0>=a)return g.__rightShiftByMaximum(n);let u=!1;if(n)if(0!=(t.__digit(o)&(1<>>s;const n=r-o-1;for(let r=0;r>>s}l.__setDigit(n,e)}return u&&(l=g.__absoluteAddOne(l,!0,l)),l.__trim()}static __rightShiftByMaximum(t){return t?g.__oneDigit(1,!0):g.__zero()}static __toShiftAmount(t){if(1g.__kMaxLengthBits?-1:e}static __toPrimitive(t,e="default"){if("object"!=typeof t)return t;if(t.constructor===g)return t;const r=t[Symbol.toPrimitive];if(r){const t=r(e);if("object"!=typeof t)return t;throw new TypeError("Cannot convert object to primitive value")}const n=t.valueOf;if(n){const e=n.call(t);if("object"!=typeof e)return e}const i=t.toString;if(i){const e=i.call(t);if("object"!=typeof e)return e}throw new TypeError("Cannot convert object to primitive value")}static __toNumeric(t){return g.__isBigInt(t)?t:+t}static __isBigInt(t){return"object"==typeof t&&t.constructor===g}static __truncateToNBits(t,e){const r=t+31>>>5,n=new g(r,e.sign),i=r-1;for(let t=0;t>>e}return n.__setDigit(i,o),n.__trim()}static __truncateAndSubFromPowerOfTwo(t,e,r){var n=Math.min;const i=t+31>>>5,o=new g(i,r);let s=0;const a=i-1;let u=0;for(const t=n(a,e.length);s>>16;const n=0-(t>>>16)-u;u=1&n>>>16,o.__setDigit(s,65535&r|n<<16)}for(;s>>16;_=65535&t|0-(l>>>16)-u<<16}else{const t=32-c;l=l<>>t;const e=1<<32-t,r=(65535&e)-(65535&l)-u;u=1&r>>>16;_=65535&r|(e>>>16)-(l>>>16)-u<<16,_&=e-1}return o.__setDigit(a,_),o.__trim()}__digit(t){return this[t]}__unsignedDigit(t){return this[t]>>>0}__setDigit(t,e){this[t]=0|e}__setDigitGrow(t,e){this[t]=0|e}__halfDigitLength(){const t=this.length;return 65535>=this.__unsignedDigit(t-1)?2*t-1:2*t}__halfDigit(t){return 65535&this[t>>>1]>>>((1&t)<<4)}__setHalfDigit(t,e){const r=t>>>1,n=this.__digit(r),i=1&t?65535&n|e<<16:4294901760&n|65535&e;this.__setDigit(r,i)}static __digitPow(t,e){let r=1;for(;0>>=1,t*=t;return r}}function d(t,e,r,n=[]){!function(t,e){if(!(e instanceof Object))throw new Error(`${t} is not an object!`)}(t,e);const i=Object.keys(e).sort(),o=r.length,s=r.length+n.length,a=`${t} does not have correct keys! Required keys: [${r.sort().join(", ")}], optional keys: [${n.sort().join(", ")}], actual keys: [${i.join(", ")}]`;if(i.lengths)throw new Error(a);let u=i.filter((t=>!r.includes(t)));if(i.length-u.length!==o)throw new Error(a);if(u.find((t=>!n.includes(t))))throw new Error(a)}function p(t,e){if(!/^0x([0-9a-fA-F][0-9a-fA-F])*$/.test(e))throw new Error(`${t} must be a hex string!`)}function b(t,e){if(p(t,e),66!=e.length)throw new Error(`${t} must be a hex string of 66 bytes long!`)}function m(t,e){if("0x0"!==e&&!/^0x[1-9a-fA-F][0-9a-fA-F]*$/.test(e))throw new Error(`${t} must be a hex integer!`)}function y(t,{nestedValidation:e=!0,debugPath:r="script"}={}){if(d(r,t,["code_hash","hash_type","args"],[]),b(`${r}.code_hash`,t.code_hash),p(`${r}.args`,t.args),"data"!==t.hash_type&&"type"!==t.hash_type)throw new Error(`${r}.hash_type must be either data or type!`)}function w(t,{nestedValidation:e=!0,debugPath:r="out_point"}={}){d(r,t,["tx_hash","index"],[]),b(`${r}.tx_hash`,t.tx_hash),m(`${r}.index`,t.index)}function v(t,{nestedValidation:e=!0,debugPath:r="cell_input"}={}){d(r,t,["since","previous_output"],[]),m(`${r}.since`,t.since),e&&w(t.previous_output,{debugPath:`${r}.previous_output`})}function B(t,{nestedValidation:e=!0,debugPath:r="cell_output"}={}){d(r,t,["capacity","lock"],["type"]),m(`${r}.capacity`,t.capacity),e&&(y(t.lock,{debugPath:`${r}.lock`}),t.type&&y(t.type,{debugPath:`${r}.type`}))}function P(t,{nestedValidation:e=!0,debugPath:r="cell_dep"}={}){if(d(r,t,["out_point","dep_type"],[]),"code"!==t.dep_type&&"dep_group"!==t.dep_type)throw new Error(`${r}.dep_type must be either code or dep_group!`);e&&w(t.out_point,{debugPath:`${r}.out_point`})}function D(t,e,r,n){if(!Array.isArray(e))throw new Error(`${t} is not an array!`);if(n)for(let n=0;n1&&void 0!==arguments[1]?arguments[1]:{},n=r.size;let i=void 0===n?0:n;var o=r.timeout;let a=void 0===o?0:o;null==t?t=null:J(t)?t=Buffer.from(t.toString()):X(t)||Buffer.isBuffer(t)||("[object ArrayBuffer]"===Object.prototype.toString.call(t)?t=Buffer.from(t):ArrayBuffer.isView(t)?t=Buffer.from(t.buffer,t.byteOffset,t.byteLength):t instanceof s.default||(t=Buffer.from(String(t)))),this[H]={body:t,disturbed:!1,error:null},this.size=i,this.timeout=a,t instanceof s.default&&t.on("error",(function(t){const r="AbortError"===t.name?t:new U(`Invalid response body while trying to fetch ${e.url}: ${t.message}`,"system",t);e[H].error=r}))}function W(){var t=this;if(this[H].disturbed)return G.Promise.reject(new TypeError(`body used already for: ${this.url}`));if(this[H].disturbed=!0,this[H].error)return G.Promise.reject(this[H].error);let e=this.body;if(null===e)return G.Promise.resolve(Buffer.alloc(0));if(X(e)&&(e=e.stream()),Buffer.isBuffer(e))return G.Promise.resolve(e);if(!(e instanceof s.default))return G.Promise.resolve(Buffer.alloc(0));let r=[],n=0,i=!1;return new G.Promise((function(o,s){let a;t.timeout&&(a=setTimeout((function(){i=!0,s(new U(`Response timeout while trying to fetch ${t.url} (over ${t.timeout}ms)`,"body-timeout"))}),t.timeout)),e.on("error",(function(e){"AbortError"===e.name?(i=!0,s(e)):s(new U(`Invalid response body while trying to fetch ${t.url}: ${e.message}`,"system",e))})),e.on("data",(function(e){if(!i&&null!==e){if(t.size&&n+e.length>t.size)return i=!0,void s(new U(`content size at ${t.url} over limit: ${t.size}`,"max-size"));n+=e.length,r.push(e)}})),e.on("end",(function(){if(!i){clearTimeout(a);try{o(Buffer.concat(r,n))}catch(e){s(new U(`Could not create Buffer from response body for ${t.url}: ${e.message}`,"system",e))}}}))}))}function J(t){return"object"==typeof t&&"function"==typeof t.append&&"function"==typeof t.delete&&"function"==typeof t.get&&"function"==typeof t.getAll&&"function"==typeof t.has&&"function"==typeof t.set&&("URLSearchParams"===t.constructor.name||"[object URLSearchParams]"===Object.prototype.toString.call(t)||"function"==typeof t.sort)}function X(t){return"object"==typeof t&&"function"==typeof t.arrayBuffer&&"string"==typeof t.type&&"function"==typeof t.stream&&"function"==typeof t.constructor&&"string"==typeof t.constructor.name&&/^(Blob|File)$/.test(t.constructor.name)&&/^(Blob|File)$/.test(t[Symbol.toStringTag])}function Q(t){let e,r,n=t.body;if(t.bodyUsed)throw new Error("cannot clone body after it is used");return n instanceof s.default&&"function"!=typeof n.getBoundary&&(e=new F,r=new F,n.pipe(e),n.pipe(r),t[H].body=e,n=r),n}function Z(t){return null===t?null:"string"==typeof t?"text/plain;charset=UTF-8":J(t)?"application/x-www-form-urlencoded;charset=UTF-8":X(t)?t.type||null:Buffer.isBuffer(t)||"[object ArrayBuffer]"===Object.prototype.toString.call(t)||ArrayBuffer.isView(t)?null:"function"==typeof t.getBoundary?`multipart/form-data;boundary=${t.getBoundary()}`:t instanceof s.default?null:"text/plain;charset=UTF-8"}function K(t){const e=t.body;return null===e?0:X(e)?e.size:Buffer.isBuffer(e)?e.length:e&&"function"==typeof e.getLengthSync&&(e._lengthRetrievers&&0==e._lengthRetrievers.length||e.hasKnownLength&&e.hasKnownLength())?e.getLengthSync():null}G.prototype={get body(){return this[H].body},get bodyUsed(){return this[H].disturbed},arrayBuffer(){return W.call(this).then((function(t){return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}))},blob(){let t=this.headers&&this.headers.get("content-type")||"";return W.call(this).then((function(e){return Object.assign(new q([],{type:t.toLowerCase()}),{[L]:e})}))},json(){var t=this;return W.call(this).then((function(e){try{return JSON.parse(e.toString())}catch(e){return G.Promise.reject(new U(`invalid json response body at ${t.url} reason: ${e.message}`,"invalid-json"))}}))},text(){return W.call(this).then((function(t){return t.toString()}))},buffer(){return W.call(this)},textConverted(){var t=this;return W.call(this).then((function(e){return function(t,e){if("function"!=typeof V)throw new Error("The package `encoding` must be installed to use the textConverted() function");const r=e.get("content-type");let n,i,o="utf-8";r&&(n=/charset=([^;]*)/i.exec(r));i=t.slice(0,1024).toString(),!n&&i&&(n=/0&&void 0!==arguments[0]?arguments[0]:void 0;if(this[it]=Object.create(null),t instanceof ot){const e=t.raw(),r=Object.keys(e);for(const t of r)for(const r of e[t])this.append(t,r)}else if(null==t);else{if("object"!=typeof t)throw new TypeError("Provided initializer must be an object");{const e=t[Symbol.iterator];if(null!=e){if("function"!=typeof e)throw new TypeError("Header pairs must be iterable");const r=[];for(const e of t){if("object"!=typeof e||"function"!=typeof e[Symbol.iterator])throw new TypeError("Each header pair must be iterable");r.push(Array.from(e))}for(const t of r){if(2!==t.length)throw new TypeError("Each header pair must be a name/value tuple");this.append(t[0],t[1])}}else for(const e of Object.keys(t)){const r=t[e];this.append(e,r)}}}}get(t){et(t=`${t}`);const e=nt(this[it],t);return void 0===e?null:this[it][e].join(", ")}forEach(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,r=st(this),n=0;for(;n1&&void 0!==arguments[1]?arguments[1]:"key+value";const r=Object.keys(t[it]).sort();return r.map("key"===e?function(t){return t.toLowerCase()}:"value"===e?function(e){return t[it][e].join(", ")}:function(e){return[e.toLowerCase(),t[it][e].join(", ")]})}ot.prototype.entries=ot.prototype[Symbol.iterator],Object.defineProperty(ot.prototype,Symbol.toStringTag,{value:"Headers",writable:!1,enumerable:!1,configurable:!0}),Object.defineProperties(ot.prototype,{get:{enumerable:!0},forEach:{enumerable:!0},set:{enumerable:!0},append:{enumerable:!0},has:{enumerable:!0},delete:{enumerable:!0},keys:{enumerable:!0},values:{enumerable:!0},entries:{enumerable:!0}});const at=Symbol("internal");function ut(t,e){const r=Object.create(lt);return r[at]={target:t,kind:e,index:0},r}const lt=Object.setPrototypeOf({next(){if(!this||Object.getPrototypeOf(this)!==lt)throw new TypeError("Value of `this` is not a HeadersIterator");var t=this[at];const e=t.target,r=t.kind,n=t.index,i=st(e,r);return n>=i.length?{value:void 0,done:!0}:(this[at].index=n+1,{value:i[n],done:!1})}},Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));function ct(t){const e=Object.assign({__proto__:null},t[it]),r=nt(t[it],"Host");return void 0!==r&&(e[r]=e[r][0]),e}Object.defineProperty(lt,Symbol.toStringTag,{value:"HeadersIterator",writable:!1,enumerable:!1,configurable:!0});const _t=Symbol("Response internals"),ft=a.default.STATUS_CODES;class ht{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};G.call(this,t,e);const r=e.status||200,n=new ot(e.headers);if(null!=t&&!n.has("Content-Type")){const e=Z(t);e&&n.append("Content-Type",e)}this[_t]={url:e.url,status:r,statusText:e.statusText||ft[r],headers:n,counter:e.counter}}get url(){return this[_t].url||""}get status(){return this[_t].status}get ok(){return this[_t].status>=200&&this[_t].status<300}get redirected(){return this[_t].counter>0}get statusText(){return this[_t].statusText}get headers(){return this[_t].headers}clone(){return new ht(Q(this),{url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected})}}G.mixIn(ht.prototype),Object.defineProperties(ht.prototype,{url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}}),Object.defineProperty(ht.prototype,Symbol.toStringTag,{value:"Response",writable:!1,enumerable:!1,configurable:!0});const gt=Symbol("Request internals"),dt=u.default.parse,pt=u.default.format,bt="destroy"in s.default.Readable.prototype;function mt(t){return"object"==typeof t&&"object"==typeof t[gt]}class yt{constructor(t){let e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};mt(t)?e=dt(t.url):(e=t&&t.href?dt(t.href):dt(`${t}`),t={});let n=r.method||t.method||"GET";if(n=n.toUpperCase(),(null!=r.body||mt(t)&&null!==t.body)&&("GET"===n||"HEAD"===n))throw new TypeError("Request with GET/HEAD method cannot have body");let i=null!=r.body?r.body:mt(t)&&null!==t.body?Q(t):null;G.call(this,i,{timeout:r.timeout||t.timeout||0,size:r.size||t.size||0});const o=new ot(r.headers||t.headers||{});if(null!=i&&!o.has("Content-Type")){const t=Z(i);t&&o.append("Content-Type",t)}let s=mt(t)?t.signal:null;if("signal"in r&&(s=r.signal),null!=s&&!function(t){const e=t&&"object"==typeof t&&Object.getPrototypeOf(t);return!(!e||"AbortSignal"!==e.constructor.name)}(s))throw new TypeError("Expected signal to be an instanceof AbortSignal");this[gt]={method:n,redirect:r.redirect||t.redirect||"follow",headers:o,parsedURL:e,signal:s},this.follow=void 0!==r.follow?r.follow:void 0!==t.follow?t.follow:20,this.compress=void 0!==r.compress?r.compress:void 0===t.compress||t.compress,this.counter=r.counter||t.counter||0,this.agent=r.agent||t.agent}get method(){return this[gt].method}get url(){return pt(this[gt].parsedURL)}get headers(){return this[gt].headers}get redirect(){return this[gt].redirect}get signal(){return this[gt].signal}clone(){return new yt(this)}}function wt(t){Error.call(this,t),this.type="aborted",this.message=t,Error.captureStackTrace(this,this.constructor)}G.mixIn(yt.prototype),Object.defineProperty(yt.prototype,Symbol.toStringTag,{value:"Request",writable:!1,enumerable:!1,configurable:!0}),Object.defineProperties(yt.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0}}),wt.prototype=Object.create(Error.prototype),wt.prototype.constructor=wt,wt.prototype.name="AbortError";const vt=s.default.PassThrough,Bt=u.default.resolve;function Pt(t,e){if(!Pt.Promise)throw new Error("native promise missing, set fetch.Promise to your favorite alternative");return G.Promise=Pt.Promise,new Pt.Promise((function(r,n){const i=new yt(t,e),o=function(t){const e=t[gt].parsedURL,r=new ot(t[gt].headers);if(r.has("Accept")||r.set("Accept","*/*"),!e.protocol||!e.hostname)throw new TypeError("Only absolute URLs are supported");if(!/^https?:$/.test(e.protocol))throw new TypeError("Only HTTP(S) protocols are supported");if(t.signal&&t.body instanceof s.default.Readable&&!bt)throw new Error("Cancellation of streamed requests with AbortSignal is not supported in node < 8");let n=null;if(null==t.body&&/^(POST|PUT)$/i.test(t.method)&&(n="0"),null!=t.body){const e=K(t);"number"==typeof e&&(n=String(e))}n&&r.set("Content-Length",n),r.has("User-Agent")||r.set("User-Agent","node-fetch/1.0 (+https://github.com/bitinn/node-fetch)"),t.compress&&!r.has("Accept-Encoding")&&r.set("Accept-Encoding","gzip,deflate");let i=t.agent;return"function"==typeof i&&(i=i(e)),r.has("Connection")||i||r.set("Connection","close"),Object.assign({},e,{method:t.method,headers:ct(r),agent:i})}(i),u=("https:"===o.protocol?l.default:a.default).request,_=i.signal;let f=null;const h=function(){let t=new wt("The user aborted a request.");n(t),i.body&&i.body instanceof s.default.Readable&&i.body.destroy(t),f&&f.body&&f.body.emit("error",t)};if(_&&_.aborted)return void h();const g=function(){h(),b()},d=u(o);let p;function b(){d.abort(),_&&_.removeEventListener("abort",g),clearTimeout(p)}_&&_.addEventListener("abort",g),i.timeout&&d.once("socket",(function(t){p=setTimeout((function(){n(new U(`network timeout at: ${i.url}`,"request-timeout")),b()}),i.timeout)})),d.on("error",(function(t){n(new U(`request to ${i.url} failed, reason: ${t.message}`,"system",t)),b()})),d.on("response",(function(t){clearTimeout(p);const e=function(t){const e=new ot;for(const r of Object.keys(t))if(!Y.test(r))if(Array.isArray(t[r]))for(const n of t[r])tt.test(n)||(void 0===e[it][r]?e[it][r]=[n]:e[it][r].push(n));else tt.test(t[r])||(e[it][r]=[t[r]]);return e}(t.headers);if(Pt.isRedirect(t.statusCode)){const o=e.get("Location"),s=null===o?null:Bt(i.url,o);switch(i.redirect){case"error":return n(new U(`uri requested responds with a redirect, redirect mode is set to error: ${i.url}`,"no-redirect")),void b();case"manual":if(null!==s)try{e.set("Location",s)}catch(t){n(t)}break;case"follow":if(null===s)break;if(i.counter>=i.follow)return n(new U(`maximum redirect reached at: ${i.url}`,"max-redirect")),void b();const o={headers:new ot(i.headers),follow:i.follow,counter:i.counter+1,agent:i.agent,compress:i.compress,method:i.method,body:i.body,signal:i.signal,timeout:i.timeout,size:i.size};return 303!==t.statusCode&&i.body&&null===K(i)?(n(new U("Cannot follow redirect with body being a readable stream","unsupported-redirect")),void b()):(303!==t.statusCode&&(301!==t.statusCode&&302!==t.statusCode||"POST"!==i.method)||(o.method="GET",o.body=void 0,o.headers.delete("content-length")),r(Pt(new yt(s,o))),void b())}}t.once("end",(function(){_&&_.removeEventListener("abort",g)}));let o=t.pipe(new vt);const s={url:i.url,status:t.statusCode,statusText:t.statusMessage,headers:e,size:i.size,timeout:i.timeout,counter:i.counter},a=e.get("Content-Encoding");if(!i.compress||"HEAD"===i.method||null===a||204===t.statusCode||304===t.statusCode)return f=new ht(o,s),void r(f);const u={flush:c.default.Z_SYNC_FLUSH,finishFlush:c.default.Z_SYNC_FLUSH};if("gzip"==a||"x-gzip"==a)return o=o.pipe(c.default.createGunzip(u)),f=new ht(o,s),void r(f);if("deflate"!=a&&"x-deflate"!=a){if("br"==a&&"function"==typeof c.default.createBrotliDecompress)return o=o.pipe(c.default.createBrotliDecompress()),f=new ht(o,s),void r(f);f=new ht(o,s),r(f)}else{t.pipe(new vt).once("data",(function(t){o=8==(15&t[0])?o.pipe(c.default.createInflate()):o.pipe(c.default.createInflateRaw()),f=new ht(o,s),r(f)}))}})),function(t,e){const r=e.body;null===r?t.end():X(r)?r.stream().pipe(t):Buffer.isBuffer(r)?(t.write(r),t.end()):r.pipe(t)}(d,i)}))}Pt.isRedirect=function(t){return 301===t||302===t||303===t||307===t||308===t},Pt.Promise=global.Promise;var Dt,St,Tt,$t=R(Object.freeze({__proto__:null,default:Pt,Headers:ot,Request:yt,Response:ht,FetchError:U})),kt=(Dt=function(t,e){var r=$t.default||$t,n=function(t,e){return/^\/\//.test(t)&&(t="https:"+t),r.call(this,t,e)};t.exports=e=n,e.fetch=n,e.Headers=$t.Headers,e.Request=$t.Request,e.Response=$t.Response,e.default=n},Dt(Tt={path:St,exports:{},require:function(t,e){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==e&&Tt.path)}},Tt.exports),Tt.exports);function xt(t,e){e=e||{};const r=Object.assign({},e.headers||{},t.headers||{});return Object.assign({},e,t,{headers:r})}const Ot={get:(t,e,r)=>"send"===e?async()=>{const e=await kt(t.uri,xt({method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify(t.payload)},t.defaultOptions));return await e.json()}:(...n)=>{const i=t.id;return t.id=t.id+1,t.payload.push({jsonrpc:"2.0",id:i,method:e,params:n}),r}},Et={get:(t,e)=>"batch"===e?()=>new Proxy({id:Math.round(1e7*Math.random()),payload:[],uri:t.uri,defaultOptions:t.defaultOptions},Ot):async(...r)=>{const n=Math.round(1e7*Math.random()),i=await kt(t.uri,xt({method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:n,method:e,params:r})},t.defaultOptions)),o=await i.json();if(o.id!==n)throw new Error("JSONRPCError: response ID does not match request ID!");if(o.error)throw new Error(`JSONRPCError: server error ${JSON.stringify(o.error)}`);return o.result}};class Ct{constructor(t,e={}){return this.uri=t,this.defaultOptions=e,new Proxy(this,Et)}static create(t){return new Ct(t)}}function At(t){return g.BigInt(t)}function jt(t){return"0x"+t.toString(16)}function zt(t){return function(e,r){if(!(r instanceof ArrayBuffer)){let n=jt(g.BigInt(r)).substr(2);if(n.length%2!=0&&(n="0"+n),n.length/2>t)throw new Error(`${e} is ${n.length/2} bytes long, expected length is ${t}!`);const i=new DataView(new ArrayBuffer(t));for(let t=0;t0&&r.byteLength!==t)throw new Error(`${e} has invalid length ${r.byteLength}, required: ${t}`);return r}}function Rt(t,e,r){const n={};for(const[i,o]of Object.entries(r)){const r=e[i];if(!r)throw new Error(`${t} is missing ${i}!`);n[i]=o(`${t}.${i}`,r)}return n}function Mt(t,{debugPath:e="script"}={}){return Rt(e,t,{code_hash:It(32),hash_type:function(t,e){switch(e){case"data":return 0;case"type":return 1;case 0:case 1:return e;default:throw new Error(`${t}.hash_type has invalid value: ${e}`)}},args:It(-1)})}function Lt(t,{debugPath:e="out_point"}={}){return Rt(e,t,{tx_hash:It(32),index:zt(4)})}function Nt(t){return function(e,r){return t(r,{debugPath:e})}}function qt(t,{debugPath:e="cell_input"}={}){return Rt(e,t,{since:zt(8),previous_output:Nt(Lt)})}function Ut(t,{debugPath:e="cell_output"}={}){const r=Rt(e,t,{capacity:zt(8),lock:Nt(Mt)});return t.type&&(r.type_=Mt(t.type,{debugPath:`${e}.type`})),r}function Vt(t,{debugPath:e="cell_dep"}={}){return Rt(e,t,{out_point:Nt(Lt),dep_type:function(t,e){switch(e){case"code":return 0;case"dep_group":return 1;case 0:case 1:return e;default:throw new Error(`${t}.dep_type has invalid value: ${e}`)}}})}function Ht(t){return function(e,r){return r.map(((r,n)=>t(`${e}[${n}]`,r)))}}function Ft(t,{debugPath:e="raw_transaction"}={}){return Rt(e,t,{version:zt(4),cell_deps:Ht(Nt(Vt)),header_deps:Ht(It(32)),inputs:Ht(Nt(qt)),outputs:Ht(Nt(Ut)),outputs_data:Ht(It(-1))})}function Gt(t,{debugPath:e="transaction"}={}){const r=Ft(t,{debugPath:`(raw)${e}`}),n=Rt(e,t,{witnesses:Ht(It(-1))});return n.raw=r,n}function Wt(t,{debugPath:e="raw_header"}={}){return Rt(e,t,{version:zt(4),compact_target:zt(4),timestamp:zt(8),number:zt(8),epoch:zt(8),parent_hash:It(32),transactions_root:It(32),proposals_hash:It(32),uncles_hash:It(32),dao:It(32)})}function Jt(t,{debugPath:e="header"}={}){const r=Wt(t,{debugPath:`(raw)${e}`}),n=Rt(e,t,{nonce:zt(16)});return n.raw=r,n}function Xt(t,{debugPath:e="uncle_block"}={}){return Rt(e,t,{header:Nt(Jt),proposals:Ht(It(10))})}var Qt=Object.freeze({__proto__:null,NormalizeScript:Mt,NormalizeOutPoint:Lt,NormalizeCellInput:qt,NormalizeCellOutput:Ut,NormalizeCellDep:Vt,NormalizeRawTransaction:Ft,NormalizeTransaction:Gt,NormalizeRawHeader:Wt,NormalizeHeader:Jt,NormalizeUncleBlock:Xt,NormalizeBlock:function(t,{debugPath:e="block"}={}){return Rt(e,t,{header:Nt(Jt),uncles:Ht(Nt(Xt)),transactions:Ht(Nt(Gt)),proposals:Ht(It(10))})},NormalizeCellbaseWitness:function(t,{debugPath:e="cellbase_witness"}={}){return Rt(e,t,{lock:Nt(Mt),message:It(-1)})},NormalizeWitnessArgs:function(t,{debugPath:e="witness_args"}={}){const r={};return t.lock&&(r.lock=It(-1)(`${e}.lock`,t.lock)),t.input_type&&(r.input_type=It(-1)(`${e}.input_type`,t.input_type)),t.output_type&&(r.output_type=It(-1)(`${e}.output_type`,t.output_type)),r}});function Zt(t,e){return e instanceof Object&&e.serializeJson instanceof Function?e.serializeJson.call(e):e}function Kt(t,e,r){if(!((e=Zt(0,e))instanceof Object))throw new Error(`Transformed ${t} is not an object!`);const n={};for(const[i,o]of Object.entries(r)){let r=e[i];if(!r){r=e[i.replace(/(_[a-z])/g,(t=>t.toUpperCase().replace("_","")))]}r&&(n[i]=o(`${t}.${i}`,r))}return n}function Yt(t,{validation:e=!0,debugPath:r="script"}={}){return t=Kt(r,t,{code_hash:Zt,hash_type:Zt,args:Zt}),e&&y(t,{debugPath:`(transformed) ${r}`}),t}function te(t,{validation:e=!0,debugPath:r="out_point"}={}){return t=Kt(r,t,{tx_hash:Zt,index:Zt}),e&&w(t,{debugPath:`(transformed) ${r}`}),t}function ee(t){return function(e,r){return t(r,{validation:!1,debugPath:e})}}function re(t,{validation:e=!0,debugPath:r="cell_input"}={}){return t=Kt(r,t,{since:Zt,previous_output:ee(te)}),e&&v(t,{debugPath:`(transformed) ${r}`}),t}function ne(t,{validation:e=!0,debugPath:r="cell_output"}={}){return t=Kt(r,t,{capacity:Zt,lock:ee(Yt),type:ee(Yt)}),e&&B(t,{debugPath:`(transformed) ${r}`}),t}function ie(t,{validation:e=!0,debugPath:r="cell_dep"}={}){return t=Kt(r,t,{out_point:ee(te),dep_type:Zt}),e&&P(t,{debugPath:`(transformed) ${r}`}),t}function oe(t){return function(e,r){return r.map(((r,n)=>t(`${e}[${n}]`,r)))}}function se(t,{validation:e=!0,debugPath:r="transaction"}={}){return t=Kt(r,t,{version:Zt,cell_deps:oe(ee(ie)),header_deps:oe(Zt),inputs:oe(ee(re)),outputs:oe(ee(ne)),outputs_data:oe(Zt),witnesses:oe(Zt)}),e&&k(t,{debugPath:`(transformed) ${r}`}),t}function ae(t,{validation:e=!0,debugPath:r="header"}={}){return t=Kt(r,t,{version:Zt,compact_target:Zt,timestamp:Zt,number:Zt,epoch:Zt,parent_hash:Zt,transactions_root:Zt,proposals_hash:Zt,uncles_hash:Zt,dao:Zt,nonce:Zt}),e&&O(t,{debugPath:`(transformed) ${r}`}),t}function ue(t,{validation:e=!0,debugPath:r="uncle_block"}={}){return t=Kt(r,t,{header:ee(ae),proposals:oe(Zt)}),e&&C(t,{debugPath:`(transformed) ${r}`}),t}var le=Object.freeze({__proto__:null,TransformScript:Yt,TransformOutPoint:te,TransformCellInput:re,TransformCellOutput:ne,TransformCellDep:ie,TransformRawTransaction:function(t,{validation:e=!0,debugPath:r="raw_transaction"}={}){return t=Kt(r,t,{version:Zt,cell_deps:oe(ee(ie)),header_deps:oe(Zt),inputs:oe(ee(re)),outputs:oe(ee(ne)),outputs_data:oe(Zt)}),e&&$(t,{debugPath:`(transformed) ${r}`}),t},TransformTransaction:se,TransformRawHeader:function(t,{validation:e=!0,debugPath:r="raw_header"}={}){return t=Kt(r,t,{version:Zt,compact_target:Zt,timestamp:Zt,number:Zt,epoch:Zt,parent_hash:Zt,transactions_root:Zt,proposals_hash:Zt,uncles_hash:Zt,dao:Zt}),e&&x(t,{debugPath:`(transformed) ${r}`}),t},TransformHeader:ae,TransformUncleBlock:ue,TransformBlock:function(t,{validation:e=!0,debugPath:r="block"}={}){return t=Kt(r,t,{header:ee(ae),uncles:oe(ee(ue)),transactions:oe(ee(se)),proposals:oe(Zt)}),e&&A(t,{debugPath:`(transformed) ${r}`}),t},TransformCellbaseWitness:function(t,{validation:e=!0,debugPath:r="cellbase_witness"}={}){return t=Kt(r,t,{lock:ee(Yt),message:Zt}),e&&j(t,{debugPath:`(transformed) ${r}`}),t},TransformWitnessArgs:function(t,{validation:e=!0,debugPath:r="witness_args"}={}){return t=Kt(r,t,{lock:Zt,input_type:Zt,output_type:Zt}),e&&z(t,{debugPath:`(transformed) ${r}`}),t}});var ce=Object.freeze({__proto__:null,RPCCollector:class{constructor(t,e,{skipCellWithContent:r=!0,loadData:n=!1,loadBlockNumber:i=!0}={}){this.rpc=t,this.lockHash=new h(e).serializeJson(),this.skipCellWithContent=r,this.loadData=n,this.loadBlockNumber=i}async*collect(){const t=At(await this.rpc.get_tip_block_number());let e=g.BigInt(0);for(;g.lessThanOrEqual(e,t);){let r=g.add(e,g.BigInt(100));g.greaterThan(r,t)&&(r=t);const n=await this.rpc.get_cells_by_lock_hash(this.lockHash,jt(e),jt(r));for(const t of n){if(this.skipCellWithContent&&(t.type||g.greaterThan(At(t.output_data_len),g.BigInt(100))))continue;let e=null;if(this.loadData){e=(await this.rpc.get_live_cell(t.out_point,!0)).cell.data.content}let r=null;if(this.loadBlockNumber){r=(await this.rpc.get_header(t.block_hash)).number}yield{cellbase:t.cellbase,cell_output:{capacity:t.capacity,lock:t.lock,type:t.type},out_point:t.out_point,block_hash:t.block_hash,data:e,output_data_len:t.output_data_len,block_number:r}}e=g.add(r,g.BigInt(1))}}}});exports.BigIntToHexString=jt,exports.HexStringToBigInt=At,exports.RPC=Ct,exports.Reader=h,exports.TransactionDumper=class{constructor(t,{validateTransaction:e=!0,depGroupUnpacker:r=null}={}){this.rpc=t,this.validateTransaction=e,this.depGroupUnpacker=r}async dumpByHash(t){const e=(await this.rpc.get_transaction(t)).transaction;return delete e.hash,await this.dump(e)}async dump(t){this.validateTransaction&&k(t);const e=[];for(const r of t.inputs){const{output:t,data:n,header:i}=await this._resolveOutPoint(r.previous_output);e.push({input:r,output:t,data:n,header:i})}const r=[];for(const e of t.cell_deps){const{output:t,data:n,header:i}=await this._resolveOutPoint(e.out_point);if(r.push({cell_dep:e,output:t,data:n,header:i}),"dep_group"===e.dep_type){if(!this.depGroupUnpacker)throw new Error("depGroupUnpacker must be provided when the transaction contains dep_group!");const t=this.depGroupUnpacker(new h(n));for(const e of t){w(e);const{output:t,data:n,header:i}=await this._resolveOutPoint(e);r.push({cell_dep:{out_point:e,dep_type:"code"},output:t,data:n,header:i})}}}const n=[];for(const e of t.header_deps)n.push(await this.rpc.get_header(e));return JSON.stringify({mock_info:{inputs:e,cell_deps:r,header_deps:n},tx:t})}async _resolveOutPoint(t){const e=await this.rpc.get_transaction(t.tx_hash);if(!e||!e.transaction)throw new Error(`Transaction ${t.tx_hash} cannot be found!`);const r=e.transaction,n=g.toNumber(g.BigInt(t.index));if(n>=r.outputs.length)throw new Error(`Transaction ${t.tx_hash} does not have output ${n}!`);const i={output:r.outputs[n],data:r.outputs_data[n]};return"committed"===e.tx_status.status&&(i.header=e.tx_status.block_hash),i}},exports.VERSION="0.10.2",exports.cell_collectors=ce,exports.normalizers=Qt,exports.transformers=le,exports.validators=I; -//# sourceMappingURL=ckb-js-toolkit.node.js.map diff --git a/packages/core/lib/ckb-js-toolkit.node.js.map b/packages/core/lib/ckb-js-toolkit.node.js.map deleted file mode 100644 index 65f13e91b..000000000 --- a/packages/core/lib/ckb-js-toolkit.node.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ckb-js-toolkit.node.js","sources":["../src/reader.js","../../../node_modules/jsbi/dist/jsbi.mjs","../src/validators.js","../../../node_modules/node-fetch/lib/index.mjs","../../../node_modules/cross-fetch/dist/node-ponyfill.js","../src/rpc.js","../src/normalizers.js","../src/transformers.js","../src/cell_collectors/rpc_collector.js","../src/transaction_dumper.js","../src/index.js"],"sourcesContent":["class ArrayBufferReader {\n constructor(buffer) {\n this.view = new DataView(buffer);\n }\n\n length() {\n return this.view.byteLength;\n }\n\n indexAt(i) {\n return this.view.getUint8(i);\n }\n\n toArrayBuffer() {\n return this.view.buffer;\n }\n\n serializeJson() {\n return (\n \"0x\" +\n Array.prototype.map\n .call(new Uint8Array(this.view.buffer), x =>\n (\"00\" + x.toString(16)).slice(-2)\n )\n .join(\"\")\n );\n }\n}\n\nclass HexStringReader {\n constructor(string) {\n this.string = string;\n }\n\n length() {\n return this.string.length / 2 - 1;\n }\n\n indexAt(i) {\n return parseInt(this.string.substr(2 + i * 2, 2), 16);\n }\n\n toArrayBuffer() {\n const buffer = new ArrayBuffer(this.length());\n const view = new DataView(buffer);\n\n for (let i = 0; i < this.length(); i++) {\n view.setUint8(i, this.indexAt(i));\n }\n return buffer;\n }\n\n serializeJson() {\n return this.string;\n }\n}\n\nexport class Reader {\n constructor(input) {\n if (\n input instanceof HexStringReader ||\n input instanceof ArrayBufferReader\n ) {\n return input;\n }\n if (typeof input === \"string\") {\n if (!input.startsWith(\"0x\") || input.length % 2 != 0) {\n throw new Error(\n \"Hex string must start with 0x, and has even numbered length!\"\n );\n }\n return new HexStringReader(input);\n }\n if (input instanceof ArrayBuffer) {\n return new ArrayBufferReader(input);\n }\n throw new Error(\"Reader can only accept hex string or ArrayBuffer!\");\n }\n\n static fromRawString(string) {\n const buffer = new ArrayBuffer(string.length);\n const view = new DataView(buffer);\n\n for (let i = 0; i < string.length; i++) {\n const c = string.charCodeAt(i);\n if (c > 0xff) {\n throw new Error(\"fromRawString can only accept UTF-8 raw string!\");\n }\n view.setUint8(i, c);\n }\n return new ArrayBufferReader(buffer);\n }\n}\n","class JSBI extends Array{constructor(a,b){if(a>JSBI.__kMaxLength)throw new RangeError(\"Maximum BigInt size exceeded\");super(a),this.sign=b}static BigInt(a){var b=Math.floor,c=Number.isFinite;if(\"number\"==typeof a){if(0===a)return JSBI.__zero();if((0|a)===a)return 0>a?JSBI.__oneDigit(-a,!0):JSBI.__oneDigit(a,!1);if(!c(a)||b(a)!==a)throw new RangeError(\"The number \"+a+\" cannot be converted to BigInt because it is not an integer\");return JSBI.__fromDouble(a)}if(\"string\"==typeof a){const b=JSBI.__fromString(a);if(null===b)throw new SyntaxError(\"Cannot convert \"+a+\" to a BigInt\");return b}if(\"boolean\"==typeof a)return!0===a?JSBI.__oneDigit(1,!1):JSBI.__zero();if(\"object\"==typeof a){if(a.constructor===JSBI)return a;const b=JSBI.__toPrimitive(a);return JSBI.BigInt(b)}throw new TypeError(\"Cannot convert \"+a+\" to a BigInt\")}toDebugString(){const a=[\"BigInt[\"];for(const b of this)a.push((b?(b>>>0).toString(16):b)+\", \");return a.push(\"]\"),a.join(\"\")}toString(a=10){if(2>a||36>>=12;const l=j-12;let m=12<=j?0:h<<20+j,n=20+j;0>>32-l,m=h<>>32-n,n-=32);const o=JSBI.__decideRounding(a,n,i,h);if((1===o||0===o&&1==(1&m))&&(m=m+1>>>0,0===m&&(k++,0!=k>>>20&&(k=0,g++,1023=JSBI.__kMaxLengthBits)throw new RangeError(\"BigInt too big\");if(1===a.length&&2===a.__digit(0)){const b=1+(c>>>5),d=a.sign&&0!=(1&c),e=new JSBI(b,d);e.__initializeDigits();const f=1<<(31&c);return e.__setDigit(b-1,f),e}let d=null,e=a;for(0!=(1&c)&&(d=a),c>>=1;0!==c;c>>=1)e=JSBI.multiply(e,e),0!=(1&c)&&(null===d?d=e:d=JSBI.multiply(d,e));return d}static multiply(a,b){if(0===a.length)return a;if(0===b.length)return b;let c=a.length+b.length;32<=a.__clzmsd()+b.__clzmsd()&&c--;const d=new JSBI(c,a.sign!==b.sign);d.__initializeDigits();for(let c=0;cJSBI.__absoluteCompare(a,b))return JSBI.__zero();const c=a.sign!==b.sign,d=b.__unsignedDigit(0);let e;if(1===b.length&&65535>=d){if(1===d)return c===a.sign?a:JSBI.unaryMinus(a);e=JSBI.__absoluteDivSmall(a,d,null)}else e=JSBI.__absoluteDivLarge(a,b,!0,!1);return e.sign=c,e.__trim()}static remainder(a,b){if(0===b.length)throw new RangeError(\"Division by zero\");if(0>JSBI.__absoluteCompare(a,b))return a;const c=b.__unsignedDigit(0);if(1===b.length&&65535>=c){if(1===c)return JSBI.__zero();const b=JSBI.__absoluteModSmall(a,c);return 0===b?JSBI.__zero():JSBI.__oneDigit(b,a.sign)}const d=JSBI.__absoluteDivLarge(a,b,!1,!0);return d.sign=a.sign,d.__trim()}static add(a,b){const c=a.sign;return c===b.sign?JSBI.__absoluteAdd(a,b,c):0<=JSBI.__absoluteCompare(a,b)?JSBI.__absoluteSub(a,b,c):JSBI.__absoluteSub(b,a,!c)}static subtract(a,b){const c=a.sign;return c===b.sign?0<=JSBI.__absoluteCompare(a,b)?JSBI.__absoluteSub(a,b,c):JSBI.__absoluteSub(b,a,!c):JSBI.__absoluteAdd(a,b,c)}static leftShift(a,b){return 0===b.length||0===a.length?a:b.sign?JSBI.__rightShiftByAbsolute(a,b):JSBI.__leftShiftByAbsolute(a,b)}static signedRightShift(a,b){return 0===b.length||0===a.length?a:b.sign?JSBI.__leftShiftByAbsolute(a,b):JSBI.__rightShiftByAbsolute(a,b)}static unsignedRightShift(){throw new TypeError(\"BigInts have no unsigned right shift; use >> instead\")}static lessThan(a,b){return 0>JSBI.__compareToBigInt(a,b)}static lessThanOrEqual(a,b){return 0>=JSBI.__compareToBigInt(a,b)}static greaterThan(a,b){return 0=JSBI.__kMaxLengthBits)return b;const c=a+31>>>5;if(b.lengthJSBI.__kMaxLengthBits)throw new RangeError(\"BigInt too big\");return JSBI.__truncateAndSubFromPowerOfTwo(a,b,!1)}if(a>=JSBI.__kMaxLengthBits)return b;const c=a+31>>>5;if(b.length>>d)return b}return JSBI.__truncateToNBits(a,b)}static ADD(a,b){if(a=JSBI.__toPrimitive(a),b=JSBI.__toPrimitive(b),\"string\"==typeof a)return\"string\"!=typeof b&&(b=b.toString()),a+b;if(\"string\"==typeof b)return a.toString()+b;if(a=JSBI.__toNumeric(a),b=JSBI.__toNumeric(b),JSBI.__isBigInt(a)&&JSBI.__isBigInt(b))return JSBI.add(a,b);if(\"number\"==typeof a&&\"number\"==typeof b)return a+b;throw new TypeError(\"Cannot mix BigInt and other types, use explicit conversions\")}static LT(a,b){return JSBI.__compare(a,b,0)}static LE(a,b){return JSBI.__compare(a,b,1)}static GT(a,b){return JSBI.__compare(a,b,2)}static GE(a,b){return JSBI.__compare(a,b,3)}static EQ(a,b){for(;;){if(JSBI.__isBigInt(a))return JSBI.__isBigInt(b)?JSBI.equal(a,b):JSBI.EQ(b,a);if(\"number\"==typeof a){if(JSBI.__isBigInt(b))return JSBI.__equalToNumber(b,a);if(\"object\"!=typeof b)return a==b;b=JSBI.__toPrimitive(b)}else if(\"string\"==typeof a){if(JSBI.__isBigInt(b))return a=JSBI.__fromString(a),null!==a&&JSBI.equal(a,b);if(\"object\"!=typeof b)return a==b;b=JSBI.__toPrimitive(b)}else if(\"boolean\"==typeof a){if(JSBI.__isBigInt(b))return JSBI.__equalToNumber(b,+a);if(\"object\"!=typeof b)return a==b;b=JSBI.__toPrimitive(b)}else if(\"symbol\"==typeof a){if(JSBI.__isBigInt(b))return!1;if(\"object\"!=typeof b)return a==b;b=JSBI.__toPrimitive(b)}else if(\"object\"==typeof a){if(\"object\"==typeof b&&b.constructor!==JSBI)return a==b;a=JSBI.__toPrimitive(a)}else return a==b}}static NE(a,b){return!JSBI.EQ(a,b)}static __zero(){return new JSBI(0,!1)}static __oneDigit(a,b){const c=new JSBI(1,b);return c.__setDigit(0,a),c}__copy(){const a=new JSBI(this.length,this.sign);for(let b=0;bb)e=-b-1;else{if(0===c)return-1;c--,d=a.__digit(c),e=31}let f=1<>>20,c=b-1023,d=(c>>>5)+1,e=new JSBI(d,0>a);let f=1048575&JSBI.__kBitConversionInts[1]|1048576,g=JSBI.__kBitConversionInts[0];const h=20,i=31&c;let j,k=0;if(i<20){const a=h-i;k=a+32,j=f>>>a,f=f<<32-a|g>>>a,g<<=32-a}else if(i===20)k=32,j=f,f=g;else{const a=i-h;k=32-a,j=f<>>32-a,f=g<=a&&9<=a)||(159>=a?32==a:131071>=a?160==a||5760==a:196607>=a?(a&=131071,10>=a||40==a||41==a||47==a||95==a||4096==a):65279==a)}static __fromString(a,b=0){let c=0;const e=a.length;let f=0;if(f===e)return JSBI.__zero();let g=a.charCodeAt(f);for(;JSBI.__isWhitespace(g);){if(++f===e)return JSBI.__zero();g=a.charCodeAt(f)}if(43===g){if(++f===e)return null;g=a.charCodeAt(f),c=1}else if(45===g){if(++f===e)return null;g=a.charCodeAt(f),c=-1}if(0===b){if(b=10,48===g){if(++f===e)return JSBI.__zero();if(g=a.charCodeAt(f),88===g||120===g){if(b=16,++f===e)return null;g=a.charCodeAt(f)}else if(79===g||111===g){if(b=8,++f===e)return null;g=a.charCodeAt(f)}else if(66===g||98===g){if(b=2,++f===e)return null;g=a.charCodeAt(f)}}}else if(16===b&&48===g){if(++f===e)return JSBI.__zero();if(g=a.charCodeAt(f),88===g||120===g){if(++f===e)return null;g=a.charCodeAt(f)}}for(;48===g;){if(++f===e)return JSBI.__zero();g=a.charCodeAt(f)}const h=e-f;let i=JSBI.__kMaxBitsPerChar[b],j=JSBI.__kBitsPerCharTableMultiplier-1;if(h>1073741824/i)return null;const k=i*h+j>>>JSBI.__kBitsPerCharTableShift,l=new JSBI(k+31>>>5,!1),n=10>b?b:10,o=10>=JSBI.__kBitsPerCharTableShift;const b=[],c=[];let d=!1;do{let h=0,j=0;for(;;){let b;if(g-48>>>0>>0>>0>>0>>JSBI.__kBitsPerCharTableShift+5;l.__inplaceMultiplyAdd(p,k,q)}while(!c)}if(f!==e){if(!JSBI.__isWhitespace(g))return null;for(f++;f>>i-f)}if(0!==e){if(d>=a.length)throw new Error(\"implementation bug\");a.__setDigit(d++,e)}for(;d>>1)+(85&e),e=(51&e>>>2)+(51&e),e=(15&e>>>4)+(15&e);const f=e,g=b-1,h=a.__digit(d-1),i=c(h);let j=0|(32*d-i+f-1)/f;if(a.sign&&j++,268435456>>e,n=32-e;n>=f;)k[l--]=JSBI.__kConversionChars[m&g],m>>>=f,n-=f}const o=(m|h<>>f-n;0!==m;)k[l--]=JSBI.__kConversionChars[m&g],m>>>=f;if(a.sign&&(k[l--]=\"-\"),-1!=l)throw new Error(\"implementation bug\");return k.join(\"\")}static __toStringGeneric(a,b,c){var d=Math.clz32;const e=a.length;if(0===e)return\"\";if(1===e){let d=a.__unsignedDigit(0).toString(b);return!1===c&&a.sign&&(d=\"-\"+d),d}const f=32*e-d(a.__digit(e-1)),g=JSBI.__kMaxBitsPerChar[b],h=g-1;let i=f*JSBI.__kBitsPerCharTableMultiplier;i+=h-1,i=0|i/h;const j=i+1>>1,k=JSBI.exponentiate(JSBI.__oneDigit(b,!1),JSBI.__oneDigit(j,!1));let l,m;const n=k.__unsignedDigit(0);if(1===k.length&&65535>=n){l=new JSBI(a.length,!1),l.__initializeDigits();let c=0;for(let b=2*a.length-1;0<=b;b--){const d=c<<16|a.__halfDigit(b);l.__setHalfDigit(b,0|d/n),c=0|d%n}m=c.toString(b)}else{const c=JSBI.__absoluteDivLarge(a,k,!0,!0);l=c.quotient;const d=c.remainder.__trim();m=JSBI.__toStringGeneric(d,b,!0)}l.__trim();let o=JSBI.__toStringGeneric(l,b,!0);for(;m.lengthd?JSBI.__absoluteLess(c):0}static __compareToNumber(a,b){if(b|!0){const c=a.sign,d=0>b;if(c!==d)return JSBI.__unequalSign(c);if(0===a.length){if(d)throw new Error(\"implementation bug\");return 0===b?0:-1}if(1e?JSBI.__absoluteGreater(c):fb)return JSBI.__unequalSign(d);if(0===b)throw new Error(\"implementation bug: should be handled elsewhere\");if(0===a.length)return-1;JSBI.__kBitConversionDouble[0]=b;const e=2047&JSBI.__kBitConversionInts[1]>>>20;if(2047==e)throw new Error(\"implementation bug: handled elsewhere\");const f=e-1023;if(0>f)return JSBI.__absoluteGreater(d);const g=a.length;let h=a.__digit(g-1);const i=c(h),j=32*g-i,k=f+1;if(jk)return JSBI.__absoluteGreater(d);let l=1048576|1048575&JSBI.__kBitConversionInts[1],m=JSBI.__kBitConversionInts[0];const n=20,o=31-i;if(o!==(j-1)%31)throw new Error(\"implementation bug\");let p,q=0;if(20>o){const a=n-o;q=a+32,p=l>>>a,l=l<<32-a|m>>>a,m<<=32-a}else if(20===o)q=32,p=l,l=m;else{const a=o-n;q=32-a,p=l<>>32-a,l=m<>>=0,p>>>=0,h>p)return JSBI.__absoluteGreater(d);if(h>>0,l=m,m=0):p=0;const b=a.__unsignedDigit(c);if(b>p)return JSBI.__absoluteGreater(d);if(bb&&a.__unsignedDigit(0)===c(b):0===JSBI.__compareToDouble(a,b)}static __comparisonResultToBool(a,b){switch(b){case 0:return 0>a;case 1:return 0>=a;case 2:return 0b;case 3:return a>=b;}if(JSBI.__isBigInt(a)&&\"string\"==typeof b)return b=JSBI.__fromString(b),null!==b&&JSBI.__comparisonResultToBool(JSBI.__compareToBigInt(a,b),c);if(\"string\"==typeof a&&JSBI.__isBigInt(b))return a=JSBI.__fromString(a),null!==a&&JSBI.__comparisonResultToBool(JSBI.__compareToBigInt(a,b),c);if(a=JSBI.__toNumeric(a),b=JSBI.__toNumeric(b),JSBI.__isBigInt(a)){if(JSBI.__isBigInt(b))return JSBI.__comparisonResultToBool(JSBI.__compareToBigInt(a,b),c);if(\"number\"!=typeof b)throw new Error(\"implementation bug\");return JSBI.__comparisonResultToBool(JSBI.__compareToNumber(a,b),c)}if(\"number\"!=typeof a)throw new Error(\"implementation bug\");if(JSBI.__isBigInt(b))return JSBI.__comparisonResultToBool(JSBI.__compareToNumber(b,a),2^c);if(\"number\"!=typeof b)throw new Error(\"implementation bug\");return 0===c?ab:3===c?a>=b:void 0}__clzmsd(){return Math.clz32(this[this.length-1])}static __absoluteAdd(a,b,c){if(a.length>>16)+(c>>>16)+(h>>>16);f=i>>>16,e.__setDigit(g,65535&h|i<<16)}for(;g>>16)+(c>>>16);f=d>>>16,e.__setDigit(g,65535&c|d<<16)}return g>>16;const i=(c>>>16)-(g>>>16)-e;e=1&i>>>16,d.__setDigit(f,65535&h|i<<16)}for(;f>>16;const g=(b>>>16)-e;e=1&g>>>16,d.__setDigit(f,65535&c|g<<16)}return d.__trim()}static __absoluteAddOne(a,b,c=null){const d=a.length;null===c?c=new JSBI(d,b):c.sign=b;let e=!0;for(let f,g=0;gd?0:a.__unsignedDigit(d)>b.__unsignedDigit(d)?1:-1}static __multiplyAccumulate(a,b,c,d){var e=Math.imul;if(0===b)return;const f=65535&b,g=b>>>16;let h=0,j=0,k=0;for(let l=0;l>>16;const n=a.__digit(l),o=65535&n,p=n>>>16,q=e(o,f),r=e(o,g),s=e(p,f),t=e(p,g);i+=j+(65535&q),m+=k+h+(i>>>16)+(q>>>16)+(65535&r)+(65535&s),h=m>>>16,j=(r>>>16)+(s>>>16)+(65535&t)+h,h=j>>>16,j&=65535,k=t>>>16,b=65535&i|m<<16,c.__setDigit(d,b)}for(;0!=h||0!==j||0!==k;d++){let a=c.__digit(d);const b=(65535&a)+j,e=(a>>>16)+(b>>>16)+k+h;j=0,k=0,h=e>>>16,a=65535&b|e<<16,c.__setDigit(d,a)}}static __internalMultiplyAdd(a,b,c,d,e){var f=Math.imul;let g=c,h=0;for(let j=0;j>>16;const k=f(c>>>16,b),l=(65535&k)+(d>>>16)+g;g=l>>>16,h=k>>>16,e.__setDigit(j,l<<16|65535&i)}if(e.length>d)for(e.__setDigit(d++,g+h);dthis.length&&(c=this.length);const f=65535&a,g=a>>>16;let h=0,j=65535&b,k=b>>>16;for(let l=0;l>>16,d=e(b,f),i=e(b,g),m=e(c,f),n=e(c,g),o=j+(65535&d),p=k+h+(o>>>16)+(d>>>16)+(65535&i)+(65535&m);j=(i>>>16)+(m>>>16)+(65535&n)+(p>>>16),h=j>>>16,j&=65535,k=n>>>16;this.__setDigit(l,65535&o|p<<16)}if(0!=h||0!==j||0!==k)throw new Error(\"implementation bug\")}static __absoluteDivSmall(a,b,c){null===c&&(c=new JSBI(a.length,!1));let d=0;for(let e,f=2*a.length-1;0<=f;f-=2){e=(d<<16|a.__halfDigit(f))>>>0;const g=0|e/b;d=0|e%b,e=(d<<16|a.__halfDigit(f-1))>>>0;const h=0|e/b;d=0|e%b,c.__setDigit(f>>>1,g<<16|h)}return c}static __absoluteModSmall(a,b){let c=0;for(let d=2*a.length-1;0<=d;d--){const e=(c<<16|a.__halfDigit(d))>>>0;c=0|e%b}return c}static __absoluteDivLarge(a,b,d,e){var f=Math.imul;const g=b.__halfDigitLength(),h=b.length,c=a.__halfDigitLength()-g;let i=null;d&&(i=new JSBI(c+2>>>1,!1),i.__initializeDigits());const k=new JSBI(g+2>>>1,!1);k.__initializeDigits();const l=JSBI.__clz16(b.__halfDigit(g-1));0>>0;l=0|c/n;let d=0|c%n;const e=b.__halfDigit(g-2),h=m.__halfDigit(p+g-2);for(;f(l,e)>>>0>(d<<16|h)>>>0&&(l--,d+=n,!(65535>>1,o|l))}return e?(m.__inplaceRightShift(l),d?{quotient:i,remainder:m}:m):d?i:void 0}static __clz16(a){return Math.clz32(a)-16}__inplaceAdd(a,b,c){let d=0;for(let e=0;e>>16,this.__setHalfDigit(b+e,c)}return d}__inplaceSub(a,b,c){let d=0;if(1&b){b>>=1;let e=this.__digit(b),f=65535&e,g=0;for(;g>>1;g++){const c=a.__digit(g),h=(e>>>16)-(65535&c)-d;d=1&h>>>16,this.__setDigit(b+g,h<<16|65535&f),e=this.__digit(b+g+1),f=(65535&e)-(c>>>16)-d,d=1&f>>>16}const h=a.__digit(g),i=(e>>>16)-(65535&h)-d;d=1&i>>>16,this.__setDigit(b+g,i<<16|65535&f);if(b+g+1>=this.length)throw new RangeError(\"out of bounds\");0==(1&c)&&(e=this.__digit(b+g+1),f=(65535&e)-(h>>>16)-d,d=1&f>>>16,this.__setDigit(b+a.length,4294901760&e|65535&f))}else{b>>=1;let e=0;for(;e>>16;const h=(c>>>16)-(f>>>16)-d;d=1&h>>>16,this.__setDigit(b+e,h<<16|65535&g)}const f=this.__digit(b+e),g=a.__digit(e),h=(65535&f)-(65535&g)-d;d=1&h>>>16;let i=0;0==(1&c)&&(i=(f>>>16)-(g>>>16)-d,d=1&i>>>16),this.__setDigit(b+e,i<<16|65535&h)}return d}__inplaceRightShift(a){if(0===a)return;let b=this.__digit(0)>>>a;const c=this.length-1;for(let e=0;e>>a}this.__setDigit(c,b)}static __specialLeftShift(a,b,c){const d=a.length,e=new JSBI(d+c,!1);if(0===b){for(let b=0;b>>32-b}return 0c)throw new RangeError(\"BigInt too big\");const e=c>>>5,f=31&c,g=a.length,h=0!==f&&0!=a.__digit(g-1)>>>32-f,j=g+e+(h?1:0),k=new JSBI(j,a.sign);if(0===f){let b=0;for(;b>>32-f}if(h)k.__setDigit(g+e,b);else if(0!==b)throw new Error(\"implementation bug\")}return k.__trim()}static __rightShiftByAbsolute(a,b){const c=a.length,d=a.sign,e=JSBI.__toShiftAmount(b);if(0>e)return JSBI.__rightShiftByMaximum(d);const f=e>>>5,g=31&e;let h=c-f;if(0>=h)return JSBI.__rightShiftByMaximum(d);let i=!1;if(d){if(0!=(a.__digit(f)&(1<>>g;const d=c-f-1;for(let c=0;c>>g}j.__setDigit(d,b)}return i&&(j=JSBI.__absoluteAddOne(j,!0,j)),j.__trim()}static __rightShiftByMaximum(a){return a?JSBI.__oneDigit(1,!0):JSBI.__zero()}static __toShiftAmount(a){if(1JSBI.__kMaxLengthBits?-1:b}static __toPrimitive(a,b=\"default\"){if(\"object\"!=typeof a)return a;if(a.constructor===JSBI)return a;const c=a[Symbol.toPrimitive];if(c){const a=c(b);if(\"object\"!=typeof a)return a;throw new TypeError(\"Cannot convert object to primitive value\")}const d=a.valueOf;if(d){const b=d.call(a);if(\"object\"!=typeof b)return b}const e=a.toString;if(e){const b=e.call(a);if(\"object\"!=typeof b)return b}throw new TypeError(\"Cannot convert object to primitive value\")}static __toNumeric(a){return JSBI.__isBigInt(a)?a:+a}static __isBigInt(a){return\"object\"==typeof a&&a.constructor===JSBI}static __truncateToNBits(a,b){const c=a+31>>>5,d=new JSBI(c,b.sign),e=c-1;for(let c=0;c>>b}return d.__setDigit(e,f),d.__trim()}static __truncateAndSubFromPowerOfTwo(a,b,c){var d=Math.min;const e=a+31>>>5,f=new JSBI(e,c);let g=0;const h=e-1;let j=0;for(const e=d(h,b.length);g>>16;const d=0-(a>>>16)-j;j=1&d>>>16,f.__setDigit(g,65535&c|d<<16)}for(;g>>16;const b=0-(k>>>16)-j;m=65535&a|b<<16}else{const a=32-l;k=k<>>a;const b=1<<32-a,c=(65535&b)-(65535&k)-j;j=1&c>>>16;const d=(b>>>16)-(k>>>16)-j;m=65535&c|d<<16,m&=b-1}return f.__setDigit(h,m),f.__trim()}__digit(a){return this[a]}__unsignedDigit(a){return this[a]>>>0}__setDigit(a,b){this[a]=0|b}__setDigitGrow(a,b){this[a]=0|b}__halfDigitLength(){const a=this.length;return 65535>=this.__unsignedDigit(a-1)?2*a-1:2*a}__halfDigit(a){return 65535&this[a>>>1]>>>((1&a)<<4)}__setHalfDigit(a,b){const c=a>>>1,d=this.__digit(c),e=1&a?65535&d|b<<16:4294901760&d|65535&b;this.__setDigit(c,e)}static __digitPow(a,b){let c=1;for(;0>>=1,a*=a;return c}}JSBI.__kMaxLength=33554432,JSBI.__kMaxLengthBits=JSBI.__kMaxLength<<5,JSBI.__kMaxBitsPerChar=[0,0,32,51,64,75,83,90,96,102,107,111,115,119,122,126,128,131,134,136,139,141,143,145,147,149,151,153,154,156,158,159,160,162,163,165,166],JSBI.__kBitsPerCharTableShift=5,JSBI.__kBitsPerCharTableMultiplier=1< maximalLength\n ) {\n throw new Error(errorMessage);\n }\n let optionalProvidedKeys = providedKeys.filter(\n key => !expectedKeys.includes(key)\n );\n if (providedKeys.length - optionalProvidedKeys.length !== requiredLength) {\n throw new Error(errorMessage);\n }\n if (optionalProvidedKeys.find(key => !optionalKeys.includes(key))) {\n throw new Error(errorMessage);\n }\n}\n\nfunction assertHexString(debugPath, string) {\n if (!/^0x([0-9a-fA-F][0-9a-fA-F])*$/.test(string)) {\n throw new Error(`${debugPath} must be a hex string!`);\n }\n}\n\nfunction assertHash(debugPath, hash) {\n assertHexString(debugPath, hash);\n if (hash.length != 66) {\n throw new Error(`${debugPath} must be a hex string of 66 bytes long!`);\n }\n}\n\nfunction assertInteger(debugPath, i) {\n if (i === \"0x0\") {\n return;\n }\n if (!/^0x[1-9a-fA-F][0-9a-fA-F]*$/.test(i)) {\n throw new Error(`${debugPath} must be a hex integer!`);\n }\n}\n\nexport function ValidateScript(\n script,\n { nestedValidation = true, debugPath = \"script\" } = {}\n) {\n assertObjectWithKeys(\n debugPath,\n script,\n [\"code_hash\", \"hash_type\", \"args\"],\n []\n );\n assertHash(`${debugPath}.code_hash`, script.code_hash);\n assertHexString(`${debugPath}.args`, script.args);\n\n if (script.hash_type !== \"data\" && script.hash_type !== \"type\") {\n throw new Error(`${debugPath}.hash_type must be either data or type!`);\n }\n}\n\nexport function ValidateOutPoint(\n outPoint,\n { nestedValidation = true, debugPath = \"out_point\" } = {}\n) {\n assertObjectWithKeys(debugPath, outPoint, [\"tx_hash\", \"index\"], []);\n assertHash(`${debugPath}.tx_hash`, outPoint.tx_hash);\n assertInteger(`${debugPath}.index`, outPoint.index);\n}\n\nexport function ValidateCellInput(\n cellInput,\n { nestedValidation = true, debugPath = \"cell_input\" } = {}\n) {\n assertObjectWithKeys(debugPath, cellInput, [\"since\", \"previous_output\"], []);\n assertInteger(`${debugPath}.since`, cellInput.since);\n\n if (nestedValidation) {\n ValidateOutPoint(cellInput.previous_output, {\n debugPath: `${debugPath}.previous_output`\n });\n }\n}\n\nexport function ValidateCellOutput(\n cellOutput,\n { nestedValidation = true, debugPath = \"cell_output\" } = {}\n) {\n assertObjectWithKeys(debugPath, cellOutput, [\"capacity\", \"lock\"], [\"type\"]);\n assertInteger(`${debugPath}.capacity`, cellOutput.capacity);\n\n if (nestedValidation) {\n ValidateScript(cellOutput.lock, {\n debugPath: `${debugPath}.lock`\n });\n if (cellOutput.type) {\n ValidateScript(cellOutput.type, {\n debugPath: `${debugPath}.type`\n });\n }\n }\n}\n\nexport function ValidateCellDep(\n cellDep,\n { nestedValidation = true, debugPath = \"cell_dep\" } = {}\n) {\n assertObjectWithKeys(debugPath, cellDep, [\"out_point\", \"dep_type\"], []);\n if (cellDep.dep_type !== \"code\" && cellDep.dep_type !== \"dep_group\") {\n throw new Error(`${debugPath}.dep_type must be either code or dep_group!`);\n }\n\n if (nestedValidation) {\n ValidateOutPoint(cellDep.out_point, {\n debugPath: `${debugPath}.out_point`\n });\n }\n}\n\nfunction assertArray(debugPath, array, validateFunction, nestedValidation) {\n if (!Array.isArray(array)) {\n throw new Error(`${debugPath} is not an array!`);\n }\n if (nestedValidation) {\n for (let i = 0; i < array.length; i++) {\n validateFunction(`${debugPath}[${i}]`, array[i]);\n }\n }\n}\n\nfunction toAssert(validateFunction, nestedValidation) {\n return function(debugPath, value) {\n validateFunction(value, {\n nestedValidation: nestedValidation,\n debugPath: debugPath\n });\n };\n}\n\nfunction assertCommonTransaction(debugPath, rawTransaction, nestedValidation) {\n assertInteger(`${debugPath}.version`, rawTransaction.version);\n assertArray(\n `${debugPath}.cell_deps`,\n rawTransaction.cell_deps,\n toAssert(ValidateCellDep, nestedValidation),\n nestedValidation\n );\n assertArray(\n `${debugPath}.header_deps`,\n rawTransaction.header_deps,\n assertHash,\n nestedValidation\n );\n assertArray(\n `${debugPath}.inputs`,\n rawTransaction.inputs,\n toAssert(ValidateCellInput, nestedValidation),\n nestedValidation\n );\n assertArray(\n `${debugPath}.outputs`,\n rawTransaction.outputs,\n toAssert(ValidateCellOutput, nestedValidation),\n nestedValidation\n );\n assertArray(\n `${debugPath}.outputs_data`,\n rawTransaction.outputs_data,\n assertHexString,\n nestedValidation\n );\n}\n\nexport function ValidateRawTransaction(\n rawTransaction,\n { nestedValidation = true, debugPath = \"raw_transaction\" } = {}\n) {\n assertObjectWithKeys(\n debugPath,\n rawTransaction,\n [\n \"version\",\n \"cell_deps\",\n \"header_deps\",\n \"inputs\",\n \"outputs\",\n \"outputs_data\"\n ],\n []\n );\n assertCommonTransaction(debugPath, rawTransaction, nestedValidation);\n}\n\nexport function ValidateTransaction(\n transaction,\n { nestedValidation = true, debugPath = \"transaction\" } = {}\n) {\n assertObjectWithKeys(\n debugPath,\n transaction,\n [\n \"version\",\n \"cell_deps\",\n \"header_deps\",\n \"inputs\",\n \"outputs\",\n \"outputs_data\",\n \"witnesses\"\n ],\n []\n );\n assertCommonTransaction(debugPath, transaction, nestedValidation);\n assertArray(\n `${debugPath}.witnesses`,\n transaction.witnesses,\n assertHexString,\n nestedValidation\n );\n}\n\nfunction assertCommonHeader(debugPath, rawHeader) {\n assertInteger(`${debugPath}.version`, rawHeader.version);\n assertInteger(`${debugPath}.compact_target`, rawHeader.compact_target);\n assertInteger(`${debugPath}.timestamp`, rawHeader.timestamp);\n assertInteger(`${debugPath}.number`, rawHeader.number);\n assertInteger(`${debugPath}.epoch`, rawHeader.epoch);\n assertHash(`${debugPath}.parent_hash`, rawHeader.parent_hash);\n assertHash(`${debugPath}.transactions_root`, rawHeader.transactions_root);\n assertHash(`${debugPath}.proposals_hash`, rawHeader.proposals_hash);\n assertHash(`${debugPath}.uncles_hash`, rawHeader.uncles_hash);\n assertHash(`${debugPath}.dao`, rawHeader.dao);\n}\n\nexport function ValidateRawHeader(\n rawHeader,\n { nestedValidation = true, debugPath = \"raw_header\" } = {}\n) {\n assertObjectWithKeys(\n debugPath,\n rawHeader,\n [\n \"version\",\n \"compact_target\",\n \"timestamp\",\n \"number\",\n \"epoch\",\n \"parent_hash\",\n \"transactions_root\",\n \"proposals_hash\",\n \"uncles_hash\",\n \"dao\"\n ],\n []\n );\n assertCommonHeader(debugPath, rawHeader);\n}\n\nexport function ValidateHeader(\n header,\n { nestedValidation = true, debugPath = \"header\" } = {}\n) {\n assertObjectWithKeys(\n debugPath,\n header,\n [\n \"version\",\n \"compact_target\",\n \"timestamp\",\n \"number\",\n \"epoch\",\n \"parent_hash\",\n \"transactions_root\",\n \"proposals_hash\",\n \"uncles_hash\",\n \"dao\",\n \"nonce\"\n ],\n []\n );\n assertHexString(`${debugPath}.nonce`, header.nonce);\n if (header.nonce.length != 34) {\n throw new Error(\n `${debugPath}.nonce must be a hex string of 34 bytes long!`\n );\n }\n}\n\nfunction assertProposalShortId(debugPath, shortId) {\n assertHexString(debugPath, shortId);\n if (shortId.length != 22) {\n throw new Error(`${debugPath} must be a hex string of 22 bytes long!`);\n }\n}\n\nexport function ValidateUncleBlock(\n uncleBlock,\n { nestedValidation = true, debugPath = \"uncle_block\" } = {}\n) {\n assertObjectWithKeys(debugPath, uncleBlock, [\"header\", \"proposals\"], []);\n\n if (nestedValidation) {\n ValidateHeader(uncleBlock.header, {\n debugPath: `${debugPath}.header`\n });\n }\n assertArray(\n `${debugPath}.proposals`,\n uncleBlock.proposals,\n assertProposalShortId,\n nestedValidation\n );\n}\n\nexport function ValidateBlock(\n block,\n { nestedValidation = true, debugPath = \"block\" } = {}\n) {\n assertObjectWithKeys(\n debugPath,\n block,\n [\"header\", \"uncles\", \"transactions\", \"proposals\"],\n []\n );\n\n if (nestedValidation) {\n ValidateHeader(block.header, {\n debugPath: `${debugPath}.header`\n });\n }\n assertArray(\n `${debugPath}.uncles`,\n block.uncles,\n toAssert(ValidateUncleBlock, nestedValidation),\n nestedValidation\n );\n assertArray(\n `${debugPath}.transactions`,\n block.transactions,\n toAssert(ValidateTransaction, nestedValidation),\n nestedValidation\n );\n assertArray(\n `${debugPath}.proposals`,\n block.proposals,\n assertProposalShortId,\n nestedValidation\n );\n}\n\nexport function ValidateCellbaseWitness(\n cellbaseWitness,\n { nestedValidation = true, debugPath = \"cellbase_witness\" } = {}\n) {\n assertObjectWithKeys(debugPath, cellbaseWitness, [\"lock\", \"message\"], []);\n assertHexString(`${debugPath}.message`, cellbaseWitness.message);\n\n if (nestedValidation) {\n ValidateScript(cellbaseWitness.lock, {\n debugPath: `${debugPath}.lock`\n });\n }\n}\n\nexport function ValidateWitnessArgs(\n witnessArgs,\n { nestedValidation = true, debugPath = \"witness_args\" } = {}\n) {\n assertObjectWithKeys(\n debugPath,\n witnessArgs,\n [],\n [\"lock\", \"input_type\", \"output_type\"]\n );\n\n if (witnessArgs.lock) {\n assertHexString(`${debugPath}.lock`, witnessArgs.lock);\n }\n if (witnessArgs.input_type) {\n assertHexString(`${debugPath}.input_type`, witnessArgs.input_type);\n }\n if (witnessArgs.output_type) {\n assertHexString(`${debugPath}.output_type`, witnessArgs.output_type);\n }\n}\n","import Stream from 'stream';\nimport http from 'http';\nimport Url from 'url';\nimport https from 'https';\nimport zlib from 'zlib';\n\n// Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js\n\n// fix for \"Readable\" isn't a named export issue\nconst Readable = Stream.Readable;\n\nconst BUFFER = Symbol('buffer');\nconst TYPE = Symbol('type');\n\nclass Blob {\n\tconstructor() {\n\t\tthis[TYPE] = '';\n\n\t\tconst blobParts = arguments[0];\n\t\tconst options = arguments[1];\n\n\t\tconst buffers = [];\n\t\tlet size = 0;\n\n\t\tif (blobParts) {\n\t\t\tconst a = blobParts;\n\t\t\tconst length = Number(a.length);\n\t\t\tfor (let i = 0; i < length; i++) {\n\t\t\t\tconst element = a[i];\n\t\t\t\tlet buffer;\n\t\t\t\tif (element instanceof Buffer) {\n\t\t\t\t\tbuffer = element;\n\t\t\t\t} else if (ArrayBuffer.isView(element)) {\n\t\t\t\t\tbuffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength);\n\t\t\t\t} else if (element instanceof ArrayBuffer) {\n\t\t\t\t\tbuffer = Buffer.from(element);\n\t\t\t\t} else if (element instanceof Blob) {\n\t\t\t\t\tbuffer = element[BUFFER];\n\t\t\t\t} else {\n\t\t\t\t\tbuffer = Buffer.from(typeof element === 'string' ? element : String(element));\n\t\t\t\t}\n\t\t\t\tsize += buffer.length;\n\t\t\t\tbuffers.push(buffer);\n\t\t\t}\n\t\t}\n\n\t\tthis[BUFFER] = Buffer.concat(buffers);\n\n\t\tlet type = options && options.type !== undefined && String(options.type).toLowerCase();\n\t\tif (type && !/[^\\u0020-\\u007E]/.test(type)) {\n\t\t\tthis[TYPE] = type;\n\t\t}\n\t}\n\tget size() {\n\t\treturn this[BUFFER].length;\n\t}\n\tget type() {\n\t\treturn this[TYPE];\n\t}\n\ttext() {\n\t\treturn Promise.resolve(this[BUFFER].toString());\n\t}\n\tarrayBuffer() {\n\t\tconst buf = this[BUFFER];\n\t\tconst ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\treturn Promise.resolve(ab);\n\t}\n\tstream() {\n\t\tconst readable = new Readable();\n\t\treadable._read = function () {};\n\t\treadable.push(this[BUFFER]);\n\t\treadable.push(null);\n\t\treturn readable;\n\t}\n\ttoString() {\n\t\treturn '[object Blob]';\n\t}\n\tslice() {\n\t\tconst size = this.size;\n\n\t\tconst start = arguments[0];\n\t\tconst end = arguments[1];\n\t\tlet relativeStart, relativeEnd;\n\t\tif (start === undefined) {\n\t\t\trelativeStart = 0;\n\t\t} else if (start < 0) {\n\t\t\trelativeStart = Math.max(size + start, 0);\n\t\t} else {\n\t\t\trelativeStart = Math.min(start, size);\n\t\t}\n\t\tif (end === undefined) {\n\t\t\trelativeEnd = size;\n\t\t} else if (end < 0) {\n\t\t\trelativeEnd = Math.max(size + end, 0);\n\t\t} else {\n\t\t\trelativeEnd = Math.min(end, size);\n\t\t}\n\t\tconst span = Math.max(relativeEnd - relativeStart, 0);\n\n\t\tconst buffer = this[BUFFER];\n\t\tconst slicedBuffer = buffer.slice(relativeStart, relativeStart + span);\n\t\tconst blob = new Blob([], { type: arguments[2] });\n\t\tblob[BUFFER] = slicedBuffer;\n\t\treturn blob;\n\t}\n}\n\nObject.defineProperties(Blob.prototype, {\n\tsize: { enumerable: true },\n\ttype: { enumerable: true },\n\tslice: { enumerable: true }\n});\n\nObject.defineProperty(Blob.prototype, Symbol.toStringTag, {\n\tvalue: 'Blob',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\n/**\n * fetch-error.js\n *\n * FetchError interface for operational errors\n */\n\n/**\n * Create FetchError instance\n *\n * @param String message Error message for human\n * @param String type Error type for machine\n * @param String systemError For Node.js system error\n * @return FetchError\n */\nfunction FetchError(message, type, systemError) {\n Error.call(this, message);\n\n this.message = message;\n this.type = type;\n\n // when err.type is `system`, err.code contains system error code\n if (systemError) {\n this.code = this.errno = systemError.code;\n }\n\n // hide custom error implementation details from end-users\n Error.captureStackTrace(this, this.constructor);\n}\n\nFetchError.prototype = Object.create(Error.prototype);\nFetchError.prototype.constructor = FetchError;\nFetchError.prototype.name = 'FetchError';\n\nlet convert;\ntry {\n\tconvert = require('encoding').convert;\n} catch (e) {}\n\nconst INTERNALS = Symbol('Body internals');\n\n// fix an issue where \"PassThrough\" isn't a named export for node <10\nconst PassThrough = Stream.PassThrough;\n\n/**\n * Body mixin\n *\n * Ref: https://fetch.spec.whatwg.org/#body\n *\n * @param Stream body Readable stream\n * @param Object opts Response options\n * @return Void\n */\nfunction Body(body) {\n\tvar _this = this;\n\n\tvar _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n\t _ref$size = _ref.size;\n\n\tlet size = _ref$size === undefined ? 0 : _ref$size;\n\tvar _ref$timeout = _ref.timeout;\n\tlet timeout = _ref$timeout === undefined ? 0 : _ref$timeout;\n\n\tif (body == null) {\n\t\t// body is undefined or null\n\t\tbody = null;\n\t} else if (isURLSearchParams(body)) {\n\t\t// body is a URLSearchParams\n\t\tbody = Buffer.from(body.toString());\n\t} else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {\n\t\t// body is ArrayBuffer\n\t\tbody = Buffer.from(body);\n\t} else if (ArrayBuffer.isView(body)) {\n\t\t// body is ArrayBufferView\n\t\tbody = Buffer.from(body.buffer, body.byteOffset, body.byteLength);\n\t} else if (body instanceof Stream) ; else {\n\t\t// none of the above\n\t\t// coerce to string then buffer\n\t\tbody = Buffer.from(String(body));\n\t}\n\tthis[INTERNALS] = {\n\t\tbody,\n\t\tdisturbed: false,\n\t\terror: null\n\t};\n\tthis.size = size;\n\tthis.timeout = timeout;\n\n\tif (body instanceof Stream) {\n\t\tbody.on('error', function (err) {\n\t\t\tconst error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err);\n\t\t\t_this[INTERNALS].error = error;\n\t\t});\n\t}\n}\n\nBody.prototype = {\n\tget body() {\n\t\treturn this[INTERNALS].body;\n\t},\n\n\tget bodyUsed() {\n\t\treturn this[INTERNALS].disturbed;\n\t},\n\n\t/**\n * Decode response as ArrayBuffer\n *\n * @return Promise\n */\n\tarrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t},\n\n\t/**\n * Return raw response as Blob\n *\n * @return Promise\n */\n\tblob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t},\n\n\t/**\n * Decode response as json\n *\n * @return Promise\n */\n\tjson() {\n\t\tvar _this2 = this;\n\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\ttry {\n\t\t\t\treturn JSON.parse(buffer.toString());\n\t\t\t} catch (err) {\n\t\t\t\treturn Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json'));\n\t\t\t}\n\t\t});\n\t},\n\n\t/**\n * Decode response as text\n *\n * @return Promise\n */\n\ttext() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t},\n\n\t/**\n * Decode response as buffer (non-spec api)\n *\n * @return Promise\n */\n\tbuffer() {\n\t\treturn consumeBody.call(this);\n\t},\n\n\t/**\n * Decode response as text, while automatically detecting the encoding and\n * trying to decode to UTF-8 (non-spec api)\n *\n * @return Promise\n */\n\ttextConverted() {\n\t\tvar _this3 = this;\n\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn convertBody(buffer, _this3.headers);\n\t\t});\n\t}\n};\n\n// In browsers, all properties are enumerable.\nObject.defineProperties(Body.prototype, {\n\tbody: { enumerable: true },\n\tbodyUsed: { enumerable: true },\n\tarrayBuffer: { enumerable: true },\n\tblob: { enumerable: true },\n\tjson: { enumerable: true },\n\ttext: { enumerable: true }\n});\n\nBody.mixIn = function (proto) {\n\tfor (const name of Object.getOwnPropertyNames(Body.prototype)) {\n\t\t// istanbul ignore else: future proof\n\t\tif (!(name in proto)) {\n\t\t\tconst desc = Object.getOwnPropertyDescriptor(Body.prototype, name);\n\t\t\tObject.defineProperty(proto, name, desc);\n\t\t}\n\t}\n};\n\n/**\n * Consume and convert an entire Body to a Buffer.\n *\n * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body\n *\n * @return Promise\n */\nfunction consumeBody() {\n\tvar _this4 = this;\n\n\tif (this[INTERNALS].disturbed) {\n\t\treturn Body.Promise.reject(new TypeError(`body used already for: ${this.url}`));\n\t}\n\n\tthis[INTERNALS].disturbed = true;\n\n\tif (this[INTERNALS].error) {\n\t\treturn Body.Promise.reject(this[INTERNALS].error);\n\t}\n\n\tlet body = this.body;\n\n\t// body is null\n\tif (body === null) {\n\t\treturn Body.Promise.resolve(Buffer.alloc(0));\n\t}\n\n\t// body is blob\n\tif (isBlob(body)) {\n\t\tbody = body.stream();\n\t}\n\n\t// body is buffer\n\tif (Buffer.isBuffer(body)) {\n\t\treturn Body.Promise.resolve(body);\n\t}\n\n\t// istanbul ignore if: should never happen\n\tif (!(body instanceof Stream)) {\n\t\treturn Body.Promise.resolve(Buffer.alloc(0));\n\t}\n\n\t// body is stream\n\t// get ready to actually consume the body\n\tlet accum = [];\n\tlet accumBytes = 0;\n\tlet abort = false;\n\n\treturn new Body.Promise(function (resolve, reject) {\n\t\tlet resTimeout;\n\n\t\t// allow timeout on slow response body\n\t\tif (_this4.timeout) {\n\t\t\tresTimeout = setTimeout(function () {\n\t\t\t\tabort = true;\n\t\t\t\treject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout'));\n\t\t\t}, _this4.timeout);\n\t\t}\n\n\t\t// handle stream errors\n\t\tbody.on('error', function (err) {\n\t\t\tif (err.name === 'AbortError') {\n\t\t\t\t// if the request was aborted, reject with this Error\n\t\t\t\tabort = true;\n\t\t\t\treject(err);\n\t\t\t} else {\n\t\t\t\t// other errors, such as incorrect content-encoding\n\t\t\t\treject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err));\n\t\t\t}\n\t\t});\n\n\t\tbody.on('data', function (chunk) {\n\t\t\tif (abort || chunk === null) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (_this4.size && accumBytes + chunk.length > _this4.size) {\n\t\t\t\tabort = true;\n\t\t\t\treject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size'));\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\taccumBytes += chunk.length;\n\t\t\taccum.push(chunk);\n\t\t});\n\n\t\tbody.on('end', function () {\n\t\t\tif (abort) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tclearTimeout(resTimeout);\n\n\t\t\ttry {\n\t\t\t\tresolve(Buffer.concat(accum, accumBytes));\n\t\t\t} catch (err) {\n\t\t\t\t// handle streams that have accumulated too much data (issue #414)\n\t\t\t\treject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err));\n\t\t\t}\n\t\t});\n\t});\n}\n\n/**\n * Detect buffer encoding and convert to target encoding\n * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding\n *\n * @param Buffer buffer Incoming buffer\n * @param String encoding Target encoding\n * @return String\n */\nfunction convertBody(buffer, headers) {\n\tif (typeof convert !== 'function') {\n\t\tthrow new Error('The package `encoding` must be installed to use the textConverted() function');\n\t}\n\n\tconst ct = headers.get('content-type');\n\tlet charset = 'utf-8';\n\tlet res, str;\n\n\t// header\n\tif (ct) {\n\t\tres = /charset=([^;]*)/i.exec(ct);\n\t}\n\n\t// no charset in content type, peek at response body for at most 1024 bytes\n\tstr = buffer.slice(0, 1024).toString();\n\n\t// html5\n\tif (!res && str) {\n\t\tres = / 0 && arguments[0] !== undefined ? arguments[0] : undefined;\n\n\t\tthis[MAP] = Object.create(null);\n\n\t\tif (init instanceof Headers) {\n\t\t\tconst rawHeaders = init.raw();\n\t\t\tconst headerNames = Object.keys(rawHeaders);\n\n\t\t\tfor (const headerName of headerNames) {\n\t\t\t\tfor (const value of rawHeaders[headerName]) {\n\t\t\t\t\tthis.append(headerName, value);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\t// We don't worry about converting prop to ByteString here as append()\n\t\t// will handle it.\n\t\tif (init == null) ; else if (typeof init === 'object') {\n\t\t\tconst method = init[Symbol.iterator];\n\t\t\tif (method != null) {\n\t\t\t\tif (typeof method !== 'function') {\n\t\t\t\t\tthrow new TypeError('Header pairs must be iterable');\n\t\t\t\t}\n\n\t\t\t\t// sequence>\n\t\t\t\t// Note: per spec we have to first exhaust the lists then process them\n\t\t\t\tconst pairs = [];\n\t\t\t\tfor (const pair of init) {\n\t\t\t\t\tif (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') {\n\t\t\t\t\t\tthrow new TypeError('Each header pair must be iterable');\n\t\t\t\t\t}\n\t\t\t\t\tpairs.push(Array.from(pair));\n\t\t\t\t}\n\n\t\t\t\tfor (const pair of pairs) {\n\t\t\t\t\tif (pair.length !== 2) {\n\t\t\t\t\t\tthrow new TypeError('Each header pair must be a name/value tuple');\n\t\t\t\t\t}\n\t\t\t\t\tthis.append(pair[0], pair[1]);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// record\n\t\t\t\tfor (const key of Object.keys(init)) {\n\t\t\t\t\tconst value = init[key];\n\t\t\t\t\tthis.append(key, value);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new TypeError('Provided initializer must be an object');\n\t\t}\n\t}\n\n\t/**\n * Return combined header value given name\n *\n * @param String name Header name\n * @return Mixed\n */\n\tget(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\tconst key = find(this[MAP], name);\n\t\tif (key === undefined) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn this[MAP][key].join(', ');\n\t}\n\n\t/**\n * Iterate over all headers\n *\n * @param Function callback Executed for each item with parameters (value, name, thisArg)\n * @param Boolean thisArg `this` context for callback function\n * @return Void\n */\n\tforEach(callback) {\n\t\tlet thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;\n\n\t\tlet pairs = getHeaders(this);\n\t\tlet i = 0;\n\t\twhile (i < pairs.length) {\n\t\t\tvar _pairs$i = pairs[i];\n\t\t\tconst name = _pairs$i[0],\n\t\t\t value = _pairs$i[1];\n\n\t\t\tcallback.call(thisArg, value, name, this);\n\t\t\tpairs = getHeaders(this);\n\t\t\ti++;\n\t\t}\n\t}\n\n\t/**\n * Overwrite header values given name\n *\n * @param String name Header name\n * @param String value Header value\n * @return Void\n */\n\tset(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}\n\n\t/**\n * Append a value onto existing header\n *\n * @param String name Header name\n * @param String value Header value\n * @return Void\n */\n\tappend(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tif (key !== undefined) {\n\t\t\tthis[MAP][key].push(value);\n\t\t} else {\n\t\t\tthis[MAP][name] = [value];\n\t\t}\n\t}\n\n\t/**\n * Check for header name existence\n *\n * @param String name Header name\n * @return Boolean\n */\n\thas(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\treturn find(this[MAP], name) !== undefined;\n\t}\n\n\t/**\n * Delete all header values given name\n *\n * @param String name Header name\n * @return Void\n */\n\tdelete(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\tconst key = find(this[MAP], name);\n\t\tif (key !== undefined) {\n\t\t\tdelete this[MAP][key];\n\t\t}\n\t}\n\n\t/**\n * Return raw headers (non-spec api)\n *\n * @return Object\n */\n\traw() {\n\t\treturn this[MAP];\n\t}\n\n\t/**\n * Get an iterator on keys.\n *\n * @return Iterator\n */\n\tkeys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}\n\n\t/**\n * Get an iterator on values.\n *\n * @return Iterator\n */\n\tvalues() {\n\t\treturn createHeadersIterator(this, 'value');\n\t}\n\n\t/**\n * Get an iterator on entries.\n *\n * This is the default iterator of the Headers object.\n *\n * @return Iterator\n */\n\t[Symbol.iterator]() {\n\t\treturn createHeadersIterator(this, 'key+value');\n\t}\n}\nHeaders.prototype.entries = Headers.prototype[Symbol.iterator];\n\nObject.defineProperty(Headers.prototype, Symbol.toStringTag, {\n\tvalue: 'Headers',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\nObject.defineProperties(Headers.prototype, {\n\tget: { enumerable: true },\n\tforEach: { enumerable: true },\n\tset: { enumerable: true },\n\tappend: { enumerable: true },\n\thas: { enumerable: true },\n\tdelete: { enumerable: true },\n\tkeys: { enumerable: true },\n\tvalues: { enumerable: true },\n\tentries: { enumerable: true }\n});\n\nfunction getHeaders(headers) {\n\tlet kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value';\n\n\tconst keys = Object.keys(headers[MAP]).sort();\n\treturn keys.map(kind === 'key' ? function (k) {\n\t\treturn k.toLowerCase();\n\t} : kind === 'value' ? function (k) {\n\t\treturn headers[MAP][k].join(', ');\n\t} : function (k) {\n\t\treturn [k.toLowerCase(), headers[MAP][k].join(', ')];\n\t});\n}\n\nconst INTERNAL = Symbol('internal');\n\nfunction createHeadersIterator(target, kind) {\n\tconst iterator = Object.create(HeadersIteratorPrototype);\n\titerator[INTERNAL] = {\n\t\ttarget,\n\t\tkind,\n\t\tindex: 0\n\t};\n\treturn iterator;\n}\n\nconst HeadersIteratorPrototype = Object.setPrototypeOf({\n\tnext() {\n\t\t// istanbul ignore if\n\t\tif (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) {\n\t\t\tthrow new TypeError('Value of `this` is not a HeadersIterator');\n\t\t}\n\n\t\tvar _INTERNAL = this[INTERNAL];\n\t\tconst target = _INTERNAL.target,\n\t\t kind = _INTERNAL.kind,\n\t\t index = _INTERNAL.index;\n\n\t\tconst values = getHeaders(target, kind);\n\t\tconst len = values.length;\n\t\tif (index >= len) {\n\t\t\treturn {\n\t\t\t\tvalue: undefined,\n\t\t\t\tdone: true\n\t\t\t};\n\t\t}\n\n\t\tthis[INTERNAL].index = index + 1;\n\n\t\treturn {\n\t\t\tvalue: values[index],\n\t\t\tdone: false\n\t\t};\n\t}\n}, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));\n\nObject.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, {\n\tvalue: 'HeadersIterator',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\n/**\n * Export the Headers object in a form that Node.js can consume.\n *\n * @param Headers headers\n * @return Object\n */\nfunction exportNodeCompatibleHeaders(headers) {\n\tconst obj = Object.assign({ __proto__: null }, headers[MAP]);\n\n\t// http.request() only supports string as Host header. This hack makes\n\t// specifying custom Host header possible.\n\tconst hostHeaderKey = find(headers[MAP], 'Host');\n\tif (hostHeaderKey !== undefined) {\n\t\tobj[hostHeaderKey] = obj[hostHeaderKey][0];\n\t}\n\n\treturn obj;\n}\n\n/**\n * Create a Headers object from an object of headers, ignoring those that do\n * not conform to HTTP grammar productions.\n *\n * @param Object obj Object of headers\n * @return Headers\n */\nfunction createHeadersLenient(obj) {\n\tconst headers = new Headers();\n\tfor (const name of Object.keys(obj)) {\n\t\tif (invalidTokenRegex.test(name)) {\n\t\t\tcontinue;\n\t\t}\n\t\tif (Array.isArray(obj[name])) {\n\t\t\tfor (const val of obj[name]) {\n\t\t\t\tif (invalidHeaderCharRegex.test(val)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (headers[MAP][name] === undefined) {\n\t\t\t\t\theaders[MAP][name] = [val];\n\t\t\t\t} else {\n\t\t\t\t\theaders[MAP][name].push(val);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (!invalidHeaderCharRegex.test(obj[name])) {\n\t\t\theaders[MAP][name] = [obj[name]];\n\t\t}\n\t}\n\treturn headers;\n}\n\nconst INTERNALS$1 = Symbol('Response internals');\n\n// fix an issue where \"STATUS_CODES\" aren't a named export for node <10\nconst STATUS_CODES = http.STATUS_CODES;\n\n/**\n * Response class\n *\n * @param Stream body Readable stream\n * @param Object opts Response options\n * @return Void\n */\nclass Response {\n\tconstructor() {\n\t\tlet body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n\t\tlet opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n\t\tBody.call(this, body, opts);\n\n\t\tconst status = opts.status || 200;\n\t\tconst headers = new Headers(opts.headers);\n\n\t\tif (body != null && !headers.has('Content-Type')) {\n\t\t\tconst contentType = extractContentType(body);\n\t\t\tif (contentType) {\n\t\t\t\theaders.append('Content-Type', contentType);\n\t\t\t}\n\t\t}\n\n\t\tthis[INTERNALS$1] = {\n\t\t\turl: opts.url,\n\t\t\tstatus,\n\t\t\tstatusText: opts.statusText || STATUS_CODES[status],\n\t\t\theaders,\n\t\t\tcounter: opts.counter\n\t\t};\n\t}\n\n\tget url() {\n\t\treturn this[INTERNALS$1].url || '';\n\t}\n\n\tget status() {\n\t\treturn this[INTERNALS$1].status;\n\t}\n\n\t/**\n * Convenience property representing if the request ended normally\n */\n\tget ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}\n\n\tget redirected() {\n\t\treturn this[INTERNALS$1].counter > 0;\n\t}\n\n\tget statusText() {\n\t\treturn this[INTERNALS$1].statusText;\n\t}\n\n\tget headers() {\n\t\treturn this[INTERNALS$1].headers;\n\t}\n\n\t/**\n * Clone this response\n *\n * @return Response\n */\n\tclone() {\n\t\treturn new Response(clone(this), {\n\t\t\turl: this.url,\n\t\t\tstatus: this.status,\n\t\t\tstatusText: this.statusText,\n\t\t\theaders: this.headers,\n\t\t\tok: this.ok,\n\t\t\tredirected: this.redirected\n\t\t});\n\t}\n}\n\nBody.mixIn(Response.prototype);\n\nObject.defineProperties(Response.prototype, {\n\turl: { enumerable: true },\n\tstatus: { enumerable: true },\n\tok: { enumerable: true },\n\tredirected: { enumerable: true },\n\tstatusText: { enumerable: true },\n\theaders: { enumerable: true },\n\tclone: { enumerable: true }\n});\n\nObject.defineProperty(Response.prototype, Symbol.toStringTag, {\n\tvalue: 'Response',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\nconst INTERNALS$2 = Symbol('Request internals');\n\n// fix an issue where \"format\", \"parse\" aren't a named export for node <10\nconst parse_url = Url.parse;\nconst format_url = Url.format;\n\nconst streamDestructionSupported = 'destroy' in Stream.Readable.prototype;\n\n/**\n * Check if a value is an instance of Request.\n *\n * @param Mixed input\n * @return Boolean\n */\nfunction isRequest(input) {\n\treturn typeof input === 'object' && typeof input[INTERNALS$2] === 'object';\n}\n\nfunction isAbortSignal(signal) {\n\tconst proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal);\n\treturn !!(proto && proto.constructor.name === 'AbortSignal');\n}\n\n/**\n * Request class\n *\n * @param Mixed input Url or Request instance\n * @param Object init Custom options\n * @return Void\n */\nclass Request {\n\tconstructor(input) {\n\t\tlet init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n\t\tlet parsedURL;\n\n\t\t// normalize input\n\t\tif (!isRequest(input)) {\n\t\t\tif (input && input.href) {\n\t\t\t\t// in order to support Node.js' Url objects; though WHATWG's URL objects\n\t\t\t\t// will fall into this branch also (since their `toString()` will return\n\t\t\t\t// `href` property anyway)\n\t\t\t\tparsedURL = parse_url(input.href);\n\t\t\t} else {\n\t\t\t\t// coerce input to a string before attempting to parse\n\t\t\t\tparsedURL = parse_url(`${input}`);\n\t\t\t}\n\t\t\tinput = {};\n\t\t} else {\n\t\t\tparsedURL = parse_url(input.url);\n\t\t}\n\n\t\tlet method = init.method || input.method || 'GET';\n\t\tmethod = method.toUpperCase();\n\n\t\tif ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) {\n\t\t\tthrow new TypeError('Request with GET/HEAD method cannot have body');\n\t\t}\n\n\t\tlet inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null;\n\n\t\tBody.call(this, inputBody, {\n\t\t\ttimeout: init.timeout || input.timeout || 0,\n\t\t\tsize: init.size || input.size || 0\n\t\t});\n\n\t\tconst headers = new Headers(init.headers || input.headers || {});\n\n\t\tif (inputBody != null && !headers.has('Content-Type')) {\n\t\t\tconst contentType = extractContentType(inputBody);\n\t\t\tif (contentType) {\n\t\t\t\theaders.append('Content-Type', contentType);\n\t\t\t}\n\t\t}\n\n\t\tlet signal = isRequest(input) ? input.signal : null;\n\t\tif ('signal' in init) signal = init.signal;\n\n\t\tif (signal != null && !isAbortSignal(signal)) {\n\t\t\tthrow new TypeError('Expected signal to be an instanceof AbortSignal');\n\t\t}\n\n\t\tthis[INTERNALS$2] = {\n\t\t\tmethod,\n\t\t\tredirect: init.redirect || input.redirect || 'follow',\n\t\t\theaders,\n\t\t\tparsedURL,\n\t\t\tsignal\n\t\t};\n\n\t\t// node-fetch-only options\n\t\tthis.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20;\n\t\tthis.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true;\n\t\tthis.counter = init.counter || input.counter || 0;\n\t\tthis.agent = init.agent || input.agent;\n\t}\n\n\tget method() {\n\t\treturn this[INTERNALS$2].method;\n\t}\n\n\tget url() {\n\t\treturn format_url(this[INTERNALS$2].parsedURL);\n\t}\n\n\tget headers() {\n\t\treturn this[INTERNALS$2].headers;\n\t}\n\n\tget redirect() {\n\t\treturn this[INTERNALS$2].redirect;\n\t}\n\n\tget signal() {\n\t\treturn this[INTERNALS$2].signal;\n\t}\n\n\t/**\n * Clone this request\n *\n * @return Request\n */\n\tclone() {\n\t\treturn new Request(this);\n\t}\n}\n\nBody.mixIn(Request.prototype);\n\nObject.defineProperty(Request.prototype, Symbol.toStringTag, {\n\tvalue: 'Request',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\nObject.defineProperties(Request.prototype, {\n\tmethod: { enumerable: true },\n\turl: { enumerable: true },\n\theaders: { enumerable: true },\n\tredirect: { enumerable: true },\n\tclone: { enumerable: true },\n\tsignal: { enumerable: true }\n});\n\n/**\n * Convert a Request to Node.js http request options.\n *\n * @param Request A Request instance\n * @return Object The options object to be passed to http.request\n */\nfunction getNodeRequestOptions(request) {\n\tconst parsedURL = request[INTERNALS$2].parsedURL;\n\tconst headers = new Headers(request[INTERNALS$2].headers);\n\n\t// fetch step 1.3\n\tif (!headers.has('Accept')) {\n\t\theaders.set('Accept', '*/*');\n\t}\n\n\t// Basic fetch\n\tif (!parsedURL.protocol || !parsedURL.hostname) {\n\t\tthrow new TypeError('Only absolute URLs are supported');\n\t}\n\n\tif (!/^https?:$/.test(parsedURL.protocol)) {\n\t\tthrow new TypeError('Only HTTP(S) protocols are supported');\n\t}\n\n\tif (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) {\n\t\tthrow new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8');\n\t}\n\n\t// HTTP-network-or-cache fetch steps 2.4-2.7\n\tlet contentLengthValue = null;\n\tif (request.body == null && /^(POST|PUT)$/i.test(request.method)) {\n\t\tcontentLengthValue = '0';\n\t}\n\tif (request.body != null) {\n\t\tconst totalBytes = getTotalBytes(request);\n\t\tif (typeof totalBytes === 'number') {\n\t\t\tcontentLengthValue = String(totalBytes);\n\t\t}\n\t}\n\tif (contentLengthValue) {\n\t\theaders.set('Content-Length', contentLengthValue);\n\t}\n\n\t// HTTP-network-or-cache fetch step 2.11\n\tif (!headers.has('User-Agent')) {\n\t\theaders.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)');\n\t}\n\n\t// HTTP-network-or-cache fetch step 2.15\n\tif (request.compress && !headers.has('Accept-Encoding')) {\n\t\theaders.set('Accept-Encoding', 'gzip,deflate');\n\t}\n\n\tlet agent = request.agent;\n\tif (typeof agent === 'function') {\n\t\tagent = agent(parsedURL);\n\t}\n\n\tif (!headers.has('Connection') && !agent) {\n\t\theaders.set('Connection', 'close');\n\t}\n\n\t// HTTP-network fetch step 4.2\n\t// chunked encoding is handled by Node.js\n\n\treturn Object.assign({}, parsedURL, {\n\t\tmethod: request.method,\n\t\theaders: exportNodeCompatibleHeaders(headers),\n\t\tagent\n\t});\n}\n\n/**\n * abort-error.js\n *\n * AbortError interface for cancelled requests\n */\n\n/**\n * Create AbortError instance\n *\n * @param String message Error message for human\n * @return AbortError\n */\nfunction AbortError(message) {\n Error.call(this, message);\n\n this.type = 'aborted';\n this.message = message;\n\n // hide custom error implementation details from end-users\n Error.captureStackTrace(this, this.constructor);\n}\n\nAbortError.prototype = Object.create(Error.prototype);\nAbortError.prototype.constructor = AbortError;\nAbortError.prototype.name = 'AbortError';\n\n// fix an issue where \"PassThrough\", \"resolve\" aren't a named export for node <10\nconst PassThrough$1 = Stream.PassThrough;\nconst resolve_url = Url.resolve;\n\n/**\n * Fetch function\n *\n * @param Mixed url Absolute url or Request instance\n * @param Object opts Fetch options\n * @return Promise\n */\nfunction fetch(url, opts) {\n\n\t// allow custom promise\n\tif (!fetch.Promise) {\n\t\tthrow new Error('native promise missing, set fetch.Promise to your favorite alternative');\n\t}\n\n\tBody.Promise = fetch.Promise;\n\n\t// wrap http.request into fetch\n\treturn new fetch.Promise(function (resolve, reject) {\n\t\t// build request object\n\t\tconst request = new Request(url, opts);\n\t\tconst options = getNodeRequestOptions(request);\n\n\t\tconst send = (options.protocol === 'https:' ? https : http).request;\n\t\tconst signal = request.signal;\n\n\t\tlet response = null;\n\n\t\tconst abort = function abort() {\n\t\t\tlet error = new AbortError('The user aborted a request.');\n\t\t\treject(error);\n\t\t\tif (request.body && request.body instanceof Stream.Readable) {\n\t\t\t\trequest.body.destroy(error);\n\t\t\t}\n\t\t\tif (!response || !response.body) return;\n\t\t\tresponse.body.emit('error', error);\n\t\t};\n\n\t\tif (signal && signal.aborted) {\n\t\t\tabort();\n\t\t\treturn;\n\t\t}\n\n\t\tconst abortAndFinalize = function abortAndFinalize() {\n\t\t\tabort();\n\t\t\tfinalize();\n\t\t};\n\n\t\t// send request\n\t\tconst req = send(options);\n\t\tlet reqTimeout;\n\n\t\tif (signal) {\n\t\t\tsignal.addEventListener('abort', abortAndFinalize);\n\t\t}\n\n\t\tfunction finalize() {\n\t\t\treq.abort();\n\t\t\tif (signal) signal.removeEventListener('abort', abortAndFinalize);\n\t\t\tclearTimeout(reqTimeout);\n\t\t}\n\n\t\tif (request.timeout) {\n\t\t\treq.once('socket', function (socket) {\n\t\t\t\treqTimeout = setTimeout(function () {\n\t\t\t\t\treject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout'));\n\t\t\t\t\tfinalize();\n\t\t\t\t}, request.timeout);\n\t\t\t});\n\t\t}\n\n\t\treq.on('error', function (err) {\n\t\t\treject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));\n\t\t\tfinalize();\n\t\t});\n\n\t\treq.on('response', function (res) {\n\t\t\tclearTimeout(reqTimeout);\n\n\t\t\tconst headers = createHeadersLenient(res.headers);\n\n\t\t\t// HTTP fetch step 5\n\t\t\tif (fetch.isRedirect(res.statusCode)) {\n\t\t\t\t// HTTP fetch step 5.2\n\t\t\t\tconst location = headers.get('Location');\n\n\t\t\t\t// HTTP fetch step 5.3\n\t\t\t\tconst locationURL = location === null ? null : resolve_url(request.url, location);\n\n\t\t\t\t// HTTP fetch step 5.5\n\t\t\t\tswitch (request.redirect) {\n\t\t\t\t\tcase 'error':\n\t\t\t\t\t\treject(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${request.url}`, 'no-redirect'));\n\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\treturn;\n\t\t\t\t\tcase 'manual':\n\t\t\t\t\t\t// node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL.\n\t\t\t\t\t\tif (locationURL !== null) {\n\t\t\t\t\t\t\t// handle corrupted header\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\theaders.set('Location', locationURL);\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\t// istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request\n\t\t\t\t\t\t\t\treject(err);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'follow':\n\t\t\t\t\t\t// HTTP-redirect fetch step 2\n\t\t\t\t\t\tif (locationURL === null) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 5\n\t\t\t\t\t\tif (request.counter >= request.follow) {\n\t\t\t\t\t\t\treject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect'));\n\t\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 6 (counter increment)\n\t\t\t\t\t\t// Create a new Request object.\n\t\t\t\t\t\tconst requestOpts = {\n\t\t\t\t\t\t\theaders: new Headers(request.headers),\n\t\t\t\t\t\t\tfollow: request.follow,\n\t\t\t\t\t\t\tcounter: request.counter + 1,\n\t\t\t\t\t\t\tagent: request.agent,\n\t\t\t\t\t\t\tcompress: request.compress,\n\t\t\t\t\t\t\tmethod: request.method,\n\t\t\t\t\t\t\tbody: request.body,\n\t\t\t\t\t\t\tsignal: request.signal,\n\t\t\t\t\t\t\ttimeout: request.timeout,\n\t\t\t\t\t\t\tsize: request.size\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 9\n\t\t\t\t\t\tif (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {\n\t\t\t\t\t\t\treject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));\n\t\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 11\n\t\t\t\t\t\tif (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') {\n\t\t\t\t\t\t\trequestOpts.method = 'GET';\n\t\t\t\t\t\t\trequestOpts.body = undefined;\n\t\t\t\t\t\t\trequestOpts.headers.delete('content-length');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 15\n\t\t\t\t\t\tresolve(fetch(new Request(locationURL, requestOpts)));\n\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// prepare response\n\t\t\tres.once('end', function () {\n\t\t\t\tif (signal) signal.removeEventListener('abort', abortAndFinalize);\n\t\t\t});\n\t\t\tlet body = res.pipe(new PassThrough$1());\n\n\t\t\tconst response_options = {\n\t\t\t\turl: request.url,\n\t\t\t\tstatus: res.statusCode,\n\t\t\t\tstatusText: res.statusMessage,\n\t\t\t\theaders: headers,\n\t\t\t\tsize: request.size,\n\t\t\t\ttimeout: request.timeout,\n\t\t\t\tcounter: request.counter\n\t\t\t};\n\n\t\t\t// HTTP-network fetch step 12.1.1.3\n\t\t\tconst codings = headers.get('Content-Encoding');\n\n\t\t\t// HTTP-network fetch step 12.1.1.4: handle content codings\n\n\t\t\t// in following scenarios we ignore compression support\n\t\t\t// 1. compression support is disabled\n\t\t\t// 2. HEAD request\n\t\t\t// 3. no Content-Encoding header\n\t\t\t// 4. no content response (204)\n\t\t\t// 5. content not modified response (304)\n\t\t\tif (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) {\n\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// For Node v6+\n\t\t\t// Be less strict when decoding compressed responses, since sometimes\n\t\t\t// servers send slightly invalid responses that are still accepted\n\t\t\t// by common browsers.\n\t\t\t// Always using Z_SYNC_FLUSH is what cURL does.\n\t\t\tconst zlibOptions = {\n\t\t\t\tflush: zlib.Z_SYNC_FLUSH,\n\t\t\t\tfinishFlush: zlib.Z_SYNC_FLUSH\n\t\t\t};\n\n\t\t\t// for gzip\n\t\t\tif (codings == 'gzip' || codings == 'x-gzip') {\n\t\t\t\tbody = body.pipe(zlib.createGunzip(zlibOptions));\n\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// for deflate\n\t\t\tif (codings == 'deflate' || codings == 'x-deflate') {\n\t\t\t\t// handle the infamous raw deflate response from old servers\n\t\t\t\t// a hack for old IIS and Apache servers\n\t\t\t\tconst raw = res.pipe(new PassThrough$1());\n\t\t\t\traw.once('data', function (chunk) {\n\t\t\t\t\t// see http://stackoverflow.com/questions/37519828\n\t\t\t\t\tif ((chunk[0] & 0x0F) === 0x08) {\n\t\t\t\t\t\tbody = body.pipe(zlib.createInflate());\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbody = body.pipe(zlib.createInflateRaw());\n\t\t\t\t\t}\n\t\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\t\tresolve(response);\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// for br\n\t\t\tif (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') {\n\t\t\t\tbody = body.pipe(zlib.createBrotliDecompress());\n\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// otherwise, use response as-is\n\t\t\tresponse = new Response(body, response_options);\n\t\t\tresolve(response);\n\t\t});\n\n\t\twriteToStream(req, request);\n\t});\n}\n/**\n * Redirect code matching\n *\n * @param Number code Status code\n * @return Boolean\n */\nfetch.isRedirect = function (code) {\n\treturn code === 301 || code === 302 || code === 303 || code === 307 || code === 308;\n};\n\n// expose Promise\nfetch.Promise = global.Promise;\n\nexport default fetch;\nexport { Headers, Request, Response, FetchError };\n","var nodeFetch = require('node-fetch')\nvar realFetch = nodeFetch.default || nodeFetch\n\nvar fetch = function (url, options) {\n // Support schemaless URIs on the server for parity with the browser.\n // Ex: //github.com/ -> https://github.com/\n if (/^\\/\\//.test(url)) {\n url = 'https:' + url\n }\n return realFetch.call(this, url, options)\n}\n\nmodule.exports = exports = fetch\nexports.fetch = fetch\nexports.Headers = nodeFetch.Headers\nexports.Request = nodeFetch.Request\nexports.Response = nodeFetch.Response\n\n// Needed for TypeScript consumers without esModuleInterop.\nexports.default = fetch\n","import fetch from \"cross-fetch\";\nimport JSBI from \"jsbi\";\n\nfunction mergeOptions(overrideOptions, defaultOptions) {\n defaultOptions = defaultOptions || {};\n const headers = Object.assign(\n {},\n defaultOptions.headers || {},\n overrideOptions.headers || {}\n );\n return Object.assign({}, defaultOptions, overrideOptions, {\n headers: headers\n });\n}\n\nconst batchHandler = {\n get: (target, method, receiver) => {\n if (method === \"send\") {\n return async () => {\n const response = await fetch(\n target.uri,\n mergeOptions(\n {\n method: \"post\",\n headers: {\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify(target.payload)\n },\n target.defaultOptions\n )\n );\n return await response.json();\n };\n }\n return (...params) => {\n const id = target.id;\n target.id = target.id + 1;\n target.payload.push({\n jsonrpc: \"2.0\",\n id: id,\n method: method,\n params: params\n });\n return receiver;\n };\n }\n};\n\nconst handler = {\n get: (target, method) => {\n if (method === \"batch\") {\n return () => {\n return new Proxy(\n {\n id: Math.round(Math.random() * 10000000),\n payload: [],\n uri: target.uri,\n defaultOptions: target.defaultOptions\n },\n batchHandler\n );\n };\n }\n return async (...params) => {\n const id = Math.round(Math.random() * 10000000);\n const response = await fetch(\n target.uri,\n mergeOptions(\n {\n method: \"post\",\n headers: {\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({\n jsonrpc: \"2.0\",\n id: id,\n method: method,\n params: params\n })\n },\n target.defaultOptions\n )\n );\n const data = await response.json();\n if (data.id !== id) {\n throw new Error(\"JSONRPCError: response ID does not match request ID!\");\n }\n if (data.error) {\n throw new Error(\n `JSONRPCError: server error ${JSON.stringify(data.error)}`\n );\n }\n return data.result;\n };\n }\n};\n\nexport class RPC {\n constructor(uri, defaultOptions = {}) {\n this.uri = uri;\n this.defaultOptions = defaultOptions;\n return new Proxy(this, handler);\n }\n\n static create(uri) {\n return new RPC(uri);\n }\n}\n\nexport function HexStringToBigInt(hexString) {\n return JSBI.BigInt(hexString);\n}\n\nexport function BigIntToHexString(bigInt) {\n return \"0x\" + bigInt.toString(16);\n}\n","// This package provides normalizer functions. Even though CKB uses molecule\n// as the serialization layer. There is still CKB specific knowledge that does\n// not belong in molecule. For example, all numbers in CKB protocols are\n// serialized using little endian format. This package tries to encode such\n// knowledge. The goal here, is that you are free to use whatever types that\n// makes most sense to represent the values. As long as you pass your object\n// through the normalizers here, molecule should be able to serialize the values\n// into correct formats required by CKB.\n//\n// Note this is only used when you need to deal with CKB structures in molecule\n// format. If you are using RPCs or GraphQL to interact with CKB, chances are you\n// will not need this package.\nimport JSBI from \"jsbi\";\nimport { Reader } from \"./reader\";\nimport { BigIntToHexString } from \"./rpc\";\n\nfunction normalizeHexNumber(length) {\n return function(debugPath, value) {\n if (!(value instanceof ArrayBuffer)) {\n let intValue = BigIntToHexString(JSBI.BigInt(value)).substr(2);\n if (intValue.length % 2 !== 0) {\n intValue = \"0\" + intValue;\n }\n if (intValue.length / 2 > length) {\n throw new Error(\n `${debugPath} is ${intValue.length /\n 2} bytes long, expected length is ${length}!`\n );\n }\n const view = new DataView(new ArrayBuffer(length));\n for (let i = 0; i < intValue.length / 2; i++) {\n const start = intValue.length - (i + 1) * 2;\n view.setUint8(i, parseInt(intValue.substr(start, 2), 16));\n }\n value = view.buffer;\n }\n if (value.byteLength < length) {\n const array = new Uint8Array(length);\n array.set(new Uint8Array(value), 0);\n value = array.buffer;\n }\n return value;\n };\n}\n\nfunction normalizeRawData(length) {\n return function(debugPath, value) {\n value = new Reader(value).toArrayBuffer();\n if (length > 0 && value.byteLength !== length) {\n throw new Error(\n `${debugPath} has invalid length ${value.byteLength}, required: ${length}`\n );\n }\n return value;\n };\n}\n\nfunction normalizeObject(debugPath, object, keys) {\n const result = {};\n\n for (const [key, f] of Object.entries(keys)) {\n const value = object[key];\n if (!value) {\n throw new Error(`${debugPath} is missing ${key}!`);\n }\n result[key] = f(`${debugPath}.${key}`, value);\n }\n return result;\n}\n\nexport function NormalizeScript(script, { debugPath = \"script\" } = {}) {\n return normalizeObject(debugPath, script, {\n code_hash: normalizeRawData(32),\n hash_type: function(debugPath, value) {\n switch (value) {\n case \"data\":\n return 0;\n case \"type\":\n return 1;\n case 0:\n return value;\n case 1:\n return value;\n default:\n throw new Error(`${debugPath}.hash_type has invalid value: ${value}`);\n }\n },\n args: normalizeRawData(-1)\n });\n}\n\nexport function NormalizeOutPoint(outPoint, { debugPath = \"out_point\" } = {}) {\n return normalizeObject(debugPath, outPoint, {\n tx_hash: normalizeRawData(32),\n index: normalizeHexNumber(4)\n });\n}\n\nfunction toNormalize(normalize) {\n return function(debugPath, value) {\n return normalize(value, {\n debugPath\n });\n };\n}\n\nexport function NormalizeCellInput(\n cellInput,\n { debugPath = \"cell_input\" } = {}\n) {\n return normalizeObject(debugPath, cellInput, {\n since: normalizeHexNumber(8),\n previous_output: toNormalize(NormalizeOutPoint)\n });\n}\n\nexport function NormalizeCellOutput(\n cellOutput,\n { debugPath = \"cell_output\" } = {}\n) {\n const result = normalizeObject(debugPath, cellOutput, {\n capacity: normalizeHexNumber(8),\n lock: toNormalize(NormalizeScript)\n });\n if (cellOutput.type) {\n result.type_ = NormalizeScript(cellOutput.type, {\n debugPath: `${debugPath}.type`\n });\n }\n return result;\n}\n\nexport function NormalizeCellDep(cellDep, { debugPath = \"cell_dep\" } = {}) {\n return normalizeObject(debugPath, cellDep, {\n out_point: toNormalize(NormalizeOutPoint),\n dep_type: function(debugPath, value) {\n switch (value) {\n case \"code\":\n return 0;\n case \"dep_group\":\n return 1;\n case 0:\n return value;\n case 1:\n return value;\n default:\n throw new Error(`${debugPath}.dep_type has invalid value: ${value}`);\n }\n }\n });\n}\n\nfunction toNormalizeArray(normalizeFunction) {\n return function(debugPath, array) {\n return array.map((item, i) => {\n return normalizeFunction(`${debugPath}[${i}]`, item);\n });\n };\n}\n\nexport function NormalizeRawTransaction(\n rawTransaction,\n { debugPath = \"raw_transaction\" } = {}\n) {\n return normalizeObject(debugPath, rawTransaction, {\n version: normalizeHexNumber(4),\n cell_deps: toNormalizeArray(toNormalize(NormalizeCellDep)),\n header_deps: toNormalizeArray(normalizeRawData(32)),\n inputs: toNormalizeArray(toNormalize(NormalizeCellInput)),\n outputs: toNormalizeArray(toNormalize(NormalizeCellOutput)),\n outputs_data: toNormalizeArray(normalizeRawData(-1))\n });\n}\n\nexport function NormalizeTransaction(\n transaction,\n { debugPath = \"transaction\" } = {}\n) {\n const rawTransaction = NormalizeRawTransaction(transaction, {\n debugPath: `(raw)${debugPath}`\n });\n const result = normalizeObject(debugPath, transaction, {\n witnesses: toNormalizeArray(normalizeRawData(-1))\n });\n result.raw = rawTransaction;\n return result;\n}\n\nexport function NormalizeRawHeader(\n rawHeader,\n { debugPath = \"raw_header\" } = {}\n) {\n return normalizeObject(debugPath, rawHeader, {\n version: normalizeHexNumber(4),\n compact_target: normalizeHexNumber(4),\n timestamp: normalizeHexNumber(8),\n number: normalizeHexNumber(8),\n epoch: normalizeHexNumber(8),\n parent_hash: normalizeRawData(32),\n transactions_root: normalizeRawData(32),\n proposals_hash: normalizeRawData(32),\n uncles_hash: normalizeRawData(32),\n dao: normalizeRawData(32)\n });\n}\n\nexport function NormalizeHeader(header, { debugPath = \"header\" } = {}) {\n const rawHeader = NormalizeRawHeader(header, {\n debugPath: `(raw)${debugPath}`\n });\n const result = normalizeObject(debugPath, header, {\n nonce: normalizeHexNumber(16)\n });\n result.raw = rawHeader;\n return result;\n}\n\nexport function NormalizeUncleBlock(\n uncleBlock,\n { debugPath = \"uncle_block\" } = {}\n) {\n return normalizeObject(debugPath, uncleBlock, {\n header: toNormalize(NormalizeHeader),\n proposals: toNormalizeArray(normalizeRawData(10))\n });\n}\n\nexport function NormalizeBlock(block, { debugPath = \"block\" } = {}) {\n return normalizeObject(debugPath, block, {\n header: toNormalize(NormalizeHeader),\n uncles: toNormalizeArray(toNormalize(NormalizeUncleBlock)),\n transactions: toNormalizeArray(toNormalize(NormalizeTransaction)),\n proposals: toNormalizeArray(normalizeRawData(10))\n });\n}\n\nexport function NormalizeCellbaseWitness(\n cellbaseWitness,\n { debugPath = \"cellbase_witness\" } = {}\n) {\n return normalizeObject(debugPath, cellbaseWitness, {\n lock: toNormalize(NormalizeScript),\n message: normalizeRawData(-1)\n });\n}\n\nexport function NormalizeWitnessArgs(\n witnessArgs,\n { debugPath = \"witness_args\" } = {}\n) {\n const result = {};\n if (witnessArgs.lock) {\n result.lock = normalizeRawData(-1)(`${debugPath}.lock`, witnessArgs.lock);\n }\n if (witnessArgs.input_type) {\n result.input_type = normalizeRawData(-1)(\n `${debugPath}.input_type`,\n witnessArgs.input_type\n );\n }\n if (witnessArgs.output_type) {\n result.output_type = normalizeRawData(-1)(\n `${debugPath}.output_type`,\n witnessArgs.output_type\n );\n }\n return result;\n}\n","// This package provides transformer functions that transform JavaScript objects\n// into JSON ready objects that can be passed to RPC. It following the following\n// rules:\n//\n// 1. If the specified object has a serializeJson method, it would invoke this\n// method and use the result to replace current object.\n// 2. It then restricts the keys of the object to keys required by the specified\n// entity(i.e., a Script would only have code_hash, hash_type, args keys),for each\n// sub-field, it then recursively perform the steps here from step 1.\n// 3. It then optionally run validator functions to ensure the resulting object\n// follows specified rules.\n//\n// Note rule 1 here provides the flexibility in defining your own structures: you\n// could define a class containing custom data structures, then provide a\n// serializeJson that transforms the custom one into the rigid data structure\n// required by CKB. You can also leverage the Reader class we provide as much as\n// possible. Since Reader class does provide serializeJson methods, transformers\n// here will transform them to valid hex strings required by CKB.\nimport * as validators from \"./validators\";\n\nfunction invokeSerializeJson(debugPath, value) {\n if (value instanceof Object && value.serializeJson instanceof Function) {\n return value.serializeJson.call(value);\n }\n return value;\n}\n\nfunction transformObject(debugPath, object, keys) {\n object = invokeSerializeJson(debugPath, object);\n if (!(object instanceof Object)) {\n throw new Error(`Transformed ${debugPath} is not an object!`);\n }\n const result = {};\n\n for (const [key, f] of Object.entries(keys)) {\n let value = object[key];\n if (!value) {\n const camelKey = key.replace(/(_[a-z])/g, group =>\n group.toUpperCase().replace(\"_\", \"\")\n );\n value = object[camelKey];\n }\n if (value) {\n result[key] = f(`${debugPath}.${key}`, value);\n }\n }\n return result;\n}\n\nexport function TransformScript(\n script,\n { validation = true, debugPath = \"script\" } = {}\n) {\n script = transformObject(debugPath, script, {\n code_hash: invokeSerializeJson,\n hash_type: invokeSerializeJson,\n args: invokeSerializeJson\n });\n\n if (validation) {\n validators.ValidateScript(script, {\n debugPath: `(transformed) ${debugPath}`\n });\n }\n return script;\n}\n\nexport function TransformOutPoint(\n outPoint,\n { validation = true, debugPath = \"out_point\" } = {}\n) {\n outPoint = transformObject(debugPath, outPoint, {\n tx_hash: invokeSerializeJson,\n index: invokeSerializeJson\n });\n\n if (validation) {\n validators.ValidateOutPoint(outPoint, {\n debugPath: `(transformed) ${debugPath}`\n });\n }\n return outPoint;\n}\n\nfunction toInvoke(transform) {\n return function(debugPath, value) {\n return transform(value, {\n validation: false,\n debugPath\n });\n };\n}\n\nexport function TransformCellInput(\n cellInput,\n { validation = true, debugPath = \"cell_input\" } = {}\n) {\n cellInput = transformObject(debugPath, cellInput, {\n since: invokeSerializeJson,\n previous_output: toInvoke(TransformOutPoint)\n });\n\n if (validation) {\n validators.ValidateCellInput(cellInput, {\n debugPath: `(transformed) ${debugPath}`\n });\n }\n return cellInput;\n}\n\nexport function TransformCellOutput(\n cellOutput,\n { validation = true, debugPath = \"cell_output\" } = {}\n) {\n cellOutput = transformObject(debugPath, cellOutput, {\n capacity: invokeSerializeJson,\n lock: toInvoke(TransformScript),\n type: toInvoke(TransformScript)\n });\n\n if (validation) {\n validators.ValidateCellOutput(cellOutput, {\n debugPath: `(transformed) ${debugPath}`\n });\n }\n return cellOutput;\n}\n\nexport function TransformCellDep(\n cellDep,\n { validation = true, debugPath = \"cell_dep\" } = {}\n) {\n cellDep = transformObject(debugPath, cellDep, {\n out_point: toInvoke(TransformOutPoint),\n dep_type: invokeSerializeJson\n });\n\n if (validation) {\n validators.ValidateCellDep(cellDep, {\n debugPath: `(transformed) ${debugPath}`\n });\n }\n return cellDep;\n}\n\nfunction toInvokeArray(invokeFunction) {\n return function(debugPath, array) {\n return array.map((item, i) => {\n return invokeFunction(`${debugPath}[${i}]`, item);\n });\n };\n}\n\nexport function TransformRawTransaction(\n rawTransaction,\n { validation = true, debugPath = \"raw_transaction\" } = {}\n) {\n rawTransaction = transformObject(debugPath, rawTransaction, {\n version: invokeSerializeJson,\n cell_deps: toInvokeArray(toInvoke(TransformCellDep)),\n header_deps: toInvokeArray(invokeSerializeJson),\n inputs: toInvokeArray(toInvoke(TransformCellInput)),\n outputs: toInvokeArray(toInvoke(TransformCellOutput)),\n outputs_data: toInvokeArray(invokeSerializeJson)\n });\n\n if (validation) {\n validators.ValidateRawTransaction(rawTransaction, {\n debugPath: `(transformed) ${debugPath}`\n });\n }\n return rawTransaction;\n}\n\nexport function TransformTransaction(\n transaction,\n { validation = true, debugPath = \"transaction\" } = {}\n) {\n transaction = transformObject(debugPath, transaction, {\n version: invokeSerializeJson,\n cell_deps: toInvokeArray(toInvoke(TransformCellDep)),\n header_deps: toInvokeArray(invokeSerializeJson),\n inputs: toInvokeArray(toInvoke(TransformCellInput)),\n outputs: toInvokeArray(toInvoke(TransformCellOutput)),\n outputs_data: toInvokeArray(invokeSerializeJson),\n witnesses: toInvokeArray(invokeSerializeJson)\n });\n\n if (validation) {\n validators.ValidateTransaction(transaction, {\n debugPath: `(transformed) ${debugPath}`\n });\n }\n return transaction;\n}\n\nexport function TransformRawHeader(\n rawHeader,\n { validation = true, debugPath = \"raw_header\" } = {}\n) {\n rawHeader = transformObject(debugPath, rawHeader, {\n version: invokeSerializeJson,\n compact_target: invokeSerializeJson,\n timestamp: invokeSerializeJson,\n number: invokeSerializeJson,\n epoch: invokeSerializeJson,\n parent_hash: invokeSerializeJson,\n transactions_root: invokeSerializeJson,\n proposals_hash: invokeSerializeJson,\n uncles_hash: invokeSerializeJson,\n dao: invokeSerializeJson\n });\n\n if (validation) {\n validators.ValidateRawHeader(rawHeader, {\n debugPath: `(transformed) ${debugPath}`\n });\n }\n return rawHeader;\n}\n\nexport function TransformHeader(\n header,\n { validation = true, debugPath = \"header\" } = {}\n) {\n header = transformObject(debugPath, header, {\n version: invokeSerializeJson,\n compact_target: invokeSerializeJson,\n timestamp: invokeSerializeJson,\n number: invokeSerializeJson,\n epoch: invokeSerializeJson,\n parent_hash: invokeSerializeJson,\n transactions_root: invokeSerializeJson,\n proposals_hash: invokeSerializeJson,\n uncles_hash: invokeSerializeJson,\n dao: invokeSerializeJson,\n nonce: invokeSerializeJson\n });\n\n if (validation) {\n validators.ValidateHeader(header, {\n debugPath: `(transformed) ${debugPath}`\n });\n }\n return header;\n}\n\nexport function TransformUncleBlock(\n uncleBlock,\n { validation = true, debugPath = \"uncle_block\" } = {}\n) {\n uncleBlock = transformObject(debugPath, uncleBlock, {\n header: toInvoke(TransformHeader),\n proposals: toInvokeArray(invokeSerializeJson)\n });\n\n if (validation) {\n validators.ValidateUncleBlock(uncleBlock, {\n debugPath: `(transformed) ${debugPath}`\n });\n }\n return uncleBlock;\n}\n\nexport function TransformBlock(\n block,\n { validation = true, debugPath = \"block\" } = {}\n) {\n block = transformObject(debugPath, block, {\n header: toInvoke(TransformHeader),\n uncles: toInvokeArray(toInvoke(TransformUncleBlock)),\n transactions: toInvokeArray(toInvoke(TransformTransaction)),\n proposals: toInvokeArray(invokeSerializeJson)\n });\n\n if (validation) {\n validators.ValidateBlock(block, {\n debugPath: `(transformed) ${debugPath}`\n });\n }\n return block;\n}\n\nexport function TransformCellbaseWitness(\n cellbaseWitness,\n { validation = true, debugPath = \"cellbase_witness\" } = {}\n) {\n cellbaseWitness = transformObject(debugPath, cellbaseWitness, {\n lock: toInvoke(TransformScript),\n message: invokeSerializeJson\n });\n\n if (validation) {\n validators.ValidateCellbaseWitness(cellbaseWitness, {\n debugPath: `(transformed) ${debugPath}`\n });\n }\n return cellbaseWitness;\n}\n\nexport function TransformWitnessArgs(\n witnessArgs,\n { validation = true, debugPath = \"witness_args\" } = {}\n) {\n witnessArgs = transformObject(debugPath, witnessArgs, {\n lock: invokeSerializeJson,\n input_type: invokeSerializeJson,\n output_type: invokeSerializeJson\n });\n\n if (validation) {\n validators.ValidateWitnessArgs(witnessArgs, {\n debugPath: `(transformed) ${debugPath}`\n });\n }\n return witnessArgs;\n}\n","import JSBI from \"jsbi\";\nimport { Reader } from \"../reader\";\nimport { HexStringToBigInt, BigIntToHexString } from \"../rpc\";\n\nexport class RPCCollector {\n constructor(\n rpc,\n lockHash,\n {\n skipCellWithContent = true,\n loadData = false,\n loadBlockNumber = true\n } = {}\n ) {\n this.rpc = rpc;\n this.lockHash = new Reader(lockHash).serializeJson();\n this.skipCellWithContent = skipCellWithContent;\n this.loadData = loadData;\n this.loadBlockNumber = loadBlockNumber;\n }\n\n async *collect() {\n const to = HexStringToBigInt(await this.rpc.get_tip_block_number());\n let currentFrom = JSBI.BigInt(0);\n while (JSBI.lessThanOrEqual(currentFrom, to)) {\n let currentTo = JSBI.add(currentFrom, JSBI.BigInt(100));\n if (JSBI.greaterThan(currentTo, to)) {\n currentTo = to;\n }\n const cells = await this.rpc.get_cells_by_lock_hash(\n this.lockHash,\n BigIntToHexString(currentFrom),\n BigIntToHexString(currentTo)\n );\n for (const cell of cells) {\n if (this.skipCellWithContent) {\n if (\n cell.type ||\n JSBI.greaterThan(\n HexStringToBigInt(cell.output_data_len),\n JSBI.BigInt(100)\n )\n ) {\n continue;\n }\n }\n let data = null;\n if (this.loadData) {\n const cellWithData = await this.rpc.get_live_cell(\n cell.out_point,\n true\n );\n data = cellWithData.cell.data.content;\n }\n let block_number = null;\n if (this.loadBlockNumber) {\n const header = await this.rpc.get_header(cell.block_hash);\n block_number = header.number;\n }\n yield {\n cellbase: cell.cellbase,\n cell_output: {\n capacity: cell.capacity,\n lock: cell.lock,\n type: cell.type\n },\n out_point: cell.out_point,\n block_hash: cell.block_hash,\n data: data,\n output_data_len: cell.output_data_len,\n block_number\n };\n }\n currentFrom = JSBI.add(currentTo, JSBI.BigInt(1));\n }\n }\n}\n","import JSBI from \"jsbi\";\nimport { Reader } from \"./reader\";\nimport { ValidateTransaction, ValidateOutPoint } from \"./validators\";\n\nexport class TransactionDumper {\n constructor(\n rpc,\n { validateTransaction = true, depGroupUnpacker = null } = {}\n ) {\n this.rpc = rpc;\n this.validateTransaction = validateTransaction;\n this.depGroupUnpacker = depGroupUnpacker;\n }\n\n async dumpByHash(txHash) {\n const tx = (await this.rpc.get_transaction(txHash)).transaction;\n delete tx.hash;\n return await this.dump(tx);\n }\n\n async dump(tx) {\n if (this.validateTransaction) {\n ValidateTransaction(tx);\n }\n const mockInputs = [];\n for (const input of tx.inputs) {\n const { output, data, header } = await this._resolveOutPoint(\n input.previous_output\n );\n mockInputs.push({ input, output, data, header });\n }\n const mockCellDeps = [];\n for (const cellDep of tx.cell_deps) {\n const { output, data, header } = await this._resolveOutPoint(\n cellDep.out_point\n );\n mockCellDeps.push({\n cell_dep: cellDep,\n output,\n data,\n header\n });\n if (cellDep.dep_type === \"dep_group\") {\n if (!this.depGroupUnpacker) {\n throw new Error(\n \"depGroupUnpacker must be provided when the transaction contains dep_group!\"\n );\n }\n const outPoints = this.depGroupUnpacker(new Reader(data));\n for (const outPoint of outPoints) {\n ValidateOutPoint(outPoint);\n const { output, data, header } = await this._resolveOutPoint(\n outPoint\n );\n mockCellDeps.push({\n cell_dep: {\n out_point: outPoint,\n dep_type: \"code\"\n },\n output,\n data,\n header\n });\n }\n }\n }\n const mockHeaderDeps = [];\n for (const headerDep of tx.header_deps) {\n mockHeaderDeps.push(await this.rpc.get_header(headerDep));\n }\n return JSON.stringify({\n mock_info: {\n inputs: mockInputs,\n cell_deps: mockCellDeps,\n header_deps: mockHeaderDeps\n },\n tx\n });\n }\n\n async _resolveOutPoint(out_point) {\n const txStatus = await this.rpc.get_transaction(out_point.tx_hash);\n if (!txStatus || !txStatus.transaction) {\n throw new Error(`Transaction ${out_point.tx_hash} cannot be found!`);\n }\n const tx = txStatus.transaction;\n const index = JSBI.toNumber(JSBI.BigInt(out_point.index));\n if (index >= tx.outputs.length) {\n throw new Error(\n `Transaction ${out_point.tx_hash} does not have output ${index}!`\n );\n }\n const data = {\n output: tx.outputs[index],\n data: tx.outputs_data[index]\n };\n if (txStatus.tx_status.status === \"committed\") {\n data.header = txStatus.tx_status.block_hash;\n }\n return data;\n }\n}\n","export { Reader } from \"./reader.js\";\nexport { TransactionDumper } from \"./transaction_dumper.js\";\nexport { RPC, HexStringToBigInt, BigIntToHexString } from \"./rpc.js\";\nexport * as normalizers from \"./normalizers\";\nexport * as transformers from \"./transformers\";\nexport * as validators from \"./validators\";\nexport * as cell_collectors from \"./cell_collectors\";\nexport const VERSION = \"__development_build__\";\n"],"names":["ArrayBufferReader","constructor","buffer","this","view","DataView","length","byteLength","indexAt","i","getUint8","toArrayBuffer","serializeJson","Array","prototype","map","call","Uint8Array","x","toString","slice","join","HexStringReader","string","parseInt","substr","ArrayBuffer","setUint8","Reader","input","startsWith","Error","static","c","charCodeAt","JSBI","a","b","__kMaxLength","RangeError","super","sign","Math","floor","Number","isFinite","__zero","__oneDigit","__fromDouble","__fromString","SyntaxError","__toPrimitive","BigInt","TypeError","toDebugString","push","__toStringBasePowerOfTwo","__toStringGeneric","clz32","__unsignedDigit","d","__digit","e","f","Infinity","g","h","j","k","l","m","n","o","__decideRounding","p","__kBitConversionInts","__kBitConversionDouble","__copy","__absoluteSubOne","__trim","__absoluteAddOne","unaryMinus","__kMaxLengthBits","__initializeDigits","__setDigit","multiply","__clzmsd","__multiplyAccumulate","__absoluteCompare","__absoluteDivSmall","__absoluteDivLarge","__absoluteModSmall","__absoluteAdd","__absoluteSub","__rightShiftByAbsolute","__leftShiftByAbsolute","__compareToBigInt","equal","max","__absoluteAnd","__absoluteOr","__absoluteAndNot","__absoluteXor","__truncateToNBits","__truncateAndSubFromPowerOfTwo","__toNumeric","__isBigInt","add","__compare","EQ","__equalToNumber","pop","__isWhitespace","__kMaxBitsPerChar","__kBitsPerCharTableMultiplier","__kBitsPerCharTableShift","__fillFromParts","q","__inplaceMultiplyAdd","__kConversionChars","exponentiate","__halfDigit","__setHalfDigit","quotient","remainder","__unequalSign","__absoluteGreater","__absoluteLess","abs","__compareToDouble","__comparisonResultToBool","__compareToNumber","__setDigitGrow","imul","r","s","t","__halfDigitLength","__clz16","__specialLeftShift","__internalMultiplyAdd","__inplaceSub","__inplaceAdd","__inplaceRightShift","__toShiftAmount","__rightShiftByMaximum","Symbol","toPrimitive","valueOf","min","assertObjectWithKeys","debugPath","object","expectedKeys","optionalKeys","Object","assertObject","providedKeys","keys","sort","requiredLength","maximalLength","errorMessage","optionalProvidedKeys","filter","key","includes","find","assertHexString","test","assertHash","hash","assertInteger","ValidateScript","script","nestedValidation","code_hash","args","hash_type","ValidateOutPoint","outPoint","tx_hash","index","ValidateCellInput","cellInput","since","previous_output","ValidateCellOutput","cellOutput","capacity","lock","type","ValidateCellDep","cellDep","dep_type","out_point","assertArray","array","validateFunction","isArray","toAssert","value","assertCommonTransaction","rawTransaction","version","cell_deps","header_deps","inputs","outputs","outputs_data","ValidateRawTransaction","ValidateTransaction","transaction","witnesses","ValidateRawHeader","rawHeader","compact_target","timestamp","number","epoch","parent_hash","transactions_root","proposals_hash","uncles_hash","dao","assertCommonHeader","ValidateHeader","header","nonce","assertProposalShortId","shortId","ValidateUncleBlock","uncleBlock","proposals","ValidateBlock","block","uncles","transactions","ValidateCellbaseWitness","cellbaseWitness","message","ValidateWitnessArgs","witnessArgs","input_type","output_type","__kBitConversionBuffer","Float64Array","Int32Array","Readable","Stream","BUFFER","TYPE","Blob","blobParts","arguments","options","buffers","size","element","Buffer","isView","from","byteOffset","String","concat","undefined","toLowerCase","text","Promise","resolve","arrayBuffer","buf","ab","stream","readable","_read","start","end","relativeStart","relativeEnd","span","slicedBuffer","blob","FetchError","systemError","code","errno","captureStackTrace","convert","defineProperties","enumerable","defineProperty","toStringTag","writable","configurable","create","name","require","INTERNALS","PassThrough","Body","body","_this","_ref","_ref$size","_ref$timeout","timeout","isURLSearchParams","isBlob","isBuffer","disturbed","error","on","err","url","consumeBody","_this4","reject","alloc","accum","accumBytes","abort","resTimeout","setTimeout","chunk","clearTimeout","obj","append","delete","get","getAll","has","set","clone","instance","p1","p2","bodyUsed","getBoundary","pipe","extractContentType","getTotalBytes","getLengthSync","_lengthRetrievers","hasKnownLength","then","ct","headers","assign","json","_this2","JSON","parse","textConverted","_this3","res","str","charset","exec","convertBody","mixIn","proto","getOwnPropertyNames","desc","getOwnPropertyDescriptor","global","invalidTokenRegex","invalidHeaderCharRegex","validateName","validateValue","MAP","Headers","init","rawHeaders","raw","headerNames","headerName","method","iterator","pairs","pair","forEach","callback","thisArg","getHeaders","_pairs$i","createHeadersIterator","values","kind","entries","INTERNAL","target","HeadersIteratorPrototype","setPrototypeOf","next","getPrototypeOf","_INTERNAL","done","exportNodeCompatibleHeaders","__proto__","hostHeaderKey","INTERNALS$1","STATUS_CODES","http","Response","opts","status","contentType","statusText","counter","ok","redirected","INTERNALS$2","parse_url","Url","format_url","format","streamDestructionSupported","isRequest","Request","parsedURL","href","toUpperCase","inputBody","signal","isAbortSignal","redirect","follow","compress","agent","AbortError","PassThrough$1","resolve_url","fetch","request","protocol","hostname","contentLengthValue","totalBytes","getNodeRequestOptions","send","https","response","destroy","emit","aborted","abortAndFinalize","finalize","req","reqTimeout","removeEventListener","addEventListener","once","socket","val","createHeadersLenient","isRedirect","statusCode","location","locationURL","requestOpts","response_options","statusMessage","codings","zlibOptions","flush","zlib","Z_SYNC_FLUSH","finishFlush","createGunzip","createBrotliDecompress","createInflate","createInflateRaw","dest","write","writeToStream","realFetch","nodeFetch","default","module","exports","mergeOptions","overrideOptions","defaultOptions","batchHandler","receiver","async","uri","stringify","payload","params","id","jsonrpc","handler","Proxy","round","random","data","result","RPC","HexStringToBigInt","hexString","BigIntToHexString","bigInt","normalizeHexNumber","intValue","normalizeRawData","normalizeObject","NormalizeScript","NormalizeOutPoint","toNormalize","normalize","NormalizeCellInput","NormalizeCellOutput","type_","NormalizeCellDep","toNormalizeArray","normalizeFunction","item","NormalizeRawTransaction","NormalizeTransaction","NormalizeRawHeader","NormalizeHeader","NormalizeUncleBlock","invokeSerializeJson","Function","transformObject","replace","group","TransformScript","validation","validators.ValidateScript","TransformOutPoint","validators.ValidateOutPoint","toInvoke","transform","TransformCellInput","validators.ValidateCellInput","TransformCellOutput","validators.ValidateCellOutput","TransformCellDep","validators.ValidateCellDep","toInvokeArray","invokeFunction","TransformTransaction","validators.ValidateTransaction","TransformHeader","validators.ValidateHeader","TransformUncleBlock","validators.ValidateUncleBlock","validators.ValidateRawTransaction","validators.ValidateRawHeader","validators.ValidateBlock","validators.ValidateCellbaseWitness","validators.ValidateWitnessArgs","rpc","lockHash","skipCellWithContent","loadData","loadBlockNumber","to","get_tip_block_number","currentFrom","lessThanOrEqual","currentTo","greaterThan","cells","get_cells_by_lock_hash","cell","output_data_len","get_live_cell","content","block_number","get_header","block_hash","cellbase","cell_output","validateTransaction","depGroupUnpacker","txHash","tx","get_transaction","dump","mockInputs","output","_resolveOutPoint","mockCellDeps","cell_dep","outPoints","mockHeaderDeps","headerDep","mock_info","txStatus","toNumber","tx_status"],"mappings":"mRAAA,MAAMA,EACJC,YAAYC,GACVC,KAAKC,KAAO,IAAIC,SAASH,GAG3BI,SACE,OAAOH,KAAKC,KAAKG,WAGnBC,QAAQC,GACN,OAAON,KAAKC,KAAKM,SAASD,GAG5BE,gBACE,OAAOR,KAAKC,KAAKF,OAGnBU,gBACE,MACE,KACAC,MAAMC,UAAUC,IACbC,KAAK,IAAIC,WAAWd,KAAKC,KAAKF,SAASgB,IACrC,KAAOA,EAAEC,SAAS,KAAKC,OAAO,KAEhCC,KAAK,KAKd,MAAMC,EACJrB,YAAYsB,GACVpB,KAAKoB,OAASA,EAGhBjB,SACE,OAAOH,KAAKoB,OAAOjB,OAAS,EAAI,EAGlCE,QAAQC,GACN,OAAOe,SAASrB,KAAKoB,OAAOE,OAAO,EAAQ,EAAJhB,EAAO,GAAI,IAGpDE,gBACE,MAAMT,EAAS,IAAIwB,YAAYvB,KAAKG,UAC9BF,EAAO,IAAIC,SAASH,GAE1B,IAAK,IAAIO,EAAI,EAAGA,EAAIN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,EAAK9Q,OAAS6W,EAASE,UAAUpB,YAE5B7E,oBC5FY"} \ No newline at end of file diff --git a/packages/core/lib/ckb-js-toolkit.umd.js b/packages/core/lib/ckb-js-toolkit.umd.js deleted file mode 100644 index cc6338a8a..000000000 --- a/packages/core/lib/ckb-js-toolkit.umd.js +++ /dev/null @@ -1 +0,0 @@ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).CKBJSToolkit={})}(this,(function(t){"use strict";class e{constructor(t){this.view=new DataView(t)}length(){return this.view.byteLength}indexAt(t){return this.view.getUint8(t)}toArrayBuffer(){return this.view.buffer}serializeJson(){return"0x"+Array.prototype.map.call(new Uint8Array(this.view.buffer),(t=>("00"+t.toString(16)).slice(-2))).join("")}}class r{constructor(t){this.string=t}length(){return this.string.length/2-1}indexAt(t){return parseInt(this.string.substr(2+2*t,2),16)}toArrayBuffer(){const t=new ArrayBuffer(this.length()),e=new DataView(t);for(let t=0;t255)throw new Error("fromRawString can only accept UTF-8 raw string!");n.setUint8(e,r)}return new e(r)}}var i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function o(t,e,r){return t(r={path:e,exports:{},require:function(t,e){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==e&&r.path)}},r.exports),r.exports}var a=o((function(t,e){t.exports=function(){function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}function e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){for(var r,n=0;nt.length)&&(e=t.length);for(var r=0,n=Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw o}}}}var v=function(r){var o=Math.abs,a=Math.max,u=Math.imul,s=Math.clz32;function _(t,r){var n;if(e(this,_),t>_.__kMaxLength)throw new RangeError("Maximum BigInt size exceeded");return(n=l.call(this,t)).sign=r,n}i(_,r);var l=h(_);return n(_,[{key:"toDebugString",value:function(){var t,e=["BigInt["],r=p(this);try{for(r.s();!(t=r.n()).done;){var n=t.value;e.push((n?(n>>>0).toString(16):n)+", ")}}catch(t){r.e(t)}finally{r.f()}return e.push("]"),e.join("")}},{key:"toString",value:function(){var t=0t||36this.length&&(r=this.length);for(var n=65535&t,i=t>>>16,o=0,a=65535&e,s=e>>>16,_=0;_>>16,h=u(f,n),g=u(f,i),d=u(c,n),p=u(c,i),v=a+(65535&h),y=s+o+(v>>>16)+(h>>>16)+(65535&g)+(65535&d);o=(a=(g>>>16)+(d>>>16)+(65535&p)+(y>>>16))>>>16,a&=65535,s=p>>>16,this.__setDigit(_,65535&v|y<<16)}if(0!==o||0!==a||0!==s)throw new Error("implementation bug")}},{key:"__inplaceAdd",value:function(t,e,r){for(var n,i=0,o=0;o>>16,this.__setHalfDigit(e+o,n);return i}},{key:"__inplaceSub",value:function(t,e,r){var n=0;if(1&e){e>>=1;for(var i=this.__digit(e),o=65535&i,a=0;a>>1;a++){var u=t.__digit(a),s=(i>>>16)-(65535&u)-n;n=1&s>>>16,this.__setDigit(e+a,s<<16|65535&o),n=1&(o=(65535&(i=this.__digit(e+a+1)))-(u>>>16)-n)>>>16}var _=t.__digit(a),l=(i>>>16)-(65535&_)-n;if(n=1&l>>>16,this.__setDigit(e+a,l<<16|65535&o),e+a+1>=this.length)throw new RangeError("out of bounds");0==(1&r)&&(n=1&(o=(65535&(i=this.__digit(e+a+1)))-(_>>>16)-n)>>>16,this.__setDigit(e+t.length,4294901760&i|65535&o))}else{e>>=1;for(var f=0;f>>16)-(h>>>16)-(n=1&g>>>16);n=1&d>>>16,this.__setDigit(e+f,d<<16|65535&g)}var p=this.__digit(e+f),v=t.__digit(f),y=(65535&p)-(65535&v)-n;n=1&y>>>16;var b=0;0==(1&r)&&(n=1&(b=(p>>>16)-(v>>>16)-n)>>>16),this.__setDigit(e+f,b<<16|65535&y)}return n}},{key:"__inplaceRightShift",value:function(t){if(0!==t){for(var e,r=this.__digit(0)>>>t,n=this.length-1,i=0;i>>t;this.__setDigit(n,r)}}},{key:"__digit",value:function(t){return this[t]}},{key:"__unsignedDigit",value:function(t){return this[t]>>>0}},{key:"__setDigit",value:function(t,e){this[t]=0|e}},{key:"__setDigitGrow",value:function(t,e){this[t]=0|e}},{key:"__halfDigitLength",value:function(){var t=this.length;return 65535>=this.__unsignedDigit(t-1)?2*t-1:2*t}},{key:"__halfDigit",value:function(t){return 65535&this[t>>>1]>>>((1&t)<<4)}},{key:"__setHalfDigit",value:function(t,e){var r=t>>>1,n=this.__digit(r),i=1&t?65535&n|e<<16:4294901760&n|65535&e;this.__setDigit(r,i)}}],[{key:"BigInt",value:function(e){var r=Math.floor,n=Number.isFinite;if("number"==typeof e){if(0===e)return _.__zero();if((0|e)===e)return 0>e?_.__oneDigit(-e,!0):_.__oneDigit(e,!1);if(!n(e)||r(e)!==e)throw new RangeError("The number "+e+" cannot be converted to BigInt because it is not an integer");return _.__fromDouble(e)}if("string"==typeof e){var i=_.__fromString(e);if(null===i)throw new SyntaxError("Cannot convert "+e+" to a BigInt");return i}if("boolean"==typeof e)return!0===e?_.__oneDigit(1,!1):_.__zero();if("object"===t(e)){if(e.constructor===_)return e;var o=_.__toPrimitive(e);return _.BigInt(o)}throw new TypeError("Cannot convert "+e+" to a BigInt")}},{key:"toNumber",value:function(t){var e=t.length;if(0===e)return 0;if(1===e){var r=t.__unsignedDigit(0);return t.sign?-r:r}var n=t.__digit(e-1),i=s(n),o=32*e-i;if(1024>>=12;var h=f-12,g=12<=f?0:u<<20+f,d=20+f;0>>32-h,g=u<>>32-d,d-=32);var p=_.__decideRounding(t,d,l,u);if((1===p||0===p&&1==(1&g))&&0==(g=g+1>>>0)&&0!=++c>>>20&&(c=0,1023<++a))return t.sign?-1/0:1/0;var v=t.sign?-2147483648:0;return a=a+1023<<20,_.__kBitConversionInts[1]=v|a|c,_.__kBitConversionInts[0]=g,_.__kBitConversionDouble[0]}},{key:"unaryMinus",value:function(t){if(0===t.length)return t;var e=t.__copy();return e.sign=!t.sign,e}},{key:"bitwiseNot",value:function(t){return t.sign?_.__absoluteSubOne(t).__trim():_.__absoluteAddOne(t,!0)}},{key:"exponentiate",value:function(t,e){if(e.sign)throw new RangeError("Exponent must be positive");if(0===e.length)return _.__oneDigit(1,!1);if(0===t.length)return t;if(1===t.length&&1===t.__digit(0))return t.sign&&0==(1&e.__digit(0))?_.unaryMinus(t):t;if(1=_.__kMaxLengthBits)throw new RangeError("BigInt too big");if(1===t.length&&2===t.__digit(0)){var n=1+(r>>>5),i=new _(n,t.sign&&0!=(1&r));i.__initializeDigits();var o=1<<(31&r);return i.__setDigit(n-1,o),i}var a=null,u=t;for(0!=(1&r)&&(a=t),r>>=1;0!==r;r>>=1)u=_.multiply(u,u),0!=(1&r)&&(a=null===a?u:_.multiply(a,u));return a}},{key:"multiply",value:function(t,e){if(0===t.length)return t;if(0===e.length)return e;var r=t.length+e.length;32<=t.__clzmsd()+e.__clzmsd()&&r--;var n=new _(r,t.sign!==e.sign);n.__initializeDigits();for(var i=0;i_.__absoluteCompare(t,e))return _.__zero();var r,n=t.sign!==e.sign,i=e.__unsignedDigit(0);if(1===e.length&&65535>=i){if(1===i)return n===t.sign?t:_.unaryMinus(t);r=_.__absoluteDivSmall(t,i,null)}else r=_.__absoluteDivLarge(t,e,!0,!1);return r.sign=n,r.__trim()}},{key:"remainder",value:function(t,e){if(0===e.length)throw new RangeError("Division by zero");if(0>_.__absoluteCompare(t,e))return t;var r=e.__unsignedDigit(0);if(1===e.length&&65535>=r){if(1===r)return _.__zero();var n=_.__absoluteModSmall(t,r);return 0===n?_.__zero():_.__oneDigit(n,t.sign)}var i=_.__absoluteDivLarge(t,e,!1,!0);return i.sign=t.sign,i.__trim()}},{key:"add",value:function(t,e){var r=t.sign;return r===e.sign?_.__absoluteAdd(t,e,r):0<=_.__absoluteCompare(t,e)?_.__absoluteSub(t,e,r):_.__absoluteSub(e,t,!r)}},{key:"subtract",value:function(t,e){var r=t.sign;return r===e.sign?0<=_.__absoluteCompare(t,e)?_.__absoluteSub(t,e,r):_.__absoluteSub(e,t,!r):_.__absoluteAdd(t,e,r)}},{key:"leftShift",value:function(t,e){return 0===e.length||0===t.length?t:e.sign?_.__rightShiftByAbsolute(t,e):_.__leftShiftByAbsolute(t,e)}},{key:"signedRightShift",value:function(t,e){return 0===e.length||0===t.length?t:e.sign?_.__leftShiftByAbsolute(t,e):_.__rightShiftByAbsolute(t,e)}},{key:"unsignedRightShift",value:function(){throw new TypeError("BigInts have no unsigned right shift; use >> instead")}},{key:"lessThan",value:function(t,e){return 0>_.__compareToBigInt(t,e)}},{key:"lessThanOrEqual",value:function(t,e){return 0>=_.__compareToBigInt(t,e)}},{key:"greaterThan",value:function(t,e){return 0<_.__compareToBigInt(t,e)}},{key:"greaterThanOrEqual",value:function(t,e){return 0<=_.__compareToBigInt(t,e)}},{key:"equal",value:function(t,e){if(t.sign!==e.sign)return!1;if(t.length!==e.length)return!1;for(var r=0;r=_.__kMaxLengthBits)return e;var r=t+31>>>5;if(e.length_.__kMaxLengthBits)throw new RangeError("BigInt too big");return _.__truncateAndSubFromPowerOfTwo(t,e,!1)}if(t>=_.__kMaxLengthBits)return e;var r=t+31>>>5;if(e.length>>n)return e}return _.__truncateToNBits(t,e)}},{key:"ADD",value:function(t,e){if(t=_.__toPrimitive(t),e=_.__toPrimitive(e),"string"==typeof t)return"string"!=typeof e&&(e=e.toString()),t+e;if("string"==typeof e)return t.toString()+e;if(t=_.__toNumeric(t),e=_.__toNumeric(e),_.__isBigInt(t)&&_.__isBigInt(e))return _.add(t,e);if("number"==typeof t&&"number"==typeof e)return t+e;throw new TypeError("Cannot mix BigInt and other types, use explicit conversions")}},{key:"LT",value:function(t,e){return _.__compare(t,e,0)}},{key:"LE",value:function(t,e){return _.__compare(t,e,1)}},{key:"GT",value:function(t,e){return _.__compare(t,e,2)}},{key:"GE",value:function(t,e){return _.__compare(t,e,3)}},{key:"EQ",value:function(e,r){for(;;){if(_.__isBigInt(e))return _.__isBigInt(r)?_.equal(e,r):_.EQ(r,e);if("number"==typeof e){if(_.__isBigInt(r))return _.__equalToNumber(r,e);if("object"!==t(r))return e==r;r=_.__toPrimitive(r)}else if("string"==typeof e){if(_.__isBigInt(r))return null!==(e=_.__fromString(e))&&_.equal(e,r);if("object"!==t(r))return e==r;r=_.__toPrimitive(r)}else if("boolean"==typeof e){if(_.__isBigInt(r))return _.__equalToNumber(r,+e);if("object"!==t(r))return e==r;r=_.__toPrimitive(r)}else if("symbol"===t(e)){if(_.__isBigInt(r))return!1;if("object"!==t(r))return e==r;r=_.__toPrimitive(r)}else{if("object"!==t(e))return e==r;if("object"===t(r)&&r.constructor!==_)return e==r;e=_.__toPrimitive(e)}}}},{key:"NE",value:function(t,e){return!_.EQ(t,e)}},{key:"__zero",value:function(){return new _(0,!1)}},{key:"__oneDigit",value:function(t,e){var r=new _(1,e);return r.__setDigit(0,t),r}},{key:"__decideRounding",value:function(t,e,r,n){if(0e)i=-e-1;else{if(0===r)return-1;r--,n=t.__digit(r),i=31}var o=1<>>20)-1023,n=1+(r>>>5),i=new _(n,0>t),o=1048575&_.__kBitConversionInts[1]|1048576,a=_.__kBitConversionInts[0],u=20,s=31&r,l=0;if(s>>f,o=o<<32-f|a>>>f,a<<=32-f}else if(s===u)l=32,e=o,o=a;else{var c=s-u;l=32-c,e=o<>>32-c,o=a<=t&&9<=t)||(159>=t?32==t:131071>=t?160==t||5760==t:196607>=t?10>=(t&=131071)||40==t||41==t||47==t||95==t||4096==t:65279==t)}},{key:"__fromString",value:function(t){var e=11073741824/u)return null;var l=new _(31+(u*a+s>>>_.__kBitsPerCharTableShift)>>>5,!1),f=10>e?e:10,c=10>=_.__kBitsPerCharTableShift;var h=[],g=[],d=!1;do{for(var p,v=0,y=0;;){if(p=void 0,o-48>>>0>>0>>0>>0>>_.__kBitsPerCharTableShift+5;l.__inplaceMultiplyAdd(D,k,P)}while(!b)}if(i!==n){if(!_.__isWhitespace(o))return null;for(i++;i>>s-(o-=32))}if(0!==i){if(n>=t.length)throw new Error("implementation bug");t.__setDigit(n++,i)}for(;n>>1)+(85&n))>>>2)+(51&n))>>>4)+(15&n),o=e-1,a=t.__digit(r-1),u=0|(32*r-s(a)+i-1)/i;if(t.sign&&u++,268435456>>v,h=32-v;h>=i;)l[f--]=_.__kConversionChars[c&o],c>>>=i,h-=i}var y=(c|a<>>i-h;0!==c;)l[f--]=_.__kConversionChars[c&o],c>>>=i;if(t.sign&&(l[f--]="-"),-1!==f)throw new Error("implementation bug");return l.join("")}},{key:"__toStringGeneric",value:function(t,e,r){var n=t.length;if(0===n)return"";if(1===n){var i=t.__unsignedDigit(0).toString(e);return!1===r&&t.sign&&(i="-"+i),i}var o,a,u=32*n-s(t.__digit(n-1)),l=_.__kMaxBitsPerChar[e]-1,f=u*_.__kBitsPerCharTableMultiplier,c=1+(f=0|(f+=l-1)/l)>>1,h=_.exponentiate(_.__oneDigit(e,!1),_.__oneDigit(c,!1)),g=h.__unsignedDigit(0);if(1===h.length&&65535>=g){(o=new _(t.length,!1)).__initializeDigits();for(var d,p=0,v=2*t.length-1;0<=v;v--)d=p<<16|t.__halfDigit(v),o.__setHalfDigit(v,0|d/g),p=0|d%g;a=p.toString(e)}else{var y=_.__absoluteDivLarge(t,h,!0,!0);o=y.quotient;var b=y.remainder.__trim();a=_.__toStringGeneric(b,e,!0)}o.__trim();for(var m=_.__toStringGeneric(o,e,!0);a.lengthn?_.__absoluteLess(r):0}},{key:"__compareToNumber",value:function(t,e){if(!0|e){var r=t.sign,n=0>e;if(r!==n)return _.__unequalSign(r);if(0===t.length){if(n)throw new Error("implementation bug");return 0===e?0:-1}if(1i?_.__absoluteGreater(r):ae)return _.__unequalSign(r);if(0===e)throw new Error("implementation bug: should be handled elsewhere");if(0===t.length)return-1;_.__kBitConversionDouble[0]=e;var n=2047&_.__kBitConversionInts[1]>>>20;if(2047==n)throw new Error("implementation bug: handled elsewhere");var i=n-1023;if(0>i)return _.__absoluteGreater(r);var o=t.length,a=t.__digit(o-1),u=s(a),l=32*o-u,f=i+1;if(lf)return _.__absoluteGreater(r);var c=1048576|1048575&_.__kBitConversionInts[1],h=_.__kBitConversionInts[0],g=20,d=31-u;if(d!==(l-1)%31)throw new Error("implementation bug");var p,v=0;if(d>>y,c=c<<32-y|h>>>y,h<<=32-y}else if(d===g)v=32,p=c,c=h;else{var b=d-g;v=32-b,p=c<>>32-b,c=h<>>=0)>(p>>>=0))return _.__absoluteGreater(r);if(a>>0,c=h,h=0):p=0;var w=t.__unsignedDigit(m);if(w>p)return _.__absoluteGreater(r);if(we&&t.__unsignedDigit(0)===o(e):0===_.__compareToDouble(t,e)}},{key:"__comparisonResultToBool",value:function(t,e){switch(e){case 0:return 0>t;case 1:return 0>=t;case 2:return 0e;case 3:return t>=e}if(_.__isBigInt(t)&&"string"==typeof e)return null!==(e=_.__fromString(e))&&_.__comparisonResultToBool(_.__compareToBigInt(t,e),r);if("string"==typeof t&&_.__isBigInt(e))return null!==(t=_.__fromString(t))&&_.__comparisonResultToBool(_.__compareToBigInt(t,e),r);if(t=_.__toNumeric(t),e=_.__toNumeric(e),_.__isBigInt(t)){if(_.__isBigInt(e))return _.__comparisonResultToBool(_.__compareToBigInt(t,e),r);if("number"!=typeof e)throw new Error("implementation bug");return _.__comparisonResultToBool(_.__compareToNumber(t,e),r)}if("number"!=typeof t)throw new Error("implementation bug");if(_.__isBigInt(e))return _.__comparisonResultToBool(_.__compareToNumber(e,t),2^r);if("number"!=typeof e)throw new Error("implementation bug");return 0===r?te:3===r?t>=e:void 0}},{key:"__absoluteAdd",value:function(t,e,r){if(t.length>>16)+(u>>>16)+(l>>>16);o=f>>>16,i.__setDigit(a,65535&l|f<<16)}for(;a>>16)+(h>>>16);o=g>>>16,i.__setDigit(a,65535&h|g<<16)}return a>>16)-(u>>>16)-(i=1&s>>>16);i=1&l>>>16,n.__setDigit(o,65535&s|l<<16)}for(;o>>16)-(i=1&c>>>16);i=1&h>>>16,n.__setDigit(o,65535&c|h<<16)}return n.__trim()}},{key:"__absoluteAddOne",value:function(t,e){var r=2n?0:t.__unsignedDigit(n)>e.__unsignedDigit(n)?1:-1}},{key:"__multiplyAccumulate",value:function(t,e,r,n){if(0!==e){for(var i=65535&e,o=e>>>16,a=0,s=0,_=0,l=0;l>>16,g=t.__digit(l),d=65535&g,p=g>>>16,v=u(d,i),y=u(d,o),b=u(p,i),m=u(p,o);a=(s=(y>>>16)+(b>>>16)+(65535&m)+(a=(h+=_+a+((c+=s+(65535&v))>>>16)+(v>>>16)+(65535&y)+(65535&b))>>>16))>>>16,s&=65535,_=m>>>16,f=65535&c|h<<16,r.__setDigit(n,f)}for(;0!==a||0!==s||0!==_;n++){var w=r.__digit(n),k=(65535&w)+s,D=(w>>>16)+(k>>>16)+_+a;s=0,_=0,a=D>>>16,w=65535&k|D<<16,r.__setDigit(n,w)}}}},{key:"__internalMultiplyAdd",value:function(t,e,r,n,i){for(var o=r,a=0,s=0;s>>16;var c=u(_>>>16,e),h=(65535&c)+(l>>>16)+o;o=h>>>16,a=c>>>16,i.__setDigit(s,h<<16|65535&f)}if(i.length>n)for(i.__setDigit(n++,o+a);n>>0,a=0|o/e,u=0|(o=((n=0|o%e)<<16|t.__halfDigit(i-1))>>>0)/e;n=0|o%e,r.__setDigit(i>>>1,a<<16|u)}return r}},{key:"__absoluteModSmall",value:function(t,e){for(var r=0,n=2*t.length-1;0<=n;n--)r=0|((r<<16|t.__halfDigit(n))>>>0)%e;return r}},{key:"__absoluteDivLarge",value:function(t,e,r,n){var i=e.__halfDigitLength(),o=e.length,a=t.__halfDigitLength()-i,s=null;r&&(s=new _(a+2>>>1,!1)).__initializeDigits();var l=new _(i+2>>>1,!1);l.__initializeDigits();var f=_.__clz16(e.__halfDigit(i-1));0>>0;p=0|y/h;for(var b=0|y%h,m=e.__halfDigit(i-2),w=c.__halfDigit(d+i-2);u(p,m)>>>0>(b<<16|w)>>>0&&(p--,!(65535<(b+=h))););}_.__internalMultiplyAdd(e,p,0,o,l);var k=c.__inplaceSub(l,d,i+1);0!==k&&(k=c.__inplaceAdd(e,d,i),c.__setHalfDigit(d+i,c.__halfDigit(d+i)+k),p--),r&&(1&d?g=p<<16:s.__setDigit(d>>>1,g|p))}return n?(c.__inplaceRightShift(f),r?{quotient:s,remainder:c}:c):r?s:void 0}},{key:"__clz16",value:function(t){return s(t)-16}},{key:"__specialLeftShift",value:function(t,e,r){var n=t.length,i=new _(n+r,!1);if(0===e){for(var o=0;o>>32-e;return 0r)throw new RangeError("BigInt too big");var n=r>>>5,i=31&r,o=t.length,a=0!==i&&0!=t.__digit(o-1)>>>32-i,u=o+n+(a?1:0),s=new _(u,t.sign);if(0===i){for(var l=0;l>>32-i;if(a)s.__setDigit(o+n,f);else if(0!==f)throw new Error("implementation bug")}return s.__trim()}},{key:"__rightShiftByAbsolute",value:function(t,e){var r=t.length,n=t.sign,i=_.__toShiftAmount(e);if(0>i)return _.__rightShiftByMaximum(n);var o=i>>>5,a=31&i,u=r-o;if(0>=u)return _.__rightShiftByMaximum(n);var s=!1;if(n)if(0!=(t.__digit(o)&(1<>>a,d=r-o-1,p=0;p>>a;f.__setDigit(d,g)}return s&&(f=_.__absoluteAddOne(f,!0,f)),f.__trim()}},{key:"__rightShiftByMaximum",value:function(t){return t?_.__oneDigit(1,!0):_.__zero()}},{key:"__toShiftAmount",value:function(t){if(1_.__kMaxLengthBits?-1:e}},{key:"__toPrimitive",value:function(e){var r=1>>5,n=new _(r,e.sign),i=r-1,o=0;o>>u}return n.__setDigit(i,a),n.__trim()}},{key:"__truncateAndSubFromPowerOfTwo",value:function(t,e,r){for(var n=Math.min,i=t+31>>>5,o=new _(i,r),a=0,u=i-1,s=0,l=n(u,e.length);a>>16)-(s=1&c>>>16);s=1&h>>>16,o.__setDigit(a,65535&c|h<<16)}for(;a>>16)-(s=1&v>>>16)<<16}else{var y=32-p,b=1<<32-y,m=(65535&b)-(65535&(d=d<>>y))-s;g=65535&m|(b>>>16)-(d>>>16)-(s=1&m>>>16)<<16,g&=b-1}return o.__setDigit(u,g),o.__trim()}},{key:"__digitPow",value:function(t,e){for(var r=1;0>>=1,t*=t;return r}}]),_}(l(Array));return v.__kMaxLength=33554432,v.__kMaxLengthBits=v.__kMaxLength<<5,v.__kMaxBitsPerChar=[0,0,32,51,64,75,83,90,96,102,107,111,115,119,122,126,128,131,134,136,139,141,143,145,147,149,151,153,154,156,158,159,160,162,163,165,166],v.__kBitsPerCharTableShift=5,v.__kBitsPerCharTableMultiplier=1<a)throw new Error(u);let s=i.filter((t=>!r.includes(t)));if(i.length-s.length!==o)throw new Error(u);if(s.find((t=>!n.includes(t))))throw new Error(u)}function s(t,e){if(!/^0x([0-9a-fA-F][0-9a-fA-F])*$/.test(e))throw new Error(`${t} must be a hex string!`)}function _(t,e){if(s(t,e),66!=e.length)throw new Error(`${t} must be a hex string of 66 bytes long!`)}function l(t,e){if("0x0"!==e&&!/^0x[1-9a-fA-F][0-9a-fA-F]*$/.test(e))throw new Error(`${t} must be a hex integer!`)}function f(t,{nestedValidation:e=!0,debugPath:r="script"}={}){if(u(r,t,["code_hash","hash_type","args"],[]),_(`${r}.code_hash`,t.code_hash),s(`${r}.args`,t.args),"data"!==t.hash_type&&"type"!==t.hash_type)throw new Error(`${r}.hash_type must be either data or type!`)}function c(t,{nestedValidation:e=!0,debugPath:r="out_point"}={}){u(r,t,["tx_hash","index"],[]),_(`${r}.tx_hash`,t.tx_hash),l(`${r}.index`,t.index)}function h(t,{nestedValidation:e=!0,debugPath:r="cell_input"}={}){u(r,t,["since","previous_output"],[]),l(`${r}.since`,t.since),e&&c(t.previous_output,{debugPath:`${r}.previous_output`})}function g(t,{nestedValidation:e=!0,debugPath:r="cell_output"}={}){u(r,t,["capacity","lock"],["type"]),l(`${r}.capacity`,t.capacity),e&&(f(t.lock,{debugPath:`${r}.lock`}),t.type&&f(t.type,{debugPath:`${r}.type`}))}function d(t,{nestedValidation:e=!0,debugPath:r="cell_dep"}={}){if(u(r,t,["out_point","dep_type"],[]),"code"!==t.dep_type&&"dep_group"!==t.dep_type)throw new Error(`${r}.dep_type must be either code or dep_group!`);e&&c(t.out_point,{debugPath:`${r}.out_point`})}function p(t,e,r,n){if(!Array.isArray(e))throw new Error(`${t} is not an array!`);if(n)for(let n=0;n-1};function _(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function l(t){return"string"!=typeof t&&(t=String(t)),t}function f(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return n&&(e[Symbol.iterator]=function(){return e}),e}function c(t){this.map={},t instanceof c?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function h(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function g(t){return new Promise((function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}}))}function d(t){var e=new FileReader,r=g(e);return e.readAsArrayBuffer(t),r}function p(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function v(){return this.bodyUsed=!1,this._initBody=function(t){var e;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:i&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:o&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:r&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():a&&i&&((e=t)&&DataView.prototype.isPrototypeOf(e))?(this._bodyArrayBuffer=p(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a&&(ArrayBuffer.prototype.isPrototypeOf(t)||s(t))?this._bodyArrayBuffer=p(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var t=h(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?h(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(d)}),this.text=function(){var t,e,r,n=h(this);if(n)return n;if(this._bodyBlob)return t=this._bodyBlob,e=new FileReader,r=g(e),e.readAsText(t),r;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=new Array(e.length),n=0;n-1?n:r),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function m(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var r=t.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(n),decodeURIComponent(i))}})),e}function w(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new c(e.headers),this.url=e.url||"",this._initBody(t)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},v.call(b.prototype),v.call(w.prototype),w.prototype.clone=function(){return new w(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new c(this.headers),url:this.url})},w.error=function(){var t=new w(null,{status:0,statusText:""});return t.type="error",t};var k=[301,302,303,307,308];w.redirect=function(t,e){if(-1===k.indexOf(e))throw new RangeError("Invalid status code");return new w(null,{status:e,headers:{location:t}})},e.DOMException=t.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(t,e){this.message=t,this.name=e;var r=Error(t);this.stack=r.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function D(t,r){return new Promise((function(n,o){var a=new b(t,r);if(a.signal&&a.signal.aborted)return o(new e.DOMException("Aborted","AbortError"));var u=new XMLHttpRequest;function s(){u.abort()}u.onload=function(){var t,e,r={status:u.status,statusText:u.statusText,headers:(t=u.getAllResponseHeaders()||"",e=new c,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var r=t.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();e.append(n,i)}})),e)};r.url="responseURL"in u?u.responseURL:r.headers.get("X-Request-URL");var i="response"in u?u.response:u.responseText;n(new w(i,r))},u.onerror=function(){o(new TypeError("Network request failed"))},u.ontimeout=function(){o(new TypeError("Network request failed"))},u.onabort=function(){o(new e.DOMException("Aborted","AbortError"))},u.open(a.method,a.url,!0),"include"===a.credentials?u.withCredentials=!0:"omit"===a.credentials&&(u.withCredentials=!1),"responseType"in u&&i&&(u.responseType="blob"),a.headers.forEach((function(t,e){u.setRequestHeader(e,t)})),a.signal&&(a.signal.addEventListener("abort",s),u.onreadystatechange=function(){4===u.readyState&&a.signal.removeEventListener("abort",s)}),u.send(void 0===a._bodyInit?null:a._bodyInit)}))}D.polyfill=!0,t.fetch||(t.fetch=D,t.Headers=c,t.Request=b,t.Response=w),e.Headers=c,e.Request=b,e.Response=w,e.fetch=D}({})}(r),delete r.fetch.polyfill,(e=r.fetch).default=r.fetch,e.fetch=r.fetch,e.Headers=r.Headers,e.Request=r.Request,e.Response=r.Response,t.exports=e}));function x(t,e){e=e||{};const r=Object.assign({},e.headers||{},t.headers||{});return Object.assign({},e,t,{headers:r})}const O={get:(t,e,r)=>"send"===e?async()=>{const e=await E(t.uri,x({method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify(t.payload)},t.defaultOptions));return await e.json()}:(...n)=>{const i=t.id;return t.id=t.id+1,t.payload.push({jsonrpc:"2.0",id:i,method:e,params:n}),r}},C={get:(t,e)=>"batch"===e?()=>new Proxy({id:Math.round(1e7*Math.random()),payload:[],uri:t.uri,defaultOptions:t.defaultOptions},O):async(...r)=>{const n=Math.round(1e7*Math.random()),i=await E(t.uri,x({method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:n,method:e,params:r})},t.defaultOptions)),o=await i.json();if(o.id!==n)throw new Error("JSONRPCError: response ID does not match request ID!");if(o.error)throw new Error(`JSONRPCError: server error ${JSON.stringify(o.error)}`);return o.result}};class ${constructor(t,e={}){return this.uri=t,this.defaultOptions=e,new Proxy(this,C)}static create(t){return new $(t)}}function I(t){return a.BigInt(t)}function j(t){return"0x"+t.toString(16)}function R(t){return function(e,r){if(!(r instanceof ArrayBuffer)){let n=j(a.BigInt(r)).substr(2);if(n.length%2!=0&&(n="0"+n),n.length/2>t)throw new Error(`${e} is ${n.length/2} bytes long, expected length is ${t}!`);const i=new DataView(new ArrayBuffer(t));for(let t=0;t0&&r.byteLength!==t)throw new Error(`${e} has invalid length ${r.byteLength}, required: ${t}`);return r}}function M(t,e,r){const n={};for(const[i,o]of Object.entries(r)){const r=e[i];if(!r)throw new Error(`${t} is missing ${i}!`);n[i]=o(`${t}.${i}`,r)}return n}function N(t,{debugPath:e="script"}={}){return M(e,t,{code_hash:z(32),hash_type:function(t,e){switch(e){case"data":return 0;case"type":return 1;case 0:case 1:return e;default:throw new Error(`${t}.hash_type has invalid value: ${e}`)}},args:z(-1)})}function L(t,{debugPath:e="out_point"}={}){return M(e,t,{tx_hash:z(32),index:R(4)})}function U(t){return function(e,r){return t(r,{debugPath:e})}}function V(t,{debugPath:e="cell_input"}={}){return M(e,t,{since:R(8),previous_output:U(L)})}function q(t,{debugPath:e="cell_output"}={}){const r=M(e,t,{capacity:R(8),lock:U(N)});return t.type&&(r.type_=N(t.type,{debugPath:`${e}.type`})),r}function F(t,{debugPath:e="cell_dep"}={}){return M(e,t,{out_point:U(L),dep_type:function(t,e){switch(e){case"code":return 0;case"dep_group":return 1;case 0:case 1:return e;default:throw new Error(`${t}.dep_type has invalid value: ${e}`)}}})}function H(t){return function(e,r){return r.map(((r,n)=>t(`${e}[${n}]`,r)))}}function G(t,{debugPath:e="raw_transaction"}={}){return M(e,t,{version:R(4),cell_deps:H(U(F)),header_deps:H(z(32)),inputs:H(U(V)),outputs:H(U(q)),outputs_data:H(z(-1))})}function W(t,{debugPath:e="transaction"}={}){const r=G(t,{debugPath:`(raw)${e}`}),n=M(e,t,{witnesses:H(z(-1))});return n.raw=r,n}function J(t,{debugPath:e="raw_header"}={}){return M(e,t,{version:R(4),compact_target:R(4),timestamp:R(8),number:R(8),epoch:R(8),parent_hash:z(32),transactions_root:z(32),proposals_hash:z(32),uncles_hash:z(32),dao:z(32)})}function X(t,{debugPath:e="header"}={}){const r=J(t,{debugPath:`(raw)${e}`}),n=M(e,t,{nonce:R(16)});return n.raw=r,n}function Q(t,{debugPath:e="uncle_block"}={}){return M(e,t,{header:U(X),proposals:H(z(10))})}var K=Object.freeze({__proto__:null,NormalizeScript:N,NormalizeOutPoint:L,NormalizeCellInput:V,NormalizeCellOutput:q,NormalizeCellDep:F,NormalizeRawTransaction:G,NormalizeTransaction:W,NormalizeRawHeader:J,NormalizeHeader:X,NormalizeUncleBlock:Q,NormalizeBlock:function(t,{debugPath:e="block"}={}){return M(e,t,{header:U(X),uncles:H(U(Q)),transactions:H(U(W)),proposals:H(z(10))})},NormalizeCellbaseWitness:function(t,{debugPath:e="cellbase_witness"}={}){return M(e,t,{lock:U(N),message:z(-1)})},NormalizeWitnessArgs:function(t,{debugPath:e="witness_args"}={}){const r={};return t.lock&&(r.lock=z(-1)(`${e}.lock`,t.lock)),t.input_type&&(r.input_type=z(-1)(`${e}.input_type`,t.input_type)),t.output_type&&(r.output_type=z(-1)(`${e}.output_type`,t.output_type)),r}});function Y(t,e){return e instanceof Object&&e.serializeJson instanceof Function?e.serializeJson.call(e):e}function Z(t,e,r){if(!((e=Y(0,e))instanceof Object))throw new Error(`Transformed ${t} is not an object!`);const n={};for(const[i,o]of Object.entries(r)){let r=e[i];if(!r){r=e[i.replace(/(_[a-z])/g,(t=>t.toUpperCase().replace("_","")))]}r&&(n[i]=o(`${t}.${i}`,r))}return n}function tt(t,{validation:e=!0,debugPath:r="script"}={}){return t=Z(r,t,{code_hash:Y,hash_type:Y,args:Y}),e&&f(t,{debugPath:`(transformed) ${r}`}),t}function et(t,{validation:e=!0,debugPath:r="out_point"}={}){return t=Z(r,t,{tx_hash:Y,index:Y}),e&&c(t,{debugPath:`(transformed) ${r}`}),t}function rt(t){return function(e,r){return t(r,{validation:!1,debugPath:e})}}function nt(t,{validation:e=!0,debugPath:r="cell_input"}={}){return t=Z(r,t,{since:Y,previous_output:rt(et)}),e&&h(t,{debugPath:`(transformed) ${r}`}),t}function it(t,{validation:e=!0,debugPath:r="cell_output"}={}){return t=Z(r,t,{capacity:Y,lock:rt(tt),type:rt(tt)}),e&&g(t,{debugPath:`(transformed) ${r}`}),t}function ot(t,{validation:e=!0,debugPath:r="cell_dep"}={}){return t=Z(r,t,{out_point:rt(et),dep_type:Y}),e&&d(t,{debugPath:`(transformed) ${r}`}),t}function at(t){return function(e,r){return r.map(((r,n)=>t(`${e}[${n}]`,r)))}}function ut(t,{validation:e=!0,debugPath:r="transaction"}={}){return t=Z(r,t,{version:Y,cell_deps:at(rt(ot)),header_deps:at(Y),inputs:at(rt(nt)),outputs:at(rt(it)),outputs_data:at(Y),witnesses:at(Y)}),e&&m(t,{debugPath:`(transformed) ${r}`}),t}function st(t,{validation:e=!0,debugPath:r="header"}={}){return t=Z(r,t,{version:Y,compact_target:Y,timestamp:Y,number:Y,epoch:Y,parent_hash:Y,transactions_root:Y,proposals_hash:Y,uncles_hash:Y,dao:Y,nonce:Y}),e&&k(t,{debugPath:`(transformed) ${r}`}),t}function _t(t,{validation:e=!0,debugPath:r="uncle_block"}={}){return t=Z(r,t,{header:rt(st),proposals:at(Y)}),e&&B(t,{debugPath:`(transformed) ${r}`}),t}var lt=Object.freeze({__proto__:null,TransformScript:tt,TransformOutPoint:et,TransformCellInput:nt,TransformCellOutput:it,TransformCellDep:ot,TransformRawTransaction:function(t,{validation:e=!0,debugPath:r="raw_transaction"}={}){return t=Z(r,t,{version:Y,cell_deps:at(rt(ot)),header_deps:at(Y),inputs:at(rt(nt)),outputs:at(rt(it)),outputs_data:at(Y)}),e&&b(t,{debugPath:`(transformed) ${r}`}),t},TransformTransaction:ut,TransformRawHeader:function(t,{validation:e=!0,debugPath:r="raw_header"}={}){return t=Z(r,t,{version:Y,compact_target:Y,timestamp:Y,number:Y,epoch:Y,parent_hash:Y,transactions_root:Y,proposals_hash:Y,uncles_hash:Y,dao:Y}),e&&w(t,{debugPath:`(transformed) ${r}`}),t},TransformHeader:st,TransformUncleBlock:_t,TransformBlock:function(t,{validation:e=!0,debugPath:r="block"}={}){return t=Z(r,t,{header:rt(st),uncles:at(rt(_t)),transactions:at(rt(ut)),proposals:at(Y)}),e&&P(t,{debugPath:`(transformed) ${r}`}),t},TransformCellbaseWitness:function(t,{validation:e=!0,debugPath:r="cellbase_witness"}={}){return t=Z(r,t,{lock:rt(tt),message:Y}),e&&A(t,{debugPath:`(transformed) ${r}`}),t},TransformWitnessArgs:function(t,{validation:e=!0,debugPath:r="witness_args"}={}){return t=Z(r,t,{lock:Y,input_type:Y,output_type:Y}),e&&T(t,{debugPath:`(transformed) ${r}`}),t}});var ft=Object.freeze({__proto__:null,RPCCollector:class{constructor(t,e,{skipCellWithContent:r=!0,loadData:i=!1,loadBlockNumber:o=!0}={}){this.rpc=t,this.lockHash=new n(e).serializeJson(),this.skipCellWithContent=r,this.loadData=i,this.loadBlockNumber=o}async*collect(){const t=I(await this.rpc.get_tip_block_number());let e=a.BigInt(0);for(;a.lessThanOrEqual(e,t);){let r=a.add(e,a.BigInt(100));a.greaterThan(r,t)&&(r=t);const n=await this.rpc.get_cells_by_lock_hash(this.lockHash,j(e),j(r));for(const t of n){if(this.skipCellWithContent&&(t.type||a.greaterThan(I(t.output_data_len),a.BigInt(100))))continue;let e=null;if(this.loadData){e=(await this.rpc.get_live_cell(t.out_point,!0)).cell.data.content}let r=null;if(this.loadBlockNumber){r=(await this.rpc.get_header(t.block_hash)).number}yield{cellbase:t.cellbase,cell_output:{capacity:t.capacity,lock:t.lock,type:t.type},out_point:t.out_point,block_hash:t.block_hash,data:e,output_data_len:t.output_data_len,block_number:r}}e=a.add(r,a.BigInt(1))}}}});t.BigIntToHexString=j,t.HexStringToBigInt=I,t.RPC=$,t.Reader=n,t.TransactionDumper=class{constructor(t,{validateTransaction:e=!0,depGroupUnpacker:r=null}={}){this.rpc=t,this.validateTransaction=e,this.depGroupUnpacker=r}async dumpByHash(t){const e=(await this.rpc.get_transaction(t)).transaction;return delete e.hash,await this.dump(e)}async dump(t){this.validateTransaction&&m(t);const e=[];for(const r of t.inputs){const{output:t,data:n,header:i}=await this._resolveOutPoint(r.previous_output);e.push({input:r,output:t,data:n,header:i})}const r=[];for(const e of t.cell_deps){const{output:t,data:i,header:o}=await this._resolveOutPoint(e.out_point);if(r.push({cell_dep:e,output:t,data:i,header:o}),"dep_group"===e.dep_type){if(!this.depGroupUnpacker)throw new Error("depGroupUnpacker must be provided when the transaction contains dep_group!");const t=this.depGroupUnpacker(new n(i));for(const e of t){c(e);const{output:t,data:n,header:i}=await this._resolveOutPoint(e);r.push({cell_dep:{out_point:e,dep_type:"code"},output:t,data:n,header:i})}}}const i=[];for(const e of t.header_deps)i.push(await this.rpc.get_header(e));return JSON.stringify({mock_info:{inputs:e,cell_deps:r,header_deps:i},tx:t})}async _resolveOutPoint(t){const e=await this.rpc.get_transaction(t.tx_hash);if(!e||!e.transaction)throw new Error(`Transaction ${t.tx_hash} cannot be found!`);const r=e.transaction,n=a.toNumber(a.BigInt(t.index));if(n>=r.outputs.length)throw new Error(`Transaction ${t.tx_hash} does not have output ${n}!`);const i={output:r.outputs[n],data:r.outputs_data[n]};return"committed"===e.tx_status.status&&(i.header=e.tx_status.block_hash),i}},t.VERSION="0.10.2",t.cell_collectors=ft,t.normalizers=K,t.transformers=lt,t.validators=S,Object.defineProperty(t,"__esModule",{value:!0})})); From aef1db274b2f0f4def071fcfed1147523273846f Mon Sep 17 00:00:00 2001 From: beiqian Date: Mon, 17 Jan 2022 09:57:55 +0800 Subject: [PATCH 3/3] integrate ckb-js-toolkit into lumos --- Makefile | 4 +- packages/base/lib/denormalizers.js | 2 +- packages/base/lib/indexer.js | 2 +- packages/base/lib/utils.d.ts | 2 +- packages/base/lib/utils.js | 2 +- packages/base/lib/values.js | 2 +- packages/base/package.json | 2 +- packages/base/tests/denormalizers.js | 2 +- packages/base/tests/utils.test.js | 2 +- packages/ckb-indexer/package.json | 2 +- packages/ckb-indexer/src/collector.ts | 2 +- packages/ckb-indexer/src/indexer.ts | 2 +- packages/ckb-indexer/src/rpc.ts | 2 +- .../common-scripts/examples/pw_lock/lock.ts | 2 +- packages/common-scripts/package.json | 2 +- packages/common-scripts/src/anyone_can_pay.ts | 2 +- packages/common-scripts/src/common.ts | 2 +- packages/common-scripts/src/dao.ts | 2 +- packages/common-scripts/src/deploy.ts | 2 +- packages/common-scripts/src/helper.ts | 2 +- packages/common-scripts/src/locktime_pool.ts | 2 +- .../common-scripts/src/secp256k1_blake160.ts | 2 +- .../src/secp256k1_blake160_multisig.ts | 2 +- packages/core/LICENSE | 21 - packages/core/package-lock.json | 2689 ----------------- packages/helpers/package.json | 2 +- packages/helpers/src/index.ts | 2 +- packages/indexer/lib/index.js | 2 +- packages/indexer/package.json | 2 +- packages/lumos/package.json | 2 +- packages/lumos/src/index.ts | 7 +- packages/rpc/package.json | 2 +- packages/rpc/src/index.ts | 2 +- packages/sql-indexer/lib/index.js | 2 +- packages/sql-indexer/package.json | 2 +- packages/testkit/package.json | 2 +- packages/testkit/src/mock-ckb-jsonrpc.ts | 2 +- packages/{core => toolkit}/.gitignore | 0 packages/{core => toolkit}/README.md | 0 packages/{core => toolkit}/images/toolkit.svg | 0 packages/{core => toolkit}/index.d.ts | 0 packages/{core => toolkit}/package.json | 20 +- packages/{core => toolkit}/rollup.config.js | 2 +- .../src/cell_collectors/index.js | 0 .../src/cell_collectors/rpc_collector.js | 0 packages/{core => toolkit}/src/index.js | 0 packages/{core => toolkit}/src/normalizers.js | 0 packages/{core => toolkit}/src/reader.js | 0 packages/{core => toolkit}/src/rpc.js | 0 .../src/transaction_dumper.js | 0 .../{core => toolkit}/src/transformers.js | 0 packages/{core => toolkit}/src/validators.js | 0 .../testfiles/blockchain.umd.js | 0 .../{core => toolkit}/tests/serializers.js | 2 +- .../{core => toolkit}/tests/transformers.js | 2 +- .../{core => toolkit}/tests/validators.js | 2 +- packages/transaction-manager/lib/index.js | 2 +- packages/transaction-manager/package.json | 2 +- yarn.lock | 8 - 59 files changed, 61 insertions(+), 2766 deletions(-) delete mode 100644 packages/core/LICENSE delete mode 100644 packages/core/package-lock.json rename packages/{core => toolkit}/.gitignore (100%) rename packages/{core => toolkit}/README.md (100%) rename packages/{core => toolkit}/images/toolkit.svg (100%) rename packages/{core => toolkit}/index.d.ts (100%) rename packages/{core => toolkit}/package.json (82%) rename packages/{core => toolkit}/rollup.config.js (96%) rename packages/{core => toolkit}/src/cell_collectors/index.js (100%) rename packages/{core => toolkit}/src/cell_collectors/rpc_collector.js (100%) rename packages/{core => toolkit}/src/index.js (100%) rename packages/{core => toolkit}/src/normalizers.js (100%) rename packages/{core => toolkit}/src/reader.js (100%) rename packages/{core => toolkit}/src/rpc.js (100%) rename packages/{core => toolkit}/src/transaction_dumper.js (100%) rename packages/{core => toolkit}/src/transformers.js (100%) rename packages/{core => toolkit}/src/validators.js (100%) rename packages/{core => toolkit}/testfiles/blockchain.umd.js (100%) rename packages/{core => toolkit}/tests/serializers.js (99%) rename packages/{core => toolkit}/tests/transformers.js (99%) rename packages/{core => toolkit}/tests/validators.js (99%) diff --git a/Makefile b/Makefile index 89daf2de7..aa47aba2c 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,6 @@ build: yarn workspace @ckb-lumos/bi build + yarn workspace @ckb-lumos/toolkit build yarn workspace @ckb-lumos/config-manager build yarn workspace @ckb-lumos/helpers build yarn workspace @ckb-lumos/rpc build @@ -8,13 +9,13 @@ build: yarn workspace @ckb-lumos/hd-cache build yarn workspace @ckb-lumos/ckb-indexer build yarn workspace @ckb-lumos/lumos build - yarn workspace @ckb-lumos/core build build-release: build yarn workspace @ckb-lumos/lumos build:umd test: yarn workspace @ckb-lumos/bi test + yarn workspace @ckb-lumos/toolkit test yarn workspace @ckb-lumos/base test yarn workspace @ckb-lumos/common-scripts test yarn workspace @ckb-lumos/config-manager test @@ -24,7 +25,6 @@ test: yarn workspace @ckb-lumos/indexer test yarn workspace @ckb-lumos/transaction-manager test yarn workspace @ckb-lumos/rpc test - yarn workspace @ckb-lumos/core test test-coverage: yarn c8 --reporter=cobertura --reporter=html --clean -o coverage make test diff --git a/packages/base/lib/denormalizers.js b/packages/base/lib/denormalizers.js index 7f2ba90c7..0e0d2af2d 100644 --- a/packages/base/lib/denormalizers.js +++ b/packages/base/lib/denormalizers.js @@ -1,4 +1,4 @@ -const { Reader } = require("ckb-js-toolkit"); +const { Reader } = require("@ckb-lumos/toolkit"); function DenormalizeOutPoint(outPoint) { return { diff --git a/packages/base/lib/indexer.js b/packages/base/lib/indexer.js index 233e23b48..316cced2b 100644 --- a/packages/base/lib/indexer.js +++ b/packages/base/lib/indexer.js @@ -1,4 +1,4 @@ -const { validators } = require("ckb-js-toolkit"); +const { validators } = require("@ckb-lumos/toolkit"); const utils = require("./utils"); // Notice this TransactionCollector implementation only uses indexer diff --git a/packages/base/lib/utils.d.ts b/packages/base/lib/utils.d.ts index c9968a37e..77c84912c 100644 --- a/packages/base/lib/utils.d.ts +++ b/packages/base/lib/utils.d.ts @@ -1,4 +1,4 @@ -import { Reader } from "ckb-js-toolkit"; +import { Reader } from "@ckb-lumos/toolkit"; import { HexNumber } from ".."; import { Script, Input } from "./api"; import { Hash, HexString } from "./primitive"; diff --git a/packages/base/lib/utils.js b/packages/base/lib/utils.js index 533b8a9d0..b93ab660c 100644 --- a/packages/base/lib/utils.js +++ b/packages/base/lib/utils.js @@ -1,5 +1,5 @@ const blake2b = require("blake2b"); -const { validators, normalizers, Reader } = require("ckb-js-toolkit"); +const { validators, normalizers, Reader } = require("@ckb-lumos/toolkit"); const { SerializeScript, SerializeCellInput } = require("./core"); const { xxHash32 } = require("js-xxhash"); diff --git a/packages/base/lib/values.js b/packages/base/lib/values.js index 8f52d3eb6..f0b25bf15 100644 --- a/packages/base/lib/values.js +++ b/packages/base/lib/values.js @@ -1,6 +1,6 @@ // This module provides a ValueObject implementation for CKB related data // structures to allow seamless immutable.js integration. -const { validators, normalizers, Reader } = require("ckb-js-toolkit"); +const { validators, normalizers, Reader } = require("@ckb-lumos/toolkit"); const { xxHash32 } = require("js-xxhash"); const core = require("./core"); const { ckbHash } = require("./utils"); diff --git a/packages/base/package.json b/packages/base/package.json index ba6e2c205..1511c6fe2 100644 --- a/packages/base/package.json +++ b/packages/base/package.json @@ -37,7 +37,7 @@ }, "dependencies": { "blake2b": "^2.1.3", - "ckb-js-toolkit": "^0.10.2", + "@ckb-lumos/toolkit": "^0.17.0-rc6", "js-xxhash": "^1.0.4" } } diff --git a/packages/base/tests/denormalizers.js b/packages/base/tests/denormalizers.js index f9579364d..4baa338fa 100644 --- a/packages/base/tests/denormalizers.js +++ b/packages/base/tests/denormalizers.js @@ -1,5 +1,5 @@ const test = require("ava"); -const { normalizers } = require("ckb-js-toolkit"); +const { normalizers } = require("@ckb-lumos/toolkit"); const core = require("../lib/core"); const denormalizers = require("../lib/denormalizers"); diff --git a/packages/base/tests/utils.test.js b/packages/base/tests/utils.test.js index bb7657886..7e79da9de 100644 --- a/packages/base/tests/utils.test.js +++ b/packages/base/tests/utils.test.js @@ -1,5 +1,5 @@ const test = require("ava"); -const { Reader } = require("ckb-js-toolkit"); +const { Reader } = require("@ckb-lumos/toolkit"); const { CKBHasher, diff --git a/packages/ckb-indexer/package.json b/packages/ckb-indexer/package.json index fa7cb3719..77033b22b 100644 --- a/packages/ckb-indexer/package.json +++ b/packages/ckb-indexer/package.json @@ -26,7 +26,7 @@ "dependencies": { "@ckb-lumos/base": "^0.17.0-rc6", "@ckb-lumos/rpc": "^0.17.0-rc6", - "ckb-js-toolkit": "^0.10.2", + "@ckb-lumos/toolkit": "^0.17.0-rc6", "cross-fetch": "^3.1.4", "events": "^3.3.0" }, diff --git a/packages/ckb-indexer/src/collector.ts b/packages/ckb-indexer/src/collector.ts index 1bb933675..26c045db7 100644 --- a/packages/ckb-indexer/src/collector.ts +++ b/packages/ckb-indexer/src/collector.ts @@ -1,5 +1,5 @@ import { utils, Cell, BaseCellCollector } from "@ckb-lumos/base"; -import { validators } from "ckb-js-toolkit"; +import { validators } from "@ckb-lumos/toolkit"; import { SearchKeyFilter, CKBIndexerQueryOptions, diff --git a/packages/ckb-indexer/src/indexer.ts b/packages/ckb-indexer/src/indexer.ts index 060f5ce21..1e3d7a824 100644 --- a/packages/ckb-indexer/src/indexer.ts +++ b/packages/ckb-indexer/src/indexer.ts @@ -9,7 +9,7 @@ import { utils, Block, } from "@ckb-lumos/base"; -import { validators } from "ckb-js-toolkit"; +import { validators } from "@ckb-lumos/toolkit"; import { RPC } from "@ckb-lumos/rpc"; import { request, requestBatch } from "./services"; import { CKBCellCollector } from "./collector"; diff --git a/packages/ckb-indexer/src/rpc.ts b/packages/ckb-indexer/src/rpc.ts index 564c501a5..895ba19d6 100644 --- a/packages/ckb-indexer/src/rpc.ts +++ b/packages/ckb-indexer/src/rpc.ts @@ -1,4 +1,4 @@ -import { RPC as ToolkitRPC } from "ckb-js-toolkit"; +import { RPC as ToolkitRPC } from "@ckb-lumos/toolkit"; import { HexString, Tip } from "@ckb-lumos/base"; import { GetCellsResults, diff --git a/packages/common-scripts/examples/pw_lock/lock.ts b/packages/common-scripts/examples/pw_lock/lock.ts index d64017300..dfd818792 100644 --- a/packages/common-scripts/examples/pw_lock/lock.ts +++ b/packages/common-scripts/examples/pw_lock/lock.ts @@ -20,7 +20,7 @@ import { createTransactionFromSkeleton, } from "@ckb-lumos/helpers"; import { getConfig, Config, initializeConfig } from "@ckb-lumos/config-manager"; -import { Reader, normalizers } from "ckb-js-toolkit"; +import { Reader, normalizers } from "@ckb-lumos/toolkit"; import { Set } from "immutable"; import keccak, { Keccak } from "keccak"; diff --git a/packages/common-scripts/package.json b/packages/common-scripts/package.json index ca665bdc6..44c323cf0 100644 --- a/packages/common-scripts/package.json +++ b/packages/common-scripts/package.json @@ -28,7 +28,7 @@ "@ckb-lumos/config-manager": "^0.17.0-rc6", "@ckb-lumos/helpers": "^0.17.0-rc6", "@ckb-lumos/rpc": "^0.17.0-rc6", - "ckb-js-toolkit": "^0.10.2", + "@ckb-lumos/toolkit": "^0.17.0-rc6", "immutable": "^4.0.0-rc.12" }, "repository": { diff --git a/packages/common-scripts/src/anyone_can_pay.ts b/packages/common-scripts/src/anyone_can_pay.ts index f0f42a8c6..7932c2f62 100644 --- a/packages/common-scripts/src/anyone_can_pay.ts +++ b/packages/common-scripts/src/anyone_can_pay.ts @@ -22,7 +22,7 @@ import { parseAddress, TransactionSkeletonType, } from "@ckb-lumos/helpers"; -import { normalizers, Reader } from "ckb-js-toolkit"; +import { normalizers, Reader } from "@ckb-lumos/toolkit"; import { List, Set } from "immutable"; import { FromInfo, parseFromInfo } from "./from_info"; import { diff --git a/packages/common-scripts/src/common.ts b/packages/common-scripts/src/common.ts index 7f20f01e9..1fca43653 100644 --- a/packages/common-scripts/src/common.ts +++ b/packages/common-scripts/src/common.ts @@ -26,7 +26,7 @@ import anyoneCanPay from "./anyone_can_pay"; const { ScriptValue } = values; import { Set } from "immutable"; import { SerializeTransaction } from "@ckb-lumos/base/lib/core"; -import { normalizers } from "ckb-js-toolkit"; +import { normalizers } from "@ckb-lumos/toolkit"; import { isAcpScript } from "./helper"; function defaultLogger(level: string, message: string) { diff --git a/packages/common-scripts/src/dao.ts b/packages/common-scripts/src/dao.ts index a1a368418..d6b4fde84 100644 --- a/packages/common-scripts/src/dao.ts +++ b/packages/common-scripts/src/dao.ts @@ -21,7 +21,7 @@ import { import { getConfig, Config } from "@ckb-lumos/config-manager"; const { toBigUInt64LE, readBigUInt64LE } = utils; const { parseSince } = sinceUtils; -import { normalizers, Reader } from "ckb-js-toolkit"; +import { normalizers, Reader } from "@ckb-lumos/toolkit"; import secp256k1Blake160 from "./secp256k1_blake160"; import secp256k1Blake160Multisig from "./secp256k1_blake160_multisig"; import { FromInfo, parseFromInfo } from "./from_info"; diff --git a/packages/common-scripts/src/deploy.ts b/packages/common-scripts/src/deploy.ts index 96b6ae94c..a3c981abc 100644 --- a/packages/common-scripts/src/deploy.ts +++ b/packages/common-scripts/src/deploy.ts @@ -19,7 +19,7 @@ import { createTransactionFromSkeleton, parseAddress, } from "@ckb-lumos/helpers"; -import { Reader, normalizers } from "ckb-js-toolkit"; +import { Reader, normalizers } from "@ckb-lumos/toolkit"; import { RPC } from "@ckb-lumos/rpc"; import { Set } from "immutable"; import { FromInfo, parseFromInfo, MultisigScript } from "./from_info"; diff --git a/packages/common-scripts/src/helper.ts b/packages/common-scripts/src/helper.ts index 7728ddedc..a53fc9efa 100644 --- a/packages/common-scripts/src/helper.ts +++ b/packages/common-scripts/src/helper.ts @@ -14,7 +14,7 @@ import { HexString, } from "@ckb-lumos/base"; const { CKBHasher, ckbHash } = utils; -import { normalizers, Reader } from "ckb-js-toolkit"; +import { normalizers, Reader } from "@ckb-lumos/toolkit"; import { Config } from "@ckb-lumos/config-manager"; export function addCellDep( diff --git a/packages/common-scripts/src/locktime_pool.ts b/packages/common-scripts/src/locktime_pool.ts index eac1ef778..bb1ce7671 100644 --- a/packages/common-scripts/src/locktime_pool.ts +++ b/packages/common-scripts/src/locktime_pool.ts @@ -26,7 +26,7 @@ import { } from "@ckb-lumos/base"; const { toBigUInt64LE, readBigUInt64LE } = utils; const { ScriptValue } = values; -import { normalizers, Reader } from "ckb-js-toolkit"; +import { normalizers, Reader } from "@ckb-lumos/toolkit"; import { generateDaoScript, isSecp256k1Blake160MultisigScript, diff --git a/packages/common-scripts/src/secp256k1_blake160.ts b/packages/common-scripts/src/secp256k1_blake160.ts index 7949b4489..2d05f6276 100644 --- a/packages/common-scripts/src/secp256k1_blake160.ts +++ b/packages/common-scripts/src/secp256k1_blake160.ts @@ -1,5 +1,5 @@ import { Set } from "immutable"; -import { normalizers, Reader } from "ckb-js-toolkit"; +import { normalizers, Reader } from "@ckb-lumos/toolkit"; import { parseAddress, minimalCellCapacity } from "@ckb-lumos/helpers"; import { core, diff --git a/packages/common-scripts/src/secp256k1_blake160_multisig.ts b/packages/common-scripts/src/secp256k1_blake160_multisig.ts index 5ba113e8e..885de379a 100644 --- a/packages/common-scripts/src/secp256k1_blake160_multisig.ts +++ b/packages/common-scripts/src/secp256k1_blake160_multisig.ts @@ -20,7 +20,7 @@ import { } from "@ckb-lumos/base"; import { getConfig, Config } from "@ckb-lumos/config-manager"; const { ScriptValue } = values; -import { normalizers, Reader } from "ckb-js-toolkit"; +import { normalizers, Reader } from "@ckb-lumos/toolkit"; import { Set } from "immutable"; import { addCellDep, diff --git a/packages/core/LICENSE b/packages/core/LICENSE deleted file mode 100644 index d10177c1c..000000000 --- a/packages/core/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2020 Xuejie Xiao - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/packages/core/package-lock.json b/packages/core/package-lock.json deleted file mode 100644 index ee42d6752..000000000 --- a/packages/core/package-lock.json +++ /dev/null @@ -1,2689 +0,0 @@ -{ - "name": "ckb-js-toolkit", - "version": "0.10.2", - "lockfileVersion": 1, - "requires": true, - "dependencies": { - "@babel/code-frame": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz", - "integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==", - "dev": true, - "requires": { - "@babel/highlight": "^7.8.3" - } - }, - "@babel/helper-validator-identifier": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz", - "integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==", - "dev": true - }, - "@babel/highlight": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.8.3.tgz", - "integrity": "sha512-PX4y5xQUvy0fnEVHrYOarRPXVWafSjTW9T0Hab8gVIawpl2Sj0ORyrygANq+KjcNlSSTw0YCLSNA8OyZ1I4yEg==", - "dev": true, - "requires": { - "chalk": "^2.0.0", - "esutils": "^2.0.2", - "js-tokens": "^4.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, - "@concordance/react": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@concordance/react/-/react-2.0.0.tgz", - "integrity": "sha512-huLSkUuM2/P+U0uy2WwlKuixMsTODD8p4JVQBI4VKeopkiN0C7M3N9XYVawb4M+4spN5RrO/eLhk7KoQX6nsfA==", - "dev": true, - "requires": { - "arrify": "^1.0.1" - }, - "dependencies": { - "arrify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", - "dev": true - } - } - }, - "@nodelib/fs.scandir": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz", - "integrity": "sha512-eGmwYQn3gxo4r7jdQnkrrN6bY478C3P+a/y72IJukF8LjB6ZHeB3c+Ehacj3sYeSmUXGlnA67/PmbM9CVwL7Dw==", - "dev": true, - "requires": { - "@nodelib/fs.stat": "2.0.3", - "run-parallel": "^1.1.9" - } - }, - "@nodelib/fs.stat": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.3.tgz", - "integrity": "sha512-bQBFruR2TAwoevBEd/NWMoAAtNGzTRgdrqnYCc7dhzfoNvqPzLyqlEQnzZ3kVnNrSp25iyxE00/3h2fqGAGArA==", - "dev": true - }, - "@nodelib/fs.walk": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.4.tgz", - "integrity": "sha512-1V9XOY4rDW0rehzbrcqAmHnz8e7SKvX27gh8Gt2WgB0+pdzdiLV83p72kZPU+jvMbS1qU5mauP2iOvO8rhmurQ==", - "dev": true, - "requires": { - "@nodelib/fs.scandir": "2.1.3", - "fastq": "^1.6.0" - } - }, - "@rollup/plugin-commonjs": { - "version": "15.0.0", - "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-15.0.0.tgz", - "integrity": "sha512-8uAdikHqVyrT32w1zB9VhW6uGwGjhKgnDNP4pQJsjdnyF4FgCj6/bmv24c7v2CuKhq32CcyCwRzMPEElaKkn0w==", - "dev": true, - "requires": { - "@rollup/pluginutils": "^3.1.0", - "commondir": "^1.0.1", - "estree-walker": "^2.0.1", - "glob": "^7.1.6", - "is-reference": "^1.2.1", - "magic-string": "^0.25.7", - "resolve": "^1.17.0" - }, - "dependencies": { - "resolve": { - "version": "1.17.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", - "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", - "dev": true, - "requires": { - "path-parse": "^1.0.6" - } - } - } - }, - "@rollup/plugin-node-resolve": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-9.0.0.tgz", - "integrity": "sha512-gPz+utFHLRrd41WMP13Jq5mqqzHL3OXrfj3/MkSyB6UBIcuNt9j60GCbarzMzdf1VHFpOxfQh/ez7wyadLMqkg==", - "dev": true, - "requires": { - "@rollup/pluginutils": "^3.1.0", - "@types/resolve": "1.17.1", - "builtin-modules": "^3.1.0", - "deepmerge": "^4.2.2", - "is-module": "^1.0.0", - "resolve": "^1.17.0" - }, - "dependencies": { - "resolve": { - "version": "1.17.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", - "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", - "dev": true, - "requires": { - "path-parse": "^1.0.6" - } - } - } - }, - "@rollup/plugin-replace": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/@rollup/plugin-replace/-/plugin-replace-2.3.3.tgz", - "integrity": "sha512-XPmVXZ7IlaoWaJLkSCDaa0Y6uVo5XQYHhiMFzOd5qSv5rE+t/UJToPIOE56flKIxBFQI27ONsxb7dqHnwSsjKQ==", - "dev": true, - "requires": { - "@rollup/pluginutils": "^3.0.8", - "magic-string": "^0.25.5" - } - }, - "@rollup/pluginutils": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.1.0.tgz", - "integrity": "sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==", - "dev": true, - "requires": { - "@types/estree": "0.0.39", - "estree-walker": "^1.0.1", - "picomatch": "^2.2.2" - }, - "dependencies": { - "estree-walker": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-1.0.1.tgz", - "integrity": "sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==", - "dev": true - }, - "picomatch": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", - "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", - "dev": true - } - } - }, - "@sindresorhus/is": { - "version": "0.14.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz", - "integrity": "sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ==", - "dev": true - }, - "@szmarczak/http-timer": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-1.1.2.tgz", - "integrity": "sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA==", - "dev": true, - "requires": { - "defer-to-connect": "^1.0.1" - } - }, - "@types/color-name": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", - "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==", - "dev": true - }, - "@types/estree": { - "version": "0.0.39", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", - "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", - "dev": true - }, - "@types/events": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz", - "integrity": "sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g==", - "dev": true - }, - "@types/glob": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.1.tgz", - "integrity": "sha512-1Bh06cbWJUHMC97acuD6UMG29nMt0Aqz1vF3guLfG+kHHJhy3AyohZFFxYk2f7Q1SQIrNwvncxAE0N/9s70F2w==", - "dev": true, - "requires": { - "@types/events": "*", - "@types/minimatch": "*", - "@types/node": "*" - } - }, - "@types/minimatch": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz", - "integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==", - "dev": true - }, - "@types/node": { - "version": "13.7.7", - "resolved": "https://registry.npmjs.org/@types/node/-/node-13.7.7.tgz", - "integrity": "sha512-Uo4chgKbnPNlxQwoFmYIwctkQVkMMmsAoGGU4JKwLuvBefF0pCq4FybNSnfkfRCpC7ZW7kttcC/TrRtAJsvGtg==", - "dev": true - }, - "@types/normalize-package-data": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz", - "integrity": "sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA==", - "dev": true - }, - "@types/resolve": { - "version": "1.17.1", - "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.17.1.tgz", - "integrity": "sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==", - "dev": true, - "requires": { - "@types/node": "*" - } - }, - "aggregate-error": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.0.1.tgz", - "integrity": "sha512-quoaXsZ9/BLNae5yiNoUz+Nhkwz83GhWwtYFglcjEQB2NDHCIpApbqXxIFnm4Pq/Nvhrsq5sYJFyohrrxnTGAA==", - "dev": true, - "requires": { - "clean-stack": "^2.0.0", - "indent-string": "^4.0.0" - } - }, - "ansi-align": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.0.tgz", - "integrity": "sha512-ZpClVKqXN3RGBmKibdfWzqCY4lnjEuoNzU5T0oEFpfd/z5qJHVarukridD4juLO2FXMiwUQxr9WqQtaYa8XRYw==", - "dev": true, - "requires": { - "string-width": "^3.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "dev": true - }, - "emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "dev": true, - "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - } - }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "requires": { - "ansi-regex": "^4.1.0" - } - } - } - }, - "ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", - "dev": true - }, - "ansi-styles": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", - "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", - "dev": true, - "requires": { - "@types/color-name": "^1.1.1", - "color-convert": "^2.0.1" - } - }, - "anymatch": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", - "integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==", - "dev": true, - "requires": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - } - }, - "argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, - "requires": { - "sprintf-js": "~1.0.2" - } - }, - "array-find-index": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", - "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=", - "dev": true - }, - "array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true - }, - "arrgv": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/arrgv/-/arrgv-1.0.2.tgz", - "integrity": "sha512-a4eg4yhp7mmruZDQFqVMlxNRFGi/i1r87pt8SDHy0/I8PqSXoUTlWZRdAZo0VXgvEARcujbtTk8kiZRi1uDGRw==", - "dev": true - }, - "arrify": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", - "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==", - "dev": true - }, - "astral-regex": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", - "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", - "dev": true - }, - "ava": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/ava/-/ava-3.5.0.tgz", - "integrity": "sha512-o+xq1RgAZrQ7GX5nddTNeYbUDogwlBoa/Hnt+b1ciCLLxSOj5U6ZFblLNBSKwHtP1X/8R06bmzvX47jmlVu9KQ==", - "dev": true, - "requires": { - "@concordance/react": "^2.0.0", - "ansi-styles": "^4.2.1", - "arrgv": "^1.0.2", - "arrify": "^2.0.1", - "chalk": "^3.0.0", - "chokidar": "^3.3.1", - "chunkd": "^2.0.1", - "ci-parallel-vars": "^1.0.0", - "clean-stack": "^2.2.0", - "clean-yaml-object": "^0.1.0", - "cli-cursor": "^3.1.0", - "cli-truncate": "^2.1.0", - "code-excerpt": "^2.1.1", - "common-path-prefix": "^3.0.0", - "concordance": "^4.0.0", - "convert-source-map": "^1.7.0", - "currently-unhandled": "^0.4.1", - "debug": "^4.1.1", - "del": "^5.1.0", - "emittery": "^0.5.1", - "equal-length": "^1.0.0", - "figures": "^3.1.0", - "globby": "^11.0.0", - "ignore-by-default": "^1.0.0", - "import-local": "^3.0.2", - "indent-string": "^4.0.0", - "is-ci": "^2.0.0", - "is-error": "^2.2.2", - "is-plain-object": "^3.0.0", - "is-promise": "^2.1.0", - "lodash": "^4.17.15", - "matcher": "^2.1.0", - "md5-hex": "^3.0.1", - "ms": "^2.1.2", - "ora": "^4.0.3", - "p-map": "^3.0.0", - "picomatch": "^2.2.1", - "pkg-conf": "^3.1.0", - "plur": "^4.0.0", - "pretty-ms": "^6.0.0", - "read-pkg": "^5.2.0", - "resolve-cwd": "^3.0.0", - "slash": "^3.0.0", - "source-map-support": "^0.5.16", - "stack-utils": "^2.0.1", - "strip-ansi": "^6.0.0", - "supertap": "^1.0.0", - "temp-dir": "^2.0.0", - "trim-off-newlines": "^1.0.1", - "update-notifier": "^4.1.0", - "write-file-atomic": "^3.0.1", - "yargs": "^15.1.0" - } - }, - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true - }, - "binary-extensions": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.0.0.tgz", - "integrity": "sha512-Phlt0plgpIIBOGTT/ehfFnbNlfsDEiqmzE2KRXoX1bLIlir4X/MR+zSyBEkL05ffWgnRSf/DXv+WrUAVr93/ow==", - "dev": true - }, - "blueimp-md5": { - "version": "2.12.0", - "resolved": "https://registry.npmjs.org/blueimp-md5/-/blueimp-md5-2.12.0.tgz", - "integrity": "sha512-zo+HIdIhzojv6F1siQPqPFROyVy7C50KzHv/k/Iz+BtvtVzSHXiMXOpq2wCfNkeBqdCv+V8XOV96tsEt2W/3rQ==", - "dev": true - }, - "boxen": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/boxen/-/boxen-4.2.0.tgz", - "integrity": "sha512-eB4uT9RGzg2odpER62bBwSLvUeGC+WbRjjyyFhGsKnc8wp/m0+hQsMUvUe3H2V0D5vw0nBdO1hCJoZo5mKeuIQ==", - "dev": true, - "requires": { - "ansi-align": "^3.0.0", - "camelcase": "^5.3.1", - "chalk": "^3.0.0", - "cli-boxes": "^2.2.0", - "string-width": "^4.1.0", - "term-size": "^2.1.0", - "type-fest": "^0.8.1", - "widest-line": "^3.1.0" - }, - "dependencies": { - "type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", - "dev": true - } - } - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "requires": { - "fill-range": "^7.0.1" - } - }, - "buffer-from": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", - "dev": true - }, - "builtin-modules": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.1.0.tgz", - "integrity": "sha512-k0KL0aWZuBt2lrxrcASWDfwOLMnodeQjodT/1SxEQAXsHANgo6ZC/VEaSEHCXt7aSTZ4/4H5LKa+tBXmW7Vtvw==", - "dev": true - }, - "cacheable-request": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-6.1.0.tgz", - "integrity": "sha512-Oj3cAGPCqOZX7Rz64Uny2GYAZNliQSqfbePrgAQ1wKAihYmCUnraBtJtKcGR4xz7wF+LoJC+ssFZvv5BgF9Igg==", - "dev": true, - "requires": { - "clone-response": "^1.0.2", - "get-stream": "^5.1.0", - "http-cache-semantics": "^4.0.0", - "keyv": "^3.0.0", - "lowercase-keys": "^2.0.0", - "normalize-url": "^4.1.0", - "responselike": "^1.0.2" - }, - "dependencies": { - "get-stream": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.1.0.tgz", - "integrity": "sha512-EXr1FOzrzTfGeL0gQdeFEvOMm2mzMOglyiOXSTpPC+iAjAKftbr3jpCMWynogwYnM+eSj9sHGc6wjIcDvYiygw==", - "dev": true, - "requires": { - "pump": "^3.0.0" - } - }, - "lowercase-keys": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", - "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==", - "dev": true - } - } - }, - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true - }, - "chalk": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", - "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "chokidar": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.3.1.tgz", - "integrity": "sha512-4QYCEWOcK3OJrxwvyyAOxFuhpvOVCYkr33LPfFNBjAD/w3sEzWsp2BUOkI4l9bHvWioAd0rc6NlHUOEaWkTeqg==", - "dev": true, - "requires": { - "anymatch": "~3.1.1", - "braces": "~3.0.2", - "fsevents": "~2.1.2", - "glob-parent": "~5.1.0", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.3.0" - } - }, - "chunkd": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/chunkd/-/chunkd-2.0.1.tgz", - "integrity": "sha512-7d58XsFmOq0j6el67Ug9mHf9ELUXsQXYJBkyxhH/k+6Ke0qXRnv0kbemx+Twc6fRJ07C49lcbdgm9FL1Ei/6SQ==", - "dev": true - }, - "ci-info": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", - "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", - "dev": true - }, - "ci-parallel-vars": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/ci-parallel-vars/-/ci-parallel-vars-1.0.0.tgz", - "integrity": "sha512-u6dx20FBXm+apMi+5x7UVm6EH7BL1gc4XrcnQewjcB7HWRcor/V5qWc3RG2HwpgDJ26gIi2DSEu3B7sXynAw/g==", - "dev": true - }, - "clean-stack": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", - "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", - "dev": true - }, - "clean-yaml-object": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/clean-yaml-object/-/clean-yaml-object-0.1.0.tgz", - "integrity": "sha1-Y/sRDcLOGoTcIfbZM0h20BCui2g=", - "dev": true - }, - "cli-boxes": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-2.2.0.tgz", - "integrity": "sha512-gpaBrMAizVEANOpfZp/EEUixTXDyGt7DFzdK5hU+UbWt/J0lB0w20ncZj59Z9a93xHb9u12zF5BS6i9RKbtg4w==", - "dev": true - }, - "cli-cursor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", - "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", - "dev": true, - "requires": { - "restore-cursor": "^3.1.0" - } - }, - "cli-spinners": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.2.0.tgz", - "integrity": "sha512-tgU3fKwzYjiLEQgPMD9Jt+JjHVL9kW93FiIMX/l7rivvOD4/LL0Mf7gda3+4U2KJBloybwgj5KEoQgGRioMiKQ==", - "dev": true - }, - "cli-truncate": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-2.1.0.tgz", - "integrity": "sha512-n8fOixwDD6b/ObinzTrp1ZKFzbgvKZvuz/TvejnLn1aQfC6r52XEx85FmuC+3HI+JM7coBRXUvNqEU2PHVrHpg==", - "dev": true, - "requires": { - "slice-ansi": "^3.0.0", - "string-width": "^4.2.0" - } - }, - "cliui": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", - "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", - "dev": true, - "requires": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^6.2.0" - } - }, - "clone": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", - "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=", - "dev": true - }, - "clone-response": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz", - "integrity": "sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws=", - "dev": true, - "requires": { - "mimic-response": "^1.0.0" - } - }, - "code-excerpt": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/code-excerpt/-/code-excerpt-2.1.1.tgz", - "integrity": "sha512-tJLhH3EpFm/1x7heIW0hemXJTUU5EWl2V0EIX558jp05Mt1U6DVryCgkp3l37cxqs+DNbNgxG43SkwJXpQ14Jw==", - "dev": true, - "requires": { - "convert-to-spaces": "^1.0.1" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true - }, - "common-path-prefix": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/common-path-prefix/-/common-path-prefix-3.0.0.tgz", - "integrity": "sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==", - "dev": true - }, - "commondir": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", - "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", - "dev": true - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true - }, - "concordance": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/concordance/-/concordance-4.0.0.tgz", - "integrity": "sha512-l0RFuB8RLfCS0Pt2Id39/oCPykE01pyxgAFypWTlaGRgvLkZrtczZ8atEHpTeEIW+zYWXTBuA9cCSeEOScxReQ==", - "dev": true, - "requires": { - "date-time": "^2.1.0", - "esutils": "^2.0.2", - "fast-diff": "^1.1.2", - "js-string-escape": "^1.0.1", - "lodash.clonedeep": "^4.5.0", - "lodash.flattendeep": "^4.4.0", - "lodash.islength": "^4.0.1", - "lodash.merge": "^4.6.1", - "md5-hex": "^2.0.0", - "semver": "^5.5.1", - "well-known-symbols": "^2.0.0" - }, - "dependencies": { - "md5-hex": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/md5-hex/-/md5-hex-2.0.0.tgz", - "integrity": "sha1-0FiOnxx0lUSS7NJKwKxs6ZfZLjM=", - "dev": true, - "requires": { - "md5-o-matic": "^0.1.1" - } - } - } - }, - "configstore": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/configstore/-/configstore-5.0.1.tgz", - "integrity": "sha512-aMKprgk5YhBNyH25hj8wGt2+D52Sw1DRRIzqBwLp2Ya9mFmY8KPvvtvmna8SxVR9JMZ4kzMD68N22vlaRpkeFA==", - "dev": true, - "requires": { - "dot-prop": "^5.2.0", - "graceful-fs": "^4.1.2", - "make-dir": "^3.0.0", - "unique-string": "^2.0.0", - "write-file-atomic": "^3.0.0", - "xdg-basedir": "^4.0.0" - } - }, - "convert-source-map": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", - "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.1" - } - }, - "convert-to-spaces": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/convert-to-spaces/-/convert-to-spaces-1.0.2.tgz", - "integrity": "sha1-fj5Iu+bZl7FBfdyihoIEtNPYVxU=", - "dev": true - }, - "cross-fetch": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.0.6.tgz", - "integrity": "sha512-KBPUbqgFjzWlVcURG+Svp9TlhA5uliYtiNx/0r8nv0pdypeQCRJ9IaSIc3q/x3q8t3F75cHuwxVql1HFGHCNJQ==", - "requires": { - "node-fetch": "2.6.1" - } - }, - "crypto-random-string": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-2.0.0.tgz", - "integrity": "sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA==", - "dev": true - }, - "currently-unhandled": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", - "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=", - "dev": true, - "requires": { - "array-find-index": "^1.0.1" - } - }, - "date-time": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/date-time/-/date-time-2.1.0.tgz", - "integrity": "sha512-/9+C44X7lot0IeiyfgJmETtRMhBidBYM2QFFIkGa0U1k+hSyY87Nw7PY3eDqpvCBm7I3WCSfPeZskW/YYq6m4g==", - "dev": true, - "requires": { - "time-zone": "^1.0.0" - } - }, - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", - "dev": true - }, - "decompress-response": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz", - "integrity": "sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=", - "dev": true, - "requires": { - "mimic-response": "^1.0.0" - } - }, - "deep-extend": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", - "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", - "dev": true - }, - "deepmerge": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", - "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==", - "dev": true - }, - "defaults": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz", - "integrity": "sha1-xlYFHpgX2f8I7YgUd/P+QBnz730=", - "dev": true, - "requires": { - "clone": "^1.0.2" - } - }, - "defer-to-connect": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-1.1.3.tgz", - "integrity": "sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ==", - "dev": true - }, - "del": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/del/-/del-5.1.0.tgz", - "integrity": "sha512-wH9xOVHnczo9jN2IW68BabcecVPxacIA3g/7z6vhSU/4stOKQzeCRK0yD0A24WiAAUJmmVpWqrERcTxnLo3AnA==", - "dev": true, - "requires": { - "globby": "^10.0.1", - "graceful-fs": "^4.2.2", - "is-glob": "^4.0.1", - "is-path-cwd": "^2.2.0", - "is-path-inside": "^3.0.1", - "p-map": "^3.0.0", - "rimraf": "^3.0.0", - "slash": "^3.0.0" - }, - "dependencies": { - "globby": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/globby/-/globby-10.0.2.tgz", - "integrity": "sha512-7dUi7RvCoT/xast/o/dLN53oqND4yk0nsHkhRgn9w65C4PofCLOoJ39iSOg+qVDdWQPIEj+eszMHQ+aLVwwQSg==", - "dev": true, - "requires": { - "@types/glob": "^7.1.1", - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.0.3", - "glob": "^7.1.3", - "ignore": "^5.1.1", - "merge2": "^1.2.3", - "slash": "^3.0.0" - } - } - } - }, - "dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "dev": true, - "requires": { - "path-type": "^4.0.0" - } - }, - "dot-prop": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.2.0.tgz", - "integrity": "sha512-uEUyaDKoSQ1M4Oq8l45hSE26SnTxL6snNnqvK/VWx5wJhmff5z0FUVJDKDanor/6w3kzE3i7XZOk+7wC0EXr1A==", - "dev": true, - "requires": { - "is-obj": "^2.0.0" - } - }, - "duplexer3": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", - "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=", - "dev": true - }, - "emittery": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.5.1.tgz", - "integrity": "sha512-sYZXNHH9PhTfs98ROEFVC3bLiR8KSqXQsEHIwZ9J6H0RaQObC3JYq4G8IvDd0b45/LxfGKYBpmaUN4LiKytaNw==", - "dev": true - }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "end-of-stream": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", - "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", - "dev": true, - "requires": { - "once": "^1.4.0" - } - }, - "equal-length": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/equal-length/-/equal-length-1.0.1.tgz", - "integrity": "sha1-IcoRLUirJLTh5//A5TOdMf38J0w=", - "dev": true - }, - "error-ex": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "dev": true, - "requires": { - "is-arrayish": "^0.2.1" - } - }, - "escape-goat": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/escape-goat/-/escape-goat-2.1.1.tgz", - "integrity": "sha512-8/uIhbG12Csjy2JEW7D9pHbreaVaS/OpN3ycnyvElTdwM5n6GY6W6e2IPemfvGZeUMqZ9A/3GqIZMgKnBhAw/Q==", - "dev": true - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true - }, - "esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true - }, - "estree-walker": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.1.tgz", - "integrity": "sha512-tF0hv+Yi2Ot1cwj9eYHtxC0jB9bmjacjQs6ZBTj82H8JwUywFuc+7E83NWfNMwHXZc11mjfFcVXPe9gEP4B8dg==", - "dev": true - }, - "esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "dev": true - }, - "fast-diff": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.2.0.tgz", - "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==", - "dev": true - }, - "fast-glob": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.2.tgz", - "integrity": "sha512-UDV82o4uQyljznxwMxyVRJgZZt3O5wENYojjzbaGEGZgeOxkLFf+V4cnUD+krzb2F72E18RhamkMZ7AdeggF7A==", - "dev": true, - "requires": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.0", - "merge2": "^1.3.0", - "micromatch": "^4.0.2", - "picomatch": "^2.2.1" - } - }, - "fastq": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.6.1.tgz", - "integrity": "sha512-mpIH5sKYueh3YyeJwqtVo8sORi0CgtmkVbK6kZStpQlZBYQuTzG2CZ7idSiJuA7bY0SFCWUc5WIs+oYumGCQNw==", - "dev": true, - "requires": { - "reusify": "^1.0.4" - } - }, - "figures": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", - "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", - "dev": true, - "requires": { - "escape-string-regexp": "^1.0.5" - } - }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "requires": { - "to-regex-range": "^5.0.1" - } - }, - "find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, - "requires": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - } - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true - }, - "fsevents": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.2.tgz", - "integrity": "sha512-R4wDiBwZ0KzpgOWetKDug1FZcYhqYnUYKtfZYt4mD5SBz76q0KR4Q9o7GIPamsVPGmW3EYPPJ0dOOjvx32ldZA==", - "dev": true, - "optional": true - }, - "get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "dev": true - }, - "get-stream": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", - "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", - "dev": true, - "requires": { - "pump": "^3.0.0" - } - }, - "glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", - "dev": true, - "requires": { - "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" - } - }, - "glob-parent": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.0.tgz", - "integrity": "sha512-qjtRgnIVmOfnKUE3NJAQEdk+lKrxfw8t5ke7SXtfMTHcjsBfOfWXCQfdb30zfDoZQ2IRSIiidmjtbHZPZ++Ihw==", - "dev": true, - "requires": { - "is-glob": "^4.0.1" - } - }, - "global-dirs": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-2.0.1.tgz", - "integrity": "sha512-5HqUqdhkEovj2Of/ms3IeS/EekcO54ytHRLV4PEY2rhRwrHXLQjeVEES0Lhka0xwNDtGYn58wyC4s5+MHsOO6A==", - "dev": true, - "requires": { - "ini": "^1.3.5" - } - }, - "globby": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.0.tgz", - "integrity": "sha512-iuehFnR3xu5wBBtm4xi0dMe92Ob87ufyu/dHwpDYfbcpYpIbrO5OnS8M1vWvrBhSGEJ3/Ecj7gnX76P8YxpPEg==", - "dev": true, - "requires": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.1.1", - "ignore": "^5.1.4", - "merge2": "^1.3.0", - "slash": "^3.0.0" - } - }, - "got": { - "version": "9.6.0", - "resolved": "https://registry.npmjs.org/got/-/got-9.6.0.tgz", - "integrity": "sha512-R7eWptXuGYxwijs0eV+v3o6+XH1IqVK8dJOEecQfTmkncw9AV4dcw/Dhxi8MdlqPthxxpZyizMzyg8RTmEsG+Q==", - "dev": true, - "requires": { - "@sindresorhus/is": "^0.14.0", - "@szmarczak/http-timer": "^1.1.2", - "cacheable-request": "^6.0.0", - "decompress-response": "^3.3.0", - "duplexer3": "^0.1.4", - "get-stream": "^4.1.0", - "lowercase-keys": "^1.0.1", - "mimic-response": "^1.0.1", - "p-cancelable": "^1.0.0", - "to-readable-stream": "^1.0.0", - "url-parse-lax": "^3.0.0" - } - }, - "graceful-fs": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz", - "integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==", - "dev": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "has-yarn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/has-yarn/-/has-yarn-2.1.0.tgz", - "integrity": "sha512-UqBRqi4ju7T+TqGNdqAO0PaSVGsDGJUBQvk9eUWNGRY1CFGDzYhLWoM7JQEemnlvVcv/YEmc2wNW8BC24EnUsw==", - "dev": true - }, - "hosted-git-info": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", - "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", - "dev": true - }, - "http-cache-semantics": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz", - "integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==", - "dev": true - }, - "ignore": { - "version": "5.1.4", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.4.tgz", - "integrity": "sha512-MzbUSahkTW1u7JpKKjY7LCARd1fU5W2rLdxlM4kdkayuCwZImjkpluF9CM1aLewYJguPDqewLam18Y6AU69A8A==", - "dev": true - }, - "ignore-by-default": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", - "integrity": "sha1-SMptcvbGo68Aqa1K5odr44ieKwk=", - "dev": true - }, - "import-lazy": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-2.1.0.tgz", - "integrity": "sha1-BWmOPUXIjo1+nZLLBYTnfwlvPkM=", - "dev": true - }, - "import-local": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.0.2.tgz", - "integrity": "sha512-vjL3+w0oulAVZ0hBHnxa/Nm5TAurf9YLQJDhqRZyqb+VKGOB6LU8t9H1Nr5CIo16vh9XfJTOoHwU0B71S557gA==", - "dev": true, - "requires": { - "pkg-dir": "^4.2.0", - "resolve-cwd": "^3.0.0" - } - }, - "imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", - "dev": true - }, - "indent-string": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", - "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", - "dev": true - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true - }, - "ini": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", - "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", - "dev": true - }, - "irregular-plurals": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/irregular-plurals/-/irregular-plurals-3.2.0.tgz", - "integrity": "sha512-YqTdPLfwP7YFN0SsD3QUVCkm9ZG2VzOXv3DOrw5G5mkMbVwptTwVcFv7/C0vOpBmgTxAeTG19XpUs1E522LW9Q==", - "dev": true - }, - "is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", - "dev": true - }, - "is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "dev": true, - "requires": { - "binary-extensions": "^2.0.0" - } - }, - "is-ci": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", - "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==", - "dev": true, - "requires": { - "ci-info": "^2.0.0" - } - }, - "is-error": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/is-error/-/is-error-2.2.2.tgz", - "integrity": "sha512-IOQqts/aHWbiisY5DuPJQ0gcbvaLFCa7fBa9xoLfxBZvQ+ZI/Zh9xoI7Gk+G64N0FdK4AbibytHht2tWgpJWLg==", - "dev": true - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true - }, - "is-glob": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", - "dev": true, - "requires": { - "is-extglob": "^2.1.1" - } - }, - "is-installed-globally": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.3.1.tgz", - "integrity": "sha512-oiEcGoQbGc+3/iijAijrK2qFpkNoNjsHOm/5V5iaeydyrS/hnwaRCEgH5cpW0P3T1lSjV5piB7S5b5lEugNLhg==", - "dev": true, - "requires": { - "global-dirs": "^2.0.1", - "is-path-inside": "^3.0.1" - } - }, - "is-interactive": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz", - "integrity": "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==", - "dev": true - }, - "is-module": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz", - "integrity": "sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE=", - "dev": true - }, - "is-npm": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-4.0.0.tgz", - "integrity": "sha512-96ECIfh9xtDDlPylNPXhzjsykHsMJZ18ASpaWzQyBr4YRTcVjUvzaHayDAES2oU/3KpljhHUjtSRNiDwi0F0ig==", - "dev": true - }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true - }, - "is-obj": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", - "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==", - "dev": true - }, - "is-path-cwd": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-2.2.0.tgz", - "integrity": "sha512-w942bTcih8fdJPJmQHFzkS76NEP8Kzzvmw92cXsazb8intwLqPibPPdXf4ANdKV3rYMuuQYGIWtvz9JilB3NFQ==", - "dev": true - }, - "is-path-inside": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.2.tgz", - "integrity": "sha512-/2UGPSgmtqwo1ktx8NDHjuPwZWmHhO+gj0f93EkhLB5RgW9RZevWYYlIkS6zePc6U2WpOdQYIwHe9YC4DWEBVg==", - "dev": true - }, - "is-plain-object": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-3.0.0.tgz", - "integrity": "sha512-tZIpofR+P05k8Aocp7UI/2UTa9lTJSebCXpFFoR9aibpokDj/uXBsJ8luUu0tTVYKkMU6URDUuOfJZ7koewXvg==", - "dev": true, - "requires": { - "isobject": "^4.0.0" - } - }, - "is-promise": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", - "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", - "dev": true - }, - "is-reference": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.2.1.tgz", - "integrity": "sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==", - "dev": true, - "requires": { - "@types/estree": "*" - } - }, - "is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", - "dev": true - }, - "is-yarn-global": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/is-yarn-global/-/is-yarn-global-0.3.0.tgz", - "integrity": "sha512-VjSeb/lHmkoyd8ryPVIKvOCn4D1koMqY+vqyjjUfc3xyKtP4dYOxM44sZrnqQSzSds3xyOrUTLTC9LVCVgLngw==", - "dev": true - }, - "isobject": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-4.0.0.tgz", - "integrity": "sha512-S/2fF5wH8SJA/kmwr6HYhK/RI/OkhD84k8ntalo0iJjZikgq1XFvR5M8NPT1x5F7fBwCG3qHfnzeP/Vh/ZxCUA==", - "dev": true - }, - "jest-worker": { - "version": "26.3.0", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.3.0.tgz", - "integrity": "sha512-Vmpn2F6IASefL+DVBhPzI2J9/GJUsqzomdeN+P+dK8/jKxbh8R3BtFnx3FIta7wYlPU62cpJMJQo4kuOowcMnw==", - "dev": true, - "requires": { - "@types/node": "*", - "merge-stream": "^2.0.0", - "supports-color": "^7.0.0" - } - }, - "js-string-escape": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/js-string-escape/-/js-string-escape-1.0.1.tgz", - "integrity": "sha1-4mJbrbwNZ8dTPp7cEGjFh65BN+8=", - "dev": true - }, - "js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true - }, - "js-yaml": { - "version": "3.13.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", - "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", - "dev": true, - "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - } - }, - "jsbi": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/jsbi/-/jsbi-3.1.2.tgz", - "integrity": "sha512-5nDXo1X9QVaXK/Cpb5VECV9ss1QPbjUuk1qSruHB1PK/g39Sd414K4nci99ElFDZv0vzxDEnKn3o49/Tn9Yagw==" - }, - "json-buffer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz", - "integrity": "sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg=", - "dev": true - }, - "json-parse-better-errors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", - "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", - "dev": true - }, - "keyv": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-3.1.0.tgz", - "integrity": "sha512-9ykJ/46SN/9KPM/sichzQ7OvXyGDYKGTaDlKMGCAlg2UK8KRy4jb0d8sFc+0Tt0YYnThq8X2RZgCg74RPxgcVA==", - "dev": true, - "requires": { - "json-buffer": "3.0.0" - } - }, - "latest-version": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-5.1.0.tgz", - "integrity": "sha512-weT+r0kTkRQdCdYCNtkMwWXQTMEswKrFBkm4ckQOMVhhqhIMI1UT2hMj+1iigIhgSZm5gTmrRXBNoGUgaTY1xA==", - "dev": true, - "requires": { - "package-json": "^6.3.0" - } - }, - "lines-and-columns": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz", - "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=", - "dev": true - }, - "load-json-file": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-5.3.0.tgz", - "integrity": "sha512-cJGP40Jc/VXUsp8/OrnyKyTZ1y6v/dphm3bioS+RrKXjK2BB6wHUd6JptZEFDGgGahMT+InnZO5i1Ei9mpC8Bw==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.15", - "parse-json": "^4.0.0", - "pify": "^4.0.1", - "strip-bom": "^3.0.0", - "type-fest": "^0.3.0" - } - }, - "locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, - "requires": { - "p-locate": "^4.1.0" - } - }, - "lodash": { - "version": "4.17.19", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", - "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==", - "dev": true - }, - "lodash.clonedeep": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", - "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=", - "dev": true - }, - "lodash.flattendeep": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz", - "integrity": "sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI=", - "dev": true - }, - "lodash.islength": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/lodash.islength/-/lodash.islength-4.0.1.tgz", - "integrity": "sha1-Tpho1FJXXXUK/9NYyXlUPcIO1Xc=", - "dev": true - }, - "lodash.merge": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "dev": true - }, - "log-symbols": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-3.0.0.tgz", - "integrity": "sha512-dSkNGuI7iG3mfvDzUuYZyvk5dD9ocYCYzNU6CYDE6+Xqd+gwme6Z00NS3dUh8mq/73HaEtT7m6W+yUPtU6BZnQ==", - "dev": true, - "requires": { - "chalk": "^2.4.2" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, - "lowercase-keys": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", - "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==", - "dev": true - }, - "magic-string": { - "version": "0.25.7", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz", - "integrity": "sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA==", - "dev": true, - "requires": { - "sourcemap-codec": "^1.4.4" - } - }, - "make-dir": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.0.2.tgz", - "integrity": "sha512-rYKABKutXa6vXTXhoV18cBE7PaewPXHe/Bdq4v+ZLMhxbWApkFFplT0LcbMW+6BbjnQXzZ/sAvSE/JdguApG5w==", - "dev": true, - "requires": { - "semver": "^6.0.0" - }, - "dependencies": { - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - } - } - }, - "matcher": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/matcher/-/matcher-2.1.0.tgz", - "integrity": "sha512-o+nZr+vtJtgPNklyeUKkkH42OsK8WAfdgaJE2FNxcjLPg+5QbeEoT6vRj8Xq/iv18JlQ9cmKsEu0b94ixWf1YQ==", - "dev": true, - "requires": { - "escape-string-regexp": "^2.0.0" - }, - "dependencies": { - "escape-string-regexp": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", - "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", - "dev": true - } - } - }, - "md5-hex": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/md5-hex/-/md5-hex-3.0.1.tgz", - "integrity": "sha512-BUiRtTtV39LIJwinWBjqVsU9xhdnz7/i889V859IBFpuqGAj6LuOvHv5XLbgZ2R7ptJoJaEcxkv88/h25T7Ciw==", - "dev": true, - "requires": { - "blueimp-md5": "^2.10.0" - } - }, - "md5-o-matic": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/md5-o-matic/-/md5-o-matic-0.1.1.tgz", - "integrity": "sha1-givM1l4RfFFPqxdrJZRdVBAKA8M=", - "dev": true - }, - "merge-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", - "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", - "dev": true - }, - "merge2": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.3.0.tgz", - "integrity": "sha512-2j4DAdlBOkiSZIsaXk4mTE3sRS02yBHAtfy127xRV3bQUFqXkjHCHLW6Scv7DwNRbIWNHH8zpnz9zMaKXIdvYw==", - "dev": true - }, - "micromatch": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", - "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", - "dev": true, - "requires": { - "braces": "^3.0.1", - "picomatch": "^2.0.5" - } - }, - "mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", - "dev": true - }, - "mimic-response": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", - "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==", - "dev": true - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", - "dev": true - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "mute-stream": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", - "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", - "dev": true - }, - "node-fetch": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", - "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==" - }, - "normalize-package-data": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", - "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", - "dev": true, - "requires": { - "hosted-git-info": "^2.1.4", - "resolve": "^1.10.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" - } - }, - "normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true - }, - "normalize-url": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.0.tgz", - "integrity": "sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ==", - "dev": true - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, - "requires": { - "wrappy": "1" - } - }, - "onetime": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.0.tgz", - "integrity": "sha512-5NcSkPHhwTVFIQN+TUqXoS5+dlElHXdpAWu9I0HP20YOtIi+aZ0Ct82jdlILDxjLEAWwvm+qj1m6aEtsDVmm6Q==", - "dev": true, - "requires": { - "mimic-fn": "^2.1.0" - } - }, - "ora": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/ora/-/ora-4.0.3.tgz", - "integrity": "sha512-fnDebVFyz309A73cqCipVL1fBZewq4vwgSHfxh43vVy31mbyoQ8sCH3Oeaog/owYOs/lLlGVPCISQonTneg6Pg==", - "dev": true, - "requires": { - "chalk": "^3.0.0", - "cli-cursor": "^3.1.0", - "cli-spinners": "^2.2.0", - "is-interactive": "^1.0.0", - "log-symbols": "^3.0.0", - "mute-stream": "0.0.8", - "strip-ansi": "^6.0.0", - "wcwidth": "^1.0.1" - } - }, - "p-cancelable": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-1.1.0.tgz", - "integrity": "sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw==", - "dev": true - }, - "p-limit": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.2.tgz", - "integrity": "sha512-WGR+xHecKTr7EbUEhyLSh5Dube9JtdiG78ufaeLxTgpudf/20KqyMioIUZJAezlTIi6evxuoUs9YXc11cU+yzQ==", - "dev": true, - "requires": { - "p-try": "^2.0.0" - } - }, - "p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, - "requires": { - "p-limit": "^2.2.0" - } - }, - "p-map": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", - "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", - "dev": true, - "requires": { - "aggregate-error": "^3.0.0" - } - }, - "p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true - }, - "package-json": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/package-json/-/package-json-6.5.0.tgz", - "integrity": "sha512-k3bdm2n25tkyxcjSKzB5x8kfVxlMdgsbPr0GkZcwHsLpba6cBjqCt1KlcChKEvxHIcTB1FVMuwoijZ26xex5MQ==", - "dev": true, - "requires": { - "got": "^9.6.0", - "registry-auth-token": "^4.0.0", - "registry-url": "^5.0.0", - "semver": "^6.2.0" - }, - "dependencies": { - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - } - } - }, - "parse-json": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", - "dev": true, - "requires": { - "error-ex": "^1.3.1", - "json-parse-better-errors": "^1.0.1" - } - }, - "parse-ms": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-2.1.0.tgz", - "integrity": "sha512-kHt7kzLoS9VBZfUsiKjv43mr91ea+U05EyKkEtqp7vNbHxmaVuEqN7XxeEVnGrMtYOAxGrDElSi96K7EgO1zCA==", - "dev": true - }, - "path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true - }, - "path-parse": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", - "dev": true - }, - "path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true - }, - "picomatch": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.1.tgz", - "integrity": "sha512-ISBaA8xQNmwELC7eOjqFKMESB2VIqt4PPDD0nsS95b/9dZXvVKOlz9keMSnoGGKcOHXfTvDD6WMaRoSc9UuhRA==", - "dev": true - }, - "pify": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", - "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", - "dev": true - }, - "pkg-conf": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/pkg-conf/-/pkg-conf-3.1.0.tgz", - "integrity": "sha512-m0OTbR/5VPNPqO1ph6Fqbj7Hv6QU7gR/tQW40ZqrL1rjgCU85W6C1bJn0BItuJqnR98PWzw7Z8hHeChD1WrgdQ==", - "dev": true, - "requires": { - "find-up": "^3.0.0", - "load-json-file": "^5.2.0" - }, - "dependencies": { - "find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", - "dev": true, - "requires": { - "locate-path": "^3.0.0" - } - }, - "locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", - "dev": true, - "requires": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" - } - }, - "p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", - "dev": true, - "requires": { - "p-limit": "^2.0.0" - } - }, - "path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", - "dev": true - } - } - }, - "pkg-dir": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", - "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", - "dev": true, - "requires": { - "find-up": "^4.0.0" - } - }, - "plur": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/plur/-/plur-4.0.0.tgz", - "integrity": "sha512-4UGewrYgqDFw9vV6zNV+ADmPAUAfJPKtGvb/VdpQAx25X5f3xXdGdyOEVFwkl8Hl/tl7+xbeHqSEM+D5/TirUg==", - "dev": true, - "requires": { - "irregular-plurals": "^3.2.0" - } - }, - "prepend-http": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", - "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=", - "dev": true - }, - "prettier": { - "version": "1.19.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.19.1.tgz", - "integrity": "sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==", - "dev": true - }, - "pretty-ms": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-6.0.1.tgz", - "integrity": "sha512-ke4njoVmlotekHlHyCZ3wI/c5AMT8peuHs8rKJqekj/oR5G8lND2dVpicFlUz5cbZgE290vvkMuDwfj/OcW1kw==", - "dev": true, - "requires": { - "parse-ms": "^2.1.0" - } - }, - "pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "dev": true, - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, - "pupa": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pupa/-/pupa-2.0.1.tgz", - "integrity": "sha512-hEJH0s8PXLY/cdXh66tNEQGndDrIKNqNC5xmrysZy3i5C3oEoLna7YAOad+7u125+zH1HNXUmGEkrhb3c2VriA==", - "dev": true, - "requires": { - "escape-goat": "^2.0.0" - } - }, - "randombytes": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", - "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", - "dev": true, - "requires": { - "safe-buffer": "^5.1.0" - } - }, - "rc": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", - "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", - "dev": true, - "requires": { - "deep-extend": "^0.6.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - } - }, - "read-pkg": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", - "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", - "dev": true, - "requires": { - "@types/normalize-package-data": "^2.4.0", - "normalize-package-data": "^2.5.0", - "parse-json": "^5.0.0", - "type-fest": "^0.6.0" - }, - "dependencies": { - "parse-json": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.0.0.tgz", - "integrity": "sha512-OOY5b7PAEFV0E2Fir1KOkxchnZNCdowAJgQ5NuxjpBKTRP3pQhwkrkxqQjeoKJ+fO7bCpmIZaogI4eZGDMEGOw==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.0.0", - "error-ex": "^1.3.1", - "json-parse-better-errors": "^1.0.1", - "lines-and-columns": "^1.1.6" - } - }, - "type-fest": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", - "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", - "dev": true - } - } - }, - "readdirp": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.3.0.tgz", - "integrity": "sha512-zz0pAkSPOXXm1viEwygWIPSPkcBYjW1xU5j/JBh5t9bGCJwa6f9+BJa6VaB2g+b55yVrmXzqkyLf4xaWYM0IkQ==", - "dev": true, - "requires": { - "picomatch": "^2.0.7" - } - }, - "registry-auth-token": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-4.1.1.tgz", - "integrity": "sha512-9bKS7nTl9+/A1s7tnPeGrUpRcVY+LUh7bfFgzpndALdPfXQBfQV77rQVtqgUV3ti4vc/Ik81Ex8UJDWDQ12zQA==", - "dev": true, - "requires": { - "rc": "^1.2.8" - } - }, - "registry-url": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-5.1.0.tgz", - "integrity": "sha512-8acYXXTI0AkQv6RAOjE3vOaIXZkT9wo4LOFbBKYQEEnnMNBpKqdUrI6S4NT0KPIo/WVvJ5tE/X5LF/TQUf0ekw==", - "dev": true, - "requires": { - "rc": "^1.2.8" - } - }, - "require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", - "dev": true - }, - "require-main-filename": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", - "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", - "dev": true - }, - "resolve": { - "version": "1.15.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.15.1.tgz", - "integrity": "sha512-84oo6ZTtoTUpjgNEr5SJyzQhzL72gaRodsSfyxC/AXRvwu0Yse9H8eF9IpGo7b8YetZhlI6v7ZQ6bKBFV/6S7w==", - "dev": true, - "requires": { - "path-parse": "^1.0.6" - } - }, - "resolve-cwd": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", - "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", - "dev": true, - "requires": { - "resolve-from": "^5.0.0" - } - }, - "resolve-from": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", - "dev": true - }, - "responselike": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/responselike/-/responselike-1.0.2.tgz", - "integrity": "sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec=", - "dev": true, - "requires": { - "lowercase-keys": "^1.0.0" - } - }, - "restore-cursor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", - "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", - "dev": true, - "requires": { - "onetime": "^5.1.0", - "signal-exit": "^3.0.2" - } - }, - "reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true - }, - "rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - }, - "rollup": { - "version": "2.26.11", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.26.11.tgz", - "integrity": "sha512-xyfxxhsE6hW57xhfL1I+ixH8l2bdoIMaAecdQiWF3N7IgJEMu99JG+daBiSZQjnBpzFxa0/xZm+3pbCdAQehHw==", - "dev": true, - "requires": { - "fsevents": "~2.1.2" - } - }, - "rollup-plugin-terser": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/rollup-plugin-terser/-/rollup-plugin-terser-7.0.2.tgz", - "integrity": "sha512-w3iIaU4OxcF52UUXiZNsNeuXIMDvFrr+ZXK6bFZ0Q60qyVfq4uLptoS4bbq3paG3x216eQllFZX7zt6TIImguQ==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.10.4", - "jest-worker": "^26.2.1", - "serialize-javascript": "^4.0.0", - "terser": "^5.0.0" - }, - "dependencies": { - "@babel/code-frame": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz", - "integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==", - "dev": true, - "requires": { - "@babel/highlight": "^7.10.4" - } - }, - "@babel/highlight": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", - "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", - "dev": true, - "requires": { - "@babel/helper-validator-identifier": "^7.10.4", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - } - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, - "run-parallel": { - "version": "1.1.9", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.9.tgz", - "integrity": "sha512-DEqnSRTDw/Tc3FXf49zedI638Z9onwUotBMiUFKmrO2sdFKIbXamXGQ3Axd4qgphxKB4kw/qP1w5kTxnfU1B9Q==", - "dev": true - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - }, - "semver-diff": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-3.1.1.tgz", - "integrity": "sha512-GX0Ix/CJcHyB8c4ykpHGIAvLyOwOobtM/8d+TQkAd81/bEjgPHrfba41Vpesr7jX/t8Uh+R3EX9eAS5be+jQYg==", - "dev": true, - "requires": { - "semver": "^6.3.0" - }, - "dependencies": { - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - } - } - }, - "serialize-error": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/serialize-error/-/serialize-error-2.1.0.tgz", - "integrity": "sha1-ULZ51WNc34Rme9yOWa9OW4HV9go=", - "dev": true - }, - "serialize-javascript": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-4.0.0.tgz", - "integrity": "sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw==", - "dev": true, - "requires": { - "randombytes": "^2.1.0" - } - }, - "set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", - "dev": true - }, - "signal-exit": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", - "dev": true - }, - "slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true - }, - "slice-ansi": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-3.0.0.tgz", - "integrity": "sha512-pSyv7bSTC7ig9Dcgbw9AuRNUb5k5V6oDudjZoMBSr13qpLBG7tB+zgCkARjq7xIUgdz5P1Qe8u+rSGdouOOIyQ==", - "dev": true, - "requires": { - "ansi-styles": "^4.0.0", - "astral-regex": "^2.0.0", - "is-fullwidth-code-point": "^3.0.0" - } - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - }, - "source-map-support": { - "version": "0.5.16", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.16.tgz", - "integrity": "sha512-efyLRJDr68D9hBBNIPWFjhpFzURh+KJykQwvMyW5UiZzYwoF6l4YMMDIJJEyFWxWCqfyxLzz6tSfUFR+kXXsVQ==", - "dev": true, - "requires": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - } - }, - "sourcemap-codec": { - "version": "1.4.8", - "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", - "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==", - "dev": true - }, - "spdx-correct": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", - "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", - "dev": true, - "requires": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-exceptions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", - "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==", - "dev": true - }, - "spdx-expression-parse": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", - "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", - "dev": true, - "requires": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-license-ids": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz", - "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==", - "dev": true - }, - "sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", - "dev": true - }, - "stack-utils": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.1.tgz", - "integrity": "sha512-BvBTnHGm8boe+HiJFqP19ywEsGlfQAKqW78pbfvUuzCbUuxPPUyLrH5dYFY+Xn9IpLY3b5ZmMcl8jAqXB4wddg==", - "dev": true, - "requires": { - "escape-string-regexp": "^2.0.0" - }, - "dependencies": { - "escape-string-regexp": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", - "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", - "dev": true - } - } - }, - "string-width": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", - "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" - } - }, - "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.0" - } - }, - "strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", - "dev": true - }, - "strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", - "dev": true - }, - "supertap": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/supertap/-/supertap-1.0.0.tgz", - "integrity": "sha512-HZJ3geIMPgVwKk2VsmO5YHqnnJYl6bV5A9JW2uzqV43WmpgliNEYbuvukfor7URpaqpxuw3CfZ3ONdVbZjCgIA==", - "dev": true, - "requires": { - "arrify": "^1.0.1", - "indent-string": "^3.2.0", - "js-yaml": "^3.10.0", - "serialize-error": "^2.1.0", - "strip-ansi": "^4.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "arrify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", - "dev": true - }, - "indent-string": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", - "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=", - "dev": true - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - } - } - }, - "supports-color": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", - "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - }, - "temp-dir": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/temp-dir/-/temp-dir-2.0.0.tgz", - "integrity": "sha512-aoBAniQmmwtcKp/7BzsH8Cxzv8OL736p7v1ihGb5e9DJ9kTwGWHrQrVB5+lfVDzfGrdRzXch+ig7LHaY1JTOrg==", - "dev": true - }, - "term-size": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/term-size/-/term-size-2.2.0.tgz", - "integrity": "sha512-a6sumDlzyHVJWb8+YofY4TW112G6p2FCPEAFk+59gIYHv3XHRhm9ltVQ9kli4hNWeQBwSpe8cRN25x0ROunMOw==", - "dev": true - }, - "terser": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.3.1.tgz", - "integrity": "sha512-yD80f4hdwCWTH5mojzxe1q8bN1oJbsK/vfJGLcPZM/fl+/jItIVNKhFIHqqR71OipFWMLgj3Kc+GIp6CeIqfnA==", - "dev": true, - "requires": { - "commander": "^2.20.0", - "source-map": "~0.6.1", - "source-map-support": "~0.5.12" - } - }, - "time-zone": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/time-zone/-/time-zone-1.0.0.tgz", - "integrity": "sha1-mcW/VZWJZq9tBtg73zgA3IL67F0=", - "dev": true - }, - "to-readable-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/to-readable-stream/-/to-readable-stream-1.0.0.tgz", - "integrity": "sha512-Iq25XBt6zD5npPhlLVXGFN3/gyR2/qODcKNNyTMd4vbm39HUaOiAM4PMq0eMVC/Tkxz+Zjdsc55g9yyz+Yq00Q==", - "dev": true - }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "requires": { - "is-number": "^7.0.0" - } - }, - "trim-off-newlines": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/trim-off-newlines/-/trim-off-newlines-1.0.1.tgz", - "integrity": "sha1-n5up2e+odkw4dpi8v+sshI8RrbM=", - "dev": true - }, - "type-fest": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.3.1.tgz", - "integrity": "sha512-cUGJnCdr4STbePCgqNFbpVNCepa+kAVohJs1sLhxzdH+gnEoOd8VhbYa7pD3zZYGiURWM2xzEII3fQcRizDkYQ==", - "dev": true - }, - "typedarray-to-buffer": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", - "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", - "dev": true, - "requires": { - "is-typedarray": "^1.0.0" - } - }, - "unique-string": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-2.0.0.tgz", - "integrity": "sha512-uNaeirEPvpZWSgzwsPGtU2zVSTrn/8L5q/IexZmH0eH6SA73CmAA5U4GwORTxQAZs95TAXLNqeLoPPNO5gZfWg==", - "dev": true, - "requires": { - "crypto-random-string": "^2.0.0" - } - }, - "update-notifier": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-4.1.0.tgz", - "integrity": "sha512-w3doE1qtI0/ZmgeoDoARmI5fjDoT93IfKgEGqm26dGUOh8oNpaSTsGNdYRN/SjOuo10jcJGwkEL3mroKzktkew==", - "dev": true, - "requires": { - "boxen": "^4.2.0", - "chalk": "^3.0.0", - "configstore": "^5.0.1", - "has-yarn": "^2.1.0", - "import-lazy": "^2.1.0", - "is-ci": "^2.0.0", - "is-installed-globally": "^0.3.1", - "is-npm": "^4.0.0", - "is-yarn-global": "^0.3.0", - "latest-version": "^5.0.0", - "pupa": "^2.0.1", - "semver-diff": "^3.1.1", - "xdg-basedir": "^4.0.0" - } - }, - "url-parse-lax": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-3.0.0.tgz", - "integrity": "sha1-FrXK/Afb42dsGxmZF3gj1lA6yww=", - "dev": true, - "requires": { - "prepend-http": "^2.0.0" - } - }, - "validate-npm-package-license": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", - "dev": true, - "requires": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" - } - }, - "wcwidth": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", - "integrity": "sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g=", - "dev": true, - "requires": { - "defaults": "^1.0.3" - } - }, - "well-known-symbols": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/well-known-symbols/-/well-known-symbols-2.0.0.tgz", - "integrity": "sha512-ZMjC3ho+KXo0BfJb7JgtQ5IBuvnShdlACNkKkdsqBmYw3bPAaJfPeYUo6tLUaT5tG/Gkh7xkpBhKRQ9e7pyg9Q==", - "dev": true - }, - "which-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", - "dev": true - }, - "widest-line": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz", - "integrity": "sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg==", - "dev": true, - "requires": { - "string-width": "^4.0.0" - } - }, - "wrap-ansi": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", - "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", - "dev": true, - "requires": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - } - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true - }, - "write-file-atomic": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", - "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", - "dev": true, - "requires": { - "imurmurhash": "^0.1.4", - "is-typedarray": "^1.0.0", - "signal-exit": "^3.0.2", - "typedarray-to-buffer": "^3.1.5" - } - }, - "xdg-basedir": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-4.0.0.tgz", - "integrity": "sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q==", - "dev": true - }, - "y18n": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", - "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", - "dev": true - }, - "yargs": { - "version": "15.4.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", - "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", - "dev": true, - "requires": { - "cliui": "^6.0.0", - "decamelize": "^1.2.0", - "find-up": "^4.1.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^4.2.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^18.1.2" - }, - "dependencies": { - "yargs-parser": { - "version": "18.1.3", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", - "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", - "dev": true, - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - } - } - } - } - } -} diff --git a/packages/helpers/package.json b/packages/helpers/package.json index 5f4629ff9..6e0e74d2b 100644 --- a/packages/helpers/package.json +++ b/packages/helpers/package.json @@ -45,7 +45,7 @@ "@ckb-lumos/base": "^0.17.0-rc6", "@ckb-lumos/config-manager": "^0.17.0-rc6", "bech32": "^1.1.4", - "ckb-js-toolkit": "^0.10.2", + "@ckb-lumos/toolkit": "^0.17.0-rc6", "immutable": "^4.0.0-rc.12" }, "devDependencies": { diff --git a/packages/helpers/src/index.ts b/packages/helpers/src/index.ts index f4cd7339c..ce85e72d7 100644 --- a/packages/helpers/src/index.ts +++ b/packages/helpers/src/index.ts @@ -12,7 +12,7 @@ import { WitnessArgs, } from "@ckb-lumos/base"; import * as bech32 from "bech32"; -import { normalizers, validators, Reader } from "ckb-js-toolkit"; +import { normalizers, validators, Reader } from "@ckb-lumos/toolkit"; import { List, Record, Map as ImmutableMap } from "immutable"; import { getConfig, Config } from "@ckb-lumos/config-manager"; diff --git a/packages/indexer/lib/index.js b/packages/indexer/lib/index.js index 48d80c5e2..5e316ba9c 100644 --- a/packages/indexer/lib/index.js +++ b/packages/indexer/lib/index.js @@ -1,4 +1,4 @@ -const { validators, normalizers, Reader, RPC } = require("ckb-js-toolkit"); +const { validators, normalizers, Reader, RPC } = require("@ckb-lumos/toolkit"); const { OrderedSet, Map } = require("immutable"); const XXHash = require("xxhash"); const { Indexer: NativeIndexer, Emitter, BlockEmitter } = require("../native"); diff --git a/packages/indexer/package.json b/packages/indexer/package.json index e734f854a..417caeff2 100644 --- a/packages/indexer/package.json +++ b/packages/indexer/package.json @@ -32,7 +32,7 @@ ], "dependencies": { "@ckb-lumos/base": "^0.17.0-rc6", - "ckb-js-toolkit": "^0.9.2", + "@ckb-lumos/toolkit": "^0.17.0-rc6", "neon-cli": "^0.4.0", "node-pre-gyp": "^0.14.0", "request": "^2.88.2", diff --git a/packages/lumos/package.json b/packages/lumos/package.json index d58270f8b..151710763 100644 --- a/packages/lumos/package.json +++ b/packages/lumos/package.json @@ -49,7 +49,7 @@ "@ckb-lumos/hd": "^0.17.0-rc6", "@ckb-lumos/helpers": "^0.17.0-rc6", "@ckb-lumos/rpc": "^0.17.0-rc6", - "ckb-js-toolkit": "^0.10.2" + "@ckb-lumos/toolkit": "^0.17.0-rc6" }, "devDependencies": { "buffer": "^6.0.3", diff --git a/packages/lumos/src/index.ts b/packages/lumos/src/index.ts index e571cd37a..063e03f09 100644 --- a/packages/lumos/src/index.ts +++ b/packages/lumos/src/index.ts @@ -1,4 +1,9 @@ -import { Reader, validators, normalizers, transformers } from "ckb-js-toolkit"; +import { + Reader, + validators, + normalizers, + transformers, +} from "@ckb-lumos/toolkit"; export const toolkit = { Reader, validators, normalizers, transformers }; diff --git a/packages/rpc/package.json b/packages/rpc/package.json index 59fa37dec..43f74574b 100644 --- a/packages/rpc/package.json +++ b/packages/rpc/package.json @@ -43,7 +43,7 @@ }, "dependencies": { "@ckb-lumos/base": "^0.17.0-rc6", - "ckb-js-toolkit": "^0.10.2" + "@ckb-lumos/toolkit": "^0.17.0-rc6" }, "ava": { "extensions": [ diff --git a/packages/rpc/src/index.ts b/packages/rpc/src/index.ts index 8c2421d70..a47b105b0 100644 --- a/packages/rpc/src/index.ts +++ b/packages/rpc/src/index.ts @@ -1,4 +1,4 @@ -import { RPC as ToolkitRPC } from "ckb-js-toolkit"; +import { RPC as ToolkitRPC } from "@ckb-lumos/toolkit"; import { Alert, BannedAddr, diff --git a/packages/sql-indexer/lib/index.js b/packages/sql-indexer/lib/index.js index eccd713a7..3f1022ecf 100644 --- a/packages/sql-indexer/lib/index.js +++ b/packages/sql-indexer/lib/index.js @@ -1,4 +1,4 @@ -const { RPC, Reader, validators } = require("ckb-js-toolkit"); +const { RPC, Reader, validators } = require("@ckb-lumos/toolkit"); const { EventEmitter } = require("events"); const { utils, indexer: BaseIndexerModule } = require("@ckb-lumos/base"); const SCRIPT_TYPE_LOCK = 0; diff --git a/packages/sql-indexer/package.json b/packages/sql-indexer/package.json index ab00b3b05..3464272a6 100644 --- a/packages/sql-indexer/package.json +++ b/packages/sql-indexer/package.json @@ -26,7 +26,7 @@ ], "dependencies": { "@ckb-lumos/base": "^0.17.0-rc6", - "ckb-js-toolkit": "^0.10.2", + "@ckb-lumos/toolkit": "^0.17.0-rc6", "knex": "^0.21.1" }, "scripts": { diff --git a/packages/testkit/package.json b/packages/testkit/package.json index a546ba42f..8b98e6a92 100644 --- a/packages/testkit/package.json +++ b/packages/testkit/package.json @@ -27,7 +27,7 @@ "@types/body-parser": "^1.19.1", "@types/express": "^4.17.13", "body-parser": "^1.19.0", - "ckb-js-toolkit": "^0.10.2", + "@ckb-lumos/toolkit": "^0.17.0-rc6", "express": "^4.17.1", "json-rpc-2.0": "^0.2.19", "ts-node": "^10.4.0" diff --git a/packages/testkit/src/mock-ckb-jsonrpc.ts b/packages/testkit/src/mock-ckb-jsonrpc.ts index a0c32b6c6..ed3a23ca6 100644 --- a/packages/testkit/src/mock-ckb-jsonrpc.ts +++ b/packages/testkit/src/mock-ckb-jsonrpc.ts @@ -2,7 +2,7 @@ import { JSONRPCResponse, JSONRPCServer } from "json-rpc-2.0"; import express, { Express } from "express"; import bodyParser from "body-parser"; import { LocalNode, Block, core } from "@ckb-lumos/base"; -import { normalizers, Reader } from "ckb-js-toolkit"; +import { normalizers, Reader } from "@ckb-lumos/toolkit"; interface Options { blocks: Block[]; diff --git a/packages/core/.gitignore b/packages/toolkit/.gitignore similarity index 100% rename from packages/core/.gitignore rename to packages/toolkit/.gitignore diff --git a/packages/core/README.md b/packages/toolkit/README.md similarity index 100% rename from packages/core/README.md rename to packages/toolkit/README.md diff --git a/packages/core/images/toolkit.svg b/packages/toolkit/images/toolkit.svg similarity index 100% rename from packages/core/images/toolkit.svg rename to packages/toolkit/images/toolkit.svg diff --git a/packages/core/index.d.ts b/packages/toolkit/index.d.ts similarity index 100% rename from packages/core/index.d.ts rename to packages/toolkit/index.d.ts diff --git a/packages/core/package.json b/packages/toolkit/package.json similarity index 82% rename from packages/core/package.json rename to packages/toolkit/package.json index 4b8735527..fd5105fac 100644 --- a/packages/core/package.json +++ b/packages/toolkit/package.json @@ -1,17 +1,25 @@ { - "name": "ckb-js-toolkit", - "version": "0.10.2", + "name": "@ckb-lumos/toolkit", + "version": "0.17.0-rc6", "description": "JavaScript toolkits used to build dapps for Nervos CKB", - "main": "dist/ckb-js-toolkit.node.js", - "browser": "dist/ckb-js-toolkit.esm.js", + "main": "lib/ckb-js-toolkit.node.js", + "browser": "lib/ckb-js-toolkit.esm.js", "types": "index.d.ts", + "engines": { + "node": ">=12.0.0" + }, + "os": [ + "win32", + "darwin", + "linux" + ], "repository": { "type": "git", - "url": "https://github.com/xxuejie/ckb-js-toolkit.git" + "url": "git+https://github.com/nervosnetwork/lumos.git" }, "files": [ "index.d.ts", - "dist" + "lib" ], "scripts": { "build": "rollup -c --environment BUILD:production", diff --git a/packages/core/rollup.config.js b/packages/toolkit/rollup.config.js similarity index 96% rename from packages/core/rollup.config.js rename to packages/toolkit/rollup.config.js index 1a78fdd38..5d53327ed 100644 --- a/packages/core/rollup.config.js +++ b/packages/toolkit/rollup.config.js @@ -6,7 +6,7 @@ import { terser } from "rollup-plugin-terser"; import * as package_json from "./package.json"; const isProduction = process.env.BUILD === 'production'; -const outputFolder = isProduction ? "lib" : "build"; +const outputFolder = "lib"; const sourcemap = !isProduction; module.exports = [ diff --git a/packages/core/src/cell_collectors/index.js b/packages/toolkit/src/cell_collectors/index.js similarity index 100% rename from packages/core/src/cell_collectors/index.js rename to packages/toolkit/src/cell_collectors/index.js diff --git a/packages/core/src/cell_collectors/rpc_collector.js b/packages/toolkit/src/cell_collectors/rpc_collector.js similarity index 100% rename from packages/core/src/cell_collectors/rpc_collector.js rename to packages/toolkit/src/cell_collectors/rpc_collector.js diff --git a/packages/core/src/index.js b/packages/toolkit/src/index.js similarity index 100% rename from packages/core/src/index.js rename to packages/toolkit/src/index.js diff --git a/packages/core/src/normalizers.js b/packages/toolkit/src/normalizers.js similarity index 100% rename from packages/core/src/normalizers.js rename to packages/toolkit/src/normalizers.js diff --git a/packages/core/src/reader.js b/packages/toolkit/src/reader.js similarity index 100% rename from packages/core/src/reader.js rename to packages/toolkit/src/reader.js diff --git a/packages/core/src/rpc.js b/packages/toolkit/src/rpc.js similarity index 100% rename from packages/core/src/rpc.js rename to packages/toolkit/src/rpc.js diff --git a/packages/core/src/transaction_dumper.js b/packages/toolkit/src/transaction_dumper.js similarity index 100% rename from packages/core/src/transaction_dumper.js rename to packages/toolkit/src/transaction_dumper.js diff --git a/packages/core/src/transformers.js b/packages/toolkit/src/transformers.js similarity index 100% rename from packages/core/src/transformers.js rename to packages/toolkit/src/transformers.js diff --git a/packages/core/src/validators.js b/packages/toolkit/src/validators.js similarity index 100% rename from packages/core/src/validators.js rename to packages/toolkit/src/validators.js diff --git a/packages/core/testfiles/blockchain.umd.js b/packages/toolkit/testfiles/blockchain.umd.js similarity index 100% rename from packages/core/testfiles/blockchain.umd.js rename to packages/toolkit/testfiles/blockchain.umd.js diff --git a/packages/core/tests/serializers.js b/packages/toolkit/tests/serializers.js similarity index 99% rename from packages/core/tests/serializers.js rename to packages/toolkit/tests/serializers.js index efa06982d..1d20b860a 100644 --- a/packages/core/tests/serializers.js +++ b/packages/toolkit/tests/serializers.js @@ -1,5 +1,5 @@ const test = require("ava"); -const { normalizers, Reader } = require("../build/ckb-js-toolkit.node.js"); +const { normalizers, Reader } = require("../lib/ckb-js-toolkit.node.js"); const CKB = require("../testfiles/blockchain.umd.js"); test("normalize and serialize script", t => { diff --git a/packages/core/tests/transformers.js b/packages/toolkit/tests/transformers.js similarity index 99% rename from packages/core/tests/transformers.js rename to packages/toolkit/tests/transformers.js index 8c85e58bf..c3cc8b433 100644 --- a/packages/core/tests/transformers.js +++ b/packages/toolkit/tests/transformers.js @@ -1,5 +1,5 @@ const test = require("ava"); -const { transformers, Reader } = require("../build/ckb-js-toolkit.node.js"); +const { transformers, Reader } = require("../lib/ckb-js-toolkit.node.js"); test("transform script", t => { const s = transformers.TransformScript({ diff --git a/packages/core/tests/validators.js b/packages/toolkit/tests/validators.js similarity index 99% rename from packages/core/tests/validators.js rename to packages/toolkit/tests/validators.js index dbc334a32..caf4da429 100644 --- a/packages/core/tests/validators.js +++ b/packages/toolkit/tests/validators.js @@ -1,5 +1,5 @@ const test = require("ava"); -const { validators } = require("../build/ckb-js-toolkit.node.js"); +const { validators } = require("../lib/ckb-js-toolkit.node.js"); test("correct script should pass validation", t => { validators.ValidateScript({ diff --git a/packages/transaction-manager/lib/index.js b/packages/transaction-manager/lib/index.js index 19338ac38..58de04436 100644 --- a/packages/transaction-manager/lib/index.js +++ b/packages/transaction-manager/lib/index.js @@ -1,4 +1,4 @@ -const { validators, RPC } = require("ckb-js-toolkit"); +const { validators, RPC } = require("@ckb-lumos/toolkit"); const { List, Set } = require("immutable"); const { values, helpers } = require("@ckb-lumos/base"); const { TransactionCollector } = require("@ckb-lumos/indexer/lib"); diff --git a/packages/transaction-manager/package.json b/packages/transaction-manager/package.json index 9aac24ccb..33553ad65 100644 --- a/packages/transaction-manager/package.json +++ b/packages/transaction-manager/package.json @@ -38,7 +38,7 @@ "dependencies": { "@ckb-lumos/base": "^0.17.0-rc6", "@ckb-lumos/indexer": "^0.17.0-rc6", - "ckb-js-toolkit": "^0.10.2", + "@ckb-lumos/toolkit": "^0.17.0-rc6", "immutable": "^4.0.0-rc.12" } } diff --git a/yarn.lock b/yarn.lock index 7673f659a..b1c5b2b75 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3764,14 +3764,6 @@ cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: inherits "^2.0.1" safe-buffer "^5.0.1" -ckb-js-toolkit@^0.9.2: - version "0.9.2" - resolved "https://registry.yarnpkg.com/ckb-js-toolkit/-/ckb-js-toolkit-0.9.2.tgz#c80eb98dc25099241e97bb025ac1566b896bbd49" - integrity sha512-KutTBpsvkioPl3wPzwS6A5yEppq2pbpSPG4dXnbAu+L5gBzhQVEOj5tH4WBwF8qHm6u9mc/zCRnmjPw8e8Ad2g== - dependencies: - cross-fetch "^3.0.6" - jsbi "^3.1.2" - class-utils@^0.3.5: version "0.3.6" resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463"