rain-sdk-v2 2.1.4 → 2.1.6

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
@@ -32,12 +32,17 @@ const config = rain.getEnvironmentConfig();
32
32
  console.log(config.market_factory_address); // Factory contract
33
33
  console.log(config.tokens.usdt.address); // USDT token address
34
34
  console.log(config.tokens.rain.address); // RAIN token address
35
+ console.log(config.tokens.usdr.address); // USDR token address
35
36
  console.log(config.tokens.usdt.decimals); // 6
36
37
  console.log(config.tokens.rain.decimals); // 18
38
+ console.log(config.tokens.usdr.decimals); // 18
37
39
 
38
40
  // Get token config by address
39
41
  const tokenInfo = rain.getTokenConfig('0x...');
40
42
  console.log(tokenInfo?.decimals, tokenInfo?.symbol);
43
+
44
+ // USDR token ABI (ERC20 + AccessControl + EIP-2612 permit, role-gated mint/burn)
45
+ import { USDRAbi } from 'rain-sdk-v2';
41
46
  ```
42
47
 
43
48
  ---
@@ -661,6 +666,96 @@ const payouts = await rain.getDynamicPayout({
661
666
  // payouts = [yesPayoutWei, noPayoutWei]
662
667
  ```
663
668
 
669
+ ### `getResolverBondAmount(params): Promise<bigint>`
670
+
671
+ Get the bond amount (in base-token wei) a resolver must post to propose a resolution for an option.
672
+
673
+ ```typescript
674
+ const bond = await rain.getResolverBondAmount({
675
+ marketContractAddress: '0x...',
676
+ option: 1n, // 1-based option index
677
+ });
678
+ ```
679
+
680
+ ### `getDisputeAppealFee(params): Promise<bigint>`
681
+
682
+ Get the fee (in base-token wei) required to open a dispute or appeal on an option.
683
+
684
+ ```typescript
685
+ const fee = await rain.getDisputeAppealFee({
686
+ marketContractAddress: '0x...',
687
+ option: 1n,
688
+ });
689
+ ```
690
+
691
+ ### `optionResolverBond(params): Promise<bigint>`
692
+
693
+ Get the resolver bond currently posted on an option (0n if no resolution has been proposed).
694
+
695
+ ```typescript
696
+ const bond = await rain.optionResolverBond({
697
+ marketContractAddress: '0x...',
698
+ option: 1n,
699
+ });
700
+ ```
701
+
702
+ ### `optionResolutionProposer(params): Promise<`0x${string}`>`
703
+
704
+ Get the address that proposed the resolution for an option (zero address if none).
705
+
706
+ ```typescript
707
+ const proposer = await rain.optionResolutionProposer({
708
+ marketContractAddress: '0x...',
709
+ option: 1n,
710
+ });
711
+ ```
712
+
713
+ ### `isOptionDisputed(params): Promise<boolean>`
714
+
715
+ Check whether an option's resolution has been disputed.
716
+
717
+ ```typescript
718
+ const disputed = await rain.isOptionDisputed({
719
+ marketContractAddress: '0x...',
720
+ option: 1n,
721
+ });
722
+ ```
723
+
724
+ ### `isOptionAppealed(params): Promise<boolean>`
725
+
726
+ Check whether an option's dispute resolution has been appealed.
727
+
728
+ ```typescript
729
+ const appealed = await rain.isOptionAppealed({
730
+ marketContractAddress: '0x...',
731
+ option: 1n,
732
+ });
733
+ ```
734
+
735
+ ### `optionDispute(params): Promise<OptionDisputeInfo>`
736
+
737
+ Get the dispute details for an option: fee paid, the winner claimed by the disputer, the disputer address, and the dispute resolver.
738
+
739
+ ```typescript
740
+ const dispute = await rain.optionDispute({
741
+ marketContractAddress: '0x...',
742
+ option: 1n,
743
+ });
744
+ // { disputeFee: bigint, disputedWinner: bigint, disputer: '0x...', disputeResolver: '0x...' }
745
+ ```
746
+
747
+ ### `optionAppeal(params): Promise<OptionAppealInfo>`
748
+
749
+ Get the appeal details for an option: fee paid, the winner claimed by the appellant, the disputer address, and the appeal resolver.
750
+
751
+ ```typescript
752
+ const appeal = await rain.optionAppeal({
753
+ marketContractAddress: '0x...',
754
+ option: 1n,
755
+ });
756
+ // { disputeFee: bigint, disputedWinner: bigint, disputer: '0x...', appealResolver: '0x...' }
757
+ ```
758
+
664
759
  ### `getUserActiveBuyOrders(params): Promise<bigint>`
665
760
 
666
761
  Get count of user's active buy orders.
package/dist/Rain.d.ts CHANGED
@@ -4,6 +4,7 @@ import { ExtendTimeTxParams } from './tx/buildExtendTimeRawTx.js';
4
4
  import { RainCoreConfig, RainEnvironment } from './types.js';
5
5
  import { LoginParams, LoginResult } from './auth/types.js';
6
6
  import { SellProceedsResult } from './markets/getSellProceeds.js';
7
+ import { OptionDisputeInfo, OptionAppealInfo } from './markets/getDisputeState.js';
7
8
  import { EntrySharesResult } from './markets/getEntryShares.js';
