rain-sdk-v2 2.0.10 → 2.0.12
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 +17 -0
- package/dist/Rain.d.ts +3 -1
- package/dist/Rain.js +6 -0
- package/dist/abi/MarketsAbi.d.ts +12 -0
- package/dist/abi/MarketsAbi.js +1 -1
- package/dist/api/investments.d.ts +3 -1
- package/dist/api/investments.js +15 -0
- package/dist/api/types.d.ts +7 -0
- package/dist/tx/buildPlaceOrderRawTx.js +4 -4
- package/dist/tx/types.d.ts +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -366,12 +366,15 @@ const txs = await rain.buildPlaceBuyOrderTx({
|
|
|
366
366
|
optionSide: OptionSide.Yes,
|
|
367
367
|
price: parseEther('0.5'), // 50% price in 1e18 scale
|
|
368
368
|
amount: parseUnits('10', 6), // 10 USDT
|
|
369
|
+
postOnly: false, // optional, defaults to false. Set true for maker-only (reverts OrderWouldCross if it would cross the book)
|
|
369
370
|
walletAddress: '0x...', // user's wallet address
|
|
370
371
|
});
|
|
371
372
|
// Returns [approveTx?, placeBuyOrderTx]
|
|
372
373
|
```
|
|
373
374
|
|
|
374
375
|
> **Note:** Approval is handled automatically. Available when AMM pool is closed.
|
|
376
|
+
>
|
|
377
|
+
> **`postOnly`:** When `true`, the matching loop is skipped — the order rests directly. If `price` would cross a resting ask the call reverts `OrderWouldCross`, so the caller is never charged taker fees. When `false` (default), behaviour is unchanged: matches the sell book first and rests only the residual.
|
|
375
378
|
|
|
376
379
|
#### `buildPlaceSellOrderTx(params: PlaceSellOrderTxParams): RawTransaction`
|
|
377
380
|
|
|
@@ -384,10 +387,13 @@ const tx = rain.buildPlaceSellOrderTx({
|
|
|
384
387
|
optionSide: OptionSide.Yes,
|
|
385
388
|
price: parseEther('0.7'), // 70% price in 1e18 scale
|
|
386
389
|
shares: 5000000n, // shares to sell (from getUserOptionShares)
|
|
390
|
+
postOnly: false, // optional, defaults to false. Set true for maker-only (reverts OrderWouldCross if it would cross the book)
|
|
387
391
|
});
|
|
388
392
|
```
|
|
389
393
|
|
|
390
394
|
> **Note:** No approval needed. Shares are escrowed by the contract.
|
|
395
|
+
>
|
|
396
|
+
> **`postOnly`:** Same semantics as `buildPlaceBuyOrderTx` — `true` rejects orders that would immediately cross the buy book (revert `OrderWouldCross`); `false` matches the buy book first and rests only the residual.
|
|
391
397
|
|
|
392
398
|
#### `buildCancelBuyOrdersTx(params: CancelBuyOrdersTxParams): RawTransaction`
|
|
393
399
|
|
|
@@ -1017,6 +1023,17 @@ const count = await rain.getUserInvestedLivePoolsCount(accessToken);
|
|
|
1017
1023
|
|
|
1018
1024
|
// Calculate user open interest
|
|
1019
1025
|
const oi = await rain.calculateUserOpenInterest(accessToken);
|
|
1026
|
+
|
|
1027
|
+
// Get the authenticated user's positions in a specific subPool
|
|
1028
|
+
// (per-side net shares, weighted average buy price, projected payout on win)
|
|
1029
|
+
const positions = await rain.getUserPositions(
|
|
1030
|
+
{ poolId: '...', subPoolIndex: 1 },
|
|
1031
|
+
accessToken
|
|
1032
|
+
);
|
|
1033
|
+
|
|
1034
|
+
// Get the authenticated user's open positions across all subPools of a pool
|
|
1035
|
+
// (one entry per (subPool, side) the user still holds; excludes claimed / losing sides)
|
|
1036
|
+
const open = await rain.getOpenPositions({ poolId: '...' }, accessToken);
|
|
1020
1037
|
```
|
|
1021
1038
|
|
|
1022
1039
|
### Orders
|
package/dist/Rain.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { ExtendTimeTxParams } from './tx/buildExtendTimeRawTx.js';
|
|
|
4
4
|
import { RainCoreConfig, RainEnvironment } from './types.js';
|
|
5
5
|
import { LoginParams, LoginResult } from './auth/types.js';
|
|
6
6
|
import { EntrySharesResult } from './markets/getEntryShares.js';
|
|
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';
|
|
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, UserPositionsParams, OpenPositionsParams, PriceDataParams, AddReviewParams, GetUserOrdersParams, OrderBookParams, GetUserOrderByPoolIdParams, OrdersListingByPoolParams, AddUserPointsParams, UserOnboardingParams, PointsGraphParams, GetNotificationsParams, MarkNotificationAsReadParams, CreateDisputeMessageParams, GetPoolDisputeConvoParams, FollowToggleParams, FollowCheckParams, FollowListParams, FollowStatsParams, RainBurnPerPoolParams } from './api/types.js';
|
|
8
8
|
export declare class Rain {
|
|
9
9
|
readonly environment: RainEnvironment;
|
|
10
10
|
private readonly marketFactory;
|
|
@@ -244,6 +244,8 @@ export declare class Rain {
|
|
|
244
244
|
getPlatformVolume(accessToken?: string): Promise<import("./api/types.js").ApiResponse<unknown>>;
|
|
245
245
|
getUserInvestedLivePoolsCount(accessToken: string): Promise<import("./api/types.js").ApiResponse<unknown>>;
|
|
246
246
|
calculateUserOpenInterest(accessToken: string): Promise<import("./api/types.js").ApiResponse<unknown>>;
|
|
247
|
+
getUserPositions(params: UserPositionsParams, accessToken: string): Promise<import("./api/types.js").ApiResponse<unknown>>;
|
|
248
|
+
getOpenPositions(params: OpenPositionsParams, accessToken: string): Promise<import("./api/types.js").ApiResponse<unknown>>;
|
|
247
249
|
getPriceData(params: PriceDataParams, accessToken?: string): Promise<import("./api/types.js").ApiResponse<unknown>>;
|
|
248
250
|
addReview(params: AddReviewParams, accessToken: string): Promise<import("./api/types.js").ApiResponse<unknown>>;
|
|
249
251
|
getUserReviews(accessToken: string): Promise<import("./api/types.js").ApiResponse<unknown>>;
|
package/dist/Rain.js
CHANGED
|
@@ -382,6 +382,12 @@ export class Rain {
|
|
|
382
382
|
async calculateUserOpenInterest(accessToken) {
|
|
383
383
|
return investmentsApi.calculateUserOpenInterest(this.cfg(accessToken));
|
|
384
384
|
}
|
|
385
|
+
async getUserPositions(params, accessToken) {
|
|
386
|
+
return investmentsApi.getUserPositions(params, this.cfg(accessToken));
|
|
387
|
+
}
|
|
388
|
+
async getOpenPositions(params, accessToken) {
|
|
389
|
+
return investmentsApi.getOpenPositions(params, this.cfg(accessToken));
|
|
390
|
+
}
|
|
385
391
|
// ─── Price Data ──────────────────────────────────────────────────────────────
|
|
386
392
|
async getPriceData(params, accessToken) {
|
|
387
393
|
return priceDataApi.getPriceData(params, this.cfg(accessToken));
|
package/dist/abi/MarketsAbi.d.ts
CHANGED
|
@@ -1324,6 +1324,10 @@ export declare const MarketsAbi: readonly [{
|
|
|
1324
1324
|
readonly name: "amount";
|
|
1325
1325
|
readonly type: "uint256";
|
|
1326
1326
|
readonly internalType: "uint256";
|
|
1327
|
+
}, {
|
|
1328
|
+
readonly name: "postOnly";
|
|
1329
|
+
readonly type: "bool";
|
|
1330
|
+
readonly internalType: "bool";
|
|
1327
1331
|
}];
|
|
1328
1332
|
readonly outputs: readonly [{
|
|
1329
1333
|
readonly name: "orderID";
|
|
@@ -1350,6 +1354,10 @@ export declare const MarketsAbi: readonly [{
|
|
|
1350
1354
|
readonly name: "shares";
|
|
1351
1355
|
readonly type: "uint256";
|
|
1352
1356
|
readonly internalType: "uint256";
|
|
1357
|
+
}, {
|
|
1358
|
+
readonly name: "postOnly";
|
|
1359
|
+
readonly type: "bool";
|
|
1360
|
+
readonly internalType: "bool";
|
|
1353
1361
|
}];
|
|
1354
1362
|
readonly outputs: readonly [{
|
|
1355
1363
|
readonly name: "orderID";
|
|
@@ -2928,6 +2936,10 @@ export declare const MarketsAbi: readonly [{
|
|
|
2928
2936
|
readonly type: "error";
|
|
2929
2937
|
readonly name: "OrderDoesNotExist";
|
|
2930
2938
|
readonly inputs: readonly [];
|
|
2939
|
+
}, {
|
|
2940
|
+
readonly type: "error";
|
|
2941
|
+
readonly name: "OrderWouldCross";
|
|
2942
|
+
readonly inputs: readonly [];
|
|
2931
2943
|
}, {
|
|
2932
2944
|
readonly type: "error";
|
|
2933
2945
|
readonly name: "PoolClosed";
|
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": "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": [] }];
|
|
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" }, { "name": "postOnly", "type": "bool", "internalType": "bool" }], "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" }, { "name": "postOnly", "type": "bool", "internalType": "bool" }], "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": "OrderWouldCross", "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": [] }];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ApiConfig, ApiResponse, UserTotalInvestmentParams, OptionsTotalVolumeParams, PoolActivityParams, TopHoldersParams, UserInvestedPoolsParams, InvestmentVolumeGraphParams, UserPnlGraphParams, TopWinnersLosersParams, PnlByPoolIdParams } from './types.js';
|
|
1
|
+
import { ApiConfig, ApiResponse, UserTotalInvestmentParams, OptionsTotalVolumeParams, PoolActivityParams, TopHoldersParams, UserInvestedPoolsParams, InvestmentVolumeGraphParams, UserPnlGraphParams, TopWinnersLosersParams, PnlByPoolIdParams, UserPositionsParams, OpenPositionsParams } from './types.js';
|
|
2
2
|
export declare function getUserTotalInvestment(params: UserTotalInvestmentParams, config: ApiConfig): Promise<ApiResponse>;
|
|
3
3
|
export declare function getOptionsTotalVolume(params: OptionsTotalVolumeParams, config: ApiConfig): Promise<ApiResponse>;
|
|
4
4
|
export declare function getPoolActivity(params: PoolActivityParams, config: ApiConfig): Promise<ApiResponse>;
|
|
@@ -19,3 +19,5 @@ export declare function getUserOverallInvestment(config: ApiConfig): Promise<Api
|
|
|
19
19
|
export declare function getPlatformVolume(config: ApiConfig): Promise<ApiResponse>;
|
|
20
20
|
export declare function getUserInvestedLivePoolsCount(config: ApiConfig): Promise<ApiResponse>;
|
|
21
21
|
export declare function calculateUserOpenInterest(config: ApiConfig): Promise<ApiResponse>;
|
|
22
|
+
export declare function getUserPositions(params: UserPositionsParams, config: ApiConfig): Promise<ApiResponse>;
|
|
23
|
+
export declare function getOpenPositions(params: OpenPositionsParams, config: ApiConfig): Promise<ApiResponse>;
|
package/dist/api/investments.js
CHANGED
|
@@ -133,3 +133,18 @@ export async function calculateUserOpenInterest(config) {
|
|
|
133
133
|
});
|
|
134
134
|
return handleResponse(res);
|
|
135
135
|
}
|
|
136
|
+
export async function getUserPositions(params, config) {
|
|
137
|
+
const qs = buildQuery({ subPoolIndex: params.subPoolIndex });
|
|
138
|
+
const res = await fetch(`${config.apiUrl}/investments/${encodeURIComponent(params.poolId)}/user-positions${qs}`, {
|
|
139
|
+
method: 'GET',
|
|
140
|
+
headers: buildHeaders(config),
|
|
141
|
+
});
|
|
142
|
+
return handleResponse(res);
|
|
143
|
+
}
|
|
144
|
+
export async function getOpenPositions(params, config) {
|
|
145
|
+
const res = await fetch(`${config.apiUrl}/investments/${encodeURIComponent(params.poolId)}/open-positions`, {
|
|
146
|
+
method: 'GET',
|
|
147
|
+
headers: buildHeaders(config),
|
|
148
|
+
});
|
|
149
|
+
return handleResponse(res);
|
|
150
|
+
}
|
package/dist/api/types.d.ts
CHANGED
|
@@ -192,6 +192,13 @@ export interface TopWinnersLosersParams {
|
|
|
192
192
|
export interface PnlByPoolIdParams {
|
|
193
193
|
poolId: string;
|
|
194
194
|
}
|
|
195
|
+
export interface UserPositionsParams {
|
|
196
|
+
poolId: string;
|
|
197
|
+
subPoolIndex: number;
|
|
198
|
+
}
|
|
199
|
+
export interface OpenPositionsParams {
|
|
200
|
+
poolId: string;
|
|
201
|
+
}
|
|
195
202
|
export interface PriceDataParams {
|
|
196
203
|
contractAddress: string;
|
|
197
204
|
side: 1 | 2;
|
|
@@ -4,7 +4,7 @@ import { PLACE_BUY_ORDER, PLACE_SELL_ORDER } from "../constants/contractmethods.
|
|
|
4
4
|
import { checkMarketTokenAllowance } from "../utils/helpers.js";
|
|
5
5
|
import { buildApproveRawTx } from "./buildApprovalRawTx.js";
|
|
6
6
|
export async function buildPlaceBuyOrderRawTx(params) {
|
|
7
|
-
const { marketContractAddress, option, optionSide, price, amount, walletAddress, rpcUrl } = params;
|
|
7
|
+
const { marketContractAddress, option, optionSide, price, amount, postOnly = false, walletAddress, rpcUrl } = params;
|
|
8
8
|
if (!marketContractAddress)
|
|
9
9
|
throw new Error("marketContractAddress is required");
|
|
10
10
|
if (option === undefined || option === null)
|
|
@@ -25,14 +25,14 @@ export async function buildPlaceBuyOrderRawTx(params) {
|
|
|
25
25
|
data: encodeFunctionData({
|
|
26
26
|
abi: MarketsAbi,
|
|
27
27
|
functionName: PLACE_BUY_ORDER,
|
|
28
|
-
args: [option, optionSide, price, amount],
|
|
28
|
+
args: [option, optionSide, price, amount, postOnly],
|
|
29
29
|
}),
|
|
30
30
|
value: 0n,
|
|
31
31
|
});
|
|
32
32
|
return txs;
|
|
33
33
|
}
|
|
34
34
|
export function buildPlaceSellOrderRawTx(params) {
|
|
35
|
-
const { marketContractAddress, option, optionSide, price, shares } = params;
|
|
35
|
+
const { marketContractAddress, option, optionSide, price, shares, postOnly = false } = params;
|
|
36
36
|
if (!marketContractAddress)
|
|
37
37
|
throw new Error("marketContractAddress is required");
|
|
38
38
|
if (option === undefined || option === null)
|
|
@@ -48,7 +48,7 @@ export function buildPlaceSellOrderRawTx(params) {
|
|
|
48
48
|
data: encodeFunctionData({
|
|
49
49
|
abi: MarketsAbi,
|
|
50
50
|
functionName: PLACE_SELL_ORDER,
|
|
51
|
-
args: [option, optionSide, price, shares],
|
|
51
|
+
args: [option, optionSide, price, shares, postOnly],
|
|
52
52
|
}),
|
|
53
53
|
value: 0n,
|
|
54
54
|
};
|
package/dist/tx/types.d.ts
CHANGED
|
@@ -39,6 +39,7 @@ export interface PlaceBuyOrderTxParams {
|
|
|
39
39
|
optionSide: OptionSide;
|
|
40
40
|
price: bigint;
|
|
41
41
|
amount: bigint;
|
|
42
|
+
postOnly?: boolean;
|
|
42
43
|
}
|
|
43
44
|
export interface PlaceSellOrderTxParams {
|
|
44
45
|
marketContractAddress: `0x${string}`;
|
|
@@ -46,6 +47,7 @@ export interface PlaceSellOrderTxParams {
|
|
|
46
47
|
optionSide: OptionSide;
|
|
47
48
|
price: bigint;
|
|
48
49
|
shares: bigint;
|
|
50
|
+
postOnly?: boolean;
|
|
49
51
|
}
|
|
50
52
|
export interface CancelBuyOrdersTxParams {
|
|
51
53
|
marketContractAddress: `0x${string}`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rain-sdk-v2",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.12",
|
|
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",
|