rain-sdk-v2 2.0.6 → 2.0.8
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 +77 -0
- package/dist/Rain.d.ts +11 -1
- package/dist/Rain.js +12 -0
- package/dist/abi/MarketsAbi.d.ts +91 -0
- package/dist/abi/MarketsAbi.js +1 -1
- package/dist/abi/OracleAbi.d.ts +14 -0
- package/dist/abi/OracleAbi.js +18 -0
- package/dist/constants/contractmethods.d.ts +1 -0
- package/dist/constants/contractmethods.js +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/markets/getEntryShares.d.ts +12 -0
- package/dist/markets/getEntryShares.js +20 -0
- package/dist/tx/buildAddLiquidityRawTx.js +2 -2
- package/dist/tx/buildEnterOptionRawTx.js +2 -2
- package/dist/tx/buildExtendTimeRawTx.d.ts +10 -0
- package/dist/tx/buildExtendTimeRawTx.js +37 -0
- package/dist/tx/buildRemoveLiquidityRawTx.js +2 -2
- package/dist/tx/buildSellOptionRawTx.d.ts +2 -0
- package/dist/tx/buildSellOptionRawTx.js +27 -0
- package/dist/tx/types.d.ts +8 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -228,6 +228,34 @@ const txs = await rain.buildEnterOptionTx({
|
|
|
228
228
|
|
|
229
229
|
---
|
|
230
230
|
|
|
231
|
+
#### `buildSellOptionTx(params): Promise<RawTransaction>`
|
|
232
|
+
|
|
233
|
+
Market-sell shares of an option into the resting buy order book. No approval needed (you're selling shares, not tokens). Slippage protection is auto-calculated from on-chain `getCurrentPrice`.
|
|
234
|
+
|
|
235
|
+
```typescript
|
|
236
|
+
const tx = await rain.buildSellOptionTx({
|
|
237
|
+
marketContractAddress: '0x...',
|
|
238
|
+
selectedOption: 1n, // 1-based option index
|
|
239
|
+
optionSide: OptionSide.Yes, // Yes = 1, No = 2
|
|
240
|
+
sharesAmount: parseUnits('10', 6), // shares to sell
|
|
241
|
+
slippageTolerance: 5n, // optional, default 5%
|
|
242
|
+
deadline: 600n, // optional, default 600 (10 min) — duration in seconds
|
|
243
|
+
});
|
|
244
|
+
// Returns a single RawTransaction (no approval needed)
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
| Parameter | Type | Description |
|
|
248
|
+
|-----------|------|-------------|
|
|
249
|
+
| `marketContractAddress` | `0x${string}` | Market contract address |
|
|
250
|
+
| `selectedOption` | `bigint` | Option index (1-based) |
|
|
251
|
+
| `optionSide` | `OptionSide` | `Yes (1)` or `No (2)` |
|
|
252
|
+
| `sharesAmount` | `bigint` | Number of shares to sell |
|
|
253
|
+
| `minAmountOut` | `bigint` | *(Optional)* Minimum base tokens to receive. Auto-calculated from `getCurrentPrice` with slippage if not set |
|
|
254
|
+
| `slippageTolerance` | `bigint` | *(Optional)* Slippage percentage (e.g. `5n` = 5%). Default: 5% |
|
|
255
|
+
| `deadline` | `bigint` | *(Optional)* Duration in seconds (e.g. `600n` = 10 min). Default: 600 |
|
|
256
|
+
|
|
257
|
+
---
|
|
258
|
+
|
|
231
259
|
### Split & Merge
|
|
232
260
|
|
|
233
261
|
#### `buildSplitTx(params): Promise<RawTransaction[]>`
|
|
@@ -431,6 +459,35 @@ const tx = await rain.buildCalculateWinnerTx({
|
|
|
431
459
|
|
|
432
460
|
---
|
|
433
461
|
|
|
462
|
+
#### `buildExtendTimeTx(params: ExtendTimeTxParams): Promise<RawTransaction>`
|
|
463
|
+
|
|
464
|
+
Extend the resolution time of a market option. Requires a signature from the oracle backend (obtained via `signOraclesExtendTime` API). Reads `optionResolver(option)` from the market and calls `extendTime(newEndTime, signature)` on that resolver contract.
|
|
465
|
+
|
|
466
|
+
```typescript
|
|
467
|
+
// 1. Get the signature from the API
|
|
468
|
+
const signResult = await rain.signOraclesExtendTime(
|
|
469
|
+
{ contractAddress: '0x...', walletAddress: '0x...' },
|
|
470
|
+
accessToken
|
|
471
|
+
);
|
|
472
|
+
|
|
473
|
+
// 2. Build the extend time transaction
|
|
474
|
+
const tx = await rain.buildExtendTimeTx({
|
|
475
|
+
marketContractAddress: '0x...',
|
|
476
|
+
option: 1n,
|
|
477
|
+
newEndTime: BigInt(Math.floor(Date.now() / 1000) + 86400), // extend by 1 day
|
|
478
|
+
signature: signResult.signature, // from API
|
|
479
|
+
});
|
|
480
|
+
```
|
|
481
|
+
|
|
482
|
+
| Param | Type | Description |
|
|
483
|
+
|---|---|---|
|
|
484
|
+
| `marketContractAddress` | `0x${string}` | Market contract address |
|
|
485
|
+
| `option` | `bigint` | Option index (1-based) |
|
|
486
|
+
| `newEndTime` | `bigint` | New end time as unix timestamp (seconds) |
|
|
487
|
+
| `signature` | `0x${string}` | Backend signature from `signOraclesExtendTime` |
|
|
488
|
+
|
|
489
|
+
---
|
|
490
|
+
|
|
434
491
|
### Claiming
|
|
435
492
|
|
|
436
493
|
#### `buildClaimTx(params: ClaimTxParams): RawTransaction`
|
|
@@ -531,6 +588,21 @@ const claimed = await rain.getOptionClaimed({
|
|
|
531
588
|
// true if already claimed, false otherwise
|
|
532
589
|
```
|
|
533
590
|
|
|
591
|
+
### `getEntryShares(params): Promise<{ returnedShares: bigint; expectedReward: bigint }>`
|
|
592
|
+
|
|
593
|
+
Calculate how many shares you'd receive for a given buy amount, plus the expected reward.
|
|
594
|
+
|
|
595
|
+
```typescript
|
|
596
|
+
const result = await rain.getEntryShares({
|
|
597
|
+
marketContractAddress: '0x...',
|
|
598
|
+
option: 1n, // 1-based option index
|
|
599
|
+
optionSide: 1, // 1 = Yes, 2 = No
|
|
600
|
+
amount: 1000000n, // buy amount in base token wei
|
|
601
|
+
});
|
|
602
|
+
// result.returnedShares = shares you'd receive
|
|
603
|
+
// result.expectedReward = expected reward amount
|
|
604
|
+
```
|
|
605
|
+
|
|
534
606
|
### `getDisputeWindow(params): Promise<bigint>`
|
|
535
607
|
|
|
536
608
|
Get the dispute window duration (in seconds) for a market contract.
|
|
@@ -761,6 +833,11 @@ If disputed:
|
|
|
761
833
|
6c. Appeal (buildOpenDisputeTx again)
|
|
762
834
|
```
|
|
763
835
|
|
|
836
|
+
If extending time:
|
|
837
|
+
```
|
|
838
|
+
5b. Extend Time (signOraclesExtendTime API → buildExtendTimeTx)
|
|
839
|
+
```
|
|
840
|
+
|
|
764
841
|
---
|
|
765
842
|
|
|
766
843
|
## REST API Methods
|
package/dist/Rain.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { ApproveTxParams, CreateMarketTxParams, EnterOptionTxParams, AddLiquidityTxParams, RemoveLiquidityTxParams, SplitTxParams, MergeTxParams, ClosePoolAITxParams, ClosePoolManualTxParams, ChooseWinnerTxParams, PlaceBuyOrderTxParams, PlaceSellOrderTxParams, OpenDisputeTxParams, ClaimTxParams, CancelBuyOrdersTxParams, CancelSellOrdersTxParams, RawTransaction } from './tx/types.js';
|
|
1
|
+
import { ApproveTxParams, CreateMarketTxParams, EnterOptionTxParams, SellOptionTxParams, AddLiquidityTxParams, RemoveLiquidityTxParams, SplitTxParams, MergeTxParams, ClosePoolAITxParams, ClosePoolManualTxParams, ChooseWinnerTxParams, PlaceBuyOrderTxParams, PlaceSellOrderTxParams, OpenDisputeTxParams, ClaimTxParams, CancelBuyOrdersTxParams, CancelSellOrdersTxParams, RawTransaction } from './tx/types.js';
|
|
2
2
|
import { CalculateWinnerTxParams } from './tx/buildCalculateWinnerRawTx.js';
|
|
3
|
+
import { ExtendTimeTxParams } from './tx/buildExtendTimeRawTx.js';
|
|
3
4
|
import { RainCoreConfig, RainEnvironment } from './types.js';
|
|
4
5
|
import { LoginParams, LoginResult } from './auth/types.js';
|
|
6
|
+
import { EntrySharesResult } from './markets/getEntryShares.js';
|
|
5
7
|
import type { UserProfileUpdateParams, UserHistoryParams, CreateCommentParams, CommentsListingParams, UpdateCommentParams, CommentCountParams, PublicPoolsParams, PrivatePoolsParams, PoolListingByCreatorParams, VerifyAccessCodeParams, PoolTotalParticipantsParams, SearchPoolParams, RelatedPoolsParams, UpdateStreamingParams, UpdatePoolResolutionTimeParams, FindPoolFallbackParams, SignOraclesExtendTimeParams, UserTotalInvestmentParams, OptionsTotalVolumeParams, PoolActivityParams, TopHoldersParams, UserInvestedPoolsParams, InvestmentVolumeGraphParams, UserPnlGraphParams, TopWinnersLosersParams, PnlByPoolIdParams, PriceDataParams, AddReviewParams, GetUserOrdersParams, OrderBookParams, GetUserOrderByPoolIdParams, OrdersListingByPoolParams, AddUserPointsParams, UserOnboardingParams, PointsGraphParams, GetNotificationsParams, MarkNotificationAsReadParams, CreateDisputeMessageParams, GetPoolDisputeConvoParams, FollowToggleParams, FollowCheckParams, FollowListParams, FollowStatsParams, RainBurnPerPoolParams } from './api/types.js';
|
|
6
8
|
export declare class Rain {
|
|
7
9
|
readonly environment: RainEnvironment;
|
|
@@ -25,6 +27,7 @@ export declare class Rain {
|
|
|
25
27
|
buildEnterOptionTx(params: EnterOptionTxParams & {
|
|
26
28
|
walletAddress: `0x${string}`;
|
|
27
29
|
}): Promise<RawTransaction[]>;
|
|
30
|
+
buildSellOptionTx(params: SellOptionTxParams): RawTransaction;
|
|
28
31
|
buildAddLiquidityTx(params: AddLiquidityTxParams & {
|
|
29
32
|
walletAddress: `0x${string}`;
|
|
30
33
|
}): Promise<RawTransaction[]>;
|
|
@@ -54,6 +57,12 @@ export declare class Rain {
|
|
|
54
57
|
getDisputeWindow(params: {
|
|
55
58
|
marketContractAddress: `0x${string}`;
|
|
56
59
|
}): Promise<bigint>;
|
|
60
|
+
getEntryShares(params: {
|
|
61
|
+
marketContractAddress: `0x${string}`;
|
|
62
|
+
option: bigint;
|
|
63
|
+
optionSide: number;
|
|
64
|
+
amount: bigint;
|
|
65
|
+
}): Promise<EntrySharesResult>;
|
|
57
66
|
getDynamicPayout(params: {
|
|
58
67
|
marketContractAddress: `0x${string}`;
|
|
59
68
|
userAddress: `0x${string}`;
|
|
@@ -72,6 +81,7 @@ export declare class Rain {
|
|
|
72
81
|
buildPlaceSellOrderTx(params: PlaceSellOrderTxParams): RawTransaction;
|
|
73
82
|
buildOpenDisputeTx(params: OpenDisputeTxParams): Promise<RawTransaction[]>;
|
|
74
83
|
buildCalculateWinnerTx(params: CalculateWinnerTxParams): Promise<RawTransaction>;
|
|
84
|
+
buildExtendTimeTx(params: ExtendTimeTxParams): Promise<RawTransaction>;
|
|
75
85
|
buildClaimTx(params: ClaimTxParams): RawTransaction;
|
|
76
86
|
buildCancelBuyOrdersTx(params: CancelBuyOrdersTxParams): RawTransaction;
|
|
77
87
|
buildCancelSellOrdersTx(params: CancelSellOrdersTxParams): RawTransaction;
|
package/dist/Rain.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { buildApproveRawTx } from './tx/buildApprovalRawTx.js';
|
|
2
2
|
import { buildCreateMarketRawTx } from './tx/CreateMarket/buildCreateMarketRawTx.js';
|
|
3
3
|
import { buildEnterOptionRawTx } from './tx/buildEnterOptionRawTx.js';
|
|
4
|
+
import { buildSellOptionRawTx } from './tx/buildSellOptionRawTx.js';
|
|
4
5
|
import { buildAddLiquidityRawTx } from './tx/buildAddLiquidityRawTx.js';
|
|
5
6
|
import { buildRemoveLiquidityRawTx } from './tx/buildRemoveLiquidityRawTx.js';
|
|
6
7
|
import { buildSplitRawTx } from './tx/buildSplitRawTx.js';
|
|
@@ -11,6 +12,7 @@ import { buildOpenDisputeRawTx } from './tx/buildOpenDisputeRawTx.js';
|
|
|
11
12
|
import { buildClaimRawTx } from './tx/buildClaimRawTx.js';
|
|
12
13
|
import { buildCancelBuyOrdersRawTx, buildCancelSellOrdersRawTx } from './tx/buildCancelOrdersRawTx.js';
|
|
13
14
|
import { buildCalculateWinnerRawTx } from './tx/buildCalculateWinnerRawTx.js';
|
|
15
|
+
import { buildExtendTimeRawTx } from './tx/buildExtendTimeRawTx.js';
|
|
14
16
|
import { getUserActiveBuyOrders, getUserActiveSellOrders, getFirstBuyOrderPrice, getFirstSellOrderPrice, getBuyOrdersAtPrice, getSellOrdersAtPrice, checkOrderExists } from './markets/getOrderInfo.js';
|
|
15
17
|
import { ALLOWED_ENVIRONMENTS, ENV_CONFIG, getRandomRpc } from './config/environments.js';
|
|
16
18
|
import { loginUser } from './auth/login.js';
|
|
@@ -20,6 +22,7 @@ import { getDynamicPayout } from './markets/getDynamicPayout.js';
|
|
|
20
22
|
import { getUserSharesInEscrow } from './markets/getUserSharesInEscrow.js';
|
|
21
23
|
import { getOptionClaimed } from './markets/getOptionClaimed.js';
|
|
22
24
|
import { getDisputeWindow } from './markets/getDisputeWindow.js';
|
|
25
|
+
import { getEntryShares } from './markets/getEntryShares.js';
|
|
23
26
|
import { createPublicClient, http, parseAbi } from 'viem';
|
|
24
27
|
import { arbitrum } from 'viem/chains';
|
|
25
28
|
import * as usersApi from './api/users.js';
|
|
@@ -106,6 +109,9 @@ export class Rain {
|
|
|
106
109
|
async buildEnterOptionTx(params) {
|
|
107
110
|
return buildEnterOptionRawTx({ ...params, rpcUrl: this.rpcUrl });
|
|
108
111
|
}
|
|
112
|
+
buildSellOptionTx(params) {
|
|
113
|
+
return buildSellOptionRawTx(params);
|
|
114
|
+
}
|
|
109
115
|
async buildAddLiquidityTx(params) {
|
|
110
116
|
return buildAddLiquidityRawTx({ ...params, rpcUrl: this.rpcUrl });
|
|
111
117
|
}
|
|
@@ -127,6 +133,9 @@ export class Rain {
|
|
|
127
133
|
async getDisputeWindow(params) {
|
|
128
134
|
return getDisputeWindow({ ...params, rpcUrl: this.rpcUrl });
|
|
129
135
|
}
|
|
136
|
+
async getEntryShares(params) {
|
|
137
|
+
return getEntryShares({ ...params, rpcUrl: this.rpcUrl });
|
|
138
|
+
}
|
|
130
139
|
async getDynamicPayout(params) {
|
|
131
140
|
return getDynamicPayout({ ...params, rpcUrl: this.rpcUrl });
|
|
132
141
|
}
|
|
@@ -157,6 +166,9 @@ export class Rain {
|
|
|
157
166
|
async buildCalculateWinnerTx(params) {
|
|
158
167
|
return buildCalculateWinnerRawTx({ ...params, rpcUrl: this.rpcUrl });
|
|
159
168
|
}
|
|
169
|
+
async buildExtendTimeTx(params) {
|
|
170
|
+
return buildExtendTimeRawTx({ ...params, rpcUrl: this.rpcUrl });
|
|
171
|
+
}
|
|
160
172
|
buildClaimTx(params) {
|
|
161
173
|
return buildClaimRawTx(params);
|
|
162
174
|
}
|
package/dist/abi/MarketsAbi.d.ts
CHANGED
|
@@ -58,6 +58,16 @@ export declare const MarketsAbi: readonly [{
|
|
|
58
58
|
readonly internalType: "uint256";
|
|
59
59
|
}];
|
|
60
60
|
readonly stateMutability: "view";
|
|
61
|
+
}, {
|
|
62
|
+
readonly type: "function";
|
|
63
|
+
readonly name: "MAKER_REBATE_FEE";
|
|
64
|
+
readonly inputs: readonly [];
|
|
65
|
+
readonly outputs: readonly [{
|
|
66
|
+
readonly name: "";
|
|
67
|
+
readonly type: "uint256";
|
|
68
|
+
readonly internalType: "uint256";
|
|
69
|
+
}];
|
|
70
|
+
readonly stateMutability: "view";
|
|
61
71
|
}, {
|
|
62
72
|
readonly type: "function";
|
|
63
73
|
readonly name: "ORDER_EXECUTION_FEE";
|
|
@@ -1467,6 +1477,32 @@ export declare const MarketsAbi: readonly [{
|
|
|
1467
1477
|
readonly internalType: "uint256";
|
|
1468
1478
|
}];
|
|
1469
1479
|
readonly stateMutability: "view";
|
|
1480
|
+
}, {
|
|
1481
|
+
readonly type: "function";
|
|
1482
|
+
readonly name: "sellOption";
|
|
1483
|
+
readonly inputs: readonly [{
|
|
1484
|
+
readonly name: "option";
|
|
1485
|
+
readonly type: "uint256";
|
|
1486
|
+
readonly internalType: "uint256";
|
|
1487
|
+
}, {
|
|
1488
|
+
readonly name: "optionSide";
|
|
1489
|
+
readonly type: "uint8";
|
|
1490
|
+
readonly internalType: "uint8";
|
|
1491
|
+
}, {
|
|
1492
|
+
readonly name: "amount";
|
|
1493
|
+
readonly type: "uint256";
|
|
1494
|
+
readonly internalType: "uint256";
|
|
1495
|
+
}, {
|
|
1496
|
+
readonly name: "minAmountOut";
|
|
1497
|
+
readonly type: "uint256";
|
|
1498
|
+
readonly internalType: "uint256";
|
|
1499
|
+
}, {
|
|
1500
|
+
readonly name: "deadline";
|
|
1501
|
+
readonly type: "uint256";
|
|
1502
|
+
readonly internalType: "uint256";
|
|
1503
|
+
}];
|
|
1504
|
+
readonly outputs: readonly [];
|
|
1505
|
+
readonly stateMutability: "nonpayable";
|
|
1470
1506
|
}, {
|
|
1471
1507
|
readonly type: "function";
|
|
1472
1508
|
readonly name: "sellOrders";
|
|
@@ -2266,6 +2302,31 @@ export declare const MarketsAbi: readonly [{
|
|
|
2266
2302
|
readonly internalType: "address";
|
|
2267
2303
|
}];
|
|
2268
2304
|
readonly anonymous: false;
|
|
2305
|
+
}, {
|
|
2306
|
+
readonly type: "event";
|
|
2307
|
+
readonly name: "MakerRebate";
|
|
2308
|
+
readonly inputs: readonly [{
|
|
2309
|
+
readonly name: "maker";
|
|
2310
|
+
readonly type: "address";
|
|
2311
|
+
readonly indexed: true;
|
|
2312
|
+
readonly internalType: "address";
|
|
2313
|
+
}, {
|
|
2314
|
+
readonly name: "option";
|
|
2315
|
+
readonly type: "uint256";
|
|
2316
|
+
readonly indexed: false;
|
|
2317
|
+
readonly internalType: "uint256";
|
|
2318
|
+
}, {
|
|
2319
|
+
readonly name: "optionSide";
|
|
2320
|
+
readonly type: "uint8";
|
|
2321
|
+
readonly indexed: false;
|
|
2322
|
+
readonly internalType: "uint8";
|
|
2323
|
+
}, {
|
|
2324
|
+
readonly name: "amount";
|
|
2325
|
+
readonly type: "uint256";
|
|
2326
|
+
readonly indexed: false;
|
|
2327
|
+
readonly internalType: "uint256";
|
|
2328
|
+
}];
|
|
2329
|
+
readonly anonymous: false;
|
|
2269
2330
|
}, {
|
|
2270
2331
|
readonly type: "event";
|
|
2271
2332
|
readonly name: "Merge";
|
|
@@ -2616,6 +2677,36 @@ export declare const MarketsAbi: readonly [{
|
|
|
2616
2677
|
readonly internalType: "uint256";
|
|
2617
2678
|
}];
|
|
2618
2679
|
readonly anonymous: false;
|
|
2680
|
+
}, {
|
|
2681
|
+
readonly type: "event";
|
|
2682
|
+
readonly name: "SellOption";
|
|
2683
|
+
readonly inputs: readonly [{
|
|
2684
|
+
readonly name: "option";
|
|
2685
|
+
readonly type: "uint256";
|
|
2686
|
+
readonly indexed: false;
|
|
2687
|
+
readonly internalType: "uint256";
|
|
2688
|
+
}, {
|
|
2689
|
+
readonly name: "optionSide";
|
|
2690
|
+
readonly type: "uint8";
|
|
2691
|
+
readonly indexed: false;
|
|
2692
|
+
readonly internalType: "uint8";
|
|
2693
|
+
}, {
|
|
2694
|
+
readonly name: "baseAmount";
|
|
2695
|
+
readonly type: "uint256";
|
|
2696
|
+
readonly indexed: false;
|
|
2697
|
+
readonly internalType: "uint256";
|
|
2698
|
+
}, {
|
|
2699
|
+
readonly name: "sharesAmount";
|
|
2700
|
+
readonly type: "uint256";
|
|
2701
|
+
readonly indexed: false;
|
|
2702
|
+
readonly internalType: "uint256";
|
|
2703
|
+
}, {
|
|
2704
|
+
readonly name: "wallet";
|
|
2705
|
+
readonly type: "address";
|
|
2706
|
+
readonly indexed: false;
|
|
2707
|
+
readonly internalType: "address";
|
|
2708
|
+
}];
|
|
2709
|
+
readonly anonymous: false;
|
|
2619
2710
|
}, {
|
|
2620
2711
|
readonly type: "event";
|
|
2621
2712
|
readonly name: "Split";
|
package/dist/abi/MarketsAbi.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// Diamond proxy constructor ABI (for reference only — not used by SDK):
|
|
2
2
|
// export const MarketsDiamondAbi = [{"inputs":[{"components":[{"internalType":"address","name":"facetAddress","type":"address"},{"internalType":"enum IDiamondCut.FacetCutAction","name":"action","type":"uint8"},{"internalType":"bytes4[]","name":"functionSelectors","type":"bytes4[]"}],"internalType":"struct IDiamondCut.FacetCut[]","name":"_diamondCut","type":"tuple[]"},{"components":[{"internalType":"uint256","name":"initialLiquidity","type":"uint256"},{"internalType":"uint256[]","name":"liquidityPercentages","type":"uint256[]"},{"internalType":"uint256[]","name":"initialYesPrices","type":"uint256[]"},{"internalType":"bool","name":"isPublic","type":"bool"},{"internalType":"bool","name":"resolverIsAI","type":"bool"},{"internalType":"address","name":"deployerContract","type":"address"},{"internalType":"address","name":"baseToken","type":"address"},{"internalType":"address","name":"usdt","type":"address"},{"internalType":"address","name":"poolOwner","type":"address"},{"internalType":"address","name":"platformAddress","type":"address"},{"internalType":"address","name":"resolver","type":"address"},{"internalType":"address","name":"disputeResolver","type":"address"},{"internalType":"address","name":"rainToken","type":"address"},{"internalType":"address","name":"referrer","type":"address"},{"internalType":"uint256","name":"baseTokenDecimals","type":"uint256"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"uint256","name":"numberOfOptions","type":"uint256"},{"internalType":"uint256","name":"platformFee","type":"uint256"},{"internalType":"uint256","name":"liquidityFee","type":"uint256"},{"internalType":"uint256","name":"creatorFee","type":"uint256"},{"internalType":"uint256","name":"resultResolverFee","type":"uint256"},{"internalType":"uint256","name":"closingFee","type":"uint256"},{"internalType":"uint256","name":"oracleFixedFee","type":"uint256"},{"internalType":"uint256","name":"oracleEndTime","type":"uint256"},{"internalType":"string","name":"ipfsUri","type":"string"},{"components":[{"internalType":"enum IRainDeployer.TokenPool","name":"tokenPool","type":"uint8"},{"internalType":"bool","name":"isAllowed","type":"bool"},{"internalType":"address","name":"routerAddress","type":"address"},{"internalType":"address","name":"routerHelper","type":"address"},{"internalType":"bytes","name":"pathUSDTToToken","type":"bytes"},{"internalType":"bytes","name":"pathTokenToUSDT","type":"bytes"},{"internalType":"bytes","name":"pathTokenWETH","type":"bytes"}],"internalType":"struct IRainDeployer.TokenData","name":"tokenData","type":"tuple"},{"internalType":"enum Types.TradingModel","name":"tradingModel","type":"uint8"}],"internalType":"struct IRainPool.Params","name":"params","type":"tuple"}],"stateMutability":"payable","type":"constructor"},{"stateMutability":"payable","type":"fallback"},{"stateMutability":"payable","type":"receive"}] as const
|
|
3
|
-
export const MarketsAbi = [{ "type": "function", "name": "APPEAL_FEE_MIN", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "DISPUTE_FEE_MAX", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "DISPUTE_FEE_MIN", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "DISPUTE_WINDOW", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "FACTORY", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "FEE_MAGNIFICATION", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "ORDER_EXECUTION_FEE", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "PRICE_MAGNIFICATION", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "RESOLUTION_FEE_MAX", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "RESOLUTION_FEE_MIN", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "TICK_SPACING", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "ammNoReserve", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "ammYesReserve", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "baseToken", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "baseTokenDecimals", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "buyOrders", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "internalType": "uint8" }, { "name": "price", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "headIndex", "type": "int256", "internalType": "int256" }, { "name": "tailIndex", "type": "int256", "internalType": "int256" }, { "name": "count", "type": "int256", "internalType": "int256" }, { "name": "isInitialized", "type": "bool", "internalType": "bool" }], "stateMutability": "view" }, { "type": "function", "name": "calculateBaseTokenOracleFixedFee", "inputs": [{ "name": "oracleFixedFee", "type": "uint256", "internalType": "uint256" }, { "name": "tokenData", "type": "tuple", "internalType": "struct IRainDeployer.TokenData", "components": [{ "name": "tokenPool", "type": "uint8", "internalType": "enum IRainDeployer.TokenPool" }, { "name": "isAllowed", "type": "bool", "internalType": "bool" }, { "name": "routerAddress", "type": "address", "internalType": "address" }, { "name": "routerHelper", "type": "address", "internalType": "address" }, { "name": "pathUSDTToToken", "type": "bytes", "internalType": "bytes" }, { "name": "pathTokenToUSDT", "type": "bytes", "internalType": "bytes" }, { "name": "pathTokenWETH", "type": "bytes", "internalType": "bytes" }] }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "nonpayable" }, { "type": "function", "name": "cancelBuyOrders", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8[]", "internalType": "uint8[]" }, { "name": "price", "type": "uint256[]", "internalType": "uint256[]" }, { "name": "orderID", "type": "uint256[]", "internalType": "uint256[]" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "cancelSellOrders", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8[]", "internalType": "uint8[]" }, { "name": "price", "type": "uint256[]", "internalType": "uint256[]" }, { "name": "orderID", "type": "uint256[]", "internalType": "uint256[]" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "chooseWinner", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "internalType": "uint8" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "claim", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "closePool", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "closePool", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "proposedWinner", "type": "uint8", "internalType": "uint8" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "closingFee", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "creatorFee", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "disputeResolver", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "endTime", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "enterLiquidity", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "totalAmount", "type": "uint256", "internalType": "uint256" }, { "name": "minYesToDeposit", "type": "uint256", "internalType": "uint256" }, { "name": "minNoToDeposit", "type": "uint256", "internalType": "uint256" }, { "name": "deadline", "type": "uint256", "internalType": "uint256" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "enterLiquidityBatch", "inputs": [{ "name": "totalAmount", "type": "uint256", "internalType": "uint256" }, { "name": "percentages", "type": "uint256[]", "internalType": "uint256[]" }, { "name": "minYesToDeposit", "type": "uint256[]", "internalType": "uint256[]" }, { "name": "minNoToDeposit", "type": "uint256[]", "internalType": "uint256[]" }, { "name": "deadline", "type": "uint256", "internalType": "uint256" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "enterOption", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "internalType": "uint8" }, { "name": "amount", "type": "uint256", "internalType": "uint256" }, { "name": "minSharesOut", "type": "uint256", "internalType": "uint256" }, { "name": "deadline", "type": "uint256", "internalType": "uint256" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "feePerLPShareX128", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "firstBuyOrderPrice", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "internalType": "uint8" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "firstSellOrderPrice", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "internalType": "uint8" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "getAmountRequired", "inputs": [{ "name": "targetPrice", "type": "uint256", "internalType": "uint256" }, { "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "internalType": "uint8" }], "outputs": [{ "name": "requiredAmount", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "getCreatorReward", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "creatorReward", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "getCurrentPrice", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "internalType": "uint8" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "getDisputeAppealFee", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "disputeFee", "type": "uint256", "internalType": "uint256" }], "stateMutability": "nonpayable" }, { "type": "function", "name": "getDynamicPayout", "inputs": [{ "name": "user", "type": "address", "internalType": "address" }, { "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "dynamicPayout", "type": "uint256[]", "internalType": "uint256[]" }], "stateMutability": "view" }, { "type": "function", "name": "getEntryShares", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "internalType": "uint8" }, { "name": "amount", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "returnedShares", "type": "uint256", "internalType": "uint256" }, { "name": "expectedReward", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "getImpactedPrice", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "internalType": "uint8" }, { "name": "amount", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "getLiquidityReward", "inputs": [{ "name": "user", "type": "address", "internalType": "address" }, { "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "liquidityReward", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "getRemovedLiquidity", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "lpShares", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "yesBack", "type": "uint256", "internalType": "uint256" }, { "name": "noBack", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "getResolverBondAmount", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "resolverBondAmount", "type": "uint256", "internalType": "uint256" }], "stateMutability": "nonpayable" }, { "type": "function", "name": "getResolverReward", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "resolverReward", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "getReturnedLiquidity", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "totalAmount", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "returnedShares", "type": "uint256[]", "internalType": "uint256[]" }, { "name": "returnedAmounts", "type": "uint256[]", "internalType": "uint256[]" }], "stateMutability": "view" }, { "type": "function", "name": "getReturnedShares", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "internalType": "uint8" }, { "name": "amount", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "getSharesReward", "inputs": [{ "name": "user", "type": "address", "internalType": "address" }, { "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "sharesReward", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "ipfsUri", "inputs": [], "outputs": [{ "name": "", "type": "string", "internalType": "string" }], "stateMutability": "view" }, { "type": "function", "name": "isOptionAppealed", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], "stateMutability": "view" }, { "type": "function", "name": "isOptionDisputed", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], "stateMutability": "view" }, { "type": "function", "name": "isPublic", "inputs": [], "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], "stateMutability": "view" }, { "type": "function", "name": "liquidityFee", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "merge", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "amount", "type": "uint256", "internalType": "uint256" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "numberOfOptions", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "openDispute", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "optionAppeal", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "disputeFee", "type": "uint256", "internalType": "uint256" }, { "name": "disputedWinner", "type": "uint256", "internalType": "uint256" }, { "name": "disputer", "type": "address", "internalType": "address" }, { "name": "appealResolver", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "optionClaimed", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "user", "type": "address", "internalType": "address" }], "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], "stateMutability": "view" }, { "type": "function", "name": "optionClosingShare", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "optionCreatorShare", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "optionDispute", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "disputeFee", "type": "uint256", "internalType": "uint256" }, { "name": "disputedWinner", "type": "uint256", "internalType": "uint256" }, { "name": "disputer", "type": "address", "internalType": "address" }, { "name": "_disputeResolver", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "optionEndTime", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "optionEndTimeCache", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "optionFinalized", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], "stateMutability": "view" }, { "type": "function", "name": "optionFirstClaim", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], "stateMutability": "view" }, { "type": "function", "name": "optionOrderBookShare", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "optionPerSideFunds", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "internalType": "uint8" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "optionPerSideShares", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "internalType": "uint8" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "optionPlatformShare", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "optionProposedWinner", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint8", "internalType": "uint8" }], "stateMutability": "view" }, { "type": "function", "name": "optionResolutionProposer", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "optionResolved", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], "stateMutability": "view" }, { "type": "function", "name": "optionResolver", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "optionResolverBond", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "optionResolverShare", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "optionState", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint8", "internalType": "enum Types.PoolState" }], "stateMutability": "view" }, { "type": "function", "name": "optionTotalFunds", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "optionTotalShares", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "optionWinner", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint8", "internalType": "uint8" }], "stateMutability": "view" }, { "type": "function", "name": "optionWinningPoolShare", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "oracleEndTime", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "oracleFixedFee", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "orderBook", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "internalType": "uint8" }, { "name": "price", "type": "uint256", "internalType": "uint256" }, { "name": "orderID", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "exists", "type": "bool", "internalType": "bool" }, { "name": "index", "type": "int256", "internalType": "int256" }], "stateMutability": "view" }, { "type": "function", "name": "ordersAdded", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "ordersRemoved", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "placeBuyOrder", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "internalType": "uint8" }, { "name": "price", "type": "uint256", "internalType": "uint256" }, { "name": "amount", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "orderID", "type": "uint256", "internalType": "uint256" }], "stateMutability": "nonpayable" }, { "type": "function", "name": "placeSellOrder", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "internalType": "uint8" }, { "name": "price", "type": "uint256", "internalType": "uint256" }, { "name": "shares", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "orderID", "type": "uint256", "internalType": "uint256" }], "stateMutability": "nonpayable" }, { "type": "function", "name": "platformAddress", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "platformFee", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "poolOwner", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "rainToken", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "referrer", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "removeLiquidity", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "lpShares", "type": "uint256", "internalType": "uint256" }, { "name": "minYesOut", "type": "uint256", "internalType": "uint256" }, { "name": "minNoOut", "type": "uint256", "internalType": "uint256" }, { "name": "deadline", "type": "uint256", "internalType": "uint256" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "resolver", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "resolverIsAI", "inputs": [], "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], "stateMutability": "view" }, { "type": "function", "name": "resolverShareUSDT", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "resultResolverFee", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "sellOrders", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "internalType": "uint8" }, { "name": "price", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "headIndex", "type": "int256", "internalType": "int256" }, { "name": "tailIndex", "type": "int256", "internalType": "int256" }, { "name": "count", "type": "int256", "internalType": "int256" }, { "name": "isInitialized", "type": "bool", "internalType": "bool" }], "stateMutability": "view" }, { "type": "function", "name": "split", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "amount", "type": "uint256", "internalType": "uint256" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "startTime", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "swapOracleFixedFee", "inputs": [{ "name": "baseToken", "type": "address", "internalType": "address" }, { "name": "tokenData", "type": "tuple", "internalType": "struct IRainDeployer.TokenData", "components": [{ "name": "tokenPool", "type": "uint8", "internalType": "enum IRainDeployer.TokenPool" }, { "name": "isAllowed", "type": "bool", "internalType": "bool" }, { "name": "routerAddress", "type": "address", "internalType": "address" }, { "name": "routerHelper", "type": "address", "internalType": "address" }, { "name": "pathUSDTToToken", "type": "bytes", "internalType": "bytes" }, { "name": "pathTokenToUSDT", "type": "bytes", "internalType": "bytes" }, { "name": "pathTokenWETH", "type": "bytes", "internalType": "bytes" }] }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "tokenData", "inputs": [], "outputs": [{ "name": "tokenPool", "type": "uint8", "internalType": "enum IRainDeployer.TokenPool" }, { "name": "isAllowed", "type": "bool", "internalType": "bool" }, { "name": "routerAddress", "type": "address", "internalType": "address" }, { "name": "routerHelper", "type": "address", "internalType": "address" }, { "name": "pathUSDTToToken", "type": "bytes", "internalType": "bytes" }, { "name": "pathTokenToUSDT", "type": "bytes", "internalType": "bytes" }, { "name": "pathTokenToWETH", "type": "bytes", "internalType": "bytes" }], "stateMutability": "view" }, { "type": "function", "name": "tooEarly", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "totalMarketFunds", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "totalMarketShares", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "totalOptionLPShares", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "totalOrders", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "nonpayable" }, { "type": "function", "name": "tradingModel", "inputs": [], "outputs": [{ "name": "", "type": "uint8", "internalType": "enum Types.TradingModel" }], "stateMutability": "view" }, { "type": "function", "name": "usdt", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "userActiveBuyOrders", "inputs": [{ "name": "user", "type": "address", "internalType": "address" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "userActiveSellOrders", "inputs": [{ "name": "user", "type": "address", "internalType": "address" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "userFeeDebtX128", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "user", "type": "address", "internalType": "address" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "userFundsPerSideInEscrow", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "internalType": "uint8" }, { "name": "user", "type": "address", "internalType": "address" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "userOptionLPShares", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "user", "type": "address", "internalType": "address" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "userOptionPerSideShares", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "internalType": "uint8" }, { "name": "user", "type": "address", "internalType": "address" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "userSharesPerSideInEscrow", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "internalType": "uint8" }, { "name": "user", "type": "address", "internalType": "address" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "event", "name": "AddLiquidity", "inputs": [{ "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "baseAmount", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "lpShares", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "wallet", "type": "address", "indexed": true, "internalType": "address" }], "anonymous": false }, { "type": "event", "name": "AppealFeeRefunded", "inputs": [{ "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "appealer", "type": "address", "indexed": true, "internalType": "address" }, { "name": "appealFee", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "appealedWinner", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "CancelBuyOrder", "inputs": [{ "name": "orderOption", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "orderOptionSide", "type": "uint8", "indexed": false, "internalType": "uint8" }, { "name": "orderBaseAmount", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "orderPrice", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "orderID", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "orderCreator", "type": "address", "indexed": true, "internalType": "address" }], "anonymous": false }, { "type": "event", "name": "CancelSellOrder", "inputs": [{ "name": "orderOption", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "orderOptionSide", "type": "uint8", "indexed": false, "internalType": "uint8" }, { "name": "sharesAmount", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "orderPrice", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "orderID", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "orderCreator", "type": "address", "indexed": true, "internalType": "address" }], "anonymous": false }, { "type": "event", "name": "ChooseWinner", "inputs": [{ "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "indexed": false, "internalType": "uint8" }, { "name": "platformShare", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "winningShare", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "ChooseWinnerAppeal", "inputs": [{ "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "indexed": false, "internalType": "uint8" }, { "name": "platformShare", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "winningShare", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "ChooseWinnerDispute", "inputs": [{ "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "indexed": false, "internalType": "uint8" }, { "name": "platformShare", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "winningShare", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "Claim", "inputs": [{ "name": "wallet", "type": "address", "indexed": true, "internalType": "address" }, { "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "winnerSide", "type": "uint8", "indexed": false, "internalType": "uint8" }, { "name": "winningReward", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "ClaimSwapFees", "inputs": [{ "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "amount", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "wallet", "type": "address", "indexed": true, "internalType": "address" }], "anonymous": false }, { "type": "event", "name": "ClosePool", "inputs": [{ "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "side", "type": "uint8", "indexed": false, "internalType": "uint8" }], "anonymous": false }, { "type": "event", "name": "ClosingShareClaim", "inputs": [{ "name": "closer", "type": "address", "indexed": true, "internalType": "address" }, { "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "closingShare", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "CreateOracle", "inputs": [{ "name": "creatorContract", "type": "address", "indexed": true, "internalType": "address" }, { "name": "createdContract", "type": "address", "indexed": true, "internalType": "address" }, { "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "CreatorClaim", "inputs": [{ "name": "wallet", "type": "address", "indexed": true, "internalType": "address" }, { "name": "amount", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "DisputeFeeRefunded", "inputs": [{ "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "disputer", "type": "address", "indexed": true, "internalType": "address" }, { "name": "disputeFee", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "disputedWinner", "type": "uint8", "indexed": false, "internalType": "uint8" }], "anonymous": false }, { "type": "event", "name": "EnterOption", "inputs": [{ "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "indexed": false, "internalType": "uint8" }, { "name": "baseAmount", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "sharesAmount", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "wallet", "type": "address", "indexed": false, "internalType": "address" }], "anonymous": false }, { "type": "event", "name": "ExecuteBuyOrder", "inputs": [{ "name": "orderOption", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "orderOptionSide", "type": "uint8", "indexed": false, "internalType": "uint8" }, { "name": "orderPrice", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "sharesAmount", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "baseAmount", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "orderID", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "maker", "type": "address", "indexed": true, "internalType": "address" }, { "name": "taker", "type": "address", "indexed": true, "internalType": "address" }], "anonymous": false }, { "type": "event", "name": "ExecuteSellOrder", "inputs": [{ "name": "orderOption", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "orderOptionSide", "type": "uint8", "indexed": false, "internalType": "uint8" }, { "name": "orderPrice", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "sharesAmount", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "baseAmount", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "orderID", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "maker", "type": "address", "indexed": true, "internalType": "address" }, { "name": "taker", "type": "address", "indexed": true, "internalType": "address" }], "anonymous": false }, { "type": "event", "name": "Merge", "inputs": [{ "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "amount", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "wallet", "type": "address", "indexed": true, "internalType": "address" }], "anonymous": false }, { "type": "event", "name": "OpenAppeal", "inputs": [{ "name": "caller", "type": "address", "indexed": true, "internalType": "address" }, { "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "currentWinner", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "appealFee", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "OpenDispute", "inputs": [{ "name": "caller", "type": "address", "indexed": true, "internalType": "address" }, { "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "currentWinner", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "disputeFee", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "PlaceBuyOrder", "inputs": [{ "name": "orderOption", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "orderOptionSide", "type": "uint8", "indexed": false, "internalType": "uint8" }, { "name": "orderPrice", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "baseAmount", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "orderID", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "maker", "type": "address", "indexed": true, "internalType": "address" }], "anonymous": false }, { "type": "event", "name": "PlaceSellOrder", "inputs": [{ "name": "orderOption", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "orderOptionSide", "type": "uint8", "indexed": false, "internalType": "uint8" }, { "name": "orderPrice", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "sharesAmount", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "orderID", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "maker", "type": "address", "indexed": true, "internalType": "address" }], "anonymous": false }, { "type": "event", "name": "PlatformClaim", "inputs": [{ "name": "wallet", "type": "address", "indexed": true, "internalType": "address" }, { "name": "amount", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "Price", "inputs": [{ "name": "option", "type": "uint256", "indexed": true, "internalType": "uint256" }, { "name": "yesReserve", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "noReserve", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "optionTotalFunds", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "RainTokenBurned", "inputs": [{ "name": "amountBurned", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "ReferrerClaim", "inputs": [{ "name": "wallet", "type": "address", "indexed": true, "internalType": "address" }, { "name": "amount", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "RemoveLiquidity", "inputs": [{ "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "lpShares", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "baseTokensReturned", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "yesReturned", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "noReturned", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "feesEarned", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "wallet", "type": "address", "indexed": true, "internalType": "address" }], "anonymous": false }, { "type": "event", "name": "ResolutionProposed", "inputs": [{ "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "indexed": false, "internalType": "uint8" }, { "name": "resolutionProposer", "type": "address", "indexed": true, "internalType": "address" }, { "name": "resolverBond", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "proposedWinner", "type": "uint8", "indexed": false, "internalType": "uint8" }], "anonymous": false }, { "type": "event", "name": "ResolutionProposerRefund", "inputs": [{ "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "indexed": false, "internalType": "uint8" }, { "name": "resolutionProposer", "type": "address", "indexed": true, "internalType": "address" }, { "name": "resolverBond", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "proposedWinner", "type": "uint8", "indexed": false, "internalType": "uint8" }], "anonymous": false }, { "type": "event", "name": "ResolverClaim", "inputs": [{ "name": "wallet", "type": "address", "indexed": true, "internalType": "address" }, { "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "amount", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "ResolverSet", "inputs": [{ "name": "resolver", "type": "address", "indexed": true, "internalType": "address" }, { "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "Split", "inputs": [{ "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "amount", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "wallet", "type": "address", "indexed": true, "internalType": "address" }], "anonymous": false }, { "type": "event", "name": "TooEarly", "inputs": [{ "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "resolutionProposer", "type": "address", "indexed": true, "internalType": "address" }, { "name": "resolverBond", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "proposedWinner", "type": "uint8", "indexed": false, "internalType": "uint8" }], "anonymous": false }, { "type": "error", "name": "AlreadyClaimed", "inputs": [] }, { "type": "error", "name": "AlreadyInitialized", "inputs": [] }, { "type": "error", "name": "AmountTooSmall", "inputs": [] }, { "type": "error", "name": "ArrayLengthMismatch", "inputs": [] }, { "type": "error", "name": "CallerNotOrderPlacer", "inputs": [] }, { "type": "error", "name": "DeadlineExpired", "inputs": [] }, { "type": "error", "name": "DisputeAlreadyOpened", "inputs": [] }, { "type": "error", "name": "DisputeWindowEnded", "inputs": [] }, { "type": "error", "name": "DisputeWindowNotEnded", "inputs": [] }, { "type": "error", "name": "EndPriceTooHigh", "inputs": [] }, { "type": "error", "name": "EndPriceTooLow", "inputs": [] }, { "type": "error", "name": "EndTImeLessThanStartTime", "inputs": [] }, { "type": "error", "name": "IneligibleToClaim", "inputs": [] }, { "type": "error", "name": "InsufficientAmount", "inputs": [] }, { "type": "error", "name": "InsufficientLPShares", "inputs": [] }, { "type": "error", "name": "InsufficientUserShares", "inputs": [] }, { "type": "error", "name": "InvalidAmount", "inputs": [] }, { "type": "error", "name": "InvalidCall", "inputs": [] }, { "type": "error", "name": "InvalidCaller", "inputs": [] }, { "type": "error", "name": "InvalidInitialLiquidity", "inputs": [] }, { "type": "error", "name": "InvalidLiquidityPercentage", "inputs": [] }, { "type": "error", "name": "InvalidOption", "inputs": [] }, { "type": "error", "name": "InvalidOptions", "inputs": [] }, { "type": "error", "name": "InvalidOracleEndTime", "inputs": [] }, { "type": "error", "name": "InvalidOracleFixedFee", "inputs": [] }, { "type": "error", "name": "InvalidPoolState", "inputs": [] }, { "type": "error", "name": "InvalidPrice", "inputs": [] }, { "type": "error", "name": "InvalidSide", "inputs": [] }, { "type": "error", "name": "LPSharesZero", "inputs": [] }, { "type": "error", "name": "LinkedListNotInitalized", "inputs": [] }, { "type": "error", "name": "MaximumOptionsExceeded", "inputs": [] }, { "type": "error", "name": "NoIncreaseNeeded", "inputs": [] }, { "type": "error", "name": "NoOwnerSet", "inputs": [] }, { "type": "error", "name": "NoPlatformSet", "inputs": [] }, { "type": "error", "name": "NoRewardToClaim", "inputs": [] }, { "type": "error", "name": "NoTokenSet", "inputs": [] }, { "type": "error", "name": "NotPoolManager", "inputs": [] }, { "type": "error", "name": "OnlyAuthority", "inputs": [] }, { "type": "error", "name": "OnlyOwner", "inputs": [] }, { "type": "error", "name": "OnlyResolver", "inputs": [] }, { "type": "error", "name": "OracleNotFinalized", "inputs": [] }, { "type": "error", "name": "OrderAlreadyExists", "inputs": [] }, { "type": "error", "name": "OrderBookPhaseNotOpen", "inputs": [] }, { "type": "error", "name": "OrderDoesNotExist", "inputs": [] }, { "type": "error", "name": "PoolClosed", "inputs": [] }, { "type": "error", "name": "PoolNotClosed", "inputs": [] }, { "type": "error", "name": "PoolOpen", "inputs": [] }, { "type": "error", "name": "SaleNotLive", "inputs": [] }, { "type": "error", "name": "SaleStillLive", "inputs": [] }, { "type": "error", "name": "SlippageExceeded", "inputs": [] }, { "type": "error", "name": "StartTimeEnded", "inputs": [] }, { "type": "error", "name": "UserBuyOrderExist", "inputs": [] }, { "type": "error", "name": "UserBuyOrderLimitReached", "inputs": [] }, { "type": "error", "name": "UserSellOrderExist", "inputs": [] }, { "type": "error", "name": "UserSellOrderLimitReached", "inputs": [] }, { "type": "error", "name": "VotingEnded", "inputs": [] }, { "type": "error", "name": "WinnerAlreadyFinalized", "inputs": [] }, { "type": "error", "name": "WinnerNotDecided", "inputs": [] }, { "type": "error", "name": "WinnerOutOfBound", "inputs": [] }];
|
|
3
|
+
export const MarketsAbi = [{ "type": "function", "name": "APPEAL_FEE_MIN", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "DISPUTE_FEE_MAX", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "DISPUTE_FEE_MIN", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "DISPUTE_WINDOW", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "FACTORY", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "FEE_MAGNIFICATION", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "MAKER_REBATE_FEE", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "ORDER_EXECUTION_FEE", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "PRICE_MAGNIFICATION", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "RESOLUTION_FEE_MAX", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "RESOLUTION_FEE_MIN", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "TICK_SPACING", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "ammNoReserve", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "ammYesReserve", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "baseToken", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "baseTokenDecimals", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "buyOrders", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "internalType": "uint8" }, { "name": "price", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "headIndex", "type": "int256", "internalType": "int256" }, { "name": "tailIndex", "type": "int256", "internalType": "int256" }, { "name": "count", "type": "int256", "internalType": "int256" }, { "name": "isInitialized", "type": "bool", "internalType": "bool" }], "stateMutability": "view" }, { "type": "function", "name": "calculateBaseTokenOracleFixedFee", "inputs": [{ "name": "oracleFixedFee", "type": "uint256", "internalType": "uint256" }, { "name": "tokenData", "type": "tuple", "internalType": "struct IRainDeployer.TokenData", "components": [{ "name": "tokenPool", "type": "uint8", "internalType": "enum IRainDeployer.TokenPool" }, { "name": "isAllowed", "type": "bool", "internalType": "bool" }, { "name": "routerAddress", "type": "address", "internalType": "address" }, { "name": "routerHelper", "type": "address", "internalType": "address" }, { "name": "pathUSDTToToken", "type": "bytes", "internalType": "bytes" }, { "name": "pathTokenToUSDT", "type": "bytes", "internalType": "bytes" }, { "name": "pathTokenWETH", "type": "bytes", "internalType": "bytes" }] }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "nonpayable" }, { "type": "function", "name": "cancelBuyOrders", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8[]", "internalType": "uint8[]" }, { "name": "price", "type": "uint256[]", "internalType": "uint256[]" }, { "name": "orderID", "type": "uint256[]", "internalType": "uint256[]" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "cancelSellOrders", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8[]", "internalType": "uint8[]" }, { "name": "price", "type": "uint256[]", "internalType": "uint256[]" }, { "name": "orderID", "type": "uint256[]", "internalType": "uint256[]" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "chooseWinner", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "internalType": "uint8" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "claim", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "closePool", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "closePool", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "proposedWinner", "type": "uint8", "internalType": "uint8" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "closingFee", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "creatorFee", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "disputeResolver", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "endTime", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "enterLiquidity", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "totalAmount", "type": "uint256", "internalType": "uint256" }, { "name": "minYesToDeposit", "type": "uint256", "internalType": "uint256" }, { "name": "minNoToDeposit", "type": "uint256", "internalType": "uint256" }, { "name": "deadline", "type": "uint256", "internalType": "uint256" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "enterLiquidityBatch", "inputs": [{ "name": "totalAmount", "type": "uint256", "internalType": "uint256" }, { "name": "percentages", "type": "uint256[]", "internalType": "uint256[]" }, { "name": "minYesToDeposit", "type": "uint256[]", "internalType": "uint256[]" }, { "name": "minNoToDeposit", "type": "uint256[]", "internalType": "uint256[]" }, { "name": "deadline", "type": "uint256", "internalType": "uint256" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "enterOption", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "internalType": "uint8" }, { "name": "amount", "type": "uint256", "internalType": "uint256" }, { "name": "minSharesOut", "type": "uint256", "internalType": "uint256" }, { "name": "deadline", "type": "uint256", "internalType": "uint256" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "feePerLPShareX128", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "firstBuyOrderPrice", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "internalType": "uint8" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "firstSellOrderPrice", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "internalType": "uint8" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "getAmountRequired", "inputs": [{ "name": "targetPrice", "type": "uint256", "internalType": "uint256" }, { "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "internalType": "uint8" }], "outputs": [{ "name": "requiredAmount", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "getCreatorReward", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "creatorReward", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "getCurrentPrice", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "internalType": "uint8" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "getDisputeAppealFee", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "disputeFee", "type": "uint256", "internalType": "uint256" }], "stateMutability": "nonpayable" }, { "type": "function", "name": "getDynamicPayout", "inputs": [{ "name": "user", "type": "address", "internalType": "address" }, { "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "dynamicPayout", "type": "uint256[]", "internalType": "uint256[]" }], "stateMutability": "view" }, { "type": "function", "name": "getEntryShares", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "internalType": "uint8" }, { "name": "amount", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "returnedShares", "type": "uint256", "internalType": "uint256" }, { "name": "expectedReward", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "getImpactedPrice", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "internalType": "uint8" }, { "name": "amount", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "getLiquidityReward", "inputs": [{ "name": "user", "type": "address", "internalType": "address" }, { "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "liquidityReward", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "getRemovedLiquidity", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "lpShares", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "yesBack", "type": "uint256", "internalType": "uint256" }, { "name": "noBack", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "getResolverBondAmount", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "resolverBondAmount", "type": "uint256", "internalType": "uint256" }], "stateMutability": "nonpayable" }, { "type": "function", "name": "getResolverReward", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "resolverReward", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "getReturnedLiquidity", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "totalAmount", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "returnedShares", "type": "uint256[]", "internalType": "uint256[]" }, { "name": "returnedAmounts", "type": "uint256[]", "internalType": "uint256[]" }], "stateMutability": "view" }, { "type": "function", "name": "getReturnedShares", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "internalType": "uint8" }, { "name": "amount", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "getSharesReward", "inputs": [{ "name": "user", "type": "address", "internalType": "address" }, { "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "sharesReward", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "ipfsUri", "inputs": [], "outputs": [{ "name": "", "type": "string", "internalType": "string" }], "stateMutability": "view" }, { "type": "function", "name": "isOptionAppealed", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], "stateMutability": "view" }, { "type": "function", "name": "isOptionDisputed", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], "stateMutability": "view" }, { "type": "function", "name": "isPublic", "inputs": [], "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], "stateMutability": "view" }, { "type": "function", "name": "liquidityFee", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "merge", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "amount", "type": "uint256", "internalType": "uint256" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "numberOfOptions", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "openDispute", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "optionAppeal", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "disputeFee", "type": "uint256", "internalType": "uint256" }, { "name": "disputedWinner", "type": "uint256", "internalType": "uint256" }, { "name": "disputer", "type": "address", "internalType": "address" }, { "name": "appealResolver", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "optionClaimed", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "user", "type": "address", "internalType": "address" }], "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], "stateMutability": "view" }, { "type": "function", "name": "optionClosingShare", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "optionCreatorShare", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "optionDispute", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "disputeFee", "type": "uint256", "internalType": "uint256" }, { "name": "disputedWinner", "type": "uint256", "internalType": "uint256" }, { "name": "disputer", "type": "address", "internalType": "address" }, { "name": "_disputeResolver", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "optionEndTime", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "optionEndTimeCache", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "optionFinalized", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], "stateMutability": "view" }, { "type": "function", "name": "optionFirstClaim", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], "stateMutability": "view" }, { "type": "function", "name": "optionOrderBookShare", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "optionPerSideFunds", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "internalType": "uint8" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "optionPerSideShares", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "internalType": "uint8" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "optionPlatformShare", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "optionProposedWinner", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint8", "internalType": "uint8" }], "stateMutability": "view" }, { "type": "function", "name": "optionResolutionProposer", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "optionResolved", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], "stateMutability": "view" }, { "type": "function", "name": "optionResolver", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "optionResolverBond", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "optionResolverShare", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "optionState", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint8", "internalType": "enum Types.PoolState" }], "stateMutability": "view" }, { "type": "function", "name": "optionTotalFunds", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "optionTotalShares", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "optionWinner", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint8", "internalType": "uint8" }], "stateMutability": "view" }, { "type": "function", "name": "optionWinningPoolShare", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "oracleEndTime", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "oracleFixedFee", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "orderBook", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "internalType": "uint8" }, { "name": "price", "type": "uint256", "internalType": "uint256" }, { "name": "orderID", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "exists", "type": "bool", "internalType": "bool" }, { "name": "index", "type": "int256", "internalType": "int256" }], "stateMutability": "view" }, { "type": "function", "name": "ordersAdded", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "ordersRemoved", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "placeBuyOrder", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "internalType": "uint8" }, { "name": "price", "type": "uint256", "internalType": "uint256" }, { "name": "amount", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "orderID", "type": "uint256", "internalType": "uint256" }], "stateMutability": "nonpayable" }, { "type": "function", "name": "placeSellOrder", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "internalType": "uint8" }, { "name": "price", "type": "uint256", "internalType": "uint256" }, { "name": "shares", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "orderID", "type": "uint256", "internalType": "uint256" }], "stateMutability": "nonpayable" }, { "type": "function", "name": "platformAddress", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "platformFee", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "poolOwner", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "rainToken", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "referrer", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "removeLiquidity", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "lpShares", "type": "uint256", "internalType": "uint256" }, { "name": "minYesOut", "type": "uint256", "internalType": "uint256" }, { "name": "minNoOut", "type": "uint256", "internalType": "uint256" }, { "name": "deadline", "type": "uint256", "internalType": "uint256" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "resolver", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "resolverIsAI", "inputs": [], "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], "stateMutability": "view" }, { "type": "function", "name": "resolverShareUSDT", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "resultResolverFee", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "sellOption", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "internalType": "uint8" }, { "name": "amount", "type": "uint256", "internalType": "uint256" }, { "name": "minAmountOut", "type": "uint256", "internalType": "uint256" }, { "name": "deadline", "type": "uint256", "internalType": "uint256" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "sellOrders", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "internalType": "uint8" }, { "name": "price", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "headIndex", "type": "int256", "internalType": "int256" }, { "name": "tailIndex", "type": "int256", "internalType": "int256" }, { "name": "count", "type": "int256", "internalType": "int256" }, { "name": "isInitialized", "type": "bool", "internalType": "bool" }], "stateMutability": "view" }, { "type": "function", "name": "split", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "amount", "type": "uint256", "internalType": "uint256" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "startTime", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "swapOracleFixedFee", "inputs": [{ "name": "baseToken", "type": "address", "internalType": "address" }, { "name": "tokenData", "type": "tuple", "internalType": "struct IRainDeployer.TokenData", "components": [{ "name": "tokenPool", "type": "uint8", "internalType": "enum IRainDeployer.TokenPool" }, { "name": "isAllowed", "type": "bool", "internalType": "bool" }, { "name": "routerAddress", "type": "address", "internalType": "address" }, { "name": "routerHelper", "type": "address", "internalType": "address" }, { "name": "pathUSDTToToken", "type": "bytes", "internalType": "bytes" }, { "name": "pathTokenToUSDT", "type": "bytes", "internalType": "bytes" }, { "name": "pathTokenWETH", "type": "bytes", "internalType": "bytes" }] }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "tokenData", "inputs": [], "outputs": [{ "name": "tokenPool", "type": "uint8", "internalType": "enum IRainDeployer.TokenPool" }, { "name": "isAllowed", "type": "bool", "internalType": "bool" }, { "name": "routerAddress", "type": "address", "internalType": "address" }, { "name": "routerHelper", "type": "address", "internalType": "address" }, { "name": "pathUSDTToToken", "type": "bytes", "internalType": "bytes" }, { "name": "pathTokenToUSDT", "type": "bytes", "internalType": "bytes" }, { "name": "pathTokenToWETH", "type": "bytes", "internalType": "bytes" }], "stateMutability": "view" }, { "type": "function", "name": "tooEarly", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "totalMarketFunds", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "totalMarketShares", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "totalOptionLPShares", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "totalOrders", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "nonpayable" }, { "type": "function", "name": "tradingModel", "inputs": [], "outputs": [{ "name": "", "type": "uint8", "internalType": "enum Types.TradingModel" }], "stateMutability": "view" }, { "type": "function", "name": "usdt", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "userActiveBuyOrders", "inputs": [{ "name": "user", "type": "address", "internalType": "address" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "userActiveSellOrders", "inputs": [{ "name": "user", "type": "address", "internalType": "address" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "userFeeDebtX128", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "user", "type": "address", "internalType": "address" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "userFundsPerSideInEscrow", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "internalType": "uint8" }, { "name": "user", "type": "address", "internalType": "address" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "userOptionLPShares", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "user", "type": "address", "internalType": "address" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "userOptionPerSideShares", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "internalType": "uint8" }, { "name": "user", "type": "address", "internalType": "address" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "userSharesPerSideInEscrow", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "internalType": "uint8" }, { "name": "user", "type": "address", "internalType": "address" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "event", "name": "AddLiquidity", "inputs": [{ "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "baseAmount", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "lpShares", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "wallet", "type": "address", "indexed": true, "internalType": "address" }], "anonymous": false }, { "type": "event", "name": "AppealFeeRefunded", "inputs": [{ "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "appealer", "type": "address", "indexed": true, "internalType": "address" }, { "name": "appealFee", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "appealedWinner", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "CancelBuyOrder", "inputs": [{ "name": "orderOption", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "orderOptionSide", "type": "uint8", "indexed": false, "internalType": "uint8" }, { "name": "orderBaseAmount", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "orderPrice", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "orderID", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "orderCreator", "type": "address", "indexed": true, "internalType": "address" }], "anonymous": false }, { "type": "event", "name": "CancelSellOrder", "inputs": [{ "name": "orderOption", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "orderOptionSide", "type": "uint8", "indexed": false, "internalType": "uint8" }, { "name": "sharesAmount", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "orderPrice", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "orderID", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "orderCreator", "type": "address", "indexed": true, "internalType": "address" }], "anonymous": false }, { "type": "event", "name": "ChooseWinner", "inputs": [{ "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "indexed": false, "internalType": "uint8" }, { "name": "platformShare", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "winningShare", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "ChooseWinnerAppeal", "inputs": [{ "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "indexed": false, "internalType": "uint8" }, { "name": "platformShare", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "winningShare", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "ChooseWinnerDispute", "inputs": [{ "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "indexed": false, "internalType": "uint8" }, { "name": "platformShare", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "winningShare", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "Claim", "inputs": [{ "name": "wallet", "type": "address", "indexed": true, "internalType": "address" }, { "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "winnerSide", "type": "uint8", "indexed": false, "internalType": "uint8" }, { "name": "winningReward", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "ClaimSwapFees", "inputs": [{ "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "amount", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "wallet", "type": "address", "indexed": true, "internalType": "address" }], "anonymous": false }, { "type": "event", "name": "ClosePool", "inputs": [{ "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "side", "type": "uint8", "indexed": false, "internalType": "uint8" }], "anonymous": false }, { "type": "event", "name": "ClosingShareClaim", "inputs": [{ "name": "closer", "type": "address", "indexed": true, "internalType": "address" }, { "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "closingShare", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "CreateOracle", "inputs": [{ "name": "creatorContract", "type": "address", "indexed": true, "internalType": "address" }, { "name": "createdContract", "type": "address", "indexed": true, "internalType": "address" }, { "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "CreatorClaim", "inputs": [{ "name": "wallet", "type": "address", "indexed": true, "internalType": "address" }, { "name": "amount", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "DisputeFeeRefunded", "inputs": [{ "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "disputer", "type": "address", "indexed": true, "internalType": "address" }, { "name": "disputeFee", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "disputedWinner", "type": "uint8", "indexed": false, "internalType": "uint8" }], "anonymous": false }, { "type": "event", "name": "EnterOption", "inputs": [{ "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "indexed": false, "internalType": "uint8" }, { "name": "baseAmount", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "sharesAmount", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "wallet", "type": "address", "indexed": false, "internalType": "address" }], "anonymous": false }, { "type": "event", "name": "ExecuteBuyOrder", "inputs": [{ "name": "orderOption", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "orderOptionSide", "type": "uint8", "indexed": false, "internalType": "uint8" }, { "name": "orderPrice", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "sharesAmount", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "baseAmount", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "orderID", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "maker", "type": "address", "indexed": true, "internalType": "address" }, { "name": "taker", "type": "address", "indexed": true, "internalType": "address" }], "anonymous": false }, { "type": "event", "name": "ExecuteSellOrder", "inputs": [{ "name": "orderOption", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "orderOptionSide", "type": "uint8", "indexed": false, "internalType": "uint8" }, { "name": "orderPrice", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "sharesAmount", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "baseAmount", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "orderID", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "maker", "type": "address", "indexed": true, "internalType": "address" }, { "name": "taker", "type": "address", "indexed": true, "internalType": "address" }], "anonymous": false }, { "type": "event", "name": "MakerRebate", "inputs": [{ "name": "maker", "type": "address", "indexed": true, "internalType": "address" }, { "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "indexed": false, "internalType": "uint8" }, { "name": "amount", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "Merge", "inputs": [{ "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "amount", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "wallet", "type": "address", "indexed": true, "internalType": "address" }], "anonymous": false }, { "type": "event", "name": "OpenAppeal", "inputs": [{ "name": "caller", "type": "address", "indexed": true, "internalType": "address" }, { "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "currentWinner", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "appealFee", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "OpenDispute", "inputs": [{ "name": "caller", "type": "address", "indexed": true, "internalType": "address" }, { "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "currentWinner", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "disputeFee", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "PlaceBuyOrder", "inputs": [{ "name": "orderOption", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "orderOptionSide", "type": "uint8", "indexed": false, "internalType": "uint8" }, { "name": "orderPrice", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "baseAmount", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "orderID", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "maker", "type": "address", "indexed": true, "internalType": "address" }], "anonymous": false }, { "type": "event", "name": "PlaceSellOrder", "inputs": [{ "name": "orderOption", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "orderOptionSide", "type": "uint8", "indexed": false, "internalType": "uint8" }, { "name": "orderPrice", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "sharesAmount", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "orderID", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "maker", "type": "address", "indexed": true, "internalType": "address" }], "anonymous": false }, { "type": "event", "name": "PlatformClaim", "inputs": [{ "name": "wallet", "type": "address", "indexed": true, "internalType": "address" }, { "name": "amount", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "Price", "inputs": [{ "name": "option", "type": "uint256", "indexed": true, "internalType": "uint256" }, { "name": "yesReserve", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "noReserve", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "optionTotalFunds", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "RainTokenBurned", "inputs": [{ "name": "amountBurned", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "ReferrerClaim", "inputs": [{ "name": "wallet", "type": "address", "indexed": true, "internalType": "address" }, { "name": "amount", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "RemoveLiquidity", "inputs": [{ "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "lpShares", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "baseTokensReturned", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "yesReturned", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "noReturned", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "feesEarned", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "wallet", "type": "address", "indexed": true, "internalType": "address" }], "anonymous": false }, { "type": "event", "name": "ResolutionProposed", "inputs": [{ "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "indexed": false, "internalType": "uint8" }, { "name": "resolutionProposer", "type": "address", "indexed": true, "internalType": "address" }, { "name": "resolverBond", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "proposedWinner", "type": "uint8", "indexed": false, "internalType": "uint8" }], "anonymous": false }, { "type": "event", "name": "ResolutionProposerRefund", "inputs": [{ "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "indexed": false, "internalType": "uint8" }, { "name": "resolutionProposer", "type": "address", "indexed": true, "internalType": "address" }, { "name": "resolverBond", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "proposedWinner", "type": "uint8", "indexed": false, "internalType": "uint8" }], "anonymous": false }, { "type": "event", "name": "ResolverClaim", "inputs": [{ "name": "wallet", "type": "address", "indexed": true, "internalType": "address" }, { "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "amount", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "ResolverSet", "inputs": [{ "name": "resolver", "type": "address", "indexed": true, "internalType": "address" }, { "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "SellOption", "inputs": [{ "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "indexed": false, "internalType": "uint8" }, { "name": "baseAmount", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "sharesAmount", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "wallet", "type": "address", "indexed": false, "internalType": "address" }], "anonymous": false }, { "type": "event", "name": "Split", "inputs": [{ "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "amount", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "wallet", "type": "address", "indexed": true, "internalType": "address" }], "anonymous": false }, { "type": "event", "name": "TooEarly", "inputs": [{ "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "resolutionProposer", "type": "address", "indexed": true, "internalType": "address" }, { "name": "resolverBond", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "proposedWinner", "type": "uint8", "indexed": false, "internalType": "uint8" }], "anonymous": false }, { "type": "error", "name": "AlreadyClaimed", "inputs": [] }, { "type": "error", "name": "AlreadyInitialized", "inputs": [] }, { "type": "error", "name": "AmountTooSmall", "inputs": [] }, { "type": "error", "name": "ArrayLengthMismatch", "inputs": [] }, { "type": "error", "name": "CallerNotOrderPlacer", "inputs": [] }, { "type": "error", "name": "DeadlineExpired", "inputs": [] }, { "type": "error", "name": "DisputeAlreadyOpened", "inputs": [] }, { "type": "error", "name": "DisputeWindowEnded", "inputs": [] }, { "type": "error", "name": "DisputeWindowNotEnded", "inputs": [] }, { "type": "error", "name": "EndPriceTooHigh", "inputs": [] }, { "type": "error", "name": "EndPriceTooLow", "inputs": [] }, { "type": "error", "name": "EndTImeLessThanStartTime", "inputs": [] }, { "type": "error", "name": "IneligibleToClaim", "inputs": [] }, { "type": "error", "name": "InsufficientAmount", "inputs": [] }, { "type": "error", "name": "InsufficientLPShares", "inputs": [] }, { "type": "error", "name": "InsufficientUserShares", "inputs": [] }, { "type": "error", "name": "InvalidAmount", "inputs": [] }, { "type": "error", "name": "InvalidCall", "inputs": [] }, { "type": "error", "name": "InvalidCaller", "inputs": [] }, { "type": "error", "name": "InvalidInitialLiquidity", "inputs": [] }, { "type": "error", "name": "InvalidLiquidityPercentage", "inputs": [] }, { "type": "error", "name": "InvalidOption", "inputs": [] }, { "type": "error", "name": "InvalidOptions", "inputs": [] }, { "type": "error", "name": "InvalidOracleEndTime", "inputs": [] }, { "type": "error", "name": "InvalidOracleFixedFee", "inputs": [] }, { "type": "error", "name": "InvalidPoolState", "inputs": [] }, { "type": "error", "name": "InvalidPrice", "inputs": [] }, { "type": "error", "name": "InvalidSide", "inputs": [] }, { "type": "error", "name": "LPSharesZero", "inputs": [] }, { "type": "error", "name": "LinkedListNotInitalized", "inputs": [] }, { "type": "error", "name": "MaximumOptionsExceeded", "inputs": [] }, { "type": "error", "name": "NoIncreaseNeeded", "inputs": [] }, { "type": "error", "name": "NoOwnerSet", "inputs": [] }, { "type": "error", "name": "NoPlatformSet", "inputs": [] }, { "type": "error", "name": "NoRewardToClaim", "inputs": [] }, { "type": "error", "name": "NoTokenSet", "inputs": [] }, { "type": "error", "name": "NotPoolManager", "inputs": [] }, { "type": "error", "name": "OnlyAuthority", "inputs": [] }, { "type": "error", "name": "OnlyOwner", "inputs": [] }, { "type": "error", "name": "OnlyResolver", "inputs": [] }, { "type": "error", "name": "OracleNotFinalized", "inputs": [] }, { "type": "error", "name": "OrderAlreadyExists", "inputs": [] }, { "type": "error", "name": "OrderBookPhaseNotOpen", "inputs": [] }, { "type": "error", "name": "OrderDoesNotExist", "inputs": [] }, { "type": "error", "name": "PoolClosed", "inputs": [] }, { "type": "error", "name": "PoolNotClosed", "inputs": [] }, { "type": "error", "name": "PoolOpen", "inputs": [] }, { "type": "error", "name": "SaleNotLive", "inputs": [] }, { "type": "error", "name": "SaleStillLive", "inputs": [] }, { "type": "error", "name": "SlippageExceeded", "inputs": [] }, { "type": "error", "name": "StartTimeEnded", "inputs": [] }, { "type": "error", "name": "UserBuyOrderExist", "inputs": [] }, { "type": "error", "name": "UserBuyOrderLimitReached", "inputs": [] }, { "type": "error", "name": "UserSellOrderExist", "inputs": [] }, { "type": "error", "name": "UserSellOrderLimitReached", "inputs": [] }, { "type": "error", "name": "VotingEnded", "inputs": [] }, { "type": "error", "name": "WinnerAlreadyFinalized", "inputs": [] }, { "type": "error", "name": "WinnerNotDecided", "inputs": [] }, { "type": "error", "name": "WinnerOutOfBound", "inputs": [] }];
|
package/dist/abi/OracleAbi.d.ts
CHANGED
|
@@ -8,4 +8,18 @@ export declare const OracleAbi: readonly [{
|
|
|
8
8
|
}];
|
|
9
9
|
readonly stateMutability: "nonpayable";
|
|
10
10
|
readonly type: "function";
|
|
11
|
+
}, {
|
|
12
|
+
readonly inputs: readonly [{
|
|
13
|
+
readonly internalType: "uint256";
|
|
14
|
+
readonly name: "newEndTime";
|
|
15
|
+
readonly type: "uint256";
|
|
16
|
+
}, {
|
|
17
|
+
readonly internalType: "bytes";
|
|
18
|
+
readonly name: "signature";
|
|
19
|
+
readonly type: "bytes";
|
|
20
|
+
}];
|
|
21
|
+
readonly name: "extendTime";
|
|
22
|
+
readonly outputs: readonly [];
|
|
23
|
+
readonly stateMutability: "nonpayable";
|
|
24
|
+
readonly type: "function";
|
|
11
25
|
}];
|
package/dist/abi/OracleAbi.js
CHANGED
|
@@ -11,5 +11,23 @@ export const OracleAbi = [
|
|
|
11
11
|
],
|
|
12
12
|
"stateMutability": "nonpayable",
|
|
13
13
|
"type": "function"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"inputs": [
|
|
17
|
+
{
|
|
18
|
+
"internalType": "uint256",
|
|
19
|
+
"name": "newEndTime",
|
|
20
|
+
"type": "uint256"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"internalType": "bytes",
|
|
24
|
+
"name": "signature",
|
|
25
|
+
"type": "bytes"
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"name": "extendTime",
|
|
29
|
+
"outputs": [],
|
|
30
|
+
"stateMutability": "nonpayable",
|
|
31
|
+
"type": "function"
|
|
14
32
|
}
|
|
15
33
|
];
|
|
@@ -13,3 +13,4 @@ export declare const OPEN_DISPUTE = "openDispute";
|
|
|
13
13
|
export declare const CLAIM = "claim";
|
|
14
14
|
export declare const CANCEL_BUY_ORDERS = "cancelBuyOrders";
|
|
15
15
|
export declare const CANCEL_SELL_ORDERS = "cancelSellOrders";
|
|
16
|
+
export declare const SELL_OPTION = "sellOption";
|
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,8 @@ export { TradingModel, OptionSide } from './tx/types.js';
|
|
|
5
5
|
export type { CreateMarketTxParams, EnterOptionTxParams, AddLiquidityTxParams, RemoveLiquidityTxParams, SplitTxParams, MergeTxParams, ClosePoolAITxParams, ClosePoolManualTxParams, ChooseWinnerTxParams, PlaceBuyOrderTxParams, PlaceSellOrderTxParams, OpenDisputeTxParams, ClaimTxParams, CancelBuyOrdersTxParams, CancelSellOrdersTxParams, RawTransaction, ApproveTxParams } from './tx/types.js';
|
|
6
6
|
export type { LoginParams, LoginResult } from './auth/types.js';
|
|
7
7
|
export { signLoginMessage } from './auth/signMessage.js';
|
|
8
|
+
export type { ExtendTimeTxParams } from './tx/buildExtendTimeRawTx.js';
|
|
9
|
+
export type { CalculateWinnerTxParams } from './tx/buildCalculateWinnerRawTx.js';
|
|
8
10
|
export type { TokenConfig } from './config/environments.js';
|
|
9
11
|
export * from './api/index.js';
|
|
10
12
|
export { RainSocket } from './socket/RainSocket.js';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface GetEntrySharesParams {
|
|
2
|
+
marketContractAddress: `0x${string}`;
|
|
3
|
+
option: bigint;
|
|
4
|
+
optionSide: number;
|
|
5
|
+
amount: bigint;
|
|
6
|
+
rpcUrl: string;
|
|
7
|
+
}
|
|
8
|
+
export interface EntrySharesResult {
|
|
9
|
+
returnedShares: bigint;
|
|
10
|
+
expectedReward: bigint;
|
|
11
|
+
}
|
|
12
|
+
export declare function getEntryShares(params: GetEntrySharesParams): Promise<EntrySharesResult>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { createPublicClient, http } from 'viem';
|
|
2
|
+
import { arbitrum } from 'viem/chains';
|
|
3
|
+
import { MarketsAbi } from '../abi/MarketsAbi.js';
|
|
4
|
+
export async function getEntryShares(params) {
|
|
5
|
+
const { marketContractAddress, option, optionSide, amount, rpcUrl } = params;
|
|
6
|
+
const client = createPublicClient({
|
|
7
|
+
chain: arbitrum,
|
|
8
|
+
transport: http(rpcUrl),
|
|
9
|
+
});
|
|
10
|
+
const result = await client.readContract({
|
|
11
|
+
address: marketContractAddress,
|
|
12
|
+
abi: MarketsAbi,
|
|
13
|
+
functionName: 'getEntryShares',
|
|
14
|
+
args: [option, optionSide, amount],
|
|
15
|
+
});
|
|
16
|
+
return {
|
|
17
|
+
returnedShares: result[0],
|
|
18
|
+
expectedReward: result[1],
|
|
19
|
+
};
|
|
20
|
+
}
|
|
@@ -5,7 +5,7 @@ import { ENTER_LIQUIDITY } from "../constants/contractmethods.js";
|
|
|
5
5
|
import { checkMarketTokenAllowance } from "../utils/helpers.js";
|
|
6
6
|
import { buildApproveRawTx } from "./buildApprovalRawTx.js";
|
|
7
7
|
const DEFAULT_SLIPPAGE = 5n; // 5%
|
|
8
|
-
const
|
|
8
|
+
const DEFAULT_DEADLINE_DURATION = 600; // 10 minutes
|
|
9
9
|
export async function buildAddLiquidityRawTx(params) {
|
|
10
10
|
const { marketContractAddress, option, totalAmountInWei, minYesToDeposit, minNoToDeposit, slippageTolerance, deadline, walletAddress, rpcUrl } = params;
|
|
11
11
|
if (!marketContractAddress)
|
|
@@ -46,7 +46,7 @@ export async function buildAddLiquidityRawTx(params) {
|
|
|
46
46
|
data: encodeFunctionData({
|
|
47
47
|
abi: MarketsAbi,
|
|
48
48
|
functionName: ENTER_LIQUIDITY,
|
|
49
|
-
args: [option, totalAmountInWei, effectiveMinYes ?? 0n, effectiveMinNo ?? 0n, deadline ??
|
|
49
|
+
args: [option, totalAmountInWei, effectiveMinYes ?? 0n, effectiveMinNo ?? 0n, deadline ?? BigInt(Math.floor(Date.now() / 1000) + DEFAULT_DEADLINE_DURATION)],
|
|
50
50
|
}),
|
|
51
51
|
value: 0n,
|
|
52
52
|
});
|
|
@@ -5,7 +5,7 @@ import { ENTER_OPTION } from "../constants/contractmethods.js";
|
|
|
5
5
|
import { checkMarketTokenAllowance } from "../utils/helpers.js";
|
|
6
6
|
import { buildApproveRawTx } from "./buildApprovalRawTx.js";
|
|
7
7
|
const DEFAULT_SLIPPAGE = 5n; // 5%
|
|
8
|
-
const
|
|
8
|
+
const DEFAULT_DEADLINE_DURATION = 600; // 10 minutes
|
|
9
9
|
export async function buildEnterOptionRawTx(params) {
|
|
10
10
|
const { marketContractAddress, selectedOption, optionSide, buyAmountInWei, minSharesOut, slippageTolerance, deadline, walletAddress, rpcUrl } = params;
|
|
11
11
|
if (!marketContractAddress)
|
|
@@ -43,7 +43,7 @@ export async function buildEnterOptionRawTx(params) {
|
|
|
43
43
|
data: encodeFunctionData({
|
|
44
44
|
abi: MarketsAbi,
|
|
45
45
|
functionName: ENTER_OPTION,
|
|
46
|
-
args: [selectedOption, optionSide, buyAmountInWei, effectiveMinShares, deadline ??
|
|
46
|
+
args: [selectedOption, optionSide, buyAmountInWei, effectiveMinShares, deadline ?? BigInt(Math.floor(Date.now() / 1000) + DEFAULT_DEADLINE_DURATION)],
|
|
47
47
|
}),
|
|
48
48
|
value: 0n,
|
|
49
49
|
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { RawTransaction } from "./types.js";
|
|
2
|
+
export interface ExtendTimeTxParams {
|
|
3
|
+
marketContractAddress: `0x${string}`;
|
|
4
|
+
option: bigint;
|
|
5
|
+
newEndTime: bigint;
|
|
6
|
+
signature: `0x${string}`;
|
|
7
|
+
}
|
|
8
|
+
export declare function buildExtendTimeRawTx(params: ExtendTimeTxParams & {
|
|
9
|
+
rpcUrl: string;
|
|
10
|
+
}): Promise<RawTransaction>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { encodeFunctionData, createPublicClient, http, parseAbi } from "viem";
|
|
2
|
+
import { arbitrum } from "viem/chains";
|
|
3
|
+
import { OracleAbi } from "../abi/OracleAbi.js";
|
|
4
|
+
const optionResolverAbi = parseAbi(['function optionResolver(uint256 option) view returns (address)']);
|
|
5
|
+
export async function buildExtendTimeRawTx(params) {
|
|
6
|
+
const { marketContractAddress, option, newEndTime, signature, rpcUrl } = params;
|
|
7
|
+
if (!marketContractAddress)
|
|
8
|
+
throw new Error("marketContractAddress is required");
|
|
9
|
+
if (option === undefined || option === null)
|
|
10
|
+
throw new Error("option is required");
|
|
11
|
+
if (!newEndTime)
|
|
12
|
+
throw new Error("newEndTime is required");
|
|
13
|
+
if (!signature)
|
|
14
|
+
throw new Error("signature is required");
|
|
15
|
+
const client = createPublicClient({
|
|
16
|
+
chain: arbitrum,
|
|
17
|
+
transport: http(rpcUrl),
|
|
18
|
+
});
|
|
19
|
+
const resolverAddress = await client.readContract({
|
|
20
|
+
address: marketContractAddress,
|
|
21
|
+
abi: optionResolverAbi,
|
|
22
|
+
functionName: 'optionResolver',
|
|
23
|
+
args: [option],
|
|
24
|
+
});
|
|
25
|
+
if (!resolverAddress || resolverAddress === '0x0000000000000000000000000000000000000000') {
|
|
26
|
+
throw new Error("No resolver set for this option");
|
|
27
|
+
}
|
|
28
|
+
return {
|
|
29
|
+
to: resolverAddress,
|
|
30
|
+
data: encodeFunctionData({
|
|
31
|
+
abi: OracleAbi,
|
|
32
|
+
functionName: 'extendTime',
|
|
33
|
+
args: [newEndTime, signature],
|
|
34
|
+
}),
|
|
35
|
+
value: 0n,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
@@ -3,7 +3,7 @@ import { arbitrum } from "viem/chains";
|
|
|
3
3
|
import { MarketsAbi } from "../abi/MarketsAbi.js";
|
|
4
4
|
import { REMOVE_LIQUIDITY } from "../constants/contractmethods.js";
|
|
5
5
|
const DEFAULT_SLIPPAGE = 5n; // 5%
|
|
6
|
-
const
|
|
6
|
+
const DEFAULT_DEADLINE_DURATION = 600; // 10 minutes
|
|
7
7
|
export async function buildRemoveLiquidityRawTx(params) {
|
|
8
8
|
const { marketContractAddress, option, lpShares, minYesOut, minNoOut, slippageTolerance, deadline, rpcUrl } = params;
|
|
9
9
|
if (!marketContractAddress)
|
|
@@ -36,7 +36,7 @@ export async function buildRemoveLiquidityRawTx(params) {
|
|
|
36
36
|
data: encodeFunctionData({
|
|
37
37
|
abi: MarketsAbi,
|
|
38
38
|
functionName: REMOVE_LIQUIDITY,
|
|
39
|
-
args: [option, lpShares, effectiveMinYes ?? 0n, effectiveMinNo ?? 0n, deadline ??
|
|
39
|
+
args: [option, lpShares, effectiveMinYes ?? 0n, effectiveMinNo ?? 0n, deadline ?? BigInt(Math.floor(Date.now() / 1000) + DEFAULT_DEADLINE_DURATION)],
|
|
40
40
|
}),
|
|
41
41
|
value: 0n,
|
|
42
42
|
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { encodeFunctionData } from "viem";
|
|
2
|
+
import { MarketsAbi } from "../abi/MarketsAbi.js";
|
|
3
|
+
import { SELL_OPTION } from "../constants/contractmethods.js";
|
|
4
|
+
const DEFAULT_DEADLINE_DURATION = 600; // 10 minutes
|
|
5
|
+
export function buildSellOptionRawTx(params) {
|
|
6
|
+
const { marketContractAddress, selectedOption, optionSide, sharesAmount, minAmountOut, deadline } = params;
|
|
7
|
+
const effectiveDeadline = deadline ?? BigInt(Math.floor(Date.now() / 1000) + DEFAULT_DEADLINE_DURATION);
|
|
8
|
+
if (!marketContractAddress)
|
|
9
|
+
throw new Error("marketContractAddress is required");
|
|
10
|
+
if (selectedOption === undefined || selectedOption === null)
|
|
11
|
+
throw new Error("selectedOption is required");
|
|
12
|
+
if (optionSide === undefined || optionSide === null)
|
|
13
|
+
throw new Error("optionSide is required");
|
|
14
|
+
if (!sharesAmount)
|
|
15
|
+
throw new Error("sharesAmount is required");
|
|
16
|
+
if (sharesAmount <= 0n)
|
|
17
|
+
throw new Error("sharesAmount must be greater than 0");
|
|
18
|
+
return {
|
|
19
|
+
to: marketContractAddress,
|
|
20
|
+
data: encodeFunctionData({
|
|
21
|
+
abi: MarketsAbi,
|
|
22
|
+
functionName: SELL_OPTION,
|
|
23
|
+
args: [selectedOption, optionSide, sharesAmount, minAmountOut ?? 0n, effectiveDeadline],
|
|
24
|
+
}),
|
|
25
|
+
value: 0n,
|
|
26
|
+
};
|
|
27
|
+
}
|
package/dist/tx/types.d.ts
CHANGED
|
@@ -25,6 +25,14 @@ export interface EnterOptionTxParams {
|
|
|
25
25
|
slippageTolerance?: bigint;
|
|
26
26
|
deadline?: bigint;
|
|
27
27
|
}
|
|
28
|
+
export interface SellOptionTxParams {
|
|
29
|
+
marketContractAddress: `0x${string}`;
|
|
30
|
+
selectedOption: bigint;
|
|
31
|
+
optionSide: OptionSide;
|
|
32
|
+
sharesAmount: bigint;
|
|
33
|
+
minAmountOut?: bigint;
|
|
34
|
+
deadline?: bigint;
|
|
35
|
+
}
|
|
28
36
|
export interface PlaceBuyOrderTxParams {
|
|
29
37
|
marketContractAddress: `0x${string}`;
|
|
30
38
|
option: bigint;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rain-sdk-v2",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.8",
|
|
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",
|