New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@dhedge/trading-widget

Package Overview
Dependencies
Maintainers
0
Versions
88
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dhedge/trading-widget

## Get started

  • 3.3.11
  • latest
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

dHEDGE Trading Widget API Docs

Get started

Requirements:

Widget library has some vital peerDependencies as a core tool stack. Make sure having all those dependencies installed in app before starting the integration:

"@tanstack/react-query": "^5.28.4",
"react": ">=18.2.0",
"viem": "^2.8.14",
"wagmi": "^2.5.11"
  1. Installation:
npm i @dhedge/trading-widget
  1. Providers hierarchy
import { WagmiProvider } from 'wagmi'
import { TradingPanelProvider, TradingWidget } from '@dhedge/trading-widget'
  • Setup Wagmi Provider on top level or use existing one in your app
  • Setup TradingPanelProvider
    Providing a getSwapData callback is mandatory for depositing with off-chain swaps.
  • Setup TradingWidget
  1. Minimum required config

See bare minimum setup example: packages/trading-widget/src/examples/simple-example.tsx

  1. Styling
import '@dhedge/trading-widget/style.css'

Initially widget takes full parent width

See TradingWidget -> theme config to manage customization

API

TradingPanelProvider

Top level provider component. Headless part of trading logic. API handles params to setup initialState and actions. See below for more details

actions / Optional General callbacks to interact with 3rd party services
nametypedefault valuedescription
onUpdateSendTokenInput(payload: Partial<{ address: Address; symbol: string; value: string; decimals: number; isLoading?: boolean }>) => voidundefinedtriggers on send token change
onUpdateTradingSettings(payload: Partial<{ slippage: number | 'auto'; minSlippage?: number isInfiniteAllowance: boolean; isMultiAssetWithdrawalEnabled: boolean; isMaxSlippageLoading: boolean }>) => voidundefinedtriggers on trading settings change
onSetTradingType(payload: 'deposit' | 'withdraw') => voidundefinedtriggers on trading type change
onUpdateTradingModal(payload: Partial<{ isOpen: boolean; status: 'Success' | 'None' | 'Mining' | 'Wallet' }>) => voidundefinedtriggers on trading modal change
onUpdateTransactions(payload: AddTransaction | UpdateTransaction | RemoveTransaction) => voidundefinedtriggers on transaction action change
onTradingSettleError(error: Error) => voidundefinedtriggers on trading settle error
onTransactionError(error: Error, action: TransactionAction | undefined, chainId?: ChainId, txHash?: Address) => voidundefinedtriggers on transaction error
onTransactionSuccess(data: WaitForTransactionReceiptReturnType, action: TransactionAction | undefined, link?: string) => voidundefinedtriggers on transaction success
onTransactionEstimationError(error: EstimationError, address: Address, chainId?: ChainId, account?: Address) => voidundefinedtriggers on transaction estimation error
onTokenSelector(payload: { isOpen: boolean; entity: 'token' | 'pool' }) => voidundefinedtriggers on token selector change
onLog(eventName: string, payload?: Record<string, unknown>) => voidundefinedtriggers on log event
onSimulateTransaction(payload: { chainId: ChainId; from: Address: to: Address; input: string; gas: number; value?: string }) => Promise<{ link?: string; simulation: { status: boolean; error_message: string } } | null>undefinedtriggers to simulate transaction and get error details after failed tx estimation
getSwapData({ signal: AbortSignal, variables: { chainId: number; sourceAddress: Address; destinationAddress: Address; walletAddress: Address; fromAddress: Address; amount: string; slippage: string } }) => Promise<{ destinationAmount: string; txData: string ; routerKey: 'ONE_INCH' / 'ONE_INCH_V5' / 'ZERO_X' / 'PARASWAP' / 'PARASWAP_V6' } } | null>undefinedprovides off chain swap data based on send token value
Source: packages/trading-widget/src/core-kit/providers/index.tsx
Default values: undefined

