@polymarket/clob-client-v2 1.0.8 → 1.2.0-canary.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -0
- package/dist/client.cjs +61 -16
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +15 -5
- package/dist/client.d.ts +15 -5
- package/dist/client.js +61 -16
- package/dist/client.js.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/order-builder/helpers/buildMarketOrderCreationArgs.cjs +3 -2
- package/dist/order-builder/helpers/buildMarketOrderCreationArgs.cjs.map +1 -1
- package/dist/order-builder/helpers/buildMarketOrderCreationArgs.js +3 -2
- package/dist/order-builder/helpers/buildMarketOrderCreationArgs.js.map +1 -1
- package/dist/order-builder/helpers/buildOrderCreationArgs.cjs +3 -2
- package/dist/order-builder/helpers/buildOrderCreationArgs.cjs.map +1 -1
- package/dist/order-builder/helpers/buildOrderCreationArgs.js +3 -2
- package/dist/order-builder/helpers/buildOrderCreationArgs.js.map +1 -1
- package/dist/order-builder/helpers/createMarketOrder.cjs +6 -4
- package/dist/order-builder/helpers/createMarketOrder.cjs.map +1 -1
- package/dist/order-builder/helpers/createMarketOrder.js +6 -4
- package/dist/order-builder/helpers/createMarketOrder.js.map +1 -1
- package/dist/order-builder/helpers/createOrder.cjs +6 -4
- package/dist/order-builder/helpers/createOrder.cjs.map +1 -1
- package/dist/order-builder/helpers/createOrder.js +6 -4
- package/dist/order-builder/helpers/createOrder.js.map +1 -1
- package/dist/order-builder/helpers/orderAsset.cjs +16 -0
- package/dist/order-builder/helpers/orderAsset.cjs.map +1 -0
- package/dist/order-builder/helpers/orderAsset.js +14 -0
- package/dist/order-builder/helpers/orderAsset.js.map +1 -0
- package/dist/order-builder/orderBuilder.cjs +2 -2
- package/dist/order-builder/orderBuilder.cjs.map +1 -1
- package/dist/order-builder/orderBuilder.d.cts +2 -2
- package/dist/order-builder/orderBuilder.d.ts +2 -2
- package/dist/order-builder/orderBuilder.js +2 -2
- package/dist/order-builder/orderBuilder.js.map +1 -1
- package/dist/types/clob.cjs.map +1 -1
- package/dist/types/clob.d.cts +5 -0
- package/dist/types/clob.d.ts +5 -0
- package/dist/types/clob.js.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/ordersV1.cjs.map +1 -1
- package/dist/types/ordersV1.d.cts +2 -0
- package/dist/types/ordersV1.d.ts +2 -0
- package/dist/types/ordersV1.js.map +1 -1
- package/dist/types/ordersV2.cjs.map +1 -1
- package/dist/types/ordersV2.d.cts +17 -13
- package/dist/types/ordersV2.d.ts +17 -13
- package/dist/types/ordersV2.js.map +1 -1
- package/package.json +1 -1
package/dist/types/clob.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clob.js","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 OrderVersion = 1 | 2 | 3;\n\nexport type CreateOrderOptions = {\n\ttickSize: TickSize;\n\tnegRisk?: boolean;\n\tversion?: OrderVersion;\n};\n\nexport type TickSize = \"0.1\" | \"0.01\" | \"0.005\" | \"0.0025\" | \"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"}
|
|
1
|
+
{"version":3,"file":"clob.js","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\t/**\n\t * Settlement transaction hashes for the order's trades, returned on a\n\t * best-effort basis when the order matched.\n\t */\n\ttransactionsHashes?: string[];\n\t/** IDs of the trades created when the order matched. */\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 OrderVersion = 1 | 2 | 3;\n\nexport type CreateOrderOptions = {\n\ttickSize: TickSize;\n\tnegRisk?: boolean;\n\tversion?: OrderVersion;\n};\n\nexport type TickSize = \"0.1\" | \"0.01\" | \"0.005\" | \"0.0025\" | \"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;;;AA+GD,IAAY,0CAAL;AACN;AACA;;;AAgBD,IAAY,wEAAL;AACN;AACA;AACA;AACA;AACA;;;AAqCD,IAAY,kDAAL;AACN;AACA"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Side } from "../order-utils/model/side.js";
|
|
2
2
|
import { ApiKeyCreds, ApiKeyRaw, ApiKeysResponse, AssetType, BalanceAllowanceParams, BalanceAllowanceResponse, BanStatus, BookParams, BuilderApiKey, BuilderApiKeyResponse, BuilderConfig, BuilderFeeRates, BuilderTrade, BuilderTradeParams, BuilderTradesResponse, Chain, ClobErrorResponseBody, ClobRewards, ClobToken, CreateOrderOptions, DropNotificationParams, Earning, FeeDetails, FeeInfo, FeeInfos, FeeRates, L1PolyHeader, L2HeaderArgs, L2PolyHeader, MakerOrder, MarketDetails, MarketPrice, MarketReward, MarketTradeEvent, NegRisk, Notification, OpenOrder, OpenOrderParams, OpenOrdersResponse, OrderBookSummary, OrderMarketCancelParams, OrderPayload, OrderResponse, OrderScoring, OrderScoringParams, OrderSummary, OrderType, OrderVersion, OrdersScoring, OrdersScoringParams, PaginationPayload, PreMigrationOrder, PreMigrationOrdersResponse, PriceHistoryFilterParams, PriceHistoryInterval, ReadonlyApiKeyResponse, RewardsConfig, RewardsPercentages, RoundConfig, SimpleHeaders, TickSize, TickSizes, Token, TokenConditionMap, TotalUserEarning, Trade, TradeParams, TradesPaginatedResponse, UserEarning, UserRewardsEarning } from "./clob.js";
|
|
3
3
|
import { NewOrderV1, PostOrdersV1Args, UserMarketOrderV1, UserOrderV1, orderToJsonV1 } from "./ordersV1.js";
|
|
4
|
-
import { NewOrderV2, PostOrdersV2Args, UserMarketOrderV2, UserOrderV2, orderToJsonV2 } from "./ordersV2.js";
|
|
4
|
+
import { NewOrderV2, OrderAsset, PostOrdersV2Args, UserMarketOrderV2, UserOrderV2, orderToJsonV2 } from "./ordersV2.js";
|
|
5
5
|
import { ExchangeV3OrderAmounts } from "./ordersV3.js";
|
|
6
6
|
import { PostOrdersArgs, SignedOrder, VersionedPostOrdersArgs, VersionedSignedOrder, VersionedUserMarketOrder, VersionedUserOrder, isV2Order } from "./unifiedOrder.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ordersV1.cjs","names":[],"sources":["../../src/types/ordersV1.ts"],"sourcesContent":["import type { SignatureTypeV1, SignedOrderV1 } from \"../order-utils/index.js\";\n\nimport type { OrderType, Side } from \"./clob.js\";\n\nexport function orderToJsonV1<T extends OrderType>(\n\torder: SignedOrderV1,\n\towner: string,\n\torderType: T,\n\tpostOnly = false,\n\tdeferExec = false,\n): NewOrderV1<T> {\n\treturn {\n\t\tdeferExec,\n\t\tpostOnly,\n\t\torder: {\n\t\t\tsalt: parseInt(order.salt, 10),\n\t\t\tmaker: order.maker,\n\t\t\tsigner: order.signer,\n\t\t\ttaker: order.taker,\n\t\t\ttokenId: order.tokenId,\n\t\t\tmakerAmount: order.makerAmount,\n\t\t\ttakerAmount: order.takerAmount,\n\t\t\tside: order.side,\n\t\t\texpiration: order.expiration,\n\t\t\tnonce: order.nonce,\n\t\t\tfeeRateBps: order.feeRateBps,\n\t\t\tsignatureType: order.signatureType,\n\t\t\tsignature: order.signature,\n\t\t},\n\t\towner,\n\t\torderType,\n\t} as NewOrderV1<T>;\n}\n\nexport interface PostOrdersV1Args {\n\torder: SignedOrderV1;\n\torderType: OrderType;\n}\n\nexport interface NewOrderV1<T extends OrderType> {\n\treadonly order: {\n\t\treadonly salt: number;\n\t\treadonly maker: string;\n\t\treadonly signer: string;\n\t\treadonly taker: string;\n\t\treadonly tokenId: string;\n\t\treadonly makerAmount: string;\n\t\treadonly takerAmount: string;\n\t\treadonly expiration: string;\n\t\treadonly nonce: string;\n\t\treadonly feeRateBps: string;\n\t\treadonly side: string;\n\t\treadonly signatureType: SignatureTypeV1;\n\t\treadonly signature: string;\n\t};\n\treadonly owner: string;\n\treadonly orderType: T;\n\treadonly deferExec: boolean;\n\treadonly postOnly: boolean;\n}\n\n// Simplified order for users\nexport interface UserOrderV1 {\n\t/**\n\t * TokenID of the Conditional token asset being traded\n\t */\n\ttokenID: string;\n\n\t/**\n\t * Price used to create the order\n\t */\n\tprice: number;\n\n\t/**\n\t * Size in terms of the ConditionalToken\n\t */\n\tsize: number;\n\n\t/**\n\t * Side of the order\n\t */\n\tside: Side;\n\n\t/**\n\t * Fee rate, in basis points, charged to the order maker, charged on proceeds\n\t */\n\tfeeRateBps?: number;\n\n\t/**\n\t * Nonce used for onchain cancellations\n\t */\n\tnonce?: number;\n\n\t/**\n\t * Timestamp after which the order is expired.\n\t */\n\texpiration?: number;\n\n\t/**\n\t * Address of the order taker. The zero address is used to indicate a public order\n\t */\n\ttaker?: string;\n\n\t/**\n\t * Builder code (bytes32)\n\t */\n\tbuilderCode?: string;\n}\n\n// Simplified market order for users\nexport interface UserMarketOrderV1 {\n\t/**\n\t * TokenID of the Conditional token asset being traded\n\t */\n\ttokenID: string;\n\n\t/**\n\t * Price used to create the order\n\t * If it is not present the market price will be used.\n\t */\n\tprice?: number;\n\n\t/**\n\t * BUY orders: $$$ Amount to buy\n\t * SELL orders: Shares to sell\n\t */\n\tamount: number;\n\n\t/**\n\t * Side of the order\n\t */\n\tside: Side;\n\n\t/**\n\t * Fee rate, in basis points, charged to the order maker, charged on proceeds\n\t */\n\tfeeRateBps?: number;\n\n\t/**\n\t * Nonce used for onchain cancellations\n\t */\n\tnonce?: number;\n\n\t/**\n\t * Address of the order taker. The zero address is used to indicate a public order\n\t */\n\ttaker?: string;\n\n\t/**\n\t * Specifies the type of order execution:\n\t * - FOK (Fill or Kill): The order must be filled entirely or not at all.\n\t * - FAK (Fill and Kill): The order can be partially filled, and any unfilled portion is canceled.\n\t */\n\torderType?: OrderType.FOK | OrderType.FAK;\n\n\t/**\n\t * Builder code (bytes32)\n\t */\n\tbuilderCode?: string;\n}\n"],"mappings":";;AAIA,SAAgB,cACf,OACA,OACA,WACA,WAAW,OACX,YAAY,OACI;AAChB,QAAO;EACN;EACA;EACA,OAAO;GACN,MAAM,SAAS,MAAM,MAAM,GAAG;GAC9B,OAAO,MAAM;GACb,QAAQ,MAAM;GACd,OAAO,MAAM;GACb,SAAS,MAAM;GACf,aAAa,MAAM;GACnB,aAAa,MAAM;GACnB,MAAM,MAAM;GACZ,YAAY,MAAM;GAClB,OAAO,MAAM;GACb,YAAY,MAAM;GAClB,eAAe,MAAM;GACrB,WAAW,MAAM;GACjB;EACD;EACA;EACA"}
|
|
1
|
+
{"version":3,"file":"ordersV1.cjs","names":[],"sources":["../../src/types/ordersV1.ts"],"sourcesContent":["import type { SignatureTypeV1, SignedOrderV1 } from \"../order-utils/index.js\";\n\nimport type { OrderType, Side } from \"./clob.js\";\n\nexport function orderToJsonV1<T extends OrderType>(\n\torder: SignedOrderV1,\n\towner: string,\n\torderType: T,\n\tpostOnly = false,\n\tdeferExec = false,\n): NewOrderV1<T> {\n\treturn {\n\t\tdeferExec,\n\t\tpostOnly,\n\t\torder: {\n\t\t\tsalt: parseInt(order.salt, 10),\n\t\t\tmaker: order.maker,\n\t\t\tsigner: order.signer,\n\t\t\ttaker: order.taker,\n\t\t\ttokenId: order.tokenId,\n\t\t\tmakerAmount: order.makerAmount,\n\t\t\ttakerAmount: order.takerAmount,\n\t\t\tside: order.side,\n\t\t\texpiration: order.expiration,\n\t\t\tnonce: order.nonce,\n\t\t\tfeeRateBps: order.feeRateBps,\n\t\t\tsignatureType: order.signatureType,\n\t\t\tsignature: order.signature,\n\t\t},\n\t\towner,\n\t\torderType,\n\t} as NewOrderV1<T>;\n}\n\nexport interface PostOrdersV1Args {\n\torder: SignedOrderV1;\n\torderType: OrderType;\n}\n\nexport interface NewOrderV1<T extends OrderType> {\n\treadonly order: {\n\t\treadonly salt: number;\n\t\treadonly maker: string;\n\t\treadonly signer: string;\n\t\treadonly taker: string;\n\t\treadonly tokenId: string;\n\t\treadonly makerAmount: string;\n\t\treadonly takerAmount: string;\n\t\treadonly expiration: string;\n\t\treadonly nonce: string;\n\t\treadonly feeRateBps: string;\n\t\treadonly side: string;\n\t\treadonly signatureType: SignatureTypeV1;\n\t\treadonly signature: string;\n\t};\n\treadonly owner: string;\n\treadonly orderType: T;\n\treadonly deferExec: boolean;\n\treadonly postOnly: boolean;\n}\n\n// Simplified order for users\nexport interface UserOrderV1 {\n\t/**\n\t * TokenID of the Conditional token asset being traded\n\t */\n\ttokenID: string;\n\tpositionID?: never;\n\n\t/**\n\t * Price used to create the order\n\t */\n\tprice: number;\n\n\t/**\n\t * Size in terms of the ConditionalToken\n\t */\n\tsize: number;\n\n\t/**\n\t * Side of the order\n\t */\n\tside: Side;\n\n\t/**\n\t * Fee rate, in basis points, charged to the order maker, charged on proceeds\n\t */\n\tfeeRateBps?: number;\n\n\t/**\n\t * Nonce used for onchain cancellations\n\t */\n\tnonce?: number;\n\n\t/**\n\t * Timestamp after which the order is expired.\n\t */\n\texpiration?: number;\n\n\t/**\n\t * Address of the order taker. The zero address is used to indicate a public order\n\t */\n\ttaker?: string;\n\n\t/**\n\t * Builder code (bytes32)\n\t */\n\tbuilderCode?: string;\n}\n\n// Simplified market order for users\nexport interface UserMarketOrderV1 {\n\t/**\n\t * TokenID of the Conditional token asset being traded\n\t */\n\ttokenID: string;\n\tpositionID?: never;\n\n\t/**\n\t * Price used to create the order\n\t * If it is not present the market price will be used.\n\t */\n\tprice?: number;\n\n\t/**\n\t * BUY orders: $$$ Amount to buy\n\t * SELL orders: Shares to sell\n\t */\n\tamount: number;\n\n\t/**\n\t * Side of the order\n\t */\n\tside: Side;\n\n\t/**\n\t * Fee rate, in basis points, charged to the order maker, charged on proceeds\n\t */\n\tfeeRateBps?: number;\n\n\t/**\n\t * Nonce used for onchain cancellations\n\t */\n\tnonce?: number;\n\n\t/**\n\t * Address of the order taker. The zero address is used to indicate a public order\n\t */\n\ttaker?: string;\n\n\t/**\n\t * Specifies the type of order execution:\n\t * - FOK (Fill or Kill): The order must be filled entirely or not at all.\n\t * - FAK (Fill and Kill): The order can be partially filled, and any unfilled portion is canceled.\n\t */\n\torderType?: OrderType.FOK | OrderType.FAK;\n\n\t/**\n\t * Builder code (bytes32)\n\t */\n\tbuilderCode?: string;\n}\n"],"mappings":";;AAIA,SAAgB,cACf,OACA,OACA,WACA,WAAW,OACX,YAAY,OACI;AAChB,QAAO;EACN;EACA;EACA,OAAO;GACN,MAAM,SAAS,MAAM,MAAM,GAAG;GAC9B,OAAO,MAAM;GACb,QAAQ,MAAM;GACd,OAAO,MAAM;GACb,SAAS,MAAM;GACf,aAAa,MAAM;GACnB,aAAa,MAAM;GACnB,MAAM,MAAM;GACZ,YAAY,MAAM;GAClB,OAAO,MAAM;GACb,YAAY,MAAM;GAClB,eAAe,MAAM;GACrB,WAAW,MAAM;GACjB;EACD;EACA;EACA"}
|
|
@@ -35,6 +35,7 @@ interface UserOrderV1 {
|
|
|
35
35
|
* TokenID of the Conditional token asset being traded
|
|
36
36
|
*/
|
|
37
37
|
tokenID: string;
|
|
38
|
+
positionID?: never;
|
|
38
39
|
/**
|
|
39
40
|
* Price used to create the order
|
|
40
41
|
*/
|
|
@@ -73,6 +74,7 @@ interface UserMarketOrderV1 {
|
|
|
73
74
|
* TokenID of the Conditional token asset being traded
|
|
74
75
|
*/
|
|
75
76
|
tokenID: string;
|
|
77
|
+
positionID?: never;
|
|
76
78
|
/**
|
|
77
79
|
* Price used to create the order
|
|
78
80
|
* If it is not present the market price will be used.
|
package/dist/types/ordersV1.d.ts
CHANGED
|
@@ -36,6 +36,7 @@ interface UserOrderV1 {
|
|
|
36
36
|
* TokenID of the Conditional token asset being traded
|
|
37
37
|
*/
|
|
38
38
|
tokenID: string;
|
|
39
|
+
positionID?: never;
|
|
39
40
|
/**
|
|
40
41
|
* Price used to create the order
|
|
41
42
|
*/
|
|
@@ -74,6 +75,7 @@ interface UserMarketOrderV1 {
|
|
|
74
75
|
* TokenID of the Conditional token asset being traded
|
|
75
76
|
*/
|
|
76
77
|
tokenID: string;
|
|
78
|
+
positionID?: never;
|
|
77
79
|
/**
|
|
78
80
|
* Price used to create the order
|
|
79
81
|
* If it is not present the market price will be used.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ordersV1.js","names":[],"sources":["../../src/types/ordersV1.ts"],"sourcesContent":["import type { SignatureTypeV1, SignedOrderV1 } from \"../order-utils/index.js\";\n\nimport type { OrderType, Side } from \"./clob.js\";\n\nexport function orderToJsonV1<T extends OrderType>(\n\torder: SignedOrderV1,\n\towner: string,\n\torderType: T,\n\tpostOnly = false,\n\tdeferExec = false,\n): NewOrderV1<T> {\n\treturn {\n\t\tdeferExec,\n\t\tpostOnly,\n\t\torder: {\n\t\t\tsalt: parseInt(order.salt, 10),\n\t\t\tmaker: order.maker,\n\t\t\tsigner: order.signer,\n\t\t\ttaker: order.taker,\n\t\t\ttokenId: order.tokenId,\n\t\t\tmakerAmount: order.makerAmount,\n\t\t\ttakerAmount: order.takerAmount,\n\t\t\tside: order.side,\n\t\t\texpiration: order.expiration,\n\t\t\tnonce: order.nonce,\n\t\t\tfeeRateBps: order.feeRateBps,\n\t\t\tsignatureType: order.signatureType,\n\t\t\tsignature: order.signature,\n\t\t},\n\t\towner,\n\t\torderType,\n\t} as NewOrderV1<T>;\n}\n\nexport interface PostOrdersV1Args {\n\torder: SignedOrderV1;\n\torderType: OrderType;\n}\n\nexport interface NewOrderV1<T extends OrderType> {\n\treadonly order: {\n\t\treadonly salt: number;\n\t\treadonly maker: string;\n\t\treadonly signer: string;\n\t\treadonly taker: string;\n\t\treadonly tokenId: string;\n\t\treadonly makerAmount: string;\n\t\treadonly takerAmount: string;\n\t\treadonly expiration: string;\n\t\treadonly nonce: string;\n\t\treadonly feeRateBps: string;\n\t\treadonly side: string;\n\t\treadonly signatureType: SignatureTypeV1;\n\t\treadonly signature: string;\n\t};\n\treadonly owner: string;\n\treadonly orderType: T;\n\treadonly deferExec: boolean;\n\treadonly postOnly: boolean;\n}\n\n// Simplified order for users\nexport interface UserOrderV1 {\n\t/**\n\t * TokenID of the Conditional token asset being traded\n\t */\n\ttokenID: string;\n\n\t/**\n\t * Price used to create the order\n\t */\n\tprice: number;\n\n\t/**\n\t * Size in terms of the ConditionalToken\n\t */\n\tsize: number;\n\n\t/**\n\t * Side of the order\n\t */\n\tside: Side;\n\n\t/**\n\t * Fee rate, in basis points, charged to the order maker, charged on proceeds\n\t */\n\tfeeRateBps?: number;\n\n\t/**\n\t * Nonce used for onchain cancellations\n\t */\n\tnonce?: number;\n\n\t/**\n\t * Timestamp after which the order is expired.\n\t */\n\texpiration?: number;\n\n\t/**\n\t * Address of the order taker. The zero address is used to indicate a public order\n\t */\n\ttaker?: string;\n\n\t/**\n\t * Builder code (bytes32)\n\t */\n\tbuilderCode?: string;\n}\n\n// Simplified market order for users\nexport interface UserMarketOrderV1 {\n\t/**\n\t * TokenID of the Conditional token asset being traded\n\t */\n\ttokenID: string;\n\n\t/**\n\t * Price used to create the order\n\t * If it is not present the market price will be used.\n\t */\n\tprice?: number;\n\n\t/**\n\t * BUY orders: $$$ Amount to buy\n\t * SELL orders: Shares to sell\n\t */\n\tamount: number;\n\n\t/**\n\t * Side of the order\n\t */\n\tside: Side;\n\n\t/**\n\t * Fee rate, in basis points, charged to the order maker, charged on proceeds\n\t */\n\tfeeRateBps?: number;\n\n\t/**\n\t * Nonce used for onchain cancellations\n\t */\n\tnonce?: number;\n\n\t/**\n\t * Address of the order taker. The zero address is used to indicate a public order\n\t */\n\ttaker?: string;\n\n\t/**\n\t * Specifies the type of order execution:\n\t * - FOK (Fill or Kill): The order must be filled entirely or not at all.\n\t * - FAK (Fill and Kill): The order can be partially filled, and any unfilled portion is canceled.\n\t */\n\torderType?: OrderType.FOK | OrderType.FAK;\n\n\t/**\n\t * Builder code (bytes32)\n\t */\n\tbuilderCode?: string;\n}\n"],"mappings":";AAIA,SAAgB,cACf,OACA,OACA,WACA,WAAW,OACX,YAAY,OACI;AAChB,QAAO;EACN;EACA;EACA,OAAO;GACN,MAAM,SAAS,MAAM,MAAM,GAAG;GAC9B,OAAO,MAAM;GACb,QAAQ,MAAM;GACd,OAAO,MAAM;GACb,SAAS,MAAM;GACf,aAAa,MAAM;GACnB,aAAa,MAAM;GACnB,MAAM,MAAM;GACZ,YAAY,MAAM;GAClB,OAAO,MAAM;GACb,YAAY,MAAM;GAClB,eAAe,MAAM;GACrB,WAAW,MAAM;GACjB;EACD;EACA;EACA"}
|
|
1
|
+
{"version":3,"file":"ordersV1.js","names":[],"sources":["../../src/types/ordersV1.ts"],"sourcesContent":["import type { SignatureTypeV1, SignedOrderV1 } from \"../order-utils/index.js\";\n\nimport type { OrderType, Side } from \"./clob.js\";\n\nexport function orderToJsonV1<T extends OrderType>(\n\torder: SignedOrderV1,\n\towner: string,\n\torderType: T,\n\tpostOnly = false,\n\tdeferExec = false,\n): NewOrderV1<T> {\n\treturn {\n\t\tdeferExec,\n\t\tpostOnly,\n\t\torder: {\n\t\t\tsalt: parseInt(order.salt, 10),\n\t\t\tmaker: order.maker,\n\t\t\tsigner: order.signer,\n\t\t\ttaker: order.taker,\n\t\t\ttokenId: order.tokenId,\n\t\t\tmakerAmount: order.makerAmount,\n\t\t\ttakerAmount: order.takerAmount,\n\t\t\tside: order.side,\n\t\t\texpiration: order.expiration,\n\t\t\tnonce: order.nonce,\n\t\t\tfeeRateBps: order.feeRateBps,\n\t\t\tsignatureType: order.signatureType,\n\t\t\tsignature: order.signature,\n\t\t},\n\t\towner,\n\t\torderType,\n\t} as NewOrderV1<T>;\n}\n\nexport interface PostOrdersV1Args {\n\torder: SignedOrderV1;\n\torderType: OrderType;\n}\n\nexport interface NewOrderV1<T extends OrderType> {\n\treadonly order: {\n\t\treadonly salt: number;\n\t\treadonly maker: string;\n\t\treadonly signer: string;\n\t\treadonly taker: string;\n\t\treadonly tokenId: string;\n\t\treadonly makerAmount: string;\n\t\treadonly takerAmount: string;\n\t\treadonly expiration: string;\n\t\treadonly nonce: string;\n\t\treadonly feeRateBps: string;\n\t\treadonly side: string;\n\t\treadonly signatureType: SignatureTypeV1;\n\t\treadonly signature: string;\n\t};\n\treadonly owner: string;\n\treadonly orderType: T;\n\treadonly deferExec: boolean;\n\treadonly postOnly: boolean;\n}\n\n// Simplified order for users\nexport interface UserOrderV1 {\n\t/**\n\t * TokenID of the Conditional token asset being traded\n\t */\n\ttokenID: string;\n\tpositionID?: never;\n\n\t/**\n\t * Price used to create the order\n\t */\n\tprice: number;\n\n\t/**\n\t * Size in terms of the ConditionalToken\n\t */\n\tsize: number;\n\n\t/**\n\t * Side of the order\n\t */\n\tside: Side;\n\n\t/**\n\t * Fee rate, in basis points, charged to the order maker, charged on proceeds\n\t */\n\tfeeRateBps?: number;\n\n\t/**\n\t * Nonce used for onchain cancellations\n\t */\n\tnonce?: number;\n\n\t/**\n\t * Timestamp after which the order is expired.\n\t */\n\texpiration?: number;\n\n\t/**\n\t * Address of the order taker. The zero address is used to indicate a public order\n\t */\n\ttaker?: string;\n\n\t/**\n\t * Builder code (bytes32)\n\t */\n\tbuilderCode?: string;\n}\n\n// Simplified market order for users\nexport interface UserMarketOrderV1 {\n\t/**\n\t * TokenID of the Conditional token asset being traded\n\t */\n\ttokenID: string;\n\tpositionID?: never;\n\n\t/**\n\t * Price used to create the order\n\t * If it is not present the market price will be used.\n\t */\n\tprice?: number;\n\n\t/**\n\t * BUY orders: $$$ Amount to buy\n\t * SELL orders: Shares to sell\n\t */\n\tamount: number;\n\n\t/**\n\t * Side of the order\n\t */\n\tside: Side;\n\n\t/**\n\t * Fee rate, in basis points, charged to the order maker, charged on proceeds\n\t */\n\tfeeRateBps?: number;\n\n\t/**\n\t * Nonce used for onchain cancellations\n\t */\n\tnonce?: number;\n\n\t/**\n\t * Address of the order taker. The zero address is used to indicate a public order\n\t */\n\ttaker?: string;\n\n\t/**\n\t * Specifies the type of order execution:\n\t * - FOK (Fill or Kill): The order must be filled entirely or not at all.\n\t * - FAK (Fill and Kill): The order can be partially filled, and any unfilled portion is canceled.\n\t */\n\torderType?: OrderType.FOK | OrderType.FAK;\n\n\t/**\n\t * Builder code (bytes32)\n\t */\n\tbuilderCode?: string;\n}\n"],"mappings":";AAIA,SAAgB,cACf,OACA,OACA,WACA,WAAW,OACX,YAAY,OACI;AAChB,QAAO;EACN;EACA;EACA,OAAO;GACN,MAAM,SAAS,MAAM,MAAM,GAAG;GAC9B,OAAO,MAAM;GACb,QAAQ,MAAM;GACd,OAAO,MAAM;GACb,SAAS,MAAM;GACf,aAAa,MAAM;GACnB,aAAa,MAAM;GACnB,MAAM,MAAM;GACZ,YAAY,MAAM;GAClB,OAAO,MAAM;GACb,YAAY,MAAM;GAClB,eAAe,MAAM;GACrB,WAAW,MAAM;GACjB;EACD;EACA;EACA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ordersV2.cjs","names":[],"sources":["../../src/types/ordersV2.ts"],"sourcesContent":["import type { SignatureTypeV2, SignedOrderV2 } from \"../order-utils/index.js\";\n\nimport type { OrderType, Side } from \"./clob.js\";\n\nexport function orderToJsonV2<T extends OrderType>(\n\torder: SignedOrderV2,\n\towner: string,\n\torderType: T,\n\tpostOnly = false,\n\tdeferExec = false,\n): NewOrderV2<T> {\n\treturn {\n\t\tdeferExec,\n\t\tpostOnly,\n\t\torder: {\n\t\t\tsalt: parseInt(order.salt, 10),\n\t\t\tmaker: order.maker,\n\t\t\tsigner: order.signer,\n\t\t\ttaker: order.taker,\n\t\t\ttokenId: order.tokenId,\n\t\t\tmakerAmount: order.makerAmount,\n\t\t\ttakerAmount: order.takerAmount,\n\t\t\tside: order.side,\n\t\t\tsignatureType: order.signatureType,\n\t\t\ttimestamp: order.timestamp,\n\t\t\texpiration: order.expiration,\n\t\t\tmetadata: order.metadata,\n\t\t\tbuilder: order.builder,\n\t\t\tsignature: order.signature,\n\t\t},\n\t\towner,\n\t\torderType,\n\t} as NewOrderV2<T>;\n}\n\nexport interface PostOrdersV2Args {\n\torder: SignedOrderV2;\n\torderType: OrderType;\n}\n\nexport interface NewOrderV2<T extends OrderType> {\n\treadonly order: {\n\t\treadonly salt: number;\n\t\treadonly maker: string;\n\t\treadonly signer: string;\n\t\treadonly taker: string;\n\t\treadonly tokenId: string;\n\t\treadonly makerAmount: string;\n\t\treadonly takerAmount: string;\n\t\treadonly side: string;\n\t\treadonly signatureType: SignatureTypeV2;\n\t\treadonly timestamp: string;\n\t\treadonly expiration: string;\n\t\treadonly metadata: string;\n\t\treadonly builder: string;\n\t\treadonly signature: string;\n\t};\n\treadonly owner: string;\n\treadonly orderType: T;\n\treadonly deferExec: boolean;\n\treadonly postOnly: boolean;\n}\n\n
|
|
1
|
+
{"version":3,"file":"ordersV2.cjs","names":[],"sources":["../../src/types/ordersV2.ts"],"sourcesContent":["import type { SignatureTypeV2, SignedOrderV2 } from \"../order-utils/index.js\";\n\nimport type { OrderType, Side } from \"./clob.js\";\n\nexport function orderToJsonV2<T extends OrderType>(\n\torder: SignedOrderV2,\n\towner: string,\n\torderType: T,\n\tpostOnly = false,\n\tdeferExec = false,\n): NewOrderV2<T> {\n\treturn {\n\t\tdeferExec,\n\t\tpostOnly,\n\t\torder: {\n\t\t\tsalt: parseInt(order.salt, 10),\n\t\t\tmaker: order.maker,\n\t\t\tsigner: order.signer,\n\t\t\ttaker: order.taker,\n\t\t\ttokenId: order.tokenId,\n\t\t\tmakerAmount: order.makerAmount,\n\t\t\ttakerAmount: order.takerAmount,\n\t\t\tside: order.side,\n\t\t\tsignatureType: order.signatureType,\n\t\t\ttimestamp: order.timestamp,\n\t\t\texpiration: order.expiration,\n\t\t\tmetadata: order.metadata,\n\t\t\tbuilder: order.builder,\n\t\t\tsignature: order.signature,\n\t\t},\n\t\towner,\n\t\torderType,\n\t} as NewOrderV2<T>;\n}\n\nexport interface PostOrdersV2Args {\n\torder: SignedOrderV2;\n\torderType: OrderType;\n}\n\nexport interface NewOrderV2<T extends OrderType> {\n\treadonly order: {\n\t\treadonly salt: number;\n\t\treadonly maker: string;\n\t\treadonly signer: string;\n\t\treadonly taker: string;\n\t\treadonly tokenId: string;\n\t\treadonly makerAmount: string;\n\t\treadonly takerAmount: string;\n\t\treadonly side: string;\n\t\treadonly signatureType: SignatureTypeV2;\n\t\treadonly timestamp: string;\n\t\treadonly expiration: string;\n\t\treadonly metadata: string;\n\t\treadonly builder: string;\n\t\treadonly signature: string;\n\t};\n\treadonly owner: string;\n\treadonly orderType: T;\n\treadonly deferExec: boolean;\n\treadonly postOnly: boolean;\n}\n\n/** Identifies the outcome to trade. Provide exactly one identifier. */\nexport type OrderAsset =\n\t| {\n\t\t\t/** Token identifier for a CTF outcome. */\n\t\t\ttokenID: string;\n\t\t\tpositionID?: never;\n\t }\n\t| {\n\t\t\t/** Position identifier for a Polymarket V2 outcome. */\n\t\t\tpositionID: string;\n\t\t\ttokenID?: never;\n\t };\n\n// Simplified order for users\ntype BaseUserOrderV2 = {\n\t/**\n\t * Price used to create the order\n\t */\n\tprice: number;\n\n\t/**\n\t * Size in outcome shares.\n\t */\n\tsize: number;\n\n\t/**\n\t * Side of the order\n\t */\n\tside: Side;\n\n\t/**\n\t * Metadata (bytes32)\n\t */\n\tmetadata?: string;\n\n\t/**\n\t * Builder code (bytes32)\n\t */\n\tbuilderCode?: string;\n\n\t/**\n\t * Expiration timestamp (unix seconds). Defaults to 0 (no expiration).\n\t */\n\texpiration?: number;\n\n\t/**\n\t * User's USDC balance. If provided and sufficient to cover amount + fees, the order\n\t * size is used as-is. Otherwise fees are deducted from the order notional and size is reduced.\n\t * If this field is left empty, the default flow is to use the order size as-is.\n\t * This is used for marketable limit orders\n\t */\n\tuserUSDCBalance?: number;\n};\n\nexport type UserOrderV2 = OrderAsset & BaseUserOrderV2;\n\n// Simplified market order for users\ntype BaseUserMarketOrderV2 = {\n\t/**\n\t * Price used to create the order\n\t * If it is not present the market price will be used.\n\t */\n\tprice?: number;\n\n\t/**\n\t * BUY orders: $$$ Amount to buy\n\t * SELL orders: Shares to sell\n\t */\n\tamount: number;\n\n\t/**\n\t * Side of the order\n\t */\n\tside: Side;\n\n\t/**\n\t * Specifies the type of order execution:\n\t * - FOK (Fill or Kill): The order must be filled entirely or not at all.\n\t * - FAK (Fill and Kill): The order can be partially filled, and any unfilled portion is canceled.\n\t */\n\torderType?: OrderType.FOK | OrderType.FAK;\n\n\t/**\n\t * User's USDC balance. If provided and sufficient to cover amount + fees, the order\n\t * amount is used as-is. Otherwise fees are deducted from the amount.\n\t * If this field is left empty, the default flow is to use the order amount as-is\n\t */\n\tuserUSDCBalance?: number;\n\n\t/**\n\t * Metadata (bytes32)\n\t */\n\tmetadata?: string;\n\n\t/**\n\t * Builder code (bytes32)\n\t */\n\tbuilderCode?: string;\n};\n\nexport type UserMarketOrderV2 = OrderAsset & BaseUserMarketOrderV2;\n"],"mappings":";;AAIA,SAAgB,cACf,OACA,OACA,WACA,WAAW,OACX,YAAY,OACI;AAChB,QAAO;EACN;EACA;EACA,OAAO;GACN,MAAM,SAAS,MAAM,MAAM,GAAG;GAC9B,OAAO,MAAM;GACb,QAAQ,MAAM;GACd,OAAO,MAAM;GACb,SAAS,MAAM;GACf,aAAa,MAAM;GACnB,aAAa,MAAM;GACnB,MAAM,MAAM;GACZ,eAAe,MAAM;GACrB,WAAW,MAAM;GACjB,YAAY,MAAM;GAClB,UAAU,MAAM;GAChB,SAAS,MAAM;GACf,WAAW,MAAM;GACjB;EACD;EACA;EACA"}
|
|
@@ -31,17 +31,23 @@ interface NewOrderV2<T extends OrderType> {
|
|
|
31
31
|
readonly deferExec: boolean;
|
|
32
32
|
readonly postOnly: boolean;
|
|
33
33
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
*/
|
|
34
|
+
/** Identifies the outcome to trade. Provide exactly one identifier. */
|
|
35
|
+
type OrderAsset = {
|
|
36
|
+
/** Token identifier for a CTF outcome. */
|
|
38
37
|
tokenID: string;
|
|
38
|
+
positionID?: never;
|
|
39
|
+
} | {
|
|
40
|
+
/** Position identifier for a Polymarket V2 outcome. */
|
|
41
|
+
positionID: string;
|
|
42
|
+
tokenID?: never;
|
|
43
|
+
};
|
|
44
|
+
type BaseUserOrderV2 = {
|
|
39
45
|
/**
|
|
40
46
|
* Price used to create the order
|
|
41
47
|
*/
|
|
42
48
|
price: number;
|
|
43
49
|
/**
|
|
44
|
-
* Size in
|
|
50
|
+
* Size in outcome shares.
|
|
45
51
|
*/
|
|
46
52
|
size: number;
|
|
47
53
|
/**
|
|
@@ -67,12 +73,9 @@ interface UserOrderV2 {
|
|
|
67
73
|
* This is used for marketable limit orders
|
|
68
74
|
*/
|
|
69
75
|
userUSDCBalance?: number;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
* TokenID of the Conditional token asset being traded
|
|
74
|
-
*/
|
|
75
|
-
tokenID: string;
|
|
76
|
+
};
|
|
77
|
+
type UserOrderV2 = OrderAsset & BaseUserOrderV2;
|
|
78
|
+
type BaseUserMarketOrderV2 = {
|
|
76
79
|
/**
|
|
77
80
|
* Price used to create the order
|
|
78
81
|
* If it is not present the market price will be used.
|
|
@@ -107,7 +110,8 @@ interface UserMarketOrderV2 {
|
|
|
107
110
|
* Builder code (bytes32)
|
|
108
111
|
*/
|
|
109
112
|
builderCode?: string;
|
|
110
|
-
}
|
|
113
|
+
};
|
|
114
|
+
type UserMarketOrderV2 = OrderAsset & BaseUserMarketOrderV2;
|
|
111
115
|
//#endregion
|
|
112
|
-
export { NewOrderV2, PostOrdersV2Args, UserMarketOrderV2, UserOrderV2, orderToJsonV2 };
|
|
116
|
+
export { NewOrderV2, OrderAsset, PostOrdersV2Args, UserMarketOrderV2, UserOrderV2, orderToJsonV2 };
|
|
113
117
|
//# sourceMappingURL=ordersV2.d.cts.map
|
package/dist/types/ordersV2.d.ts
CHANGED
|
@@ -32,17 +32,23 @@ interface NewOrderV2<T extends OrderType> {
|
|
|
32
32
|
readonly deferExec: boolean;
|
|
33
33
|
readonly postOnly: boolean;
|
|
34
34
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
*/
|
|
35
|
+
/** Identifies the outcome to trade. Provide exactly one identifier. */
|
|
36
|
+
type OrderAsset = {
|
|
37
|
+
/** Token identifier for a CTF outcome. */
|
|
39
38
|
tokenID: string;
|
|
39
|
+
positionID?: never;
|
|
40
|
+
} | {
|
|
41
|
+
/** Position identifier for a Polymarket V2 outcome. */
|
|
42
|
+
positionID: string;
|
|
43
|
+
tokenID?: never;
|
|
44
|
+
};
|
|
45
|
+
type BaseUserOrderV2 = {
|
|
40
46
|
/**
|
|
41
47
|
* Price used to create the order
|
|
42
48
|
*/
|
|
43
49
|
price: number;
|
|
44
50
|
/**
|
|
45
|
-
* Size in
|
|
51
|
+
* Size in outcome shares.
|
|
46
52
|
*/
|
|
47
53
|
size: number;
|
|
48
54
|
/**
|
|
@@ -68,12 +74,9 @@ interface UserOrderV2 {
|
|
|
68
74
|
* This is used for marketable limit orders
|
|
69
75
|
*/
|
|
70
76
|
userUSDCBalance?: number;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
* TokenID of the Conditional token asset being traded
|
|
75
|
-
*/
|
|
76
|
-
tokenID: string;
|
|
77
|
+
};
|
|
78
|
+
type UserOrderV2 = OrderAsset & BaseUserOrderV2;
|
|
79
|
+
type BaseUserMarketOrderV2 = {
|
|
77
80
|
/**
|
|
78
81
|
* Price used to create the order
|
|
79
82
|
* If it is not present the market price will be used.
|
|
@@ -108,7 +111,8 @@ interface UserMarketOrderV2 {
|
|
|
108
111
|
* Builder code (bytes32)
|
|
109
112
|
*/
|
|
110
113
|
builderCode?: string;
|
|
111
|
-
}
|
|
114
|
+
};
|
|
115
|
+
type UserMarketOrderV2 = OrderAsset & BaseUserMarketOrderV2;
|
|
112
116
|
//#endregion
|
|
113
|
-
export { NewOrderV2, PostOrdersV2Args, UserMarketOrderV2, UserOrderV2, orderToJsonV2 };
|
|
117
|
+
export { NewOrderV2, OrderAsset, PostOrdersV2Args, UserMarketOrderV2, UserOrderV2, orderToJsonV2 };
|
|
114
118
|
//# sourceMappingURL=ordersV2.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ordersV2.js","names":[],"sources":["../../src/types/ordersV2.ts"],"sourcesContent":["import type { SignatureTypeV2, SignedOrderV2 } from \"../order-utils/index.js\";\n\nimport type { OrderType, Side } from \"./clob.js\";\n\nexport function orderToJsonV2<T extends OrderType>(\n\torder: SignedOrderV2,\n\towner: string,\n\torderType: T,\n\tpostOnly = false,\n\tdeferExec = false,\n): NewOrderV2<T> {\n\treturn {\n\t\tdeferExec,\n\t\tpostOnly,\n\t\torder: {\n\t\t\tsalt: parseInt(order.salt, 10),\n\t\t\tmaker: order.maker,\n\t\t\tsigner: order.signer,\n\t\t\ttaker: order.taker,\n\t\t\ttokenId: order.tokenId,\n\t\t\tmakerAmount: order.makerAmount,\n\t\t\ttakerAmount: order.takerAmount,\n\t\t\tside: order.side,\n\t\t\tsignatureType: order.signatureType,\n\t\t\ttimestamp: order.timestamp,\n\t\t\texpiration: order.expiration,\n\t\t\tmetadata: order.metadata,\n\t\t\tbuilder: order.builder,\n\t\t\tsignature: order.signature,\n\t\t},\n\t\towner,\n\t\torderType,\n\t} as NewOrderV2<T>;\n}\n\nexport interface PostOrdersV2Args {\n\torder: SignedOrderV2;\n\torderType: OrderType;\n}\n\nexport interface NewOrderV2<T extends OrderType> {\n\treadonly order: {\n\t\treadonly salt: number;\n\t\treadonly maker: string;\n\t\treadonly signer: string;\n\t\treadonly taker: string;\n\t\treadonly tokenId: string;\n\t\treadonly makerAmount: string;\n\t\treadonly takerAmount: string;\n\t\treadonly side: string;\n\t\treadonly signatureType: SignatureTypeV2;\n\t\treadonly timestamp: string;\n\t\treadonly expiration: string;\n\t\treadonly metadata: string;\n\t\treadonly builder: string;\n\t\treadonly signature: string;\n\t};\n\treadonly owner: string;\n\treadonly orderType: T;\n\treadonly deferExec: boolean;\n\treadonly postOnly: boolean;\n}\n\n
|
|
1
|
+
{"version":3,"file":"ordersV2.js","names":[],"sources":["../../src/types/ordersV2.ts"],"sourcesContent":["import type { SignatureTypeV2, SignedOrderV2 } from \"../order-utils/index.js\";\n\nimport type { OrderType, Side } from \"./clob.js\";\n\nexport function orderToJsonV2<T extends OrderType>(\n\torder: SignedOrderV2,\n\towner: string,\n\torderType: T,\n\tpostOnly = false,\n\tdeferExec = false,\n): NewOrderV2<T> {\n\treturn {\n\t\tdeferExec,\n\t\tpostOnly,\n\t\torder: {\n\t\t\tsalt: parseInt(order.salt, 10),\n\t\t\tmaker: order.maker,\n\t\t\tsigner: order.signer,\n\t\t\ttaker: order.taker,\n\t\t\ttokenId: order.tokenId,\n\t\t\tmakerAmount: order.makerAmount,\n\t\t\ttakerAmount: order.takerAmount,\n\t\t\tside: order.side,\n\t\t\tsignatureType: order.signatureType,\n\t\t\ttimestamp: order.timestamp,\n\t\t\texpiration: order.expiration,\n\t\t\tmetadata: order.metadata,\n\t\t\tbuilder: order.builder,\n\t\t\tsignature: order.signature,\n\t\t},\n\t\towner,\n\t\torderType,\n\t} as NewOrderV2<T>;\n}\n\nexport interface PostOrdersV2Args {\n\torder: SignedOrderV2;\n\torderType: OrderType;\n}\n\nexport interface NewOrderV2<T extends OrderType> {\n\treadonly order: {\n\t\treadonly salt: number;\n\t\treadonly maker: string;\n\t\treadonly signer: string;\n\t\treadonly taker: string;\n\t\treadonly tokenId: string;\n\t\treadonly makerAmount: string;\n\t\treadonly takerAmount: string;\n\t\treadonly side: string;\n\t\treadonly signatureType: SignatureTypeV2;\n\t\treadonly timestamp: string;\n\t\treadonly expiration: string;\n\t\treadonly metadata: string;\n\t\treadonly builder: string;\n\t\treadonly signature: string;\n\t};\n\treadonly owner: string;\n\treadonly orderType: T;\n\treadonly deferExec: boolean;\n\treadonly postOnly: boolean;\n}\n\n/** Identifies the outcome to trade. Provide exactly one identifier. */\nexport type OrderAsset =\n\t| {\n\t\t\t/** Token identifier for a CTF outcome. */\n\t\t\ttokenID: string;\n\t\t\tpositionID?: never;\n\t }\n\t| {\n\t\t\t/** Position identifier for a Polymarket V2 outcome. */\n\t\t\tpositionID: string;\n\t\t\ttokenID?: never;\n\t };\n\n// Simplified order for users\ntype BaseUserOrderV2 = {\n\t/**\n\t * Price used to create the order\n\t */\n\tprice: number;\n\n\t/**\n\t * Size in outcome shares.\n\t */\n\tsize: number;\n\n\t/**\n\t * Side of the order\n\t */\n\tside: Side;\n\n\t/**\n\t * Metadata (bytes32)\n\t */\n\tmetadata?: string;\n\n\t/**\n\t * Builder code (bytes32)\n\t */\n\tbuilderCode?: string;\n\n\t/**\n\t * Expiration timestamp (unix seconds). Defaults to 0 (no expiration).\n\t */\n\texpiration?: number;\n\n\t/**\n\t * User's USDC balance. If provided and sufficient to cover amount + fees, the order\n\t * size is used as-is. Otherwise fees are deducted from the order notional and size is reduced.\n\t * If this field is left empty, the default flow is to use the order size as-is.\n\t * This is used for marketable limit orders\n\t */\n\tuserUSDCBalance?: number;\n};\n\nexport type UserOrderV2 = OrderAsset & BaseUserOrderV2;\n\n// Simplified market order for users\ntype BaseUserMarketOrderV2 = {\n\t/**\n\t * Price used to create the order\n\t * If it is not present the market price will be used.\n\t */\n\tprice?: number;\n\n\t/**\n\t * BUY orders: $$$ Amount to buy\n\t * SELL orders: Shares to sell\n\t */\n\tamount: number;\n\n\t/**\n\t * Side of the order\n\t */\n\tside: Side;\n\n\t/**\n\t * Specifies the type of order execution:\n\t * - FOK (Fill or Kill): The order must be filled entirely or not at all.\n\t * - FAK (Fill and Kill): The order can be partially filled, and any unfilled portion is canceled.\n\t */\n\torderType?: OrderType.FOK | OrderType.FAK;\n\n\t/**\n\t * User's USDC balance. If provided and sufficient to cover amount + fees, the order\n\t * amount is used as-is. Otherwise fees are deducted from the amount.\n\t * If this field is left empty, the default flow is to use the order amount as-is\n\t */\n\tuserUSDCBalance?: number;\n\n\t/**\n\t * Metadata (bytes32)\n\t */\n\tmetadata?: string;\n\n\t/**\n\t * Builder code (bytes32)\n\t */\n\tbuilderCode?: string;\n};\n\nexport type UserMarketOrderV2 = OrderAsset & BaseUserMarketOrderV2;\n"],"mappings":";AAIA,SAAgB,cACf,OACA,OACA,WACA,WAAW,OACX,YAAY,OACI;AAChB,QAAO;EACN;EACA;EACA,OAAO;GACN,MAAM,SAAS,MAAM,MAAM,GAAG;GAC9B,OAAO,MAAM;GACb,QAAQ,MAAM;GACd,OAAO,MAAM;GACb,SAAS,MAAM;GACf,aAAa,MAAM;GACnB,aAAa,MAAM;GACnB,MAAM,MAAM;GACZ,eAAe,MAAM;GACrB,WAAW,MAAM;GACjB,YAAY,MAAM;GAClB,UAAU,MAAM;GAChB,SAAS,MAAM;GACf,WAAW,MAAM;GACjB;EACD;EACA;EACA"}
|