8
9
  import type { UserProfileUpdateParams, UserHistoryParams, CreateCommentParams, CommentsListingParams, UpdateCommentParams, CommentCountParams, PublicPoolsParams, PrivatePoolsParams, PoolListingByCreatorParams, VerifyAccessCodeParams, PoolTotalParticipantsParams, SearchPoolParams, RelatedPoolsParams, UpdateStreamingParams, UpdatePoolResolutionTimeParams, FindPoolFallbackParams, SignOraclesExtendTimeParams, TrendingTagsParams, UserTotalInvestmentParams, OptionsTotalVolumeParams, PoolActivityParams, TopHoldersParams, UserInvestedPoolsParams, InvestmentVolumeGraphParams, UserPnlGraphParams, TopWinnersLosersParams, PnlByPoolIdParams, UserPositionsParams, OpenPositionsParams, UserSharePositionsParams, SearchInvestedPoolsParams, PriceDataParams, AddReviewParams, GetUserOrdersParams, OrderBookParams, GetUserOrderByPoolIdParams, OrdersListingByPoolParams, AddUserPointsParams, UserOnboardingParams, PointsGraphParams, GetNotificationsParams, MarkNotificationAsReadParams, CreateDisputeMessageParams, GetPoolDisputeConvoParams, FollowToggleParams, FollowCheckParams, FollowListParams, FollowStatsParams, RainBurnPerPoolParams, ToggleBookmarkParams, GetBookmarksParams, CheckBookmarkParams, LeaderboardParams, LeaderboardSearchParams, TraderRecentTradesParams } from './api/types.js';
