dex.getSellQuote
Gets the quote for selling a specific amount of tokens.
Usage
ts
import { } from 'wagmi/tempo'
import { } from 'viem'
import { } from './config'
const = await ..(, {
: ('100', 6),
: '0x20c0000000000000000000000000000000000001',
: '0x20c0000000000000000000000000000000000002',
})
.('Amount received:', )
Amount received: 99700000nts
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
ts
type ReturnType = bigintReturns the amount of tokenOut received for selling the specified amountIn of tokenIn.
Parameters
amountIn
- Type:
bigint
Amount of tokenIn to sell.
tokenIn
- Type:
Address
Address of the token to sell.
tokenOut
- Type:
Address
Address of the token to receive.