@totalis/hip4-client 0.128.0 → 0.130.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.
@@ -0,0 +1,336 @@
1
+ import { ceilDiv, centAmount, coreShortfall, decimalParts, decimalUnits, nearestDiv } from "./money.js";
2
+ import { closingFees, guestFees, saleProceeds, settledPayout, withBuilderFee } from "./outcome-fees.js";
3
+ import { nativePrice } from "./singles.js";
4
+ /**
5
+ * The money of one single before it is signed: what a limit or a market
6
+ * order of a budget or of whole shares signs, spends, pays and receives.
7
+ * Amounts are USDC base units (6 decimals) unless named HyperCore units
8
+ * (8 decimals); prices are decimal text. A refusal carries a reason code and
9
+ * the numbers behind it, never copy.
10
+ */
11
+ const usdcUnit = 1000000n;
12
+ /** Hyperliquid refuses a single whose traded notional is under 1 USDC, in USDC base units. */
13
+ export const minOrderNotional = 1000000n;
14
+ const priceScale = 100000000n;
15
+ const bookToUsdc = 100n;
16
+ const walkMinimum = minOrderNotional * bookToUsdc;
17
+ /** Whole shares in a size: the fraction dropped, empty read as 0. HIP-4 sizes are whole. */
18
+ export const wholeShares = (amount) => BigInt(amount.split(".")[0] || "0");
19
+ /** A price in 1e-8 USDC per share, so units times shares is HyperCore USDC units; `null` outside (0, 1) or past 8 decimals. */
20
+ export function priceUnits(value) {
21
+ if (!/^\d+(\.\d+)?$/.test(value))
22
+ return null;
23
+ const [whole = "", fraction = ""] = value.split(".");
24
+ if (fraction.length > 8)
25
+ return null;
26
+ const units = BigInt(whole) * priceScale + BigInt(fraction.padEnd(8, "0") || "0");
27
+ return units > 0n && units < priceScale ? units : null;
28
+ }
29
+ const unitsText = (value, decimals) => {
30
+ const scale = 10n ** BigInt(decimals);
31
+ const fraction = (value % scale).toString().padStart(decimals, "0").replace(/0+$/, "");
32
+ return fraction ? `${value / scale}.${fraction}` : (value / scale).toString();
33
+ };
34
+ const centCeiling = (atoms) => centAmount("fee", atoms);
35
+ function minimumShares(wire) {
36
+ const [whole = "", fraction = ""] = wire.split(".");
37
+ const mantissa = BigInt(whole + fraction);
38
+ const unit = 10n ** BigInt(fraction.length);
39
+ const perShare = mantissa * usdcUnit;
40
+ const needed = (minOrderNotional * unit + perShare - 1n) / perShare;
41
+ return { needed, stake: centCeiling((perShare * needed + unit - 1n) / unit) };
42
+ }
43
+ const belowMinimum = (least, price, shares, notional, payout) => ({ ok: false, reason: "BELOW_MINIMUM", leastStake: least.stake, leastShares: least.needed, price, shares: shares.toString(), notional, payout });
44
+ function signedShares(buy, price, shares) {
45
+ const wire = nativePrice(price);
46
+ if (wire === null)
47
+ return { ok: false, reason: "PRICE_UNAVAILABLE" };
48
+ const [whole = "", fraction = ""] = wire.split(".");
49
+ const unit = 10n ** BigInt(fraction.length);
50
+ const notional = (BigInt(whole + fraction) * shares * usdcUnit) / unit;
51
+ return { ok: true, buy, price: wire, shares: shares.toString(), notional, payout: buy ? shares * usdcUnit : notional };
52
+ }
53
+ function previewShares(buy, price, shares) {
54
+ const signed = signedShares(buy, price, shares);
55
+ if (!signed.ok || signed.notional >= minOrderNotional)
56
+ return signed;
57
+ return belowMinimum(minimumShares(signed.price), signed.price, shares, signed.notional, signed.payout);
58
+ }
59
+ /**
60
+ * A limit order at `price`: a buy of the most whole shares whose price times
61
+ * size fits `budget` (HyperCore units, 8 decimals), or a sale of `shares`.
62
+ * Its minimum is judged on price times size.
63
+ */
64
+ export function limitPreview(order) {
65
+ if (!order.buy)
66
+ return previewShares(false, order.price, order.shares);
67
+ const wire = nativePrice(order.price);
68
+ if (wire === null)
69
+ return { ok: false, reason: "PRICE_UNAVAILABLE" };
70
+ const [whole = "", fraction = ""] = wire.split(".");
71
+ return previewShares(true, wire, (order.budget * 10n ** BigInt(fraction.length)) / (BigInt(whole + fraction) * priceScale));
72
+ }
73
+ function bookLevels(book, buy) {
74
+ return book.levels[buy ? 1 : 0]
75
+ .map((level) => ({ price: priceUnits(level.px), shares: wholeShares(level.sz) }))
76
+ .filter((level) => level.price !== null && level.shares > 0n)
77
+ .sort((left, right) => (left.price === right.price ? 0 : (buy ? left.price < right.price : left.price > right.price) ? -1 : 1));
78
+ }
79
+ /** The best price on the side an order takes: the lowest ask to buy, the highest bid to sell; `null` when that side is empty. */
80
+ export function bookTop(book, buy) {
81
+ const best = bookLevels(book, buy)[0];
82
+ return best ? unitsText(best.price, 8) : null;
83
+ }
84
+ function fillShares(levels, requested) {
85
+ let shares = 0n;
86
+ let value = 0n;
87
+ let worst = 0n;
88
+ for (const level of levels) {
89
+ const remaining = requested - shares;
90
+ if (remaining === 0n)
91
+ break;
92
+ const taken = level.shares < remaining ? level.shares : remaining;
93
+ shares += taken;
94
+ value += taken * level.price;
95
+ worst = level.price;
96
+ }
97
+ return { shares, value, worst };
98
+ }
99
+ // The most whole shares a buy can take off these asks with its signed limit
100
+ // times size inside `budget`: each level's limit bounds the shares it can
101
+ // reach, so every level is a candidate and the largest wins.
102
+ function budgetShares(levels, budget) {
103
+ let reach = 0n;
104
+ let best = 0n;
105
+ for (const level of levels) {
106
+ reach += level.shares;
107
+ const limit = priceUnits(unitsText(level.price, 8));
108
+ if (limit === null)
109
+ break;
110
+ const affordable = budget / limit;
111
+ const candidate = affordable < reach ? affordable : reach;
112
+ if (candidate > best)
113
+ best = candidate;
114
+ }
115
+ return best;
116
+ }
117
+ // The fewest whole shares whose walk clears the minimum, and the least stake
118
+ // whose signed limit buys them; past the depth received the deepest level is
119
+ // taken as going on.
120
+ function walkLeast(levels) {
121
+ let shares = 0n;
122
+ let value = 0n;
123
+ for (const [index, level] of levels.entries()) {
124
+ const more = (walkMinimum - value + level.price - 1n) / level.price;
125
+ if (more <= level.shares || index === levels.length - 1) {
126
+ const needed = shares + more;
127
+ const limit = priceUnits(unitsText(level.price, 8)) ?? level.price;
128
+ return { needed, stake: centCeiling((needed * limit + bookToUsdc - 1n) / bookToUsdc) };
129
+ }
130
+ shares += level.shares;
131
+ value += level.shares * level.price;
132
+ }
133
+ return { needed: 0n, stake: 0n };
134
+ }
135
+ /**
136
+ * A market order walked off `book`: a buy of the most whole shares whose
137
+ * signed limit times size fits `budget` (HyperCore units, 8 decimals), or a
138
+ * sale of `shares`. Its IOC limit is the worst level the walk reaches; its
139
+ * minimum is judged on what the walk trades, as Hyperliquid judges an IOC.
140
+ */
141
+ export function bookPreview(order, book) {
142
+ const { buy } = order;
143
+ const levels = bookLevels(book, buy);
144
+ const last = levels[levels.length - 1];
145
+ const top = levels[0];
146
+ if (last === undefined || top === undefined)
147
+ return { ok: false, reason: buy ? "NO_ASKS" : "NO_BIDS" };
148
+ const available = levels.reduce((sum, level) => sum + level.shares, 0n);
149
+ let requested;
150
+ if (order.buy) {
151
+ requested = budgetShares(levels, order.budget);
152
+ const deepest = priceUnits(unitsText(last.price, 8));
153
+ if (requested === available && deepest !== null && order.budget / deepest > available) {
154
+ return { ok: false, reason: "BOOK_TOO_THIN", fillableUsdc: centAmount("received", fillShares(levels, available).value / bookToUsdc) };
155
+ }
156
+ }
157
+ else {
158
+ requested = order.shares;
159
+ if (requested === 0n)
160
+ return { ok: false, reason: "NO_AMOUNT" };
161
+ if (requested > available)
162
+ return { ok: false, reason: "BOOK_TOO_THIN", fillableShares: available };
163
+ }
164
+ const { shares, value, worst } = fillShares(levels, requested);
165
+ if (shares === 0n || worst === 0n)
166
+ return { ok: false, reason: "LESS_THAN_SHARE" };
167
+ const limit = unitsText(worst, 8);
168
+ const signed = signedShares(false, limit, shares);
169
+ if (!signed.ok)
170
+ return signed;
171
+ const execution = value / bookToUsdc;
172
+ const payout = buy ? shares * usdcUnit : execution;
173
+ if (value < walkMinimum)
174
+ return belowMinimum(walkLeast(levels), limit, shares, signed.notional, payout);
175
+ return { ...signed, buy, payout, averagePrice: unitsText(value / shares, 8), bestPrice: unitsText(top.price, 8), cost: buy ? execution : null };
176
+ }
177
+ /**
178
+ * `side`'s book of `outcomeId` less the account's own resting orders, which
179
+ * Hyperliquid never fills against the account (it cancels the resting one),
180
+ * so a walk must not count them. An order on the other side rests here
181
+ * mirrored: a No buy at p is a Yes ask at 1 − p.
182
+ */
183
+ export function othersBook(book, outcomeId, side, orders) {
184
+ const own = [new Map(), new Map()];
185
+ for (const order of orders) {
186
+ const units = order.outcome_id === outcomeId ? priceUnits(order.limit_price) : null;
187
+ if (units === null)
188
+ continue;
189
+ const same = order.market_side === side;
190
+ const levels = own[(order.direction === "BUY") === same ? 0 : 1];
191
+ const price = same ? units : priceScale - units;
192
+ levels.set(price, (levels.get(price) ?? 0n) + wholeShares(order.remaining_size));
193
+ }
194
+ if (own[0].size === 0 && own[1].size === 0)
195
+ return book;
196
+ const less = (levels, mine) => levels.flatMap((level) => {
197
+ const units = priceUnits(level.px);
198
+ const taken = units === null ? undefined : mine.get(units);
199
+ if (taken === undefined)
200
+ return [level];
201
+ const left = wholeShares(level.sz) - taken;
202
+ return left > 0n ? [{ ...level, sz: left.toString(), ...(level.n === undefined ? {} : { n: Math.max(level.n - 1, 1) }) }] : [];
203
+ });
204
+ return { ...book, levels: [less(book.levels[0], own[0]), less(book.levels[1], own[1])] };
205
+ }
206
+ const spend = (preview) => (!preview.ok ? null : "cost" in preview ? preview.cost : preview.notional);
207
+ // The signed limit times size, exact in HyperCore units.
208
+ function signedUnits(order) {
209
+ const units = priceUnits(order.price);
210
+ if (units === null)
211
+ throw new RangeError(`not a signed price: ${order.price}`);
212
+ return units * BigInt(order.shares);
213
+ }
214
+ /**
215
+ * The most a buy on these terms can take from cash: its limit times size,
216
+ * rounded up to the USDC base unit, with the builder fee rounded up, then
217
+ * rounded up to the cent. Buying outcome shares pays no venue fee, only the
218
+ * builder fee, and `signedBuilderDecibps` is the one in the signed action
219
+ * (0 without the builder), so no rate read before the press can move it.
220
+ */
221
+ export const maxCost = (order, signedBuilderDecibps) => centAmount("fee", withBuilderFee(ceilDiv(signedUnits(order), bookToUsdc), signedBuilderDecibps));
222
+ /**
223
+ * The least a sale on these terms lands if every share fills, whatever
224
+ * discount or volume tier applies when it executes: its limit times size
225
+ * less the venue fee at the highest taker rate `market` can charge (the base
226
+ * schedule, `guestFees`, with no discount) and the builder fee in the signed
227
+ * action, charged as `saleProceeds` charges them. It takes the market's
228
+ * scales, never an account's rate, which a referral discount ending or a
229
+ * tier changing can raise before the order fills; so it sits a few bps under
230
+ * a forecast at the account's own rate. An IOC can fill fewer shares or
231
+ * none, so it bounds each share's price, not the total.
232
+ */
233
+ export const minProceeds = (order, market, signedBuilderDecibps) => saleProceeds(signedUnits(order) / bookToUsdc, closingFees(guestFees, market).taker, signedBuilderDecibps);
234
+ /**
235
+ * What a priced buy takes from cash, with the builder fee (decibps): `cost`
236
+ * what it is expected to spend (the walk's cost, or price times size),
237
+ * rounded to the nearest cent; `maxCost` as `maxCost` states it for the
238
+ * preview's own limit; `leftover` what of `stake` stays in cash after that
239
+ * cost and any `setupFee`. `null` for a refusal or a sale.
240
+ */
241
+ export function buyCost(preview, stake, builderDecibps, setupFee = 0n) {
242
+ const cost = spend(preview);
243
+ if (!preview.ok || !preview.buy || cost === null)
244
+ return null;
245
+ const shown = centAmount("cost", withBuilderFee(cost, builderDecibps));
246
+ return {
247
+ cost: shown,
248
+ shares: BigInt(preview.shares),
249
+ leftover: stake > shown + setupFee ? stake - shown - setupFee : 0n,
250
+ maxCost: maxCost(preview, builderDecibps),
251
+ };
252
+ }
253
+ /** What a priced sale lands in cash: the walk's proceeds (or price times size at a limit) less the fee at `rate` and the builder fee; 0 for a refusal or a buy. */
254
+ export const sellProceeds = (preview, rate, builderDecibps) => preview.ok && !preview.buy ? saleProceeds(preview.payout, rate, builderDecibps) : 0n;
255
+ /** What a priced buy needs on HyperCore spot, in HyperCore units: its signed price times size, with the builder fee (decibps). 0 for a refusal or a sale. */
256
+ export const orderCoreNeed = (preview, builderDecibps = 0) => preview.ok && preview.buy ? withBuilderFee(decimalParts(preview.price, 8) * BigInt(preview.shares), builderDecibps) : 0n;
257
+ /** The vault cash (6 decimals) that covers what `spot` (HyperCore units) lacks of `orderCoreNeed`: exact in 8 decimals, only the shortfall rounded up. */
258
+ export const orderVaultNeed = (preview, spot = 0n, builderDecibps = 0) => coreShortfall(orderCoreNeed(preview, builderDecibps), spot);
259
+ /** What a fill moved in HyperCore units: shares times price, exact, plus `fee` (a buy pays it on top, so pass it negated for a sale). `null` for a price that is not decimal text. */
260
+ export function filledCoreUnits(shares, price, fee = 0n) {
261
+ if (!/^\d+(\.\d+)?$/.test(price))
262
+ return null;
263
+ const decimals = price.split(".")[1]?.length ?? 0;
264
+ return nearestDiv(shares * decimalParts(price, decimals) * priceScale, 10n ** BigInt(decimals)) + fee;
265
+ }
266
+ /**
267
+ * Settled money from a fill, never the preview, rounded once to the cent: a
268
+ * buy's `cost` to the nearest, its `payout` if it wins at `fees` (`null`
269
+ * while they are unread), and `setup` when a setup fee was proven paid; a
270
+ * sale's `received` down. `null` where the fill's price or fee is not in yet.
271
+ */
272
+ export function orderReceipt(fill, buy, fees, setupFee = 0n) {
273
+ const price = fill.kind === "resting" ? null : fill.averagePrice;
274
+ const gross = price === null ? null : filledCoreUnits(fill.shares, price);
275
+ const net = price === null || fill.fee === null ? null : filledCoreUnits(fill.shares, price, buy ? fill.fee : -fill.fee);
276
+ if (!buy)
277
+ return { received: net === null ? null : centAmount("received", net, 8) };
278
+ return {
279
+ cost: net === null ? null : centAmount("cost", net, 8),
280
+ payout: gross === null || fees === null ? null : settledPayout(fill.shares, fees),
281
+ ...(setupFee > 0n ? { setup: setupFee } : {}),
282
+ };
283
+ }
284
+ const fractionDigits = (value) => value.split(".")[1]?.length ?? 0;
285
+ // A size-weighted price is carried this far past its fills' scale, enough to keep a receipt exact at any size.
286
+ const executionPriceDigits = 18;
287
+ /** The size-weighted price `fills` executed at; `null` where any lacks a price. */
288
+ export function executionPrice(fills) {
289
+ const prices = fills.map((fill) => fill.price ?? "");
290
+ if (prices.length === 0 || prices.some((price) => !/^\d+(\.\d+)?$/.test(price)))
291
+ return null;
292
+ const sizeScale = Math.max(...fills.map((fill) => fractionDigits(fill.size)));
293
+ const priceDigits = Math.max(...prices.map(fractionDigits)) + executionPriceDigits;
294
+ const size = fills.reduce((sum, fill) => sum + decimalParts(fill.size, sizeScale), 0n);
295
+ if (size <= 0n)
296
+ return null;
297
+ const notional = fills.reduce((sum, fill, index) => sum + decimalParts(prices[index] ?? "", priceDigits) * decimalParts(fill.size, sizeScale), 0n);
298
+ return unitsText((notional + size / 2n) / size, priceDigits);
299
+ }
300
+ /**
301
+ * What the venue charged and executed at over every fill of order `oid`,
302
+ * once they add up to exactly `expectedSize`: a resting order keeps filling
303
+ * and old fills drop out, so fills that come to more or less belong to
304
+ * another total. `fee` is decimal text in `token`, negative for a rebate;
305
+ * `price` is `executionPrice`. `null` until then.
306
+ */
307
+ export function actualOrderFill(fills, oid, expectedSize) {
308
+ const matching = fills.filter((fill) => fill.oid === oid);
309
+ const token = matching[0]?.fee_token;
310
+ if (!token || matching.some((fill) => fill.fee === undefined || fill.fee_token !== token))
311
+ return null;
312
+ const values = [...matching.map((fill) => fill.fee ?? ""), ...matching.map((fill) => fill.size), expectedSize];
313
+ if (values.some((value) => !/^-?\d+(\.\d+)?$/.test(value)))
314
+ return null;
315
+ const decimals = Math.max(...values.map(fractionDigits));
316
+ const units = (value) => decimalUnits(value, decimals) ?? 0n;
317
+ const size = matching.reduce((sum, fill) => sum + units(fill.size), 0n);
318
+ if (size !== units(expectedSize))
319
+ return null;
320
+ const fee = matching.reduce((sum, fill) => sum + units(fill.fee ?? ""), 0n);
321
+ return { fee: `${fee < 0n ? "-" : ""}${unitsText(fee < 0n ? -fee : fee, decimals)}`, token, price: executionPrice(matching) };
322
+ }
323
+ /**
324
+ * A fill whose price or fee is missing, completed from the order's `fills`
325
+ * once they add up to exactly its shares: the venue's own answer wins where
326
+ * it gave one, and the fee must be USDC. Otherwise the same fill.
327
+ */
328
+ export function settledFill(fill, fills) {
329
+ if (fill.oid === undefined || fill.kind === "resting" || (fill.averagePrice !== null && fill.fee !== null))
330
+ return fill;
331
+ const actual = actualOrderFill(fills, fill.oid, fill.shares.toString());
332
+ const charged = actual?.token === "USDC" ? decimalUnits(actual.fee, 8) : null;
333
+ const averagePrice = fill.averagePrice ?? actual?.price ?? null;
334
+ const fee = fill.fee ?? charged;
335
+ return averagePrice === null || fee === null ? fill : { ...fill, averagePrice, fee };
336
+ }
package/dist/client.d.ts CHANGED
@@ -5,13 +5,16 @@ export type { components, operations, paths } from "./generated/client.js";
5
5
  export type { AccessToken, ApiClientOptions, PublicEnvironment } from "./base.js";