9
10
  export declare class Rain {
@@ -58,6 +59,38 @@ export declare class Rain {
58
59
  getDisputeWindow(params: {
59
60
  marketContractAddress: `0x${string}`;
60
61
  }): Promise<bigint>;
62
+ getResolverBondAmount(params: {
63
+ marketContractAddress: `0x${string}`;
64
+ option: bigint;
65
+ }): Promise<bigint>;
66
+ getDisputeAppealFee(params: {
67
+ marketContractAddress: `0x${string}`;
68
+ option: bigint;
69
+ }): Promise<bigint>;
70
+ optionResolverBond(params: {
71
+ marketContractAddress: `0x${string}`;
72
+ option: bigint;
73
+ }): Promise<bigint>;
74
+ optionResolutionProposer(params: {
75
+ marketContractAddress: `0x${string}`;
76
+ option: bigint;
77
+ }): Promise<`0x${string}`>;
78
+ isOptionDisputed(params: {
79
+ marketContractAddress: `0x${string}`;
80
+ option: bigint;
81
+ }): Promise<boolean>;
82
+ isOptionAppealed(params: {
83
+ marketContractAddress: `0x${string}`;
84
+ option: bigint;
85
+ }): Promise<boolean>;
86
+ optionDispute(params: {
87
+ marketContractAddress: `0x${string}`;
88
+ option: bigint;
89
+ }): Promise<OptionDisputeInfo>;
90
+ optionAppeal(params: {
91
+ marketContractAddress: `0x${string}`;
92
+ option: bigint;
93
+ }): Promise<OptionAppealInfo>;
61
94
  getEntryShares(params: {
62
95
  marketContractAddress: `0x${string}`;
63
96
  option: bigint;
@@ -150,6 +183,7 @@ export declare class Rain {
150
183
  readonly tokens: {
151
184
  readonly usdt: import("./config/environments.js").TokenConfig;
152
185
  readonly rain: import("./config/environments.js").TokenConfig;
186
+ readonly usdr: import("./config/environments.js").TokenConfig;
153
187
  };
154
188
  } | {
155
189
  readonly apiUrl: "https://stg2-api.rain.one";
@@ -158,6 +192,7 @@ export declare class Rain {
158
192
  readonly tokens: {
159
193
  readonly usdt: import("./config/environments.js").TokenConfig;
160
194
  readonly rain: import("./config/environments.js").TokenConfig;
195
+ readonly usdr: import("./config/environments.js").TokenConfig;
161
196
  };
162
197
  } | {
163
198
  readonly apiUrl: "https://prod2-api.rain.one";
@@ -166,6 +201,7 @@ export declare class Rain {
166
201
  readonly tokens: {
167
202
  readonly usdt: import("./config/environments.js").TokenConfig;
168
203
  readonly rain: import("./config/environments.js").TokenConfig;
204
+ readonly usdr: import("./config/environments.js").TokenConfig;
169
205
  };
170
206
  };
171
207
  private cfg;
package/dist/Rain.js CHANGED
@@ -24,6 +24,9 @@ import { getSellProceeds } from './markets/getSellProceeds.js';
24
24
  import { getUserSharesInEscrow } from './markets/getUserSharesInEscrow.js';
25
25
  import { getOptionClaimed } from './markets/getOptionClaimed.js';
26
26
  import { getDisputeWindow } from './markets/getDisputeWindow.js';
27
+ import { getResolverBondAmount } from './markets/getResolverBondAmount.js';
28
+ import { getDisputeAppealFee } from './markets/getDisputeFee.js';
29
+ import { optionResolverBond, optionResolutionProposer, isOptionDisputed, isOptionAppealed, optionDispute, optionAppeal } from './markets/getDisputeState.js';
27
30
  import { getEntryShares } from './markets/getEntryShares.js';
28
31
  import { createPublicClient, http, parseAbi } from 'viem';
29
32
  import { arbitrum } from 'viem/chains';
@@ -137,6 +140,30 @@ export class Rain {
137
140
  async getDisputeWindow(params) {
138
141
  return getDisputeWindow({ ...params, rpcUrl: this.rpcUrl });
139
142
  }
143
+ async getResolverBondAmount(params) {
144
+ return getResolverBondAmount({ ...params, rpcUrl: this.rpcUrl });
145
+ }
146
+ async getDisputeAppealFee(params) {
147
+ return getDisputeAppealFee({ ...params, rpcUrl: this.rpcUrl });
148
+ }
149
+ async optionResolverBond(params) {
150
+ return optionResolverBond({ ...params, rpcUrl: this.rpcUrl });
151
+ }
152
+ async optionResolutionProposer(params) {
153
+ return optionResolutionProposer({ ...params, rpcUrl: this.rpcUrl });
154
+ }
155
+ async isOptionDisputed(params) {
156
+ return isOptionDisputed({ ...params, rpcUrl: this.rpcUrl });
157
+ }
158
+ async isOptionAppealed(params) {
159
+ return isOptionAppealed({ ...params, rpcUrl: this.rpcUrl });
160
+ }
161
+ async optionDispute(params) {
162
+ return optionDispute({ ...params, rpcUrl: this.rpcUrl });
163
+ }
164
+ async optionAppeal(params) {
165
+ return optionAppeal({ ...params, rpcUrl: this.rpcUrl });
166
+ }
140
167
  async getEntryShares(params) {
141
168
  return getEntryShares({ ...params, rpcUrl: this.rpcUrl });
142
169
  }
@@ -0,0 +1,602 @@
1
+ export declare const USDRAbi: readonly [{
2
+ readonly inputs: readonly [];
3
+ readonly stateMutability: "nonpayable";
4
+ readonly type: "constructor";
5
+ }, {
6
+ readonly inputs: readonly [];
7
+ readonly name: "AccessControlBadConfirmation";
8
+ readonly type: "error";
9
+ }, {
10
+ readonly inputs: readonly [{
11
+ readonly internalType: "address";
12
+ readonly name: "account";
13
+ readonly type: "address";
14
+ }, {
15
+ readonly internalType: "bytes32";
16
+ readonly name: "neededRole";
17
+ readonly type: "bytes32";
18
+ }];
19
+ readonly name: "AccessControlUnauthorizedAccount";
20
+ readonly type: "error";
21
+ }, {
22
+ readonly inputs: readonly [];
23
+ readonly name: "ECDSAInvalidSignature";
24
+ readonly type: "error";
25
+ }, {
26
+ readonly inputs: readonly [{
27
+ readonly internalType: "uint256";
28
+ readonly name: "length";
29
+ readonly type: "uint256";
30
+ }];
31
+ readonly name: "ECDSAInvalidSignatureLength";
32
+ readonly type: "error";
33
+ }, {
34
+ readonly inputs: readonly [{
35
+ readonly internalType: "bytes32";
36
+ readonly name: "s";
37
+ readonly type: "bytes32";
38
+ }];
39
+ readonly name: "ECDSAInvalidSignatureS";
40
+ readonly type: "error";
41
+ }, {
42
+ readonly inputs: readonly [{
43
+ readonly internalType: "address";
44
+ readonly name: "spender";
45
+ readonly type: "address";
46
+ }, {
47
+ readonly internalType: "uint256";
48
+ readonly name: "allowance";
49
+ readonly type: "uint256";
50
+ }, {
51
+ readonly internalType: "uint256";
52
+ readonly name: "needed";
53
+ readonly type: "uint256";
54
+ }];
55
+ readonly name: "ERC20InsufficientAllowance";
56
+ readonly type: "error";
57
+ }, {
58
+ readonly inputs: readonly [{
59
+ readonly internalType: "address";
60
+ readonly name: "sender";
61
+ readonly type: "address";
62
+ }, {
63
+ readonly internalType: "uint256";
64
+ readonly name: "balance";
65
+ readonly type: "uint256";
66
+ }, {
67
+ readonly internalType: "uint256";
68
+ readonly name: "needed";
69
+ readonly type: "uint256";
70
+ }];
71
+ readonly name: "ERC20InsufficientBalance";
72
+ readonly type: "error";
73
+ }, {
74
+ readonly inputs: readonly [{
75
+ readonly internalType: "address";
76
+ readonly name: "approver";
77
+ readonly type: "address";
78
+ }];
79
+ readonly name: "ERC20InvalidApprover";
80
+ readonly type: "error";
81
+ }, {
82
+ readonly inputs: readonly [{
83
+ readonly internalType: "address";
84
+ readonly name: "receiver";
85
+ readonly type: "address";
86
+ }];
87
+ readonly name: "ERC20InvalidReceiver";
88
+ readonly type: "error";
89
+ }, {
90
+ readonly inputs: readonly [{
91
+ readonly internalType: "address";
92
+ readonly name: "sender";
93
+ readonly type: "address";
94
+ }];
95
+ readonly name: "ERC20InvalidSender";
96
+ readonly type: "error";
97
+ }, {
98
+ readonly inputs: readonly [{
99
+ readonly internalType: "address";
100
+ readonly name: "spender";
101
+ readonly type: "address";
102
+ }];
103
+ readonly name: "ERC20InvalidSpender";
104
+ readonly type: "error";
105
+ }, {
106
+ readonly inputs: readonly [{
107
+ readonly internalType: "uint256";
108
+ readonly name: "deadline";
109
+ readonly type: "uint256";
110
+ }];
111
+ readonly name: "ERC2612ExpiredSignature";
112
+ readonly type: "error";
113
+ }, {
114
+ readonly inputs: readonly [{
115
+ readonly internalType: "address";
116
+ readonly name: "signer";
117
+ readonly type: "address";
118
+ }, {
119
+ readonly internalType: "address";
120
+ readonly name: "owner";
121
+ readonly type: "address";
122
+ }];
123
+ readonly name: "ERC2612InvalidSigner";
124
+ readonly type: "error";
125
+ }, {
126
+ readonly inputs: readonly [{
127
+ readonly internalType: "address";
128
+ readonly name: "account";
129
+ readonly type: "address";
130
+ }, {
131
+ readonly internalType: "uint256";
132
+ readonly name: "currentNonce";
133
+ readonly type: "uint256";
134
+ }];
135
+ readonly name: "InvalidAccountNonce";
136
+ readonly type: "error";
137
+ }, {
138
+ readonly inputs: readonly [];
139
+ readonly name: "InvalidShortString";
140
+ readonly type: "error";
141
+ }, {
142
+ readonly inputs: readonly [{
143
+ readonly internalType: "string";
144
+ readonly name: "str";
145
+ readonly type: "string";
146
+ }];
147
+ readonly name: "StringTooLong";
148
+ readonly type: "error";
149
+ }, {
150
+ readonly anonymous: false;
151
+ readonly inputs: readonly [{
152
+ readonly indexed: true;
153
+ readonly internalType: "address";
154
+ readonly name: "owner";
155
+ readonly type: "address";
156
+ }, {
157
+ readonly indexed: true;
158
+ readonly internalType: "address";
159
+ readonly name: "spender";
160
+ readonly type: "address";
161
+ }, {
162
+ readonly indexed: false;
163
+ readonly internalType: "uint256";
164
+ readonly name: "value";
165
+ readonly type: "uint256";
166
+ }];
167
+ readonly name: "Approval";
168
+ readonly type: "event";
169
+ }, {
170
+ readonly anonymous: false;
171
+ readonly inputs: readonly [];
172
+ readonly name: "EIP712DomainChanged";
173
+ readonly type: "event";
174
+ }, {
175
+ readonly anonymous: false;
176
+ readonly inputs: readonly [{
177
+ readonly indexed: true;
178
+ readonly internalType: "bytes32";
179
+ readonly name: "role";
180
+ readonly type: "bytes32";
181
+ }, {
182
+ readonly indexed: true;
183
+ readonly internalType: "bytes32";
184
+ readonly name: "previousAdminRole";
185
+ readonly type: "bytes32";
186
+ }, {
187
+ readonly indexed: true;
188
+ readonly internalType: "bytes32";
189
+ readonly name: "newAdminRole";
190
+ readonly type: "bytes32";
191
+ }];
192
+ readonly name: "RoleAdminChanged";
193
+ readonly type: "event";
194
+ }, {
195
+ readonly anonymous: false;
196
+ readonly inputs: readonly [{
197
+ readonly indexed: true;
198
+ readonly internalType: "bytes32";
199
+ readonly name: "role";
200
+ readonly type: "bytes32";
201
+ }, {
202
+ readonly indexed: true;
203
+ readonly internalType: "address";
204
+ readonly name: "account";
205
+ readonly type: "address";
206
+ }, {
207
+ readonly indexed: true;
208
+ readonly internalType: "address";
209
+ readonly name: "sender";
210
+ readonly type: "address";
211
+ }];
212
+ readonly name: "RoleGranted";
213
+ readonly type: "event";
214
+ }, {
215
+ readonly anonymous: false;
216
+ readonly inputs: readonly [{
217
+ readonly indexed: true;
218
+ readonly internalType: "bytes32";
219
+ readonly name: "role";
220
+ readonly type: "bytes32";
221
+ }, {
222
+ readonly indexed: true;
223
+ readonly internalType: "address";
224
+ readonly name: "account";
225
+ readonly type: "address";
226
+ }, {
227
+ readonly indexed: true;
228
+ readonly internalType: "address";
229
+ readonly name: "sender";
230
+ readonly type: "address";
231
+ }];
232
+ readonly name: "RoleRevoked";
233
+ readonly type: "event";
234
+ }, {
235
+ readonly anonymous: false;
236
+ readonly inputs: readonly [{
237
+ readonly indexed: true;
238
+ readonly internalType: "address";
239
+ readonly name: "from";
240
+ readonly type: "address";
241
+ }, {
242
+ readonly indexed: true;
243
+ readonly internalType: "address";
244
+ readonly name: "to";
245
+ readonly type: "address";
246
+ }, {
247
+ readonly indexed: false;
248
+ readonly internalType: "uint256";
249
+ readonly name: "value";
250
+ readonly type: "uint256";
251
+ }];
252
+ readonly name: "Transfer";
253
+ readonly type: "event";
254
+ }, {
255
+ readonly inputs: readonly [];
256
+ readonly name: "DEFAULT_ADMIN_ROLE";
257
+ readonly outputs: readonly [{
258
+ readonly internalType: "bytes32";
259
+ readonly name: "";
260
+ readonly type: "bytes32";
261
+ }];
262
+ readonly stateMutability: "view";
263
+ readonly type: "function";
264
+ }, {
265
+ readonly inputs: readonly [];
266
+ readonly name: "DOMAIN_SEPARATOR";
267
+ readonly outputs: readonly [{
268
+ readonly internalType: "bytes32";
269
+ readonly name: "";
270
+ readonly type: "bytes32";
271
+ }];
272
+ readonly stateMutability: "view";
273
+ readonly type: "function";
274
+ }, {
275
+ readonly inputs: readonly [{
276
+ readonly internalType: "address";
277
+ readonly name: "owner";
278
+ readonly type: "address";
279
+ }, {
280
+ readonly internalType: "address";
281
+ readonly name: "spender";
282
+ readonly type: "address";
283
+ }];
284
+ readonly name: "allowance";
285
+ readonly outputs: readonly [{
286
+ readonly internalType: "uint256";
287
+ readonly name: "";
288
+ readonly type: "uint256";
289
+ }];
290
+ readonly stateMutability: "view";
291
+ readonly type: "function";
292
+ }, {
293
+ readonly inputs: readonly [{
294
+ readonly internalType: "address";
295
+ readonly name: "spender";
296
+ readonly type: "address";
297
+ }, {
298
+ readonly internalType: "uint256";
299
+ readonly name: "value";
300
+ readonly type: "uint256";
301
+ }];
302
+ readonly name: "approve";
303
+ readonly outputs: readonly [{
304
+ readonly internalType: "bool";
305
+ readonly name: "";
306
+ readonly type: "bool";
307
+ }];
308
+ readonly stateMutability: "nonpayable";
309
+ readonly type: "function";
310
+ }, {
311
+ readonly inputs: readonly [{
312
+ readonly internalType: "address";
313
+ readonly name: "account";
314
+ readonly type: "address";
315
+ }];
316
+ readonly name: "balanceOf";
317
+ readonly outputs: readonly [{
318
+ readonly internalType: "uint256";
319
+ readonly name: "";
320
+ readonly type: "uint256";
321
+ }];
322
+ readonly stateMutability: "view";
323
+ readonly type: "function";
324
+ }, {
325
+ readonly inputs: readonly [{
326
+ readonly internalType: "address";
327
+ readonly name: "from";
328
+ readonly type: "address";
329
+ }, {
330
+ readonly internalType: "uint256";
331
+ readonly name: "amount";
332
+ readonly type: "uint256";
333
+ }];
334
+ readonly name: "burn";
335
+ readonly outputs: readonly [];
336
+ readonly stateMutability: "nonpayable";
337
+ readonly type: "function";
338
+ }, {
339
+ readonly inputs: readonly [];
340
+ readonly name: "decimals";
341
+ readonly outputs: readonly [{
342
+ readonly internalType: "uint8";
343
+ readonly name: "";
344
+ readonly type: "uint8";
345
+ }];
346
+ readonly stateMutability: "view";
347
+ readonly type: "function";
348
+ }, {
349
+ readonly inputs: readonly [];
350
+ readonly name: "eip712Domain";
351
+ readonly outputs: readonly [{
352
+ readonly internalType: "bytes1";
353
+ readonly name: "fields";
354
+ readonly type: "bytes1";
355
+ }, {
356
+ readonly internalType: "string";
357
+ readonly name: "name";
358
+ readonly type: "string";
359
+ }, {
360
+ readonly internalType: "string";
361
+ readonly name: "version";
362
+ readonly type: "string";
363
+ }, {
364
+ readonly internalType: "uint256";
365
+ readonly name: "chainId";
366
+ readonly type: "uint256";
367
+ }, {
368
+ readonly internalType: "address";
369
+ readonly name: "verifyingContract";
370
+ readonly type: "address";
371
+ }, {
372
+ readonly internalType: "bytes32";
373
+ readonly name: "salt";
374
+ readonly type: "bytes32";
375
+ }, {
376
+ readonly internalType: "uint256[]";
377
+ readonly name: "extensions";
378
+ readonly type: "uint256[]";
379
+ }];
380
+ readonly stateMutability: "view";
381
+ readonly type: "function";
382
+ }, {
383
+ readonly inputs: readonly [{
384
+ readonly internalType: "bytes32";
385
+ readonly name: "role";
386
+ readonly type: "bytes32";
387
+ }];
388
+ readonly name: "getRoleAdmin";
389
+ readonly outputs: readonly [{
390
+ readonly internalType: "bytes32";
391
+ readonly name: "";
392
+ readonly type: "bytes32";
393
+ }];
394
+ readonly stateMutability: "view";
395
+ readonly type: "function";
396
+ }, {
397
+ readonly inputs: readonly [{
398
+ readonly internalType: "bytes32";
399
+ readonly name: "role";
400
+ readonly type: "bytes32";
401
+ }, {
402
+ readonly internalType: "address";
403
+ readonly name: "account";
404
+ readonly type: "address";
405
+ }];
406
+ readonly name: "grantRole";
407
+ readonly outputs: readonly [];
408
+ readonly stateMutability: "nonpayable";
409
+ readonly type: "function";
410
+ }, {
411
+ readonly inputs: readonly [{
412
+ readonly internalType: "bytes32";
413
+ readonly name: "role";
414
+ readonly type: "bytes32";
415
+ }, {
416
+ readonly internalType: "address";
417
+ readonly name: "account";
418
+ readonly type: "address";
419
+ }];
420
+ readonly name: "hasRole";
421
+ readonly outputs: readonly [{
422
+ readonly internalType: "bool";
423
+ readonly name: "";
424
+ readonly type: "bool";
425
+ }];
426
+ readonly stateMutability: "view";
427
+ readonly type: "function";
428
+ }, {
429
+ readonly inputs: readonly [{
430
+ readonly internalType: "address";
431
+ readonly name: "to";
432
+ readonly type: "address";
433
+ }, {
434
+ readonly internalType: "uint256";
435
+ readonly name: "amount";
436
+ readonly type: "uint256";
437
+ }];
438
+ readonly name: "mint";
439
+ readonly outputs: readonly [];
440
+ readonly stateMutability: "nonpayable";
441
+ readonly type: "function";
442
+ }, {
443
+ readonly inputs: readonly [];
444
+ readonly name: "name";
445
+ readonly outputs: readonly [{
446
+ readonly internalType: "string";
447
+ readonly name: "";
448
+ readonly type: "string";
449
+ }];
450
+ readonly stateMutability: "view";
451
+ readonly type: "function";
452
+ }, {
453
+ readonly inputs: readonly [{
454
+ readonly internalType: "address";
455
+ readonly name: "owner";
456
+ readonly type: "address";
457
+ }];
458
+ readonly name: "nonces";
459
+ readonly outputs: readonly [{
460
+ readonly internalType: "uint256";
461
+ readonly name: "";
462
+ readonly type: "uint256";
463
+ }];
464
+ readonly stateMutability: "view";
465
+ readonly type: "function";
466
+ }, {
467
+ readonly inputs: readonly [{
468
+ readonly internalType: "address";
469
+ readonly name: "owner";
470
+ readonly type: "address";
471
+ }, {
472
+ readonly internalType: "address";
473
+ readonly name: "spender";
474
+ readonly type: "address";
475
+ }, {
476
+ readonly internalType: "uint256";
477
+ readonly name: "value";
478
+ readonly type: "uint256";
479
+ }, {
480
+ readonly internalType: "uint256";
481
+ readonly name: "deadline";
482
+ readonly type: "uint256";
483
+ }, {
484
+ readonly internalType: "uint8";
485
+ readonly name: "v";
486
+ readonly type: "uint8";
487
+ }, {
488
+ readonly internalType: "bytes32";
489
+ readonly name: "r";
490
+ readonly type: "bytes32";
491
+ }, {
492
+ readonly internalType: "bytes32";
493
+ readonly name: "s";
494
+ readonly type: "bytes32";
495
+ }];
496
+ readonly name: "permit";
497
+ readonly outputs: readonly [];
498
+ readonly stateMutability: "nonpayable";
499
+ readonly type: "function";
500
+ }, {
501
+ readonly inputs: readonly [{
502
+ readonly internalType: "bytes32";
503
+ readonly name: "role";
504
+ readonly type: "bytes32";
505
+ }, {
506
+ readonly internalType: "address";
507
+ readonly name: "callerConfirmation";
508
+ readonly type: "address";
509
+ }];
510
+ readonly name: "renounceRole";
511
+ readonly outputs: readonly [];
512
+ readonly stateMutability: "nonpayable";
513
+ readonly type: "function";
514
+ }, {
515
+ readonly inputs: readonly [{
516
+ readonly internalType: "bytes32";
517
+ readonly name: "role";
518
+ readonly type: "bytes32";
519
+ }, {
520
+ readonly internalType: "address";
521
+ readonly name: "account";
522
+ readonly type: "address";
523
+ }];
524
+ readonly name: "revokeRole";
525
+ readonly outputs: readonly [];
526
+ readonly stateMutability: "nonpayable";
527
+ readonly type: "function";
528
+ }, {
529
+ readonly inputs: readonly [{
530
+ readonly internalType: "bytes4";
531
+ readonly name: "interfaceId";
532
+ readonly type: "bytes4";
533
+ }];
534
+ readonly name: "supportsInterface";
535
+ readonly outputs: readonly [{
536
+ readonly internalType: "bool";
537
+ readonly name: "";
538
+ readonly type: "bool";
539
+ }];
540
+ readonly stateMutability: "view";
541
+ readonly type: "function";
542
+ }, {
543
+ readonly inputs: readonly [];
544
+ readonly name: "symbol";
545
+ readonly outputs: readonly [{
546
+ readonly internalType: "string";
547
+ readonly name: "";
548
+ readonly type: "string";
549
+ }];
550
+ readonly stateMutability: "view";
551
+ readonly type: "function";
552
+ }, {
553
+ readonly inputs: readonly [];
554
+ readonly name: "totalSupply";
555
+ readonly outputs: readonly [{
556
+ readonly internalType: "uint256";
557
+ readonly name: "";
558
+ readonly type: "uint256";
559
+ }];
560
+ readonly stateMutability: "view";
561
+ readonly type: "function";
562
+ }, {
563
+ readonly inputs: readonly [{
564
+ readonly internalType: "address";
565
+ readonly name: "to";
566
+ readonly type: "address";
567
+ }, {
568
+ readonly internalType: "uint256";
569
+ readonly name: "value";
570
+ readonly type: "uint256";
571
+ }];
572
+ readonly name: "transfer";
573
+ readonly outputs: readonly [{
574
+ readonly internalType: "bool";
575
+ readonly name: "";
576
+ readonly type: "bool";
577
+ }];
578
+ readonly stateMutability: "nonpayable";
579
+ readonly type: "function";
580
+ }, {
581
+ readonly inputs: readonly [{
582
+ readonly internalType: "address";
583
+ readonly name: "from";
584
+ readonly type: "address";
585
+ }, {
586
+ readonly internalType: "address";
587
+ readonly name: "to";
588
+ readonly type: "address";
589
+ }, {
590
+ readonly internalType: "uint256";
591
+ readonly name: "value";
592
+ readonly type: "uint256";
593
+ }];
594
+ readonly name: "transferFrom";
595
+ readonly outputs: readonly [{
596
+ readonly internalType: "bool";
597
+ readonly name: "";
598
+ readonly type: "bool";
599
+ }];
600
+ readonly stateMutability: "nonpayable";
601
+ readonly type: "function";
602
+ }];
@@ -0,0 +1 @@
1
+ export const USDRAbi = [{ "inputs": [], "stateMutability": "nonpayable", "type": "constructor" }, { "inputs": [], "name": "AccessControlBadConfirmation", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "account", "type": "address" }, { "internalType": "bytes32", "name": "neededRole", "type": "bytes32" }], "name": "AccessControlUnauthorizedAccount", "type": "error" }, { "inputs": [], "name": "ECDSAInvalidSignature", "type": "error" }, { "inputs": [{ "internalType": "uint256", "name": "length", "type": "uint256" }], "name": "ECDSAInvalidSignatureLength", "type": "error" }, { "inputs": [{ "internalType": "bytes32", "name": "s", "type": "bytes32" }], "name": "ECDSAInvalidSignatureS", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "spender", "type": "address" }, { "internalType": "uint256", "name": "allowance", "type": "uint256" }, { "internalType": "uint256", "name": "needed", "type": "uint256" }], "name": "ERC20InsufficientAllowance", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "sender", "type": "address" }, { "internalType": "uint256", "name": "balance", "type": "uint256" }, { "internalType": "uint256", "name": "needed", "type": "uint256" }], "name": "ERC20InsufficientBalance", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "approver", "type": "address" }], "name": "ERC20InvalidApprover", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "receiver", "type": "address" }], "name": "ERC20InvalidReceiver", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "sender", "type": "address" }], "name": "ERC20InvalidSender", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "spender", "type": "address" }], "name": "ERC20InvalidSpender", "type": "error" }, { "inputs": [{ "internalType": "uint256", "name": "deadline", "type": "uint256" }], "name": "ERC2612ExpiredSignature", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "signer", "type": "address" }, { "internalType": "address", "name": "owner", "type": "address" }], "name": "ERC2612InvalidSigner", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "account", "type": "address" }, { "internalType": "uint256", "name": "currentNonce", "type": "uint256" }], "name": "InvalidAccountNonce", "type": "error" }, { "inputs": [], "name": "InvalidShortString", "type": "error" }, { "inputs": [{ "internalType": "string", "name": "str", "type": "string" }], "name": "StringTooLong", "type": "error" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "spender", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" }], "name": "Approval", "type": "event" }, { "anonymous": false, "inputs": [], "name": "EIP712DomainChanged", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "indexed": true, "internalType": "bytes32", "name": "previousAdminRole", "type": "bytes32" }, { "indexed": true, "internalType": "bytes32", "name": "newAdminRole", "type": "bytes32" }], "name": "RoleAdminChanged", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "indexed": true, "internalType": "address", "name": "account", "type": "address" }, { "indexed": true, "internalType": "address", "name": "sender", "type": "address" }], "name": "RoleGranted", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "indexed": true, "internalType": "address", "name": "account", "type": "address" }, { "indexed": true, "internalType": "address", "name": "sender", "type": "address" }], "name": "RoleRevoked", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "from", "type": "address" }, { "indexed": true, "internalType": "address", "name": "to", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" }], "name": "Transfer", "type": "event" }, { "inputs": [], "name": "DEFAULT_ADMIN_ROLE", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "DOMAIN_SEPARATOR", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "address", "name": "spender", "type": "address" }], "name": "allowance", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "spender", "type": "address" }, { "internalType": "uint256", "name": "value", "type": "uint256" }], "name": "approve", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], "name": "balanceOf", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "from", "type": "address" }, { "internalType": "uint256", "name": "amount", "type": "uint256" }], "name": "burn", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "decimals", "outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "eip712Domain", "outputs": [{ "internalType": "bytes1", "name": "fields", "type": "bytes1" }, { "internalType": "string", "name": "name", "type": "string" }, { "internalType": "string", "name": "version", "type": "string" }, { "internalType": "uint256", "name": "chainId", "type": "uint256" }, { "internalType": "address", "name": "verifyingContract", "type": "address" }, { "internalType": "bytes32", "name": "salt", "type": "bytes32" }, { "internalType": "uint256[]", "name": "extensions", "type": "uint256[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }], "name": "getRoleAdmin", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "internalType": "address", "name": "account", "type": "address" }], "name": "grantRole", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "internalType": "address", "name": "account", "type": "address" }], "name": "hasRole", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "amount", "type": "uint256" }], "name": "mint", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "name", "outputs": [{ "internalType": "string", "name": "", "type": "string" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "owner", "type": "address" }], "name": "nonces", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "address", "name": "spender", "type": "address" }, { "internalType": "uint256", "name": "value", "type": "uint256" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" }], "name": "permit", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "internalType": "address", "name": "callerConfirmation", "type": "address" }], "name": "renounceRole", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "internalType": "address", "name": "account", "type": "address" }], "name": "revokeRole", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "bytes4", "name": "interfaceId", "type": "bytes4" }], "name": "supportsInterface", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "symbol", "outputs": [{ "internalType": "string", "name": "", "type": "string" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "totalSupply", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "value", "type": "uint256" }], "name": "transfer", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "from", "type": "address" }, { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "value", "type": "uint256" }], "name": "transferFrom", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "nonpayable", "type": "function" }];
@@ -16,6 +16,7 @@ export declare const ENV_CONFIG: {
16
16
  readonly tokens: {
17
17
  readonly usdt: TokenConfig;
18
18
  readonly rain: TokenConfig;
19
+ readonly usdr: TokenConfig;
19
20
  };
20
21
  };
21
22
  readonly stage: {
@@ -25,6 +26,7 @@ export declare const ENV_CONFIG: {
25
26
  readonly tokens: {
26
27
  readonly usdt: TokenConfig;
27
28
  readonly rain: TokenConfig;
29
+ readonly usdr: TokenConfig;
28
30
  };
29
31
  };
30
32
  readonly production: {
@@ -34,6 +36,7 @@ export declare const ENV_CONFIG: {
34
36
  readonly tokens: {
35
37
  readonly usdt: TokenConfig;
36
38
  readonly rain: TokenConfig;
39
+ readonly usdr: TokenConfig;
37
40
  };
38
41
  };
39
42
  };
@@ -27,6 +27,12 @@ export const ENV_CONFIG = {
27
27
  decimals: 18,
28
28
  oracle_fixed_fee_per_option: 1000000000000000000n, // $1 in 18 decimals
29
29
  },
30
+ usdr: {
31
+ address: "0xC1aeb1D39008337E127698c10f6338E93E5f3369",
32
+ symbol: "USDR",
33
+ decimals: 18,
34
+ oracle_fixed_fee_per_option: 1000000000000000000n, // $1 in 18 decimals
35
+ },
30
36
  },
31
37
  },