initialState / Optional initial state of trading panel
nametypedefault valuedescription
poolAddressAddressAddressZeroCurrent active pool address
poolConfigMapRecord<Address, PoolConfig>{}Map of pool configs available for trading
settings{ slippage: number | 'auto'; minSlippage?: number; isInfiniteAllowance: boolean; isMultiAssetWithdrawalEnabled: boolean; isMaxSlippageLoading: boolean }{ slippage: 'auto'; isInfiniteAllowance: false; isMultiAssetWithdrawalEnabled: true; isMaxSlippageLoading: false }Panel settings
type'deposit' | 'withdraw''deposit'Trading type
input{ sendToken: { address: Address; symbol: string; value: string; decimals: number; isLoading?: boolean }; receiveToken: { address: Address; symbol: string; value: string; decimals: number; isLoading?: boolean } }poolConfigMap[poolAddress]Send/receive tokens pair
entryFee{ deposit: number; depositWithCustomCooldown: number; }{ deposit: 0; depositWithCustomCooldown: 0.1 }Entry fee config map
modal{ isOpen: boolean; status: 'Success' | 'None' | 'Mining' | 'Wallet'; action: 'deposit' | 'withdraw' | 'approve | 'oraclesUpdate'; link?: string; sendToken: TradingToken | null; receiveToken: TradingToken | null }{ isOpen: false,status: 'None', receiveToken: null, sendToken: null }Trading modal state
transactions{ action: 'deposit' | 'withdraw' | 'approve'; symbol: string; chainId: ChainId; txHash?: Address }[][]Pending transactions
poolFallbackData{ address: Address; managerLogicAddress?: Address; poolCompositions: PoolComposition[]; tokenPrice?: string; apy?: { value: number; currency: 'USD' | 'ETH' } }{ address: AddressZero }Current active pool fallback data to override or extend contract's response
defaultChainIdnumber (optional)undefinedChain id that will be returned from useNetwork wagmi hook when connected to unsupported network
Source: packages/trading-widget/src/core-kit/providers/index.tsx
Default values: packages/trading-widget/src/core-kit/providers/index.tsx

TradingWidget

UI configuration provider. Manages params to configure custom styling, components, translations and basic trading params. Decomposed into config, components, theme and translation params. See below for more details

config / General feature configuration params
params
nametypedefault valuedescription
isGeoBlockedbooleanfalseRestricts depositing action button and conditionally renders GeoBlockAlert component
isSanctionedbooleanfalseRestricts depositing action button and conditionally renders SanctionedAlert component
depositQuoteDiffWarningThresholdnumber1Deposit slippage absolute percent value warning threshold, Affects styling to warn user
depositQuoteDiffErrorThresholdnumber3Deposit slippage absolute percent value error threshold, Affects styling to warn user
defaultWithdrawSlippagenumber[0.1, 0.3, 0.5, 1, 1.5, 3]Initial withdraw slippage absolute percent. Further adjustments are available in panel settings
defaultSwapTransactionSlippagenumber0.3Default slippage (%) applied to swap transaction.
defaultNoSwapMinDepositAmountGapnumber0.1Default gap (%) for min received vault tokens during no swap deposits.
defaultNotificationDurationnumber10000Notification duration in ms
defaultLockTimestring'24 hours'Formatted default deposit lock time to be displayed in panel (Long lockup period is used to bypass entry fee and can be managed in panel settings)
customLockTimestring'15 minutes'Formatted custom deposit lock time alternative to be displayed in panel
stablePrecisionnumber3Number of decimals to be displayed in stables (e.g USDC balance)
defaultPrecisionnumber6Number of decimals to be displayed in token values
stakingChainIdnumber10 (Optimism)ChainId to be used in staking logic
termsOfUseAcceptedbooleantrueRequires user to confirm terms of use by rendering DepositTermsOfUse component before deposit action
standalonebooleantrueHandles token selection in SPA mode
isAllAssetsWithdrawOptionDefaultbooleanfalseSets "All Assets" withdraw option by default
chainConfigPartial<Record<ChainId, { name: string; iconPath: string }>>{}Sets map of chain name and iconPath
aaveOffchainWithdrawChainIdsChainId[][]Offchain swap data will be used for Aave withdrawals for selected chains
aaveOffchainWithdrawMinValuenumber50Value in USD when off-chain Aave withdrawal is enabled
getFallbackIconPath(tokenName: string) => stringbuildIconLinkFallback token icon path getter
actions
nametypedefault valuedescription
onConnect() => void() => {}Widget has built-in Connect Wallet action button that triggers onConnect callback assuming starting of abstract wallet connection process. After all the only requirement is to get connected wallet inside wagmi's useAccount hook to make trading operations possible
onAcceptTermsOfUse() => Promise<boolean>() => Promise.resolve(true)Callback is triggered after user's approval of Terms of Use statements assuming switching of external config.termsOfUseAccepted param to true state
Source: packages/trading-widget/src/trading-widget/providers/config-provider
Default values: packages/trading-widget/src/trading-widget/providers/config-provider/config-provider.defaults.ts
components / Custom components to be injected into widget layout
nametypedefault valuedescription
GeoBlockAlertComponentType<GeoBlockAlert>Component replaces deposit button while isGeoBlocked config param is set to true
SanctionedAlertComponentType<SanctionedAlert>Component replaces deposit button while isSanctioned config param is set to true
DepositMetaInfoComponentTypeundefinedComponent is injected into deposit meta part of widget layout nearby TransactionOverviewDisclosure
WithdrawMetaInfoComponentTypeundefinedComponent is injected into withdraw meta part of widget layout nearby WithdrawTransactionOverviewDisclosure
ExtraActionButtonComponentTypeundefinedComponent is injected below deposit action button and rendered if isGeoBlocked config param is set to false
ImageComponentType<img>Component optionally can be used to pass nextjs Image component to be used for assets rendering
LogoSpinnerComponentType<SVGProps><Spinner>Component is injected into widget pending transaction overlay. Assume using of spinning animation
DepositTermsOfUseComponentTypeundefinedComponent is injected into TermsOfUseOverlay to extend default terms of use statement points
ActionButtonComponentType<ActionButton>Component overrides default ActionButton and has ButtonProps API
Source: packages/trading-widget/src/trading-widget/providers/component-provider/component-provider.tsx
Default values: undefined

theme / Widget styling variables config
global
color

path: global.color[name]

nametypedefault valuedescription
colorTextPrimarystring#ffffffPrimary text color
colorTextPrimaryHoverstring#ffffffCCPrimary hover text color
colorBorderPrimarystringglobal?.color?.colorTextPrimary ?? #ffffffPrimary border color
colorTextSecondarystring#9DA2ADSecondary text color
colorBgPrimarystring#1B2432Primary bg color
colorBgSecondarystring#2B313ESecondary bg color
colorTextAccentstring#ffffffAccent text color
colorTextAccentHoverstring#ffffffCCAccent hover text color
colorBgAccentFromstring#73D393Accent bg gradient from color
colorBgAccentTostring#34855EAccent bg gradient to color
colorBgAccentFromHoverstring#73D393CCAccent hover bg gradient from color
colorBgAccentToHoverstring#162435Accent hover bg gradient to color
colorTextNeutralstring#9DA2AD80Neutral text color
colorBgNeutralstring#9DA2AD33Neutral bg color
colorTextLoadingstring#ffffff99Loading text color
colorTextErrorstring#EF4444Error text color
colorTextWarningstring#AFA58DWarning text color
colorIconstringglobal?.color?.colorTextPrimary ?? #ffffffWarning text color
size

path: global.size[name]

nametypedefault valuedescription
gapstring0.25remGeneral flex gap
spacerstring4pxGeneral spacer
fontSizeBasestring16pxFont size base
lineHeightBasestring24pxLine height base
fontSizeXsstring12pxFont size xs
lineHeightXsstring16pxLine height xs
fontSizeSmstring14pxFont size sm
lineHeightSmstring20pxLine height sm
fontSizeLgstring18pxFont size lg
lineHeightLgstring28pxLine height lg
iconSizestring20pxIcon size base
iconSizeSmstring24pxIcon size sm
iconSecondarySizestring16pxIcon secondary size
iconSecondarySizeSmstring16pxIcon secondary size sm
labelFontSizestringconfig?.global?.size?.fontSizeXs ?? 12pxLabel font size
labelLineHeightstringconfig?.global?.size?.lineHeightXs ?? 16pxLabel font size
labelLineHeightstringconfig?.global?.size?.lineHeightXs ?? 16pxLabel font size
style

path: global.style[name]

nametypedefault valuedescription
radiusPrimarystring1remGeneral border radius
radiusSecondarystring1remSecondary border radius
fontWeightLightstring300Font weight light
fontWeightMediumstring500Font weight medium
fontWeightBoldstring700Font weight bold
actionOpacitystring1Action element opacity
actionOpacityHoverstring0.8Action hover element opacity
component
notification

path: component.notification[name]

nametypedefault valuedescription
color.colorBgstringconfig?.global?.color?.colorBgSecondary ?? #2B313ENotification bg color
popup

path: component.popup[name]

nametypedefault valuedescription
color.colorTextstringconfig?.global?.color?.colorTextSecondary ?? #9DA2ADPopup text color
color.colorBgstringconfig?.global?.color?.colorBgSecondary ?? #2B313EPopup bg color
color.colorBorderstringconfig?.global?.color?.colorTextSecondary ?? #9DA2ADPopup bg color
size.fontSizestringconfig?.global?.size?.fontSizeXs ?? 12pxPopup font size
popupList

path: component.popupList[name]

nametypedefault valuedescription
color.itemBgEvenstringtransparentPopup list even item bg color
color.itemBgOddstring#2A3648Popup list odd item bg color
color.headerBgstring#1B2432Popup list header bg color
tabGroup

path: component.tabGroup[name]

nametypedefault valuedescription
size.pxstringglobal.size.spacer * 3Tab group padding inline
tabContent

path: component.tabContent[name]

nametypedefault valuedescription
size.ptstringglobal.size.spacer * 3Tab content padding top
size.pxstring0pxTab content padding inline
size.pbstringglobal.size.spacer * 9Tab content padding bottom
size.gapstringglobal.size.spacer * 2Tab content flex gap
tab

path: component.tab[name]

nametypedefault valuedescription
size.pxstringglobal.size.spacer * 9Tab padding inline
size.pystringglobal.size.spacer * 3Tab padding block
size.fontSizestringglobal.size.fontSizeSmTab font size
color.colorBgstringglobal.color.colorBgNeutralTab bg color
color.colorTextstringglobal.color.colorTextNeutralTab text color
color.selectColorTextstringglobal.color.colorTextPrimaryTab select text color
color.colorTextHoverstringglobal.color.colorTextPrimaryHoverTab hover text color
style.fontWeightstringglobal.style.fontWeightBoldTab font weight
style.lineHeightstringglobal.size.lineHeightSmTab line height
balance

path: component.balance[name]

nametypedefault valuedescription
size.pxstringglobal.size.spacer * 3Balance padding inline
size.gapstringglobal.size.gapBalance flex gap
size.fontSizestringglobal.size.fontSizeLgBalance font size
size.lineHeightstringglobal.size.lineHeightLgBalance line height
size.priceFontSizestringglobal.size.fontSizeBaseBalance price font size
size.priceLineHeightstringglobal.size.lineHeightBaseBalance price line height
color.colorTextstringglobal.color.colorTextPrimaryBalance text color
color.priceColorTextstringglobal.color.colorTextSecondaryBalance price text color
inputGroup

path: component.inputGroup[name]

nametypedefault valuedescription
size.pxstringglobal.size.spacer * 3Input group padding inline
size.gapstringglobal.size.gapInput group flex gap
input

path: component.input[name]

nametypedefault valuedescription
size.pxstringglobal.size.spacer * 3Input padding inline
size.pystringglobal.size.spacer * 2Input padding block
size.gapstringglobal.size.gap * 2Input flex gap
size.priceGapstringglobal.size.gap * 2Input flex gap
size.iconSizestringglobal.size.iconSizeInput icon size
size.iconSizeSmstringglobal.size.iconSizeSmInput icon size sm
size.labelFontSizestringglobal.size.fontSizeSmInput label line height
size.labelLineHeightstringglobal.size.lineHeightSmInput label font size
size.fontSizestringglobal.size.fontSizeSmInput font size
size.lineHeightstringglobal.size.lineHeightSmInput line height
size.fontSizeLgstringglobal.size.fontSizeLgInput font size lg
size.lineHeightLgstringglobal.size.lineHeightLgInput line height lg
size.tokenFontSizestringglobal.size.fontSizeXsInput token font size
size.tokenLineHeightstringglobal.size.lineHeightXsInput token line height
size.tokenFontSizeSmstringglobal.size.fontSizeBaseInput token font size sm
size.tokenLineHeightSmstringglobal.size.lineHeightBaseInput token line height sm
size.buttonPxstringglobal.size.spacer * 2Input button padding inline
size.buttonPystringglobal.size.spacerInput button padding block
size.buttonFontSizestringglobal?.size?.fontSizeXsInput button font size
size.buttonLineHeightstringglobal?.size?.lineHeightXsInput button line height
color.textColorstringglobal.color.colorTextPrimaryInput text color
color.loadingTextColorstringglobal.color.colorTextLoadingInput loading text color
color.bgColorstringglobal.color.colorBgNeutralInput bg color
color.bgColorFocusstringtransparentInput bg color
color.borderColorstring#4C505BInput border color
color.borderColorFocusstringglobal.color.colorTextPrimaryInput border focus color
color.placeholderColorstringglobal.color.colorTextSecondaryInput placeholder color
color.buttonBgColorstringglobal.color.colorBgSecondaryInput button bg color
color.buttonBorderColorstringglobal.color.colorBgAccentToInput button border color
color.buttonTextColorstringglobal.color.colorTextPrimaryInput button text color
style.radiusstringglobal.style.radiusPrimaryInput border radius
style.labelFontWeightstringglobal.style.fontWeightLightInput label font weight
style.fontWeightstringglobal.style.fontWeightLightInput font weight
style.tokenFontWeightstringglobal.style.fontWeightLightInput token font weight
style.buttonRadiusstring30pxInput button border radius
tooltip

path: component.tooltip[name]

nametypedefault valuedescription
color.colorBgstring#12171FTooltip bg color
color.colorTextstring#ffffffTooltip bg color
switch

path: component.switch[name]

nametypedefault valuedescription
color.colorBgCheckedstring#152E4DSwitch checked bg color
color.colorBgstring#4C505BSwitch unchecked bg color
actionButton

path: component.actionButton[name]

nametypedefault valuedescription
size.borderWidthstring1pxAction button border width
color.colorBgFromstringglobal.color.colorBgAccentFromAction button bg gradient color from
color.colorBgTostringglobal.color.colorBgAccentToAction button bg gradient color to
color.colorBgFromHoverstringglobal.color.colorBgAccentFromHoverAction button hover bg gradient color from
color.colorBgToHoverstringglobal.color.colorBgAccentToAction button hover bg gradient color to
color.colorBorderstringglobal.color.colorBgAccentFromAction button border color
color.colorTextstringglobal.color.colorTextAccentAction button text color
color.colorTextstringglobal.color.colorTextAccentAction button text color
color.outlineColorBorderstring#ffffff33Action outline button border color
color.outlineColorBorderHoverstring#ffffffCCAction outline button hover border color
color.outlineColorTextstringglobal.color.colorTextPrimaryAction outline button text color
meta

path: component.meta[name]

nametypedefault valuedescription
size.gapstringglobal.size.gapMeta flex gap
size.pxstringglobal.size.spacer * 3Meta padding inline
color.linkTextColorstringglobal.color.colorBgAccentFromMeta link text color
color.panelBgHoverstringconfig.global.color.colorBgNeutralMeta panel hover bg
Source: packages/trading-widget/src/trading-widget/providers/theme-provider/theme-provider.tsx
Default values: undefined

translation / Translation keys |
nametypedefault valuedescription
depositSlippageWarningstringExcludes entry fee.
withdrawSlippageWarningstringSlippage only applies to single asset withdrawals and withdrawals from vaults with debt positions in Aave.
minSlippageWarningstringFlexible min slippage value that is likely enough to process the transaction.
highSlippageWarningstringWe recommend using another asset to trade with lower slippage.
recommendedMinSlippagestringRecommended Min Slippage
projectedDailyEarningsTooltipstringProjected daily earnings are based on the current APY and may differ from actual earnings.
dailyEarningsstringDaily Earnings
projectedYearlyEarningsTooltipstringProjected yearly earnings are based on the current APY and may differ from actual earnings.
yearlyEarningsstringYearly Earnings
fullReceiveDetailsstringSee full details influencing what you will receive.
tradeDetailsstringTrade details
maxSlippagestringMax slippage
minReceiveAmountstringYou will receive no less than this amount.
minReceivedstringMinimum Received
estimatedMultiAssetFractionsstringEstimated multi asset fractions
infinitestringInfinite
tokenAllowancestringToken Allowance
entryFeestringEntry Fee
entryFeeExplanationstringWhen you deposit, the token takes a small entry fee. This fee helps cover the costs when we rebalance the underlying funds, and it's shared among all token holders.
minDepositUsdstringMinimum deposit in USD.
minDepositstringMinimum Deposit
tokensLockTimestringPurchased tokens will have a {lockTime} lock.
slippageTolerancestringSlippage tolerance
bypassEntryFeestringBypass Entry Fee
tokenAmountToApprovestringAmount of tokens to be approved.
autostringAuto
lengthenLockupstringLengthen lockup to remove entry fee
depositstringBuy
withdrawstringSell
yourBalancestringYour Balance
maxstringMax
allAssetsstringAll Assets
allstringAll
payWithstringPay with
buyEstimatedstringBuy (estimated)
sellstringSell
receiveEstimatedstringReceive (estimated)
confirmInWalletstringPlease confirm in wallet
pendingstringPending...
approvestringApprove
connectWalletstringConnect Wallet
minimumPurchasestringMinimum purchase is ${value}
poolIsInactivestring{poolSymbol} token is no longer active. Please withdraw from them.
poolIsPrivatestringThis vault is currently private
updateOraclesstringUpdate Oracles
checkingOraclesstringChecking Oracles
confirmMaxSlippagestringConfirm {slippagePercentage}% max slippage
withdrawalWindowDisabledstringYou can sell your {tokenSymbol} tokens during withdrawal window period starting from {startTime}
withdrawalLiquidityDisabledstringIntended withdraw value is greater than available liquidity ({value})
withdrawCooldownstringYou can sell your {tokenSymbol} tokens in {cooldownEndTime}
termsOfUsestringTerms Of Use
termOfUseDepositListTitlestringPlease know the following before depositing
termOfUseDepositAssetSlippagestringWhen exiting, investors receive single asset or the underlying vault assets. Withdraw slippage can be customized in withdraw settings
termOfUseDepositBugsstringThere may be interface bugs on the platform
termOfUseDepositDowntimestringThere may be interface downtime (planned and unplanned)
termOfUseDepositAuditRiskstringSmart contracts are audited but a risk is still present
termOfUseDepositAcceptstringAccept & Deposit
backstringBack
highSlippagestringHigh Slippage Alert
responsibleHighSlippagestringBy proceeding with this trade, you acknowledge and accept the possibility of experiencing high slippage, resulting in a potential difference between the expected and executed price.
highSlippageListTitlestringPlease consider the following before confirming
highSlippageQuoteDiffstringBe aware that the final amount of assets you receive may be different from the initially quoted value.
highSlippageRiskstringEnsure that you understand the risks associated with high slippage and are comfortable proceeding with the trade.
confirmstringConfirm
selectTokenstringSelect Token
sendingOrderToWalletstringSending order to your wallet
settingUpTxstringSetting up transaction
miningTxstringProcessing
updateSynthetixOraclesstringUpdating Synthetix Oracles
approveSpendingstringApprove {symbol} spending
paystringPay
multiAssetFractionsstringmulti asset fractions
swappableAssetsstringswappable assets
explorerstringExplorer
asstringAs
switchNetworkstringSwitch Network
depositActionstringBuy
withdrawActionstringSell
swapActionstringSwap
unrollActionstringUnroll
unrollAndClaimActionstringClaim
claimActionstringClaim Without Swap
claimLabelstringClaim Assets
swapAndClaimTostringSwap and claim assets to
initWithdrawDescriptionstringUnroll
initWithdrawTooltipstringUnroll prepares assets for single asset withdrawal
completeWithdrawDescriptionstringClaim
completeWithdrawTooltipstringThis final step swaps all assets to a single asset and sends it to your wallet
unrollAndClaimDescriptionstringClaim
totalstringTotal:
showAllstringShow All
hidestringHide
refreshSwapQuoteTooltipstringRefresh swap quote
proceedWithNextStepstringPlease proceed with the next step.
Source: packages/trading-widget/src/trading-widget/providers/translation-provider/translation-provider.tsx
Default values: packages/trading-widget/src/trading-widget/providers/translation-provider/translation-provider.defaults.ts

Local Development

Follow the steps below to set up the project for local development:

  1. Install Dependencies: Use pnpm to install all required dependencies:

    pnpm install
    
  2. Update Alchemy API Key: Replace the placeholder Alchemy API key in the file:

     packages/trading-widget/src/core-kit/providers/wagmi-provider.tsx
    
  3. Implement getSwapData in:

    packages/trading-widget/src/core-kit/providers/wagmi-provider.tsx
    
  4. Run Storybook

    pnpm storybook
    

FAQs

Package last updated on 11 Feb 2025

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc