@pulsepairs/sdk 0.9.1 → 0.9.2

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/DOCUMENTATION.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # `@pulsepairs/sdk` — Reference Documentation
2
2
 
3
- **Version:** 0.7.0 · **License:** UNLICENSED · **Runtime:** Node ≥ 18 or a modern browser
3
+ **Version:** 0.9.2 · **License:** UNLICENSED · **Runtime:** Node ≥ 18 or a modern browser
4
4
 
5
5
  Complete reference for the UpDown TypeScript SDK: every export, its
6
6
  units, its failure modes, and the protocol it speaks.
@@ -43,10 +43,14 @@ returns, what unit a number is in, or why a signature is being rejected.
43
43
  ## 1. What this SDK is
44
44
 
45
45
  UpDown is a binary prediction market: *will BTC-USD (or ETH-USD) be UP or DOWN at
46
- the end of this 5-minute / 15-minute / 1-hour cycle?* Trading is an **off-chain
46
+ the end of this 5-minute or 15-minute cycle?* Trading is an **off-chain
47
47
  central limit order book** (the "matcher"); settlement is **on-chain** on
48
48
  Arbitrum.
49
49
 
50
+ 60-minute cycles were retired on 2026-08-18 and no new ones are created. The
51
+ `3600` timeframe is still accepted and still returns the historical rounds — see
52
+ `getMarkets` under [§5 `UpDownHttpClient`](#5-updownhttpclient--rest-client).
53
+
50
54
  The SDK gives you three layers, usable independently:
51
55
 
52
56
  | Layer | Modules | What it does |
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # @pulsepairs/sdk
2
2
 
3
3
  Standalone SDK for the **UpDown** up/down prediction markets —
4
- BTC-USD / ETH-USD, UP or DOWN, on 5-minute / 15-minute / 1-hour cycles.
4
+ BTC-USD / ETH-USD, UP or DOWN, on 5-minute and 15-minute cycles.
5
5
 
6
6
  > **On the name:** the product is **UpDown**. "PulsePairs" is a retired name that
7
7
  > survives in two places for compatibility reasons only — this npm package's name
@@ -456,6 +456,32 @@ for (const f of bulkFailures(res)) {
456
456
 
457
457
  `index` is the position in the array you sent — results are positional.
458
458
 
459
+ **On success the order is NESTED, and the single routes spread it.** This is
460
+ the one asymmetry that bites, because nothing about the call site hints at it:
461
+
462
+ ```ts
463
+ const single = await api.amendOrder({ cancelOrderId, order });
464
+ single.id; // flat — the replacement's id
465
+
466
+ const bulk = await api.amendOrdersBulk({ amends });
467
+ for (const r of bulk.results) {
468
+ if (!r.ok) continue; // narrow first; failures have no `order`
469
+ r.order.id; // NESTED — `r.id` is undefined
470
+ r.replaced; // the id that was retired
471
+ r.priorityKept; // false when queue position was forfeited
472
+ r.remaining; // atomic USDT carried to the replacement
473
+ }
474
+ ```
475
+
476
+ `postOrdersBulk` nests the same way: `results[i].order`, never `results[i].id`.
477
+
478
+ Reading `results[i].id` yields `undefined` rather than throwing, so the mistake
479
+ survives to wherever that id is used — usually a later cancel that silently
480
+ matches nothing. SDK **0.9.0 typed the bulk result flat** and shipped that
481
+ mistake into the types themselves; 0.9.1 corrected them. The wire shape never
482
+ changed, so no server behaviour depends on which version you are on — but on
483
+ 0.9.0 the compiler will agree with you while you read the wrong field.
484
+
459
485
  Two behavioural differences worth knowing, because they change how latency
460
486
  scales:
461
487
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pulsepairs/sdk",
3
- "version": "0.9.1",
4
- "description": "Standalone SDK for the UpDown (PulsePairs) up/down prediction markets \u2014 matcher REST/WS client, EIP-712 order signing, trade-math, and Alchemy Account Kit (smart-account) order signing for rain.trade integration.",
3
+ "version": "0.9.2",
4
+ "description": "Standalone SDK for the UpDown (PulsePairs) up/down prediction markets — matcher REST/WS client, EIP-712 order signing, trade-math, and Alchemy Account Kit (smart-account) order signing for rain.trade integration.",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
7
7
  "main": "dist/index.js",