rain-sdk-v2 2.0.1 → 2.0.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/README.md CHANGED
@@ -186,7 +186,7 @@ const txsRain = await rain.buildCreateMarketTx({
186
186
  | `inputAmountWei` | `bigint` | Initial liquidity in base token wei |
187
187
  | `disputeTimer` | `number` | Oracle end time duration in seconds (e.g. 259200 = 3 days). Auto-set from environment config |
188
188
  | `barValues` | `number[]` | Probability distribution (0-100 scale) |
189
- | `initialYesPrices` | `bigint[]` | *(Optional)* Initial Yes prices per option in 1e18 scale (e.g. `500000000000000000n` = 50%). Defaults to 50% per option |
189
+ | `initialYesPrices` | `bigint[]` | *(Optional)* Initial Yes prices per option in 1e18 scale (e.g. `500000000000000000n` = 50%). Defaults to 50% for AMM. Forced to `0n` for OrderBook |
190
190
  | `baseToken` | `0x${string}` | Base token address (USDT or RAIN) |
191
191
  | `tradingModel` | `TradingModel` | `AMM (0)` or `OrderBook (1)` |
192
192
  | `marketImage` | `string` | Market image URL (required) |
@@ -37,7 +37,9 @@ export async function buildCreateMarketRawTx(params) {
37
37
  ipfsUri: ipfsUrl,
38
38
  initialLiquidity: inputAmountWei,
39
39
  liquidityPercentages,
40
- initialYesPrices: params.initialYesPrices ?? liquidityPercentages.map(() => 500000000000000000n),
40
+ initialYesPrices: (tradingModel ?? 0) === 1
41
+ ? liquidityPercentages.map(() => 0n)
42
+ : (params.initialYesPrices ?? liquidityPercentages.map(() => 500000000000000000n)),
41
43
  baseToken,
42
44
  tradingModel: tradingModel ?? 0,
43
45
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rain-sdk-v2",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
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",