rain-sdk-v2 2.5.2 → 2.5.4

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/CHANGELOG.md CHANGED
@@ -15,6 +15,20 @@ Versions `< 2.5.0` are **deprecated on npm** — they build sell transactions wi
15
15
  slippage protection by default (fixed in 2.5.0). See the Security notice in the
16
16
  README and the 2.5.0 entry below. Upgrade to `>= 2.5.0`.
17
17
 
18
+ ## [2.5.4] - Fix: allow 1-option (binary) markets
19
+
20
+ ### Fixed
21
+ - `createMarket` validation rejected `no_of_options: 1` (`must be at least 2`),
22
+ which blocked binary (single Yes/No) markets — the most common type, and one
23
+ the contract accepts (verified on-chain). Minimum is now **1** (1 = binary,
24
+ 2+ = multi-outcome). Regression introduced in 2.5.0.
25
+
26
+ ## [2.5.3] - Update USDR token addresses (dev/stage)
27
+
28
+ ### Changed
29
+ - Updated the USDR token contract address for the `development` and `stage`
30
+ environments in `ENV_CONFIG`. Production USDR is unchanged. Config-only.
31
+
18
32
  ## [2.5.2] - Remove ngrok dev header
19
33
 
20
34
  ### Removed
package/README.md CHANGED
@@ -199,7 +199,7 @@ const txsRain = await rain.buildCreateMarketTx({
199
199
  | Parameter | Type | Description |
200
200
  |-----------|------|-------------|
201
201
  | `marketQuestion` | `string` | The market question |
202
- | `marketOptions` | `string[]` | Option labels (2-26 options) |
202
+ | `marketOptions` | `string[]` | Option labels. 1 = binary (single Yes/No) market; 2+ = multi-outcome. Length must equal `no_of_options` |
203
203
  | `marketTags` | `string[]` | Tags (1-3) |
204
204
  | `marketDescription` | `string` | Description |
205
205
  | `isPublic` | `boolean` | Public market |
@@ -28,7 +28,7 @@ export const ENV_CONFIG = {
28
28
  oracle_fixed_fee_per_option: 1000000000000000000n, // $1 in 18 decimals
29
29
  },
30
30
  usdr: {
31
- address: "0x2b67d5367175d8C0Ce3c755004565a60F1D08D4D",
31
+ address: "0x9cD5Dd558d5C0eac93D7f1C9d994916f9Bfbc50a",
32
32
  symbol: "USDR",
33
33
  decimals: 18,
34
34
  oracle_fixed_fee_per_option: 1000000000000000000n, // $1 in 18 decimals
@@ -53,7 +53,7 @@ export const ENV_CONFIG = {
53
53
  oracle_fixed_fee_per_option: 1000000000000000000n,
54
54
  },
55
55
  usdr: {
56
- address: "0xC1aeb1D39008337E127698c10f6338E93E5f3369",
56
+ address: "0xD3Ffde8ca474E15f207463cb223daae2719D70c8",
57
57
  symbol: "USDR",
58
58
  decimals: 18,
59
59
  oracle_fixed_fee_per_option: 1000000000000000000n,
@@ -52,8 +52,10 @@ export function validateCreateMarketParams(params) {
52
52
  // "fixed" by normalizeBarValues (which dumped the rounding remainder onto the
53
53
  // last option, producing odds the caller never asked for). Reject loudly instead.
54
54
  const optionCount = Number(no_of_options);
55
- if (optionCount < 2)
56
- throw new Error("no_of_options must be at least 2");
55
+ // 1 option = a binary (single Yes/No) market — the most common type;
56
+ // 2+ options = a multi-outcome market. Both are valid on-chain.
57
+ if (optionCount < 1)
58
+ throw new Error("no_of_options must be at least 1");
57
59
  if (marketOptions.length !== optionCount) {
58
60
  throw new Error(`marketOptions length (${marketOptions.length}) must equal no_of_options (${optionCount})`);
59
61
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rain-sdk-v2",
3
- "version": "2.5.2",
3
+ "version": "2.5.4",
4
4
  "type": "module",
5
5
  "description": "Rain SDK V2 — TypeScript SDK for Rain prediction markets on Arbitrum. Market creation, trading, liquidity, order book, split/merge, dispute, and smart account support.",
6
6
  "main": "dist/index.js",