6
6
  /** The typed HTTP client for the `client` audience. `createTotalis` adds the flows. */
7
7
  export declare function createClient(environment: PublicEnvironment, options?: ApiClientOptions): import("openapi-fetch").Client<paths, `${string}/${string}`>;
8
- export { bestBid, bestQuote, createTotalis, defaultWalletApproval, EntryError, entryFailure, follow, fundWindowMs, WalletApprovalError, type Acceptance, type AcceptanceResult, type Amount, type ApprovalListener, type BridgeState, type ComboCash, type CashoutBid, type Chooser, type Deployment, type DepositAccepted, type EntryCash, type EntryFailure, type EntryQuote, type KnownWalletApproval, type LandedWalletApproval, type SignedWalletApproval, type WalletApproval, type WalletApprovalRequest, type CoreExit, type LegacySignedEntry, type Leg, type MarketFilters, type MarketRow, type PreparedEntryFunding, type NotAdmitted, type RecordListener, type Operation, type Quote, type ResponseOf, type SellBackQuote, type SignedAcceptance, type SignedCashout, type SignedCoreExit, type SignedDeposit, type SignedEntry, type SignedReturnToCore, type Totalis, type TotalisOptions, type WalletCall, type Withdrawal, } from "./totalis.js";
8
+ export { bestBid, bestNetQuote, bestQuote, createTotalis, defaultWalletApproval, EntryError, entryFailure, follow, fundWindowMs, WalletApprovalError, type Acceptance, type AcceptanceResult, type Amount, type ApprovalListener, type BridgeState, type ComboCash, type CashoutBid, type Chooser, type Deployment, type DepositAccepted, type EntryCash, type EntryFailure, type EntryQuote, type KnownWalletApproval, type LandedWalletApproval, type SignedWalletApproval, type WalletApproval, type WalletApprovalRequest, type CoreExit, type LegacySignedEntry, type Leg, type MarketFilters, type MarketRow, type PreparedEntryFunding, type NotAdmitted, type RecordListener, type Operation, type Quote, type ResponseOf, type SellBackQuote, type SignedAcceptance, type SignedCashout, type SignedCoreExit, type SignedDeposit, type SignedEntry, type SignedReturnToCore, type Totalis, type TotalisOptions, type WalletCall, type Withdrawal, } from "./totalis.js";
9
9
  export { bridgeAction, bridgeGasBuffer, classifyHypercoreAnswer, coreSetupFee, hyperevmUsdcBridge, hyperliquidExchange, hyperliquidInfo, hyperliquidNetwork, hypercoreNonce, hypercoreSignature, readCoreCash, sendAssetTypedData, settleHypercore, signSendAsset, submitHypercore, usdcText, type BridgedCash, type CoreAccountMode, type CoreCash, type HypercoreAnswer, type HyperliquidInfo, type HypercoreSignature, type HypercoreTransport, type HyperliquidNetwork, type SendAssetAction, type SignedSendAsset, } from "./hypercore.js";
