@dimes-dot-fi/sdk 1.4.2 → 1.5.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.
Files changed (39) hide show
  1. package/dist/{aliases-Dtl19fcM.d.cts → aliases-ByZ2DcA5.d.cts} +280 -5
  2. package/dist/{aliases-Dtl19fcM.d.ts → aliases-ByZ2DcA5.d.ts} +280 -5
  3. package/dist/{chunk-SGA6OZEU.mjs → chunk-3OPRSKCY.mjs} +18 -2
  4. package/dist/chunk-3OPRSKCY.mjs.map +1 -0
  5. package/dist/{chunk-DYPABUKC.cjs → chunk-72LTVPD2.cjs} +16 -1
  6. package/dist/chunk-72LTVPD2.cjs.map +1 -0
  7. package/dist/{chunk-BVILILIV.mjs → chunk-PZCBUVPD.mjs} +16 -1
  8. package/dist/chunk-PZCBUVPD.mjs.map +1 -0
  9. package/dist/{chunk-COSLZ5TM.cjs → chunk-Y5WQ3UWF.cjs} +21 -5
  10. package/dist/chunk-Y5WQ3UWF.cjs.map +1 -0
  11. package/dist/contract/index.cjs +13 -13
  12. package/dist/contract/index.d.cts +3 -3
  13. package/dist/contract/index.d.ts +3 -3
  14. package/dist/contract/index.mjs +1 -1
  15. package/dist/{dimes-client-DsRQSCTw.d.ts → dimes-client-B-thu7VQ.d.cts} +18 -3
  16. package/dist/{dimes-client-Bd7DE-tr.d.cts → dimes-client-CerC9mTr.d.ts} +18 -3
  17. package/dist/{dimes-error-DNcs8hsc.d.cts → dimes-error-BY5qVGZC.d.cts} +1 -1
  18. package/dist/{dimes-error-B46ZbXNX.d.ts → dimes-error-CrvPuFzB.d.ts} +1 -1
  19. package/dist/index.cjs +88 -6
  20. package/dist/index.cjs.map +1 -1
  21. package/dist/index.d.cts +138 -8
  22. package/dist/index.d.ts +138 -8
  23. package/dist/index.mjs +85 -3
  24. package/dist/index.mjs.map +1 -1
  25. package/dist/{quote-BMw6RUjG.d.ts → quote-Czq3Selh.d.ts} +2 -2
  26. package/dist/{quote-IRF_hecL.d.cts → quote-quIOosIv.d.cts} +2 -2
  27. package/dist/react/index.cjs +4 -4
  28. package/dist/react/index.d.cts +3 -3
  29. package/dist/react/index.d.ts +3 -3
  30. package/dist/react/index.mjs +2 -2
  31. package/dist/{types-DTgaOUUw.d.cts → types-2bGyrtqd.d.cts} +1 -1
  32. package/dist/{types-Ct7tufPh.d.ts → types-CAuPxEwO.d.ts} +1 -1
  33. package/dist/ws/index.d.cts +3 -3
  34. package/dist/ws/index.d.ts +3 -3
  35. package/package.json +1 -1
  36. package/dist/chunk-BVILILIV.mjs.map +0 -1
  37. package/dist/chunk-COSLZ5TM.cjs.map +0 -1
  38. package/dist/chunk-DYPABUKC.cjs.map +0 -1
  39. package/dist/chunk-SGA6OZEU.mjs.map +0 -1
@@ -38,6 +38,185 @@ interface components {
38
38
  */
39
39
  polygon_vault_contract_address: string;
40
40
  };
