@azuro-org/toolkit
Version:
This framework-agnostic package provides essential utilities for building applications on the Azuro Protocol.
40 lines (39 loc) • 1.25 kB
TypeScript
import { type Address, type Hex } from 'viem';
import { type CreateBetResponse, type BetClientData } from '../../global';
export type CreateBetParams = {
account: Address;
clientData: BetClientData;
bet: {
conditionId: string | bigint;
outcomeId: string | number | bigint;
minOdds: string | bigint;
amount: string | bigint;
nonce: string | number | bigint;
};
signature: Hex;
bonusId?: string;
};
export type CreateBetResult = CreateBetResponse;
/**
* Creates a single (ordinary) bet by submitting signed bet data to the Azuro API.
* This function sends the bet order to the relayer which will then place the bet on-chain.
*
* - Docs: https://gem.azuro.org/hub/apps/toolkit/bet/createBet
*
* @example
* import { createBet } from '@azuro-org/toolkit'
*
* const account = '0x...'
* const clientData = { chainId: 137, core: '0x...', ... }
* const bet = {
* conditionId: '1',
* outcomeId: '1',
* minOdds: '1500000000000',
* amount: '1000000',
* nonce: '1',
* }
* const signature = '0x...'
*
* const result = await createBet({ account, clientData, bet, signature })
* */
export declare const createBet: (props: CreateBetParams) => Promise<CreateBetResult>;