rain-sdk-v2 1.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.
Files changed (102) hide show
  1. package/README.md +1074 -0
  2. package/dist/Rain.d.ts +212 -0
  3. package/dist/Rain.js +401 -0
  4. package/dist/RainAA.d.ts +62 -0
  5. package/dist/RainAA.js +304 -0
  6. package/dist/abi/CreateMarketAbi.d.ts +1125 -0
  7. package/dist/abi/CreateMarketAbi.js +1 -0
  8. package/dist/abi/ERC20Abi.d.ts +89 -0
  9. package/dist/abi/ERC20Abi.js +119 -0
  10. package/dist/abi/MarketsAbi.d.ts +2810 -0
  11. package/dist/abi/MarketsAbi.js +1 -0
  12. package/dist/abi/OracleAbi.d.ts +11 -0
  13. package/dist/abi/OracleAbi.js +15 -0
  14. package/dist/api/comments.d.ts +14 -0
  15. package/dist/api/comments.js +48 -0
  16. package/dist/api/dispute.d.ts +3 -0
  17. package/dist/api/dispute.js +30 -0
  18. package/dist/api/follow.d.ts +6 -0
  19. package/dist/api/follow.js +38 -0
  20. package/dist/api/helpers.d.ts +4 -0
  21. package/dist/api/helpers.js +26 -0
  22. package/dist/api/index.d.ts +14 -0
  23. package/dist/api/index.js +14 -0
  24. package/dist/api/investments.d.ts +21 -0
  25. package/dist/api/investments.js +135 -0
  26. package/dist/api/notifications.d.ts +4 -0
  27. package/dist/api/notifications.js +24 -0
  28. package/dist/api/orders.d.ts +8 -0
  29. package/dist/api/orders.js +40 -0
  30. package/dist/api/points.d.ts +5 -0
  31. package/dist/api/points.js +32 -0
  32. package/dist/api/poolReviews.d.ts +4 -0
  33. package/dist/api/poolReviews.js +23 -0
  34. package/dist/api/pools.d.ts +41 -0
  35. package/dist/api/pools.js +149 -0
  36. package/dist/api/priceData.d.ts +2 -0
  37. package/dist/api/priceData.js +9 -0
  38. package/dist/api/rainBurn.d.ts +3 -0
  39. package/dist/api/rainBurn.js +15 -0
  40. package/dist/api/types.d.ts +292 -0
  41. package/dist/api/types.js +2 -0
  42. package/dist/api/users.d.ts +15 -0
  43. package/dist/api/users.js +60 -0
  44. package/dist/auth/login.d.ts +4 -0
  45. package/dist/auth/login.js +27 -0
  46. package/dist/auth/types.d.ts +16 -0
  47. package/dist/auth/types.js +1 -0
  48. package/dist/config/environments.d.ts +15 -0
  49. package/dist/config/environments.js +41 -0
  50. package/dist/constants/contractmethods.d.ts +15 -0
  51. package/dist/constants/contractmethods.js +15 -0
  52. package/dist/index.d.ts +9 -0
  53. package/dist/index.js +6 -0
  54. package/dist/markets/getDisputeFee.d.ts +5 -0
  55. package/dist/markets/getDisputeFee.js +19 -0
  56. package/dist/markets/getOrderInfo.d.ts +53 -0
  57. package/dist/markets/getOrderInfo.js +80 -0
  58. package/dist/markets/getResolverBondAmount.d.ts +9 -0
  59. package/dist/markets/getResolverBondAmount.js +35 -0
  60. package/dist/markets/getUserOptionLPShares.d.ts +7 -0
  61. package/dist/markets/getUserOptionLPShares.js +17 -0
  62. package/dist/markets/getUserOptionShares.d.ts +8 -0
  63. package/dist/markets/getUserOptionShares.js +17 -0
  64. package/dist/socket/RainSocket.d.ts +175 -0
  65. package/dist/socket/RainSocket.js +186 -0
  66. package/dist/tx/CreateMarket/buildCreateMarketRawTx.d.ts +2 -0
  67. package/dist/tx/CreateMarket/buildCreateMarketRawTx.js +55 -0
  68. package/dist/tx/CreateMarket/createMarketValidation.d.ts +2 -0
  69. package/dist/tx/CreateMarket/createMarketValidation.js +48 -0
  70. package/dist/tx/CreateMarket/helpers.d.ts +3 -0
  71. package/dist/tx/CreateMarket/helpers.js +42 -0
  72. package/dist/tx/buildAddLiquidityRawTx.d.ts +2 -0
  73. package/dist/tx/buildAddLiquidityRawTx.js +23 -0
  74. package/dist/tx/buildApprovalRawTx.d.ts +2 -0
  75. package/dist/tx/buildApprovalRawTx.js +24 -0
  76. package/dist/tx/buildCalculateWinnerRawTx.d.ts +13 -0
  77. package/dist/tx/buildCalculateWinnerRawTx.js +37 -0
  78. package/dist/tx/buildCancelOrdersRawTx.d.ts +3 -0
  79. package/dist/tx/buildCancelOrdersRawTx.js +43 -0
  80. package/dist/tx/buildClaimRawTx.d.ts +2 -0
  81. package/dist/tx/buildClaimRawTx.js +19 -0
  82. package/dist/tx/buildClosePoolRawTx.d.ts +20 -0
  83. package/dist/tx/buildClosePoolRawTx.js +95 -0
  84. package/dist/tx/buildEnterOptionRawTx.d.ts +2 -0
  85. package/dist/tx/buildEnterOptionRawTx.js +25 -0
  86. package/dist/tx/buildMergeRawTx.d.ts +2 -0
  87. package/dist/tx/buildMergeRawTx.js +21 -0
  88. package/dist/tx/buildOpenDisputeRawTx.d.ts +8 -0
  89. package/dist/tx/buildOpenDisputeRawTx.js +39 -0
  90. package/dist/tx/buildPlaceOrderRawTx.d.ts +3 -0
  91. package/dist/tx/buildPlaceOrderRawTx.js +47 -0
  92. package/dist/tx/buildRemoveLiquidityRawTx.d.ts +2 -0
  93. package/dist/tx/buildRemoveLiquidityRawTx.js +23 -0
  94. package/dist/tx/buildSplitRawTx.d.ts +2 -0
  95. package/dist/tx/buildSplitRawTx.js +21 -0
  96. package/dist/tx/types.d.ts +117 -0
  97. package/dist/tx/types.js +10 -0
  98. package/dist/types.d.ts +15 -0
  99. package/dist/types.js +1 -0
  100. package/dist/utils/helpers.d.ts +4 -0
  101. package/dist/utils/helpers.js +28 -0
  102. package/package.json +66 -0