32
38
  stage: {
@@ -46,6 +52,12 @@ export const ENV_CONFIG = {
46
52
  decimals: 18,
47
53
  oracle_fixed_fee_per_option: 1000000000000000000n,
48
54
  },
55
+ usdr: {
56
+ address: "0xC1aeb1D39008337E127698c10f6338E93E5f3369",
57
+ symbol: "USDR",
58
+ decimals: 18,
59
+ oracle_fixed_fee_per_option: 1000000000000000000n,
60
+ },
49
61
  },
50
62
  },
51
63
  production: {
@@ -65,6 +77,12 @@ export const ENV_CONFIG = {
65
77
  decimals: 18,
66
78
  oracle_fixed_fee_per_option: 1000000000000000000n,
67
79
  },
80
+ usdr: {
81
+ address: "0xC1aeb1D39008337E127698c10f6338E93E5f3369",
82
+ symbol: "USDR",
83
+ decimals: 18,
84
+ oracle_fixed_fee_per_option: 1000000000000000000n,
85
+ },
68
86
  },
69
87
  },
70
88
  };
package/dist/index.d.ts CHANGED
@@ -8,6 +8,8 @@ export { signLoginMessage } from './auth/signMessage.js';
8
8
  export type { ExtendTimeTxParams } from './tx/buildExtendTimeRawTx.js';
