@azuro-org/sdk
Version:
One-stop solution for building betting dApps on the Azuro Protocol.
54 lines (53 loc) • 1.77 kB
TypeScript
import { type Address, type TransactionReceipt, type Hex } from 'viem';
import { type Selection, type Freebet, type ChainId } from '@azuro-org/toolkit';
type UseBetProps = {
betAmount: string;
slippage: number;
affiliate: Address;
selections: Selection[];
odds: Record<string, number>;
totalOdds: number;
chainId?: ChainId;
freebet?: Pick<Freebet, 'id' | 'params'>;
EIP712Attention?: string;
deadline?: number;
onSuccess?(receipt?: TransactionReceipt): void;
onError?(err?: Error): void;
};
export declare const useBet: (props: UseBetProps) => {
submit: () => Promise<void>;
approveTx: {
isPending: boolean;
isProcessing: boolean;
};
betTx: {
data: `0x${string}` | undefined;
receipt: {
blobGasPrice?: bigint | undefined;
blobGasUsed?: bigint | undefined;
blockHash: import("viem").Hash;
blockNumber: bigint;
contractAddress: Address | null | undefined;
cumulativeGasUsed: bigint;
effectiveGasPrice: bigint;
from: Address;
gasUsed: bigint;
logs: import("viem").Log<bigint, number, false>[];
logsBloom: Hex;
root?: `0x${string}` | undefined;
status: "success" | "reverted";
to: Address | null;
transactionHash: import("viem").Hash;
transactionIndex: number;
type: import("viem").TransactionType;
chainId: number;
} | undefined;
isPending: boolean;
isProcessing: boolean;
};
relayerFeeAmount: string | undefined;
isAllowanceLoading: boolean;
isApproveRequired: boolean;
isRelayerFeeLoading: boolean;
};
export {};