@@ -0,0 +1 @@
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": [] }];
@@ -0,0 +1,11 @@
1
+ export declare const OracleAbi: readonly [{
2
+ readonly inputs: readonly [];
3
+ readonly name: "calculateWinner";
4
+ readonly outputs: readonly [{
5
+ readonly internalType: "uint256";
6
+ readonly name: "";
7
+ readonly type: "uint256";
8
+ }];
9
+ readonly stateMutability: "nonpayable";
10
+ readonly type: "function";
11
+ }];
@@ -0,0 +1,15 @@
1
+ export const OracleAbi = [
2
+ {
3
+ "inputs": [],
4
+ "name": "calculateWinner",
5
+ "outputs": [
6
+ {
7
+ "internalType": "uint256",
8
+ "name": "",
9
+ "type": "uint256"
10
+ }
11
+ ],
12
+ "stateMutability": "nonpayable",
13
+ "type": "function"
14
+ }
15
+ ];
@@ -0,0 +1,14 @@
1
+ import { ApiConfig, ApiResponse, CreateCommentParams, CommentsListingParams, UpdateCommentParams, CommentCountParams } from './types.js';
2
+ export declare function createComment(params: CreateCommentParams, config: ApiConfig): Promise<ApiResponse>;
3
+ export declare function getCommentsListing(params: CommentsListingParams, config: ApiConfig): Promise<ApiResponse>;
4
+ export declare function updateComment(params: UpdateCommentParams, config: ApiConfig): Promise<ApiResponse>;
5
+ export declare function likeComment(params: {
6
+ commentId: string;
7
+ }, config: ApiConfig): Promise<ApiResponse>;
8
+ export declare function unlikeComment(params: {
9
+ commentId: string;
10
+ }, config: ApiConfig): Promise<ApiResponse>;
11
+ export declare function getCommentsCount(params: CommentCountParams, config: ApiConfig): Promise<ApiResponse<{
12
+ poolId: string;
13
+ count: number;
14
+ }>>;
@@ -0,0 +1,48 @@
1
+ import { buildHeaders, buildQuery, handleResponse } from './helpers.js';
2
+ export async function createComment(params, config) {
3
+ const res = await fetch(`${config.apiUrl}/comments/create-comment`, {
4
+ method: 'POST',
5
+ headers: buildHeaders(config, 'application/json'),
6
+ body: JSON.stringify(params),
7
+ });
8
+ return handleResponse(res);
9
+ }
10
+ export async function getCommentsListing(params, config) {
11
+ const qs = buildQuery({ poolId: params.poolId, limit: params.limit, offset: params.offset });
12
+ const res = await fetch(`${config.apiUrl}/comments/comments-listing${qs}`, {
13
+ method: 'GET',
14
+ headers: buildHeaders(config),
15
+ });
16
+ return handleResponse(res);
17
+ }
18
+ export async function updateComment(params, config) {
19
+ const { commentId, comment } = params;
20
+ const res = await fetch(`${config.apiUrl}/comments/update-comment/${encodeURIComponent(commentId)}`, {
21
+ method: 'PUT',
22
+ headers: buildHeaders(config, 'application/json'),
23
+ body: JSON.stringify({ comment }),
24
+ });
25
+ return handleResponse(res);
26
+ }
27
+ export async function likeComment(params, config) {
28
+ const res = await fetch(`${config.apiUrl}/comments/like/${encodeURIComponent(params.commentId)}`, {
29
+ method: 'POST',
30
+ headers: buildHeaders(config),
31
+ });
32
+ return handleResponse(res);
33
+ }
34
+ export async function unlikeComment(params, config) {
35
+ const res = await fetch(`${config.apiUrl}/comments/unlike/${encodeURIComponent(params.commentId)}`, {
36
+ method: 'POST',
37
+ headers: buildHeaders(config),
38
+ });
39
+ return handleResponse(res);
40
+ }
41
+ export async function getCommentsCount(params, config) {
42
+ const qs = buildQuery({ poolId: params.poolId });
43
+ const res = await fetch(`${config.apiUrl}/comments/comments-count${qs}`, {
44
+ method: 'GET',
45
+ headers: buildHeaders(config),
46
+ });
47
+ return handleResponse(res);
48
+ }
@@ -0,0 +1,3 @@
1
+ import { ApiConfig, ApiResponse, CreateDisputeMessageParams, GetPoolDisputeConvoParams } from './types.js';
2
+ export declare function createDisputeMessage(params: CreateDisputeMessageParams, config: ApiConfig): Promise<ApiResponse>;
3
+ export declare function getPoolDisputeConvo(params: GetPoolDisputeConvoParams, config: ApiConfig): Promise<ApiResponse>;
@@ -0,0 +1,30 @@
1
+ import { buildHeaders, buildQuery, handleResponse } from './helpers.js';
2
+ export async function createDisputeMessage(params, config) {
3
+ const formData = new FormData();
4
+ formData.append('pool', params.pool);
5
+ formData.append('role', params.role);
6
+ formData.append('messageType', params.messageType);
7
+ formData.append('evidence', JSON.stringify(params.evidence));
8
+ if (params.file) {
9
+ formData.append('file', params.file);
10
+ }
11
+ const headers = {};
12
+ if (config.accessToken) {
13
+ headers['Authorization'] = `Bearer ${config.accessToken}`;
14
+ }
15
+ // Do not set Content-Type for FormData; the browser sets the boundary automatically.
16
+ const res = await fetch(`${config.apiUrl}/dispute/create-dispute-message`, {
17
+ method: 'POST',
18
+ headers,
19
+ body: formData,
20
+ });
21
+ return handleResponse(res);
22
+ }
23
+ export async function getPoolDisputeConvo(params, config) {
24
+ const qs = buildQuery({ limit: params.limit, offset: params.offset });
25
+ const res = await fetch(`${config.apiUrl}/dispute/get-pool-dispute-convo/${encodeURIComponent(params.poolId)}/${encodeURIComponent(params.subPool)}${qs}`, {
26
+ method: 'GET',
27
+ headers: buildHeaders(config),
28
+ });
29
+ return handleResponse(res);
30
+ }
@@ -0,0 +1,6 @@
1
+ import { ApiConfig, ApiResponse, FollowToggleParams, FollowCheckParams, FollowListParams, FollowStatsParams } from './types.js';
2
+ export declare function toggleFollow(params: FollowToggleParams, config: ApiConfig): Promise<ApiResponse>;
3
+ export declare function checkFollow(params: FollowCheckParams, config: ApiConfig): Promise<ApiResponse>;
4
+ export declare function getFollowers(params: FollowListParams, config: ApiConfig): Promise<ApiResponse>;
5
+ export declare function getFollowing(params: FollowListParams, config: ApiConfig): Promise<ApiResponse>;
6
+ export declare function getFollowStats(params: FollowStatsParams, config: ApiConfig): Promise<ApiResponse>;
@@ -0,0 +1,38 @@
1
+ import { buildHeaders, buildQuery, handleResponse } from './helpers.js';
2
+ export async function toggleFollow(params, config) {
3
+ const res = await fetch(`${config.apiUrl}/follow/toggle/${encodeURIComponent(params.userId)}`, {
4
+ method: 'POST',
5
+ headers: buildHeaders(config),
6
+ });
7
+ return handleResponse(res);
8
+ }
9
+ export async function checkFollow(params, config) {
10
+ const res = await fetch(`${config.apiUrl}/follow/check/${encodeURIComponent(params.userId)}`, {
11
+ method: 'GET',
12
+ headers: buildHeaders(config),
13
+ });
14
+ return handleResponse(res);
15
+ }
16
+ export async function getFollowers(params, config) {
17
+ const qs = buildQuery({ page: params.page, limit: params.limit });
18
+ const res = await fetch(`${config.apiUrl}/follow/followers/${encodeURIComponent(params.userId)}${qs}`, {
19
+ method: 'GET',
20
+ headers: buildHeaders(config),
21
+ });
22
+ return handleResponse(res);
23
+ }
24
+ export async function getFollowing(params, config) {
25
+ const qs = buildQuery({ page: params.page, limit: params.limit });
26
+ const res = await fetch(`${config.apiUrl}/follow/following/${encodeURIComponent(params.userId)}${qs}`, {
27
+ method: 'GET',
28
+ headers: buildHeaders(config),
29
+ });
30
+ return handleResponse(res);
31
+ }
32
+ export async function getFollowStats(params, config) {
33
+ const res = await fetch(`${config.apiUrl}/follow/stats/${encodeURIComponent(params.userId)}`, {
34
+ method: 'GET',
35
+ headers: buildHeaders(config),
36
+ });
37
+ return handleResponse(res);
38
+ }
@@ -0,0 +1,4 @@
1
+ import { ApiConfig } from './types.js';
2
+ export declare function buildHeaders(config: ApiConfig, contentType?: string): Record<string, string>;
3
+ export declare function buildQuery(params: Record<string, string | number | boolean | undefined | null>): string;
4
+ export declare function handleResponse<T>(res: Response): Promise<T>;
@@ -0,0 +1,26 @@
1
+ export function buildHeaders(config, contentType) {
2
+ const headers = {};
3
+ if (config.apiUrl?.includes('ngrok')) {
4
+ headers['ngrok-skip-browser-warning'] = 'true';
5
+ }
6
+ if (contentType) {
7
+ headers['Content-Type'] = contentType;
8
+ }
9
+ if (config.accessToken) {
10
+ headers['Authorization'] = `Bearer ${config.accessToken}`;
11
+ }
12
+ return headers;
13
+ }
14
+ export function buildQuery(params) {
15
+ const entries = Object.entries(params).filter(([, v]) => v !== undefined && v !== null);
16
+ if (entries.length === 0)
17
+ return '';
18
+ return '?' + entries.map(([k, v]) => `${encodeURIComponent(k)}=${encodeURIComponent(String(v))}`).join('&');
19
+ }
20
+ export async function handleResponse(res) {
21
+ if (!res.ok) {
22
+ const text = await res.text().catch(() => res.statusText);
23
+ throw new Error(`API error (${res.status}): ${text}`);
24
+ }
25
+ return res.json();
26
+ }
@@ -0,0 +1,14 @@
1
+ export * from './types.js';
2
+ export * from './helpers.js';
3
+ export * from './users.js';
4
+ export * from './comments.js';
5
+ export * from './pools.js';
6
+ export * from './investments.js';
7
+ export * from './priceData.js';
8
+ export * from './poolReviews.js';
9
+ export * from './orders.js';
10
+ export * from './points.js';
11
+ export * from './notifications.js';
12
+ export * from './rainBurn.js';
13
+ export * from './dispute.js';
14
+ export * from './follow.js';
@@ -0,0 +1,14 @@
1
+ export * from './types.js';
2
+ export * from './helpers.js';
3
+ export * from './users.js';
4
+ export * from './comments.js';
5
+ export * from './pools.js';
6
+ export * from './investments.js';
7
+ export * from './priceData.js';
8
+ export * from './poolReviews.js';
9
+ export * from './orders.js';
10
+ export * from './points.js';
11
+ export * from './notifications.js';
12
+ export * from './rainBurn.js';
13
+ export * from './dispute.js';
14
+ export * from './follow.js';
@@ -0,0 +1,21 @@
1
+ import { ApiConfig, ApiResponse, UserTotalInvestmentParams, OptionsTotalVolumeParams, PoolActivityParams, TopHoldersParams, UserInvestedPoolsParams, InvestmentVolumeGraphParams, UserPnlGraphParams, TopWinnersLosersParams, PnlByPoolIdParams } from './types.js';
2
+ export declare function getUserTotalInvestment(params: UserTotalInvestmentParams, config: ApiConfig): Promise<ApiResponse>;
3
+ export declare function getOptionsTotalVolume(params: OptionsTotalVolumeParams, config: ApiConfig): Promise<ApiResponse>;
4
+ export declare function getPoolActivity(params: PoolActivityParams, config: ApiConfig): Promise<ApiResponse>;
5
+ export declare function getTopHolders(params: TopHoldersParams, config: ApiConfig): Promise<ApiResponse>;
6
+ export declare function getUserInvestedPools(params: UserInvestedPoolsParams, config: ApiConfig): Promise<ApiResponse>;
7
+ export declare function getPlatformTVL(config: ApiConfig): Promise<ApiResponse<{
8
+ tvl: number;
9
+ }>>;
10
+ export declare function getInvestmentVolumeGraph(params: InvestmentVolumeGraphParams, config: ApiConfig): Promise<ApiResponse>;
11
+ export declare function calculateUserPNL(config: ApiConfig): Promise<ApiResponse>;
12
+ export declare function calculateUserTotalVolume(config: ApiConfig): Promise<ApiResponse>;
13
+ export declare function getUserPnlGraph(params: UserPnlGraphParams, config: ApiConfig): Promise<ApiResponse>;
14
+ export declare function getTVLGraph(config: ApiConfig): Promise<ApiResponse>;
15
+ export declare function calculateUserPNLPerPool(config: ApiConfig): Promise<ApiResponse>;
16
+ export declare function getPnlByPoolId(params: PnlByPoolIdParams, config: ApiConfig): Promise<ApiResponse>;
17
+ export declare function getTopWinnersLosers(params: TopWinnersLosersParams, config: ApiConfig): Promise<ApiResponse>;
18
+ export declare function getUserOverallInvestment(config: ApiConfig): Promise<ApiResponse>;
19
+ export declare function getPlatformVolume(config: ApiConfig): Promise<ApiResponse>;
20
+ export declare function getUserInvestedLivePoolsCount(config: ApiConfig): Promise<ApiResponse>;
21
+ export declare function calculateUserOpenInterest(config: ApiConfig): Promise<ApiResponse>;
@@ -0,0 +1,135 @@
1
+ import { buildHeaders, buildQuery, handleResponse } from './helpers.js';
2
+ export async function getUserTotalInvestment(params, config) {
3
+ const qs = buildQuery({ poolId: params.poolId });
4
+ const res = await fetch(`${config.apiUrl}/investments/user-total-investment${qs}`, {
5
+ method: 'GET',
6
+ headers: buildHeaders(config),
7
+ });
8
+ return handleResponse(res);
9
+ }
10
+ export async function getOptionsTotalVolume(params, config) {
11
+ const qs = buildQuery({ poolId: params.poolId });
12
+ const res = await fetch(`${config.apiUrl}/investments/options-total-volume${qs}`, {
13
+ method: 'GET',
14
+ headers: buildHeaders(config),
15
+ });
16
+ return handleResponse(res);
17
+ }
18
+ export async function getPoolActivity(params, config) {
19
+ const qs = buildQuery({ limit: params.limit, offset: params.offset });
20
+ const res = await fetch(`${config.apiUrl}/investments/${encodeURIComponent(params.poolId)}/pool-activity${qs}`, {
21
+ method: 'GET',
22
+ headers: buildHeaders(config),
23
+ });
24
+ return handleResponse(res);
25
+ }
26
+ export async function getTopHolders(params, config) {
27
+ const qs = buildQuery({ subPoolIndex: params.subPoolIndex, limit: params.limit, offset: params.offset });
28
+ const res = await fetch(`${config.apiUrl}/investments/${encodeURIComponent(params.poolId)}/top-holders${qs}`, {
29
+ method: 'GET',
30
+ headers: buildHeaders(config),
31
+ });
32
+ return handleResponse(res);
33
+ }
34
+ export async function getUserInvestedPools(params, config) {
35
+ const qs = buildQuery({ limit: params.limit, offset: params.offset });
36
+ const res = await fetch(`${config.apiUrl}/investments/user-invested-pools${qs}`, {
37
+ method: 'GET',
38
+ headers: buildHeaders(config),
39
+ });
40
+ return handleResponse(res);
41
+ }
42
+ export async function getPlatformTVL(config) {
43
+ const res = await fetch(`${config.apiUrl}/investments/platform-tvl`, {
44
+ method: 'GET',
45
+ headers: buildHeaders(config),
46
+ });
47
+ return handleResponse(res);
48
+ }
49
+ export async function getInvestmentVolumeGraph(params, config) {
50
+ const qs = buildQuery({ timeframe: params.timeframe });
51
+ const res = await fetch(`${config.apiUrl}/investments/investment-volume-graph${qs}`, {
52
+ method: 'GET',
53
+ headers: buildHeaders(config),
54
+ });
55
+ return handleResponse(res);
56
+ }
57
+ export async function calculateUserPNL(config) {
58
+ const res = await fetch(`${config.apiUrl}/investments/calculate-user-PNL`, {
59
+ method: 'GET',
60
+ headers: buildHeaders(config),
61
+ });
62
+ return handleResponse(res);
63
+ }
64
+ export async function calculateUserTotalVolume(config) {
65
+ const res = await fetch(`${config.apiUrl}/investments/calculate-user-total-volume`, {
66
+ method: 'GET',
67
+ headers: buildHeaders(config),
68
+ });
69
+ return handleResponse(res);
70
+ }
71
+ export async function getUserPnlGraph(params, config) {
72
+ const qs = buildQuery({ timeframe: params.timeframe });
73
+ const res = await fetch(`${config.apiUrl}/investments/get-user-pnl-graph${qs}`, {
74
+ method: 'GET',
75
+ headers: buildHeaders(config),
76
+ });
77
+ return handleResponse(res);
78
+ }
79
+ export async function getTVLGraph(config) {
80
+ const res = await fetch(`${config.apiUrl}/investments/TVL-graph`, {
81
+ method: 'GET',
82
+ headers: buildHeaders(config),
83
+ });
84
+ return handleResponse(res);
85
+ }
86
+ export async function calculateUserPNLPerPool(config) {
87
+ const res = await fetch(`${config.apiUrl}/investments/calculate-user-PNL-per-pool`, {
88
+ method: 'GET',
89
+ headers: buildHeaders(config),
90
+ });
91
+ return handleResponse(res);
92
+ }
93
+ export async function getPnlByPoolId(params, config) {
94
+ const res = await fetch(`${config.apiUrl}/investments/pnl/${encodeURIComponent(params.poolId)}`, {
95
+ method: 'GET',
96
+ headers: buildHeaders(config),
97
+ });
98
+ return handleResponse(res);
99
+ }
100
+ export async function getTopWinnersLosers(params, config) {
101
+ const qs = buildQuery({ timeFilter: params.timeFilter });
102
+ const res = await fetch(`${config.apiUrl}/investments/top-winners-losers${qs}`, {
103
+ method: 'GET',
104
+ headers: buildHeaders(config),
105
+ });
106
+ return handleResponse(res);
107
+ }
108
+ export async function getUserOverallInvestment(config) {
109
+ const res = await fetch(`${config.apiUrl}/investments/user-over-all-investment`, {
110
+ method: 'GET',
111
+ headers: buildHeaders(config),
112
+ });
113
+ return handleResponse(res);
114
+ }
115
+ export async function getPlatformVolume(config) {
116
+ const res = await fetch(`${config.apiUrl}/investments/platform-volume`, {
117
+ method: 'GET',
118
+ headers: buildHeaders(config),
119
+ });
120
+ return handleResponse(res);
121
+ }
122
+ export async function getUserInvestedLivePoolsCount(config) {
123
+ const res = await fetch(`${config.apiUrl}/investments/user-invested-live-pools-count`, {
124
+ method: 'GET',
125
+ headers: buildHeaders(config),
126
+ });
127
+ return handleResponse(res);
128
+ }
129
+ export async function calculateUserOpenInterest(config) {
130
+ const res = await fetch(`${config.apiUrl}/investments/calculate-user-open-interest`, {
131
+ method: 'GET',
132
+ headers: buildHeaders(config),
133
+ });
134
+ return handleResponse(res);
135
+ }
@@ -0,0 +1,4 @@
1
+ import { ApiConfig, ApiResponse, GetNotificationsParams, MarkNotificationAsReadParams } from './types.js';
2
+ export declare function getNotifications(params: GetNotificationsParams, config: ApiConfig): Promise<ApiResponse>;
3
+ export declare function markAllNotificationsAsRead(config: ApiConfig): Promise<ApiResponse>;
4
+ export declare function markNotificationAsRead(params: MarkNotificationAsReadParams, config: ApiConfig): Promise<ApiResponse>;
@@ -0,0 +1,24 @@
1
+ import { buildHeaders, buildQuery, handleResponse } from './helpers.js';
2
+ export async function getNotifications(params, config) {
3
+ const qs = buildQuery({ page: params.page, limit: params.limit, status: params.status });
4
+ const res = await fetch(`${config.apiUrl}/notifications/get-notifications${qs}`, {
5
+ method: 'GET',
6
+ headers: buildHeaders(config),
7
+ });
8
+ return handleResponse(res);
9
+ }
10
+ export async function markAllNotificationsAsRead(config) {
11
+ const res = await fetch(`${config.apiUrl}/notifications/mark-all-as-read`, {
12
+ method: 'POST',
13
+ headers: buildHeaders(config),
14
+ });
15
+ return handleResponse(res);
16
+ }
17
+ export async function markNotificationAsRead(params, config) {
18
+ const res = await fetch(`${config.apiUrl}/notifications/mark-notification-as-read`, {
19
+ method: 'POST',
20
+ headers: buildHeaders(config, 'application/json'),
21
+ body: JSON.stringify({ id: params.id }),
22
+ });
23
+ return handleResponse(res);
24
+ }