diff --git a/.eslintrc b/.eslintrc index 90ed444e..a5b50eb5 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,6 +1,6 @@ { "root": true, - "parser": "babel-eslint", + "parser": "@typescript-eslint/parser", "parserOptions": { "ecmaVersion": 2018, "sourceType": "module", @@ -15,13 +15,8 @@ "browser": true, "jest": true }, - "plugins": [ - "babel", - "import" - ], - "extends": [ - "eslint-config-airbnb-base" - ], + "plugins": ["babel", "import"], + "extends": ["eslint-config-airbnb-base"], "globals": {}, "rules": { "no-console": ["warn"], @@ -34,7 +29,7 @@ "no-underscore-dangle": "off", "no-bitwise": "off", "no-mixed-operators": "off", - "max-len": ["error", { "code": 120}], + "max-len": ["error", { "code": 120 }], "class-methods-use-this": "off", "no-plusplus": "off" } diff --git a/package.json b/package.json index d716be6a..a6593093 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "aelf-sdk", + "name": "aelf-web3", "version": "3.2.41", "description": "aelf-sdk js library", "main": "dist/aelf.cjs.js", @@ -24,7 +24,7 @@ "test:node:watch": "jest --config=jest.node.config.js --watch" }, "keywords": [ - "aelf-sdk" + "aelf-web3" ], "files": [ "src", @@ -41,10 +41,12 @@ "engines": { "node": ">=10.5.0" }, + "types": "types", "engineStrict": true, "dependencies": { "@aelfqueen/protobufjs": "^6.8.9", "@babel/runtime": "^7.4.5", + "@typescript-eslint/parser": "^5.47.1", "assert": "^2.0.0", "bignumber.js": "^9.0.0", "bip39": "^3.0.2", @@ -65,6 +67,8 @@ "@babel/plugin-proposal-class-properties": "^7.4.4", "@babel/plugin-transform-runtime": "^7.4.4", "@babel/preset-env": "^7.4.5", + "@types/elliptic": "^6.4.14", + "@types/hdkey": "^2.0.1", "babel-eslint": "^10.0.2", "babel-loader": "^8.0.6", "bundle-analyzer": "^0.0.6", diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 00000000..f5748540 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,26 @@ +{ + "ts-node": { + "compilerOptions": { + "module": "commonjs" + } + }, + "compilerOptions": { + "module": "esnext", + "lib": ["dom", "dom.iterable", "esnext"], + "target": "es5", + "moduleResolution": "node", + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "noEmit": true, + "allowJs": false, + "allowSyntheticDefaultImports": false, + "baseUrl": ".", + "paths": { + "aelf-web3": ["types"] + }, + "esModuleInterop": true, + "declaration": true + } +} diff --git a/types/chain/chainMethod.d.ts b/types/chain/chainMethod.d.ts new file mode 100644 index 00000000..d85d1528 --- /dev/null +++ b/types/chain/chainMethod.d.ts @@ -0,0 +1,43 @@ +import * as protobuf from "@aelfqueen/protobufjs/light"; +import { RequestManager } from "types/util/requestManage"; +type TInputAddressFormatter = (address: any) => string; +interface IChainMethodParams { + name: string; + call: string; + method?: string; + params?: Array; + inputFormatter?: Array; + outputFormatter?: protobuf.Type | null; +} +export type TExtractArg = Function & { + isSync: boolean; + callback?: Function; + [k: string]: any; +}; +export interface IExtractArgumentsIntoObjectResult { + method: Function; + requestMethod: string; + isSync: boolean; + callback: Function; + params: { [k in string]: any }; +} +declare class ChainMethod { + constructor({ + name, + call, + method, + params, + inputFormatter, + outputFormatter, + }: IChainMethodParams); + public formatInput(args: Array): Array; + public setRequestManager(manager: RequestManager): void; + public formatOutput(result: any): any; + public extractArgumentsIntoObject( + args: TExtractArg[] + ): IExtractArgumentsIntoObjectResult; + public run( + args: TExtractArg[] + ): { [k: string]: any } | Promise<{ [k: string]: any }>; +} +export default ChainMethod; diff --git a/types/chain/index.d.ts b/types/chain/index.d.ts new file mode 100644 index 00000000..6e139663 --- /dev/null +++ b/types/chain/index.d.ts @@ -0,0 +1,22 @@ +import { Contract } from "types/contract"; +import { RequestManager } from "types/util/requestManage"; +import { IWallet } from "types/wallet"; +import { IExtractArgumentsIntoObjectResult, TExtractArg } from "./chainMethod"; + +declare class Chain { + constructor(requestManager: RequestManager); + public extractArgumentsIntoObject( + args: TExtractArg[] + ): IExtractArgumentsIntoObjectResult; + public contractAt( + address: string, + wallet: IWallet, + args: { [k in string]: any } + ): Promise; + public getMerklePath( + txId: string, + height: number, + args: { [k in string]: any } + ): any[] | null; +} +export default Chain; diff --git a/types/contract/contractMethod.d.ts b/types/contract/contractMethod.d.ts new file mode 100644 index 00000000..974f61f9 --- /dev/null +++ b/types/contract/contractMethod.d.ts @@ -0,0 +1,76 @@ +import Chain from "types/chain"; +import { IWallet } from "types/wallet"; +import * as protobuf from "@aelfqueen/protobufjs"; +import { ITransaction } from "types/util/proto"; +import { Contract } from "."; +type TRawTx = ITransaction & { + refBlockNumber: string; + refBlockPrefix: string; +}; + +interface IExtractArgumentsIntoObject { + callback: Function; + isSync: boolean; +} +interface IRequestRes { + method: string; + callback: Function; + params: string; + format?: { [k: string]: any } | null; +} +declare class ContractMethod { + constructor( + chain: Chain, + method: protobuf.Method, + contractAddress: string, + walletInstance: IWallet + ); + public packInput(input: { [k: string]: any }): Uint8Array; + public unpackPackedInput( + inputPacked?: ArrayBuffer | SharedArrayBuffer | null + ): { [k: string]: any } | undefined | null; + public unpackOutput( + output?: ArrayBuffer | SharedArrayBuffer | null + ): { [k: string]: any } | undefined | null; + public packOutput(result?: { [k: string]: any } | null): Uint8Array; + public handleTransaction( + height: string, + hash: string, + encoded: Uint8Array + ): string; + public prepareParametersAsync(args: Array): Promise; + public prepareParameters(args: Array): string; + public prepareParametersWithBlockInfo(args: Array): string; + // TODO + public sendTransaction( + ...args: Array<{ [k: string]: any }> + ): { TransactionId: string } | Promise<{ TransactionId: string }>; + public callReadOnly( + ...args: Array<{ [k: string]: any }> + ): + | { [k: string]: any } + | undefined + | null + | Promise<{ [k: string]: any } | undefined | null>; + public extractArgumentsIntoObject( + ...args: Array<{ [k: string]: any }> + ): IExtractArgumentsIntoObject; + + public getSignedTx(...args: Array<{ [k: string]: any }>): string | undefined; + public getRawTx( + blockHeightInput: string, + blockHashInput: string, + packedInput: Uint8Array + ): TRawTx; + public request(...args: Array): IRequestRes; + public run( + ...args: Array<{ [k: string]: any }> + ): { TransactionId: string } | Promise<{ TransactionId: string }>; + public bindMethodToContract(contract: Contract): void; + public getRawTx( + blockHeightInput: string, + blockHashInput: string, + packedInput: Uint8Array + ): TRawTx; +} +export default ContractMethod; diff --git a/types/contract/index.d.ts b/types/contract/index.d.ts new file mode 100644 index 00000000..984b3a10 --- /dev/null +++ b/types/contract/index.d.ts @@ -0,0 +1,22 @@ +import Chain from "types/chain"; +import { IFileDescriptorSet } from "@aelfqueen/protobufjs/ext/descriptor"; +import * as protobuf from "@aelfqueen/protobufjs/light"; +import { IWallet } from "types/wallet"; +export class Contract { + constructor(chain: Chain, services: Array, address: string); +} +declare class ContractFactory { + constructor( + chain: Chain, + fileDescriptorSet: IFileDescriptorSet, + wallet: IWallet + ); + public static bindMethodsToContract( + contract: Contract, + wallet: IWallet + ): void; + + public at(address: string, callback: Function): Contract; +} + +export default ContractFactory; diff --git a/types/index.d.ts b/types/index.d.ts new file mode 100644 index 00000000..d96d4c13 --- /dev/null +++ b/types/index.d.ts @@ -0,0 +1,101 @@ +import * as protobuf from "@aelfqueen/protobufjs/light"; +import HttpProvider from "./util/httpProvider"; +import Wallet from "./wallet/index"; +import * as proto from "./util/proto"; +import * as utils from "./util/utils"; +import { sha256 } from "js-sha256"; +import * as transform from "./util/transform"; +import { + arrayToHex, + padLeft, + padRight, + decodeAddressRep, + encodeAddressRep, + isBigNumber, + isString, + isFunction, + isObject, + isBoolean, + isJson, + toBigNumber, + getValueOfUnit, + fromWei, + toWei, + toTwosComplement, + uint8ArrayToHex, + noop, + setPath, + unpackSpecifiedTypeData, + deserializeTransaction, + getAuthorization, +} from "./util/utils"; +import { + isInBloom, + isEventInBloom, + isIndexedInBloom, + isAddressInBloom, +} from "./util/bloom"; +interface IUtils { + base58: utils.base58; + chainIdConvertor: utils.chainIdConvertor; + arrayToHex: typeof arrayToHex; + padLeft: typeof padLeft; + padRight: typeof padRight; + decodeAddressRep: typeof decodeAddressRep; + encodeAddressRep: typeof encodeAddressRep; + isBigNumber: typeof isBigNumber; + isString: typeof isString; + isFunction: typeof isFunction; + isObject: typeof isObject; + isBoolean: typeof isBoolean; + isJson: typeof isJson; + toBigNumber: typeof toBigNumber; + getValueOfUnit: typeof getValueOfUnit; + fromWei: typeof fromWei; + toWei: typeof toWei; + toTwosComplement: typeof toTwosComplement; + uint8ArrayToHex: typeof uint8ArrayToHex; + noop: typeof noop; + setPath: typeof setPath; + unpackSpecifiedTypeData: typeof unpackSpecifiedTypeData; + deserializeTransaction: typeof deserializeTransaction; + getAuthorization: typeof getAuthorization; +} +import Settings from "./util/settings"; +interface IBloom { + isInBloom: typeof isInBloom; + isEventInBloom: typeof isEventInBloom; + isIndexedInBloom: typeof isIndexedInBloom; + isAddressInBloom: typeof isAddressInBloom; +} +type TUtil = IUtils & + IBloom & { + sha256: typeof sha256; + } & { + transform: typeof transform; + }; +interface IVersion { + api?: string; +} +declare namespace AElf {} +export declare class AElf { + constructor(provider: HttpProvider); + static version?: string; + static providers: { + HttpProvider: HttpProvider; + }; + static pbjs: typeof protobuf; + static pbUtils: typeof proto; + static wallet: Wallet; + static utils: TUtil; + providers: { + HttpProvider: HttpProvider; + }; + settings: Settings; + version: IVersion; + isConnected(): boolean; + // TODO: + // reset 方法不存在 + setProvider(provider: HttpProvider): void; +} +export default AElf; diff --git a/types/util/bloom.d.ts b/types/util/bloom.d.ts new file mode 100644 index 00000000..b0a58bc9 --- /dev/null +++ b/types/util/bloom.d.ts @@ -0,0 +1,13 @@ +export declare function isInBloom(bloom: string, hash: string): boolean; +export declare function isEventInBloom( + bloom: string, + eventName: string +): boolean; +export declare function isIndexedInBloom( + bloom: string, + indexed: string +): boolean; +export declare function isAddressInBloom( + bloom: string, + address: string +): boolean; diff --git a/types/util/errors.d.ts b/types/util/errors.d.ts new file mode 100644 index 00000000..6001d1ce --- /dev/null +++ b/types/util/errors.d.ts @@ -0,0 +1,9 @@ +interface IRequestError { + InvalidNumberOfRPCParams(): Error; + InvalidConnection(host: string): Error; + InvalidProvider(): Error; + InvalidResponse(error: Error, result: { [k: string]: any }): Error; + ConnectionTimeout(ms: string | number): Error; +} +declare const RequestError: IRequestError; +export { RequestError }; diff --git a/types/util/formatters.d.ts b/types/util/formatters.d.ts new file mode 100644 index 00000000..209931fb --- /dev/null +++ b/types/util/formatters.d.ts @@ -0,0 +1,3 @@ +import { Message } from "@aelfqueen/protobufjs"; +export function inputAddressFormatter(address: string): string; +export function outputFileDescriptorSetFormatter(result: string): Message<{}>; diff --git a/types/util/hash.d.ts b/types/util/hash.d.ts new file mode 100644 index 00000000..c8906f24 --- /dev/null +++ b/types/util/hash.d.ts @@ -0,0 +1,4 @@ +export declare function keccak256(bits: Buffer): string; +export declare function keccak512(bits: Buffer): string; +export declare function keccak256s(bits: Buffer): string; +export declare function keccak512s(bits: Buffer): string; diff --git a/types/util/httpProvider.d.ts b/types/util/httpProvider.d.ts new file mode 100644 index 00000000..713fed36 --- /dev/null +++ b/types/util/httpProvider.d.ts @@ -0,0 +1,43 @@ +interface ITimeoutResolve { + type: string; +} +type TRequestConfig = { + url: RequestInfo | URL; +} & RequestInit; +interface IError { + message: string; +} +interface IFormatResponseTextRes { + status: number; + error: number; + Error: IError; + statusText: string; +} +declare class HttpProvider { + constructor(host?: string, timeout?: number, headers?: Headers); + public static formatResponse(response: Response): { [k: string]: any }; + public static formatResponseText(request: Request): IFormatResponseTextRes; + public static timeoutPromise(delay: number): Promise; + public requestSendByFetch( + requestConfig: TRequestConfig, + request: Request + ): Request; + public sendAsyncByFetch( + requestConfig: TRequestConfig + ): Promise<{ [k: string]: any }>; + public requestSend( + requestConfig: TRequestConfig, + request: Request, + isAsync?: boolean + ): void; + public send(requestConfig: TRequestConfig): { [k: string]: any }; + public sendAsync( + requestConfig: TRequestConfig + ): Promise<{ [k: string]: any }>; + public sendAsyncByXMLHttp( + requestConfig: TRequestConfig + ): Promise<{ [k: string]: any }>; + public isConnected(): boolean; + public isConnectedAsync(): boolean; +} +export default HttpProvider; diff --git a/types/util/keyStore.d.ts b/types/util/keyStore.d.ts new file mode 100644 index 00000000..278c8744 --- /dev/null +++ b/types/util/keyStore.d.ts @@ -0,0 +1,51 @@ +import { IWallet } from "../wallet"; + +interface IOptions { + dklen: number; + n: number; + r: number; + p: number; + cipher: string; +} +interface IKdfparams { + dklen: number; + n: number; + r: number; + p: number; + salt: string; +} +type TWalletInfo = IWallet & { + nickName?: string; +}; +interface ICipherparams { + iv: string; +} +interface ICrypto { + cipher: string; + cipherparams: ICipherparams; + ciphertext: string; + kdf: string; + kdfparams: IKdfparams; + mac: string; + mnemonicEncrypted: string; +} +interface IkeyStore { + version: number; + type: string; + nickName?: string; + address: string; + crypto: ICrypto; +} +export declare function getKeystore( + walletInfoInput: TWalletInfo, + password: string, + option?: IOptions +): IkeyStore; +export declare function unlockKeystore( + keyStoreInput: IkeyStore, + password: string +): TWalletInfo; +export declare function checkPassword( + keyStoreInput: IkeyStore, + password: string +): boolean; diff --git a/types/util/merkleTree.d.ts b/types/util/merkleTree.d.ts new file mode 100644 index 00000000..f371882d --- /dev/null +++ b/types/util/merkleTree.d.ts @@ -0,0 +1,7 @@ +type Message = string | number[] | ArrayBuffer | Uint8Array; +export declare function computeRoot(data: Array): Buffer; +export declare function getMerklePath( + index: number, + data: Array +): Array | null; +export function node(buffer: Message): Buffer; diff --git a/types/util/proto.d.ts b/types/util/proto.d.ts new file mode 100644 index 00000000..013a56e8 --- /dev/null +++ b/types/util/proto.d.ts @@ -0,0 +1,50 @@ +import * as protobuf from "@aelfqueen/protobufjs/light"; +export interface IAddress { + value: Uint8Array; +} +export interface ITransaction { + from: IAddress; + to: IAddress; + methodName: string; + params: string; +} + +export const coreRootProto: protobuf.Root; +export const Transaction: protobuf.Type; +export const Hash: protobuf.Type; +export const Address: protobuf.Type; +export const TransactionFeeCharged: protobuf.Type; +export const ResourceTokenCharged: protobuf.Type; +export function getFee( + base64Str: string, + type?: string +): { [k: string]: any } | undefined | null; + +interface ILog { + Address: string; + Name: string; + Indexed: Array | null; + NonIndexed: string; +} +export function getSerializedDataFromLog(log: ILog): string; +export function getResourceFee( + Logs?: Array +): Array<{ [k: string]: any } | undefined | null>; +export function getTransactionFee( + Logs?: Array +): Array<{ [k: string]: any } | undefined | null>; + +export function arrayBufferToHex(arrayBuffer: Buffer): string; +export function getRepForAddress(address: { [k: string]: any }): string; +export function getAddressFromRep(rep: string): protobuf.Message<{}>; +export function getAddressObjectFromRep(rep: string): { [k: string]: any }; +export function getRepForHash(hash: protobuf.Message<{}>): string; +export function getHashFromHex(hex: string): protobuf.Message<{}>; +export function getHashObjectFromHex(hex: string): { [k: string]: any }; +export function encodeTransaction(tx: { [k: string]: any }): Uint8Array; +export function getTransaction( + from: string, + to: string, + methodName: string, + params: Uint8Array +): protobuf.Message<{}>; diff --git a/types/util/requestManage.d.ts b/types/util/requestManage.d.ts new file mode 100644 index 00000000..1d513b5c --- /dev/null +++ b/types/util/requestManage.d.ts @@ -0,0 +1,22 @@ +import HttpProvider from "./httpProvider"; +interface IRequestBody { + requestMethod: string; + method: Function; + params: { [k: string]: any }; +} +interface IPrepareResult { + method: string; + url: Function; + params: { [k in string]: any }; +} +declare class RequestManager { + constructor(provider: HttpProvider); + public static prepareRequest({ + requestMethod, + method, + params, + }: IRequestBody): IPrepareResult; + public setProvider(provider: HttpProvider): void; + public send(requestBody: IRequestBody): Response; + public sendAsync(requestBody: IRequestBody): Promise; +} diff --git a/types/util/settings.d.ts b/types/util/settings.d.ts new file mode 100644 index 00000000..ab3e8089 --- /dev/null +++ b/types/util/settings.d.ts @@ -0,0 +1,4 @@ +declare class Settings { + constructor(); +} +export default Settings; diff --git a/types/util/transform.d.ts b/types/util/transform.d.ts new file mode 100644 index 00000000..0d280514 --- /dev/null +++ b/types/util/transform.d.ts @@ -0,0 +1,29 @@ +import * as protobuf from "@aelfqueen/protobufjs"; +interface IInTransformer { + filter: (resolvedType: protobuf.Type) => boolean; + transformer: (origin: string | Array) => { + value: string | Array; + }; +} +interface IOutTransformer { + filter: (resolvedType: protobuf.Type) => boolean; + transformer: (origin: string | Array) => string | Array; +} + +export function transform( + inputType: protobuf.Type, + origin: { [k: string]: any }, + transformers?: Array +): { [k: string]: any } | undefined | null; + +export function transformMapToArray( + inputType: protobuf.Type, + origin?: { [k: string]: any } +): { [k: string]: any } | Array<{ [k: string]: any }> | undefined | null; +export function transformArrayToMap( + inputType: protobuf.Type, + origin?: { [k: string]: any } | Array<{ [k: string]: any }> +): { [k: string]: any } | undefined | null; +export const INPUT_TRANSFORMERS: IInTransformer; +export function encodeAddress(str: string): string; +export const OUTPUT_TRANSFORMERS: IOutTransformer[]; diff --git a/types/util/utils.d.ts b/types/util/utils.d.ts new file mode 100644 index 00000000..5ddca7d4 --- /dev/null +++ b/types/util/utils.d.ts @@ -0,0 +1,68 @@ +import BigNumber from "bignumber.js"; +import * as protobuf from "@aelfqueen/protobufjs/light"; +export interface base58 { + encode(data: ArrayBuffer | SharedArrayBuffer, encoding?: number): string; + decode(str: string, encoding?: string): Buffer; +} +export interface chainIdConvertor { + chainIdToBase58(chainId: string): string; + base58ToChainId(base58String: string): Buffer; +} +export declare function arrayToHex(value: Buffer): string; +export declare function padLeft( + string: string, + charLen: number, + sign?: string +): string; +export declare function padRight( + string: string, + charLen: number, + sign?: string +): string; +export declare function decodeAddressRep(address: string): string; +export declare function encodeAddressRep(hex: string): string; +export declare function isBigNumber(object: any): boolean; +export declare function isString(object: any): boolean; +export declare function isFunction(object: any): boolean; +export declare function isObject(object: any): boolean; +export declare function isBoolean(object: any): boolean; +export declare function isJson(str: string): boolean; + +export declare function toBigNumber( + number: number | string | BigNumber +): BigNumber; +export declare function getValueOfUnit(unit: string): BigNumber; + +export declare function fromWei( + number: number | string, + unit: string +): string | BigNumber; +export declare function toWei( + number: number | string | BigNumber, + unit: string +): string | BigNumber; +export declare function toTwosComplement( + number: number | string | BigNumber +): BigNumber; +export declare function uint8ArrayToHex(uint8Array: Uint8Array): string; + +export declare function noop(): void; +export declare function setPath(obj: any, path: string, value: any): void; +interface IUnpackSpecifiedParams { + data: ArrayBuffer | SharedArrayBuffer; + dataType: protobuf.Type; + encoding?: string; +} +export declare function unpackSpecifiedTypeData({ + data, + dataType, + encoding, +}: IUnpackSpecifiedParams): { [k: string]: any }; +export declare function deserializeTransaction( + rawTx: ArrayBuffer | SharedArrayBuffer, + paramsDataType: protobuf.Type +): { [k: string]: any }; +export declare function getAuthorization( + userName: string, + password: string +): string; diff --git a/types/wallet/index.d.ts b/types/wallet/index.d.ts new file mode 100644 index 00000000..4027c26a --- /dev/null +++ b/types/wallet/index.d.ts @@ -0,0 +1,37 @@ +import HDNode = require("hdkey"); +import * as Bip39 from "bip39"; +import { ec, curve } from "elliptic"; +import { ITransaction } from "../util/proto"; +import * as KeyStore from "../util/keyStore"; + +export default Wallet; + +interface ISignature { + signature: Uint8Array; +} +type TSignTransaction = ISignature & ITransaction; + +export interface IWallet { + BIP44Path: string; + address: string; + childWallet: IWallet | string; + keyPair: ec.KeyPair; + mnemonic: string; + privateKey: string; +} + +declare class Wallet { + ellipticEc: ec; + hdkey: HDNode; + bip39: typeof Bip39; + keyStore: typeof KeyStore; + AESEncrypt(input: string, password: string): string; + AESDescrypt(input: string, password: string): string; + getSignature(bytesToBeSign: string, keyPair: ec.KeyPair): Buffer; + getAddressFromPubKey(pubKey: curve.base.BasePoint): string; + createNewWallet(BIP44Path?: string): IWallet; + getWalletByMnemonic(mnemonic: string, BIP44Path: string): IWallet; + getWalletByPrivateKey(privateKey: string): IWallet; + signTransaction(rawTxn: ITransaction, keyPair: ec.KeyPair): TSignTransaction; + sign(hexString: string, keyPair: ec.KeyPair): Buffer; +} diff --git a/yarn.lock b/yarn.lock index db8abdb5..d9ae9380 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1005,6 +1005,20 @@ dependencies: "@babel/types" "^7.3.0" +"@types/bn.js@*": + version "5.1.1" + resolved "https://registry.npmjs.org/@types/bn.js/-/bn.js-5.1.1.tgz#b51e1b55920a4ca26e9285ff79936bbdec910682" + integrity sha512-qNrYbZqMx0uJAfKnKclPh+dTwK33KfLHYqtyODwd5HnXOjnkhc4qgn3BrK6RWyGZm5+sIFE7Q7Vz6QQtJB7w7g== + dependencies: + "@types/node" "*" + +"@types/elliptic@^6.4.14": + version "6.4.14" + resolved "https://registry.npmjs.org/@types/elliptic/-/elliptic-6.4.14.tgz#7bbaad60567a588c1f08b10893453e6b9b4de48e" + integrity sha512-z4OBcDAU0GVwDTuwJzQCiL6188QvZMkvoERgcVjq0/mPM8jCfdwZ3x5zQEVoL9WCAru3aG5wl3Z5Ww5wBWn7ZQ== + dependencies: + "@types/bn.js" "*" + "@types/events@*": version "3.0.0" resolved "https://registry.yarnpkg.com/@types/events/-/events-3.0.0.tgz#2862f3f58a9a7f7c3e78d79f130dd4d71c25c2a7" @@ -1019,6 +1033,13 @@ "@types/minimatch" "*" "@types/node" "*" +"@types/hdkey@^2.0.1": + version "2.0.1" + resolved "https://registry.npmjs.org/@types/hdkey/-/hdkey-2.0.1.tgz#ab46597562d977b229704c7f19949953b936b6a3" + integrity sha512-4s6jhP0BT3sWBaRo0BfA3BpFllQvuRlXUzIqnuvSNmPhmMCZYjhrDe31nJb8kJLc0ZVdqj9Ep9eH2RGBNCK9Sw== + dependencies: + "@types/node" "*" + "@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0": version "2.0.1" resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz#42995b446db9a48a11a07ec083499a860e9138ff" @@ -1096,6 +1117,50 @@ dependencies: "@types/yargs-parser" "*" +"@typescript-eslint/parser@^5.47.1": + version "5.47.1" + resolved "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.47.1.tgz#c4bf16f8c3c7608ce4bf8ff804b677fc899f173f" + integrity sha512-9Vb+KIv29r6GPu4EboWOnQM7T+UjpjXvjCPhNORlgm40a9Ia9bvaPJswvtae1gip2QEeVeGh6YquqAzEgoRAlw== + dependencies: + "@typescript-eslint/scope-manager" "5.47.1" + "@typescript-eslint/types" "5.47.1" + "@typescript-eslint/typescript-estree" "5.47.1" + debug "^4.3.4" + +"@typescript-eslint/scope-manager@5.47.1": + version "5.47.1" + resolved "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.47.1.tgz#0d302b3c2f20ab24e4787bf3f5a0d8c449b823bd" + integrity sha512-9hsFDsgUwrdOoW1D97Ewog7DYSHaq4WKuNs0LHF9RiCmqB0Z+XRR4Pf7u7u9z/8CciHuJ6yxNws1XznI3ddjEw== + dependencies: + "@typescript-eslint/types" "5.47.1" + "@typescript-eslint/visitor-keys" "5.47.1" + +"@typescript-eslint/types@5.47.1": + version "5.47.1" + resolved "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.47.1.tgz#459f07428aec5a8c4113706293c2ae876741ac8e" + integrity sha512-CmALY9YWXEpwuu6377ybJBZdtSAnzXLSQcxLSqSQSbC7VfpMu/HLVdrnVJj7ycI138EHqocW02LPJErE35cE9A== + +"@typescript-eslint/typescript-estree@5.47.1": + version "5.47.1" + resolved "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.47.1.tgz#b9d8441308aca53df7f69b2c67a887b82c9ed418" + integrity sha512-4+ZhFSuISAvRi2xUszEj0xXbNTHceV9GbH9S8oAD2a/F9SW57aJNQVOCxG8GPfSWH/X4eOPdMEU2jYVuWKEpWA== + dependencies: + "@typescript-eslint/types" "5.47.1" + "@typescript-eslint/visitor-keys" "5.47.1" + debug "^4.3.4" + globby "^11.1.0" + is-glob "^4.0.3" + semver "^7.3.7" + tsutils "^3.21.0" + +"@typescript-eslint/visitor-keys@5.47.1": + version "5.47.1" + resolved "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.47.1.tgz#d35c2da544dbb685db9c5b5b85adac0a1d74d1f2" + integrity sha512-rF3pmut2JCCjh6BLRhNKdYjULMb1brvoaiWDlHfLNVgmnZ0sBVJrs3SyaKE1XoDDnJuAx/hDQryHYmPUuNq0ig== + dependencies: + "@typescript-eslint/types" "5.47.1" + eslint-visitor-keys "^3.3.0" + "@webassemblyjs/ast@1.8.5": version "1.8.5" resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.8.5.tgz#51b1c5fe6576a34953bf4b253df9f0d490d9e359" @@ -1780,7 +1845,7 @@ braces@^2.3.1, braces@^2.3.2: split-string "^3.0.2" to-regex "^3.0.1" -braces@^3.0.1: +braces@^3.0.1, braces@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== @@ -2761,6 +2826,13 @@ debug@^4.0.1, debug@^4.1.0, debug@^4.1.1: dependencies: ms "^2.1.1" +debug@^4.3.4: + version "4.3.4" + resolved "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" + integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== + dependencies: + ms "2.1.2" + decamelize-keys@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/decamelize-keys/-/decamelize-keys-1.1.0.tgz#d171a87933252807eb3cb61dc1c1445d078df2d9" @@ -3208,6 +3280,11 @@ eslint-visitor-keys@^1.0.0, eslint-visitor-keys@^1.1.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz#e2a82cea84ff246ad6fb57f9bde5b46621459ec2" integrity sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A== +eslint-visitor-keys@^3.3.0: + version "3.3.0" + resolved "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz#f6480fa6b1f30efe2d1968aa8ac745b862469826" + integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== + eslint@^6.0.1: version "6.8.0" resolved "https://registry.yarnpkg.com/eslint/-/eslint-6.8.0.tgz#62262d6729739f9275723824302fb227c8c93ffb" @@ -3487,6 +3564,17 @@ fast-glob@^3.0.3: merge2 "^1.3.0" micromatch "^4.0.2" +fast-glob@^3.2.9: + version "3.2.12" + resolved "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz#7f39ec99c2e6ab030337142da9e0c18f37afae80" + integrity sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w== + 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" @@ -3906,6 +3994,13 @@ glob-parent@^5.0.0, glob-parent@^5.1.0: dependencies: is-glob "^4.0.1" +glob-parent@^5.1.2: + version "5.1.2" + resolved "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" + integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== + dependencies: + is-glob "^4.0.1" + glob@7.1.4: version "7.1.4" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.4.tgz#aa608a2f6c577ad357e1ae5a5c26d9a8d1969255" @@ -4007,6 +4102,18 @@ globby@^10.0.1: merge2 "^1.2.3" slash "^3.0.0" +globby@^11.1.0: + version "11.1.0" + resolved "https://registry.npmjs.org/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" + graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.2: version "4.2.3" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.3.tgz#4a12ff1b60376ef09862c2093edd908328be8423" @@ -4266,6 +4373,11 @@ ignore@^5.1.1: resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.4.tgz#84b7b3dbe64552b6ef0eca99f6743dbec6d97adf" integrity sha512-MzbUSahkTW1u7JpKKjY7LCARd1fU5W2rLdxlM4kdkayuCwZImjkpluF9CM1aLewYJguPDqewLam18Y6AU69A8A== +ignore@^5.2.0: + version "5.2.4" + resolved "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz#a291c0c6178ff1b960befe47fcdec301674a6324" + integrity sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ== + import-fresh@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-2.0.0.tgz#d81355c15612d386c61f9ddd3922d4304822a546" @@ -4572,6 +4684,13 @@ is-glob@^4.0.0, is-glob@^4.0.1: dependencies: is-extglob "^2.1.1" +is-glob@^4.0.3: + version "4.0.3" + resolved "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" + integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== + dependencies: + is-extglob "^2.1.1" + is-nan@^1.2.1: version "1.3.0" resolved "https://registry.yarnpkg.com/is-nan/-/is-nan-1.3.0.tgz#85d1f5482f7051c2019f5673ccebdb06f3b0db03" @@ -5718,6 +5837,11 @@ merge2@^1.2.3, merge2@^1.3.0: resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.3.0.tgz#5b366ee83b2f1582c48f87e47cf1a9352103ca81" integrity sha512-2j4DAdlBOkiSZIsaXk4mTE3sRS02yBHAtfy127xRV3bQUFqXkjHCHLW6Scv7DwNRbIWNHH8zpnz9zMaKXIdvYw== +merge2@^1.4.1: + version "1.4.1" + resolved "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" + integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== + merge@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/merge/-/merge-1.2.1.tgz#38bebf80c3220a8a487b6fcfb3941bb11720c145" @@ -5755,6 +5879,14 @@ micromatch@^4.0.2: braces "^3.0.1" picomatch "^2.0.5" +micromatch@^4.0.4: + version "4.0.5" + resolved "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz#bc8999a7cbbf77cdc89f132f6e467051b49090c6" + integrity sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA== + dependencies: + braces "^3.0.2" + picomatch "^2.3.1" + miller-rabin@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/miller-rabin/-/miller-rabin-4.0.1.tgz#f080351c865b0dc562a8462966daa53543c78a4d" @@ -5911,7 +6043,7 @@ ms@2.1.1: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg== -ms@^2.1.1: +ms@2.1.2, ms@^2.1.1: version "2.1.2" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== @@ -6548,6 +6680,11 @@ picomatch@^2.0.5: resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.1.tgz#21bac888b6ed8601f831ce7816e335bc779f0a4a" integrity sha512-ISBaA8xQNmwELC7eOjqFKMESB2VIqt4PPDD0nsS95b/9dZXvVKOlz9keMSnoGGKcOHXfTvDD6WMaRoSc9UuhRA== +picomatch@^2.3.1: + version "2.3.1" + resolved "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" + integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== + pify@^2.0.0, pify@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" @@ -7370,6 +7507,13 @@ semver@^7.1.1, semver@^7.3.2: dependencies: lru-cache "^6.0.0" +semver@^7.3.7: + version "7.3.8" + resolved "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz#07a78feafb3f7b32347d725e33de7e2a2df67798" + integrity sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A== + dependencies: + lru-cache "^6.0.0" + send@0.17.1: version "0.17.1" resolved "https://registry.yarnpkg.com/send/-/send-0.17.1.tgz#c1d8b059f7900f7466dd4938bdc44e11ddb376c8" @@ -8144,11 +8288,23 @@ tryer@^1.0.1: resolved "https://registry.yarnpkg.com/tryer/-/tryer-1.0.1.tgz#f2c85406800b9b0f74c9f7465b81eaad241252f8" integrity sha512-c3zayb8/kWWpycWYg87P71E1S1ZL6b6IJxfb5fvsUgsf0S2MVGaDhDXXjDMpdCpfWXqptc+4mXwmiy1ypXqRAA== +tslib@^1.8.1: + version "1.14.1" + resolved "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" + integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== + tslib@^1.9.0: version "1.10.0" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a" integrity sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ== +tsutils@^3.21.0: + version "3.21.0" + resolved "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz#b48717d394cea6c1e096983eed58e9d61715b623" + integrity sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA== + dependencies: + tslib "^1.8.1" + tty-browserify@0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6"