diff --git a/packages/xchain-cosmos-sdk/.gitignore b/packages/xchain-cosmos-sdk/.gitignore new file mode 100644 index 000000000..b72199a3c --- /dev/null +++ b/packages/xchain-cosmos-sdk/.gitignore @@ -0,0 +1,6 @@ +*.log +.DS_Store +node_modules +lerna-debug.log +npm-debug.log +packages/**/lib diff --git a/packages/xchain-cosmos-sdk/CHANGELOG.md b/packages/xchain-cosmos-sdk/CHANGELOG.md new file mode 100644 index 000000000..b2580c697 --- /dev/null +++ b/packages/xchain-cosmos-sdk/CHANGELOG.md @@ -0,0 +1,3 @@ +# v.0.1.0 (2023-09-19) + +First release diff --git a/packages/xchain-cosmos-sdk/LICENSE b/packages/xchain-cosmos-sdk/LICENSE new file mode 100644 index 000000000..3adb269e7 --- /dev/null +++ b/packages/xchain-cosmos-sdk/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 THORChain + +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/xchain-cosmos-sdk/README.md b/packages/xchain-cosmos-sdk/README.md new file mode 100644 index 000000000..417a01fc4 --- /dev/null +++ b/packages/xchain-cosmos-sdk/README.md @@ -0,0 +1,17 @@ +# `@xchainjs/xchain-cosmos-sdk` + +## Modules + +- `client` - Custom client for communicating with cosmosSDK chains by using [`cosmjs`](https://github.com/cosmos/cosmjs) + +## Installation + +``` +yarn add @xchainjs/xchain-cosmos-sdk +``` + +Following peer dependencies have to be installed into your project. These are not included in `@xchainjs/xchain-cosmos-sdk`. + +``` +yarn add @xchainjs/xchain-client @xchainjs/xchain-crypto @xchainjs/xchain-util +``` diff --git a/packages/xchain-cosmos-sdk/__e2e__/cosmos-sdk-client.e2e.ts b/packages/xchain-cosmos-sdk/__e2e__/cosmos-sdk-client.e2e.ts new file mode 100644 index 000000000..0ca799eee --- /dev/null +++ b/packages/xchain-cosmos-sdk/__e2e__/cosmos-sdk-client.e2e.ts @@ -0,0 +1,128 @@ +import { AssetInfo, Network, TxParams } from '@xchainjs/xchain-client' +import { Asset, assetFromString, assetToString, baseAmount, eqAsset } from '@xchainjs/xchain-util' + +const AssetKUJI = assetFromString('KUJI.KUJI') as Asset +const AssetTokenKuji = { + chain: 'KUJI', + symbol: 'factory/kujira1ltvwg69sw3c5z99c6rr08hal7v0kdzfxz07yj5/demo', + ticker: '', + synth: false, +} + +import Client from '../src/client' + +let xchainClient: Client + +class CustomSdkClient extends Client { + getAssetInfo(): AssetInfo { + throw new Error('Method not implemented.') + } + getDenom(asset: Asset): string | null { + if (eqAsset(asset, AssetKUJI)) return 'ukuji' + return null + } + assetFromDenom(denom: string): Asset | null { + if (denom === this.baseDenom) return AssetKUJI + return { + chain: AssetKUJI.chain, + symbol: denom, + ticker: '', + synth: false, + } + } + getExplorerUrl(): string { + throw new Error('Method not implemented.') + } + getExplorerAddressUrl(_address: string): string { + throw new Error('Method not implemented.') + } + getExplorerTxUrl(_txID: string): string { + throw new Error('Method not implemented.') + } +} + +describe('Cosmos SDK client Integration Tests', () => { + beforeEach(() => { + const settings = { + network: Network.Testnet, + phrase: process.env.MAINNETPHRASE, + chain: AssetKUJI.chain, + defaultDecimals: 6, + prefix: 'kujira', + baseDenom: 'ukuji', + defaultFee: baseAmount(5000, 6), + rootDerivationPaths: { + [Network.Mainnet]: `44'/118'/0'/0/`, + [Network.Testnet]: `44'/118'/0'/0/`, + [Network.Stagenet]: `44'/118'/0'/0/`, + }, + clientUrls: { + [Network.Testnet]: 'https://test-rpc-kujira.mintthemoon.xyz/', + [Network.Stagenet]: 'wip', + [Network.Mainnet]: 'wip', + }, + } + xchainClient = new CustomSdkClient(settings) + }) + it('should fetch balances cosmos sdk', async () => { + const address = await xchainClient.getAddress() + const balances = await xchainClient.getBalance(address) + + balances.forEach((bal) => { + console.log(`${address} ${assetToString(bal.asset)} = ${bal.amount.amount()}`) + }) + expect(balances.length).toBeGreaterThan(0) + }) + it('should validate invalid addreses', async () => { + const isValid = xchainClient.validateAddress('asdadasd') + expect(isValid).toBe(false) + }) + it('should validate valid addreses', async () => { + const isValid = xchainClient.validateAddress('kujira1es76p8qspctcxhex79c32nng9fvhuxjn4z6u7k') + expect(isValid).toBe(true) + }) + it('should generate addreses', async () => { + const address0 = await xchainClient.getAddress(0) + console.log('address0', address0) + }) + it('should get transactions', async () => { + const txs = await xchainClient.getTransactions({ + address: 'kujira1kltgthzruhvdm8u2rjtke69tppwys63rx3fk8a', + }) + console.log('txs', txs) + console.log('To:', txs.txs[0].to[0].amount.amount().toString()) + console.log('From:', txs.txs[0].from[0].amount.amount().toString()) + }) + it('should get transaction data', async () => { + const tx = await xchainClient.getTransactionData('F3131AE603FFDE602217330410DD3ADFB9E21C987DDAA5CCF54F99DB15A6714B') + console.log('tx', tx) + tx.from.forEach((row) => console.log('from:', row.from, row.amount.amount().toString())) + tx.to.forEach((row) => console.log('to:', row.to, row.amount.amount().toString())) + }) + it('get fees', async () => { + const fees = await xchainClient.getFees() + console.log('fees', fees.average.amount().toString()) + }) + + it('transfer', async () => { + const txDate: TxParams = { + asset: AssetKUJI, + amount: baseAmount('1000', 6), + recipient: 'kujira1es76p8qspctcxhex79c32nng9fvhuxjn4z6u7k', + memo: 'Rosa melano', + } + const txHash = await xchainClient.transfer(txDate) + console.log('txHash', txHash) + }) + + it('Try secondary token transfer', async () => { + const txDate: TxParams = { + asset: AssetTokenKuji, + amount: baseAmount('100000', 6), + recipient: 'kujira1es76p8qspctcxhex79c32nng9fvhuxjn4z6u7k', + memo: 'Rosa melano', + } + const txHash = await xchainClient.transfer(txDate) + console.log('txHash', txHash) + }) +}) diff --git a/packages/xchain-cosmos-sdk/jest.config.e2e.js b/packages/xchain-cosmos-sdk/jest.config.e2e.js new file mode 100644 index 000000000..ea1f7573c --- /dev/null +++ b/packages/xchain-cosmos-sdk/jest.config.e2e.js @@ -0,0 +1,8 @@ +module.exports = { + preset: 'ts-jest', + testEnvironment: 'node', + testPathIgnorePatterns: ['/node_modules', '/lib'], + testMatch: ['/__e2e__/**/*.[jt]s?(x)'], + maxConcurrency: 1, + setupFilesAfterEnv: ['./jest.setup.js'], +} diff --git a/packages/xchain-cosmos-sdk/jest.config.js b/packages/xchain-cosmos-sdk/jest.config.js new file mode 100644 index 000000000..2c5daf952 --- /dev/null +++ b/packages/xchain-cosmos-sdk/jest.config.js @@ -0,0 +1,6 @@ +module.exports = { + preset: 'ts-jest', + testEnvironment: 'node', + testPathIgnorePatterns: ['/node_modules', '/lib'], + setupFilesAfterEnv: ['./jest.setup.js'], +} diff --git a/packages/xchain-cosmos-sdk/jest.setup.js b/packages/xchain-cosmos-sdk/jest.setup.js new file mode 100644 index 000000000..7f0aeddaa --- /dev/null +++ b/packages/xchain-cosmos-sdk/jest.setup.js @@ -0,0 +1 @@ +jest.setTimeout(60000) diff --git a/packages/xchain-cosmos-sdk/package.json b/packages/xchain-cosmos-sdk/package.json new file mode 100644 index 000000000..a077a2882 --- /dev/null +++ b/packages/xchain-cosmos-sdk/package.json @@ -0,0 +1,54 @@ +{ + "name": "@xchainjs/xchain-cosmos-sdk", + "version": "0.1.0", + "description": "Genereic Cosmos SDK client for XChainJS", + "keywords": [ + "XChain", + "CosmosSDK" + ], + "author": "XChainJS", + "homepage": "https://github.com/xchainjs/xchainjs-lib", + "license": "MIT", + "main": "lib/index.js", + "module": "lib/index.esm.js", + "typings": "lib/index.d.ts", + "directories": { + "lib": "lib", + "test": "__tests__" + }, + "files": [ + "lib" + ], + "repository": { + "type": "git", + "url": "git@github.com:xchainjs/xchainjs-lib.git" + }, + "scripts": { + "clean": "rimraf lib/**", + "build": "yarn clean && rollup -c", + "test": "jest --passWithNoTests", + "e2e": "jest --config jest.config.e2e.js", + "lint": "eslint \"{src,__tests__, __mocks__}/**/*.ts\" --fix --max-warnings 0", + "prepublishOnly": "yarn build" + }, + "publishConfig": { + "access": "public" + }, + "devDependencies": { + "@types/secp256k1": "^4.0.3", + "@xchainjs/xchain-client": "^0.14.2", + "@xchainjs/xchain-crypto": "^0.3.0", + "@xchainjs/xchain-util": "^0.13.1" + }, + "peerDependencies": { + "@xchainjs/xchain-client": "^0.14.2", + "@xchainjs/xchain-crypto": "^0.3.0", + "@xchainjs/xchain-util": "^0.13.1" + }, + "dependencies": { + "@cosmjs/stargate": "^0.31.1", + "bech32": "^1.1.3", + "bip32": "^2.0.6", + "secp256k1": "^5.0.0" + } +} diff --git a/packages/xchain-cosmos-sdk/rollup.config.js b/packages/xchain-cosmos-sdk/rollup.config.js new file mode 100644 index 000000000..ef8f15a1e --- /dev/null +++ b/packages/xchain-cosmos-sdk/rollup.config.js @@ -0,0 +1,37 @@ +import commonjs from '@rollup/plugin-commonjs' +import json from '@rollup/plugin-json' +import resolve from '@rollup/plugin-node-resolve' +import external from 'rollup-plugin-peer-deps-external' +import typescript from 'rollup-plugin-typescript2' + +import pkg from './package.json' + +export default { + input: 'src/index.ts', + output: [ + { + file: pkg.main, + format: 'cjs', + exports: 'named', + sourcemap: true, + }, + { + file: pkg.module, + format: 'es', + exports: 'named', + sourcemap: true, + }, + ], + plugins: [ + // ignore(["@ethersproject/providers", "@ethersproject/abstract-provider", "@ethersproject/strings"]), + external(), + resolve({ preferBuiltins: true, browser: true }), + typescript({ + tsconfig: './tsconfig.json', + exclude: '__tests__/**', + }), + commonjs(), + json(), + ], + external: ['buffer', 'http', 'https', 'url', 'stream', 'string_decoder'], +} diff --git a/packages/xchain-cosmos-sdk/src/client.ts b/packages/xchain-cosmos-sdk/src/client.ts new file mode 100644 index 000000000..47cfb276e --- /dev/null +++ b/packages/xchain-cosmos-sdk/src/client.ts @@ -0,0 +1,324 @@ +import { fromBech32 } from '@cosmjs/encoding' +import { DirectSecp256k1HdWallet } from '@cosmjs/proto-signing' +import { GasPrice, IndexedTx, SigningStargateClient, StargateClient, StdFee, calculateFee } from '@cosmjs/stargate' +import { + AssetInfo, + Balance, + BaseXChainClient, + FeeType, + Fees, + Network, + Tx, + TxFrom, + TxHistoryParams, + TxParams, + TxTo, + TxType, + TxsPage, + XChainClient, + XChainClientParams, + singleFee, +} from '@xchainjs/xchain-client' +import * as xchainCrypto from '@xchainjs/xchain-crypto' +import { Address, Asset, BaseAmount, CachedValue, Chain, baseAmount } from '@xchainjs/xchain-util' +import * as bech32 from 'bech32' +import * as BIP32 from 'bip32' +import * as crypto from 'crypto' +import * as secp256k1 from 'secp256k1' + +export type CosmosSdkClientParams = XChainClientParams & { + chain: Chain + clientUrls: Record + prefix: string + defaultDecimals: number + defaultFee: BaseAmount + baseDenom: string +} + +/** + * Cosmos-sdk client + */ +export default abstract class Client extends BaseXChainClient implements XChainClient { + private readonly startgateClient: CachedValue + private readonly clientUrls: Record + private readonly signer: CachedValue | undefined + private readonly prefix: string + private readonly defaultDecimals: number + private readonly defaultFee: BaseAmount + protected readonly baseDenom: string + /** + * Constructor + */ + constructor(params: CosmosSdkClientParams) { + super(params.chain, params) + this.clientUrls = params.clientUrls + this.prefix = params.prefix + this.defaultDecimals = params.defaultDecimals + this.defaultFee = params.defaultFee + this.baseDenom = params.baseDenom + this.signer = new CachedValue( + async () => + await DirectSecp256k1HdWallet.fromMnemonic(params.phrase as string, { prefix: params.prefix || 'cosmos' }), + ) + this.startgateClient = new CachedValue(() => + this.connectClient(this.clientUrls[params.network || Network.Mainnet]), + ) + } + + private async connectClient(clientUrl: string) { + return StargateClient.connect(clientUrl) + } + + /** + * Give 300000uatom return { amount: 300000, denom: uatom } + */ + private splitAmountAndDenom(amountsAndDenoms: string[]) { + const amounAndDenomParsed: { amount: string; denom: string }[] = [] + amountsAndDenoms.forEach((amountAndDenom) => { + const regex = /^(\d+)(\D+)$/ + const match = amountAndDenom.match(regex) + + if (match) { + const amount = match[1] // '3000000' + const denom = match[2] // 'uatom' + amounAndDenomParsed.push({ amount, denom }) + } + }) + return amounAndDenomParsed + } + + private async mapIndexedTxToTx(indexedTx: IndexedTx): Promise { + const mapTo: Map = new Map() + const mapFrom: Map = new Map() + + indexedTx.events.forEach((event) => { + if (event.type === 'transfer') { + const keyAmount = event.attributes.find((atribute) => atribute.key === 'amount') as { + key: string + value: string + } + const keySender = event.attributes.find((atribute) => atribute.key === 'sender') as { + key: string + value: string + } + const keyRecipient = event.attributes.find((atribute) => atribute.key === 'recipient') as { + key: string + value: string + } + try { + const allTokensInEvent = keyAmount.value.split(',') // More than one asset per event (kuji faucet example) + const amounts = this.splitAmountAndDenom(allTokensInEvent) + const nativeAssetAmounts = amounts.filter((amount) => amount.denom === this.baseDenom) // TODO: Temporally discard non native assets + const totalNativeAmount = nativeAssetAmounts.reduce( + // TODO: Diferenciate fee from amount + (acum, amount) => acum.plus(amount.amount), + baseAmount(0, this.defaultDecimals), + ) + // Fill to + if (mapTo.has(keyRecipient.value)) { + const currentTo = mapTo.get(keyRecipient.value) as { amount: BaseAmount; asset: Asset | undefined } + currentTo.amount = currentTo?.amount.plus(totalNativeAmount) + mapTo.set(keyRecipient.value, currentTo) + } else { + const asset = this.assetFromDenom(this.baseDenom) + if (asset) { + mapTo.set(keyRecipient.value, { + amount: totalNativeAmount, + asset, + }) + } + } + // Fill from + if (mapFrom.has(keySender.value)) { + const currentTo = mapFrom.get(keySender.value) as { amount: BaseAmount; asset: Asset | undefined } + currentTo.amount = currentTo?.amount.plus(totalNativeAmount) + mapFrom.set(keySender.value, currentTo) + } else { + const asset = this.assetFromDenom(this.baseDenom) + if (asset) { + mapFrom.set(keySender.value, { + amount: totalNativeAmount, + asset, + }) + } + } + } catch (e) { + console.error('Error:', e) + } + } + }) + + const txTo: TxTo[] = [] + for (const [key, value] of mapTo.entries()) { + const txToObj: TxTo = { + to: key, + amount: value.amount, + asset: value.asset, + } + txTo.push(txToObj) + } + + const txFrom: TxFrom[] = [] + for (const [key, value] of mapFrom.entries()) { + const txFromObj: TxFrom = { + from: key, + amount: value.amount, + asset: value.asset, + } + txFrom.push(txFromObj) + } + + const client = await this.startgateClient.getValue() + const blockData = await client.getBlock(indexedTx.height) + + return { + asset: txFrom[0].asset as Asset, + from: txFrom, + to: txTo, + date: new Date(blockData.header.time), + type: TxType.Transfer, + hash: indexedTx.hash, + } + } + + getFees(): Promise { + return Promise.resolve(singleFee(FeeType.FlatFee, this.defaultFee)) + } + + private hash160(buffer: Uint8Array) { + const sha256Hash: Buffer = crypto.createHash('sha256').update(buffer).digest() + try { + return crypto.createHash('rmd160').update(sha256Hash).digest() + } catch (err) { + return crypto.createHash('ripemd160').update(sha256Hash).digest() + } + } + + public getAddress(walletIndex?: number | undefined): string { + const seed = xchainCrypto.getSeed(this.phrase) + const node = BIP32.fromSeed(seed) + const child = node.derivePath(this.getFullDerivationPath(walletIndex || 0)) + + if (!child.privateKey) throw new Error('child does not have a privateKey') + + // TODO: Make this method async and use CosmosJS official address generation strategy + const pubKey = secp256k1.publicKeyCreate(child.privateKey) + const rawAddress = this.hash160(Uint8Array.from(pubKey)) + const words = bech32.toWords(Buffer.from(rawAddress)) + const address = bech32.encode(this.prefix, words) + return address + } + + public validateAddress(address: string): boolean { + try { + const { prefix: decodedPrefix } = fromBech32(address) + if (decodedPrefix !== this.prefix) { + return false + } + return true + } catch (error) { + return false + } + } + + public async getBalance(address: string, _assets?: Asset[] | undefined): Promise { + const client = await this.startgateClient.getValue() + const result = await client.getAllBalances(address) + // TODO: Filter using assets + const balances: Balance[] = [] + result.forEach((balance) => { + const asset = this.assetFromDenom(balance.denom) + if (asset) { + balances.push({ + asset, + amount: baseAmount(balance.amount, this.defaultDecimals), + }) + } + }) + return balances + } + + public async getTransactions(params?: TxHistoryParams | undefined): Promise { + // TODO: Use all filters + if (params?.startTime || params?.limit || params?.offset) { + throw Error('Not supported param limit for this client') + } + + const client = await this.startgateClient.getValue() + + const indexedTxsSender = await client.searchTx([ + // TODO: Unify in one filter + { + key: 'message.sender', + value: params?.address as string, + }, + ]) + + const indexedTxsReceipent = await client.searchTx([ + // TODO: Unify in one filter + { + key: 'transfer.recipient', + value: params?.address as string, + }, + ]) + + const indexedTxs = [...indexedTxsReceipent, ...indexedTxsSender] + const promisesTxs = indexedTxs.map((indexedTx) => this.mapIndexedTxToTx(indexedTx)) + const txs = await Promise.all(promisesTxs) + return { + total: indexedTxs.length, + txs, + } + } + + public async getTransactionData(txId: string, _assetAddress?: string | undefined): Promise { + const client = await this.startgateClient.getValue() + const tx = await client.getTx(txId) + if (!tx) { + throw Error(`Can not find transaction ${txId}`) + } + return this.mapIndexedTxToTx(tx) + } + + public async transfer(params: TxParams): Promise { + if (!this.signer) { + throw Error('Invalid signer') + } + + const denom = this.getDenom(params.asset || this.getAssetInfo().asset) + + if (!denom) { + throw Error( + `Invalid asset ${params.asset?.symbol} - Only ${this.baseDenom} asset is currently supported to transfer`, + ) + } + + const signer = await this.signer.getValue() + const signingClient = await SigningStargateClient.connectWithSigner(this.clientUrls[this.network], signer) + const address = await this.getAddress() + const amount = { amount: params.amount.amount().toString(), denom } + + // TODO: Support fee configuration (subsided fee) + const defaultGasPrice = GasPrice.fromString(`0.025${denom}`) + const defaultSendFee: StdFee = calculateFee(90_000, defaultGasPrice) + + const tx = await signingClient.sendTokens(address, params.recipient, [amount], defaultSendFee, params.memo) + + return tx.transactionHash + } + + public async broadcastTx(txHex: string): Promise { + const client = await this.startgateClient.getValue() + const txResponse = await client.broadcastTx(new Uint8Array(Buffer.from(txHex, 'hex'))) + return txResponse.transactionHash + } + + abstract getAssetInfo(): AssetInfo + abstract getExplorerUrl(): string + abstract getExplorerAddressUrl(_address: string): string + abstract getExplorerTxUrl(txID: string): string + abstract assetFromDenom(denom: string): Asset | null + abstract getDenom(asset: Asset): string | null +} + +export { Client } diff --git a/packages/xchain-cosmos-sdk/src/index.ts b/packages/xchain-cosmos-sdk/src/index.ts new file mode 100644 index 000000000..83dae7638 --- /dev/null +++ b/packages/xchain-cosmos-sdk/src/index.ts @@ -0,0 +1 @@ +export * from './client' diff --git a/packages/xchain-cosmos-sdk/tsconfig.json b/packages/xchain-cosmos-sdk/tsconfig.json new file mode 100644 index 000000000..be9253369 --- /dev/null +++ b/packages/xchain-cosmos-sdk/tsconfig.json @@ -0,0 +1,4 @@ +{ + "extends": "../../tsconfig.json", + "include": [ "src/**/*"] +} diff --git a/packages/xchain-util/CHANGELOG.md b/packages/xchain-util/CHANGELOG.md index de68a4dae..70c804686 100755 --- a/packages/xchain-util/CHANGELOG.md +++ b/packages/xchain-util/CHANGELOG.md @@ -1,3 +1,9 @@ +# v0.13.2 (2023-09-23) + +## Update + +- Support no expirity time on cached-value class + # v0.13.1 (2023-09-03) ## Update diff --git a/packages/xchain-util/package.json b/packages/xchain-util/package.json index b1cf9ccbf..f12df51bf 100755 --- a/packages/xchain-util/package.json +++ b/packages/xchain-util/package.json @@ -1,6 +1,6 @@ { "name": "@xchainjs/xchain-util", - "version": "0.13.1", + "version": "0.13.2", "description": "Helper utilities for XChain clients", "keywords": [ "THORChain", diff --git a/packages/xchain-util/src/cached-value.ts b/packages/xchain-util/src/cached-value.ts index 00b8459b6..c5e458333 100644 --- a/packages/xchain-util/src/cached-value.ts +++ b/packages/xchain-util/src/cached-value.ts @@ -6,8 +6,8 @@ export class CachedValue { private refreshData: (params?: any) => Promise private refreshPromise: Promise | null = null - constructor(refreshData: (params?: any) => Promise, cacheMaxAge: number) { - this.cacheMaxAge = cacheMaxAge + constructor(refreshData: (params?: any) => Promise, cacheMaxAge?: number) { + this.cacheMaxAge = cacheMaxAge || Infinity this.refreshData = refreshData } @@ -15,7 +15,7 @@ export class CachedValue { return Boolean(this.cacheTimestamp && new Date().getTime() - this.cacheTimestamp.getTime() < this.cacheMaxAge) } - async getValue(params?: any) { + async getValue(params?: any): Promise { if (this.isCacheValid()) { return this.cachedValue as T } diff --git a/yarn.lock b/yarn.lock index a3b3c9532..1b0a5954c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -352,6 +352,130 @@ optionalDependencies: "@ledgerhq/hw-transport-node-hid" "^5.10.0" +"@confio/ics23@^0.6.8": + version "0.6.8" + resolved "https://registry.yarnpkg.com/@confio/ics23/-/ics23-0.6.8.tgz#2a6b4f1f2b7b20a35d9a0745bb5a446e72930b3d" + integrity sha512-wB6uo+3A50m0sW/EWcU64xpV/8wShZ6bMTa7pF8eYsTrSkQA7oLUIJcs/wb8g4y2Oyq701BaGiO6n/ak5WXO1w== + dependencies: + "@noble/hashes" "^1.0.0" + protobufjs "^6.8.8" + +"@cosmjs/amino@^0.31.1": + version "0.31.1" + resolved "https://registry.yarnpkg.com/@cosmjs/amino/-/amino-0.31.1.tgz#e6b4adc3ebe19ddfd953c67ee04b1eae488238af" + integrity sha512-kkB9IAkNEUFtjp/uwHv95TgM8VGJ4VWfZwrTyLNqBDD1EpSX2dsNrmUe7k8OMPzKlZUFcKmD4iA0qGvIwzjbGA== + dependencies: + "@cosmjs/crypto" "^0.31.1" + "@cosmjs/encoding" "^0.31.1" + "@cosmjs/math" "^0.31.1" + "@cosmjs/utils" "^0.31.1" + +"@cosmjs/crypto@^0.31.1": + version "0.31.1" + resolved "https://registry.yarnpkg.com/@cosmjs/crypto/-/crypto-0.31.1.tgz#ce4917df0f7b38f0909a32020907ccff04acefe6" + integrity sha512-4R/SqdzdVzd4E5dpyEh1IKm5GbTqwDogutyIyyb1bcOXiX/x3CrvPI9Tb4WSIMDLvlb5TVzu2YnUV51Q1+6mMA== + dependencies: + "@cosmjs/encoding" "^0.31.1" + "@cosmjs/math" "^0.31.1" + "@cosmjs/utils" "^0.31.1" + "@noble/hashes" "^1" + bn.js "^5.2.0" + elliptic "^6.5.4" + libsodium-wrappers-sumo "^0.7.11" + +"@cosmjs/encoding@^0.31.1": + version "0.31.1" + resolved "https://registry.yarnpkg.com/@cosmjs/encoding/-/encoding-0.31.1.tgz#0041b2650c443d883e22f27c7d3cd7b844c6d0ec" + integrity sha512-IuxP6ewwX6vg9sUJ8ocJD92pkerI4lyG8J5ynAM3NaX3q+n+uMoPRSQXNeL9bnlrv01FF1kIm8if/f5F7ZPtkA== + dependencies: + base64-js "^1.3.0" + bech32 "^1.1.4" + readonly-date "^1.0.0" + +"@cosmjs/json-rpc@^0.31.1": + version "0.31.1" + resolved "https://registry.yarnpkg.com/@cosmjs/json-rpc/-/json-rpc-0.31.1.tgz#54d1064adb3ebd0412b04f87a3c2029384e4cb5e" + integrity sha512-gIkCj2mUDHAxvmJnHtybXtMLZDeXrkDZlujjzhvJlWsIuj1kpZbKtYqh+eNlfwhMkMMAlQa/y4422jDmizW+ng== + dependencies: + "@cosmjs/stream" "^0.31.1" + xstream "^11.14.0" + +"@cosmjs/math@^0.31.1": + version "0.31.1" + resolved "https://registry.yarnpkg.com/@cosmjs/math/-/math-0.31.1.tgz#74c02cf237c2996b77661b636b014168b18d95e6" + integrity sha512-kiuHV6m6DSB8/4UV1qpFhlc4ul8SgLXTGRlYkYiIIP4l0YNeJ+OpPYaOlEgx4Unk2mW3/O2FWYj7Jc93+BWXng== + dependencies: + bn.js "^5.2.0" + +"@cosmjs/proto-signing@^0.31.1": + version "0.31.1" + resolved "https://registry.yarnpkg.com/@cosmjs/proto-signing/-/proto-signing-0.31.1.tgz#3929d5bee3c88c42b3bc3c4b9db4ab3bddb684c4" + integrity sha512-hipbBVrssPu+jnmRzQRP5hhS/mbz2nU7RvxG/B1ZcdNhr1AtZC5DN09OTUoEpMSRgyQvScXmk/NTbyf+xmCgYg== + dependencies: + "@cosmjs/amino" "^0.31.1" + "@cosmjs/crypto" "^0.31.1" + "@cosmjs/encoding" "^0.31.1" + "@cosmjs/math" "^0.31.1" + "@cosmjs/utils" "^0.31.1" + cosmjs-types "^0.8.0" + long "^4.0.0" + +"@cosmjs/socket@^0.31.1": + version "0.31.1" + resolved "https://registry.yarnpkg.com/@cosmjs/socket/-/socket-0.31.1.tgz#887d4e9b6aad4b3d264d64a47bdb40bcfa9802ff" + integrity sha512-XTtEr+x3WGbqkzoGX0sCkwVqf5n+bBqDwqNgb+DWaBABQxHVRuuainrTVp0Yc91D3Iy2twLQzeBA9OrRxDSerw== + dependencies: + "@cosmjs/stream" "^0.31.1" + isomorphic-ws "^4.0.1" + ws "^7" + xstream "^11.14.0" + +"@cosmjs/stargate@^0.31.1": + version "0.31.1" + resolved "https://registry.yarnpkg.com/@cosmjs/stargate/-/stargate-0.31.1.tgz#7e2b0fd6f181250915b1d73ecf9dfbab6f3cdd0d" + integrity sha512-TqOJZYOH5W3sZIjR6949GfjhGXO3kSHQ3/KmE+SuKyMMmQ5fFZ45beawiRtVF0/CJg5RyPFyFGJKhb1Xxv3Lcg== + dependencies: + "@confio/ics23" "^0.6.8" + "@cosmjs/amino" "^0.31.1" + "@cosmjs/encoding" "^0.31.1" + "@cosmjs/math" "^0.31.1" + "@cosmjs/proto-signing" "^0.31.1" + "@cosmjs/stream" "^0.31.1" + "@cosmjs/tendermint-rpc" "^0.31.1" + "@cosmjs/utils" "^0.31.1" + cosmjs-types "^0.8.0" + long "^4.0.0" + protobufjs "~6.11.3" + xstream "^11.14.0" + +"@cosmjs/stream@^0.31.1": + version "0.31.1" + resolved "https://registry.yarnpkg.com/@cosmjs/stream/-/stream-0.31.1.tgz#01bab56278bfe32cd601043949fcdc021a5f7ca7" + integrity sha512-xsIGD9bpBvYYZASajCyOevh1H5pDdbOWmvb4UwGZ78doGVz3IC3Kb9BZKJHIX2fjq9CMdGVJHmlM+Zp5aM8yZA== + dependencies: + xstream "^11.14.0" + +"@cosmjs/tendermint-rpc@^0.31.1": + version "0.31.1" + resolved "https://registry.yarnpkg.com/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.31.1.tgz#0699c6046fc8afd1eee3c648cfb3b896119ce52e" + integrity sha512-KX+wwi725sSePqIxfMPPOqg+xTETV8BHGOBhRhCZXEl5Fq48UlXXq3/yG1sn7K67ADC0kqHqcCF41Wn1GxNNPA== + dependencies: + "@cosmjs/crypto" "^0.31.1" + "@cosmjs/encoding" "^0.31.1" + "@cosmjs/json-rpc" "^0.31.1" + "@cosmjs/math" "^0.31.1" + "@cosmjs/socket" "^0.31.1" + "@cosmjs/stream" "^0.31.1" + "@cosmjs/utils" "^0.31.1" + axios "^0.21.2" + readonly-date "^1.0.0" + xstream "^11.14.0" + +"@cosmjs/utils@^0.31.1": + version "0.31.1" + resolved "https://registry.yarnpkg.com/@cosmjs/utils/-/utils-0.31.1.tgz#e6055cd7d722fa72df9cbd0d39cd1f7a9ac80483" + integrity sha512-n4Se1wu4GnKwztQHNFfJvUeWcpvx3o8cWhSbNs9JQShEuB3nv3R5lqFBtDCgHZF/emFQAP+ZjF8bTfCs9UBGhA== + "@cosmos-client/core@0.46.1": version "0.46.1" resolved "https://registry.yarnpkg.com/@cosmos-client/core/-/core-0.46.1.tgz#63738da4c6506c6606f9ae23be7b6e2545d51418" @@ -1256,6 +1380,11 @@ path-to-regexp "3.2.0" tslib "2.5.0" +"@noble/hashes@^1", "@noble/hashes@^1.0.0": + version "1.3.2" + resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.3.2.tgz#6f26dbc8fbc7205873ce3cee2f690eba0d421b39" + integrity sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ== + "@noble/hashes@^1.2.0": version "1.3.0" resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.3.0.tgz#085fd70f6d7d9d109671090ccae1d3bec62554a1" @@ -2172,6 +2301,13 @@ "@types/node" "*" rollup "^0.63.4" +"@types/secp256k1@^4.0.3": + version "4.0.3" + resolved "https://registry.yarnpkg.com/@types/secp256k1/-/secp256k1-4.0.3.tgz#1b8e55d8e00f08ee7220b4d59a6abe89c37a901c" + integrity sha512-Da66lEIFeIz9ltsdMZcpQvmrmmoqrfju8pm1BH8WbYjZSwUgCwXLb9C+9XYogwBITnbsSaMdVPb2ekf7TV+03w== + dependencies: + "@types/node" "*" + "@types/semver@^7.3.12": version "7.3.13" resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.3.13.tgz#da4bfd73f49bd541d28920ab0e2bf0ee80f71c91" @@ -2609,6 +2745,13 @@ axios@^0.19.0: dependencies: follow-redirects "1.5.10" +axios@^0.21.2: + version "0.21.4" + resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.4.tgz#c67b90dc0568e5c1cf2b0b858c43ba28e2eda575" + integrity sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg== + dependencies: + follow-redirects "^1.14.0" + axios@^0.23.0: version "0.23.0" resolved "https://registry.yarnpkg.com/axios/-/axios-0.23.0.tgz#b0fa5d0948a8d1d75e3d5635238b6c4625b05149" @@ -2707,7 +2850,7 @@ base-x@^4.0.0: resolved "https://registry.yarnpkg.com/base-x/-/base-x-4.0.0.tgz#d0e3b7753450c73f8ad2389b5c018a4af7b2224a" integrity sha512-FuwxlW4H5kh37X/oW59pwTzzTKRzfrrQwhmyspRM7swOEZcHtDZSCt45U6oKgtuFE+WYPblePMVIPR4RZrh/hw== -base64-js@^1.3.1: +base64-js@^1.3.0, base64-js@^1.3.1: version "1.5.1" resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== @@ -3602,6 +3745,14 @@ cosmiconfig@7.0.0: path-type "^4.0.0" yaml "^1.10.0" +cosmjs-types@^0.8.0: + version "0.8.0" + resolved "https://registry.yarnpkg.com/cosmjs-types/-/cosmjs-types-0.8.0.tgz#2ed78f3e990f770229726f95f3ef5bf9e2b6859b" + integrity sha512-Q2Mj95Fl0PYMWEhA2LuGEIhipF7mQwd9gTQ85DdP9jjjopeoGaDxvmPa5nakNzsq7FnO1DMTatXTAx6bxMH7Lg== + dependencies: + long "^4.0.0" + protobufjs "~6.11.2" + create-ecdh@^4.0.0: version "4.0.4" resolved "https://registry.yarnpkg.com/create-ecdh/-/create-ecdh-4.0.4.tgz#d6e7f4bffa66736085a0762fd3a632684dabcc4e" @@ -3755,11 +3906,29 @@ defaults@^1.0.3: dependencies: clone "^1.0.2" +define-data-property@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/define-data-property/-/define-data-property-1.1.0.tgz#0db13540704e1d8d479a0656cf781267531b9451" + integrity sha512-UzGwzcjyv3OtAvolTj1GoyNYzfFR+iqbGjcnBEENZVCpM4/Ng1yhGNvS3lR/xDS74Tb2wGG9WzNSNIOS9UVb2g== + dependencies: + get-intrinsic "^1.2.1" + gopd "^1.0.1" + has-property-descriptors "^1.0.0" + define-lazy-prop@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz#3f7ae421129bcaaac9bc74905c98a0009ec9ee7f" integrity sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og== +define-properties@^1.1.3: + version "1.2.1" + resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.2.1.tgz#10781cc616eb951a80a034bafcaa7377f6af2b6c" + integrity sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg== + dependencies: + define-data-property "^1.0.1" + has-property-descriptors "^1.0.0" + object-keys "^1.1.1" + del@^6.0.0: version "6.1.1" resolved "https://registry.yarnpkg.com/del/-/del-6.1.1.tgz#3b70314f1ec0aa325c6b14eb36b95786671edb7a" @@ -4456,6 +4625,11 @@ follow-redirects@1.5.10: dependencies: debug "=3.1.0" +follow-redirects@^1.14.0: + version "1.15.3" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.3.tgz#fe2f3ef2690afce7e82ed0b44db08165b207123a" + integrity sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q== + follow-redirects@^1.14.4, follow-redirects@^1.14.9, follow-redirects@^1.15.0: version "1.15.2" resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13" @@ -4608,6 +4782,16 @@ get-caller-file@^2.0.5: resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== +get-intrinsic@^1.1.1, get-intrinsic@^1.1.3, get-intrinsic@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.2.1.tgz#d295644fed4505fc9cde952c37ee12b477a83d82" + integrity sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw== + dependencies: + function-bind "^1.1.1" + has "^1.0.3" + has-proto "^1.0.1" + has-symbols "^1.0.3" + get-package-type@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/get-package-type/-/get-package-type-0.1.0.tgz#8de2d803cff44df3bc6c456e6668b36c3926e11a" @@ -4786,6 +4970,13 @@ globals@^13.19.0: dependencies: type-fest "^0.20.2" +globalthis@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/globalthis/-/globalthis-1.0.3.tgz#5852882a52b80dc301b0660273e1ed082f0b6ccf" + integrity sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA== + dependencies: + define-properties "^1.1.3" + globby@11.1.0, globby@^11.0.1, globby@^11.1.0: version "11.1.0" resolved "https://registry.yarnpkg.com/globby/-/globby-11.1.0.tgz#bd4be98bb042f83d796f7e3811991fbe82a0d34b" @@ -4798,6 +4989,13 @@ globby@11.1.0, globby@^11.0.1, globby@^11.1.0: merge2 "^1.4.1" slash "^3.0.0" +gopd@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/gopd/-/gopd-1.0.1.tgz#29ff76de69dac7489b7c0918a5788e56477c332c" + integrity sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA== + dependencies: + get-intrinsic "^1.1.3" + graceful-fs@4.2.10: version "4.2.10" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c" @@ -4840,6 +5038,23 @@ has-flag@^4.0.0: resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== +has-property-descriptors@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz#610708600606d36961ed04c196193b6a607fa861" + integrity sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ== + dependencies: + get-intrinsic "^1.1.1" + +has-proto@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/has-proto/-/has-proto-1.0.1.tgz#1885c1305538958aff469fef37937c22795408e0" + integrity sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg== + +has-symbols@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.3.tgz#bb7b2c4349251dce87b125f7bdf874aa7c8b39f8" + integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A== + has-unicode@2.0.1, has-unicode@^2.0.0, has-unicode@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" @@ -5317,6 +5532,11 @@ isobject@^3.0.1: resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" integrity sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg== +isomorphic-ws@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz#55fd4cd6c5e6491e76dc125938dd863f5cd4f2dc" + integrity sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w== + istanbul-lib-coverage@^3.0.0, istanbul-lib-coverage@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz#189e7909d0a39fa5a3dfad5b03f71947770191d3" @@ -5989,6 +6209,18 @@ libnpmpublish@6.0.4: semver "^7.3.7" ssri "^9.0.0" +libsodium-sumo@^0.7.13: + version "0.7.13" + resolved "https://registry.yarnpkg.com/libsodium-sumo/-/libsodium-sumo-0.7.13.tgz#533b97d2be44b1277e59c1f9f60805978ac5542d" + integrity sha512-zTGdLu4b9zSNLfovImpBCbdAA4xkpkZbMnSQjP8HShyOutnGjRHmSOKlsylh1okao6QhLiz7nG98EGn+04cZjQ== + +libsodium-wrappers-sumo@^0.7.11: + version "0.7.13" + resolved "https://registry.yarnpkg.com/libsodium-wrappers-sumo/-/libsodium-wrappers-sumo-0.7.13.tgz#a33aea845a0bb56db067548f04feba28c730ab8e" + integrity sha512-lz4YdplzDRh6AhnLGF2Dj2IUj94xRN6Bh8T0HLNwzYGwPehQJX6c7iYVrFUPZ3QqxE0bqC+K0IIqqZJYWumwSQ== + dependencies: + libsodium-sumo "^0.7.13" + lilconfig@2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/lilconfig/-/lilconfig-2.1.0.tgz#78e23ac89ebb7e1bfbf25b18043de756548e7f52" @@ -6605,6 +6837,11 @@ node-addon-api@^4.2.0: resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-4.3.0.tgz#52a1a0b475193e0928e98e0426a0d1254782b77f" integrity sha512-73sE9+3UaLYYFmDsFZnqCInzPyh3MqIwZO9cw58yIqAZhONrrabrYyYe3TuIqtIiOuTXVhsGau8hcrhhwSsDIQ== +node-addon-api@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-5.1.0.tgz#49da1ca055e109a23d537e9de43c09cca21eb762" + integrity sha512-eh0GgfEkpnoWDq+VY8OyvYhFEzBk6jIYbRKdIlyTiAXIVJ8PyBaKb0rp7oDtoddbdoHWhq8wwr+XZ81F1rpNdA== + node-fetch@2.6.7: version "2.6.7" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad" @@ -6998,6 +7235,11 @@ object-inspect@^1.12.3: resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.3.tgz#ba62dffd67ee256c8c086dfae69e016cd1f198b9" integrity sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g== +object-keys@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" + integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== + once@^1.3.0, once@^1.3.1, once@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" @@ -7543,6 +7785,25 @@ protobufjs@^6.11.2: "@types/node" ">=13.7.0" long "^4.0.0" +protobufjs@^6.8.8, protobufjs@~6.11.2, protobufjs@~6.11.3: + version "6.11.4" + resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-6.11.4.tgz#29a412c38bf70d89e537b6d02d904a6f448173aa" + integrity sha512-5kQWPaJHi1WoCpjTGszzQ32PG2F4+wRY6BmAT4Vfw56Q2FZ4YZzK20xUYQH4YkfehY1e6QSICrJquM6xXZNcrw== + dependencies: + "@protobufjs/aspromise" "^1.1.2" + "@protobufjs/base64" "^1.1.2" + "@protobufjs/codegen" "^2.0.4" + "@protobufjs/eventemitter" "^1.1.0" + "@protobufjs/fetch" "^1.1.0" + "@protobufjs/float" "^1.0.2" + "@protobufjs/inquire" "^1.1.0" + "@protobufjs/path" "^1.1.2" + "@protobufjs/pool" "^1.1.0" + "@protobufjs/utf8" "^1.1.0" + "@types/long" "^4.0.1" + "@types/node" ">=13.7.0" + long "^4.0.0" + protocol-buffers-encodings@^1.1.0: version "1.2.0" resolved "https://registry.yarnpkg.com/protocol-buffers-encodings/-/protocol-buffers-encodings-1.2.0.tgz#39900b85dcff3172a23f15bdf3fda70daa2b38d3" @@ -7799,6 +8060,11 @@ readable-stream@^4.1.0: events "^3.3.0" process "^0.11.10" +readonly-date@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/readonly-date/-/readonly-date-1.0.0.tgz#5af785464d8c7d7c40b9d738cbde8c646f97dcd9" + integrity sha512-tMKIV7hlk0h4mO3JTmmVuIlJVXjKk3Sep9Bf5OH0O+758ruuVkUy2J9SttDLm91IEX/WHlXPSpxMGjPj4beMIQ== + redent@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/redent/-/redent-3.0.0.tgz#e557b7998316bb53c9f1f56fa626352c6963059f" @@ -7998,6 +8264,15 @@ secp256k1@^4.0.0, secp256k1@^4.0.2: node-addon-api "^2.0.0" node-gyp-build "^4.2.0" +secp256k1@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/secp256k1/-/secp256k1-5.0.0.tgz#be6f0c8c7722e2481e9773336d351de8cddd12f7" + integrity sha512-TKWX8xvoGHrxVdqbYeZM9w+izTF4b9z3NhSaDkdn81btvuh+ivbIMGT/zQvDtTFWhRlThpoz6LEYTr7n8A5GcA== + dependencies: + elliptic "^6.5.4" + node-addon-api "^5.0.0" + node-gyp-build "^4.2.0" + secure-random@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/secure-random/-/secure-random-1.1.2.tgz#ed103b460a851632d420d46448b2a900a41e7f7c" @@ -8422,6 +8697,11 @@ supports-preserve-symlinks-flag@^1.0.0: resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== +symbol-observable@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-2.0.3.tgz#5b521d3d07a43c351055fa43b8355b62d33fd16a" + integrity sha512-sQV7phh2WCYAn81oAkakC5qjq2Ml0g8ozqz03wOGnx9dDlG1de6yrF+0RAzSJD8fPUow3PTSMf2SAbOGxb93BA== + tar-fs@^2.0.0: version "2.1.1" resolved "https://registry.yarnpkg.com/tar-fs/-/tar-fs-2.1.1.tgz#489a15ab85f1f0befabb370b7de4f9eb5cbe8784" @@ -9087,6 +9367,19 @@ ws@^3.2.0: safe-buffer "~5.1.0" ultron "~1.1.0" +ws@^7: + version "7.5.9" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.9.tgz#54fa7db29f4c7cec68b1ddd3a89de099942bb591" + integrity sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q== + +xstream@^11.14.0: + version "11.14.0" + resolved "https://registry.yarnpkg.com/xstream/-/xstream-11.14.0.tgz#2c071d26b18310523b6877e86b4e54df068a9ae5" + integrity sha512-1bLb+kKKtKPbgTK6i/BaoAn03g47PpFstlbe1BA+y3pNS/LfvcaghS5BFf9+EE1J+KwSQsEpfJvFN5GqFtiNmw== + dependencies: + globalthis "^1.0.1" + symbol-observable "^2.0.3" + xtend@^4.0.0, xtend@~4.0.1: version "4.0.2" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54"