Configuration
This page details your widget configuration options. Tweak it to fit your exact user experience needs!
Component Props
The SwapWidget
component accepts the following props.
defaultRoute
Customizes the initial route displayed on widget load. Query supported assets using the Skip Go API /assets endpoint. Setting this triggers a route request on render.
amountIn
: Preset input amount for exact amount in request.amountOut
: Preset output amount for exact amount out request. If both specified, onlyamountIn
is used.srcChainID
: Source chain ID.srcAssetDenom
: Source asset denomination.destChainID
: Destination chain ID.destAssetDenom
: Destination asset denomination.
routeConfig
Customizes enabled route types.
allowMultiTx
: Allow multi-transaction routes. Default: true.allowUnsafe
: Allow unsafe routes. Default: false. More info.bridges
: Restrict routing to specific bridges. Default: empty (all bridges).swapVenues
: Restrict routing to specific swap venues. Default: empty (all venues).smartSwapOptions
: Advanced swapping features like EVM Swaps and split trade routes. More info.
filter
Limits source and destination chains and assets.
Example:
settings
Sets defaults for user-customizable settings.
customGasAmount
: Gas amount for CosmosSDK chain transactions. Default: 200000.slippage
: Default slippage percentage (0-100) for CosmosSDK chain swaps. Default: 3.
onlyTestnet
onlyTestnet
: Boolean to show only testnet data. Default: false (mainnet data only).
toasterProps
Props for the toaster component. Refer to ToasterProps for more details. Position defaults to { position: 'top-right' }
.
endpointOptions
Override default Skip proxied endpoints. Whitelisting required, reach out here.
apiURL
String to override default Skip Go API proxied endpoints. Whitelisting required, reach out here.
theme
Customize widget appearance.
callbacks
Event handling functions.
onWalletConnected
: Called when a wallet is connected.onWalletDisconnected
: Called when a wallet is disconnected.onTransactionBroadcasted
: Called when a transaction is broadcasted. This is called multiple times for multi-transaction routes.onTransactionComplete
: Triggered when a transaction is completed.onTransactionFailed
: Triggered when a transaction fails.onValidateGasBalance
: Triggered when validating gas balance.
connectedWallet
Inject your own wallet provider into the SwapWidget. See an implementation example here.
WalletClient
comes from the viem
package. Adapter
comes from the @solana/wallet-adapter-base
package. And OfflineSigner
comes from the @cosmjs
package.
chainIDsToAffiliates
Define fees per chain and recipient addresses.
Total basisPointsFee must be consistent across chains. Addresses must be valid for respective chains.
className
String to apply custom CSS classes.
style
React.CSSProperties to apply custom inline styles.