Skip to content

amm.getPool

Gets the reserves for a liquidity pool.

Usage

ts
import {  } from 'wagmi/tempo'
import {  } from './config'

const  = await ..(, {
  : '0x20c0000000000000000000000000000000000000',
  : '0x20c0000000000000000000000000000000000001',
})

.('User token reserve:', .)
.('Validator token reserve:', .)
User token reserve: 1000000000000000000000n
.('Total supply:', .)
Validator token reserve: 1000000000000000000000n
Total supply: 1000000000000000000000n
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

ts
type ReturnType = {
  /** Reserve of user token */
  reserveUserToken: bigint
  /** Reserve of validator token */
  reserveValidatorToken: bigint
  /** Total supply of LP tokens */
  totalSupply: bigint
}

Parameters

userToken

  • Type: Address | bigint

Address or ID of the user token.

validatorToken

  • Type: Address | bigint

Address or ID of the validator token.

Viem

Released under the MIT License.