rain-sdk-v2 1.2.1 → 2.0.0
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/dist/Rain.d.ts +6 -1
- package/dist/Rain.js +6 -2
- package/dist/abi/CreateMarketAbi.d.ts +1190 -87
- package/dist/abi/CreateMarketAbi.js +2 -1
- package/dist/abi/MarketsAbi.d.ts +91 -1
- package/dist/abi/MarketsAbi.js +3 -1
- package/dist/config/environments.d.ts +9 -0
- package/dist/config/environments.js +23 -13
- package/dist/markets/getOptionClaimed.d.ts +7 -0
- package/dist/markets/getOptionClaimed.js +17 -0
- package/dist/tx/CreateMarket/buildCreateMarketRawTx.js +3 -3
- package/dist/tx/buildAddLiquidityRawTx.js +26 -3
- package/dist/tx/buildEnterOptionRawTx.js +21 -3
- package/dist/tx/buildRemoveLiquidityRawTx.d.ts +3 -1
- package/dist/tx/buildRemoveLiquidityRawTx.js +24 -4
- package/dist/tx/types.d.ts +12 -0
- package/package.json +1 -1
package/dist/abi/MarketsAbi.js
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
|
-
export const MarketsAbi = [{ "type": "function", "name": "APPEAL_FEE_MIN", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "DISPUTE_FEE_MAX", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "DISPUTE_FEE_MIN", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "DISPUTE_WINDOW", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "FACTORY", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "FEE_MAGNIFICATION", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "ORDER_EXECUTION_FEE", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "PRICE_MAGNIFICATION", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "RESOLUTION_FEE_MAX", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "RESOLUTION_FEE_MIN", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "TICK_SPACING", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "ammNoReserve", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "ammYesReserve", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "baseToken", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "baseTokenDecimals", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "buyOrders", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "internalType": "uint8" }, { "name": "price", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "headIndex", "type": "int256", "internalType": "int256" }, { "name": "tailIndex", "type": "int256", "internalType": "int256" }, { "name": "count", "type": "int256", "internalType": "int256" }, { "name": "isInitialized", "type": "bool", "internalType": "bool" }], "stateMutability": "view" }, { "type": "function", "name": "calculateBaseTokenOracleFixedFee", "inputs": [{ "name": "oracleFixedFee", "type": "uint256", "internalType": "uint256" }, { "name": "tokenData", "type": "tuple", "internalType": "struct IRainDeployer.TokenData", "components": [{ "name": "tokenPool", "type": "uint8", "internalType": "enum IRainDeployer.TokenPool" }, { "name": "isAllowed", "type": "bool", "internalType": "bool" }, { "name": "routerAddress", "type": "address", "internalType": "address" }, { "name": "routerHelper", "type": "address", "internalType": "address" }, { "name": "pathUSDTToToken", "type": "bytes", "internalType": "bytes" }, { "name": "pathTokenToUSDT", "type": "bytes", "internalType": "bytes" }, { "name": "pathTokenWETH", "type": "bytes", "internalType": "bytes" }] }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "nonpayable" }, { "type": "function", "name": "cancelBuyOrders", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8[]", "internalType": "uint8[]" }, { "name": "price", "type": "uint256[]", "internalType": "uint256[]" }, { "name": "orderID", "type": "uint256[]", "internalType": "uint256[]" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "cancelSellOrders", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8[]", "internalType": "uint8[]" }, { "name": "price", "type": "uint256[]", "internalType": "uint256[]" }, { "name": "orderID", "type": "uint256[]", "internalType": "uint256[]" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "chooseWinner", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "internalType": "uint8" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "claim", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "closePool", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "closePool", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "proposedWinner", "type": "uint8", "internalType": "uint8" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "closingFee", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "creatorFee", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "disputeResolver", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "endTime", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "enterLiquidity", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "totalAmount", "type": "uint256", "internalType": "uint256" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "enterLiquidityBatch", "inputs": [{ "name": "totalAmount", "type": "uint256", "internalType": "uint256" }, { "name": "percentages", "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" }], "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": "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" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "resolver", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "resolverIsAI", "inputs": [], "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], "stateMutability": "view" }, { "type": "function", "name": "resolverShareUSDT", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "resultResolverFee", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "sellOrders", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "internalType": "uint8" }, { "name": "price", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "headIndex", "type": "int256", "internalType": "int256" }, { "name": "tailIndex", "type": "int256", "internalType": "int256" }, { "name": "count", "type": "int256", "internalType": "int256" }, { "name": "isInitialized", "type": "bool", "internalType": "bool" }], "stateMutability": "view" }, { "type": "function", "name": "split", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "amount", "type": "uint256", "internalType": "uint256" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "startTime", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "swapOracleFixedFee", "inputs": [{ "name": "baseToken", "type": "address", "internalType": "address" }, { "name": "tokenData", "type": "tuple", "internalType": "struct IRainDeployer.TokenData", "components": [{ "name": "tokenPool", "type": "uint8", "internalType": "enum IRainDeployer.TokenPool" }, { "name": "isAllowed", "type": "bool", "internalType": "bool" }, { "name": "routerAddress", "type": "address", "internalType": "address" }, { "name": "routerHelper", "type": "address", "internalType": "address" }, { "name": "pathUSDTToToken", "type": "bytes", "internalType": "bytes" }, { "name": "pathTokenToUSDT", "type": "bytes", "internalType": "bytes" }, { "name": "pathTokenWETH", "type": "bytes", "internalType": "bytes" }] }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "tokenData", "inputs": [], "outputs": [{ "name": "tokenPool", "type": "uint8", "internalType": "enum IRainDeployer.TokenPool" }, { "name": "isAllowed", "type": "bool", "internalType": "bool" }, { "name": "routerAddress", "type": "address", "internalType": "address" }, { "name": "routerHelper", "type": "address", "internalType": "address" }, { "name": "pathUSDTToToken", "type": "bytes", "internalType": "bytes" }, { "name": "pathTokenToUSDT", "type": "bytes", "internalType": "bytes" }, { "name": "pathTokenToWETH", "type": "bytes", "internalType": "bytes" }], "stateMutability": "view" }, { "type": "function", "name": "tooEarly", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "totalMarketFunds", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "totalMarketShares", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "totalOptionLPShares", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "totalOrders", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "nonpayable" }, { "type": "function", "name": "tradingModel", "inputs": [], "outputs": [{ "name": "", "type": "uint8", "internalType": "enum Types.TradingModel" }], "stateMutability": "view" }, { "type": "function", "name": "usdt", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "userActiveBuyOrders", "inputs": [{ "name": "user", "type": "address", "internalType": "address" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "userActiveSellOrders", "inputs": [{ "name": "user", "type": "address", "internalType": "address" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "userFeeDebtX128", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "user", "type": "address", "internalType": "address" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "userFundsPerSideInEscrow", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "internalType": "uint8" }, { "name": "user", "type": "address", "internalType": "address" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "userOptionLPShares", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "user", "type": "address", "internalType": "address" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "userOptionPerSideShares", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "internalType": "uint8" }, { "name": "user", "type": "address", "internalType": "address" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "userSharesPerSideInEscrow", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "internalType": "uint8" }, { "name": "user", "type": "address", "internalType": "address" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "event", "name": "AddLiquidity", "inputs": [{ "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "baseAmount", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "lpShares", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "wallet", "type": "address", "indexed": true, "internalType": "address" }], "anonymous": false }, { "type": "event", "name": "AppealFeeRefunded", "inputs": [{ "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "appealer", "type": "address", "indexed": true, "internalType": "address" }, { "name": "appealFee", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "appealedWinner", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "CancelBuyOrder", "inputs": [{ "name": "orderOption", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "orderOptionSide", "type": "uint8", "indexed": false, "internalType": "uint8" }, { "name": "orderBaseAmount", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "orderPrice", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "orderID", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "orderCreator", "type": "address", "indexed": true, "internalType": "address" }], "anonymous": false }, { "type": "event", "name": "CancelSellOrder", "inputs": [{ "name": "orderOption", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "orderOptionSide", "type": "uint8", "indexed": false, "internalType": "uint8" }, { "name": "sharesAmount", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "orderPrice", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "orderID", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "orderCreator", "type": "address", "indexed": true, "internalType": "address" }], "anonymous": false }, { "type": "event", "name": "ChooseWinner", "inputs": [{ "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "indexed": false, "internalType": "uint8" }, { "name": "platformShare", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "winningShare", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "ChooseWinnerAppeal", "inputs": [{ "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "indexed": false, "internalType": "uint8" }, { "name": "platformShare", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "winningShare", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "ChooseWinnerDispute", "inputs": [{ "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "indexed": false, "internalType": "uint8" }, { "name": "platformShare", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "winningShare", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "Claim", "inputs": [{ "name": "wallet", "type": "address", "indexed": true, "internalType": "address" }, { "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "winnerSide", "type": "uint8", "indexed": false, "internalType": "uint8" }, { "name": "winningReward", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "ClaimSwapFees", "inputs": [{ "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "amount", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "wallet", "type": "address", "indexed": true, "internalType": "address" }], "anonymous": false }, { "type": "event", "name": "ClosePool", "inputs": [{ "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "side", "type": "uint8", "indexed": false, "internalType": "uint8" }], "anonymous": false }, { "type": "event", "name": "ClosingShareClaim", "inputs": [{ "name": "closer", "type": "address", "indexed": true, "internalType": "address" }, { "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "closingShare", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "CreateOracle", "inputs": [{ "name": "creatorContract", "type": "address", "indexed": true, "internalType": "address" }, { "name": "createdContract", "type": "address", "indexed": true, "internalType": "address" }, { "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "CreatorClaim", "inputs": [{ "name": "wallet", "type": "address", "indexed": true, "internalType": "address" }, { "name": "amount", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "DisputeFeeRefunded", "inputs": [{ "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "disputer", "type": "address", "indexed": true, "internalType": "address" }, { "name": "disputeFee", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "disputedWinner", "type": "uint8", "indexed": false, "internalType": "uint8" }], "anonymous": false }, { "type": "event", "name": "EnterOption", "inputs": [{ "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "indexed": false, "internalType": "uint8" }, { "name": "baseAmount", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "sharesAmount", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "wallet", "type": "address", "indexed": false, "internalType": "address" }], "anonymous": false }, { "type": "event", "name": "ExecuteBuyOrder", "inputs": [{ "name": "orderOption", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "orderOptionSide", "type": "uint8", "indexed": false, "internalType": "uint8" }, { "name": "orderPrice", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "sharesAmount", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "baseAmount", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "orderID", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "maker", "type": "address", "indexed": true, "internalType": "address" }, { "name": "taker", "type": "address", "indexed": true, "internalType": "address" }], "anonymous": false }, { "type": "event", "name": "ExecuteSellOrder", "inputs": [{ "name": "orderOption", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "orderOptionSide", "type": "uint8", "indexed": false, "internalType": "uint8" }, { "name": "orderPrice", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "sharesAmount", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "baseAmount", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "orderID", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "maker", "type": "address", "indexed": true, "internalType": "address" }, { "name": "taker", "type": "address", "indexed": true, "internalType": "address" }], "anonymous": false }, { "type": "event", "name": "Merge", "inputs": [{ "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "amount", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "wallet", "type": "address", "indexed": true, "internalType": "address" }], "anonymous": false }, { "type": "event", "name": "OpenAppeal", "inputs": [{ "name": "caller", "type": "address", "indexed": true, "internalType": "address" }, { "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "currentWinner", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "appealFee", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "OpenDispute", "inputs": [{ "name": "caller", "type": "address", "indexed": true, "internalType": "address" }, { "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "currentWinner", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "disputeFee", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "PlaceBuyOrder", "inputs": [{ "name": "orderOption", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "orderOptionSide", "type": "uint8", "indexed": false, "internalType": "uint8" }, { "name": "orderPrice", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "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": "PlaceSellOrder", "inputs": [{ "name": "orderOption", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "orderOptionSide", "type": "uint8", "indexed": false, "internalType": "uint8" }, { "name": "orderPrice", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "sharesAmount", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "orderID", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "maker", "type": "address", "indexed": true, "internalType": "address" }], "anonymous": false }, { "type": "event", "name": "PlatformClaim", "inputs": [{ "name": "wallet", "type": "address", "indexed": true, "internalType": "address" }, { "name": "amount", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "Price", "inputs": [{ "name": "option", "type": "uint256", "indexed": true, "internalType": "uint256" }, { "name": "yesReserve", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "noReserve", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "optionTotalFunds", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "RainTokenBurned", "inputs": [{ "name": "amountBurned", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "ReferrerClaim", "inputs": [{ "name": "wallet", "type": "address", "indexed": true, "internalType": "address" }, { "name": "amount", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "RemoveLiquidity", "inputs": [{ "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "lpShares", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "baseTokensReturned", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "yesReturned", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "noReturned", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "feesEarned", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "wallet", "type": "address", "indexed": true, "internalType": "address" }], "anonymous": false }, { "type": "event", "name": "ResolutionProposed", "inputs": [{ "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "indexed": false, "internalType": "uint8" }, { "name": "resolutionProposer", "type": "address", "indexed": true, "internalType": "address" }, { "name": "resolverBond", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "proposedWinner", "type": "uint8", "indexed": false, "internalType": "uint8" }], "anonymous": false }, { "type": "event", "name": "ResolutionProposerRefund", "inputs": [{ "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "indexed": false, "internalType": "uint8" }, { "name": "resolutionProposer", "type": "address", "indexed": true, "internalType": "address" }, { "name": "resolverBond", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "proposedWinner", "type": "uint8", "indexed": false, "internalType": "uint8" }], "anonymous": false }, { "type": "event", "name": "ResolverClaim", "inputs": [{ "name": "wallet", "type": "address", "indexed": true, "internalType": "address" }, { "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "amount", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "ResolverSet", "inputs": [{ "name": "resolver", "type": "address", "indexed": true, "internalType": "address" }, { "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "Split", "inputs": [{ "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "amount", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "wallet", "type": "address", "indexed": true, "internalType": "address" }], "anonymous": false }, { "type": "event", "name": "TooEarly", "inputs": [{ "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "resolutionProposer", "type": "address", "indexed": true, "internalType": "address" }, { "name": "resolverBond", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "proposedWinner", "type": "uint8", "indexed": false, "internalType": "uint8" }], "anonymous": false }, { "type": "error", "name": "AlreadyClaimed", "inputs": [] }, { "type": "error", "name": "AlreadyInitialized", "inputs": [] }, { "type": "error", "name": "ArrayLengthMismatch", "inputs": [] }, { "type": "error", "name": "CallerNotOrderPlacer", "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": "InvalidOracleFixedFee", "inputs": [] }, { "type": "error", "name": "InvalidPoolState", "inputs": [] }, { "type": "error", "name": "InvalidPrice", "inputs": [] }, { "type": "error", "name": "InvalidSide", "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": "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": "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
|
+
// Diamond proxy constructor ABI (for reference only — not used by SDK):
|
|
2
|
+
// export const MarketsDiamondAbi = [{"inputs":[{"components":[{"internalType":"address","name":"facetAddress","type":"address"},{"internalType":"enum IDiamondCut.FacetCutAction","name":"action","type":"uint8"},{"internalType":"bytes4[]","name":"functionSelectors","type":"bytes4[]"}],"internalType":"struct IDiamondCut.FacetCut[]","name":"_diamondCut","type":"tuple[]"},{"components":[{"internalType":"uint256","name":"initialLiquidity","type":"uint256"},{"internalType":"uint256[]","name":"liquidityPercentages","type":"uint256[]"},{"internalType":"uint256[]","name":"initialYesPrices","type":"uint256[]"},{"internalType":"bool","name":"isPublic","type":"bool"},{"internalType":"bool","name":"resolverIsAI","type":"bool"},{"internalType":"address","name":"deployerContract","type":"address"},{"internalType":"address","name":"baseToken","type":"address"},{"internalType":"address","name":"usdt","type":"address"},{"internalType":"address","name":"poolOwner","type":"address"},{"internalType":"address","name":"platformAddress","type":"address"},{"internalType":"address","name":"resolver","type":"address"},{"internalType":"address","name":"disputeResolver","type":"address"},{"internalType":"address","name":"rainToken","type":"address"},{"internalType":"address","name":"referrer","type":"address"},{"internalType":"uint256","name":"baseTokenDecimals","type":"uint256"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"uint256","name":"numberOfOptions","type":"uint256"},{"internalType":"uint256","name":"platformFee","type":"uint256"},{"internalType":"uint256","name":"liquidityFee","type":"uint256"},{"internalType":"uint256","name":"creatorFee","type":"uint256"},{"internalType":"uint256","name":"resultResolverFee","type":"uint256"},{"internalType":"uint256","name":"closingFee","type":"uint256"},{"internalType":"uint256","name":"oracleFixedFee","type":"uint256"},{"internalType":"uint256","name":"oracleEndTime","type":"uint256"},{"internalType":"string","name":"ipfsUri","type":"string"},{"components":[{"internalType":"enum IRainDeployer.TokenPool","name":"tokenPool","type":"uint8"},{"internalType":"bool","name":"isAllowed","type":"bool"},{"internalType":"address","name":"routerAddress","type":"address"},{"internalType":"address","name":"routerHelper","type":"address"},{"internalType":"bytes","name":"pathUSDTToToken","type":"bytes"},{"internalType":"bytes","name":"pathTokenToUSDT","type":"bytes"},{"internalType":"bytes","name":"pathTokenWETH","type":"bytes"}],"internalType":"struct IRainDeployer.TokenData","name":"tokenData","type":"tuple"},{"internalType":"enum Types.TradingModel","name":"tradingModel","type":"uint8"}],"internalType":"struct IRainPool.Params","name":"params","type":"tuple"}],"stateMutability":"payable","type":"constructor"},{"stateMutability":"payable","type":"fallback"},{"stateMutability":"payable","type":"receive"}] as const
|
|
3
|
+
export const MarketsAbi = [{ "type": "function", "name": "APPEAL_FEE_MIN", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "DISPUTE_FEE_MAX", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "DISPUTE_FEE_MIN", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "DISPUTE_WINDOW", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "FACTORY", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "FEE_MAGNIFICATION", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "ORDER_EXECUTION_FEE", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "PRICE_MAGNIFICATION", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "RESOLUTION_FEE_MAX", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "RESOLUTION_FEE_MIN", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "TICK_SPACING", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "ammNoReserve", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "ammYesReserve", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "baseToken", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "baseTokenDecimals", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "buyOrders", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "internalType": "uint8" }, { "name": "price", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "headIndex", "type": "int256", "internalType": "int256" }, { "name": "tailIndex", "type": "int256", "internalType": "int256" }, { "name": "count", "type": "int256", "internalType": "int256" }, { "name": "isInitialized", "type": "bool", "internalType": "bool" }], "stateMutability": "view" }, { "type": "function", "name": "calculateBaseTokenOracleFixedFee", "inputs": [{ "name": "oracleFixedFee", "type": "uint256", "internalType": "uint256" }, { "name": "tokenData", "type": "tuple", "internalType": "struct IRainDeployer.TokenData", "components": [{ "name": "tokenPool", "type": "uint8", "internalType": "enum IRainDeployer.TokenPool" }, { "name": "isAllowed", "type": "bool", "internalType": "bool" }, { "name": "routerAddress", "type": "address", "internalType": "address" }, { "name": "routerHelper", "type": "address", "internalType": "address" }, { "name": "pathUSDTToToken", "type": "bytes", "internalType": "bytes" }, { "name": "pathTokenToUSDT", "type": "bytes", "internalType": "bytes" }, { "name": "pathTokenWETH", "type": "bytes", "internalType": "bytes" }] }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "nonpayable" }, { "type": "function", "name": "cancelBuyOrders", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8[]", "internalType": "uint8[]" }, { "name": "price", "type": "uint256[]", "internalType": "uint256[]" }, { "name": "orderID", "type": "uint256[]", "internalType": "uint256[]" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "cancelSellOrders", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8[]", "internalType": "uint8[]" }, { "name": "price", "type": "uint256[]", "internalType": "uint256[]" }, { "name": "orderID", "type": "uint256[]", "internalType": "uint256[]" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "chooseWinner", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "internalType": "uint8" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "claim", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "closePool", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "closePool", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "proposedWinner", "type": "uint8", "internalType": "uint8" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "closingFee", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "creatorFee", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "disputeResolver", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "endTime", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "enterLiquidity", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "totalAmount", "type": "uint256", "internalType": "uint256" }, { "name": "minYesToDeposit", "type": "uint256", "internalType": "uint256" }, { "name": "minNoToDeposit", "type": "uint256", "internalType": "uint256" }, { "name": "deadline", "type": "uint256", "internalType": "uint256" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "enterLiquidityBatch", "inputs": [{ "name": "totalAmount", "type": "uint256", "internalType": "uint256" }, { "name": "percentages", "type": "uint256[]", "internalType": "uint256[]" }, { "name": "minYesToDeposit", "type": "uint256[]", "internalType": "uint256[]" }, { "name": "minNoToDeposit", "type": "uint256[]", "internalType": "uint256[]" }, { "name": "deadline", "type": "uint256", "internalType": "uint256" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "enterOption", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "internalType": "uint8" }, { "name": "amount", "type": "uint256", "internalType": "uint256" }, { "name": "minSharesOut", "type": "uint256", "internalType": "uint256" }, { "name": "deadline", "type": "uint256", "internalType": "uint256" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "feePerLPShareX128", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "firstBuyOrderPrice", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "internalType": "uint8" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "firstSellOrderPrice", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "internalType": "uint8" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "getAmountRequired", "inputs": [{ "name": "targetPrice", "type": "uint256", "internalType": "uint256" }, { "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "internalType": "uint8" }], "outputs": [{ "name": "requiredAmount", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "getCreatorReward", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "creatorReward", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "getCurrentPrice", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "internalType": "uint8" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "getDisputeAppealFee", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "disputeFee", "type": "uint256", "internalType": "uint256" }], "stateMutability": "nonpayable" }, { "type": "function", "name": "getDynamicPayout", "inputs": [{ "name": "user", "type": "address", "internalType": "address" }, { "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "dynamicPayout", "type": "uint256[]", "internalType": "uint256[]" }], "stateMutability": "view" }, { "type": "function", "name": "getEntryShares", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "internalType": "uint8" }, { "name": "amount", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "returnedShares", "type": "uint256", "internalType": "uint256" }, { "name": "expectedReward", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "getImpactedPrice", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "internalType": "uint8" }, { "name": "amount", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "getLiquidityReward", "inputs": [{ "name": "user", "type": "address", "internalType": "address" }, { "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "liquidityReward", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "getRemovedLiquidity", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "lpShares", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "yesBack", "type": "uint256", "internalType": "uint256" }, { "name": "noBack", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "getResolverBondAmount", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "resolverBondAmount", "type": "uint256", "internalType": "uint256" }], "stateMutability": "nonpayable" }, { "type": "function", "name": "getResolverReward", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "resolverReward", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "getReturnedLiquidity", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "totalAmount", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "returnedShares", "type": "uint256[]", "internalType": "uint256[]" }, { "name": "returnedAmounts", "type": "uint256[]", "internalType": "uint256[]" }], "stateMutability": "view" }, { "type": "function", "name": "getReturnedShares", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "internalType": "uint8" }, { "name": "amount", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "getSharesReward", "inputs": [{ "name": "user", "type": "address", "internalType": "address" }, { "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "sharesReward", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "ipfsUri", "inputs": [], "outputs": [{ "name": "", "type": "string", "internalType": "string" }], "stateMutability": "view" }, { "type": "function", "name": "isOptionAppealed", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], "stateMutability": "view" }, { "type": "function", "name": "isOptionDisputed", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], "stateMutability": "view" }, { "type": "function", "name": "isPublic", "inputs": [], "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], "stateMutability": "view" }, { "type": "function", "name": "liquidityFee", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "merge", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "amount", "type": "uint256", "internalType": "uint256" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "numberOfOptions", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "openDispute", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "optionAppeal", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "disputeFee", "type": "uint256", "internalType": "uint256" }, { "name": "disputedWinner", "type": "uint256", "internalType": "uint256" }, { "name": "disputer", "type": "address", "internalType": "address" }, { "name": "appealResolver", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "optionClaimed", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "user", "type": "address", "internalType": "address" }], "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], "stateMutability": "view" }, { "type": "function", "name": "optionClosingShare", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "optionCreatorShare", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "optionDispute", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "disputeFee", "type": "uint256", "internalType": "uint256" }, { "name": "disputedWinner", "type": "uint256", "internalType": "uint256" }, { "name": "disputer", "type": "address", "internalType": "address" }, { "name": "_disputeResolver", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "optionEndTime", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "optionEndTimeCache", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "optionFinalized", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], "stateMutability": "view" }, { "type": "function", "name": "optionFirstClaim", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], "stateMutability": "view" }, { "type": "function", "name": "optionOrderBookShare", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "optionPerSideFunds", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "internalType": "uint8" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "optionPerSideShares", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "internalType": "uint8" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "optionPlatformShare", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "optionProposedWinner", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint8", "internalType": "uint8" }], "stateMutability": "view" }, { "type": "function", "name": "optionResolutionProposer", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "optionResolved", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], "stateMutability": "view" }, { "type": "function", "name": "optionResolver", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "optionResolverBond", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "optionResolverShare", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "optionState", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint8", "internalType": "enum Types.PoolState" }], "stateMutability": "view" }, { "type": "function", "name": "optionTotalFunds", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "optionTotalShares", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "optionWinner", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint8", "internalType": "uint8" }], "stateMutability": "view" }, { "type": "function", "name": "optionWinningPoolShare", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "oracleEndTime", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "oracleFixedFee", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "orderBook", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "internalType": "uint8" }, { "name": "price", "type": "uint256", "internalType": "uint256" }, { "name": "orderID", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "exists", "type": "bool", "internalType": "bool" }, { "name": "index", "type": "int256", "internalType": "int256" }], "stateMutability": "view" }, { "type": "function", "name": "ordersAdded", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "ordersRemoved", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "placeBuyOrder", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "internalType": "uint8" }, { "name": "price", "type": "uint256", "internalType": "uint256" }, { "name": "amount", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "orderID", "type": "uint256", "internalType": "uint256" }], "stateMutability": "nonpayable" }, { "type": "function", "name": "placeSellOrder", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "internalType": "uint8" }, { "name": "price", "type": "uint256", "internalType": "uint256" }, { "name": "shares", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "orderID", "type": "uint256", "internalType": "uint256" }], "stateMutability": "nonpayable" }, { "type": "function", "name": "platformAddress", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "platformFee", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "poolOwner", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "rainToken", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "referrer", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "removeLiquidity", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "lpShares", "type": "uint256", "internalType": "uint256" }, { "name": "minYesOut", "type": "uint256", "internalType": "uint256" }, { "name": "minNoOut", "type": "uint256", "internalType": "uint256" }, { "name": "deadline", "type": "uint256", "internalType": "uint256" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "resolver", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "resolverIsAI", "inputs": [], "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], "stateMutability": "view" }, { "type": "function", "name": "resolverShareUSDT", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "resultResolverFee", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "sellOrders", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "internalType": "uint8" }, { "name": "price", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "headIndex", "type": "int256", "internalType": "int256" }, { "name": "tailIndex", "type": "int256", "internalType": "int256" }, { "name": "count", "type": "int256", "internalType": "int256" }, { "name": "isInitialized", "type": "bool", "internalType": "bool" }], "stateMutability": "view" }, { "type": "function", "name": "split", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "amount", "type": "uint256", "internalType": "uint256" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "startTime", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "swapOracleFixedFee", "inputs": [{ "name": "baseToken", "type": "address", "internalType": "address" }, { "name": "tokenData", "type": "tuple", "internalType": "struct IRainDeployer.TokenData", "components": [{ "name": "tokenPool", "type": "uint8", "internalType": "enum IRainDeployer.TokenPool" }, { "name": "isAllowed", "type": "bool", "internalType": "bool" }, { "name": "routerAddress", "type": "address", "internalType": "address" }, { "name": "routerHelper", "type": "address", "internalType": "address" }, { "name": "pathUSDTToToken", "type": "bytes", "internalType": "bytes" }, { "name": "pathTokenToUSDT", "type": "bytes", "internalType": "bytes" }, { "name": "pathTokenWETH", "type": "bytes", "internalType": "bytes" }] }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "tokenData", "inputs": [], "outputs": [{ "name": "tokenPool", "type": "uint8", "internalType": "enum IRainDeployer.TokenPool" }, { "name": "isAllowed", "type": "bool", "internalType": "bool" }, { "name": "routerAddress", "type": "address", "internalType": "address" }, { "name": "routerHelper", "type": "address", "internalType": "address" }, { "name": "pathUSDTToToken", "type": "bytes", "internalType": "bytes" }, { "name": "pathTokenToUSDT", "type": "bytes", "internalType": "bytes" }, { "name": "pathTokenToWETH", "type": "bytes", "internalType": "bytes" }], "stateMutability": "view" }, { "type": "function", "name": "tooEarly", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "totalMarketFunds", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "totalMarketShares", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "totalOptionLPShares", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "totalOrders", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "nonpayable" }, { "type": "function", "name": "tradingModel", "inputs": [], "outputs": [{ "name": "", "type": "uint8", "internalType": "enum Types.TradingModel" }], "stateMutability": "view" }, { "type": "function", "name": "usdt", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "userActiveBuyOrders", "inputs": [{ "name": "user", "type": "address", "internalType": "address" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "userActiveSellOrders", "inputs": [{ "name": "user", "type": "address", "internalType": "address" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "userFeeDebtX128", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "user", "type": "address", "internalType": "address" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "userFundsPerSideInEscrow", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "internalType": "uint8" }, { "name": "user", "type": "address", "internalType": "address" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "userOptionLPShares", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "user", "type": "address", "internalType": "address" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "userOptionPerSideShares", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "internalType": "uint8" }, { "name": "user", "type": "address", "internalType": "address" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "userSharesPerSideInEscrow", "inputs": [{ "name": "option", "type": "uint256", "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "internalType": "uint8" }, { "name": "user", "type": "address", "internalType": "address" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "event", "name": "AddLiquidity", "inputs": [{ "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "baseAmount", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "lpShares", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "wallet", "type": "address", "indexed": true, "internalType": "address" }], "anonymous": false }, { "type": "event", "name": "AppealFeeRefunded", "inputs": [{ "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "appealer", "type": "address", "indexed": true, "internalType": "address" }, { "name": "appealFee", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "appealedWinner", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "CancelBuyOrder", "inputs": [{ "name": "orderOption", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "orderOptionSide", "type": "uint8", "indexed": false, "internalType": "uint8" }, { "name": "orderBaseAmount", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "orderPrice", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "orderID", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "orderCreator", "type": "address", "indexed": true, "internalType": "address" }], "anonymous": false }, { "type": "event", "name": "CancelSellOrder", "inputs": [{ "name": "orderOption", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "orderOptionSide", "type": "uint8", "indexed": false, "internalType": "uint8" }, { "name": "sharesAmount", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "orderPrice", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "orderID", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "orderCreator", "type": "address", "indexed": true, "internalType": "address" }], "anonymous": false }, { "type": "event", "name": "ChooseWinner", "inputs": [{ "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "indexed": false, "internalType": "uint8" }, { "name": "platformShare", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "winningShare", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "ChooseWinnerAppeal", "inputs": [{ "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "indexed": false, "internalType": "uint8" }, { "name": "platformShare", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "winningShare", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "ChooseWinnerDispute", "inputs": [{ "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "indexed": false, "internalType": "uint8" }, { "name": "platformShare", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "winningShare", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "Claim", "inputs": [{ "name": "wallet", "type": "address", "indexed": true, "internalType": "address" }, { "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "winnerSide", "type": "uint8", "indexed": false, "internalType": "uint8" }, { "name": "winningReward", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "ClaimSwapFees", "inputs": [{ "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "amount", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "wallet", "type": "address", "indexed": true, "internalType": "address" }], "anonymous": false }, { "type": "event", "name": "ClosePool", "inputs": [{ "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "side", "type": "uint8", "indexed": false, "internalType": "uint8" }], "anonymous": false }, { "type": "event", "name": "ClosingShareClaim", "inputs": [{ "name": "closer", "type": "address", "indexed": true, "internalType": "address" }, { "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "closingShare", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "CreateOracle", "inputs": [{ "name": "creatorContract", "type": "address", "indexed": true, "internalType": "address" }, { "name": "createdContract", "type": "address", "indexed": true, "internalType": "address" }, { "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "CreatorClaim", "inputs": [{ "name": "wallet", "type": "address", "indexed": true, "internalType": "address" }, { "name": "amount", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "DisputeFeeRefunded", "inputs": [{ "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "disputer", "type": "address", "indexed": true, "internalType": "address" }, { "name": "disputeFee", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "disputedWinner", "type": "uint8", "indexed": false, "internalType": "uint8" }], "anonymous": false }, { "type": "event", "name": "EnterOption", "inputs": [{ "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "indexed": false, "internalType": "uint8" }, { "name": "baseAmount", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "sharesAmount", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "wallet", "type": "address", "indexed": false, "internalType": "address" }], "anonymous": false }, { "type": "event", "name": "ExecuteBuyOrder", "inputs": [{ "name": "orderOption", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "orderOptionSide", "type": "uint8", "indexed": false, "internalType": "uint8" }, { "name": "orderPrice", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "sharesAmount", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "baseAmount", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "orderID", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "maker", "type": "address", "indexed": true, "internalType": "address" }, { "name": "taker", "type": "address", "indexed": true, "internalType": "address" }], "anonymous": false }, { "type": "event", "name": "ExecuteSellOrder", "inputs": [{ "name": "orderOption", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "orderOptionSide", "type": "uint8", "indexed": false, "internalType": "uint8" }, { "name": "orderPrice", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "sharesAmount", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "baseAmount", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "orderID", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "maker", "type": "address", "indexed": true, "internalType": "address" }, { "name": "taker", "type": "address", "indexed": true, "internalType": "address" }], "anonymous": false }, { "type": "event", "name": "Merge", "inputs": [{ "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "amount", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "wallet", "type": "address", "indexed": true, "internalType": "address" }], "anonymous": false }, { "type": "event", "name": "OpenAppeal", "inputs": [{ "name": "caller", "type": "address", "indexed": true, "internalType": "address" }, { "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "currentWinner", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "appealFee", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "OpenDispute", "inputs": [{ "name": "caller", "type": "address", "indexed": true, "internalType": "address" }, { "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "currentWinner", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "disputeFee", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "PlaceBuyOrder", "inputs": [{ "name": "orderOption", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "orderOptionSide", "type": "uint8", "indexed": false, "internalType": "uint8" }, { "name": "orderPrice", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "baseAmount", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "orderID", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "maker", "type": "address", "indexed": true, "internalType": "address" }], "anonymous": false }, { "type": "event", "name": "PlaceSellOrder", "inputs": [{ "name": "orderOption", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "orderOptionSide", "type": "uint8", "indexed": false, "internalType": "uint8" }, { "name": "orderPrice", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "sharesAmount", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "orderID", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "maker", "type": "address", "indexed": true, "internalType": "address" }], "anonymous": false }, { "type": "event", "name": "PlatformClaim", "inputs": [{ "name": "wallet", "type": "address", "indexed": true, "internalType": "address" }, { "name": "amount", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "Price", "inputs": [{ "name": "option", "type": "uint256", "indexed": true, "internalType": "uint256" }, { "name": "yesReserve", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "noReserve", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "optionTotalFunds", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "RainTokenBurned", "inputs": [{ "name": "amountBurned", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "ReferrerClaim", "inputs": [{ "name": "wallet", "type": "address", "indexed": true, "internalType": "address" }, { "name": "amount", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "RemoveLiquidity", "inputs": [{ "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "lpShares", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "baseTokensReturned", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "yesReturned", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "noReturned", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "feesEarned", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "wallet", "type": "address", "indexed": true, "internalType": "address" }], "anonymous": false }, { "type": "event", "name": "ResolutionProposed", "inputs": [{ "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "indexed": false, "internalType": "uint8" }, { "name": "resolutionProposer", "type": "address", "indexed": true, "internalType": "address" }, { "name": "resolverBond", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "proposedWinner", "type": "uint8", "indexed": false, "internalType": "uint8" }], "anonymous": false }, { "type": "event", "name": "ResolutionProposerRefund", "inputs": [{ "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "optionSide", "type": "uint8", "indexed": false, "internalType": "uint8" }, { "name": "resolutionProposer", "type": "address", "indexed": true, "internalType": "address" }, { "name": "resolverBond", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "proposedWinner", "type": "uint8", "indexed": false, "internalType": "uint8" }], "anonymous": false }, { "type": "event", "name": "ResolverClaim", "inputs": [{ "name": "wallet", "type": "address", "indexed": true, "internalType": "address" }, { "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "amount", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "ResolverSet", "inputs": [{ "name": "resolver", "type": "address", "indexed": true, "internalType": "address" }, { "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "Split", "inputs": [{ "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "amount", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "wallet", "type": "address", "indexed": true, "internalType": "address" }], "anonymous": false }, { "type": "event", "name": "TooEarly", "inputs": [{ "name": "option", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "resolutionProposer", "type": "address", "indexed": true, "internalType": "address" }, { "name": "resolverBond", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "proposedWinner", "type": "uint8", "indexed": false, "internalType": "uint8" }], "anonymous": false }, { "type": "error", "name": "AlreadyClaimed", "inputs": [] }, { "type": "error", "name": "AlreadyInitialized", "inputs": [] }, { "type": "error", "name": "AmountTooSmall", "inputs": [] }, { "type": "error", "name": "ArrayLengthMismatch", "inputs": [] }, { "type": "error", "name": "CallerNotOrderPlacer", "inputs": [] }, { "type": "error", "name": "DeadlineExpired", "inputs": [] }, { "type": "error", "name": "DisputeAlreadyOpened", "inputs": [] }, { "type": "error", "name": "DisputeWindowEnded", "inputs": [] }, { "type": "error", "name": "DisputeWindowNotEnded", "inputs": [] }, { "type": "error", "name": "EndPriceTooHigh", "inputs": [] }, { "type": "error", "name": "EndPriceTooLow", "inputs": [] }, { "type": "error", "name": "EndTImeLessThanStartTime", "inputs": [] }, { "type": "error", "name": "IneligibleToClaim", "inputs": [] }, { "type": "error", "name": "InsufficientAmount", "inputs": [] }, { "type": "error", "name": "InsufficientLPShares", "inputs": [] }, { "type": "error", "name": "InsufficientUserShares", "inputs": [] }, { "type": "error", "name": "InvalidAmount", "inputs": [] }, { "type": "error", "name": "InvalidCall", "inputs": [] }, { "type": "error", "name": "InvalidCaller", "inputs": [] }, { "type": "error", "name": "InvalidInitialLiquidity", "inputs": [] }, { "type": "error", "name": "InvalidLiquidityPercentage", "inputs": [] }, { "type": "error", "name": "InvalidOption", "inputs": [] }, { "type": "error", "name": "InvalidOptions", "inputs": [] }, { "type": "error", "name": "InvalidOracleEndTime", "inputs": [] }, { "type": "error", "name": "InvalidOracleFixedFee", "inputs": [] }, { "type": "error", "name": "InvalidPoolState", "inputs": [] }, { "type": "error", "name": "InvalidPrice", "inputs": [] }, { "type": "error", "name": "InvalidSide", "inputs": [] }, { "type": "error", "name": "LPSharesZero", "inputs": [] }, { "type": "error", "name": "LinkedListNotInitalized", "inputs": [] }, { "type": "error", "name": "MaximumOptionsExceeded", "inputs": [] }, { "type": "error", "name": "NoIncreaseNeeded", "inputs": [] }, { "type": "error", "name": "NoOwnerSet", "inputs": [] }, { "type": "error", "name": "NoPlatformSet", "inputs": [] }, { "type": "error", "name": "NoRewardToClaim", "inputs": [] }, { "type": "error", "name": "NoTokenSet", "inputs": [] }, { "type": "error", "name": "NotPoolManager", "inputs": [] }, { "type": "error", "name": "OnlyAuthority", "inputs": [] }, { "type": "error", "name": "OnlyOwner", "inputs": [] }, { "type": "error", "name": "OnlyResolver", "inputs": [] }, { "type": "error", "name": "OracleNotFinalized", "inputs": [] }, { "type": "error", "name": "OrderAlreadyExists", "inputs": [] }, { "type": "error", "name": "OrderBookPhaseNotOpen", "inputs": [] }, { "type": "error", "name": "OrderDoesNotExist", "inputs": [] }, { "type": "error", "name": "PoolClosed", "inputs": [] }, { "type": "error", "name": "PoolNotClosed", "inputs": [] }, { "type": "error", "name": "PoolOpen", "inputs": [] }, { "type": "error", "name": "SaleNotLive", "inputs": [] }, { "type": "error", "name": "SaleStillLive", "inputs": [] }, { "type": "error", "name": "SlippageExceeded", "inputs": [] }, { "type": "error", "name": "StartTimeEnded", "inputs": [] }, { "type": "error", "name": "UserBuyOrderExist", "inputs": [] }, { "type": "error", "name": "UserBuyOrderLimitReached", "inputs": [] }, { "type": "error", "name": "UserSellOrderExist", "inputs": [] }, { "type": "error", "name": "UserSellOrderLimitReached", "inputs": [] }, { "type": "error", "name": "VotingEnded", "inputs": [] }, { "type": "error", "name": "WinnerAlreadyFinalized", "inputs": [] }, { "type": "error", "name": "WinnerNotDecided", "inputs": [] }, { "type": "error", "name": "WinnerOutOfBound", "inputs": [] }];
|
|
@@ -27,4 +27,13 @@ export declare const ENV_CONFIG: {
|
|
|
27
27
|
readonly rain: TokenConfig;
|
|
28
28
|
};
|
|
29
29
|
};
|
|
30
|
+
readonly production: {
|
|
31
|
+
readonly apiUrl: "https://prod2-api.rain.one";
|
|
32
|
+
readonly market_factory_address: `0x${string}`;
|
|
33
|
+
readonly dispute_initial_timer: number;
|
|
34
|
+
readonly tokens: {
|
|
35
|
+
readonly usdt: TokenConfig;
|
|
36
|
+
readonly rain: TokenConfig;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
30
39
|
};
|
|
@@ -12,8 +12,8 @@ export const USDT_SYMBOL_DEV = "USDTm";
|
|
|
12
12
|
export const ENV_CONFIG = {
|
|
13
13
|
development: {
|
|
14
14
|
apiUrl: "https://dev2-api.rain.one",
|
|
15
|
-
market_factory_address: "
|
|
16
|
-
dispute_initial_timer:
|
|
15
|
+
market_factory_address: "0xbbDd9F2436d3F2e88588c6d28630557e8066f02f",
|
|
16
|
+
dispute_initial_timer: 3 * 24 * 60 * 60,
|
|
17
17
|
tokens: {
|
|
18
18
|
usdt: {
|
|
19
19
|
address: "0xCa4f77A38d8552Dd1D5E44e890173921B67725F4",
|
|
@@ -31,8 +31,27 @@ export const ENV_CONFIG = {
|
|
|
31
31
|
},
|
|
32
32
|
stage: {
|
|
33
33
|
apiUrl: "https://stg2-api.rain.one",
|
|
34
|
-
market_factory_address: "
|
|
35
|
-
dispute_initial_timer:
|
|
34
|
+
market_factory_address: "0x16ccF044f8AE910888d96e9cae6ba22AFEDE628d",
|
|
35
|
+
dispute_initial_timer: 3 * 24 * 60 * 60,
|
|
36
|
+
tokens: {
|
|
37
|
+
usdt: {
|
|
38
|
+
address: "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",
|
|
39
|
+
symbol: "USD₮0",
|
|
40
|
+
decimals: 6,
|
|
41
|
+
oracle_fixed_fee_per_option: 1000000n,
|
|
42
|
+
},
|
|
43
|
+
rain: {
|
|
44
|
+
address: "0x25118290e6A5f4139381D072181157035864099d",
|
|
45
|
+
symbol: "RAIN",
|
|
46
|
+
decimals: 18,
|
|
47
|
+
oracle_fixed_fee_per_option: 1000000000000000000n,
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
production: {
|
|
52
|
+
apiUrl: "https://prod2-api.rain.one",
|
|
53
|
+
market_factory_address: "0x38B3Ba1ee001E6785224E31b3031ae96CA06C677",
|
|
54
|
+
dispute_initial_timer: 120 * 60,
|
|
36
55
|
tokens: {
|
|
37
56
|
usdt: {
|
|
38
57
|
address: "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",
|
|
@@ -48,13 +67,4 @@ export const ENV_CONFIG = {
|
|
|
48
67
|
},
|
|
49
68
|
},
|
|
50
69
|
},
|
|
51
|
-
// production: {
|
|
52
|
-
// apiUrl: "https://prod-api.rain.one",
|
|
53
|
-
// market_factory_address: "0xA8640B62D755e42C9ed6A86d0fc65CE09e31F264" as `0x${string}`,
|
|
54
|
-
// dispute_initial_timer: 120 * 60,
|
|
55
|
-
// oracle_fixed_fee_per_option: 1_000_000n, // $1 per option (6 decimals)
|
|
56
|
-
// usdt_symbol: USDT_SYMBOL_PROD,
|
|
57
|
-
// usdt_token: "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9" as `0x${string}`,
|
|
58
|
-
// rain_token: "0x43976a124e6834b541840Ce741243dAD3dd538DA" as `0x${string}`,
|
|
59
|
-
// },
|
|
60
70
|
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { createPublicClient, http } from 'viem';
|
|
2
|
+
import { arbitrum } from 'viem/chains';
|
|
3
|
+
import { MarketsAbi } from '../abi/MarketsAbi.js';
|
|
4
|
+
export async function getOptionClaimed(params) {
|
|
5
|
+
const { marketContractAddress, option, userAddress, rpcUrl } = params;
|
|
6
|
+
const client = createPublicClient({
|
|
7
|
+
chain: arbitrum,
|
|
8
|
+
transport: http(rpcUrl),
|
|
9
|
+
});
|
|
10
|
+
const claimed = await client.readContract({
|
|
11
|
+
address: marketContractAddress,
|
|
12
|
+
abi: MarketsAbi,
|
|
13
|
+
functionName: 'optionClaimed',
|
|
14
|
+
args: [option, userAddress],
|
|
15
|
+
});
|
|
16
|
+
return claimed;
|
|
17
|
+
}
|
|
@@ -23,8 +23,8 @@ export async function buildCreateMarketRawTx(params) {
|
|
|
23
23
|
const normalizeBarValue = normalizeBarValues(barValues);
|
|
24
24
|
const liquidityPercentages = normalizeBarValue.map((v) => BigInt(v));
|
|
25
25
|
const ipfsUrl = await uploadMetaData(params);
|
|
26
|
-
// oracleEndTime
|
|
27
|
-
const oracleEndTime = BigInt(
|
|
26
|
+
// oracleEndTime is a duration (not absolute), default 3 days
|
|
27
|
+
const oracleEndTime = BigInt(disputeTimer);
|
|
28
28
|
const createMarketParams = {
|
|
29
29
|
isPublic,
|
|
30
30
|
resolverIsAI: isPublicPoolResolverAi,
|
|
@@ -37,7 +37,7 @@ export async function buildCreateMarketRawTx(params) {
|
|
|
37
37
|
ipfsUri: ipfsUrl,
|
|
38
38
|
initialLiquidity: inputAmountWei,
|
|
39
39
|
liquidityPercentages,
|
|
40
|
-
|
|
40
|
+
initialYesPrices: params.initialYesPrices ?? liquidityPercentages.map(() => 500000000000000000n),
|
|
41
41
|
baseToken,
|
|
42
42
|
tradingModel: tradingModel ?? 0,
|
|
43
43
|
};
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import { encodeFunctionData } from "viem";
|
|
1
|
+
import { encodeFunctionData, createPublicClient, http } from "viem";
|
|
2
|
+
import { arbitrum } from "viem/chains";
|
|
2
3
|
import { MarketsAbi } from "../abi/MarketsAbi.js";
|
|
3
4
|
import { ENTER_LIQUIDITY } from "../constants/contractmethods.js";
|
|
4
5
|
import { checkMarketTokenAllowance } from "../utils/helpers.js";
|
|
5
6
|
import { buildApproveRawTx } from "./buildApprovalRawTx.js";
|
|
7
|
+
const DEFAULT_SLIPPAGE = 5n; // 5%
|
|
8
|
+
const DEFAULT_DEADLINE_SECONDS = 600n; // 10 minutes
|
|
6
9
|
export async function buildAddLiquidityRawTx(params) {
|
|
7
|
-
const { marketContractAddress, option, totalAmountInWei, walletAddress, rpcUrl } = params;
|
|
10
|
+
const { marketContractAddress, option, totalAmountInWei, minYesToDeposit, minNoToDeposit, slippageTolerance, deadline, walletAddress, rpcUrl } = params;
|
|
8
11
|
if (!marketContractAddress)
|
|
9
12
|
throw new Error("marketContractAddress is required");
|
|
10
13
|
if (option === undefined || option === null)
|
|
@@ -18,12 +21,32 @@ export async function buildAddLiquidityRawTx(params) {
|
|
|
18
21
|
if (allowance < totalAmountInWei) {
|
|
19
22
|
txs.push(buildApproveRawTx({ tokenAddress: baseToken, spender: marketContractAddress, amount: totalAmountInWei }));
|
|
20
23
|
}
|
|
24
|
+
let effectiveMinYes = minYesToDeposit;
|
|
25
|
+
let effectiveMinNo = minNoToDeposit;
|
|
26
|
+
if ((effectiveMinYes === undefined || effectiveMinYes === null) && (effectiveMinNo === undefined || effectiveMinNo === null)) {
|
|
27
|
+
const client = createPublicClient({
|
|
28
|
+
chain: arbitrum,
|
|
29
|
+
transport: http(rpcUrl),
|
|
30
|
+
});
|
|
31
|
+
const [yesReserve, noReserve] = await Promise.all([
|
|
32
|
+
client.readContract({ address: marketContractAddress, abi: MarketsAbi, functionName: "ammYesReserve", args: [option] }),
|
|
33
|
+
client.readContract({ address: marketContractAddress, abi: MarketsAbi, functionName: "ammNoReserve", args: [option] }),
|
|
34
|
+
]);
|
|
35
|
+
const totalReserves = yesReserve + noReserve;
|
|
36
|
+
if (totalReserves > 0n) {
|
|
37
|
+
const expectedYes = totalAmountInWei * yesReserve / totalReserves;
|
|
38
|
+
const expectedNo = totalAmountInWei * noReserve / totalReserves;
|
|
39
|
+
const slippage = slippageTolerance ?? DEFAULT_SLIPPAGE;
|
|
40
|
+
effectiveMinYes = expectedYes * (100n - slippage) / 100n;
|
|
41
|
+
effectiveMinNo = expectedNo * (100n - slippage) / 100n;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
21
44
|
txs.push({
|
|
22
45
|
to: marketContractAddress,
|
|
23
46
|
data: encodeFunctionData({
|
|
24
47
|
abi: MarketsAbi,
|
|
25
48
|
functionName: ENTER_LIQUIDITY,
|
|
26
|
-
args: [option, totalAmountInWei],
|
|
49
|
+
args: [option, totalAmountInWei, effectiveMinYes ?? 0n, effectiveMinNo ?? 0n, deadline ?? DEFAULT_DEADLINE_SECONDS],
|
|
27
50
|
}),
|
|
28
51
|
value: 0n,
|
|
29
52
|
});
|