@dimes-dot-fi/sdk 1.0.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/dist/chunk-BRANC7OH.mjs +283 -0
- package/dist/chunk-BRANC7OH.mjs.map +1 -0
- package/dist/chunk-JGK55KDX.cjs +283 -0
- package/dist/chunk-JGK55KDX.cjs.map +1 -0
- package/dist/chunk-LQ5LLBR6.mjs +312 -0
- package/dist/chunk-LQ5LLBR6.mjs.map +1 -0
- package/dist/chunk-XXTTXLCT.cjs +312 -0
- package/dist/chunk-XXTTXLCT.cjs.map +1 -0
- package/dist/contract/index.cjs +670 -0
- package/dist/contract/index.cjs.map +1 -0
- package/dist/contract/index.d.cts +83 -0
- package/dist/contract/index.d.ts +83 -0
- package/dist/contract/index.mjs +670 -0
- package/dist/contract/index.mjs.map +1 -0
- package/dist/dimes-client-BLIAuK4M.d.cts +1241 -0
- package/dist/dimes-client-BLIAuK4M.d.ts +1241 -0
- package/dist/dimes-error-BtDMi3Kv.d.ts +26 -0
- package/dist/dimes-error-DxzsfQo6.d.cts +26 -0
- package/dist/index.cjs +275 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +21 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.mjs +275 -0
- package/dist/index.mjs.map +1 -0
- package/dist/quote-ByZJRoPf.d.cts +29 -0
- package/dist/quote-CgmTKnIZ.d.ts +29 -0
- package/dist/react/index.cjs +166 -0
- package/dist/react/index.cjs.map +1 -0
- package/dist/react/index.d.cts +41 -0
- package/dist/react/index.d.ts +41 -0
- package/dist/react/index.mjs +166 -0
- package/dist/react/index.mjs.map +1 -0
- package/package.json +111 -0
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
// src/utils/parse.ts
|
|
2
|
+
function asNumber(value) {
|
|
3
|
+
if (typeof value === "number" && Number.isFinite(value)) {
|
|
4
|
+
return value;
|
|
5
|
+
}
|
|
6
|
+
if (typeof value === "string" && value.trim() !== "") {
|
|
7
|
+
const parsed = Number(value);
|
|
8
|
+
if (Number.isFinite(parsed)) {
|
|
9
|
+
return parsed;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
function asBigInt(value) {
|
|
15
|
+
if (typeof value === "bigint") {
|
|
16
|
+
return value;
|
|
17
|
+
}
|
|
18
|
+
if (typeof value === "string" && /^-?\d+$/.test(value.trim())) {
|
|
19
|
+
return BigInt(value.trim());
|
|
20
|
+
}
|
|
21
|
+
if (typeof value === "number" && Number.isInteger(value)) {
|
|
22
|
+
return BigInt(value);
|
|
23
|
+
}
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
function getParam(params, key) {
|
|
27
|
+
return params ? params[key] : void 0;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// src/utils/format.ts
|
|
31
|
+
var BPS_PER_UNIT = 1e4;
|
|
32
|
+
var BPS_PER_PCT = 100;
|
|
33
|
+
var FRACTION_TO_PCT = 100;
|
|
34
|
+
var PIPS_PER_USD = 1000000n;
|
|
35
|
+
var ROUNDING_OFFSET = 5000n;
|
|
36
|
+
var CENTS_DIVISOR = 10000n;
|
|
37
|
+
var CENTS_PAD = 2;
|
|
38
|
+
function formatLeverage(value) {
|
|
39
|
+
const n = asNumber(value);
|
|
40
|
+
if (n === null) {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
return `${(n / BPS_PER_UNIT).toLocaleString(void 0, { maximumFractionDigits: 2 })}x`;
|
|
44
|
+
}
|
|
45
|
+
function formatBpsPct(value) {
|
|
46
|
+
const n = asNumber(value);
|
|
47
|
+
if (n === null) {
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
return `${(n / BPS_PER_PCT).toLocaleString(void 0, { maximumFractionDigits: 2 })}%`;
|
|
51
|
+
}
|
|
52
|
+
function formatFractionPct(value) {
|
|
53
|
+
const n = asNumber(value);
|
|
54
|
+
if (n === null) {
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
return `${(n * FRACTION_TO_PCT).toLocaleString(void 0, { maximumFractionDigits: 1 })}%`;
|
|
58
|
+
}
|
|
59
|
+
function formatPipsUsd(value) {
|
|
60
|
+
const big = asBigInt(value);
|
|
61
|
+
if (big === null) {
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
const negative = big < 0n;
|
|
65
|
+
const absUnits = negative ? -big : big;
|
|
66
|
+
const whole = absUnits / PIPS_PER_USD;
|
|
67
|
+
const frac = absUnits % PIPS_PER_USD;
|
|
68
|
+
const cents = (frac + ROUNDING_OFFSET) / CENTS_DIVISOR;
|
|
69
|
+
const formatted = `$${whole.toLocaleString()}.${cents.toString().padStart(CENTS_PAD, "0")}`;
|
|
70
|
+
return negative ? `-${formatted}` : formatted;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// src/errors/error-messages.ts
|
|
74
|
+
var friendlyByCode = {
|
|
75
|
+
invalid_evm_address: "Invalid EVM address.",
|
|
76
|
+
invalid_solana_address: "Invalid Solana address.",
|
|
77
|
+
invalid_string_for_chain_address: "Invalid wallet address for the selected chain.",
|
|
78
|
+
invalid_wallet_address: "Invalid wallet address.",
|
|
79
|
+
customer_auth_invalid_wallet_address: "Invalid wallet address.",
|
|
80
|
+
unauthorized: "Session expired. Please reconnect your wallet.",
|
|
81
|
+
forbidden: "You do not have access to this resource.",
|
|
82
|
+
array_out_of_bounds: "Internal indexing error. Please try again.",
|
|
83
|
+
batch_compute_not_available: "Cached pricing is temporarily unavailable. Try again shortly.",
|
|
84
|
+
internal_server_error: "Something went wrong on our side. Please try again.",
|
|
85
|
+
unexpected_error: "Something went wrong. Please try again.",
|
|
86
|
+
provider_not_available: "Upstream provider is unavailable. Try again shortly.",
|
|
87
|
+
request_already_in_progress: "A previous request is still in flight. Wait for it to complete and try again.",
|
|
88
|
+
math_error: "A numeric calculation failed. Please try again.",
|
|
89
|
+
invalid_number: "Invalid numeric value in request.",
|
|
90
|
+
invalid_message: "Received an invalid upstream message.",
|
|
91
|
+
invalid_filter_combination: "That combination of filters is not supported.",
|
|
92
|
+
cancel_position_delay_not_elapsed: "Cancel delay has not elapsed yet. Try again shortly.",
|
|
93
|
+
cancel_position_transaction_failed: "Cancel transaction failed on-chain.",
|
|
94
|
+
cancel_position_not_found: "Position not found.",
|
|
95
|
+
cancel_position_not_in_created_state: "This position can only be cancelled before it has filled.",
|
|
96
|
+
cancel_position_not_on_polygon: "Cancel is only supported for Polygon positions.",
|
|
97
|
+
customer_cancel_position_evm_only: "Cancel is only supported for EVM positions.",
|
|
98
|
+
customer_cancel_position_not_cancellable: "This position can no longer be cancelled.",
|
|
99
|
+
customer_cancel_position_not_owner: "You do not own this position.",
|
|
100
|
+
customer_cancel_position_not_found: "Position not found.",
|
|
101
|
+
circuit_breaker_price_divergence_tripped: "Trading is temporarily paused due to price divergence. Try again shortly.",
|
|
102
|
+
customer_market_not_found: "Market not found.",
|
|
103
|
+
customer_position_not_found: "Position not found.",
|
|
104
|
+
close_position_transaction_failed: "Close transaction failed on-chain.",
|
|
105
|
+
close_position_transaction_not_found: "Close transaction not found.",
|
|
106
|
+
finalize_close_transaction_failed: "Finalising the close transaction failed.",
|
|
107
|
+
close_no_open_position_transaction: "No open transaction found for this position.",
|
|
108
|
+
close_no_request_close_transaction: "No close request found for this position.",
|
|
109
|
+
close_polymarket_order_failed: "Polymarket close order failed.",
|
|
110
|
+
close_polymarket_order_retry_failed: "Polymarket close order failed after retries.",
|
|
111
|
+
close_position_already_closed: "This position is already closed.",
|
|
112
|
+
close_position_has_no_tokens: "This position has no tokens to close.",
|
|
113
|
+
close_position_not_found: "Position not found.",
|
|
114
|
+
close_position_not_originated: "Position has not been originated yet \u2014 nothing to close.",
|
|
115
|
+
exchange_order_submission_locked: "Order submission is temporarily locked. Try again shortly.",
|
|
116
|
+
quote_partner_position_limit_exceeded: (params) => {
|
|
117
|
+
const available = formatPipsUsd(getParam(params, "availableCapacityUsdPips"));
|
|
118
|
+
return available ? `Partner position limit reached. Remaining capacity: ${available}.` : "Partner position limit reached. Try a smaller size.";
|
|
119
|
+
},
|
|
120
|
+
quote_user_position_limit_exceeded: (params) => {
|
|
121
|
+
const available = formatPipsUsd(getParam(params, "availableCapacityUsdPips"));
|
|
122
|
+
return available ? `You have reached your position limit on this market. Remaining capacity: ${available}.` : "You have reached your position limit on this market.";
|
|
123
|
+
},
|
|
124
|
+
quote_market_position_limit_exceeded: (params) => {
|
|
125
|
+
const available = formatPipsUsd(getParam(params, "availableCapacityUsdPips"));
|
|
126
|
+
return available ? `This market has reached its open-interest cap. Remaining capacity: ${available}.` : "This market has reached its open-interest cap. Try a smaller size or another market.";
|
|
127
|
+
},
|
|
128
|
+
quote_global_position_limit_exceeded: (params) => {
|
|
129
|
+
const available = formatPipsUsd(getParam(params, "availableCapacityUsdPips"));
|
|
130
|
+
return available ? `Global position limit reached. Remaining capacity: ${available}.` : "Global position limit reached. Try again shortly.";
|
|
131
|
+
},
|
|
132
|
+
quote_side_position_limit_exceeded: (params) => {
|
|
133
|
+
const available = formatPipsUsd(getParam(params, "availableCapacityUsdPips"));
|
|
134
|
+
return available ? `This side of the market is at its position limit. Remaining capacity: ${available}.` : "This side of the market is at its position limit. Try the other side or a smaller size.";
|
|
135
|
+
},
|
|
136
|
+
quote_side_capacity_exceeded: (params) => {
|
|
137
|
+
const maxCollateral = formatPipsUsd(getParam(params, "maxSupportedCollateralUsdPips"));
|
|
138
|
+
return maxCollateral ? `Not enough capacity on this side of the market. Max supported collateral at this size: ${maxCollateral}.` : "Not enough capacity on this side of the market for that size.";
|
|
139
|
+
},
|
|
140
|
+
quote_position_limit_exceeded: "Position limit reached for this request.",
|
|
141
|
+
quote_insufficient_liquidity: "Not enough liquidity on the order book to fill this size.",
|
|
142
|
+
quote_slippage_too_high: (params) => {
|
|
143
|
+
const max = formatBpsPct(getParam(params, "maxSlippageBps"));
|
|
144
|
+
const current = formatBpsPct(getParam(params, "currentSlippageBps"));
|
|
145
|
+
if (max && current) {
|
|
146
|
+
return `Required slippage ${current} exceeds your tolerance (${max}). Reduce size or raise tolerance.`;
|
|
147
|
+
}
|
|
148
|
+
if (max) {
|
|
149
|
+
return `Required slippage exceeds your tolerance (${max}). Reduce size or raise tolerance.`;
|
|
150
|
+
}
|
|
151
|
+
return "Price would move too far to fill this order. Reduce size or raise your slippage tolerance.";
|
|
152
|
+
},
|
|
153
|
+
quote_event_not_started: "This event has not started yet. Trading opens at the scheduled start time.",
|
|
154
|
+
quote_entry_bid_depth_too_low: "Order book depth on the entry side is too thin to open this position safely.",
|
|
155
|
+
quote_entry_capacity_exceeded: "Entry size exceeds the market's available capacity.",
|
|
156
|
+
quote_entry_depth_too_low: "Order book depth is too thin to open this position safely.",
|
|
157
|
+
quote_entry_spread_too_wide: "Bid/ask spread is too wide to open right now. Try again shortly.",
|
|
158
|
+
quote_entry_order_book_stale: "Order book data is stale. Refresh and try again.",
|
|
159
|
+
quote_entry_price_stale: "Price data is stale. Refresh and try again.",
|
|
160
|
+
quote_entry_crypto_price_stale: "Crypto price data is stale. Refresh and try again.",
|
|
161
|
+
quote_entry_sport_data_stale: "Sport event data is stale. Refresh and try again.",
|
|
162
|
+
quote_entry_volume_too_low: "Recent traded volume on this market is too low to open new positions.",
|
|
163
|
+
quote_entry_top_holder_too_high: "A single trader holds too much of this market. Opening here is restricted.",
|
|
164
|
+
quote_entry_price_out_of_range: "Current price is outside the range we can open at. Try again shortly.",
|
|
165
|
+
quote_entry_exit_drop_too_high: "Exit liquidity is too thin to safely open this size.",
|
|
166
|
+
quote_entry_market_too_elapsed: (params) => {
|
|
167
|
+
const elapsed = formatFractionPct(getParam(params, "pctElapsed"));
|
|
168
|
+
const max = formatFractionPct(getParam(params, "maxPctElapsed"));
|
|
169
|
+
if (elapsed && max) {
|
|
170
|
+
return `Market is ${elapsed} elapsed (max ${max}). Too close to resolution to open new positions.`;
|
|
171
|
+
}
|
|
172
|
+
return "Market is too close to resolution to open new positions.";
|
|
173
|
+
},
|
|
174
|
+
quote_entry_excluded_market_type: "This market type is not supported for leveraged positions.",
|
|
175
|
+
quote_entry_excluded_sport: "This sport is not supported for leveraged positions.",
|
|
176
|
+
quote_price_too_low: "Underlying price is too low to open a leveraged position.",
|
|
177
|
+
quote_open_interest_unavailable: "Open-interest data is unavailable right now. Try again shortly.",
|
|
178
|
+
quote_leverage_below_minimum: (params) => {
|
|
179
|
+
const min = formatLeverage(getParam(params, "minLeverageBps"));
|
|
180
|
+
const current = formatLeverage(getParam(params, "currentLeverageBps"));
|
|
181
|
+
if (min && current) {
|
|
182
|
+
return `Leverage ${current} is below the minimum allowed (${min}).`;
|
|
183
|
+
}
|
|
184
|
+
if (min) {
|
|
185
|
+
return `Leverage is below the minimum allowed (${min}).`;
|
|
186
|
+
}
|
|
187
|
+
return "Leverage is below the minimum allowed for this market.";
|
|
188
|
+
},
|
|
189
|
+
quote_leverage_exceeds_maximum: (params) => {
|
|
190
|
+
const max = formatLeverage(getParam(params, "maxLeverageBps"));
|
|
191
|
+
const current = formatLeverage(getParam(params, "currentLeverageBps"));
|
|
192
|
+
if (max && current) {
|
|
193
|
+
return `Leverage ${current} is above the maximum allowed (${max}).`;
|
|
194
|
+
}
|
|
195
|
+
if (max) {
|
|
196
|
+
return `Leverage is above the maximum allowed (${max}).`;
|
|
197
|
+
}
|
|
198
|
+
return "Leverage is above the maximum allowed for this market.";
|
|
199
|
+
},
|
|
200
|
+
quote_leverage_exceeds_model_max: (params) => {
|
|
201
|
+
const max = formatLeverage(getParam(params, "maxLeverageBps"));
|
|
202
|
+
const current = formatLeverage(getParam(params, "currentLeverageBps"));
|
|
203
|
+
if (max && current) {
|
|
204
|
+
return `Leverage ${current} exceeds the risk-model limit (${max}) for this market.`;
|
|
205
|
+
}
|
|
206
|
+
if (max) {
|
|
207
|
+
return `Leverage exceeds the risk-model limit (${max}) for this market.`;
|
|
208
|
+
}
|
|
209
|
+
return "Leverage exceeds the risk-model limit for this market.";
|
|
210
|
+
},
|
|
211
|
+
quote_leverage_too_high_for_price: (params) => {
|
|
212
|
+
const current = formatLeverage(getParam(params, "currentLeverageBps"));
|
|
213
|
+
const max = formatLeverage(getParam(params, "maxAcceptableLeverageBps"));
|
|
214
|
+
if (current && max) {
|
|
215
|
+
return `Leverage ${current} is too high for the current price. Maximum is ${max}.`;
|
|
216
|
+
}
|
|
217
|
+
if (current) {
|
|
218
|
+
return `Leverage ${current} is too high for the current price. Reduce leverage.`;
|
|
219
|
+
}
|
|
220
|
+
return "Leverage is too high for the current price. Reduce leverage.";
|
|
221
|
+
},
|
|
222
|
+
quote_hard_exit_too_close: "Hard-exit is too close to entry. Reduce leverage.",
|
|
223
|
+
quote_liquidation_not_viable: (params) => {
|
|
224
|
+
const tolerance = formatBpsPct(getParam(params, "minTolerancePctBps"));
|
|
225
|
+
return tolerance ? `Liquidation price is too close to entry (minimum buffer ${tolerance}). Reduce leverage.` : "Liquidation price is not viable at this leverage. Reduce leverage.";
|
|
226
|
+
},
|
|
227
|
+
quote_market_not_active: "Market is not active.",
|
|
228
|
+
quote_market_not_eligible: "Market is not eligible for leveraged trading.",
|
|
229
|
+
quote_market_not_ready: "Market is not ready yet. Try again shortly.",
|
|
230
|
+
quote_market_not_found: "Market not found.",
|
|
231
|
+
quote_market_risk_too_high: "Market risk is too high right now. Try again later.",
|
|
232
|
+
quote_market_unsupported_category: "This market category is not supported.",
|
|
233
|
+
quote_market_no_prices: "No price data available for this market.",
|
|
234
|
+
quote_market_missing_polymarket_condition_id: "This market is missing required Polymarket data.",
|
|
235
|
+
quote_polymarket_market_closed: "This Polymarket market is closed and not accepting new positions.",
|
|
236
|
+
quote_polymarket_market_inactive: "This Polymarket market is inactive and not accepting new positions.",
|
|
237
|
+
quote_polymarket_market_not_accepting_orders: "Polymarket is not accepting orders on this market right now. Try again shortly or pick another market.",
|
|
238
|
+
quote_polymarket_missing_token: "This Polymarket market is missing a tradable outcome token.",
|
|
239
|
+
quote_invalid_polymarket_wallet_address: "Invalid Polymarket wallet address.",
|
|
240
|
+
quote_invalid_kalshi_wallet_address: "Invalid Kalshi wallet address.",
|
|
241
|
+
kalshi_quote_market_closed: "This Kalshi market is closed.",
|
|
242
|
+
quote_draft_not_found: "This quote has expired or does not exist. Please request a new quote.",
|
|
243
|
+
quote_twap_data_stale: "Reference price (TWAP) is stale. Try again shortly.",
|
|
244
|
+
quote_twap_data_unavailable: "Reference price (TWAP) is unavailable for this market.",
|
|
245
|
+
quote_revision_required: "Quote needs to be refreshed before submitting.",
|
|
246
|
+
quote_price_provider_not_found: "No price provider configured for this market.",
|
|
247
|
+
notional_selector_insufficient_liquidity: "Not enough liquidity at the selected size.",
|
|
248
|
+
evm_gas_price_circuit_breaker: "EVM gas price is too high \u2014 trading is temporarily paused.",
|
|
249
|
+
evm_gas_price_spike: "EVM gas price spiked. Try again shortly.",
|
|
250
|
+
evm_simulation_failed: "Transaction simulation failed. The transaction would revert on-chain.",
|
|
251
|
+
evm_receipt_timeout: "Transaction confirmation timed out. Check status before retrying.",
|
|
252
|
+
evm_transaction_failed: "EVM transaction failed.",
|
|
253
|
+
position_transition_conflicting_operation: "Another operation on this position is in progress. Try again shortly.",
|
|
254
|
+
position_transition_invalid_state: "Position is not in a state that allows this action.",
|
|
255
|
+
quote_creation_disabled: "Quote creation is temporarily disabled. Try again shortly."
|
|
256
|
+
};
|
|
257
|
+
function humanizeCode(code) {
|
|
258
|
+
const spaced = code.replace(/_/g, " ");
|
|
259
|
+
return spaced.charAt(0).toUpperCase() + spaced.slice(1);
|
|
260
|
+
}
|
|
261
|
+
function resolveFriendlyMessage(code, params) {
|
|
262
|
+
const entry = friendlyByCode[code];
|
|
263
|
+
if (entry === void 0) {
|
|
264
|
+
return null;
|
|
265
|
+
}
|
|
266
|
+
return typeof entry === "function" ? entry(params) : entry;
|
|
267
|
+
}
|
|
268
|
+
function formatErrorMessage(code, params) {
|
|
269
|
+
return resolveFriendlyMessage(code, params) ?? humanizeCode(code);
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
// src/errors/dimes-error.ts
|
|
273
|
+
var DimesError = class extends Error {
|
|
274
|
+
code;
|
|
275
|
+
constructor(code, message) {
|
|
276
|
+
super(message);
|
|
277
|
+
this.name = "DimesError";
|
|
278
|
+
this.code = code;
|
|
279
|
+
}
|
|
280
|
+
};
|
|
281
|
+
var DimesApiError = class extends DimesError {
|
|
282
|
+
status;
|
|
283
|
+
type;
|
|
284
|
+
rawMessage;
|
|
285
|
+
params;
|
|
286
|
+
hint;
|
|
287
|
+
constructor(options) {
|
|
288
|
+
const friendly = resolveFriendlyMessage(options.code, options.params) ?? options.message;
|
|
289
|
+
super(options.code, friendly);
|
|
290
|
+
this.name = "DimesApiError";
|
|
291
|
+
this.status = options.status;
|
|
292
|
+
this.type = options.type;
|
|
293
|
+
this.rawMessage = options.message;
|
|
294
|
+
this.params = options.params;
|
|
295
|
+
this.hint = options.hint ?? null;
|
|
296
|
+
}
|
|
297
|
+
};
|
|
298
|
+
var DimesContractError = class extends DimesError {
|
|
299
|
+
constructor(code, message) {
|
|
300
|
+
super(code, message);
|
|
301
|
+
this.name = "DimesContractError";
|
|
302
|
+
}
|
|
303
|
+
};
|
|
304
|
+
|
|
305
|
+
export {
|
|
306
|
+
resolveFriendlyMessage,
|
|
307
|
+
formatErrorMessage,
|
|
308
|
+
DimesError,
|
|
309
|
+
DimesApiError,
|
|
310
|
+
DimesContractError
|
|
311
|
+
};
|
|
312
|
+
//# sourceMappingURL=chunk-LQ5LLBR6.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utils/parse.ts","../src/utils/format.ts","../src/errors/error-messages.ts","../src/errors/dimes-error.ts"],"sourcesContent":["export type Params = Record<string, unknown> | null;\n\nexport function asNumber(value: unknown): number | null {\n if (typeof value === \"number\" && Number.isFinite(value)) {\n return value;\n }\n if (typeof value === \"string\" && value.trim() !== \"\") {\n const parsed = Number(value);\n if (Number.isFinite(parsed)) {\n return parsed;\n }\n }\n return null;\n}\n\nexport function asBigInt(value: unknown): bigint | null {\n if (typeof value === \"bigint\") {\n return value;\n }\n if (typeof value === \"string\" && /^-?\\d+$/.test(value.trim())) {\n return BigInt(value.trim());\n }\n if (typeof value === \"number\" && Number.isInteger(value)) {\n return BigInt(value);\n }\n return null;\n}\n\nexport function getParam(params: Params, key: string): unknown {\n return params ? params[key] : undefined;\n}\n","import { asNumber, asBigInt } from \"./parse\";\n\nconst BPS_PER_UNIT = 10_000;\nconst BPS_PER_PCT = 100;\nconst FRACTION_TO_PCT = 100;\nconst PIPS_PER_USD = 1_000_000n;\nconst ROUNDING_OFFSET = 5_000n;\nconst CENTS_DIVISOR = 10_000n;\nconst CENTS_PAD = 2;\n\nexport function formatLeverage(value: unknown): string | null {\n const n = asNumber(value);\n if (n === null) {\n return null;\n }\n return `${(n / BPS_PER_UNIT).toLocaleString(undefined, { maximumFractionDigits: 2 })}x`;\n}\n\nexport function formatBpsPct(value: unknown): string | null {\n const n = asNumber(value);\n if (n === null) {\n return null;\n }\n return `${(n / BPS_PER_PCT).toLocaleString(undefined, { maximumFractionDigits: 2 })}%`;\n}\n\nexport function formatFractionPct(value: unknown): string | null {\n const n = asNumber(value);\n if (n === null) {\n return null;\n }\n return `${(n * FRACTION_TO_PCT).toLocaleString(undefined, { maximumFractionDigits: 1 })}%`;\n}\n\nexport function formatPipsUsd(value: unknown): string | null {\n const big = asBigInt(value);\n if (big === null) {\n return null;\n }\n const negative = big < 0n;\n const absUnits = negative ? -big : big;\n const whole = absUnits / PIPS_PER_USD;\n const frac = absUnits % PIPS_PER_USD;\n const cents = (frac + ROUNDING_OFFSET) / CENTS_DIVISOR;\n const formatted = `$${whole.toLocaleString()}.${cents.toString().padStart(CENTS_PAD, \"0\")}`;\n return negative ? `-${formatted}` : formatted;\n}\n","import { formatLeverage, formatBpsPct, formatFractionPct, formatPipsUsd } from \"../utils/format\";\nimport { type Params, getParam } from \"../utils/parse\";\n\ntype FriendlyEntry = string | ((params: Params) => string);\n\nconst friendlyByCode: Record<string, FriendlyEntry> = {\n invalid_evm_address: \"Invalid EVM address.\",\n invalid_solana_address: \"Invalid Solana address.\",\n invalid_string_for_chain_address: \"Invalid wallet address for the selected chain.\",\n invalid_wallet_address: \"Invalid wallet address.\",\n customer_auth_invalid_wallet_address: \"Invalid wallet address.\",\n\n unauthorized: \"Session expired. Please reconnect your wallet.\",\n forbidden: \"You do not have access to this resource.\",\n\n array_out_of_bounds: \"Internal indexing error. Please try again.\",\n batch_compute_not_available: \"Cached pricing is temporarily unavailable. Try again shortly.\",\n internal_server_error: \"Something went wrong on our side. Please try again.\",\n unexpected_error: \"Something went wrong. Please try again.\",\n provider_not_available: \"Upstream provider is unavailable. Try again shortly.\",\n request_already_in_progress: \"A previous request is still in flight. Wait for it to complete and try again.\",\n math_error: \"A numeric calculation failed. Please try again.\",\n invalid_number: \"Invalid numeric value in request.\",\n invalid_message: \"Received an invalid upstream message.\",\n invalid_filter_combination: \"That combination of filters is not supported.\",\n\n cancel_position_delay_not_elapsed: \"Cancel delay has not elapsed yet. Try again shortly.\",\n cancel_position_transaction_failed: \"Cancel transaction failed on-chain.\",\n cancel_position_not_found: \"Position not found.\",\n cancel_position_not_in_created_state: \"This position can only be cancelled before it has filled.\",\n cancel_position_not_on_polygon: \"Cancel is only supported for Polygon positions.\",\n customer_cancel_position_evm_only: \"Cancel is only supported for EVM positions.\",\n customer_cancel_position_not_cancellable: \"This position can no longer be cancelled.\",\n customer_cancel_position_not_owner: \"You do not own this position.\",\n customer_cancel_position_not_found: \"Position not found.\",\n\n circuit_breaker_price_divergence_tripped: \"Trading is temporarily paused due to price divergence. Try again shortly.\",\n\n customer_market_not_found: \"Market not found.\",\n customer_position_not_found: \"Position not found.\",\n\n close_position_transaction_failed: \"Close transaction failed on-chain.\",\n close_position_transaction_not_found: \"Close transaction not found.\",\n finalize_close_transaction_failed: \"Finalising the close transaction failed.\",\n close_no_open_position_transaction: \"No open transaction found for this position.\",\n close_no_request_close_transaction: \"No close request found for this position.\",\n close_polymarket_order_failed: \"Polymarket close order failed.\",\n close_polymarket_order_retry_failed: \"Polymarket close order failed after retries.\",\n close_position_already_closed: \"This position is already closed.\",\n close_position_has_no_tokens: \"This position has no tokens to close.\",\n close_position_not_found: \"Position not found.\",\n close_position_not_originated: \"Position has not been originated yet — nothing to close.\",\n\n exchange_order_submission_locked: \"Order submission is temporarily locked. Try again shortly.\",\n\n quote_partner_position_limit_exceeded: (params) => {\n const available = formatPipsUsd(getParam(params, \"availableCapacityUsdPips\"));\n return available\n ? `Partner position limit reached. Remaining capacity: ${available}.`\n : \"Partner position limit reached. Try a smaller size.\";\n },\n quote_user_position_limit_exceeded: (params) => {\n const available = formatPipsUsd(getParam(params, \"availableCapacityUsdPips\"));\n return available\n ? `You have reached your position limit on this market. Remaining capacity: ${available}.`\n : \"You have reached your position limit on this market.\";\n },\n quote_market_position_limit_exceeded: (params) => {\n const available = formatPipsUsd(getParam(params, \"availableCapacityUsdPips\"));\n return available\n ? `This market has reached its open-interest cap. Remaining capacity: ${available}.`\n : \"This market has reached its open-interest cap. Try a smaller size or another market.\";\n },\n quote_global_position_limit_exceeded: (params) => {\n const available = formatPipsUsd(getParam(params, \"availableCapacityUsdPips\"));\n return available\n ? `Global position limit reached. Remaining capacity: ${available}.`\n : \"Global position limit reached. Try again shortly.\";\n },\n quote_side_position_limit_exceeded: (params) => {\n const available = formatPipsUsd(getParam(params, \"availableCapacityUsdPips\"));\n return available\n ? `This side of the market is at its position limit. Remaining capacity: ${available}.`\n : \"This side of the market is at its position limit. Try the other side or a smaller size.\";\n },\n quote_side_capacity_exceeded: (params) => {\n const maxCollateral = formatPipsUsd(getParam(params, \"maxSupportedCollateralUsdPips\"));\n return maxCollateral\n ? `Not enough capacity on this side of the market. Max supported collateral at this size: ${maxCollateral}.`\n : \"Not enough capacity on this side of the market for that size.\";\n },\n quote_position_limit_exceeded: \"Position limit reached for this request.\",\n\n quote_insufficient_liquidity: \"Not enough liquidity on the order book to fill this size.\",\n quote_slippage_too_high: (params) => {\n const max = formatBpsPct(getParam(params, \"maxSlippageBps\"));\n const current = formatBpsPct(getParam(params, \"currentSlippageBps\"));\n if (max && current) {\n return `Required slippage ${current} exceeds your tolerance (${max}). Reduce size or raise tolerance.`;\n }\n if (max) {\n return `Required slippage exceeds your tolerance (${max}). Reduce size or raise tolerance.`;\n }\n return \"Price would move too far to fill this order. Reduce size or raise your slippage tolerance.\";\n },\n quote_event_not_started: \"This event has not started yet. Trading opens at the scheduled start time.\",\n quote_entry_bid_depth_too_low: \"Order book depth on the entry side is too thin to open this position safely.\",\n quote_entry_capacity_exceeded: \"Entry size exceeds the market's available capacity.\",\n quote_entry_depth_too_low: \"Order book depth is too thin to open this position safely.\",\n quote_entry_spread_too_wide: \"Bid/ask spread is too wide to open right now. Try again shortly.\",\n quote_entry_order_book_stale: \"Order book data is stale. Refresh and try again.\",\n quote_entry_price_stale: \"Price data is stale. Refresh and try again.\",\n quote_entry_crypto_price_stale: \"Crypto price data is stale. Refresh and try again.\",\n quote_entry_sport_data_stale: \"Sport event data is stale. Refresh and try again.\",\n quote_entry_volume_too_low: \"Recent traded volume on this market is too low to open new positions.\",\n quote_entry_top_holder_too_high: \"A single trader holds too much of this market. Opening here is restricted.\",\n quote_entry_price_out_of_range: \"Current price is outside the range we can open at. Try again shortly.\",\n quote_entry_exit_drop_too_high: \"Exit liquidity is too thin to safely open this size.\",\n quote_entry_market_too_elapsed: (params) => {\n const elapsed = formatFractionPct(getParam(params, \"pctElapsed\"));\n const max = formatFractionPct(getParam(params, \"maxPctElapsed\"));\n if (elapsed && max) {\n return `Market is ${elapsed} elapsed (max ${max}). Too close to resolution to open new positions.`;\n }\n return \"Market is too close to resolution to open new positions.\";\n },\n quote_entry_excluded_market_type: \"This market type is not supported for leveraged positions.\",\n quote_entry_excluded_sport: \"This sport is not supported for leveraged positions.\",\n quote_price_too_low: \"Underlying price is too low to open a leveraged position.\",\n quote_open_interest_unavailable: \"Open-interest data is unavailable right now. Try again shortly.\",\n\n quote_leverage_below_minimum: (params) => {\n const min = formatLeverage(getParam(params, \"minLeverageBps\"));\n const current = formatLeverage(getParam(params, \"currentLeverageBps\"));\n if (min && current) {\n return `Leverage ${current} is below the minimum allowed (${min}).`;\n }\n if (min) {\n return `Leverage is below the minimum allowed (${min}).`;\n }\n return \"Leverage is below the minimum allowed for this market.\";\n },\n quote_leverage_exceeds_maximum: (params) => {\n const max = formatLeverage(getParam(params, \"maxLeverageBps\"));\n const current = formatLeverage(getParam(params, \"currentLeverageBps\"));\n if (max && current) {\n return `Leverage ${current} is above the maximum allowed (${max}).`;\n }\n if (max) {\n return `Leverage is above the maximum allowed (${max}).`;\n }\n return \"Leverage is above the maximum allowed for this market.\";\n },\n quote_leverage_exceeds_model_max: (params) => {\n const max = formatLeverage(getParam(params, \"maxLeverageBps\"));\n const current = formatLeverage(getParam(params, \"currentLeverageBps\"));\n if (max && current) {\n return `Leverage ${current} exceeds the risk-model limit (${max}) for this market.`;\n }\n if (max) {\n return `Leverage exceeds the risk-model limit (${max}) for this market.`;\n }\n return \"Leverage exceeds the risk-model limit for this market.\";\n },\n quote_leverage_too_high_for_price: (params) => {\n const current = formatLeverage(getParam(params, \"currentLeverageBps\"));\n const max = formatLeverage(getParam(params, \"maxAcceptableLeverageBps\"));\n if (current && max) {\n return `Leverage ${current} is too high for the current price. Maximum is ${max}.`;\n }\n if (current) {\n return `Leverage ${current} is too high for the current price. Reduce leverage.`;\n }\n return \"Leverage is too high for the current price. Reduce leverage.\";\n },\n quote_hard_exit_too_close: \"Hard-exit is too close to entry. Reduce leverage.\",\n quote_liquidation_not_viable: (params) => {\n const tolerance = formatBpsPct(getParam(params, \"minTolerancePctBps\"));\n return tolerance\n ? `Liquidation price is too close to entry (minimum buffer ${tolerance}). Reduce leverage.`\n : \"Liquidation price is not viable at this leverage. Reduce leverage.\";\n },\n\n quote_market_not_active: \"Market is not active.\",\n quote_market_not_eligible: \"Market is not eligible for leveraged trading.\",\n quote_market_not_ready: \"Market is not ready yet. Try again shortly.\",\n quote_market_not_found: \"Market not found.\",\n quote_market_risk_too_high: \"Market risk is too high right now. Try again later.\",\n quote_market_unsupported_category: \"This market category is not supported.\",\n quote_market_no_prices: \"No price data available for this market.\",\n quote_market_missing_polymarket_condition_id: \"This market is missing required Polymarket data.\",\n\n quote_polymarket_market_closed: \"This Polymarket market is closed and not accepting new positions.\",\n quote_polymarket_market_inactive: \"This Polymarket market is inactive and not accepting new positions.\",\n quote_polymarket_market_not_accepting_orders:\n \"Polymarket is not accepting orders on this market right now. Try again shortly or pick another market.\",\n quote_polymarket_missing_token: \"This Polymarket market is missing a tradable outcome token.\",\n quote_invalid_polymarket_wallet_address: \"Invalid Polymarket wallet address.\",\n quote_invalid_kalshi_wallet_address: \"Invalid Kalshi wallet address.\",\n\n kalshi_quote_market_closed: \"This Kalshi market is closed.\",\n\n quote_draft_not_found: \"This quote has expired or does not exist. Please request a new quote.\",\n\n quote_twap_data_stale: \"Reference price (TWAP) is stale. Try again shortly.\",\n quote_twap_data_unavailable: \"Reference price (TWAP) is unavailable for this market.\",\n quote_revision_required: \"Quote needs to be refreshed before submitting.\",\n quote_price_provider_not_found: \"No price provider configured for this market.\",\n\n notional_selector_insufficient_liquidity: \"Not enough liquidity at the selected size.\",\n\n evm_gas_price_circuit_breaker: \"EVM gas price is too high — trading is temporarily paused.\",\n evm_gas_price_spike: \"EVM gas price spiked. Try again shortly.\",\n evm_simulation_failed: \"Transaction simulation failed. The transaction would revert on-chain.\",\n evm_receipt_timeout: \"Transaction confirmation timed out. Check status before retrying.\",\n evm_transaction_failed: \"EVM transaction failed.\",\n\n position_transition_conflicting_operation: \"Another operation on this position is in progress. Try again shortly.\",\n position_transition_invalid_state: \"Position is not in a state that allows this action.\",\n\n quote_creation_disabled: \"Quote creation is temporarily disabled. Try again shortly.\",\n};\n\nfunction humanizeCode(code: string): string {\n const spaced = code.replace(/_/g, \" \");\n return spaced.charAt(0).toUpperCase() + spaced.slice(1);\n}\n\nexport function resolveFriendlyMessage(code: string, params: Params): string | null {\n const entry = friendlyByCode[code];\n if (entry === undefined) {\n return null;\n }\n return typeof entry === \"function\" ? entry(params) : entry;\n}\n\nexport function formatErrorMessage(code: string, params: Params): string {\n return resolveFriendlyMessage(code, params) ?? humanizeCode(code);\n}\n","import type { QuoteHint } from \"../quote/quote-error-hints\";\nimport { resolveFriendlyMessage } from \"./error-messages\";\n\nexport class DimesError extends Error {\n public readonly code: string;\n\n constructor(code: string, message: string) {\n super(message);\n this.name = \"DimesError\";\n this.code = code;\n }\n}\n\nexport class DimesApiError extends DimesError {\n public readonly status: number;\n\n public readonly type: string | null;\n\n public readonly rawMessage: string;\n\n public readonly params: Record<string, unknown> | null;\n\n public readonly hint: QuoteHint | null;\n\n constructor(options: {\n status: number;\n code: string;\n type: string | null;\n message: string;\n params: Record<string, unknown> | null;\n hint?: QuoteHint | null;\n }) {\n const friendly = resolveFriendlyMessage(options.code, options.params) ?? options.message;\n super(options.code, friendly);\n this.name = \"DimesApiError\";\n this.status = options.status;\n this.type = options.type;\n this.rawMessage = options.message;\n this.params = options.params;\n this.hint = options.hint ?? null;\n }\n}\n\nexport class DimesContractError extends DimesError {\n constructor(code: string, message: string) {\n super(code, message);\n this.name = \"DimesContractError\";\n }\n}\n"],"mappings":";AAEO,SAAS,SAAS,OAA+B;AACtD,MAAI,OAAO,UAAU,YAAY,OAAO,SAAS,KAAK,GAAG;AACvD,WAAO;AAAA,EACT;AACA,MAAI,OAAO,UAAU,YAAY,MAAM,KAAK,MAAM,IAAI;AACpD,UAAM,SAAS,OAAO,KAAK;AAC3B,QAAI,OAAO,SAAS,MAAM,GAAG;AAC3B,aAAO;AAAA,IACT;AAAA,EACF;AACA,SAAO;AACT;AAEO,SAAS,SAAS,OAA+B;AACtD,MAAI,OAAO,UAAU,UAAU;AAC7B,WAAO;AAAA,EACT;AACA,MAAI,OAAO,UAAU,YAAY,UAAU,KAAK,MAAM,KAAK,CAAC,GAAG;AAC7D,WAAO,OAAO,MAAM,KA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