Skip to content

dex.useBuyQuote

Gets the quote for buying a specific amount of tokens.

Usage

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

const { :  } = ..({
  : ('100', 6),
  : '0x20c0000000000000000000000000000000000001',
  : '0x20c0000000000000000000000000000000000002',
})

.('Amount needed:', )
Amount needed: 100300000n
ts
import { createConfig, http } from 'wagmi'
import { tempoTestnet } from 'wagmi/chains'
import { KeyManager, webAuthn } from 'wagmi/tempo'

export const config = createConfig({
  connectors: [
    webAuthn({
      keyManager: KeyManager.localStorage(),
    }),
  ],
  chains: [tempoTestnet],
  multiInjectedProviderDiscovery: false,
  transports: {
    [tempoTestnet.id]: http(),
  },
})

Return Type

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

data

See Wagmi Action dex.getBuyQuote Return Type

Parameters

See Wagmi Action dex.getBuyQuote Parameters

query

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

Action

Released under the MIT License.