10
- export { approveAgentAction, approveAgentTypedData, approveBuilderFeeTypedData, approveHyperliquidAgent, approveTotalisBuilder, approveTotalisBuilderAction, cancelSingles, l1ActionHash, l1TypedData, outcomeAsset, outcomeCoin, placeSingle, readSingleOrder, readTotalisBuilderFee, signL1Action, singleCancelAction, singleCancelAnswers, singleCloid, singleOrderAction, singleOrderAnswer, submitSingleCancel, submitSingleOrder, totalisBuilder, type ApproveAgentAction, type ApproveBuilderFeeAction, type CancelByCloidAction, type CancelByOidAction, type ExchangeOptions, type L1Options, type OutcomeSide, type SignedL1Action, type SignedUserAction, type SingleAction, type SingleCancel, type SingleCancelAction, type SingleCancelAnswer, type SingleOrder, type SingleOrderAction, type SingleOrderAnswer, type SingleOrderStatus, type SingleTif, } from "./singles.js";
10
+ export { approveAgentAction, approveAgentTypedData, approveBuilderFeeTypedData, approveHyperliquidAgent, approveTotalisBuilder, approveTotalisBuilderAction, cancelSingles, l1ActionHash, l1TypedData, outcomeAsset, outcomeCoin, placeSingle, readSingleOrder, readTotalisBuilderFee, signL1Action, singleCancelAction, singleCancelAnswers, singleCloid, singleOrderAction, singleOrderAnswer, submitSingleCancel, submitSingleOrder, totalisBuilder, type ApproveAgentAction, type ApproveBuilderFeeAction, type CancelByCloidAction, type CancelByOidAction, type ExchangeOptions, type L1Options, type OutcomeSide, type SignedL1Action, type SignedUserAction, type SingleAction, type SingleCancel, type SingleCancelAction, type SingleCancelAnswer, type SingleOrder, type SingleOrderAction, type SingleOrderAnswer, type SingleOrderStatus, type SingleTif, type SingleOrderActionWithoutBuilder, } from "./singles.js";
11
11
  export { ApiError, envelope, NetworkError, randomBytes32, rawBody, retryingFetch, sendOnce, unwrap, uuidv7, type Fetch, type Repaired, type RetryPolicy } from "./request.js";
