{"version":3,"file":"clob.cjs","names":[],"sources":["../../src/types/clob.ts"],"sourcesContent":["import { Side } from \"../order-utils/model/side.js\";\n\nexport { Side };\n\nexport interface ApiKeyCreds {\n\tkey: string;\n\tsecret: string;\n\tpassphrase: string;\n}\n\nexport interface BuilderConfig {\n\tbuilderCode: string;\n}\n\nexport interface ApiKeyRaw {\n\tapiKey: string;\n\tsecret: string;\n\tpassphrase: string;\n}\n\nexport interface L2HeaderArgs {\n\tmethod: string;\n\trequestPath: string;\n\tbody?: string;\n}\n\nexport type SimpleHeaders = Record<string, string | number | boolean>;\n\n// EIP712 sig verification\nexport interface L1PolyHeader extends SimpleHeaders {\n\tPOLY_ADDRESS: string;\n\tPOLY_SIGNATURE: string;\n\tPOLY_TIMESTAMP: string;\n\tPOLY_NONCE: string;\n}\n\n// API key verification\nexport interface L2PolyHeader extends SimpleHeaders {\n\tPOLY_ADDRESS: string;\n\tPOLY_SIGNATURE: string;\n\tPOLY_TIMESTAMP: string;\n\tPOLY_API_KEY: string;\n\tPOLY_PASSPHRASE: string;\n}\n\nexport enum OrderType {\n\tGTC = \"GTC\",\n\tFOK = \"FOK\",\n\tGTD = \"GTD\",\n\tFAK = \"FAK\",\n}\n\nexport interface OrderPayload {\n\torderID: string;\n}\n\nexport interface OrderResponse {\n\tsuccess: boolean;\n\terrorMsg: string;\n\torderID: string;\n\ttransactionsHashes?: string[];\n\ttradeIDs?: string[];\n\tstatus: string;\n\ttakingAmount: string;\n\tmakingAmount: string;\n}\n\nexport interface OpenOrder {\n\tid: string;\n\tstatus: string;\n\towner: string;\n\tmaker_address: string;\n\tmarket: string;\n\tasset_id: string;\n\tside: string;\n\toriginal_size: string;\n\tsize_matched: string;\n\tprice: string;\n\tassociate_trades: string[];\n\toutcome: string;\n\tcreated_at: number;\n\texpiration: string;\n\torder_type: string;\n}\n\nexport type OpenOrdersResponse = OpenOrder[];\n\nexport type PreMigrationOrder = OpenOrder;\n\nexport type PreMigrationOrdersResponse = PreMigrationOrder[];\n\nexport interface MakerOrder {\n\torder_id: string;\n\towner: string;\n\tmaker_address: string;\n\tmatched_amount: string;\n\tprice: string;\n\tfee_rate_bps: string;\n\tasset_id: string;\n\toutcome: string;\n\tside?: Side;\n\tbuilder_fee?: string;\n\tbuilder_code?: string;\n}\n\nexport interface Trade {\n\tid: string;\n\ttaker_order_id: string;\n\tmarket: string;\n\tasset_id: string;\n\tside: Side;\n\tsize: string;\n\tfee_rate_bps: string;\n\tprice: string;\n\tstatus: string;\n\tmatch_time: string;\n\tmatch_time_nano?: string;\n\tlast_update: string;\n\toutcome: string;\n\tbucket_index: number;\n\towner: string;\n\tmaker_address: string;\n\tmaker_orders: MakerOrder[];\n\ttransaction_hash?: string;\n\terr_msg?: string | null;\n\ttrader_side: \"TAKER\" | \"MAKER\";\n}\n\nexport interface ApiKeysResponse {\n\tapiKeys: ApiKeyCreds[];\n}\n\nexport interface BanStatus {\n\tclosed_only: boolean;\n}\n\nexport interface TradeParams {\n\tid?: string;\n\tmaker_address?: string;\n\tmarket?: string;\n\tasset_id?: string;\n\tbefore?: string;\n\tafter?: string;\n}\n\nexport interface BuilderTradeParams extends TradeParams {\n\tbuilder_code: string;\n}\n\nexport interface OpenOrderParams {\n\tid?: string;\n\tmarket?: string;\n\tasset_id?: string;\n}\n\nexport enum Chain {\n\tPOLYGON = 137,\n\tAMOY = 80002,\n}\n\nexport interface MarketPrice {\n\tt: number; // timestamp\n\tp: number; // price\n}\n\nexport interface PriceHistoryFilterParams {\n\tmarket?: string;\n\tstartTs?: number;\n\tendTs?: number;\n\tfidelity?: number;\n\tinterval?: PriceHistoryInterval;\n}\n\nexport enum PriceHistoryInterval {\n\tMAX = \"max\",\n\tONE_WEEK = \"1w\",\n\tONE_DAY = \"1d\",\n\tSIX_HOURS = \"6h\",\n\tONE_HOUR = \"1h\",\n}\n\nexport interface DropNotificationParams {\n\tids: string[];\n}\n\nexport interface Notification {\n\ttype: number;\n\towner: string;\n\n\tpayload: any;\n}\n\nexport interface OrderMarketCancelParams {\n\tmarket?: string;\n\tasset_id?: string;\n}\n\nexport interface OrderBookSummary {\n\tmarket: string;\n\tasset_id: string;\n\ttimestamp: string;\n\tbids: OrderSummary[];\n\tasks: OrderSummary[];\n\tmin_order_size: string;\n\ttick_size: string;\n\tneg_risk: boolean;\n\thash: string;\n\tlast_trade_price: string;\n}\n\nexport interface OrderSummary {\n\tprice: string;\n\tsize: string;\n}\n\nexport enum AssetType {\n\tCOLLATERAL = \"COLLATERAL\",\n\tCONDITIONAL = \"CONDITIONAL\",\n}\n\nexport interface BalanceAllowanceParams {\n\tasset_type: AssetType;\n\ttoken_id?: string;\n}\n\nexport interface BalanceAllowanceResponse {\n\tbalance: string;\n\tallowances: Record<string, string>;\n}\n\nexport interface OrderScoringParams {\n\torder_id: string;\n}\n\nexport interface OrderScoring {\n\tscoring: boolean;\n}\n\nexport interface OrdersScoringParams {\n\torderIds: string[];\n}\n\nexport type OrdersScoring = { [orderId in string]: boolean };\n\nexport type CreateOrderOptions = {\n\ttickSize: TickSize;\n\tnegRisk?: boolean;\n};\n\nexport type TickSize = \"0.1\" | \"0.01\" | \"0.001\" | \"0.0001\";\n\nexport interface RoundConfig {\n\treadonly price: number;\n\treadonly size: number;\n\treadonly amount: number;\n}\n\nexport interface TickSizes {\n\t[tokenId: string]: TickSize;\n}\n\nexport interface FeeRates {\n\t[tokenId: string]: number;\n}\n\nexport interface NegRisk {\n\t[tokenId: string]: boolean;\n}\n\nexport interface FeeInfo {\n\trate: number;\n\texponent: number;\n}\n\nexport interface FeeInfos {\n\t[tokenId: string]: FeeInfo;\n}\n\nexport interface BuilderFeeRates {\n\t[builderCode: string]: { maker: number; taker: number };\n}\n\nexport type TokenConditionMap = Record<string, string>;\n\nexport interface FeeDetails {\n\tr?: number; // fee rate\n\te?: number; // fee exponent\n\tto?: boolean; // taker only (omitted when false)\n}\n\nexport interface ClobRewards {\n\tmi?: number; // min size\n\tma?: number; // max spread\n\te?: boolean; // enabled\n\tsmoa?: boolean; // skip min order age\n\tmoas?: number; // min order age seconds\n}\n\nexport interface ClobToken {\n\tt: string; // token ID\n\to: string; // outcome\n}\n\nexport interface MarketDetails {\n\tc: string; // condition ID\n\tt: [ClobToken, ClobToken]; // YES and NO tokens\n\tmts: number; // min tick size\n\tnr?: boolean; // neg risk (omitted when false)\n\tfd?: FeeDetails; // platform fee details\n\tmbf?: number; // maker base fee\n\ttbf?: number; // taker base fee\n\tr: ClobRewards | null; // rewards config (always present, null if unset)\n\tao?: boolean; // accepting orders\n\tmos?: number; // min order size\n\tsd?: number; // seconds delay\n\tgst?: string; // game start time (ISO 8601)\n\tcbos?: boolean; // clear book on start\n\taot?: string; // accepting orders timestamp (ISO 8601)\n\trfqe?: boolean; // RFQ enabled\n\titode?: boolean; // taker order delay enabled\n\tibce?: boolean; // blockaid check enabled\n}\n\nexport interface PaginationPayload {\n\treadonly limit: number;\n\treadonly count: number;\n\treadonly next_cursor: string;\n\treadonly data: any[];\n}\n\nexport interface BookParams {\n\ttoken_id: string;\n\tside: Side;\n}\n\nexport interface UserEarning {\n\tdate: string;\n\tcondition_id: string;\n\tasset_address: string;\n\tmaker_address: string;\n\tearnings: number;\n\tasset_rate: number;\n}\n\nexport interface TotalUserEarning {\n\tdate: string;\n\tasset_address: string;\n\tmaker_address: string;\n\tearnings: number;\n\tasset_rate: number;\n}\n\nexport interface RewardsPercentages {\n\t[market: string]: number;\n}\n\nexport interface Token {\n\ttoken_id: string;\n\toutcome: string;\n\tprice: number;\n}\n\nexport interface RewardsConfig {\n\tasset_address: string;\n\tstart_date: string;\n\tend_date: string;\n\trate_per_day: number;\n\ttotal_rewards: number;\n}\n\nexport interface MarketReward {\n\tcondition_id: string;\n\tquestion: string;\n\tmarket_slug: string;\n\tevent_slug: string;\n\timage: string;\n\trewards_max_spread: number;\n\trewards_min_size: number;\n\ttokens: Token[];\n\trewards_config: RewardsConfig[];\n}\n\nexport interface Earning {\n\tasset_address: string;\n\tearnings: number;\n\tasset_rate: number;\n}\n\nexport interface UserRewardsEarning {\n\tcondition_id: string;\n\tquestion: string;\n\tmarket_slug: string;\n\tevent_slug: string;\n\timage: string;\n\trewards_max_spread: number;\n\trewards_min_size: number;\n\tmarket_competitiveness: number;\n\ttokens: Token[];\n\trewards_config: RewardsConfig[];\n\tmaker_address: string;\n\tearning_percentage: number;\n\tearnings: Earning[];\n}\n\nexport interface BuilderTrade {\n\tid: string;\n\ttradeType: string;\n\ttakerOrderHash: string;\n\tbuilder: string;\n\tmarket: string;\n\tassetId: string;\n\tside: string;\n\tsize: string;\n\tsizeUsdc: string;\n\tprice: string;\n\tstatus: string;\n\toutcome: string;\n\toutcomeIndex: number;\n\towner: string;\n\tmaker: string;\n\ttransactionHash: string;\n\tmatchTime: string;\n\tbucketIndex: number;\n\tfee: string;\n\tfeeUsdc: string;\n\tbuilderFee: string;\n\tbuilderCode: string;\n\terr_msg?: string | null;\n\tcreatedAt: string | null;\n\tupdatedAt: string | null;\n}\n\nexport interface ReadonlyApiKeyResponse {\n\tapiKey: string;\n}\n\nexport interface MarketTradeEvent {\n\tevent_type: string;\n\tmarket: {\n\t\tcondition_id: string;\n\t\tasset_id: string;\n\t\tquestion: string;\n\t\ticon: string;\n\t\tslug: string;\n\t};\n\tuser: {\n\t\taddress: string;\n\t\tusername: string;\n\t\tprofile_picture: string;\n\t\toptimized_profile_picture: string;\n\t\tpseudonym: string;\n\t};\n\tside: Side;\n\tsize: string;\n\tfee_rate_bps: string;\n\tprice: string;\n\toutcome: string;\n\toutcome_index: number;\n\ttransaction_hash: string;\n\ttimestamp: string;\n}\n\nexport interface BuilderApiKey {\n\tkey: string;\n\tsecret: string;\n\tpassphrase: string;\n}\n\nexport interface BuilderApiKeyResponse {\n\tkey: string;\n\tcreatedAt?: string;\n\trevokedAt?: string;\n}\n\nexport type ClobErrorResponseBody = {\n\terror: string;\n};\n\nexport interface TradesPaginatedResponse {\n\ttrades: Trade[];\n\tnext_cursor: string;\n\tlimit: number;\n\tcount: number;\n}\n\nexport interface BuilderTradesResponse {\n\ttrades: BuilderTrade[];\n\tnext_cursor: string;\n\tlimit: number;\n\tcount: number;\n}\n"],"mappings":";;;AA6CA,IAAY,kDAAL;AACN;AACA;AACA;AACA;;;AA0GD,IAAY,0CAAL;AACN;AACA;;;AAgBD,IAAY,wEAAL;AACN;AACA;AACA;AACA;AACA;;;AAqCD,IAAY,kDAAL;AACN;AACA"}