UNPKG

kohin-js

Version:

The Kohin JS is a comprehensive developer toolkit designed to integrate Kohin's decentralized insurance system seamlessly into your applications. It enables efficient interaction with Kohin smart contracts and backend APIs, facilitating management and ana

1,658 lines (1,657 loc) 40.6 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.policyManagerAbi = void 0; exports.policyManagerAbi = [ { inputs: [], name: "BetAlreadyPaid", type: "error", }, { inputs: [], name: "BetConditionAlreadyResolvedAsWon", type: "error", }, { inputs: [], name: "ComboBetAlreadyClaimed", type: "error", }, { inputs: [], name: "ComboBetHasNoSubBets", type: "error", }, { inputs: [ { internalType: "uint8", name: "currentState", type: "uint8", }, ], name: "ConditionStateViolation", type: "error", }, { inputs: [], name: "CoverDoesNotExist", type: "error", }, { inputs: [], name: "ERC721EnumerableForbiddenBatchMint", type: "error", }, { inputs: [ { internalType: "address", name: "sender", type: "address", }, { internalType: "uint256", name: "tokenId", type: "uint256", }, { internalType: "address", name: "owner", type: "address", }, ], name: "ERC721IncorrectOwner", type: "error", }, { inputs: [ { internalType: "address", name: "operator", type: "address", }, { internalType: "uint256", name: "tokenId", type: "uint256", }, ], name: "ERC721InsufficientApproval", type: "error", }, { inputs: [ { internalType: "address", name: "approver", type: "address", }, ], name: "ERC721InvalidApprover", type: "error", }, { inputs: [ { internalType: "address", name: "operator", type: "address", }, ], name: "ERC721InvalidOperator", type: "error", }, { inputs: [ { internalType: "address", name: "owner", type: "address", }, ], name: "ERC721InvalidOwner", type: "error", }, { inputs: [ { internalType: "address", name: "receiver", type: "address", }, ], name: "ERC721InvalidReceiver", type: "error", }, { inputs: [ { internalType: "address", name: "sender", type: "address", }, ], name: "ERC721InvalidSender", type: "error", }, { inputs: [ { internalType: "uint256", name: "tokenId", type: "uint256", }, ], name: "ERC721NonexistentToken", type: "error", }, { inputs: [ { internalType: "address", name: "owner", type: "address", }, { internalType: "uint256", name: "index", type: "uint256", }, ], name: "ERC721OutOfBoundsIndex", type: "error", }, { inputs: [], name: "EnforcedPause", type: "error", }, { inputs: [], name: "ExpectedPause", type: "error", }, { inputs: [], name: "GameCanceled", type: "error", }, { inputs: [], name: "InvalidAccessControlConnector", type: "error", }, { inputs: [], name: "InvalidComboPremiumCalculator", type: "error", }, { inputs: [], name: "InvalidConditionId", type: "error", }, { inputs: [], name: "InvalidCoverageAmount", type: "error", }, { inputs: [], name: "InvalidInitialization", type: "error", }, { inputs: [], name: "InvalidInsurancePoolConnector", type: "error", }, { inputs: [], name: "InvalidInsuredAddress", type: "error", }, { inputs: [], name: "InvalidPredictionMarketConnector", type: "error", }, { inputs: [], name: "InvalidPremiumAmount", type: "error", }, { inputs: [], name: "InvalidSettlementEngineConnector", type: "error", }, { inputs: [], name: "InvalidSinglePremiumCalculator", type: "error", }, { inputs: [], name: "NotInitializing", type: "error", }, { inputs: [], name: "OnlyInsurancePool", type: "error", }, { inputs: [], name: "PolicyStateAlreadySet", type: "error", }, { inputs: [], name: "ReentrancyGuardReentrantCall", type: "error", }, { inputs: [ { internalType: "enum SafeCast.Type", name: "to", type: "uint8", }, ], name: "SafeCastError", type: "error", }, { inputs: [], name: "SubBetOutcomeAlreadyResolved", type: "error", }, { inputs: [], name: "UnsupportedBetType", type: "error", }, { anonymous: false, inputs: [ { indexed: true, internalType: "address", name: "newAccessControl", type: "address", }, ], name: "AccessControlUpdated", type: "event", }, { anonymous: false, inputs: [ { indexed: true, internalType: "address", name: "owner", type: "address", }, { indexed: true, internalType: "address", name: "approved", type: "address", }, { indexed: true, internalType: "uint256", name: "tokenId", type: "uint256", }, ], name: "Approval", type: "event", }, { anonymous: false, inputs: [ { indexed: true, internalType: "address", name: "owner", type: "address", }, { indexed: true, internalType: "address", name: "operator", type: "address", }, { indexed: false, internalType: "bool", name: "approved", type: "bool", }, ], name: "ApprovalForAll", type: "event", }, { anonymous: false, inputs: [ { indexed: false, internalType: "string", name: "newBaseURI", type: "string", }, ], name: "BaseURIUpdated", type: "event", }, { anonymous: false, inputs: [ { indexed: true, internalType: "uint256", name: "coverId", type: "uint256", }, { indexed: true, internalType: "address", name: "insured", type: "address", }, { indexed: true, internalType: "uint256", name: "betId", type: "uint256", }, { indexed: false, internalType: "uint128", name: "premium", type: "uint128", }, { indexed: false, internalType: "uint128", name: "coverageAmount", type: "uint128", }, { indexed: false, internalType: "uint128", name: "odds", type: "uint128", }, { indexed: false, internalType: "enum IPolicyManager.BetType", name: "betType", type: "uint8", }, { indexed: false, internalType: "uint48", name: "depositId", type: "uint48", }, ], name: "CoverPurchased", type: "event", }, { anonymous: false, inputs: [ { indexed: true, internalType: "uint256", name: "coverId", type: "uint256", }, { indexed: false, internalType: "enum IPolicyManager.CoverState", name: "oldState", type: "uint8", }, { indexed: false, internalType: "enum IPolicyManager.CoverState", name: "newState", type: "uint8", }, { indexed: false, internalType: "uint128", name: "settlementAmount", type: "uint128", }, ], name: "CoverStateUpdated", type: "event", }, { anonymous: false, inputs: [ { indexed: true, internalType: "uint256", name: "coverId", type: "uint256", }, { indexed: false, internalType: "enum IPolicyManager.CoverState", name: "oldState", type: "uint8", }, { indexed: false, internalType: "enum IPolicyManager.CoverState", name: "newState", type: "uint8", }, ], name: "CoverStateUpdatedAndBurned", type: "event", }, { anonymous: false, inputs: [ { indexed: false, internalType: "uint64", name: "version", type: "uint64", }, ], name: "Initialized", type: "event", }, { anonymous: false, inputs: [ { indexed: true, internalType: "address", name: "previousOwner", type: "address", }, { indexed: true, internalType: "address", name: "newOwner", type: "address", }, ], name: "OwnershipTransferred", type: "event", }, { anonymous: false, inputs: [ { indexed: false, internalType: "address", name: "account", type: "address", }, ], name: "Paused", type: "event", }, { anonymous: false, inputs: [ { indexed: false, internalType: "address", name: "newPredictionMarket", type: "address", }, { indexed: false, internalType: "address", name: "newSettlementEngine", type: "address", }, { indexed: false, internalType: "address", name: "newInsurancePool", type: "address", }, ], name: "PolicyManagerConfigUpdated", type: "event", }, { anonymous: false, inputs: [ { indexed: false, internalType: "address", name: "newComboPremiumCalculator", type: "address", }, { indexed: false, internalType: "address", name: "newSinglePremiumCalculator", type: "address", }, ], name: "PremiumCalculatorUpdated", type: "event", }, { anonymous: false, inputs: [ { indexed: true, internalType: "address", name: "from", type: "address", }, { indexed: true, internalType: "address", name: "to", type: "address", }, { indexed: true, internalType: "uint256", name: "tokenId", type: "uint256", }, ], name: "Transfer", type: "event", }, { anonymous: false, inputs: [ { indexed: false, internalType: "address", name: "account", type: "address", }, ], name: "Unpaused", type: "event", }, { inputs: [], name: "accessControl", outputs: [ { internalType: "contract IAccessControl", name: "", type: "address", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "address", name: "to", type: "address", }, { internalType: "uint256", name: "tokenId", type: "uint256", }, ], name: "approve", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "address", name: "owner", type: "address", }, ], name: "balanceOf", outputs: [ { internalType: "uint256", name: "", type: "uint256", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "", type: "uint256", }, ], name: "betInsured", outputs: [ { internalType: "bool", name: "", type: "bool", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "betId", type: "uint256", }, { internalType: "enum IPolicyManager.BetType", name: "betType", type: "uint8", }, ], name: "calculatePremium", outputs: [ { internalType: "uint128", name: "calculatedPremium", type: "uint128", }, { internalType: "uint128", name: "amount", type: "uint128", }, { internalType: "uint128", name: "odds", type: "uint128", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "address", name: "account", type: "address", }, ], name: "checkOwner", outputs: [], stateMutability: "view", type: "function", }, { inputs: [ { components: [ { internalType: "uint256", name: "coverId", type: "uint256", }, { internalType: "address", name: "insured", type: "address", }, { internalType: "uint256", name: "betId", type: "uint256", }, { internalType: "enum IPolicyManager.BetType", name: "betType", type: "uint8", }, { internalType: "uint128", name: "premium", type: "uint128", }, { internalType: "uint128", name: "coverageAmount", type: "uint128", }, { internalType: "uint128", name: "odds", type: "uint128", }, { internalType: "enum IPolicyManager.CoverState", name: "state", type: "uint8", }, { internalType: "uint48", name: "depositId", type: "uint48", }, { internalType: "uint128", name: "settlementAmount", type: "uint128", }, ], internalType: "struct IPolicyManager.Cover", name: "cover", type: "tuple", }, ], name: "claimCover", outputs: [ { internalType: "uint128", name: "amount", type: "uint128", }, { internalType: "enum IPolicyManager.CoverState", name: "coverState", type: "uint8", }, ], stateMutability: "view", type: "function", }, { inputs: [], name: "comboPremiumCalculator", outputs: [ { internalType: "contract IComboPremiumCalculator", name: "", type: "address", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "", type: "uint256", }, ], name: "covers", outputs: [ { internalType: "uint256", name: "coverId", type: "uint256", }, { internalType: "address", name: "insured", type: "address", }, { internalType: "uint256", name: "betId", type: "uint256", }, { internalType: "enum IPolicyManager.BetType", name: "betType", type: "uint8", }, { internalType: "uint128", name: "premium", type: "uint128", }, { internalType: "uint128", name: "coverageAmount", type: "uint128", }, { internalType: "uint128", name: "odds", type: "uint128", }, { internalType: "enum IPolicyManager.CoverState", name: "state", type: "uint8", }, { internalType: "uint48", name: "depositId", type: "uint48", }, { internalType: "uint128", name: "settlementAmount", type: "uint128", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "tokenId", type: "uint256", }, ], name: "getApproved", outputs: [ { internalType: "address", name: "", type: "address", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "coverId", type: "uint256", }, ], name: "getCover", outputs: [ { components: [ { internalType: "uint256", name: "coverId", type: "uint256", }, { internalType: "address", name: "insured", type: "address", }, { internalType: "uint256", name: "betId", type: "uint256", }, { internalType: "enum IPolicyManager.BetType", name: "betType", type: "uint8", }, { internalType: "uint128", name: "premium", type: "uint128", }, { internalType: "uint128", name: "coverageAmount", type: "uint128", }, { internalType: "uint128", name: "odds", type: "uint128", }, { internalType: "enum IPolicyManager.CoverState", name: "state", type: "uint8", }, { internalType: "uint48", name: "depositId", type: "uint48", }, { internalType: "uint128", name: "settlementAmount", type: "uint128", }, ], internalType: "struct IPolicyManager.Cover", name: "", type: "tuple", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "betId", type: "uint256", }, { internalType: "enum IPolicyManager.BetType", name: "betType", type: "uint8", }, ], name: "getOwnerOfAzuroBets", outputs: [ { internalType: "address", name: "owner", type: "address", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "coverId", type: "uint256", }, ], name: "getOwnerOfCover", outputs: [ { internalType: "address", name: "owner", type: "address", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "address", name: "_predictionMarketConnector", type: "address", }, { internalType: "address", name: "_settlementEngineConnector", type: "address", }, { internalType: "address", name: "_accessControl", type: "address", }, { internalType: "address", name: "_comboPremiumCalculator", type: "address", }, ], name: "initialize", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [], name: "insurancePool", outputs: [ { internalType: "address", name: "", type: "address", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "address", name: "owner", type: "address", }, { internalType: "address", name: "operator", type: "address", }, ], name: "isApprovedForAll", outputs: [ { internalType: "bool", name: "", type: "bool", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "betId", type: "uint256", }, { internalType: "enum IPolicyManager.BetType", name: "betType", type: "uint8", }, ], name: "isBetInsured", outputs: [ { internalType: "bool", name: "", type: "bool", }, ], stateMutability: "view", type: "function", }, { inputs: [], name: "name", outputs: [ { internalType: "string", name: "", type: "string", }, ], stateMutability: "view", type: "function", }, { inputs: [], name: "nextCoverId", outputs: [ { internalType: "uint256", name: "", type: "uint256", }, ], stateMutability: "view", type: "function", }, { inputs: [], name: "owner", outputs: [ { internalType: "address", name: "", type: "address", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "tokenId", type: "uint256", }, ], name: "ownerOf", outputs: [ { internalType: "address", name: "", type: "address", }, ], stateMutability: "view", type: "function", }, { inputs: [], name: "pause", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [], name: "paused", outputs: [ { internalType: "bool", name: "", type: "bool", }, ], stateMutability: "view", type: "function", }, { inputs: [], name: "predictionMarketConnector", outputs: [ { internalType: "contract IPredictionMarketConnector", name: "", type: "address", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "betId", type: "uint256", }, { internalType: "enum IPolicyManager.BetType", name: "betType", type: "uint8", }, { internalType: "uint128", name: "calculatedPremium", type: "uint128", }, { internalType: "uint128", name: "amount", type: "uint128", }, { internalType: "uint128", name: "odds", type: "uint128", }, { internalType: "uint48", name: "lastDepositId", type: "uint48", }, { internalType: "address", name: "insured", type: "address", }, ], name: "purchaseCover", outputs: [ { internalType: "uint256", name: "tokenId", type: "uint256", }, ], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "address", name: "from", type: "address", }, { internalType: "address", name: "to", type: "address", }, { internalType: "uint256", name: "tokenId", type: "uint256", }, ], name: "safeTransferFrom", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "address", name: "from", type: "address", }, { internalType: "address", name: "to", type: "address", }, { internalType: "uint256", name: "tokenId", type: "uint256", }, { internalType: "bytes", name: "data", type: "bytes", }, ], name: "safeTransferFrom", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "address", name: "newAccessControl", type: "address", }, ], name: "setAccessControl", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "address", name: "operator", type: "address", }, { internalType: "bool", name: "approved", type: "bool", }, ], name: "setApprovalForAll", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "address", name: "newComboPremiumCalculator", type: "address", }, { internalType: "address", name: "newSinglePremiumCalculator", type: "address", }, ], name: "setPremiumCalculator", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [], name: "settlementEngine", outputs: [ { internalType: "contract ISettlementEngine", name: "", type: "address", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "", type: "uint256", }, ], name: "singleBetInsured", outputs: [ { internalType: "bool", name: "", type: "bool", }, ], stateMutability: "view", type: "function", }, { inputs: [], name: "singlePremiumCalculator", outputs: [ { internalType: "contract ISinglePremiumCalculator", name: "", type: "address", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "bytes4", name: "interfaceId", type: "bytes4", }, ], name: "supportsInterface", outputs: [ { internalType: "bool", name: "", type: "bool", }, ], stateMutability: "view", type: "function", }, { inputs: [], name: "symbol", outputs: [ { internalType: "string", name: "", type: "string", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "index", type: "uint256", }, ], name: "tokenByIndex", outputs: [ { internalType: "uint256", name: "", type: "uint256", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "address", name: "owner", type: "address", }, { internalType: "uint256", name: "index", type: "uint256", }, ], name: "tokenOfOwnerByIndex", outputs: [ { internalType: "uint256", name: "", type: "uint256", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "tokenId", type: "uint256", }, ], name: "tokenURI", outputs: [ { internalType: "string", name: "", type: "string", }, ], stateMutability: "view", type: "function", }, { inputs: [], name: "totalSupply", outputs: [ { internalType: "uint256", name: "", type: "uint256", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "address", name: "from", type: "address", }, { internalType: "address", name: "to", type: "address", }, { internalType: "uint256", name: "tokenId", type: "uint256", }, ], name: "transferFrom", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "address", name: "newOwner", type: "address", }, ], name: "transferOwnership", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [], name: "unpause", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "uint256", name: "coverId", type: "uint256", }, { internalType: "enum IPolicyManager.CoverState", name: "newState", type: "uint8", }, { internalType: "uint128", name: "settlementAmount", type: "uint128", }, ], name: "updateCoverState", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "uint256", name: "coverId", type: "uint256", }, { internalType: "enum IPolicyManager.CoverState", name: "newState", type: "uint8", }, ], name: "updateCoverStateAndBurn", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "address", name: "newPredictionMarket", type: "address", }, { internalType: "address", name: "newSettlementEngine", type: "address", }, { internalType: "address", name: "newInsurancePool", type: "address", }, ], name: "updatePolicyManagerConfig", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "address", name: "", type: "address", }, { internalType: "uint256", name: "", type: "uint256", }, ], name: "userCovers", outputs: [ { internalType: "uint256", name: "", type: "uint256", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "betId", type: "uint256", }, ], name: "isBetInsured", outputs: [ { internalType: "bool", name: "", type: "bool", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "betId", type: "uint256", }, { internalType: "enum IPolicyManager.BetType", name: "betType", type: "uint8", }, { internalType: "uint128", name: "uPremiumAmount", type: "uint128", }, { internalType: "uint256", name: "slippagePercent", type: "uint256", }, ], name: "buyCover", outputs: [ { internalType: "uint256", name: "tokenId", type: "uint256", }, ], stateMutability: "nonpayable", type: "function", }, ];