12
12
  export { items, pages, type Page, type PageQuery } from "./pagination.js";
13
13
  export { toTotalisSigner, type SignerInput, type TotalisSigner } from "./signer.js";
14
14
  export { BalanceUnknownError, ExitUnavailableError, normalizeError, type NormalizedError } from "./flow-errors.js";
15
- export { comboAllowance, netCashout, netOfProfitFee, netPayout, netStake, offeredCore, spendableCash } from "./money.js";
15
+ export { activationTopUp, afterActivation, centAmount, comboAllowance, coreAtomsFloor, coreShortfall, coreUnits, decimalUnits, directBuyBudget, directBuyVault, fundable, maxStake, netCashout, netOfProfitFee, netPayout, netStake, offeredCore, sendableAfterSetup, spendableCash, stakeAfterSetup, sweepAmount, usdCents, usdcCent, walletDepositable, walletSweepMinimum, withdrawRoom, type ComboSources, type UsdKind, } from "./money.js";
16
+ export { beforeBuilderFee, closingFees, guestFees, pairPayout, parseUserFees, saleProceeds, saleRate, settledPayout, withBuilderFee, type AccountFees, type FeeRate, type MarketFeeScale, type OutcomeFees, } from "./outcome-fees.js";
17
+ export { actualOrderFill, bookPreview, bookTop, buyCost, executionPrice, filledCoreUnits, limitPreview, maxCost, minOrderNotional, minProceeds, orderCoreNeed, orderReceipt, orderVaultNeed, othersBook, priceUnits, sellProceeds, settledFill, wholeShares, type BookLevel, type BookPreview, type Fill, type OrderFill, type OrderPreview, type OrderRefusal, type OwnOrder, type PricedOrder, type SignedTerms, type SingleBook, } from "./book-walk.js";
18
+ export { boundLimit, ShownHistory, shownFloor, shownLookbackMs, type ShownValue } from "./shown.js";
16
19
  export { createUiAdapter, type AccountResource, type QuoteView, type UiAdapter, type UiAdapterOptions } from "./ui.js";
17
20
  export { StreamClosedError, TotalisStream, type StreamEvent, type StreamOptions, type StreamStatus, type StreamSubscription } from "./stream.js";
package/dist/client.js CHANGED
@@ -4,13 +4,16 @@ export { publicServers, publicStreamServers } from "./base.js";
4
4
  export function createClient(environment, options) {
5
5
  return audienceClient(environment, options);
6
6
  }
