diff --git a/package.json b/package.json index 86670df..f9bf4ce 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "CasperWalletCore", - "version": "1.1.5", + "version": "1.2.0", "main": "index.ts", "repository": { "type": "git", @@ -15,8 +15,8 @@ "@noble/hashes": "^1.8.0", "@react-native/typescript-config": "0.74.83", "@types/uuid": "^10.0.0", - "apisauce": "^3.1.1", - "casper-js-sdk": "5.0.6", + "apisauce": "^3.2.2", + "casper-js-sdk": "5.0.10", "date-fns": "^2.30.0", "decimal.js": "^10.4.3", "lru-cache": "10.4.3", diff --git a/src/data/data-providers/http/http.ts b/src/data/data-providers/http/http.ts index 0cf92d5..3e73694 100644 --- a/src/data/data-providers/http/http.ts +++ b/src/data/data-providers/http/http.ts @@ -177,8 +177,8 @@ export class HttpDataProvider implements IHttpDataProvider { }); } - setAuthHeader(token: string) { - this.instance.setHeader(HttpDataProvider.AUTH_HEADER_KEY, `Bearer ${token}`); + setAuthHeader(value: string) { + this.instance.setHeader(HttpDataProvider.AUTH_HEADER_KEY, value); } removeAuthHeader() { diff --git a/src/data/dto/common.ts b/src/data/dto/common.ts index dc9094b..557efc9 100644 --- a/src/data/dto/common.ts +++ b/src/data/dto/common.ts @@ -15,6 +15,7 @@ import { SupportedMarketDataProviders, } from '../../domain'; import { Maybe } from '../../typings'; +import { ITokenMarketData } from '../repositories'; export function getCsprFiatAmount(amount: string | number, rate?: string | number) { const isZeroRate = Number(rate ?? 0) === 0; @@ -95,6 +96,8 @@ export function getMarketDataProviderUrl( latestVersionContractHash?: string | null, ) { switch (marketDataProvider) { + case 'CsprTrade': + return 'https://cspr.trade/'; // TODO link to token page case 'CoinGecko': return coingeckoId ? `https://www.coingecko.com/en/coins/${coingeckoId}` : null; case 'FriendlyMarket': @@ -122,3 +125,17 @@ export function isNftAction(entryPointName: string, contractTypeId?: Maybe a.dex_id - b.dex_id)?.[0]; +} + +export const dexIdToMarketDataProviderMap: Record = { + 1: 'CsprTrade', + 2: 'CoinGecko', + 3: 'FriendlyMarket', +}; diff --git a/src/data/dto/deploys/ActionResults.ts b/src/data/dto/deploys/ActionResults.ts index ed7ebc4..4cd5cb9 100644 --- a/src/data/dto/deploys/ActionResults.ts +++ b/src/data/dto/deploys/ActionResults.ts @@ -16,7 +16,7 @@ import { NFTEntryPointType, } from '../../../domain'; import { getAccountInfoFromMap, getNftTokenUrlsMap } from '../common'; -import { ExtendedCloudDeploy } from '../../repositories'; +import { ExtendedCloudDeploy, ICloudTransactionFeedItem } from '../../repositories'; import { getCsprFiatAmount } from '../common'; const mapCep18EntryPointIdToName: Record = { @@ -36,7 +36,7 @@ const mapNftentryPointIdToName: Record = { export function getCep18ActionsResult( activePublicKey: string, - deploy?: Partial, + deploy?: Partial, accountInfoMap: Record = {}, ) { return ( @@ -93,7 +93,7 @@ export function getNftActionsResult( activePublicKey: string, network: Network, collectionHash: string, - deploy?: Partial, + deploy?: Partial, accountInfoMap: Record = {}, ) { return ( @@ -141,7 +141,7 @@ export function getNftActionsResult( export function getTransferActionsResult( activePublicKey: string, - deploy?: Partial, + deploy?: Partial, accountInfoMap: Record = {}, ) { return ( @@ -180,10 +180,7 @@ export function getTransferActionsResult( amount: action.amount, decimalAmount: getDecimalTokenBalance(action.amount, CSPR_COIN.decimals), formattedDecimalAmount: formatTokenBalance(action.amount, CSPR_COIN.decimals), - fiatAmount: getCsprFiatAmount( - action.amount, - deploy?.time_transaction_currency_rate ?? deploy?.rate, - ), + fiatAmount: getCsprFiatAmount(action.amount, deploy?.rate), }; }) ?? [] ); diff --git a/src/data/dto/deploys/AssociatedKeysDeployDto.ts b/src/data/dto/deploys/AssociatedKeysDeployDto.ts index 386ec91..dfa4e35 100644 --- a/src/data/dto/deploys/AssociatedKeysDeployDto.ts +++ b/src/data/dto/deploys/AssociatedKeysDeployDto.ts @@ -1,6 +1,6 @@ import { DeployDto } from './DeployDto'; import { getEntryPoint } from './common'; -import { ExtendedCloudDeploy } from '../../repositories'; +import { ExtendedCloudDeploy, ICloudTransactionFeedItem } from '../../repositories'; import { IAccountInfo, IAssociatedKeysDeploy, Network } from '../../../domain'; import { Maybe } from '../../../typings'; @@ -8,7 +8,7 @@ export class AssociatedKeysDeployDto extends DeployDto implements IAssociatedKey constructor( network: Network, activePublicKey: string, - data?: Partial, + data?: Partial, accountInfoMap: Record = {}, ) { super(network, activePublicKey, data, accountInfoMap); diff --git a/src/data/dto/deploys/AuctionDeployDto.ts b/src/data/dto/deploys/AuctionDeployDto.ts index e4f0691..a740853 100644 --- a/src/data/dto/deploys/AuctionDeployDto.ts +++ b/src/data/dto/deploys/AuctionDeployDto.ts @@ -10,7 +10,7 @@ import { getDeployAmount, getEntryPoint } from './common'; import { deriveKeyType, getAccountInfoFromMap } from '../common'; import { formatTokenBalance, getDecimalTokenBalance } from '../../../utils'; import { DeployDto } from './DeployDto'; -import { ExtendedCloudDeploy } from '../../repositories'; +import { ExtendedCloudDeploy, ICloudTransactionFeedItem } from '../../repositories'; import { Maybe } from '../../../typings'; import { getCsprFiatAmount } from '../common'; @@ -18,7 +18,7 @@ export class AuctionDeployDto extends DeployDto implements IAuctionDeploy { constructor( network: Network, activePublicKey: string, - data?: Partial, + data?: Partial, accountInfoMap: Record = {}, ) { super(network, activePublicKey, data, accountInfoMap); @@ -29,10 +29,7 @@ export class AuctionDeployDto extends DeployDto implements IAuctionDeploy { this.amount = getDeployAmount(data?.args); this.decimalAmount = getDecimalTokenBalance(this.amount, this.decimals); this.formattedDecimalAmount = formatTokenBalance(this.amount, this.decimals); - this.fiatAmount = getCsprFiatAmount( - this.amount, - data?.time_transaction_currency_rate ?? data?.rate, - ); + this.fiatAmount = getCsprFiatAmount(this.amount, data?.rate); const fromValidator = getFromValidator(data); const fromValidatorKeyType = deriveKeyType(fromValidator); @@ -76,7 +73,9 @@ export class AuctionDeployDto extends DeployDto implements IAuctionDeploy { readonly fiatAmount: string; } -function getFromValidator(data?: Partial): string | null { +function getFromValidator( + data?: Partial, +): string | null { const entryPoint = getEntryPoint(data); if (entryPoint === 'undelegate' && data?.args?.validator?.cl_type === 'PublicKey') { @@ -88,7 +87,7 @@ function getFromValidator(data?: Partial): string | null { return null; } -function getToValidator(data?: Partial) { +function getToValidator(data?: Partial) { const entryPoint = getEntryPoint(data); if (data?.args?.new_validator) { diff --git a/src/data/dto/deploys/Cep18DeployDto.ts b/src/data/dto/deploys/Cep18DeployDto.ts index f8f1c1a..71619d1 100644 --- a/src/data/dto/deploys/Cep18DeployDto.ts +++ b/src/data/dto/deploys/Cep18DeployDto.ts @@ -13,7 +13,7 @@ import { isNotEmpty, } from '../../../utils'; import { DeployDto } from './DeployDto'; -import { ExtendedCloudDeploy } from '../../repositories'; +import { ExtendedCloudDeploy, ICloudTransactionFeedItem } from '../../repositories'; import { AccountKeyType, CEP18EntryPointType, @@ -23,13 +23,18 @@ import { SupportedMarketDataProviders, } from '../../../domain'; import { Maybe } from '../../../typings'; -import { getAccountInfoFromMap, getMarketDataProviderUrl } from '../common'; +import { + dexIdToMarketDataProviderMap, + getAccountInfoFromMap, + getMarketDataProviderUrl, + getPreferredTokenMarketData, +} from '../common'; export class Cep18DeployDto extends DeployDto implements ICep18Deploy { constructor( network: Network, activePublicKey: string, - data?: Partial, + data?: Partial, accountInfoMap: Record = {}, ) { super(network, activePublicKey, data, accountInfoMap); @@ -51,26 +56,15 @@ export class Cep18DeployDto extends DeployDto implements ICep18Deploy { this.recipientKeyType = this.recipientAccountInfo?.publicKey ? 'publicKey' : recipientKeyType; this.isReceive = isKeysEqual(activePublicKey, this.recipientKey); - this.fiatAmount = getCep18FiatAmount( - this.decimalAmount, - data?.contract_package?.coingecko_data?.price ?? - data?.contract_package?.friendlymarket_data?.price ?? - 0, - false, - ); - this.formattedFiatAmount = getCep18FiatAmount( - this.decimalAmount, - data?.contract_package?.coingecko_data?.price ?? - data?.contract_package?.friendlymarket_data?.price ?? - 0, - true, - ); + const tokenMarketData = getPreferredTokenMarketData(data?.contract_package?.token_market_data); + const fiatRate = tokenMarketData?.latest_rate ?? 0; + + this.fiatAmount = getCep18FiatAmount(this.decimalAmount, fiatRate, false); + this.formattedFiatAmount = getCep18FiatAmount(this.decimalAmount, fiatRate, true); this.fiatCurrency = 'USD'; - this.marketDataProvider = data?.contract_package?.coingecko_data?.price - ? 'CoinGecko' - : data?.contract_package?.friendlymarket_data?.price - ? 'FriendlyMarket' - : null; + this.marketDataProvider = tokenMarketData + ? dexIdToMarketDataProviderMap[tokenMarketData.dex_id] + : null; this.marketDataProviderUrl = getMarketDataProviderUrl( this.marketDataProvider, data?.contract_package?.coingecko_id, @@ -99,7 +93,7 @@ export class Cep18DeployDto extends DeployDto implements ICep18Deploy { } export function getCep18RecipientKeyAndType( - data?: Partial, + data?: Partial, ): Pick { const recipient = guardedDeriveSplitDataFromArguments(data?.args?.recipient, 'Hash'); const recipientAccount = guardedDeriveSplitDataFromArguments(data?.args?.recipient, 'Account'); @@ -135,7 +129,7 @@ export function getCep18RecipientKeyAndType( export function derivePublicKeyFromCep18ActionResults( accountHash: string, - deploy?: Partial, + deploy?: Partial, ) { return deploy?.ft_token_actions ?.reduce((acc, cur) => { diff --git a/src/data/dto/deploys/Cep18transferDeployDto.ts b/src/data/dto/deploys/Cep18transferDeployDto.ts index 9ce61b5..1fc03ce 100644 --- a/src/data/dto/deploys/Cep18transferDeployDto.ts +++ b/src/data/dto/deploys/Cep18transferDeployDto.ts @@ -20,7 +20,12 @@ import { SupportedMarketDataProviders, } from '../../../domain'; -import { getAccountInfoFromMap, getMarketDataProviderUrl } from '../common'; +import { + dexIdToMarketDataProviderMap, + getAccountInfoFromMap, + getMarketDataProviderUrl, + getPreferredTokenMarketData, +} from '../common'; import { getCsprFiatAmount } from '../common'; import { Maybe } from '../../../typings'; import { IErc20TokensTransferResponse } from '../../repositories'; @@ -78,26 +83,15 @@ export class Cep18TransferDeployDto implements ICep18Deploy { this.fiatPaymentAmount = getCsprFiatAmount(this.paymentAmount, data?.deploy?.rate); this.nftActionsResult = []; - this.fiatAmount = getCep18FiatAmount( - this.decimalAmount, - data?.contract_package?.coingecko_data?.price ?? - data?.contract_package?.friendlymarket_data?.price ?? - 0, - false, - ); - this.formattedFiatAmount = getCep18FiatAmount( - this.decimalAmount, - data?.contract_package?.coingecko_data?.price ?? - data?.contract_package?.friendlymarket_data?.price ?? - 0, - true, - ); + const tokenMarketData = getPreferredTokenMarketData(data?.contract_package?.token_market_data); + const fiatRate = tokenMarketData?.latest_rate ?? 0; + + this.fiatAmount = getCep18FiatAmount(this.decimalAmount, fiatRate, false); + this.formattedFiatAmount = getCep18FiatAmount(this.decimalAmount, fiatRate, true); this.fiatCurrency = 'USD'; - this.marketDataProvider = data?.contract_package?.coingecko_data?.price - ? 'CoinGecko' - : data?.contract_package?.friendlymarket_data?.price - ? 'FriendlyMarket' - : null; + this.marketDataProvider = tokenMarketData + ? dexIdToMarketDataProviderMap[tokenMarketData.dex_id] + : null; this.marketDataProviderUrl = getMarketDataProviderUrl( this.marketDataProvider, data?.contract_package?.coingecko_id, diff --git a/src/data/dto/deploys/CsprMarketDeployDto.ts b/src/data/dto/deploys/CsprMarketDeployDto.ts index a5e72dc..16b204c 100644 --- a/src/data/dto/deploys/CsprMarketDeployDto.ts +++ b/src/data/dto/deploys/CsprMarketDeployDto.ts @@ -18,7 +18,7 @@ import { Network, } from '../../../domain'; import { DeployDto } from './DeployDto'; -import { ExtendedCloudDeploy } from '../../repositories'; +import { ExtendedCloudDeploy, ICloudTransactionFeedItem } from '../../repositories'; import { Maybe } from '../../../typings'; import { getAccountInfoFromMap, getCsprFiatAmount, getNftTokenUrlsMap } from '../common'; @@ -26,7 +26,7 @@ export class CsprMarketDeployDto extends DeployDto implements ICasperMarketDeplo constructor( network: Network, activePublicKey: string, - data?: Partial, + data?: Partial, accountInfoMap: Record = {}, ) { super(network, activePublicKey, data, accountInfoMap); @@ -50,10 +50,7 @@ export class CsprMarketDeployDto extends DeployDto implements ICasperMarketDeplo this.amount = getDeployAmount(data?.args); this.decimalAmount = getDecimalTokenBalance(this.amount, CSPR_COIN.decimals); this.formattedDecimalAmount = formatTokenBalance(this.amount, CSPR_COIN.decimals); - this.fiatAmount = getCsprFiatAmount( - this.amount, - data?.time_transaction_currency_rate ?? data?.rate, - ); + this.fiatAmount = getCsprFiatAmount(this.amount, data?.rate); this.iconUrl = data?.contract_package?.icon_url ?? null; } @@ -74,7 +71,7 @@ export class CsprMarketDeployDto extends DeployDto implements ICasperMarketDeplo } export function getOffererFormDeploy( - deploy?: Partial, + deploy?: Partial, ): Pick { const offererHash = guardedDeriveSplitDataFromArguments(deploy?.args?.offerer, 'Account'); diff --git a/src/data/dto/deploys/DeployDto.ts b/src/data/dto/deploys/DeployDto.ts index 2de5945..e79bdb7 100644 --- a/src/data/dto/deploys/DeployDto.ts +++ b/src/data/dto/deploys/DeployDto.ts @@ -18,7 +18,7 @@ import { getNftActionsResult, getTransferActionsResult, } from './ActionResults'; -import { ExtendedCloudDeploy } from '../../repositories'; +import { ExtendedCloudDeploy, ICloudTransactionFeedItem } from '../../repositories'; import { Maybe } from '../../../typings'; import { getCsprFiatAmount } from '../common'; @@ -26,7 +26,7 @@ export class DeployDto implements IDeploy { constructor( network: Network, activePublicKey: string, - data?: Partial, + data?: Partial, accountInfoMap: Record = {}, ) { this.deployHash = data?.deploy_hash ?? ''; @@ -38,16 +38,10 @@ export class DeployDto implements IDeploy { this.timestamp = data?.timestamp ?? ''; this.cost = data?.consumed_gas ?? '0'; this.formattedCost = formatTokenBalance(this.cost, CSPR_COIN.decimals); - this.fiatCost = getCsprFiatAmount( - this.cost, - data?.time_transaction_currency_rate ?? data?.rate, - ); + this.fiatCost = getCsprFiatAmount(this.cost, data?.rate); this.paymentAmount = data?.payment_amount ?? '0'; this.formattedPaymentAmount = formatTokenBalance(this.paymentAmount, CSPR_COIN.decimals); - this.fiatPaymentAmount = getCsprFiatAmount( - this.paymentAmount, - data?.time_transaction_currency_rate ?? data?.rate, - ); + this.fiatPaymentAmount = getCsprFiatAmount(this.paymentAmount, data?.rate); this.contractHash = data?.contract_hash ?? ''; this.contractPackageHash = data?.contract_package_hash ?? ''; this.iconUrl = data?.contract_package?.icon_url ?? null; @@ -97,7 +91,9 @@ export class DeployDto implements IDeploy { readonly cep18ActionsResult: ICep18ActionsResult[]; } -export function getDeployStatus(deploy?: Partial): DeployStatus { +export function getDeployStatus( + deploy?: Partial, +): DeployStatus { const status = deploy?.status as DeployStatus | undefined; if (deploy?.error_message) { diff --git a/src/data/dto/deploys/NativeCsprDeployDto.ts b/src/data/dto/deploys/NativeCsprDeployDto.ts index baa6283..5269a2b 100644 --- a/src/data/dto/deploys/NativeCsprDeployDto.ts +++ b/src/data/dto/deploys/NativeCsprDeployDto.ts @@ -8,7 +8,7 @@ import { } from '../../../domain'; import { derivePublicKeyFromTransfersActionResults, getDeployAmount } from './common'; import { DeployDto } from './DeployDto'; -import { ExtendedCloudDeploy } from '../../repositories'; +import { ExtendedCloudDeploy, ICloudTransactionFeedItem } from '../../repositories'; import { Maybe } from '../../../typings'; import { getAccountInfoFromMap, getCsprFiatAmount } from '../common'; @@ -16,7 +16,7 @@ export class NativeCsprDeployDto extends DeployDto implements INativeCsprDeploy constructor( network: Network, activePublicKey: string, - data?: Partial, + data?: Partial, accountInfoMap: Record = {}, ) { super(network, activePublicKey, data, accountInfoMap); @@ -36,10 +36,7 @@ export class NativeCsprDeployDto extends DeployDto implements INativeCsprDeploy this.formattedDecimalAmount = formatTokenBalance(this.amount, this.decimals); this.entryPoint = null; this.contractName = null; - this.fiatAmount = getCsprFiatAmount( - this.amount, - data?.time_transaction_currency_rate ?? data?.rate, - ); + this.fiatAmount = getCsprFiatAmount(this.amount, data?.rate); } readonly entryPoint: Maybe; @@ -57,7 +54,7 @@ export class NativeCsprDeployDto extends DeployDto implements INativeCsprDeploy } function getNativeTransferRecipientKey( - data?: Partial, + data?: Partial, ): Pick { const recipientKeyType: AccountKeyType = data?.args?.target?.cl_type === 'PublicKey' ? 'publicKey' : 'accountHash'; diff --git a/src/data/dto/deploys/NftDeployDto.ts b/src/data/dto/deploys/NftDeployDto.ts index e4e57a1..f9f1494 100644 --- a/src/data/dto/deploys/NftDeployDto.ts +++ b/src/data/dto/deploys/NftDeployDto.ts @@ -7,7 +7,7 @@ import { guardedDeriveSplitDataFromArguments, } from './common'; import { DeployDto } from './DeployDto'; -import { ExtendedCloudDeploy } from '../../repositories'; +import { ExtendedCloudDeploy, ICloudTransactionFeedItem } from '../../repositories'; import { isKeysEqual } from '../../../utils'; import { AccountKeyType, @@ -23,7 +23,7 @@ export class NftDeployDto extends DeployDto implements INftDeploy { constructor( network: Network, activePublicKey: string, - data?: Partial, + data?: Partial, accountInfoMap: Record = {}, ) { super(network, activePublicKey, data, accountInfoMap); @@ -66,7 +66,7 @@ export class NftDeployDto extends DeployDto implements INftDeploy { } export function getNftRecipientKeys( - data?: Partial, + data?: Partial, ): Pick { const tokenOwner = guardedDeriveSplitDataFromArguments(data?.args?.token_owner, 'Account'); const owner = guardedDeriveSplitDataFromArguments(data?.args?.owner, 'Account'); diff --git a/src/data/dto/deploys/common.ts b/src/data/dto/deploys/common.ts index 1d20ee0..d85d011 100644 --- a/src/data/dto/deploys/common.ts +++ b/src/data/dto/deploys/common.ts @@ -19,11 +19,19 @@ import { Network, } from '../../../domain'; -import { ExtendedCloudDeploy, ExtendedDeployArgsResult, IApiDeployArgs } from '../../repositories'; +import { + ExtendedCloudDeploy, + ExtendedDeployArgsResult, + IApiDeployArgs, + ICloudTransactionFeedItem, +} from '../../repositories'; import { Maybe } from '../../../typings'; import { getHashByType, isCep18Action, isNftAction } from '../common'; -export function getDeployType(network: Network, deploy?: Partial): DeployType { +export function getDeployType( + network: Network, + deploy?: Partial, +): DeployType { const contractTypeId = deploy?.contract_package?.latest_version_contract_type_id || deploy?.contract_package?.contract_type_id; @@ -127,10 +135,13 @@ export const getAccountHashesFromDeployActionResults = (deploy: IDeploy): string }; export const getNftTokensQuantity = ( - data?: Partial, + data?: Partial, excludedEntryPoints: string[] = [], ) => { - if (data?.entry_point?.name && excludedEntryPoints.includes(data?.entry_point?.name)) { + if ( + data?.contract_entrypoint?.name && + excludedEntryPoints.includes(data.contract_entrypoint.name) + ) { return null; } @@ -147,13 +158,13 @@ export const getNftTokensQuantity = ( return null; }; -export function getEntryPoint(data?: Partial) { - return data?.entry_point?.name ?? data?.contract_entrypoint?.name; +export function getEntryPoint(data?: Partial) { + return /*data?.entry_point?.name ??*/ data?.contract_entrypoint?.name; } export function derivePublicKeyFromTransfersActionResults( accountHash: string, - deploy?: Partial, + deploy?: Partial, ) { return deploy?.transfers ?.reduce((acc, cur) => { @@ -167,7 +178,7 @@ export function derivePublicKeyFromTransfersActionResults( export function derivePublicKeyFromNftActionResults( accountHash: string, - deploy?: Partial, + deploy?: Partial, ) { return deploy?.nft_token_actions ?.reduce((acc, cur) => { @@ -269,7 +280,7 @@ export function getCollectionHashFormDeploy( network: Network, contractHash: string, contractPackageHash: string, - deploy?: Partial, + deploy?: Partial, ) { const collection = deploy?.args?.collection; diff --git a/src/data/dto/deploys/index.ts b/src/data/dto/deploys/index.ts index 9127b74..f8e798c 100644 --- a/src/data/dto/deploys/index.ts +++ b/src/data/dto/deploys/index.ts @@ -1,4 +1,4 @@ -import { ExtendedCloudDeploy } from '../../repositories'; +import { ExtendedCloudDeploy, ICloudTransactionFeedItem } from '../../repositories'; import { NativeCsprDeployDto } from './NativeCsprDeployDto'; import { Cep18DeployDto } from './Cep18DeployDto'; import { NftDeployDto } from './NftDeployDto'; @@ -16,7 +16,7 @@ export function processDeploy( activePublicKey: string, network: Network, accountInfoMap: Record, - data?: Partial, + data?: Partial, ): IDeploy { const type = getDeployType(network, data); diff --git a/src/data/dto/tokens.ts b/src/data/dto/tokens.ts index 3f48b13..380bd58 100644 --- a/src/data/dto/tokens.ts +++ b/src/data/dto/tokens.ts @@ -12,7 +12,11 @@ import { } from '../../domain'; import { ApiToken, IGetCsprBalanceResponse, IGetCurrencyRateResponse } from '../repositories'; import { Maybe } from '../../typings'; -import { getMarketDataProviderUrl } from './common'; +import { + dexIdToMarketDataProviderMap, + getMarketDataProviderUrl, + getPreferredTokenMarketData, +} from './common'; export class TokenDto implements ITokenWithFiatBalance { constructor(network: Network, apiToken?: Partial) { @@ -28,23 +32,16 @@ export class TokenDto implements ITokenWithFiatBalance { this.decimalBalance = getDecimalTokenBalance(this.balance, this.decimals); this.formattedDecimalBalance = formatTokenBalance(this.balance, this.decimals); this.isNative = this.symbol === 'CSPR'; - this.fiatBalance = getCep18FiatAmount( - this.decimalBalance, - apiToken?.coingecko_data?.price ?? apiToken?.friendlymarket_data?.price ?? 0, - false, - ); - this.formattedFiatBalance = getCep18FiatAmount( - this.decimalBalance, - apiToken?.coingecko_data?.price ?? apiToken?.friendlymarket_data?.price ?? 0, - true, - ); - this.fiatPrice = apiToken?.coingecko_data?.price ?? apiToken?.friendlymarket_data?.price ?? 0; + + const tokenMarketData = getPreferredTokenMarketData(apiToken?.token_market_data); + + this.fiatPrice = tokenMarketData?.latest_rate ?? 0; + this.fiatBalance = getCep18FiatAmount(this.decimalBalance, this.fiatPrice, false); + this.formattedFiatBalance = getCep18FiatAmount(this.decimalBalance, this.fiatPrice, true); this.currency = 'USD'; - this.marketDataProvider = apiToken?.coingecko_data?.price - ? 'CoinGecko' - : apiToken?.friendlymarket_data?.price - ? 'FriendlyMarket' - : null; + this.marketDataProvider = tokenMarketData + ? dexIdToMarketDataProviderMap[tokenMarketData.dex_id] + : null; this.marketDataProviderUrl = getMarketDataProviderUrl( this.marketDataProvider, apiToken?.coingecko_id, diff --git a/src/data/dto/txSignatureRequest/TxSignatureRequestDto.ts b/src/data/dto/txSignatureRequest/TxSignatureRequestDto.ts index 3cc6301..f6ee858 100644 --- a/src/data/dto/txSignatureRequest/TxSignatureRequestDto.ts +++ b/src/data/dto/txSignatureRequest/TxSignatureRequestDto.ts @@ -5,7 +5,6 @@ import { AssociatedKeysContractInfo, AuctionManagerContractInfo, CasperNetwork, - CEP_18_ACTION_ENTRY_POINTS, CSPR_COIN, CSPRMarketContractInfo, IAccountInfo, diff --git a/src/data/repositories/contractPackage/types.ts b/src/data/repositories/contractPackage/types.ts index 1ae1e3d..9df83b0 100644 --- a/src/data/repositories/contractPackage/types.ts +++ b/src/data/repositories/contractPackage/types.ts @@ -1,5 +1,4 @@ import { Maybe } from '../../../typings'; -import { CoingeckoApiData, FriendlymarketApiData } from '../tokens'; export interface IContractPackageCloudResponse { contract_package_hash: string; @@ -29,6 +28,15 @@ export interface IContractPackageCloudResponse { icon_url: Maybe; website_url: Maybe; deploys_number: number; - coingecko_data?: Maybe; - friendlymarket_data?: Maybe; + token_market_data?: ITokenMarketData[] | null; +} + +export interface ITokenMarketData { + dex_id: number; + token_contract_package_hash: string; + currency_id: number; + latest_rate: number; + volume_24h: string; + token_volume_24h: string; + timestamp: string; } diff --git a/src/data/repositories/deploys/index.ts b/src/data/repositories/deploys/index.ts index 5ae5c53..a4fc560 100644 --- a/src/data/repositories/deploys/index.ts +++ b/src/data/repositories/deploys/index.ts @@ -17,7 +17,12 @@ import { import type { IHttpDataProvider, IAccountInfoRepository } from '../../../domain'; import { getAccountHashFromPublicKey } from '../../../utils'; import { CsprTransferDeployDto, processDeploy, Cep18TransferDeployDto } from '../../dto'; -import { ExtendedCloudDeploy, ICsprTransferResponse, IErc20TokensTransferResponse } from './types'; +import { + ExtendedCloudDeploy, + ICloudTransactionFeedItem, + ICsprTransferResponse, + IErc20TokensTransferResponse, +} from './types'; import { getAccountHashesFromDeploy, getAccountHashesFromDeployActionResults, @@ -233,6 +238,59 @@ export class DeploysRepository implements IDeploysRepository { } } + async getTransactionsFeed({ + network, + activePublicKey, + page, + limit = DEFAULT_PAGE_LIMIT, + contractPackageHash, + withProxyHeader = true, + }: IGetDeploysParams) { + try { + const resp = await this._httpProvider.get>({ + url: `https://cspr-wallet-api.dev.make.services:443/accounts/${activePublicKey}/feed-transactions`, // TODO: Replace with production API endpoint + params: { + account_identifier: activePublicKey, + page, + page_size: limit, + includes: + 'rate(1),contract_entrypoint,contract_package,transfers,centralized_account_info,account_info,cspr_name,nft_token_actions,ft_token_actions,token_market_data(1)', + ...(contractPackageHash ? { contract_package_hash: contractPackageHash } : {}), + }, + ...(withProxyHeader ? { headers: CSPR_API_PROXY_HEADERS } : {}), + errorType: 'getTransactionsFeed', + }); + + if (!resp) { + return EMPTY_PAGINATED_RESPONSE; + } + + const rawDeploys = resp.data.map(d => processDeploy(activePublicKey, network, {}, d)); + const accountHashes = rawDeploys.map(d => getAccountHashesFromDeploy(d)).flat(); + + await this._accountInfoRepository.getAccountsInfo({ + network, + accountHashes, + }); + + return { + itemCount: resp.item_count, + pageCount: resp.page_count, + pages: resp.pages, + data: resp.data.map(d => + processDeploy( + activePublicKey, + network, + this._accountInfoRepository.accountsInfoMapCache, + d, + ), + ), + }; + } catch (e) { + this._processError(e, 'getTransactionsFeed'); + } + } + private _processError(e: unknown, type: keyof IDeploysRepository): never { if (isDeploysError(e)) { throw e; diff --git a/src/data/repositories/deploys/types.ts b/src/data/repositories/deploys/types.ts index 2d6178d..37a1200 100644 --- a/src/data/repositories/deploys/types.ts +++ b/src/data/repositories/deploys/types.ts @@ -1,5 +1,6 @@ import { Maybe } from '../../../typings'; -import { CoingeckoApiData, ContractPackage, FriendlymarketApiData } from '../tokens'; +import { ContractPackage } from '../tokens'; +import { ITokenMarketData } from '../contractPackage'; export enum TransactorHashType { 'account' = 0, @@ -147,8 +148,7 @@ export interface ExtendedCloudDeploy { transfers?: DeployTransferResult[]; ft_token_actions?: FTActionsResult[]; nft_token_actions?: NftCloudActionsResult[]; - coingecko_data?: Maybe; - friendlymarket_data?: Maybe; + token_market_data?: ITokenMarketData[] | null; } export enum CasperMarketEntryPoint { @@ -291,8 +291,6 @@ export interface IErc20TokensTransferResponse { transform_idx: number; deploy?: ExtendedCloudDeploy; contract_package?: ContractPackage; - coingecko_data?: Maybe; - friendlymarket_data?: Maybe; } export interface IApiDeployArgs { @@ -374,9 +372,9 @@ export interface ExtendedDeployContractPackageResult { coingecko_id?: string | null; friendlymarket_id?: string | null; - coingecko_data?: Maybe; - friendlymarket_data?: Maybe; latest_version_contract_hash?: string | null; + + token_market_data?: ITokenMarketData[] | null; } export interface ExtendedDeployEntryPointResult { @@ -403,3 +401,36 @@ export interface ExtendedDeployContractPackageMetadata { whitelist_mode?: string; owner_reverse_lookup_mode?: string; } + +export interface ICloudTransactionFeedItem { + account_info: null; + args: ExtendedDeployArgsResult; + block_hash: string; + block_height: number; + caller_hash: string; + caller_public_key: string; + centralized_account_info: null; + consumed_gas: string; + contract_entrypoint: ExtendedDeployEntryPointResult; + contract_hash: string; + contract_package: ExtendedDeployContractPackageResult; + contract_package_hash: string; + cost: string; + deploy_hash: string; + entry_point_id: number; + error_message: null | string; + execution_type_id: number; + transfers?: DeployTransferResult[]; + ft_token_actions?: FTActionsResult[]; + nft_token_actions?: NftCloudActionsResult[]; + gas_price_limit: number; + is_standard_payment: boolean; + payment_amount: string; + pricing_mode_id: number; + rate: number; + refund_amount: string; + runtime_type_id: number; + status: string; + timestamp: string; + version_id: 2; +} diff --git a/src/data/repositories/tokens/index.ts b/src/data/repositories/tokens/index.ts index 0cf48a7..a6dfffc 100644 --- a/src/data/repositories/tokens/index.ts +++ b/src/data/repositories/tokens/index.ts @@ -35,10 +35,10 @@ export class TokensRepository implements ITokensRepository { const accountHash = getAccountHashFromPublicKey(publicKey); const tokensList = await this._httpProvider.get>({ - url: `${this._casperWalletApiUrl[network]}/accounts/${accountHash}/ft-token-ownership`, + url: `https://cspr-wallet-api.dev.make.services:443/accounts/${accountHash}/ft-token-ownership`, // TODO replace with prod API params: { page_size: 100, // TODO pagination? - includes: 'contract_package,friendlymarket_data(1),coingecko_data(1)', + includes: 'contract_package,token_market_data(1)', }, ...(withProxyHeader ? { headers: CSPR_API_PROXY_HEADERS } : {}), errorType: 'getTokens', diff --git a/src/data/repositories/tokens/types.ts b/src/data/repositories/tokens/types.ts index 4848356..c8bde81 100644 --- a/src/data/repositories/tokens/types.ts +++ b/src/data/repositories/tokens/types.ts @@ -1,5 +1,5 @@ import { DataResponse, Network } from '../../../domain'; -import { Maybe } from '../../../typings'; +import { ITokenMarketData } from '../contractPackage'; export interface IGetCsprBalanceResponse { balance: string; @@ -22,8 +22,6 @@ export interface Erc20Token { contract_package_hash: string; owner_hash: string; owner_type: number; - coingecko_data?: Maybe; - friendlymarket_data?: Maybe; contract_package: ContractPackage; } @@ -56,15 +54,12 @@ export interface ContractPackage { contractHash?: string; coingecko_id?: string | null; friendlymarket_id?: string | null; - coingecko_data?: Maybe; - friendlymarket_data?: Maybe; latest_version_contract_hash?: string | null; + token_market_data?: ITokenMarketData[] | null; } export interface ApiToken extends ContractPackage { balance: string; network: Network; contractHash?: string; - coingecko_data?: Maybe; - friendlymarket_data?: Maybe; } diff --git a/src/data/repositories/txSignatureRequest/index.ts b/src/data/repositories/txSignatureRequest/index.ts index b66ebe8..4d991c3 100644 --- a/src/data/repositories/txSignatureRequest/index.ts +++ b/src/data/repositories/txSignatureRequest/index.ts @@ -48,6 +48,7 @@ export class TxSignatureRequestRepository implements ITxSignatureRequestReposito private _contractPackageRepository: IContractPackageRepository, private _casperWalletApiByEnvUrl: Record, private _grpcUrl: Record, + private _httpAuthorizationHeader?: string, ) {} async prepareSignatureRequest({ @@ -134,6 +135,12 @@ export class TxSignatureRequestRepository implements ITxSignatureRequestReposito try { const handler = new HttpHandler(this._grpcUrl[network], 'fetch'); + if (this._httpAuthorizationHeader) { + handler.setCustomHeaders({ + Authorization: this._httpAuthorizationHeader, + }); + } + if (withProxyHeader) { handler.setReferrer(CSPR_API_PROXY_HEADERS.Referer); } @@ -267,6 +274,12 @@ export class TxSignatureRequestRepository implements ITxSignatureRequestReposito const handler = new HttpHandler(this._grpcUrl[network], 'fetch'); + if (this._httpAuthorizationHeader) { + handler.setCustomHeaders({ + Authorization: this._httpAuthorizationHeader, + }); + } + if (withProxyHeader) { handler.setReferrer(CSPR_API_PROXY_HEADERS.Referer); } diff --git a/src/domain/common/http/data-provider.ts b/src/domain/common/http/data-provider.ts index 7bb6f91..4dd59f0 100644 --- a/src/domain/common/http/data-provider.ts +++ b/src/domain/common/http/data-provider.ts @@ -21,7 +21,7 @@ export interface IHttpDataProvider { head: (params: HttpMethodParamsType) => Promise | undefined>; setUpBaseUrl: (url: string) => void; - setAuthHeader: (token: string) => void; + setAuthHeader: (value: string) => void; removeAuthHeader: () => void; } diff --git a/src/domain/constants/casperNetwork.ts b/src/domain/constants/casperNetwork.ts index 854547a..594ee24 100644 --- a/src/domain/constants/casperNetwork.ts +++ b/src/domain/constants/casperNetwork.ts @@ -159,6 +159,33 @@ export const AuctionManagerContractInfo: Record = }, }; +export const SystemMintContractInfo: Record = { + mainnet: { + contractHash: '', + contactName: '', + contractPackageHash: '4475016098705466254edd18d267a9dad43e341d4dafadb507d0fe3cf2d4a74b', + contractPackageName: 'Mint', + }, + testnet: { + contractHash: '', + contactName: '', + contractPackageHash: '9824d60dc3a5c44a20b9fd260a412437933835b52fc683d8ae36e4ec2114843e', + contractPackageName: 'Mint', + }, + devnet: { + contractHash: '', + contactName: '', + contractPackageHash: '', + contractPackageName: '', + }, + integration: { + contractHash: '', + contactName: '', + contractPackageHash: '', + contractPackageName: '', + }, +}; + export const CSPRMarketContractInfo: Record = { mainnet: { contractHash: '5adb720d529964437caf75f3df974edffd204fe511b9e359e7dff28f79d12337', diff --git a/src/domain/deploys/repository.ts b/src/domain/deploys/repository.ts index 49e51f0..f6f64f6 100644 --- a/src/domain/deploys/repository.ts +++ b/src/domain/deploys/repository.ts @@ -7,6 +7,7 @@ export interface IDeploysRepository { getDeploys(params: IGetDeploysParams): Promise>; getCsprTransferDeploys(params: IGetDeploysParams): Promise>; getCep18TransferDeploys(params: IGetDeploysParams): Promise>; + getTransactionsFeed(params: IGetDeploysParams): Promise>; } export interface IGetSingleDeployParams { diff --git a/src/domain/tokens/entities.ts b/src/domain/tokens/entities.ts index df951f7..2a5a36a 100644 --- a/src/domain/tokens/entities.ts +++ b/src/domain/tokens/entities.ts @@ -28,7 +28,7 @@ export interface ITokenWithFiatBalance extends IToken { readonly marketDataProviderUrl: Maybe; } -export type SupportedMarketDataProviders = 'CoinGecko' | 'FriendlyMarket'; +export type SupportedMarketDataProviders = 'CsprTrade' | 'CoinGecko' | 'FriendlyMarket'; export interface ICsprBalance { readonly publicKey: string; diff --git a/src/setup.ts b/src/setup.ts index 13dba55..8ede33b 100644 --- a/src/setup.ts +++ b/src/setup.ts @@ -27,6 +27,7 @@ export interface ISetupRepositoriesParams { /** Environment-based url for Casper Wallet Api. Some API network agnostic and do not belong to any {@link CasperWalletApiByNetworkUrl}. Default env is PRODUCTION (in all places where it is used) */ casperWalletApiByEnvUrl?: Record; grpcUrl?: Record; + httpAuthorizationHeader?: string; } export const setupRepositories = ({ @@ -35,10 +36,15 @@ export const setupRepositories = ({ casperWalletApiByNetworkUrl = CasperWalletApiByNetworkUrl, casperWalletApiByEnvUrl = CasperWalletApiByEnvUrl, grpcUrl = GrpcUrl, + httpAuthorizationHeader, }: ISetupRepositoriesParams = {}) => { const log = logger ?? new Logger(); const httpDataProvider = new HttpDataProvider(debug ? log : null); + if (httpAuthorizationHeader) { + httpDataProvider.setAuthHeader(httpAuthorizationHeader); + } + const accountInfoRepository = new AccountInfoRepository( httpDataProvider, casperWalletApiByNetworkUrl, @@ -67,6 +73,7 @@ export const setupRepositories = ({ contractPackageRepository, casperWalletApiByEnvUrl, grpcUrl, + httpAuthorizationHeader, ); return { diff --git a/yarn.lock b/yarn.lock index 21e1979..4462043 100644 --- a/yarn.lock +++ b/yarn.lock @@ -726,8 +726,8 @@ __metadata: "@react-native/eslint-config": "npm:0.74.83" "@react-native/typescript-config": "npm:0.74.83" "@types/uuid": "npm:^10.0.0" - apisauce: "npm:^3.1.1" - casper-js-sdk: "npm:5.0.6" + apisauce: "npm:^3.2.2" + casper-js-sdk: "npm:5.0.10" date-fns: "npm:^2.30.0" decimal.js: "npm:^10.4.3" eslint: "npm:8.22.0" @@ -811,12 +811,12 @@ __metadata: languageName: node linkType: hard -"apisauce@npm:^3.1.1": - version: 3.1.1 - resolution: "apisauce@npm:3.1.1" +"apisauce@npm:^3.2.2": + version: 3.2.2 + resolution: "apisauce@npm:3.2.2" dependencies: - axios: "npm:^1.7.7" - checksum: 10c0/a88498049588e803042b1b5e2ffe3670aa61e6381b2c6a88afd4f47b1e50e1bd574ba9719c6891c92cecff207812387f861e4115666600bd8e09e6d3bbab231b + axios: "npm:^1.11.0" + checksum: 10c0/512ea3c454ab9091af89d2b7fb4ab06a6458d5c3ffcdee2b24ac0c00bbe8a612c93ade636d1ecf4c994f89bb3b98a8fb8a3da821f0041f4e73a32fb114c495a6 languageName: node linkType: hard @@ -959,14 +959,14 @@ __metadata: languageName: node linkType: hard -"axios@npm:^1.7.7": - version: 1.9.0 - resolution: "axios@npm:1.9.0" +"axios@npm:^1.11.0": + version: 1.13.6 + resolution: "axios@npm:1.13.6" dependencies: - follow-redirects: "npm:^1.15.6" - form-data: "npm:^4.0.0" + follow-redirects: "npm:^1.15.11" + form-data: "npm:^4.0.5" proxy-from-env: "npm:^1.1.0" - checksum: 10c0/9371a56886c2e43e4ff5647b5c2c3c046ed0a3d13482ef1d0135b994a628c41fbad459796f101c655e62f0c161d03883454474d2e435b2e021b1924d9f24994c + checksum: 10c0/51fb5af055c3b85662fa97df17d986ae2c37d13bf86d50b6bb36b6b3a2dec6966a1d3a14ab3774b71707b155ae3597ed9b7babdf1a1a863d1a31840cb8e7ec71 languageName: node linkType: hard @@ -988,7 +988,7 @@ __metadata: languageName: node linkType: hard -"bn.js@npm:^4.0.0, bn.js@npm:^4.11.9": +"bn.js@npm:^4.0.0": version: 4.12.2 resolution: "bn.js@npm:4.12.2" checksum: 10c0/09a249faa416a9a1ce68b5f5ec8bbca87fe54e5dd4ef8b1cc8a4969147b80035592bddcb1e9cc814c3ba79e573503d5c5178664b722b509fb36d93620dba9b57 @@ -1030,13 +1030,6 @@ __metadata: languageName: node linkType: hard -"brorand@npm:^1.1.0": - version: 1.1.0 - resolution: "brorand@npm:1.1.0" - checksum: 10c0/6f366d7c4990f82c366e3878492ba9a372a73163c09871e80d82fb4ae0d23f9f8924cb8a662330308206e6b3b76ba1d528b4601c9ef73c2166b440b2ea3b7571 - languageName: node - linkType: hard - "browserslist@npm:^4.24.0": version: 4.25.0 resolution: "browserslist@npm:4.25.0" @@ -1097,9 +1090,9 @@ __metadata: languageName: node linkType: hard -"casper-js-sdk@npm:5.0.6": - version: 5.0.6 - resolution: "casper-js-sdk@npm:5.0.6" +"casper-js-sdk@npm:5.0.10": + version: 5.0.10 + resolution: "casper-js-sdk@npm:5.0.10" dependencies: "@ethersproject/bignumber": "npm:^5.0.8" "@ethersproject/bytes": "npm:^5.0.5" @@ -1115,7 +1108,6 @@ __metadata: asn1.js: "npm:^5.4.1" axios: "npm:^1.8.4" bn.js: "npm:^5.2.1" - elliptic: "npm:6.6.1" eventsource: "npm:^2.0.2" glob: "npm:^7.1.6" humanize-duration: "npm:^3.24.0" @@ -1124,7 +1116,7 @@ __metadata: reflect-metadata: "npm:^0.1.13" ts-results: "npm:@casperlabs/ts-results@^3.3.4" typedjson: "npm:^1.6.0-rc2" - checksum: 10c0/66b09b8f2ea9de9078cd3d3a4bf8a1bc0f5cbfad224525a8f240f60f1636b4f023c6b48eecae04566bd85dc5034ba3985bd0a6a6982de07b54101d2d06dac7cc + checksum: 10c0/5e6415b0e1ddbb5711c382dfd5b6ab8d15a9ddd34d9b2f5a51b012909031443831ded2e3a13ae66dd8eb7fe0fcb35a1c7a33c4be2d3e4dc35803f9655f082ef8 languageName: node linkType: hard @@ -1389,21 +1381,6 @@ __metadata: languageName: node linkType: hard -"elliptic@npm:6.6.1": - version: 6.6.1 - resolution: "elliptic@npm:6.6.1" - dependencies: - bn.js: "npm:^4.11.9" - brorand: "npm:^1.1.0" - hash.js: "npm:^1.0.0" - hmac-drbg: "npm:^1.0.1" - inherits: "npm:^2.0.4" - minimalistic-assert: "npm:^1.0.1" - minimalistic-crypto-utils: "npm:^1.0.1" - checksum: 10c0/8b24ef782eec8b472053793ea1e91ae6bee41afffdfcb78a81c0a53b191e715cbe1292aa07165958a9bbe675bd0955142560b1a007ffce7d6c765bcaf951a867 - languageName: node - linkType: hard - "emoji-regex@npm:^9.2.2": version: 9.2.2 resolution: "emoji-regex@npm:9.2.2" @@ -1995,6 +1972,16 @@ __metadata: languageName: node linkType: hard +"follow-redirects@npm:^1.15.11": + version: 1.15.11 + resolution: "follow-redirects@npm:1.15.11" + peerDependenciesMeta: + debug: + optional: true + checksum: 10c0/d301f430542520a54058d4aeeb453233c564aaccac835d29d15e050beb33f339ad67d9bddbce01739c5dc46a6716dbe3d9d0d5134b1ca203effa11a7ef092343 + languageName: node + linkType: hard + "follow-redirects@npm:^1.15.6": version: 1.15.9 resolution: "follow-redirects@npm:1.15.9" @@ -2014,19 +2001,7 @@ __metadata: languageName: node linkType: hard -"form-data@npm:^4.0.0": - version: 4.0.2 - resolution: "form-data@npm:4.0.2" - dependencies: - asynckit: "npm:^0.4.0" - combined-stream: "npm:^1.0.8" - es-set-tostringtag: "npm:^2.1.0" - mime-types: "npm:^2.1.12" - checksum: 10c0/e534b0cf025c831a0929bf4b9bbe1a9a6b03e273a8161f9947286b9b13bf8fb279c6944aae0070c4c311100c6d6dbb815cd955dc217728caf73fad8dc5b8ee9c - languageName: node - linkType: hard - -"form-data@npm:^4.0.4": +"form-data@npm:^4.0.4, form-data@npm:^4.0.5": version: 4.0.5 resolution: "form-data@npm:4.0.5" dependencies: @@ -2275,16 +2250,6 @@ __metadata: languageName: node linkType: hard -"hash.js@npm:^1.0.0, hash.js@npm:^1.0.3": - version: 1.1.7 - resolution: "hash.js@npm:1.1.7" - dependencies: - inherits: "npm:^2.0.3" - minimalistic-assert: "npm:^1.0.1" - checksum: 10c0/41ada59494eac5332cfc1ce6b7ebdd7b88a3864a6d6b08a3ea8ef261332ed60f37f10877e0c825aaa4bddebf164fbffa618286aeeec5296675e2671cbfa746c4 - languageName: node - linkType: hard - "hasown@npm:^2.0.2": version: 2.0.2 resolution: "hasown@npm:2.0.2" @@ -2294,17 +2259,6 @@ __metadata: languageName: node linkType: hard -"hmac-drbg@npm:^1.0.1": - version: 1.0.1 - resolution: "hmac-drbg@npm:1.0.1" - dependencies: - hash.js: "npm:^1.0.3" - minimalistic-assert: "npm:^1.0.0" - minimalistic-crypto-utils: "npm:^1.0.1" - checksum: 10c0/f3d9ba31b40257a573f162176ac5930109816036c59a09f901eb2ffd7e5e705c6832bedfff507957125f2086a0ab8f853c0df225642a88bf1fcaea945f20600d - languageName: node - linkType: hard - "human-signals@npm:^4.3.0": version: 4.3.1 resolution: "human-signals@npm:4.3.1" @@ -2362,7 +2316,7 @@ __metadata: languageName: node linkType: hard -"inherits@npm:2, inherits@npm:^2.0.1, inherits@npm:^2.0.3, inherits@npm:^2.0.4": +"inherits@npm:2, inherits@npm:^2.0.1": version: 2.0.4 resolution: "inherits@npm:2.0.4" checksum: 10c0/4e531f648b29039fb7426fb94075e6545faa1eb9fe83c29f0b6d9e7263aceb4289d2d4557db0d428188eeb449cc7c5e77b0a0b2c4e248ff2a65933a0dee49ef2 @@ -2941,20 +2895,13 @@ __metadata: languageName: node linkType: hard -"minimalistic-assert@npm:^1.0.0, minimalistic-assert@npm:^1.0.1": +"minimalistic-assert@npm:^1.0.0": version: 1.0.1 resolution: "minimalistic-assert@npm:1.0.1" checksum: 10c0/96730e5601cd31457f81a296f521eb56036e6f69133c0b18c13fe941109d53ad23a4204d946a0d638d7f3099482a0cec8c9bb6d642604612ce43ee536be3dddd languageName: node linkType: hard -"minimalistic-crypto-utils@npm:^1.0.1": - version: 1.0.1 - resolution: "minimalistic-crypto-utils@npm:1.0.1" - checksum: 10c0/790ecec8c5c73973a4fbf2c663d911033e8494d5fb0960a4500634766ab05d6107d20af896ca2132e7031741f19888154d44b2408ada0852446705441383e9f8 - languageName: node - linkType: hard - "minimatch@npm:9.0.3": version: 9.0.3 resolution: "minimatch@npm:9.0.3"