Skip to Content

The useWrapTokens hook to handle wrapping and unwrapping tokens on the Gnosis and Base chains.

ℹ️

The useWrapTokens uses chain settings from ChainProvider.

Usage

import { useWrapTokens } from '@azuro-org/sdk' const { wrap, unwrap } = useWrapTokens() wrap('0.1') // wrap 0.1 XDAI to 0.1 WXDAI unwrap('0.1') // unwrap 0.1 WXDAI to 0.1 XDAI

Props

{ chainId?: ChainId }
type ChainId = | 100 // Gnosis | 137 // Polygon | 80002 // Polygon Amoy | 88888 // Chiliz | 88882 // Chiliz Spicy | 8453 // Base | 84532 // Base Sepolia

Return Value

{ wrap: Promise<TransactionReceipt> unwrap: Promise<TransactionReceipt> wrapTx: { // wrap transaction state data: Hex receipt: TransactionReceipt isPending: boolean isProcessing: boolean } unwrapTx: { // unwrap transaction state data: Hex receipt: TransactionReceipt isPending: boolean isProcessing: boolean } }
Last updated on