7
- export { bestBid, bestQuote, createTotalis, defaultWalletApproval, EntryError, entryFailure, follow, fundWindowMs, WalletApprovalError, } from "./totalis.js";
7
+ export { bestBid, bestNetQuote, bestQuote, createTotalis, defaultWalletApproval, EntryError, entryFailure, follow, fundWindowMs, WalletApprovalError, } from "./totalis.js";
8
8
  export { bridgeAction, bridgeGasBuffer, classifyHypercoreAnswer, coreSetupFee, hyperevmUsdcBridge, hyperliquidExchange, hyperliquidInfo, hyperliquidNetwork, hypercoreNonce, hypercoreSignature, readCoreCash, sendAssetTypedData, settleHypercore, signSendAsset, submitHypercore, usdcText, } from "./hypercore.js";
9
9
  export { approveAgentAction, approveAgentTypedData, approveBuilderFeeTypedData, approveHyperliquidAgent, approveTotalisBuilder, approveTotalisBuilderAction, cancelSingles, l1ActionHash, l1TypedData, outcomeAsset, outcomeCoin, placeSingle, readSingleOrder, readTotalisBuilderFee, signL1Action, singleCancelAction, singleCancelAnswers, singleCloid, singleOrderAction, singleOrderAnswer, submitSingleCancel, submitSingleOrder, totalisBuilder, } from "./singles.js";
10
10
  export { ApiError, envelope, NetworkError, randomBytes32, rawBody, retryingFetch, sendOnce, unwrap, uuidv7 } from "./request.js";
11
11
  export { items, pages } from "./pagination.js";
12
12
  export { toTotalisSigner } from "./signer.js";
13
13
  export { BalanceUnknownError, ExitUnavailableError, normalizeError } from "./flow-errors.js";
14
- export { comboAllowance, netCashout, netOfProfitFee, netPayout, netStake, offeredCore, spendableCash } from "./money.js";
14
+ export { activationTopUp, afterActivation, centAmount, comboAllowance, coreAtomsFloor, coreShortfall, coreUnits, decimalUnits, directBuyBudget, directBuyVault, fundable, maxStake, netCashout, netOfProfitFee, netPayout, netStake, offeredCore, sendableAfterSetup, spendableCash, stakeAfterSetup, sweepAmount, usdCents, usdcCent, walletDepositable, walletSweepMinimum, withdrawRoom, } from "./money.js";
15
+ export { beforeBuilderFee, closingFees, guestFees, pairPayout, parseUserFees, saleProceeds, saleRate, settledPayout, withBuilderFee, } from "./outcome-fees.js";
16
+ export { actualOrderFill, bookPreview, bookTop, buyCost, executionPrice, filledCoreUnits, limitPreview, maxCost, minOrderNotional, minProceeds, orderCoreNeed, orderReceipt, orderVaultNeed, othersBook, priceUnits, sellProceeds, settledFill, wholeShares, } from "./book-walk.js";
17
+ export { boundLimit, ShownHistory, shownFloor, shownLookbackMs } from "./shown.js";
15
18
  export { createUiAdapter } from "./ui.js";
16
19
  export { StreamClosedError, TotalisStream } from "./stream.js";
