import { GetLogsReturnType } from "viem"; export type Hex = `0x${string}`; import { abi as CollateralABI } from "./abi/Collateral"; import { abi as PreMarketNrABI } from "./abi/PreMarketNr"; import { abi as PreMarketABI } from "./abi/PreMarket"; import { abi as SwipeABI } from "./abi/Swipe"; import { abi as MarketplaceABI } from "./abi/Marketplace"; export type IEthereumProvider = { request(...args: any): Promise; }; export type IMarketplaceEvent = GetLogsReturnType[0]; export type ICollateralEvent = GetLogsReturnType[0]; export type IPreMarketEvent = GetLogsReturnType[0]; export type IPreMarketNrEvent = GetLogsReturnType[0]; export type ISwipeEvent = GetLogsReturnType[0]; export type IMarket = { id: number; name: string; token?: Hex; goliveDate?: string; expirationDate?: string; conversionRate?: string; locked: boolean; status: IMarketStatus; }; export type IMarketStatus = "MARKET_OPEN" | "MARKET_SETTLING" | "MARKET_CLOSED" | "MARKET_LOCKED" | "MARKET_INVALID"; export declare const toMarketStatus: (status: number) => IMarketStatus; export type IOrder = { id: Hex; side: IOrderSide; status: IOrderStatus; allowPartial: boolean; numFills: number; marketId: number; marketAmount: string; paymentToken: Hex; paymentAmount: string; collateralAmount: string; filledAmount: string; settledAmount: string; claimedAmount: string; maker: Hex; }; export declare const ORDER_SIDE: readonly ["BUY", "SELL"]; export type IOrderSide = (typeof ORDER_SIDE)[number]; export declare const toOrderSide: (side: number) => "BUY" | "SELL"; export declare const ORDER_STATUS: readonly ["ORDER_OPEN", "ORDER_CANCELLED", "ORDER_FILLED", "ORDER_SETTLED", "ORDER_CLAIMED", "ORDER_RECOVERED"]; export type IOrderStatus = (typeof ORDER_STATUS)[number]; export declare const toOrderStatus: (status: number) => "ORDER_OPEN" | "ORDER_CANCELLED" | "ORDER_FILLED" | "ORDER_SETTLED" | "ORDER_CLAIMED" | "ORDER_RECOVERED"; export type IFill = { id: Hex; taker: Hex; amount: string; orderId: Hex; status: IFillStatus; }; export declare const FILL_STATUS: readonly ["FILL_OPEN", "FILL_SETTLED", "FILL_CLAIMED", "FILL_RECOVERED"]; export type IFillStatus = (typeof FILL_STATUS)[number]; export declare const toFillStatus: (status: number) => "FILL_OPEN" | "FILL_SETTLED" | "FILL_CLAIMED" | "FILL_RECOVERED"; export type IMarketplaceListingStatus = "LISTING_OPEN" | "LISTING_CANCELLED" | "LISTING_PURCHASED" | "LISTING_EXPIRED" | "LISTING_INVALID"; export declare const toListingStatus: (status: number) => IMarketplaceListingStatus; export type IMarketplaceOfferStatus = "OFFER_OPEN" | "OFFER_CANCELLED" | "OFFER_ACCEPTED" | "OFFER_EXPIRED" | "OFFER_INVALID"; export declare const toOfferStatus: (status: number) => IMarketplaceOfferStatus; export declare const GAME_STATUS: readonly ["GAME_OPEN", "GAME_PENDING", "GAME_FINISHED", "GAME_CANCELLED"]; export type IGameStatus = (typeof GAME_STATUS)[number]; export declare const toGameStatus: (val: number) => "GAME_OPEN" | "GAME_PENDING" | "GAME_FINISHED" | "GAME_CANCELLED"; export declare const GAME_OUTCOME: readonly ["GAME_OUTCOME_UNSET", "GAME_OUTCOME_A", "GAME_OUTCOME_B", "GAME_OUTCOME_UNKNOWN"]; export type IGameOutcome = (typeof GAME_OUTCOME)[number]; export declare const toGameOutcome: (val: number) => "GAME_OUTCOME_UNSET" | "GAME_OUTCOME_A" | "GAME_OUTCOME_B" | "GAME_OUTCOME_UNKNOWN"; export declare const encodeGameOutcome: (val: IGameOutcome) => number; export type IPreMarketConfig = { owner: Hex; collateral: Hex; feeWallet: Hex; settleDurationSec: number; minCollateralBPS: number; maxCollateralBPS: number; settleFeeBPS: number; cancelFeeBPS: number; minOrderUsdb: bigint; minOrderWeth: bigint; }; export type ICollateralConfig = { owner: Hex; operator: Hex; baseUri: string; }; export type IUpdateMarketParams = { id: number; name?: string; token?: Hex; goliveDate?: string; conversionRate?: string; }; export type ICreateOrderParams = { marketId: number; marketAmount: string; paymentToken: Hex; paymentAmount: string; collateralAmount: string; allowPartial: boolean; side: IOrderSide; data?: Uint8Array; }; export type IFillOrderParams = { orderId: Hex; fillAmount: string; data?: Uint8Array; }; export type IRepriceOrderParams = { orderId: Hex; newMarketAmount: string; }; export type IMarketplaceConfig = { owner: Hex; feeWallet: Hex; collateral: Hex; preMarket: Hex; settleFeeBPS: number; }; export type IMarketplaceListing = { tokenId: Hex; paymentAmount: string; expirationDate: string; paymentToken: Hex; maker: Hex; status: string; }; export type ICreateListingParams = { tokenId: Hex; paymentAmount: string; expirationDate: string; paymentToken: Hex; }; export type IUpdateListingParams = { listingId: Hex; paymentToken: Hex; paymentAmount: string; expirationDate: string; }; export type IPurchaseListingParams = { listingId: Hex; expectedPaymentToken: Hex; expectedPaymentAmount: string; }; export type IMarketplaceOffer = { tokenId: Hex; paymentAmount: string; expirationDate: string; paymentToken: Hex; maker: Hex; status: IMarketplaceOfferStatus; }; export type ICreateOfferParams = { tokenId: Hex; paymentToken: Hex; paymentAmount: string; expirationDate: string; }; export type IUpdateOfferParams = { offerId: Hex; paymentToken: Hex; paymentAmount: string; expirationDate: string; }; export type IAcceptOfferParams = { offerId: Hex; expectedPaymentToken: Hex; expectedPaymentAmount: string; listingId?: Hex; }; export type ISwipeConfig = { owner: Hex; feeWallet: Hex; claimFeeBPS: number; }; export type ISwipeGame = { id: Hex; priceToken: Hex; pricePerShare: string; expiresAt: string; aShares: string; bShares: string; outcome: IGameOutcome; status: IGameStatus; }; export type ISwipeChoice = { id: Hex; gameId: Hex; player: Hex; numShares: string; value: "GAME_OUTCOME_A" | "GAME_OUTCOME_B"; claimed: boolean; }; export type ICreateGameParams = { priceToken: Hex; pricePerShare: string; expiresAt: string; }; export type IUpdateGameParams = { gameId: Hex; outcome: IGameOutcome; }; export type IPickParams = { gameId: Hex; numShares: string; value: "GAME_OUTCOME_A" | "GAME_OUTCOME_B"; };