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