
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@dexknot/shared
Advanced tools
The submodule is a part of monorepo [Dexknot](https://github.com/yozh-io/dexknot).
The submodule is a part of monorepo Dexknot.
Contains store, themes, locales, hooks, utils, types used in different applications.
yarn add --dev @dexknot/shared
or
npm install --dev @dexknot/shared
Individual components can be imported:
//Hooks
import {
hooks
} from '@dexknot/shared';
const {
useAbortableTimeout,
useAdvancedSettings,
useAlertMessage,
useApproveStatus,
useBuildSwapTx,
useExecuteApprove,
useExecuteQuote,
useExecuteSwap,
useFeeRange,
useGasPriceOptions,
useInterval,
useLocalStorage,
useProtocolInstances,
useRate,
useTokens,
useTotalRouteSteps,
useUpdateAllowance,
useUpdateParams,
useUpdateSpender,
useUpdateUsdcPricesForBalances,
useUpdateUsdcPricesForSelectedTokens,
useUsdStablecoins,
useWaitTime,
useWidgetHeightContext,
WidgetHeightProvider
} = hooks,
//Locales
import {
locales
} from '@dexknot/shared';
const {
translationEN,
translationUA,
SUPPORTED_LOCALES,
DEFAULT_LOCALE
} = locales,
//Store
import {
store
} from '@dexknot/shared';
const {
AppState,
AppDispatch,
addTokenToAllTokens,
approveInitialState,
approveReducer,
applyDefaultSettings,
cleanLastTxHash,
configuredStore,
fetchCoinInfoById,
fetchTokens,
updateDecimalsForTypedValue,
recalculateTypedValueOnSelectCurrency,
recalculateTypedValueOnSwitchCurrency,
removeTokenFromAllTokens,
rootReducer,
selectCurrency,
selectSwapProtocol,
setBuildTxError,
setCustomGasPrice,
setDefaultSettings,
setEstimateGasError,
setExplorer,
setGasPriceInfo,
setGasPriceSettingsMode,
setIsWaitingTx,
setLastTxHash,
setSlippage,
setSpender,
setTxErrorMessage,
setRecipient,
swapInitialState,
swapReducer,
switchCurrencies,
tokensInitialState,
tokensReducer,
txInitialState,
txReducer,
typeInput,
userInitialState,
userReducer,
updateAllQuotes,
updateAllTokenBalances,
updatePriceTokenInUsd,
updateTokenInfo
} = store,
//Theme
import {
theme
} from '@dexknot/shared';
const {
baseTypographyOptions,
darkTheme,
defaultTheme
} = theme,
//Types
import {
types
} from '@dexknot/shared';
const {
ApproveState,
AppStateTypes,
SupportedLocale,
SwapState,
TokensState,
TransactionsState,
UserState
} = types,
//Utils
import {
utils
} from '@dexknot/shared';
const {
bigFloatToFixed,
calculateGasMargin,
calculateRoughFees,
calculateTxFee,
catchNetworkError,
convertStringCase,
countOfCustomTokens,
createQuoteInfoLabel,
createTxCostLabel,
formatGweiFixed,
formatUsdFixed,
getDefaultGasLimit,
getErrorMessage,
getFilteredNetworkListButton,
getNameOrTokensInRoutes,
getSupportedChainsByProtocols
getTxStatus,
isSupportedChain,
parseGwei,
roundPercentInRoutes,
toHex,
validateDefaultChainId,
validateDefaultTokensOptions,
validateDefaultValue,
validateReferrerOptions,
} = utils
FAQs
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.