@azuro-org/toolkit
Version:
This framework-agnostic package provides essential utilities for building applications on the Azuro Protocol.
29 lines (28 loc) • 810 B
TypeScript
import { type ChainId } from '../../config';
import type { BetOrderData } from './types';
export type GetBetParams = {
chainId: ChainId;
orderId: string;
};
export type GetBetResponse = BetOrderData;
export type GetBetResult = GetBetResponse | null;
/**
* Retrieves bet order data by order ID from the Azuro API.
* Returns null if the bet order is not found.
*
* - Docs: https://gem.azuro.org/hub/apps/toolkit/bet/getBet
*
* @example
* import { getBet } from '@azuro-org/toolkit'
*
* const orderId = '0x123...'
* const chainId = 137
*
* const bet = await getBet({ chainId, orderId })
*
* if (bet) {
* console.log('Bet state:', bet.state)
* console.log('Bet result:', bet.result)
* }
* */
export declare const getBet: ({ chainId, orderId }: GetBetParams) => Promise<GetBetResult>;