rain-sdk-v2 2.5.3 → 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 +14 -0
- package/README.md +1 -1
- package/dist/tx/CreateMarket/createMarketValidation.js +4 -2
- package/package.json +1 -1
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-
|
|
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 |
|
|
@@ -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
|
-
|
|
56
|
-
|
|
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.
|
|
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",
|