9
9
  export type { CalculateWinnerTxParams } from './tx/buildCalculateWinnerRawTx.js';
10
10
  export type { TokenConfig } from './config/environments.js';
11
+ export type { OptionDisputeInfo, OptionAppealInfo } from './markets/getDisputeState.js';
12
+ export { USDRAbi } from './abi/USDRAbi.js';
11
13
  export * from './api/index.js';
12
14
  export { RainSocket } from './socket/RainSocket.js';
13
15
  export type { RainSocketEvent, EnterOptionEventData, ExitOptionEventData, LiquidityEventData, SplitEventData, MergeEventData, RemoveLiquidityEventData, SyncPriceEventData, OrderCreatedEventData, OrderCancelledEventData, OrderFilledEventData, PoolClosedEventData, PoolEventData, WinnerEventData, DisputeOpenedEventData, OracleCreatedEventData, AppealOpenedEventData, DisputeWinnerEventData, AppealWinnerEventData, ClaimRewardEventData, DisputeRefundEventData } from './socket/RainSocket.js';
package/dist/index.js CHANGED
@@ -3,5 +3,6 @@ export { RainAA } from './RainAA.js';
3
3
  export * from './types.js';
4
4
  export { TradingModel, OptionSide } from './tx/types.js';
5
5
  export { signLoginMessage } from './auth/signMessage.js';
