diff --git a/jest.config.js b/jest.config.js index af05d96..b02fd07 100644 --- a/jest.config.js +++ b/jest.config.js @@ -25,5 +25,7 @@ module.exports = { 'web.tsx', 'json', 'node' - ] + ], + workerIdleMemoryLimit: '512MB', // Memory used per worker. Required to prevent memory leaks + maxWorkers: '50%' // Maximum tests ran in parallel. Required to prevent CPU usage at 100% }; diff --git a/src/apiCalls/index.ts b/src/apiCalls/index.ts index 28f2150..fc13821 100644 --- a/src/apiCalls/index.ts +++ b/src/apiCalls/index.ts @@ -1,2 +1,3 @@ export * from './configuration'; export * from './endpoints'; +export * from './transactions'; diff --git a/src/apiCalls/transactions/index.ts b/src/apiCalls/transactions/index.ts new file mode 100644 index 0000000..ac35e8d --- /dev/null +++ b/src/apiCalls/transactions/index.ts @@ -0,0 +1,2 @@ +export * from './getTransactionByHash'; +export * from './getTransactionsByHashes'; diff --git a/src/constants/index.ts b/src/constants/index.ts index 7798f00..c563bd3 100644 --- a/src/constants/index.ts +++ b/src/constants/index.ts @@ -5,5 +5,5 @@ export * from './ledger.constants'; export * from './network.constants'; export * from './placeholders.constants'; export * from './storage.constants'; -export * from './transactions.constants' +export * from './transactions.constants'; export * from './window.constants'; diff --git a/src/constants/mvx.constants.ts b/src/constants/mvx.constants.ts index c983a41..d2ebe5e 100644 --- a/src/constants/mvx.constants.ts +++ b/src/constants/mvx.constants.ts @@ -1,14 +1,7 @@ -export const GAS_PRICE_MODIFIER = 0.01; -export const GAS_PER_DATA_BYTE = 1500; -export const GAS_LIMIT = 50000; -/** - * Extra gas limit for guarded transactions - */ -export const EXTRA_GAS_LIMIT_GUARDED_TX = 50000; -export const GAS_PRICE = 1000000000; +export const ALL_SHARDS_SHARD_ID = 4294967280; +export const CROSS_SHARD_ROUNDS = 5; export const DECIMALS = 18; export const DIGITS = 4; -export const VERSION = 1; export const LEDGER_CONTRACT_DATA_ENABLED_VALUE = 1; export const METACHAIN_SHARD_ID = 4294967295; -export const ALL_SHARDS_SHARD_ID = 4294967280; +export const VERSION = 1; diff --git a/src/constants/transactions.constants.ts b/src/constants/transactions.constants.ts index dd0f90f..ebcc89b 100644 --- a/src/constants/transactions.constants.ts +++ b/src/constants/transactions.constants.ts @@ -1,18 +1,12 @@ -export const ALL_SHARDS_SHARD_ID = 4294967280; export const AVERAGE_TX_DURATION_MS = 6000; export const CANCEL_TRANSACTION_TOAST_DEFAULT_DURATION = 20000; export const CANCEL_TRANSACTION_TOAST_ID = 'cancel-transaction-toast'; -export const CROSS_SHARD_ROUNDS = 5; -export const DECIMALS = 18; -export const DIGITS = 4; export const EXTRA_GAS_LIMIT_GUARDED_TX = 50_000; export const GAS_LIMIT = 50_000; export const GAS_PER_DATA_BYTE = 1_500; export const GAS_PRICE = 1_000_000_000; export const GAS_PRICE_MODIFIER = 0.01; -export const METACHAIN_SHARD_ID = 4294967295; -export const SDK_DAPP_VERSION = 'sdk-dapp-version'; +export const REFUNDED_GAS = 'refundedGas'; export const TRANSACTIONS_STATUS_DROP_INTERVAL_MS = 10 * 60 * 1000; // 10min export const TRANSACTIONS_STATUS_POLLING_INTERVAL_MS = 90 * 1000; // 90sec -export const VERSION = 1; export const WALLET_SIGN_SESSION = 'signSession'; diff --git a/src/core/methods/initApp/websocket/initializeWebsocketConnection.ts b/src/core/methods/initApp/websocket/initializeWebsocketConnection.ts index 9b8a39a..569dc51 100644 --- a/src/core/methods/initApp/websocket/initializeWebsocketConnection.ts +++ b/src/core/methods/initApp/websocket/initializeWebsocketConnection.ts @@ -7,7 +7,7 @@ import { } from 'store/actions/account/accountActions'; import { networkSelector } from 'store/selectors'; import { getStore } from 'store/store'; -import { retryMultipleTimes } from 'utils/retryMultipleTimes'; +import { retryMultipleTimes } from 'utils/misc/retryMultipleTimes'; import { BatchTransactionsWSResponseType, websocketConnection, diff --git a/src/core/methods/trackTransactions/helpers/checkTransactionStatus/checkBatch.ts b/src/core/methods/trackTransactions/helpers/checkTransactionStatus/checkBatch.ts index e789db8..3d1f8fa 100644 --- a/src/core/methods/trackTransactions/helpers/checkTransactionStatus/checkBatch.ts +++ b/src/core/methods/trackTransactions/helpers/checkTransactionStatus/checkBatch.ts @@ -19,7 +19,7 @@ import { getPendingTransactions } from './getPendingTransactions'; import { manageFailedTransactions } from './manageFailedTransactions'; import { TransactionsTrackerType } from '../../trackTransactions.types'; -export interface TransactionStatusTrackerPropsType +export interface TransactionStatusTrackerParamsType extends TransactionsTrackerType { sessionId: string; transactionBatch: SignedTransactionType[]; @@ -126,7 +126,7 @@ export async function checkBatch({ isSequential, onSuccess, onFail -}: TransactionStatusTrackerPropsType) { +}: TransactionStatusTrackerParamsType) { try { if (transactions == null) { return; diff --git a/src/core/providers/DappProvider/helpers/logout/logout.ts b/src/core/providers/DappProvider/helpers/logout/logout.ts index 026fe66..eeb871c 100644 --- a/src/core/providers/DappProvider/helpers/logout/logout.ts +++ b/src/core/providers/DappProvider/helpers/logout/logout.ts @@ -37,7 +37,7 @@ export type LogoutParamsType = { interface IProviderLogout { provider: IProvider; - options?: LogoutPropsType; + options?: LogoutParamsType; } export async function logout({ diff --git a/src/core/providers/ProviderFactory.ts b/src/core/providers/ProviderFactory.ts index d7427be..111f803 100644 --- a/src/core/providers/ProviderFactory.ts +++ b/src/core/providers/ProviderFactory.ts @@ -48,8 +48,8 @@ export class ProviderFactory { case ProviderTypeEnum.ledger: { const ledgerProvider = await createLedgerProvider( - ui.ledger.eventBus, - ui.ledger.mount + ui?.ledger.eventBus, + ui?.ledger.mount ); if (!ledgerProvider) { diff --git a/src/services/nativeAuth/helpers/getLatestBlockHash.ts b/src/services/nativeAuth/helpers/getLatestBlockHash.ts index 2f748f2..586ec2b 100644 --- a/src/services/nativeAuth/helpers/getLatestBlockHash.ts +++ b/src/services/nativeAuth/helpers/getLatestBlockHash.ts @@ -1,6 +1,6 @@ import axios from 'axios'; import { BLOCKS_ENDPOINT } from 'apiCalls/endpoints'; -import { retryMultipleTimes } from 'utils/retryMultipleTimes'; +import { retryMultipleTimes } from 'utils/misc/retryMultipleTimes'; export interface LatestBlockHashType { hash: string; diff --git a/src/store/actions/network/initializeNetwork.ts b/src/store/actions/network/initializeNetwork.ts index 34be0fe..97e2431 100644 --- a/src/store/actions/network/initializeNetwork.ts +++ b/src/store/actions/network/initializeNetwork.ts @@ -13,7 +13,7 @@ export type InitializeNetworkParamsType = { export const initializeNetwork = async ({ customNetworkConfig = {}, environment -}: InitializeNetworkParamsType): Promise => { +}: InitializeNetworkParamsType) => { const fetchConfigFromServer = !customNetworkConfig?.skipFetchFromServer; const customNetworkApiAddress = customNetworkConfig?.apiAddress; diff --git a/src/store/selectors/networkSelectors.ts b/src/store/selectors/networkSelectors.ts index 9e023f9..f95dbfe 100644 --- a/src/store/selectors/networkSelectors.ts +++ b/src/store/selectors/networkSelectors.ts @@ -16,3 +16,6 @@ export const roundDurationSelectorSelector = ({ export const apiAddressSelector = ({ network: { network } }: StoreType) => network.apiAddress; + +export const explorerAddressSelector = ({ network: { network } }: StoreType) => + network.explorerAddress; diff --git a/src/store/selectors/transactionsSelectors.ts b/src/store/selectors/transactionsSelectors.ts deleted file mode 100644 index b68c98a..0000000 --- a/src/store/selectors/transactionsSelectors.ts +++ /dev/null @@ -1,79 +0,0 @@ -import { StoreType } from 'store/store.types'; -import { - getIsTransactionFailed, - getIsTransactionPending, - getIsTransactionSuccessful, - getIsTransactionTimedOut, - newTransaction -} from 'utils/transactions'; -import { - CustomTransactionInformation, - RawTransactionType, - SignedTransactionsType -} from '../../types'; - -export const signedTransactionsSelector = ({ transactions }: StoreType) => - transactions.signedTransactions; - -export const signTransactionsErrorSelector = ({ transactions }: StoreType) => - transactions.signTransactionsError; - -export const signTransactionsCancelMessageSelector = ({ - transactions -}: StoreType) => transactions.signTransactionsCancelMessage; - -const selectTxByStatus = - (txStatusVerifier: typeof getIsTransactionPending) => (store: StoreType) => { - const signedTransactions = signedTransactionsSelector(store); - - return Object.entries(signedTransactions).reduce( - (acc, [sessionId, txBody]) => { - if (txStatusVerifier(txBody.status)) { - acc[sessionId] = txBody; - } - return acc; - }, - {} as SignedTransactionsType - ); - }; - -export const pendingSignedTransactionsSelector = selectTxByStatus( - getIsTransactionPending -); - -export const successfulTransactionsSelector = selectTxByStatus( - getIsTransactionSuccessful -); - -export const failedTransactionsSelector = selectTxByStatus( - getIsTransactionFailed -); - -export const timedOutTransactionsSelector = selectTxByStatus( - getIsTransactionTimedOut -); - -export const transactionsToSignSelector = ({ transactions }: StoreType) => { - const transactionsToSign = transactions.transactionsToSign; - - if (transactionsToSign == null) { - return null; - } - - return { - ...transactionsToSign, - transactions: - transactionsToSign?.transactions.map((tx: RawTransactionType) => - newTransaction(tx) - ) || [] - }; -}; - -export const transactionStatusSelector = - (transactionSessionId: number) => (store: StoreType) => { - const signedTransactions = signedTransactionsSelector(store); - - return signedTransactions.transactionSessionId != null - ? signedTransactions?.[transactionSessionId] || {} - : {}; - }; diff --git a/src/types/enums.types.ts b/src/types/enums.types.ts index cf97633..676e179 100644 --- a/src/types/enums.types.ts +++ b/src/types/enums.types.ts @@ -43,16 +43,6 @@ export enum ESDTTransferTypesEnum { ESDTFreeze = 'ESDTFreeze' } -export enum TransactionServerStatusesEnum { - pending = 'pending', - fail = 'fail', - invalid = 'invalid', - success = 'success', - executed = 'executed', - notExecuted = 'not executed', - rewardReverted = 'reward-reverted' -} - export enum SignedMessageStatusesEnum { pending = 'pending', failed = 'failed', @@ -60,16 +50,6 @@ export enum SignedMessageStatusesEnum { cancelled = 'cancelled' } -export enum TransactionBatchStatusesEnum { - signed = 'signed', - cancelled = 'cancelled', - success = 'success', - sent = 'sent', - fail = 'fail', - timedOut = 'timedOut', - invalid = 'invalid' -} - export enum LoginMethodsEnum { ledger = 'ledger', walletconnect = 'walletconnect', diff --git a/src/types/index.ts b/src/types/index.ts index da399ce..4ee21aa 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -2,5 +2,6 @@ export * from './enums.types'; export * from './login.types'; export * from './misc.types'; export * from './network.types'; -export * from './tokens.types' -export * from './transactions.types'; \ No newline at end of file +export * from './serverTransactions.types'; +export * from './tokens.types'; +export * from './transactions.types'; diff --git a/src/types/serverTransactions.types.ts b/src/types/serverTransactions.types.ts index ae6b3c7..91e010d 100644 --- a/src/types/serverTransactions.types.ts +++ b/src/types/serverTransactions.types.ts @@ -299,7 +299,7 @@ export interface InterpretedTransactionType extends ServerTransactionType { }; } -export interface DecodeForDisplayPropsType { +export interface DecodeForDisplayParamsType { input: string; decodeMethod: DecodeMethodEnum; identifier?: string; diff --git a/src/types/transactions.types.ts b/src/types/transactions.types.ts index e2ae663..16df7f1 100644 --- a/src/types/transactions.types.ts +++ b/src/types/transactions.types.ts @@ -1,7 +1,9 @@ import { IPlainTransactionObject } from '@multiversx/sdk-core/out'; +import { Transaction } from '@multiversx/sdk-core/out/transaction'; import { TransactionBatchStatusesEnum, - TransactionServerStatusesEnum + TransactionServerStatusesEnum, + TransactionTypesEnum } from 'types/enums.types'; export interface SignedTransactionType extends IPlainTransactionObject { @@ -48,3 +50,50 @@ export interface SmartContractResult { miniBlockHash: string; returnMessage: string; } + +interface MultiEsdtType { + type: + | TransactionTypesEnum.esdtTransaction + | TransactionTypesEnum.nftTransaction; + receiver: string; + token?: string; + nonce?: string; + amount?: string; + data: string; +} + +interface MultiEsdtScCallType { + type: TransactionTypesEnum.scCall; + receiver: string; + token?: string; + nonce?: string; + amount?: string; + data: string; +} + +export type MultiEsdtTransactionType = MultiEsdtType | MultiEsdtScCallType; + +export interface TransactionDataTokenType { + tokenId: string; + amount: string; + receiver: string; + type?: MultiEsdtTransactionType['type'] | ''; + nonce?: string; + multiTxData?: string; +} + +export type TransactionsDataTokensType = + | Record + | undefined; + +export interface MultiSignTransactionType { + multiTxData?: string; + transactionIndex: number; + transaction: Transaction; +} + +export interface TransactionLinkType { + link: string; + label: string; + address: string; +} diff --git a/src/utils/account/fetchAccount.ts b/src/utils/account/fetchAccount.ts index 76e8587..6f13ede 100644 --- a/src/utils/account/fetchAccount.ts +++ b/src/utils/account/fetchAccount.ts @@ -1,3 +1,5 @@ import { getAccountFromApi } from 'apiCalls/account/getAccountFromApi'; -export const fetchAccount = (address?: string) => getAccountFromApi(address); +export function fetchAccount(address?: string) { + return getAccountFromApi(address); +} diff --git a/src/utils/account/getShardOfAddress.ts b/src/utils/account/getShardOfAddress.ts index 265e887..731b16c 100644 --- a/src/utils/account/getShardOfAddress.ts +++ b/src/utils/account/getShardOfAddress.ts @@ -12,7 +12,8 @@ const isAddressOfMetachain = (pubKey: Buffer) => { const zeroAddress = Buffer.alloc(32).fill(0); return pubKey.equals(zeroAddress); }; -export const getShardOfAddress = (hexPubKey: any) => { + +export function getShardOfAddress(hexPubKey: any) { try { const numShards = 3; const maskHigh = parseInt('11', 2); @@ -27,7 +28,7 @@ export const getShardOfAddress = (hexPubKey: any) => { shard = lastByteOfPubKey & maskLow; } return shard; - } catch (err) { + } catch { return -1; } -}; +} diff --git a/src/utils/account/refreshAccount.ts b/src/utils/account/refreshAccount.ts index 42f2503..def0e4d 100644 --- a/src/utils/account/refreshAccount.ts +++ b/src/utils/account/refreshAccount.ts @@ -4,7 +4,7 @@ import { getAccountProvider } from 'core/providers/accountProvider'; import { setAccount } from 'store/actions'; import { fetchAccount } from './fetchAccount'; -const setNewAccount = async () => { +async function setNewAccount() { try { const address = getAddress(); @@ -29,7 +29,7 @@ const setNewAccount = async () => { } return null; -}; +} export async function refreshAccount() { const provider = getAccountProvider(); diff --git a/src/utils/dateTime/getUnixTimestamp.ts b/src/utils/dateTime/getUnixTimestamp.ts index 1e1bcc3..a60b1ab 100644 --- a/src/utils/dateTime/getUnixTimestamp.ts +++ b/src/utils/dateTime/getUnixTimestamp.ts @@ -1,3 +1,4 @@ -export const getUnixTimestamp = () => { +// TODO: Move to utils +export function getUnixTimestamp() { return Date.now() / 1000; -}; +} diff --git a/src/utils/dateTime/getUnixTimestampWithAddedMilliseconds.ts b/src/utils/dateTime/getUnixTimestampWithAddedMilliseconds.ts index a2346bf..07dfbb0 100644 --- a/src/utils/dateTime/getUnixTimestampWithAddedMilliseconds.ts +++ b/src/utils/dateTime/getUnixTimestampWithAddedMilliseconds.ts @@ -1,9 +1,10 @@ -export const getUnixTimestampWithAddedMilliseconds = ( +// TODO: Move to utils +export function getUnixTimestampWithAddedMilliseconds( addedMilliseconds: number -) => { +) { return ( new Date().setMilliseconds( new Date().getMilliseconds() + addedMilliseconds ) / 1000 ); -}; +} diff --git a/src/utils/dateTime/getUnixTimestampWithAddedSeconds.ts b/src/utils/dateTime/getUnixTimestampWithAddedSeconds.ts index ad53a33..cb6c491 100644 --- a/src/utils/dateTime/getUnixTimestampWithAddedSeconds.ts +++ b/src/utils/dateTime/getUnixTimestampWithAddedSeconds.ts @@ -1,3 +1,4 @@ -export const getUnixTimestampWithAddedSeconds = (addedSeconds: number) => { +// TODO: Move to utils +export function getUnixTimestampWithAddedSeconds(addedSeconds: number) { return new Date().setSeconds(new Date().getSeconds() + addedSeconds); -}; +} diff --git a/src/utils/decoders/base64Utils.ts b/src/utils/decoders/base64Utils.ts index af97e3d..f77a620 100644 --- a/src/utils/decoders/base64Utils.ts +++ b/src/utils/decoders/base64Utils.ts @@ -17,6 +17,7 @@ * @see The tests for this function are in src/utils/decoders/tests/base64Utils.test.ts * @param str */ +// TODO: Move to utils export function isStringBase64(str: string) { try { // Try to decode the string and encode it back using base64 functions diff --git a/src/utils/decoders/decodePart.ts b/src/utils/decoders/decodePart.ts index 90e30f1..338c9be 100644 --- a/src/utils/decoders/decodePart.ts +++ b/src/utils/decoders/decodePart.ts @@ -1,5 +1,6 @@ import { isUtf8 } from './isUtf8'; +// TODO: Move to utils export const decodePart = (part: string) => { let decodedPart = part; diff --git a/src/utils/decoders/isAscii.ts b/src/utils/decoders/isAscii.ts index cc4c183..6ef84a6 100644 --- a/src/utils/decoders/isAscii.ts +++ b/src/utils/decoders/isAscii.ts @@ -1,2 +1,5 @@ -// eslint-disable-next-line no-control-regex -export const isAscii = (str: string) => !/[^\x00-\x7F]/gm.test(str); +// TODO: Move to utils +export function isAscii(str: string) { + // eslint-disable-next-line no-control-regex + return !/[^\x00-\x7F]/gm.test(str); +} diff --git a/src/utils/decoders/isUtf8.ts b/src/utils/decoders/isUtf8.ts index 9d08a13..f52a6aa 100644 --- a/src/utils/decoders/isUtf8.ts +++ b/src/utils/decoders/isUtf8.ts @@ -1,3 +1,4 @@ +// TODO: Move to utils export function isUtf8(str: string) { for (let i = 0; i < str.length; i++) { if (str.charCodeAt(i) > 127) { diff --git a/src/utils/decoders/stringContainsNumbers.ts b/src/utils/decoders/stringContainsNumbers.ts index fea36d6..1fdd4c5 100644 --- a/src/utils/decoders/stringContainsNumbers.ts +++ b/src/utils/decoders/stringContainsNumbers.ts @@ -1 +1,4 @@ -export const stringContainsNumbers = (str: string) => /\d/.test(str); +// TODO: Move to utils +export function stringContainsNumbers(str: string) { + return /\d/.test(str); +} diff --git a/src/utils/index.ts b/src/utils/index.ts index c4f7da4..b41d59f 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -3,7 +3,7 @@ export * from './asyncActions'; export * from './dateTime'; export * from './decoders'; export * from './operations'; -export * from './retryMultipleTimes'; +export * from './misc/retryMultipleTimes'; export * from './validation'; export * from './transactions'; export * from './walletconnect'; diff --git a/src/utils/misc/getAllStringOccurrences.ts b/src/utils/misc/getAllStringOccurrences.ts new file mode 100644 index 0000000..470226f --- /dev/null +++ b/src/utils/misc/getAllStringOccurrences.ts @@ -0,0 +1,17 @@ +// TODO: Move to utils +export function getAllStringOccurrences(sourceStr: string, searchStr: string) { + if (!sourceStr || !searchStr) { + return []; + } + + const startingIndices = []; + + let indexOccurrence = sourceStr.indexOf(searchStr, 0); + + while (indexOccurrence >= 0) { + startingIndices.push(indexOccurrence); + indexOccurrence = sourceStr.indexOf(searchStr, indexOccurrence + 1); + } + + return startingIndices; +} diff --git a/src/utils/misc/index.ts b/src/utils/misc/index.ts new file mode 100644 index 0000000..2769629 --- /dev/null +++ b/src/utils/misc/index.ts @@ -0,0 +1,2 @@ +export * from './getAllStringOccurrences'; +export * from './retryMultipleTimes'; diff --git a/src/utils/retryMultipleTimes.ts b/src/utils/misc/retryMultipleTimes.ts similarity index 67% rename from src/utils/retryMultipleTimes.ts rename to src/utils/misc/retryMultipleTimes.ts index 943cd5c..504ecea 100644 --- a/src/utils/retryMultipleTimes.ts +++ b/src/utils/misc/retryMultipleTimes.ts @@ -1,16 +1,16 @@ -import { sleep } from './asyncActions'; +import { sleep } from '../asyncActions'; interface Options { retries: number; delay?: number; } -const executeAsyncCall = async ( +async function executeAsyncCall( cb: (..._args: any[]) => any, options: Options, args: any[], retries = 0 -): Promise => { +): Promise { try { return await cb(...args); // eslint-disable-next-line @typescript-eslint/no-unused-vars @@ -25,13 +25,13 @@ const executeAsyncCall = async ( return null; } -}; +} -export const retryMultipleTimes = - ( - cb: (..._args: any[]) => any, - options: Options = { retries: 5, delay: 500 } - ) => - async (...args: any[]) => { +export function retryMultipleTimes( + cb: (..._args: any[]) => any, + options: Options = { retries: 5, delay: 500 } +) { + return async function (...args: any[]) { return await executeAsyncCall(cb, options, args); }; +} diff --git a/src/utils/misc/tests/getAllStringOccurences.test.ts b/src/utils/misc/tests/getAllStringOccurences.test.ts new file mode 100644 index 0000000..4003a3d --- /dev/null +++ b/src/utils/misc/tests/getAllStringOccurences.test.ts @@ -0,0 +1,42 @@ +import { getAllStringOccurrences } from '../getAllStringOccurrences'; + +describe('getAllStringOccurrences', () => { + test('basic functionality with single character', () => { + expect(getAllStringOccurrences('hello world', 'o')).toEqual([4, 7]); + }); + + test('case sensitivity', () => { + expect(getAllStringOccurrences('Hello World', 'o')).toEqual([4, 7]); + expect(getAllStringOccurrences('Hello World', 'O')).toEqual([]); + }); + + test('no occurrences', () => { + expect(getAllStringOccurrences('hello world', 'z')).toEqual([]); + }); + + test('multiple occurrences of substring', () => { + expect(getAllStringOccurrences('banana', 'ana')).toEqual([1, 3]); + }); + + test('overlapping occurrences', () => { + expect(getAllStringOccurrences('aaa', 'aa')).toEqual([0, 1]); + }); + + test('empty search string', () => { + expect(getAllStringOccurrences('hello', '')).toEqual([]); + }); + + test('empty source string', () => { + expect(getAllStringOccurrences('', 'hello')).toEqual([]); + }); + + test('entire string match', () => { + expect(getAllStringOccurrences('test', 'test')).toEqual([0]); + }); + + test('multiple character occurrences', () => { + expect(getAllStringOccurrences('test test test', 'test')).toEqual([ + 0, 5, 10 + ]); + }); +}); diff --git a/src/utils/operations/formatAmount.ts b/src/utils/operations/formatAmount.ts index a2b6213..fddcc44 100644 --- a/src/utils/operations/formatAmount.ts +++ b/src/utils/operations/formatAmount.ts @@ -15,6 +15,7 @@ export interface FormatAmountType { addCommas?: boolean; } +// TODO: Move to utils export function formatAmount({ input, decimals = DECIMALS, diff --git a/src/utils/operations/getUsdValue.ts b/src/utils/operations/getUsdValue.ts new file mode 100644 index 0000000..76bcfb9 --- /dev/null +++ b/src/utils/operations/getUsdValue.ts @@ -0,0 +1,20 @@ +export function getUsdValue({ + amount, + usd, + decimals = 2, + addEqualSign +}: { + amount: string; + usd: number; + decimals?: number; + addEqualSign?: boolean; +}) { + const sum = (parseFloat(amount) * usd).toFixed(decimals); + const formattedValue = parseFloat(sum).toLocaleString('en', { + maximumFractionDigits: decimals, + minimumFractionDigits: decimals + }); + const equalSign = parseFloat(amount) > 0 ? '≈' : '='; + const equalSignPrefix = addEqualSign ? `${equalSign} ` : ''; + return `${equalSignPrefix}$${formattedValue}`; +} diff --git a/src/utils/operations/index.ts b/src/utils/operations/index.ts index 5a1c31e..60fe8df 100644 --- a/src/utils/operations/index.ts +++ b/src/utils/operations/index.ts @@ -1,2 +1,3 @@ export * from './formatAmount'; +export * from './getUsdValue'; export * from './pipe'; diff --git a/src/utils/operations/pipe.ts b/src/utils/operations/pipe.ts index 97f28d0..e752058 100644 --- a/src/utils/operations/pipe.ts +++ b/src/utils/operations/pipe.ts @@ -1,3 +1,4 @@ +// TODO: Move to utils export function pipe(previous: ValueType) { return { if: function (condition: boolean) { diff --git a/src/utils/operations/tests/formatAmount.test.ts b/src/utils/operations/tests/formatAmount.test.ts index 68b187b..6d55119 100644 --- a/src/utils/operations/tests/formatAmount.test.ts +++ b/src/utils/operations/tests/formatAmount.test.ts @@ -1,247 +1,190 @@ import { formatAmount } from '../formatAmount'; -describe('format with 4,4', () => { - const numbers: { [key: string]: string } = { - '9999999999999999999999990000': '999,999,999,999,999,999,999,999', - '0': '0' - }; - const decimals = 4; - const digits = 4; - for (let i = 0; i < Object.keys(numbers).length; i++) { - const input = Object.keys(numbers)[i]; - const output = numbers[input]; - it(`format ${input} -> ${output}`, () => { +describe('formatAmount', () => { + describe('format with 4,4', () => { + test.each([ + ['9999999999999999999999990000', '999,999,999,999,999,999,999,999'], + ['0', '0'] + ])('format %s -> %s', (input, expected) => { const withCommas = formatAmount({ input, - decimals, - digits, + decimals: 4, + digits: 4, showLastNonZeroDecimal: false, addCommas: true }); - expect(withCommas).toBe(output); + expect(withCommas).toBe(expected); }); - } -}); + }); -describe('format with 8,4', () => { - const numbers: { [key: string]: string } = { - '9999999999999999999899996000': '99,999,999,999,999,999,998.9999', - '0': '0', - '10000': '0.0001' - }; - const decimals = 8; - const digits = 4; - for (let i = 0; i < Object.keys(numbers).length; i++) { - const input = Object.keys(numbers)[i]; - const output = numbers[input]; - it(`format ${input} -> ${output}`, () => { + describe('format with 8,4', () => { + test.each([ + ['9999999999999999999899996000', '99,999,999,999,999,999,998.9999'], + ['0', '0'], + ['10000', '0.0001'] + ])('format %s -> %s', (input, expected) => { const withCommas = formatAmount({ input, - decimals, - digits, + decimals: 8, + digits: 4, showLastNonZeroDecimal: false, addCommas: true }); - expect(withCommas).toBe(output); + expect(withCommas).toBe(expected); }); - } -}); + }); -describe('format with 0,0', () => { - const numbers: { [key: string]: string } = { - '350': '350' - }; - const decimals = 0; - const digits = 0; - for (let i = 0; i < Object.keys(numbers).length; i++) { - const input = Object.keys(numbers)[i]; - const output = numbers[input]; - it(`format ${input} -> ${output}`, () => { + describe('format with 0,0', () => { + test.each([['350', '350']])('format %s -> %s', (input, expected) => { const withCommas = formatAmount({ input, - decimals, - digits, + decimals: 0, + digits: 0, showLastNonZeroDecimal: false }); - expect(withCommas).toBe(output); + expect(withCommas).toBe(expected); }); - } -}); + }); -describe('format with 4,8,true', () => { - const numbers: { [key: string]: string } = { - '12345678901234567890123': '123,456,789,012,345.67890123' - }; - const decimals = 8; - const digits = 4; - for (let i = 0; i < Object.keys(numbers).length; i++) { - const input = Object.keys(numbers)[i]; - const output = numbers[input]; - it(`format ${input} -> ${output}`, () => { - const withCommas = formatAmount({ - input, - decimals, - digits, - showLastNonZeroDecimal: true, - addCommas: true - }); - expect(withCommas).toBe(output); - }); - } -}); + describe('format with 4,8,true', () => { + test.each([['12345678901234567890123', '123,456,789,012,345.67890123']])( + 'format %s -> %s', + (input, expected) => { + const withCommas = formatAmount({ + input, + decimals: 8, + digits: 4, + showLastNonZeroDecimal: true, + addCommas: true + }); + expect(withCommas).toBe(expected); + } + ); + }); -describe('format with 18,0,true', () => { - const numbers: { [key: string]: string } = { - '102000000000000000': '0.102', - '100000000000000000': '0.1', - '1000000000000000000': '1' - }; - const decimals = 18; - const digits = 0; - for (let i = 0; i < Object.keys(numbers).length; i++) { - const input = Object.keys(numbers)[i]; - const output = numbers[input]; - it(`format ${input} -> ${output}`, () => { + describe('format with 18,0,true', () => { + test.each([ + ['102000000000000000', '0.102'], + ['100000000000000000', '0.1'], + ['1000000000000000000', '1'] + ])('format %s -> %s', (input, expected) => { const withCommas = formatAmount({ input, - decimals, - digits, + decimals: 18, + digits: 0, showLastNonZeroDecimal: true }); - expect(withCommas).toBe(output); + expect(withCommas).toBe(expected); }); - } -}); + }); -describe('format with float throws error', () => { - const numbers: { [key: string]: string } = { - '0.015': 'Throws error', - '01000000000000000000': 'Throws error' - }; - const decimals = 18; - const digits = 4; - for (let i = 0; i < Object.keys(numbers).length; i++) { - const input = Object.keys(numbers)[i]; - const output = numbers[input]; - it(`format ${input} -> ${output}`, () => { - let err = ''; - try { - formatAmount({ - input, - decimals, - digits, - addCommas: false, - showLastNonZeroDecimal: true - }); - expect(err).toBeInstanceOf(Error); - } catch (error) { - err = error as any; - expect(err).toBeInstanceOf(Error); - expect(error).toHaveProperty('message', 'Invalid input'); + describe('format with float throws error', () => { + test.each([['0.015'], ['01000000000000000000']])( + 'format %s throws error', + (input) => { + expect(() => { + formatAmount({ + input, + decimals: 18, + digits: 4, + addCommas: false, + showLastNonZeroDecimal: true + }); + }).toThrow('Invalid input'); } - }); - } -}); + ); + }); -describe('format with negative', () => { - const numbers: { [key: string]: string } = { - '-922506751086064008': '-0.922506751086064008', - '-578345000000000000000': '-578.3450', - '-1578345000000000000000': '-1,578.3450', - '-3456000000000000000': '-3.4560' - }; - const decimals = 18; - const digits = 4; - for (let i = 0; i < Object.keys(numbers).length; i++) { - const input = Object.keys(numbers)[i]; - const output = numbers[input]; - it(`format ${input} -> ${output}`, () => { + describe('format with negative', () => { + test.each([ + ['-922506751086064008', '-0.922506751086064008'], + ['-578345000000000000000', '-578.3450'], + ['-1578345000000000000000', '-1,578.3450'], + ['-3456000000000000000', '-3.4560'] + ])('format %s -> %s', (input, expected) => { const withCommas = formatAmount({ input, - decimals, - digits, + decimals: 18, + digits: 4, showLastNonZeroDecimal: true, addCommas: true }); - expect(withCommas).toBe(output); + expect(withCommas).toBe(expected); }); - } -}); + }); -describe('format with single tests', () => { - it('should show less than if decimal amount is too low', () => { - const result = formatAmount({ - input: (100_000_000_000_000).toString(), - digits: 2, - showIsLessThanDecimalsLabel: true, - showLastNonZeroDecimal: false + describe('format with single tests', () => { + test('should show less than if decimal amount is too low', () => { + const result = formatAmount({ + input: (100_000_000_000_000).toString(), + digits: 2, + showIsLessThanDecimalsLabel: true, + showLastNonZeroDecimal: false + }); + expect(result).toBe('<0.01'); }); - expect(result).toBe('<0.01'); - }); - it('should not show digits when result is below 1', () => { - const result = formatAmount({ - input: (100_000_000_000_000).toString(), - showLastNonZeroDecimal: false, - digits: 2 + + test('should not show digits when result is below 1', () => { + const result = formatAmount({ + input: (100_000_000_000_000).toString(), + showLastNonZeroDecimal: false, + digits: 2 + }); + expect(result).toBe('0'); }); - expect(result).toBe('0'); - }); - it('should show zero digits for integers with decimal amount too low', () => { - const result = formatAmount({ - input: ['1', '000', '000', '001', '000', '000', '000', '000'].join(''), - digits: 2, - showLastNonZeroDecimal: false + + test('should show zero digits for integers with decimal amount too low', () => { + const result = formatAmount({ + input: ['1', '000', '000', '001', '000', '000', '000', '000'].join(''), + digits: 2, + showLastNonZeroDecimal: false + }); + expect(result).toBe('1000.00'); }); - expect(result).toBe('1000.00'); - }); - it('should show a valid number if showLastNonZeroDecimal is set', () => { - const result = formatAmount({ - input: (1_000_000_000).toString(), - digits: 4, - showLastNonZeroDecimal: true + + test('should show a valid number if showLastNonZeroDecimal is set', () => { + const result = formatAmount({ + input: (1_000_000_000).toString(), + digits: 4, + showLastNonZeroDecimal: true + }); + expect(result).toBe('0.000000001'); }); - expect(result).toBe('0.000000001'); - }); - it('should show remove digits and not add commas', () => { - const result = formatAmount({ - input: '369884288127092846270928', - digits: 4, - showLastNonZeroDecimal: false, - addCommas: false + test('should show remove digits and not add commas', () => { + const result = formatAmount({ + input: '369884288127092846270928', + digits: 4, + showLastNonZeroDecimal: false, + addCommas: false + }); + expect(result).toBe('369884.2881'); }); - expect(result).toBe('369884.2881'); - }); - it('should not add . at the end for 0 digits', () => { - const result = formatAmount({ - input: '369884288127092846270928', - digits: 0, - showLastNonZeroDecimal: false, - addCommas: false + test('should not add . at the end for 0 digits', () => { + const result = formatAmount({ + input: '369884288127092846270928', + digits: 0, + showLastNonZeroDecimal: false, + addCommas: false + }); + expect(result).toBe('369884'); }); - expect(result).toBe('369884'); }); describe('should show all 4 digits', () => { - const numbers: { [key: string]: string } = { - '995000000000000000': '0.9950' - }; - const decimals = 18; - const digits = 4; - for (let i = 0; i < Object.keys(numbers).length; i++) { - const input = Object.keys(numbers)[i]; - const output = numbers[input]; - it(`format ${input} -> ${output}`, () => { + test.each([['995000000000000000', '0.9950']])( + 'format %s -> %s', + (input, expected) => { const withCommas = formatAmount({ input, - decimals, - digits, + decimals: 18, + digits: 4, showLastNonZeroDecimal: true, addCommas: true }); - expect(withCommas).toBe(output); - }); - } + expect(withCommas).toBe(expected); + } + ); }); }); diff --git a/src/utils/operations/tests/getUsdValue.test.ts b/src/utils/operations/tests/getUsdValue.test.ts new file mode 100644 index 0000000..927d6f4 --- /dev/null +++ b/src/utils/operations/tests/getUsdValue.test.ts @@ -0,0 +1,23 @@ +import { getUsdValue } from '../getUsdValue'; + +describe('getUsdValue tests', () => { + it('formats amount', () => { + expect( + getUsdValue({ + amount: '2', + usd: 40, + decimals: 4, + addEqualSign: true + }) + ).toBe('≈ $80.0000'); + }); + it('shows = for 0', () => { + expect( + getUsdValue({ + amount: '0', + usd: 40, + addEqualSign: true + }) + ).toBe('= $0.00'); + }); +}); diff --git a/src/utils/transactions/batch/getBatchTransactionsStatusFromApi.ts b/src/utils/transactions/batch/getBatchTransactionsStatusFromApi.ts index 970ca1e..373d5c9 100644 --- a/src/utils/transactions/batch/getBatchTransactionsStatusFromApi.ts +++ b/src/utils/transactions/batch/getBatchTransactionsStatusFromApi.ts @@ -1,9 +1,9 @@ import axios from 'axios'; import { TRANSACTIONS_BATCH } from 'apiCalls'; -import { BatchTransactionsResponseType } from 'types'; +import { TIMEOUT } from 'constants/index'; import { networkSelector } from 'store/selectors'; import { getState } from 'store/store'; -import { TIMEOUT } from 'constants/index'; +import { BatchTransactionsResponseType } from 'types'; export interface SendBatchTransactionsParamsType { batchId: string; diff --git a/src/utils/transactions/batch/tests/getTransactionsStatus.test.ts b/src/utils/transactions/batch/tests/getTransactionsStatus.test.ts index e497046..349869f 100644 --- a/src/utils/transactions/batch/tests/getTransactionsStatus.test.ts +++ b/src/utils/transactions/batch/tests/getTransactionsStatus.test.ts @@ -1,5 +1,5 @@ -import { getTransactionsStatus } from '../getTransactionsStatus'; import { TransactionServerStatusesEnum } from 'types'; +import { getTransactionsStatus } from '../getTransactionsStatus'; describe('getTransactionsStatus', () => { it('should identify all transactions as successful', () => { diff --git a/src/utils/transactions/batch/tests/sendBatchTransactions.test.ts b/src/utils/transactions/batch/tests/sendBatchTransactions.test.ts deleted file mode 100644 index 54e5edf..0000000 --- a/src/utils/transactions/batch/tests/sendBatchTransactions.test.ts +++ /dev/null @@ -1,215 +0,0 @@ -import { addressSelector } from 'reduxStore/selectors'; -import { store } from 'reduxStore/store'; -import { getWindowLocation } from 'utils/window/getWindowLocation'; -import { sendBatchTransactions } from '../sendBatchTransactions'; -import { signTransactions } from '../operations/signTransactions'; -import { transformTransactionsToSign } from './utils/transformTransactionsToSign'; - -jest.mock('reduxStore/selectors', () => ({ - addressSelector: jest.fn() -})); - -jest.mock('reduxStore/store', () => ({ - store: { - getState: jest.fn() - } -})); - -jest.mock('utils/window/getWindowLocation', () => ({ - getWindowLocation: jest.fn() -})); - -jest.mock('../operations/signTransactions', () => ({ - signTransactions: jest.fn() -})); - -jest.mock('./utils/transformTransactionsToSign', () => ({ - transformTransactionsToSign: jest.fn() -})); - -describe('sendBatchTransactions', () => { - beforeEach(() => { - jest.clearAllMocks(); - }); - - it('should call all the dependencies and return the expected result', async () => { - const address = - 'erd1axhx4kenjlae6sknq7zjg2g4fvzavv979r2fg425p62wkl84avtqsf7vvv'; - const sessionId = '12345'; - const transactions = [ - [ - { - receiver: address, - sender: address, - value: '0', - data: '1' - }, - { - receiver: address, - sender: address, - value: '0', - data: '2' - } - ], - [ - { - receiver: address, - sender: address, - value: '0', - data: '3' - } - ], - [ - { - receiver: address, - sender: address, - value: '0', - data: '4' - }, - { - receiver: address, - sender: address, - value: '0', - data: '5' - }, - { - receiver: address, - sender: address, - value: '0', - data: '6' - } - ] - ]; - const transactionsDisplayInfo = {}; - const callbackRoute = '/callback'; - const minGasLimit = 21000; - - // Mock the dependencies - (addressSelector as unknown as jest.Mock).mockReturnValue(address); - // eslint-disable-next-line @typescript-eslint/no-empty-function - (store.getState as unknown as jest.Mock).mockReturnValue(() => {}); - (getWindowLocation as unknown as jest.Mock).mockReturnValue({ - pathname: callbackRoute - }); - (signTransactions as unknown as jest.Mock).mockResolvedValue({ sessionId }); - (transformTransactionsToSign as unknown as jest.Mock).mockResolvedValue([]); - - const result = await sendBatchTransactions({ - transactions, - transactionsDisplayInfo, - minGasLimit - }); - - expect(addressSelector).toHaveBeenCalled(); - expect(store.getState).toHaveBeenCalled(); - expect(getWindowLocation).toHaveBeenCalled(); - expect(transformTransactionsToSign).toHaveBeenCalledWith({ - transactions: expect.any(Array), - minGasLimit - }); - expect(signTransactions).toHaveBeenCalledWith({ - transactions: expect.any(Array), - minGasLimit, - callbackRoute, - transactionsDisplayInfo, - customTransactionInformation: { - grouping: expect.any(Array), - redirectAfterSign: true, - completedTransactionsDelay: undefined, - sessionInformation: undefined, - skipGuardian: undefined, - signWithoutSending: false - } - }); - - expect(result).toEqual({ - error: undefined, - batchId: `${sessionId}-${address}` - }); - }); - - it('should prepare the grouping field with the indexes from the flat transactions array', async () => { - const address = - 'erd1axhx4kenjlae6sknq7zjg2g4fvzavv979r2fg425p62wkl84avtqsf7vvv'; - const sessionId = '12345'; - const transactions = [ - [ - { - receiver: address, - sender: address, - value: '0', - data: '1' - }, - { - receiver: address, - sender: address, - value: '0', - data: '2' - } - ], - [ - { - receiver: address, - sender: address, - value: '0', - data: '3' - } - ], - [ - { - receiver: address, - sender: address, - value: '0', - data: '4' - }, - { - receiver: address, - sender: address, - value: '0', - data: '5' - }, - { - receiver: address, - sender: address, - value: '0', - data: '6' - } - ] - ]; - const transactionsDisplayInfo = {}; // Your test display info - const callbackRoute = '/callback'; - const minGasLimit = 21000; - - // Mock the dependencies - (addressSelector as unknown as jest.Mock).mockReturnValue(address); - (store.getState as unknown as jest.Mock).mockReturnValue({}); - (getWindowLocation as unknown as jest.Mock).mockReturnValue({ - pathname: callbackRoute - }); - (signTransactions as unknown as jest.Mock).mockResolvedValue({ sessionId }); - (transformTransactionsToSign as unknown as jest.Mock).mockResolvedValue( - transactions - ); - - await sendBatchTransactions({ - transactions, - transactionsDisplayInfo, - minGasLimit - }); - - expect(signTransactions).toHaveBeenCalledWith({ - transactions, - minGasLimit, - callbackRoute, - transactionsDisplayInfo, - customTransactionInformation: { - grouping: [[0, 1], [2], [3, 4, 5]], - redirectAfterSign: true, - completedTransactionsDelay: undefined, - sessionInformation: undefined, - skipGuardian: undefined, - signWithoutSending: false - } - }); - }); -}); diff --git a/src/utils/transactions/dataDecoders/decodeTransactionData/helpers/decodeByMethod.ts b/src/utils/transactions/dataDecoders/decodeTransactionData/helpers/decodeByMethod.ts index f0363cd..de1d38d 100644 --- a/src/utils/transactions/dataDecoders/decodeTransactionData/helpers/decodeByMethod.ts +++ b/src/utils/transactions/dataDecoders/decodeTransactionData/helpers/decodeByMethod.ts @@ -13,9 +13,10 @@ export function decodeByMethod( case DecodeMethodEnum.text: try { return Buffer.from(part, 'hex').toString('utf8'); - } catch {} + } catch { + return part; + } - return part; case DecodeMethodEnum.decimal: return part !== '' ? new BigNumber(part, 16).toString(10) : ''; case DecodeMethodEnum.smart: @@ -25,7 +26,9 @@ export function decodeByMethod( if (addressIsValid(bech32Encoded)) { return bech32Encoded; } - } catch {} + } catch (e) { + console.info('Decoded data is not an address: ', e); + } try { const decoded = Buffer.from(part, 'hex').toString('utf8'); @@ -48,9 +51,9 @@ export function decodeByMethod( } else { return decoded; } - } catch {} - - return part; + } catch { + return part; + } case DecodeMethodEnum.raw: default: return part; diff --git a/src/utils/transactions/dataDecoders/decodeTransactionData/helpers/getSmartDecodedParts.ts b/src/utils/transactions/dataDecoders/decodeTransactionData/helpers/getSmartDecodedParts.ts index 9989afd..edd57ea 100644 --- a/src/utils/transactions/dataDecoders/decodeTransactionData/helpers/getSmartDecodedParts.ts +++ b/src/utils/transactions/dataDecoders/decodeTransactionData/helpers/getSmartDecodedParts.ts @@ -1,4 +1,5 @@ -import { DecodeMethodEnum, TransactionTypesEnum } from 'types'; +import { TransactionTypesEnum } from 'types'; +import { DecodeMethodEnum } from 'types/serverTransactions.types'; import { decodeByMethod } from './decodeByMethod'; interface SmartDecodedPartsType { diff --git a/src/utils/transactions/dataDecoders/decodeTransactionData/tests/decodeByMethod.spec.ts b/src/utils/transactions/dataDecoders/decodeTransactionData/tests/decodeByMethod.spec.ts index 581370c..b864943 100644 --- a/src/utils/transactions/dataDecoders/decodeTransactionData/tests/decodeByMethod.spec.ts +++ b/src/utils/transactions/dataDecoders/decodeTransactionData/tests/decodeByMethod.spec.ts @@ -1,7 +1,7 @@ import { Address } from '@multiversx/sdk-core/out'; -import { DecodeMethodEnum } from 'types'; -import { addressIsValid } from 'utils/account/addressIsValid'; +import { DecodeMethodEnum } from 'types/serverTransactions.types'; import { isUtf8 } from 'utils/decoders'; +import { addressIsValid } from 'utils/validation'; import { decodeByMethod } from '../helpers'; jest.mock('@multiversx/sdk-core/out', () => ({ @@ -10,8 +10,8 @@ jest.mock('@multiversx/sdk-core/out', () => ({ } })); -jest.mock('utils/account/addressIsValid'); -jest.mock('utils/decoders'); +jest.mock('utils/validation/addressIsValid'); +jest.mock('utils/decoders/isUtf8'); describe('decodeByMethod', () => { beforeEach(() => { @@ -88,15 +88,16 @@ describe('decodeByMethod', () => { DecodeMethodEnum.smart, mockTokens ); + expect(result).toBe('token1'); }); - it('should convert to decimal when no other conditions met', () => { + it('should return the string unchanged', () => { (Address.fromHex as jest.Mock).mockImplementation(() => { throw new Error(); }); - (isUtf8 as jest.Mock).mockReturnValue(false); + (isUtf8 as jest.Mock).mockReturnValue(false); const result = decodeByMethod('a', DecodeMethodEnum.smart); expect(result).toBe('10'); }); diff --git a/src/utils/transactions/dataDecoders/decodeTransactionData/tests/decodeForDisplay.spec.ts b/src/utils/transactions/dataDecoders/decodeTransactionData/tests/decodeForDisplay.spec.ts index ff8127d..047b923 100644 --- a/src/utils/transactions/dataDecoders/decodeTransactionData/tests/decodeForDisplay.spec.ts +++ b/src/utils/transactions/dataDecoders/decodeTransactionData/tests/decodeForDisplay.spec.ts @@ -1,4 +1,7 @@ -import { DecodeMethodEnum, DecodeForDisplayParamsType } from 'types'; +import { + DecodeForDisplayParamsType, + DecodeMethodEnum +} from '../../../../../types/serverTransactions.types'; import { decodeTransactionData } from '../decodeTransactionData'; import { decodeByMethod, diff --git a/src/utils/transactions/dataDecoders/decodeTransactionData/tests/getDisplayValueAndValidationWarnings.spec.ts b/src/utils/transactions/dataDecoders/decodeTransactionData/tests/getDisplayValueAndValidationWarnings.spec.ts index 2617bf4..8a94ac5 100644 --- a/src/utils/transactions/dataDecoders/decodeTransactionData/tests/getDisplayValueAndValidationWarnings.spec.ts +++ b/src/utils/transactions/dataDecoders/decodeTransactionData/tests/getDisplayValueAndValidationWarnings.spec.ts @@ -1,4 +1,7 @@ -import { DecodeMethodEnum, DecodedDisplayType } from 'types'; +import { + DecodedDisplayType, + DecodeMethodEnum +} from 'types/serverTransactions.types'; import { decodeByMethod, getHexValidationWarnings, diff --git a/src/utils/transactions/dataDecoders/decodeTransactionData/tests/getSmartDecodedParts.spec.ts b/src/utils/transactions/dataDecoders/decodeTransactionData/tests/getSmartDecodedParts.spec.ts index d4ad1d1..2193220 100644 --- a/src/utils/transactions/dataDecoders/decodeTransactionData/tests/getSmartDecodedParts.spec.ts +++ b/src/utils/transactions/dataDecoders/decodeTransactionData/tests/getSmartDecodedParts.spec.ts @@ -1,4 +1,5 @@ -import { DecodeMethodEnum, TransactionTypesEnum } from 'types'; +import { TransactionTypesEnum } from 'types'; +import { DecodeMethodEnum } from '../../../../../types/serverTransactions.types'; import { decodeByMethod, getSmartDecodedParts } from '../helpers'; jest.mock('../helpers/decodeByMethod'); @@ -34,6 +35,7 @@ describe('getSmartDecodedParts', () => { 'hexValue', DecodeMethodEnum.decimal ); + expect(result).toEqual(['decoded1', 'decoded2', mockDecodedValue]); }); diff --git a/src/utils/transactions/dataDecoders/getTokenFromData.ts b/src/utils/transactions/dataDecoders/getTokenFromData.ts index 104f056..edd711a 100644 --- a/src/utils/transactions/dataDecoders/getTokenFromData.ts +++ b/src/utils/transactions/dataDecoders/getTokenFromData.ts @@ -1,7 +1,7 @@ import { Address } from '@multiversx/sdk-core'; import BigNumber from 'bignumber.js'; -import { decodePart } from '../../decoders'; import { TransactionTypesEnum } from '../../../types'; +import { decodePart } from '../../decoders'; import { addressIsValid } from '../../validation'; const noData = { @@ -74,7 +74,9 @@ export function getTokenFromData(data?: string): { receiver: new Address(receiver).bech32() }; } - } catch (err) {} + } catch (e) { + console.error('Error getting NFT from transaction data', e); + } } if (isNftBurn) { @@ -88,7 +90,9 @@ export function getTokenFromData(data?: string): { nonce }; } - } catch (err) {} + } catch (e) { + console.error('Error getting NFT from transaction data', e); + } } return noData; diff --git a/src/utils/transactions/index.ts b/src/utils/transactions/index.ts index 636aa12..4780a49 100644 --- a/src/utils/transactions/index.ts +++ b/src/utils/transactions/index.ts @@ -2,5 +2,4 @@ export * from './batch'; export * from './dataDecoders'; export * from './operations'; export * from './parsers'; -export * from './url'; export * from './validation'; diff --git a/src/utils/transactions/operations/calculateFeeInFiat.ts b/src/utils/transactions/operations/calculateFeeInFiat.ts new file mode 100644 index 0000000..bfeabf5 --- /dev/null +++ b/src/utils/transactions/operations/calculateFeeInFiat.ts @@ -0,0 +1,33 @@ +import { DIGITS, DECIMALS } from 'constants/index'; +import { formatAmount, getUsdValue } from '../../operations'; + +export interface CalculateFeeInFiatParamsType { + feeLimit: string; + egldPriceInUsd: number; + hideEqualSign?: boolean; +} + +export function calculateFeeInFiat({ + feeLimit, + egldPriceInUsd, + hideEqualSign +}: CalculateFeeInFiatParamsType) { + const amount = formatAmount({ + input: feeLimit, + decimals: DECIMALS, + digits: DIGITS, + showLastNonZeroDecimal: true + }); + + const feeAsUsdValue = getUsdValue({ + amount, + usd: egldPriceInUsd, + decimals: DIGITS + }); + + if (hideEqualSign) { + return feeAsUsdValue; + } + + return `≈ ${feeAsUsdValue}`; +} diff --git a/src/utils/transactions/operations/calculateFeeLimit.ts b/src/utils/transactions/operations/calculateFeeLimit.ts new file mode 100755 index 0000000..81a14fb --- /dev/null +++ b/src/utils/transactions/operations/calculateFeeLimit.ts @@ -0,0 +1,76 @@ +import { + Transaction, + TransactionPayload, + TransactionVersion, + Address, + TokenPayment +} from '@multiversx/sdk-core'; +import BigNumber from 'bignumber.js'; +import { + EXTRA_GAS_LIMIT_GUARDED_TX, + GAS_LIMIT, + GAS_PRICE, + ZERO +} from 'constants/index'; +import { stringIsFloat, stringIsInteger } from 'utils/validation'; +import { isGuardianTx } from '../validation'; + +export interface CalculateFeeLimitType { + gasLimit: string; + gasPrice: string; + data: string; + gasPerDataByte: string; + gasPriceModifier: string; + chainId: string; + minGasLimit?: string; + defaultGasPrice?: string; +} +const placeholderData = { + from: 'erd12dnfhej64s6c56ka369gkyj3hwv5ms0y5rxgsk2k7hkd2vuk7rvqxkalsa', + to: 'erd12dnfhej64s6c56ka369gkyj3hwv5ms0y5rxgsk2k7hkd2vuk7rvqxkalsa' +}; +export function calculateFeeLimit({ + minGasLimit = String(GAS_LIMIT), + gasLimit, + gasPrice, + data: inputData, + gasPerDataByte, + gasPriceModifier, + defaultGasPrice = String(GAS_PRICE), + chainId +}: CalculateFeeLimitType) { + const data = inputData || ''; + const validGasLimit = stringIsInteger(gasLimit) ? gasLimit : minGasLimit; + + // We need to add extra gas fee for guardian transactions + const extraGasLimit = isGuardianTx({ data }) ? EXTRA_GAS_LIMIT_GUARDED_TX : 0; + const usedGasLimit = new BigNumber(validGasLimit) + .plus(extraGasLimit) + .toNumber(); + + const validGasPrice = stringIsFloat(gasPrice) ? gasPrice : defaultGasPrice; + const transaction = new Transaction({ + nonce: 0, + value: TokenPayment.egldFromAmount('0'), + receiver: new Address(placeholderData.to), + sender: new Address(placeholderData.to), + gasPrice: parseInt(validGasPrice), + gasLimit: usedGasLimit, + data: new TransactionPayload(data.trim()), + chainID: chainId, + version: new TransactionVersion(1) + }); + + try { + const bNfee = transaction.computeFee({ + GasPerDataByte: parseInt(gasPerDataByte), + MinGasLimit: parseInt(minGasLimit), + GasPriceModifier: parseFloat(gasPriceModifier), + ChainID: chainId + }); + return bNfee.toString(10); + } catch (err) { + console.error(err); + return ZERO; + } +} diff --git a/src/utils/transactions/calculateTotalTransactionsFee.ts b/src/utils/transactions/operations/calculateTotalTransactionsFee.ts similarity index 93% rename from src/utils/transactions/calculateTotalTransactionsFee.ts rename to src/utils/transactions/operations/calculateTotalTransactionsFee.ts index a4d2fdb..21a785b 100644 --- a/src/utils/transactions/calculateTotalTransactionsFee.ts +++ b/src/utils/transactions/operations/calculateTotalTransactionsFee.ts @@ -1,7 +1,7 @@ import { Transaction } from '@multiversx/sdk-core/out'; import BigNumber from 'bignumber.js'; import { GAS_PER_DATA_BYTE, GAS_PRICE_MODIFIER } from 'constants/index'; -import { calculateFeeLimit } from './operations'; +import { calculateFeeLimit } from './calculateFeeLimit'; export function calcTotalFee(transactions: Transaction[], minGasLimit: number) { let totalFee = new BigNumber(0); diff --git a/src/utils/transactions/operations/index.ts b/src/utils/transactions/operations/index.ts new file mode 100644 index 0000000..ca95564 --- /dev/null +++ b/src/utils/transactions/operations/index.ts @@ -0,0 +1,2 @@ +export * from './calculateFeeLimit'; +export * from './calculateTotalTransactionsFee'; diff --git a/src/utils/transactions/operations/tests/calculateFeeInFiat.test.ts b/src/utils/transactions/operations/tests/calculateFeeInFiat.test.ts new file mode 100644 index 0000000..1d8257a --- /dev/null +++ b/src/utils/transactions/operations/tests/calculateFeeInFiat.test.ts @@ -0,0 +1,11 @@ +import { calculateFeeInFiat } from '../calculateFeeInFiat'; + +describe('calculateFeeInFiat tests', () => { + it('computes correct fee in fiat', () => { + const fee = calculateFeeInFiat({ + feeLimit: '50000000000000', + egldPriceInUsd: 135.78 + }); + expect(fee).toBe('≈ $0.0068'); + }); +}); diff --git a/src/utils/transactions/operations/tests/calculateFeeLimit.test.ts b/src/utils/transactions/operations/tests/calculateFeeLimit.test.ts new file mode 100644 index 0000000..415ffb8 --- /dev/null +++ b/src/utils/transactions/operations/tests/calculateFeeLimit.test.ts @@ -0,0 +1,96 @@ +import { GAS_PER_DATA_BYTE, GAS_PRICE_MODIFIER } from 'constants/index'; +import { calculateFeeLimit } from '../calculateFeeLimit'; + +describe('calculateFeeLimit tests', () => { + it('computes correct fee', () => { + const feeLimit = calculateFeeLimit({ + gasLimit: '62000', + gasPrice: '1000000000', + data: 'testdata', + chainId: 'T', + gasPerDataByte: String(GAS_PER_DATA_BYTE), + gasPriceModifier: String(GAS_PRICE_MODIFIER) + }); + expect(feeLimit).toBe('62000000000000'); + }); + + it('computes correct fee for data field with more parameters', () => { + const feeLimit = calculateFeeLimit({ + gasLimit: '11100000', + gasPrice: '1000000000', + data: 'bid@0d59@43525a502d333663366162@25', + gasPerDataByte: String(GAS_PER_DATA_BYTE), + gasPriceModifier: String(GAS_PRICE_MODIFIER), + defaultGasPrice: '1000000000', + chainId: 'T' + }); + + expect(feeLimit).toBe('210990000000000'); + }); + + it('computes correct fee for SetGuardian tx', () => { + const feeLimit = calculateFeeLimit({ + gasLimit: '', + gasPrice: (1_000_000).toString(), + data: 'SetGuardian@qwerty@12345', + chainId: 'T', + gasPerDataByte: '1', + gasPriceModifier: '1' + }); + + expect(feeLimit).toBe((100_000_000_000).toString()); // (minGasLimit + extra guardian gas) * gasPrice + }); + + it('computes correct fee for GuardAccount tx', () => { + const feeLimit = calculateFeeLimit({ + gasLimit: '', + gasPrice: (1_000_000).toString(), + data: 'GuardAccount@qwerty@12345', + chainId: 'T', + gasPerDataByte: '1', + gasPriceModifier: '1' + }); + + expect(feeLimit).toBe((100_000_000_000).toString()); // (minGasLimit + extra guardian gas) * gasPrice + }); + + it('computes correct fee for UnGuardAccount tx', () => { + const feeLimit = calculateFeeLimit({ + gasLimit: '', + gasPrice: (1_000_000).toString(), + data: 'UnGuardAccount@qwerty@12345', + chainId: 'T', + gasPerDataByte: '1', + gasPriceModifier: '1' + }); + + expect(feeLimit).toBe((100_000_000_000).toString()); // (minGasLimit + extra guardian gas) * gasPrice + }); + + it('computes correct fee for UnGuardAccount tx and gas limit specified', () => { + const feeLimit = calculateFeeLimit({ + gasLimit: (1_000_000).toString(), + gasPrice: (1_000_000).toString(), + data: 'UnGuardAccount@qwerty@12345', + chainId: 'T', + gasPerDataByte: '1', + gasPriceModifier: '1' + }); + + expect(feeLimit).toBe((1_050_000_000_000).toString()); // (gasLimit + extra guardian gas) * gasPrice + }); + + it('computes correct fee for UnGuardAccount tx and min gas limit specified', () => { + const feeLimit = calculateFeeLimit({ + gasLimit: '', + minGasLimit: (1_000_000).toString(), + gasPrice: (1_000_000).toString(), + data: 'UnGuardAccount@qwerty@12345', + chainId: 'T', + gasPerDataByte: '1', + gasPriceModifier: '1' + }); + + expect(feeLimit).toBe((1_050_000_000_000).toString()); // (minGasLimit + extra guardian gas) * gasPrice + }); +}); diff --git a/src/utils/transactions/parsers/getInterpretedTransaction/constants.ts b/src/utils/transactions/parsers/getInterpretedTransaction/constants.ts index 2b7231b..20dd6f6 100644 --- a/src/utils/transactions/parsers/getInterpretedTransaction/constants.ts +++ b/src/utils/transactions/parsers/getInterpretedTransaction/constants.ts @@ -1,4 +1,4 @@ -import { TransactionActionsEnum } from 'types'; +import { TransactionActionsEnum } from 'types/serverTransactions.types'; /** * If `action.name` or `function` is in `ACTIONS_WITH_MANDATORY_OPERATIONS[]`, transaction value will be computed based `operations` field diff --git a/src/utils/transactions/parsers/getInterpretedTransaction/getInterpretedTransaction.ts b/src/utils/transactions/parsers/getInterpretedTransaction/getInterpretedTransaction.ts index c8039ea..2b106a6 100644 --- a/src/utils/transactions/parsers/getInterpretedTransaction/getInterpretedTransaction.ts +++ b/src/utils/transactions/parsers/getInterpretedTransaction/getInterpretedTransaction.ts @@ -1,6 +1,8 @@ -import { InterpretedTransactionType, ServerTransactionType } from 'types'; -import { TokenArgumentType } from 'types'; -import { isContract } from '../../dataDecoders/smartContractTransaction'; +import { + InterpretedTransactionType, + ServerTransactionType, + TokenArgumentType +} from 'types/serverTransactions.types'; import { getTokenFromData } from 'utils/transactions/dataDecoders/getTokenFromData'; import { getExplorerLink, @@ -11,6 +13,7 @@ import { getTransactionTransferType, explorerUrlBuilder } from './helpers'; +import { isContract } from '../../dataDecoders'; export interface GetInterpretedTransactionType { address: string; diff --git a/src/utils/transactions/parsers/getInterpretedTransaction/helpers/getTransactionMethod.ts b/src/utils/transactions/parsers/getInterpretedTransaction/helpers/getTransactionMethod.ts index 37c598f..5b2e50f 100644 --- a/src/utils/transactions/parsers/getInterpretedTransaction/helpers/getTransactionMethod.ts +++ b/src/utils/transactions/parsers/getInterpretedTransaction/helpers/getTransactionMethod.ts @@ -2,7 +2,7 @@ import { TransactionActionCategoryEnum, TransactionActionsEnum, ServerTransactionType -} from 'types'; +} from 'types/serverTransactions.types'; export function getTransactionMethod(transaction: ServerTransactionType) { let transactionAction = 'Transaction'; diff --git a/src/utils/transactions/parsers/getInterpretedTransaction/helpers/getTransactionTransferType.ts b/src/utils/transactions/parsers/getInterpretedTransaction/helpers/getTransactionTransferType.ts index f08d8d8..775bdf9 100644 --- a/src/utils/transactions/parsers/getInterpretedTransaction/helpers/getTransactionTransferType.ts +++ b/src/utils/transactions/parsers/getInterpretedTransaction/helpers/getTransactionTransferType.ts @@ -2,7 +2,7 @@ import { ServerTransactionType, TransferTypeEnum, TransactionDirectionEnum -} from 'types'; +} from 'types/serverTransactions.types'; export function getTransactionTransferType( address: string, diff --git a/src/utils/transactions/parsers/getInterpretedTransaction/helpers/getTransactionValue/getTransactionValue.ts b/src/utils/transactions/parsers/getInterpretedTransaction/helpers/getTransactionValue/getTransactionValue.ts index a58b467..57762e1 100644 --- a/src/utils/transactions/parsers/getInterpretedTransaction/helpers/getTransactionValue/getTransactionValue.ts +++ b/src/utils/transactions/parsers/getInterpretedTransaction/helpers/getTransactionValue/getTransactionValue.ts @@ -1,12 +1,6 @@ import { DECIMALS } from 'constants/index'; -import { - ACTIONS_WITH_EGLD_VALUE, - ACTIONS_WITH_MANDATORY_OPERATIONS, - ACTIONS_WITH_VALUE_IN_ACTION_FIELD, - ACTIONS_WITH_VALUE_IN_DATA_FIELD -} from '../../constants'; - +import { NftEnumType, InterpretedTransactionType } from 'types'; import { getValueFromActions, getValueFromDataField, @@ -14,15 +8,20 @@ import { getEgldValueData, getTitleText } from './helpers'; +import { getTransactionActionNftText } from '../../../getTransactionActionNftText'; +import { getTransactionActionTokenText } from '../../../getTransactionActionTokenText'; +import { + ACTIONS_WITH_EGLD_VALUE, + ACTIONS_WITH_MANDATORY_OPERATIONS, + ACTIONS_WITH_VALUE_IN_ACTION_FIELD, + ACTIONS_WITH_VALUE_IN_DATA_FIELD +} from '../../constants'; +import { getTransactionTokens } from '../getTransactionTokens'; import { EgldValueDataType, NFTValueDataType, TokenValueDataType } from '../types'; -import { NftEnumType, InterpretedTransactionType } from 'types'; -import { getTransactionTokens } from '../getTransactionTokens'; -import { getTransactionActionNftText } from '../../../getTransactionActionNftText'; -import { getTransactionActionTokenText } from '../../../getTransactionActionTokenText'; export interface GetTransactionValueReturnType { egldValueData?: EgldValueDataType; diff --git a/src/utils/transactions/parsers/getInterpretedTransaction/helpers/getTransactionValue/helpers/getTitleText.ts b/src/utils/transactions/parsers/getInterpretedTransaction/helpers/getTransactionValue/helpers/getTitleText.ts index 5e0ebf3..1d908ec 100644 --- a/src/utils/transactions/parsers/getInterpretedTransaction/helpers/getTransactionValue/helpers/getTitleText.ts +++ b/src/utils/transactions/parsers/getInterpretedTransaction/helpers/getTransactionValue/helpers/getTitleText.ts @@ -1,12 +1,12 @@ +import { TokenArgumentType } from 'types'; +import { getIdentifierType } from 'utils/validation'; +import { getTransactionActionNftText } from '../../../../getTransactionActionNftText'; +import { getTransactionActionTokenText } from '../../../../getTransactionActionTokenText'; import { EgldValueDataType, NFTValueDataType, TokenValueDataType } from '../../types'; -import { TokenArgumentType } from 'types'; -import { getIdentifierType } from 'utils'; -import { getTransactionActionNftText } from '../../../../getTransactionActionNftText'; -import { getTransactionActionTokenText } from '../../../../getTransactionActionTokenText'; export interface GetTransactionValueReturnType { egldValueData?: EgldValueDataType; diff --git a/src/utils/transactions/parsers/getInterpretedTransaction/helpers/getTransactionValue/helpers/getValueFromDataField.ts b/src/utils/transactions/parsers/getInterpretedTransaction/helpers/getTransactionValue/helpers/getValueFromDataField.ts index 2cbb266..c63d053 100644 --- a/src/utils/transactions/parsers/getInterpretedTransaction/helpers/getTransactionValue/helpers/getValueFromDataField.ts +++ b/src/utils/transactions/parsers/getInterpretedTransaction/helpers/getTransactionValue/helpers/getValueFromDataField.ts @@ -1,5 +1,5 @@ import BigNumber from 'bignumber.js'; -import { InterpretedTransactionType } from 'types'; +import { InterpretedTransactionType } from 'types/serverTransactions.types'; import { decodeBase64 } from 'utils/decoders'; import { getEgldValueData } from './getEgldValueData'; @@ -13,7 +13,7 @@ export function getValueFromDataField(transaction: InterpretedTransactionType) { if (!value.isNaN()) { return getEgldValueData(value.toString(10)); } - } catch (err) { + } catch { if (!warningLogged) { console.error( `Unable to extract value for txHash: ${transaction.txHash}` diff --git a/src/utils/transactions/parsers/getInterpretedTransaction/helpers/getTransactionValue/helpers/getValueFromOperations.ts b/src/utils/transactions/parsers/getInterpretedTransaction/helpers/getTransactionValue/helpers/getValueFromOperations.ts index 043bad0..8bae791 100644 --- a/src/utils/transactions/parsers/getInterpretedTransaction/helpers/getTransactionValue/helpers/getValueFromOperations.ts +++ b/src/utils/transactions/parsers/getInterpretedTransaction/helpers/getTransactionValue/helpers/getValueFromOperations.ts @@ -1,4 +1,4 @@ -import { InterpretedTransactionType } from 'types'; +import { InterpretedTransactionType } from 'types/serverTransactions.types'; import { getEgldValueData } from './getEgldValueData'; import { getVisibleOperations } from '../../../../getVisibleOperations'; @@ -24,8 +24,9 @@ export function getValueFromOperations( } else { logError(transaction.txHash); } - } catch (err) { + } catch { logError(transaction.txHash); } + return getEgldValueData(transaction.value); } diff --git a/src/utils/transactions/parsers/getInterpretedTransaction/helpers/getTransactionValue/tests/getTransactionValue.test.ts b/src/utils/transactions/parsers/getInterpretedTransaction/helpers/getTransactionValue/tests/getTransactionValue.test.ts index 6409b1c..fbc7b4b 100644 --- a/src/utils/transactions/parsers/getInterpretedTransaction/helpers/getTransactionValue/tests/getTransactionValue.test.ts +++ b/src/utils/transactions/parsers/getInterpretedTransaction/helpers/getTransactionValue/tests/getTransactionValue.test.ts @@ -1,11 +1,12 @@ -import { NftEnumType, TransactionActionsEnum } from 'types'; import { DECIMALS } from 'constants/index'; -import { getTransactionValue } from '../getTransactionValue'; +import { NftEnumType } from 'types'; +import { TransactionActionsEnum } from 'types/serverTransactions.types'; import { ACTIONS_WITH_EGLD_VALUE, ACTIONS_WITH_MANDATORY_OPERATIONS, ACTIONS_WITH_VALUE_IN_DATA_FIELD } from '../../../constants'; +import { getTransactionValue } from '../getTransactionValue'; describe('getTransactionValue', () => { const baseTransaction = { @@ -74,7 +75,7 @@ describe('getTransactionValue', () => { test('handles NFT transactions', () => { const mockNftToken = { - type: NftEnumType.NonFungibleESDT, + type: NftEnumType.SemiFungibleESDT, value: '1', decimals: 0, identifier: 'TEST-123-01' @@ -86,13 +87,9 @@ describe('getTransactionValue', () => { ...baseAction, category: 'nft', arguments: { - tokenId: mockNftToken.identifier, - amount: mockNftToken.value + token: mockNftToken } - }, - tokens: [mockNftToken], - tokenIdentifier: mockNftToken.identifier, - tokenValue: mockNftToken.value + } }; const result = getTransactionValue({ transaction }); @@ -117,13 +114,9 @@ describe('getTransactionValue', () => { ...baseAction, category: 'esdt', arguments: { - tokenId: mockToken.identifier, - amount: mockToken.value + token: mockToken } }, - tokens: [mockToken], - tokenIdentifier: mockToken.identifier, - tokenValue: mockToken.value, function: 'transfer', operations: [], results: [] @@ -143,26 +136,33 @@ describe('getTransactionValue', () => { type: 'FungibleESDT', value: '1000000000000000000', decimals: 18, - identifier: 'TEST-123' + identifier: 'TEST-123', + amount: '1000000000000000000', + tokenId: 'TEST-123' }, { type: 'FungibleESDT', value: '2000000000000000000', decimals: 18, - identifier: 'TEST-456' + identifier: 'TEST-456', + amount: '2000000000000000000', + tokenId: 'TEST-456' } ]; + const transfers = mockTokens.map((token) => ({ + ...token, + tokenId: token.identifier, + amount: token.value + })); + const transaction = { ...baseTransaction, action: { ...baseAction, category: 'multiToken', arguments: { - tokens: mockTokens.map((token) => ({ - tokenId: token.identifier, - amount: token.value - })) + transfers } }, tokens: mockTokens @@ -171,7 +171,7 @@ describe('getTransactionValue', () => { const result = getTransactionValue({ transaction }); expect(result.tokenValueData?.titleText).toBeDefined(); - expect(result.tokenValueData?.transactionTokens).toEqual(mockTokens); + expect(result.tokenValueData?.transactionTokens).toEqual(transfers); }); test('handles actions with value in data field', () => { diff --git a/src/utils/transactions/parsers/getInterpretedTransaction/helpers/tests/base-transaction-mock.ts b/src/utils/transactions/parsers/getInterpretedTransaction/helpers/tests/base-transaction-mock.ts index 98a406f..23c9285 100644 --- a/src/utils/transactions/parsers/getInterpretedTransaction/helpers/tests/base-transaction-mock.ts +++ b/src/utils/transactions/parsers/getInterpretedTransaction/helpers/tests/base-transaction-mock.ts @@ -1,4 +1,4 @@ -import { TransactionActionsEnum } from 'types'; +import { TransactionActionsEnum } from 'types/serverTransactions.types'; export const baseTransactionMock = { blockHash: '', diff --git a/src/utils/transactions/parsers/getInterpretedTransaction/helpers/tests/getOperationsMessages.test.ts b/src/utils/transactions/parsers/getInterpretedTransaction/helpers/tests/getOperationsMessages.test.ts index 0e68bd1..bda15cf 100644 --- a/src/utils/transactions/parsers/getInterpretedTransaction/helpers/tests/getOperationsMessages.test.ts +++ b/src/utils/transactions/parsers/getInterpretedTransaction/helpers/tests/getOperationsMessages.test.ts @@ -2,7 +2,7 @@ import { OperationType, TransactionOperationActionTypeEnum, VisibleTransactionOperationType -} from 'types'; +} from 'types/serverTransactions.types'; import { getOperationsMessages } from '../getOperationsMessages'; import { baseTransactionMock } from './base-transaction-mock'; diff --git a/src/utils/transactions/parsers/getInterpretedTransaction/helpers/tests/getTransactionMethod.test.ts b/src/utils/transactions/parsers/getInterpretedTransaction/helpers/tests/getTransactionMethod.test.ts index c3ce93b..541e5ce 100644 --- a/src/utils/transactions/parsers/getInterpretedTransaction/helpers/tests/getTransactionMethod.test.ts +++ b/src/utils/transactions/parsers/getInterpretedTransaction/helpers/tests/getTransactionMethod.test.ts @@ -2,12 +2,12 @@ import { ServerTransactionType, TransactionActionCategoryEnum, TransactionActionsEnum -} from 'types'; +} from 'types/serverTransactions.types'; import { getTransactionMethod } from '../getTransactionMethod'; import { baseTransactionMock } from './base-transaction-mock'; describe('getTransactionMethod', () => { - it('returns default value "Transaction" in case of missing "action" field ', () => { + it('returns default value "Transaction" in case of missing "action" field', () => { const transaction: ServerTransactionType = { ...baseTransactionMock, action: undefined diff --git a/src/utils/transactions/parsers/getInterpretedTransaction/helpers/tests/getTransactionReceiver.test.ts b/src/utils/transactions/parsers/getInterpretedTransaction/helpers/tests/getTransactionReceiver.test.ts index 242e1ac..60de128 100644 --- a/src/utils/transactions/parsers/getInterpretedTransaction/helpers/tests/getTransactionReceiver.test.ts +++ b/src/utils/transactions/parsers/getInterpretedTransaction/helpers/tests/getTransactionReceiver.test.ts @@ -2,7 +2,7 @@ import { ServerTransactionType, TransactionActionCategoryEnum, TransactionActionsEnum -} from 'types'; +} from 'types/serverTransactions.types'; import { getTransactionReceiver } from '../getTransactionReceiver'; import { baseTransactionMock } from './base-transaction-mock'; diff --git a/src/utils/transactions/parsers/getInterpretedTransaction/helpers/tests/getTransactionTokens.test.ts b/src/utils/transactions/parsers/getInterpretedTransaction/helpers/tests/getTransactionTokens.test.ts index ab24f1b..cdbce40 100644 --- a/src/utils/transactions/parsers/getInterpretedTransaction/helpers/tests/getTransactionTokens.test.ts +++ b/src/utils/transactions/parsers/getInterpretedTransaction/helpers/tests/getTransactionTokens.test.ts @@ -2,7 +2,7 @@ import { ServerTransactionType, TransactionActionCategoryEnum, TransactionActionsEnum -} from 'types'; +} from 'types/serverTransactions.types'; import { getTransactionTokens } from '../getTransactionTokens'; import { baseTransactionMock } from './base-transaction-mock'; diff --git a/src/utils/transactions/parsers/getInterpretedTransaction/helpers/tests/getTransactionTransferType.test.ts b/src/utils/transactions/parsers/getInterpretedTransaction/helpers/tests/getTransactionTransferType.test.ts index 2d3ab66..a078f62 100644 --- a/src/utils/transactions/parsers/getInterpretedTransaction/helpers/tests/getTransactionTransferType.test.ts +++ b/src/utils/transactions/parsers/getInterpretedTransaction/helpers/tests/getTransactionTransferType.test.ts @@ -1,5 +1,8 @@ -import { TransactionDirectionEnum } from 'types'; -import { ServerTransactionType, TransferTypeEnum } from 'types'; +import { + ServerTransactionType, + TransactionDirectionEnum, + TransferTypeEnum +} from 'types/serverTransactions.types'; import { getTransactionTransferType } from '../getTransactionTransferType'; import { baseTransactionMock } from './base-transaction-mock'; diff --git a/src/utils/transactions/parsers/getInterpretedTransaction/tests/extended-transaction-mock.ts b/src/utils/transactions/parsers/getInterpretedTransaction/tests/extended-transaction-mock.ts index d74738b..33dece5 100644 --- a/src/utils/transactions/parsers/getInterpretedTransaction/tests/extended-transaction-mock.ts +++ b/src/utils/transactions/parsers/getInterpretedTransaction/tests/extended-transaction-mock.ts @@ -4,7 +4,7 @@ import { TransactionActionCategoryEnum, TransactionActionsEnum, VisibleTransactionOperationType -} from 'types'; +} from 'types/serverTransactions.types'; import { EsdtEnumType } from 'types/tokens.types'; import { baseTransactionMock } from '../helpers/tests/base-transaction-mock'; diff --git a/src/utils/transactions/parsers/getInterpretedTransaction/tests/getInterpretedTransaction.test.ts b/src/utils/transactions/parsers/getInterpretedTransaction/tests/getInterpretedTransaction.test.ts index fe4a4d9..14fabd6 100644 --- a/src/utils/transactions/parsers/getInterpretedTransaction/tests/getInterpretedTransaction.test.ts +++ b/src/utils/transactions/parsers/getInterpretedTransaction/tests/getInterpretedTransaction.test.ts @@ -1,8 +1,11 @@ -import { InterpretedTransactionType, TransactionDirectionEnum } from 'types'; -import { ServerTransactionType, TransactionActionsEnum } from 'types'; +import { + ServerTransactionType, + TransactionActionsEnum, + InterpretedTransactionType, + TransactionDirectionEnum +} from 'types/serverTransactions.types'; import { getInterpretedTransaction } from '../getInterpretedTransaction'; - -import { explorerUrlBuilder } from '../helpers/explorerUrlBuilder'; +import { explorerUrlBuilder } from '../helpers'; import { transactionMock } from './extended-transaction-mock'; diff --git a/src/utils/transactions/parsers/getTransactionLink.ts b/src/utils/transactions/parsers/getTransactionLink.ts index e208ffe..28584e1 100644 --- a/src/utils/transactions/parsers/getTransactionLink.ts +++ b/src/utils/transactions/parsers/getTransactionLink.ts @@ -1,9 +1,9 @@ -import { explorerAddressSelector } from 'reduxStore/selectors'; -import { store } from 'reduxStore/store'; +import { explorerAddressSelector } from 'store/selectors'; +import { getState } from 'store/store'; export function getTransactionLink( transactionHash: string, - explorerAddress: string = explorerAddressSelector(store.getState()) + explorerAddress: string = explorerAddressSelector(getState()) ) { return `${explorerAddress}/transactions/${transactionHash}`; } diff --git a/src/utils/transactions/parsers/getTransactionMessages.ts b/src/utils/transactions/parsers/getTransactionMessages.ts index fafdaa1..cf8a528 100644 --- a/src/utils/transactions/parsers/getTransactionMessages.ts +++ b/src/utils/transactions/parsers/getTransactionMessages.ts @@ -1,7 +1,9 @@ -import { InterpretedTransactionType } from 'types'; -import { getOperationsMessages } from '../getInterpretedTransaction/helpers/getOperationsMessages'; -import { getReceiptMessage } from '../getInterpretedTransaction/helpers/getReceiptMessage'; -import getScResultsMessages from '../getInterpretedTransaction/helpers/getScResultsMessages'; +import { InterpretedTransactionType } from 'types/serverTransactions.types'; +import { + getOperationsMessages, + getReceiptMessage +} from './getInterpretedTransaction'; +import getScResultsMessages from './getInterpretedTransaction/helpers/getScResultsMessages'; export function getTransactionMessages( transaction: InterpretedTransactionType diff --git a/src/utils/transactions/parsers/getTransactionStatus.ts b/src/utils/transactions/parsers/getTransactionStatus.ts index 315380b..73be8a4 100644 --- a/src/utils/transactions/parsers/getTransactionStatus.ts +++ b/src/utils/transactions/parsers/getTransactionStatus.ts @@ -1,5 +1,5 @@ import { TransactionServerStatusesEnum } from 'types/enums.types'; -import { InterpretedTransactionType } from 'types'; +import { InterpretedTransactionType } from 'types/serverTransactions.types'; export function getTransactionStatus(transaction: InterpretedTransactionType) { const statusIs = (compareTo: string) => diff --git a/src/utils/transactions/parsers/getTransactionStatusText.ts b/src/utils/transactions/parsers/getTransactionStatusText.ts index cc9d4b0..97062bb 100644 --- a/src/utils/transactions/parsers/getTransactionStatusText.ts +++ b/src/utils/transactions/parsers/getTransactionStatusText.ts @@ -1,5 +1,5 @@ import { TransactionServerStatusesEnum } from 'types/enums.types'; -import { InterpretedTransactionType } from 'types'; +import { InterpretedTransactionType } from 'types/serverTransactions.types'; export function getTransactionStatusText( transaction: InterpretedTransactionType diff --git a/src/utils/transactions/parsers/getTransactionsDetails.ts b/src/utils/transactions/parsers/getTransactionsDetails.ts index e79aa18..88b1ede 100644 --- a/src/utils/transactions/parsers/getTransactionsDetails.ts +++ b/src/utils/transactions/parsers/getTransactionsDetails.ts @@ -1,5 +1,7 @@ -import { getTransactionByHashPromise } from 'apiCalls'; -import { ServerTransactionType } from 'types'; +import { TransactionStatus } from '@multiversx/sdk-core/out'; +import { getTransactionByHash } from 'apiCalls'; +import { ServerTransactionType } from 'types/serverTransactions.types'; +import { sleep } from '../../asyncActions'; export async function getTransactionsDetails(txHashes: string[]) { const delayMs = 3000; @@ -12,10 +14,10 @@ export async function getTransactionsDetails(txHashes: string[]) { while (transactions === undefined && retries > 0) { try { - await delayWithPromise(delayMs); + await sleep(delayMs); const promiseResponse = await Promise.allSettled( - txHashes.map((hash) => getTransactionByHashPromise(hash)) + txHashes.map((hash) => getTransactionByHash(hash)) ); const apiTransactions = promiseResponse @@ -43,7 +45,7 @@ export async function getTransactionsDetails(txHashes: string[]) { } else { retries -= 1; } - } catch (e) { + } catch { retries -= 1; } } diff --git a/src/utils/transactions/parsers/getVisibleOperations.ts b/src/utils/transactions/parsers/getVisibleOperations.ts index 32bb1b8..650dd2c 100644 --- a/src/utils/transactions/parsers/getVisibleOperations.ts +++ b/src/utils/transactions/parsers/getVisibleOperations.ts @@ -1,7 +1,7 @@ import { InterpretedTransactionType, VisibleTransactionOperationType -} from 'types'; +} from 'types/serverTransactions.types'; export function getVisibleOperations(transaction: InterpretedTransactionType) { const operations = diff --git a/src/utils/transactions/parsers/parseMultiEsdtTransferData.ts b/src/utils/transactions/parsers/parseMultiEsdtTransferData.ts index 8a5b668..8b6b798 100644 --- a/src/utils/transactions/parsers/parseMultiEsdtTransferData.ts +++ b/src/utils/transactions/parsers/parseMultiEsdtTransferData.ts @@ -1,17 +1,23 @@ import BigNumber from 'bignumber.js'; import { MultiEsdtTransactionType, TransactionTypesEnum } from 'types'; import { decodePart } from 'utils/decoders/decodePart'; -import { getAllStringOccurrences } from '../getAllStringOccurrences'; +import { getAllStringOccurrences } from '../../misc'; export function parseMultiEsdtTransferData(data?: string) { const transactions: MultiEsdtTransactionType[] = []; + + if (!data) { + return transactions; + } + let contractCallDataIndex = 0; + try { if ( - data?.startsWith(TransactionTypesEnum.MultiESDTNFTTransfer) && - data?.includes('@') + data.startsWith(TransactionTypesEnum.MultiESDTNFTTransfer) && + data.includes('@') ) { - const [, receiver, encodedTxCount, ...rest] = data?.split('@'); + const [, receiver, encodedTxCount, ...rest] = data.split('@'); if (receiver) { const txCount = new BigNumber(encodedTxCount, 16).toNumber(); @@ -90,7 +96,7 @@ export function parseMultiEsdtTransferData(data?: string) { } } catch (err) { console.error('failed parsing tx', err); - return transactions; } + return transactions; } diff --git a/src/utils/transactions/parsers/parseMultiEsdtTransferDataForMultipleTransactions.ts b/src/utils/transactions/parsers/parseMultiEsdtTransferDataForMultipleTransactions.ts index b171748..c25497f 100644 --- a/src/utils/transactions/parsers/parseMultiEsdtTransferDataForMultipleTransactions.ts +++ b/src/utils/transactions/parsers/parseMultiEsdtTransferDataForMultipleTransactions.ts @@ -1,4 +1,5 @@ import type { Transaction } from '@multiversx/sdk-core'; + import { MultiSignTransactionType, TransactionDataTokenType, diff --git a/src/utils/transactions/parsers/parseTransactionAfterSigning.ts b/src/utils/transactions/parsers/parseTransactionAfterSigning.ts index ecf82fa..e527229 100644 --- a/src/utils/transactions/parsers/parseTransactionAfterSigning.ts +++ b/src/utils/transactions/parsers/parseTransactionAfterSigning.ts @@ -1,9 +1,8 @@ -import { Transaction } from '@multiversx/sdk-core/out'; +import { Transaction, TransactionPayload } from '@multiversx/sdk-core/out'; import { PlainSignedTransaction } from '@multiversx/sdk-web-wallet-provider/out/plainSignedTransaction'; -import { newTransaction } from 'models'; import { SignedTransactionType } from 'types'; import { TransactionServerStatusesEnum } from 'types/enums.types'; -import { isGuardianTx } from '../validation/isGuardianTx'; +import { isGuardianTx } from '../validation'; export function parseTransactionAfterSigning( signedTransaction: Transaction | PlainSignedTransaction @@ -11,9 +10,17 @@ export function parseTransactionAfterSigning( const isComplexTransaction = Object.getPrototypeOf(signedTransaction).toPlainObject != null; + const plainSignedTx = signedTransaction as PlainSignedTransaction; + const encoder = new TextEncoder(); + const transaction = isComplexTransaction ? (signedTransaction as Transaction) - : newTransaction(signedTransaction as PlainSignedTransaction); + : new Transaction({ + ...plainSignedTx, + data: new TransactionPayload(plainSignedTx.data), + signature: encoder.encode(plainSignedTx.signature), + guardianSignature: encoder.encode(plainSignedTx.guardianSignature) + }); const parsedTransaction: SignedTransactionType = { ...transaction.toPlainObject(), diff --git a/src/utils/transactions/parsers/tests/getOperationsDetails.test.ts b/src/utils/transactions/parsers/tests/getOperationsDetails.test.ts index 19eef2d..030b1db 100644 --- a/src/utils/transactions/parsers/tests/getOperationsDetails.test.ts +++ b/src/utils/transactions/parsers/tests/getOperationsDetails.test.ts @@ -5,7 +5,7 @@ import { TransactionActionsEnum, TransactionOperationActionTypeEnum, VisibleTransactionOperationType -} from 'types'; +} from 'types/serverTransactions.types'; import { NftEnumType } from 'types/tokens.types'; import { getOperationsDetails } from '../getOperationsDetails'; @@ -187,29 +187,25 @@ describe('getOperationsDetails tests', () => { expect(getOperationsDetails({ transaction: TRANSACTION }).length).toBe(4); }); - test('returns operations without hidden operation type and with create action type', () => { + test('returns operations filtered by create action type', () => { expect( getOperationsDetails({ transaction: TRANSACTION, - filterBy: { - action: TransactionOperationActionTypeEnum.create - } + filterBy: { action: TransactionOperationActionTypeEnum.create } }).length ).toBe(3); }); - test('returns operations without hidden operation type and with transfer action type', () => { + test('returns operations filtered by transfer action type', () => { expect( getOperationsDetails({ transaction: TRANSACTION, - filterBy: { - action: TransactionOperationActionTypeEnum.transfer - } + filterBy: { action: TransactionOperationActionTypeEnum.transfer } }).length ).toBe(1); }); - test('returns operations without hidden operation type and with transfer action type', () => { + test('returns operations filtered by transfer action type and receiver', () => { expect( getOperationsDetails({ transaction: TRANSACTION, @@ -221,7 +217,7 @@ describe('getOperationsDetails tests', () => { ).toBe(1); }); - test('returns operations without hidden operation type and with create action type', () => { + test('returns operations filtered by create action type and receiver', () => { expect( getOperationsDetails({ transaction: TRANSACTION, @@ -233,7 +229,7 @@ describe('getOperationsDetails tests', () => { ).toBe(0); }); - test('returns operations without hidden operation type and with create action type, sender and receiver', () => { + test('returns operations filtered by create action type with matching sender and receiver', () => { expect( getOperationsDetails({ transaction: TRANSACTION, diff --git a/src/utils/transactions/parsers/tests/getTransactionLinkWithLabel.test.ts b/src/utils/transactions/parsers/tests/getTransactionLinkWithLabel.test.ts index d1a8217..4b77dbc 100644 --- a/src/utils/transactions/parsers/tests/getTransactionLinkWithLabel.test.ts +++ b/src/utils/transactions/parsers/tests/getTransactionLinkWithLabel.test.ts @@ -1,6 +1,9 @@ -import { ServerTransactionType, TransactionDirectionEnum } from 'types'; -import { getInterpretedTransaction } from 'utils/transactions/getInterpretedTransaction'; -import { transactionMock } from '../../getInterpretedTransaction/tests/extended-transaction-mock'; +import { + ServerTransactionType, + TransactionDirectionEnum +} from 'types/serverTransactions.types'; +import { getInterpretedTransaction } from '../getInterpretedTransaction'; +import { transactionMock } from '../getInterpretedTransaction/tests/extended-transaction-mock'; import { getTransactionLinkWithLabel } from '../getTransactionLinkWithLabel'; const explorerAddress = 'https://testing.devnet.com'; diff --git a/src/utils/transactions/parsers/transactionActionUnwrapper/helpers/mexUnwrapper.ts b/src/utils/transactions/parsers/transactionActionUnwrapper/helpers/mexUnwrapper.ts index 1b2c0b8..60fa9b9 100644 --- a/src/utils/transactions/parsers/transactionActionUnwrapper/helpers/mexUnwrapper.ts +++ b/src/utils/transactions/parsers/transactionActionUnwrapper/helpers/mexUnwrapper.ts @@ -1,14 +1,16 @@ import BigNumber from 'bignumber.js'; import { ZERO } from 'constants/index'; import { + TransactionActionsEnum, TransactionActionType, - UnwrapperType, - TransactionActionsEnum -} from 'types'; + UnwrapperType +} from 'types/serverTransactions.types'; export function mexUnwrapper( action: TransactionActionType ): Array { + let value = ZERO; + switch (action.name) { // distribution case TransactionActionsEnum.claimLockedAssets: @@ -54,7 +56,6 @@ export function mexUnwrapper( { token: action.arguments?.transfers } ]; case TransactionActionsEnum.mergeLockedAssetTokens: - let value = ZERO; if (action.arguments?.transfers) { const values = action.arguments.transfers.map( ({ value }: { value: string }) => value diff --git a/src/utils/transactions/parsers/transactionActionUnwrapper/transactionActionUnwrapper.ts b/src/utils/transactions/parsers/transactionActionUnwrapper/transactionActionUnwrapper.ts index 1b51ca5..f732cd9 100644 --- a/src/utils/transactions/parsers/transactionActionUnwrapper/transactionActionUnwrapper.ts +++ b/src/utils/transactions/parsers/transactionActionUnwrapper/transactionActionUnwrapper.ts @@ -1,9 +1,9 @@ +import { esdtNftUnwrapper, mexUnwrapper, stakeUnwrapper } from './helpers'; import { TransactionActionCategoryEnum, TransactionActionType, UnwrapperType } from '../../../../types'; -import { esdtNftUnwrapper, mexUnwrapper, stakeUnwrapper } from './helpers'; export function transactionActionUnwrapper( action: TransactionActionType diff --git a/src/utils/transactions/validation/isCrossShardTransaction.ts b/src/utils/transactions/validation/isCrossShardTransaction.ts index ba724dd..cace4e2 100644 --- a/src/utils/transactions/validation/isCrossShardTransaction.ts +++ b/src/utils/transactions/validation/isCrossShardTransaction.ts @@ -20,7 +20,7 @@ export function isCrossShardTransaction({ return getShardOfAddress(sender) === receiverShard; } return receiverShard === senderShard; - } catch (err) { + } catch { return false; } } diff --git a/src/utils/transactions/validation/tests/isGuardianTx.test.ts b/src/utils/transactions/validation/tests/isGuardianTx.test.ts index 6defcd9..f2da869 100644 --- a/src/utils/transactions/validation/tests/isGuardianTx.test.ts +++ b/src/utils/transactions/validation/tests/isGuardianTx.test.ts @@ -1,4 +1,4 @@ -import { GuardianActionsEnum } from 'constants'; +import { GuardianActionsEnum } from 'types'; import { isGuardianTx } from '../isGuardianTx'; describe('isGuardianTx Function', () => { diff --git a/src/utils/validation/addressIsValid.ts b/src/utils/validation/addressIsValid.ts index 6b877bc..f3f885c 100644 --- a/src/utils/validation/addressIsValid.ts +++ b/src/utils/validation/addressIsValid.ts @@ -9,6 +9,7 @@ function canTransformToPublicKey(address: string) { } } +// TODO: Move to utils export function addressIsValid(destinationAddress: string) { const isValidBach = destinationAddress?.startsWith('erd') && diff --git a/src/utils/validation/maxDecimals.ts b/src/utils/validation/maxDecimals.ts index b56d2a7..695d52e 100644 --- a/src/utils/validation/maxDecimals.ts +++ b/src/utils/validation/maxDecimals.ts @@ -1,4 +1,7 @@ -export const maxDecimals = (amount: string, decimals = 18) => { +// TODO: Move to utils +import { DECIMALS } from 'constants/index'; + +export function maxDecimals(amount: string, decimals = DECIMALS) { if ( amount != null && amount.toString().indexOf('.') >= 0 && @@ -7,4 +10,4 @@ export const maxDecimals = (amount: string, decimals = 18) => { return false; } return true; -}; +} diff --git a/src/utils/validation/stringIsFloat.ts b/src/utils/validation/stringIsFloat.ts index c752883..88ab54e 100755 --- a/src/utils/validation/stringIsFloat.ts +++ b/src/utils/validation/stringIsFloat.ts @@ -1,7 +1,8 @@ import BigNumber from 'bignumber.js'; import { ZERO } from 'constants/index'; -export const stringIsFloat = (amount: string) => { +// TODO: Move to utils +export function stringIsFloat(amount: string) { if (isNaN(amount as any)) { return false; } @@ -21,4 +22,4 @@ export const stringIsFloat = (amount: string) => { const number = decimals ? [wholes, decimals].join('.') : wholes; const bNparsed = new BigNumber(number); return bNparsed.toString(10) === number && bNparsed.comparedTo(0) >= 0; -}; +} diff --git a/src/utils/validation/stringIsInteger.ts b/src/utils/validation/stringIsInteger.ts index 990c232..983c2d2 100644 --- a/src/utils/validation/stringIsInteger.ts +++ b/src/utils/validation/stringIsInteger.ts @@ -1,9 +1,7 @@ import BigNumber from 'bignumber.js'; -export const stringIsInteger = ( - integer: string, - positiveNumbersOnly = true -) => { +// TODO: Move to utils +export function stringIsInteger(integer: string, positiveNumbersOnly = true) { const stringInteger = String(integer); if (!stringInteger.match(/^[-]?\d+$/)) { return false; @@ -13,4 +11,4 @@ export const stringIsInteger = ( return ( bNparsed.toString(10) === stringInteger && bNparsed.comparedTo(0) >= limit ); -}; +} diff --git a/src/utils/window/index.ts b/src/utils/window/index.ts index dfead60..742a502 100644 --- a/src/utils/window/index.ts +++ b/src/utils/window/index.ts @@ -5,5 +5,5 @@ export * from './getIsAuthRoute'; export * from './getWindowLocation'; export * from './isWindowAvailable'; export * from './parseNavigationParams'; -export * from './removeSearchParamsFromUrl' +export * from './removeSearchParamsFromUrl'; export * from './sanitizeCallbackUrl'; diff --git a/src/utils/window/tests/clearNavigationHistory.test.ts b/src/utils/window/tests/clearNavigationHistory.test.ts index e585e71..04cac7e 100644 --- a/src/utils/window/tests/clearNavigationHistory.test.ts +++ b/src/utils/window/tests/clearNavigationHistory.test.ts @@ -9,7 +9,7 @@ describe('clearNavigationHistory', () => { jest.spyOn(window.history, 'replaceState').mockImplementation(); (getWindowLocation as jest.Mock).mockReturnValue({ pathname: '/test', - hash: '#section1', + hash: '#section1' }); }); @@ -46,7 +46,7 @@ describe('clearNavigationHistory', () => { test('should use default path when pathname is empty', () => { (getWindowLocation as jest.Mock).mockReturnValue({ pathname: '', - hash: '', + hash: '' }); clearNavigationHistory({}); @@ -72,4 +72,4 @@ describe('clearNavigationHistory', () => { '/test?filter=active#section1' ); }); -}); \ No newline at end of file +}); diff --git a/yarn.lock b/yarn.lock index 954867e..1abfdcc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -24,7 +24,7 @@ resolved "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.26.2.tgz" integrity sha512-Z0WgzSEa+aUcdiJuCIqgujCshpMWgUpgOxXotrYPSA53hA3qopNaqcJpyr0hVb1FeWdnqFA35/fUtXgBK8srQg== -"@babel/core@^7.0.0", "@babel/core@^7.0.0-0", "@babel/core@^7.11.6", "@babel/core@^7.12.3", "@babel/core@^7.23.9", "@babel/core@^7.8.0", "@babel/core@>=7.0.0-beta.0 <8": +"@babel/core@^7.11.6", "@babel/core@^7.12.3", "@babel/core@^7.23.9": version "7.26.0" resolved "https://registry.npmjs.org/@babel/core/-/core-7.26.0.tgz" integrity sha512-i1SLeK+DzNnQ3LL/CswPCa/E5u4lh1k6IAEphON8F+cXt0t9euTshDru0q7/IqMa1PMPz5RnHuHscF8/ZJsStg== @@ -273,19 +273,129 @@ resolved "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== +"@esbuild/aix-ppc64@0.21.1": + version "0.21.1" + resolved "https://registry.yarnpkg.com/@esbuild/aix-ppc64/-/aix-ppc64-0.21.1.tgz#044268dc9ca4dc67f8d4aad8f51cfb894bfd7114" + integrity sha512-O7yppwipkXvnEPjzkSXJRk2g4bS8sUx9p9oXHq9MU/U7lxUzZVsnFZMDTmeeX9bfQxrFcvOacl/ENgOh0WP9pA== + +"@esbuild/android-arm64@0.21.1": + version "0.21.1" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.21.1.tgz#76aacd934449e541f05b66d5ec8cbff96ec2ae81" + integrity sha512-jXhccq6es+onw7x8MxoFnm820mz7sGa9J14kLADclmiEUH4fyj+FjR6t0M93RgtlI/awHWhtF0Wgfhqgf9gDZA== + +"@esbuild/android-arm@0.21.1": + version "0.21.1" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.21.1.tgz#8247c5aef933a212bca261290f6e43a9dca07cc5" + integrity sha512-hh3jKWikdnTtHCglDAeVO3Oyh8MaH8xZUaWMiCCvJ9/c3NtPqZq+CACOlGTxhddypXhl+8B45SeceYBfB/e8Ow== + +"@esbuild/android-x64@0.21.1": + version "0.21.1" + resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.21.1.tgz#80cbfa35412299edefbc4ab78064f0b66e448008" + integrity sha512-NPObtlBh4jQHE01gJeucqEhdoD/4ya2owSIS8lZYS58aR0x7oZo9lB2lVFxgTANSa5MGCBeoQtr+yA9oKCGPvA== + "@esbuild/darwin-arm64@0.21.1": version "0.21.1" resolved "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.1.tgz" integrity sha512-BLT7TDzqsVlQRmJfO/FirzKlzmDpBWwmCUlyggfzUwg1cAxVxeA4O6b1XkMInlxISdfPAOunV9zXjvh5x99Heg== -"@eslint-community/eslint-utils@^4.1.2", "@eslint-community/eslint-utils@^4.2.0", "@eslint-community/eslint-utils@^4.4.0": +"@esbuild/darwin-x64@0.21.1": + version "0.21.1" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.21.1.tgz#db971502c9fa204906b89e489810c902bf6d9afb" + integrity sha512-D3h3wBQmeS/vp93O4B+SWsXB8HvRDwMyhTNhBd8yMbh5wN/2pPWRW5o/hM3EKgk9bdKd9594lMGoTCTiglQGRQ== + +"@esbuild/freebsd-arm64@0.21.1": + version "0.21.1" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.1.tgz#f0f3bc20c23af999bd696099a324dceb66d77761" + integrity sha512-/uVdqqpNKXIxT6TyS/oSK4XE4xWOqp6fh4B5tgAwozkyWdylcX+W4YF2v6SKsL4wCQ5h1bnaSNjWPXG/2hp8AQ== + +"@esbuild/freebsd-x64@0.21.1": + version "0.21.1" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.21.1.tgz#d36af9085edb34244b41e5a57640e6b4452cbec2" + integrity sha512-paAkKN1n1jJitw+dAoR27TdCzxRl1FOEITx3h201R6NoXUojpMzgMLdkXVgCvaCSCqwYkeGLoe9UVNRDKSvQgw== + +"@esbuild/linux-arm64@0.21.1": + version "0.21.1" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.21.1.tgz#9d2ad42eea33b2a9571f13e7ecc39ee9d3ff0c6d" + integrity sha512-G65d08YoH00TL7Xg4LaL3gLV21bpoAhQ+r31NUu013YB7KK0fyXIt05VbsJtpqh/6wWxoLJZOvQHYnodRrnbUQ== + +"@esbuild/linux-arm@0.21.1": + version "0.21.1" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.21.1.tgz#d6f7c5873479dd97148bef3e3a7f09d486642883" + integrity sha512-tRHnxWJnvNnDpNVnsyDhr1DIQZUfCXlHSCDohbXFqmg9W4kKR7g8LmA3kzcwbuxbRMKeit8ladnCabU5f2traA== + +"@esbuild/linux-ia32@0.21.1": + version "0.21.1" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.21.1.tgz#8f2aef34a31c8d16dbce0b8679021f4881f38efe" + integrity sha512-tt/54LqNNAqCz++QhxoqB9+XqdsaZOtFD/srEhHYwBd3ZUOepmR1Eeot8bS+Q7BiEvy9vvKbtpHf+r6q8hF5UA== + +"@esbuild/linux-loong64@0.21.1": + version "0.21.1" + resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.21.1.tgz#44461ea2388efbafa6cf12b2bc1407a5388da066" + integrity sha512-MhNalK6r0nZD0q8VzUBPwheHzXPr9wronqmZrewLfP7ui9Fv1tdPmg6e7A8lmg0ziQCziSDHxh3cyRt4YMhGnQ== + +"@esbuild/linux-mips64el@0.21.1": + version "0.21.1" + resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.21.1.tgz#754d533a4fef4b0790d82bfe1e82d6876f18370e" + integrity sha512-YCKVY7Zen5rwZV+nZczOhFmHaeIxR4Zn3jcmNH53LbgF6IKRwmrMywqDrg4SiSNApEefkAbPSIzN39FC8VsxPg== + +"@esbuild/linux-ppc64@0.21.1": + version "0.21.1" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.21.1.tgz#2aafcfe2826c7d5d2e3c41eb8934e6368a7cada5" + integrity sha512-bw7bcQ+270IOzDV4mcsKAnDtAFqKO0jVv3IgRSd8iM0ac3L8amvCrujRVt1ajBTJcpDaFhIX+lCNRKteoDSLig== + +"@esbuild/linux-riscv64@0.21.1": + version "0.21.1" + resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.21.1.tgz#481ceaf5939d14fb25da62a385b5e6c2096a3370" + integrity sha512-ARmDRNkcOGOm1AqUBSwRVDfDeD9hGYRfkudP2QdoonBz1ucWVnfBPfy7H4JPI14eYtZruRSczJxyu7SRYDVOcg== + +"@esbuild/linux-s390x@0.21.1": + version "0.21.1" + resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.21.1.tgz#e25b97005e4c82540d1bc7af88e333fb55142570" + integrity sha512-o73TcUNMuoTZlhwFdsgr8SfQtmMV58sbgq6gQq9G1xUiYnHMTmJbwq65RzMx89l0iya69lR4bxBgtWiiOyDQZA== + +"@esbuild/linux-x64@0.21.1": + version "0.21.1" + resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.21.1.tgz#a05a61d0a0cbb03baa6db12cd8164c1e5265ffb2" + integrity sha512-da4/1mBJwwgJkbj4fMH7SOXq2zapgTo0LKXX1VUZ0Dxr+e8N0WbS80nSZ5+zf3lvpf8qxrkZdqkOqFfm57gXwA== + +"@esbuild/netbsd-x64@0.21.1": + version "0.21.1" + resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.21.1.tgz#e298f854e8999563f2e4668bd542678c46be4b53" + integrity sha512-CPWs0HTFe5woTJN5eKPvgraUoRHrCtzlYIAv9wBC+FAyagBSaf+UdZrjwYyTGnwPGkThV4OCI7XibZOnPvONVw== + +"@esbuild/openbsd-x64@0.21.1": + version "0.21.1" + resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.21.1.tgz#640d34de1e3c6bc3ff64e0379aae00ede3608f14" + integrity sha512-xxhTm5QtzNLc24R0hEkcH+zCx/o49AsdFZ0Cy5zSd/5tOj4X2g3/2AJB625NoadUuc4A8B3TenLJoYdWYOYCew== + +"@esbuild/sunos-x64@0.21.1": + version "0.21.1" + resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.21.1.tgz#f53cb1cdcbf05b3320e147ddb85ec2b1cf2b6cfc" + integrity sha512-CWibXszpWys1pYmbr9UiKAkX6x+Sxw8HWtw1dRESK1dLW5fFJ6rMDVw0o8MbadusvVQx1a8xuOxnHXT941Hp1A== + +"@esbuild/win32-arm64@0.21.1": + version "0.21.1" + resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.21.1.tgz#df4f44f9b4fec9598c0ec2c34fec9c568c8ab85d" + integrity sha512-jb5B4k+xkytGbGUS4T+Z89cQJ9DJ4lozGRSV+hhfmCPpfJ3880O31Q1srPCimm+V6UCbnigqD10EgDNgjvjerQ== + +"@esbuild/win32-ia32@0.21.1": + version "0.21.1" + resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.21.1.tgz#a57edbd9905db9f957327ae0facfbf406a80a4e4" + integrity sha512-PgyFvjJhXqHn1uxPhyN1wZ6dIomKjiLUQh1LjFvjiV1JmnkZ/oMPrfeEAZg5R/1ftz4LZWZr02kefNIQ5SKREQ== + +"@esbuild/win32-x64@0.21.1": + version "0.21.1" + resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.21.1.tgz#eb86553d90e86a8c174b96650fdb4c60f2de16a7" + integrity sha512-W9NttRZQR5ehAiqHGDnvfDaGmQOm6Fi4vSlce8mjM75x//XKuVAByohlEX6N17yZnVXxQFuh4fDRunP8ca6bfA== + +"@eslint-community/eslint-utils@^4.2.0", "@eslint-community/eslint-utils@^4.4.0": version "4.4.1" resolved "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.1.tgz" integrity sha512-s3O3waFUrMV8P/XaF/+ZTp1X9XBZW1a4B97ZnjQF2KYWaFD2A8KyFBsrsfSjEmjn3RGWAIuvlneuZm3CUK3jbA== dependencies: eslint-visitor-keys "^3.4.3" -"@eslint-community/regexpp@^4.10.0", "@eslint-community/regexpp@^4.11.0", "@eslint-community/regexpp@^4.12.1": +"@eslint-community/regexpp@^4.10.0", "@eslint-community/regexpp@^4.12.1": version "4.12.1" resolved "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz" integrity sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ== @@ -611,7 +721,7 @@ slash "^3.0.0" write-file-atomic "^4.0.2" -"@jest/types@^29.0.0", "@jest/types@^29.6.3": +"@jest/types@^29.6.3": version "29.6.3" resolved "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz" integrity sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw== @@ -655,17 +765,17 @@ "@jridgewell/resolve-uri" "^3.1.0" "@jridgewell/sourcemap-codec" "^1.4.14" -"@ledgerhq/devices@^8.0.7": - version "8.4.4" - resolved "https://registry.npmjs.org/@ledgerhq/devices/-/devices-8.4.4.tgz" - integrity sha512-sz/ryhe/R687RHtevIE9RlKaV8kkKykUV4k29e7GAVwzHX1gqG+O75cu1NCJUHLbp3eABV5FdvZejqRUlLis9A== +"@ledgerhq/devices@8.0.3": + version "8.0.3" + resolved "https://registry.npmjs.org/@ledgerhq/devices/-/devices-8.0.3.tgz" + integrity sha512-Q7/vqkGELSBuwFafFoTqlHIRyOjw8JqbSgiQwe2R38xN0RKtKIh+5E6UfMKyoExiq+SrQg0IC8P2LS+XdjOHLw== dependencies: - "@ledgerhq/errors" "^6.19.1" - "@ledgerhq/logs" "^6.12.0" - rxjs "^7.8.1" + "@ledgerhq/errors" "^6.12.6" + "@ledgerhq/logs" "^6.10.1" + rxjs "6" semver "^7.3.5" -"@ledgerhq/devices@^8.3.0", "@ledgerhq/devices@^8.4.4": +"@ledgerhq/devices@^8.0.7", "@ledgerhq/devices@^8.3.0", "@ledgerhq/devices@^8.4.4": version "8.4.4" resolved "https://registry.npmjs.org/@ledgerhq/devices/-/devices-8.4.4.tgz" integrity sha512-sz/ryhe/R687RHtevIE9RlKaV8kkKykUV4k29e7GAVwzHX1gqG+O75cu1NCJUHLbp3eABV5FdvZejqRUlLis9A== @@ -675,31 +785,16 @@ rxjs "^7.8.1" semver "^7.3.5" -"@ledgerhq/devices@8.0.3": - version "8.0.3" - resolved "https://registry.npmjs.org/@ledgerhq/devices/-/devices-8.0.3.tgz" - integrity sha512-Q7/vqkGELSBuwFafFoTqlHIRyOjw8JqbSgiQwe2R38xN0RKtKIh+5E6UfMKyoExiq+SrQg0IC8P2LS+XdjOHLw== - dependencies: - "@ledgerhq/errors" "^6.12.6" - "@ledgerhq/logs" "^6.10.1" - rxjs "6" - semver "^7.3.5" - -"@ledgerhq/errors@^6.12.6": - version "6.19.1" - resolved "https://registry.npmjs.org/@ledgerhq/errors/-/errors-6.19.1.tgz" - integrity sha512-75yK7Nnit/Gp7gdrJAz0ipp31CCgncRp+evWt6QawQEtQKYEDfGo10QywgrrBBixeRxwnMy1DP6g2oCWRf1bjw== - -"@ledgerhq/errors@^6.14.0", "@ledgerhq/errors@^6.16.4", "@ledgerhq/errors@^6.19.1": - version "6.19.1" - resolved "https://registry.npmjs.org/@ledgerhq/errors/-/errors-6.19.1.tgz" - integrity sha512-75yK7Nnit/Gp7gdrJAz0ipp31CCgncRp+evWt6QawQEtQKYEDfGo10QywgrrBBixeRxwnMy1DP6g2oCWRf1bjw== - "@ledgerhq/errors@6.12.6": version "6.12.6" resolved "https://registry.npmjs.org/@ledgerhq/errors/-/errors-6.12.6.tgz" integrity sha512-D+r2B09vaRO06wfGoss+rNgwqWSoK0bCtsaJWzlD2hv1zxTtucqVtSztbRFypIqxWTCb3ix5Nh2dWHEJVTp2Xw== +"@ledgerhq/errors@^6.12.6", "@ledgerhq/errors@^6.14.0", "@ledgerhq/errors@^6.16.4", "@ledgerhq/errors@^6.19.1": + version "6.19.1" + resolved "https://registry.npmjs.org/@ledgerhq/errors/-/errors-6.19.1.tgz" + integrity sha512-75yK7Nnit/Gp7gdrJAz0ipp31CCgncRp+evWt6QawQEtQKYEDfGo10QywgrrBBixeRxwnMy1DP6g2oCWRf1bjw== + "@ledgerhq/hw-transport-web-ble@6.28.6": version "6.28.6" resolved "https://registry.npmjs.org/@ledgerhq/hw-transport-web-ble/-/hw-transport-web-ble-6.28.6.tgz" @@ -731,6 +826,15 @@ "@ledgerhq/hw-transport" "^6.30.6" "@ledgerhq/logs" "^6.12.0" +"@ledgerhq/hw-transport@6.28.8": + version "6.28.8" + resolved "https://registry.npmjs.org/@ledgerhq/hw-transport/-/hw-transport-6.28.8.tgz" + integrity sha512-XxQVl4htd018u/M66r0iu5nlHi+J6QfdPsORzDF6N39jaz+tMqItb7tUlXM/isggcuS5lc7GJo7NOuJ8rvHZaQ== + dependencies: + "@ledgerhq/devices" "^8.0.7" + "@ledgerhq/errors" "^6.14.0" + events "^3.3.0" + "@ledgerhq/hw-transport@^6.30.6": version "6.31.4" resolved "https://registry.npmjs.org/@ledgerhq/hw-transport/-/hw-transport-6.31.4.tgz" @@ -741,15 +845,6 @@ "@ledgerhq/logs" "^6.12.0" events "^3.3.0" -"@ledgerhq/hw-transport@6.28.8": - version "6.28.8" - resolved "https://registry.npmjs.org/@ledgerhq/hw-transport/-/hw-transport-6.28.8.tgz" - integrity sha512-XxQVl4htd018u/M66r0iu5nlHi+J6QfdPsORzDF6N39jaz+tMqItb7tUlXM/isggcuS5lc7GJo7NOuJ8rvHZaQ== - dependencies: - "@ledgerhq/devices" "^8.0.7" - "@ledgerhq/errors" "^6.14.0" - events "^3.3.0" - "@ledgerhq/logs@^6.10.1", "@ledgerhq/logs@^6.12.0": version "6.12.0" resolved "https://registry.npmjs.org/@ledgerhq/logs/-/logs-6.12.0.tgz" @@ -882,7 +977,7 @@ resolved "https://registry.npmjs.org/@multiversx/sdk-bls-wasm/-/sdk-bls-wasm-0.3.5.tgz" integrity sha512-c0tIdQUnbBLSt6NYU+OpeGPYdL0+GV547HeHT8Xc0BKQ7Cj0v82QUoA2QRtWrR1G4MNZmLsIacZSsf6DrIS2Bw== -"@multiversx/sdk-core@>= 12.18.0", "@multiversx/sdk-core@>= 12.5.0", "@multiversx/sdk-core@>= 13.0.0", "@multiversx/sdk-core@>= 13.5.0": +"@multiversx/sdk-core@>= 13.5.0": version "13.15.0" resolved "https://registry.npmjs.org/@multiversx/sdk-core/-/sdk-core-13.15.0.tgz" integrity sha512-5RRLMxSDd0XZGopIrPsWLbA8nWxC7WQYjea8/jPvkRApLyggheQU8gaC6ZSgSE0EBrSHl+oC3+YH8nbVayZ2gw== @@ -907,7 +1002,8 @@ "@multiversx/sdk-dapp-core-ui@file:../mx-sdk-dapp-core-ui": version "0.0.0" - resolved "file:../mx-sdk-dapp-core-ui" + dependencies: + bignumber.js "9.x" "@multiversx/sdk-dapp-utils@1.0.0": version "1.0.0" @@ -1009,7 +1105,7 @@ dependencies: qs "6.10.3" -"@noble/curves@~1.4.0", "@noble/curves@1.4.2": +"@noble/curves@1.4.2", "@noble/curves@~1.4.0": version "1.4.2" resolved "https://registry.npmjs.org/@noble/curves/-/curves-1.4.2.tgz" integrity sha512-TavHr8qycMChk8UwMld0ZDRvatedkzWfH8IiaeGCfymOP5i0hSCozz9vHOL0nkwk7HRMlFnAiKpS2jrUmSybcw== @@ -1021,25 +1117,20 @@ resolved "https://registry.npmjs.org/@noble/ed25519/-/ed25519-1.7.3.tgz" integrity sha512-iR8GBkDt0Q3GyaVcIu7mSsVIqnFbkbRzGLWlvhwunacoLwt4J3swfKhfaM6rN6WY+TBGoYT1GtT1mIh2/jGbRQ== -"@noble/hashes@^1.2.0": - version "1.6.1" - resolved "https://registry.npmjs.org/@noble/hashes/-/hashes-1.6.1.tgz" - integrity sha512-pq5D8h10hHBjyqX+cfBm0i8JUXJ0UhczFc4r74zbuT9XgewFo2E3J1cOaGtdZynILNmQ685YWGzGE1Zv6io50w== - -"@noble/hashes@^1.3.1": - version "1.6.1" - resolved "https://registry.npmjs.org/@noble/hashes/-/hashes-1.6.1.tgz" - integrity sha512-pq5D8h10hHBjyqX+cfBm0i8JUXJ0UhczFc4r74zbuT9XgewFo2E3J1cOaGtdZynILNmQ685YWGzGE1Zv6io50w== +"@noble/hashes@1.3.0": + version "1.3.0" + resolved "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.0.tgz" + integrity sha512-ilHEACi9DwqJB0pw7kv+Apvh50jiiSyR/cQ3y4W7lOR5mhvn/50FLUfsnfJz0BDZtl/RR16kXvptiv6q1msYZg== -"@noble/hashes@~1.4.0", "@noble/hashes@1.4.0": +"@noble/hashes@1.4.0", "@noble/hashes@~1.4.0": version "1.4.0" resolved "https://registry.npmjs.org/@noble/hashes/-/hashes-1.4.0.tgz" integrity sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg== -"@noble/hashes@1.3.0": - version "1.3.0" - resolved "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.0.tgz" - integrity sha512-ilHEACi9DwqJB0pw7kv+Apvh50jiiSyR/cQ3y4W7lOR5mhvn/50FLUfsnfJz0BDZtl/RR16kXvptiv6q1msYZg== +"@noble/hashes@^1.2.0", "@noble/hashes@^1.3.1": + version "1.6.1" + resolved "https://registry.npmjs.org/@noble/hashes/-/hashes-1.6.1.tgz" + integrity sha512-pq5D8h10hHBjyqX+cfBm0i8JUXJ0UhczFc4r74zbuT9XgewFo2E3J1cOaGtdZynILNmQ685YWGzGE1Zv6io50w== "@nodelib/fs.scandir@2.1.5": version "2.1.5" @@ -1049,7 +1140,7 @@ "@nodelib/fs.stat" "2.0.5" run-parallel "^1.1.9" -"@nodelib/fs.stat@^2.0.2", "@nodelib/fs.stat@2.0.5": +"@nodelib/fs.stat@2.0.5", "@nodelib/fs.stat@^2.0.2": version "2.0.5" resolved "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz" integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== @@ -1072,11 +1163,56 @@ resolved "https://registry.npmjs.org/@open-draft/until/-/until-1.0.3.tgz" integrity sha512-Aq58f5HiWdyDlFffbbSjAlv596h/cOnt2DO1w3DOC7OJ5EHs0hd/nycJfiu9RJbT6Yk6F1knnRRXNSpxoIVZ9Q== +"@parcel/watcher-android-arm64@2.5.0": + version "2.5.0" + resolved "https://registry.yarnpkg.com/@parcel/watcher-android-arm64/-/watcher-android-arm64-2.5.0.tgz#e32d3dda6647791ee930556aee206fcd5ea0fb7a" + integrity sha512-qlX4eS28bUcQCdribHkg/herLe+0A9RyYC+mm2PXpncit8z5b3nSqGVzMNR3CmtAOgRutiZ02eIJJgP/b1iEFQ== + "@parcel/watcher-darwin-arm64@2.5.0": version "2.5.0" resolved "https://registry.npmjs.org/@parcel/watcher-darwin-arm64/-/watcher-darwin-arm64-2.5.0.tgz" integrity sha512-hyZ3TANnzGfLpRA2s/4U1kbw2ZI4qGxaRJbBH2DCSREFfubMswheh8TeiC1sGZ3z2jUf3s37P0BBlrD3sjVTUw== +"@parcel/watcher-darwin-x64@2.5.0": + version "2.5.0" + resolved "https://registry.yarnpkg.com/@parcel/watcher-darwin-x64/-/watcher-darwin-x64-2.5.0.tgz#f9f1d5ce9d5878d344f14ef1856b7a830c59d1bb" + integrity sha512-9rhlwd78saKf18fT869/poydQK8YqlU26TMiNg7AIu7eBp9adqbJZqmdFOsbZ5cnLp5XvRo9wcFmNHgHdWaGYA== + +"@parcel/watcher-freebsd-x64@2.5.0": + version "2.5.0" + resolved "https://registry.yarnpkg.com/@parcel/watcher-freebsd-x64/-/watcher-freebsd-x64-2.5.0.tgz#2b77f0c82d19e84ff4c21de6da7f7d096b1a7e82" + integrity sha512-syvfhZzyM8kErg3VF0xpV8dixJ+RzbUaaGaeb7uDuz0D3FK97/mZ5AJQ3XNnDsXX7KkFNtyQyFrXZzQIcN49Tw== + +"@parcel/watcher-linux-arm-glibc@2.5.0": + version "2.5.0" + resolved "https://registry.yarnpkg.com/@parcel/watcher-linux-arm-glibc/-/watcher-linux-arm-glibc-2.5.0.tgz#92ed322c56dbafa3d2545dcf2803334aee131e42" + integrity sha512-0VQY1K35DQET3dVYWpOaPFecqOT9dbuCfzjxoQyif1Wc574t3kOSkKevULddcR9znz1TcklCE7Ht6NIxjvTqLA== + +"@parcel/watcher-linux-arm-musl@2.5.0": + version "2.5.0" + resolved "https://registry.yarnpkg.com/@parcel/watcher-linux-arm-musl/-/watcher-linux-arm-musl-2.5.0.tgz#cd48e9bfde0cdbbd2ecd9accfc52967e22f849a4" + integrity sha512-6uHywSIzz8+vi2lAzFeltnYbdHsDm3iIB57d4g5oaB9vKwjb6N6dRIgZMujw4nm5r6v9/BQH0noq6DzHrqr2pA== + +"@parcel/watcher-linux-arm64-glibc@2.5.0": + version "2.5.0" + resolved "https://registry.yarnpkg.com/@parcel/watcher-linux-arm64-glibc/-/watcher-linux-arm64-glibc-2.5.0.tgz#7b81f6d5a442bb89fbabaf6c13573e94a46feb03" + integrity sha512-BfNjXwZKxBy4WibDb/LDCriWSKLz+jJRL3cM/DllnHH5QUyoiUNEp3GmL80ZqxeumoADfCCP19+qiYiC8gUBjA== + +"@parcel/watcher-linux-arm64-musl@2.5.0": + version "2.5.0" + resolved "https://registry.yarnpkg.com/@parcel/watcher-linux-arm64-musl/-/watcher-linux-arm64-musl-2.5.0.tgz#dcb8ff01077cdf59a18d9e0a4dff7a0cfe5fd732" + integrity sha512-S1qARKOphxfiBEkwLUbHjCY9BWPdWnW9j7f7Hb2jPplu8UZ3nes7zpPOW9bkLbHRvWM0WDTsjdOTUgW0xLBN1Q== + +"@parcel/watcher-linux-x64-glibc@2.5.0": + version "2.5.0" + resolved "https://registry.yarnpkg.com/@parcel/watcher-linux-x64-glibc/-/watcher-linux-x64-glibc-2.5.0.tgz#2e254600fda4e32d83942384d1106e1eed84494d" + integrity sha512-d9AOkusyXARkFD66S6zlGXyzx5RvY+chTP9Jp0ypSTC9d4lzyRs9ovGf/80VCxjKddcUvnsGwCHWuF2EoPgWjw== + +"@parcel/watcher-linux-x64-musl@2.5.0": + version "2.5.0" + resolved "https://registry.yarnpkg.com/@parcel/watcher-linux-x64-musl/-/watcher-linux-x64-musl-2.5.0.tgz#01fcea60fedbb3225af808d3f0a7b11229792eef" + integrity sha512-iqOC+GoTDoFyk/VYSFHwjHhYrk8bljW6zOhPuhi5t9ulqiYq1togGJB5e3PwYVFFfeVgc6pbz3JdQyDoBszVaA== + "@parcel/watcher-wasm@^2.4.1": version "2.5.0" resolved "https://registry.npmjs.org/@parcel/watcher-wasm/-/watcher-wasm-2.5.0.tgz" @@ -1086,6 +1222,21 @@ micromatch "^4.0.5" napi-wasm "^1.1.0" +"@parcel/watcher-win32-arm64@2.5.0": + version "2.5.0" + resolved "https://registry.yarnpkg.com/@parcel/watcher-win32-arm64/-/watcher-win32-arm64-2.5.0.tgz#87cdb16e0783e770197e52fb1dc027bb0c847154" + integrity sha512-twtft1d+JRNkM5YbmexfcH/N4znDtjgysFaV9zvZmmJezQsKpkfLYJ+JFV3uygugK6AtIM2oADPkB2AdhBrNig== + +"@parcel/watcher-win32-ia32@2.5.0": + version "2.5.0" + resolved "https://registry.yarnpkg.com/@parcel/watcher-win32-ia32/-/watcher-win32-ia32-2.5.0.tgz#778c39b56da33e045ba21c678c31a9f9d7c6b220" + integrity sha512-+rgpsNRKwo8A53elqbbHXdOMtY/tAtTzManTWShB5Kk54N8Q9mzNWV7tV+IbGueCbcj826MfWGU3mprWtuf1TA== + +"@parcel/watcher-win32-x64@2.5.0": + version "2.5.0" + resolved "https://registry.yarnpkg.com/@parcel/watcher-win32-x64/-/watcher-win32-x64-2.5.0.tgz#33873876d0bbc588aacce38e90d1d7480ce81cb7" + integrity sha512-lPrxve92zEHdgeff3aiu4gDOIt4u7sJYha6wbdEZDCDUhtjTsOMiaJzG5lMY4GkWH8p0fMmO2Ppq5G5XXG+DQw== + "@parcel/watcher@^2.4.1": version "2.5.0" resolved "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.5.0.tgz" @@ -1246,14 +1397,6 @@ resolved "https://registry.npmjs.org/@stablelib/bytes/-/bytes-1.0.1.tgz" integrity sha512-Kre4Y4kdwuqL8BR2E9hV/R5sOrUj6NanZaZis0V6lX5yzqC3hBuVSDXUIBqQv/sCpmuWRiHLwqiT1pqqjuBXoQ== -"@stablelib/chacha@^1.0.1": - version "1.0.1" - resolved "https://registry.npmjs.org/@stablelib/chacha/-/chacha-1.0.1.tgz" - integrity sha512-Pmlrswzr0pBzDofdFuVe1q7KdsHKhhU24e8gkEwnTGOmlC7PADzLVxGdn2PoNVBBabdg0l/IfLKg6sHAbTQugg== - dependencies: - "@stablelib/binary" "^1.0.1" - "@stablelib/wipe" "^1.0.1" - "@stablelib/chacha20poly1305@1.0.1": version "1.0.1" resolved "https://registry.npmjs.org/@stablelib/chacha20poly1305/-/chacha20poly1305-1.0.1.tgz" @@ -1266,6 +1409,14 @@ "@stablelib/poly1305" "^1.0.1" "@stablelib/wipe" "^1.0.1" +"@stablelib/chacha@^1.0.1": + version "1.0.1" + resolved "https://registry.npmjs.org/@stablelib/chacha/-/chacha-1.0.1.tgz" + integrity sha512-Pmlrswzr0pBzDofdFuVe1q7KdsHKhhU24e8gkEwnTGOmlC7PADzLVxGdn2PoNVBBabdg0l/IfLKg6sHAbTQugg== + dependencies: + "@stablelib/binary" "^1.0.1" + "@stablelib/wipe" "^1.0.1" + "@stablelib/constant-time@^1.0.1": version "1.0.1" resolved "https://registry.npmjs.org/@stablelib/constant-time/-/constant-time-1.0.1.tgz" @@ -1368,7 +1519,52 @@ resolved "https://registry.npmjs.org/@swc/core-darwin-arm64/-/core-darwin-arm64-1.9.3.tgz" integrity sha512-hGfl/KTic/QY4tB9DkTbNuxy5cV4IeejpPD4zo+Lzt4iLlDWIeANL4Fkg67FiVceNJboqg48CUX+APhDHO5G1w== -"@swc/core@*", "@swc/core@^1.4.17": +"@swc/core-darwin-x64@1.9.3": + version "1.9.3" + resolved "https://registry.yarnpkg.com/@swc/core-darwin-x64/-/core-darwin-x64-1.9.3.tgz#01376c6c2caea5dd0c235f21ebc7e41238153c86" + integrity sha512-IaRq05ZLdtgF5h9CzlcgaNHyg4VXuiStnOFpfNEMuI5fm5afP2S0FHq8WdakUz5WppsbddTdplL+vpeApt/WCQ== + +"@swc/core-linux-arm-gnueabihf@1.9.3": + version "1.9.3" + resolved "https://registry.yarnpkg.com/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.9.3.tgz#4a9705903cebfc8e3e2bee71a42f7c88896e61df" + integrity sha512-Pbwe7xYprj/nEnZrNBvZfjnTxlBIcfApAGdz2EROhjpPj+FBqBa3wOogqbsuGGBdCphf8S+KPprL1z+oDWkmSQ== + +"@swc/core-linux-arm64-gnu@1.9.3": + version "1.9.3" + resolved "https://registry.yarnpkg.com/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.9.3.tgz#722aefc00a7abfb031fae7539226c7d7683f5c8d" + integrity sha512-AQ5JZiwNGVV/2K2TVulg0mw/3LYfqpjZO6jDPtR2evNbk9Yt57YsVzS+3vHSlUBQDRV9/jqMuZYVU3P13xrk+g== + +"@swc/core-linux-arm64-musl@1.9.3": + version "1.9.3" + resolved "https://registry.yarnpkg.com/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.9.3.tgz#6643f683311cc1dcee00970e3d6b4872225bdbd8" + integrity sha512-tzVH480RY6RbMl/QRgh5HK3zn1ZTFsThuxDGo6Iuk1MdwIbdFYUY034heWUTI4u3Db97ArKh0hNL0xhO3+PZdg== + +"@swc/core-linux-x64-gnu@1.9.3": + version "1.9.3" + resolved "https://registry.yarnpkg.com/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.9.3.tgz#e6f5cefa244409abe1451fbb4575696a870cbd7a" + integrity sha512-ivXXBRDXDc9k4cdv10R21ccBmGebVOwKXT/UdH1PhxUn9m/h8erAWjz5pcELwjiMf27WokqPgaWVfaclDbgE+w== + +"@swc/core-linux-x64-musl@1.9.3": + version "1.9.3" + resolved "https://registry.yarnpkg.com/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.9.3.tgz#4d45399f7a01389add61febd02da9b12f16abc81" + integrity sha512-ILsGMgfnOz1HwdDz+ZgEuomIwkP1PHT6maigZxaCIuC6OPEhKE8uYna22uU63XvYcLQvZYDzpR3ms47WQPuNEg== + +"@swc/core-win32-arm64-msvc@1.9.3": + version "1.9.3" + resolved "https://registry.yarnpkg.com/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.9.3.tgz#8c352bcea558b9a950877cd724f132d7d51a4d80" + integrity sha512-e+XmltDVIHieUnNJHtspn6B+PCcFOMYXNJB1GqoCcyinkEIQNwC8KtWgMqUucUbEWJkPc35NHy9k8aCXRmw9Kg== + +"@swc/core-win32-ia32-msvc@1.9.3": + version "1.9.3" + resolved "https://registry.yarnpkg.com/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.9.3.tgz#656f78b9c56413dbd590ac259dbe0d563cd8e166" + integrity sha512-rqpzNfpAooSL4UfQnHhkW8aL+oyjqJniDP0qwZfGnjDoJSbtPysHg2LpcOBEdSnEH+uIZq6J96qf0ZFD8AGfXA== + +"@swc/core-win32-x64-msvc@1.9.3": + version "1.9.3" + resolved "https://registry.yarnpkg.com/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.9.3.tgz#9595c177d2c11909558da93b18f37e7c5ae1909c" + integrity sha512-3YJJLQ5suIEHEKc1GHtqVq475guiyqisKSoUnoaRtxkDaW5g1yvPt9IoSLOe2mRs7+FFhGGU693RsBUSwOXSdQ== + +"@swc/core@^1.4.17": version "1.9.3" resolved "https://registry.npmjs.org/@swc/core/-/core-1.9.3.tgz" integrity sha512-oRj0AFePUhtatX+BscVhnzaAmWjpfAeySpM1TCbxA1rtBDeH/JDhi5yYzAKneDYtVtBvA7ApfeuzhMC9ye4xSg== @@ -1489,14 +1685,6 @@ dependencies: "@types/istanbul-lib-report" "*" -"@types/jest@^29.5.11": - version "29.5.14" - resolved "https://registry.npmjs.org/@types/jest/-/jest-29.5.14.tgz" - integrity sha512-ZN+4sdnLUbo8EVvVc2ao0GFW6oVrQRPn4K2lglySj7APvSrgzxHiNNK99us4WDMi57xxA2yggblIAMNhXOotLQ== - dependencies: - expect "^29.0.0" - pretty-format "^29.0.0" - "@types/jest@29.5.13": version "29.5.13" resolved "https://registry.npmjs.org/@types/jest/-/jest-29.5.13.tgz" @@ -1505,6 +1693,14 @@ expect "^29.0.0" pretty-format "^29.0.0" +"@types/jest@^29.5.11": + version "29.5.14" + resolved "https://registry.npmjs.org/@types/jest/-/jest-29.5.14.tgz" + integrity sha512-ZN+4sdnLUbo8EVvVc2ao0GFW6oVrQRPn4K2lglySj7APvSrgzxHiNNK99us4WDMi57xxA2yggblIAMNhXOotLQ== + dependencies: + expect "^29.0.0" + pretty-format "^29.0.0" + "@types/js-levenshtein@^1.1.1": version "1.1.3" resolved "https://registry.npmjs.org/@types/js-levenshtein/-/js-levenshtein-1.1.3.tgz" @@ -1547,14 +1743,7 @@ "@types/node" "*" form-data "^4.0.0" -"@types/node@*": - version "22.10.1" - resolved "https://registry.npmjs.org/@types/node/-/node-22.10.1.tgz" - integrity sha512-qKgsUwfHZV2WCWLAnVP1JqnpE6Im6h3Y0+fYgMTasNQ7V++CBX5OT1as0g0f+OyubbFqhf6XVNIsmN4IIhEgGQ== - dependencies: - undici-types "~6.20.0" - -"@types/node@>=13.7.0": +"@types/node@*", "@types/node@>=13.7.0": version "22.10.1" resolved "https://registry.npmjs.org/@types/node/-/node-22.10.1.tgz" integrity sha512-qKgsUwfHZV2WCWLAnVP1JqnpE6Im6h3Y0+fYgMTasNQ7V++CBX5OT1as0g0f+OyubbFqhf6XVNIsmN4IIhEgGQ== @@ -1607,7 +1796,7 @@ dependencies: "@types/yargs-parser" "*" -"@typescript-eslint/eslint-plugin@^6.0.0 || ^7.0.0 || ^8.0.0", "@typescript-eslint/eslint-plugin@8.15.0": +"@typescript-eslint/eslint-plugin@8.15.0": version "8.15.0" resolved "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.15.0.tgz" integrity sha512-+zkm9AR1Ds9uLWN3fkoeXgFppaQ+uEVtfOV62dDmsy9QCNqlRHWNEck4yarvRNrvRcHQLGfqBNui3cimoz8XAg== @@ -1622,7 +1811,7 @@ natural-compare "^1.4.0" ts-api-utils "^1.3.0" -"@typescript-eslint/parser@^8.0.0 || ^8.0.0-alpha.0", "@typescript-eslint/parser@8.15.0": +"@typescript-eslint/parser@8.15.0": version "8.15.0" resolved "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.15.0.tgz" integrity sha512-7n59qFpghG4uazrF9qtGKBZXn7Oz4sOMm8dwNWDQY96Xlm2oX67eipqcblDj+oY1lLCbf1oltMZFpUso66Kl1A== @@ -1697,16 +1886,6 @@ semver "^7.6.0" ts-api-utils "^1.3.0" -"@typescript-eslint/utils@^6.0.0 || ^7.0.0 || ^8.0.0": - version "8.17.0" - resolved "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.17.0.tgz" - integrity sha512-bQC8BnEkxqG8HBGKwG9wXlZqg37RKSMY7v/X8VEWD8JG2JuTHuNK0VFvMPMUKQcbk6B+tf05k+4AShAEtCtJ/w== - dependencies: - "@eslint-community/eslint-utils" "^4.4.0" - "@typescript-eslint/scope-manager" "8.17.0" - "@typescript-eslint/types" "8.17.0" - "@typescript-eslint/typescript-estree" "8.17.0" - "@typescript-eslint/utils@8.15.0": version "8.15.0" resolved "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.15.0.tgz" @@ -1717,6 +1896,16 @@ "@typescript-eslint/types" "8.15.0" "@typescript-eslint/typescript-estree" "8.15.0" +"@typescript-eslint/utils@^6.0.0 || ^7.0.0 || ^8.0.0": + version "8.17.0" + resolved "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.17.0.tgz" + integrity sha512-bQC8BnEkxqG8HBGKwG9wXlZqg37RKSMY7v/X8VEWD8JG2JuTHuNK0VFvMPMUKQcbk6B+tf05k+4AShAEtCtJ/w== + dependencies: + "@eslint-community/eslint-utils" "^4.4.0" + "@typescript-eslint/scope-manager" "8.17.0" + "@typescript-eslint/types" "8.17.0" + "@typescript-eslint/typescript-estree" "8.17.0" + "@typescript-eslint/visitor-keys@8.15.0": version "8.15.0" resolved "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.15.0.tgz" @@ -1789,15 +1978,15 @@ "@walletconnect/safe-json" "^1.0.2" tslib "1.14.1" -"@walletconnect/jsonrpc-types@^1.0.2": - version "1.0.4" - resolved "https://registry.npmjs.org/@walletconnect/jsonrpc-types/-/jsonrpc-types-1.0.4.tgz" - integrity sha512-P6679fG/M+wuWg9TY8mh6xFSdYnFyFjwFelxyISxMDrlbXokorEVXYOxiqEbrU3x1BmBoCAJJ+vtEaEoMlpCBQ== +"@walletconnect/jsonrpc-types@1.0.3": + version "1.0.3" + resolved "https://registry.npmjs.org/@walletconnect/jsonrpc-types/-/jsonrpc-types-1.0.3.tgz" + integrity sha512-iIQ8hboBl3o5ufmJ8cuduGad0CQm3ZlsHtujv9Eu16xq89q+BG7Nh5VLxxUgmtpnrePgFkTwXirCTkwJH1v+Yw== dependencies: - events "^3.3.0" keyvaluestorage-interface "^1.0.0" + tslib "1.14.1" -"@walletconnect/jsonrpc-types@^1.0.3": +"@walletconnect/jsonrpc-types@^1.0.2", "@walletconnect/jsonrpc-types@^1.0.3": version "1.0.4" resolved "https://registry.npmjs.org/@walletconnect/jsonrpc-types/-/jsonrpc-types-1.0.4.tgz" integrity sha512-P6679fG/M+wuWg9TY8mh6xFSdYnFyFjwFelxyISxMDrlbXokorEVXYOxiqEbrU3x1BmBoCAJJ+vtEaEoMlpCBQ== @@ -1805,15 +1994,7 @@ events "^3.3.0" keyvaluestorage-interface "^1.0.0" -"@walletconnect/jsonrpc-types@1.0.3": - version "1.0.3" - resolved "https://registry.npmjs.org/@walletconnect/jsonrpc-types/-/jsonrpc-types-1.0.3.tgz" - integrity sha512-iIQ8hboBl3o5ufmJ8cuduGad0CQm3ZlsHtujv9Eu16xq89q+BG7Nh5VLxxUgmtpnrePgFkTwXirCTkwJH1v+Yw== - dependencies: - keyvaluestorage-interface "^1.0.0" - tslib "1.14.1" - -"@walletconnect/jsonrpc-utils@^1.0.6", "@walletconnect/jsonrpc-utils@^1.0.8", "@walletconnect/jsonrpc-utils@1.0.8": +"@walletconnect/jsonrpc-utils@1.0.8", "@walletconnect/jsonrpc-utils@^1.0.6", "@walletconnect/jsonrpc-utils@^1.0.8": version "1.0.8" resolved "https://registry.npmjs.org/@walletconnect/jsonrpc-utils/-/jsonrpc-utils-1.0.8.tgz" integrity sha512-vdeb03bD8VzJUL6ZtzRYsFMq1eZQcM3EAzT0a3st59dyLfJ0wq+tKMpmGH7HlB7waD858UWgfIcudbPFsbzVdw== @@ -1986,7 +2167,7 @@ acorn-walk@^8.0.2: dependencies: acorn "^8.11.0" -"acorn@^6.0.0 || ^7.0.0 || ^8.0.0", acorn@^8.1.0, acorn@^8.11.0, acorn@^8.14.0, acorn@^8.8.1: +acorn@^8.1.0, acorn@^8.11.0, acorn@^8.14.0, acorn@^8.8.1: version "8.14.0" resolved "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz" integrity sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA== @@ -2015,6 +2196,11 @@ ansi-escapes@^4.2.1: dependencies: type-fest "^0.21.3" +ansi-regex@^4.1.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.1.tgz#164daac87ab2d6f6db3a29875e2d1766582dabed" + integrity sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g== + ansi-regex@^5.0.1: version "5.0.1" resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz" @@ -2178,7 +2364,7 @@ axios-mock-adapter@1.22.0: fast-deep-equal "^3.1.3" is-buffer "^2.0.5" -axios@^1.7.4, "axios@>= 0.17.0", axios@>=1.6.5: +axios@>=1.6.5, axios@^1.7.4: version "1.7.8" resolved "https://registry.npmjs.org/axios/-/axios-1.7.8.tgz" integrity sha512-Uu0wb7KNqK2t5K+YQyVCLM76prD5sRFjKHbJYCP1J7JFGEQ6nN7HWn9+04LAeiJ3ji54lgS/gZCH1oxyrf1SPw== @@ -2187,7 +2373,7 @@ axios@^1.7.4, "axios@>= 0.17.0", axios@>=1.6.5: form-data "^4.0.0" proxy-from-env "^1.1.0" -babel-jest@^29.0.0, babel-jest@^29.7.0: +babel-jest@^29.7.0: version "29.7.0" resolved "https://registry.npmjs.org/babel-jest/-/babel-jest-29.7.0.tgz" integrity sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg== @@ -2260,17 +2446,17 @@ base64-js@^1.3.1: resolved "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz" integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== -bech32@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/bech32/-/bech32-2.0.0.tgz" - integrity sha512-LcknSilhIGatDAsY1ak2I8VtGaHNhgMSYVxFrGLXv+xLHytaKZKcaUJJUE7qmBr7h33o5YQwP55pMI0xmkpJwg== - bech32@1.1.4: version "1.1.4" resolved "https://registry.npmjs.org/bech32/-/bech32-1.1.4.tgz" integrity sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ== -bignumber.js@^9.0.0, bignumber.js@^9.0.1, bignumber.js@9.x: +bech32@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/bech32/-/bech32-2.0.0.tgz" + integrity sha512-LcknSilhIGatDAsY1ak2I8VtGaHNhgMSYVxFrGLXv+xLHytaKZKcaUJJUE7qmBr7h33o5YQwP55pMI0xmkpJwg== + +bignumber.js@9.x, bignumber.js@^9.0.0: version "9.1.2" resolved "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.1.2.tgz" integrity sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug== @@ -2428,7 +2614,7 @@ browserify-zlib@^0.2.0: dependencies: pako "~1.0.5" -browserslist@^4.24.0, "browserslist@>= 4.21.0": +browserslist@^4.24.0: version "4.24.2" resolved "https://registry.npmjs.org/browserslist/-/browserslist-4.24.2.tgz" integrity sha512-ZIc+Q62revdMcqC6aChtW4jz3My3klmCO1fEmINZY/8J3EpBg5/A/D0AKmBveUh6pgoeycoMkVMko84tuYS+Gg== @@ -2462,15 +2648,15 @@ buffer-xor@^1.0.3: resolved "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz" integrity sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ== -buffer@^5.5.0: - version "5.7.1" - resolved "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz" - integrity sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ== +buffer@6.0.3, buffer@^6.0.3: + version "6.0.3" + resolved "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz" + integrity sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA== dependencies: base64-js "^1.3.1" - ieee754 "^1.1.13" + ieee754 "^1.2.1" -buffer@^5.7.1: +buffer@^5.5.0, buffer@^5.7.1: version "5.7.1" resolved "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz" integrity sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ== @@ -2478,31 +2664,11 @@ buffer@^5.7.1: base64-js "^1.3.1" ieee754 "^1.1.13" -buffer@^6.0.3, buffer@6.0.3: - version "6.0.3" - resolved "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz" - integrity sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA== - dependencies: - base64-js "^1.3.1" - ieee754 "^1.2.1" - -builtin-modules@^3.3.0: - version "3.3.0" - resolved "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.3.0.tgz" - integrity sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw== - builtin-status-codes@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz" integrity sha512-HpGFw18DgFWlncDfjTa2rcQ4W88O1mC8e8yZ2AvQY5KDaktSTwo+KRf6nHK6FRI5FyRyb/5T6+TSxfP7QyGsmQ== -builtins@^5.0.1: - version "5.1.0" - resolved "https://registry.npmjs.org/builtins/-/builtins-5.1.0.tgz" - integrity sha512-SW9lzGTLvWTP1AY8xeAMZimqDrIaSdLQUcVr9DMef51niJ022Ri87SwRRKYm4A6iHfkPaiVUu/Duw2Wc4J7kKg== - dependencies: - semver "^7.0.0" - call-bind@^1.0.0, call-bind@^1.0.2, call-bind@^1.0.5, call-bind@^1.0.6, call-bind@^1.0.7: version "1.0.7" resolved "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz" @@ -2735,7 +2901,7 @@ create-hash@^1.1.0, create-hash@^1.1.2, create-hash@^1.2.0: ripemd160 "^2.0.1" sha.js "^2.4.0" -create-hmac@^1.1.4, create-hmac@^1.1.7, create-hmac@1.1.7: +create-hmac@1.1.7, create-hmac@^1.1.4, create-hmac@^1.1.7: version "1.1.7" resolved "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz" integrity sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg== @@ -2852,6 +3018,13 @@ data-view-byte-offset@^1.0.0: es-errors "^1.3.0" is-data-view "^1.0.1" +debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.3, debug@^4.3.4, debug@^4.3.5, debug@~4.3.1, debug@~4.3.2: + version "4.3.7" + resolved "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz" + integrity sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ== + dependencies: + ms "^2.1.3" + debug@^3.2.7: version "3.2.7" resolved "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz" @@ -2859,13 +3032,6 @@ debug@^3.2.7: dependencies: ms "^2.1.1" -debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.3, debug@^4.3.4, debug@^4.3.5, debug@~4.3.1, debug@~4.3.2, debug@4: - version "4.3.7" - resolved "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz" - integrity sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ== - dependencies: - ms "^2.1.3" - decimal.js@^10.4.2: version "10.4.3" resolved "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.3.tgz" @@ -2939,7 +3105,7 @@ destr@^2.0.3: resolved "https://registry.npmjs.org/destr/-/destr-2.0.3.tgz" integrity sha512-2N3BOUU4gYMpTP24s5rF5iP7BDr7uNTCs4ozw3kf/eKfvWSIu93GEBi5m427YoyJoeOzQ5smuu4nNAPGb8idSQ== -detect-browser@^5.2.0, detect-browser@5.3.0: +detect-browser@5.3.0, detect-browser@^5.2.0: version "5.3.0" resolved "https://registry.npmjs.org/detect-browser/-/detect-browser-5.3.0.tgz" integrity sha512-53rsFbGdwMwlF7qvCt0ypLM5V5/Mbl0szB7GPN8y9NCcbknYOeVVXdrXEq+90IwAfrrzt6Hd+u2E2ntakICU8w== @@ -3004,11 +3170,6 @@ duplexify@^4.1.2: readable-stream "^3.1.1" stream-shift "^1.0.2" -eastasianwidth@^0.2.0: - version "0.2.0" - resolved "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz" - integrity sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA== - ed25519-hd-key@1.1.2: version "1.1.2" resolved "https://registry.npmjs.org/ed25519-hd-key/-/ed25519-hd-key-1.1.2.tgz" @@ -3053,11 +3214,6 @@ emoji-regex@^8.0.0: resolved "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz" integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== -emoji-regex@^9.2.2: - version "9.2.2" - resolved "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz" - integrity sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg== - end-of-stream@^1.4.1: version "1.4.4" resolved "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz" @@ -3205,7 +3361,7 @@ esbuild-node-externals@1.14.0: find-up "^5.0.0" tslib "^2.4.1" -"esbuild@0.12 - 0.23", esbuild@0.21.1: +esbuild@0.21.1: version "0.21.1" resolved "https://registry.npmjs.org/esbuild/-/esbuild-0.21.1.tgz" integrity sha512-GPqx+FX7mdqulCeQ4TsGZQ3djBJkx5k7zBGtqt9ycVlWNg8llJ4RO9n2vciu8BN2zAEs6lPbPl0asZsAh7oWzg== @@ -3265,14 +3421,7 @@ escodegen@^2.0.0: optionalDependencies: source-map "~0.6.1" -eslint-compat-utils@^0.5.1: - version "0.5.1" - resolved "https://registry.npmjs.org/eslint-compat-utils/-/eslint-compat-utils-0.5.1.tgz" - integrity sha512-3z3vFexKIEnjHE3zCMRo6fn/e44U7T1khUjg+Hp0ZQMCigh28rALD0nPFBcGZuiLC5rLZa2ubQHDRln09JfU2Q== - dependencies: - semver "^7.5.4" - -eslint-config-prettier@*, eslint-config-prettier@9.1.0: +eslint-config-prettier@9.1.0: version "9.1.0" resolved "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz" integrity sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw== @@ -3312,15 +3461,6 @@ eslint-module-utils@^2.12.0, eslint-module-utils@^2.8.1: dependencies: debug "^3.2.7" -eslint-plugin-es-x@^7.5.0: - version "7.8.0" - resolved "https://registry.npmjs.org/eslint-plugin-es-x/-/eslint-plugin-es-x-7.8.0.tgz" - integrity sha512-7Ds8+wAAoV3T+LAKeu39Y5BzXCrGKrcISfgKEqTS4BDN8SFEDQd0S43jiQ8vIa3wUKD07qitZdfzlenSi8/0qQ== - dependencies: - "@eslint-community/eslint-utils" "^4.1.2" - "@eslint-community/regexpp" "^4.11.0" - eslint-compat-utils "^0.5.1" - eslint-plugin-es@^3.0.0: version "3.0.1" resolved "https://registry.npmjs.org/eslint-plugin-es/-/eslint-plugin-es-3.0.1.tgz" @@ -3329,7 +3469,7 @@ eslint-plugin-es@^3.0.0: eslint-utils "^2.0.0" regexpp "^3.0.0" -eslint-plugin-import@*, eslint-plugin-import@^2.25.2, eslint-plugin-import@2.31.0: +eslint-plugin-import@2.31.0: version "2.31.0" resolved "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.31.0.tgz" integrity sha512-ixmkI62Rbc2/w8Vfxyh1jQRTdRTF52VxwRVHl/ykPAmqG+Nb7/kNn+byLP0LxPgI7zWA16Jt82SybJInmMia3A== @@ -3361,23 +3501,6 @@ eslint-plugin-jest@28.9.0: dependencies: "@typescript-eslint/utils" "^6.0.0 || ^7.0.0 || ^8.0.0" -"eslint-plugin-n@^15.0.0 || ^16.0.0 ": - version "16.6.2" - resolved "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-16.6.2.tgz" - integrity sha512-6TyDmZ1HXoFQXnhCTUjVFULReoBPOAjpuiKELMkeP40yffI/1ZRO+d9ug/VC6fqISo2WkuIBk3cvuRPALaWlOQ== - dependencies: - "@eslint-community/eslint-utils" "^4.4.0" - builtins "^5.0.1" - eslint-plugin-es-x "^7.5.0" - get-tsconfig "^4.7.0" - globals "^13.24.0" - ignore "^5.2.4" - is-builtin-module "^3.2.1" - is-core-module "^2.12.1" - minimatch "^3.1.2" - resolve "^1.22.2" - semver "^7.5.3" - eslint-plugin-node@11.1.0: version "11.1.0" resolved "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-11.1.0.tgz" @@ -3398,7 +3521,7 @@ eslint-plugin-prettier@5.2.1: prettier-linter-helpers "^1.0.0" synckit "^0.9.1" -eslint-plugin-promise@^6.0.0, eslint-plugin-promise@7.1.0: +eslint-plugin-promise@7.1.0: version "7.1.0" resolved "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-7.1.0.tgz" integrity sha512-8trNmPxdAy3W620WKDpaS65NlM5yAumod6XeC4LOb+jxlkG4IVcp68c6dXY2ev+uT4U1PtG57YDV6EGAXN0GbQ== @@ -3433,7 +3556,7 @@ eslint-visitor-keys@^4.2.0: resolved "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz" integrity sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw== -eslint@*, "eslint@^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 || ^9", "eslint@^6.0.0 || ^7.0.0 || >=8.0.0", "eslint@^7.0.0 || ^8.0.0 || ^9.0.0", eslint@^8.0.1, "eslint@^8.57.0 || ^9.0.0", eslint@>=4.19.1, eslint@>=5.16.0, eslint@>=6.0.0, eslint@>=7.0.0, eslint@>=8, eslint@>=8.0.0, eslint@9.15.0: +eslint@9.15.0: version "9.15.0" resolved "https://registry.npmjs.org/eslint/-/eslint-9.15.0.tgz" integrity sha512-7CrWySmIibCgT1Os28lUU6upBshZ+GxybLOrmRzi08kS8MBuO8QA7pXEgYgY5W8vK3e74xv0lpjo9DbaGU9Rkw== @@ -3623,7 +3746,7 @@ fast-glob@^3.2.9, fast-glob@^3.3.2: merge2 "^1.3.0" micromatch "^4.0.4" -fast-json-stable-stringify@^2.0.0, fast-json-stable-stringify@^2.1.0, fast-json-stable-stringify@2.x: +fast-json-stable-stringify@2.x, fast-json-stable-stringify@^2.0.0, fast-json-stable-stringify@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz" integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== @@ -3683,15 +3806,7 @@ filter-obj@^1.1.0: resolved "https://registry.npmjs.org/filter-obj/-/filter-obj-1.1.0.tgz" integrity sha512-8rXg1ZnX7xzy2NGDVkBVaAy+lSlPNwad13BtgSlLuxfIslyt5Vg64U7tFcCt4WS1R0hvtnQybT/IyCkGZ3DpXQ== -find-up@^4.0.0: - version "4.1.0" - resolved "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz" - integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== - dependencies: - locate-path "^5.0.0" - path-exists "^4.0.0" - -find-up@^4.1.0: +find-up@^4.0.0, find-up@^4.1.0: version "4.1.0" resolved "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz" integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== @@ -3829,7 +3944,7 @@ get-symbol-description@^1.0.2: es-errors "^1.3.0" get-intrinsic "^1.2.4" -get-tsconfig@^4.7.0, get-tsconfig@^4.7.5: +get-tsconfig@^4.7.5: version "4.8.1" resolved "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.8.1.tgz" integrity sha512-k9PN+cFBmaLWtVz29SkUoqU5O0slLuHJXt/2P+tMVFT+phsSGXGkp9t3rQIqdz0e+06EHNGs3oM6ZX1s2zHxRg== @@ -3850,6 +3965,17 @@ glob-parent@^6.0.2: dependencies: is-glob "^4.0.3" +glob@10.3.14: + version "10.3.14" + resolved "https://registry.npmjs.org/glob/-/glob-10.3.14.tgz" + integrity sha512-4fkAqu93xe9Mk7le9v0y3VrPDqLKHarNi2s4Pv7f2yOvfhWfhc7hRPHC/JyqMqb8B/Dt/eGS4n7ykwf3fOsl8g== + dependencies: + foreground-child "^3.1.0" + jackspeak "^2.3.6" + minimatch "^9.0.1" + minipass "^7.0.4" + path-scurry "^1.11.0" + glob@^10.3.7: version "10.4.5" resolved "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz" @@ -3862,7 +3988,7 @@ glob@^10.3.7: package-json-from-dist "^1.0.0" path-scurry "^1.11.1" -glob@^7.1.3: +glob@^7.1.3, glob@^7.1.4: version "7.2.3" resolved "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz" integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== @@ -3874,41 +4000,11 @@ glob@^7.1.3: once "^1.3.0" path-is-absolute "^1.0.0" -glob@^7.1.4: - version "7.2.3" - resolved "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz" - integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.1.1" - once "^1.3.0" - path-is-absolute "^1.0.0" - -glob@10.3.14: - version "10.3.14" - resolved "https://registry.npmjs.org/glob/-/glob-10.3.14.tgz" - integrity sha512-4fkAqu93xe9Mk7le9v0y3VrPDqLKHarNi2s4Pv7f2yOvfhWfhc7hRPHC/JyqMqb8B/Dt/eGS4n7ykwf3fOsl8g== - dependencies: - foreground-child "^3.1.0" - jackspeak "^2.3.6" - minimatch "^9.0.1" - minipass "^7.0.4" - path-scurry "^1.11.0" - globals@^11.1.0: version "11.12.0" resolved "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz" integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== -globals@^13.24.0: - version "13.24.0" - resolved "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz" - integrity sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ== - dependencies: - type-fest "^0.20.2" - globals@^14.0.0: version "14.0.0" resolved "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz" @@ -4103,13 +4199,6 @@ human-signals@^5.0.0: resolved "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz" integrity sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ== -iconv-lite@^0.4.24: - version "0.4.24" - resolved "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz" - integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== - dependencies: - safer-buffer ">= 2.1.2 < 3" - iconv-lite@0.6.3: version "0.6.3" resolved "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz" @@ -4117,6 +4206,13 @@ iconv-lite@0.6.3: dependencies: safer-buffer ">= 2.1.2 < 3.0.0" +iconv-lite@^0.4.24: + version "0.4.24" + resolved "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz" + integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== + dependencies: + safer-buffer ">= 2.1.2 < 3" + idb-keyval@^6.2.1: version "6.2.1" resolved "https://registry.npmjs.org/idb-keyval/-/idb-keyval-6.2.1.tgz" @@ -4127,12 +4223,12 @@ ieee754@^1.1.13, ieee754@^1.2.1: resolved "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz" integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== -ignore@^5.1.1, ignore@^5.2.0, ignore@^5.2.4, ignore@^5.3.1: +ignore@^5.1.1, ignore@^5.2.0, ignore@^5.3.1: version "5.3.2" resolved "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz" integrity sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g== -immer@^10.1.1, immer@>=9.0: +immer@^10.1.1: version "10.1.1" resolved "https://registry.npmjs.org/immer/-/immer-10.1.1.tgz" integrity sha512-s2MPrmjovJcoMaHtx6K11Ra7oD05NT97w1IC5zpMkT6Atjr7H8LjaDd81iIxUYpMKSRRNMJE703M1Fhr/TctHw== @@ -4166,7 +4262,7 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.3, inherits@~2.0.4, inherits@2: +inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.3, inherits@~2.0.4: version "2.0.4" resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== @@ -4261,13 +4357,6 @@ is-buffer@^2.0.5: resolved "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.5.tgz" integrity sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ== -is-builtin-module@^3.2.1: - version "3.2.1" - resolved "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-3.2.1.tgz" - integrity sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A== - dependencies: - builtin-modules "^3.3.0" - is-bun-module@^1.0.2: version "1.3.0" resolved "https://registry.npmjs.org/is-bun-module/-/is-bun-module-1.3.0.tgz" @@ -4280,7 +4369,7 @@ is-callable@^1.1.3, is-callable@^1.2.7: resolved "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz" integrity sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA== -is-core-module@^2.12.1, is-core-module@^2.13.0, is-core-module@^2.15.1: +is-core-module@^2.13.0, is-core-module@^2.15.1: version "2.15.1" resolved "https://registry.npmjs.org/is-core-module/-/is-core-module-2.15.1.tgz" integrity sha512-z0vtXSwucUJtANQWldhbtbt7BnL0vxiFjIdDLAatwhDYty2bad6s+rijD6Ri4YuYJubLzIJLUidCh09e1djEVQ== @@ -4815,7 +4904,7 @@ jest-resolve-dependencies@^29.7.0: jest-regex-util "^29.6.3" jest-snapshot "^29.7.0" -jest-resolve@*, jest-resolve@^29.7.0: +jest-resolve@^29.7.0: version "29.7.0" resolved "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.7.0.tgz" integrity sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA== @@ -4959,7 +5048,7 @@ jest-worker@^29.7.0: merge-stream "^2.0.0" supports-color "^8.0.0" -jest@*, jest@^29.0.0, jest@29.7.0: +jest@29.7.0: version "29.7.0" resolved "https://registry.npmjs.org/jest/-/jest-29.7.0.tgz" integrity sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw== @@ -4969,7 +5058,7 @@ jest@*, jest@^29.0.0, jest@29.7.0: import-local "^3.0.2" jest-cli "^29.7.0" -jiti@*, jiti@^2.1.2: +jiti@^2.1.2: version "2.4.1" resolved "https://registry.npmjs.org/jiti/-/jiti-2.4.1.tgz" integrity sha512-yPBThwecp1wS9DmoA4x4KR2h3QoslacnDR8ypuFM962kI4/456Iy1oHx2RAgh4jfZNdn0bctsdadceiBUgpU1g== @@ -5185,7 +5274,7 @@ lodash.merge@^4.6.2: resolved "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz" integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== -lodash@^4.17.21, lodash@4.17.21: +lodash@4.17.21, lodash@^4.17.21: version "4.17.21" resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -5325,14 +5414,7 @@ minimatch@^3.0.4, minimatch@^3.1.1, minimatch@^3.1.2: dependencies: brace-expansion "^1.1.7" -minimatch@^9.0.1: - version "9.0.5" - resolved "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz" - integrity sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow== - dependencies: - brace-expansion "^2.0.1" - -minimatch@^9.0.4: +minimatch@^9.0.1, minimatch@^9.0.4: version "9.0.5" resolved "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz" integrity sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow== @@ -5410,7 +5492,9 @@ nanoassert@^1.0.0: integrity sha512-C40jQ3NzfkP53NsO8kEOFd79p4b9kDXQMwgiY1z8ZwrDZgUyom0AHwGegF4Dm99L+YoYhuaB0ceerUcXmqr1rQ== napi-wasm@^1.1.0: - version "1.1.0" + version "1.1.3" + resolved "https://registry.yarnpkg.com/napi-wasm/-/napi-wasm-1.1.3.tgz#7bb95c88e6561f84880bb67195437b1cfbe99224" + integrity sha512-h/4nMGsHjZDCYmQVNODIrYACVJ+I9KItbG+0si6W/jSjdA9JbWDoU4LLeMXVcEQGHjttI2tuXqDrbGF7qkUHHg== natural-compare@^1.4.0: version "1.4.0" @@ -5899,7 +5983,7 @@ prettier-linter-helpers@^1.0.0: dependencies: fast-diff "^1.1.2" -prettier@>=3.0.0, prettier@3.2.5: +prettier@3.2.5: version "3.2.5" resolved "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz" integrity sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A== @@ -5936,7 +6020,7 @@ prompts@^2.0.1: kleur "^3.0.3" sisteransi "^1.0.5" -protobufjs@^7.2.6, protobufjs@7.3.0: +protobufjs@7.3.0: version "7.3.0" resolved "https://registry.npmjs.org/protobufjs/-/protobufjs-7.3.0.tgz" integrity sha512-YWD03n3shzV9ImZRX3ccbjqLxj7NokGN0V/ESiBV5xWqrommYHYiihuIyavq03pWSGqlyvYUFmfoMKd+1rPA/g== @@ -5993,13 +6077,6 @@ pure-rand@^6.0.0: resolved "https://registry.npmjs.org/pure-rand/-/pure-rand-6.1.0.tgz" integrity sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA== -qs@^6.12.3: - version "6.13.1" - resolved "https://registry.npmjs.org/qs/-/qs-6.13.1.tgz" - integrity sha512-EJPeIn0CYrGu+hli1xilKAPXODtJ12T0sP63Ijx2/khC2JtuaN3JyNIpvmnkmaEtha9ocbG4A4cMcr+TvqvwQg== - dependencies: - side-channel "^1.0.6" - qs@6.10.3: version "6.10.3" resolved "https://registry.npmjs.org/qs/-/qs-6.10.3.tgz" @@ -6014,6 +6091,13 @@ qs@6.11.2: dependencies: side-channel "^1.0.4" +qs@^6.12.3: + version "6.13.1" + resolved "https://registry.npmjs.org/qs/-/qs-6.13.1.tgz" + integrity sha512-EJPeIn0CYrGu+hli1xilKAPXODtJ12T0sP63Ijx2/khC2JtuaN3JyNIpvmnkmaEtha9ocbG4A4cMcr+TvqvwQg== + dependencies: + side-channel "^1.0.6" + query-string@7.1.3: version "7.1.3" resolved "https://registry.npmjs.org/query-string/-/query-string-7.1.3.tgz" @@ -6074,7 +6158,7 @@ react-is@^18.0.0: resolved "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz" integrity sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg== -"react@^16.8.0 || ^17.0.0 || ^18.0.0", react@^18.3.1, react@>=16.8: +react@^18.3.1: version "18.3.1" resolved "https://registry.npmjs.org/react/-/react-18.3.1.tgz" integrity sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ== @@ -6191,7 +6275,7 @@ resolve.exports@^2.0.0: resolved "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.3.tgz" integrity sha512-OcXjMsGdhL4XnbShKpAcSqPMzQoYkYyhbEaeSko47MjRP9NfEQMhZkXL1DoFlt9LWQn4YttrdnV6X2OiyzBi+A== -resolve@^1.10.1, resolve@^1.17.0, resolve@^1.20.0, resolve@^1.22.2, resolve@^1.22.4: +resolve@^1.10.1, resolve@^1.17.0, resolve@^1.20.0, resolve@^1.22.4: version "1.22.8" resolved "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz" integrity sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw== @@ -6240,13 +6324,6 @@ run-parallel@^1.1.9: dependencies: queue-microtask "^1.2.2" -rxjs@^7.5.5, rxjs@^7.8.1: - version "7.8.1" - resolved "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz" - integrity sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg== - dependencies: - tslib "^2.1.0" - rxjs@6: version "6.6.7" resolved "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz" @@ -6254,6 +6331,13 @@ rxjs@6: dependencies: tslib "^1.9.0" +rxjs@^7.5.5, rxjs@^7.8.1: + version "7.8.1" + resolved "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz" + integrity sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg== + dependencies: + tslib "^2.1.0" + safe-array-concat@^1.1.2: version "1.1.2" resolved "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.2.tgz" @@ -6269,12 +6353,7 @@ safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== -safe-buffer@~5.1.0: - version "5.1.2" - resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz" - integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== - -safe-buffer@~5.1.1: +safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "5.1.2" resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz" integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== @@ -6310,22 +6389,12 @@ scryptsy@2.1.0: resolved "https://registry.npmjs.org/scryptsy/-/scryptsy-2.1.0.tgz" integrity sha512-1CdSqHQowJBnMAFyPEBRfqag/YP9OF394FV+4YREIJX4ljD7OxvQRDayyoyyCk+senRjSkP6VnUNQmVQqB6g7w== -semver@^6.1.0: +semver@^6.1.0, semver@^6.3.0, semver@^6.3.1: version "6.3.1" resolved "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz" integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== -semver@^6.3.0: - version "6.3.1" - resolved "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz" - integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== - -semver@^6.3.1: - version "6.3.1" - resolved "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz" - integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== - -semver@^7.0.0, semver@^7.3.5, semver@^7.5.3, semver@^7.5.4, semver@^7.6.0, semver@^7.6.3: +semver@^7.3.5, semver@^7.5.3, semver@^7.5.4, semver@^7.6.0, semver@^7.6.3: version "7.6.3" resolved "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz" integrity sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A== @@ -6397,12 +6466,7 @@ signal-exit@^3.0.2, signal-exit@^3.0.3, signal-exit@^3.0.7: resolved "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz" integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== -signal-exit@^4.0.1: - version "4.1.0" - resolved "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz" - integrity sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw== - -signal-exit@^4.1.0: +signal-exit@^4.0.1, signal-exit@^4.1.0: version "4.1.0" resolved "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz" integrity sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw== @@ -6522,20 +6586,6 @@ strict-uri-encode@^2.0.0: resolved "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz" integrity sha512-QwiXZgpRcKkhTj2Scnn++4PKtWsH0kpzZ62L2R6c/LUVYv7hVnZqcg2+sMuT6R7Jusu1vviK/MFsu6kNJfWlEQ== -string_decoder@^1.0.0, string_decoder@^1.1.1, string_decoder@^1.3.0: - version "1.3.0" - resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz" - integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== - dependencies: - safe-buffer "~5.2.0" - -string_decoder@~1.1.1: - version "1.1.1" - resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz" - integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== - dependencies: - safe-buffer "~5.1.0" - string-length@^4.0.1: version "4.0.2" resolved "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz" @@ -6553,23 +6603,14 @@ string-length@^4.0.1: is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.1" -string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: - version "4.2.3" - resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== +string-width@4.1.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3, string-width@^5.0.1, string-width@^5.1.2: + version "4.1.0" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.1.0.tgz#ba846d1daa97c3c596155308063e075ed1c99aff" + integrity sha512-NrX+1dVVh+6Y9dnQ19pR0pP4FiEIlUvdTGn8pw6CKTNq5sgib2nIhmUNT5TAmhWmvKr3WcxBcP3E8nWezuipuQ== dependencies: emoji-regex "^8.0.0" is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - -string-width@^5.0.1, string-width@^5.1.2: - version "5.1.2" - resolved "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz" - integrity sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA== - dependencies: - eastasianwidth "^0.2.0" - emoji-regex "^9.2.2" - strip-ansi "^7.0.1" + strip-ansi "^5.2.0" string.prototype.trim@^1.2.9: version "1.2.9" @@ -6599,6 +6640,20 @@ string.prototype.trimstart@^1.0.8: define-properties "^1.2.1" es-object-atoms "^1.0.0" +string_decoder@^1.0.0, string_decoder@^1.1.1, string_decoder@^1.3.0: + version "1.3.0" + resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz" + integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== + dependencies: + safe-buffer "~5.2.0" + +string_decoder@~1.1.1: + version "1.1.1" + resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz" + integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== + dependencies: + safe-buffer "~5.1.0" + "strip-ansi-cjs@npm:strip-ansi@^6.0.1": version "6.0.1" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz" @@ -6606,6 +6661,13 @@ string.prototype.trimstart@^1.0.8: dependencies: ansi-regex "^5.0.1" +strip-ansi@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" + integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== + dependencies: + ansi-regex "^4.1.0" + strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz" @@ -6797,22 +6859,12 @@ tsconfig-paths@^3.15.0: minimist "^1.2.6" strip-bom "^3.0.0" -tslib@^1.9.0, tslib@1.14.1: +tslib@1.14.1, tslib@^1.9.0: version "1.14.1" resolved "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== -tslib@^2.1.0: - version "2.8.1" - resolved "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz" - integrity sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w== - -tslib@^2.4.1: - version "2.8.1" - resolved "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz" - integrity sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w== - -tslib@^2.6.2: +tslib@^2.1.0, tslib@^2.4.1, tslib@^2.6.2: version "2.8.1" resolved "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz" integrity sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w== @@ -6839,11 +6891,6 @@ type-detect@4.0.8: resolved "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz" integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== -type-fest@^0.20.2: - version "0.20.2" - resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz" - integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== - type-fest@^0.21.3: version "0.21.3" resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz" @@ -6908,7 +6955,7 @@ typescript-eslint@8.15.0: "@typescript-eslint/parser" "8.15.0" "@typescript-eslint/utils" "8.15.0" -"typescript@>= 4.4.x <= 5.2.x", typescript@>=4.2.0, "typescript@>=4.3 <6", typescript@5.4.5: +typescript@5.4.5: version "5.4.5" resolved "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz" integrity sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ== @@ -7053,16 +7100,16 @@ util@^0.12.3, util@^0.12.4, util@^0.12.5: is-typed-array "^1.1.3" which-typed-array "^1.1.2" -uuid@^9.0.1: - version "9.0.1" - resolved "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz" - integrity sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA== - uuid@8.3.2: version "8.3.2" resolved "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz" integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== +uuid@^9.0.1: + version "9.0.1" + resolved "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz" + integrity sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA== + v8-to-istanbul@^9.0.1: version "9.3.0" resolved "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.3.0.tgz" @@ -7107,16 +7154,16 @@ web-encoding@^1.1.5: optionalDependencies: "@zxing/text-encoding" "0.9.0" -webextension-polyfill@^0.10.0: - version "0.10.0" - resolved "https://registry.npmjs.org/webextension-polyfill/-/webextension-polyfill-0.10.0.tgz" - integrity sha512-c5s35LgVa5tFaHhrZDnr3FpQpjj1BB+RXhLTYUxGqBVN460HkbM8TBtEqdXWbpTKfzwCcjAZVF7zXCYSKtcp9g== - "webextension-polyfill@>=0.10.0 <1.0": version "0.12.0" resolved "https://registry.npmjs.org/webextension-polyfill/-/webextension-polyfill-0.12.0.tgz" integrity sha512-97TBmpoWJEE+3nFBQ4VocyCdLKfw54rFaJ6EVQYLBCXqCIpLSZkwGgASpv4oPt9gdKCJ80RJlcmNzNn008Ag6Q== +webextension-polyfill@^0.10.0: + version "0.10.0" + resolved "https://registry.npmjs.org/webextension-polyfill/-/webextension-polyfill-0.10.0.tgz" + integrity sha512-c5s35LgVa5tFaHhrZDnr3FpQpjj1BB+RXhLTYUxGqBVN460HkbM8TBtEqdXWbpTKfzwCcjAZVF7zXCYSKtcp9g== + webidl-conversions@^3.0.0: version "3.0.1" resolved "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz"