New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@dexknot/shared

Package Overview
Dependencies
Maintainers
2
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dexknot/shared

The submodule is a part of monorepo [Dexknot](https://github.com/yozh-io/dexknot).

latest
Source
npmnpm
Version
1.1.0
Version published
Maintainers
2
Created
Source

shared

The submodule is a part of monorepo Dexknot.

Contains store, themes, locales, hooks, utils, types used in different applications.

Install

  • yarn
yarn add --dev @dexknot/shared

or

  • npm
npm install --dev @dexknot/shared

Importing

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

Package last updated on 23 Jun 2023

Did you know?

Socket

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.

Install

Related posts