rain-sdk-v2 1.0.4 → 1.0.5

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
@@ -156,6 +156,7 @@ const txs = await rain.buildCreateMarketTx({
156
156
  barValues: [50, 50], // probability distribution (0-100, sums to 100)
157
157
  baseToken: config.tokens.usdt.address, // USDT
158
158
  tradingModel: TradingModel.AMM, // AMM = 0, OrderBook = 1
159
+ marketImage: 'https://cdn.example.com/market-image.png',
159
160
  });
160
161
 
161
162
  // Create market with RAIN token (18 decimals)
@@ -183,8 +184,9 @@ const txsRain = await rain.buildCreateMarketTx({
183
184
  | `no_of_options` | `bigint` | Number of options |
184
185
  | `inputAmountWei` | `bigint` | Initial liquidity in base token wei |
185
186
  | `barValues` | `number[]` | Probability distribution (0-100 scale) |
186
- | `baseToken` | `0x${string}` | Base token address (USDT) |
187
+ | `baseToken` | `0x${string}` | Base token address (USDT or RAIN) |
187
188
  | `tradingModel` | `TradingModel` | `AMM (0)` or `OrderBook (1)` |
189
+ | `marketImage` | `string` | Market image URL (required) |
188
190
 
189
191
  ---
190
192
 
@@ -35,6 +35,8 @@ export function validateCreateMarketParams(params) {
35
35
  throw new Error("barValues array is required and cannot be empty");
36
36
  if (!baseToken)
37
37
  throw new Error("baseToken address is required");
38
+ if (!params.marketImage)
39
+ throw new Error("marketImage is required");
38
40
  if (!factoryContractAddress)
39
41
  throw new Error("factoryContractAddress is required");
40
42
  const decimals = tokenDecimals ?? 6;
@@ -20,7 +20,7 @@ export async function uploadMetaData(params) {
20
20
  startDate: formattedStartDate,
21
21
  endDate: formattedEndDate,
22
22
  tradingModel: tradingModel ?? 0,
23
- questionImage: params.questionImage ?? '',
23
+ questionImage: params.marketImage,
24
24
  tags: marketTags,
25
25
  poolDescription: marketDescription,
26
26
  isAiResolver: isPublicPoolResolverAi,
@@ -108,7 +108,7 @@ export interface CreateMarketTxParams {
108
108
  barValues: number[];
109
109
  baseToken: `0x${string}`;
110
110
  tradingModel?: TradingModel;
111
- questionImage?: string;
111
+ marketImage: string;
112
112
  tokenDecimals?: number;
113
113
  factoryContractAddress?: `0x${string}`;
114
114
  oracleFixedFeePerOption?: bigint;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rain-sdk-v2",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
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",