
Product
Introducing Socket Firewall Enterprise: Flexible, Configurable Protection for Modern Package Ecosystems
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.
@dhedge/trading-widget
Advanced tools
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"
npm i @dhedge/trading-widget
import { WagmiProvider } from 'wagmi'
import { TradingPanelProvider, TradingWidget } from '@dhedge/trading-widget'
getSwapData callback is mandatory for depositing with off-chain swaps.See bare minimum setup example: packages/trading-widget/src/examples/simple-example.tsx
import '@dhedge/trading-widget/style.css'
Initially widget takes full parent width
See TradingWidget -> theme config to manage customization
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
name type default value description onUpdateSendTokenInput(payload: Partial<{ address: Address; symbol:string; value:string; decimals:number; isLoading?:boolean}>) => voidundefined triggers on send token change onUpdateTradingSettings(payload: Partial<{ slippage: number | 'auto'; minSlippage?:numberisInfiniteAllowance:boolean; isMultiAssetWithdrawalEnabled:boolean; isCustomDepositOptionsDisabled?:boolean; isMaxSlippageLoading:boolean}>) => voidundefined triggers on trading settings change onSetTradingType(payload: 'deposit' | 'withdraw') => voidundefined triggers on trading type change onUpdateTradingModal(payload: Partial<{ isOpen: boolean; status:'Success' | 'None' | 'Mining' | 'Wallet'}>) => voidundefined triggers on trading modal change onUpdateTransactions(payload: AddTransaction | UpdateTransaction | RemoveTransaction) => void undefined triggers on transaction action change onTradingSettleError(error: Error) => voidundefined triggers on trading settle error onTransactionError(error: Error, action:TransactionAction|undefined, chainId?:ChainId, txHash?:Address) => voidundefined triggers on transaction error onTransactionSuccess(data: WaitForTransactionReceiptReturnType, action:TransactionAction|undefined, link?:string) => voidundefined triggers on transaction success onTransactionEstimationError(error: EstimationError, address:Address, chainId?:ChainId, account?:Address) => voidundefined triggers on transaction estimation error onTokenSelector(payload: { isOpen: boolean; entity:'token' | 'pool'}) => voidundefined triggers on token selector change onLog(eventName: string, payload?:Record<string, unknown>) => voidundefined triggers 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>undefined triggers 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; rawTransaction:{ data: string }; routerKey:'ONE_INCH' / 'ONE_INCH_V5' / 'ZERO_X' / 'PARASWAP' / 'PARASWAP_V6' / 'ODOS_V2'} } | null>undefined provides off chain swap data based on send token value
packages/trading-widget/src/core-kit/providers/index.tsxundefinedinitialState / Optional initial state of trading panel
name type default value description poolAddressAddress AddressZeroCurrent active pool address poolConfigMapRecord<Address, PoolConfig> {}Map of pool configs available for trading settings{ slippage: number | 'auto'; minSlippage?:number; isInfiniteAllowance:boolean; isMultiAssetWithdrawalEnabled:boolean; isCustomDepositOptionsDisabled?:boolean; isMaxSlippageLoading:boolean; availableAggregators:string[]}{ slippage: 'auto'; isInfiniteAllowance:false; isMultiAssetWithdrawalEnabled:true; isMaxSlippageLoading:false; availableAggregators:[]}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 \; 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) undefined Chain id that will be returned from useNetwork wagmi hook when connected to unsupported network customDepositTokensPerChainRecord<ChainId, TradingToken[]> undefinedPer-chain map of extra deposit tokens that are appended to depositParams.customTokens.
packages/trading-widget/src/core-kit/providers/index.tsxpackages/trading-widget/src/core-kit/providers/index.tsxPoolConfig / Vault configuration schema
name type default value description addressAddress— Vault contract address symbolstring— Vault token symbol chainIdChainId— Chain identifier where the vault lives depositParams.customTokensTradingToken[][]List of additional assets accepted for deposits depositParams.defaultDepositTokenSymbolstringundefinedSymbol of token to pre-select by default when switching to the Deposit tab withdrawParams.customTokensTradingToken[][]List of single-asset options available for withdrawals withdrawParams.defaultWithdrawTokenSymbolstringundefinedSymbol of token to pre-select by default when switching to the Withdraw tab (falls back to first customTokensitem if undefined).deprecatedbooleanfalseMarks vault as deprecated and blocks trading operations maintenancebooleanfalseEnables global vault maintenance mode (blocks deposits & withdrawals) maintenanceDepositsbooleanfalseBlocks only deposits maintenanceWithdrawalsbooleanfalseBlocks only withdrawals pricingAsset{ address: Address; symbol: string }undefinedPricing asset used for limit orders
packages/trading-widget/src/core-kit/types/config.types.tsUI 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
name type default value description isGeoBlockedbooleanfalseRestricts depositing action button and conditionally renders GeoBlockAlert component isSanctionedbooleanfalseRestricts depositing action button and conditionally renders SanctionedAlert component depositQuoteDiffWarningThresholdnumber1.5Deposit 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.75Default 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 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 isCustomDepositOptionsDisabledbooleanfalseWhen enabled, excludes custom deposit tokens and native tokens from deposit options. Only vault's default deposit tokens are available. chainConfigPartial<Record<ChainId, { name: string; iconPath: string }>>{}Sets map of chain nameandiconPathaaveOffchainWithdrawMinValuenumber50Value in USD when off-chain Aave withdrawal is enabled getFallbackIconPath(tokenName: string) => stringbuildIconLinkFallback token icon path getter minLimitOrderValuenumber0Minimum USD value required to create a limit sell order limitOrderThemeConfigThemeProviderConfigProps{}Limit sell overlay content theme config
name type default value description onConnect() => void() => {}Widget has built-in Connect Walletaction button that triggersonConnectcallback assuming starting of abstract wallet connection process. After all the only requirement is to get connected wallet inside wagmi'suseAccounthook to make trading operations possibleonAcceptTermsOfUse() => Promise<boolean>() => Promise.resolve(true)Callback is triggered after user's approval of Terms of Use statements assuming switching of external config.termsOfUseAcceptedparam totruestate
packages/trading-widget/src/trading-widget/providers/config-providerpackages/trading-widget/src/trading-widget/providers/config-provider/config-provider.defaults.tscomponents
/
Custom components to be injected into widget layout
name type default value description GeoBlockAlertComponentType <GeoBlockAlert>Component replaces deposit button while isGeoBlockedconfig param is set totrueSanctionedAlertComponentType <SanctionedAlert>Component replaces deposit button while isSanctionedconfig param is set totrueMaxSupplyReachedAlertComponentType <MaxSupplyReachedAlert>Component rendered in the deposit meta when the expected total supply exceeds the max cap; warns that the deposit will not go through DepositMetaInfoComponentType undefinedComponent is injected into deposit meta part of widget layout nearby TransactionOverviewDisclosure WithdrawMetaInfoComponentType undefinedComponent is injected into withdraw meta part of widget layout nearby WithdrawTransactionOverviewDisclosure CustomDepositMetaComponentType undefinedCustom extra component injected above deposit meta section in the deposit tab panel (e.g., chart, info, etc.) ImageComponentType <img>Component optionally can be used to pass nextjsImage component to be used for assets renderingLogoSpinnerComponentType<SVGProps> <Spinner>Component is injected into widget pending transaction overlay. Assume using of spinning animation DepositTermsOfUseComponentType undefinedComponent is injected into TermsOfUseOverlayto extend default terms of use statement pointsActionButtonComponentType <ActionButton>Component overrides default ActionButtonand hasButtonPropsAPI
packages/trading-widget/src/trading-widget/providers/component-provider/component-provider.tsxundefinedtheme
/
Widget styling variables config
path: global.color[name]
name type default value description colorTextPrimarystring #ffffffPrimary text color colorTextPrimaryHoverstring #ffffffCCPrimary hover text color colorBorderPrimarystring global?.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 fromcolorcolorBgAccentTostring #34855EAccent bg gradient tocolorcolorBgAccentFromHoverstring #73D393CCAccent hover bg gradient fromcolorcolorBgAccentToHoverstring #162435Accent hover bg gradient tocolorcolorTextNeutralstring #9DA2AD80Neutral text color colorBgNeutralstring #9DA2AD33Neutral bg color colorTextLoadingstring #ffffff99Loading text color colorTextErrorstring #EF4444Error text color colorTextWarningstring #AFA58DWarning text color colorTextSuccessstring #73D393Success text color colorIconstring global?.color?.colorTextPrimary ?? #ffffffIcon color colorIconHoverstring global?.color?.colorIconHover ?? #ffffffCCIcon hover color colorScrollbarstring #73D39380Scrollbar color
path: global.size[name]
name type default value description gapstring 0.25remGeneral flex gap spacerstring 4pxGeneral spacer fontSizeBasestring 16pxFont size base lineHeightBasestring 24pxLine height base fontSizeXsstring 12pxFont size xs lineHeightXsstring 16pxLine height xs fontSizeSmstring 14pxFont size sm lineHeightSmstring 20pxLine height sm fontSizeLgstring 18pxFont size lg lineHeightLgstring 28pxLine height lg iconSizestring 20pxIcon size base iconSizeSmstring 24pxIcon size sm iconSecondarySizestring 16pxIcon secondary size iconSecondarySizeSmstring 16pxIcon secondary size sm labelFontSizestring config?.global?.size?.fontSizeXs ?? 12pxLabel font size labelLineHeightstring config?.global?.size?.lineHeightXs ?? 16pxLabel font size labelLineHeightstring config?.global?.size?.lineHeightXs ?? 16pxLabel font size
path: global.style[name]
name type default value description radiusPrimarystring 1remGeneral border radius radiusSecondarystring 1remSecondary border radius fontWeightLightstring 300Font weight light fontWeightMediumstring 500Font weight medium fontWeightBoldstring 700Font weight bold actionOpacitystring 1Action element opacity actionOpacityHoverstring 0.8Action hover element opacity
path: component.notification[name]
name type default value description color.colorBgstring config?.global?.color?.colorBgSecondary ?? #2B313ENotification bg color
path: component.popup[name]
name type default value description color.colorTextstring config?.global?.color?.colorTextSecondary ?? #9DA2ADPopup text color color.colorBgstring config?.global?.color?.colorBgSecondary ?? #2B313EPopup bg color color.colorBorderstring config?.global?.color?.colorTextSecondary ?? #9DA2ADPopup bg color size.fontSizestring config?.global?.size?.fontSizeXs ?? 12pxPopup font size
path: component.popupList[name]
name type default value description color.itemBgEvenstring transparentPopup list even item bg color color.itemBgOddstring #2A3648Popup list odd item bg color color.headerBgstring #1B2432Popup list header bg color
path: component.tabGroup[name]
name type default value description size.pxstring global.size.spacer * 3Tab group padding inline
path: component.tabList[name]
name type default value description color.colorBgstring #181C25Tab list bg color style.radiusstring global.style.radiusSecondaryTab list border radius size.pxstring global.size.spacer * 3Tab list padding inline size.pystring global.size.spacer * 2Tab list padding vertical
path: component.tabContent[name]
name type default value description size.ptstring global.size.spacer * 3Tab content padding top size.pxstring 0pxTab content padding inline size.pbstring global.size.spacer * 9Tab content padding bottom size.gapstring global.size.spacer * 2Tab content flex gap
path: component.tab[name]
name type default value description size.pxstring global.size.spacer * 9Tab padding inline size.pystring global.size.spacer * 3Tab padding block size.fontSizestring global.size.fontSizeSmTab font size color.colorBgstring global.color.colorBgNeutralTab bg color color.colorTextstring global.color.colorTextNeutralTab text color color.selectColorTextstring global.color.colorTextPrimaryTab select text color color.colorTextHoverstring global.color.colorTextPrimaryHoverTab hover text color style.fontWeightstring global.style.fontWeightBoldTab font weight style.lineHeightstring global.size.lineHeightSmTab line height
path: component.balance[name]
name type default value description size.pxstring global.size.spacer * 3Balance padding inline size.gapstring global.size.gapBalance flex gap size.fontSizestring global.size.fontSizeLgBalance font size size.lineHeightstring global.size.lineHeightLgBalance line height size.priceFontSizestring global.size.fontSizeBaseBalance price font size size.priceLineHeightstring global.size.lineHeightBaseBalance price line height color.colorTextstring global.color.colorTextPrimaryBalance text color color.priceColorTextstring global.color.colorTextSecondaryBalance price text color
path: component.inputGroup[name]
name type default value description size.pxstring global.size.spacer * 3Input group padding inline size.gapstring global.size.gapInput group flex gap
path: component.input[name]
name type default value description size.pxstring global.size.spacer * 3Input padding inline size.pystring global.size.spacer * 2Input padding block size.gapstring global.size.gap * 2Input flex gap size.priceGapstring global.size.gap * 2Input flex gap size.iconSizestring global.size.iconSizeInput icon size size.iconSizeSmstring global.size.iconSizeSmInput icon size sm size.labelFontSizestring global.size.fontSizeSmInput label line height size.labelLineHeightstring global.size.lineHeightSmInput label font size size.fontSizestring global.size.fontSizeSmInput font size size.lineHeightstring global.size.lineHeightSmInput line height size.fontSizeLgstring global.size.fontSizeLgInput font size lg size.lineHeightLgstring global.size.lineHeightLgInput line height lg size.tokenFontSizestring global.size.fontSizeXsInput token font size size.tokenLineHeightstring global.size.lineHeightXsInput token line height size.tokenFontSizeSmstring global.size.fontSizeBaseInput token font size sm size.tokenLineHeightSmstring global.size.lineHeightBaseInput token line height sm size.buttonPxstring global.size.spacer * 2Input button padding inline size.buttonPystring global.size.spacerInput button padding block size.buttonFontSizestring global?.size?.fontSizeXsInput button font size size.buttonLineHeightstring global?.size?.lineHeightXsInput button line height color.textColorstring global.color.colorTextPrimaryInput text color color.loadingTextColorstring global.color.colorTextLoadingInput loading text color color.bgColorstring global.color.colorBgNeutralInput bg color color.bgColorFocusstring transparentInput bg color color.borderColorstring #4C505BInput border color color.borderColorFocusstring global.color.colorTextPrimaryInput border focus color color.placeholderColorstring global.color.colorTextSecondaryInput placeholder color color.buttonBgColorstring global.color.colorBgSecondaryInput button bg color color.buttonBorderColorstring global.color.colorBgAccentToInput button border color color.buttonTextColorstring global.color.colorTextPrimaryInput button text color style.radiusstring global.style.radiusPrimaryInput border radius style.labelFontWeightstring global.style.fontWeightLightInput label font weight style.fontWeightstring global.style.fontWeightLightInput font weight style.tokenFontWeightstring global.style.fontWeightLightInput token font weight style.buttonRadiusstring 30pxInput button border radius
path: component.tooltip[name]
name type default value description color.colorBgstring #12171FTooltip bg color color.colorTextstring #ffffffTooltip bg color
path: component.switch[name]
name type default value description color.colorBgCheckedstring #152E4DSwitch checked bg color color.colorBgstring #4C505BSwitch unchecked bg color color.colorstring `` Switch unchecked text color color.colorCheckedstring `` Switch checked text color
path: component.actionButton[name]
name type default value description size.borderWidthstring 1pxAction button border width color.colorBgFromstring global.color.colorBgAccentFromAction button bg gradient color from color.colorBgTostring global.color.colorBgAccentToAction button bg gradient color to color.colorBgFromHoverstring global.color.colorBgAccentFromHoverAction button hover bg gradient color from color.colorBgToHoverstring global.color.colorBgAccentToAction button hover bg gradient color to color.colorBorderstring global.color.colorBgAccentFromAction button border color color.colorTextstring global.color.colorTextAccentAction button text color color.colorTextstring global.color.colorTextAccentAction button text color color.outlineColorBorderstring #ffffff33Action outline button border color color.outlineColorBorderHoverstring #ffffffCCAction outline button hover border color color.outlineColorTextstring global.color.colorTextPrimaryAction outline button text color
path: component.meta[name]
name type default value description size.gapstring global.size.gapMeta flex gap size.pxstring global.size.spacer * 3Meta padding inline size.fontSizestring global.size.fontSizeXsMeta font size size.lineHeightstring global.size.lineHeightXsMeta line height size.emphasisedFontSizestring global.size.fontSizeSmMeta font size emphasised size.emphasisedLineHeightstring global.size.lineHeightSmMeta line height emphasised color.linkTextColorstring global.color.colorBgAccentFromMeta link text color color.panelBgHoverstring config.global.color.colorBgNeutralMeta panel hover bg
packages/trading-widget/src/trading-widget/providers/theme-provider/theme-provider.tsxundefinedtranslation
/
Translation keys
name type default value description depositSlippageWarningstring Excludes entry fee. withdrawSlippageWarningstring Slippage only applies to single asset withdrawals and withdrawals from vaults with debt positions in Aave. minSlippageWarningstring Flexible min slippage value that is likely enough to process the transaction. highSlippageWarningstring We recommend using another asset to trade with lower slippage. recommendedMinSlippagestring Recommended Min Slippage projectedDailyEarningsTooltipstring Projected daily earnings are based on the current APY and may differ from actual earnings. dailyEarningsstring Daily Earnings projectedYearlyEarningsTooltipstring Projected yearly earnings are based on the current APY and may differ from actual earnings. yearlyEarningsstring Yearly Earnings fullReceiveDetailsstring See full details influencing what you will receive. tradeDetailsstring Trade details maxSlippagestring Max slippage minReceiveAmountstring You will receive no less than this amount. minReceivedstring Minimum Received estimatedMultiAssetFractionsstring Estimated multi asset fractions infinitestring Infinite tokenAllowancestring Token Allowance entryFeestring Entry Fee entryFeeExplanationstring When 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. minDepositUsdstring Minimum deposit in USD. minDepositstring Minimum Deposit tokensLockTimestring Purchased tokens will have a {lockTime} lock. slippageTolerancestring Slippage tolerance bypassEntryFeestring Bypass Entry Fee tokenAmountToApprovestring Amount of tokens to be approved. autostring Auto lengthenLockupstring Lengthen lockup to remove entry fee depositstring Buy withdrawstring Sell maxstring Max allAssetsstring All Assets allstring All sellstring Sell receiveEstimatedstring Receive (estimated) confirmInWalletstring Please confirm in wallet pendingstring Pending... approvestring Approve connectWalletstring Connect Wallet minimumPurchasestring Minimum purchase is {value} poolIsInactivestring {poolSymbol} token is no longer active. Please withdraw from them. poolDepositsAreMaintenancestring {poolSymbol} token is under maintenance. Deposits are temporarily blocked. poolWithdrawalsAreMaintenancestring {poolSymbol} token is under maintenance. Withdrawals are temporarily blocked. poolIsPrivatestring This vault is currently private confirmMaxSlippagestring Confirm {slippagePercentage}% max slippage withdrawalLiquidityDisabledstring Intended withdraw value is greater than available liquidity ({value}) withdrawCooldownstring You can sell your {tokenSymbol} tokens in {cooldownEndTime} termsOfUsestring Terms Of Use termOfUseDepositListTitlestring Please know the following before depositing termOfUseDepositAssetSlippagestring When exiting, investors receive single asset or the underlying vault assets. Withdraw slippage can be customized in withdraw settings termOfUseDepositBugsstring There may be interface bugs on the platform termOfUseDepositDowntimestring There may be interface downtime (planned and unplanned) termOfUseDepositAuditRiskstring Smart contracts are audited but a risk is still present termOfUseDepositAcceptstring Accept & Deposit backstring Back donestring Done termOfUseWithdrawAcceptLabelstring I understand and accept the withdraw terms termOfUseWithdrawPoint1string Withdrawal requests are intended to settle in USDC. In rare cases where market conditions or high slippage prevent a USDC swap, the order may be settled in the underlying tokens of the respective vault. termOfUseWithdrawPoint2string Revoking token approval after placing an order will prevent the order from being executed. highSlippagestring High Slippage Alert responsibleHighSlippagestring By 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. highSlippageListTitlestring Please consider the following before confirming highSlippageQuoteDiffstring Be aware that the final amount of assets you receive may be different from the initially quoted value. highSlippageRiskstring Ensure that you understand the risks associated with high slippage and are comfortable proceeding with the trade. confirmstring Confirm selectTokenstring Select Token sendingOrderToWalletstring Sending order to your wallet settingUpTxstring Setting up transaction miningTxstring Processing approveSpendingstring Approve {symbol} spending paystring Pay multiAssetFractionsstring multi asset fractions swappableAssetsstring swappable assets explorerstring Explorer asstring As switchNetworkstring Switch Network depositActionstring Buy withdrawActionstring Sell swapActionstring Swap unrollActionstring Unroll unrollAndClaimActionstring Claim claimActionstring Claim Without Swap claimLabelstring Claim Assets createLimitSellOrderstring Stop order set swapAndClaimTostring Swap and claim assets to initWithdrawDescriptionstring Unroll initWithdrawTooltipstring Unroll prepares assets for single asset withdrawal completeWithdrawDescriptionstring Claim completeWithdrawTooltipstring This final step swaps all assets to a single asset and sends it to your wallet unrollAndClaimDescriptionstring Claim limitOrderWithdrawDescriptionstring You are about to create a withdrawal request. Your vault tokens will be withdrawn within a few minutes. totalstring Total: showAllstring Show All hidestring Hide refreshSwapQuoteTooltipstring Refresh swap quote proceedWithNextStepstring Please proceed with the next step. aggregatorsLabelstring Swap source aggregatorsTooltipstring Choose which aggregators to use for your trades. batchTransactionsLabelstring Batch transactions batchTransactionsSwitchLabelstring Batch batchTransactionsTooltipstring Group approve and trade calls into a single batch transaction. Disable if you prefer separate prompts. openLimitOrderAfterBuySwitchLabelstring Add Stop Order orderingLabelstring Ordering paidLabelstring Paid priceLabelstring Price transactionLabelstring Transaction stopOrderstring Stop Order sendstring Send cooldownstring Cooldown deletestring Delete withdrawalRequeststring Withdrawal request deleteWithdrawalRequeststring Delete withdrawal request insufficientBalancestring Insufficient Balance expectToReceiveUsdcSoonstring Expect to receive your USDC over the next few minutes
packages/trading-widget/src/trading-widget/providers/translation-provider/translation-provider.tsxpackages/trading-widget/src/trading-widget/providers/translation-provider/translation-provider.defaults.tspath: component.divider[name]
name type default value description color.colorBgstring global.color.colorBgNeutralorpanel-secondary-content-colorDivider background color
Follow the steps below to set up the project for local development:
Install Dependencies:
Use pnpm to install all required dependencies:
pnpm install
Update Alchemy API Key: Replace the placeholder Alchemy API key in the file:
packages/trading-widget/src/core-kit/providers/wagmi-provider.tsx
Implement getSwapData in:
packages/trading-widget/src/core-kit/providers/wagmi-provider.tsx
Run Storybook
pnpm storybook
FAQs
Requirements:
The npm package @dhedge/trading-widget receives a total of 952 weekly downloads. As such, @dhedge/trading-widget popularity was classified as not popular.
We found that @dhedge/trading-widget demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 7 open source maintainers collaborating on the project.
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.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.