Skip to content

dex.useSellQuote ​

Gets the quote for selling a specific amount of tokens.

Usage ​

ts
import { Hooks } from 'wagmi/tempo'
import { parseUnits } from 'viem'

const { data: quote } = Hooks.dex.useSellQuote({
  amountIn: parseUnits('100', 6),
  tokenIn: '0x20c0000000000000000000000000000000000001',
  tokenOut: '0x20c0000000000000000000000000000000000002',
})

console.log('Amount received:', quote)
// @log: Amount received: 99700000n
ts
import { createConfig, http } from 'wagmi'
import { tempo } from 'wagmi/chains'
import { tempoWallet } from 'wagmi/tempo'

export const config = createConfig({
  connectors: [tempoWallet()],
  chains: [tempo],
  multiInjectedProviderDiscovery: false,
  transports: {
    [tempo.id]: http(),
  },
})

Return Type ​

See TanStack Query query docs for more info hook return types.

data ​

See Wagmi Action dex.getSellQuote Return Type

Parameters ​

See Wagmi Action dex.getSellQuote Parameters

query ​

See the TanStack Query query docs for more info hook parameters.

Action ​

Released under the MIT License.