41
+ CustomerOriginationFeeTier: {
42
+ /**
43
+ * @description Upper leverage bound (inclusive) in basis points for this tier. The last tier is the catch-all.
44
+ * @example 40000
45
+ */
46
+ max_leverage_bps: number;
47
+ /**
48
+ * @description Protocol origination fee in basis points applied at or below this tier's leverage bound.
49
+ * @example 200
50
+ */
51
+ fee_bps: number;
52
+ };
53
+ CustomerFeeRatesMarket: {
54
+ /**
55
+ * @description Market ticker
56
+ * @example TRUMP-2024-WIN
57
+ */
58
+ ticker: string;
59
+ /**
60
+ * @description Polymarket venue trading fee rate in basis points (`feeRateBps`).
61
+ * @example 0
62
+ */
63
+ polymarket_trading_fee_bps: number;
64
+ /**
65
+ * @description Polymarket fee-curve exponent (`feeExponent`). `1` for the standard quadratic curve.
66
+ * @example 1
67
+ */
68
+ polymarket_fee_exponent: number;
69
+ };
70
+ CustomerFeeRates: {
71
+ /** @description Per-market venue fee fields. Only present when the request includes a `ticker` query parameter. */
72
+ market?: components["schemas"]["CustomerFeeRatesMarket"];
73
+ /** @description Leverage-tiered protocol origination fee schedule. Resolve a leverage to its fee by picking the first tier whose `maxLeverageBps >= leverageBps` (the last tier is the catch-all). */
74
+ origination_fee_tiers: components["schemas"]["CustomerOriginationFeeTier"][];
75
+ /**
76
+ * @description Maximum combined (protocol + partner) origination fee in basis points enforced on-chain.
77
+ * @example 1000
78
+ */
79
+ contract_max_origination_fee_bps: number;
80
+ /**
81
+ * @description Lifetime fee APR in basis points
82
+ * @example 2000
83
+ */
84
+ lifetime_fee_apr_bps: number;
85
+ /**
86
+ * @description Liquidation fee in basis points
87
+ * @example 250
88
+ */
89
+ liquidation_fee_bps: number;
90
+ /**
91
+ * @description This partner's origination fee component in basis points, added to the protocol tier fee. `0` by default.
92
+ * @example 0
93
+ */
94
+ partner_origination_fee_bps: number;
95
+ /**
96
+ * @description This partner's Polymarket builder taker fee in basis points (flat percentage of notional). `0` by default.
97
+ * @example 0
98
+ */
99
+ partner_trading_fee_bps: number;
100
+ };
101
+ FeeReportBody: {
102
+ /**
103
+ * @description Leverage in basis points (20000 = 2x, 100000 = 10x). Must be divisible by 2500. Maximum 10x.
104
+ * @example 50000
105
+ */
106
+ leverage_bps: number;
107
+ /**
108
+ * @description Market ticker
109
+ * @example TRUMP-2024-WIN
110
+ */
111
+ market_ticker: string;
112
+ /**
113
+ * @description Notional amount in USD pips (10,000 pips = $1.00)
114
+ * @example 50000
115
+ */
116
+ notional_amount_usd_pips: string;
117
+ /**
118
+ * @description Market side (yes or no)
119
+ * @enum {string}
120
+ */
121
+ effective_side: "yes" | "no";
122
+ /**
123
+ * @description Effective-side entry price in USD pips (10000 pips = $1) to compute against. When omitted, the market's current reference price is used. Provide it to compute deterministically against a known price.
124
+ * @example 5100
125
+ */
126
+ entry_price_usd_pips?: string;
127
+ };
128
+ CustomerFeeReport: {
129
+ /**
130
+ * @description Market ticker
131
+ * @example TRUMP-2024-WIN
132
+ */
133
+ market_ticker: string;
134
+ /**
135
+ * @description Market side
136
+ * @enum {string}
137
+ */
138
+ effective_side: "yes" | "no";
139
+ /**
140
+ * @description Leverage in basis points (20000 = 2x)
141
+ * @example 20000
142
+ */
143
+ leverage_bps: number;
144
+ /**
145
+ * @description Entry price used for the computation, in USD pips
146
+ * @example 5100
147
+ */
148
+ entry_price_usd_pips: string;
149
+ /**
150
+ * @description Notional in USD pips (10000 pips = $1)
151
+ * @example 500000
152
+ */
153
+ notional_amount_usd_pips: string;
154
+ /**
155
+ * @description Notional in USDC units (1,000,000 = 1 USDC)
156
+ * @example 50000000
157
+ */
158
+ notional_usdc_units: string;
159
+ /**
160
+ * @description Collateral in USDC units
161
+ * @example 25000000
162
+ */
163
+ collateral_usdc_units: string;
164
+ /**
165
+ * @description Combined origination fee in basis points
166
+ * @example 200
167
+ */
168
+ origination_fee_bps: number;
169
+ /**
170
+ * @description Origination fee in USDC units
171
+ * @example 1000000
172
+ */
173
+ origination_fee_usdc_units: string;
174
+ /**
175
+ * @description Protocol component of the origination fee in basis points
176
+ * @example 200
177
+ */
178
+ protocol_origination_fee_bps: number;
179
+ /**
180
+ * @description Partner component of the origination fee in basis points
181
+ * @example 0
182
+ */
183
+ partner_origination_fee_bps: number;
184
+ /**
185
+ * @description Polymarket venue trading fee rate in basis points (`feeRateBps`).
186
+ * @example 0
187
+ */
188
+ polymarket_trading_fee_bps: number;
189
+ /**
190
+ * @description Partner Polymarket builder taker fee in basis points (flat percentage of notional).
191
+ * @example 0
192
+ */
193
+ partner_trading_fee_bps: number;
194
+ /**
195
+ * @description Expected venue trading fee in USDC units charged to open the position (protocol venue fee + partner builder fee), computed from notional and entry price.
196
+ * @example 2204118
197
+ */
198
+ expected_open_trading_fee_usdc_units: string;
199
+ /**
200
+ * @description Total amount the user must provide to open, in USDC units.
201
+ * @example 28204118
202
+ */
203
+ total_user_amount_usdc_units: string;
204
+ /**
205
+ * @description Deterministic at-entry liquidation price ESTIMATE in USD pips (10000 pips = $1): `entry * (L-1)/L * (1 + liquidationFeeBps/10000)`. This is a closed-form estimate; the binding offer uses a TWAP/inference-based price that may differ.
206
+ * @example 2629
207
+ */
208
+ estimated_liquidation_price_usd_pips: string;
209
+ /**
210
+ * @description Gross maximum gain in USDC units: full value on a win (settlement at $1) minus notional, before fees. Profit over principal; may be negative.
211
+ * @example 48039215
212
+ */
213
+ gross_max_gain_usdc_units: string;
214
+ /**
215
+ * @description Net maximum gain in USDC units: grossMaxGain minus the open trading fee and the origination fee. Assumes a win via settlement (no exit trading fee) and excludes lifetime fees, so it is an upper bound. May be negative.
216
+ * @example 44835097
217
+ */
218
+ net_max_gain_usdc_units: string;
219
+ };
41
220
  CustomerLimit: {
42
221
  /**
43
222
  * @description Total limit formatted as USD
@@ -342,22 +521,22 @@ interface components {
342
521
  */
343
522
  capacity_max_notional_yes_usd_pips?: string | null;
344
523
  /**
345
- * @description Maximum notional available for NO side formatted as USD
524
+ * @description Maximum notional available for NO side formatted as USD. Bounded by slippage, capacity, the partner's remaining position limit, and the per-user position limit (assuming a user with no open positions).
346
525
  * @example 50.00
347
526
  */
348
527
  max_notional_no_usd?: string;
349
528
  /**
350
- * @description Maximum notional available for NO side in USD pips (10000 pips = $1)
529
+ * @description Maximum notional available for NO side in USD pips (10000 pips = $1). Bounded by slippage, capacity, the partner's remaining position limit, and the per-user position limit (assuming a user with no open positions).
351
530
  * @example 500000000
352
531
  */
353
532
  max_notional_no_usd_pips?: string;
354
533
  /**
355
- * @description Maximum notional available for YES side formatted as USD
534
+ * @description Maximum notional available for YES side formatted as USD. Bounded by slippage, capacity, the partner's remaining position limit, and the per-user position limit (assuming a user with no open positions).
356
535
  * @example 50.00
357
536
  */
358
537
  max_notional_yes_usd?: string;
359
538
  /**
360
- * @description Maximum notional available for YES side in USD pips (10000 pips = $1)
539
+ * @description Maximum notional available for YES side in USD pips (10000 pips = $1). Bounded by slippage, capacity, the partner's remaining position limit, and the per-user position limit (assuming a user with no open positions).
361
540
  * @example 500000000
362
541
  */
363
542
  max_notional_yes_usd_pips?: string;
@@ -522,6 +701,23 @@ interface components {
522
701
  */
523
702
  origination_leverage_bps: number;
524
703
  };
704
+ CustomerCloseAttempt: {
705
+ /**
706
+ * @description Outcome of the close attempt. `deferred` means the close could not complete yet and was postponed.
707
+ * @enum {string}
708
+ */
709
+ outcome: "deferred";
710
+ /**
711
+ * @description Why the close was deferred. `awaiting_settlement`: the market resolved before the position could be sold, so the remaining tokens will be redeemed when the market settles rather than sold on the order book.
712
+ * @enum {string}
713
+ */
714
+ reason: "awaiting_settlement";
715
+ /**
716
+ * @description ISO-8601 timestamp of when the close was requested.
717
+ * @example 2026-06-15T17:27:11.736Z
718
+ */
719
+ deferred_at: string;
720
+ };
525
721
  CustomerPositionCurrent: {
526
722
  /**
527
723
  * @description Current book-value leverage in basis points (20000 = 2x)
@@ -785,6 +981,8 @@ interface components {
785
981
  * @example 7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU
786
982
  */
787
983
  wallet_address: string;
984
+ /** @description Details of a close request that could not complete and was deferred. Null unless the customer requested a close that is now waiting on market settlement to redeem the remaining tokens. */
985
+ close_attempt?: components["schemas"]["CustomerCloseAttempt"] | null;
788
986
  };
789
987
  CustomerPositionClosedFees: {
790
988
  /**
@@ -879,6 +1077,16 @@ interface components {
879
1077
  * @example 0
880
1078
  */
881
1079
  collected_liquidation_fee_usd_pips: string;
1080
+ /**
1081
+ * @description Volume-weighted notional realized across all unwinds and the final close, formatted as USD. Null for reverted or cancelled positions.
1082
+ * @example 5.25
1083
+ */
1084
+ exit_notional_usd?: string | null;
1085
+ /**
1086
+ * @description Exit notional in USD pips. Null for reverted or cancelled positions.
1087
+ * @example 52500
1088
+ */
1089
+ exit_notional_usd_pips?: string | null;
882
1090
  /**
883
1091
  * @description Realized PnL net of all fees (origination + lifetime + liquidation + venue) as return on equity in basis points
884
1092
  * @example 1700
@@ -1047,6 +1255,49 @@ interface components {
1047
1255
  * @enum {string}
1048
1256
  */
1049
1257
  pm_provider: "kalshi" | "polymarket";
1258
+ /**
1259
+ * @description If true, the order may fill less than the requested notional (down to minFillBps) and the position opens at the actual fill size. If false or omitted, the order is atomic — fully filled or rejected.
1260
+ * @default false
1261
+ * @example true
1262
+ */
1263
+ allow_partial_fill: boolean;
1264
+ /**
1265
+ * @description Minimum fill the user will accept, in basis points. Only valid when allowPartialFill=true (rejected otherwise). Must be in [2000, 5000] and divisible by 500 (5% steps). Capped from below by max(2000, ceil(MIN_COLLATERAL × 10000 / requestedCollateral)).
1266
+ * @example 5000
1267
+ */
1268
+ min_fill_bps?: number;
1269
+ };
1270
+ CustomerOfferMaxGain: {
1271
+ /**
1272
+ * @description Gross max gain (profit before fees) formatted as USD
1273
+ * @example 1.90
1274
+ */
1275
+ gross_max_gain_usd: string;
1276
+ /**
1277
+ * @description Gross max gain in USD pips (10000 pips = $1)
1278
+ * @example 19000
1279
+ */
1280
+ gross_max_gain_usd_pips: string;
1281
+ /**
1282
+ * @description Gross max gain in USDC units (1,000,000 units = 1 USDC). May be negative.
1283
+ * @example 1900000
1284
+ */
1285
+ gross_max_gain_usdc_units: string;
1286
+ /**
1287
+ * @description Net max gain (profit after fees) formatted as USD
1288
+ * @example 1.40
1289
+ */
1290
+ net_max_gain_usd: string;
1291
+ /**
1292
+ * @description Net max gain in USD pips (10000 pips = $1)
1293
+ * @example 14000
1294
+ */
1295
+ net_max_gain_usd_pips: string;
1296
+ /**
1297
+ * @description Net max gain in USDC units (1,000,000 units = 1 USDC). May be negative.
1298
+ * @example 1400000
1299
+ */
1300
+ net_max_gain_usdc_units: string;
1050
1301
  };
1051
1302
  CustomerOffer: {
1052
1303
  /**
@@ -1283,8 +1534,20 @@ interface components {
1283
1534
  * @example 200
1284
1535
  */
1285
1536
  slippage_bps: number;
1537
+ /**
1538
+ * @description Whether the user opted into partial fills. When true, the position may open at less than the requested notional (down to minFillBps). When false or omitted, the order is atomic — fully filled or rejected.
1539
+ * @example true
1540
+ */
1541
+ allow_partial_fill?: boolean;
1542
+ /**
1543
+ * @description Minimum fill the user accepted in basis points. Only meaningful when allowPartialFill=true. Capped from below by max(2000, ceil(MIN_COLLATERAL × 10000 / requestedCollateral)).
1544
+ * @example 5000
1545
+ */
1546
+ min_fill_bps?: number;
1286
1547
  /** @description Base64-encoded Solana transaction (present for Solana markets only) */
1287
1548
  swap_transaction?: string;
1549
+ /** @description Expected maximum gain on a win (profit over principal). Only present when the request includes `expand=max_gain`; omitted otherwise. Assumes settlement at $1.00 (no exit trading fee) and excludes time-based lifetime fees, so it is an upper bound. */
1550
+ max_gain?: components["schemas"]["CustomerOfferMaxGain"];
1288
1551
  /**
1289
1552
  * @description Total amount user must provide formatted as USD
1290
1553
  * @example 2.73
@@ -1336,12 +1599,17 @@ type PositionClosedFees = CamelizeKeys<Raw["CustomerPositionClosedFees"]>;
1336
1599
  type PositionResult = CamelizeKeys<Raw["CustomerPositionResult"]>;
1337
1600
  type PositionTiming = CamelizeKeys<Raw["CustomerPositionTiming"]>;
1338
1601
  type PositionFailure = CamelizeKeys<Raw["CustomerPositionFailure"]>;
1602
+ type CloseAttempt = CamelizeKeys<Raw["CustomerCloseAttempt"]>;
1339
1603
  type PositionUnwind = CamelizeKeys<Raw["CustomerPositionUnwind"]>;
1340
1604
  type PositionUnwindList = CamelizeKeys<Raw["CustomerPositionUnwindList"]>;
1341
1605
  type PositionTransactions = CamelizeKeys<Raw["PositionTransactions"]>;
1342
1606
  type ContractInfo = CamelizeKeys<Raw["CustomerContractInfo"]>;
1343
1607
  type CustomerLimit = CamelizeKeys<Raw["CustomerLimit"]>;
1344
1608
  type CreateTokenResult = CamelizeKeys<Raw["CreateTokenResult"]>;
1609
+ type FeeRatesOriginationTier = CamelizeKeys<Raw["CustomerOriginationFeeTier"]>;
1610
+ type FeeRatesMarket = CamelizeKeys<Raw["CustomerFeeRatesMarket"]>;
1611
+ type FeeRates = CamelizeKeys<Raw["CustomerFeeRates"]>;
1612
+ type FeeReport = CamelizeKeys<Raw["CustomerFeeReport"]>;
1345
1613
  interface CreateOfferParams {
1346
1614
  marketTicker: string;
1347
1615
  effectiveSide: "yes" | "no";
@@ -1350,8 +1618,15 @@ interface CreateOfferParams {
1350
1618
  slippageBps: number;
1351
1619
  pmProvider?: "polymarket" | "kalshi";
1352
1620
  }
1621
+ interface FeeReportParams {
1622
+ marketTicker: string;
1623
+ effectiveSide: "yes" | "no";
1624
+ leverageBps: number;
1625
+ notionalAmountUsdPips: string;
1626
+ entryPriceUsdPips?: string;
1627
+ }
1353
1628
  declare function isOpenPosition(p: Position): p is OpenPosition;
1354
1629
  declare function isClosedPosition(p: Position): p is ClosedPosition;
1355
1630
  declare function leverageMaxBps(lev: MarketLeverage, side: "yes" | "no"): number;
1356
1631
 
1357
- export { type PositionTransactions as A, type MarketPolymarket as B, type CreateOfferParams as C, type Market as M, type Offer as O, type Position as P, type CamelizeKeys as a, type ClosedPosition as b, type ContractInfo as c, type CreateTokenResult as d, type CustomerLimit as e, type MarketFees as f, type MarketLeverage as g, type MarketMaxLeveragePerNotional as h, type MarketPrices as i, type MarketSidedEligibility as j, type MarketSidedMaxLeveragePerNotional as k, type OpenPosition as l, type OriginationTier as m, type PositionClosedFees as n, type PositionCurrent as o, type PositionEntry as p, type PositionFailure as q, type PositionOpenFees as r, type PositionResult as s, type PositionRisk as t, type PositionTiming as u, type PositionUnwind as v, type PositionUnwindList as w, isClosedPosition as x, isOpenPosition as y, leverageMaxBps as z };
1632
+ export { type PositionUnwind as A, type PositionUnwindList as B, type CreateOfferParams as C, isClosedPosition as D, isOpenPosition as E, type FeeRates as F, leverageMaxBps as G, type PositionTransactions as H, type MarketPolymarket as I, type Market as M, type Offer as O, type Position as P, type CamelizeKeys as a, type CloseAttempt as b, type ClosedPosition as c, type ContractInfo as d, type CreateTokenResult as e, type CustomerLimit as f, type FeeRatesMarket as g, type FeeRatesOriginationTier as h, type FeeReport as i, type FeeReportParams as j, type MarketFees as k, type MarketLeverage as l, type MarketMaxLeveragePerNotional as m, type MarketPrices as n, type MarketSidedEligibility as o, type MarketSidedMaxLeveragePerNotional as p, type OpenPosition as q, type OriginationTier as r, type PositionClosedFees as s, type PositionCurrent as t, type PositionEntry as u, type PositionFailure as v, type PositionOpenFees as w, type PositionResult as x, type PositionRisk as y, type PositionTiming as z };