From 76ee01a0390082901e05d1be16af2d15e4107692 Mon Sep 17 00:00:00 2001 From: Pislariu Alexandru Date: Mon, 21 Jun 2021 12:05:52 +0300 Subject: [PATCH 001/127] Integrate Elrond in Ledger families --- src/families/elrond/account.js | 50 +++++ src/families/elrond/api/apiCalls.js | 157 ++++++++++++++ src/families/elrond/api/index.js | 8 + src/families/elrond/api/sdk.js | 141 ++++++++++++ src/families/elrond/bridge/js.js | 38 ++++ src/families/elrond/cli-transaction.js | 36 ++++ src/families/elrond/constants.js | 9 + src/families/elrond/errors.js | 9 + src/families/elrond/hw-app-elrond/index.js | 200 ++++++++++++++++++ src/families/elrond/hw-getAddress.js | 14 ++ src/families/elrond/js-broadcast.js | 25 +++ src/families/elrond/js-buildTransaction.js | 37 ++++ .../elrond/js-estimateMaxSpendable.js | 38 ++++ .../elrond/js-getFeesForTransaction.js | 30 +++ .../elrond/js-getTransactionStatus.js | 57 +++++ src/families/elrond/js-signOperation.js | 115 ++++++++++ src/families/elrond/js-synchronisation.js | 37 ++++ src/families/elrond/js-transaction.js | 55 +++++ src/families/elrond/logic.js | 71 +++++++ src/families/elrond/preload.js | 66 ++++++ src/families/elrond/serialization.js | 16 ++ src/families/elrond/test-dataset.js | 58 +++++ src/families/elrond/transaction.js | 53 +++++ src/families/elrond/types.js | 65 ++++++ src/generated/account.js | 2 + src/generated/bridge/js.js | 2 + src/generated/cli-transaction.js | 2 + src/generated/hw-getAddress.js | 2 + src/generated/test-dataset.js | 2 + src/generated/transaction.js | 2 + src/generated/types.js | 18 ++ 31 files changed, 1415 insertions(+) create mode 100644 src/families/elrond/account.js create mode 100644 src/families/elrond/api/apiCalls.js create mode 100644 src/families/elrond/api/index.js create mode 100644 src/families/elrond/api/sdk.js create mode 100644 src/families/elrond/bridge/js.js create mode 100644 src/families/elrond/cli-transaction.js create mode 100644 src/families/elrond/constants.js create mode 100644 src/families/elrond/errors.js create mode 100644 src/families/elrond/hw-app-elrond/index.js create mode 100644 src/families/elrond/hw-getAddress.js create mode 100644 src/families/elrond/js-broadcast.js create mode 100644 src/families/elrond/js-buildTransaction.js create mode 100644 src/families/elrond/js-estimateMaxSpendable.js create mode 100644 src/families/elrond/js-getFeesForTransaction.js create mode 100644 src/families/elrond/js-getTransactionStatus.js create mode 100644 src/families/elrond/js-signOperation.js create mode 100644 src/families/elrond/js-synchronisation.js create mode 100644 src/families/elrond/js-transaction.js create mode 100644 src/families/elrond/logic.js create mode 100644 src/families/elrond/preload.js create mode 100644 src/families/elrond/serialization.js create mode 100644 src/families/elrond/test-dataset.js create mode 100644 src/families/elrond/transaction.js create mode 100644 src/families/elrond/types.js diff --git a/src/families/elrond/account.js b/src/families/elrond/account.js new file mode 100644 index 0000000000..d6acb6b095 --- /dev/null +++ b/src/families/elrond/account.js @@ -0,0 +1,50 @@ +// @flow +import invariant from "invariant"; +import { BigNumber } from "bignumber.js"; +import type { Account, Operation, Unit } from "../../types"; +import { getAccountUnit } from "../../account"; +import { formatCurrencyUnit } from "../../currencies"; + +function formatAccountSpecifics(account: Account): string { + const { elrondResources } = account; + invariant(elrondResources, "elrond account expected"); + const unit = getAccountUnit(account); + const formatConfig = { + disableRounding: true, + alwaysShowSign: false, + showCode: true, + }; + + let str = " "; + + if (account.spendableBalance) { + str += + formatCurrencyUnit(unit, account.spendableBalance, formatConfig) + + " spendable. "; + } else { + str += " 0 spendable."; + } + + if (elrondResources.nonce) { + str += "\nonce : " + elrondResources.nonce; + } + + return str; +} + +function formatOperationSpecifics(op: Operation, unit: ?Unit): string { + let str = " "; + + const formatConfig = { + disableRounding: true, + alwaysShowSign: false, + showCode: true, + }; + + return str; +} + +export default { + formatAccountSpecifics, + formatOperationSpecifics, +}; diff --git a/src/families/elrond/api/apiCalls.js b/src/families/elrond/api/apiCalls.js new file mode 100644 index 0000000000..d74fa549dc --- /dev/null +++ b/src/families/elrond/api/apiCalls.js @@ -0,0 +1,157 @@ +import network from "../../../network"; +import { HASH_TRANSACTION, RAW_TRANSACTION } from "../constants"; + +export default class ElrondApi { + constructor(API_URL: String) { + this.API_URL = API_URL; + } + + async getBalance(addr: String) { + const { + data: { balance }, + } = await network({ + method: "GET", + url: `${this.API_URL}/accounts/${addr}`, + }); + + return balance; + } + + async getNonce(addr: String) { + const { + data: { nonce }, + } = await network({ + method: "GET", + url: `${this.API_URL}/accounts/${addr}`, + }); + + return nonce; + } + + async getValidators() { + let data = []; + try { + let { + data: { validators }, + } = await network({ + method: "GET", + url: `${this.API_URL}/validator/statistics`, + }); + data = validators; + } catch (error) { + return data; + } + + return data; + } + + async getNetworkConfig() { + const { + data: { + data: { + config: { + erd_chain_id: chainId, + erd_denomination: denomination, + erd_min_gas_limit: gasLimit, + erd_min_gas_price: gasPrice, + }, + }, + }, + } = await network({ + method: "GET", + url: `${this.API_URL}/network/config`, + }); + + return { chainId, denomination, gasLimit, gasPrice }; + } + + async submit({ operation, signature, signUsingHash }) { + const { chainId, gasLimit, gasPrice } = await this.getNetworkConfig(); + + const transactionType = signUsingHash ? HASH_TRANSACTION : RAW_TRANSACTION; + + const { + senders: [sender], + recipients: [receiver], + value, + } = operation; + + const nonce = await this.getNonce(sender); + + const { + data: { + data: { txHash: hash }, + }, + } = await network({ + method: "POST", + url: `${this.API_URL}/transaction/send`, + data: { + nonce, + value, + receiver, + sender, + gasPrice, + gasLimit, + chainID: chainId, + signature, + ...transactionType, + }, + }); + + return { hash }; + } + + async getHistory(addr: string) { + const { data: transactions } = await network({ + method: "GET", + url: `${this.API_URL}/transactions?condition=should&sender=${addr}&receiver=${addr}`, + }); + + if (!transactions.length) return transactions; //Account does not have any transactions + + return Promise.all( + transactions.map(async (transaction) => { + const { blockHeight, blockHash } = await this.getConfirmedTransaction( + transaction.txHash + ); + + return { ...transaction, blockHash, blockHeight }; + }) + ); + } + + async getBlockchainBlockHeight() { + const { data: transactions } = await network({ + method: "GET", + url: `${this.API_URL}/transactions`, + }); + + let blockHeight; + let index = 0; + while (!blockHeight) { + const confirmedTransaction = await this.getConfirmedTransaction( + transactions[index].txHash + ); + blockHeight = confirmedTransaction.blockHeight; + + index++; + } + + return blockHeight; + } + + async getConfirmedTransaction(txHash: string) { + const { + data: { + data: { + transaction: { hyperblockNonce, blockHash }, + }, + }, + } = await network({ + method: "GET", + url: `${this.API_URL}/transaction/${txHash}`, + }); + + return { blockHeight: hyperblockNonce, blockHash }; + } +} diff --git a/src/families/elrond/api/index.js b/src/families/elrond/api/index.js new file mode 100644 index 0000000000..add27d8be8 --- /dev/null +++ b/src/families/elrond/api/index.js @@ -0,0 +1,8 @@ +export { + getAccount, + getNetworkConfig, + getValidators, + getOperations, + getFees, + submit, +} from "./sdk"; diff --git a/src/families/elrond/api/sdk.js b/src/families/elrond/api/sdk.js new file mode 100644 index 0000000000..c6d26ced81 --- /dev/null +++ b/src/families/elrond/api/sdk.js @@ -0,0 +1,141 @@ +// @flow + +import { BigNumber } from "bignumber.js"; +import ElrondApi from "./apiCalls"; +import type { Transaction } from "../types"; +import type { Operation, OperationType } from "../../../types"; +import { getEnv } from "../../../env"; +import { encodeOperationId } from "../../../operation"; + +const ELROND_API_ENDPOINT = () => getEnv("ELROND_API_ENDPOINT"); + +let api = new ElrondApi(ELROND_API_ENDPOINT()); + +/** + * Get account balances and nonce + */ +export const getAccount = async (addr: string) => { + const balance = await api.getBalance(addr); + const nonce = await api.getNonce(addr); + const blockHeight = await api.getBlockchainBlockHeight(); + + return { + blockHeight, + balance: new BigNumber(balance), + nonce, + }; +}; + +export const getValidators = async () => { + const validators = await api.getValidators(); + return { validators }; +}; + +export const getNetworkConfig = async () => { + const { + chainId, + gasPrice, + gasLimit, + denomination, + } = await api.getNetworkConfig(); + + return { chainId, gasPrice, gasLimit, denomination }; +}; + +/** + * Returns true if account is the signer + */ +function isSender(transaction: Transaction, addr: string): boolean { + return transaction.sender === addr; +} + +/** + * Map transaction to an Operation Type + */ +function getOperationType( + transaction: Transaction, + addr: string +): OperationType { + return isSender(transaction, addr) ? "OUT" : "IN"; +} + +/** + * Map transaction to a correct Operation Value (affecting account balance) + */ +function getOperationValue(transaction: Transaction, addr: string): BigNumber { + return isSender(transaction, addr) + ? BigNumber(transaction.value).plus(transaction.fee) + : BigNumber(transaction.value); +} + +/** + * Map the Elrond history transaction to a Ledger Live Operation + */ +function transactionToOperation( + accountId: string, + addr: string, + transaction: Transaction +): Operation { + const type = getOperationType(transaction, addr); + + return { + id: encodeOperationId(accountId, transaction.txHash, type), + accountId, + fee: BigNumber(transaction.fee || 0), + value: getOperationValue(transaction, addr), + type, + hash: transaction.txHash, + blockHash: transaction.blockHash, + blockHeight: transaction.blockHeight, + date: new Date(transaction.timestamp * 1000), + // extra: getOperationExtra(transaction), + senders: [transaction.sender], + recipients: transaction.receiver ? [transaction.receiver] : [], + transactionSequenceNumber: isSender(transaction, addr) + ? transaction.nonce + : undefined, + hasFailed: + !transaction.status || + transaction.status === "fail" || + transaction.status === "invalid", + }; +} + +/** + * Fetch operation list + */ +export const getOperations = async ( + accountId: string, + addr: string +): Promise => { + const rawTransactions = await api.getHistory(addr); + + if (!rawTransactions) return rawTransactions; + + return rawTransactions.map((transaction) => + transactionToOperation(accountId, addr, transaction) + ); +}; + +/** + * Obtain fees from blockchain + */ +export const getFees = async (unsigned): Promise => { + const { data, gasLimit } = unsigned; + + if (!data) { + return BigNumber(gasLimit * 1000000000); + } else { + return BigNumber((gasLimit + 1500 * data.length) * 1000000000); + } +}; + +/** + * Broadcast blob to blockchain + */ +export const submit = async (blob: string) => { + const { hash, fees } = await api.submit(blob); + + // Transaction hash is likely to be returned + return { hash, fees: BigNumber(fees) }; +}; diff --git a/src/families/elrond/bridge/js.js b/src/families/elrond/bridge/js.js new file mode 100644 index 0000000000..49ab2ab568 --- /dev/null +++ b/src/families/elrond/bridge/js.js @@ -0,0 +1,38 @@ +// @flow +import type { AccountBridge, CurrencyBridge } from "../../../types"; +import type { Transaction } from "../types"; +import { makeAccountBridgeReceive } from "../../../bridge/jsHelpers"; +import { getPreloadStrategy, preload, hydrate } from "../preload"; +import { sync, scanAccounts } from "../js-synchronisation"; +import { + createTransaction, + updateTransaction, + prepareTransaction, +} from "../js-transaction"; +import getTransactionStatus from "../js-getTransactionStatus"; +import estimateMaxSpendable from "../js-estimateMaxSpendable"; +import signOperation from "../js-signOperation"; +import broadcast from "../js-broadcast"; + +const receive = makeAccountBridgeReceive(); + +const currencyBridge: CurrencyBridge = { + getPreloadStrategy, + preload, + hydrate, + scanAccounts, +}; + +const accountBridge: AccountBridge = { + estimateMaxSpendable, + createTransaction, + updateTransaction, + getTransactionStatus, + prepareTransaction, + sync, + receive, + signOperation, + broadcast, +}; + +export default { currencyBridge, accountBridge }; diff --git a/src/families/elrond/cli-transaction.js b/src/families/elrond/cli-transaction.js new file mode 100644 index 0000000000..094d48678e --- /dev/null +++ b/src/families/elrond/cli-transaction.js @@ -0,0 +1,36 @@ +// @flow +import invariant from "invariant"; +import flatMap from "lodash/flatMap"; +import type { Transaction, AccountLike } from "../../types"; + +const options = [ + { + name: "mode", + type: String, + desc: "mode of transaction: send", + }, +]; + +function inferTransactions( + transactions: Array<{ account: AccountLike, transaction: Transaction }>, + opts: Object +): Transaction[] { + return flatMap(transactions, ({ transaction, account }) => { + invariant(transaction.family === "elrond", "elrond family"); + + if (account.type === "Account") { + invariant(account.elrondResources, "unactivated account"); + } + + return { + ...transaction, + family: "elrond", + mode: opts.mode || "send", + }; + }); +} + +export default { + options, + inferTransactions, +}; diff --git a/src/families/elrond/constants.js b/src/families/elrond/constants.js new file mode 100644 index 0000000000..1b9c5a966c --- /dev/null +++ b/src/families/elrond/constants.js @@ -0,0 +1,9 @@ +export const HASH_TRANSACTION = { + version: 2, + options: 1, +}; + +export const RAW_TRANSACTION = { + version: 1, + options: 0, +}; diff --git a/src/families/elrond/errors.js b/src/families/elrond/errors.js new file mode 100644 index 0000000000..4aa317442a --- /dev/null +++ b/src/families/elrond/errors.js @@ -0,0 +1,9 @@ +// @flow +import { createCustomErrorClass } from "@ledgerhq/errors"; + +/** + * Elrond error thrown on a specifc check done on a transaction amount + */ +export const ElrondSpecificError = createCustomErrorClass( + "ElrondSpecificError" +); diff --git a/src/families/elrond/hw-app-elrond/index.js b/src/families/elrond/hw-app-elrond/index.js new file mode 100644 index 0000000000..1f1cc4e018 --- /dev/null +++ b/src/families/elrond/hw-app-elrond/index.js @@ -0,0 +1,200 @@ +//@flow + +import type Transport from "@ledgerhq/hw-transport"; +import BIPPath from "bip32-path"; + +const CHUNK_SIZE = 150; +const CURVE_MASK = 0x80; +const CLA = 0xed; + +const INS = { + GET_VERSION: 0x02, + GET_ADDRESS: 0x03, + SET_ADDRESS: 0x05, +}; + +const SIGN_RAW_TX_INS = 0x04; +const SIGN_HASH_TX_INS = 0x07; +const SIGN_MESSAGE_INS = 0x06; + +const ACTIVE_SIGNERS = [SIGN_RAW_TX_INS, SIGN_HASH_TX_INS, SIGN_MESSAGE_INS]; + +const SW_OK = 0x9000; +const SW_CANCEL = 0x6986; + +export default class Elrond { + transport: Transport<*>; + + constructor(transport: Transport<*>, scrambleKey: string = "eGLD") { + this.transport = transport; + transport.decorateAppAPIMethods( + this, + [ + "getAddress", + "setAddress", + "signTransaction", + "signMessage", + "getAppConfiguration", + ], + scrambleKey + ); + } + + /** + * Get Elrond app configuration. + * + * @return an object with a contractData, accountIndex, addressIndex, version + * @example + * const result = await elrond.getAppConfiguration(); + * const { contractData, accountIndex, addressIndex, version } = result; + */ + async getAppConfiguration(): Promise<{ + version: string, + }> { + const response = await this.transport.send( + CLA, + INS.GET_VERSION, + 0x00, + 0x00 + ); + return { + contractData: response[0], + accountIndex: response[1], + addressIndex: response[2], + version: `${response[3]}.${response[4]}.${response[5]}`, + }; + } + + serializePath(path: Array) { + const buf = Buffer.alloc(8); + + buf.writeUInt32BE(path[3], 0); + buf.writeUInt32BE(path[4], 4); + + return buf; + } + + /** + * Get Elrond address for a given BIP 32 path. + * + * @param path a path in BIP 32 format + * @param display optionally enable or not the display + * @return an object with a address + * @example + * const result = await elrond.getAddress("44'/508'/0'/0'/0'"); + * const { address, returnCode } = result; + */ + async getAddress( + path: string, + display?: boolean + ): Promise<{ + address: string, + }> { + const bipPath = BIPPath.fromString(path).toPathArray(); + + const data = this.serializePath(bipPath); + + const response = await this.transport.send( + CLA, + INS.GET_ADDRESS, + display ? 0x01 : 0x00, + 0x00, + data, + [SW_OK, SW_CANCEL] + ); + + const addressLength = response[0]; + const address = response.slice(1, 1 + addressLength).toString("ascii"); + + return { address }; + } + + /** + * Set Elrond address for a given BIP 32 path. + * + * @param path a path in BIP 32 format + * @param display optionally enable or not the display + * @return an object with a address + * @example + * const result = await elrond.setAddress("44'/508'/0'/0/0"); + * result : Buffer; + */ + async setAddress(path: string, display?: boolean) { + const bipPath = BIPPath.fromString(path).toPathArray(); + const data = this.serializePath(bipPath); + + await this.transport.send( + CLA, + INS.SET_ADDRESS, + display ? 0x01 : 0x00, + 0x00, + data, + [SW_OK, SW_CANCEL] + ); + } + + async signTransaction( + path: string, + message: string, + usingHash: boolean + ): Promise { + const chunks = []; + + const buffer = Buffer.from(message); + + for (let i = 0; i < buffer.length; i += CHUNK_SIZE) { + let end = i + CHUNK_SIZE; + if (i > buffer.length) { + end = buffer.length; + } + chunks.push(buffer.slice(i, end)); + } + + return usingHash + ? this.sign(chunks, SIGN_HASH_TX_INS) + : this.sign(chunks, SIGN_RAW_TX_INS); + } + + async signMessage(message: Buffer): Promise { + return this.sign(message, SIGN_MESSAGE_INS); + } + + async sign(message: Buffer, type: number): Promise { + if (!ACTIVE_SIGNERS.includes(type)) { + throw new Error(`invalid sign instruction called: ${type}`); + } + + const apdus = []; + + message.forEach((data, index) => { + const apdu = { + cla: CLA, + ins: type, + p1: index === 0 ? 0x00 : CURVE_MASK, + p2: CURVE_MASK, + data, + }; + + apdus.push(apdu); + }); + + let response = {}; + for (let apdu of apdus) { + response = await this.transport.send( + apdu.cla, + apdu.ins, + apdu.p1, + apdu.p2, + apdu.data + ); + } + + if (response.length !== 67 || response[0] !== 64) { + throw new Error("invalid signature received from ledger device"); + } + + const signature = response.slice(1, response.length - 2).toString("hex"); + + return signature; + } +} diff --git a/src/families/elrond/hw-getAddress.js b/src/families/elrond/hw-getAddress.js new file mode 100644 index 0000000000..89f8841ae3 --- /dev/null +++ b/src/families/elrond/hw-getAddress.js @@ -0,0 +1,14 @@ +// @flow + +import type { Resolver } from "../../hw/getAddress/types"; +import Elrond from "./hw-app-elrond"; + +const resolver: Resolver = async (transport, { path, verify }) => { + const elrond = new Elrond(transport); + + const { address } = await elrond.getAddress(path, verify); + + return { address, path }; +}; + +export default resolver; diff --git a/src/families/elrond/js-broadcast.js b/src/families/elrond/js-broadcast.js new file mode 100644 index 0000000000..d47f35f5af --- /dev/null +++ b/src/families/elrond/js-broadcast.js @@ -0,0 +1,25 @@ +// @flow +import type { Operation, SignedOperation } from "../../types"; +import { patchOperationWithHash } from "../../operation"; + +import { submit } from "./api"; + +/** + * Broadcast the signed transaction + * @param {signature: string, operation: string} signedOperation + */ +const broadcast = async ({ + signedOperation: { signature, operation }, +}: { + signedOperation: SignedOperation, +}): Promise => { + const { + extra: { signUsingHash }, + } = operation; + + const { hash } = await submit({ operation, signature, signUsingHash }); + + return patchOperationWithHash(operation, hash); +}; + +export default broadcast; diff --git a/src/families/elrond/js-buildTransaction.js b/src/families/elrond/js-buildTransaction.js new file mode 100644 index 0000000000..2669c8c304 --- /dev/null +++ b/src/families/elrond/js-buildTransaction.js @@ -0,0 +1,37 @@ +// @flow +import type { Transaction } from "./types"; +import type { Account } from "../../types"; + +import { getNonce, getNetworkConfigs } from "./logic"; + +import { HASH_TRANSACTION, RAW_TRANSACTION } from "./constants"; + +/** + * + * @param {Account} a + * @param {Transaction} t + */ +export const buildTransaction = async ( + a: Account, + t: Transaction, + signUsingHash: Boolean = true +) => { + const address = a.freshAddress; + const nonce = getNonce(a); + const { gasPrice, gasLimit, chainId } = await getNetworkConfigs(); + const transactionType = signUsingHash ? HASH_TRANSACTION : RAW_TRANSACTION; + + const unsigned = { + nonce, + value: t.amount, + receiver: t.recipient, + sender: address, + gasPrice, + gasLimit, + chainID: chainId, + ...transactionType, + }; + + // Will likely be a call to Elrond SDK + return JSON.stringify(unsigned); +}; diff --git a/src/families/elrond/js-estimateMaxSpendable.js b/src/families/elrond/js-estimateMaxSpendable.js new file mode 100644 index 0000000000..828cbc833f --- /dev/null +++ b/src/families/elrond/js-estimateMaxSpendable.js @@ -0,0 +1,38 @@ +// @flow +import { BigNumber } from "bignumber.js"; + +import type { AccountLike, Account } from "../../types"; +import { getMainAccount } from "../../account"; + +import type { Transaction } from "./types"; + +import { createTransaction } from "./js-transaction"; +import getEstimatedFees from "./js-getFeesForTransaction"; + +/** + * Returns the maximum possible amount for transaction + * + * @param {Object} param - the account, parentAccount and transaction + */ +const estimateMaxSpendable = async ({ + account, + parentAccount, + transaction, +}: { + account: AccountLike, + parentAccount: ?Account, + transaction: ?Transaction, +}): Promise => { + const a = getMainAccount(account, parentAccount); + const t = { + ...createTransaction(), + ...transaction, + amount: a.spendableBalance, + }; + + const fees = await getEstimatedFees({ a, t }); + + return a.spendableBalance.minus(fees); +}; + +export default estimateMaxSpendable; diff --git a/src/families/elrond/js-getFeesForTransaction.js b/src/families/elrond/js-getFeesForTransaction.js new file mode 100644 index 0000000000..e4b018125e --- /dev/null +++ b/src/families/elrond/js-getFeesForTransaction.js @@ -0,0 +1,30 @@ +// @flow +import { BigNumber } from "bignumber.js"; + +import type { Account } from "../../types"; +import type { Transaction } from "./types"; + +import { getFees } from "./api"; +import { buildTransaction } from "./js-buildTransaction"; + +/** + * Fetch the transaction fees for a transaction + * + * @param {Account} a + * @param {Transaction} t + */ +const getEstimatedFees = async ({ + a, + t, + signUsingHash = true, +}: { + a: Account, + t: Transaction, +}): Promise => { + const unsigned = await buildTransaction(a, t, signUsingHash); + const fees = await getFees(JSON.parse(unsigned)); + + return fees; +}; + +export default getEstimatedFees; diff --git a/src/families/elrond/js-getTransactionStatus.js b/src/families/elrond/js-getTransactionStatus.js new file mode 100644 index 0000000000..963e6bf245 --- /dev/null +++ b/src/families/elrond/js-getTransactionStatus.js @@ -0,0 +1,57 @@ +// @flow +import { BigNumber } from "bignumber.js"; +import { + NotEnoughBalance, + RecipientRequired, + InvalidAddress, + FeeNotLoaded, +} from "@ledgerhq/errors"; +import type { Account, TransactionStatus } from "../../types"; +import type { Transaction } from "./types"; + +import { isValidAddress } from "./logic"; + +const getTransactionStatus = async ( + a: Account, + t: Transaction +): Promise => { + const errors = {}; + const warnings = {}; + const useAllAmount = !!t.useAllAmount; + + if (!t.recipient) { + errors.recipient = new RecipientRequired(); + } + + if (!isValidAddress(t.recipient)) { + errors.recipient = new InvalidAddress(); + } + + if (!t.fees) { + errors.fees = new FeeNotLoaded(); + } + + const estimatedFees = t.fees || BigNumber(0); + + const totalSpent = useAllAmount + ? a.balance + : BigNumber(t.amount).plus(estimatedFees); + + const amount = useAllAmount + ? a.balance.minus(estimatedFees) + : BigNumber(t.amount); + + if (totalSpent.gt(a.balance)) { + errors.amount = new NotEnoughBalance(); + } + + return Promise.resolve({ + errors, + warnings, + estimatedFees, + amount, + totalSpent, + }); +}; + +export default getTransactionStatus; diff --git a/src/families/elrond/js-signOperation.js b/src/families/elrond/js-signOperation.js new file mode 100644 index 0000000000..3b5aab782e --- /dev/null +++ b/src/families/elrond/js-signOperation.js @@ -0,0 +1,115 @@ +// @flow +import { BigNumber } from "bignumber.js"; +import { Observable } from "rxjs"; +import { FeeNotLoaded } from "@ledgerhq/errors"; + +import type { Transaction } from "./types"; +import type { Account, Operation, SignOperationEvent } from "../../types"; + +import { open, close } from "../../hw"; +import { encodeOperationId } from "../../operation"; +import Elrond from "./hw-app-elrond"; + +import { buildTransaction } from "./js-buildTransaction"; +import { getNonce, compareVersions } from "./logic"; + +const buildOptimisticOperation = ( + account: Account, + transaction: Transaction, + fee: BigNumber, + signUsingHash: Boolean +): Operation => { + const type = "OUT"; + + const value = BigNumber(transaction.amount); + + const operation: $Exact = { + id: encodeOperationId(account.id, "", type), + hash: "", + type, + value, + fee, + blockHash: null, + blockHeight: account.blockHeight, + senders: [account.freshAddress], + recipients: [transaction.recipient].filter(Boolean), + accountId: account.id, + transactionSequenceNumber: getNonce(account), + date: new Date(), + extra: { + signUsingHash, + }, + }; + + return operation; +}; + +/** + * Sign Transaction with Ledger hardware + */ +const signOperation = ({ + account, + deviceId, + transaction, +}: { + account: Account, + deviceId: *, + transaction: Transaction, +}): Observable => + Observable.create((o) => { + async function main() { + const transport = await open(deviceId); + + try { + if (!transaction.fees) { + throw new FeeNotLoaded(); + } + + const elrond = new Elrond(transport); + + const { version } = await elrond.getAppConfiguration(); + + const signUsingHash = compareVersions(version, "1.0.11") >= 0; + + const unsigned = await buildTransaction( + account, + transaction, + signUsingHash + ); + + o.next({ type: "device-signature-requested" }); + + const r = await elrond.signTransaction( + account.freshAddressPath, + unsigned, + signUsingHash + ); + + o.next({ type: "device-signature-granted" }); + + const operation = buildOptimisticOperation( + account, + transaction, + transaction.fees ?? BigNumber(0), + signUsingHash + ); + + o.next({ + type: "signed", + signedOperation: { + operation, + signature: r, + expirationDate: null, + }, + }); + } finally { + close(transport, deviceId); + } + } + main().then( + () => o.complete(), + (e) => o.error(e) + ); + }); + +export default signOperation; diff --git a/src/families/elrond/js-synchronisation.js b/src/families/elrond/js-synchronisation.js new file mode 100644 index 0000000000..ccd52f2893 --- /dev/null +++ b/src/families/elrond/js-synchronisation.js @@ -0,0 +1,37 @@ +//@flow +import type { Account } from "../../types"; +import type { GetAccountShape } from "../../bridge/jsHelpers"; +import { makeSync, makeScanAccounts, mergeOps } from "../../bridge/jsHelpers"; + +import { getAccount, getOperations } from "./api"; + +const getAccountShape: GetAccountShape = async (info) => { + const { id, address, initialAccount } = info; + const oldOperations = initialAccount?.operations || []; + + // get the current account balance state depending your api implementation + const { blockHeight, balance, nonce } = await getAccount(address); + + // Merge new operations with the previously synced ones + const newOperations = await getOperations(id, address); + const operations = mergeOps(oldOperations, newOperations); + + const shape = { + id, + balance, + spendableBalance: balance, + operationsCount: operations.length, + blockHeight, + elrondResources: { + nonce, + }, + }; + + return { ...shape, operations }; +}; + +const postSync = (initial: Account, parent: Account) => parent; + +export const scanAccounts = makeScanAccounts(getAccountShape); + +export const sync = makeSync(getAccountShape, postSync); diff --git a/src/families/elrond/js-transaction.js b/src/families/elrond/js-transaction.js new file mode 100644 index 0000000000..8f71c5c2fe --- /dev/null +++ b/src/families/elrond/js-transaction.js @@ -0,0 +1,55 @@ +// @flow +import { BigNumber } from "bignumber.js"; +import type { Account } from "../../types"; +import type { Transaction } from "./types"; + +import getEstimatedFees from "./js-getFeesForTransaction"; + +const sameFees = (a, b) => (!a || !b ? false : a === b); + +/** + * Create an empty transaction + * + * @returns {Transaction} + */ +export const createTransaction = (): Transaction => { + return { + family: "elrond", + mode: "send", + amount: BigNumber(0), + recipient: "", + useAllAmount: false, + fees: 50000, + }; +}; + +/** + * Apply patch to transaction + * + * @param {*} t + * @param {*} patch + */ +export const updateTransaction = ( + t: Transaction, + patch: $Shape +) => { + return { ...t, ...patch }; +}; + +/** + * Prepare transaction before checking status + * + * @param {Account} a + * @param {Transaction} t + */ +export const prepareTransaction = async (a: Account, t: Transaction) => { + let fees = t.fees; + + fees = await getEstimatedFees({ a, t }); + + if (!sameFees(t.fees, fees)) { + return { ...t, fees }; + } + + return t; +}; diff --git a/src/families/elrond/logic.js b/src/families/elrond/logic.js new file mode 100644 index 0000000000..a1855a7978 --- /dev/null +++ b/src/families/elrond/logic.js @@ -0,0 +1,71 @@ +// @flow +import type { Account } from "../../types"; + +import { getNetworkConfig } from "./api"; + +export const compareVersions = (versionA: string, versionB: string): number => { + let i, diff; + const regExStrip0 = /(\.0+)+$/; + const segmentsA = versionA.replace(regExStrip0, "").split("."); + const segmentsB = versionB.replace(regExStrip0, "").split("."); + const minVersionLength = Math.min(segmentsA.length, segmentsB.length); + + for (i = 0; i < minVersionLength; i++) { + diff = parseInt(segmentsA[i], 10) - parseInt(segmentsB[i], 10); + if (diff == 0) { + continue; + } + + if (diff < 0) { + return -1; + } + + return 1; + } + + return segmentsA.length - segmentsB.length; +}; + +/** + * Returns true if address is a valid bech32 + * + * @param {string} address + */ +export const isValidAddress = (address: string): boolean => { + if (!address) return false; + + if (!address.startsWith("erd1")) return false; + + if (address.length !== 62) return false; + + return true; +}; + +/** + * Returns nonce for an account + * + * @param {Account} a + */ +export const getNonce = (a: Account): number => { + const lastPendingOp = a.pendingOperations[0]; + + const nonce = Math.max( + a.elrondResources?.nonce || 0, + lastPendingOp && typeof lastPendingOp.transactionSequenceNumber === "number" + ? lastPendingOp.transactionSequenceNumber + 1 + : 0 + ); + + return nonce; +}; + +export const getNetworkConfigs = async () => { + const { + chainId, + gasPrice, + gasLimit, + denomination, + } = await getNetworkConfig(); + + return { chainId, gasPrice, gasLimit, denomination }; +}; diff --git a/src/families/elrond/preload.js b/src/families/elrond/preload.js new file mode 100644 index 0000000000..a53a228e9b --- /dev/null +++ b/src/families/elrond/preload.js @@ -0,0 +1,66 @@ +// @flow +import { Observable, Subject } from "rxjs"; +import { log } from "@ledgerhq/logs"; + +import type { ElrondPreloadData } from "./types"; +import { getValidators } from "./api"; + +const PRELOAD_MAX_AGE = 30 * 60 * 1000; // 30 minutes + +let currentPreloadedData: ElrondPreloadData = { + validators: {}, +}; + +function fromHydratePreloadData(data: mixed): ElrondPreloadData { + let foo = null; + + if (typeof data === "object" && data) { + if (typeof data.validators === "object" && data.validators) { + foo = data.validators.foo || "bar"; + } + } + + return { + validators: { foo }, + }; +} + +const updates = new Subject(); + +export function getCurrentElrondPreloadData(): ElrondPreloadData { + return currentPreloadedData; +} + +export function setElrondPreloadData(data: ElrondPreloadData) { + if (data === currentPreloadedData) return; + + currentPreloadedData = data; + + updates.next(data); +} + +export function getElrondPreloadDataUpdates(): Observable { + return updates.asObservable(); +} + +export const getPreloadStrategy = () => { + return { + preloadMaxAge: PRELOAD_MAX_AGE, + }; +}; + +export const preload = async (): Promise => { + log("elrond/preload", "preloading elrond data..."); + + const validators = (await getValidators()) || []; + + return { validators }; +}; + +export const hydrate = (data: mixed) => { + const hydrated = fromHydratePreloadData(data); + + log("elrond/preload", `hydrated foo with ${hydrated.validators.foo}`); + + setElrondPreloadData(hydrated); +}; diff --git a/src/families/elrond/serialization.js b/src/families/elrond/serialization.js new file mode 100644 index 0000000000..05b458a649 --- /dev/null +++ b/src/families/elrond/serialization.js @@ -0,0 +1,16 @@ +// @flow +import type { ElrondResourcesRaw, ElrondResources } from "./types"; + +export function toElrondResourcesRaw(r: ElrondResources): ElrondResourcesRaw { + const { nonce } = r; + return { + nonce, + }; +} + +export function fromElrondResourcesRaw(r: ElrondResourcesRaw): ElrondResources { + const { nonce } = r; + return { + nonce, + }; +} diff --git a/src/families/elrond/test-dataset.js b/src/families/elrond/test-dataset.js new file mode 100644 index 0000000000..f340f6b9a0 --- /dev/null +++ b/src/families/elrond/test-dataset.js @@ -0,0 +1,58 @@ +// @flow +import type { DatasetTest } from "../../types"; +import type { Transaction } from "./types"; + +type TestTransaction = { + name: string, + transaction: Transaction, + expectedStatus: { + amount: BigNumber, + errors: {}, + warnings: {}, + }, +}; + +export default dataset = { + implementations: ["js"], + currencies: { + elrond: { + scanAccounts: [ + { + name: "elrond seed 1", + apdus: ` + => ed030000080000000000000000 + <= 3e65726431726e71376d386b6472707966616e793466776571747964736b34706778306c3664746c367476636164357765736167727578747336326539726b9000 + => ed030000080000000000000000 + <= 3e65726431726e71376d386b6472707966616e793466776571747964736b34706778306c3664746c367476636164357765736167727578747336326539726b9000 + `, + }, + ], + accounts: [ + { + raw: { + id: `js:2:elrond:erd1rnq7m8kdrpyfany4fweqtydsk4pgx0l6dtl6tvcad5wesagruxts62e9rk:`, + seedIdentifier: + "erd1rnq7m8kdrpyfany4fweqtydsk4pgx0l6dtl6tvcad5wesagruxts62e9rk", + name: "Elrond 1", + derivationMode: "", + index: 0, + freshAddress: + "erd1rnq7m8kdrpyfany4fweqtydsk4pgx0l6dtl6tvcad5wesagruxts62e9rk", + freshAddressPath: "44'/508'/0'/0/0'", + freshAddresses: [], + blockHeight: 0, + operations: [], + pendingOperations: [], + currencyId: "elrond", + unitMagnitude: 10, + lastSyncDate: "", + balance: "299569965", + }, + transactions: [ + // HERE WE WILL INSERT OUR test + ], + }, + ], + }, + }, +}; diff --git a/src/families/elrond/transaction.js b/src/families/elrond/transaction.js new file mode 100644 index 0000000000..ce99bf4054 --- /dev/null +++ b/src/families/elrond/transaction.js @@ -0,0 +1,53 @@ +// @flow +import type { Transaction, TransactionRaw } from "./types"; +import { BigNumber } from "bignumber.js"; +import { + fromTransactionCommonRaw, + toTransactionCommonRaw, +} from "../../transaction/common"; +import type { Account } from "../../types"; +import { getAccountUnit } from "../../account"; +import { formatCurrencyUnit } from "../../currencies"; + +export const formatTransaction = ( + { mode, amount, recipient, useAllAmount }: Transaction, + account: Account +): string => + ` +${mode.toUpperCase()} ${ + useAllAmount + ? "MAX" + : amount.isZero() + ? "" + : " " + + formatCurrencyUnit(getAccountUnit(account), amount, { + showCode: true, + disableRounding: true, + }) + }${recipient ? `\nTO ${recipient}` : ""}`; + +export const fromTransactionRaw = (tr: TransactionRaw): Transaction => { + const common = fromTransactionCommonRaw(tr); + return { + ...common, + family: tr.family, + mode: tr.mode, + fees: tr.fees ? BigNumber(tr.fees) : null, + }; +}; + +export const toTransactionRaw = (t: Transaction): TransactionRaw => { + const common = toTransactionCommonRaw(t); + return { + ...common, + family: t.family, + mode: t.mode, + fees: t.fees?.toString() || null, + }; +}; + +export default { + formatTransaction, + fromTransactionRaw, + toTransactionRaw, +}; diff --git a/src/families/elrond/types.js b/src/families/elrond/types.js new file mode 100644 index 0000000000..ba11a48234 --- /dev/null +++ b/src/families/elrond/types.js @@ -0,0 +1,65 @@ +// @flow +import type { BigNumber } from "bignumber.js"; +import type { + TransactionCommon, + TransactionCommonRaw, +} from "../../types/transaction"; + +export type CoreStatics = {}; + +export type CoreAccountSpecifics = {}; + +export type CoreOperationSpecifics = {}; + +export type CoreCurrencySpecifics = {}; + +export type ElrondResources = {| + nonce: number, +|}; + +/** + * Elrond account resources from raw JSON + */ +export type ElrondResourcesRaw = {| + nonce: number, +|}; + +/** + * Elrond transaction + */ +export type Transaction = {| + ...TransactionCommon, + mode: string, + family: "elrond", + fees: ?BigNumber, +|}; + +/** + * Elrond transaction from a raw JSON + */ +export type TransactionRaw = {| + ...TransactionCommonRaw, + family: "elrond", + mode: string, + fees: ?string, +|}; + +export type ElrondValidator = {| + bls: string, + identity: string, + owner: string, + provider: string, + type: string, + status: string, + nonce: number, + stake: BigNumber, + topUp: BigNumber, + locked: BigNumber, + online: boolean, +|}; + +export type ElrondPreloadData = {| + validators: Object, +|}; + +export const reflect = (_declare: *) => {}; diff --git a/src/generated/account.js b/src/generated/account.js index 54eeb328a7..028dab9852 100644 --- a/src/generated/account.js +++ b/src/generated/account.js @@ -2,11 +2,13 @@ import algorand from "../families/algorand/account.js"; import bitcoin from "../families/bitcoin/account.js"; import cosmos from "../families/cosmos/account.js"; +import elrond from "../families/elrond/account.js"; import polkadot from "../families/polkadot/account.js"; export default { algorand, bitcoin, cosmos, + elrond, polkadot, }; diff --git a/src/generated/bridge/js.js b/src/generated/bridge/js.js index 7318c57b5e..b4edc5922c 100644 --- a/src/generated/bridge/js.js +++ b/src/generated/bridge/js.js @@ -1,4 +1,5 @@ // @flow +import elrond from "../../families/elrond/bridge/js.js"; import ethereum from "../../families/ethereum/bridge/js.js"; import neo from "../../families/neo/bridge/js.js"; import polkadot from "../../families/polkadot/bridge/js.js"; @@ -7,6 +8,7 @@ import stellar from "../../families/stellar/bridge/js.js"; import tron from "../../families/tron/bridge/js.js"; export default { + elrond, ethereum, neo, polkadot, diff --git a/src/generated/cli-transaction.js b/src/generated/cli-transaction.js index 29e56c3ea7..389975c980 100644 --- a/src/generated/cli-transaction.js +++ b/src/generated/cli-transaction.js @@ -2,6 +2,7 @@ import algorand from "../families/algorand/cli-transaction.js"; import bitcoin from "../families/bitcoin/cli-transaction.js"; import cosmos from "../families/cosmos/cli-transaction.js"; +import elrond from "../families/elrond/cli-transaction.js"; import ethereum from "../families/ethereum/cli-transaction.js"; import polkadot from "../families/polkadot/cli-transaction.js"; import ripple from "../families/ripple/cli-transaction.js"; @@ -13,6 +14,7 @@ export default { algorand, bitcoin, cosmos, + elrond, ethereum, polkadot, ripple, diff --git a/src/generated/hw-getAddress.js b/src/generated/hw-getAddress.js index d8e4e76aba..1f5e7eb782 100644 --- a/src/generated/hw-getAddress.js +++ b/src/generated/hw-getAddress.js @@ -2,6 +2,7 @@ import algorand from "../families/algorand/hw-getAddress.js"; import bitcoin from "../families/bitcoin/hw-getAddress.js"; import cosmos from "../families/cosmos/hw-getAddress.js"; +import elrond from "../families/elrond/hw-getAddress.js"; import ethereum from "../families/ethereum/hw-getAddress.js"; import neo from "../families/neo/hw-getAddress.js"; import polkadot from "../families/polkadot/hw-getAddress.js"; @@ -14,6 +15,7 @@ export default { algorand, bitcoin, cosmos, + elrond, ethereum, neo, polkadot, diff --git a/src/generated/test-dataset.js b/src/generated/test-dataset.js index 062c3c5608..d5b1aa3a4b 100644 --- a/src/generated/test-dataset.js +++ b/src/generated/test-dataset.js @@ -2,6 +2,7 @@ import algorand from "../families/algorand/test-dataset.js"; import bitcoin from "../families/bitcoin/test-dataset.js"; import cosmos from "../families/cosmos/test-dataset.js"; +import elrond from "../families/elrond/test-dataset.js"; import ethereum from "../families/ethereum/test-dataset.js"; import polkadot from "../families/polkadot/test-dataset.js"; import ripple from "../families/ripple/test-dataset.js"; @@ -13,6 +14,7 @@ export default { algorand, bitcoin, cosmos, + elrond, ethereum, polkadot, ripple, diff --git a/src/generated/transaction.js b/src/generated/transaction.js index 1ba1440455..0e8de21e1d 100644 --- a/src/generated/transaction.js +++ b/src/generated/transaction.js @@ -2,6 +2,7 @@ import algorand from "../families/algorand/transaction.js"; import bitcoin from "../families/bitcoin/transaction.js"; import cosmos from "../families/cosmos/transaction.js"; +import elrond from "../families/elrond/transaction.js"; import ethereum from "../families/ethereum/transaction.js"; import neo from "../families/neo/transaction.js"; import polkadot from "../families/polkadot/transaction.js"; @@ -14,6 +15,7 @@ export default { algorand, bitcoin, cosmos, + elrond, ethereum, neo, polkadot, diff --git a/src/generated/types.js b/src/generated/types.js index caca7cee53..a0cefb2501 100644 --- a/src/generated/types.js +++ b/src/generated/types.js @@ -24,6 +24,15 @@ import type { Transaction as cosmosTransaction } from "../families/cosmos/types" import type { TransactionRaw as cosmosTransactionRaw } from "../families/cosmos/types"; import type { NetworkInfo as cosmosNetworkInfo } from "../families/cosmos/types"; import type { NetworkInfoRaw as cosmosNetworkInfoRaw } from "../families/cosmos/types"; +import { reflect as elrondReflect } from "../families/elrond/types"; +import type { CoreStatics as CoreStatics_elrond } from "../families/elrond/types"; +import type { CoreAccountSpecifics as CoreAccountSpecifics_elrond } from "../families/elrond/types"; +import type { CoreOperationSpecifics as CoreOperationSpecifics_elrond } from "../families/elrond/types"; +import type { CoreCurrencySpecifics as CoreCurrencySpecifics_elrond } from "../families/elrond/types"; +import type { Transaction as elrondTransaction } from "../families/elrond/types"; +import type { TransactionRaw as elrondTransactionRaw } from "../families/elrond/types"; +import type { NetworkInfo as elrondNetworkInfo } from "../families/elrond/types"; +import type { NetworkInfoRaw as elrondNetworkInfoRaw } from "../families/elrond/types"; import { reflect as ethereumReflect } from "../families/ethereum/types"; import type { CoreStatics as CoreStatics_ethereum } from "../families/ethereum/types"; import type { CoreAccountSpecifics as CoreAccountSpecifics_ethereum } from "../families/ethereum/types"; @@ -90,6 +99,7 @@ export type SpecificStatics = {} & CoreStatics_algorand & CoreStatics_bitcoin & CoreStatics_cosmos +& CoreStatics_elrond & CoreStatics_ethereum & CoreStatics_neo & CoreStatics_polkadot @@ -101,6 +111,7 @@ export type CoreAccountSpecifics = {} & CoreAccountSpecifics_algorand & CoreAccountSpecifics_bitcoin & CoreAccountSpecifics_cosmos +& CoreAccountSpecifics_elrond & CoreAccountSpecifics_ethereum & CoreAccountSpecifics_neo & CoreAccountSpecifics_polkadot @@ -112,6 +123,7 @@ export type CoreOperationSpecifics = {} & CoreOperationSpecifics_algorand & CoreOperationSpecifics_bitcoin & CoreOperationSpecifics_cosmos +& CoreOperationSpecifics_elrond & CoreOperationSpecifics_ethereum & CoreOperationSpecifics_neo & CoreOperationSpecifics_polkadot @@ -123,6 +135,7 @@ export type CoreCurrencySpecifics = {} & CoreCurrencySpecifics_algorand & CoreCurrencySpecifics_bitcoin & CoreCurrencySpecifics_cosmos +& CoreCurrencySpecifics_elrond & CoreCurrencySpecifics_ethereum & CoreCurrencySpecifics_neo & CoreCurrencySpecifics_polkadot @@ -134,6 +147,7 @@ export type Transaction = | algorandTransaction | bitcoinTransaction | cosmosTransaction + | elrondTransaction | ethereumTransaction | neoTransaction | polkadotTransaction @@ -145,6 +159,7 @@ export type TransactionRaw = | algorandTransactionRaw | bitcoinTransactionRaw | cosmosTransactionRaw + | elrondTransactionRaw | ethereumTransactionRaw | neoTransactionRaw | polkadotTransactionRaw @@ -155,6 +170,7 @@ export type TransactionRaw = export type NetworkInfo = | bitcoinNetworkInfo | cosmosNetworkInfo + | elrondNetworkInfo | ethereumNetworkInfo | neoNetworkInfo | rippleNetworkInfo @@ -164,6 +180,7 @@ export type NetworkInfo = export type NetworkInfoRaw = | bitcoinNetworkInfoRaw | cosmosNetworkInfoRaw + | elrondNetworkInfoRaw | ethereumNetworkInfoRaw | neoNetworkInfoRaw | rippleNetworkInfoRaw @@ -174,6 +191,7 @@ export const reflectSpecifics = (declare: *) => [ algorandReflect(declare), bitcoinReflect(declare), cosmosReflect(declare), + elrondReflect(declare), ethereumReflect(declare), neoReflect(declare), polkadotReflect(declare), From 75dad61fa2adaab2a61f1dc1ef5bb3108d0b6a8c Mon Sep 17 00:00:00 2001 From: Pislariu Alexandru Date: Mon, 21 Jun 2021 12:06:15 +0300 Subject: [PATCH 002/127] Serialize specific resources for Elrond family --- src/account/serialization.js | 13 +++++++++++++ src/types/account.js | 6 ++++++ 2 files changed, 19 insertions(+) diff --git a/src/account/serialization.js b/src/account/serialization.js index b3f025ec9f..907fbc5d4f 100644 --- a/src/account/serialization.js +++ b/src/account/serialization.js @@ -35,6 +35,10 @@ import { toPolkadotResourcesRaw, fromPolkadotResourcesRaw, } from "../families/polkadot/serialization"; +import { + toElrondResourcesRaw, + fromElrondResourcesRaw, +} from "../families/elrond/serialization"; import { getCryptoCurrencyById, getTokenById, @@ -53,6 +57,7 @@ export { toCosmosResourcesRaw, fromCosmosResourcesRaw }; export { toAlgorandResourcesRaw, fromAlgorandResourcesRaw }; export { toBitcoinResourcesRaw, fromBitcoinResourcesRaw }; export { toPolkadotResourcesRaw, fromPolkadotResourcesRaw }; +export { toElrondResourcesRaw, fromElrondResourcesRaw }; export function toBalanceHistoryRaw(b: BalanceHistory): BalanceHistoryRaw { return b.map(({ date, value }) => [date.toISOString(), value.toString()]); @@ -648,6 +653,7 @@ export function fromAccountRaw(rawAccount: AccountRaw): Account { algorandResources, syncHash, polkadotResources, + elrondResources, } = rawAccount; const subAccounts = @@ -747,6 +753,9 @@ export function fromAccountRaw(rawAccount: AccountRaw): Account { if (polkadotResources) { res.polkadotResources = fromPolkadotResourcesRaw(polkadotResources); } + if (elrondResources) { + res.elrondResources = fromElrondResourcesRaw(elrondResources); + } return res; } @@ -784,6 +793,7 @@ export function toAccountRaw({ algorandResources, syncHash, polkadotResources, + elrondResources, }: Account): AccountRaw { const res: $Exact = { id, @@ -841,5 +851,8 @@ export function toAccountRaw({ if (polkadotResources) { res.polkadotResources = toPolkadotResourcesRaw(polkadotResources); } + if (elrondResources) { + res.elrondResources = toElrondResourcesRaw(elrondResources); + } return res; } diff --git a/src/types/account.js b/src/types/account.js index 29a2d13c0c..04bb7c58a3 100644 --- a/src/types/account.js +++ b/src/types/account.js @@ -21,6 +21,10 @@ import type { PolkadotResources, PolkadotResourcesRaw, } from "../families/polkadot/types"; +import type { + ElrondResources, + ElrondResourcesRaw, +} from "../families/elrond/types"; import type { BalanceHistory, BalanceHistoryRaw, @@ -234,6 +238,7 @@ export type Account = { cosmosResources?: CosmosResources, algorandResources?: AlgorandResources, polkadotResources?: PolkadotResources, + elrondResources?: ElrondResources, // Swap operations linked to this account swapHistory: SwapOperation[], @@ -322,6 +327,7 @@ export type AccountRaw = { cosmosResources?: CosmosResourcesRaw, algorandResources?: AlgorandResourcesRaw, polkadotResources?: PolkadotResourcesRaw, + elrondResources?: ElrondResourcesRaw, swapHistory?: SwapOperationRaw[], syncHash?: string, }; From 05aff5d82d519031554fe67d038396f349937368 Mon Sep 17 00:00:00 2001 From: Pislariu Alexandru Date: Mon, 21 Jun 2021 12:07:01 +0300 Subject: [PATCH 003/127] Reconciliate specific resources for Elrond family --- src/reconciliation.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/reconciliation.js b/src/reconciliation.js index 3681ffd7ac..1d86aa2e4e 100644 --- a/src/reconciliation.js +++ b/src/reconciliation.js @@ -26,6 +26,7 @@ import { fromBalanceHistoryRawMap, fromAlgorandResourcesRaw, fromPolkadotResourcesRaw, + fromElrondResourcesRaw, } from "./account"; import consoleWarnExpectToEqual from "./consoleWarnExpectToEqual"; @@ -339,6 +340,14 @@ export function patchAccount( changed = true; } + if ( + updatedRaw.elrondResources && + account.elrondResources !== updatedRaw.elrondResources + ) { + next.elrondResources = fromElrondResourcesRaw(updatedRaw.elrondResources); + changed = true; + } + if (!changed) return account; // nothing changed at all return next; From 695e6c5b3537600ed133045cb44d5094152c83c1 Mon Sep 17 00:00:00 2001 From: Pislariu Alexandru Date: Mon, 21 Jun 2021 12:07:18 +0300 Subject: [PATCH 004/127] Elrond mainnet api for interactions --- src/env.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/env.js b/src/env.js index 97cf160db1..cbd5c5a2ce 100644 --- a/src/env.js +++ b/src/env.js @@ -83,6 +83,11 @@ const envDefinitions = { def: "https://polkadot-sidecar.coin.ledger.com", desc: "Polkadot Sidecar API url", }, + ELROND_API_ENDPOINT: { + parser: stringParser, + def: "https://api.elrond.com", + desc: "Elrond API url", + }, API_STELLAR_HORIZON: { parser: stringParser, def: "https://stellar.coin.ledger.com", From 58a29393c05534e1274292ef8ee5f33bf5a5ccf8 Mon Sep 17 00:00:00 2001 From: Pislariu Alexandru Date: Mon, 21 Jun 2021 12:07:32 +0300 Subject: [PATCH 005/127] Set elrond as supported currency --- cli/src/live-common-setup-base.js | 1 + 1 file changed, 1 insertion(+) diff --git a/cli/src/live-common-setup-base.js b/cli/src/live-common-setup-base.js index 9f742fdf17..245222d3fd 100644 --- a/cli/src/live-common-setup-base.js +++ b/cli/src/live-common-setup-base.js @@ -15,6 +15,7 @@ setSupportedCurrencies([ "litecoin", "dash", "ethereum_classic", + "elrond", "tezos", "qtum", "zcash", From 341793d35efb376375bf53968374ffdb266af2b4 Mon Sep 17 00:00:00 2001 From: Pislariu Alexandru <57287326+pislaProgramming@users.noreply.github.com> Date: Tue, 22 Jun 2021 10:08:45 +0300 Subject: [PATCH 006/127] Revert "Integrate" --- cli/src/live-common-setup-base.js | 1 - src/account/serialization.js | 13 -- src/env.js | 5 - src/families/elrond/account.js | 50 ----- src/families/elrond/api/apiCalls.js | 157 -------------- src/families/elrond/api/index.js | 8 - src/families/elrond/api/sdk.js | 141 ------------ src/families/elrond/bridge/js.js | 38 ---- src/families/elrond/cli-transaction.js | 36 ---- src/families/elrond/constants.js | 9 - src/families/elrond/errors.js | 9 - src/families/elrond/hw-app-elrond/index.js | 200 ------------------ src/families/elrond/hw-getAddress.js | 14 -- src/families/elrond/js-broadcast.js | 25 --- src/families/elrond/js-buildTransaction.js | 37 ---- .../elrond/js-estimateMaxSpendable.js | 38 ---- .../elrond/js-getFeesForTransaction.js | 30 --- .../elrond/js-getTransactionStatus.js | 57 ----- src/families/elrond/js-signOperation.js | 115 ---------- src/families/elrond/js-synchronisation.js | 37 ---- src/families/elrond/js-transaction.js | 55 ----- src/families/elrond/logic.js | 71 ------- src/families/elrond/preload.js | 66 ------ src/families/elrond/serialization.js | 16 -- src/families/elrond/test-dataset.js | 58 ----- src/families/elrond/transaction.js | 53 ----- src/families/elrond/types.js | 65 ------ src/generated/account.js | 2 - src/generated/bridge/js.js | 2 - src/generated/cli-transaction.js | 2 - src/generated/hw-getAddress.js | 2 - src/generated/test-dataset.js | 2 - src/generated/transaction.js | 2 - src/generated/types.js | 18 -- src/reconciliation.js | 9 - src/types/account.js | 6 - 36 files changed, 1449 deletions(-) delete mode 100644 src/families/elrond/account.js delete mode 100644 src/families/elrond/api/apiCalls.js delete mode 100644 src/families/elrond/api/index.js delete mode 100644 src/families/elrond/api/sdk.js delete mode 100644 src/families/elrond/bridge/js.js delete mode 100644 src/families/elrond/cli-transaction.js delete mode 100644 src/families/elrond/constants.js delete mode 100644 src/families/elrond/errors.js delete mode 100644 src/families/elrond/hw-app-elrond/index.js delete mode 100644 src/families/elrond/hw-getAddress.js delete mode 100644 src/families/elrond/js-broadcast.js delete mode 100644 src/families/elrond/js-buildTransaction.js delete mode 100644 src/families/elrond/js-estimateMaxSpendable.js delete mode 100644 src/families/elrond/js-getFeesForTransaction.js delete mode 100644 src/families/elrond/js-getTransactionStatus.js delete mode 100644 src/families/elrond/js-signOperation.js delete mode 100644 src/families/elrond/js-synchronisation.js delete mode 100644 src/families/elrond/js-transaction.js delete mode 100644 src/families/elrond/logic.js delete mode 100644 src/families/elrond/preload.js delete mode 100644 src/families/elrond/serialization.js delete mode 100644 src/families/elrond/test-dataset.js delete mode 100644 src/families/elrond/transaction.js delete mode 100644 src/families/elrond/types.js diff --git a/cli/src/live-common-setup-base.js b/cli/src/live-common-setup-base.js index 245222d3fd..9f742fdf17 100644 --- a/cli/src/live-common-setup-base.js +++ b/cli/src/live-common-setup-base.js @@ -15,7 +15,6 @@ setSupportedCurrencies([ "litecoin", "dash", "ethereum_classic", - "elrond", "tezos", "qtum", "zcash", diff --git a/src/account/serialization.js b/src/account/serialization.js index 907fbc5d4f..b3f025ec9f 100644 --- a/src/account/serialization.js +++ b/src/account/serialization.js @@ -35,10 +35,6 @@ import { toPolkadotResourcesRaw, fromPolkadotResourcesRaw, } from "../families/polkadot/serialization"; -import { - toElrondResourcesRaw, - fromElrondResourcesRaw, -} from "../families/elrond/serialization"; import { getCryptoCurrencyById, getTokenById, @@ -57,7 +53,6 @@ export { toCosmosResourcesRaw, fromCosmosResourcesRaw }; export { toAlgorandResourcesRaw, fromAlgorandResourcesRaw }; export { toBitcoinResourcesRaw, fromBitcoinResourcesRaw }; export { toPolkadotResourcesRaw, fromPolkadotResourcesRaw }; -export { toElrondResourcesRaw, fromElrondResourcesRaw }; export function toBalanceHistoryRaw(b: BalanceHistory): BalanceHistoryRaw { return b.map(({ date, value }) => [date.toISOString(), value.toString()]); @@ -653,7 +648,6 @@ export function fromAccountRaw(rawAccount: AccountRaw): Account { algorandResources, syncHash, polkadotResources, - elrondResources, } = rawAccount; const subAccounts = @@ -753,9 +747,6 @@ export function fromAccountRaw(rawAccount: AccountRaw): Account { if (polkadotResources) { res.polkadotResources = fromPolkadotResourcesRaw(polkadotResources); } - if (elrondResources) { - res.elrondResources = fromElrondResourcesRaw(elrondResources); - } return res; } @@ -793,7 +784,6 @@ export function toAccountRaw({ algorandResources, syncHash, polkadotResources, - elrondResources, }: Account): AccountRaw { const res: $Exact = { id, @@ -851,8 +841,5 @@ export function toAccountRaw({ if (polkadotResources) { res.polkadotResources = toPolkadotResourcesRaw(polkadotResources); } - if (elrondResources) { - res.elrondResources = toElrondResourcesRaw(elrondResources); - } return res; } diff --git a/src/env.js b/src/env.js index cbd5c5a2ce..97cf160db1 100644 --- a/src/env.js +++ b/src/env.js @@ -83,11 +83,6 @@ const envDefinitions = { def: "https://polkadot-sidecar.coin.ledger.com", desc: "Polkadot Sidecar API url", }, - ELROND_API_ENDPOINT: { - parser: stringParser, - def: "https://api.elrond.com", - desc: "Elrond API url", - }, API_STELLAR_HORIZON: { parser: stringParser, def: "https://stellar.coin.ledger.com", diff --git a/src/families/elrond/account.js b/src/families/elrond/account.js deleted file mode 100644 index d6acb6b095..0000000000 --- a/src/families/elrond/account.js +++ /dev/null @@ -1,50 +0,0 @@ -// @flow -import invariant from "invariant"; -import { BigNumber } from "bignumber.js"; -import type { Account, Operation, Unit } from "../../types"; -import { getAccountUnit } from "../../account"; -import { formatCurrencyUnit } from "../../currencies"; - -function formatAccountSpecifics(account: Account): string { - const { elrondResources } = account; - invariant(elrondResources, "elrond account expected"); - const unit = getAccountUnit(account); - const formatConfig = { - disableRounding: true, - alwaysShowSign: false, - showCode: true, - }; - - let str = " "; - - if (account.spendableBalance) { - str += - formatCurrencyUnit(unit, account.spendableBalance, formatConfig) + - " spendable. "; - } else { - str += " 0 spendable."; - } - - if (elrondResources.nonce) { - str += "\nonce : " + elrondResources.nonce; - } - - return str; -} - -function formatOperationSpecifics(op: Operation, unit: ?Unit): string { - let str = " "; - - const formatConfig = { - disableRounding: true, - alwaysShowSign: false, - showCode: true, - }; - - return str; -} - -export default { - formatAccountSpecifics, - formatOperationSpecifics, -}; diff --git a/src/families/elrond/api/apiCalls.js b/src/families/elrond/api/apiCalls.js deleted file mode 100644 index d74fa549dc..0000000000 --- a/src/families/elrond/api/apiCalls.js +++ /dev/null @@ -1,157 +0,0 @@ -import network from "../../../network"; -import { HASH_TRANSACTION, RAW_TRANSACTION } from "../constants"; - -export default class ElrondApi { - constructor(API_URL: String) { - this.API_URL = API_URL; - } - - async getBalance(addr: String) { - const { - data: { balance }, - } = await network({ - method: "GET", - url: `${this.API_URL}/accounts/${addr}`, - }); - - return balance; - } - - async getNonce(addr: String) { - const { - data: { nonce }, - } = await network({ - method: "GET", - url: `${this.API_URL}/accounts/${addr}`, - }); - - return nonce; - } - - async getValidators() { - let data = []; - try { - let { - data: { validators }, - } = await network({ - method: "GET", - url: `${this.API_URL}/validator/statistics`, - }); - data = validators; - } catch (error) { - return data; - } - - return data; - } - - async getNetworkConfig() { - const { - data: { - data: { - config: { - erd_chain_id: chainId, - erd_denomination: denomination, - erd_min_gas_limit: gasLimit, - erd_min_gas_price: gasPrice, - }, - }, - }, - } = await network({ - method: "GET", - url: `${this.API_URL}/network/config`, - }); - - return { chainId, denomination, gasLimit, gasPrice }; - } - - async submit({ operation, signature, signUsingHash }) { - const { chainId, gasLimit, gasPrice } = await this.getNetworkConfig(); - - const transactionType = signUsingHash ? HASH_TRANSACTION : RAW_TRANSACTION; - - const { - senders: [sender], - recipients: [receiver], - value, - } = operation; - - const nonce = await this.getNonce(sender); - - const { - data: { - data: { txHash: hash }, - }, - } = await network({ - method: "POST", - url: `${this.API_URL}/transaction/send`, - data: { - nonce, - value, - receiver, - sender, - gasPrice, - gasLimit, - chainID: chainId, - signature, - ...transactionType, - }, - }); - - return { hash }; - } - - async getHistory(addr: string) { - const { data: transactions } = await network({ - method: "GET", - url: `${this.API_URL}/transactions?condition=should&sender=${addr}&receiver=${addr}`, - }); - - if (!transactions.length) return transactions; //Account does not have any transactions - - return Promise.all( - transactions.map(async (transaction) => { - const { blockHeight, blockHash } = await this.getConfirmedTransaction( - transaction.txHash - ); - - return { ...transaction, blockHash, blockHeight }; - }) - ); - } - - async getBlockchainBlockHeight() { - const { data: transactions } = await network({ - method: "GET", - url: `${this.API_URL}/transactions`, - }); - - let blockHeight; - let index = 0; - while (!blockHeight) { - const confirmedTransaction = await this.getConfirmedTransaction( - transactions[index].txHash - ); - blockHeight = confirmedTransaction.blockHeight; - - index++; - } - - return blockHeight; - } - - async getConfirmedTransaction(txHash: string) { - const { - data: { - data: { - transaction: { hyperblockNonce, blockHash }, - }, - }, - } = await network({ - method: "GET", - url: `${this.API_URL}/transaction/${txHash}`, - }); - - return { blockHeight: hyperblockNonce, blockHash }; - } -} diff --git a/src/families/elrond/api/index.js b/src/families/elrond/api/index.js deleted file mode 100644 index add27d8be8..0000000000 --- a/src/families/elrond/api/index.js +++ /dev/null @@ -1,8 +0,0 @@ -export { - getAccount, - getNetworkConfig, - getValidators, - getOperations, - getFees, - submit, -} from "./sdk"; diff --git a/src/families/elrond/api/sdk.js b/src/families/elrond/api/sdk.js deleted file mode 100644 index c6d26ced81..0000000000 --- a/src/families/elrond/api/sdk.js +++ /dev/null @@ -1,141 +0,0 @@ -// @flow - -import { BigNumber } from "bignumber.js"; -import ElrondApi from "./apiCalls"; -import type { Transaction } from "../types"; -import type { Operation, OperationType } from "../../../types"; -import { getEnv } from "../../../env"; -import { encodeOperationId } from "../../../operation"; - -const ELROND_API_ENDPOINT = () => getEnv("ELROND_API_ENDPOINT"); - -let api = new ElrondApi(ELROND_API_ENDPOINT()); - -/** - * Get account balances and nonce - */ -export const getAccount = async (addr: string) => { - const balance = await api.getBalance(addr); - const nonce = await api.getNonce(addr); - const blockHeight = await api.getBlockchainBlockHeight(); - - return { - blockHeight, - balance: new BigNumber(balance), - nonce, - }; -}; - -export const getValidators = async () => { - const validators = await api.getValidators(); - return { validators }; -}; - -export const getNetworkConfig = async () => { - const { - chainId, - gasPrice, - gasLimit, - denomination, - } = await api.getNetworkConfig(); - - return { chainId, gasPrice, gasLimit, denomination }; -}; - -/** - * Returns true if account is the signer - */ -function isSender(transaction: Transaction, addr: string): boolean { - return transaction.sender === addr; -} - -/** - * Map transaction to an Operation Type - */ -function getOperationType( - transaction: Transaction, - addr: string -): OperationType { - return isSender(transaction, addr) ? "OUT" : "IN"; -} - -/** - * Map transaction to a correct Operation Value (affecting account balance) - */ -function getOperationValue(transaction: Transaction, addr: string): BigNumber { - return isSender(transaction, addr) - ? BigNumber(transaction.value).plus(transaction.fee) - : BigNumber(transaction.value); -} - -/** - * Map the Elrond history transaction to a Ledger Live Operation - */ -function transactionToOperation( - accountId: string, - addr: string, - transaction: Transaction -): Operation { - const type = getOperationType(transaction, addr); - - return { - id: encodeOperationId(accountId, transaction.txHash, type), - accountId, - fee: BigNumber(transaction.fee || 0), - value: getOperationValue(transaction, addr), - type, - hash: transaction.txHash, - blockHash: transaction.blockHash, - blockHeight: transaction.blockHeight, - date: new Date(transaction.timestamp * 1000), - // extra: getOperationExtra(transaction), - senders: [transaction.sender], - recipients: transaction.receiver ? [transaction.receiver] : [], - transactionSequenceNumber: isSender(transaction, addr) - ? transaction.nonce - : undefined, - hasFailed: - !transaction.status || - transaction.status === "fail" || - transaction.status === "invalid", - }; -} - -/** - * Fetch operation list - */ -export const getOperations = async ( - accountId: string, - addr: string -): Promise => { - const rawTransactions = await api.getHistory(addr); - - if (!rawTransactions) return rawTransactions; - - return rawTransactions.map((transaction) => - transactionToOperation(accountId, addr, transaction) - ); -}; - -/** - * Obtain fees from blockchain - */ -export const getFees = async (unsigned): Promise => { - const { data, gasLimit } = unsigned; - - if (!data) { - return BigNumber(gasLimit * 1000000000); - } else { - return BigNumber((gasLimit + 1500 * data.length) * 1000000000); - } -}; - -/** - * Broadcast blob to blockchain - */ -export const submit = async (blob: string) => { - const { hash, fees } = await api.submit(blob); - - // Transaction hash is likely to be returned - return { hash, fees: BigNumber(fees) }; -}; diff --git a/src/families/elrond/bridge/js.js b/src/families/elrond/bridge/js.js deleted file mode 100644 index 49ab2ab568..0000000000 --- a/src/families/elrond/bridge/js.js +++ /dev/null @@ -1,38 +0,0 @@ -// @flow -import type { AccountBridge, CurrencyBridge } from "../../../types"; -import type { Transaction } from "../types"; -import { makeAccountBridgeReceive } from "../../../bridge/jsHelpers"; -import { getPreloadStrategy, preload, hydrate } from "../preload"; -import { sync, scanAccounts } from "../js-synchronisation"; -import { - createTransaction, - updateTransaction, - prepareTransaction, -} from "../js-transaction"; -import getTransactionStatus from "../js-getTransactionStatus"; -import estimateMaxSpendable from "../js-estimateMaxSpendable"; -import signOperation from "../js-signOperation"; -import broadcast from "../js-broadcast"; - -const receive = makeAccountBridgeReceive(); - -const currencyBridge: CurrencyBridge = { - getPreloadStrategy, - preload, - hydrate, - scanAccounts, -}; - -const accountBridge: AccountBridge = { - estimateMaxSpendable, - createTransaction, - updateTransaction, - getTransactionStatus, - prepareTransaction, - sync, - receive, - signOperation, - broadcast, -}; - -export default { currencyBridge, accountBridge }; diff --git a/src/families/elrond/cli-transaction.js b/src/families/elrond/cli-transaction.js deleted file mode 100644 index 094d48678e..0000000000 --- a/src/families/elrond/cli-transaction.js +++ /dev/null @@ -1,36 +0,0 @@ -// @flow -import invariant from "invariant"; -import flatMap from "lodash/flatMap"; -import type { Transaction, AccountLike } from "../../types"; - -const options = [ - { - name: "mode", - type: String, - desc: "mode of transaction: send", - }, -]; - -function inferTransactions( - transactions: Array<{ account: AccountLike, transaction: Transaction }>, - opts: Object -): Transaction[] { - return flatMap(transactions, ({ transaction, account }) => { - invariant(transaction.family === "elrond", "elrond family"); - - if (account.type === "Account") { - invariant(account.elrondResources, "unactivated account"); - } - - return { - ...transaction, - family: "elrond", - mode: opts.mode || "send", - }; - }); -} - -export default { - options, - inferTransactions, -}; diff --git a/src/families/elrond/constants.js b/src/families/elrond/constants.js deleted file mode 100644 index 1b9c5a966c..0000000000 --- a/src/families/elrond/constants.js +++ /dev/null @@ -1,9 +0,0 @@ -export const HASH_TRANSACTION = { - version: 2, - options: 1, -}; - -export const RAW_TRANSACTION = { - version: 1, - options: 0, -}; diff --git a/src/families/elrond/errors.js b/src/families/elrond/errors.js deleted file mode 100644 index 4aa317442a..0000000000 --- a/src/families/elrond/errors.js +++ /dev/null @@ -1,9 +0,0 @@ -// @flow -import { createCustomErrorClass } from "@ledgerhq/errors"; - -/** - * Elrond error thrown on a specifc check done on a transaction amount - */ -export const ElrondSpecificError = createCustomErrorClass( - "ElrondSpecificError" -); diff --git a/src/families/elrond/hw-app-elrond/index.js b/src/families/elrond/hw-app-elrond/index.js deleted file mode 100644 index 1f1cc4e018..0000000000 --- a/src/families/elrond/hw-app-elrond/index.js +++ /dev/null @@ -1,200 +0,0 @@ -//@flow - -import type Transport from "@ledgerhq/hw-transport"; -import BIPPath from "bip32-path"; - -const CHUNK_SIZE = 150; -const CURVE_MASK = 0x80; -const CLA = 0xed; - -const INS = { - GET_VERSION: 0x02, - GET_ADDRESS: 0x03, - SET_ADDRESS: 0x05, -}; - -const SIGN_RAW_TX_INS = 0x04; -const SIGN_HASH_TX_INS = 0x07; -const SIGN_MESSAGE_INS = 0x06; - -const ACTIVE_SIGNERS = [SIGN_RAW_TX_INS, SIGN_HASH_TX_INS, SIGN_MESSAGE_INS]; - -const SW_OK = 0x9000; -const SW_CANCEL = 0x6986; - -export default class Elrond { - transport: Transport<*>; - - constructor(transport: Transport<*>, scrambleKey: string = "eGLD") { - this.transport = transport; - transport.decorateAppAPIMethods( - this, - [ - "getAddress", - "setAddress", - "signTransaction", - "signMessage", - "getAppConfiguration", - ], - scrambleKey - ); - } - - /** - * Get Elrond app configuration. - * - * @return an object with a contractData, accountIndex, addressIndex, version - * @example - * const result = await elrond.getAppConfiguration(); - * const { contractData, accountIndex, addressIndex, version } = result; - */ - async getAppConfiguration(): Promise<{ - version: string, - }> { - const response = await this.transport.send( - CLA, - INS.GET_VERSION, - 0x00, - 0x00 - ); - return { - contractData: response[0], - accountIndex: response[1], - addressIndex: response[2], - version: `${response[3]}.${response[4]}.${response[5]}`, - }; - } - - serializePath(path: Array) { - const buf = Buffer.alloc(8); - - buf.writeUInt32BE(path[3], 0); - buf.writeUInt32BE(path[4], 4); - - return buf; - } - - /** - * Get Elrond address for a given BIP 32 path. - * - * @param path a path in BIP 32 format - * @param display optionally enable or not the display - * @return an object with a address - * @example - * const result = await elrond.getAddress("44'/508'/0'/0'/0'"); - * const { address, returnCode } = result; - */ - async getAddress( - path: string, - display?: boolean - ): Promise<{ - address: string, - }> { - const bipPath = BIPPath.fromString(path).toPathArray(); - - const data = this.serializePath(bipPath); - - const response = await this.transport.send( - CLA, - INS.GET_ADDRESS, - display ? 0x01 : 0x00, - 0x00, - data, - [SW_OK, SW_CANCEL] - ); - - const addressLength = response[0]; - const address = response.slice(1, 1 + addressLength).toString("ascii"); - - return { address }; - } - - /** - * Set Elrond address for a given BIP 32 path. - * - * @param path a path in BIP 32 format - * @param display optionally enable or not the display - * @return an object with a address - * @example - * const result = await elrond.setAddress("44'/508'/0'/0/0"); - * result : Buffer; - */ - async setAddress(path: string, display?: boolean) { - const bipPath = BIPPath.fromString(path).toPathArray(); - const data = this.serializePath(bipPath); - - await this.transport.send( - CLA, - INS.SET_ADDRESS, - display ? 0x01 : 0x00, - 0x00, - data, - [SW_OK, SW_CANCEL] - ); - } - - async signTransaction( - path: string, - message: string, - usingHash: boolean - ): Promise { - const chunks = []; - - const buffer = Buffer.from(message); - - for (let i = 0; i < buffer.length; i += CHUNK_SIZE) { - let end = i + CHUNK_SIZE; - if (i > buffer.length) { - end = buffer.length; - } - chunks.push(buffer.slice(i, end)); - } - - return usingHash - ? this.sign(chunks, SIGN_HASH_TX_INS) - : this.sign(chunks, SIGN_RAW_TX_INS); - } - - async signMessage(message: Buffer): Promise { - return this.sign(message, SIGN_MESSAGE_INS); - } - - async sign(message: Buffer, type: number): Promise { - if (!ACTIVE_SIGNERS.includes(type)) { - throw new Error(`invalid sign instruction called: ${type}`); - } - - const apdus = []; - - message.forEach((data, index) => { - const apdu = { - cla: CLA, - ins: type, - p1: index === 0 ? 0x00 : CURVE_MASK, - p2: CURVE_MASK, - data, - }; - - apdus.push(apdu); - }); - - let response = {}; - for (let apdu of apdus) { - response = await this.transport.send( - apdu.cla, - apdu.ins, - apdu.p1, - apdu.p2, - apdu.data - ); - } - - if (response.length !== 67 || response[0] !== 64) { - throw new Error("invalid signature received from ledger device"); - } - - const signature = response.slice(1, response.length - 2).toString("hex"); - - return signature; - } -} diff --git a/src/families/elrond/hw-getAddress.js b/src/families/elrond/hw-getAddress.js deleted file mode 100644 index 89f8841ae3..0000000000 --- a/src/families/elrond/hw-getAddress.js +++ /dev/null @@ -1,14 +0,0 @@ -// @flow - -import type { Resolver } from "../../hw/getAddress/types"; -import Elrond from "./hw-app-elrond"; - -const resolver: Resolver = async (transport, { path, verify }) => { - const elrond = new Elrond(transport); - - const { address } = await elrond.getAddress(path, verify); - - return { address, path }; -}; - -export default resolver; diff --git a/src/families/elrond/js-broadcast.js b/src/families/elrond/js-broadcast.js deleted file mode 100644 index d47f35f5af..0000000000 --- a/src/families/elrond/js-broadcast.js +++ /dev/null @@ -1,25 +0,0 @@ -// @flow -import type { Operation, SignedOperation } from "../../types"; -import { patchOperationWithHash } from "../../operation"; - -import { submit } from "./api"; - -/** - * Broadcast the signed transaction - * @param {signature: string, operation: string} signedOperation - */ -const broadcast = async ({ - signedOperation: { signature, operation }, -}: { - signedOperation: SignedOperation, -}): Promise => { - const { - extra: { signUsingHash }, - } = operation; - - const { hash } = await submit({ operation, signature, signUsingHash }); - - return patchOperationWithHash(operation, hash); -}; - -export default broadcast; diff --git a/src/families/elrond/js-buildTransaction.js b/src/families/elrond/js-buildTransaction.js deleted file mode 100644 index 2669c8c304..0000000000 --- a/src/families/elrond/js-buildTransaction.js +++ /dev/null @@ -1,37 +0,0 @@ -// @flow -import type { Transaction } from "./types"; -import type { Account } from "../../types"; - -import { getNonce, getNetworkConfigs } from "./logic"; - -import { HASH_TRANSACTION, RAW_TRANSACTION } from "./constants"; - -/** - * - * @param {Account} a - * @param {Transaction} t - */ -export const buildTransaction = async ( - a: Account, - t: Transaction, - signUsingHash: Boolean = true -) => { - const address = a.freshAddress; - const nonce = getNonce(a); - const { gasPrice, gasLimit, chainId } = await getNetworkConfigs(); - const transactionType = signUsingHash ? HASH_TRANSACTION : RAW_TRANSACTION; - - const unsigned = { - nonce, - value: t.amount, - receiver: t.recipient, - sender: address, - gasPrice, - gasLimit, - chainID: chainId, - ...transactionType, - }; - - // Will likely be a call to Elrond SDK - return JSON.stringify(unsigned); -}; diff --git a/src/families/elrond/js-estimateMaxSpendable.js b/src/families/elrond/js-estimateMaxSpendable.js deleted file mode 100644 index 828cbc833f..0000000000 --- a/src/families/elrond/js-estimateMaxSpendable.js +++ /dev/null @@ -1,38 +0,0 @@ -// @flow -import { BigNumber } from "bignumber.js"; - -import type { AccountLike, Account } from "../../types"; -import { getMainAccount } from "../../account"; - -import type { Transaction } from "./types"; - -import { createTransaction } from "./js-transaction"; -import getEstimatedFees from "./js-getFeesForTransaction"; - -/** - * Returns the maximum possible amount for transaction - * - * @param {Object} param - the account, parentAccount and transaction - */ -const estimateMaxSpendable = async ({ - account, - parentAccount, - transaction, -}: { - account: AccountLike, - parentAccount: ?Account, - transaction: ?Transaction, -}): Promise => { - const a = getMainAccount(account, parentAccount); - const t = { - ...createTransaction(), - ...transaction, - amount: a.spendableBalance, - }; - - const fees = await getEstimatedFees({ a, t }); - - return a.spendableBalance.minus(fees); -}; - -export default estimateMaxSpendable; diff --git a/src/families/elrond/js-getFeesForTransaction.js b/src/families/elrond/js-getFeesForTransaction.js deleted file mode 100644 index e4b018125e..0000000000 --- a/src/families/elrond/js-getFeesForTransaction.js +++ /dev/null @@ -1,30 +0,0 @@ -// @flow -import { BigNumber } from "bignumber.js"; - -import type { Account } from "../../types"; -import type { Transaction } from "./types"; - -import { getFees } from "./api"; -import { buildTransaction } from "./js-buildTransaction"; - -/** - * Fetch the transaction fees for a transaction - * - * @param {Account} a - * @param {Transaction} t - */ -const getEstimatedFees = async ({ - a, - t, - signUsingHash = true, -}: { - a: Account, - t: Transaction, -}): Promise => { - const unsigned = await buildTransaction(a, t, signUsingHash); - const fees = await getFees(JSON.parse(unsigned)); - - return fees; -}; - -export default getEstimatedFees; diff --git a/src/families/elrond/js-getTransactionStatus.js b/src/families/elrond/js-getTransactionStatus.js deleted file mode 100644 index 963e6bf245..0000000000 --- a/src/families/elrond/js-getTransactionStatus.js +++ /dev/null @@ -1,57 +0,0 @@ -// @flow -import { BigNumber } from "bignumber.js"; -import { - NotEnoughBalance, - RecipientRequired, - InvalidAddress, - FeeNotLoaded, -} from "@ledgerhq/errors"; -import type { Account, TransactionStatus } from "../../types"; -import type { Transaction } from "./types"; - -import { isValidAddress } from "./logic"; - -const getTransactionStatus = async ( - a: Account, - t: Transaction -): Promise => { - const errors = {}; - const warnings = {}; - const useAllAmount = !!t.useAllAmount; - - if (!t.recipient) { - errors.recipient = new RecipientRequired(); - } - - if (!isValidAddress(t.recipient)) { - errors.recipient = new InvalidAddress(); - } - - if (!t.fees) { - errors.fees = new FeeNotLoaded(); - } - - const estimatedFees = t.fees || BigNumber(0); - - const totalSpent = useAllAmount - ? a.balance - : BigNumber(t.amount).plus(estimatedFees); - - const amount = useAllAmount - ? a.balance.minus(estimatedFees) - : BigNumber(t.amount); - - if (totalSpent.gt(a.balance)) { - errors.amount = new NotEnoughBalance(); - } - - return Promise.resolve({ - errors, - warnings, - estimatedFees, - amount, - totalSpent, - }); -}; - -export default getTransactionStatus; diff --git a/src/families/elrond/js-signOperation.js b/src/families/elrond/js-signOperation.js deleted file mode 100644 index 3b5aab782e..0000000000 --- a/src/families/elrond/js-signOperation.js +++ /dev/null @@ -1,115 +0,0 @@ -// @flow -import { BigNumber } from "bignumber.js"; -import { Observable } from "rxjs"; -import { FeeNotLoaded } from "@ledgerhq/errors"; - -import type { Transaction } from "./types"; -import type { Account, Operation, SignOperationEvent } from "../../types"; - -import { open, close } from "../../hw"; -import { encodeOperationId } from "../../operation"; -import Elrond from "./hw-app-elrond"; - -import { buildTransaction } from "./js-buildTransaction"; -import { getNonce, compareVersions } from "./logic"; - -const buildOptimisticOperation = ( - account: Account, - transaction: Transaction, - fee: BigNumber, - signUsingHash: Boolean -): Operation => { - const type = "OUT"; - - const value = BigNumber(transaction.amount); - - const operation: $Exact = { - id: encodeOperationId(account.id, "", type), - hash: "", - type, - value, - fee, - blockHash: null, - blockHeight: account.blockHeight, - senders: [account.freshAddress], - recipients: [transaction.recipient].filter(Boolean), - accountId: account.id, - transactionSequenceNumber: getNonce(account), - date: new Date(), - extra: { - signUsingHash, - }, - }; - - return operation; -}; - -/** - * Sign Transaction with Ledger hardware - */ -const signOperation = ({ - account, - deviceId, - transaction, -}: { - account: Account, - deviceId: *, - transaction: Transaction, -}): Observable => - Observable.create((o) => { - async function main() { - const transport = await open(deviceId); - - try { - if (!transaction.fees) { - throw new FeeNotLoaded(); - } - - const elrond = new Elrond(transport); - - const { version } = await elrond.getAppConfiguration(); - - const signUsingHash = compareVersions(version, "1.0.11") >= 0; - - const unsigned = await buildTransaction( - account, - transaction, - signUsingHash - ); - - o.next({ type: "device-signature-requested" }); - - const r = await elrond.signTransaction( - account.freshAddressPath, - unsigned, - signUsingHash - ); - - o.next({ type: "device-signature-granted" }); - - const operation = buildOptimisticOperation( - account, - transaction, - transaction.fees ?? BigNumber(0), - signUsingHash - ); - - o.next({ - type: "signed", - signedOperation: { - operation, - signature: r, - expirationDate: null, - }, - }); - } finally { - close(transport, deviceId); - } - } - main().then( - () => o.complete(), - (e) => o.error(e) - ); - }); - -export default signOperation; diff --git a/src/families/elrond/js-synchronisation.js b/src/families/elrond/js-synchronisation.js deleted file mode 100644 index ccd52f2893..0000000000 --- a/src/families/elrond/js-synchronisation.js +++ /dev/null @@ -1,37 +0,0 @@ -//@flow -import type { Account } from "../../types"; -import type { GetAccountShape } from "../../bridge/jsHelpers"; -import { makeSync, makeScanAccounts, mergeOps } from "../../bridge/jsHelpers"; - -import { getAccount, getOperations } from "./api"; - -const getAccountShape: GetAccountShape = async (info) => { - const { id, address, initialAccount } = info; - const oldOperations = initialAccount?.operations || []; - - // get the current account balance state depending your api implementation - const { blockHeight, balance, nonce } = await getAccount(address); - - // Merge new operations with the previously synced ones - const newOperations = await getOperations(id, address); - const operations = mergeOps(oldOperations, newOperations); - - const shape = { - id, - balance, - spendableBalance: balance, - operationsCount: operations.length, - blockHeight, - elrondResources: { - nonce, - }, - }; - - return { ...shape, operations }; -}; - -const postSync = (initial: Account, parent: Account) => parent; - -export const scanAccounts = makeScanAccounts(getAccountShape); - -export const sync = makeSync(getAccountShape, postSync); diff --git a/src/families/elrond/js-transaction.js b/src/families/elrond/js-transaction.js deleted file mode 100644 index 8f71c5c2fe..0000000000 --- a/src/families/elrond/js-transaction.js +++ /dev/null @@ -1,55 +0,0 @@ -// @flow -import { BigNumber } from "bignumber.js"; -import type { Account } from "../../types"; -import type { Transaction } from "./types"; - -import getEstimatedFees from "./js-getFeesForTransaction"; - -const sameFees = (a, b) => (!a || !b ? false : a === b); - -/** - * Create an empty transaction - * - * @returns {Transaction} - */ -export const createTransaction = (): Transaction => { - return { - family: "elrond", - mode: "send", - amount: BigNumber(0), - recipient: "", - useAllAmount: false, - fees: 50000, - }; -}; - -/** - * Apply patch to transaction - * - * @param {*} t - * @param {*} patch - */ -export const updateTransaction = ( - t: Transaction, - patch: $Shape -) => { - return { ...t, ...patch }; -}; - -/** - * Prepare transaction before checking status - * - * @param {Account} a - * @param {Transaction} t - */ -export const prepareTransaction = async (a: Account, t: Transaction) => { - let fees = t.fees; - - fees = await getEstimatedFees({ a, t }); - - if (!sameFees(t.fees, fees)) { - return { ...t, fees }; - } - - return t; -}; diff --git a/src/families/elrond/logic.js b/src/families/elrond/logic.js deleted file mode 100644 index a1855a7978..0000000000 --- a/src/families/elrond/logic.js +++ /dev/null @@ -1,71 +0,0 @@ -// @flow -import type { Account } from "../../types"; - -import { getNetworkConfig } from "./api"; - -export const compareVersions = (versionA: string, versionB: string): number => { - let i, diff; - const regExStrip0 = /(\.0+)+$/; - const segmentsA = versionA.replace(regExStrip0, "").split("."); - const segmentsB = versionB.replace(regExStrip0, "").split("."); - const minVersionLength = Math.min(segmentsA.length, segmentsB.length); - - for (i = 0; i < minVersionLength; i++) { - diff = parseInt(segmentsA[i], 10) - parseInt(segmentsB[i], 10); - if (diff == 0) { - continue; - } - - if (diff < 0) { - return -1; - } - - return 1; - } - - return segmentsA.length - segmentsB.length; -}; - -/** - * Returns true if address is a valid bech32 - * - * @param {string} address - */ -export const isValidAddress = (address: string): boolean => { - if (!address) return false; - - if (!address.startsWith("erd1")) return false; - - if (address.length !== 62) return false; - - return true; -}; - -/** - * Returns nonce for an account - * - * @param {Account} a - */ -export const getNonce = (a: Account): number => { - const lastPendingOp = a.pendingOperations[0]; - - const nonce = Math.max( - a.elrondResources?.nonce || 0, - lastPendingOp && typeof lastPendingOp.transactionSequenceNumber === "number" - ? lastPendingOp.transactionSequenceNumber + 1 - : 0 - ); - - return nonce; -}; - -export const getNetworkConfigs = async () => { - const { - chainId, - gasPrice, - gasLimit, - denomination, - } = await getNetworkConfig(); - - return { chainId, gasPrice, gasLimit, denomination }; -}; diff --git a/src/families/elrond/preload.js b/src/families/elrond/preload.js deleted file mode 100644 index a53a228e9b..0000000000 --- a/src/families/elrond/preload.js +++ /dev/null @@ -1,66 +0,0 @@ -// @flow -import { Observable, Subject } from "rxjs"; -import { log } from "@ledgerhq/logs"; - -import type { ElrondPreloadData } from "./types"; -import { getValidators } from "./api"; - -const PRELOAD_MAX_AGE = 30 * 60 * 1000; // 30 minutes - -let currentPreloadedData: ElrondPreloadData = { - validators: {}, -}; - -function fromHydratePreloadData(data: mixed): ElrondPreloadData { - let foo = null; - - if (typeof data === "object" && data) { - if (typeof data.validators === "object" && data.validators) { - foo = data.validators.foo || "bar"; - } - } - - return { - validators: { foo }, - }; -} - -const updates = new Subject(); - -export function getCurrentElrondPreloadData(): ElrondPreloadData { - return currentPreloadedData; -} - -export function setElrondPreloadData(data: ElrondPreloadData) { - if (data === currentPreloadedData) return; - - currentPreloadedData = data; - - updates.next(data); -} - -export function getElrondPreloadDataUpdates(): Observable { - return updates.asObservable(); -} - -export const getPreloadStrategy = () => { - return { - preloadMaxAge: PRELOAD_MAX_AGE, - }; -}; - -export const preload = async (): Promise => { - log("elrond/preload", "preloading elrond data..."); - - const validators = (await getValidators()) || []; - - return { validators }; -}; - -export const hydrate = (data: mixed) => { - const hydrated = fromHydratePreloadData(data); - - log("elrond/preload", `hydrated foo with ${hydrated.validators.foo}`); - - setElrondPreloadData(hydrated); -}; diff --git a/src/families/elrond/serialization.js b/src/families/elrond/serialization.js deleted file mode 100644 index 05b458a649..0000000000 --- a/src/families/elrond/serialization.js +++ /dev/null @@ -1,16 +0,0 @@ -// @flow -import type { ElrondResourcesRaw, ElrondResources } from "./types"; - -export function toElrondResourcesRaw(r: ElrondResources): ElrondResourcesRaw { - const { nonce } = r; - return { - nonce, - }; -} - -export function fromElrondResourcesRaw(r: ElrondResourcesRaw): ElrondResources { - const { nonce } = r; - return { - nonce, - }; -} diff --git a/src/families/elrond/test-dataset.js b/src/families/elrond/test-dataset.js deleted file mode 100644 index f340f6b9a0..0000000000 --- a/src/families/elrond/test-dataset.js +++ /dev/null @@ -1,58 +0,0 @@ -// @flow -import type { DatasetTest } from "../../types"; -import type { Transaction } from "./types"; - -type TestTransaction = { - name: string, - transaction: Transaction, - expectedStatus: { - amount: BigNumber, - errors: {}, - warnings: {}, - }, -}; - -export default dataset = { - implementations: ["js"], - currencies: { - elrond: { - scanAccounts: [ - { - name: "elrond seed 1", - apdus: ` - => ed030000080000000000000000 - <= 3e65726431726e71376d386b6472707966616e793466776571747964736b34706778306c3664746c367476636164357765736167727578747336326539726b9000 - => ed030000080000000000000000 - <= 3e65726431726e71376d386b6472707966616e793466776571747964736b34706778306c3664746c367476636164357765736167727578747336326539726b9000 - `, - }, - ], - accounts: [ - { - raw: { - id: `js:2:elrond:erd1rnq7m8kdrpyfany4fweqtydsk4pgx0l6dtl6tvcad5wesagruxts62e9rk:`, - seedIdentifier: - "erd1rnq7m8kdrpyfany4fweqtydsk4pgx0l6dtl6tvcad5wesagruxts62e9rk", - name: "Elrond 1", - derivationMode: "", - index: 0, - freshAddress: - "erd1rnq7m8kdrpyfany4fweqtydsk4pgx0l6dtl6tvcad5wesagruxts62e9rk", - freshAddressPath: "44'/508'/0'/0/0'", - freshAddresses: [], - blockHeight: 0, - operations: [], - pendingOperations: [], - currencyId: "elrond", - unitMagnitude: 10, - lastSyncDate: "", - balance: "299569965", - }, - transactions: [ - // HERE WE WILL INSERT OUR test - ], - }, - ], - }, - }, -}; diff --git a/src/families/elrond/transaction.js b/src/families/elrond/transaction.js deleted file mode 100644 index ce99bf4054..0000000000 --- a/src/families/elrond/transaction.js +++ /dev/null @@ -1,53 +0,0 @@ -// @flow -import type { Transaction, TransactionRaw } from "./types"; -import { BigNumber } from "bignumber.js"; -import { - fromTransactionCommonRaw, - toTransactionCommonRaw, -} from "../../transaction/common"; -import type { Account } from "../../types"; -import { getAccountUnit } from "../../account"; -import { formatCurrencyUnit } from "../../currencies"; - -export const formatTransaction = ( - { mode, amount, recipient, useAllAmount }: Transaction, - account: Account -): string => - ` -${mode.toUpperCase()} ${ - useAllAmount - ? "MAX" - : amount.isZero() - ? "" - : " " + - formatCurrencyUnit(getAccountUnit(account), amount, { - showCode: true, - disableRounding: true, - }) - }${recipient ? `\nTO ${recipient}` : ""}`; - -export const fromTransactionRaw = (tr: TransactionRaw): Transaction => { - const common = fromTransactionCommonRaw(tr); - return { - ...common, - family: tr.family, - mode: tr.mode, - fees: tr.fees ? BigNumber(tr.fees) : null, - }; -}; - -export const toTransactionRaw = (t: Transaction): TransactionRaw => { - const common = toTransactionCommonRaw(t); - return { - ...common, - family: t.family, - mode: t.mode, - fees: t.fees?.toString() || null, - }; -}; - -export default { - formatTransaction, - fromTransactionRaw, - toTransactionRaw, -}; diff --git a/src/families/elrond/types.js b/src/families/elrond/types.js deleted file mode 100644 index ba11a48234..0000000000 --- a/src/families/elrond/types.js +++ /dev/null @@ -1,65 +0,0 @@ -// @flow -import type { BigNumber } from "bignumber.js"; -import type { - TransactionCommon, - TransactionCommonRaw, -} from "../../types/transaction"; - -export type CoreStatics = {}; - -export type CoreAccountSpecifics = {}; - -export type CoreOperationSpecifics = {}; - -export type CoreCurrencySpecifics = {}; - -export type ElrondResources = {| - nonce: number, -|}; - -/** - * Elrond account resources from raw JSON - */ -export type ElrondResourcesRaw = {| - nonce: number, -|}; - -/** - * Elrond transaction - */ -export type Transaction = {| - ...TransactionCommon, - mode: string, - family: "elrond", - fees: ?BigNumber, -|}; - -/** - * Elrond transaction from a raw JSON - */ -export type TransactionRaw = {| - ...TransactionCommonRaw, - family: "elrond", - mode: string, - fees: ?string, -|}; - -export type ElrondValidator = {| - bls: string, - identity: string, - owner: string, - provider: string, - type: string, - status: string, - nonce: number, - stake: BigNumber, - topUp: BigNumber, - locked: BigNumber, - online: boolean, -|}; - -export type ElrondPreloadData = {| - validators: Object, -|}; - -export const reflect = (_declare: *) => {}; diff --git a/src/generated/account.js b/src/generated/account.js index 028dab9852..54eeb328a7 100644 --- a/src/generated/account.js +++ b/src/generated/account.js @@ -2,13 +2,11 @@ import algorand from "../families/algorand/account.js"; import bitcoin from "../families/bitcoin/account.js"; import cosmos from "../families/cosmos/account.js"; -import elrond from "../families/elrond/account.js"; import polkadot from "../families/polkadot/account.js"; export default { algorand, bitcoin, cosmos, - elrond, polkadot, }; diff --git a/src/generated/bridge/js.js b/src/generated/bridge/js.js index b4edc5922c..7318c57b5e 100644 --- a/src/generated/bridge/js.js +++ b/src/generated/bridge/js.js @@ -1,5 +1,4 @@ // @flow -import elrond from "../../families/elrond/bridge/js.js"; import ethereum from "../../families/ethereum/bridge/js.js"; import neo from "../../families/neo/bridge/js.js"; import polkadot from "../../families/polkadot/bridge/js.js"; @@ -8,7 +7,6 @@ import stellar from "../../families/stellar/bridge/js.js"; import tron from "../../families/tron/bridge/js.js"; export default { - elrond, ethereum, neo, polkadot, diff --git a/src/generated/cli-transaction.js b/src/generated/cli-transaction.js index 389975c980..29e56c3ea7 100644 --- a/src/generated/cli-transaction.js +++ b/src/generated/cli-transaction.js @@ -2,7 +2,6 @@ import algorand from "../families/algorand/cli-transaction.js"; import bitcoin from "../families/bitcoin/cli-transaction.js"; import cosmos from "../families/cosmos/cli-transaction.js"; -import elrond from "../families/elrond/cli-transaction.js"; import ethereum from "../families/ethereum/cli-transaction.js"; import polkadot from "../families/polkadot/cli-transaction.js"; import ripple from "../families/ripple/cli-transaction.js"; @@ -14,7 +13,6 @@ export default { algorand, bitcoin, cosmos, - elrond, ethereum, polkadot, ripple, diff --git a/src/generated/hw-getAddress.js b/src/generated/hw-getAddress.js index 1f5e7eb782..d8e4e76aba 100644 --- a/src/generated/hw-getAddress.js +++ b/src/generated/hw-getAddress.js @@ -2,7 +2,6 @@ import algorand from "../families/algorand/hw-getAddress.js"; import bitcoin from "../families/bitcoin/hw-getAddress.js"; import cosmos from "../families/cosmos/hw-getAddress.js"; -import elrond from "../families/elrond/hw-getAddress.js"; import ethereum from "../families/ethereum/hw-getAddress.js"; import neo from "../families/neo/hw-getAddress.js"; import polkadot from "../families/polkadot/hw-getAddress.js"; @@ -15,7 +14,6 @@ export default { algorand, bitcoin, cosmos, - elrond, ethereum, neo, polkadot, diff --git a/src/generated/test-dataset.js b/src/generated/test-dataset.js index d5b1aa3a4b..062c3c5608 100644 --- a/src/generated/test-dataset.js +++ b/src/generated/test-dataset.js @@ -2,7 +2,6 @@ import algorand from "../families/algorand/test-dataset.js"; import bitcoin from "../families/bitcoin/test-dataset.js"; import cosmos from "../families/cosmos/test-dataset.js"; -import elrond from "../families/elrond/test-dataset.js"; import ethereum from "../families/ethereum/test-dataset.js"; import polkadot from "../families/polkadot/test-dataset.js"; import ripple from "../families/ripple/test-dataset.js"; @@ -14,7 +13,6 @@ export default { algorand, bitcoin, cosmos, - elrond, ethereum, polkadot, ripple, diff --git a/src/generated/transaction.js b/src/generated/transaction.js index 0e8de21e1d..1ba1440455 100644 --- a/src/generated/transaction.js +++ b/src/generated/transaction.js @@ -2,7 +2,6 @@ import algorand from "../families/algorand/transaction.js"; import bitcoin from "../families/bitcoin/transaction.js"; import cosmos from "../families/cosmos/transaction.js"; -import elrond from "../families/elrond/transaction.js"; import ethereum from "../families/ethereum/transaction.js"; import neo from "../families/neo/transaction.js"; import polkadot from "../families/polkadot/transaction.js"; @@ -15,7 +14,6 @@ export default { algorand, bitcoin, cosmos, - elrond, ethereum, neo, polkadot, diff --git a/src/generated/types.js b/src/generated/types.js index a0cefb2501..caca7cee53 100644 --- a/src/generated/types.js +++ b/src/generated/types.js @@ -24,15 +24,6 @@ import type { Transaction as cosmosTransaction } from "../families/cosmos/types" import type { TransactionRaw as cosmosTransactionRaw } from "../families/cosmos/types"; import type { NetworkInfo as cosmosNetworkInfo } from "../families/cosmos/types"; import type { NetworkInfoRaw as cosmosNetworkInfoRaw } from "../families/cosmos/types"; -import { reflect as elrondReflect } from "../families/elrond/types"; -import type { CoreStatics as CoreStatics_elrond } from "../families/elrond/types"; -import type { CoreAccountSpecifics as CoreAccountSpecifics_elrond } from "../families/elrond/types"; -import type { CoreOperationSpecifics as CoreOperationSpecifics_elrond } from "../families/elrond/types"; -import type { CoreCurrencySpecifics as CoreCurrencySpecifics_elrond } from "../families/elrond/types"; -import type { Transaction as elrondTransaction } from "../families/elrond/types"; -import type { TransactionRaw as elrondTransactionRaw } from "../families/elrond/types"; -import type { NetworkInfo as elrondNetworkInfo } from "../families/elrond/types"; -import type { NetworkInfoRaw as elrondNetworkInfoRaw } from "../families/elrond/types"; import { reflect as ethereumReflect } from "../families/ethereum/types"; import type { CoreStatics as CoreStatics_ethereum } from "../families/ethereum/types"; import type { CoreAccountSpecifics as CoreAccountSpecifics_ethereum } from "../families/ethereum/types"; @@ -99,7 +90,6 @@ export type SpecificStatics = {} & CoreStatics_algorand & CoreStatics_bitcoin & CoreStatics_cosmos -& CoreStatics_elrond & CoreStatics_ethereum & CoreStatics_neo & CoreStatics_polkadot @@ -111,7 +101,6 @@ export type CoreAccountSpecifics = {} & CoreAccountSpecifics_algorand & CoreAccountSpecifics_bitcoin & CoreAccountSpecifics_cosmos -& CoreAccountSpecifics_elrond & CoreAccountSpecifics_ethereum & CoreAccountSpecifics_neo & CoreAccountSpecifics_polkadot @@ -123,7 +112,6 @@ export type CoreOperationSpecifics = {} & CoreOperationSpecifics_algorand & CoreOperationSpecifics_bitcoin & CoreOperationSpecifics_cosmos -& CoreOperationSpecifics_elrond & CoreOperationSpecifics_ethereum & CoreOperationSpecifics_neo & CoreOperationSpecifics_polkadot @@ -135,7 +123,6 @@ export type CoreCurrencySpecifics = {} & CoreCurrencySpecifics_algorand & CoreCurrencySpecifics_bitcoin & CoreCurrencySpecifics_cosmos -& CoreCurrencySpecifics_elrond & CoreCurrencySpecifics_ethereum & CoreCurrencySpecifics_neo & CoreCurrencySpecifics_polkadot @@ -147,7 +134,6 @@ export type Transaction = | algorandTransaction | bitcoinTransaction | cosmosTransaction - | elrondTransaction | ethereumTransaction | neoTransaction | polkadotTransaction @@ -159,7 +145,6 @@ export type TransactionRaw = | algorandTransactionRaw | bitcoinTransactionRaw | cosmosTransactionRaw - | elrondTransactionRaw | ethereumTransactionRaw | neoTransactionRaw | polkadotTransactionRaw @@ -170,7 +155,6 @@ export type TransactionRaw = export type NetworkInfo = | bitcoinNetworkInfo | cosmosNetworkInfo - | elrondNetworkInfo | ethereumNetworkInfo | neoNetworkInfo | rippleNetworkInfo @@ -180,7 +164,6 @@ export type NetworkInfo = export type NetworkInfoRaw = | bitcoinNetworkInfoRaw | cosmosNetworkInfoRaw - | elrondNetworkInfoRaw | ethereumNetworkInfoRaw | neoNetworkInfoRaw | rippleNetworkInfoRaw @@ -191,7 +174,6 @@ export const reflectSpecifics = (declare: *) => [ algorandReflect(declare), bitcoinReflect(declare), cosmosReflect(declare), - elrondReflect(declare), ethereumReflect(declare), neoReflect(declare), polkadotReflect(declare), diff --git a/src/reconciliation.js b/src/reconciliation.js index 1d86aa2e4e..3681ffd7ac 100644 --- a/src/reconciliation.js +++ b/src/reconciliation.js @@ -26,7 +26,6 @@ import { fromBalanceHistoryRawMap, fromAlgorandResourcesRaw, fromPolkadotResourcesRaw, - fromElrondResourcesRaw, } from "./account"; import consoleWarnExpectToEqual from "./consoleWarnExpectToEqual"; @@ -340,14 +339,6 @@ export function patchAccount( changed = true; } - if ( - updatedRaw.elrondResources && - account.elrondResources !== updatedRaw.elrondResources - ) { - next.elrondResources = fromElrondResourcesRaw(updatedRaw.elrondResources); - changed = true; - } - if (!changed) return account; // nothing changed at all return next; diff --git a/src/types/account.js b/src/types/account.js index 04bb7c58a3..29a2d13c0c 100644 --- a/src/types/account.js +++ b/src/types/account.js @@ -21,10 +21,6 @@ import type { PolkadotResources, PolkadotResourcesRaw, } from "../families/polkadot/types"; -import type { - ElrondResources, - ElrondResourcesRaw, -} from "../families/elrond/types"; import type { BalanceHistory, BalanceHistoryRaw, @@ -238,7 +234,6 @@ export type Account = { cosmosResources?: CosmosResources, algorandResources?: AlgorandResources, polkadotResources?: PolkadotResources, - elrondResources?: ElrondResources, // Swap operations linked to this account swapHistory: SwapOperation[], @@ -327,7 +322,6 @@ export type AccountRaw = { cosmosResources?: CosmosResourcesRaw, algorandResources?: AlgorandResourcesRaw, polkadotResources?: PolkadotResourcesRaw, - elrondResources?: ElrondResourcesRaw, swapHistory?: SwapOperationRaw[], syncHash?: string, }; From 62975f0d29fd087a5b9417e19a7df7c7e75acae2 Mon Sep 17 00:00:00 2001 From: Pislariu Alexandru <57287326+pislaProgramming@users.noreply.github.com> Date: Tue, 22 Jun 2021 10:20:16 +0300 Subject: [PATCH 007/127] Revert "Revert "Integrate"" --- cli/src/live-common-setup-base.js | 1 + src/account/serialization.js | 13 ++ src/env.js | 5 + src/families/elrond/account.js | 50 +++++ src/families/elrond/api/apiCalls.js | 157 ++++++++++++++ src/families/elrond/api/index.js | 8 + src/families/elrond/api/sdk.js | 141 ++++++++++++ src/families/elrond/bridge/js.js | 38 ++++ src/families/elrond/cli-transaction.js | 36 ++++ src/families/elrond/constants.js | 9 + src/families/elrond/errors.js | 9 + src/families/elrond/hw-app-elrond/index.js | 200 ++++++++++++++++++ src/families/elrond/hw-getAddress.js | 14 ++ src/families/elrond/js-broadcast.js | 25 +++ src/families/elrond/js-buildTransaction.js | 37 ++++ .../elrond/js-estimateMaxSpendable.js | 38 ++++ .../elrond/js-getFeesForTransaction.js | 30 +++ .../elrond/js-getTransactionStatus.js | 57 +++++ src/families/elrond/js-signOperation.js | 115 ++++++++++ src/families/elrond/js-synchronisation.js | 37 ++++ src/families/elrond/js-transaction.js | 55 +++++ src/families/elrond/logic.js | 71 +++++++ src/families/elrond/preload.js | 66 ++++++ src/families/elrond/serialization.js | 16 ++ src/families/elrond/test-dataset.js | 58 +++++ src/families/elrond/transaction.js | 53 +++++ src/families/elrond/types.js | 65 ++++++ src/generated/account.js | 2 + src/generated/bridge/js.js | 2 + src/generated/cli-transaction.js | 2 + src/generated/hw-getAddress.js | 2 + src/generated/test-dataset.js | 2 + src/generated/transaction.js | 2 + src/generated/types.js | 18 ++ src/reconciliation.js | 9 + src/types/account.js | 6 + 36 files changed, 1449 insertions(+) create mode 100644 src/families/elrond/account.js create mode 100644 src/families/elrond/api/apiCalls.js create mode 100644 src/families/elrond/api/index.js create mode 100644 src/families/elrond/api/sdk.js create mode 100644 src/families/elrond/bridge/js.js create mode 100644 src/families/elrond/cli-transaction.js create mode 100644 src/families/elrond/constants.js create mode 100644 src/families/elrond/errors.js create mode 100644 src/families/elrond/hw-app-elrond/index.js create mode 100644 src/families/elrond/hw-getAddress.js create mode 100644 src/families/elrond/js-broadcast.js create mode 100644 src/families/elrond/js-buildTransaction.js create mode 100644 src/families/elrond/js-estimateMaxSpendable.js create mode 100644 src/families/elrond/js-getFeesForTransaction.js create mode 100644 src/families/elrond/js-getTransactionStatus.js create mode 100644 src/families/elrond/js-signOperation.js create mode 100644 src/families/elrond/js-synchronisation.js create mode 100644 src/families/elrond/js-transaction.js create mode 100644 src/families/elrond/logic.js create mode 100644 src/families/elrond/preload.js create mode 100644 src/families/elrond/serialization.js create mode 100644 src/families/elrond/test-dataset.js create mode 100644 src/families/elrond/transaction.js create mode 100644 src/families/elrond/types.js diff --git a/cli/src/live-common-setup-base.js b/cli/src/live-common-setup-base.js index 9f742fdf17..245222d3fd 100644 --- a/cli/src/live-common-setup-base.js +++ b/cli/src/live-common-setup-base.js @@ -15,6 +15,7 @@ setSupportedCurrencies([ "litecoin", "dash", "ethereum_classic", + "elrond", "tezos", "qtum", "zcash", diff --git a/src/account/serialization.js b/src/account/serialization.js index b3f025ec9f..907fbc5d4f 100644 --- a/src/account/serialization.js +++ b/src/account/serialization.js @@ -35,6 +35,10 @@ import { toPolkadotResourcesRaw, fromPolkadotResourcesRaw, } from "../families/polkadot/serialization"; +import { + toElrondResourcesRaw, + fromElrondResourcesRaw, +} from "../families/elrond/serialization"; import { getCryptoCurrencyById, getTokenById, @@ -53,6 +57,7 @@ export { toCosmosResourcesRaw, fromCosmosResourcesRaw }; export { toAlgorandResourcesRaw, fromAlgorandResourcesRaw }; export { toBitcoinResourcesRaw, fromBitcoinResourcesRaw }; export { toPolkadotResourcesRaw, fromPolkadotResourcesRaw }; +export { toElrondResourcesRaw, fromElrondResourcesRaw }; export function toBalanceHistoryRaw(b: BalanceHistory): BalanceHistoryRaw { return b.map(({ date, value }) => [date.toISOString(), value.toString()]); @@ -648,6 +653,7 @@ export function fromAccountRaw(rawAccount: AccountRaw): Account { algorandResources, syncHash, polkadotResources, + elrondResources, } = rawAccount; const subAccounts = @@ -747,6 +753,9 @@ export function fromAccountRaw(rawAccount: AccountRaw): Account { if (polkadotResources) { res.polkadotResources = fromPolkadotResourcesRaw(polkadotResources); } + if (elrondResources) { + res.elrondResources = fromElrondResourcesRaw(elrondResources); + } return res; } @@ -784,6 +793,7 @@ export function toAccountRaw({ algorandResources, syncHash, polkadotResources, + elrondResources, }: Account): AccountRaw { const res: $Exact = { id, @@ -841,5 +851,8 @@ export function toAccountRaw({ if (polkadotResources) { res.polkadotResources = toPolkadotResourcesRaw(polkadotResources); } + if (elrondResources) { + res.elrondResources = toElrondResourcesRaw(elrondResources); + } return res; } diff --git a/src/env.js b/src/env.js index 97cf160db1..cbd5c5a2ce 100644 --- a/src/env.js +++ b/src/env.js @@ -83,6 +83,11 @@ const envDefinitions = { def: "https://polkadot-sidecar.coin.ledger.com", desc: "Polkadot Sidecar API url", }, + ELROND_API_ENDPOINT: { + parser: stringParser, + def: "https://api.elrond.com", + desc: "Elrond API url", + }, API_STELLAR_HORIZON: { parser: stringParser, def: "https://stellar.coin.ledger.com", diff --git a/src/families/elrond/account.js b/src/families/elrond/account.js new file mode 100644 index 0000000000..d6acb6b095 --- /dev/null +++ b/src/families/elrond/account.js @@ -0,0 +1,50 @@ +// @flow +import invariant from "invariant"; +import { BigNumber } from "bignumber.js"; +import type { Account, Operation, Unit } from "../../types"; +import { getAccountUnit } from "../../account"; +import { formatCurrencyUnit } from "../../currencies"; + +function formatAccountSpecifics(account: Account): string { + const { elrondResources } = account; + invariant(elrondResources, "elrond account expected"); + const unit = getAccountUnit(account); + const formatConfig = { + disableRounding: true, + alwaysShowSign: false, + showCode: true, + }; + + let str = " "; + + if (account.spendableBalance) { + str += + formatCurrencyUnit(unit, account.spendableBalance, formatConfig) + + " spendable. "; + } else { + str += " 0 spendable."; + } + + if (elrondResources.nonce) { + str += "\nonce : " + elrondResources.nonce; + } + + return str; +} + +function formatOperationSpecifics(op: Operation, unit: ?Unit): string { + let str = " "; + + const formatConfig = { + disableRounding: true, + alwaysShowSign: false, + showCode: true, + }; + + return str; +} + +export default { + formatAccountSpecifics, + formatOperationSpecifics, +}; diff --git a/src/families/elrond/api/apiCalls.js b/src/families/elrond/api/apiCalls.js new file mode 100644 index 0000000000..d74fa549dc --- /dev/null +++ b/src/families/elrond/api/apiCalls.js @@ -0,0 +1,157 @@ +import network from "../../../network"; +import { HASH_TRANSACTION, RAW_TRANSACTION } from "../constants"; + +export default class ElrondApi { + constructor(API_URL: String) { + this.API_URL = API_URL; + } + + async getBalance(addr: String) { + const { + data: { balance }, + } = await network({ + method: "GET", + url: `${this.API_URL}/accounts/${addr}`, + }); + + return balance; + } + + async getNonce(addr: String) { + const { + data: { nonce }, + } = await network({ + method: "GET", + url: `${this.API_URL}/accounts/${addr}`, + }); + + return nonce; + } + + async getValidators() { + let data = []; + try { + let { + data: { validators }, + } = await network({ + method: "GET", + url: `${this.API_URL}/validator/statistics`, + }); + data = validators; + } catch (error) { + return data; + } + + return data; + } + + async getNetworkConfig() { + const { + data: { + data: { + config: { + erd_chain_id: chainId, + erd_denomination: denomination, + erd_min_gas_limit: gasLimit, + erd_min_gas_price: gasPrice, + }, + }, + }, + } = await network({ + method: "GET", + url: `${this.API_URL}/network/config`, + }); + + return { chainId, denomination, gasLimit, gasPrice }; + } + + async submit({ operation, signature, signUsingHash }) { + const { chainId, gasLimit, gasPrice } = await this.getNetworkConfig(); + + const transactionType = signUsingHash ? HASH_TRANSACTION : RAW_TRANSACTION; + + const { + senders: [sender], + recipients: [receiver], + value, + } = operation; + + const nonce = await this.getNonce(sender); + + const { + data: { + data: { txHash: hash }, + }, + } = await network({ + method: "POST", + url: `${this.API_URL}/transaction/send`, + data: { + nonce, + value, + receiver, + sender, + gasPrice, + gasLimit, + chainID: chainId, + signature, + ...transactionType, + }, + }); + + return { hash }; + } + + async getHistory(addr: string) { + const { data: transactions } = await network({ + method: "GET", + url: `${this.API_URL}/transactions?condition=should&sender=${addr}&receiver=${addr}`, + }); + + if (!transactions.length) return transactions; //Account does not have any transactions + + return Promise.all( + transactions.map(async (transaction) => { + const { blockHeight, blockHash } = await this.getConfirmedTransaction( + transaction.txHash + ); + + return { ...transaction, blockHash, blockHeight }; + }) + ); + } + + async getBlockchainBlockHeight() { + const { data: transactions } = await network({ + method: "GET", + url: `${this.API_URL}/transactions`, + }); + + let blockHeight; + let index = 0; + while (!blockHeight) { + const confirmedTransaction = await this.getConfirmedTransaction( + transactions[index].txHash + ); + blockHeight = confirmedTransaction.blockHeight; + + index++; + } + + return blockHeight; + } + + async getConfirmedTransaction(txHash: string) { + const { + data: { + data: { + transaction: { hyperblockNonce, blockHash }, + }, + }, + } = await network({ + method: "GET", + url: `${this.API_URL}/transaction/${txHash}`, + }); + + return { blockHeight: hyperblockNonce, blockHash }; + } +} diff --git a/src/families/elrond/api/index.js b/src/families/elrond/api/index.js new file mode 100644 index 0000000000..add27d8be8 --- /dev/null +++ b/src/families/elrond/api/index.js @@ -0,0 +1,8 @@ +export { + getAccount, + getNetworkConfig, + getValidators, + getOperations, + getFees, + submit, +} from "./sdk"; diff --git a/src/families/elrond/api/sdk.js b/src/families/elrond/api/sdk.js new file mode 100644 index 0000000000..c6d26ced81 --- /dev/null +++ b/src/families/elrond/api/sdk.js @@ -0,0 +1,141 @@ +// @flow + +import { BigNumber } from "bignumber.js"; +import ElrondApi from "./apiCalls"; +import type { Transaction } from "../types"; +import type { Operation, OperationType } from "../../../types"; +import { getEnv } from "../../../env"; +import { encodeOperationId } from "../../../operation"; + +const ELROND_API_ENDPOINT = () => getEnv("ELROND_API_ENDPOINT"); + +let api = new ElrondApi(ELROND_API_ENDPOINT()); + +/** + * Get account balances and nonce + */ +export const getAccount = async (addr: string) => { + const balance = await api.getBalance(addr); + const nonce = await api.getNonce(addr); + const blockHeight = await api.getBlockchainBlockHeight(); + + return { + blockHeight, + balance: new BigNumber(balance), + nonce, + }; +}; + +export const getValidators = async () => { + const validators = await api.getValidators(); + return { validators }; +}; + +export const getNetworkConfig = async () => { + const { + chainId, + gasPrice, + gasLimit, + denomination, + } = await api.getNetworkConfig(); + + return { chainId, gasPrice, gasLimit, denomination }; +}; + +/** + * Returns true if account is the signer + */ +function isSender(transaction: Transaction, addr: string): boolean { + return transaction.sender === addr; +} + +/** + * Map transaction to an Operation Type + */ +function getOperationType( + transaction: Transaction, + addr: string +): OperationType { + return isSender(transaction, addr) ? "OUT" : "IN"; +} + +/** + * Map transaction to a correct Operation Value (affecting account balance) + */ +function getOperationValue(transaction: Transaction, addr: string): BigNumber { + return isSender(transaction, addr) + ? BigNumber(transaction.value).plus(transaction.fee) + : BigNumber(transaction.value); +} + +/** + * Map the Elrond history transaction to a Ledger Live Operation + */ +function transactionToOperation( + accountId: string, + addr: string, + transaction: Transaction +): Operation { + const type = getOperationType(transaction, addr); + + return { + id: encodeOperationId(accountId, transaction.txHash, type), + accountId, + fee: BigNumber(transaction.fee || 0), + value: getOperationValue(transaction, addr), + type, + hash: transaction.txHash, + blockHash: transaction.blockHash, + blockHeight: transaction.blockHeight, + date: new Date(transaction.timestamp * 1000), + // extra: getOperationExtra(transaction), + senders: [transaction.sender], + recipients: transaction.receiver ? [transaction.receiver] : [], + transactionSequenceNumber: isSender(transaction, addr) + ? transaction.nonce + : undefined, + hasFailed: + !transaction.status || + transaction.status === "fail" || + transaction.status === "invalid", + }; +} + +/** + * Fetch operation list + */ +export const getOperations = async ( + accountId: string, + addr: string +): Promise => { + const rawTransactions = await api.getHistory(addr); + + if (!rawTransactions) return rawTransactions; + + return rawTransactions.map((transaction) => + transactionToOperation(accountId, addr, transaction) + ); +}; + +/** + * Obtain fees from blockchain + */ +export const getFees = async (unsigned): Promise => { + const { data, gasLimit } = unsigned; + + if (!data) { + return BigNumber(gasLimit * 1000000000); + } else { + return BigNumber((gasLimit + 1500 * data.length) * 1000000000); + } +}; + +/** + * Broadcast blob to blockchain + */ +export const submit = async (blob: string) => { + const { hash, fees } = await api.submit(blob); + + // Transaction hash is likely to be returned + return { hash, fees: BigNumber(fees) }; +}; diff --git a/src/families/elrond/bridge/js.js b/src/families/elrond/bridge/js.js new file mode 100644 index 0000000000..49ab2ab568 --- /dev/null +++ b/src/families/elrond/bridge/js.js @@ -0,0 +1,38 @@ +// @flow +import type { AccountBridge, CurrencyBridge } from "../../../types"; +import type { Transaction } from "../types"; +import { makeAccountBridgeReceive } from "../../../bridge/jsHelpers"; +import { getPreloadStrategy, preload, hydrate } from "../preload"; +import { sync, scanAccounts } from "../js-synchronisation"; +import { + createTransaction, + updateTransaction, + prepareTransaction, +} from "../js-transaction"; +import getTransactionStatus from "../js-getTransactionStatus"; +import estimateMaxSpendable from "../js-estimateMaxSpendable"; +import signOperation from "../js-signOperation"; +import broadcast from "../js-broadcast"; + +const receive = makeAccountBridgeReceive(); + +const currencyBridge: CurrencyBridge = { + getPreloadStrategy, + preload, + hydrate, + scanAccounts, +}; + +const accountBridge: AccountBridge = { + estimateMaxSpendable, + createTransaction, + updateTransaction, + getTransactionStatus, + prepareTransaction, + sync, + receive, + signOperation, + broadcast, +}; + +export default { currencyBridge, accountBridge }; diff --git a/src/families/elrond/cli-transaction.js b/src/families/elrond/cli-transaction.js new file mode 100644 index 0000000000..094d48678e --- /dev/null +++ b/src/families/elrond/cli-transaction.js @@ -0,0 +1,36 @@ +// @flow +import invariant from "invariant"; +import flatMap from "lodash/flatMap"; +import type { Transaction, AccountLike } from "../../types"; + +const options = [ + { + name: "mode", + type: String, + desc: "mode of transaction: send", + }, +]; + +function inferTransactions( + transactions: Array<{ account: AccountLike, transaction: Transaction }>, + opts: Object +): Transaction[] { + return flatMap(transactions, ({ transaction, account }) => { + invariant(transaction.family === "elrond", "elrond family"); + + if (account.type === "Account") { + invariant(account.elrondResources, "unactivated account"); + } + + return { + ...transaction, + family: "elrond", + mode: opts.mode || "send", + }; + }); +} + +export default { + options, + inferTransactions, +}; diff --git a/src/families/elrond/constants.js b/src/families/elrond/constants.js new file mode 100644 index 0000000000..1b9c5a966c --- /dev/null +++ b/src/families/elrond/constants.js @@ -0,0 +1,9 @@ +export const HASH_TRANSACTION = { + version: 2, + options: 1, +}; + +export const RAW_TRANSACTION = { + version: 1, + options: 0, +}; diff --git a/src/families/elrond/errors.js b/src/families/elrond/errors.js new file mode 100644 index 0000000000..4aa317442a --- /dev/null +++ b/src/families/elrond/errors.js @@ -0,0 +1,9 @@ +// @flow +import { createCustomErrorClass } from "@ledgerhq/errors"; + +/** + * Elrond error thrown on a specifc check done on a transaction amount + */ +export const ElrondSpecificError = createCustomErrorClass( + "ElrondSpecificError" +); diff --git a/src/families/elrond/hw-app-elrond/index.js b/src/families/elrond/hw-app-elrond/index.js new file mode 100644 index 0000000000..1f1cc4e018 --- /dev/null +++ b/src/families/elrond/hw-app-elrond/index.js @@ -0,0 +1,200 @@ +//@flow + +import type Transport from "@ledgerhq/hw-transport"; +import BIPPath from "bip32-path"; + +const CHUNK_SIZE = 150; +const CURVE_MASK = 0x80; +const CLA = 0xed; + +const INS = { + GET_VERSION: 0x02, + GET_ADDRESS: 0x03, + SET_ADDRESS: 0x05, +}; + +const SIGN_RAW_TX_INS = 0x04; +const SIGN_HASH_TX_INS = 0x07; +const SIGN_MESSAGE_INS = 0x06; + +const ACTIVE_SIGNERS = [SIGN_RAW_TX_INS, SIGN_HASH_TX_INS, SIGN_MESSAGE_INS]; + +const SW_OK = 0x9000; +const SW_CANCEL = 0x6986; + +export default class Elrond { + transport: Transport<*>; + + constructor(transport: Transport<*>, scrambleKey: string = "eGLD") { + this.transport = transport; + transport.decorateAppAPIMethods( + this, + [ + "getAddress", + "setAddress", + "signTransaction", + "signMessage", + "getAppConfiguration", + ], + scrambleKey + ); + } + + /** + * Get Elrond app configuration. + * + * @return an object with a contractData, accountIndex, addressIndex, version + * @example + * const result = await elrond.getAppConfiguration(); + * const { contractData, accountIndex, addressIndex, version } = result; + */ + async getAppConfiguration(): Promise<{ + version: string, + }> { + const response = await this.transport.send( + CLA, + INS.GET_VERSION, + 0x00, + 0x00 + ); + return { + contractData: response[0], + accountIndex: response[1], + addressIndex: response[2], + version: `${response[3]}.${response[4]}.${response[5]}`, + }; + } + + serializePath(path: Array) { + const buf = Buffer.alloc(8); + + buf.writeUInt32BE(path[3], 0); + buf.writeUInt32BE(path[4], 4); + + return buf; + } + + /** + * Get Elrond address for a given BIP 32 path. + * + * @param path a path in BIP 32 format + * @param display optionally enable or not the display + * @return an object with a address + * @example + * const result = await elrond.getAddress("44'/508'/0'/0'/0'"); + * const { address, returnCode } = result; + */ + async getAddress( + path: string, + display?: boolean + ): Promise<{ + address: string, + }> { + const bipPath = BIPPath.fromString(path).toPathArray(); + + const data = this.serializePath(bipPath); + + const response = await this.transport.send( + CLA, + INS.GET_ADDRESS, + display ? 0x01 : 0x00, + 0x00, + data, + [SW_OK, SW_CANCEL] + ); + + const addressLength = response[0]; + const address = response.slice(1, 1 + addressLength).toString("ascii"); + + return { address }; + } + + /** + * Set Elrond address for a given BIP 32 path. + * + * @param path a path in BIP 32 format + * @param display optionally enable or not the display + * @return an object with a address + * @example + * const result = await elrond.setAddress("44'/508'/0'/0/0"); + * result : Buffer; + */ + async setAddress(path: string, display?: boolean) { + const bipPath = BIPPath.fromString(path).toPathArray(); + const data = this.serializePath(bipPath); + + await this.transport.send( + CLA, + INS.SET_ADDRESS, + display ? 0x01 : 0x00, + 0x00, + data, + [SW_OK, SW_CANCEL] + ); + } + + async signTransaction( + path: string, + message: string, + usingHash: boolean + ): Promise { + const chunks = []; + + const buffer = Buffer.from(message); + + for (let i = 0; i < buffer.length; i += CHUNK_SIZE) { + let end = i + CHUNK_SIZE; + if (i > buffer.length) { + end = buffer.length; + } + chunks.push(buffer.slice(i, end)); + } + + return usingHash + ? this.sign(chunks, SIGN_HASH_TX_INS) + : this.sign(chunks, SIGN_RAW_TX_INS); + } + + async signMessage(message: Buffer): Promise { + return this.sign(message, SIGN_MESSAGE_INS); + } + + async sign(message: Buffer, type: number): Promise { + if (!ACTIVE_SIGNERS.includes(type)) { + throw new Error(`invalid sign instruction called: ${type}`); + } + + const apdus = []; + + message.forEach((data, index) => { + const apdu = { + cla: CLA, + ins: type, + p1: index === 0 ? 0x00 : CURVE_MASK, + p2: CURVE_MASK, + data, + }; + + apdus.push(apdu); + }); + + let response = {}; + for (let apdu of apdus) { + response = await this.transport.send( + apdu.cla, + apdu.ins, + apdu.p1, + apdu.p2, + apdu.data + ); + } + + if (response.length !== 67 || response[0] !== 64) { + throw new Error("invalid signature received from ledger device"); + } + + const signature = response.slice(1, response.length - 2).toString("hex"); + + return signature; + } +} diff --git a/src/families/elrond/hw-getAddress.js b/src/families/elrond/hw-getAddress.js new file mode 100644 index 0000000000..89f8841ae3 --- /dev/null +++ b/src/families/elrond/hw-getAddress.js @@ -0,0 +1,14 @@ +// @flow + +import type { Resolver } from "../../hw/getAddress/types"; +import Elrond from "./hw-app-elrond"; + +const resolver: Resolver = async (transport, { path, verify }) => { + const elrond = new Elrond(transport); + + const { address } = await elrond.getAddress(path, verify); + + return { address, path }; +}; + +export default resolver; diff --git a/src/families/elrond/js-broadcast.js b/src/families/elrond/js-broadcast.js new file mode 100644 index 0000000000..d47f35f5af --- /dev/null +++ b/src/families/elrond/js-broadcast.js @@ -0,0 +1,25 @@ +// @flow +import type { Operation, SignedOperation } from "../../types"; +import { patchOperationWithHash } from "../../operation"; + +import { submit } from "./api"; + +/** + * Broadcast the signed transaction + * @param {signature: string, operation: string} signedOperation + */ +const broadcast = async ({ + signedOperation: { signature, operation }, +}: { + signedOperation: SignedOperation, +}): Promise => { + const { + extra: { signUsingHash }, + } = operation; + + const { hash } = await submit({ operation, signature, signUsingHash }); + + return patchOperationWithHash(operation, hash); +}; + +export default broadcast; diff --git a/src/families/elrond/js-buildTransaction.js b/src/families/elrond/js-buildTransaction.js new file mode 100644 index 0000000000..2669c8c304 --- /dev/null +++ b/src/families/elrond/js-buildTransaction.js @@ -0,0 +1,37 @@ +// @flow +import type { Transaction } from "./types"; +import type { Account } from "../../types"; + +import { getNonce, getNetworkConfigs } from "./logic"; + +import { HASH_TRANSACTION, RAW_TRANSACTION } from "./constants"; + +/** + * + * @param {Account} a + * @param {Transaction} t + */ +export const buildTransaction = async ( + a: Account, + t: Transaction, + signUsingHash: Boolean = true +) => { + const address = a.freshAddress; + const nonce = getNonce(a); + const { gasPrice, gasLimit, chainId } = await getNetworkConfigs(); + const transactionType = signUsingHash ? HASH_TRANSACTION : RAW_TRANSACTION; + + const unsigned = { + nonce, + value: t.amount, + receiver: t.recipient, + sender: address, + gasPrice, + gasLimit, + chainID: chainId, + ...transactionType, + }; + + // Will likely be a call to Elrond SDK + return JSON.stringify(unsigned); +}; diff --git a/src/families/elrond/js-estimateMaxSpendable.js b/src/families/elrond/js-estimateMaxSpendable.js new file mode 100644 index 0000000000..828cbc833f --- /dev/null +++ b/src/families/elrond/js-estimateMaxSpendable.js @@ -0,0 +1,38 @@ +// @flow +import { BigNumber } from "bignumber.js"; + +import type { AccountLike, Account } from "../../types"; +import { getMainAccount } from "../../account"; + +import type { Transaction } from "./types"; + +import { createTransaction } from "./js-transaction"; +import getEstimatedFees from "./js-getFeesForTransaction"; + +/** + * Returns the maximum possible amount for transaction + * + * @param {Object} param - the account, parentAccount and transaction + */ +const estimateMaxSpendable = async ({ + account, + parentAccount, + transaction, +}: { + account: AccountLike, + parentAccount: ?Account, + transaction: ?Transaction, +}): Promise => { + const a = getMainAccount(account, parentAccount); + const t = { + ...createTransaction(), + ...transaction, + amount: a.spendableBalance, + }; + + const fees = await getEstimatedFees({ a, t }); + + return a.spendableBalance.minus(fees); +}; + +export default estimateMaxSpendable; diff --git a/src/families/elrond/js-getFeesForTransaction.js b/src/families/elrond/js-getFeesForTransaction.js new file mode 100644 index 0000000000..e4b018125e --- /dev/null +++ b/src/families/elrond/js-getFeesForTransaction.js @@ -0,0 +1,30 @@ +// @flow +import { BigNumber } from "bignumber.js"; + +import type { Account } from "../../types"; +import type { Transaction } from "./types"; + +import { getFees } from "./api"; +import { buildTransaction } from "./js-buildTransaction"; + +/** + * Fetch the transaction fees for a transaction + * + * @param {Account} a + * @param {Transaction} t + */ +const getEstimatedFees = async ({ + a, + t, + signUsingHash = true, +}: { + a: Account, + t: Transaction, +}): Promise => { + const unsigned = await buildTransaction(a, t, signUsingHash); + const fees = await getFees(JSON.parse(unsigned)); + + return fees; +}; + +export default getEstimatedFees; diff --git a/src/families/elrond/js-getTransactionStatus.js b/src/families/elrond/js-getTransactionStatus.js new file mode 100644 index 0000000000..963e6bf245 --- /dev/null +++ b/src/families/elrond/js-getTransactionStatus.js @@ -0,0 +1,57 @@ +// @flow +import { BigNumber } from "bignumber.js"; +import { + NotEnoughBalance, + RecipientRequired, + InvalidAddress, + FeeNotLoaded, +} from "@ledgerhq/errors"; +import type { Account, TransactionStatus } from "../../types"; +import type { Transaction } from "./types"; + +import { isValidAddress } from "./logic"; + +const getTransactionStatus = async ( + a: Account, + t: Transaction +): Promise => { + const errors = {}; + const warnings = {}; + const useAllAmount = !!t.useAllAmount; + + if (!t.recipient) { + errors.recipient = new RecipientRequired(); + } + + if (!isValidAddress(t.recipient)) { + errors.recipient = new InvalidAddress(); + } + + if (!t.fees) { + errors.fees = new FeeNotLoaded(); + } + + const estimatedFees = t.fees || BigNumber(0); + + const totalSpent = useAllAmount + ? a.balance + : BigNumber(t.amount).plus(estimatedFees); + + const amount = useAllAmount + ? a.balance.minus(estimatedFees) + : BigNumber(t.amount); + + if (totalSpent.gt(a.balance)) { + errors.amount = new NotEnoughBalance(); + } + + return Promise.resolve({ + errors, + warnings, + estimatedFees, + amount, + totalSpent, + }); +}; + +export default getTransactionStatus; diff --git a/src/families/elrond/js-signOperation.js b/src/families/elrond/js-signOperation.js new file mode 100644 index 0000000000..3b5aab782e --- /dev/null +++ b/src/families/elrond/js-signOperation.js @@ -0,0 +1,115 @@ +// @flow +import { BigNumber } from "bignumber.js"; +import { Observable } from "rxjs"; +import { FeeNotLoaded } from "@ledgerhq/errors"; + +import type { Transaction } from "./types"; +import type { Account, Operation, SignOperationEvent } from "../../types"; + +import { open, close } from "../../hw"; +import { encodeOperationId } from "../../operation"; +import Elrond from "./hw-app-elrond"; + +import { buildTransaction } from "./js-buildTransaction"; +import { getNonce, compareVersions } from "./logic"; + +const buildOptimisticOperation = ( + account: Account, + transaction: Transaction, + fee: BigNumber, + signUsingHash: Boolean +): Operation => { + const type = "OUT"; + + const value = BigNumber(transaction.amount); + + const operation: $Exact = { + id: encodeOperationId(account.id, "", type), + hash: "", + type, + value, + fee, + blockHash: null, + blockHeight: account.blockHeight, + senders: [account.freshAddress], + recipients: [transaction.recipient].filter(Boolean), + accountId: account.id, + transactionSequenceNumber: getNonce(account), + date: new Date(), + extra: { + signUsingHash, + }, + }; + + return operation; +}; + +/** + * Sign Transaction with Ledger hardware + */ +const signOperation = ({ + account, + deviceId, + transaction, +}: { + account: Account, + deviceId: *, + transaction: Transaction, +}): Observable => + Observable.create((o) => { + async function main() { + const transport = await open(deviceId); + + try { + if (!transaction.fees) { + throw new FeeNotLoaded(); + } + + const elrond = new Elrond(transport); + + const { version } = await elrond.getAppConfiguration(); + + const signUsingHash = compareVersions(version, "1.0.11") >= 0; + + const unsigned = await buildTransaction( + account, + transaction, + signUsingHash + ); + + o.next({ type: "device-signature-requested" }); + + const r = await elrond.signTransaction( + account.freshAddressPath, + unsigned, + signUsingHash + ); + + o.next({ type: "device-signature-granted" }); + + const operation = buildOptimisticOperation( + account, + transaction, + transaction.fees ?? BigNumber(0), + signUsingHash + ); + + o.next({ + type: "signed", + signedOperation: { + operation, + signature: r, + expirationDate: null, + }, + }); + } finally { + close(transport, deviceId); + } + } + main().then( + () => o.complete(), + (e) => o.error(e) + ); + }); + +export default signOperation; diff --git a/src/families/elrond/js-synchronisation.js b/src/families/elrond/js-synchronisation.js new file mode 100644 index 0000000000..ccd52f2893 --- /dev/null +++ b/src/families/elrond/js-synchronisation.js @@ -0,0 +1,37 @@ +//@flow +import type { Account } from "../../types"; +import type { GetAccountShape } from "../../bridge/jsHelpers"; +import { makeSync, makeScanAccounts, mergeOps } from "../../bridge/jsHelpers"; + +import { getAccount, getOperations } from "./api"; + +const getAccountShape: GetAccountShape = async (info) => { + const { id, address, initialAccount } = info; + const oldOperations = initialAccount?.operations || []; + + // get the current account balance state depending your api implementation + const { blockHeight, balance, nonce } = await getAccount(address); + + // Merge new operations with the previously synced ones + const newOperations = await getOperations(id, address); + const operations = mergeOps(oldOperations, newOperations); + + const shape = { + id, + balance, + spendableBalance: balance, + operationsCount: operations.length, + blockHeight, + elrondResources: { + nonce, + }, + }; + + return { ...shape, operations }; +}; + +const postSync = (initial: Account, parent: Account) => parent; + +export const scanAccounts = makeScanAccounts(getAccountShape); + +export const sync = makeSync(getAccountShape, postSync); diff --git a/src/families/elrond/js-transaction.js b/src/families/elrond/js-transaction.js new file mode 100644 index 0000000000..8f71c5c2fe --- /dev/null +++ b/src/families/elrond/js-transaction.js @@ -0,0 +1,55 @@ +// @flow +import { BigNumber } from "bignumber.js"; +import type { Account } from "../../types"; +import type { Transaction } from "./types"; + +import getEstimatedFees from "./js-getFeesForTransaction"; + +const sameFees = (a, b) => (!a || !b ? false : a === b); + +/** + * Create an empty transaction + * + * @returns {Transaction} + */ +export const createTransaction = (): Transaction => { + return { + family: "elrond", + mode: "send", + amount: BigNumber(0), + recipient: "", + useAllAmount: false, + fees: 50000, + }; +}; + +/** + * Apply patch to transaction + * + * @param {*} t + * @param {*} patch + */ +export const updateTransaction = ( + t: Transaction, + patch: $Shape +) => { + return { ...t, ...patch }; +}; + +/** + * Prepare transaction before checking status + * + * @param {Account} a + * @param {Transaction} t + */ +export const prepareTransaction = async (a: Account, t: Transaction) => { + let fees = t.fees; + + fees = await getEstimatedFees({ a, t }); + + if (!sameFees(t.fees, fees)) { + return { ...t, fees }; + } + + return t; +}; diff --git a/src/families/elrond/logic.js b/src/families/elrond/logic.js new file mode 100644 index 0000000000..a1855a7978 --- /dev/null +++ b/src/families/elrond/logic.js @@ -0,0 +1,71 @@ +// @flow +import type { Account } from "../../types"; + +import { getNetworkConfig } from "./api"; + +export const compareVersions = (versionA: string, versionB: string): number => { + let i, diff; + const regExStrip0 = /(\.0+)+$/; + const segmentsA = versionA.replace(regExStrip0, "").split("."); + const segmentsB = versionB.replace(regExStrip0, "").split("."); + const minVersionLength = Math.min(segmentsA.length, segmentsB.length); + + for (i = 0; i < minVersionLength; i++) { + diff = parseInt(segmentsA[i], 10) - parseInt(segmentsB[i], 10); + if (diff == 0) { + continue; + } + + if (diff < 0) { + return -1; + } + + return 1; + } + + return segmentsA.length - segmentsB.length; +}; + +/** + * Returns true if address is a valid bech32 + * + * @param {string} address + */ +export const isValidAddress = (address: string): boolean => { + if (!address) return false; + + if (!address.startsWith("erd1")) return false; + + if (address.length !== 62) return false; + + return true; +}; + +/** + * Returns nonce for an account + * + * @param {Account} a + */ +export const getNonce = (a: Account): number => { + const lastPendingOp = a.pendingOperations[0]; + + const nonce = Math.max( + a.elrondResources?.nonce || 0, + lastPendingOp && typeof lastPendingOp.transactionSequenceNumber === "number" + ? lastPendingOp.transactionSequenceNumber + 1 + : 0 + ); + + return nonce; +}; + +export const getNetworkConfigs = async () => { + const { + chainId, + gasPrice, + gasLimit, + denomination, + } = await getNetworkConfig(); + + return { chainId, gasPrice, gasLimit, denomination }; +}; diff --git a/src/families/elrond/preload.js b/src/families/elrond/preload.js new file mode 100644 index 0000000000..a53a228e9b --- /dev/null +++ b/src/families/elrond/preload.js @@ -0,0 +1,66 @@ +// @flow +import { Observable, Subject } from "rxjs"; +import { log } from "@ledgerhq/logs"; + +import type { ElrondPreloadData } from "./types"; +import { getValidators } from "./api"; + +const PRELOAD_MAX_AGE = 30 * 60 * 1000; // 30 minutes + +let currentPreloadedData: ElrondPreloadData = { + validators: {}, +}; + +function fromHydratePreloadData(data: mixed): ElrondPreloadData { + let foo = null; + + if (typeof data === "object" && data) { + if (typeof data.validators === "object" && data.validators) { + foo = data.validators.foo || "bar"; + } + } + + return { + validators: { foo }, + }; +} + +const updates = new Subject(); + +export function getCurrentElrondPreloadData(): ElrondPreloadData { + return currentPreloadedData; +} + +export function setElrondPreloadData(data: ElrondPreloadData) { + if (data === currentPreloadedData) return; + + currentPreloadedData = data; + + updates.next(data); +} + +export function getElrondPreloadDataUpdates(): Observable { + return updates.asObservable(); +} + +export const getPreloadStrategy = () => { + return { + preloadMaxAge: PRELOAD_MAX_AGE, + }; +}; + +export const preload = async (): Promise => { + log("elrond/preload", "preloading elrond data..."); + + const validators = (await getValidators()) || []; + + return { validators }; +}; + +export const hydrate = (data: mixed) => { + const hydrated = fromHydratePreloadData(data); + + log("elrond/preload", `hydrated foo with ${hydrated.validators.foo}`); + + setElrondPreloadData(hydrated); +}; diff --git a/src/families/elrond/serialization.js b/src/families/elrond/serialization.js new file mode 100644 index 0000000000..05b458a649 --- /dev/null +++ b/src/families/elrond/serialization.js @@ -0,0 +1,16 @@ +// @flow +import type { ElrondResourcesRaw, ElrondResources } from "./types"; + +export function toElrondResourcesRaw(r: ElrondResources): ElrondResourcesRaw { + const { nonce } = r; + return { + nonce, + }; +} + +export function fromElrondResourcesRaw(r: ElrondResourcesRaw): ElrondResources { + const { nonce } = r; + return { + nonce, + }; +} diff --git a/src/families/elrond/test-dataset.js b/src/families/elrond/test-dataset.js new file mode 100644 index 0000000000..f340f6b9a0 --- /dev/null +++ b/src/families/elrond/test-dataset.js @@ -0,0 +1,58 @@ +// @flow +import type { DatasetTest } from "../../types"; +import type { Transaction } from "./types"; + +type TestTransaction = { + name: string, + transaction: Transaction, + expectedStatus: { + amount: BigNumber, + errors: {}, + warnings: {}, + }, +}; + +export default dataset = { + implementations: ["js"], + currencies: { + elrond: { + scanAccounts: [ + { + name: "elrond seed 1", + apdus: ` + => ed030000080000000000000000 + <= 3e65726431726e71376d386b6472707966616e793466776571747964736b34706778306c3664746c367476636164357765736167727578747336326539726b9000 + => ed030000080000000000000000 + <= 3e65726431726e71376d386b6472707966616e793466776571747964736b34706778306c3664746c367476636164357765736167727578747336326539726b9000 + `, + }, + ], + accounts: [ + { + raw: { + id: `js:2:elrond:erd1rnq7m8kdrpyfany4fweqtydsk4pgx0l6dtl6tvcad5wesagruxts62e9rk:`, + seedIdentifier: + "erd1rnq7m8kdrpyfany4fweqtydsk4pgx0l6dtl6tvcad5wesagruxts62e9rk", + name: "Elrond 1", + derivationMode: "", + index: 0, + freshAddress: + "erd1rnq7m8kdrpyfany4fweqtydsk4pgx0l6dtl6tvcad5wesagruxts62e9rk", + freshAddressPath: "44'/508'/0'/0/0'", + freshAddresses: [], + blockHeight: 0, + operations: [], + pendingOperations: [], + currencyId: "elrond", + unitMagnitude: 10, + lastSyncDate: "", + balance: "299569965", + }, + transactions: [ + // HERE WE WILL INSERT OUR test + ], + }, + ], + }, + }, +}; diff --git a/src/families/elrond/transaction.js b/src/families/elrond/transaction.js new file mode 100644 index 0000000000..ce99bf4054 --- /dev/null +++ b/src/families/elrond/transaction.js @@ -0,0 +1,53 @@ +// @flow +import type { Transaction, TransactionRaw } from "./types"; +import { BigNumber } from "bignumber.js"; +import { + fromTransactionCommonRaw, + toTransactionCommonRaw, +} from "../../transaction/common"; +import type { Account } from "../../types"; +import { getAccountUnit } from "../../account"; +import { formatCurrencyUnit } from "../../currencies"; + +export const formatTransaction = ( + { mode, amount, recipient, useAllAmount }: Transaction, + account: Account +): string => + ` +${mode.toUpperCase()} ${ + useAllAmount + ? "MAX" + : amount.isZero() + ? "" + : " " + + formatCurrencyUnit(getAccountUnit(account), amount, { + showCode: true, + disableRounding: true, + }) + }${recipient ? `\nTO ${recipient}` : ""}`; + +export const fromTransactionRaw = (tr: TransactionRaw): Transaction => { + const common = fromTransactionCommonRaw(tr); + return { + ...common, + family: tr.family, + mode: tr.mode, + fees: tr.fees ? BigNumber(tr.fees) : null, + }; +}; + +export const toTransactionRaw = (t: Transaction): TransactionRaw => { + const common = toTransactionCommonRaw(t); + return { + ...common, + family: t.family, + mode: t.mode, + fees: t.fees?.toString() || null, + }; +}; + +export default { + formatTransaction, + fromTransactionRaw, + toTransactionRaw, +}; diff --git a/src/families/elrond/types.js b/src/families/elrond/types.js new file mode 100644 index 0000000000..ba11a48234 --- /dev/null +++ b/src/families/elrond/types.js @@ -0,0 +1,65 @@ +// @flow +import type { BigNumber } from "bignumber.js"; +import type { + TransactionCommon, + TransactionCommonRaw, +} from "../../types/transaction"; + +export type CoreStatics = {}; + +export type CoreAccountSpecifics = {}; + +export type CoreOperationSpecifics = {}; + +export type CoreCurrencySpecifics = {}; + +export type ElrondResources = {| + nonce: number, +|}; + +/** + * Elrond account resources from raw JSON + */ +export type ElrondResourcesRaw = {| + nonce: number, +|}; + +/** + * Elrond transaction + */ +export type Transaction = {| + ...TransactionCommon, + mode: string, + family: "elrond", + fees: ?BigNumber, +|}; + +/** + * Elrond transaction from a raw JSON + */ +export type TransactionRaw = {| + ...TransactionCommonRaw, + family: "elrond", + mode: string, + fees: ?string, +|}; + +export type ElrondValidator = {| + bls: string, + identity: string, + owner: string, + provider: string, + type: string, + status: string, + nonce: number, + stake: BigNumber, + topUp: BigNumber, + locked: BigNumber, + online: boolean, +|}; + +export type ElrondPreloadData = {| + validators: Object, +|}; + +export const reflect = (_declare: *) => {}; diff --git a/src/generated/account.js b/src/generated/account.js index 54eeb328a7..028dab9852 100644 --- a/src/generated/account.js +++ b/src/generated/account.js @@ -2,11 +2,13 @@ import algorand from "../families/algorand/account.js"; import bitcoin from "../families/bitcoin/account.js"; import cosmos from "../families/cosmos/account.js"; +import elrond from "../families/elrond/account.js"; import polkadot from "../families/polkadot/account.js"; export default { algorand, bitcoin, cosmos, + elrond, polkadot, }; diff --git a/src/generated/bridge/js.js b/src/generated/bridge/js.js index 7318c57b5e..b4edc5922c 100644 --- a/src/generated/bridge/js.js +++ b/src/generated/bridge/js.js @@ -1,4 +1,5 @@ // @flow +import elrond from "../../families/elrond/bridge/js.js"; import ethereum from "../../families/ethereum/bridge/js.js"; import neo from "../../families/neo/bridge/js.js"; import polkadot from "../../families/polkadot/bridge/js.js"; @@ -7,6 +8,7 @@ import stellar from "../../families/stellar/bridge/js.js"; import tron from "../../families/tron/bridge/js.js"; export default { + elrond, ethereum, neo, polkadot, diff --git a/src/generated/cli-transaction.js b/src/generated/cli-transaction.js index 29e56c3ea7..389975c980 100644 --- a/src/generated/cli-transaction.js +++ b/src/generated/cli-transaction.js @@ -2,6 +2,7 @@ import algorand from "../families/algorand/cli-transaction.js"; import bitcoin from "../families/bitcoin/cli-transaction.js"; import cosmos from "../families/cosmos/cli-transaction.js"; +import elrond from "../families/elrond/cli-transaction.js"; import ethereum from "../families/ethereum/cli-transaction.js"; import polkadot from "../families/polkadot/cli-transaction.js"; import ripple from "../families/ripple/cli-transaction.js"; @@ -13,6 +14,7 @@ export default { algorand, bitcoin, cosmos, + elrond, ethereum, polkadot, ripple, diff --git a/src/generated/hw-getAddress.js b/src/generated/hw-getAddress.js index d8e4e76aba..1f5e7eb782 100644 --- a/src/generated/hw-getAddress.js +++ b/src/generated/hw-getAddress.js @@ -2,6 +2,7 @@ import algorand from "../families/algorand/hw-getAddress.js"; import bitcoin from "../families/bitcoin/hw-getAddress.js"; import cosmos from "../families/cosmos/hw-getAddress.js"; +import elrond from "../families/elrond/hw-getAddress.js"; import ethereum from "../families/ethereum/hw-getAddress.js"; import neo from "../families/neo/hw-getAddress.js"; import polkadot from "../families/polkadot/hw-getAddress.js"; @@ -14,6 +15,7 @@ export default { algorand, bitcoin, cosmos, + elrond, ethereum, neo, polkadot, diff --git a/src/generated/test-dataset.js b/src/generated/test-dataset.js index 062c3c5608..d5b1aa3a4b 100644 --- a/src/generated/test-dataset.js +++ b/src/generated/test-dataset.js @@ -2,6 +2,7 @@ import algorand from "../families/algorand/test-dataset.js"; import bitcoin from "../families/bitcoin/test-dataset.js"; import cosmos from "../families/cosmos/test-dataset.js"; +import elrond from "../families/elrond/test-dataset.js"; import ethereum from "../families/ethereum/test-dataset.js"; import polkadot from "../families/polkadot/test-dataset.js"; import ripple from "../families/ripple/test-dataset.js"; @@ -13,6 +14,7 @@ export default { algorand, bitcoin, cosmos, + elrond, ethereum, polkadot, ripple, diff --git a/src/generated/transaction.js b/src/generated/transaction.js index 1ba1440455..0e8de21e1d 100644 --- a/src/generated/transaction.js +++ b/src/generated/transaction.js @@ -2,6 +2,7 @@ import algorand from "../families/algorand/transaction.js"; import bitcoin from "../families/bitcoin/transaction.js"; import cosmos from "../families/cosmos/transaction.js"; +import elrond from "../families/elrond/transaction.js"; import ethereum from "../families/ethereum/transaction.js"; import neo from "../families/neo/transaction.js"; import polkadot from "../families/polkadot/transaction.js"; @@ -14,6 +15,7 @@ export default { algorand, bitcoin, cosmos, + elrond, ethereum, neo, polkadot, diff --git a/src/generated/types.js b/src/generated/types.js index caca7cee53..a0cefb2501 100644 --- a/src/generated/types.js +++ b/src/generated/types.js @@ -24,6 +24,15 @@ import type { Transaction as cosmosTransaction } from "../families/cosmos/types" import type { TransactionRaw as cosmosTransactionRaw } from "../families/cosmos/types"; import type { NetworkInfo as cosmosNetworkInfo } from "../families/cosmos/types"; import type { NetworkInfoRaw as cosmosNetworkInfoRaw } from "../families/cosmos/types"; +import { reflect as elrondReflect } from "../families/elrond/types"; +import type { CoreStatics as CoreStatics_elrond } from "../families/elrond/types"; +import type { CoreAccountSpecifics as CoreAccountSpecifics_elrond } from "../families/elrond/types"; +import type { CoreOperationSpecifics as CoreOperationSpecifics_elrond } from "../families/elrond/types"; +import type { CoreCurrencySpecifics as CoreCurrencySpecifics_elrond } from "../families/elrond/types"; +import type { Transaction as elrondTransaction } from "../families/elrond/types"; +import type { TransactionRaw as elrondTransactionRaw } from "../families/elrond/types"; +import type { NetworkInfo as elrondNetworkInfo } from "../families/elrond/types"; +import type { NetworkInfoRaw as elrondNetworkInfoRaw } from "../families/elrond/types"; import { reflect as ethereumReflect } from "../families/ethereum/types"; import type { CoreStatics as CoreStatics_ethereum } from "../families/ethereum/types"; import type { CoreAccountSpecifics as CoreAccountSpecifics_ethereum } from "../families/ethereum/types"; @@ -90,6 +99,7 @@ export type SpecificStatics = {} & CoreStatics_algorand & CoreStatics_bitcoin & CoreStatics_cosmos +& CoreStatics_elrond & CoreStatics_ethereum & CoreStatics_neo & CoreStatics_polkadot @@ -101,6 +111,7 @@ export type CoreAccountSpecifics = {} & CoreAccountSpecifics_algorand & CoreAccountSpecifics_bitcoin & CoreAccountSpecifics_cosmos +& CoreAccountSpecifics_elrond & CoreAccountSpecifics_ethereum & CoreAccountSpecifics_neo & CoreAccountSpecifics_polkadot @@ -112,6 +123,7 @@ export type CoreOperationSpecifics = {} & CoreOperationSpecifics_algorand & CoreOperationSpecifics_bitcoin & CoreOperationSpecifics_cosmos +& CoreOperationSpecifics_elrond & CoreOperationSpecifics_ethereum & CoreOperationSpecifics_neo & CoreOperationSpecifics_polkadot @@ -123,6 +135,7 @@ export type CoreCurrencySpecifics = {} & CoreCurrencySpecifics_algorand & CoreCurrencySpecifics_bitcoin & CoreCurrencySpecifics_cosmos +& CoreCurrencySpecifics_elrond & CoreCurrencySpecifics_ethereum & CoreCurrencySpecifics_neo & CoreCurrencySpecifics_polkadot @@ -134,6 +147,7 @@ export type Transaction = | algorandTransaction | bitcoinTransaction | cosmosTransaction + | elrondTransaction | ethereumTransaction | neoTransaction | polkadotTransaction @@ -145,6 +159,7 @@ export type TransactionRaw = | algorandTransactionRaw | bitcoinTransactionRaw | cosmosTransactionRaw + | elrondTransactionRaw | ethereumTransactionRaw | neoTransactionRaw | polkadotTransactionRaw @@ -155,6 +170,7 @@ export type TransactionRaw = export type NetworkInfo = | bitcoinNetworkInfo | cosmosNetworkInfo + | elrondNetworkInfo | ethereumNetworkInfo | neoNetworkInfo | rippleNetworkInfo @@ -164,6 +180,7 @@ export type NetworkInfo = export type NetworkInfoRaw = | bitcoinNetworkInfoRaw | cosmosNetworkInfoRaw + | elrondNetworkInfoRaw | ethereumNetworkInfoRaw | neoNetworkInfoRaw | rippleNetworkInfoRaw @@ -174,6 +191,7 @@ export const reflectSpecifics = (declare: *) => [ algorandReflect(declare), bitcoinReflect(declare), cosmosReflect(declare), + elrondReflect(declare), ethereumReflect(declare), neoReflect(declare), polkadotReflect(declare), diff --git a/src/reconciliation.js b/src/reconciliation.js index 3681ffd7ac..1d86aa2e4e 100644 --- a/src/reconciliation.js +++ b/src/reconciliation.js @@ -26,6 +26,7 @@ import { fromBalanceHistoryRawMap, fromAlgorandResourcesRaw, fromPolkadotResourcesRaw, + fromElrondResourcesRaw, } from "./account"; import consoleWarnExpectToEqual from "./consoleWarnExpectToEqual"; @@ -339,6 +340,14 @@ export function patchAccount( changed = true; } + if ( + updatedRaw.elrondResources && + account.elrondResources !== updatedRaw.elrondResources + ) { + next.elrondResources = fromElrondResourcesRaw(updatedRaw.elrondResources); + changed = true; + } + if (!changed) return account; // nothing changed at all return next; diff --git a/src/types/account.js b/src/types/account.js index 29a2d13c0c..04bb7c58a3 100644 --- a/src/types/account.js +++ b/src/types/account.js @@ -21,6 +21,10 @@ import type { PolkadotResources, PolkadotResourcesRaw, } from "../families/polkadot/types"; +import type { + ElrondResources, + ElrondResourcesRaw, +} from "../families/elrond/types"; import type { BalanceHistory, BalanceHistoryRaw, @@ -234,6 +238,7 @@ export type Account = { cosmosResources?: CosmosResources, algorandResources?: AlgorandResources, polkadotResources?: PolkadotResources, + elrondResources?: ElrondResources, // Swap operations linked to this account swapHistory: SwapOperation[], @@ -322,6 +327,7 @@ export type AccountRaw = { cosmosResources?: CosmosResourcesRaw, algorandResources?: AlgorandResourcesRaw, polkadotResources?: PolkadotResourcesRaw, + elrondResources?: ElrondResourcesRaw, swapHistory?: SwapOperationRaw[], syncHash?: string, }; From 63404a5fadbf0d81839f4fa491aa778d37d4fccd Mon Sep 17 00:00:00 2001 From: Pislariu Alexandru Date: Tue, 22 Jun 2021 13:57:38 +0300 Subject: [PATCH 008/127] Incremental synchronisation depending on timestamp --- src/families/elrond/api/apiCalls.js | 5 +++-- src/families/elrond/api/sdk.js | 5 +++-- src/families/elrond/js-synchronisation.js | 7 ++++++- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/families/elrond/api/apiCalls.js b/src/families/elrond/api/apiCalls.js index d74fa549dc..304e5151a5 100644 --- a/src/families/elrond/api/apiCalls.js +++ b/src/families/elrond/api/apiCalls.js @@ -101,10 +101,10 @@ export default class ElrondApi { return { hash }; } - async getHistory(addr: string) { + async getHistory(addr: string, startAt: Number) { const { data: transactions } = await network({ method: "GET", - url: `${this.API_URL}/transactions?condition=should&sender=${addr}&receiver=${addr}`, + url: `${this.API_URL}/transactions?condition=should&sender=${addr}&receiver=${addr}&after=${startAt}`, }); if (!transactions.length) return transactions; //Account does not have any transactions @@ -132,6 +132,7 @@ export default class ElrondApi { const confirmedTransaction = await this.getConfirmedTransaction( transactions[index].txHash ); + blockHeight = confirmedTransaction.blockHeight; index++; diff --git a/src/families/elrond/api/sdk.js b/src/families/elrond/api/sdk.js index c6d26ced81..8030591f70 100644 --- a/src/families/elrond/api/sdk.js +++ b/src/families/elrond/api/sdk.js @@ -106,9 +106,10 @@ function transactionToOperation( */ export const getOperations = async ( accountId: string, - addr: string + addr: string, + startAt: Number ): Promise => { - const rawTransactions = await api.getHistory(addr); + const rawTransactions = await api.getHistory(addr, startAt); if (!rawTransactions) return rawTransactions; diff --git a/src/families/elrond/js-synchronisation.js b/src/families/elrond/js-synchronisation.js index ccd52f2893..8cfe729c36 100644 --- a/src/families/elrond/js-synchronisation.js +++ b/src/families/elrond/js-synchronisation.js @@ -9,11 +9,16 @@ const getAccountShape: GetAccountShape = async (info) => { const { id, address, initialAccount } = info; const oldOperations = initialAccount?.operations || []; + // Needed for incremental synchronisation + const startAt = oldOperations.length + ? (new Date(oldOperations[0].date).getTime() / 1000 || 0) + 1 + : 0; + // get the current account balance state depending your api implementation const { blockHeight, balance, nonce } = await getAccount(address); // Merge new operations with the previously synced ones - const newOperations = await getOperations(id, address); + const newOperations = await getOperations(id, address, startAt); const operations = mergeOps(oldOperations, newOperations); const shape = { From 3d15bb68ac9f8512005ed24efcb5b65ef07eb294 Mon Sep 17 00:00:00 2001 From: Pislariu Alexandru Date: Tue, 22 Jun 2021 14:27:33 +0300 Subject: [PATCH 009/127] Sync with last operation only if is confirmed --- src/families/elrond/js-synchronisation.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/families/elrond/js-synchronisation.js b/src/families/elrond/js-synchronisation.js index 8cfe729c36..3e511452da 100644 --- a/src/families/elrond/js-synchronisation.js +++ b/src/families/elrond/js-synchronisation.js @@ -10,7 +10,7 @@ const getAccountShape: GetAccountShape = async (info) => { const oldOperations = initialAccount?.operations || []; // Needed for incremental synchronisation - const startAt = oldOperations.length + const startAt = oldOperations.length && oldOperations[0].blockHeight ? (new Date(oldOperations[0].date).getTime() / 1000 || 0) + 1 : 0; From ecfb86b19a1d8eb1df53ae847d25a8e5a2ab3c9a Mon Sep 17 00:00:00 2001 From: Pislariu Alexandru Date: Wed, 23 Jun 2021 13:22:03 +0300 Subject: [PATCH 010/127] Unused import --- src/families/elrond/account.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/families/elrond/account.js b/src/families/elrond/account.js index d6acb6b095..9ed25b1349 100644 --- a/src/families/elrond/account.js +++ b/src/families/elrond/account.js @@ -1,6 +1,5 @@ // @flow import invariant from "invariant"; -import { BigNumber } from "bignumber.js"; import type { Account, Operation, Unit } from "../../types"; import { getAccountUnit } from "../../account"; import { formatCurrencyUnit } from "../../currencies"; From 929969f49aea66ae9a858d45b42687bce10f54f6 Mon Sep 17 00:00:00 2001 From: Pislariu Alexandru Date: Wed, 23 Jun 2021 13:22:38 +0300 Subject: [PATCH 011/127] Unnecessary variable --- src/families/elrond/js-getFeesForTransaction.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/families/elrond/js-getFeesForTransaction.js b/src/families/elrond/js-getFeesForTransaction.js index e4b018125e..3aaddc1b0e 100644 --- a/src/families/elrond/js-getFeesForTransaction.js +++ b/src/families/elrond/js-getFeesForTransaction.js @@ -22,9 +22,8 @@ const getEstimatedFees = async ({ t: Transaction, }): Promise => { const unsigned = await buildTransaction(a, t, signUsingHash); - const fees = await getFees(JSON.parse(unsigned)); - return fees; + return await getFees(JSON.parse(unsigned)); }; export default getEstimatedFees; From 71c665e837f3a2b1004e68f555292f9846802900 Mon Sep 17 00:00:00 2001 From: Pislariu Alexandru Date: Wed, 23 Jun 2021 13:22:52 +0300 Subject: [PATCH 012/127] Lint --- src/families/elrond/js-synchronisation.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/families/elrond/js-synchronisation.js b/src/families/elrond/js-synchronisation.js index 3e511452da..b5bbb9e3a3 100644 --- a/src/families/elrond/js-synchronisation.js +++ b/src/families/elrond/js-synchronisation.js @@ -10,9 +10,10 @@ const getAccountShape: GetAccountShape = async (info) => { const oldOperations = initialAccount?.operations || []; // Needed for incremental synchronisation - const startAt = oldOperations.length && oldOperations[0].blockHeight - ? (new Date(oldOperations[0].date).getTime() / 1000 || 0) + 1 - : 0; + const startAt = + oldOperations.length && oldOperations[0].blockHeight + ? (new Date(oldOperations[0].date).getTime() / 1000 || 0) + 1 + : 0; // get the current account balance state depending your api implementation const { blockHeight, balance, nonce } = await getAccount(address); From e874779c46d09c8ae887ebdc322d5eb6d8623232 Mon Sep 17 00:00:00 2001 From: Pislariu Alexandru Date: Wed, 23 Jun 2021 13:23:19 +0300 Subject: [PATCH 013/127] Unnecessary object destructuring --- src/families/elrond/logic.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/families/elrond/logic.js b/src/families/elrond/logic.js index a1855a7978..ee2a153f44 100644 --- a/src/families/elrond/logic.js +++ b/src/families/elrond/logic.js @@ -60,12 +60,5 @@ export const getNonce = (a: Account): number => { }; export const getNetworkConfigs = async () => { - const { - chainId, - gasPrice, - gasLimit, - denomination, - } = await getNetworkConfig(); - - return { chainId, gasPrice, gasLimit, denomination }; + return await getNetworkConfig(); }; From 444d12e68387da7576beb969455cf2b90d03451e Mon Sep 17 00:00:00 2001 From: Pislariu Alexandru Date: Wed, 23 Jun 2021 13:24:11 +0300 Subject: [PATCH 014/127] Account details and blockchain blockHeight --- src/families/elrond/api/apiCalls.js | 40 ++++++++--------------------- 1 file changed, 10 insertions(+), 30 deletions(-) diff --git a/src/families/elrond/api/apiCalls.js b/src/families/elrond/api/apiCalls.js index 304e5151a5..d4c2550feb 100644 --- a/src/families/elrond/api/apiCalls.js +++ b/src/families/elrond/api/apiCalls.js @@ -6,26 +6,15 @@ export default class ElrondApi { this.API_URL = API_URL; } - async getBalance(addr: String) { + async getAccountDetails(addr: String) { const { - data: { balance }, + data: { balance, nonce }, } = await network({ method: "GET", url: `${this.API_URL}/accounts/${addr}`, }); - return balance; - } - - async getNonce(addr: String) { - const { - data: { nonce }, - } = await network({ - method: "GET", - url: `${this.API_URL}/accounts/${addr}`, - }); - - return nonce; + return { balance, nonce }; } async getValidators() { @@ -54,6 +43,7 @@ export default class ElrondApi { erd_denomination: denomination, erd_min_gas_limit: gasLimit, erd_min_gas_price: gasPrice, + erd_gas_per_data_byte: gasPerByte, }, }, }, @@ -62,7 +52,7 @@ export default class ElrondApi { url: `${this.API_URL}/network/config`, }); - return { chainId, denomination, gasLimit, gasPrice }; + return { chainId, denomination, gasLimit, gasPrice, gasPerByte }; } async submit({ operation, signature, signUsingHash }) { @@ -76,7 +66,7 @@ export default class ElrondApi { value, } = operation; - const nonce = await this.getNonce(sender); + const { nonce } = await this.getAccountDetails(sender); const { data: { @@ -121,23 +111,13 @@ export default class ElrondApi { } async getBlockchainBlockHeight() { - const { data: transactions } = await network({ + const { + data: [{ nonce: blockHeight }], + } = await network({ method: "GET", - url: `${this.API_URL}/transactions`, + url: `${this.API_URL}/blocks?shard=4294967295&fields=nonce`, }); - let blockHeight; - let index = 0; - while (!blockHeight) { - const confirmedTransaction = await this.getConfirmedTransaction( - transactions[index].txHash - ); - - blockHeight = confirmedTransaction.blockHeight; - - index++; - } - return blockHeight; } From bf3e1aba9abe9f66da95eecf421376aaaa8143b8 Mon Sep 17 00:00:00 2001 From: Pislariu Alexandru Date: Wed, 23 Jun 2021 13:24:47 +0300 Subject: [PATCH 015/127] Network configs for fees --- src/families/elrond/api/sdk.js | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/src/families/elrond/api/sdk.js b/src/families/elrond/api/sdk.js index 8030591f70..156b8ca2bc 100644 --- a/src/families/elrond/api/sdk.js +++ b/src/families/elrond/api/sdk.js @@ -15,8 +15,7 @@ let api = new ElrondApi(ELROND_API_ENDPOINT()); * Get account balances and nonce */ export const getAccount = async (addr: string) => { - const balance = await api.getBalance(addr); - const nonce = await api.getNonce(addr); + const { balance, nonce } = await api.getAccountDetails(addr); const blockHeight = await api.getBlockchainBlockHeight(); return { @@ -32,14 +31,7 @@ export const getValidators = async () => { }; export const getNetworkConfig = async () => { - const { - chainId, - gasPrice, - gasLimit, - denomination, - } = await api.getNetworkConfig(); - - return { chainId, gasPrice, gasLimit, denomination }; + return await api.getNetworkConfig(); }; /** @@ -122,13 +114,13 @@ export const getOperations = async ( * Obtain fees from blockchain */ export const getFees = async (unsigned): Promise => { - const { data, gasLimit } = unsigned; + const { data } = unsigned; + const { gasLimit, gasPerByte, gasPrice } = await api.getNetworkConfig(); if (!data) { - return BigNumber(gasLimit * 1000000000); - } else { - return BigNumber((gasLimit + 1500 * data.length) * 1000000000); + return BigNumber(gasLimit * gasPrice); } + return BigNumber((gasLimit + gasPerByte * data.length) * gasPrice); }; /** From 2b3ed44f3e29586886d79fbed2c58c2af3802f87 Mon Sep 17 00:00:00 2001 From: Pislariu Alexandru Date: Wed, 23 Jun 2021 16:33:40 +0300 Subject: [PATCH 016/127] Submit transaction --- src/families/elrond/api/index.js | 2 +- src/families/elrond/api/sdk.js | 6 +++--- src/families/elrond/js-broadcast.js | 8 ++++++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/families/elrond/api/index.js b/src/families/elrond/api/index.js index add27d8be8..39b8612dcd 100644 --- a/src/families/elrond/api/index.js +++ b/src/families/elrond/api/index.js @@ -4,5 +4,5 @@ export { getValidators, getOperations, getFees, - submit, + submitTransaction, } from "./sdk"; diff --git a/src/families/elrond/api/sdk.js b/src/families/elrond/api/sdk.js index 156b8ca2bc..dadf8fc6ac 100644 --- a/src/families/elrond/api/sdk.js +++ b/src/families/elrond/api/sdk.js @@ -126,9 +126,9 @@ export const getFees = async (unsigned): Promise => { /** * Broadcast blob to blockchain */ -export const submit = async (blob: string) => { - const { hash, fees } = await api.submit(blob); +export const submitTransaction = async (blob: string) => { + const { hash } = await api.submit(blob); // Transaction hash is likely to be returned - return { hash, fees: BigNumber(fees) }; + return { hash }; }; diff --git a/src/families/elrond/js-broadcast.js b/src/families/elrond/js-broadcast.js index d47f35f5af..1b067270a1 100644 --- a/src/families/elrond/js-broadcast.js +++ b/src/families/elrond/js-broadcast.js @@ -2,7 +2,7 @@ import type { Operation, SignedOperation } from "../../types"; import { patchOperationWithHash } from "../../operation"; -import { submit } from "./api"; +import { submitTransaction } from "./api"; /** * Broadcast the signed transaction @@ -17,7 +17,11 @@ const broadcast = async ({ extra: { signUsingHash }, } = operation; - const { hash } = await submit({ operation, signature, signUsingHash }); + const { hash } = await submitTransaction({ + operation, + signature, + signUsingHash, + }); return patchOperationWithHash(operation, hash); }; From 5100004dfcfd185798acd5196dfb776fe1f41d0a Mon Sep 17 00:00:00 2001 From: Pislariu Alexandru Date: Wed, 23 Jun 2021 16:33:57 +0300 Subject: [PATCH 017/127] Remove call for nonce --- src/families/elrond/api/apiCalls.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/families/elrond/api/apiCalls.js b/src/families/elrond/api/apiCalls.js index d4c2550feb..66f3bd355e 100644 --- a/src/families/elrond/api/apiCalls.js +++ b/src/families/elrond/api/apiCalls.js @@ -64,10 +64,9 @@ export default class ElrondApi { senders: [sender], recipients: [receiver], value, + transactionSequenceNumber: nonce, } = operation; - const { nonce } = await this.getAccountDetails(sender); - const { data: { data: { txHash: hash }, From 6f7caa54f5e6432076c712128554bc2a1e54d3f9 Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Wed, 14 Jul 2021 11:44:00 +0300 Subject: [PATCH 018/127] self transaction warning --- src/families/elrond/errors.js | 6 +++--- src/families/elrond/js-getTransactionStatus.js | 10 ++++++++-- src/families/elrond/logic.js | 6 +++++- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/families/elrond/errors.js b/src/families/elrond/errors.js index 4aa317442a..f152bf6227 100644 --- a/src/families/elrond/errors.js +++ b/src/families/elrond/errors.js @@ -2,8 +2,8 @@ import { createCustomErrorClass } from "@ledgerhq/errors"; /** - * Elrond error thrown on a specifc check done on a transaction amount + * Elrond error thrown on a specifc check done on a transaction recipient and sender address */ -export const ElrondSpecificError = createCustomErrorClass( - "ElrondSpecificError" +export const ElrondSelfTransactionError = createCustomErrorClass( + "ElrondSelfTransactionError" ); diff --git a/src/families/elrond/js-getTransactionStatus.js b/src/families/elrond/js-getTransactionStatus.js index 963e6bf245..b879e405e5 100644 --- a/src/families/elrond/js-getTransactionStatus.js +++ b/src/families/elrond/js-getTransactionStatus.js @@ -8,8 +8,8 @@ import { } from "@ledgerhq/errors"; import type { Account, TransactionStatus } from "../../types"; import type { Transaction } from "./types"; - -import { isValidAddress } from "./logic"; +import { isValidAddress, isSelfTransaction } from "./logic"; +import { ElrondSelfTransactionError } from "./errors"; const getTransactionStatus = async ( a: Account, @@ -23,6 +23,12 @@ const getTransactionStatus = async ( errors.recipient = new RecipientRequired(); } + if (isSelfTransaction(a, t)) { + errors.recipient = new ElrondSelfTransactionError( + "Recipient address is the same as the sender!" + ); + } + if (!isValidAddress(t.recipient)) { errors.recipient = new InvalidAddress(); } diff --git a/src/families/elrond/logic.js b/src/families/elrond/logic.js index ee2a153f44..de2d9f7be0 100644 --- a/src/families/elrond/logic.js +++ b/src/families/elrond/logic.js @@ -1,7 +1,7 @@ // @flow import type { Account } from "../../types"; - import { getNetworkConfig } from "./api"; +import type { Transaction } from "./types"; export const compareVersions = (versionA: string, versionB: string): number => { let i, diff; @@ -41,6 +41,10 @@ export const isValidAddress = (address: string): boolean => { return true; }; +export const isSelfTransaction = (a: Account, t: Transaction): boolean => { + return t.recipient === a.freshAddress; +}; + /** * Returns nonce for an account * From f46af8ae16eeec431f90a2ad2de8e3098baf5f56 Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Mon, 19 Jul 2021 12:09:56 +0300 Subject: [PATCH 019/127] Update changes from base repo --- .ci.env | 2 + .eslintignore | 1 + .github/pull_request_template.md | 19 + .gitignore | 7 + .nvmrc | 2 +- CODEOWNERS | 2 +- CONTRIBUTING.md | 74 +- cli/package.json | 32 +- cli/src/commands-index.js | 2 + .../commands/generateAppJsonFromDataset.js | 193 ++ cli/src/commands/swap.js | 42 +- cli/src/live-common-setup-base.js | 5 + cli/src/live-common-setup.js | 36 + cli/yarn.lock | 3049 ++++++++++------- mobile-test-app/Gemfile.lock | 2 +- mobile-test-app/yarn.lock | 40 +- package.json | 53 +- scripts/build.sh | 3 +- scripts/buildReactFlags.js | 101 + .../__snapshots__/all.libcore.js.snap | 168 +- src/__tests__/accounts/importAccounts.js | 3 + src/__tests__/test-helpers/setup.js | 3 + src/account/ordering.js | 5 +- src/account/serialization.js | 4 + src/api/explorerConfig/index.js | 2 + src/apps/filtering.test.js | 3 + src/apps/hw.js | 7 +- src/apps/support.js | 2 +- src/bridge/mockHelpers.js | 4 +- .../sortByMarketcap.test.js.snap | 14 + src/data/flags/svg/FR.svg | 29 + src/data/flags/svg/JP.svg | 33 + src/data/flags/svg/US.svg | 36 + src/env.js | 40 + src/errors.js | 42 + src/exchange/swap/getExchangeRates.js | 178 +- src/exchange/swap/getKYCStatus.js | 31 + src/exchange/swap/index.js | 125 +- src/exchange/swap/initSwap.js | 3 +- src/exchange/swap/logic.js | 83 +- src/exchange/swap/mock.js | 79 +- src/exchange/swap/submitKYC.js | 33 + src/exchange/swap/types.js | 33 +- src/families/crypto_org/account.js | 58 + src/families/crypto_org/api/index.js | 6 + src/families/crypto_org/api/sdk.js | 234 ++ src/families/crypto_org/api/sdk.types.js | 52 + src/families/crypto_org/bridge/js.js | 37 + src/families/crypto_org/cli-transaction.js | 36 + src/families/crypto_org/errors.js | 14 + src/families/crypto_org/hw-getAddress.js | 18 + src/families/crypto_org/js-broadcast.js | 36 + .../crypto_org/js-buildTransaction.js | 59 + .../crypto_org/js-estimateMaxSpendable.js | 29 + .../crypto_org/js-getFeesForTransaction.js | 14 + .../crypto_org/js-getTransactionStatus.js | 59 + src/families/crypto_org/js-signOperation.js | 179 + src/families/crypto_org/js-synchronisation.js | 51 + src/families/crypto_org/js-transaction.js | 49 + src/families/crypto_org/logic.js | 72 + src/families/crypto_org/serialization.js | 37 + src/families/crypto_org/transaction.js | 49 + src/families/crypto_org/types.js | 56 + src/families/elrond/test-dataset.js | 4 +- src/families/ethereum/modules/compound.js | 72 +- src/families/polkadot/api/bisontrails.js | 19 +- src/families/polkadot/api/common.js | 3 + src/families/polkadot/api/index.js | 1 + src/families/polkadot/api/sidecar.js | 23 +- src/families/polkadot/cache.js | 24 + .../polkadot/deviceTransactionConfig.js | 13 + src/families/polkadot/js-buildTransaction.js | 8 + .../polkadot/js-getTransactionStatus.js | 59 +- src/families/polkadot/js-signOperation.js | 2 + src/families/polkadot/logic.js | 28 +- src/families/polkadot/preload.js | 15 +- src/families/polkadot/specs.js | 7 +- src/families/polkadot/test-dataset.js | 1 + src/families/polkadot/types.js | 1 + src/generated/account.js | 2 + src/generated/bridge/js.js | 2 + src/generated/cli-transaction.js | 2 + src/generated/hw-getAddress.js | 2 + src/generated/transaction.js | 2 + src/generated/types.js | 18 + src/hw/actions/app.js | 17 +- src/hw/actions/initSwap.js | 15 +- src/hw/connectApp.js | 58 +- src/operation.js | 1 + src/platform/CatalogProvider.js | 92 + src/platform/PlatformAppProvider/api/api.js | 30 + .../PlatformAppProvider/api/api.mock.js | 295 ++ src/platform/PlatformAppProvider/api/index.js | 15 + src/platform/PlatformAppProvider/helpers.js | 58 + src/platform/PlatformAppProvider/index.js | 96 + src/platform/PlatformAppProvider/types.js | 23 + src/platform/api/api.js | 30 + src/platform/api/api.mock.js | 295 ++ src/platform/api/index.js | 15 + src/platform/logic.js | 27 + src/platform/types.js | 44 + src/platform/version.js | 18 + src/platform/version.test.js | 7 + src/react.js | 5 + src/reactNative.js | 5 + src/types/operation.js | 1 + src/walletconnect/walletconnect.test.js | 3 + yarn.lock | 1567 +++++---- 108 files changed, 6488 insertions(+), 2307 deletions(-) create mode 100644 .ci.env create mode 100644 .github/pull_request_template.md create mode 100644 cli/src/commands/generateAppJsonFromDataset.js create mode 100644 scripts/buildReactFlags.js create mode 100644 src/data/flags/svg/FR.svg create mode 100644 src/data/flags/svg/JP.svg create mode 100644 src/data/flags/svg/US.svg create mode 100644 src/exchange/swap/getKYCStatus.js create mode 100644 src/exchange/swap/submitKYC.js create mode 100644 src/families/crypto_org/account.js create mode 100644 src/families/crypto_org/api/index.js create mode 100644 src/families/crypto_org/api/sdk.js create mode 100644 src/families/crypto_org/api/sdk.types.js create mode 100644 src/families/crypto_org/bridge/js.js create mode 100644 src/families/crypto_org/cli-transaction.js create mode 100644 src/families/crypto_org/errors.js create mode 100644 src/families/crypto_org/hw-getAddress.js create mode 100644 src/families/crypto_org/js-broadcast.js create mode 100644 src/families/crypto_org/js-buildTransaction.js create mode 100644 src/families/crypto_org/js-estimateMaxSpendable.js create mode 100644 src/families/crypto_org/js-getFeesForTransaction.js create mode 100644 src/families/crypto_org/js-getTransactionStatus.js create mode 100644 src/families/crypto_org/js-signOperation.js create mode 100644 src/families/crypto_org/js-synchronisation.js create mode 100644 src/families/crypto_org/js-transaction.js create mode 100644 src/families/crypto_org/logic.js create mode 100644 src/families/crypto_org/serialization.js create mode 100644 src/families/crypto_org/transaction.js create mode 100644 src/families/crypto_org/types.js create mode 100644 src/platform/CatalogProvider.js create mode 100644 src/platform/PlatformAppProvider/api/api.js create mode 100644 src/platform/PlatformAppProvider/api/api.mock.js create mode 100644 src/platform/PlatformAppProvider/api/index.js create mode 100644 src/platform/PlatformAppProvider/helpers.js create mode 100644 src/platform/PlatformAppProvider/index.js create mode 100644 src/platform/PlatformAppProvider/types.js create mode 100644 src/platform/api/api.js create mode 100644 src/platform/api/api.mock.js create mode 100644 src/platform/api/index.js create mode 100644 src/platform/logic.js create mode 100644 src/platform/version.js create mode 100644 src/platform/version.test.js diff --git a/.ci.env b/.ci.env new file mode 100644 index 0000000000..d774f3f3a6 --- /dev/null +++ b/.ci.env @@ -0,0 +1,2 @@ +# always test on latest conditions +EXPERIMENTAL_EXPLORERS=1 diff --git a/.eslintignore b/.eslintignore index c5d6334a1d..03e188de05 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,4 +1,5 @@ src/data/icons +src/data/flags src/libcore/types/*.js src/families/*/types.js diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000000..f42de4ffa1 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,19 @@ + +## Context (issues, jira) + + + +## Description / Usage + + + + +## Expectations + +- [ ] **Test coverage: The changes of this PR are covered by test.** Unit test were added with mocks when depending on a backend/device. +- [ ] **No impact: The changes of this PR have ZERO impact on the userland.** Meaning, we can use these changes without modifying LLD/LLM at all. It will be a "noop" and the maintainers will be able to bump it without changing anything. + + diff --git a/.gitignore b/.gitignore index 7d2c135d90..6cc32432bd 100644 --- a/.gitignore +++ b/.gitignore @@ -35,6 +35,13 @@ flow-coverage src/data/icons/react src/data/icons/reactNative +# Generated icons +src/data/flags/react +src/data/flags/reactNative + cli/tests/*/output cli/tests/tmp .env + +# Jetbrains +.idea diff --git a/.nvmrc b/.nvmrc index cae54a258e..2ccd0b76bb 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -v12.14.1 +v14.17.1 diff --git a/CODEOWNERS b/CODEOWNERS index b562a58240..7bbe5cf638 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -1 +1 @@ -* @ledgerhq/ledger-live-maintainer +* @ledgerhq/live-maintainer diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 902d2e9270..b494f9ab90 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,71 +1,41 @@ # Contributing -Thanks for considering contributing to Ledger Live! +:+1::tada: First off, thanks for taking the time to contribute! :tada::+1: +This repository hosts `@ledgerhq/live-common` JavaScript library which centralize the business logic work of Ledger Live. -## Opening issues +## JavaScript styleguide -If you find a bug, please feel free to [open an issue](https://github.com/ledgerhq/ledger-live-common/issues). +* ES6+ features. +* [prettier](https://prettier.io/) for formatting convention. You can run `yarn prettier`. +* ESLint is used to enhance code quality. Check with `yarn lint`. +* Flowtype is currently getting used to typecheck the library, but we are currently migrating to TypeScript. -If you taking the time to mention a problem, even a seemingly minor one, it is greatly appreciated, and a totally valid contribution to this project. Thank you! +> NB. for the 3 points above, the best is to have integration of Prettier, +> ESlint, Flowtype in your text editor (there are plugin for most editors). -## Fixing bugs +## Expectations -We love pull requests. Here’s a quick guide: +As documented in the PR template, there are two very important points we require contributors to focus on: -1. [Fork this repository](https://github.com/ledgerhq/ledger-live-common/fork) and then clone it locally: +### Changes have no impact - ```bash - git clone https://github.com/ledgerhq/ledger-live-common - ``` +**The impact of your changes must be made as limited as possible.** -2. Create a topic branch for your changes: +As we want to have the ability to merge things quickly and have small iterations, this can only work if your changes are non-breaking which means they do not require any extra modification in user land side (Ledger Live Desktop, Ledger Live Mobile) **to still make the library works the same way**. - ```bash - git checkout -b fix-for-that-thing - ``` -3. Commit a failing test for the bug: +Of course you may introduce new features for the UI side, it just should not affect the existing work / only affect it in a way that the result of this is "acceptable" and "stable" (e.g. a bugfix is a change, but it's the purpose of the bugfix to fix it). - ```bash - git commit -am "Adds a failing test to demonstrate that thing" - ``` +There are always exception to break this rule, when you do break it however, you need to carefully document it in the PR so we can report that documentation back in the release notes and organise the work load. The complexity of that PR will however be defacto higher and harder with less guarantee to merge. -4. Commit a fix that makes the test pass: +We want to avoid locked situation where we can't merge your work because it's too impacting on userland but you still need that work merged to test against your changes on LLD/LLM. - ```bash - git commit -am "Adds a fix for that thing!" - ``` +Here are a few tips: -5. Run the tests: - - ```bash - npm test - ``` - -6. If everything looks good, push to your fork: - - ```bash - git push origin fix-for-that-thing - ``` - -7. [Submit a pull request.](https://help.github.com/articles/creating-a-pull-request) - -## Features and expectation of ledger-live-common project - -ledger-live-common is the common ground for [Ledger Live desktop](https://github.com/LedgerHQ/ledger-live-desktop) and [Ledger Live mobile](https://github.com/LedgerHQ/ledger-live-mobile). - -It contains most of its core business logic. - -**We try to do as less breaking changes as possible**. What we mean by breaking changes, it means any changes in live-common that would need the userland (Ledger Live Desktop, Ledger Live Mobile) to also change codes to keep making that live-common version to work should be avoided. -Adding new features are ok, but they need to be made as much as possible "not changing" when the userland still uses the old API. - -Here are a few guidelines: -- if you have a completely new rework of an existing stack, it may be wise to have a `v2/` folder, specifically when there is a risk in it. +- When you have a new feature that need changes in the existing work, introduce a new environment variable in `env.js` that will allow you to implement a code branching +- When you have a completely new rework of an existing feature, feel free to make a `v2` folder where the new logic will leave. The existing work will be not impacted and considered a "v1" in which you can also start documentation a **deprecation path** (use JS comments, it will be on maintainer side to organize the deprecation and planning the sunset) - when adding new methods, fields, it should be ok as long as you don't change the main interface. You can ship things "silently" without userland to use it yet. -- Libraries upgrade are the only exception here. -## Expectation of PR information +### Changes must have test coverage and pass the CI -- the impact of each PR needs to be explicitly written. -- code need to be covered by tests. (unit tests, dataset tests or bot tests) -- document everything that userland need to do to upgrade to your changes (if relevant) +As we allow to be very flexible at merging things quickly in live-common, we also expect you to deliver unit tests with the features you deliver or improve the tests when you fix a bug. diff --git a/cli/package.json b/cli/package.json index 7bb55cdf50..65912be551 100644 --- a/cli/package.json +++ b/cli/package.json @@ -1,6 +1,6 @@ { "name": "ledger-live", - "version": "19.10.0", + "version": "20.3.0", "description": "ledger-live CLI version", "repository": { "type": "git", @@ -29,15 +29,15 @@ "@ledgerhq/hw-transport-node-ble": "5.7.0" }, "dependencies": { - "@ledgerhq/cryptoassets": "6.0.2", + "@ledgerhq/cryptoassets": "6.1.0", "@ledgerhq/errors": "6.0.2", - "@ledgerhq/hw-app-btc": "6.0.2", - "@ledgerhq/hw-transport-http": "6.0.2", - "@ledgerhq/hw-transport-mocker": "6.0.0", - "@ledgerhq/hw-transport-node-hid": "6.0.2", - "@ledgerhq/hw-transport-node-speculos": "6.0.2", + "@ledgerhq/hw-app-btc": "6.1.0", + "@ledgerhq/hw-transport-http": "6.1.0", + "@ledgerhq/hw-transport-mocker": "6.1.0", + "@ledgerhq/hw-transport-node-hid": "6.1.0", + "@ledgerhq/hw-transport-node-speculos": "6.1.0", "@ledgerhq/ledger-core": "6.12.3", - "@ledgerhq/live-common": "^19.12.0-rc.2", + "@ledgerhq/live-common": "^20.3.0", "@ledgerhq/logs": "6.0.2", "@walletconnect/client": "^1.4.1", "asciichart": "^1.5.25", @@ -59,16 +59,16 @@ "winston": "^3.3.3" }, "devDependencies": { - "@babel/cli": "^7.13.16", - "@babel/core": "^7.13.16", - "@babel/plugin-proposal-class-properties": "^7.13.0", - "@babel/plugin-proposal-export-default-from": "^7.12.13", - "@babel/plugin-proposal-export-namespace-from": "^7.12.13", + "@babel/cli": "^7.14.5", + "@babel/core": "^7.14.6", + "@babel/plugin-proposal-class-properties": "^7.14.5", + "@babel/plugin-proposal-export-default-from": "^7.14.5", + "@babel/plugin-proposal-export-namespace-from": "^7.14.5", "@babel/plugin-syntax-dynamic-import": "^7.8.3", "@babel/plugin-syntax-import-meta": "^7.10.4", - "@babel/preset-env": "^7.13.15", - "@babel/preset-flow": "^7.13.13", - "@babel/preset-typescript": "^7.13.0", + "@babel/preset-env": "^7.14.7", + "@babel/preset-flow": "^7.14.5", + "@babel/preset-typescript": "^7.14.5", "@types/command-line-args": "^5.0.0", "ts-node": "^9.1.1", "typescript": "^4.2.4" diff --git a/cli/src/commands-index.js b/cli/src/commands-index.js index 0da0345d39..d435129913 100644 --- a/cli/src/commands-index.js +++ b/cli/src/commands-index.js @@ -20,6 +20,7 @@ import estimateMaxSpendable from "./commands/estimateMaxSpendable"; import exportAccounts from "./commands/exportAccounts"; import firmwareRepair from "./commands/firmwareRepair"; import firmwareUpdate from "./commands/firmwareUpdate"; +import generateAppJsonFromDataset from "./commands/generateAppJsonFromDataset"; import generateTestScanAccounts from "./commands/generateTestScanAccounts"; import generateTestTransaction from "./commands/generateTestTransaction"; import genuineCheck from "./commands/genuineCheck"; @@ -71,6 +72,7 @@ export default { exportAccounts, firmwareRepair, firmwareUpdate, + generateAppJsonFromDataset, generateTestScanAccounts, generateTestTransaction, genuineCheck, diff --git a/cli/src/commands/generateAppJsonFromDataset.js b/cli/src/commands/generateAppJsonFromDataset.js new file mode 100644 index 0000000000..b6acee691e --- /dev/null +++ b/cli/src/commands/generateAppJsonFromDataset.js @@ -0,0 +1,193 @@ +// @flow +/* eslint-disable no-console */ +import invariant from "invariant"; +import { reduce, filter, map } from "rxjs/operators"; +import { getCurrencyBridge } from "@ledgerhq/live-common/lib/bridge"; +import { implicitMigration } from "@ledgerhq/live-common/lib/migrations/accounts"; +import { + getCryptoCurrencyById, + setSupportedCurrencies, +} from "@ledgerhq/live-common/lib/currencies"; +import { setPlatformVersion } from "@ledgerhq/live-common/lib/platform/version"; +import datasets from "@ledgerhq/live-common/lib/generated/test-dataset"; +import { mockDeviceWithAPDUs, releaseMockDevice } from "../live-common-setup"; + +setPlatformVersion("0.0.1"); + +setSupportedCurrencies([ + "bitcoin", + "ethereum", + "ripple", + "bitcoin_cash", + "litecoin", + "dash", + "ethereum_classic", + "tezos", + "qtum", + "zcash", + "bitcoin_gold", + "stratis", + "dogecoin", + "digibyte", + "komodo", + "pivx", + "zencash", + "vertcoin", + "peercoin", + "viacoin", + "stakenet", + "stealthcoin", + "decred", + "bitcoin_testnet", + "ethereum_ropsten", + "tron", + "stellar", + "cosmos", + "algorand", + "polkadot", +]); + +const defaultSyncConfig = { + paginationConfig: {}, + blacklistedTokenIds: ["ethereum/erc20/ampleforth"], +}; + +const excluded = [ + "algorand", + "bitcoin", + "bitcoin_cash", + "bitcoin_gold", + "cosmos", + "dash", + "decred", + "digibyte", + "dogecoin", + "ethereum_classic", + "komodo", + "litecoin", + "peercoin", + "pivx", + "polkadot", + "qtum", + "ripple", + "stakenet", + "stellar", + "stealthcoin", + "viacoin", + "vertcoin", + "zcash", + "zencash", +]; + +const appJsonTemplate = { + data: { + SPECTRON_RUN: { + localStorage: { + acceptedTermsVersion: "2019-12-04", + }, + }, + settings: { + hasCompletedOnboarding: true, + counterValue: "USD", + language: "en", + theme: "light", + region: null, + orderAccounts: "balance|desc", + countervalueFirst: false, + autoLockTimeout: 10, + selectedTimeRange: "month", + marketIndicator: "western", + currenciesSettings: {}, + pairExchanges: {}, + developerMode: false, + loaded: true, + shareAnalytics: true, + sentryLogs: true, + lastUsedVersion: "99.99.99", + dismissedBanners: [], + accountsViewMode: "list", + showAccountsHelperBanner: true, + hideEmptyTokenAccounts: false, + sidebarCollapsed: false, + discreetMode: false, + preferredDeviceModel: "nanoS", + hasInstalledApps: true, + carouselVisibility: 99999999999, + hasAcceptedSwapKYC: false, + lastSeenDevice: null, + blacklistedTokenIds: [], + swapAcceptedProviderIds: [], + deepLinkUrl: null, + firstTimeLend: false, + swapProviders: [], + showClearCacheBanner: false, + starredAccountIds: [], + hasPassword: false, + }, + user: { + id: "08cf3393-c5eb-4ea7-92de-0deea22e3971", + }, + countervalues: {}, + accounts: [], + }, +}; + +const extraCurrenciesData = () => { + const data = []; + + Object.keys(datasets).forEach((key) => { + const { currencies } = datasets[key]; + Object.keys(currencies).forEach((k) => { + // TODO: Check why these are not working + if (excluded.includes(k)) { + return; + } + const currency = currencies[k]; + if (!currency.scanAccounts?.length) return; + currency.scanAccounts?.forEach((sa) => { + data.push({ currencyName: k, apdus: sa.apdus }); + }); + }); + }); + + return data; +}; + +const syncAccount = async (data) => { + const currency = getCryptoCurrencyById(data.currencyName); + const bridge = getCurrencyBridge(currency); + const deviceId = mockDeviceWithAPDUs(data.apdus); + invariant(currency, `could not find currency for ${data.currencyName}`); + try { + const accounts = await bridge + .scanAccounts({ + currency, + deviceId, + syncConfig: defaultSyncConfig, + }) + .pipe( + filter((e) => e.type === "discovered"), + map((e) => e.account), + reduce((all, a) => all.concat(a), []) + ) + .toPromise(); + return implicitMigration(accounts); + } finally { + releaseMockDevice(deviceId); + } +}; + +async function main() { + const data = extraCurrenciesData(); + const accounts = await Promise.all(data.flatMap((d) => syncAccount(d))); + const flatten = accounts.flat(); + appJsonTemplate.data.accounts = flatten; + console.log(JSON.stringify(appJsonTemplate)); +} + +export default { + description: + "Extract accounts from test datasets and print a sample app.json usable for tests", + args: [], + job: () => main(), +}; diff --git a/cli/src/commands/swap.js b/cli/src/commands/swap.js index 20c04ee1ae..1aae484fc4 100644 --- a/cli/src/commands/swap.js +++ b/cli/src/commands/swap.js @@ -24,18 +24,30 @@ type SwapJobOpts = ScanCommonOpts & { amount: string, useAllAmount: boolean, useFloat: boolean, + wyreUserId?: string, _unknown: any, deviceId: string, tokenId: string, }; const exec = async (opts: SwapJobOpts) => { - const { amount, useAllAmount, tokenId, useFloat, deviceId = "" } = opts; + const { + amount, + useAllAmount, + tokenId, + useFloat, + wyreUserId = "", + deviceId = "", + } = opts; invariant( amount || useAllAmount, `✖ amount in satoshis is needed or --useAllAmount ` ); invariant(opts._unknown, `✖ second account information is missing`); + invariant( + !wyreUserId || wyreUserId.length === 14, + "Provider wyre user id is not valid" + ); //Remove suffix from arguments before passing them to sync. const secondAccountOpts: ScanCommonOpts & { @@ -169,11 +181,24 @@ const exec = async (opts: SwapJobOpts) => { toParentAccount, }; - const exchangeRates = await getExchangeRates(exchange, transaction); - - const exchangeRate = exchangeRates.find( - (er) => er.tradeMethod === (useFloat ? "float" : "fixed") + const exchangeRates = await getExchangeRates( + exchange, + transaction, + wyreUserId ); + + console.log({ exchangeRates }); + + const exchangeRate = exchangeRates.find((er) => { + if ( + er.tradeMethod === (useFloat ? "float" : "fixed") && + (!wyreUserId || er.provider === "wyre") + ) { + return true; + } + return false; + }); + invariant(exchangeRate, `✖ No valid rate available`); console.log( `Using first ${useFloat ? "float" : "fixed"} rate:\n`, @@ -189,6 +214,7 @@ const exec = async (opts: SwapJobOpts) => { exchangeRate, transaction, deviceId, + userId: wyreUserId, }) .pipe( tap((e) => { @@ -259,6 +285,12 @@ export default { type: Boolean, desc: "Attempt to send all using the emulated max amount calculation", }, + { + name: "wyreUserId", + alias: "w", + type: String, + desc: "If provided, will attempt to use Wyre provider with given userId", + }, { name: "tokenId", alias: "t", diff --git a/cli/src/live-common-setup-base.js b/cli/src/live-common-setup-base.js index 245222d3fd..b48827fddc 100644 --- a/cli/src/live-common-setup-base.js +++ b/cli/src/live-common-setup-base.js @@ -6,6 +6,9 @@ import simple from "@ledgerhq/live-common/lib/logs/simple"; import { listen } from "@ledgerhq/logs"; import implementLibcore from "@ledgerhq/live-common/lib/libcore/platforms/nodejs"; import { setSupportedCurrencies } from "@ledgerhq/live-common/lib/currencies"; +import { setPlatformVersion } from "@ledgerhq/live-common/lib/platform/version"; + +setPlatformVersion("0.0.1"); setSupportedCurrencies([ "bitcoin", @@ -40,6 +43,8 @@ setSupportedCurrencies([ "algorand", "polkadot", "cosmos_testnet", + "crypto_org", + "crypto_org_croeseid", ]); for (const k in process.env) setEnvUnsafe(k, process.env[k]); diff --git a/cli/src/live-common-setup.js b/cli/src/live-common-setup.js index ed0d3a34b1..ff7fadef20 100644 --- a/cli/src/live-common-setup.js +++ b/cli/src/live-common-setup.js @@ -4,6 +4,11 @@ export * from "./live-common-setup-base"; import React from "react"; import { connect } from "react-redux"; +import invariant from "invariant"; +import { + createTransportReplayer, + RecordStore, +} from "@ledgerhq/hw-transport-mocker"; import Transport from "@ledgerhq/hw-transport"; import { NotEnoughBalance } from "@ledgerhq/errors"; import { log } from "@ledgerhq/logs"; @@ -34,6 +39,37 @@ implementLibcore({ dbPath: process.env.LIBCORE_DB_PATH || "./dbdata", }); +let idCounter = 0; +const mockTransports = {}; +const recordStores = {}; + +export function releaseMockDevice(id: string) { + const store = recordStores[id]; + invariant(store, "MockDevice does not exist (%s)", id); + store.ensureQueueEmpty(); + delete recordStores[id]; + delete mockTransports[id]; +} + +export function mockDeviceWithAPDUs(apdus: string) { + const id = `mock:${++idCounter}`; + const store = RecordStore.fromString(apdus); + recordStores[id] = store; + mockTransports[id] = createTransportReplayer(store); + return id; +} + +registerTransportModule({ + id: "mock", + open: (id) => { + if (id in mockTransports) { + const Tr = mockTransports[id]; + return Tr.open(); + } + }, + disconnect: () => Promise.resolve(), +}); + if (process.env.DEVICE_PROXY_URL) { const Tr = createTransportHttp(process.env.DEVICE_PROXY_URL.split("|")); registerTransportModule({ diff --git a/cli/yarn.lock b/cli/yarn.lock index 5c0a936488..b36296922e 100644 --- a/cli/yarn.lock +++ b/cli/yarn.lock @@ -2,10 +2,10 @@ # yarn lockfile v1 -"@babel/cli@^7.13.16": - version "7.13.16" - resolved "https://registry.yarnpkg.com/@babel/cli/-/cli-7.13.16.tgz#9d372e943ced0cc291f068204a9b010fd9cfadbc" - integrity sha512-cL9tllhqvsQ6r1+d9Invf7nNXg/3BlfL1vvvL/AdH9fZ2l5j0CeBcoq6UjsqHpvyN1v5nXSZgqJZoGeK+ZOAbw== +"@babel/cli@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/cli/-/cli-7.14.5.tgz#9551b194f02360729de6060785bbdcce52c69f0a" + integrity sha512-poegjhRvXHWO0EAsnYajwYZuqcz7gyfxwfaecUESxDujrqOivf3zrjFbub8IJkrqEaz3fvJWh001EzxBub54fg== dependencies: commander "^4.0.1" convert-source-map "^1.1.0" @@ -15,35 +15,35 @@ slash "^2.0.0" source-map "^0.5.0" optionalDependencies: - "@nicolo-ribaudo/chokidar-2" "2.1.8-no-fsevents" + "@nicolo-ribaudo/chokidar-2" "2.1.8-no-fsevents.2" chokidar "^3.4.0" -"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.8.3": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.13.tgz#dcfc826beef65e75c50e21d3837d7d95798dd658" - integrity sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g== - dependencies: - "@babel/highlight" "^7.12.13" - -"@babel/compat-data@^7.13.11", "@babel/compat-data@^7.13.15", "@babel/compat-data@^7.13.8": - version "7.13.15" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.13.15.tgz#7e8eea42d0b64fda2b375b22d06c605222e848f4" - integrity sha512-ltnibHKR1VnrU4ymHyQ/CXtNXI6yZC0oJThyW78Hft8XndANwi+9H+UIklBDraIjFEJzw8wmcM427oDd9KS5wA== - -"@babel/core@^7.13.16": - version "7.13.16" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.13.16.tgz#7756ab24396cc9675f1c3fcd5b79fcce192ea96a" - integrity sha512-sXHpixBiWWFti0AV2Zq7avpTasr6sIAu7Y396c608541qAU2ui4a193m0KSQmfPSKFZLnQ3cvlKDOm3XkuXm3Q== - dependencies: - "@babel/code-frame" "^7.12.13" - "@babel/generator" "^7.13.16" - "@babel/helper-compilation-targets" "^7.13.16" - "@babel/helper-module-transforms" "^7.13.14" - "@babel/helpers" "^7.13.16" - "@babel/parser" "^7.13.16" - "@babel/template" "^7.12.13" - "@babel/traverse" "^7.13.15" - "@babel/types" "^7.13.16" +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.14.5", "@babel/code-frame@^7.8.3": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.14.5.tgz#23b08d740e83f49c5e59945fbf1b43e80bbf4edb" + integrity sha512-9pzDqyc6OLDaqe+zbACgFkb6fKMNG6CObKpnYXChRsvYGyEdc7CA2BaqeOM+vOtCS5ndmJicPJhKAwYRI6UfFw== + dependencies: + "@babel/highlight" "^7.14.5" + +"@babel/compat-data@^7.13.11", "@babel/compat-data@^7.14.5", "@babel/compat-data@^7.14.7": + version "7.14.7" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.14.7.tgz#7b047d7a3a89a67d2258dc61f604f098f1bc7e08" + integrity sha512-nS6dZaISCXJ3+518CWiBfEr//gHyMO02uDxBkXTKZDN5POruCnOZ1N4YBRZDCabwF8nZMWBpRxIicmXtBs+fvw== + +"@babel/core@^7.14.6": + version "7.14.6" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.14.6.tgz#e0814ec1a950032ff16c13a2721de39a8416fcab" + integrity sha512-gJnOEWSqTk96qG5BoIrl5bVtc23DCycmIePPYnamY9RboYdI4nFy5vAQMSl81O5K/W0sLDWfGysnOECC+KUUCA== + dependencies: + "@babel/code-frame" "^7.14.5" + "@babel/generator" "^7.14.5" + "@babel/helper-compilation-targets" "^7.14.5" + "@babel/helper-module-transforms" "^7.14.5" + "@babel/helpers" "^7.14.6" + "@babel/parser" "^7.14.6" + "@babel/template" "^7.14.5" + "@babel/traverse" "^7.14.5" + "@babel/types" "^7.14.5" convert-source-map "^1.7.0" debug "^4.1.0" gensync "^1.0.0-beta.2" @@ -51,63 +51,64 @@ semver "^6.3.0" source-map "^0.5.0" -"@babel/generator@^7.13.16": - version "7.13.16" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.13.16.tgz#0befc287031a201d84cdfc173b46b320ae472d14" - integrity sha512-grBBR75UnKOcUWMp8WoDxNsWCFl//XCK6HWTrBQKTr5SV9f5g0pNOjdyzi/DTBv12S9GnYPInIXQBTky7OXEMg== +"@babel/generator@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.14.5.tgz#848d7b9f031caca9d0cd0af01b063f226f52d785" + integrity sha512-y3rlP+/G25OIX3mYKKIOlQRcqj7YgrvHxOLbVmyLJ9bPmi5ttvUmpydVjcFjZphOktWuA7ovbx91ECloWTfjIA== dependencies: - "@babel/types" "^7.13.16" + "@babel/types" "^7.14.5" jsesc "^2.5.1" source-map "^0.5.0" -"@babel/helper-annotate-as-pure@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.12.13.tgz#0f58e86dfc4bb3b1fcd7db806570e177d439b6ab" - integrity sha512-7YXfX5wQ5aYM/BOlbSccHDbuXXFPxeoUmfWtz8le2yTkTZc+BxsiEnENFoi2SlmA8ewDkG2LgIMIVzzn2h8kfw== +"@babel/helper-annotate-as-pure@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.14.5.tgz#7bf478ec3b71726d56a8ca5775b046fc29879e61" + integrity sha512-EivH9EgBIb+G8ij1B2jAwSH36WnGvkQSEC6CkX/6v6ZFlw5fVOHvsgGF4uiEHO2GzMvunZb6tDLQEQSdrdocrA== dependencies: - "@babel/types" "^7.12.13" + "@babel/types" "^7.14.5" -"@babel/helper-builder-binary-assignment-operator-visitor@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.12.13.tgz#6bc20361c88b0a74d05137a65cac8d3cbf6f61fc" - integrity sha512-CZOv9tGphhDRlVjVkAgm8Nhklm9RzSmWpX2my+t7Ua/KT616pEzXsQCjinzvkRvHWJ9itO4f296efroX23XCMA== +"@babel/helper-builder-binary-assignment-operator-visitor@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.14.5.tgz#b939b43f8c37765443a19ae74ad8b15978e0a191" + integrity sha512-YTA/Twn0vBXDVGJuAX6PwW7x5zQei1luDDo2Pl6q1qZ7hVNl0RZrhHCQG/ArGpR29Vl7ETiB8eJyrvpuRp300w== dependencies: - "@babel/helper-explode-assignable-expression" "^7.12.13" - "@babel/types" "^7.12.13" + "@babel/helper-explode-assignable-expression" "^7.14.5" + "@babel/types" "^7.14.5" -"@babel/helper-compilation-targets@^7.13.0", "@babel/helper-compilation-targets@^7.13.13", "@babel/helper-compilation-targets@^7.13.16", "@babel/helper-compilation-targets@^7.13.8": - version "7.13.16" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.13.16.tgz#6e91dccf15e3f43e5556dffe32d860109887563c" - integrity sha512-3gmkYIrpqsLlieFwjkGgLaSHmhnvlAYzZLlYVjlW+QwI+1zE17kGxuJGmIqDQdYp56XdmGeD+Bswx0UTyG18xA== +"@babel/helper-compilation-targets@^7.13.0", "@babel/helper-compilation-targets@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.14.5.tgz#7a99c5d0967911e972fe2c3411f7d5b498498ecf" + integrity sha512-v+QtZqXEiOnpO6EYvlImB6zCD2Lel06RzOPzmkz/D/XgQiUu3C/Jb1LOqSt/AIA34TYi/Q+KlT8vTQrgdxkbLw== dependencies: - "@babel/compat-data" "^7.13.15" - "@babel/helper-validator-option" "^7.12.17" - browserslist "^4.14.5" + "@babel/compat-data" "^7.14.5" + "@babel/helper-validator-option" "^7.14.5" + browserslist "^4.16.6" semver "^6.3.0" -"@babel/helper-create-class-features-plugin@^7.13.0": - version "7.13.0" - resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.13.0.tgz#28d04ad9cfbd1ed1d8b988c9ea7b945263365846" - integrity sha512-twwzhthM4/+6o9766AW2ZBHpIHPSGrPGk1+WfHiu13u/lBnggXGNYCpeAyVfNwGDKfkhEDp+WOD/xafoJ2iLjA== +"@babel/helper-create-class-features-plugin@^7.14.5", "@babel/helper-create-class-features-plugin@^7.14.6": + version "7.14.6" + resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.14.6.tgz#f114469b6c06f8b5c59c6c4e74621f5085362542" + integrity sha512-Z6gsfGofTxH/+LQXqYEK45kxmcensbzmk/oi8DmaQytlQCgqNZt9XQF8iqlI/SeXWVjaMNxvYvzaYw+kh42mDg== dependencies: - "@babel/helper-function-name" "^7.12.13" - "@babel/helper-member-expression-to-functions" "^7.13.0" - "@babel/helper-optimise-call-expression" "^7.12.13" - "@babel/helper-replace-supers" "^7.13.0" - "@babel/helper-split-export-declaration" "^7.12.13" + "@babel/helper-annotate-as-pure" "^7.14.5" + "@babel/helper-function-name" "^7.14.5" + "@babel/helper-member-expression-to-functions" "^7.14.5" + "@babel/helper-optimise-call-expression" "^7.14.5" + "@babel/helper-replace-supers" "^7.14.5" + "@babel/helper-split-export-declaration" "^7.14.5" -"@babel/helper-create-regexp-features-plugin@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.12.13.tgz#0996d370a92896c612ae41a4215544bd152579c0" - integrity sha512-XC+kiA0J3at6E85dL5UnCYfVOcIZ834QcAY0TIpgUVnz0zDzg+0TtvZTnJ4g9L1dPRGe30Qi03XCIS4tYCLtqw== +"@babel/helper-create-regexp-features-plugin@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.14.5.tgz#c7d5ac5e9cf621c26057722fb7a8a4c5889358c4" + integrity sha512-TLawwqpOErY2HhWbGJ2nZT5wSkR192QpN+nBg1THfBfftrlvOh+WbhrxXCH4q4xJ9Gl16BGPR/48JA+Ryiho/A== dependencies: - "@babel/helper-annotate-as-pure" "^7.12.13" + "@babel/helper-annotate-as-pure" "^7.14.5" regexpu-core "^4.7.1" -"@babel/helper-define-polyfill-provider@^0.2.0": - version "0.2.0" - resolved "https://registry.yarnpkg.com/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.2.0.tgz#a640051772045fedaaecc6f0c6c69f02bdd34bf1" - integrity sha512-JT8tHuFjKBo8NnaUbblz7mIu1nnvUDiHVjXXkulZULyidvo/7P6TY7+YqpV37IfF+KUFxmlK04elKtGKXaiVgw== +"@babel/helper-define-polyfill-provider@^0.2.2": + version "0.2.3" + resolved "https://registry.yarnpkg.com/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.2.3.tgz#0525edec5094653a282688d34d846e4c75e9c0b6" + integrity sha512-RH3QDAfRMzj7+0Nqu5oqgO5q9mFtQEVvCRsi8qCEfzLR9p2BHfn5FzhSB2oj1fF7I2+DcTORkYaQ6aTR9Cofew== dependencies: "@babel/helper-compilation-targets" "^7.13.0" "@babel/helper-module-imports" "^7.12.13" @@ -118,285 +119,303 @@ resolve "^1.14.2" semver "^6.1.2" -"@babel/helper-explode-assignable-expression@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.12.13.tgz#0e46990da9e271502f77507efa4c9918d3d8634a" - integrity sha512-5loeRNvMo9mx1dA/d6yNi+YiKziJZFylZnCo1nmFF4qPU4yJ14abhWESuSMQSlQxWdxdOFzxXjk/PpfudTtYyw== +"@babel/helper-explode-assignable-expression@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.14.5.tgz#8aa72e708205c7bb643e45c73b4386cdf2a1f645" + integrity sha512-Htb24gnGJdIGT4vnRKMdoXiOIlqOLmdiUYpAQ0mYfgVT/GDm8GOYhgi4GL+hMKrkiPRohO4ts34ELFsGAPQLDQ== dependencies: - "@babel/types" "^7.12.13" - -"@babel/helper-function-name@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.12.13.tgz#93ad656db3c3c2232559fd7b2c3dbdcbe0eb377a" - integrity sha512-TZvmPn0UOqmvi5G4vvw0qZTpVptGkB1GL61R6lKvrSdIxGm5Pky7Q3fpKiIkQCAtRCBUwB0PaThlx9vebCDSwA== - dependencies: - "@babel/helper-get-function-arity" "^7.12.13" - "@babel/template" "^7.12.13" - "@babel/types" "^7.12.13" - -"@babel/helper-get-function-arity@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz#bc63451d403a3b3082b97e1d8b3fe5bd4091e583" - integrity sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg== + "@babel/types" "^7.14.5" + +"@babel/helper-function-name@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.14.5.tgz#89e2c474972f15d8e233b52ee8c480e2cfcd50c4" + integrity sha512-Gjna0AsXWfFvrAuX+VKcN/aNNWonizBj39yGwUzVDVTlMYJMK2Wp6xdpy72mfArFq5uK+NOuexfzZlzI1z9+AQ== dependencies: - "@babel/types" "^7.12.13" - -"@babel/helper-hoist-variables@^7.13.0": - version "7.13.0" - resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.13.0.tgz#5d5882e855b5c5eda91e0cadc26c6e7a2c8593d8" - integrity sha512-0kBzvXiIKfsCA0y6cFEIJf4OdzfpRuNk4+YTeHZpGGc666SATFKTz6sRncwFnQk7/ugJ4dSrCj6iJuvW4Qwr2g== - dependencies: - "@babel/traverse" "^7.13.0" - "@babel/types" "^7.13.0" - -"@babel/helper-member-expression-to-functions@^7.13.0", "@babel/helper-member-expression-to-functions@^7.13.12": - version "7.13.12" - resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.13.12.tgz#dfe368f26d426a07299d8d6513821768216e6d72" - integrity sha512-48ql1CLL59aKbU94Y88Xgb2VFy7a95ykGRbJJaaVv+LX5U8wFpLfiGXJJGUozsmA1oEh/o5Bp60Voq7ACyA/Sw== - dependencies: - "@babel/types" "^7.13.12" - -"@babel/helper-module-imports@^7.12.13", "@babel/helper-module-imports@^7.13.12": - version "7.13.12" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.13.12.tgz#c6a369a6f3621cb25da014078684da9196b61977" - integrity sha512-4cVvR2/1B693IuOvSI20xqqa/+bl7lqAMR59R4iu39R9aOX8/JoYY1sFaNvUMyMBGnHdwvJgUrzNLoUZxXypxA== - dependencies: - "@babel/types" "^7.13.12" - -"@babel/helper-module-transforms@^7.13.0", "@babel/helper-module-transforms@^7.13.14": - version "7.13.14" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.13.14.tgz#e600652ba48ccb1641775413cb32cfa4e8b495ef" - integrity sha512-QuU/OJ0iAOSIatyVZmfqB0lbkVP0kDRiKj34xy+QNsnVZi/PA6BoSoreeqnxxa9EHFAIL0R9XOaAR/G9WlIy5g== - dependencies: - "@babel/helper-module-imports" "^7.13.12" - "@babel/helper-replace-supers" "^7.13.12" - "@babel/helper-simple-access" "^7.13.12" - "@babel/helper-split-export-declaration" "^7.12.13" - "@babel/helper-validator-identifier" "^7.12.11" - "@babel/template" "^7.12.13" - "@babel/traverse" "^7.13.13" - "@babel/types" "^7.13.14" - -"@babel/helper-optimise-call-expression@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.12.13.tgz#5c02d171b4c8615b1e7163f888c1c81c30a2aaea" - integrity sha512-BdWQhoVJkp6nVjB7nkFWcn43dkprYauqtk++Py2eaf/GRDFm5BxRqEIZCiHlZUGAVmtwKcsVL1dC68WmzeFmiA== - dependencies: - "@babel/types" "^7.12.13" - -"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.13.0", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": - version "7.13.0" - resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz#806526ce125aed03373bc416a828321e3a6a33af" - integrity sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ== + "@babel/helper-get-function-arity" "^7.14.5" + "@babel/template" "^7.14.5" + "@babel/types" "^7.14.5" -"@babel/helper-remap-async-to-generator@^7.13.0": - version "7.13.0" - resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.13.0.tgz#376a760d9f7b4b2077a9dd05aa9c3927cadb2209" - integrity sha512-pUQpFBE9JvC9lrQbpX0TmeNIy5s7GnZjna2lhhcHC7DzgBs6fWn722Y5cfwgrtrqc7NAJwMvOa0mKhq6XaE4jg== +"@babel/helper-get-function-arity@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.14.5.tgz#25fbfa579b0937eee1f3b805ece4ce398c431815" + integrity sha512-I1Db4Shst5lewOM4V+ZKJzQ0JGGaZ6VY1jYvMghRjqs6DWgxLCIyFt30GlnKkfUeFLpJt2vzbMVEXVSXlIFYUg== dependencies: - "@babel/helper-annotate-as-pure" "^7.12.13" - "@babel/helper-wrap-function" "^7.13.0" - "@babel/types" "^7.13.0" + "@babel/types" "^7.14.5" + +"@babel/helper-hoist-variables@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.14.5.tgz#e0dd27c33a78e577d7c8884916a3e7ef1f7c7f8d" + integrity sha512-R1PXiz31Uc0Vxy4OEOm07x0oSjKAdPPCh3tPivn/Eo8cvz6gveAeuyUUPB21Hoiif0uoPQSSdhIPS3352nvdyQ== + dependencies: + "@babel/types" "^7.14.5" -"@babel/helper-replace-supers@^7.12.13", "@babel/helper-replace-supers@^7.13.0", "@babel/helper-replace-supers@^7.13.12": - version "7.13.12" - resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.13.12.tgz#6442f4c1ad912502481a564a7386de0c77ff3804" - integrity sha512-Gz1eiX+4yDO8mT+heB94aLVNCL+rbuT2xy4YfyNqu8F+OI6vMvJK891qGBTqL9Uc8wxEvRW92Id6G7sDen3fFw== - dependencies: - "@babel/helper-member-expression-to-functions" "^7.13.12" - "@babel/helper-optimise-call-expression" "^7.12.13" - "@babel/traverse" "^7.13.0" - "@babel/types" "^7.13.12" - -"@babel/helper-simple-access@^7.12.13", "@babel/helper-simple-access@^7.13.12": - version "7.13.12" - resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.13.12.tgz#dd6c538afb61819d205a012c31792a39c7a5eaf6" - integrity sha512-7FEjbrx5SL9cWvXioDbnlYTppcZGuCY6ow3/D5vMggb2Ywgu4dMrpTJX0JdQAIcRRUElOIxF3yEooa9gUb9ZbA== - dependencies: - "@babel/types" "^7.13.12" - -"@babel/helper-skip-transparent-expression-wrappers@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.12.1.tgz#462dc63a7e435ade8468385c63d2b84cce4b3cbf" - integrity sha512-Mf5AUuhG1/OCChOJ/HcADmvcHM42WJockombn8ATJG3OnyiSxBK/Mm5x78BQWvmtXZKHgbjdGL2kin/HOLlZGA== - dependencies: - "@babel/types" "^7.12.1" - -"@babel/helper-split-export-declaration@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz#e9430be00baf3e88b0e13e6f9d4eaf2136372b05" - integrity sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg== - dependencies: - "@babel/types" "^7.12.13" - -"@babel/helper-validator-identifier@^7.12.11": - version "7.12.11" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz#c9a1f021917dcb5ccf0d4e453e399022981fc9ed" - integrity sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw== - -"@babel/helper-validator-option@^7.12.17": - version "7.12.17" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.12.17.tgz#d1fbf012e1a79b7eebbfdc6d270baaf8d9eb9831" - integrity sha512-TopkMDmLzq8ngChwRlyjR6raKD6gMSae4JdYDB8bByKreQgG0RBTuKe9LRxW3wFtUnjxOPRKBDwEH6Mg5KeDfw== - -"@babel/helper-wrap-function@^7.13.0": - version "7.13.0" - resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.13.0.tgz#bdb5c66fda8526ec235ab894ad53a1235c79fcc4" - integrity sha512-1UX9F7K3BS42fI6qd2A4BjKzgGjToscyZTdp1DjknHLCIvpgne6918io+aL5LXFcER/8QWiwpoY902pVEqgTXA== - dependencies: - "@babel/helper-function-name" "^7.12.13" - "@babel/template" "^7.12.13" - "@babel/traverse" "^7.13.0" - "@babel/types" "^7.13.0" - -"@babel/helpers@^7.13.16": - version "7.13.17" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.13.17.tgz#b497c7a00e9719d5b613b8982bda6ed3ee94caf6" - integrity sha512-Eal4Gce4kGijo1/TGJdqp3WuhllaMLSrW6XcL0ulyUAQOuxHcCafZE8KHg9857gcTehsm/v7RcOx2+jp0Ryjsg== - dependencies: - "@babel/template" "^7.12.13" - "@babel/traverse" "^7.13.17" - "@babel/types" "^7.13.17" - -"@babel/highlight@^7.12.13", "@babel/highlight@^7.9.0": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.12.13.tgz#8ab538393e00370b26271b01fa08f7f27f2e795c" - integrity sha512-kocDQvIbgMKlWxXe9fof3TQ+gkIPOUSEYhJjqUjvKMez3krV7vbzYCDq39Oj11UAVK7JqPVGQPlgE85dPNlQww== - dependencies: - "@babel/helper-validator-identifier" "^7.12.11" +"@babel/helper-member-expression-to-functions@^7.14.5": + version "7.14.7" + resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.14.7.tgz#97e56244beb94211fe277bd818e3a329c66f7970" + integrity sha512-TMUt4xKxJn6ccjcOW7c4hlwyJArizskAhoSTOCkA0uZ+KghIaci0Qg9R043kUMWI9mtQfgny+NQ5QATnZ+paaA== + dependencies: + "@babel/types" "^7.14.5" + +"@babel/helper-module-imports@^7.12.13", "@babel/helper-module-imports@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.14.5.tgz#6d1a44df6a38c957aa7c312da076429f11b422f3" + integrity sha512-SwrNHu5QWS84XlHwGYPDtCxcA0hrSlL2yhWYLgeOc0w7ccOl2qv4s/nARI0aYZW+bSwAL5CukeXA47B/1NKcnQ== + dependencies: + "@babel/types" "^7.14.5" + +"@babel/helper-module-transforms@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.14.5.tgz#7de42f10d789b423eb902ebd24031ca77cb1e10e" + integrity sha512-iXpX4KW8LVODuAieD7MzhNjmM6dzYY5tfRqT+R9HDXWl0jPn/djKmA+G9s/2C2T9zggw5tK1QNqZ70USfedOwA== + dependencies: + "@babel/helper-module-imports" "^7.14.5" + "@babel/helper-replace-supers" "^7.14.5" + "@babel/helper-simple-access" "^7.14.5" + "@babel/helper-split-export-declaration" "^7.14.5" + "@babel/helper-validator-identifier" "^7.14.5" + "@babel/template" "^7.14.5" + "@babel/traverse" "^7.14.5" + "@babel/types" "^7.14.5" + +"@babel/helper-optimise-call-expression@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.14.5.tgz#f27395a8619e0665b3f0364cddb41c25d71b499c" + integrity sha512-IqiLIrODUOdnPU9/F8ib1Fx2ohlgDhxnIDU7OEVi+kAbEZcyiF7BLU8W6PfvPi9LzztjS7kcbzbmL7oG8kD6VA== + dependencies: + "@babel/types" "^7.14.5" + +"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.13.0", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.14.5.tgz#5ac822ce97eec46741ab70a517971e443a70c5a9" + integrity sha512-/37qQCE3K0vvZKwoK4XU/irIJQdIfCJuhU5eKnNxpFDsOkgFaUAwbv+RYw6eYgsC0E4hS7r5KqGULUogqui0fQ== + +"@babel/helper-remap-async-to-generator@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.14.5.tgz#51439c913612958f54a987a4ffc9ee587a2045d6" + integrity sha512-rLQKdQU+HYlxBwQIj8dk4/0ENOUEhA/Z0l4hN8BexpvmSMN9oA9EagjnhnDpNsRdWCfjwa4mn/HyBXO9yhQP6A== + dependencies: + "@babel/helper-annotate-as-pure" "^7.14.5" + "@babel/helper-wrap-function" "^7.14.5" + "@babel/types" "^7.14.5" + +"@babel/helper-replace-supers@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.14.5.tgz#0ecc0b03c41cd567b4024ea016134c28414abb94" + integrity sha512-3i1Qe9/8x/hCHINujn+iuHy+mMRLoc77b2nI9TB0zjH1hvn9qGlXjWlggdwUcju36PkPCy/lpM7LLUdcTyH4Ow== + dependencies: + "@babel/helper-member-expression-to-functions" "^7.14.5" + "@babel/helper-optimise-call-expression" "^7.14.5" + "@babel/traverse" "^7.14.5" + "@babel/types" "^7.14.5" + +"@babel/helper-simple-access@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.14.5.tgz#66ea85cf53ba0b4e588ba77fc813f53abcaa41c4" + integrity sha512-nfBN9xvmCt6nrMZjfhkl7i0oTV3yxR4/FztsbOASyTvVcoYd0TRHh7eMLdlEcCqobydC0LAF3LtC92Iwxo0wyw== + dependencies: + "@babel/types" "^7.14.5" + +"@babel/helper-skip-transparent-expression-wrappers@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.14.5.tgz#96f486ac050ca9f44b009fbe5b7d394cab3a0ee4" + integrity sha512-dmqZB7mrb94PZSAOYtr+ZN5qt5owZIAgqtoTuqiFbHFtxgEcmQlRJVI+bO++fciBunXtB6MK7HrzrfcAzIz2NQ== + dependencies: + "@babel/types" "^7.14.5" + +"@babel/helper-split-export-declaration@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.14.5.tgz#22b23a54ef51c2b7605d851930c1976dd0bc693a" + integrity sha512-hprxVPu6e5Kdp2puZUmvOGjaLv9TCe58E/Fl6hRq4YiVQxIcNvuq6uTM2r1mT/oPskuS9CgR+I94sqAYv0NGKA== + dependencies: + "@babel/types" "^7.14.5" + +"@babel/helper-validator-identifier@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.5.tgz#d0f0e277c512e0c938277faa85a3968c9a44c0e8" + integrity sha512-5lsetuxCLilmVGyiLEfoHBRX8UCFD+1m2x3Rj97WrW3V7H3u4RWRXA4evMjImCsin2J2YT0QaVDGf+z8ondbAg== + +"@babel/helper-validator-option@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.14.5.tgz#6e72a1fff18d5dfcb878e1e62f1a021c4b72d5a3" + integrity sha512-OX8D5eeX4XwcroVW45NMvoYaIuFI+GQpA2a8Gi+X/U/cDUIRsV37qQfF905F0htTRCREQIB4KqPeaveRJUl3Ow== + +"@babel/helper-wrap-function@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.14.5.tgz#5919d115bf0fe328b8a5d63bcb610f51601f2bff" + integrity sha512-YEdjTCq+LNuNS1WfxsDCNpgXkJaIyqco6DAelTUjT4f2KIWC1nBcaCaSdHTBqQVLnTBexBcVcFhLSU1KnYuePQ== + dependencies: + "@babel/helper-function-name" "^7.14.5" + "@babel/template" "^7.14.5" + "@babel/traverse" "^7.14.5" + "@babel/types" "^7.14.5" + +"@babel/helpers@^7.14.6": + version "7.14.6" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.14.6.tgz#5b58306b95f1b47e2a0199434fa8658fa6c21635" + integrity sha512-yesp1ENQBiLI+iYHSJdoZKUtRpfTlL1grDIX9NRlAVppljLw/4tTyYupIB7uIYmC3stW/imAv8EqaKaS/ibmeA== + dependencies: + "@babel/template" "^7.14.5" + "@babel/traverse" "^7.14.5" + "@babel/types" "^7.14.5" + +"@babel/highlight@^7.14.5", "@babel/highlight@^7.9.0": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.14.5.tgz#6861a52f03966405001f6aa534a01a24d99e8cd9" + integrity sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg== + dependencies: + "@babel/helper-validator-identifier" "^7.14.5" chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.12.13", "@babel/parser@^7.13.16": - version "7.13.16" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.13.16.tgz#0f18179b0448e6939b1f3f5c4c355a3a9bcdfd37" - integrity sha512-6bAg36mCwuqLO0hbR+z7PHuqWiCeP7Dzg73OpQwsAB1Eb8HnGEz5xYBzCfbu+YjoaJsJs+qheDxVAuqbt3ILEw== +"@babel/parser@^7.14.5", "@babel/parser@^7.14.6", "@babel/parser@^7.14.7": + version "7.14.7" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.14.7.tgz#6099720c8839ca865a2637e6c85852ead0bdb595" + integrity sha512-X67Z5y+VBJuHB/RjwECp8kSl5uYi0BvRbNeWqkaJCVh+LiTPl19WBUfG627psSgp9rSf6ojuXghQM3ha6qHHdA== -"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.13.12": - version "7.13.12" - resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.13.12.tgz#a3484d84d0b549f3fc916b99ee4783f26fabad2a" - integrity sha512-d0u3zWKcoZf379fOeJdr1a5WPDny4aOFZ6hlfKivgK0LY7ZxNfoaHL2fWwdGtHyVvra38FC+HVYkO+byfSA8AQ== +"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.14.5.tgz#4b467302e1548ed3b1be43beae2cc9cf45e0bb7e" + integrity sha512-ZoJS2XCKPBfTmL122iP6NM9dOg+d4lc9fFk3zxc8iDjvt8Pk4+TlsHSKhIPf6X+L5ORCdBzqMZDjL/WHj7WknQ== dependencies: - "@babel/helper-plugin-utils" "^7.13.0" - "@babel/helper-skip-transparent-expression-wrappers" "^7.12.1" - "@babel/plugin-proposal-optional-chaining" "^7.13.12" + "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-skip-transparent-expression-wrappers" "^7.14.5" + "@babel/plugin-proposal-optional-chaining" "^7.14.5" -"@babel/plugin-proposal-async-generator-functions@^7.13.15": - version "7.13.15" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.13.15.tgz#80e549df273a3b3050431b148c892491df1bcc5b" - integrity sha512-VapibkWzFeoa6ubXy/NgV5U2U4MVnUlvnx6wo1XhlsaTrLYWE0UFpDQsVrmn22q5CzeloqJ8gEMHSKxuee6ZdA== +"@babel/plugin-proposal-async-generator-functions@^7.14.7": + version "7.14.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.14.7.tgz#784a48c3d8ed073f65adcf30b57bcbf6c8119ace" + integrity sha512-RK8Wj7lXLY3bqei69/cc25gwS5puEc3dknoFPFbqfy3XxYQBQFvu4ioWpafMBAB+L9NyptQK4nMOa5Xz16og8Q== dependencies: - "@babel/helper-plugin-utils" "^7.13.0" - "@babel/helper-remap-async-to-generator" "^7.13.0" + "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-remap-async-to-generator" "^7.14.5" "@babel/plugin-syntax-async-generators" "^7.8.4" -"@babel/plugin-proposal-class-properties@^7.13.0": - version "7.13.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.13.0.tgz#146376000b94efd001e57a40a88a525afaab9f37" - integrity sha512-KnTDjFNC1g+45ka0myZNvSBFLhNCLN+GeGYLDEA8Oq7MZ6yMgfLoIRh86GRT0FjtJhZw8JyUskP9uvj5pHM9Zg== +"@babel/plugin-proposal-class-properties@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.14.5.tgz#40d1ee140c5b1e31a350f4f5eed945096559b42e" + integrity sha512-q/PLpv5Ko4dVc1LYMpCY7RVAAO4uk55qPwrIuJ5QJ8c6cVuAmhu7I/49JOppXL6gXf7ZHzpRVEUZdYoPLM04Gg== dependencies: - "@babel/helper-create-class-features-plugin" "^7.13.0" - "@babel/helper-plugin-utils" "^7.13.0" + "@babel/helper-create-class-features-plugin" "^7.14.5" + "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-proposal-dynamic-import@^7.13.8": - version "7.13.8" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.13.8.tgz#876a1f6966e1dec332e8c9451afda3bebcdf2e1d" - integrity sha512-ONWKj0H6+wIRCkZi9zSbZtE/r73uOhMVHh256ys0UzfM7I3d4n+spZNWjOnJv2gzopumP2Wxi186vI8N0Y2JyQ== +"@babel/plugin-proposal-class-static-block@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-static-block/-/plugin-proposal-class-static-block-7.14.5.tgz#158e9e10d449c3849ef3ecde94a03d9f1841b681" + integrity sha512-KBAH5ksEnYHCegqseI5N9skTdxgJdmDoAOc0uXa+4QMYKeZD0w5IARh4FMlTNtaHhbB8v+KzMdTgxMMzsIy6Yg== dependencies: - "@babel/helper-plugin-utils" "^7.13.0" + "@babel/helper-create-class-features-plugin" "^7.14.5" + "@babel/helper-plugin-utils" "^7.14.5" + "@babel/plugin-syntax-class-static-block" "^7.14.5" + +"@babel/plugin-proposal-dynamic-import@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.14.5.tgz#0c6617df461c0c1f8fff3b47cd59772360101d2c" + integrity sha512-ExjiNYc3HDN5PXJx+bwC50GIx/KKanX2HiggnIUAYedbARdImiCU4RhhHfdf0Kd7JNXGpsBBBCOm+bBVy3Gb0g== + dependencies: + "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-dynamic-import" "^7.8.3" -"@babel/plugin-proposal-export-default-from@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-export-default-from/-/plugin-proposal-export-default-from-7.12.13.tgz#f110284108a9b2b96f01b15b3be9e54c2610a989" - integrity sha512-idIsBT+DGXdOHL82U+8bwX4goHm/z10g8sGGrQroh+HCRcm7mDv/luaGdWJQMTuCX2FsdXS7X0Nyyzp4znAPJA== +"@babel/plugin-proposal-export-default-from@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-export-default-from/-/plugin-proposal-export-default-from-7.14.5.tgz#8931a6560632c650f92a8e5948f6e73019d6d321" + integrity sha512-T8KZ5abXvKMjF6JcoXjgac3ElmXf0AWzJwi2O/42Jk+HmCky3D9+i1B7NPP1FblyceqTevKeV/9szeikFoaMDg== dependencies: - "@babel/helper-plugin-utils" "^7.12.13" - "@babel/plugin-syntax-export-default-from" "^7.12.13" + "@babel/helper-plugin-utils" "^7.14.5" + "@babel/plugin-syntax-export-default-from" "^7.14.5" -"@babel/plugin-proposal-export-namespace-from@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.12.13.tgz#393be47a4acd03fa2af6e3cde9b06e33de1b446d" - integrity sha512-INAgtFo4OnLN3Y/j0VwAgw3HDXcDtX+C/erMvWzuV9v71r7urb6iyMXu7eM9IgLr1ElLlOkaHjJ0SbCmdOQ3Iw== +"@babel/plugin-proposal-export-namespace-from@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.14.5.tgz#dbad244310ce6ccd083072167d8cea83a52faf76" + integrity sha512-g5POA32bXPMmSBu5Dx/iZGLGnKmKPc5AiY7qfZgurzrCYgIztDlHFbznSNCoQuv57YQLnQfaDi7dxCtLDIdXdA== dependencies: - "@babel/helper-plugin-utils" "^7.12.13" + "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-export-namespace-from" "^7.8.3" -"@babel/plugin-proposal-json-strings@^7.13.8": - version "7.13.8" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.13.8.tgz#bf1fb362547075afda3634ed31571c5901afef7b" - integrity sha512-w4zOPKUFPX1mgvTmL/fcEqy34hrQ1CRcGxdphBc6snDnnqJ47EZDIyop6IwXzAC8G916hsIuXB2ZMBCExC5k7Q== +"@babel/plugin-proposal-json-strings@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.14.5.tgz#38de60db362e83a3d8c944ac858ddf9f0c2239eb" + integrity sha512-NSq2fczJYKVRIsUJyNxrVUMhB27zb7N7pOFGQOhBKJrChbGcgEAqyZrmZswkPk18VMurEeJAaICbfm57vUeTbQ== dependencies: - "@babel/helper-plugin-utils" "^7.13.0" + "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-json-strings" "^7.8.3" -"@babel/plugin-proposal-logical-assignment-operators@^7.13.8": - version "7.13.8" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.13.8.tgz#93fa78d63857c40ce3c8c3315220fd00bfbb4e1a" - integrity sha512-aul6znYB4N4HGweImqKn59Su9RS8lbUIqxtXTOcAGtNIDczoEFv+l1EhmX8rUBp3G1jMjKJm8m0jXVp63ZpS4A== +"@babel/plugin-proposal-logical-assignment-operators@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.14.5.tgz#6e6229c2a99b02ab2915f82571e0cc646a40c738" + integrity sha512-YGn2AvZAo9TwyhlLvCCWxD90Xq8xJ4aSgaX3G5D/8DW94L8aaT+dS5cSP+Z06+rCJERGSr9GxMBZ601xoc2taw== dependencies: - "@babel/helper-plugin-utils" "^7.13.0" + "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" -"@babel/plugin-proposal-nullish-coalescing-operator@^7.13.8": - version "7.13.8" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.13.8.tgz#3730a31dafd3c10d8ccd10648ed80a2ac5472ef3" - integrity sha512-iePlDPBn//UhxExyS9KyeYU7RM9WScAG+D3Hhno0PLJebAEpDZMocbDe64eqynhNAnwz/vZoL/q/QB2T1OH39A== +"@babel/plugin-proposal-nullish-coalescing-operator@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.14.5.tgz#ee38589ce00e2cc59b299ec3ea406fcd3a0fdaf6" + integrity sha512-gun/SOnMqjSb98Nkaq2rTKMwervfdAoz6NphdY0vTfuzMfryj+tDGb2n6UkDKwez+Y8PZDhE3D143v6Gepp4Hg== dependencies: - "@babel/helper-plugin-utils" "^7.13.0" + "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" -"@babel/plugin-proposal-numeric-separator@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.12.13.tgz#bd9da3188e787b5120b4f9d465a8261ce67ed1db" - integrity sha512-O1jFia9R8BUCl3ZGB7eitaAPu62TXJRHn7rh+ojNERCFyqRwJMTmhz+tJ+k0CwI6CLjX/ee4qW74FSqlq9I35w== +"@babel/plugin-proposal-numeric-separator@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.14.5.tgz#83631bf33d9a51df184c2102a069ac0c58c05f18" + integrity sha512-yiclALKe0vyZRZE0pS6RXgjUOt87GWv6FYa5zqj15PvhOGFO69R5DusPlgK/1K5dVnCtegTiWu9UaBSrLLJJBg== dependencies: - "@babel/helper-plugin-utils" "^7.12.13" + "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-numeric-separator" "^7.10.4" -"@babel/plugin-proposal-object-rest-spread@^7.13.8": - version "7.13.8" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.13.8.tgz#5d210a4d727d6ce3b18f9de82cc99a3964eed60a" - integrity sha512-DhB2EuB1Ih7S3/IRX5AFVgZ16k3EzfRbq97CxAVI1KSYcW+lexV8VZb7G7L8zuPVSdQMRn0kiBpf/Yzu9ZKH0g== +"@babel/plugin-proposal-object-rest-spread@^7.14.7": + version "7.14.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.14.7.tgz#5920a2b3df7f7901df0205974c0641b13fd9d363" + integrity sha512-082hsZz+sVabfmDWo1Oct1u1AgbKbUAyVgmX4otIc7bdsRgHBXwTwb3DpDmD4Eyyx6DNiuz5UAATT655k+kL5g== dependencies: - "@babel/compat-data" "^7.13.8" - "@babel/helper-compilation-targets" "^7.13.8" - "@babel/helper-plugin-utils" "^7.13.0" + "@babel/compat-data" "^7.14.7" + "@babel/helper-compilation-targets" "^7.14.5" + "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-object-rest-spread" "^7.8.3" - "@babel/plugin-transform-parameters" "^7.13.0" + "@babel/plugin-transform-parameters" "^7.14.5" -"@babel/plugin-proposal-optional-catch-binding@^7.13.8": - version "7.13.8" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.13.8.tgz#3ad6bd5901506ea996fc31bdcf3ccfa2bed71107" - integrity sha512-0wS/4DUF1CuTmGo+NiaHfHcVSeSLj5S3e6RivPTg/2k3wOv3jO35tZ6/ZWsQhQMvdgI7CwphjQa/ccarLymHVA== +"@babel/plugin-proposal-optional-catch-binding@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.14.5.tgz#939dd6eddeff3a67fdf7b3f044b5347262598c3c" + integrity sha512-3Oyiixm0ur7bzO5ybNcZFlmVsygSIQgdOa7cTfOYCMY+wEPAYhZAJxi3mixKFCTCKUhQXuCTtQ1MzrpL3WT8ZQ== dependencies: - "@babel/helper-plugin-utils" "^7.13.0" + "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" -"@babel/plugin-proposal-optional-chaining@^7.13.12": - version "7.13.12" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.13.12.tgz#ba9feb601d422e0adea6760c2bd6bbb7bfec4866" - integrity sha512-fcEdKOkIB7Tf4IxrgEVeFC4zeJSTr78no9wTdBuZZbqF64kzllU0ybo2zrzm7gUQfxGhBgq4E39oRs8Zx/RMYQ== +"@babel/plugin-proposal-optional-chaining@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.14.5.tgz#fa83651e60a360e3f13797eef00b8d519695b603" + integrity sha512-ycz+VOzo2UbWNI1rQXxIuMOzrDdHGrI23fRiz/Si2R4kv2XZQ1BK8ccdHwehMKBlcH/joGW/tzrUmo67gbJHlQ== dependencies: - "@babel/helper-plugin-utils" "^7.13.0" - "@babel/helper-skip-transparent-expression-wrappers" "^7.12.1" + "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-skip-transparent-expression-wrappers" "^7.14.5" "@babel/plugin-syntax-optional-chaining" "^7.8.3" -"@babel/plugin-proposal-private-methods@^7.13.0": - version "7.13.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.13.0.tgz#04bd4c6d40f6e6bbfa2f57e2d8094bad900ef787" - integrity sha512-MXyyKQd9inhx1kDYPkFRVOBXQ20ES8Pto3T7UZ92xj2mY0EVD8oAVzeyYuVfy/mxAdTSIayOvg+aVzcHV2bn6Q== +"@babel/plugin-proposal-private-methods@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.14.5.tgz#37446495996b2945f30f5be5b60d5e2aa4f5792d" + integrity sha512-838DkdUA1u+QTCplatfq4B7+1lnDa/+QMI89x5WZHBcnNv+47N8QEj2k9I2MUU9xIv8XJ4XvPCviM/Dj7Uwt9g== dependencies: - "@babel/helper-create-class-features-plugin" "^7.13.0" - "@babel/helper-plugin-utils" "^7.13.0" + "@babel/helper-create-class-features-plugin" "^7.14.5" + "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-proposal-unicode-property-regex@^7.12.13", "@babel/plugin-proposal-unicode-property-regex@^7.4.4": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.12.13.tgz#bebde51339be829c17aaaaced18641deb62b39ba" - integrity sha512-XyJmZidNfofEkqFV5VC/bLabGmO5QzenPO/YOfGuEbgU+2sSwMmio3YLb4WtBgcmmdwZHyVyv8on77IUjQ5Gvg== +"@babel/plugin-proposal-private-property-in-object@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.14.5.tgz#9f65a4d0493a940b4c01f8aa9d3f1894a587f636" + integrity sha512-62EyfyA3WA0mZiF2e2IV9mc9Ghwxcg8YTu8BS4Wss4Y3PY725OmS9M0qLORbJwLqFtGh+jiE4wAmocK2CTUK2Q== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.12.13" - "@babel/helper-plugin-utils" "^7.12.13" + "@babel/helper-annotate-as-pure" "^7.14.5" + "@babel/helper-create-class-features-plugin" "^7.14.5" + "@babel/helper-plugin-utils" "^7.14.5" + "@babel/plugin-syntax-private-property-in-object" "^7.14.5" + +"@babel/plugin-proposal-unicode-property-regex@^7.14.5", "@babel/plugin-proposal-unicode-property-regex@^7.4.4": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.14.5.tgz#0f95ee0e757a5d647f378daa0eca7e93faa8bbe8" + integrity sha512-6axIeOU5LnY471KenAB9vI8I5j7NQ2d652hIYwVyRfgaZT5UpiqFKCuVXCDMSrU+3VFafnu2c5m3lrWIlr6A5Q== + dependencies: + "@babel/helper-create-regexp-features-plugin" "^7.14.5" + "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-async-generators@^7.8.4": version "7.8.4" @@ -412,6 +431,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.12.13" +"@babel/plugin-syntax-class-static-block@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz#195df89b146b4b78b3bf897fd7a257c84659d406" + integrity sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw== + dependencies: + "@babel/helper-plugin-utils" "^7.14.5" + "@babel/plugin-syntax-dynamic-import@^7.8.3": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz#62bf98b2da3cd21d626154fc96ee5b3cb68eacb3" @@ -419,12 +445,12 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.0" -"@babel/plugin-syntax-export-default-from@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-export-default-from/-/plugin-syntax-export-default-from-7.12.13.tgz#3c807d37efaf0a806f1deb556ccb3b2f562ae9c2" - integrity sha512-gVry0zqoums0hA+EniCYK3gABhjYSLX1dVuwYpPw9DrLNA4/GovXySHVg4FGRsZht09ON/5C2NVx3keq+qqVGQ== +"@babel/plugin-syntax-export-default-from@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-export-default-from/-/plugin-syntax-export-default-from-7.14.5.tgz#cdfa9d43d2b2c89b6f1af3e83518e8c8b9ed0dbc" + integrity sha512-snWDxjuaPEobRBnhpqEfZ8RMxDbHt8+87fiEioGuE+Uc0xAKgSD8QiuL3lF93hPVQfZFAcYwrrf+H5qUhike3Q== dependencies: - "@babel/helper-plugin-utils" "^7.12.13" + "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-export-namespace-from@^7.8.3": version "7.8.3" @@ -433,12 +459,12 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.3" -"@babel/plugin-syntax-flow@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-flow/-/plugin-syntax-flow-7.12.13.tgz#5df9962503c0a9c918381c929d51d4d6949e7e86" - integrity sha512-J/RYxnlSLXZLVR7wTRsozxKT8qbsx1mNKJzXEEjQ0Kjx1ZACcyHgbanNWNCFtc36IzuWhYWPpvJFFoexoOWFmA== +"@babel/plugin-syntax-flow@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-flow/-/plugin-syntax-flow-7.14.5.tgz#2ff654999497d7d7d142493260005263731da180" + integrity sha512-9WK5ZwKCdWHxVuU13XNT6X73FGmutAXeor5lGFq6qhOFtMFUF4jkbijuyUdZZlpYq6E2hZeZf/u3959X9wsv0Q== dependencies: - "@babel/helper-plugin-utils" "^7.12.13" + "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-import-meta@^7.10.4": version "7.10.4" @@ -496,310 +522,320 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.0" -"@babel/plugin-syntax-top-level-await@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.12.13.tgz#c5f0fa6e249f5b739727f923540cf7a806130178" - integrity sha512-A81F9pDwyS7yM//KwbCSDqy3Uj4NMIurtplxphWxoYtNPov7cJsDkAFNNyVlIZ3jwGycVsurZ+LtOA8gZ376iQ== +"@babel/plugin-syntax-private-property-in-object@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz#0dc6671ec0ea22b6e94a1114f857970cd39de1ad" + integrity sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg== dependencies: - "@babel/helper-plugin-utils" "^7.12.13" + "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-syntax-typescript@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.12.13.tgz#9dff111ca64154cef0f4dc52cf843d9f12ce4474" - integrity sha512-cHP3u1JiUiG2LFDKbXnwVad81GvfyIOmCD6HIEId6ojrY0Drfy2q1jw7BwN7dE84+kTnBjLkXoL3IEy/3JPu2w== +"@babel/plugin-syntax-top-level-await@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz#c1cfdadc35a646240001f06138247b741c34d94c" + integrity sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw== dependencies: - "@babel/helper-plugin-utils" "^7.12.13" + "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-arrow-functions@^7.13.0": - version "7.13.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.13.0.tgz#10a59bebad52d637a027afa692e8d5ceff5e3dae" - integrity sha512-96lgJagobeVmazXFaDrbmCLQxBysKu7U6Do3mLsx27gf5Dk85ezysrs2BZUpXD703U/Su1xTBDxxar2oa4jAGg== +"@babel/plugin-syntax-typescript@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.14.5.tgz#b82c6ce471b165b5ce420cf92914d6fb46225716" + integrity sha512-u6OXzDaIXjEstBRRoBCQ/uKQKlbuaeE5in0RvWdA4pN6AhqxTIwUsnHPU1CFZA/amYObMsuWhYfRl3Ch90HD0Q== dependencies: - "@babel/helper-plugin-utils" "^7.13.0" + "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-async-to-generator@^7.13.0": - version "7.13.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.13.0.tgz#8e112bf6771b82bf1e974e5e26806c5c99aa516f" - integrity sha512-3j6E004Dx0K3eGmhxVJxwwI89CTJrce7lg3UrtFuDAVQ/2+SJ/h/aSFOeE6/n0WB1GsOffsJp6MnPQNQ8nmwhg== +"@babel/plugin-transform-arrow-functions@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.14.5.tgz#f7187d9588a768dd080bf4c9ffe117ea62f7862a" + integrity sha512-KOnO0l4+tD5IfOdi4x8C1XmEIRWUjNRV8wc6K2vz/3e8yAOoZZvsRXRRIF/yo/MAOFb4QjtAw9xSxMXbSMRy8A== dependencies: - "@babel/helper-module-imports" "^7.12.13" - "@babel/helper-plugin-utils" "^7.13.0" - "@babel/helper-remap-async-to-generator" "^7.13.0" + "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-block-scoped-functions@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.12.13.tgz#a9bf1836f2a39b4eb6cf09967739de29ea4bf4c4" - integrity sha512-zNyFqbc3kI/fVpqwfqkg6RvBgFpC4J18aKKMmv7KdQ/1GgREapSJAykLMVNwfRGO3BtHj3YQZl8kxCXPcVMVeg== +"@babel/plugin-transform-async-to-generator@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.14.5.tgz#72c789084d8f2094acb945633943ef8443d39e67" + integrity sha512-szkbzQ0mNk0rpu76fzDdqSyPu0MuvpXgC+6rz5rpMb5OIRxdmHfQxrktL8CYolL2d8luMCZTR0DpIMIdL27IjA== dependencies: - "@babel/helper-plugin-utils" "^7.12.13" + "@babel/helper-module-imports" "^7.14.5" + "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-remap-async-to-generator" "^7.14.5" -"@babel/plugin-transform-block-scoping@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.12.13.tgz#f36e55076d06f41dfd78557ea039c1b581642e61" - integrity sha512-Pxwe0iqWJX4fOOM2kEZeUuAxHMWb9nK+9oh5d11bsLoB0xMg+mkDpt0eYuDZB7ETrY9bbcVlKUGTOGWy7BHsMQ== +"@babel/plugin-transform-block-scoped-functions@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.14.5.tgz#e48641d999d4bc157a67ef336aeb54bc44fd3ad4" + integrity sha512-dtqWqdWZ5NqBX3KzsVCWfQI3A53Ft5pWFCT2eCVUftWZgjc5DpDponbIF1+c+7cSGk2wN0YK7HGL/ezfRbpKBQ== dependencies: - "@babel/helper-plugin-utils" "^7.12.13" + "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-classes@^7.13.0": - version "7.13.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.13.0.tgz#0265155075c42918bf4d3a4053134176ad9b533b" - integrity sha512-9BtHCPUARyVH1oXGcSJD3YpsqRLROJx5ZNP6tN5vnk17N0SVf9WCtf8Nuh1CFmgByKKAIMstitKduoCmsaDK5g== +"@babel/plugin-transform-block-scoping@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.14.5.tgz#8cc63e61e50f42e078e6f09be775a75f23ef9939" + integrity sha512-LBYm4ZocNgoCqyxMLoOnwpsmQ18HWTQvql64t3GvMUzLQrNoV1BDG0lNftC8QKYERkZgCCT/7J5xWGObGAyHDw== dependencies: - "@babel/helper-annotate-as-pure" "^7.12.13" - "@babel/helper-function-name" "^7.12.13" - "@babel/helper-optimise-call-expression" "^7.12.13" - "@babel/helper-plugin-utils" "^7.13.0" - "@babel/helper-replace-supers" "^7.13.0" - "@babel/helper-split-export-declaration" "^7.12.13" + "@babel/helper-plugin-utils" "^7.14.5" + +"@babel/plugin-transform-classes@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.14.5.tgz#0e98e82097b38550b03b483f9b51a78de0acb2cf" + integrity sha512-J4VxKAMykM06K/64z9rwiL6xnBHgB1+FVspqvlgCdwD1KUbQNfszeKVVOMh59w3sztHYIZDgnhOC4WbdEfHFDA== + dependencies: + "@babel/helper-annotate-as-pure" "^7.14.5" + "@babel/helper-function-name" "^7.14.5" + "@babel/helper-optimise-call-expression" "^7.14.5" + "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-replace-supers" "^7.14.5" + "@babel/helper-split-export-declaration" "^7.14.5" globals "^11.1.0" -"@babel/plugin-transform-computed-properties@^7.13.0": - version "7.13.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.13.0.tgz#845c6e8b9bb55376b1fa0b92ef0bdc8ea06644ed" - integrity sha512-RRqTYTeZkZAz8WbieLTvKUEUxZlUTdmL5KGMyZj7FnMfLNKV4+r5549aORG/mgojRmFlQMJDUupwAMiF2Q7OUg== +"@babel/plugin-transform-computed-properties@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.14.5.tgz#1b9d78987420d11223d41195461cc43b974b204f" + integrity sha512-pWM+E4283UxaVzLb8UBXv4EIxMovU4zxT1OPnpHJcmnvyY9QbPPTKZfEj31EUvG3/EQRbYAGaYEUZ4yWOBC2xg== dependencies: - "@babel/helper-plugin-utils" "^7.13.0" + "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-destructuring@^7.13.0": - version "7.13.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.13.0.tgz#c5dce270014d4e1ebb1d806116694c12b7028963" - integrity sha512-zym5em7tePoNT9s964c0/KU3JPPnuq7VhIxPRefJ4/s82cD+q1mgKfuGRDMCPL0HTyKz4dISuQlCusfgCJ86HA== +"@babel/plugin-transform-destructuring@^7.14.7": + version "7.14.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.14.7.tgz#0ad58ed37e23e22084d109f185260835e5557576" + integrity sha512-0mDE99nK+kVh3xlc5vKwB6wnP9ecuSj+zQCa/n0voENtP/zymdT4HH6QEb65wjjcbqr1Jb/7z9Qp7TF5FtwYGw== dependencies: - "@babel/helper-plugin-utils" "^7.13.0" + "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-dotall-regex@^7.12.13", "@babel/plugin-transform-dotall-regex@^7.4.4": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.12.13.tgz#3f1601cc29905bfcb67f53910f197aeafebb25ad" - integrity sha512-foDrozE65ZFdUC2OfgeOCrEPTxdB3yjqxpXh8CH+ipd9CHd4s/iq81kcUpyH8ACGNEPdFqbtzfgzbT/ZGlbDeQ== +"@babel/plugin-transform-dotall-regex@^7.14.5", "@babel/plugin-transform-dotall-regex@^7.4.4": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.14.5.tgz#2f6bf76e46bdf8043b4e7e16cf24532629ba0c7a" + integrity sha512-loGlnBdj02MDsFaHhAIJzh7euK89lBrGIdM9EAtHFo6xKygCUGuuWe07o1oZVk287amtW1n0808sQM99aZt3gw== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.12.13" - "@babel/helper-plugin-utils" "^7.12.13" + "@babel/helper-create-regexp-features-plugin" "^7.14.5" + "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-duplicate-keys@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.12.13.tgz#6f06b87a8b803fd928e54b81c258f0a0033904de" - integrity sha512-NfADJiiHdhLBW3pulJlJI2NB0t4cci4WTZ8FtdIuNc2+8pslXdPtRRAEWqUY+m9kNOk2eRYbTAOipAxlrOcwwQ== +"@babel/plugin-transform-duplicate-keys@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.14.5.tgz#365a4844881bdf1501e3a9f0270e7f0f91177954" + integrity sha512-iJjbI53huKbPDAsJ8EmVmvCKeeq21bAze4fu9GBQtSLqfvzj2oRuHVx4ZkDwEhg1htQ+5OBZh/Ab0XDf5iBZ7A== dependencies: - "@babel/helper-plugin-utils" "^7.12.13" + "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-exponentiation-operator@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.12.13.tgz#4d52390b9a273e651e4aba6aee49ef40e80cd0a1" - integrity sha512-fbUelkM1apvqez/yYx1/oICVnGo2KM5s63mhGylrmXUxK/IAXSIf87QIxVfZldWf4QsOafY6vV3bX8aMHSvNrA== +"@babel/plugin-transform-exponentiation-operator@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.14.5.tgz#5154b8dd6a3dfe6d90923d61724bd3deeb90b493" + integrity sha512-jFazJhMBc9D27o9jDnIE5ZErI0R0m7PbKXVq77FFvqFbzvTMuv8jaAwLZ5PviOLSFttqKIW0/wxNSDbjLk0tYA== dependencies: - "@babel/helper-builder-binary-assignment-operator-visitor" "^7.12.13" - "@babel/helper-plugin-utils" "^7.12.13" + "@babel/helper-builder-binary-assignment-operator-visitor" "^7.14.5" + "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-flow-strip-types@^7.13.0": - version "7.13.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-flow-strip-types/-/plugin-transform-flow-strip-types-7.13.0.tgz#58177a48c209971e8234e99906cb6bd1122addd3" - integrity sha512-EXAGFMJgSX8gxWD7PZtW/P6M+z74jpx3wm/+9pn+c2dOawPpBkUX7BrfyPvo6ZpXbgRIEuwgwDb/MGlKvu2pOg== +"@babel/plugin-transform-flow-strip-types@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-flow-strip-types/-/plugin-transform-flow-strip-types-7.14.5.tgz#0dc9c1d11dcdc873417903d6df4bed019ef0f85e" + integrity sha512-KhcolBKfXbvjwI3TV7r7TkYm8oNXHNBqGOy6JDVwtecFaRoKYsUUqJdS10q0YDKW1c6aZQgO+Ys3LfGkox8pXA== dependencies: - "@babel/helper-plugin-utils" "^7.13.0" - "@babel/plugin-syntax-flow" "^7.12.13" + "@babel/helper-plugin-utils" "^7.14.5" + "@babel/plugin-syntax-flow" "^7.14.5" -"@babel/plugin-transform-for-of@^7.13.0": - version "7.13.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.13.0.tgz#c799f881a8091ac26b54867a845c3e97d2696062" - integrity sha512-IHKT00mwUVYE0zzbkDgNRP6SRzvfGCYsOxIRz8KsiaaHCcT9BWIkO+H9QRJseHBLOGBZkHUdHiqj6r0POsdytg== +"@babel/plugin-transform-for-of@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.14.5.tgz#dae384613de8f77c196a8869cbf602a44f7fc0eb" + integrity sha512-CfmqxSUZzBl0rSjpoQSFoR9UEj3HzbGuGNL21/iFTmjb5gFggJp3ph0xR1YBhexmLoKRHzgxuFvty2xdSt6gTA== dependencies: - "@babel/helper-plugin-utils" "^7.13.0" + "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-function-name@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.12.13.tgz#bb024452f9aaed861d374c8e7a24252ce3a50051" - integrity sha512-6K7gZycG0cmIwwF7uMK/ZqeCikCGVBdyP2J5SKNCXO5EOHcqi+z7Jwf8AmyDNcBgxET8DrEtCt/mPKPyAzXyqQ== +"@babel/plugin-transform-function-name@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.14.5.tgz#e81c65ecb900746d7f31802f6bed1f52d915d6f2" + integrity sha512-vbO6kv0fIzZ1GpmGQuvbwwm+O4Cbm2NrPzwlup9+/3fdkuzo1YqOZcXw26+YUJB84Ja7j9yURWposEHLYwxUfQ== dependencies: - "@babel/helper-function-name" "^7.12.13" - "@babel/helper-plugin-utils" "^7.12.13" + "@babel/helper-function-name" "^7.14.5" + "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-literals@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.12.13.tgz#2ca45bafe4a820197cf315794a4d26560fe4bdb9" - integrity sha512-FW+WPjSR7hiUxMcKqyNjP05tQ2kmBCdpEpZHY1ARm96tGQCCBvXKnpjILtDplUnJ/eHZ0lALLM+d2lMFSpYJrQ== +"@babel/plugin-transform-literals@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.14.5.tgz#41d06c7ff5d4d09e3cf4587bd3ecf3930c730f78" + integrity sha512-ql33+epql2F49bi8aHXxvLURHkxJbSmMKl9J5yHqg4PLtdE6Uc48CH1GS6TQvZ86eoB/ApZXwm7jlA+B3kra7A== dependencies: - "@babel/helper-plugin-utils" "^7.12.13" + "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-member-expression-literals@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.12.13.tgz#5ffa66cd59b9e191314c9f1f803b938e8c081e40" - integrity sha512-kxLkOsg8yir4YeEPHLuO2tXP9R/gTjpuTOjshqSpELUN3ZAg2jfDnKUvzzJxObun38sw3wm4Uu69sX/zA7iRvg== +"@babel/plugin-transform-member-expression-literals@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.14.5.tgz#b39cd5212a2bf235a617d320ec2b48bcc091b8a7" + integrity sha512-WkNXxH1VXVTKarWFqmso83xl+2V3Eo28YY5utIkbsmXoItO8Q3aZxN4BTS2k0hz9dGUloHK26mJMyQEYfkn/+Q== dependencies: - "@babel/helper-plugin-utils" "^7.12.13" + "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-modules-amd@^7.13.0": - version "7.13.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.13.0.tgz#19f511d60e3d8753cc5a6d4e775d3a5184866cc3" - integrity sha512-EKy/E2NHhY/6Vw5d1k3rgoobftcNUmp9fGjb9XZwQLtTctsRBOTRO7RHHxfIky1ogMN5BxN7p9uMA3SzPfotMQ== +"@babel/plugin-transform-modules-amd@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.14.5.tgz#4fd9ce7e3411cb8b83848480b7041d83004858f7" + integrity sha512-3lpOU8Vxmp3roC4vzFpSdEpGUWSMsHFreTWOMMLzel2gNGfHE5UWIh/LN6ghHs2xurUp4jRFYMUIZhuFbody1g== dependencies: - "@babel/helper-module-transforms" "^7.13.0" - "@babel/helper-plugin-utils" "^7.13.0" + "@babel/helper-module-transforms" "^7.14.5" + "@babel/helper-plugin-utils" "^7.14.5" babel-plugin-dynamic-import-node "^2.3.3" -"@babel/plugin-transform-modules-commonjs@^7.13.8": - version "7.13.8" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.13.8.tgz#7b01ad7c2dcf2275b06fa1781e00d13d420b3e1b" - integrity sha512-9QiOx4MEGglfYZ4XOnU79OHr6vIWUakIj9b4mioN8eQIoEh+pf5p/zEB36JpDFWA12nNMiRf7bfoRvl9Rn79Bw== +"@babel/plugin-transform-modules-commonjs@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.14.5.tgz#7aaee0ea98283de94da98b28f8c35701429dad97" + integrity sha512-en8GfBtgnydoao2PS+87mKyw62k02k7kJ9ltbKe0fXTHrQmG6QZZflYuGI1VVG7sVpx4E1n7KBpNlPb8m78J+A== dependencies: - "@babel/helper-module-transforms" "^7.13.0" - "@babel/helper-plugin-utils" "^7.13.0" - "@babel/helper-simple-access" "^7.12.13" + "@babel/helper-module-transforms" "^7.14.5" + "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-simple-access" "^7.14.5" babel-plugin-dynamic-import-node "^2.3.3" -"@babel/plugin-transform-modules-systemjs@^7.13.8": - version "7.13.8" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.13.8.tgz#6d066ee2bff3c7b3d60bf28dec169ad993831ae3" - integrity sha512-hwqctPYjhM6cWvVIlOIe27jCIBgHCsdH2xCJVAYQm7V5yTMoilbVMi9f6wKg0rpQAOn6ZG4AOyvCqFF/hUh6+A== +"@babel/plugin-transform-modules-systemjs@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.14.5.tgz#c75342ef8b30dcde4295d3401aae24e65638ed29" + integrity sha512-mNMQdvBEE5DcMQaL5LbzXFMANrQjd2W7FPzg34Y4yEz7dBgdaC+9B84dSO+/1Wba98zoDbInctCDo4JGxz1VYA== dependencies: - "@babel/helper-hoist-variables" "^7.13.0" - "@babel/helper-module-transforms" "^7.13.0" - "@babel/helper-plugin-utils" "^7.13.0" - "@babel/helper-validator-identifier" "^7.12.11" + "@babel/helper-hoist-variables" "^7.14.5" + "@babel/helper-module-transforms" "^7.14.5" + "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-validator-identifier" "^7.14.5" babel-plugin-dynamic-import-node "^2.3.3" -"@babel/plugin-transform-modules-umd@^7.13.0": - version "7.13.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.13.0.tgz#8a3d96a97d199705b9fd021580082af81c06e70b" - integrity sha512-D/ILzAh6uyvkWjKKyFE/W0FzWwasv6vPTSqPcjxFqn6QpX3u8DjRVliq4F2BamO2Wee/om06Vyy+vPkNrd4wxw== +"@babel/plugin-transform-modules-umd@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.14.5.tgz#fb662dfee697cce274a7cda525190a79096aa6e0" + integrity sha512-RfPGoagSngC06LsGUYyM9QWSXZ8MysEjDJTAea1lqRjNECE3y0qIJF/qbvJxc4oA4s99HumIMdXOrd+TdKaAAA== dependencies: - "@babel/helper-module-transforms" "^7.13.0" - "@babel/helper-plugin-utils" "^7.13.0" + "@babel/helper-module-transforms" "^7.14.5" + "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-named-capturing-groups-regex@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.12.13.tgz#2213725a5f5bbbe364b50c3ba5998c9599c5c9d9" - integrity sha512-Xsm8P2hr5hAxyYblrfACXpQKdQbx4m2df9/ZZSQ8MAhsadw06+jW7s9zsSw6he+mJZXRlVMyEnVktJo4zjk1WA== +"@babel/plugin-transform-named-capturing-groups-regex@^7.14.7": + version "7.14.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.14.7.tgz#60c06892acf9df231e256c24464bfecb0908fd4e" + integrity sha512-DTNOTaS7TkW97xsDMrp7nycUVh6sn/eq22VaxWfEdzuEbRsiaOU0pqU7DlyUGHVsbQbSghvjKRpEl+nUCKGQSg== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.12.13" + "@babel/helper-create-regexp-features-plugin" "^7.14.5" -"@babel/plugin-transform-new-target@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.12.13.tgz#e22d8c3af24b150dd528cbd6e685e799bf1c351c" - integrity sha512-/KY2hbLxrG5GTQ9zzZSc3xWiOy379pIETEhbtzwZcw9rvuaVV4Fqy7BYGYOWZnaoXIQYbbJ0ziXLa/sKcGCYEQ== +"@babel/plugin-transform-new-target@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.14.5.tgz#31bdae8b925dc84076ebfcd2a9940143aed7dbf8" + integrity sha512-Nx054zovz6IIRWEB49RDRuXGI4Gy0GMgqG0cII9L3MxqgXz/+rgII+RU58qpo4g7tNEx1jG7rRVH4ihZoP4esQ== dependencies: - "@babel/helper-plugin-utils" "^7.12.13" + "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-object-super@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.12.13.tgz#b4416a2d63b8f7be314f3d349bd55a9c1b5171f7" - integrity sha512-JzYIcj3XtYspZDV8j9ulnoMPZZnF/Cj0LUxPOjR89BdBVx+zYJI9MdMIlUZjbXDX+6YVeS6I3e8op+qQ3BYBoQ== +"@babel/plugin-transform-object-super@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.14.5.tgz#d0b5faeac9e98597a161a9cf78c527ed934cdc45" + integrity sha512-MKfOBWzK0pZIrav9z/hkRqIk/2bTv9qvxHzPQc12RcVkMOzpIKnFCNYJip00ssKWYkd8Sf5g0Wr7pqJ+cmtuFg== dependencies: - "@babel/helper-plugin-utils" "^7.12.13" - "@babel/helper-replace-supers" "^7.12.13" + "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-replace-supers" "^7.14.5" -"@babel/plugin-transform-parameters@^7.13.0": - version "7.13.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.13.0.tgz#8fa7603e3097f9c0b7ca1a4821bc2fb52e9e5007" - integrity sha512-Jt8k/h/mIwE2JFEOb3lURoY5C85ETcYPnbuAJ96zRBzh1XHtQZfs62ChZ6EP22QlC8c7Xqr9q+e1SU5qttwwjw== +"@babel/plugin-transform-parameters@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.14.5.tgz#49662e86a1f3ddccac6363a7dfb1ff0a158afeb3" + integrity sha512-Tl7LWdr6HUxTmzQtzuU14SqbgrSKmaR77M0OKyq4njZLQTPfOvzblNKyNkGwOfEFCEx7KeYHQHDI0P3F02IVkA== dependencies: - "@babel/helper-plugin-utils" "^7.13.0" + "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-property-literals@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.12.13.tgz#4e6a9e37864d8f1b3bc0e2dce7bf8857db8b1a81" - integrity sha512-nqVigwVan+lR+g8Fj8Exl0UQX2kymtjcWfMOYM1vTYEKujeyv2SkMgazf2qNcK7l4SDiKyTA/nHCPqL4e2zo1A== +"@babel/plugin-transform-property-literals@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.14.5.tgz#0ddbaa1f83db3606f1cdf4846fa1dfb473458b34" + integrity sha512-r1uilDthkgXW8Z1vJz2dKYLV1tuw2xsbrp3MrZmD99Wh9vsfKoob+JTgri5VUb/JqyKRXotlOtwgu4stIYCmnw== dependencies: - "@babel/helper-plugin-utils" "^7.12.13" + "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-regenerator@^7.13.15": - version "7.13.15" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.13.15.tgz#e5eb28945bf8b6563e7f818945f966a8d2997f39" - integrity sha512-Bk9cOLSz8DiurcMETZ8E2YtIVJbFCPGW28DJWUakmyVWtQSm6Wsf0p4B4BfEr/eL2Nkhe/CICiUiMOCi1TPhuQ== +"@babel/plugin-transform-regenerator@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.14.5.tgz#9676fd5707ed28f522727c5b3c0aa8544440b04f" + integrity sha512-NVIY1W3ITDP5xQl50NgTKlZ0GrotKtLna08/uGY6ErQt6VEQZXla86x/CTddm5gZdcr+5GSsvMeTmWA5Ii6pkg== dependencies: regenerator-transform "^0.14.2" -"@babel/plugin-transform-reserved-words@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.12.13.tgz#7d9988d4f06e0fe697ea1d9803188aa18b472695" - integrity sha512-xhUPzDXxZN1QfiOy/I5tyye+TRz6lA7z6xaT4CLOjPRMVg1ldRf0LHw0TDBpYL4vG78556WuHdyO9oi5UmzZBg== - dependencies: - "@babel/helper-plugin-utils" "^7.12.13" - -"@babel/plugin-transform-shorthand-properties@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.12.13.tgz#db755732b70c539d504c6390d9ce90fe64aff7ad" - integrity sha512-xpL49pqPnLtf0tVluuqvzWIgLEhuPpZzvs2yabUHSKRNlN7ScYU7aMlmavOeyXJZKgZKQRBlh8rHbKiJDraTSw== - dependencies: - "@babel/helper-plugin-utils" "^7.12.13" - -"@babel/plugin-transform-spread@^7.13.0": - version "7.13.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.13.0.tgz#84887710e273c1815ace7ae459f6f42a5d31d5fd" - integrity sha512-V6vkiXijjzYeFmQTr3dBxPtZYLPcUfY34DebOU27jIl2M/Y8Egm52Hw82CSjjPqd54GTlJs5x+CR7HeNr24ckg== - dependencies: - "@babel/helper-plugin-utils" "^7.13.0" - "@babel/helper-skip-transparent-expression-wrappers" "^7.12.1" - -"@babel/plugin-transform-sticky-regex@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.12.13.tgz#760ffd936face73f860ae646fb86ee82f3d06d1f" - integrity sha512-Jc3JSaaWT8+fr7GRvQP02fKDsYk4K/lYwWq38r/UGfaxo89ajud321NH28KRQ7xy1Ybc0VUE5Pz8psjNNDUglg== - dependencies: - "@babel/helper-plugin-utils" "^7.12.13" - -"@babel/plugin-transform-template-literals@^7.13.0": - version "7.13.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.13.0.tgz#a36049127977ad94438dee7443598d1cefdf409d" - integrity sha512-d67umW6nlfmr1iehCcBv69eSUSySk1EsIS8aTDX4Xo9qajAh6mYtcl4kJrBkGXuxZPEgVr7RVfAvNW6YQkd4Mw== - dependencies: - "@babel/helper-plugin-utils" "^7.13.0" - -"@babel/plugin-transform-typeof-symbol@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.12.13.tgz#785dd67a1f2ea579d9c2be722de8c84cb85f5a7f" - integrity sha512-eKv/LmUJpMnu4npgfvs3LiHhJua5fo/CysENxa45YCQXZwKnGCQKAg87bvoqSW1fFT+HA32l03Qxsm8ouTY3ZQ== - dependencies: - "@babel/helper-plugin-utils" "^7.12.13" - -"@babel/plugin-transform-typescript@^7.13.0": - version "7.13.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.13.0.tgz#4a498e1f3600342d2a9e61f60131018f55774853" - integrity sha512-elQEwluzaU8R8dbVuW2Q2Y8Nznf7hnjM7+DSCd14Lo5fF63C9qNLbwZYbmZrtV9/ySpSUpkRpQXvJb6xyu4hCQ== - dependencies: - "@babel/helper-create-class-features-plugin" "^7.13.0" - "@babel/helper-plugin-utils" "^7.13.0" - "@babel/plugin-syntax-typescript" "^7.12.13" - -"@babel/plugin-transform-unicode-escapes@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.12.13.tgz#840ced3b816d3b5127dd1d12dcedc5dead1a5e74" - integrity sha512-0bHEkdwJ/sN/ikBHfSmOXPypN/beiGqjo+o4/5K+vxEFNPRPdImhviPakMKG4x96l85emoa0Z6cDflsdBusZbw== - dependencies: - "@babel/helper-plugin-utils" "^7.12.13" - -"@babel/plugin-transform-unicode-regex@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.12.13.tgz#b52521685804e155b1202e83fc188d34bb70f5ac" - integrity sha512-mDRzSNY7/zopwisPZ5kM9XKCfhchqIYwAKRERtEnhYscZB79VRekuRSoYbN0+KVe3y8+q1h6A4svXtP7N+UoCA== - dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.12.13" - "@babel/helper-plugin-utils" "^7.12.13" - -"@babel/preset-env@^7.13.15": - version "7.13.15" - resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.13.15.tgz#c8a6eb584f96ecba183d3d414a83553a599f478f" - integrity sha512-D4JAPMXcxk69PKe81jRJ21/fP/uYdcTZ3hJDF5QX2HSI9bBxxYw/dumdR6dGumhjxlprHPE4XWoPaqzZUVy2MA== - dependencies: - "@babel/compat-data" "^7.13.15" - "@babel/helper-compilation-targets" "^7.13.13" - "@babel/helper-plugin-utils" "^7.13.0" - "@babel/helper-validator-option" "^7.12.17" - "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining" "^7.13.12" - "@babel/plugin-proposal-async-generator-functions" "^7.13.15" - "@babel/plugin-proposal-class-properties" "^7.13.0" - "@babel/plugin-proposal-dynamic-import" "^7.13.8" - "@babel/plugin-proposal-export-namespace-from" "^7.12.13" - "@babel/plugin-proposal-json-strings" "^7.13.8" - "@babel/plugin-proposal-logical-assignment-operators" "^7.13.8" - "@babel/plugin-proposal-nullish-coalescing-operator" "^7.13.8" - "@babel/plugin-proposal-numeric-separator" "^7.12.13" - "@babel/plugin-proposal-object-rest-spread" "^7.13.8" - "@babel/plugin-proposal-optional-catch-binding" "^7.13.8" - "@babel/plugin-proposal-optional-chaining" "^7.13.12" - "@babel/plugin-proposal-private-methods" "^7.13.0" - "@babel/plugin-proposal-unicode-property-regex" "^7.12.13" +"@babel/plugin-transform-reserved-words@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.14.5.tgz#c44589b661cfdbef8d4300dcc7469dffa92f8304" + integrity sha512-cv4F2rv1nD4qdexOGsRQXJrOcyb5CrgjUH9PKrrtyhSDBNWGxd0UIitjyJiWagS+EbUGjG++22mGH1Pub8D6Vg== + dependencies: + "@babel/helper-plugin-utils" "^7.14.5" + +"@babel/plugin-transform-shorthand-properties@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.14.5.tgz#97f13855f1409338d8cadcbaca670ad79e091a58" + integrity sha512-xLucks6T1VmGsTB+GWK5Pl9Jl5+nRXD1uoFdA5TSO6xtiNjtXTjKkmPdFXVLGlK5A2/or/wQMKfmQ2Y0XJfn5g== + dependencies: + "@babel/helper-plugin-utils" "^7.14.5" + +"@babel/plugin-transform-spread@^7.14.6": + version "7.14.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.14.6.tgz#6bd40e57fe7de94aa904851963b5616652f73144" + integrity sha512-Zr0x0YroFJku7n7+/HH3A2eIrGMjbmAIbJSVv0IZ+t3U2WUQUA64S/oeied2e+MaGSjmt4alzBCsK9E8gh+fag== + dependencies: + "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-skip-transparent-expression-wrappers" "^7.14.5" + +"@babel/plugin-transform-sticky-regex@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.14.5.tgz#5b617542675e8b7761294381f3c28c633f40aeb9" + integrity sha512-Z7F7GyvEMzIIbwnziAZmnSNpdijdr4dWt+FJNBnBLz5mwDFkqIXU9wmBcWWad3QeJF5hMTkRe4dAq2sUZiG+8A== + dependencies: + "@babel/helper-plugin-utils" "^7.14.5" + +"@babel/plugin-transform-template-literals@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.14.5.tgz#a5f2bc233937d8453885dc736bdd8d9ffabf3d93" + integrity sha512-22btZeURqiepOfuy/VkFr+zStqlujWaarpMErvay7goJS6BWwdd6BY9zQyDLDa4x2S3VugxFb162IZ4m/S/+Gg== + dependencies: + "@babel/helper-plugin-utils" "^7.14.5" + +"@babel/plugin-transform-typeof-symbol@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.14.5.tgz#39af2739e989a2bd291bf6b53f16981423d457d4" + integrity sha512-lXzLD30ffCWseTbMQzrvDWqljvZlHkXU+CnseMhkMNqU1sASnCsz3tSzAaH3vCUXb9PHeUb90ZT1BdFTm1xxJw== + dependencies: + "@babel/helper-plugin-utils" "^7.14.5" + +"@babel/plugin-transform-typescript@^7.14.5": + version "7.14.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.14.6.tgz#6e9c2d98da2507ebe0a883b100cde3c7279df36c" + integrity sha512-XlTdBq7Awr4FYIzqhmYY80WN0V0azF74DMPyFqVHBvf81ZUgc4X7ZOpx6O8eLDK6iM5cCQzeyJw0ynTaefixRA== + dependencies: + "@babel/helper-create-class-features-plugin" "^7.14.6" + "@babel/helper-plugin-utils" "^7.14.5" + "@babel/plugin-syntax-typescript" "^7.14.5" + +"@babel/plugin-transform-unicode-escapes@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.14.5.tgz#9d4bd2a681e3c5d7acf4f57fa9e51175d91d0c6b" + integrity sha512-crTo4jATEOjxj7bt9lbYXcBAM3LZaUrbP2uUdxb6WIorLmjNKSpHfIybgY4B8SRpbf8tEVIWH3Vtm7ayCrKocA== + dependencies: + "@babel/helper-plugin-utils" "^7.14.5" + +"@babel/plugin-transform-unicode-regex@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.14.5.tgz#4cd09b6c8425dd81255c7ceb3fb1836e7414382e" + integrity sha512-UygduJpC5kHeCiRw/xDVzC+wj8VaYSoKl5JNVmbP7MadpNinAm3SvZCxZ42H37KZBKztz46YC73i9yV34d0Tzw== + dependencies: + "@babel/helper-create-regexp-features-plugin" "^7.14.5" + "@babel/helper-plugin-utils" "^7.14.5" + +"@babel/preset-env@^7.14.7": + version "7.14.7" + resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.14.7.tgz#5c70b22d4c2d893b03d8c886a5c17422502b932a" + integrity sha512-itOGqCKLsSUl0Y+1nSfhbuuOlTs0MJk2Iv7iSH+XT/mR8U1zRLO7NjWlYXB47yhK4J/7j+HYty/EhFZDYKa/VA== + dependencies: + "@babel/compat-data" "^7.14.7" + "@babel/helper-compilation-targets" "^7.14.5" + "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-validator-option" "^7.14.5" + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining" "^7.14.5" + "@babel/plugin-proposal-async-generator-functions" "^7.14.7" + "@babel/plugin-proposal-class-properties" "^7.14.5" + "@babel/plugin-proposal-class-static-block" "^7.14.5" + "@babel/plugin-proposal-dynamic-import" "^7.14.5" + "@babel/plugin-proposal-export-namespace-from" "^7.14.5" + "@babel/plugin-proposal-json-strings" "^7.14.5" + "@babel/plugin-proposal-logical-assignment-operators" "^7.14.5" + "@babel/plugin-proposal-nullish-coalescing-operator" "^7.14.5" + "@babel/plugin-proposal-numeric-separator" "^7.14.5" + "@babel/plugin-proposal-object-rest-spread" "^7.14.7" + "@babel/plugin-proposal-optional-catch-binding" "^7.14.5" + "@babel/plugin-proposal-optional-chaining" "^7.14.5" + "@babel/plugin-proposal-private-methods" "^7.14.5" + "@babel/plugin-proposal-private-property-in-object" "^7.14.5" + "@babel/plugin-proposal-unicode-property-regex" "^7.14.5" "@babel/plugin-syntax-async-generators" "^7.8.4" "@babel/plugin-syntax-class-properties" "^7.12.13" + "@babel/plugin-syntax-class-static-block" "^7.14.5" "@babel/plugin-syntax-dynamic-import" "^7.8.3" "@babel/plugin-syntax-export-namespace-from" "^7.8.3" "@babel/plugin-syntax-json-strings" "^7.8.3" @@ -809,55 +845,56 @@ "@babel/plugin-syntax-object-rest-spread" "^7.8.3" "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" "@babel/plugin-syntax-optional-chaining" "^7.8.3" - "@babel/plugin-syntax-top-level-await" "^7.12.13" - "@babel/plugin-transform-arrow-functions" "^7.13.0" - "@babel/plugin-transform-async-to-generator" "^7.13.0" - "@babel/plugin-transform-block-scoped-functions" "^7.12.13" - "@babel/plugin-transform-block-scoping" "^7.12.13" - "@babel/plugin-transform-classes" "^7.13.0" - "@babel/plugin-transform-computed-properties" "^7.13.0" - "@babel/plugin-transform-destructuring" "^7.13.0" - "@babel/plugin-transform-dotall-regex" "^7.12.13" - "@babel/plugin-transform-duplicate-keys" "^7.12.13" - "@babel/plugin-transform-exponentiation-operator" "^7.12.13" - "@babel/plugin-transform-for-of" "^7.13.0" - "@babel/plugin-transform-function-name" "^7.12.13" - "@babel/plugin-transform-literals" "^7.12.13" - "@babel/plugin-transform-member-expression-literals" "^7.12.13" - "@babel/plugin-transform-modules-amd" "^7.13.0" - "@babel/plugin-transform-modules-commonjs" "^7.13.8" - "@babel/plugin-transform-modules-systemjs" "^7.13.8" - "@babel/plugin-transform-modules-umd" "^7.13.0" - "@babel/plugin-transform-named-capturing-groups-regex" "^7.12.13" - "@babel/plugin-transform-new-target" "^7.12.13" - "@babel/plugin-transform-object-super" "^7.12.13" - "@babel/plugin-transform-parameters" "^7.13.0" - "@babel/plugin-transform-property-literals" "^7.12.13" - "@babel/plugin-transform-regenerator" "^7.13.15" - "@babel/plugin-transform-reserved-words" "^7.12.13" - "@babel/plugin-transform-shorthand-properties" "^7.12.13" - "@babel/plugin-transform-spread" "^7.13.0" - "@babel/plugin-transform-sticky-regex" "^7.12.13" - "@babel/plugin-transform-template-literals" "^7.13.0" - "@babel/plugin-transform-typeof-symbol" "^7.12.13" - "@babel/plugin-transform-unicode-escapes" "^7.12.13" - "@babel/plugin-transform-unicode-regex" "^7.12.13" + "@babel/plugin-syntax-private-property-in-object" "^7.14.5" + "@babel/plugin-syntax-top-level-await" "^7.14.5" + "@babel/plugin-transform-arrow-functions" "^7.14.5" + "@babel/plugin-transform-async-to-generator" "^7.14.5" + "@babel/plugin-transform-block-scoped-functions" "^7.14.5" + "@babel/plugin-transform-block-scoping" "^7.14.5" + "@babel/plugin-transform-classes" "^7.14.5" + "@babel/plugin-transform-computed-properties" "^7.14.5" + "@babel/plugin-transform-destructuring" "^7.14.7" + "@babel/plugin-transform-dotall-regex" "^7.14.5" + "@babel/plugin-transform-duplicate-keys" "^7.14.5" + "@babel/plugin-transform-exponentiation-operator" "^7.14.5" + "@babel/plugin-transform-for-of" "^7.14.5" + "@babel/plugin-transform-function-name" "^7.14.5" + "@babel/plugin-transform-literals" "^7.14.5" + "@babel/plugin-transform-member-expression-literals" "^7.14.5" + "@babel/plugin-transform-modules-amd" "^7.14.5" + "@babel/plugin-transform-modules-commonjs" "^7.14.5" + "@babel/plugin-transform-modules-systemjs" "^7.14.5" + "@babel/plugin-transform-modules-umd" "^7.14.5" + "@babel/plugin-transform-named-capturing-groups-regex" "^7.14.7" + "@babel/plugin-transform-new-target" "^7.14.5" + "@babel/plugin-transform-object-super" "^7.14.5" + "@babel/plugin-transform-parameters" "^7.14.5" + "@babel/plugin-transform-property-literals" "^7.14.5" + "@babel/plugin-transform-regenerator" "^7.14.5" + "@babel/plugin-transform-reserved-words" "^7.14.5" + "@babel/plugin-transform-shorthand-properties" "^7.14.5" + "@babel/plugin-transform-spread" "^7.14.6" + "@babel/plugin-transform-sticky-regex" "^7.14.5" + "@babel/plugin-transform-template-literals" "^7.14.5" + "@babel/plugin-transform-typeof-symbol" "^7.14.5" + "@babel/plugin-transform-unicode-escapes" "^7.14.5" + "@babel/plugin-transform-unicode-regex" "^7.14.5" "@babel/preset-modules" "^0.1.4" - "@babel/types" "^7.13.14" - babel-plugin-polyfill-corejs2 "^0.2.0" - babel-plugin-polyfill-corejs3 "^0.2.0" - babel-plugin-polyfill-regenerator "^0.2.0" - core-js-compat "^3.9.0" + "@babel/types" "^7.14.5" + babel-plugin-polyfill-corejs2 "^0.2.2" + babel-plugin-polyfill-corejs3 "^0.2.2" + babel-plugin-polyfill-regenerator "^0.2.2" + core-js-compat "^3.15.0" semver "^6.3.0" -"@babel/preset-flow@^7.13.13": - version "7.13.13" - resolved "https://registry.yarnpkg.com/@babel/preset-flow/-/preset-flow-7.13.13.tgz#a61a1c149b3f77589d795287744393444d5cdd9e" - integrity sha512-MDtwtamMifqq3R2mC7l3A3uFalUb3NH5TIBQWjN/epEPlZktcLq4se3J+ivckKrLMGsR7H9LW8+pYuIUN9tsKg== +"@babel/preset-flow@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/preset-flow/-/preset-flow-7.14.5.tgz#a1810b0780c8b48ab0bece8e7ab8d0d37712751c" + integrity sha512-pP5QEb4qRUSVGzzKx9xqRuHUrM/jEzMqdrZpdMA+oUCRgd5zM1qGr5y5+ZgAL/1tVv1H0dyk5t4SKJntqyiVtg== dependencies: - "@babel/helper-plugin-utils" "^7.13.0" - "@babel/helper-validator-option" "^7.12.17" - "@babel/plugin-transform-flow-strip-types" "^7.13.0" + "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-validator-option" "^7.14.5" + "@babel/plugin-transform-flow-strip-types" "^7.14.5" "@babel/preset-modules@^0.1.4": version "0.1.4" @@ -870,400 +907,577 @@ "@babel/types" "^7.4.4" esutils "^2.0.2" -"@babel/preset-typescript@^7.13.0": - version "7.13.0" - resolved "https://registry.yarnpkg.com/@babel/preset-typescript/-/preset-typescript-7.13.0.tgz#ab107e5f050609d806fbb039bec553b33462c60a" - integrity sha512-LXJwxrHy0N3f6gIJlYbLta1D9BDtHpQeqwzM0LIfjDlr6UE/D5Mc7W4iDiQzaE+ks0sTjT26ArcHWnJVt0QiHw== +"@babel/preset-typescript@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/preset-typescript/-/preset-typescript-7.14.5.tgz#aa98de119cf9852b79511f19e7f44a2d379bcce0" + integrity sha512-u4zO6CdbRKbS9TypMqrlGH7sd2TAJppZwn3c/ZRLeO/wGsbddxgbPDUZVNrie3JWYLQ9vpineKlsrWFvO6Pwkw== dependencies: - "@babel/helper-plugin-utils" "^7.13.0" - "@babel/helper-validator-option" "^7.12.17" - "@babel/plugin-transform-typescript" "^7.13.0" + "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-validator-option" "^7.14.5" + "@babel/plugin-transform-typescript" "^7.14.5" -"@babel/runtime@^7.12.1", "@babel/runtime@^7.13.7", "@babel/runtime@^7.13.8", "@babel/runtime@^7.8.4", "@babel/runtime@^7.9.2": - version "7.13.17" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.13.17.tgz#8966d1fc9593bf848602f0662d6b4d0069e3a7ec" - integrity sha512-NCdgJEelPTSh+FEFylhnP1ylq848l1z9t9N0j1Lfbcw0+KXGjsTvUmkxy+voLLXB5SOKMbLLx4jxYliGrYQseA== +"@babel/runtime@^7.12.1", "@babel/runtime@^7.13.9", "@babel/runtime@^7.14.6", "@babel/runtime@^7.8.4", "@babel/runtime@^7.9.2": + version "7.14.6" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.14.6.tgz#535203bc0892efc7dec60bdc27b2ecf6e409062d" + integrity sha512-/PCB2uJ7oM44tz8YhC4Z/6PeOKXp4K588f+5M3clr1M4zbqztlo0XEfJ2LEzj/FgwfgGcIdl8n7YYjTCI0BYwg== dependencies: regenerator-runtime "^0.13.4" -"@babel/template@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.12.13.tgz#530265be8a2589dbb37523844c5bcb55947fb327" - integrity sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA== - dependencies: - "@babel/code-frame" "^7.12.13" - "@babel/parser" "^7.12.13" - "@babel/types" "^7.12.13" - -"@babel/traverse@^7.13.0", "@babel/traverse@^7.13.13", "@babel/traverse@^7.13.15", "@babel/traverse@^7.13.17": - version "7.13.17" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.13.17.tgz#c85415e0c7d50ac053d758baec98b28b2ecfeea3" - integrity sha512-BMnZn0R+X6ayqm3C3To7o1j7Q020gWdqdyP50KEoVqaCO2c/Im7sYZSmVgvefp8TTMQ+9CtwuBp0Z1CZ8V3Pvg== - dependencies: - "@babel/code-frame" "^7.12.13" - "@babel/generator" "^7.13.16" - "@babel/helper-function-name" "^7.12.13" - "@babel/helper-split-export-declaration" "^7.12.13" - "@babel/parser" "^7.13.16" - "@babel/types" "^7.13.17" +"@babel/template@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.14.5.tgz#a9bc9d8b33354ff6e55a9c60d1109200a68974f4" + integrity sha512-6Z3Po85sfxRGachLULUhOmvAaOo7xCvqGQtxINai2mEGPFm6pQ4z5QInFnUrRpfoSV60BnjyF5F3c+15fxFV1g== + dependencies: + "@babel/code-frame" "^7.14.5" + "@babel/parser" "^7.14.5" + "@babel/types" "^7.14.5" + +"@babel/traverse@^7.13.0", "@babel/traverse@^7.14.5": + version "7.14.7" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.14.7.tgz#64007c9774cfdc3abd23b0780bc18a3ce3631753" + integrity sha512-9vDr5NzHu27wgwejuKL7kIOm4bwEtaPQ4Z6cpCmjSuaRqpH/7xc4qcGEscwMqlkwgcXl6MvqoAjZkQ24uSdIZQ== + dependencies: + "@babel/code-frame" "^7.14.5" + "@babel/generator" "^7.14.5" + "@babel/helper-function-name" "^7.14.5" + "@babel/helper-hoist-variables" "^7.14.5" + "@babel/helper-split-export-declaration" "^7.14.5" + "@babel/parser" "^7.14.7" + "@babel/types" "^7.14.5" debug "^4.1.0" globals "^11.1.0" -"@babel/types@^7.12.1", "@babel/types@^7.12.13", "@babel/types@^7.13.0", "@babel/types@^7.13.12", "@babel/types@^7.13.14", "@babel/types@^7.13.16", "@babel/types@^7.13.17", "@babel/types@^7.4.4": - version "7.13.17" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.13.17.tgz#48010a115c9fba7588b4437dd68c9469012b38b4" - integrity sha512-RawydLgxbOPDlTLJNtoIypwdmAy//uQIzlKt2+iBiJaRlVuI6QLUxVAyWGNfOzp8Yu4L4lLIacoCyTNtpb4wiA== +"@babel/types@^7.14.5", "@babel/types@^7.4.4": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.14.5.tgz#3bb997ba829a2104cedb20689c4a5b8121d383ff" + integrity sha512-M/NzBpEL95I5Hh4dwhin5JlE7EzO5PHMAuzjxss3tiOBD46KfQvVedN/3jEPZvdRvtsK2222XfdHogNIttFgcg== dependencies: - "@babel/helper-validator-identifier" "^7.12.11" + "@babel/helper-validator-identifier" "^7.14.5" to-fast-properties "^2.0.0" -"@dabh/diagnostics@^2.0.2": - version "2.0.2" - resolved "https://registry.yarnpkg.com/@dabh/diagnostics/-/diagnostics-2.0.2.tgz#290d08f7b381b8f94607dc8f471a12c675f9db31" - integrity sha512-+A1YivoVDNNVCdfozHSR8v/jyuuLTMXwjWuxPFlFlUapXoGc+Gj9mDlTDDfrwl7rXCl2tNZ0kE8sIBO6YOn96Q== +"@confio/ics23@^0.6.3": + version "0.6.5" + resolved "https://registry.yarnpkg.com/@confio/ics23/-/ics23-0.6.5.tgz#9c21a61089d4c3c2429875a69d6d9cd8c87512aa" + integrity sha512-1GdPMsaP/l8JSF4P4HWFLBhdcxHcJT8lS0nknBYNSZ1XrJOsJKUy6EkOwd9Pa1qJkXzY2gyNv7MdHR+AIwSTAg== dependencies: - colorspace "1.1.x" - enabled "2.0.x" - kuler "^2.0.0" + js-sha512 "^0.8.0" + protobufjs "^6.8.8" + ripemd160 "^2.0.2" + sha.js "^2.4.11" -"@ethersproject/abi@5.3.1", "@ethersproject/abi@^5.3.0": - version "5.3.1" - resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.3.1.tgz#69a1a496729d3a83521675a57cbe21f3cc27241c" - integrity sha512-F98FWTJG7nWWAQ4DcV6R0cSlrj67MWK3ylahuFbzkumem5cLWg1p7fZ3vIdRoS1c7TEf55Lvyx0w7ICR47IImw== - dependencies: - "@ethersproject/address" "^5.3.0" - "@ethersproject/bignumber" "^5.3.0" - "@ethersproject/bytes" "^5.3.0" - "@ethersproject/constants" "^5.3.0" - "@ethersproject/hash" "^5.3.0" - "@ethersproject/keccak256" "^5.3.0" - "@ethersproject/logger" "^5.3.0" - "@ethersproject/properties" "^5.3.0" - "@ethersproject/strings" "^5.3.0" - -"@ethersproject/abstract-provider@5.3.0", "@ethersproject/abstract-provider@^5.3.0": - version "5.3.0" - resolved "https://registry.yarnpkg.com/@ethersproject/abstract-provider/-/abstract-provider-5.3.0.tgz#f4c0ae4a4cef9f204d7781de805fd44b72756c81" - integrity sha512-1+MLhGP1GwxBDBNwMWVmhCsvKwh4gK7oIfOrmlmePNeskg1NhIrYssraJBieaFNHUYfKEd/1DjiVZMw8Qu5Cxw== - dependencies: - "@ethersproject/bignumber" "^5.3.0" - "@ethersproject/bytes" "^5.3.0" - "@ethersproject/logger" "^5.3.0" - "@ethersproject/networks" "^5.3.0" - "@ethersproject/properties" "^5.3.0" - "@ethersproject/transactions" "^5.3.0" - "@ethersproject/web" "^5.3.0" - -"@ethersproject/abstract-signer@5.3.0", "@ethersproject/abstract-signer@^5.3.0": - version "5.3.0" - resolved "https://registry.yarnpkg.com/@ethersproject/abstract-signer/-/abstract-signer-5.3.0.tgz#05172b653e15b535ed5854ef5f6a72f4b441052d" - integrity sha512-w8IFwOYqiPrtvosPuArZ3+QPR2nmdVTRrVY8uJYL3NNfMmQfTy3V3l2wbzX47UUlNbPJY+gKvzJAyvK1onZxJg== - dependencies: - "@ethersproject/abstract-provider" "^5.3.0" - "@ethersproject/bignumber" "^5.3.0" - "@ethersproject/bytes" "^5.3.0" - "@ethersproject/logger" "^5.3.0" - "@ethersproject/properties" "^5.3.0" +"@cosmjs/amino@^0.25.0-alpha.2", "@cosmjs/amino@^0.25.5": + version "0.25.5" + resolved "https://registry.yarnpkg.com/@cosmjs/amino/-/amino-0.25.5.tgz#a22abac74057848834f1e3b0d2b90a0a328dd119" + integrity sha512-q9tU2b9hJ3S/KxYCLSyiZCfkaidbSPBr2sJ5HPLxz48y5O4k9sYM7bPa0zioeePaIBnby3AOgyjucVxlbzUlYg== + dependencies: + "@cosmjs/crypto" "^0.25.5" + "@cosmjs/encoding" "^0.25.5" + "@cosmjs/math" "^0.25.5" + "@cosmjs/utils" "^0.25.5" + +"@cosmjs/crypto@^0.25.0-alpha.2", "@cosmjs/crypto@^0.25.5": + version "0.25.5" + resolved "https://registry.yarnpkg.com/@cosmjs/crypto/-/crypto-0.25.5.tgz#4b8e4a8693f9f597b4de92df1b1057f61ec7a735" + integrity sha512-i0Nfbk4JXAwyKNGPFu0o1xV6IJUbYmmveySytbU/yweybcZppxoczjSQ1sGrUaLVLvgfcpfwZte3jKqDR67+dg== + dependencies: + "@cosmjs/encoding" "^0.25.5" + "@cosmjs/math" "^0.25.5" + "@cosmjs/utils" "^0.25.5" + bip39 "^3.0.2" + bn.js "^4.11.8" + elliptic "^6.5.3" + js-sha3 "^0.8.0" + libsodium-wrappers "^0.7.6" + ripemd160 "^2.0.2" + sha.js "^2.4.11" -"@ethersproject/address@5.3.0", "@ethersproject/address@^5.3.0": - version "5.3.0" - resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.3.0.tgz#e53b69eacebf332e8175de814c5e6507d6932518" - integrity sha512-29TgjzEBK+gUEUAOfWCG7s9IxLNLCqvr+oDSk6L9TXD0VLvZJKhJV479tKQqheVA81OeGxfpdxYtUVH8hqlCvA== +"@cosmjs/encoding@0.23.1": + version "0.23.1" + resolved "https://registry.yarnpkg.com/@cosmjs/encoding/-/encoding-0.23.1.tgz#b51cd2813499cfdeeb0f9cc7d050a45eb8b27bf4" + integrity sha512-rP5O3vYo0k6W329J+u5uKqJNrhmR4QTngLgsDvP/qsRRBfEiirhk+TQC8gjUlgnzoiCKCtWsiOyFP1z9Me9HIw== dependencies: - "@ethersproject/bignumber" "^5.3.0" - "@ethersproject/bytes" "^5.3.0" - "@ethersproject/keccak256" "^5.3.0" - "@ethersproject/logger" "^5.3.0" - "@ethersproject/rlp" "^5.3.0" + base64-js "^1.3.0" + bech32 "^1.1.4" + readonly-date "^1.0.0" -"@ethersproject/base64@5.3.0", "@ethersproject/base64@^5.3.0": - version "5.3.0" - resolved "https://registry.yarnpkg.com/@ethersproject/base64/-/base64-5.3.0.tgz#b831fb35418b42ad24d943c557259062b8640824" - integrity sha512-JIqgtOmgKcbc2sjGWTXyXktqUhvFUDte8fPVsAaOrcPiJf6YotNF+nsrOYGC9pbHBEGSuSBp3QR0varkO8JHEw== +"@cosmjs/encoding@^0.25.0-alpha.2", "@cosmjs/encoding@^0.25.5": + version "0.25.5" + resolved "https://registry.yarnpkg.com/@cosmjs/encoding/-/encoding-0.25.5.tgz#edc90084b112b57ca73ec82c1682ac9c4da3bb3a" + integrity sha512-QT7MaPBiMeCaMJ6VZZKeOqDQlAxMEzTFjBFhbkdyx5DVRc4dPOVO4HbTggmIN5/eizIv4/CNJSVTR//tO53J0A== dependencies: - "@ethersproject/bytes" "^5.3.0" + base64-js "^1.3.0" + bech32 "^1.1.4" + readonly-date "^1.0.0" -"@ethersproject/basex@5.3.0", "@ethersproject/basex@^5.3.0": - version "5.3.0" - resolved "https://registry.yarnpkg.com/@ethersproject/basex/-/basex-5.3.0.tgz#02dea3ab8559ae625c6d548bc11773432255c916" - integrity sha512-8J4nS6t/SOnoCgr3DF5WCSRLC5YwTKYpZWJqeyYQLX+86TwPhtzvHXacODzcDII9tWKhVg6g0Bka8JCBWXsCiQ== +"@cosmjs/json-rpc@^0.25.0-alpha.2", "@cosmjs/json-rpc@^0.25.5": + version "0.25.5" + resolved "https://registry.yarnpkg.com/@cosmjs/json-rpc/-/json-rpc-0.25.5.tgz#34c7489fc6ae32a4acaabf658e057a55c431a193" + integrity sha512-WFDallAolxBqB8V/mYxU0riF/OBoc6Fc2DDsZhds5xOZxeN9sTX0qWhu1UiFyURw4Z9D+SjB9QngqSDBTMTdjw== dependencies: - "@ethersproject/bytes" "^5.3.0" - "@ethersproject/properties" "^5.3.0" + "@cosmjs/stream" "^0.25.5" + xstream "^11.14.0" -"@ethersproject/bignumber@5.3.0", "@ethersproject/bignumber@^5.3.0": - version "5.3.0" - resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.3.0.tgz#74ab2ec9c3bda4e344920565720a6ee9c794e9db" - integrity sha512-5xguJ+Q1/zRMgHgDCaqAexx/8DwDVLRemw2i6uR8KyGjwGdXI8f32QZZ1cKGucBN6ekJvpUpHy6XAuQnTv0mPA== +"@cosmjs/math@0.23.1": + version "0.23.1" + resolved "https://registry.yarnpkg.com/@cosmjs/math/-/math-0.23.1.tgz#706f38742a9a1f6561cf2c4510f8e5ab001fc5e6" + integrity sha512-xjGGogFZXLdmRumE1Wr+GlPfKznIl5Qa6K6QyZr4IjBhfB6/ZzLUihliDJp2d8zbjBJgQt9RUwP/PaFQ/yGQNg== dependencies: - "@ethersproject/bytes" "^5.3.0" - "@ethersproject/logger" "^5.3.0" - bn.js "^4.11.9" + bn.js "^4.11.8" -"@ethersproject/bytes@5.3.0", "@ethersproject/bytes@^5.3.0": - version "5.3.0" - resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.3.0.tgz#473e0da7f831d535b2002be05e6f4ca3729a1bc9" - integrity sha512-rqLJjdVqCcn7glPer7Fxh87PRqlnRScVAoxcIP3PmOUNApMWJ6yRdOFfo2KvPAdO7Le3yEI1o0YW+Yvr7XCYvw== +"@cosmjs/math@^0.25.0-alpha.2", "@cosmjs/math@^0.25.5": + version "0.25.5" + resolved "https://registry.yarnpkg.com/@cosmjs/math/-/math-0.25.5.tgz#0f586610353c95b2055d1b2556a232622cd2d453" + integrity sha512-LWovT1uTHlr+VEce27/14Wrgc4INJYOYk1+ncyvbZertixNFH6OMnc9Xkk0DIV4RYmW+/fvB9kCXVnNtQGSuHg== dependencies: - "@ethersproject/logger" "^5.3.0" + bn.js "^4.11.8" -"@ethersproject/constants@5.3.0", "@ethersproject/constants@^5.3.0": - version "5.3.0" - resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.3.0.tgz#a5d6d86c0eec2c64c3024479609493b9afb3fc77" - integrity sha512-4y1feNOwEpgjAfiCFWOHznvv6qUF/H6uI0UKp8xdhftb+H+FbKflXg1pOgH5qs4Sr7EYBL+zPyPb+YD5g1aEyw== +"@cosmjs/proto-signing@^0.25.0-alpha.2": + version "0.25.5" + resolved "https://registry.yarnpkg.com/@cosmjs/proto-signing/-/proto-signing-0.25.5.tgz#93122ed1d57518a1c520917afde62e5aa9754033" + integrity sha512-YWVp+dGHt7v6ZKjOs8CI9xkpOV49eweHbYMv/vCVYF4cEh0kWwy2WzbWIkUH9zwwUqCxigVOTBYUCfbsjEbfug== dependencies: - "@ethersproject/bignumber" "^5.3.0" - -"@ethersproject/contracts@5.3.0": - version "5.3.0" - resolved "https://registry.yarnpkg.com/@ethersproject/contracts/-/contracts-5.3.0.tgz#ad699a3abaae30bfb6422cf31813a663b2d4099c" - integrity sha512-eDyQ8ltykvyQqnGZxb/c1e0OnEtzqXhNNC4BX8nhYBCaoBrYYuK/1fLmyEvc5+XUMoxNhwpYkoSSwvPLci7/Zg== - dependencies: - "@ethersproject/abi" "^5.3.0" - "@ethersproject/abstract-provider" "^5.3.0" - "@ethersproject/abstract-signer" "^5.3.0" - "@ethersproject/address" "^5.3.0" - "@ethersproject/bignumber" "^5.3.0" - "@ethersproject/bytes" "^5.3.0" - "@ethersproject/constants" "^5.3.0" - "@ethersproject/logger" "^5.3.0" - "@ethersproject/properties" "^5.3.0" - "@ethersproject/transactions" "^5.3.0" - -"@ethersproject/hash@5.3.0", "@ethersproject/hash@^5.3.0": - version "5.3.0" - resolved "https://registry.yarnpkg.com/@ethersproject/hash/-/hash-5.3.0.tgz#f65e3bf3db3282df4da676db6cfa049535dd3643" - integrity sha512-gAFZSjUPQ32CIfoKSMtMEQ+IO0kQxqhwz9fCIFt2DtAq2u4pWt8mL9Z5P0r6KkLcQU8LE9FmuPPyd+JvBzmr1w== - dependencies: - "@ethersproject/abstract-signer" "^5.3.0" - "@ethersproject/address" "^5.3.0" - "@ethersproject/bignumber" "^5.3.0" - "@ethersproject/bytes" "^5.3.0" - "@ethersproject/keccak256" "^5.3.0" - "@ethersproject/logger" "^5.3.0" - "@ethersproject/properties" "^5.3.0" - "@ethersproject/strings" "^5.3.0" - -"@ethersproject/hdnode@5.3.0", "@ethersproject/hdnode@^5.3.0": - version "5.3.0" - resolved "https://registry.yarnpkg.com/@ethersproject/hdnode/-/hdnode-5.3.0.tgz#26fed65ffd5c25463fddff13f5fb4e5617553c94" - integrity sha512-zLmmtLNoDMGoYRdjOab01Zqkvp+TmZyCGDAMQF1Bs3yZyBs/kzTNi1qJjR1jVUcPP5CWGtjFwY8iNG8oNV9J8g== - dependencies: - "@ethersproject/abstract-signer" "^5.3.0" - "@ethersproject/basex" "^5.3.0" - "@ethersproject/bignumber" "^5.3.0" - "@ethersproject/bytes" "^5.3.0" - "@ethersproject/logger" "^5.3.0" - "@ethersproject/pbkdf2" "^5.3.0" - "@ethersproject/properties" "^5.3.0" - "@ethersproject/sha2" "^5.3.0" - "@ethersproject/signing-key" "^5.3.0" - "@ethersproject/strings" "^5.3.0" - "@ethersproject/transactions" "^5.3.0" - "@ethersproject/wordlists" "^5.3.0" - -"@ethersproject/json-wallets@5.3.0", "@ethersproject/json-wallets@^5.3.0": - version "5.3.0" - resolved "https://registry.yarnpkg.com/@ethersproject/json-wallets/-/json-wallets-5.3.0.tgz#7b1a5ff500c12aa8597ae82c8939837b0449376e" - integrity sha512-/xwbqaIb5grUIGNmeEaz8GdcpmDr++X8WT4Jqcclnxow8PXCUHFeDxjf3O+nSuoqOYG/Ds0+BI5xuQKbva6Xkw== - dependencies: - "@ethersproject/abstract-signer" "^5.3.0" - "@ethersproject/address" "^5.3.0" - "@ethersproject/bytes" "^5.3.0" - "@ethersproject/hdnode" "^5.3.0" - "@ethersproject/keccak256" "^5.3.0" - "@ethersproject/logger" "^5.3.0" - "@ethersproject/pbkdf2" "^5.3.0" - "@ethersproject/properties" "^5.3.0" - "@ethersproject/random" "^5.3.0" - "@ethersproject/strings" "^5.3.0" - "@ethersproject/transactions" "^5.3.0" - aes-js "3.0.0" - scrypt-js "3.0.1" + "@cosmjs/amino" "^0.25.5" + long "^4.0.0" + protobufjs "~6.10.2" -"@ethersproject/keccak256@5.3.0", "@ethersproject/keccak256@^5.3.0": - version "5.3.0" - resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.3.0.tgz#fb5cd36bdfd6fa02e2ea84964078a9fc6bd731be" - integrity sha512-Gv2YqgIUmRbYVNIibafT0qGaeGYLIA/EdWHJ7JcVxVSs2vyxafGxOJ5VpSBHWeOIsE6OOaCelYowhuuTicgdFQ== +"@cosmjs/socket@^0.25.0-alpha.2", "@cosmjs/socket@^0.25.5": + version "0.25.5" + resolved "https://registry.yarnpkg.com/@cosmjs/socket/-/socket-0.25.5.tgz#2b565afd310cdfaf3b106b901302ae93d849ec54" + integrity sha512-wcJVbD4xlF4+5hMum4tOmAy5ppX+E9qrB9Pvt3T7BK+6T5uobxiBQCLEiDwHP3n42RBj+xQWJrScPf5IEWmZKg== dependencies: - "@ethersproject/bytes" "^5.3.0" - js-sha3 "0.5.7" - -"@ethersproject/logger@5.3.0", "@ethersproject/logger@^5.3.0": - version "5.3.0" - resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.3.0.tgz#7a69fa1d4ca0d4b7138da1627eb152f763d84dd0" - integrity sha512-8bwJ2gxJGkZZnpQSq5uSiZSJjyVTWmlGft4oH8vxHdvO1Asy4TwVepAhPgxIQIMxXZFUNMych1YjIV4oQ4I7dA== + "@cosmjs/stream" "^0.25.5" + isomorphic-ws "^4.0.1" + ws "^7" + xstream "^11.14.0" + +"@cosmjs/stargate@0.25.0-alpha.2": + version "0.25.0-alpha.2" + resolved "https://registry.yarnpkg.com/@cosmjs/stargate/-/stargate-0.25.0-alpha.2.tgz#db6fa0002e96f62875e5b72378e24bd19ef9478f" + integrity sha512-r6VT720EuF6yPwS1WGPPUAPUOfD5aVIRlVJNJHkePWGg4l+ztJtoUbr7QN1CoPrxvG3b+WflNug1EQ7dG44UsA== + dependencies: + "@confio/ics23" "^0.6.3" + "@cosmjs/amino" "^0.25.0-alpha.2" + "@cosmjs/encoding" "^0.25.0-alpha.2" + "@cosmjs/math" "^0.25.0-alpha.2" + "@cosmjs/proto-signing" "^0.25.0-alpha.2" + "@cosmjs/stream" "^0.25.0-alpha.2" + "@cosmjs/tendermint-rpc" "^0.25.0-alpha.2" + "@cosmjs/utils" "^0.25.0-alpha.2" + long "^4.0.0" + protobufjs "~6.10.2" + +"@cosmjs/stream@^0.25.0-alpha.2", "@cosmjs/stream@^0.25.5": + version "0.25.5" + resolved "https://registry.yarnpkg.com/@cosmjs/stream/-/stream-0.25.5.tgz#5c538fc11e9d3d3ef16849164730dafee180e22e" + integrity sha512-a+0sDNKZTxw9p4j5tl7SI0siMTii7AQot1+5vkH5BkQoAv3C3D8jagPouUz3RUFuh13qftPxPLiHzDFLNSjTnQ== + dependencies: + xstream "^11.14.0" + +"@cosmjs/tendermint-rpc@0.25.0-alpha.2": + version "0.25.0-alpha.2" + resolved "https://registry.yarnpkg.com/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.25.0-alpha.2.tgz#15e31d8a9385085740ec71ea0029b9ebb9dd757e" + integrity sha512-1xK8mPwFWiWnyGafZhAdwYfcYmXl1l7UxQRR3yI2Q3kDk7CQhT87mgeAd56jw9JOaZvLYKKTgCRZkLNiKjXNew== + dependencies: + "@cosmjs/crypto" "^0.25.0-alpha.2" + "@cosmjs/encoding" "^0.25.0-alpha.2" + "@cosmjs/json-rpc" "^0.25.0-alpha.2" + "@cosmjs/math" "^0.25.0-alpha.2" + "@cosmjs/socket" "^0.25.0-alpha.2" + "@cosmjs/stream" "^0.25.0-alpha.2" + axios "^0.21.1" + readonly-date "^1.0.0" + xstream "^11.14.0" + +"@cosmjs/tendermint-rpc@^0.25.0-alpha.2": + version "0.25.5" + resolved "https://registry.yarnpkg.com/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.25.5.tgz#5467391f430f648d46d9f39aa4324515affb8578" + integrity sha512-WlUCFVdhbwA3IDA1C858S8WOtLseZLXKTdj5fz1sTKSBmtrig4l1ZMKHHlZRprvmjSpkpbjgSQU+RjjvBd75BA== + dependencies: + "@cosmjs/crypto" "^0.25.5" + "@cosmjs/encoding" "^0.25.5" + "@cosmjs/json-rpc" "^0.25.5" + "@cosmjs/math" "^0.25.5" + "@cosmjs/socket" "^0.25.5" + "@cosmjs/stream" "^0.25.5" + axios "^0.21.1" + readonly-date "^1.0.0" + xstream "^11.14.0" + +"@cosmjs/utils@^0.25.0-alpha.2", "@cosmjs/utils@^0.25.5": + version "0.25.5" + resolved "https://registry.yarnpkg.com/@cosmjs/utils/-/utils-0.25.5.tgz#6dc9d8de81acb9d49b6d1420f61ea2390f5d5f07" + integrity sha512-U4YdgJadFgXWblthgyXqP28Yw5rsw2IX/cOES0pa6fiB81hoYl2LXqXiuKp2yVPoAgk8JpkFh3i5KchcD9muJg== + +"@crypto-com/chain-jslib@^0.0.16": + version "0.0.16" + resolved "https://registry.yarnpkg.com/@crypto-com/chain-jslib/-/chain-jslib-0.0.16.tgz#d09563d62200db7ad3955438abf2a5722ebc4e4c" + integrity sha512-iLq4XC0Jq7BZJXZ4xL3bmmjEUMH8VlPirUCM5Unyc2S1QL1A9NzWngoJS6ua7MgL7WPQOjqJrKpZAmt6quI1ow== + dependencies: + "@cosmjs/encoding" "0.23.1" + "@cosmjs/math" "0.23.1" + "@cosmjs/stargate" "0.25.0-alpha.2" + "@cosmjs/tendermint-rpc" "0.25.0-alpha.2" + axios "0.21.1" + bech32 "1.1.4" + big.js "6.0.0" + bip32 "2.0.6" + bip39 "3.0.2" + buffer "5.6.1" + create-hash "1.2.0" + lodash "4.17.21" + long "4.0.0" + ow "0.17.0" + protobufjs "6.10.1" + randombytes "2.1.0" + secp256k1 "4.0.2" -"@ethersproject/networks@5.3.1", "@ethersproject/networks@^5.3.0": - version "5.3.1" - resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.3.1.tgz#78fe08324cee289ce239acf8c746121934b2ef61" - integrity sha512-6uQKHkYChlsfeiZhQ8IHIqGE/sQsf25o9ZxAYpMxi15dLPzz3IxOEF5KiSD32aHwsjXVBKBSlo+teAXLlYJybw== +"@dabh/diagnostics@^2.0.2": + version "2.0.2" + resolved "https://registry.yarnpkg.com/@dabh/diagnostics/-/diagnostics-2.0.2.tgz#290d08f7b381b8f94607dc8f471a12c675f9db31" + integrity sha512-+A1YivoVDNNVCdfozHSR8v/jyuuLTMXwjWuxPFlFlUapXoGc+Gj9mDlTDDfrwl7rXCl2tNZ0kE8sIBO6YOn96Q== dependencies: - "@ethersproject/logger" "^5.3.0" + colorspace "1.1.x" + enabled "2.0.x" + kuler "^2.0.0" -"@ethersproject/pbkdf2@5.3.0", "@ethersproject/pbkdf2@^5.3.0": - version "5.3.0" - resolved "https://registry.yarnpkg.com/@ethersproject/pbkdf2/-/pbkdf2-5.3.0.tgz#8adbb41489c3c9f319cc44bc7d3e6095fd468dc8" - integrity sha512-Q9ChVU6gBFiex0FSdtzo4b0SAKz3ZYcYVFLrEWHL0FnHvNk3J3WgAtRNtBQGQYn/T5wkoTdZttMbfBkFlaiWcA== - dependencies: - "@ethersproject/bytes" "^5.3.0" - "@ethersproject/sha2" "^5.3.0" +"@ethersproject/abi@5.4.0", "@ethersproject/abi@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.4.0.tgz#a6d63bdb3672f738398846d4279fa6b6c9818242" + integrity sha512-9gU2H+/yK1j2eVMdzm6xvHSnMxk8waIHQGYCZg5uvAyH0rsAzxkModzBSpbAkAuhKFEovC2S9hM4nPuLym8IZw== + dependencies: + "@ethersproject/address" "^5.4.0" + "@ethersproject/bignumber" "^5.4.0" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/constants" "^5.4.0" + "@ethersproject/hash" "^5.4.0" + "@ethersproject/keccak256" "^5.4.0" + "@ethersproject/logger" "^5.4.0" + "@ethersproject/properties" "^5.4.0" + "@ethersproject/strings" "^5.4.0" + +"@ethersproject/abstract-provider@5.4.0", "@ethersproject/abstract-provider@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/abstract-provider/-/abstract-provider-5.4.0.tgz#415331031b0f678388971e1987305244edc04e1d" + integrity sha512-vPBR7HKUBY0lpdllIn7tLIzNN7DrVnhCLKSzY0l8WAwxz686m/aL7ASDzrVxV93GJtIub6N2t4dfZ29CkPOxgA== + dependencies: + "@ethersproject/bignumber" "^5.4.0" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/logger" "^5.4.0" + "@ethersproject/networks" "^5.4.0" + "@ethersproject/properties" "^5.4.0" + "@ethersproject/transactions" "^5.4.0" + "@ethersproject/web" "^5.4.0" + +"@ethersproject/abstract-signer@5.4.0", "@ethersproject/abstract-signer@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/abstract-signer/-/abstract-signer-5.4.0.tgz#cd5f50b93141ee9f9f49feb4075a0b3eafb57d65" + integrity sha512-AieQAzt05HJZS2bMofpuxMEp81AHufA5D6M4ScKwtolj041nrfIbIi8ciNW7+F59VYxXq+V4c3d568Q6l2m8ew== + dependencies: + "@ethersproject/abstract-provider" "^5.4.0" + "@ethersproject/bignumber" "^5.4.0" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/logger" "^5.4.0" + "@ethersproject/properties" "^5.4.0" + +"@ethersproject/address@5.4.0", "@ethersproject/address@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.4.0.tgz#ba2d00a0f8c4c0854933b963b9a3a9f6eb4a37a3" + integrity sha512-SD0VgOEkcACEG/C6xavlU1Hy3m5DGSXW3CUHkaaEHbAPPsgi0coP5oNPsxau8eTlZOk/bpa/hKeCNoK5IzVI2Q== + dependencies: + "@ethersproject/bignumber" "^5.4.0" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/keccak256" "^5.4.0" + "@ethersproject/logger" "^5.4.0" + "@ethersproject/rlp" "^5.4.0" + +"@ethersproject/base64@5.4.0", "@ethersproject/base64@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/base64/-/base64-5.4.0.tgz#7252bf65295954c9048c7ca5f43e5c86441b2a9a" + integrity sha512-CjQw6E17QDSSC5jiM9YpF7N1aSCHmYGMt9bWD8PWv6YPMxjsys2/Q8xLrROKI3IWJ7sFfZ8B3flKDTM5wlWuZQ== + dependencies: + "@ethersproject/bytes" "^5.4.0" + +"@ethersproject/basex@5.4.0", "@ethersproject/basex@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/basex/-/basex-5.4.0.tgz#0a2da0f4e76c504a94f2b21d3161ed9438c7f8a6" + integrity sha512-J07+QCVJ7np2bcpxydFVf/CuYo9mZ7T73Pe7KQY4c1lRlrixMeblauMxHXD0MPwFmUHZIILDNViVkykFBZylbg== + dependencies: + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/properties" "^5.4.0" + +"@ethersproject/bignumber@5.4.0", "@ethersproject/bignumber@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.4.0.tgz#be8dea298c0ec71208ee60f0b245be0761217ad9" + integrity sha512-OXUu9f9hO3vGRIPxU40cignXZVaYyfx6j9NNMjebKdnaCL3anCLSSy8/b8d03vY6dh7duCC0kW72GEC4tZer2w== + dependencies: + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/logger" "^5.4.0" + bn.js "^4.11.9" -"@ethersproject/properties@5.3.0", "@ethersproject/properties@^5.3.0": - version "5.3.0" - resolved "https://registry.yarnpkg.com/@ethersproject/properties/-/properties-5.3.0.tgz#feef4c4babeb7c10a6b3449575016f4ad2c092b2" - integrity sha512-PaHxJyM5/bfusk6vr3yP//JMnm4UEojpzuWGTmtL5X4uNhNnFNvlYilZLyDr4I9cTkIbipCMsAuIcXWsmdRnEw== +"@ethersproject/bytes@5.4.0", "@ethersproject/bytes@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.4.0.tgz#56fa32ce3bf67153756dbaefda921d1d4774404e" + integrity sha512-H60ceqgTHbhzOj4uRc/83SCN9d+BSUnOkrr2intevqdtEMO1JFVZ1XL84OEZV+QjV36OaZYxtnt4lGmxcGsPfA== + dependencies: + "@ethersproject/logger" "^5.4.0" + +"@ethersproject/constants@5.4.0", "@ethersproject/constants@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.4.0.tgz#ee0bdcb30bf1b532d2353c977bf2ef1ee117958a" + integrity sha512-tzjn6S7sj9+DIIeKTJLjK9WGN2Tj0P++Z8ONEIlZjyoTkBuODN+0VfhAyYksKi43l1Sx9tX2VlFfzjfmr5Wl3Q== + dependencies: + "@ethersproject/bignumber" "^5.4.0" + +"@ethersproject/contracts@5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/contracts/-/contracts-5.4.0.tgz#e05fe6bd33acc98741e27d553889ec5920078abb" + integrity sha512-hkO3L3IhS1Z3ZtHtaAG/T87nQ7KiPV+/qnvutag35I0IkiQ8G3ZpCQ9NNOpSCzn4pWSW4CfzmtE02FcqnLI+hw== + dependencies: + "@ethersproject/abi" "^5.4.0" + "@ethersproject/abstract-provider" "^5.4.0" + "@ethersproject/abstract-signer" "^5.4.0" + "@ethersproject/address" "^5.4.0" + "@ethersproject/bignumber" "^5.4.0" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/constants" "^5.4.0" + "@ethersproject/logger" "^5.4.0" + "@ethersproject/properties" "^5.4.0" + "@ethersproject/transactions" "^5.4.0" + +"@ethersproject/hash@5.4.0", "@ethersproject/hash@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/hash/-/hash-5.4.0.tgz#d18a8e927e828e22860a011f39e429d388344ae0" + integrity sha512-xymAM9tmikKgbktOCjW60Z5sdouiIIurkZUr9oW5NOex5uwxrbsYG09kb5bMcNjlVeJD3yPivTNzViIs1GCbqA== + dependencies: + "@ethersproject/abstract-signer" "^5.4.0" + "@ethersproject/address" "^5.4.0" + "@ethersproject/bignumber" "^5.4.0" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/keccak256" "^5.4.0" + "@ethersproject/logger" "^5.4.0" + "@ethersproject/properties" "^5.4.0" + "@ethersproject/strings" "^5.4.0" + +"@ethersproject/hdnode@5.4.0", "@ethersproject/hdnode@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/hdnode/-/hdnode-5.4.0.tgz#4bc9999b9a12eb5ce80c5faa83114a57e4107cac" + integrity sha512-pKxdS0KAaeVGfZPp1KOiDLB0jba11tG6OP1u11QnYfb7pXn6IZx0xceqWRr6ygke8+Kw74IpOoSi7/DwANhy8Q== + dependencies: + "@ethersproject/abstract-signer" "^5.4.0" + "@ethersproject/basex" "^5.4.0" + "@ethersproject/bignumber" "^5.4.0" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/logger" "^5.4.0" + "@ethersproject/pbkdf2" "^5.4.0" + "@ethersproject/properties" "^5.4.0" + "@ethersproject/sha2" "^5.4.0" + "@ethersproject/signing-key" "^5.4.0" + "@ethersproject/strings" "^5.4.0" + "@ethersproject/transactions" "^5.4.0" + "@ethersproject/wordlists" "^5.4.0" + +"@ethersproject/json-wallets@5.4.0", "@ethersproject/json-wallets@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/json-wallets/-/json-wallets-5.4.0.tgz#2583341cfe313fc9856642e8ace3080154145e95" + integrity sha512-igWcu3fx4aiczrzEHwG1xJZo9l1cFfQOWzTqwRw/xcvxTk58q4f9M7cjh51EKphMHvrJtcezJ1gf1q1AUOfEQQ== + dependencies: + "@ethersproject/abstract-signer" "^5.4.0" + "@ethersproject/address" "^5.4.0" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/hdnode" "^5.4.0" + "@ethersproject/keccak256" "^5.4.0" + "@ethersproject/logger" "^5.4.0" + "@ethersproject/pbkdf2" "^5.4.0" + "@ethersproject/properties" "^5.4.0" + "@ethersproject/random" "^5.4.0" + "@ethersproject/strings" "^5.4.0" + "@ethersproject/transactions" "^5.4.0" + aes-js "3.0.0" + scrypt-js "3.0.1" + +"@ethersproject/keccak256@5.4.0", "@ethersproject/keccak256@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.4.0.tgz#7143b8eea4976080241d2bd92e3b1f1bf7025318" + integrity sha512-FBI1plWet+dPUvAzPAeHzRKiPpETQzqSUWR1wXJGHVWi4i8bOSrpC3NwpkPjgeXG7MnugVc1B42VbfnQikyC/A== dependencies: - "@ethersproject/logger" "^5.3.0" + "@ethersproject/bytes" "^5.4.0" + js-sha3 "0.5.7" -"@ethersproject/providers@5.3.1": - version "5.3.1" - resolved "https://registry.yarnpkg.com/@ethersproject/providers/-/providers-5.3.1.tgz#a12c6370e8cbc0968c9744641b8ef90b0dd5ec2b" - integrity sha512-HC63vENTrur6/JKEhcQbA8PRDj1FAesdpX98IW+xAAo3EAkf70ou5fMIA3KCGzJDLNTeYA4C2Bonz849tVLekg== - dependencies: - "@ethersproject/abstract-provider" "^5.3.0" - "@ethersproject/abstract-signer" "^5.3.0" - "@ethersproject/address" "^5.3.0" - "@ethersproject/basex" "^5.3.0" - "@ethersproject/bignumber" "^5.3.0" - "@ethersproject/bytes" "^5.3.0" - "@ethersproject/constants" "^5.3.0" - "@ethersproject/hash" "^5.3.0" - "@ethersproject/logger" "^5.3.0" - "@ethersproject/networks" "^5.3.0" - "@ethersproject/properties" "^5.3.0" - "@ethersproject/random" "^5.3.0" - "@ethersproject/rlp" "^5.3.0" - "@ethersproject/sha2" "^5.3.0" - "@ethersproject/strings" "^5.3.0" - "@ethersproject/transactions" "^5.3.0" - "@ethersproject/web" "^5.3.0" +"@ethersproject/logger@5.4.0", "@ethersproject/logger@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.4.0.tgz#f39adadf62ad610c420bcd156fd41270e91b3ca9" + integrity sha512-xYdWGGQ9P2cxBayt64d8LC8aPFJk6yWCawQi/4eJ4+oJdMMjEBMrIcIMZ9AxhwpPVmnBPrsB10PcXGmGAqgUEQ== + +"@ethersproject/networks@5.4.1", "@ethersproject/networks@^5.4.0": + version "5.4.1" + resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.4.1.tgz#2ce83b8e42aa85216e5d277a7952d97b6ce8d852" + integrity sha512-8SvowCKz9Uf4xC5DTKI8+il8lWqOr78kmiqAVLYT9lzB8aSmJHQMD1GSuJI0CW4hMAnzocpGpZLgiMdzsNSPig== + dependencies: + "@ethersproject/logger" "^5.4.0" + +"@ethersproject/pbkdf2@5.4.0", "@ethersproject/pbkdf2@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/pbkdf2/-/pbkdf2-5.4.0.tgz#ed88782a67fda1594c22d60d0ca911a9d669641c" + integrity sha512-x94aIv6tiA04g6BnazZSLoRXqyusawRyZWlUhKip2jvoLpzJuLb//KtMM6PEovE47pMbW+Qe1uw+68ameJjB7g== + dependencies: + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/sha2" "^5.4.0" + +"@ethersproject/properties@5.4.0", "@ethersproject/properties@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/properties/-/properties-5.4.0.tgz#38ba20539b44dcc5d5f80c45ad902017dcdbefe7" + integrity sha512-7jczalGVRAJ+XSRvNA6D5sAwT4gavLq3OXPuV/74o3Rd2wuzSL035IMpIMgei4CYyBdialJMrTqkOnzccLHn4A== + dependencies: + "@ethersproject/logger" "^5.4.0" + +"@ethersproject/providers@5.4.1": + version "5.4.1" + resolved "https://registry.yarnpkg.com/@ethersproject/providers/-/providers-5.4.1.tgz#654267b563b833046b9c9647647cfc8267cb93b4" + integrity sha512-p06eiFKz8nu/5Ju0kIX024gzEQIgE5pvvGrBCngpyVjpuLtUIWT3097Agw4mTn9/dEA0FMcfByzFqacBMSgCVg== + dependencies: + "@ethersproject/abstract-provider" "^5.4.0" + "@ethersproject/abstract-signer" "^5.4.0" + "@ethersproject/address" "^5.4.0" + "@ethersproject/basex" "^5.4.0" + "@ethersproject/bignumber" "^5.4.0" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/constants" "^5.4.0" + "@ethersproject/hash" "^5.4.0" + "@ethersproject/logger" "^5.4.0" + "@ethersproject/networks" "^5.4.0" + "@ethersproject/properties" "^5.4.0" + "@ethersproject/random" "^5.4.0" + "@ethersproject/rlp" "^5.4.0" + "@ethersproject/sha2" "^5.4.0" + "@ethersproject/strings" "^5.4.0" + "@ethersproject/transactions" "^5.4.0" + "@ethersproject/web" "^5.4.0" bech32 "1.1.4" ws "7.4.6" -"@ethersproject/random@5.3.0", "@ethersproject/random@^5.3.0": - version "5.3.0" - resolved "https://registry.yarnpkg.com/@ethersproject/random/-/random-5.3.0.tgz#7c46bf36e50cb0d0550bc8c666af8e1d4496dc1a" - integrity sha512-A5SL/4inutSwt3Fh2OD0x2gz+x6GHmuUnIPkR7zAiTidMD2N8F6tZdMF1hlQKWVCcVMWhEQg8mWijhEzm6BBYw== +"@ethersproject/random@5.4.0", "@ethersproject/random@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/random/-/random-5.4.0.tgz#9cdde60e160d024be39cc16f8de3b9ce39191e16" + integrity sha512-pnpWNQlf0VAZDEOVp1rsYQosmv2o0ITS/PecNw+mS2/btF8eYdspkN0vIXrCMtkX09EAh9bdk8GoXmFXM1eAKw== dependencies: - "@ethersproject/bytes" "^5.3.0" - "@ethersproject/logger" "^5.3.0" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/logger" "^5.4.0" -"@ethersproject/rlp@5.3.0", "@ethersproject/rlp@^5.3.0": - version "5.3.0" - resolved "https://registry.yarnpkg.com/@ethersproject/rlp/-/rlp-5.3.0.tgz#7cb93a7b5dfa69163894153c9d4b0d936f333188" - integrity sha512-oI0joYpsRanl9guDubaW+1NbcpK0vJ3F/6Wpcanzcnqq+oaW9O5E98liwkEDPcb16BUTLIJ+ZF8GPIHYxJ/5Pw== +"@ethersproject/rlp@5.4.0", "@ethersproject/rlp@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/rlp/-/rlp-5.4.0.tgz#de61afda5ff979454e76d3b3310a6c32ad060931" + integrity sha512-0I7MZKfi+T5+G8atId9QaQKHRvvasM/kqLyAH4XxBCBchAooH2EX5rL9kYZWwcm3awYV+XC7VF6nLhfeQFKVPg== dependencies: - "@ethersproject/bytes" "^5.3.0" - "@ethersproject/logger" "^5.3.0" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/logger" "^5.4.0" -"@ethersproject/sha2@5.3.0", "@ethersproject/sha2@^5.3.0": - version "5.3.0" - resolved "https://registry.yarnpkg.com/@ethersproject/sha2/-/sha2-5.3.0.tgz#209f9a1649f7d2452dcd5e5b94af43b7f3f42366" - integrity sha512-r5ftlwKcocYEuFz2JbeKOT5SAsCV4m1RJDsTOEfQ5L67ZC7NFDK5i7maPdn1bx4nPhylF9VAwxSrQ1esmwzylg== +"@ethersproject/sha2@5.4.0", "@ethersproject/sha2@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/sha2/-/sha2-5.4.0.tgz#c9a8db1037014cbc4e9482bd662f86c090440371" + integrity sha512-siheo36r1WD7Cy+bDdE1BJ8y0bDtqXCOxRMzPa4bV1TGt/eTUUt03BHoJNB6reWJD8A30E/pdJ8WFkq+/uz4Gg== dependencies: - "@ethersproject/bytes" "^5.3.0" - "@ethersproject/logger" "^5.3.0" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/logger" "^5.4.0" hash.js "1.1.7" -"@ethersproject/signing-key@5.3.0", "@ethersproject/signing-key@^5.3.0": - version "5.3.0" - resolved "https://registry.yarnpkg.com/@ethersproject/signing-key/-/signing-key-5.3.0.tgz#a96c88f8173e1abedfa35de32d3e5db7c48e5259" - integrity sha512-+DX/GwHAd0ok1bgedV1cKO0zfK7P/9aEyNoaYiRsGHpCecN7mhLqcdoUiUzE7Uz86LBsxm5ssK0qA1kBB47fbQ== +"@ethersproject/signing-key@5.4.0", "@ethersproject/signing-key@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/signing-key/-/signing-key-5.4.0.tgz#2f05120984e81cf89a3d5f6dec5c68ee0894fbec" + integrity sha512-q8POUeywx6AKg2/jX9qBYZIAmKSB4ubGXdQ88l40hmATj29JnG5pp331nAWwwxPn2Qao4JpWHNZsQN+bPiSW9A== dependencies: - "@ethersproject/bytes" "^5.3.0" - "@ethersproject/logger" "^5.3.0" - "@ethersproject/properties" "^5.3.0" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/logger" "^5.4.0" + "@ethersproject/properties" "^5.4.0" bn.js "^4.11.9" elliptic "6.5.4" hash.js "1.1.7" -"@ethersproject/solidity@5.3.0": - version "5.3.0" - resolved "https://registry.yarnpkg.com/@ethersproject/solidity/-/solidity-5.3.0.tgz#2a0b00b4aaaef99a080ddea13acab1fa35cd4a93" - integrity sha512-uLRBaNUiISHbut94XKewJgQh6UmydWTBp71I7I21pkjVXfZO2dJ5EOo3jCnumJc01M4LOm79dlNNmF3oGIvweQ== - dependencies: - "@ethersproject/bignumber" "^5.3.0" - "@ethersproject/bytes" "^5.3.0" - "@ethersproject/keccak256" "^5.3.0" - "@ethersproject/sha2" "^5.3.0" - "@ethersproject/strings" "^5.3.0" - -"@ethersproject/strings@5.3.0", "@ethersproject/strings@^5.3.0": - version "5.3.0" - resolved "https://registry.yarnpkg.com/@ethersproject/strings/-/strings-5.3.0.tgz#a6b640aab56a18e0909f657da798eef890968ff0" - integrity sha512-j/AzIGZ503cvhuF2ldRSjB0BrKzpsBMtCieDtn4TYMMZMQ9zScJn9wLzTQl/bRNvJbBE6TOspK0r8/Ngae/f2Q== - dependencies: - "@ethersproject/bytes" "^5.3.0" - "@ethersproject/constants" "^5.3.0" - "@ethersproject/logger" "^5.3.0" - -"@ethersproject/transactions@5.3.0", "@ethersproject/transactions@^5.3.0": - version "5.3.0" - resolved "https://registry.yarnpkg.com/@ethersproject/transactions/-/transactions-5.3.0.tgz#49b86f2bafa4d0bdf8e596578fc795ee47c50458" - integrity sha512-cdfK8VVyW2oEBCXhURG0WQ6AICL/r6Gmjh0e4Bvbv6MCn/GBd8FeBH3rtl7ho+AW50csMKeGv3m3K1HSHB2jMQ== - dependencies: - "@ethersproject/address" "^5.3.0" - "@ethersproject/bignumber" "^5.3.0" - "@ethersproject/bytes" "^5.3.0" - "@ethersproject/constants" "^5.3.0" - "@ethersproject/keccak256" "^5.3.0" - "@ethersproject/logger" "^5.3.0" - "@ethersproject/properties" "^5.3.0" - "@ethersproject/rlp" "^5.3.0" - "@ethersproject/signing-key" "^5.3.0" - -"@ethersproject/units@5.3.0": - version "5.3.0" - resolved "https://registry.yarnpkg.com/@ethersproject/units/-/units-5.3.0.tgz#c4d1493532ad3d4ddf6e2bc4f8c94a2db933a8f5" - integrity sha512-BkfccZGwfJ6Ob+AelpIrgAzuNhrN2VLp3AILnkqTOv+yBdsc83V4AYf25XC/u0rHnWl6f4POaietPwlMqP2vUg== - dependencies: - "@ethersproject/bignumber" "^5.3.0" - "@ethersproject/constants" "^5.3.0" - "@ethersproject/logger" "^5.3.0" - -"@ethersproject/wallet@5.3.0": - version "5.3.0" - resolved "https://registry.yarnpkg.com/@ethersproject/wallet/-/wallet-5.3.0.tgz#91946b470bd279e39ade58866f21f92749d062af" - integrity sha512-boYBLydG6671p9QoG6EinNnNzbm7DNOjVT20eV8J6HQEq4aUaGiA2CytF2vK+2rOEWbzhZqoNDt6AlkE1LlsTg== - dependencies: - "@ethersproject/abstract-provider" "^5.3.0" - "@ethersproject/abstract-signer" "^5.3.0" - "@ethersproject/address" "^5.3.0" - "@ethersproject/bignumber" "^5.3.0" - "@ethersproject/bytes" "^5.3.0" - "@ethersproject/hash" "^5.3.0" - "@ethersproject/hdnode" "^5.3.0" - "@ethersproject/json-wallets" "^5.3.0" - "@ethersproject/keccak256" "^5.3.0" - "@ethersproject/logger" "^5.3.0" - "@ethersproject/properties" "^5.3.0" - "@ethersproject/random" "^5.3.0" - "@ethersproject/signing-key" "^5.3.0" - "@ethersproject/transactions" "^5.3.0" - "@ethersproject/wordlists" "^5.3.0" - -"@ethersproject/web@5.3.0", "@ethersproject/web@^5.3.0": - version "5.3.0" - resolved "https://registry.yarnpkg.com/@ethersproject/web/-/web-5.3.0.tgz#7959c403f6476c61515008d8f92da51c553a8ee1" - integrity sha512-Ni6/DHnY6k/TD41LEkv0RQDx4jqWz5e/RZvrSecsxGYycF+MFy2z++T/yGc2peRunLOTIFwEksgEGGlbwfYmhQ== - dependencies: - "@ethersproject/base64" "^5.3.0" - "@ethersproject/bytes" "^5.3.0" - "@ethersproject/logger" "^5.3.0" - "@ethersproject/properties" "^5.3.0" - "@ethersproject/strings" "^5.3.0" - -"@ethersproject/wordlists@5.3.0", "@ethersproject/wordlists@^5.3.0": - version "5.3.0" - resolved "https://registry.yarnpkg.com/@ethersproject/wordlists/-/wordlists-5.3.0.tgz#45a0205f5178c1de33d316cb2ab7ed5eac3c06c5" - integrity sha512-JcwumCZcsUxgWpiFU/BRy6b4KlTRdOmYvOKZcAw/3sdF93/pZyPW5Od2hFkHS8oWp4xS06YQ+qHqQhdcxdHafQ== - dependencies: - "@ethersproject/bytes" "^5.3.0" - "@ethersproject/hash" "^5.3.0" - "@ethersproject/logger" "^5.3.0" - "@ethersproject/properties" "^5.3.0" - "@ethersproject/strings" "^5.3.0" +"@ethersproject/solidity@5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/solidity/-/solidity-5.4.0.tgz#1305e058ea02dc4891df18b33232b11a14ece9ec" + integrity sha512-XFQTZ7wFSHOhHcV1DpcWj7VXECEiSrBuv7JErJvB9Uo+KfCdc3QtUZV+Vjh/AAaYgezUEKbCtE6Khjm44seevQ== + dependencies: + "@ethersproject/bignumber" "^5.4.0" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/keccak256" "^5.4.0" + "@ethersproject/sha2" "^5.4.0" + "@ethersproject/strings" "^5.4.0" + +"@ethersproject/strings@5.4.0", "@ethersproject/strings@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/strings/-/strings-5.4.0.tgz#fb12270132dd84b02906a8d895ae7e7fa3d07d9a" + integrity sha512-k/9DkH5UGDhv7aReXLluFG5ExurwtIpUfnDNhQA29w896Dw3i4uDTz01Quaptbks1Uj9kI8wo9tmW73wcIEaWA== + dependencies: + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/constants" "^5.4.0" + "@ethersproject/logger" "^5.4.0" + +"@ethersproject/transactions@5.4.0", "@ethersproject/transactions@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/transactions/-/transactions-5.4.0.tgz#a159d035179334bd92f340ce0f77e83e9e1522e0" + integrity sha512-s3EjZZt7xa4BkLknJZ98QGoIza94rVjaEed0rzZ/jB9WrIuu/1+tjvYCWzVrystXtDswy7TPBeIepyXwSYa4WQ== + dependencies: + "@ethersproject/address" "^5.4.0" + "@ethersproject/bignumber" "^5.4.0" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/constants" "^5.4.0" + "@ethersproject/keccak256" "^5.4.0" + "@ethersproject/logger" "^5.4.0" + "@ethersproject/properties" "^5.4.0" + "@ethersproject/rlp" "^5.4.0" + "@ethersproject/signing-key" "^5.4.0" + +"@ethersproject/units@5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/units/-/units-5.4.0.tgz#d57477a4498b14b88b10396062c8cbbaf20c79fe" + integrity sha512-Z88krX40KCp+JqPCP5oPv5p750g+uU6gopDYRTBGcDvOASh6qhiEYCRatuM/suC4S2XW9Zz90QI35MfSrTIaFg== + dependencies: + "@ethersproject/bignumber" "^5.4.0" + "@ethersproject/constants" "^5.4.0" + "@ethersproject/logger" "^5.4.0" + +"@ethersproject/wallet@5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/wallet/-/wallet-5.4.0.tgz#fa5b59830b42e9be56eadd45a16a2e0933ad9353" + integrity sha512-wU29majLjM6AjCjpat21mPPviG+EpK7wY1+jzKD0fg3ui5fgedf2zEu1RDgpfIMsfn8fJHJuzM4zXZ2+hSHaSQ== + dependencies: + "@ethersproject/abstract-provider" "^5.4.0" + "@ethersproject/abstract-signer" "^5.4.0" + "@ethersproject/address" "^5.4.0" + "@ethersproject/bignumber" "^5.4.0" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/hash" "^5.4.0" + "@ethersproject/hdnode" "^5.4.0" + "@ethersproject/json-wallets" "^5.4.0" + "@ethersproject/keccak256" "^5.4.0" + "@ethersproject/logger" "^5.4.0" + "@ethersproject/properties" "^5.4.0" + "@ethersproject/random" "^5.4.0" + "@ethersproject/signing-key" "^5.4.0" + "@ethersproject/transactions" "^5.4.0" + "@ethersproject/wordlists" "^5.4.0" + +"@ethersproject/web@5.4.0", "@ethersproject/web@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/web/-/web-5.4.0.tgz#49fac173b96992334ed36a175538ba07a7413d1f" + integrity sha512-1bUusGmcoRLYgMn6c1BLk1tOKUIFuTg8j+6N8lYlbMpDesnle+i3pGSagGNvwjaiLo4Y5gBibwctpPRmjrh4Og== + dependencies: + "@ethersproject/base64" "^5.4.0" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/logger" "^5.4.0" + "@ethersproject/properties" "^5.4.0" + "@ethersproject/strings" "^5.4.0" + +"@ethersproject/wordlists@5.4.0", "@ethersproject/wordlists@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/wordlists/-/wordlists-5.4.0.tgz#f34205ec3bbc9e2c49cadaee774cf0b07e7573d7" + integrity sha512-FemEkf6a+EBKEPxlzeVgUaVSodU7G0Na89jqKjmWMlDB0tomoU8RlEMgUvXyqtrg8N4cwpLh8nyRnm1Nay1isA== + dependencies: + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/hash" "^5.4.0" + "@ethersproject/logger" "^5.4.0" + "@ethersproject/properties" "^5.4.0" + "@ethersproject/strings" "^5.4.0" "@jest/types@^26.6.2": version "26.6.2" @@ -1297,17 +1511,17 @@ dependencies: commander "^2.20.0" -"@ledgerhq/cryptoassets@6.0.2", "@ledgerhq/cryptoassets@^6.0.2": - version "6.0.2" - resolved "https://registry.yarnpkg.com/@ledgerhq/cryptoassets/-/cryptoassets-6.0.2.tgz#52efb7d017722ad7806c98c5d4e9887ed54ab744" - integrity sha512-vBG4GFFhMNTt+Y9GRNCZVAH9SzzzL/GEOXA4dJ/rPwCgz9nxymTCtkJugK4KCzdyFwp6U1X+7s7BOz1F0bnu8g== +"@ledgerhq/cryptoassets@6.1.0", "@ledgerhq/cryptoassets@^6.1.0": + version "6.1.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/cryptoassets/-/cryptoassets-6.1.0.tgz#46b04f8928461653179663fef096b59a842add37" + integrity sha512-4j5vXxvbGjPdUK9x3UaMR04DfmSjXYnq7Dhg8IN+9DqJnvFyKHzcrj57hLw3w5amJZPa89OEukFJCe52G4rsZA== dependencies: invariant "2" -"@ledgerhq/devices@6.0.2", "@ledgerhq/devices@^6.0.2": - version "6.0.2" - resolved "https://registry.yarnpkg.com/@ledgerhq/devices/-/devices-6.0.2.tgz#cbf730368f00ddb5a4384f73bb4966371aa2a4c3" - integrity sha512-xR4RYXltXISH4Vf7bLgiaIRy4W3F+kvDXYhXY7Q72goR4NA+vAosuRLGFQZIQiuZZMdPCIbXHuysj07z/NsEpA== +"@ledgerhq/devices@6.1.0", "@ledgerhq/devices@^6.1.0": + version "6.1.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/devices/-/devices-6.1.0.tgz#54963409011c0bb83e2cc3d4d55ad9b905e296ff" + integrity sha512-Swl08sVuvx7IL9yx9P0ZzvwjIl4JXl51X34Po3pT2uRRaLnh/fRRSNe9tSC1gFMioviiLJlkmO+yydE4XeV+Jg== dependencies: "@ledgerhq/errors" "^6.0.2" "@ledgerhq/logs" "^6.0.2" @@ -1319,21 +1533,21 @@ resolved "https://registry.yarnpkg.com/@ledgerhq/errors/-/errors-6.0.2.tgz#7c88d16620db08c96de6a2636440db1c0e541da1" integrity sha512-m42ZMzR/EKpOrZfPR3DzusE98DoF3d03cbBkQG6ddm6diwVXFSa7MabaKzgD+41EYQ+hrCGOEZK1K0kosX1itg== -"@ledgerhq/hw-app-algorand@6.0.2": - version "6.0.2" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-algorand/-/hw-app-algorand-6.0.2.tgz#b13487bccbed67d9ad4cda99133ca41d39e87158" - integrity sha512-0HDzIvazqu/fSWitGtDZyAPNKR7FFrhDGHMcAILURaeZux+OojQ0pEdh9yBKWMfi4drAyqRLX7tsXEy6HB+nEg== +"@ledgerhq/hw-app-algorand@6.1.0": + version "6.1.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-algorand/-/hw-app-algorand-6.1.0.tgz#e1c653de33fc144249f6ce406c4df5c51c2b273b" + integrity sha512-TKNpCb3iBU8SIG5cIA3H9mEyWftO5UYrieKVVckXRdObKGKvVwhGTy512O3DibdR/wwBAskIkGnHdRWBnCb6kA== dependencies: "@ledgerhq/errors" "^6.0.2" - "@ledgerhq/hw-transport" "^6.0.2" + "@ledgerhq/hw-transport" "^6.1.0" bip32-path "^0.4.2" -"@ledgerhq/hw-app-btc@6.0.2": - version "6.0.2" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-btc/-/hw-app-btc-6.0.2.tgz#0cf125d3d8e60e7e7225e8e7c0e3491d60effeed" - integrity sha512-CODHZ0hy0VuKo2xn8ADpPyKIG4ge1kQz+Q+XXQgfJEE/ZOYpT0R9nOfR974Ocif44Q9u/k0QAbuD9Q9w2STMUg== +"@ledgerhq/hw-app-btc@6.1.0": + version "6.1.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-btc/-/hw-app-btc-6.1.0.tgz#a7ecc3e9a2ab4eddab73edde94cb8b49176e6bf4" + integrity sha512-lt11cdeuoB62xcUuhe5u3ZJcRM5APbb2hFdzk2N8xdMoJ8wI0vBYvLdM+hhZXzePTtVU/Bxdp3cs/UeDyBrxSg== dependencies: - "@ledgerhq/hw-transport" "^6.0.2" + "@ledgerhq/hw-transport" "^6.1.0" "@ledgerhq/logs" "^6.0.2" bip32-path "^0.4.2" invariant "^2.2.4" @@ -1341,140 +1555,132 @@ semver "^7.3.5" sha.js "2" -"@ledgerhq/hw-app-cosmos@6.0.2": - version "6.0.2" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-cosmos/-/hw-app-cosmos-6.0.2.tgz#1402ad306d3d3af562d3e91c61b69d3a7f57f873" - integrity sha512-BQ8e7NjzIWhVg8TR9GQvcsM3YnHL6/t82IrlQ6jCbnvkijpw/gYie6YLIvXaxojbH15hNgAtIsN2fjqIoLtPXQ== +"@ledgerhq/hw-app-cosmos@6.1.0": + version "6.1.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-cosmos/-/hw-app-cosmos-6.1.0.tgz#da429847645596be618f636ef32775aa40a0008b" + integrity sha512-0hoDGRQAc8G4Rim77fKqiV+RlXP3JUWlpu6U2Ch7EUAhhqB91/mpqjRcFiwLNLNrdxtYLS7nIF/LBDdGzU08Ag== dependencies: "@ledgerhq/errors" "^6.0.2" - "@ledgerhq/hw-transport" "^6.0.2" + "@ledgerhq/hw-transport" "^6.1.0" bip32-path "^0.4.2" -"@ledgerhq/hw-app-eth@6.0.2": - version "6.0.2" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-eth/-/hw-app-eth-6.0.2.tgz#d2e26756c084322643a9cc21f4b9c59cb7d72766" - integrity sha512-vAkn/cod5qucPI2D59uRpOXq/cmbXf96GCuaXQWCOEjMhENe+k/be6RuHh8TVah9fAWunBmcPHyLVeHj1oVSCA== +"@ledgerhq/hw-app-eth@6.1.0": + version "6.1.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-eth/-/hw-app-eth-6.1.0.tgz#1aeddd9d61bdfb04ec51d6cb666043feea208741" + integrity sha512-vWWSMcV5I+xzgQZlRpcX/8lTMyE7MylsuAMcaio8gLf+BbNA94ti5+aJLmJH8Dyh4bSSgbbYhVpdsbCL/i0zlQ== dependencies: - "@ledgerhq/cryptoassets" "^6.0.2" + "@ledgerhq/cryptoassets" "^6.1.0" "@ledgerhq/errors" "^6.0.2" - "@ledgerhq/hw-transport" "^6.0.2" + "@ledgerhq/hw-transport" "^6.1.0" "@ledgerhq/logs" "^6.0.2" bignumber.js "^9.0.1" - ethers "^5.2.0" + ethers "^5.4.1" -"@ledgerhq/hw-app-polkadot@6.0.2": - version "6.0.2" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-polkadot/-/hw-app-polkadot-6.0.2.tgz#1986a519d26ca3029646f0f83230cacee708ce85" - integrity sha512-OeQNSVfgFVcKAMGOJGCevUobgpjt9ByhG19/fZa5Av7f/KJFbItj5NctwvweH+W9sZJXFHCetHxwe6APuPNhkA== +"@ledgerhq/hw-app-polkadot@6.1.0": + version "6.1.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-polkadot/-/hw-app-polkadot-6.1.0.tgz#6b431099c595f9bbd3103a7de950e88b6cd2b8c1" + integrity sha512-EVLvd7gM7WjU366GBxCI60T6avkModHf0fCV8lNrO7BrTx1dx1EGttUOiMsFzVj5du81SwM2TOdPpES59Mo4zQ== dependencies: "@ledgerhq/errors" "^6.0.2" - "@ledgerhq/hw-transport" "^6.0.2" + "@ledgerhq/hw-transport" "^6.1.0" bip32-path "^0.4.2" -"@ledgerhq/hw-app-str@6.0.2": - version "6.0.2" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-str/-/hw-app-str-6.0.2.tgz#dfbd0c67acdd09befd24661c06bd632cd927f342" - integrity sha512-+VSIZzeJ7F9pU19TH74XjrjUYoGLYQ9DS1s9bGCvCep0Vd061dtXZwNhmnu7gWYKRHvLkEEMDZQHdARByHqR0w== +"@ledgerhq/hw-app-str@6.1.0": + version "6.1.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-str/-/hw-app-str-6.1.0.tgz#ab285821bf89ad4d21ae29e067abfe718416ca71" + integrity sha512-JipovJkRc9Qm+64VHxNyQxL/8+V5Fhxefxvg9f8rZvq2fLf4OHbC2w6ic3ZqIrjK6/fafrOT8JCrBX4ifi14fg== dependencies: - "@ledgerhq/hw-transport" "^6.0.2" + "@ledgerhq/hw-transport" "^6.1.0" base32.js "^0.1.0" sha.js "^2.3.6" tweetnacl "^1.0.3" -"@ledgerhq/hw-app-tezos@6.0.2": - version "6.0.2" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-tezos/-/hw-app-tezos-6.0.2.tgz#7086a10227c3f570ed25374b2d1f3589ce7eefc0" - integrity sha512-BMCd1r12I1RcqMZAa0RitL/jQxrLAr8AoFIW7L+0wehMHnppFghiBiMXa6VNs05diXd+lxOTkG7oyKd0Ax/3Og== +"@ledgerhq/hw-app-tezos@6.1.0": + version "6.1.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-tezos/-/hw-app-tezos-6.1.0.tgz#9beeb347eb4cb8a0346a80387929074249cf500f" + integrity sha512-YZPwyZnCA8nx1MRqx4nkdILyrn54rPxTO6C9qlC3jTPCqYfPTbrJ0RxZWyPp1A6Jpz1s6XLA1s1UW1ZINIq5bA== dependencies: - "@ledgerhq/hw-transport" "^6.0.2" + "@ledgerhq/hw-transport" "^6.1.0" blake2b "^2.1.3" bs58check "^2.1.2" invariant "^2.2.4" -"@ledgerhq/hw-app-trx@6.0.2": - version "6.0.2" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-trx/-/hw-app-trx-6.0.2.tgz#0a0749b0690effb7c57380bc5da97ab00a27bd52" - integrity sha512-cI4UnVYb6nlj3QfxB9kSOmf5ViH4p+ZFIvduU0iovnG9P+ynqd13ls2rtju6mobC1/aVk0TCx8n2I1jBrSUgGA== +"@ledgerhq/hw-app-trx@6.1.0": + version "6.1.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-trx/-/hw-app-trx-6.1.0.tgz#5e2b5f869db07cb1850bdc28dd02abcdf1e71537" + integrity sha512-fcA59hle9Ah495xe3K+42A70wrn1Yp5scGF0yiKXbXTLAWq95Dkjo7Aohza1ev6o/IN7g9rxGjJoIuVgAalS/g== dependencies: "@ledgerhq/errors" "^6.0.2" - "@ledgerhq/hw-transport" "^6.0.2" + "@ledgerhq/hw-transport" "^6.1.0" -"@ledgerhq/hw-app-xrp@6.0.2": - version "6.0.2" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-xrp/-/hw-app-xrp-6.0.2.tgz#c7470b68c40e3844641fd38a5349ec4da5257955" - integrity sha512-VlBUqSUJfE2ITBuwJSqfft9IPShVzGMaKJnSavyL/pHsK37e2zBbcth9GyeiKUVs+276gJsDJWM/HsD68359NA== +"@ledgerhq/hw-app-xrp@6.1.0": + version "6.1.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-xrp/-/hw-app-xrp-6.1.0.tgz#2d20bd5fd2a3b3fe196e756b95dcf63a7357b307" + integrity sha512-WXlEdfIpuLlr3l/xV6FfFmf6Lp/d5T3Dal7E2twyVWy39AHVEuw5vUdY+A7hcbZuZL0M8EKXdKjwKDKMU6f2qQ== dependencies: - "@ledgerhq/hw-transport" "^6.0.2" + "@ledgerhq/hw-transport" "^6.1.0" bip32-path "0.4.2" -"@ledgerhq/hw-transport-http@6.0.2": - version "6.0.2" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-http/-/hw-transport-http-6.0.2.tgz#a2a29b4cc218736e0a5a4342015dec995dd35c0e" - integrity sha512-OYMSrQa5MWAftf2/54AYUs41Mzr51trx5MCMAgsr/V7Wg17fQlsSxEB07NckqYMZX3uSvQDvqIs/m6T+ioMH7g== +"@ledgerhq/hw-transport-http@6.1.0": + version "6.1.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-http/-/hw-transport-http-6.1.0.tgz#ede66296ab73d83ddb9165f5f21baaebcc29fdeb" + integrity sha512-thpVSA+r4xndZ1bweYL6XVt1C2JOBFyDXF31aqhGDKJih/tF+Sm+2swoS8d+ZCYJrk4sfdQTiq1T52V5oYLmDw== dependencies: "@ledgerhq/errors" "^6.0.2" - "@ledgerhq/hw-transport" "^6.0.2" + "@ledgerhq/hw-transport" "^6.1.0" "@ledgerhq/logs" "^6.0.2" axios "^0.21.1" ws "7" -"@ledgerhq/hw-transport-mocker@6.0.0": - version "6.0.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-mocker/-/hw-transport-mocker-6.0.0.tgz#ff67f373471294d863b62aa921b13095ca09157c" - integrity sha512-E10nlHEMN5Qopxgkq90Za4n/0ZkOBItxlelL05fm4H26vgNKvz4hi+Ec1OejG3qckef12Zjw5ufbKEq2cfV8sA== - dependencies: - "@ledgerhq/hw-transport" "^6.0.0" - "@ledgerhq/logs" "^6.0.0" - -"@ledgerhq/hw-transport-mocker@6.0.2": - version "6.0.2" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-mocker/-/hw-transport-mocker-6.0.2.tgz#7473b5fe60160dffd4b501a7af7e7ce0c4821219" - integrity sha512-ydd78CDXZjfV+MLynw5B7uinonKTMdBq5i3Ae478mU7YmJN7blUFQne4GEMPHkbW4Tx6iZGeT/rmbOPalnKwRw== +"@ledgerhq/hw-transport-mocker@6.1.0": + version "6.1.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-mocker/-/hw-transport-mocker-6.1.0.tgz#78d35fe1d424c5350fe79d996c876bc57d71972b" + integrity sha512-/UWP26fvoP+fT0Z9TzD/j/+nsmSQx3tsLN4x7sCYwdnur6CprdehtRIr9xbnDqZemGrddd/2sqyNiNAb3Ml5Iw== dependencies: - "@ledgerhq/hw-transport" "^6.0.2" + "@ledgerhq/hw-transport" "^6.1.0" "@ledgerhq/logs" "^6.0.2" -"@ledgerhq/hw-transport-node-hid-noevents@^6.0.2": - version "6.0.2" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-node-hid-noevents/-/hw-transport-node-hid-noevents-6.0.2.tgz#c2fcc1fd21c82dcda5fb031ef3b45c162d0eee98" - integrity sha512-qLqYDngATMU/D8fihIPCy5yaKJUGSHO0xunaDLUsj6nJP54DNDk7O9T0XMMsN6+RfeH0WLybNzSLubIS+mpj8w== +"@ledgerhq/hw-transport-node-hid-noevents@^6.1.0": + version "6.1.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-node-hid-noevents/-/hw-transport-node-hid-noevents-6.1.0.tgz#b894dbe07234eb2a7a6751b1a298d00758b91731" + integrity sha512-U7VFaLIG46ohe92N7ZXqgJSLuIWTPXS6BxT+K45VIkHr/OZYlJhtrI/5Ly3FOUOnWsI+O7QCg/yTBdEkfVSfRw== dependencies: - "@ledgerhq/devices" "^6.0.2" + "@ledgerhq/devices" "^6.1.0" "@ledgerhq/errors" "^6.0.2" - "@ledgerhq/hw-transport" "^6.0.2" + "@ledgerhq/hw-transport" "^6.1.0" "@ledgerhq/logs" "^6.0.2" node-hid "2.1.1" -"@ledgerhq/hw-transport-node-hid@6.0.2": - version "6.0.2" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-node-hid/-/hw-transport-node-hid-6.0.2.tgz#7e0c0f8dedceff8cbeea2214bd91b2a1338f08c1" - integrity sha512-kLOl3opTWNEhCBPX6FGuTF9b7MmnU0CHVNEBrQExoc2GESDRIgKpISbDhVEL0ZTtLj8jw4UVouhoE5KZOOpCyA== +"@ledgerhq/hw-transport-node-hid@6.1.0": + version "6.1.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-node-hid/-/hw-transport-node-hid-6.1.0.tgz#b8fff70c96f53af65aaab3d425c4ef33b1c18c88" + integrity sha512-WmVkc/bOKxnesv3wadooNVdWR2lRhti5asn6kw7OstRNOAXlSgYyPexLsliCfIe9APwOSt+S5SDci+oEh8Oh/Q== dependencies: - "@ledgerhq/devices" "^6.0.2" + "@ledgerhq/devices" "^6.1.0" "@ledgerhq/errors" "^6.0.2" - "@ledgerhq/hw-transport" "^6.0.2" - "@ledgerhq/hw-transport-node-hid-noevents" "^6.0.2" + "@ledgerhq/hw-transport" "^6.1.0" + "@ledgerhq/hw-transport-node-hid-noevents" "^6.1.0" "@ledgerhq/logs" "^6.0.2" lodash "^4.17.21" node-hid "2.1.1" usb "^1.7.0" -"@ledgerhq/hw-transport-node-speculos@6.0.2": - version "6.0.2" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-node-speculos/-/hw-transport-node-speculos-6.0.2.tgz#25dde72fbd8754891b7fec4ddf5a8175e2395407" - integrity sha512-UuQZ13gLbHtRvuL2H2RDNF3z8RVbDpA3WXrBz1Y3uFVFXHXZkr/XsZJ0kibXrBvtGt/T0vOq2/KhoNPe5zjYZw== +"@ledgerhq/hw-transport-node-speculos@6.1.0": + version "6.1.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-node-speculos/-/hw-transport-node-speculos-6.1.0.tgz#777f1223e25f22168387298a863d253ac539e78d" + integrity sha512-6dyxe9iQNcRJRrjRHv1unuVl+rWBp8oAvX477EYGdoEPLqA0+IDRncwbUCxsxkK+5eD84Azx1rAj/64k+UWUzQ== dependencies: "@ledgerhq/errors" "^6.0.2" - "@ledgerhq/hw-transport" "^6.0.2" + "@ledgerhq/hw-transport" "^6.1.0" "@ledgerhq/logs" "^6.0.2" rxjs "6" -"@ledgerhq/hw-transport@6.0.2", "@ledgerhq/hw-transport@^6.0.0", "@ledgerhq/hw-transport@^6.0.2": - version "6.0.2" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport/-/hw-transport-6.0.2.tgz#5b3a0cb01eb6adbd876916bc7d566226e505d333" - integrity sha512-JI8bhs0vQW1pjDeZ8/Cv/OT4iejH2F3j0i5z5mGNkSgs179GiGeM81EhStLB0XuXqxWpFZMnZ97/Cdo0XmffrA== +"@ledgerhq/hw-transport@6.1.0", "@ledgerhq/hw-transport@^6.1.0": + version "6.1.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport/-/hw-transport-6.1.0.tgz#b50151c6199e9ad6d3ab9e447532a22170c9f3b7" + integrity sha512-j9IyvksI9PjFoFrk/B3p8wCXWRWc8uK24gc20pAaXQiDtqMkWqEge8iZyPKWBVIv69vDQF3LE3Y6EeRwwA7wJA== dependencies: - "@ledgerhq/devices" "^6.0.2" + "@ledgerhq/devices" "^6.1.0" "@ledgerhq/errors" "^6.0.2" events "^3.3.0" @@ -1489,31 +1695,32 @@ node-pre-gyp "^0.17.0" node-pre-gyp-github "^1.4.3" -"@ledgerhq/live-common@^19.12.0-rc.2": - version "19.12.0-rc.2" - resolved "https://registry.yarnpkg.com/@ledgerhq/live-common/-/live-common-19.12.0-rc.2.tgz#9d59c42012f6f49ca7c98344a80f47d515d7c209" - integrity sha512-PwTSic0DBwycqdD8o/oVZtaeIx+TDbO/YGxIFIivTDoEHEcfDrXPloDZJOWOl1t/d3T5Es/cFPflpsS/SOVblQ== +"@ledgerhq/live-common@^20.3.0": + version "20.3.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/live-common/-/live-common-20.3.0.tgz#1cf3d0afd147d2bf78acaed24dce7f92eaa107d3" + integrity sha512-fmFy4Cz8p0xkP+VBXX0BkScHZDVgQ4ViDFiFOtRoBRGF2YZJnpBKh60MvSf1qnfAH2RutliTnsDMzs5hspv9Fw== dependencies: + "@crypto-com/chain-jslib" "^0.0.16" "@ledgerhq/compressjs" "1.3.2" - "@ledgerhq/cryptoassets" "6.0.2" - "@ledgerhq/devices" "6.0.2" + "@ledgerhq/cryptoassets" "6.1.0" + "@ledgerhq/devices" "6.1.0" "@ledgerhq/errors" "6.0.2" - "@ledgerhq/hw-app-algorand" "6.0.2" - "@ledgerhq/hw-app-btc" "6.0.2" - "@ledgerhq/hw-app-cosmos" "6.0.2" - "@ledgerhq/hw-app-eth" "6.0.2" - "@ledgerhq/hw-app-polkadot" "6.0.2" - "@ledgerhq/hw-app-str" "6.0.2" - "@ledgerhq/hw-app-tezos" "6.0.2" - "@ledgerhq/hw-app-trx" "6.0.2" - "@ledgerhq/hw-app-xrp" "6.0.2" - "@ledgerhq/hw-transport" "6.0.2" - "@ledgerhq/hw-transport-mocker" "6.0.2" - "@ledgerhq/hw-transport-node-speculos" "6.0.2" + "@ledgerhq/hw-app-algorand" "6.1.0" + "@ledgerhq/hw-app-btc" "6.1.0" + "@ledgerhq/hw-app-cosmos" "6.1.0" + "@ledgerhq/hw-app-eth" "6.1.0" + "@ledgerhq/hw-app-polkadot" "6.1.0" + "@ledgerhq/hw-app-str" "6.1.0" + "@ledgerhq/hw-app-tezos" "6.1.0" + "@ledgerhq/hw-app-trx" "6.1.0" + "@ledgerhq/hw-app-xrp" "6.1.0" + "@ledgerhq/hw-transport" "6.1.0" + "@ledgerhq/hw-transport-mocker" "6.1.0" + "@ledgerhq/hw-transport-node-speculos" "6.1.0" "@ledgerhq/logs" "6.0.2" - "@polkadot/types" "3.11.1" + "@polkadot/types" "4.17.1" "@walletconnect/client" "1.4.1" - "@xstate/react" "^1.3.4" + "@xstate/react" "^1.5.1" async "^3.2.0" axios "0.21.1" bchaddrjs "^0.5.2" @@ -1543,7 +1750,7 @@ ripemd160 "^2.0.2" ripple-binary-codec "^1.1.3" ripple-bs58check "^2.0.2" - ripple-lib "1.9.5" + ripple-lib "1.9.6" rxjs "6" rxjs-compat "^6.6.7" secp256k1 "^4.0.2" @@ -1552,22 +1759,22 @@ stellar-sdk "^8.2.2" triple-beam "^1.3.0" winston "^3.3.3" - xstate "^4.20.0" + xstate "^4.22.0" -"@ledgerhq/logs@6.0.2", "@ledgerhq/logs@^6.0.0", "@ledgerhq/logs@^6.0.2": +"@ledgerhq/logs@6.0.2", "@ledgerhq/logs@^6.0.2": version "6.0.2" resolved "https://registry.yarnpkg.com/@ledgerhq/logs/-/logs-6.0.2.tgz#a6063ed99461c0d2c36a48de89ed0283f13cb908" integrity sha512-4lU3WBwugG+I/dv/qE8HQ2f7MNsKfU58FEzSE1PAELvW96umrlO4ogwuO1tRCPmrtOo9ssam1QVYotwELY8zvw== -"@nicolo-ribaudo/chokidar-2@2.1.8-no-fsevents": - version "2.1.8-no-fsevents" - resolved "https://registry.yarnpkg.com/@nicolo-ribaudo/chokidar-2/-/chokidar-2-2.1.8-no-fsevents.tgz#da7c3996b8e6e19ebd14d82eaced2313e7769f9b" - integrity sha512-+nb9vWloHNNMFHjGofEam3wopE3m1yuambrrd/fnPc+lFOMB9ROTqQlche9ByFWNkdNqfSgR/kkQtQ8DzEWt2w== +"@nicolo-ribaudo/chokidar-2@2.1.8-no-fsevents.2": + version "2.1.8-no-fsevents.2" + resolved "https://registry.yarnpkg.com/@nicolo-ribaudo/chokidar-2/-/chokidar-2-2.1.8-no-fsevents.2.tgz#e324c0a247a5567192dd7180647709d7e2faf94b" + integrity sha512-Fb8WxUFOBQVl+CX4MWet5o7eCc6Pj04rXIwVKZ6h1NnqTo45eOQW6aWyhG25NIODvWFwTDMwBsYxrQ3imxpetg== dependencies: anymatch "^2.0.0" async-each "^1.0.1" braces "^2.3.2" - glob-parent "^3.1.0" + glob-parent "^5.1.2" inherits "^2.0.3" is-binary-path "^1.0.0" is-glob "^4.0.0" @@ -1705,62 +1912,58 @@ hash.js "^1.1.7" randombytes "^2.1.0" -"@polkadot/metadata@3.11.1": - version "3.11.1" - resolved "https://registry.yarnpkg.com/@polkadot/metadata/-/metadata-3.11.1.tgz#c3e9645f6f78c8e02e0da695f3718b9d69f450a8" - integrity sha512-Z3KtOTX2kU+vvbRDiGY+qyPpF/4xTpnUipoNGijIGQ/EWWcgrm8sSgPzZQhHCfgIqM+jq3g9GvPMYeQp2Yy3ng== - dependencies: - "@babel/runtime" "^7.13.8" - "@polkadot/types" "3.11.1" - "@polkadot/types-known" "3.11.1" - "@polkadot/util" "^5.9.2" - "@polkadot/util-crypto" "^5.9.2" - bn.js "^4.11.9" - -"@polkadot/networks@5.9.2", "@polkadot/networks@^5.9.2": - version "5.9.2" - resolved "https://registry.yarnpkg.com/@polkadot/networks/-/networks-5.9.2.tgz#c687525b5886c9418f75240afe22b562ed88e2dd" - integrity sha512-JQyXJDJTZKQtn8y3HBHWDhiBfijhpiXjVEhY+fKvFcQ82TaKmzhnipYX0EdBoopZbuxpn/BJy6Y1Y/3y85EC+g== +"@polkadot/metadata@4.17.1": + version "4.17.1" + resolved "https://registry.yarnpkg.com/@polkadot/metadata/-/metadata-4.17.1.tgz#4da9ee5b2b816493910abfd302a50b58141ceca2" + integrity sha512-219isiCWVfbu5JxZnOPj+cV4T+S0XHS4+Jal3t3xz9y4nbgr+25Pa4KInEsJPx0u8EZAxMeiUCX3vd5U7oe72g== dependencies: - "@babel/runtime" "^7.13.8" + "@babel/runtime" "^7.14.6" + "@polkadot/types" "4.17.1" + "@polkadot/types-known" "4.17.1" + "@polkadot/util" "^6.11.1" + "@polkadot/util-crypto" "^6.11.1" -"@polkadot/types-known@3.11.1": - version "3.11.1" - resolved "https://registry.yarnpkg.com/@polkadot/types-known/-/types-known-3.11.1.tgz#f695c9155fa54eeed95cea179bb8cb2398726bd3" - integrity sha512-ImAxyCdqblmlXaMlgvuXZ6wzZgOYgE40FgWaYRJpFXRGJLDwtcJcpVI+7m/ns5dJ3WujboEMOHVR1HPpquw8Jw== +"@polkadot/networks@6.11.1", "@polkadot/networks@^6.11.1": + version "6.11.1" + resolved "https://registry.yarnpkg.com/@polkadot/networks/-/networks-6.11.1.tgz#8fd189593f6ee4f8bf64378d0aaae09e39a37d35" + integrity sha512-0C6Ha2kvr42se3Gevx6UhHzv3KnPHML0N73Amjwvdr4y0HLZ1Nfw+vcm5yqpz5gpiehqz97XqFrsPRauYdcksQ== dependencies: - "@babel/runtime" "^7.13.8" - "@polkadot/networks" "^5.9.2" - "@polkadot/types" "3.11.1" - "@polkadot/util" "^5.9.2" - bn.js "^4.11.9" + "@babel/runtime" "^7.14.6" -"@polkadot/types@3.11.1": - version "3.11.1" - resolved "https://registry.yarnpkg.com/@polkadot/types/-/types-3.11.1.tgz#c0188390dfda84d746d57f7818ad622ac6b1de8b" - integrity sha512-+BWsmveYVkLFx/csvPmU+NhNFhf+0srAt2d0f+7y663nitc/sng1AcEDPbrbXHSQVyPdvI20Mh4Escl4aR+TLw== +"@polkadot/types-known@4.17.1": + version "4.17.1" + resolved "https://registry.yarnpkg.com/@polkadot/types-known/-/types-known-4.17.1.tgz#71c18dda4967a13ec34fbbf0c4ef264e882c2688" + integrity sha512-YkOwGrO+k9aVrBR8FgYHnfJKhOfpdgC5ZRYNL/xJ9oa7lBYqPts9ENAxeBmJS/5IGeDF9f32MNyrCP2umeCXWg== dependencies: - "@babel/runtime" "^7.13.8" - "@polkadot/metadata" "3.11.1" - "@polkadot/util" "^5.9.2" - "@polkadot/util-crypto" "^5.9.2" - "@polkadot/x-rxjs" "^5.9.2" - "@types/bn.js" "^4.11.6" - bn.js "^4.11.9" + "@babel/runtime" "^7.14.6" + "@polkadot/networks" "^6.11.1" + "@polkadot/types" "4.17.1" + "@polkadot/util" "^6.11.1" -"@polkadot/util-crypto@^5.9.2": - version "5.9.2" - resolved "https://registry.yarnpkg.com/@polkadot/util-crypto/-/util-crypto-5.9.2.tgz#3858cfffe7732458b4a2b38ece01eaf52a3746c2" - integrity sha512-d8CW2grI3gWi6d/brmcZQWaMPHqQq5z7VcM74/v8D2KZ+hPYL3B0Jn8zGL1vtgMz2qdpWrZdAe89LBC8BvM9bw== - dependencies: - "@babel/runtime" "^7.13.8" - "@polkadot/networks" "5.9.2" - "@polkadot/util" "5.9.2" - "@polkadot/wasm-crypto" "^3.2.4" - "@polkadot/x-randomvalues" "5.9.2" +"@polkadot/types@4.17.1": + version "4.17.1" + resolved "https://registry.yarnpkg.com/@polkadot/types/-/types-4.17.1.tgz#41d43621d53820ee930ba4036bfa8b16cf98ca6f" + integrity sha512-rjW4OFdwvFekzN3ATLibC2JPSd8AWt5YepJhmuCPdwH26r3zB8bEC6dM7YQExLVUmygVPvgXk5ffHI6RAdXBMg== + dependencies: + "@babel/runtime" "^7.14.6" + "@polkadot/metadata" "4.17.1" + "@polkadot/util" "^6.11.1" + "@polkadot/util-crypto" "^6.11.1" + "@polkadot/x-rxjs" "^6.11.1" + +"@polkadot/util-crypto@^6.11.1": + version "6.11.1" + resolved "https://registry.yarnpkg.com/@polkadot/util-crypto/-/util-crypto-6.11.1.tgz#7a36acf5c8bf52541609ec0b0b2a69af295d652e" + integrity sha512-fWA1Nz17FxWJslweZS4l0Uo30WXb5mYV1KEACVzM+BSZAvG5eoiOAYX6VYZjyw6/7u53XKrWQlD83iPsg3KvZw== + dependencies: + "@babel/runtime" "^7.14.6" + "@polkadot/networks" "6.11.1" + "@polkadot/util" "6.11.1" + "@polkadot/wasm-crypto" "^4.0.2" + "@polkadot/x-randomvalues" "6.11.1" base-x "^3.0.8" base64-js "^1.5.1" - blakejs "^1.1.0" + blakejs "^1.1.1" bn.js "^4.11.9" create-hash "^1.2.0" elliptic "^6.5.4" @@ -1770,82 +1973,133 @@ tweetnacl "^1.0.3" xxhashjs "^0.2.2" -"@polkadot/util@5.9.2", "@polkadot/util@^5.9.2": - version "5.9.2" - resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-5.9.2.tgz#ad2494e78ca6c3aadd6fb394a6be55020dc9b2a8" - integrity sha512-p225NJusnXeu7i2iAb8HAGWiMOUAnRaIyblIjJ4F89ZFZZ4amyliGxe5gKcyjRgxAJ44WdKyBLl/8L3rNv8hmQ== +"@polkadot/util@6.11.1", "@polkadot/util@^6.11.1": + version "6.11.1" + resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-6.11.1.tgz#8950b038ba3e6ebfc0a7ff47feeb972e81b2626c" + integrity sha512-TEdCetr9rsdUfJZqQgX/vxLuV4XU8KMoKBMJdx+JuQ5EWemIdQkEtMBdL8k8udNGbgSNiYFA6rPppATeIxAScg== dependencies: - "@babel/runtime" "^7.13.8" - "@polkadot/x-textdecoder" "5.9.2" - "@polkadot/x-textencoder" "5.9.2" + "@babel/runtime" "^7.14.6" + "@polkadot/x-textdecoder" "6.11.1" + "@polkadot/x-textencoder" "6.11.1" "@types/bn.js" "^4.11.6" bn.js "^4.11.9" camelcase "^5.3.1" ip-regex "^4.3.0" -"@polkadot/wasm-crypto-asmjs@^3.2.4": - version "3.2.4" - resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-asmjs/-/wasm-crypto-asmjs-3.2.4.tgz#837f5b723161b21670d13779eff4c061f7947577" - integrity sha512-fgN26iL+Pbb35OYsDIRHC74Xnwde+A5u3OjEcQ9zJhM391eOTuKsQ2gyC9TLNAKqeYH8pxsa27yjRO71We7FUA== +"@polkadot/wasm-crypto-asmjs@^4.0.2": + version "4.0.2" + resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-asmjs/-/wasm-crypto-asmjs-4.0.2.tgz#f42c353a64e1243841daf90e4bd54eff01a4e3cf" + integrity sha512-hlebqtGvfjg2ZNm4scwBGVHwOwfUhy2yw5RBHmPwkccUif3sIy4SAzstpcVBIVMdAEvo746bPWEInA8zJRcgJA== + dependencies: + "@babel/runtime" "^7.13.9" + +"@polkadot/wasm-crypto-wasm@^4.0.2": + version "4.0.2" + resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-wasm/-/wasm-crypto-wasm-4.0.2.tgz#89f9e0a1e4d076784d4a42bea37fc8b06bdd8bb6" + integrity sha512-de/AfNPZ0uDKFWzOZ1rJCtaUbakGN29ks6IRYu6HZTRg7+RtqvE1rIkxabBvYgQVHIesmNwvEA9DlIkS6hYRFQ== dependencies: - "@babel/runtime" "^7.13.7" + "@babel/runtime" "^7.13.9" -"@polkadot/wasm-crypto-wasm@^3.2.4": - version "3.2.4" - resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-wasm/-/wasm-crypto-wasm-3.2.4.tgz#70885e06a813af91d81cf7e8ff826976fa99a38b" - integrity sha512-Q/3IEpoo7vkTzg40GxehRK000A9oBgjbh/uWCNQ8cMqWLYYCfzZy4NIzw8szpxNiSiGfGL0iZlP4ZSx2ZqEe2g== +"@polkadot/wasm-crypto@^4.0.2": + version "4.0.2" + resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto/-/wasm-crypto-4.0.2.tgz#9649057adee8383cc86433d107ba526b718c5a3b" + integrity sha512-2h9FuQFkBc+B3TwSapt6LtyPvgtd0Hq9QsHW8g8FrmKBFRiiFKYRpfJKHCk0aCZzuRf9h95bQl/X6IXAIWF2ng== dependencies: - "@babel/runtime" "^7.13.7" + "@babel/runtime" "^7.13.9" + "@polkadot/wasm-crypto-asmjs" "^4.0.2" + "@polkadot/wasm-crypto-wasm" "^4.0.2" -"@polkadot/wasm-crypto@^3.2.4": - version "3.2.4" - resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto/-/wasm-crypto-3.2.4.tgz#c3e23ff728c1d5701215ae15ecdc605e96901989" - integrity sha512-poeRU91zzZza0ZectT63vBiAqh6DsHCyd3Ogx1U6jsYiRa0yuECMWJx1onvnseDW4tIqsC8vZ/9xHXWwhjTAVg== +"@polkadot/x-global@6.11.1": + version "6.11.1" + resolved "https://registry.yarnpkg.com/@polkadot/x-global/-/x-global-6.11.1.tgz#c292b3825fea60e9b33fff1790323fc57de1ca5d" + integrity sha512-lsBK/e4KbjfieyRmnPs7bTiGbP/6EoCZz7rqD/voNS5qsJAaXgB9LR+ilubun9gK/TDpebyxgO+J19OBiQPIRw== dependencies: - "@babel/runtime" "^7.13.7" - "@polkadot/wasm-crypto-asmjs" "^3.2.4" - "@polkadot/wasm-crypto-wasm" "^3.2.4" + "@babel/runtime" "^7.14.6" -"@polkadot/x-global@5.9.2": - version "5.9.2" - resolved "https://registry.yarnpkg.com/@polkadot/x-global/-/x-global-5.9.2.tgz#e223d59536d168c7cbc49fc3a2052cbd71bd7256" - integrity sha512-wpY6IAOZMGiJQa8YMm7NeTLi9bwnqqVauR+v7HwyrssnGPuYX8heb6BQLOnnnPh/EK0+M8zNtwRBU48ez0/HOg== +"@polkadot/x-randomvalues@6.11.1": + version "6.11.1" + resolved "https://registry.yarnpkg.com/@polkadot/x-randomvalues/-/x-randomvalues-6.11.1.tgz#f006fa250c8e82c92ccb769976a45a8e7f3df28b" + integrity sha512-2MfUfGZSOkuPt7GF5OJkPDbl4yORI64SUuKM25EGrJ22o1UyoBnPOClm9eYujLMD6BfDZRM/7bQqqoLW+NuHVw== dependencies: - "@babel/runtime" "^7.13.8" - "@types/node-fetch" "^2.5.8" - node-fetch "^2.6.1" + "@babel/runtime" "^7.14.6" + "@polkadot/x-global" "6.11.1" -"@polkadot/x-randomvalues@5.9.2": - version "5.9.2" - resolved "https://registry.yarnpkg.com/@polkadot/x-randomvalues/-/x-randomvalues-5.9.2.tgz#563a76550f94107ce5a37c462ed067dc040626b1" - integrity sha512-Zv+eXSP3oBImMnB82y05Doo0A96WUFsQDbnLHI3jFHioIg848cL0nndB9TgBwPaFkZ2oiwoHEC8yxqNI6/jkzQ== +"@polkadot/x-rxjs@^6.11.1": + version "6.11.1" + resolved "https://registry.yarnpkg.com/@polkadot/x-rxjs/-/x-rxjs-6.11.1.tgz#5454708b61da70eea05708611d9148fce9372498" + integrity sha512-zIciEmij7SUuXXg9g/683Irx6GogxivrQS2pgBir2DI/YZq+um52+Dqg1mqsEZt74N4KMTMnzAZAP6LJOBOMww== dependencies: - "@babel/runtime" "^7.13.8" - "@polkadot/x-global" "5.9.2" + "@babel/runtime" "^7.14.6" + rxjs "^6.6.7" -"@polkadot/x-rxjs@^5.9.2": - version "5.9.2" - resolved "https://registry.yarnpkg.com/@polkadot/x-rxjs/-/x-rxjs-5.9.2.tgz#925b7c3325678b137ca30af6a726b22c5e8f9125" - integrity sha512-cuF4schclspOfAqEPvbcA3aQ9d3TBy2ORZ8YehxD0ZSHWJNhefHDIUDgS5T3NtPhSKgcEmSlI5TfVfgGFxgVMg== +"@polkadot/x-textdecoder@6.11.1": + version "6.11.1" + resolved "https://registry.yarnpkg.com/@polkadot/x-textdecoder/-/x-textdecoder-6.11.1.tgz#6cc314645681cc4639085c03b65328671c7f182c" + integrity sha512-DI1Ym2lyDSS/UhnTT2e9WutukevFZ0WGpzj4eotuG2BTHN3e21uYtYTt24SlyRNMrWJf5+TkZItmZeqs1nwAfQ== dependencies: - "@babel/runtime" "^7.13.8" - rxjs "^6.6.6" + "@babel/runtime" "^7.14.6" + "@polkadot/x-global" "6.11.1" -"@polkadot/x-textdecoder@5.9.2": - version "5.9.2" - resolved "https://registry.yarnpkg.com/@polkadot/x-textdecoder/-/x-textdecoder-5.9.2.tgz#2e69922acc426f91adc2629fea362e41c9035f25" - integrity sha512-MCkgITwGY3tG0UleDkBJEoiKGk/YWYwMM5OR6fNo07RymHRtJ8OLJC+Sej9QD05yz6TIhFaaRRYzmtungIcwTw== +"@polkadot/x-textencoder@6.11.1": + version "6.11.1" + resolved "https://registry.yarnpkg.com/@polkadot/x-textencoder/-/x-textencoder-6.11.1.tgz#73e89da5b91954ae380042c19314c90472f59d9e" + integrity sha512-8ipjWdEuqFo+R4Nxsc3/WW9CSEiprX4XU91a37ZyRVC4e9R1bmvClrpXmRQLVcAQyhRvG8DKOOtWbz8xM+oXKg== dependencies: - "@babel/runtime" "^7.13.8" - "@polkadot/x-global" "5.9.2" + "@babel/runtime" "^7.14.6" + "@polkadot/x-global" "6.11.1" + +"@protobufjs/aspromise@^1.1.1", "@protobufjs/aspromise@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@protobufjs/aspromise/-/aspromise-1.1.2.tgz#9b8b0cc663d669a7d8f6f5d0893a14d348f30fbf" + integrity sha1-m4sMxmPWaafY9vXQiToU00jzD78= + +"@protobufjs/base64@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@protobufjs/base64/-/base64-1.1.2.tgz#4c85730e59b9a1f1f349047dbf24296034bb2735" + integrity sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg== + +"@protobufjs/codegen@^2.0.4": + version "2.0.4" + resolved "https://registry.yarnpkg.com/@protobufjs/codegen/-/codegen-2.0.4.tgz#7ef37f0d010fb028ad1ad59722e506d9262815cb" + integrity sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg== -"@polkadot/x-textencoder@5.9.2": - version "5.9.2" - resolved "https://registry.yarnpkg.com/@polkadot/x-textencoder/-/x-textencoder-5.9.2.tgz#67362e64bacfe6ff4eec73bf596873a2f9d9f36d" - integrity sha512-IjdLY3xy0nUfps1Bdi0tRxAX7X081YyoiSWExwqUkChdcYGMqMe3T2wqrrt9qBr2IkW8O/tlfYBiZXdII0YCcw== +"@protobufjs/eventemitter@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz#355cbc98bafad5978f9ed095f397621f1d066b70" + integrity sha1-NVy8mLr61ZePntCV85diHx0Ga3A= + +"@protobufjs/fetch@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/fetch/-/fetch-1.1.0.tgz#ba99fb598614af65700c1619ff06d454b0d84c45" + integrity sha1-upn7WYYUr2VwDBYZ/wbUVLDYTEU= dependencies: - "@babel/runtime" "^7.13.8" - "@polkadot/x-global" "5.9.2" + "@protobufjs/aspromise" "^1.1.1" + "@protobufjs/inquire" "^1.1.0" + +"@protobufjs/float@^1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@protobufjs/float/-/float-1.0.2.tgz#5e9e1abdcb73fc0a7cb8b291df78c8cbd97b87d1" + integrity sha1-Xp4avctz/Ap8uLKR33jIy9l7h9E= + +"@protobufjs/inquire@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/inquire/-/inquire-1.1.0.tgz#ff200e3e7cf2429e2dcafc1140828e8cc638f089" + integrity sha1-/yAOPnzyQp4tyvwRQIKOjMY48Ik= + +"@protobufjs/path@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@protobufjs/path/-/path-1.1.2.tgz#6cc2b20c5c9ad6ad0dccfd21ca7673d8d7fbf68d" + integrity sha1-bMKyDFya1q0NzP0hynZz2Nf79o0= + +"@protobufjs/pool@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/pool/-/pool-1.1.0.tgz#09fd15f2d6d3abfa9b65bc366506d6ad7846ff54" + integrity sha1-Cf0V8tbTq/qbZbw2ZQbWrXhG/1Q= + +"@protobufjs/utf8@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/utf8/-/utf8-1.1.0.tgz#a777360b5b39a1a2e5106f8e858f2fd2d060c570" + integrity sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA= "@sindresorhus/is@^2.0.0": version "2.1.1" @@ -1942,24 +2196,36 @@ resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.165.tgz#74d55d947452e2de0742bad65270433b63a8c30f" integrity sha512-tjSSOTHhI5mCHTy/OOXYIhi2Wt1qcbHmuXD1Ha7q70CgI/I71afO4XtLb/cVexki1oVYchpul/TOuu3Arcdxrg== -"@types/node-fetch@^2.5.8": - version "2.5.8" - resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.5.8.tgz#e199c835d234c7eb0846f6618012e558544ee2fb" - integrity sha512-fbjI6ja0N5ZA8TV53RUqzsKNkl9fv8Oj3T7zxW7FGv1GSH7gwJaNF8dzCjrqKaxKeUpTz4yT1DaJFq/omNpGfw== - dependencies: - "@types/node" "*" - form-data "^3.0.0" +"@types/long@^4.0.1": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@types/long/-/long-4.0.1.tgz#459c65fa1867dafe6a8f322c4c51695663cc55e9" + integrity sha512-5tXH6Bx/kNGd3MgffdmP4dy2Z+G4eaXw0SE81Tq3BNadtnMR5/ySMzX4SLEzHJzSmPNn4HIdpQsBvXMUykr58w== "@types/node@*", "@types/node@>= 8": - version "14.10.2" - resolved "https://registry.yarnpkg.com/@types/node/-/node-14.10.2.tgz#9b47a2c8e4dabd4db73b57e750b24af689600514" - integrity sha512-IzMhbDYCpv26pC2wboJ4MMOa9GKtjplXfcAqrMeNJpUUwpM/2ATt2w1JPUXwS6spu856TvKZL2AOmeU2rAxskw== + version "15.14.0" + resolved "https://registry.yarnpkg.com/@types/node/-/node-15.14.0.tgz#74dbf254fb375551a9d2a71faf6b9dbc2178dc53" + integrity sha512-um/+/ip3QZmwLfIkWZSNtQIJNVAqrJ92OkLMeuZrjZMTAJniI7fh8N8OICyDhAJ2mzgk/fmYFo72jRr5HyZ1EQ== + +"@types/node@10.12.18": + version "10.12.18" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.18.tgz#1d3ca764718915584fcd9f6344621b7672665c67" + integrity sha512-fh+pAqt4xRzPfqA6eh3Z2y6fyZavRIumvjhaCL753+TVkGKGhpPeyrJG2JftD0T9q4GF00KjefsQ+PQNDdWQaQ== "@types/node@11.11.6": version "11.11.6" resolved "https://registry.yarnpkg.com/@types/node/-/node-11.11.6.tgz#df929d1bb2eee5afdda598a41930fe50b43eaa6a" integrity sha512-Exw4yUWMBXM3X+8oqzJNRqZSwUAaS4+7NdvHqQuFi/d+synz++xmX3QIf+BFqneW8N31R8Ky+sikfZUXq07ggQ== +"@types/node@>=13.7.0": + version "16.0.1" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.0.1.tgz#70cedfda26af7a2ca073fdcc9beb2fff4aa693f8" + integrity sha512-hBOx4SUlEPKwRi6PrXuTGw1z6lz0fjsibcWCM378YxsSu/6+C30L6CR49zIBKHiwNWCYIcOLjg4OHKZaFeLAug== + +"@types/node@^13.7.0": + version "13.13.52" + resolved "https://registry.yarnpkg.com/@types/node/-/node-13.13.52.tgz#03c13be70b9031baaed79481c0c0cfb0045e53f7" + integrity sha512-s3nugnZumCC//n4moGGe6tkNMyYEdaDBitVjwPxXmR5lnMG5dHePinH2EdxkG3Rh1ghFHHixAG4NJhpJW1rthQ== + "@types/pbkdf2@^3.0.0": version "3.1.0" resolved "https://registry.yarnpkg.com/@types/pbkdf2/-/pbkdf2-3.1.0.tgz#039a0e9b67da0cdc4ee5dab865caa6b267bb66b1" @@ -2023,9 +2289,9 @@ integrity sha512-RJJrrySY7A8havqpGObOB4W92QXKJo63/jFLLgpvOtsGUqbQZ9Sbgl35KMm1DjC6j7AvmmU2bIno+3IyEaemaw== "@types/urijs@^1.19.6": - version "1.19.15" - resolved "https://registry.yarnpkg.com/@types/urijs/-/urijs-1.19.15.tgz#0142b92b52d07c4ba97dd82e7a54a875332942ec" - integrity sha512-pEDVREIvkyRtzpWlO5nqsUgR/JpLv9+lAzvkERCwoH2jXxl+TmaTNshhL7gjQLhfqgFUzCM6ovmoB1JssTop1A== + version "1.19.16" + resolved "https://registry.yarnpkg.com/@types/urijs/-/urijs-1.19.16.tgz#156658c47438fa867db5dce4d2949fe1ca0878e2" + integrity sha512-WgxqcUSEYijGnNWHSln/uqay+AywS3mEhLC+d2PwLsru2fLeMblvxP67Y/SCfB2Pxe+dX/zbIoNNzXY+VKOtNA== "@types/ws@^7.2.0": version "7.4.0" @@ -2112,10 +2378,10 @@ js-sha3 "0.8.0" query-string "6.13.5" -"@xstate/react@^1.3.4": - version "1.3.4" - resolved "https://registry.yarnpkg.com/@xstate/react/-/react-1.3.4.tgz#d79126c9eecc9a1225d553e3421aaad68eb5ee5e" - integrity sha512-uKbKriFYjgeqMeEAqOv8IWRM8WBx5i/4pMPGpqo58wd7sInhFmmK6HWfV7eX3nD/vJPfxWielNMxAUCUdVh1pA== +"@xstate/react@^1.5.1": + version "1.5.1" + resolved "https://registry.yarnpkg.com/@xstate/react/-/react-1.5.1.tgz#60817e60e54e338b8e7c3e51bfa4cd3babebdc7d" + integrity sha512-DJHDqDlZHus08X98uMJw4KR17FRWBXLHMQ02YRxx0DMm5VLn75VwGyt4tXdlNZHQWjyk++C5c9Ichq3PdmM3og== dependencies: use-isomorphic-layout-effect "^1.0.0" use-subscription "^1.3.0" @@ -2364,29 +2630,29 @@ babel-plugin-dynamic-import-node@^2.3.3: dependencies: object.assign "^4.1.0" -babel-plugin-polyfill-corejs2@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.2.0.tgz#686775bf9a5aa757e10520903675e3889caeedc4" - integrity sha512-9bNwiR0dS881c5SHnzCmmGlMkJLl0OUZvxrxHo9w/iNoRuqaPjqlvBf4HrovXtQs/au5yKkpcdgfT1cC5PAZwg== +babel-plugin-polyfill-corejs2@^0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.2.2.tgz#e9124785e6fd94f94b618a7954e5693053bf5327" + integrity sha512-kISrENsJ0z5dNPq5eRvcctITNHYXWOA4DUZRFYCz3jYCcvTb/A546LIddmoGNMVYg2U38OyFeNosQwI9ENTqIQ== dependencies: "@babel/compat-data" "^7.13.11" - "@babel/helper-define-polyfill-provider" "^0.2.0" + "@babel/helper-define-polyfill-provider" "^0.2.2" semver "^6.1.1" -babel-plugin-polyfill-corejs3@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.2.0.tgz#f4b4bb7b19329827df36ff56f6e6d367026cb7a2" - integrity sha512-zZyi7p3BCUyzNxLx8KV61zTINkkV65zVkDAFNZmrTCRVhjo1jAS+YLvDJ9Jgd/w2tsAviCwFHReYfxO3Iql8Yg== +babel-plugin-polyfill-corejs3@^0.2.2: + version "0.2.3" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.2.3.tgz#72add68cf08a8bf139ba6e6dfc0b1d504098e57b" + integrity sha512-rCOFzEIJpJEAU14XCcV/erIf/wZQMmMT5l5vXOpL5uoznyOGfDIjPj6FVytMvtzaKSTSVKouOCTPJ5OMUZH30g== dependencies: - "@babel/helper-define-polyfill-provider" "^0.2.0" - core-js-compat "^3.9.1" + "@babel/helper-define-polyfill-provider" "^0.2.2" + core-js-compat "^3.14.0" -babel-plugin-polyfill-regenerator@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.2.0.tgz#853f5f5716f4691d98c84f8069c7636ea8da7ab8" - integrity sha512-J7vKbCuD2Xi/eEHxquHN14bXAW9CXtecwuLrOIDJtcZzTaPzV1VdEfoUf9AzcRBMolKUQKM9/GVojeh0hFiqMg== +babel-plugin-polyfill-regenerator@^0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.2.2.tgz#b310c8d642acada348c1fa3b3e6ce0e851bee077" + integrity sha512-Goy5ghsc21HgPDFtzRkSirpZVW35meGoTmTOb2bxqdl60ghub4xOidgNTHaZfQ2FaxQsKmwvXtOAkcIS4SMBWg== dependencies: - "@babel/helper-define-polyfill-provider" "^0.2.0" + "@babel/helper-define-polyfill-provider" "^0.2.2" balanced-match@^1.0.0: version "1.0.0" @@ -2412,7 +2678,7 @@ base32.js@^0.1.0: resolved "https://registry.yarnpkg.com/base32.js/-/base32.js-0.1.0.tgz#b582dec693c2f11e893cf064ee6ac5b6131a2202" integrity sha1-tYLexpPC8R6JPPBk7mrFthMaIgI= -base64-js@^1.0.2, base64-js@^1.3.1, base64-js@^1.5.1: +base64-js@^1.0.2, base64-js@^1.3.0, base64-js@^1.3.1, base64-js@^1.5.1: version "1.5.1" resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== @@ -2447,7 +2713,7 @@ bcrypt-pbkdf@^1.0.0: dependencies: tweetnacl "^0.14.3" -bech32@1.1.4: +bech32@1.1.4, bech32@^1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/bech32/-/bech32-1.1.4.tgz#e38c9f37bf179b8eb16ae3a772b40c356d4832e9" integrity sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ== @@ -2472,6 +2738,11 @@ big-integer@^1.6.17, big-integer@^1.6.48: resolved "https://registry.yarnpkg.com/big-integer/-/big-integer-1.6.48.tgz#8fd88bd1632cba4a1c8c3e3d7159f08bb95b4b9e" integrity sha512-j51egjPa7/i+RdiRuJbPdJ2FIUYYPhvYLjzoYbcMMm62ooO6F94fETG4MTs46zPAF9Brs04OajboA/qTGuz78w== +big.js@6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/big.js/-/big.js-6.0.0.tgz#d3806d83d93d67faaf29bfca2d2c45d02160da04" + integrity sha512-PGsJX+jhBY5qaGOymm4V1QMM2oOCtfGdW8CxgbDTg17C/qHeW89jhx6Kpda3vS0uPHFT6sEhwbb5tlc0wmA+wQ== + bignumber.js@^4.0.0: version "4.1.0" resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-4.1.0.tgz#db6f14067c140bd46624815a7916c92d9b6c24b1" @@ -2500,7 +2771,7 @@ binary@~0.3.0: buffers "~0.1.1" chainsaw "~0.1.0" -bindings@1.5.0, bindings@^1.2.1, bindings@^1.4.0, bindings@^1.5.0: +bindings@1.5.0, bindings@^1.2.1, bindings@^1.3.0, bindings@^1.4.0, bindings@^1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.5.0.tgz#10353c9e945334bc0511a6d90b38fbc7c9c504df" integrity sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ== @@ -2512,7 +2783,30 @@ bip32-path@0.4.2, bip32-path@^0.4.2: resolved "https://registry.yarnpkg.com/bip32-path/-/bip32-path-0.4.2.tgz#5db0416ad6822712f077836e2557b8697c0c7c99" integrity sha1-XbBBataCJxLwd4NuJVe4aXwMfJk= -bip39@^3.0.4: +bip32@2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/bip32/-/bip32-2.0.6.tgz#6a81d9f98c4cd57d05150c60d8f9e75121635134" + integrity sha512-HpV5OMLLGTjSVblmrtYRfFFKuQB+GArM0+XP8HGWfJ5vxYBqo+DesvJwOdC2WJ3bCkZShGf0QIfoIpeomVzVdA== + dependencies: + "@types/node" "10.12.18" + bs58check "^2.1.1" + create-hash "^1.2.0" + create-hmac "^1.1.7" + tiny-secp256k1 "^1.1.3" + typeforce "^1.11.5" + wif "^2.0.6" + +bip39@3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/bip39/-/bip39-3.0.2.tgz#2baf42ff3071fc9ddd5103de92e8f80d9257ee32" + integrity sha512-J4E1r2N0tUylTKt07ibXvhpT2c5pyAFgvuA5q1H9uDy6dEGpjV8jmymh3MTYJDLCNbIVClSB9FbND49I6N24MQ== + dependencies: + "@types/node" "11.11.6" + create-hash "^1.1.0" + pbkdf2 "^3.0.9" + randombytes "^2.0.1" + +bip39@^3.0.2, bip39@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/bip39/-/bip39-3.0.4.tgz#5b11fed966840b5e1b8539f0f54ab6392969b2a0" integrity sha512-YZKQlb752TrUWqHWj7XAwCSjYEgGAk+/Aas3V7NyjQeZYsztO8JnQUaCWhcnL4T+jL8nvB8typ2jRPzTlgugNw== @@ -2546,10 +2840,10 @@ blake2b@^2.1.3: blake2b-wasm "^1.1.0" nanoassert "^1.0.0" -blakejs@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/blakejs/-/blakejs-1.1.0.tgz#69df92ef953aa88ca51a32df6ab1c54a155fc7a5" - integrity sha1-ad+S75U6qIylGjLfarHFShVfx6U= +blakejs@^1.1.0, blakejs@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/blakejs/-/blakejs-1.1.1.tgz#bf313053978b2cd4c444a48795710be05c785702" + integrity sha512-bLG6PHOCZJKNshTjGRBvET0vTciwQE6zFKOKKXPDJfwFBd4Ac0yBfPZqcGvGJap50l7ktvlpFqc2jGVaUgbJgg== bluebird@~3.4.1: version "3.4.7" @@ -2635,7 +2929,7 @@ browserify-aes@^1.2.0: inherits "^2.0.1" safe-buffer "^5.0.1" -browserslist@^4.14.5, browserslist@^4.16.3: +browserslist@^4.16.6: version "4.16.6" resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.16.6.tgz#d7901277a5a88e554ed305b183ec9b0c08f66fa2" integrity sha512-Wspk/PqO+4W9qp5iUTJsa1B/QrYn1keNCcEP5OvP7WBwT4KaDly0uONYmC6Xa3Z5IqnUgS0KcgLYu1l74x0ZXQ== @@ -2653,7 +2947,7 @@ bs58@^4.0.0, bs58@^4.0.1: dependencies: base-x "^3.0.2" -bs58check@2.1.2, bs58check@^2.1.2: +bs58check@2.1.2, bs58check@<3.0.0, bs58check@^2.1.1, bs58check@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/bs58check/-/bs58check-2.1.2.tgz#53b018291228d82a5aa08e7d796fdafda54aebfc" integrity sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA== @@ -2690,6 +2984,14 @@ buffer@5.6.0: base64-js "^1.0.2" ieee754 "^1.1.4" +buffer@5.6.1: + version "5.6.1" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.6.1.tgz#b99419405f4290a7a1f20b51037cee9f1fbd7f6a" + integrity sha512-2z15UUHpS9/3tk9mY/q+Rl3rydOi7yMp5XWNQnRvoz+mJwiv8brqYwp9a+nOCtma6dwuEIxljD8W3ysVBZ05Vg== + dependencies: + base64-js "^1.3.1" + ieee754 "^1.1.13" + buffer@^5.1.0, buffer@^5.5.0: version "5.7.1" resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.7.1.tgz#ba62e7c13133053582197160851a8f648e99eed0" @@ -2941,7 +3243,7 @@ colorspace@1.1.x: color "3.0.x" text-hex "1.0.x" -combined-stream@^1.0.6, combined-stream@^1.0.8, combined-stream@~1.0.6: +combined-stream@^1.0.6, combined-stream@~1.0.6: version "1.0.8" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== @@ -3022,12 +3324,12 @@ copy-descriptor@^0.1.0: resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= -core-js-compat@^3.9.0, core-js-compat@^3.9.1: - version "3.10.1" - resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.10.1.tgz#62183a3a77ceeffcc420d907a3e6fc67d9b27f1c" - integrity sha512-ZHQTdTPkqvw2CeHiZC970NNJcnwzT6YIueDMASKt+p3WbZsLXOcoD392SkcWhkC0wBBHhlfhqGKKsNCQUozYtg== +core-js-compat@^3.14.0, core-js-compat@^3.15.0: + version "3.15.1" + resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.15.1.tgz#1afe233716d37ee021956ef097594071b2b585a7" + integrity sha512-xGhzYMX6y7oEGQGAJmP2TmtBLvR4nZmRGEcFa3ubHOq5YEp51gGN9AovVa0AoujGZIq+Wm6dISiYyGNfdflYww== dependencies: - browserslist "^4.16.3" + browserslist "^4.16.6" semver "7.0.0" core-util-is@1.0.2, core-util-is@~1.0.0: @@ -3050,7 +3352,7 @@ crc@^3.5.0: dependencies: buffer "^5.1.0" -create-hash@^1.1.0, create-hash@^1.1.2, create-hash@^1.2.0: +create-hash@1.2.0, create-hash@^1.1.0, create-hash@^1.1.2, create-hash@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.2.0.tgz#889078af11a63756bcfb59bd221996be3a9ef196" integrity sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg== @@ -3248,9 +3550,9 @@ detect-libc@^1.0.3: integrity sha1-+hN8S9aY7fVc1c0CrFWfkaTEups= detect-node@^2.0.4: - version "2.0.5" - resolved "https://registry.yarnpkg.com/detect-node/-/detect-node-2.0.5.tgz#9d270aa7eaa5af0b72c4c9d9b814e7f4ce738b79" - integrity sha512-qi86tE6hRcFHy8jI1m2VG+LaPUR1LhqDa5G8tVjuUXmOrpuAgqsA1pN0+ldgr3aKUH+QLI9hCY/OcRYisERejw== + version "2.1.0" + resolved "https://registry.yarnpkg.com/detect-node/-/detect-node-2.1.0.tgz#c9c70775a49c3d03bc2c06d9a73be550f978f8b1" + integrity sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g== diff-sequences@^26.6.2: version "26.6.2" @@ -3299,7 +3601,7 @@ electron-to-chromium@^1.3.723: resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.740.tgz#e38b7d2b848f632191b643e6dabca51be2162922" integrity sha512-Mi2m55JrX2BFbNZGKYR+2ItcGnR4O5HhrvgoRRyZQlaMGQULqDhoGkLWHzJoshSzi7k1PUofxcDbNhlFrDZNhg== -elliptic@6.5.4, elliptic@^6.5.2, elliptic@^6.5.4: +elliptic@6.5.4, elliptic@^6.4.0, elliptic@^6.5.2, elliptic@^6.5.3, elliptic@^6.5.4: version "6.5.4" resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.4.tgz#da37cebd31e79a1367e941b592ed1fbebd58abbb" integrity sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ== @@ -3533,41 +3835,41 @@ ethereumjs-util@^7.0.10: ethjs-util "0.1.6" rlp "^2.2.4" -ethers@^5.2.0: - version "5.3.1" - resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.3.1.tgz#1f018f0aeb651576cd84fd987a45f0b99646d761" - integrity sha512-xCKmC0gsZ9gks89ZfK3B1y6LlPdvX5fxDtu9SytnpdDJR1M7pmJI+4H0AxQPMgUYr7GtQdmECLR0gWdJQ+lZYw== - dependencies: - "@ethersproject/abi" "5.3.1" - "@ethersproject/abstract-provider" "5.3.0" - "@ethersproject/abstract-signer" "5.3.0" - "@ethersproject/address" "5.3.0" - "@ethersproject/base64" "5.3.0" - "@ethersproject/basex" "5.3.0" - "@ethersproject/bignumber" "5.3.0" - "@ethersproject/bytes" "5.3.0" - "@ethersproject/constants" "5.3.0" - "@ethersproject/contracts" "5.3.0" - "@ethersproject/hash" "5.3.0" - "@ethersproject/hdnode" "5.3.0" - "@ethersproject/json-wallets" "5.3.0" - "@ethersproject/keccak256" "5.3.0" - "@ethersproject/logger" "5.3.0" - "@ethersproject/networks" "5.3.1" - "@ethersproject/pbkdf2" "5.3.0" - "@ethersproject/properties" "5.3.0" - "@ethersproject/providers" "5.3.1" - "@ethersproject/random" "5.3.0" - "@ethersproject/rlp" "5.3.0" - "@ethersproject/sha2" "5.3.0" - "@ethersproject/signing-key" "5.3.0" - "@ethersproject/solidity" "5.3.0" - "@ethersproject/strings" "5.3.0" - "@ethersproject/transactions" "5.3.0" - "@ethersproject/units" "5.3.0" - "@ethersproject/wallet" "5.3.0" - "@ethersproject/web" "5.3.0" - "@ethersproject/wordlists" "5.3.0" +ethers@^5.4.1: + version "5.4.1" + resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.4.1.tgz#bcff1e9f45bf1a061bf313ec04e8d9881d2d53f9" + integrity sha512-SrcddMdCgP1hukDvCPd87Aipbf4NWjQvdfAbZ65XSZGbfyuYPtIrUJPDH5B1SBRsdlfiEgX3eoz28DdBDzMNFg== + dependencies: + "@ethersproject/abi" "5.4.0" + "@ethersproject/abstract-provider" "5.4.0" + "@ethersproject/abstract-signer" "5.4.0" + "@ethersproject/address" "5.4.0" + "@ethersproject/base64" "5.4.0" + "@ethersproject/basex" "5.4.0" + "@ethersproject/bignumber" "5.4.0" + "@ethersproject/bytes" "5.4.0" + "@ethersproject/constants" "5.4.0" + "@ethersproject/contracts" "5.4.0" + "@ethersproject/hash" "5.4.0" + "@ethersproject/hdnode" "5.4.0" + "@ethersproject/json-wallets" "5.4.0" + "@ethersproject/keccak256" "5.4.0" + "@ethersproject/logger" "5.4.0" + "@ethersproject/networks" "5.4.1" + "@ethersproject/pbkdf2" "5.4.0" + "@ethersproject/properties" "5.4.0" + "@ethersproject/providers" "5.4.1" + "@ethersproject/random" "5.4.0" + "@ethersproject/rlp" "5.4.0" + "@ethersproject/sha2" "5.4.0" + "@ethersproject/signing-key" "5.4.0" + "@ethersproject/solidity" "5.4.0" + "@ethersproject/strings" "5.4.0" + "@ethersproject/transactions" "5.4.0" + "@ethersproject/units" "5.4.0" + "@ethersproject/wallet" "5.4.0" + "@ethersproject/web" "5.4.0" + "@ethersproject/wordlists" "5.4.0" ethjs-util@0.1.6, ethjs-util@^0.1.3: version "0.1.6" @@ -3837,9 +4139,9 @@ fn.name@1.x.x: integrity sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw== follow-redirects@^1.10.0: - version "1.13.0" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.13.0.tgz#b42e8d93a2a7eea5ed88633676d6597bc8e384db" - integrity sha512-aq6gF1BEKje4a9i9+5jimNFIpq4Q1WiwBToeRK5NvZBd/TRsmW8BsJfOEGkr76TbOyPVD3OVDN910EcUNtRYEA== + version "1.14.1" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.1.tgz#d9114ded0a1cfdd334e164e6662ad02bfd91ff43" + integrity sha512-HWqDgT7ZEkqRzBvc2s64vSZ/hfOceEol3ac/7tKwzuvEyWx3/4UegXh5oBOIotkGsObyk3xznnSRVADBgWSQVg== for-in@^1.0.2: version "1.0.2" @@ -3856,15 +4158,6 @@ forever-agent@~0.6.1: resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE= -form-data@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-3.0.0.tgz#31b7e39c85f1355b7139ee0c647cf0de7f83c682" - integrity sha512-CKMFDglpbMi6PyN+brwB9Q/GOw0eAnsrEZDgcsH5Krhz5Od/haKHAX0NmQfha2zPPz0JpWzA7GJHGSnvCRLWsg== - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.8" - mime-types "^2.1.12" - form-data@~2.3.2: version "2.3.3" resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" @@ -4013,18 +4306,10 @@ github-from-package@0.0.0: resolved "https://registry.yarnpkg.com/github-from-package/-/github-from-package-0.0.0.tgz#97fb5d96bfde8973313f20e8288ef9a167fa64ce" integrity sha1-l/tdlr/eiXMxPyDoKI75oWf6ZM4= -glob-parent@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-3.1.0.tgz#9e6af6299d8d3bd2bd40430832bd113df906c5ae" - integrity sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4= - dependencies: - is-glob "^3.1.0" - path-dirname "^1.0.0" - -glob-parent@~5.1.0: - version "5.1.1" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.1.tgz#b6c1ef417c4e5663ea498f1c45afac6916bbc229" - integrity sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ== +glob-parent@^5.1.2, glob-parent@~5.1.0: + version "5.1.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" + integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== dependencies: is-glob "^4.0.1" @@ -4045,6 +4330,13 @@ globals@^11.1.0: resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== +globalthis@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/globalthis/-/globalthis-1.0.2.tgz#2a235d34f4d8036219f7e34929b5de9e18166b8b" + integrity sha512-ZQnSFO1la8P7auIOQECnm0sSuoMeaSq0EEdXMBFF2QJO4uNcwbyhSgG3MruWNbFTqCLmxVwGOl7LZ9kASvHdeQ== + dependencies: + define-properties "^1.1.3" + got@^10.5.7: version "10.7.0" resolved "https://registry.yarnpkg.com/got/-/got-10.7.0.tgz#62889dbcd6cca32cd6a154cc2d0c6895121d091f" @@ -4405,7 +4697,7 @@ is-extendable@^1.0.1: dependencies: is-plain-object "^2.0.4" -is-extglob@^2.1.0, is-extglob@^2.1.1: +is-extglob@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= @@ -4432,13 +4724,6 @@ is-generator-function@^1.0.7: resolved "https://registry.yarnpkg.com/is-generator-function/-/is-generator-function-1.0.8.tgz#dfb5c2b120e02b0a8d9d2c6806cd5621aa922f7b" integrity sha512-2Omr/twNtufVZFr1GhxjOMFPAj2sjc/dKaIqBhvo4qciXfJmITGH6ZGd8eZYNHza8t1y0e01AuqRhJwfWp26WQ== -is-glob@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-3.1.0.tgz#7ba5ae24217804ac70707b96922567486cc3e84a" - integrity sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo= - dependencies: - is-extglob "^2.1.0" - is-glob@^4.0.0, is-glob@^4.0.1, is-glob@~4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" @@ -4619,6 +4904,11 @@ js-sha3@0.8.0, js-sha3@^0.8.0: resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.8.0.tgz#b9b7a5da73afad7dedd0f8c463954cbde6818840" integrity sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q== +js-sha512@^0.8.0: + version "0.8.0" + resolved "https://registry.yarnpkg.com/js-sha512/-/js-sha512-0.8.0.tgz#dd22db8d02756faccf19f218e3ed61ec8249f7d4" + integrity sha512-PWsmefG6Jkodqt+ePTvBZCSMFgN7Clckjd0O7su3I0+BW2QWUTJNzjktHsztGLhncP2h8mcF9V9Y2Ha59pAViQ== + "js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" @@ -4760,6 +5050,18 @@ kuler@^2.0.0: resolved "https://registry.yarnpkg.com/kuler/-/kuler-2.0.0.tgz#e2c570a3800388fb44407e851531c1d670b061b3" integrity sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A== +libsodium-wrappers@^0.7.6: + version "0.7.9" + resolved "https://registry.yarnpkg.com/libsodium-wrappers/-/libsodium-wrappers-0.7.9.tgz#4ffc2b69b8f7c7c7c5594a93a4803f80f6d0f346" + integrity sha512-9HaAeBGk1nKTRFRHkt7nzxqCvnkWTjn1pdjKgcUnZxj0FyOP4CnhgFhMdrFfgNsukijBGyBLpP2m2uKT1vuWhQ== + dependencies: + libsodium "^0.7.0" + +libsodium@^0.7.0: + version "0.7.9" + resolved "https://registry.yarnpkg.com/libsodium/-/libsodium-0.7.9.tgz#4bb7bcbf662ddd920d8795c227ae25bbbfa3821b" + integrity sha512-gfeADtR4D/CM0oRUviKBViMGXZDgnFdMKMzHsvBdqLBHd9ySi6EtYnmuhHVDDYgYpAO8eU8hEY+F8vIUAPh08A== + listenercount@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/listenercount/-/listenercount-1.0.1.tgz#84c8a72ab59c4725321480c975e6508342e70937" @@ -4807,7 +5109,7 @@ lodash.uniq@^4.5.0: resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M= -lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.21, lodash@^4.17.4, lodash@^4.17.5: +lodash@4.17.21, lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.21, lodash@^4.17.4, lodash@^4.17.5: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -4823,6 +5125,11 @@ logform@^2.2.0: ms "^2.1.1" triple-beam "^1.3.0" +long@4.0.0, long@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/long/-/long-4.0.0.tgz#9a7b71cfb7d361a194ea555241c92f7468d5bf28" + integrity sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA== + long@^2.2.3: version "2.4.0" resolved "https://registry.yarnpkg.com/long/-/long-2.4.0.tgz#9fa180bb1d9500cdc29c4156766a1995e1f4524f" @@ -5063,7 +5370,7 @@ ms@2.1.2, ms@^2.1.1: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== -nan@^2.14.0, nan@^2.14.2, nan@^2.2.1: +nan@^2.13.2, nan@^2.14.0, nan@^2.14.2, nan@^2.2.1: version "2.14.2" resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.2.tgz#f5376400695168f4cc694ac9393d0c9585eeea19" integrity sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ== @@ -5401,6 +5708,13 @@ osenv@^0.1.4: os-homedir "^1.0.0" os-tmpdir "^1.0.0" +ow@0.17.0: + version "0.17.0" + resolved "https://registry.yarnpkg.com/ow/-/ow-0.17.0.tgz#4f938999fed6264c9048cd6254356e0f1e7f688c" + integrity sha512-i3keDzDQP5lWIe4oODyDFey1qVrq2hXKTuTH2VpqwpYtzPiKZt2ziRI4NBQmgW40AnV5Euz17OyWweCb+bNEQA== + dependencies: + type-fest "^0.11.0" + p-cancelable@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-2.0.0.tgz#4a3740f5bdaf5ed5d7c3e34882c6fb5d6b266a6e" @@ -5454,11 +5768,6 @@ pascalcase@^0.1.1: resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" integrity sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ= -path-dirname@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0" - integrity sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA= - path-exists@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" @@ -5596,6 +5905,63 @@ prop-types@^15.7.2: object-assign "^4.1.1" react-is "^16.8.1" +protobufjs@6.10.1: + version "6.10.1" + resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-6.10.1.tgz#e6a484dd8f04b29629e9053344e3970cccf13cd2" + integrity sha512-pb8kTchL+1Ceg4lFd5XUpK8PdWacbvV5SK2ULH2ebrYtl4GjJmS24m6CKME67jzV53tbJxHlnNOSqQHbTsR9JQ== + 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" + +protobufjs@^6.8.8: + version "6.11.2" + resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-6.11.2.tgz#de39fabd4ed32beaa08e9bb1e30d08544c1edf8b" + integrity sha512-4BQJoPooKJl2G9j3XftkIXjoC9C0Av2NOrWmbLWT1vH32GcSUHjM0Arra6UfTsVyfMAuFzaLucXn1sadxJydAw== + 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" + +protobufjs@~6.10.2: + version "6.10.2" + resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-6.10.2.tgz#b9cb6bd8ec8f87514592ba3fdfd28e93f33a469b" + integrity sha512-27yj+04uF6ya9l+qfpH187aqEzfCF4+Uit0I9ZBQVqK09hk/SQzKa2MUqUpXaVa7LOFRg1TSSr3lVxGOk6c0SQ== + 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" + proxy-addr@~2.0.5: version "2.0.6" resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.6.tgz#fdc2336505447d3f2f2c638ed272caf614bbb2bf" @@ -5659,7 +6025,7 @@ querystringify@^2.1.1: resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-2.2.0.tgz#3345941b4153cb9d082d8eee4cda2016a9aef7f6" integrity sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ== -randombytes@^2.0.1, randombytes@^2.1.0: +randombytes@2.1.0, randombytes@^2.0.1, randombytes@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== @@ -5768,6 +6134,11 @@ readdirp@~3.5.0: dependencies: picomatch "^2.2.1" +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== + rechoir@^0.6.2: version "0.6.2" resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384" @@ -6000,10 +6371,10 @@ ripple-lib-transactionparser@0.8.2: bignumber.js "^9.0.0" lodash "^4.17.15" -ripple-lib@1.9.5: - version "1.9.5" - resolved "https://registry.yarnpkg.com/ripple-lib/-/ripple-lib-1.9.5.tgz#6238c8869cc1353add3c8000016fabb6a1e72afe" - integrity sha512-de5lhHimuBM1TqtWNEobUDOToXK1VoB+svP9kvb8xy9cBRza5/kWWAR7FkQ2e1kPNXMR6G51HNPfTattCb9T9g== +ripple-lib@1.9.6: + version "1.9.6" + resolved "https://registry.yarnpkg.com/ripple-lib/-/ripple-lib-1.9.6.tgz#c3c071390597effc0ec191e22c9575108cd795f8" + integrity sha512-EJlbOWIqO8nDzHr/oO+/n7RvwGYAilRJPK/iwZjxPp5o+jNEBdHz1uVleAobasXS4tiVfBBDUP0nfhsxvluOWQ== dependencies: "@types/lodash" "^4.14.136" "@types/ws" "^7.2.0" @@ -6030,7 +6401,7 @@ rxjs-compat@^6.6.7: resolved "https://registry.yarnpkg.com/rxjs-compat/-/rxjs-compat-6.6.7.tgz#6eb4ef75c0a58ea672854a701ccc8d49f41e69cb" integrity sha512-szN4fK+TqBPOFBcBcsR0g2cmTTUF/vaFEOZNuSdfU8/pGFnNmmn2u8SystYXG1QMrjOPBc6XTKHMVfENDf6hHw== -rxjs@6, rxjs@^6.6.6, rxjs@^6.6.7: +rxjs@6, rxjs@^6.6.7: version "6.6.7" resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.7.tgz#90ac018acabf491bf65044235d5863c4dab804c9" integrity sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ== @@ -6087,7 +6458,7 @@ scryptsy@^2.1.0: resolved "https://registry.yarnpkg.com/scryptsy/-/scryptsy-2.1.0.tgz#8d1e8d0c025b58fdd25b6fa9a0dc905ee8faa790" integrity sha512-1CdSqHQowJBnMAFyPEBRfqag/YP9OF394FV+4YREIJX4ljD7OxvQRDayyoyyCk+senRjSkP6VnUNQmVQqB6g7w== -secp256k1@^4.0.1, secp256k1@^4.0.2: +secp256k1@4.0.2, secp256k1@^4.0.1, secp256k1@^4.0.2: version "4.0.2" resolved "https://registry.yarnpkg.com/secp256k1/-/secp256k1-4.0.2.tgz#15dd57d0f0b9fdb54ac1fa1694f40e5e9a54f4a1" integrity sha512-UDar4sKvWAksIlfX3xIaQReADn+WFnHvbVujpcbr+9Sf/69odMwy2MUsz5CKLQgX9nsIyrjuxL2imVyoNHa3fg== @@ -6387,9 +6758,9 @@ stellar-base@^5.2.1: sodium-native "^2.3.0" stellar-sdk@^8.2.2: - version "8.2.2" - resolved "https://registry.yarnpkg.com/stellar-sdk/-/stellar-sdk-8.2.2.tgz#fd52bbf09992a60c38548c4ca97d9e14e98bab82" - integrity sha512-TCE69NV1/sZXfwGO3a7aGoskR/9Src7JNZMOli8jO8wTWi+JOzMhJi/SLj3qHp6xvMKI4Oonqz5HiRf0b0fsSQ== + version "8.2.3" + resolved "https://registry.yarnpkg.com/stellar-sdk/-/stellar-sdk-8.2.3.tgz#2970211877937e487b4e1f88021200cf0ddf8603" + integrity sha512-RlrR6DD+706vgA1iVDXteU/x3bdqFDthf+4M3C19D/owmF0GCR/FoRQpnPqqRJ0C/rbbdZ6YjAyKO6Q0GSbDWw== dependencies: "@types/eventsource" "^1.1.2" "@types/node" ">= 8" @@ -6545,6 +6916,11 @@ supports-color@^7.1.0: dependencies: has-flag "^4.0.0" +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== + table@^5.4.6: version "5.4.6" resolved "https://registry.yarnpkg.com/table/-/table-5.4.6.tgz#1292d19500ce3f86053b05f0e8e7e4a3bb21079e" @@ -6611,6 +6987,17 @@ through@^2.3.8: resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= +tiny-secp256k1@^1.1.3: + version "1.1.6" + resolved "https://registry.yarnpkg.com/tiny-secp256k1/-/tiny-secp256k1-1.1.6.tgz#7e224d2bee8ab8283f284e40e6b4acb74ffe047c" + integrity sha512-FmqJZGduTyvsr2cF3375fqGHUovSwDi/QytexX1Se4BPuPZpTE5Ftp5fg+EFSuEf3lhZqgCRjEG3ydUQ/aNiwA== + dependencies: + bindings "^1.3.0" + bn.js "^4.11.8" + create-hmac "^1.1.7" + elliptic "^6.4.0" + nan "^2.13.2" + to-fast-properties@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" @@ -6725,6 +7112,11 @@ type-fest@^0.10.0: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.10.0.tgz#7f06b2b9fbfc581068d1341ffabd0349ceafc642" integrity sha512-EUV9jo4sffrwlg8s0zDhP0T2WD3pru5Xi0+HTE3zTUmBaZNhfkite9PdSJwdXLwPVW0jnAHT56pZHIOYckPEiw== +type-fest@^0.11.0: + version "0.11.0" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.11.0.tgz#97abf0872310fed88a5c466b25681576145e33f1" + integrity sha512-OdjXJxnCN1AvyLSzeKIgXTXxV+99ZuXl3Hpo9XpJAv9MBcHrrJOQ5kV7ypXOuQie+AmWG25hLbiKdwYTifzcfQ== + type-is@~1.6.17, type-is@~1.6.18: version "1.6.18" resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131" @@ -6740,6 +7132,11 @@ typedarray-to-buffer@3.1.5: dependencies: is-typedarray "^1.0.0" +typeforce@^1.11.5: + version "1.18.0" + resolved "https://registry.yarnpkg.com/typeforce/-/typeforce-1.18.0.tgz#d7416a2c5845e085034d70fcc5b6cc4a90edbfdc" + integrity sha512-7uc1O8h1M1g0rArakJdf0uLRSSgFcYexrVoKo+bzJd32gd4gDy2L/Z+8/FjPnU9ydY3pEnVPtr9FyscYY60K1g== + typescript-compiler@^1.4.1-2: version "1.4.1-2" resolved "https://registry.yarnpkg.com/typescript-compiler/-/typescript-compiler-1.4.1-2.tgz#ba4f7db22d91534a1929d90009dce161eb72fd3f" @@ -6997,6 +7394,13 @@ wide-align@^1.1.0: dependencies: string-width "^1.0.2 || 2" +wif@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/wif/-/wif-2.0.6.tgz#08d3f52056c66679299726fade0d432ae74b4704" + integrity sha1-CNP1IFbGZnkplyb63g1DKudLRwQ= + dependencies: + bs58check "<3.0.0" + window-getters@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/window-getters/-/window-getters-1.0.0.tgz#b5b264538c4c79cead027f9997850222bf6d0852" @@ -7073,10 +7477,23 @@ ws@7.4.6: resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.6.tgz#5654ca8ecdeee47c33a9a4bf6d28e2be2980377c" integrity sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A== -xstate@^4.20.0: - version "4.20.0" - resolved "https://registry.yarnpkg.com/xstate/-/xstate-4.20.0.tgz#6f241f2b49c840cb6e05b32544a6048362f558e2" - integrity sha512-u5Ou1CMo/oWApasmv1TYTHgj38k69DJdTqQdBBwt+/ooNhPJQiSIKTB3Y3HvX0h5tulwfSo6xAwZgBgjRsK3LA== +ws@^7: + version "7.5.2" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.2.tgz#09cc8fea3bec1bc5ed44ef51b42f945be36900f6" + integrity sha512-lkF7AWRicoB9mAgjeKbGqVUekLnSNO4VjKVnuPHpQeOxZOErX6BPXwJk70nFslRCEEA8EVW7ZjKwXaP9N+1sKQ== + +xstate@^4.22.0: + version "4.22.0" + resolved "https://registry.yarnpkg.com/xstate/-/xstate-4.22.0.tgz#5d6c2a762cb94c3170ee826d26194b7561d70aae" + integrity sha512-WBQS/XxmjCH6789fx5JXjct2pWA0ZI0a1Kx8PJMurzgytkJH3vC2+QganHWzK38vG9PyXHefyVG54UN5q6YVSw== + +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" xxhashjs@^0.2.2: version "0.2.2" diff --git a/mobile-test-app/Gemfile.lock b/mobile-test-app/Gemfile.lock index 5e09c0c861..446bff3ddb 100644 --- a/mobile-test-app/Gemfile.lock +++ b/mobile-test-app/Gemfile.lock @@ -7,7 +7,7 @@ GEM minitest (~> 5.1) thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) - addressable (2.7.0) + addressable (2.8.0) public_suffix (>= 2.0.2, < 5.0) algoliasearch (1.27.1) httpclient (~> 2.8, >= 2.8.3) diff --git a/mobile-test-app/yarn.lock b/mobile-test-app/yarn.lock index e8ac11cd1e..ce408e62d1 100644 --- a/mobile-test-app/yarn.lock +++ b/mobile-test-app/yarn.lock @@ -1336,9 +1336,9 @@ form-data "^3.0.0" "@types/node@*", "@types/node@>= 8": - version "14.14.37" - resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.37.tgz#a3dd8da4eb84a996c36e331df98d82abd76b516e" - integrity sha512-XYmBiy+ohOR4Lh5jE379fV2IU+6Jn4g5qASinhitfyO71b/sCo6MKsMLF5tc7Zf2CE8hViVQyYSobJNke8OvUw== + version "15.14.0" + resolved "https://registry.yarnpkg.com/@types/node/-/node-15.14.0.tgz#74dbf254fb375551a9d2a71faf6b9dbc2178dc53" + integrity sha512-um/+/ip3QZmwLfIkWZSNtQIJNVAqrJ92OkLMeuZrjZMTAJniI7fh8N8OICyDhAJ2mzgk/fmYFo72jRr5HyZ1EQ== "@types/pbkdf2@^3.0.0": version "3.1.0" @@ -1401,9 +1401,9 @@ integrity sha512-RJJrrySY7A8havqpGObOB4W92QXKJo63/jFLLgpvOtsGUqbQZ9Sbgl35KMm1DjC6j7AvmmU2bIno+3IyEaemaw== "@types/urijs@^1.19.6": - version "1.19.15" - resolved "https://registry.yarnpkg.com/@types/urijs/-/urijs-1.19.15.tgz#0142b92b52d07c4ba97dd82e7a54a875332942ec" - integrity sha512-pEDVREIvkyRtzpWlO5nqsUgR/JpLv9+lAzvkERCwoH2jXxl+TmaTNshhL7gjQLhfqgFUzCM6ovmoB1JssTop1A== + version "1.19.16" + resolved "https://registry.yarnpkg.com/@types/urijs/-/urijs-1.19.16.tgz#156658c47438fa867db5dce4d2949fe1ca0878e2" + integrity sha512-WgxqcUSEYijGnNWHSln/uqay+AywS3mEhLC+d2PwLsru2fLeMblvxP67Y/SCfB2Pxe+dX/zbIoNNzXY+VKOtNA== "@types/ws@^7.2.0": version "7.4.0" @@ -2748,9 +2748,9 @@ detect-libc@^1.0.2: integrity sha1-+hN8S9aY7fVc1c0CrFWfkaTEups= detect-node@^2.0.4: - version "2.0.5" - resolved "https://registry.yarnpkg.com/detect-node/-/detect-node-2.0.5.tgz#9d270aa7eaa5af0b72c4c9d9b814e7f4ce738b79" - integrity sha512-qi86tE6hRcFHy8jI1m2VG+LaPUR1LhqDa5G8tVjuUXmOrpuAgqsA1pN0+ldgr3aKUH+QLI9hCY/OcRYisERejw== + version "2.1.0" + resolved "https://registry.yarnpkg.com/detect-node/-/detect-node-2.1.0.tgz#c9c70775a49c3d03bc2c06d9a73be550f978f8b1" + integrity sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g== diff-sequences@^24.9.0: version "24.9.0" @@ -3338,9 +3338,9 @@ fn.name@1.x.x: integrity sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw== follow-redirects@^1.10.0: - version "1.13.0" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.13.0.tgz#b42e8d93a2a7eea5ed88633676d6597bc8e384db" - integrity sha512-aq6gF1BEKje4a9i9+5jimNFIpq4Q1WiwBToeRK5NvZBd/TRsmW8BsJfOEGkr76TbOyPVD3OVDN910EcUNtRYEA== + version "1.14.1" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.1.tgz#d9114ded0a1cfdd334e164e6662ad02bfd91ff43" + integrity sha512-HWqDgT7ZEkqRzBvc2s64vSZ/hfOceEol3ac/7tKwzuvEyWx3/4UegXh5oBOIotkGsObyk3xznnSRVADBgWSQVg== for-in@^1.0.2: version "1.0.2" @@ -6442,10 +6442,10 @@ static-extend@^0.1.1: resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow= -stellar-base@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/stellar-base/-/stellar-base-5.1.0.tgz#7c2d2c9fe7ec8781df41514bc351e8c749888278" - integrity sha512-J0hdF2UGKlRmwaQCpL5IedetJMDBvxTmoFEnvwHMxZBeSNfGt3+pjLi+dghURiWyuBOF9ZeyS8lUBeOhy/tOpA== +stellar-base@^5.2.1: + version "5.3.0" + resolved "https://registry.yarnpkg.com/stellar-base/-/stellar-base-5.3.0.tgz#15e8d9f3767a62bda14d55f0c4347d27987ae1f6" + integrity sha512-8LCOX/D/Zp5DBhcTwXQSh9v25sHivkCJc+FSPncqhvMYgvQQg8w+2kj9hCFg1SAxkLJOjSpfzObrUaTl+CFFjw== dependencies: base32.js "^0.1.0" bignumber.js "^4.0.0" @@ -6458,9 +6458,9 @@ stellar-base@^5.1.0: sodium-native "^2.3.0" stellar-sdk@^8.1.1: - version "8.1.1" - resolved "https://registry.yarnpkg.com/stellar-sdk/-/stellar-sdk-8.1.1.tgz#3a1de4f5aa211dc41504275d4c12c85ef66ba742" - integrity sha512-crZSONO1lDEg2TP2wsslB7kcBopP6r2jzA5fC7JNvFZMMf0yq14fGDOwQerWI9XaxzpXOJxuQ1ZP3yB93Ds0+Q== + version "8.2.3" + resolved "https://registry.yarnpkg.com/stellar-sdk/-/stellar-sdk-8.2.3.tgz#2970211877937e487b4e1f88021200cf0ddf8603" + integrity sha512-RlrR6DD+706vgA1iVDXteU/x3bdqFDthf+4M3C19D/owmF0GCR/FoRQpnPqqRJ0C/rbbdZ6YjAyKO6Q0GSbDWw== dependencies: "@types/eventsource" "^1.1.2" "@types/node" ">= 8" @@ -6473,7 +6473,7 @@ stellar-sdk@^8.1.1: eventsource "^1.0.7" lodash "^4.17.11" randombytes "^2.1.0" - stellar-base "^5.1.0" + stellar-base "^5.2.1" toml "^2.3.0" tslib "^1.10.0" urijs "^1.19.1" diff --git a/package.json b/package.json index 42bdeb7eb1..8f7816d1c4 100644 --- a/package.json +++ b/package.json @@ -1,18 +1,21 @@ { + "engines": { + "node": ">=14" + }, "name": "@ledgerhq/live-common", "description": "Common ground for the Ledger Live apps", "repository": { "type": "git", "url": "https://github.com/LedgerHQ/ledger-live-common" }, - "version": "19.12.1", + "version": "20.5.2", "main": "lib/index.js", "license": "Apache-2.0", "scripts": { "flow-typed": "flow-typed install -s", "build": "./scripts/build.sh", "prepare": "yarn build", - "watch": "node scripts/buildReactIcons.js && BABEL_ENV=cjs babel -wsd lib src & flow-copy-source -wv src lib", + "watch": "node scripts/buildReactIcons.js && node scripts/buildReactFlags.js && BABEL_ENV=cjs babel -wsd lib src & flow-copy-source -wv src lib", "updateAppSupportsQuitApp": "node scripts/updateAppSupportsQuitApp.js", "prettier": "prettier --write 'src/**/*.?s' 'cli/src/**/*.?s'", "lint": "eslint src", @@ -20,10 +23,10 @@ "jest": "rimraf libcoredb && mkdir libcoredb && cross-env TZ=America/New_York jest", "test": "yarn jest", "ci-lint": "yarn lint && yarn flow", - "ci-test-common": "cross-env EXPERIMENTAL_EXPLORERS=1 yarn test --ci --updateSnapshot && git diff --exit-code src", + "ci-test-common": "env-cmd -f ./.ci.env yarn test --ci --updateSnapshot && git diff --exit-code src", "ci-setup-cli": "yalc publish && cd cli && yalc add @ledgerhq/live-common && yarn && yarn build && yarn link", "ci-test-cli": "cd cli && yarn test", - "ci-test-bot": "cross-env EXPERIMENTAL_EXPLORERS=1 yarn jest --testMatch '**/*.bot.js'" + "ci-test-bot": "env-cmd -f ./.ci.env yarn jest --testMatch '**/*.bot.js'" }, "files": [ "lib", @@ -58,6 +61,9 @@ "cli/", "test-helpers/" ], + "transformIgnorePatterns": [ + "/node_modules/(?!@polkadot|@babel/runtime/helpers/esm/)" + ], "moduleDirectories": [ "node_modules", "cli/node_modules" @@ -69,26 +75,28 @@ "react-redux": "7" }, "dependencies": { + "@crypto-com/chain-jslib": "^0.0.16", "@ledgerhq/compressjs": "1.3.2", - "@ledgerhq/cryptoassets": "6.0.2", - "@ledgerhq/devices": "6.0.2", + "@ledgerhq/cryptoassets": "6.1.0", + "@ledgerhq/devices": "6.1.0", "@ledgerhq/errors": "6.0.2", - "@ledgerhq/hw-app-algorand": "6.0.2", - "@ledgerhq/hw-app-btc": "6.0.2", - "@ledgerhq/hw-app-cosmos": "6.0.2", - "@ledgerhq/hw-app-eth": "6.0.2", - "@ledgerhq/hw-app-polkadot": "6.0.2", - "@ledgerhq/hw-app-str": "6.0.2", - "@ledgerhq/hw-app-tezos": "6.0.2", - "@ledgerhq/hw-app-trx": "6.0.2", - "@ledgerhq/hw-app-xrp": "6.0.2", - "@ledgerhq/hw-transport": "6.0.2", - "@ledgerhq/hw-transport-mocker": "6.0.2", - "@ledgerhq/hw-transport-node-speculos": "6.0.2", + "@ledgerhq/hw-app-algorand": "6.1.0", + "@ledgerhq/hw-app-btc": "6.1.0", + "@ledgerhq/hw-app-cosmos": "6.1.0", + "@ledgerhq/hw-app-eth": "6.1.0", + "@ledgerhq/hw-app-polkadot": "6.1.0", + "@ledgerhq/hw-app-str": "6.1.0", + "@ledgerhq/hw-app-tezos": "6.1.0", + "@ledgerhq/hw-app-trx": "6.1.0", + "@ledgerhq/hw-app-xrp": "6.1.0", + "@ledgerhq/hw-transport": "6.1.0", + "@ledgerhq/hw-transport-mocker": "6.1.0", + "@ledgerhq/hw-transport-node-speculos": "6.1.0", "@ledgerhq/logs": "6.0.2", - "@polkadot/types": "3.11.1", + "@polkadot/types": "5.0.1", + "@polkadot/types-known": "5.0.1", "@walletconnect/client": "1.4.1", - "@xstate/react": "^1.3.4", + "@xstate/react": "^1.5.1", "async": "^3.2.0", "axios": "0.21.1", "bchaddrjs": "^0.5.2", @@ -118,7 +126,7 @@ "ripemd160": "^2.0.2", "ripple-binary-codec": "^1.1.3", "ripple-bs58check": "^2.0.2", - "ripple-lib": "1.9.5", + "ripple-lib": "1.9.6", "rxjs": "6", "rxjs-compat": "^6.6.7", "secp256k1": "^4.0.2", @@ -127,7 +135,7 @@ "stellar-sdk": "^8.2.2", "triple-beam": "^1.3.0", "winston": "^3.3.3", - "xstate": "^4.20.0" + "xstate": "^4.22.0" }, "devDependencies": { "@babel/cli": "^7.13.16", @@ -146,6 +154,7 @@ "babel-jest": "^26.6.3", "benchmark": "^2.1.4", "cross-env": "^7.0.3", + "env-cmd": "*", "eslint": "^7.25.0", "eslint-config-airbnb": "^18.2.1", "eslint-config-prettier": "^7.2.0", diff --git a/scripts/build.sh b/scripts/build.sh index 2a4d82f95e..a6723134ee 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -2,9 +2,10 @@ set -e -rm -rf lib src/data/icons/react* +rm -rf lib src/data/icons/react* src/data/flags/react* bash ./scripts/sync-families-dispatch.sh node scripts/buildReactIcons.js +node scripts/buildReactFlags.js BABEL_ENV=cjs babel --ignore __tests__ -s -d lib src flow-copy-source -i \"__tests__/**\" src lib diff --git a/scripts/buildReactFlags.js b/scripts/buildReactFlags.js new file mode 100644 index 0000000000..78e2d21340 --- /dev/null +++ b/scripts/buildReactFlags.js @@ -0,0 +1,101 @@ +const fs = require("fs"); +const glob = require("glob"); +const camelcase = require("camelcase"); +const path = require("path"); +const svgr = require("@svgr/core").default; + +const rootDir = path.join(__dirname, "../src/data/flags"); +const reactDir = `${rootDir}/react`; +const reactNativeDir = `${rootDir}/reactNative`; + +if (!fs.existsSync(reactDir)) { + fs.mkdirSync(reactDir); +} + +if (!fs.existsSync(reactNativeDir)) { + fs.mkdirSync(reactNativeDir); +} + +function reactTemplate( + { template }, + opts, + { imports, interfaces, componentName, _, jsx, exports } +) { + // @TODO update this once TS is the norm here + const plugins = ["js", "flow"]; + + // if (opts.typescript) { + // plugins.push("typescript"); + // } + + const tpl = template.smart({ plugins }); + return tpl.ast` + ${imports}; + + type Props = { + size: number, + } + + ${interfaces} + function ${componentName}({ size }: Props) { + return ${jsx}; + } + + ${exports} + `; +} + +const convert = (svg, options, componentName, outputFile) => { + svgr(svg, options, componentName) + .then((result) => { + // @TODO remove this flow comment once TS is the norm here + // can't do it is babel ast for now sorry about it + const component = `//@flow + ${result.replace("xlinkHref=", "href=")}`; + + fs.writeFileSync(outputFile, component, "utf-8"); + }) + .catch((e) => console.error(e)); +}; + +glob(`${rootDir}/svg/*.svg`, (err, icons) => { + fs.writeFileSync(`${reactDir}/index.js`, "", "utf-8"); + fs.writeFileSync(`${reactNativeDir}/index.js`, "", "utf-8"); + + icons.forEach((i) => { + let name = `${camelcase(path.basename(i, ".svg"))}Flag`; + const exportString = `export { default as ${name} } from "./${name}";\n`; + + fs.appendFileSync(`${reactDir}/index.js`, exportString, "utf-8"); + fs.appendFileSync(`${reactNativeDir}/index.js`, exportString, "utf-8"); + + const svg = fs.readFileSync(i, "utf-8"); + const options = { + expandProps: false, + componentName: name, + svgProps: { + viewBox: "0 0 38 30", + height: "{size}", + width: "{size/30*38}", + }, + }; + + convert( + svg, + { ...options, template: reactTemplate }, + { componentName: name }, + `${reactDir}/${name}.js` + ); + + convert( + svg, + { + ...options, + native: true, + template: reactTemplate, + }, + { componentName: name }, + `${reactNativeDir}/${name}.js` + ); + }); +}); diff --git a/src/__tests__/__snapshots__/all.libcore.js.snap b/src/__tests__/__snapshots__/all.libcore.js.snap index 8b7076a409..1076b271af 100644 --- a/src/__tests__/__snapshots__/all.libcore.js.snap +++ b/src/__tests__/__snapshots__/all.libcore.js.snap @@ -21193,7 +21193,7 @@ Array [ "starred": false, "subAccounts": Array [], "swapHistory": Array [], - "syncHash": "[\\"ethereum/erc20/ampleforth\\"]_2674", + "syncHash": "[\\"ethereum/erc20/ampleforth\\"]_2687", "unitMagnitude": 18, "used": true, }, @@ -21233,7 +21233,7 @@ Array [ "starred": false, "subAccounts": Array [], "swapHistory": Array [], - "syncHash": "[\\"ethereum/erc20/ampleforth\\"]_2674", + "syncHash": "[\\"ethereum/erc20/ampleforth\\"]_2687", "unitMagnitude": 18, "used": true, }, @@ -21712,7 +21712,7 @@ Array [ "starred": false, "subAccounts": Array [], "swapHistory": Array [], - "syncHash": "[\\"ethereum/erc20/ampleforth\\"]_2674", + "syncHash": "[\\"ethereum/erc20/ampleforth\\"]_2687", "unitMagnitude": 18, "used": true, }, @@ -22032,7 +22032,7 @@ Array [ "starred": false, "subAccounts": Array [], "swapHistory": Array [], - "syncHash": "[\\"ethereum/erc20/ampleforth\\"]_2674", + "syncHash": "[\\"ethereum/erc20/ampleforth\\"]_2687", "unitMagnitude": 18, "used": true, }, @@ -22128,7 +22128,7 @@ Array [ "starred": false, "subAccounts": Array [], "swapHistory": Array [], - "syncHash": "[\\"ethereum/erc20/ampleforth\\"]_2674", + "syncHash": "[\\"ethereum/erc20/ampleforth\\"]_2687", "unitMagnitude": 18, "used": true, }, @@ -22252,7 +22252,7 @@ Array [ "starred": false, "subAccounts": Array [], "swapHistory": Array [], - "syncHash": "[\\"ethereum/erc20/ampleforth\\"]_2674", + "syncHash": "[\\"ethereum/erc20/ampleforth\\"]_2687", "unitMagnitude": 18, "used": true, }, @@ -22348,7 +22348,7 @@ Array [ "starred": false, "subAccounts": Array [], "swapHistory": Array [], - "syncHash": "[\\"ethereum/erc20/ampleforth\\"]_2674", + "syncHash": "[\\"ethereum/erc20/ampleforth\\"]_2687", "unitMagnitude": 18, "used": true, }, @@ -51014,22 +51014,22 @@ Array [ "RPUb5G4iGWhJy6TEzwhntA4qoyJSmXjSak", ], "senders": Array [ - "RPL2Ws9tYcSmTZ7fCfZnybGZrFnrjfHY5W", - "RUHd4GPvw4j6MSitJNC1bJjdpEA7tiFGC6", + "RJefAEr1mDREUPcw4uAR8m9pQHHthvVF5V", "RC7fCw4b7F4h3uDuYMMBvx8HE8ubwVuZMc", + "RU6LhQVXErq5vxdbm5ubnJnr236C1b9wFn", + "RTSyLffZtjPKZ1PLv6Dz7Sb2rWP8MHZbYA", + "RPL2Ws9tYcSmTZ7fCfZnybGZrFnrjfHY5W", "RDqp2hjeDt1YJXvB1c8udT8o3qJz25T89F", - "RJefAEr1mDREUPcw4uAR8m9pQHHthvVF5V", - "RPceGQQsZvvTzButAx1tZ9g8kM6eWdkVhg", "RHYxa3xWSPULd8deeYak1emQ9G61v3cBUy", - "RTSyLffZtjPKZ1PLv6Dz7Sb2rWP8MHZbYA", - "RU6LhQVXErq5vxdbm5ubnJnr236C1b9wFn", - "RHQeF3BUrN1ub5PqdQhWTAbJB2pv7xukML", - "RKSuhHTzgmc5gnFDCdSJt3U8HWeNYnPuK6", + "RFepmqmpXL5dFBJYSFoncN2Fphn2KiFH2S", + "RUHd4GPvw4j6MSitJNC1bJjdpEA7tiFGC6", + "RPceGQQsZvvTzButAx1tZ9g8kM6eWdkVhg", "RJXH5iiDG9GGP3uFN4y9nZznWm4H7WRpZr", + "RNBip2PqrD9xhkoK613VptMqjfS1Sdwa2p", "RQeZqrkJuGpv3nCF3QriSUt7b7zRaE2WDj", - "RFepmqmpXL5dFBJYSFoncN2Fphn2KiFH2S", "RQeZqrkJuGpv3nCF3QriSUt7b7zRaE2WDj", - "RNBip2PqrD9xhkoK613VptMqjfS1Sdwa2p", + "RHQeF3BUrN1ub5PqdQhWTAbJB2pv7xukML", + "RKSuhHTzgmc5gnFDCdSJt3U8HWeNYnPuK6", "RRmshus5KvRKRY1oT56imffSFuxPUPS7s1", ], "type": "IN", @@ -51064,10 +51064,10 @@ Array [ "RMLMRFQBN1xgsLmCUbgfEsRpkEHTFKcKT2", ], "senders": Array [ + "RRUYWQYzTbMA5i87hf3CBikMyFH5xv1p3x", + "RX2Z69ru9Rupds9UJR2SA2UyQEVeEi6uCS", "RTRMxYQJFfXmtdkrDjLpQt44qvsMoaTHnj", "RGW6W4DZowZ2GdX55tmavbLu8ZAkoMTaMs", - "RX2Z69ru9Rupds9UJR2SA2UyQEVeEi6uCS", - "RRUYWQYzTbMA5i87hf3CBikMyFH5xv1p3x", ], "type": "IN", "value": "958600000", @@ -51084,10 +51084,10 @@ Array [ "RMLMRFQBN1xgsLmCUbgfEsRpkEHTFKcKT2", ], "senders": Array [ + "RRUYWQYzTbMA5i87hf3CBikMyFH5xv1p3x", + "RX2Z69ru9Rupds9UJR2SA2UyQEVeEi6uCS", "RTRMxYQJFfXmtdkrDjLpQt44qvsMoaTHnj", "RGW6W4DZowZ2GdX55tmavbLu8ZAkoMTaMs", - "RX2Z69ru9Rupds9UJR2SA2UyQEVeEi6uCS", - "RRUYWQYzTbMA5i87hf3CBikMyFH5xv1p3x", ], "type": "OUT", "value": "958602010", @@ -51292,12 +51292,12 @@ Array [ "RUFezg3Y15ETRm6bEnEn3BCxwbVHy6bNtQ", ], "senders": Array [ + "RH5evC49ptzuXtejGCRKnEAmvMDBpht93B", + "RL56vZfA7ZEK5y8NVvg2mhmnEAsnCxhdWX", + "RK8876U89usNdEQ9Rrf3y5WbzaWSNejAUg", "RShN4KVXxJRPMtTtEH5FrnP8PyZzbiDrF1", "RGpavZ4T1w7UQaQk7EguLDjCCN72t2TAHZ", "RPpRK88iPS74bggXhqkrat2fSMfNpTJRZB", - "RL56vZfA7ZEK5y8NVvg2mhmnEAsnCxhdWX", - "RK8876U89usNdEQ9Rrf3y5WbzaWSNejAUg", - "RH5evC49ptzuXtejGCRKnEAmvMDBpht93B", ], "type": "IN", "value": "152825000", @@ -51368,8 +51368,8 @@ Array [ "RGkkBY1Sm5hRcYYNTSjjdJ6szN5pV7PCUC", ], "senders": Array [ - "RWVhCh1JzLB6R2tVGej6MmM8eUedTYAtDS", "RJJcPeUCrqvNhRYsArgXpstBTFgfYCSDzv", + "RWVhCh1JzLB6R2tVGej6MmM8eUedTYAtDS", ], "type": "OUT", "value": "658000374", @@ -51404,22 +51404,22 @@ Array [ "RAk2tjcuvj43PD7qQf4iA3tDTPH2DV6h3U", ], "senders": Array [ - "RSLN3e8R5EAxxpQrTo7DnA28GS1vWWdMrg", - "RGNWy7th499k6XiwqEikfNMRQje8DJo844", - "RHHNE9STEUT7i3duUw1eeHBKw2rBgzjBXx", - "RL9A3qSt1sFmN53CFhgmgVfbqNcEQr3vb9", "RLYGtUx7btUCBVZXu7NNYWZ7b8sBAuPrYw", "RSwtr8GTRhb7DaMxLxsHpJtSwKVvgQykMV", - "RWcX7eETAYi5kY6tdnFUnB2Ym91ys8nDS3", - "RSBWKbE9QgpwRMRLXdHoeArJxdwC1T64CH", "RSwtr8GTRhb7DaMxLxsHpJtSwKVvgQykMV", + "RWcX7eETAYi5kY6tdnFUnB2Ym91ys8nDS3", + "RL9A3qSt1sFmN53CFhgmgVfbqNcEQr3vb9", + "RSLN3e8R5EAxxpQrTo7DnA28GS1vWWdMrg", "RY46BXxDRnRLgihFmgJfTfL8KdCTxBfb8y", - "RAL9ALvajDctnaSps5WJqxrtcs7VmkepGP", - "RHdxmxNNMR1x63pEZpYgsdnKrtU2Y1mNCw", - "RUrLYTstF6Lk9sKLe6hmxkqTZxh6z2xVoQ", "RMRDUxS3NK6WmhfCegYDgNxHV9jCf43JsU", - "RPrYigcs1VYujYLX8ZvUTARBhZiU1LwSUR", + "RHdxmxNNMR1x63pEZpYgsdnKrtU2Y1mNCw", + "RGNWy7th499k6XiwqEikfNMRQje8DJo844", "RQjtqfFYe3KTTSCT8STvm9VXSEeGp4uGSR", + "RPrYigcs1VYujYLX8ZvUTARBhZiU1LwSUR", + "RUrLYTstF6Lk9sKLe6hmxkqTZxh6z2xVoQ", + "RHHNE9STEUT7i3duUw1eeHBKw2rBgzjBXx", + "RAL9ALvajDctnaSps5WJqxrtcs7VmkepGP", + "RSBWKbE9QgpwRMRLXdHoeArJxdwC1T64CH", ], "type": "IN", "value": "2513651102", @@ -51454,8 +51454,8 @@ Array [ "RX2Z69ru9Rupds9UJR2SA2UyQEVeEi6uCS", ], "senders": Array [ - "RXqM1qvrfE3ode3rG5zWgUUsmbLp1b7nur", "RG3NVhdczLipGZvCnqfQhgMPwV6T3RwRX8", + "RXqM1qvrfE3ode3rG5zWgUUsmbLp1b7nur", ], "type": "IN", "value": "354228900", @@ -51577,10 +51577,10 @@ Array [ "RLwt3WByFtb3ys6QmPc8i78krC4us4toR2", ], "senders": Array [ - "RUFezg3Y15ETRm6bEnEn3BCxwbVHy6bNtQ", + "RLm3LbyQADa7oD2EUtd5NJJxeVKAjkXbby", "RHMRCjLZVUt5QivbKqpRp6BfvLtnXeih7n", "RPhNPLNReWJdZCESh55oiX1ZpMYDuwdPec", - "RLm3LbyQADa7oD2EUtd5NJJxeVKAjkXbby", + "RUFezg3Y15ETRm6bEnEn3BCxwbVHy6bNtQ", ], "type": "OUT", "value": "100001340", @@ -51649,8 +51649,8 @@ Array [ "RXgZGSvASzxiynSiWfut2aUV9ppJA3MCB9", ], "senders": Array [ - "RMLMRFQBN1xgsLmCUbgfEsRpkEHTFKcKT2", "RGpU9iVqpXxWum6S5Lph1mi3LR7WSmSj9P", + "RMLMRFQBN1xgsLmCUbgfEsRpkEHTFKcKT2", ], "type": "OUT", "value": "665633168", @@ -51668,8 +51668,8 @@ Array [ ], "senders": Array [ "RDf9fBMKGQq4jS2J97SiXEdLYmJNw5Vi8b", - "RYJDkz5m4rcTh9DhpRDdaAuakPCsoQ42hZ", "RJsjsWzwWHCRH2LapH3o9C3nGmX3Waq9x1", + "RYJDkz5m4rcTh9DhpRDdaAuakPCsoQ42hZ", ], "type": "IN", "value": "294864099", @@ -51720,8 +51720,8 @@ Array [ "RG3NVhdczLipGZvCnqfQhgMPwV6T3RwRX8", ], "senders": Array [ - "RPGKRR3iPKHU95NtwvnQSnmQQWBSea1E9V", "RFgaa7eWegjEYg9gJkgvxcQ5FJyCceLMut", + "RPGKRR3iPKHU95NtwvnQSnmQQWBSea1E9V", ], "type": "OUT", "value": "300001122", @@ -51789,10 +51789,10 @@ Array [ "RGzpra2ocm9hhk4MZwXDPgfkpQfkywzdWm", ], "senders": Array [ + "RKb2xHTs9m5Z7mfV9B6CBCXd5rMautbHff", "R9x3jfPUWGVyasxwpbhG5wQJUo2oAJSTiy", "RGEFfDaCWwwnLbs8LBwQHmd5gsrGzpgLoL", "RQF74tgS3fgMge211AGcaHveLAG8PZJPTj", - "RKb2xHTs9m5Z7mfV9B6CBCXd5rMautbHff", "RRnNF15Zwg9HXAqV2bcKn3ekjkXj5G4B4w", ], "type": "OUT", @@ -51861,12 +51861,12 @@ Array [ "RPhNPLNReWJdZCESh55oiX1ZpMYDuwdPec", ], "senders": Array [ - "RGbmHsx1ExgxC3AmyYycBe9Xvdou2j3ERD", + "RNaGmLqLFhW9u7eqLA5D2Tfb4FgpKRvYYo", "RJS2Rg2PE3ChhPKtBiPRskmTJciv3nR9Aa", - "RDHKsbJ8CrZQMDLYACszFGhCEdpw3K2mRW", "RAdQbQFFTV2hpXZB69D5SJQFt175XcZFHk", + "RDHKsbJ8CrZQMDLYACszFGhCEdpw3K2mRW", "RTK83cYisa2G2DxpAuxE78Wd6wWMAKCWuD", - "RNaGmLqLFhW9u7eqLA5D2Tfb4FgpKRvYYo", + "RGbmHsx1ExgxC3AmyYycBe9Xvdou2j3ERD", ], "type": "IN", "value": "74100000", @@ -51917,9 +51917,9 @@ Array [ "RUq8VcnDy1qjzzKcLTP5SR3zP2tWxnixBv", ], "senders": Array [ - "RCtv8ZRjsW53cn6RS8b5iry7XBqiQWuQVD", - "RXQnZrhtDiH77pa8afLDnub6KfjrPRR8gs", "RSATezniZfbmWvf4a8fRvULYkXii7p3PYP", + "RXQnZrhtDiH77pa8afLDnub6KfjrPRR8gs", + "RCtv8ZRjsW53cn6RS8b5iry7XBqiQWuQVD", ], "type": "OUT", "value": "300001044", @@ -51990,8 +51990,8 @@ Array [ "RJJcPeUCrqvNhRYsArgXpstBTFgfYCSDzv", ], "senders": Array [ - "RCA6paLq1zpAVKXA1fhCaVwPoAUXJgX83s", "RUohAyCGt1wWPkpnrUbKem87nWjFTakvmb", + "RCA6paLq1zpAVKXA1fhCaVwPoAUXJgX83s", ], "type": "IN", "value": "400000000", @@ -52217,8 +52217,8 @@ Array [ "RV9wcNWLnAxCf8b2Rpw8mPdAJHWfA4YjY3", ], "senders": Array [ - "RBCc1ZPzP9PWARyR9cdUkaNbhwt2wutvNu", "RUVg5GSg7KjJSgWRDSyZJk8Vtx9UzVL2m9", + "RBCc1ZPzP9PWARyR9cdUkaNbhwt2wutvNu", "RJYYeHQKSeyzm6fF1RF1qoBkAQ1scQ1LRR", ], "type": "IN", @@ -52444,8 +52444,8 @@ Array [ "RGkkBY1Sm5hRcYYNTSjjdJ6szN5pV7PCUC", ], "senders": Array [ - "RWVhCh1JzLB6R2tVGej6MmM8eUedTYAtDS", "RJJcPeUCrqvNhRYsArgXpstBTFgfYCSDzv", + "RWVhCh1JzLB6R2tVGej6MmM8eUedTYAtDS", ], "type": "IN", "value": "658000000", @@ -52515,8 +52515,8 @@ Array [ "RX2Z69ru9Rupds9UJR2SA2UyQEVeEi6uCS", ], "senders": Array [ - "RXqM1qvrfE3ode3rG5zWgUUsmbLp1b7nur", "RG3NVhdczLipGZvCnqfQhgMPwV6T3RwRX8", + "RXqM1qvrfE3ode3rG5zWgUUsmbLp1b7nur", ], "type": "OUT", "value": "354230022", @@ -52742,8 +52742,8 @@ Array [ "RXgZGSvASzxiynSiWfut2aUV9ppJA3MCB9", ], "senders": Array [ - "RMLMRFQBN1xgsLmCUbgfEsRpkEHTFKcKT2", "RGpU9iVqpXxWum6S5Lph1mi3LR7WSmSj9P", + "RMLMRFQBN1xgsLmCUbgfEsRpkEHTFKcKT2", ], "type": "IN", "value": "665632420", @@ -52845,8 +52845,8 @@ Array [ "RG3NVhdczLipGZvCnqfQhgMPwV6T3RwRX8", ], "senders": Array [ - "RPGKRR3iPKHU95NtwvnQSnmQQWBSea1E9V", "RFgaa7eWegjEYg9gJkgvxcQ5FJyCceLMut", + "RPGKRR3iPKHU95NtwvnQSnmQQWBSea1E9V", ], "type": "IN", "value": "300000000", @@ -52880,10 +52880,10 @@ Array [ "RGzpra2ocm9hhk4MZwXDPgfkpQfkywzdWm", ], "senders": Array [ + "RKb2xHTs9m5Z7mfV9B6CBCXd5rMautbHff", "R9x3jfPUWGVyasxwpbhG5wQJUo2oAJSTiy", "RGEFfDaCWwwnLbs8LBwQHmd5gsrGzpgLoL", "RQF74tgS3fgMge211AGcaHveLAG8PZJPTj", - "RKb2xHTs9m5Z7mfV9B6CBCXd5rMautbHff", "RRnNF15Zwg9HXAqV2bcKn3ekjkXj5G4B4w", ], "type": "IN", @@ -53071,9 +53071,9 @@ Array [ "RUq8VcnDy1qjzzKcLTP5SR3zP2tWxnixBv", ], "senders": Array [ - "RCtv8ZRjsW53cn6RS8b5iry7XBqiQWuQVD", - "RXQnZrhtDiH77pa8afLDnub6KfjrPRR8gs", "RSATezniZfbmWvf4a8fRvULYkXii7p3PYP", + "RXQnZrhtDiH77pa8afLDnub6KfjrPRR8gs", + "RCtv8ZRjsW53cn6RS8b5iry7XBqiQWuQVD", ], "type": "IN", "value": "300000000", @@ -53090,14 +53090,14 @@ Array [ "RHve7nnW4ZFgHz9bboyKfFVkL7pQ5rxp4q", ], "senders": Array [ - "RFKpGt3yvf1Kgp9vqrHRzKV8RvdHZYaSFB", + "RCi43iyaY9fRsoLXEFKA3Num2SVtmcwV6X", "RDMc6vAY5ihjPdMJYVdzLymdPztBFhGPE2", + "RFKpGt3yvf1Kgp9vqrHRzKV8RvdHZYaSFB", "RJmbtWXrHtFQFz29f3R66QLW7rDsNYcuWq", "RAjBzAgtHFT3En7FaTbaZ6Acx8XeYdTtGD", - "RCi43iyaY9fRsoLXEFKA3Num2SVtmcwV6X", + "RS4hAHh9ciFwHWpzdXpsq1St2eQNQkG2az", "RNjtQQGgn3SZ4D5QBLVC8fYauox4bmFN6o", "RUq8VcnDy1qjzzKcLTP5SR3zP2tWxnixBv", - "RS4hAHh9ciFwHWpzdXpsq1St2eQNQkG2az", ], "type": "IN", "value": "2450585000", @@ -53114,14 +53114,14 @@ Array [ "RHve7nnW4ZFgHz9bboyKfFVkL7pQ5rxp4q", ], "senders": Array [ - "RFKpGt3yvf1Kgp9vqrHRzKV8RvdHZYaSFB", + "RCi43iyaY9fRsoLXEFKA3Num2SVtmcwV6X", "RDMc6vAY5ihjPdMJYVdzLymdPztBFhGPE2", + "RFKpGt3yvf1Kgp9vqrHRzKV8RvdHZYaSFB", "RJmbtWXrHtFQFz29f3R66QLW7rDsNYcuWq", "RAjBzAgtHFT3En7FaTbaZ6Acx8XeYdTtGD", - "RCi43iyaY9fRsoLXEFKA3Num2SVtmcwV6X", + "RS4hAHh9ciFwHWpzdXpsq1St2eQNQkG2az", "RNjtQQGgn3SZ4D5QBLVC8fYauox4bmFN6o", "RUq8VcnDy1qjzzKcLTP5SR3zP2tWxnixBv", - "RS4hAHh9ciFwHWpzdXpsq1St2eQNQkG2az", ], "type": "OUT", "value": "2450588294", @@ -53172,8 +53172,8 @@ Array [ "RJJcPeUCrqvNhRYsArgXpstBTFgfYCSDzv", ], "senders": Array [ - "RCA6paLq1zpAVKXA1fhCaVwPoAUXJgX83s", "RUohAyCGt1wWPkpnrUbKem87nWjFTakvmb", + "RCA6paLq1zpAVKXA1fhCaVwPoAUXJgX83s", ], "type": "OUT", "value": "400001122", @@ -53281,12 +53281,12 @@ Array [ "RTvAn5VZoyG6mKCRaM79yMBbS3tSTfoxqd", ], "senders": Array [ - "RHnd78KCFWtKx8w1yYLGksh8jmYdUF4PpD", - "RNapVgVAN3p9jidrEdqZiYb8aLTpQUfjR6", "RAsAgiVzseCmyBPQponJKtVdxxb3Di5jiZ", "RUDGPKrAzsLt9tMFrppo5gdZDA7wTW7HsY", + "RHnd78KCFWtKx8w1yYLGksh8jmYdUF4PpD", "RFB7G524miPGi6fAG43FGLy84DhtEBqmuG", "RK7qVmRQdEtZFsnm6Py7BdZuGYpZu8q4zK", + "RNapVgVAN3p9jidrEdqZiYb8aLTpQUfjR6", ], "type": "OUT", "value": "2117128318", @@ -53408,22 +53408,22 @@ Array [ "RPUb5G4iGWhJy6TEzwhntA4qoyJSmXjSak", ], "senders": Array [ - "RPL2Ws9tYcSmTZ7fCfZnybGZrFnrjfHY5W", - "RUHd4GPvw4j6MSitJNC1bJjdpEA7tiFGC6", + "RJefAEr1mDREUPcw4uAR8m9pQHHthvVF5V", "RC7fCw4b7F4h3uDuYMMBvx8HE8ubwVuZMc", + "RU6LhQVXErq5vxdbm5ubnJnr236C1b9wFn", + "RTSyLffZtjPKZ1PLv6Dz7Sb2rWP8MHZbYA", + "RPL2Ws9tYcSmTZ7fCfZnybGZrFnrjfHY5W", "RDqp2hjeDt1YJXvB1c8udT8o3qJz25T89F", - "RJefAEr1mDREUPcw4uAR8m9pQHHthvVF5V", - "RPceGQQsZvvTzButAx1tZ9g8kM6eWdkVhg", "RHYxa3xWSPULd8deeYak1emQ9G61v3cBUy", - "RTSyLffZtjPKZ1PLv6Dz7Sb2rWP8MHZbYA", - "RU6LhQVXErq5vxdbm5ubnJnr236C1b9wFn", - "RHQeF3BUrN1ub5PqdQhWTAbJB2pv7xukML", - "RKSuhHTzgmc5gnFDCdSJt3U8HWeNYnPuK6", + "RFepmqmpXL5dFBJYSFoncN2Fphn2KiFH2S", + "RUHd4GPvw4j6MSitJNC1bJjdpEA7tiFGC6", + "RPceGQQsZvvTzButAx1tZ9g8kM6eWdkVhg", "RJXH5iiDG9GGP3uFN4y9nZznWm4H7WRpZr", + "RNBip2PqrD9xhkoK613VptMqjfS1Sdwa2p", "RQeZqrkJuGpv3nCF3QriSUt7b7zRaE2WDj", - "RFepmqmpXL5dFBJYSFoncN2Fphn2KiFH2S", "RQeZqrkJuGpv3nCF3QriSUt7b7zRaE2WDj", - "RNBip2PqrD9xhkoK613VptMqjfS1Sdwa2p", + "RHQeF3BUrN1ub5PqdQhWTAbJB2pv7xukML", + "RKSuhHTzgmc5gnFDCdSJt3U8HWeNYnPuK6", "RRmshus5KvRKRY1oT56imffSFuxPUPS7s1", ], "type": "OUT", @@ -53509,8 +53509,8 @@ Array [ "RV9wcNWLnAxCf8b2Rpw8mPdAJHWfA4YjY3", ], "senders": Array [ - "RBCc1ZPzP9PWARyR9cdUkaNbhwt2wutvNu", "RUVg5GSg7KjJSgWRDSyZJk8Vtx9UzVL2m9", + "RBCc1ZPzP9PWARyR9cdUkaNbhwt2wutvNu", "RJYYeHQKSeyzm6fF1RF1qoBkAQ1scQ1LRR", ], "type": "OUT", @@ -53598,12 +53598,12 @@ Array [ "RUFezg3Y15ETRm6bEnEn3BCxwbVHy6bNtQ", ], "senders": Array [ + "RH5evC49ptzuXtejGCRKnEAmvMDBpht93B", + "RL56vZfA7ZEK5y8NVvg2mhmnEAsnCxhdWX", + "RK8876U89usNdEQ9Rrf3y5WbzaWSNejAUg", "RShN4KVXxJRPMtTtEH5FrnP8PyZzbiDrF1", "RGpavZ4T1w7UQaQk7EguLDjCCN72t2TAHZ", "RPpRK88iPS74bggXhqkrat2fSMfNpTJRZB", - "RL56vZfA7ZEK5y8NVvg2mhmnEAsnCxhdWX", - "RK8876U89usNdEQ9Rrf3y5WbzaWSNejAUg", - "RH5evC49ptzuXtejGCRKnEAmvMDBpht93B", ], "type": "OUT", "value": "152827411", @@ -53739,10 +53739,10 @@ Array [ "RLwt3WByFtb3ys6QmPc8i78krC4us4toR2", ], "senders": Array [ - "RUFezg3Y15ETRm6bEnEn3BCxwbVHy6bNtQ", + "RLm3LbyQADa7oD2EUtd5NJJxeVKAjkXbby", "RHMRCjLZVUt5QivbKqpRp6BfvLtnXeih7n", "RPhNPLNReWJdZCESh55oiX1ZpMYDuwdPec", - "RLm3LbyQADa7oD2EUtd5NJJxeVKAjkXbby", + "RUFezg3Y15ETRm6bEnEn3BCxwbVHy6bNtQ", ], "type": "IN", "value": "100000000", @@ -53998,12 +53998,12 @@ Array [ "RPhNPLNReWJdZCESh55oiX1ZpMYDuwdPec", ], "senders": Array [ - "RGbmHsx1ExgxC3AmyYycBe9Xvdou2j3ERD", + "RNaGmLqLFhW9u7eqLA5D2Tfb4FgpKRvYYo", "RJS2Rg2PE3ChhPKtBiPRskmTJciv3nR9Aa", - "RDHKsbJ8CrZQMDLYACszFGhCEdpw3K2mRW", "RAdQbQFFTV2hpXZB69D5SJQFt175XcZFHk", + "RDHKsbJ8CrZQMDLYACszFGhCEdpw3K2mRW", "RTK83cYisa2G2DxpAuxE78Wd6wWMAKCWuD", - "RNaGmLqLFhW9u7eqLA5D2Tfb4FgpKRvYYo", + "RGbmHsx1ExgxC3AmyYycBe9Xvdou2j3ERD", ], "type": "OUT", "value": "74101932", diff --git a/src/__tests__/accounts/importAccounts.js b/src/__tests__/accounts/importAccounts.js index 732618cbd9..b5a665ed25 100644 --- a/src/__tests__/accounts/importAccounts.js +++ b/src/__tests__/accounts/importAccounts.js @@ -6,6 +6,9 @@ import { fromAccountRaw, } from "../../account"; import { setSupportedCurrencies } from "../../currencies"; +import { setPlatformVersion } from "../../platform/version"; + +setPlatformVersion("0.0.1"); setSupportedCurrencies(["ethereum"]); diff --git a/src/__tests__/test-helpers/setup.js b/src/__tests__/test-helpers/setup.js index 6dbac777d5..3f26e17631 100644 --- a/src/__tests__/test-helpers/setup.js +++ b/src/__tests__/test-helpers/setup.js @@ -1,7 +1,10 @@ import { setSupportedCurrencies } from "../../currencies"; +import { setPlatformVersion } from "../../platform/version"; jest.setTimeout(180000); +setPlatformVersion("0.0.1"); + setSupportedCurrencies([ "bitcoin", "ethereum", diff --git a/src/account/ordering.js b/src/account/ordering.js index e4373100d2..1e4aad9392 100644 --- a/src/account/ordering.js +++ b/src/account/ordering.js @@ -35,7 +35,10 @@ export const sortAccountsComparatorFromOrder = ( const ascValue = sort === "desc" ? -1 : 1; if (order === "name") { return (a, b) => - ascValue * sortNameLense(a).localeCompare(sortNameLense(b)); + ascValue * + sortNameLense(a).localeCompare(sortNameLense(b), undefined, { + numeric: true, + }); } const cvCaches = {}; const lazyCalcCV = (a) => { diff --git a/src/account/serialization.js b/src/account/serialization.js index 907fbc5d4f..edbfdf5ea3 100644 --- a/src/account/serialization.js +++ b/src/account/serialization.js @@ -757,6 +757,10 @@ export function fromAccountRaw(rawAccount: AccountRaw): Account { res.elrondResources = fromElrondResourcesRaw(elrondResources); } + if (cryptoOrgResources) { + res.cryptoOrgResources = fromCryptoOrgResourcesRaw(cryptoOrgResources); + } + return res; } diff --git a/src/api/explorerConfig/index.js b/src/api/explorerConfig/index.js index 5ebae4a8bf..6c4cdefe9d 100644 --- a/src/api/explorerConfig/index.js +++ b/src/api/explorerConfig/index.js @@ -98,10 +98,12 @@ const initialExplorerConfig: FullConfig = { base: "EXPLORER", version: "v2", }, + /* experimental: { base: "EXPLORER", version: "v3", }, + */ }, litecoin: { id: "ltc", diff --git a/src/apps/filtering.test.js b/src/apps/filtering.test.js index 3eebfeedf7..1caf53ffe8 100644 --- a/src/apps/filtering.test.js +++ b/src/apps/filtering.test.js @@ -5,6 +5,9 @@ import { deviceInfo155, mockListAppsResult } from "./mock"; import type { FilterOptions, SortOptions } from "./filtering"; import { sortFilterApps } from "./filtering"; import { setSupportedCurrencies } from "../currencies/support"; +import { setPlatformVersion } from "../platform/version"; + +setPlatformVersion("0.0.1"); type FilteringScenario = { name: string, diff --git a/src/apps/hw.js b/src/apps/hw.js index 86caabb095..d647dd6f06 100644 --- a/src/apps/hw.js +++ b/src/apps/hw.js @@ -1,7 +1,8 @@ // @flow import Transport from "@ledgerhq/hw-transport"; -import { getDeviceModel } from "@ledgerhq/devices"; +// $FlowExpectedError Caused by TS migration, flow def support stopped at v5. +import { getDeviceModel, identifyTargetId } from "@ledgerhq/devices"; import { UnexpectedBootloader } from "@ledgerhq/errors"; import { concat, of, empty, from, Observable, throwError, defer } from "rxjs"; import { mergeMap, map } from "rxjs/operators"; @@ -118,7 +119,9 @@ export const listApps = ( const deviceModelId = // $FlowFixMe - (transport.deviceModel && transport.deviceModel.id) || "nanoS"; + (transport.deviceModel && transport.deviceModel.id) || + (deviceInfo && identifyTargetId(deviceInfo.targetId))?.id || + getEnv("DEVICE_PROXY_MODEL"); return Observable.create((o) => { let sub; diff --git a/src/apps/support.js b/src/apps/support.js index 1752b3d896..8ad84d0d1b 100644 --- a/src/apps/support.js +++ b/src/apps/support.js @@ -27,7 +27,7 @@ export function shouldUpgrade( const appVersionsRequired = { Cosmos: ">= 2.14", Algorand: ">= 1.2.9", - Polkadot: ">= 7.30.0", + Polkadot: ">= 7.9050.0", }; export function mustUpgrade( diff --git a/src/bridge/mockHelpers.js b/src/bridge/mockHelpers.js index a5064e9230..ec2e284c76 100644 --- a/src/bridge/mockHelpers.js +++ b/src/bridge/mockHelpers.js @@ -40,7 +40,7 @@ export const sync: $PropertyType, "sync"> = (initialAccount) => const nextAcc = { ...acc, - blockHeight: acc.blockHeight + 1, + blockHeight: acc.blockHeight + 1000, // make a sync move a lot by blockHeight to avoid flawky tests issue on op confirm. lastSyncDate: new Date(), operations: ops.concat(acc.operations.slice(0)), pendingOperations: [], @@ -59,7 +59,7 @@ export const sync: $PropertyType, "sync"> = (initialAccount) => o.complete(); }; - syncTimeouts[accountId] = setTimeout(sync, 2000); + syncTimeouts[accountId] = setTimeout(sync, 500); return () => { clearTimeout(syncTimeouts[accountId]); diff --git a/src/currencies/__snapshots__/sortByMarketcap.test.js.snap b/src/currencies/__snapshots__/sortByMarketcap.test.js.snap index 13fc1e6cab..d789df668a 100644 --- a/src/currencies/__snapshots__/sortByMarketcap.test.js.snap +++ b/src/currencies/__snapshots__/sortByMarketcap.test.js.snap @@ -345,6 +345,7 @@ Array [ "ethereum/erc20/covesting", "ethereum/erc20/bcpt", "ethereum/erc20/lympo_", + "ethereum/erc20/newscrypto", "ethereum/erc20/spendcoin", "ethereum/erc20/napoleonx", "ethereum/erc20/oneledger_token", @@ -894,6 +895,7 @@ Array [ "ethereum/erc20/300_token_sparta", "ethereum/erc20/300fit_network", "ethereum/erc20/420doge", + "ethereum/erc20/4artcoin", "ethereum/erc20/808ta", "ethereum/erc20/88mph.app", "ethereum/erc20/8x8_protocol", @@ -989,6 +991,7 @@ Array [ "ethereum/erc20/apot", "ethereum/erc20/apwine_token", "ethereum/erc20/apyswap", + "ethereum/erc20/ara_token", "ethereum/erc20/aragon_network_juror", "ethereum/erc20/arbi_token", "ethereum/erc20/arc_stablex", @@ -1024,6 +1027,7 @@ Array [ "ethereum/erc20/aurusgold", "ethereum/erc20/aurusplatinum", "ethereum/erc20/aurussilver", + "ethereum/erc20/automata", "ethereum/erc20/autonio", "ethereum/erc20/autonio_old", "ethereum/erc20/ava", @@ -1159,6 +1163,7 @@ Array [ "ethereum/erc20/bytether", "ethereum/erc20/bzx_protocol_token", "ethereum/erc20/bzx_vesting_token", + "ethereum/erc20/bzz", "ethereum/erc20/cacaoshares", "ethereum/erc20/calvin", "ethereum/erc20/cami", @@ -1205,6 +1210,7 @@ Array [ "ethereum/erc20/coal_coin", "ethereum/erc20/cocostoken_old", "ethereum/erc20/cofi_token", + "ethereum/erc20/coin", "ethereum/erc20/coin_artist", "ethereum/erc20/coin_utility_token", "ethereum/erc20/coincrowd", @@ -1279,6 +1285,7 @@ Array [ "ethereum/erc20/cudostoken", "ethereum/erc20/curate", "ethereum/erc20/current", + "ethereum/erc20/curryswap", "ethereum/erc20/curve.fi", "ethereum/erc20/curve_dao_token", "ethereum/erc20/curve_fi_usdk_3crv", @@ -1487,6 +1494,7 @@ Array [ "ethereum/erc20/fidelium_token", "ethereum/erc20/filmscoin", "ethereum/erc20/finance.vote_token", + "ethereum/erc20/finbet", "ethereum/erc20/fingerprint", "ethereum/erc20/finnexus", "ethereum/erc20/finxflo", @@ -1904,6 +1912,7 @@ Array [ "ethereum/erc20/pantheon_x", "ethereum/erc20/par_stablecoin", "ethereum/erc20/paralink_network", + "ethereum/erc20/parallelchain_token", "ethereum/erc20/pareto", "ethereum/erc20/parsec_finance", "ethereum/erc20/parsiq_token_", @@ -1974,6 +1983,7 @@ Array [ "ethereum/erc20/pour_coin", "ethereum/erc20/pow_btc-35wt", "ethereum/erc20/pow_eth-1.8wm", + "ethereum/erc20/power", "ethereum/erc20/power_index_pool_token", "ethereum/erc20/powertrade_fuel_token", "ethereum/erc20/premia", @@ -2083,6 +2093,7 @@ Array [ "ethereum/erc20/serum", "ethereum/erc20/sgelder", "ethereum/erc20/sgpay", + "ethereum/erc20/shadowbit", "ethereum/erc20/shadows_network", "ethereum/erc20/shaka", "ethereum/erc20/shard", @@ -2115,6 +2126,7 @@ Array [ "ethereum/erc20/skull", "ethereum/erc20/skymap_token", "ethereum/erc20/smart_advertising_transaction_token", + "ethereum/erc20/smartcredit_token", "ethereum/erc20/smartkey", "ethereum/erc20/smartmesh", "ethereum/erc20/smartrealty", @@ -2214,6 +2226,7 @@ Array [ "ethereum/erc20/taklimakan_network", "ethereum/erc20/talao", "ethereum/erc20/tangguotao_token", + "ethereum/erc20/tapcoin", "ethereum/erc20/tapmydata", "ethereum/erc20/target_coin", "ethereum/erc20/tatatu", @@ -2514,5 +2527,6 @@ Array [ "algorand/asa/438831", "algorand/asa/438828", "algorand/asa/163650", + "algorand/asa/137594422", ] `; diff --git a/src/data/flags/svg/FR.svg b/src/data/flags/svg/FR.svg new file mode 100644 index 0000000000..c64f9bec2e --- /dev/null +++ b/src/data/flags/svg/FR.svg @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/data/flags/svg/JP.svg b/src/data/flags/svg/JP.svg new file mode 100644 index 0000000000..1ceff6892a --- /dev/null +++ b/src/data/flags/svg/JP.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/data/flags/svg/US.svg b/src/data/flags/svg/US.svg new file mode 100644 index 0000000000..d7d6864d3e --- /dev/null +++ b/src/data/flags/svg/US.svg @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/env.js b/src/env.js index 03dea68721..1e2dbe5796 100644 --- a/src/env.js +++ b/src/env.js @@ -150,6 +150,26 @@ const envDefinitions = { desc: "gasLimit * gasPrice to determine the fees price. A too low GAS_PRICE will get rejected before the transaction is broadcast", }, + CRYPTO_ORG_INDEXER: { + def: "https://crypto.org/explorer", + parser: stringParser, + desc: "location of the crypto.org indexer API", + }, + CRYPTO_ORG_TESTNET_INDEXER: { + def: "https://crypto.org/explorer/croeseid3", + parser: stringParser, + desc: "location of the crypto.org indexer testnet API", + }, + CRYPTO_ORG_RPC_URL: { + def: "", + parser: stringParser, + desc: "location of the crypto.org indexer API", + }, + CRYPTO_ORG_TESTNET_RPC_URL: { + def: "https://testnet-croeseid-3.crypto.org:26657", + parser: stringParser, + desc: "location of the crypto.org chain testnet node", + }, DEBUG_UTXO_DISPLAY: { def: 4, parser: intParser, @@ -171,6 +191,11 @@ const envDefinitions = { parser: stringParser, desc: "enable a proxy to use instead of a physical device", }, + DEVICE_PROXY_MODEL: { + def: "nanoS", + parser: stringParser, + desc: "allow to override the default model of a proxied device", + }, DISABLE_TRANSACTION_BROADCAST: { def: false, parser: boolParser, @@ -457,6 +482,21 @@ const envDefinitions = { parser: intParser, desc: "version used for ledger status api", }, + PLATFORM_DEBUG: { + def: false, + parser: boolParser, + desc: "enable visibility of debug apps and tools in Platform Catalog", + }, + PLATFORM_API_URL: { + def: "", + parser: stringParser, + desc: "url used to fetch platform catalog", + }, + PLATFORM_API_VERSION: { + def: 1, + parser: intParser, + desc: "version used for the platform api", + }, }; const getDefinition = (name: string): ?EnvDef => envDefinitions[name]; diff --git a/src/errors.js b/src/errors.js index f0da5ccd61..c273f12457 100644 --- a/src/errors.js +++ b/src/errors.js @@ -14,6 +14,10 @@ export const GetAppAndVersionUnsupportedFormat = createCustomErrorClass( "GetAppAndVersionUnsupportedFormat" ); +export const LatestFirmwareVersionRequired = createCustomErrorClass( + "LatestFirmwareVersionRequired" +); + export const FeeEstimationFailed = createCustomErrorClass( "FeeEstimationFailed" ); @@ -175,12 +179,50 @@ export const SwapExchangeRateAmountTooHigh = createCustomErrorClass( "SwapExchangeRateAmountTooHigh" ); +export const SwapCheckKYCStatusFailed = createCustomErrorClass( + "SwapCheckKYCStatusFailed" +); + +export const SwapSubmitKYCFailed = createCustomErrorClass( + "SwapSubmitKYCFailed" +); + export const SwapUnknownSwapId = createCustomErrorClass("SwapUnknownSwapId"); export const SwapGenericAPIError = createCustomErrorClass( "SwapGenericAPIError" ); +export const JSONRPCResponseError = createCustomErrorClass( + "JSONRPCResponseError" +); +export const JSONDecodeError = createCustomErrorClass("JSONDecodeError"); +export const NoIPHeaderError = createCustomErrorClass("NoIPHeaderError"); +export const CurrencyNotSupportedError = createCustomErrorClass( + "CurrencyNotSupportedError" +); +export const CurrencyDisabledError = createCustomErrorClass( + "CurrencyDisabledError" +); +export const CurrencyDisabledAsInputError = createCustomErrorClass( + "CurrencyDisabledAsInputError" +); +export const CurrencyDisabledAsOutputError = createCustomErrorClass( + "CurrencyDisabledAsOutputError" +); +export const CurrencyNotSupportedByProviderError = createCustomErrorClass( + "CurrencyNotSupportedByProviderError" +); +export const TradeMethodNotSupportedError = createCustomErrorClass( + "TradeMethodNotSupportedError" +); +export const UnexpectedError = createCustomErrorClass("UnexpectedError"); +export const NotImplementedError = createCustomErrorClass( + "NotImplementedError" +); +export const ValidationError = createCustomErrorClass("ValidationError"); +export const AccessDeniedError = createCustomErrorClass("AccessDeniedError"); + export const AlgorandASANotOptInInRecipient = createCustomErrorClass( "AlgorandASANotOptInInRecipient" ); diff --git a/src/exchange/swap/getExchangeRates.js b/src/exchange/swap/getExchangeRates.js index 3c402c8c42..e6247c5aa2 100644 --- a/src/exchange/swap/getExchangeRates.js +++ b/src/exchange/swap/getExchangeRates.js @@ -3,10 +3,11 @@ import type { Exchange, GetExchangeRates } from "./types"; import type { Transaction } from "../../types"; import { getAccountCurrency, getAccountUnit } from "../../account"; +import type { Unit } from "../../types"; import { formatCurrencyUnit } from "../../currencies"; import { mockGetExchangeRates } from "./mock"; import network from "../../network"; -import { getSwapAPIBaseURL } from "./"; +import { getSwapAPIError, getSwapAPIBaseURL } from "./"; import { getEnv } from "../../env"; import { BigNumber } from "bignumber.js"; import { @@ -16,10 +17,13 @@ import { const getExchangeRates: GetExchangeRates = async ( exchange: Exchange, - transaction: Transaction + transaction: Transaction, + userId?: string // TODO remove when wyre doesn't require this for rates ) => { if (getEnv("MOCK")) return mockGetExchangeRates(exchange, transaction); + // Rely on the api base to determine the version logic + const usesV3 = getSwapAPIBaseURL().endsWith("v3"); const from = getAccountCurrency(exchange.fromAccount).id; const unitFrom = getAccountUnit(exchange.fromAccount); const unitTo = getAccountUnit(exchange.toAccount); @@ -27,90 +31,130 @@ const getExchangeRates: GetExchangeRates = async ( const amountFrom = transaction.amount; const tenPowMagnitude = BigNumber(10).pow(unitFrom.magnitude); const apiAmount = BigNumber(amountFrom).div(tenPowMagnitude); - + const request = { + from, + to, + amountFrom: apiAmount.toString(), + }; const res = await network({ method: "POST", url: `${getSwapAPIBaseURL()}/rate`, - data: [ - { - from, - to, - amountFrom: apiAmount.toString(), - }, - ], + headers: { + ...(userId ? { userId } : {}), + }, + data: usesV3 ? request : [request], }); - return res.data.map( - ({ + return res.data.map((responseData) => { + const { rate: maybeRate, payoutNetworkFees: maybePayoutNetworkFees, rateId, provider, amountFrom, amountTo, - minAmountFrom, - maxAmountFrom, tradeMethod, - }) => { - let error; - let magnitudeAwareRate; - - if (!amountFrom) { - const isTooSmall = BigNumber(apiAmount).lte(minAmountFrom); - - error = isTooSmall - ? new SwapExchangeRateAmountTooLow(null, { - minAmountFromFormatted: formatCurrencyUnit( - unitFrom, - BigNumber(minAmountFrom).times(tenPowMagnitude), - { - alwaysShowSign: false, - disableRounding: true, - showCode: true, - } - ), - }) - : new SwapExchangeRateAmountTooHigh(null, { - maxAmountFromFormatted: formatCurrencyUnit( - unitFrom, - BigNumber(maxAmountFrom).times(tenPowMagnitude), - { - alwaysShowSign: false, - disableRounding: true, - showCode: true, - } - ), - }); - } else { - // NB Allows us to simply multiply satoshi values from/to - magnitudeAwareRate = (tradeMethod === "fixed" - ? BigNumber(maybeRate) - : BigNumber(amountTo).div(amountFrom) - ).div(BigNumber(10).pow(unitFrom.magnitude - unitTo.magnitude)); - } - - const payoutNetworkFees = BigNumber(maybePayoutNetworkFees || 0).times( - BigNumber(10).pow(unitTo.magnitude) - ); - - const toAmount = BigNumber(amountTo) - .times(BigNumber(10).pow(unitTo.magnitude)) - .minus(payoutNetworkFees); // Nb no longer need to break it down on UI - - const rate = maybeRate || BigNumber(amountTo).div(BigNumber(amountFrom)); + } = responseData; + const error = inferError(apiAmount, unitFrom, responseData); + if (error) { return { - magnitudeAwareRate, provider, tradeMethod, - toAmount, - rate, - rateId, - payoutNetworkFees, error, }; } - ); + + // NB Allows us to simply multiply satoshi values from/to + const magnitudeAwareRate = (tradeMethod === "fixed" + ? BigNumber(maybeRate) + : BigNumber(amountTo).div(amountFrom) + ).div(BigNumber(10).pow(unitFrom.magnitude - unitTo.magnitude)); + + const payoutNetworkFees = BigNumber(maybePayoutNetworkFees || 0).times( + BigNumber(10).pow(unitTo.magnitude) + ); + + const toAmount = BigNumber(amountTo) + .times(BigNumber(10).pow(unitTo.magnitude)) + .minus(payoutNetworkFees); // Nb no longer need to break it down on UI + + const rate = maybeRate || BigNumber(amountTo).div(BigNumber(amountFrom)); + + const out = { + magnitudeAwareRate, + provider, + rate, + rateId, + toAmount, + tradeMethod, + }; + + if (tradeMethod === "fixed") { + return { ...out, rateId }; + } else { + return { + ...out, + payoutNetworkFees, + }; + } + }); +}; + +const inferError = ( + apiAmount: BigNumber, + unitFrom: Unit, + responseData: { + amountTo: string, + minAmountFrom: string, + maxAmountFrom: string, + errorCode?: number, + errorMessage?: string, + } +): ?Error => { + const tenPowMagnitude = BigNumber(10).pow(unitFrom.magnitude); + const { + amountTo, + minAmountFrom, + maxAmountFrom, + errorCode, + errorMessage, + } = responseData; + + if (!amountTo) { + // We are in an error case regardless of api version. + if (errorCode) { + return getSwapAPIError(errorCode, errorMessage); + } + + // For out of range errors we will have a min/max pairing + if (minAmountFrom) { + const isTooSmall = BigNumber(apiAmount).lte(minAmountFrom); + + const MinOrMaxError = isTooSmall + ? SwapExchangeRateAmountTooLow + : SwapExchangeRateAmountTooHigh; + + const key: string = isTooSmall + ? "minAmountFromFormatted" + : "maxAmountFromFormatted"; + + const amount = isTooSmall ? minAmountFrom : maxAmountFrom; + + return new MinOrMaxError(null, { + [key]: formatCurrencyUnit( + unitFrom, + BigNumber(amount).times(tenPowMagnitude), + { + alwaysShowSign: false, + disableRounding: true, + showCode: true, + } + ), + }); + } + } + return; }; export default getExchangeRates; diff --git a/src/exchange/swap/getKYCStatus.js b/src/exchange/swap/getKYCStatus.js new file mode 100644 index 0000000000..479b93ce70 --- /dev/null +++ b/src/exchange/swap/getKYCStatus.js @@ -0,0 +1,31 @@ +// @flow + +import network from "../../network"; +import { getSwapAPIBaseURL } from "./"; +import type { GetKYCStatus } from "./types"; +import { SwapCheckKYCStatusFailed } from "../../errors"; + +export const getKYCStatus: GetKYCStatus = async ( + provider: string, + id: string +) => { + //if (getEnv("MOCK")) return mockGetKYCStatus(id); // TODO implement + + const res = await network({ + method: "GET", + url: `${getSwapAPIBaseURL()}/provider/${provider}/user/${id}`, + }); + + if (!res.data?.status) { + return new SwapCheckKYCStatusFailed(id); + } + + const { status } = res.data; + + return { + id, + status, + }; +}; + +export default getKYCStatus; diff --git a/src/exchange/swap/index.js b/src/exchange/swap/index.js index fbf62b10d2..cabaa27c7c 100644 --- a/src/exchange/swap/index.js +++ b/src/exchange/swap/index.js @@ -5,18 +5,40 @@ import getExchangeRates from "./getExchangeRates"; import getStatus from "./getStatus"; import getProviders from "./getProviders"; import getCompleteSwapHistory from "./getCompleteSwapHistory"; +import getKYCStatus from "./getKYCStatus"; +import submitKYC from "./submitKYC"; import initSwap from "./initSwap"; import { getEnv } from "../../env"; +import { + JSONRPCResponseError, + JSONDecodeError, + NoIPHeaderError, + CurrencyNotSupportedError, + CurrencyDisabledError, + CurrencyDisabledAsInputError, + CurrencyDisabledAsOutputError, + CurrencyNotSupportedByProviderError, + TradeMethodNotSupportedError, + UnexpectedError, + NotImplementedError, + ValidationError, + AccessDeniedError, +} from "../../errors"; export const operationStatusList = { finishedOK: ["finished"], - finishedKO: ["expired", "refunded"], - pending: ["pending", "onhold"], + finishedKO: ["refunded"], + pending: ["pending", "onhold", "expired"], }; const getSwapAPIBaseURL: () => string = () => getEnv("SWAP_API_BASE"); const swapProviders: { - [string]: { nameAndPubkey: Buffer, signature: Buffer, curve: string }, + [string]: { + nameAndPubkey: Buffer, + signature: Buffer, + curve: string, + needsKYC: boolean, + }, } = { changelly: { nameAndPubkey: Buffer.from( @@ -28,6 +50,19 @@ const swapProviders: { "hex" ), curve: "secpk256k1", + needsKYC: false, + }, + wyre: { + nameAndPubkey: Buffer.from( + "045779726504AD01A6241929A5EC331046868FBACB424696FD7C8A4D824FEE61268374E9F4F87FFC5301F0E0A84CEA69FFED46E14C771F9CA1EEA345F6531994291C816E8AE6", + "hex" + ), + signature: Buffer.from( + "304402207b49e46d458a55daee9bc8ed96e1b404c2d99dbbc3d3c3c15430026eb7e01a05022011ab86db08a4c956874a83f23d918319a073fdd9df23a1c7eed8a0a22c98b1e3", + "hex" + ), + curve: "secpk256k1", + needsKYC: true, }, }; @@ -41,6 +76,86 @@ const getProviderNameAndSignature = ( return res; }; +const USStates = { + AL: "Alabama", + AK: "Alaska", + AZ: "Arizona", + AR: "Arkansas", + CA: "California", + CO: "Colorado", + CT: "Connecticut", + DE: "Delaware", + DC: "District Of Columbia", + FL: "Florida", + GA: "Georgia", + HI: "Hawaii", + ID: "Idaho", + IL: "Illinois", + IN: "Indiana", + IA: "Iowa", + KS: "Kansas", + KY: "Kentucky", + LA: "Louisiana", + ME: "Maine", + MD: "Maryland", + MA: "Massachusetts", + MI: "Michigan", + MN: "Minnesota", + MS: "Mississippi", + MO: "Missouri", + MT: "Montana", + NE: "Nebraska", + NV: "Nevada", + NH: "New Hampshire", + NJ: "New Jersey", + NM: "New Mexico", + NY: "New York", + NC: "North Carolina", + ND: "North Dakota", + OH: "Ohio", + OK: "Oklahoma", + OR: "Oregon", + PA: "Pennsylvania", + RI: "Rhode Island", + SC: "South Carolina", + SD: "South Dakota", + TN: "Tennessee", + TX: "Texas", + UT: "Utah", + VT: "Vermont", + VA: "Virginia", + WA: "Washington", + WV: "West Virginia", + WI: "Wisconsin", + WY: "Wyoming", +}; + +const countries = { + US: "United States", +}; + +const swapBackendErrorCodes = { + "100": JSONRPCResponseError, + "101": JSONDecodeError, + "200": NoIPHeaderError, + "300": CurrencyNotSupportedError, + "301": CurrencyDisabledError, + "302": CurrencyDisabledAsInputError, + "303": CurrencyDisabledAsOutputError, + "304": CurrencyNotSupportedByProviderError, + "400": TradeMethodNotSupportedError, + "500": UnexpectedError, + "600": NotImplementedError, + "700": ValidationError, + "701": AccessDeniedError, +}; + +export const getSwapAPIError = (errorCode: number, errorMessage?: string) => { + if (errorCode in swapBackendErrorCodes) + return new swapBackendErrorCodes[errorCode](errorMessage); + return new Error(errorMessage); +}; + export { getSwapAPIBaseURL, getProviderNameAndSignature, @@ -49,4 +164,8 @@ export { getExchangeRates, getCompleteSwapHistory, initSwap, + getKYCStatus, + submitKYC, + USStates, + countries, }; diff --git a/src/exchange/swap/initSwap.js b/src/exchange/swap/initSwap.js index 0bd80a334a..ad9b88dbd8 100644 --- a/src/exchange/swap/initSwap.js +++ b/src/exchange/swap/initSwap.js @@ -36,7 +36,7 @@ const withDevicePromise = (deviceId, fn) => // throw if TransactionStatus have errors // you get at the end a final Transaction to be done (it's not yet signed, nor broadcasted!) and a swapId const initSwap = (input: InitSwapInput): Observable => { - let { exchange, exchangeRate, transaction, deviceId } = input; + let { exchange, exchangeRate, transaction, deviceId, userId } = input; if (getEnv("MOCK")) return mockInitSwap(exchange, exchangeRate, transaction); return Observable.create((o) => { let unsubscribed = false; @@ -84,6 +84,7 @@ const initSwap = (input: InitSwapInput): Observable => { url: `${getSwapAPIBaseURL()}/swap`, headers: { EquipmentId: getEnv("USER_ID"), + ...(userId ? { userId } : {}), }, data: { provider, diff --git a/src/exchange/swap/logic.js b/src/exchange/swap/logic.js index ccb7aec953..e3408a5a95 100644 --- a/src/exchange/swap/logic.js +++ b/src/exchange/swap/logic.js @@ -1,6 +1,6 @@ // @flow -import type { SwapState, TradeMethod } from "./types"; +import type { SwapState, TradeMethod, AvailableProviderV3 } from "./types"; import { isExchangeSupportedByApp } from "../"; import type { AccountLike, TokenCurrency, CryptoCurrency } from "../../types"; import type { InstalledItem } from "../../apps"; @@ -8,8 +8,25 @@ import { flattenAccounts, getAccountCurrency } from "../../account"; export type CurrencyStatus = $Keys; export type CurrenciesStatus = { [string]: CurrencyStatus }; import uniq from "lodash/uniq"; +import invariant from "invariant"; +import { findCryptoCurrencyById, findTokenById } from "@ledgerhq/cryptoassets"; +import { isCurrencyExchangeSupported } from "../"; +import { isCurrencySupported } from "../../currencies"; const validCurrencyStatus = { ok: 1, noApp: 1, noAccounts: 1, outdatedApp: 1 }; + +export const getSwapSelectableCurrencies = ( + rawProviderData: Array +) => { + const ids = []; + rawProviderData.forEach((provider) => { + const { pairs } = provider; + pairs.forEach(({ from, to }) => ids.push(from, to)); + }); + return uniq(ids); +}; + +// TODO deprecated when noWall export const getCurrenciesWithStatus = ({ accounts, selectableCurrencies, @@ -81,6 +98,70 @@ export const getValidToCurrencies = ({ return uniq(out); }; +export const getSupportedCurrencies = ({ + providers, + provider, + tradeMethod, + fromCurrency, +}: { + providers: any, + provider: string, + tradeMethod?: string, + fromCurrency?: CryptoCurrency | TokenCurrency, +}): Array => { + const providerData = providers.find((p) => p.provider === provider); + invariant(provider, `No provider matching ${provider} was found`); + + const { pairs } = providerData; + const ids = uniq( + pairs.map(({ from, to, tradeMethods }) => { + const isTo = fromCurrency; + if ( + (!tradeMethod || tradeMethods.include(tradeMethod)) && + (!fromCurrency || fromCurrency.id === from) + ) { + return isTo ? to : from; + } + }) + ); + + const tokenCurrencies = ids + .map(findTokenById) + .filter(Boolean) + .filter((t) => !t.delisted); + + const cryptoCurrencies = ids + .map(findCryptoCurrencyById) + .filter(Boolean) + .filter(isCurrencySupported); + + return [...cryptoCurrencies, ...tokenCurrencies].filter( + isCurrencyExchangeSupported + ); +}; + +export const getEnabledTradingMethods = ({ + providers, + provider, + fromCurrency, + toCurrency, +}: { + providers: any, + provider: string, + fromCurrency: CryptoCurrency | TokenCurrency, + toCurrency: CryptoCurrency | TokenCurrency, +}) => { + const providerData = providers.find((p) => p.provider === provider); + invariant(provider, `No provider matching ${provider} was found`); + + const { pairs } = providerData; + const match = pairs.find( + (p) => p.from === fromCurrency.id && p.to === toCurrency.id + ); + + return match?.tradeMethod || []; +}; + const allTradeMethods: TradeMethod[] = ["fixed", "float"]; // Flow i give up export const getEnabledTradeMethods = ({ diff --git a/src/exchange/swap/mock.js b/src/exchange/swap/mock.js index 069a3ad1ed..8ad7c06c91 100644 --- a/src/exchange/swap/mock.js +++ b/src/exchange/swap/mock.js @@ -16,6 +16,7 @@ import { SwapExchangeRateAmountTooHigh, } from "../../errors"; import { Observable, of } from "rxjs"; +import { getSwapAPIBaseURL } from "./"; export const mockGetExchangeRates = async ( exchange: Exchange, @@ -104,35 +105,57 @@ export const mockInitSwap = ( export const mockGetProviders: GetProviders = async () => { //Fake delay to show loading UI await new Promise((r) => setTimeout(r, 800)); + const usesV3 = getSwapAPIBaseURL().endsWith("v3"); - return [ - { - provider: "changelly", - supportedCurrencies: [ - "bitcoin", - "litecoin", - "ethereum", - "tron", - "ethereum/erc20/omg", - "ethereum/erc20/0x_project", - "ethereum/erc20/augur", - ], - tradeMethod: "fixed", - }, - { - provider: "changelly", - supportedCurrencies: [ - "bitcoin", - "litecoin", - "ethereum", - "tron", - "ethereum/erc20/omg", - "ethereum/erc20/0x_project", - "ethereum/erc20/augur", - ], - tradeMethod: "float", - }, - ]; + return usesV3 + ? [ + { + provider: "changelly", + pairs: [ + { from: "bitcoin", to: "ethereum", tradeMethod: "float" }, + { from: "bitcoin", to: "ethereum", tradeMethod: "fixed" }, + { from: "ethereum", to: "bitcoin", tradeMethod: "float" }, + { from: "ethereum", to: "bitcoin", tradeMethod: "fixed" }, + ], + }, + { + provider: "wyre", + pairs: [ + { from: "bitcoin", to: "ethereum", tradeMethod: "float" }, + { from: "bitcoin", to: "ethereum", tradeMethod: "fixed" }, + { from: "ethereum", to: "bitcoin", tradeMethod: "float" }, + { from: "ethereum", to: "bitcoin", tradeMethod: "fixed" }, + ], + }, + ] + : [ + { + provider: "changelly", + supportedCurrencies: [ + "bitcoin", + "litecoin", + "ethereum", + "tron", + "ethereum/erc20/omg", + "ethereum/erc20/0x_project", + "ethereum/erc20/augur", + ], + tradeMethod: "fixed", + }, + { + provider: "changelly", + supportedCurrencies: [ + "bitcoin", + "litecoin", + "ethereum", + "tron", + "ethereum/erc20/omg", + "ethereum/erc20/0x_project", + "ethereum/erc20/augur", + ], + tradeMethod: "float", + }, + ]; }; export const mockGetStatus: GetMultipleStatus = async (statusList) => { diff --git a/src/exchange/swap/submitKYC.js b/src/exchange/swap/submitKYC.js new file mode 100644 index 0000000000..8982b8abee --- /dev/null +++ b/src/exchange/swap/submitKYC.js @@ -0,0 +1,33 @@ +// @flow + +import network from "../../network"; +import { getSwapAPIBaseURL } from "./"; +import type { KYCData, SubmitKYC } from "./types"; +import { ValidationError } from "../../errors"; + +export const submitKYC: SubmitKYC = async (provider: string, data: KYCData) => { + try { + const res = await network({ + method: "POST", + url: `${getSwapAPIBaseURL()}/provider/${provider}/user`, + data, + }); + + const { id, status } = res.data; + + return { + id, + status, + }; + } catch (error) { + // Nb this is the best we have, no _per field_ validation but rather + // error handling at the top level. + + // TODO detect KYC specs changed to throw specific error + return { + error: new ValidationError(error.message), + }; + } +}; + +export default submitKYC; diff --git a/src/exchange/swap/types.js b/src/exchange/swap/types.js index 11165809fc..de9a92f958 100644 --- a/src/exchange/swap/types.js +++ b/src/exchange/swap/types.js @@ -12,6 +12,28 @@ import type { TransactionRaw, } from "../../types"; +/// v3 changes here, move me to another folder soon +export type ValidKYCStatus = "open" | "pending" | "approved" | "closed"; +export type KYCStatus = { id: string, status: ValidKYCStatus }; +export type GetKYCStatus = (string, string) => Promise; +export type SubmitKYC = ( + string, + KYCData +) => Promise; + +export type KYCData = { + firstName: string, + lastName: string, + residenceAddress: { + street1: string, + street2: string, + city: string, + state: string, + country: string, + postalCode: string, + }, +}; +/// export type Exchange = { fromParentAccount: ?Account, fromAccount: AccountLike, @@ -51,15 +73,22 @@ export type ExchangeRateRaw = { providerURL?: ?string, }; -export type AvailableProvider = { +export type AvailableProviderV2 = { provider: string, supportedCurrencies: string[], }; +export type AvailableProviderV3 = { + provider: string, + pairs: Array<{ from: string, to: string, tradeMethod: string }>, +}; + +export type AvailableProvider = AvailableProviderV2 | AvailableProviderV3; export type GetExchangeRates = ( Exchange, Transaction ) => Promise; + export type GetProviders = () => Promise; export type InitSwapResult = { @@ -165,6 +194,7 @@ export type InitSwapInput = { exchangeRate: ExchangeRate, transaction: Transaction, deviceId: string, + userId?: string, // Nb for kyc purposes }; export type InitSwapInputRaw = { @@ -172,4 +202,5 @@ export type InitSwapInputRaw = { exchangeRate: ExchangeRateRaw, transaction: TransactionRaw, deviceId: string, + userId?: string, }; diff --git a/src/families/crypto_org/account.js b/src/families/crypto_org/account.js new file mode 100644 index 0000000000..0614a88143 --- /dev/null +++ b/src/families/crypto_org/account.js @@ -0,0 +1,58 @@ +// @flow +import invariant from "invariant"; +import type { Account } from "../../types"; +import { getAccountUnit } from "../../account"; +import { formatCurrencyUnit } from "../../currencies"; + +function formatAccountSpecifics(account: Account): string { + const { cryptoOrgResources } = account; + invariant(cryptoOrgResources, "Crypto.org account expected"); + const unit = getAccountUnit(account); + const formatConfig = { + disableRounding: true, + alwaysShowSign: false, + showCode: true, + }; + + let str = " "; + + str += + formatCurrencyUnit(unit, account.spendableBalance, formatConfig) + + " spendable. "; + + if (cryptoOrgResources.bondedBalance.gt(0)) { + str += + formatCurrencyUnit(unit, cryptoOrgResources.bondedBalance, formatConfig) + + " bonded. "; + } + + if (cryptoOrgResources.redelegatingBalance.gt(0)) { + str += + formatCurrencyUnit( + unit, + cryptoOrgResources.redelegatingBalance, + formatConfig + ) + " redelegatingBalance. "; + } + + if (cryptoOrgResources.unbondingBalance.gt(0)) { + str += + formatCurrencyUnit( + unit, + cryptoOrgResources.unbondingBalance, + formatConfig + ) + " unbondingBalance. "; + } + + if (cryptoOrgResources.commissions.gt(0)) { + str += + formatCurrencyUnit(unit, cryptoOrgResources.commissions, formatConfig) + + " commissions. "; + } + + return str; +} + +export default { + formatAccountSpecifics, +}; diff --git a/src/families/crypto_org/api/index.js b/src/families/crypto_org/api/index.js new file mode 100644 index 0000000000..dafa6b52c9 --- /dev/null +++ b/src/families/crypto_org/api/index.js @@ -0,0 +1,6 @@ +export { + getAccount, + getOperations, + broadcastTransaction, + getAccountParams, +} from "./sdk"; diff --git a/src/families/crypto_org/api/sdk.js b/src/families/crypto_org/api/sdk.js new file mode 100644 index 0000000000..fcac179ae3 --- /dev/null +++ b/src/families/crypto_org/api/sdk.js @@ -0,0 +1,234 @@ +// @flow +import { utils } from "@crypto-com/chain-jslib"; +import { + CryptoOrgAccountTransaction, + CryptoOrgMsgSendContent, + CryptoOrgAmount, + CryptoOrgAccountTransactionTypeEnum, + CryptoOrgCurrency, + CryptoOrgTestnetCurrency, +} from "./sdk.types"; +import { BigNumber } from "bignumber.js"; +import network from "../../../network"; +import { getCroSdk, isTestNet } from "../logic"; + +import type { Operation, OperationType } from "../../../types"; +import { getEnv } from "../../../env"; +import { encodeOperationId } from "../../../operation"; + +const PAGINATION_LIMIT = 200; + +const instances = {}; +/** + * Get CroClient + */ +export async function getClient(currencyId: *) { + if (instances[currencyId]) { + return instances[currencyId]; + } + const crypto_org_rpc_url = isTestNet(currencyId) + ? getEnv("CRYPTO_ORG_TESTNET_RPC_URL") + : getEnv("CRYPTO_ORG_RPC_URL"); + instances[currencyId] = await getCroSdk(currencyId).CroClient.connect( + crypto_org_rpc_url + ); + return instances[currencyId]; +} + +/** + * Extract only the cro amount from list of currencies + */ +export const getCroAmount = ( + amounts: CryptoOrgAmount[], + currencyId: string +) => { + const cryptoOrgCurrency = isTestNet(currencyId) + ? CryptoOrgTestnetCurrency + : CryptoOrgCurrency; + return amounts.reduce( + (result, current) => + current.denom === cryptoOrgCurrency + ? result.plus(BigNumber(current.amount)) + : result, + BigNumber(0) + ); +}; + +/** + * Get account balances + */ +export const getAccount = async (addr: string, currencyId: string) => { + const client = await getClient(currencyId); + const { header } = await client.getBlock(); + + const crypto_org_indexer = isTestNet(currencyId) + ? getEnv("CRYPTO_ORG_TESTNET_INDEXER") + : getEnv("CRYPTO_ORG_INDEXER"); + + let balance = 0; + let bondedBalance = 0; + let redelegatingBalance = 0; + let unbondingBalance = 0; + let commissions = 0; + let data; + try { + const response = await network({ + method: "GET", + url: `${crypto_org_indexer}/api/v1/accounts/${addr}`, + }); + data = response.data; + } catch (error) { + if (error?.status !== 404) { + throw error; + } + } + + if (data) { + balance = getCroAmount(data.result.balance, currencyId); + bondedBalance = getCroAmount(data.result.bondedBalance, currencyId); + redelegatingBalance = getCroAmount( + data.result.redelegatingBalance, + currencyId + ); + unbondingBalance = getCroAmount(data.result.unbondingBalance, currencyId); + commissions = getCroAmount(data.result.commissions, currencyId); + } + return { + blockHeight: header.height, + balance: BigNumber(balance), + bondedBalance: BigNumber(bondedBalance), + redelegatingBalance: BigNumber(redelegatingBalance), + unbondingBalance: BigNumber(unbondingBalance), + commissions: BigNumber(commissions), + }; +}; + +/** + * Get account information for sending transactions + */ +export const getAccountParams = async (addr: string, currencyId: string) => { + const client = await getClient(currencyId); + const { accountNumber, sequence } = await client.getAccount(addr); + + return { + accountNumber: accountNumber ?? 0, + sequence: sequence ?? 0, + }; +}; + +/** + * Returns true if account is the signer + */ +function isSender(transaction: CryptoOrgMsgSendContent, addr: string): boolean { + return transaction.fromAddress === addr; +} + +/** + * Map transaction to an Operation Type + */ +function getOperationType( + messageSendContent: CryptoOrgMsgSendContent, + addr: string +): OperationType { + return isSender(messageSendContent, addr) ? "OUT" : "IN"; +} + +/** + * Map transaction to a correct Operation Value (affecting account balance) + */ +function getOperationValue( + messageSendContent: CryptoOrgMsgSendContent, + currencyId: string +): BigNumber { + return getCroAmount(messageSendContent.amount, currencyId); +} + +/** + * Map the send history transaction to a Ledger Live Operation + */ +function convertSendTransactionToOperation( + accountId: string, + addr: string, + messageSendContent: CryptoOrgMsgSendContent, + transaction: CryptoOrgAccountTransaction, + currencyId: string +): Operation { + const type = getOperationType(messageSendContent, addr); + + return { + id: encodeOperationId(accountId, messageSendContent.txHash, type), + accountId, + fee: BigNumber(transaction.fee.amount), + value: getOperationValue(messageSendContent, currencyId), + type, + hash: messageSendContent.txHash, + blockHash: transaction.blockHash, + blockHeight: transaction.blockHeight, + date: new Date(transaction.blockTime), + senders: [messageSendContent.fromAddress], + recipients: [messageSendContent.toAddress], + hasFailed: !transaction.success, + extra: undefined, + }; +} + +/** + * Fetch operation list + */ +export const getOperations = async ( + accountId: string, + addr: string, + startAt: number, + currencyId: string +): Promise => { + let rawTransactions: Operation[] = []; + + const crypto_org_indexer = isTestNet(currencyId) + ? getEnv("CRYPTO_ORG_TESTNET_INDEXER") + : getEnv("CRYPTO_ORG_INDEXER"); + + const { data } = await network({ + method: "GET", + url: `${crypto_org_indexer}/api/v1/accounts/${addr}/transactions?pagination=offset&page=${ + startAt + 1 + }&limit=${PAGINATION_LIMIT}`, + }); + const accountTransactions: CryptoOrgAccountTransaction[] = data.result; + for (let i = 0; i < accountTransactions.length; i++) { + const msgs = accountTransactions[i].messages; + for (let j = 0; j < msgs.length; j++) { + switch (msgs[j].type) { + case CryptoOrgAccountTransactionTypeEnum.MsgSend: { + const msgSend: CryptoOrgMsgSendContent = msgs[j].content; + rawTransactions.push( + convertSendTransactionToOperation( + accountId, + addr, + msgSend, + accountTransactions[i], + currencyId + ) + ); + break; + } + default: + } + } + } + + return rawTransactions; +}; + +/** + * Broadcast blob to blockchain + */ +export const broadcastTransaction = async ( + blob: string, + currencyId: string +) => { + const client = await getClient(currencyId); + const broadcastResponse = await client.broadcastTx( + utils.Bytes.fromHexString(blob).toUint8Array() + ); + return broadcastResponse; +}; diff --git a/src/families/crypto_org/api/sdk.types.js b/src/families/crypto_org/api/sdk.types.js new file mode 100644 index 0000000000..f559b04149 --- /dev/null +++ b/src/families/crypto_org/api/sdk.types.js @@ -0,0 +1,52 @@ +// @flow + +export const CryptoOrgAccountTransactionTypeEnum = { + MsgSend: "MsgSend", + MgsMultiSend: "MsgMultiSend", +}; + +export const CryptoOrgCurrency = "basecro"; +export const CryptoOrgTestnetCurrency = "basetcro"; + +export interface CryptoOrgAccountTransaction { + account: string; + blockHeight: number; + blockHash: string; + blockTime: Date; + hash: string; + messageTypes: string[]; + success: boolean; + code: number; + log: string; + fee: CryptoOrgAmount; + feePayer: string; + feeGranter: string; + gasWanted: number; + gasUsed: number; + memo: string; + timeoutHeight: number; + messages: any[]; +} + +export interface CryptoOrgAmount { + denom: string; + amount: number; +} + +export interface CryptoOrgMsgSendContent { + amount: CryptoOrgAmount[]; + height: number; + txHash: string; + msgName: string; + version: number; + msgIndex: number; + name: string; + uuid: string; + toAddress: string; + fromAddress: string; +} + +export interface CryptoOrgMsgSend { + type: string; + content: CryptoOrgMsgSendContent; +} diff --git a/src/families/crypto_org/bridge/js.js b/src/families/crypto_org/bridge/js.js new file mode 100644 index 0000000000..f4ec70b5ee --- /dev/null +++ b/src/families/crypto_org/bridge/js.js @@ -0,0 +1,37 @@ +// @flow +import type { AccountBridge, CurrencyBridge } from "../../../types"; +import type { Transaction } from "../types"; +import { makeAccountBridgeReceive } from "../../../bridge/jsHelpers"; + +import { sync, scanAccounts } from "../js-synchronisation"; +import { + createTransaction, + updateTransaction, + prepareTransaction, +} from "../js-transaction"; +import getTransactionStatus from "../js-getTransactionStatus"; +import estimateMaxSpendable from "../js-estimateMaxSpendable"; +import signOperation from "../js-signOperation"; +import broadcast from "../js-broadcast"; + +const receive = makeAccountBridgeReceive(); + +const currencyBridge: CurrencyBridge = { + preload: async () => {}, + hydrate: () => {}, + scanAccounts, +}; + +const accountBridge: AccountBridge = { + estimateMaxSpendable, + createTransaction, + updateTransaction, + getTransactionStatus, + prepareTransaction, + sync, + receive, + signOperation, + broadcast, +}; + +export default { currencyBridge, accountBridge }; diff --git a/src/families/crypto_org/cli-transaction.js b/src/families/crypto_org/cli-transaction.js new file mode 100644 index 0000000000..f56b240b96 --- /dev/null +++ b/src/families/crypto_org/cli-transaction.js @@ -0,0 +1,36 @@ +// @flow +import invariant from "invariant"; +import flatMap from "lodash/flatMap"; +import type { Transaction, AccountLike } from "../../types"; + +const options = [ + { + name: "mode", + type: String, + desc: "mode of transaction: send", + }, +]; + +function inferTransactions( + transactions: Array<{ account: AccountLike, transaction: Transaction }>, + opts: Object +): Transaction[] { + return flatMap(transactions, ({ transaction, account }) => { + invariant(transaction.family === "crypto_org", "crypto_org family"); + + if (account.type === "Account") { + invariant(account.cryptoOrgResources, "unactivated account"); + } + + return { + ...transaction, + family: "crypto_org", + mode: opts.mode || "send", + }; + }); +} + +export default { + options, + inferTransactions, +}; diff --git a/src/families/crypto_org/errors.js b/src/families/crypto_org/errors.js new file mode 100644 index 0000000000..999f5ca355 --- /dev/null +++ b/src/families/crypto_org/errors.js @@ -0,0 +1,14 @@ +// @flow +import { createCustomErrorClass } from "@ledgerhq/errors"; + +export const CryptoOrgWrongSignatureHeader = createCustomErrorClass( + "CryptoOrgWrongSignatureHeader" +); + +export const CryptoOrgSignatureSize = createCustomErrorClass( + "CryptoOrgSignatureSize" +); + +export const CryptoOrgErrorBroadcasting = createCustomErrorClass( + "CryptoOrgErrorBroadcasting" +); diff --git a/src/families/crypto_org/hw-getAddress.js b/src/families/crypto_org/hw-getAddress.js new file mode 100644 index 0000000000..43a2f753dd --- /dev/null +++ b/src/families/crypto_org/hw-getAddress.js @@ -0,0 +1,18 @@ +// @flow + +import Cosmos from "@ledgerhq/hw-app-cosmos"; +import type { Resolver } from "../../hw/getAddress/types"; +import { isTestNet } from "./logic"; + +const resolver: Resolver = async (transport, { path, verify, currency }) => { + const cosmos = new Cosmos(transport); + const cointype = isTestNet(currency.id) ? "tcro" : "cro"; + const r = await cosmos.getAddress(path, cointype, verify || false); + return { + address: r.address, + publicKey: r.publicKey, + path, + }; +}; + +export default resolver; diff --git a/src/families/crypto_org/js-broadcast.js b/src/families/crypto_org/js-broadcast.js new file mode 100644 index 0000000000..87f0444980 --- /dev/null +++ b/src/families/crypto_org/js-broadcast.js @@ -0,0 +1,36 @@ +// @flow +import type { Operation, SignedOperation, Account } from "../../types"; +import { patchOperationWithHash } from "../../operation"; + +import { broadcastTransaction } from "./api"; +import { CryptoOrgErrorBroadcasting } from "./errors"; + +function isBroadcastTxFailure(result) { + return !!result.code; +} + +/** + * Broadcast the signed transaction + */ +const broadcast = async ({ + account, + signedOperation: { signature, operation }, +}: { + account: Account, + signedOperation: SignedOperation, +}): Promise => { + const broadcastResponse = await broadcastTransaction( + signature, + account.currency.id + ); + + if (isBroadcastTxFailure(broadcastResponse)) { + throw new CryptoOrgErrorBroadcasting( + `broadcasting failed with error code ${broadcastResponse.code}` + ); + } + + return patchOperationWithHash(operation, broadcastResponse.transactionHash); +}; + +export default broadcast; diff --git a/src/families/crypto_org/js-buildTransaction.js b/src/families/crypto_org/js-buildTransaction.js new file mode 100644 index 0000000000..930ec86266 --- /dev/null +++ b/src/families/crypto_org/js-buildTransaction.js @@ -0,0 +1,59 @@ +// @flow +import type { Transaction } from "./types"; +import type { Account } from "../../types"; +import { Units, utils } from "@crypto-com/chain-jslib"; +import { getAccountParams } from "./api/sdk"; +import { getCroSdk } from "./logic"; + +const getTransactionAmount = (a: Account, t: Transaction) => { + const croSdk = getCroSdk(a.currency.id); + switch (t.mode) { + case "send": + if (t.useAllAmount) { + const amountMinusFee = t.amount.minus(t.fees || 0); + return new croSdk.Coin(amountMinusFee.toString(), Units.BASE); + } else { + return new croSdk.Coin(t.amount.toString(), Units.BASE); + } + default: + throw new Error("Unknown mode in transaction"); + } +}; + +/** + * + * @param {Account} a + * @param {Transaction} t + */ +export const buildTransaction = async ( + a: Account, + t: Transaction, + publicKey: string +) => { + const croSdk = getCroSdk(a.currency.id); + const address = a.freshAddresses[0].address; + const { accountNumber, sequence } = await getAccountParams( + address, + a.currency.id + ); + const rawTx = new croSdk.RawTransaction(); + rawTx.setFee(new croSdk.Coin((t.fees || 0).toString(), Units.BASE)); + + const msgSend = new croSdk.bank.MsgSend({ + fromAddress: address, + toAddress: t.recipient, + amount: getTransactionAmount(a, t), + }); + + const signableTx = rawTx + .appendMessage(msgSend) + .addSigner({ + publicKey: utils.Bytes.fromHexString(publicKey), + accountNumber: new utils.Big(accountNumber), + accountSequence: new utils.Big(sequence), + signMode: 0, + }) + .toSignable(); + + return signableTx; +}; diff --git a/src/families/crypto_org/js-estimateMaxSpendable.js b/src/families/crypto_org/js-estimateMaxSpendable.js new file mode 100644 index 0000000000..15839a0d50 --- /dev/null +++ b/src/families/crypto_org/js-estimateMaxSpendable.js @@ -0,0 +1,29 @@ +// @flow +import { BigNumber } from "bignumber.js"; + +import type { AccountLike, Account } from "../../types"; +import { getMainAccount } from "../../account"; + +import type { Transaction } from "./types"; + +import getEstimatedFees from "./js-getFeesForTransaction"; + +/** + * Returns the maximum possible amount for transaction + * + * @param {Object} param - the account, parentAccount and transaction + */ +const estimateMaxSpendable = async ({ + account, + parentAccount, +}: { + account: AccountLike, + parentAccount: ?Account, + transaction: ?Transaction, +}): Promise => { + const a = getMainAccount(account, parentAccount); + const fees = await getEstimatedFees(); + return a.spendableBalance.minus(fees); +}; + +export default estimateMaxSpendable; diff --git a/src/families/crypto_org/js-getFeesForTransaction.js b/src/families/crypto_org/js-getFeesForTransaction.js new file mode 100644 index 0000000000..5d97946e61 --- /dev/null +++ b/src/families/crypto_org/js-getFeesForTransaction.js @@ -0,0 +1,14 @@ +// @flow +import { BigNumber } from "bignumber.js"; +import { FIXED_GAS_PRICE, FIXED_DEFAULT_GAS_LIMIT } from "./logic"; + +/** + * Fetch the transaction fees for a transaction + */ +const getEstimatedFees = async (): Promise => { + // TODO: call gas station to get a more accurate tx fee in the future + let estimateFee = Math.ceil(FIXED_GAS_PRICE * FIXED_DEFAULT_GAS_LIMIT); + return new BigNumber(estimateFee); +}; + +export default getEstimatedFees; diff --git a/src/families/crypto_org/js-getTransactionStatus.js b/src/families/crypto_org/js-getTransactionStatus.js new file mode 100644 index 0000000000..ec637c41ff --- /dev/null +++ b/src/families/crypto_org/js-getTransactionStatus.js @@ -0,0 +1,59 @@ +// @flow +import { BigNumber } from "bignumber.js"; +import { + NotEnoughBalance, + RecipientRequired, + InvalidAddress, + FeeNotLoaded, + AmountRequired, +} from "@ledgerhq/errors"; +import type { Account, TransactionStatus } from "../../types"; +import type { Transaction } from "./types"; +import { isValidAddress } from "./logic"; + +const getTransactionStatus = async ( + a: Account, + t: Transaction +): Promise => { + const errors = {}; + const warnings = {}; + const useAllAmount = !!t.useAllAmount; + + if (!t.fees) { + errors.fees = new FeeNotLoaded(); + } + + const estimatedFees = t.fees || BigNumber(0); + + const totalSpent = useAllAmount + ? a.balance + : BigNumber(t.amount).plus(estimatedFees); + + const amount = useAllAmount + ? a.balance.minus(estimatedFees) + : BigNumber(t.amount); + + if (totalSpent.gt(a.balance)) { + errors.amount = new NotEnoughBalance(); + } + + if (!t.amount.gt(0)) { + errors.amount = new AmountRequired(); + } + + if (!t.recipient) { + errors.recipient = new RecipientRequired(); + } else if (!isValidAddress(t.recipient, a.currency.id)) { + errors.recipient = new InvalidAddress(); + } + + return Promise.resolve({ + errors, + warnings, + estimatedFees, + amount, + totalSpent, + }); +}; + +export default getTransactionStatus; diff --git a/src/families/crypto_org/js-signOperation.js b/src/families/crypto_org/js-signOperation.js new file mode 100644 index 0000000000..0ea9d2d867 --- /dev/null +++ b/src/families/crypto_org/js-signOperation.js @@ -0,0 +1,179 @@ +// @flow +import { BigNumber } from "bignumber.js"; +import { Observable } from "rxjs"; +import { FeeNotLoaded } from "@ledgerhq/errors"; +import { + CryptoOrgWrongSignatureHeader, + CryptoOrgSignatureSize, +} from "./errors"; +import type { Transaction } from "./types"; +import type { Account, Operation, SignOperationEvent } from "../../types"; + +import { open, close } from "../../hw"; +import { encodeOperationId } from "../../operation"; +import CryptoOrgApp from "@ledgerhq/hw-app-cosmos"; +import { utils } from "@crypto-com/chain-jslib"; + +import { buildTransaction } from "./js-buildTransaction"; +import { isTestNet } from "./logic"; + +const buildOptimisticOperation = ( + account: Account, + transaction: Transaction, + fee: BigNumber +): Operation => { + const type = "OUT"; + + const value = BigNumber(transaction.amount).plus(fee); + + const operation: $Exact = { + id: encodeOperationId(account.id, "", type), + hash: "", + type, + value, + fee, + blockHash: null, + blockHeight: null, + senders: [account.freshAddress], + recipients: [transaction.recipient].filter(Boolean), + accountId: account.id, + date: new Date(), + extra: { additionalField: transaction.amount }, + }; + + return operation; +}; + +function convertASN1toBase64(signature) { + // 0 0x30: a header byte indicating a compound structure + // 1 A 1-byte length descriptor for all what follows (ignore) + // 2 0x02: a header byte indicating an integer + // 3 A 1-byte length descriptor for the R value + // 4 The R coordinate, as a big-endian integer + // 0x02: a header byte indicating an integer + // A 1-byte length descriptor for the S value + // The S coordinate, as a big-endian integer + // = 7 bytes of overhead + if (signature[0] !== 0x30) { + throw new CryptoOrgWrongSignatureHeader(); + } + + // decode DER string format + let rOffset = 4; + let rLen = signature[3]; + const sLen = signature[4 + rLen + 1]; // skip over following 0x02 type prefix for s + let sOffset = signature.length - sLen; + + const sigR = signature.slice(rOffset, rOffset + rLen); // skip e.g. 3045022100 and pad + const sigS = signature.slice(sOffset); + const newSigR = padZero(sigR, 32); + const newSigS = padZero(sigS, 32); + + // $FlowFixMe please fix types here. + const signatureFormatted = Buffer.concat([newSigR, newSigS]); + if (signatureFormatted.length !== 64) { + throw new CryptoOrgSignatureSize(); + } + + return signatureFormatted; +} + +function padZero(original_array: Uint8Array, wanted_length: number) { + const new_array = new Uint8Array(wanted_length); + for (let i = wanted_length - 1; i >= 0; i--) { + const j = wanted_length - 1 - i; + const new_i = original_array.length - 1 - j; + if (new_i >= 0 && new_i < original_array.length) { + new_array[i] = original_array[new_i]; + } else { + new_array[i] = 0; + } + } + + return new_array; +} + +/** + * Sign Transaction with Ledger hardware + */ +const signOperation = ({ + account, + deviceId, + transaction, +}: { + account: Account, + deviceId: *, + transaction: Transaction, +}): Observable => + Observable.create((o) => { + async function main() { + const transport = await open(deviceId); + try { + o.next({ type: "device-signature-requested" }); + + if (!transaction.fees) { + throw new FeeNotLoaded(); + } + + // Get the public key + const hwApp = new CryptoOrgApp(transport); + const address = account.freshAddresses[0]; + const cointype = isTestNet(account.currency.id) ? "tcro" : "cro"; + const { publicKey } = await hwApp.getAddress( + address.derivationPath, + cointype, + false + ); + + const unsigned = await buildTransaction( + account, + transaction, + publicKey + ); + + // Sign by device + const { signature } = await hwApp.sign( + address.derivationPath, + unsigned.toSignDocument(0).toUint8Array() + ); + + // Ledger has encoded the sig in ASN1 DER format, but we need a 64-byte buffer of + // DER-encoded signature from Ledger + if (signature != null) { + const base64Sig = convertASN1toBase64(signature); + const signed = unsigned + .setSignature( + 0, + utils.Bytes.fromUint8Array(new Uint8Array(base64Sig)) + ) + .toSigned() + .getHexEncoded(); + + o.next({ type: "device-signature-granted" }); + + const operation = buildOptimisticOperation( + account, + transaction, + transaction.fees ?? BigNumber(0) + ); + + o.next({ + type: "signed", + signedOperation: { + operation, + signature: signed, + expirationDate: null, + }, + }); + } + } finally { + close(transport, deviceId); + } + } + main().then( + () => o.complete(), + (e) => o.error(e) + ); + }); + +export default signOperation; diff --git a/src/families/crypto_org/js-synchronisation.js b/src/families/crypto_org/js-synchronisation.js new file mode 100644 index 0000000000..4063a5a0f8 --- /dev/null +++ b/src/families/crypto_org/js-synchronisation.js @@ -0,0 +1,51 @@ +//@flow +import type { Account } from "../../types"; +import type { GetAccountShape } from "../../bridge/jsHelpers"; +import { makeSync, makeScanAccounts, mergeOps } from "../../bridge/jsHelpers"; + +import { getAccount, getOperations } from "./api"; + +const getAccountShape: GetAccountShape = async (info) => { + const { id, address, initialAccount, currency } = info; + const oldOperations = initialAccount?.operations || []; + const { + blockHeight, + balance, + bondedBalance, + redelegatingBalance, + unbondingBalance, + commissions, + } = await getAccount(address, currency.id); + + // Merge new operations with the previously synced ones + let startAt = 0; + let maxIteration = 20; + let operations = oldOperations; + let newOperations = await getOperations(id, address, startAt++, currency.id); + do { + operations = mergeOps(operations, newOperations); + newOperations = await getOperations(id, address, startAt++, currency.id); + } while (--maxIteration && newOperations.length != 0); + + const shape = { + id, + balance, + spendableBalance: balance, + operationsCount: operations.length, + blockHeight, + cryptoOrgResources: { + bondedBalance, + redelegatingBalance, + unbondingBalance, + commissions, + }, + }; + + return { ...shape, operations }; +}; + +const postSync = (initial: Account, parent: Account) => parent; + +export const scanAccounts = makeScanAccounts(getAccountShape); + +export const sync = makeSync(getAccountShape, postSync); diff --git a/src/families/crypto_org/js-transaction.js b/src/families/crypto_org/js-transaction.js new file mode 100644 index 0000000000..3f8d8c7c7f --- /dev/null +++ b/src/families/crypto_org/js-transaction.js @@ -0,0 +1,49 @@ +// @flow +import { BigNumber } from "bignumber.js"; +import type { Account } from "../../types"; +import type { Transaction } from "./types"; +import getEstimatedFees from "./js-getFeesForTransaction"; +const sameFees = (a, b) => (!a || !b ? a === b : a.eq(b)); + +/** + * Create an empty transaction + * + * @returns {Transaction} + */ +export const createTransaction = (): Transaction => ({ + family: "crypto_org", + mode: "send", + amount: BigNumber(0), + recipient: "", + useAllAmount: false, + fees: null, +}); + +/** + * Apply patch to transaction + * + * @param {*} t + * @param {*} patch + */ +export const updateTransaction = ( + t: Transaction, + patch: $Shape +) => ({ ...t, ...patch }); + +/** + * Prepare transaction before checking status + * + * @param {Account} a + * @param {Transaction} t + */ +export const prepareTransaction = async (a: Account, t: Transaction) => { + let fees = t.fees; + + fees = await getEstimatedFees(); + + if (!sameFees(t.fees, fees)) { + return { ...t, fees }; + } + + return t; +}; diff --git a/src/families/crypto_org/logic.js b/src/families/crypto_org/logic.js new file mode 100644 index 0000000000..8162840b69 --- /dev/null +++ b/src/families/crypto_org/logic.js @@ -0,0 +1,72 @@ +// @flow +import { CroNetwork, CroSDK, utils } from "@crypto-com/chain-jslib"; + +export const TESTNET_CURRENCY_ID = "crypto_org_croeseid"; + +export const FIXED_GAS_PRICE = 0.025; +export const FIXED_DEFAULT_GAS_LIMIT = 200000; + +export const TestnetCroeseid3 = { + defaultNodeUrl: "https://testnet-croeseid-3.crypto.org", + chainId: "testnet-croeseid-3", + addressPrefix: "tcro", + validatorAddressPrefix: "tcrocncl", + validatorPubKeyPrefix: "tcrocnclconspub", + coin: { + baseDenom: "basetcro", + croDenom: "tcro", + }, + bip44Path: { + coinType: 1, + account: 0, + }, + rpcUrl: "https://testnet-croeseid-3.crypto.org:26657", +}; + +const croSdks = {}; + +/** + * Returns true if we are using testnet + * + * @param {string} currency + */ +export function isTestNet(currencyId: string) { + return currencyId == TESTNET_CURRENCY_ID; +} + +/** + * Get CroSdk + * @param {string} currency + */ +export function getCroSdk(currencyId: string) { + if (!croSdks[currencyId]) { + croSdks[currencyId] = isTestNet(currencyId) + ? CroSDK({ network: TestnetCroeseid3 }) + : CroSDK({ network: CroNetwork.Mainnet }); + } + return croSdks[currencyId]; +} + +/** + * Returns true if address is a valid md5 + * + * @param {string} address + * @param {boolean} useTestNet + */ +export const isValidAddress = ( + address: string, + currencyId: string +): boolean => { + if (!address) return false; + + const network = isTestNet(currencyId) ? TestnetCroeseid3 : CroNetwork.Mainnet; + + const addressProps = { + address: address, + network: network, + type: utils.AddressType.USER, + }; + + const addressValidator = new utils.AddressValidator(addressProps); + return addressValidator.isValid(); +}; diff --git a/src/families/crypto_org/serialization.js b/src/families/crypto_org/serialization.js new file mode 100644 index 0000000000..db535956e8 --- /dev/null +++ b/src/families/crypto_org/serialization.js @@ -0,0 +1,37 @@ +// @flow +import { BigNumber } from "bignumber.js"; +import type { CryptoOrgResourcesRaw, CryptoOrgResources } from "./types"; + +export function toCryptoOrgResourcesRaw( + r: CryptoOrgResources +): CryptoOrgResourcesRaw { + const { + bondedBalance, + redelegatingBalance, + unbondingBalance, + commissions, + } = r; + return { + bondedBalance: bondedBalance.toString(), + redelegatingBalance: redelegatingBalance.toString(), + unbondingBalance: unbondingBalance.toString(), + commissions: commissions.toString(), + }; +} + +export function fromCryptoOrgResourcesRaw( + r: CryptoOrgResourcesRaw +): CryptoOrgResources { + const { + bondedBalance, + redelegatingBalance, + unbondingBalance, + commissions, + } = r; + return { + bondedBalance: BigNumber(bondedBalance), + redelegatingBalance: BigNumber(redelegatingBalance), + unbondingBalance: BigNumber(unbondingBalance), + commissions: BigNumber(commissions), + }; +} diff --git a/src/families/crypto_org/transaction.js b/src/families/crypto_org/transaction.js new file mode 100644 index 0000000000..f3e352c93b --- /dev/null +++ b/src/families/crypto_org/transaction.js @@ -0,0 +1,49 @@ +// @flow +import type { Transaction, TransactionRaw } from "./types"; +import { BigNumber } from "bignumber.js"; +import { + fromTransactionCommonRaw, + toTransactionCommonRaw, +} from "../../transaction/common"; +import type { Account } from "../../types"; +import { getAccountUnit } from "../../account"; +import { formatCurrencyUnit } from "../../currencies"; + +export const formatTransaction = ( + { mode, amount, recipient, useAllAmount }: Transaction, + account: Account +): string => + ` +${mode.toUpperCase()} ${ + useAllAmount + ? "MAX" + : amount.isZero() + ? "" + : " " + + formatCurrencyUnit(getAccountUnit(account), amount, { + showCode: true, + disableRounding: true, + }) + }${recipient ? `\nTO ${recipient}` : ""}`; + +export const fromTransactionRaw = (tr: TransactionRaw): Transaction => { + const common = fromTransactionCommonRaw(tr); + return { + ...common, + family: tr.family, + mode: tr.mode, + fees: tr.fees ? BigNumber(tr.fees) : null, + }; +}; + +export const toTransactionRaw = (t: Transaction): TransactionRaw => { + const common = toTransactionCommonRaw(t); + return { + ...common, + family: t.family, + mode: t.mode, + fees: t.fees?.toString() || null, + }; +}; + +export default { formatTransaction, fromTransactionRaw, toTransactionRaw }; diff --git a/src/families/crypto_org/types.js b/src/families/crypto_org/types.js new file mode 100644 index 0000000000..39186c8048 --- /dev/null +++ b/src/families/crypto_org/types.js @@ -0,0 +1,56 @@ +// @flow +import type { BigNumber } from "bignumber.js"; +import type { + TransactionCommon, + TransactionCommonRaw, +} from "../../types/transaction"; + +export type CoreStatics = {}; + +export type CoreAccountSpecifics = {}; + +export type CoreOperationSpecifics = {}; + +export type CoreCurrencySpecifics = {}; + +export type CryptoOrgResources = {| + bondedBalance: BigNumber, + redelegatingBalance: BigNumber, + unbondingBalance: BigNumber, + commissions: BigNumber, +|}; + +export type CryptoOrgResourcesRaw = {| + bondedBalance: string, + redelegatingBalance: string, + unbondingBalance: string, + commissions: string, +|}; + +export type Transaction = {| + ...TransactionCommon, + family: "crypto_org", + mode: string, + fees: ?BigNumber, + // add here all transaction-specific fields if you implement other modes than "send" +|}; + +export type TransactionRaw = {| + ...TransactionCommonRaw, + family: "crypto_org", + mode: string, + fees: ?string, + // also the transaction fields as raw JSON data +|}; + +export type CryptoOrgPreloadData = {||}; + +export type NetworkInfo = {| + family: "crypto_org", +|}; + +export type NetworkInfoRaw = {| + family: "crypto_org", +|}; + +export const reflect = (_declare: *) => {}; diff --git a/src/families/elrond/test-dataset.js b/src/families/elrond/test-dataset.js index f340f6b9a0..7b444e89b3 100644 --- a/src/families/elrond/test-dataset.js +++ b/src/families/elrond/test-dataset.js @@ -12,7 +12,7 @@ type TestTransaction = { }, }; -export default dataset = { +const dataset: DatasetTest = { implementations: ["js"], currencies: { elrond: { @@ -56,3 +56,5 @@ export default dataset = { }, }, }; + +export default dataset; diff --git a/src/families/ethereum/modules/compound.js b/src/families/ethereum/modules/compound.js index 7f7955164f..c1b0f9a92a 100644 --- a/src/families/ethereum/modules/compound.js +++ b/src/families/ethereum/modules/compound.js @@ -396,18 +396,11 @@ export function prepareTokenAccounts( return subAccounts.concat(implicitCTokenAccounts); } -const ctokenToGeneratedTokenOpMapping: { - [_: OperationType]: ?OperationType, -} = { +const cdaiToDaiOpMapping: { [_: OperationType]: ?OperationType } = { IN: "SUPPLY", OUT: "REDEEM", }; -const ctokenToTokenOpMapping: { [_: OperationType]: ?OperationType } = { - IN: "OUT", - OUT: "IN", -}; - export async function digestTokenAccounts( currency: CryptoCurrency, subAccounts: TokenAccount[], @@ -476,39 +469,30 @@ export async function digestTokenAccounts( // operations, C* to * conversions with the historical rates // cIN => SUPPLY // cOUT => REDEEM - const blockNumberSet = new Set(); - ctokenAccount.operations.forEach(({ blockHeight }) => { - if (typeof blockHeight !== "number") return; - blockNumberSet.add(blockHeight); - }); - const rates = await fetchHistoricalRates(ctoken, [...blockNumberSet]); - - const newOps = []; - ctokenAccount.operations.forEach((ctokenOp, i) => { - const { rate } = rates[i]; - const type = ctokenToGeneratedTokenOpMapping[ctokenOp.type]; - const tokenOpType = ctokenToTokenOpMapping[ctokenOp.type]; - if (!type || !tokenOpType) return; - - const matchingTokenOp = a.operations.find( - (tokenOp) => - tokenOp.id === `${a.id}-${ctokenOp.hash}-${tokenOpType}` - ); - if (!matchingTokenOp) return; - - const newOp = { - ...ctokenOp, - id: `${a.id}-${ctokenOp.hash}-${type}`, - type, - value: matchingTokenOp.value, - accountId: a.id, - extra: { - compoundValue: ctokenOp.value.toString(10), - rate: rate.toString(10), - }, - }; - newOps.push(newOp); - }); + const rates = await fetchHistoricalRates( + ctoken, + ctokenAccount.operations.map((op) => op.date) + ); + + const newOps = ctokenAccount.operations + .map((op, i) => { + const { rate } = rates[i]; + const value = op.value.times(rate).integerValue(); + const type = cdaiToDaiOpMapping[op.type]; + if (!type) return; + return { + ...op, + id: `${a.id}-${op.hash}-${type}`, + type, + value, + accountId: a.id, + extra: { + compoundValue: op.value.toString(10), + rate: rate.toString(10), + }, + }; + }) + .filter(Boolean); // TODO: for perf, we can be a slightly more conservative and keep refs as much as possible to not have a ref changes above @@ -597,11 +581,11 @@ type HistoRate = { async function fetchHistoricalRates( token, - blockNumbers: number[] + dates: Date[] ): Promise { - const all = await promiseAllBatched(3, blockNumbers, async (blockNumber) => { + const all = await promiseAllBatched(3, dates, async (date) => { const { data } = await fetch("/ctoken", { - block_number: blockNumber, + block_timestamp: Math.round(date.getTime() / 1000), addresses: [token.contractAddress], }); const cToken = data.cToken.find( diff --git a/src/families/polkadot/api/bisontrails.js b/src/families/polkadot/api/bisontrails.js index 862c734861..8c6e8de7c3 100644 --- a/src/families/polkadot/api/bisontrails.js +++ b/src/families/polkadot/api/bisontrails.js @@ -8,6 +8,7 @@ import { encodeOperationId } from "../../../operation"; import { getEnv } from "../../../env"; import { getOperationType } from "./common"; import type { OperationType, Operation } from "../../../types"; +import { isValidAddress } from "../logic"; const LIMIT = 200; @@ -50,6 +51,11 @@ const getWithdrawUnbondedAmount = (extrinsic) => { ); }; +const getController = (_extrinsic) => { + // TODO: ask BisonTrails to provide the info + return ""; +}; + /** * add Extra info for operation details * @@ -93,6 +99,13 @@ const getExtra = (type: OperationType, extrinsic: *): Object => { }; break; + case "SET_CONTROLLER": + extra = { + ...extra, + controller: getController(extrinsic), + }; + break; + case "REWARD_PAYOUT": case "SLASH": extra = { @@ -181,9 +194,9 @@ const extrinsicToOperation = ( date: new Date(extrinsic.timestamp), extra: getExtra(type, extrinsic), senders: [extrinsic.signer], - recipients: [extrinsic.affectedAddress1, extrinsic.affectedAddress2].filter( - Boolean - ), + recipients: [extrinsic.affectedAddress1, extrinsic.affectedAddress2] + .filter(Boolean) + .filter(isValidAddress), transactionSequenceNumber: extrinsic.signer === addr ? extrinsic.nonce : undefined, hasFailed: !extrinsic.isSuccess, diff --git a/src/families/polkadot/api/common.js b/src/families/polkadot/api/common.js index 487583ad0b..750088ca85 100644 --- a/src/families/polkadot/api/common.js +++ b/src/families/polkadot/api/common.js @@ -38,6 +38,9 @@ export const getOperationType = ( case "withdrawUnbonded": return "WITHDRAW_UNBONDED"; + case "setController": + return "SET_CONTROLLER"; + case "payoutStakers": return "FEES"; diff --git a/src/families/polkadot/api/index.js b/src/families/polkadot/api/index.js index cceb6b54a6..0b85c1822b 100644 --- a/src/families/polkadot/api/index.js +++ b/src/families/polkadot/api/index.js @@ -30,6 +30,7 @@ export { verifyValidatorAddresses, getAccount, getTransactionParams, + getMinimumBondBalance, submitExtrinsic, paymentInfo, getValidators, diff --git a/src/families/polkadot/api/sidecar.js b/src/families/polkadot/api/sidecar.js index ea5e14aa33..25c6d463a8 100644 --- a/src/families/polkadot/api/sidecar.js +++ b/src/families/polkadot/api/sidecar.js @@ -4,8 +4,8 @@ import querystring from "querystring"; import { TypeRegistry, ModulesWithCalls } from "@polkadot/types"; import { getSpecTypes } from "@polkadot/types-known"; -import { Metadata } from "@polkadot/metadata"; -import { expandMetadata } from "@polkadot/metadata/decorate"; +import { Metadata } from "@polkadot/types/metadata"; +import { expandMetadata } from "@polkadot/types/metadata/decorate"; import { makeLRUCache } from "../../../cache"; import type { CacheRes } from "../../../cache"; @@ -174,6 +174,23 @@ const fetchActiveEra = async (): Promise => { return data; }; +/** + * Fetch the minimum value allowed for a bond + * + * @async + * @param {string} addr + * + * @returns {string} + */ +export const getMinimumBondBalance = async (): Promise => { + const { data }: { data: SidecarPalletStorageItem } = await network({ + method: "GET", + url: getSidecarUrl(`/pallets/staking/storage/minNominatorBond`), + }); + + return (data.value && BigNumber(data.value)) || BigNumber(0); +}; + /** * Fetch a list of validators with some info and indentity. * It fetches the list providing a status (all, elected, waiting) and/or a list of @@ -665,7 +682,7 @@ export const getConstants: CacheRes, Object> = makeLRUCache( async (): Promise => fetchConstants(), () => "polkadot", { - max: 1, // Store only one constnats object since we only have polkadot. + max: 1, // Store only one constants object since we only have polkadot. maxAge: 60 * 60 * 1000, // 1 hour } ); diff --git a/src/families/polkadot/cache.js b/src/families/polkadot/cache.js index 92b201879d..bbe5091945 100644 --- a/src/families/polkadot/cache.js +++ b/src/families/polkadot/cache.js @@ -1,4 +1,6 @@ // @flow +import { BigNumber } from "bignumber.js"; + import { TypeRegistry, ModulesWithCalls } from "@polkadot/types"; import { makeLRUCache } from "../../cache"; @@ -13,6 +15,7 @@ import { getRegistry as apiGetRegistry, getTransactionParams as apiGetTransactionParams, paymentInfo as apiPaymentInfo, + getMinimumBondBalance as apiGetMinimumBondBalance, } from "./api"; /** @@ -50,6 +53,8 @@ const hashTransactionParams = ( return `${prefix}_${t.numSlashingSpans ?? "0"}`; case "chill": return `${prefix}`; + case "setController": + return `${prefix}`; case "claimReward": return `${prefix}_${t.era || "0"}`; default: @@ -159,3 +164,22 @@ export const isElectionClosed: CacheRes, boolean> = makeLRUCache( maxAge: 60 * 1000, // 1 minute } ); + +/** + * Cache the getMinimumBondBalance to avoid too many calls + * + * @async + * + * @returns {Promise} consts + */ +export const getMinimumBondBalance: CacheRes< + Array, + BigNumber +> = makeLRUCache( + async (): Promise => apiGetMinimumBondBalance(), + () => "polkadot", + { + max: 1, // Store only one object since we only have polkadot. + maxAge: 60 * 60 * 1000, // 1 hour + } +); diff --git a/src/families/polkadot/deviceTransactionConfig.js b/src/families/polkadot/deviceTransactionConfig.js index e28be52ef1..b19c66f98d 100644 --- a/src/families/polkadot/deviceTransactionConfig.js +++ b/src/families/polkadot/deviceTransactionConfig.js @@ -179,6 +179,19 @@ function getDeviceTransactionConfig({ }); break; + case "setController": + fields.push({ + type: "text", + label: "Staking", + value: "Set controller", + }); + fields.push({ + type: "text", + label: "Controller", + value: mainAccount.freshAddress, + }); + break; + case "claimReward": fields.push({ type: "text", diff --git a/src/families/polkadot/js-buildTransaction.js b/src/families/polkadot/js-buildTransaction.js index a48e830495..e02dc445f2 100644 --- a/src/families/polkadot/js-buildTransaction.js +++ b/src/families/polkadot/js-buildTransaction.js @@ -79,6 +79,14 @@ const getExtrinsicParams = (a: Account, t: Transaction) => { args: { numSlashingSpans: a.polkadotResources?.numSlashingSpans || 0 }, }; + case "setController": + // Set the current account as its own controller + return { + pallet: "staking", + name: "setController", + args: { controller: a.freshAddress }, + }; + case "nominate": // Construct a transaction to nominate validators. // Must be signed by the controller, and can be only called when `EraElectionStatus` is `Closed`. diff --git a/src/families/polkadot/js-getTransactionStatus.js b/src/families/polkadot/js-getTransactionStatus.js index a2b4134be6..fbc0a3a88d 100644 --- a/src/families/polkadot/js-getTransactionStatus.js +++ b/src/families/polkadot/js-getTransactionStatus.js @@ -30,15 +30,15 @@ import { import { verifyValidatorAddresses } from "./api"; import { EXISTENTIAL_DEPOSIT, - MINIMUM_BOND_AMOUNT, FEES_SAFETY_BUFFER, isValidAddress, isFirstBond, isController, + isStash, hasLockedBalance, hasMaxUnlockings, calculateAmount, - getMinimalLockedBalance, + getMinimumAmountToBond, getMinimumBalance, } from "./logic"; import { getCurrentPolkadotPreloadData } from "./preload"; @@ -80,7 +80,13 @@ const getSendTransactionStatus = async ( leftover.lt(minimumBalanceExistential) && leftover.gt(0) ) { - errors.amount = new PolkadotDoMaxSendInstead(); + errors.amount = new PolkadotDoMaxSendInstead("", { + minimumBalance: formatCurrencyUnit( + a.currency.units[0], + EXISTENTIAL_DEPOSIT, + { showCode: true } + ), + }); } else if (totalSpent.gt(a.spendableBalance)) { errors.amount = new NotEnoughBalance(); } @@ -120,7 +126,9 @@ const getSendTransactionStatus = async ( const getTransactionStatus = async (a: Account, t: Transaction) => { const errors = {}; const warnings = {}; - const { staking, validators } = getCurrentPolkadotPreloadData(); + const preloaded = getCurrentPolkadotPreloadData(); + const { staking, validators } = preloaded; + const minimumBondBalance = BigNumber(preloaded.minimumBondBalance); if (t.mode === "send") { return await getSendTransactionStatus(a, t); @@ -143,8 +151,20 @@ const getTransactionStatus = async (a: Account, t: Transaction) => { const currentBonded = a.polkadotResources?.lockedBalance.minus(unlockingBalance) || BigNumber(0); + const minimumAmountToBond = getMinimumAmountToBond(a, minimumBondBalance); + switch (t.mode) { case "bond": + if (amount.lt(minimumAmountToBond)) { + errors.amount = new PolkadotBondMinimumAmount("", { + minimumBondAmount: formatCurrencyUnit( + a.currency.units[0], + minimumAmountToBond, + { showCode: true } + ), + }); + } + if (isFirstBond(a)) { // Not a stash yet -> bond method sets the controller if (!t.recipient) { @@ -156,25 +176,6 @@ const getTransactionStatus = async (a: Account, t: Transaction) => { "Recipient is already a controller" ); } - - // If not a stash yet, first bond must respect minimum amount of 1 DOT - if (amount.lt(MINIMUM_BOND_AMOUNT)) { - errors.amount = new PolkadotBondMinimumAmount("", { - minimalAmount: formatCurrencyUnit( - a.currency.units[0], - MINIMUM_BOND_AMOUNT, - { showCode: true } - ), - }); - } - } else if (amount.lt(getMinimalLockedBalance(a))) { - errors.amount = new PolkadotBondMinimumAmount("", { - minimalAmount: formatCurrencyUnit( - a.currency.units[0], - getMinimalLockedBalance(a), - { showCode: true } - ), - }); } break; @@ -191,7 +192,7 @@ const getTransactionStatus = async (a: Account, t: Transaction) => { if (amount.lte(0)) { errors.amount = new AmountRequired(); } else if ( - amount.gt(currentBonded.minus(MINIMUM_BOND_AMOUNT)) && + amount.gt(currentBonded.minus(EXISTENTIAL_DEPOSIT)) && amount.lt(currentBonded) ) { warnings.amount = new PolkadotLowBondedBalance(); @@ -209,11 +210,11 @@ const getTransactionStatus = async (a: Account, t: Transaction) => { errors.amount = new AmountRequired(); } else if (amount.gt(unlockingBalance)) { errors.amount = new NotEnoughBalance(); - } else if (amount.lt(getMinimalLockedBalance(a))) { + } else if (amount.lt(minimumAmountToBond)) { errors.amount = new PolkadotBondMinimumAmount("", { minimalAmount: formatCurrencyUnit( a.currency.units[0], - getMinimalLockedBalance(a), + minimumAmountToBond, { showCode: true } ), }); @@ -271,6 +272,12 @@ const getTransactionStatus = async (a: Account, t: Transaction) => { errors.staking = new PolkadotNoNominations(); } break; + + case "setController": + if (!isStash(a)) { + errors.staking = new PolkadotUnauthorizedOperation(); + } + break; } const estimatedFees = t.fees || BigNumber(0); diff --git a/src/families/polkadot/js-signOperation.js b/src/families/polkadot/js-signOperation.js index fa1e7fe34c..411475c5f8 100644 --- a/src/families/polkadot/js-signOperation.js +++ b/src/families/polkadot/js-signOperation.js @@ -23,6 +23,7 @@ const MODE_TO_TYPE = { withdrawUnbonded: "WITHDRAW_UNBONDED", nominate: "NOMINATE", chill: "CHILL", + setController: "SET_CONTROLLER", claimReward: "REWARD_PAYOUT", default: "FEES", }; @@ -36,6 +37,7 @@ const MODE_TO_PALLET_METHOD = { withdrawUnbonded: "staking.withdrawUnbonded", nominate: "staking.nominate", chill: "staking.chill", + setController: "staking.setController", claimReward: "staking.payoutStakers", }; diff --git a/src/families/polkadot/logic.js b/src/families/polkadot/logic.js index a3c67ab8c2..0592679ff4 100644 --- a/src/families/polkadot/logic.js +++ b/src/families/polkadot/logic.js @@ -4,9 +4,9 @@ import { decodeAddress } from "@polkadot/util-crypto"; import type { Account, OperationType } from "../../types"; import type { Transaction } from "./types"; +import { getCurrentPolkadotPreloadData } from "./preload"; export const EXISTENTIAL_DEPOSIT = BigNumber(10000000000); -export const MINIMUM_BOND_AMOUNT = BigNumber(10000000000); export const MAX_NOMINATIONS = 16; export const MAX_UNLOCKINGS = 32; export const PRELOAD_MAX_AGE = 60 * 1000; @@ -86,19 +86,35 @@ export const canBond = (a: Account): boolean => { }; /** - * Get the minimum bond amount required to rebond + * Get the minimum bond amount required to bond/rebond * * @param {Account} a */ -export const getMinimalLockedBalance = (a: Account): BigNumber => { - const remainingActiveLockedBalance = calculateMaxUnbond(a); +export const getMinimumAmountToBond = ( + a: Account, + minimumBondBalance: ?BigNumber +): BigNumber => { + const currentlyBondedBalance = calculateMaxUnbond(a); - if (remainingActiveLockedBalance.lt(MINIMUM_BOND_AMOUNT)) { - return MINIMUM_BOND_AMOUNT.minus(remainingActiveLockedBalance); + if (minimumBondBalance && currentlyBondedBalance.lt(minimumBondBalance)) { + return minimumBondBalance.minus(currentlyBondedBalance); } return BigNumber(0); }; +/** + * Return true if the account has at least the current minimum bonded balance required by the network + * + * @param {Account} a + */ +export const hasMinimumBondBalance = (a: Account): boolean => { + const { minimumBondBalance } = getCurrentPolkadotPreloadData(); + return ( + !a.polkadotResources || + a.polkadotResources.lockedBalance.gte(BigNumber(minimumBondBalance)) + ); +}; + /** * Return true if some operation with type is pending and not yet synchronized * diff --git a/src/families/polkadot/preload.js b/src/families/polkadot/preload.js index b16534d018..28e2fa552a 100644 --- a/src/families/polkadot/preload.js +++ b/src/families/polkadot/preload.js @@ -5,13 +5,14 @@ import { Observable, Subject } from "rxjs"; import { log } from "@ledgerhq/logs"; import { PRELOAD_MAX_AGE } from "./logic"; -import { getRegistry } from "./cache"; +import { getRegistry, getMinimumBondBalance } from "./cache"; import type { PolkadotPreloadData, PolkadotValidator } from "./types"; import { getStakingProgress, getValidators } from "./validators"; let currentPolkadotPreloadedData: PolkadotPreloadData = { validators: [], staking: null, + minimumBondBalance: "0", }; function fromHydrateValidator(validatorRaw: Object): PolkadotValidator { @@ -34,6 +35,7 @@ function fromHydrateValidator(validatorRaw: Object): PolkadotValidator { function fromHydratePreloadData(data: mixed): PolkadotPreloadData { let validators = []; let staking = null; + let minimumBondBalance = "0"; if (typeof data === "object" && data) { if (Array.isArray(data.validators)) { @@ -56,11 +58,19 @@ function fromHydratePreloadData(data: mixed): PolkadotPreloadData { bondingDuration: Number(bondingDuration) || 28, }; } + + if ( + data.minimumBondBalance !== null && + typeof data.minimumBondBalance === "string" + ) { + minimumBondBalance = data.minimumBondBalance || "0"; + } } return { validators, staking, + minimumBondBalance, }; } @@ -96,6 +106,8 @@ const shouldRefreshValidators = (previousState, currentState) => { export const preload = async (): Promise => { await getRegistry(); // ensure registry is already in cache. const currentStakingProgress = await getStakingProgress(); + const minimumBondBalance = await getMinimumBondBalance(); + const minimumBondBalanceStr = minimumBondBalance.toString(); const { validators: previousValidators, @@ -120,6 +132,7 @@ export const preload = async (): Promise => { return { validators, staking: currentStakingProgress, + minimumBondBalance: minimumBondBalanceStr, }; }; diff --git a/src/families/polkadot/specs.js b/src/families/polkadot/specs.js index 012fc7be0c..a3cd6450ef 100644 --- a/src/families/polkadot/specs.js +++ b/src/families/polkadot/specs.js @@ -15,7 +15,7 @@ import { canUnbond, canNominate, isFirstBond, - getMinimalLockedBalance, + getMinimumAmountToBond, } from "../../families/polkadot/logic"; const currency = getCryptoCurrencyById("polkadot"); @@ -82,8 +82,11 @@ const polkadot: AppSpec = { maxRun: 2, transaction: ({ account, bridge }) => { invariant(canBond(account), "can't bond"); + const { minimumBondBalance } = getCurrentPolkadotPreloadData(); invariant( - BigNumber(100000).gt(getMinimalLockedBalance(account)), + BigNumber(100000).gt( + getMinimumAmountToBond(account, BigNumber(minimumBondBalance)) + ), "can't bond because too much unbond" ); const { polkadotResources } = account; diff --git a/src/families/polkadot/test-dataset.js b/src/families/polkadot/test-dataset.js index fbab1fa58b..2a7278056e 100644 --- a/src/families/polkadot/test-dataset.js +++ b/src/families/polkadot/test-dataset.js @@ -482,6 +482,7 @@ const dataset: DatasetTest = { }, ], }, + // TODO: Write a setController test { raw: { id: `js:2:polkadot:${ACCOUNT_CONTROLLER}:polkadotbip44`, diff --git a/src/families/polkadot/types.js b/src/families/polkadot/types.js index 9a21c54fd3..5027ed511a 100644 --- a/src/families/polkadot/types.js +++ b/src/families/polkadot/types.js @@ -113,6 +113,7 @@ export type PolkadotStakingProgress = {| export type PolkadotPreloadData = {| validators: PolkadotValidator[], staking: PolkadotStakingProgress | null, + minimumBondBalance: string, |}; export type PolkadotSearchFilter = ( diff --git a/src/generated/account.js b/src/generated/account.js index 028dab9852..ea939514eb 100644 --- a/src/generated/account.js +++ b/src/generated/account.js @@ -2,6 +2,7 @@ import algorand from "../families/algorand/account.js"; import bitcoin from "../families/bitcoin/account.js"; import cosmos from "../families/cosmos/account.js"; +import crypto_org from "../families/crypto_org/account.js"; import elrond from "../families/elrond/account.js"; import polkadot from "../families/polkadot/account.js"; @@ -9,6 +10,7 @@ export default { algorand, bitcoin, cosmos, + crypto_org, elrond, polkadot, }; diff --git a/src/generated/bridge/js.js b/src/generated/bridge/js.js index b4edc5922c..77fa3f77e7 100644 --- a/src/generated/bridge/js.js +++ b/src/generated/bridge/js.js @@ -1,4 +1,5 @@ // @flow +import crypto_org from "../../families/crypto_org/bridge/js.js"; import elrond from "../../families/elrond/bridge/js.js"; import ethereum from "../../families/ethereum/bridge/js.js"; import neo from "../../families/neo/bridge/js.js"; @@ -8,6 +9,7 @@ import stellar from "../../families/stellar/bridge/js.js"; import tron from "../../families/tron/bridge/js.js"; export default { + crypto_org, elrond, ethereum, neo, diff --git a/src/generated/cli-transaction.js b/src/generated/cli-transaction.js index 389975c980..55ab51a85b 100644 --- a/src/generated/cli-transaction.js +++ b/src/generated/cli-transaction.js @@ -2,6 +2,7 @@ import algorand from "../families/algorand/cli-transaction.js"; import bitcoin from "../families/bitcoin/cli-transaction.js"; import cosmos from "../families/cosmos/cli-transaction.js"; +import crypto_org from "../families/crypto_org/cli-transaction.js"; import elrond from "../families/elrond/cli-transaction.js"; import ethereum from "../families/ethereum/cli-transaction.js"; import polkadot from "../families/polkadot/cli-transaction.js"; @@ -14,6 +15,7 @@ export default { algorand, bitcoin, cosmos, + crypto_org, elrond, ethereum, polkadot, diff --git a/src/generated/hw-getAddress.js b/src/generated/hw-getAddress.js index 1f5e7eb782..3049a30c3f 100644 --- a/src/generated/hw-getAddress.js +++ b/src/generated/hw-getAddress.js @@ -2,6 +2,7 @@ import algorand from "../families/algorand/hw-getAddress.js"; import bitcoin from "../families/bitcoin/hw-getAddress.js"; import cosmos from "../families/cosmos/hw-getAddress.js"; +import crypto_org from "../families/crypto_org/hw-getAddress.js"; import elrond from "../families/elrond/hw-getAddress.js"; import ethereum from "../families/ethereum/hw-getAddress.js"; import neo from "../families/neo/hw-getAddress.js"; @@ -15,6 +16,7 @@ export default { algorand, bitcoin, cosmos, + crypto_org, elrond, ethereum, neo, diff --git a/src/generated/transaction.js b/src/generated/transaction.js index 0e8de21e1d..9702af533b 100644 --- a/src/generated/transaction.js +++ b/src/generated/transaction.js @@ -2,6 +2,7 @@ import algorand from "../families/algorand/transaction.js"; import bitcoin from "../families/bitcoin/transaction.js"; import cosmos from "../families/cosmos/transaction.js"; +import crypto_org from "../families/crypto_org/transaction.js"; import elrond from "../families/elrond/transaction.js"; import ethereum from "../families/ethereum/transaction.js"; import neo from "../families/neo/transaction.js"; @@ -15,6 +16,7 @@ export default { algorand, bitcoin, cosmos, + crypto_org, elrond, ethereum, neo, diff --git a/src/generated/types.js b/src/generated/types.js index a0cefb2501..36db3a4b6b 100644 --- a/src/generated/types.js +++ b/src/generated/types.js @@ -24,6 +24,15 @@ import type { Transaction as cosmosTransaction } from "../families/cosmos/types" import type { TransactionRaw as cosmosTransactionRaw } from "../families/cosmos/types"; import type { NetworkInfo as cosmosNetworkInfo } from "../families/cosmos/types"; import type { NetworkInfoRaw as cosmosNetworkInfoRaw } from "../families/cosmos/types"; +import { reflect as crypto_orgReflect } from "../families/crypto_org/types"; +import type { CoreStatics as CoreStatics_crypto_org } from "../families/crypto_org/types"; +import type { CoreAccountSpecifics as CoreAccountSpecifics_crypto_org } from "../families/crypto_org/types"; +import type { CoreOperationSpecifics as CoreOperationSpecifics_crypto_org } from "../families/crypto_org/types"; +import type { CoreCurrencySpecifics as CoreCurrencySpecifics_crypto_org } from "../families/crypto_org/types"; +import type { Transaction as crypto_orgTransaction } from "../families/crypto_org/types"; +import type { TransactionRaw as crypto_orgTransactionRaw } from "../families/crypto_org/types"; +import type { NetworkInfo as crypto_orgNetworkInfo } from "../families/crypto_org/types"; +import type { NetworkInfoRaw as crypto_orgNetworkInfoRaw } from "../families/crypto_org/types"; import { reflect as elrondReflect } from "../families/elrond/types"; import type { CoreStatics as CoreStatics_elrond } from "../families/elrond/types"; import type { CoreAccountSpecifics as CoreAccountSpecifics_elrond } from "../families/elrond/types"; @@ -99,6 +108,7 @@ export type SpecificStatics = {} & CoreStatics_algorand & CoreStatics_bitcoin & CoreStatics_cosmos +& CoreStatics_crypto_org & CoreStatics_elrond & CoreStatics_ethereum & CoreStatics_neo @@ -111,6 +121,7 @@ export type CoreAccountSpecifics = {} & CoreAccountSpecifics_algorand & CoreAccountSpecifics_bitcoin & CoreAccountSpecifics_cosmos +& CoreAccountSpecifics_crypto_org & CoreAccountSpecifics_elrond & CoreAccountSpecifics_ethereum & CoreAccountSpecifics_neo @@ -123,6 +134,7 @@ export type CoreOperationSpecifics = {} & CoreOperationSpecifics_algorand & CoreOperationSpecifics_bitcoin & CoreOperationSpecifics_cosmos +& CoreOperationSpecifics_crypto_org & CoreOperationSpecifics_elrond & CoreOperationSpecifics_ethereum & CoreOperationSpecifics_neo @@ -135,6 +147,7 @@ export type CoreCurrencySpecifics = {} & CoreCurrencySpecifics_algorand & CoreCurrencySpecifics_bitcoin & CoreCurrencySpecifics_cosmos +& CoreCurrencySpecifics_crypto_org & CoreCurrencySpecifics_elrond & CoreCurrencySpecifics_ethereum & CoreCurrencySpecifics_neo @@ -147,6 +160,7 @@ export type Transaction = | algorandTransaction | bitcoinTransaction | cosmosTransaction + | crypto_orgTransaction | elrondTransaction | ethereumTransaction | neoTransaction @@ -159,6 +173,7 @@ export type TransactionRaw = | algorandTransactionRaw | bitcoinTransactionRaw | cosmosTransactionRaw + | crypto_orgTransactionRaw | elrondTransactionRaw | ethereumTransactionRaw | neoTransactionRaw @@ -170,6 +185,7 @@ export type TransactionRaw = export type NetworkInfo = | bitcoinNetworkInfo | cosmosNetworkInfo + | crypto_orgNetworkInfo | elrondNetworkInfo | ethereumNetworkInfo | neoNetworkInfo @@ -180,6 +196,7 @@ export type NetworkInfo = export type NetworkInfoRaw = | bitcoinNetworkInfoRaw | cosmosNetworkInfoRaw + | crypto_orgNetworkInfoRaw | elrondNetworkInfoRaw | ethereumNetworkInfoRaw | neoNetworkInfoRaw @@ -191,6 +208,7 @@ export const reflectSpecifics = (declare: *) => [ algorandReflect(declare), bitcoinReflect(declare), cosmosReflect(declare), + crypto_orgReflect(declare), elrondReflect(declare), ethereumReflect(declare), neoReflect(declare), diff --git a/src/hw/actions/app.js b/src/hw/actions/app.js index 3d939e4a10..2c19fe9500 100644 --- a/src/hw/actions/app.js +++ b/src/hw/actions/app.js @@ -76,6 +76,7 @@ export type AppRequest = { account?: ?Account, tokenCurrency?: ?TokenCurrency, dependencies?: AppRequest[], + requireLatestFirmware?: boolean, }; export type AppResult = {| @@ -299,10 +300,9 @@ function inferCommandParams(appRequest: AppRequest) { let derivationMode; let derivationPath; - let appName = appRequest.appName; - const account = appRequest.account; - let currency = appRequest.currency; - let dependencies = appRequest.dependencies; + const { account } = appRequest; + let { appName, currency, dependencies, requireLatestFirmware } = appRequest; + if (!currency && account) { currency = account.currency; } @@ -317,7 +317,7 @@ function inferCommandParams(appRequest: AppRequest) { } if (!currency) { - return { appName, dependencies }; + return { appName, dependencies, requireLatestFirmware }; } let extra; @@ -341,6 +341,7 @@ function inferCommandParams(appRequest: AppRequest) { return { appName, dependencies, + requireLatestFirmware, requiresDerivation: { derivationMode, path: derivationPath, @@ -478,6 +479,7 @@ export const createAction = ( ): AppAction => { const useHook = (device: ?Device, appRequest: AppRequest): AppState => { const dependenciesResolvedRef = useRef(false); + const latestFirmwareResolvedRef = useRef(false); const connectApp = useCallback( (device, params) => @@ -490,10 +492,15 @@ export const createAction = ( dependencies: dependenciesResolvedRef.current ? undefined : params.dependencies, + requireLatestFirmware: latestFirmwareResolvedRef.current + ? undefined + : params.requireLatestFirmware, }).pipe( tap((e) => { if (e.type === "dependencies-resolved") { dependenciesResolvedRef.current = true; + } else if (e.type === "latest-firmware-resolved") { + latestFirmwareResolvedRef.current = true; } }), catchError((error: Error) => of({ type: "error", error })) diff --git a/src/hw/actions/initSwap.js b/src/hw/actions/initSwap.js index 31c9258395..931c11831d 100644 --- a/src/hw/actions/initSwap.js +++ b/src/hw/actions/initSwap.js @@ -36,6 +36,8 @@ type InitSwapRequest = { exchange: Exchange, exchangeRate: ExchangeRate, transaction: Transaction, + userId?: string, + requireLatestFirmware?: boolean, }; type Result = @@ -116,7 +118,14 @@ export const createAction = ( state.freezeReduxDevice ); - const { exchange, exchangeRate, transaction } = initSwapRequest; + const { + exchange, + exchangeRate, + transaction, + userId, + requireLatestFirmware, + } = initSwapRequest; + const { fromAccount, fromParentAccount, @@ -133,6 +142,7 @@ export const createAction = ( { account: mainFromAccount }, { account: maintoAccount }, ], + requireLatestFirmware, } ); @@ -153,6 +163,7 @@ export const createAction = ( exchangeRate, transaction, deviceId: device.deviceId, + userId, }) ) .pipe( @@ -172,7 +183,7 @@ export const createAction = ( return () => { sub.unsubscribe(); }; - }, [exchange, exchangeRate, transaction, device, opened, hasError]); + }, [exchange, exchangeRate, transaction, device, opened, hasError, userId]); return { ...appState, diff --git a/src/hw/connectApp.js b/src/hw/connectApp.js index 14e6965d21..4c4726a5c9 100644 --- a/src/hw/connectApp.js +++ b/src/hw/connectApp.js @@ -1,7 +1,8 @@ // @flow +import semver from "semver"; import { Observable, concat, from, of, throwError, defer } from "rxjs"; -import { concatMap, map, catchError, delay } from "rxjs/operators"; +import { mergeMap, concatMap, map, catchError, delay } from "rxjs/operators"; import { TransportStatusError, FirmwareOrAppUpdateRequired, @@ -14,16 +15,20 @@ import { import Transport from "@ledgerhq/hw-transport"; import type { DeviceModelId } from "@ledgerhq/devices"; import type { DerivationMode } from "../types"; +import type { DeviceInfo, FirmwareUpdateContext } from "../types/manager"; import { getCryptoCurrencyById } from "../currencies"; import appSupportsQuitApp from "../appSupportsQuitApp"; import { withDevice } from "./deviceAccess"; import { streamAppInstall } from "../apps/hw"; import { isDashboardName } from "./isDashboardName"; import getAppAndVersion from "./getAppAndVersion"; +import getDeviceInfo from "./getDeviceInfo"; import getAddress from "./getAddress"; import openApp from "./openApp"; import quitApp from "./quitApp"; +import { LatestFirmwareVersionRequired } from "../errors"; import { mustUpgrade } from "../apps"; +import manager from "../manager"; export type RequiresDerivation = {| currencyId: string, @@ -38,6 +43,7 @@ export type Input = { appName: string, requiresDerivation?: RequiresDerivation, dependencies?: string[], + requireLatestFirmware?: boolean, }; export type AppAndVersion = { @@ -58,6 +64,7 @@ export type ConnectAppEvent = | { type: "stream-install", progress: number } | { type: "listing-apps" } | { type: "dependencies-resolved" } + | { type: "latest-firmware-resolved" } | { type: "ask-quit-app" } | { type: "ask-open-app", appName: string } | { type: "opened", app?: AppAndVersion, derivation?: { address: string } } @@ -160,6 +167,7 @@ const cmd = ({ appName, requiresDerivation, dependencies, + requireLatestFirmware, }: Input): Observable => withDevice(devicePath)((transport) => Observable.create((o) => { @@ -167,12 +175,45 @@ const cmd = ({ .pipe(delay(1000)) .subscribe((e) => o.next(e)); - const innerSub = ({ appName, dependencies }: any) => + const innerSub = ({ + appName, + dependencies, + requireLatestFirmware, + }: any) => defer(() => from(getAppAndVersion(transport))).pipe( concatMap((appAndVersion): Observable => { timeoutSub.unsubscribe(); if (isDashboardName(appAndVersion.name)) { + // check if we meet minimum fw + if (requireLatestFirmware) { + return from(getDeviceInfo(transport)).pipe( + mergeMap((deviceInfo: DeviceInfo) => + from(manager.getLatestFirmwareForDevice(deviceInfo)).pipe( + mergeMap((latest: ?FirmwareUpdateContext) => { + if ( + !latest || + semver.eq(deviceInfo.version, latest.final.version) + ) { + o.next({ type: "latest-firmware-resolved" }); + return innerSub({ appName }); // NB without the fw version check + } else { + return throwError( + new LatestFirmwareVersionRequired( + "LatestFirmwareVersionRequired", + { + latest: latest.final.version, + current: deviceInfo.version, + } + ) + ); + } + }) + ) + ) + ); + } + // check if we meet dependencies if (dependencies?.length) { return streamAppInstall({ @@ -188,7 +229,12 @@ const cmd = ({ return openAppFromDashboard(transport, appName); } - if (dependencies?.length || appAndVersion.name !== appName) { + // in order to check the fw version, install deps, we need dashboard + if ( + dependencies?.length || + requireLatestFirmware || + appAndVersion.name !== appName + ) { return attemptToQuitApp(transport, appAndVersion); } @@ -242,7 +288,11 @@ const cmd = ({ return throwError(e); }) ); - const sub = innerSub({ appName, dependencies }).subscribe(o); + const sub = innerSub({ + appName, + dependencies, + requireLatestFirmware, + }).subscribe(o); return () => { timeoutSub.unsubscribe(); diff --git a/src/operation.js b/src/operation.js index 06c1b8383c..35039040cb 100644 --- a/src/operation.js +++ b/src/operation.js @@ -99,6 +99,7 @@ export function getOperationAmountNumber(op: Operation): BigNumber { case "BOND": case "UNBOND": case "WITHDRAW_UNBONDED": + case "SET_CONTROLLER": case "NOMINATE": case "CHILL": return op.fee.negated(); diff --git a/src/platform/CatalogProvider.js b/src/platform/CatalogProvider.js new file mode 100644 index 0000000000..8bbc4df1e7 --- /dev/null +++ b/src/platform/CatalogProvider.js @@ -0,0 +1,92 @@ +// @flow + +import React, { useContext, useEffect, useMemo, useState } from "react"; + +import type { AppManifest, AppBranch, AppPlatform } from "./types"; +import { isSupported, matchPlatform, matchBranches } from "./logic"; + +import api from "./api"; + +type State = { + apps: AppManifest[], +}; + +type Props = { + children: React$Node, +}; + +const initialState = { + apps: [], +}; + +export const PlatformCatalogContext = React.createContext(initialState); + +const PlatformCatalogProvider = ({ children }: Props) => { + const [state, setState] = useState(initialState); + + useEffect(() => { + api.fetchManifest().then((manifest) => setState({ apps: manifest })); + }, []); + + return ( + + {children} + + ); +}; + +export const usePlatformManifests = () => { + const context = useContext(PlatformCatalogContext); + if (context === undefined) { + throw new Error( + "usePlatformManifests must be used within a PlatformCatalogContext" + ); + } + + return context; +}; + +export const useCatalog = ( + platform: AppPlatform = "all", + branches?: AppBranch[] = ["stable"] +) => { + const context = useContext(PlatformCatalogContext); + if (context === undefined) { + throw new Error("useCatalog must be used within a PlatformCatalogContext"); + } + + const apps = useMemo( + (): AppManifest[] => + context.apps.filter( + (manifest) => + matchPlatform(manifest, platform) && + (!branches || matchBranches(manifest, branches)) && + isSupported(manifest) && + !manifest.private + ), + [context.apps, branches, platform] + ); + + return { + ...context, + apps, + }; +}; + +export const useAppManifest = (platformId: string) => { + const context = useContext(PlatformCatalogContext); + if (context === undefined) { + throw new Error( + "useAppManifest must be used within a PlatformCatalogContext" + ); + } + + const manifest = useMemo( + () => context.apps.find((app) => app.id === platformId), + [context.apps, platformId] + ); + + return manifest; +}; + +export default PlatformCatalogProvider; diff --git a/src/platform/PlatformAppProvider/api/api.js b/src/platform/PlatformAppProvider/api/api.js new file mode 100644 index 0000000000..2ecee2ed47 --- /dev/null +++ b/src/platform/PlatformAppProvider/api/api.js @@ -0,0 +1,30 @@ +// @flow + +import { getEnv } from "../../../env"; +import network from "../../../network"; +import type { AppManifest, PlatformApi } from "../../types"; + +// expose a function to fetch data from the cdn (data from ledger-live-assets) +// https://cdn.live.ledger.com/ + +const basePlatformUrl = () => getEnv("PLATFORM_API_URL"); +const platformVersion = () => getEnv("PLATFORM_API_VERSION"); + +async function fetchManifest(): Promise { + const url = `${basePlatformUrl()}/v${platformVersion()}/data.json?t=${Date.now()}`; + + const { data } = await network({ + method: "GET", + headers: { + Origin: "http://localhost:3000", + }, + url, + }); + return data; +} + +const api: PlatformApi = { + fetchManifest, +}; + +export default api; diff --git a/src/platform/PlatformAppProvider/api/api.mock.js b/src/platform/PlatformAppProvider/api/api.mock.js new file mode 100644 index 0000000000..3c6672e1a3 --- /dev/null +++ b/src/platform/PlatformAppProvider/api/api.mock.js @@ -0,0 +1,295 @@ +// @flow +import type { AppManifest, PlatformApi } from "../../types"; + +const manifest: AppManifest[] = [ + { + id: "paraswap", + name: "ParaSwap", + url: + "https://ledger-live-platform-apps.vercel.app/app/dapp-browser?url=https%3A%2F%2Fparaswap.io%2F%3Fembed%3Dtrue%26referrer%3Dledger2&nanoApp=Paraswap&dappName=ParaSwap", + homepageUrl: "https://paraswap.io", + supportUrl: "https://paraswap.io", + icon: "https://cdn.live.ledger.com/icons/platform/paraswap.png", + platform: "all", + apiVersion: "0.0.1", + manifestVersion: "1", + branch: "stable", + params: ["accountId"], + categories: ["swap", "defi"], + currencies: ["ethereum"], + content: { + shortDescription: { + en: + "Swap your crypto with ParaSwap that aggregates and provides the best quotes decentralised exchanges.", + }, + description: { + en: + "Swap your crypto with ParaSwap that aggregates and provides the best quotes decentralised exchanges.", + }, + }, + permissions: [ + { + method: "account.list", + params: { + currencies: ["ethereum"], + }, + }, + { + method: "account.request", + params: { + currencies: ["ethereum"], + }, + }, + { + method: "transaction.sign", + params: { + nanoApp: ["paraswap"], + }, + }, + { + method: "transaction.broadcast", + }, + ], + domains: ["https://*"], + }, + { + id: "wyre_buy", + name: "Wyre", + url: "https://ledger-live-platform-apps.vercel.app/app/wyre", + homepageUrl: "https://www.sendwyre.com/", + icon: "https://cdn.live.ledger.com/icons/platform/wyre.png", + platform: "all", + apiVersion: "0.0.1", + manifestVersion: "1", + branch: "stable", + categories: ["exchange", "buy"], + currencies: ["ethereum", "bitcoin"], + content: { + shortDescription: { + en: + "Purchase Bitcoin, Ethereum and more crypto with Wyre, only available to our US customers.", + }, + description: { + en: + "Purchase Bitcoin, Ethereum and more crypto with Wyre, only available to our US customers.", + }, + }, + permissions: [ + { + method: "account.request", + params: { + currencies: ["ethereum", "bitcoin"], + }, + }, + ], + domains: ["https://*"], + }, + { + id: "zerion", + name: "Zerion", + url: + "https://ledger-live-platform-apps.vercel.app/app/dapp-browser?dappName=Zerion&nanoApp=Paraswap&url=https%3A%2F%2Fapp.zerion.io%2F%3Fembed%3Dledgerdappbrowser", + homepageUrl: "https://zerion.io/", + icon: "https://cdn.live.ledger.com/icons/platform/zerion.png", + platform: "all", + apiVersion: "0.0.1", + manifestVersion: "1", + branch: "stable", + categories: ["portfolio", "defi"], + currencies: ["ethereum"], + content: { + shortDescription: { + en: "The smart way to manage your DeFi portfolio.", + }, + description: { + en: "The smart way to manage your DeFi portfolio.", + }, + }, + permissions: [], + domains: ["https://*"], + }, + { + id: "rainbow", + name: "Rainbow.me", + url: + "https://ledger-live-platform-apps.vercel.app/app/web-browser?url=https%3A%2F%2Frainbow.me%2F%7Baccount.address%7D¤cies=ethereum&webAppName=Rainbow.me", + homepageUrl: "https://rainbow.me", + icon: "https://cdn.live.ledger.com/icons/platform/rainbow.png", + platform: "all", + apiVersion: "0.0.1", + manifestVersion: "1", + branch: "stable", + categories: ["nft"], + currencies: ["ethereum"], + content: { + shortDescription: { + en: "An easy way to visualize the NFT secured by your hardware wallet.", + }, + description: { + en: "An easy way to visualize the NFT secured by your hardware wallet.", + }, + }, + permissions: [], + domains: ["https://*"], + }, + { + id: "aave", + name: "Aave", + url: "", + homepageUrl: "https://aave.com/", + icon: "https://cdn.live.ledger.com/icons/platform/aave.png", + platform: "all", + apiVersion: "0.0.1", + manifestVersion: "1", + branch: "soon", + categories: ["lend"], + currencies: ["ethereum"], + content: { + shortDescription: { + en: + "Lend or Borrow your crypto through a liquidity market protocol and stay in control of your funds.", + }, + description: { + en: + "Lend or Borrow your crypto through a liquidity market protocol and stay in control of your funds.", + }, + }, + permissions: [], + domains: [], + }, + { + id: "compound", + name: "Compound", + url: "", + homepageUrl: "https://compound.finance/", + icon: "https://cdn.live.ledger.com/icons/platform/compound.png", + platform: "all", + apiVersion: "0.0.1", + manifestVersion: "1", + branch: "soon", + categories: ["lend", "compound"], + currencies: ["ethereum"], + content: { + shortDescription: { + en: + "Lend or Borrow your crypto via a completely decentralized and open-source protocol.", + }, + description: { + en: + "Lend or Borrow your crypto via a completely decentralized and open-source protocol.", + }, + }, + permissions: [], + domains: [], + }, + { + id: "deversifi", + name: "DeversiFi", + url: "", + homepageUrl: "https://www.deversifi.com/", + icon: "https://cdn.live.ledger.com/icons/platform/deversifi.png", + platform: "all", + apiVersion: "0.0.1", + manifestVersion: "1", + branch: "soon", + categories: ["dex"], + currencies: ["ethereum"], + content: { + shortDescription: { + en: + "Trade through a self-custody decentralized exchange on Ethereum layer-2.", + }, + description: { + en: + "Trade through a self-custody decentralized exchange on Ethereum layer-2.", + }, + }, + permissions: [], + domains: [], + }, + { + id: "1inch", + name: "1Inch", + url: "", + homepageUrl: "https://1inch.io/", + icon: "https://cdn.live.ledger.com/icons/platform/1inch.png", + platform: "all", + apiVersion: "0.0.1", + manifestVersion: "1", + branch: "soon", + categories: ["swap", "defi"], + currencies: ["ethereum"], + content: { + shortDescription: { + en: "Exchange crypto via a Defi/DEX aggregator on Ethereum.", + }, + description: { + en: "Exchange crypto via a Defi/DEX aggregator on Ethereum.", + }, + }, + permissions: [], + domains: [], + }, + { + id: "lido", + name: "Lido", + url: "", + homepageUrl: "https://lido.fi/", + icon: "https://cdn.live.ledger.com/icons/platform/lido.png", + platform: "all", + apiVersion: "0.0.1", + manifestVersion: "1", + branch: "soon", + categories: ["staking", "defi"], + currencies: ["ethereum"], + content: { + shortDescription: { + en: "Stake any amount of Eth to Eth2 and earn daily staking rewards.", + }, + description: { + en: "Stake any amount of Eth to Eth2 and earn daily staking rewards.", + }, + }, + permissions: [], + domains: [], + }, + { + id: "debug", + name: "Debugger", + url: "https://ledger-live-platform-apps.vercel.app/app/debug", + homepageUrl: "https://developers.ledger.com/", + icon: "https://cdn.live.ledger.com/icons/platform/debugger.png", + platform: "all", + apiVersion: "0.0.1", + manifestVersion: "1", + branch: "debug", + categories: ["tools"], + currencies: "*", + content: { + shortDescription: { + en: + "Try out the Ledger Live API to test capabilities of our platform integration solution. Use at your own risk.", + }, + description: { + en: + "Try out the Ledger Live API to test capabilities of our platform integration solution. Use at your own risk.", + }, + }, + permissions: [ + { + method: "*", + }, + ], + domains: ["https://*"], + }, +]; + +async function fetchManifest(): Promise { + return Promise.resolve(manifest); +} + +const api: PlatformApi = { + fetchManifest, +}; + +export default api; diff --git a/src/platform/PlatformAppProvider/api/index.js b/src/platform/PlatformAppProvider/api/index.js new file mode 100644 index 0000000000..499afee68e --- /dev/null +++ b/src/platform/PlatformAppProvider/api/index.js @@ -0,0 +1,15 @@ +// @flow + +import { getEnv } from "../../../env"; +import type { PlatformApi } from "../../types"; +import prodApi from "./api"; +import mockApi from "./api.mock"; + +const api: PlatformApi = { + fetchManifest: () => + getEnv("MOCK") || !getEnv("PLATFORM_API_URL") + ? mockApi.fetchManifest() + : prodApi.fetchManifest(), +}; + +export default api; diff --git a/src/platform/PlatformAppProvider/helpers.js b/src/platform/PlatformAppProvider/helpers.js new file mode 100644 index 0000000000..bffb78489b --- /dev/null +++ b/src/platform/PlatformAppProvider/helpers.js @@ -0,0 +1,58 @@ +// @flow + +import type { AppManifest } from "../types"; +import semver from "semver"; + +export type FilterParams = { + branches?: string[], + platform?: string, + private?: boolean, + version?: string, +}; + +function matchVersion(filterParams: FilterParams, manifest: AppManifest) { + return ( + !filterParams.version || + semver.satisfies(semver.coerce(filterParams.version), manifest.apiVersion) + ); +} + +function matchBranches(filterParams: FilterParams, manifest: AppManifest) { + return ( + !filterParams.branches || filterParams.branches.includes(manifest.branch) + ); +} + +function matchPlatform(filterParams: FilterParams, manifest: AppManifest) { + return ( + !filterParams.platform || + filterParams.platform === "all" || + filterParams.platform === manifest.platform + ); +} + +function matchPrivate(filterParams: FilterParams, manifest: AppManifest) { + return filterParams.private === true || !(manifest.private === true); +} + +export function filterPlatformApps( + appManifests: AppManifest[], + filterParams: FilterParams +): AppManifest[] { + return appManifests.filter((appManifest: AppManifest) => { + return ( + matchBranches(filterParams, appManifest) && + matchPlatform(filterParams, appManifest) && + matchPrivate(filterParams, appManifest) && + matchVersion(filterParams, appManifest) + ); + }); +} + +export function mergeManifestLists( + list1: AppManifest[], + list2: AppManifest[] +): AppManifest[] { + const newIds = new Set(list2.map((elem) => elem.id)); + return [...list1.filter((elem) => !newIds.has(elem.id)), ...list2]; +} diff --git a/src/platform/PlatformAppProvider/index.js b/src/platform/PlatformAppProvider/index.js new file mode 100644 index 0000000000..720c1f77bb --- /dev/null +++ b/src/platform/PlatformAppProvider/index.js @@ -0,0 +1,96 @@ +// @flow + +import React, { + createContext, + useCallback, + useMemo, + useState, + useEffect, + useContext, +} from "react"; +import type { PlatformAppContextType, Props, State } from "./types"; +import api from "./api"; +import { mergeManifestLists } from "./helpers"; + +//$FlowFixMe +const PlatformAppContext = createContext({}); + +const initialState: State = { + manifests: [], + manifestById: {}, + isLoading: false, + lastUpdateTime: undefined, + error: undefined, +}; + +const AUTO_UPDATE_DEFAULT_DELAY = 1800 * 1000; // 1800 seconds + +export function usePlatformApp(): PlatformAppContextType { + return useContext(PlatformAppContext); +} + +export function PlatformAppProvider({ + autoUpdateDelay, + extraManifests, + children, +}: Props) { + const [state, setState] = useState(initialState); + + const updateData = useCallback(async () => { + try { + setState((previousState) => ({ + ...previousState, + isLoading: true, + })); + const manifests = await api.fetchManifest(); + const allManifests = extraManifests + ? mergeManifestLists(manifests, extraManifests) + : manifests; + setState((previousState) => ({ + ...previousState, + manifests: allManifests, + manifestById: allManifests.reduce((acc, manifest) => { + acc[manifest.id] = manifest; + return acc; + }, {}), + isLoading: false, + lastUpdateTime: Date.now(), + error: undefined, + })); + } catch (error) { + setState((previousState) => ({ + ...previousState, + isLoading: false, + error, + })); + } + }, [extraManifests]); + + useEffect(() => { + updateData(); + }, [updateData]); + + useEffect(() => { + const intervalInstance = setInterval( + updateData, + autoUpdateDelay !== undefined + ? autoUpdateDelay + : AUTO_UPDATE_DEFAULT_DELAY + ); + return () => clearInterval(intervalInstance); + }, [autoUpdateDelay, updateData]); + + const value = useMemo( + () => ({ + ...state, + updateData, + }), + [state, updateData] + ); + + return ( + + {children} + + ); +} diff --git a/src/platform/PlatformAppProvider/types.js b/src/platform/PlatformAppProvider/types.js new file mode 100644 index 0000000000..6c1cc9237e --- /dev/null +++ b/src/platform/PlatformAppProvider/types.js @@ -0,0 +1,23 @@ +// @flow + +import type { AppManifest } from "../types"; + +export type State = { + manifests: AppManifest[], + manifestById: { [id: string]: AppManifest }, + isLoading: boolean, + lastUpdateTime: ?number, + error: ?Error, +}; + +export type Props = { + children: React$Node, + autoUpdateDelay?: number, + extraManifests?: AppManifest[], +}; + +export type API = { + updateData: () => Promise, +}; + +export type PlatformAppContextType = State & API; diff --git a/src/platform/api/api.js b/src/platform/api/api.js new file mode 100644 index 0000000000..e0e17f0c70 --- /dev/null +++ b/src/platform/api/api.js @@ -0,0 +1,30 @@ +// @flow + +import { getEnv } from "../../env"; +import network from "../../network"; +import type { AppManifest, PlatformApi } from "../types"; + +// expose a function to fetch data from the cdn (data from ledger-live-assets) +// https://cdn.live.ledger.com/ + +const basePlatformUrl = () => getEnv("PLATFORM_API_URL"); +const platformVersion = () => getEnv("PLATFORM_API_VERSION"); + +async function fetchManifest(): Promise { + const url = `${basePlatformUrl()}/v${platformVersion()}/data.json?t=${Date.now()}`; + + const { data } = await network({ + method: "GET", + headers: { + Origin: "http://localhost:3000", + }, + url, + }); + return data; +} + +const api: PlatformApi = { + fetchManifest, +}; + +export default api; diff --git a/src/platform/api/api.mock.js b/src/platform/api/api.mock.js new file mode 100644 index 0000000000..eeccef76e2 --- /dev/null +++ b/src/platform/api/api.mock.js @@ -0,0 +1,295 @@ +// @flow +import type { AppManifest, PlatformApi } from "../types"; + +const manifest: AppManifest[] = [ + { + id: "paraswap", + name: "ParaSwap", + url: + "https://ledger-live-platform-apps.vercel.app/app/dapp-browser?url=https%3A%2F%2Fparaswap.io%2F%3Fembed%3Dtrue%26referrer%3Dledger2&nanoApp=Paraswap&dappName=ParaSwap", + homepageUrl: "https://paraswap.io", + supportUrl: "https://paraswap.io", + icon: "https://cdn.live.ledger.com/icons/platform/paraswap.png", + platform: "all", + apiVersion: "0.0.1", + manifestVersion: "1", + branch: "stable", + params: ["accountId"], + categories: ["swap", "defi"], + currencies: ["ethereum"], + content: { + shortDescription: { + en: + "Swap your crypto with ParaSwap that aggregates and provides the best quotes decentralised exchanges.", + }, + description: { + en: + "Swap your crypto with ParaSwap that aggregates and provides the best quotes decentralised exchanges.", + }, + }, + permissions: [ + { + method: "account.list", + params: { + currencies: ["ethereum"], + }, + }, + { + method: "account.request", + params: { + currencies: ["ethereum"], + }, + }, + { + method: "transaction.sign", + params: { + nanoApp: ["paraswap"], + }, + }, + { + method: "transaction.broadcast", + }, + ], + domains: ["https://*"], + }, + { + id: "wyre_buy", + name: "Wyre", + url: "https://ledger-live-platform-apps.vercel.app/app/wyre", + homepageUrl: "https://www.sendwyre.com/", + icon: "https://cdn.live.ledger.com/icons/platform/wyre.png", + platform: "all", + apiVersion: "0.0.1", + manifestVersion: "1", + branch: "stable", + categories: ["exchange", "buy"], + currencies: ["ethereum", "bitcoin"], + content: { + shortDescription: { + en: + "Purchase Bitcoin, Ethereum and more crypto with Wyre, only available to our US customers.", + }, + description: { + en: + "Purchase Bitcoin, Ethereum and more crypto with Wyre, only available to our US customers.", + }, + }, + permissions: [ + { + method: "account.request", + params: { + currencies: ["ethereum", "bitcoin"], + }, + }, + ], + domains: ["https://*"], + }, + { + id: "zerion", + name: "Zerion", + url: + "https://ledger-live-platform-apps.vercel.app/app/dapp-browser?dappName=Zerion&nanoApp=Paraswap&url=https%3A%2F%2Fapp.zerion.io%2F%3Fembed%3Dledgerdappbrowser", + homepageUrl: "https://zerion.io/", + icon: "https://cdn.live.ledger.com/icons/platform/zerion.png", + platform: "all", + apiVersion: "0.0.1", + manifestVersion: "1", + branch: "stable", + categories: ["portfolio", "defi"], + currencies: ["ethereum"], + content: { + shortDescription: { + en: "The smart way to manage your DeFi portfolio.", + }, + description: { + en: "The smart way to manage your DeFi portfolio.", + }, + }, + permissions: [], + domains: ["https://*"], + }, + { + id: "rainbow", + name: "Rainbow.me", + url: + "https://ledger-live-platform-apps.vercel.app/app/web-browser?url=https%3A%2F%2Frainbow.me%2F%7Baccount.address%7D¤cies=ethereum&webAppName=Rainbow.me", + homepageUrl: "https://rainbow.me", + icon: "https://cdn.live.ledger.com/icons/platform/rainbow.png", + platform: "all", + apiVersion: "0.0.1", + manifestVersion: "1", + branch: "stable", + categories: ["nft"], + currencies: ["ethereum"], + content: { + shortDescription: { + en: "An easy way to visualize the NFT secured by your hardware wallet.", + }, + description: { + en: "An easy way to visualize the NFT secured by your hardware wallet.", + }, + }, + permissions: [], + domains: ["https://*"], + }, + { + id: "aave", + name: "Aave", + url: "", + homepageUrl: "https://aave.com/", + icon: "https://cdn.live.ledger.com/icons/platform/aave.png", + platform: "all", + apiVersion: "0.0.1", + manifestVersion: "1", + branch: "soon", + categories: ["lend"], + currencies: ["ethereum"], + content: { + shortDescription: { + en: + "Lend or Borrow your crypto through a liquidity market protocol and stay in control of your funds.", + }, + description: { + en: + "Lend or Borrow your crypto through a liquidity market protocol and stay in control of your funds.", + }, + }, + permissions: [], + domains: [], + }, + { + id: "compound", + name: "Compound", + url: "", + homepageUrl: "https://compound.finance/", + icon: "https://cdn.live.ledger.com/icons/platform/compound.png", + platform: "all", + apiVersion: "0.0.1", + manifestVersion: "1", + branch: "soon", + categories: ["lend", "compound"], + currencies: ["ethereum"], + content: { + shortDescription: { + en: + "Lend or Borrow your crypto via a completely decentralized and open-source protocol.", + }, + description: { + en: + "Lend or Borrow your crypto via a completely decentralized and open-source protocol.", + }, + }, + permissions: [], + domains: [], + }, + { + id: "deversifi", + name: "DeversiFi", + url: "", + homepageUrl: "https://www.deversifi.com/", + icon: "https://cdn.live.ledger.com/icons/platform/deversifi.png", + platform: "all", + apiVersion: "0.0.1", + manifestVersion: "1", + branch: "soon", + categories: ["dex"], + currencies: ["ethereum"], + content: { + shortDescription: { + en: + "Trade through a self-custody decentralized exchange on Ethereum layer-2.", + }, + description: { + en: + "Trade through a self-custody decentralized exchange on Ethereum layer-2.", + }, + }, + permissions: [], + domains: [], + }, + { + id: "1inch", + name: "1Inch", + url: "", + homepageUrl: "https://1inch.io/", + icon: "https://cdn.live.ledger.com/icons/platform/1inch.png", + platform: "all", + apiVersion: "0.0.1", + manifestVersion: "1", + branch: "soon", + categories: ["swap", "defi"], + currencies: ["ethereum"], + content: { + shortDescription: { + en: "Exchange crypto via a Defi/DEX aggregator on Ethereum.", + }, + description: { + en: "Exchange crypto via a Defi/DEX aggregator on Ethereum.", + }, + }, + permissions: [], + domains: [], + }, + { + id: "lido", + name: "Lido", + url: "", + homepageUrl: "https://lido.fi/", + icon: "https://cdn.live.ledger.com/icons/platform/lido.png", + platform: "all", + apiVersion: "0.0.1", + manifestVersion: "1", + branch: "soon", + categories: ["staking", "defi"], + currencies: ["ethereum"], + content: { + shortDescription: { + en: "Stake any amount of Eth to Eth2 and earn daily staking rewards.", + }, + description: { + en: "Stake any amount of Eth to Eth2 and earn daily staking rewards.", + }, + }, + permissions: [], + domains: [], + }, + { + id: "debug", + name: "Debugger", + url: "https://ledger-live-platform-apps.vercel.app/app/debug", + homepageUrl: "https://developers.ledger.com/", + icon: "https://cdn.live.ledger.com/icons/platform/debugger.png", + platform: "all", + apiVersion: "0.0.1", + manifestVersion: "1", + branch: "debug", + categories: ["tools"], + currencies: "*", + content: { + shortDescription: { + en: + "Try out the Ledger Live API to test capabilities of our platform integration solution. Use at your own risk.", + }, + description: { + en: + "Try out the Ledger Live API to test capabilities of our platform integration solution. Use at your own risk.", + }, + }, + permissions: [ + { + method: "*", + }, + ], + domains: ["https://*"], + }, +]; + +async function fetchManifest(): Promise { + return Promise.resolve(manifest); +} + +const api: PlatformApi = { + fetchManifest, +}; + +export default api; diff --git a/src/platform/api/index.js b/src/platform/api/index.js new file mode 100644 index 0000000000..643e3a891a --- /dev/null +++ b/src/platform/api/index.js @@ -0,0 +1,15 @@ +// @flow + +import { getEnv } from "../../env"; +import type { PlatformApi } from "../types"; +import prodApi from "./api"; +import mockApi from "./api.mock"; + +const api: PlatformApi = { + fetchManifest: () => + getEnv("MOCK") || !getEnv("PLATFORM_API_URL") + ? mockApi.fetchManifest() + : prodApi.fetchManifest(), +}; + +export default api; diff --git a/src/platform/logic.js b/src/platform/logic.js new file mode 100644 index 0000000000..939d5718a4 --- /dev/null +++ b/src/platform/logic.js @@ -0,0 +1,27 @@ +// @flow + +import semver from "semver"; + +import type { AppManifest, AppPlatform, AppBranch } from "./types"; +import { getPlatformVersion } from "./version"; + +export function translateContent(content: any, locale: string = "en") { + if (!content || typeof content !== "object") return content; + + return content[locale] || content.en; +} + +export function isSupported(manifest: AppManifest) { + return semver.satisfies( + semver.coerce(getPlatformVersion()), + manifest.apiVersion + ); +} + +export function matchBranches(manifest: AppManifest, branches: AppBranch[]) { + return branches.indexOf(manifest.branch) > -1; +} + +export function matchPlatform(manifest: AppManifest, platform: AppPlatform) { + return manifest.platform === "all" || manifest.platform === platform; +} diff --git a/src/platform/types.js b/src/platform/types.js index 6e5ba62f14..9b9488e8da 100644 --- a/src/platform/types.js +++ b/src/platform/types.js @@ -4,6 +4,50 @@ import type { BigNumber } from "bignumber.js"; import type { SignedOperation } from "../types"; +export type TranslatableString = { + en: string, + [locale: string]: string, +}; + +export type AppPlatform = + | "desktop" // == windows || mac || linux + | "mobile" // == android || ios + | "all"; + +export type AppBranch = "stable" | "experimental" | "soon" | "debug"; + +export type AppPermission = { + method: string, + params?: any, +}; + +export type AppManifest = { + id: string, + private?: boolean, + name: string, + url: string, + homepageUrl: string, + supportUrl?: string, + icon?: string | null, + platform: AppPlatform, + apiVersion: string, + manifestVersion: string, + branch: AppBranch, + params?: string[], + categories: string[], + currencies: string[] | "*", + content: { + shortDescription: TranslatableString, + description: TranslatableString, + }, + permissions: AppPermission[], + domains: string[], +}; + +export type PlatformApi = { + fetchManifest: () => Promise, +}; + export type PlatformAccount = { id: string, name: string, diff --git a/src/platform/version.js b/src/platform/version.js new file mode 100644 index 0000000000..a0370324c4 --- /dev/null +++ b/src/platform/version.js @@ -0,0 +1,18 @@ +// @flow +// as the client side must implement platform, it's for LLD/LLM to set the platform version +// that way allows to be loosely coupled between common and lld/llm +// it's like we do for enabling coins. +// beware this must be set in the first import of the end project. + +import invariant from "invariant"; + +let version = ""; + +export function getPlatformVersion() { + invariant(version, "setPlatformVersion must be called before anything else."); + return version; +} + +export function setPlatformVersion(v: string) { + version = v; +} diff --git a/src/platform/version.test.js b/src/platform/version.test.js new file mode 100644 index 0000000000..4cbb4963b3 --- /dev/null +++ b/src/platform/version.test.js @@ -0,0 +1,7 @@ +// @flow +import "../__tests__/test-helpers/setup"; +import { getPlatformVersion } from "./version"; + +test("version is defined by setup", () => { + expect(getPlatformVersion()).toBe("0.0.1"); +}); diff --git a/src/react.js b/src/react.js index 18c05e4a16..d3f8f6aca6 100644 --- a/src/react.js +++ b/src/react.js @@ -1,5 +1,6 @@ // @flow import * as icons from "./data/icons/react"; +import * as flags from "./data/flags/react"; import type { CryptoCurrency, TokenCurrency } from "./types"; type Icon = React$ComponentType<{ size: number, color?: string }>; @@ -18,3 +19,7 @@ export function getCryptoCurrencyIcon(currency: CryptoCurrency): ?Icon { export function getTokenCurrencyIcon(token: TokenCurrency): ?Icon { return token.disableCountervalue ? null : icons[getIconId(token)]; } + +export function getFlag(countryCode: string): ?Icon { + return flags[`${countryCode.toLowerCase()}Flag`]; +} diff --git a/src/reactNative.js b/src/reactNative.js index b4789c2c02..80f6452bf0 100644 --- a/src/reactNative.js +++ b/src/reactNative.js @@ -1,5 +1,6 @@ // @flow import * as icons from "./data/icons/reactNative"; +import * as flags from "./data/flags/reactNative"; import type { CryptoCurrency, TokenCurrency } from "./types"; type Icon = React$ComponentType<{ size: number, color: string }>; @@ -18,3 +19,7 @@ export function getCryptoCurrencyIcon(currency: CryptoCurrency): ?Icon { export function getTokenCurrencyIcon(token: TokenCurrency): ?Icon { return icons[getIconId(token)]; } + +export function getFlag(countryCode: string): ?Icon { + return flags[`${countryCode.toLowerCase()}Flag`]; +} diff --git a/src/types/operation.js b/src/types/operation.js index 19770d26d6..a2a2fe3ec7 100644 --- a/src/types/operation.js +++ b/src/types/operation.js @@ -24,6 +24,7 @@ export type OperationType = | "BOND" | "UNBOND" | "WITHDRAW_UNBONDED" + | "SET_CONTROLLER" | "SLASH" | "NOMINATE" | "CHILL" diff --git a/src/walletconnect/walletconnect.test.js b/src/walletconnect/walletconnect.test.js index fd7ea91256..0e1d8e7f65 100644 --- a/src/walletconnect/walletconnect.test.js +++ b/src/walletconnect/walletconnect.test.js @@ -9,6 +9,9 @@ import { getCryptoCurrencyById, setSupportedCurrencies } from "../currencies"; import type { Account } from "../types/account"; import { emptyHistoryCache } from "../account"; import { setEnv } from "../env"; +import { setPlatformVersion } from "../platform/version"; + +setPlatformVersion("0.0.1"); describe("walletconnect", () => { const account: Account = { diff --git a/yarn.lock b/yarn.lock index b0d5daef97..bf9a7db729 100644 --- a/yarn.lock +++ b/yarn.lock @@ -936,10 +936,10 @@ core-js-pure "^3.0.0" regenerator-runtime "^0.13.4" -"@babel/runtime@^7.10.2", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.1", "@babel/runtime@^7.12.5", "@babel/runtime@^7.13.7", "@babel/runtime@^7.13.8", "@babel/runtime@^7.8.4", "@babel/runtime@^7.9.2": - version "7.13.17" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.13.17.tgz#8966d1fc9593bf848602f0662d6b4d0069e3a7ec" - integrity sha512-NCdgJEelPTSh+FEFylhnP1ylq848l1z9t9N0j1Lfbcw0+KXGjsTvUmkxy+voLLXB5SOKMbLLx4jxYliGrYQseA== +"@babel/runtime@^7.10.2", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.1", "@babel/runtime@^7.12.5", "@babel/runtime@^7.14.6", "@babel/runtime@^7.8.4", "@babel/runtime@^7.9.2": + version "7.14.6" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.14.6.tgz#535203bc0892efc7dec60bdc27b2ecf6e409062d" + integrity sha512-/PCB2uJ7oM44tz8YhC4Z/6PeOKXp4K588f+5M3clr1M4zbqztlo0XEfJ2LEzj/FgwfgGcIdl8n7YYjTCI0BYwg== dependencies: regenerator-runtime "^0.13.4" @@ -987,6 +987,182 @@ exec-sh "^0.3.2" minimist "^1.2.0" +"@confio/ics23@^0.6.3": + version "0.6.5" + resolved "https://registry.yarnpkg.com/@confio/ics23/-/ics23-0.6.5.tgz#9c21a61089d4c3c2429875a69d6d9cd8c87512aa" + integrity sha512-1GdPMsaP/l8JSF4P4HWFLBhdcxHcJT8lS0nknBYNSZ1XrJOsJKUy6EkOwd9Pa1qJkXzY2gyNv7MdHR+AIwSTAg== + dependencies: + js-sha512 "^0.8.0" + protobufjs "^6.8.8" + ripemd160 "^2.0.2" + sha.js "^2.4.11" + +"@cosmjs/amino@^0.25.0-alpha.2", "@cosmjs/amino@^0.25.4": + version "0.25.4" + resolved "https://registry.yarnpkg.com/@cosmjs/amino/-/amino-0.25.4.tgz#478da0e5933b50d22e412e17dcf6784eeeb7d937" + integrity sha512-S22PlzC/VoJirv5UpDYe4XIVtOHKHxGLYgpgBkv10P4vpEhD872R0G7dRfiZZ35lMbu0+vvJxn3e/pEOEVGcuA== + dependencies: + "@cosmjs/crypto" "^0.25.4" + "@cosmjs/encoding" "^0.25.4" + "@cosmjs/math" "^0.25.4" + "@cosmjs/utils" "^0.25.4" + +"@cosmjs/crypto@^0.25.0-alpha.2", "@cosmjs/crypto@^0.25.4": + version "0.25.4" + resolved "https://registry.yarnpkg.com/@cosmjs/crypto/-/crypto-0.25.4.tgz#0e526a8939773b43799bd013252642e08e389f75" + integrity sha512-xm7o2xMQIERFjG+hBa/5f+l1CNdXrXzGqhICo3VJuKsuFRtOtEw3w0dbV+3DOp2oxaUQvLBkLqdYXNBL+lmHlQ== + dependencies: + "@cosmjs/encoding" "^0.25.4" + "@cosmjs/math" "^0.25.4" + "@cosmjs/utils" "^0.25.4" + bip39 "^3.0.2" + bn.js "^4.11.8" + elliptic "^6.5.3" + js-sha3 "^0.8.0" + libsodium-wrappers "^0.7.6" + ripemd160 "^2.0.2" + sha.js "^2.4.11" + +"@cosmjs/encoding@0.23.1": + version "0.23.1" + resolved "https://registry.yarnpkg.com/@cosmjs/encoding/-/encoding-0.23.1.tgz#b51cd2813499cfdeeb0f9cc7d050a45eb8b27bf4" + integrity sha512-rP5O3vYo0k6W329J+u5uKqJNrhmR4QTngLgsDvP/qsRRBfEiirhk+TQC8gjUlgnzoiCKCtWsiOyFP1z9Me9HIw== + dependencies: + base64-js "^1.3.0" + bech32 "^1.1.4" + readonly-date "^1.0.0" + +"@cosmjs/encoding@^0.25.0-alpha.2", "@cosmjs/encoding@^0.25.4": + version "0.25.4" + resolved "https://registry.yarnpkg.com/@cosmjs/encoding/-/encoding-0.25.4.tgz#7589f350410e91728f8377fef782117382873da6" + integrity sha512-wYwYYbCGwDyhaROX6EyZBaiMqpTME8oo7KaRChS6O/6w5hZcfWAyo0NVaHCv8atxt/h0lYroazEXxOVKY+uo6A== + dependencies: + base64-js "^1.3.0" + bech32 "^1.1.4" + readonly-date "^1.0.0" + +"@cosmjs/json-rpc@^0.25.0-alpha.2", "@cosmjs/json-rpc@^0.25.4": + version "0.25.4" + resolved "https://registry.yarnpkg.com/@cosmjs/json-rpc/-/json-rpc-0.25.4.tgz#4109ebe5f6ab21561767c25e13ad7734dee94526" + integrity sha512-X3BzvzUpThD2o9+Ak2+icAqm8AAdWhCGB6Hl229DvKG1NUnXEKdwSxlI/VNw0IKT7ljy47Jv56syQiK5nFdXRQ== + dependencies: + "@cosmjs/stream" "^0.25.4" + xstream "^11.14.0" + +"@cosmjs/math@0.23.1": + version "0.23.1" + resolved "https://registry.yarnpkg.com/@cosmjs/math/-/math-0.23.1.tgz#706f38742a9a1f6561cf2c4510f8e5ab001fc5e6" + integrity sha512-xjGGogFZXLdmRumE1Wr+GlPfKznIl5Qa6K6QyZr4IjBhfB6/ZzLUihliDJp2d8zbjBJgQt9RUwP/PaFQ/yGQNg== + dependencies: + bn.js "^4.11.8" + +"@cosmjs/math@^0.25.0-alpha.2", "@cosmjs/math@^0.25.4": + version "0.25.4" + resolved "https://registry.yarnpkg.com/@cosmjs/math/-/math-0.25.4.tgz#1a70b26c18f990654dfd195a1a2b544b48269572" + integrity sha512-mnf5TgDObjx1yt1Vxkr3k/vncTL4FPRu3eSHjYM+EyQeNmy/Dld0fHFWxELeGqlQ09kVuqFY1jkKG2R96YRHww== + dependencies: + bn.js "^4.11.8" + +"@cosmjs/proto-signing@^0.25.0-alpha.2": + version "0.25.4" + resolved "https://registry.yarnpkg.com/@cosmjs/proto-signing/-/proto-signing-0.25.4.tgz#82a2bdfc105f66c8d9cdf2cfbb86e6da960ab49a" + integrity sha512-W9qJTH0LkOY/WsCe/V2hv6px7gZZxwh8TpLEKSSh4XOUjtqKHcr2jhbdXfi1CQm5lgbvEsovdzVv8VgbtgJxDQ== + dependencies: + "@cosmjs/amino" "^0.25.4" + long "^4.0.0" + protobufjs "~6.10.2" + +"@cosmjs/socket@^0.25.0-alpha.2", "@cosmjs/socket@^0.25.4": + version "0.25.4" + resolved "https://registry.yarnpkg.com/@cosmjs/socket/-/socket-0.25.4.tgz#f32bc7bb347ac26ee1be0c0a57614712bbb6c28c" + integrity sha512-hcL+2kISZ1qqgviNB8OFSzMyYGdiKsBp+j582WYJa+5h9rpZrNWJSm2BFe8hah5AvfYsVCZX1kn7jRu8dZpUnA== + dependencies: + "@cosmjs/stream" "^0.25.4" + isomorphic-ws "^4.0.1" + ws "^7" + xstream "^11.14.0" + +"@cosmjs/stargate@0.25.0-alpha.2": + version "0.25.0-alpha.2" + resolved "https://registry.yarnpkg.com/@cosmjs/stargate/-/stargate-0.25.0-alpha.2.tgz#db6fa0002e96f62875e5b72378e24bd19ef9478f" + integrity sha512-r6VT720EuF6yPwS1WGPPUAPUOfD5aVIRlVJNJHkePWGg4l+ztJtoUbr7QN1CoPrxvG3b+WflNug1EQ7dG44UsA== + dependencies: + "@confio/ics23" "^0.6.3" + "@cosmjs/amino" "^0.25.0-alpha.2" + "@cosmjs/encoding" "^0.25.0-alpha.2" + "@cosmjs/math" "^0.25.0-alpha.2" + "@cosmjs/proto-signing" "^0.25.0-alpha.2" + "@cosmjs/stream" "^0.25.0-alpha.2" + "@cosmjs/tendermint-rpc" "^0.25.0-alpha.2" + "@cosmjs/utils" "^0.25.0-alpha.2" + long "^4.0.0" + protobufjs "~6.10.2" + +"@cosmjs/stream@^0.25.0-alpha.2", "@cosmjs/stream@^0.25.4": + version "0.25.4" + resolved "https://registry.yarnpkg.com/@cosmjs/stream/-/stream-0.25.4.tgz#9b978ee27355d6d4268ebed7be6d6d701e6ccd50" + integrity sha512-Z/if46lnNyiGojzQgSi4ztaqDCJ4gljlmGw6hX/7MrPn5dtmaSqWjLep5CMh7moiR9ZaAeqRPTdUsb99CjiKMQ== + dependencies: + xstream "^11.14.0" + +"@cosmjs/tendermint-rpc@0.25.0-alpha.2": + version "0.25.0-alpha.2" + resolved "https://registry.yarnpkg.com/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.25.0-alpha.2.tgz#15e31d8a9385085740ec71ea0029b9ebb9dd757e" + integrity sha512-1xK8mPwFWiWnyGafZhAdwYfcYmXl1l7UxQRR3yI2Q3kDk7CQhT87mgeAd56jw9JOaZvLYKKTgCRZkLNiKjXNew== + dependencies: + "@cosmjs/crypto" "^0.25.0-alpha.2" + "@cosmjs/encoding" "^0.25.0-alpha.2" + "@cosmjs/json-rpc" "^0.25.0-alpha.2" + "@cosmjs/math" "^0.25.0-alpha.2" + "@cosmjs/socket" "^0.25.0-alpha.2" + "@cosmjs/stream" "^0.25.0-alpha.2" + axios "^0.21.1" + readonly-date "^1.0.0" + xstream "^11.14.0" + +"@cosmjs/tendermint-rpc@^0.25.0-alpha.2": + version "0.25.4" + resolved "https://registry.yarnpkg.com/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.25.4.tgz#8fcf8850ecbc4851a2763303bda8962779ee6d2b" + integrity sha512-F8qiSTtDcS7ZkfvX4RfodpoMG7C7kwLJ8P7umSeWe0wkLaO6NYoKcqxBGjc6E7XVy+XtJDyfF3gqNDJz5/Jtpg== + dependencies: + "@cosmjs/crypto" "^0.25.4" + "@cosmjs/encoding" "^0.25.4" + "@cosmjs/json-rpc" "^0.25.4" + "@cosmjs/math" "^0.25.4" + "@cosmjs/socket" "^0.25.4" + "@cosmjs/stream" "^0.25.4" + axios "^0.21.1" + readonly-date "^1.0.0" + xstream "^11.14.0" + +"@cosmjs/utils@^0.25.0-alpha.2", "@cosmjs/utils@^0.25.4": + version "0.25.4" + resolved "https://registry.yarnpkg.com/@cosmjs/utils/-/utils-0.25.4.tgz#6e617543476e9e1f72bfcb6e263b273e01e4ba93" + integrity sha512-SRkE+Nc0hwuWdsUCQCF3HNWcxhm8UtTg2fIo8CJpecusYfKSGKzkeL1O/Ja/+xDpuTAXW2s2mfVyaAW5b5pHVQ== + +"@crypto-com/chain-jslib@^0.0.16": + version "0.0.16" + resolved "https://registry.yarnpkg.com/@crypto-com/chain-jslib/-/chain-jslib-0.0.16.tgz#d09563d62200db7ad3955438abf2a5722ebc4e4c" + integrity sha512-iLq4XC0Jq7BZJXZ4xL3bmmjEUMH8VlPirUCM5Unyc2S1QL1A9NzWngoJS6ua7MgL7WPQOjqJrKpZAmt6quI1ow== + dependencies: + "@cosmjs/encoding" "0.23.1" + "@cosmjs/math" "0.23.1" + "@cosmjs/stargate" "0.25.0-alpha.2" + "@cosmjs/tendermint-rpc" "0.25.0-alpha.2" + axios "0.21.1" + bech32 "1.1.4" + big.js "6.0.0" + bip32 "2.0.6" + bip39 "3.0.2" + buffer "5.6.1" + create-hash "1.2.0" + lodash "4.17.21" + long "4.0.0" + ow "0.17.0" + protobufjs "6.10.1" + randombytes "2.1.0" + secp256k1 "4.0.2" + "@dabh/diagnostics@^2.0.2": version "2.0.2" resolved "https://registry.yarnpkg.com/@dabh/diagnostics/-/diagnostics-2.0.2.tgz#290d08f7b381b8f94607dc8f471a12c675f9db31" @@ -1011,343 +1187,344 @@ minimatch "^3.0.4" strip-json-comments "^3.1.1" -"@ethersproject/abi@5.2.0", "@ethersproject/abi@^5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.2.0.tgz#e2ca0b7f7e3b83e4d427ed8b38fdc1c48e2bb00f" - integrity sha512-24ExfHa0VbIOUHbB36b6lCVmWkaIVmrd9/m8MICtmSsRKzlugWqUD0B8g0zrRylXNxAOc3V6T4xKJ8jEDSvp3w== - dependencies: - "@ethersproject/address" "^5.2.0" - "@ethersproject/bignumber" "^5.2.0" - "@ethersproject/bytes" "^5.2.0" - "@ethersproject/constants" "^5.2.0" - "@ethersproject/hash" "^5.2.0" - "@ethersproject/keccak256" "^5.2.0" - "@ethersproject/logger" "^5.2.0" - "@ethersproject/properties" "^5.2.0" - "@ethersproject/strings" "^5.2.0" - -"@ethersproject/abstract-provider@5.2.0", "@ethersproject/abstract-provider@^5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@ethersproject/abstract-provider/-/abstract-provider-5.2.0.tgz#b5c24b162f119b5d241738ded9555186013aa77d" - integrity sha512-Xi7Pt+CulRijc/vskBGIaYMEhafKjoNx8y4RNj/dnSpXHXScOJUSTtypqGBUngZddRbcwZGbHwEr6DZoKZwIZA== - dependencies: - "@ethersproject/bignumber" "^5.2.0" - "@ethersproject/bytes" "^5.2.0" - "@ethersproject/logger" "^5.2.0" - "@ethersproject/networks" "^5.2.0" - "@ethersproject/properties" "^5.2.0" - "@ethersproject/transactions" "^5.2.0" - "@ethersproject/web" "^5.2.0" - -"@ethersproject/abstract-signer@5.2.0", "@ethersproject/abstract-signer@^5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@ethersproject/abstract-signer/-/abstract-signer-5.2.0.tgz#8e291fb6558b4190fb3e2fe440a9ffd092a2f459" - integrity sha512-JTXzLUrtoxpOEq1ecH86U7tstkEa9POKAGbGBb+gicbjGgzYYkLR4/LD83SX2/JNWvtYyY8t5errt5ehiy1gxQ== +"@ethersproject/abi@5.4.0", "@ethersproject/abi@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.4.0.tgz#a6d63bdb3672f738398846d4279fa6b6c9818242" + integrity sha512-9gU2H+/yK1j2eVMdzm6xvHSnMxk8waIHQGYCZg5uvAyH0rsAzxkModzBSpbAkAuhKFEovC2S9hM4nPuLym8IZw== + dependencies: + "@ethersproject/address" "^5.4.0" + "@ethersproject/bignumber" "^5.4.0" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/constants" "^5.4.0" + "@ethersproject/hash" "^5.4.0" + "@ethersproject/keccak256" "^5.4.0" + "@ethersproject/logger" "^5.4.0" + "@ethersproject/properties" "^5.4.0" + "@ethersproject/strings" "^5.4.0" + +"@ethersproject/abstract-provider@5.4.0", "@ethersproject/abstract-provider@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/abstract-provider/-/abstract-provider-5.4.0.tgz#415331031b0f678388971e1987305244edc04e1d" + integrity sha512-vPBR7HKUBY0lpdllIn7tLIzNN7DrVnhCLKSzY0l8WAwxz686m/aL7ASDzrVxV93GJtIub6N2t4dfZ29CkPOxgA== + dependencies: + "@ethersproject/bignumber" "^5.4.0" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/logger" "^5.4.0" + "@ethersproject/networks" "^5.4.0" + "@ethersproject/properties" "^5.4.0" + "@ethersproject/transactions" "^5.4.0" + "@ethersproject/web" "^5.4.0" + +"@ethersproject/abstract-signer@5.4.0", "@ethersproject/abstract-signer@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/abstract-signer/-/abstract-signer-5.4.0.tgz#cd5f50b93141ee9f9f49feb4075a0b3eafb57d65" + integrity sha512-AieQAzt05HJZS2bMofpuxMEp81AHufA5D6M4ScKwtolj041nrfIbIi8ciNW7+F59VYxXq+V4c3d568Q6l2m8ew== dependencies: - "@ethersproject/abstract-provider" "^5.2.0" - "@ethersproject/bignumber" "^5.2.0" - "@ethersproject/bytes" "^5.2.0" - "@ethersproject/logger" "^5.2.0" - "@ethersproject/properties" "^5.2.0" + "@ethersproject/abstract-provider" "^5.4.0" + "@ethersproject/bignumber" "^5.4.0" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/logger" "^5.4.0" + "@ethersproject/properties" "^5.4.0" -"@ethersproject/address@5.2.0", "@ethersproject/address@^5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.2.0.tgz#afcfa92db84582f54a60a9da361cea4aae450a69" - integrity sha512-2YfZlalWefOEfnr/CdqKRrgMgbKidYc+zG4/ilxSdcryZSux3eBU5/5btAT/hSiaHipUjd8UrWK8esCBHU6QNQ== +"@ethersproject/address@5.4.0", "@ethersproject/address@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.4.0.tgz#ba2d00a0f8c4c0854933b963b9a3a9f6eb4a37a3" + integrity sha512-SD0VgOEkcACEG/C6xavlU1Hy3m5DGSXW3CUHkaaEHbAPPsgi0coP5oNPsxau8eTlZOk/bpa/hKeCNoK5IzVI2Q== dependencies: - "@ethersproject/bignumber" "^5.2.0" - "@ethersproject/bytes" "^5.2.0" - "@ethersproject/keccak256" "^5.2.0" - "@ethersproject/logger" "^5.2.0" - "@ethersproject/rlp" "^5.2.0" + "@ethersproject/bignumber" "^5.4.0" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/keccak256" "^5.4.0" + "@ethersproject/logger" "^5.4.0" + "@ethersproject/rlp" "^5.4.0" -"@ethersproject/base64@5.2.0", "@ethersproject/base64@^5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@ethersproject/base64/-/base64-5.2.0.tgz#e01066d25e5b4e8a051545163bee5def47bd9534" - integrity sha512-D9wOvRE90QBI+yFsKMv0hnANiMzf40Xicq9JZbV9XYzh7srImmwmMcReU2wHjOs9FtEgSJo51Tt+sI1dKPYKDg== +"@ethersproject/base64@5.4.0", "@ethersproject/base64@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/base64/-/base64-5.4.0.tgz#7252bf65295954c9048c7ca5f43e5c86441b2a9a" + integrity sha512-CjQw6E17QDSSC5jiM9YpF7N1aSCHmYGMt9bWD8PWv6YPMxjsys2/Q8xLrROKI3IWJ7sFfZ8B3flKDTM5wlWuZQ== dependencies: - "@ethersproject/bytes" "^5.2.0" + "@ethersproject/bytes" "^5.4.0" -"@ethersproject/basex@5.2.0", "@ethersproject/basex@^5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@ethersproject/basex/-/basex-5.2.0.tgz#f921039e3bdfdab8c5a7ba8b21e81c83fc1ab98b" - integrity sha512-Oo7oX7BmaHLY/8ZsOLI5W0mrSwPBb1iboosN17jfK/4vGAtKjAInDai9I72CzN4NRJaMN5FkFLoPYywGqgGHlg== +"@ethersproject/basex@5.4.0", "@ethersproject/basex@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/basex/-/basex-5.4.0.tgz#0a2da0f4e76c504a94f2b21d3161ed9438c7f8a6" + integrity sha512-J07+QCVJ7np2bcpxydFVf/CuYo9mZ7T73Pe7KQY4c1lRlrixMeblauMxHXD0MPwFmUHZIILDNViVkykFBZylbg== dependencies: - "@ethersproject/bytes" "^5.2.0" - "@ethersproject/properties" "^5.2.0" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/properties" "^5.4.0" -"@ethersproject/bignumber@5.2.0", "@ethersproject/bignumber@^5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.2.0.tgz#03f91ea740c5adb6f8c6a2e91bb4ee5ffaff5503" - integrity sha512-+MNQTxwV7GEiA4NH/i51UqQ+lY36O0rxPdV+0qzjFSySiyBlJpLk6aaa4UTvKmYWlI7YKZm6vuyCENeYn7qAOw== +"@ethersproject/bignumber@5.4.0", "@ethersproject/bignumber@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.4.0.tgz#be8dea298c0ec71208ee60f0b245be0761217ad9" + integrity sha512-OXUu9f9hO3vGRIPxU40cignXZVaYyfx6j9NNMjebKdnaCL3anCLSSy8/b8d03vY6dh7duCC0kW72GEC4tZer2w== dependencies: - "@ethersproject/bytes" "^5.2.0" - "@ethersproject/logger" "^5.2.0" - bn.js "^4.4.0" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/logger" "^5.4.0" + bn.js "^4.11.9" -"@ethersproject/bytes@5.2.0", "@ethersproject/bytes@^5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.2.0.tgz#327917d5a1600f92fd2a9da4052fa6d974583132" - integrity sha512-O1CRpvJDnRTB47vvW8vyqojUZxVookb4LJv/s06TotriU3Xje5WFvlvXJu1yTchtxTz9BbvJw0lFXKpyO6Dn7w== +"@ethersproject/bytes@5.4.0", "@ethersproject/bytes@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.4.0.tgz#56fa32ce3bf67153756dbaefda921d1d4774404e" + integrity sha512-H60ceqgTHbhzOj4uRc/83SCN9d+BSUnOkrr2intevqdtEMO1JFVZ1XL84OEZV+QjV36OaZYxtnt4lGmxcGsPfA== dependencies: - "@ethersproject/logger" "^5.2.0" + "@ethersproject/logger" "^5.4.0" -"@ethersproject/constants@5.2.0", "@ethersproject/constants@^5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.2.0.tgz#ccea78ce325f78abfe7358397c03eec570518d92" - integrity sha512-p+34YG0KbHS20NGdE+Ic0M6egzd7cDvcfoO9RpaAgyAYm3V5gJVqL7UynS87yCt6O6Nlx6wRFboPiM5ctAr+jA== +"@ethersproject/constants@5.4.0", "@ethersproject/constants@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.4.0.tgz#ee0bdcb30bf1b532d2353c977bf2ef1ee117958a" + integrity sha512-tzjn6S7sj9+DIIeKTJLjK9WGN2Tj0P++Z8ONEIlZjyoTkBuODN+0VfhAyYksKi43l1Sx9tX2VlFfzjfmr5Wl3Q== dependencies: - "@ethersproject/bignumber" "^5.2.0" + "@ethersproject/bignumber" "^5.4.0" -"@ethersproject/contracts@5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@ethersproject/contracts/-/contracts-5.2.0.tgz#f54e12ec4a323f2bf93c338034839cc6dfc1e347" - integrity sha512-/2fg5tWPG6Z4pciEWpwGji3ggGA5j0ChVNF7NTmkOhvFrrJuWnRpzbvYA00nz8tBDNCOV3cwub5zfWRpgwYEJQ== - dependencies: - "@ethersproject/abi" "^5.2.0" - "@ethersproject/abstract-provider" "^5.2.0" - "@ethersproject/abstract-signer" "^5.2.0" - "@ethersproject/address" "^5.2.0" - "@ethersproject/bignumber" "^5.2.0" - "@ethersproject/bytes" "^5.2.0" - "@ethersproject/constants" "^5.2.0" - "@ethersproject/logger" "^5.2.0" - "@ethersproject/properties" "^5.2.0" - "@ethersproject/transactions" "^5.2.0" - -"@ethersproject/hash@5.2.0", "@ethersproject/hash@^5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@ethersproject/hash/-/hash-5.2.0.tgz#2d21901eafc5bdb738b4ad96bee364d371ec724b" - integrity sha512-wEGry2HFFSssFiNEkFWMzj1vpdFv4rQlkBp41UfL6J58zKGNycoAWimokITDMk8p7548MKr27h48QfERnNKkRw== - dependencies: - "@ethersproject/abstract-signer" "^5.2.0" - "@ethersproject/address" "^5.2.0" - "@ethersproject/bignumber" "^5.2.0" - "@ethersproject/bytes" "^5.2.0" - "@ethersproject/keccak256" "^5.2.0" - "@ethersproject/logger" "^5.2.0" - "@ethersproject/properties" "^5.2.0" - "@ethersproject/strings" "^5.2.0" - -"@ethersproject/hdnode@5.2.0", "@ethersproject/hdnode@^5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@ethersproject/hdnode/-/hdnode-5.2.0.tgz#efea9b2f713e55aa5ba23cc62b4aac6d08dcfa53" - integrity sha512-ffq2JrW5AftCmfWZ8DxpdWdw/x06Yn+e9wrWHLpj8If1+w87W4LbTMRUaUmO1DUSN8H8g/6kMUKCTJPVuxsuOw== - dependencies: - "@ethersproject/abstract-signer" "^5.2.0" - "@ethersproject/basex" "^5.2.0" - "@ethersproject/bignumber" "^5.2.0" - "@ethersproject/bytes" "^5.2.0" - "@ethersproject/logger" "^5.2.0" - "@ethersproject/pbkdf2" "^5.2.0" - "@ethersproject/properties" "^5.2.0" - "@ethersproject/sha2" "^5.2.0" - "@ethersproject/signing-key" "^5.2.0" - "@ethersproject/strings" "^5.2.0" - "@ethersproject/transactions" "^5.2.0" - "@ethersproject/wordlists" "^5.2.0" - -"@ethersproject/json-wallets@5.2.0", "@ethersproject/json-wallets@^5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@ethersproject/json-wallets/-/json-wallets-5.2.0.tgz#d41c7c39e4d236b586e26e2145b09ac49dc56608" - integrity sha512-iWxSm9XiugEtaehYD6w1ImmXeatjcGcrQvffZVJHH1UqV4FckDzrOYnZBRHPQRYlnhNVrGTld1+S0Cu4MB8gdw== - dependencies: - "@ethersproject/abstract-signer" "^5.2.0" - "@ethersproject/address" "^5.2.0" - "@ethersproject/bytes" "^5.2.0" - "@ethersproject/hdnode" "^5.2.0" - "@ethersproject/keccak256" "^5.2.0" - "@ethersproject/logger" "^5.2.0" - "@ethersproject/pbkdf2" "^5.2.0" - "@ethersproject/properties" "^5.2.0" - "@ethersproject/random" "^5.2.0" - "@ethersproject/strings" "^5.2.0" - "@ethersproject/transactions" "^5.2.0" +"@ethersproject/contracts@5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/contracts/-/contracts-5.4.0.tgz#e05fe6bd33acc98741e27d553889ec5920078abb" + integrity sha512-hkO3L3IhS1Z3ZtHtaAG/T87nQ7KiPV+/qnvutag35I0IkiQ8G3ZpCQ9NNOpSCzn4pWSW4CfzmtE02FcqnLI+hw== + dependencies: + "@ethersproject/abi" "^5.4.0" + "@ethersproject/abstract-provider" "^5.4.0" + "@ethersproject/abstract-signer" "^5.4.0" + "@ethersproject/address" "^5.4.0" + "@ethersproject/bignumber" "^5.4.0" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/constants" "^5.4.0" + "@ethersproject/logger" "^5.4.0" + "@ethersproject/properties" "^5.4.0" + "@ethersproject/transactions" "^5.4.0" + +"@ethersproject/hash@5.4.0", "@ethersproject/hash@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/hash/-/hash-5.4.0.tgz#d18a8e927e828e22860a011f39e429d388344ae0" + integrity sha512-xymAM9tmikKgbktOCjW60Z5sdouiIIurkZUr9oW5NOex5uwxrbsYG09kb5bMcNjlVeJD3yPivTNzViIs1GCbqA== + dependencies: + "@ethersproject/abstract-signer" "^5.4.0" + "@ethersproject/address" "^5.4.0" + "@ethersproject/bignumber" "^5.4.0" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/keccak256" "^5.4.0" + "@ethersproject/logger" "^5.4.0" + "@ethersproject/properties" "^5.4.0" + "@ethersproject/strings" "^5.4.0" + +"@ethersproject/hdnode@5.4.0", "@ethersproject/hdnode@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/hdnode/-/hdnode-5.4.0.tgz#4bc9999b9a12eb5ce80c5faa83114a57e4107cac" + integrity sha512-pKxdS0KAaeVGfZPp1KOiDLB0jba11tG6OP1u11QnYfb7pXn6IZx0xceqWRr6ygke8+Kw74IpOoSi7/DwANhy8Q== + dependencies: + "@ethersproject/abstract-signer" "^5.4.0" + "@ethersproject/basex" "^5.4.0" + "@ethersproject/bignumber" "^5.4.0" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/logger" "^5.4.0" + "@ethersproject/pbkdf2" "^5.4.0" + "@ethersproject/properties" "^5.4.0" + "@ethersproject/sha2" "^5.4.0" + "@ethersproject/signing-key" "^5.4.0" + "@ethersproject/strings" "^5.4.0" + "@ethersproject/transactions" "^5.4.0" + "@ethersproject/wordlists" "^5.4.0" + +"@ethersproject/json-wallets@5.4.0", "@ethersproject/json-wallets@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/json-wallets/-/json-wallets-5.4.0.tgz#2583341cfe313fc9856642e8ace3080154145e95" + integrity sha512-igWcu3fx4aiczrzEHwG1xJZo9l1cFfQOWzTqwRw/xcvxTk58q4f9M7cjh51EKphMHvrJtcezJ1gf1q1AUOfEQQ== + dependencies: + "@ethersproject/abstract-signer" "^5.4.0" + "@ethersproject/address" "^5.4.0" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/hdnode" "^5.4.0" + "@ethersproject/keccak256" "^5.4.0" + "@ethersproject/logger" "^5.4.0" + "@ethersproject/pbkdf2" "^5.4.0" + "@ethersproject/properties" "^5.4.0" + "@ethersproject/random" "^5.4.0" + "@ethersproject/strings" "^5.4.0" + "@ethersproject/transactions" "^5.4.0" aes-js "3.0.0" scrypt-js "3.0.1" -"@ethersproject/keccak256@5.2.0", "@ethersproject/keccak256@^5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.2.0.tgz#15257862807c23f24a3209d1016d322dca85a464" - integrity sha512-LqyxTwVANga5Y3L1yo184czW6b3PibabN8xyE/eOulQLLfXNrHHhwrOTpOhoVRWCICVCD/5SjQfwqTrczjS7jQ== +"@ethersproject/keccak256@5.4.0", "@ethersproject/keccak256@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.4.0.tgz#7143b8eea4976080241d2bd92e3b1f1bf7025318" + integrity sha512-FBI1plWet+dPUvAzPAeHzRKiPpETQzqSUWR1wXJGHVWi4i8bOSrpC3NwpkPjgeXG7MnugVc1B42VbfnQikyC/A== dependencies: - "@ethersproject/bytes" "^5.2.0" + "@ethersproject/bytes" "^5.4.0" js-sha3 "0.5.7" -"@ethersproject/logger@5.2.0", "@ethersproject/logger@^5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.2.0.tgz#accf5348251f78b6c8891af67f42490a4ea4e5ae" - integrity sha512-dPZ6/E3YiArgG8dI/spGkaRDry7YZpCntf4gm/c6SI8Mbqiihd7q3nuLN5VvDap/0K3xm3RE1AIUOcUwwh2ezQ== - -"@ethersproject/networks@5.2.0", "@ethersproject/networks@^5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.2.0.tgz#66c23c6ac477dd703645b2c971ac842d8b8aa524" - integrity sha512-q+htMgq7wQoEnjlkdHM6t1sktKxNbEB/F6DQBPNwru7KpQ1R0n0UTIXJB8Rb7lSnvjqcAQ40X3iVqm94NJfYDw== - dependencies: - "@ethersproject/logger" "^5.2.0" +"@ethersproject/logger@5.4.0", "@ethersproject/logger@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.4.0.tgz#f39adadf62ad610c420bcd156fd41270e91b3ca9" + integrity sha512-xYdWGGQ9P2cxBayt64d8LC8aPFJk6yWCawQi/4eJ4+oJdMMjEBMrIcIMZ9AxhwpPVmnBPrsB10PcXGmGAqgUEQ== -"@ethersproject/pbkdf2@5.2.0", "@ethersproject/pbkdf2@^5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@ethersproject/pbkdf2/-/pbkdf2-5.2.0.tgz#8166a7a7238a5fd1d9bb6eb2000fea0f19fdde06" - integrity sha512-qKOoO6yir/qnAgg6OP3U4gRuZ6jl9P7xwggRu/spVfnuaR+wa490AatWLqB1WOXKf6JFjm5yOaT/T5fCICQVdQ== +"@ethersproject/networks@5.4.1", "@ethersproject/networks@^5.4.0": + version "5.4.1" + resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.4.1.tgz#2ce83b8e42aa85216e5d277a7952d97b6ce8d852" + integrity sha512-8SvowCKz9Uf4xC5DTKI8+il8lWqOr78kmiqAVLYT9lzB8aSmJHQMD1GSuJI0CW4hMAnzocpGpZLgiMdzsNSPig== dependencies: - "@ethersproject/bytes" "^5.2.0" - "@ethersproject/sha2" "^5.2.0" + "@ethersproject/logger" "^5.4.0" -"@ethersproject/properties@5.2.0", "@ethersproject/properties@^5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@ethersproject/properties/-/properties-5.2.0.tgz#8fadf367f7ac7357019d0224aa579b234c545ac1" - integrity sha512-oNFkzcoGwXXV+/Yp/MLcDLrL/2i360XIy2YN9yRZJPnIbLwjroFNLiRzLs6PyPw1D09Xs8OcPR1/nHv6xDKE2A== +"@ethersproject/pbkdf2@5.4.0", "@ethersproject/pbkdf2@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/pbkdf2/-/pbkdf2-5.4.0.tgz#ed88782a67fda1594c22d60d0ca911a9d669641c" + integrity sha512-x94aIv6tiA04g6BnazZSLoRXqyusawRyZWlUhKip2jvoLpzJuLb//KtMM6PEovE47pMbW+Qe1uw+68ameJjB7g== dependencies: - "@ethersproject/logger" "^5.2.0" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/sha2" "^5.4.0" -"@ethersproject/providers@5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@ethersproject/providers/-/providers-5.2.0.tgz#b2f3e3b2ca4567c8372543ceb6f3c6e3a2370783" - integrity sha512-Yf/ZUqCrVr+jR0SHA9GuNZs4R1xnV9Ibnh1TlOa0ZzI6o+Qf8bEyE550k9bYI4zk2f9x9baX2RRs6BJY7Jz/WA== - dependencies: - "@ethersproject/abstract-provider" "^5.2.0" - "@ethersproject/abstract-signer" "^5.2.0" - "@ethersproject/address" "^5.2.0" - "@ethersproject/basex" "^5.2.0" - "@ethersproject/bignumber" "^5.2.0" - "@ethersproject/bytes" "^5.2.0" - "@ethersproject/constants" "^5.2.0" - "@ethersproject/hash" "^5.2.0" - "@ethersproject/logger" "^5.2.0" - "@ethersproject/networks" "^5.2.0" - "@ethersproject/properties" "^5.2.0" - "@ethersproject/random" "^5.2.0" - "@ethersproject/rlp" "^5.2.0" - "@ethersproject/sha2" "^5.2.0" - "@ethersproject/strings" "^5.2.0" - "@ethersproject/transactions" "^5.2.0" - "@ethersproject/web" "^5.2.0" +"@ethersproject/properties@5.4.0", "@ethersproject/properties@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/properties/-/properties-5.4.0.tgz#38ba20539b44dcc5d5f80c45ad902017dcdbefe7" + integrity sha512-7jczalGVRAJ+XSRvNA6D5sAwT4gavLq3OXPuV/74o3Rd2wuzSL035IMpIMgei4CYyBdialJMrTqkOnzccLHn4A== + dependencies: + "@ethersproject/logger" "^5.4.0" + +"@ethersproject/providers@5.4.1": + version "5.4.1" + resolved "https://registry.yarnpkg.com/@ethersproject/providers/-/providers-5.4.1.tgz#654267b563b833046b9c9647647cfc8267cb93b4" + integrity sha512-p06eiFKz8nu/5Ju0kIX024gzEQIgE5pvvGrBCngpyVjpuLtUIWT3097Agw4mTn9/dEA0FMcfByzFqacBMSgCVg== + dependencies: + "@ethersproject/abstract-provider" "^5.4.0" + "@ethersproject/abstract-signer" "^5.4.0" + "@ethersproject/address" "^5.4.0" + "@ethersproject/basex" "^5.4.0" + "@ethersproject/bignumber" "^5.4.0" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/constants" "^5.4.0" + "@ethersproject/hash" "^5.4.0" + "@ethersproject/logger" "^5.4.0" + "@ethersproject/networks" "^5.4.0" + "@ethersproject/properties" "^5.4.0" + "@ethersproject/random" "^5.4.0" + "@ethersproject/rlp" "^5.4.0" + "@ethersproject/sha2" "^5.4.0" + "@ethersproject/strings" "^5.4.0" + "@ethersproject/transactions" "^5.4.0" + "@ethersproject/web" "^5.4.0" bech32 "1.1.4" - ws "7.2.3" + ws "7.4.6" -"@ethersproject/random@5.2.0", "@ethersproject/random@^5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@ethersproject/random/-/random-5.2.0.tgz#1d7e19f17d88eda56228a263063826829e49eebe" - integrity sha512-7Nd3qjivBGlDCGDuGYjPi8CXdtVhRZ7NeyBXoJgtnJBwn1S01ahrbMeOUVmRVWrFM0YiSEPEGo7i4xEu2gRPcg== +"@ethersproject/random@5.4.0", "@ethersproject/random@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/random/-/random-5.4.0.tgz#9cdde60e160d024be39cc16f8de3b9ce39191e16" + integrity sha512-pnpWNQlf0VAZDEOVp1rsYQosmv2o0ITS/PecNw+mS2/btF8eYdspkN0vIXrCMtkX09EAh9bdk8GoXmFXM1eAKw== dependencies: - "@ethersproject/bytes" "^5.2.0" - "@ethersproject/logger" "^5.2.0" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/logger" "^5.4.0" -"@ethersproject/rlp@5.2.0", "@ethersproject/rlp@^5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@ethersproject/rlp/-/rlp-5.2.0.tgz#bbf605183818a9d96bdc40323d734c79e26cfaca" - integrity sha512-RqGsELtPWxcFhOOhSr0lQ2hBNT9tBE08WK0tb6VQbCk97EpqkbgP8yXED9PZlWMiRGchJTw6S+ExzK62XMX/fw== +"@ethersproject/rlp@5.4.0", "@ethersproject/rlp@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/rlp/-/rlp-5.4.0.tgz#de61afda5ff979454e76d3b3310a6c32ad060931" + integrity sha512-0I7MZKfi+T5+G8atId9QaQKHRvvasM/kqLyAH4XxBCBchAooH2EX5rL9kYZWwcm3awYV+XC7VF6nLhfeQFKVPg== dependencies: - "@ethersproject/bytes" "^5.2.0" - "@ethersproject/logger" "^5.2.0" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/logger" "^5.4.0" -"@ethersproject/sha2@5.2.0", "@ethersproject/sha2@^5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@ethersproject/sha2/-/sha2-5.2.0.tgz#ae18fa6c09c6d99fa2b564dac7276bcd513c1579" - integrity sha512-Wqqptfn0PRO2mvmpktPW1HOLrrCyGtxhVQxO1ZyePoGrcEOurhICOlIvkTogoX4Q928D3Z9XtSSCUbdOJUF2kg== +"@ethersproject/sha2@5.4.0", "@ethersproject/sha2@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/sha2/-/sha2-5.4.0.tgz#c9a8db1037014cbc4e9482bd662f86c090440371" + integrity sha512-siheo36r1WD7Cy+bDdE1BJ8y0bDtqXCOxRMzPa4bV1TGt/eTUUt03BHoJNB6reWJD8A30E/pdJ8WFkq+/uz4Gg== dependencies: - "@ethersproject/bytes" "^5.2.0" - "@ethersproject/logger" "^5.2.0" - hash.js "1.1.3" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/logger" "^5.4.0" + hash.js "1.1.7" -"@ethersproject/signing-key@5.2.0", "@ethersproject/signing-key@^5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@ethersproject/signing-key/-/signing-key-5.2.0.tgz#e8eb10d3c0f4a575479db8d70c62aaf93cd384d1" - integrity sha512-9A+dVSkrVAPuhJnWqLWV/NkKi/KB4iagTKEuojfuApUfeIHEhpwQ0Jx3cBimk7qWISSSKdgiAmIqpvVtZ5FEkg== +"@ethersproject/signing-key@5.4.0", "@ethersproject/signing-key@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/signing-key/-/signing-key-5.4.0.tgz#2f05120984e81cf89a3d5f6dec5c68ee0894fbec" + integrity sha512-q8POUeywx6AKg2/jX9qBYZIAmKSB4ubGXdQ88l40hmATj29JnG5pp331nAWwwxPn2Qao4JpWHNZsQN+bPiSW9A== dependencies: - "@ethersproject/bytes" "^5.2.0" - "@ethersproject/logger" "^5.2.0" - "@ethersproject/properties" "^5.2.0" - bn.js "^4.4.0" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/logger" "^5.4.0" + "@ethersproject/properties" "^5.4.0" + bn.js "^4.11.9" elliptic "6.5.4" + hash.js "1.1.7" -"@ethersproject/solidity@5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@ethersproject/solidity/-/solidity-5.2.0.tgz#ac902d8f8b11bf58fd37ccf77392178cbbd0b08f" - integrity sha512-EEFlNyEnONW3CWF8UGWPcqxJUHiaIoofO7itGwO/2gvGpnwlL+WUV+GmQoHNxmn+QJeOHspnZuh6NOVrJL6H1g== +"@ethersproject/solidity@5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/solidity/-/solidity-5.4.0.tgz#1305e058ea02dc4891df18b33232b11a14ece9ec" + integrity sha512-XFQTZ7wFSHOhHcV1DpcWj7VXECEiSrBuv7JErJvB9Uo+KfCdc3QtUZV+Vjh/AAaYgezUEKbCtE6Khjm44seevQ== dependencies: - "@ethersproject/bignumber" "^5.2.0" - "@ethersproject/bytes" "^5.2.0" - "@ethersproject/keccak256" "^5.2.0" - "@ethersproject/sha2" "^5.2.0" - "@ethersproject/strings" "^5.2.0" + "@ethersproject/bignumber" "^5.4.0" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/keccak256" "^5.4.0" + "@ethersproject/sha2" "^5.4.0" + "@ethersproject/strings" "^5.4.0" -"@ethersproject/strings@5.2.0", "@ethersproject/strings@^5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@ethersproject/strings/-/strings-5.2.0.tgz#e93d989859587191c3f64bda124d9dedbc3f5a97" - integrity sha512-RmjX800wRYKgrzo2ZCSlA8OCQYyq4+M46VgjSVDVyYkLZctBXC3epqlppDA24R7eo856KNbXqezZsMnHT+sSuA== +"@ethersproject/strings@5.4.0", "@ethersproject/strings@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/strings/-/strings-5.4.0.tgz#fb12270132dd84b02906a8d895ae7e7fa3d07d9a" + integrity sha512-k/9DkH5UGDhv7aReXLluFG5ExurwtIpUfnDNhQA29w896Dw3i4uDTz01Quaptbks1Uj9kI8wo9tmW73wcIEaWA== dependencies: - "@ethersproject/bytes" "^5.2.0" - "@ethersproject/constants" "^5.2.0" - "@ethersproject/logger" "^5.2.0" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/constants" "^5.4.0" + "@ethersproject/logger" "^5.4.0" -"@ethersproject/transactions@5.2.0", "@ethersproject/transactions@^5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@ethersproject/transactions/-/transactions-5.2.0.tgz#052e2ef8f8adf7037ebe4cc47aad2a61950e6491" - integrity sha512-QrGbhGYsouNNclUp3tWMbckMsuXJTOsA56kT3BuRrLlXJcUH7myIihajXdSfKcyJsvHJPrGZP+U3TKh+sLzZtg== - dependencies: - "@ethersproject/address" "^5.2.0" - "@ethersproject/bignumber" "^5.2.0" - "@ethersproject/bytes" "^5.2.0" - "@ethersproject/constants" "^5.2.0" - "@ethersproject/keccak256" "^5.2.0" - "@ethersproject/logger" "^5.2.0" - "@ethersproject/properties" "^5.2.0" - "@ethersproject/rlp" "^5.2.0" - "@ethersproject/signing-key" "^5.2.0" - -"@ethersproject/units@5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@ethersproject/units/-/units-5.2.0.tgz#08643e5d4583ecc1a32b103c1157f7ae80803392" - integrity sha512-yrwlyomXcBBHp5oSrLxlLkyHN7dVu3PO7hMbQXc00h388zU4TF3o/PAIUhh+x695wgJ19Fa8YgUWCab3a1RDwA== +"@ethersproject/transactions@5.4.0", "@ethersproject/transactions@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/transactions/-/transactions-5.4.0.tgz#a159d035179334bd92f340ce0f77e83e9e1522e0" + integrity sha512-s3EjZZt7xa4BkLknJZ98QGoIza94rVjaEed0rzZ/jB9WrIuu/1+tjvYCWzVrystXtDswy7TPBeIepyXwSYa4WQ== + dependencies: + "@ethersproject/address" "^5.4.0" + "@ethersproject/bignumber" "^5.4.0" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/constants" "^5.4.0" + "@ethersproject/keccak256" "^5.4.0" + "@ethersproject/logger" "^5.4.0" + "@ethersproject/properties" "^5.4.0" + "@ethersproject/rlp" "^5.4.0" + "@ethersproject/signing-key" "^5.4.0" + +"@ethersproject/units@5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/units/-/units-5.4.0.tgz#d57477a4498b14b88b10396062c8cbbaf20c79fe" + integrity sha512-Z88krX40KCp+JqPCP5oPv5p750g+uU6gopDYRTBGcDvOASh6qhiEYCRatuM/suC4S2XW9Zz90QI35MfSrTIaFg== dependencies: - "@ethersproject/bignumber" "^5.2.0" - "@ethersproject/constants" "^5.2.0" - "@ethersproject/logger" "^5.2.0" + "@ethersproject/bignumber" "^5.4.0" + "@ethersproject/constants" "^5.4.0" + "@ethersproject/logger" "^5.4.0" -"@ethersproject/wallet@5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@ethersproject/wallet/-/wallet-5.2.0.tgz#b5a8406676067e34f633536a4cb53c2ff98c0b5c" - integrity sha512-uPdjZwUmAJLo1+ybR/G/rL9pv/NEcCqOsjn6RJFvG7RmwP2kS1v5C+F+ysgx2W/PxBIVT+2IEsfXLbBz8s/6Rg== - dependencies: - "@ethersproject/abstract-provider" "^5.2.0" - "@ethersproject/abstract-signer" "^5.2.0" - "@ethersproject/address" "^5.2.0" - "@ethersproject/bignumber" "^5.2.0" - "@ethersproject/bytes" "^5.2.0" - "@ethersproject/hash" "^5.2.0" - "@ethersproject/hdnode" "^5.2.0" - "@ethersproject/json-wallets" "^5.2.0" - "@ethersproject/keccak256" "^5.2.0" - "@ethersproject/logger" "^5.2.0" - "@ethersproject/properties" "^5.2.0" - "@ethersproject/random" "^5.2.0" - "@ethersproject/signing-key" "^5.2.0" - "@ethersproject/transactions" "^5.2.0" - "@ethersproject/wordlists" "^5.2.0" - -"@ethersproject/web@5.2.0", "@ethersproject/web@^5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@ethersproject/web/-/web-5.2.0.tgz#47d8e152e7fcc07ba0aff4f99fde268fde79dd7a" - integrity sha512-mYb9qxGlOBFR2pR6t1CZczuqqX6r8RQGn7MtwrBciMex3cvA/qs+wbmcDgl+/OZY0Pco/ih6WHQRnVi+4sBeCQ== +"@ethersproject/wallet@5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/wallet/-/wallet-5.4.0.tgz#fa5b59830b42e9be56eadd45a16a2e0933ad9353" + integrity sha512-wU29majLjM6AjCjpat21mPPviG+EpK7wY1+jzKD0fg3ui5fgedf2zEu1RDgpfIMsfn8fJHJuzM4zXZ2+hSHaSQ== + dependencies: + "@ethersproject/abstract-provider" "^5.4.0" + "@ethersproject/abstract-signer" "^5.4.0" + "@ethersproject/address" "^5.4.0" + "@ethersproject/bignumber" "^5.4.0" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/hash" "^5.4.0" + "@ethersproject/hdnode" "^5.4.0" + "@ethersproject/json-wallets" "^5.4.0" + "@ethersproject/keccak256" "^5.4.0" + "@ethersproject/logger" "^5.4.0" + "@ethersproject/properties" "^5.4.0" + "@ethersproject/random" "^5.4.0" + "@ethersproject/signing-key" "^5.4.0" + "@ethersproject/transactions" "^5.4.0" + "@ethersproject/wordlists" "^5.4.0" + +"@ethersproject/web@5.4.0", "@ethersproject/web@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/web/-/web-5.4.0.tgz#49fac173b96992334ed36a175538ba07a7413d1f" + integrity sha512-1bUusGmcoRLYgMn6c1BLk1tOKUIFuTg8j+6N8lYlbMpDesnle+i3pGSagGNvwjaiLo4Y5gBibwctpPRmjrh4Og== dependencies: - "@ethersproject/base64" "^5.2.0" - "@ethersproject/bytes" "^5.2.0" - "@ethersproject/logger" "^5.2.0" - "@ethersproject/properties" "^5.2.0" - "@ethersproject/strings" "^5.2.0" + "@ethersproject/base64" "^5.4.0" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/logger" "^5.4.0" + "@ethersproject/properties" "^5.4.0" + "@ethersproject/strings" "^5.4.0" -"@ethersproject/wordlists@5.2.0", "@ethersproject/wordlists@^5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@ethersproject/wordlists/-/wordlists-5.2.0.tgz#afcce0229e9ef64af1bf8a1e96571fa441e9f444" - integrity sha512-/7TG5r/Zm8Wd9WhoqQ4QnntgMkIfIZ8QVrpU81muiChLD26XLOgmyiqKPL7K058uYt7UZ0wzbXjxyCYadU3xFQ== +"@ethersproject/wordlists@5.4.0", "@ethersproject/wordlists@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/wordlists/-/wordlists-5.4.0.tgz#f34205ec3bbc9e2c49cadaee774cf0b07e7573d7" + integrity sha512-FemEkf6a+EBKEPxlzeVgUaVSodU7G0Na89jqKjmWMlDB0tomoU8RlEMgUvXyqtrg8N4cwpLh8nyRnm1Nay1isA== dependencies: - "@ethersproject/bytes" "^5.2.0" - "@ethersproject/hash" "^5.2.0" - "@ethersproject/logger" "^5.2.0" - "@ethersproject/properties" "^5.2.0" - "@ethersproject/strings" "^5.2.0" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/hash" "^5.4.0" + "@ethersproject/logger" "^5.4.0" + "@ethersproject/properties" "^5.4.0" + "@ethersproject/strings" "^5.4.0" "@istanbuljs/load-nyc-config@^1.0.0": version "1.0.0" @@ -1556,17 +1733,17 @@ dependencies: commander "^2.20.0" -"@ledgerhq/cryptoassets@6.0.2", "@ledgerhq/cryptoassets@^6.0.2": - version "6.0.2" - resolved "https://registry.yarnpkg.com/@ledgerhq/cryptoassets/-/cryptoassets-6.0.2.tgz#52efb7d017722ad7806c98c5d4e9887ed54ab744" - integrity sha512-vBG4GFFhMNTt+Y9GRNCZVAH9SzzzL/GEOXA4dJ/rPwCgz9nxymTCtkJugK4KCzdyFwp6U1X+7s7BOz1F0bnu8g== +"@ledgerhq/cryptoassets@6.1.0", "@ledgerhq/cryptoassets@^6.1.0": + version "6.1.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/cryptoassets/-/cryptoassets-6.1.0.tgz#46b04f8928461653179663fef096b59a842add37" + integrity sha512-4j5vXxvbGjPdUK9x3UaMR04DfmSjXYnq7Dhg8IN+9DqJnvFyKHzcrj57hLw3w5amJZPa89OEukFJCe52G4rsZA== dependencies: invariant "2" -"@ledgerhq/devices@6.0.2", "@ledgerhq/devices@^6.0.2": - version "6.0.2" - resolved "https://registry.yarnpkg.com/@ledgerhq/devices/-/devices-6.0.2.tgz#cbf730368f00ddb5a4384f73bb4966371aa2a4c3" - integrity sha512-xR4RYXltXISH4Vf7bLgiaIRy4W3F+kvDXYhXY7Q72goR4NA+vAosuRLGFQZIQiuZZMdPCIbXHuysj07z/NsEpA== +"@ledgerhq/devices@6.1.0", "@ledgerhq/devices@^6.1.0": + version "6.1.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/devices/-/devices-6.1.0.tgz#54963409011c0bb83e2cc3d4d55ad9b905e296ff" + integrity sha512-Swl08sVuvx7IL9yx9P0ZzvwjIl4JXl51X34Po3pT2uRRaLnh/fRRSNe9tSC1gFMioviiLJlkmO+yydE4XeV+Jg== dependencies: "@ledgerhq/errors" "^6.0.2" "@ledgerhq/logs" "^6.0.2" @@ -1578,21 +1755,21 @@ resolved "https://registry.yarnpkg.com/@ledgerhq/errors/-/errors-6.0.2.tgz#7c88d16620db08c96de6a2636440db1c0e541da1" integrity sha512-m42ZMzR/EKpOrZfPR3DzusE98DoF3d03cbBkQG6ddm6diwVXFSa7MabaKzgD+41EYQ+hrCGOEZK1K0kosX1itg== -"@ledgerhq/hw-app-algorand@6.0.2": - version "6.0.2" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-algorand/-/hw-app-algorand-6.0.2.tgz#b13487bccbed67d9ad4cda99133ca41d39e87158" - integrity sha512-0HDzIvazqu/fSWitGtDZyAPNKR7FFrhDGHMcAILURaeZux+OojQ0pEdh9yBKWMfi4drAyqRLX7tsXEy6HB+nEg== +"@ledgerhq/hw-app-algorand@6.1.0": + version "6.1.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-algorand/-/hw-app-algorand-6.1.0.tgz#e1c653de33fc144249f6ce406c4df5c51c2b273b" + integrity sha512-TKNpCb3iBU8SIG5cIA3H9mEyWftO5UYrieKVVckXRdObKGKvVwhGTy512O3DibdR/wwBAskIkGnHdRWBnCb6kA== dependencies: "@ledgerhq/errors" "^6.0.2" - "@ledgerhq/hw-transport" "^6.0.2" + "@ledgerhq/hw-transport" "^6.1.0" bip32-path "^0.4.2" -"@ledgerhq/hw-app-btc@6.0.2": - version "6.0.2" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-btc/-/hw-app-btc-6.0.2.tgz#0cf125d3d8e60e7e7225e8e7c0e3491d60effeed" - integrity sha512-CODHZ0hy0VuKo2xn8ADpPyKIG4ge1kQz+Q+XXQgfJEE/ZOYpT0R9nOfR974Ocif44Q9u/k0QAbuD9Q9w2STMUg== +"@ledgerhq/hw-app-btc@6.1.0": + version "6.1.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-btc/-/hw-app-btc-6.1.0.tgz#a7ecc3e9a2ab4eddab73edde94cb8b49176e6bf4" + integrity sha512-lt11cdeuoB62xcUuhe5u3ZJcRM5APbb2hFdzk2N8xdMoJ8wI0vBYvLdM+hhZXzePTtVU/Bxdp3cs/UeDyBrxSg== dependencies: - "@ledgerhq/hw-transport" "^6.0.2" + "@ledgerhq/hw-transport" "^6.1.0" "@ledgerhq/logs" "^6.0.2" bip32-path "^0.4.2" invariant "^2.2.4" @@ -1600,96 +1777,96 @@ semver "^7.3.5" sha.js "2" -"@ledgerhq/hw-app-cosmos@6.0.2": - version "6.0.2" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-cosmos/-/hw-app-cosmos-6.0.2.tgz#1402ad306d3d3af562d3e91c61b69d3a7f57f873" - integrity sha512-BQ8e7NjzIWhVg8TR9GQvcsM3YnHL6/t82IrlQ6jCbnvkijpw/gYie6YLIvXaxojbH15hNgAtIsN2fjqIoLtPXQ== +"@ledgerhq/hw-app-cosmos@6.1.0": + version "6.1.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-cosmos/-/hw-app-cosmos-6.1.0.tgz#da429847645596be618f636ef32775aa40a0008b" + integrity sha512-0hoDGRQAc8G4Rim77fKqiV+RlXP3JUWlpu6U2Ch7EUAhhqB91/mpqjRcFiwLNLNrdxtYLS7nIF/LBDdGzU08Ag== dependencies: "@ledgerhq/errors" "^6.0.2" - "@ledgerhq/hw-transport" "^6.0.2" + "@ledgerhq/hw-transport" "^6.1.0" bip32-path "^0.4.2" -"@ledgerhq/hw-app-eth@6.0.2": - version "6.0.2" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-eth/-/hw-app-eth-6.0.2.tgz#d2e26756c084322643a9cc21f4b9c59cb7d72766" - integrity sha512-vAkn/cod5qucPI2D59uRpOXq/cmbXf96GCuaXQWCOEjMhENe+k/be6RuHh8TVah9fAWunBmcPHyLVeHj1oVSCA== +"@ledgerhq/hw-app-eth@6.1.0": + version "6.1.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-eth/-/hw-app-eth-6.1.0.tgz#1aeddd9d61bdfb04ec51d6cb666043feea208741" + integrity sha512-vWWSMcV5I+xzgQZlRpcX/8lTMyE7MylsuAMcaio8gLf+BbNA94ti5+aJLmJH8Dyh4bSSgbbYhVpdsbCL/i0zlQ== dependencies: - "@ledgerhq/cryptoassets" "^6.0.2" + "@ledgerhq/cryptoassets" "^6.1.0" "@ledgerhq/errors" "^6.0.2" - "@ledgerhq/hw-transport" "^6.0.2" + "@ledgerhq/hw-transport" "^6.1.0" "@ledgerhq/logs" "^6.0.2" bignumber.js "^9.0.1" - ethers "^5.2.0" + ethers "^5.4.1" -"@ledgerhq/hw-app-polkadot@6.0.2": - version "6.0.2" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-polkadot/-/hw-app-polkadot-6.0.2.tgz#1986a519d26ca3029646f0f83230cacee708ce85" - integrity sha512-OeQNSVfgFVcKAMGOJGCevUobgpjt9ByhG19/fZa5Av7f/KJFbItj5NctwvweH+W9sZJXFHCetHxwe6APuPNhkA== +"@ledgerhq/hw-app-polkadot@6.1.0": + version "6.1.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-polkadot/-/hw-app-polkadot-6.1.0.tgz#6b431099c595f9bbd3103a7de950e88b6cd2b8c1" + integrity sha512-EVLvd7gM7WjU366GBxCI60T6avkModHf0fCV8lNrO7BrTx1dx1EGttUOiMsFzVj5du81SwM2TOdPpES59Mo4zQ== dependencies: "@ledgerhq/errors" "^6.0.2" - "@ledgerhq/hw-transport" "^6.0.2" + "@ledgerhq/hw-transport" "^6.1.0" bip32-path "^0.4.2" -"@ledgerhq/hw-app-str@6.0.2": - version "6.0.2" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-str/-/hw-app-str-6.0.2.tgz#dfbd0c67acdd09befd24661c06bd632cd927f342" - integrity sha512-+VSIZzeJ7F9pU19TH74XjrjUYoGLYQ9DS1s9bGCvCep0Vd061dtXZwNhmnu7gWYKRHvLkEEMDZQHdARByHqR0w== +"@ledgerhq/hw-app-str@6.1.0": + version "6.1.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-str/-/hw-app-str-6.1.0.tgz#ab285821bf89ad4d21ae29e067abfe718416ca71" + integrity sha512-JipovJkRc9Qm+64VHxNyQxL/8+V5Fhxefxvg9f8rZvq2fLf4OHbC2w6ic3ZqIrjK6/fafrOT8JCrBX4ifi14fg== dependencies: - "@ledgerhq/hw-transport" "^6.0.2" + "@ledgerhq/hw-transport" "^6.1.0" base32.js "^0.1.0" sha.js "^2.3.6" tweetnacl "^1.0.3" -"@ledgerhq/hw-app-tezos@6.0.2": - version "6.0.2" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-tezos/-/hw-app-tezos-6.0.2.tgz#7086a10227c3f570ed25374b2d1f3589ce7eefc0" - integrity sha512-BMCd1r12I1RcqMZAa0RitL/jQxrLAr8AoFIW7L+0wehMHnppFghiBiMXa6VNs05diXd+lxOTkG7oyKd0Ax/3Og== +"@ledgerhq/hw-app-tezos@6.1.0": + version "6.1.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-tezos/-/hw-app-tezos-6.1.0.tgz#9beeb347eb4cb8a0346a80387929074249cf500f" + integrity sha512-YZPwyZnCA8nx1MRqx4nkdILyrn54rPxTO6C9qlC3jTPCqYfPTbrJ0RxZWyPp1A6Jpz1s6XLA1s1UW1ZINIq5bA== dependencies: - "@ledgerhq/hw-transport" "^6.0.2" + "@ledgerhq/hw-transport" "^6.1.0" blake2b "^2.1.3" bs58check "^2.1.2" invariant "^2.2.4" -"@ledgerhq/hw-app-trx@6.0.2": - version "6.0.2" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-trx/-/hw-app-trx-6.0.2.tgz#0a0749b0690effb7c57380bc5da97ab00a27bd52" - integrity sha512-cI4UnVYb6nlj3QfxB9kSOmf5ViH4p+ZFIvduU0iovnG9P+ynqd13ls2rtju6mobC1/aVk0TCx8n2I1jBrSUgGA== +"@ledgerhq/hw-app-trx@6.1.0": + version "6.1.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-trx/-/hw-app-trx-6.1.0.tgz#5e2b5f869db07cb1850bdc28dd02abcdf1e71537" + integrity sha512-fcA59hle9Ah495xe3K+42A70wrn1Yp5scGF0yiKXbXTLAWq95Dkjo7Aohza1ev6o/IN7g9rxGjJoIuVgAalS/g== dependencies: "@ledgerhq/errors" "^6.0.2" - "@ledgerhq/hw-transport" "^6.0.2" + "@ledgerhq/hw-transport" "^6.1.0" -"@ledgerhq/hw-app-xrp@6.0.2": - version "6.0.2" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-xrp/-/hw-app-xrp-6.0.2.tgz#c7470b68c40e3844641fd38a5349ec4da5257955" - integrity sha512-VlBUqSUJfE2ITBuwJSqfft9IPShVzGMaKJnSavyL/pHsK37e2zBbcth9GyeiKUVs+276gJsDJWM/HsD68359NA== +"@ledgerhq/hw-app-xrp@6.1.0": + version "6.1.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-xrp/-/hw-app-xrp-6.1.0.tgz#2d20bd5fd2a3b3fe196e756b95dcf63a7357b307" + integrity sha512-WXlEdfIpuLlr3l/xV6FfFmf6Lp/d5T3Dal7E2twyVWy39AHVEuw5vUdY+A7hcbZuZL0M8EKXdKjwKDKMU6f2qQ== dependencies: - "@ledgerhq/hw-transport" "^6.0.2" + "@ledgerhq/hw-transport" "^6.1.0" bip32-path "0.4.2" -"@ledgerhq/hw-transport-mocker@6.0.2": - version "6.0.2" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-mocker/-/hw-transport-mocker-6.0.2.tgz#7473b5fe60160dffd4b501a7af7e7ce0c4821219" - integrity sha512-ydd78CDXZjfV+MLynw5B7uinonKTMdBq5i3Ae478mU7YmJN7blUFQne4GEMPHkbW4Tx6iZGeT/rmbOPalnKwRw== +"@ledgerhq/hw-transport-mocker@6.1.0": + version "6.1.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-mocker/-/hw-transport-mocker-6.1.0.tgz#78d35fe1d424c5350fe79d996c876bc57d71972b" + integrity sha512-/UWP26fvoP+fT0Z9TzD/j/+nsmSQx3tsLN4x7sCYwdnur6CprdehtRIr9xbnDqZemGrddd/2sqyNiNAb3Ml5Iw== dependencies: - "@ledgerhq/hw-transport" "^6.0.2" + "@ledgerhq/hw-transport" "^6.1.0" "@ledgerhq/logs" "^6.0.2" -"@ledgerhq/hw-transport-node-speculos@6.0.2": - version "6.0.2" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-node-speculos/-/hw-transport-node-speculos-6.0.2.tgz#25dde72fbd8754891b7fec4ddf5a8175e2395407" - integrity sha512-UuQZ13gLbHtRvuL2H2RDNF3z8RVbDpA3WXrBz1Y3uFVFXHXZkr/XsZJ0kibXrBvtGt/T0vOq2/KhoNPe5zjYZw== +"@ledgerhq/hw-transport-node-speculos@6.1.0": + version "6.1.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-node-speculos/-/hw-transport-node-speculos-6.1.0.tgz#777f1223e25f22168387298a863d253ac539e78d" + integrity sha512-6dyxe9iQNcRJRrjRHv1unuVl+rWBp8oAvX477EYGdoEPLqA0+IDRncwbUCxsxkK+5eD84Azx1rAj/64k+UWUzQ== dependencies: "@ledgerhq/errors" "^6.0.2" - "@ledgerhq/hw-transport" "^6.0.2" + "@ledgerhq/hw-transport" "^6.1.0" "@ledgerhq/logs" "^6.0.2" rxjs "6" -"@ledgerhq/hw-transport@6.0.2", "@ledgerhq/hw-transport@^6.0.2": - version "6.0.2" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport/-/hw-transport-6.0.2.tgz#5b3a0cb01eb6adbd876916bc7d566226e505d333" - integrity sha512-JI8bhs0vQW1pjDeZ8/Cv/OT4iejH2F3j0i5z5mGNkSgs179GiGeM81EhStLB0XuXqxWpFZMnZ97/Cdo0XmffrA== +"@ledgerhq/hw-transport@6.1.0", "@ledgerhq/hw-transport@^6.1.0": + version "6.1.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport/-/hw-transport-6.1.0.tgz#b50151c6199e9ad6d3ab9e447532a22170c9f3b7" + integrity sha512-j9IyvksI9PjFoFrk/B3p8wCXWRWc8uK24gc20pAaXQiDtqMkWqEge8iZyPKWBVIv69vDQF3LE3Y6EeRwwA7wJA== dependencies: - "@ledgerhq/devices" "^6.0.2" + "@ledgerhq/devices" "^6.1.0" "@ledgerhq/errors" "^6.0.2" events "^3.3.0" @@ -1782,62 +1959,46 @@ hash.js "^1.1.7" randombytes "^2.1.0" -"@polkadot/metadata@3.11.1": - version "3.11.1" - resolved "https://registry.yarnpkg.com/@polkadot/metadata/-/metadata-3.11.1.tgz#c3e9645f6f78c8e02e0da695f3718b9d69f450a8" - integrity sha512-Z3KtOTX2kU+vvbRDiGY+qyPpF/4xTpnUipoNGijIGQ/EWWcgrm8sSgPzZQhHCfgIqM+jq3g9GvPMYeQp2Yy3ng== - dependencies: - "@babel/runtime" "^7.13.8" - "@polkadot/types" "3.11.1" - "@polkadot/types-known" "3.11.1" - "@polkadot/util" "^5.9.2" - "@polkadot/util-crypto" "^5.9.2" - bn.js "^4.11.9" - -"@polkadot/networks@5.9.2", "@polkadot/networks@^5.9.2": - version "5.9.2" - resolved "https://registry.yarnpkg.com/@polkadot/networks/-/networks-5.9.2.tgz#c687525b5886c9418f75240afe22b562ed88e2dd" - integrity sha512-JQyXJDJTZKQtn8y3HBHWDhiBfijhpiXjVEhY+fKvFcQ82TaKmzhnipYX0EdBoopZbuxpn/BJy6Y1Y/3y85EC+g== +"@polkadot/networks@7.0.1", "@polkadot/networks@^7.0.1": + version "7.0.1" + resolved "https://registry.yarnpkg.com/@polkadot/networks/-/networks-7.0.1.tgz#e07c4b88e25711433e76d24fce4c7273c25dd38b" + integrity sha512-bJSvI7UgEpxmBKS8TMh+I1mfmCMwhClGdSs29kwU+K61IjBTKTt3yQJ/SflYIQV7QftGbz3oMfSkGbQbRHZqvQ== dependencies: - "@babel/runtime" "^7.13.8" + "@babel/runtime" "^7.14.6" -"@polkadot/types-known@3.11.1": - version "3.11.1" - resolved "https://registry.yarnpkg.com/@polkadot/types-known/-/types-known-3.11.1.tgz#f695c9155fa54eeed95cea179bb8cb2398726bd3" - integrity sha512-ImAxyCdqblmlXaMlgvuXZ6wzZgOYgE40FgWaYRJpFXRGJLDwtcJcpVI+7m/ns5dJ3WujboEMOHVR1HPpquw8Jw== +"@polkadot/types-known@5.0.1": + version "5.0.1" + resolved "https://registry.yarnpkg.com/@polkadot/types-known/-/types-known-5.0.1.tgz#21feb327fc4323733bf027c8d874a2aa3014b21f" + integrity sha512-AIhPlN4r14ZW4wdwHZD2nIe1DE61ZO9PsyrCyAU3ysl6Cw6TI+txDCN3aS/8XYuC7wDLEgLB9vJv2sVWdCzqJg== dependencies: - "@babel/runtime" "^7.13.8" - "@polkadot/networks" "^5.9.2" - "@polkadot/types" "3.11.1" - "@polkadot/util" "^5.9.2" - bn.js "^4.11.9" + "@babel/runtime" "^7.14.6" + "@polkadot/networks" "^7.0.1" + "@polkadot/types" "5.0.1" + "@polkadot/util" "^7.0.1" -"@polkadot/types@3.11.1": - version "3.11.1" - resolved "https://registry.yarnpkg.com/@polkadot/types/-/types-3.11.1.tgz#c0188390dfda84d746d57f7818ad622ac6b1de8b" - integrity sha512-+BWsmveYVkLFx/csvPmU+NhNFhf+0srAt2d0f+7y663nitc/sng1AcEDPbrbXHSQVyPdvI20Mh4Escl4aR+TLw== +"@polkadot/types@5.0.1": + version "5.0.1" + resolved "https://registry.yarnpkg.com/@polkadot/types/-/types-5.0.1.tgz#2a4e23e452f999eeae175b595470df0e426a930d" + integrity sha512-aN6JKeF7ZYi5irYAaUoDqth6qlOlB15C5vhlDOojEorYLfRs/R+GCrO+lPSs+bKmSxh7BSRh500ikI/xD4nx5A== dependencies: - "@babel/runtime" "^7.13.8" - "@polkadot/metadata" "3.11.1" - "@polkadot/util" "^5.9.2" - "@polkadot/util-crypto" "^5.9.2" - "@polkadot/x-rxjs" "^5.9.2" - "@types/bn.js" "^4.11.6" - bn.js "^4.11.9" + "@babel/runtime" "^7.14.6" + "@polkadot/util" "^7.0.1" + "@polkadot/util-crypto" "^7.0.1" + rxjs "^7.2.0" -"@polkadot/util-crypto@^5.9.2": - version "5.9.2" - resolved "https://registry.yarnpkg.com/@polkadot/util-crypto/-/util-crypto-5.9.2.tgz#3858cfffe7732458b4a2b38ece01eaf52a3746c2" - integrity sha512-d8CW2grI3gWi6d/brmcZQWaMPHqQq5z7VcM74/v8D2KZ+hPYL3B0Jn8zGL1vtgMz2qdpWrZdAe89LBC8BvM9bw== - dependencies: - "@babel/runtime" "^7.13.8" - "@polkadot/networks" "5.9.2" - "@polkadot/util" "5.9.2" - "@polkadot/wasm-crypto" "^3.2.4" - "@polkadot/x-randomvalues" "5.9.2" +"@polkadot/util-crypto@^7.0.1": + version "7.0.1" + resolved "https://registry.yarnpkg.com/@polkadot/util-crypto/-/util-crypto-7.0.1.tgz#03109dc11323dad174fb2214d395855495def16a" + integrity sha512-dbvdsICoyOVw/K45RmHOP7wXE/7vj+NzEKGcKbiDt39nglHm6g2BTJ947PwwyNusTTAx82Q2iJ9vIZ1Kl0xG+g== + dependencies: + "@babel/runtime" "^7.14.6" + "@polkadot/networks" "7.0.1" + "@polkadot/util" "7.0.1" + "@polkadot/wasm-crypto" "^4.1.2" + "@polkadot/x-randomvalues" "7.0.1" base-x "^3.0.8" base64-js "^1.5.1" - blakejs "^1.1.0" + blakejs "^1.1.1" bn.js "^4.11.9" create-hash "^1.2.0" elliptic "^6.5.4" @@ -1847,82 +2008,125 @@ tweetnacl "^1.0.3" xxhashjs "^0.2.2" -"@polkadot/util@5.9.2", "@polkadot/util@^5.9.2": - version "5.9.2" - resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-5.9.2.tgz#ad2494e78ca6c3aadd6fb394a6be55020dc9b2a8" - integrity sha512-p225NJusnXeu7i2iAb8HAGWiMOUAnRaIyblIjJ4F89ZFZZ4amyliGxe5gKcyjRgxAJ44WdKyBLl/8L3rNv8hmQ== +"@polkadot/util@7.0.1", "@polkadot/util@^7.0.1": + version "7.0.1" + resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-7.0.1.tgz#79afd40473016876f51d65ebb9900a20108fe0a4" + integrity sha512-EtQlZL6ok0Ep+zRz2QHMUoJo/b3kFHVN2qqyD2+9sdqg0FGLmkzNFM+K6dasCMLXieJ1l0HoFsQppSo/leUeaA== dependencies: - "@babel/runtime" "^7.13.8" - "@polkadot/x-textdecoder" "5.9.2" - "@polkadot/x-textencoder" "5.9.2" + "@babel/runtime" "^7.14.6" + "@polkadot/x-textdecoder" "7.0.1" + "@polkadot/x-textencoder" "7.0.1" "@types/bn.js" "^4.11.6" bn.js "^4.11.9" camelcase "^5.3.1" ip-regex "^4.3.0" -"@polkadot/wasm-crypto-asmjs@^3.2.4": - version "3.2.4" - resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-asmjs/-/wasm-crypto-asmjs-3.2.4.tgz#837f5b723161b21670d13779eff4c061f7947577" - integrity sha512-fgN26iL+Pbb35OYsDIRHC74Xnwde+A5u3OjEcQ9zJhM391eOTuKsQ2gyC9TLNAKqeYH8pxsa27yjRO71We7FUA== +"@polkadot/wasm-crypto-asmjs@^4.1.2": + version "4.1.2" + resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-asmjs/-/wasm-crypto-asmjs-4.1.2.tgz#094b3eeeb5fd39a93db177583b48454511874cfc" + integrity sha512-3Q+vVUxDAC2tXgKMM3lKzx2JW+tarDpTjkvdxIKATyi8Ek69KkUqvMyJD0VL/iFZOFZED0YDX9UU4XOJ/astlg== dependencies: - "@babel/runtime" "^7.13.7" + "@babel/runtime" "^7.14.6" -"@polkadot/wasm-crypto-wasm@^3.2.4": - version "3.2.4" - resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-wasm/-/wasm-crypto-wasm-3.2.4.tgz#70885e06a813af91d81cf7e8ff826976fa99a38b" - integrity sha512-Q/3IEpoo7vkTzg40GxehRK000A9oBgjbh/uWCNQ8cMqWLYYCfzZy4NIzw8szpxNiSiGfGL0iZlP4ZSx2ZqEe2g== +"@polkadot/wasm-crypto-wasm@^4.1.2": + version "4.1.2" + resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-wasm/-/wasm-crypto-wasm-4.1.2.tgz#773c78c1d65886671d3ba1d66c31afd86c93d02f" + integrity sha512-/l4IBEdQ41szHdHkuF//z1qr+XmWuLHlpBA7s9Eb221m1Fir6AKoCHoh1hp1r3v0ecZYLKvak1B225w6JAU3Fg== dependencies: - "@babel/runtime" "^7.13.7" + "@babel/runtime" "^7.14.6" -"@polkadot/wasm-crypto@^3.2.4": - version "3.2.4" - resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto/-/wasm-crypto-3.2.4.tgz#c3e23ff728c1d5701215ae15ecdc605e96901989" - integrity sha512-poeRU91zzZza0ZectT63vBiAqh6DsHCyd3Ogx1U6jsYiRa0yuECMWJx1onvnseDW4tIqsC8vZ/9xHXWwhjTAVg== +"@polkadot/wasm-crypto@^4.1.2": + version "4.1.2" + resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto/-/wasm-crypto-4.1.2.tgz#dead71ae5d2f7722d23aed5be2112e1732d315e9" + integrity sha512-2EKdOjIrD2xHP2rC+0G/3Qo6926nL/18vCFkd34lBd9zP9YNF2GDEtDY+zAeDIRFKe1sQHTpsKgNdYSWoV2eBg== dependencies: - "@babel/runtime" "^7.13.7" - "@polkadot/wasm-crypto-asmjs" "^3.2.4" - "@polkadot/wasm-crypto-wasm" "^3.2.4" + "@babel/runtime" "^7.14.6" + "@polkadot/wasm-crypto-asmjs" "^4.1.2" + "@polkadot/wasm-crypto-wasm" "^4.1.2" -"@polkadot/x-global@5.9.2": - version "5.9.2" - resolved "https://registry.yarnpkg.com/@polkadot/x-global/-/x-global-5.9.2.tgz#e223d59536d168c7cbc49fc3a2052cbd71bd7256" - integrity sha512-wpY6IAOZMGiJQa8YMm7NeTLi9bwnqqVauR+v7HwyrssnGPuYX8heb6BQLOnnnPh/EK0+M8zNtwRBU48ez0/HOg== +"@polkadot/x-global@7.0.1": + version "7.0.1" + resolved "https://registry.yarnpkg.com/@polkadot/x-global/-/x-global-7.0.1.tgz#44fb248d3aaea557753318327149772969e96bff" + integrity sha512-gVVACSdRhHYRJejLEAL0mM9BZfY8N50VT2+15A7ALD1tVqwS4tz3P9vRW3Go7ZjfyAc83aEmh0PiQ8Nm1R+2Cg== dependencies: - "@babel/runtime" "^7.13.8" - "@types/node-fetch" "^2.5.8" - node-fetch "^2.6.1" + "@babel/runtime" "^7.14.6" -"@polkadot/x-randomvalues@5.9.2": - version "5.9.2" - resolved "https://registry.yarnpkg.com/@polkadot/x-randomvalues/-/x-randomvalues-5.9.2.tgz#563a76550f94107ce5a37c462ed067dc040626b1" - integrity sha512-Zv+eXSP3oBImMnB82y05Doo0A96WUFsQDbnLHI3jFHioIg848cL0nndB9TgBwPaFkZ2oiwoHEC8yxqNI6/jkzQ== +"@polkadot/x-randomvalues@7.0.1": + version "7.0.1" + resolved "https://registry.yarnpkg.com/@polkadot/x-randomvalues/-/x-randomvalues-7.0.1.tgz#32036ae5d48645a062f6a1c3ebbf227236c806b8" + integrity sha512-UNoIFaz1xJPozruT+lo8BTeT8A3NM3PgWuru7Vs8OsIz0Phkg7lUWlpHu9PZHyQCyKlUryvkOA692IlVlNYy2Q== dependencies: - "@babel/runtime" "^7.13.8" - "@polkadot/x-global" "5.9.2" + "@babel/runtime" "^7.14.6" + "@polkadot/x-global" "7.0.1" -"@polkadot/x-rxjs@^5.9.2": - version "5.9.2" - resolved "https://registry.yarnpkg.com/@polkadot/x-rxjs/-/x-rxjs-5.9.2.tgz#925b7c3325678b137ca30af6a726b22c5e8f9125" - integrity sha512-cuF4schclspOfAqEPvbcA3aQ9d3TBy2ORZ8YehxD0ZSHWJNhefHDIUDgS5T3NtPhSKgcEmSlI5TfVfgGFxgVMg== +"@polkadot/x-textdecoder@7.0.1": + version "7.0.1" + resolved "https://registry.yarnpkg.com/@polkadot/x-textdecoder/-/x-textdecoder-7.0.1.tgz#bb9bba94b2eb1612dd35c299f43ab74515db74d9" + integrity sha512-CFRnpI0cp1h2N1+ec551BLVLwV6OHG6Gj62EYcIOXR+o/SX/6MXm3Qcehm2YvfTKqktyIUSWmTwbWjGjuqPrpA== dependencies: - "@babel/runtime" "^7.13.8" - rxjs "^6.6.6" + "@babel/runtime" "^7.14.6" + "@polkadot/x-global" "7.0.1" -"@polkadot/x-textdecoder@5.9.2": - version "5.9.2" - resolved "https://registry.yarnpkg.com/@polkadot/x-textdecoder/-/x-textdecoder-5.9.2.tgz#2e69922acc426f91adc2629fea362e41c9035f25" - integrity sha512-MCkgITwGY3tG0UleDkBJEoiKGk/YWYwMM5OR6fNo07RymHRtJ8OLJC+Sej9QD05yz6TIhFaaRRYzmtungIcwTw== +"@polkadot/x-textencoder@7.0.1": + version "7.0.1" + resolved "https://registry.yarnpkg.com/@polkadot/x-textencoder/-/x-textencoder-7.0.1.tgz#181d403c5dc1d94fd1e2147fd1c5c528d30d8805" + integrity sha512-m+QL1HNiu5GMz6cfr/udSA6fUTv3RyIybJb7v43EQCxqlj/L0J3cUHapFd6tqH9PElD6jPkH1pXcgYN8e7dWTQ== dependencies: - "@babel/runtime" "^7.13.8" - "@polkadot/x-global" "5.9.2" + "@babel/runtime" "^7.14.6" + "@polkadot/x-global" "7.0.1" + +"@protobufjs/aspromise@^1.1.1", "@protobufjs/aspromise@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@protobufjs/aspromise/-/aspromise-1.1.2.tgz#9b8b0cc663d669a7d8f6f5d0893a14d348f30fbf" + integrity sha1-m4sMxmPWaafY9vXQiToU00jzD78= -"@polkadot/x-textencoder@5.9.2": - version "5.9.2" - resolved "https://registry.yarnpkg.com/@polkadot/x-textencoder/-/x-textencoder-5.9.2.tgz#67362e64bacfe6ff4eec73bf596873a2f9d9f36d" - integrity sha512-IjdLY3xy0nUfps1Bdi0tRxAX7X081YyoiSWExwqUkChdcYGMqMe3T2wqrrt9qBr2IkW8O/tlfYBiZXdII0YCcw== +"@protobufjs/base64@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@protobufjs/base64/-/base64-1.1.2.tgz#4c85730e59b9a1f1f349047dbf24296034bb2735" + integrity sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg== + +"@protobufjs/codegen@^2.0.4": + version "2.0.4" + resolved "https://registry.yarnpkg.com/@protobufjs/codegen/-/codegen-2.0.4.tgz#7ef37f0d010fb028ad1ad59722e506d9262815cb" + integrity sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg== + +"@protobufjs/eventemitter@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz#355cbc98bafad5978f9ed095f397621f1d066b70" + integrity sha1-NVy8mLr61ZePntCV85diHx0Ga3A= + +"@protobufjs/fetch@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/fetch/-/fetch-1.1.0.tgz#ba99fb598614af65700c1619ff06d454b0d84c45" + integrity sha1-upn7WYYUr2VwDBYZ/wbUVLDYTEU= dependencies: - "@babel/runtime" "^7.13.8" - "@polkadot/x-global" "5.9.2" + "@protobufjs/aspromise" "^1.1.1" + "@protobufjs/inquire" "^1.1.0" + +"@protobufjs/float@^1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@protobufjs/float/-/float-1.0.2.tgz#5e9e1abdcb73fc0a7cb8b291df78c8cbd97b87d1" + integrity sha1-Xp4avctz/Ap8uLKR33jIy9l7h9E= + +"@protobufjs/inquire@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/inquire/-/inquire-1.1.0.tgz#ff200e3e7cf2429e2dcafc1140828e8cc638f089" + integrity sha1-/yAOPnzyQp4tyvwRQIKOjMY48Ik= + +"@protobufjs/path@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@protobufjs/path/-/path-1.1.2.tgz#6cc2b20c5c9ad6ad0dccfd21ca7673d8d7fbf68d" + integrity sha1-bMKyDFya1q0NzP0hynZz2Nf79o0= + +"@protobufjs/pool@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/pool/-/pool-1.1.0.tgz#09fd15f2d6d3abfa9b65bc366506d6ad7846ff54" + integrity sha1-Cf0V8tbTq/qbZbw2ZQbWrXhG/1Q= + +"@protobufjs/utf8@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/utf8/-/utf8-1.1.0.tgz#a777360b5b39a1a2e5106f8e858f2fd2d060c570" + integrity sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA= "@sindresorhus/is@^0.7.0": version "0.7.0" @@ -2133,18 +2337,30 @@ resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.162.tgz#65d78c397e0d883f44afbf1f7ba9867022411470" integrity sha512-alvcho1kRUnnD1Gcl4J+hK0eencvzq9rmzvFPRmP5rPHx9VVsJj6bKLTATPVf9ktgv4ujzh7T+XWKp+jhuODig== -"@types/node-fetch@^2.5.8": - version "2.5.8" - resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.5.8.tgz#e199c835d234c7eb0846f6618012e558544ee2fb" - integrity sha512-fbjI6ja0N5ZA8TV53RUqzsKNkl9fv8Oj3T7zxW7FGv1GSH7gwJaNF8dzCjrqKaxKeUpTz4yT1DaJFq/omNpGfw== - dependencies: - "@types/node" "*" - form-data "^3.0.0" +"@types/long@^4.0.1": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@types/long/-/long-4.0.1.tgz#459c65fa1867dafe6a8f322c4c51695663cc55e9" + integrity sha512-5tXH6Bx/kNGd3MgffdmP4dy2Z+G4eaXw0SE81Tq3BNadtnMR5/ySMzX4SLEzHJzSmPNn4HIdpQsBvXMUykr58w== + +"@types/node@*", "@types/node@>= 8", "@types/node@>=13.7.0": + version "15.9.0" + resolved "https://registry.yarnpkg.com/@types/node/-/node-15.9.0.tgz#0b7f6c33ca5618fe329a9d832b478b4964d325a8" + integrity sha512-AR1Vq1Ei1GaA5FjKL5PBqblTZsL5M+monvGSZwe6sSIdGiuu7Xr/pNwWJY+0ZQuN8AapD/XMB5IzBAyYRFbocA== + +"@types/node@10.12.18": + version "10.12.18" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.18.tgz#1d3ca764718915584fcd9f6344621b7672665c67" + integrity sha512-fh+pAqt4xRzPfqA6eh3Z2y6fyZavRIumvjhaCL753+TVkGKGhpPeyrJG2JftD0T9q4GF00KjefsQ+PQNDdWQaQ== + +"@types/node@11.11.6": + version "11.11.6" + resolved "https://registry.yarnpkg.com/@types/node/-/node-11.11.6.tgz#df929d1bb2eee5afdda598a41930fe50b43eaa6a" + integrity sha512-Exw4yUWMBXM3X+8oqzJNRqZSwUAaS4+7NdvHqQuFi/d+synz++xmX3QIf+BFqneW8N31R8Ky+sikfZUXq07ggQ== -"@types/node@*", "@types/node@>= 8": - version "14.14.8" - resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.8.tgz#2127bd81949a95c8b7d3240f3254352d72563aec" - integrity sha512-z/5Yd59dCKI5kbxauAJgw6dLPzW+TNOItNE00PkpzNwUIEwdj/Lsqwq94H5DdYBX7C13aRA0CY32BK76+neEUA== +"@types/node@^13.7.0": + version "13.13.52" + resolved "https://registry.yarnpkg.com/@types/node/-/node-13.13.52.tgz#03c13be70b9031baaed79481c0c0cfb0045e53f7" + integrity sha512-s3nugnZumCC//n4moGGe6tkNMyYEdaDBitVjwPxXmR5lnMG5dHePinH2EdxkG3Rh1ghFHHixAG4NJhpJW1rthQ== "@types/normalize-package-data@^2.4.0": version "2.4.0" @@ -2307,10 +2523,10 @@ js-sha3 "0.8.0" query-string "6.13.5" -"@xstate/react@^1.3.4": - version "1.3.4" - resolved "https://registry.yarnpkg.com/@xstate/react/-/react-1.3.4.tgz#d79126c9eecc9a1225d553e3421aaad68eb5ee5e" - integrity sha512-uKbKriFYjgeqMeEAqOv8IWRM8WBx5i/4pMPGpqo58wd7sInhFmmK6HWfV7eX3nD/vJPfxWielNMxAUCUdVh1pA== +"@xstate/react@^1.5.1": + version "1.5.1" + resolved "https://registry.yarnpkg.com/@xstate/react/-/react-1.5.1.tgz#60817e60e54e338b8e7c3e51bfa4cd3babebdc7d" + integrity sha512-DJHDqDlZHus08X98uMJw4KR17FRWBXLHMQ02YRxx0DMm5VLn75VwGyt4tXdlNZHQWjyk++C5c9Ichq3PdmM3og== dependencies: use-isomorphic-layout-effect "^1.0.0" use-subscription "^1.3.0" @@ -2601,7 +2817,7 @@ axe-core@^4.0.2: resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.0.2.tgz#c7cf7378378a51fcd272d3c09668002a4990b1cb" integrity sha512-arU1h31OGFu+LPrOLGZ7nB45v940NMDMEJeNmbutu57P+UFDVnkZg3e+J1I2HJRZ9hT7gO8J91dn/PMrAiKakA== -axios@0.21.1: +axios@0.21.1, axios@^0.21.1: version "0.21.1" resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.1.tgz#22563481962f4d6bde9a76d516ef0e5d3c09b2b8" integrity sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA== @@ -2741,7 +2957,7 @@ base32.js@^0.1.0: resolved "https://registry.yarnpkg.com/base32.js/-/base32.js-0.1.0.tgz#b582dec693c2f11e893cf064ee6ac5b6131a2202" integrity sha1-tYLexpPC8R6JPPBk7mrFthMaIgI= -base64-js@^1.0.2, base64-js@^1.3.1, base64-js@^1.5.1: +base64-js@^1.0.2, base64-js@^1.3.0, base64-js@^1.3.1, base64-js@^1.5.1: version "1.5.1" resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== @@ -2776,7 +2992,7 @@ bcrypt-pbkdf@^1.0.0: dependencies: tweetnacl "^0.14.3" -bech32@1.1.4: +bech32@1.1.4, bech32@^1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/bech32/-/bech32-1.1.4.tgz#e38c9f37bf179b8eb16ae3a772b40c356d4832e9" integrity sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ== @@ -2804,6 +3020,11 @@ big-integer@^1.6.17, big-integer@^1.6.48: resolved "https://registry.yarnpkg.com/big-integer/-/big-integer-1.6.48.tgz#8fd88bd1632cba4a1c8c3e3d7159f08bb95b4b9e" integrity sha512-j51egjPa7/i+RdiRuJbPdJ2FIUYYPhvYLjzoYbcMMm62ooO6F94fETG4MTs46zPAF9Brs04OajboA/qTGuz78w== +big.js@6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/big.js/-/big.js-6.0.0.tgz#d3806d83d93d67faaf29bfca2d2c45d02160da04" + integrity sha512-PGsJX+jhBY5qaGOymm4V1QMM2oOCtfGdW8CxgbDTg17C/qHeW89jhx6Kpda3vS0uPHFT6sEhwbb5tlc0wmA+wQ== + bignumber.js@^4.0.0: version "4.1.0" resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-4.1.0.tgz#db6f14067c140bd46624815a7916c92d9b6c24b1" @@ -2832,7 +3053,7 @@ binary@~0.3.0: buffers "~0.1.1" chainsaw "~0.1.0" -bindings@^1.2.1: +bindings@^1.2.1, bindings@^1.3.0: version "1.5.0" resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.5.0.tgz#10353c9e945334bc0511a6d90b38fbc7c9c504df" integrity sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ== @@ -2844,6 +3065,39 @@ bip32-path@0.4.2, bip32-path@^0.4.2: resolved "https://registry.yarnpkg.com/bip32-path/-/bip32-path-0.4.2.tgz#5db0416ad6822712f077836e2557b8697c0c7c99" integrity sha1-XbBBataCJxLwd4NuJVe4aXwMfJk= +bip32@2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/bip32/-/bip32-2.0.6.tgz#6a81d9f98c4cd57d05150c60d8f9e75121635134" + integrity sha512-HpV5OMLLGTjSVblmrtYRfFFKuQB+GArM0+XP8HGWfJ5vxYBqo+DesvJwOdC2WJ3bCkZShGf0QIfoIpeomVzVdA== + dependencies: + "@types/node" "10.12.18" + bs58check "^2.1.1" + create-hash "^1.2.0" + create-hmac "^1.1.7" + tiny-secp256k1 "^1.1.3" + typeforce "^1.11.5" + wif "^2.0.6" + +bip39@3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/bip39/-/bip39-3.0.2.tgz#2baf42ff3071fc9ddd5103de92e8f80d9257ee32" + integrity sha512-J4E1r2N0tUylTKt07ibXvhpT2c5pyAFgvuA5q1H9uDy6dEGpjV8jmymh3MTYJDLCNbIVClSB9FbND49I6N24MQ== + dependencies: + "@types/node" "11.11.6" + create-hash "^1.1.0" + pbkdf2 "^3.0.9" + randombytes "^2.0.1" + +bip39@^3.0.2: + version "3.0.4" + resolved "https://registry.yarnpkg.com/bip39/-/bip39-3.0.4.tgz#5b11fed966840b5e1b8539f0f54ab6392969b2a0" + integrity sha512-YZKQlb752TrUWqHWj7XAwCSjYEgGAk+/Aas3V7NyjQeZYsztO8JnQUaCWhcnL4T+jL8nvB8typ2jRPzTlgugNw== + dependencies: + "@types/node" "11.11.6" + create-hash "^1.1.0" + pbkdf2 "^3.0.9" + randombytes "^2.0.1" + blake2b-wasm@^1.1.0: version "1.1.7" resolved "https://registry.yarnpkg.com/blake2b-wasm/-/blake2b-wasm-1.1.7.tgz#e4d075da10068e5d4c3ec1fb9accc4d186c55d81" @@ -2859,10 +3113,10 @@ blake2b@^2.1.3: blake2b-wasm "^1.1.0" nanoassert "^1.0.0" -blakejs@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/blakejs/-/blakejs-1.1.0.tgz#69df92ef953aa88ca51a32df6ab1c54a155fc7a5" - integrity sha1-ad+S75U6qIylGjLfarHFShVfx6U= +blakejs@^1.1.0, blakejs@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/blakejs/-/blakejs-1.1.1.tgz#bf313053978b2cd4c444a48795710be05c785702" + integrity sha512-bLG6PHOCZJKNshTjGRBvET0vTciwQE6zFKOKKXPDJfwFBd4Ac0yBfPZqcGvGJap50l7ktvlpFqc2jGVaUgbJgg== bluebird@~3.4.1: version "3.4.7" @@ -2874,7 +3128,7 @@ bn.js@4.11.8: resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f" integrity sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA== -bn.js@^4.11.0, bn.js@^4.11.1, bn.js@^4.11.8, bn.js@^4.11.9, bn.js@^4.4.0: +bn.js@^4.11.0, bn.js@^4.11.1, bn.js@^4.11.8, bn.js@^4.11.9: version "4.12.0" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88" integrity sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA== @@ -2955,7 +3209,7 @@ bs58@^4.0.0, bs58@^4.0.1: dependencies: base-x "^3.0.2" -bs58check@2.1.2, bs58check@^2.1.2: +bs58check@2.1.2, bs58check@<3.0.0, bs58check@^2.1.1, bs58check@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/bs58check/-/bs58check-2.1.2.tgz#53b018291228d82a5aa08e7d796fdafda54aebfc" integrity sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA== @@ -2999,6 +3253,14 @@ buffer@5.6.0: base64-js "^1.0.2" ieee754 "^1.1.4" +buffer@5.6.1: + version "5.6.1" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.6.1.tgz#b99419405f4290a7a1f20b51037cee9f1fbd7f6a" + integrity sha512-2z15UUHpS9/3tk9mY/q+Rl3rydOi7yMp5XWNQnRvoz+mJwiv8brqYwp9a+nOCtma6dwuEIxljD8W3ysVBZ05Vg== + dependencies: + base64-js "^1.3.1" + ieee754 "^1.1.13" + buffer@^5.1.0: version "5.7.1" resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.7.1.tgz#ba62e7c13133053582197160851a8f648e99eed0" @@ -3278,7 +3540,7 @@ colorspace@1.1.x: color "3.0.x" text-hex "1.0.x" -combined-stream@^1.0.6, combined-stream@^1.0.8, combined-stream@~1.0.6: +combined-stream@^1.0.6, combined-stream@~1.0.6: version "1.0.8" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== @@ -3290,10 +3552,10 @@ commander@^2.11.0, commander@^2.20.0: resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== -commander@^4.0.1: - version "4.1.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-4.1.0.tgz#545983a0603fe425bc672d66c9e3c89c42121a83" - integrity sha512-NIQrwvv9V39FHgGFm36+U9SMQzbiHvU79k+iADraJTpmrFFfx7Ds0IvDoAdZsDrknlkRk14OYoWXb57uTh7/sw== +commander@^4.0.0, commander@^4.0.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/commander/-/commander-4.1.1.tgz#9fd602bd936294e9e9ef46a3f4d6964044b18068" + integrity sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA== component-emitter@^1.2.1: version "1.3.0" @@ -3368,7 +3630,7 @@ crc@^3.5.0: dependencies: buffer "^5.1.0" -create-hash@^1.1.0, create-hash@^1.1.2, create-hash@^1.2.0: +create-hash@1.2.0, create-hash@^1.1.0, create-hash@^1.1.2, create-hash@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.2.0.tgz#889078af11a63756bcfb59bd221996be3a9ef196" integrity sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg== @@ -3647,7 +3909,7 @@ electron-to-chromium@^1.3.723: resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.736.tgz#f632d900a1f788dab22fec9c62ec5c9c8f0c4052" integrity sha512-DY8dA7gR51MSo66DqitEQoUMQ0Z+A2DSXFi7tK304bdTVqczCAfUuyQw6Wdg8hIoo5zIxkU1L24RQtUce1Ioig== -elliptic@6.5.4, elliptic@^6.5.2, elliptic@^6.5.4: +elliptic@6.5.4, elliptic@^6.4.0, elliptic@^6.5.2, elliptic@^6.5.3, elliptic@^6.5.4: version "6.5.4" resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.4.tgz#da37cebd31e79a1367e941b592ed1fbebd58abbb" integrity sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ== @@ -3707,6 +3969,14 @@ enquirer@^2.3.5: dependencies: ansi-colors "^3.2.1" +env-cmd@*: + version "10.1.0" + resolved "https://registry.yarnpkg.com/env-cmd/-/env-cmd-10.1.0.tgz#c7f5d3b550c9519f137fdac4dd8fb6866a8c8c4b" + integrity sha512-mMdWTT9XKN7yNth/6N6g2GuKuJTsKMDHlQFUDacb/heQRRWOTIZ42t1rMHnQu4jYxU1ajdTeJM+9eEETlqToMA== + dependencies: + commander "^4.0.0" + cross-spawn "^7.0.0" + error-ex@^1.2.0, error-ex@^1.3.1: version "1.3.2" resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" @@ -4096,41 +4366,41 @@ ethereumjs-util@^7.0.10: ethjs-util "0.1.6" rlp "^2.2.4" -ethers@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.2.0.tgz#13452e35947ab5d77053286d1f7161ee666c85ba" - integrity sha512-HqFGU2Qab0mAg3y1eHKVMXS4i1gTObMY0/4+x4LiO72NHhJL3Z795gnqyivmwG1J8e5NLSlRSfyIR7TL0Hw3ig== - dependencies: - "@ethersproject/abi" "5.2.0" - "@ethersproject/abstract-provider" "5.2.0" - "@ethersproject/abstract-signer" "5.2.0" - "@ethersproject/address" "5.2.0" - "@ethersproject/base64" "5.2.0" - "@ethersproject/basex" "5.2.0" - "@ethersproject/bignumber" "5.2.0" - "@ethersproject/bytes" "5.2.0" - "@ethersproject/constants" "5.2.0" - "@ethersproject/contracts" "5.2.0" - "@ethersproject/hash" "5.2.0" - "@ethersproject/hdnode" "5.2.0" - "@ethersproject/json-wallets" "5.2.0" - "@ethersproject/keccak256" "5.2.0" - "@ethersproject/logger" "5.2.0" - "@ethersproject/networks" "5.2.0" - "@ethersproject/pbkdf2" "5.2.0" - "@ethersproject/properties" "5.2.0" - "@ethersproject/providers" "5.2.0" - "@ethersproject/random" "5.2.0" - "@ethersproject/rlp" "5.2.0" - "@ethersproject/sha2" "5.2.0" - "@ethersproject/signing-key" "5.2.0" - "@ethersproject/solidity" "5.2.0" - "@ethersproject/strings" "5.2.0" - "@ethersproject/transactions" "5.2.0" - "@ethersproject/units" "5.2.0" - "@ethersproject/wallet" "5.2.0" - "@ethersproject/web" "5.2.0" - "@ethersproject/wordlists" "5.2.0" +ethers@^5.4.1: + version "5.4.1" + resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.4.1.tgz#bcff1e9f45bf1a061bf313ec04e8d9881d2d53f9" + integrity sha512-SrcddMdCgP1hukDvCPd87Aipbf4NWjQvdfAbZ65XSZGbfyuYPtIrUJPDH5B1SBRsdlfiEgX3eoz28DdBDzMNFg== + dependencies: + "@ethersproject/abi" "5.4.0" + "@ethersproject/abstract-provider" "5.4.0" + "@ethersproject/abstract-signer" "5.4.0" + "@ethersproject/address" "5.4.0" + "@ethersproject/base64" "5.4.0" + "@ethersproject/basex" "5.4.0" + "@ethersproject/bignumber" "5.4.0" + "@ethersproject/bytes" "5.4.0" + "@ethersproject/constants" "5.4.0" + "@ethersproject/contracts" "5.4.0" + "@ethersproject/hash" "5.4.0" + "@ethersproject/hdnode" "5.4.0" + "@ethersproject/json-wallets" "5.4.0" + "@ethersproject/keccak256" "5.4.0" + "@ethersproject/logger" "5.4.0" + "@ethersproject/networks" "5.4.1" + "@ethersproject/pbkdf2" "5.4.0" + "@ethersproject/properties" "5.4.0" + "@ethersproject/providers" "5.4.1" + "@ethersproject/random" "5.4.0" + "@ethersproject/rlp" "5.4.0" + "@ethersproject/sha2" "5.4.0" + "@ethersproject/signing-key" "5.4.0" + "@ethersproject/solidity" "5.4.0" + "@ethersproject/strings" "5.4.0" + "@ethersproject/transactions" "5.4.0" + "@ethersproject/units" "5.4.0" + "@ethersproject/wallet" "5.4.0" + "@ethersproject/web" "5.4.0" + "@ethersproject/wordlists" "5.4.0" ethjs-util@0.1.6, ethjs-util@^0.1.3: version "0.1.6" @@ -4447,15 +4717,6 @@ forever-agent@~0.6.1: resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE= -form-data@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-3.0.0.tgz#31b7e39c85f1355b7139ee0c647cf0de7f83c682" - integrity sha512-CKMFDglpbMi6PyN+brwB9Q/GOw0eAnsrEZDgcsH5Krhz5Od/haKHAX0NmQfha2zPPz0JpWzA7GJHGSnvCRLWsg== - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.8" - mime-types "^2.1.12" - form-data@~2.3.2: version "2.3.3" resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" @@ -4634,6 +4895,13 @@ globals@^13.6.0: dependencies: type-fest "^0.20.2" +globalthis@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/globalthis/-/globalthis-1.0.2.tgz#2a235d34f4d8036219f7e34929b5de9e18166b8b" + integrity sha512-ZQnSFO1la8P7auIOQECnm0sSuoMeaSq0EEdXMBFF2QJO4uNcwbyhSgG3MruWNbFTqCLmxVwGOl7LZ9kASvHdeQ== + dependencies: + define-properties "^1.1.3" + got@^8.3.2: version "8.3.2" resolved "https://registry.yarnpkg.com/got/-/got-8.3.2.tgz#1d23f64390e97f776cac52e5b936e5f514d2e937" @@ -4759,15 +5027,7 @@ hash-base@^3.0.0: readable-stream "^3.6.0" safe-buffer "^5.2.0" -hash.js@1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.3.tgz#340dedbe6290187151c1ea1d777a3448935df846" - integrity sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA== - dependencies: - inherits "^2.0.3" - minimalistic-assert "^1.0.0" - -hash.js@^1.0.0, hash.js@^1.0.3, hash.js@^1.1.7: +hash.js@1.1.7, hash.js@^1.0.0, hash.js@^1.0.3, hash.js@^1.1.7: version "1.1.7" resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.7.tgz#0babca538e8d4ee4a0f8988d68866537a003cf42" integrity sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA== @@ -5711,6 +5971,11 @@ js-sha3@0.8.0, js-sha3@^0.8.0: resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.8.0.tgz#b9b7a5da73afad7dedd0f8c463954cbde6818840" integrity sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q== +js-sha512@^0.8.0: + version "0.8.0" + resolved "https://registry.yarnpkg.com/js-sha512/-/js-sha512-0.8.0.tgz#dd22db8d02756faccf19f218e3ed61ec8249f7d4" + integrity sha512-PWsmefG6Jkodqt+ePTvBZCSMFgN7Clckjd0O7su3I0+BW2QWUTJNzjktHsztGLhncP2h8mcF9V9Y2Ha59pAViQ== + "js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" @@ -5975,6 +6240,18 @@ levn@~0.3.0: prelude-ls "~1.1.2" type-check "~0.3.2" +libsodium-wrappers@^0.7.6: + version "0.7.9" + resolved "https://registry.yarnpkg.com/libsodium-wrappers/-/libsodium-wrappers-0.7.9.tgz#4ffc2b69b8f7c7c7c5594a93a4803f80f6d0f346" + integrity sha512-9HaAeBGk1nKTRFRHkt7nzxqCvnkWTjn1pdjKgcUnZxj0FyOP4CnhgFhMdrFfgNsukijBGyBLpP2m2uKT1vuWhQ== + dependencies: + libsodium "^0.7.0" + +libsodium@^0.7.0: + version "0.7.9" + resolved "https://registry.yarnpkg.com/libsodium/-/libsodium-0.7.9.tgz#4bb7bcbf662ddd920d8795c227ae25bbbfa3821b" + integrity sha512-gfeADtR4D/CM0oRUviKBViMGXZDgnFdMKMzHsvBdqLBHd9ySi6EtYnmuhHVDDYgYpAO8eU8hEY+F8vIUAPh08A== + lines-and-columns@^1.1.6: version "1.1.6" resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.1.6.tgz#1c00c743b433cd0a4e80758f7b64a57440d9ff00" @@ -6048,7 +6325,7 @@ lodash.uniq@^4.5.0: resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M= -lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.17.4, lodash@^4.17.5: +lodash@4.17.21, lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.17.4, lodash@^4.17.5: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -6064,6 +6341,11 @@ logform@^2.2.0: ms "^2.1.1" triple-beam "^1.3.0" +long@4.0.0, long@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/long/-/long-4.0.0.tgz#9a7b71cfb7d361a194ea555241c92f7468d5bf28" + integrity sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA== + long@^2.2.3: version "2.4.0" resolved "https://registry.yarnpkg.com/long/-/long-2.4.0.tgz#9fa180bb1d9500cdc29c4156766a1995e1f4524f" @@ -6279,7 +6561,7 @@ ms@2.1.2, ms@^2.1.1: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== -nan@^2.14.0, nan@^2.2.1: +nan@^2.13.2, nan@^2.14.0, nan@^2.2.1: version "2.14.2" resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.2.tgz#f5376400695168f4cc694ac9393d0c9585eeea19" integrity sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ== @@ -6321,7 +6603,7 @@ node-addon-api@^2.0.0: resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-2.0.2.tgz#432cfa82962ce494b132e9d72a15b29f71ff5d32" integrity sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA== -node-fetch@^2.3.0, node-fetch@^2.6.1: +node-fetch@^2.3.0: version "2.6.1" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw== @@ -6583,6 +6865,13 @@ os-name@^3.1.0: macos-release "^2.2.0" windows-release "^3.1.0" +ow@0.17.0: + version "0.17.0" + resolved "https://registry.yarnpkg.com/ow/-/ow-0.17.0.tgz#4f938999fed6264c9048cd6254356e0f1e7f688c" + integrity sha512-i3keDzDQP5lWIe4oODyDFey1qVrq2hXKTuTH2VpqwpYtzPiKZt2ziRI4NBQmgW40AnV5Euz17OyWweCb+bNEQA== + dependencies: + type-fest "^0.11.0" + p-cancelable@^0.4.0: version "0.4.1" resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-0.4.1.tgz#35f363d67d52081c8d9585e37bcceb7e0bbcb2a0" @@ -6751,10 +7040,10 @@ path-type@^4.0.0: resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== -pbkdf2@^3.0.17: - version "3.1.1" - resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.1.1.tgz#cb8724b0fada984596856d1a6ebafd3584654b94" - integrity sha512-4Ejy1OPxi9f2tt1rRV7Go7zmfDQ+ZectEQz3VGUQhgq62HtIRPDyG/JtnwIxs6x3uNMwo2V7q1fMvKjb+Tnpqg== +pbkdf2@^3.0.17, pbkdf2@^3.0.9: + version "3.1.2" + resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.1.2.tgz#dd822aa0887580e52f1a039dc3eda108efae3075" + integrity sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA== dependencies: create-hash "^1.1.2" create-hmac "^1.1.4" @@ -6897,6 +7186,63 @@ prop-types@^15.7.2: object-assign "^4.1.1" react-is "^16.8.1" +protobufjs@6.10.1: + version "6.10.1" + resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-6.10.1.tgz#e6a484dd8f04b29629e9053344e3970cccf13cd2" + integrity sha512-pb8kTchL+1Ceg4lFd5XUpK8PdWacbvV5SK2ULH2ebrYtl4GjJmS24m6CKME67jzV53tbJxHlnNOSqQHbTsR9JQ== + 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" + +protobufjs@^6.8.8: + version "6.11.2" + resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-6.11.2.tgz#de39fabd4ed32beaa08e9bb1e30d08544c1edf8b" + integrity sha512-4BQJoPooKJl2G9j3XftkIXjoC9C0Av2NOrWmbLWT1vH32GcSUHjM0Arra6UfTsVyfMAuFzaLucXn1sadxJydAw== + 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" + +protobufjs@~6.10.2: + version "6.10.2" + resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-6.10.2.tgz#b9cb6bd8ec8f87514592ba3fdfd28e93f33a469b" + integrity sha512-27yj+04uF6ya9l+qfpH187aqEzfCF4+Uit0I9ZBQVqK09hk/SQzKa2MUqUpXaVa7LOFRg1TSSr3lVxGOk6c0SQ== + 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" + psl@^1.1.28: version "1.7.0" resolved "https://registry.yarnpkg.com/psl/-/psl-1.7.0.tgz#f1c4c47a8ef97167dea5d6bbf4816d736e884a3c" @@ -6943,7 +7289,7 @@ querystringify@^2.1.1: resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-2.2.0.tgz#3345941b4153cb9d082d8eee4cda2016a9aef7f6" integrity sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ== -randombytes@^2.1.0: +randombytes@2.1.0, randombytes@^2.0.1, randombytes@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== @@ -7081,6 +7427,11 @@ readdirp@~3.5.0: dependencies: picomatch "^2.2.1" +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== + rechoir@^0.6.2: version "0.6.2" resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384" @@ -7378,10 +7729,10 @@ ripple-lib-transactionparser@0.8.2: bignumber.js "^9.0.0" lodash "^4.17.15" -ripple-lib@1.9.5: - version "1.9.5" - resolved "https://registry.yarnpkg.com/ripple-lib/-/ripple-lib-1.9.5.tgz#6238c8869cc1353add3c8000016fabb6a1e72afe" - integrity sha512-de5lhHimuBM1TqtWNEobUDOToXK1VoB+svP9kvb8xy9cBRza5/kWWAR7FkQ2e1kPNXMR6G51HNPfTattCb9T9g== +ripple-lib@1.9.6: + version "1.9.6" + resolved "https://registry.yarnpkg.com/ripple-lib/-/ripple-lib-1.9.6.tgz#c3c071390597effc0ec191e22c9575108cd795f8" + integrity sha512-EJlbOWIqO8nDzHr/oO+/n7RvwGYAilRJPK/iwZjxPp5o+jNEBdHz1uVleAobasXS4tiVfBBDUP0nfhsxvluOWQ== dependencies: "@types/lodash" "^4.14.136" "@types/ws" "^7.2.0" @@ -7413,13 +7764,20 @@ rxjs-compat@^6.6.7: resolved "https://registry.yarnpkg.com/rxjs-compat/-/rxjs-compat-6.6.7.tgz#6eb4ef75c0a58ea672854a701ccc8d49f41e69cb" integrity sha512-szN4fK+TqBPOFBcBcsR0g2cmTTUF/vaFEOZNuSdfU8/pGFnNmmn2u8SystYXG1QMrjOPBc6XTKHMVfENDf6hHw== -rxjs@6, rxjs@^6.6.6: +rxjs@6: version "6.6.7" resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.7.tgz#90ac018acabf491bf65044235d5863c4dab804c9" integrity sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ== dependencies: tslib "^1.9.0" +rxjs@^7.2.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.2.0.tgz#5cd12409639e9514a71c9f5f9192b2c4ae94de31" + integrity sha512-aX8w9OpKrQmiPKfT1bqETtUr9JygIz6GZ+gql8v7CijClsP0laoFUdKzxFAoWuRdSlOdU2+crss+cMf+cqMTnw== + dependencies: + tslib "~2.1.0" + safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@~5.2.0: version "5.2.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" @@ -7487,7 +7845,7 @@ scryptsy@^2.1.0: resolved "https://registry.yarnpkg.com/scryptsy/-/scryptsy-2.1.0.tgz#8d1e8d0c025b58fdd25b6fa9a0dc905ee8faa790" integrity sha512-1CdSqHQowJBnMAFyPEBRfqag/YP9OF394FV+4YREIJX4ljD7OxvQRDayyoyyCk+senRjSkP6VnUNQmVQqB6g7w== -secp256k1@^4.0.1, secp256k1@^4.0.2: +secp256k1@4.0.2, secp256k1@^4.0.1, secp256k1@^4.0.2: version "4.0.2" resolved "https://registry.yarnpkg.com/secp256k1/-/secp256k1-4.0.2.tgz#15dd57d0f0b9fdb54ac1fa1694f40e5e9a54f4a1" integrity sha512-UDar4sKvWAksIlfX3xIaQReADn+WFnHvbVujpcbr+9Sf/69odMwy2MUsz5CKLQgX9nsIyrjuxL2imVyoNHa3fg== @@ -7822,9 +8180,9 @@ stellar-base@^5.2.1: sodium-native "^2.3.0" stellar-sdk@^8.2.2: - version "8.2.2" - resolved "https://registry.yarnpkg.com/stellar-sdk/-/stellar-sdk-8.2.2.tgz#fd52bbf09992a60c38548c4ca97d9e14e98bab82" - integrity sha512-TCE69NV1/sZXfwGO3a7aGoskR/9Src7JNZMOli8jO8wTWi+JOzMhJi/SLj3qHp6xvMKI4Oonqz5HiRf0b0fsSQ== + version "8.2.3" + resolved "https://registry.yarnpkg.com/stellar-sdk/-/stellar-sdk-8.2.3.tgz#2970211877937e487b4e1f88021200cf0ddf8603" + integrity sha512-RlrR6DD+706vgA1iVDXteU/x3bdqFDthf+4M3C19D/owmF0GCR/FoRQpnPqqRJ0C/rbbdZ6YjAyKO6Q0GSbDWw== dependencies: "@types/eventsource" "^1.1.2" "@types/node" ">= 8" @@ -8044,6 +8402,11 @@ symbol-observable@1.0.4: resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.0.4.tgz#29bf615d4aa7121bdd898b22d4b3f9bc4e2aa03d" integrity sha1-Kb9hXUqnEhvdiYsi1LP5vE4qoD0= +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== + symbol-tree@^3.2.4: version "3.2.4" resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2" @@ -8116,6 +8479,17 @@ timemachine@^0.3.2: resolved "https://registry.yarnpkg.com/timemachine/-/timemachine-0.3.2.tgz#83c594d0271c3608d5fab13636cd3b7c979ea2c5" integrity sha512-JNKeKZXQJc8UC19JcIq0XziBud+fNNJfatZ57lwk+o1O9mpW2FmzWvRw7FTTOKuN6M0zsjGIlNi0O0QrF5WVRA== +tiny-secp256k1@^1.1.3: + version "1.1.6" + resolved "https://registry.yarnpkg.com/tiny-secp256k1/-/tiny-secp256k1-1.1.6.tgz#7e224d2bee8ab8283f284e40e6b4acb74ffe047c" + integrity sha512-FmqJZGduTyvsr2cF3375fqGHUovSwDi/QytexX1Se4BPuPZpTE5Ftp5fg+EFSuEf3lhZqgCRjEG3ydUQ/aNiwA== + dependencies: + bindings "^1.3.0" + bn.js "^4.11.8" + create-hmac "^1.1.7" + elliptic "^6.4.0" + nan "^2.13.2" + tmpl@1.0.x: version "1.0.4" resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.4.tgz#23640dd7b42d00433911140820e5cf440e521dd1" @@ -8212,6 +8586,11 @@ tslib@^1.10.0, tslib@^1.9.0: resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== +tslib@~2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.1.0.tgz#da60860f1c2ecaa5703ab7d39bc05b6bf988b97a" + integrity sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A== + tunnel-agent@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" @@ -8253,6 +8632,11 @@ type-detect@4.0.8: resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== +type-fest@^0.11.0: + version "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.20.2: version "0.20.2" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4" @@ -8275,6 +8659,11 @@ typedarray-to-buffer@3.1.5, typedarray-to-buffer@^3.1.5: dependencies: is-typedarray "^1.0.0" +typeforce@^1.11.5: + version "1.18.0" + resolved "https://registry.yarnpkg.com/typeforce/-/typeforce-1.18.0.tgz#d7416a2c5845e085034d70fcc5b6cc4a90edbfdc" + integrity sha512-7uc1O8h1M1g0rArakJdf0uLRSSgFcYexrVoKo+bzJd32gd4gDy2L/Z+8/FjPnU9ydY3pEnVPtr9FyscYY60K1g== + typescript-compiler@^1.4.1-2: version "1.4.1-2" resolved "https://registry.yarnpkg.com/typescript-compiler/-/typescript-compiler-1.4.1-2.tgz#ba4f7db22d91534a1929d90009dce161eb72fd3f" @@ -8580,6 +8969,13 @@ which@^2.0.1, which@^2.0.2: dependencies: isexe "^2.0.0" +wif@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/wif/-/wif-2.0.6.tgz#08d3f52056c66679299726fade0d432ae74b4704" + integrity sha1-CNP1IFbGZnkplyb63g1DKudLRwQ= + dependencies: + bs58check "<3.0.0" + window-getters@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/window-getters/-/window-getters-1.0.0.tgz#b5b264538c4c79cead027f9997850222bf6d0852" @@ -8664,20 +9060,15 @@ write-file-atomic@^3.0.0: signal-exit "^3.0.2" typedarray-to-buffer "^3.1.5" -ws@7.2.3: - version "7.2.3" - resolved "https://registry.yarnpkg.com/ws/-/ws-7.2.3.tgz#a5411e1fb04d5ed0efee76d26d5c46d830c39b46" - integrity sha512-HTDl9G9hbkNDk98naoR/cHDws7+EyYMOdL1BmjsZXRUjf7d+MficC4B7HLUPlSiho0vg+CWKrGIt/VJBd1xunQ== - ws@7.3.0: version "7.3.0" resolved "https://registry.yarnpkg.com/ws/-/ws-7.3.0.tgz#4b2f7f219b3d3737bc1a2fbf145d825b94d38ffd" integrity sha512-iFtXzngZVXPGgpTlP1rBqsUK82p9tKqsWRPg5L56egiljujJT3vGAYnHANvFxBieXrTFavhzhxW52jnaWV+w2w== -ws@^7.2.0, ws@^7.2.3: - version "7.3.1" - resolved "https://registry.yarnpkg.com/ws/-/ws-7.3.1.tgz#d0547bf67f7ce4f12a72dfe31262c68d7dc551c8" - integrity sha512-D3RuNkynyHmEJIpD2qrgVkc9DQ23OrN/moAwZX4L8DfvszsJxpjQuUq3LMx6HoYji9fbIOBY18XWBsAux1ZZUA== +ws@7.4.6, ws@^7, ws@^7.2.0, ws@^7.2.3: + version "7.4.6" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.6.tgz#5654ca8ecdeee47c33a9a4bf6d28e2be2980377c" + integrity sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A== xml-name-validator@^3.0.0: version "3.0.0" @@ -8689,10 +9080,18 @@ xmlchars@^2.2.0: resolved "https://registry.yarnpkg.com/xmlchars/-/xmlchars-2.2.0.tgz#060fe1bcb7f9c76fe2a17db86a9bc3ab894210cb" integrity sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw== -xstate@^4.20.0: - version "4.20.0" - resolved "https://registry.yarnpkg.com/xstate/-/xstate-4.20.0.tgz#6f241f2b49c840cb6e05b32544a6048362f558e2" - integrity sha512-u5Ou1CMo/oWApasmv1TYTHgj38k69DJdTqQdBBwt+/ooNhPJQiSIKTB3Y3HvX0h5tulwfSo6xAwZgBgjRsK3LA== +xstate@^4.22.0: + version "4.22.0" + resolved "https://registry.yarnpkg.com/xstate/-/xstate-4.22.0.tgz#5d6c2a762cb94c3170ee826d26194b7561d70aae" + integrity sha512-WBQS/XxmjCH6789fx5JXjct2pWA0ZI0a1Kx8PJMurzgytkJH3vC2+QganHWzK38vG9PyXHefyVG54UN5q6YVSw== + +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" xxhashjs@^0.2.2: version "0.2.2" From 3df8eac0b65a36fcfb51b20c8b0f184585a8c5a2 Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Mon, 19 Jul 2021 12:45:29 +0300 Subject: [PATCH 020/127] Revert "Update changes from base repo" This reverts commit f46af8ae16eeec431f90a2ad2de8e3098baf5f56. --- .ci.env | 2 - .eslintignore | 1 - .github/pull_request_template.md | 19 - .gitignore | 7 - .nvmrc | 2 +- CODEOWNERS | 2 +- CONTRIBUTING.md | 74 +- cli/package.json | 32 +- cli/src/commands-index.js | 2 - .../commands/generateAppJsonFromDataset.js | 193 -- cli/src/commands/swap.js | 42 +- cli/src/live-common-setup-base.js | 5 - cli/src/live-common-setup.js | 36 - cli/yarn.lock | 3049 +++++++---------- mobile-test-app/Gemfile.lock | 2 +- mobile-test-app/yarn.lock | 40 +- package.json | 53 +- scripts/build.sh | 3 +- scripts/buildReactFlags.js | 101 - .../__snapshots__/all.libcore.js.snap | 168 +- src/__tests__/accounts/importAccounts.js | 3 - src/__tests__/test-helpers/setup.js | 3 - src/account/ordering.js | 5 +- src/account/serialization.js | 4 - src/api/explorerConfig/index.js | 2 - src/apps/filtering.test.js | 3 - src/apps/hw.js | 7 +- src/apps/support.js | 2 +- src/bridge/mockHelpers.js | 4 +- .../sortByMarketcap.test.js.snap | 14 - src/data/flags/svg/FR.svg | 29 - src/data/flags/svg/JP.svg | 33 - src/data/flags/svg/US.svg | 36 - src/env.js | 40 - src/errors.js | 42 - src/exchange/swap/getExchangeRates.js | 178 +- src/exchange/swap/getKYCStatus.js | 31 - src/exchange/swap/index.js | 125 +- src/exchange/swap/initSwap.js | 3 +- src/exchange/swap/logic.js | 83 +- src/exchange/swap/mock.js | 79 +- src/exchange/swap/submitKYC.js | 33 - src/exchange/swap/types.js | 33 +- src/families/crypto_org/account.js | 58 - src/families/crypto_org/api/index.js | 6 - src/families/crypto_org/api/sdk.js | 234 -- src/families/crypto_org/api/sdk.types.js | 52 - src/families/crypto_org/bridge/js.js | 37 - src/families/crypto_org/cli-transaction.js | 36 - src/families/crypto_org/errors.js | 14 - src/families/crypto_org/hw-getAddress.js | 18 - src/families/crypto_org/js-broadcast.js | 36 - .../crypto_org/js-buildTransaction.js | 59 - .../crypto_org/js-estimateMaxSpendable.js | 29 - .../crypto_org/js-getFeesForTransaction.js | 14 - .../crypto_org/js-getTransactionStatus.js | 59 - src/families/crypto_org/js-signOperation.js | 179 - src/families/crypto_org/js-synchronisation.js | 51 - src/families/crypto_org/js-transaction.js | 49 - src/families/crypto_org/logic.js | 72 - src/families/crypto_org/serialization.js | 37 - src/families/crypto_org/transaction.js | 49 - src/families/crypto_org/types.js | 56 - src/families/elrond/test-dataset.js | 4 +- src/families/ethereum/modules/compound.js | 72 +- src/families/polkadot/api/bisontrails.js | 19 +- src/families/polkadot/api/common.js | 3 - src/families/polkadot/api/index.js | 1 - src/families/polkadot/api/sidecar.js | 23 +- src/families/polkadot/cache.js | 24 - .../polkadot/deviceTransactionConfig.js | 13 - src/families/polkadot/js-buildTransaction.js | 8 - .../polkadot/js-getTransactionStatus.js | 59 +- src/families/polkadot/js-signOperation.js | 2 - src/families/polkadot/logic.js | 28 +- src/families/polkadot/preload.js | 15 +- src/families/polkadot/specs.js | 7 +- src/families/polkadot/test-dataset.js | 1 - src/families/polkadot/types.js | 1 - src/generated/account.js | 2 - src/generated/bridge/js.js | 2 - src/generated/cli-transaction.js | 2 - src/generated/hw-getAddress.js | 2 - src/generated/transaction.js | 2 - src/generated/types.js | 18 - src/hw/actions/app.js | 17 +- src/hw/actions/initSwap.js | 15 +- src/hw/connectApp.js | 58 +- src/operation.js | 1 - src/platform/CatalogProvider.js | 92 - src/platform/PlatformAppProvider/api/api.js | 30 - .../PlatformAppProvider/api/api.mock.js | 295 -- src/platform/PlatformAppProvider/api/index.js | 15 - src/platform/PlatformAppProvider/helpers.js | 58 - src/platform/PlatformAppProvider/index.js | 96 - src/platform/PlatformAppProvider/types.js | 23 - src/platform/api/api.js | 30 - src/platform/api/api.mock.js | 295 -- src/platform/api/index.js | 15 - src/platform/logic.js | 27 - src/platform/types.js | 44 - src/platform/version.js | 18 - src/platform/version.test.js | 7 - src/react.js | 5 - src/reactNative.js | 5 - src/types/operation.js | 1 - src/walletconnect/walletconnect.test.js | 3 - yarn.lock | 1567 ++++----- 108 files changed, 2307 insertions(+), 6488 deletions(-) delete mode 100644 .ci.env delete mode 100644 .github/pull_request_template.md delete mode 100644 cli/src/commands/generateAppJsonFromDataset.js delete mode 100644 scripts/buildReactFlags.js delete mode 100644 src/data/flags/svg/FR.svg delete mode 100644 src/data/flags/svg/JP.svg delete mode 100644 src/data/flags/svg/US.svg delete mode 100644 src/exchange/swap/getKYCStatus.js delete mode 100644 src/exchange/swap/submitKYC.js delete mode 100644 src/families/crypto_org/account.js delete mode 100644 src/families/crypto_org/api/index.js delete mode 100644 src/families/crypto_org/api/sdk.js delete mode 100644 src/families/crypto_org/api/sdk.types.js delete mode 100644 src/families/crypto_org/bridge/js.js delete mode 100644 src/families/crypto_org/cli-transaction.js delete mode 100644 src/families/crypto_org/errors.js delete mode 100644 src/families/crypto_org/hw-getAddress.js delete mode 100644 src/families/crypto_org/js-broadcast.js delete mode 100644 src/families/crypto_org/js-buildTransaction.js delete mode 100644 src/families/crypto_org/js-estimateMaxSpendable.js delete mode 100644 src/families/crypto_org/js-getFeesForTransaction.js delete mode 100644 src/families/crypto_org/js-getTransactionStatus.js delete mode 100644 src/families/crypto_org/js-signOperation.js delete mode 100644 src/families/crypto_org/js-synchronisation.js delete mode 100644 src/families/crypto_org/js-transaction.js delete mode 100644 src/families/crypto_org/logic.js delete mode 100644 src/families/crypto_org/serialization.js delete mode 100644 src/families/crypto_org/transaction.js delete mode 100644 src/families/crypto_org/types.js delete mode 100644 src/platform/CatalogProvider.js delete mode 100644 src/platform/PlatformAppProvider/api/api.js delete mode 100644 src/platform/PlatformAppProvider/api/api.mock.js delete mode 100644 src/platform/PlatformAppProvider/api/index.js delete mode 100644 src/platform/PlatformAppProvider/helpers.js delete mode 100644 src/platform/PlatformAppProvider/index.js delete mode 100644 src/platform/PlatformAppProvider/types.js delete mode 100644 src/platform/api/api.js delete mode 100644 src/platform/api/api.mock.js delete mode 100644 src/platform/api/index.js delete mode 100644 src/platform/logic.js delete mode 100644 src/platform/version.js delete mode 100644 src/platform/version.test.js diff --git a/.ci.env b/.ci.env deleted file mode 100644 index d774f3f3a6..0000000000 --- a/.ci.env +++ /dev/null @@ -1,2 +0,0 @@ -# always test on latest conditions -EXPERIMENTAL_EXPLORERS=1 diff --git a/.eslintignore b/.eslintignore index 03e188de05..c5d6334a1d 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,5 +1,4 @@ src/data/icons -src/data/flags src/libcore/types/*.js src/families/*/types.js diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md deleted file mode 100644 index f42de4ffa1..0000000000 --- a/.github/pull_request_template.md +++ /dev/null @@ -1,19 +0,0 @@ - -## Context (issues, jira) - - - -## Description / Usage - - - - -## Expectations - -- [ ] **Test coverage: The changes of this PR are covered by test.** Unit test were added with mocks when depending on a backend/device. -- [ ] **No impact: The changes of this PR have ZERO impact on the userland.** Meaning, we can use these changes without modifying LLD/LLM at all. It will be a "noop" and the maintainers will be able to bump it without changing anything. - - diff --git a/.gitignore b/.gitignore index 6cc32432bd..7d2c135d90 100644 --- a/.gitignore +++ b/.gitignore @@ -35,13 +35,6 @@ flow-coverage src/data/icons/react src/data/icons/reactNative -# Generated icons -src/data/flags/react -src/data/flags/reactNative - cli/tests/*/output cli/tests/tmp .env - -# Jetbrains -.idea diff --git a/.nvmrc b/.nvmrc index 2ccd0b76bb..cae54a258e 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -v14.17.1 +v12.14.1 diff --git a/CODEOWNERS b/CODEOWNERS index 7bbe5cf638..b562a58240 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -1 +1 @@ -* @ledgerhq/live-maintainer +* @ledgerhq/ledger-live-maintainer diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b494f9ab90..902d2e9270 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,41 +1,71 @@ # Contributing -:+1::tada: First off, thanks for taking the time to contribute! :tada::+1: +Thanks for considering contributing to Ledger Live! -This repository hosts `@ledgerhq/live-common` JavaScript library which centralize the business logic work of Ledger Live. -## JavaScript styleguide +## Opening issues -* ES6+ features. -* [prettier](https://prettier.io/) for formatting convention. You can run `yarn prettier`. -* ESLint is used to enhance code quality. Check with `yarn lint`. -* Flowtype is currently getting used to typecheck the library, but we are currently migrating to TypeScript. +If you find a bug, please feel free to [open an issue](https://github.com/ledgerhq/ledger-live-common/issues). -> NB. for the 3 points above, the best is to have integration of Prettier, -> ESlint, Flowtype in your text editor (there are plugin for most editors). +If you taking the time to mention a problem, even a seemingly minor one, it is greatly appreciated, and a totally valid contribution to this project. Thank you! -## Expectations +## Fixing bugs -As documented in the PR template, there are two very important points we require contributors to focus on: +We love pull requests. Here’s a quick guide: -### Changes have no impact +1. [Fork this repository](https://github.com/ledgerhq/ledger-live-common/fork) and then clone it locally: -**The impact of your changes must be made as limited as possible.** + ```bash + git clone https://github.com/ledgerhq/ledger-live-common + ``` -As we want to have the ability to merge things quickly and have small iterations, this can only work if your changes are non-breaking which means they do not require any extra modification in user land side (Ledger Live Desktop, Ledger Live Mobile) **to still make the library works the same way**. +2. Create a topic branch for your changes: -Of course you may introduce new features for the UI side, it just should not affect the existing work / only affect it in a way that the result of this is "acceptable" and "stable" (e.g. a bugfix is a change, but it's the purpose of the bugfix to fix it). + ```bash + git checkout -b fix-for-that-thing + ``` +3. Commit a failing test for the bug: -There are always exception to break this rule, when you do break it however, you need to carefully document it in the PR so we can report that documentation back in the release notes and organise the work load. The complexity of that PR will however be defacto higher and harder with less guarantee to merge. + ```bash + git commit -am "Adds a failing test to demonstrate that thing" + ``` -We want to avoid locked situation where we can't merge your work because it's too impacting on userland but you still need that work merged to test against your changes on LLD/LLM. +4. Commit a fix that makes the test pass: -Here are a few tips: + ```bash + git commit -am "Adds a fix for that thing!" + ``` -- When you have a new feature that need changes in the existing work, introduce a new environment variable in `env.js` that will allow you to implement a code branching -- When you have a completely new rework of an existing feature, feel free to make a `v2` folder where the new logic will leave. The existing work will be not impacted and considered a "v1" in which you can also start documentation a **deprecation path** (use JS comments, it will be on maintainer side to organize the deprecation and planning the sunset) +5. Run the tests: + + ```bash + npm test + ``` + +6. If everything looks good, push to your fork: + + ```bash + git push origin fix-for-that-thing + ``` + +7. [Submit a pull request.](https://help.github.com/articles/creating-a-pull-request) + +## Features and expectation of ledger-live-common project + +ledger-live-common is the common ground for [Ledger Live desktop](https://github.com/LedgerHQ/ledger-live-desktop) and [Ledger Live mobile](https://github.com/LedgerHQ/ledger-live-mobile). + +It contains most of its core business logic. + +**We try to do as less breaking changes as possible**. What we mean by breaking changes, it means any changes in live-common that would need the userland (Ledger Live Desktop, Ledger Live Mobile) to also change codes to keep making that live-common version to work should be avoided. +Adding new features are ok, but they need to be made as much as possible "not changing" when the userland still uses the old API. + +Here are a few guidelines: +- if you have a completely new rework of an existing stack, it may be wise to have a `v2/` folder, specifically when there is a risk in it. - when adding new methods, fields, it should be ok as long as you don't change the main interface. You can ship things "silently" without userland to use it yet. +- Libraries upgrade are the only exception here. -### Changes must have test coverage and pass the CI +## Expectation of PR information -As we allow to be very flexible at merging things quickly in live-common, we also expect you to deliver unit tests with the features you deliver or improve the tests when you fix a bug. +- the impact of each PR needs to be explicitly written. +- code need to be covered by tests. (unit tests, dataset tests or bot tests) +- document everything that userland need to do to upgrade to your changes (if relevant) diff --git a/cli/package.json b/cli/package.json index 65912be551..7bb55cdf50 100644 --- a/cli/package.json +++ b/cli/package.json @@ -1,6 +1,6 @@ { "name": "ledger-live", - "version": "20.3.0", + "version": "19.10.0", "description": "ledger-live CLI version", "repository": { "type": "git", @@ -29,15 +29,15 @@ "@ledgerhq/hw-transport-node-ble": "5.7.0" }, "dependencies": { - "@ledgerhq/cryptoassets": "6.1.0", + "@ledgerhq/cryptoassets": "6.0.2", "@ledgerhq/errors": "6.0.2", - "@ledgerhq/hw-app-btc": "6.1.0", - "@ledgerhq/hw-transport-http": "6.1.0", - "@ledgerhq/hw-transport-mocker": "6.1.0", - "@ledgerhq/hw-transport-node-hid": "6.1.0", - "@ledgerhq/hw-transport-node-speculos": "6.1.0", + "@ledgerhq/hw-app-btc": "6.0.2", + "@ledgerhq/hw-transport-http": "6.0.2", + "@ledgerhq/hw-transport-mocker": "6.0.0", + "@ledgerhq/hw-transport-node-hid": "6.0.2", + "@ledgerhq/hw-transport-node-speculos": "6.0.2", "@ledgerhq/ledger-core": "6.12.3", - "@ledgerhq/live-common": "^20.3.0", + "@ledgerhq/live-common": "^19.12.0-rc.2", "@ledgerhq/logs": "6.0.2", "@walletconnect/client": "^1.4.1", "asciichart": "^1.5.25", @@ -59,16 +59,16 @@ "winston": "^3.3.3" }, "devDependencies": { - "@babel/cli": "^7.14.5", - "@babel/core": "^7.14.6", - "@babel/plugin-proposal-class-properties": "^7.14.5", - "@babel/plugin-proposal-export-default-from": "^7.14.5", - "@babel/plugin-proposal-export-namespace-from": "^7.14.5", + "@babel/cli": "^7.13.16", + "@babel/core": "^7.13.16", + "@babel/plugin-proposal-class-properties": "^7.13.0", + "@babel/plugin-proposal-export-default-from": "^7.12.13", + "@babel/plugin-proposal-export-namespace-from": "^7.12.13", "@babel/plugin-syntax-dynamic-import": "^7.8.3", "@babel/plugin-syntax-import-meta": "^7.10.4", - "@babel/preset-env": "^7.14.7", - "@babel/preset-flow": "^7.14.5", - "@babel/preset-typescript": "^7.14.5", + "@babel/preset-env": "^7.13.15", + "@babel/preset-flow": "^7.13.13", + "@babel/preset-typescript": "^7.13.0", "@types/command-line-args": "^5.0.0", "ts-node": "^9.1.1", "typescript": "^4.2.4" diff --git a/cli/src/commands-index.js b/cli/src/commands-index.js index d435129913..0da0345d39 100644 --- a/cli/src/commands-index.js +++ b/cli/src/commands-index.js @@ -20,7 +20,6 @@ import estimateMaxSpendable from "./commands/estimateMaxSpendable"; import exportAccounts from "./commands/exportAccounts"; import firmwareRepair from "./commands/firmwareRepair"; import firmwareUpdate from "./commands/firmwareUpdate"; -import generateAppJsonFromDataset from "./commands/generateAppJsonFromDataset"; import generateTestScanAccounts from "./commands/generateTestScanAccounts"; import generateTestTransaction from "./commands/generateTestTransaction"; import genuineCheck from "./commands/genuineCheck"; @@ -72,7 +71,6 @@ export default { exportAccounts, firmwareRepair, firmwareUpdate, - generateAppJsonFromDataset, generateTestScanAccounts, generateTestTransaction, genuineCheck, diff --git a/cli/src/commands/generateAppJsonFromDataset.js b/cli/src/commands/generateAppJsonFromDataset.js deleted file mode 100644 index b6acee691e..0000000000 --- a/cli/src/commands/generateAppJsonFromDataset.js +++ /dev/null @@ -1,193 +0,0 @@ -// @flow -/* eslint-disable no-console */ -import invariant from "invariant"; -import { reduce, filter, map } from "rxjs/operators"; -import { getCurrencyBridge } from "@ledgerhq/live-common/lib/bridge"; -import { implicitMigration } from "@ledgerhq/live-common/lib/migrations/accounts"; -import { - getCryptoCurrencyById, - setSupportedCurrencies, -} from "@ledgerhq/live-common/lib/currencies"; -import { setPlatformVersion } from "@ledgerhq/live-common/lib/platform/version"; -import datasets from "@ledgerhq/live-common/lib/generated/test-dataset"; -import { mockDeviceWithAPDUs, releaseMockDevice } from "../live-common-setup"; - -setPlatformVersion("0.0.1"); - -setSupportedCurrencies([ - "bitcoin", - "ethereum", - "ripple", - "bitcoin_cash", - "litecoin", - "dash", - "ethereum_classic", - "tezos", - "qtum", - "zcash", - "bitcoin_gold", - "stratis", - "dogecoin", - "digibyte", - "komodo", - "pivx", - "zencash", - "vertcoin", - "peercoin", - "viacoin", - "stakenet", - "stealthcoin", - "decred", - "bitcoin_testnet", - "ethereum_ropsten", - "tron", - "stellar", - "cosmos", - "algorand", - "polkadot", -]); - -const defaultSyncConfig = { - paginationConfig: {}, - blacklistedTokenIds: ["ethereum/erc20/ampleforth"], -}; - -const excluded = [ - "algorand", - "bitcoin", - "bitcoin_cash", - "bitcoin_gold", - "cosmos", - "dash", - "decred", - "digibyte", - "dogecoin", - "ethereum_classic", - "komodo", - "litecoin", - "peercoin", - "pivx", - "polkadot", - "qtum", - "ripple", - "stakenet", - "stellar", - "stealthcoin", - "viacoin", - "vertcoin", - "zcash", - "zencash", -]; - -const appJsonTemplate = { - data: { - SPECTRON_RUN: { - localStorage: { - acceptedTermsVersion: "2019-12-04", - }, - }, - settings: { - hasCompletedOnboarding: true, - counterValue: "USD", - language: "en", - theme: "light", - region: null, - orderAccounts: "balance|desc", - countervalueFirst: false, - autoLockTimeout: 10, - selectedTimeRange: "month", - marketIndicator: "western", - currenciesSettings: {}, - pairExchanges: {}, - developerMode: false, - loaded: true, - shareAnalytics: true, - sentryLogs: true, - lastUsedVersion: "99.99.99", - dismissedBanners: [], - accountsViewMode: "list", - showAccountsHelperBanner: true, - hideEmptyTokenAccounts: false, - sidebarCollapsed: false, - discreetMode: false, - preferredDeviceModel: "nanoS", - hasInstalledApps: true, - carouselVisibility: 99999999999, - hasAcceptedSwapKYC: false, - lastSeenDevice: null, - blacklistedTokenIds: [], - swapAcceptedProviderIds: [], - deepLinkUrl: null, - firstTimeLend: false, - swapProviders: [], - showClearCacheBanner: false, - starredAccountIds: [], - hasPassword: false, - }, - user: { - id: "08cf3393-c5eb-4ea7-92de-0deea22e3971", - }, - countervalues: {}, - accounts: [], - }, -}; - -const extraCurrenciesData = () => { - const data = []; - - Object.keys(datasets).forEach((key) => { - const { currencies } = datasets[key]; - Object.keys(currencies).forEach((k) => { - // TODO: Check why these are not working - if (excluded.includes(k)) { - return; - } - const currency = currencies[k]; - if (!currency.scanAccounts?.length) return; - currency.scanAccounts?.forEach((sa) => { - data.push({ currencyName: k, apdus: sa.apdus }); - }); - }); - }); - - return data; -}; - -const syncAccount = async (data) => { - const currency = getCryptoCurrencyById(data.currencyName); - const bridge = getCurrencyBridge(currency); - const deviceId = mockDeviceWithAPDUs(data.apdus); - invariant(currency, `could not find currency for ${data.currencyName}`); - try { - const accounts = await bridge - .scanAccounts({ - currency, - deviceId, - syncConfig: defaultSyncConfig, - }) - .pipe( - filter((e) => e.type === "discovered"), - map((e) => e.account), - reduce((all, a) => all.concat(a), []) - ) - .toPromise(); - return implicitMigration(accounts); - } finally { - releaseMockDevice(deviceId); - } -}; - -async function main() { - const data = extraCurrenciesData(); - const accounts = await Promise.all(data.flatMap((d) => syncAccount(d))); - const flatten = accounts.flat(); - appJsonTemplate.data.accounts = flatten; - console.log(JSON.stringify(appJsonTemplate)); -} - -export default { - description: - "Extract accounts from test datasets and print a sample app.json usable for tests", - args: [], - job: () => main(), -}; diff --git a/cli/src/commands/swap.js b/cli/src/commands/swap.js index 1aae484fc4..20c04ee1ae 100644 --- a/cli/src/commands/swap.js +++ b/cli/src/commands/swap.js @@ -24,30 +24,18 @@ type SwapJobOpts = ScanCommonOpts & { amount: string, useAllAmount: boolean, useFloat: boolean, - wyreUserId?: string, _unknown: any, deviceId: string, tokenId: string, }; const exec = async (opts: SwapJobOpts) => { - const { - amount, - useAllAmount, - tokenId, - useFloat, - wyreUserId = "", - deviceId = "", - } = opts; + const { amount, useAllAmount, tokenId, useFloat, deviceId = "" } = opts; invariant( amount || useAllAmount, `✖ amount in satoshis is needed or --useAllAmount ` ); invariant(opts._unknown, `✖ second account information is missing`); - invariant( - !wyreUserId || wyreUserId.length === 14, - "Provider wyre user id is not valid" - ); //Remove suffix from arguments before passing them to sync. const secondAccountOpts: ScanCommonOpts & { @@ -181,24 +169,11 @@ const exec = async (opts: SwapJobOpts) => { toParentAccount, }; - const exchangeRates = await getExchangeRates( - exchange, - transaction, - wyreUserId - ); - - console.log({ exchangeRates }); - - const exchangeRate = exchangeRates.find((er) => { - if ( - er.tradeMethod === (useFloat ? "float" : "fixed") && - (!wyreUserId || er.provider === "wyre") - ) { - return true; - } - return false; - }); + const exchangeRates = await getExchangeRates(exchange, transaction); + const exchangeRate = exchangeRates.find( + (er) => er.tradeMethod === (useFloat ? "float" : "fixed") + ); invariant(exchangeRate, `✖ No valid rate available`); console.log( `Using first ${useFloat ? "float" : "fixed"} rate:\n`, @@ -214,7 +189,6 @@ const exec = async (opts: SwapJobOpts) => { exchangeRate, transaction, deviceId, - userId: wyreUserId, }) .pipe( tap((e) => { @@ -285,12 +259,6 @@ export default { type: Boolean, desc: "Attempt to send all using the emulated max amount calculation", }, - { - name: "wyreUserId", - alias: "w", - type: String, - desc: "If provided, will attempt to use Wyre provider with given userId", - }, { name: "tokenId", alias: "t", diff --git a/cli/src/live-common-setup-base.js b/cli/src/live-common-setup-base.js index b48827fddc..245222d3fd 100644 --- a/cli/src/live-common-setup-base.js +++ b/cli/src/live-common-setup-base.js @@ -6,9 +6,6 @@ import simple from "@ledgerhq/live-common/lib/logs/simple"; import { listen } from "@ledgerhq/logs"; import implementLibcore from "@ledgerhq/live-common/lib/libcore/platforms/nodejs"; import { setSupportedCurrencies } from "@ledgerhq/live-common/lib/currencies"; -import { setPlatformVersion } from "@ledgerhq/live-common/lib/platform/version"; - -setPlatformVersion("0.0.1"); setSupportedCurrencies([ "bitcoin", @@ -43,8 +40,6 @@ setSupportedCurrencies([ "algorand", "polkadot", "cosmos_testnet", - "crypto_org", - "crypto_org_croeseid", ]); for (const k in process.env) setEnvUnsafe(k, process.env[k]); diff --git a/cli/src/live-common-setup.js b/cli/src/live-common-setup.js index ff7fadef20..ed0d3a34b1 100644 --- a/cli/src/live-common-setup.js +++ b/cli/src/live-common-setup.js @@ -4,11 +4,6 @@ export * from "./live-common-setup-base"; import React from "react"; import { connect } from "react-redux"; -import invariant from "invariant"; -import { - createTransportReplayer, - RecordStore, -} from "@ledgerhq/hw-transport-mocker"; import Transport from "@ledgerhq/hw-transport"; import { NotEnoughBalance } from "@ledgerhq/errors"; import { log } from "@ledgerhq/logs"; @@ -39,37 +34,6 @@ implementLibcore({ dbPath: process.env.LIBCORE_DB_PATH || "./dbdata", }); -let idCounter = 0; -const mockTransports = {}; -const recordStores = {}; - -export function releaseMockDevice(id: string) { - const store = recordStores[id]; - invariant(store, "MockDevice does not exist (%s)", id); - store.ensureQueueEmpty(); - delete recordStores[id]; - delete mockTransports[id]; -} - -export function mockDeviceWithAPDUs(apdus: string) { - const id = `mock:${++idCounter}`; - const store = RecordStore.fromString(apdus); - recordStores[id] = store; - mockTransports[id] = createTransportReplayer(store); - return id; -} - -registerTransportModule({ - id: "mock", - open: (id) => { - if (id in mockTransports) { - const Tr = mockTransports[id]; - return Tr.open(); - } - }, - disconnect: () => Promise.resolve(), -}); - if (process.env.DEVICE_PROXY_URL) { const Tr = createTransportHttp(process.env.DEVICE_PROXY_URL.split("|")); registerTransportModule({ diff --git a/cli/yarn.lock b/cli/yarn.lock index b36296922e..5c0a936488 100644 --- a/cli/yarn.lock +++ b/cli/yarn.lock @@ -2,10 +2,10 @@ # yarn lockfile v1 -"@babel/cli@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/cli/-/cli-7.14.5.tgz#9551b194f02360729de6060785bbdcce52c69f0a" - integrity sha512-poegjhRvXHWO0EAsnYajwYZuqcz7gyfxwfaecUESxDujrqOivf3zrjFbub8IJkrqEaz3fvJWh001EzxBub54fg== +"@babel/cli@^7.13.16": + version "7.13.16" + resolved "https://registry.yarnpkg.com/@babel/cli/-/cli-7.13.16.tgz#9d372e943ced0cc291f068204a9b010fd9cfadbc" + integrity sha512-cL9tllhqvsQ6r1+d9Invf7nNXg/3BlfL1vvvL/AdH9fZ2l5j0CeBcoq6UjsqHpvyN1v5nXSZgqJZoGeK+ZOAbw== dependencies: commander "^4.0.1" convert-source-map "^1.1.0" @@ -15,35 +15,35 @@ slash "^2.0.0" source-map "^0.5.0" optionalDependencies: - "@nicolo-ribaudo/chokidar-2" "2.1.8-no-fsevents.2" + "@nicolo-ribaudo/chokidar-2" "2.1.8-no-fsevents" chokidar "^3.4.0" -"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.14.5", "@babel/code-frame@^7.8.3": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.14.5.tgz#23b08d740e83f49c5e59945fbf1b43e80bbf4edb" - integrity sha512-9pzDqyc6OLDaqe+zbACgFkb6fKMNG6CObKpnYXChRsvYGyEdc7CA2BaqeOM+vOtCS5ndmJicPJhKAwYRI6UfFw== - dependencies: - "@babel/highlight" "^7.14.5" - -"@babel/compat-data@^7.13.11", "@babel/compat-data@^7.14.5", "@babel/compat-data@^7.14.7": - version "7.14.7" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.14.7.tgz#7b047d7a3a89a67d2258dc61f604f098f1bc7e08" - integrity sha512-nS6dZaISCXJ3+518CWiBfEr//gHyMO02uDxBkXTKZDN5POruCnOZ1N4YBRZDCabwF8nZMWBpRxIicmXtBs+fvw== - -"@babel/core@^7.14.6": - version "7.14.6" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.14.6.tgz#e0814ec1a950032ff16c13a2721de39a8416fcab" - integrity sha512-gJnOEWSqTk96qG5BoIrl5bVtc23DCycmIePPYnamY9RboYdI4nFy5vAQMSl81O5K/W0sLDWfGysnOECC+KUUCA== - dependencies: - "@babel/code-frame" "^7.14.5" - "@babel/generator" "^7.14.5" - "@babel/helper-compilation-targets" "^7.14.5" - "@babel/helper-module-transforms" "^7.14.5" - "@babel/helpers" "^7.14.6" - "@babel/parser" "^7.14.6" - "@babel/template" "^7.14.5" - "@babel/traverse" "^7.14.5" - "@babel/types" "^7.14.5" +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.8.3": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.13.tgz#dcfc826beef65e75c50e21d3837d7d95798dd658" + integrity sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g== + dependencies: + "@babel/highlight" "^7.12.13" + +"@babel/compat-data@^7.13.11", "@babel/compat-data@^7.13.15", "@babel/compat-data@^7.13.8": + version "7.13.15" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.13.15.tgz#7e8eea42d0b64fda2b375b22d06c605222e848f4" + integrity sha512-ltnibHKR1VnrU4ymHyQ/CXtNXI6yZC0oJThyW78Hft8XndANwi+9H+UIklBDraIjFEJzw8wmcM427oDd9KS5wA== + +"@babel/core@^7.13.16": + version "7.13.16" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.13.16.tgz#7756ab24396cc9675f1c3fcd5b79fcce192ea96a" + integrity sha512-sXHpixBiWWFti0AV2Zq7avpTasr6sIAu7Y396c608541qAU2ui4a193m0KSQmfPSKFZLnQ3cvlKDOm3XkuXm3Q== + dependencies: + "@babel/code-frame" "^7.12.13" + "@babel/generator" "^7.13.16" + "@babel/helper-compilation-targets" "^7.13.16" + "@babel/helper-module-transforms" "^7.13.14" + "@babel/helpers" "^7.13.16" + "@babel/parser" "^7.13.16" + "@babel/template" "^7.12.13" + "@babel/traverse" "^7.13.15" + "@babel/types" "^7.13.16" convert-source-map "^1.7.0" debug "^4.1.0" gensync "^1.0.0-beta.2" @@ -51,64 +51,63 @@ semver "^6.3.0" source-map "^0.5.0" -"@babel/generator@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.14.5.tgz#848d7b9f031caca9d0cd0af01b063f226f52d785" - integrity sha512-y3rlP+/G25OIX3mYKKIOlQRcqj7YgrvHxOLbVmyLJ9bPmi5ttvUmpydVjcFjZphOktWuA7ovbx91ECloWTfjIA== +"@babel/generator@^7.13.16": + version "7.13.16" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.13.16.tgz#0befc287031a201d84cdfc173b46b320ae472d14" + integrity sha512-grBBR75UnKOcUWMp8WoDxNsWCFl//XCK6HWTrBQKTr5SV9f5g0pNOjdyzi/DTBv12S9GnYPInIXQBTky7OXEMg== dependencies: - "@babel/types" "^7.14.5" + "@babel/types" "^7.13.16" jsesc "^2.5.1" source-map "^0.5.0" -"@babel/helper-annotate-as-pure@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.14.5.tgz#7bf478ec3b71726d56a8ca5775b046fc29879e61" - integrity sha512-EivH9EgBIb+G8ij1B2jAwSH36WnGvkQSEC6CkX/6v6ZFlw5fVOHvsgGF4uiEHO2GzMvunZb6tDLQEQSdrdocrA== +"@babel/helper-annotate-as-pure@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.12.13.tgz#0f58e86dfc4bb3b1fcd7db806570e177d439b6ab" + integrity sha512-7YXfX5wQ5aYM/BOlbSccHDbuXXFPxeoUmfWtz8le2yTkTZc+BxsiEnENFoi2SlmA8ewDkG2LgIMIVzzn2h8kfw== dependencies: - "@babel/types" "^7.14.5" + "@babel/types" "^7.12.13" -"@babel/helper-builder-binary-assignment-operator-visitor@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.14.5.tgz#b939b43f8c37765443a19ae74ad8b15978e0a191" - integrity sha512-YTA/Twn0vBXDVGJuAX6PwW7x5zQei1luDDo2Pl6q1qZ7hVNl0RZrhHCQG/ArGpR29Vl7ETiB8eJyrvpuRp300w== +"@babel/helper-builder-binary-assignment-operator-visitor@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.12.13.tgz#6bc20361c88b0a74d05137a65cac8d3cbf6f61fc" + integrity sha512-CZOv9tGphhDRlVjVkAgm8Nhklm9RzSmWpX2my+t7Ua/KT616pEzXsQCjinzvkRvHWJ9itO4f296efroX23XCMA== dependencies: - "@babel/helper-explode-assignable-expression" "^7.14.5" - "@babel/types" "^7.14.5" + "@babel/helper-explode-assignable-expression" "^7.12.13" + "@babel/types" "^7.12.13" -"@babel/helper-compilation-targets@^7.13.0", "@babel/helper-compilation-targets@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.14.5.tgz#7a99c5d0967911e972fe2c3411f7d5b498498ecf" - integrity sha512-v+QtZqXEiOnpO6EYvlImB6zCD2Lel06RzOPzmkz/D/XgQiUu3C/Jb1LOqSt/AIA34TYi/Q+KlT8vTQrgdxkbLw== +"@babel/helper-compilation-targets@^7.13.0", "@babel/helper-compilation-targets@^7.13.13", "@babel/helper-compilation-targets@^7.13.16", "@babel/helper-compilation-targets@^7.13.8": + version "7.13.16" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.13.16.tgz#6e91dccf15e3f43e5556dffe32d860109887563c" + integrity sha512-3gmkYIrpqsLlieFwjkGgLaSHmhnvlAYzZLlYVjlW+QwI+1zE17kGxuJGmIqDQdYp56XdmGeD+Bswx0UTyG18xA== dependencies: - "@babel/compat-data" "^7.14.5" - "@babel/helper-validator-option" "^7.14.5" - browserslist "^4.16.6" + "@babel/compat-data" "^7.13.15" + "@babel/helper-validator-option" "^7.12.17" + browserslist "^4.14.5" semver "^6.3.0" -"@babel/helper-create-class-features-plugin@^7.14.5", "@babel/helper-create-class-features-plugin@^7.14.6": - version "7.14.6" - resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.14.6.tgz#f114469b6c06f8b5c59c6c4e74621f5085362542" - integrity sha512-Z6gsfGofTxH/+LQXqYEK45kxmcensbzmk/oi8DmaQytlQCgqNZt9XQF8iqlI/SeXWVjaMNxvYvzaYw+kh42mDg== +"@babel/helper-create-class-features-plugin@^7.13.0": + version "7.13.0" + resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.13.0.tgz#28d04ad9cfbd1ed1d8b988c9ea7b945263365846" + integrity sha512-twwzhthM4/+6o9766AW2ZBHpIHPSGrPGk1+WfHiu13u/lBnggXGNYCpeAyVfNwGDKfkhEDp+WOD/xafoJ2iLjA== dependencies: - "@babel/helper-annotate-as-pure" "^7.14.5" - "@babel/helper-function-name" "^7.14.5" - "@babel/helper-member-expression-to-functions" "^7.14.5" - "@babel/helper-optimise-call-expression" "^7.14.5" - "@babel/helper-replace-supers" "^7.14.5" - "@babel/helper-split-export-declaration" "^7.14.5" + "@babel/helper-function-name" "^7.12.13" + "@babel/helper-member-expression-to-functions" "^7.13.0" + "@babel/helper-optimise-call-expression" "^7.12.13" + "@babel/helper-replace-supers" "^7.13.0" + "@babel/helper-split-export-declaration" "^7.12.13" -"@babel/helper-create-regexp-features-plugin@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.14.5.tgz#c7d5ac5e9cf621c26057722fb7a8a4c5889358c4" - integrity sha512-TLawwqpOErY2HhWbGJ2nZT5wSkR192QpN+nBg1THfBfftrlvOh+WbhrxXCH4q4xJ9Gl16BGPR/48JA+Ryiho/A== +"@babel/helper-create-regexp-features-plugin@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.12.13.tgz#0996d370a92896c612ae41a4215544bd152579c0" + integrity sha512-XC+kiA0J3at6E85dL5UnCYfVOcIZ834QcAY0TIpgUVnz0zDzg+0TtvZTnJ4g9L1dPRGe30Qi03XCIS4tYCLtqw== dependencies: - "@babel/helper-annotate-as-pure" "^7.14.5" + "@babel/helper-annotate-as-pure" "^7.12.13" regexpu-core "^4.7.1" -"@babel/helper-define-polyfill-provider@^0.2.2": - version "0.2.3" - resolved "https://registry.yarnpkg.com/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.2.3.tgz#0525edec5094653a282688d34d846e4c75e9c0b6" - integrity sha512-RH3QDAfRMzj7+0Nqu5oqgO5q9mFtQEVvCRsi8qCEfzLR9p2BHfn5FzhSB2oj1fF7I2+DcTORkYaQ6aTR9Cofew== +"@babel/helper-define-polyfill-provider@^0.2.0": + version "0.2.0" + resolved "https://registry.yarnpkg.com/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.2.0.tgz#a640051772045fedaaecc6f0c6c69f02bdd34bf1" + integrity sha512-JT8tHuFjKBo8NnaUbblz7mIu1nnvUDiHVjXXkulZULyidvo/7P6TY7+YqpV37IfF+KUFxmlK04elKtGKXaiVgw== dependencies: "@babel/helper-compilation-targets" "^7.13.0" "@babel/helper-module-imports" "^7.12.13" @@ -119,303 +118,285 @@ resolve "^1.14.2" semver "^6.1.2" -"@babel/helper-explode-assignable-expression@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.14.5.tgz#8aa72e708205c7bb643e45c73b4386cdf2a1f645" - integrity sha512-Htb24gnGJdIGT4vnRKMdoXiOIlqOLmdiUYpAQ0mYfgVT/GDm8GOYhgi4GL+hMKrkiPRohO4ts34ELFsGAPQLDQ== +"@babel/helper-explode-assignable-expression@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.12.13.tgz#0e46990da9e271502f77507efa4c9918d3d8634a" + integrity sha512-5loeRNvMo9mx1dA/d6yNi+YiKziJZFylZnCo1nmFF4qPU4yJ14abhWESuSMQSlQxWdxdOFzxXjk/PpfudTtYyw== dependencies: - "@babel/types" "^7.14.5" - -"@babel/helper-function-name@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.14.5.tgz#89e2c474972f15d8e233b52ee8c480e2cfcd50c4" - integrity sha512-Gjna0AsXWfFvrAuX+VKcN/aNNWonizBj39yGwUzVDVTlMYJMK2Wp6xdpy72mfArFq5uK+NOuexfzZlzI1z9+AQ== + "@babel/types" "^7.12.13" + +"@babel/helper-function-name@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.12.13.tgz#93ad656db3c3c2232559fd7b2c3dbdcbe0eb377a" + integrity sha512-TZvmPn0UOqmvi5G4vvw0qZTpVptGkB1GL61R6lKvrSdIxGm5Pky7Q3fpKiIkQCAtRCBUwB0PaThlx9vebCDSwA== + dependencies: + "@babel/helper-get-function-arity" "^7.12.13" + "@babel/template" "^7.12.13" + "@babel/types" "^7.12.13" + +"@babel/helper-get-function-arity@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz#bc63451d403a3b3082b97e1d8b3fe5bd4091e583" + integrity sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg== dependencies: - "@babel/helper-get-function-arity" "^7.14.5" - "@babel/template" "^7.14.5" - "@babel/types" "^7.14.5" + "@babel/types" "^7.12.13" + +"@babel/helper-hoist-variables@^7.13.0": + version "7.13.0" + resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.13.0.tgz#5d5882e855b5c5eda91e0cadc26c6e7a2c8593d8" + integrity sha512-0kBzvXiIKfsCA0y6cFEIJf4OdzfpRuNk4+YTeHZpGGc666SATFKTz6sRncwFnQk7/ugJ4dSrCj6iJuvW4Qwr2g== + dependencies: + "@babel/traverse" "^7.13.0" + "@babel/types" "^7.13.0" + +"@babel/helper-member-expression-to-functions@^7.13.0", "@babel/helper-member-expression-to-functions@^7.13.12": + version "7.13.12" + resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.13.12.tgz#dfe368f26d426a07299d8d6513821768216e6d72" + integrity sha512-48ql1CLL59aKbU94Y88Xgb2VFy7a95ykGRbJJaaVv+LX5U8wFpLfiGXJJGUozsmA1oEh/o5Bp60Voq7ACyA/Sw== + dependencies: + "@babel/types" "^7.13.12" + +"@babel/helper-module-imports@^7.12.13", "@babel/helper-module-imports@^7.13.12": + version "7.13.12" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.13.12.tgz#c6a369a6f3621cb25da014078684da9196b61977" + integrity sha512-4cVvR2/1B693IuOvSI20xqqa/+bl7lqAMR59R4iu39R9aOX8/JoYY1sFaNvUMyMBGnHdwvJgUrzNLoUZxXypxA== + dependencies: + "@babel/types" "^7.13.12" + +"@babel/helper-module-transforms@^7.13.0", "@babel/helper-module-transforms@^7.13.14": + version "7.13.14" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.13.14.tgz#e600652ba48ccb1641775413cb32cfa4e8b495ef" + integrity sha512-QuU/OJ0iAOSIatyVZmfqB0lbkVP0kDRiKj34xy+QNsnVZi/PA6BoSoreeqnxxa9EHFAIL0R9XOaAR/G9WlIy5g== + dependencies: + "@babel/helper-module-imports" "^7.13.12" + "@babel/helper-replace-supers" "^7.13.12" + "@babel/helper-simple-access" "^7.13.12" + "@babel/helper-split-export-declaration" "^7.12.13" + "@babel/helper-validator-identifier" "^7.12.11" + "@babel/template" "^7.12.13" + "@babel/traverse" "^7.13.13" + "@babel/types" "^7.13.14" + +"@babel/helper-optimise-call-expression@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.12.13.tgz#5c02d171b4c8615b1e7163f888c1c81c30a2aaea" + integrity sha512-BdWQhoVJkp6nVjB7nkFWcn43dkprYauqtk++Py2eaf/GRDFm5BxRqEIZCiHlZUGAVmtwKcsVL1dC68WmzeFmiA== + dependencies: + "@babel/types" "^7.12.13" + +"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.13.0", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": + version "7.13.0" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz#806526ce125aed03373bc416a828321e3a6a33af" + integrity sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ== -"@babel/helper-get-function-arity@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.14.5.tgz#25fbfa579b0937eee1f3b805ece4ce398c431815" - integrity sha512-I1Db4Shst5lewOM4V+ZKJzQ0JGGaZ6VY1jYvMghRjqs6DWgxLCIyFt30GlnKkfUeFLpJt2vzbMVEXVSXlIFYUg== +"@babel/helper-remap-async-to-generator@^7.13.0": + version "7.13.0" + resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.13.0.tgz#376a760d9f7b4b2077a9dd05aa9c3927cadb2209" + integrity sha512-pUQpFBE9JvC9lrQbpX0TmeNIy5s7GnZjna2lhhcHC7DzgBs6fWn722Y5cfwgrtrqc7NAJwMvOa0mKhq6XaE4jg== dependencies: - "@babel/types" "^7.14.5" - -"@babel/helper-hoist-variables@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.14.5.tgz#e0dd27c33a78e577d7c8884916a3e7ef1f7c7f8d" - integrity sha512-R1PXiz31Uc0Vxy4OEOm07x0oSjKAdPPCh3tPivn/Eo8cvz6gveAeuyUUPB21Hoiif0uoPQSSdhIPS3352nvdyQ== - dependencies: - "@babel/types" "^7.14.5" + "@babel/helper-annotate-as-pure" "^7.12.13" + "@babel/helper-wrap-function" "^7.13.0" + "@babel/types" "^7.13.0" -"@babel/helper-member-expression-to-functions@^7.14.5": - version "7.14.7" - resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.14.7.tgz#97e56244beb94211fe277bd818e3a329c66f7970" - integrity sha512-TMUt4xKxJn6ccjcOW7c4hlwyJArizskAhoSTOCkA0uZ+KghIaci0Qg9R043kUMWI9mtQfgny+NQ5QATnZ+paaA== - dependencies: - "@babel/types" "^7.14.5" - -"@babel/helper-module-imports@^7.12.13", "@babel/helper-module-imports@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.14.5.tgz#6d1a44df6a38c957aa7c312da076429f11b422f3" - integrity sha512-SwrNHu5QWS84XlHwGYPDtCxcA0hrSlL2yhWYLgeOc0w7ccOl2qv4s/nARI0aYZW+bSwAL5CukeXA47B/1NKcnQ== - dependencies: - "@babel/types" "^7.14.5" - -"@babel/helper-module-transforms@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.14.5.tgz#7de42f10d789b423eb902ebd24031ca77cb1e10e" - integrity sha512-iXpX4KW8LVODuAieD7MzhNjmM6dzYY5tfRqT+R9HDXWl0jPn/djKmA+G9s/2C2T9zggw5tK1QNqZ70USfedOwA== - dependencies: - "@babel/helper-module-imports" "^7.14.5" - "@babel/helper-replace-supers" "^7.14.5" - "@babel/helper-simple-access" "^7.14.5" - "@babel/helper-split-export-declaration" "^7.14.5" - "@babel/helper-validator-identifier" "^7.14.5" - "@babel/template" "^7.14.5" - "@babel/traverse" "^7.14.5" - "@babel/types" "^7.14.5" - -"@babel/helper-optimise-call-expression@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.14.5.tgz#f27395a8619e0665b3f0364cddb41c25d71b499c" - integrity sha512-IqiLIrODUOdnPU9/F8ib1Fx2ohlgDhxnIDU7OEVi+kAbEZcyiF7BLU8W6PfvPi9LzztjS7kcbzbmL7oG8kD6VA== - dependencies: - "@babel/types" "^7.14.5" - -"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.13.0", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.14.5.tgz#5ac822ce97eec46741ab70a517971e443a70c5a9" - integrity sha512-/37qQCE3K0vvZKwoK4XU/irIJQdIfCJuhU5eKnNxpFDsOkgFaUAwbv+RYw6eYgsC0E4hS7r5KqGULUogqui0fQ== - -"@babel/helper-remap-async-to-generator@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.14.5.tgz#51439c913612958f54a987a4ffc9ee587a2045d6" - integrity sha512-rLQKdQU+HYlxBwQIj8dk4/0ENOUEhA/Z0l4hN8BexpvmSMN9oA9EagjnhnDpNsRdWCfjwa4mn/HyBXO9yhQP6A== - dependencies: - "@babel/helper-annotate-as-pure" "^7.14.5" - "@babel/helper-wrap-function" "^7.14.5" - "@babel/types" "^7.14.5" - -"@babel/helper-replace-supers@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.14.5.tgz#0ecc0b03c41cd567b4024ea016134c28414abb94" - integrity sha512-3i1Qe9/8x/hCHINujn+iuHy+mMRLoc77b2nI9TB0zjH1hvn9qGlXjWlggdwUcju36PkPCy/lpM7LLUdcTyH4Ow== - dependencies: - "@babel/helper-member-expression-to-functions" "^7.14.5" - "@babel/helper-optimise-call-expression" "^7.14.5" - "@babel/traverse" "^7.14.5" - "@babel/types" "^7.14.5" - -"@babel/helper-simple-access@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.14.5.tgz#66ea85cf53ba0b4e588ba77fc813f53abcaa41c4" - integrity sha512-nfBN9xvmCt6nrMZjfhkl7i0oTV3yxR4/FztsbOASyTvVcoYd0TRHh7eMLdlEcCqobydC0LAF3LtC92Iwxo0wyw== - dependencies: - "@babel/types" "^7.14.5" - -"@babel/helper-skip-transparent-expression-wrappers@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.14.5.tgz#96f486ac050ca9f44b009fbe5b7d394cab3a0ee4" - integrity sha512-dmqZB7mrb94PZSAOYtr+ZN5qt5owZIAgqtoTuqiFbHFtxgEcmQlRJVI+bO++fciBunXtB6MK7HrzrfcAzIz2NQ== - dependencies: - "@babel/types" "^7.14.5" - -"@babel/helper-split-export-declaration@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.14.5.tgz#22b23a54ef51c2b7605d851930c1976dd0bc693a" - integrity sha512-hprxVPu6e5Kdp2puZUmvOGjaLv9TCe58E/Fl6hRq4YiVQxIcNvuq6uTM2r1mT/oPskuS9CgR+I94sqAYv0NGKA== - dependencies: - "@babel/types" "^7.14.5" - -"@babel/helper-validator-identifier@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.5.tgz#d0f0e277c512e0c938277faa85a3968c9a44c0e8" - integrity sha512-5lsetuxCLilmVGyiLEfoHBRX8UCFD+1m2x3Rj97WrW3V7H3u4RWRXA4evMjImCsin2J2YT0QaVDGf+z8ondbAg== - -"@babel/helper-validator-option@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.14.5.tgz#6e72a1fff18d5dfcb878e1e62f1a021c4b72d5a3" - integrity sha512-OX8D5eeX4XwcroVW45NMvoYaIuFI+GQpA2a8Gi+X/U/cDUIRsV37qQfF905F0htTRCREQIB4KqPeaveRJUl3Ow== - -"@babel/helper-wrap-function@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.14.5.tgz#5919d115bf0fe328b8a5d63bcb610f51601f2bff" - integrity sha512-YEdjTCq+LNuNS1WfxsDCNpgXkJaIyqco6DAelTUjT4f2KIWC1nBcaCaSdHTBqQVLnTBexBcVcFhLSU1KnYuePQ== - dependencies: - "@babel/helper-function-name" "^7.14.5" - "@babel/template" "^7.14.5" - "@babel/traverse" "^7.14.5" - "@babel/types" "^7.14.5" - -"@babel/helpers@^7.14.6": - version "7.14.6" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.14.6.tgz#5b58306b95f1b47e2a0199434fa8658fa6c21635" - integrity sha512-yesp1ENQBiLI+iYHSJdoZKUtRpfTlL1grDIX9NRlAVppljLw/4tTyYupIB7uIYmC3stW/imAv8EqaKaS/ibmeA== - dependencies: - "@babel/template" "^7.14.5" - "@babel/traverse" "^7.14.5" - "@babel/types" "^7.14.5" - -"@babel/highlight@^7.14.5", "@babel/highlight@^7.9.0": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.14.5.tgz#6861a52f03966405001f6aa534a01a24d99e8cd9" - integrity sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg== - dependencies: - "@babel/helper-validator-identifier" "^7.14.5" +"@babel/helper-replace-supers@^7.12.13", "@babel/helper-replace-supers@^7.13.0", "@babel/helper-replace-supers@^7.13.12": + version "7.13.12" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.13.12.tgz#6442f4c1ad912502481a564a7386de0c77ff3804" + integrity sha512-Gz1eiX+4yDO8mT+heB94aLVNCL+rbuT2xy4YfyNqu8F+OI6vMvJK891qGBTqL9Uc8wxEvRW92Id6G7sDen3fFw== + dependencies: + "@babel/helper-member-expression-to-functions" "^7.13.12" + "@babel/helper-optimise-call-expression" "^7.12.13" + "@babel/traverse" "^7.13.0" + "@babel/types" "^7.13.12" + +"@babel/helper-simple-access@^7.12.13", "@babel/helper-simple-access@^7.13.12": + version "7.13.12" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.13.12.tgz#dd6c538afb61819d205a012c31792a39c7a5eaf6" + integrity sha512-7FEjbrx5SL9cWvXioDbnlYTppcZGuCY6ow3/D5vMggb2Ywgu4dMrpTJX0JdQAIcRRUElOIxF3yEooa9gUb9ZbA== + dependencies: + "@babel/types" "^7.13.12" + +"@babel/helper-skip-transparent-expression-wrappers@^7.12.1": + version "7.12.1" + resolved "https://registry.yarnpkg.com/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.12.1.tgz#462dc63a7e435ade8468385c63d2b84cce4b3cbf" + integrity sha512-Mf5AUuhG1/OCChOJ/HcADmvcHM42WJockombn8ATJG3OnyiSxBK/Mm5x78BQWvmtXZKHgbjdGL2kin/HOLlZGA== + dependencies: + "@babel/types" "^7.12.1" + +"@babel/helper-split-export-declaration@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz#e9430be00baf3e88b0e13e6f9d4eaf2136372b05" + integrity sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg== + dependencies: + "@babel/types" "^7.12.13" + +"@babel/helper-validator-identifier@^7.12.11": + version "7.12.11" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz#c9a1f021917dcb5ccf0d4e453e399022981fc9ed" + integrity sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw== + +"@babel/helper-validator-option@^7.12.17": + version "7.12.17" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.12.17.tgz#d1fbf012e1a79b7eebbfdc6d270baaf8d9eb9831" + integrity sha512-TopkMDmLzq8ngChwRlyjR6raKD6gMSae4JdYDB8bByKreQgG0RBTuKe9LRxW3wFtUnjxOPRKBDwEH6Mg5KeDfw== + +"@babel/helper-wrap-function@^7.13.0": + version "7.13.0" + resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.13.0.tgz#bdb5c66fda8526ec235ab894ad53a1235c79fcc4" + integrity sha512-1UX9F7K3BS42fI6qd2A4BjKzgGjToscyZTdp1DjknHLCIvpgne6918io+aL5LXFcER/8QWiwpoY902pVEqgTXA== + dependencies: + "@babel/helper-function-name" "^7.12.13" + "@babel/template" "^7.12.13" + "@babel/traverse" "^7.13.0" + "@babel/types" "^7.13.0" + +"@babel/helpers@^7.13.16": + version "7.13.17" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.13.17.tgz#b497c7a00e9719d5b613b8982bda6ed3ee94caf6" + integrity sha512-Eal4Gce4kGijo1/TGJdqp3WuhllaMLSrW6XcL0ulyUAQOuxHcCafZE8KHg9857gcTehsm/v7RcOx2+jp0Ryjsg== + dependencies: + "@babel/template" "^7.12.13" + "@babel/traverse" "^7.13.17" + "@babel/types" "^7.13.17" + +"@babel/highlight@^7.12.13", "@babel/highlight@^7.9.0": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.12.13.tgz#8ab538393e00370b26271b01fa08f7f27f2e795c" + integrity sha512-kocDQvIbgMKlWxXe9fof3TQ+gkIPOUSEYhJjqUjvKMez3krV7vbzYCDq39Oj11UAVK7JqPVGQPlgE85dPNlQww== + dependencies: + "@babel/helper-validator-identifier" "^7.12.11" chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.14.5", "@babel/parser@^7.14.6", "@babel/parser@^7.14.7": - version "7.14.7" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.14.7.tgz#6099720c8839ca865a2637e6c85852ead0bdb595" - integrity sha512-X67Z5y+VBJuHB/RjwECp8kSl5uYi0BvRbNeWqkaJCVh+LiTPl19WBUfG627psSgp9rSf6ojuXghQM3ha6qHHdA== +"@babel/parser@^7.12.13", "@babel/parser@^7.13.16": + version "7.13.16" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.13.16.tgz#0f18179b0448e6939b1f3f5c4c355a3a9bcdfd37" + integrity sha512-6bAg36mCwuqLO0hbR+z7PHuqWiCeP7Dzg73OpQwsAB1Eb8HnGEz5xYBzCfbu+YjoaJsJs+qheDxVAuqbt3ILEw== -"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.14.5.tgz#4b467302e1548ed3b1be43beae2cc9cf45e0bb7e" - integrity sha512-ZoJS2XCKPBfTmL122iP6NM9dOg+d4lc9fFk3zxc8iDjvt8Pk4+TlsHSKhIPf6X+L5ORCdBzqMZDjL/WHj7WknQ== +"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.13.12": + version "7.13.12" + resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.13.12.tgz#a3484d84d0b549f3fc916b99ee4783f26fabad2a" + integrity sha512-d0u3zWKcoZf379fOeJdr1a5WPDny4aOFZ6hlfKivgK0LY7ZxNfoaHL2fWwdGtHyVvra38FC+HVYkO+byfSA8AQ== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-skip-transparent-expression-wrappers" "^7.14.5" - "@babel/plugin-proposal-optional-chaining" "^7.14.5" + "@babel/helper-plugin-utils" "^7.13.0" + "@babel/helper-skip-transparent-expression-wrappers" "^7.12.1" + "@babel/plugin-proposal-optional-chaining" "^7.13.12" -"@babel/plugin-proposal-async-generator-functions@^7.14.7": - version "7.14.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.14.7.tgz#784a48c3d8ed073f65adcf30b57bcbf6c8119ace" - integrity sha512-RK8Wj7lXLY3bqei69/cc25gwS5puEc3dknoFPFbqfy3XxYQBQFvu4ioWpafMBAB+L9NyptQK4nMOa5Xz16og8Q== +"@babel/plugin-proposal-async-generator-functions@^7.13.15": + version "7.13.15" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.13.15.tgz#80e549df273a3b3050431b148c892491df1bcc5b" + integrity sha512-VapibkWzFeoa6ubXy/NgV5U2U4MVnUlvnx6wo1XhlsaTrLYWE0UFpDQsVrmn22q5CzeloqJ8gEMHSKxuee6ZdA== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-remap-async-to-generator" "^7.14.5" + "@babel/helper-plugin-utils" "^7.13.0" + "@babel/helper-remap-async-to-generator" "^7.13.0" "@babel/plugin-syntax-async-generators" "^7.8.4" -"@babel/plugin-proposal-class-properties@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.14.5.tgz#40d1ee140c5b1e31a350f4f5eed945096559b42e" - integrity sha512-q/PLpv5Ko4dVc1LYMpCY7RVAAO4uk55qPwrIuJ5QJ8c6cVuAmhu7I/49JOppXL6gXf7ZHzpRVEUZdYoPLM04Gg== +"@babel/plugin-proposal-class-properties@^7.13.0": + version "7.13.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.13.0.tgz#146376000b94efd001e57a40a88a525afaab9f37" + integrity sha512-KnTDjFNC1g+45ka0myZNvSBFLhNCLN+GeGYLDEA8Oq7MZ6yMgfLoIRh86GRT0FjtJhZw8JyUskP9uvj5pHM9Zg== dependencies: - "@babel/helper-create-class-features-plugin" "^7.14.5" - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/plugin-proposal-class-static-block@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-static-block/-/plugin-proposal-class-static-block-7.14.5.tgz#158e9e10d449c3849ef3ecde94a03d9f1841b681" - integrity sha512-KBAH5ksEnYHCegqseI5N9skTdxgJdmDoAOc0uXa+4QMYKeZD0w5IARh4FMlTNtaHhbB8v+KzMdTgxMMzsIy6Yg== - dependencies: - "@babel/helper-create-class-features-plugin" "^7.14.5" - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/plugin-syntax-class-static-block" "^7.14.5" + "@babel/helper-create-class-features-plugin" "^7.13.0" + "@babel/helper-plugin-utils" "^7.13.0" -"@babel/plugin-proposal-dynamic-import@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.14.5.tgz#0c6617df461c0c1f8fff3b47cd59772360101d2c" - integrity sha512-ExjiNYc3HDN5PXJx+bwC50GIx/KKanX2HiggnIUAYedbARdImiCU4RhhHfdf0Kd7JNXGpsBBBCOm+bBVy3Gb0g== +"@babel/plugin-proposal-dynamic-import@^7.13.8": + version "7.13.8" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.13.8.tgz#876a1f6966e1dec332e8c9451afda3bebcdf2e1d" + integrity sha512-ONWKj0H6+wIRCkZi9zSbZtE/r73uOhMVHh256ys0UzfM7I3d4n+spZNWjOnJv2gzopumP2Wxi186vI8N0Y2JyQ== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.13.0" "@babel/plugin-syntax-dynamic-import" "^7.8.3" -"@babel/plugin-proposal-export-default-from@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-export-default-from/-/plugin-proposal-export-default-from-7.14.5.tgz#8931a6560632c650f92a8e5948f6e73019d6d321" - integrity sha512-T8KZ5abXvKMjF6JcoXjgac3ElmXf0AWzJwi2O/42Jk+HmCky3D9+i1B7NPP1FblyceqTevKeV/9szeikFoaMDg== +"@babel/plugin-proposal-export-default-from@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-export-default-from/-/plugin-proposal-export-default-from-7.12.13.tgz#f110284108a9b2b96f01b15b3be9e54c2610a989" + integrity sha512-idIsBT+DGXdOHL82U+8bwX4goHm/z10g8sGGrQroh+HCRcm7mDv/luaGdWJQMTuCX2FsdXS7X0Nyyzp4znAPJA== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/plugin-syntax-export-default-from" "^7.14.5" + "@babel/helper-plugin-utils" "^7.12.13" + "@babel/plugin-syntax-export-default-from" "^7.12.13" -"@babel/plugin-proposal-export-namespace-from@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.14.5.tgz#dbad244310ce6ccd083072167d8cea83a52faf76" - integrity sha512-g5POA32bXPMmSBu5Dx/iZGLGnKmKPc5AiY7qfZgurzrCYgIztDlHFbznSNCoQuv57YQLnQfaDi7dxCtLDIdXdA== +"@babel/plugin-proposal-export-namespace-from@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.12.13.tgz#393be47a4acd03fa2af6e3cde9b06e33de1b446d" + integrity sha512-INAgtFo4OnLN3Y/j0VwAgw3HDXcDtX+C/erMvWzuV9v71r7urb6iyMXu7eM9IgLr1ElLlOkaHjJ0SbCmdOQ3Iw== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.12.13" "@babel/plugin-syntax-export-namespace-from" "^7.8.3" -"@babel/plugin-proposal-json-strings@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.14.5.tgz#38de60db362e83a3d8c944ac858ddf9f0c2239eb" - integrity sha512-NSq2fczJYKVRIsUJyNxrVUMhB27zb7N7pOFGQOhBKJrChbGcgEAqyZrmZswkPk18VMurEeJAaICbfm57vUeTbQ== +"@babel/plugin-proposal-json-strings@^7.13.8": + version "7.13.8" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.13.8.tgz#bf1fb362547075afda3634ed31571c5901afef7b" + integrity sha512-w4zOPKUFPX1mgvTmL/fcEqy34hrQ1CRcGxdphBc6snDnnqJ47EZDIyop6IwXzAC8G916hsIuXB2ZMBCExC5k7Q== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.13.0" "@babel/plugin-syntax-json-strings" "^7.8.3" -"@babel/plugin-proposal-logical-assignment-operators@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.14.5.tgz#6e6229c2a99b02ab2915f82571e0cc646a40c738" - integrity sha512-YGn2AvZAo9TwyhlLvCCWxD90Xq8xJ4aSgaX3G5D/8DW94L8aaT+dS5cSP+Z06+rCJERGSr9GxMBZ601xoc2taw== +"@babel/plugin-proposal-logical-assignment-operators@^7.13.8": + version "7.13.8" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.13.8.tgz#93fa78d63857c40ce3c8c3315220fd00bfbb4e1a" + integrity sha512-aul6znYB4N4HGweImqKn59Su9RS8lbUIqxtXTOcAGtNIDczoEFv+l1EhmX8rUBp3G1jMjKJm8m0jXVp63ZpS4A== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.13.0" "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" -"@babel/plugin-proposal-nullish-coalescing-operator@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.14.5.tgz#ee38589ce00e2cc59b299ec3ea406fcd3a0fdaf6" - integrity sha512-gun/SOnMqjSb98Nkaq2rTKMwervfdAoz6NphdY0vTfuzMfryj+tDGb2n6UkDKwez+Y8PZDhE3D143v6Gepp4Hg== +"@babel/plugin-proposal-nullish-coalescing-operator@^7.13.8": + version "7.13.8" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.13.8.tgz#3730a31dafd3c10d8ccd10648ed80a2ac5472ef3" + integrity sha512-iePlDPBn//UhxExyS9KyeYU7RM9WScAG+D3Hhno0PLJebAEpDZMocbDe64eqynhNAnwz/vZoL/q/QB2T1OH39A== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.13.0" "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" -"@babel/plugin-proposal-numeric-separator@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.14.5.tgz#83631bf33d9a51df184c2102a069ac0c58c05f18" - integrity sha512-yiclALKe0vyZRZE0pS6RXgjUOt87GWv6FYa5zqj15PvhOGFO69R5DusPlgK/1K5dVnCtegTiWu9UaBSrLLJJBg== +"@babel/plugin-proposal-numeric-separator@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.12.13.tgz#bd9da3188e787b5120b4f9d465a8261ce67ed1db" + integrity sha512-O1jFia9R8BUCl3ZGB7eitaAPu62TXJRHn7rh+ojNERCFyqRwJMTmhz+tJ+k0CwI6CLjX/ee4qW74FSqlq9I35w== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.12.13" "@babel/plugin-syntax-numeric-separator" "^7.10.4" -"@babel/plugin-proposal-object-rest-spread@^7.14.7": - version "7.14.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.14.7.tgz#5920a2b3df7f7901df0205974c0641b13fd9d363" - integrity sha512-082hsZz+sVabfmDWo1Oct1u1AgbKbUAyVgmX4otIc7bdsRgHBXwTwb3DpDmD4Eyyx6DNiuz5UAATT655k+kL5g== +"@babel/plugin-proposal-object-rest-spread@^7.13.8": + version "7.13.8" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.13.8.tgz#5d210a4d727d6ce3b18f9de82cc99a3964eed60a" + integrity sha512-DhB2EuB1Ih7S3/IRX5AFVgZ16k3EzfRbq97CxAVI1KSYcW+lexV8VZb7G7L8zuPVSdQMRn0kiBpf/Yzu9ZKH0g== dependencies: - "@babel/compat-data" "^7.14.7" - "@babel/helper-compilation-targets" "^7.14.5" - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/compat-data" "^7.13.8" + "@babel/helper-compilation-targets" "^7.13.8" + "@babel/helper-plugin-utils" "^7.13.0" "@babel/plugin-syntax-object-rest-spread" "^7.8.3" - "@babel/plugin-transform-parameters" "^7.14.5" + "@babel/plugin-transform-parameters" "^7.13.0" -"@babel/plugin-proposal-optional-catch-binding@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.14.5.tgz#939dd6eddeff3a67fdf7b3f044b5347262598c3c" - integrity sha512-3Oyiixm0ur7bzO5ybNcZFlmVsygSIQgdOa7cTfOYCMY+wEPAYhZAJxi3mixKFCTCKUhQXuCTtQ1MzrpL3WT8ZQ== +"@babel/plugin-proposal-optional-catch-binding@^7.13.8": + version "7.13.8" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.13.8.tgz#3ad6bd5901506ea996fc31bdcf3ccfa2bed71107" + integrity sha512-0wS/4DUF1CuTmGo+NiaHfHcVSeSLj5S3e6RivPTg/2k3wOv3jO35tZ6/ZWsQhQMvdgI7CwphjQa/ccarLymHVA== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.13.0" "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" -"@babel/plugin-proposal-optional-chaining@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.14.5.tgz#fa83651e60a360e3f13797eef00b8d519695b603" - integrity sha512-ycz+VOzo2UbWNI1rQXxIuMOzrDdHGrI23fRiz/Si2R4kv2XZQ1BK8ccdHwehMKBlcH/joGW/tzrUmo67gbJHlQ== +"@babel/plugin-proposal-optional-chaining@^7.13.12": + version "7.13.12" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.13.12.tgz#ba9feb601d422e0adea6760c2bd6bbb7bfec4866" + integrity sha512-fcEdKOkIB7Tf4IxrgEVeFC4zeJSTr78no9wTdBuZZbqF64kzllU0ybo2zrzm7gUQfxGhBgq4E39oRs8Zx/RMYQ== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-skip-transparent-expression-wrappers" "^7.14.5" + "@babel/helper-plugin-utils" "^7.13.0" + "@babel/helper-skip-transparent-expression-wrappers" "^7.12.1" "@babel/plugin-syntax-optional-chaining" "^7.8.3" -"@babel/plugin-proposal-private-methods@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.14.5.tgz#37446495996b2945f30f5be5b60d5e2aa4f5792d" - integrity sha512-838DkdUA1u+QTCplatfq4B7+1lnDa/+QMI89x5WZHBcnNv+47N8QEj2k9I2MUU9xIv8XJ4XvPCviM/Dj7Uwt9g== +"@babel/plugin-proposal-private-methods@^7.13.0": + version "7.13.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.13.0.tgz#04bd4c6d40f6e6bbfa2f57e2d8094bad900ef787" + integrity sha512-MXyyKQd9inhx1kDYPkFRVOBXQ20ES8Pto3T7UZ92xj2mY0EVD8oAVzeyYuVfy/mxAdTSIayOvg+aVzcHV2bn6Q== dependencies: - "@babel/helper-create-class-features-plugin" "^7.14.5" - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/plugin-proposal-private-property-in-object@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.14.5.tgz#9f65a4d0493a940b4c01f8aa9d3f1894a587f636" - integrity sha512-62EyfyA3WA0mZiF2e2IV9mc9Ghwxcg8YTu8BS4Wss4Y3PY725OmS9M0qLORbJwLqFtGh+jiE4wAmocK2CTUK2Q== - dependencies: - "@babel/helper-annotate-as-pure" "^7.14.5" - "@babel/helper-create-class-features-plugin" "^7.14.5" - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/plugin-syntax-private-property-in-object" "^7.14.5" + "@babel/helper-create-class-features-plugin" "^7.13.0" + "@babel/helper-plugin-utils" "^7.13.0" -"@babel/plugin-proposal-unicode-property-regex@^7.14.5", "@babel/plugin-proposal-unicode-property-regex@^7.4.4": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.14.5.tgz#0f95ee0e757a5d647f378daa0eca7e93faa8bbe8" - integrity sha512-6axIeOU5LnY471KenAB9vI8I5j7NQ2d652hIYwVyRfgaZT5UpiqFKCuVXCDMSrU+3VFafnu2c5m3lrWIlr6A5Q== +"@babel/plugin-proposal-unicode-property-regex@^7.12.13", "@babel/plugin-proposal-unicode-property-regex@^7.4.4": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.12.13.tgz#bebde51339be829c17aaaaced18641deb62b39ba" + integrity sha512-XyJmZidNfofEkqFV5VC/bLabGmO5QzenPO/YOfGuEbgU+2sSwMmio3YLb4WtBgcmmdwZHyVyv8on77IUjQ5Gvg== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.14.5" - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-create-regexp-features-plugin" "^7.12.13" + "@babel/helper-plugin-utils" "^7.12.13" "@babel/plugin-syntax-async-generators@^7.8.4": version "7.8.4" @@ -431,13 +412,6 @@ dependencies: "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-syntax-class-static-block@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz#195df89b146b4b78b3bf897fd7a257c84659d406" - integrity sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/plugin-syntax-dynamic-import@^7.8.3": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz#62bf98b2da3cd21d626154fc96ee5b3cb68eacb3" @@ -445,12 +419,12 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.0" -"@babel/plugin-syntax-export-default-from@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-export-default-from/-/plugin-syntax-export-default-from-7.14.5.tgz#cdfa9d43d2b2c89b6f1af3e83518e8c8b9ed0dbc" - integrity sha512-snWDxjuaPEobRBnhpqEfZ8RMxDbHt8+87fiEioGuE+Uc0xAKgSD8QiuL3lF93hPVQfZFAcYwrrf+H5qUhike3Q== +"@babel/plugin-syntax-export-default-from@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-export-default-from/-/plugin-syntax-export-default-from-7.12.13.tgz#3c807d37efaf0a806f1deb556ccb3b2f562ae9c2" + integrity sha512-gVry0zqoums0hA+EniCYK3gABhjYSLX1dVuwYpPw9DrLNA4/GovXySHVg4FGRsZht09ON/5C2NVx3keq+qqVGQ== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.12.13" "@babel/plugin-syntax-export-namespace-from@^7.8.3": version "7.8.3" @@ -459,12 +433,12 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.3" -"@babel/plugin-syntax-flow@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-flow/-/plugin-syntax-flow-7.14.5.tgz#2ff654999497d7d7d142493260005263731da180" - integrity sha512-9WK5ZwKCdWHxVuU13XNT6X73FGmutAXeor5lGFq6qhOFtMFUF4jkbijuyUdZZlpYq6E2hZeZf/u3959X9wsv0Q== +"@babel/plugin-syntax-flow@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-flow/-/plugin-syntax-flow-7.12.13.tgz#5df9962503c0a9c918381c929d51d4d6949e7e86" + integrity sha512-J/RYxnlSLXZLVR7wTRsozxKT8qbsx1mNKJzXEEjQ0Kjx1ZACcyHgbanNWNCFtc36IzuWhYWPpvJFFoexoOWFmA== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.12.13" "@babel/plugin-syntax-import-meta@^7.10.4": version "7.10.4" @@ -522,320 +496,310 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.0" -"@babel/plugin-syntax-private-property-in-object@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz#0dc6671ec0ea22b6e94a1114f857970cd39de1ad" - integrity sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/plugin-syntax-top-level-await@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz#c1cfdadc35a646240001f06138247b741c34d94c" - integrity sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw== +"@babel/plugin-syntax-top-level-await@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.12.13.tgz#c5f0fa6e249f5b739727f923540cf7a806130178" + integrity sha512-A81F9pDwyS7yM//KwbCSDqy3Uj4NMIurtplxphWxoYtNPov7cJsDkAFNNyVlIZ3jwGycVsurZ+LtOA8gZ376iQ== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-syntax-typescript@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.14.5.tgz#b82c6ce471b165b5ce420cf92914d6fb46225716" - integrity sha512-u6OXzDaIXjEstBRRoBCQ/uKQKlbuaeE5in0RvWdA4pN6AhqxTIwUsnHPU1CFZA/amYObMsuWhYfRl3Ch90HD0Q== +"@babel/plugin-syntax-typescript@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.12.13.tgz#9dff111ca64154cef0f4dc52cf843d9f12ce4474" + integrity sha512-cHP3u1JiUiG2LFDKbXnwVad81GvfyIOmCD6HIEId6ojrY0Drfy2q1jw7BwN7dE84+kTnBjLkXoL3IEy/3JPu2w== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-transform-arrow-functions@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.14.5.tgz#f7187d9588a768dd080bf4c9ffe117ea62f7862a" - integrity sha512-KOnO0l4+tD5IfOdi4x8C1XmEIRWUjNRV8wc6K2vz/3e8yAOoZZvsRXRRIF/yo/MAOFb4QjtAw9xSxMXbSMRy8A== +"@babel/plugin-transform-arrow-functions@^7.13.0": + version "7.13.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.13.0.tgz#10a59bebad52d637a027afa692e8d5ceff5e3dae" + integrity sha512-96lgJagobeVmazXFaDrbmCLQxBysKu7U6Do3mLsx27gf5Dk85ezysrs2BZUpXD703U/Su1xTBDxxar2oa4jAGg== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.13.0" -"@babel/plugin-transform-async-to-generator@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.14.5.tgz#72c789084d8f2094acb945633943ef8443d39e67" - integrity sha512-szkbzQ0mNk0rpu76fzDdqSyPu0MuvpXgC+6rz5rpMb5OIRxdmHfQxrktL8CYolL2d8luMCZTR0DpIMIdL27IjA== +"@babel/plugin-transform-async-to-generator@^7.13.0": + version "7.13.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.13.0.tgz#8e112bf6771b82bf1e974e5e26806c5c99aa516f" + integrity sha512-3j6E004Dx0K3eGmhxVJxwwI89CTJrce7lg3UrtFuDAVQ/2+SJ/h/aSFOeE6/n0WB1GsOffsJp6MnPQNQ8nmwhg== dependencies: - "@babel/helper-module-imports" "^7.14.5" - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-remap-async-to-generator" "^7.14.5" + "@babel/helper-module-imports" "^7.12.13" + "@babel/helper-plugin-utils" "^7.13.0" + "@babel/helper-remap-async-to-generator" "^7.13.0" -"@babel/plugin-transform-block-scoped-functions@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.14.5.tgz#e48641d999d4bc157a67ef336aeb54bc44fd3ad4" - integrity sha512-dtqWqdWZ5NqBX3KzsVCWfQI3A53Ft5pWFCT2eCVUftWZgjc5DpDponbIF1+c+7cSGk2wN0YK7HGL/ezfRbpKBQ== +"@babel/plugin-transform-block-scoped-functions@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.12.13.tgz#a9bf1836f2a39b4eb6cf09967739de29ea4bf4c4" + integrity sha512-zNyFqbc3kI/fVpqwfqkg6RvBgFpC4J18aKKMmv7KdQ/1GgREapSJAykLMVNwfRGO3BtHj3YQZl8kxCXPcVMVeg== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-transform-block-scoping@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.14.5.tgz#8cc63e61e50f42e078e6f09be775a75f23ef9939" - integrity sha512-LBYm4ZocNgoCqyxMLoOnwpsmQ18HWTQvql64t3GvMUzLQrNoV1BDG0lNftC8QKYERkZgCCT/7J5xWGObGAyHDw== +"@babel/plugin-transform-block-scoping@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.12.13.tgz#f36e55076d06f41dfd78557ea039c1b581642e61" + integrity sha512-Pxwe0iqWJX4fOOM2kEZeUuAxHMWb9nK+9oh5d11bsLoB0xMg+mkDpt0eYuDZB7ETrY9bbcVlKUGTOGWy7BHsMQ== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-transform-classes@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.14.5.tgz#0e98e82097b38550b03b483f9b51a78de0acb2cf" - integrity sha512-J4VxKAMykM06K/64z9rwiL6xnBHgB1+FVspqvlgCdwD1KUbQNfszeKVVOMh59w3sztHYIZDgnhOC4WbdEfHFDA== +"@babel/plugin-transform-classes@^7.13.0": + version "7.13.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.13.0.tgz#0265155075c42918bf4d3a4053134176ad9b533b" + integrity sha512-9BtHCPUARyVH1oXGcSJD3YpsqRLROJx5ZNP6tN5vnk17N0SVf9WCtf8Nuh1CFmgByKKAIMstitKduoCmsaDK5g== dependencies: - "@babel/helper-annotate-as-pure" "^7.14.5" - "@babel/helper-function-name" "^7.14.5" - "@babel/helper-optimise-call-expression" "^7.14.5" - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-replace-supers" "^7.14.5" - "@babel/helper-split-export-declaration" "^7.14.5" + "@babel/helper-annotate-as-pure" "^7.12.13" + "@babel/helper-function-name" "^7.12.13" + "@babel/helper-optimise-call-expression" "^7.12.13" + "@babel/helper-plugin-utils" "^7.13.0" + "@babel/helper-replace-supers" "^7.13.0" + "@babel/helper-split-export-declaration" "^7.12.13" globals "^11.1.0" -"@babel/plugin-transform-computed-properties@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.14.5.tgz#1b9d78987420d11223d41195461cc43b974b204f" - integrity sha512-pWM+E4283UxaVzLb8UBXv4EIxMovU4zxT1OPnpHJcmnvyY9QbPPTKZfEj31EUvG3/EQRbYAGaYEUZ4yWOBC2xg== +"@babel/plugin-transform-computed-properties@^7.13.0": + version "7.13.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.13.0.tgz#845c6e8b9bb55376b1fa0b92ef0bdc8ea06644ed" + integrity sha512-RRqTYTeZkZAz8WbieLTvKUEUxZlUTdmL5KGMyZj7FnMfLNKV4+r5549aORG/mgojRmFlQMJDUupwAMiF2Q7OUg== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.13.0" -"@babel/plugin-transform-destructuring@^7.14.7": - version "7.14.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.14.7.tgz#0ad58ed37e23e22084d109f185260835e5557576" - integrity sha512-0mDE99nK+kVh3xlc5vKwB6wnP9ecuSj+zQCa/n0voENtP/zymdT4HH6QEb65wjjcbqr1Jb/7z9Qp7TF5FtwYGw== +"@babel/plugin-transform-destructuring@^7.13.0": + version "7.13.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.13.0.tgz#c5dce270014d4e1ebb1d806116694c12b7028963" + integrity sha512-zym5em7tePoNT9s964c0/KU3JPPnuq7VhIxPRefJ4/s82cD+q1mgKfuGRDMCPL0HTyKz4dISuQlCusfgCJ86HA== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.13.0" -"@babel/plugin-transform-dotall-regex@^7.14.5", "@babel/plugin-transform-dotall-regex@^7.4.4": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.14.5.tgz#2f6bf76e46bdf8043b4e7e16cf24532629ba0c7a" - integrity sha512-loGlnBdj02MDsFaHhAIJzh7euK89lBrGIdM9EAtHFo6xKygCUGuuWe07o1oZVk287amtW1n0808sQM99aZt3gw== +"@babel/plugin-transform-dotall-regex@^7.12.13", "@babel/plugin-transform-dotall-regex@^7.4.4": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.12.13.tgz#3f1601cc29905bfcb67f53910f197aeafebb25ad" + integrity sha512-foDrozE65ZFdUC2OfgeOCrEPTxdB3yjqxpXh8CH+ipd9CHd4s/iq81kcUpyH8ACGNEPdFqbtzfgzbT/ZGlbDeQ== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.14.5" - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-create-regexp-features-plugin" "^7.12.13" + "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-transform-duplicate-keys@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.14.5.tgz#365a4844881bdf1501e3a9f0270e7f0f91177954" - integrity sha512-iJjbI53huKbPDAsJ8EmVmvCKeeq21bAze4fu9GBQtSLqfvzj2oRuHVx4ZkDwEhg1htQ+5OBZh/Ab0XDf5iBZ7A== +"@babel/plugin-transform-duplicate-keys@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.12.13.tgz#6f06b87a8b803fd928e54b81c258f0a0033904de" + integrity sha512-NfADJiiHdhLBW3pulJlJI2NB0t4cci4WTZ8FtdIuNc2+8pslXdPtRRAEWqUY+m9kNOk2eRYbTAOipAxlrOcwwQ== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-transform-exponentiation-operator@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.14.5.tgz#5154b8dd6a3dfe6d90923d61724bd3deeb90b493" - integrity sha512-jFazJhMBc9D27o9jDnIE5ZErI0R0m7PbKXVq77FFvqFbzvTMuv8jaAwLZ5PviOLSFttqKIW0/wxNSDbjLk0tYA== +"@babel/plugin-transform-exponentiation-operator@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.12.13.tgz#4d52390b9a273e651e4aba6aee49ef40e80cd0a1" + integrity sha512-fbUelkM1apvqez/yYx1/oICVnGo2KM5s63mhGylrmXUxK/IAXSIf87QIxVfZldWf4QsOafY6vV3bX8aMHSvNrA== dependencies: - "@babel/helper-builder-binary-assignment-operator-visitor" "^7.14.5" - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-builder-binary-assignment-operator-visitor" "^7.12.13" + "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-transform-flow-strip-types@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-flow-strip-types/-/plugin-transform-flow-strip-types-7.14.5.tgz#0dc9c1d11dcdc873417903d6df4bed019ef0f85e" - integrity sha512-KhcolBKfXbvjwI3TV7r7TkYm8oNXHNBqGOy6JDVwtecFaRoKYsUUqJdS10q0YDKW1c6aZQgO+Ys3LfGkox8pXA== +"@babel/plugin-transform-flow-strip-types@^7.13.0": + version "7.13.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-flow-strip-types/-/plugin-transform-flow-strip-types-7.13.0.tgz#58177a48c209971e8234e99906cb6bd1122addd3" + integrity sha512-EXAGFMJgSX8gxWD7PZtW/P6M+z74jpx3wm/+9pn+c2dOawPpBkUX7BrfyPvo6ZpXbgRIEuwgwDb/MGlKvu2pOg== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/plugin-syntax-flow" "^7.14.5" + "@babel/helper-plugin-utils" "^7.13.0" + "@babel/plugin-syntax-flow" "^7.12.13" -"@babel/plugin-transform-for-of@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.14.5.tgz#dae384613de8f77c196a8869cbf602a44f7fc0eb" - integrity sha512-CfmqxSUZzBl0rSjpoQSFoR9UEj3HzbGuGNL21/iFTmjb5gFggJp3ph0xR1YBhexmLoKRHzgxuFvty2xdSt6gTA== +"@babel/plugin-transform-for-of@^7.13.0": + version "7.13.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.13.0.tgz#c799f881a8091ac26b54867a845c3e97d2696062" + integrity sha512-IHKT00mwUVYE0zzbkDgNRP6SRzvfGCYsOxIRz8KsiaaHCcT9BWIkO+H9QRJseHBLOGBZkHUdHiqj6r0POsdytg== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.13.0" -"@babel/plugin-transform-function-name@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.14.5.tgz#e81c65ecb900746d7f31802f6bed1f52d915d6f2" - integrity sha512-vbO6kv0fIzZ1GpmGQuvbwwm+O4Cbm2NrPzwlup9+/3fdkuzo1YqOZcXw26+YUJB84Ja7j9yURWposEHLYwxUfQ== +"@babel/plugin-transform-function-name@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.12.13.tgz#bb024452f9aaed861d374c8e7a24252ce3a50051" + integrity sha512-6K7gZycG0cmIwwF7uMK/ZqeCikCGVBdyP2J5SKNCXO5EOHcqi+z7Jwf8AmyDNcBgxET8DrEtCt/mPKPyAzXyqQ== dependencies: - "@babel/helper-function-name" "^7.14.5" - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-function-name" "^7.12.13" + "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-transform-literals@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.14.5.tgz#41d06c7ff5d4d09e3cf4587bd3ecf3930c730f78" - integrity sha512-ql33+epql2F49bi8aHXxvLURHkxJbSmMKl9J5yHqg4PLtdE6Uc48CH1GS6TQvZ86eoB/ApZXwm7jlA+B3kra7A== +"@babel/plugin-transform-literals@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.12.13.tgz#2ca45bafe4a820197cf315794a4d26560fe4bdb9" + integrity sha512-FW+WPjSR7hiUxMcKqyNjP05tQ2kmBCdpEpZHY1ARm96tGQCCBvXKnpjILtDplUnJ/eHZ0lALLM+d2lMFSpYJrQ== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-transform-member-expression-literals@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.14.5.tgz#b39cd5212a2bf235a617d320ec2b48bcc091b8a7" - integrity sha512-WkNXxH1VXVTKarWFqmso83xl+2V3Eo28YY5utIkbsmXoItO8Q3aZxN4BTS2k0hz9dGUloHK26mJMyQEYfkn/+Q== +"@babel/plugin-transform-member-expression-literals@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.12.13.tgz#5ffa66cd59b9e191314c9f1f803b938e8c081e40" + integrity sha512-kxLkOsg8yir4YeEPHLuO2tXP9R/gTjpuTOjshqSpELUN3ZAg2jfDnKUvzzJxObun38sw3wm4Uu69sX/zA7iRvg== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-transform-modules-amd@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.14.5.tgz#4fd9ce7e3411cb8b83848480b7041d83004858f7" - integrity sha512-3lpOU8Vxmp3roC4vzFpSdEpGUWSMsHFreTWOMMLzel2gNGfHE5UWIh/LN6ghHs2xurUp4jRFYMUIZhuFbody1g== +"@babel/plugin-transform-modules-amd@^7.13.0": + version "7.13.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.13.0.tgz#19f511d60e3d8753cc5a6d4e775d3a5184866cc3" + integrity sha512-EKy/E2NHhY/6Vw5d1k3rgoobftcNUmp9fGjb9XZwQLtTctsRBOTRO7RHHxfIky1ogMN5BxN7p9uMA3SzPfotMQ== dependencies: - "@babel/helper-module-transforms" "^7.14.5" - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-module-transforms" "^7.13.0" + "@babel/helper-plugin-utils" "^7.13.0" babel-plugin-dynamic-import-node "^2.3.3" -"@babel/plugin-transform-modules-commonjs@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.14.5.tgz#7aaee0ea98283de94da98b28f8c35701429dad97" - integrity sha512-en8GfBtgnydoao2PS+87mKyw62k02k7kJ9ltbKe0fXTHrQmG6QZZflYuGI1VVG7sVpx4E1n7KBpNlPb8m78J+A== +"@babel/plugin-transform-modules-commonjs@^7.13.8": + version "7.13.8" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.13.8.tgz#7b01ad7c2dcf2275b06fa1781e00d13d420b3e1b" + integrity sha512-9QiOx4MEGglfYZ4XOnU79OHr6vIWUakIj9b4mioN8eQIoEh+pf5p/zEB36JpDFWA12nNMiRf7bfoRvl9Rn79Bw== dependencies: - "@babel/helper-module-transforms" "^7.14.5" - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-simple-access" "^7.14.5" + "@babel/helper-module-transforms" "^7.13.0" + "@babel/helper-plugin-utils" "^7.13.0" + "@babel/helper-simple-access" "^7.12.13" babel-plugin-dynamic-import-node "^2.3.3" -"@babel/plugin-transform-modules-systemjs@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.14.5.tgz#c75342ef8b30dcde4295d3401aae24e65638ed29" - integrity sha512-mNMQdvBEE5DcMQaL5LbzXFMANrQjd2W7FPzg34Y4yEz7dBgdaC+9B84dSO+/1Wba98zoDbInctCDo4JGxz1VYA== +"@babel/plugin-transform-modules-systemjs@^7.13.8": + version "7.13.8" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.13.8.tgz#6d066ee2bff3c7b3d60bf28dec169ad993831ae3" + integrity sha512-hwqctPYjhM6cWvVIlOIe27jCIBgHCsdH2xCJVAYQm7V5yTMoilbVMi9f6wKg0rpQAOn6ZG4AOyvCqFF/hUh6+A== dependencies: - "@babel/helper-hoist-variables" "^7.14.5" - "@babel/helper-module-transforms" "^7.14.5" - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-validator-identifier" "^7.14.5" + "@babel/helper-hoist-variables" "^7.13.0" + "@babel/helper-module-transforms" "^7.13.0" + "@babel/helper-plugin-utils" "^7.13.0" + "@babel/helper-validator-identifier" "^7.12.11" babel-plugin-dynamic-import-node "^2.3.3" -"@babel/plugin-transform-modules-umd@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.14.5.tgz#fb662dfee697cce274a7cda525190a79096aa6e0" - integrity sha512-RfPGoagSngC06LsGUYyM9QWSXZ8MysEjDJTAea1lqRjNECE3y0qIJF/qbvJxc4oA4s99HumIMdXOrd+TdKaAAA== +"@babel/plugin-transform-modules-umd@^7.13.0": + version "7.13.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.13.0.tgz#8a3d96a97d199705b9fd021580082af81c06e70b" + integrity sha512-D/ILzAh6uyvkWjKKyFE/W0FzWwasv6vPTSqPcjxFqn6QpX3u8DjRVliq4F2BamO2Wee/om06Vyy+vPkNrd4wxw== dependencies: - "@babel/helper-module-transforms" "^7.14.5" - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-module-transforms" "^7.13.0" + "@babel/helper-plugin-utils" "^7.13.0" -"@babel/plugin-transform-named-capturing-groups-regex@^7.14.7": - version "7.14.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.14.7.tgz#60c06892acf9df231e256c24464bfecb0908fd4e" - integrity sha512-DTNOTaS7TkW97xsDMrp7nycUVh6sn/eq22VaxWfEdzuEbRsiaOU0pqU7DlyUGHVsbQbSghvjKRpEl+nUCKGQSg== +"@babel/plugin-transform-named-capturing-groups-regex@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.12.13.tgz#2213725a5f5bbbe364b50c3ba5998c9599c5c9d9" + integrity sha512-Xsm8P2hr5hAxyYblrfACXpQKdQbx4m2df9/ZZSQ8MAhsadw06+jW7s9zsSw6he+mJZXRlVMyEnVktJo4zjk1WA== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.14.5" + "@babel/helper-create-regexp-features-plugin" "^7.12.13" -"@babel/plugin-transform-new-target@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.14.5.tgz#31bdae8b925dc84076ebfcd2a9940143aed7dbf8" - integrity sha512-Nx054zovz6IIRWEB49RDRuXGI4Gy0GMgqG0cII9L3MxqgXz/+rgII+RU58qpo4g7tNEx1jG7rRVH4ihZoP4esQ== +"@babel/plugin-transform-new-target@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.12.13.tgz#e22d8c3af24b150dd528cbd6e685e799bf1c351c" + integrity sha512-/KY2hbLxrG5GTQ9zzZSc3xWiOy379pIETEhbtzwZcw9rvuaVV4Fqy7BYGYOWZnaoXIQYbbJ0ziXLa/sKcGCYEQ== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-transform-object-super@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.14.5.tgz#d0b5faeac9e98597a161a9cf78c527ed934cdc45" - integrity sha512-MKfOBWzK0pZIrav9z/hkRqIk/2bTv9qvxHzPQc12RcVkMOzpIKnFCNYJip00ssKWYkd8Sf5g0Wr7pqJ+cmtuFg== +"@babel/plugin-transform-object-super@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.12.13.tgz#b4416a2d63b8f7be314f3d349bd55a9c1b5171f7" + integrity sha512-JzYIcj3XtYspZDV8j9ulnoMPZZnF/Cj0LUxPOjR89BdBVx+zYJI9MdMIlUZjbXDX+6YVeS6I3e8op+qQ3BYBoQ== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-replace-supers" "^7.14.5" + "@babel/helper-plugin-utils" "^7.12.13" + "@babel/helper-replace-supers" "^7.12.13" -"@babel/plugin-transform-parameters@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.14.5.tgz#49662e86a1f3ddccac6363a7dfb1ff0a158afeb3" - integrity sha512-Tl7LWdr6HUxTmzQtzuU14SqbgrSKmaR77M0OKyq4njZLQTPfOvzblNKyNkGwOfEFCEx7KeYHQHDI0P3F02IVkA== +"@babel/plugin-transform-parameters@^7.13.0": + version "7.13.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.13.0.tgz#8fa7603e3097f9c0b7ca1a4821bc2fb52e9e5007" + integrity sha512-Jt8k/h/mIwE2JFEOb3lURoY5C85ETcYPnbuAJ96zRBzh1XHtQZfs62ChZ6EP22QlC8c7Xqr9q+e1SU5qttwwjw== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.13.0" -"@babel/plugin-transform-property-literals@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.14.5.tgz#0ddbaa1f83db3606f1cdf4846fa1dfb473458b34" - integrity sha512-r1uilDthkgXW8Z1vJz2dKYLV1tuw2xsbrp3MrZmD99Wh9vsfKoob+JTgri5VUb/JqyKRXotlOtwgu4stIYCmnw== +"@babel/plugin-transform-property-literals@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.12.13.tgz#4e6a9e37864d8f1b3bc0e2dce7bf8857db8b1a81" + integrity sha512-nqVigwVan+lR+g8Fj8Exl0UQX2kymtjcWfMOYM1vTYEKujeyv2SkMgazf2qNcK7l4SDiKyTA/nHCPqL4e2zo1A== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-transform-regenerator@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.14.5.tgz#9676fd5707ed28f522727c5b3c0aa8544440b04f" - integrity sha512-NVIY1W3ITDP5xQl50NgTKlZ0GrotKtLna08/uGY6ErQt6VEQZXla86x/CTddm5gZdcr+5GSsvMeTmWA5Ii6pkg== +"@babel/plugin-transform-regenerator@^7.13.15": + version "7.13.15" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.13.15.tgz#e5eb28945bf8b6563e7f818945f966a8d2997f39" + integrity sha512-Bk9cOLSz8DiurcMETZ8E2YtIVJbFCPGW28DJWUakmyVWtQSm6Wsf0p4B4BfEr/eL2Nkhe/CICiUiMOCi1TPhuQ== dependencies: regenerator-transform "^0.14.2" -"@babel/plugin-transform-reserved-words@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.14.5.tgz#c44589b661cfdbef8d4300dcc7469dffa92f8304" - integrity sha512-cv4F2rv1nD4qdexOGsRQXJrOcyb5CrgjUH9PKrrtyhSDBNWGxd0UIitjyJiWagS+EbUGjG++22mGH1Pub8D6Vg== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/plugin-transform-shorthand-properties@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.14.5.tgz#97f13855f1409338d8cadcbaca670ad79e091a58" - integrity sha512-xLucks6T1VmGsTB+GWK5Pl9Jl5+nRXD1uoFdA5TSO6xtiNjtXTjKkmPdFXVLGlK5A2/or/wQMKfmQ2Y0XJfn5g== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/plugin-transform-spread@^7.14.6": - version "7.14.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.14.6.tgz#6bd40e57fe7de94aa904851963b5616652f73144" - integrity sha512-Zr0x0YroFJku7n7+/HH3A2eIrGMjbmAIbJSVv0IZ+t3U2WUQUA64S/oeied2e+MaGSjmt4alzBCsK9E8gh+fag== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-skip-transparent-expression-wrappers" "^7.14.5" - -"@babel/plugin-transform-sticky-regex@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.14.5.tgz#5b617542675e8b7761294381f3c28c633f40aeb9" - integrity sha512-Z7F7GyvEMzIIbwnziAZmnSNpdijdr4dWt+FJNBnBLz5mwDFkqIXU9wmBcWWad3QeJF5hMTkRe4dAq2sUZiG+8A== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/plugin-transform-template-literals@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.14.5.tgz#a5f2bc233937d8453885dc736bdd8d9ffabf3d93" - integrity sha512-22btZeURqiepOfuy/VkFr+zStqlujWaarpMErvay7goJS6BWwdd6BY9zQyDLDa4x2S3VugxFb162IZ4m/S/+Gg== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/plugin-transform-typeof-symbol@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.14.5.tgz#39af2739e989a2bd291bf6b53f16981423d457d4" - integrity sha512-lXzLD30ffCWseTbMQzrvDWqljvZlHkXU+CnseMhkMNqU1sASnCsz3tSzAaH3vCUXb9PHeUb90ZT1BdFTm1xxJw== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/plugin-transform-typescript@^7.14.5": - version "7.14.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.14.6.tgz#6e9c2d98da2507ebe0a883b100cde3c7279df36c" - integrity sha512-XlTdBq7Awr4FYIzqhmYY80WN0V0azF74DMPyFqVHBvf81ZUgc4X7ZOpx6O8eLDK6iM5cCQzeyJw0ynTaefixRA== - dependencies: - "@babel/helper-create-class-features-plugin" "^7.14.6" - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/plugin-syntax-typescript" "^7.14.5" - -"@babel/plugin-transform-unicode-escapes@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.14.5.tgz#9d4bd2a681e3c5d7acf4f57fa9e51175d91d0c6b" - integrity sha512-crTo4jATEOjxj7bt9lbYXcBAM3LZaUrbP2uUdxb6WIorLmjNKSpHfIybgY4B8SRpbf8tEVIWH3Vtm7ayCrKocA== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/plugin-transform-unicode-regex@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.14.5.tgz#4cd09b6c8425dd81255c7ceb3fb1836e7414382e" - integrity sha512-UygduJpC5kHeCiRw/xDVzC+wj8VaYSoKl5JNVmbP7MadpNinAm3SvZCxZ42H37KZBKztz46YC73i9yV34d0Tzw== - dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.14.5" - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/preset-env@^7.14.7": - version "7.14.7" - resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.14.7.tgz#5c70b22d4c2d893b03d8c886a5c17422502b932a" - integrity sha512-itOGqCKLsSUl0Y+1nSfhbuuOlTs0MJk2Iv7iSH+XT/mR8U1zRLO7NjWlYXB47yhK4J/7j+HYty/EhFZDYKa/VA== - dependencies: - "@babel/compat-data" "^7.14.7" - "@babel/helper-compilation-targets" "^7.14.5" - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-validator-option" "^7.14.5" - "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining" "^7.14.5" - "@babel/plugin-proposal-async-generator-functions" "^7.14.7" - "@babel/plugin-proposal-class-properties" "^7.14.5" - "@babel/plugin-proposal-class-static-block" "^7.14.5" - "@babel/plugin-proposal-dynamic-import" "^7.14.5" - "@babel/plugin-proposal-export-namespace-from" "^7.14.5" - "@babel/plugin-proposal-json-strings" "^7.14.5" - "@babel/plugin-proposal-logical-assignment-operators" "^7.14.5" - "@babel/plugin-proposal-nullish-coalescing-operator" "^7.14.5" - "@babel/plugin-proposal-numeric-separator" "^7.14.5" - "@babel/plugin-proposal-object-rest-spread" "^7.14.7" - "@babel/plugin-proposal-optional-catch-binding" "^7.14.5" - "@babel/plugin-proposal-optional-chaining" "^7.14.5" - "@babel/plugin-proposal-private-methods" "^7.14.5" - "@babel/plugin-proposal-private-property-in-object" "^7.14.5" - "@babel/plugin-proposal-unicode-property-regex" "^7.14.5" +"@babel/plugin-transform-reserved-words@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.12.13.tgz#7d9988d4f06e0fe697ea1d9803188aa18b472695" + integrity sha512-xhUPzDXxZN1QfiOy/I5tyye+TRz6lA7z6xaT4CLOjPRMVg1ldRf0LHw0TDBpYL4vG78556WuHdyO9oi5UmzZBg== + dependencies: + "@babel/helper-plugin-utils" "^7.12.13" + +"@babel/plugin-transform-shorthand-properties@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.12.13.tgz#db755732b70c539d504c6390d9ce90fe64aff7ad" + integrity sha512-xpL49pqPnLtf0tVluuqvzWIgLEhuPpZzvs2yabUHSKRNlN7ScYU7aMlmavOeyXJZKgZKQRBlh8rHbKiJDraTSw== + dependencies: + "@babel/helper-plugin-utils" "^7.12.13" + +"@babel/plugin-transform-spread@^7.13.0": + version "7.13.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.13.0.tgz#84887710e273c1815ace7ae459f6f42a5d31d5fd" + integrity sha512-V6vkiXijjzYeFmQTr3dBxPtZYLPcUfY34DebOU27jIl2M/Y8Egm52Hw82CSjjPqd54GTlJs5x+CR7HeNr24ckg== + dependencies: + "@babel/helper-plugin-utils" "^7.13.0" + "@babel/helper-skip-transparent-expression-wrappers" "^7.12.1" + +"@babel/plugin-transform-sticky-regex@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.12.13.tgz#760ffd936face73f860ae646fb86ee82f3d06d1f" + integrity sha512-Jc3JSaaWT8+fr7GRvQP02fKDsYk4K/lYwWq38r/UGfaxo89ajud321NH28KRQ7xy1Ybc0VUE5Pz8psjNNDUglg== + dependencies: + "@babel/helper-plugin-utils" "^7.12.13" + +"@babel/plugin-transform-template-literals@^7.13.0": + version "7.13.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.13.0.tgz#a36049127977ad94438dee7443598d1cefdf409d" + integrity sha512-d67umW6nlfmr1iehCcBv69eSUSySk1EsIS8aTDX4Xo9qajAh6mYtcl4kJrBkGXuxZPEgVr7RVfAvNW6YQkd4Mw== + dependencies: + "@babel/helper-plugin-utils" "^7.13.0" + +"@babel/plugin-transform-typeof-symbol@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.12.13.tgz#785dd67a1f2ea579d9c2be722de8c84cb85f5a7f" + integrity sha512-eKv/LmUJpMnu4npgfvs3LiHhJua5fo/CysENxa45YCQXZwKnGCQKAg87bvoqSW1fFT+HA32l03Qxsm8ouTY3ZQ== + dependencies: + "@babel/helper-plugin-utils" "^7.12.13" + +"@babel/plugin-transform-typescript@^7.13.0": + version "7.13.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.13.0.tgz#4a498e1f3600342d2a9e61f60131018f55774853" + integrity sha512-elQEwluzaU8R8dbVuW2Q2Y8Nznf7hnjM7+DSCd14Lo5fF63C9qNLbwZYbmZrtV9/ySpSUpkRpQXvJb6xyu4hCQ== + dependencies: + "@babel/helper-create-class-features-plugin" "^7.13.0" + "@babel/helper-plugin-utils" "^7.13.0" + "@babel/plugin-syntax-typescript" "^7.12.13" + +"@babel/plugin-transform-unicode-escapes@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.12.13.tgz#840ced3b816d3b5127dd1d12dcedc5dead1a5e74" + integrity sha512-0bHEkdwJ/sN/ikBHfSmOXPypN/beiGqjo+o4/5K+vxEFNPRPdImhviPakMKG4x96l85emoa0Z6cDflsdBusZbw== + dependencies: + "@babel/helper-plugin-utils" "^7.12.13" + +"@babel/plugin-transform-unicode-regex@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.12.13.tgz#b52521685804e155b1202e83fc188d34bb70f5ac" + integrity sha512-mDRzSNY7/zopwisPZ5kM9XKCfhchqIYwAKRERtEnhYscZB79VRekuRSoYbN0+KVe3y8+q1h6A4svXtP7N+UoCA== + dependencies: + "@babel/helper-create-regexp-features-plugin" "^7.12.13" + "@babel/helper-plugin-utils" "^7.12.13" + +"@babel/preset-env@^7.13.15": + version "7.13.15" + resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.13.15.tgz#c8a6eb584f96ecba183d3d414a83553a599f478f" + integrity sha512-D4JAPMXcxk69PKe81jRJ21/fP/uYdcTZ3hJDF5QX2HSI9bBxxYw/dumdR6dGumhjxlprHPE4XWoPaqzZUVy2MA== + dependencies: + "@babel/compat-data" "^7.13.15" + "@babel/helper-compilation-targets" "^7.13.13" + "@babel/helper-plugin-utils" "^7.13.0" + "@babel/helper-validator-option" "^7.12.17" + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining" "^7.13.12" + "@babel/plugin-proposal-async-generator-functions" "^7.13.15" + "@babel/plugin-proposal-class-properties" "^7.13.0" + "@babel/plugin-proposal-dynamic-import" "^7.13.8" + "@babel/plugin-proposal-export-namespace-from" "^7.12.13" + "@babel/plugin-proposal-json-strings" "^7.13.8" + "@babel/plugin-proposal-logical-assignment-operators" "^7.13.8" + "@babel/plugin-proposal-nullish-coalescing-operator" "^7.13.8" + "@babel/plugin-proposal-numeric-separator" "^7.12.13" + "@babel/plugin-proposal-object-rest-spread" "^7.13.8" + "@babel/plugin-proposal-optional-catch-binding" "^7.13.8" + "@babel/plugin-proposal-optional-chaining" "^7.13.12" + "@babel/plugin-proposal-private-methods" "^7.13.0" + "@babel/plugin-proposal-unicode-property-regex" "^7.12.13" "@babel/plugin-syntax-async-generators" "^7.8.4" "@babel/plugin-syntax-class-properties" "^7.12.13" - "@babel/plugin-syntax-class-static-block" "^7.14.5" "@babel/plugin-syntax-dynamic-import" "^7.8.3" "@babel/plugin-syntax-export-namespace-from" "^7.8.3" "@babel/plugin-syntax-json-strings" "^7.8.3" @@ -845,56 +809,55 @@ "@babel/plugin-syntax-object-rest-spread" "^7.8.3" "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" "@babel/plugin-syntax-optional-chaining" "^7.8.3" - "@babel/plugin-syntax-private-property-in-object" "^7.14.5" - "@babel/plugin-syntax-top-level-await" "^7.14.5" - "@babel/plugin-transform-arrow-functions" "^7.14.5" - "@babel/plugin-transform-async-to-generator" "^7.14.5" - "@babel/plugin-transform-block-scoped-functions" "^7.14.5" - "@babel/plugin-transform-block-scoping" "^7.14.5" - "@babel/plugin-transform-classes" "^7.14.5" - "@babel/plugin-transform-computed-properties" "^7.14.5" - "@babel/plugin-transform-destructuring" "^7.14.7" - "@babel/plugin-transform-dotall-regex" "^7.14.5" - "@babel/plugin-transform-duplicate-keys" "^7.14.5" - "@babel/plugin-transform-exponentiation-operator" "^7.14.5" - "@babel/plugin-transform-for-of" "^7.14.5" - "@babel/plugin-transform-function-name" "^7.14.5" - "@babel/plugin-transform-literals" "^7.14.5" - "@babel/plugin-transform-member-expression-literals" "^7.14.5" - "@babel/plugin-transform-modules-amd" "^7.14.5" - "@babel/plugin-transform-modules-commonjs" "^7.14.5" - "@babel/plugin-transform-modules-systemjs" "^7.14.5" - "@babel/plugin-transform-modules-umd" "^7.14.5" - "@babel/plugin-transform-named-capturing-groups-regex" "^7.14.7" - "@babel/plugin-transform-new-target" "^7.14.5" - "@babel/plugin-transform-object-super" "^7.14.5" - "@babel/plugin-transform-parameters" "^7.14.5" - "@babel/plugin-transform-property-literals" "^7.14.5" - "@babel/plugin-transform-regenerator" "^7.14.5" - "@babel/plugin-transform-reserved-words" "^7.14.5" - "@babel/plugin-transform-shorthand-properties" "^7.14.5" - "@babel/plugin-transform-spread" "^7.14.6" - "@babel/plugin-transform-sticky-regex" "^7.14.5" - "@babel/plugin-transform-template-literals" "^7.14.5" - "@babel/plugin-transform-typeof-symbol" "^7.14.5" - "@babel/plugin-transform-unicode-escapes" "^7.14.5" - "@babel/plugin-transform-unicode-regex" "^7.14.5" + "@babel/plugin-syntax-top-level-await" "^7.12.13" + "@babel/plugin-transform-arrow-functions" "^7.13.0" + "@babel/plugin-transform-async-to-generator" "^7.13.0" + "@babel/plugin-transform-block-scoped-functions" "^7.12.13" + "@babel/plugin-transform-block-scoping" "^7.12.13" + "@babel/plugin-transform-classes" "^7.13.0" + "@babel/plugin-transform-computed-properties" "^7.13.0" + "@babel/plugin-transform-destructuring" "^7.13.0" + "@babel/plugin-transform-dotall-regex" "^7.12.13" + "@babel/plugin-transform-duplicate-keys" "^7.12.13" + "@babel/plugin-transform-exponentiation-operator" "^7.12.13" + "@babel/plugin-transform-for-of" "^7.13.0" + "@babel/plugin-transform-function-name" "^7.12.13" + "@babel/plugin-transform-literals" "^7.12.13" + "@babel/plugin-transform-member-expression-literals" "^7.12.13" + "@babel/plugin-transform-modules-amd" "^7.13.0" + "@babel/plugin-transform-modules-commonjs" "^7.13.8" + "@babel/plugin-transform-modules-systemjs" "^7.13.8" + "@babel/plugin-transform-modules-umd" "^7.13.0" + "@babel/plugin-transform-named-capturing-groups-regex" "^7.12.13" + "@babel/plugin-transform-new-target" "^7.12.13" + "@babel/plugin-transform-object-super" "^7.12.13" + "@babel/plugin-transform-parameters" "^7.13.0" + "@babel/plugin-transform-property-literals" "^7.12.13" + "@babel/plugin-transform-regenerator" "^7.13.15" + "@babel/plugin-transform-reserved-words" "^7.12.13" + "@babel/plugin-transform-shorthand-properties" "^7.12.13" + "@babel/plugin-transform-spread" "^7.13.0" + "@babel/plugin-transform-sticky-regex" "^7.12.13" + "@babel/plugin-transform-template-literals" "^7.13.0" + "@babel/plugin-transform-typeof-symbol" "^7.12.13" + "@babel/plugin-transform-unicode-escapes" "^7.12.13" + "@babel/plugin-transform-unicode-regex" "^7.12.13" "@babel/preset-modules" "^0.1.4" - "@babel/types" "^7.14.5" - babel-plugin-polyfill-corejs2 "^0.2.2" - babel-plugin-polyfill-corejs3 "^0.2.2" - babel-plugin-polyfill-regenerator "^0.2.2" - core-js-compat "^3.15.0" + "@babel/types" "^7.13.14" + babel-plugin-polyfill-corejs2 "^0.2.0" + babel-plugin-polyfill-corejs3 "^0.2.0" + babel-plugin-polyfill-regenerator "^0.2.0" + core-js-compat "^3.9.0" semver "^6.3.0" -"@babel/preset-flow@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/preset-flow/-/preset-flow-7.14.5.tgz#a1810b0780c8b48ab0bece8e7ab8d0d37712751c" - integrity sha512-pP5QEb4qRUSVGzzKx9xqRuHUrM/jEzMqdrZpdMA+oUCRgd5zM1qGr5y5+ZgAL/1tVv1H0dyk5t4SKJntqyiVtg== +"@babel/preset-flow@^7.13.13": + version "7.13.13" + resolved "https://registry.yarnpkg.com/@babel/preset-flow/-/preset-flow-7.13.13.tgz#a61a1c149b3f77589d795287744393444d5cdd9e" + integrity sha512-MDtwtamMifqq3R2mC7l3A3uFalUb3NH5TIBQWjN/epEPlZktcLq4se3J+ivckKrLMGsR7H9LW8+pYuIUN9tsKg== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-validator-option" "^7.14.5" - "@babel/plugin-transform-flow-strip-types" "^7.14.5" + "@babel/helper-plugin-utils" "^7.13.0" + "@babel/helper-validator-option" "^7.12.17" + "@babel/plugin-transform-flow-strip-types" "^7.13.0" "@babel/preset-modules@^0.1.4": version "0.1.4" @@ -907,577 +870,400 @@ "@babel/types" "^7.4.4" esutils "^2.0.2" -"@babel/preset-typescript@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/preset-typescript/-/preset-typescript-7.14.5.tgz#aa98de119cf9852b79511f19e7f44a2d379bcce0" - integrity sha512-u4zO6CdbRKbS9TypMqrlGH7sd2TAJppZwn3c/ZRLeO/wGsbddxgbPDUZVNrie3JWYLQ9vpineKlsrWFvO6Pwkw== +"@babel/preset-typescript@^7.13.0": + version "7.13.0" + resolved "https://registry.yarnpkg.com/@babel/preset-typescript/-/preset-typescript-7.13.0.tgz#ab107e5f050609d806fbb039bec553b33462c60a" + integrity sha512-LXJwxrHy0N3f6gIJlYbLta1D9BDtHpQeqwzM0LIfjDlr6UE/D5Mc7W4iDiQzaE+ks0sTjT26ArcHWnJVt0QiHw== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-validator-option" "^7.14.5" - "@babel/plugin-transform-typescript" "^7.14.5" + "@babel/helper-plugin-utils" "^7.13.0" + "@babel/helper-validator-option" "^7.12.17" + "@babel/plugin-transform-typescript" "^7.13.0" -"@babel/runtime@^7.12.1", "@babel/runtime@^7.13.9", "@babel/runtime@^7.14.6", "@babel/runtime@^7.8.4", "@babel/runtime@^7.9.2": - version "7.14.6" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.14.6.tgz#535203bc0892efc7dec60bdc27b2ecf6e409062d" - integrity sha512-/PCB2uJ7oM44tz8YhC4Z/6PeOKXp4K588f+5M3clr1M4zbqztlo0XEfJ2LEzj/FgwfgGcIdl8n7YYjTCI0BYwg== +"@babel/runtime@^7.12.1", "@babel/runtime@^7.13.7", "@babel/runtime@^7.13.8", "@babel/runtime@^7.8.4", "@babel/runtime@^7.9.2": + version "7.13.17" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.13.17.tgz#8966d1fc9593bf848602f0662d6b4d0069e3a7ec" + integrity sha512-NCdgJEelPTSh+FEFylhnP1ylq848l1z9t9N0j1Lfbcw0+KXGjsTvUmkxy+voLLXB5SOKMbLLx4jxYliGrYQseA== dependencies: regenerator-runtime "^0.13.4" -"@babel/template@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.14.5.tgz#a9bc9d8b33354ff6e55a9c60d1109200a68974f4" - integrity sha512-6Z3Po85sfxRGachLULUhOmvAaOo7xCvqGQtxINai2mEGPFm6pQ4z5QInFnUrRpfoSV60BnjyF5F3c+15fxFV1g== - dependencies: - "@babel/code-frame" "^7.14.5" - "@babel/parser" "^7.14.5" - "@babel/types" "^7.14.5" - -"@babel/traverse@^7.13.0", "@babel/traverse@^7.14.5": - version "7.14.7" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.14.7.tgz#64007c9774cfdc3abd23b0780bc18a3ce3631753" - integrity sha512-9vDr5NzHu27wgwejuKL7kIOm4bwEtaPQ4Z6cpCmjSuaRqpH/7xc4qcGEscwMqlkwgcXl6MvqoAjZkQ24uSdIZQ== - dependencies: - "@babel/code-frame" "^7.14.5" - "@babel/generator" "^7.14.5" - "@babel/helper-function-name" "^7.14.5" - "@babel/helper-hoist-variables" "^7.14.5" - "@babel/helper-split-export-declaration" "^7.14.5" - "@babel/parser" "^7.14.7" - "@babel/types" "^7.14.5" +"@babel/template@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.12.13.tgz#530265be8a2589dbb37523844c5bcb55947fb327" + integrity sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA== + dependencies: + "@babel/code-frame" "^7.12.13" + "@babel/parser" "^7.12.13" + "@babel/types" "^7.12.13" + +"@babel/traverse@^7.13.0", "@babel/traverse@^7.13.13", "@babel/traverse@^7.13.15", "@babel/traverse@^7.13.17": + version "7.13.17" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.13.17.tgz#c85415e0c7d50ac053d758baec98b28b2ecfeea3" + integrity sha512-BMnZn0R+X6ayqm3C3To7o1j7Q020gWdqdyP50KEoVqaCO2c/Im7sYZSmVgvefp8TTMQ+9CtwuBp0Z1CZ8V3Pvg== + dependencies: + "@babel/code-frame" "^7.12.13" + "@babel/generator" "^7.13.16" + "@babel/helper-function-name" "^7.12.13" + "@babel/helper-split-export-declaration" "^7.12.13" + "@babel/parser" "^7.13.16" + "@babel/types" "^7.13.17" debug "^4.1.0" globals "^11.1.0" -"@babel/types@^7.14.5", "@babel/types@^7.4.4": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.14.5.tgz#3bb997ba829a2104cedb20689c4a5b8121d383ff" - integrity sha512-M/NzBpEL95I5Hh4dwhin5JlE7EzO5PHMAuzjxss3tiOBD46KfQvVedN/3jEPZvdRvtsK2222XfdHogNIttFgcg== +"@babel/types@^7.12.1", "@babel/types@^7.12.13", "@babel/types@^7.13.0", "@babel/types@^7.13.12", "@babel/types@^7.13.14", "@babel/types@^7.13.16", "@babel/types@^7.13.17", "@babel/types@^7.4.4": + version "7.13.17" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.13.17.tgz#48010a115c9fba7588b4437dd68c9469012b38b4" + integrity sha512-RawydLgxbOPDlTLJNtoIypwdmAy//uQIzlKt2+iBiJaRlVuI6QLUxVAyWGNfOzp8Yu4L4lLIacoCyTNtpb4wiA== dependencies: - "@babel/helper-validator-identifier" "^7.14.5" + "@babel/helper-validator-identifier" "^7.12.11" to-fast-properties "^2.0.0" -"@confio/ics23@^0.6.3": - version "0.6.5" - resolved "https://registry.yarnpkg.com/@confio/ics23/-/ics23-0.6.5.tgz#9c21a61089d4c3c2429875a69d6d9cd8c87512aa" - integrity sha512-1GdPMsaP/l8JSF4P4HWFLBhdcxHcJT8lS0nknBYNSZ1XrJOsJKUy6EkOwd9Pa1qJkXzY2gyNv7MdHR+AIwSTAg== - dependencies: - js-sha512 "^0.8.0" - protobufjs "^6.8.8" - ripemd160 "^2.0.2" - sha.js "^2.4.11" - -"@cosmjs/amino@^0.25.0-alpha.2", "@cosmjs/amino@^0.25.5": - version "0.25.5" - resolved "https://registry.yarnpkg.com/@cosmjs/amino/-/amino-0.25.5.tgz#a22abac74057848834f1e3b0d2b90a0a328dd119" - integrity sha512-q9tU2b9hJ3S/KxYCLSyiZCfkaidbSPBr2sJ5HPLxz48y5O4k9sYM7bPa0zioeePaIBnby3AOgyjucVxlbzUlYg== - dependencies: - "@cosmjs/crypto" "^0.25.5" - "@cosmjs/encoding" "^0.25.5" - "@cosmjs/math" "^0.25.5" - "@cosmjs/utils" "^0.25.5" - -"@cosmjs/crypto@^0.25.0-alpha.2", "@cosmjs/crypto@^0.25.5": - version "0.25.5" - resolved "https://registry.yarnpkg.com/@cosmjs/crypto/-/crypto-0.25.5.tgz#4b8e4a8693f9f597b4de92df1b1057f61ec7a735" - integrity sha512-i0Nfbk4JXAwyKNGPFu0o1xV6IJUbYmmveySytbU/yweybcZppxoczjSQ1sGrUaLVLvgfcpfwZte3jKqDR67+dg== - dependencies: - "@cosmjs/encoding" "^0.25.5" - "@cosmjs/math" "^0.25.5" - "@cosmjs/utils" "^0.25.5" - bip39 "^3.0.2" - bn.js "^4.11.8" - elliptic "^6.5.3" - js-sha3 "^0.8.0" - libsodium-wrappers "^0.7.6" - ripemd160 "^2.0.2" - sha.js "^2.4.11" - -"@cosmjs/encoding@0.23.1": - version "0.23.1" - resolved "https://registry.yarnpkg.com/@cosmjs/encoding/-/encoding-0.23.1.tgz#b51cd2813499cfdeeb0f9cc7d050a45eb8b27bf4" - integrity sha512-rP5O3vYo0k6W329J+u5uKqJNrhmR4QTngLgsDvP/qsRRBfEiirhk+TQC8gjUlgnzoiCKCtWsiOyFP1z9Me9HIw== +"@dabh/diagnostics@^2.0.2": + version "2.0.2" + resolved "https://registry.yarnpkg.com/@dabh/diagnostics/-/diagnostics-2.0.2.tgz#290d08f7b381b8f94607dc8f471a12c675f9db31" + integrity sha512-+A1YivoVDNNVCdfozHSR8v/jyuuLTMXwjWuxPFlFlUapXoGc+Gj9mDlTDDfrwl7rXCl2tNZ0kE8sIBO6YOn96Q== dependencies: - base64-js "^1.3.0" - bech32 "^1.1.4" - readonly-date "^1.0.0" + colorspace "1.1.x" + enabled "2.0.x" + kuler "^2.0.0" -"@cosmjs/encoding@^0.25.0-alpha.2", "@cosmjs/encoding@^0.25.5": - version "0.25.5" - resolved "https://registry.yarnpkg.com/@cosmjs/encoding/-/encoding-0.25.5.tgz#edc90084b112b57ca73ec82c1682ac9c4da3bb3a" - integrity sha512-QT7MaPBiMeCaMJ6VZZKeOqDQlAxMEzTFjBFhbkdyx5DVRc4dPOVO4HbTggmIN5/eizIv4/CNJSVTR//tO53J0A== +"@ethersproject/abi@5.3.1", "@ethersproject/abi@^5.3.0": + version "5.3.1" + resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.3.1.tgz#69a1a496729d3a83521675a57cbe21f3cc27241c" + integrity sha512-F98FWTJG7nWWAQ4DcV6R0cSlrj67MWK3ylahuFbzkumem5cLWg1p7fZ3vIdRoS1c7TEf55Lvyx0w7ICR47IImw== + dependencies: + "@ethersproject/address" "^5.3.0" + "@ethersproject/bignumber" "^5.3.0" + "@ethersproject/bytes" "^5.3.0" + "@ethersproject/constants" "^5.3.0" + "@ethersproject/hash" "^5.3.0" + "@ethersproject/keccak256" "^5.3.0" + "@ethersproject/logger" "^5.3.0" + "@ethersproject/properties" "^5.3.0" + "@ethersproject/strings" "^5.3.0" + +"@ethersproject/abstract-provider@5.3.0", "@ethersproject/abstract-provider@^5.3.0": + version "5.3.0" + resolved "https://registry.yarnpkg.com/@ethersproject/abstract-provider/-/abstract-provider-5.3.0.tgz#f4c0ae4a4cef9f204d7781de805fd44b72756c81" + integrity sha512-1+MLhGP1GwxBDBNwMWVmhCsvKwh4gK7oIfOrmlmePNeskg1NhIrYssraJBieaFNHUYfKEd/1DjiVZMw8Qu5Cxw== + dependencies: + "@ethersproject/bignumber" "^5.3.0" + "@ethersproject/bytes" "^5.3.0" + "@ethersproject/logger" "^5.3.0" + "@ethersproject/networks" "^5.3.0" + "@ethersproject/properties" "^5.3.0" + "@ethersproject/transactions" "^5.3.0" + "@ethersproject/web" "^5.3.0" + +"@ethersproject/abstract-signer@5.3.0", "@ethersproject/abstract-signer@^5.3.0": + version "5.3.0" + resolved "https://registry.yarnpkg.com/@ethersproject/abstract-signer/-/abstract-signer-5.3.0.tgz#05172b653e15b535ed5854ef5f6a72f4b441052d" + integrity sha512-w8IFwOYqiPrtvosPuArZ3+QPR2nmdVTRrVY8uJYL3NNfMmQfTy3V3l2wbzX47UUlNbPJY+gKvzJAyvK1onZxJg== dependencies: - base64-js "^1.3.0" - bech32 "^1.1.4" - readonly-date "^1.0.0" + "@ethersproject/abstract-provider" "^5.3.0" + "@ethersproject/bignumber" "^5.3.0" + "@ethersproject/bytes" "^5.3.0" + "@ethersproject/logger" "^5.3.0" + "@ethersproject/properties" "^5.3.0" -"@cosmjs/json-rpc@^0.25.0-alpha.2", "@cosmjs/json-rpc@^0.25.5": - version "0.25.5" - resolved "https://registry.yarnpkg.com/@cosmjs/json-rpc/-/json-rpc-0.25.5.tgz#34c7489fc6ae32a4acaabf658e057a55c431a193" - integrity sha512-WFDallAolxBqB8V/mYxU0riF/OBoc6Fc2DDsZhds5xOZxeN9sTX0qWhu1UiFyURw4Z9D+SjB9QngqSDBTMTdjw== +"@ethersproject/address@5.3.0", "@ethersproject/address@^5.3.0": + version "5.3.0" + resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.3.0.tgz#e53b69eacebf332e8175de814c5e6507d6932518" + integrity sha512-29TgjzEBK+gUEUAOfWCG7s9IxLNLCqvr+oDSk6L9TXD0VLvZJKhJV479tKQqheVA81OeGxfpdxYtUVH8hqlCvA== dependencies: - "@cosmjs/stream" "^0.25.5" - xstream "^11.14.0" + "@ethersproject/bignumber" "^5.3.0" + "@ethersproject/bytes" "^5.3.0" + "@ethersproject/keccak256" "^5.3.0" + "@ethersproject/logger" "^5.3.0" + "@ethersproject/rlp" "^5.3.0" -"@cosmjs/math@0.23.1": - version "0.23.1" - resolved "https://registry.yarnpkg.com/@cosmjs/math/-/math-0.23.1.tgz#706f38742a9a1f6561cf2c4510f8e5ab001fc5e6" - integrity sha512-xjGGogFZXLdmRumE1Wr+GlPfKznIl5Qa6K6QyZr4IjBhfB6/ZzLUihliDJp2d8zbjBJgQt9RUwP/PaFQ/yGQNg== +"@ethersproject/base64@5.3.0", "@ethersproject/base64@^5.3.0": + version "5.3.0" + resolved "https://registry.yarnpkg.com/@ethersproject/base64/-/base64-5.3.0.tgz#b831fb35418b42ad24d943c557259062b8640824" + integrity sha512-JIqgtOmgKcbc2sjGWTXyXktqUhvFUDte8fPVsAaOrcPiJf6YotNF+nsrOYGC9pbHBEGSuSBp3QR0varkO8JHEw== dependencies: - bn.js "^4.11.8" + "@ethersproject/bytes" "^5.3.0" -"@cosmjs/math@^0.25.0-alpha.2", "@cosmjs/math@^0.25.5": - version "0.25.5" - resolved "https://registry.yarnpkg.com/@cosmjs/math/-/math-0.25.5.tgz#0f586610353c95b2055d1b2556a232622cd2d453" - integrity sha512-LWovT1uTHlr+VEce27/14Wrgc4INJYOYk1+ncyvbZertixNFH6OMnc9Xkk0DIV4RYmW+/fvB9kCXVnNtQGSuHg== +"@ethersproject/basex@5.3.0", "@ethersproject/basex@^5.3.0": + version "5.3.0" + resolved "https://registry.yarnpkg.com/@ethersproject/basex/-/basex-5.3.0.tgz#02dea3ab8559ae625c6d548bc11773432255c916" + integrity sha512-8J4nS6t/SOnoCgr3DF5WCSRLC5YwTKYpZWJqeyYQLX+86TwPhtzvHXacODzcDII9tWKhVg6g0Bka8JCBWXsCiQ== dependencies: - bn.js "^4.11.8" + "@ethersproject/bytes" "^5.3.0" + "@ethersproject/properties" "^5.3.0" -"@cosmjs/proto-signing@^0.25.0-alpha.2": - version "0.25.5" - resolved "https://registry.yarnpkg.com/@cosmjs/proto-signing/-/proto-signing-0.25.5.tgz#93122ed1d57518a1c520917afde62e5aa9754033" - integrity sha512-YWVp+dGHt7v6ZKjOs8CI9xkpOV49eweHbYMv/vCVYF4cEh0kWwy2WzbWIkUH9zwwUqCxigVOTBYUCfbsjEbfug== +"@ethersproject/bignumber@5.3.0", "@ethersproject/bignumber@^5.3.0": + version "5.3.0" + resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.3.0.tgz#74ab2ec9c3bda4e344920565720a6ee9c794e9db" + integrity sha512-5xguJ+Q1/zRMgHgDCaqAexx/8DwDVLRemw2i6uR8KyGjwGdXI8f32QZZ1cKGucBN6ekJvpUpHy6XAuQnTv0mPA== dependencies: - "@cosmjs/amino" "^0.25.5" - long "^4.0.0" - protobufjs "~6.10.2" + "@ethersproject/bytes" "^5.3.0" + "@ethersproject/logger" "^5.3.0" + bn.js "^4.11.9" -"@cosmjs/socket@^0.25.0-alpha.2", "@cosmjs/socket@^0.25.5": - version "0.25.5" - resolved "https://registry.yarnpkg.com/@cosmjs/socket/-/socket-0.25.5.tgz#2b565afd310cdfaf3b106b901302ae93d849ec54" - integrity sha512-wcJVbD4xlF4+5hMum4tOmAy5ppX+E9qrB9Pvt3T7BK+6T5uobxiBQCLEiDwHP3n42RBj+xQWJrScPf5IEWmZKg== +"@ethersproject/bytes@5.3.0", "@ethersproject/bytes@^5.3.0": + version "5.3.0" + resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.3.0.tgz#473e0da7f831d535b2002be05e6f4ca3729a1bc9" + integrity sha512-rqLJjdVqCcn7glPer7Fxh87PRqlnRScVAoxcIP3PmOUNApMWJ6yRdOFfo2KvPAdO7Le3yEI1o0YW+Yvr7XCYvw== dependencies: - "@cosmjs/stream" "^0.25.5" - isomorphic-ws "^4.0.1" - ws "^7" - xstream "^11.14.0" - -"@cosmjs/stargate@0.25.0-alpha.2": - version "0.25.0-alpha.2" - resolved "https://registry.yarnpkg.com/@cosmjs/stargate/-/stargate-0.25.0-alpha.2.tgz#db6fa0002e96f62875e5b72378e24bd19ef9478f" - integrity sha512-r6VT720EuF6yPwS1WGPPUAPUOfD5aVIRlVJNJHkePWGg4l+ztJtoUbr7QN1CoPrxvG3b+WflNug1EQ7dG44UsA== - dependencies: - "@confio/ics23" "^0.6.3" - "@cosmjs/amino" "^0.25.0-alpha.2" - "@cosmjs/encoding" "^0.25.0-alpha.2" - "@cosmjs/math" "^0.25.0-alpha.2" - "@cosmjs/proto-signing" "^0.25.0-alpha.2" - "@cosmjs/stream" "^0.25.0-alpha.2" - "@cosmjs/tendermint-rpc" "^0.25.0-alpha.2" - "@cosmjs/utils" "^0.25.0-alpha.2" - long "^4.0.0" - protobufjs "~6.10.2" - -"@cosmjs/stream@^0.25.0-alpha.2", "@cosmjs/stream@^0.25.5": - version "0.25.5" - resolved "https://registry.yarnpkg.com/@cosmjs/stream/-/stream-0.25.5.tgz#5c538fc11e9d3d3ef16849164730dafee180e22e" - integrity sha512-a+0sDNKZTxw9p4j5tl7SI0siMTii7AQot1+5vkH5BkQoAv3C3D8jagPouUz3RUFuh13qftPxPLiHzDFLNSjTnQ== - dependencies: - xstream "^11.14.0" - -"@cosmjs/tendermint-rpc@0.25.0-alpha.2": - version "0.25.0-alpha.2" - resolved "https://registry.yarnpkg.com/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.25.0-alpha.2.tgz#15e31d8a9385085740ec71ea0029b9ebb9dd757e" - integrity sha512-1xK8mPwFWiWnyGafZhAdwYfcYmXl1l7UxQRR3yI2Q3kDk7CQhT87mgeAd56jw9JOaZvLYKKTgCRZkLNiKjXNew== - dependencies: - "@cosmjs/crypto" "^0.25.0-alpha.2" - "@cosmjs/encoding" "^0.25.0-alpha.2" - "@cosmjs/json-rpc" "^0.25.0-alpha.2" - "@cosmjs/math" "^0.25.0-alpha.2" - "@cosmjs/socket" "^0.25.0-alpha.2" - "@cosmjs/stream" "^0.25.0-alpha.2" - axios "^0.21.1" - readonly-date "^1.0.0" - xstream "^11.14.0" - -"@cosmjs/tendermint-rpc@^0.25.0-alpha.2": - version "0.25.5" - resolved "https://registry.yarnpkg.com/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.25.5.tgz#5467391f430f648d46d9f39aa4324515affb8578" - integrity sha512-WlUCFVdhbwA3IDA1C858S8WOtLseZLXKTdj5fz1sTKSBmtrig4l1ZMKHHlZRprvmjSpkpbjgSQU+RjjvBd75BA== - dependencies: - "@cosmjs/crypto" "^0.25.5" - "@cosmjs/encoding" "^0.25.5" - "@cosmjs/json-rpc" "^0.25.5" - "@cosmjs/math" "^0.25.5" - "@cosmjs/socket" "^0.25.5" - "@cosmjs/stream" "^0.25.5" - axios "^0.21.1" - readonly-date "^1.0.0" - xstream "^11.14.0" - -"@cosmjs/utils@^0.25.0-alpha.2", "@cosmjs/utils@^0.25.5": - version "0.25.5" - resolved "https://registry.yarnpkg.com/@cosmjs/utils/-/utils-0.25.5.tgz#6dc9d8de81acb9d49b6d1420f61ea2390f5d5f07" - integrity sha512-U4YdgJadFgXWblthgyXqP28Yw5rsw2IX/cOES0pa6fiB81hoYl2LXqXiuKp2yVPoAgk8JpkFh3i5KchcD9muJg== - -"@crypto-com/chain-jslib@^0.0.16": - version "0.0.16" - resolved "https://registry.yarnpkg.com/@crypto-com/chain-jslib/-/chain-jslib-0.0.16.tgz#d09563d62200db7ad3955438abf2a5722ebc4e4c" - integrity sha512-iLq4XC0Jq7BZJXZ4xL3bmmjEUMH8VlPirUCM5Unyc2S1QL1A9NzWngoJS6ua7MgL7WPQOjqJrKpZAmt6quI1ow== - dependencies: - "@cosmjs/encoding" "0.23.1" - "@cosmjs/math" "0.23.1" - "@cosmjs/stargate" "0.25.0-alpha.2" - "@cosmjs/tendermint-rpc" "0.25.0-alpha.2" - axios "0.21.1" - bech32 "1.1.4" - big.js "6.0.0" - bip32 "2.0.6" - bip39 "3.0.2" - buffer "5.6.1" - create-hash "1.2.0" - lodash "4.17.21" - long "4.0.0" - ow "0.17.0" - protobufjs "6.10.1" - randombytes "2.1.0" - secp256k1 "4.0.2" + "@ethersproject/logger" "^5.3.0" -"@dabh/diagnostics@^2.0.2": - version "2.0.2" - resolved "https://registry.yarnpkg.com/@dabh/diagnostics/-/diagnostics-2.0.2.tgz#290d08f7b381b8f94607dc8f471a12c675f9db31" - integrity sha512-+A1YivoVDNNVCdfozHSR8v/jyuuLTMXwjWuxPFlFlUapXoGc+Gj9mDlTDDfrwl7rXCl2tNZ0kE8sIBO6YOn96Q== +"@ethersproject/constants@5.3.0", "@ethersproject/constants@^5.3.0": + version "5.3.0" + resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.3.0.tgz#a5d6d86c0eec2c64c3024479609493b9afb3fc77" + integrity sha512-4y1feNOwEpgjAfiCFWOHznvv6qUF/H6uI0UKp8xdhftb+H+FbKflXg1pOgH5qs4Sr7EYBL+zPyPb+YD5g1aEyw== dependencies: - colorspace "1.1.x" - enabled "2.0.x" - kuler "^2.0.0" - -"@ethersproject/abi@5.4.0", "@ethersproject/abi@^5.4.0": - version "5.4.0" - resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.4.0.tgz#a6d63bdb3672f738398846d4279fa6b6c9818242" - integrity sha512-9gU2H+/yK1j2eVMdzm6xvHSnMxk8waIHQGYCZg5uvAyH0rsAzxkModzBSpbAkAuhKFEovC2S9hM4nPuLym8IZw== - dependencies: - "@ethersproject/address" "^5.4.0" - "@ethersproject/bignumber" "^5.4.0" - "@ethersproject/bytes" "^5.4.0" - "@ethersproject/constants" "^5.4.0" - "@ethersproject/hash" "^5.4.0" - "@ethersproject/keccak256" "^5.4.0" - "@ethersproject/logger" "^5.4.0" - "@ethersproject/properties" "^5.4.0" - "@ethersproject/strings" "^5.4.0" - -"@ethersproject/abstract-provider@5.4.0", "@ethersproject/abstract-provider@^5.4.0": - version "5.4.0" - resolved "https://registry.yarnpkg.com/@ethersproject/abstract-provider/-/abstract-provider-5.4.0.tgz#415331031b0f678388971e1987305244edc04e1d" - integrity sha512-vPBR7HKUBY0lpdllIn7tLIzNN7DrVnhCLKSzY0l8WAwxz686m/aL7ASDzrVxV93GJtIub6N2t4dfZ29CkPOxgA== - dependencies: - "@ethersproject/bignumber" "^5.4.0" - "@ethersproject/bytes" "^5.4.0" - "@ethersproject/logger" "^5.4.0" - "@ethersproject/networks" "^5.4.0" - "@ethersproject/properties" "^5.4.0" - "@ethersproject/transactions" "^5.4.0" - "@ethersproject/web" "^5.4.0" - -"@ethersproject/abstract-signer@5.4.0", "@ethersproject/abstract-signer@^5.4.0": - version "5.4.0" - resolved "https://registry.yarnpkg.com/@ethersproject/abstract-signer/-/abstract-signer-5.4.0.tgz#cd5f50b93141ee9f9f49feb4075a0b3eafb57d65" - integrity sha512-AieQAzt05HJZS2bMofpuxMEp81AHufA5D6M4ScKwtolj041nrfIbIi8ciNW7+F59VYxXq+V4c3d568Q6l2m8ew== - dependencies: - "@ethersproject/abstract-provider" "^5.4.0" - "@ethersproject/bignumber" "^5.4.0" - "@ethersproject/bytes" "^5.4.0" - "@ethersproject/logger" "^5.4.0" - "@ethersproject/properties" "^5.4.0" - -"@ethersproject/address@5.4.0", "@ethersproject/address@^5.4.0": - version "5.4.0" - resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.4.0.tgz#ba2d00a0f8c4c0854933b963b9a3a9f6eb4a37a3" - integrity sha512-SD0VgOEkcACEG/C6xavlU1Hy3m5DGSXW3CUHkaaEHbAPPsgi0coP5oNPsxau8eTlZOk/bpa/hKeCNoK5IzVI2Q== - dependencies: - "@ethersproject/bignumber" "^5.4.0" - "@ethersproject/bytes" "^5.4.0" - "@ethersproject/keccak256" "^5.4.0" - "@ethersproject/logger" "^5.4.0" - "@ethersproject/rlp" "^5.4.0" - -"@ethersproject/base64@5.4.0", "@ethersproject/base64@^5.4.0": - version "5.4.0" - resolved "https://registry.yarnpkg.com/@ethersproject/base64/-/base64-5.4.0.tgz#7252bf65295954c9048c7ca5f43e5c86441b2a9a" - integrity sha512-CjQw6E17QDSSC5jiM9YpF7N1aSCHmYGMt9bWD8PWv6YPMxjsys2/Q8xLrROKI3IWJ7sFfZ8B3flKDTM5wlWuZQ== - dependencies: - "@ethersproject/bytes" "^5.4.0" - -"@ethersproject/basex@5.4.0", "@ethersproject/basex@^5.4.0": - version "5.4.0" - resolved "https://registry.yarnpkg.com/@ethersproject/basex/-/basex-5.4.0.tgz#0a2da0f4e76c504a94f2b21d3161ed9438c7f8a6" - integrity sha512-J07+QCVJ7np2bcpxydFVf/CuYo9mZ7T73Pe7KQY4c1lRlrixMeblauMxHXD0MPwFmUHZIILDNViVkykFBZylbg== - dependencies: - "@ethersproject/bytes" "^5.4.0" - "@ethersproject/properties" "^5.4.0" - -"@ethersproject/bignumber@5.4.0", "@ethersproject/bignumber@^5.4.0": - version "5.4.0" - resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.4.0.tgz#be8dea298c0ec71208ee60f0b245be0761217ad9" - integrity sha512-OXUu9f9hO3vGRIPxU40cignXZVaYyfx6j9NNMjebKdnaCL3anCLSSy8/b8d03vY6dh7duCC0kW72GEC4tZer2w== - dependencies: - "@ethersproject/bytes" "^5.4.0" - "@ethersproject/logger" "^5.4.0" - bn.js "^4.11.9" + "@ethersproject/bignumber" "^5.3.0" -"@ethersproject/bytes@5.4.0", "@ethersproject/bytes@^5.4.0": - version "5.4.0" - resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.4.0.tgz#56fa32ce3bf67153756dbaefda921d1d4774404e" - integrity sha512-H60ceqgTHbhzOj4uRc/83SCN9d+BSUnOkrr2intevqdtEMO1JFVZ1XL84OEZV+QjV36OaZYxtnt4lGmxcGsPfA== - dependencies: - "@ethersproject/logger" "^5.4.0" - -"@ethersproject/constants@5.4.0", "@ethersproject/constants@^5.4.0": - version "5.4.0" - resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.4.0.tgz#ee0bdcb30bf1b532d2353c977bf2ef1ee117958a" - integrity sha512-tzjn6S7sj9+DIIeKTJLjK9WGN2Tj0P++Z8ONEIlZjyoTkBuODN+0VfhAyYksKi43l1Sx9tX2VlFfzjfmr5Wl3Q== - dependencies: - "@ethersproject/bignumber" "^5.4.0" - -"@ethersproject/contracts@5.4.0": - version "5.4.0" - resolved "https://registry.yarnpkg.com/@ethersproject/contracts/-/contracts-5.4.0.tgz#e05fe6bd33acc98741e27d553889ec5920078abb" - integrity sha512-hkO3L3IhS1Z3ZtHtaAG/T87nQ7KiPV+/qnvutag35I0IkiQ8G3ZpCQ9NNOpSCzn4pWSW4CfzmtE02FcqnLI+hw== - dependencies: - "@ethersproject/abi" "^5.4.0" - "@ethersproject/abstract-provider" "^5.4.0" - "@ethersproject/abstract-signer" "^5.4.0" - "@ethersproject/address" "^5.4.0" - "@ethersproject/bignumber" "^5.4.0" - "@ethersproject/bytes" "^5.4.0" - "@ethersproject/constants" "^5.4.0" - "@ethersproject/logger" "^5.4.0" - "@ethersproject/properties" "^5.4.0" - "@ethersproject/transactions" "^5.4.0" - -"@ethersproject/hash@5.4.0", "@ethersproject/hash@^5.4.0": - version "5.4.0" - resolved "https://registry.yarnpkg.com/@ethersproject/hash/-/hash-5.4.0.tgz#d18a8e927e828e22860a011f39e429d388344ae0" - integrity sha512-xymAM9tmikKgbktOCjW60Z5sdouiIIurkZUr9oW5NOex5uwxrbsYG09kb5bMcNjlVeJD3yPivTNzViIs1GCbqA== - dependencies: - "@ethersproject/abstract-signer" "^5.4.0" - "@ethersproject/address" "^5.4.0" - "@ethersproject/bignumber" "^5.4.0" - "@ethersproject/bytes" "^5.4.0" - "@ethersproject/keccak256" "^5.4.0" - "@ethersproject/logger" "^5.4.0" - "@ethersproject/properties" "^5.4.0" - "@ethersproject/strings" "^5.4.0" - -"@ethersproject/hdnode@5.4.0", "@ethersproject/hdnode@^5.4.0": - version "5.4.0" - resolved "https://registry.yarnpkg.com/@ethersproject/hdnode/-/hdnode-5.4.0.tgz#4bc9999b9a12eb5ce80c5faa83114a57e4107cac" - integrity sha512-pKxdS0KAaeVGfZPp1KOiDLB0jba11tG6OP1u11QnYfb7pXn6IZx0xceqWRr6ygke8+Kw74IpOoSi7/DwANhy8Q== - dependencies: - "@ethersproject/abstract-signer" "^5.4.0" - "@ethersproject/basex" "^5.4.0" - "@ethersproject/bignumber" "^5.4.0" - "@ethersproject/bytes" "^5.4.0" - "@ethersproject/logger" "^5.4.0" - "@ethersproject/pbkdf2" "^5.4.0" - "@ethersproject/properties" "^5.4.0" - "@ethersproject/sha2" "^5.4.0" - "@ethersproject/signing-key" "^5.4.0" - "@ethersproject/strings" "^5.4.0" - "@ethersproject/transactions" "^5.4.0" - "@ethersproject/wordlists" "^5.4.0" - -"@ethersproject/json-wallets@5.4.0", "@ethersproject/json-wallets@^5.4.0": - version "5.4.0" - resolved "https://registry.yarnpkg.com/@ethersproject/json-wallets/-/json-wallets-5.4.0.tgz#2583341cfe313fc9856642e8ace3080154145e95" - integrity sha512-igWcu3fx4aiczrzEHwG1xJZo9l1cFfQOWzTqwRw/xcvxTk58q4f9M7cjh51EKphMHvrJtcezJ1gf1q1AUOfEQQ== - dependencies: - "@ethersproject/abstract-signer" "^5.4.0" - "@ethersproject/address" "^5.4.0" - "@ethersproject/bytes" "^5.4.0" - "@ethersproject/hdnode" "^5.4.0" - "@ethersproject/keccak256" "^5.4.0" - "@ethersproject/logger" "^5.4.0" - "@ethersproject/pbkdf2" "^5.4.0" - "@ethersproject/properties" "^5.4.0" - "@ethersproject/random" "^5.4.0" - "@ethersproject/strings" "^5.4.0" - "@ethersproject/transactions" "^5.4.0" +"@ethersproject/contracts@5.3.0": + version "5.3.0" + resolved "https://registry.yarnpkg.com/@ethersproject/contracts/-/contracts-5.3.0.tgz#ad699a3abaae30bfb6422cf31813a663b2d4099c" + integrity sha512-eDyQ8ltykvyQqnGZxb/c1e0OnEtzqXhNNC4BX8nhYBCaoBrYYuK/1fLmyEvc5+XUMoxNhwpYkoSSwvPLci7/Zg== + dependencies: + "@ethersproject/abi" "^5.3.0" + "@ethersproject/abstract-provider" "^5.3.0" + "@ethersproject/abstract-signer" "^5.3.0" + "@ethersproject/address" "^5.3.0" + "@ethersproject/bignumber" "^5.3.0" + "@ethersproject/bytes" "^5.3.0" + "@ethersproject/constants" "^5.3.0" + "@ethersproject/logger" "^5.3.0" + "@ethersproject/properties" "^5.3.0" + "@ethersproject/transactions" "^5.3.0" + +"@ethersproject/hash@5.3.0", "@ethersproject/hash@^5.3.0": + version "5.3.0" + resolved "https://registry.yarnpkg.com/@ethersproject/hash/-/hash-5.3.0.tgz#f65e3bf3db3282df4da676db6cfa049535dd3643" + integrity sha512-gAFZSjUPQ32CIfoKSMtMEQ+IO0kQxqhwz9fCIFt2DtAq2u4pWt8mL9Z5P0r6KkLcQU8LE9FmuPPyd+JvBzmr1w== + dependencies: + "@ethersproject/abstract-signer" "^5.3.0" + "@ethersproject/address" "^5.3.0" + "@ethersproject/bignumber" "^5.3.0" + "@ethersproject/bytes" "^5.3.0" + "@ethersproject/keccak256" "^5.3.0" + "@ethersproject/logger" "^5.3.0" + "@ethersproject/properties" "^5.3.0" + "@ethersproject/strings" "^5.3.0" + +"@ethersproject/hdnode@5.3.0", "@ethersproject/hdnode@^5.3.0": + version "5.3.0" + resolved "https://registry.yarnpkg.com/@ethersproject/hdnode/-/hdnode-5.3.0.tgz#26fed65ffd5c25463fddff13f5fb4e5617553c94" + integrity sha512-zLmmtLNoDMGoYRdjOab01Zqkvp+TmZyCGDAMQF1Bs3yZyBs/kzTNi1qJjR1jVUcPP5CWGtjFwY8iNG8oNV9J8g== + dependencies: + "@ethersproject/abstract-signer" "^5.3.0" + "@ethersproject/basex" "^5.3.0" + "@ethersproject/bignumber" "^5.3.0" + "@ethersproject/bytes" "^5.3.0" + "@ethersproject/logger" "^5.3.0" + "@ethersproject/pbkdf2" "^5.3.0" + "@ethersproject/properties" "^5.3.0" + "@ethersproject/sha2" "^5.3.0" + "@ethersproject/signing-key" "^5.3.0" + "@ethersproject/strings" "^5.3.0" + "@ethersproject/transactions" "^5.3.0" + "@ethersproject/wordlists" "^5.3.0" + +"@ethersproject/json-wallets@5.3.0", "@ethersproject/json-wallets@^5.3.0": + version "5.3.0" + resolved "https://registry.yarnpkg.com/@ethersproject/json-wallets/-/json-wallets-5.3.0.tgz#7b1a5ff500c12aa8597ae82c8939837b0449376e" + integrity sha512-/xwbqaIb5grUIGNmeEaz8GdcpmDr++X8WT4Jqcclnxow8PXCUHFeDxjf3O+nSuoqOYG/Ds0+BI5xuQKbva6Xkw== + dependencies: + "@ethersproject/abstract-signer" "^5.3.0" + "@ethersproject/address" "^5.3.0" + "@ethersproject/bytes" "^5.3.0" + "@ethersproject/hdnode" "^5.3.0" + "@ethersproject/keccak256" "^5.3.0" + "@ethersproject/logger" "^5.3.0" + "@ethersproject/pbkdf2" "^5.3.0" + "@ethersproject/properties" "^5.3.0" + "@ethersproject/random" "^5.3.0" + "@ethersproject/strings" "^5.3.0" + "@ethersproject/transactions" "^5.3.0" aes-js "3.0.0" scrypt-js "3.0.1" -"@ethersproject/keccak256@5.4.0", "@ethersproject/keccak256@^5.4.0": - version "5.4.0" - resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.4.0.tgz#7143b8eea4976080241d2bd92e3b1f1bf7025318" - integrity sha512-FBI1plWet+dPUvAzPAeHzRKiPpETQzqSUWR1wXJGHVWi4i8bOSrpC3NwpkPjgeXG7MnugVc1B42VbfnQikyC/A== +"@ethersproject/keccak256@5.3.0", "@ethersproject/keccak256@^5.3.0": + version "5.3.0" + resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.3.0.tgz#fb5cd36bdfd6fa02e2ea84964078a9fc6bd731be" + integrity sha512-Gv2YqgIUmRbYVNIibafT0qGaeGYLIA/EdWHJ7JcVxVSs2vyxafGxOJ5VpSBHWeOIsE6OOaCelYowhuuTicgdFQ== dependencies: - "@ethersproject/bytes" "^5.4.0" + "@ethersproject/bytes" "^5.3.0" js-sha3 "0.5.7" -"@ethersproject/logger@5.4.0", "@ethersproject/logger@^5.4.0": - version "5.4.0" - resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.4.0.tgz#f39adadf62ad610c420bcd156fd41270e91b3ca9" - integrity sha512-xYdWGGQ9P2cxBayt64d8LC8aPFJk6yWCawQi/4eJ4+oJdMMjEBMrIcIMZ9AxhwpPVmnBPrsB10PcXGmGAqgUEQ== - -"@ethersproject/networks@5.4.1", "@ethersproject/networks@^5.4.0": - version "5.4.1" - resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.4.1.tgz#2ce83b8e42aa85216e5d277a7952d97b6ce8d852" - integrity sha512-8SvowCKz9Uf4xC5DTKI8+il8lWqOr78kmiqAVLYT9lzB8aSmJHQMD1GSuJI0CW4hMAnzocpGpZLgiMdzsNSPig== - dependencies: - "@ethersproject/logger" "^5.4.0" - -"@ethersproject/pbkdf2@5.4.0", "@ethersproject/pbkdf2@^5.4.0": - version "5.4.0" - resolved "https://registry.yarnpkg.com/@ethersproject/pbkdf2/-/pbkdf2-5.4.0.tgz#ed88782a67fda1594c22d60d0ca911a9d669641c" - integrity sha512-x94aIv6tiA04g6BnazZSLoRXqyusawRyZWlUhKip2jvoLpzJuLb//KtMM6PEovE47pMbW+Qe1uw+68ameJjB7g== - dependencies: - "@ethersproject/bytes" "^5.4.0" - "@ethersproject/sha2" "^5.4.0" - -"@ethersproject/properties@5.4.0", "@ethersproject/properties@^5.4.0": - version "5.4.0" - resolved "https://registry.yarnpkg.com/@ethersproject/properties/-/properties-5.4.0.tgz#38ba20539b44dcc5d5f80c45ad902017dcdbefe7" - integrity sha512-7jczalGVRAJ+XSRvNA6D5sAwT4gavLq3OXPuV/74o3Rd2wuzSL035IMpIMgei4CYyBdialJMrTqkOnzccLHn4A== - dependencies: - "@ethersproject/logger" "^5.4.0" - -"@ethersproject/providers@5.4.1": - version "5.4.1" - resolved "https://registry.yarnpkg.com/@ethersproject/providers/-/providers-5.4.1.tgz#654267b563b833046b9c9647647cfc8267cb93b4" - integrity sha512-p06eiFKz8nu/5Ju0kIX024gzEQIgE5pvvGrBCngpyVjpuLtUIWT3097Agw4mTn9/dEA0FMcfByzFqacBMSgCVg== - dependencies: - "@ethersproject/abstract-provider" "^5.4.0" - "@ethersproject/abstract-signer" "^5.4.0" - "@ethersproject/address" "^5.4.0" - "@ethersproject/basex" "^5.4.0" - "@ethersproject/bignumber" "^5.4.0" - "@ethersproject/bytes" "^5.4.0" - "@ethersproject/constants" "^5.4.0" - "@ethersproject/hash" "^5.4.0" - "@ethersproject/logger" "^5.4.0" - "@ethersproject/networks" "^5.4.0" - "@ethersproject/properties" "^5.4.0" - "@ethersproject/random" "^5.4.0" - "@ethersproject/rlp" "^5.4.0" - "@ethersproject/sha2" "^5.4.0" - "@ethersproject/strings" "^5.4.0" - "@ethersproject/transactions" "^5.4.0" - "@ethersproject/web" "^5.4.0" +"@ethersproject/logger@5.3.0", "@ethersproject/logger@^5.3.0": + version "5.3.0" + resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.3.0.tgz#7a69fa1d4ca0d4b7138da1627eb152f763d84dd0" + integrity sha512-8bwJ2gxJGkZZnpQSq5uSiZSJjyVTWmlGft4oH8vxHdvO1Asy4TwVepAhPgxIQIMxXZFUNMych1YjIV4oQ4I7dA== + +"@ethersproject/networks@5.3.1", "@ethersproject/networks@^5.3.0": + version "5.3.1" + resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.3.1.tgz#78fe08324cee289ce239acf8c746121934b2ef61" + integrity sha512-6uQKHkYChlsfeiZhQ8IHIqGE/sQsf25o9ZxAYpMxi15dLPzz3IxOEF5KiSD32aHwsjXVBKBSlo+teAXLlYJybw== + dependencies: + "@ethersproject/logger" "^5.3.0" + +"@ethersproject/pbkdf2@5.3.0", "@ethersproject/pbkdf2@^5.3.0": + version "5.3.0" + resolved "https://registry.yarnpkg.com/@ethersproject/pbkdf2/-/pbkdf2-5.3.0.tgz#8adbb41489c3c9f319cc44bc7d3e6095fd468dc8" + integrity sha512-Q9ChVU6gBFiex0FSdtzo4b0SAKz3ZYcYVFLrEWHL0FnHvNk3J3WgAtRNtBQGQYn/T5wkoTdZttMbfBkFlaiWcA== + dependencies: + "@ethersproject/bytes" "^5.3.0" + "@ethersproject/sha2" "^5.3.0" + +"@ethersproject/properties@5.3.0", "@ethersproject/properties@^5.3.0": + version "5.3.0" + resolved "https://registry.yarnpkg.com/@ethersproject/properties/-/properties-5.3.0.tgz#feef4c4babeb7c10a6b3449575016f4ad2c092b2" + integrity sha512-PaHxJyM5/bfusk6vr3yP//JMnm4UEojpzuWGTmtL5X4uNhNnFNvlYilZLyDr4I9cTkIbipCMsAuIcXWsmdRnEw== + dependencies: + "@ethersproject/logger" "^5.3.0" + +"@ethersproject/providers@5.3.1": + version "5.3.1" + resolved "https://registry.yarnpkg.com/@ethersproject/providers/-/providers-5.3.1.tgz#a12c6370e8cbc0968c9744641b8ef90b0dd5ec2b" + integrity sha512-HC63vENTrur6/JKEhcQbA8PRDj1FAesdpX98IW+xAAo3EAkf70ou5fMIA3KCGzJDLNTeYA4C2Bonz849tVLekg== + dependencies: + "@ethersproject/abstract-provider" "^5.3.0" + "@ethersproject/abstract-signer" "^5.3.0" + "@ethersproject/address" "^5.3.0" + "@ethersproject/basex" "^5.3.0" + "@ethersproject/bignumber" "^5.3.0" + "@ethersproject/bytes" "^5.3.0" + "@ethersproject/constants" "^5.3.0" + "@ethersproject/hash" "^5.3.0" + "@ethersproject/logger" "^5.3.0" + "@ethersproject/networks" "^5.3.0" + "@ethersproject/properties" "^5.3.0" + "@ethersproject/random" "^5.3.0" + "@ethersproject/rlp" "^5.3.0" + "@ethersproject/sha2" "^5.3.0" + "@ethersproject/strings" "^5.3.0" + "@ethersproject/transactions" "^5.3.0" + "@ethersproject/web" "^5.3.0" bech32 "1.1.4" ws "7.4.6" -"@ethersproject/random@5.4.0", "@ethersproject/random@^5.4.0": - version "5.4.0" - resolved "https://registry.yarnpkg.com/@ethersproject/random/-/random-5.4.0.tgz#9cdde60e160d024be39cc16f8de3b9ce39191e16" - integrity sha512-pnpWNQlf0VAZDEOVp1rsYQosmv2o0ITS/PecNw+mS2/btF8eYdspkN0vIXrCMtkX09EAh9bdk8GoXmFXM1eAKw== +"@ethersproject/random@5.3.0", "@ethersproject/random@^5.3.0": + version "5.3.0" + resolved "https://registry.yarnpkg.com/@ethersproject/random/-/random-5.3.0.tgz#7c46bf36e50cb0d0550bc8c666af8e1d4496dc1a" + integrity sha512-A5SL/4inutSwt3Fh2OD0x2gz+x6GHmuUnIPkR7zAiTidMD2N8F6tZdMF1hlQKWVCcVMWhEQg8mWijhEzm6BBYw== dependencies: - "@ethersproject/bytes" "^5.4.0" - "@ethersproject/logger" "^5.4.0" + "@ethersproject/bytes" "^5.3.0" + "@ethersproject/logger" "^5.3.0" -"@ethersproject/rlp@5.4.0", "@ethersproject/rlp@^5.4.0": - version "5.4.0" - resolved "https://registry.yarnpkg.com/@ethersproject/rlp/-/rlp-5.4.0.tgz#de61afda5ff979454e76d3b3310a6c32ad060931" - integrity sha512-0I7MZKfi+T5+G8atId9QaQKHRvvasM/kqLyAH4XxBCBchAooH2EX5rL9kYZWwcm3awYV+XC7VF6nLhfeQFKVPg== +"@ethersproject/rlp@5.3.0", "@ethersproject/rlp@^5.3.0": + version "5.3.0" + resolved "https://registry.yarnpkg.com/@ethersproject/rlp/-/rlp-5.3.0.tgz#7cb93a7b5dfa69163894153c9d4b0d936f333188" + integrity sha512-oI0joYpsRanl9guDubaW+1NbcpK0vJ3F/6Wpcanzcnqq+oaW9O5E98liwkEDPcb16BUTLIJ+ZF8GPIHYxJ/5Pw== dependencies: - "@ethersproject/bytes" "^5.4.0" - "@ethersproject/logger" "^5.4.0" + "@ethersproject/bytes" "^5.3.0" + "@ethersproject/logger" "^5.3.0" -"@ethersproject/sha2@5.4.0", "@ethersproject/sha2@^5.4.0": - version "5.4.0" - resolved "https://registry.yarnpkg.com/@ethersproject/sha2/-/sha2-5.4.0.tgz#c9a8db1037014cbc4e9482bd662f86c090440371" - integrity sha512-siheo36r1WD7Cy+bDdE1BJ8y0bDtqXCOxRMzPa4bV1TGt/eTUUt03BHoJNB6reWJD8A30E/pdJ8WFkq+/uz4Gg== +"@ethersproject/sha2@5.3.0", "@ethersproject/sha2@^5.3.0": + version "5.3.0" + resolved "https://registry.yarnpkg.com/@ethersproject/sha2/-/sha2-5.3.0.tgz#209f9a1649f7d2452dcd5e5b94af43b7f3f42366" + integrity sha512-r5ftlwKcocYEuFz2JbeKOT5SAsCV4m1RJDsTOEfQ5L67ZC7NFDK5i7maPdn1bx4nPhylF9VAwxSrQ1esmwzylg== dependencies: - "@ethersproject/bytes" "^5.4.0" - "@ethersproject/logger" "^5.4.0" + "@ethersproject/bytes" "^5.3.0" + "@ethersproject/logger" "^5.3.0" hash.js "1.1.7" -"@ethersproject/signing-key@5.4.0", "@ethersproject/signing-key@^5.4.0": - version "5.4.0" - resolved "https://registry.yarnpkg.com/@ethersproject/signing-key/-/signing-key-5.4.0.tgz#2f05120984e81cf89a3d5f6dec5c68ee0894fbec" - integrity sha512-q8POUeywx6AKg2/jX9qBYZIAmKSB4ubGXdQ88l40hmATj29JnG5pp331nAWwwxPn2Qao4JpWHNZsQN+bPiSW9A== +"@ethersproject/signing-key@5.3.0", "@ethersproject/signing-key@^5.3.0": + version "5.3.0" + resolved "https://registry.yarnpkg.com/@ethersproject/signing-key/-/signing-key-5.3.0.tgz#a96c88f8173e1abedfa35de32d3e5db7c48e5259" + integrity sha512-+DX/GwHAd0ok1bgedV1cKO0zfK7P/9aEyNoaYiRsGHpCecN7mhLqcdoUiUzE7Uz86LBsxm5ssK0qA1kBB47fbQ== dependencies: - "@ethersproject/bytes" "^5.4.0" - "@ethersproject/logger" "^5.4.0" - "@ethersproject/properties" "^5.4.0" + "@ethersproject/bytes" "^5.3.0" + "@ethersproject/logger" "^5.3.0" + "@ethersproject/properties" "^5.3.0" bn.js "^4.11.9" elliptic "6.5.4" hash.js "1.1.7" -"@ethersproject/solidity@5.4.0": - version "5.4.0" - resolved "https://registry.yarnpkg.com/@ethersproject/solidity/-/solidity-5.4.0.tgz#1305e058ea02dc4891df18b33232b11a14ece9ec" - integrity sha512-XFQTZ7wFSHOhHcV1DpcWj7VXECEiSrBuv7JErJvB9Uo+KfCdc3QtUZV+Vjh/AAaYgezUEKbCtE6Khjm44seevQ== - dependencies: - "@ethersproject/bignumber" "^5.4.0" - "@ethersproject/bytes" "^5.4.0" - "@ethersproject/keccak256" "^5.4.0" - "@ethersproject/sha2" "^5.4.0" - "@ethersproject/strings" "^5.4.0" - -"@ethersproject/strings@5.4.0", "@ethersproject/strings@^5.4.0": - version "5.4.0" - resolved "https://registry.yarnpkg.com/@ethersproject/strings/-/strings-5.4.0.tgz#fb12270132dd84b02906a8d895ae7e7fa3d07d9a" - integrity sha512-k/9DkH5UGDhv7aReXLluFG5ExurwtIpUfnDNhQA29w896Dw3i4uDTz01Quaptbks1Uj9kI8wo9tmW73wcIEaWA== - dependencies: - "@ethersproject/bytes" "^5.4.0" - "@ethersproject/constants" "^5.4.0" - "@ethersproject/logger" "^5.4.0" - -"@ethersproject/transactions@5.4.0", "@ethersproject/transactions@^5.4.0": - version "5.4.0" - resolved "https://registry.yarnpkg.com/@ethersproject/transactions/-/transactions-5.4.0.tgz#a159d035179334bd92f340ce0f77e83e9e1522e0" - integrity sha512-s3EjZZt7xa4BkLknJZ98QGoIza94rVjaEed0rzZ/jB9WrIuu/1+tjvYCWzVrystXtDswy7TPBeIepyXwSYa4WQ== - dependencies: - "@ethersproject/address" "^5.4.0" - "@ethersproject/bignumber" "^5.4.0" - "@ethersproject/bytes" "^5.4.0" - "@ethersproject/constants" "^5.4.0" - "@ethersproject/keccak256" "^5.4.0" - "@ethersproject/logger" "^5.4.0" - "@ethersproject/properties" "^5.4.0" - "@ethersproject/rlp" "^5.4.0" - "@ethersproject/signing-key" "^5.4.0" - -"@ethersproject/units@5.4.0": - version "5.4.0" - resolved "https://registry.yarnpkg.com/@ethersproject/units/-/units-5.4.0.tgz#d57477a4498b14b88b10396062c8cbbaf20c79fe" - integrity sha512-Z88krX40KCp+JqPCP5oPv5p750g+uU6gopDYRTBGcDvOASh6qhiEYCRatuM/suC4S2XW9Zz90QI35MfSrTIaFg== - dependencies: - "@ethersproject/bignumber" "^5.4.0" - "@ethersproject/constants" "^5.4.0" - "@ethersproject/logger" "^5.4.0" - -"@ethersproject/wallet@5.4.0": - version "5.4.0" - resolved "https://registry.yarnpkg.com/@ethersproject/wallet/-/wallet-5.4.0.tgz#fa5b59830b42e9be56eadd45a16a2e0933ad9353" - integrity sha512-wU29majLjM6AjCjpat21mPPviG+EpK7wY1+jzKD0fg3ui5fgedf2zEu1RDgpfIMsfn8fJHJuzM4zXZ2+hSHaSQ== - dependencies: - "@ethersproject/abstract-provider" "^5.4.0" - "@ethersproject/abstract-signer" "^5.4.0" - "@ethersproject/address" "^5.4.0" - "@ethersproject/bignumber" "^5.4.0" - "@ethersproject/bytes" "^5.4.0" - "@ethersproject/hash" "^5.4.0" - "@ethersproject/hdnode" "^5.4.0" - "@ethersproject/json-wallets" "^5.4.0" - "@ethersproject/keccak256" "^5.4.0" - "@ethersproject/logger" "^5.4.0" - "@ethersproject/properties" "^5.4.0" - "@ethersproject/random" "^5.4.0" - "@ethersproject/signing-key" "^5.4.0" - "@ethersproject/transactions" "^5.4.0" - "@ethersproject/wordlists" "^5.4.0" - -"@ethersproject/web@5.4.0", "@ethersproject/web@^5.4.0": - version "5.4.0" - resolved "https://registry.yarnpkg.com/@ethersproject/web/-/web-5.4.0.tgz#49fac173b96992334ed36a175538ba07a7413d1f" - integrity sha512-1bUusGmcoRLYgMn6c1BLk1tOKUIFuTg8j+6N8lYlbMpDesnle+i3pGSagGNvwjaiLo4Y5gBibwctpPRmjrh4Og== - dependencies: - "@ethersproject/base64" "^5.4.0" - "@ethersproject/bytes" "^5.4.0" - "@ethersproject/logger" "^5.4.0" - "@ethersproject/properties" "^5.4.0" - "@ethersproject/strings" "^5.4.0" - -"@ethersproject/wordlists@5.4.0", "@ethersproject/wordlists@^5.4.0": - version "5.4.0" - resolved "https://registry.yarnpkg.com/@ethersproject/wordlists/-/wordlists-5.4.0.tgz#f34205ec3bbc9e2c49cadaee774cf0b07e7573d7" - integrity sha512-FemEkf6a+EBKEPxlzeVgUaVSodU7G0Na89jqKjmWMlDB0tomoU8RlEMgUvXyqtrg8N4cwpLh8nyRnm1Nay1isA== - dependencies: - "@ethersproject/bytes" "^5.4.0" - "@ethersproject/hash" "^5.4.0" - "@ethersproject/logger" "^5.4.0" - "@ethersproject/properties" "^5.4.0" - "@ethersproject/strings" "^5.4.0" +"@ethersproject/solidity@5.3.0": + version "5.3.0" + resolved "https://registry.yarnpkg.com/@ethersproject/solidity/-/solidity-5.3.0.tgz#2a0b00b4aaaef99a080ddea13acab1fa35cd4a93" + integrity sha512-uLRBaNUiISHbut94XKewJgQh6UmydWTBp71I7I21pkjVXfZO2dJ5EOo3jCnumJc01M4LOm79dlNNmF3oGIvweQ== + dependencies: + "@ethersproject/bignumber" "^5.3.0" + "@ethersproject/bytes" "^5.3.0" + "@ethersproject/keccak256" "^5.3.0" + "@ethersproject/sha2" "^5.3.0" + "@ethersproject/strings" "^5.3.0" + +"@ethersproject/strings@5.3.0", "@ethersproject/strings@^5.3.0": + version "5.3.0" + resolved "https://registry.yarnpkg.com/@ethersproject/strings/-/strings-5.3.0.tgz#a6b640aab56a18e0909f657da798eef890968ff0" + integrity sha512-j/AzIGZ503cvhuF2ldRSjB0BrKzpsBMtCieDtn4TYMMZMQ9zScJn9wLzTQl/bRNvJbBE6TOspK0r8/Ngae/f2Q== + dependencies: + "@ethersproject/bytes" "^5.3.0" + "@ethersproject/constants" "^5.3.0" + "@ethersproject/logger" "^5.3.0" + +"@ethersproject/transactions@5.3.0", "@ethersproject/transactions@^5.3.0": + version "5.3.0" + resolved "https://registry.yarnpkg.com/@ethersproject/transactions/-/transactions-5.3.0.tgz#49b86f2bafa4d0bdf8e596578fc795ee47c50458" + integrity sha512-cdfK8VVyW2oEBCXhURG0WQ6AICL/r6Gmjh0e4Bvbv6MCn/GBd8FeBH3rtl7ho+AW50csMKeGv3m3K1HSHB2jMQ== + dependencies: + "@ethersproject/address" "^5.3.0" + "@ethersproject/bignumber" "^5.3.0" + "@ethersproject/bytes" "^5.3.0" + "@ethersproject/constants" "^5.3.0" + "@ethersproject/keccak256" "^5.3.0" + "@ethersproject/logger" "^5.3.0" + "@ethersproject/properties" "^5.3.0" + "@ethersproject/rlp" "^5.3.0" + "@ethersproject/signing-key" "^5.3.0" + +"@ethersproject/units@5.3.0": + version "5.3.0" + resolved "https://registry.yarnpkg.com/@ethersproject/units/-/units-5.3.0.tgz#c4d1493532ad3d4ddf6e2bc4f8c94a2db933a8f5" + integrity sha512-BkfccZGwfJ6Ob+AelpIrgAzuNhrN2VLp3AILnkqTOv+yBdsc83V4AYf25XC/u0rHnWl6f4POaietPwlMqP2vUg== + dependencies: + "@ethersproject/bignumber" "^5.3.0" + "@ethersproject/constants" "^5.3.0" + "@ethersproject/logger" "^5.3.0" + +"@ethersproject/wallet@5.3.0": + version "5.3.0" + resolved "https://registry.yarnpkg.com/@ethersproject/wallet/-/wallet-5.3.0.tgz#91946b470bd279e39ade58866f21f92749d062af" + integrity sha512-boYBLydG6671p9QoG6EinNnNzbm7DNOjVT20eV8J6HQEq4aUaGiA2CytF2vK+2rOEWbzhZqoNDt6AlkE1LlsTg== + dependencies: + "@ethersproject/abstract-provider" "^5.3.0" + "@ethersproject/abstract-signer" "^5.3.0" + "@ethersproject/address" "^5.3.0" + "@ethersproject/bignumber" "^5.3.0" + "@ethersproject/bytes" "^5.3.0" + "@ethersproject/hash" "^5.3.0" + "@ethersproject/hdnode" "^5.3.0" + "@ethersproject/json-wallets" "^5.3.0" + "@ethersproject/keccak256" "^5.3.0" + "@ethersproject/logger" "^5.3.0" + "@ethersproject/properties" "^5.3.0" + "@ethersproject/random" "^5.3.0" + "@ethersproject/signing-key" "^5.3.0" + "@ethersproject/transactions" "^5.3.0" + "@ethersproject/wordlists" "^5.3.0" + +"@ethersproject/web@5.3.0", "@ethersproject/web@^5.3.0": + version "5.3.0" + resolved "https://registry.yarnpkg.com/@ethersproject/web/-/web-5.3.0.tgz#7959c403f6476c61515008d8f92da51c553a8ee1" + integrity sha512-Ni6/DHnY6k/TD41LEkv0RQDx4jqWz5e/RZvrSecsxGYycF+MFy2z++T/yGc2peRunLOTIFwEksgEGGlbwfYmhQ== + dependencies: + "@ethersproject/base64" "^5.3.0" + "@ethersproject/bytes" "^5.3.0" + "@ethersproject/logger" "^5.3.0" + "@ethersproject/properties" "^5.3.0" + "@ethersproject/strings" "^5.3.0" + +"@ethersproject/wordlists@5.3.0", "@ethersproject/wordlists@^5.3.0": + version "5.3.0" + resolved "https://registry.yarnpkg.com/@ethersproject/wordlists/-/wordlists-5.3.0.tgz#45a0205f5178c1de33d316cb2ab7ed5eac3c06c5" + integrity sha512-JcwumCZcsUxgWpiFU/BRy6b4KlTRdOmYvOKZcAw/3sdF93/pZyPW5Od2hFkHS8oWp4xS06YQ+qHqQhdcxdHafQ== + dependencies: + "@ethersproject/bytes" "^5.3.0" + "@ethersproject/hash" "^5.3.0" + "@ethersproject/logger" "^5.3.0" + "@ethersproject/properties" "^5.3.0" + "@ethersproject/strings" "^5.3.0" "@jest/types@^26.6.2": version "26.6.2" @@ -1511,17 +1297,17 @@ dependencies: commander "^2.20.0" -"@ledgerhq/cryptoassets@6.1.0", "@ledgerhq/cryptoassets@^6.1.0": - version "6.1.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/cryptoassets/-/cryptoassets-6.1.0.tgz#46b04f8928461653179663fef096b59a842add37" - integrity sha512-4j5vXxvbGjPdUK9x3UaMR04DfmSjXYnq7Dhg8IN+9DqJnvFyKHzcrj57hLw3w5amJZPa89OEukFJCe52G4rsZA== +"@ledgerhq/cryptoassets@6.0.2", "@ledgerhq/cryptoassets@^6.0.2": + version "6.0.2" + resolved "https://registry.yarnpkg.com/@ledgerhq/cryptoassets/-/cryptoassets-6.0.2.tgz#52efb7d017722ad7806c98c5d4e9887ed54ab744" + integrity sha512-vBG4GFFhMNTt+Y9GRNCZVAH9SzzzL/GEOXA4dJ/rPwCgz9nxymTCtkJugK4KCzdyFwp6U1X+7s7BOz1F0bnu8g== dependencies: invariant "2" -"@ledgerhq/devices@6.1.0", "@ledgerhq/devices@^6.1.0": - version "6.1.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/devices/-/devices-6.1.0.tgz#54963409011c0bb83e2cc3d4d55ad9b905e296ff" - integrity sha512-Swl08sVuvx7IL9yx9P0ZzvwjIl4JXl51X34Po3pT2uRRaLnh/fRRSNe9tSC1gFMioviiLJlkmO+yydE4XeV+Jg== +"@ledgerhq/devices@6.0.2", "@ledgerhq/devices@^6.0.2": + version "6.0.2" + resolved "https://registry.yarnpkg.com/@ledgerhq/devices/-/devices-6.0.2.tgz#cbf730368f00ddb5a4384f73bb4966371aa2a4c3" + integrity sha512-xR4RYXltXISH4Vf7bLgiaIRy4W3F+kvDXYhXY7Q72goR4NA+vAosuRLGFQZIQiuZZMdPCIbXHuysj07z/NsEpA== dependencies: "@ledgerhq/errors" "^6.0.2" "@ledgerhq/logs" "^6.0.2" @@ -1533,21 +1319,21 @@ resolved "https://registry.yarnpkg.com/@ledgerhq/errors/-/errors-6.0.2.tgz#7c88d16620db08c96de6a2636440db1c0e541da1" integrity sha512-m42ZMzR/EKpOrZfPR3DzusE98DoF3d03cbBkQG6ddm6diwVXFSa7MabaKzgD+41EYQ+hrCGOEZK1K0kosX1itg== -"@ledgerhq/hw-app-algorand@6.1.0": - version "6.1.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-algorand/-/hw-app-algorand-6.1.0.tgz#e1c653de33fc144249f6ce406c4df5c51c2b273b" - integrity sha512-TKNpCb3iBU8SIG5cIA3H9mEyWftO5UYrieKVVckXRdObKGKvVwhGTy512O3DibdR/wwBAskIkGnHdRWBnCb6kA== +"@ledgerhq/hw-app-algorand@6.0.2": + version "6.0.2" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-algorand/-/hw-app-algorand-6.0.2.tgz#b13487bccbed67d9ad4cda99133ca41d39e87158" + integrity sha512-0HDzIvazqu/fSWitGtDZyAPNKR7FFrhDGHMcAILURaeZux+OojQ0pEdh9yBKWMfi4drAyqRLX7tsXEy6HB+nEg== dependencies: "@ledgerhq/errors" "^6.0.2" - "@ledgerhq/hw-transport" "^6.1.0" + "@ledgerhq/hw-transport" "^6.0.2" bip32-path "^0.4.2" -"@ledgerhq/hw-app-btc@6.1.0": - version "6.1.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-btc/-/hw-app-btc-6.1.0.tgz#a7ecc3e9a2ab4eddab73edde94cb8b49176e6bf4" - integrity sha512-lt11cdeuoB62xcUuhe5u3ZJcRM5APbb2hFdzk2N8xdMoJ8wI0vBYvLdM+hhZXzePTtVU/Bxdp3cs/UeDyBrxSg== +"@ledgerhq/hw-app-btc@6.0.2": + version "6.0.2" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-btc/-/hw-app-btc-6.0.2.tgz#0cf125d3d8e60e7e7225e8e7c0e3491d60effeed" + integrity sha512-CODHZ0hy0VuKo2xn8ADpPyKIG4ge1kQz+Q+XXQgfJEE/ZOYpT0R9nOfR974Ocif44Q9u/k0QAbuD9Q9w2STMUg== dependencies: - "@ledgerhq/hw-transport" "^6.1.0" + "@ledgerhq/hw-transport" "^6.0.2" "@ledgerhq/logs" "^6.0.2" bip32-path "^0.4.2" invariant "^2.2.4" @@ -1555,132 +1341,140 @@ semver "^7.3.5" sha.js "2" -"@ledgerhq/hw-app-cosmos@6.1.0": - version "6.1.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-cosmos/-/hw-app-cosmos-6.1.0.tgz#da429847645596be618f636ef32775aa40a0008b" - integrity sha512-0hoDGRQAc8G4Rim77fKqiV+RlXP3JUWlpu6U2Ch7EUAhhqB91/mpqjRcFiwLNLNrdxtYLS7nIF/LBDdGzU08Ag== +"@ledgerhq/hw-app-cosmos@6.0.2": + version "6.0.2" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-cosmos/-/hw-app-cosmos-6.0.2.tgz#1402ad306d3d3af562d3e91c61b69d3a7f57f873" + integrity sha512-BQ8e7NjzIWhVg8TR9GQvcsM3YnHL6/t82IrlQ6jCbnvkijpw/gYie6YLIvXaxojbH15hNgAtIsN2fjqIoLtPXQ== dependencies: "@ledgerhq/errors" "^6.0.2" - "@ledgerhq/hw-transport" "^6.1.0" + "@ledgerhq/hw-transport" "^6.0.2" bip32-path "^0.4.2" -"@ledgerhq/hw-app-eth@6.1.0": - version "6.1.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-eth/-/hw-app-eth-6.1.0.tgz#1aeddd9d61bdfb04ec51d6cb666043feea208741" - integrity sha512-vWWSMcV5I+xzgQZlRpcX/8lTMyE7MylsuAMcaio8gLf+BbNA94ti5+aJLmJH8Dyh4bSSgbbYhVpdsbCL/i0zlQ== +"@ledgerhq/hw-app-eth@6.0.2": + version "6.0.2" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-eth/-/hw-app-eth-6.0.2.tgz#d2e26756c084322643a9cc21f4b9c59cb7d72766" + integrity sha512-vAkn/cod5qucPI2D59uRpOXq/cmbXf96GCuaXQWCOEjMhENe+k/be6RuHh8TVah9fAWunBmcPHyLVeHj1oVSCA== dependencies: - "@ledgerhq/cryptoassets" "^6.1.0" + "@ledgerhq/cryptoassets" "^6.0.2" "@ledgerhq/errors" "^6.0.2" - "@ledgerhq/hw-transport" "^6.1.0" + "@ledgerhq/hw-transport" "^6.0.2" "@ledgerhq/logs" "^6.0.2" bignumber.js "^9.0.1" - ethers "^5.4.1" + ethers "^5.2.0" -"@ledgerhq/hw-app-polkadot@6.1.0": - version "6.1.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-polkadot/-/hw-app-polkadot-6.1.0.tgz#6b431099c595f9bbd3103a7de950e88b6cd2b8c1" - integrity sha512-EVLvd7gM7WjU366GBxCI60T6avkModHf0fCV8lNrO7BrTx1dx1EGttUOiMsFzVj5du81SwM2TOdPpES59Mo4zQ== +"@ledgerhq/hw-app-polkadot@6.0.2": + version "6.0.2" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-polkadot/-/hw-app-polkadot-6.0.2.tgz#1986a519d26ca3029646f0f83230cacee708ce85" + integrity sha512-OeQNSVfgFVcKAMGOJGCevUobgpjt9ByhG19/fZa5Av7f/KJFbItj5NctwvweH+W9sZJXFHCetHxwe6APuPNhkA== dependencies: "@ledgerhq/errors" "^6.0.2" - "@ledgerhq/hw-transport" "^6.1.0" + "@ledgerhq/hw-transport" "^6.0.2" bip32-path "^0.4.2" -"@ledgerhq/hw-app-str@6.1.0": - version "6.1.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-str/-/hw-app-str-6.1.0.tgz#ab285821bf89ad4d21ae29e067abfe718416ca71" - integrity sha512-JipovJkRc9Qm+64VHxNyQxL/8+V5Fhxefxvg9f8rZvq2fLf4OHbC2w6ic3ZqIrjK6/fafrOT8JCrBX4ifi14fg== +"@ledgerhq/hw-app-str@6.0.2": + version "6.0.2" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-str/-/hw-app-str-6.0.2.tgz#dfbd0c67acdd09befd24661c06bd632cd927f342" + integrity sha512-+VSIZzeJ7F9pU19TH74XjrjUYoGLYQ9DS1s9bGCvCep0Vd061dtXZwNhmnu7gWYKRHvLkEEMDZQHdARByHqR0w== dependencies: - "@ledgerhq/hw-transport" "^6.1.0" + "@ledgerhq/hw-transport" "^6.0.2" base32.js "^0.1.0" sha.js "^2.3.6" tweetnacl "^1.0.3" -"@ledgerhq/hw-app-tezos@6.1.0": - version "6.1.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-tezos/-/hw-app-tezos-6.1.0.tgz#9beeb347eb4cb8a0346a80387929074249cf500f" - integrity sha512-YZPwyZnCA8nx1MRqx4nkdILyrn54rPxTO6C9qlC3jTPCqYfPTbrJ0RxZWyPp1A6Jpz1s6XLA1s1UW1ZINIq5bA== +"@ledgerhq/hw-app-tezos@6.0.2": + version "6.0.2" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-tezos/-/hw-app-tezos-6.0.2.tgz#7086a10227c3f570ed25374b2d1f3589ce7eefc0" + integrity sha512-BMCd1r12I1RcqMZAa0RitL/jQxrLAr8AoFIW7L+0wehMHnppFghiBiMXa6VNs05diXd+lxOTkG7oyKd0Ax/3Og== dependencies: - "@ledgerhq/hw-transport" "^6.1.0" + "@ledgerhq/hw-transport" "^6.0.2" blake2b "^2.1.3" bs58check "^2.1.2" invariant "^2.2.4" -"@ledgerhq/hw-app-trx@6.1.0": - version "6.1.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-trx/-/hw-app-trx-6.1.0.tgz#5e2b5f869db07cb1850bdc28dd02abcdf1e71537" - integrity sha512-fcA59hle9Ah495xe3K+42A70wrn1Yp5scGF0yiKXbXTLAWq95Dkjo7Aohza1ev6o/IN7g9rxGjJoIuVgAalS/g== +"@ledgerhq/hw-app-trx@6.0.2": + version "6.0.2" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-trx/-/hw-app-trx-6.0.2.tgz#0a0749b0690effb7c57380bc5da97ab00a27bd52" + integrity sha512-cI4UnVYb6nlj3QfxB9kSOmf5ViH4p+ZFIvduU0iovnG9P+ynqd13ls2rtju6mobC1/aVk0TCx8n2I1jBrSUgGA== dependencies: "@ledgerhq/errors" "^6.0.2" - "@ledgerhq/hw-transport" "^6.1.0" + "@ledgerhq/hw-transport" "^6.0.2" -"@ledgerhq/hw-app-xrp@6.1.0": - version "6.1.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-xrp/-/hw-app-xrp-6.1.0.tgz#2d20bd5fd2a3b3fe196e756b95dcf63a7357b307" - integrity sha512-WXlEdfIpuLlr3l/xV6FfFmf6Lp/d5T3Dal7E2twyVWy39AHVEuw5vUdY+A7hcbZuZL0M8EKXdKjwKDKMU6f2qQ== +"@ledgerhq/hw-app-xrp@6.0.2": + version "6.0.2" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-xrp/-/hw-app-xrp-6.0.2.tgz#c7470b68c40e3844641fd38a5349ec4da5257955" + integrity sha512-VlBUqSUJfE2ITBuwJSqfft9IPShVzGMaKJnSavyL/pHsK37e2zBbcth9GyeiKUVs+276gJsDJWM/HsD68359NA== dependencies: - "@ledgerhq/hw-transport" "^6.1.0" + "@ledgerhq/hw-transport" "^6.0.2" bip32-path "0.4.2" -"@ledgerhq/hw-transport-http@6.1.0": - version "6.1.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-http/-/hw-transport-http-6.1.0.tgz#ede66296ab73d83ddb9165f5f21baaebcc29fdeb" - integrity sha512-thpVSA+r4xndZ1bweYL6XVt1C2JOBFyDXF31aqhGDKJih/tF+Sm+2swoS8d+ZCYJrk4sfdQTiq1T52V5oYLmDw== +"@ledgerhq/hw-transport-http@6.0.2": + version "6.0.2" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-http/-/hw-transport-http-6.0.2.tgz#a2a29b4cc218736e0a5a4342015dec995dd35c0e" + integrity sha512-OYMSrQa5MWAftf2/54AYUs41Mzr51trx5MCMAgsr/V7Wg17fQlsSxEB07NckqYMZX3uSvQDvqIs/m6T+ioMH7g== dependencies: "@ledgerhq/errors" "^6.0.2" - "@ledgerhq/hw-transport" "^6.1.0" + "@ledgerhq/hw-transport" "^6.0.2" "@ledgerhq/logs" "^6.0.2" axios "^0.21.1" ws "7" -"@ledgerhq/hw-transport-mocker@6.1.0": - version "6.1.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-mocker/-/hw-transport-mocker-6.1.0.tgz#78d35fe1d424c5350fe79d996c876bc57d71972b" - integrity sha512-/UWP26fvoP+fT0Z9TzD/j/+nsmSQx3tsLN4x7sCYwdnur6CprdehtRIr9xbnDqZemGrddd/2sqyNiNAb3Ml5Iw== +"@ledgerhq/hw-transport-mocker@6.0.0": + version "6.0.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-mocker/-/hw-transport-mocker-6.0.0.tgz#ff67f373471294d863b62aa921b13095ca09157c" + integrity sha512-E10nlHEMN5Qopxgkq90Za4n/0ZkOBItxlelL05fm4H26vgNKvz4hi+Ec1OejG3qckef12Zjw5ufbKEq2cfV8sA== + dependencies: + "@ledgerhq/hw-transport" "^6.0.0" + "@ledgerhq/logs" "^6.0.0" + +"@ledgerhq/hw-transport-mocker@6.0.2": + version "6.0.2" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-mocker/-/hw-transport-mocker-6.0.2.tgz#7473b5fe60160dffd4b501a7af7e7ce0c4821219" + integrity sha512-ydd78CDXZjfV+MLynw5B7uinonKTMdBq5i3Ae478mU7YmJN7blUFQne4GEMPHkbW4Tx6iZGeT/rmbOPalnKwRw== dependencies: - "@ledgerhq/hw-transport" "^6.1.0" + "@ledgerhq/hw-transport" "^6.0.2" "@ledgerhq/logs" "^6.0.2" -"@ledgerhq/hw-transport-node-hid-noevents@^6.1.0": - version "6.1.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-node-hid-noevents/-/hw-transport-node-hid-noevents-6.1.0.tgz#b894dbe07234eb2a7a6751b1a298d00758b91731" - integrity sha512-U7VFaLIG46ohe92N7ZXqgJSLuIWTPXS6BxT+K45VIkHr/OZYlJhtrI/5Ly3FOUOnWsI+O7QCg/yTBdEkfVSfRw== +"@ledgerhq/hw-transport-node-hid-noevents@^6.0.2": + version "6.0.2" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-node-hid-noevents/-/hw-transport-node-hid-noevents-6.0.2.tgz#c2fcc1fd21c82dcda5fb031ef3b45c162d0eee98" + integrity sha512-qLqYDngATMU/D8fihIPCy5yaKJUGSHO0xunaDLUsj6nJP54DNDk7O9T0XMMsN6+RfeH0WLybNzSLubIS+mpj8w== dependencies: - "@ledgerhq/devices" "^6.1.0" + "@ledgerhq/devices" "^6.0.2" "@ledgerhq/errors" "^6.0.2" - "@ledgerhq/hw-transport" "^6.1.0" + "@ledgerhq/hw-transport" "^6.0.2" "@ledgerhq/logs" "^6.0.2" node-hid "2.1.1" -"@ledgerhq/hw-transport-node-hid@6.1.0": - version "6.1.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-node-hid/-/hw-transport-node-hid-6.1.0.tgz#b8fff70c96f53af65aaab3d425c4ef33b1c18c88" - integrity sha512-WmVkc/bOKxnesv3wadooNVdWR2lRhti5asn6kw7OstRNOAXlSgYyPexLsliCfIe9APwOSt+S5SDci+oEh8Oh/Q== +"@ledgerhq/hw-transport-node-hid@6.0.2": + version "6.0.2" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-node-hid/-/hw-transport-node-hid-6.0.2.tgz#7e0c0f8dedceff8cbeea2214bd91b2a1338f08c1" + integrity sha512-kLOl3opTWNEhCBPX6FGuTF9b7MmnU0CHVNEBrQExoc2GESDRIgKpISbDhVEL0ZTtLj8jw4UVouhoE5KZOOpCyA== dependencies: - "@ledgerhq/devices" "^6.1.0" + "@ledgerhq/devices" "^6.0.2" "@ledgerhq/errors" "^6.0.2" - "@ledgerhq/hw-transport" "^6.1.0" - "@ledgerhq/hw-transport-node-hid-noevents" "^6.1.0" + "@ledgerhq/hw-transport" "^6.0.2" + "@ledgerhq/hw-transport-node-hid-noevents" "^6.0.2" "@ledgerhq/logs" "^6.0.2" lodash "^4.17.21" node-hid "2.1.1" usb "^1.7.0" -"@ledgerhq/hw-transport-node-speculos@6.1.0": - version "6.1.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-node-speculos/-/hw-transport-node-speculos-6.1.0.tgz#777f1223e25f22168387298a863d253ac539e78d" - integrity sha512-6dyxe9iQNcRJRrjRHv1unuVl+rWBp8oAvX477EYGdoEPLqA0+IDRncwbUCxsxkK+5eD84Azx1rAj/64k+UWUzQ== +"@ledgerhq/hw-transport-node-speculos@6.0.2": + version "6.0.2" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-node-speculos/-/hw-transport-node-speculos-6.0.2.tgz#25dde72fbd8754891b7fec4ddf5a8175e2395407" + integrity sha512-UuQZ13gLbHtRvuL2H2RDNF3z8RVbDpA3WXrBz1Y3uFVFXHXZkr/XsZJ0kibXrBvtGt/T0vOq2/KhoNPe5zjYZw== dependencies: "@ledgerhq/errors" "^6.0.2" - "@ledgerhq/hw-transport" "^6.1.0" + "@ledgerhq/hw-transport" "^6.0.2" "@ledgerhq/logs" "^6.0.2" rxjs "6" -"@ledgerhq/hw-transport@6.1.0", "@ledgerhq/hw-transport@^6.1.0": - version "6.1.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport/-/hw-transport-6.1.0.tgz#b50151c6199e9ad6d3ab9e447532a22170c9f3b7" - integrity sha512-j9IyvksI9PjFoFrk/B3p8wCXWRWc8uK24gc20pAaXQiDtqMkWqEge8iZyPKWBVIv69vDQF3LE3Y6EeRwwA7wJA== +"@ledgerhq/hw-transport@6.0.2", "@ledgerhq/hw-transport@^6.0.0", "@ledgerhq/hw-transport@^6.0.2": + version "6.0.2" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport/-/hw-transport-6.0.2.tgz#5b3a0cb01eb6adbd876916bc7d566226e505d333" + integrity sha512-JI8bhs0vQW1pjDeZ8/Cv/OT4iejH2F3j0i5z5mGNkSgs179GiGeM81EhStLB0XuXqxWpFZMnZ97/Cdo0XmffrA== dependencies: - "@ledgerhq/devices" "^6.1.0" + "@ledgerhq/devices" "^6.0.2" "@ledgerhq/errors" "^6.0.2" events "^3.3.0" @@ -1695,32 +1489,31 @@ node-pre-gyp "^0.17.0" node-pre-gyp-github "^1.4.3" -"@ledgerhq/live-common@^20.3.0": - version "20.3.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/live-common/-/live-common-20.3.0.tgz#1cf3d0afd147d2bf78acaed24dce7f92eaa107d3" - integrity sha512-fmFy4Cz8p0xkP+VBXX0BkScHZDVgQ4ViDFiFOtRoBRGF2YZJnpBKh60MvSf1qnfAH2RutliTnsDMzs5hspv9Fw== +"@ledgerhq/live-common@^19.12.0-rc.2": + version "19.12.0-rc.2" + resolved "https://registry.yarnpkg.com/@ledgerhq/live-common/-/live-common-19.12.0-rc.2.tgz#9d59c42012f6f49ca7c98344a80f47d515d7c209" + integrity sha512-PwTSic0DBwycqdD8o/oVZtaeIx+TDbO/YGxIFIivTDoEHEcfDrXPloDZJOWOl1t/d3T5Es/cFPflpsS/SOVblQ== dependencies: - "@crypto-com/chain-jslib" "^0.0.16" "@ledgerhq/compressjs" "1.3.2" - "@ledgerhq/cryptoassets" "6.1.0" - "@ledgerhq/devices" "6.1.0" + "@ledgerhq/cryptoassets" "6.0.2" + "@ledgerhq/devices" "6.0.2" "@ledgerhq/errors" "6.0.2" - "@ledgerhq/hw-app-algorand" "6.1.0" - "@ledgerhq/hw-app-btc" "6.1.0" - "@ledgerhq/hw-app-cosmos" "6.1.0" - "@ledgerhq/hw-app-eth" "6.1.0" - "@ledgerhq/hw-app-polkadot" "6.1.0" - "@ledgerhq/hw-app-str" "6.1.0" - "@ledgerhq/hw-app-tezos" "6.1.0" - "@ledgerhq/hw-app-trx" "6.1.0" - "@ledgerhq/hw-app-xrp" "6.1.0" - "@ledgerhq/hw-transport" "6.1.0" - "@ledgerhq/hw-transport-mocker" "6.1.0" - "@ledgerhq/hw-transport-node-speculos" "6.1.0" + "@ledgerhq/hw-app-algorand" "6.0.2" + "@ledgerhq/hw-app-btc" "6.0.2" + "@ledgerhq/hw-app-cosmos" "6.0.2" + "@ledgerhq/hw-app-eth" "6.0.2" + "@ledgerhq/hw-app-polkadot" "6.0.2" + "@ledgerhq/hw-app-str" "6.0.2" + "@ledgerhq/hw-app-tezos" "6.0.2" + "@ledgerhq/hw-app-trx" "6.0.2" + "@ledgerhq/hw-app-xrp" "6.0.2" + "@ledgerhq/hw-transport" "6.0.2" + "@ledgerhq/hw-transport-mocker" "6.0.2" + "@ledgerhq/hw-transport-node-speculos" "6.0.2" "@ledgerhq/logs" "6.0.2" - "@polkadot/types" "4.17.1" + "@polkadot/types" "3.11.1" "@walletconnect/client" "1.4.1" - "@xstate/react" "^1.5.1" + "@xstate/react" "^1.3.4" async "^3.2.0" axios "0.21.1" bchaddrjs "^0.5.2" @@ -1750,7 +1543,7 @@ ripemd160 "^2.0.2" ripple-binary-codec "^1.1.3" ripple-bs58check "^2.0.2" - ripple-lib "1.9.6" + ripple-lib "1.9.5" rxjs "6" rxjs-compat "^6.6.7" secp256k1 "^4.0.2" @@ -1759,22 +1552,22 @@ stellar-sdk "^8.2.2" triple-beam "^1.3.0" winston "^3.3.3" - xstate "^4.22.0" + xstate "^4.20.0" -"@ledgerhq/logs@6.0.2", "@ledgerhq/logs@^6.0.2": +"@ledgerhq/logs@6.0.2", "@ledgerhq/logs@^6.0.0", "@ledgerhq/logs@^6.0.2": version "6.0.2" resolved "https://registry.yarnpkg.com/@ledgerhq/logs/-/logs-6.0.2.tgz#a6063ed99461c0d2c36a48de89ed0283f13cb908" integrity sha512-4lU3WBwugG+I/dv/qE8HQ2f7MNsKfU58FEzSE1PAELvW96umrlO4ogwuO1tRCPmrtOo9ssam1QVYotwELY8zvw== -"@nicolo-ribaudo/chokidar-2@2.1.8-no-fsevents.2": - version "2.1.8-no-fsevents.2" - resolved "https://registry.yarnpkg.com/@nicolo-ribaudo/chokidar-2/-/chokidar-2-2.1.8-no-fsevents.2.tgz#e324c0a247a5567192dd7180647709d7e2faf94b" - integrity sha512-Fb8WxUFOBQVl+CX4MWet5o7eCc6Pj04rXIwVKZ6h1NnqTo45eOQW6aWyhG25NIODvWFwTDMwBsYxrQ3imxpetg== +"@nicolo-ribaudo/chokidar-2@2.1.8-no-fsevents": + version "2.1.8-no-fsevents" + resolved "https://registry.yarnpkg.com/@nicolo-ribaudo/chokidar-2/-/chokidar-2-2.1.8-no-fsevents.tgz#da7c3996b8e6e19ebd14d82eaced2313e7769f9b" + integrity sha512-+nb9vWloHNNMFHjGofEam3wopE3m1yuambrrd/fnPc+lFOMB9ROTqQlche9ByFWNkdNqfSgR/kkQtQ8DzEWt2w== dependencies: anymatch "^2.0.0" async-each "^1.0.1" braces "^2.3.2" - glob-parent "^5.1.2" + glob-parent "^3.1.0" inherits "^2.0.3" is-binary-path "^1.0.0" is-glob "^4.0.0" @@ -1912,58 +1705,62 @@ hash.js "^1.1.7" randombytes "^2.1.0" -"@polkadot/metadata@4.17.1": - version "4.17.1" - resolved "https://registry.yarnpkg.com/@polkadot/metadata/-/metadata-4.17.1.tgz#4da9ee5b2b816493910abfd302a50b58141ceca2" - integrity sha512-219isiCWVfbu5JxZnOPj+cV4T+S0XHS4+Jal3t3xz9y4nbgr+25Pa4KInEsJPx0u8EZAxMeiUCX3vd5U7oe72g== +"@polkadot/metadata@3.11.1": + version "3.11.1" + resolved "https://registry.yarnpkg.com/@polkadot/metadata/-/metadata-3.11.1.tgz#c3e9645f6f78c8e02e0da695f3718b9d69f450a8" + integrity sha512-Z3KtOTX2kU+vvbRDiGY+qyPpF/4xTpnUipoNGijIGQ/EWWcgrm8sSgPzZQhHCfgIqM+jq3g9GvPMYeQp2Yy3ng== dependencies: - "@babel/runtime" "^7.14.6" - "@polkadot/types" "4.17.1" - "@polkadot/types-known" "4.17.1" - "@polkadot/util" "^6.11.1" - "@polkadot/util-crypto" "^6.11.1" + "@babel/runtime" "^7.13.8" + "@polkadot/types" "3.11.1" + "@polkadot/types-known" "3.11.1" + "@polkadot/util" "^5.9.2" + "@polkadot/util-crypto" "^5.9.2" + bn.js "^4.11.9" -"@polkadot/networks@6.11.1", "@polkadot/networks@^6.11.1": - version "6.11.1" - resolved "https://registry.yarnpkg.com/@polkadot/networks/-/networks-6.11.1.tgz#8fd189593f6ee4f8bf64378d0aaae09e39a37d35" - integrity sha512-0C6Ha2kvr42se3Gevx6UhHzv3KnPHML0N73Amjwvdr4y0HLZ1Nfw+vcm5yqpz5gpiehqz97XqFrsPRauYdcksQ== +"@polkadot/networks@5.9.2", "@polkadot/networks@^5.9.2": + version "5.9.2" + resolved "https://registry.yarnpkg.com/@polkadot/networks/-/networks-5.9.2.tgz#c687525b5886c9418f75240afe22b562ed88e2dd" + integrity sha512-JQyXJDJTZKQtn8y3HBHWDhiBfijhpiXjVEhY+fKvFcQ82TaKmzhnipYX0EdBoopZbuxpn/BJy6Y1Y/3y85EC+g== dependencies: - "@babel/runtime" "^7.14.6" + "@babel/runtime" "^7.13.8" -"@polkadot/types-known@4.17.1": - version "4.17.1" - resolved "https://registry.yarnpkg.com/@polkadot/types-known/-/types-known-4.17.1.tgz#71c18dda4967a13ec34fbbf0c4ef264e882c2688" - integrity sha512-YkOwGrO+k9aVrBR8FgYHnfJKhOfpdgC5ZRYNL/xJ9oa7lBYqPts9ENAxeBmJS/5IGeDF9f32MNyrCP2umeCXWg== +"@polkadot/types-known@3.11.1": + version "3.11.1" + resolved "https://registry.yarnpkg.com/@polkadot/types-known/-/types-known-3.11.1.tgz#f695c9155fa54eeed95cea179bb8cb2398726bd3" + integrity sha512-ImAxyCdqblmlXaMlgvuXZ6wzZgOYgE40FgWaYRJpFXRGJLDwtcJcpVI+7m/ns5dJ3WujboEMOHVR1HPpquw8Jw== dependencies: - "@babel/runtime" "^7.14.6" - "@polkadot/networks" "^6.11.1" - "@polkadot/types" "4.17.1" - "@polkadot/util" "^6.11.1" + "@babel/runtime" "^7.13.8" + "@polkadot/networks" "^5.9.2" + "@polkadot/types" "3.11.1" + "@polkadot/util" "^5.9.2" + bn.js "^4.11.9" -"@polkadot/types@4.17.1": - version "4.17.1" - resolved "https://registry.yarnpkg.com/@polkadot/types/-/types-4.17.1.tgz#41d43621d53820ee930ba4036bfa8b16cf98ca6f" - integrity sha512-rjW4OFdwvFekzN3ATLibC2JPSd8AWt5YepJhmuCPdwH26r3zB8bEC6dM7YQExLVUmygVPvgXk5ffHI6RAdXBMg== - dependencies: - "@babel/runtime" "^7.14.6" - "@polkadot/metadata" "4.17.1" - "@polkadot/util" "^6.11.1" - "@polkadot/util-crypto" "^6.11.1" - "@polkadot/x-rxjs" "^6.11.1" - -"@polkadot/util-crypto@^6.11.1": - version "6.11.1" - resolved "https://registry.yarnpkg.com/@polkadot/util-crypto/-/util-crypto-6.11.1.tgz#7a36acf5c8bf52541609ec0b0b2a69af295d652e" - integrity sha512-fWA1Nz17FxWJslweZS4l0Uo30WXb5mYV1KEACVzM+BSZAvG5eoiOAYX6VYZjyw6/7u53XKrWQlD83iPsg3KvZw== - dependencies: - "@babel/runtime" "^7.14.6" - "@polkadot/networks" "6.11.1" - "@polkadot/util" "6.11.1" - "@polkadot/wasm-crypto" "^4.0.2" - "@polkadot/x-randomvalues" "6.11.1" +"@polkadot/types@3.11.1": + version "3.11.1" + resolved "https://registry.yarnpkg.com/@polkadot/types/-/types-3.11.1.tgz#c0188390dfda84d746d57f7818ad622ac6b1de8b" + integrity sha512-+BWsmveYVkLFx/csvPmU+NhNFhf+0srAt2d0f+7y663nitc/sng1AcEDPbrbXHSQVyPdvI20Mh4Escl4aR+TLw== + dependencies: + "@babel/runtime" "^7.13.8" + "@polkadot/metadata" "3.11.1" + "@polkadot/util" "^5.9.2" + "@polkadot/util-crypto" "^5.9.2" + "@polkadot/x-rxjs" "^5.9.2" + "@types/bn.js" "^4.11.6" + bn.js "^4.11.9" + +"@polkadot/util-crypto@^5.9.2": + version "5.9.2" + resolved "https://registry.yarnpkg.com/@polkadot/util-crypto/-/util-crypto-5.9.2.tgz#3858cfffe7732458b4a2b38ece01eaf52a3746c2" + integrity sha512-d8CW2grI3gWi6d/brmcZQWaMPHqQq5z7VcM74/v8D2KZ+hPYL3B0Jn8zGL1vtgMz2qdpWrZdAe89LBC8BvM9bw== + dependencies: + "@babel/runtime" "^7.13.8" + "@polkadot/networks" "5.9.2" + "@polkadot/util" "5.9.2" + "@polkadot/wasm-crypto" "^3.2.4" + "@polkadot/x-randomvalues" "5.9.2" base-x "^3.0.8" base64-js "^1.5.1" - blakejs "^1.1.1" + blakejs "^1.1.0" bn.js "^4.11.9" create-hash "^1.2.0" elliptic "^6.5.4" @@ -1973,133 +1770,82 @@ tweetnacl "^1.0.3" xxhashjs "^0.2.2" -"@polkadot/util@6.11.1", "@polkadot/util@^6.11.1": - version "6.11.1" - resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-6.11.1.tgz#8950b038ba3e6ebfc0a7ff47feeb972e81b2626c" - integrity sha512-TEdCetr9rsdUfJZqQgX/vxLuV4XU8KMoKBMJdx+JuQ5EWemIdQkEtMBdL8k8udNGbgSNiYFA6rPppATeIxAScg== +"@polkadot/util@5.9.2", "@polkadot/util@^5.9.2": + version "5.9.2" + resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-5.9.2.tgz#ad2494e78ca6c3aadd6fb394a6be55020dc9b2a8" + integrity sha512-p225NJusnXeu7i2iAb8HAGWiMOUAnRaIyblIjJ4F89ZFZZ4amyliGxe5gKcyjRgxAJ44WdKyBLl/8L3rNv8hmQ== dependencies: - "@babel/runtime" "^7.14.6" - "@polkadot/x-textdecoder" "6.11.1" - "@polkadot/x-textencoder" "6.11.1" + "@babel/runtime" "^7.13.8" + "@polkadot/x-textdecoder" "5.9.2" + "@polkadot/x-textencoder" "5.9.2" "@types/bn.js" "^4.11.6" bn.js "^4.11.9" camelcase "^5.3.1" ip-regex "^4.3.0" -"@polkadot/wasm-crypto-asmjs@^4.0.2": - version "4.0.2" - resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-asmjs/-/wasm-crypto-asmjs-4.0.2.tgz#f42c353a64e1243841daf90e4bd54eff01a4e3cf" - integrity sha512-hlebqtGvfjg2ZNm4scwBGVHwOwfUhy2yw5RBHmPwkccUif3sIy4SAzstpcVBIVMdAEvo746bPWEInA8zJRcgJA== - dependencies: - "@babel/runtime" "^7.13.9" - -"@polkadot/wasm-crypto-wasm@^4.0.2": - version "4.0.2" - resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-wasm/-/wasm-crypto-wasm-4.0.2.tgz#89f9e0a1e4d076784d4a42bea37fc8b06bdd8bb6" - integrity sha512-de/AfNPZ0uDKFWzOZ1rJCtaUbakGN29ks6IRYu6HZTRg7+RtqvE1rIkxabBvYgQVHIesmNwvEA9DlIkS6hYRFQ== +"@polkadot/wasm-crypto-asmjs@^3.2.4": + version "3.2.4" + resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-asmjs/-/wasm-crypto-asmjs-3.2.4.tgz#837f5b723161b21670d13779eff4c061f7947577" + integrity sha512-fgN26iL+Pbb35OYsDIRHC74Xnwde+A5u3OjEcQ9zJhM391eOTuKsQ2gyC9TLNAKqeYH8pxsa27yjRO71We7FUA== dependencies: - "@babel/runtime" "^7.13.9" + "@babel/runtime" "^7.13.7" -"@polkadot/wasm-crypto@^4.0.2": - version "4.0.2" - resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto/-/wasm-crypto-4.0.2.tgz#9649057adee8383cc86433d107ba526b718c5a3b" - integrity sha512-2h9FuQFkBc+B3TwSapt6LtyPvgtd0Hq9QsHW8g8FrmKBFRiiFKYRpfJKHCk0aCZzuRf9h95bQl/X6IXAIWF2ng== +"@polkadot/wasm-crypto-wasm@^3.2.4": + version "3.2.4" + resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-wasm/-/wasm-crypto-wasm-3.2.4.tgz#70885e06a813af91d81cf7e8ff826976fa99a38b" + integrity sha512-Q/3IEpoo7vkTzg40GxehRK000A9oBgjbh/uWCNQ8cMqWLYYCfzZy4NIzw8szpxNiSiGfGL0iZlP4ZSx2ZqEe2g== dependencies: - "@babel/runtime" "^7.13.9" - "@polkadot/wasm-crypto-asmjs" "^4.0.2" - "@polkadot/wasm-crypto-wasm" "^4.0.2" + "@babel/runtime" "^7.13.7" -"@polkadot/x-global@6.11.1": - version "6.11.1" - resolved "https://registry.yarnpkg.com/@polkadot/x-global/-/x-global-6.11.1.tgz#c292b3825fea60e9b33fff1790323fc57de1ca5d" - integrity sha512-lsBK/e4KbjfieyRmnPs7bTiGbP/6EoCZz7rqD/voNS5qsJAaXgB9LR+ilubun9gK/TDpebyxgO+J19OBiQPIRw== +"@polkadot/wasm-crypto@^3.2.4": + version "3.2.4" + resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto/-/wasm-crypto-3.2.4.tgz#c3e23ff728c1d5701215ae15ecdc605e96901989" + integrity sha512-poeRU91zzZza0ZectT63vBiAqh6DsHCyd3Ogx1U6jsYiRa0yuECMWJx1onvnseDW4tIqsC8vZ/9xHXWwhjTAVg== dependencies: - "@babel/runtime" "^7.14.6" + "@babel/runtime" "^7.13.7" + "@polkadot/wasm-crypto-asmjs" "^3.2.4" + "@polkadot/wasm-crypto-wasm" "^3.2.4" -"@polkadot/x-randomvalues@6.11.1": - version "6.11.1" - resolved "https://registry.yarnpkg.com/@polkadot/x-randomvalues/-/x-randomvalues-6.11.1.tgz#f006fa250c8e82c92ccb769976a45a8e7f3df28b" - integrity sha512-2MfUfGZSOkuPt7GF5OJkPDbl4yORI64SUuKM25EGrJ22o1UyoBnPOClm9eYujLMD6BfDZRM/7bQqqoLW+NuHVw== +"@polkadot/x-global@5.9.2": + version "5.9.2" + resolved "https://registry.yarnpkg.com/@polkadot/x-global/-/x-global-5.9.2.tgz#e223d59536d168c7cbc49fc3a2052cbd71bd7256" + integrity sha512-wpY6IAOZMGiJQa8YMm7NeTLi9bwnqqVauR+v7HwyrssnGPuYX8heb6BQLOnnnPh/EK0+M8zNtwRBU48ez0/HOg== dependencies: - "@babel/runtime" "^7.14.6" - "@polkadot/x-global" "6.11.1" + "@babel/runtime" "^7.13.8" + "@types/node-fetch" "^2.5.8" + node-fetch "^2.6.1" -"@polkadot/x-rxjs@^6.11.1": - version "6.11.1" - resolved "https://registry.yarnpkg.com/@polkadot/x-rxjs/-/x-rxjs-6.11.1.tgz#5454708b61da70eea05708611d9148fce9372498" - integrity sha512-zIciEmij7SUuXXg9g/683Irx6GogxivrQS2pgBir2DI/YZq+um52+Dqg1mqsEZt74N4KMTMnzAZAP6LJOBOMww== +"@polkadot/x-randomvalues@5.9.2": + version "5.9.2" + resolved "https://registry.yarnpkg.com/@polkadot/x-randomvalues/-/x-randomvalues-5.9.2.tgz#563a76550f94107ce5a37c462ed067dc040626b1" + integrity sha512-Zv+eXSP3oBImMnB82y05Doo0A96WUFsQDbnLHI3jFHioIg848cL0nndB9TgBwPaFkZ2oiwoHEC8yxqNI6/jkzQ== dependencies: - "@babel/runtime" "^7.14.6" - rxjs "^6.6.7" + "@babel/runtime" "^7.13.8" + "@polkadot/x-global" "5.9.2" -"@polkadot/x-textdecoder@6.11.1": - version "6.11.1" - resolved "https://registry.yarnpkg.com/@polkadot/x-textdecoder/-/x-textdecoder-6.11.1.tgz#6cc314645681cc4639085c03b65328671c7f182c" - integrity sha512-DI1Ym2lyDSS/UhnTT2e9WutukevFZ0WGpzj4eotuG2BTHN3e21uYtYTt24SlyRNMrWJf5+TkZItmZeqs1nwAfQ== +"@polkadot/x-rxjs@^5.9.2": + version "5.9.2" + resolved "https://registry.yarnpkg.com/@polkadot/x-rxjs/-/x-rxjs-5.9.2.tgz#925b7c3325678b137ca30af6a726b22c5e8f9125" + integrity sha512-cuF4schclspOfAqEPvbcA3aQ9d3TBy2ORZ8YehxD0ZSHWJNhefHDIUDgS5T3NtPhSKgcEmSlI5TfVfgGFxgVMg== dependencies: - "@babel/runtime" "^7.14.6" - "@polkadot/x-global" "6.11.1" + "@babel/runtime" "^7.13.8" + rxjs "^6.6.6" -"@polkadot/x-textencoder@6.11.1": - version "6.11.1" - resolved "https://registry.yarnpkg.com/@polkadot/x-textencoder/-/x-textencoder-6.11.1.tgz#73e89da5b91954ae380042c19314c90472f59d9e" - integrity sha512-8ipjWdEuqFo+R4Nxsc3/WW9CSEiprX4XU91a37ZyRVC4e9R1bmvClrpXmRQLVcAQyhRvG8DKOOtWbz8xM+oXKg== +"@polkadot/x-textdecoder@5.9.2": + version "5.9.2" + resolved "https://registry.yarnpkg.com/@polkadot/x-textdecoder/-/x-textdecoder-5.9.2.tgz#2e69922acc426f91adc2629fea362e41c9035f25" + integrity sha512-MCkgITwGY3tG0UleDkBJEoiKGk/YWYwMM5OR6fNo07RymHRtJ8OLJC+Sej9QD05yz6TIhFaaRRYzmtungIcwTw== dependencies: - "@babel/runtime" "^7.14.6" - "@polkadot/x-global" "6.11.1" - -"@protobufjs/aspromise@^1.1.1", "@protobufjs/aspromise@^1.1.2": - version "1.1.2" - resolved "https://registry.yarnpkg.com/@protobufjs/aspromise/-/aspromise-1.1.2.tgz#9b8b0cc663d669a7d8f6f5d0893a14d348f30fbf" - integrity sha1-m4sMxmPWaafY9vXQiToU00jzD78= - -"@protobufjs/base64@^1.1.2": - version "1.1.2" - resolved "https://registry.yarnpkg.com/@protobufjs/base64/-/base64-1.1.2.tgz#4c85730e59b9a1f1f349047dbf24296034bb2735" - integrity sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg== - -"@protobufjs/codegen@^2.0.4": - version "2.0.4" - resolved "https://registry.yarnpkg.com/@protobufjs/codegen/-/codegen-2.0.4.tgz#7ef37f0d010fb028ad1ad59722e506d9262815cb" - integrity sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg== + "@babel/runtime" "^7.13.8" + "@polkadot/x-global" "5.9.2" -"@protobufjs/eventemitter@^1.1.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz#355cbc98bafad5978f9ed095f397621f1d066b70" - integrity sha1-NVy8mLr61ZePntCV85diHx0Ga3A= - -"@protobufjs/fetch@^1.1.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@protobufjs/fetch/-/fetch-1.1.0.tgz#ba99fb598614af65700c1619ff06d454b0d84c45" - integrity sha1-upn7WYYUr2VwDBYZ/wbUVLDYTEU= +"@polkadot/x-textencoder@5.9.2": + version "5.9.2" + resolved "https://registry.yarnpkg.com/@polkadot/x-textencoder/-/x-textencoder-5.9.2.tgz#67362e64bacfe6ff4eec73bf596873a2f9d9f36d" + integrity sha512-IjdLY3xy0nUfps1Bdi0tRxAX7X081YyoiSWExwqUkChdcYGMqMe3T2wqrrt9qBr2IkW8O/tlfYBiZXdII0YCcw== dependencies: - "@protobufjs/aspromise" "^1.1.1" - "@protobufjs/inquire" "^1.1.0" - -"@protobufjs/float@^1.0.2": - version "1.0.2" - resolved "https://registry.yarnpkg.com/@protobufjs/float/-/float-1.0.2.tgz#5e9e1abdcb73fc0a7cb8b291df78c8cbd97b87d1" - integrity sha1-Xp4avctz/Ap8uLKR33jIy9l7h9E= - -"@protobufjs/inquire@^1.1.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@protobufjs/inquire/-/inquire-1.1.0.tgz#ff200e3e7cf2429e2dcafc1140828e8cc638f089" - integrity sha1-/yAOPnzyQp4tyvwRQIKOjMY48Ik= - -"@protobufjs/path@^1.1.2": - version "1.1.2" - resolved "https://registry.yarnpkg.com/@protobufjs/path/-/path-1.1.2.tgz#6cc2b20c5c9ad6ad0dccfd21ca7673d8d7fbf68d" - integrity sha1-bMKyDFya1q0NzP0hynZz2Nf79o0= - -"@protobufjs/pool@^1.1.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@protobufjs/pool/-/pool-1.1.0.tgz#09fd15f2d6d3abfa9b65bc366506d6ad7846ff54" - integrity sha1-Cf0V8tbTq/qbZbw2ZQbWrXhG/1Q= - -"@protobufjs/utf8@^1.1.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@protobufjs/utf8/-/utf8-1.1.0.tgz#a777360b5b39a1a2e5106f8e858f2fd2d060c570" - integrity sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA= + "@babel/runtime" "^7.13.8" + "@polkadot/x-global" "5.9.2" "@sindresorhus/is@^2.0.0": version "2.1.1" @@ -2196,36 +1942,24 @@ resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.165.tgz#74d55d947452e2de0742bad65270433b63a8c30f" integrity sha512-tjSSOTHhI5mCHTy/OOXYIhi2Wt1qcbHmuXD1Ha7q70CgI/I71afO4XtLb/cVexki1oVYchpul/TOuu3Arcdxrg== -"@types/long@^4.0.1": - version "4.0.1" - resolved "https://registry.yarnpkg.com/@types/long/-/long-4.0.1.tgz#459c65fa1867dafe6a8f322c4c51695663cc55e9" - integrity sha512-5tXH6Bx/kNGd3MgffdmP4dy2Z+G4eaXw0SE81Tq3BNadtnMR5/ySMzX4SLEzHJzSmPNn4HIdpQsBvXMUykr58w== +"@types/node-fetch@^2.5.8": + version "2.5.8" + resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.5.8.tgz#e199c835d234c7eb0846f6618012e558544ee2fb" + integrity sha512-fbjI6ja0N5ZA8TV53RUqzsKNkl9fv8Oj3T7zxW7FGv1GSH7gwJaNF8dzCjrqKaxKeUpTz4yT1DaJFq/omNpGfw== + dependencies: + "@types/node" "*" + form-data "^3.0.0" "@types/node@*", "@types/node@>= 8": - version "15.14.0" - resolved "https://registry.yarnpkg.com/@types/node/-/node-15.14.0.tgz#74dbf254fb375551a9d2a71faf6b9dbc2178dc53" - integrity sha512-um/+/ip3QZmwLfIkWZSNtQIJNVAqrJ92OkLMeuZrjZMTAJniI7fh8N8OICyDhAJ2mzgk/fmYFo72jRr5HyZ1EQ== - -"@types/node@10.12.18": - version "10.12.18" - resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.18.tgz#1d3ca764718915584fcd9f6344621b7672665c67" - integrity sha512-fh+pAqt4xRzPfqA6eh3Z2y6fyZavRIumvjhaCL753+TVkGKGhpPeyrJG2JftD0T9q4GF00KjefsQ+PQNDdWQaQ== + version "14.10.2" + resolved "https://registry.yarnpkg.com/@types/node/-/node-14.10.2.tgz#9b47a2c8e4dabd4db73b57e750b24af689600514" + integrity sha512-IzMhbDYCpv26pC2wboJ4MMOa9GKtjplXfcAqrMeNJpUUwpM/2ATt2w1JPUXwS6spu856TvKZL2AOmeU2rAxskw== "@types/node@11.11.6": version "11.11.6" resolved "https://registry.yarnpkg.com/@types/node/-/node-11.11.6.tgz#df929d1bb2eee5afdda598a41930fe50b43eaa6a" integrity sha512-Exw4yUWMBXM3X+8oqzJNRqZSwUAaS4+7NdvHqQuFi/d+synz++xmX3QIf+BFqneW8N31R8Ky+sikfZUXq07ggQ== -"@types/node@>=13.7.0": - version "16.0.1" - resolved "https://registry.yarnpkg.com/@types/node/-/node-16.0.1.tgz#70cedfda26af7a2ca073fdcc9beb2fff4aa693f8" - integrity sha512-hBOx4SUlEPKwRi6PrXuTGw1z6lz0fjsibcWCM378YxsSu/6+C30L6CR49zIBKHiwNWCYIcOLjg4OHKZaFeLAug== - -"@types/node@^13.7.0": - version "13.13.52" - resolved "https://registry.yarnpkg.com/@types/node/-/node-13.13.52.tgz#03c13be70b9031baaed79481c0c0cfb0045e53f7" - integrity sha512-s3nugnZumCC//n4moGGe6tkNMyYEdaDBitVjwPxXmR5lnMG5dHePinH2EdxkG3Rh1ghFHHixAG4NJhpJW1rthQ== - "@types/pbkdf2@^3.0.0": version "3.1.0" resolved "https://registry.yarnpkg.com/@types/pbkdf2/-/pbkdf2-3.1.0.tgz#039a0e9b67da0cdc4ee5dab865caa6b267bb66b1" @@ -2289,9 +2023,9 @@ integrity sha512-RJJrrySY7A8havqpGObOB4W92QXKJo63/jFLLgpvOtsGUqbQZ9Sbgl35KMm1DjC6j7AvmmU2bIno+3IyEaemaw== "@types/urijs@^1.19.6": - version "1.19.16" - resolved "https://registry.yarnpkg.com/@types/urijs/-/urijs-1.19.16.tgz#156658c47438fa867db5dce4d2949fe1ca0878e2" - integrity sha512-WgxqcUSEYijGnNWHSln/uqay+AywS3mEhLC+d2PwLsru2fLeMblvxP67Y/SCfB2Pxe+dX/zbIoNNzXY+VKOtNA== + version "1.19.15" + resolved "https://registry.yarnpkg.com/@types/urijs/-/urijs-1.19.15.tgz#0142b92b52d07c4ba97dd82e7a54a875332942ec" + integrity sha512-pEDVREIvkyRtzpWlO5nqsUgR/JpLv9+lAzvkERCwoH2jXxl+TmaTNshhL7gjQLhfqgFUzCM6ovmoB1JssTop1A== "@types/ws@^7.2.0": version "7.4.0" @@ -2378,10 +2112,10 @@ js-sha3 "0.8.0" query-string "6.13.5" -"@xstate/react@^1.5.1": - version "1.5.1" - resolved "https://registry.yarnpkg.com/@xstate/react/-/react-1.5.1.tgz#60817e60e54e338b8e7c3e51bfa4cd3babebdc7d" - integrity sha512-DJHDqDlZHus08X98uMJw4KR17FRWBXLHMQ02YRxx0DMm5VLn75VwGyt4tXdlNZHQWjyk++C5c9Ichq3PdmM3og== +"@xstate/react@^1.3.4": + version "1.3.4" + resolved "https://registry.yarnpkg.com/@xstate/react/-/react-1.3.4.tgz#d79126c9eecc9a1225d553e3421aaad68eb5ee5e" + integrity sha512-uKbKriFYjgeqMeEAqOv8IWRM8WBx5i/4pMPGpqo58wd7sInhFmmK6HWfV7eX3nD/vJPfxWielNMxAUCUdVh1pA== dependencies: use-isomorphic-layout-effect "^1.0.0" use-subscription "^1.3.0" @@ -2630,29 +2364,29 @@ babel-plugin-dynamic-import-node@^2.3.3: dependencies: object.assign "^4.1.0" -babel-plugin-polyfill-corejs2@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.2.2.tgz#e9124785e6fd94f94b618a7954e5693053bf5327" - integrity sha512-kISrENsJ0z5dNPq5eRvcctITNHYXWOA4DUZRFYCz3jYCcvTb/A546LIddmoGNMVYg2U38OyFeNosQwI9ENTqIQ== +babel-plugin-polyfill-corejs2@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.2.0.tgz#686775bf9a5aa757e10520903675e3889caeedc4" + integrity sha512-9bNwiR0dS881c5SHnzCmmGlMkJLl0OUZvxrxHo9w/iNoRuqaPjqlvBf4HrovXtQs/au5yKkpcdgfT1cC5PAZwg== dependencies: "@babel/compat-data" "^7.13.11" - "@babel/helper-define-polyfill-provider" "^0.2.2" + "@babel/helper-define-polyfill-provider" "^0.2.0" semver "^6.1.1" -babel-plugin-polyfill-corejs3@^0.2.2: - version "0.2.3" - resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.2.3.tgz#72add68cf08a8bf139ba6e6dfc0b1d504098e57b" - integrity sha512-rCOFzEIJpJEAU14XCcV/erIf/wZQMmMT5l5vXOpL5uoznyOGfDIjPj6FVytMvtzaKSTSVKouOCTPJ5OMUZH30g== +babel-plugin-polyfill-corejs3@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.2.0.tgz#f4b4bb7b19329827df36ff56f6e6d367026cb7a2" + integrity sha512-zZyi7p3BCUyzNxLx8KV61zTINkkV65zVkDAFNZmrTCRVhjo1jAS+YLvDJ9Jgd/w2tsAviCwFHReYfxO3Iql8Yg== dependencies: - "@babel/helper-define-polyfill-provider" "^0.2.2" - core-js-compat "^3.14.0" + "@babel/helper-define-polyfill-provider" "^0.2.0" + core-js-compat "^3.9.1" -babel-plugin-polyfill-regenerator@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.2.2.tgz#b310c8d642acada348c1fa3b3e6ce0e851bee077" - integrity sha512-Goy5ghsc21HgPDFtzRkSirpZVW35meGoTmTOb2bxqdl60ghub4xOidgNTHaZfQ2FaxQsKmwvXtOAkcIS4SMBWg== +babel-plugin-polyfill-regenerator@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.2.0.tgz#853f5f5716f4691d98c84f8069c7636ea8da7ab8" + integrity sha512-J7vKbCuD2Xi/eEHxquHN14bXAW9CXtecwuLrOIDJtcZzTaPzV1VdEfoUf9AzcRBMolKUQKM9/GVojeh0hFiqMg== dependencies: - "@babel/helper-define-polyfill-provider" "^0.2.2" + "@babel/helper-define-polyfill-provider" "^0.2.0" balanced-match@^1.0.0: version "1.0.0" @@ -2678,7 +2412,7 @@ base32.js@^0.1.0: resolved "https://registry.yarnpkg.com/base32.js/-/base32.js-0.1.0.tgz#b582dec693c2f11e893cf064ee6ac5b6131a2202" integrity sha1-tYLexpPC8R6JPPBk7mrFthMaIgI= -base64-js@^1.0.2, base64-js@^1.3.0, base64-js@^1.3.1, base64-js@^1.5.1: +base64-js@^1.0.2, base64-js@^1.3.1, base64-js@^1.5.1: version "1.5.1" resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== @@ -2713,7 +2447,7 @@ bcrypt-pbkdf@^1.0.0: dependencies: tweetnacl "^0.14.3" -bech32@1.1.4, bech32@^1.1.4: +bech32@1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/bech32/-/bech32-1.1.4.tgz#e38c9f37bf179b8eb16ae3a772b40c356d4832e9" integrity sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ== @@ -2738,11 +2472,6 @@ big-integer@^1.6.17, big-integer@^1.6.48: resolved "https://registry.yarnpkg.com/big-integer/-/big-integer-1.6.48.tgz#8fd88bd1632cba4a1c8c3e3d7159f08bb95b4b9e" integrity sha512-j51egjPa7/i+RdiRuJbPdJ2FIUYYPhvYLjzoYbcMMm62ooO6F94fETG4MTs46zPAF9Brs04OajboA/qTGuz78w== -big.js@6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/big.js/-/big.js-6.0.0.tgz#d3806d83d93d67faaf29bfca2d2c45d02160da04" - integrity sha512-PGsJX+jhBY5qaGOymm4V1QMM2oOCtfGdW8CxgbDTg17C/qHeW89jhx6Kpda3vS0uPHFT6sEhwbb5tlc0wmA+wQ== - bignumber.js@^4.0.0: version "4.1.0" resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-4.1.0.tgz#db6f14067c140bd46624815a7916c92d9b6c24b1" @@ -2771,7 +2500,7 @@ binary@~0.3.0: buffers "~0.1.1" chainsaw "~0.1.0" -bindings@1.5.0, bindings@^1.2.1, bindings@^1.3.0, bindings@^1.4.0, bindings@^1.5.0: +bindings@1.5.0, bindings@^1.2.1, bindings@^1.4.0, bindings@^1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.5.0.tgz#10353c9e945334bc0511a6d90b38fbc7c9c504df" integrity sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ== @@ -2783,30 +2512,7 @@ bip32-path@0.4.2, bip32-path@^0.4.2: resolved "https://registry.yarnpkg.com/bip32-path/-/bip32-path-0.4.2.tgz#5db0416ad6822712f077836e2557b8697c0c7c99" integrity sha1-XbBBataCJxLwd4NuJVe4aXwMfJk= -bip32@2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/bip32/-/bip32-2.0.6.tgz#6a81d9f98c4cd57d05150c60d8f9e75121635134" - integrity sha512-HpV5OMLLGTjSVblmrtYRfFFKuQB+GArM0+XP8HGWfJ5vxYBqo+DesvJwOdC2WJ3bCkZShGf0QIfoIpeomVzVdA== - dependencies: - "@types/node" "10.12.18" - bs58check "^2.1.1" - create-hash "^1.2.0" - create-hmac "^1.1.7" - tiny-secp256k1 "^1.1.3" - typeforce "^1.11.5" - wif "^2.0.6" - -bip39@3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/bip39/-/bip39-3.0.2.tgz#2baf42ff3071fc9ddd5103de92e8f80d9257ee32" - integrity sha512-J4E1r2N0tUylTKt07ibXvhpT2c5pyAFgvuA5q1H9uDy6dEGpjV8jmymh3MTYJDLCNbIVClSB9FbND49I6N24MQ== - dependencies: - "@types/node" "11.11.6" - create-hash "^1.1.0" - pbkdf2 "^3.0.9" - randombytes "^2.0.1" - -bip39@^3.0.2, bip39@^3.0.4: +bip39@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/bip39/-/bip39-3.0.4.tgz#5b11fed966840b5e1b8539f0f54ab6392969b2a0" integrity sha512-YZKQlb752TrUWqHWj7XAwCSjYEgGAk+/Aas3V7NyjQeZYsztO8JnQUaCWhcnL4T+jL8nvB8typ2jRPzTlgugNw== @@ -2840,10 +2546,10 @@ blake2b@^2.1.3: blake2b-wasm "^1.1.0" nanoassert "^1.0.0" -blakejs@^1.1.0, blakejs@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/blakejs/-/blakejs-1.1.1.tgz#bf313053978b2cd4c444a48795710be05c785702" - integrity sha512-bLG6PHOCZJKNshTjGRBvET0vTciwQE6zFKOKKXPDJfwFBd4Ac0yBfPZqcGvGJap50l7ktvlpFqc2jGVaUgbJgg== +blakejs@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/blakejs/-/blakejs-1.1.0.tgz#69df92ef953aa88ca51a32df6ab1c54a155fc7a5" + integrity sha1-ad+S75U6qIylGjLfarHFShVfx6U= bluebird@~3.4.1: version "3.4.7" @@ -2929,7 +2635,7 @@ browserify-aes@^1.2.0: inherits "^2.0.1" safe-buffer "^5.0.1" -browserslist@^4.16.6: +browserslist@^4.14.5, browserslist@^4.16.3: version "4.16.6" resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.16.6.tgz#d7901277a5a88e554ed305b183ec9b0c08f66fa2" integrity sha512-Wspk/PqO+4W9qp5iUTJsa1B/QrYn1keNCcEP5OvP7WBwT4KaDly0uONYmC6Xa3Z5IqnUgS0KcgLYu1l74x0ZXQ== @@ -2947,7 +2653,7 @@ bs58@^4.0.0, bs58@^4.0.1: dependencies: base-x "^3.0.2" -bs58check@2.1.2, bs58check@<3.0.0, bs58check@^2.1.1, bs58check@^2.1.2: +bs58check@2.1.2, bs58check@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/bs58check/-/bs58check-2.1.2.tgz#53b018291228d82a5aa08e7d796fdafda54aebfc" integrity sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA== @@ -2984,14 +2690,6 @@ buffer@5.6.0: base64-js "^1.0.2" ieee754 "^1.1.4" -buffer@5.6.1: - version "5.6.1" - resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.6.1.tgz#b99419405f4290a7a1f20b51037cee9f1fbd7f6a" - integrity sha512-2z15UUHpS9/3tk9mY/q+Rl3rydOi7yMp5XWNQnRvoz+mJwiv8brqYwp9a+nOCtma6dwuEIxljD8W3ysVBZ05Vg== - dependencies: - base64-js "^1.3.1" - ieee754 "^1.1.13" - buffer@^5.1.0, buffer@^5.5.0: version "5.7.1" resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.7.1.tgz#ba62e7c13133053582197160851a8f648e99eed0" @@ -3243,7 +2941,7 @@ colorspace@1.1.x: color "3.0.x" text-hex "1.0.x" -combined-stream@^1.0.6, combined-stream@~1.0.6: +combined-stream@^1.0.6, combined-stream@^1.0.8, combined-stream@~1.0.6: version "1.0.8" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== @@ -3324,12 +3022,12 @@ copy-descriptor@^0.1.0: resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= -core-js-compat@^3.14.0, core-js-compat@^3.15.0: - version "3.15.1" - resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.15.1.tgz#1afe233716d37ee021956ef097594071b2b585a7" - integrity sha512-xGhzYMX6y7oEGQGAJmP2TmtBLvR4nZmRGEcFa3ubHOq5YEp51gGN9AovVa0AoujGZIq+Wm6dISiYyGNfdflYww== +core-js-compat@^3.9.0, core-js-compat@^3.9.1: + version "3.10.1" + resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.10.1.tgz#62183a3a77ceeffcc420d907a3e6fc67d9b27f1c" + integrity sha512-ZHQTdTPkqvw2CeHiZC970NNJcnwzT6YIueDMASKt+p3WbZsLXOcoD392SkcWhkC0wBBHhlfhqGKKsNCQUozYtg== dependencies: - browserslist "^4.16.6" + browserslist "^4.16.3" semver "7.0.0" core-util-is@1.0.2, core-util-is@~1.0.0: @@ -3352,7 +3050,7 @@ crc@^3.5.0: dependencies: buffer "^5.1.0" -create-hash@1.2.0, create-hash@^1.1.0, create-hash@^1.1.2, create-hash@^1.2.0: +create-hash@^1.1.0, create-hash@^1.1.2, create-hash@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.2.0.tgz#889078af11a63756bcfb59bd221996be3a9ef196" integrity sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg== @@ -3550,9 +3248,9 @@ detect-libc@^1.0.3: integrity sha1-+hN8S9aY7fVc1c0CrFWfkaTEups= detect-node@^2.0.4: - version "2.1.0" - resolved "https://registry.yarnpkg.com/detect-node/-/detect-node-2.1.0.tgz#c9c70775a49c3d03bc2c06d9a73be550f978f8b1" - integrity sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g== + version "2.0.5" + resolved "https://registry.yarnpkg.com/detect-node/-/detect-node-2.0.5.tgz#9d270aa7eaa5af0b72c4c9d9b814e7f4ce738b79" + integrity sha512-qi86tE6hRcFHy8jI1m2VG+LaPUR1LhqDa5G8tVjuUXmOrpuAgqsA1pN0+ldgr3aKUH+QLI9hCY/OcRYisERejw== diff-sequences@^26.6.2: version "26.6.2" @@ -3601,7 +3299,7 @@ electron-to-chromium@^1.3.723: resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.740.tgz#e38b7d2b848f632191b643e6dabca51be2162922" integrity sha512-Mi2m55JrX2BFbNZGKYR+2ItcGnR4O5HhrvgoRRyZQlaMGQULqDhoGkLWHzJoshSzi7k1PUofxcDbNhlFrDZNhg== -elliptic@6.5.4, elliptic@^6.4.0, elliptic@^6.5.2, elliptic@^6.5.3, elliptic@^6.5.4: +elliptic@6.5.4, elliptic@^6.5.2, elliptic@^6.5.4: version "6.5.4" resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.4.tgz#da37cebd31e79a1367e941b592ed1fbebd58abbb" integrity sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ== @@ -3835,41 +3533,41 @@ ethereumjs-util@^7.0.10: ethjs-util "0.1.6" rlp "^2.2.4" -ethers@^5.4.1: - version "5.4.1" - resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.4.1.tgz#bcff1e9f45bf1a061bf313ec04e8d9881d2d53f9" - integrity sha512-SrcddMdCgP1hukDvCPd87Aipbf4NWjQvdfAbZ65XSZGbfyuYPtIrUJPDH5B1SBRsdlfiEgX3eoz28DdBDzMNFg== - dependencies: - "@ethersproject/abi" "5.4.0" - "@ethersproject/abstract-provider" "5.4.0" - "@ethersproject/abstract-signer" "5.4.0" - "@ethersproject/address" "5.4.0" - "@ethersproject/base64" "5.4.0" - "@ethersproject/basex" "5.4.0" - "@ethersproject/bignumber" "5.4.0" - "@ethersproject/bytes" "5.4.0" - "@ethersproject/constants" "5.4.0" - "@ethersproject/contracts" "5.4.0" - "@ethersproject/hash" "5.4.0" - "@ethersproject/hdnode" "5.4.0" - "@ethersproject/json-wallets" "5.4.0" - "@ethersproject/keccak256" "5.4.0" - "@ethersproject/logger" "5.4.0" - "@ethersproject/networks" "5.4.1" - "@ethersproject/pbkdf2" "5.4.0" - "@ethersproject/properties" "5.4.0" - "@ethersproject/providers" "5.4.1" - "@ethersproject/random" "5.4.0" - "@ethersproject/rlp" "5.4.0" - "@ethersproject/sha2" "5.4.0" - "@ethersproject/signing-key" "5.4.0" - "@ethersproject/solidity" "5.4.0" - "@ethersproject/strings" "5.4.0" - "@ethersproject/transactions" "5.4.0" - "@ethersproject/units" "5.4.0" - "@ethersproject/wallet" "5.4.0" - "@ethersproject/web" "5.4.0" - "@ethersproject/wordlists" "5.4.0" +ethers@^5.2.0: + version "5.3.1" + resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.3.1.tgz#1f018f0aeb651576cd84fd987a45f0b99646d761" + integrity sha512-xCKmC0gsZ9gks89ZfK3B1y6LlPdvX5fxDtu9SytnpdDJR1M7pmJI+4H0AxQPMgUYr7GtQdmECLR0gWdJQ+lZYw== + dependencies: + "@ethersproject/abi" "5.3.1" + "@ethersproject/abstract-provider" "5.3.0" + "@ethersproject/abstract-signer" "5.3.0" + "@ethersproject/address" "5.3.0" + "@ethersproject/base64" "5.3.0" + "@ethersproject/basex" "5.3.0" + "@ethersproject/bignumber" "5.3.0" + "@ethersproject/bytes" "5.3.0" + "@ethersproject/constants" "5.3.0" + "@ethersproject/contracts" "5.3.0" + "@ethersproject/hash" "5.3.0" + "@ethersproject/hdnode" "5.3.0" + "@ethersproject/json-wallets" "5.3.0" + "@ethersproject/keccak256" "5.3.0" + "@ethersproject/logger" "5.3.0" + "@ethersproject/networks" "5.3.1" + "@ethersproject/pbkdf2" "5.3.0" + "@ethersproject/properties" "5.3.0" + "@ethersproject/providers" "5.3.1" + "@ethersproject/random" "5.3.0" + "@ethersproject/rlp" "5.3.0" + "@ethersproject/sha2" "5.3.0" + "@ethersproject/signing-key" "5.3.0" + "@ethersproject/solidity" "5.3.0" + "@ethersproject/strings" "5.3.0" + "@ethersproject/transactions" "5.3.0" + "@ethersproject/units" "5.3.0" + "@ethersproject/wallet" "5.3.0" + "@ethersproject/web" "5.3.0" + "@ethersproject/wordlists" "5.3.0" ethjs-util@0.1.6, ethjs-util@^0.1.3: version "0.1.6" @@ -4139,9 +3837,9 @@ fn.name@1.x.x: integrity sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw== follow-redirects@^1.10.0: - version "1.14.1" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.1.tgz#d9114ded0a1cfdd334e164e6662ad02bfd91ff43" - integrity sha512-HWqDgT7ZEkqRzBvc2s64vSZ/hfOceEol3ac/7tKwzuvEyWx3/4UegXh5oBOIotkGsObyk3xznnSRVADBgWSQVg== + version "1.13.0" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.13.0.tgz#b42e8d93a2a7eea5ed88633676d6597bc8e384db" + integrity sha512-aq6gF1BEKje4a9i9+5jimNFIpq4Q1WiwBToeRK5NvZBd/TRsmW8BsJfOEGkr76TbOyPVD3OVDN910EcUNtRYEA== for-in@^1.0.2: version "1.0.2" @@ -4158,6 +3856,15 @@ forever-agent@~0.6.1: resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE= +form-data@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-3.0.0.tgz#31b7e39c85f1355b7139ee0c647cf0de7f83c682" + integrity sha512-CKMFDglpbMi6PyN+brwB9Q/GOw0eAnsrEZDgcsH5Krhz5Od/haKHAX0NmQfha2zPPz0JpWzA7GJHGSnvCRLWsg== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.8" + mime-types "^2.1.12" + form-data@~2.3.2: version "2.3.3" resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" @@ -4306,10 +4013,18 @@ github-from-package@0.0.0: resolved "https://registry.yarnpkg.com/github-from-package/-/github-from-package-0.0.0.tgz#97fb5d96bfde8973313f20e8288ef9a167fa64ce" integrity sha1-l/tdlr/eiXMxPyDoKI75oWf6ZM4= -glob-parent@^5.1.2, glob-parent@~5.1.0: - version "5.1.2" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" - integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== +glob-parent@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-3.1.0.tgz#9e6af6299d8d3bd2bd40430832bd113df906c5ae" + integrity sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4= + dependencies: + is-glob "^3.1.0" + path-dirname "^1.0.0" + +glob-parent@~5.1.0: + version "5.1.1" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.1.tgz#b6c1ef417c4e5663ea498f1c45afac6916bbc229" + integrity sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ== dependencies: is-glob "^4.0.1" @@ -4330,13 +4045,6 @@ globals@^11.1.0: resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== -globalthis@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/globalthis/-/globalthis-1.0.2.tgz#2a235d34f4d8036219f7e34929b5de9e18166b8b" - integrity sha512-ZQnSFO1la8P7auIOQECnm0sSuoMeaSq0EEdXMBFF2QJO4uNcwbyhSgG3MruWNbFTqCLmxVwGOl7LZ9kASvHdeQ== - dependencies: - define-properties "^1.1.3" - got@^10.5.7: version "10.7.0" resolved "https://registry.yarnpkg.com/got/-/got-10.7.0.tgz#62889dbcd6cca32cd6a154cc2d0c6895121d091f" @@ -4697,7 +4405,7 @@ is-extendable@^1.0.1: dependencies: is-plain-object "^2.0.4" -is-extglob@^2.1.1: +is-extglob@^2.1.0, is-extglob@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= @@ -4724,6 +4432,13 @@ is-generator-function@^1.0.7: resolved "https://registry.yarnpkg.com/is-generator-function/-/is-generator-function-1.0.8.tgz#dfb5c2b120e02b0a8d9d2c6806cd5621aa922f7b" integrity sha512-2Omr/twNtufVZFr1GhxjOMFPAj2sjc/dKaIqBhvo4qciXfJmITGH6ZGd8eZYNHza8t1y0e01AuqRhJwfWp26WQ== +is-glob@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-3.1.0.tgz#7ba5ae24217804ac70707b96922567486cc3e84a" + integrity sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo= + dependencies: + is-extglob "^2.1.0" + is-glob@^4.0.0, is-glob@^4.0.1, is-glob@~4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" @@ -4904,11 +4619,6 @@ js-sha3@0.8.0, js-sha3@^0.8.0: resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.8.0.tgz#b9b7a5da73afad7dedd0f8c463954cbde6818840" integrity sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q== -js-sha512@^0.8.0: - version "0.8.0" - resolved "https://registry.yarnpkg.com/js-sha512/-/js-sha512-0.8.0.tgz#dd22db8d02756faccf19f218e3ed61ec8249f7d4" - integrity sha512-PWsmefG6Jkodqt+ePTvBZCSMFgN7Clckjd0O7su3I0+BW2QWUTJNzjktHsztGLhncP2h8mcF9V9Y2Ha59pAViQ== - "js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" @@ -5050,18 +4760,6 @@ kuler@^2.0.0: resolved "https://registry.yarnpkg.com/kuler/-/kuler-2.0.0.tgz#e2c570a3800388fb44407e851531c1d670b061b3" integrity sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A== -libsodium-wrappers@^0.7.6: - version "0.7.9" - resolved "https://registry.yarnpkg.com/libsodium-wrappers/-/libsodium-wrappers-0.7.9.tgz#4ffc2b69b8f7c7c7c5594a93a4803f80f6d0f346" - integrity sha512-9HaAeBGk1nKTRFRHkt7nzxqCvnkWTjn1pdjKgcUnZxj0FyOP4CnhgFhMdrFfgNsukijBGyBLpP2m2uKT1vuWhQ== - dependencies: - libsodium "^0.7.0" - -libsodium@^0.7.0: - version "0.7.9" - resolved "https://registry.yarnpkg.com/libsodium/-/libsodium-0.7.9.tgz#4bb7bcbf662ddd920d8795c227ae25bbbfa3821b" - integrity sha512-gfeADtR4D/CM0oRUviKBViMGXZDgnFdMKMzHsvBdqLBHd9ySi6EtYnmuhHVDDYgYpAO8eU8hEY+F8vIUAPh08A== - listenercount@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/listenercount/-/listenercount-1.0.1.tgz#84c8a72ab59c4725321480c975e6508342e70937" @@ -5109,7 +4807,7 @@ lodash.uniq@^4.5.0: resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M= -lodash@4.17.21, lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.21, lodash@^4.17.4, lodash@^4.17.5: +lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.21, lodash@^4.17.4, lodash@^4.17.5: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -5125,11 +4823,6 @@ logform@^2.2.0: ms "^2.1.1" triple-beam "^1.3.0" -long@4.0.0, long@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/long/-/long-4.0.0.tgz#9a7b71cfb7d361a194ea555241c92f7468d5bf28" - integrity sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA== - long@^2.2.3: version "2.4.0" resolved "https://registry.yarnpkg.com/long/-/long-2.4.0.tgz#9fa180bb1d9500cdc29c4156766a1995e1f4524f" @@ -5370,7 +5063,7 @@ ms@2.1.2, ms@^2.1.1: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== -nan@^2.13.2, nan@^2.14.0, nan@^2.14.2, nan@^2.2.1: +nan@^2.14.0, nan@^2.14.2, nan@^2.2.1: version "2.14.2" resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.2.tgz#f5376400695168f4cc694ac9393d0c9585eeea19" integrity sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ== @@ -5708,13 +5401,6 @@ osenv@^0.1.4: os-homedir "^1.0.0" os-tmpdir "^1.0.0" -ow@0.17.0: - version "0.17.0" - resolved "https://registry.yarnpkg.com/ow/-/ow-0.17.0.tgz#4f938999fed6264c9048cd6254356e0f1e7f688c" - integrity sha512-i3keDzDQP5lWIe4oODyDFey1qVrq2hXKTuTH2VpqwpYtzPiKZt2ziRI4NBQmgW40AnV5Euz17OyWweCb+bNEQA== - dependencies: - type-fest "^0.11.0" - p-cancelable@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-2.0.0.tgz#4a3740f5bdaf5ed5d7c3e34882c6fb5d6b266a6e" @@ -5768,6 +5454,11 @@ pascalcase@^0.1.1: resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" integrity sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ= +path-dirname@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0" + integrity sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA= + path-exists@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" @@ -5905,63 +5596,6 @@ prop-types@^15.7.2: object-assign "^4.1.1" react-is "^16.8.1" -protobufjs@6.10.1: - version "6.10.1" - resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-6.10.1.tgz#e6a484dd8f04b29629e9053344e3970cccf13cd2" - integrity sha512-pb8kTchL+1Ceg4lFd5XUpK8PdWacbvV5SK2ULH2ebrYtl4GjJmS24m6CKME67jzV53tbJxHlnNOSqQHbTsR9JQ== - 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" - -protobufjs@^6.8.8: - version "6.11.2" - resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-6.11.2.tgz#de39fabd4ed32beaa08e9bb1e30d08544c1edf8b" - integrity sha512-4BQJoPooKJl2G9j3XftkIXjoC9C0Av2NOrWmbLWT1vH32GcSUHjM0Arra6UfTsVyfMAuFzaLucXn1sadxJydAw== - 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" - -protobufjs@~6.10.2: - version "6.10.2" - resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-6.10.2.tgz#b9cb6bd8ec8f87514592ba3fdfd28e93f33a469b" - integrity sha512-27yj+04uF6ya9l+qfpH187aqEzfCF4+Uit0I9ZBQVqK09hk/SQzKa2MUqUpXaVa7LOFRg1TSSr3lVxGOk6c0SQ== - 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" - proxy-addr@~2.0.5: version "2.0.6" resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.6.tgz#fdc2336505447d3f2f2c638ed272caf614bbb2bf" @@ -6025,7 +5659,7 @@ querystringify@^2.1.1: resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-2.2.0.tgz#3345941b4153cb9d082d8eee4cda2016a9aef7f6" integrity sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ== -randombytes@2.1.0, randombytes@^2.0.1, randombytes@^2.1.0: +randombytes@^2.0.1, randombytes@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== @@ -6134,11 +5768,6 @@ readdirp@~3.5.0: dependencies: picomatch "^2.2.1" -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== - rechoir@^0.6.2: version "0.6.2" resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384" @@ -6371,10 +6000,10 @@ ripple-lib-transactionparser@0.8.2: bignumber.js "^9.0.0" lodash "^4.17.15" -ripple-lib@1.9.6: - version "1.9.6" - resolved "https://registry.yarnpkg.com/ripple-lib/-/ripple-lib-1.9.6.tgz#c3c071390597effc0ec191e22c9575108cd795f8" - integrity sha512-EJlbOWIqO8nDzHr/oO+/n7RvwGYAilRJPK/iwZjxPp5o+jNEBdHz1uVleAobasXS4tiVfBBDUP0nfhsxvluOWQ== +ripple-lib@1.9.5: + version "1.9.5" + resolved "https://registry.yarnpkg.com/ripple-lib/-/ripple-lib-1.9.5.tgz#6238c8869cc1353add3c8000016fabb6a1e72afe" + integrity sha512-de5lhHimuBM1TqtWNEobUDOToXK1VoB+svP9kvb8xy9cBRza5/kWWAR7FkQ2e1kPNXMR6G51HNPfTattCb9T9g== dependencies: "@types/lodash" "^4.14.136" "@types/ws" "^7.2.0" @@ -6401,7 +6030,7 @@ rxjs-compat@^6.6.7: resolved "https://registry.yarnpkg.com/rxjs-compat/-/rxjs-compat-6.6.7.tgz#6eb4ef75c0a58ea672854a701ccc8d49f41e69cb" integrity sha512-szN4fK+TqBPOFBcBcsR0g2cmTTUF/vaFEOZNuSdfU8/pGFnNmmn2u8SystYXG1QMrjOPBc6XTKHMVfENDf6hHw== -rxjs@6, rxjs@^6.6.7: +rxjs@6, rxjs@^6.6.6, rxjs@^6.6.7: version "6.6.7" resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.7.tgz#90ac018acabf491bf65044235d5863c4dab804c9" integrity sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ== @@ -6458,7 +6087,7 @@ scryptsy@^2.1.0: resolved "https://registry.yarnpkg.com/scryptsy/-/scryptsy-2.1.0.tgz#8d1e8d0c025b58fdd25b6fa9a0dc905ee8faa790" integrity sha512-1CdSqHQowJBnMAFyPEBRfqag/YP9OF394FV+4YREIJX4ljD7OxvQRDayyoyyCk+senRjSkP6VnUNQmVQqB6g7w== -secp256k1@4.0.2, secp256k1@^4.0.1, secp256k1@^4.0.2: +secp256k1@^4.0.1, secp256k1@^4.0.2: version "4.0.2" resolved "https://registry.yarnpkg.com/secp256k1/-/secp256k1-4.0.2.tgz#15dd57d0f0b9fdb54ac1fa1694f40e5e9a54f4a1" integrity sha512-UDar4sKvWAksIlfX3xIaQReADn+WFnHvbVujpcbr+9Sf/69odMwy2MUsz5CKLQgX9nsIyrjuxL2imVyoNHa3fg== @@ -6758,9 +6387,9 @@ stellar-base@^5.2.1: sodium-native "^2.3.0" stellar-sdk@^8.2.2: - version "8.2.3" - resolved "https://registry.yarnpkg.com/stellar-sdk/-/stellar-sdk-8.2.3.tgz#2970211877937e487b4e1f88021200cf0ddf8603" - integrity sha512-RlrR6DD+706vgA1iVDXteU/x3bdqFDthf+4M3C19D/owmF0GCR/FoRQpnPqqRJ0C/rbbdZ6YjAyKO6Q0GSbDWw== + version "8.2.2" + resolved "https://registry.yarnpkg.com/stellar-sdk/-/stellar-sdk-8.2.2.tgz#fd52bbf09992a60c38548c4ca97d9e14e98bab82" + integrity sha512-TCE69NV1/sZXfwGO3a7aGoskR/9Src7JNZMOli8jO8wTWi+JOzMhJi/SLj3qHp6xvMKI4Oonqz5HiRf0b0fsSQ== dependencies: "@types/eventsource" "^1.1.2" "@types/node" ">= 8" @@ -6916,11 +6545,6 @@ supports-color@^7.1.0: dependencies: has-flag "^4.0.0" -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== - table@^5.4.6: version "5.4.6" resolved "https://registry.yarnpkg.com/table/-/table-5.4.6.tgz#1292d19500ce3f86053b05f0e8e7e4a3bb21079e" @@ -6987,17 +6611,6 @@ through@^2.3.8: resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= -tiny-secp256k1@^1.1.3: - version "1.1.6" - resolved "https://registry.yarnpkg.com/tiny-secp256k1/-/tiny-secp256k1-1.1.6.tgz#7e224d2bee8ab8283f284e40e6b4acb74ffe047c" - integrity sha512-FmqJZGduTyvsr2cF3375fqGHUovSwDi/QytexX1Se4BPuPZpTE5Ftp5fg+EFSuEf3lhZqgCRjEG3ydUQ/aNiwA== - dependencies: - bindings "^1.3.0" - bn.js "^4.11.8" - create-hmac "^1.1.7" - elliptic "^6.4.0" - nan "^2.13.2" - to-fast-properties@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" @@ -7112,11 +6725,6 @@ type-fest@^0.10.0: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.10.0.tgz#7f06b2b9fbfc581068d1341ffabd0349ceafc642" integrity sha512-EUV9jo4sffrwlg8s0zDhP0T2WD3pru5Xi0+HTE3zTUmBaZNhfkite9PdSJwdXLwPVW0jnAHT56pZHIOYckPEiw== -type-fest@^0.11.0: - version "0.11.0" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.11.0.tgz#97abf0872310fed88a5c466b25681576145e33f1" - integrity sha512-OdjXJxnCN1AvyLSzeKIgXTXxV+99ZuXl3Hpo9XpJAv9MBcHrrJOQ5kV7ypXOuQie+AmWG25hLbiKdwYTifzcfQ== - type-is@~1.6.17, type-is@~1.6.18: version "1.6.18" resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131" @@ -7132,11 +6740,6 @@ typedarray-to-buffer@3.1.5: dependencies: is-typedarray "^1.0.0" -typeforce@^1.11.5: - version "1.18.0" - resolved "https://registry.yarnpkg.com/typeforce/-/typeforce-1.18.0.tgz#d7416a2c5845e085034d70fcc5b6cc4a90edbfdc" - integrity sha512-7uc1O8h1M1g0rArakJdf0uLRSSgFcYexrVoKo+bzJd32gd4gDy2L/Z+8/FjPnU9ydY3pEnVPtr9FyscYY60K1g== - typescript-compiler@^1.4.1-2: version "1.4.1-2" resolved "https://registry.yarnpkg.com/typescript-compiler/-/typescript-compiler-1.4.1-2.tgz#ba4f7db22d91534a1929d90009dce161eb72fd3f" @@ -7394,13 +6997,6 @@ wide-align@^1.1.0: dependencies: string-width "^1.0.2 || 2" -wif@^2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/wif/-/wif-2.0.6.tgz#08d3f52056c66679299726fade0d432ae74b4704" - integrity sha1-CNP1IFbGZnkplyb63g1DKudLRwQ= - dependencies: - bs58check "<3.0.0" - window-getters@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/window-getters/-/window-getters-1.0.0.tgz#b5b264538c4c79cead027f9997850222bf6d0852" @@ -7477,23 +7073,10 @@ ws@7.4.6: resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.6.tgz#5654ca8ecdeee47c33a9a4bf6d28e2be2980377c" integrity sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A== -ws@^7: - version "7.5.2" - resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.2.tgz#09cc8fea3bec1bc5ed44ef51b42f945be36900f6" - integrity sha512-lkF7AWRicoB9mAgjeKbGqVUekLnSNO4VjKVnuPHpQeOxZOErX6BPXwJk70nFslRCEEA8EVW7ZjKwXaP9N+1sKQ== - -xstate@^4.22.0: - version "4.22.0" - resolved "https://registry.yarnpkg.com/xstate/-/xstate-4.22.0.tgz#5d6c2a762cb94c3170ee826d26194b7561d70aae" - integrity sha512-WBQS/XxmjCH6789fx5JXjct2pWA0ZI0a1Kx8PJMurzgytkJH3vC2+QganHWzK38vG9PyXHefyVG54UN5q6YVSw== - -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" +xstate@^4.20.0: + version "4.20.0" + resolved "https://registry.yarnpkg.com/xstate/-/xstate-4.20.0.tgz#6f241f2b49c840cb6e05b32544a6048362f558e2" + integrity sha512-u5Ou1CMo/oWApasmv1TYTHgj38k69DJdTqQdBBwt+/ooNhPJQiSIKTB3Y3HvX0h5tulwfSo6xAwZgBgjRsK3LA== xxhashjs@^0.2.2: version "0.2.2" diff --git a/mobile-test-app/Gemfile.lock b/mobile-test-app/Gemfile.lock index 446bff3ddb..5e09c0c861 100644 --- a/mobile-test-app/Gemfile.lock +++ b/mobile-test-app/Gemfile.lock @@ -7,7 +7,7 @@ GEM minitest (~> 5.1) thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) - addressable (2.8.0) + addressable (2.7.0) public_suffix (>= 2.0.2, < 5.0) algoliasearch (1.27.1) httpclient (~> 2.8, >= 2.8.3) diff --git a/mobile-test-app/yarn.lock b/mobile-test-app/yarn.lock index ce408e62d1..e8ac11cd1e 100644 --- a/mobile-test-app/yarn.lock +++ b/mobile-test-app/yarn.lock @@ -1336,9 +1336,9 @@ form-data "^3.0.0" "@types/node@*", "@types/node@>= 8": - version "15.14.0" - resolved "https://registry.yarnpkg.com/@types/node/-/node-15.14.0.tgz#74dbf254fb375551a9d2a71faf6b9dbc2178dc53" - integrity sha512-um/+/ip3QZmwLfIkWZSNtQIJNVAqrJ92OkLMeuZrjZMTAJniI7fh8N8OICyDhAJ2mzgk/fmYFo72jRr5HyZ1EQ== + version "14.14.37" + resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.37.tgz#a3dd8da4eb84a996c36e331df98d82abd76b516e" + integrity sha512-XYmBiy+ohOR4Lh5jE379fV2IU+6Jn4g5qASinhitfyO71b/sCo6MKsMLF5tc7Zf2CE8hViVQyYSobJNke8OvUw== "@types/pbkdf2@^3.0.0": version "3.1.0" @@ -1401,9 +1401,9 @@ integrity sha512-RJJrrySY7A8havqpGObOB4W92QXKJo63/jFLLgpvOtsGUqbQZ9Sbgl35KMm1DjC6j7AvmmU2bIno+3IyEaemaw== "@types/urijs@^1.19.6": - version "1.19.16" - resolved "https://registry.yarnpkg.com/@types/urijs/-/urijs-1.19.16.tgz#156658c47438fa867db5dce4d2949fe1ca0878e2" - integrity sha512-WgxqcUSEYijGnNWHSln/uqay+AywS3mEhLC+d2PwLsru2fLeMblvxP67Y/SCfB2Pxe+dX/zbIoNNzXY+VKOtNA== + version "1.19.15" + resolved "https://registry.yarnpkg.com/@types/urijs/-/urijs-1.19.15.tgz#0142b92b52d07c4ba97dd82e7a54a875332942ec" + integrity sha512-pEDVREIvkyRtzpWlO5nqsUgR/JpLv9+lAzvkERCwoH2jXxl+TmaTNshhL7gjQLhfqgFUzCM6ovmoB1JssTop1A== "@types/ws@^7.2.0": version "7.4.0" @@ -2748,9 +2748,9 @@ detect-libc@^1.0.2: integrity sha1-+hN8S9aY7fVc1c0CrFWfkaTEups= detect-node@^2.0.4: - version "2.1.0" - resolved "https://registry.yarnpkg.com/detect-node/-/detect-node-2.1.0.tgz#c9c70775a49c3d03bc2c06d9a73be550f978f8b1" - integrity sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g== + version "2.0.5" + resolved "https://registry.yarnpkg.com/detect-node/-/detect-node-2.0.5.tgz#9d270aa7eaa5af0b72c4c9d9b814e7f4ce738b79" + integrity sha512-qi86tE6hRcFHy8jI1m2VG+LaPUR1LhqDa5G8tVjuUXmOrpuAgqsA1pN0+ldgr3aKUH+QLI9hCY/OcRYisERejw== diff-sequences@^24.9.0: version "24.9.0" @@ -3338,9 +3338,9 @@ fn.name@1.x.x: integrity sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw== follow-redirects@^1.10.0: - version "1.14.1" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.1.tgz#d9114ded0a1cfdd334e164e6662ad02bfd91ff43" - integrity sha512-HWqDgT7ZEkqRzBvc2s64vSZ/hfOceEol3ac/7tKwzuvEyWx3/4UegXh5oBOIotkGsObyk3xznnSRVADBgWSQVg== + version "1.13.0" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.13.0.tgz#b42e8d93a2a7eea5ed88633676d6597bc8e384db" + integrity sha512-aq6gF1BEKje4a9i9+5jimNFIpq4Q1WiwBToeRK5NvZBd/TRsmW8BsJfOEGkr76TbOyPVD3OVDN910EcUNtRYEA== for-in@^1.0.2: version "1.0.2" @@ -6442,10 +6442,10 @@ static-extend@^0.1.1: resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow= -stellar-base@^5.2.1: - version "5.3.0" - resolved "https://registry.yarnpkg.com/stellar-base/-/stellar-base-5.3.0.tgz#15e8d9f3767a62bda14d55f0c4347d27987ae1f6" - integrity sha512-8LCOX/D/Zp5DBhcTwXQSh9v25sHivkCJc+FSPncqhvMYgvQQg8w+2kj9hCFg1SAxkLJOjSpfzObrUaTl+CFFjw== +stellar-base@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/stellar-base/-/stellar-base-5.1.0.tgz#7c2d2c9fe7ec8781df41514bc351e8c749888278" + integrity sha512-J0hdF2UGKlRmwaQCpL5IedetJMDBvxTmoFEnvwHMxZBeSNfGt3+pjLi+dghURiWyuBOF9ZeyS8lUBeOhy/tOpA== dependencies: base32.js "^0.1.0" bignumber.js "^4.0.0" @@ -6458,9 +6458,9 @@ stellar-base@^5.2.1: sodium-native "^2.3.0" stellar-sdk@^8.1.1: - version "8.2.3" - resolved "https://registry.yarnpkg.com/stellar-sdk/-/stellar-sdk-8.2.3.tgz#2970211877937e487b4e1f88021200cf0ddf8603" - integrity sha512-RlrR6DD+706vgA1iVDXteU/x3bdqFDthf+4M3C19D/owmF0GCR/FoRQpnPqqRJ0C/rbbdZ6YjAyKO6Q0GSbDWw== + version "8.1.1" + resolved "https://registry.yarnpkg.com/stellar-sdk/-/stellar-sdk-8.1.1.tgz#3a1de4f5aa211dc41504275d4c12c85ef66ba742" + integrity sha512-crZSONO1lDEg2TP2wsslB7kcBopP6r2jzA5fC7JNvFZMMf0yq14fGDOwQerWI9XaxzpXOJxuQ1ZP3yB93Ds0+Q== dependencies: "@types/eventsource" "^1.1.2" "@types/node" ">= 8" @@ -6473,7 +6473,7 @@ stellar-sdk@^8.1.1: eventsource "^1.0.7" lodash "^4.17.11" randombytes "^2.1.0" - stellar-base "^5.2.1" + stellar-base "^5.1.0" toml "^2.3.0" tslib "^1.10.0" urijs "^1.19.1" diff --git a/package.json b/package.json index 8f7816d1c4..42bdeb7eb1 100644 --- a/package.json +++ b/package.json @@ -1,21 +1,18 @@ { - "engines": { - "node": ">=14" - }, "name": "@ledgerhq/live-common", "description": "Common ground for the Ledger Live apps", "repository": { "type": "git", "url": "https://github.com/LedgerHQ/ledger-live-common" }, - "version": "20.5.2", + "version": "19.12.1", "main": "lib/index.js", "license": "Apache-2.0", "scripts": { "flow-typed": "flow-typed install -s", "build": "./scripts/build.sh", "prepare": "yarn build", - "watch": "node scripts/buildReactIcons.js && node scripts/buildReactFlags.js && BABEL_ENV=cjs babel -wsd lib src & flow-copy-source -wv src lib", + "watch": "node scripts/buildReactIcons.js && BABEL_ENV=cjs babel -wsd lib src & flow-copy-source -wv src lib", "updateAppSupportsQuitApp": "node scripts/updateAppSupportsQuitApp.js", "prettier": "prettier --write 'src/**/*.?s' 'cli/src/**/*.?s'", "lint": "eslint src", @@ -23,10 +20,10 @@ "jest": "rimraf libcoredb && mkdir libcoredb && cross-env TZ=America/New_York jest", "test": "yarn jest", "ci-lint": "yarn lint && yarn flow", - "ci-test-common": "env-cmd -f ./.ci.env yarn test --ci --updateSnapshot && git diff --exit-code src", + "ci-test-common": "cross-env EXPERIMENTAL_EXPLORERS=1 yarn test --ci --updateSnapshot && git diff --exit-code src", "ci-setup-cli": "yalc publish && cd cli && yalc add @ledgerhq/live-common && yarn && yarn build && yarn link", "ci-test-cli": "cd cli && yarn test", - "ci-test-bot": "env-cmd -f ./.ci.env yarn jest --testMatch '**/*.bot.js'" + "ci-test-bot": "cross-env EXPERIMENTAL_EXPLORERS=1 yarn jest --testMatch '**/*.bot.js'" }, "files": [ "lib", @@ -61,9 +58,6 @@ "cli/", "test-helpers/" ], - "transformIgnorePatterns": [ - "/node_modules/(?!@polkadot|@babel/runtime/helpers/esm/)" - ], "moduleDirectories": [ "node_modules", "cli/node_modules" @@ -75,28 +69,26 @@ "react-redux": "7" }, "dependencies": { - "@crypto-com/chain-jslib": "^0.0.16", "@ledgerhq/compressjs": "1.3.2", - "@ledgerhq/cryptoassets": "6.1.0", - "@ledgerhq/devices": "6.1.0", + "@ledgerhq/cryptoassets": "6.0.2", + "@ledgerhq/devices": "6.0.2", "@ledgerhq/errors": "6.0.2", - "@ledgerhq/hw-app-algorand": "6.1.0", - "@ledgerhq/hw-app-btc": "6.1.0", - "@ledgerhq/hw-app-cosmos": "6.1.0", - "@ledgerhq/hw-app-eth": "6.1.0", - "@ledgerhq/hw-app-polkadot": "6.1.0", - "@ledgerhq/hw-app-str": "6.1.0", - "@ledgerhq/hw-app-tezos": "6.1.0", - "@ledgerhq/hw-app-trx": "6.1.0", - "@ledgerhq/hw-app-xrp": "6.1.0", - "@ledgerhq/hw-transport": "6.1.0", - "@ledgerhq/hw-transport-mocker": "6.1.0", - "@ledgerhq/hw-transport-node-speculos": "6.1.0", + "@ledgerhq/hw-app-algorand": "6.0.2", + "@ledgerhq/hw-app-btc": "6.0.2", + "@ledgerhq/hw-app-cosmos": "6.0.2", + "@ledgerhq/hw-app-eth": "6.0.2", + "@ledgerhq/hw-app-polkadot": "6.0.2", + "@ledgerhq/hw-app-str": "6.0.2", + "@ledgerhq/hw-app-tezos": "6.0.2", + "@ledgerhq/hw-app-trx": "6.0.2", + "@ledgerhq/hw-app-xrp": "6.0.2", + "@ledgerhq/hw-transport": "6.0.2", + "@ledgerhq/hw-transport-mocker": "6.0.2", + "@ledgerhq/hw-transport-node-speculos": "6.0.2", "@ledgerhq/logs": "6.0.2", - "@polkadot/types": "5.0.1", - "@polkadot/types-known": "5.0.1", + "@polkadot/types": "3.11.1", "@walletconnect/client": "1.4.1", - "@xstate/react": "^1.5.1", + "@xstate/react": "^1.3.4", "async": "^3.2.0", "axios": "0.21.1", "bchaddrjs": "^0.5.2", @@ -126,7 +118,7 @@ "ripemd160": "^2.0.2", "ripple-binary-codec": "^1.1.3", "ripple-bs58check": "^2.0.2", - "ripple-lib": "1.9.6", + "ripple-lib": "1.9.5", "rxjs": "6", "rxjs-compat": "^6.6.7", "secp256k1": "^4.0.2", @@ -135,7 +127,7 @@ "stellar-sdk": "^8.2.2", "triple-beam": "^1.3.0", "winston": "^3.3.3", - "xstate": "^4.22.0" + "xstate": "^4.20.0" }, "devDependencies": { "@babel/cli": "^7.13.16", @@ -154,7 +146,6 @@ "babel-jest": "^26.6.3", "benchmark": "^2.1.4", "cross-env": "^7.0.3", - "env-cmd": "*", "eslint": "^7.25.0", "eslint-config-airbnb": "^18.2.1", "eslint-config-prettier": "^7.2.0", diff --git a/scripts/build.sh b/scripts/build.sh index a6723134ee..2a4d82f95e 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -2,10 +2,9 @@ set -e -rm -rf lib src/data/icons/react* src/data/flags/react* +rm -rf lib src/data/icons/react* bash ./scripts/sync-families-dispatch.sh node scripts/buildReactIcons.js -node scripts/buildReactFlags.js BABEL_ENV=cjs babel --ignore __tests__ -s -d lib src flow-copy-source -i \"__tests__/**\" src lib diff --git a/scripts/buildReactFlags.js b/scripts/buildReactFlags.js deleted file mode 100644 index 78e2d21340..0000000000 --- a/scripts/buildReactFlags.js +++ /dev/null @@ -1,101 +0,0 @@ -const fs = require("fs"); -const glob = require("glob"); -const camelcase = require("camelcase"); -const path = require("path"); -const svgr = require("@svgr/core").default; - -const rootDir = path.join(__dirname, "../src/data/flags"); -const reactDir = `${rootDir}/react`; -const reactNativeDir = `${rootDir}/reactNative`; - -if (!fs.existsSync(reactDir)) { - fs.mkdirSync(reactDir); -} - -if (!fs.existsSync(reactNativeDir)) { - fs.mkdirSync(reactNativeDir); -} - -function reactTemplate( - { template }, - opts, - { imports, interfaces, componentName, _, jsx, exports } -) { - // @TODO update this once TS is the norm here - const plugins = ["js", "flow"]; - - // if (opts.typescript) { - // plugins.push("typescript"); - // } - - const tpl = template.smart({ plugins }); - return tpl.ast` - ${imports}; - - type Props = { - size: number, - } - - ${interfaces} - function ${componentName}({ size }: Props) { - return ${jsx}; - } - - ${exports} - `; -} - -const convert = (svg, options, componentName, outputFile) => { - svgr(svg, options, componentName) - .then((result) => { - // @TODO remove this flow comment once TS is the norm here - // can't do it is babel ast for now sorry about it - const component = `//@flow - ${result.replace("xlinkHref=", "href=")}`; - - fs.writeFileSync(outputFile, component, "utf-8"); - }) - .catch((e) => console.error(e)); -}; - -glob(`${rootDir}/svg/*.svg`, (err, icons) => { - fs.writeFileSync(`${reactDir}/index.js`, "", "utf-8"); - fs.writeFileSync(`${reactNativeDir}/index.js`, "", "utf-8"); - - icons.forEach((i) => { - let name = `${camelcase(path.basename(i, ".svg"))}Flag`; - const exportString = `export { default as ${name} } from "./${name}";\n`; - - fs.appendFileSync(`${reactDir}/index.js`, exportString, "utf-8"); - fs.appendFileSync(`${reactNativeDir}/index.js`, exportString, "utf-8"); - - const svg = fs.readFileSync(i, "utf-8"); - const options = { - expandProps: false, - componentName: name, - svgProps: { - viewBox: "0 0 38 30", - height: "{size}", - width: "{size/30*38}", - }, - }; - - convert( - svg, - { ...options, template: reactTemplate }, - { componentName: name }, - `${reactDir}/${name}.js` - ); - - convert( - svg, - { - ...options, - native: true, - template: reactTemplate, - }, - { componentName: name }, - `${reactNativeDir}/${name}.js` - ); - }); -}); diff --git a/src/__tests__/__snapshots__/all.libcore.js.snap b/src/__tests__/__snapshots__/all.libcore.js.snap index 1076b271af..8b7076a409 100644 --- a/src/__tests__/__snapshots__/all.libcore.js.snap +++ b/src/__tests__/__snapshots__/all.libcore.js.snap @@ -21193,7 +21193,7 @@ Array [ "starred": false, "subAccounts": Array [], "swapHistory": Array [], - "syncHash": "[\\"ethereum/erc20/ampleforth\\"]_2687", + "syncHash": "[\\"ethereum/erc20/ampleforth\\"]_2674", "unitMagnitude": 18, "used": true, }, @@ -21233,7 +21233,7 @@ Array [ "starred": false, "subAccounts": Array [], "swapHistory": Array [], - "syncHash": "[\\"ethereum/erc20/ampleforth\\"]_2687", + "syncHash": "[\\"ethereum/erc20/ampleforth\\"]_2674", "unitMagnitude": 18, "used": true, }, @@ -21712,7 +21712,7 @@ Array [ "starred": false, "subAccounts": Array [], "swapHistory": Array [], - "syncHash": "[\\"ethereum/erc20/ampleforth\\"]_2687", + "syncHash": "[\\"ethereum/erc20/ampleforth\\"]_2674", "unitMagnitude": 18, "used": true, }, @@ -22032,7 +22032,7 @@ Array [ "starred": false, "subAccounts": Array [], "swapHistory": Array [], - "syncHash": "[\\"ethereum/erc20/ampleforth\\"]_2687", + "syncHash": "[\\"ethereum/erc20/ampleforth\\"]_2674", "unitMagnitude": 18, "used": true, }, @@ -22128,7 +22128,7 @@ Array [ "starred": false, "subAccounts": Array [], "swapHistory": Array [], - "syncHash": "[\\"ethereum/erc20/ampleforth\\"]_2687", + "syncHash": "[\\"ethereum/erc20/ampleforth\\"]_2674", "unitMagnitude": 18, "used": true, }, @@ -22252,7 +22252,7 @@ Array [ "starred": false, "subAccounts": Array [], "swapHistory": Array [], - "syncHash": "[\\"ethereum/erc20/ampleforth\\"]_2687", + "syncHash": "[\\"ethereum/erc20/ampleforth\\"]_2674", "unitMagnitude": 18, "used": true, }, @@ -22348,7 +22348,7 @@ Array [ "starred": false, "subAccounts": Array [], "swapHistory": Array [], - "syncHash": "[\\"ethereum/erc20/ampleforth\\"]_2687", + "syncHash": "[\\"ethereum/erc20/ampleforth\\"]_2674", "unitMagnitude": 18, "used": true, }, @@ -51014,22 +51014,22 @@ Array [ "RPUb5G4iGWhJy6TEzwhntA4qoyJSmXjSak", ], "senders": Array [ - "RJefAEr1mDREUPcw4uAR8m9pQHHthvVF5V", - "RC7fCw4b7F4h3uDuYMMBvx8HE8ubwVuZMc", - "RU6LhQVXErq5vxdbm5ubnJnr236C1b9wFn", - "RTSyLffZtjPKZ1PLv6Dz7Sb2rWP8MHZbYA", "RPL2Ws9tYcSmTZ7fCfZnybGZrFnrjfHY5W", - "RDqp2hjeDt1YJXvB1c8udT8o3qJz25T89F", - "RHYxa3xWSPULd8deeYak1emQ9G61v3cBUy", - "RFepmqmpXL5dFBJYSFoncN2Fphn2KiFH2S", "RUHd4GPvw4j6MSitJNC1bJjdpEA7tiFGC6", + "RC7fCw4b7F4h3uDuYMMBvx8HE8ubwVuZMc", + "RDqp2hjeDt1YJXvB1c8udT8o3qJz25T89F", + "RJefAEr1mDREUPcw4uAR8m9pQHHthvVF5V", "RPceGQQsZvvTzButAx1tZ9g8kM6eWdkVhg", + "RHYxa3xWSPULd8deeYak1emQ9G61v3cBUy", + "RTSyLffZtjPKZ1PLv6Dz7Sb2rWP8MHZbYA", + "RU6LhQVXErq5vxdbm5ubnJnr236C1b9wFn", + "RHQeF3BUrN1ub5PqdQhWTAbJB2pv7xukML", + "RKSuhHTzgmc5gnFDCdSJt3U8HWeNYnPuK6", "RJXH5iiDG9GGP3uFN4y9nZznWm4H7WRpZr", - "RNBip2PqrD9xhkoK613VptMqjfS1Sdwa2p", "RQeZqrkJuGpv3nCF3QriSUt7b7zRaE2WDj", + "RFepmqmpXL5dFBJYSFoncN2Fphn2KiFH2S", "RQeZqrkJuGpv3nCF3QriSUt7b7zRaE2WDj", - "RHQeF3BUrN1ub5PqdQhWTAbJB2pv7xukML", - "RKSuhHTzgmc5gnFDCdSJt3U8HWeNYnPuK6", + "RNBip2PqrD9xhkoK613VptMqjfS1Sdwa2p", "RRmshus5KvRKRY1oT56imffSFuxPUPS7s1", ], "type": "IN", @@ -51064,10 +51064,10 @@ Array [ "RMLMRFQBN1xgsLmCUbgfEsRpkEHTFKcKT2", ], "senders": Array [ - "RRUYWQYzTbMA5i87hf3CBikMyFH5xv1p3x", - "RX2Z69ru9Rupds9UJR2SA2UyQEVeEi6uCS", "RTRMxYQJFfXmtdkrDjLpQt44qvsMoaTHnj", "RGW6W4DZowZ2GdX55tmavbLu8ZAkoMTaMs", + "RX2Z69ru9Rupds9UJR2SA2UyQEVeEi6uCS", + "RRUYWQYzTbMA5i87hf3CBikMyFH5xv1p3x", ], "type": "IN", "value": "958600000", @@ -51084,10 +51084,10 @@ Array [ "RMLMRFQBN1xgsLmCUbgfEsRpkEHTFKcKT2", ], "senders": Array [ - "RRUYWQYzTbMA5i87hf3CBikMyFH5xv1p3x", - "RX2Z69ru9Rupds9UJR2SA2UyQEVeEi6uCS", "RTRMxYQJFfXmtdkrDjLpQt44qvsMoaTHnj", "RGW6W4DZowZ2GdX55tmavbLu8ZAkoMTaMs", + "RX2Z69ru9Rupds9UJR2SA2UyQEVeEi6uCS", + "RRUYWQYzTbMA5i87hf3CBikMyFH5xv1p3x", ], "type": "OUT", "value": "958602010", @@ -51292,12 +51292,12 @@ Array [ "RUFezg3Y15ETRm6bEnEn3BCxwbVHy6bNtQ", ], "senders": Array [ - "RH5evC49ptzuXtejGCRKnEAmvMDBpht93B", - "RL56vZfA7ZEK5y8NVvg2mhmnEAsnCxhdWX", - "RK8876U89usNdEQ9Rrf3y5WbzaWSNejAUg", "RShN4KVXxJRPMtTtEH5FrnP8PyZzbiDrF1", "RGpavZ4T1w7UQaQk7EguLDjCCN72t2TAHZ", "RPpRK88iPS74bggXhqkrat2fSMfNpTJRZB", + "RL56vZfA7ZEK5y8NVvg2mhmnEAsnCxhdWX", + "RK8876U89usNdEQ9Rrf3y5WbzaWSNejAUg", + "RH5evC49ptzuXtejGCRKnEAmvMDBpht93B", ], "type": "IN", "value": "152825000", @@ -51368,8 +51368,8 @@ Array [ "RGkkBY1Sm5hRcYYNTSjjdJ6szN5pV7PCUC", ], "senders": Array [ - "RJJcPeUCrqvNhRYsArgXpstBTFgfYCSDzv", "RWVhCh1JzLB6R2tVGej6MmM8eUedTYAtDS", + "RJJcPeUCrqvNhRYsArgXpstBTFgfYCSDzv", ], "type": "OUT", "value": "658000374", @@ -51404,22 +51404,22 @@ Array [ "RAk2tjcuvj43PD7qQf4iA3tDTPH2DV6h3U", ], "senders": Array [ + "RSLN3e8R5EAxxpQrTo7DnA28GS1vWWdMrg", + "RGNWy7th499k6XiwqEikfNMRQje8DJo844", + "RHHNE9STEUT7i3duUw1eeHBKw2rBgzjBXx", + "RL9A3qSt1sFmN53CFhgmgVfbqNcEQr3vb9", "RLYGtUx7btUCBVZXu7NNYWZ7b8sBAuPrYw", "RSwtr8GTRhb7DaMxLxsHpJtSwKVvgQykMV", - "RSwtr8GTRhb7DaMxLxsHpJtSwKVvgQykMV", "RWcX7eETAYi5kY6tdnFUnB2Ym91ys8nDS3", - "RL9A3qSt1sFmN53CFhgmgVfbqNcEQr3vb9", - "RSLN3e8R5EAxxpQrTo7DnA28GS1vWWdMrg", + "RSBWKbE9QgpwRMRLXdHoeArJxdwC1T64CH", + "RSwtr8GTRhb7DaMxLxsHpJtSwKVvgQykMV", "RY46BXxDRnRLgihFmgJfTfL8KdCTxBfb8y", - "RMRDUxS3NK6WmhfCegYDgNxHV9jCf43JsU", + "RAL9ALvajDctnaSps5WJqxrtcs7VmkepGP", "RHdxmxNNMR1x63pEZpYgsdnKrtU2Y1mNCw", - "RGNWy7th499k6XiwqEikfNMRQje8DJo844", - "RQjtqfFYe3KTTSCT8STvm9VXSEeGp4uGSR", - "RPrYigcs1VYujYLX8ZvUTARBhZiU1LwSUR", "RUrLYTstF6Lk9sKLe6hmxkqTZxh6z2xVoQ", - "RHHNE9STEUT7i3duUw1eeHBKw2rBgzjBXx", - "RAL9ALvajDctnaSps5WJqxrtcs7VmkepGP", - "RSBWKbE9QgpwRMRLXdHoeArJxdwC1T64CH", + "RMRDUxS3NK6WmhfCegYDgNxHV9jCf43JsU", + "RPrYigcs1VYujYLX8ZvUTARBhZiU1LwSUR", + "RQjtqfFYe3KTTSCT8STvm9VXSEeGp4uGSR", ], "type": "IN", "value": "2513651102", @@ -51454,8 +51454,8 @@ Array [ "RX2Z69ru9Rupds9UJR2SA2UyQEVeEi6uCS", ], "senders": Array [ - "RG3NVhdczLipGZvCnqfQhgMPwV6T3RwRX8", "RXqM1qvrfE3ode3rG5zWgUUsmbLp1b7nur", + "RG3NVhdczLipGZvCnqfQhgMPwV6T3RwRX8", ], "type": "IN", "value": "354228900", @@ -51577,10 +51577,10 @@ Array [ "RLwt3WByFtb3ys6QmPc8i78krC4us4toR2", ], "senders": Array [ - "RLm3LbyQADa7oD2EUtd5NJJxeVKAjkXbby", + "RUFezg3Y15ETRm6bEnEn3BCxwbVHy6bNtQ", "RHMRCjLZVUt5QivbKqpRp6BfvLtnXeih7n", "RPhNPLNReWJdZCESh55oiX1ZpMYDuwdPec", - "RUFezg3Y15ETRm6bEnEn3BCxwbVHy6bNtQ", + "RLm3LbyQADa7oD2EUtd5NJJxeVKAjkXbby", ], "type": "OUT", "value": "100001340", @@ -51649,8 +51649,8 @@ Array [ "RXgZGSvASzxiynSiWfut2aUV9ppJA3MCB9", ], "senders": Array [ - "RGpU9iVqpXxWum6S5Lph1mi3LR7WSmSj9P", "RMLMRFQBN1xgsLmCUbgfEsRpkEHTFKcKT2", + "RGpU9iVqpXxWum6S5Lph1mi3LR7WSmSj9P", ], "type": "OUT", "value": "665633168", @@ -51668,8 +51668,8 @@ Array [ ], "senders": Array [ "RDf9fBMKGQq4jS2J97SiXEdLYmJNw5Vi8b", - "RJsjsWzwWHCRH2LapH3o9C3nGmX3Waq9x1", "RYJDkz5m4rcTh9DhpRDdaAuakPCsoQ42hZ", + "RJsjsWzwWHCRH2LapH3o9C3nGmX3Waq9x1", ], "type": "IN", "value": "294864099", @@ -51720,8 +51720,8 @@ Array [ "RG3NVhdczLipGZvCnqfQhgMPwV6T3RwRX8", ], "senders": Array [ - "RFgaa7eWegjEYg9gJkgvxcQ5FJyCceLMut", "RPGKRR3iPKHU95NtwvnQSnmQQWBSea1E9V", + "RFgaa7eWegjEYg9gJkgvxcQ5FJyCceLMut", ], "type": "OUT", "value": "300001122", @@ -51789,10 +51789,10 @@ Array [ "RGzpra2ocm9hhk4MZwXDPgfkpQfkywzdWm", ], "senders": Array [ - "RKb2xHTs9m5Z7mfV9B6CBCXd5rMautbHff", "R9x3jfPUWGVyasxwpbhG5wQJUo2oAJSTiy", "RGEFfDaCWwwnLbs8LBwQHmd5gsrGzpgLoL", "RQF74tgS3fgMge211AGcaHveLAG8PZJPTj", + "RKb2xHTs9m5Z7mfV9B6CBCXd5rMautbHff", "RRnNF15Zwg9HXAqV2bcKn3ekjkXj5G4B4w", ], "type": "OUT", @@ -51861,12 +51861,12 @@ Array [ "RPhNPLNReWJdZCESh55oiX1ZpMYDuwdPec", ], "senders": Array [ - "RNaGmLqLFhW9u7eqLA5D2Tfb4FgpKRvYYo", + "RGbmHsx1ExgxC3AmyYycBe9Xvdou2j3ERD", "RJS2Rg2PE3ChhPKtBiPRskmTJciv3nR9Aa", - "RAdQbQFFTV2hpXZB69D5SJQFt175XcZFHk", "RDHKsbJ8CrZQMDLYACszFGhCEdpw3K2mRW", + "RAdQbQFFTV2hpXZB69D5SJQFt175XcZFHk", "RTK83cYisa2G2DxpAuxE78Wd6wWMAKCWuD", - "RGbmHsx1ExgxC3AmyYycBe9Xvdou2j3ERD", + "RNaGmLqLFhW9u7eqLA5D2Tfb4FgpKRvYYo", ], "type": "IN", "value": "74100000", @@ -51917,9 +51917,9 @@ Array [ "RUq8VcnDy1qjzzKcLTP5SR3zP2tWxnixBv", ], "senders": Array [ - "RSATezniZfbmWvf4a8fRvULYkXii7p3PYP", - "RXQnZrhtDiH77pa8afLDnub6KfjrPRR8gs", "RCtv8ZRjsW53cn6RS8b5iry7XBqiQWuQVD", + "RXQnZrhtDiH77pa8afLDnub6KfjrPRR8gs", + "RSATezniZfbmWvf4a8fRvULYkXii7p3PYP", ], "type": "OUT", "value": "300001044", @@ -51990,8 +51990,8 @@ Array [ "RJJcPeUCrqvNhRYsArgXpstBTFgfYCSDzv", ], "senders": Array [ - "RUohAyCGt1wWPkpnrUbKem87nWjFTakvmb", "RCA6paLq1zpAVKXA1fhCaVwPoAUXJgX83s", + "RUohAyCGt1wWPkpnrUbKem87nWjFTakvmb", ], "type": "IN", "value": "400000000", @@ -52217,8 +52217,8 @@ Array [ "RV9wcNWLnAxCf8b2Rpw8mPdAJHWfA4YjY3", ], "senders": Array [ - "RUVg5GSg7KjJSgWRDSyZJk8Vtx9UzVL2m9", "RBCc1ZPzP9PWARyR9cdUkaNbhwt2wutvNu", + "RUVg5GSg7KjJSgWRDSyZJk8Vtx9UzVL2m9", "RJYYeHQKSeyzm6fF1RF1qoBkAQ1scQ1LRR", ], "type": "IN", @@ -52444,8 +52444,8 @@ Array [ "RGkkBY1Sm5hRcYYNTSjjdJ6szN5pV7PCUC", ], "senders": Array [ - "RJJcPeUCrqvNhRYsArgXpstBTFgfYCSDzv", "RWVhCh1JzLB6R2tVGej6MmM8eUedTYAtDS", + "RJJcPeUCrqvNhRYsArgXpstBTFgfYCSDzv", ], "type": "IN", "value": "658000000", @@ -52515,8 +52515,8 @@ Array [ "RX2Z69ru9Rupds9UJR2SA2UyQEVeEi6uCS", ], "senders": Array [ - "RG3NVhdczLipGZvCnqfQhgMPwV6T3RwRX8", "RXqM1qvrfE3ode3rG5zWgUUsmbLp1b7nur", + "RG3NVhdczLipGZvCnqfQhgMPwV6T3RwRX8", ], "type": "OUT", "value": "354230022", @@ -52742,8 +52742,8 @@ Array [ "RXgZGSvASzxiynSiWfut2aUV9ppJA3MCB9", ], "senders": Array [ - "RGpU9iVqpXxWum6S5Lph1mi3LR7WSmSj9P", "RMLMRFQBN1xgsLmCUbgfEsRpkEHTFKcKT2", + "RGpU9iVqpXxWum6S5Lph1mi3LR7WSmSj9P", ], "type": "IN", "value": "665632420", @@ -52845,8 +52845,8 @@ Array [ "RG3NVhdczLipGZvCnqfQhgMPwV6T3RwRX8", ], "senders": Array [ - "RFgaa7eWegjEYg9gJkgvxcQ5FJyCceLMut", "RPGKRR3iPKHU95NtwvnQSnmQQWBSea1E9V", + "RFgaa7eWegjEYg9gJkgvxcQ5FJyCceLMut", ], "type": "IN", "value": "300000000", @@ -52880,10 +52880,10 @@ Array [ "RGzpra2ocm9hhk4MZwXDPgfkpQfkywzdWm", ], "senders": Array [ - "RKb2xHTs9m5Z7mfV9B6CBCXd5rMautbHff", "R9x3jfPUWGVyasxwpbhG5wQJUo2oAJSTiy", "RGEFfDaCWwwnLbs8LBwQHmd5gsrGzpgLoL", "RQF74tgS3fgMge211AGcaHveLAG8PZJPTj", + "RKb2xHTs9m5Z7mfV9B6CBCXd5rMautbHff", "RRnNF15Zwg9HXAqV2bcKn3ekjkXj5G4B4w", ], "type": "IN", @@ -53071,9 +53071,9 @@ Array [ "RUq8VcnDy1qjzzKcLTP5SR3zP2tWxnixBv", ], "senders": Array [ - "RSATezniZfbmWvf4a8fRvULYkXii7p3PYP", - "RXQnZrhtDiH77pa8afLDnub6KfjrPRR8gs", "RCtv8ZRjsW53cn6RS8b5iry7XBqiQWuQVD", + "RXQnZrhtDiH77pa8afLDnub6KfjrPRR8gs", + "RSATezniZfbmWvf4a8fRvULYkXii7p3PYP", ], "type": "IN", "value": "300000000", @@ -53090,14 +53090,14 @@ Array [ "RHve7nnW4ZFgHz9bboyKfFVkL7pQ5rxp4q", ], "senders": Array [ - "RCi43iyaY9fRsoLXEFKA3Num2SVtmcwV6X", - "RDMc6vAY5ihjPdMJYVdzLymdPztBFhGPE2", "RFKpGt3yvf1Kgp9vqrHRzKV8RvdHZYaSFB", + "RDMc6vAY5ihjPdMJYVdzLymdPztBFhGPE2", "RJmbtWXrHtFQFz29f3R66QLW7rDsNYcuWq", "RAjBzAgtHFT3En7FaTbaZ6Acx8XeYdTtGD", - "RS4hAHh9ciFwHWpzdXpsq1St2eQNQkG2az", + "RCi43iyaY9fRsoLXEFKA3Num2SVtmcwV6X", "RNjtQQGgn3SZ4D5QBLVC8fYauox4bmFN6o", "RUq8VcnDy1qjzzKcLTP5SR3zP2tWxnixBv", + "RS4hAHh9ciFwHWpzdXpsq1St2eQNQkG2az", ], "type": "IN", "value": "2450585000", @@ -53114,14 +53114,14 @@ Array [ "RHve7nnW4ZFgHz9bboyKfFVkL7pQ5rxp4q", ], "senders": Array [ - "RCi43iyaY9fRsoLXEFKA3Num2SVtmcwV6X", - "RDMc6vAY5ihjPdMJYVdzLymdPztBFhGPE2", "RFKpGt3yvf1Kgp9vqrHRzKV8RvdHZYaSFB", + "RDMc6vAY5ihjPdMJYVdzLymdPztBFhGPE2", "RJmbtWXrHtFQFz29f3R66QLW7rDsNYcuWq", "RAjBzAgtHFT3En7FaTbaZ6Acx8XeYdTtGD", - "RS4hAHh9ciFwHWpzdXpsq1St2eQNQkG2az", + "RCi43iyaY9fRsoLXEFKA3Num2SVtmcwV6X", "RNjtQQGgn3SZ4D5QBLVC8fYauox4bmFN6o", "RUq8VcnDy1qjzzKcLTP5SR3zP2tWxnixBv", + "RS4hAHh9ciFwHWpzdXpsq1St2eQNQkG2az", ], "type": "OUT", "value": "2450588294", @@ -53172,8 +53172,8 @@ Array [ "RJJcPeUCrqvNhRYsArgXpstBTFgfYCSDzv", ], "senders": Array [ - "RUohAyCGt1wWPkpnrUbKem87nWjFTakvmb", "RCA6paLq1zpAVKXA1fhCaVwPoAUXJgX83s", + "RUohAyCGt1wWPkpnrUbKem87nWjFTakvmb", ], "type": "OUT", "value": "400001122", @@ -53281,12 +53281,12 @@ Array [ "RTvAn5VZoyG6mKCRaM79yMBbS3tSTfoxqd", ], "senders": Array [ + "RHnd78KCFWtKx8w1yYLGksh8jmYdUF4PpD", + "RNapVgVAN3p9jidrEdqZiYb8aLTpQUfjR6", "RAsAgiVzseCmyBPQponJKtVdxxb3Di5jiZ", "RUDGPKrAzsLt9tMFrppo5gdZDA7wTW7HsY", - "RHnd78KCFWtKx8w1yYLGksh8jmYdUF4PpD", "RFB7G524miPGi6fAG43FGLy84DhtEBqmuG", "RK7qVmRQdEtZFsnm6Py7BdZuGYpZu8q4zK", - "RNapVgVAN3p9jidrEdqZiYb8aLTpQUfjR6", ], "type": "OUT", "value": "2117128318", @@ -53408,22 +53408,22 @@ Array [ "RPUb5G4iGWhJy6TEzwhntA4qoyJSmXjSak", ], "senders": Array [ - "RJefAEr1mDREUPcw4uAR8m9pQHHthvVF5V", - "RC7fCw4b7F4h3uDuYMMBvx8HE8ubwVuZMc", - "RU6LhQVXErq5vxdbm5ubnJnr236C1b9wFn", - "RTSyLffZtjPKZ1PLv6Dz7Sb2rWP8MHZbYA", "RPL2Ws9tYcSmTZ7fCfZnybGZrFnrjfHY5W", - "RDqp2hjeDt1YJXvB1c8udT8o3qJz25T89F", - "RHYxa3xWSPULd8deeYak1emQ9G61v3cBUy", - "RFepmqmpXL5dFBJYSFoncN2Fphn2KiFH2S", "RUHd4GPvw4j6MSitJNC1bJjdpEA7tiFGC6", + "RC7fCw4b7F4h3uDuYMMBvx8HE8ubwVuZMc", + "RDqp2hjeDt1YJXvB1c8udT8o3qJz25T89F", + "RJefAEr1mDREUPcw4uAR8m9pQHHthvVF5V", "RPceGQQsZvvTzButAx1tZ9g8kM6eWdkVhg", + "RHYxa3xWSPULd8deeYak1emQ9G61v3cBUy", + "RTSyLffZtjPKZ1PLv6Dz7Sb2rWP8MHZbYA", + "RU6LhQVXErq5vxdbm5ubnJnr236C1b9wFn", + "RHQeF3BUrN1ub5PqdQhWTAbJB2pv7xukML", + "RKSuhHTzgmc5gnFDCdSJt3U8HWeNYnPuK6", "RJXH5iiDG9GGP3uFN4y9nZznWm4H7WRpZr", - "RNBip2PqrD9xhkoK613VptMqjfS1Sdwa2p", "RQeZqrkJuGpv3nCF3QriSUt7b7zRaE2WDj", + "RFepmqmpXL5dFBJYSFoncN2Fphn2KiFH2S", "RQeZqrkJuGpv3nCF3QriSUt7b7zRaE2WDj", - "RHQeF3BUrN1ub5PqdQhWTAbJB2pv7xukML", - "RKSuhHTzgmc5gnFDCdSJt3U8HWeNYnPuK6", + "RNBip2PqrD9xhkoK613VptMqjfS1Sdwa2p", "RRmshus5KvRKRY1oT56imffSFuxPUPS7s1", ], "type": "OUT", @@ -53509,8 +53509,8 @@ Array [ "RV9wcNWLnAxCf8b2Rpw8mPdAJHWfA4YjY3", ], "senders": Array [ - "RUVg5GSg7KjJSgWRDSyZJk8Vtx9UzVL2m9", "RBCc1ZPzP9PWARyR9cdUkaNbhwt2wutvNu", + "RUVg5GSg7KjJSgWRDSyZJk8Vtx9UzVL2m9", "RJYYeHQKSeyzm6fF1RF1qoBkAQ1scQ1LRR", ], "type": "OUT", @@ -53598,12 +53598,12 @@ Array [ "RUFezg3Y15ETRm6bEnEn3BCxwbVHy6bNtQ", ], "senders": Array [ - "RH5evC49ptzuXtejGCRKnEAmvMDBpht93B", - "RL56vZfA7ZEK5y8NVvg2mhmnEAsnCxhdWX", - "RK8876U89usNdEQ9Rrf3y5WbzaWSNejAUg", "RShN4KVXxJRPMtTtEH5FrnP8PyZzbiDrF1", "RGpavZ4T1w7UQaQk7EguLDjCCN72t2TAHZ", "RPpRK88iPS74bggXhqkrat2fSMfNpTJRZB", + "RL56vZfA7ZEK5y8NVvg2mhmnEAsnCxhdWX", + "RK8876U89usNdEQ9Rrf3y5WbzaWSNejAUg", + "RH5evC49ptzuXtejGCRKnEAmvMDBpht93B", ], "type": "OUT", "value": "152827411", @@ -53739,10 +53739,10 @@ Array [ "RLwt3WByFtb3ys6QmPc8i78krC4us4toR2", ], "senders": Array [ - "RLm3LbyQADa7oD2EUtd5NJJxeVKAjkXbby", + "RUFezg3Y15ETRm6bEnEn3BCxwbVHy6bNtQ", "RHMRCjLZVUt5QivbKqpRp6BfvLtnXeih7n", "RPhNPLNReWJdZCESh55oiX1ZpMYDuwdPec", - "RUFezg3Y15ETRm6bEnEn3BCxwbVHy6bNtQ", + "RLm3LbyQADa7oD2EUtd5NJJxeVKAjkXbby", ], "type": "IN", "value": "100000000", @@ -53998,12 +53998,12 @@ Array [ "RPhNPLNReWJdZCESh55oiX1ZpMYDuwdPec", ], "senders": Array [ - "RNaGmLqLFhW9u7eqLA5D2Tfb4FgpKRvYYo", + "RGbmHsx1ExgxC3AmyYycBe9Xvdou2j3ERD", "RJS2Rg2PE3ChhPKtBiPRskmTJciv3nR9Aa", - "RAdQbQFFTV2hpXZB69D5SJQFt175XcZFHk", "RDHKsbJ8CrZQMDLYACszFGhCEdpw3K2mRW", + "RAdQbQFFTV2hpXZB69D5SJQFt175XcZFHk", "RTK83cYisa2G2DxpAuxE78Wd6wWMAKCWuD", - "RGbmHsx1ExgxC3AmyYycBe9Xvdou2j3ERD", + "RNaGmLqLFhW9u7eqLA5D2Tfb4FgpKRvYYo", ], "type": "OUT", "value": "74101932", diff --git a/src/__tests__/accounts/importAccounts.js b/src/__tests__/accounts/importAccounts.js index b5a665ed25..732618cbd9 100644 --- a/src/__tests__/accounts/importAccounts.js +++ b/src/__tests__/accounts/importAccounts.js @@ -6,9 +6,6 @@ import { fromAccountRaw, } from "../../account"; import { setSupportedCurrencies } from "../../currencies"; -import { setPlatformVersion } from "../../platform/version"; - -setPlatformVersion("0.0.1"); setSupportedCurrencies(["ethereum"]); diff --git a/src/__tests__/test-helpers/setup.js b/src/__tests__/test-helpers/setup.js index 3f26e17631..6dbac777d5 100644 --- a/src/__tests__/test-helpers/setup.js +++ b/src/__tests__/test-helpers/setup.js @@ -1,10 +1,7 @@ import { setSupportedCurrencies } from "../../currencies"; -import { setPlatformVersion } from "../../platform/version"; jest.setTimeout(180000); -setPlatformVersion("0.0.1"); - setSupportedCurrencies([ "bitcoin", "ethereum", diff --git a/src/account/ordering.js b/src/account/ordering.js index 1e4aad9392..e4373100d2 100644 --- a/src/account/ordering.js +++ b/src/account/ordering.js @@ -35,10 +35,7 @@ export const sortAccountsComparatorFromOrder = ( const ascValue = sort === "desc" ? -1 : 1; if (order === "name") { return (a, b) => - ascValue * - sortNameLense(a).localeCompare(sortNameLense(b), undefined, { - numeric: true, - }); + ascValue * sortNameLense(a).localeCompare(sortNameLense(b)); } const cvCaches = {}; const lazyCalcCV = (a) => { diff --git a/src/account/serialization.js b/src/account/serialization.js index edbfdf5ea3..907fbc5d4f 100644 --- a/src/account/serialization.js +++ b/src/account/serialization.js @@ -757,10 +757,6 @@ export function fromAccountRaw(rawAccount: AccountRaw): Account { res.elrondResources = fromElrondResourcesRaw(elrondResources); } - if (cryptoOrgResources) { - res.cryptoOrgResources = fromCryptoOrgResourcesRaw(cryptoOrgResources); - } - return res; } diff --git a/src/api/explorerConfig/index.js b/src/api/explorerConfig/index.js index 6c4cdefe9d..5ebae4a8bf 100644 --- a/src/api/explorerConfig/index.js +++ b/src/api/explorerConfig/index.js @@ -98,12 +98,10 @@ const initialExplorerConfig: FullConfig = { base: "EXPLORER", version: "v2", }, - /* experimental: { base: "EXPLORER", version: "v3", }, - */ }, litecoin: { id: "ltc", diff --git a/src/apps/filtering.test.js b/src/apps/filtering.test.js index 1caf53ffe8..3eebfeedf7 100644 --- a/src/apps/filtering.test.js +++ b/src/apps/filtering.test.js @@ -5,9 +5,6 @@ import { deviceInfo155, mockListAppsResult } from "./mock"; import type { FilterOptions, SortOptions } from "./filtering"; import { sortFilterApps } from "./filtering"; import { setSupportedCurrencies } from "../currencies/support"; -import { setPlatformVersion } from "../platform/version"; - -setPlatformVersion("0.0.1"); type FilteringScenario = { name: string, diff --git a/src/apps/hw.js b/src/apps/hw.js index d647dd6f06..86caabb095 100644 --- a/src/apps/hw.js +++ b/src/apps/hw.js @@ -1,8 +1,7 @@ // @flow import Transport from "@ledgerhq/hw-transport"; -// $FlowExpectedError Caused by TS migration, flow def support stopped at v5. -import { getDeviceModel, identifyTargetId } from "@ledgerhq/devices"; +import { getDeviceModel } from "@ledgerhq/devices"; import { UnexpectedBootloader } from "@ledgerhq/errors"; import { concat, of, empty, from, Observable, throwError, defer } from "rxjs"; import { mergeMap, map } from "rxjs/operators"; @@ -119,9 +118,7 @@ export const listApps = ( const deviceModelId = // $FlowFixMe - (transport.deviceModel && transport.deviceModel.id) || - (deviceInfo && identifyTargetId(deviceInfo.targetId))?.id || - getEnv("DEVICE_PROXY_MODEL"); + (transport.deviceModel && transport.deviceModel.id) || "nanoS"; return Observable.create((o) => { let sub; diff --git a/src/apps/support.js b/src/apps/support.js index 8ad84d0d1b..1752b3d896 100644 --- a/src/apps/support.js +++ b/src/apps/support.js @@ -27,7 +27,7 @@ export function shouldUpgrade( const appVersionsRequired = { Cosmos: ">= 2.14", Algorand: ">= 1.2.9", - Polkadot: ">= 7.9050.0", + Polkadot: ">= 7.30.0", }; export function mustUpgrade( diff --git a/src/bridge/mockHelpers.js b/src/bridge/mockHelpers.js index ec2e284c76..a5064e9230 100644 --- a/src/bridge/mockHelpers.js +++ b/src/bridge/mockHelpers.js @@ -40,7 +40,7 @@ export const sync: $PropertyType, "sync"> = (initialAccount) => const nextAcc = { ...acc, - blockHeight: acc.blockHeight + 1000, // make a sync move a lot by blockHeight to avoid flawky tests issue on op confirm. + blockHeight: acc.blockHeight + 1, lastSyncDate: new Date(), operations: ops.concat(acc.operations.slice(0)), pendingOperations: [], @@ -59,7 +59,7 @@ export const sync: $PropertyType, "sync"> = (initialAccount) => o.complete(); }; - syncTimeouts[accountId] = setTimeout(sync, 500); + syncTimeouts[accountId] = setTimeout(sync, 2000); return () => { clearTimeout(syncTimeouts[accountId]); diff --git a/src/currencies/__snapshots__/sortByMarketcap.test.js.snap b/src/currencies/__snapshots__/sortByMarketcap.test.js.snap index d789df668a..13fc1e6cab 100644 --- a/src/currencies/__snapshots__/sortByMarketcap.test.js.snap +++ b/src/currencies/__snapshots__/sortByMarketcap.test.js.snap @@ -345,7 +345,6 @@ Array [ "ethereum/erc20/covesting", "ethereum/erc20/bcpt", "ethereum/erc20/lympo_", - "ethereum/erc20/newscrypto", "ethereum/erc20/spendcoin", "ethereum/erc20/napoleonx", "ethereum/erc20/oneledger_token", @@ -895,7 +894,6 @@ Array [ "ethereum/erc20/300_token_sparta", "ethereum/erc20/300fit_network", "ethereum/erc20/420doge", - "ethereum/erc20/4artcoin", "ethereum/erc20/808ta", "ethereum/erc20/88mph.app", "ethereum/erc20/8x8_protocol", @@ -991,7 +989,6 @@ Array [ "ethereum/erc20/apot", "ethereum/erc20/apwine_token", "ethereum/erc20/apyswap", - "ethereum/erc20/ara_token", "ethereum/erc20/aragon_network_juror", "ethereum/erc20/arbi_token", "ethereum/erc20/arc_stablex", @@ -1027,7 +1024,6 @@ Array [ "ethereum/erc20/aurusgold", "ethereum/erc20/aurusplatinum", "ethereum/erc20/aurussilver", - "ethereum/erc20/automata", "ethereum/erc20/autonio", "ethereum/erc20/autonio_old", "ethereum/erc20/ava", @@ -1163,7 +1159,6 @@ Array [ "ethereum/erc20/bytether", "ethereum/erc20/bzx_protocol_token", "ethereum/erc20/bzx_vesting_token", - "ethereum/erc20/bzz", "ethereum/erc20/cacaoshares", "ethereum/erc20/calvin", "ethereum/erc20/cami", @@ -1210,7 +1205,6 @@ Array [ "ethereum/erc20/coal_coin", "ethereum/erc20/cocostoken_old", "ethereum/erc20/cofi_token", - "ethereum/erc20/coin", "ethereum/erc20/coin_artist", "ethereum/erc20/coin_utility_token", "ethereum/erc20/coincrowd", @@ -1285,7 +1279,6 @@ Array [ "ethereum/erc20/cudostoken", "ethereum/erc20/curate", "ethereum/erc20/current", - "ethereum/erc20/curryswap", "ethereum/erc20/curve.fi", "ethereum/erc20/curve_dao_token", "ethereum/erc20/curve_fi_usdk_3crv", @@ -1494,7 +1487,6 @@ Array [ "ethereum/erc20/fidelium_token", "ethereum/erc20/filmscoin", "ethereum/erc20/finance.vote_token", - "ethereum/erc20/finbet", "ethereum/erc20/fingerprint", "ethereum/erc20/finnexus", "ethereum/erc20/finxflo", @@ -1912,7 +1904,6 @@ Array [ "ethereum/erc20/pantheon_x", "ethereum/erc20/par_stablecoin", "ethereum/erc20/paralink_network", - "ethereum/erc20/parallelchain_token", "ethereum/erc20/pareto", "ethereum/erc20/parsec_finance", "ethereum/erc20/parsiq_token_", @@ -1983,7 +1974,6 @@ Array [ "ethereum/erc20/pour_coin", "ethereum/erc20/pow_btc-35wt", "ethereum/erc20/pow_eth-1.8wm", - "ethereum/erc20/power", "ethereum/erc20/power_index_pool_token", "ethereum/erc20/powertrade_fuel_token", "ethereum/erc20/premia", @@ -2093,7 +2083,6 @@ Array [ "ethereum/erc20/serum", "ethereum/erc20/sgelder", "ethereum/erc20/sgpay", - "ethereum/erc20/shadowbit", "ethereum/erc20/shadows_network", "ethereum/erc20/shaka", "ethereum/erc20/shard", @@ -2126,7 +2115,6 @@ Array [ "ethereum/erc20/skull", "ethereum/erc20/skymap_token", "ethereum/erc20/smart_advertising_transaction_token", - "ethereum/erc20/smartcredit_token", "ethereum/erc20/smartkey", "ethereum/erc20/smartmesh", "ethereum/erc20/smartrealty", @@ -2226,7 +2214,6 @@ Array [ "ethereum/erc20/taklimakan_network", "ethereum/erc20/talao", "ethereum/erc20/tangguotao_token", - "ethereum/erc20/tapcoin", "ethereum/erc20/tapmydata", "ethereum/erc20/target_coin", "ethereum/erc20/tatatu", @@ -2527,6 +2514,5 @@ Array [ "algorand/asa/438831", "algorand/asa/438828", "algorand/asa/163650", - "algorand/asa/137594422", ] `; diff --git a/src/data/flags/svg/FR.svg b/src/data/flags/svg/FR.svg deleted file mode 100644 index c64f9bec2e..0000000000 --- a/src/data/flags/svg/FR.svg +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/data/flags/svg/JP.svg b/src/data/flags/svg/JP.svg deleted file mode 100644 index 1ceff6892a..0000000000 --- a/src/data/flags/svg/JP.svg +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/data/flags/svg/US.svg b/src/data/flags/svg/US.svg deleted file mode 100644 index d7d6864d3e..0000000000 --- a/src/data/flags/svg/US.svg +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/env.js b/src/env.js index 1e2dbe5796..03dea68721 100644 --- a/src/env.js +++ b/src/env.js @@ -150,26 +150,6 @@ const envDefinitions = { desc: "gasLimit * gasPrice to determine the fees price. A too low GAS_PRICE will get rejected before the transaction is broadcast", }, - CRYPTO_ORG_INDEXER: { - def: "https://crypto.org/explorer", - parser: stringParser, - desc: "location of the crypto.org indexer API", - }, - CRYPTO_ORG_TESTNET_INDEXER: { - def: "https://crypto.org/explorer/croeseid3", - parser: stringParser, - desc: "location of the crypto.org indexer testnet API", - }, - CRYPTO_ORG_RPC_URL: { - def: "", - parser: stringParser, - desc: "location of the crypto.org indexer API", - }, - CRYPTO_ORG_TESTNET_RPC_URL: { - def: "https://testnet-croeseid-3.crypto.org:26657", - parser: stringParser, - desc: "location of the crypto.org chain testnet node", - }, DEBUG_UTXO_DISPLAY: { def: 4, parser: intParser, @@ -191,11 +171,6 @@ const envDefinitions = { parser: stringParser, desc: "enable a proxy to use instead of a physical device", }, - DEVICE_PROXY_MODEL: { - def: "nanoS", - parser: stringParser, - desc: "allow to override the default model of a proxied device", - }, DISABLE_TRANSACTION_BROADCAST: { def: false, parser: boolParser, @@ -482,21 +457,6 @@ const envDefinitions = { parser: intParser, desc: "version used for ledger status api", }, - PLATFORM_DEBUG: { - def: false, - parser: boolParser, - desc: "enable visibility of debug apps and tools in Platform Catalog", - }, - PLATFORM_API_URL: { - def: "", - parser: stringParser, - desc: "url used to fetch platform catalog", - }, - PLATFORM_API_VERSION: { - def: 1, - parser: intParser, - desc: "version used for the platform api", - }, }; const getDefinition = (name: string): ?EnvDef => envDefinitions[name]; diff --git a/src/errors.js b/src/errors.js index c273f12457..f0da5ccd61 100644 --- a/src/errors.js +++ b/src/errors.js @@ -14,10 +14,6 @@ export const GetAppAndVersionUnsupportedFormat = createCustomErrorClass( "GetAppAndVersionUnsupportedFormat" ); -export const LatestFirmwareVersionRequired = createCustomErrorClass( - "LatestFirmwareVersionRequired" -); - export const FeeEstimationFailed = createCustomErrorClass( "FeeEstimationFailed" ); @@ -179,50 +175,12 @@ export const SwapExchangeRateAmountTooHigh = createCustomErrorClass( "SwapExchangeRateAmountTooHigh" ); -export const SwapCheckKYCStatusFailed = createCustomErrorClass( - "SwapCheckKYCStatusFailed" -); - -export const SwapSubmitKYCFailed = createCustomErrorClass( - "SwapSubmitKYCFailed" -); - export const SwapUnknownSwapId = createCustomErrorClass("SwapUnknownSwapId"); export const SwapGenericAPIError = createCustomErrorClass( "SwapGenericAPIError" ); -export const JSONRPCResponseError = createCustomErrorClass( - "JSONRPCResponseError" -); -export const JSONDecodeError = createCustomErrorClass("JSONDecodeError"); -export const NoIPHeaderError = createCustomErrorClass("NoIPHeaderError"); -export const CurrencyNotSupportedError = createCustomErrorClass( - "CurrencyNotSupportedError" -); -export const CurrencyDisabledError = createCustomErrorClass( - "CurrencyDisabledError" -); -export const CurrencyDisabledAsInputError = createCustomErrorClass( - "CurrencyDisabledAsInputError" -); -export const CurrencyDisabledAsOutputError = createCustomErrorClass( - "CurrencyDisabledAsOutputError" -); -export const CurrencyNotSupportedByProviderError = createCustomErrorClass( - "CurrencyNotSupportedByProviderError" -); -export const TradeMethodNotSupportedError = createCustomErrorClass( - "TradeMethodNotSupportedError" -); -export const UnexpectedError = createCustomErrorClass("UnexpectedError"); -export const NotImplementedError = createCustomErrorClass( - "NotImplementedError" -); -export const ValidationError = createCustomErrorClass("ValidationError"); -export const AccessDeniedError = createCustomErrorClass("AccessDeniedError"); - export const AlgorandASANotOptInInRecipient = createCustomErrorClass( "AlgorandASANotOptInInRecipient" ); diff --git a/src/exchange/swap/getExchangeRates.js b/src/exchange/swap/getExchangeRates.js index e6247c5aa2..3c402c8c42 100644 --- a/src/exchange/swap/getExchangeRates.js +++ b/src/exchange/swap/getExchangeRates.js @@ -3,11 +3,10 @@ import type { Exchange, GetExchangeRates } from "./types"; import type { Transaction } from "../../types"; import { getAccountCurrency, getAccountUnit } from "../../account"; -import type { Unit } from "../../types"; import { formatCurrencyUnit } from "../../currencies"; import { mockGetExchangeRates } from "./mock"; import network from "../../network"; -import { getSwapAPIError, getSwapAPIBaseURL } from "./"; +import { getSwapAPIBaseURL } from "./"; import { getEnv } from "../../env"; import { BigNumber } from "bignumber.js"; import { @@ -17,13 +16,10 @@ import { const getExchangeRates: GetExchangeRates = async ( exchange: Exchange, - transaction: Transaction, - userId?: string // TODO remove when wyre doesn't require this for rates + transaction: Transaction ) => { if (getEnv("MOCK")) return mockGetExchangeRates(exchange, transaction); - // Rely on the api base to determine the version logic - const usesV3 = getSwapAPIBaseURL().endsWith("v3"); const from = getAccountCurrency(exchange.fromAccount).id; const unitFrom = getAccountUnit(exchange.fromAccount); const unitTo = getAccountUnit(exchange.toAccount); @@ -31,130 +27,90 @@ const getExchangeRates: GetExchangeRates = async ( const amountFrom = transaction.amount; const tenPowMagnitude = BigNumber(10).pow(unitFrom.magnitude); const apiAmount = BigNumber(amountFrom).div(tenPowMagnitude); - const request = { - from, - to, - amountFrom: apiAmount.toString(), - }; + const res = await network({ method: "POST", url: `${getSwapAPIBaseURL()}/rate`, - headers: { - ...(userId ? { userId } : {}), - }, - data: usesV3 ? request : [request], + data: [ + { + from, + to, + amountFrom: apiAmount.toString(), + }, + ], }); - return res.data.map((responseData) => { - const { + return res.data.map( + ({ rate: maybeRate, payoutNetworkFees: maybePayoutNetworkFees, rateId, provider, amountFrom, amountTo, + minAmountFrom, + maxAmountFrom, tradeMethod, - } = responseData; + }) => { + let error; + let magnitudeAwareRate; + + if (!amountFrom) { + const isTooSmall = BigNumber(apiAmount).lte(minAmountFrom); + + error = isTooSmall + ? new SwapExchangeRateAmountTooLow(null, { + minAmountFromFormatted: formatCurrencyUnit( + unitFrom, + BigNumber(minAmountFrom).times(tenPowMagnitude), + { + alwaysShowSign: false, + disableRounding: true, + showCode: true, + } + ), + }) + : new SwapExchangeRateAmountTooHigh(null, { + maxAmountFromFormatted: formatCurrencyUnit( + unitFrom, + BigNumber(maxAmountFrom).times(tenPowMagnitude), + { + alwaysShowSign: false, + disableRounding: true, + showCode: true, + } + ), + }); + } else { + // NB Allows us to simply multiply satoshi values from/to + magnitudeAwareRate = (tradeMethod === "fixed" + ? BigNumber(maybeRate) + : BigNumber(amountTo).div(amountFrom) + ).div(BigNumber(10).pow(unitFrom.magnitude - unitTo.magnitude)); + } + + const payoutNetworkFees = BigNumber(maybePayoutNetworkFees || 0).times( + BigNumber(10).pow(unitTo.magnitude) + ); + + const toAmount = BigNumber(amountTo) + .times(BigNumber(10).pow(unitTo.magnitude)) + .minus(payoutNetworkFees); // Nb no longer need to break it down on UI + + const rate = maybeRate || BigNumber(amountTo).div(BigNumber(amountFrom)); - const error = inferError(apiAmount, unitFrom, responseData); - if (error) { return { + magnitudeAwareRate, provider, tradeMethod, - error, - }; - } - - // NB Allows us to simply multiply satoshi values from/to - const magnitudeAwareRate = (tradeMethod === "fixed" - ? BigNumber(maybeRate) - : BigNumber(amountTo).div(amountFrom) - ).div(BigNumber(10).pow(unitFrom.magnitude - unitTo.magnitude)); - - const payoutNetworkFees = BigNumber(maybePayoutNetworkFees || 0).times( - BigNumber(10).pow(unitTo.magnitude) - ); - - const toAmount = BigNumber(amountTo) - .times(BigNumber(10).pow(unitTo.magnitude)) - .minus(payoutNetworkFees); // Nb no longer need to break it down on UI - - const rate = maybeRate || BigNumber(amountTo).div(BigNumber(amountFrom)); - - const out = { - magnitudeAwareRate, - provider, - rate, - rateId, - toAmount, - tradeMethod, - }; - - if (tradeMethod === "fixed") { - return { ...out, rateId }; - } else { - return { - ...out, + toAmount, + rate, + rateId, payoutNetworkFees, + error, }; } - }); -}; - -const inferError = ( - apiAmount: BigNumber, - unitFrom: Unit, - responseData: { - amountTo: string, - minAmountFrom: string, - maxAmountFrom: string, - errorCode?: number, - errorMessage?: string, - } -): ?Error => { - const tenPowMagnitude = BigNumber(10).pow(unitFrom.magnitude); - const { - amountTo, - minAmountFrom, - maxAmountFrom, - errorCode, - errorMessage, - } = responseData; - - if (!amountTo) { - // We are in an error case regardless of api version. - if (errorCode) { - return getSwapAPIError(errorCode, errorMessage); - } - - // For out of range errors we will have a min/max pairing - if (minAmountFrom) { - const isTooSmall = BigNumber(apiAmount).lte(minAmountFrom); - - const MinOrMaxError = isTooSmall - ? SwapExchangeRateAmountTooLow - : SwapExchangeRateAmountTooHigh; - - const key: string = isTooSmall - ? "minAmountFromFormatted" - : "maxAmountFromFormatted"; - - const amount = isTooSmall ? minAmountFrom : maxAmountFrom; - - return new MinOrMaxError(null, { - [key]: formatCurrencyUnit( - unitFrom, - BigNumber(amount).times(tenPowMagnitude), - { - alwaysShowSign: false, - disableRounding: true, - showCode: true, - } - ), - }); - } - } - return; + ); }; export default getExchangeRates; diff --git a/src/exchange/swap/getKYCStatus.js b/src/exchange/swap/getKYCStatus.js deleted file mode 100644 index 479b93ce70..0000000000 --- a/src/exchange/swap/getKYCStatus.js +++ /dev/null @@ -1,31 +0,0 @@ -// @flow - -import network from "../../network"; -import { getSwapAPIBaseURL } from "./"; -import type { GetKYCStatus } from "./types"; -import { SwapCheckKYCStatusFailed } from "../../errors"; - -export const getKYCStatus: GetKYCStatus = async ( - provider: string, - id: string -) => { - //if (getEnv("MOCK")) return mockGetKYCStatus(id); // TODO implement - - const res = await network({ - method: "GET", - url: `${getSwapAPIBaseURL()}/provider/${provider}/user/${id}`, - }); - - if (!res.data?.status) { - return new SwapCheckKYCStatusFailed(id); - } - - const { status } = res.data; - - return { - id, - status, - }; -}; - -export default getKYCStatus; diff --git a/src/exchange/swap/index.js b/src/exchange/swap/index.js index cabaa27c7c..fbf62b10d2 100644 --- a/src/exchange/swap/index.js +++ b/src/exchange/swap/index.js @@ -5,40 +5,18 @@ import getExchangeRates from "./getExchangeRates"; import getStatus from "./getStatus"; import getProviders from "./getProviders"; import getCompleteSwapHistory from "./getCompleteSwapHistory"; -import getKYCStatus from "./getKYCStatus"; -import submitKYC from "./submitKYC"; import initSwap from "./initSwap"; import { getEnv } from "../../env"; -import { - JSONRPCResponseError, - JSONDecodeError, - NoIPHeaderError, - CurrencyNotSupportedError, - CurrencyDisabledError, - CurrencyDisabledAsInputError, - CurrencyDisabledAsOutputError, - CurrencyNotSupportedByProviderError, - TradeMethodNotSupportedError, - UnexpectedError, - NotImplementedError, - ValidationError, - AccessDeniedError, -} from "../../errors"; export const operationStatusList = { finishedOK: ["finished"], - finishedKO: ["refunded"], - pending: ["pending", "onhold", "expired"], + finishedKO: ["expired", "refunded"], + pending: ["pending", "onhold"], }; const getSwapAPIBaseURL: () => string = () => getEnv("SWAP_API_BASE"); const swapProviders: { - [string]: { - nameAndPubkey: Buffer, - signature: Buffer, - curve: string, - needsKYC: boolean, - }, + [string]: { nameAndPubkey: Buffer, signature: Buffer, curve: string }, } = { changelly: { nameAndPubkey: Buffer.from( @@ -50,19 +28,6 @@ const swapProviders: { "hex" ), curve: "secpk256k1", - needsKYC: false, - }, - wyre: { - nameAndPubkey: Buffer.from( - "045779726504AD01A6241929A5EC331046868FBACB424696FD7C8A4D824FEE61268374E9F4F87FFC5301F0E0A84CEA69FFED46E14C771F9CA1EEA345F6531994291C816E8AE6", - "hex" - ), - signature: Buffer.from( - "304402207b49e46d458a55daee9bc8ed96e1b404c2d99dbbc3d3c3c15430026eb7e01a05022011ab86db08a4c956874a83f23d918319a073fdd9df23a1c7eed8a0a22c98b1e3", - "hex" - ), - curve: "secpk256k1", - needsKYC: true, }, }; @@ -76,86 +41,6 @@ const getProviderNameAndSignature = ( return res; }; -const USStates = { - AL: "Alabama", - AK: "Alaska", - AZ: "Arizona", - AR: "Arkansas", - CA: "California", - CO: "Colorado", - CT: "Connecticut", - DE: "Delaware", - DC: "District Of Columbia", - FL: "Florida", - GA: "Georgia", - HI: "Hawaii", - ID: "Idaho", - IL: "Illinois", - IN: "Indiana", - IA: "Iowa", - KS: "Kansas", - KY: "Kentucky", - LA: "Louisiana", - ME: "Maine", - MD: "Maryland", - MA: "Massachusetts", - MI: "Michigan", - MN: "Minnesota", - MS: "Mississippi", - MO: "Missouri", - MT: "Montana", - NE: "Nebraska", - NV: "Nevada", - NH: "New Hampshire", - NJ: "New Jersey", - NM: "New Mexico", - NY: "New York", - NC: "North Carolina", - ND: "North Dakota", - OH: "Ohio", - OK: "Oklahoma", - OR: "Oregon", - PA: "Pennsylvania", - RI: "Rhode Island", - SC: "South Carolina", - SD: "South Dakota", - TN: "Tennessee", - TX: "Texas", - UT: "Utah", - VT: "Vermont", - VA: "Virginia", - WA: "Washington", - WV: "West Virginia", - WI: "Wisconsin", - WY: "Wyoming", -}; - -const countries = { - US: "United States", -}; - -const swapBackendErrorCodes = { - "100": JSONRPCResponseError, - "101": JSONDecodeError, - "200": NoIPHeaderError, - "300": CurrencyNotSupportedError, - "301": CurrencyDisabledError, - "302": CurrencyDisabledAsInputError, - "303": CurrencyDisabledAsOutputError, - "304": CurrencyNotSupportedByProviderError, - "400": TradeMethodNotSupportedError, - "500": UnexpectedError, - "600": NotImplementedError, - "700": ValidationError, - "701": AccessDeniedError, -}; - -export const getSwapAPIError = (errorCode: number, errorMessage?: string) => { - if (errorCode in swapBackendErrorCodes) - return new swapBackendErrorCodes[errorCode](errorMessage); - return new Error(errorMessage); -}; - export { getSwapAPIBaseURL, getProviderNameAndSignature, @@ -164,8 +49,4 @@ export { getExchangeRates, getCompleteSwapHistory, initSwap, - getKYCStatus, - submitKYC, - USStates, - countries, }; diff --git a/src/exchange/swap/initSwap.js b/src/exchange/swap/initSwap.js index ad9b88dbd8..0bd80a334a 100644 --- a/src/exchange/swap/initSwap.js +++ b/src/exchange/swap/initSwap.js @@ -36,7 +36,7 @@ const withDevicePromise = (deviceId, fn) => // throw if TransactionStatus have errors // you get at the end a final Transaction to be done (it's not yet signed, nor broadcasted!) and a swapId const initSwap = (input: InitSwapInput): Observable => { - let { exchange, exchangeRate, transaction, deviceId, userId } = input; + let { exchange, exchangeRate, transaction, deviceId } = input; if (getEnv("MOCK")) return mockInitSwap(exchange, exchangeRate, transaction); return Observable.create((o) => { let unsubscribed = false; @@ -84,7 +84,6 @@ const initSwap = (input: InitSwapInput): Observable => { url: `${getSwapAPIBaseURL()}/swap`, headers: { EquipmentId: getEnv("USER_ID"), - ...(userId ? { userId } : {}), }, data: { provider, diff --git a/src/exchange/swap/logic.js b/src/exchange/swap/logic.js index e3408a5a95..ccb7aec953 100644 --- a/src/exchange/swap/logic.js +++ b/src/exchange/swap/logic.js @@ -1,6 +1,6 @@ // @flow -import type { SwapState, TradeMethod, AvailableProviderV3 } from "./types"; +import type { SwapState, TradeMethod } from "./types"; import { isExchangeSupportedByApp } from "../"; import type { AccountLike, TokenCurrency, CryptoCurrency } from "../../types"; import type { InstalledItem } from "../../apps"; @@ -8,25 +8,8 @@ import { flattenAccounts, getAccountCurrency } from "../../account"; export type CurrencyStatus = $Keys; export type CurrenciesStatus = { [string]: CurrencyStatus }; import uniq from "lodash/uniq"; -import invariant from "invariant"; -import { findCryptoCurrencyById, findTokenById } from "@ledgerhq/cryptoassets"; -import { isCurrencyExchangeSupported } from "../"; -import { isCurrencySupported } from "../../currencies"; const validCurrencyStatus = { ok: 1, noApp: 1, noAccounts: 1, outdatedApp: 1 }; - -export const getSwapSelectableCurrencies = ( - rawProviderData: Array -) => { - const ids = []; - rawProviderData.forEach((provider) => { - const { pairs } = provider; - pairs.forEach(({ from, to }) => ids.push(from, to)); - }); - return uniq(ids); -}; - -// TODO deprecated when noWall export const getCurrenciesWithStatus = ({ accounts, selectableCurrencies, @@ -98,70 +81,6 @@ export const getValidToCurrencies = ({ return uniq(out); }; -export const getSupportedCurrencies = ({ - providers, - provider, - tradeMethod, - fromCurrency, -}: { - providers: any, - provider: string, - tradeMethod?: string, - fromCurrency?: CryptoCurrency | TokenCurrency, -}): Array => { - const providerData = providers.find((p) => p.provider === provider); - invariant(provider, `No provider matching ${provider} was found`); - - const { pairs } = providerData; - const ids = uniq( - pairs.map(({ from, to, tradeMethods }) => { - const isTo = fromCurrency; - if ( - (!tradeMethod || tradeMethods.include(tradeMethod)) && - (!fromCurrency || fromCurrency.id === from) - ) { - return isTo ? to : from; - } - }) - ); - - const tokenCurrencies = ids - .map(findTokenById) - .filter(Boolean) - .filter((t) => !t.delisted); - - const cryptoCurrencies = ids - .map(findCryptoCurrencyById) - .filter(Boolean) - .filter(isCurrencySupported); - - return [...cryptoCurrencies, ...tokenCurrencies].filter( - isCurrencyExchangeSupported - ); -}; - -export const getEnabledTradingMethods = ({ - providers, - provider, - fromCurrency, - toCurrency, -}: { - providers: any, - provider: string, - fromCurrency: CryptoCurrency | TokenCurrency, - toCurrency: CryptoCurrency | TokenCurrency, -}) => { - const providerData = providers.find((p) => p.provider === provider); - invariant(provider, `No provider matching ${provider} was found`); - - const { pairs } = providerData; - const match = pairs.find( - (p) => p.from === fromCurrency.id && p.to === toCurrency.id - ); - - return match?.tradeMethod || []; -}; - const allTradeMethods: TradeMethod[] = ["fixed", "float"]; // Flow i give up export const getEnabledTradeMethods = ({ diff --git a/src/exchange/swap/mock.js b/src/exchange/swap/mock.js index 8ad7c06c91..069a3ad1ed 100644 --- a/src/exchange/swap/mock.js +++ b/src/exchange/swap/mock.js @@ -16,7 +16,6 @@ import { SwapExchangeRateAmountTooHigh, } from "../../errors"; import { Observable, of } from "rxjs"; -import { getSwapAPIBaseURL } from "./"; export const mockGetExchangeRates = async ( exchange: Exchange, @@ -105,57 +104,35 @@ export const mockInitSwap = ( export const mockGetProviders: GetProviders = async () => { //Fake delay to show loading UI await new Promise((r) => setTimeout(r, 800)); - const usesV3 = getSwapAPIBaseURL().endsWith("v3"); - return usesV3 - ? [ - { - provider: "changelly", - pairs: [ - { from: "bitcoin", to: "ethereum", tradeMethod: "float" }, - { from: "bitcoin", to: "ethereum", tradeMethod: "fixed" }, - { from: "ethereum", to: "bitcoin", tradeMethod: "float" }, - { from: "ethereum", to: "bitcoin", tradeMethod: "fixed" }, - ], - }, - { - provider: "wyre", - pairs: [ - { from: "bitcoin", to: "ethereum", tradeMethod: "float" }, - { from: "bitcoin", to: "ethereum", tradeMethod: "fixed" }, - { from: "ethereum", to: "bitcoin", tradeMethod: "float" }, - { from: "ethereum", to: "bitcoin", tradeMethod: "fixed" }, - ], - }, - ] - : [ - { - provider: "changelly", - supportedCurrencies: [ - "bitcoin", - "litecoin", - "ethereum", - "tron", - "ethereum/erc20/omg", - "ethereum/erc20/0x_project", - "ethereum/erc20/augur", - ], - tradeMethod: "fixed", - }, - { - provider: "changelly", - supportedCurrencies: [ - "bitcoin", - "litecoin", - "ethereum", - "tron", - "ethereum/erc20/omg", - "ethereum/erc20/0x_project", - "ethereum/erc20/augur", - ], - tradeMethod: "float", - }, - ]; + return [ + { + provider: "changelly", + supportedCurrencies: [ + "bitcoin", + "litecoin", + "ethereum", + "tron", + "ethereum/erc20/omg", + "ethereum/erc20/0x_project", + "ethereum/erc20/augur", + ], + tradeMethod: "fixed", + }, + { + provider: "changelly", + supportedCurrencies: [ + "bitcoin", + "litecoin", + "ethereum", + "tron", + "ethereum/erc20/omg", + "ethereum/erc20/0x_project", + "ethereum/erc20/augur", + ], + tradeMethod: "float", + }, + ]; }; export const mockGetStatus: GetMultipleStatus = async (statusList) => { diff --git a/src/exchange/swap/submitKYC.js b/src/exchange/swap/submitKYC.js deleted file mode 100644 index 8982b8abee..0000000000 --- a/src/exchange/swap/submitKYC.js +++ /dev/null @@ -1,33 +0,0 @@ -// @flow - -import network from "../../network"; -import { getSwapAPIBaseURL } from "./"; -import type { KYCData, SubmitKYC } from "./types"; -import { ValidationError } from "../../errors"; - -export const submitKYC: SubmitKYC = async (provider: string, data: KYCData) => { - try { - const res = await network({ - method: "POST", - url: `${getSwapAPIBaseURL()}/provider/${provider}/user`, - data, - }); - - const { id, status } = res.data; - - return { - id, - status, - }; - } catch (error) { - // Nb this is the best we have, no _per field_ validation but rather - // error handling at the top level. - - // TODO detect KYC specs changed to throw specific error - return { - error: new ValidationError(error.message), - }; - } -}; - -export default submitKYC; diff --git a/src/exchange/swap/types.js b/src/exchange/swap/types.js index de9a92f958..11165809fc 100644 --- a/src/exchange/swap/types.js +++ b/src/exchange/swap/types.js @@ -12,28 +12,6 @@ import type { TransactionRaw, } from "../../types"; -/// v3 changes here, move me to another folder soon -export type ValidKYCStatus = "open" | "pending" | "approved" | "closed"; -export type KYCStatus = { id: string, status: ValidKYCStatus }; -export type GetKYCStatus = (string, string) => Promise; -export type SubmitKYC = ( - string, - KYCData -) => Promise; - -export type KYCData = { - firstName: string, - lastName: string, - residenceAddress: { - street1: string, - street2: string, - city: string, - state: string, - country: string, - postalCode: string, - }, -}; -/// export type Exchange = { fromParentAccount: ?Account, fromAccount: AccountLike, @@ -73,22 +51,15 @@ export type ExchangeRateRaw = { providerURL?: ?string, }; -export type AvailableProviderV2 = { +export type AvailableProvider = { provider: string, supportedCurrencies: string[], }; -export type AvailableProviderV3 = { - provider: string, - pairs: Array<{ from: string, to: string, tradeMethod: string }>, -}; - -export type AvailableProvider = AvailableProviderV2 | AvailableProviderV3; export type GetExchangeRates = ( Exchange, Transaction ) => Promise; - export type GetProviders = () => Promise; export type InitSwapResult = { @@ -194,7 +165,6 @@ export type InitSwapInput = { exchangeRate: ExchangeRate, transaction: Transaction, deviceId: string, - userId?: string, // Nb for kyc purposes }; export type InitSwapInputRaw = { @@ -202,5 +172,4 @@ export type InitSwapInputRaw = { exchangeRate: ExchangeRateRaw, transaction: TransactionRaw, deviceId: string, - userId?: string, }; diff --git a/src/families/crypto_org/account.js b/src/families/crypto_org/account.js deleted file mode 100644 index 0614a88143..0000000000 --- a/src/families/crypto_org/account.js +++ /dev/null @@ -1,58 +0,0 @@ -// @flow -import invariant from "invariant"; -import type { Account } from "../../types"; -import { getAccountUnit } from "../../account"; -import { formatCurrencyUnit } from "../../currencies"; - -function formatAccountSpecifics(account: Account): string { - const { cryptoOrgResources } = account; - invariant(cryptoOrgResources, "Crypto.org account expected"); - const unit = getAccountUnit(account); - const formatConfig = { - disableRounding: true, - alwaysShowSign: false, - showCode: true, - }; - - let str = " "; - - str += - formatCurrencyUnit(unit, account.spendableBalance, formatConfig) + - " spendable. "; - - if (cryptoOrgResources.bondedBalance.gt(0)) { - str += - formatCurrencyUnit(unit, cryptoOrgResources.bondedBalance, formatConfig) + - " bonded. "; - } - - if (cryptoOrgResources.redelegatingBalance.gt(0)) { - str += - formatCurrencyUnit( - unit, - cryptoOrgResources.redelegatingBalance, - formatConfig - ) + " redelegatingBalance. "; - } - - if (cryptoOrgResources.unbondingBalance.gt(0)) { - str += - formatCurrencyUnit( - unit, - cryptoOrgResources.unbondingBalance, - formatConfig - ) + " unbondingBalance. "; - } - - if (cryptoOrgResources.commissions.gt(0)) { - str += - formatCurrencyUnit(unit, cryptoOrgResources.commissions, formatConfig) + - " commissions. "; - } - - return str; -} - -export default { - formatAccountSpecifics, -}; diff --git a/src/families/crypto_org/api/index.js b/src/families/crypto_org/api/index.js deleted file mode 100644 index dafa6b52c9..0000000000 --- a/src/families/crypto_org/api/index.js +++ /dev/null @@ -1,6 +0,0 @@ -export { - getAccount, - getOperations, - broadcastTransaction, - getAccountParams, -} from "./sdk"; diff --git a/src/families/crypto_org/api/sdk.js b/src/families/crypto_org/api/sdk.js deleted file mode 100644 index fcac179ae3..0000000000 --- a/src/families/crypto_org/api/sdk.js +++ /dev/null @@ -1,234 +0,0 @@ -// @flow -import { utils } from "@crypto-com/chain-jslib"; -import { - CryptoOrgAccountTransaction, - CryptoOrgMsgSendContent, - CryptoOrgAmount, - CryptoOrgAccountTransactionTypeEnum, - CryptoOrgCurrency, - CryptoOrgTestnetCurrency, -} from "./sdk.types"; -import { BigNumber } from "bignumber.js"; -import network from "../../../network"; -import { getCroSdk, isTestNet } from "../logic"; - -import type { Operation, OperationType } from "../../../types"; -import { getEnv } from "../../../env"; -import { encodeOperationId } from "../../../operation"; - -const PAGINATION_LIMIT = 200; - -const instances = {}; -/** - * Get CroClient - */ -export async function getClient(currencyId: *) { - if (instances[currencyId]) { - return instances[currencyId]; - } - const crypto_org_rpc_url = isTestNet(currencyId) - ? getEnv("CRYPTO_ORG_TESTNET_RPC_URL") - : getEnv("CRYPTO_ORG_RPC_URL"); - instances[currencyId] = await getCroSdk(currencyId).CroClient.connect( - crypto_org_rpc_url - ); - return instances[currencyId]; -} - -/** - * Extract only the cro amount from list of currencies - */ -export const getCroAmount = ( - amounts: CryptoOrgAmount[], - currencyId: string -) => { - const cryptoOrgCurrency = isTestNet(currencyId) - ? CryptoOrgTestnetCurrency - : CryptoOrgCurrency; - return amounts.reduce( - (result, current) => - current.denom === cryptoOrgCurrency - ? result.plus(BigNumber(current.amount)) - : result, - BigNumber(0) - ); -}; - -/** - * Get account balances - */ -export const getAccount = async (addr: string, currencyId: string) => { - const client = await getClient(currencyId); - const { header } = await client.getBlock(); - - const crypto_org_indexer = isTestNet(currencyId) - ? getEnv("CRYPTO_ORG_TESTNET_INDEXER") - : getEnv("CRYPTO_ORG_INDEXER"); - - let balance = 0; - let bondedBalance = 0; - let redelegatingBalance = 0; - let unbondingBalance = 0; - let commissions = 0; - let data; - try { - const response = await network({ - method: "GET", - url: `${crypto_org_indexer}/api/v1/accounts/${addr}`, - }); - data = response.data; - } catch (error) { - if (error?.status !== 404) { - throw error; - } - } - - if (data) { - balance = getCroAmount(data.result.balance, currencyId); - bondedBalance = getCroAmount(data.result.bondedBalance, currencyId); - redelegatingBalance = getCroAmount( - data.result.redelegatingBalance, - currencyId - ); - unbondingBalance = getCroAmount(data.result.unbondingBalance, currencyId); - commissions = getCroAmount(data.result.commissions, currencyId); - } - return { - blockHeight: header.height, - balance: BigNumber(balance), - bondedBalance: BigNumber(bondedBalance), - redelegatingBalance: BigNumber(redelegatingBalance), - unbondingBalance: BigNumber(unbondingBalance), - commissions: BigNumber(commissions), - }; -}; - -/** - * Get account information for sending transactions - */ -export const getAccountParams = async (addr: string, currencyId: string) => { - const client = await getClient(currencyId); - const { accountNumber, sequence } = await client.getAccount(addr); - - return { - accountNumber: accountNumber ?? 0, - sequence: sequence ?? 0, - }; -}; - -/** - * Returns true if account is the signer - */ -function isSender(transaction: CryptoOrgMsgSendContent, addr: string): boolean { - return transaction.fromAddress === addr; -} - -/** - * Map transaction to an Operation Type - */ -function getOperationType( - messageSendContent: CryptoOrgMsgSendContent, - addr: string -): OperationType { - return isSender(messageSendContent, addr) ? "OUT" : "IN"; -} - -/** - * Map transaction to a correct Operation Value (affecting account balance) - */ -function getOperationValue( - messageSendContent: CryptoOrgMsgSendContent, - currencyId: string -): BigNumber { - return getCroAmount(messageSendContent.amount, currencyId); -} - -/** - * Map the send history transaction to a Ledger Live Operation - */ -function convertSendTransactionToOperation( - accountId: string, - addr: string, - messageSendContent: CryptoOrgMsgSendContent, - transaction: CryptoOrgAccountTransaction, - currencyId: string -): Operation { - const type = getOperationType(messageSendContent, addr); - - return { - id: encodeOperationId(accountId, messageSendContent.txHash, type), - accountId, - fee: BigNumber(transaction.fee.amount), - value: getOperationValue(messageSendContent, currencyId), - type, - hash: messageSendContent.txHash, - blockHash: transaction.blockHash, - blockHeight: transaction.blockHeight, - date: new Date(transaction.blockTime), - senders: [messageSendContent.fromAddress], - recipients: [messageSendContent.toAddress], - hasFailed: !transaction.success, - extra: undefined, - }; -} - -/** - * Fetch operation list - */ -export const getOperations = async ( - accountId: string, - addr: string, - startAt: number, - currencyId: string -): Promise => { - let rawTransactions: Operation[] = []; - - const crypto_org_indexer = isTestNet(currencyId) - ? getEnv("CRYPTO_ORG_TESTNET_INDEXER") - : getEnv("CRYPTO_ORG_INDEXER"); - - const { data } = await network({ - method: "GET", - url: `${crypto_org_indexer}/api/v1/accounts/${addr}/transactions?pagination=offset&page=${ - startAt + 1 - }&limit=${PAGINATION_LIMIT}`, - }); - const accountTransactions: CryptoOrgAccountTransaction[] = data.result; - for (let i = 0; i < accountTransactions.length; i++) { - const msgs = accountTransactions[i].messages; - for (let j = 0; j < msgs.length; j++) { - switch (msgs[j].type) { - case CryptoOrgAccountTransactionTypeEnum.MsgSend: { - const msgSend: CryptoOrgMsgSendContent = msgs[j].content; - rawTransactions.push( - convertSendTransactionToOperation( - accountId, - addr, - msgSend, - accountTransactions[i], - currencyId - ) - ); - break; - } - default: - } - } - } - - return rawTransactions; -}; - -/** - * Broadcast blob to blockchain - */ -export const broadcastTransaction = async ( - blob: string, - currencyId: string -) => { - const client = await getClient(currencyId); - const broadcastResponse = await client.broadcastTx( - utils.Bytes.fromHexString(blob).toUint8Array() - ); - return broadcastResponse; -}; diff --git a/src/families/crypto_org/api/sdk.types.js b/src/families/crypto_org/api/sdk.types.js deleted file mode 100644 index f559b04149..0000000000 --- a/src/families/crypto_org/api/sdk.types.js +++ /dev/null @@ -1,52 +0,0 @@ -// @flow - -export const CryptoOrgAccountTransactionTypeEnum = { - MsgSend: "MsgSend", - MgsMultiSend: "MsgMultiSend", -}; - -export const CryptoOrgCurrency = "basecro"; -export const CryptoOrgTestnetCurrency = "basetcro"; - -export interface CryptoOrgAccountTransaction { - account: string; - blockHeight: number; - blockHash: string; - blockTime: Date; - hash: string; - messageTypes: string[]; - success: boolean; - code: number; - log: string; - fee: CryptoOrgAmount; - feePayer: string; - feeGranter: string; - gasWanted: number; - gasUsed: number; - memo: string; - timeoutHeight: number; - messages: any[]; -} - -export interface CryptoOrgAmount { - denom: string; - amount: number; -} - -export interface CryptoOrgMsgSendContent { - amount: CryptoOrgAmount[]; - height: number; - txHash: string; - msgName: string; - version: number; - msgIndex: number; - name: string; - uuid: string; - toAddress: string; - fromAddress: string; -} - -export interface CryptoOrgMsgSend { - type: string; - content: CryptoOrgMsgSendContent; -} diff --git a/src/families/crypto_org/bridge/js.js b/src/families/crypto_org/bridge/js.js deleted file mode 100644 index f4ec70b5ee..0000000000 --- a/src/families/crypto_org/bridge/js.js +++ /dev/null @@ -1,37 +0,0 @@ -// @flow -import type { AccountBridge, CurrencyBridge } from "../../../types"; -import type { Transaction } from "../types"; -import { makeAccountBridgeReceive } from "../../../bridge/jsHelpers"; - -import { sync, scanAccounts } from "../js-synchronisation"; -import { - createTransaction, - updateTransaction, - prepareTransaction, -} from "../js-transaction"; -import getTransactionStatus from "../js-getTransactionStatus"; -import estimateMaxSpendable from "../js-estimateMaxSpendable"; -import signOperation from "../js-signOperation"; -import broadcast from "../js-broadcast"; - -const receive = makeAccountBridgeReceive(); - -const currencyBridge: CurrencyBridge = { - preload: async () => {}, - hydrate: () => {}, - scanAccounts, -}; - -const accountBridge: AccountBridge = { - estimateMaxSpendable, - createTransaction, - updateTransaction, - getTransactionStatus, - prepareTransaction, - sync, - receive, - signOperation, - broadcast, -}; - -export default { currencyBridge, accountBridge }; diff --git a/src/families/crypto_org/cli-transaction.js b/src/families/crypto_org/cli-transaction.js deleted file mode 100644 index f56b240b96..0000000000 --- a/src/families/crypto_org/cli-transaction.js +++ /dev/null @@ -1,36 +0,0 @@ -// @flow -import invariant from "invariant"; -import flatMap from "lodash/flatMap"; -import type { Transaction, AccountLike } from "../../types"; - -const options = [ - { - name: "mode", - type: String, - desc: "mode of transaction: send", - }, -]; - -function inferTransactions( - transactions: Array<{ account: AccountLike, transaction: Transaction }>, - opts: Object -): Transaction[] { - return flatMap(transactions, ({ transaction, account }) => { - invariant(transaction.family === "crypto_org", "crypto_org family"); - - if (account.type === "Account") { - invariant(account.cryptoOrgResources, "unactivated account"); - } - - return { - ...transaction, - family: "crypto_org", - mode: opts.mode || "send", - }; - }); -} - -export default { - options, - inferTransactions, -}; diff --git a/src/families/crypto_org/errors.js b/src/families/crypto_org/errors.js deleted file mode 100644 index 999f5ca355..0000000000 --- a/src/families/crypto_org/errors.js +++ /dev/null @@ -1,14 +0,0 @@ -// @flow -import { createCustomErrorClass } from "@ledgerhq/errors"; - -export const CryptoOrgWrongSignatureHeader = createCustomErrorClass( - "CryptoOrgWrongSignatureHeader" -); - -export const CryptoOrgSignatureSize = createCustomErrorClass( - "CryptoOrgSignatureSize" -); - -export const CryptoOrgErrorBroadcasting = createCustomErrorClass( - "CryptoOrgErrorBroadcasting" -); diff --git a/src/families/crypto_org/hw-getAddress.js b/src/families/crypto_org/hw-getAddress.js deleted file mode 100644 index 43a2f753dd..0000000000 --- a/src/families/crypto_org/hw-getAddress.js +++ /dev/null @@ -1,18 +0,0 @@ -// @flow - -import Cosmos from "@ledgerhq/hw-app-cosmos"; -import type { Resolver } from "../../hw/getAddress/types"; -import { isTestNet } from "./logic"; - -const resolver: Resolver = async (transport, { path, verify, currency }) => { - const cosmos = new Cosmos(transport); - const cointype = isTestNet(currency.id) ? "tcro" : "cro"; - const r = await cosmos.getAddress(path, cointype, verify || false); - return { - address: r.address, - publicKey: r.publicKey, - path, - }; -}; - -export default resolver; diff --git a/src/families/crypto_org/js-broadcast.js b/src/families/crypto_org/js-broadcast.js deleted file mode 100644 index 87f0444980..0000000000 --- a/src/families/crypto_org/js-broadcast.js +++ /dev/null @@ -1,36 +0,0 @@ -// @flow -import type { Operation, SignedOperation, Account } from "../../types"; -import { patchOperationWithHash } from "../../operation"; - -import { broadcastTransaction } from "./api"; -import { CryptoOrgErrorBroadcasting } from "./errors"; - -function isBroadcastTxFailure(result) { - return !!result.code; -} - -/** - * Broadcast the signed transaction - */ -const broadcast = async ({ - account, - signedOperation: { signature, operation }, -}: { - account: Account, - signedOperation: SignedOperation, -}): Promise => { - const broadcastResponse = await broadcastTransaction( - signature, - account.currency.id - ); - - if (isBroadcastTxFailure(broadcastResponse)) { - throw new CryptoOrgErrorBroadcasting( - `broadcasting failed with error code ${broadcastResponse.code}` - ); - } - - return patchOperationWithHash(operation, broadcastResponse.transactionHash); -}; - -export default broadcast; diff --git a/src/families/crypto_org/js-buildTransaction.js b/src/families/crypto_org/js-buildTransaction.js deleted file mode 100644 index 930ec86266..0000000000 --- a/src/families/crypto_org/js-buildTransaction.js +++ /dev/null @@ -1,59 +0,0 @@ -// @flow -import type { Transaction } from "./types"; -import type { Account } from "../../types"; -import { Units, utils } from "@crypto-com/chain-jslib"; -import { getAccountParams } from "./api/sdk"; -import { getCroSdk } from "./logic"; - -const getTransactionAmount = (a: Account, t: Transaction) => { - const croSdk = getCroSdk(a.currency.id); - switch (t.mode) { - case "send": - if (t.useAllAmount) { - const amountMinusFee = t.amount.minus(t.fees || 0); - return new croSdk.Coin(amountMinusFee.toString(), Units.BASE); - } else { - return new croSdk.Coin(t.amount.toString(), Units.BASE); - } - default: - throw new Error("Unknown mode in transaction"); - } -}; - -/** - * - * @param {Account} a - * @param {Transaction} t - */ -export const buildTransaction = async ( - a: Account, - t: Transaction, - publicKey: string -) => { - const croSdk = getCroSdk(a.currency.id); - const address = a.freshAddresses[0].address; - const { accountNumber, sequence } = await getAccountParams( - address, - a.currency.id - ); - const rawTx = new croSdk.RawTransaction(); - rawTx.setFee(new croSdk.Coin((t.fees || 0).toString(), Units.BASE)); - - const msgSend = new croSdk.bank.MsgSend({ - fromAddress: address, - toAddress: t.recipient, - amount: getTransactionAmount(a, t), - }); - - const signableTx = rawTx - .appendMessage(msgSend) - .addSigner({ - publicKey: utils.Bytes.fromHexString(publicKey), - accountNumber: new utils.Big(accountNumber), - accountSequence: new utils.Big(sequence), - signMode: 0, - }) - .toSignable(); - - return signableTx; -}; diff --git a/src/families/crypto_org/js-estimateMaxSpendable.js b/src/families/crypto_org/js-estimateMaxSpendable.js deleted file mode 100644 index 15839a0d50..0000000000 --- a/src/families/crypto_org/js-estimateMaxSpendable.js +++ /dev/null @@ -1,29 +0,0 @@ -// @flow -import { BigNumber } from "bignumber.js"; - -import type { AccountLike, Account } from "../../types"; -import { getMainAccount } from "../../account"; - -import type { Transaction } from "./types"; - -import getEstimatedFees from "./js-getFeesForTransaction"; - -/** - * Returns the maximum possible amount for transaction - * - * @param {Object} param - the account, parentAccount and transaction - */ -const estimateMaxSpendable = async ({ - account, - parentAccount, -}: { - account: AccountLike, - parentAccount: ?Account, - transaction: ?Transaction, -}): Promise => { - const a = getMainAccount(account, parentAccount); - const fees = await getEstimatedFees(); - return a.spendableBalance.minus(fees); -}; - -export default estimateMaxSpendable; diff --git a/src/families/crypto_org/js-getFeesForTransaction.js b/src/families/crypto_org/js-getFeesForTransaction.js deleted file mode 100644 index 5d97946e61..0000000000 --- a/src/families/crypto_org/js-getFeesForTransaction.js +++ /dev/null @@ -1,14 +0,0 @@ -// @flow -import { BigNumber } from "bignumber.js"; -import { FIXED_GAS_PRICE, FIXED_DEFAULT_GAS_LIMIT } from "./logic"; - -/** - * Fetch the transaction fees for a transaction - */ -const getEstimatedFees = async (): Promise => { - // TODO: call gas station to get a more accurate tx fee in the future - let estimateFee = Math.ceil(FIXED_GAS_PRICE * FIXED_DEFAULT_GAS_LIMIT); - return new BigNumber(estimateFee); -}; - -export default getEstimatedFees; diff --git a/src/families/crypto_org/js-getTransactionStatus.js b/src/families/crypto_org/js-getTransactionStatus.js deleted file mode 100644 index ec637c41ff..0000000000 --- a/src/families/crypto_org/js-getTransactionStatus.js +++ /dev/null @@ -1,59 +0,0 @@ -// @flow -import { BigNumber } from "bignumber.js"; -import { - NotEnoughBalance, - RecipientRequired, - InvalidAddress, - FeeNotLoaded, - AmountRequired, -} from "@ledgerhq/errors"; -import type { Account, TransactionStatus } from "../../types"; -import type { Transaction } from "./types"; -import { isValidAddress } from "./logic"; - -const getTransactionStatus = async ( - a: Account, - t: Transaction -): Promise => { - const errors = {}; - const warnings = {}; - const useAllAmount = !!t.useAllAmount; - - if (!t.fees) { - errors.fees = new FeeNotLoaded(); - } - - const estimatedFees = t.fees || BigNumber(0); - - const totalSpent = useAllAmount - ? a.balance - : BigNumber(t.amount).plus(estimatedFees); - - const amount = useAllAmount - ? a.balance.minus(estimatedFees) - : BigNumber(t.amount); - - if (totalSpent.gt(a.balance)) { - errors.amount = new NotEnoughBalance(); - } - - if (!t.amount.gt(0)) { - errors.amount = new AmountRequired(); - } - - if (!t.recipient) { - errors.recipient = new RecipientRequired(); - } else if (!isValidAddress(t.recipient, a.currency.id)) { - errors.recipient = new InvalidAddress(); - } - - return Promise.resolve({ - errors, - warnings, - estimatedFees, - amount, - totalSpent, - }); -}; - -export default getTransactionStatus; diff --git a/src/families/crypto_org/js-signOperation.js b/src/families/crypto_org/js-signOperation.js deleted file mode 100644 index 0ea9d2d867..0000000000 --- a/src/families/crypto_org/js-signOperation.js +++ /dev/null @@ -1,179 +0,0 @@ -// @flow -import { BigNumber } from "bignumber.js"; -import { Observable } from "rxjs"; -import { FeeNotLoaded } from "@ledgerhq/errors"; -import { - CryptoOrgWrongSignatureHeader, - CryptoOrgSignatureSize, -} from "./errors"; -import type { Transaction } from "./types"; -import type { Account, Operation, SignOperationEvent } from "../../types"; - -import { open, close } from "../../hw"; -import { encodeOperationId } from "../../operation"; -import CryptoOrgApp from "@ledgerhq/hw-app-cosmos"; -import { utils } from "@crypto-com/chain-jslib"; - -import { buildTransaction } from "./js-buildTransaction"; -import { isTestNet } from "./logic"; - -const buildOptimisticOperation = ( - account: Account, - transaction: Transaction, - fee: BigNumber -): Operation => { - const type = "OUT"; - - const value = BigNumber(transaction.amount).plus(fee); - - const operation: $Exact = { - id: encodeOperationId(account.id, "", type), - hash: "", - type, - value, - fee, - blockHash: null, - blockHeight: null, - senders: [account.freshAddress], - recipients: [transaction.recipient].filter(Boolean), - accountId: account.id, - date: new Date(), - extra: { additionalField: transaction.amount }, - }; - - return operation; -}; - -function convertASN1toBase64(signature) { - // 0 0x30: a header byte indicating a compound structure - // 1 A 1-byte length descriptor for all what follows (ignore) - // 2 0x02: a header byte indicating an integer - // 3 A 1-byte length descriptor for the R value - // 4 The R coordinate, as a big-endian integer - // 0x02: a header byte indicating an integer - // A 1-byte length descriptor for the S value - // The S coordinate, as a big-endian integer - // = 7 bytes of overhead - if (signature[0] !== 0x30) { - throw new CryptoOrgWrongSignatureHeader(); - } - - // decode DER string format - let rOffset = 4; - let rLen = signature[3]; - const sLen = signature[4 + rLen + 1]; // skip over following 0x02 type prefix for s - let sOffset = signature.length - sLen; - - const sigR = signature.slice(rOffset, rOffset + rLen); // skip e.g. 3045022100 and pad - const sigS = signature.slice(sOffset); - const newSigR = padZero(sigR, 32); - const newSigS = padZero(sigS, 32); - - // $FlowFixMe please fix types here. - const signatureFormatted = Buffer.concat([newSigR, newSigS]); - if (signatureFormatted.length !== 64) { - throw new CryptoOrgSignatureSize(); - } - - return signatureFormatted; -} - -function padZero(original_array: Uint8Array, wanted_length: number) { - const new_array = new Uint8Array(wanted_length); - for (let i = wanted_length - 1; i >= 0; i--) { - const j = wanted_length - 1 - i; - const new_i = original_array.length - 1 - j; - if (new_i >= 0 && new_i < original_array.length) { - new_array[i] = original_array[new_i]; - } else { - new_array[i] = 0; - } - } - - return new_array; -} - -/** - * Sign Transaction with Ledger hardware - */ -const signOperation = ({ - account, - deviceId, - transaction, -}: { - account: Account, - deviceId: *, - transaction: Transaction, -}): Observable => - Observable.create((o) => { - async function main() { - const transport = await open(deviceId); - try { - o.next({ type: "device-signature-requested" }); - - if (!transaction.fees) { - throw new FeeNotLoaded(); - } - - // Get the public key - const hwApp = new CryptoOrgApp(transport); - const address = account.freshAddresses[0]; - const cointype = isTestNet(account.currency.id) ? "tcro" : "cro"; - const { publicKey } = await hwApp.getAddress( - address.derivationPath, - cointype, - false - ); - - const unsigned = await buildTransaction( - account, - transaction, - publicKey - ); - - // Sign by device - const { signature } = await hwApp.sign( - address.derivationPath, - unsigned.toSignDocument(0).toUint8Array() - ); - - // Ledger has encoded the sig in ASN1 DER format, but we need a 64-byte buffer of - // DER-encoded signature from Ledger - if (signature != null) { - const base64Sig = convertASN1toBase64(signature); - const signed = unsigned - .setSignature( - 0, - utils.Bytes.fromUint8Array(new Uint8Array(base64Sig)) - ) - .toSigned() - .getHexEncoded(); - - o.next({ type: "device-signature-granted" }); - - const operation = buildOptimisticOperation( - account, - transaction, - transaction.fees ?? BigNumber(0) - ); - - o.next({ - type: "signed", - signedOperation: { - operation, - signature: signed, - expirationDate: null, - }, - }); - } - } finally { - close(transport, deviceId); - } - } - main().then( - () => o.complete(), - (e) => o.error(e) - ); - }); - -export default signOperation; diff --git a/src/families/crypto_org/js-synchronisation.js b/src/families/crypto_org/js-synchronisation.js deleted file mode 100644 index 4063a5a0f8..0000000000 --- a/src/families/crypto_org/js-synchronisation.js +++ /dev/null @@ -1,51 +0,0 @@ -//@flow -import type { Account } from "../../types"; -import type { GetAccountShape } from "../../bridge/jsHelpers"; -import { makeSync, makeScanAccounts, mergeOps } from "../../bridge/jsHelpers"; - -import { getAccount, getOperations } from "./api"; - -const getAccountShape: GetAccountShape = async (info) => { - const { id, address, initialAccount, currency } = info; - const oldOperations = initialAccount?.operations || []; - const { - blockHeight, - balance, - bondedBalance, - redelegatingBalance, - unbondingBalance, - commissions, - } = await getAccount(address, currency.id); - - // Merge new operations with the previously synced ones - let startAt = 0; - let maxIteration = 20; - let operations = oldOperations; - let newOperations = await getOperations(id, address, startAt++, currency.id); - do { - operations = mergeOps(operations, newOperations); - newOperations = await getOperations(id, address, startAt++, currency.id); - } while (--maxIteration && newOperations.length != 0); - - const shape = { - id, - balance, - spendableBalance: balance, - operationsCount: operations.length, - blockHeight, - cryptoOrgResources: { - bondedBalance, - redelegatingBalance, - unbondingBalance, - commissions, - }, - }; - - return { ...shape, operations }; -}; - -const postSync = (initial: Account, parent: Account) => parent; - -export const scanAccounts = makeScanAccounts(getAccountShape); - -export const sync = makeSync(getAccountShape, postSync); diff --git a/src/families/crypto_org/js-transaction.js b/src/families/crypto_org/js-transaction.js deleted file mode 100644 index 3f8d8c7c7f..0000000000 --- a/src/families/crypto_org/js-transaction.js +++ /dev/null @@ -1,49 +0,0 @@ -// @flow -import { BigNumber } from "bignumber.js"; -import type { Account } from "../../types"; -import type { Transaction } from "./types"; -import getEstimatedFees from "./js-getFeesForTransaction"; -const sameFees = (a, b) => (!a || !b ? a === b : a.eq(b)); - -/** - * Create an empty transaction - * - * @returns {Transaction} - */ -export const createTransaction = (): Transaction => ({ - family: "crypto_org", - mode: "send", - amount: BigNumber(0), - recipient: "", - useAllAmount: false, - fees: null, -}); - -/** - * Apply patch to transaction - * - * @param {*} t - * @param {*} patch - */ -export const updateTransaction = ( - t: Transaction, - patch: $Shape -) => ({ ...t, ...patch }); - -/** - * Prepare transaction before checking status - * - * @param {Account} a - * @param {Transaction} t - */ -export const prepareTransaction = async (a: Account, t: Transaction) => { - let fees = t.fees; - - fees = await getEstimatedFees(); - - if (!sameFees(t.fees, fees)) { - return { ...t, fees }; - } - - return t; -}; diff --git a/src/families/crypto_org/logic.js b/src/families/crypto_org/logic.js deleted file mode 100644 index 8162840b69..0000000000 --- a/src/families/crypto_org/logic.js +++ /dev/null @@ -1,72 +0,0 @@ -// @flow -import { CroNetwork, CroSDK, utils } from "@crypto-com/chain-jslib"; - -export const TESTNET_CURRENCY_ID = "crypto_org_croeseid"; - -export const FIXED_GAS_PRICE = 0.025; -export const FIXED_DEFAULT_GAS_LIMIT = 200000; - -export const TestnetCroeseid3 = { - defaultNodeUrl: "https://testnet-croeseid-3.crypto.org", - chainId: "testnet-croeseid-3", - addressPrefix: "tcro", - validatorAddressPrefix: "tcrocncl", - validatorPubKeyPrefix: "tcrocnclconspub", - coin: { - baseDenom: "basetcro", - croDenom: "tcro", - }, - bip44Path: { - coinType: 1, - account: 0, - }, - rpcUrl: "https://testnet-croeseid-3.crypto.org:26657", -}; - -const croSdks = {}; - -/** - * Returns true if we are using testnet - * - * @param {string} currency - */ -export function isTestNet(currencyId: string) { - return currencyId == TESTNET_CURRENCY_ID; -} - -/** - * Get CroSdk - * @param {string} currency - */ -export function getCroSdk(currencyId: string) { - if (!croSdks[currencyId]) { - croSdks[currencyId] = isTestNet(currencyId) - ? CroSDK({ network: TestnetCroeseid3 }) - : CroSDK({ network: CroNetwork.Mainnet }); - } - return croSdks[currencyId]; -} - -/** - * Returns true if address is a valid md5 - * - * @param {string} address - * @param {boolean} useTestNet - */ -export const isValidAddress = ( - address: string, - currencyId: string -): boolean => { - if (!address) return false; - - const network = isTestNet(currencyId) ? TestnetCroeseid3 : CroNetwork.Mainnet; - - const addressProps = { - address: address, - network: network, - type: utils.AddressType.USER, - }; - - const addressValidator = new utils.AddressValidator(addressProps); - return addressValidator.isValid(); -}; diff --git a/src/families/crypto_org/serialization.js b/src/families/crypto_org/serialization.js deleted file mode 100644 index db535956e8..0000000000 --- a/src/families/crypto_org/serialization.js +++ /dev/null @@ -1,37 +0,0 @@ -// @flow -import { BigNumber } from "bignumber.js"; -import type { CryptoOrgResourcesRaw, CryptoOrgResources } from "./types"; - -export function toCryptoOrgResourcesRaw( - r: CryptoOrgResources -): CryptoOrgResourcesRaw { - const { - bondedBalance, - redelegatingBalance, - unbondingBalance, - commissions, - } = r; - return { - bondedBalance: bondedBalance.toString(), - redelegatingBalance: redelegatingBalance.toString(), - unbondingBalance: unbondingBalance.toString(), - commissions: commissions.toString(), - }; -} - -export function fromCryptoOrgResourcesRaw( - r: CryptoOrgResourcesRaw -): CryptoOrgResources { - const { - bondedBalance, - redelegatingBalance, - unbondingBalance, - commissions, - } = r; - return { - bondedBalance: BigNumber(bondedBalance), - redelegatingBalance: BigNumber(redelegatingBalance), - unbondingBalance: BigNumber(unbondingBalance), - commissions: BigNumber(commissions), - }; -} diff --git a/src/families/crypto_org/transaction.js b/src/families/crypto_org/transaction.js deleted file mode 100644 index f3e352c93b..0000000000 --- a/src/families/crypto_org/transaction.js +++ /dev/null @@ -1,49 +0,0 @@ -// @flow -import type { Transaction, TransactionRaw } from "./types"; -import { BigNumber } from "bignumber.js"; -import { - fromTransactionCommonRaw, - toTransactionCommonRaw, -} from "../../transaction/common"; -import type { Account } from "../../types"; -import { getAccountUnit } from "../../account"; -import { formatCurrencyUnit } from "../../currencies"; - -export const formatTransaction = ( - { mode, amount, recipient, useAllAmount }: Transaction, - account: Account -): string => - ` -${mode.toUpperCase()} ${ - useAllAmount - ? "MAX" - : amount.isZero() - ? "" - : " " + - formatCurrencyUnit(getAccountUnit(account), amount, { - showCode: true, - disableRounding: true, - }) - }${recipient ? `\nTO ${recipient}` : ""}`; - -export const fromTransactionRaw = (tr: TransactionRaw): Transaction => { - const common = fromTransactionCommonRaw(tr); - return { - ...common, - family: tr.family, - mode: tr.mode, - fees: tr.fees ? BigNumber(tr.fees) : null, - }; -}; - -export const toTransactionRaw = (t: Transaction): TransactionRaw => { - const common = toTransactionCommonRaw(t); - return { - ...common, - family: t.family, - mode: t.mode, - fees: t.fees?.toString() || null, - }; -}; - -export default { formatTransaction, fromTransactionRaw, toTransactionRaw }; diff --git a/src/families/crypto_org/types.js b/src/families/crypto_org/types.js deleted file mode 100644 index 39186c8048..0000000000 --- a/src/families/crypto_org/types.js +++ /dev/null @@ -1,56 +0,0 @@ -// @flow -import type { BigNumber } from "bignumber.js"; -import type { - TransactionCommon, - TransactionCommonRaw, -} from "../../types/transaction"; - -export type CoreStatics = {}; - -export type CoreAccountSpecifics = {}; - -export type CoreOperationSpecifics = {}; - -export type CoreCurrencySpecifics = {}; - -export type CryptoOrgResources = {| - bondedBalance: BigNumber, - redelegatingBalance: BigNumber, - unbondingBalance: BigNumber, - commissions: BigNumber, -|}; - -export type CryptoOrgResourcesRaw = {| - bondedBalance: string, - redelegatingBalance: string, - unbondingBalance: string, - commissions: string, -|}; - -export type Transaction = {| - ...TransactionCommon, - family: "crypto_org", - mode: string, - fees: ?BigNumber, - // add here all transaction-specific fields if you implement other modes than "send" -|}; - -export type TransactionRaw = {| - ...TransactionCommonRaw, - family: "crypto_org", - mode: string, - fees: ?string, - // also the transaction fields as raw JSON data -|}; - -export type CryptoOrgPreloadData = {||}; - -export type NetworkInfo = {| - family: "crypto_org", -|}; - -export type NetworkInfoRaw = {| - family: "crypto_org", -|}; - -export const reflect = (_declare: *) => {}; diff --git a/src/families/elrond/test-dataset.js b/src/families/elrond/test-dataset.js index 7b444e89b3..f340f6b9a0 100644 --- a/src/families/elrond/test-dataset.js +++ b/src/families/elrond/test-dataset.js @@ -12,7 +12,7 @@ type TestTransaction = { }, }; -const dataset: DatasetTest = { +export default dataset = { implementations: ["js"], currencies: { elrond: { @@ -56,5 +56,3 @@ const dataset: DatasetTest = { }, }, }; - -export default dataset; diff --git a/src/families/ethereum/modules/compound.js b/src/families/ethereum/modules/compound.js index c1b0f9a92a..7f7955164f 100644 --- a/src/families/ethereum/modules/compound.js +++ b/src/families/ethereum/modules/compound.js @@ -396,11 +396,18 @@ export function prepareTokenAccounts( return subAccounts.concat(implicitCTokenAccounts); } -const cdaiToDaiOpMapping: { [_: OperationType]: ?OperationType } = { +const ctokenToGeneratedTokenOpMapping: { + [_: OperationType]: ?OperationType, +} = { IN: "SUPPLY", OUT: "REDEEM", }; +const ctokenToTokenOpMapping: { [_: OperationType]: ?OperationType } = { + IN: "OUT", + OUT: "IN", +}; + export async function digestTokenAccounts( currency: CryptoCurrency, subAccounts: TokenAccount[], @@ -469,30 +476,39 @@ export async function digestTokenAccounts( // operations, C* to * conversions with the historical rates // cIN => SUPPLY // cOUT => REDEEM - const rates = await fetchHistoricalRates( - ctoken, - ctokenAccount.operations.map((op) => op.date) - ); - - const newOps = ctokenAccount.operations - .map((op, i) => { - const { rate } = rates[i]; - const value = op.value.times(rate).integerValue(); - const type = cdaiToDaiOpMapping[op.type]; - if (!type) return; - return { - ...op, - id: `${a.id}-${op.hash}-${type}`, - type, - value, - accountId: a.id, - extra: { - compoundValue: op.value.toString(10), - rate: rate.toString(10), - }, - }; - }) - .filter(Boolean); + const blockNumberSet = new Set(); + ctokenAccount.operations.forEach(({ blockHeight }) => { + if (typeof blockHeight !== "number") return; + blockNumberSet.add(blockHeight); + }); + const rates = await fetchHistoricalRates(ctoken, [...blockNumberSet]); + + const newOps = []; + ctokenAccount.operations.forEach((ctokenOp, i) => { + const { rate } = rates[i]; + const type = ctokenToGeneratedTokenOpMapping[ctokenOp.type]; + const tokenOpType = ctokenToTokenOpMapping[ctokenOp.type]; + if (!type || !tokenOpType) return; + + const matchingTokenOp = a.operations.find( + (tokenOp) => + tokenOp.id === `${a.id}-${ctokenOp.hash}-${tokenOpType}` + ); + if (!matchingTokenOp) return; + + const newOp = { + ...ctokenOp, + id: `${a.id}-${ctokenOp.hash}-${type}`, + type, + value: matchingTokenOp.value, + accountId: a.id, + extra: { + compoundValue: ctokenOp.value.toString(10), + rate: rate.toString(10), + }, + }; + newOps.push(newOp); + }); // TODO: for perf, we can be a slightly more conservative and keep refs as much as possible to not have a ref changes above @@ -581,11 +597,11 @@ type HistoRate = { async function fetchHistoricalRates( token, - dates: Date[] + blockNumbers: number[] ): Promise { - const all = await promiseAllBatched(3, dates, async (date) => { + const all = await promiseAllBatched(3, blockNumbers, async (blockNumber) => { const { data } = await fetch("/ctoken", { - block_timestamp: Math.round(date.getTime() / 1000), + block_number: blockNumber, addresses: [token.contractAddress], }); const cToken = data.cToken.find( diff --git a/src/families/polkadot/api/bisontrails.js b/src/families/polkadot/api/bisontrails.js index 8c6e8de7c3..862c734861 100644 --- a/src/families/polkadot/api/bisontrails.js +++ b/src/families/polkadot/api/bisontrails.js @@ -8,7 +8,6 @@ import { encodeOperationId } from "../../../operation"; import { getEnv } from "../../../env"; import { getOperationType } from "./common"; import type { OperationType, Operation } from "../../../types"; -import { isValidAddress } from "../logic"; const LIMIT = 200; @@ -51,11 +50,6 @@ const getWithdrawUnbondedAmount = (extrinsic) => { ); }; -const getController = (_extrinsic) => { - // TODO: ask BisonTrails to provide the info - return ""; -}; - /** * add Extra info for operation details * @@ -99,13 +93,6 @@ const getExtra = (type: OperationType, extrinsic: *): Object => { }; break; - case "SET_CONTROLLER": - extra = { - ...extra, - controller: getController(extrinsic), - }; - break; - case "REWARD_PAYOUT": case "SLASH": extra = { @@ -194,9 +181,9 @@ const extrinsicToOperation = ( date: new Date(extrinsic.timestamp), extra: getExtra(type, extrinsic), senders: [extrinsic.signer], - recipients: [extrinsic.affectedAddress1, extrinsic.affectedAddress2] - .filter(Boolean) - .filter(isValidAddress), + recipients: [extrinsic.affectedAddress1, extrinsic.affectedAddress2].filter( + Boolean + ), transactionSequenceNumber: extrinsic.signer === addr ? extrinsic.nonce : undefined, hasFailed: !extrinsic.isSuccess, diff --git a/src/families/polkadot/api/common.js b/src/families/polkadot/api/common.js index 750088ca85..487583ad0b 100644 --- a/src/families/polkadot/api/common.js +++ b/src/families/polkadot/api/common.js @@ -38,9 +38,6 @@ export const getOperationType = ( case "withdrawUnbonded": return "WITHDRAW_UNBONDED"; - case "setController": - return "SET_CONTROLLER"; - case "payoutStakers": return "FEES"; diff --git a/src/families/polkadot/api/index.js b/src/families/polkadot/api/index.js index 0b85c1822b..cceb6b54a6 100644 --- a/src/families/polkadot/api/index.js +++ b/src/families/polkadot/api/index.js @@ -30,7 +30,6 @@ export { verifyValidatorAddresses, getAccount, getTransactionParams, - getMinimumBondBalance, submitExtrinsic, paymentInfo, getValidators, diff --git a/src/families/polkadot/api/sidecar.js b/src/families/polkadot/api/sidecar.js index 25c6d463a8..ea5e14aa33 100644 --- a/src/families/polkadot/api/sidecar.js +++ b/src/families/polkadot/api/sidecar.js @@ -4,8 +4,8 @@ import querystring from "querystring"; import { TypeRegistry, ModulesWithCalls } from "@polkadot/types"; import { getSpecTypes } from "@polkadot/types-known"; -import { Metadata } from "@polkadot/types/metadata"; -import { expandMetadata } from "@polkadot/types/metadata/decorate"; +import { Metadata } from "@polkadot/metadata"; +import { expandMetadata } from "@polkadot/metadata/decorate"; import { makeLRUCache } from "../../../cache"; import type { CacheRes } from "../../../cache"; @@ -174,23 +174,6 @@ const fetchActiveEra = async (): Promise => { return data; }; -/** - * Fetch the minimum value allowed for a bond - * - * @async - * @param {string} addr - * - * @returns {string} - */ -export const getMinimumBondBalance = async (): Promise => { - const { data }: { data: SidecarPalletStorageItem } = await network({ - method: "GET", - url: getSidecarUrl(`/pallets/staking/storage/minNominatorBond`), - }); - - return (data.value && BigNumber(data.value)) || BigNumber(0); -}; - /** * Fetch a list of validators with some info and indentity. * It fetches the list providing a status (all, elected, waiting) and/or a list of @@ -682,7 +665,7 @@ export const getConstants: CacheRes, Object> = makeLRUCache( async (): Promise => fetchConstants(), () => "polkadot", { - max: 1, // Store only one constants object since we only have polkadot. + max: 1, // Store only one constnats object since we only have polkadot. maxAge: 60 * 60 * 1000, // 1 hour } ); diff --git a/src/families/polkadot/cache.js b/src/families/polkadot/cache.js index bbe5091945..92b201879d 100644 --- a/src/families/polkadot/cache.js +++ b/src/families/polkadot/cache.js @@ -1,6 +1,4 @@ // @flow -import { BigNumber } from "bignumber.js"; - import { TypeRegistry, ModulesWithCalls } from "@polkadot/types"; import { makeLRUCache } from "../../cache"; @@ -15,7 +13,6 @@ import { getRegistry as apiGetRegistry, getTransactionParams as apiGetTransactionParams, paymentInfo as apiPaymentInfo, - getMinimumBondBalance as apiGetMinimumBondBalance, } from "./api"; /** @@ -53,8 +50,6 @@ const hashTransactionParams = ( return `${prefix}_${t.numSlashingSpans ?? "0"}`; case "chill": return `${prefix}`; - case "setController": - return `${prefix}`; case "claimReward": return `${prefix}_${t.era || "0"}`; default: @@ -164,22 +159,3 @@ export const isElectionClosed: CacheRes, boolean> = makeLRUCache( maxAge: 60 * 1000, // 1 minute } ); - -/** - * Cache the getMinimumBondBalance to avoid too many calls - * - * @async - * - * @returns {Promise} consts - */ -export const getMinimumBondBalance: CacheRes< - Array, - BigNumber -> = makeLRUCache( - async (): Promise => apiGetMinimumBondBalance(), - () => "polkadot", - { - max: 1, // Store only one object since we only have polkadot. - maxAge: 60 * 60 * 1000, // 1 hour - } -); diff --git a/src/families/polkadot/deviceTransactionConfig.js b/src/families/polkadot/deviceTransactionConfig.js index b19c66f98d..e28be52ef1 100644 --- a/src/families/polkadot/deviceTransactionConfig.js +++ b/src/families/polkadot/deviceTransactionConfig.js @@ -179,19 +179,6 @@ function getDeviceTransactionConfig({ }); break; - case "setController": - fields.push({ - type: "text", - label: "Staking", - value: "Set controller", - }); - fields.push({ - type: "text", - label: "Controller", - value: mainAccount.freshAddress, - }); - break; - case "claimReward": fields.push({ type: "text", diff --git a/src/families/polkadot/js-buildTransaction.js b/src/families/polkadot/js-buildTransaction.js index e02dc445f2..a48e830495 100644 --- a/src/families/polkadot/js-buildTransaction.js +++ b/src/families/polkadot/js-buildTransaction.js @@ -79,14 +79,6 @@ const getExtrinsicParams = (a: Account, t: Transaction) => { args: { numSlashingSpans: a.polkadotResources?.numSlashingSpans || 0 }, }; - case "setController": - // Set the current account as its own controller - return { - pallet: "staking", - name: "setController", - args: { controller: a.freshAddress }, - }; - case "nominate": // Construct a transaction to nominate validators. // Must be signed by the controller, and can be only called when `EraElectionStatus` is `Closed`. diff --git a/src/families/polkadot/js-getTransactionStatus.js b/src/families/polkadot/js-getTransactionStatus.js index fbc0a3a88d..a2b4134be6 100644 --- a/src/families/polkadot/js-getTransactionStatus.js +++ b/src/families/polkadot/js-getTransactionStatus.js @@ -30,15 +30,15 @@ import { import { verifyValidatorAddresses } from "./api"; import { EXISTENTIAL_DEPOSIT, + MINIMUM_BOND_AMOUNT, FEES_SAFETY_BUFFER, isValidAddress, isFirstBond, isController, - isStash, hasLockedBalance, hasMaxUnlockings, calculateAmount, - getMinimumAmountToBond, + getMinimalLockedBalance, getMinimumBalance, } from "./logic"; import { getCurrentPolkadotPreloadData } from "./preload"; @@ -80,13 +80,7 @@ const getSendTransactionStatus = async ( leftover.lt(minimumBalanceExistential) && leftover.gt(0) ) { - errors.amount = new PolkadotDoMaxSendInstead("", { - minimumBalance: formatCurrencyUnit( - a.currency.units[0], - EXISTENTIAL_DEPOSIT, - { showCode: true } - ), - }); + errors.amount = new PolkadotDoMaxSendInstead(); } else if (totalSpent.gt(a.spendableBalance)) { errors.amount = new NotEnoughBalance(); } @@ -126,9 +120,7 @@ const getSendTransactionStatus = async ( const getTransactionStatus = async (a: Account, t: Transaction) => { const errors = {}; const warnings = {}; - const preloaded = getCurrentPolkadotPreloadData(); - const { staking, validators } = preloaded; - const minimumBondBalance = BigNumber(preloaded.minimumBondBalance); + const { staking, validators } = getCurrentPolkadotPreloadData(); if (t.mode === "send") { return await getSendTransactionStatus(a, t); @@ -151,20 +143,8 @@ const getTransactionStatus = async (a: Account, t: Transaction) => { const currentBonded = a.polkadotResources?.lockedBalance.minus(unlockingBalance) || BigNumber(0); - const minimumAmountToBond = getMinimumAmountToBond(a, minimumBondBalance); - switch (t.mode) { case "bond": - if (amount.lt(minimumAmountToBond)) { - errors.amount = new PolkadotBondMinimumAmount("", { - minimumBondAmount: formatCurrencyUnit( - a.currency.units[0], - minimumAmountToBond, - { showCode: true } - ), - }); - } - if (isFirstBond(a)) { // Not a stash yet -> bond method sets the controller if (!t.recipient) { @@ -176,6 +156,25 @@ const getTransactionStatus = async (a: Account, t: Transaction) => { "Recipient is already a controller" ); } + + // If not a stash yet, first bond must respect minimum amount of 1 DOT + if (amount.lt(MINIMUM_BOND_AMOUNT)) { + errors.amount = new PolkadotBondMinimumAmount("", { + minimalAmount: formatCurrencyUnit( + a.currency.units[0], + MINIMUM_BOND_AMOUNT, + { showCode: true } + ), + }); + } + } else if (amount.lt(getMinimalLockedBalance(a))) { + errors.amount = new PolkadotBondMinimumAmount("", { + minimalAmount: formatCurrencyUnit( + a.currency.units[0], + getMinimalLockedBalance(a), + { showCode: true } + ), + }); } break; @@ -192,7 +191,7 @@ const getTransactionStatus = async (a: Account, t: Transaction) => { if (amount.lte(0)) { errors.amount = new AmountRequired(); } else if ( - amount.gt(currentBonded.minus(EXISTENTIAL_DEPOSIT)) && + amount.gt(currentBonded.minus(MINIMUM_BOND_AMOUNT)) && amount.lt(currentBonded) ) { warnings.amount = new PolkadotLowBondedBalance(); @@ -210,11 +209,11 @@ const getTransactionStatus = async (a: Account, t: Transaction) => { errors.amount = new AmountRequired(); } else if (amount.gt(unlockingBalance)) { errors.amount = new NotEnoughBalance(); - } else if (amount.lt(minimumAmountToBond)) { + } else if (amount.lt(getMinimalLockedBalance(a))) { errors.amount = new PolkadotBondMinimumAmount("", { minimalAmount: formatCurrencyUnit( a.currency.units[0], - minimumAmountToBond, + getMinimalLockedBalance(a), { showCode: true } ), }); @@ -272,12 +271,6 @@ const getTransactionStatus = async (a: Account, t: Transaction) => { errors.staking = new PolkadotNoNominations(); } break; - - case "setController": - if (!isStash(a)) { - errors.staking = new PolkadotUnauthorizedOperation(); - } - break; } const estimatedFees = t.fees || BigNumber(0); diff --git a/src/families/polkadot/js-signOperation.js b/src/families/polkadot/js-signOperation.js index 411475c5f8..fa1e7fe34c 100644 --- a/src/families/polkadot/js-signOperation.js +++ b/src/families/polkadot/js-signOperation.js @@ -23,7 +23,6 @@ const MODE_TO_TYPE = { withdrawUnbonded: "WITHDRAW_UNBONDED", nominate: "NOMINATE", chill: "CHILL", - setController: "SET_CONTROLLER", claimReward: "REWARD_PAYOUT", default: "FEES", }; @@ -37,7 +36,6 @@ const MODE_TO_PALLET_METHOD = { withdrawUnbonded: "staking.withdrawUnbonded", nominate: "staking.nominate", chill: "staking.chill", - setController: "staking.setController", claimReward: "staking.payoutStakers", }; diff --git a/src/families/polkadot/logic.js b/src/families/polkadot/logic.js index 0592679ff4..a3c67ab8c2 100644 --- a/src/families/polkadot/logic.js +++ b/src/families/polkadot/logic.js @@ -4,9 +4,9 @@ import { decodeAddress } from "@polkadot/util-crypto"; import type { Account, OperationType } from "../../types"; import type { Transaction } from "./types"; -import { getCurrentPolkadotPreloadData } from "./preload"; export const EXISTENTIAL_DEPOSIT = BigNumber(10000000000); +export const MINIMUM_BOND_AMOUNT = BigNumber(10000000000); export const MAX_NOMINATIONS = 16; export const MAX_UNLOCKINGS = 32; export const PRELOAD_MAX_AGE = 60 * 1000; @@ -86,35 +86,19 @@ export const canBond = (a: Account): boolean => { }; /** - * Get the minimum bond amount required to bond/rebond + * Get the minimum bond amount required to rebond * * @param {Account} a */ -export const getMinimumAmountToBond = ( - a: Account, - minimumBondBalance: ?BigNumber -): BigNumber => { - const currentlyBondedBalance = calculateMaxUnbond(a); +export const getMinimalLockedBalance = (a: Account): BigNumber => { + const remainingActiveLockedBalance = calculateMaxUnbond(a); - if (minimumBondBalance && currentlyBondedBalance.lt(minimumBondBalance)) { - return minimumBondBalance.minus(currentlyBondedBalance); + if (remainingActiveLockedBalance.lt(MINIMUM_BOND_AMOUNT)) { + return MINIMUM_BOND_AMOUNT.minus(remainingActiveLockedBalance); } return BigNumber(0); }; -/** - * Return true if the account has at least the current minimum bonded balance required by the network - * - * @param {Account} a - */ -export const hasMinimumBondBalance = (a: Account): boolean => { - const { minimumBondBalance } = getCurrentPolkadotPreloadData(); - return ( - !a.polkadotResources || - a.polkadotResources.lockedBalance.gte(BigNumber(minimumBondBalance)) - ); -}; - /** * Return true if some operation with type is pending and not yet synchronized * diff --git a/src/families/polkadot/preload.js b/src/families/polkadot/preload.js index 28e2fa552a..b16534d018 100644 --- a/src/families/polkadot/preload.js +++ b/src/families/polkadot/preload.js @@ -5,14 +5,13 @@ import { Observable, Subject } from "rxjs"; import { log } from "@ledgerhq/logs"; import { PRELOAD_MAX_AGE } from "./logic"; -import { getRegistry, getMinimumBondBalance } from "./cache"; +import { getRegistry } from "./cache"; import type { PolkadotPreloadData, PolkadotValidator } from "./types"; import { getStakingProgress, getValidators } from "./validators"; let currentPolkadotPreloadedData: PolkadotPreloadData = { validators: [], staking: null, - minimumBondBalance: "0", }; function fromHydrateValidator(validatorRaw: Object): PolkadotValidator { @@ -35,7 +34,6 @@ function fromHydrateValidator(validatorRaw: Object): PolkadotValidator { function fromHydratePreloadData(data: mixed): PolkadotPreloadData { let validators = []; let staking = null; - let minimumBondBalance = "0"; if (typeof data === "object" && data) { if (Array.isArray(data.validators)) { @@ -58,19 +56,11 @@ function fromHydratePreloadData(data: mixed): PolkadotPreloadData { bondingDuration: Number(bondingDuration) || 28, }; } - - if ( - data.minimumBondBalance !== null && - typeof data.minimumBondBalance === "string" - ) { - minimumBondBalance = data.minimumBondBalance || "0"; - } } return { validators, staking, - minimumBondBalance, }; } @@ -106,8 +96,6 @@ const shouldRefreshValidators = (previousState, currentState) => { export const preload = async (): Promise => { await getRegistry(); // ensure registry is already in cache. const currentStakingProgress = await getStakingProgress(); - const minimumBondBalance = await getMinimumBondBalance(); - const minimumBondBalanceStr = minimumBondBalance.toString(); const { validators: previousValidators, @@ -132,7 +120,6 @@ export const preload = async (): Promise => { return { validators, staking: currentStakingProgress, - minimumBondBalance: minimumBondBalanceStr, }; }; diff --git a/src/families/polkadot/specs.js b/src/families/polkadot/specs.js index a3cd6450ef..012fc7be0c 100644 --- a/src/families/polkadot/specs.js +++ b/src/families/polkadot/specs.js @@ -15,7 +15,7 @@ import { canUnbond, canNominate, isFirstBond, - getMinimumAmountToBond, + getMinimalLockedBalance, } from "../../families/polkadot/logic"; const currency = getCryptoCurrencyById("polkadot"); @@ -82,11 +82,8 @@ const polkadot: AppSpec = { maxRun: 2, transaction: ({ account, bridge }) => { invariant(canBond(account), "can't bond"); - const { minimumBondBalance } = getCurrentPolkadotPreloadData(); invariant( - BigNumber(100000).gt( - getMinimumAmountToBond(account, BigNumber(minimumBondBalance)) - ), + BigNumber(100000).gt(getMinimalLockedBalance(account)), "can't bond because too much unbond" ); const { polkadotResources } = account; diff --git a/src/families/polkadot/test-dataset.js b/src/families/polkadot/test-dataset.js index 2a7278056e..fbab1fa58b 100644 --- a/src/families/polkadot/test-dataset.js +++ b/src/families/polkadot/test-dataset.js @@ -482,7 +482,6 @@ const dataset: DatasetTest = { }, ], }, - // TODO: Write a setController test { raw: { id: `js:2:polkadot:${ACCOUNT_CONTROLLER}:polkadotbip44`, diff --git a/src/families/polkadot/types.js b/src/families/polkadot/types.js index 5027ed511a..9a21c54fd3 100644 --- a/src/families/polkadot/types.js +++ b/src/families/polkadot/types.js @@ -113,7 +113,6 @@ export type PolkadotStakingProgress = {| export type PolkadotPreloadData = {| validators: PolkadotValidator[], staking: PolkadotStakingProgress | null, - minimumBondBalance: string, |}; export type PolkadotSearchFilter = ( diff --git a/src/generated/account.js b/src/generated/account.js index ea939514eb..028dab9852 100644 --- a/src/generated/account.js +++ b/src/generated/account.js @@ -2,7 +2,6 @@ import algorand from "../families/algorand/account.js"; import bitcoin from "../families/bitcoin/account.js"; import cosmos from "../families/cosmos/account.js"; -import crypto_org from "../families/crypto_org/account.js"; import elrond from "../families/elrond/account.js"; import polkadot from "../families/polkadot/account.js"; @@ -10,7 +9,6 @@ export default { algorand, bitcoin, cosmos, - crypto_org, elrond, polkadot, }; diff --git a/src/generated/bridge/js.js b/src/generated/bridge/js.js index 77fa3f77e7..b4edc5922c 100644 --- a/src/generated/bridge/js.js +++ b/src/generated/bridge/js.js @@ -1,5 +1,4 @@ // @flow -import crypto_org from "../../families/crypto_org/bridge/js.js"; import elrond from "../../families/elrond/bridge/js.js"; import ethereum from "../../families/ethereum/bridge/js.js"; import neo from "../../families/neo/bridge/js.js"; @@ -9,7 +8,6 @@ import stellar from "../../families/stellar/bridge/js.js"; import tron from "../../families/tron/bridge/js.js"; export default { - crypto_org, elrond, ethereum, neo, diff --git a/src/generated/cli-transaction.js b/src/generated/cli-transaction.js index 55ab51a85b..389975c980 100644 --- a/src/generated/cli-transaction.js +++ b/src/generated/cli-transaction.js @@ -2,7 +2,6 @@ import algorand from "../families/algorand/cli-transaction.js"; import bitcoin from "../families/bitcoin/cli-transaction.js"; import cosmos from "../families/cosmos/cli-transaction.js"; -import crypto_org from "../families/crypto_org/cli-transaction.js"; import elrond from "../families/elrond/cli-transaction.js"; import ethereum from "../families/ethereum/cli-transaction.js"; import polkadot from "../families/polkadot/cli-transaction.js"; @@ -15,7 +14,6 @@ export default { algorand, bitcoin, cosmos, - crypto_org, elrond, ethereum, polkadot, diff --git a/src/generated/hw-getAddress.js b/src/generated/hw-getAddress.js index 3049a30c3f..1f5e7eb782 100644 --- a/src/generated/hw-getAddress.js +++ b/src/generated/hw-getAddress.js @@ -2,7 +2,6 @@ import algorand from "../families/algorand/hw-getAddress.js"; import bitcoin from "../families/bitcoin/hw-getAddress.js"; import cosmos from "../families/cosmos/hw-getAddress.js"; -import crypto_org from "../families/crypto_org/hw-getAddress.js"; import elrond from "../families/elrond/hw-getAddress.js"; import ethereum from "../families/ethereum/hw-getAddress.js"; import neo from "../families/neo/hw-getAddress.js"; @@ -16,7 +15,6 @@ export default { algorand, bitcoin, cosmos, - crypto_org, elrond, ethereum, neo, diff --git a/src/generated/transaction.js b/src/generated/transaction.js index 9702af533b..0e8de21e1d 100644 --- a/src/generated/transaction.js +++ b/src/generated/transaction.js @@ -2,7 +2,6 @@ import algorand from "../families/algorand/transaction.js"; import bitcoin from "../families/bitcoin/transaction.js"; import cosmos from "../families/cosmos/transaction.js"; -import crypto_org from "../families/crypto_org/transaction.js"; import elrond from "../families/elrond/transaction.js"; import ethereum from "../families/ethereum/transaction.js"; import neo from "../families/neo/transaction.js"; @@ -16,7 +15,6 @@ export default { algorand, bitcoin, cosmos, - crypto_org, elrond, ethereum, neo, diff --git a/src/generated/types.js b/src/generated/types.js index 36db3a4b6b..a0cefb2501 100644 --- a/src/generated/types.js +++ b/src/generated/types.js @@ -24,15 +24,6 @@ import type { Transaction as cosmosTransaction } from "../families/cosmos/types" import type { TransactionRaw as cosmosTransactionRaw } from "../families/cosmos/types"; import type { NetworkInfo as cosmosNetworkInfo } from "../families/cosmos/types"; import type { NetworkInfoRaw as cosmosNetworkInfoRaw } from "../families/cosmos/types"; -import { reflect as crypto_orgReflect } from "../families/crypto_org/types"; -import type { CoreStatics as CoreStatics_crypto_org } from "../families/crypto_org/types"; -import type { CoreAccountSpecifics as CoreAccountSpecifics_crypto_org } from "../families/crypto_org/types"; -import type { CoreOperationSpecifics as CoreOperationSpecifics_crypto_org } from "../families/crypto_org/types"; -import type { CoreCurrencySpecifics as CoreCurrencySpecifics_crypto_org } from "../families/crypto_org/types"; -import type { Transaction as crypto_orgTransaction } from "../families/crypto_org/types"; -import type { TransactionRaw as crypto_orgTransactionRaw } from "../families/crypto_org/types"; -import type { NetworkInfo as crypto_orgNetworkInfo } from "../families/crypto_org/types"; -import type { NetworkInfoRaw as crypto_orgNetworkInfoRaw } from "../families/crypto_org/types"; import { reflect as elrondReflect } from "../families/elrond/types"; import type { CoreStatics as CoreStatics_elrond } from "../families/elrond/types"; import type { CoreAccountSpecifics as CoreAccountSpecifics_elrond } from "../families/elrond/types"; @@ -108,7 +99,6 @@ export type SpecificStatics = {} & CoreStatics_algorand & CoreStatics_bitcoin & CoreStatics_cosmos -& CoreStatics_crypto_org & CoreStatics_elrond & CoreStatics_ethereum & CoreStatics_neo @@ -121,7 +111,6 @@ export type CoreAccountSpecifics = {} & CoreAccountSpecifics_algorand & CoreAccountSpecifics_bitcoin & CoreAccountSpecifics_cosmos -& CoreAccountSpecifics_crypto_org & CoreAccountSpecifics_elrond & CoreAccountSpecifics_ethereum & CoreAccountSpecifics_neo @@ -134,7 +123,6 @@ export type CoreOperationSpecifics = {} & CoreOperationSpecifics_algorand & CoreOperationSpecifics_bitcoin & CoreOperationSpecifics_cosmos -& CoreOperationSpecifics_crypto_org & CoreOperationSpecifics_elrond & CoreOperationSpecifics_ethereum & CoreOperationSpecifics_neo @@ -147,7 +135,6 @@ export type CoreCurrencySpecifics = {} & CoreCurrencySpecifics_algorand & CoreCurrencySpecifics_bitcoin & CoreCurrencySpecifics_cosmos -& CoreCurrencySpecifics_crypto_org & CoreCurrencySpecifics_elrond & CoreCurrencySpecifics_ethereum & CoreCurrencySpecifics_neo @@ -160,7 +147,6 @@ export type Transaction = | algorandTransaction | bitcoinTransaction | cosmosTransaction - | crypto_orgTransaction | elrondTransaction | ethereumTransaction | neoTransaction @@ -173,7 +159,6 @@ export type TransactionRaw = | algorandTransactionRaw | bitcoinTransactionRaw | cosmosTransactionRaw - | crypto_orgTransactionRaw | elrondTransactionRaw | ethereumTransactionRaw | neoTransactionRaw @@ -185,7 +170,6 @@ export type TransactionRaw = export type NetworkInfo = | bitcoinNetworkInfo | cosmosNetworkInfo - | crypto_orgNetworkInfo | elrondNetworkInfo | ethereumNetworkInfo | neoNetworkInfo @@ -196,7 +180,6 @@ export type NetworkInfo = export type NetworkInfoRaw = | bitcoinNetworkInfoRaw | cosmosNetworkInfoRaw - | crypto_orgNetworkInfoRaw | elrondNetworkInfoRaw | ethereumNetworkInfoRaw | neoNetworkInfoRaw @@ -208,7 +191,6 @@ export const reflectSpecifics = (declare: *) => [ algorandReflect(declare), bitcoinReflect(declare), cosmosReflect(declare), - crypto_orgReflect(declare), elrondReflect(declare), ethereumReflect(declare), neoReflect(declare), diff --git a/src/hw/actions/app.js b/src/hw/actions/app.js index 2c19fe9500..3d939e4a10 100644 --- a/src/hw/actions/app.js +++ b/src/hw/actions/app.js @@ -76,7 +76,6 @@ export type AppRequest = { account?: ?Account, tokenCurrency?: ?TokenCurrency, dependencies?: AppRequest[], - requireLatestFirmware?: boolean, }; export type AppResult = {| @@ -300,9 +299,10 @@ function inferCommandParams(appRequest: AppRequest) { let derivationMode; let derivationPath; - const { account } = appRequest; - let { appName, currency, dependencies, requireLatestFirmware } = appRequest; - + let appName = appRequest.appName; + const account = appRequest.account; + let currency = appRequest.currency; + let dependencies = appRequest.dependencies; if (!currency && account) { currency = account.currency; } @@ -317,7 +317,7 @@ function inferCommandParams(appRequest: AppRequest) { } if (!currency) { - return { appName, dependencies, requireLatestFirmware }; + return { appName, dependencies }; } let extra; @@ -341,7 +341,6 @@ function inferCommandParams(appRequest: AppRequest) { return { appName, dependencies, - requireLatestFirmware, requiresDerivation: { derivationMode, path: derivationPath, @@ -479,7 +478,6 @@ export const createAction = ( ): AppAction => { const useHook = (device: ?Device, appRequest: AppRequest): AppState => { const dependenciesResolvedRef = useRef(false); - const latestFirmwareResolvedRef = useRef(false); const connectApp = useCallback( (device, params) => @@ -492,15 +490,10 @@ export const createAction = ( dependencies: dependenciesResolvedRef.current ? undefined : params.dependencies, - requireLatestFirmware: latestFirmwareResolvedRef.current - ? undefined - : params.requireLatestFirmware, }).pipe( tap((e) => { if (e.type === "dependencies-resolved") { dependenciesResolvedRef.current = true; - } else if (e.type === "latest-firmware-resolved") { - latestFirmwareResolvedRef.current = true; } }), catchError((error: Error) => of({ type: "error", error })) diff --git a/src/hw/actions/initSwap.js b/src/hw/actions/initSwap.js index 931c11831d..31c9258395 100644 --- a/src/hw/actions/initSwap.js +++ b/src/hw/actions/initSwap.js @@ -36,8 +36,6 @@ type InitSwapRequest = { exchange: Exchange, exchangeRate: ExchangeRate, transaction: Transaction, - userId?: string, - requireLatestFirmware?: boolean, }; type Result = @@ -118,14 +116,7 @@ export const createAction = ( state.freezeReduxDevice ); - const { - exchange, - exchangeRate, - transaction, - userId, - requireLatestFirmware, - } = initSwapRequest; - + const { exchange, exchangeRate, transaction } = initSwapRequest; const { fromAccount, fromParentAccount, @@ -142,7 +133,6 @@ export const createAction = ( { account: mainFromAccount }, { account: maintoAccount }, ], - requireLatestFirmware, } ); @@ -163,7 +153,6 @@ export const createAction = ( exchangeRate, transaction, deviceId: device.deviceId, - userId, }) ) .pipe( @@ -183,7 +172,7 @@ export const createAction = ( return () => { sub.unsubscribe(); }; - }, [exchange, exchangeRate, transaction, device, opened, hasError, userId]); + }, [exchange, exchangeRate, transaction, device, opened, hasError]); return { ...appState, diff --git a/src/hw/connectApp.js b/src/hw/connectApp.js index 4c4726a5c9..14e6965d21 100644 --- a/src/hw/connectApp.js +++ b/src/hw/connectApp.js @@ -1,8 +1,7 @@ // @flow -import semver from "semver"; import { Observable, concat, from, of, throwError, defer } from "rxjs"; -import { mergeMap, concatMap, map, catchError, delay } from "rxjs/operators"; +import { concatMap, map, catchError, delay } from "rxjs/operators"; import { TransportStatusError, FirmwareOrAppUpdateRequired, @@ -15,20 +14,16 @@ import { import Transport from "@ledgerhq/hw-transport"; import type { DeviceModelId } from "@ledgerhq/devices"; import type { DerivationMode } from "../types"; -import type { DeviceInfo, FirmwareUpdateContext } from "../types/manager"; import { getCryptoCurrencyById } from "../currencies"; import appSupportsQuitApp from "../appSupportsQuitApp"; import { withDevice } from "./deviceAccess"; import { streamAppInstall } from "../apps/hw"; import { isDashboardName } from "./isDashboardName"; import getAppAndVersion from "./getAppAndVersion"; -import getDeviceInfo from "./getDeviceInfo"; import getAddress from "./getAddress"; import openApp from "./openApp"; import quitApp from "./quitApp"; -import { LatestFirmwareVersionRequired } from "../errors"; import { mustUpgrade } from "../apps"; -import manager from "../manager"; export type RequiresDerivation = {| currencyId: string, @@ -43,7 +38,6 @@ export type Input = { appName: string, requiresDerivation?: RequiresDerivation, dependencies?: string[], - requireLatestFirmware?: boolean, }; export type AppAndVersion = { @@ -64,7 +58,6 @@ export type ConnectAppEvent = | { type: "stream-install", progress: number } | { type: "listing-apps" } | { type: "dependencies-resolved" } - | { type: "latest-firmware-resolved" } | { type: "ask-quit-app" } | { type: "ask-open-app", appName: string } | { type: "opened", app?: AppAndVersion, derivation?: { address: string } } @@ -167,7 +160,6 @@ const cmd = ({ appName, requiresDerivation, dependencies, - requireLatestFirmware, }: Input): Observable => withDevice(devicePath)((transport) => Observable.create((o) => { @@ -175,45 +167,12 @@ const cmd = ({ .pipe(delay(1000)) .subscribe((e) => o.next(e)); - const innerSub = ({ - appName, - dependencies, - requireLatestFirmware, - }: any) => + const innerSub = ({ appName, dependencies }: any) => defer(() => from(getAppAndVersion(transport))).pipe( concatMap((appAndVersion): Observable => { timeoutSub.unsubscribe(); if (isDashboardName(appAndVersion.name)) { - // check if we meet minimum fw - if (requireLatestFirmware) { - return from(getDeviceInfo(transport)).pipe( - mergeMap((deviceInfo: DeviceInfo) => - from(manager.getLatestFirmwareForDevice(deviceInfo)).pipe( - mergeMap((latest: ?FirmwareUpdateContext) => { - if ( - !latest || - semver.eq(deviceInfo.version, latest.final.version) - ) { - o.next({ type: "latest-firmware-resolved" }); - return innerSub({ appName }); // NB without the fw version check - } else { - return throwError( - new LatestFirmwareVersionRequired( - "LatestFirmwareVersionRequired", - { - latest: latest.final.version, - current: deviceInfo.version, - } - ) - ); - } - }) - ) - ) - ); - } - // check if we meet dependencies if (dependencies?.length) { return streamAppInstall({ @@ -229,12 +188,7 @@ const cmd = ({ return openAppFromDashboard(transport, appName); } - // in order to check the fw version, install deps, we need dashboard - if ( - dependencies?.length || - requireLatestFirmware || - appAndVersion.name !== appName - ) { + if (dependencies?.length || appAndVersion.name !== appName) { return attemptToQuitApp(transport, appAndVersion); } @@ -288,11 +242,7 @@ const cmd = ({ return throwError(e); }) ); - const sub = innerSub({ - appName, - dependencies, - requireLatestFirmware, - }).subscribe(o); + const sub = innerSub({ appName, dependencies }).subscribe(o); return () => { timeoutSub.unsubscribe(); diff --git a/src/operation.js b/src/operation.js index 35039040cb..06c1b8383c 100644 --- a/src/operation.js +++ b/src/operation.js @@ -99,7 +99,6 @@ export function getOperationAmountNumber(op: Operation): BigNumber { case "BOND": case "UNBOND": case "WITHDRAW_UNBONDED": - case "SET_CONTROLLER": case "NOMINATE": case "CHILL": return op.fee.negated(); diff --git a/src/platform/CatalogProvider.js b/src/platform/CatalogProvider.js deleted file mode 100644 index 8bbc4df1e7..0000000000 --- a/src/platform/CatalogProvider.js +++ /dev/null @@ -1,92 +0,0 @@ -// @flow - -import React, { useContext, useEffect, useMemo, useState } from "react"; - -import type { AppManifest, AppBranch, AppPlatform } from "./types"; -import { isSupported, matchPlatform, matchBranches } from "./logic"; - -import api from "./api"; - -type State = { - apps: AppManifest[], -}; - -type Props = { - children: React$Node, -}; - -const initialState = { - apps: [], -}; - -export const PlatformCatalogContext = React.createContext(initialState); - -const PlatformCatalogProvider = ({ children }: Props) => { - const [state, setState] = useState(initialState); - - useEffect(() => { - api.fetchManifest().then((manifest) => setState({ apps: manifest })); - }, []); - - return ( - - {children} - - ); -}; - -export const usePlatformManifests = () => { - const context = useContext(PlatformCatalogContext); - if (context === undefined) { - throw new Error( - "usePlatformManifests must be used within a PlatformCatalogContext" - ); - } - - return context; -}; - -export const useCatalog = ( - platform: AppPlatform = "all", - branches?: AppBranch[] = ["stable"] -) => { - const context = useContext(PlatformCatalogContext); - if (context === undefined) { - throw new Error("useCatalog must be used within a PlatformCatalogContext"); - } - - const apps = useMemo( - (): AppManifest[] => - context.apps.filter( - (manifest) => - matchPlatform(manifest, platform) && - (!branches || matchBranches(manifest, branches)) && - isSupported(manifest) && - !manifest.private - ), - [context.apps, branches, platform] - ); - - return { - ...context, - apps, - }; -}; - -export const useAppManifest = (platformId: string) => { - const context = useContext(PlatformCatalogContext); - if (context === undefined) { - throw new Error( - "useAppManifest must be used within a PlatformCatalogContext" - ); - } - - const manifest = useMemo( - () => context.apps.find((app) => app.id === platformId), - [context.apps, platformId] - ); - - return manifest; -}; - -export default PlatformCatalogProvider; diff --git a/src/platform/PlatformAppProvider/api/api.js b/src/platform/PlatformAppProvider/api/api.js deleted file mode 100644 index 2ecee2ed47..0000000000 --- a/src/platform/PlatformAppProvider/api/api.js +++ /dev/null @@ -1,30 +0,0 @@ -// @flow - -import { getEnv } from "../../../env"; -import network from "../../../network"; -import type { AppManifest, PlatformApi } from "../../types"; - -// expose a function to fetch data from the cdn (data from ledger-live-assets) -// https://cdn.live.ledger.com/ - -const basePlatformUrl = () => getEnv("PLATFORM_API_URL"); -const platformVersion = () => getEnv("PLATFORM_API_VERSION"); - -async function fetchManifest(): Promise { - const url = `${basePlatformUrl()}/v${platformVersion()}/data.json?t=${Date.now()}`; - - const { data } = await network({ - method: "GET", - headers: { - Origin: "http://localhost:3000", - }, - url, - }); - return data; -} - -const api: PlatformApi = { - fetchManifest, -}; - -export default api; diff --git a/src/platform/PlatformAppProvider/api/api.mock.js b/src/platform/PlatformAppProvider/api/api.mock.js deleted file mode 100644 index 3c6672e1a3..0000000000 --- a/src/platform/PlatformAppProvider/api/api.mock.js +++ /dev/null @@ -1,295 +0,0 @@ -// @flow -import type { AppManifest, PlatformApi } from "../../types"; - -const manifest: AppManifest[] = [ - { - id: "paraswap", - name: "ParaSwap", - url: - "https://ledger-live-platform-apps.vercel.app/app/dapp-browser?url=https%3A%2F%2Fparaswap.io%2F%3Fembed%3Dtrue%26referrer%3Dledger2&nanoApp=Paraswap&dappName=ParaSwap", - homepageUrl: "https://paraswap.io", - supportUrl: "https://paraswap.io", - icon: "https://cdn.live.ledger.com/icons/platform/paraswap.png", - platform: "all", - apiVersion: "0.0.1", - manifestVersion: "1", - branch: "stable", - params: ["accountId"], - categories: ["swap", "defi"], - currencies: ["ethereum"], - content: { - shortDescription: { - en: - "Swap your crypto with ParaSwap that aggregates and provides the best quotes decentralised exchanges.", - }, - description: { - en: - "Swap your crypto with ParaSwap that aggregates and provides the best quotes decentralised exchanges.", - }, - }, - permissions: [ - { - method: "account.list", - params: { - currencies: ["ethereum"], - }, - }, - { - method: "account.request", - params: { - currencies: ["ethereum"], - }, - }, - { - method: "transaction.sign", - params: { - nanoApp: ["paraswap"], - }, - }, - { - method: "transaction.broadcast", - }, - ], - domains: ["https://*"], - }, - { - id: "wyre_buy", - name: "Wyre", - url: "https://ledger-live-platform-apps.vercel.app/app/wyre", - homepageUrl: "https://www.sendwyre.com/", - icon: "https://cdn.live.ledger.com/icons/platform/wyre.png", - platform: "all", - apiVersion: "0.0.1", - manifestVersion: "1", - branch: "stable", - categories: ["exchange", "buy"], - currencies: ["ethereum", "bitcoin"], - content: { - shortDescription: { - en: - "Purchase Bitcoin, Ethereum and more crypto with Wyre, only available to our US customers.", - }, - description: { - en: - "Purchase Bitcoin, Ethereum and more crypto with Wyre, only available to our US customers.", - }, - }, - permissions: [ - { - method: "account.request", - params: { - currencies: ["ethereum", "bitcoin"], - }, - }, - ], - domains: ["https://*"], - }, - { - id: "zerion", - name: "Zerion", - url: - "https://ledger-live-platform-apps.vercel.app/app/dapp-browser?dappName=Zerion&nanoApp=Paraswap&url=https%3A%2F%2Fapp.zerion.io%2F%3Fembed%3Dledgerdappbrowser", - homepageUrl: "https://zerion.io/", - icon: "https://cdn.live.ledger.com/icons/platform/zerion.png", - platform: "all", - apiVersion: "0.0.1", - manifestVersion: "1", - branch: "stable", - categories: ["portfolio", "defi"], - currencies: ["ethereum"], - content: { - shortDescription: { - en: "The smart way to manage your DeFi portfolio.", - }, - description: { - en: "The smart way to manage your DeFi portfolio.", - }, - }, - permissions: [], - domains: ["https://*"], - }, - { - id: "rainbow", - name: "Rainbow.me", - url: - "https://ledger-live-platform-apps.vercel.app/app/web-browser?url=https%3A%2F%2Frainbow.me%2F%7Baccount.address%7D¤cies=ethereum&webAppName=Rainbow.me", - homepageUrl: "https://rainbow.me", - icon: "https://cdn.live.ledger.com/icons/platform/rainbow.png", - platform: "all", - apiVersion: "0.0.1", - manifestVersion: "1", - branch: "stable", - categories: ["nft"], - currencies: ["ethereum"], - content: { - shortDescription: { - en: "An easy way to visualize the NFT secured by your hardware wallet.", - }, - description: { - en: "An easy way to visualize the NFT secured by your hardware wallet.", - }, - }, - permissions: [], - domains: ["https://*"], - }, - { - id: "aave", - name: "Aave", - url: "", - homepageUrl: "https://aave.com/", - icon: "https://cdn.live.ledger.com/icons/platform/aave.png", - platform: "all", - apiVersion: "0.0.1", - manifestVersion: "1", - branch: "soon", - categories: ["lend"], - currencies: ["ethereum"], - content: { - shortDescription: { - en: - "Lend or Borrow your crypto through a liquidity market protocol and stay in control of your funds.", - }, - description: { - en: - "Lend or Borrow your crypto through a liquidity market protocol and stay in control of your funds.", - }, - }, - permissions: [], - domains: [], - }, - { - id: "compound", - name: "Compound", - url: "", - homepageUrl: "https://compound.finance/", - icon: "https://cdn.live.ledger.com/icons/platform/compound.png", - platform: "all", - apiVersion: "0.0.1", - manifestVersion: "1", - branch: "soon", - categories: ["lend", "compound"], - currencies: ["ethereum"], - content: { - shortDescription: { - en: - "Lend or Borrow your crypto via a completely decentralized and open-source protocol.", - }, - description: { - en: - "Lend or Borrow your crypto via a completely decentralized and open-source protocol.", - }, - }, - permissions: [], - domains: [], - }, - { - id: "deversifi", - name: "DeversiFi", - url: "", - homepageUrl: "https://www.deversifi.com/", - icon: "https://cdn.live.ledger.com/icons/platform/deversifi.png", - platform: "all", - apiVersion: "0.0.1", - manifestVersion: "1", - branch: "soon", - categories: ["dex"], - currencies: ["ethereum"], - content: { - shortDescription: { - en: - "Trade through a self-custody decentralized exchange on Ethereum layer-2.", - }, - description: { - en: - "Trade through a self-custody decentralized exchange on Ethereum layer-2.", - }, - }, - permissions: [], - domains: [], - }, - { - id: "1inch", - name: "1Inch", - url: "", - homepageUrl: "https://1inch.io/", - icon: "https://cdn.live.ledger.com/icons/platform/1inch.png", - platform: "all", - apiVersion: "0.0.1", - manifestVersion: "1", - branch: "soon", - categories: ["swap", "defi"], - currencies: ["ethereum"], - content: { - shortDescription: { - en: "Exchange crypto via a Defi/DEX aggregator on Ethereum.", - }, - description: { - en: "Exchange crypto via a Defi/DEX aggregator on Ethereum.", - }, - }, - permissions: [], - domains: [], - }, - { - id: "lido", - name: "Lido", - url: "", - homepageUrl: "https://lido.fi/", - icon: "https://cdn.live.ledger.com/icons/platform/lido.png", - platform: "all", - apiVersion: "0.0.1", - manifestVersion: "1", - branch: "soon", - categories: ["staking", "defi"], - currencies: ["ethereum"], - content: { - shortDescription: { - en: "Stake any amount of Eth to Eth2 and earn daily staking rewards.", - }, - description: { - en: "Stake any amount of Eth to Eth2 and earn daily staking rewards.", - }, - }, - permissions: [], - domains: [], - }, - { - id: "debug", - name: "Debugger", - url: "https://ledger-live-platform-apps.vercel.app/app/debug", - homepageUrl: "https://developers.ledger.com/", - icon: "https://cdn.live.ledger.com/icons/platform/debugger.png", - platform: "all", - apiVersion: "0.0.1", - manifestVersion: "1", - branch: "debug", - categories: ["tools"], - currencies: "*", - content: { - shortDescription: { - en: - "Try out the Ledger Live API to test capabilities of our platform integration solution. Use at your own risk.", - }, - description: { - en: - "Try out the Ledger Live API to test capabilities of our platform integration solution. Use at your own risk.", - }, - }, - permissions: [ - { - method: "*", - }, - ], - domains: ["https://*"], - }, -]; - -async function fetchManifest(): Promise { - return Promise.resolve(manifest); -} - -const api: PlatformApi = { - fetchManifest, -}; - -export default api; diff --git a/src/platform/PlatformAppProvider/api/index.js b/src/platform/PlatformAppProvider/api/index.js deleted file mode 100644 index 499afee68e..0000000000 --- a/src/platform/PlatformAppProvider/api/index.js +++ /dev/null @@ -1,15 +0,0 @@ -// @flow - -import { getEnv } from "../../../env"; -import type { PlatformApi } from "../../types"; -import prodApi from "./api"; -import mockApi from "./api.mock"; - -const api: PlatformApi = { - fetchManifest: () => - getEnv("MOCK") || !getEnv("PLATFORM_API_URL") - ? mockApi.fetchManifest() - : prodApi.fetchManifest(), -}; - -export default api; diff --git a/src/platform/PlatformAppProvider/helpers.js b/src/platform/PlatformAppProvider/helpers.js deleted file mode 100644 index bffb78489b..0000000000 --- a/src/platform/PlatformAppProvider/helpers.js +++ /dev/null @@ -1,58 +0,0 @@ -// @flow - -import type { AppManifest } from "../types"; -import semver from "semver"; - -export type FilterParams = { - branches?: string[], - platform?: string, - private?: boolean, - version?: string, -}; - -function matchVersion(filterParams: FilterParams, manifest: AppManifest) { - return ( - !filterParams.version || - semver.satisfies(semver.coerce(filterParams.version), manifest.apiVersion) - ); -} - -function matchBranches(filterParams: FilterParams, manifest: AppManifest) { - return ( - !filterParams.branches || filterParams.branches.includes(manifest.branch) - ); -} - -function matchPlatform(filterParams: FilterParams, manifest: AppManifest) { - return ( - !filterParams.platform || - filterParams.platform === "all" || - filterParams.platform === manifest.platform - ); -} - -function matchPrivate(filterParams: FilterParams, manifest: AppManifest) { - return filterParams.private === true || !(manifest.private === true); -} - -export function filterPlatformApps( - appManifests: AppManifest[], - filterParams: FilterParams -): AppManifest[] { - return appManifests.filter((appManifest: AppManifest) => { - return ( - matchBranches(filterParams, appManifest) && - matchPlatform(filterParams, appManifest) && - matchPrivate(filterParams, appManifest) && - matchVersion(filterParams, appManifest) - ); - }); -} - -export function mergeManifestLists( - list1: AppManifest[], - list2: AppManifest[] -): AppManifest[] { - const newIds = new Set(list2.map((elem) => elem.id)); - return [...list1.filter((elem) => !newIds.has(elem.id)), ...list2]; -} diff --git a/src/platform/PlatformAppProvider/index.js b/src/platform/PlatformAppProvider/index.js deleted file mode 100644 index 720c1f77bb..0000000000 --- a/src/platform/PlatformAppProvider/index.js +++ /dev/null @@ -1,96 +0,0 @@ -// @flow - -import React, { - createContext, - useCallback, - useMemo, - useState, - useEffect, - useContext, -} from "react"; -import type { PlatformAppContextType, Props, State } from "./types"; -import api from "./api"; -import { mergeManifestLists } from "./helpers"; - -//$FlowFixMe -const PlatformAppContext = createContext({}); - -const initialState: State = { - manifests: [], - manifestById: {}, - isLoading: false, - lastUpdateTime: undefined, - error: undefined, -}; - -const AUTO_UPDATE_DEFAULT_DELAY = 1800 * 1000; // 1800 seconds - -export function usePlatformApp(): PlatformAppContextType { - return useContext(PlatformAppContext); -} - -export function PlatformAppProvider({ - autoUpdateDelay, - extraManifests, - children, -}: Props) { - const [state, setState] = useState(initialState); - - const updateData = useCallback(async () => { - try { - setState((previousState) => ({ - ...previousState, - isLoading: true, - })); - const manifests = await api.fetchManifest(); - const allManifests = extraManifests - ? mergeManifestLists(manifests, extraManifests) - : manifests; - setState((previousState) => ({ - ...previousState, - manifests: allManifests, - manifestById: allManifests.reduce((acc, manifest) => { - acc[manifest.id] = manifest; - return acc; - }, {}), - isLoading: false, - lastUpdateTime: Date.now(), - error: undefined, - })); - } catch (error) { - setState((previousState) => ({ - ...previousState, - isLoading: false, - error, - })); - } - }, [extraManifests]); - - useEffect(() => { - updateData(); - }, [updateData]); - - useEffect(() => { - const intervalInstance = setInterval( - updateData, - autoUpdateDelay !== undefined - ? autoUpdateDelay - : AUTO_UPDATE_DEFAULT_DELAY - ); - return () => clearInterval(intervalInstance); - }, [autoUpdateDelay, updateData]); - - const value = useMemo( - () => ({ - ...state, - updateData, - }), - [state, updateData] - ); - - return ( - - {children} - - ); -} diff --git a/src/platform/PlatformAppProvider/types.js b/src/platform/PlatformAppProvider/types.js deleted file mode 100644 index 6c1cc9237e..0000000000 --- a/src/platform/PlatformAppProvider/types.js +++ /dev/null @@ -1,23 +0,0 @@ -// @flow - -import type { AppManifest } from "../types"; - -export type State = { - manifests: AppManifest[], - manifestById: { [id: string]: AppManifest }, - isLoading: boolean, - lastUpdateTime: ?number, - error: ?Error, -}; - -export type Props = { - children: React$Node, - autoUpdateDelay?: number, - extraManifests?: AppManifest[], -}; - -export type API = { - updateData: () => Promise, -}; - -export type PlatformAppContextType = State & API; diff --git a/src/platform/api/api.js b/src/platform/api/api.js deleted file mode 100644 index e0e17f0c70..0000000000 --- a/src/platform/api/api.js +++ /dev/null @@ -1,30 +0,0 @@ -// @flow - -import { getEnv } from "../../env"; -import network from "../../network"; -import type { AppManifest, PlatformApi } from "../types"; - -// expose a function to fetch data from the cdn (data from ledger-live-assets) -// https://cdn.live.ledger.com/ - -const basePlatformUrl = () => getEnv("PLATFORM_API_URL"); -const platformVersion = () => getEnv("PLATFORM_API_VERSION"); - -async function fetchManifest(): Promise { - const url = `${basePlatformUrl()}/v${platformVersion()}/data.json?t=${Date.now()}`; - - const { data } = await network({ - method: "GET", - headers: { - Origin: "http://localhost:3000", - }, - url, - }); - return data; -} - -const api: PlatformApi = { - fetchManifest, -}; - -export default api; diff --git a/src/platform/api/api.mock.js b/src/platform/api/api.mock.js deleted file mode 100644 index eeccef76e2..0000000000 --- a/src/platform/api/api.mock.js +++ /dev/null @@ -1,295 +0,0 @@ -// @flow -import type { AppManifest, PlatformApi } from "../types"; - -const manifest: AppManifest[] = [ - { - id: "paraswap", - name: "ParaSwap", - url: - "https://ledger-live-platform-apps.vercel.app/app/dapp-browser?url=https%3A%2F%2Fparaswap.io%2F%3Fembed%3Dtrue%26referrer%3Dledger2&nanoApp=Paraswap&dappName=ParaSwap", - homepageUrl: "https://paraswap.io", - supportUrl: "https://paraswap.io", - icon: "https://cdn.live.ledger.com/icons/platform/paraswap.png", - platform: "all", - apiVersion: "0.0.1", - manifestVersion: "1", - branch: "stable", - params: ["accountId"], - categories: ["swap", "defi"], - currencies: ["ethereum"], - content: { - shortDescription: { - en: - "Swap your crypto with ParaSwap that aggregates and provides the best quotes decentralised exchanges.", - }, - description: { - en: - "Swap your crypto with ParaSwap that aggregates and provides the best quotes decentralised exchanges.", - }, - }, - permissions: [ - { - method: "account.list", - params: { - currencies: ["ethereum"], - }, - }, - { - method: "account.request", - params: { - currencies: ["ethereum"], - }, - }, - { - method: "transaction.sign", - params: { - nanoApp: ["paraswap"], - }, - }, - { - method: "transaction.broadcast", - }, - ], - domains: ["https://*"], - }, - { - id: "wyre_buy", - name: "Wyre", - url: "https://ledger-live-platform-apps.vercel.app/app/wyre", - homepageUrl: "https://www.sendwyre.com/", - icon: "https://cdn.live.ledger.com/icons/platform/wyre.png", - platform: "all", - apiVersion: "0.0.1", - manifestVersion: "1", - branch: "stable", - categories: ["exchange", "buy"], - currencies: ["ethereum", "bitcoin"], - content: { - shortDescription: { - en: - "Purchase Bitcoin, Ethereum and more crypto with Wyre, only available to our US customers.", - }, - description: { - en: - "Purchase Bitcoin, Ethereum and more crypto with Wyre, only available to our US customers.", - }, - }, - permissions: [ - { - method: "account.request", - params: { - currencies: ["ethereum", "bitcoin"], - }, - }, - ], - domains: ["https://*"], - }, - { - id: "zerion", - name: "Zerion", - url: - "https://ledger-live-platform-apps.vercel.app/app/dapp-browser?dappName=Zerion&nanoApp=Paraswap&url=https%3A%2F%2Fapp.zerion.io%2F%3Fembed%3Dledgerdappbrowser", - homepageUrl: "https://zerion.io/", - icon: "https://cdn.live.ledger.com/icons/platform/zerion.png", - platform: "all", - apiVersion: "0.0.1", - manifestVersion: "1", - branch: "stable", - categories: ["portfolio", "defi"], - currencies: ["ethereum"], - content: { - shortDescription: { - en: "The smart way to manage your DeFi portfolio.", - }, - description: { - en: "The smart way to manage your DeFi portfolio.", - }, - }, - permissions: [], - domains: ["https://*"], - }, - { - id: "rainbow", - name: "Rainbow.me", - url: - "https://ledger-live-platform-apps.vercel.app/app/web-browser?url=https%3A%2F%2Frainbow.me%2F%7Baccount.address%7D¤cies=ethereum&webAppName=Rainbow.me", - homepageUrl: "https://rainbow.me", - icon: "https://cdn.live.ledger.com/icons/platform/rainbow.png", - platform: "all", - apiVersion: "0.0.1", - manifestVersion: "1", - branch: "stable", - categories: ["nft"], - currencies: ["ethereum"], - content: { - shortDescription: { - en: "An easy way to visualize the NFT secured by your hardware wallet.", - }, - description: { - en: "An easy way to visualize the NFT secured by your hardware wallet.", - }, - }, - permissions: [], - domains: ["https://*"], - }, - { - id: "aave", - name: "Aave", - url: "", - homepageUrl: "https://aave.com/", - icon: "https://cdn.live.ledger.com/icons/platform/aave.png", - platform: "all", - apiVersion: "0.0.1", - manifestVersion: "1", - branch: "soon", - categories: ["lend"], - currencies: ["ethereum"], - content: { - shortDescription: { - en: - "Lend or Borrow your crypto through a liquidity market protocol and stay in control of your funds.", - }, - description: { - en: - "Lend or Borrow your crypto through a liquidity market protocol and stay in control of your funds.", - }, - }, - permissions: [], - domains: [], - }, - { - id: "compound", - name: "Compound", - url: "", - homepageUrl: "https://compound.finance/", - icon: "https://cdn.live.ledger.com/icons/platform/compound.png", - platform: "all", - apiVersion: "0.0.1", - manifestVersion: "1", - branch: "soon", - categories: ["lend", "compound"], - currencies: ["ethereum"], - content: { - shortDescription: { - en: - "Lend or Borrow your crypto via a completely decentralized and open-source protocol.", - }, - description: { - en: - "Lend or Borrow your crypto via a completely decentralized and open-source protocol.", - }, - }, - permissions: [], - domains: [], - }, - { - id: "deversifi", - name: "DeversiFi", - url: "", - homepageUrl: "https://www.deversifi.com/", - icon: "https://cdn.live.ledger.com/icons/platform/deversifi.png", - platform: "all", - apiVersion: "0.0.1", - manifestVersion: "1", - branch: "soon", - categories: ["dex"], - currencies: ["ethereum"], - content: { - shortDescription: { - en: - "Trade through a self-custody decentralized exchange on Ethereum layer-2.", - }, - description: { - en: - "Trade through a self-custody decentralized exchange on Ethereum layer-2.", - }, - }, - permissions: [], - domains: [], - }, - { - id: "1inch", - name: "1Inch", - url: "", - homepageUrl: "https://1inch.io/", - icon: "https://cdn.live.ledger.com/icons/platform/1inch.png", - platform: "all", - apiVersion: "0.0.1", - manifestVersion: "1", - branch: "soon", - categories: ["swap", "defi"], - currencies: ["ethereum"], - content: { - shortDescription: { - en: "Exchange crypto via a Defi/DEX aggregator on Ethereum.", - }, - description: { - en: "Exchange crypto via a Defi/DEX aggregator on Ethereum.", - }, - }, - permissions: [], - domains: [], - }, - { - id: "lido", - name: "Lido", - url: "", - homepageUrl: "https://lido.fi/", - icon: "https://cdn.live.ledger.com/icons/platform/lido.png", - platform: "all", - apiVersion: "0.0.1", - manifestVersion: "1", - branch: "soon", - categories: ["staking", "defi"], - currencies: ["ethereum"], - content: { - shortDescription: { - en: "Stake any amount of Eth to Eth2 and earn daily staking rewards.", - }, - description: { - en: "Stake any amount of Eth to Eth2 and earn daily staking rewards.", - }, - }, - permissions: [], - domains: [], - }, - { - id: "debug", - name: "Debugger", - url: "https://ledger-live-platform-apps.vercel.app/app/debug", - homepageUrl: "https://developers.ledger.com/", - icon: "https://cdn.live.ledger.com/icons/platform/debugger.png", - platform: "all", - apiVersion: "0.0.1", - manifestVersion: "1", - branch: "debug", - categories: ["tools"], - currencies: "*", - content: { - shortDescription: { - en: - "Try out the Ledger Live API to test capabilities of our platform integration solution. Use at your own risk.", - }, - description: { - en: - "Try out the Ledger Live API to test capabilities of our platform integration solution. Use at your own risk.", - }, - }, - permissions: [ - { - method: "*", - }, - ], - domains: ["https://*"], - }, -]; - -async function fetchManifest(): Promise { - return Promise.resolve(manifest); -} - -const api: PlatformApi = { - fetchManifest, -}; - -export default api; diff --git a/src/platform/api/index.js b/src/platform/api/index.js deleted file mode 100644 index 643e3a891a..0000000000 --- a/src/platform/api/index.js +++ /dev/null @@ -1,15 +0,0 @@ -// @flow - -import { getEnv } from "../../env"; -import type { PlatformApi } from "../types"; -import prodApi from "./api"; -import mockApi from "./api.mock"; - -const api: PlatformApi = { - fetchManifest: () => - getEnv("MOCK") || !getEnv("PLATFORM_API_URL") - ? mockApi.fetchManifest() - : prodApi.fetchManifest(), -}; - -export default api; diff --git a/src/platform/logic.js b/src/platform/logic.js deleted file mode 100644 index 939d5718a4..0000000000 --- a/src/platform/logic.js +++ /dev/null @@ -1,27 +0,0 @@ -// @flow - -import semver from "semver"; - -import type { AppManifest, AppPlatform, AppBranch } from "./types"; -import { getPlatformVersion } from "./version"; - -export function translateContent(content: any, locale: string = "en") { - if (!content || typeof content !== "object") return content; - - return content[locale] || content.en; -} - -export function isSupported(manifest: AppManifest) { - return semver.satisfies( - semver.coerce(getPlatformVersion()), - manifest.apiVersion - ); -} - -export function matchBranches(manifest: AppManifest, branches: AppBranch[]) { - return branches.indexOf(manifest.branch) > -1; -} - -export function matchPlatform(manifest: AppManifest, platform: AppPlatform) { - return manifest.platform === "all" || manifest.platform === platform; -} diff --git a/src/platform/types.js b/src/platform/types.js index 9b9488e8da..6e5ba62f14 100644 --- a/src/platform/types.js +++ b/src/platform/types.js @@ -4,50 +4,6 @@ import type { BigNumber } from "bignumber.js"; import type { SignedOperation } from "../types"; -export type TranslatableString = { - en: string, - [locale: string]: string, -}; - -export type AppPlatform = - | "desktop" // == windows || mac || linux - | "mobile" // == android || ios - | "all"; - -export type AppBranch = "stable" | "experimental" | "soon" | "debug"; - -export type AppPermission = { - method: string, - params?: any, -}; - -export type AppManifest = { - id: string, - private?: boolean, - name: string, - url: string, - homepageUrl: string, - supportUrl?: string, - icon?: string | null, - platform: AppPlatform, - apiVersion: string, - manifestVersion: string, - branch: AppBranch, - params?: string[], - categories: string[], - currencies: string[] | "*", - content: { - shortDescription: TranslatableString, - description: TranslatableString, - }, - permissions: AppPermission[], - domains: string[], -}; - -export type PlatformApi = { - fetchManifest: () => Promise, -}; - export type PlatformAccount = { id: string, name: string, diff --git a/src/platform/version.js b/src/platform/version.js deleted file mode 100644 index a0370324c4..0000000000 --- a/src/platform/version.js +++ /dev/null @@ -1,18 +0,0 @@ -// @flow -// as the client side must implement platform, it's for LLD/LLM to set the platform version -// that way allows to be loosely coupled between common and lld/llm -// it's like we do for enabling coins. -// beware this must be set in the first import of the end project. - -import invariant from "invariant"; - -let version = ""; - -export function getPlatformVersion() { - invariant(version, "setPlatformVersion must be called before anything else."); - return version; -} - -export function setPlatformVersion(v: string) { - version = v; -} diff --git a/src/platform/version.test.js b/src/platform/version.test.js deleted file mode 100644 index 4cbb4963b3..0000000000 --- a/src/platform/version.test.js +++ /dev/null @@ -1,7 +0,0 @@ -// @flow -import "../__tests__/test-helpers/setup"; -import { getPlatformVersion } from "./version"; - -test("version is defined by setup", () => { - expect(getPlatformVersion()).toBe("0.0.1"); -}); diff --git a/src/react.js b/src/react.js index d3f8f6aca6..18c05e4a16 100644 --- a/src/react.js +++ b/src/react.js @@ -1,6 +1,5 @@ // @flow import * as icons from "./data/icons/react"; -import * as flags from "./data/flags/react"; import type { CryptoCurrency, TokenCurrency } from "./types"; type Icon = React$ComponentType<{ size: number, color?: string }>; @@ -19,7 +18,3 @@ export function getCryptoCurrencyIcon(currency: CryptoCurrency): ?Icon { export function getTokenCurrencyIcon(token: TokenCurrency): ?Icon { return token.disableCountervalue ? null : icons[getIconId(token)]; } - -export function getFlag(countryCode: string): ?Icon { - return flags[`${countryCode.toLowerCase()}Flag`]; -} diff --git a/src/reactNative.js b/src/reactNative.js index 80f6452bf0..b4789c2c02 100644 --- a/src/reactNative.js +++ b/src/reactNative.js @@ -1,6 +1,5 @@ // @flow import * as icons from "./data/icons/reactNative"; -import * as flags from "./data/flags/reactNative"; import type { CryptoCurrency, TokenCurrency } from "./types"; type Icon = React$ComponentType<{ size: number, color: string }>; @@ -19,7 +18,3 @@ export function getCryptoCurrencyIcon(currency: CryptoCurrency): ?Icon { export function getTokenCurrencyIcon(token: TokenCurrency): ?Icon { return icons[getIconId(token)]; } - -export function getFlag(countryCode: string): ?Icon { - return flags[`${countryCode.toLowerCase()}Flag`]; -} diff --git a/src/types/operation.js b/src/types/operation.js index a2a2fe3ec7..19770d26d6 100644 --- a/src/types/operation.js +++ b/src/types/operation.js @@ -24,7 +24,6 @@ export type OperationType = | "BOND" | "UNBOND" | "WITHDRAW_UNBONDED" - | "SET_CONTROLLER" | "SLASH" | "NOMINATE" | "CHILL" diff --git a/src/walletconnect/walletconnect.test.js b/src/walletconnect/walletconnect.test.js index 0e1d8e7f65..fd7ea91256 100644 --- a/src/walletconnect/walletconnect.test.js +++ b/src/walletconnect/walletconnect.test.js @@ -9,9 +9,6 @@ import { getCryptoCurrencyById, setSupportedCurrencies } from "../currencies"; import type { Account } from "../types/account"; import { emptyHistoryCache } from "../account"; import { setEnv } from "../env"; -import { setPlatformVersion } from "../platform/version"; - -setPlatformVersion("0.0.1"); describe("walletconnect", () => { const account: Account = { diff --git a/yarn.lock b/yarn.lock index bf9a7db729..b0d5daef97 100644 --- a/yarn.lock +++ b/yarn.lock @@ -936,10 +936,10 @@ core-js-pure "^3.0.0" regenerator-runtime "^0.13.4" -"@babel/runtime@^7.10.2", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.1", "@babel/runtime@^7.12.5", "@babel/runtime@^7.14.6", "@babel/runtime@^7.8.4", "@babel/runtime@^7.9.2": - version "7.14.6" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.14.6.tgz#535203bc0892efc7dec60bdc27b2ecf6e409062d" - integrity sha512-/PCB2uJ7oM44tz8YhC4Z/6PeOKXp4K588f+5M3clr1M4zbqztlo0XEfJ2LEzj/FgwfgGcIdl8n7YYjTCI0BYwg== +"@babel/runtime@^7.10.2", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.1", "@babel/runtime@^7.12.5", "@babel/runtime@^7.13.7", "@babel/runtime@^7.13.8", "@babel/runtime@^7.8.4", "@babel/runtime@^7.9.2": + version "7.13.17" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.13.17.tgz#8966d1fc9593bf848602f0662d6b4d0069e3a7ec" + integrity sha512-NCdgJEelPTSh+FEFylhnP1ylq848l1z9t9N0j1Lfbcw0+KXGjsTvUmkxy+voLLXB5SOKMbLLx4jxYliGrYQseA== dependencies: regenerator-runtime "^0.13.4" @@ -987,182 +987,6 @@ exec-sh "^0.3.2" minimist "^1.2.0" -"@confio/ics23@^0.6.3": - version "0.6.5" - resolved "https://registry.yarnpkg.com/@confio/ics23/-/ics23-0.6.5.tgz#9c21a61089d4c3c2429875a69d6d9cd8c87512aa" - integrity sha512-1GdPMsaP/l8JSF4P4HWFLBhdcxHcJT8lS0nknBYNSZ1XrJOsJKUy6EkOwd9Pa1qJkXzY2gyNv7MdHR+AIwSTAg== - dependencies: - js-sha512 "^0.8.0" - protobufjs "^6.8.8" - ripemd160 "^2.0.2" - sha.js "^2.4.11" - -"@cosmjs/amino@^0.25.0-alpha.2", "@cosmjs/amino@^0.25.4": - version "0.25.4" - resolved "https://registry.yarnpkg.com/@cosmjs/amino/-/amino-0.25.4.tgz#478da0e5933b50d22e412e17dcf6784eeeb7d937" - integrity sha512-S22PlzC/VoJirv5UpDYe4XIVtOHKHxGLYgpgBkv10P4vpEhD872R0G7dRfiZZ35lMbu0+vvJxn3e/pEOEVGcuA== - dependencies: - "@cosmjs/crypto" "^0.25.4" - "@cosmjs/encoding" "^0.25.4" - "@cosmjs/math" "^0.25.4" - "@cosmjs/utils" "^0.25.4" - -"@cosmjs/crypto@^0.25.0-alpha.2", "@cosmjs/crypto@^0.25.4": - version "0.25.4" - resolved "https://registry.yarnpkg.com/@cosmjs/crypto/-/crypto-0.25.4.tgz#0e526a8939773b43799bd013252642e08e389f75" - integrity sha512-xm7o2xMQIERFjG+hBa/5f+l1CNdXrXzGqhICo3VJuKsuFRtOtEw3w0dbV+3DOp2oxaUQvLBkLqdYXNBL+lmHlQ== - dependencies: - "@cosmjs/encoding" "^0.25.4" - "@cosmjs/math" "^0.25.4" - "@cosmjs/utils" "^0.25.4" - bip39 "^3.0.2" - bn.js "^4.11.8" - elliptic "^6.5.3" - js-sha3 "^0.8.0" - libsodium-wrappers "^0.7.6" - ripemd160 "^2.0.2" - sha.js "^2.4.11" - -"@cosmjs/encoding@0.23.1": - version "0.23.1" - resolved "https://registry.yarnpkg.com/@cosmjs/encoding/-/encoding-0.23.1.tgz#b51cd2813499cfdeeb0f9cc7d050a45eb8b27bf4" - integrity sha512-rP5O3vYo0k6W329J+u5uKqJNrhmR4QTngLgsDvP/qsRRBfEiirhk+TQC8gjUlgnzoiCKCtWsiOyFP1z9Me9HIw== - dependencies: - base64-js "^1.3.0" - bech32 "^1.1.4" - readonly-date "^1.0.0" - -"@cosmjs/encoding@^0.25.0-alpha.2", "@cosmjs/encoding@^0.25.4": - version "0.25.4" - resolved "https://registry.yarnpkg.com/@cosmjs/encoding/-/encoding-0.25.4.tgz#7589f350410e91728f8377fef782117382873da6" - integrity sha512-wYwYYbCGwDyhaROX6EyZBaiMqpTME8oo7KaRChS6O/6w5hZcfWAyo0NVaHCv8atxt/h0lYroazEXxOVKY+uo6A== - dependencies: - base64-js "^1.3.0" - bech32 "^1.1.4" - readonly-date "^1.0.0" - -"@cosmjs/json-rpc@^0.25.0-alpha.2", "@cosmjs/json-rpc@^0.25.4": - version "0.25.4" - resolved "https://registry.yarnpkg.com/@cosmjs/json-rpc/-/json-rpc-0.25.4.tgz#4109ebe5f6ab21561767c25e13ad7734dee94526" - integrity sha512-X3BzvzUpThD2o9+Ak2+icAqm8AAdWhCGB6Hl229DvKG1NUnXEKdwSxlI/VNw0IKT7ljy47Jv56syQiK5nFdXRQ== - dependencies: - "@cosmjs/stream" "^0.25.4" - xstream "^11.14.0" - -"@cosmjs/math@0.23.1": - version "0.23.1" - resolved "https://registry.yarnpkg.com/@cosmjs/math/-/math-0.23.1.tgz#706f38742a9a1f6561cf2c4510f8e5ab001fc5e6" - integrity sha512-xjGGogFZXLdmRumE1Wr+GlPfKznIl5Qa6K6QyZr4IjBhfB6/ZzLUihliDJp2d8zbjBJgQt9RUwP/PaFQ/yGQNg== - dependencies: - bn.js "^4.11.8" - -"@cosmjs/math@^0.25.0-alpha.2", "@cosmjs/math@^0.25.4": - version "0.25.4" - resolved "https://registry.yarnpkg.com/@cosmjs/math/-/math-0.25.4.tgz#1a70b26c18f990654dfd195a1a2b544b48269572" - integrity sha512-mnf5TgDObjx1yt1Vxkr3k/vncTL4FPRu3eSHjYM+EyQeNmy/Dld0fHFWxELeGqlQ09kVuqFY1jkKG2R96YRHww== - dependencies: - bn.js "^4.11.8" - -"@cosmjs/proto-signing@^0.25.0-alpha.2": - version "0.25.4" - resolved "https://registry.yarnpkg.com/@cosmjs/proto-signing/-/proto-signing-0.25.4.tgz#82a2bdfc105f66c8d9cdf2cfbb86e6da960ab49a" - integrity sha512-W9qJTH0LkOY/WsCe/V2hv6px7gZZxwh8TpLEKSSh4XOUjtqKHcr2jhbdXfi1CQm5lgbvEsovdzVv8VgbtgJxDQ== - dependencies: - "@cosmjs/amino" "^0.25.4" - long "^4.0.0" - protobufjs "~6.10.2" - -"@cosmjs/socket@^0.25.0-alpha.2", "@cosmjs/socket@^0.25.4": - version "0.25.4" - resolved "https://registry.yarnpkg.com/@cosmjs/socket/-/socket-0.25.4.tgz#f32bc7bb347ac26ee1be0c0a57614712bbb6c28c" - integrity sha512-hcL+2kISZ1qqgviNB8OFSzMyYGdiKsBp+j582WYJa+5h9rpZrNWJSm2BFe8hah5AvfYsVCZX1kn7jRu8dZpUnA== - dependencies: - "@cosmjs/stream" "^0.25.4" - isomorphic-ws "^4.0.1" - ws "^7" - xstream "^11.14.0" - -"@cosmjs/stargate@0.25.0-alpha.2": - version "0.25.0-alpha.2" - resolved "https://registry.yarnpkg.com/@cosmjs/stargate/-/stargate-0.25.0-alpha.2.tgz#db6fa0002e96f62875e5b72378e24bd19ef9478f" - integrity sha512-r6VT720EuF6yPwS1WGPPUAPUOfD5aVIRlVJNJHkePWGg4l+ztJtoUbr7QN1CoPrxvG3b+WflNug1EQ7dG44UsA== - dependencies: - "@confio/ics23" "^0.6.3" - "@cosmjs/amino" "^0.25.0-alpha.2" - "@cosmjs/encoding" "^0.25.0-alpha.2" - "@cosmjs/math" "^0.25.0-alpha.2" - "@cosmjs/proto-signing" "^0.25.0-alpha.2" - "@cosmjs/stream" "^0.25.0-alpha.2" - "@cosmjs/tendermint-rpc" "^0.25.0-alpha.2" - "@cosmjs/utils" "^0.25.0-alpha.2" - long "^4.0.0" - protobufjs "~6.10.2" - -"@cosmjs/stream@^0.25.0-alpha.2", "@cosmjs/stream@^0.25.4": - version "0.25.4" - resolved "https://registry.yarnpkg.com/@cosmjs/stream/-/stream-0.25.4.tgz#9b978ee27355d6d4268ebed7be6d6d701e6ccd50" - integrity sha512-Z/if46lnNyiGojzQgSi4ztaqDCJ4gljlmGw6hX/7MrPn5dtmaSqWjLep5CMh7moiR9ZaAeqRPTdUsb99CjiKMQ== - dependencies: - xstream "^11.14.0" - -"@cosmjs/tendermint-rpc@0.25.0-alpha.2": - version "0.25.0-alpha.2" - resolved "https://registry.yarnpkg.com/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.25.0-alpha.2.tgz#15e31d8a9385085740ec71ea0029b9ebb9dd757e" - integrity sha512-1xK8mPwFWiWnyGafZhAdwYfcYmXl1l7UxQRR3yI2Q3kDk7CQhT87mgeAd56jw9JOaZvLYKKTgCRZkLNiKjXNew== - dependencies: - "@cosmjs/crypto" "^0.25.0-alpha.2" - "@cosmjs/encoding" "^0.25.0-alpha.2" - "@cosmjs/json-rpc" "^0.25.0-alpha.2" - "@cosmjs/math" "^0.25.0-alpha.2" - "@cosmjs/socket" "^0.25.0-alpha.2" - "@cosmjs/stream" "^0.25.0-alpha.2" - axios "^0.21.1" - readonly-date "^1.0.0" - xstream "^11.14.0" - -"@cosmjs/tendermint-rpc@^0.25.0-alpha.2": - version "0.25.4" - resolved "https://registry.yarnpkg.com/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.25.4.tgz#8fcf8850ecbc4851a2763303bda8962779ee6d2b" - integrity sha512-F8qiSTtDcS7ZkfvX4RfodpoMG7C7kwLJ8P7umSeWe0wkLaO6NYoKcqxBGjc6E7XVy+XtJDyfF3gqNDJz5/Jtpg== - dependencies: - "@cosmjs/crypto" "^0.25.4" - "@cosmjs/encoding" "^0.25.4" - "@cosmjs/json-rpc" "^0.25.4" - "@cosmjs/math" "^0.25.4" - "@cosmjs/socket" "^0.25.4" - "@cosmjs/stream" "^0.25.4" - axios "^0.21.1" - readonly-date "^1.0.0" - xstream "^11.14.0" - -"@cosmjs/utils@^0.25.0-alpha.2", "@cosmjs/utils@^0.25.4": - version "0.25.4" - resolved "https://registry.yarnpkg.com/@cosmjs/utils/-/utils-0.25.4.tgz#6e617543476e9e1f72bfcb6e263b273e01e4ba93" - integrity sha512-SRkE+Nc0hwuWdsUCQCF3HNWcxhm8UtTg2fIo8CJpecusYfKSGKzkeL1O/Ja/+xDpuTAXW2s2mfVyaAW5b5pHVQ== - -"@crypto-com/chain-jslib@^0.0.16": - version "0.0.16" - resolved "https://registry.yarnpkg.com/@crypto-com/chain-jslib/-/chain-jslib-0.0.16.tgz#d09563d62200db7ad3955438abf2a5722ebc4e4c" - integrity sha512-iLq4XC0Jq7BZJXZ4xL3bmmjEUMH8VlPirUCM5Unyc2S1QL1A9NzWngoJS6ua7MgL7WPQOjqJrKpZAmt6quI1ow== - dependencies: - "@cosmjs/encoding" "0.23.1" - "@cosmjs/math" "0.23.1" - "@cosmjs/stargate" "0.25.0-alpha.2" - "@cosmjs/tendermint-rpc" "0.25.0-alpha.2" - axios "0.21.1" - bech32 "1.1.4" - big.js "6.0.0" - bip32 "2.0.6" - bip39 "3.0.2" - buffer "5.6.1" - create-hash "1.2.0" - lodash "4.17.21" - long "4.0.0" - ow "0.17.0" - protobufjs "6.10.1" - randombytes "2.1.0" - secp256k1 "4.0.2" - "@dabh/diagnostics@^2.0.2": version "2.0.2" resolved "https://registry.yarnpkg.com/@dabh/diagnostics/-/diagnostics-2.0.2.tgz#290d08f7b381b8f94607dc8f471a12c675f9db31" @@ -1187,344 +1011,343 @@ minimatch "^3.0.4" strip-json-comments "^3.1.1" -"@ethersproject/abi@5.4.0", "@ethersproject/abi@^5.4.0": - version "5.4.0" - resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.4.0.tgz#a6d63bdb3672f738398846d4279fa6b6c9818242" - integrity sha512-9gU2H+/yK1j2eVMdzm6xvHSnMxk8waIHQGYCZg5uvAyH0rsAzxkModzBSpbAkAuhKFEovC2S9hM4nPuLym8IZw== - dependencies: - "@ethersproject/address" "^5.4.0" - "@ethersproject/bignumber" "^5.4.0" - "@ethersproject/bytes" "^5.4.0" - "@ethersproject/constants" "^5.4.0" - "@ethersproject/hash" "^5.4.0" - "@ethersproject/keccak256" "^5.4.0" - "@ethersproject/logger" "^5.4.0" - "@ethersproject/properties" "^5.4.0" - "@ethersproject/strings" "^5.4.0" - -"@ethersproject/abstract-provider@5.4.0", "@ethersproject/abstract-provider@^5.4.0": - version "5.4.0" - resolved "https://registry.yarnpkg.com/@ethersproject/abstract-provider/-/abstract-provider-5.4.0.tgz#415331031b0f678388971e1987305244edc04e1d" - integrity sha512-vPBR7HKUBY0lpdllIn7tLIzNN7DrVnhCLKSzY0l8WAwxz686m/aL7ASDzrVxV93GJtIub6N2t4dfZ29CkPOxgA== - dependencies: - "@ethersproject/bignumber" "^5.4.0" - "@ethersproject/bytes" "^5.4.0" - "@ethersproject/logger" "^5.4.0" - "@ethersproject/networks" "^5.4.0" - "@ethersproject/properties" "^5.4.0" - "@ethersproject/transactions" "^5.4.0" - "@ethersproject/web" "^5.4.0" - -"@ethersproject/abstract-signer@5.4.0", "@ethersproject/abstract-signer@^5.4.0": - version "5.4.0" - resolved "https://registry.yarnpkg.com/@ethersproject/abstract-signer/-/abstract-signer-5.4.0.tgz#cd5f50b93141ee9f9f49feb4075a0b3eafb57d65" - integrity sha512-AieQAzt05HJZS2bMofpuxMEp81AHufA5D6M4ScKwtolj041nrfIbIi8ciNW7+F59VYxXq+V4c3d568Q6l2m8ew== +"@ethersproject/abi@5.2.0", "@ethersproject/abi@^5.2.0": + version "5.2.0" + resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.2.0.tgz#e2ca0b7f7e3b83e4d427ed8b38fdc1c48e2bb00f" + integrity sha512-24ExfHa0VbIOUHbB36b6lCVmWkaIVmrd9/m8MICtmSsRKzlugWqUD0B8g0zrRylXNxAOc3V6T4xKJ8jEDSvp3w== + dependencies: + "@ethersproject/address" "^5.2.0" + "@ethersproject/bignumber" "^5.2.0" + "@ethersproject/bytes" "^5.2.0" + "@ethersproject/constants" "^5.2.0" + "@ethersproject/hash" "^5.2.0" + "@ethersproject/keccak256" "^5.2.0" + "@ethersproject/logger" "^5.2.0" + "@ethersproject/properties" "^5.2.0" + "@ethersproject/strings" "^5.2.0" + +"@ethersproject/abstract-provider@5.2.0", "@ethersproject/abstract-provider@^5.2.0": + version "5.2.0" + resolved "https://registry.yarnpkg.com/@ethersproject/abstract-provider/-/abstract-provider-5.2.0.tgz#b5c24b162f119b5d241738ded9555186013aa77d" + integrity sha512-Xi7Pt+CulRijc/vskBGIaYMEhafKjoNx8y4RNj/dnSpXHXScOJUSTtypqGBUngZddRbcwZGbHwEr6DZoKZwIZA== + dependencies: + "@ethersproject/bignumber" "^5.2.0" + "@ethersproject/bytes" "^5.2.0" + "@ethersproject/logger" "^5.2.0" + "@ethersproject/networks" "^5.2.0" + "@ethersproject/properties" "^5.2.0" + "@ethersproject/transactions" "^5.2.0" + "@ethersproject/web" "^5.2.0" + +"@ethersproject/abstract-signer@5.2.0", "@ethersproject/abstract-signer@^5.2.0": + version "5.2.0" + resolved "https://registry.yarnpkg.com/@ethersproject/abstract-signer/-/abstract-signer-5.2.0.tgz#8e291fb6558b4190fb3e2fe440a9ffd092a2f459" + integrity sha512-JTXzLUrtoxpOEq1ecH86U7tstkEa9POKAGbGBb+gicbjGgzYYkLR4/LD83SX2/JNWvtYyY8t5errt5ehiy1gxQ== dependencies: - "@ethersproject/abstract-provider" "^5.4.0" - "@ethersproject/bignumber" "^5.4.0" - "@ethersproject/bytes" "^5.4.0" - "@ethersproject/logger" "^5.4.0" - "@ethersproject/properties" "^5.4.0" + "@ethersproject/abstract-provider" "^5.2.0" + "@ethersproject/bignumber" "^5.2.0" + "@ethersproject/bytes" "^5.2.0" + "@ethersproject/logger" "^5.2.0" + "@ethersproject/properties" "^5.2.0" -"@ethersproject/address@5.4.0", "@ethersproject/address@^5.4.0": - version "5.4.0" - resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.4.0.tgz#ba2d00a0f8c4c0854933b963b9a3a9f6eb4a37a3" - integrity sha512-SD0VgOEkcACEG/C6xavlU1Hy3m5DGSXW3CUHkaaEHbAPPsgi0coP5oNPsxau8eTlZOk/bpa/hKeCNoK5IzVI2Q== +"@ethersproject/address@5.2.0", "@ethersproject/address@^5.2.0": + version "5.2.0" + resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.2.0.tgz#afcfa92db84582f54a60a9da361cea4aae450a69" + integrity sha512-2YfZlalWefOEfnr/CdqKRrgMgbKidYc+zG4/ilxSdcryZSux3eBU5/5btAT/hSiaHipUjd8UrWK8esCBHU6QNQ== dependencies: - "@ethersproject/bignumber" "^5.4.0" - "@ethersproject/bytes" "^5.4.0" - "@ethersproject/keccak256" "^5.4.0" - "@ethersproject/logger" "^5.4.0" - "@ethersproject/rlp" "^5.4.0" + "@ethersproject/bignumber" "^5.2.0" + "@ethersproject/bytes" "^5.2.0" + "@ethersproject/keccak256" "^5.2.0" + "@ethersproject/logger" "^5.2.0" + "@ethersproject/rlp" "^5.2.0" -"@ethersproject/base64@5.4.0", "@ethersproject/base64@^5.4.0": - version "5.4.0" - resolved "https://registry.yarnpkg.com/@ethersproject/base64/-/base64-5.4.0.tgz#7252bf65295954c9048c7ca5f43e5c86441b2a9a" - integrity sha512-CjQw6E17QDSSC5jiM9YpF7N1aSCHmYGMt9bWD8PWv6YPMxjsys2/Q8xLrROKI3IWJ7sFfZ8B3flKDTM5wlWuZQ== +"@ethersproject/base64@5.2.0", "@ethersproject/base64@^5.2.0": + version "5.2.0" + resolved "https://registry.yarnpkg.com/@ethersproject/base64/-/base64-5.2.0.tgz#e01066d25e5b4e8a051545163bee5def47bd9534" + integrity sha512-D9wOvRE90QBI+yFsKMv0hnANiMzf40Xicq9JZbV9XYzh7srImmwmMcReU2wHjOs9FtEgSJo51Tt+sI1dKPYKDg== dependencies: - "@ethersproject/bytes" "^5.4.0" + "@ethersproject/bytes" "^5.2.0" -"@ethersproject/basex@5.4.0", "@ethersproject/basex@^5.4.0": - version "5.4.0" - resolved "https://registry.yarnpkg.com/@ethersproject/basex/-/basex-5.4.0.tgz#0a2da0f4e76c504a94f2b21d3161ed9438c7f8a6" - integrity sha512-J07+QCVJ7np2bcpxydFVf/CuYo9mZ7T73Pe7KQY4c1lRlrixMeblauMxHXD0MPwFmUHZIILDNViVkykFBZylbg== +"@ethersproject/basex@5.2.0", "@ethersproject/basex@^5.2.0": + version "5.2.0" + resolved "https://registry.yarnpkg.com/@ethersproject/basex/-/basex-5.2.0.tgz#f921039e3bdfdab8c5a7ba8b21e81c83fc1ab98b" + integrity sha512-Oo7oX7BmaHLY/8ZsOLI5W0mrSwPBb1iboosN17jfK/4vGAtKjAInDai9I72CzN4NRJaMN5FkFLoPYywGqgGHlg== dependencies: - "@ethersproject/bytes" "^5.4.0" - "@ethersproject/properties" "^5.4.0" + "@ethersproject/bytes" "^5.2.0" + "@ethersproject/properties" "^5.2.0" -"@ethersproject/bignumber@5.4.0", "@ethersproject/bignumber@^5.4.0": - version "5.4.0" - resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.4.0.tgz#be8dea298c0ec71208ee60f0b245be0761217ad9" - integrity sha512-OXUu9f9hO3vGRIPxU40cignXZVaYyfx6j9NNMjebKdnaCL3anCLSSy8/b8d03vY6dh7duCC0kW72GEC4tZer2w== +"@ethersproject/bignumber@5.2.0", "@ethersproject/bignumber@^5.2.0": + version "5.2.0" + resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.2.0.tgz#03f91ea740c5adb6f8c6a2e91bb4ee5ffaff5503" + integrity sha512-+MNQTxwV7GEiA4NH/i51UqQ+lY36O0rxPdV+0qzjFSySiyBlJpLk6aaa4UTvKmYWlI7YKZm6vuyCENeYn7qAOw== dependencies: - "@ethersproject/bytes" "^5.4.0" - "@ethersproject/logger" "^5.4.0" - bn.js "^4.11.9" + "@ethersproject/bytes" "^5.2.0" + "@ethersproject/logger" "^5.2.0" + bn.js "^4.4.0" -"@ethersproject/bytes@5.4.0", "@ethersproject/bytes@^5.4.0": - version "5.4.0" - resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.4.0.tgz#56fa32ce3bf67153756dbaefda921d1d4774404e" - integrity sha512-H60ceqgTHbhzOj4uRc/83SCN9d+BSUnOkrr2intevqdtEMO1JFVZ1XL84OEZV+QjV36OaZYxtnt4lGmxcGsPfA== +"@ethersproject/bytes@5.2.0", "@ethersproject/bytes@^5.2.0": + version "5.2.0" + resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.2.0.tgz#327917d5a1600f92fd2a9da4052fa6d974583132" + integrity sha512-O1CRpvJDnRTB47vvW8vyqojUZxVookb4LJv/s06TotriU3Xje5WFvlvXJu1yTchtxTz9BbvJw0lFXKpyO6Dn7w== dependencies: - "@ethersproject/logger" "^5.4.0" + "@ethersproject/logger" "^5.2.0" -"@ethersproject/constants@5.4.0", "@ethersproject/constants@^5.4.0": - version "5.4.0" - resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.4.0.tgz#ee0bdcb30bf1b532d2353c977bf2ef1ee117958a" - integrity sha512-tzjn6S7sj9+DIIeKTJLjK9WGN2Tj0P++Z8ONEIlZjyoTkBuODN+0VfhAyYksKi43l1Sx9tX2VlFfzjfmr5Wl3Q== +"@ethersproject/constants@5.2.0", "@ethersproject/constants@^5.2.0": + version "5.2.0" + resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.2.0.tgz#ccea78ce325f78abfe7358397c03eec570518d92" + integrity sha512-p+34YG0KbHS20NGdE+Ic0M6egzd7cDvcfoO9RpaAgyAYm3V5gJVqL7UynS87yCt6O6Nlx6wRFboPiM5ctAr+jA== dependencies: - "@ethersproject/bignumber" "^5.4.0" + "@ethersproject/bignumber" "^5.2.0" -"@ethersproject/contracts@5.4.0": - version "5.4.0" - resolved "https://registry.yarnpkg.com/@ethersproject/contracts/-/contracts-5.4.0.tgz#e05fe6bd33acc98741e27d553889ec5920078abb" - integrity sha512-hkO3L3IhS1Z3ZtHtaAG/T87nQ7KiPV+/qnvutag35I0IkiQ8G3ZpCQ9NNOpSCzn4pWSW4CfzmtE02FcqnLI+hw== - dependencies: - "@ethersproject/abi" "^5.4.0" - "@ethersproject/abstract-provider" "^5.4.0" - "@ethersproject/abstract-signer" "^5.4.0" - "@ethersproject/address" "^5.4.0" - "@ethersproject/bignumber" "^5.4.0" - "@ethersproject/bytes" "^5.4.0" - "@ethersproject/constants" "^5.4.0" - "@ethersproject/logger" "^5.4.0" - "@ethersproject/properties" "^5.4.0" - "@ethersproject/transactions" "^5.4.0" - -"@ethersproject/hash@5.4.0", "@ethersproject/hash@^5.4.0": - version "5.4.0" - resolved "https://registry.yarnpkg.com/@ethersproject/hash/-/hash-5.4.0.tgz#d18a8e927e828e22860a011f39e429d388344ae0" - integrity sha512-xymAM9tmikKgbktOCjW60Z5sdouiIIurkZUr9oW5NOex5uwxrbsYG09kb5bMcNjlVeJD3yPivTNzViIs1GCbqA== - dependencies: - "@ethersproject/abstract-signer" "^5.4.0" - "@ethersproject/address" "^5.4.0" - "@ethersproject/bignumber" "^5.4.0" - "@ethersproject/bytes" "^5.4.0" - "@ethersproject/keccak256" "^5.4.0" - "@ethersproject/logger" "^5.4.0" - "@ethersproject/properties" "^5.4.0" - "@ethersproject/strings" "^5.4.0" - -"@ethersproject/hdnode@5.4.0", "@ethersproject/hdnode@^5.4.0": - version "5.4.0" - resolved "https://registry.yarnpkg.com/@ethersproject/hdnode/-/hdnode-5.4.0.tgz#4bc9999b9a12eb5ce80c5faa83114a57e4107cac" - integrity sha512-pKxdS0KAaeVGfZPp1KOiDLB0jba11tG6OP1u11QnYfb7pXn6IZx0xceqWRr6ygke8+Kw74IpOoSi7/DwANhy8Q== - dependencies: - "@ethersproject/abstract-signer" "^5.4.0" - "@ethersproject/basex" "^5.4.0" - "@ethersproject/bignumber" "^5.4.0" - "@ethersproject/bytes" "^5.4.0" - "@ethersproject/logger" "^5.4.0" - "@ethersproject/pbkdf2" "^5.4.0" - "@ethersproject/properties" "^5.4.0" - "@ethersproject/sha2" "^5.4.0" - "@ethersproject/signing-key" "^5.4.0" - "@ethersproject/strings" "^5.4.0" - "@ethersproject/transactions" "^5.4.0" - "@ethersproject/wordlists" "^5.4.0" - -"@ethersproject/json-wallets@5.4.0", "@ethersproject/json-wallets@^5.4.0": - version "5.4.0" - resolved "https://registry.yarnpkg.com/@ethersproject/json-wallets/-/json-wallets-5.4.0.tgz#2583341cfe313fc9856642e8ace3080154145e95" - integrity sha512-igWcu3fx4aiczrzEHwG1xJZo9l1cFfQOWzTqwRw/xcvxTk58q4f9M7cjh51EKphMHvrJtcezJ1gf1q1AUOfEQQ== - dependencies: - "@ethersproject/abstract-signer" "^5.4.0" - "@ethersproject/address" "^5.4.0" - "@ethersproject/bytes" "^5.4.0" - "@ethersproject/hdnode" "^5.4.0" - "@ethersproject/keccak256" "^5.4.0" - "@ethersproject/logger" "^5.4.0" - "@ethersproject/pbkdf2" "^5.4.0" - "@ethersproject/properties" "^5.4.0" - "@ethersproject/random" "^5.4.0" - "@ethersproject/strings" "^5.4.0" - "@ethersproject/transactions" "^5.4.0" +"@ethersproject/contracts@5.2.0": + version "5.2.0" + resolved "https://registry.yarnpkg.com/@ethersproject/contracts/-/contracts-5.2.0.tgz#f54e12ec4a323f2bf93c338034839cc6dfc1e347" + integrity sha512-/2fg5tWPG6Z4pciEWpwGji3ggGA5j0ChVNF7NTmkOhvFrrJuWnRpzbvYA00nz8tBDNCOV3cwub5zfWRpgwYEJQ== + dependencies: + "@ethersproject/abi" "^5.2.0" + "@ethersproject/abstract-provider" "^5.2.0" + "@ethersproject/abstract-signer" "^5.2.0" + "@ethersproject/address" "^5.2.0" + "@ethersproject/bignumber" "^5.2.0" + "@ethersproject/bytes" "^5.2.0" + "@ethersproject/constants" "^5.2.0" + "@ethersproject/logger" "^5.2.0" + "@ethersproject/properties" "^5.2.0" + "@ethersproject/transactions" "^5.2.0" + +"@ethersproject/hash@5.2.0", "@ethersproject/hash@^5.2.0": + version "5.2.0" + resolved "https://registry.yarnpkg.com/@ethersproject/hash/-/hash-5.2.0.tgz#2d21901eafc5bdb738b4ad96bee364d371ec724b" + integrity sha512-wEGry2HFFSssFiNEkFWMzj1vpdFv4rQlkBp41UfL6J58zKGNycoAWimokITDMk8p7548MKr27h48QfERnNKkRw== + dependencies: + "@ethersproject/abstract-signer" "^5.2.0" + "@ethersproject/address" "^5.2.0" + "@ethersproject/bignumber" "^5.2.0" + "@ethersproject/bytes" "^5.2.0" + "@ethersproject/keccak256" "^5.2.0" + "@ethersproject/logger" "^5.2.0" + "@ethersproject/properties" "^5.2.0" + "@ethersproject/strings" "^5.2.0" + +"@ethersproject/hdnode@5.2.0", "@ethersproject/hdnode@^5.2.0": + version "5.2.0" + resolved "https://registry.yarnpkg.com/@ethersproject/hdnode/-/hdnode-5.2.0.tgz#efea9b2f713e55aa5ba23cc62b4aac6d08dcfa53" + integrity sha512-ffq2JrW5AftCmfWZ8DxpdWdw/x06Yn+e9wrWHLpj8If1+w87W4LbTMRUaUmO1DUSN8H8g/6kMUKCTJPVuxsuOw== + dependencies: + "@ethersproject/abstract-signer" "^5.2.0" + "@ethersproject/basex" "^5.2.0" + "@ethersproject/bignumber" "^5.2.0" + "@ethersproject/bytes" "^5.2.0" + "@ethersproject/logger" "^5.2.0" + "@ethersproject/pbkdf2" "^5.2.0" + "@ethersproject/properties" "^5.2.0" + "@ethersproject/sha2" "^5.2.0" + "@ethersproject/signing-key" "^5.2.0" + "@ethersproject/strings" "^5.2.0" + "@ethersproject/transactions" "^5.2.0" + "@ethersproject/wordlists" "^5.2.0" + +"@ethersproject/json-wallets@5.2.0", "@ethersproject/json-wallets@^5.2.0": + version "5.2.0" + resolved "https://registry.yarnpkg.com/@ethersproject/json-wallets/-/json-wallets-5.2.0.tgz#d41c7c39e4d236b586e26e2145b09ac49dc56608" + integrity sha512-iWxSm9XiugEtaehYD6w1ImmXeatjcGcrQvffZVJHH1UqV4FckDzrOYnZBRHPQRYlnhNVrGTld1+S0Cu4MB8gdw== + dependencies: + "@ethersproject/abstract-signer" "^5.2.0" + "@ethersproject/address" "^5.2.0" + "@ethersproject/bytes" "^5.2.0" + "@ethersproject/hdnode" "^5.2.0" + "@ethersproject/keccak256" "^5.2.0" + "@ethersproject/logger" "^5.2.0" + "@ethersproject/pbkdf2" "^5.2.0" + "@ethersproject/properties" "^5.2.0" + "@ethersproject/random" "^5.2.0" + "@ethersproject/strings" "^5.2.0" + "@ethersproject/transactions" "^5.2.0" aes-js "3.0.0" scrypt-js "3.0.1" -"@ethersproject/keccak256@5.4.0", "@ethersproject/keccak256@^5.4.0": - version "5.4.0" - resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.4.0.tgz#7143b8eea4976080241d2bd92e3b1f1bf7025318" - integrity sha512-FBI1plWet+dPUvAzPAeHzRKiPpETQzqSUWR1wXJGHVWi4i8bOSrpC3NwpkPjgeXG7MnugVc1B42VbfnQikyC/A== +"@ethersproject/keccak256@5.2.0", "@ethersproject/keccak256@^5.2.0": + version "5.2.0" + resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.2.0.tgz#15257862807c23f24a3209d1016d322dca85a464" + integrity sha512-LqyxTwVANga5Y3L1yo184czW6b3PibabN8xyE/eOulQLLfXNrHHhwrOTpOhoVRWCICVCD/5SjQfwqTrczjS7jQ== dependencies: - "@ethersproject/bytes" "^5.4.0" + "@ethersproject/bytes" "^5.2.0" js-sha3 "0.5.7" -"@ethersproject/logger@5.4.0", "@ethersproject/logger@^5.4.0": - version "5.4.0" - resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.4.0.tgz#f39adadf62ad610c420bcd156fd41270e91b3ca9" - integrity sha512-xYdWGGQ9P2cxBayt64d8LC8aPFJk6yWCawQi/4eJ4+oJdMMjEBMrIcIMZ9AxhwpPVmnBPrsB10PcXGmGAqgUEQ== +"@ethersproject/logger@5.2.0", "@ethersproject/logger@^5.2.0": + version "5.2.0" + resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.2.0.tgz#accf5348251f78b6c8891af67f42490a4ea4e5ae" + integrity sha512-dPZ6/E3YiArgG8dI/spGkaRDry7YZpCntf4gm/c6SI8Mbqiihd7q3nuLN5VvDap/0K3xm3RE1AIUOcUwwh2ezQ== -"@ethersproject/networks@5.4.1", "@ethersproject/networks@^5.4.0": - version "5.4.1" - resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.4.1.tgz#2ce83b8e42aa85216e5d277a7952d97b6ce8d852" - integrity sha512-8SvowCKz9Uf4xC5DTKI8+il8lWqOr78kmiqAVLYT9lzB8aSmJHQMD1GSuJI0CW4hMAnzocpGpZLgiMdzsNSPig== +"@ethersproject/networks@5.2.0", "@ethersproject/networks@^5.2.0": + version "5.2.0" + resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.2.0.tgz#66c23c6ac477dd703645b2c971ac842d8b8aa524" + integrity sha512-q+htMgq7wQoEnjlkdHM6t1sktKxNbEB/F6DQBPNwru7KpQ1R0n0UTIXJB8Rb7lSnvjqcAQ40X3iVqm94NJfYDw== dependencies: - "@ethersproject/logger" "^5.4.0" + "@ethersproject/logger" "^5.2.0" -"@ethersproject/pbkdf2@5.4.0", "@ethersproject/pbkdf2@^5.4.0": - version "5.4.0" - resolved "https://registry.yarnpkg.com/@ethersproject/pbkdf2/-/pbkdf2-5.4.0.tgz#ed88782a67fda1594c22d60d0ca911a9d669641c" - integrity sha512-x94aIv6tiA04g6BnazZSLoRXqyusawRyZWlUhKip2jvoLpzJuLb//KtMM6PEovE47pMbW+Qe1uw+68ameJjB7g== +"@ethersproject/pbkdf2@5.2.0", "@ethersproject/pbkdf2@^5.2.0": + version "5.2.0" + resolved "https://registry.yarnpkg.com/@ethersproject/pbkdf2/-/pbkdf2-5.2.0.tgz#8166a7a7238a5fd1d9bb6eb2000fea0f19fdde06" + integrity sha512-qKOoO6yir/qnAgg6OP3U4gRuZ6jl9P7xwggRu/spVfnuaR+wa490AatWLqB1WOXKf6JFjm5yOaT/T5fCICQVdQ== dependencies: - "@ethersproject/bytes" "^5.4.0" - "@ethersproject/sha2" "^5.4.0" + "@ethersproject/bytes" "^5.2.0" + "@ethersproject/sha2" "^5.2.0" -"@ethersproject/properties@5.4.0", "@ethersproject/properties@^5.4.0": - version "5.4.0" - resolved "https://registry.yarnpkg.com/@ethersproject/properties/-/properties-5.4.0.tgz#38ba20539b44dcc5d5f80c45ad902017dcdbefe7" - integrity sha512-7jczalGVRAJ+XSRvNA6D5sAwT4gavLq3OXPuV/74o3Rd2wuzSL035IMpIMgei4CYyBdialJMrTqkOnzccLHn4A== - dependencies: - "@ethersproject/logger" "^5.4.0" - -"@ethersproject/providers@5.4.1": - version "5.4.1" - resolved "https://registry.yarnpkg.com/@ethersproject/providers/-/providers-5.4.1.tgz#654267b563b833046b9c9647647cfc8267cb93b4" - integrity sha512-p06eiFKz8nu/5Ju0kIX024gzEQIgE5pvvGrBCngpyVjpuLtUIWT3097Agw4mTn9/dEA0FMcfByzFqacBMSgCVg== - dependencies: - "@ethersproject/abstract-provider" "^5.4.0" - "@ethersproject/abstract-signer" "^5.4.0" - "@ethersproject/address" "^5.4.0" - "@ethersproject/basex" "^5.4.0" - "@ethersproject/bignumber" "^5.4.0" - "@ethersproject/bytes" "^5.4.0" - "@ethersproject/constants" "^5.4.0" - "@ethersproject/hash" "^5.4.0" - "@ethersproject/logger" "^5.4.0" - "@ethersproject/networks" "^5.4.0" - "@ethersproject/properties" "^5.4.0" - "@ethersproject/random" "^5.4.0" - "@ethersproject/rlp" "^5.4.0" - "@ethersproject/sha2" "^5.4.0" - "@ethersproject/strings" "^5.4.0" - "@ethersproject/transactions" "^5.4.0" - "@ethersproject/web" "^5.4.0" +"@ethersproject/properties@5.2.0", "@ethersproject/properties@^5.2.0": + version "5.2.0" + resolved "https://registry.yarnpkg.com/@ethersproject/properties/-/properties-5.2.0.tgz#8fadf367f7ac7357019d0224aa579b234c545ac1" + integrity sha512-oNFkzcoGwXXV+/Yp/MLcDLrL/2i360XIy2YN9yRZJPnIbLwjroFNLiRzLs6PyPw1D09Xs8OcPR1/nHv6xDKE2A== + dependencies: + "@ethersproject/logger" "^5.2.0" + +"@ethersproject/providers@5.2.0": + version "5.2.0" + resolved "https://registry.yarnpkg.com/@ethersproject/providers/-/providers-5.2.0.tgz#b2f3e3b2ca4567c8372543ceb6f3c6e3a2370783" + integrity sha512-Yf/ZUqCrVr+jR0SHA9GuNZs4R1xnV9Ibnh1TlOa0ZzI6o+Qf8bEyE550k9bYI4zk2f9x9baX2RRs6BJY7Jz/WA== + dependencies: + "@ethersproject/abstract-provider" "^5.2.0" + "@ethersproject/abstract-signer" "^5.2.0" + "@ethersproject/address" "^5.2.0" + "@ethersproject/basex" "^5.2.0" + "@ethersproject/bignumber" "^5.2.0" + "@ethersproject/bytes" "^5.2.0" + "@ethersproject/constants" "^5.2.0" + "@ethersproject/hash" "^5.2.0" + "@ethersproject/logger" "^5.2.0" + "@ethersproject/networks" "^5.2.0" + "@ethersproject/properties" "^5.2.0" + "@ethersproject/random" "^5.2.0" + "@ethersproject/rlp" "^5.2.0" + "@ethersproject/sha2" "^5.2.0" + "@ethersproject/strings" "^5.2.0" + "@ethersproject/transactions" "^5.2.0" + "@ethersproject/web" "^5.2.0" bech32 "1.1.4" - ws "7.4.6" + ws "7.2.3" -"@ethersproject/random@5.4.0", "@ethersproject/random@^5.4.0": - version "5.4.0" - resolved "https://registry.yarnpkg.com/@ethersproject/random/-/random-5.4.0.tgz#9cdde60e160d024be39cc16f8de3b9ce39191e16" - integrity sha512-pnpWNQlf0VAZDEOVp1rsYQosmv2o0ITS/PecNw+mS2/btF8eYdspkN0vIXrCMtkX09EAh9bdk8GoXmFXM1eAKw== +"@ethersproject/random@5.2.0", "@ethersproject/random@^5.2.0": + version "5.2.0" + resolved "https://registry.yarnpkg.com/@ethersproject/random/-/random-5.2.0.tgz#1d7e19f17d88eda56228a263063826829e49eebe" + integrity sha512-7Nd3qjivBGlDCGDuGYjPi8CXdtVhRZ7NeyBXoJgtnJBwn1S01ahrbMeOUVmRVWrFM0YiSEPEGo7i4xEu2gRPcg== dependencies: - "@ethersproject/bytes" "^5.4.0" - "@ethersproject/logger" "^5.4.0" + "@ethersproject/bytes" "^5.2.0" + "@ethersproject/logger" "^5.2.0" -"@ethersproject/rlp@5.4.0", "@ethersproject/rlp@^5.4.0": - version "5.4.0" - resolved "https://registry.yarnpkg.com/@ethersproject/rlp/-/rlp-5.4.0.tgz#de61afda5ff979454e76d3b3310a6c32ad060931" - integrity sha512-0I7MZKfi+T5+G8atId9QaQKHRvvasM/kqLyAH4XxBCBchAooH2EX5rL9kYZWwcm3awYV+XC7VF6nLhfeQFKVPg== +"@ethersproject/rlp@5.2.0", "@ethersproject/rlp@^5.2.0": + version "5.2.0" + resolved "https://registry.yarnpkg.com/@ethersproject/rlp/-/rlp-5.2.0.tgz#bbf605183818a9d96bdc40323d734c79e26cfaca" + integrity sha512-RqGsELtPWxcFhOOhSr0lQ2hBNT9tBE08WK0tb6VQbCk97EpqkbgP8yXED9PZlWMiRGchJTw6S+ExzK62XMX/fw== dependencies: - "@ethersproject/bytes" "^5.4.0" - "@ethersproject/logger" "^5.4.0" + "@ethersproject/bytes" "^5.2.0" + "@ethersproject/logger" "^5.2.0" -"@ethersproject/sha2@5.4.0", "@ethersproject/sha2@^5.4.0": - version "5.4.0" - resolved "https://registry.yarnpkg.com/@ethersproject/sha2/-/sha2-5.4.0.tgz#c9a8db1037014cbc4e9482bd662f86c090440371" - integrity sha512-siheo36r1WD7Cy+bDdE1BJ8y0bDtqXCOxRMzPa4bV1TGt/eTUUt03BHoJNB6reWJD8A30E/pdJ8WFkq+/uz4Gg== +"@ethersproject/sha2@5.2.0", "@ethersproject/sha2@^5.2.0": + version "5.2.0" + resolved "https://registry.yarnpkg.com/@ethersproject/sha2/-/sha2-5.2.0.tgz#ae18fa6c09c6d99fa2b564dac7276bcd513c1579" + integrity sha512-Wqqptfn0PRO2mvmpktPW1HOLrrCyGtxhVQxO1ZyePoGrcEOurhICOlIvkTogoX4Q928D3Z9XtSSCUbdOJUF2kg== dependencies: - "@ethersproject/bytes" "^5.4.0" - "@ethersproject/logger" "^5.4.0" - hash.js "1.1.7" + "@ethersproject/bytes" "^5.2.0" + "@ethersproject/logger" "^5.2.0" + hash.js "1.1.3" -"@ethersproject/signing-key@5.4.0", "@ethersproject/signing-key@^5.4.0": - version "5.4.0" - resolved "https://registry.yarnpkg.com/@ethersproject/signing-key/-/signing-key-5.4.0.tgz#2f05120984e81cf89a3d5f6dec5c68ee0894fbec" - integrity sha512-q8POUeywx6AKg2/jX9qBYZIAmKSB4ubGXdQ88l40hmATj29JnG5pp331nAWwwxPn2Qao4JpWHNZsQN+bPiSW9A== +"@ethersproject/signing-key@5.2.0", "@ethersproject/signing-key@^5.2.0": + version "5.2.0" + resolved "https://registry.yarnpkg.com/@ethersproject/signing-key/-/signing-key-5.2.0.tgz#e8eb10d3c0f4a575479db8d70c62aaf93cd384d1" + integrity sha512-9A+dVSkrVAPuhJnWqLWV/NkKi/KB4iagTKEuojfuApUfeIHEhpwQ0Jx3cBimk7qWISSSKdgiAmIqpvVtZ5FEkg== dependencies: - "@ethersproject/bytes" "^5.4.0" - "@ethersproject/logger" "^5.4.0" - "@ethersproject/properties" "^5.4.0" - bn.js "^4.11.9" + "@ethersproject/bytes" "^5.2.0" + "@ethersproject/logger" "^5.2.0" + "@ethersproject/properties" "^5.2.0" + bn.js "^4.4.0" elliptic "6.5.4" - hash.js "1.1.7" -"@ethersproject/solidity@5.4.0": - version "5.4.0" - resolved "https://registry.yarnpkg.com/@ethersproject/solidity/-/solidity-5.4.0.tgz#1305e058ea02dc4891df18b33232b11a14ece9ec" - integrity sha512-XFQTZ7wFSHOhHcV1DpcWj7VXECEiSrBuv7JErJvB9Uo+KfCdc3QtUZV+Vjh/AAaYgezUEKbCtE6Khjm44seevQ== +"@ethersproject/solidity@5.2.0": + version "5.2.0" + resolved "https://registry.yarnpkg.com/@ethersproject/solidity/-/solidity-5.2.0.tgz#ac902d8f8b11bf58fd37ccf77392178cbbd0b08f" + integrity sha512-EEFlNyEnONW3CWF8UGWPcqxJUHiaIoofO7itGwO/2gvGpnwlL+WUV+GmQoHNxmn+QJeOHspnZuh6NOVrJL6H1g== dependencies: - "@ethersproject/bignumber" "^5.4.0" - "@ethersproject/bytes" "^5.4.0" - "@ethersproject/keccak256" "^5.4.0" - "@ethersproject/sha2" "^5.4.0" - "@ethersproject/strings" "^5.4.0" + "@ethersproject/bignumber" "^5.2.0" + "@ethersproject/bytes" "^5.2.0" + "@ethersproject/keccak256" "^5.2.0" + "@ethersproject/sha2" "^5.2.0" + "@ethersproject/strings" "^5.2.0" -"@ethersproject/strings@5.4.0", "@ethersproject/strings@^5.4.0": - version "5.4.0" - resolved "https://registry.yarnpkg.com/@ethersproject/strings/-/strings-5.4.0.tgz#fb12270132dd84b02906a8d895ae7e7fa3d07d9a" - integrity sha512-k/9DkH5UGDhv7aReXLluFG5ExurwtIpUfnDNhQA29w896Dw3i4uDTz01Quaptbks1Uj9kI8wo9tmW73wcIEaWA== +"@ethersproject/strings@5.2.0", "@ethersproject/strings@^5.2.0": + version "5.2.0" + resolved "https://registry.yarnpkg.com/@ethersproject/strings/-/strings-5.2.0.tgz#e93d989859587191c3f64bda124d9dedbc3f5a97" + integrity sha512-RmjX800wRYKgrzo2ZCSlA8OCQYyq4+M46VgjSVDVyYkLZctBXC3epqlppDA24R7eo856KNbXqezZsMnHT+sSuA== dependencies: - "@ethersproject/bytes" "^5.4.0" - "@ethersproject/constants" "^5.4.0" - "@ethersproject/logger" "^5.4.0" + "@ethersproject/bytes" "^5.2.0" + "@ethersproject/constants" "^5.2.0" + "@ethersproject/logger" "^5.2.0" -"@ethersproject/transactions@5.4.0", "@ethersproject/transactions@^5.4.0": - version "5.4.0" - resolved "https://registry.yarnpkg.com/@ethersproject/transactions/-/transactions-5.4.0.tgz#a159d035179334bd92f340ce0f77e83e9e1522e0" - integrity sha512-s3EjZZt7xa4BkLknJZ98QGoIza94rVjaEed0rzZ/jB9WrIuu/1+tjvYCWzVrystXtDswy7TPBeIepyXwSYa4WQ== - dependencies: - "@ethersproject/address" "^5.4.0" - "@ethersproject/bignumber" "^5.4.0" - "@ethersproject/bytes" "^5.4.0" - "@ethersproject/constants" "^5.4.0" - "@ethersproject/keccak256" "^5.4.0" - "@ethersproject/logger" "^5.4.0" - "@ethersproject/properties" "^5.4.0" - "@ethersproject/rlp" "^5.4.0" - "@ethersproject/signing-key" "^5.4.0" - -"@ethersproject/units@5.4.0": - version "5.4.0" - resolved "https://registry.yarnpkg.com/@ethersproject/units/-/units-5.4.0.tgz#d57477a4498b14b88b10396062c8cbbaf20c79fe" - integrity sha512-Z88krX40KCp+JqPCP5oPv5p750g+uU6gopDYRTBGcDvOASh6qhiEYCRatuM/suC4S2XW9Zz90QI35MfSrTIaFg== +"@ethersproject/transactions@5.2.0", "@ethersproject/transactions@^5.2.0": + version "5.2.0" + resolved "https://registry.yarnpkg.com/@ethersproject/transactions/-/transactions-5.2.0.tgz#052e2ef8f8adf7037ebe4cc47aad2a61950e6491" + integrity sha512-QrGbhGYsouNNclUp3tWMbckMsuXJTOsA56kT3BuRrLlXJcUH7myIihajXdSfKcyJsvHJPrGZP+U3TKh+sLzZtg== + dependencies: + "@ethersproject/address" "^5.2.0" + "@ethersproject/bignumber" "^5.2.0" + "@ethersproject/bytes" "^5.2.0" + "@ethersproject/constants" "^5.2.0" + "@ethersproject/keccak256" "^5.2.0" + "@ethersproject/logger" "^5.2.0" + "@ethersproject/properties" "^5.2.0" + "@ethersproject/rlp" "^5.2.0" + "@ethersproject/signing-key" "^5.2.0" + +"@ethersproject/units@5.2.0": + version "5.2.0" + resolved "https://registry.yarnpkg.com/@ethersproject/units/-/units-5.2.0.tgz#08643e5d4583ecc1a32b103c1157f7ae80803392" + integrity sha512-yrwlyomXcBBHp5oSrLxlLkyHN7dVu3PO7hMbQXc00h388zU4TF3o/PAIUhh+x695wgJ19Fa8YgUWCab3a1RDwA== dependencies: - "@ethersproject/bignumber" "^5.4.0" - "@ethersproject/constants" "^5.4.0" - "@ethersproject/logger" "^5.4.0" + "@ethersproject/bignumber" "^5.2.0" + "@ethersproject/constants" "^5.2.0" + "@ethersproject/logger" "^5.2.0" -"@ethersproject/wallet@5.4.0": - version "5.4.0" - resolved "https://registry.yarnpkg.com/@ethersproject/wallet/-/wallet-5.4.0.tgz#fa5b59830b42e9be56eadd45a16a2e0933ad9353" - integrity sha512-wU29majLjM6AjCjpat21mPPviG+EpK7wY1+jzKD0fg3ui5fgedf2zEu1RDgpfIMsfn8fJHJuzM4zXZ2+hSHaSQ== - dependencies: - "@ethersproject/abstract-provider" "^5.4.0" - "@ethersproject/abstract-signer" "^5.4.0" - "@ethersproject/address" "^5.4.0" - "@ethersproject/bignumber" "^5.4.0" - "@ethersproject/bytes" "^5.4.0" - "@ethersproject/hash" "^5.4.0" - "@ethersproject/hdnode" "^5.4.0" - "@ethersproject/json-wallets" "^5.4.0" - "@ethersproject/keccak256" "^5.4.0" - "@ethersproject/logger" "^5.4.0" - "@ethersproject/properties" "^5.4.0" - "@ethersproject/random" "^5.4.0" - "@ethersproject/signing-key" "^5.4.0" - "@ethersproject/transactions" "^5.4.0" - "@ethersproject/wordlists" "^5.4.0" - -"@ethersproject/web@5.4.0", "@ethersproject/web@^5.4.0": - version "5.4.0" - resolved "https://registry.yarnpkg.com/@ethersproject/web/-/web-5.4.0.tgz#49fac173b96992334ed36a175538ba07a7413d1f" - integrity sha512-1bUusGmcoRLYgMn6c1BLk1tOKUIFuTg8j+6N8lYlbMpDesnle+i3pGSagGNvwjaiLo4Y5gBibwctpPRmjrh4Og== +"@ethersproject/wallet@5.2.0": + version "5.2.0" + resolved "https://registry.yarnpkg.com/@ethersproject/wallet/-/wallet-5.2.0.tgz#b5a8406676067e34f633536a4cb53c2ff98c0b5c" + integrity sha512-uPdjZwUmAJLo1+ybR/G/rL9pv/NEcCqOsjn6RJFvG7RmwP2kS1v5C+F+ysgx2W/PxBIVT+2IEsfXLbBz8s/6Rg== + dependencies: + "@ethersproject/abstract-provider" "^5.2.0" + "@ethersproject/abstract-signer" "^5.2.0" + "@ethersproject/address" "^5.2.0" + "@ethersproject/bignumber" "^5.2.0" + "@ethersproject/bytes" "^5.2.0" + "@ethersproject/hash" "^5.2.0" + "@ethersproject/hdnode" "^5.2.0" + "@ethersproject/json-wallets" "^5.2.0" + "@ethersproject/keccak256" "^5.2.0" + "@ethersproject/logger" "^5.2.0" + "@ethersproject/properties" "^5.2.0" + "@ethersproject/random" "^5.2.0" + "@ethersproject/signing-key" "^5.2.0" + "@ethersproject/transactions" "^5.2.0" + "@ethersproject/wordlists" "^5.2.0" + +"@ethersproject/web@5.2.0", "@ethersproject/web@^5.2.0": + version "5.2.0" + resolved "https://registry.yarnpkg.com/@ethersproject/web/-/web-5.2.0.tgz#47d8e152e7fcc07ba0aff4f99fde268fde79dd7a" + integrity sha512-mYb9qxGlOBFR2pR6t1CZczuqqX6r8RQGn7MtwrBciMex3cvA/qs+wbmcDgl+/OZY0Pco/ih6WHQRnVi+4sBeCQ== dependencies: - "@ethersproject/base64" "^5.4.0" - "@ethersproject/bytes" "^5.4.0" - "@ethersproject/logger" "^5.4.0" - "@ethersproject/properties" "^5.4.0" - "@ethersproject/strings" "^5.4.0" + "@ethersproject/base64" "^5.2.0" + "@ethersproject/bytes" "^5.2.0" + "@ethersproject/logger" "^5.2.0" + "@ethersproject/properties" "^5.2.0" + "@ethersproject/strings" "^5.2.0" -"@ethersproject/wordlists@5.4.0", "@ethersproject/wordlists@^5.4.0": - version "5.4.0" - resolved "https://registry.yarnpkg.com/@ethersproject/wordlists/-/wordlists-5.4.0.tgz#f34205ec3bbc9e2c49cadaee774cf0b07e7573d7" - integrity sha512-FemEkf6a+EBKEPxlzeVgUaVSodU7G0Na89jqKjmWMlDB0tomoU8RlEMgUvXyqtrg8N4cwpLh8nyRnm1Nay1isA== +"@ethersproject/wordlists@5.2.0", "@ethersproject/wordlists@^5.2.0": + version "5.2.0" + resolved "https://registry.yarnpkg.com/@ethersproject/wordlists/-/wordlists-5.2.0.tgz#afcce0229e9ef64af1bf8a1e96571fa441e9f444" + integrity sha512-/7TG5r/Zm8Wd9WhoqQ4QnntgMkIfIZ8QVrpU81muiChLD26XLOgmyiqKPL7K058uYt7UZ0wzbXjxyCYadU3xFQ== dependencies: - "@ethersproject/bytes" "^5.4.0" - "@ethersproject/hash" "^5.4.0" - "@ethersproject/logger" "^5.4.0" - "@ethersproject/properties" "^5.4.0" - "@ethersproject/strings" "^5.4.0" + "@ethersproject/bytes" "^5.2.0" + "@ethersproject/hash" "^5.2.0" + "@ethersproject/logger" "^5.2.0" + "@ethersproject/properties" "^5.2.0" + "@ethersproject/strings" "^5.2.0" "@istanbuljs/load-nyc-config@^1.0.0": version "1.0.0" @@ -1733,17 +1556,17 @@ dependencies: commander "^2.20.0" -"@ledgerhq/cryptoassets@6.1.0", "@ledgerhq/cryptoassets@^6.1.0": - version "6.1.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/cryptoassets/-/cryptoassets-6.1.0.tgz#46b04f8928461653179663fef096b59a842add37" - integrity sha512-4j5vXxvbGjPdUK9x3UaMR04DfmSjXYnq7Dhg8IN+9DqJnvFyKHzcrj57hLw3w5amJZPa89OEukFJCe52G4rsZA== +"@ledgerhq/cryptoassets@6.0.2", "@ledgerhq/cryptoassets@^6.0.2": + version "6.0.2" + resolved "https://registry.yarnpkg.com/@ledgerhq/cryptoassets/-/cryptoassets-6.0.2.tgz#52efb7d017722ad7806c98c5d4e9887ed54ab744" + integrity sha512-vBG4GFFhMNTt+Y9GRNCZVAH9SzzzL/GEOXA4dJ/rPwCgz9nxymTCtkJugK4KCzdyFwp6U1X+7s7BOz1F0bnu8g== dependencies: invariant "2" -"@ledgerhq/devices@6.1.0", "@ledgerhq/devices@^6.1.0": - version "6.1.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/devices/-/devices-6.1.0.tgz#54963409011c0bb83e2cc3d4d55ad9b905e296ff" - integrity sha512-Swl08sVuvx7IL9yx9P0ZzvwjIl4JXl51X34Po3pT2uRRaLnh/fRRSNe9tSC1gFMioviiLJlkmO+yydE4XeV+Jg== +"@ledgerhq/devices@6.0.2", "@ledgerhq/devices@^6.0.2": + version "6.0.2" + resolved "https://registry.yarnpkg.com/@ledgerhq/devices/-/devices-6.0.2.tgz#cbf730368f00ddb5a4384f73bb4966371aa2a4c3" + integrity sha512-xR4RYXltXISH4Vf7bLgiaIRy4W3F+kvDXYhXY7Q72goR4NA+vAosuRLGFQZIQiuZZMdPCIbXHuysj07z/NsEpA== dependencies: "@ledgerhq/errors" "^6.0.2" "@ledgerhq/logs" "^6.0.2" @@ -1755,21 +1578,21 @@ resolved "https://registry.yarnpkg.com/@ledgerhq/errors/-/errors-6.0.2.tgz#7c88d16620db08c96de6a2636440db1c0e541da1" integrity sha512-m42ZMzR/EKpOrZfPR3DzusE98DoF3d03cbBkQG6ddm6diwVXFSa7MabaKzgD+41EYQ+hrCGOEZK1K0kosX1itg== -"@ledgerhq/hw-app-algorand@6.1.0": - version "6.1.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-algorand/-/hw-app-algorand-6.1.0.tgz#e1c653de33fc144249f6ce406c4df5c51c2b273b" - integrity sha512-TKNpCb3iBU8SIG5cIA3H9mEyWftO5UYrieKVVckXRdObKGKvVwhGTy512O3DibdR/wwBAskIkGnHdRWBnCb6kA== +"@ledgerhq/hw-app-algorand@6.0.2": + version "6.0.2" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-algorand/-/hw-app-algorand-6.0.2.tgz#b13487bccbed67d9ad4cda99133ca41d39e87158" + integrity sha512-0HDzIvazqu/fSWitGtDZyAPNKR7FFrhDGHMcAILURaeZux+OojQ0pEdh9yBKWMfi4drAyqRLX7tsXEy6HB+nEg== dependencies: "@ledgerhq/errors" "^6.0.2" - "@ledgerhq/hw-transport" "^6.1.0" + "@ledgerhq/hw-transport" "^6.0.2" bip32-path "^0.4.2" -"@ledgerhq/hw-app-btc@6.1.0": - version "6.1.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-btc/-/hw-app-btc-6.1.0.tgz#a7ecc3e9a2ab4eddab73edde94cb8b49176e6bf4" - integrity sha512-lt11cdeuoB62xcUuhe5u3ZJcRM5APbb2hFdzk2N8xdMoJ8wI0vBYvLdM+hhZXzePTtVU/Bxdp3cs/UeDyBrxSg== +"@ledgerhq/hw-app-btc@6.0.2": + version "6.0.2" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-btc/-/hw-app-btc-6.0.2.tgz#0cf125d3d8e60e7e7225e8e7c0e3491d60effeed" + integrity sha512-CODHZ0hy0VuKo2xn8ADpPyKIG4ge1kQz+Q+XXQgfJEE/ZOYpT0R9nOfR974Ocif44Q9u/k0QAbuD9Q9w2STMUg== dependencies: - "@ledgerhq/hw-transport" "^6.1.0" + "@ledgerhq/hw-transport" "^6.0.2" "@ledgerhq/logs" "^6.0.2" bip32-path "^0.4.2" invariant "^2.2.4" @@ -1777,96 +1600,96 @@ semver "^7.3.5" sha.js "2" -"@ledgerhq/hw-app-cosmos@6.1.0": - version "6.1.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-cosmos/-/hw-app-cosmos-6.1.0.tgz#da429847645596be618f636ef32775aa40a0008b" - integrity sha512-0hoDGRQAc8G4Rim77fKqiV+RlXP3JUWlpu6U2Ch7EUAhhqB91/mpqjRcFiwLNLNrdxtYLS7nIF/LBDdGzU08Ag== +"@ledgerhq/hw-app-cosmos@6.0.2": + version "6.0.2" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-cosmos/-/hw-app-cosmos-6.0.2.tgz#1402ad306d3d3af562d3e91c61b69d3a7f57f873" + integrity sha512-BQ8e7NjzIWhVg8TR9GQvcsM3YnHL6/t82IrlQ6jCbnvkijpw/gYie6YLIvXaxojbH15hNgAtIsN2fjqIoLtPXQ== dependencies: "@ledgerhq/errors" "^6.0.2" - "@ledgerhq/hw-transport" "^6.1.0" + "@ledgerhq/hw-transport" "^6.0.2" bip32-path "^0.4.2" -"@ledgerhq/hw-app-eth@6.1.0": - version "6.1.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-eth/-/hw-app-eth-6.1.0.tgz#1aeddd9d61bdfb04ec51d6cb666043feea208741" - integrity sha512-vWWSMcV5I+xzgQZlRpcX/8lTMyE7MylsuAMcaio8gLf+BbNA94ti5+aJLmJH8Dyh4bSSgbbYhVpdsbCL/i0zlQ== +"@ledgerhq/hw-app-eth@6.0.2": + version "6.0.2" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-eth/-/hw-app-eth-6.0.2.tgz#d2e26756c084322643a9cc21f4b9c59cb7d72766" + integrity sha512-vAkn/cod5qucPI2D59uRpOXq/cmbXf96GCuaXQWCOEjMhENe+k/be6RuHh8TVah9fAWunBmcPHyLVeHj1oVSCA== dependencies: - "@ledgerhq/cryptoassets" "^6.1.0" + "@ledgerhq/cryptoassets" "^6.0.2" "@ledgerhq/errors" "^6.0.2" - "@ledgerhq/hw-transport" "^6.1.0" + "@ledgerhq/hw-transport" "^6.0.2" "@ledgerhq/logs" "^6.0.2" bignumber.js "^9.0.1" - ethers "^5.4.1" + ethers "^5.2.0" -"@ledgerhq/hw-app-polkadot@6.1.0": - version "6.1.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-polkadot/-/hw-app-polkadot-6.1.0.tgz#6b431099c595f9bbd3103a7de950e88b6cd2b8c1" - integrity sha512-EVLvd7gM7WjU366GBxCI60T6avkModHf0fCV8lNrO7BrTx1dx1EGttUOiMsFzVj5du81SwM2TOdPpES59Mo4zQ== +"@ledgerhq/hw-app-polkadot@6.0.2": + version "6.0.2" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-polkadot/-/hw-app-polkadot-6.0.2.tgz#1986a519d26ca3029646f0f83230cacee708ce85" + integrity sha512-OeQNSVfgFVcKAMGOJGCevUobgpjt9ByhG19/fZa5Av7f/KJFbItj5NctwvweH+W9sZJXFHCetHxwe6APuPNhkA== dependencies: "@ledgerhq/errors" "^6.0.2" - "@ledgerhq/hw-transport" "^6.1.0" + "@ledgerhq/hw-transport" "^6.0.2" bip32-path "^0.4.2" -"@ledgerhq/hw-app-str@6.1.0": - version "6.1.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-str/-/hw-app-str-6.1.0.tgz#ab285821bf89ad4d21ae29e067abfe718416ca71" - integrity sha512-JipovJkRc9Qm+64VHxNyQxL/8+V5Fhxefxvg9f8rZvq2fLf4OHbC2w6ic3ZqIrjK6/fafrOT8JCrBX4ifi14fg== +"@ledgerhq/hw-app-str@6.0.2": + version "6.0.2" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-str/-/hw-app-str-6.0.2.tgz#dfbd0c67acdd09befd24661c06bd632cd927f342" + integrity sha512-+VSIZzeJ7F9pU19TH74XjrjUYoGLYQ9DS1s9bGCvCep0Vd061dtXZwNhmnu7gWYKRHvLkEEMDZQHdARByHqR0w== dependencies: - "@ledgerhq/hw-transport" "^6.1.0" + "@ledgerhq/hw-transport" "^6.0.2" base32.js "^0.1.0" sha.js "^2.3.6" tweetnacl "^1.0.3" -"@ledgerhq/hw-app-tezos@6.1.0": - version "6.1.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-tezos/-/hw-app-tezos-6.1.0.tgz#9beeb347eb4cb8a0346a80387929074249cf500f" - integrity sha512-YZPwyZnCA8nx1MRqx4nkdILyrn54rPxTO6C9qlC3jTPCqYfPTbrJ0RxZWyPp1A6Jpz1s6XLA1s1UW1ZINIq5bA== +"@ledgerhq/hw-app-tezos@6.0.2": + version "6.0.2" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-tezos/-/hw-app-tezos-6.0.2.tgz#7086a10227c3f570ed25374b2d1f3589ce7eefc0" + integrity sha512-BMCd1r12I1RcqMZAa0RitL/jQxrLAr8AoFIW7L+0wehMHnppFghiBiMXa6VNs05diXd+lxOTkG7oyKd0Ax/3Og== dependencies: - "@ledgerhq/hw-transport" "^6.1.0" + "@ledgerhq/hw-transport" "^6.0.2" blake2b "^2.1.3" bs58check "^2.1.2" invariant "^2.2.4" -"@ledgerhq/hw-app-trx@6.1.0": - version "6.1.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-trx/-/hw-app-trx-6.1.0.tgz#5e2b5f869db07cb1850bdc28dd02abcdf1e71537" - integrity sha512-fcA59hle9Ah495xe3K+42A70wrn1Yp5scGF0yiKXbXTLAWq95Dkjo7Aohza1ev6o/IN7g9rxGjJoIuVgAalS/g== +"@ledgerhq/hw-app-trx@6.0.2": + version "6.0.2" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-trx/-/hw-app-trx-6.0.2.tgz#0a0749b0690effb7c57380bc5da97ab00a27bd52" + integrity sha512-cI4UnVYb6nlj3QfxB9kSOmf5ViH4p+ZFIvduU0iovnG9P+ynqd13ls2rtju6mobC1/aVk0TCx8n2I1jBrSUgGA== dependencies: "@ledgerhq/errors" "^6.0.2" - "@ledgerhq/hw-transport" "^6.1.0" + "@ledgerhq/hw-transport" "^6.0.2" -"@ledgerhq/hw-app-xrp@6.1.0": - version "6.1.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-xrp/-/hw-app-xrp-6.1.0.tgz#2d20bd5fd2a3b3fe196e756b95dcf63a7357b307" - integrity sha512-WXlEdfIpuLlr3l/xV6FfFmf6Lp/d5T3Dal7E2twyVWy39AHVEuw5vUdY+A7hcbZuZL0M8EKXdKjwKDKMU6f2qQ== +"@ledgerhq/hw-app-xrp@6.0.2": + version "6.0.2" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-xrp/-/hw-app-xrp-6.0.2.tgz#c7470b68c40e3844641fd38a5349ec4da5257955" + integrity sha512-VlBUqSUJfE2ITBuwJSqfft9IPShVzGMaKJnSavyL/pHsK37e2zBbcth9GyeiKUVs+276gJsDJWM/HsD68359NA== dependencies: - "@ledgerhq/hw-transport" "^6.1.0" + "@ledgerhq/hw-transport" "^6.0.2" bip32-path "0.4.2" -"@ledgerhq/hw-transport-mocker@6.1.0": - version "6.1.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-mocker/-/hw-transport-mocker-6.1.0.tgz#78d35fe1d424c5350fe79d996c876bc57d71972b" - integrity sha512-/UWP26fvoP+fT0Z9TzD/j/+nsmSQx3tsLN4x7sCYwdnur6CprdehtRIr9xbnDqZemGrddd/2sqyNiNAb3Ml5Iw== +"@ledgerhq/hw-transport-mocker@6.0.2": + version "6.0.2" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-mocker/-/hw-transport-mocker-6.0.2.tgz#7473b5fe60160dffd4b501a7af7e7ce0c4821219" + integrity sha512-ydd78CDXZjfV+MLynw5B7uinonKTMdBq5i3Ae478mU7YmJN7blUFQne4GEMPHkbW4Tx6iZGeT/rmbOPalnKwRw== dependencies: - "@ledgerhq/hw-transport" "^6.1.0" + "@ledgerhq/hw-transport" "^6.0.2" "@ledgerhq/logs" "^6.0.2" -"@ledgerhq/hw-transport-node-speculos@6.1.0": - version "6.1.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-node-speculos/-/hw-transport-node-speculos-6.1.0.tgz#777f1223e25f22168387298a863d253ac539e78d" - integrity sha512-6dyxe9iQNcRJRrjRHv1unuVl+rWBp8oAvX477EYGdoEPLqA0+IDRncwbUCxsxkK+5eD84Azx1rAj/64k+UWUzQ== +"@ledgerhq/hw-transport-node-speculos@6.0.2": + version "6.0.2" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-node-speculos/-/hw-transport-node-speculos-6.0.2.tgz#25dde72fbd8754891b7fec4ddf5a8175e2395407" + integrity sha512-UuQZ13gLbHtRvuL2H2RDNF3z8RVbDpA3WXrBz1Y3uFVFXHXZkr/XsZJ0kibXrBvtGt/T0vOq2/KhoNPe5zjYZw== dependencies: "@ledgerhq/errors" "^6.0.2" - "@ledgerhq/hw-transport" "^6.1.0" + "@ledgerhq/hw-transport" "^6.0.2" "@ledgerhq/logs" "^6.0.2" rxjs "6" -"@ledgerhq/hw-transport@6.1.0", "@ledgerhq/hw-transport@^6.1.0": - version "6.1.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport/-/hw-transport-6.1.0.tgz#b50151c6199e9ad6d3ab9e447532a22170c9f3b7" - integrity sha512-j9IyvksI9PjFoFrk/B3p8wCXWRWc8uK24gc20pAaXQiDtqMkWqEge8iZyPKWBVIv69vDQF3LE3Y6EeRwwA7wJA== +"@ledgerhq/hw-transport@6.0.2", "@ledgerhq/hw-transport@^6.0.2": + version "6.0.2" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport/-/hw-transport-6.0.2.tgz#5b3a0cb01eb6adbd876916bc7d566226e505d333" + integrity sha512-JI8bhs0vQW1pjDeZ8/Cv/OT4iejH2F3j0i5z5mGNkSgs179GiGeM81EhStLB0XuXqxWpFZMnZ97/Cdo0XmffrA== dependencies: - "@ledgerhq/devices" "^6.1.0" + "@ledgerhq/devices" "^6.0.2" "@ledgerhq/errors" "^6.0.2" events "^3.3.0" @@ -1959,46 +1782,62 @@ hash.js "^1.1.7" randombytes "^2.1.0" -"@polkadot/networks@7.0.1", "@polkadot/networks@^7.0.1": - version "7.0.1" - resolved "https://registry.yarnpkg.com/@polkadot/networks/-/networks-7.0.1.tgz#e07c4b88e25711433e76d24fce4c7273c25dd38b" - integrity sha512-bJSvI7UgEpxmBKS8TMh+I1mfmCMwhClGdSs29kwU+K61IjBTKTt3yQJ/SflYIQV7QftGbz3oMfSkGbQbRHZqvQ== +"@polkadot/metadata@3.11.1": + version "3.11.1" + resolved "https://registry.yarnpkg.com/@polkadot/metadata/-/metadata-3.11.1.tgz#c3e9645f6f78c8e02e0da695f3718b9d69f450a8" + integrity sha512-Z3KtOTX2kU+vvbRDiGY+qyPpF/4xTpnUipoNGijIGQ/EWWcgrm8sSgPzZQhHCfgIqM+jq3g9GvPMYeQp2Yy3ng== dependencies: - "@babel/runtime" "^7.14.6" + "@babel/runtime" "^7.13.8" + "@polkadot/types" "3.11.1" + "@polkadot/types-known" "3.11.1" + "@polkadot/util" "^5.9.2" + "@polkadot/util-crypto" "^5.9.2" + bn.js "^4.11.9" -"@polkadot/types-known@5.0.1": - version "5.0.1" - resolved "https://registry.yarnpkg.com/@polkadot/types-known/-/types-known-5.0.1.tgz#21feb327fc4323733bf027c8d874a2aa3014b21f" - integrity sha512-AIhPlN4r14ZW4wdwHZD2nIe1DE61ZO9PsyrCyAU3ysl6Cw6TI+txDCN3aS/8XYuC7wDLEgLB9vJv2sVWdCzqJg== +"@polkadot/networks@5.9.2", "@polkadot/networks@^5.9.2": + version "5.9.2" + resolved "https://registry.yarnpkg.com/@polkadot/networks/-/networks-5.9.2.tgz#c687525b5886c9418f75240afe22b562ed88e2dd" + integrity sha512-JQyXJDJTZKQtn8y3HBHWDhiBfijhpiXjVEhY+fKvFcQ82TaKmzhnipYX0EdBoopZbuxpn/BJy6Y1Y/3y85EC+g== dependencies: - "@babel/runtime" "^7.14.6" - "@polkadot/networks" "^7.0.1" - "@polkadot/types" "5.0.1" - "@polkadot/util" "^7.0.1" + "@babel/runtime" "^7.13.8" -"@polkadot/types@5.0.1": - version "5.0.1" - resolved "https://registry.yarnpkg.com/@polkadot/types/-/types-5.0.1.tgz#2a4e23e452f999eeae175b595470df0e426a930d" - integrity sha512-aN6JKeF7ZYi5irYAaUoDqth6qlOlB15C5vhlDOojEorYLfRs/R+GCrO+lPSs+bKmSxh7BSRh500ikI/xD4nx5A== +"@polkadot/types-known@3.11.1": + version "3.11.1" + resolved "https://registry.yarnpkg.com/@polkadot/types-known/-/types-known-3.11.1.tgz#f695c9155fa54eeed95cea179bb8cb2398726bd3" + integrity sha512-ImAxyCdqblmlXaMlgvuXZ6wzZgOYgE40FgWaYRJpFXRGJLDwtcJcpVI+7m/ns5dJ3WujboEMOHVR1HPpquw8Jw== dependencies: - "@babel/runtime" "^7.14.6" - "@polkadot/util" "^7.0.1" - "@polkadot/util-crypto" "^7.0.1" - rxjs "^7.2.0" + "@babel/runtime" "^7.13.8" + "@polkadot/networks" "^5.9.2" + "@polkadot/types" "3.11.1" + "@polkadot/util" "^5.9.2" + bn.js "^4.11.9" -"@polkadot/util-crypto@^7.0.1": - version "7.0.1" - resolved "https://registry.yarnpkg.com/@polkadot/util-crypto/-/util-crypto-7.0.1.tgz#03109dc11323dad174fb2214d395855495def16a" - integrity sha512-dbvdsICoyOVw/K45RmHOP7wXE/7vj+NzEKGcKbiDt39nglHm6g2BTJ947PwwyNusTTAx82Q2iJ9vIZ1Kl0xG+g== - dependencies: - "@babel/runtime" "^7.14.6" - "@polkadot/networks" "7.0.1" - "@polkadot/util" "7.0.1" - "@polkadot/wasm-crypto" "^4.1.2" - "@polkadot/x-randomvalues" "7.0.1" +"@polkadot/types@3.11.1": + version "3.11.1" + resolved "https://registry.yarnpkg.com/@polkadot/types/-/types-3.11.1.tgz#c0188390dfda84d746d57f7818ad622ac6b1de8b" + integrity sha512-+BWsmveYVkLFx/csvPmU+NhNFhf+0srAt2d0f+7y663nitc/sng1AcEDPbrbXHSQVyPdvI20Mh4Escl4aR+TLw== + dependencies: + "@babel/runtime" "^7.13.8" + "@polkadot/metadata" "3.11.1" + "@polkadot/util" "^5.9.2" + "@polkadot/util-crypto" "^5.9.2" + "@polkadot/x-rxjs" "^5.9.2" + "@types/bn.js" "^4.11.6" + bn.js "^4.11.9" + +"@polkadot/util-crypto@^5.9.2": + version "5.9.2" + resolved "https://registry.yarnpkg.com/@polkadot/util-crypto/-/util-crypto-5.9.2.tgz#3858cfffe7732458b4a2b38ece01eaf52a3746c2" + integrity sha512-d8CW2grI3gWi6d/brmcZQWaMPHqQq5z7VcM74/v8D2KZ+hPYL3B0Jn8zGL1vtgMz2qdpWrZdAe89LBC8BvM9bw== + dependencies: + "@babel/runtime" "^7.13.8" + "@polkadot/networks" "5.9.2" + "@polkadot/util" "5.9.2" + "@polkadot/wasm-crypto" "^3.2.4" + "@polkadot/x-randomvalues" "5.9.2" base-x "^3.0.8" base64-js "^1.5.1" - blakejs "^1.1.1" + blakejs "^1.1.0" bn.js "^4.11.9" create-hash "^1.2.0" elliptic "^6.5.4" @@ -2008,125 +1847,82 @@ tweetnacl "^1.0.3" xxhashjs "^0.2.2" -"@polkadot/util@7.0.1", "@polkadot/util@^7.0.1": - version "7.0.1" - resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-7.0.1.tgz#79afd40473016876f51d65ebb9900a20108fe0a4" - integrity sha512-EtQlZL6ok0Ep+zRz2QHMUoJo/b3kFHVN2qqyD2+9sdqg0FGLmkzNFM+K6dasCMLXieJ1l0HoFsQppSo/leUeaA== +"@polkadot/util@5.9.2", "@polkadot/util@^5.9.2": + version "5.9.2" + resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-5.9.2.tgz#ad2494e78ca6c3aadd6fb394a6be55020dc9b2a8" + integrity sha512-p225NJusnXeu7i2iAb8HAGWiMOUAnRaIyblIjJ4F89ZFZZ4amyliGxe5gKcyjRgxAJ44WdKyBLl/8L3rNv8hmQ== dependencies: - "@babel/runtime" "^7.14.6" - "@polkadot/x-textdecoder" "7.0.1" - "@polkadot/x-textencoder" "7.0.1" + "@babel/runtime" "^7.13.8" + "@polkadot/x-textdecoder" "5.9.2" + "@polkadot/x-textencoder" "5.9.2" "@types/bn.js" "^4.11.6" bn.js "^4.11.9" camelcase "^5.3.1" ip-regex "^4.3.0" -"@polkadot/wasm-crypto-asmjs@^4.1.2": - version "4.1.2" - resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-asmjs/-/wasm-crypto-asmjs-4.1.2.tgz#094b3eeeb5fd39a93db177583b48454511874cfc" - integrity sha512-3Q+vVUxDAC2tXgKMM3lKzx2JW+tarDpTjkvdxIKATyi8Ek69KkUqvMyJD0VL/iFZOFZED0YDX9UU4XOJ/astlg== +"@polkadot/wasm-crypto-asmjs@^3.2.4": + version "3.2.4" + resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-asmjs/-/wasm-crypto-asmjs-3.2.4.tgz#837f5b723161b21670d13779eff4c061f7947577" + integrity sha512-fgN26iL+Pbb35OYsDIRHC74Xnwde+A5u3OjEcQ9zJhM391eOTuKsQ2gyC9TLNAKqeYH8pxsa27yjRO71We7FUA== dependencies: - "@babel/runtime" "^7.14.6" + "@babel/runtime" "^7.13.7" -"@polkadot/wasm-crypto-wasm@^4.1.2": - version "4.1.2" - resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-wasm/-/wasm-crypto-wasm-4.1.2.tgz#773c78c1d65886671d3ba1d66c31afd86c93d02f" - integrity sha512-/l4IBEdQ41szHdHkuF//z1qr+XmWuLHlpBA7s9Eb221m1Fir6AKoCHoh1hp1r3v0ecZYLKvak1B225w6JAU3Fg== +"@polkadot/wasm-crypto-wasm@^3.2.4": + version "3.2.4" + resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-wasm/-/wasm-crypto-wasm-3.2.4.tgz#70885e06a813af91d81cf7e8ff826976fa99a38b" + integrity sha512-Q/3IEpoo7vkTzg40GxehRK000A9oBgjbh/uWCNQ8cMqWLYYCfzZy4NIzw8szpxNiSiGfGL0iZlP4ZSx2ZqEe2g== dependencies: - "@babel/runtime" "^7.14.6" + "@babel/runtime" "^7.13.7" -"@polkadot/wasm-crypto@^4.1.2": - version "4.1.2" - resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto/-/wasm-crypto-4.1.2.tgz#dead71ae5d2f7722d23aed5be2112e1732d315e9" - integrity sha512-2EKdOjIrD2xHP2rC+0G/3Qo6926nL/18vCFkd34lBd9zP9YNF2GDEtDY+zAeDIRFKe1sQHTpsKgNdYSWoV2eBg== +"@polkadot/wasm-crypto@^3.2.4": + version "3.2.4" + resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto/-/wasm-crypto-3.2.4.tgz#c3e23ff728c1d5701215ae15ecdc605e96901989" + integrity sha512-poeRU91zzZza0ZectT63vBiAqh6DsHCyd3Ogx1U6jsYiRa0yuECMWJx1onvnseDW4tIqsC8vZ/9xHXWwhjTAVg== dependencies: - "@babel/runtime" "^7.14.6" - "@polkadot/wasm-crypto-asmjs" "^4.1.2" - "@polkadot/wasm-crypto-wasm" "^4.1.2" + "@babel/runtime" "^7.13.7" + "@polkadot/wasm-crypto-asmjs" "^3.2.4" + "@polkadot/wasm-crypto-wasm" "^3.2.4" -"@polkadot/x-global@7.0.1": - version "7.0.1" - resolved "https://registry.yarnpkg.com/@polkadot/x-global/-/x-global-7.0.1.tgz#44fb248d3aaea557753318327149772969e96bff" - integrity sha512-gVVACSdRhHYRJejLEAL0mM9BZfY8N50VT2+15A7ALD1tVqwS4tz3P9vRW3Go7ZjfyAc83aEmh0PiQ8Nm1R+2Cg== +"@polkadot/x-global@5.9.2": + version "5.9.2" + resolved "https://registry.yarnpkg.com/@polkadot/x-global/-/x-global-5.9.2.tgz#e223d59536d168c7cbc49fc3a2052cbd71bd7256" + integrity sha512-wpY6IAOZMGiJQa8YMm7NeTLi9bwnqqVauR+v7HwyrssnGPuYX8heb6BQLOnnnPh/EK0+M8zNtwRBU48ez0/HOg== dependencies: - "@babel/runtime" "^7.14.6" + "@babel/runtime" "^7.13.8" + "@types/node-fetch" "^2.5.8" + node-fetch "^2.6.1" -"@polkadot/x-randomvalues@7.0.1": - version "7.0.1" - resolved "https://registry.yarnpkg.com/@polkadot/x-randomvalues/-/x-randomvalues-7.0.1.tgz#32036ae5d48645a062f6a1c3ebbf227236c806b8" - integrity sha512-UNoIFaz1xJPozruT+lo8BTeT8A3NM3PgWuru7Vs8OsIz0Phkg7lUWlpHu9PZHyQCyKlUryvkOA692IlVlNYy2Q== +"@polkadot/x-randomvalues@5.9.2": + version "5.9.2" + resolved "https://registry.yarnpkg.com/@polkadot/x-randomvalues/-/x-randomvalues-5.9.2.tgz#563a76550f94107ce5a37c462ed067dc040626b1" + integrity sha512-Zv+eXSP3oBImMnB82y05Doo0A96WUFsQDbnLHI3jFHioIg848cL0nndB9TgBwPaFkZ2oiwoHEC8yxqNI6/jkzQ== dependencies: - "@babel/runtime" "^7.14.6" - "@polkadot/x-global" "7.0.1" + "@babel/runtime" "^7.13.8" + "@polkadot/x-global" "5.9.2" -"@polkadot/x-textdecoder@7.0.1": - version "7.0.1" - resolved "https://registry.yarnpkg.com/@polkadot/x-textdecoder/-/x-textdecoder-7.0.1.tgz#bb9bba94b2eb1612dd35c299f43ab74515db74d9" - integrity sha512-CFRnpI0cp1h2N1+ec551BLVLwV6OHG6Gj62EYcIOXR+o/SX/6MXm3Qcehm2YvfTKqktyIUSWmTwbWjGjuqPrpA== +"@polkadot/x-rxjs@^5.9.2": + version "5.9.2" + resolved "https://registry.yarnpkg.com/@polkadot/x-rxjs/-/x-rxjs-5.9.2.tgz#925b7c3325678b137ca30af6a726b22c5e8f9125" + integrity sha512-cuF4schclspOfAqEPvbcA3aQ9d3TBy2ORZ8YehxD0ZSHWJNhefHDIUDgS5T3NtPhSKgcEmSlI5TfVfgGFxgVMg== dependencies: - "@babel/runtime" "^7.14.6" - "@polkadot/x-global" "7.0.1" + "@babel/runtime" "^7.13.8" + rxjs "^6.6.6" -"@polkadot/x-textencoder@7.0.1": - version "7.0.1" - resolved "https://registry.yarnpkg.com/@polkadot/x-textencoder/-/x-textencoder-7.0.1.tgz#181d403c5dc1d94fd1e2147fd1c5c528d30d8805" - integrity sha512-m+QL1HNiu5GMz6cfr/udSA6fUTv3RyIybJb7v43EQCxqlj/L0J3cUHapFd6tqH9PElD6jPkH1pXcgYN8e7dWTQ== +"@polkadot/x-textdecoder@5.9.2": + version "5.9.2" + resolved "https://registry.yarnpkg.com/@polkadot/x-textdecoder/-/x-textdecoder-5.9.2.tgz#2e69922acc426f91adc2629fea362e41c9035f25" + integrity sha512-MCkgITwGY3tG0UleDkBJEoiKGk/YWYwMM5OR6fNo07RymHRtJ8OLJC+Sej9QD05yz6TIhFaaRRYzmtungIcwTw== dependencies: - "@babel/runtime" "^7.14.6" - "@polkadot/x-global" "7.0.1" - -"@protobufjs/aspromise@^1.1.1", "@protobufjs/aspromise@^1.1.2": - version "1.1.2" - resolved "https://registry.yarnpkg.com/@protobufjs/aspromise/-/aspromise-1.1.2.tgz#9b8b0cc663d669a7d8f6f5d0893a14d348f30fbf" - integrity sha1-m4sMxmPWaafY9vXQiToU00jzD78= + "@babel/runtime" "^7.13.8" + "@polkadot/x-global" "5.9.2" -"@protobufjs/base64@^1.1.2": - version "1.1.2" - resolved "https://registry.yarnpkg.com/@protobufjs/base64/-/base64-1.1.2.tgz#4c85730e59b9a1f1f349047dbf24296034bb2735" - integrity sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg== - -"@protobufjs/codegen@^2.0.4": - version "2.0.4" - resolved "https://registry.yarnpkg.com/@protobufjs/codegen/-/codegen-2.0.4.tgz#7ef37f0d010fb028ad1ad59722e506d9262815cb" - integrity sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg== - -"@protobufjs/eventemitter@^1.1.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz#355cbc98bafad5978f9ed095f397621f1d066b70" - integrity sha1-NVy8mLr61ZePntCV85diHx0Ga3A= - -"@protobufjs/fetch@^1.1.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@protobufjs/fetch/-/fetch-1.1.0.tgz#ba99fb598614af65700c1619ff06d454b0d84c45" - integrity sha1-upn7WYYUr2VwDBYZ/wbUVLDYTEU= +"@polkadot/x-textencoder@5.9.2": + version "5.9.2" + resolved "https://registry.yarnpkg.com/@polkadot/x-textencoder/-/x-textencoder-5.9.2.tgz#67362e64bacfe6ff4eec73bf596873a2f9d9f36d" + integrity sha512-IjdLY3xy0nUfps1Bdi0tRxAX7X081YyoiSWExwqUkChdcYGMqMe3T2wqrrt9qBr2IkW8O/tlfYBiZXdII0YCcw== dependencies: - "@protobufjs/aspromise" "^1.1.1" - "@protobufjs/inquire" "^1.1.0" - -"@protobufjs/float@^1.0.2": - version "1.0.2" - resolved "https://registry.yarnpkg.com/@protobufjs/float/-/float-1.0.2.tgz#5e9e1abdcb73fc0a7cb8b291df78c8cbd97b87d1" - integrity sha1-Xp4avctz/Ap8uLKR33jIy9l7h9E= - -"@protobufjs/inquire@^1.1.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@protobufjs/inquire/-/inquire-1.1.0.tgz#ff200e3e7cf2429e2dcafc1140828e8cc638f089" - integrity sha1-/yAOPnzyQp4tyvwRQIKOjMY48Ik= - -"@protobufjs/path@^1.1.2": - version "1.1.2" - resolved "https://registry.yarnpkg.com/@protobufjs/path/-/path-1.1.2.tgz#6cc2b20c5c9ad6ad0dccfd21ca7673d8d7fbf68d" - integrity sha1-bMKyDFya1q0NzP0hynZz2Nf79o0= - -"@protobufjs/pool@^1.1.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@protobufjs/pool/-/pool-1.1.0.tgz#09fd15f2d6d3abfa9b65bc366506d6ad7846ff54" - integrity sha1-Cf0V8tbTq/qbZbw2ZQbWrXhG/1Q= - -"@protobufjs/utf8@^1.1.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@protobufjs/utf8/-/utf8-1.1.0.tgz#a777360b5b39a1a2e5106f8e858f2fd2d060c570" - integrity sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA= + "@babel/runtime" "^7.13.8" + "@polkadot/x-global" "5.9.2" "@sindresorhus/is@^0.7.0": version "0.7.0" @@ -2337,30 +2133,18 @@ resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.162.tgz#65d78c397e0d883f44afbf1f7ba9867022411470" integrity sha512-alvcho1kRUnnD1Gcl4J+hK0eencvzq9rmzvFPRmP5rPHx9VVsJj6bKLTATPVf9ktgv4ujzh7T+XWKp+jhuODig== -"@types/long@^4.0.1": - version "4.0.1" - resolved "https://registry.yarnpkg.com/@types/long/-/long-4.0.1.tgz#459c65fa1867dafe6a8f322c4c51695663cc55e9" - integrity sha512-5tXH6Bx/kNGd3MgffdmP4dy2Z+G4eaXw0SE81Tq3BNadtnMR5/ySMzX4SLEzHJzSmPNn4HIdpQsBvXMUykr58w== - -"@types/node@*", "@types/node@>= 8", "@types/node@>=13.7.0": - version "15.9.0" - resolved "https://registry.yarnpkg.com/@types/node/-/node-15.9.0.tgz#0b7f6c33ca5618fe329a9d832b478b4964d325a8" - integrity sha512-AR1Vq1Ei1GaA5FjKL5PBqblTZsL5M+monvGSZwe6sSIdGiuu7Xr/pNwWJY+0ZQuN8AapD/XMB5IzBAyYRFbocA== - -"@types/node@10.12.18": - version "10.12.18" - resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.18.tgz#1d3ca764718915584fcd9f6344621b7672665c67" - integrity sha512-fh+pAqt4xRzPfqA6eh3Z2y6fyZavRIumvjhaCL753+TVkGKGhpPeyrJG2JftD0T9q4GF00KjefsQ+PQNDdWQaQ== - -"@types/node@11.11.6": - version "11.11.6" - resolved "https://registry.yarnpkg.com/@types/node/-/node-11.11.6.tgz#df929d1bb2eee5afdda598a41930fe50b43eaa6a" - integrity sha512-Exw4yUWMBXM3X+8oqzJNRqZSwUAaS4+7NdvHqQuFi/d+synz++xmX3QIf+BFqneW8N31R8Ky+sikfZUXq07ggQ== +"@types/node-fetch@^2.5.8": + version "2.5.8" + resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.5.8.tgz#e199c835d234c7eb0846f6618012e558544ee2fb" + integrity sha512-fbjI6ja0N5ZA8TV53RUqzsKNkl9fv8Oj3T7zxW7FGv1GSH7gwJaNF8dzCjrqKaxKeUpTz4yT1DaJFq/omNpGfw== + dependencies: + "@types/node" "*" + form-data "^3.0.0" -"@types/node@^13.7.0": - version "13.13.52" - resolved "https://registry.yarnpkg.com/@types/node/-/node-13.13.52.tgz#03c13be70b9031baaed79481c0c0cfb0045e53f7" - integrity sha512-s3nugnZumCC//n4moGGe6tkNMyYEdaDBitVjwPxXmR5lnMG5dHePinH2EdxkG3Rh1ghFHHixAG4NJhpJW1rthQ== +"@types/node@*", "@types/node@>= 8": + version "14.14.8" + resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.8.tgz#2127bd81949a95c8b7d3240f3254352d72563aec" + integrity sha512-z/5Yd59dCKI5kbxauAJgw6dLPzW+TNOItNE00PkpzNwUIEwdj/Lsqwq94H5DdYBX7C13aRA0CY32BK76+neEUA== "@types/normalize-package-data@^2.4.0": version "2.4.0" @@ -2523,10 +2307,10 @@ js-sha3 "0.8.0" query-string "6.13.5" -"@xstate/react@^1.5.1": - version "1.5.1" - resolved "https://registry.yarnpkg.com/@xstate/react/-/react-1.5.1.tgz#60817e60e54e338b8e7c3e51bfa4cd3babebdc7d" - integrity sha512-DJHDqDlZHus08X98uMJw4KR17FRWBXLHMQ02YRxx0DMm5VLn75VwGyt4tXdlNZHQWjyk++C5c9Ichq3PdmM3og== +"@xstate/react@^1.3.4": + version "1.3.4" + resolved "https://registry.yarnpkg.com/@xstate/react/-/react-1.3.4.tgz#d79126c9eecc9a1225d553e3421aaad68eb5ee5e" + integrity sha512-uKbKriFYjgeqMeEAqOv8IWRM8WBx5i/4pMPGpqo58wd7sInhFmmK6HWfV7eX3nD/vJPfxWielNMxAUCUdVh1pA== dependencies: use-isomorphic-layout-effect "^1.0.0" use-subscription "^1.3.0" @@ -2817,7 +2601,7 @@ axe-core@^4.0.2: resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.0.2.tgz#c7cf7378378a51fcd272d3c09668002a4990b1cb" integrity sha512-arU1h31OGFu+LPrOLGZ7nB45v940NMDMEJeNmbutu57P+UFDVnkZg3e+J1I2HJRZ9hT7gO8J91dn/PMrAiKakA== -axios@0.21.1, axios@^0.21.1: +axios@0.21.1: version "0.21.1" resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.1.tgz#22563481962f4d6bde9a76d516ef0e5d3c09b2b8" integrity sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA== @@ -2957,7 +2741,7 @@ base32.js@^0.1.0: resolved "https://registry.yarnpkg.com/base32.js/-/base32.js-0.1.0.tgz#b582dec693c2f11e893cf064ee6ac5b6131a2202" integrity sha1-tYLexpPC8R6JPPBk7mrFthMaIgI= -base64-js@^1.0.2, base64-js@^1.3.0, base64-js@^1.3.1, base64-js@^1.5.1: +base64-js@^1.0.2, base64-js@^1.3.1, base64-js@^1.5.1: version "1.5.1" resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== @@ -2992,7 +2776,7 @@ bcrypt-pbkdf@^1.0.0: dependencies: tweetnacl "^0.14.3" -bech32@1.1.4, bech32@^1.1.4: +bech32@1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/bech32/-/bech32-1.1.4.tgz#e38c9f37bf179b8eb16ae3a772b40c356d4832e9" integrity sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ== @@ -3020,11 +2804,6 @@ big-integer@^1.6.17, big-integer@^1.6.48: resolved "https://registry.yarnpkg.com/big-integer/-/big-integer-1.6.48.tgz#8fd88bd1632cba4a1c8c3e3d7159f08bb95b4b9e" integrity sha512-j51egjPa7/i+RdiRuJbPdJ2FIUYYPhvYLjzoYbcMMm62ooO6F94fETG4MTs46zPAF9Brs04OajboA/qTGuz78w== -big.js@6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/big.js/-/big.js-6.0.0.tgz#d3806d83d93d67faaf29bfca2d2c45d02160da04" - integrity sha512-PGsJX+jhBY5qaGOymm4V1QMM2oOCtfGdW8CxgbDTg17C/qHeW89jhx6Kpda3vS0uPHFT6sEhwbb5tlc0wmA+wQ== - bignumber.js@^4.0.0: version "4.1.0" resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-4.1.0.tgz#db6f14067c140bd46624815a7916c92d9b6c24b1" @@ -3053,7 +2832,7 @@ binary@~0.3.0: buffers "~0.1.1" chainsaw "~0.1.0" -bindings@^1.2.1, bindings@^1.3.0: +bindings@^1.2.1: version "1.5.0" resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.5.0.tgz#10353c9e945334bc0511a6d90b38fbc7c9c504df" integrity sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ== @@ -3065,39 +2844,6 @@ bip32-path@0.4.2, bip32-path@^0.4.2: resolved "https://registry.yarnpkg.com/bip32-path/-/bip32-path-0.4.2.tgz#5db0416ad6822712f077836e2557b8697c0c7c99" integrity sha1-XbBBataCJxLwd4NuJVe4aXwMfJk= -bip32@2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/bip32/-/bip32-2.0.6.tgz#6a81d9f98c4cd57d05150c60d8f9e75121635134" - integrity sha512-HpV5OMLLGTjSVblmrtYRfFFKuQB+GArM0+XP8HGWfJ5vxYBqo+DesvJwOdC2WJ3bCkZShGf0QIfoIpeomVzVdA== - dependencies: - "@types/node" "10.12.18" - bs58check "^2.1.1" - create-hash "^1.2.0" - create-hmac "^1.1.7" - tiny-secp256k1 "^1.1.3" - typeforce "^1.11.5" - wif "^2.0.6" - -bip39@3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/bip39/-/bip39-3.0.2.tgz#2baf42ff3071fc9ddd5103de92e8f80d9257ee32" - integrity sha512-J4E1r2N0tUylTKt07ibXvhpT2c5pyAFgvuA5q1H9uDy6dEGpjV8jmymh3MTYJDLCNbIVClSB9FbND49I6N24MQ== - dependencies: - "@types/node" "11.11.6" - create-hash "^1.1.0" - pbkdf2 "^3.0.9" - randombytes "^2.0.1" - -bip39@^3.0.2: - version "3.0.4" - resolved "https://registry.yarnpkg.com/bip39/-/bip39-3.0.4.tgz#5b11fed966840b5e1b8539f0f54ab6392969b2a0" - integrity sha512-YZKQlb752TrUWqHWj7XAwCSjYEgGAk+/Aas3V7NyjQeZYsztO8JnQUaCWhcnL4T+jL8nvB8typ2jRPzTlgugNw== - dependencies: - "@types/node" "11.11.6" - create-hash "^1.1.0" - pbkdf2 "^3.0.9" - randombytes "^2.0.1" - blake2b-wasm@^1.1.0: version "1.1.7" resolved "https://registry.yarnpkg.com/blake2b-wasm/-/blake2b-wasm-1.1.7.tgz#e4d075da10068e5d4c3ec1fb9accc4d186c55d81" @@ -3113,10 +2859,10 @@ blake2b@^2.1.3: blake2b-wasm "^1.1.0" nanoassert "^1.0.0" -blakejs@^1.1.0, blakejs@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/blakejs/-/blakejs-1.1.1.tgz#bf313053978b2cd4c444a48795710be05c785702" - integrity sha512-bLG6PHOCZJKNshTjGRBvET0vTciwQE6zFKOKKXPDJfwFBd4Ac0yBfPZqcGvGJap50l7ktvlpFqc2jGVaUgbJgg== +blakejs@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/blakejs/-/blakejs-1.1.0.tgz#69df92ef953aa88ca51a32df6ab1c54a155fc7a5" + integrity sha1-ad+S75U6qIylGjLfarHFShVfx6U= bluebird@~3.4.1: version "3.4.7" @@ -3128,7 +2874,7 @@ bn.js@4.11.8: resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f" integrity sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA== -bn.js@^4.11.0, bn.js@^4.11.1, bn.js@^4.11.8, bn.js@^4.11.9: +bn.js@^4.11.0, bn.js@^4.11.1, bn.js@^4.11.8, bn.js@^4.11.9, bn.js@^4.4.0: version "4.12.0" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88" integrity sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA== @@ -3209,7 +2955,7 @@ bs58@^4.0.0, bs58@^4.0.1: dependencies: base-x "^3.0.2" -bs58check@2.1.2, bs58check@<3.0.0, bs58check@^2.1.1, bs58check@^2.1.2: +bs58check@2.1.2, bs58check@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/bs58check/-/bs58check-2.1.2.tgz#53b018291228d82a5aa08e7d796fdafda54aebfc" integrity sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA== @@ -3253,14 +2999,6 @@ buffer@5.6.0: base64-js "^1.0.2" ieee754 "^1.1.4" -buffer@5.6.1: - version "5.6.1" - resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.6.1.tgz#b99419405f4290a7a1f20b51037cee9f1fbd7f6a" - integrity sha512-2z15UUHpS9/3tk9mY/q+Rl3rydOi7yMp5XWNQnRvoz+mJwiv8brqYwp9a+nOCtma6dwuEIxljD8W3ysVBZ05Vg== - dependencies: - base64-js "^1.3.1" - ieee754 "^1.1.13" - buffer@^5.1.0: version "5.7.1" resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.7.1.tgz#ba62e7c13133053582197160851a8f648e99eed0" @@ -3540,7 +3278,7 @@ colorspace@1.1.x: color "3.0.x" text-hex "1.0.x" -combined-stream@^1.0.6, combined-stream@~1.0.6: +combined-stream@^1.0.6, combined-stream@^1.0.8, combined-stream@~1.0.6: version "1.0.8" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== @@ -3552,10 +3290,10 @@ commander@^2.11.0, commander@^2.20.0: resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== -commander@^4.0.0, commander@^4.0.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/commander/-/commander-4.1.1.tgz#9fd602bd936294e9e9ef46a3f4d6964044b18068" - integrity sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA== +commander@^4.0.1: + version "4.1.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-4.1.0.tgz#545983a0603fe425bc672d66c9e3c89c42121a83" + integrity sha512-NIQrwvv9V39FHgGFm36+U9SMQzbiHvU79k+iADraJTpmrFFfx7Ds0IvDoAdZsDrknlkRk14OYoWXb57uTh7/sw== component-emitter@^1.2.1: version "1.3.0" @@ -3630,7 +3368,7 @@ crc@^3.5.0: dependencies: buffer "^5.1.0" -create-hash@1.2.0, create-hash@^1.1.0, create-hash@^1.1.2, create-hash@^1.2.0: +create-hash@^1.1.0, create-hash@^1.1.2, create-hash@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.2.0.tgz#889078af11a63756bcfb59bd221996be3a9ef196" integrity sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg== @@ -3909,7 +3647,7 @@ electron-to-chromium@^1.3.723: resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.736.tgz#f632d900a1f788dab22fec9c62ec5c9c8f0c4052" integrity sha512-DY8dA7gR51MSo66DqitEQoUMQ0Z+A2DSXFi7tK304bdTVqczCAfUuyQw6Wdg8hIoo5zIxkU1L24RQtUce1Ioig== -elliptic@6.5.4, elliptic@^6.4.0, elliptic@^6.5.2, elliptic@^6.5.3, elliptic@^6.5.4: +elliptic@6.5.4, elliptic@^6.5.2, elliptic@^6.5.4: version "6.5.4" resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.4.tgz#da37cebd31e79a1367e941b592ed1fbebd58abbb" integrity sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ== @@ -3969,14 +3707,6 @@ enquirer@^2.3.5: dependencies: ansi-colors "^3.2.1" -env-cmd@*: - version "10.1.0" - resolved "https://registry.yarnpkg.com/env-cmd/-/env-cmd-10.1.0.tgz#c7f5d3b550c9519f137fdac4dd8fb6866a8c8c4b" - integrity sha512-mMdWTT9XKN7yNth/6N6g2GuKuJTsKMDHlQFUDacb/heQRRWOTIZ42t1rMHnQu4jYxU1ajdTeJM+9eEETlqToMA== - dependencies: - commander "^4.0.0" - cross-spawn "^7.0.0" - error-ex@^1.2.0, error-ex@^1.3.1: version "1.3.2" resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" @@ -4366,41 +4096,41 @@ ethereumjs-util@^7.0.10: ethjs-util "0.1.6" rlp "^2.2.4" -ethers@^5.4.1: - version "5.4.1" - resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.4.1.tgz#bcff1e9f45bf1a061bf313ec04e8d9881d2d53f9" - integrity sha512-SrcddMdCgP1hukDvCPd87Aipbf4NWjQvdfAbZ65XSZGbfyuYPtIrUJPDH5B1SBRsdlfiEgX3eoz28DdBDzMNFg== - dependencies: - "@ethersproject/abi" "5.4.0" - "@ethersproject/abstract-provider" "5.4.0" - "@ethersproject/abstract-signer" "5.4.0" - "@ethersproject/address" "5.4.0" - "@ethersproject/base64" "5.4.0" - "@ethersproject/basex" "5.4.0" - "@ethersproject/bignumber" "5.4.0" - "@ethersproject/bytes" "5.4.0" - "@ethersproject/constants" "5.4.0" - "@ethersproject/contracts" "5.4.0" - "@ethersproject/hash" "5.4.0" - "@ethersproject/hdnode" "5.4.0" - "@ethersproject/json-wallets" "5.4.0" - "@ethersproject/keccak256" "5.4.0" - "@ethersproject/logger" "5.4.0" - "@ethersproject/networks" "5.4.1" - "@ethersproject/pbkdf2" "5.4.0" - "@ethersproject/properties" "5.4.0" - "@ethersproject/providers" "5.4.1" - "@ethersproject/random" "5.4.0" - "@ethersproject/rlp" "5.4.0" - "@ethersproject/sha2" "5.4.0" - "@ethersproject/signing-key" "5.4.0" - "@ethersproject/solidity" "5.4.0" - "@ethersproject/strings" "5.4.0" - "@ethersproject/transactions" "5.4.0" - "@ethersproject/units" "5.4.0" - "@ethersproject/wallet" "5.4.0" - "@ethersproject/web" "5.4.0" - "@ethersproject/wordlists" "5.4.0" +ethers@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.2.0.tgz#13452e35947ab5d77053286d1f7161ee666c85ba" + integrity sha512-HqFGU2Qab0mAg3y1eHKVMXS4i1gTObMY0/4+x4LiO72NHhJL3Z795gnqyivmwG1J8e5NLSlRSfyIR7TL0Hw3ig== + dependencies: + "@ethersproject/abi" "5.2.0" + "@ethersproject/abstract-provider" "5.2.0" + "@ethersproject/abstract-signer" "5.2.0" + "@ethersproject/address" "5.2.0" + "@ethersproject/base64" "5.2.0" + "@ethersproject/basex" "5.2.0" + "@ethersproject/bignumber" "5.2.0" + "@ethersproject/bytes" "5.2.0" + "@ethersproject/constants" "5.2.0" + "@ethersproject/contracts" "5.2.0" + "@ethersproject/hash" "5.2.0" + "@ethersproject/hdnode" "5.2.0" + "@ethersproject/json-wallets" "5.2.0" + "@ethersproject/keccak256" "5.2.0" + "@ethersproject/logger" "5.2.0" + "@ethersproject/networks" "5.2.0" + "@ethersproject/pbkdf2" "5.2.0" + "@ethersproject/properties" "5.2.0" + "@ethersproject/providers" "5.2.0" + "@ethersproject/random" "5.2.0" + "@ethersproject/rlp" "5.2.0" + "@ethersproject/sha2" "5.2.0" + "@ethersproject/signing-key" "5.2.0" + "@ethersproject/solidity" "5.2.0" + "@ethersproject/strings" "5.2.0" + "@ethersproject/transactions" "5.2.0" + "@ethersproject/units" "5.2.0" + "@ethersproject/wallet" "5.2.0" + "@ethersproject/web" "5.2.0" + "@ethersproject/wordlists" "5.2.0" ethjs-util@0.1.6, ethjs-util@^0.1.3: version "0.1.6" @@ -4717,6 +4447,15 @@ forever-agent@~0.6.1: resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE= +form-data@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-3.0.0.tgz#31b7e39c85f1355b7139ee0c647cf0de7f83c682" + integrity sha512-CKMFDglpbMi6PyN+brwB9Q/GOw0eAnsrEZDgcsH5Krhz5Od/haKHAX0NmQfha2zPPz0JpWzA7GJHGSnvCRLWsg== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.8" + mime-types "^2.1.12" + form-data@~2.3.2: version "2.3.3" resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" @@ -4895,13 +4634,6 @@ globals@^13.6.0: dependencies: type-fest "^0.20.2" -globalthis@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/globalthis/-/globalthis-1.0.2.tgz#2a235d34f4d8036219f7e34929b5de9e18166b8b" - integrity sha512-ZQnSFO1la8P7auIOQECnm0sSuoMeaSq0EEdXMBFF2QJO4uNcwbyhSgG3MruWNbFTqCLmxVwGOl7LZ9kASvHdeQ== - dependencies: - define-properties "^1.1.3" - got@^8.3.2: version "8.3.2" resolved "https://registry.yarnpkg.com/got/-/got-8.3.2.tgz#1d23f64390e97f776cac52e5b936e5f514d2e937" @@ -5027,7 +4759,15 @@ hash-base@^3.0.0: readable-stream "^3.6.0" safe-buffer "^5.2.0" -hash.js@1.1.7, hash.js@^1.0.0, hash.js@^1.0.3, hash.js@^1.1.7: +hash.js@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.3.tgz#340dedbe6290187151c1ea1d777a3448935df846" + integrity sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA== + dependencies: + inherits "^2.0.3" + minimalistic-assert "^1.0.0" + +hash.js@^1.0.0, hash.js@^1.0.3, hash.js@^1.1.7: version "1.1.7" resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.7.tgz#0babca538e8d4ee4a0f8988d68866537a003cf42" integrity sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA== @@ -5971,11 +5711,6 @@ js-sha3@0.8.0, js-sha3@^0.8.0: resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.8.0.tgz#b9b7a5da73afad7dedd0f8c463954cbde6818840" integrity sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q== -js-sha512@^0.8.0: - version "0.8.0" - resolved "https://registry.yarnpkg.com/js-sha512/-/js-sha512-0.8.0.tgz#dd22db8d02756faccf19f218e3ed61ec8249f7d4" - integrity sha512-PWsmefG6Jkodqt+ePTvBZCSMFgN7Clckjd0O7su3I0+BW2QWUTJNzjktHsztGLhncP2h8mcF9V9Y2Ha59pAViQ== - "js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" @@ -6240,18 +5975,6 @@ levn@~0.3.0: prelude-ls "~1.1.2" type-check "~0.3.2" -libsodium-wrappers@^0.7.6: - version "0.7.9" - resolved "https://registry.yarnpkg.com/libsodium-wrappers/-/libsodium-wrappers-0.7.9.tgz#4ffc2b69b8f7c7c7c5594a93a4803f80f6d0f346" - integrity sha512-9HaAeBGk1nKTRFRHkt7nzxqCvnkWTjn1pdjKgcUnZxj0FyOP4CnhgFhMdrFfgNsukijBGyBLpP2m2uKT1vuWhQ== - dependencies: - libsodium "^0.7.0" - -libsodium@^0.7.0: - version "0.7.9" - resolved "https://registry.yarnpkg.com/libsodium/-/libsodium-0.7.9.tgz#4bb7bcbf662ddd920d8795c227ae25bbbfa3821b" - integrity sha512-gfeADtR4D/CM0oRUviKBViMGXZDgnFdMKMzHsvBdqLBHd9ySi6EtYnmuhHVDDYgYpAO8eU8hEY+F8vIUAPh08A== - lines-and-columns@^1.1.6: version "1.1.6" resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.1.6.tgz#1c00c743b433cd0a4e80758f7b64a57440d9ff00" @@ -6325,7 +6048,7 @@ lodash.uniq@^4.5.0: resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M= -lodash@4.17.21, lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.17.4, lodash@^4.17.5: +lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.17.4, lodash@^4.17.5: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -6341,11 +6064,6 @@ logform@^2.2.0: ms "^2.1.1" triple-beam "^1.3.0" -long@4.0.0, long@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/long/-/long-4.0.0.tgz#9a7b71cfb7d361a194ea555241c92f7468d5bf28" - integrity sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA== - long@^2.2.3: version "2.4.0" resolved "https://registry.yarnpkg.com/long/-/long-2.4.0.tgz#9fa180bb1d9500cdc29c4156766a1995e1f4524f" @@ -6561,7 +6279,7 @@ ms@2.1.2, ms@^2.1.1: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== -nan@^2.13.2, nan@^2.14.0, nan@^2.2.1: +nan@^2.14.0, nan@^2.2.1: version "2.14.2" resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.2.tgz#f5376400695168f4cc694ac9393d0c9585eeea19" integrity sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ== @@ -6603,7 +6321,7 @@ node-addon-api@^2.0.0: resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-2.0.2.tgz#432cfa82962ce494b132e9d72a15b29f71ff5d32" integrity sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA== -node-fetch@^2.3.0: +node-fetch@^2.3.0, node-fetch@^2.6.1: version "2.6.1" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw== @@ -6865,13 +6583,6 @@ os-name@^3.1.0: macos-release "^2.2.0" windows-release "^3.1.0" -ow@0.17.0: - version "0.17.0" - resolved "https://registry.yarnpkg.com/ow/-/ow-0.17.0.tgz#4f938999fed6264c9048cd6254356e0f1e7f688c" - integrity sha512-i3keDzDQP5lWIe4oODyDFey1qVrq2hXKTuTH2VpqwpYtzPiKZt2ziRI4NBQmgW40AnV5Euz17OyWweCb+bNEQA== - dependencies: - type-fest "^0.11.0" - p-cancelable@^0.4.0: version "0.4.1" resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-0.4.1.tgz#35f363d67d52081c8d9585e37bcceb7e0bbcb2a0" @@ -7040,10 +6751,10 @@ path-type@^4.0.0: resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== -pbkdf2@^3.0.17, pbkdf2@^3.0.9: - version "3.1.2" - resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.1.2.tgz#dd822aa0887580e52f1a039dc3eda108efae3075" - integrity sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA== +pbkdf2@^3.0.17: + version "3.1.1" + resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.1.1.tgz#cb8724b0fada984596856d1a6ebafd3584654b94" + integrity sha512-4Ejy1OPxi9f2tt1rRV7Go7zmfDQ+ZectEQz3VGUQhgq62HtIRPDyG/JtnwIxs6x3uNMwo2V7q1fMvKjb+Tnpqg== dependencies: create-hash "^1.1.2" create-hmac "^1.1.4" @@ -7186,63 +6897,6 @@ prop-types@^15.7.2: object-assign "^4.1.1" react-is "^16.8.1" -protobufjs@6.10.1: - version "6.10.1" - resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-6.10.1.tgz#e6a484dd8f04b29629e9053344e3970cccf13cd2" - integrity sha512-pb8kTchL+1Ceg4lFd5XUpK8PdWacbvV5SK2ULH2ebrYtl4GjJmS24m6CKME67jzV53tbJxHlnNOSqQHbTsR9JQ== - 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" - -protobufjs@^6.8.8: - version "6.11.2" - resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-6.11.2.tgz#de39fabd4ed32beaa08e9bb1e30d08544c1edf8b" - integrity sha512-4BQJoPooKJl2G9j3XftkIXjoC9C0Av2NOrWmbLWT1vH32GcSUHjM0Arra6UfTsVyfMAuFzaLucXn1sadxJydAw== - 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" - -protobufjs@~6.10.2: - version "6.10.2" - resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-6.10.2.tgz#b9cb6bd8ec8f87514592ba3fdfd28e93f33a469b" - integrity sha512-27yj+04uF6ya9l+qfpH187aqEzfCF4+Uit0I9ZBQVqK09hk/SQzKa2MUqUpXaVa7LOFRg1TSSr3lVxGOk6c0SQ== - 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" - psl@^1.1.28: version "1.7.0" resolved "https://registry.yarnpkg.com/psl/-/psl-1.7.0.tgz#f1c4c47a8ef97167dea5d6bbf4816d736e884a3c" @@ -7289,7 +6943,7 @@ querystringify@^2.1.1: resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-2.2.0.tgz#3345941b4153cb9d082d8eee4cda2016a9aef7f6" integrity sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ== -randombytes@2.1.0, randombytes@^2.0.1, randombytes@^2.1.0: +randombytes@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== @@ -7427,11 +7081,6 @@ readdirp@~3.5.0: dependencies: picomatch "^2.2.1" -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== - rechoir@^0.6.2: version "0.6.2" resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384" @@ -7729,10 +7378,10 @@ ripple-lib-transactionparser@0.8.2: bignumber.js "^9.0.0" lodash "^4.17.15" -ripple-lib@1.9.6: - version "1.9.6" - resolved "https://registry.yarnpkg.com/ripple-lib/-/ripple-lib-1.9.6.tgz#c3c071390597effc0ec191e22c9575108cd795f8" - integrity sha512-EJlbOWIqO8nDzHr/oO+/n7RvwGYAilRJPK/iwZjxPp5o+jNEBdHz1uVleAobasXS4tiVfBBDUP0nfhsxvluOWQ== +ripple-lib@1.9.5: + version "1.9.5" + resolved "https://registry.yarnpkg.com/ripple-lib/-/ripple-lib-1.9.5.tgz#6238c8869cc1353add3c8000016fabb6a1e72afe" + integrity sha512-de5lhHimuBM1TqtWNEobUDOToXK1VoB+svP9kvb8xy9cBRza5/kWWAR7FkQ2e1kPNXMR6G51HNPfTattCb9T9g== dependencies: "@types/lodash" "^4.14.136" "@types/ws" "^7.2.0" @@ -7764,20 +7413,13 @@ rxjs-compat@^6.6.7: resolved "https://registry.yarnpkg.com/rxjs-compat/-/rxjs-compat-6.6.7.tgz#6eb4ef75c0a58ea672854a701ccc8d49f41e69cb" integrity sha512-szN4fK+TqBPOFBcBcsR0g2cmTTUF/vaFEOZNuSdfU8/pGFnNmmn2u8SystYXG1QMrjOPBc6XTKHMVfENDf6hHw== -rxjs@6: +rxjs@6, rxjs@^6.6.6: version "6.6.7" resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.7.tgz#90ac018acabf491bf65044235d5863c4dab804c9" integrity sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ== dependencies: tslib "^1.9.0" -rxjs@^7.2.0: - version "7.2.0" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.2.0.tgz#5cd12409639e9514a71c9f5f9192b2c4ae94de31" - integrity sha512-aX8w9OpKrQmiPKfT1bqETtUr9JygIz6GZ+gql8v7CijClsP0laoFUdKzxFAoWuRdSlOdU2+crss+cMf+cqMTnw== - dependencies: - tslib "~2.1.0" - safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@~5.2.0: version "5.2.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" @@ -7845,7 +7487,7 @@ scryptsy@^2.1.0: resolved "https://registry.yarnpkg.com/scryptsy/-/scryptsy-2.1.0.tgz#8d1e8d0c025b58fdd25b6fa9a0dc905ee8faa790" integrity sha512-1CdSqHQowJBnMAFyPEBRfqag/YP9OF394FV+4YREIJX4ljD7OxvQRDayyoyyCk+senRjSkP6VnUNQmVQqB6g7w== -secp256k1@4.0.2, secp256k1@^4.0.1, secp256k1@^4.0.2: +secp256k1@^4.0.1, secp256k1@^4.0.2: version "4.0.2" resolved "https://registry.yarnpkg.com/secp256k1/-/secp256k1-4.0.2.tgz#15dd57d0f0b9fdb54ac1fa1694f40e5e9a54f4a1" integrity sha512-UDar4sKvWAksIlfX3xIaQReADn+WFnHvbVujpcbr+9Sf/69odMwy2MUsz5CKLQgX9nsIyrjuxL2imVyoNHa3fg== @@ -8180,9 +7822,9 @@ stellar-base@^5.2.1: sodium-native "^2.3.0" stellar-sdk@^8.2.2: - version "8.2.3" - resolved "https://registry.yarnpkg.com/stellar-sdk/-/stellar-sdk-8.2.3.tgz#2970211877937e487b4e1f88021200cf0ddf8603" - integrity sha512-RlrR6DD+706vgA1iVDXteU/x3bdqFDthf+4M3C19D/owmF0GCR/FoRQpnPqqRJ0C/rbbdZ6YjAyKO6Q0GSbDWw== + version "8.2.2" + resolved "https://registry.yarnpkg.com/stellar-sdk/-/stellar-sdk-8.2.2.tgz#fd52bbf09992a60c38548c4ca97d9e14e98bab82" + integrity sha512-TCE69NV1/sZXfwGO3a7aGoskR/9Src7JNZMOli8jO8wTWi+JOzMhJi/SLj3qHp6xvMKI4Oonqz5HiRf0b0fsSQ== dependencies: "@types/eventsource" "^1.1.2" "@types/node" ">= 8" @@ -8402,11 +8044,6 @@ symbol-observable@1.0.4: resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.0.4.tgz#29bf615d4aa7121bdd898b22d4b3f9bc4e2aa03d" integrity sha1-Kb9hXUqnEhvdiYsi1LP5vE4qoD0= -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== - symbol-tree@^3.2.4: version "3.2.4" resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2" @@ -8479,17 +8116,6 @@ timemachine@^0.3.2: resolved "https://registry.yarnpkg.com/timemachine/-/timemachine-0.3.2.tgz#83c594d0271c3608d5fab13636cd3b7c979ea2c5" integrity sha512-JNKeKZXQJc8UC19JcIq0XziBud+fNNJfatZ57lwk+o1O9mpW2FmzWvRw7FTTOKuN6M0zsjGIlNi0O0QrF5WVRA== -tiny-secp256k1@^1.1.3: - version "1.1.6" - resolved "https://registry.yarnpkg.com/tiny-secp256k1/-/tiny-secp256k1-1.1.6.tgz#7e224d2bee8ab8283f284e40e6b4acb74ffe047c" - integrity sha512-FmqJZGduTyvsr2cF3375fqGHUovSwDi/QytexX1Se4BPuPZpTE5Ftp5fg+EFSuEf3lhZqgCRjEG3ydUQ/aNiwA== - dependencies: - bindings "^1.3.0" - bn.js "^4.11.8" - create-hmac "^1.1.7" - elliptic "^6.4.0" - nan "^2.13.2" - tmpl@1.0.x: version "1.0.4" resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.4.tgz#23640dd7b42d00433911140820e5cf440e521dd1" @@ -8586,11 +8212,6 @@ tslib@^1.10.0, tslib@^1.9.0: resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== -tslib@~2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.1.0.tgz#da60860f1c2ecaa5703ab7d39bc05b6bf988b97a" - integrity sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A== - tunnel-agent@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" @@ -8632,11 +8253,6 @@ type-detect@4.0.8: resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== -type-fest@^0.11.0: - version "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.20.2: version "0.20.2" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4" @@ -8659,11 +8275,6 @@ typedarray-to-buffer@3.1.5, typedarray-to-buffer@^3.1.5: dependencies: is-typedarray "^1.0.0" -typeforce@^1.11.5: - version "1.18.0" - resolved "https://registry.yarnpkg.com/typeforce/-/typeforce-1.18.0.tgz#d7416a2c5845e085034d70fcc5b6cc4a90edbfdc" - integrity sha512-7uc1O8h1M1g0rArakJdf0uLRSSgFcYexrVoKo+bzJd32gd4gDy2L/Z+8/FjPnU9ydY3pEnVPtr9FyscYY60K1g== - typescript-compiler@^1.4.1-2: version "1.4.1-2" resolved "https://registry.yarnpkg.com/typescript-compiler/-/typescript-compiler-1.4.1-2.tgz#ba4f7db22d91534a1929d90009dce161eb72fd3f" @@ -8969,13 +8580,6 @@ which@^2.0.1, which@^2.0.2: dependencies: isexe "^2.0.0" -wif@^2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/wif/-/wif-2.0.6.tgz#08d3f52056c66679299726fade0d432ae74b4704" - integrity sha1-CNP1IFbGZnkplyb63g1DKudLRwQ= - dependencies: - bs58check "<3.0.0" - window-getters@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/window-getters/-/window-getters-1.0.0.tgz#b5b264538c4c79cead027f9997850222bf6d0852" @@ -9060,15 +8664,20 @@ write-file-atomic@^3.0.0: signal-exit "^3.0.2" typedarray-to-buffer "^3.1.5" +ws@7.2.3: + version "7.2.3" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.2.3.tgz#a5411e1fb04d5ed0efee76d26d5c46d830c39b46" + integrity sha512-HTDl9G9hbkNDk98naoR/cHDws7+EyYMOdL1BmjsZXRUjf7d+MficC4B7HLUPlSiho0vg+CWKrGIt/VJBd1xunQ== + ws@7.3.0: version "7.3.0" resolved "https://registry.yarnpkg.com/ws/-/ws-7.3.0.tgz#4b2f7f219b3d3737bc1a2fbf145d825b94d38ffd" integrity sha512-iFtXzngZVXPGgpTlP1rBqsUK82p9tKqsWRPg5L56egiljujJT3vGAYnHANvFxBieXrTFavhzhxW52jnaWV+w2w== -ws@7.4.6, ws@^7, ws@^7.2.0, ws@^7.2.3: - version "7.4.6" - resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.6.tgz#5654ca8ecdeee47c33a9a4bf6d28e2be2980377c" - integrity sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A== +ws@^7.2.0, ws@^7.2.3: + version "7.3.1" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.3.1.tgz#d0547bf67f7ce4f12a72dfe31262c68d7dc551c8" + integrity sha512-D3RuNkynyHmEJIpD2qrgVkc9DQ23OrN/moAwZX4L8DfvszsJxpjQuUq3LMx6HoYji9fbIOBY18XWBsAux1ZZUA== xml-name-validator@^3.0.0: version "3.0.0" @@ -9080,18 +8689,10 @@ xmlchars@^2.2.0: resolved "https://registry.yarnpkg.com/xmlchars/-/xmlchars-2.2.0.tgz#060fe1bcb7f9c76fe2a17db86a9bc3ab894210cb" integrity sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw== -xstate@^4.22.0: - version "4.22.0" - resolved "https://registry.yarnpkg.com/xstate/-/xstate-4.22.0.tgz#5d6c2a762cb94c3170ee826d26194b7561d70aae" - integrity sha512-WBQS/XxmjCH6789fx5JXjct2pWA0ZI0a1Kx8PJMurzgytkJH3vC2+QganHWzK38vG9PyXHefyVG54UN5q6YVSw== - -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" +xstate@^4.20.0: + version "4.20.0" + resolved "https://registry.yarnpkg.com/xstate/-/xstate-4.20.0.tgz#6f241f2b49c840cb6e05b32544a6048362f558e2" + integrity sha512-u5Ou1CMo/oWApasmv1TYTHgj38k69DJdTqQdBBwt+/ooNhPJQiSIKTB3Y3HvX0h5tulwfSo6xAwZgBgjRsK3LA== xxhashjs@^0.2.2: version "0.2.2" From 21d0b832c597956a0916180a699863b5cb01b9c8 Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Mon, 19 Jul 2021 13:47:23 +0300 Subject: [PATCH 021/127] fix ledger infinite sync on first account --- src/families/elrond/hw-app-elrond/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/families/elrond/hw-app-elrond/index.js b/src/families/elrond/hw-app-elrond/index.js index 1f1cc4e018..bf0440a805 100644 --- a/src/families/elrond/hw-app-elrond/index.js +++ b/src/families/elrond/hw-app-elrond/index.js @@ -69,7 +69,7 @@ export default class Elrond { const buf = Buffer.alloc(8); buf.writeUInt32BE(path[3], 0); - buf.writeUInt32BE(path[4], 4); + buf.writeUInt32BE(path[2], 4); return buf; } From ecb5f9db857882e31eecf8c2e388ea8f600c911b Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Thu, 29 Jul 2021 10:04:57 +0300 Subject: [PATCH 022/127] remove elrond specific errors, use ledger errors instead --- src/families/elrond/errors.js | 9 --------- src/families/elrond/js-getTransactionStatus.js | 6 ++---- 2 files changed, 2 insertions(+), 13 deletions(-) delete mode 100644 src/families/elrond/errors.js diff --git a/src/families/elrond/errors.js b/src/families/elrond/errors.js deleted file mode 100644 index f152bf6227..0000000000 --- a/src/families/elrond/errors.js +++ /dev/null @@ -1,9 +0,0 @@ -// @flow -import { createCustomErrorClass } from "@ledgerhq/errors"; - -/** - * Elrond error thrown on a specifc check done on a transaction recipient and sender address - */ -export const ElrondSelfTransactionError = createCustomErrorClass( - "ElrondSelfTransactionError" -); diff --git a/src/families/elrond/js-getTransactionStatus.js b/src/families/elrond/js-getTransactionStatus.js index b879e405e5..72ed0e1ca7 100644 --- a/src/families/elrond/js-getTransactionStatus.js +++ b/src/families/elrond/js-getTransactionStatus.js @@ -5,11 +5,11 @@ import { RecipientRequired, InvalidAddress, FeeNotLoaded, + InvalidAddressBecauseDestinationIsAlsoSource, } from "@ledgerhq/errors"; import type { Account, TransactionStatus } from "../../types"; import type { Transaction } from "./types"; import { isValidAddress, isSelfTransaction } from "./logic"; -import { ElrondSelfTransactionError } from "./errors"; const getTransactionStatus = async ( a: Account, @@ -24,9 +24,7 @@ const getTransactionStatus = async ( } if (isSelfTransaction(a, t)) { - errors.recipient = new ElrondSelfTransactionError( - "Recipient address is the same as the sender!" - ); + errors.recipient = new InvalidAddressBecauseDestinationIsAlsoSource(); } if (!isValidAddress(t.recipient)) { From 4e990771eec3cf68b7a8864b6b9ba7983ba234d1 Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Thu, 29 Jul 2021 10:06:30 +0300 Subject: [PATCH 023/127] typo in nonce display --- src/families/elrond/account.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/families/elrond/account.js b/src/families/elrond/account.js index 9ed25b1349..cf3304fe12 100644 --- a/src/families/elrond/account.js +++ b/src/families/elrond/account.js @@ -25,7 +25,7 @@ function formatAccountSpecifics(account: Account): string { } if (elrondResources.nonce) { - str += "\nonce : " + elrondResources.nonce; + str += "\n nonce : " + elrondResources.nonce; } return str; From d1cf9c1fa40f490f48aee69d797d73836a4952d8 Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Thu, 29 Jul 2021 10:09:52 +0300 Subject: [PATCH 024/127] use METACHAIN_SHARD constant --- src/families/elrond/api/apiCalls.js | 8 ++++++-- src/families/elrond/constants.js | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/families/elrond/api/apiCalls.js b/src/families/elrond/api/apiCalls.js index 66f3bd355e..9f346e744c 100644 --- a/src/families/elrond/api/apiCalls.js +++ b/src/families/elrond/api/apiCalls.js @@ -1,5 +1,9 @@ import network from "../../../network"; -import { HASH_TRANSACTION, RAW_TRANSACTION } from "../constants"; +import { + HASH_TRANSACTION, + RAW_TRANSACTION, + METACHAIN_SHARD, +} from "../constants"; export default class ElrondApi { constructor(API_URL: String) { @@ -114,7 +118,7 @@ export default class ElrondApi { data: [{ nonce: blockHeight }], } = await network({ method: "GET", - url: `${this.API_URL}/blocks?shard=4294967295&fields=nonce`, + url: `${this.API_URL}/blocks?shard=${METACHAIN_SHARD}&fields=nonce`, }); return blockHeight; diff --git a/src/families/elrond/constants.js b/src/families/elrond/constants.js index 1b9c5a966c..e1f51e8694 100644 --- a/src/families/elrond/constants.js +++ b/src/families/elrond/constants.js @@ -7,3 +7,5 @@ export const RAW_TRANSACTION = { version: 1, options: 0, }; + +export const METACHAIN_SHARD = 4294967295; From 50e448c901fa7d1aa0708755b2d69b31955416b8 Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Thu, 29 Jul 2021 10:11:39 +0300 Subject: [PATCH 025/127] unnecessary ELROND_API_ENDPOINT constant --- src/families/elrond/api/sdk.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/families/elrond/api/sdk.js b/src/families/elrond/api/sdk.js index dadf8fc6ac..57f68c8d6e 100644 --- a/src/families/elrond/api/sdk.js +++ b/src/families/elrond/api/sdk.js @@ -7,9 +7,7 @@ import type { Operation, OperationType } from "../../../types"; import { getEnv } from "../../../env"; import { encodeOperationId } from "../../../operation"; -const ELROND_API_ENDPOINT = () => getEnv("ELROND_API_ENDPOINT"); - -let api = new ElrondApi(ELROND_API_ENDPOINT()); +let api = new ElrondApi(getEnv("ELROND_API_ENDPOINT")); /** * Get account balances and nonce From 1d4c4768713797cd19ce0e22520a108b7bdf2c79 Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Thu, 29 Jul 2021 10:24:35 +0300 Subject: [PATCH 026/127] broadcast instead of submit transaction --- src/families/elrond/api/index.js | 2 +- src/families/elrond/api/sdk.js | 2 +- src/families/elrond/js-broadcast.js | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/families/elrond/api/index.js b/src/families/elrond/api/index.js index 39b8612dcd..65398ce1f9 100644 --- a/src/families/elrond/api/index.js +++ b/src/families/elrond/api/index.js @@ -4,5 +4,5 @@ export { getValidators, getOperations, getFees, - submitTransaction, + broadcastTransaction, } from "./sdk"; diff --git a/src/families/elrond/api/sdk.js b/src/families/elrond/api/sdk.js index 57f68c8d6e..6db2cc457a 100644 --- a/src/families/elrond/api/sdk.js +++ b/src/families/elrond/api/sdk.js @@ -124,7 +124,7 @@ export const getFees = async (unsigned): Promise => { /** * Broadcast blob to blockchain */ -export const submitTransaction = async (blob: string) => { +export const broadcastTransaction = async (blob: string) => { const { hash } = await api.submit(blob); // Transaction hash is likely to be returned diff --git a/src/families/elrond/js-broadcast.js b/src/families/elrond/js-broadcast.js index 1b067270a1..855373a0c0 100644 --- a/src/families/elrond/js-broadcast.js +++ b/src/families/elrond/js-broadcast.js @@ -2,7 +2,7 @@ import type { Operation, SignedOperation } from "../../types"; import { patchOperationWithHash } from "../../operation"; -import { submitTransaction } from "./api"; +import { broadcastTransaction } from "./api"; /** * Broadcast the signed transaction @@ -17,7 +17,7 @@ const broadcast = async ({ extra: { signUsingHash }, } = operation; - const { hash } = await submitTransaction({ + const { hash } = await broadcastTransaction({ operation, signature, signUsingHash, From a1b3b2babe75c1db1de2588a8c439aad87b129b0 Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Thu, 29 Jul 2021 10:33:25 +0300 Subject: [PATCH 027/127] use cache mechanism for transaction network config --- src/families/elrond/api/sdk.js | 3 ++- src/families/elrond/cache.js | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 src/families/elrond/cache.js diff --git a/src/families/elrond/api/sdk.js b/src/families/elrond/api/sdk.js index 6db2cc457a..c1d6828059 100644 --- a/src/families/elrond/api/sdk.js +++ b/src/families/elrond/api/sdk.js @@ -6,6 +6,7 @@ import type { Transaction } from "../types"; import type { Operation, OperationType } from "../../../types"; import { getEnv } from "../../../env"; import { encodeOperationId } from "../../../operation"; +import { getTransactionParams } from "../cache"; let api = new ElrondApi(getEnv("ELROND_API_ENDPOINT")); @@ -113,7 +114,7 @@ export const getOperations = async ( */ export const getFees = async (unsigned): Promise => { const { data } = unsigned; - const { gasLimit, gasPerByte, gasPrice } = await api.getNetworkConfig(); + const { gasLimit, gasPerByte, gasPrice } = await getTransactionParams(); if (!data) { return BigNumber(gasLimit * gasPrice); diff --git a/src/families/elrond/cache.js b/src/families/elrond/cache.js new file mode 100644 index 0000000000..ca11233251 --- /dev/null +++ b/src/families/elrond/cache.js @@ -0,0 +1,18 @@ +import { makeLRUCache } from "../../cache"; +import type { CacheRes } from "../../cache"; +import { getNetworkConfig } from "./api"; +/** + * Cache the getTransactionInfo for fees estimation to avoid multiple calls during 5 minutes. + * Should be force refresh when signing operation. + * + * @param {Account} account + * + * @returns {Promise} txInfo + */ +export const getTransactionParams: CacheRes, Object> = makeLRUCache( + async (): Promise => getNetworkConfig(), + () => "elrond", + { + maxAge: 5 * 60 * 1000, // 5 minutes + } +); From c458dc7aec779a78ad3c4053b288ebc7b2d2b578 Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Thu, 29 Jul 2021 10:42:44 +0300 Subject: [PATCH 028/127] address validation using bech32 decode --- src/families/elrond/logic.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/families/elrond/logic.js b/src/families/elrond/logic.js index de2d9f7be0..7766328387 100644 --- a/src/families/elrond/logic.js +++ b/src/families/elrond/logic.js @@ -2,6 +2,7 @@ import type { Account } from "../../types"; import { getNetworkConfig } from "./api"; import type { Transaction } from "./types"; +import { bech32 } from "bech32"; export const compareVersions = (versionA: string, versionB: string): number => { let i, diff; @@ -32,13 +33,20 @@ export const compareVersions = (versionA: string, versionB: string): number => { * @param {string} address */ export const isValidAddress = (address: string): boolean => { - if (!address) return false; + // if (!address) return false; - if (!address.startsWith("erd1")) return false; + // if (!address.startsWith("erd1")) return false; - if (address.length !== 62) return false; + // if (address.length !== 62) return false; - return true; + try { + bech32.decode(address, 256); + return true; + } catch (erro) { + return false; + } + + // return true; }; export const isSelfTransaction = (a: Account, t: Transaction): boolean => { From 413d21c7ebcbf7e471e7ce05e6d76767a73b86d1 Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Thu, 29 Jul 2021 10:43:36 +0300 Subject: [PATCH 029/127] remove unnecessary getNetworkConfigs from logic --- src/families/elrond/js-buildTransaction.js | 5 +++-- src/families/elrond/logic.js | 4 ---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/families/elrond/js-buildTransaction.js b/src/families/elrond/js-buildTransaction.js index 2669c8c304..4ca707242b 100644 --- a/src/families/elrond/js-buildTransaction.js +++ b/src/families/elrond/js-buildTransaction.js @@ -2,7 +2,8 @@ import type { Transaction } from "./types"; import type { Account } from "../../types"; -import { getNonce, getNetworkConfigs } from "./logic"; +import { getNonce } from "./logic"; +import { getNetworkConfig } from "./api"; import { HASH_TRANSACTION, RAW_TRANSACTION } from "./constants"; @@ -18,7 +19,7 @@ export const buildTransaction = async ( ) => { const address = a.freshAddress; const nonce = getNonce(a); - const { gasPrice, gasLimit, chainId } = await getNetworkConfigs(); + const { gasPrice, gasLimit, chainId } = await getNetworkConfig(); const transactionType = signUsingHash ? HASH_TRANSACTION : RAW_TRANSACTION; const unsigned = { diff --git a/src/families/elrond/logic.js b/src/families/elrond/logic.js index 7766328387..3221ead517 100644 --- a/src/families/elrond/logic.js +++ b/src/families/elrond/logic.js @@ -70,7 +70,3 @@ export const getNonce = (a: Account): number => { return nonce; }; - -export const getNetworkConfigs = async () => { - return await getNetworkConfig(); -}; From 2c5cc91e7e613d0424928ea39f2e6219f6803da8 Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Thu, 29 Jul 2021 11:10:54 +0300 Subject: [PATCH 030/127] use erdjs for address validation --- src/families/elrond/logic.js | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/src/families/elrond/logic.js b/src/families/elrond/logic.js index 3221ead517..c4253af9b3 100644 --- a/src/families/elrond/logic.js +++ b/src/families/elrond/logic.js @@ -1,8 +1,6 @@ -// @flow import type { Account } from "../../types"; -import { getNetworkConfig } from "./api"; import type { Transaction } from "./types"; -import { bech32 } from "bech32"; +import { Address } from "@elrondnetwork/erdjs"; export const compareVersions = (versionA: string, versionB: string): number => { let i, diff; @@ -33,20 +31,12 @@ export const compareVersions = (versionA: string, versionB: string): number => { * @param {string} address */ export const isValidAddress = (address: string): boolean => { - // if (!address) return false; - - // if (!address.startsWith("erd1")) return false; - - // if (address.length !== 62) return false; - try { - bech32.decode(address, 256); + new Address(address); return true; - } catch (erro) { + } catch (error) { return false; } - - // return true; }; export const isSelfTransaction = (a: Account, t: Transaction): boolean => { From 1792802fbb65cce7f619ee47085fb062a960bbc7 Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Thu, 29 Jul 2021 11:12:35 +0300 Subject: [PATCH 031/127] install @elrondnetwork/erdjs --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 42bdeb7eb1..bbc8a999db 100644 --- a/package.json +++ b/package.json @@ -69,8 +69,9 @@ "react-redux": "7" }, "dependencies": { + "@elrondnetwork/erdjs": "^6.5.1", "@ledgerhq/compressjs": "1.3.2", - "@ledgerhq/cryptoassets": "6.0.2", + "@ledgerhq/cryptoassets": "^6.2.0", "@ledgerhq/devices": "6.0.2", "@ledgerhq/errors": "6.0.2", "@ledgerhq/hw-app-algorand": "6.0.2", From 57294b47d9c1c6aef6a3101455b99c3ef79a5d04 Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Thu, 29 Jul 2021 11:48:41 +0300 Subject: [PATCH 032/127] add tests for elrond transactions --- src/families/elrond/test-dataset.js | 79 ++++++++++++++++++++++++++--- 1 file changed, 72 insertions(+), 7 deletions(-) diff --git a/src/families/elrond/test-dataset.js b/src/families/elrond/test-dataset.js index f340f6b9a0..7768007d07 100644 --- a/src/families/elrond/test-dataset.js +++ b/src/families/elrond/test-dataset.js @@ -1,5 +1,6 @@ // @flow import type { DatasetTest } from "../../types"; +import { fromTransactionRaw } from "../elrond/transaction"; import type { Transaction } from "./types"; type TestTransaction = { @@ -13,18 +14,20 @@ type TestTransaction = { }; export default dataset = { - implementations: ["js"], + implementations: ["mock", "js"], currencies: { elrond: { scanAccounts: [ { name: "elrond seed 1", apdus: ` - => ed030000080000000000000000 - <= 3e65726431726e71376d386b6472707966616e793466776571747964736b34706778306c3664746c367476636164357765736167727578747336326539726b9000 - => ed030000080000000000000000 - <= 3e65726431726e71376d386b6472707966616e793466776571747964736b34706778306c3664746c367476636164357765736167727578747336326539726b9000 - `, + => ed030000080000000000000000 + <= 3e6572643176676670336737617a716a783477736d7474373036376d306c3632763370736d717a7232346a36787679776a32746c7a3067657376797a7371329000 + => ed030000080000000080000000 + <= 3e6572643176676670336737617a716a783477736d7474373036376d306c3632763370736d717a7232346a36787679776a32746c7a3067657376797a7371329000 + => ed030000080000000080000001 + <= 3e65726431706d33676a65326c6d643576796c6463767579366a7078676465347261706a70756a76756a6b65653661376a77327a6d6834747172653739367a9000 + `, }, ], accounts: [ @@ -49,7 +52,69 @@ export default dataset = { balance: "299569965", }, transactions: [ - // HERE WE WILL INSERT OUR test + { + name: "recipient and sender must not be the same", + transaction: fromTransactionRaw({ + family: "elrond", + recipient: + "erd1rnq7m8kdrpyfany4fweqtydsk4pgx0l6dtl6tvcad5wesagruxts62e9rk", + amount: "100000000", + mode: "send", + era: null, + validators: [], + fees: null, + rewardDestination: null, + numSlashingSpans: 0, + }), + expectedStatus: { + amount: BigNumber("100000000"), + errors: { + recipient: new InvalidAddressBecauseDestinationIsAlsoSource(), + }, + warnings: {}, + }, + }, + { + name: "Not a valid address", + transaction: fromTransactionRaw({ + family: "elrond", + recipient: "elrondinv", + amount: "100000000", + mode: "send", + era: null, + validators: [], + fees: null, + rewardDestination: null, + numSlashingSpans: 0, + }), + expectedStatus: { + errors: { + recipient: new InvalidAddress(), + }, + warnings: {}, + }, + }, + { + name: "Not enough balance", + transaction: fromTransactionRaw({ + family: "elrond", + recipient: + "erd1frj909pfums4m8aza596595l9pl56crwdj077vs2aqcw6ynl28wsfkw9rd", + amount: "1000000000000000", + mode: "send", + era: null, + validators: [], + fees: null, + rewardDestination: null, + numSlashingSpans: 0, + }), + expectedStatus: { + errors: { + amount: new NotEnoughBalance(), + }, + warnings: {}, + }, + }, ], }, ], From 15b9cb0815280222014d7c9e9e4915852c5b2ca1 Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Thu, 29 Jul 2021 15:23:42 +0300 Subject: [PATCH 033/127] add elrond to test setup --- src/__tests__/test-helpers/setup.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/__tests__/test-helpers/setup.js b/src/__tests__/test-helpers/setup.js index 6dbac777d5..3b6fc318d5 100644 --- a/src/__tests__/test-helpers/setup.js +++ b/src/__tests__/test-helpers/setup.js @@ -5,6 +5,7 @@ jest.setTimeout(180000); setSupportedCurrencies([ "bitcoin", "ethereum", + "elrond", "ripple", "bitcoin_cash", "litecoin", From 01f1e2c7816af6e0ff98215b2aacf23122213b8c Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Thu, 29 Jul 2021 15:35:22 +0300 Subject: [PATCH 034/127] small fixes to test-dataset --- src/families/elrond/test-dataset.js | 34 +++++++++-------------------- 1 file changed, 10 insertions(+), 24 deletions(-) diff --git a/src/families/elrond/test-dataset.js b/src/families/elrond/test-dataset.js index 7768007d07..62541df065 100644 --- a/src/families/elrond/test-dataset.js +++ b/src/families/elrond/test-dataset.js @@ -1,19 +1,15 @@ // @flow -import type { DatasetTest } from "../../types"; import { fromTransactionRaw } from "../elrond/transaction"; +import { BigNumber } from "bignumber.js"; +import { + InvalidAddressBecauseDestinationIsAlsoSource, + NotEnoughBalance, + InvalidAddress, +} from "@ledgerhq/errors"; +import type { DatasetTest } from "../../types"; import type { Transaction } from "./types"; -type TestTransaction = { - name: string, - transaction: Transaction, - expectedStatus: { - amount: BigNumber, - errors: {}, - warnings: {}, - }, -}; - -export default dataset = { +const dataset: DatasetTest = { implementations: ["mock", "js"], currencies: { elrond: { @@ -60,11 +56,7 @@ export default dataset = { "erd1rnq7m8kdrpyfany4fweqtydsk4pgx0l6dtl6tvcad5wesagruxts62e9rk", amount: "100000000", mode: "send", - era: null, - validators: [], fees: null, - rewardDestination: null, - numSlashingSpans: 0, }), expectedStatus: { amount: BigNumber("100000000"), @@ -81,11 +73,7 @@ export default dataset = { recipient: "elrondinv", amount: "100000000", mode: "send", - era: null, - validators: [], fees: null, - rewardDestination: null, - numSlashingSpans: 0, }), expectedStatus: { errors: { @@ -102,11 +90,7 @@ export default dataset = { "erd1frj909pfums4m8aza596595l9pl56crwdj077vs2aqcw6ynl28wsfkw9rd", amount: "1000000000000000", mode: "send", - era: null, - validators: [], fees: null, - rewardDestination: null, - numSlashingSpans: 0, }), expectedStatus: { errors: { @@ -121,3 +105,5 @@ export default dataset = { }, }, }; + +export default dataset; From fa5751346497a2fb57a04931fd75434dea1c836e Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Thu, 29 Jul 2021 18:49:48 +0300 Subject: [PATCH 035/127] remove mock implementations --- src/families/elrond/test-dataset.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/families/elrond/test-dataset.js b/src/families/elrond/test-dataset.js index 62541df065..d737ae85bb 100644 --- a/src/families/elrond/test-dataset.js +++ b/src/families/elrond/test-dataset.js @@ -10,7 +10,7 @@ import type { DatasetTest } from "../../types"; import type { Transaction } from "./types"; const dataset: DatasetTest = { - implementations: ["mock", "js"], + implementations: ["js"], currencies: { elrond: { scanAccounts: [ @@ -71,7 +71,7 @@ const dataset: DatasetTest = { transaction: fromTransactionRaw({ family: "elrond", recipient: "elrondinv", - amount: "100000000", + amount: BigNumber("100000000"), mode: "send", fees: null, }), @@ -88,7 +88,7 @@ const dataset: DatasetTest = { family: "elrond", recipient: "erd1frj909pfums4m8aza596595l9pl56crwdj077vs2aqcw6ynl28wsfkw9rd", - amount: "1000000000000000", + amount: BigNumber("1000000000000000"), mode: "send", fees: null, }), From a56c2cc98c1216aa22793defdb1820f93c30793c Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Thu, 29 Jul 2021 18:50:28 +0300 Subject: [PATCH 036/127] elrond seeds for tests --- .../__snapshots__/all.libcore.js.snap | 125 ++++++++++++++++++ 1 file changed, 125 insertions(+) diff --git a/src/__tests__/__snapshots__/all.libcore.js.snap b/src/__tests__/__snapshots__/all.libcore.js.snap index 09758237c1..ca5d8ef970 100644 --- a/src/__tests__/__snapshots__/all.libcore.js.snap +++ b/src/__tests__/__snapshots__/all.libcore.js.snap @@ -21169,6 +21169,131 @@ Array [ ] `; +exports[`elrond currency bridge scanAccounts elrond seed 1 1`] = ` +Array [ + Object { + "balance": "0", + "currencyId": "elrond", + "derivationMode": "", + "elrondResources": Object { + "nonce": 2, + }, + "freshAddress": "erd1vgfp3g7azqjx4wsmtt7067m0l62v3psmqzr24j6xvywj2tlz0gesvyzsq2", + "freshAddressPath": "44'/508'/0'/0/0", + "freshAddresses": Array [ + Object { + "address": "erd1vgfp3g7azqjx4wsmtt7067m0l62v3psmqzr24j6xvywj2tlz0gesvyzsq2", + "derivationPath": "44'/508'/0'/0/0", + }, + ], + "id": "js:2:elrond:erd1vgfp3g7azqjx4wsmtt7067m0l62v3psmqzr24j6xvywj2tlz0gesvyzsq2:", + "index": 0, + "name": "Elrond 1", + "operationsCount": 3, + "pendingOperations": Array [], + "seedIdentifier": undefined, + "spendableBalance": "0", + "starred": false, + "swapHistory": Array [], + "syncHash": undefined, + "unitMagnitude": 18, + "used": true, + }, + Object { + "balance": "0", + "currencyId": "elrond", + "derivationMode": "", + "elrondResources": Object { + "nonce": 0, + }, + "freshAddress": "erd1pm3gje2lmd5vyldcvuy6jpxgde4rapjpujvujkee6a7jw2zmh4tqre796z", + "freshAddressPath": "44'/508'/1'/0/0", + "freshAddresses": Array [ + Object { + "address": "erd1pm3gje2lmd5vyldcvuy6jpxgde4rapjpujvujkee6a7jw2zmh4tqre796z", + "derivationPath": "44'/508'/1'/0/0", + }, + ], + "id": "js:2:elrond:erd1pm3gje2lmd5vyldcvuy6jpxgde4rapjpujvujkee6a7jw2zmh4tqre796z:", + "index": 1, + "name": "Elrond 2", + "operationsCount": 0, + "pendingOperations": Array [], + "seedIdentifier": undefined, + "spendableBalance": "0", + "starred": false, + "swapHistory": Array [], + "syncHash": undefined, + "unitMagnitude": 18, + "used": false, + }, +] +`; + +exports[`elrond currency bridge scanAccounts elrond seed 1 2`] = ` +Array [ + Array [ + Object { + "accountId": "js:2:elrond:erd1vgfp3g7azqjx4wsmtt7067m0l62v3psmqzr24j6xvywj2tlz0gesvyzsq2:", + "blockHash": "ca620c947a18265d839707d746fc5f43aac4e0bbe058afbfd3fce54ad2add5b7", + "blockHeight": 4994858, + "extra": undefined, + "fee": "50000000000000", + "hasFailed": false, + "hash": "976d34a592aa5421a19c05fb68463ee3bf35801a8ada608f023843f0c9b0e07b", + "id": "js:2:elrond:erd1vgfp3g7azqjx4wsmtt7067m0l62v3psmqzr24j6xvywj2tlz0gesvyzsq2:-976d34a592aa5421a19c05fb68463ee3bf35801a8ada608f023843f0c9b0e07b-OUT", + "recipients": Array [ + "erd1frj909pfums4m8aza596595l9pl56crwdj077vs2aqcw6ynl28wsfkw9rd", + ], + "senders": Array [ + "erd1vgfp3g7azqjx4wsmtt7067m0l62v3psmqzr24j6xvywj2tlz0gesvyzsq2", + ], + "transactionSequenceNumber": 0, + "type": "OUT", + "value": "50000000000000", + }, + Object { + "accountId": "js:2:elrond:erd1vgfp3g7azqjx4wsmtt7067m0l62v3psmqzr24j6xvywj2tlz0gesvyzsq2:", + "blockHash": "7acef750895375ddacaa377586259356e2592fe5f382ad0c8be1495753eec7d8", + "blockHeight": 4994906, + "extra": undefined, + "fee": "50000000000000", + "hasFailed": false, + "hash": "c0615e1eb10ed98fb0e0bcbb28588b3937ff1e5d80cb8ad0112a3380f36dbf6a", + "id": "js:2:elrond:erd1vgfp3g7azqjx4wsmtt7067m0l62v3psmqzr24j6xvywj2tlz0gesvyzsq2:-c0615e1eb10ed98fb0e0bcbb28588b3937ff1e5d80cb8ad0112a3380f36dbf6a-OUT", + "recipients": Array [ + "erd1frj909pfums4m8aza596595l9pl56crwdj077vs2aqcw6ynl28wsfkw9rd", + ], + "senders": Array [ + "erd1vgfp3g7azqjx4wsmtt7067m0l62v3psmqzr24j6xvywj2tlz0gesvyzsq2", + ], + "transactionSequenceNumber": 1, + "type": "OUT", + "value": "9950000000000000", + }, + Object { + "accountId": "js:2:elrond:erd1vgfp3g7azqjx4wsmtt7067m0l62v3psmqzr24j6xvywj2tlz0gesvyzsq2:", + "blockHash": "cf102d2d317c106396601828d63dc6311dd2c903ddf54f23b1f1bbd47731f5a9", + "blockHeight": 4994825, + "extra": undefined, + "fee": "56000000000000", + "hasFailed": false, + "hash": "dbcc80e99b9e45fd4973e5e8a6b283d1df3ace0cd424b7f4dfd59eaac31bd54d", + "id": "js:2:elrond:erd1vgfp3g7azqjx4wsmtt7067m0l62v3psmqzr24j6xvywj2tlz0gesvyzsq2:-dbcc80e99b9e45fd4973e5e8a6b283d1df3ace0cd424b7f4dfd59eaac31bd54d-IN", + "recipients": Array [ + "erd1vgfp3g7azqjx4wsmtt7067m0l62v3psmqzr24j6xvywj2tlz0gesvyzsq2", + ], + "senders": Array [ + "erd1frj909pfums4m8aza596595l9pl56crwdj077vs2aqcw6ynl28wsfkw9rd", + ], + "type": "IN", + "value": "10000000000000000", + }, + ], + Array [], +] +`; + exports[`komodo currency bridge scanAccounts komodo seed 1 1`] = ` Array [ Object { From a3102e016c23d6742dbfb54f11328f895f2051e3 Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Fri, 30 Jul 2021 13:47:27 +0300 Subject: [PATCH 037/127] compute spendable balance --- src/families/elrond/js-estimateMaxSpendable.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/families/elrond/js-estimateMaxSpendable.js b/src/families/elrond/js-estimateMaxSpendable.js index 828cbc833f..e6ba576e33 100644 --- a/src/families/elrond/js-estimateMaxSpendable.js +++ b/src/families/elrond/js-estimateMaxSpendable.js @@ -32,6 +32,10 @@ const estimateMaxSpendable = async ({ const fees = await getEstimatedFees({ a, t }); + if (fees.gt(a.spendableBalance)) { + return BigNumber(0); + } + return a.spendableBalance.minus(fees); }; From b6a61a7efc87f8a52b1a65f021f9d23acdfb3c93 Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Fri, 30 Jul 2021 13:58:14 +0300 Subject: [PATCH 038/127] fees as BigNumber --- src/families/elrond/js-transaction.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/families/elrond/js-transaction.js b/src/families/elrond/js-transaction.js index 8f71c5c2fe..820a73cd2a 100644 --- a/src/families/elrond/js-transaction.js +++ b/src/families/elrond/js-transaction.js @@ -19,7 +19,7 @@ export const createTransaction = (): Transaction => { amount: BigNumber(0), recipient: "", useAllAmount: false, - fees: 50000, + fees: BigNumber(50000), }; }; From 7caf5e62dbfd99adf4bcd2d3fc4d383f4be9fffe Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Fri, 30 Jul 2021 14:01:07 +0300 Subject: [PATCH 039/127] test address with 0 balance --- src/families/elrond/test-dataset.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/families/elrond/test-dataset.js b/src/families/elrond/test-dataset.js index d737ae85bb..9e29046d82 100644 --- a/src/families/elrond/test-dataset.js +++ b/src/families/elrond/test-dataset.js @@ -9,6 +9,9 @@ import { import type { DatasetTest } from "../../types"; import type { Transaction } from "./types"; +const TEST_ADDRESS = + "erd1vgfp3g7azqjx4wsmtt7067m0l62v3psmqzr24j6xvywj2tlz0gesvyzsq2"; + const dataset: DatasetTest = { implementations: ["js"], currencies: { @@ -29,14 +32,12 @@ const dataset: DatasetTest = { accounts: [ { raw: { - id: `js:2:elrond:erd1rnq7m8kdrpyfany4fweqtydsk4pgx0l6dtl6tvcad5wesagruxts62e9rk:`, - seedIdentifier: - "erd1rnq7m8kdrpyfany4fweqtydsk4pgx0l6dtl6tvcad5wesagruxts62e9rk", + id: `js:2:elrond:${TEST_ADDRESS}:`, + seedIdentifier: `${TEST_ADDRESS}`, name: "Elrond 1", derivationMode: "", index: 0, - freshAddress: - "erd1rnq7m8kdrpyfany4fweqtydsk4pgx0l6dtl6tvcad5wesagruxts62e9rk", + freshAddress: `${TEST_ADDRESS}`, freshAddressPath: "44'/508'/0'/0/0'", freshAddresses: [], blockHeight: 0, @@ -52,8 +53,7 @@ const dataset: DatasetTest = { name: "recipient and sender must not be the same", transaction: fromTransactionRaw({ family: "elrond", - recipient: - "erd1rnq7m8kdrpyfany4fweqtydsk4pgx0l6dtl6tvcad5wesagruxts62e9rk", + recipient: `${TEST_ADDRESS}`, amount: "100000000", mode: "send", fees: null, @@ -88,7 +88,7 @@ const dataset: DatasetTest = { family: "elrond", recipient: "erd1frj909pfums4m8aza596595l9pl56crwdj077vs2aqcw6ynl28wsfkw9rd", - amount: BigNumber("1000000000000000"), + amount: BigNumber("1000000000000000000000000"), mode: "send", fees: null, }), From f3d2338392f7baba7bbe7441568374b8ff3fb43d Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Mon, 2 Aug 2021 12:47:35 +0300 Subject: [PATCH 040/127] toBe => toStrictEqual jest matcher --- docs/AccountBridge.md | 2 +- src/__tests__/test-helpers/bridge.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/AccountBridge.md b/docs/AccountBridge.md index c79fc997e1..16d1a95bbc 100644 --- a/docs/AccountBridge.md +++ b/docs/AccountBridge.md @@ -202,7 +202,7 @@ In other words _(and in a Jest test that we actually have)_ this should be expec async function expectStability(account, t) { const t2 = await bridge.prepareTransaction(account, t); const t3 = await bridge.prepareTransaction(account, t2); - expect(t2).toBe(t3); // t2 === t3 + expect(t2).toStrictEqual(t3); // t2 === t3 } ``` diff --git a/src/__tests__/test-helpers/bridge.js b/src/__tests__/test-helpers/bridge.js index 40f0a1991d..671e6015df 100644 --- a/src/__tests__/test-helpers/bridge.js +++ b/src/__tests__/test-helpers/bridge.js @@ -543,7 +543,7 @@ export function testBridge(family: string, data: DatasetTest) { async function expectStability(account, t) { const t2 = await bridge.prepareTransaction(account, t); const t3 = await bridge.prepareTransaction(account, t2); - expect(t2).toBe(t3); + expect(t2).toStrictEqual(t3); } makeTest("ref stability on empty transaction", async () => { From 9fc0245f379c88e6b4eead33adb31eefb5b6c443 Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Mon, 2 Aug 2021 13:16:03 +0300 Subject: [PATCH 041/127] add bsc supported currency --- src/__tests__/test-helpers/setup.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/__tests__/test-helpers/setup.js b/src/__tests__/test-helpers/setup.js index 358def326c..4b4d2d0a56 100644 --- a/src/__tests__/test-helpers/setup.js +++ b/src/__tests__/test-helpers/setup.js @@ -8,6 +8,7 @@ setPlatformVersion("0.0.1"); setSupportedCurrencies([ "bitcoin", "ethereum", + "bsc", "elrond", "ripple", "bitcoin_cash", From ca4cca3b3ca2b5d4b51fa6210ac358a0329087f7 Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Wed, 11 Aug 2021 17:29:21 +0300 Subject: [PATCH 042/127] migrate elrond integration to ts --- .../elrond/{account.js => account.ts} | 24 +- .../elrond/api/{apiCalls.js => apiCalls.ts} | 135 ++++++----- src/families/elrond/api/index.js | 8 - src/families/elrond/api/index.ts | 1 + src/families/elrond/api/{sdk.js => sdk.ts} | 95 ++++---- src/families/elrond/bridge/{js.js => js.ts} | 20 +- src/families/elrond/{cache.js => cache.ts} | 12 +- src/families/elrond/cli-transaction.js | 36 --- src/families/elrond/cli-transaction.ts | 34 +++ .../elrond/{constants.js => constants.ts} | 8 +- .../hw-app-elrond/{index.js => index.ts} | 118 +++------- src/families/elrond/hw-getAddress.js | 14 -- src/families/elrond/hw-getAddress.ts | 19 ++ .../{js-broadcast.js => js-broadcast.ts} | 23 +- ...dTransaction.js => js-buildTransaction.ts} | 21 +- ...pendable.js => js-estimateMaxSpendable.ts} | 28 ++- ...saction.js => js-getFeesForTransaction.ts} | 13 +- ...onStatus.js => js-getTransactionStatus.ts} | 34 +-- src/families/elrond/js-signOperation.js | 115 --------- src/families/elrond/js-signOperation.ts | 85 +++++++ ...nchronisation.js => js-synchronisation.ts} | 37 ++- .../{js-transaction.js => js-transaction.ts} | 31 +-- src/families/elrond/{logic.js => logic.ts} | 14 +- .../elrond/{preload.js => preload.ts} | 33 +-- .../{serialization.js => serialization.ts} | 17 +- src/families/elrond/test-dataset.js | 109 --------- src/families/elrond/test-dataset.ts | 91 ++++++++ src/families/elrond/transaction.js | 53 ----- src/families/elrond/transaction.ts | 37 +++ src/families/elrond/types.js | 65 ------ src/families/elrond/types.ts | 61 +++++ src/generated/account.js | 16 -- src/generated/account.ts | 3 + src/generated/bridge/js.js | 20 -- src/generated/bridge/js.ts | 3 + src/generated/cli-transaction.js | 26 --- src/generated/cli-transaction.ts | 3 + src/generated/hw-getAddress.js | 28 --- src/generated/hw-getAddress.ts | 3 + src/generated/test-dataset.js | 24 -- src/generated/test-dataset.ts | 3 + src/generated/transaction.js | 28 --- src/generated/transaction.ts | 3 + src/generated/types.js | 220 ------------------ src/generated/types.ts | 18 ++ 45 files changed, 646 insertions(+), 1143 deletions(-) rename src/families/elrond/{account.js => account.ts} (68%) rename src/families/elrond/api/{apiCalls.js => apiCalls.ts} (52%) delete mode 100644 src/families/elrond/api/index.js create mode 100644 src/families/elrond/api/index.ts rename src/families/elrond/api/{sdk.js => sdk.ts} (55%) rename src/families/elrond/bridge/{js.js => js.ts} (81%) rename src/families/elrond/{cache.js => cache.ts} (62%) delete mode 100644 src/families/elrond/cli-transaction.js create mode 100644 src/families/elrond/cli-transaction.ts rename src/families/elrond/{constants.js => constants.ts} (58%) rename src/families/elrond/hw-app-elrond/{index.js => index.ts} (63%) delete mode 100644 src/families/elrond/hw-getAddress.js create mode 100644 src/families/elrond/hw-getAddress.ts rename src/families/elrond/{js-broadcast.js => js-broadcast.ts} (66%) rename src/families/elrond/{js-buildTransaction.js => js-buildTransaction.ts} (75%) rename src/families/elrond/{js-estimateMaxSpendable.js => js-estimateMaxSpendable.ts} (66%) rename src/families/elrond/{js-getFeesForTransaction.js => js-getFeesForTransaction.ts} (80%) rename src/families/elrond/{js-getTransactionStatus.js => js-getTransactionStatus.ts} (55%) delete mode 100644 src/families/elrond/js-signOperation.js create mode 100644 src/families/elrond/js-signOperation.ts rename src/families/elrond/{js-synchronisation.js => js-synchronisation.ts} (66%) rename src/families/elrond/{js-transaction.js => js-transaction.ts} (65%) rename src/families/elrond/{logic.js => logic.ts} (85%) rename src/families/elrond/{preload.js => preload.ts} (84%) rename src/families/elrond/{serialization.js => serialization.ts} (76%) delete mode 100644 src/families/elrond/test-dataset.js create mode 100644 src/families/elrond/test-dataset.ts delete mode 100644 src/families/elrond/transaction.js create mode 100644 src/families/elrond/transaction.ts delete mode 100644 src/families/elrond/types.js create mode 100644 src/families/elrond/types.ts delete mode 100644 src/generated/account.js delete mode 100644 src/generated/bridge/js.js delete mode 100644 src/generated/cli-transaction.js delete mode 100644 src/generated/hw-getAddress.js delete mode 100644 src/generated/test-dataset.js delete mode 100644 src/generated/transaction.js delete mode 100644 src/generated/types.js diff --git a/src/families/elrond/account.js b/src/families/elrond/account.ts similarity index 68% rename from src/families/elrond/account.js rename to src/families/elrond/account.ts index cf3304fe12..72c93d4388 100644 --- a/src/families/elrond/account.js +++ b/src/families/elrond/account.ts @@ -1,49 +1,45 @@ -// @flow import invariant from "invariant"; import type { Account, Operation, Unit } from "../../types"; import { getAccountUnit } from "../../account"; import { formatCurrencyUnit } from "../../currencies"; function formatAccountSpecifics(account: Account): string { - const { elrondResources } = account; + const { + elrondResources + } = account; invariant(elrondResources, "elrond account expected"); const unit = getAccountUnit(account); const formatConfig = { disableRounding: true, alwaysShowSign: false, - showCode: true, + showCode: true }; - let str = " "; if (account.spendableBalance) { - str += - formatCurrencyUnit(unit, account.spendableBalance, formatConfig) + - " spendable. "; + str += formatCurrencyUnit(unit, account.spendableBalance, formatConfig) + " spendable. "; } else { str += " 0 spendable."; } - if (elrondResources.nonce) { + if (elrondResources && elrondResources.nonce) { str += "\n nonce : " + elrondResources.nonce; } return str; } -function formatOperationSpecifics(op: Operation, unit: ?Unit): string { +function formatOperationSpecifics(op: Operation, unit: Unit | null | undefined): string { let str = " "; - const formatConfig = { disableRounding: true, alwaysShowSign: false, - showCode: true, + showCode: true }; - return str; } export default { formatAccountSpecifics, - formatOperationSpecifics, -}; + formatOperationSpecifics +}; \ No newline at end of file diff --git a/src/families/elrond/api/apiCalls.js b/src/families/elrond/api/apiCalls.ts similarity index 52% rename from src/families/elrond/api/apiCalls.js rename to src/families/elrond/api/apiCalls.ts index 9f346e744c..8674383bce 100644 --- a/src/families/elrond/api/apiCalls.js +++ b/src/families/elrond/api/apiCalls.ts @@ -1,34 +1,39 @@ import network from "../../../network"; -import { - HASH_TRANSACTION, - RAW_TRANSACTION, - METACHAIN_SHARD, -} from "../constants"; - +import { HASH_TRANSACTION, RAW_TRANSACTION, METACHAIN_SHARD } from "../constants"; export default class ElrondApi { - constructor(API_URL: String) { + private API_URL: string; + + constructor(API_URL: string) { this.API_URL = API_URL; } async getAccountDetails(addr: String) { const { - data: { balance, nonce }, + data: { + balance, + nonce + } } = await network({ method: "GET", - url: `${this.API_URL}/accounts/${addr}`, + url: `${this.API_URL}/accounts/${addr}` }); - - return { balance, nonce }; + return { + balance, + nonce + }; } async getValidators() { let data = []; + try { let { - data: { validators }, + data: { + validators + } } = await network({ method: "GET", - url: `${this.API_URL}/validator/statistics`, + url: `${this.API_URL}/validator/statistics` }); data = validators; } catch (error) { @@ -47,34 +52,46 @@ export default class ElrondApi { erd_denomination: denomination, erd_min_gas_limit: gasLimit, erd_min_gas_price: gasPrice, - erd_gas_per_data_byte: gasPerByte, - }, - }, - }, + erd_gas_per_data_byte: gasPerByte + } + } + } } = await network({ method: "GET", - url: `${this.API_URL}/network/config`, + url: `${this.API_URL}/network/config` }); - - return { chainId, denomination, gasLimit, gasPrice, gasPerByte }; + return { + chainId, + denomination, + gasLimit, + gasPrice, + gasPerByte + }; } - async submit({ operation, signature, signUsingHash }) { - const { chainId, gasLimit, gasPrice } = await this.getNetworkConfig(); - + async submit({ + operation, + signature, + signUsingHash + }) { + const { + chainId, + gasLimit, + gasPrice + } = await this.getNetworkConfig(); const transactionType = signUsingHash ? HASH_TRANSACTION : RAW_TRANSACTION; - const { senders: [sender], recipients: [receiver], value, - transactionSequenceNumber: nonce, + transactionSequenceNumber: nonce } = operation; - const { data: { - data: { txHash: hash }, - }, + data: { + txHash: hash + } + } } = await network({ method: "POST", url: `${this.API_URL}/transaction/send`, @@ -87,40 +104,44 @@ export default class ElrondApi { gasLimit, chainID: chainId, signature, - ...transactionType, - }, + ...transactionType + } }); - - return { hash }; + return { + hash + }; } async getHistory(addr: string, startAt: Number) { - const { data: transactions } = await network({ + const { + data: transactions + } = await network({ method: "GET", - url: `${this.API_URL}/transactions?condition=should&sender=${addr}&receiver=${addr}&after=${startAt}`, + url: `${this.API_URL}/transactions?condition=should&sender=${addr}&receiver=${addr}&after=${startAt}` }); - if (!transactions.length) return transactions; //Account does not have any transactions - return Promise.all( - transactions.map(async (transaction) => { - const { blockHeight, blockHash } = await this.getConfirmedTransaction( - transaction.txHash - ); - - return { ...transaction, blockHash, blockHeight }; - }) - ); + return Promise.all(transactions.map(async transaction => { + const { + blockHeight, + blockHash + } = await this.getConfirmedTransaction(transaction.txHash); + return { ...transaction, + blockHash, + blockHeight + }; + })); } async getBlockchainBlockHeight() { const { - data: [{ nonce: blockHeight }], + data: [{ + nonce: blockHeight + }] } = await network({ method: "GET", - url: `${this.API_URL}/blocks?shard=${METACHAIN_SHARD}&fields=nonce`, + url: `${this.API_URL}/blocks?shard=${METACHAIN_SHARD}&fields=nonce` }); - return blockHeight; } @@ -128,14 +149,20 @@ export default class ElrondApi { const { data: { data: { - transaction: { hyperblockNonce, blockHash }, - }, - }, + transaction: { + hyperblockNonce, + blockHash + } + } + } } = await network({ method: "GET", - url: `${this.API_URL}/transaction/${txHash}`, + url: `${this.API_URL}/transaction/${txHash}` }); - - return { blockHeight: hyperblockNonce, blockHash }; + return { + blockHeight: hyperblockNonce, + blockHash + }; } -} + +} \ No newline at end of file diff --git a/src/families/elrond/api/index.js b/src/families/elrond/api/index.js deleted file mode 100644 index 65398ce1f9..0000000000 --- a/src/families/elrond/api/index.js +++ /dev/null @@ -1,8 +0,0 @@ -export { - getAccount, - getNetworkConfig, - getValidators, - getOperations, - getFees, - broadcastTransaction, -} from "./sdk"; diff --git a/src/families/elrond/api/index.ts b/src/families/elrond/api/index.ts new file mode 100644 index 0000000000..fcb626c636 --- /dev/null +++ b/src/families/elrond/api/index.ts @@ -0,0 +1 @@ +export { getAccount, getNetworkConfig, getValidators, getOperations, getFees, broadcastTransaction } from "./sdk"; \ No newline at end of file diff --git a/src/families/elrond/api/sdk.js b/src/families/elrond/api/sdk.ts similarity index 55% rename from src/families/elrond/api/sdk.js rename to src/families/elrond/api/sdk.ts index c1d6828059..4fd1c956bf 100644 --- a/src/families/elrond/api/sdk.js +++ b/src/families/elrond/api/sdk.ts @@ -1,5 +1,3 @@ -// @flow - import { BigNumber } from "bignumber.js"; import ElrondApi from "./apiCalls"; import type { Transaction } from "../types"; @@ -7,28 +5,30 @@ import type { Operation, OperationType } from "../../../types"; import { getEnv } from "../../../env"; import { encodeOperationId } from "../../../operation"; import { getTransactionParams } from "../cache"; - +import { RecordStoreInvalidSynthax } from "@ledgerhq/hw-transport-mocker"; let api = new ElrondApi(getEnv("ELROND_API_ENDPOINT")); /** * Get account balances and nonce */ export const getAccount = async (addr: string) => { - const { balance, nonce } = await api.getAccountDetails(addr); + const { + balance, + nonce + } = await api.getAccountDetails(addr); const blockHeight = await api.getBlockchainBlockHeight(); - return { blockHeight, balance: new BigNumber(balance), - nonce, + nonce }; }; - export const getValidators = async () => { const validators = await api.getValidators(); - return { validators }; + return { + validators + }; }; - export const getNetworkConfig = async () => { return await api.getNetworkConfig(); }; @@ -43,10 +43,7 @@ function isSender(transaction: Transaction, addr: string): boolean { /** * Map transaction to an Operation Type */ -function getOperationType( - transaction: Transaction, - addr: string -): OperationType { +function getOperationType(transaction: Transaction, addr: string): OperationType { return isSender(transaction, addr) ? "OUT" : "IN"; } @@ -54,80 +51,70 @@ function getOperationType( * Map transaction to a correct Operation Value (affecting account balance) */ function getOperationValue(transaction: Transaction, addr: string): BigNumber { - return isSender(transaction, addr) - ? BigNumber(transaction.value).plus(transaction.fee) - : BigNumber(transaction.value); + return isSender(transaction, addr) ? new BigNumber(transaction.value ?? 0).plus(transaction.fee ?? 0) : new BigNumber(transaction.value ?? 0); } /** * Map the Elrond history transaction to a Ledger Live Operation */ -function transactionToOperation( - accountId: string, - addr: string, - transaction: Transaction -): Operation { +function transactionToOperation(accountId: string, addr: string, transaction: Transaction): Operation { const type = getOperationType(transaction, addr); - return { - id: encodeOperationId(accountId, transaction.txHash, type), + id: encodeOperationId(accountId, transaction.txHash ?? '', type), accountId, - fee: BigNumber(transaction.fee || 0), + fee: new BigNumber(transaction.fee || 0), value: getOperationValue(transaction, addr), type, - hash: transaction.txHash, + hash: transaction.txHash ?? '', blockHash: transaction.blockHash, blockHeight: transaction.blockHeight, - date: new Date(transaction.timestamp * 1000), - // extra: getOperationExtra(transaction), - senders: [transaction.sender], + date: new Date(transaction.timestamp ?? 0 * 1000), + extra: {}, + senders: [transaction.sender ?? ''], recipients: transaction.receiver ? [transaction.receiver] : [], - transactionSequenceNumber: isSender(transaction, addr) - ? transaction.nonce - : undefined, - hasFailed: - !transaction.status || - transaction.status === "fail" || - transaction.status === "invalid", + transactionSequenceNumber: isSender(transaction, addr) ? transaction.nonce : undefined, + hasFailed: !transaction.status || transaction.status === "fail" || transaction.status === "invalid" }; } /** * Fetch operation list */ -export const getOperations = async ( - accountId: string, - addr: string, - startAt: Number -): Promise => { +export const getOperations = async (accountId: string, addr: string, startAt: Number): Promise => { const rawTransactions = await api.getHistory(addr, startAt); - if (!rawTransactions) return rawTransactions; - - return rawTransactions.map((transaction) => - transactionToOperation(accountId, addr, transaction) - ); + return rawTransactions.map(transaction => transactionToOperation(accountId, addr, transaction)); }; /** * Obtain fees from blockchain */ export const getFees = async (unsigned): Promise => { - const { data } = unsigned; - const { gasLimit, gasPerByte, gasPrice } = await getTransactionParams(); + const { + data + } = unsigned; + const { + gasLimit, + gasPerByte, + gasPrice + } = await getTransactionParams(); if (!data) { - return BigNumber(gasLimit * gasPrice); + return new BigNumber(gasLimit * gasPrice); } - return BigNumber((gasLimit + gasPerByte * data.length) * gasPrice); + + return new BigNumber((gasLimit + gasPerByte * data.length) * gasPrice); }; /** * Broadcast blob to blockchain */ -export const broadcastTransaction = async (blob: string) => { - const { hash } = await api.submit(blob); - +export const broadcastTransaction = async (blob: any) => { + const { + hash + } = await api.submit(blob); // Transaction hash is likely to be returned - return { hash }; -}; + return { + hash + }; +}; \ No newline at end of file diff --git a/src/families/elrond/bridge/js.js b/src/families/elrond/bridge/js.ts similarity index 81% rename from src/families/elrond/bridge/js.js rename to src/families/elrond/bridge/js.ts index 49ab2ab568..5653a4e497 100644 --- a/src/families/elrond/bridge/js.js +++ b/src/families/elrond/bridge/js.ts @@ -1,28 +1,20 @@ -// @flow import type { AccountBridge, CurrencyBridge } from "../../../types"; import type { Transaction } from "../types"; import { makeAccountBridgeReceive } from "../../../bridge/jsHelpers"; import { getPreloadStrategy, preload, hydrate } from "../preload"; import { sync, scanAccounts } from "../js-synchronisation"; -import { - createTransaction, - updateTransaction, - prepareTransaction, -} from "../js-transaction"; +import { createTransaction, updateTransaction, prepareTransaction } from "../js-transaction"; import getTransactionStatus from "../js-getTransactionStatus"; import estimateMaxSpendable from "../js-estimateMaxSpendable"; import signOperation from "../js-signOperation"; import broadcast from "../js-broadcast"; - const receive = makeAccountBridgeReceive(); - const currencyBridge: CurrencyBridge = { getPreloadStrategy, preload, hydrate, - scanAccounts, + scanAccounts }; - const accountBridge: AccountBridge = { estimateMaxSpendable, createTransaction, @@ -32,7 +24,9 @@ const accountBridge: AccountBridge = { sync, receive, signOperation, - broadcast, + broadcast }; - -export default { currencyBridge, accountBridge }; +export default { + currencyBridge, + accountBridge +}; \ No newline at end of file diff --git a/src/families/elrond/cache.js b/src/families/elrond/cache.ts similarity index 62% rename from src/families/elrond/cache.js rename to src/families/elrond/cache.ts index ca11233251..864a7d33e5 100644 --- a/src/families/elrond/cache.js +++ b/src/families/elrond/cache.ts @@ -1,6 +1,7 @@ import { makeLRUCache } from "../../cache"; import type { CacheRes } from "../../cache"; import { getNetworkConfig } from "./api"; + /** * Cache the getTransactionInfo for fees estimation to avoid multiple calls during 5 minutes. * Should be force refresh when signing operation. @@ -9,10 +10,7 @@ import { getNetworkConfig } from "./api"; * * @returns {Promise} txInfo */ -export const getTransactionParams: CacheRes, Object> = makeLRUCache( - async (): Promise => getNetworkConfig(), - () => "elrond", - { - maxAge: 5 * 60 * 1000, // 5 minutes - } -); +export const getTransactionParams: CacheRes, Record> = makeLRUCache(async (): Promise> => getNetworkConfig(), () => "elrond", { + maxAge: 5 * 60 * 1000 // 5 minutes + +}); \ No newline at end of file diff --git a/src/families/elrond/cli-transaction.js b/src/families/elrond/cli-transaction.js deleted file mode 100644 index 094d48678e..0000000000 --- a/src/families/elrond/cli-transaction.js +++ /dev/null @@ -1,36 +0,0 @@ -// @flow -import invariant from "invariant"; -import flatMap from "lodash/flatMap"; -import type { Transaction, AccountLike } from "../../types"; - -const options = [ - { - name: "mode", - type: String, - desc: "mode of transaction: send", - }, -]; - -function inferTransactions( - transactions: Array<{ account: AccountLike, transaction: Transaction }>, - opts: Object -): Transaction[] { - return flatMap(transactions, ({ transaction, account }) => { - invariant(transaction.family === "elrond", "elrond family"); - - if (account.type === "Account") { - invariant(account.elrondResources, "unactivated account"); - } - - return { - ...transaction, - family: "elrond", - mode: opts.mode || "send", - }; - }); -} - -export default { - options, - inferTransactions, -}; diff --git a/src/families/elrond/cli-transaction.ts b/src/families/elrond/cli-transaction.ts new file mode 100644 index 0000000000..6a2a81f264 --- /dev/null +++ b/src/families/elrond/cli-transaction.ts @@ -0,0 +1,34 @@ +import BigNumber from "bignumber.js"; +import invariant from "invariant"; +import flatMap from "lodash/flatMap"; +import type { Transaction, AccountLike } from "../../types"; +const options = [{ + name: "mode", + type: String, + desc: "mode of transaction: send" +}]; + +function inferTransactions(transactions: Array<{ + account: AccountLike; + transaction: Transaction; +}>, opts: Record): Transaction[] { + return flatMap(transactions, ({ + transaction, + account + }) => { + invariant(transaction.family === "elrond", "elrond family"); + + if (account.type === "Account") { + invariant(account.elrondResources, "unactivated account"); + } + + transaction.family = "elrond"; + + return transaction; + }); +} + +export default { + options, + inferTransactions +}; \ No newline at end of file diff --git a/src/families/elrond/constants.js b/src/families/elrond/constants.ts similarity index 58% rename from src/families/elrond/constants.js rename to src/families/elrond/constants.ts index e1f51e8694..89ba443bb2 100644 --- a/src/families/elrond/constants.js +++ b/src/families/elrond/constants.ts @@ -1,11 +1,9 @@ export const HASH_TRANSACTION = { version: 2, - options: 1, + options: 1 }; - export const RAW_TRANSACTION = { version: 1, - options: 0, + options: 0 }; - -export const METACHAIN_SHARD = 4294967295; +export const METACHAIN_SHARD = 4294967295; \ No newline at end of file diff --git a/src/families/elrond/hw-app-elrond/index.js b/src/families/elrond/hw-app-elrond/index.ts similarity index 63% rename from src/families/elrond/hw-app-elrond/index.js rename to src/families/elrond/hw-app-elrond/index.ts index bf0440a805..4b4fd9cc89 100644 --- a/src/families/elrond/hw-app-elrond/index.js +++ b/src/families/elrond/hw-app-elrond/index.ts @@ -1,43 +1,25 @@ -//@flow - import type Transport from "@ledgerhq/hw-transport"; import BIPPath from "bip32-path"; - const CHUNK_SIZE = 150; const CURVE_MASK = 0x80; const CLA = 0xed; - const INS = { GET_VERSION: 0x02, GET_ADDRESS: 0x03, - SET_ADDRESS: 0x05, + SET_ADDRESS: 0x05 }; - const SIGN_RAW_TX_INS = 0x04; const SIGN_HASH_TX_INS = 0x07; const SIGN_MESSAGE_INS = 0x06; - const ACTIVE_SIGNERS = [SIGN_RAW_TX_INS, SIGN_HASH_TX_INS, SIGN_MESSAGE_INS]; - const SW_OK = 0x9000; const SW_CANCEL = 0x6986; - export default class Elrond { - transport: Transport<*>; + transport: Transport; - constructor(transport: Transport<*>, scrambleKey: string = "eGLD") { + constructor(transport: Transport, scrambleKey: string = "eGLD") { this.transport = transport; - transport.decorateAppAPIMethods( - this, - [ - "getAddress", - "setAddress", - "signTransaction", - "signMessage", - "getAppConfiguration", - ], - scrambleKey - ); + transport.decorateAppAPIMethods(this, ["getAddress", "setAddress", "signTransaction", "signMessage", "getAppConfiguration"], scrambleKey); } /** @@ -48,29 +30,20 @@ export default class Elrond { * const result = await elrond.getAppConfiguration(); * const { contractData, accountIndex, addressIndex, version } = result; */ - async getAppConfiguration(): Promise<{ - version: string, - }> { - const response = await this.transport.send( - CLA, - INS.GET_VERSION, - 0x00, - 0x00 - ); + async getAppConfiguration(): Promise { + const response = await this.transport.send(CLA, INS.GET_VERSION, 0x00, 0x00); return { contractData: response[0], accountIndex: response[1], addressIndex: response[2], - version: `${response[3]}.${response[4]}.${response[5]}`, + version: `${response[3]}.${response[4]}.${response[5]}` }; } serializePath(path: Array) { const buf = Buffer.alloc(8); - buf.writeUInt32BE(path[3], 0); buf.writeUInt32BE(path[2], 4); - return buf; } @@ -84,29 +57,17 @@ export default class Elrond { * const result = await elrond.getAddress("44'/508'/0'/0'/0'"); * const { address, returnCode } = result; */ - async getAddress( - path: string, - display?: boolean - ): Promise<{ - address: string, + async getAddress(path: string, display?: boolean): Promise<{ + address: string; }> { const bipPath = BIPPath.fromString(path).toPathArray(); - const data = this.serializePath(bipPath); - - const response = await this.transport.send( - CLA, - INS.GET_ADDRESS, - display ? 0x01 : 0x00, - 0x00, - data, - [SW_OK, SW_CANCEL] - ); - + const response = await this.transport.send(CLA, INS.GET_ADDRESS, display ? 0x01 : 0x00, 0x00, data, [SW_OK, SW_CANCEL]); const addressLength = response[0]; const address = response.slice(1, 1 + addressLength).toString("ascii"); - - return { address }; + return { + address + }; } /** @@ -122,71 +83,50 @@ export default class Elrond { async setAddress(path: string, display?: boolean) { const bipPath = BIPPath.fromString(path).toPathArray(); const data = this.serializePath(bipPath); - - await this.transport.send( - CLA, - INS.SET_ADDRESS, - display ? 0x01 : 0x00, - 0x00, - data, - [SW_OK, SW_CANCEL] - ); + await this.transport.send(CLA, INS.SET_ADDRESS, display ? 0x01 : 0x00, 0x00, data, [SW_OK, SW_CANCEL]); } - async signTransaction( - path: string, - message: string, - usingHash: boolean - ): Promise { - const chunks = []; - - const buffer = Buffer.from(message); + async signTransaction(path: string, message: string, usingHash: boolean): Promise { + const chunks: Buffer[] = []; + const buffer: Buffer = Buffer.from(message); for (let i = 0; i < buffer.length; i += CHUNK_SIZE) { let end = i + CHUNK_SIZE; + if (i > buffer.length) { end = buffer.length; } + chunks.push(buffer.slice(i, end)); } - return usingHash - ? this.sign(chunks, SIGN_HASH_TX_INS) - : this.sign(chunks, SIGN_RAW_TX_INS); + return usingHash ? this.sign(chunks, SIGN_HASH_TX_INS) : this.sign(chunks, SIGN_RAW_TX_INS); } - async signMessage(message: Buffer): Promise { + async signMessage(message: Buffer[]): Promise { return this.sign(message, SIGN_MESSAGE_INS); } - async sign(message: Buffer, type: number): Promise { + async sign(message: Buffer[], type: number): Promise { if (!ACTIVE_SIGNERS.includes(type)) { throw new Error(`invalid sign instruction called: ${type}`); } - const apdus = []; - + const apdus: any[] = []; message.forEach((data, index) => { - const apdu = { + const apdu: any = { cla: CLA, ins: type, p1: index === 0 ? 0x00 : CURVE_MASK, p2: CURVE_MASK, - data, + data }; - apdus.push(apdu); }); + let response: any = {}; - let response = {}; for (let apdu of apdus) { - response = await this.transport.send( - apdu.cla, - apdu.ins, - apdu.p1, - apdu.p2, - apdu.data - ); + response = await this.transport.send(apdu.cla, apdu.ins, apdu.p1, apdu.p2, apdu.data); } if (response.length !== 67 || response[0] !== 64) { @@ -194,7 +134,7 @@ export default class Elrond { } const signature = response.slice(1, response.length - 2).toString("hex"); - return signature; } -} + +} \ No newline at end of file diff --git a/src/families/elrond/hw-getAddress.js b/src/families/elrond/hw-getAddress.js deleted file mode 100644 index 89f8841ae3..0000000000 --- a/src/families/elrond/hw-getAddress.js +++ /dev/null @@ -1,14 +0,0 @@ -// @flow - -import type { Resolver } from "../../hw/getAddress/types"; -import Elrond from "./hw-app-elrond"; - -const resolver: Resolver = async (transport, { path, verify }) => { - const elrond = new Elrond(transport); - - const { address } = await elrond.getAddress(path, verify); - - return { address, path }; -}; - -export default resolver; diff --git a/src/families/elrond/hw-getAddress.ts b/src/families/elrond/hw-getAddress.ts new file mode 100644 index 0000000000..49979f3b71 --- /dev/null +++ b/src/families/elrond/hw-getAddress.ts @@ -0,0 +1,19 @@ +import type { Resolver } from "../../hw/getAddress/types"; +import Elrond from "./hw-app-elrond"; + +const resolver: Resolver = async (transport, { + path, + verify +}) => { + const elrond = new Elrond(transport); + const { + address + } = await elrond.getAddress(path, verify); + return { + address, + path, + publicKey: '' + }; +}; + +export default resolver; \ No newline at end of file diff --git a/src/families/elrond/js-broadcast.js b/src/families/elrond/js-broadcast.ts similarity index 66% rename from src/families/elrond/js-broadcast.js rename to src/families/elrond/js-broadcast.ts index 855373a0c0..668ae5f352 100644 --- a/src/families/elrond/js-broadcast.js +++ b/src/families/elrond/js-broadcast.ts @@ -1,7 +1,5 @@ -// @flow import type { Operation, SignedOperation } from "../../types"; import { patchOperationWithHash } from "../../operation"; - import { broadcastTransaction } from "./api"; /** @@ -9,21 +7,26 @@ import { broadcastTransaction } from "./api"; * @param {signature: string, operation: string} signedOperation */ const broadcast = async ({ - signedOperation: { signature, operation }, + signedOperation: { + signature, + operation + } }: { - signedOperation: SignedOperation, + signedOperation: SignedOperation; }): Promise => { const { - extra: { signUsingHash }, + extra: { + signUsingHash + } } = operation; - - const { hash } = await broadcastTransaction({ + const { + hash + } = await broadcastTransaction({ operation, signature, - signUsingHash, + signUsingHash }); - return patchOperationWithHash(operation, hash); }; -export default broadcast; +export default broadcast; \ No newline at end of file diff --git a/src/families/elrond/js-buildTransaction.js b/src/families/elrond/js-buildTransaction.ts similarity index 75% rename from src/families/elrond/js-buildTransaction.js rename to src/families/elrond/js-buildTransaction.ts index 4ca707242b..5fd62bebf9 100644 --- a/src/families/elrond/js-buildTransaction.js +++ b/src/families/elrond/js-buildTransaction.ts @@ -1,10 +1,7 @@ -// @flow import type { Transaction } from "./types"; import type { Account } from "../../types"; - import { getNonce } from "./logic"; import { getNetworkConfig } from "./api"; - import { HASH_TRANSACTION, RAW_TRANSACTION } from "./constants"; /** @@ -12,16 +9,15 @@ import { HASH_TRANSACTION, RAW_TRANSACTION } from "./constants"; * @param {Account} a * @param {Transaction} t */ -export const buildTransaction = async ( - a: Account, - t: Transaction, - signUsingHash: Boolean = true -) => { +export const buildTransaction = async (a: Account, t: Transaction, signUsingHash: Boolean = true) => { const address = a.freshAddress; const nonce = getNonce(a); - const { gasPrice, gasLimit, chainId } = await getNetworkConfig(); + const { + gasPrice, + gasLimit, + chainId + } = await getNetworkConfig(); const transactionType = signUsingHash ? HASH_TRANSACTION : RAW_TRANSACTION; - const unsigned = { nonce, value: t.amount, @@ -30,9 +26,8 @@ export const buildTransaction = async ( gasPrice, gasLimit, chainID: chainId, - ...transactionType, + ...transactionType }; - // Will likely be a call to Elrond SDK return JSON.stringify(unsigned); -}; +}; \ No newline at end of file diff --git a/src/families/elrond/js-estimateMaxSpendable.js b/src/families/elrond/js-estimateMaxSpendable.ts similarity index 66% rename from src/families/elrond/js-estimateMaxSpendable.js rename to src/families/elrond/js-estimateMaxSpendable.ts index e6ba576e33..97126c806d 100644 --- a/src/families/elrond/js-estimateMaxSpendable.js +++ b/src/families/elrond/js-estimateMaxSpendable.ts @@ -1,11 +1,7 @@ -// @flow import { BigNumber } from "bignumber.js"; - import type { AccountLike, Account } from "../../types"; import { getMainAccount } from "../../account"; - import type { Transaction } from "./types"; - import { createTransaction } from "./js-transaction"; import getEstimatedFees from "./js-getFeesForTransaction"; @@ -17,26 +13,28 @@ import getEstimatedFees from "./js-getFeesForTransaction"; const estimateMaxSpendable = async ({ account, parentAccount, - transaction, + transaction }: { - account: AccountLike, - parentAccount: ?Account, - transaction: ?Transaction, + account: AccountLike; + parentAccount: Account | null | undefined; + transaction: Transaction | null | undefined; }): Promise => { const a = getMainAccount(account, parentAccount); - const t = { - ...createTransaction(), + const t = { ...createTransaction(), ...transaction, - amount: a.spendableBalance, + amount: a.spendableBalance }; - - const fees = await getEstimatedFees({ a, t }); + const fees = await getEstimatedFees({ + a, + t, + signUsingHash: true, + }); if (fees.gt(a.spendableBalance)) { - return BigNumber(0); + return new BigNumber(0); } return a.spendableBalance.minus(fees); }; -export default estimateMaxSpendable; +export default estimateMaxSpendable; \ No newline at end of file diff --git a/src/families/elrond/js-getFeesForTransaction.js b/src/families/elrond/js-getFeesForTransaction.ts similarity index 80% rename from src/families/elrond/js-getFeesForTransaction.js rename to src/families/elrond/js-getFeesForTransaction.ts index 3aaddc1b0e..9dbb92c6ff 100644 --- a/src/families/elrond/js-getFeesForTransaction.js +++ b/src/families/elrond/js-getFeesForTransaction.ts @@ -1,9 +1,6 @@ -// @flow import { BigNumber } from "bignumber.js"; - import type { Account } from "../../types"; import type { Transaction } from "./types"; - import { getFees } from "./api"; import { buildTransaction } from "./js-buildTransaction"; @@ -16,14 +13,14 @@ import { buildTransaction } from "./js-buildTransaction"; const getEstimatedFees = async ({ a, t, - signUsingHash = true, + signUsingHash = true }: { - a: Account, - t: Transaction, + a: Account; + t: Transaction; + signUsingHash: boolean | undefined; }): Promise => { const unsigned = await buildTransaction(a, t, signUsingHash); - return await getFees(JSON.parse(unsigned)); }; -export default getEstimatedFees; +export default getEstimatedFees; \ No newline at end of file diff --git a/src/families/elrond/js-getTransactionStatus.js b/src/families/elrond/js-getTransactionStatus.ts similarity index 55% rename from src/families/elrond/js-getTransactionStatus.js rename to src/families/elrond/js-getTransactionStatus.ts index 72ed0e1ca7..ba3ce6be52 100644 --- a/src/families/elrond/js-getTransactionStatus.js +++ b/src/families/elrond/js-getTransactionStatus.ts @@ -1,22 +1,12 @@ -// @flow import { BigNumber } from "bignumber.js"; -import { - NotEnoughBalance, - RecipientRequired, - InvalidAddress, - FeeNotLoaded, - InvalidAddressBecauseDestinationIsAlsoSource, -} from "@ledgerhq/errors"; +import { NotEnoughBalance, RecipientRequired, InvalidAddress, FeeNotLoaded, InvalidAddressBecauseDestinationIsAlsoSource } from "@ledgerhq/errors"; import type { Account, TransactionStatus } from "../../types"; import type { Transaction } from "./types"; import { isValidAddress, isSelfTransaction } from "./logic"; -const getTransactionStatus = async ( - a: Account, - t: Transaction -): Promise => { - const errors = {}; - const warnings = {}; +const getTransactionStatus = async (a: Account, t: Transaction): Promise => { + const errors: Record = {}; + const warnings: Record = {}; const useAllAmount = !!t.useAllAmount; if (!t.recipient) { @@ -35,15 +25,9 @@ const getTransactionStatus = async ( errors.fees = new FeeNotLoaded(); } - const estimatedFees = t.fees || BigNumber(0); - - const totalSpent = useAllAmount - ? a.balance - : BigNumber(t.amount).plus(estimatedFees); - - const amount = useAllAmount - ? a.balance.minus(estimatedFees) - : BigNumber(t.amount); + const estimatedFees = t.fees || new BigNumber(0); + const totalSpent = useAllAmount ? a.balance : new BigNumber(t.amount).plus(estimatedFees); + const amount = useAllAmount ? a.balance.minus(estimatedFees) : new BigNumber(t.amount); if (totalSpent.gt(a.balance)) { errors.amount = new NotEnoughBalance(); @@ -54,8 +38,8 @@ const getTransactionStatus = async ( warnings, estimatedFees, amount, - totalSpent, + totalSpent }); }; -export default getTransactionStatus; +export default getTransactionStatus; \ No newline at end of file diff --git a/src/families/elrond/js-signOperation.js b/src/families/elrond/js-signOperation.js deleted file mode 100644 index 3b5aab782e..0000000000 --- a/src/families/elrond/js-signOperation.js +++ /dev/null @@ -1,115 +0,0 @@ -// @flow -import { BigNumber } from "bignumber.js"; -import { Observable } from "rxjs"; -import { FeeNotLoaded } from "@ledgerhq/errors"; - -import type { Transaction } from "./types"; -import type { Account, Operation, SignOperationEvent } from "../../types"; - -import { open, close } from "../../hw"; -import { encodeOperationId } from "../../operation"; -import Elrond from "./hw-app-elrond"; - -import { buildTransaction } from "./js-buildTransaction"; -import { getNonce, compareVersions } from "./logic"; - -const buildOptimisticOperation = ( - account: Account, - transaction: Transaction, - fee: BigNumber, - signUsingHash: Boolean -): Operation => { - const type = "OUT"; - - const value = BigNumber(transaction.amount); - - const operation: $Exact = { - id: encodeOperationId(account.id, "", type), - hash: "", - type, - value, - fee, - blockHash: null, - blockHeight: account.blockHeight, - senders: [account.freshAddress], - recipients: [transaction.recipient].filter(Boolean), - accountId: account.id, - transactionSequenceNumber: getNonce(account), - date: new Date(), - extra: { - signUsingHash, - }, - }; - - return operation; -}; - -/** - * Sign Transaction with Ledger hardware - */ -const signOperation = ({ - account, - deviceId, - transaction, -}: { - account: Account, - deviceId: *, - transaction: Transaction, -}): Observable => - Observable.create((o) => { - async function main() { - const transport = await open(deviceId); - - try { - if (!transaction.fees) { - throw new FeeNotLoaded(); - } - - const elrond = new Elrond(transport); - - const { version } = await elrond.getAppConfiguration(); - - const signUsingHash = compareVersions(version, "1.0.11") >= 0; - - const unsigned = await buildTransaction( - account, - transaction, - signUsingHash - ); - - o.next({ type: "device-signature-requested" }); - - const r = await elrond.signTransaction( - account.freshAddressPath, - unsigned, - signUsingHash - ); - - o.next({ type: "device-signature-granted" }); - - const operation = buildOptimisticOperation( - account, - transaction, - transaction.fees ?? BigNumber(0), - signUsingHash - ); - - o.next({ - type: "signed", - signedOperation: { - operation, - signature: r, - expirationDate: null, - }, - }); - } finally { - close(transport, deviceId); - } - } - main().then( - () => o.complete(), - (e) => o.error(e) - ); - }); - -export default signOperation; diff --git a/src/families/elrond/js-signOperation.ts b/src/families/elrond/js-signOperation.ts new file mode 100644 index 0000000000..52e2603da5 --- /dev/null +++ b/src/families/elrond/js-signOperation.ts @@ -0,0 +1,85 @@ +import { BigNumber } from "bignumber.js"; +import { Observable } from "rxjs"; +import { FeeNotLoaded } from "@ledgerhq/errors"; +import type { Transaction } from "./types"; +import type { Account, Operation, SignOperationEvent } from "../../types"; +import { open, close } from "../../hw"; +import { encodeOperationId } from "../../operation"; +import Elrond from "./hw-app-elrond"; +import { buildTransaction } from "./js-buildTransaction"; +import { getNonce, compareVersions } from "./logic"; + +const buildOptimisticOperation = (account: Account, transaction: Transaction, fee: BigNumber, signUsingHash: Boolean): Operation => { + const type = "OUT"; + const value = new BigNumber(transaction.amount); + const operation: Operation = { + id: encodeOperationId(account.id, "", type), + hash: "", + type, + value, + fee, + blockHash: null, + blockHeight: account.blockHeight, + senders: [account.freshAddress], + recipients: [transaction.recipient].filter(Boolean), + accountId: account.id, + transactionSequenceNumber: getNonce(account), + date: new Date(), + extra: { + signUsingHash + } + }; + return operation; +}; + +/** + * Sign Transaction with Ledger hardware + */ +const signOperation = ({ + account, + deviceId, + transaction +}: { + account: Account; + deviceId: any; + transaction: Transaction; +}): Observable => Observable.create(o => { + async function main() { + const transport = await open(deviceId); + + try { + if (!transaction.fees) { + throw new FeeNotLoaded(); + } + + const elrond = new Elrond(transport); + const { + version + } = await elrond.getAppConfiguration(); + const signUsingHash = compareVersions(version, "1.0.11") >= 0; + const unsigned = await buildTransaction(account, transaction, signUsingHash); + o.next({ + type: "device-signature-requested" + }); + const r = await elrond.signTransaction(account.freshAddressPath, unsigned, signUsingHash); + o.next({ + type: "device-signature-granted" + }); + const operation = buildOptimisticOperation(account, transaction, transaction.fees ?? new BigNumber(0), signUsingHash); + o.next({ + type: "signed", + signedOperation: { + operation, + signature: r, + expirationDate: null + } + }); + } finally { + close(transport, deviceId); + } + } + + main().then(() => o.complete(), e => o.error(e)); +}); + +export default signOperation; \ No newline at end of file diff --git a/src/families/elrond/js-synchronisation.js b/src/families/elrond/js-synchronisation.ts similarity index 66% rename from src/families/elrond/js-synchronisation.js rename to src/families/elrond/js-synchronisation.ts index b5bbb9e3a3..4b206652b3 100644 --- a/src/families/elrond/js-synchronisation.js +++ b/src/families/elrond/js-synchronisation.ts @@ -1,27 +1,26 @@ -//@flow import type { Account } from "../../types"; import type { GetAccountShape } from "../../bridge/jsHelpers"; import { makeSync, makeScanAccounts, mergeOps } from "../../bridge/jsHelpers"; - import { getAccount, getOperations } from "./api"; -const getAccountShape: GetAccountShape = async (info) => { - const { id, address, initialAccount } = info; +const getAccountShape: GetAccountShape = async info => { + const { + id, + address, + initialAccount + } = info; const oldOperations = initialAccount?.operations || []; - // Needed for incremental synchronisation - const startAt = - oldOperations.length && oldOperations[0].blockHeight - ? (new Date(oldOperations[0].date).getTime() / 1000 || 0) + 1 - : 0; - + const startAt = oldOperations.length && oldOperations[0].blockHeight ? (new Date(oldOperations[0].date).getTime() / 1000 || 0) + 1 : 0; // get the current account balance state depending your api implementation - const { blockHeight, balance, nonce } = await getAccount(address); - + const { + blockHeight, + balance, + nonce + } = await getAccount(address); // Merge new operations with the previously synced ones const newOperations = await getOperations(id, address, startAt); const operations = mergeOps(oldOperations, newOperations); - const shape = { id, balance, @@ -29,15 +28,15 @@ const getAccountShape: GetAccountShape = async (info) => { operationsCount: operations.length, blockHeight, elrondResources: { - nonce, - }, + nonce + } + }; + return { ...shape, + operations }; - - return { ...shape, operations }; }; const postSync = (initial: Account, parent: Account) => parent; export const scanAccounts = makeScanAccounts(getAccountShape); - -export const sync = makeSync(getAccountShape, postSync); +export const sync = makeSync(getAccountShape, postSync); \ No newline at end of file diff --git a/src/families/elrond/js-transaction.js b/src/families/elrond/js-transaction.ts similarity index 65% rename from src/families/elrond/js-transaction.js rename to src/families/elrond/js-transaction.ts index 820a73cd2a..cbd5bf38b1 100644 --- a/src/families/elrond/js-transaction.js +++ b/src/families/elrond/js-transaction.ts @@ -1,11 +1,10 @@ -// @flow +import { $Shape } from "utility-types"; import { BigNumber } from "bignumber.js"; import type { Account } from "../../types"; import type { Transaction } from "./types"; - import getEstimatedFees from "./js-getFeesForTransaction"; -const sameFees = (a, b) => (!a || !b ? false : a === b); +const sameFees = (a, b) => !a || !b ? false : a === b; /** * Create an empty transaction @@ -16,10 +15,10 @@ export const createTransaction = (): Transaction => { return { family: "elrond", mode: "send", - amount: BigNumber(0), + amount: new BigNumber(0), recipient: "", useAllAmount: false, - fees: BigNumber(50000), + fees: new BigNumber(50000) }; }; @@ -29,11 +28,10 @@ export const createTransaction = (): Transaction => { * @param {*} t * @param {*} patch */ -export const updateTransaction = ( - t: Transaction, - patch: $Shape -) => { - return { ...t, ...patch }; +export const updateTransaction = (t: Transaction, patch: $Shape) => { + return { ...t, + ...patch + }; }; /** @@ -44,12 +42,17 @@ export const updateTransaction = ( */ export const prepareTransaction = async (a: Account, t: Transaction) => { let fees = t.fees; - - fees = await getEstimatedFees({ a, t }); + fees = await getEstimatedFees({ + a, + t, + signUsingHash: true + }); if (!sameFees(t.fees, fees)) { - return { ...t, fees }; + return { ...t, + fees + }; } return t; -}; +}; \ No newline at end of file diff --git a/src/families/elrond/logic.js b/src/families/elrond/logic.ts similarity index 85% rename from src/families/elrond/logic.js rename to src/families/elrond/logic.ts index c4253af9b3..5802a812c1 100644 --- a/src/families/elrond/logic.js +++ b/src/families/elrond/logic.ts @@ -1,7 +1,6 @@ import type { Account } from "../../types"; import type { Transaction } from "./types"; import { Address } from "@elrondnetwork/erdjs"; - export const compareVersions = (versionA: string, versionB: string): number => { let i, diff; const regExStrip0 = /(\.0+)+$/; @@ -11,6 +10,7 @@ export const compareVersions = (versionA: string, versionB: string): number => { for (i = 0; i < minVersionLength; i++) { diff = parseInt(segmentsA[i], 10) - parseInt(segmentsB[i], 10); + if (diff == 0) { continue; } @@ -38,7 +38,6 @@ export const isValidAddress = (address: string): boolean => { return false; } }; - export const isSelfTransaction = (a: Account, t: Transaction): boolean => { return t.recipient === a.freshAddress; }; @@ -50,13 +49,6 @@ export const isSelfTransaction = (a: Account, t: Transaction): boolean => { */ export const getNonce = (a: Account): number => { const lastPendingOp = a.pendingOperations[0]; - - const nonce = Math.max( - a.elrondResources?.nonce || 0, - lastPendingOp && typeof lastPendingOp.transactionSequenceNumber === "number" - ? lastPendingOp.transactionSequenceNumber + 1 - : 0 - ); - + const nonce = Math.max(a.elrondResources?.nonce || 0, lastPendingOp && typeof lastPendingOp.transactionSequenceNumber === "number" ? lastPendingOp.transactionSequenceNumber + 1 : 0); return nonce; -}; +}; \ No newline at end of file diff --git a/src/families/elrond/preload.js b/src/families/elrond/preload.ts similarity index 84% rename from src/families/elrond/preload.js rename to src/families/elrond/preload.ts index a53a228e9b..be723c585b 100644 --- a/src/families/elrond/preload.js +++ b/src/families/elrond/preload.ts @@ -1,17 +1,14 @@ -// @flow import { Observable, Subject } from "rxjs"; import { log } from "@ledgerhq/logs"; - import type { ElrondPreloadData } from "./types"; import { getValidators } from "./api"; - const PRELOAD_MAX_AGE = 30 * 60 * 1000; // 30 minutes let currentPreloadedData: ElrondPreloadData = { - validators: {}, + validators: {} }; -function fromHydratePreloadData(data: mixed): ElrondPreloadData { +function fromHydratePreloadData(data: any): ElrondPreloadData { let foo = null; if (typeof data === "object" && data) { @@ -21,46 +18,38 @@ function fromHydratePreloadData(data: mixed): ElrondPreloadData { } return { - validators: { foo }, + validators: { + foo + } }; } const updates = new Subject(); - export function getCurrentElrondPreloadData(): ElrondPreloadData { return currentPreloadedData; } - export function setElrondPreloadData(data: ElrondPreloadData) { if (data === currentPreloadedData) return; - currentPreloadedData = data; - updates.next(data); } - export function getElrondPreloadDataUpdates(): Observable { return updates.asObservable(); } - export const getPreloadStrategy = () => { return { - preloadMaxAge: PRELOAD_MAX_AGE, + preloadMaxAge: PRELOAD_MAX_AGE }; }; - export const preload = async (): Promise => { log("elrond/preload", "preloading elrond data..."); - const validators = (await getValidators()) || []; - - return { validators }; + return { + validators + }; }; - -export const hydrate = (data: mixed) => { +export const hydrate = (data: unknown) => { const hydrated = fromHydratePreloadData(data); - log("elrond/preload", `hydrated foo with ${hydrated.validators.foo}`); - setElrondPreloadData(hydrated); -}; +}; \ No newline at end of file diff --git a/src/families/elrond/serialization.js b/src/families/elrond/serialization.ts similarity index 76% rename from src/families/elrond/serialization.js rename to src/families/elrond/serialization.ts index 05b458a649..d830e0d17d 100644 --- a/src/families/elrond/serialization.js +++ b/src/families/elrond/serialization.ts @@ -1,16 +1,17 @@ -// @flow import type { ElrondResourcesRaw, ElrondResources } from "./types"; - export function toElrondResourcesRaw(r: ElrondResources): ElrondResourcesRaw { - const { nonce } = r; + const { + nonce + } = r; return { - nonce, + nonce }; } - export function fromElrondResourcesRaw(r: ElrondResourcesRaw): ElrondResources { - const { nonce } = r; + const { + nonce + } = r; return { - nonce, + nonce }; -} +} \ No newline at end of file diff --git a/src/families/elrond/test-dataset.js b/src/families/elrond/test-dataset.js deleted file mode 100644 index 9e29046d82..0000000000 --- a/src/families/elrond/test-dataset.js +++ /dev/null @@ -1,109 +0,0 @@ -// @flow -import { fromTransactionRaw } from "../elrond/transaction"; -import { BigNumber } from "bignumber.js"; -import { - InvalidAddressBecauseDestinationIsAlsoSource, - NotEnoughBalance, - InvalidAddress, -} from "@ledgerhq/errors"; -import type { DatasetTest } from "../../types"; -import type { Transaction } from "./types"; - -const TEST_ADDRESS = - "erd1vgfp3g7azqjx4wsmtt7067m0l62v3psmqzr24j6xvywj2tlz0gesvyzsq2"; - -const dataset: DatasetTest = { - implementations: ["js"], - currencies: { - elrond: { - scanAccounts: [ - { - name: "elrond seed 1", - apdus: ` - => ed030000080000000000000000 - <= 3e6572643176676670336737617a716a783477736d7474373036376d306c3632763370736d717a7232346a36787679776a32746c7a3067657376797a7371329000 - => ed030000080000000080000000 - <= 3e6572643176676670336737617a716a783477736d7474373036376d306c3632763370736d717a7232346a36787679776a32746c7a3067657376797a7371329000 - => ed030000080000000080000001 - <= 3e65726431706d33676a65326c6d643576796c6463767579366a7078676465347261706a70756a76756a6b65653661376a77327a6d6834747172653739367a9000 - `, - }, - ], - accounts: [ - { - raw: { - id: `js:2:elrond:${TEST_ADDRESS}:`, - seedIdentifier: `${TEST_ADDRESS}`, - name: "Elrond 1", - derivationMode: "", - index: 0, - freshAddress: `${TEST_ADDRESS}`, - freshAddressPath: "44'/508'/0'/0/0'", - freshAddresses: [], - blockHeight: 0, - operations: [], - pendingOperations: [], - currencyId: "elrond", - unitMagnitude: 10, - lastSyncDate: "", - balance: "299569965", - }, - transactions: [ - { - name: "recipient and sender must not be the same", - transaction: fromTransactionRaw({ - family: "elrond", - recipient: `${TEST_ADDRESS}`, - amount: "100000000", - mode: "send", - fees: null, - }), - expectedStatus: { - amount: BigNumber("100000000"), - errors: { - recipient: new InvalidAddressBecauseDestinationIsAlsoSource(), - }, - warnings: {}, - }, - }, - { - name: "Not a valid address", - transaction: fromTransactionRaw({ - family: "elrond", - recipient: "elrondinv", - amount: BigNumber("100000000"), - mode: "send", - fees: null, - }), - expectedStatus: { - errors: { - recipient: new InvalidAddress(), - }, - warnings: {}, - }, - }, - { - name: "Not enough balance", - transaction: fromTransactionRaw({ - family: "elrond", - recipient: - "erd1frj909pfums4m8aza596595l9pl56crwdj077vs2aqcw6ynl28wsfkw9rd", - amount: BigNumber("1000000000000000000000000"), - mode: "send", - fees: null, - }), - expectedStatus: { - errors: { - amount: new NotEnoughBalance(), - }, - warnings: {}, - }, - }, - ], - }, - ], - }, - }, -}; - -export default dataset; diff --git a/src/families/elrond/test-dataset.ts b/src/families/elrond/test-dataset.ts new file mode 100644 index 0000000000..14d4ef6c93 --- /dev/null +++ b/src/families/elrond/test-dataset.ts @@ -0,0 +1,91 @@ +import { fromTransactionRaw } from "../elrond/transaction"; +import { BigNumber } from "bignumber.js"; +import { InvalidAddressBecauseDestinationIsAlsoSource, NotEnoughBalance, InvalidAddress } from "@ledgerhq/errors"; +import type { DatasetTest } from "../../types"; +import type { Transaction } from "./types"; +const TEST_ADDRESS = "erd1vgfp3g7azqjx4wsmtt7067m0l62v3psmqzr24j6xvywj2tlz0gesvyzsq2"; +const dataset: DatasetTest = { + implementations: ["js"], + currencies: { + elrond: { + scanAccounts: [{ + name: "elrond seed 1", + apdus: ` + => ed030000080000000000000000 + <= 3e6572643176676670336737617a716a783477736d7474373036376d306c3632763370736d717a7232346a36787679776a32746c7a3067657376797a7371329000 + => ed030000080000000080000000 + <= 3e6572643176676670336737617a716a783477736d7474373036376d306c3632763370736d717a7232346a36787679776a32746c7a3067657376797a7371329000 + => ed030000080000000080000001 + <= 3e65726431706d33676a65326c6d643576796c6463767579366a7078676465347261706a70756a76756a6b65653661376a77327a6d6834747172653739367a9000 + ` + }], + accounts: [{ + raw: { + id: `js:2:elrond:${TEST_ADDRESS}:`, + seedIdentifier: `${TEST_ADDRESS}`, + name: "Elrond 1", + derivationMode: "", + index: 0, + freshAddress: `${TEST_ADDRESS}`, + freshAddressPath: "44'/508'/0'/0/0'", + freshAddresses: [], + blockHeight: 0, + operations: [], + pendingOperations: [], + currencyId: "elrond", + unitMagnitude: 10, + lastSyncDate: "", + balance: "299569965" + }, + transactions: [{ + name: "recipient and sender must not be the same", + transaction: fromTransactionRaw({ + family: "elrond", + recipient: `${TEST_ADDRESS}`, + amount: "100000000", + mode: "send", + fees: null + }), + expectedStatus: { + amount: new BigNumber("100000000"), + errors: { + recipient: new InvalidAddressBecauseDestinationIsAlsoSource() + }, + warnings: {} + } + }, { + name: "Not a valid address", + transaction: fromTransactionRaw({ + family: "elrond", + recipient: "elrondinv", + amount: "100000000", + mode: "send", + fees: null + }), + expectedStatus: { + errors: { + recipient: new InvalidAddress() + }, + warnings: {} + } + }, { + name: "Not enough balance", + transaction: fromTransactionRaw({ + family: "elrond", + recipient: "erd1frj909pfums4m8aza596595l9pl56crwdj077vs2aqcw6ynl28wsfkw9rd", + amount: "1000000000000000000000000", + mode: "send", + fees: null + }), + expectedStatus: { + errors: { + amount: new NotEnoughBalance() + }, + warnings: {} + } + }] + }] + } + } +}; +export default dataset; \ No newline at end of file diff --git a/src/families/elrond/transaction.js b/src/families/elrond/transaction.js deleted file mode 100644 index ce99bf4054..0000000000 --- a/src/families/elrond/transaction.js +++ /dev/null @@ -1,53 +0,0 @@ -// @flow -import type { Transaction, TransactionRaw } from "./types"; -import { BigNumber } from "bignumber.js"; -import { - fromTransactionCommonRaw, - toTransactionCommonRaw, -} from "../../transaction/common"; -import type { Account } from "../../types"; -import { getAccountUnit } from "../../account"; -import { formatCurrencyUnit } from "../../currencies"; - -export const formatTransaction = ( - { mode, amount, recipient, useAllAmount }: Transaction, - account: Account -): string => - ` -${mode.toUpperCase()} ${ - useAllAmount - ? "MAX" - : amount.isZero() - ? "" - : " " + - formatCurrencyUnit(getAccountUnit(account), amount, { - showCode: true, - disableRounding: true, - }) - }${recipient ? `\nTO ${recipient}` : ""}`; - -export const fromTransactionRaw = (tr: TransactionRaw): Transaction => { - const common = fromTransactionCommonRaw(tr); - return { - ...common, - family: tr.family, - mode: tr.mode, - fees: tr.fees ? BigNumber(tr.fees) : null, - }; -}; - -export const toTransactionRaw = (t: Transaction): TransactionRaw => { - const common = toTransactionCommonRaw(t); - return { - ...common, - family: t.family, - mode: t.mode, - fees: t.fees?.toString() || null, - }; -}; - -export default { - formatTransaction, - fromTransactionRaw, - toTransactionRaw, -}; diff --git a/src/families/elrond/transaction.ts b/src/families/elrond/transaction.ts new file mode 100644 index 0000000000..5fd6dbbd74 --- /dev/null +++ b/src/families/elrond/transaction.ts @@ -0,0 +1,37 @@ +import type { Transaction, TransactionRaw } from "./types"; +import { BigNumber } from "bignumber.js"; +import { fromTransactionCommonRaw, toTransactionCommonRaw } from "../../transaction/common"; +import type { Account } from "../../types"; +import { getAccountUnit } from "../../account"; +import { formatCurrencyUnit } from "../../currencies"; +export const formatTransaction = ({ + mode, + amount, + recipient, + useAllAmount +}: Transaction, account: Account): string => ` +${mode.toUpperCase()} ${useAllAmount ? "MAX" : amount.isZero() ? "" : " " + formatCurrencyUnit(getAccountUnit(account), amount, { + showCode: true, + disableRounding: true +})}${recipient ? `\nTO ${recipient}` : ""}`; +export const fromTransactionRaw = (tr: TransactionRaw): Transaction => { + const common = fromTransactionCommonRaw(tr); + return { ...common, + family: tr.family, + mode: tr.mode, + fees: tr.fees ? new BigNumber(tr.fees) : null + }; +}; +export const toTransactionRaw = (t: Transaction): TransactionRaw => { + const common = toTransactionCommonRaw(t); + return { ...common, + family: t.family, + mode: t.mode, + fees: t.fees?.toString() || null + }; +}; +export default { + formatTransaction, + fromTransactionRaw, + toTransactionRaw +}; \ No newline at end of file diff --git a/src/families/elrond/types.js b/src/families/elrond/types.js deleted file mode 100644 index ba11a48234..0000000000 --- a/src/families/elrond/types.js +++ /dev/null @@ -1,65 +0,0 @@ -// @flow -import type { BigNumber } from "bignumber.js"; -import type { - TransactionCommon, - TransactionCommonRaw, -} from "../../types/transaction"; - -export type CoreStatics = {}; - -export type CoreAccountSpecifics = {}; - -export type CoreOperationSpecifics = {}; - -export type CoreCurrencySpecifics = {}; - -export type ElrondResources = {| - nonce: number, -|}; - -/** - * Elrond account resources from raw JSON - */ -export type ElrondResourcesRaw = {| - nonce: number, -|}; - -/** - * Elrond transaction - */ -export type Transaction = {| - ...TransactionCommon, - mode: string, - family: "elrond", - fees: ?BigNumber, -|}; - -/** - * Elrond transaction from a raw JSON - */ -export type TransactionRaw = {| - ...TransactionCommonRaw, - family: "elrond", - mode: string, - fees: ?string, -|}; - -export type ElrondValidator = {| - bls: string, - identity: string, - owner: string, - provider: string, - type: string, - status: string, - nonce: number, - stake: BigNumber, - topUp: BigNumber, - locked: BigNumber, - online: boolean, -|}; - -export type ElrondPreloadData = {| - validators: Object, -|}; - -export const reflect = (_declare: *) => {}; diff --git a/src/families/elrond/types.ts b/src/families/elrond/types.ts new file mode 100644 index 0000000000..2aa8a32287 --- /dev/null +++ b/src/families/elrond/types.ts @@ -0,0 +1,61 @@ +import type { BigNumber } from "bignumber.js"; +import type { TransactionCommon, TransactionCommonRaw } from "../../types/transaction"; +export type CoreStatics = {}; +export type CoreAccountSpecifics = {}; +export type CoreOperationSpecifics = {}; +export type CoreCurrencySpecifics = {}; +export type ElrondResources = { + nonce: number; +}; + +/** + * Elrond account resources from raw JSON + */ +export type ElrondResourcesRaw = { + nonce: number; +}; + +/** + * Elrond transaction + */ +export type Transaction = TransactionCommon & { + mode: string; + family: "elrond"; + fees: BigNumber | null | undefined; + txHash?: string; + sender?: string; + receiver?: string; + value?: BigNumber; + blockHash?: string; + blockHeight?: number; + timestamp?: number; + nonce?: number; + status?: string; + fee?: BigNumber; +}; + +/** + * Elrond transaction from a raw JSON + */ +export type TransactionRaw = TransactionCommonRaw & { + family: "elrond"; + mode: string; + fees: string | null | undefined; +}; +export type ElrondValidator = { + bls: string; + identity: string; + owner: string; + provider: string; + type: string; + status: string; + nonce: number; + stake: BigNumber; + topUp: BigNumber; + locked: BigNumber; + online: boolean; +}; +export type ElrondPreloadData = { + validators: Record; +}; +export const reflect = (_declare: any) => {}; \ No newline at end of file diff --git a/src/generated/account.js b/src/generated/account.js deleted file mode 100644 index 868f18a852..0000000000 --- a/src/generated/account.js +++ /dev/null @@ -1,16 +0,0 @@ -// @flow -import algorand from "../families/algorand/account.js"; -import bitcoin from "../families/bitcoin/account.js"; -import cosmos from "../families/cosmos/account.js"; -import elrond from "../families/elrond/account.js"; -import crypto_org from "../families/crypto_org/account.js"; -import polkadot from "../families/polkadot/account.js"; - -export default { - algorand, - bitcoin, - cosmos, - elrond, - crypto_org, - polkadot, -}; diff --git a/src/generated/account.ts b/src/generated/account.ts index 1b4304f146..ece6073d38 100644 --- a/src/generated/account.ts +++ b/src/generated/account.ts @@ -6,6 +6,8 @@ import cosmos from "../families/cosmos/account"; import crypto_org from "../families/crypto_org/account"; +import elrond from "../families/elrond/account"; + import polkadot from "../families/polkadot/account"; @@ -14,5 +16,6 @@ export default { bitcoin, cosmos, crypto_org, + elrond, polkadot, }; diff --git a/src/generated/bridge/js.js b/src/generated/bridge/js.js deleted file mode 100644 index e55885e1d4..0000000000 --- a/src/generated/bridge/js.js +++ /dev/null @@ -1,20 +0,0 @@ -// @flow -import elrond from "../../families/elrond/bridge/js.js"; -import crypto_org from "../../families/crypto_org/bridge/js.js"; -import ethereum from "../../families/ethereum/bridge/js.js"; -import neo from "../../families/neo/bridge/js.js"; -import polkadot from "../../families/polkadot/bridge/js.js"; -import ripple from "../../families/ripple/bridge/js.js"; -import stellar from "../../families/stellar/bridge/js.js"; -import tron from "../../families/tron/bridge/js.js"; - -export default { - elrond, - crypto_org, - ethereum, - neo, - polkadot, - ripple, - stellar, - tron, -}; diff --git a/src/generated/bridge/js.ts b/src/generated/bridge/js.ts index ab96296a3a..6e98472bf3 100644 --- a/src/generated/bridge/js.ts +++ b/src/generated/bridge/js.ts @@ -1,5 +1,7 @@ import crypto_org from "../../families/crypto_org/bridge/js"; +import elrond from "../../families/elrond/bridge/js"; + import ethereum from "../../families/ethereum/bridge/js"; import neo from "../../families/neo/bridge/js"; @@ -15,6 +17,7 @@ import tron from "../../families/tron/bridge/js"; export default { crypto_org, + elrond, ethereum, neo, polkadot, diff --git a/src/generated/cli-transaction.js b/src/generated/cli-transaction.js deleted file mode 100644 index 227c2fe391..0000000000 --- a/src/generated/cli-transaction.js +++ /dev/null @@ -1,26 +0,0 @@ -// @flow -import algorand from "../families/algorand/cli-transaction.js"; -import bitcoin from "../families/bitcoin/cli-transaction.js"; -import cosmos from "../families/cosmos/cli-transaction.js"; -import elrond from "../families/elrond/cli-transaction.js"; -import crypto_org from "../families/crypto_org/cli-transaction.js"; -import ethereum from "../families/ethereum/cli-transaction.js"; -import polkadot from "../families/polkadot/cli-transaction.js"; -import ripple from "../families/ripple/cli-transaction.js"; -import stellar from "../families/stellar/cli-transaction.js"; -import tezos from "../families/tezos/cli-transaction.js"; -import tron from "../families/tron/cli-transaction.js"; - -export default { - algorand, - bitcoin, - cosmos, - elrond, - crypto_org, - ethereum, - polkadot, - ripple, - stellar, - tezos, - tron, -}; diff --git a/src/generated/cli-transaction.ts b/src/generated/cli-transaction.ts index ec014b0ea3..d53eec91c4 100644 --- a/src/generated/cli-transaction.ts +++ b/src/generated/cli-transaction.ts @@ -6,6 +6,8 @@ import cosmos from "../families/cosmos/cli-transaction"; import crypto_org from "../families/crypto_org/cli-transaction"; +import elrond from "../families/elrond/cli-transaction"; + import ethereum from "../families/ethereum/cli-transaction"; import polkadot from "../families/polkadot/cli-transaction"; @@ -24,6 +26,7 @@ export default { bitcoin, cosmos, crypto_org, + elrond, ethereum, polkadot, ripple, diff --git a/src/generated/hw-getAddress.js b/src/generated/hw-getAddress.js deleted file mode 100644 index f8fc12e01c..0000000000 --- a/src/generated/hw-getAddress.js +++ /dev/null @@ -1,28 +0,0 @@ -// @flow -import algorand from "../families/algorand/hw-getAddress.js"; -import bitcoin from "../families/bitcoin/hw-getAddress.js"; -import cosmos from "../families/cosmos/hw-getAddress.js"; -import elrond from "../families/elrond/hw-getAddress.js"; -import crypto_org from "../families/crypto_org/hw-getAddress.js"; -import ethereum from "../families/ethereum/hw-getAddress.js"; -import neo from "../families/neo/hw-getAddress.js"; -import polkadot from "../families/polkadot/hw-getAddress.js"; -import ripple from "../families/ripple/hw-getAddress.js"; -import stellar from "../families/stellar/hw-getAddress.js"; -import tezos from "../families/tezos/hw-getAddress.js"; -import tron from "../families/tron/hw-getAddress.js"; - -export default { - algorand, - bitcoin, - cosmos, - elrond, - crypto_org, - ethereum, - neo, - polkadot, - ripple, - stellar, - tezos, - tron, -}; diff --git a/src/generated/hw-getAddress.ts b/src/generated/hw-getAddress.ts index d67192b127..2c9ec8648e 100644 --- a/src/generated/hw-getAddress.ts +++ b/src/generated/hw-getAddress.ts @@ -6,6 +6,8 @@ import cosmos from "../families/cosmos/hw-getAddress"; import crypto_org from "../families/crypto_org/hw-getAddress"; +import elrond from "../families/elrond/hw-getAddress"; + import ethereum from "../families/ethereum/hw-getAddress"; import neo from "../families/neo/hw-getAddress"; @@ -26,6 +28,7 @@ export default { bitcoin, cosmos, crypto_org, + elrond, ethereum, neo, polkadot, diff --git a/src/generated/test-dataset.js b/src/generated/test-dataset.js deleted file mode 100644 index d5b1aa3a4b..0000000000 --- a/src/generated/test-dataset.js +++ /dev/null @@ -1,24 +0,0 @@ -// @flow -import algorand from "../families/algorand/test-dataset.js"; -import bitcoin from "../families/bitcoin/test-dataset.js"; -import cosmos from "../families/cosmos/test-dataset.js"; -import elrond from "../families/elrond/test-dataset.js"; -import ethereum from "../families/ethereum/test-dataset.js"; -import polkadot from "../families/polkadot/test-dataset.js"; -import ripple from "../families/ripple/test-dataset.js"; -import stellar from "../families/stellar/test-dataset.js"; -import tezos from "../families/tezos/test-dataset.js"; -import tron from "../families/tron/test-dataset.js"; - -export default { - algorand, - bitcoin, - cosmos, - elrond, - ethereum, - polkadot, - ripple, - stellar, - tezos, - tron, -}; diff --git a/src/generated/test-dataset.ts b/src/generated/test-dataset.ts index cb2e1a4764..5dcb4731f1 100644 --- a/src/generated/test-dataset.ts +++ b/src/generated/test-dataset.ts @@ -4,6 +4,8 @@ import bitcoin from "../families/bitcoin/test-dataset"; import cosmos from "../families/cosmos/test-dataset"; +import elrond from "../families/elrond/test-dataset"; + import ethereum from "../families/ethereum/test-dataset"; import polkadot from "../families/polkadot/test-dataset"; @@ -21,6 +23,7 @@ export default { algorand, bitcoin, cosmos, + elrond, ethereum, polkadot, ripple, diff --git a/src/generated/transaction.js b/src/generated/transaction.js deleted file mode 100644 index 449041c2db..0000000000 --- a/src/generated/transaction.js +++ /dev/null @@ -1,28 +0,0 @@ -// @flow -import algorand from "../families/algorand/transaction.js"; -import bitcoin from "../families/bitcoin/transaction.js"; -import cosmos from "../families/cosmos/transaction.js"; -import elrond from "../families/elrond/transaction.js"; -import crypto_org from "../families/crypto_org/transaction.js"; -import ethereum from "../families/ethereum/transaction.js"; -import neo from "../families/neo/transaction.js"; -import polkadot from "../families/polkadot/transaction.js"; -import ripple from "../families/ripple/transaction.js"; -import stellar from "../families/stellar/transaction.js"; -import tezos from "../families/tezos/transaction.js"; -import tron from "../families/tron/transaction.js"; - -export default { - algorand, - bitcoin, - cosmos, - elrond, - crypto_org, - ethereum, - neo, - polkadot, - ripple, - stellar, - tezos, - tron, -}; diff --git a/src/generated/transaction.ts b/src/generated/transaction.ts index 8c767b75cf..2837705e96 100644 --- a/src/generated/transaction.ts +++ b/src/generated/transaction.ts @@ -6,6 +6,8 @@ import cosmos from "../families/cosmos/transaction"; import crypto_org from "../families/crypto_org/transaction"; +import elrond from "../families/elrond/transaction"; + import ethereum from "../families/ethereum/transaction"; import neo from "../families/neo/transaction"; @@ -26,6 +28,7 @@ export default { bitcoin, cosmos, crypto_org, + elrond, ethereum, neo, polkadot, diff --git a/src/generated/types.js b/src/generated/types.js deleted file mode 100644 index eacc6d5a6c..0000000000 --- a/src/generated/types.js +++ /dev/null @@ -1,220 +0,0 @@ -// @flow -import { reflect as algorandReflect } from "../families/algorand/types"; -import type { CoreStatics as CoreStatics_algorand } from "../families/algorand/types"; -import type { CoreAccountSpecifics as CoreAccountSpecifics_algorand } from "../families/algorand/types"; -import type { CoreOperationSpecifics as CoreOperationSpecifics_algorand } from "../families/algorand/types"; -import type { CoreCurrencySpecifics as CoreCurrencySpecifics_algorand } from "../families/algorand/types"; -import type { Transaction as algorandTransaction } from "../families/algorand/types"; -import type { TransactionRaw as algorandTransactionRaw } from "../families/algorand/types"; -import { reflect as bitcoinReflect } from "../families/bitcoin/types"; -import type { CoreStatics as CoreStatics_bitcoin } from "../families/bitcoin/types"; -import type { CoreAccountSpecifics as CoreAccountSpecifics_bitcoin } from "../families/bitcoin/types"; -import type { CoreOperationSpecifics as CoreOperationSpecifics_bitcoin } from "../families/bitcoin/types"; -import type { CoreCurrencySpecifics as CoreCurrencySpecifics_bitcoin } from "../families/bitcoin/types"; -import type { Transaction as bitcoinTransaction } from "../families/bitcoin/types"; -import type { TransactionRaw as bitcoinTransactionRaw } from "../families/bitcoin/types"; -import type { NetworkInfo as bitcoinNetworkInfo } from "../families/bitcoin/types"; -import type { NetworkInfoRaw as bitcoinNetworkInfoRaw } from "../families/bitcoin/types"; -import { reflect as cosmosReflect } from "../families/cosmos/types"; -import type { CoreStatics as CoreStatics_cosmos } from "../families/cosmos/types"; -import type { CoreAccountSpecifics as CoreAccountSpecifics_cosmos } from "../families/cosmos/types"; -import type { CoreOperationSpecifics as CoreOperationSpecifics_cosmos } from "../families/cosmos/types"; -import type { CoreCurrencySpecifics as CoreCurrencySpecifics_cosmos } from "../families/cosmos/types"; -import type { Transaction as cosmosTransaction } from "../families/cosmos/types"; -import type { TransactionRaw as cosmosTransactionRaw } from "../families/cosmos/types"; -import type { NetworkInfo as cosmosNetworkInfo } from "../families/cosmos/types"; -import type { NetworkInfoRaw as cosmosNetworkInfoRaw } from "../families/cosmos/types"; -import { reflect as elrondReflect } from "../families/elrond/types"; -import type { CoreStatics as CoreStatics_elrond } from "../families/elrond/types"; -import type { CoreAccountSpecifics as CoreAccountSpecifics_elrond } from "../families/elrond/types"; -import type { CoreOperationSpecifics as CoreOperationSpecifics_elrond } from "../families/elrond/types"; -import type { CoreCurrencySpecifics as CoreCurrencySpecifics_elrond } from "../families/elrond/types"; -import type { Transaction as elrondTransaction } from "../families/elrond/types"; -import type { TransactionRaw as elrondTransactionRaw } from "../families/elrond/types"; -import type { NetworkInfo as elrondNetworkInfo } from "../families/elrond/types"; -import type { NetworkInfoRaw as elrondNetworkInfoRaw } from "../families/elrond/types"; -import { reflect as crypto_orgReflect } from "../families/crypto_org/types"; -import type { CoreStatics as CoreStatics_crypto_org } from "../families/crypto_org/types"; -import type { CoreAccountSpecifics as CoreAccountSpecifics_crypto_org } from "../families/crypto_org/types"; -import type { CoreOperationSpecifics as CoreOperationSpecifics_crypto_org } from "../families/crypto_org/types"; -import type { CoreCurrencySpecifics as CoreCurrencySpecifics_crypto_org } from "../families/crypto_org/types"; -import type { Transaction as crypto_orgTransaction } from "../families/crypto_org/types"; -import type { TransactionRaw as crypto_orgTransactionRaw } from "../families/crypto_org/types"; -import type { NetworkInfo as crypto_orgNetworkInfo } from "../families/crypto_org/types"; -import type { NetworkInfoRaw as crypto_orgNetworkInfoRaw } from "../families/crypto_org/types"; -import { reflect as ethereumReflect } from "../families/ethereum/types"; -import type { CoreStatics as CoreStatics_ethereum } from "../families/ethereum/types"; -import type { CoreAccountSpecifics as CoreAccountSpecifics_ethereum } from "../families/ethereum/types"; -import type { CoreOperationSpecifics as CoreOperationSpecifics_ethereum } from "../families/ethereum/types"; -import type { CoreCurrencySpecifics as CoreCurrencySpecifics_ethereum } from "../families/ethereum/types"; -import type { Transaction as ethereumTransaction } from "../families/ethereum/types"; -import type { TransactionRaw as ethereumTransactionRaw } from "../families/ethereum/types"; -import type { NetworkInfo as ethereumNetworkInfo } from "../families/ethereum/types"; -import type { NetworkInfoRaw as ethereumNetworkInfoRaw } from "../families/ethereum/types"; -import { reflect as neoReflect } from "../families/neo/types"; -import type { CoreStatics as CoreStatics_neo } from "../families/neo/types"; -import type { CoreAccountSpecifics as CoreAccountSpecifics_neo } from "../families/neo/types"; -import type { CoreOperationSpecifics as CoreOperationSpecifics_neo } from "../families/neo/types"; -import type { CoreCurrencySpecifics as CoreCurrencySpecifics_neo } from "../families/neo/types"; -import type { Transaction as neoTransaction } from "../families/neo/types"; -import type { TransactionRaw as neoTransactionRaw } from "../families/neo/types"; -import type { NetworkInfo as neoNetworkInfo } from "../families/neo/types"; -import type { NetworkInfoRaw as neoNetworkInfoRaw } from "../families/neo/types"; -import { reflect as polkadotReflect } from "../families/polkadot/types"; -import type { CoreStatics as CoreStatics_polkadot } from "../families/polkadot/types"; -import type { CoreAccountSpecifics as CoreAccountSpecifics_polkadot } from "../families/polkadot/types"; -import type { CoreOperationSpecifics as CoreOperationSpecifics_polkadot } from "../families/polkadot/types"; -import type { CoreCurrencySpecifics as CoreCurrencySpecifics_polkadot } from "../families/polkadot/types"; -import type { Transaction as polkadotTransaction } from "../families/polkadot/types"; -import type { TransactionRaw as polkadotTransactionRaw } from "../families/polkadot/types"; -import { reflect as rippleReflect } from "../families/ripple/types"; -import type { CoreStatics as CoreStatics_ripple } from "../families/ripple/types"; -import type { CoreAccountSpecifics as CoreAccountSpecifics_ripple } from "../families/ripple/types"; -import type { CoreOperationSpecifics as CoreOperationSpecifics_ripple } from "../families/ripple/types"; -import type { CoreCurrencySpecifics as CoreCurrencySpecifics_ripple } from "../families/ripple/types"; -import type { Transaction as rippleTransaction } from "../families/ripple/types"; -import type { TransactionRaw as rippleTransactionRaw } from "../families/ripple/types"; -import type { NetworkInfo as rippleNetworkInfo } from "../families/ripple/types"; -import type { NetworkInfoRaw as rippleNetworkInfoRaw } from "../families/ripple/types"; -import { reflect as stellarReflect } from "../families/stellar/types"; -import type { CoreStatics as CoreStatics_stellar } from "../families/stellar/types"; -import type { CoreAccountSpecifics as CoreAccountSpecifics_stellar } from "../families/stellar/types"; -import type { CoreOperationSpecifics as CoreOperationSpecifics_stellar } from "../families/stellar/types"; -import type { CoreCurrencySpecifics as CoreCurrencySpecifics_stellar } from "../families/stellar/types"; -import type { Transaction as stellarTransaction } from "../families/stellar/types"; -import type { TransactionRaw as stellarTransactionRaw } from "../families/stellar/types"; -import type { NetworkInfo as stellarNetworkInfo } from "../families/stellar/types"; -import type { NetworkInfoRaw as stellarNetworkInfoRaw } from "../families/stellar/types"; -import { reflect as tezosReflect } from "../families/tezos/types"; -import type { CoreStatics as CoreStatics_tezos } from "../families/tezos/types"; -import type { CoreAccountSpecifics as CoreAccountSpecifics_tezos } from "../families/tezos/types"; -import type { CoreOperationSpecifics as CoreOperationSpecifics_tezos } from "../families/tezos/types"; -import type { CoreCurrencySpecifics as CoreCurrencySpecifics_tezos } from "../families/tezos/types"; -import type { Transaction as tezosTransaction } from "../families/tezos/types"; -import type { TransactionRaw as tezosTransactionRaw } from "../families/tezos/types"; -import type { NetworkInfo as tezosNetworkInfo } from "../families/tezos/types"; -import type { NetworkInfoRaw as tezosNetworkInfoRaw } from "../families/tezos/types"; -import { reflect as tronReflect } from "../families/tron/types"; -import type { CoreStatics as CoreStatics_tron } from "../families/tron/types"; -import type { CoreAccountSpecifics as CoreAccountSpecifics_tron } from "../families/tron/types"; -import type { CoreOperationSpecifics as CoreOperationSpecifics_tron } from "../families/tron/types"; -import type { CoreCurrencySpecifics as CoreCurrencySpecifics_tron } from "../families/tron/types"; -import type { Transaction as tronTransaction } from "../families/tron/types"; -import type { TransactionRaw as tronTransactionRaw } from "../families/tron/types"; -import type { NetworkInfo as tronNetworkInfo } from "../families/tron/types"; -import type { NetworkInfoRaw as tronNetworkInfoRaw } from "../families/tron/types"; - -export type SpecificStatics = {} -& CoreStatics_algorand -& CoreStatics_bitcoin -& CoreStatics_cosmos -& CoreStatics_elrond -& CoreStatics_crypto_org -& CoreStatics_ethereum -& CoreStatics_neo -& CoreStatics_polkadot -& CoreStatics_ripple -& CoreStatics_stellar -& CoreStatics_tezos -& CoreStatics_tron -export type CoreAccountSpecifics = {} -& CoreAccountSpecifics_algorand -& CoreAccountSpecifics_bitcoin -& CoreAccountSpecifics_cosmos -& CoreAccountSpecifics_elrond -& CoreAccountSpecifics_crypto_org -& CoreAccountSpecifics_ethereum -& CoreAccountSpecifics_neo -& CoreAccountSpecifics_polkadot -& CoreAccountSpecifics_ripple -& CoreAccountSpecifics_stellar -& CoreAccountSpecifics_tezos -& CoreAccountSpecifics_tron -export type CoreOperationSpecifics = {} -& CoreOperationSpecifics_algorand -& CoreOperationSpecifics_bitcoin -& CoreOperationSpecifics_cosmos -& CoreOperationSpecifics_elrond -& CoreOperationSpecifics_crypto_org -& CoreOperationSpecifics_ethereum -& CoreOperationSpecifics_neo -& CoreOperationSpecifics_polkadot -& CoreOperationSpecifics_ripple -& CoreOperationSpecifics_stellar -& CoreOperationSpecifics_tezos -& CoreOperationSpecifics_tron -export type CoreCurrencySpecifics = {} -& CoreCurrencySpecifics_algorand -& CoreCurrencySpecifics_bitcoin -& CoreCurrencySpecifics_cosmos -& CoreCurrencySpecifics_elrond -& CoreCurrencySpecifics_crypto_org -& CoreCurrencySpecifics_ethereum -& CoreCurrencySpecifics_neo -& CoreCurrencySpecifics_polkadot -& CoreCurrencySpecifics_ripple -& CoreCurrencySpecifics_stellar -& CoreCurrencySpecifics_tezos -& CoreCurrencySpecifics_tron -export type Transaction = - | algorandTransaction - | bitcoinTransaction - | cosmosTransaction - | elrondTransaction - | crypto_orgTransaction - | ethereumTransaction - | neoTransaction - | polkadotTransaction - | rippleTransaction - | stellarTransaction - | tezosTransaction - | tronTransaction -export type TransactionRaw = - | algorandTransactionRaw - | bitcoinTransactionRaw - | cosmosTransactionRaw - | elrondTransactionRaw - | crypto_orgTransactionRaw - | ethereumTransactionRaw - | neoTransactionRaw - | polkadotTransactionRaw - | rippleTransactionRaw - | stellarTransactionRaw - | tezosTransactionRaw - | tronTransactionRaw -export type NetworkInfo = - | bitcoinNetworkInfo - | cosmosNetworkInfo - | elrondNetworkInfo - | crypto_orgNetworkInfo - | ethereumNetworkInfo - | neoNetworkInfo - | rippleNetworkInfo - | stellarNetworkInfo - | tezosNetworkInfo - | tronNetworkInfo -export type NetworkInfoRaw = - | bitcoinNetworkInfoRaw - | cosmosNetworkInfoRaw - | elrondNetworkInfoRaw - | crypto_orgNetworkInfoRaw - | ethereumNetworkInfoRaw - | neoNetworkInfoRaw - | rippleNetworkInfoRaw - | stellarNetworkInfoRaw - | tezosNetworkInfoRaw - | tronNetworkInfoRaw -export const reflectSpecifics = (declare: *) => [ - algorandReflect(declare), - bitcoinReflect(declare), - cosmosReflect(declare), - elrondReflect(declare), - crypto_orgReflect(declare), - ethereumReflect(declare), - neoReflect(declare), - polkadotReflect(declare), - rippleReflect(declare), - stellarReflect(declare), - tezosReflect(declare), - tronReflect(declare), -]; diff --git a/src/generated/types.ts b/src/generated/types.ts index 8e56c94176..4946764137 100644 --- a/src/generated/types.ts +++ b/src/generated/types.ts @@ -32,6 +32,15 @@ import { Transaction as crypto_orgTransaction } from "../families/crypto_org/typ import { TransactionRaw as crypto_orgTransactionRaw } from "../families/crypto_org/types"; import { NetworkInfo as crypto_orgNetworkInfo } from "../families/crypto_org/types"; import { NetworkInfoRaw as crypto_orgNetworkInfoRaw } from "../families/crypto_org/types"; +import { reflect as elrondReflect } from "../families/elrond/types"; +import { CoreStatics as CoreStatics_elrond } from "../families/elrond/types"; +import { CoreAccountSpecifics as CoreAccountSpecifics_elrond } from "../families/elrond/types"; +import { CoreOperationSpecifics as CoreOperationSpecifics_elrond } from "../families/elrond/types"; +import { CoreCurrencySpecifics as CoreCurrencySpecifics_elrond } from "../families/elrond/types"; +import { Transaction as elrondTransaction } from "../families/elrond/types"; +import { TransactionRaw as elrondTransactionRaw } from "../families/elrond/types"; +import { NetworkInfo as elrondNetworkInfo } from "../families/elrond/types"; +import { NetworkInfoRaw as elrondNetworkInfoRaw } from "../families/elrond/types"; import { reflect as ethereumReflect } from "../families/ethereum/types"; import { CoreStatics as CoreStatics_ethereum } from "../families/ethereum/types"; import { CoreAccountSpecifics as CoreAccountSpecifics_ethereum } from "../families/ethereum/types"; @@ -99,6 +108,7 @@ export type SpecificStatics = {} & CoreStatics_bitcoin & CoreStatics_cosmos & CoreStatics_crypto_org +& CoreStatics_elrond & CoreStatics_ethereum & CoreStatics_neo & CoreStatics_polkadot @@ -111,6 +121,7 @@ export type CoreAccountSpecifics = {} & CoreAccountSpecifics_bitcoin & CoreAccountSpecifics_cosmos & CoreAccountSpecifics_crypto_org +& CoreAccountSpecifics_elrond & CoreAccountSpecifics_ethereum & CoreAccountSpecifics_neo & CoreAccountSpecifics_polkadot @@ -123,6 +134,7 @@ export type CoreOperationSpecifics = {} & CoreOperationSpecifics_bitcoin & CoreOperationSpecifics_cosmos & CoreOperationSpecifics_crypto_org +& CoreOperationSpecifics_elrond & CoreOperationSpecifics_ethereum & CoreOperationSpecifics_neo & CoreOperationSpecifics_polkadot @@ -135,6 +147,7 @@ export type CoreCurrencySpecifics = {} & CoreCurrencySpecifics_bitcoin & CoreCurrencySpecifics_cosmos & CoreCurrencySpecifics_crypto_org +& CoreCurrencySpecifics_elrond & CoreCurrencySpecifics_ethereum & CoreCurrencySpecifics_neo & CoreCurrencySpecifics_polkadot @@ -147,6 +160,7 @@ export type Transaction = | bitcoinTransaction | cosmosTransaction | crypto_orgTransaction + | elrondTransaction | ethereumTransaction | neoTransaction | polkadotTransaction @@ -159,6 +173,7 @@ export type TransactionRaw = | bitcoinTransactionRaw | cosmosTransactionRaw | crypto_orgTransactionRaw + | elrondTransactionRaw | ethereumTransactionRaw | neoTransactionRaw | polkadotTransactionRaw @@ -170,6 +185,7 @@ export type NetworkInfo = | bitcoinNetworkInfo | cosmosNetworkInfo | crypto_orgNetworkInfo + | elrondNetworkInfo | ethereumNetworkInfo | neoNetworkInfo | rippleNetworkInfo @@ -180,6 +196,7 @@ export type NetworkInfoRaw = | bitcoinNetworkInfoRaw | cosmosNetworkInfoRaw | crypto_orgNetworkInfoRaw + | elrondNetworkInfoRaw | ethereumNetworkInfoRaw | neoNetworkInfoRaw | rippleNetworkInfoRaw @@ -191,6 +208,7 @@ export const reflectSpecifics = (declare: any): Array<{ OperationMethods: Record bitcoinReflect(declare), cosmosReflect(declare), crypto_orgReflect(declare), + elrondReflect(declare), ethereumReflect(declare), neoReflect(declare), polkadotReflect(declare), From 0a703d2f6ce2589437212650f91fb55866feb562 Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Wed, 11 Aug 2021 18:35:17 +0300 Subject: [PATCH 043/127] lint --- src/account/serialization.ts | 4 +- src/families/elrond/account.ts | 23 +-- src/families/elrond/api/apiCalls.ts | 111 +++++------- src/families/elrond/api/index.ts | 9 +- src/families/elrond/api/sdk.ts | 70 ++++---- src/families/elrond/bridge/js.ts | 14 +- src/families/elrond/cache.ts | 14 +- src/families/elrond/cli-transaction.ts | 35 ++-- src/families/elrond/constants.ts | 6 +- src/families/elrond/hw-app-elrond/index.ts | 77 +++++++-- src/families/elrond/hw-getAddress.ts | 13 +- src/families/elrond/js-broadcast.ts | 17 +- src/families/elrond/js-buildTransaction.ts | 16 +- .../elrond/js-estimateMaxSpendable.ts | 9 +- .../elrond/js-getFeesForTransaction.ts | 4 +- .../elrond/js-getTransactionStatus.ts | 25 ++- src/families/elrond/js-signOperation.ts | 98 ++++++----- src/families/elrond/js-synchronisation.ts | 29 ++-- src/families/elrond/js-transaction.ts | 23 ++- src/families/elrond/logic.ts | 9 +- src/families/elrond/preload.ts | 12 +- src/families/elrond/serialization.ts | 14 +- src/families/elrond/test-dataset.ts | 158 ++++++++++-------- src/families/elrond/transaction.ts | 42 +++-- src/families/elrond/types.ts | 15 +- src/reconciliation.ts | 4 +- src/types/account.ts | 36 ++-- 27 files changed, 490 insertions(+), 397 deletions(-) diff --git a/src/account/serialization.ts b/src/account/serialization.ts index 0e51cf1106..cffc9ada15 100644 --- a/src/account/serialization.ts +++ b/src/account/serialization.ts @@ -38,7 +38,7 @@ import { toElrondResourcesRaw, fromElrondResourcesRaw, } from "../families/elrond/serialization"; -import { +import { toCryptoOrgResourcesRaw, fromCryptoOrgResourcesRaw, } from "../families/crypto_org/serialization"; @@ -773,7 +773,7 @@ export function fromAccountRaw(rawAccount: AccountRaw): Account { if (polkadotResources) { res.polkadotResources = fromPolkadotResourcesRaw(polkadotResources); } - + if (elrondResources) { res.elrondResources = fromElrondResourcesRaw(elrondResources); } diff --git a/src/families/elrond/account.ts b/src/families/elrond/account.ts index 72c93d4388..34dbe61354 100644 --- a/src/families/elrond/account.ts +++ b/src/families/elrond/account.ts @@ -4,20 +4,20 @@ import { getAccountUnit } from "../../account"; import { formatCurrencyUnit } from "../../currencies"; function formatAccountSpecifics(account: Account): string { - const { - elrondResources - } = account; + const { elrondResources } = account; invariant(elrondResources, "elrond account expected"); const unit = getAccountUnit(account); const formatConfig = { disableRounding: true, alwaysShowSign: false, - showCode: true + showCode: true, }; let str = " "; if (account.spendableBalance) { - str += formatCurrencyUnit(unit, account.spendableBalance, formatConfig) + " spendable. "; + str += + formatCurrencyUnit(unit, account.spendableBalance, formatConfig) + + " spendable. "; } else { str += " 0 spendable."; } @@ -29,17 +29,20 @@ function formatAccountSpecifics(account: Account): string { return str; } -function formatOperationSpecifics(op: Operation, unit: Unit | null | undefined): string { - let str = " "; +function formatOperationSpecifics( + _op: Operation, + _unit: Unit | null | undefined +): string { + const str = " "; const formatConfig = { disableRounding: true, alwaysShowSign: false, - showCode: true + showCode: true, }; return str; } export default { formatAccountSpecifics, - formatOperationSpecifics -}; \ No newline at end of file + formatOperationSpecifics, +}; diff --git a/src/families/elrond/api/apiCalls.ts b/src/families/elrond/api/apiCalls.ts index 8674383bce..e611daf481 100644 --- a/src/families/elrond/api/apiCalls.ts +++ b/src/families/elrond/api/apiCalls.ts @@ -1,5 +1,9 @@ import network from "../../../network"; -import { HASH_TRANSACTION, RAW_TRANSACTION, METACHAIN_SHARD } from "../constants"; +import { + HASH_TRANSACTION, + RAW_TRANSACTION, + METACHAIN_SHARD, +} from "../constants"; export default class ElrondApi { private API_URL: string; @@ -7,19 +11,16 @@ export default class ElrondApi { this.API_URL = API_URL; } - async getAccountDetails(addr: String) { + async getAccountDetails(addr: string) { const { - data: { - balance, - nonce - } + data: { balance, nonce }, } = await network({ method: "GET", - url: `${this.API_URL}/accounts/${addr}` + url: `${this.API_URL}/accounts/${addr}`, }); return { balance, - nonce + nonce, }; } @@ -27,13 +28,11 @@ export default class ElrondApi { let data = []; try { - let { - data: { - validators - } + const { + data: { validators }, } = await network({ method: "GET", - url: `${this.API_URL}/validator/statistics` + url: `${this.API_URL}/validator/statistics`, }); data = validators; } catch (error) { @@ -52,46 +51,36 @@ export default class ElrondApi { erd_denomination: denomination, erd_min_gas_limit: gasLimit, erd_min_gas_price: gasPrice, - erd_gas_per_data_byte: gasPerByte - } - } - } + erd_gas_per_data_byte: gasPerByte, + }, + }, + }, } = await network({ method: "GET", - url: `${this.API_URL}/network/config` + url: `${this.API_URL}/network/config`, }); return { chainId, denomination, gasLimit, gasPrice, - gasPerByte + gasPerByte, }; } - async submit({ - operation, - signature, - signUsingHash - }) { - const { - chainId, - gasLimit, - gasPrice - } = await this.getNetworkConfig(); + async submit({ operation, signature, signUsingHash }) { + const { chainId, gasLimit, gasPrice } = await this.getNetworkConfig(); const transactionType = signUsingHash ? HASH_TRANSACTION : RAW_TRANSACTION; const { senders: [sender], recipients: [receiver], value, - transactionSequenceNumber: nonce + transactionSequenceNumber: nonce, } = operation; const { data: { - data: { - txHash: hash - } - } + data: { txHash: hash }, + }, } = await network({ method: "POST", url: `${this.API_URL}/transaction/send`, @@ -104,43 +93,37 @@ export default class ElrondApi { gasLimit, chainID: chainId, signature, - ...transactionType - } + ...transactionType, + }, }); return { - hash + hash, }; } - async getHistory(addr: string, startAt: Number) { - const { - data: transactions - } = await network({ + async getHistory(addr: string, startAt: number) { + const { data: transactions } = await network({ method: "GET", - url: `${this.API_URL}/transactions?condition=should&sender=${addr}&receiver=${addr}&after=${startAt}` + url: `${this.API_URL}/transactions?condition=should&sender=${addr}&receiver=${addr}&after=${startAt}`, }); if (!transactions.length) return transactions; //Account does not have any transactions - return Promise.all(transactions.map(async transaction => { - const { - blockHeight, - blockHash - } = await this.getConfirmedTransaction(transaction.txHash); - return { ...transaction, - blockHash, - blockHeight - }; - })); + return Promise.all( + transactions.map(async (transaction) => { + const { blockHeight, blockHash } = await this.getConfirmedTransaction( + transaction.txHash + ); + return { ...transaction, blockHash, blockHeight }; + }) + ); } async getBlockchainBlockHeight() { const { - data: [{ - nonce: blockHeight - }] + data: [{ nonce: blockHeight }], } = await network({ method: "GET", - url: `${this.API_URL}/blocks?shard=${METACHAIN_SHARD}&fields=nonce` + url: `${this.API_URL}/blocks?shard=${METACHAIN_SHARD}&fields=nonce`, }); return blockHeight; } @@ -149,20 +132,16 @@ export default class ElrondApi { const { data: { data: { - transaction: { - hyperblockNonce, - blockHash - } - } - } + transaction: { hyperblockNonce, blockHash }, + }, + }, } = await network({ method: "GET", - url: `${this.API_URL}/transaction/${txHash}` + url: `${this.API_URL}/transaction/${txHash}`, }); return { blockHeight: hyperblockNonce, - blockHash + blockHash, }; } - -} \ No newline at end of file +} diff --git a/src/families/elrond/api/index.ts b/src/families/elrond/api/index.ts index fcb626c636..65398ce1f9 100644 --- a/src/families/elrond/api/index.ts +++ b/src/families/elrond/api/index.ts @@ -1 +1,8 @@ -export { getAccount, getNetworkConfig, getValidators, getOperations, getFees, broadcastTransaction } from "./sdk"; \ No newline at end of file +export { + getAccount, + getNetworkConfig, + getValidators, + getOperations, + getFees, + broadcastTransaction, +} from "./sdk"; diff --git a/src/families/elrond/api/sdk.ts b/src/families/elrond/api/sdk.ts index 4fd1c956bf..85925aa8cf 100644 --- a/src/families/elrond/api/sdk.ts +++ b/src/families/elrond/api/sdk.ts @@ -5,28 +5,24 @@ import type { Operation, OperationType } from "../../../types"; import { getEnv } from "../../../env"; import { encodeOperationId } from "../../../operation"; import { getTransactionParams } from "../cache"; -import { RecordStoreInvalidSynthax } from "@ledgerhq/hw-transport-mocker"; -let api = new ElrondApi(getEnv("ELROND_API_ENDPOINT")); +const api = new ElrondApi(getEnv("ELROND_API_ENDPOINT")); /** * Get account balances and nonce */ export const getAccount = async (addr: string) => { - const { - balance, - nonce - } = await api.getAccountDetails(addr); + const { balance, nonce } = await api.getAccountDetails(addr); const blockHeight = await api.getBlockchainBlockHeight(); return { blockHeight, balance: new BigNumber(balance), - nonce + nonce, }; }; export const getValidators = async () => { const validators = await api.getValidators(); return { - validators + validators, }; }; export const getNetworkConfig = async () => { @@ -43,7 +39,10 @@ function isSender(transaction: Transaction, addr: string): boolean { /** * Map transaction to an Operation Type */ -function getOperationType(transaction: Transaction, addr: string): OperationType { +function getOperationType( + transaction: Transaction, + addr: string +): OperationType { return isSender(transaction, addr) ? "OUT" : "IN"; } @@ -51,53 +50,64 @@ function getOperationType(transaction: Transaction, addr: string): OperationType * Map transaction to a correct Operation Value (affecting account balance) */ function getOperationValue(transaction: Transaction, addr: string): BigNumber { - return isSender(transaction, addr) ? new BigNumber(transaction.value ?? 0).plus(transaction.fee ?? 0) : new BigNumber(transaction.value ?? 0); + return isSender(transaction, addr) + ? new BigNumber(transaction.value ?? 0).plus(transaction.fee ?? 0) + : new BigNumber(transaction.value ?? 0); } /** * Map the Elrond history transaction to a Ledger Live Operation */ -function transactionToOperation(accountId: string, addr: string, transaction: Transaction): Operation { +function transactionToOperation( + accountId: string, + addr: string, + transaction: Transaction +): Operation { const type = getOperationType(transaction, addr); return { - id: encodeOperationId(accountId, transaction.txHash ?? '', type), + id: encodeOperationId(accountId, transaction.txHash ?? "", type), accountId, fee: new BigNumber(transaction.fee || 0), value: getOperationValue(transaction, addr), type, - hash: transaction.txHash ?? '', + hash: transaction.txHash ?? "", blockHash: transaction.blockHash, blockHeight: transaction.blockHeight, date: new Date(transaction.timestamp ?? 0 * 1000), extra: {}, - senders: [transaction.sender ?? ''], + senders: [transaction.sender ?? ""], recipients: transaction.receiver ? [transaction.receiver] : [], - transactionSequenceNumber: isSender(transaction, addr) ? transaction.nonce : undefined, - hasFailed: !transaction.status || transaction.status === "fail" || transaction.status === "invalid" + transactionSequenceNumber: isSender(transaction, addr) + ? transaction.nonce + : undefined, + hasFailed: + !transaction.status || + transaction.status === "fail" || + transaction.status === "invalid", }; } /** * Fetch operation list */ -export const getOperations = async (accountId: string, addr: string, startAt: Number): Promise => { +export const getOperations = async ( + accountId: string, + addr: string, + startAt: number +): Promise => { const rawTransactions = await api.getHistory(addr, startAt); if (!rawTransactions) return rawTransactions; - return rawTransactions.map(transaction => transactionToOperation(accountId, addr, transaction)); + return rawTransactions.map((transaction) => + transactionToOperation(accountId, addr, transaction) + ); }; /** * Obtain fees from blockchain */ export const getFees = async (unsigned): Promise => { - const { - data - } = unsigned; - const { - gasLimit, - gasPerByte, - gasPrice - } = await getTransactionParams(); + const { data } = unsigned; + const { gasLimit, gasPerByte, gasPrice } = await getTransactionParams(); if (!data) { return new BigNumber(gasLimit * gasPrice); @@ -110,11 +120,9 @@ export const getFees = async (unsigned): Promise => { * Broadcast blob to blockchain */ export const broadcastTransaction = async (blob: any) => { - const { - hash - } = await api.submit(blob); + const { hash } = await api.submit(blob); // Transaction hash is likely to be returned return { - hash + hash, }; -}; \ No newline at end of file +}; diff --git a/src/families/elrond/bridge/js.ts b/src/families/elrond/bridge/js.ts index 5653a4e497..ae97cb8302 100644 --- a/src/families/elrond/bridge/js.ts +++ b/src/families/elrond/bridge/js.ts @@ -3,7 +3,11 @@ import type { Transaction } from "../types"; import { makeAccountBridgeReceive } from "../../../bridge/jsHelpers"; import { getPreloadStrategy, preload, hydrate } from "../preload"; import { sync, scanAccounts } from "../js-synchronisation"; -import { createTransaction, updateTransaction, prepareTransaction } from "../js-transaction"; +import { + createTransaction, + updateTransaction, + prepareTransaction, +} from "../js-transaction"; import getTransactionStatus from "../js-getTransactionStatus"; import estimateMaxSpendable from "../js-estimateMaxSpendable"; import signOperation from "../js-signOperation"; @@ -13,7 +17,7 @@ const currencyBridge: CurrencyBridge = { getPreloadStrategy, preload, hydrate, - scanAccounts + scanAccounts, }; const accountBridge: AccountBridge = { estimateMaxSpendable, @@ -24,9 +28,9 @@ const accountBridge: AccountBridge = { sync, receive, signOperation, - broadcast + broadcast, }; export default { currencyBridge, - accountBridge -}; \ No newline at end of file + accountBridge, +}; diff --git a/src/families/elrond/cache.ts b/src/families/elrond/cache.ts index 864a7d33e5..e76438b47a 100644 --- a/src/families/elrond/cache.ts +++ b/src/families/elrond/cache.ts @@ -10,7 +10,13 @@ import { getNetworkConfig } from "./api"; * * @returns {Promise} txInfo */ -export const getTransactionParams: CacheRes, Record> = makeLRUCache(async (): Promise> => getNetworkConfig(), () => "elrond", { - maxAge: 5 * 60 * 1000 // 5 minutes - -}); \ No newline at end of file +export const getTransactionParams: CacheRes< + Array, + Record +> = makeLRUCache( + async (): Promise> => getNetworkConfig(), + () => "elrond", + { + maxAge: 5 * 60 * 1000, // 5 minutes + } +); diff --git a/src/families/elrond/cli-transaction.ts b/src/families/elrond/cli-transaction.ts index 6a2a81f264..9805948cd2 100644 --- a/src/families/elrond/cli-transaction.ts +++ b/src/families/elrond/cli-transaction.ts @@ -1,21 +1,22 @@ -import BigNumber from "bignumber.js"; import invariant from "invariant"; import flatMap from "lodash/flatMap"; import type { Transaction, AccountLike } from "../../types"; -const options = [{ - name: "mode", - type: String, - desc: "mode of transaction: send" -}]; +const options = [ + { + name: "mode", + type: String, + desc: "mode of transaction: send", + }, +]; -function inferTransactions(transactions: Array<{ - account: AccountLike; - transaction: Transaction; -}>, opts: Record): Transaction[] { - return flatMap(transactions, ({ - transaction, - account - }) => { +function inferTransactions( + transactions: Array<{ + account: AccountLike; + transaction: Transaction; + }>, + _opts: Record +): Transaction[] { + return flatMap(transactions, ({ transaction, account }) => { invariant(transaction.family === "elrond", "elrond family"); if (account.type === "Account") { @@ -23,12 +24,12 @@ function inferTransactions(transactions: Array<{ } transaction.family = "elrond"; - + return transaction; }); } export default { options, - inferTransactions -}; \ No newline at end of file + inferTransactions, +}; diff --git a/src/families/elrond/constants.ts b/src/families/elrond/constants.ts index 89ba443bb2..db42640c4e 100644 --- a/src/families/elrond/constants.ts +++ b/src/families/elrond/constants.ts @@ -1,9 +1,9 @@ export const HASH_TRANSACTION = { version: 2, - options: 1 + options: 1, }; export const RAW_TRANSACTION = { version: 1, - options: 0 + options: 0, }; -export const METACHAIN_SHARD = 4294967295; \ No newline at end of file +export const METACHAIN_SHARD = 4294967295; diff --git a/src/families/elrond/hw-app-elrond/index.ts b/src/families/elrond/hw-app-elrond/index.ts index 4b4fd9cc89..1fed843297 100644 --- a/src/families/elrond/hw-app-elrond/index.ts +++ b/src/families/elrond/hw-app-elrond/index.ts @@ -6,7 +6,7 @@ const CLA = 0xed; const INS = { GET_VERSION: 0x02, GET_ADDRESS: 0x03, - SET_ADDRESS: 0x05 + SET_ADDRESS: 0x05, }; const SIGN_RAW_TX_INS = 0x04; const SIGN_HASH_TX_INS = 0x07; @@ -15,11 +15,21 @@ const ACTIVE_SIGNERS = [SIGN_RAW_TX_INS, SIGN_HASH_TX_INS, SIGN_MESSAGE_INS]; const SW_OK = 0x9000; const SW_CANCEL = 0x6986; export default class Elrond { - transport: Transport; + transport: Transport; - constructor(transport: Transport, scrambleKey: string = "eGLD") { + constructor(transport: Transport, scrambleKey = "eGLD") { this.transport = transport; - transport.decorateAppAPIMethods(this, ["getAddress", "setAddress", "signTransaction", "signMessage", "getAppConfiguration"], scrambleKey); + transport.decorateAppAPIMethods( + this, + [ + "getAddress", + "setAddress", + "signTransaction", + "signMessage", + "getAppConfiguration", + ], + scrambleKey + ); } /** @@ -31,12 +41,17 @@ export default class Elrond { * const { contractData, accountIndex, addressIndex, version } = result; */ async getAppConfiguration(): Promise { - const response = await this.transport.send(CLA, INS.GET_VERSION, 0x00, 0x00); + const response = await this.transport.send( + CLA, + INS.GET_VERSION, + 0x00, + 0x00 + ); return { contractData: response[0], accountIndex: response[1], addressIndex: response[2], - version: `${response[3]}.${response[4]}.${response[5]}` + version: `${response[3]}.${response[4]}.${response[5]}`, }; } @@ -57,16 +72,26 @@ export default class Elrond { * const result = await elrond.getAddress("44'/508'/0'/0'/0'"); * const { address, returnCode } = result; */ - async getAddress(path: string, display?: boolean): Promise<{ + async getAddress( + path: string, + display?: boolean + ): Promise<{ address: string; }> { const bipPath = BIPPath.fromString(path).toPathArray(); const data = this.serializePath(bipPath); - const response = await this.transport.send(CLA, INS.GET_ADDRESS, display ? 0x01 : 0x00, 0x00, data, [SW_OK, SW_CANCEL]); + const response = await this.transport.send( + CLA, + INS.GET_ADDRESS, + display ? 0x01 : 0x00, + 0x00, + data, + [SW_OK, SW_CANCEL] + ); const addressLength = response[0]; const address = response.slice(1, 1 + addressLength).toString("ascii"); return { - address + address, }; } @@ -83,10 +108,21 @@ export default class Elrond { async setAddress(path: string, display?: boolean) { const bipPath = BIPPath.fromString(path).toPathArray(); const data = this.serializePath(bipPath); - await this.transport.send(CLA, INS.SET_ADDRESS, display ? 0x01 : 0x00, 0x00, data, [SW_OK, SW_CANCEL]); + await this.transport.send( + CLA, + INS.SET_ADDRESS, + display ? 0x01 : 0x00, + 0x00, + data, + [SW_OK, SW_CANCEL] + ); } - async signTransaction(path: string, message: string, usingHash: boolean): Promise { + async signTransaction( + path: string, + message: string, + usingHash: boolean + ): Promise { const chunks: Buffer[] = []; const buffer: Buffer = Buffer.from(message); @@ -100,7 +136,9 @@ export default class Elrond { chunks.push(buffer.slice(i, end)); } - return usingHash ? this.sign(chunks, SIGN_HASH_TX_INS) : this.sign(chunks, SIGN_RAW_TX_INS); + return usingHash + ? this.sign(chunks, SIGN_HASH_TX_INS) + : this.sign(chunks, SIGN_RAW_TX_INS); } async signMessage(message: Buffer[]): Promise { @@ -119,14 +157,20 @@ export default class Elrond { ins: type, p1: index === 0 ? 0x00 : CURVE_MASK, p2: CURVE_MASK, - data + data, }; apdus.push(apdu); }); let response: any = {}; - for (let apdu of apdus) { - response = await this.transport.send(apdu.cla, apdu.ins, apdu.p1, apdu.p2, apdu.data); + for (const apdu of apdus) { + response = await this.transport.send( + apdu.cla, + apdu.ins, + apdu.p1, + apdu.p2, + apdu.data + ); } if (response.length !== 67 || response[0] !== 64) { @@ -136,5 +180,4 @@ export default class Elrond { const signature = response.slice(1, response.length - 2).toString("hex"); return signature; } - -} \ No newline at end of file +} diff --git a/src/families/elrond/hw-getAddress.ts b/src/families/elrond/hw-getAddress.ts index 49979f3b71..7e410a465a 100644 --- a/src/families/elrond/hw-getAddress.ts +++ b/src/families/elrond/hw-getAddress.ts @@ -1,19 +1,14 @@ import type { Resolver } from "../../hw/getAddress/types"; import Elrond from "./hw-app-elrond"; -const resolver: Resolver = async (transport, { - path, - verify -}) => { +const resolver: Resolver = async (transport, { path, verify }) => { const elrond = new Elrond(transport); - const { - address - } = await elrond.getAddress(path, verify); + const { address } = await elrond.getAddress(path, verify); return { address, path, - publicKey: '' + publicKey: "", }; }; -export default resolver; \ No newline at end of file +export default resolver; diff --git a/src/families/elrond/js-broadcast.ts b/src/families/elrond/js-broadcast.ts index 668ae5f352..fde3c6991f 100644 --- a/src/families/elrond/js-broadcast.ts +++ b/src/families/elrond/js-broadcast.ts @@ -7,26 +7,19 @@ import { broadcastTransaction } from "./api"; * @param {signature: string, operation: string} signedOperation */ const broadcast = async ({ - signedOperation: { - signature, - operation - } + signedOperation: { signature, operation }, }: { signedOperation: SignedOperation; }): Promise => { const { - extra: { - signUsingHash - } + extra: { signUsingHash }, } = operation; - const { - hash - } = await broadcastTransaction({ + const { hash } = await broadcastTransaction({ operation, signature, - signUsingHash + signUsingHash, }); return patchOperationWithHash(operation, hash); }; -export default broadcast; \ No newline at end of file +export default broadcast; diff --git a/src/families/elrond/js-buildTransaction.ts b/src/families/elrond/js-buildTransaction.ts index 5fd62bebf9..fa55555d87 100644 --- a/src/families/elrond/js-buildTransaction.ts +++ b/src/families/elrond/js-buildTransaction.ts @@ -9,14 +9,14 @@ import { HASH_TRANSACTION, RAW_TRANSACTION } from "./constants"; * @param {Account} a * @param {Transaction} t */ -export const buildTransaction = async (a: Account, t: Transaction, signUsingHash: Boolean = true) => { +export const buildTransaction = async ( + a: Account, + t: Transaction, + signUsingHash = true +) => { const address = a.freshAddress; const nonce = getNonce(a); - const { - gasPrice, - gasLimit, - chainId - } = await getNetworkConfig(); + const { gasPrice, gasLimit, chainId } = await getNetworkConfig(); const transactionType = signUsingHash ? HASH_TRANSACTION : RAW_TRANSACTION; const unsigned = { nonce, @@ -26,8 +26,8 @@ export const buildTransaction = async (a: Account, t: Transaction, signUsingHash gasPrice, gasLimit, chainID: chainId, - ...transactionType + ...transactionType, }; // Will likely be a call to Elrond SDK return JSON.stringify(unsigned); -}; \ No newline at end of file +}; diff --git a/src/families/elrond/js-estimateMaxSpendable.ts b/src/families/elrond/js-estimateMaxSpendable.ts index 97126c806d..a6601e55fa 100644 --- a/src/families/elrond/js-estimateMaxSpendable.ts +++ b/src/families/elrond/js-estimateMaxSpendable.ts @@ -13,16 +13,17 @@ import getEstimatedFees from "./js-getFeesForTransaction"; const estimateMaxSpendable = async ({ account, parentAccount, - transaction + transaction, }: { account: AccountLike; parentAccount: Account | null | undefined; transaction: Transaction | null | undefined; }): Promise => { const a = getMainAccount(account, parentAccount); - const t = { ...createTransaction(), + const t = { + ...createTransaction(), ...transaction, - amount: a.spendableBalance + amount: a.spendableBalance, }; const fees = await getEstimatedFees({ a, @@ -37,4 +38,4 @@ const estimateMaxSpendable = async ({ return a.spendableBalance.minus(fees); }; -export default estimateMaxSpendable; \ No newline at end of file +export default estimateMaxSpendable; diff --git a/src/families/elrond/js-getFeesForTransaction.ts b/src/families/elrond/js-getFeesForTransaction.ts index 9dbb92c6ff..0c9c468d08 100644 --- a/src/families/elrond/js-getFeesForTransaction.ts +++ b/src/families/elrond/js-getFeesForTransaction.ts @@ -13,7 +13,7 @@ import { buildTransaction } from "./js-buildTransaction"; const getEstimatedFees = async ({ a, t, - signUsingHash = true + signUsingHash = true, }: { a: Account; t: Transaction; @@ -23,4 +23,4 @@ const getEstimatedFees = async ({ return await getFees(JSON.parse(unsigned)); }; -export default getEstimatedFees; \ No newline at end of file +export default getEstimatedFees; diff --git a/src/families/elrond/js-getTransactionStatus.ts b/src/families/elrond/js-getTransactionStatus.ts index ba3ce6be52..2ecff160a2 100644 --- a/src/families/elrond/js-getTransactionStatus.ts +++ b/src/families/elrond/js-getTransactionStatus.ts @@ -1,10 +1,19 @@ import { BigNumber } from "bignumber.js"; -import { NotEnoughBalance, RecipientRequired, InvalidAddress, FeeNotLoaded, InvalidAddressBecauseDestinationIsAlsoSource } from "@ledgerhq/errors"; +import { + NotEnoughBalance, + RecipientRequired, + InvalidAddress, + FeeNotLoaded, + InvalidAddressBecauseDestinationIsAlsoSource, +} from "@ledgerhq/errors"; import type { Account, TransactionStatus } from "../../types"; import type { Transaction } from "./types"; import { isValidAddress, isSelfTransaction } from "./logic"; -const getTransactionStatus = async (a: Account, t: Transaction): Promise => { +const getTransactionStatus = async ( + a: Account, + t: Transaction +): Promise => { const errors: Record = {}; const warnings: Record = {}; const useAllAmount = !!t.useAllAmount; @@ -26,8 +35,12 @@ const getTransactionStatus = async (a: Account, t: Transaction): Promise { +const buildOptimisticOperation = ( + account: Account, + transaction: Transaction, + fee: BigNumber, + signUsingHash: boolean +): Operation => { const type = "OUT"; const value = new BigNumber(transaction.amount); const operation: Operation = { @@ -26,8 +31,8 @@ const buildOptimisticOperation = (account: Account, transaction: Transaction, fe transactionSequenceNumber: getNonce(account), date: new Date(), extra: { - signUsingHash - } + signUsingHash, + }, }; return operation; }; @@ -38,48 +43,63 @@ const buildOptimisticOperation = (account: Account, transaction: Transaction, fe const signOperation = ({ account, deviceId, - transaction + transaction, }: { account: Account; deviceId: any; transaction: Transaction; -}): Observable => Observable.create(o => { - async function main() { - const transport = await open(deviceId); - - try { - if (!transaction.fees) { - throw new FeeNotLoaded(); - } +}): Observable => + Observable.create((o) => { + async function main() { + const transport = await open(deviceId); - const elrond = new Elrond(transport); - const { - version - } = await elrond.getAppConfiguration(); - const signUsingHash = compareVersions(version, "1.0.11") >= 0; - const unsigned = await buildTransaction(account, transaction, signUsingHash); - o.next({ - type: "device-signature-requested" - }); - const r = await elrond.signTransaction(account.freshAddressPath, unsigned, signUsingHash); - o.next({ - type: "device-signature-granted" - }); - const operation = buildOptimisticOperation(account, transaction, transaction.fees ?? new BigNumber(0), signUsingHash); - o.next({ - type: "signed", - signedOperation: { - operation, - signature: r, - expirationDate: null + try { + if (!transaction.fees) { + throw new FeeNotLoaded(); } - }); - } finally { - close(transport, deviceId); + + const elrond = new Elrond(transport); + const { version } = await elrond.getAppConfiguration(); + const signUsingHash = compareVersions(version, "1.0.11") >= 0; + const unsigned = await buildTransaction( + account, + transaction, + signUsingHash + ); + o.next({ + type: "device-signature-requested", + }); + const r = await elrond.signTransaction( + account.freshAddressPath, + unsigned, + signUsingHash + ); + o.next({ + type: "device-signature-granted", + }); + const operation = buildOptimisticOperation( + account, + transaction, + transaction.fees ?? new BigNumber(0), + signUsingHash + ); + o.next({ + type: "signed", + signedOperation: { + operation, + signature: r, + expirationDate: null, + }, + }); + } finally { + close(transport, deviceId); + } } - } - main().then(() => o.complete(), e => o.error(e)); -}); + main().then( + () => o.complete(), + (e) => o.error(e) + ); + }); -export default signOperation; \ No newline at end of file +export default signOperation; diff --git a/src/families/elrond/js-synchronisation.ts b/src/families/elrond/js-synchronisation.ts index 4b206652b3..a28feef301 100644 --- a/src/families/elrond/js-synchronisation.ts +++ b/src/families/elrond/js-synchronisation.ts @@ -3,21 +3,16 @@ import type { GetAccountShape } from "../../bridge/jsHelpers"; import { makeSync, makeScanAccounts, mergeOps } from "../../bridge/jsHelpers"; import { getAccount, getOperations } from "./api"; -const getAccountShape: GetAccountShape = async info => { - const { - id, - address, - initialAccount - } = info; +const getAccountShape: GetAccountShape = async (info) => { + const { id, address, initialAccount } = info; const oldOperations = initialAccount?.operations || []; // Needed for incremental synchronisation - const startAt = oldOperations.length && oldOperations[0].blockHeight ? (new Date(oldOperations[0].date).getTime() / 1000 || 0) + 1 : 0; + const startAt = + oldOperations.length && oldOperations[0].blockHeight + ? (new Date(oldOperations[0].date).getTime() / 1000 || 0) + 1 + : 0; // get the current account balance state depending your api implementation - const { - blockHeight, - balance, - nonce - } = await getAccount(address); + const { blockHeight, balance, nonce } = await getAccount(address); // Merge new operations with the previously synced ones const newOperations = await getOperations(id, address, startAt); const operations = mergeOps(oldOperations, newOperations); @@ -28,15 +23,13 @@ const getAccountShape: GetAccountShape = async info => { operationsCount: operations.length, blockHeight, elrondResources: { - nonce - } - }; - return { ...shape, - operations + nonce, + }, }; + return { ...shape, operations }; }; const postSync = (initial: Account, parent: Account) => parent; export const scanAccounts = makeScanAccounts(getAccountShape); -export const sync = makeSync(getAccountShape, postSync); \ No newline at end of file +export const sync = makeSync(getAccountShape, postSync); diff --git a/src/families/elrond/js-transaction.ts b/src/families/elrond/js-transaction.ts index cbd5bf38b1..825febe4a3 100644 --- a/src/families/elrond/js-transaction.ts +++ b/src/families/elrond/js-transaction.ts @@ -4,7 +4,7 @@ import type { Account } from "../../types"; import type { Transaction } from "./types"; import getEstimatedFees from "./js-getFeesForTransaction"; -const sameFees = (a, b) => !a || !b ? false : a === b; +const sameFees = (a, b) => (!a || !b ? false : a === b); /** * Create an empty transaction @@ -18,7 +18,7 @@ export const createTransaction = (): Transaction => { amount: new BigNumber(0), recipient: "", useAllAmount: false, - fees: new BigNumber(50000) + fees: new BigNumber(50000), }; }; @@ -28,10 +28,11 @@ export const createTransaction = (): Transaction => { * @param {*} t * @param {*} patch */ -export const updateTransaction = (t: Transaction, patch: $Shape) => { - return { ...t, - ...patch - }; +export const updateTransaction = ( + t: Transaction, + patch: $Shape +) => { + return { ...t, ...patch }; }; /** @@ -44,15 +45,13 @@ export const prepareTransaction = async (a: Account, t: Transaction) => { let fees = t.fees; fees = await getEstimatedFees({ a, - t, - signUsingHash: true + t, + signUsingHash: true, }); if (!sameFees(t.fees, fees)) { - return { ...t, - fees - }; + return { ...t, fees }; } return t; -}; \ No newline at end of file +}; diff --git a/src/families/elrond/logic.ts b/src/families/elrond/logic.ts index 5802a812c1..3d57642f8a 100644 --- a/src/families/elrond/logic.ts +++ b/src/families/elrond/logic.ts @@ -49,6 +49,11 @@ export const isSelfTransaction = (a: Account, t: Transaction): boolean => { */ export const getNonce = (a: Account): number => { const lastPendingOp = a.pendingOperations[0]; - const nonce = Math.max(a.elrondResources?.nonce || 0, lastPendingOp && typeof lastPendingOp.transactionSequenceNumber === "number" ? lastPendingOp.transactionSequenceNumber + 1 : 0); + const nonce = Math.max( + a.elrondResources?.nonce || 0, + lastPendingOp && typeof lastPendingOp.transactionSequenceNumber === "number" + ? lastPendingOp.transactionSequenceNumber + 1 + : 0 + ); return nonce; -}; \ No newline at end of file +}; diff --git a/src/families/elrond/preload.ts b/src/families/elrond/preload.ts index be723c585b..d55f6a6ec9 100644 --- a/src/families/elrond/preload.ts +++ b/src/families/elrond/preload.ts @@ -5,7 +5,7 @@ import { getValidators } from "./api"; const PRELOAD_MAX_AGE = 30 * 60 * 1000; // 30 minutes let currentPreloadedData: ElrondPreloadData = { - validators: {} + validators: {}, }; function fromHydratePreloadData(data: any): ElrondPreloadData { @@ -19,8 +19,8 @@ function fromHydratePreloadData(data: any): ElrondPreloadData { return { validators: { - foo - } + foo, + }, }; } @@ -38,18 +38,18 @@ export function getElrondPreloadDataUpdates(): Observable { } export const getPreloadStrategy = () => { return { - preloadMaxAge: PRELOAD_MAX_AGE + preloadMaxAge: PRELOAD_MAX_AGE, }; }; export const preload = async (): Promise => { log("elrond/preload", "preloading elrond data..."); const validators = (await getValidators()) || []; return { - validators + validators, }; }; export const hydrate = (data: unknown) => { const hydrated = fromHydratePreloadData(data); log("elrond/preload", `hydrated foo with ${hydrated.validators.foo}`); setElrondPreloadData(hydrated); -}; \ No newline at end of file +}; diff --git a/src/families/elrond/serialization.ts b/src/families/elrond/serialization.ts index d830e0d17d..3e89729118 100644 --- a/src/families/elrond/serialization.ts +++ b/src/families/elrond/serialization.ts @@ -1,17 +1,13 @@ import type { ElrondResourcesRaw, ElrondResources } from "./types"; export function toElrondResourcesRaw(r: ElrondResources): ElrondResourcesRaw { - const { - nonce - } = r; + const { nonce } = r; return { - nonce + nonce, }; } export function fromElrondResourcesRaw(r: ElrondResourcesRaw): ElrondResources { - const { - nonce - } = r; + const { nonce } = r; return { - nonce + nonce, }; -} \ No newline at end of file +} diff --git a/src/families/elrond/test-dataset.ts b/src/families/elrond/test-dataset.ts index 14d4ef6c93..734542c519 100644 --- a/src/families/elrond/test-dataset.ts +++ b/src/families/elrond/test-dataset.ts @@ -1,91 +1,105 @@ import { fromTransactionRaw } from "../elrond/transaction"; import { BigNumber } from "bignumber.js"; -import { InvalidAddressBecauseDestinationIsAlsoSource, NotEnoughBalance, InvalidAddress } from "@ledgerhq/errors"; +import { + InvalidAddressBecauseDestinationIsAlsoSource, + NotEnoughBalance, + InvalidAddress, +} from "@ledgerhq/errors"; import type { DatasetTest } from "../../types"; import type { Transaction } from "./types"; -const TEST_ADDRESS = "erd1vgfp3g7azqjx4wsmtt7067m0l62v3psmqzr24j6xvywj2tlz0gesvyzsq2"; +const TEST_ADDRESS = + "erd1vgfp3g7azqjx4wsmtt7067m0l62v3psmqzr24j6xvywj2tlz0gesvyzsq2"; const dataset: DatasetTest = { implementations: ["js"], currencies: { elrond: { - scanAccounts: [{ - name: "elrond seed 1", - apdus: ` + scanAccounts: [ + { + name: "elrond seed 1", + apdus: ` => ed030000080000000000000000 <= 3e6572643176676670336737617a716a783477736d7474373036376d306c3632763370736d717a7232346a36787679776a32746c7a3067657376797a7371329000 => ed030000080000000080000000 <= 3e6572643176676670336737617a716a783477736d7474373036376d306c3632763370736d717a7232346a36787679776a32746c7a3067657376797a7371329000 => ed030000080000000080000001 <= 3e65726431706d33676a65326c6d643576796c6463767579366a7078676465347261706a70756a76756a6b65653661376a77327a6d6834747172653739367a9000 - ` - }], - accounts: [{ - raw: { - id: `js:2:elrond:${TEST_ADDRESS}:`, - seedIdentifier: `${TEST_ADDRESS}`, - name: "Elrond 1", - derivationMode: "", - index: 0, - freshAddress: `${TEST_ADDRESS}`, - freshAddressPath: "44'/508'/0'/0/0'", - freshAddresses: [], - blockHeight: 0, - operations: [], - pendingOperations: [], - currencyId: "elrond", - unitMagnitude: 10, - lastSyncDate: "", - balance: "299569965" + `, }, - transactions: [{ - name: "recipient and sender must not be the same", - transaction: fromTransactionRaw({ - family: "elrond", - recipient: `${TEST_ADDRESS}`, - amount: "100000000", - mode: "send", - fees: null - }), - expectedStatus: { - amount: new BigNumber("100000000"), - errors: { - recipient: new InvalidAddressBecauseDestinationIsAlsoSource() + ], + accounts: [ + { + raw: { + id: `js:2:elrond:${TEST_ADDRESS}:`, + seedIdentifier: `${TEST_ADDRESS}`, + name: "Elrond 1", + derivationMode: "", + index: 0, + freshAddress: `${TEST_ADDRESS}`, + freshAddressPath: "44'/508'/0'/0/0'", + freshAddresses: [], + blockHeight: 0, + operations: [], + pendingOperations: [], + currencyId: "elrond", + unitMagnitude: 10, + lastSyncDate: "", + balance: "299569965", + }, + transactions: [ + { + name: "recipient and sender must not be the same", + transaction: fromTransactionRaw({ + family: "elrond", + recipient: `${TEST_ADDRESS}`, + amount: "100000000", + mode: "send", + fees: null, + }), + expectedStatus: { + amount: new BigNumber("100000000"), + errors: { + recipient: new InvalidAddressBecauseDestinationIsAlsoSource(), + }, + warnings: {}, + }, }, - warnings: {} - } - }, { - name: "Not a valid address", - transaction: fromTransactionRaw({ - family: "elrond", - recipient: "elrondinv", - amount: "100000000", - mode: "send", - fees: null - }), - expectedStatus: { - errors: { - recipient: new InvalidAddress() + { + name: "Not a valid address", + transaction: fromTransactionRaw({ + family: "elrond", + recipient: "elrondinv", + amount: "100000000", + mode: "send", + fees: null, + }), + expectedStatus: { + errors: { + recipient: new InvalidAddress(), + }, + warnings: {}, + }, }, - warnings: {} - } - }, { - name: "Not enough balance", - transaction: fromTransactionRaw({ - family: "elrond", - recipient: "erd1frj909pfums4m8aza596595l9pl56crwdj077vs2aqcw6ynl28wsfkw9rd", - amount: "1000000000000000000000000", - mode: "send", - fees: null - }), - expectedStatus: { - errors: { - amount: new NotEnoughBalance() + { + name: "Not enough balance", + transaction: fromTransactionRaw({ + family: "elrond", + recipient: + "erd1frj909pfums4m8aza596595l9pl56crwdj077vs2aqcw6ynl28wsfkw9rd", + amount: "1000000000000000000000000", + mode: "send", + fees: null, + }), + expectedStatus: { + errors: { + amount: new NotEnoughBalance(), + }, + warnings: {}, + }, }, - warnings: {} - } - }] - }] - } - } + ], + }, + ], + }, + }, }; -export default dataset; \ No newline at end of file +export default dataset; diff --git a/src/families/elrond/transaction.ts b/src/families/elrond/transaction.ts index 5fd6dbbd74..8424fac232 100644 --- a/src/families/elrond/transaction.ts +++ b/src/families/elrond/transaction.ts @@ -1,37 +1,47 @@ import type { Transaction, TransactionRaw } from "./types"; import { BigNumber } from "bignumber.js"; -import { fromTransactionCommonRaw, toTransactionCommonRaw } from "../../transaction/common"; +import { + fromTransactionCommonRaw, + toTransactionCommonRaw, +} from "../../transaction/common"; import type { Account } from "../../types"; import { getAccountUnit } from "../../account"; import { formatCurrencyUnit } from "../../currencies"; -export const formatTransaction = ({ - mode, - amount, - recipient, +export const formatTransaction = ( + { mode, amount, recipient, useAllAmount }: Transaction, + account: Account +): string => ` +${mode.toUpperCase()} ${ useAllAmount -}: Transaction, account: Account): string => ` -${mode.toUpperCase()} ${useAllAmount ? "MAX" : amount.isZero() ? "" : " " + formatCurrencyUnit(getAccountUnit(account), amount, { - showCode: true, - disableRounding: true -})}${recipient ? `\nTO ${recipient}` : ""}`; + ? "MAX" + : amount.isZero() + ? "" + : " " + + formatCurrencyUnit(getAccountUnit(account), amount, { + showCode: true, + disableRounding: true, + }) +}${recipient ? `\nTO ${recipient}` : ""}`; export const fromTransactionRaw = (tr: TransactionRaw): Transaction => { const common = fromTransactionCommonRaw(tr); - return { ...common, + return { + ...common, family: tr.family, mode: tr.mode, - fees: tr.fees ? new BigNumber(tr.fees) : null + fees: tr.fees ? new BigNumber(tr.fees) : null, }; }; export const toTransactionRaw = (t: Transaction): TransactionRaw => { const common = toTransactionCommonRaw(t); - return { ...common, + return { + ...common, family: t.family, mode: t.mode, - fees: t.fees?.toString() || null + fees: t.fees?.toString() || null, }; }; export default { formatTransaction, fromTransactionRaw, - toTransactionRaw -}; \ No newline at end of file + toTransactionRaw, +}; diff --git a/src/families/elrond/types.ts b/src/families/elrond/types.ts index 2aa8a32287..67a5fc6818 100644 --- a/src/families/elrond/types.ts +++ b/src/families/elrond/types.ts @@ -1,9 +1,12 @@ import type { BigNumber } from "bignumber.js"; -import type { TransactionCommon, TransactionCommonRaw } from "../../types/transaction"; -export type CoreStatics = {}; -export type CoreAccountSpecifics = {}; -export type CoreOperationSpecifics = {}; -export type CoreCurrencySpecifics = {}; +import type { + TransactionCommon, + TransactionCommonRaw, +} from "../../types/transaction"; +export type CoreStatics = Record; +export type CoreAccountSpecifics = Record; +export type CoreOperationSpecifics = Record; +export type CoreCurrencySpecifics = Record; export type ElrondResources = { nonce: number; }; @@ -58,4 +61,4 @@ export type ElrondValidator = { export type ElrondPreloadData = { validators: Record; }; -export const reflect = (_declare: any) => {}; \ No newline at end of file +export const reflect = (_declare: any) => {}; diff --git a/src/reconciliation.ts b/src/reconciliation.ts index de34de7adc..e49eec3bc5 100644 --- a/src/reconciliation.ts +++ b/src/reconciliation.ts @@ -356,8 +356,8 @@ export function patchAccount( next.elrondResources = fromElrondResourcesRaw(updatedRaw.elrondResources); changed = true; } - - if ( + + if ( updatedRaw.cryptoOrgResources && // @ts-expect-error types don't overlap ¯\_(ツ)_/¯ account.cryptoOrgResources !== updatedRaw.cryptoOrgResources diff --git a/src/types/account.ts b/src/types/account.ts index f910f035c7..f2789f500c 100644 --- a/src/types/account.ts +++ b/src/types/account.ts @@ -275,24 +275,24 @@ export type AccountRaw = { operationsCount?: number; // this is optional for backward compat // ------------------------------------- Specific raw fields - currencyId: string, - operations: OperationRaw[], - pendingOperations: OperationRaw[], - unitMagnitude: number, - lastSyncDate: string, - endpointConfig?: string | null | undefined, - subAccounts?: SubAccountRaw[], - balanceHistory?: BalanceHistoryRawMap, - balanceHistoryCache?: BalanceHistoryCache, - bitcoinResources?: BitcoinResourcesRaw, - tronResources?: TronResourcesRaw, - cosmosResources?: CosmosResourcesRaw, - algorandResources?: AlgorandResourcesRaw, - polkadotResources?: PolkadotResourcesRaw, - elrondResources?: ElrondResourcesRaw, - cryptoOrgResources?: CryptoOrgResourcesRaw, - swapHistory?: SwapOperationRaw[], - syncHash?: string, + currencyId: string; + operations: OperationRaw[]; + pendingOperations: OperationRaw[]; + unitMagnitude: number; + lastSyncDate: string; + endpointConfig?: string | null | undefined; + subAccounts?: SubAccountRaw[]; + balanceHistory?: BalanceHistoryRawMap; + balanceHistoryCache?: BalanceHistoryCache; + bitcoinResources?: BitcoinResourcesRaw; + tronResources?: TronResourcesRaw; + cosmosResources?: CosmosResourcesRaw; + algorandResources?: AlgorandResourcesRaw; + polkadotResources?: PolkadotResourcesRaw; + elrondResources?: ElrondResourcesRaw; + cryptoOrgResources?: CryptoOrgResourcesRaw; + swapHistory?: SwapOperationRaw[]; + syncHash?: string; }; export type SubAccountRaw = TokenAccountRaw | ChildAccountRaw; export type AccountRawLike = AccountRaw | SubAccountRaw; From 7c31bae9563daf2118a6d1e0c766f1d411c17a98 Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Wed, 11 Aug 2021 18:45:34 +0300 Subject: [PATCH 044/127] formatOperationSpecifics empty --- src/families/elrond/account.ts | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/families/elrond/account.ts b/src/families/elrond/account.ts index 34dbe61354..199eb38f8c 100644 --- a/src/families/elrond/account.ts +++ b/src/families/elrond/account.ts @@ -33,13 +33,7 @@ function formatOperationSpecifics( _op: Operation, _unit: Unit | null | undefined ): string { - const str = " "; - const formatConfig = { - disableRounding: true, - alwaysShowSign: false, - showCode: true, - }; - return str; + return ""; } export default { From 3e0aa6a65c67546fabd6688d93d238a9b0acca58 Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Thu, 12 Aug 2021 10:57:42 +0300 Subject: [PATCH 045/127] elrond network info types --- src/families/elrond/types.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/families/elrond/types.ts b/src/families/elrond/types.ts index 67a5fc6818..ff114f212b 100644 --- a/src/families/elrond/types.ts +++ b/src/families/elrond/types.ts @@ -1,4 +1,5 @@ import type { BigNumber } from "bignumber.js"; +import { RangeRaw } from "../../range"; import type { TransactionCommon, TransactionCommonRaw, @@ -58,6 +59,16 @@ export type ElrondValidator = { locked: BigNumber; online: boolean; }; + +export type NetworkInfo = { + family: "elrond"; + gasPrice: Range; +}; +export type NetworkInfoRaw = { + family: "elrond"; + gasPrice: RangeRaw; +}; + export type ElrondPreloadData = { validators: Record; }; From 87f24747a640ee1d9099889d7f3b1090884e6499 Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Thu, 12 Aug 2021 10:59:26 +0300 Subject: [PATCH 046/127] remove react flags(overwritten issue) --- scripts/build-ts.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build-ts.sh b/scripts/build-ts.sh index c7035d2aaf..a66521a463 100755 --- a/scripts/build-ts.sh +++ b/scripts/build-ts.sh @@ -2,7 +2,7 @@ set -e -rm -rf lib src/data/icons/react* +rm -rf lib src/data/icons/react* src/data/flags/react* bash ./scripts/sync-families-dispatch.sh node scripts/buildReactIcons.js node scripts/buildReactFlags.js From 11a6e6cbacf91967d0a17ec335bbe15330842837 Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Thu, 12 Aug 2021 17:44:04 +0300 Subject: [PATCH 047/127] remove erdjs dependency --- package.json | 1 - src/families/elrond/logic.ts | 38 ++++++++++++++++++++++++++++++++++-- 2 files changed, 36 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 070d6a5979..8c91d656b5 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,6 @@ "react-redux": "7" }, "dependencies": { - "@elrondnetwork/erdjs": "^6.5.1", "@crypto-com/chain-jslib": "^0.0.16", "@ledgerhq/compressjs": "1.3.2", "@ledgerhq/cryptoassets": "6.4.0", diff --git a/src/families/elrond/logic.ts b/src/families/elrond/logic.ts index 3d57642f8a..a37f08c410 100644 --- a/src/families/elrond/logic.ts +++ b/src/families/elrond/logic.ts @@ -1,6 +1,16 @@ import type { Account } from "../../types"; import type { Transaction } from "./types"; -import { Address } from "@elrondnetwork/erdjs"; +import * as bech32 from "bech32"; +/** + * The human-readable-part of the bech32 addresses. + */ +const HRP = "erd"; + + /** + * The length (in bytes) of a public key (from which a bech32 address can be obtained). + */ +const PUBKEY_LENGTH = 32; + export const compareVersions = (versionA: string, versionB: string): number => { let i, diff; const regExStrip0 = /(\.0+)+$/; @@ -25,6 +35,30 @@ export const compareVersions = (versionA: string, versionB: string): number => { return segmentsA.length - segmentsB.length; }; + + +function fromBech32(value: string): string { + let decoded; + + try { + decoded = bech32.decode(value); + } catch (err) { + throw new Error("Erd address can't be created"); + } + + let prefix = decoded.prefix; + if (prefix != HRP) { + throw new Error("Bad HRP"); + } + + let pubkey = Buffer.from(bech32.fromWords(decoded.words)); + if (pubkey.length != PUBKEY_LENGTH) { + throw new Error("Erd address can't be created"); + } + + return value; +} + /** * Returns true if address is a valid bech32 * @@ -32,7 +66,7 @@ export const compareVersions = (versionA: string, versionB: string): number => { */ export const isValidAddress = (address: string): boolean => { try { - new Address(address); + fromBech32(address); return true; } catch (error) { return false; From 4a512d12ab67d17626a1a6f6c29128ca56924cdf Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Thu, 12 Aug 2021 18:32:46 +0300 Subject: [PATCH 048/127] lint issues --- src/families/elrond/logic.ts | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/families/elrond/logic.ts b/src/families/elrond/logic.ts index a37f08c410..d909054826 100644 --- a/src/families/elrond/logic.ts +++ b/src/families/elrond/logic.ts @@ -1,6 +1,7 @@ import type { Account } from "../../types"; import type { Transaction } from "./types"; import * as bech32 from "bech32"; + /** * The human-readable-part of the bech32 addresses. */ @@ -35,25 +36,23 @@ export const compareVersions = (versionA: string, versionB: string): number => { return segmentsA.length - segmentsB.length; }; - - function fromBech32(value: string): string { let decoded; try { - decoded = bech32.decode(value); + decoded = bech32.decode(value); } catch (err) { - throw new Error("Erd address can't be created"); + throw new Error("Erd address can't be created"); } - let prefix = decoded.prefix; + const prefix = decoded.prefix; if (prefix != HRP) { - throw new Error("Bad HRP"); + throw new Error("Bad HRP"); } - let pubkey = Buffer.from(bech32.fromWords(decoded.words)); + const pubkey = Buffer.from(bech32.fromWords(decoded.words)); if (pubkey.length != PUBKEY_LENGTH) { - throw new Error("Erd address can't be created"); + throw new Error("Erd address can't be created"); } return value; From 70d0a7cee92e9bcffd9099a2a9e5ee6c5c7ed2bc Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Thu, 12 Aug 2021 18:33:37 +0300 Subject: [PATCH 049/127] recipient address required --- src/families/elrond/logic.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/families/elrond/logic.ts b/src/families/elrond/logic.ts index d909054826..96c7713fa6 100644 --- a/src/families/elrond/logic.ts +++ b/src/families/elrond/logic.ts @@ -64,6 +64,10 @@ function fromBech32(value: string): string { * @param {string} address */ export const isValidAddress = (address: string): boolean => { + if (!address) { + return false; + } + try { fromBech32(address); return true; From 042743bccd72efa420a674e2867c8d8118b4b86b Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Fri, 13 Aug 2021 08:48:12 +0300 Subject: [PATCH 050/127] empty recipient address --- src/families/elrond/logic.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/families/elrond/logic.ts b/src/families/elrond/logic.ts index 96c7713fa6..2f58b0b745 100644 --- a/src/families/elrond/logic.ts +++ b/src/families/elrond/logic.ts @@ -64,10 +64,10 @@ function fromBech32(value: string): string { * @param {string} address */ export const isValidAddress = (address: string): boolean => { - if (!address) { + if (address === '') { return false; } - + try { fromBech32(address); return true; From 38349dbe6d383b0ea235cbda095100e1625d08e2 Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Fri, 13 Aug 2021 08:55:58 +0300 Subject: [PATCH 051/127] fix lint issues --- src/families/elrond/logic.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/families/elrond/logic.ts b/src/families/elrond/logic.ts index 2f58b0b745..a740f56f4e 100644 --- a/src/families/elrond/logic.ts +++ b/src/families/elrond/logic.ts @@ -7,7 +7,7 @@ import * as bech32 from "bech32"; */ const HRP = "erd"; - /** +/** * The length (in bytes) of a public key (from which a bech32 address can be obtained). */ const PUBKEY_LENGTH = 32; @@ -64,7 +64,7 @@ function fromBech32(value: string): string { * @param {string} address */ export const isValidAddress = (address: string): boolean => { - if (address === '') { + if (address === "") { return false; } From c035c6775410102e176115c916d2969210918fda Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Fri, 13 Aug 2021 10:05:42 +0300 Subject: [PATCH 052/127] transaction status empty string recipient --- src/families/elrond/js-getTransactionStatus.ts | 2 +- src/families/elrond/logic.ts | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/families/elrond/js-getTransactionStatus.ts b/src/families/elrond/js-getTransactionStatus.ts index 2ecff160a2..5457415342 100644 --- a/src/families/elrond/js-getTransactionStatus.ts +++ b/src/families/elrond/js-getTransactionStatus.ts @@ -18,7 +18,7 @@ const getTransactionStatus = async ( const warnings: Record = {}; const useAllAmount = !!t.useAllAmount; - if (!t.recipient) { + if (!t.recipient || t.recipient === "") { errors.recipient = new RecipientRequired(); } diff --git a/src/families/elrond/logic.ts b/src/families/elrond/logic.ts index a740f56f4e..953011eccb 100644 --- a/src/families/elrond/logic.ts +++ b/src/families/elrond/logic.ts @@ -64,10 +64,6 @@ function fromBech32(value: string): string { * @param {string} address */ export const isValidAddress = (address: string): boolean => { - if (address === "") { - return false; - } - try { fromBech32(address); return true; From 5a7f8a73e63d4a16414ac27f5e0ff4b295794d31 Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Fri, 13 Aug 2021 10:18:40 +0300 Subject: [PATCH 053/127] precedence in recipient error --- src/families/elrond/js-getTransactionStatus.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/families/elrond/js-getTransactionStatus.ts b/src/families/elrond/js-getTransactionStatus.ts index 5457415342..673c85b854 100644 --- a/src/families/elrond/js-getTransactionStatus.ts +++ b/src/families/elrond/js-getTransactionStatus.ts @@ -18,15 +18,11 @@ const getTransactionStatus = async ( const warnings: Record = {}; const useAllAmount = !!t.useAllAmount; - if (!t.recipient || t.recipient === "") { + if (!t.recipient) { errors.recipient = new RecipientRequired(); - } - - if (isSelfTransaction(a, t)) { + } else if (isSelfTransaction(a, t)) { errors.recipient = new InvalidAddressBecauseDestinationIsAlsoSource(); - } - - if (!isValidAddress(t.recipient)) { + } else if (!isValidAddress(t.recipient)) { errors.recipient = new InvalidAddress(); } From 5a6cb5634c190bd0503296c5f7d8df07c2075ebc Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Mon, 23 Aug 2021 13:39:02 +0300 Subject: [PATCH 054/127] configure elrond bot --- src/families/elrond/specs.ts | 74 ++++++++++++++++++++++++++++++++++++ src/generated/specs.ts | 3 ++ 2 files changed, 77 insertions(+) create mode 100644 src/families/elrond/specs.ts diff --git a/src/families/elrond/specs.ts b/src/families/elrond/specs.ts new file mode 100644 index 0000000000..7b69195077 --- /dev/null +++ b/src/families/elrond/specs.ts @@ -0,0 +1,74 @@ +import type { + Transaction, +} from "../../families/elrond/types"; +import invariant from "invariant"; +import { getCryptoCurrencyById, parseCurrencyUnit } from "../../currencies"; +import { pickSiblings } from "../../bot/specs"; +import type { AppSpec } from "../../bot/types"; +import { toOperationRaw } from "../../account"; +import { DeviceModelId } from "@ledgerhq/devices"; + +const currency = getCryptoCurrencyById("elrond"); +const EXISTENTIAL_DEPOSIT = parseCurrencyUnit(currency.units[0], "1.0"); +const ELROND_MIN_SAFE = parseCurrencyUnit(currency.units[0], "0.05"); +const elrondSpec: AppSpec = { + name: "Elrond", + currency: getCryptoCurrencyById("elrond"), + appQuery: { + model: DeviceModelId.nanoS, + appName: "Elrond", + }, + testTimeout: 2 * 60 * 1000, + transactionCheck: ({ maxSpendable }) => { + invariant(maxSpendable.gt(ELROND_MIN_SAFE), "balance is too low"); + }, + test: ({ operation, optimisticOperation }) => { + const opExpected: Record = toOperationRaw({ + ...optimisticOperation, + }); + delete opExpected.value; + delete opExpected.fee; + delete opExpected.date; + delete opExpected.blockHash; + delete opExpected.blockHeight; + expect(toOperationRaw(operation)).toMatchObject(opExpected); + }, + mutations: [ + { + name: "send 50%~", + maxRun: 1, + transaction: ({ account, siblings, bridge }) => { + const sibling = pickSiblings(siblings, 2); + let amount = account.spendableBalance + .div(1.9 + 0.2 * Math.random()) + .integerValue(); + + if (!sibling.used && amount.lt(EXISTENTIAL_DEPOSIT)) { + invariant( + account.spendableBalance.gt( + EXISTENTIAL_DEPOSIT.plus(ELROND_MIN_SAFE) + ), + "send is too low to activate account" + ); + amount = EXISTENTIAL_DEPOSIT.plus(ELROND_MIN_SAFE); + } + + return { + transaction: bridge.createTransaction(account), + updates: [ + { + recipient: pickSiblings(siblings, 1).freshAddress, + }, + { + amount, + }, + ], + }; + }, + }, + ] +}; + +export default { + elrondSpec, +}; \ No newline at end of file diff --git a/src/generated/specs.ts b/src/generated/specs.ts index 9ecdeb53f3..528c06fe13 100644 --- a/src/generated/specs.ts +++ b/src/generated/specs.ts @@ -4,6 +4,8 @@ import bitcoin from "../families/bitcoin/specs"; import cosmos from "../families/cosmos/specs"; +import elrond from "../families/elrond/specs"; + import ethereum from "../families/ethereum/specs"; import polkadot from "../families/polkadot/specs"; @@ -19,6 +21,7 @@ export default { algorand, bitcoin, cosmos, + elrond, ethereum, polkadot, ripple, From bf640874e4628f65314a6b4d8f62166f055bbaea Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Mon, 23 Aug 2021 16:55:01 +0300 Subject: [PATCH 055/127] add speculos device actions --- src/families/elrond/specs.ts | 13 +++--- src/families/elrond/speculos-deviceActions.ts | 46 +++++++++++++++++++ src/generated/specs.ts | 6 +-- src/generated/speculos-deviceActions.ts | 3 ++ 4 files changed, 58 insertions(+), 10 deletions(-) create mode 100644 src/families/elrond/speculos-deviceActions.ts diff --git a/src/families/elrond/specs.ts b/src/families/elrond/specs.ts index 7b69195077..88ab72a2b8 100644 --- a/src/families/elrond/specs.ts +++ b/src/families/elrond/specs.ts @@ -7,10 +7,9 @@ import { pickSiblings } from "../../bot/specs"; import type { AppSpec } from "../../bot/types"; import { toOperationRaw } from "../../account"; import { DeviceModelId } from "@ledgerhq/devices"; +import BigNumber from "bignumber.js"; -const currency = getCryptoCurrencyById("elrond"); -const EXISTENTIAL_DEPOSIT = parseCurrencyUnit(currency.units[0], "1.0"); -const ELROND_MIN_SAFE = parseCurrencyUnit(currency.units[0], "0.05"); +const ELROND_MIN_SAFE = new BigNumber(10000); const elrondSpec: AppSpec = { name: "Elrond", currency: getCryptoCurrencyById("elrond"), @@ -43,14 +42,14 @@ const elrondSpec: AppSpec = { .div(1.9 + 0.2 * Math.random()) .integerValue(); - if (!sibling.used && amount.lt(EXISTENTIAL_DEPOSIT)) { + if (!sibling.used && amount.gt(ELROND_MIN_SAFE)) { invariant( - account.spendableBalance.gt( - EXISTENTIAL_DEPOSIT.plus(ELROND_MIN_SAFE) + account.spendableBalance.lt( + ELROND_MIN_SAFE ), "send is too low to activate account" ); - amount = EXISTENTIAL_DEPOSIT.plus(ELROND_MIN_SAFE); + amount = ELROND_MIN_SAFE; } return { diff --git a/src/families/elrond/speculos-deviceActions.ts b/src/families/elrond/speculos-deviceActions.ts new file mode 100644 index 0000000000..d7be682a7f --- /dev/null +++ b/src/families/elrond/speculos-deviceActions.ts @@ -0,0 +1,46 @@ +import type { DeviceAction } from "../../bot/types"; +import type { Transaction } from "./types"; +import { deviceActionFlow } from "../../bot/specs"; +import { formatCurrencyUnit } from "../../currencies"; +const acceptTransaction: DeviceAction = deviceActionFlow({ + steps: [ + { + title: "Receiver", + button: "RRRRrrrr", + expectedValue: ({ transaction }) => transaction.recipient, + }, + { + title: "Amount", + button: "Rr", + expectedValue: ({ account, transaction }) => { + const formattedValue = + formatCurrencyUnit(account.unit, transaction.amount, { + disableRounding: true, + }) + " EGLD"; + + if (!formattedValue.includes(".")) { + // if the value is pure integer, in the app it will automatically add an .0 + return formattedValue + ".0"; + } + + return formattedValue; + }, + }, + { + title: "Fee", + button: "Rr", + // TODO: add a expectedValue fn + }, + { + title: "Data", + button: "Rr", + }, + { + title: "Sign", + button: "LRlr", + }, + ], +}); +export default { + acceptTransaction, +}; diff --git a/src/generated/specs.ts b/src/generated/specs.ts index 71e0a3fac1..58b0cd371c 100644 --- a/src/generated/specs.ts +++ b/src/generated/specs.ts @@ -4,10 +4,10 @@ import bitcoin from "../families/bitcoin/specs"; import cosmos from "../families/cosmos/specs"; -import elrond from "../families/elrond/specs"; - import crypto_org from "../families/crypto_org/specs"; +import elrond from "../families/elrond/specs"; + import ethereum from "../families/ethereum/specs"; import polkadot from "../families/polkadot/specs"; @@ -23,8 +23,8 @@ export default { algorand, bitcoin, cosmos, - elrond, crypto_org, + elrond, ethereum, polkadot, ripple, diff --git a/src/generated/speculos-deviceActions.ts b/src/generated/speculos-deviceActions.ts index 3af61eccd6..9bebeb1a5e 100644 --- a/src/generated/speculos-deviceActions.ts +++ b/src/generated/speculos-deviceActions.ts @@ -6,6 +6,8 @@ import cosmos from "../families/cosmos/speculos-deviceActions"; import crypto_org from "../families/crypto_org/speculos-deviceActions"; +import elrond from "../families/elrond/speculos-deviceActions"; + import ethereum from "../families/ethereum/speculos-deviceActions"; import polkadot from "../families/polkadot/speculos-deviceActions"; @@ -22,6 +24,7 @@ export default { bitcoin, cosmos, crypto_org, + elrond, ethereum, polkadot, ripple, From 4374d6a7ccc2a8e2ca2d876d6df4a19df4bd2850 Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Mon, 23 Aug 2021 17:05:40 +0300 Subject: [PATCH 056/127] amount lt min safe --- src/families/elrond/specs.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/families/elrond/specs.ts b/src/families/elrond/specs.ts index 88ab72a2b8..00645e96a4 100644 --- a/src/families/elrond/specs.ts +++ b/src/families/elrond/specs.ts @@ -42,9 +42,9 @@ const elrondSpec: AppSpec = { .div(1.9 + 0.2 * Math.random()) .integerValue(); - if (!sibling.used && amount.gt(ELROND_MIN_SAFE)) { + if (!sibling.used && amount.lt(ELROND_MIN_SAFE)) { invariant( - account.spendableBalance.lt( + account.spendableBalance.gt( ELROND_MIN_SAFE ), "send is too low to activate account" From ef329511eeabb378029b13d041b32bcec9855011 Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Mon, 23 Aug 2021 17:43:08 +0300 Subject: [PATCH 057/127] operation date in ms --- src/families/elrond/api/sdk.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/families/elrond/api/sdk.ts b/src/families/elrond/api/sdk.ts index 85925aa8cf..469aeba9d0 100644 --- a/src/families/elrond/api/sdk.ts +++ b/src/families/elrond/api/sdk.ts @@ -73,7 +73,7 @@ function transactionToOperation( hash: transaction.txHash ?? "", blockHash: transaction.blockHash, blockHeight: transaction.blockHeight, - date: new Date(transaction.timestamp ?? 0 * 1000), + date: new Date(transaction.timestamp ? transaction.timestamp * 1000 : 0), extra: {}, senders: [transaction.sender ?? ""], recipients: transaction.receiver ? [transaction.receiver] : [], From 32283aa6f72af93dac9cfd1a67764dd7db07ccbd Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Tue, 24 Aug 2021 15:40:19 +0300 Subject: [PATCH 058/127] op extra field --- src/families/elrond/specs.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/families/elrond/specs.ts b/src/families/elrond/specs.ts index 00645e96a4..732bc27870 100644 --- a/src/families/elrond/specs.ts +++ b/src/families/elrond/specs.ts @@ -2,12 +2,13 @@ import type { Transaction, } from "../../families/elrond/types"; import invariant from "invariant"; -import { getCryptoCurrencyById, parseCurrencyUnit } from "../../currencies"; +import { getCryptoCurrencyById } from "../../currencies"; import { pickSiblings } from "../../bot/specs"; import type { AppSpec } from "../../bot/types"; import { toOperationRaw } from "../../account"; import { DeviceModelId } from "@ledgerhq/devices"; import BigNumber from "bignumber.js"; +import expect from "expect"; const ELROND_MIN_SAFE = new BigNumber(10000); const elrondSpec: AppSpec = { @@ -25,6 +26,7 @@ const elrondSpec: AppSpec = { const opExpected: Record = toOperationRaw({ ...optimisticOperation, }); + operation.extra = opExpected.extra; delete opExpected.value; delete opExpected.fee; delete opExpected.date; From a7fda50108b440d4c72b6162c1b69da5d4e9e154 Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Tue, 24 Aug 2021 15:54:23 +0300 Subject: [PATCH 059/127] lint issues fix --- src/families/elrond/specs.ts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/families/elrond/specs.ts b/src/families/elrond/specs.ts index 732bc27870..879a572ff8 100644 --- a/src/families/elrond/specs.ts +++ b/src/families/elrond/specs.ts @@ -1,6 +1,4 @@ -import type { - Transaction, -} from "../../families/elrond/types"; +import type { Transaction } from "../../families/elrond/types"; import invariant from "invariant"; import { getCryptoCurrencyById } from "../../currencies"; import { pickSiblings } from "../../bot/specs"; @@ -46,9 +44,7 @@ const elrondSpec: AppSpec = { if (!sibling.used && amount.lt(ELROND_MIN_SAFE)) { invariant( - account.spendableBalance.gt( - ELROND_MIN_SAFE - ), + account.spendableBalance.gt(ELROND_MIN_SAFE), "send is too low to activate account" ); amount = ELROND_MIN_SAFE; @@ -67,9 +63,9 @@ const elrondSpec: AppSpec = { }; }, }, - ] + ], }; export default { elrondSpec, -}; \ No newline at end of file +}; From ca9aa3df774b04d6996d68493174fed433c44721 Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Thu, 26 Aug 2021 13:11:36 +0300 Subject: [PATCH 060/127] build esdt token accounts for elrond --- src/families/elrond/api/apiCalls.ts | 9 ++ src/families/elrond/api/index.ts | 1 + src/families/elrond/api/sdk.ts | 8 ++ src/families/elrond/buildESDTOperation.ts | 36 +++++ .../elrond/libcore-buildSubAccounts.ts | 132 ++++++++++++++++++ src/generated/libcore-buildSubAccounts.ts | 3 + 6 files changed, 189 insertions(+) create mode 100644 src/families/elrond/buildESDTOperation.ts create mode 100644 src/families/elrond/libcore-buildSubAccounts.ts diff --git a/src/families/elrond/api/apiCalls.ts b/src/families/elrond/api/apiCalls.ts index e611daf481..c2d45d99fc 100644 --- a/src/families/elrond/api/apiCalls.ts +++ b/src/families/elrond/api/apiCalls.ts @@ -118,6 +118,15 @@ export default class ElrondApi { ); } + async getTokensForAddress(addr: string) { + const { data: tokens } = await network({ + method: "GET", + url: `${this.API_URL}/accounts/${addr}/tokens` + }); + + return tokens; + } + async getBlockchainBlockHeight() { const { data: [{ nonce: blockHeight }], diff --git a/src/families/elrond/api/index.ts b/src/families/elrond/api/index.ts index 65398ce1f9..ca8d5db816 100644 --- a/src/families/elrond/api/index.ts +++ b/src/families/elrond/api/index.ts @@ -5,4 +5,5 @@ export { getOperations, getFees, broadcastTransaction, + getAccountESDTTokens, } from "./sdk"; diff --git a/src/families/elrond/api/sdk.ts b/src/families/elrond/api/sdk.ts index 469aeba9d0..70657d2eda 100644 --- a/src/families/elrond/api/sdk.ts +++ b/src/families/elrond/api/sdk.ts @@ -102,6 +102,14 @@ export const getOperations = async ( ); }; +export const getAccountESDTTokens = async ( + address: string, +): Promise => { + const tokens = await api.getTokensForAddress(address); + + return tokens; +} + /** * Obtain fees from blockchain */ diff --git a/src/families/elrond/buildESDTOperation.ts b/src/families/elrond/buildESDTOperation.ts new file mode 100644 index 0000000000..fe2b062c00 --- /dev/null +++ b/src/families/elrond/buildESDTOperation.ts @@ -0,0 +1,36 @@ +import { BigNumber } from "bignumber.js"; +import type { Operation, OperationType } from "../../types"; +import type { CoreOperation } from "../../libcore/types"; +import { encodeOperationId } from "../../operation"; +const OperationTypeMap = { + "0": "OUT", + "1": "IN", +}; + +export async function buildESDTOperation(arg: { + coreOperation: CoreOperation; + accountId: string; + tokenId: string; +}) { + const { coreOperation, accountId, tokenId } = arg; + + const operationType = await coreOperation.getOperationType(); + const type = OperationTypeMap[operationType]; + const date = new Date(await coreOperation.getDate()); + + // const op: Operation = { + // id, + // type: type as OperationType, + // value: new BigNumber(value), + // hash, + // fee: new BigNumber(fee), + // senders: [sender], + // recipients: receiver, + // blockHeight, + // blockHash: null, + // accountId, + // date, + // extra: {}, + // }; + return null; +} diff --git a/src/families/elrond/libcore-buildSubAccounts.ts b/src/families/elrond/libcore-buildSubAccounts.ts new file mode 100644 index 0000000000..693b6cf024 --- /dev/null +++ b/src/families/elrond/libcore-buildSubAccounts.ts @@ -0,0 +1,132 @@ +import { CryptoCurrency, findTokenById, listTokensForCryptoCurrency } from "@ledgerhq/cryptoassets"; +import BigNumber from "bignumber.js"; +import { emptyHistoryCache } from "../../account"; +import { CoreAccount, CoreOperation } from "../../libcore/types"; +import { minimalOperationsBuilder } from "../../reconciliation"; +import { Account, SyncConfig, TokenAccount } from "../../types"; +import { getAccountESDTTokens } from "./api"; +import { buildESDTOperation } from "./buildESDTOperation"; +const OperationOrderKey = { + date: 0, +}; + +async function buildElrondESDTTokenAccount({ + parentAccountId, + token, + coreAccount, + existingTokenAccount, + balance, +}) { + const extractedId = token.identifier; + const id = parentAccountId + "+" + extractedId; + + const getAllOperations = async () => { + const query = await coreAccount.queryOperations(); + await query.complete(); + await query.addOrder(OperationOrderKey.date, false); + const coreOperations = await query.execute(); + const operations = await minimalOperationsBuilder( + (existingTokenAccount && existingTokenAccount.operations) || [], + coreOperations, + (coreOperation: CoreOperation) => + buildESDTOperation({ + coreOperation, + accountId: id, + tokenId: extractedId, + }) + ); + return operations; + }; + + const operations = await getAllOperations(); + const tokenAccount: TokenAccount = { + type: "TokenAccount", + id, + parentId: parentAccountId, + starred: false, + token, + operationsCount: operations.length, + operations, + pendingOperations: [], + balance, + spendableBalance: balance, + swapHistory: [], + creationDate: + operations.length > 0 + ? operations[operations.length - 1].date + : new Date(), + balanceHistoryCache: emptyHistoryCache, // calculated in the jsHelpers + }; + return tokenAccount; +} +async function elrondBuildESDTTokenAccounts({ + currency, + coreAccount, + accountId, + existingAccount, + syncConfig, +}: { + currency: CryptoCurrency; + coreAccount: CoreAccount; + accountId: string; + existingAccount: Account | null | undefined; + syncConfig: SyncConfig; +}): Promise { + const { blacklistedTokenIds = [] } = syncConfig; + if (listTokensForCryptoCurrency(currency).length === 0) { + return undefined; + } + const tokenAccounts: TokenAccount[] = []; + + const existingAccountByTicker = {}; // used for fast lookup + + const existingAccountTickers: string[] = []; // used to keep track of ordering + + if (existingAccount) { + const elrondAddress = existingAccount.freshAddress; + const accountESDTs = await getAccountESDTTokens(elrondAddress); + if (existingAccount.subAccounts) { + for (const existingSubAccount of existingAccount.subAccounts) { + if (existingSubAccount.type === "TokenAccount") { + const { ticker, id } = existingSubAccount.token; + + if (!blacklistedTokenIds.includes(id)) { + existingAccountTickers.push(ticker); + existingAccountByTicker[ticker] = existingSubAccount; + } + } + } + } + + accountESDTs.forEach(async (esdt) => { + const token = findTokenById(esdt.identifier); + + if (token && !blacklistedTokenIds.includes(token.id)) { + const existingTokenAccount = existingAccountByTicker[token.ticker]; + const tokenAccount = await buildElrondESDTTokenAccount({ + parentAccountId: accountId, + existingTokenAccount, + token, + coreAccount, + balance: new BigNumber(esdt.balance), + }); + if (tokenAccount) { + tokenAccounts.push(tokenAccount); + } + } + }) + } + + // Preserve order of tokenAccounts from the existing token accounts + tokenAccounts.sort((a, b) => { + const i = existingAccountTickers.indexOf(a.token.ticker); + const j = existingAccountTickers.indexOf(b.token.ticker); + if (i === j) return 0; + if (i < 0) return 1; + if (j < 0) return -1; + return i - j; + }); + return tokenAccounts; +} + +export default elrondBuildESDTTokenAccounts; \ No newline at end of file diff --git a/src/generated/libcore-buildSubAccounts.ts b/src/generated/libcore-buildSubAccounts.ts index 7aaf26f982..79a4552e19 100644 --- a/src/generated/libcore-buildSubAccounts.ts +++ b/src/generated/libcore-buildSubAccounts.ts @@ -1,9 +1,12 @@ import algorand from "../families/algorand/libcore-buildSubAccounts"; +import elrond from "../families/elrond/libcore-buildSubAccounts"; + import tezos from "../families/tezos/libcore-buildSubAccounts"; export default { algorand, + elrond, tezos, }; From 0d4167437406c8a1cceb61ad373e59c7c16d8ec5 Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Thu, 26 Aug 2021 16:44:59 +0300 Subject: [PATCH 061/127] add ESDT token accounts in sync --- src/families/elrond/js-synchronisation.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/families/elrond/js-synchronisation.ts b/src/families/elrond/js-synchronisation.ts index a28feef301..8efbb92148 100644 --- a/src/families/elrond/js-synchronisation.ts +++ b/src/families/elrond/js-synchronisation.ts @@ -2,9 +2,10 @@ import type { Account } from "../../types"; import type { GetAccountShape } from "../../bridge/jsHelpers"; import { makeSync, makeScanAccounts, mergeOps } from "../../bridge/jsHelpers"; import { getAccount, getOperations } from "./api"; +import elrondBuildESDTTokenAccounts from "./js-buildSubAccounts"; const getAccountShape: GetAccountShape = async (info) => { - const { id, address, initialAccount } = info; + const { id, address, initialAccount, currency } = info; const oldOperations = initialAccount?.operations || []; // Needed for incremental synchronisation const startAt = @@ -16,6 +17,16 @@ const getAccountShape: GetAccountShape = async (info) => { // Merge new operations with the previously synced ones const newOperations = await getOperations(id, address, startAt); const operations = mergeOps(oldOperations, newOperations); + + const subAccounts = await elrondBuildESDTTokenAccounts({ + currency, + accountId: id, + existingAccount: initialAccount, + syncConfig: { + paginationConfig: {} + } + }); + const shape = { id, balance, @@ -25,7 +36,9 @@ const getAccountShape: GetAccountShape = async (info) => { elrondResources: { nonce, }, + subAccounts, }; + return { ...shape, operations }; }; From 7d9752f1784d1792e1aa23dd14bf08571c7133ef Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Thu, 26 Aug 2021 16:45:39 +0300 Subject: [PATCH 062/127] test build ESDT sub accounts --- src/families/elrond/api/sdk.ts | 9 +- ...dSubAccounts.ts => js-buildSubAccounts.ts} | 100 +++++++++--------- src/generated/libcore-buildSubAccounts.ts | 3 - 3 files changed, 54 insertions(+), 58 deletions(-) rename src/families/elrond/{libcore-buildSubAccounts.ts => js-buildSubAccounts.ts} (51%) diff --git a/src/families/elrond/api/sdk.ts b/src/families/elrond/api/sdk.ts index 70657d2eda..39ca5e4f19 100644 --- a/src/families/elrond/api/sdk.ts +++ b/src/families/elrond/api/sdk.ts @@ -103,11 +103,14 @@ export const getOperations = async ( }; export const getAccountESDTTokens = async ( - address: string, + // address: string, ): Promise => { - const tokens = await api.getTokensForAddress(address); + // const tokens = await api.getTokensForAddress(address); - return tokens; + return [{ + identifier: '4452442d633462303861', + balance: '100', + }]; } /** diff --git a/src/families/elrond/libcore-buildSubAccounts.ts b/src/families/elrond/js-buildSubAccounts.ts similarity index 51% rename from src/families/elrond/libcore-buildSubAccounts.ts rename to src/families/elrond/js-buildSubAccounts.ts index 693b6cf024..616f867381 100644 --- a/src/families/elrond/libcore-buildSubAccounts.ts +++ b/src/families/elrond/js-buildSubAccounts.ts @@ -1,4 +1,4 @@ -import { CryptoCurrency, findTokenById, listTokensForCryptoCurrency } from "@ledgerhq/cryptoassets"; +import { CryptoCurrency, findTokenById, listTokens, listTokensForCryptoCurrency } from "@ledgerhq/cryptoassets"; import BigNumber from "bignumber.js"; import { emptyHistoryCache } from "../../account"; import { CoreAccount, CoreOperation } from "../../libcore/types"; @@ -13,29 +13,28 @@ const OperationOrderKey = { async function buildElrondESDTTokenAccount({ parentAccountId, token, - coreAccount, existingTokenAccount, balance, }) { - const extractedId = token.identifier; + const extractedId = token.id; const id = parentAccountId + "+" + extractedId; const getAllOperations = async () => { - const query = await coreAccount.queryOperations(); - await query.complete(); - await query.addOrder(OperationOrderKey.date, false); - const coreOperations = await query.execute(); - const operations = await minimalOperationsBuilder( - (existingTokenAccount && existingTokenAccount.operations) || [], - coreOperations, - (coreOperation: CoreOperation) => - buildESDTOperation({ - coreOperation, - accountId: id, - tokenId: extractedId, - }) - ); - return operations; + // const query = await coreAccount.queryOperations(); + // await query.complete(); + // await query.addOrder(OperationOrderKey.date, false); + // const coreOperations = await query.execute(); + // const operations = await minimalOperationsBuilder( + // (existingTokenAccount && existingTokenAccount.operations) || [], + // coreOperations, + // (coreOperation: CoreOperation) => + // buildESDTOperation({ + // coreOperation, + // accountId: id, + // tokenId: extractedId, + // }) + // ); + return []; }; const operations = await getAllOperations(); @@ -52,26 +51,25 @@ async function buildElrondESDTTokenAccount({ spendableBalance: balance, swapHistory: [], creationDate: - operations.length > 0 - ? operations[operations.length - 1].date - : new Date(), + // operations.length > 0 + // ? operations[operations.length - 1].date + new Date(), balanceHistoryCache: emptyHistoryCache, // calculated in the jsHelpers }; return tokenAccount; } + async function elrondBuildESDTTokenAccounts({ currency, - coreAccount, accountId, existingAccount, syncConfig, }: { currency: CryptoCurrency; - coreAccount: CoreAccount; accountId: string; existingAccount: Account | null | undefined; syncConfig: SyncConfig; -}): Promise { +}): Promise { const { blacklistedTokenIds = [] } = syncConfig; if (listTokensForCryptoCurrency(currency).length === 0) { return undefined; @@ -82,40 +80,37 @@ async function elrondBuildESDTTokenAccounts({ const existingAccountTickers: string[] = []; // used to keep track of ordering - if (existingAccount) { - const elrondAddress = existingAccount.freshAddress; - const accountESDTs = await getAccountESDTTokens(elrondAddress); - if (existingAccount.subAccounts) { - for (const existingSubAccount of existingAccount.subAccounts) { - if (existingSubAccount.type === "TokenAccount") { - const { ticker, id } = existingSubAccount.token; - - if (!blacklistedTokenIds.includes(id)) { - existingAccountTickers.push(ticker); - existingAccountByTicker[ticker] = existingSubAccount; - } + if (existingAccount && existingAccount.subAccounts) { + for (const existingSubAccount of existingAccount.subAccounts) { + if (existingSubAccount.type === "TokenAccount") { + const { ticker, id } = existingSubAccount.token; + + if (!blacklistedTokenIds.includes(id)) { + existingAccountTickers.push(ticker); + existingAccountByTicker[ticker] = existingSubAccount; } } } + } - accountESDTs.forEach(async (esdt) => { - const token = findTokenById(esdt.identifier); + const accountESDTs = await getAccountESDTTokens(); + accountESDTs.forEach(async (esdt) => { + const token = findTokenById(`elrond/esdt/${esdt.identifier}`); - if (token && !blacklistedTokenIds.includes(token.id)) { - const existingTokenAccount = existingAccountByTicker[token.ticker]; - const tokenAccount = await buildElrondESDTTokenAccount({ - parentAccountId: accountId, - existingTokenAccount, - token, - coreAccount, - balance: new BigNumber(esdt.balance), - }); - if (tokenAccount) { - tokenAccounts.push(tokenAccount); - } + if (token && !blacklistedTokenIds.includes(token.id)) { + const existingTokenAccount = existingAccountByTicker[token.ticker]; + const tokenAccount = await buildElrondESDTTokenAccount({ + parentAccountId: accountId, + existingTokenAccount, + token, + balance: new BigNumber(esdt.balance), + }); + + if (tokenAccount) { + tokenAccounts.push(tokenAccount); } - }) - } + } + }); // Preserve order of tokenAccounts from the existing token accounts tokenAccounts.sort((a, b) => { @@ -126,6 +121,7 @@ async function elrondBuildESDTTokenAccounts({ if (j < 0) return -1; return i - j; }); + return tokenAccounts; } diff --git a/src/generated/libcore-buildSubAccounts.ts b/src/generated/libcore-buildSubAccounts.ts index 79a4552e19..7aaf26f982 100644 --- a/src/generated/libcore-buildSubAccounts.ts +++ b/src/generated/libcore-buildSubAccounts.ts @@ -1,12 +1,9 @@ import algorand from "../families/algorand/libcore-buildSubAccounts"; -import elrond from "../families/elrond/libcore-buildSubAccounts"; - import tezos from "../families/tezos/libcore-buildSubAccounts"; export default { algorand, - elrond, tezos, }; From 97f20f42c92ff8415bbda9a7206390dabaee60e8 Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Mon, 30 Aug 2021 12:13:37 +0300 Subject: [PATCH 063/127] prevent infinite sync on ESDT accounts --- src/families/elrond/js-synchronisation.ts | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/families/elrond/js-synchronisation.ts b/src/families/elrond/js-synchronisation.ts index 8efbb92148..d3380d6553 100644 --- a/src/families/elrond/js-synchronisation.ts +++ b/src/families/elrond/js-synchronisation.ts @@ -1,4 +1,4 @@ -import type { Account } from "../../types"; +import type { Account, TokenAccount } from "../../types"; import type { GetAccountShape } from "../../bridge/jsHelpers"; import { makeSync, makeScanAccounts, mergeOps } from "../../bridge/jsHelpers"; import { getAccount, getOperations } from "./api"; @@ -17,15 +17,18 @@ const getAccountShape: GetAccountShape = async (info) => { // Merge new operations with the previously synced ones const newOperations = await getOperations(id, address, startAt); const operations = mergeOps(oldOperations, newOperations); - - const subAccounts = await elrondBuildESDTTokenAccounts({ - currency, - accountId: id, - existingAccount: initialAccount, - syncConfig: { - paginationConfig: {} - } - }); + + let subAccounts: TokenAccount[] | undefined = []; + if (nonce) { + subAccounts = await elrondBuildESDTTokenAccounts({ + currency, + accountId: id, + existingAccount: initialAccount, + syncConfig: { + paginationConfig: {} + } + }); + } const shape = { id, From 4b1ee4d8dfa871ca7fa9c15b0e24afe635bf1052 Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Mon, 6 Sep 2021 10:57:49 +0300 Subject: [PATCH 064/127] elrond ESDT operations via api --- src/families/elrond/api/apiCalls.ts | 8 ++-- src/families/elrond/api/index.ts | 1 + src/families/elrond/api/sdk.ts | 10 +++++ src/families/elrond/buildESDTOperation.ts | 36 ----------------- src/families/elrond/js-buildSubAccounts.ts | 46 +++++++--------------- src/families/elrond/js-synchronisation.ts | 1 + 6 files changed, 30 insertions(+), 72 deletions(-) delete mode 100644 src/families/elrond/buildESDTOperation.ts diff --git a/src/families/elrond/api/apiCalls.ts b/src/families/elrond/api/apiCalls.ts index c2d45d99fc..b7388f9898 100644 --- a/src/families/elrond/api/apiCalls.ts +++ b/src/families/elrond/api/apiCalls.ts @@ -118,13 +118,13 @@ export default class ElrondApi { ); } - async getTokensForAddress(addr: string) { - const { data: tokens } = await network({ + async getESDTTransactionsForAddress(addr: string, token: string) { + const { data: transactions } = await network({ method: "GET", - url: `${this.API_URL}/accounts/${addr}/tokens` + url: `${this.API_URL}/transactions?token=${token}&sender=${addr}&receiver=${addr}&condition=should` }); - return tokens; + return transactions; } async getBlockchainBlockHeight() { diff --git a/src/families/elrond/api/index.ts b/src/families/elrond/api/index.ts index ca8d5db816..49b55f20c2 100644 --- a/src/families/elrond/api/index.ts +++ b/src/families/elrond/api/index.ts @@ -6,4 +6,5 @@ export { getFees, broadcastTransaction, getAccountESDTTokens, + getAccountESDTOperations, } from "./sdk"; diff --git a/src/families/elrond/api/sdk.ts b/src/families/elrond/api/sdk.ts index 39ca5e4f19..ee141247a4 100644 --- a/src/families/elrond/api/sdk.ts +++ b/src/families/elrond/api/sdk.ts @@ -113,6 +113,16 @@ export const getAccountESDTTokens = async ( }]; } +export const getAccountESDTOperations = async ( + accountId: string, + address: string, + tokenIdentifier: string, +): Promise => { + const accountESDTTransactions = await api.getESDTTransactionsForAddress(address, tokenIdentifier); + + return accountESDTTransactions.map(transaction => transactionToOperation(accountId, address, transaction)); +} + /** * Obtain fees from blockchain */ diff --git a/src/families/elrond/buildESDTOperation.ts b/src/families/elrond/buildESDTOperation.ts deleted file mode 100644 index fe2b062c00..0000000000 --- a/src/families/elrond/buildESDTOperation.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { BigNumber } from "bignumber.js"; -import type { Operation, OperationType } from "../../types"; -import type { CoreOperation } from "../../libcore/types"; -import { encodeOperationId } from "../../operation"; -const OperationTypeMap = { - "0": "OUT", - "1": "IN", -}; - -export async function buildESDTOperation(arg: { - coreOperation: CoreOperation; - accountId: string; - tokenId: string; -}) { - const { coreOperation, accountId, tokenId } = arg; - - const operationType = await coreOperation.getOperationType(); - const type = OperationTypeMap[operationType]; - const date = new Date(await coreOperation.getDate()); - - // const op: Operation = { - // id, - // type: type as OperationType, - // value: new BigNumber(value), - // hash, - // fee: new BigNumber(fee), - // senders: [sender], - // recipients: receiver, - // blockHeight, - // blockHash: null, - // accountId, - // date, - // extra: {}, - // }; - return null; -} diff --git a/src/families/elrond/js-buildSubAccounts.ts b/src/families/elrond/js-buildSubAccounts.ts index 616f867381..5834fbe264 100644 --- a/src/families/elrond/js-buildSubAccounts.ts +++ b/src/families/elrond/js-buildSubAccounts.ts @@ -1,43 +1,24 @@ -import { CryptoCurrency, findTokenById, listTokens, listTokensForCryptoCurrency } from "@ledgerhq/cryptoassets"; +import { CryptoCurrency, findTokenById, listTokens, listTokensForCryptoCurrency, TokenCurrency } from "@ledgerhq/cryptoassets"; import BigNumber from "bignumber.js"; import { emptyHistoryCache } from "../../account"; -import { CoreAccount, CoreOperation } from "../../libcore/types"; -import { minimalOperationsBuilder } from "../../reconciliation"; import { Account, SyncConfig, TokenAccount } from "../../types"; -import { getAccountESDTTokens } from "./api"; -import { buildESDTOperation } from "./buildESDTOperation"; -const OperationOrderKey = { - date: 0, -}; +import { getAccountESDTOperations, getAccountESDTTokens } from "./api"; async function buildElrondESDTTokenAccount({ parentAccountId, + accountAddress, token, - existingTokenAccount, balance, +}: { + parentAccountId: string; + accountAddress: string; + token: TokenCurrency; + balance: BigNumber; }) { const extractedId = token.id; const id = parentAccountId + "+" + extractedId; - const getAllOperations = async () => { - // const query = await coreAccount.queryOperations(); - // await query.complete(); - // await query.addOrder(OperationOrderKey.date, false); - // const coreOperations = await query.execute(); - // const operations = await minimalOperationsBuilder( - // (existingTokenAccount && existingTokenAccount.operations) || [], - // coreOperations, - // (coreOperation: CoreOperation) => - // buildESDTOperation({ - // coreOperation, - // accountId: id, - // tokenId: extractedId, - // }) - // ); - return []; - }; - - const operations = await getAllOperations(); + const operations = await getAccountESDTOperations(parentAccountId, accountAddress, token.id.split('/')[2]); const tokenAccount: TokenAccount = { type: "TokenAccount", id, @@ -51,9 +32,8 @@ async function buildElrondESDTTokenAccount({ spendableBalance: balance, swapHistory: [], creationDate: - // operations.length > 0 - // ? operations[operations.length - 1].date - new Date(), + operations.length > 0 + ? operations[operations.length - 1].date : new Date(), balanceHistoryCache: emptyHistoryCache, // calculated in the jsHelpers }; return tokenAccount; @@ -62,11 +42,13 @@ async function buildElrondESDTTokenAccount({ async function elrondBuildESDTTokenAccounts({ currency, accountId, + accountAddress, existingAccount, syncConfig, }: { currency: CryptoCurrency; accountId: string; + accountAddress: string; existingAccount: Account | null | undefined; syncConfig: SyncConfig; }): Promise { @@ -101,7 +83,7 @@ async function elrondBuildESDTTokenAccounts({ const existingTokenAccount = existingAccountByTicker[token.ticker]; const tokenAccount = await buildElrondESDTTokenAccount({ parentAccountId: accountId, - existingTokenAccount, + accountAddress, token, balance: new BigNumber(esdt.balance), }); diff --git a/src/families/elrond/js-synchronisation.ts b/src/families/elrond/js-synchronisation.ts index d3380d6553..b8d1796298 100644 --- a/src/families/elrond/js-synchronisation.ts +++ b/src/families/elrond/js-synchronisation.ts @@ -23,6 +23,7 @@ const getAccountShape: GetAccountShape = async (info) => { subAccounts = await elrondBuildESDTTokenAccounts({ currency, accountId: id, + accountAddress: address, existingAccount: initialAccount, syncConfig: { paginationConfig: {} From 3bafc52facc97e8b38cd60a026afb009bda41c09 Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Mon, 6 Sep 2021 10:59:37 +0300 Subject: [PATCH 065/127] compute token identifier string --- src/families/elrond/js-buildSubAccounts.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/families/elrond/js-buildSubAccounts.ts b/src/families/elrond/js-buildSubAccounts.ts index 5834fbe264..c7a5b942f6 100644 --- a/src/families/elrond/js-buildSubAccounts.ts +++ b/src/families/elrond/js-buildSubAccounts.ts @@ -17,8 +17,9 @@ async function buildElrondESDTTokenAccount({ }) { const extractedId = token.id; const id = parentAccountId + "+" + extractedId; + const tokenIdentifier = Buffer.from(token.id.split('/')[2], 'hex').toString(); - const operations = await getAccountESDTOperations(parentAccountId, accountAddress, token.id.split('/')[2]); + const operations = await getAccountESDTOperations(parentAccountId, accountAddress, tokenIdentifier); const tokenAccount: TokenAccount = { type: "TokenAccount", id, From 055778e9847547047f7488f9f1b91ee2b271376b Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Mon, 6 Sep 2021 11:09:56 +0300 Subject: [PATCH 066/127] remove unused existingTokenAccount --- src/families/elrond/js-buildSubAccounts.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/families/elrond/js-buildSubAccounts.ts b/src/families/elrond/js-buildSubAccounts.ts index c7a5b942f6..82f0e065da 100644 --- a/src/families/elrond/js-buildSubAccounts.ts +++ b/src/families/elrond/js-buildSubAccounts.ts @@ -81,7 +81,6 @@ async function elrondBuildESDTTokenAccounts({ const token = findTokenById(`elrond/esdt/${esdt.identifier}`); if (token && !blacklistedTokenIds.includes(token.id)) { - const existingTokenAccount = existingAccountByTicker[token.ticker]; const tokenAccount = await buildElrondESDTTokenAccount({ parentAccountId: accountId, accountAddress, From d3df754b7b244a473399ec897486ac28608ee352 Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Mon, 6 Sep 2021 11:58:51 +0300 Subject: [PATCH 067/127] build and ESDT transfer --- src/families/elrond/js-buildTransaction.ts | 14 ++++++++++++-- src/families/elrond/js-getFeesForTransaction.ts | 2 +- src/families/elrond/js-signOperation.ts | 8 ++++++++ 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/families/elrond/js-buildTransaction.ts b/src/families/elrond/js-buildTransaction.ts index fa55555d87..e374ee28a5 100644 --- a/src/families/elrond/js-buildTransaction.ts +++ b/src/families/elrond/js-buildTransaction.ts @@ -1,8 +1,10 @@ import type { Transaction } from "./types"; -import type { Account } from "../../types"; +import type { Account, SubAccount } from "../../types"; import { getNonce } from "./logic"; import { getNetworkConfig } from "./api"; import { HASH_TRANSACTION, RAW_TRANSACTION } from "./constants"; +import getEstimatedFees from "./js-getFeesForTransaction"; +import BigNumber from "bignumber.js"; /** * @@ -11,6 +13,7 @@ import { HASH_TRANSACTION, RAW_TRANSACTION } from "./constants"; */ export const buildTransaction = async ( a: Account, + ta: SubAccount | null | undefined, t: Transaction, signUsingHash = true ) => { @@ -18,14 +21,21 @@ export const buildTransaction = async ( const nonce = getNonce(a); const { gasPrice, gasLimit, chainId } = await getNetworkConfig(); const transactionType = signUsingHash ? HASH_TRANSACTION : RAW_TRANSACTION; + let data; + if (ta) { + const tokenIdentifier = Buffer.from(ta.id.split('/')[2], 'hex').toString(); + data = `ESDTTransfer@${tokenIdentifier}@${t.amount}`; + } + const unsigned = { nonce, - value: t.amount, + value: ta ? new BigNumber(0): t.useAllAmount ? a.spendableBalance : t.amount, receiver: t.recipient, sender: address, gasPrice, gasLimit, chainID: chainId, + data: data, ...transactionType, }; // Will likely be a call to Elrond SDK diff --git a/src/families/elrond/js-getFeesForTransaction.ts b/src/families/elrond/js-getFeesForTransaction.ts index 0c9c468d08..02e7108398 100644 --- a/src/families/elrond/js-getFeesForTransaction.ts +++ b/src/families/elrond/js-getFeesForTransaction.ts @@ -19,7 +19,7 @@ const getEstimatedFees = async ({ t: Transaction; signUsingHash: boolean | undefined; }): Promise => { - const unsigned = await buildTransaction(a, t, signUsingHash); + const unsigned = await buildTransaction(a, null, t, signUsingHash); return await getFees(JSON.parse(unsigned)); }; diff --git a/src/families/elrond/js-signOperation.ts b/src/families/elrond/js-signOperation.ts index 48aa2af795..c6569afeb8 100644 --- a/src/families/elrond/js-signOperation.ts +++ b/src/families/elrond/js-signOperation.ts @@ -57,12 +57,20 @@ const signOperation = ({ if (!transaction.fees) { throw new FeeNotLoaded(); } + // Collect data for an ESDT transfer + const { subAccounts } = account; + const { subAccountId } = transaction; + const tokenAccount = !subAccountId + ? null + : subAccounts && subAccounts.find((ta) => ta.id === subAccountId); const elrond = new Elrond(transport); const { version } = await elrond.getAppConfiguration(); const signUsingHash = compareVersions(version, "1.0.11") >= 0; + const unsigned = await buildTransaction( account, + tokenAccount, transaction, signUsingHash ); From ae8e72159ae329ab03d90b47af43b29d5317cf95 Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Fri, 17 Sep 2021 14:01:25 +0300 Subject: [PATCH 068/127] elrond device transaction config --- .../elrond/deviceTransactionConfig.ts | 27 +++++++++++++++++++ src/generated/deviceTransactionConfig.ts | 3 +++ 2 files changed, 30 insertions(+) create mode 100644 src/families/elrond/deviceTransactionConfig.ts diff --git a/src/families/elrond/deviceTransactionConfig.ts b/src/families/elrond/deviceTransactionConfig.ts new file mode 100644 index 0000000000..0dc4070402 --- /dev/null +++ b/src/families/elrond/deviceTransactionConfig.ts @@ -0,0 +1,27 @@ +import type { TransactionStatus } from "../../types"; +import type { DeviceTransactionField } from "../../transaction"; + +function getDeviceTransactionConfig({ + status: { amount, estimatedFees }, +}: { + status: TransactionStatus; +}): Array { + const fields: Array = []; + + if (!amount.isZero()) { + fields.push({ + type: "amount", + label: "Amount", + }); + } + + if (!estimatedFees.isZero()) { + fields.push({ + type: "fees", + label: "Fees", + }); + } + return fields; +} + +export default getDeviceTransactionConfig; diff --git a/src/generated/deviceTransactionConfig.ts b/src/generated/deviceTransactionConfig.ts index 6c28eba094..d2569a7715 100644 --- a/src/generated/deviceTransactionConfig.ts +++ b/src/generated/deviceTransactionConfig.ts @@ -4,6 +4,8 @@ import bitcoin from "../families/bitcoin/deviceTransactionConfig"; import cosmos from "../families/cosmos/deviceTransactionConfig"; +import elrond from "../families/elrond/deviceTransactionConfig"; + import ethereum from "../families/ethereum/deviceTransactionConfig"; import polkadot from "../families/polkadot/deviceTransactionConfig"; @@ -21,6 +23,7 @@ export default { algorand, bitcoin, cosmos, + elrond, ethereum, polkadot, ripple, From 6164a61663047ed75ec58491beb44f7b3e2659c6 Mon Sep 17 00:00:00 2001 From: Alexandru Pislariu <57287326+AlexandruPislariu@users.noreply.github.com> Date: Mon, 27 Sep 2021 13:38:42 +0300 Subject: [PATCH 069/127] Height on round (#11) * elrond transaction blockHeight based on round * lint --- src/families/elrond/api/apiCalls.ts | 34 +++-------------------------- src/families/elrond/api/sdk.ts | 4 ++-- src/families/elrond/types.ts | 2 ++ 3 files changed, 7 insertions(+), 33 deletions(-) diff --git a/src/families/elrond/api/apiCalls.ts b/src/families/elrond/api/apiCalls.ts index 437f462acc..14cb3d3855 100644 --- a/src/families/elrond/api/apiCalls.ts +++ b/src/families/elrond/api/apiCalls.ts @@ -121,44 +121,16 @@ export default class ElrondApi { from = from + TRANSACTIONS_SIZE; } - if (!allTransactions.length) { - return allTransactions; //Account does not have any transactions - } - - return Promise.all( - allTransactions.map(async (transaction) => { - const { blockHeight, blockHash } = await this.getConfirmedTransaction( - transaction.txHash - ); - return { ...transaction, blockHash, blockHeight }; - }) - ); + return allTransactions; } async getBlockchainBlockHeight() { const { - data: [{ nonce: blockHeight }], + data: [{ round: blockHeight }], } = await network({ method: "GET", - url: `${this.API_URL}/blocks?shard=${METACHAIN_SHARD}&fields=nonce`, + url: `${this.API_URL}/blocks?shard=${METACHAIN_SHARD}&fields=round`, }); return blockHeight; } - - async getConfirmedTransaction(txHash: string) { - const { - data: { - data: { - transaction: { hyperblockNonce, blockHash }, - }, - }, - } = await network({ - method: "GET", - url: `${this.API_URL}/transaction/${txHash}`, - }); - return { - blockHeight: hyperblockNonce, - blockHash, - }; - } } diff --git a/src/families/elrond/api/sdk.ts b/src/families/elrond/api/sdk.ts index 469aeba9d0..edc844f688 100644 --- a/src/families/elrond/api/sdk.ts +++ b/src/families/elrond/api/sdk.ts @@ -71,8 +71,8 @@ function transactionToOperation( value: getOperationValue(transaction, addr), type, hash: transaction.txHash ?? "", - blockHash: transaction.blockHash, - blockHeight: transaction.blockHeight, + blockHash: transaction.miniBlockHash, + blockHeight: transaction.round, date: new Date(transaction.timestamp ? transaction.timestamp * 1000 : 0), extra: {}, senders: [transaction.sender ?? ""], diff --git a/src/families/elrond/types.ts b/src/families/elrond/types.ts index ff114f212b..9e3bd2ace6 100644 --- a/src/families/elrond/types.ts +++ b/src/families/elrond/types.ts @@ -36,6 +36,8 @@ export type Transaction = TransactionCommon & { nonce?: number; status?: string; fee?: BigNumber; + round?: number; + miniBlockHash?: string; }; /** From ee11af32c2feaf5850f1abe12b83c1834cdf1e32 Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Fri, 1 Oct 2021 14:21:42 +0300 Subject: [PATCH 070/127] provideESDTInfo instruction for ledger device --- src/families/elrond/hw-app-elrond/index.ts | 54 ++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/src/families/elrond/hw-app-elrond/index.ts b/src/families/elrond/hw-app-elrond/index.ts index 1fed843297..514d19543c 100644 --- a/src/families/elrond/hw-app-elrond/index.ts +++ b/src/families/elrond/hw-app-elrond/index.ts @@ -7,6 +7,7 @@ const INS = { GET_VERSION: 0x02, GET_ADDRESS: 0x03, SET_ADDRESS: 0x05, + PROVIDE_ESDT_INFO: 0x08, }; const SIGN_RAW_TX_INS = 0x04; const SIGN_HASH_TX_INS = 0x07; @@ -27,6 +28,7 @@ export default class Elrond { "signTransaction", "signMessage", "getAppConfiguration", + "provideESDTInfo" ], scrambleKey ); @@ -180,4 +182,56 @@ export default class Elrond { const signature = response.slice(1, response.length - 2).toString("hex"); return signature; } + + serializeESDTInfo( + ticker: string, + id: string, + decimals: number, + chainId: string, + signature: string + ): Buffer { + const tickerLengthBuffer = Buffer.from([ticker.length]); + const tickerBuffer = Buffer.from(ticker); + const idLengthBuffer = Buffer.from([id.length]); + const idBuffer = Buffer.from(id); + const decimalsBuffer = Buffer.from([decimals]); + const chainIdLengthBuffer = Buffer.from([chainId.length]); + const chainIdBuffer = Buffer.from(chainId); + const signatureBuffer = Buffer.from(signature, "hex"); + let infoBuffer = [ + tickerLengthBuffer, + tickerBuffer, + idLengthBuffer, + idBuffer, + decimalsBuffer, + chainIdLengthBuffer, + chainIdBuffer, + signatureBuffer, + ]; + return Buffer.concat(infoBuffer); + } + + async provideESDTInfo( + ticker: string, + id: string, + decimals: number, + chainId: string, + signature: string + ): Promise { + const data = this.serializeESDTInfo( + ticker, + id, + decimals, + chainId, + signature + ); + + return await this.transport.send( + CLA, + INS.PROVIDE_ESDT_INFO, + 0x00, + 0x00, + data + ); + } } From 56bc4564c6187989d015716e71cbf432c14ede82 Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Fri, 1 Oct 2021 14:22:20 +0300 Subject: [PATCH 071/127] account esdt tokens for address --- src/families/elrond/api/sdk.ts | 9 ++------- src/families/elrond/js-synchronisation.ts | 4 ++-- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/families/elrond/api/sdk.ts b/src/families/elrond/api/sdk.ts index 3d02bacf9f..5bc3253edd 100644 --- a/src/families/elrond/api/sdk.ts +++ b/src/families/elrond/api/sdk.ts @@ -103,14 +103,9 @@ export const getOperations = async ( }; export const getAccountESDTTokens = async ( - // address: string, + address: string, ): Promise => { - // const tokens = await api.getTokensForAddress(address); - - return [{ - identifier: '4452442d633462303861', - balance: '100', - }]; + return await api.getESDTTokensForAddress(address); } export const getAccountESDTOperations = async ( diff --git a/src/families/elrond/js-synchronisation.ts b/src/families/elrond/js-synchronisation.ts index b8d1796298..07345c20a5 100644 --- a/src/families/elrond/js-synchronisation.ts +++ b/src/families/elrond/js-synchronisation.ts @@ -1,7 +1,7 @@ import type { Account, TokenAccount } from "../../types"; import type { GetAccountShape } from "../../bridge/jsHelpers"; import { makeSync, makeScanAccounts, mergeOps } from "../../bridge/jsHelpers"; -import { getAccount, getOperations } from "./api"; +import { getAccount, getAccountESDTTokens, getOperations } from "./api"; import elrondBuildESDTTokenAccounts from "./js-buildSubAccounts"; const getAccountShape: GetAccountShape = async (info) => { @@ -19,7 +19,7 @@ const getAccountShape: GetAccountShape = async (info) => { const operations = mergeOps(oldOperations, newOperations); let subAccounts: TokenAccount[] | undefined = []; - if (nonce) { + if ((await getAccountESDTTokens(address)).length) { subAccounts = await elrondBuildESDTTokenAccounts({ currency, accountId: id, From dc8d01ed64eab1b6fc9eaf22c421fe419a2d3271 Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Fri, 1 Oct 2021 14:33:06 +0300 Subject: [PATCH 072/127] build sub account operations --- src/families/elrond/api/apiCalls.ts | 13 +++++++++++-- src/families/elrond/js-buildSubAccounts.ts | 14 ++++++++------ src/families/elrond/js-buildTransaction.ts | 4 ++-- src/families/elrond/js-signOperation.ts | 11 +++++++++++ 4 files changed, 32 insertions(+), 10 deletions(-) diff --git a/src/families/elrond/api/apiCalls.ts b/src/families/elrond/api/apiCalls.ts index 802f819c0f..4e772a2945 100644 --- a/src/families/elrond/api/apiCalls.ts +++ b/src/families/elrond/api/apiCalls.ts @@ -127,10 +127,19 @@ export default class ElrondApi { async getESDTTransactionsForAddress(addr: string, token: string) { const { data: transactions } = await network({ method: "GET", - url: `${this.API_URL}/transactions?token=${token}&sender=${addr}&receiver=${addr}&condition=should` + url: `${this.API_URL}/transactions?sender=${addr}&receiver=${addr}&condition=should` }); - return transactions; + return transactions.filter(({tokenIdentifier}) => tokenIdentifier && tokenIdentifier==token); + } + + async getESDTTokensForAddress(addr: string) { + const { data: tokens } = await network({ + method: "GET", + url: `${this.API_URL}/accounts/${addr}/tokens` + }); + + return tokens; } async getBlockchainBlockHeight() { diff --git a/src/families/elrond/js-buildSubAccounts.ts b/src/families/elrond/js-buildSubAccounts.ts index 82f0e065da..2b7545d45e 100644 --- a/src/families/elrond/js-buildSubAccounts.ts +++ b/src/families/elrond/js-buildSubAccounts.ts @@ -1,4 +1,4 @@ -import { CryptoCurrency, findTokenById, listTokens, listTokensForCryptoCurrency, TokenCurrency } from "@ledgerhq/cryptoassets"; +import { CryptoCurrency, findTokenById, listTokensForCryptoCurrency, TokenCurrency } from "@ledgerhq/cryptoassets"; import BigNumber from "bignumber.js"; import { emptyHistoryCache } from "../../account"; import { Account, SyncConfig, TokenAccount } from "../../types"; @@ -17,7 +17,8 @@ async function buildElrondESDTTokenAccount({ }) { const extractedId = token.id; const id = parentAccountId + "+" + extractedId; - const tokenIdentifier = Buffer.from(token.id.split('/')[2], 'hex').toString(); + const tokenIdentifierHex = token.id.split('/')[2]; + const tokenIdentifier = Buffer.from(tokenIdentifierHex, 'hex').toString(); const operations = await getAccountESDTOperations(parentAccountId, accountAddress, tokenIdentifier); const tokenAccount: TokenAccount = { @@ -76,9 +77,10 @@ async function elrondBuildESDTTokenAccounts({ } } - const accountESDTs = await getAccountESDTTokens(); - accountESDTs.forEach(async (esdt) => { - const token = findTokenById(`elrond/esdt/${esdt.identifier}`); + const accountESDTs = await getAccountESDTTokens(accountAddress); + for (let esdt of accountESDTs) { + const esdtIdentifierHex = Buffer.from(esdt.identifier).toString('hex'); + const token = findTokenById(`elrond/esdt/${esdtIdentifierHex}`); if (token && !blacklistedTokenIds.includes(token.id)) { const tokenAccount = await buildElrondESDTTokenAccount({ @@ -92,7 +94,7 @@ async function elrondBuildESDTTokenAccounts({ tokenAccounts.push(tokenAccount); } } - }); + } // Preserve order of tokenAccounts from the existing token accounts tokenAccounts.sort((a, b) => { diff --git a/src/families/elrond/js-buildTransaction.ts b/src/families/elrond/js-buildTransaction.ts index 8ce98966f9..57dcee6560 100644 --- a/src/families/elrond/js-buildTransaction.ts +++ b/src/families/elrond/js-buildTransaction.ts @@ -22,8 +22,8 @@ export const buildTransaction = async ( const transactionType = signUsingHash ? HASH_TRANSACTION : RAW_TRANSACTION; let data; if (ta) { - const tokenIdentifier = Buffer.from(ta.id.split('/')[2], 'hex').toString(); - data = `ESDTTransfer@${tokenIdentifier}@${t.amount}`; + const tokenIdentifierHex = ta.id.split('/')[2]; + data = `ESDTTransfer@${tokenIdentifierHex}@${t.amount.toString(16)}`; } const unsigned = { diff --git a/src/families/elrond/js-signOperation.ts b/src/families/elrond/js-signOperation.ts index 46128e0a1e..f4445c46a2 100644 --- a/src/families/elrond/js-signOperation.ts +++ b/src/families/elrond/js-signOperation.ts @@ -8,6 +8,7 @@ import { encodeOperationId } from "../../operation"; import Elrond from "./hw-app-elrond"; import { buildTransaction } from "./js-buildTransaction"; import { getNonce, compareVersions } from "./logic"; +import { findTokenById } from "@ledgerhq/cryptoassets"; const buildOptimisticOperation = ( account: Account, @@ -59,6 +60,9 @@ const signOperation = ({ } // Collect data for an ESDT transfer const { subAccounts } = account; + if (subAccounts) { + transaction.subAccountId = subAccounts[0].id; + } const { subAccountId } = transaction; const tokenAccount = !subAccountId ? null @@ -66,6 +70,13 @@ const signOperation = ({ const elrond = new Elrond(transport); await elrond.setAddress(account.freshAddressPath); + + if (tokenAccount) { + const tokenIdentifier = tokenAccount.id.split('+')[1]; + const token = findTokenById(`elrond/esdt/${tokenIdentifier}`); + const message = await elrond.provideESDTInfo(token?.ticker || '', token?.id.split(',')[2] || '', token?.units[0].magnitude || 18, 'T', token?.ledgerSignature || ''); + console.log({message}); + } const { version } = await elrond.getAppConfiguration(); const signUsingHash = compareVersions(version, "1.0.11") >= 0; From 968ea334dc1bda61f0e8e23d531a201c1b38bf41 Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Mon, 4 Oct 2021 13:16:57 +0300 Subject: [PATCH 073/127] ESDT transactions specifics --- src/families/elrond/api/apiCalls.ts | 10 +++++++++- src/families/elrond/js-buildTransaction.ts | 9 ++++++--- src/families/elrond/js-signOperation.ts | 9 ++++++--- src/families/elrond/types.ts | 1 + 4 files changed, 22 insertions(+), 7 deletions(-) diff --git a/src/families/elrond/api/apiCalls.ts b/src/families/elrond/api/apiCalls.ts index 4e772a2945..d483ec8a8b 100644 --- a/src/families/elrond/api/apiCalls.ts +++ b/src/families/elrond/api/apiCalls.ts @@ -70,14 +70,21 @@ export default class ElrondApi { } async submit({ operation, signature, signUsingHash }) { - const { chainId, gasLimit, gasPrice } = await this.getNetworkConfig(); + let { chainId, gasLimit, gasPrice } = await this.getNetworkConfig(); const transactionType = signUsingHash ? HASH_TRANSACTION : RAW_TRANSACTION; const { senders: [sender], recipients: [receiver], value, transactionSequenceNumber: nonce, + extra: { data }, } = operation; + + if (data) { + // gasLimit for an ESDT transfer + gasLimit = 600000; + } + const { data: { data: { txHash: hash }, @@ -94,6 +101,7 @@ export default class ElrondApi { gasLimit, chainID: chainId, signature, + data, ...transactionType, }, }); diff --git a/src/families/elrond/js-buildTransaction.ts b/src/families/elrond/js-buildTransaction.ts index 57dcee6560..d86624d2db 100644 --- a/src/families/elrond/js-buildTransaction.ts +++ b/src/families/elrond/js-buildTransaction.ts @@ -18,12 +18,15 @@ export const buildTransaction = async ( ) => { const address = a.freshAddress; const nonce = getNonce(a); - const { gasPrice, gasLimit, chainId } = await getNetworkConfig(); + let { gasPrice, gasLimit, chainId } = await getNetworkConfig(); const transactionType = signUsingHash ? HASH_TRANSACTION : RAW_TRANSACTION; let data; if (ta) { const tokenIdentifierHex = ta.id.split('/')[2]; - data = `ESDTTransfer@${tokenIdentifierHex}@${t.amount.toString(16)}`; + data = Buffer.from(`ESDTTransfer@${tokenIdentifierHex}@${t.amount.toString(16)}`).toString('base64'); + t.amount = new BigNumber(0); //amount of EGLD to be sent should be 0 + t.data = data; + gasLimit = 600000; //gasLimit for and ESDT transfer } const unsigned = { @@ -35,8 +38,8 @@ export const buildTransaction = async ( sender: address, gasPrice, gasLimit, - chainID: chainId, data: data, + chainID: chainId, ...transactionType, }; // Will likely be a call to Elrond SDK diff --git a/src/families/elrond/js-signOperation.ts b/src/families/elrond/js-signOperation.ts index f4445c46a2..2f3d9d0660 100644 --- a/src/families/elrond/js-signOperation.ts +++ b/src/families/elrond/js-signOperation.ts @@ -33,6 +33,7 @@ const buildOptimisticOperation = ( date: new Date(), extra: { signUsingHash, + data: transaction.data, }, }; return operation; @@ -73,9 +74,8 @@ const signOperation = ({ if (tokenAccount) { const tokenIdentifier = tokenAccount.id.split('+')[1]; - const token = findTokenById(`elrond/esdt/${tokenIdentifier}`); - const message = await elrond.provideESDTInfo(token?.ticker || '', token?.id.split(',')[2] || '', token?.units[0].magnitude || 18, 'T', token?.ledgerSignature || ''); - console.log({message}); + const token = findTokenById(`${tokenIdentifier}`); + const message: Buffer = await elrond.provideESDTInfo(token?.ticker || '', token?.id.split('/')[2] || '', token?.units[0].magnitude || 18, 'T', token?.ledgerSignature || ''); } const { version } = await elrond.getAppConfiguration(); const signUsingHash = compareVersions(version, "1.0.11") >= 0; @@ -86,6 +86,9 @@ const signOperation = ({ transaction, signUsingHash ); + + console.log(unsigned); + o.next({ type: "device-signature-requested", }); diff --git a/src/families/elrond/types.ts b/src/families/elrond/types.ts index 9e3bd2ace6..3f5ed868e7 100644 --- a/src/families/elrond/types.ts +++ b/src/families/elrond/types.ts @@ -38,6 +38,7 @@ export type Transaction = TransactionCommon & { fee?: BigNumber; round?: number; miniBlockHash?: string; + data?: string; }; /** From e8e5bdbe3129feca613fca36c02f6692de56f5d5 Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Tue, 5 Oct 2021 12:50:07 +0300 Subject: [PATCH 074/127] constant gas for esdt transfer --- src/families/elrond/constants.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/families/elrond/constants.ts b/src/families/elrond/constants.ts index f4e880bc75..7f41f763f4 100644 --- a/src/families/elrond/constants.ts +++ b/src/families/elrond/constants.ts @@ -8,3 +8,4 @@ export const RAW_TRANSACTION = { }; export const METACHAIN_SHARD = 4294967295; export const TRANSACTIONS_SIZE = 10000; +export const ESDT_TRANSFER_GAS = 600000; From 5a293f07406fec57824ea4cd2968292daee7b53c Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Tue, 5 Oct 2021 12:50:45 +0300 Subject: [PATCH 075/127] add types to communicate properly with elrond protocol --- src/families/elrond/api/apiCalls.ts | 51 +++++++++++++++++------------ src/families/elrond/api/sdk.ts | 8 ++--- src/families/elrond/types.ts | 42 +++++++++++++++++++++--- 3 files changed, 72 insertions(+), 29 deletions(-) diff --git a/src/families/elrond/api/apiCalls.ts b/src/families/elrond/api/apiCalls.ts index d483ec8a8b..161820ac99 100644 --- a/src/families/elrond/api/apiCalls.ts +++ b/src/families/elrond/api/apiCalls.ts @@ -4,7 +4,9 @@ import { RAW_TRANSACTION, METACHAIN_SHARD, TRANSACTIONS_SIZE, + ESDT_TRANSFER_GAS, } from "../constants"; +import { ElrondProtocolTransaction, ESDTToken, ESDTTransaction, NetworkInfo, Transaction } from "../types"; export default class ElrondApi { private API_URL: string; @@ -19,6 +21,7 @@ export default class ElrondApi { method: "GET", url: `${this.API_URL}/accounts/${addr}`, }); + return { balance, nonce, @@ -43,7 +46,7 @@ export default class ElrondApi { return data; } - async getNetworkConfig() { + async getNetworkConfig(): Promise { const { data: { data: { @@ -60,8 +63,9 @@ export default class ElrondApi { method: "GET", url: `${this.API_URL}/network/config`, }); + return { - chainId, + chainID: chainId, denomination, gasLimit, gasPrice, @@ -70,8 +74,10 @@ export default class ElrondApi { } async submit({ operation, signature, signUsingHash }) { - let { chainId, gasLimit, gasPrice } = await this.getNetworkConfig(); + let { chainID, gasLimit, gasPrice } = await this.getNetworkConfig(); + const transactionType = signUsingHash ? HASH_TRANSACTION : RAW_TRANSACTION; + const { senders: [sender], recipients: [receiver], @@ -82,7 +88,20 @@ export default class ElrondApi { if (data) { // gasLimit for an ESDT transfer - gasLimit = 600000; + gasLimit = ESDT_TRANSFER_GAS; + } + + const transaction: ElrondProtocolTransaction = { + nonce, + value, + receiver, + sender, + gasPrice, + gasLimit, + chainID, + signature, + data, + ...transactionType } const { @@ -92,31 +111,21 @@ export default class ElrondApi { } = await network({ method: "POST", url: `${this.API_URL}/transaction/send`, - data: { - nonce, - value, - receiver, - sender, - gasPrice, - gasLimit, - chainID: chainId, - signature, - data, - ...transactionType, - }, + data: transaction, }); + return { hash, }; } - async getHistory(addr: string, startAt: number) { + async getHistory(addr: string, startAt: number): Promise { const { data: transactionsCount } = await network({ method: "GET", url: `${this.API_URL}/transactions/count?condition=should&sender=${addr}&receiver=${addr}&after=${startAt}`, }); - let allTransactions: any[] = []; + let allTransactions: Transaction[] = []; let from = 0; while (from <= transactionsCount) { const { data: transactions } = await network({ @@ -132,7 +141,7 @@ export default class ElrondApi { return allTransactions; } - async getESDTTransactionsForAddress(addr: string, token: string) { + async getESDTTransactionsForAddress(addr: string, token: string): Promise { const { data: transactions } = await network({ method: "GET", url: `${this.API_URL}/transactions?sender=${addr}&receiver=${addr}&condition=should` @@ -141,7 +150,7 @@ export default class ElrondApi { return transactions.filter(({tokenIdentifier}) => tokenIdentifier && tokenIdentifier==token); } - async getESDTTokensForAddress(addr: string) { + async getESDTTokensForAddress(addr: string): Promise { const { data: tokens } = await network({ method: "GET", url: `${this.API_URL}/accounts/${addr}/tokens` @@ -150,7 +159,7 @@ export default class ElrondApi { return tokens; } - async getBlockchainBlockHeight() { + async getBlockchainBlockHeight(): Promise { const { data: [{ round: blockHeight }], } = await network({ diff --git a/src/families/elrond/api/sdk.ts b/src/families/elrond/api/sdk.ts index 5bc3253edd..c387266d07 100644 --- a/src/families/elrond/api/sdk.ts +++ b/src/families/elrond/api/sdk.ts @@ -1,6 +1,6 @@ import { BigNumber } from "bignumber.js"; import ElrondApi from "./apiCalls"; -import type { Transaction } from "../types"; +import type { ESDTToken, ESDTTransaction, NetworkInfo, Transaction } from "../types"; import type { Operation, OperationType } from "../../../types"; import { getEnv } from "../../../env"; import { encodeOperationId } from "../../../operation"; @@ -25,7 +25,7 @@ export const getValidators = async () => { validators, }; }; -export const getNetworkConfig = async () => { +export const getNetworkConfig = async (): Promise => { return await api.getNetworkConfig(); }; @@ -49,7 +49,7 @@ function getOperationType( /** * Map transaction to a correct Operation Value (affecting account balance) */ -function getOperationValue(transaction: Transaction, addr: string): BigNumber { +function getOperationValue(transaction: Transaction | ESDTTransaction, addr: string): BigNumber { return isSender(transaction, addr) ? new BigNumber(transaction.value ?? 0).plus(transaction.fee ?? 0) : new BigNumber(transaction.value ?? 0); @@ -104,7 +104,7 @@ export const getOperations = async ( export const getAccountESDTTokens = async ( address: string, -): Promise => { +): Promise => { return await api.getESDTTokensForAddress(address); } diff --git a/src/families/elrond/types.ts b/src/families/elrond/types.ts index 3f5ed868e7..3f22b100c9 100644 --- a/src/families/elrond/types.ts +++ b/src/families/elrond/types.ts @@ -19,6 +19,19 @@ export type ElrondResourcesRaw = { nonce: number; }; +export type ElrondProtocolTransaction = { + nonce: number; + value: string; + receiver: string; + sender: string; + gasPrice: number; + gasLimit: number; + chainID: string; + signature?: string; + data?: string; //for ESDT or stake transactions + version: number; + options: number; +} /** * Elrond transaction */ @@ -41,6 +54,18 @@ export type Transaction = TransactionCommon & { data?: string; }; +export type ESDTTransaction = Transaction & { + type: 'ESDT' + tokenIdentifier?: string; + tokenValue?: string; +} + +export type ESDTToken = { + identifier: string; + name: string; + balance: string; +} + /** * Elrond transaction from a raw JSON */ @@ -64,12 +89,21 @@ export type ElrondValidator = { }; export type NetworkInfo = { - family: "elrond"; - gasPrice: Range; + family?: "elrond"; + chainID: string; + denomination: number; + gasLimit: number; + gasPrice: number; + gasPerByte: number; }; + export type NetworkInfoRaw = { - family: "elrond"; - gasPrice: RangeRaw; + family?: "elrond"; + chainID: string; + denomination: number; + gasLimit: number; + gasPrice: number; + gasPerByte: number; }; export type ElrondPreloadData = { From 2d932b1ac662473ec6f79ad3f93b72e5e00aff2e Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Tue, 5 Oct 2021 12:54:31 +0300 Subject: [PATCH 076/127] return hash when transaction is submitted --- src/families/elrond/api/apiCalls.ts | 6 ++---- src/families/elrond/api/sdk.ts | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/families/elrond/api/apiCalls.ts b/src/families/elrond/api/apiCalls.ts index 161820ac99..1a6bcaee4f 100644 --- a/src/families/elrond/api/apiCalls.ts +++ b/src/families/elrond/api/apiCalls.ts @@ -73,7 +73,7 @@ export default class ElrondApi { }; } - async submit({ operation, signature, signUsingHash }) { + async submit({ operation, signature, signUsingHash }): Promise { let { chainID, gasLimit, gasPrice } = await this.getNetworkConfig(); const transactionType = signUsingHash ? HASH_TRANSACTION : RAW_TRANSACTION; @@ -114,9 +114,7 @@ export default class ElrondApi { data: transaction, }); - return { - hash, - }; + return hash; } async getHistory(addr: string, startAt: number): Promise { diff --git a/src/families/elrond/api/sdk.ts b/src/families/elrond/api/sdk.ts index c387266d07..e4f2ed29ad 100644 --- a/src/families/elrond/api/sdk.ts +++ b/src/families/elrond/api/sdk.ts @@ -136,7 +136,7 @@ export const getFees = async (unsigned): Promise => { * Broadcast blob to blockchain */ export const broadcastTransaction = async (blob: any) => { - const { hash } = await api.submit(blob); + const hash = await api.submit(blob); // Transaction hash is likely to be returned return { hash, From d0859d93d343c5c55bab0b514307b8481df36a98 Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Tue, 5 Oct 2021 13:10:20 +0300 Subject: [PATCH 077/127] encode and ESDT transfer logic --- src/families/elrond/js-buildTransaction.ts | 32 +++++++++++----------- src/families/elrond/logic.ts | 7 ++++- 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/src/families/elrond/js-buildTransaction.ts b/src/families/elrond/js-buildTransaction.ts index d86624d2db..d571136412 100644 --- a/src/families/elrond/js-buildTransaction.ts +++ b/src/families/elrond/js-buildTransaction.ts @@ -1,8 +1,8 @@ -import type { Transaction } from "./types"; +import type { ElrondProtocolTransaction, NetworkInfo, Transaction } from "./types"; import type { Account, SubAccount } from "../../types"; -import { getNonce } from "./logic"; +import { encodeESDTTransfer, getNonce } from "./logic"; import { getNetworkConfig } from "./api"; -import { HASH_TRANSACTION, RAW_TRANSACTION } from "./constants"; +import { ESDT_TRANSFER_GAS, HASH_TRANSACTION, RAW_TRANSACTION } from "./constants"; import BigNumber from "bignumber.js"; /** @@ -18,28 +18,28 @@ export const buildTransaction = async ( ) => { const address = a.freshAddress; const nonce = getNonce(a); - let { gasPrice, gasLimit, chainId } = await getNetworkConfig(); + let { gasPrice, gasLimit, chainID }: NetworkInfo = await getNetworkConfig(); const transactionType = signUsingHash ? HASH_TRANSACTION : RAW_TRANSACTION; - let data; + if (ta) { - const tokenIdentifierHex = ta.id.split('/')[2]; - data = Buffer.from(`ESDTTransfer@${tokenIdentifierHex}@${t.amount.toString(16)}`).toString('base64'); - t.amount = new BigNumber(0); //amount of EGLD to be sent should be 0 - t.data = data; - gasLimit = 600000; //gasLimit for and ESDT transfer + t.amount = new BigNumber(0); //amount of EGLD to be sent should be 0 in an ESDT transafer + t.data = encodeESDTTransfer(t, ta); + gasLimit = ESDT_TRANSFER_GAS; //gasLimit for and ESDT transfer } - const unsigned = { + const transactionValue = t.useAllAmount + ? a.balance.minus(t.fees ? t.fees : new BigNumber(0)) + : t.amount; + + const unsigned: ElrondProtocolTransaction = { nonce, - value: t.useAllAmount - ? a.balance.minus(t.fees ? t.fees : new BigNumber(0)) - : t.amount, + value: transactionValue.toString(), receiver: t.recipient, sender: address, gasPrice, gasLimit, - data: data, - chainID: chainId, + data: t.data, + chainID, ...transactionType, }; // Will likely be a call to Elrond SDK diff --git a/src/families/elrond/logic.ts b/src/families/elrond/logic.ts index 953011eccb..4fa7965f39 100644 --- a/src/families/elrond/logic.ts +++ b/src/families/elrond/logic.ts @@ -1,4 +1,4 @@ -import type { Account } from "../../types"; +import type { Account, SubAccount } from "../../types"; import type { Transaction } from "./types"; import * as bech32 from "bech32"; @@ -90,3 +90,8 @@ export const getNonce = (a: Account): number => { ); return nonce; }; + +export const encodeESDTTransfer = (t: Transaction, ta: SubAccount): string => { + const tokenIdentifierHex = ta.id.split('/')[2]; + return Buffer.from(`ESDTTransfer@${tokenIdentifierHex}@${t.amount.toString(16)}`).toString('base64'); +} From c242c61f72520af94b4d08d0ae804bf2142f613c Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Tue, 5 Oct 2021 13:13:18 +0300 Subject: [PATCH 078/127] return only hash when broadcasting transaction --- src/families/elrond/api/sdk.ts | 8 ++------ src/families/elrond/js-broadcast.ts | 4 ++-- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/families/elrond/api/sdk.ts b/src/families/elrond/api/sdk.ts index e4f2ed29ad..3e6d745e9a 100644 --- a/src/families/elrond/api/sdk.ts +++ b/src/families/elrond/api/sdk.ts @@ -135,10 +135,6 @@ export const getFees = async (unsigned): Promise => { /** * Broadcast blob to blockchain */ -export const broadcastTransaction = async (blob: any) => { - const hash = await api.submit(blob); - // Transaction hash is likely to be returned - return { - hash, - }; +export const broadcastTransaction = async (blob: any): Promise => { + return await api.submit(blob); }; diff --git a/src/families/elrond/js-broadcast.ts b/src/families/elrond/js-broadcast.ts index fde3c6991f..2d40678b7a 100644 --- a/src/families/elrond/js-broadcast.ts +++ b/src/families/elrond/js-broadcast.ts @@ -14,12 +14,12 @@ const broadcast = async ({ const { extra: { signUsingHash }, } = operation; - const { hash } = await broadcastTransaction({ + const txHash = await broadcastTransaction({ operation, signature, signUsingHash, }); - return patchOperationWithHash(operation, hash); + return patchOperationWithHash(operation, txHash); }; export default broadcast; From 434c92db37213cb1d4dea2db3ff785f73a4d9a9c Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Tue, 5 Oct 2021 13:18:53 +0300 Subject: [PATCH 079/127] compute transaction fees by using data field of transaction --- src/families/elrond/api/sdk.ts | 3 +-- src/families/elrond/js-getFeesForTransaction.ts | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/families/elrond/api/sdk.ts b/src/families/elrond/api/sdk.ts index 3e6d745e9a..b5b28c23ea 100644 --- a/src/families/elrond/api/sdk.ts +++ b/src/families/elrond/api/sdk.ts @@ -121,8 +121,7 @@ export const getAccountESDTOperations = async ( /** * Obtain fees from blockchain */ -export const getFees = async (unsigned): Promise => { - const { data } = unsigned; +export const getFees = async (data?: string): Promise => { const { gasLimit, gasPerByte, gasPrice } = await getTransactionParams(); if (!data) { diff --git a/src/families/elrond/js-getFeesForTransaction.ts b/src/families/elrond/js-getFeesForTransaction.ts index 02e7108398..0036d7c220 100644 --- a/src/families/elrond/js-getFeesForTransaction.ts +++ b/src/families/elrond/js-getFeesForTransaction.ts @@ -2,7 +2,6 @@ import { BigNumber } from "bignumber.js"; import type { Account } from "../../types"; import type { Transaction } from "./types"; import { getFees } from "./api"; -import { buildTransaction } from "./js-buildTransaction"; /** * Fetch the transaction fees for a transaction @@ -19,8 +18,7 @@ const getEstimatedFees = async ({ t: Transaction; signUsingHash: boolean | undefined; }): Promise => { - const unsigned = await buildTransaction(a, null, t, signUsingHash); - return await getFees(JSON.parse(unsigned)); + return await getFees(t.data); }; export default getEstimatedFees; From df9a8aff794b33fc4740dbe9af3e8a450927fe63 Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Tue, 5 Oct 2021 13:43:54 +0300 Subject: [PATCH 080/127] compute transaction fees --- src/families/elrond/api/sdk.ts | 13 +++++++++---- src/families/elrond/js-buildTransaction.ts | 2 +- src/families/elrond/js-estimateMaxSpendable.ts | 6 +----- src/families/elrond/js-getFeesForTransaction.ts | 13 ++----------- src/families/elrond/js-transaction.ts | 6 +----- 5 files changed, 14 insertions(+), 26 deletions(-) diff --git a/src/families/elrond/api/sdk.ts b/src/families/elrond/api/sdk.ts index b5b28c23ea..1d892165f0 100644 --- a/src/families/elrond/api/sdk.ts +++ b/src/families/elrond/api/sdk.ts @@ -5,6 +5,7 @@ import type { Operation, OperationType } from "../../../types"; import { getEnv } from "../../../env"; import { encodeOperationId } from "../../../operation"; import { getTransactionParams } from "../cache"; +import { ESDT_TRANSFER_GAS } from "../constants"; const api = new ElrondApi(getEnv("ELROND_API_ENDPOINT")); /** @@ -121,14 +122,18 @@ export const getAccountESDTOperations = async ( /** * Obtain fees from blockchain */ -export const getFees = async (data?: string): Promise => { - const { gasLimit, gasPerByte, gasPrice } = await getTransactionParams(); +export const getFees = async (t: Transaction): Promise => { + let { gasLimit, gasPerByte, gasPrice } = await getTransactionParams(); - if (!data) { + if (t.subAccountId) { + gasLimit = ESDT_TRANSFER_GAS; + } + + if (!t.data) { return new BigNumber(gasLimit * gasPrice); } - return new BigNumber((gasLimit + gasPerByte * data.length) * gasPrice); + return new BigNumber((gasLimit + gasPerByte * t.data.length) * gasPrice); }; /** diff --git a/src/families/elrond/js-buildTransaction.ts b/src/families/elrond/js-buildTransaction.ts index d571136412..f666d15bfd 100644 --- a/src/families/elrond/js-buildTransaction.ts +++ b/src/families/elrond/js-buildTransaction.ts @@ -22,8 +22,8 @@ export const buildTransaction = async ( const transactionType = signUsingHash ? HASH_TRANSACTION : RAW_TRANSACTION; if (ta) { - t.amount = new BigNumber(0); //amount of EGLD to be sent should be 0 in an ESDT transafer t.data = encodeESDTTransfer(t, ta); + t.amount = new BigNumber(0); //amount of EGLD to be sent should be 0 in an ESDT transafer gasLimit = ESDT_TRANSFER_GAS; //gasLimit for and ESDT transfer } diff --git a/src/families/elrond/js-estimateMaxSpendable.ts b/src/families/elrond/js-estimateMaxSpendable.ts index a6601e55fa..3ff880357d 100644 --- a/src/families/elrond/js-estimateMaxSpendable.ts +++ b/src/families/elrond/js-estimateMaxSpendable.ts @@ -25,11 +25,7 @@ const estimateMaxSpendable = async ({ ...transaction, amount: a.spendableBalance, }; - const fees = await getEstimatedFees({ - a, - t, - signUsingHash: true, - }); + const fees = await getEstimatedFees(t); if (fees.gt(a.spendableBalance)) { return new BigNumber(0); diff --git a/src/families/elrond/js-getFeesForTransaction.ts b/src/families/elrond/js-getFeesForTransaction.ts index 0036d7c220..66e4f0f999 100644 --- a/src/families/elrond/js-getFeesForTransaction.ts +++ b/src/families/elrond/js-getFeesForTransaction.ts @@ -1,5 +1,4 @@ import { BigNumber } from "bignumber.js"; -import type { Account } from "../../types"; import type { Transaction } from "./types"; import { getFees } from "./api"; @@ -9,16 +8,8 @@ import { getFees } from "./api"; * @param {Account} a * @param {Transaction} t */ -const getEstimatedFees = async ({ - a, - t, - signUsingHash = true, -}: { - a: Account; - t: Transaction; - signUsingHash: boolean | undefined; -}): Promise => { - return await getFees(t.data); +const getEstimatedFees = async (t: Transaction): Promise => { + return await getFees(t); }; export default getEstimatedFees; diff --git a/src/families/elrond/js-transaction.ts b/src/families/elrond/js-transaction.ts index 825febe4a3..a4d12141ec 100644 --- a/src/families/elrond/js-transaction.ts +++ b/src/families/elrond/js-transaction.ts @@ -43,11 +43,7 @@ export const updateTransaction = ( */ export const prepareTransaction = async (a: Account, t: Transaction) => { let fees = t.fees; - fees = await getEstimatedFees({ - a, - t, - signUsingHash: true, - }); + fees = await getEstimatedFees(t); if (!sameFees(t.fees, fees)) { return { ...t, fees }; From e1c21c5cae01579dd1e6f6ea865646917e6147fa Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Tue, 5 Oct 2021 13:53:03 +0300 Subject: [PATCH 081/127] verify ESDT token credentials --- src/families/elrond/hw-app-elrond/index.ts | 15 ++++++++++----- src/families/elrond/js-signOperation.ts | 8 +++----- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/families/elrond/hw-app-elrond/index.ts b/src/families/elrond/hw-app-elrond/index.ts index 514d19543c..5bdb005138 100644 --- a/src/families/elrond/hw-app-elrond/index.ts +++ b/src/families/elrond/hw-app-elrond/index.ts @@ -212,12 +212,17 @@ export default class Elrond { } async provideESDTInfo( - ticker: string, - id: string, - decimals: number, - chainId: string, - signature: string + ticker?: string, + id?: string, + decimals?: number, + chainId?: string, + signature?: string ): Promise { + + if (!ticker || !id || !decimals || !chainId || !signature) { + throw new Error("Invalid ESDT token credentials!"); + } + const data = this.serializeESDTInfo( ticker, id, diff --git a/src/families/elrond/js-signOperation.ts b/src/families/elrond/js-signOperation.ts index 2f3d9d0660..bcdfc18b36 100644 --- a/src/families/elrond/js-signOperation.ts +++ b/src/families/elrond/js-signOperation.ts @@ -75,26 +75,24 @@ const signOperation = ({ if (tokenAccount) { const tokenIdentifier = tokenAccount.id.split('+')[1]; const token = findTokenById(`${tokenIdentifier}`); - const message: Buffer = await elrond.provideESDTInfo(token?.ticker || '', token?.id.split('/')[2] || '', token?.units[0].magnitude || 18, 'T', token?.ledgerSignature || ''); + await elrond.provideESDTInfo(token?.ticker, token?.id.split('/')[2], token?.units[0].magnitude, 'T', token?.ledgerSignature); } const { version } = await elrond.getAppConfiguration(); const signUsingHash = compareVersions(version, "1.0.11") >= 0; - const unsigned = await buildTransaction( + const unsignedTx: string = await buildTransaction( account, tokenAccount, transaction, signUsingHash ); - console.log(unsigned); - o.next({ type: "device-signature-requested", }); const r = await elrond.signTransaction( account.freshAddressPath, - unsigned, + unsignedTx, signUsingHash ); o.next({ From 858e32a85cd6307a4d007257dcdf2cf754df18b2 Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Tue, 5 Oct 2021 13:56:31 +0300 Subject: [PATCH 082/127] use elrond account as fallback --- src/families/elrond/js-signOperation.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/families/elrond/js-signOperation.ts b/src/families/elrond/js-signOperation.ts index bcdfc18b36..b9cc362066 100644 --- a/src/families/elrond/js-signOperation.ts +++ b/src/families/elrond/js-signOperation.ts @@ -61,9 +61,6 @@ const signOperation = ({ } // Collect data for an ESDT transfer const { subAccounts } = account; - if (subAccounts) { - transaction.subAccountId = subAccounts[0].id; - } const { subAccountId } = transaction; const tokenAccount = !subAccountId ? null From 18dcf84b3bb94afcffb5fdce9b24b0c53090ca9d Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Tue, 5 Oct 2021 14:00:47 +0300 Subject: [PATCH 083/127] check if account has ESDT tokens --- src/families/elrond/api/index.ts | 1 + src/families/elrond/api/sdk.ts | 4 ++++ src/families/elrond/js-synchronisation.ts | 4 ++-- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/families/elrond/api/index.ts b/src/families/elrond/api/index.ts index 49b55f20c2..6218326b92 100644 --- a/src/families/elrond/api/index.ts +++ b/src/families/elrond/api/index.ts @@ -7,4 +7,5 @@ export { broadcastTransaction, getAccountESDTTokens, getAccountESDTOperations, + hasESDTTokens } from "./sdk"; diff --git a/src/families/elrond/api/sdk.ts b/src/families/elrond/api/sdk.ts index 1d892165f0..65be956921 100644 --- a/src/families/elrond/api/sdk.ts +++ b/src/families/elrond/api/sdk.ts @@ -109,6 +109,10 @@ export const getAccountESDTTokens = async ( return await api.getESDTTokensForAddress(address); } +export const hasESDTTokens = async(address: string): Promise => { + return (await getAccountESDTTokens(address)).length > 0; +} + export const getAccountESDTOperations = async ( accountId: string, address: string, diff --git a/src/families/elrond/js-synchronisation.ts b/src/families/elrond/js-synchronisation.ts index 07345c20a5..6787af398f 100644 --- a/src/families/elrond/js-synchronisation.ts +++ b/src/families/elrond/js-synchronisation.ts @@ -1,7 +1,7 @@ import type { Account, TokenAccount } from "../../types"; import type { GetAccountShape } from "../../bridge/jsHelpers"; import { makeSync, makeScanAccounts, mergeOps } from "../../bridge/jsHelpers"; -import { getAccount, getAccountESDTTokens, getOperations } from "./api"; +import { getAccount, getOperations, hasESDTTokens } from "./api"; import elrondBuildESDTTokenAccounts from "./js-buildSubAccounts"; const getAccountShape: GetAccountShape = async (info) => { @@ -19,7 +19,7 @@ const getAccountShape: GetAccountShape = async (info) => { const operations = mergeOps(oldOperations, newOperations); let subAccounts: TokenAccount[] | undefined = []; - if ((await getAccountESDTTokens(address)).length) { + if (await hasESDTTokens(address)) { subAccounts = await elrondBuildESDTTokenAccounts({ currency, accountId: id, From 029380f98dc5165ec0be475c9a5b405d61da25a7 Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Wed, 3 Nov 2021 09:11:20 +0200 Subject: [PATCH 084/127] check if fees are greater than account balance --- src/families/elrond/js-getTransactionStatus.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/families/elrond/js-getTransactionStatus.ts b/src/families/elrond/js-getTransactionStatus.ts index 207c2ce74a..0dc931bf35 100644 --- a/src/families/elrond/js-getTransactionStatus.ts +++ b/src/families/elrond/js-getTransactionStatus.ts @@ -32,6 +32,10 @@ const getTransactionStatus = async ( } const estimatedFees = t.fees || new BigNumber(0); + if (estimatedFees.gt(a.balance)) { + errors.amount = new NotEnoughBalance(); + } + const totalSpent = useAllAmount ? a.balance : new BigNumber(t.amount).plus(estimatedFees); From d0a1874c9ff7a4783addd7d7217b9f825a0bdff0 Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Wed, 3 Nov 2021 09:11:51 +0200 Subject: [PATCH 085/127] compute operation value for send max transactions --- src/families/elrond/js-signOperation.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/families/elrond/js-signOperation.ts b/src/families/elrond/js-signOperation.ts index 1bb530a4ab..30e29e3ed3 100644 --- a/src/families/elrond/js-signOperation.ts +++ b/src/families/elrond/js-signOperation.ts @@ -15,7 +15,7 @@ const buildOptimisticOperation = ( fee: BigNumber ): Operation => { const type = "OUT"; - const value = new BigNumber(transaction.amount); + const value = transaction.useAllAmount ? account.balance.minus(fee) : new BigNumber(transaction.amount); const operation: Operation = { id: encodeOperationId(account.id, "", type), hash: "", From fa150c85cd6118c2eb843ba81de6f486d1a75e85 Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Wed, 3 Nov 2021 09:21:43 +0200 Subject: [PATCH 086/127] lint --- src/families/elrond/js-signOperation.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/families/elrond/js-signOperation.ts b/src/families/elrond/js-signOperation.ts index 30e29e3ed3..099d6b6033 100644 --- a/src/families/elrond/js-signOperation.ts +++ b/src/families/elrond/js-signOperation.ts @@ -15,7 +15,9 @@ const buildOptimisticOperation = ( fee: BigNumber ): Operation => { const type = "OUT"; - const value = transaction.useAllAmount ? account.balance.minus(fee) : new BigNumber(transaction.amount); + const value = transaction.useAllAmount + ? account.balance.minus(fee) + : new BigNumber(transaction.amount); const operation: Operation = { id: encodeOperationId(account.id, "", type), hash: "", From e8b4acc300bd05fa73dfcec9cf8ef3674b65a439 Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Mon, 15 Nov 2021 13:18:38 +0200 Subject: [PATCH 087/127] refactor api calls --- src/families/elrond/api/apiCalls.ts | 11 ++++------- src/families/elrond/types.ts | 2 ++ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/families/elrond/api/apiCalls.ts b/src/families/elrond/api/apiCalls.ts index b8993012c2..98305990af 100644 --- a/src/families/elrond/api/apiCalls.ts +++ b/src/families/elrond/api/apiCalls.ts @@ -116,7 +116,7 @@ export default class ElrondApi { async getHistory(addr: string, startAt: number): Promise { const { data: transactionsCount } = await network({ method: "GET", - url: `${this.API_URL}/transactions/count?condition=should&sender=${addr}&receiver=${addr}&after=${startAt}`, + url: `${this.API_URL}/accounts/${addr}/transactions/count?after=${startAt}`, }); let allTransactions: Transaction[] = []; @@ -124,7 +124,7 @@ export default class ElrondApi { while (from <= transactionsCount) { const { data: transactions } = await network({ method: "GET", - url: `${this.API_URL}/transactions?condition=should&sender=${addr}&receiver=${addr}&after=${startAt}&from=${from}&size=${TRANSACTIONS_SIZE}`, + url: `${this.API_URL}/accounts/${addr}/transactions?after=${startAt}&from=${from}&size=${TRANSACTIONS_SIZE}`, }); allTransactions = [...allTransactions, ...transactions]; @@ -135,11 +135,8 @@ export default class ElrondApi { return allTransactions; } - async getESDTTransactionsForAddress(addr: string, token: string): Promise { - const { data: transactions } = await network({ - method: "GET", - url: `${this.API_URL}/transactions?sender=${addr}&receiver=${addr}&condition=should` - }); + async getESDTTransactionsForAddress(addr: string, token: string): Promise { + const transactions = await this.getHistory(addr, 0); return transactions.filter(({tokenIdentifier}) => tokenIdentifier && tokenIdentifier==token); } diff --git a/src/families/elrond/types.ts b/src/families/elrond/types.ts index 3f22b100c9..80ef8697a6 100644 --- a/src/families/elrond/types.ts +++ b/src/families/elrond/types.ts @@ -52,6 +52,8 @@ export type Transaction = TransactionCommon & { round?: number; miniBlockHash?: string; data?: string; + tokenIdentifier?: string; + tokenValue?: string; }; export type ESDTTransaction = Transaction & { From 4736c0df291bb53f1da42c57224e57df150b6010 Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Wed, 17 Nov 2021 14:49:17 +0200 Subject: [PATCH 088/127] operation value for esdt transfers --- src/families/elrond/api/apiCalls.ts | 10 ++++++++-- src/families/elrond/api/sdk.ts | 16 +++++++++++----- src/families/elrond/js-buildSubAccounts.ts | 1 + src/families/elrond/types.ts | 8 ++++---- 4 files changed, 24 insertions(+), 11 deletions(-) diff --git a/src/families/elrond/api/apiCalls.ts b/src/families/elrond/api/apiCalls.ts index 98305990af..9237969083 100644 --- a/src/families/elrond/api/apiCalls.ts +++ b/src/families/elrond/api/apiCalls.ts @@ -5,7 +5,7 @@ import { TRANSACTIONS_SIZE, ESDT_TRANSFER_GAS, } from "../constants"; -import { ElrondProtocolTransaction, ESDTToken, ESDTTransaction, NetworkInfo, Transaction } from "../types"; +import { ElrondProtocolTransaction, ElrondTransferOptions, ESDTToken, NetworkInfo, Transaction } from "../types"; export default class ElrondApi { private API_URL: string; @@ -138,7 +138,13 @@ export default class ElrondApi { async getESDTTransactionsForAddress(addr: string, token: string): Promise { const transactions = await this.getHistory(addr, 0); - return transactions.filter(({tokenIdentifier}) => tokenIdentifier && tokenIdentifier==token); + const esdtTransactions = transactions.filter(({tokenIdentifier}) => tokenIdentifier && tokenIdentifier==token); + + for (let esdtTransaction of esdtTransactions) { + esdtTransaction.transfer = ElrondTransferOptions.esdt; + } + + return esdtTransactions; } async getESDTTokensForAddress(addr: string): Promise { diff --git a/src/families/elrond/api/sdk.ts b/src/families/elrond/api/sdk.ts index 65be956921..2fe3d10590 100644 --- a/src/families/elrond/api/sdk.ts +++ b/src/families/elrond/api/sdk.ts @@ -1,6 +1,6 @@ import { BigNumber } from "bignumber.js"; import ElrondApi from "./apiCalls"; -import type { ESDTToken, ESDTTransaction, NetworkInfo, Transaction } from "../types"; +import { ElrondTransferOptions, ESDTToken, NetworkInfo, Transaction } from "../types"; import type { Operation, OperationType } from "../../../types"; import { getEnv } from "../../../env"; import { encodeOperationId } from "../../../operation"; @@ -50,10 +50,16 @@ function getOperationType( /** * Map transaction to a correct Operation Value (affecting account balance) */ -function getOperationValue(transaction: Transaction | ESDTTransaction, addr: string): BigNumber { - return isSender(transaction, addr) - ? new BigNumber(transaction.value ?? 0).plus(transaction.fee ?? 0) - : new BigNumber(transaction.value ?? 0); +function getOperationValue(transaction: Transaction, addr: string): BigNumber { + if (transaction.transfer === ElrondTransferOptions.esdt) { + return new BigNumber(transaction.tokenValue ?? 0); + } + + if (!isSender(transaction, addr)) { + return new BigNumber(transaction.value ?? 0); + } + + return new BigNumber(transaction.value ?? 0).plus(transaction.fee ?? 0) } /** diff --git a/src/families/elrond/js-buildSubAccounts.ts b/src/families/elrond/js-buildSubAccounts.ts index 2b7545d45e..d84b9f2517 100644 --- a/src/families/elrond/js-buildSubAccounts.ts +++ b/src/families/elrond/js-buildSubAccounts.ts @@ -21,6 +21,7 @@ async function buildElrondESDTTokenAccount({ const tokenIdentifier = Buffer.from(tokenIdentifierHex, 'hex').toString(); const operations = await getAccountESDTOperations(parentAccountId, accountAddress, tokenIdentifier); + const tokenAccount: TokenAccount = { type: "TokenAccount", id, diff --git a/src/families/elrond/types.ts b/src/families/elrond/types.ts index 80ef8697a6..ad7e2bb8bf 100644 --- a/src/families/elrond/types.ts +++ b/src/families/elrond/types.ts @@ -37,6 +37,7 @@ export type ElrondProtocolTransaction = { */ export type Transaction = TransactionCommon & { mode: string; + transfer?: ElrondTransferOptions; family: "elrond"; fees: BigNumber | null | undefined; txHash?: string; @@ -56,10 +57,9 @@ export type Transaction = TransactionCommon & { tokenValue?: string; }; -export type ESDTTransaction = Transaction & { - type: 'ESDT' - tokenIdentifier?: string; - tokenValue?: string; +export enum ElrondTransferOptions { + egld = 'egld', + esdt = 'esdt', } export type ESDTToken = { From f7804cdb84e4519c14bbc8949b9b26862ece7c6b Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Thu, 18 Nov 2021 11:07:06 +0200 Subject: [PATCH 089/127] define max pagination size constant --- src/families/elrond/constants.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/families/elrond/constants.ts b/src/families/elrond/constants.ts index f9ee7e0979..ba03b9692a 100644 --- a/src/families/elrond/constants.ts +++ b/src/families/elrond/constants.ts @@ -3,5 +3,5 @@ export const HASH_TRANSACTION = { options: 1, }; export const METACHAIN_SHARD = 4294967295; -export const TRANSACTIONS_SIZE = 10000; +export const MAX_PAGINATION_SIZE = 10000; export const ESDT_TRANSFER_GAS = 600000; From 706b45435eb5c95558d8db1ad9382a1f2bac50ad Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Thu, 18 Nov 2021 11:07:48 +0200 Subject: [PATCH 090/127] define and use tokens count for address call --- src/families/elrond/api/apiCalls.ts | 34 ++++++++++++++++++++++++----- src/families/elrond/api/sdk.ts | 5 ++++- 2 files changed, 32 insertions(+), 7 deletions(-) diff --git a/src/families/elrond/api/apiCalls.ts b/src/families/elrond/api/apiCalls.ts index 9237969083..19d4d08da5 100644 --- a/src/families/elrond/api/apiCalls.ts +++ b/src/families/elrond/api/apiCalls.ts @@ -2,7 +2,7 @@ import network from "../../../network"; import { HASH_TRANSACTION, METACHAIN_SHARD, - TRANSACTIONS_SIZE, + MAX_PAGINATION_SIZE, ESDT_TRANSFER_GAS, } from "../constants"; import { ElrondProtocolTransaction, ElrondTransferOptions, ESDTToken, NetworkInfo, Transaction } from "../types"; @@ -124,12 +124,12 @@ export default class ElrondApi { while (from <= transactionsCount) { const { data: transactions } = await network({ method: "GET", - url: `${this.API_URL}/accounts/${addr}/transactions?after=${startAt}&from=${from}&size=${TRANSACTIONS_SIZE}`, + url: `${this.API_URL}/accounts/${addr}/transactions?after=${startAt}&from=${from}&size=${MAX_PAGINATION_SIZE}`, }); allTransactions = [...allTransactions, ...transactions]; - from = from + TRANSACTIONS_SIZE; + from = from + MAX_PAGINATION_SIZE; } return allTransactions; @@ -148,12 +148,34 @@ export default class ElrondApi { } async getESDTTokensForAddress(addr: string): Promise { - const { data: tokens } = await network({ + const { data: tokensCount } = await network({ method: "GET", - url: `${this.API_URL}/accounts/${addr}/tokens` + url: `${this.API_URL}/accounts/${addr}/tokens/count` }); - return tokens; + let allTokens: ESDTToken[] = []; + let from = 0; + while (from <= tokensCount) { + const { data: tokens } = await network({ + method: "GET", + url: `${this.API_URL}/accounts/${addr}/tokens?from=${from}&size=${MAX_PAGINATION_SIZE}` + }); + + allTokens = [...allTokens, ...tokens]; + + from = from + MAX_PAGINATION_SIZE; + } + + return allTokens; + } + + async getESDTTokensCountForAddress(addr: string): Promise { + const { data: tokensCount } = await network({ + method: "GET", + url: `${this.API_URL}/accounts/${addr}/tokens/count` + }); + + return tokensCount; } async getBlockchainBlockHeight(): Promise { diff --git a/src/families/elrond/api/sdk.ts b/src/families/elrond/api/sdk.ts index 2fe3d10590..4adc7a7299 100644 --- a/src/families/elrond/api/sdk.ts +++ b/src/families/elrond/api/sdk.ts @@ -20,12 +20,14 @@ export const getAccount = async (addr: string) => { nonce, }; }; + export const getValidators = async () => { const validators = await api.getValidators(); return { validators, }; }; + export const getNetworkConfig = async (): Promise => { return await api.getNetworkConfig(); }; @@ -116,7 +118,8 @@ export const getAccountESDTTokens = async ( } export const hasESDTTokens = async(address: string): Promise => { - return (await getAccountESDTTokens(address)).length > 0; + const tokensCount = await api.getESDTTokensCountForAddress(address); + return tokensCount > 0; } export const getAccountESDTOperations = async ( From f5be588c43e9db2a47e555f52e68d845bf91b4dd Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Thu, 18 Nov 2021 11:33:39 +0200 Subject: [PATCH 091/127] esdt use all amount transactions --- src/families/elrond/js-buildTransaction.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/families/elrond/js-buildTransaction.ts b/src/families/elrond/js-buildTransaction.ts index 58e04d7afd..ee01deaafb 100644 --- a/src/families/elrond/js-buildTransaction.ts +++ b/src/families/elrond/js-buildTransaction.ts @@ -19,15 +19,21 @@ export const buildTransaction = async ( const nonce = getNonce(a); let { gasPrice, gasLimit, chainID }: NetworkInfo = await getNetworkConfig(); + let transactionValue; + if (ta) { t.data = encodeESDTTransfer(t, ta); t.amount = new BigNumber(0); //amount of EGLD to be sent should be 0 in an ESDT transafer gasLimit = ESDT_TRANSFER_GAS; //gasLimit for and ESDT transfer - } - const transactionValue = t.useAllAmount - ? a.balance.minus(t.fees ? t.fees : new BigNumber(0)) - : t.amount; + transactionValue = t.useAllAmount + ? ta.balance : t.amount; + } + else { + transactionValue = t.useAllAmount + ? a.balance.minus(t.fees ? t.fees : new BigNumber(0)) + : t.amount; + } const unsigned: ElrondProtocolTransaction = { nonce, From 6f8cde54356e534ee4c1c3afc5a5998aa3d32460 Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Thu, 18 Nov 2021 12:32:58 +0200 Subject: [PATCH 092/127] transaction value for esdt transfers --- src/families/elrond/js-buildTransaction.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/families/elrond/js-buildTransaction.ts b/src/families/elrond/js-buildTransaction.ts index ee01deaafb..4683a7d165 100644 --- a/src/families/elrond/js-buildTransaction.ts +++ b/src/families/elrond/js-buildTransaction.ts @@ -4,6 +4,7 @@ import { encodeESDTTransfer, getNonce } from "./logic"; import { getNetworkConfig } from "./api"; import { ESDT_TRANSFER_GAS, HASH_TRANSACTION } from "./constants"; import BigNumber from "bignumber.js"; +import getEstimatedFees from "./js-getFeesForTransaction"; /** * @@ -20,14 +21,11 @@ export const buildTransaction = async ( let { gasPrice, gasLimit, chainID }: NetworkInfo = await getNetworkConfig(); let transactionValue; - + if (ta) { t.data = encodeESDTTransfer(t, ta); - t.amount = new BigNumber(0); //amount of EGLD to be sent should be 0 in an ESDT transafer gasLimit = ESDT_TRANSFER_GAS; //gasLimit for and ESDT transfer - - transactionValue = t.useAllAmount - ? ta.balance : t.amount; + transactionValue = new BigNumber(0); //amount of EGLD to be sent should be 0 in an ESDT transfer } else { transactionValue = t.useAllAmount From 06b0c306eba6229930a2eb70676dd011b71af270 Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Thu, 18 Nov 2021 12:44:35 +0200 Subject: [PATCH 093/127] set transaction amount for esdt transfers --- src/families/elrond/js-buildTransaction.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/families/elrond/js-buildTransaction.ts b/src/families/elrond/js-buildTransaction.ts index 4683a7d165..13c3480f05 100644 --- a/src/families/elrond/js-buildTransaction.ts +++ b/src/families/elrond/js-buildTransaction.ts @@ -24,8 +24,11 @@ export const buildTransaction = async ( if (ta) { t.data = encodeESDTTransfer(t, ta); + t.amount = new BigNumber(0); //amount of EGLD to be sent should be 0 in an ESDT transfer gasLimit = ESDT_TRANSFER_GAS; //gasLimit for and ESDT transfer - transactionValue = new BigNumber(0); //amount of EGLD to be sent should be 0 in an ESDT transfer + + transactionValue = t.useAllAmount + ? ta.balance : t.amount; } else { transactionValue = t.useAllAmount From 1e978f61541e54772f54e189453ec1741b771e85 Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Thu, 18 Nov 2021 12:44:59 +0200 Subject: [PATCH 094/127] define chain id constant --- src/families/elrond/constants.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/families/elrond/constants.ts b/src/families/elrond/constants.ts index ba03b9692a..28f8676265 100644 --- a/src/families/elrond/constants.ts +++ b/src/families/elrond/constants.ts @@ -5,3 +5,4 @@ export const HASH_TRANSACTION = { export const METACHAIN_SHARD = 4294967295; export const MAX_PAGINATION_SIZE = 10000; export const ESDT_TRANSFER_GAS = 600000; +export const CHAIN_ID = 'T' From f5d98a754c06befe6b8de03490057396bb8fdc00 Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Thu, 18 Nov 2021 12:47:14 +0200 Subject: [PATCH 095/127] compute fees for transactions status --- src/families/elrond/js-getTransactionStatus.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/families/elrond/js-getTransactionStatus.ts b/src/families/elrond/js-getTransactionStatus.ts index 0dc931bf35..92d58ece68 100644 --- a/src/families/elrond/js-getTransactionStatus.ts +++ b/src/families/elrond/js-getTransactionStatus.ts @@ -10,6 +10,7 @@ import { import type { Account, TransactionStatus } from "../../types"; import type { Transaction } from "./types"; import { isValidAddress, isSelfTransaction } from "./logic"; +import getEstimatedFees from "./js-getFeesForTransaction"; const getTransactionStatus = async ( a: Account, @@ -31,7 +32,7 @@ const getTransactionStatus = async ( errors.fees = new FeeNotLoaded(); } - const estimatedFees = t.fees || new BigNumber(0); + const estimatedFees = await getEstimatedFees(t); if (estimatedFees.gt(a.balance)) { errors.amount = new NotEnoughBalance(); } From 178b344106a96dd8bfed379fdbb5f361af1a1846 Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Thu, 18 Nov 2021 12:48:04 +0200 Subject: [PATCH 096/127] parsing token identifier --- src/families/elrond/js-signOperation.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/families/elrond/js-signOperation.ts b/src/families/elrond/js-signOperation.ts index 01b95e5749..4b8061f410 100644 --- a/src/families/elrond/js-signOperation.ts +++ b/src/families/elrond/js-signOperation.ts @@ -9,6 +9,7 @@ import Elrond from "./hw-app-elrond"; import { buildTransaction } from "./js-buildTransaction"; import { getNonce } from "./logic"; import { findTokenById } from "@ledgerhq/cryptoassets"; +import { CHAIN_ID } from "./constants"; const buildOptimisticOperation = ( account: Account, @@ -72,7 +73,9 @@ const signOperation = ({ if (tokenAccount) { const tokenIdentifier = tokenAccount.id.split('+')[1]; const token = findTokenById(`${tokenIdentifier}`); - await elrond.provideESDTInfo(token?.ticker, token?.id.split('/')[2], token?.units[0].magnitude, 'T', token?.ledgerSignature); + + const collectionIdentifierHex = token?.id.split('/')[2]; + await elrond.provideESDTInfo(token?.ticker, collectionIdentifierHex, token?.units[0].magnitude, CHAIN_ID, token?.ledgerSignature); } const unsignedTx: string = await buildTransaction( From 9f7c6452f9fbfe6ad03647b0ad2326f402c57aa9 Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Thu, 18 Nov 2021 14:37:18 +0200 Subject: [PATCH 097/127] get token transactions within api call and show only egld transactions on primary account --- src/families/elrond/api/apiCalls.ts | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/src/families/elrond/api/apiCalls.ts b/src/families/elrond/api/apiCalls.ts index 19d4d08da5..e63dc10aa4 100644 --- a/src/families/elrond/api/apiCalls.ts +++ b/src/families/elrond/api/apiCalls.ts @@ -122,11 +122,13 @@ export default class ElrondApi { let allTransactions: Transaction[] = []; let from = 0; while (from <= transactionsCount) { - const { data: transactions } = await network({ + let { data: transactions } = await network({ method: "GET", url: `${this.API_URL}/accounts/${addr}/transactions?after=${startAt}&from=${from}&size=${MAX_PAGINATION_SIZE}`, }); + transactions = transactions.filter((transaction) => !transaction.tokenIdentifier); + allTransactions = [...allTransactions, ...transactions]; from = from + MAX_PAGINATION_SIZE; @@ -136,15 +138,29 @@ export default class ElrondApi { } async getESDTTransactionsForAddress(addr: string, token: string): Promise { - const transactions = await this.getHistory(addr, 0); + const { data: tokenTransactionsCount } = await network({ + method: "GET", + url: `${this.API_URL}/accounts/${addr}/transactions/count?token=${token}`, + }); - const esdtTransactions = transactions.filter(({tokenIdentifier}) => tokenIdentifier && tokenIdentifier==token); + let allTokenTransactions: Transaction[] = []; + let from = 0; + while (from <= tokenTransactionsCount) { + const { data: tokenTransactions } = await network({ + method: "GET", + url: `${this.API_URL}/accounts/${addr}/transactions?token=${token}&from=${from}&size=${MAX_PAGINATION_SIZE}`, + }); + + allTokenTransactions = [...allTokenTransactions, ...tokenTransactions]; + + from = from + MAX_PAGINATION_SIZE; + } - for (let esdtTransaction of esdtTransactions) { + for (let esdtTransaction of allTokenTransactions) { esdtTransaction.transfer = ElrondTransferOptions.esdt; } - return esdtTransactions; + return allTokenTransactions; } async getESDTTokensForAddress(addr: string): Promise { From 8927d5885bb85b6f3ac7b3a1de7c8ba77304e543 Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Tue, 14 Dec 2021 10:53:28 +0200 Subject: [PATCH 098/127] use mainnet chainID --- src/families/elrond/constants.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/families/elrond/constants.ts b/src/families/elrond/constants.ts index 28f8676265..fcb93c42c7 100644 --- a/src/families/elrond/constants.ts +++ b/src/families/elrond/constants.ts @@ -5,4 +5,4 @@ export const HASH_TRANSACTION = { export const METACHAIN_SHARD = 4294967295; export const MAX_PAGINATION_SIZE = 10000; export const ESDT_TRANSFER_GAS = 600000; -export const CHAIN_ID = 'T' +export const CHAIN_ID = '1' From cb1c538248c250384690b4118b8a81a039a0fd05 Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Mon, 27 Dec 2021 10:24:53 +0200 Subject: [PATCH 099/127] run lint --- src/families/elrond/api/apiCalls.ts | 38 +++++++++++++++------- src/families/elrond/api/index.ts | 2 +- src/families/elrond/api/sdk.ts | 34 ++++++++++++------- src/families/elrond/constants.ts | 2 +- src/families/elrond/hw-app-elrond/index.ts | 5 ++- src/families/elrond/js-buildSubAccounts.ts | 32 +++++++++++------- src/families/elrond/js-buildTransaction.ts | 24 +++++++------- src/families/elrond/js-signOperation.ts | 14 +++++--- src/families/elrond/js-synchronisation.ts | 6 ++-- src/families/elrond/logic.ts | 8 +++-- src/families/elrond/types.ts | 11 +++---- 11 files changed, 110 insertions(+), 66 deletions(-) diff --git a/src/families/elrond/api/apiCalls.ts b/src/families/elrond/api/apiCalls.ts index e63dc10aa4..2d12f9d17d 100644 --- a/src/families/elrond/api/apiCalls.ts +++ b/src/families/elrond/api/apiCalls.ts @@ -5,7 +5,13 @@ import { MAX_PAGINATION_SIZE, ESDT_TRANSFER_GAS, } from "../constants"; -import { ElrondProtocolTransaction, ElrondTransferOptions, ESDTToken, NetworkInfo, Transaction } from "../types"; +import { + ElrondProtocolTransaction, + ElrondTransferOptions, + ESDTToken, + NetworkInfo, + Transaction, +} from "../types"; export default class ElrondApi { private API_URL: string; @@ -73,7 +79,10 @@ export default class ElrondApi { } async submit({ operation, signature }) { - let { chainID, gasLimit, gasPrice } = await this.getNetworkConfig(); + const networkConfig: NetworkInfo = await this.getNetworkConfig(); + const { chainID, gasPrice } = networkConfig; + let gasLimit = networkConfig.gasLimit; + const { senders: [sender], recipients: [receiver], @@ -83,7 +92,7 @@ export default class ElrondApi { } = operation; if (data) { - // gasLimit for an ESDT transfer + // gasLimit for an ESDT transfer gasLimit = ESDT_TRANSFER_GAS; } @@ -97,8 +106,8 @@ export default class ElrondApi { chainID, signature, data, - ...HASH_TRANSACTION - } + ...HASH_TRANSACTION, + }; const { data: { @@ -127,8 +136,10 @@ export default class ElrondApi { url: `${this.API_URL}/accounts/${addr}/transactions?after=${startAt}&from=${from}&size=${MAX_PAGINATION_SIZE}`, }); - transactions = transactions.filter((transaction) => !transaction.tokenIdentifier); - + transactions = transactions.filter( + (transaction) => !transaction.tokenIdentifier + ); + allTransactions = [...allTransactions, ...transactions]; from = from + MAX_PAGINATION_SIZE; @@ -137,7 +148,10 @@ export default class ElrondApi { return allTransactions; } - async getESDTTransactionsForAddress(addr: string, token: string): Promise { + async getESDTTransactionsForAddress( + addr: string, + token: string + ): Promise { const { data: tokenTransactionsCount } = await network({ method: "GET", url: `${this.API_URL}/accounts/${addr}/transactions/count?token=${token}`, @@ -156,7 +170,7 @@ export default class ElrondApi { from = from + MAX_PAGINATION_SIZE; } - for (let esdtTransaction of allTokenTransactions) { + for (const esdtTransaction of allTokenTransactions) { esdtTransaction.transfer = ElrondTransferOptions.esdt; } @@ -166,7 +180,7 @@ export default class ElrondApi { async getESDTTokensForAddress(addr: string): Promise { const { data: tokensCount } = await network({ method: "GET", - url: `${this.API_URL}/accounts/${addr}/tokens/count` + url: `${this.API_URL}/accounts/${addr}/tokens/count`, }); let allTokens: ESDTToken[] = []; @@ -174,7 +188,7 @@ export default class ElrondApi { while (from <= tokensCount) { const { data: tokens } = await network({ method: "GET", - url: `${this.API_URL}/accounts/${addr}/tokens?from=${from}&size=${MAX_PAGINATION_SIZE}` + url: `${this.API_URL}/accounts/${addr}/tokens?from=${from}&size=${MAX_PAGINATION_SIZE}`, }); allTokens = [...allTokens, ...tokens]; @@ -188,7 +202,7 @@ export default class ElrondApi { async getESDTTokensCountForAddress(addr: string): Promise { const { data: tokensCount } = await network({ method: "GET", - url: `${this.API_URL}/accounts/${addr}/tokens/count` + url: `${this.API_URL}/accounts/${addr}/tokens/count`, }); return tokensCount; diff --git a/src/families/elrond/api/index.ts b/src/families/elrond/api/index.ts index 6218326b92..57cf637399 100644 --- a/src/families/elrond/api/index.ts +++ b/src/families/elrond/api/index.ts @@ -7,5 +7,5 @@ export { broadcastTransaction, getAccountESDTTokens, getAccountESDTOperations, - hasESDTTokens + hasESDTTokens, } from "./sdk"; diff --git a/src/families/elrond/api/sdk.ts b/src/families/elrond/api/sdk.ts index 4adc7a7299..35b71d6196 100644 --- a/src/families/elrond/api/sdk.ts +++ b/src/families/elrond/api/sdk.ts @@ -1,6 +1,11 @@ import { BigNumber } from "bignumber.js"; import ElrondApi from "./apiCalls"; -import { ElrondTransferOptions, ESDTToken, NetworkInfo, Transaction } from "../types"; +import { + ElrondTransferOptions, + ESDTToken, + NetworkInfo, + Transaction, +} from "../types"; import type { Operation, OperationType } from "../../../types"; import { getEnv } from "../../../env"; import { encodeOperationId } from "../../../operation"; @@ -61,7 +66,7 @@ function getOperationValue(transaction: Transaction, addr: string): BigNumber { return new BigNumber(transaction.value ?? 0); } - return new BigNumber(transaction.value ?? 0).plus(transaction.fee ?? 0) + return new BigNumber(transaction.value ?? 0).plus(transaction.fee ?? 0); } /** @@ -112,31 +117,38 @@ export const getOperations = async ( }; export const getAccountESDTTokens = async ( - address: string, + address: string ): Promise => { return await api.getESDTTokensForAddress(address); -} +}; -export const hasESDTTokens = async(address: string): Promise => { +export const hasESDTTokens = async (address: string): Promise => { const tokensCount = await api.getESDTTokensCountForAddress(address); return tokensCount > 0; -} +}; export const getAccountESDTOperations = async ( accountId: string, address: string, - tokenIdentifier: string, + tokenIdentifier: string ): Promise => { - const accountESDTTransactions = await api.getESDTTransactionsForAddress(address, tokenIdentifier); + const accountESDTTransactions = await api.getESDTTransactionsForAddress( + address, + tokenIdentifier + ); - return accountESDTTransactions.map(transaction => transactionToOperation(accountId, address, transaction)); -} + return accountESDTTransactions.map((transaction) => + transactionToOperation(accountId, address, transaction) + ); +}; /** * Obtain fees from blockchain */ export const getFees = async (t: Transaction): Promise => { - let { gasLimit, gasPerByte, gasPrice } = await getTransactionParams(); + const transactionParams = await getTransactionParams(); + const { gasPerByte, gasPrice } = transactionParams; + let gasLimit = transactionParams.gasLimit; if (t.subAccountId) { gasLimit = ESDT_TRANSFER_GAS; diff --git a/src/families/elrond/constants.ts b/src/families/elrond/constants.ts index fcb93c42c7..66b5496a07 100644 --- a/src/families/elrond/constants.ts +++ b/src/families/elrond/constants.ts @@ -5,4 +5,4 @@ export const HASH_TRANSACTION = { export const METACHAIN_SHARD = 4294967295; export const MAX_PAGINATION_SIZE = 10000; export const ESDT_TRANSFER_GAS = 600000; -export const CHAIN_ID = '1' +export const CHAIN_ID = "1"; diff --git a/src/families/elrond/hw-app-elrond/index.ts b/src/families/elrond/hw-app-elrond/index.ts index 5bdb005138..29b043661b 100644 --- a/src/families/elrond/hw-app-elrond/index.ts +++ b/src/families/elrond/hw-app-elrond/index.ts @@ -28,7 +28,7 @@ export default class Elrond { "signTransaction", "signMessage", "getAppConfiguration", - "provideESDTInfo" + "provideESDTInfo", ], scrambleKey ); @@ -198,7 +198,7 @@ export default class Elrond { const chainIdLengthBuffer = Buffer.from([chainId.length]); const chainIdBuffer = Buffer.from(chainId); const signatureBuffer = Buffer.from(signature, "hex"); - let infoBuffer = [ + const infoBuffer = [ tickerLengthBuffer, tickerBuffer, idLengthBuffer, @@ -218,7 +218,6 @@ export default class Elrond { chainId?: string, signature?: string ): Promise { - if (!ticker || !id || !decimals || !chainId || !signature) { throw new Error("Invalid ESDT token credentials!"); } diff --git a/src/families/elrond/js-buildSubAccounts.ts b/src/families/elrond/js-buildSubAccounts.ts index d84b9f2517..3e6dd0d56a 100644 --- a/src/families/elrond/js-buildSubAccounts.ts +++ b/src/families/elrond/js-buildSubAccounts.ts @@ -1,4 +1,9 @@ -import { CryptoCurrency, findTokenById, listTokensForCryptoCurrency, TokenCurrency } from "@ledgerhq/cryptoassets"; +import { + CryptoCurrency, + findTokenById, + listTokensForCryptoCurrency, + TokenCurrency, +} from "@ledgerhq/cryptoassets"; import BigNumber from "bignumber.js"; import { emptyHistoryCache } from "../../account"; import { Account, SyncConfig, TokenAccount } from "../../types"; @@ -17,11 +22,15 @@ async function buildElrondESDTTokenAccount({ }) { const extractedId = token.id; const id = parentAccountId + "+" + extractedId; - const tokenIdentifierHex = token.id.split('/')[2]; - const tokenIdentifier = Buffer.from(tokenIdentifierHex, 'hex').toString(); + const tokenIdentifierHex = token.id.split("/")[2]; + const tokenIdentifier = Buffer.from(tokenIdentifierHex, "hex").toString(); + + const operations = await getAccountESDTOperations( + parentAccountId, + accountAddress, + tokenIdentifier + ); - const operations = await getAccountESDTOperations(parentAccountId, accountAddress, tokenIdentifier); - const tokenAccount: TokenAccount = { type: "TokenAccount", id, @@ -36,7 +45,8 @@ async function buildElrondESDTTokenAccount({ swapHistory: [], creationDate: operations.length > 0 - ? operations[operations.length - 1].date : new Date(), + ? operations[operations.length - 1].date + : new Date(), balanceHistoryCache: emptyHistoryCache, // calculated in the jsHelpers }; return tokenAccount; @@ -58,7 +68,7 @@ async function elrondBuildESDTTokenAccounts({ const { blacklistedTokenIds = [] } = syncConfig; if (listTokensForCryptoCurrency(currency).length === 0) { return undefined; - } + } const tokenAccounts: TokenAccount[] = []; const existingAccountByTicker = {}; // used for fast lookup @@ -79,8 +89,8 @@ async function elrondBuildESDTTokenAccounts({ } const accountESDTs = await getAccountESDTTokens(accountAddress); - for (let esdt of accountESDTs) { - const esdtIdentifierHex = Buffer.from(esdt.identifier).toString('hex'); + for (const esdt of accountESDTs) { + const esdtIdentifierHex = Buffer.from(esdt.identifier).toString("hex"); const token = findTokenById(`elrond/esdt/${esdtIdentifierHex}`); if (token && !blacklistedTokenIds.includes(token.id)) { @@ -90,7 +100,7 @@ async function elrondBuildESDTTokenAccounts({ token, balance: new BigNumber(esdt.balance), }); - + if (tokenAccount) { tokenAccounts.push(tokenAccount); } @@ -110,4 +120,4 @@ async function elrondBuildESDTTokenAccounts({ return tokenAccounts; } -export default elrondBuildESDTTokenAccounts; \ No newline at end of file +export default elrondBuildESDTTokenAccounts; diff --git a/src/families/elrond/js-buildTransaction.ts b/src/families/elrond/js-buildTransaction.ts index 13c3480f05..0e3305fb67 100644 --- a/src/families/elrond/js-buildTransaction.ts +++ b/src/families/elrond/js-buildTransaction.ts @@ -1,11 +1,13 @@ -import type { ElrondProtocolTransaction, NetworkInfo, Transaction } from "./types"; +import type { + ElrondProtocolTransaction, + NetworkInfo, + Transaction, +} from "./types"; import type { Account, SubAccount } from "../../types"; import { encodeESDTTransfer, getNonce } from "./logic"; import { getNetworkConfig } from "./api"; import { ESDT_TRANSFER_GAS, HASH_TRANSACTION } from "./constants"; import BigNumber from "bignumber.js"; -import getEstimatedFees from "./js-getFeesForTransaction"; - /** * * @param {Account} a @@ -14,11 +16,13 @@ import getEstimatedFees from "./js-getFeesForTransaction"; export const buildTransaction = async ( a: Account, ta: SubAccount | null | undefined, - t: Transaction, + t: Transaction ) => { const address = a.freshAddress; const nonce = getNonce(a); - let { gasPrice, gasLimit, chainID }: NetworkInfo = await getNetworkConfig(); + const networkConfig: NetworkInfo = await getNetworkConfig(); + const { chainID, gasPrice } = networkConfig; + let gasLimit = networkConfig.gasLimit; let transactionValue; @@ -27,13 +31,11 @@ export const buildTransaction = async ( t.amount = new BigNumber(0); //amount of EGLD to be sent should be 0 in an ESDT transfer gasLimit = ESDT_TRANSFER_GAS; //gasLimit for and ESDT transfer + transactionValue = t.useAllAmount ? ta.balance : t.amount; + } else { transactionValue = t.useAllAmount - ? ta.balance : t.amount; - } - else { - transactionValue = t.useAllAmount - ? a.balance.minus(t.fees ? t.fees : new BigNumber(0)) - : t.amount; + ? a.balance.minus(t.fees ? t.fees : new BigNumber(0)) + : t.amount; } const unsigned: ElrondProtocolTransaction = { diff --git a/src/families/elrond/js-signOperation.ts b/src/families/elrond/js-signOperation.ts index 4b8061f410..ded61e97a2 100644 --- a/src/families/elrond/js-signOperation.ts +++ b/src/families/elrond/js-signOperation.ts @@ -71,17 +71,23 @@ const signOperation = ({ await elrond.setAddress(account.freshAddressPath); if (tokenAccount) { - const tokenIdentifier = tokenAccount.id.split('+')[1]; + const tokenIdentifier = tokenAccount.id.split("+")[1]; const token = findTokenById(`${tokenIdentifier}`); - const collectionIdentifierHex = token?.id.split('/')[2]; - await elrond.provideESDTInfo(token?.ticker, collectionIdentifierHex, token?.units[0].magnitude, CHAIN_ID, token?.ledgerSignature); + const collectionIdentifierHex = token?.id.split("/")[2]; + await elrond.provideESDTInfo( + token?.ticker, + collectionIdentifierHex, + token?.units[0].magnitude, + CHAIN_ID, + token?.ledgerSignature + ); } const unsignedTx: string = await buildTransaction( account, tokenAccount, - transaction, + transaction ); o.next({ diff --git a/src/families/elrond/js-synchronisation.ts b/src/families/elrond/js-synchronisation.ts index b4126a0a51..7b4580ddbc 100644 --- a/src/families/elrond/js-synchronisation.ts +++ b/src/families/elrond/js-synchronisation.ts @@ -23,7 +23,7 @@ const getAccountShape: GetAccountShape = async (info) => { // Merge new operations with the previously synced ones const newOperations = await getOperations(accountId, address, startAt); const operations = mergeOps(oldOperations, newOperations); - + let subAccounts: TokenAccount[] | undefined = []; if (await hasESDTTokens(address)) { subAccounts = await elrondBuildESDTTokenAccounts({ @@ -32,8 +32,8 @@ const getAccountShape: GetAccountShape = async (info) => { accountAddress: address, existingAccount: initialAccount, syncConfig: { - paginationConfig: {} - } + paginationConfig: {}, + }, }); } diff --git a/src/families/elrond/logic.ts b/src/families/elrond/logic.ts index 52e02b61e2..92646f64f2 100644 --- a/src/families/elrond/logic.ts +++ b/src/families/elrond/logic.ts @@ -68,6 +68,8 @@ export const getNonce = (a: Account): number => { }; export const encodeESDTTransfer = (t: Transaction, ta: SubAccount): string => { - const tokenIdentifierHex = ta.id.split('/')[2]; - return Buffer.from(`ESDTTransfer@${tokenIdentifierHex}@${t.amount.toString(16)}`).toString('base64'); -} + const tokenIdentifierHex = ta.id.split("/")[2]; + return Buffer.from( + `ESDTTransfer@${tokenIdentifierHex}@${t.amount.toString(16)}` + ).toString("base64"); +}; diff --git a/src/families/elrond/types.ts b/src/families/elrond/types.ts index ad7e2bb8bf..62fc8926c1 100644 --- a/src/families/elrond/types.ts +++ b/src/families/elrond/types.ts @@ -1,5 +1,4 @@ import type { BigNumber } from "bignumber.js"; -import { RangeRaw } from "../../range"; import type { TransactionCommon, TransactionCommonRaw, @@ -31,7 +30,7 @@ export type ElrondProtocolTransaction = { data?: string; //for ESDT or stake transactions version: number; options: number; -} +}; /** * Elrond transaction */ @@ -58,15 +57,15 @@ export type Transaction = TransactionCommon & { }; export enum ElrondTransferOptions { - egld = 'egld', - esdt = 'esdt', + egld = "egld", + esdt = "esdt", } export type ESDTToken = { identifier: string; name: string; balance: string; -} +}; /** * Elrond transaction from a raw JSON @@ -111,4 +110,4 @@ export type NetworkInfoRaw = { export type ElrondPreloadData = { validators: Record; }; -export const reflect = (_declare: any) => {}; +export const reflect = (_declare: any) => { }; From f8aee73d990cc58c367b0a840a9d33cb7bee2cab Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Mon, 27 Dec 2021 10:41:43 +0200 Subject: [PATCH 100/127] use dictionary for fast lookup into subaccounts --- src/families/elrond/js-buildSubAccounts.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/families/elrond/js-buildSubAccounts.ts b/src/families/elrond/js-buildSubAccounts.ts index 3e6dd0d56a..5fb120e16e 100644 --- a/src/families/elrond/js-buildSubAccounts.ts +++ b/src/families/elrond/js-buildSubAccounts.ts @@ -69,6 +69,7 @@ async function elrondBuildESDTTokenAccounts({ if (listTokensForCryptoCurrency(currency).length === 0) { return undefined; } + const tokenAccounts: TokenAccount[] = []; const existingAccountByTicker = {}; // used for fast lookup @@ -103,6 +104,8 @@ async function elrondBuildESDTTokenAccounts({ if (tokenAccount) { tokenAccounts.push(tokenAccount); + existingAccountTickers.push(token.ticker); + existingAccountByTicker[token.ticker] = tokenAccount; } } } From 6f58931b140cf7497a5ae316bff99c23d8e7097d Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Mon, 27 Dec 2021 10:58:04 +0200 Subject: [PATCH 101/127] implement reconciliation for elrond sub accounts sync --- src/families/elrond/js-reconciliation.ts | 74 ++++++++++++++++++++++++ src/families/elrond/types.ts | 2 +- 2 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 src/families/elrond/js-reconciliation.ts diff --git a/src/families/elrond/js-reconciliation.ts b/src/families/elrond/js-reconciliation.ts new file mode 100644 index 0000000000..1a0a3012f7 --- /dev/null +++ b/src/families/elrond/js-reconciliation.ts @@ -0,0 +1,74 @@ +import type { Account, SubAccount, TokenAccount } from "../../types"; +import { log } from "@ledgerhq/logs"; + +export function reconciliateSubAccounts( + tokenAccounts: TokenAccount[], + initialAccount: Account | undefined +) { + let subAccounts; + + if (initialAccount) { + const initialSubAccounts: SubAccount[] | undefined = + initialAccount.subAccounts; + let anySubAccountHaveChanged = false; + const stats: string[] = []; + + if ( + initialSubAccounts && + tokenAccounts.length !== initialSubAccounts.length + ) { + stats.push("length differ"); + anySubAccountHaveChanged = true; + } + + subAccounts = tokenAccounts.map((ta: TokenAccount) => { + const existingTokenAccount = initialSubAccounts?.find( + (a) => a.id === ta.id + ); + + if (existingTokenAccount) { + let sameProperties = true; + + if (existingTokenAccount !== ta) { + for (const property in existingTokenAccount) { + if (existingTokenAccount[property] !== ta[property]) { + sameProperties = false; + stats.push(`field ${property} changed for ${ta.id}`); + break; + } + } + } + + if (sameProperties) { + return existingTokenAccount; + } else { + anySubAccountHaveChanged = true; + } + } else { + anySubAccountHaveChanged = true; + stats.push(`new token account ${ta.id}`); + } + + return ta; + }); + + if (!anySubAccountHaveChanged && initialSubAccounts) { + log( + "elrond", + "incremental sync: " + + String(initialSubAccounts.length) + + " sub accounts have not changed" + ); + subAccounts = initialSubAccounts; + } else { + log( + "elrond", + "incremental sync: sub accounts changed: " + stats.join(", ") + ); + } + } else { + subAccounts = tokenAccounts.map((a: TokenAccount) => a); + } + + return subAccounts; +} diff --git a/src/families/elrond/types.ts b/src/families/elrond/types.ts index 62fc8926c1..dde9fdacb9 100644 --- a/src/families/elrond/types.ts +++ b/src/families/elrond/types.ts @@ -110,4 +110,4 @@ export type NetworkInfoRaw = { export type ElrondPreloadData = { validators: Record; }; -export const reflect = (_declare: any) => { }; +export const reflect = (_declare: any) => {}; From 2acaff593cf8894e6db560ff13c0515f67d17b87 Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Mon, 27 Dec 2021 10:58:24 +0200 Subject: [PATCH 102/127] implement reconciliation for elrond sub accounts sync --- src/families/elrond/js-synchronisation.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/families/elrond/js-synchronisation.ts b/src/families/elrond/js-synchronisation.ts index 7b4580ddbc..5504665b3f 100644 --- a/src/families/elrond/js-synchronisation.ts +++ b/src/families/elrond/js-synchronisation.ts @@ -4,6 +4,7 @@ import type { GetAccountShape } from "../../bridge/jsHelpers"; import { makeSync, makeScanAccounts, mergeOps } from "../../bridge/jsHelpers"; import { getAccount, getOperations, hasESDTTokens } from "./api"; import elrondBuildESDTTokenAccounts from "./js-buildSubAccounts"; +import { reconciliateSubAccounts } from "./js-reconciliation"; const getAccountShape: GetAccountShape = async (info) => { const { address, initialAccount, currency, derivationMode } = info; @@ -26,7 +27,7 @@ const getAccountShape: GetAccountShape = async (info) => { let subAccounts: TokenAccount[] | undefined = []; if (await hasESDTTokens(address)) { - subAccounts = await elrondBuildESDTTokenAccounts({ + const tokenAccounts = await elrondBuildESDTTokenAccounts({ currency, accountId: accountId, accountAddress: address, @@ -35,6 +36,10 @@ const getAccountShape: GetAccountShape = async (info) => { paginationConfig: {}, }, }); + + if (tokenAccounts) { + subAccounts = reconciliateSubAccounts(tokenAccounts, initialAccount); + } } const shape = { From 9bfc941b931a4a53a3154be513630356b9a2140f Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Wed, 5 Jan 2022 14:11:27 +0200 Subject: [PATCH 103/127] estimate max spendable for token accounts --- .../elrond/js-estimateMaxSpendable.ts | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/families/elrond/js-estimateMaxSpendable.ts b/src/families/elrond/js-estimateMaxSpendable.ts index 3ff880357d..62e8929438 100644 --- a/src/families/elrond/js-estimateMaxSpendable.ts +++ b/src/families/elrond/js-estimateMaxSpendable.ts @@ -19,19 +19,29 @@ const estimateMaxSpendable = async ({ parentAccount: Account | null | undefined; transaction: Transaction | null | undefined; }): Promise => { - const a = getMainAccount(account, parentAccount); - const t = { + const mainAccount = getMainAccount(account, parentAccount); + const tx = { ...createTransaction(), + subAccountId: account.type === "Account" ? null : account.id, ...transaction, - amount: a.spendableBalance, }; - const fees = await getEstimatedFees(t); - if (fees.gt(a.spendableBalance)) { + const tokenAccount = + tx.subAccountId && + mainAccount.subAccounts && + mainAccount.subAccounts.find((ta) => ta.id === tx.subAccountId); + + if (tokenAccount) { + return tokenAccount.balance; + } + + const fees = await getEstimatedFees(tx); + + if (fees.gt(mainAccount.balance)) { return new BigNumber(0); } - return a.spendableBalance.minus(fees); + return mainAccount.spendableBalance; }; export default estimateMaxSpendable; From 118c27dd71aafd11061219f90de9834b5b7c3039 Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Wed, 5 Jan 2022 14:11:55 +0200 Subject: [PATCH 104/127] transaction status for ESDTs --- .../elrond/js-getTransactionStatus.ts | 43 ++++++++++++++----- 1 file changed, 32 insertions(+), 11 deletions(-) diff --git a/src/families/elrond/js-getTransactionStatus.ts b/src/families/elrond/js-getTransactionStatus.ts index 92d58ece68..122653d6c4 100644 --- a/src/families/elrond/js-getTransactionStatus.ts +++ b/src/families/elrond/js-getTransactionStatus.ts @@ -37,21 +37,42 @@ const getTransactionStatus = async ( errors.amount = new NotEnoughBalance(); } - const totalSpent = useAllAmount - ? a.balance - : new BigNumber(t.amount).plus(estimatedFees); - const amount = useAllAmount - ? a.balance.minus(estimatedFees) - : new BigNumber(t.amount); + let amount, totalSpent; + const tokenAccount = + t.subAccountId && + a.subAccounts && + a.subAccounts.find((ta) => ta.id === t.subAccountId); - if (totalSpent.gt(a.balance)) { - errors.amount = new NotEnoughBalance(); - } + if (tokenAccount) { + amount = useAllAmount + ? tokenAccount.balance + : t.amount; + + totalSpent = amount + + if (totalSpent.gt(tokenAccount.balance)) { + errors.amount = new NotEnoughBalance(); + } - if (amount.div(10).lt(estimatedFees)) { - warnings.feeTooHigh = new FeeTooHigh(); + } else { + totalSpent = useAllAmount + ? a.balance + : new BigNumber(t.amount).plus(estimatedFees); + + amount = useAllAmount + ? a.balance.minus(estimatedFees) + : new BigNumber(t.amount); + + if (totalSpent.gt(a.balance)) { + errors.amount = new NotEnoughBalance(); + } + + if (amount.div(10).lt(estimatedFees)) { + warnings.feeTooHigh = new FeeTooHigh(); + } } + return Promise.resolve({ errors, warnings, From 128d149431326e03c1a5df5fa346278e1627b17d Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Wed, 5 Jan 2022 14:12:23 +0200 Subject: [PATCH 105/127] adapt transaction value for esdt transactions --- src/families/elrond/js-buildTransaction.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/families/elrond/js-buildTransaction.ts b/src/families/elrond/js-buildTransaction.ts index 0e3305fb67..cf5692e30a 100644 --- a/src/families/elrond/js-buildTransaction.ts +++ b/src/families/elrond/js-buildTransaction.ts @@ -31,7 +31,7 @@ export const buildTransaction = async ( t.amount = new BigNumber(0); //amount of EGLD to be sent should be 0 in an ESDT transfer gasLimit = ESDT_TRANSFER_GAS; //gasLimit for and ESDT transfer - transactionValue = t.useAllAmount ? ta.balance : t.amount; + transactionValue = new BigNumber(0); //amount of EGLD to be sent should be 0 in an ESDT transfer } else { transactionValue = t.useAllAmount ? a.balance.minus(t.fees ? t.fees : new BigNumber(0)) From 3aa0015147169814ac908a4c29bc71a479f3a83d Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Thu, 6 Jan 2022 12:36:19 +0200 Subject: [PATCH 106/127] compute fees for ESDT transfers --- src/families/elrond/api/apiCalls.ts | 2 ++ src/families/elrond/api/sdk.ts | 30 +++++++++++++++---- src/families/elrond/constants.ts | 2 +- .../elrond/js-getTransactionStatus.ts | 14 +++++---- src/families/elrond/types.ts | 3 +- 5 files changed, 37 insertions(+), 14 deletions(-) diff --git a/src/families/elrond/api/apiCalls.ts b/src/families/elrond/api/apiCalls.ts index 2d12f9d17d..19c27658f8 100644 --- a/src/families/elrond/api/apiCalls.ts +++ b/src/families/elrond/api/apiCalls.ts @@ -61,6 +61,7 @@ export default class ElrondApi { erd_min_gas_limit: gasLimit, erd_min_gas_price: gasPrice, erd_gas_per_data_byte: gasPerByte, + erd_gas_price_modifier: gasPriceModifier, }, }, }, @@ -75,6 +76,7 @@ export default class ElrondApi { gasLimit, gasPrice, gasPerByte, + gasPriceModifier, }; } diff --git a/src/families/elrond/api/sdk.ts b/src/families/elrond/api/sdk.ts index 35b71d6196..d7228115c3 100644 --- a/src/families/elrond/api/sdk.ts +++ b/src/families/elrond/api/sdk.ts @@ -147,19 +147,37 @@ export const getAccountESDTOperations = async ( */ export const getFees = async (t: Transaction): Promise => { const transactionParams = await getTransactionParams(); - const { gasPerByte, gasPrice } = transactionParams; - let gasLimit = transactionParams.gasLimit; + let { gasPrice, gasPerByte, gasPriceModifier, gasLimit: minGasLimit } = transactionParams; + let gasLimit = minGasLimit; if (t.subAccountId) { gasLimit = ESDT_TRANSFER_GAS; } - if (!t.data) { - return new BigNumber(gasLimit * gasPrice); + const transactionData = Buffer.from(t.data?.trim() || []); + + let moveBalanceGas = + minGasLimit + transactionData.length * gasPerByte; + // if (moveBalanceGas > gasLimit) { + // throw new NotE; + // } + + if (t.subAccountId) { + gasLimit = ESDT_TRANSFER_GAS; } - return new BigNumber((gasLimit + gasPerByte * t.data.length) * gasPrice); -}; + gasPrice = new BigNumber(gasPrice); + let feeForMove = new BigNumber(moveBalanceGas).multipliedBy(gasPrice); + if (moveBalanceGas === gasLimit) { + return feeForMove; + } + + let diff = new BigNumber(gasLimit - moveBalanceGas); + let modifiedGasPrice = gasPrice.multipliedBy(new BigNumber(gasPriceModifier)); + let processingFee = diff.multipliedBy(modifiedGasPrice); + + return feeForMove.plus(processingFee); +} /** * Broadcast blob to blockchain diff --git a/src/families/elrond/constants.ts b/src/families/elrond/constants.ts index 66b5496a07..d8a91bbca9 100644 --- a/src/families/elrond/constants.ts +++ b/src/families/elrond/constants.ts @@ -4,5 +4,5 @@ export const HASH_TRANSACTION = { }; export const METACHAIN_SHARD = 4294967295; export const MAX_PAGINATION_SIZE = 10000; -export const ESDT_TRANSFER_GAS = 600000; +export const ESDT_TRANSFER_GAS = 500000; export const CHAIN_ID = "1"; diff --git a/src/families/elrond/js-getTransactionStatus.ts b/src/families/elrond/js-getTransactionStatus.ts index 122653d6c4..0f7bed5d89 100644 --- a/src/families/elrond/js-getTransactionStatus.ts +++ b/src/families/elrond/js-getTransactionStatus.ts @@ -11,6 +11,7 @@ import type { Account, TransactionStatus } from "../../types"; import type { Transaction } from "./types"; import { isValidAddress, isSelfTransaction } from "./logic"; import getEstimatedFees from "./js-getFeesForTransaction"; +import { buildTransaction } from "./js-buildTransaction"; const getTransactionStatus = async ( a: Account, @@ -31,18 +32,19 @@ const getTransactionStatus = async ( if (!t.fees) { errors.fees = new FeeNotLoaded(); } + let amount, totalSpent; + const tokenAccount = + (t.subAccountId && + a.subAccounts && + a.subAccounts.find((ta) => ta.id === t.subAccountId)) || null; + + await buildTransaction(a, tokenAccount, t); const estimatedFees = await getEstimatedFees(t); if (estimatedFees.gt(a.balance)) { errors.amount = new NotEnoughBalance(); } - let amount, totalSpent; - const tokenAccount = - t.subAccountId && - a.subAccounts && - a.subAccounts.find((ta) => ta.id === t.subAccountId); - if (tokenAccount) { amount = useAllAmount ? tokenAccount.balance diff --git a/src/families/elrond/types.ts b/src/families/elrond/types.ts index dde9fdacb9..ca72a25926 100644 --- a/src/families/elrond/types.ts +++ b/src/families/elrond/types.ts @@ -96,6 +96,7 @@ export type NetworkInfo = { gasLimit: number; gasPrice: number; gasPerByte: number; + gasPriceModifier: string; }; export type NetworkInfoRaw = { @@ -110,4 +111,4 @@ export type NetworkInfoRaw = { export type ElrondPreloadData = { validators: Record; }; -export const reflect = (_declare: any) => {}; +export const reflect = (_declare: any) => { }; From 989a4eb026a84df238d749d0486e8b39b0d4e665 Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Thu, 6 Jan 2022 13:37:38 +0200 Subject: [PATCH 107/127] encode ESDT transfer accordingly --- src/families/elrond/logic.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/families/elrond/logic.ts b/src/families/elrond/logic.ts index 92646f64f2..b5ef9ac2a8 100644 --- a/src/families/elrond/logic.ts +++ b/src/families/elrond/logic.ts @@ -69,7 +69,14 @@ export const getNonce = (a: Account): number => { export const encodeESDTTransfer = (t: Transaction, ta: SubAccount): string => { const tokenIdentifierHex = ta.id.split("/")[2]; + let amountHex = t.amount.toString(16); + + //hex amount length must be even so protocol would treat it as an ESDT transfer + if (amountHex.length % 2 !== 0) { + amountHex = "0" + amountHex; + } + return Buffer.from( - `ESDTTransfer@${tokenIdentifierHex}@${t.amount.toString(16)}` + `ESDTTransfer@${tokenIdentifierHex}@${amountHex}` ).toString("base64"); }; From 454dd26d908b252c4f19c21947dbf2ee78211f64 Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Thu, 6 Jan 2022 14:31:52 +0200 Subject: [PATCH 108/127] transaction amount should be 0 for ESDT transfers --- src/families/elrond/js-buildTransaction.ts | 1 - src/families/elrond/js-signOperation.ts | 42 ++++++++++++++-------- 2 files changed, 28 insertions(+), 15 deletions(-) diff --git a/src/families/elrond/js-buildTransaction.ts b/src/families/elrond/js-buildTransaction.ts index cf5692e30a..fdb3e8ce2c 100644 --- a/src/families/elrond/js-buildTransaction.ts +++ b/src/families/elrond/js-buildTransaction.ts @@ -28,7 +28,6 @@ export const buildTransaction = async ( if (ta) { t.data = encodeESDTTransfer(t, ta); - t.amount = new BigNumber(0); //amount of EGLD to be sent should be 0 in an ESDT transfer gasLimit = ESDT_TRANSFER_GAS; //gasLimit for and ESDT transfer transactionValue = new BigNumber(0); //amount of EGLD to be sent should be 0 in an ESDT transfer diff --git a/src/families/elrond/js-signOperation.ts b/src/families/elrond/js-signOperation.ts index ded61e97a2..bd8e43430c 100644 --- a/src/families/elrond/js-signOperation.ts +++ b/src/families/elrond/js-signOperation.ts @@ -17,9 +17,20 @@ const buildOptimisticOperation = ( fee: BigNumber ): Operation => { const type = "OUT"; - const value = transaction.useAllAmount - ? account.balance.minus(fee) - : new BigNumber(transaction.amount); + const tokenAccount = + (transaction.subAccountId && + account.subAccounts && + account.subAccounts.find((ta) => ta.id === transaction.subAccountId)) || null; + let value; + if (tokenAccount) { + value = new BigNumber(0); + } + else { + value = transaction.useAllAmount + ? account.balance.minus(fee) + : new BigNumber(transaction.amount); + } + const operation: Operation = { id: encodeOperationId(account.id, "", type), hash: "", @@ -63,9 +74,10 @@ const signOperation = ({ // Collect data for an ESDT transfer const { subAccounts } = account; const { subAccountId } = transaction; - const tokenAccount = !subAccountId - ? null - : subAccounts && subAccounts.find((ta) => ta.id === subAccountId); + const tokenAccount = + !subAccountId + ? null + : subAccounts && subAccounts.find((ta) => ta.id === subAccountId); const elrond = new Elrond(transport); await elrond.setAddress(account.freshAddressPath); @@ -74,14 +86,16 @@ const signOperation = ({ const tokenIdentifier = tokenAccount.id.split("+")[1]; const token = findTokenById(`${tokenIdentifier}`); - const collectionIdentifierHex = token?.id.split("/")[2]; - await elrond.provideESDTInfo( - token?.ticker, - collectionIdentifierHex, - token?.units[0].magnitude, - CHAIN_ID, - token?.ledgerSignature - ); + if (token?.ticker && token.id && token.ledgerSignature) { + const collectionIdentifierHex = token.id.split("/")[2]; + await elrond.provideESDTInfo( + token.ticker, + collectionIdentifierHex, + token?.units[0].magnitude, + CHAIN_ID, + token.ledgerSignature + ); + } } const unsignedTx: string = await buildTransaction( From 4bcf8eb57d67f4982059a05ecf57f398c9ddcd7e Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Thu, 6 Jan 2022 14:32:30 +0200 Subject: [PATCH 109/127] compute transaction value helper --- .../elrond/js-getTransactionStatus.ts | 24 ++------------- src/families/elrond/logic.ts | 30 +++++++++++++++++++ 2 files changed, 33 insertions(+), 21 deletions(-) diff --git a/src/families/elrond/js-getTransactionStatus.ts b/src/families/elrond/js-getTransactionStatus.ts index 0f7bed5d89..5f346b5fbb 100644 --- a/src/families/elrond/js-getTransactionStatus.ts +++ b/src/families/elrond/js-getTransactionStatus.ts @@ -9,7 +9,7 @@ import { } from "@ledgerhq/errors"; import type { Account, TransactionStatus } from "../../types"; import type { Transaction } from "./types"; -import { isValidAddress, isSelfTransaction } from "./logic"; +import { isValidAddress, isSelfTransaction, computeTransactionValue } from "./logic"; import getEstimatedFees from "./js-getFeesForTransaction"; import { buildTransaction } from "./js-buildTransaction"; @@ -19,7 +19,6 @@ const getTransactionStatus = async ( ): Promise => { const errors: Record = {}; const warnings: Record = {}; - const useAllAmount = !!t.useAllAmount; if (!t.recipient) { errors.recipient = new RecipientRequired(); @@ -32,39 +31,22 @@ const getTransactionStatus = async ( if (!t.fees) { errors.fees = new FeeNotLoaded(); } - let amount, totalSpent; + const tokenAccount = (t.subAccountId && a.subAccounts && a.subAccounts.find((ta) => ta.id === t.subAccountId)) || null; - await buildTransaction(a, tokenAccount, t); - - const estimatedFees = await getEstimatedFees(t); + const { amount, totalSpent, estimatedFees } = await computeTransactionValue(t, a, tokenAccount); if (estimatedFees.gt(a.balance)) { errors.amount = new NotEnoughBalance(); } if (tokenAccount) { - amount = useAllAmount - ? tokenAccount.balance - : t.amount; - - totalSpent = amount - if (totalSpent.gt(tokenAccount.balance)) { errors.amount = new NotEnoughBalance(); } - } else { - totalSpent = useAllAmount - ? a.balance - : new BigNumber(t.amount).plus(estimatedFees); - - amount = useAllAmount - ? a.balance.minus(estimatedFees) - : new BigNumber(t.amount); - if (totalSpent.gt(a.balance)) { errors.amount = new NotEnoughBalance(); } diff --git a/src/families/elrond/logic.ts b/src/families/elrond/logic.ts index b5ef9ac2a8..ab27f7fa8c 100644 --- a/src/families/elrond/logic.ts +++ b/src/families/elrond/logic.ts @@ -1,6 +1,9 @@ import type { Account, SubAccount } from "../../types"; import type { Transaction } from "./types"; import * as bech32 from "bech32"; +import BigNumber from "bignumber.js"; +import { buildTransaction } from "./js-buildTransaction"; +import getEstimatedFees from "./js-getFeesForTransaction"; /** * The human-readable-part of the bech32 addresses. @@ -80,3 +83,30 @@ export const encodeESDTTransfer = (t: Transaction, ta: SubAccount): string => { `ESDTTransfer@${tokenIdentifierHex}@${amountHex}` ).toString("base64"); }; + +export const computeTransactionValue = async (t: Transaction, a: Account, ta: SubAccount | null): Promise<{ amount: BigNumber, totalSpent: BigNumber, estimatedFees: BigNumber }> => { + let amount, totalSpent; + + await buildTransaction(a, ta, t); + + const estimatedFees = await getEstimatedFees(t); + + if (ta) { + amount = t.useAllAmount + ? ta.balance + : t.amount; + + totalSpent = amount + } else { + totalSpent = t.useAllAmount + ? a.balance + : new BigNumber(t.amount).plus(estimatedFees); + + amount = t.useAllAmount + ? a.balance.minus(estimatedFees) + : new BigNumber(t.amount); + + } + + return { amount, totalSpent, estimatedFees }; +} From 1736d3ff21c7c72ded0eceeecf3ac069c28fa476 Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Fri, 7 Jan 2022 08:43:59 +0200 Subject: [PATCH 110/127] fix issues related to lint --- src/families/elrond/api/sdk.ts | 25 +++++++++++-------- .../elrond/js-getTransactionStatus.ts | 19 ++++++++------ src/families/elrond/js-signOperation.ts | 13 +++++----- src/families/elrond/logic.ts | 19 ++++++++------ src/families/elrond/types.ts | 2 +- 5 files changed, 45 insertions(+), 33 deletions(-) diff --git a/src/families/elrond/api/sdk.ts b/src/families/elrond/api/sdk.ts index d7228115c3..9389b83e56 100644 --- a/src/families/elrond/api/sdk.ts +++ b/src/families/elrond/api/sdk.ts @@ -147,7 +147,12 @@ export const getAccountESDTOperations = async ( */ export const getFees = async (t: Transaction): Promise => { const transactionParams = await getTransactionParams(); - let { gasPrice, gasPerByte, gasPriceModifier, gasLimit: minGasLimit } = transactionParams; + const { + gasPerByte, + gasPriceModifier, + gasLimit: minGasLimit, + } = transactionParams; + let gasPrice = transactionParams.gasPrice; let gasLimit = minGasLimit; if (t.subAccountId) { @@ -156,28 +161,26 @@ export const getFees = async (t: Transaction): Promise => { const transactionData = Buffer.from(t.data?.trim() || []); - let moveBalanceGas = - minGasLimit + transactionData.length * gasPerByte; - // if (moveBalanceGas > gasLimit) { - // throw new NotE; - // } + const moveBalanceGas = minGasLimit + transactionData.length * gasPerByte; if (t.subAccountId) { gasLimit = ESDT_TRANSFER_GAS; } gasPrice = new BigNumber(gasPrice); - let feeForMove = new BigNumber(moveBalanceGas).multipliedBy(gasPrice); + const feeForMove = new BigNumber(moveBalanceGas).multipliedBy(gasPrice); if (moveBalanceGas === gasLimit) { return feeForMove; } - let diff = new BigNumber(gasLimit - moveBalanceGas); - let modifiedGasPrice = gasPrice.multipliedBy(new BigNumber(gasPriceModifier)); - let processingFee = diff.multipliedBy(modifiedGasPrice); + const diff = new BigNumber(gasLimit - moveBalanceGas); + const modifiedGasPrice = gasPrice.multipliedBy( + new BigNumber(gasPriceModifier) + ); + const processingFee = diff.multipliedBy(modifiedGasPrice); return feeForMove.plus(processingFee); -} +}; /** * Broadcast blob to blockchain diff --git a/src/families/elrond/js-getTransactionStatus.ts b/src/families/elrond/js-getTransactionStatus.ts index 5f346b5fbb..1acfc6f724 100644 --- a/src/families/elrond/js-getTransactionStatus.ts +++ b/src/families/elrond/js-getTransactionStatus.ts @@ -1,4 +1,3 @@ -import { BigNumber } from "bignumber.js"; import { NotEnoughBalance, RecipientRequired, @@ -9,9 +8,11 @@ import { } from "@ledgerhq/errors"; import type { Account, TransactionStatus } from "../../types"; import type { Transaction } from "./types"; -import { isValidAddress, isSelfTransaction, computeTransactionValue } from "./logic"; -import getEstimatedFees from "./js-getFeesForTransaction"; -import { buildTransaction } from "./js-buildTransaction"; +import { + isValidAddress, + isSelfTransaction, + computeTransactionValue, +} from "./logic"; const getTransactionStatus = async ( a: Account, @@ -35,9 +36,14 @@ const getTransactionStatus = async ( const tokenAccount = (t.subAccountId && a.subAccounts && - a.subAccounts.find((ta) => ta.id === t.subAccountId)) || null; + a.subAccounts.find((ta) => ta.id === t.subAccountId)) || + null; - const { amount, totalSpent, estimatedFees } = await computeTransactionValue(t, a, tokenAccount); + const { amount, totalSpent, estimatedFees } = await computeTransactionValue( + t, + a, + tokenAccount + ); if (estimatedFees.gt(a.balance)) { errors.amount = new NotEnoughBalance(); } @@ -56,7 +62,6 @@ const getTransactionStatus = async ( } } - return Promise.resolve({ errors, warnings, diff --git a/src/families/elrond/js-signOperation.ts b/src/families/elrond/js-signOperation.ts index bd8e43430c..842cef377c 100644 --- a/src/families/elrond/js-signOperation.ts +++ b/src/families/elrond/js-signOperation.ts @@ -20,12 +20,12 @@ const buildOptimisticOperation = ( const tokenAccount = (transaction.subAccountId && account.subAccounts && - account.subAccounts.find((ta) => ta.id === transaction.subAccountId)) || null; + account.subAccounts.find((ta) => ta.id === transaction.subAccountId)) || + null; let value; if (tokenAccount) { value = new BigNumber(0); - } - else { + } else { value = transaction.useAllAmount ? account.balance.minus(fee) : new BigNumber(transaction.amount); @@ -74,10 +74,9 @@ const signOperation = ({ // Collect data for an ESDT transfer const { subAccounts } = account; const { subAccountId } = transaction; - const tokenAccount = - !subAccountId - ? null - : subAccounts && subAccounts.find((ta) => ta.id === subAccountId); + const tokenAccount = !subAccountId + ? null + : subAccounts && subAccounts.find((ta) => ta.id === subAccountId); const elrond = new Elrond(transport); await elrond.setAddress(account.freshAddressPath); diff --git a/src/families/elrond/logic.ts b/src/families/elrond/logic.ts index ab27f7fa8c..c6c53f32bb 100644 --- a/src/families/elrond/logic.ts +++ b/src/families/elrond/logic.ts @@ -84,7 +84,15 @@ export const encodeESDTTransfer = (t: Transaction, ta: SubAccount): string => { ).toString("base64"); }; -export const computeTransactionValue = async (t: Transaction, a: Account, ta: SubAccount | null): Promise<{ amount: BigNumber, totalSpent: BigNumber, estimatedFees: BigNumber }> => { +export const computeTransactionValue = async ( + t: Transaction, + a: Account, + ta: SubAccount | null +): Promise<{ + amount: BigNumber; + totalSpent: BigNumber; + estimatedFees: BigNumber; +}> => { let amount, totalSpent; await buildTransaction(a, ta, t); @@ -92,11 +100,9 @@ export const computeTransactionValue = async (t: Transaction, a: Account, ta: Su const estimatedFees = await getEstimatedFees(t); if (ta) { - amount = t.useAllAmount - ? ta.balance - : t.amount; + amount = t.useAllAmount ? ta.balance : t.amount; - totalSpent = amount + totalSpent = amount; } else { totalSpent = t.useAllAmount ? a.balance @@ -105,8 +111,7 @@ export const computeTransactionValue = async (t: Transaction, a: Account, ta: Su amount = t.useAllAmount ? a.balance.minus(estimatedFees) : new BigNumber(t.amount); - } return { amount, totalSpent, estimatedFees }; -} +}; diff --git a/src/families/elrond/types.ts b/src/families/elrond/types.ts index ca72a25926..c593ea51ac 100644 --- a/src/families/elrond/types.ts +++ b/src/families/elrond/types.ts @@ -111,4 +111,4 @@ export type NetworkInfoRaw = { export type ElrondPreloadData = { validators: Record; }; -export const reflect = (_declare: any) => { }; +export const reflect = (_declare: any) => {}; From e6e39fcb1d6aabe590760787ac6445ec787a29fa Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Fri, 18 Feb 2022 16:28:49 +0200 Subject: [PATCH 111/127] use timestamp scroll for transactions --- src/families/elrond/api/apiCalls.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/families/elrond/api/apiCalls.ts b/src/families/elrond/api/apiCalls.ts index 19c27658f8..81733af935 100644 --- a/src/families/elrond/api/apiCalls.ts +++ b/src/families/elrond/api/apiCalls.ts @@ -132,10 +132,11 @@ export default class ElrondApi { let allTransactions: Transaction[] = []; let from = 0; + let before = Math.floor(Date.now() / 1000); while (from <= transactionsCount) { let { data: transactions } = await network({ method: "GET", - url: `${this.API_URL}/accounts/${addr}/transactions?after=${startAt}&from=${from}&size=${MAX_PAGINATION_SIZE}`, + url: `${this.API_URL}/accounts/${addr}/transactions?after=${startAt}&before=${before}&size=${MAX_PAGINATION_SIZE}`, }); transactions = transactions.filter( @@ -145,6 +146,7 @@ export default class ElrondApi { allTransactions = [...allTransactions, ...transactions]; from = from + MAX_PAGINATION_SIZE; + before = transactions.slice(-1).timestamp; } return allTransactions; @@ -161,15 +163,17 @@ export default class ElrondApi { let allTokenTransactions: Transaction[] = []; let from = 0; + let before = Math.floor(Date.now() / 1000); while (from <= tokenTransactionsCount) { const { data: tokenTransactions } = await network({ method: "GET", - url: `${this.API_URL}/accounts/${addr}/transactions?token=${token}&from=${from}&size=${MAX_PAGINATION_SIZE}`, + url: `${this.API_URL}/accounts/${addr}/transactions?token=${token}&before=${before}&size=${MAX_PAGINATION_SIZE}`, }); allTokenTransactions = [...allTokenTransactions, ...tokenTransactions]; from = from + MAX_PAGINATION_SIZE; + before = tokenTransactions.slice(-1).timestamp; } for (const esdtTransaction of allTokenTransactions) { From 59552b2da9df5315551298a181ba4b83f3c4c5d9 Mon Sep 17 00:00:00 2001 From: Alexandru Pislariu <57287326+AlexandruPislariu@users.noreply.github.com> Date: Fri, 4 Mar 2022 15:55:54 +0200 Subject: [PATCH 112/127] Egld staking (#13) * retrieve transaction mode from cli options * encode elrond transactions * define gas constants * support for delegation interactions * support to withdraw all funds from a staking provider * withdraw transaction encoding * add validator in transaction config * define min delegation amount * set actual value for all operations * decode intent of transaction before sending to protocol * define utils for decoding * use types * update comment --- src/families/elrond/api/apiCalls.ts | 45 +++++++++++-- src/families/elrond/api/sdk.ts | 13 ++-- src/families/elrond/cli-transaction.ts | 7 +- src/families/elrond/constants.ts | 12 +++- .../elrond/deviceTransactionConfig.ts | 12 ++++ src/families/elrond/encode.ts | 45 +++++++++++++ src/families/elrond/js-broadcast.ts | 5 +- src/families/elrond/js-buildTransaction.ts | 67 +++++++++++++++++-- src/families/elrond/js-signOperation.ts | 12 ++-- src/families/elrond/logic.ts | 14 ---- src/families/elrond/types.ts | 18 ++++- src/families/elrond/utils/binary.utils.ts | 13 ++++ 12 files changed, 215 insertions(+), 48 deletions(-) create mode 100644 src/families/elrond/encode.ts create mode 100644 src/families/elrond/utils/binary.utils.ts diff --git a/src/families/elrond/api/apiCalls.ts b/src/families/elrond/api/apiCalls.ts index 81733af935..1c971cd97a 100644 --- a/src/families/elrond/api/apiCalls.ts +++ b/src/families/elrond/api/apiCalls.ts @@ -1,9 +1,12 @@ +import BigNumber from "bignumber.js"; import network from "../../../network"; +import { Operation } from "../../../types"; +import { BinaryUtils } from "../utils/binary.utils"; import { HASH_TRANSACTION, METACHAIN_SHARD, MAX_PAGINATION_SIZE, - ESDT_TRANSFER_GAS, + GAS, } from "../constants"; import { ElrondProtocolTransaction, @@ -80,7 +83,7 @@ export default class ElrondApi { }; } - async submit({ operation, signature }) { + async submit(operation: Operation, signature: string): Promise { const networkConfig: NetworkInfo = await this.getNetworkConfig(); const { chainID, gasPrice } = networkConfig; let gasLimit = networkConfig.gasLimit; @@ -88,19 +91,47 @@ export default class ElrondApi { const { senders: [sender], recipients: [receiver], - value, transactionSequenceNumber: nonce, extra: { data }, } = operation; + let { value } = operation; if (data) { - // gasLimit for an ESDT transfer - gasLimit = ESDT_TRANSFER_GAS; + const dataDecoded = BinaryUtils.base64Decode(data); + + const funcName: string = dataDecoded.split("@")[0]; + switch (funcName) { + case "ESDTTransfer": + value = new BigNumber(0); + gasLimit = GAS.ESDT_TRANSFER; + break; + case "delegate": + gasLimit = GAS.DELEGATE; + break; + case "claimRewards": + value = new BigNumber(0); + gasLimit = GAS.CLAIM; + break; + case "withdraw": + value = new BigNumber(0); + gasLimit = GAS.DELEGATE; + break; + case "reDelegateRewards": + value = new BigNumber(0); + gasLimit = GAS.DELEGATE; + break; + case "unDelegate": + value = new BigNumber(0); + gasLimit = GAS.DELEGATE; + break; + default: + throw new Error(`Invalid function name ${funcName}`); + } } const transaction: ElrondProtocolTransaction = { - nonce, - value, + nonce: nonce ?? 0, + value: value.toString(), receiver, sender, gasPrice, diff --git a/src/families/elrond/api/sdk.ts b/src/families/elrond/api/sdk.ts index 9389b83e56..af9ed474ee 100644 --- a/src/families/elrond/api/sdk.ts +++ b/src/families/elrond/api/sdk.ts @@ -10,7 +10,7 @@ import type { Operation, OperationType } from "../../../types"; import { getEnv } from "../../../env"; import { encodeOperationId } from "../../../operation"; import { getTransactionParams } from "../cache"; -import { ESDT_TRANSFER_GAS } from "../constants"; +import { GAS } from "../constants"; const api = new ElrondApi(getEnv("ELROND_API_ENDPOINT")); /** @@ -156,7 +156,7 @@ export const getFees = async (t: Transaction): Promise => { let gasLimit = minGasLimit; if (t.subAccountId) { - gasLimit = ESDT_TRANSFER_GAS; + gasLimit = GAS.ESDT_TRANSFER; } const transactionData = Buffer.from(t.data?.trim() || []); @@ -164,7 +164,7 @@ export const getFees = async (t: Transaction): Promise => { const moveBalanceGas = minGasLimit + transactionData.length * gasPerByte; if (t.subAccountId) { - gasLimit = ESDT_TRANSFER_GAS; + gasLimit = GAS.ESDT_TRANSFER; } gasPrice = new BigNumber(gasPrice); @@ -185,6 +185,9 @@ export const getFees = async (t: Transaction): Promise => { /** * Broadcast blob to blockchain */ -export const broadcastTransaction = async (blob: any): Promise => { - return await api.submit(blob); +export const broadcastTransaction = async ( + operation: Operation, + signature: string +): Promise => { + return await api.submit(operation, signature); }; diff --git a/src/families/elrond/cli-transaction.ts b/src/families/elrond/cli-transaction.ts index 9805948cd2..fac776eba7 100644 --- a/src/families/elrond/cli-transaction.ts +++ b/src/families/elrond/cli-transaction.ts @@ -5,7 +5,7 @@ const options = [ { name: "mode", type: String, - desc: "mode of transaction: send", + desc: "mode of transaction: send, delegate, unDelegate, claimRewards", }, ]; @@ -25,7 +25,10 @@ function inferTransactions( transaction.family = "elrond"; - return transaction; + return { + ...transaction, + mode: _opts.mode || "send", + }; }); } diff --git a/src/families/elrond/constants.ts b/src/families/elrond/constants.ts index d8a91bbca9..dc45de9e75 100644 --- a/src/families/elrond/constants.ts +++ b/src/families/elrond/constants.ts @@ -1,8 +1,18 @@ +import BigNumber from "bignumber.js"; + export const HASH_TRANSACTION = { version: 2, options: 1, }; export const METACHAIN_SHARD = 4294967295; export const MAX_PAGINATION_SIZE = 10000; -export const ESDT_TRANSFER_GAS = 500000; +export const GAS = { + ESDT_TRANSFER: 500000, + DELEGATE: 12000000, + CLAIM: 6000000, +}; export const CHAIN_ID = "1"; +export const MIN_DELEGATION_AMOUNT: BigNumber = new BigNumber( + 1000000000000000000 +); +export const MIN_DELEGATION_AMOUNT_DENOMINATED: BigNumber = new BigNumber(1); diff --git a/src/families/elrond/deviceTransactionConfig.ts b/src/families/elrond/deviceTransactionConfig.ts index 0dc4070402..e4c6587974 100644 --- a/src/families/elrond/deviceTransactionConfig.ts +++ b/src/families/elrond/deviceTransactionConfig.ts @@ -1,9 +1,12 @@ import type { TransactionStatus } from "../../types"; import type { DeviceTransactionField } from "../../transaction"; +import { Transaction } from "./types"; function getDeviceTransactionConfig({ + transaction: { mode, recipient }, status: { amount, estimatedFees }, }: { + transaction: Transaction; status: TransactionStatus; }): Array { const fields: Array = []; @@ -21,6 +24,15 @@ function getDeviceTransactionConfig({ label: "Fees", }); } + + const isDelegationOperation = mode !== "send"; + if (isDelegationOperation) { + fields.push({ + type: "address", + label: "Validator", + address: recipient, + }); + } return fields; } diff --git a/src/families/elrond/encode.ts b/src/families/elrond/encode.ts new file mode 100644 index 0000000000..03060fda94 --- /dev/null +++ b/src/families/elrond/encode.ts @@ -0,0 +1,45 @@ +import { SubAccount } from "../../types"; +import type { Transaction } from "./types"; + +export class ElrondEncodeTransaction { + static ESDTTransfer(t: Transaction, ta: SubAccount): string { + const tokenIdentifierHex = ta.id.split("/")[2]; + let amountHex = t.amount.toString(16); + + //hex amount length must be even so protocol would treat it as an ESDT transfer + if (amountHex.length % 2 !== 0) { + amountHex = "0" + amountHex; + } + + return Buffer.from( + `ESDTTransfer@${tokenIdentifierHex}@${amountHex}` + ).toString("base64"); + } + + static delegate(): string { + return Buffer.from(`delegate`).toString("base64"); + } + + static claimRewards(): string { + return Buffer.from(`claimRewards`).toString("base64"); + } + + static withdraw(): string { + return Buffer.from(`withdraw`).toString("base64"); + } + + static reDelegateRewards(): string { + return Buffer.from(`reDelegateRewards`).toString("base64"); + } + + static unDelegate(t: Transaction): string { + let amountHex = t.amount.toString(16); + + //hex amount length must be even + if (amountHex.length % 2 !== 0) { + amountHex = "0" + amountHex; + } + + return Buffer.from(`unDelegate@${amountHex}`).toString("base64"); + } +} diff --git a/src/families/elrond/js-broadcast.ts b/src/families/elrond/js-broadcast.ts index 3cf68bb715..5464c9303b 100644 --- a/src/families/elrond/js-broadcast.ts +++ b/src/families/elrond/js-broadcast.ts @@ -11,10 +11,7 @@ const broadcast = async ({ }: { signedOperation: SignedOperation; }): Promise => { - const hash = await broadcastTransaction({ - operation, - signature, - }); + const hash = await broadcastTransaction(operation, signature); return patchOperationWithHash(operation, hash); }; diff --git a/src/families/elrond/js-buildTransaction.ts b/src/families/elrond/js-buildTransaction.ts index fdb3e8ce2c..0ffb3f7320 100644 --- a/src/families/elrond/js-buildTransaction.ts +++ b/src/families/elrond/js-buildTransaction.ts @@ -4,10 +4,16 @@ import type { Transaction, } from "./types"; import type { Account, SubAccount } from "../../types"; -import { encodeESDTTransfer, getNonce } from "./logic"; +import { getNonce } from "./logic"; import { getNetworkConfig } from "./api"; -import { ESDT_TRANSFER_GAS, HASH_TRANSACTION } from "./constants"; +import { + GAS, + HASH_TRANSACTION, + MIN_DELEGATION_AMOUNT, + MIN_DELEGATION_AMOUNT_DENOMINATED, +} from "./constants"; import BigNumber from "bignumber.js"; +import { ElrondEncodeTransaction } from "./encode"; /** * * @param {Account} a @@ -17,24 +23,72 @@ export const buildTransaction = async ( a: Account, ta: SubAccount | null | undefined, t: Transaction -) => { +): Promise => { const address = a.freshAddress; const nonce = getNonce(a); const networkConfig: NetworkInfo = await getNetworkConfig(); const { chainID, gasPrice } = networkConfig; let gasLimit = networkConfig.gasLimit; - let transactionValue; + let transactionValue: BigNumber; if (ta) { - t.data = encodeESDTTransfer(t, ta); - gasLimit = ESDT_TRANSFER_GAS; //gasLimit for and ESDT transfer + t.data = ElrondEncodeTransaction.ESDTTransfer(t, ta); + gasLimit = GAS.ESDT_TRANSFER; //gasLimit for and ESDT transfer transactionValue = new BigNumber(0); //amount of EGLD to be sent should be 0 in an ESDT transfer } else { transactionValue = t.useAllAmount ? a.balance.minus(t.fees ? t.fees : new BigNumber(0)) : t.amount; + + switch (t.mode) { + case "delegate": + if (transactionValue.lt(MIN_DELEGATION_AMOUNT)) { + throw new Error( + `Delegation amount should be minimum ${MIN_DELEGATION_AMOUNT_DENOMINATED} EGLD` + ); + } + + gasLimit = GAS.DELEGATE; + t.data = ElrondEncodeTransaction.delegate(); + + break; + case "claimRewards": + gasLimit = GAS.CLAIM; + t.data = ElrondEncodeTransaction.claimRewards(); + + transactionValue = new BigNumber(0); //amount of EGLD to be sent should be 0 in a claimRewards transaction + break; + case "withdraw": + gasLimit = GAS.DELEGATE; + t.data = ElrondEncodeTransaction.withdraw(); + + transactionValue = new BigNumber(0); //amount of EGLD to be sent should be 0 in a withdraw transaction + break; + case "reDelegateRewards": + gasLimit = GAS.DELEGATE; + t.data = ElrondEncodeTransaction.reDelegateRewards(); + + transactionValue = new BigNumber(0); //amount of EGLD to be sent should be 0 in a reDelegateRewards transaction + break; + case "unDelegate": + if (transactionValue.lt(MIN_DELEGATION_AMOUNT)) { + throw new Error( + `Undelegated amount should be minimum ${MIN_DELEGATION_AMOUNT_DENOMINATED} EGLD` + ); + } + + gasLimit = GAS.DELEGATE; + t.data = ElrondEncodeTransaction.unDelegate(t); + + transactionValue = new BigNumber(0); //amount of EGLD to be sent should be 0 in a unDelegate transaction + break; + case "send": + break; + default: + throw new Error("Unsupported transaction.mode = " + t.mode); + } } const unsigned: ElrondProtocolTransaction = { @@ -48,6 +102,7 @@ export const buildTransaction = async ( chainID, ...HASH_TRANSACTION, }; + // Will likely be a call to Elrond SDK return JSON.stringify(unsigned); }; diff --git a/src/families/elrond/js-signOperation.ts b/src/families/elrond/js-signOperation.ts index 842cef377c..21b8ab42e0 100644 --- a/src/families/elrond/js-signOperation.ts +++ b/src/families/elrond/js-signOperation.ts @@ -22,13 +22,13 @@ const buildOptimisticOperation = ( account.subAccounts && account.subAccounts.find((ta) => ta.id === transaction.subAccountId)) || null; - let value; + + let value = transaction.useAllAmount + ? account.balance.minus(fee) + : new BigNumber(transaction.amount); + if (tokenAccount) { - value = new BigNumber(0); - } else { - value = transaction.useAllAmount - ? account.balance.minus(fee) - : new BigNumber(transaction.amount); + value = transaction.amount; } const operation: Operation = { diff --git a/src/families/elrond/logic.ts b/src/families/elrond/logic.ts index c6c53f32bb..61fd4356ba 100644 --- a/src/families/elrond/logic.ts +++ b/src/families/elrond/logic.ts @@ -70,20 +70,6 @@ export const getNonce = (a: Account): number => { return nonce; }; -export const encodeESDTTransfer = (t: Transaction, ta: SubAccount): string => { - const tokenIdentifierHex = ta.id.split("/")[2]; - let amountHex = t.amount.toString(16); - - //hex amount length must be even so protocol would treat it as an ESDT transfer - if (amountHex.length % 2 !== 0) { - amountHex = "0" + amountHex; - } - - return Buffer.from( - `ESDTTransfer@${tokenIdentifierHex}@${amountHex}` - ).toString("base64"); -}; - export const computeTransactionValue = async ( t: Transaction, a: Account, diff --git a/src/families/elrond/types.ts b/src/families/elrond/types.ts index c593ea51ac..e35edd0da5 100644 --- a/src/families/elrond/types.ts +++ b/src/families/elrond/types.ts @@ -31,11 +31,23 @@ export type ElrondProtocolTransaction = { version: number; options: number; }; + +/** + * Elrond mode of transaction + */ +export type ElrondTransactionMode = + | "send" + | "delegate" + | "reDelegateRewards" + | "unDelegate" + | "claimRewards" + | "withdraw"; + /** * Elrond transaction */ export type Transaction = TransactionCommon & { - mode: string; + mode: ElrondTransactionMode; transfer?: ElrondTransferOptions; family: "elrond"; fees: BigNumber | null | undefined; @@ -72,7 +84,7 @@ export type ESDTToken = { */ export type TransactionRaw = TransactionCommonRaw & { family: "elrond"; - mode: string; + mode: ElrondTransactionMode; fees: string | null | undefined; }; export type ElrondValidator = { @@ -111,4 +123,4 @@ export type NetworkInfoRaw = { export type ElrondPreloadData = { validators: Record; }; -export const reflect = (_declare: any) => {}; +export const reflect = (_declare: any) => { }; diff --git a/src/families/elrond/utils/binary.utils.ts b/src/families/elrond/utils/binary.utils.ts new file mode 100644 index 0000000000..21d85a997a --- /dev/null +++ b/src/families/elrond/utils/binary.utils.ts @@ -0,0 +1,13 @@ +function base64DecodeBinary(str: string): Buffer { + return Buffer.from(str, "base64"); +} + +export class BinaryUtils { + static base64Encode(str: string) { + return Buffer.from(str).toString("base64"); + } + + static base64Decode(str: string): string { + return base64DecodeBinary(str).toString("binary"); + } +} From b4c04d4ab16bd1f5dc92544851e0c60bb74219ba Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Fri, 4 Mar 2022 16:35:03 +0200 Subject: [PATCH 113/127] retrieve ESDT amount from transaction action --- src/families/elrond/api/sdk.ts | 5 +++++ src/families/elrond/types.ts | 1 + 2 files changed, 6 insertions(+) diff --git a/src/families/elrond/api/sdk.ts b/src/families/elrond/api/sdk.ts index af9ed474ee..6234139894 100644 --- a/src/families/elrond/api/sdk.ts +++ b/src/families/elrond/api/sdk.ts @@ -59,6 +59,11 @@ function getOperationType( */ function getOperationValue(transaction: Transaction, addr: string): BigNumber { if (transaction.transfer === ElrondTransferOptions.esdt) { + if (transaction.action) { + return new BigNumber( + transaction.action.arguments.transfers[0].value ?? 0 + ); + } return new BigNumber(transaction.tokenValue ?? 0); } diff --git a/src/families/elrond/types.ts b/src/families/elrond/types.ts index e35edd0da5..5046da63b6 100644 --- a/src/families/elrond/types.ts +++ b/src/families/elrond/types.ts @@ -66,6 +66,7 @@ export type Transaction = TransactionCommon & { data?: string; tokenIdentifier?: string; tokenValue?: string; + action?: any; }; export enum ElrondTransferOptions { From cad63bab2ffd5e0646ba757e16dc1c8e25dd702f Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Tue, 15 Mar 2022 17:12:49 +0200 Subject: [PATCH 114/127] MEX & RIDE logos --- src/data/icons/svg/MEX.svg | 6 ++++++ src/data/icons/svg/RIDE.svg | 8 ++++++++ 2 files changed, 14 insertions(+) create mode 100644 src/data/icons/svg/MEX.svg create mode 100644 src/data/icons/svg/RIDE.svg diff --git a/src/data/icons/svg/MEX.svg b/src/data/icons/svg/MEX.svg new file mode 100644 index 0000000000..b679331ea5 --- /dev/null +++ b/src/data/icons/svg/MEX.svg @@ -0,0 +1,6 @@ + + + + + diff --git a/src/data/icons/svg/RIDE.svg b/src/data/icons/svg/RIDE.svg new file mode 100644 index 0000000000..ae32393597 --- /dev/null +++ b/src/data/icons/svg/RIDE.svg @@ -0,0 +1,8 @@ + + + + + From 9da9d35b9b77780d866b0c164f32eee8ecda3a23 Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Mon, 28 Mar 2022 16:57:02 +0300 Subject: [PATCH 115/127] remove unnecessary filter --- src/families/elrond/api/apiCalls.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/families/elrond/api/apiCalls.ts b/src/families/elrond/api/apiCalls.ts index 1c971cd97a..b32f6b0c76 100644 --- a/src/families/elrond/api/apiCalls.ts +++ b/src/families/elrond/api/apiCalls.ts @@ -165,15 +165,11 @@ export default class ElrondApi { let from = 0; let before = Math.floor(Date.now() / 1000); while (from <= transactionsCount) { - let { data: transactions } = await network({ + const { data: transactions } = await network({ method: "GET", url: `${this.API_URL}/accounts/${addr}/transactions?after=${startAt}&before=${before}&size=${MAX_PAGINATION_SIZE}`, }); - transactions = transactions.filter( - (transaction) => !transaction.tokenIdentifier - ); - allTransactions = [...allTransactions, ...transactions]; from = from + MAX_PAGINATION_SIZE; From 99777afd52d2d6e410d48a499e77d5a10f166825 Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Mon, 28 Mar 2022 16:58:11 +0300 Subject: [PATCH 116/127] decode transaction action for esdt transfers --- src/families/elrond/api/sdk.ts | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/src/families/elrond/api/sdk.ts b/src/families/elrond/api/sdk.ts index 6234139894..bdfa9c1a70 100644 --- a/src/families/elrond/api/sdk.ts +++ b/src/families/elrond/api/sdk.ts @@ -57,14 +57,31 @@ function getOperationType( /** * Map transaction to a correct Operation Value (affecting account balance) */ -function getOperationValue(transaction: Transaction, addr: string): BigNumber { +function getOperationValue( + transaction: Transaction, + addr: string, + tokenIdentifier?: string +): BigNumber { if (transaction.transfer === ElrondTransferOptions.esdt) { if (transaction.action) { - return new BigNumber( - transaction.action.arguments.transfers[0].value ?? 0 - ); + let token1, token2; + switch (transaction.action.name) { + case "transfer": + return new BigNumber( + transaction.action.arguments.transfers[0].value ?? 0 + ); + case "swap": + token1 = transaction.action.arguments.transfers[0]; + token2 = transaction.action.arguments.transfers[1]; + if (token1.token === tokenIdentifier) { + return new BigNumber(token1.value); + } else { + return new BigNumber(token2.value); + } + default: + return new BigNumber(transaction.tokenValue ?? 0); + } } - return new BigNumber(transaction.tokenValue ?? 0); } if (!isSender(transaction, addr)) { @@ -80,14 +97,15 @@ function getOperationValue(transaction: Transaction, addr: string): BigNumber { function transactionToOperation( accountId: string, addr: string, - transaction: Transaction + transaction: Transaction, + tokenIdentifier?: string ): Operation { const type = getOperationType(transaction, addr); return { id: encodeOperationId(accountId, transaction.txHash ?? "", type), accountId, fee: new BigNumber(transaction.fee || 0), - value: getOperationValue(transaction, addr), + value: getOperationValue(transaction, addr, tokenIdentifier), type, hash: transaction.txHash ?? "", blockHash: transaction.miniBlockHash, @@ -143,7 +161,7 @@ export const getAccountESDTOperations = async ( ); return accountESDTTransactions.map((transaction) => - transactionToOperation(accountId, address, transaction) + transactionToOperation(accountId, address, transaction, tokenIdentifier) ); }; From c0e969520a152bed466b7cb9b076a57661813bac Mon Sep 17 00:00:00 2001 From: hzheng-ledger <71653044+hzheng-ledger@users.noreply.github.com> Date: Tue, 29 Mar 2022 16:14:10 +0200 Subject: [PATCH 117/127] LL-1589 more robust bitcoin retry (#1835) * fix bot * fix sync error exception process --- .../bitcoin/wallet-btc/explorer/index.ts | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/src/families/bitcoin/wallet-btc/explorer/index.ts b/src/families/bitcoin/wallet-btc/explorer/index.ts index fa665bfd26..6da83f9286 100644 --- a/src/families/bitcoin/wallet-btc/explorer/index.ts +++ b/src/families/bitcoin/wallet-btc/explorer/index.ts @@ -207,28 +207,29 @@ class BitcoinLikeExplorer extends EventEmitter implements IExplorer { // TODO add a test for failure (at the sync level) const client = await this.client.acquire(); - const res = ( - await client.client.get(url, { - params, - // some altcoin may have outputs with values > MAX_SAFE_INTEGER - transformResponse: (string) => - // eslint-disable-next-line @typescript-eslint/no-explicit-any - JSONBigNumber.parse(string, (key: string, value: any) => { - if (BigNumber.isBigNumber(value)) { - if (key === "value") { - return value.toString(); + let res: { txs: TX[] } = { txs: [] }; + try { + res = ( + await client.client.get(url, { + params, + // some altcoin may have outputs with values > MAX_SAFE_INTEGER + transformResponse: (string) => + // eslint-disable-next-line @typescript-eslint/no-explicit-any + JSONBigNumber.parse(string, (key: string, value: any) => { + if (BigNumber.isBigNumber(value)) { + if (key === "value") { + return value.toString(); + } + return value.toNumber(); } - - return value.toNumber(); - } - return value; - }), - }) - ).data as { txs: TX[] }; - await this.client.release(client); - + return value; + }), + }) + ).data; + } finally { + await this.client.release(client); + } this.emit("fetched-address-transaction", { url, params, res }); - return res; } @@ -305,7 +306,6 @@ class BitcoinLikeExplorer extends EventEmitter implements IExplorer { params.block_hash = lastTx.block.hash; } } - const res = await this.fetchTxs(address, params); const hydratedTxs: TX[] = []; From e527a27b2a62f2de89fdbe50c7fa474260996278 Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Thu, 31 Mar 2022 13:53:26 +0300 Subject: [PATCH 118/127] show account delegations & decode delegation transactions --- src/env.ts | 5 +++ src/families/elrond/api/apiCalls.ts | 21 +++++++++-- src/families/elrond/api/index.ts | 1 + src/families/elrond/api/sdk.ts | 44 ++++++++++++++++++++++- src/families/elrond/js-synchronisation.ts | 13 +++++-- src/families/elrond/serialization.ts | 6 ++-- src/families/elrond/types.ts | 16 +++++++++ src/types/operation.ts | 2 ++ 8 files changed, 101 insertions(+), 7 deletions(-) diff --git a/src/env.ts b/src/env.ts index 29f1e051d2..ff477b0a46 100644 --- a/src/env.ts +++ b/src/env.ts @@ -95,6 +95,11 @@ const envDefinitions = { def: "https://elrond.coin.ledger.com", desc: "Elrond API url", }, + ELROND_DELEGATION_API_ENDPOINT: { + parser: stringParser, + def: "https://delegation-api.elrond.com", + desc: "Elrond DELEGATION API url", + }, API_STELLAR_HORIZON: { parser: stringParser, def: "https://stellar.coin.ledger.com", diff --git a/src/families/elrond/api/apiCalls.ts b/src/families/elrond/api/apiCalls.ts index b32f6b0c76..ee0a33e751 100644 --- a/src/families/elrond/api/apiCalls.ts +++ b/src/families/elrond/api/apiCalls.ts @@ -9,17 +9,21 @@ import { GAS, } from "../constants"; import { + ElrondDelegation, ElrondProtocolTransaction, ElrondTransferOptions, ESDTToken, NetworkInfo, Transaction, } from "../types"; +import { decodeTransaction } from "./sdk"; export default class ElrondApi { private API_URL: string; + private DELEGATION_API_URL: string; - constructor(API_URL: string) { + constructor(API_URL: string, DELEGATION_API_URL: string) { this.API_URL = API_URL; + this.DELEGATION_API_URL = DELEGATION_API_URL; } async getAccountDetails(addr: string) { @@ -165,11 +169,15 @@ export default class ElrondApi { let from = 0; let before = Math.floor(Date.now() / 1000); while (from <= transactionsCount) { - const { data: transactions } = await network({ + let { data: transactions } = await network({ method: "GET", url: `${this.API_URL}/accounts/${addr}/transactions?after=${startAt}&before=${before}&size=${MAX_PAGINATION_SIZE}`, }); + transactions = transactions.map((transaction) => + decodeTransaction(transaction) + ); + allTransactions = [...allTransactions, ...transactions]; from = from + MAX_PAGINATION_SIZE; @@ -179,6 +187,15 @@ export default class ElrondApi { return allTransactions; } + async getAccountDelegations(addr: string): Promise { + const { data: delegations } = await network({ + method: "GET", + url: `${this.DELEGATION_API_URL}/accounts/${addr}/delegations`, + }); + + return delegations; + } + async getESDTTransactionsForAddress( addr: string, token: string diff --git a/src/families/elrond/api/index.ts b/src/families/elrond/api/index.ts index 57cf637399..36a61c5bf2 100644 --- a/src/families/elrond/api/index.ts +++ b/src/families/elrond/api/index.ts @@ -6,6 +6,7 @@ export { getFees, broadcastTransaction, getAccountESDTTokens, + getAccountDelegations, getAccountESDTOperations, hasESDTTokens, } from "./sdk"; diff --git a/src/families/elrond/api/sdk.ts b/src/families/elrond/api/sdk.ts index bdfa9c1a70..13f8cd7df4 100644 --- a/src/families/elrond/api/sdk.ts +++ b/src/families/elrond/api/sdk.ts @@ -1,6 +1,7 @@ import { BigNumber } from "bignumber.js"; import ElrondApi from "./apiCalls"; import { + ElrondDelegation, ElrondTransferOptions, ESDTToken, NetworkInfo, @@ -11,7 +12,10 @@ import { getEnv } from "../../../env"; import { encodeOperationId } from "../../../operation"; import { getTransactionParams } from "../cache"; import { GAS } from "../constants"; -const api = new ElrondApi(getEnv("ELROND_API_ENDPOINT")); +const api = new ElrondApi( + getEnv("ELROND_API_ENDPOINT"), + getEnv("ELROND_DELEGATION_API_ENDPOINT") +); /** * Get account balances and nonce @@ -51,6 +55,20 @@ function getOperationType( transaction: Transaction, addr: string ): OperationType { + if (transaction.mode !== "send") { + switch (transaction.mode) { + case "delegate": + return "DELEGATE"; + case "unDelegate": + return "UNDELEGATE"; + case "withdraw": + return "WITHDRAW_UNBONDED"; + case "claimRewards": + return "REWARD"; + case "reDelegateRewards": + return "REDELEGATE_REWARDS"; + } + } return isSender(transaction, addr) ? "OUT" : "IN"; } @@ -145,6 +163,12 @@ export const getAccountESDTTokens = async ( return await api.getESDTTokensForAddress(address); }; +export const getAccountDelegations = async ( + address: string +): Promise => { + return await api.getAccountDelegations(address); +}; + export const hasESDTTokens = async (address: string): Promise => { const tokensCount = await api.getESDTTokensCountForAddress(address); return tokensCount > 0; @@ -214,3 +238,21 @@ export const broadcastTransaction = async ( ): Promise => { return await api.submit(operation, signature); }; + +export const decodeTransaction = (transaction: any): Transaction => { + if (!transaction.action) { + return transaction; + } + + if (!transaction.action.category) { + return transaction; + } + + if (transaction.action.category !== "stake") { + return transaction; + } + + transaction.mode = transaction.action.name; + + return transaction; +}; diff --git a/src/families/elrond/js-synchronisation.ts b/src/families/elrond/js-synchronisation.ts index 5504665b3f..98de6a0639 100644 --- a/src/families/elrond/js-synchronisation.ts +++ b/src/families/elrond/js-synchronisation.ts @@ -2,7 +2,12 @@ import type { Account, TokenAccount } from "../../types"; import { encodeAccountId } from "../../account"; import type { GetAccountShape } from "../../bridge/jsHelpers"; import { makeSync, makeScanAccounts, mergeOps } from "../../bridge/jsHelpers"; -import { getAccount, getOperations, hasESDTTokens } from "./api"; +import { + getAccount, + getAccountDelegations, + getOperations, + hasESDTTokens, +} from "./api"; import elrondBuildESDTTokenAccounts from "./js-buildSubAccounts"; import { reconciliateSubAccounts } from "./js-reconciliation"; @@ -26,7 +31,8 @@ const getAccountShape: GetAccountShape = async (info) => { const operations = mergeOps(oldOperations, newOperations); let subAccounts: TokenAccount[] | undefined = []; - if (await hasESDTTokens(address)) { + const hasTokens = await hasESDTTokens(address); + if (hasTokens) { const tokenAccounts = await elrondBuildESDTTokenAccounts({ currency, accountId: accountId, @@ -42,6 +48,8 @@ const getAccountShape: GetAccountShape = async (info) => { } } + const delegations = await getAccountDelegations(address); + const shape = { id: accountId, balance, @@ -50,6 +58,7 @@ const getAccountShape: GetAccountShape = async (info) => { blockHeight, elrondResources: { nonce, + delegations, }, subAccounts, }; diff --git a/src/families/elrond/serialization.ts b/src/families/elrond/serialization.ts index 3e89729118..0cca81408c 100644 --- a/src/families/elrond/serialization.ts +++ b/src/families/elrond/serialization.ts @@ -1,13 +1,15 @@ import type { ElrondResourcesRaw, ElrondResources } from "./types"; export function toElrondResourcesRaw(r: ElrondResources): ElrondResourcesRaw { - const { nonce } = r; + const { nonce, delegations } = r; return { nonce, + delegations, }; } export function fromElrondResourcesRaw(r: ElrondResourcesRaw): ElrondResources { - const { nonce } = r; + const { nonce, delegations } = r; return { nonce, + delegations, }; } diff --git a/src/families/elrond/types.ts b/src/families/elrond/types.ts index 5046da63b6..42ba9f059e 100644 --- a/src/families/elrond/types.ts +++ b/src/families/elrond/types.ts @@ -9,6 +9,21 @@ export type CoreOperationSpecifics = Record; export type CoreCurrencySpecifics = Record; export type ElrondResources = { nonce: number; + delegations: ElrondDelegation[]; +}; + +export type ElrondDelegation = { + address: string; + contract: string; + userUnBondable: string; + userActiveStake: string; + claimableRewards: string; + userUndelegatedList: UserUndelegated[]; +}; + +export type UserUndelegated = { + amount: string; + seconds: number; }; /** @@ -16,6 +31,7 @@ export type ElrondResources = { */ export type ElrondResourcesRaw = { nonce: number; + delegations: ElrondDelegation[]; }; export type ElrondProtocolTransaction = { diff --git a/src/types/operation.ts b/src/types/operation.ts index 8c2e778561..7f2c50ee10 100644 --- a/src/types/operation.ts +++ b/src/types/operation.ts @@ -7,6 +7,8 @@ export type OperationType = | "NONE" | "CREATE" | "REVEAL" + // ELROND + | "REDELEGATE_REWARDS" // COSMOS | "DELEGATE" | "UNDELEGATE" From 3e2905c68b7a52d354fbeb2aaed32dc2a52891eb Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Thu, 7 Apr 2022 16:52:34 +0300 Subject: [PATCH 119/127] integrate erdjs --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index de9438dff0..e362655465 100644 --- a/package.json +++ b/package.json @@ -46,6 +46,7 @@ "@celo/wallet-base": "^1.5.1", "@celo/wallet-ledger": "^1.5.1", "@crypto-com/chain-jslib": "0.0.19", + "@elrondnetwork/erdjs": "^9.2.4", "@ethereumjs/common": "^2.6.0", "@ethereumjs/tx": "^3.4.0", "@ledgerhq/compressjs": "1.3.2", @@ -174,4 +175,4 @@ "typescript": "^4.5.5", "typescript-eslint-parser": "^22.0.0" } -} +} \ No newline at end of file From c04283116bf84516b601c764f142c8b19b87f8d5 Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Thu, 7 Apr 2022 16:53:17 +0300 Subject: [PATCH 120/127] transaction gasLimit --- src/families/elrond/js-buildTransaction.ts | 28 ++++++++++------------ src/families/elrond/js-transaction.ts | 2 ++ src/families/elrond/test-dataset.ts | 3 +++ src/families/elrond/transaction.ts | 2 ++ src/families/elrond/types.ts | 4 +++- 5 files changed, 23 insertions(+), 16 deletions(-) diff --git a/src/families/elrond/js-buildTransaction.ts b/src/families/elrond/js-buildTransaction.ts index 0ffb3f7320..dc95b273f7 100644 --- a/src/families/elrond/js-buildTransaction.ts +++ b/src/families/elrond/js-buildTransaction.ts @@ -1,8 +1,4 @@ -import type { - ElrondProtocolTransaction, - NetworkInfo, - Transaction, -} from "./types"; +import type { ElrondProtocolTransaction, Transaction } from "./types"; import type { Account, SubAccount } from "../../types"; import { getNonce } from "./logic"; import { getNetworkConfig } from "./api"; @@ -14,6 +10,7 @@ import { } from "./constants"; import BigNumber from "bignumber.js"; import { ElrondEncodeTransaction } from "./encode"; +import { NetworkConfig } from "@elrondnetwork/erdjs/out"; /** * * @param {Account} a @@ -26,15 +23,16 @@ export const buildTransaction = async ( ): Promise => { const address = a.freshAddress; const nonce = getNonce(a); - const networkConfig: NetworkInfo = await getNetworkConfig(); - const { chainID, gasPrice } = networkConfig; - let gasLimit = networkConfig.gasLimit; + const networkConfig: NetworkConfig = await getNetworkConfig(); + const chainID = networkConfig.ChainID.valueOf(); + const gasPrice = networkConfig.MinGasPrice.valueOf(); + t.gasLimit = networkConfig.MinGasLimit.valueOf(); let transactionValue: BigNumber; if (ta) { t.data = ElrondEncodeTransaction.ESDTTransfer(t, ta); - gasLimit = GAS.ESDT_TRANSFER; //gasLimit for and ESDT transfer + t.gasLimit = GAS.ESDT_TRANSFER; //gasLimit for and ESDT transfer transactionValue = new BigNumber(0); //amount of EGLD to be sent should be 0 in an ESDT transfer } else { @@ -50,24 +48,24 @@ export const buildTransaction = async ( ); } - gasLimit = GAS.DELEGATE; + t.gasLimit = GAS.DELEGATE; t.data = ElrondEncodeTransaction.delegate(); break; case "claimRewards": - gasLimit = GAS.CLAIM; + t.gasLimit = GAS.CLAIM; t.data = ElrondEncodeTransaction.claimRewards(); transactionValue = new BigNumber(0); //amount of EGLD to be sent should be 0 in a claimRewards transaction break; case "withdraw": - gasLimit = GAS.DELEGATE; + t.gasLimit = GAS.DELEGATE; t.data = ElrondEncodeTransaction.withdraw(); transactionValue = new BigNumber(0); //amount of EGLD to be sent should be 0 in a withdraw transaction break; case "reDelegateRewards": - gasLimit = GAS.DELEGATE; + t.gasLimit = GAS.DELEGATE; t.data = ElrondEncodeTransaction.reDelegateRewards(); transactionValue = new BigNumber(0); //amount of EGLD to be sent should be 0 in a reDelegateRewards transaction @@ -79,7 +77,7 @@ export const buildTransaction = async ( ); } - gasLimit = GAS.DELEGATE; + t.gasLimit = GAS.DELEGATE; t.data = ElrondEncodeTransaction.unDelegate(t); transactionValue = new BigNumber(0); //amount of EGLD to be sent should be 0 in a unDelegate transaction @@ -97,7 +95,7 @@ export const buildTransaction = async ( receiver: t.recipient, sender: address, gasPrice, - gasLimit, + gasLimit: t.gasLimit, data: t.data, chainID, ...HASH_TRANSACTION, diff --git a/src/families/elrond/js-transaction.ts b/src/families/elrond/js-transaction.ts index a4d12141ec..1a3b11c704 100644 --- a/src/families/elrond/js-transaction.ts +++ b/src/families/elrond/js-transaction.ts @@ -3,6 +3,7 @@ import { BigNumber } from "bignumber.js"; import type { Account } from "../../types"; import type { Transaction } from "./types"; import getEstimatedFees from "./js-getFeesForTransaction"; +import { NetworkConfig } from "@elrondnetwork/erdjs/out"; const sameFees = (a, b) => (!a || !b ? false : a === b); @@ -19,6 +20,7 @@ export const createTransaction = (): Transaction => { recipient: "", useAllAmount: false, fees: new BigNumber(50000), + gasLimit: NetworkConfig.getDefault().MinGasLimit.valueOf(), }; }; diff --git a/src/families/elrond/test-dataset.ts b/src/families/elrond/test-dataset.ts index 2952920212..13f3e98129 100644 --- a/src/families/elrond/test-dataset.ts +++ b/src/families/elrond/test-dataset.ts @@ -52,6 +52,7 @@ const elrond: CurrenciesData = { amount: "100000000", mode: "send", fees: null, + gasLimit: 0, }), expectedStatus: { amount: new BigNumber("100000000"), @@ -69,6 +70,7 @@ const elrond: CurrenciesData = { amount: "100000000", mode: "send", fees: null, + gasLimit: 0, }), expectedStatus: { errors: { @@ -86,6 +88,7 @@ const elrond: CurrenciesData = { amount: "1000000000000000000000000", mode: "send", fees: null, + gasLimit: 0, }), expectedStatus: { errors: { diff --git a/src/families/elrond/transaction.ts b/src/families/elrond/transaction.ts index 8424fac232..7672ec2c80 100644 --- a/src/families/elrond/transaction.ts +++ b/src/families/elrond/transaction.ts @@ -29,6 +29,7 @@ export const fromTransactionRaw = (tr: TransactionRaw): Transaction => { family: tr.family, mode: tr.mode, fees: tr.fees ? new BigNumber(tr.fees) : null, + gasLimit: tr.gasLimit, }; }; export const toTransactionRaw = (t: Transaction): TransactionRaw => { @@ -38,6 +39,7 @@ export const toTransactionRaw = (t: Transaction): TransactionRaw => { family: t.family, mode: t.mode, fees: t.fees?.toString() || null, + gasLimit: t.gasLimit, }; }; export default { diff --git a/src/families/elrond/types.ts b/src/families/elrond/types.ts index 42ba9f059e..3778f92ea5 100644 --- a/src/families/elrond/types.ts +++ b/src/families/elrond/types.ts @@ -75,6 +75,7 @@ export type Transaction = TransactionCommon & { blockHeight?: number; timestamp?: number; nonce?: number; + gasLimit: number; status?: string; fee?: BigNumber; round?: number; @@ -103,6 +104,7 @@ export type TransactionRaw = TransactionCommonRaw & { family: "elrond"; mode: ElrondTransactionMode; fees: string | null | undefined; + gasLimit: number; }; export type ElrondValidator = { bls: string; @@ -140,4 +142,4 @@ export type NetworkInfoRaw = { export type ElrondPreloadData = { validators: Record; }; -export const reflect = (_declare: any) => { }; +export const reflect = (_declare: any) => {}; From 25c1053f18217eb8096202100fafa65339a2ac3c Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Thu, 7 Apr 2022 16:53:49 +0300 Subject: [PATCH 121/127] use erdjs proxy to compute fees --- src/families/elrond/api/sdk.ts | 59 +++++++++++++--------------------- 1 file changed, 23 insertions(+), 36 deletions(-) diff --git a/src/families/elrond/api/sdk.ts b/src/families/elrond/api/sdk.ts index 13f8cd7df4..d787999f75 100644 --- a/src/families/elrond/api/sdk.ts +++ b/src/families/elrond/api/sdk.ts @@ -4,19 +4,26 @@ import { ElrondDelegation, ElrondTransferOptions, ESDTToken, - NetworkInfo, Transaction, } from "../types"; import type { Operation, OperationType } from "../../../types"; import { getEnv } from "../../../env"; import { encodeOperationId } from "../../../operation"; -import { getTransactionParams } from "../cache"; -import { GAS } from "../constants"; +import { + Address, + GasLimit, + NetworkConfig, + ProxyProvider, + Transaction as ElrondSdkTransaction, + TransactionPayload, +} from "@elrondnetwork/erdjs/out"; const api = new ElrondApi( getEnv("ELROND_API_ENDPOINT"), getEnv("ELROND_DELEGATION_API_ENDPOINT") ); +const proxy = new ProxyProvider(getEnv("ELROND_API_ENDPOINT")); + /** * Get account balances and nonce */ @@ -37,8 +44,10 @@ export const getValidators = async () => { }; }; -export const getNetworkConfig = async (): Promise => { - return await api.getNetworkConfig(); +export const getNetworkConfig = async (): Promise => { + await NetworkConfig.getDefault().sync(proxy); + + return NetworkConfig.getDefault(); }; /** @@ -193,40 +202,18 @@ export const getAccountESDTOperations = async ( * Obtain fees from blockchain */ export const getFees = async (t: Transaction): Promise => { - const transactionParams = await getTransactionParams(); - const { - gasPerByte, - gasPriceModifier, - gasLimit: minGasLimit, - } = transactionParams; - let gasPrice = transactionParams.gasPrice; - - let gasLimit = minGasLimit; - if (t.subAccountId) { - gasLimit = GAS.ESDT_TRANSFER; - } - - const transactionData = Buffer.from(t.data?.trim() || []); + await NetworkConfig.getDefault().sync(proxy); - const moveBalanceGas = minGasLimit + transactionData.length * gasPerByte; + const transaction = new ElrondSdkTransaction({ + data: new TransactionPayload(t.data), + receiver: new Address(t.receiver), + chainID: NetworkConfig.getDefault().ChainID, + gasLimit: new GasLimit(t.gasLimit), + }); - if (t.subAccountId) { - gasLimit = GAS.ESDT_TRANSFER; - } - - gasPrice = new BigNumber(gasPrice); - const feeForMove = new BigNumber(moveBalanceGas).multipliedBy(gasPrice); - if (moveBalanceGas === gasLimit) { - return feeForMove; - } - - const diff = new BigNumber(gasLimit - moveBalanceGas); - const modifiedGasPrice = gasPrice.multipliedBy( - new BigNumber(gasPriceModifier) - ); - const processingFee = diff.multipliedBy(modifiedGasPrice); + const feesStr = transaction.computeFee(NetworkConfig.getDefault()).toFixed(); - return feeForMove.plus(processingFee); + return new BigNumber(feesStr); }; /** From 020a44c47e978800620a5127378bb542fb355609 Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Mon, 18 Apr 2022 13:56:09 +0300 Subject: [PATCH 122/127] keep 0.005 egld for future transaction fees --- src/families/elrond/constants.ts | 1 + src/families/elrond/js-synchronisation.ts | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/families/elrond/constants.ts b/src/families/elrond/constants.ts index dc45de9e75..d866bbd2fb 100644 --- a/src/families/elrond/constants.ts +++ b/src/families/elrond/constants.ts @@ -16,3 +16,4 @@ export const MIN_DELEGATION_AMOUNT: BigNumber = new BigNumber( 1000000000000000000 ); export const MIN_DELEGATION_AMOUNT_DENOMINATED: BigNumber = new BigNumber(1); +export const FEES_BALANCE: BigNumber = new BigNumber("5000000000000000"); // 0.005 EGLD for future transactions diff --git a/src/families/elrond/js-synchronisation.ts b/src/families/elrond/js-synchronisation.ts index 98de6a0639..f942633472 100644 --- a/src/families/elrond/js-synchronisation.ts +++ b/src/families/elrond/js-synchronisation.ts @@ -10,6 +10,7 @@ import { } from "./api"; import elrondBuildESDTTokenAccounts from "./js-buildSubAccounts"; import { reconciliateSubAccounts } from "./js-reconciliation"; +import { FEES_BALANCE } from "./constants"; const getAccountShape: GetAccountShape = async (info) => { const { address, initialAccount, currency, derivationMode } = info; @@ -53,7 +54,7 @@ const getAccountShape: GetAccountShape = async (info) => { const shape = { id: accountId, balance, - spendableBalance: balance, + spendableBalance: balance.minus(FEES_BALANCE), operationsCount: operations.length, blockHeight, elrondResources: { From 475cb09bc97be95b8f8d84a19732838f6302ee0e Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Mon, 18 Apr 2022 13:56:53 +0300 Subject: [PATCH 123/127] compute fees when estimate max spendable balance --- .../elrond/js-estimateMaxSpendable.ts | 36 ++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/src/families/elrond/js-estimateMaxSpendable.ts b/src/families/elrond/js-estimateMaxSpendable.ts index 62e8929438..7442ce178f 100644 --- a/src/families/elrond/js-estimateMaxSpendable.ts +++ b/src/families/elrond/js-estimateMaxSpendable.ts @@ -4,6 +4,8 @@ import { getMainAccount } from "../../account"; import type { Transaction } from "./types"; import { createTransaction } from "./js-transaction"; import getEstimatedFees from "./js-getFeesForTransaction"; +import { GAS } from "./constants"; +import { ElrondEncodeTransaction } from "./encode"; /** * Returns the maximum possible amount for transaction @@ -35,13 +37,45 @@ const estimateMaxSpendable = async ({ return tokenAccount.balance; } + switch (tx?.mode) { + case "reDelegateRewards": + tx.gasLimit = GAS.DELEGATE; + + tx.data = ElrondEncodeTransaction.reDelegateRewards(); + break; + case "withdraw": + tx.gasLimit = GAS.DELEGATE; + + tx.data = ElrondEncodeTransaction.withdraw(); + break; + case "unDelegate": + tx.gasLimit = GAS.DELEGATE; + + tx.data = ElrondEncodeTransaction.unDelegate(tx); + break; + case "delegate": + tx.gasLimit = GAS.DELEGATE; + + tx.data = ElrondEncodeTransaction.delegate(); + break; + + case "claimRewards": + tx.gasLimit = GAS.CLAIM; + + tx.data = ElrondEncodeTransaction.claimRewards(); + break; + + default: + break; + } + const fees = await getEstimatedFees(tx); if (fees.gt(mainAccount.balance)) { return new BigNumber(0); } - return mainAccount.spendableBalance; + return mainAccount.spendableBalance.minus(fees); }; export default estimateMaxSpendable; From 9488c3cf1e56fbaaffb99150bae2b8b756d820c2 Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Mon, 18 Apr 2022 13:57:15 +0300 Subject: [PATCH 124/127] reDelegateRewards as delegate operation type --- src/families/elrond/api/sdk.ts | 2 +- src/types/operation.ts | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/families/elrond/api/sdk.ts b/src/families/elrond/api/sdk.ts index d787999f75..655b5f49c7 100644 --- a/src/families/elrond/api/sdk.ts +++ b/src/families/elrond/api/sdk.ts @@ -75,7 +75,7 @@ function getOperationType( case "claimRewards": return "REWARD"; case "reDelegateRewards": - return "REDELEGATE_REWARDS"; + return "DELEGATE"; } } return isSender(transaction, addr) ? "OUT" : "IN"; diff --git a/src/types/operation.ts b/src/types/operation.ts index 7f2c50ee10..8c2e778561 100644 --- a/src/types/operation.ts +++ b/src/types/operation.ts @@ -7,8 +7,6 @@ export type OperationType = | "NONE" | "CREATE" | "REVEAL" - // ELROND - | "REDELEGATE_REWARDS" // COSMOS | "DELEGATE" | "UNDELEGATE" From e5f122bdb9a10bca7a39651770be4894d03e48ce Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Mon, 2 May 2022 15:52:35 +0300 Subject: [PATCH 125/127] Maximum decimals limit --- src/families/elrond/constants.ts | 1 + src/families/elrond/js-getTransactionStatus.ts | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/families/elrond/constants.ts b/src/families/elrond/constants.ts index d866bbd2fb..ac3b7ad023 100644 --- a/src/families/elrond/constants.ts +++ b/src/families/elrond/constants.ts @@ -17,3 +17,4 @@ export const MIN_DELEGATION_AMOUNT: BigNumber = new BigNumber( ); export const MIN_DELEGATION_AMOUNT_DENOMINATED: BigNumber = new BigNumber(1); export const FEES_BALANCE: BigNumber = new BigNumber("5000000000000000"); // 0.005 EGLD for future transactions +export const DECIMALS_LIMIT = 18; diff --git a/src/families/elrond/js-getTransactionStatus.ts b/src/families/elrond/js-getTransactionStatus.ts index 1acfc6f724..0b0435f829 100644 --- a/src/families/elrond/js-getTransactionStatus.ts +++ b/src/families/elrond/js-getTransactionStatus.ts @@ -13,6 +13,7 @@ import { isSelfTransaction, computeTransactionValue, } from "./logic"; +import { DECIMALS_LIMIT } from "./constants"; const getTransactionStatus = async ( a: Account, @@ -52,6 +53,9 @@ const getTransactionStatus = async ( if (totalSpent.gt(tokenAccount.balance)) { errors.amount = new NotEnoughBalance(); } + if (!totalSpent.decimalPlaces(DECIMALS_LIMIT).isEqualTo(totalSpent)) { + errors.amount = new Error(`Maximum '${DECIMALS_LIMIT}' decimals allowed`); + } } else { if (totalSpent.gt(a.balance)) { errors.amount = new NotEnoughBalance(); From c9c04ccbba7c9981835aa0876e2805df99294cba Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Mon, 2 May 2022 15:52:59 +0300 Subject: [PATCH 126/127] spendable balance for lower accounts --- src/families/elrond/js-synchronisation.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/families/elrond/js-synchronisation.ts b/src/families/elrond/js-synchronisation.ts index f942633472..9e60a32fef 100644 --- a/src/families/elrond/js-synchronisation.ts +++ b/src/families/elrond/js-synchronisation.ts @@ -54,7 +54,9 @@ const getAccountShape: GetAccountShape = async (info) => { const shape = { id: accountId, balance, - spendableBalance: balance.minus(FEES_BALANCE), + spendableBalance: balance.gt(FEES_BALANCE) + ? balance.minus(FEES_BALANCE) + : balance, operationsCount: operations.length, blockHeight, elrondResources: { From 3d8523cdd8c7ca7fd182ddc283f8dbf4ee0530a2 Mon Sep 17 00:00:00 2001 From: AlexandruPislariu Date: Mon, 2 May 2022 15:53:35 +0300 Subject: [PATCH 127/127] encode esdt amount using useAllAmount tx field --- src/families/elrond/encode.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/families/elrond/encode.ts b/src/families/elrond/encode.ts index 03060fda94..e1caf0064f 100644 --- a/src/families/elrond/encode.ts +++ b/src/families/elrond/encode.ts @@ -4,7 +4,9 @@ import type { Transaction } from "./types"; export class ElrondEncodeTransaction { static ESDTTransfer(t: Transaction, ta: SubAccount): string { const tokenIdentifierHex = ta.id.split("/")[2]; - let amountHex = t.amount.toString(16); + let amountHex = t.useAllAmount + ? ta.balance.toString(16) + : t.amount.toString(16); //hex amount length must be even so protocol would treat it as an ESDT transfer if (amountHex.length % 2 !== 0) {