UNPKG

@azuro-org/toolkit

Version:

This framework-agnostic package provides essential utilities for building applications on the Azuro Protocol.

36 lines (35 loc) 1.23 kB
import { type Address } from 'viem'; import { type ChainId } from '../../config'; import { type Selection } from '../../global'; export type GetBetCalculationParams = { chainId: ChainId; selections: Selection[]; account: Address | undefined; }; export type GetBetCalculationResponse = { response: { /** if `minBet` is `undefined`, there is no bottom limit */ minBet: number | undefined; maxBet: number; maxPayout: `${number}`; }; }; export type GetBetCalculationResult = GetBetCalculationResponse['response']; /** * Calculates the minimum and maximum bet amount for given selections. * User's account is required to provide the **correct** maximum bet amount. * It may be undefined if the user isn't logged in. * * - Docs: https://gem.azuro.org/hub/apps/toolkit/bet/getBetCalculation * * @example * import { getBetCalculation } from '@azuro-org/toolkit' * * const account = userWallet?.address * const selections = [ * { conditionId: '1', outcomeId: '1' }, * ] * * const { minBet, maxBet } = await getBetCalculation({ selections, account }) * */ export declare const getBetCalculation: (props: GetBetCalculationParams) => Promise<GetBetCalculationResult>;