@@ -70,6 +70,7 @@ export type components = {
70
70
  */
71
71
  readonly combo?: true;
72
72
  readonly display?: components["schemas"]["DisplayQuery"];
73
+ readonly light?: components["schemas"]["LightQuery"];
73
74
  } & ({
74
75
  readonly category: components["schemas"]["CategorySlug"];
75
76
  } | {
@@ -100,6 +101,7 @@ export type components = {
100
101
  readonly limit?: components["schemas"]["PageLimit"];
101
102
  readonly cursor?: components["schemas"]["PageCursor"];
102
103
  readonly display?: components["schemas"]["DisplayQuery"];
104
+ readonly light?: components["schemas"]["LightQuery"];
103
105
  } & ({
104
106
  readonly category: components["schemas"]["CategorySlug"];
105
107
  } | {
@@ -261,6 +263,11 @@ export type components = {
261
263
  * @constant
262
264
  */
263
265
  readonly DisplayQuery: true;
266
+ /**
267
+ * @description Only beside display=true: also answer each picture's `light_variants`, its rendition for light grounds, where imagery has one. Send it only as true; any other value, or light without display, returns 400 INVALID_QUERY. It is no filter: a cursor neither binds nor needs it.
268
+ * @constant
269
+ */
270
+ readonly LightQuery: true;
264
271
  /** @enum {string} */
265
272
  readonly MarketState: "ACTIVE" | "CLOSED" | "UNSUPPORTED";
266
273
  readonly Category: ("Crypto" | "Economics" | "Entertainment" | "Esports" | "Finance" | "Politics" | "Sports" | "Tech" | "Weather") | null;
@@ -844,12 +851,18 @@ export type components = {
844
851
  * @enum {string}
845
852
  */
846
853
  readonly fit: "ICON" | "PHOTO";
847
- /** @description Square WebP renditions at 64, 128 and 256 pixels, in that order. Their URLs never change content. */
854
+ /** @description Square WebP renditions at 64, 128 and 256 pixels, in that order. Their URLs never change content. Drawn on dark grounds, and on light ones where `light_variants` is absent. */
848
855
  readonly variants: readonly [
849
856
  components["schemas"]["PictureVariant"],
850
857
  components["schemas"]["PictureVariant"],
851
858
  components["schemas"]["PictureVariant"]
852
859
  ];
860
+ /** @description Only when asked with light=true: the same sizes drawn on light grounds, for artwork that vanishes there (a white mark); absent where `variants` read on any ground. */
861
+ readonly light_variants?: readonly [
862
+ components["schemas"]["PictureVariant"],
863
+ components["schemas"]["PictureVariant"],
864
+ components["schemas"]["PictureVariant"]
865
+ ];
853
866
  /** @description The image's chromatic colors, most used first, for team and chart line colors; absent where imagery recorded none. A line wears its side's `own` subject's palette when that subject has an image, or, when it is a chart's only line and its side's own subject has none, `market`'s; a line whose `pick` is a glyph wears none. */
854
867
  readonly palette?: readonly [
855
868
  components["schemas"]["OklchColor"],
@@ -19,6 +19,8 @@ export type paths = {
19
19
  readonly "/v1/hypercore/portfolio": Pick<SharedPaths["/v1/hypercore/portfolio"], "parameters" | "get">;
20
20
  readonly "/v1/hypercore/settlement-credits": Pick<SharedPaths["/v1/hypercore/settlement-credits"], "parameters" | "get">;
21
21
  readonly "/v1/hypercore/orders": Pick<SharedPaths["/v1/hypercore/orders"], "parameters" | "get">;
22
+ readonly "/v1/hypercore/orders/{cloid}": Pick<SharedPaths["/v1/hypercore/orders/{cloid}"], "parameters" | "get">;
23
+ readonly "/v1/hypercore/order-history": Pick<SharedPaths["/v1/hypercore/order-history"], "parameters" | "get">;
22
24
  readonly "/v1/hypercore/positions": Pick<SharedPaths["/v1/hypercore/positions"], "parameters" | "get">;
23
25
  readonly "/v1/me": Pick<SharedPaths["/v1/me"], "parameters" | "get">;
24
26
  readonly "/v1/me/embedded-wallet": Pick<SharedPaths["/v1/me/embedded-wallet"], "parameters" | "post">;
@@ -131,6 +133,7 @@ export type paths = {
131
133
  readonly "/v1/perp-marks": Pick<SharedPaths["/v1/perp-marks"], "parameters" | "get">;
132
134
  readonly "/v1/charts/{series}": Pick<SharedPaths["/v1/charts/{series}"], "parameters" | "get">;
133
135
  readonly "/v1/live-marks": Pick<SharedPaths["/v1/live-marks"], "parameters" | "get">;
136
+ readonly "/v1/polymarket/markets/{outcome_id}": Pick<SharedPaths["/v1/polymarket/markets/{outcome_id}"], "parameters" | "get">;
134
137
  readonly "/v1/rfqs/{rfq_id}": Pick<SharedPaths["/v1/rfqs/{rfq_id}"], "parameters" | "get">;
135
138
  readonly "/v1/rfqs/{rfq_id}/cancel": Pick<SharedPaths["/v1/rfqs/{rfq_id}/cancel"], "parameters" | "post">;
136
139
  readonly "/v1/me/balances": Pick<SharedPaths["/v1/me/balances"], "parameters" | "get">;
@@ -153,4 +156,4 @@ export type paths = {
153
156
  readonly "/v1/makers/{maker_id}/exposure": Pick<SharedPaths["/v1/makers/{maker_id}/exposure"], "parameters" | "get">;
154
157
  readonly "/v1/makers/{maker_id}/performance": Pick<SharedPaths["/v1/makers/{maker_id}/performance"], "parameters" | "get">;
155
158
  };
156
- export type operations = Pick<SharedOperations, "abandonCoreExit" | "acceptQuote" | "activeCoreExits" | "admitOwnMaker" | "admitPartnerWallet" | "approveWallet" | "bindEmbeddedWallet" | "cancelRfq" | "claimGoldenLink" | "confirmComboCopyAgent" | "confirmCoreCopyAgent" | "createCashout" | "createComment" | "createCoreExit" | "createDeposit" | "createGoldenRfq" | "createRfq" | "createRunOffClaim" | "createWalletChallenge" | "createWalletSession" | "createWithdrawal" | "declineGolden" | "deleteComment" | "editComment" | "endWalletSession" | "followTrader" | "getAcceptance" | "getAccountActivity" | "getAccountPnl" | "getAccountPosition" | "getAccountValue" | "getBalances" | "getChart" | "getCopyAgents" | "getCopyBudget" | "getCopySettings" | "getCopySummary" | "getCoreExit" | "getDeployment" | "getGenesis" | "getGolden" | "getGoldenLinkSuggestions" | "getGoldenMarkets" | "getGoldenOffer" | "getGoldenSuggestions" | "getHypercoreBalance" | "getHypercoreOrders" | "getHypercorePortfolio" | "getHypercoreSettlementCredits" | "getIdentity" | "getLiveMarks" | "getMakerActivity" | "getMakerCapital" | "getMakerExposure" | "getMakerPerformance" | "getMakerPosition" | "getMakerQuotes" | "getMakerTelemetry" | "getMakerVaultFundingTransaction" | "getMakerWithdrawal" | "getMarket" | "getMarketDataConfig" | "getMarketDefinitions" | "getMarketDisplay" | "getMarketRecurringRound" | "getMarketReferenceCloses" | "getMarketResults" | "getMarketRoundHistory" | "getMarketScoreTimeline" | "getMarketStats" | "getMyGenesis" | "getMyReferralBonus" | "getMyTradingRewards" | "getOperation" | "getOutcomeMetadata" | "getOwnMaker" | "getPartnerAccountValue" | "getPartnerReport" | "getPerpMarks" | "getPicture" | "getProfitLeaderboard" | "getPublicGoldenMarkets" | "getQuestion" | "getQuestionRecurringRound" | "getQuestionScoreTimeline" | "getRfq" | "getSeries" | "getSocialLeaderboard" | "getSocialPerson" | "getSocialPosition" | "getSuggestedCombo" | "getTaxonomy" | "getTrader" | "getTraderPnl" | "getUsernameAvailability" | "getVaultAgents" | "getVolumeLeaderboard" | "getWalletApproval" | "getWithdrawal" | "grantComboCopyAgent" | "grantVaultAgent" | "likeComment" | "listAccountActivity" | "listAccountPositions" | "listComboCopies" | "listComboFeed" | "listCommentReplies" | "listComments" | "listControlledMakers" | "listCopiedFills" | "listCopyTrades" | "listDiscovery" | "listFollowers" | "listFollowingFeed" | "listFollowingPositions" | "listFollows" | "listHypercorePositions" | "listMakerActivity" | "listMakerPositions" | "listMakerQuoteHistory" | "listMarketTrades" | "listMarkets" | "listMyNotifications" | "listOperations" | "listPartnerFills" | "listPartnerWebhookEvents" | "listQuotes" | "listSocialActivity" | "listSocialFeed" | "listSocialFollowers" | "listSocialFollowing" | "listSocialPositions" | "listTraderPositions" | "listTraderTrades" | "markMyNotificationsRead" | "placeGolden" | "reactComment" | "recordAcquisition" | "recordCopiedTrade" | "recordGoldenTelegramClick" | "refreshPicture" | "removeUploadedPicture" | "requestComboCopyAgent" | "requestCoreCopyAgent" | "revokeComboCopyAgent" | "searchCatalog" | "searchTraders" | "setAvatar" | "setCopyAllocation" | "setCopySettings" | "setPublicProfile" | "setUsername" | "setXHandleShown" | "setXPictureShown" | "signGoldenGift" | "stream" | "streamMarkets" | "switchOffComboCopyAgent" | "switchOffCoreCopyAgent" | "unfollowTrader" | "unlikeComment" | "unlockGolden" | "unreactComment" | "uploadPicture">;
159
+ export type operations = Pick<SharedOperations, "abandonCoreExit" | "acceptQuote" | "activeCoreExits" | "admitOwnMaker" | "admitPartnerWallet" | "approveWallet" | "bindEmbeddedWallet" | "cancelRfq" | "claimGoldenLink" | "confirmComboCopyAgent" | "confirmCoreCopyAgent" | "createCashout" | "createComment" | "createCoreExit" | "createDeposit" | "createGoldenRfq" | "createRfq" | "createRunOffClaim" | "createWalletChallenge" | "createWalletSession" | "createWithdrawal" | "declineGolden" | "deleteComment" | "editComment" | "endWalletSession" | "followTrader" | "getAcceptance" | "getAccountActivity" | "getAccountPnl" | "getAccountPosition" | "getAccountValue" | "getBalances" | "getChart" | "getCopyAgents" | "getCopyBudget" | "getCopySettings" | "getCopySummary" | "getCoreExit" | "getDeployment" | "getGenesis" | "getGolden" | "getGoldenLinkSuggestions" | "getGoldenMarkets" | "getGoldenOffer" | "getGoldenSuggestions" | "getHypercoreBalance" | "getHypercoreOrderHistory" | "getHypercoreOrderProof" | "getHypercoreOrders" | "getHypercorePortfolio" | "getHypercoreSettlementCredits" | "getIdentity" | "getLiveMarks" | "getMakerActivity" | "getMakerCapital" | "getMakerExposure" | "getMakerPerformance" | "getMakerPosition" | "getMakerQuotes" | "getMakerTelemetry" | "getMakerVaultFundingTransaction" | "getMakerWithdrawal" | "getMarket" | "getMarketDataConfig" | "getMarketDefinitions" | "getMarketDisplay" | "getMarketRecurringRound" | "getMarketReferenceCloses" | "getMarketResults" | "getMarketRoundHistory" | "getMarketScoreTimeline" | "getMarketStats" | "getMyGenesis" | "getMyReferralBonus" | "getMyTradingRewards" | "getOperation" | "getOutcomeMetadata" | "getOwnMaker" | "getPartnerAccountValue" | "getPartnerReport" | "getPerpMarks" | "getPicture" | "getPolymarketMarket" | "getProfitLeaderboard" | "getPublicGoldenMarkets" | "getQuestion" | "getQuestionRecurringRound" | "getQuestionScoreTimeline" | "getRfq" | "getSeries" | "getSocialLeaderboard" | "getSocialPerson" | "getSocialPosition" | "getSuggestedCombo" | "getTaxonomy" | "getTrader" | "getTraderPnl" | "getUsernameAvailability" | "getVaultAgents" | "getVolumeLeaderboard" | "getWalletApproval" | "getWithdrawal" | "grantComboCopyAgent" | "grantVaultAgent" | "likeComment" | "listAccountActivity" | "listAccountPositions" | "listComboCopies" | "listComboFeed" | "listCommentReplies" | "listComments" | "listControlledMakers" | "listCopiedFills" | "listCopyTrades" | "listDiscovery" | "listFollowers" | "listFollowingFeed" | "listFollowingPositions" | "listFollows" | "listHypercorePositions" | "listMakerActivity" | "listMakerPositions" | "listMakerQuoteHistory" | "listMarketTrades" | "listMarkets" | "listMyNotifications" | "listOperations" | "listPartnerFills" | "listPartnerWebhookEvents" | "listQuotes" | "listSocialActivity" | "listSocialFeed" | "listSocialFollowers" | "listSocialFollowing" | "listSocialPositions" | "listTraderPositions" | "listTraderTrades" | "markMyNotificationsRead" | "placeGolden" | "reactComment" | "recordAcquisition" | "recordCopiedTrade" | "recordGoldenTelegramClick" | "refreshPicture" | "removeUploadedPicture" | "requestComboCopyAgent" | "requestCoreCopyAgent" | "revokeComboCopyAgent" | "searchCatalog" | "searchTraders" | "setAvatar" | "setCopyAllocation" | "setCopySettings" | "setPublicProfile" | "setUsername" | "setXHandleShown" | "setXPictureShown" | "signGoldenGift" | "stream" | "streamMarkets" | "switchOffComboCopyAgent" | "switchOffCoreCopyAgent" | "unfollowTrader" | "unlikeComment" | "unlockGolden" | "unreactComment" | "uploadPicture">;
@@ -605,6 +605,8 @@ export declare const operationErrors: {
605
605
  readonly getGoldenOffer: readonly ["UNAUTHENTICATED", "FORBIDDEN", "AUTHORIZATION_UNAVAILABLE", "DEPENDENCY_STALE", "RATE_LIMITED", "ORIGIN_REQUIRED", "IDENTITY_NOT_FOUND", "INVALID_QUERY", "NOT_FOUND", "QUOTE_EXPIRED", "CONTRACT_UNAVAILABLE", "FINANCIAL_ACTIONS_DISABLED", "GOLDEN_UNLOCK_REQUIRED", "GOLDEN_TICKET_EXPIRED", "INTERNAL_ERROR"];
606
606
  readonly getGoldenSuggestions: readonly ["UNAUTHENTICATED", "FORBIDDEN", "AUTHORIZATION_UNAVAILABLE", "DEPENDENCY_STALE", "RATE_LIMITED", "ORIGIN_REQUIRED", "IDENTITY_NOT_FOUND", "INVALID_QUERY", "CONTRACT_UNAVAILABLE", "GOLDEN_TICKET_NONE", "GOLDEN_UNLOCK_REQUIRED", "GOLDEN_TICKET_USED", "GOLDEN_TICKET_EXPIRED", "GOLDEN_PLACEMENT_IN_FLIGHT", "BROWSE_UNAVAILABLE", "INTERNAL_ERROR"];
607
607
  readonly getHypercoreBalance: readonly ["UNAUTHENTICATED", "FORBIDDEN", "AUTHORIZATION_UNAVAILABLE", "DEPENDENCY_STALE", "RATE_LIMITED", "ORIGIN_REQUIRED", "INVALID_REQUEST", "IDENTITY_NOT_FOUND", "INTERNAL_ERROR"];
608
+ readonly getHypercoreOrderHistory: readonly ["UNAUTHENTICATED", "FORBIDDEN", "AUTHORIZATION_UNAVAILABLE", "DEPENDENCY_STALE", "RATE_LIMITED", "ORIGIN_REQUIRED", "INVALID_REQUEST", "IDENTITY_NOT_FOUND", "INTERNAL_ERROR"];
609
+ readonly getHypercoreOrderProof: readonly ["UNAUTHENTICATED", "FORBIDDEN", "AUTHORIZATION_UNAVAILABLE", "DEPENDENCY_STALE", "RATE_LIMITED", "ORIGIN_REQUIRED", "INVALID_QUERY", "INVALID_REQUEST", "IDENTITY_NOT_FOUND", "INTERNAL_ERROR"];
608
610
  readonly getHypercoreOrders: readonly ["UNAUTHENTICATED", "FORBIDDEN", "AUTHORIZATION_UNAVAILABLE", "DEPENDENCY_STALE", "RATE_LIMITED", "ORIGIN_REQUIRED", "INVALID_REQUEST", "IDENTITY_NOT_FOUND", "INTERNAL_ERROR"];
609
611
  readonly getHypercorePortfolio: readonly ["UNAUTHENTICATED", "FORBIDDEN", "AUTHORIZATION_UNAVAILABLE", "DEPENDENCY_STALE", "RATE_LIMITED", "INVALID_REQUEST", "IDENTITY_NOT_FOUND", "INTERNAL_ERROR"];
610
612
  readonly getHypercoreSettlementCredits: readonly ["UNAUTHENTICATED", "FORBIDDEN", "AUTHORIZATION_UNAVAILABLE", "DEPENDENCY_STALE", "RATE_LIMITED", "INVALID_REQUEST", "IDENTITY_NOT_FOUND", "INTERNAL_ERROR"];
@@ -642,6 +644,7 @@ export declare const operationErrors: {
642
644
  readonly getPerpMarks: readonly ["NOT_FOUND", "MARKET_DATA_UNAVAILABLE", "INVALID_QUERY", "INTERNAL_ERROR"];
643
645
  readonly getPersonalApiKeyCapabilities: readonly ["UNAUTHENTICATED", "FORBIDDEN", "AUTHORIZATION_UNAVAILABLE", "DEPENDENCY_STALE", "RATE_LIMITED", "INVALID_REQUEST", "NOT_FOUND", "INTERNAL_ERROR"];
644
646
  readonly getPicture: readonly ["NOT_FOUND", "RATE_LIMITED", "SOURCE_UNAVAILABLE", "INTERNAL_ERROR"];
647
+ readonly getPolymarketMarket: readonly ["INVALID_REQUEST", "NOT_FOUND", "MARKET_DATA_UNAVAILABLE", "INVALID_QUERY", "INTERNAL_ERROR"];
645
648
  readonly getProfitLeaderboard: readonly ["UNAUTHENTICATED", "FORBIDDEN", "AUTHORIZATION_UNAVAILABLE", "DEPENDENCY_STALE", "RATE_LIMITED", "INVALID_QUERY", "CONTRACT_UNAVAILABLE", "IDENTITY_NOT_FOUND", "INTERNAL_ERROR"];
646
649
  readonly getPublicGoldenMarkets: readonly ["UNAUTHENTICATED", "FORBIDDEN", "AUTHORIZATION_UNAVAILABLE", "RATE_LIMITED", "INVALID_QUERY", "CONTRACT_UNAVAILABLE", "BROWSE_UNAVAILABLE", "INTERNAL_ERROR"];
647
650
  readonly getQuestion: readonly ["INVALID_REQUEST", "NOT_FOUND", "MARKET_DATA_UNAVAILABLE", "INVALID_QUERY", "INTERNAL_ERROR"];
@@ -1326,6 +1326,29 @@ export const operationErrors = {
1326
1326
  "IDENTITY_NOT_FOUND",
1327
1327
  "INTERNAL_ERROR"
1328
1328
  ],
1329
+ "getHypercoreOrderHistory": [
1330
+ "UNAUTHENTICATED",
1331
+ "FORBIDDEN",
1332
+ "AUTHORIZATION_UNAVAILABLE",
1333
+ "DEPENDENCY_STALE",
1334
+ "RATE_LIMITED",
1335
+ "ORIGIN_REQUIRED",
1336
+ "INVALID_REQUEST",
1337
+ "IDENTITY_NOT_FOUND",
1338
+ "INTERNAL_ERROR"
1339
+ ],
1340
+ "getHypercoreOrderProof": [
1341
+ "UNAUTHENTICATED",
1342
+ "FORBIDDEN",
1343
+ "AUTHORIZATION_UNAVAILABLE",
1344
+ "DEPENDENCY_STALE",
1345
+ "RATE_LIMITED",
1346
+ "ORIGIN_REQUIRED",
1347
+ "INVALID_QUERY",
1348
+ "INVALID_REQUEST",
1349
+ "IDENTITY_NOT_FOUND",
1350
+ "INTERNAL_ERROR"
1351
+ ],
1329
1352
  "getHypercoreOrders": [
1330
1353
  "UNAUTHENTICATED",
1331
1354
  "FORBIDDEN",
@@ -1684,6 +1707,13 @@ export const operationErrors = {
1684
1707
  "SOURCE_UNAVAILABLE",
1685
1708
  "INTERNAL_ERROR"
1686
1709
  ],
1710
+ "getPolymarketMarket": [
1711
+ "INVALID_REQUEST",
1712
+ "NOT_FOUND",
1713
+ "MARKET_DATA_UNAVAILABLE",
1714
+ "INVALID_QUERY",
1715
+ "INTERNAL_ERROR"
1716
+ ],
1687
1717
  "getProfitLeaderboard": [
1688
1718
  "UNAUTHENTICATED",
1689
1719
  "FORBIDDEN",
@@ -32,6 +32,7 @@ export type paths = {
32
32
  readonly "/v1/market-display": Pick<SharedPaths["/v1/market-display"], "parameters" | "get">;
33
33
  readonly "/v1/market-results": Pick<SharedPaths["/v1/market-results"], "parameters" | "get">;
34
34
  readonly "/v1/charts/{series}": Pick<SharedPaths["/v1/charts/{series}"], "parameters" | "get">;
35
+ readonly "/v1/polymarket/markets/{outcome_id}": Pick<SharedPaths["/v1/polymarket/markets/{outcome_id}"], "parameters" | "get">;
35
36
  readonly "/v1/rfqs/{rfq_id}": Pick<SharedPaths["/v1/rfqs/{rfq_id}"], "parameters" | "get">;
36
37
  readonly "/v1/me/operations": Pick<SharedPaths["/v1/me/operations"], "parameters" | "get">;
37
38
  readonly "/v1/me/operations/{operation_id}": Pick<SharedPaths["/v1/me/operations/{operation_id}"], "parameters" | "get">;
@@ -46,4 +47,4 @@ export type paths = {
46
47
  readonly "/v1/makers/{maker_id}/exposure": Pick<SharedPaths["/v1/makers/{maker_id}/exposure"], "parameters" | "get">;
47
48
  readonly "/v1/makers/{maker_id}/performance": Pick<SharedPaths["/v1/makers/{maker_id}/performance"], "parameters" | "get">;
48
49
  };
49
- export type operations = Pick<SharedOperations, "cancelAllQuotes" | "cancelQuote" | "confirmQuote" | "createCollateralReduction" | "createQuote" | "getAccountActivity" | "getAccountPosition" | "getChart" | "getCollateralReduction" | "getDeployment" | "getMakerActivity" | "getMakerCapital" | "getMakerExposure" | "getMakerPerformance" | "getMakerPosition" | "getMakerQuotes" | "getMakerTelemetry" | "getMakerTelemetryPublication" | "getMakerVaultFundingTransaction" | "getMakerWithdrawal" | "getMarket" | "getMarketDisplay" | "getMarketRecurringRound" | "getMarketReferenceCloses" | "getMarketResults" | "getMarketRoundHistory" | "getOperation" | "getQuestion" | "getQuestionRecurringRound" | "getRfq" | "getSeries" | "getTaxonomy" | "listAccountActivity" | "listAccountPositions" | "listDiscovery" | "listMakerAcceptances" | "listMakerActivity" | "listMakerPositions" | "listMakerQuoteHistory" | "listMarkets" | "listOperations" | "listRfqs" | "publishMakerTelemetry" | "searchCatalog" | "stream" | "submitMakerSelfFundedTransaction">;
50
+ export type operations = Pick<SharedOperations, "cancelAllQuotes" | "cancelQuote" | "confirmQuote" | "createCollateralReduction" | "createQuote" | "getAccountActivity" | "getAccountPosition" | "getChart" | "getCollateralReduction" | "getDeployment" | "getMakerActivity" | "getMakerCapital" | "getMakerExposure" | "getMakerPerformance" | "getMakerPosition" | "getMakerQuotes" | "getMakerTelemetry" | "getMakerTelemetryPublication" | "getMakerVaultFundingTransaction" | "getMakerWithdrawal" | "getMarket" | "getMarketDisplay" | "getMarketRecurringRound" | "getMarketReferenceCloses" | "getMarketResults" | "getMarketRoundHistory" | "getOperation" | "getPolymarketMarket" | "getQuestion" | "getQuestionRecurringRound" | "getRfq" | "getSeries" | "getTaxonomy" | "listAccountActivity" | "listAccountPositions" | "listDiscovery" | "listMakerAcceptances" | "listMakerActivity" | "listMakerPositions" | "listMakerQuoteHistory" | "listMarkets" | "listOperations" | "listRfqs" | "publishMakerTelemetry" | "searchCatalog" | "stream" | "submitMakerSelfFundedTransaction">;