6
+ export { USDRAbi } from './abi/USDRAbi.js';
6
7
  export * from './api/index.js';
7
8
  export { RainSocket } from './socket/RainSocket.js';
@@ -0,0 +1,24 @@
1
+ export interface OptionDisputeInfo {
2
+ disputeFee: bigint;
3
+ disputedWinner: bigint;
4
+ disputer: `0x${string}`;
5
+ disputeResolver: `0x${string}`;
6
+ }
7
+ export interface OptionAppealInfo {
8
+ disputeFee: bigint;
9
+ disputedWinner: bigint;
10
+ disputer: `0x${string}`;
11
+ appealResolver: `0x${string}`;
12
+ }
13
+ interface OptionReadParams {
14
+ marketContractAddress: `0x${string}`;
15
+ option: bigint;
16
+ rpcUrl: string;
17
+ }
18
+ export declare function optionResolverBond(params: OptionReadParams): Promise<bigint>;
19
+ export declare function optionResolutionProposer(params: OptionReadParams): Promise<`0x${string}`>;
20
+ export declare function isOptionDisputed(params: OptionReadParams): Promise<boolean>;
21
+ export declare function isOptionAppealed(params: OptionReadParams): Promise<boolean>;
22
+ export declare function optionDispute(params: OptionReadParams): Promise<OptionDisputeInfo>;
23
+ export declare function optionAppeal(params: OptionReadParams): Promise<OptionAppealInfo>;
24
+ export {};
@@ -0,0 +1,69 @@
1
+ import { createPublicClient, http } from 'viem';
2
+ import { arbitrum } from 'viem/chains';
3
+ import { MarketsAbi } from '../abi/MarketsAbi.js';
4
+ function client(rpcUrl) {
5
+ return createPublicClient({
6
+ chain: arbitrum,
7
+ transport: http(rpcUrl),
8
+ });
9
+ }
10
+ export async function optionResolverBond(params) {
11
+ const { marketContractAddress, option, rpcUrl } = params;
12
+ const bond = await client(rpcUrl).readContract({
13
+ address: marketContractAddress,
14
+ abi: MarketsAbi,
15
+ functionName: 'optionResolverBond',
16
+ args: [option],
17
+ });
18
+ return bond;
19
+ }
20
+ export async function optionResolutionProposer(params) {
21
+ const { marketContractAddress, option, rpcUrl } = params;
22
+ const proposer = await client(rpcUrl).readContract({
23
+ address: marketContractAddress,
24
+ abi: MarketsAbi,
25
+ functionName: 'optionResolutionProposer',
26
+ args: [option],
27
+ });
28
+ return proposer;
29
+ }
30
+ export async function isOptionDisputed(params) {
31
+ const { marketContractAddress, option, rpcUrl } = params;
32
+ const disputed = await client(rpcUrl).readContract({
33
+ address: marketContractAddress,
34
+ abi: MarketsAbi,
35
+ functionName: 'isOptionDisputed',
36
+ args: [option],
37
+ });
38
+ return disputed;
39
+ }
40
+ export async function isOptionAppealed(params) {
41
+ const { marketContractAddress, option, rpcUrl } = params;
42
+ const appealed = await client(rpcUrl).readContract({
43
+ address: marketContractAddress,
44
+ abi: MarketsAbi,
45
+ functionName: 'isOptionAppealed',
46
+ args: [option],
47
+ });
48
+ return appealed;
49
+ }
50
+ export async function optionDispute(params) {
51
+ const { marketContractAddress, option, rpcUrl } = params;
52
+ const [disputeFee, disputedWinner, disputer, disputeResolver] = await client(rpcUrl).readContract({
53
+ address: marketContractAddress,
54
+ abi: MarketsAbi,
55
+ functionName: 'optionDispute',
56
+ args: [option],
57
+ });
58
+ return { disputeFee, disputedWinner, disputer, disputeResolver };
59
+ }
60
+ export async function optionAppeal(params) {
61
+ const { marketContractAddress, option, rpcUrl } = params;
62
+ const [disputeFee, disputedWinner, disputer, appealResolver] = await client(rpcUrl).readContract({
63
+ address: marketContractAddress,
64
+ abi: MarketsAbi,
65
+ functionName: 'optionAppeal',
66
+ args: [option],
67
+ });
68
+ return { disputeFee, disputedWinner, disputer, appealResolver };
69
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rain-sdk-v2",
3
- "version": "2.1.4",
3
+ "version": "2.1.6",
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",