UNPKG

@metaspacecy/information-sdk

Version:
143 lines (133 loc) 7.91 kB
import { HexString, Types } from 'aptos'; interface IChainID { value: 1 | 2 | 41; } declare const getPredictEventByEventID: (creator: HexString, description: string, options: string[], chainId: IChainID["value"], coinType?: string) => Promise<any>; declare const getSurveyEventByEventID: (creator: HexString, description: string, options: string[], chainId: IChainID["value"], coinType?: string) => Promise<any>; declare const getSurveyNFTEventByEventID: (creator: HexString, description: string, options: string[], chainId: IChainID["value"]) => Promise<any>; declare const getTokenBalance: (owner: HexString, itemName: string, chainId: IChainID["value"]) => Promise<string>; declare const getTokenForAccount: (owner: string, itemName: string, chainId?: IChainID['value']) => Promise<string>; declare const getMemberOperatorRole: (chainId: IChainID["value"]) => Promise<any>; declare const getServiceFee: (chainId: IChainID["value"]) => Promise<number>; declare const getOptionPrice: (creator: HexString, description: string, options: string[], chainId: IChainID["value"], token_name: string) => Promise<string | 1>; declare const getResource_getPredictEventByEventID: typeof getPredictEventByEventID; declare const getResource_getSurveyEventByEventID: typeof getSurveyEventByEventID; declare const getResource_getSurveyNFTEventByEventID: typeof getSurveyNFTEventByEventID; declare const getResource_getTokenBalance: typeof getTokenBalance; declare const getResource_getTokenForAccount: typeof getTokenForAccount; declare const getResource_getMemberOperatorRole: typeof getMemberOperatorRole; declare const getResource_getServiceFee: typeof getServiceFee; declare const getResource_getOptionPrice: typeof getOptionPrice; declare namespace getResource { export { getResource_getPredictEventByEventID as getPredictEventByEventID, getResource_getSurveyEventByEventID as getSurveyEventByEventID, getResource_getSurveyNFTEventByEventID as getSurveyNFTEventByEventID, getResource_getTokenBalance as getTokenBalance, getResource_getTokenForAccount as getTokenForAccount, getResource_getMemberOperatorRole as getMemberOperatorRole, getResource_getServiceFee as getServiceFee, getResource_getOptionPrice as getOptionPrice, }; } declare const getEventByCreator: (creator: HexString, chainID: IChainID["value"]) => Promise<any[]>; declare const getJoinedEvent: (predictor: HexString, chainID: IChainID["value"]) => Promise<any[]>; declare const services_getEventByCreator: typeof getEventByCreator; declare const services_getJoinedEvent: typeof getJoinedEvent; declare namespace services { export { services_getEventByCreator as getEventByCreator, services_getJoinedEvent as getJoinedEvent, }; } declare const MODULE_ADDRESS: { 1: string; 2: string; 41: string; }; declare const RESOURCE_ADDRESS: { 1: string; 2: string; 41: string; }; declare const APTOS_NODE_URL: { 1: string; 2: string; 41: string; }; declare const COLLECTION: { 1: string; 2: string; 41: string; }; declare const GraphQLEndpoint: { 1: string; 2: string; 41: string; }; declare const ACCESS_CONTROL_MODULE = "access_control"; declare const SECONDARY_ACCESS_CONTROL_MODULE = "secondary_access_control"; declare const INFORMATION_MODULE = "information_factory"; declare const INFORMATION_DATA_MODULE = "information_data_factory"; declare const PREDICT_MODULE = "prediction"; declare const SURVEY_MODULE = "survey"; declare const SURVEY_NFT_MODULE = "survey_nft"; declare const DEFAULT_COIN_TYPE = "0x1::aptos_coin::AptosCoin"; declare const CONITIONAL_TOKEN = "conditional_token"; declare const constants_MODULE_ADDRESS: typeof MODULE_ADDRESS; declare const constants_RESOURCE_ADDRESS: typeof RESOURCE_ADDRESS; declare const constants_APTOS_NODE_URL: typeof APTOS_NODE_URL; declare const constants_COLLECTION: typeof COLLECTION; declare const constants_GraphQLEndpoint: typeof GraphQLEndpoint; declare const constants_ACCESS_CONTROL_MODULE: typeof ACCESS_CONTROL_MODULE; declare const constants_SECONDARY_ACCESS_CONTROL_MODULE: typeof SECONDARY_ACCESS_CONTROL_MODULE; declare const constants_INFORMATION_MODULE: typeof INFORMATION_MODULE; declare const constants_INFORMATION_DATA_MODULE: typeof INFORMATION_DATA_MODULE; declare const constants_PREDICT_MODULE: typeof PREDICT_MODULE; declare const constants_SURVEY_MODULE: typeof SURVEY_MODULE; declare const constants_SURVEY_NFT_MODULE: typeof SURVEY_NFT_MODULE; declare const constants_DEFAULT_COIN_TYPE: typeof DEFAULT_COIN_TYPE; declare const constants_CONITIONAL_TOKEN: typeof CONITIONAL_TOKEN; declare namespace constants { export { constants_MODULE_ADDRESS as MODULE_ADDRESS, constants_RESOURCE_ADDRESS as RESOURCE_ADDRESS, constants_APTOS_NODE_URL as APTOS_NODE_URL, constants_COLLECTION as COLLECTION, constants_GraphQLEndpoint as GraphQLEndpoint, constants_ACCESS_CONTROL_MODULE as ACCESS_CONTROL_MODULE, constants_SECONDARY_ACCESS_CONTROL_MODULE as SECONDARY_ACCESS_CONTROL_MODULE, constants_INFORMATION_MODULE as INFORMATION_MODULE, constants_INFORMATION_DATA_MODULE as INFORMATION_DATA_MODULE, constants_PREDICT_MODULE as PREDICT_MODULE, constants_SURVEY_MODULE as SURVEY_MODULE, constants_SURVEY_NFT_MODULE as SURVEY_NFT_MODULE, constants_DEFAULT_COIN_TYPE as DEFAULT_COIN_TYPE, constants_CONITIONAL_TOKEN as CONITIONAL_TOKEN, }; } declare class InformationSDK { private chainID; private privateKey?; private responseField?; private signAndSubmitTransactionCallback?; constructor(chainID: IChainID["value"], callBack?: ((transaction: Types.TransactionPayload, options?: any) => Promise<any>) | string, responseField?: string[]); signAndSubmitTransaction: (transaction: any, options?: any) => Promise<any>; getOperatorRole(): Promise<any>; createPredictEvent(description: string, uri: string, options: string[], start_time: number, end_time: number, payout_time: number, type_arguments: string): Promise<any>; createSuyveyEvent(description: string, uri: string, reward: number, options: string[], start_time: number, end_time: number, payout_time: number, type_arguments: string): Promise<any>; createSuyveyNFTEvent(description: string, collection: string, uri: string, options: string[], start_time: number, end_time: number, payout_time: number): Promise<any>; predictEvent(option: string, amount: number, event_creator: HexString, event_description: String, event_options: string[], type_arguments: string): Promise<any>; surveyEvent(option: string, event_creator: HexString, event_description: String, event_options: string[], type_arguments: string): Promise<any>; surveyNFTEvent(option: string, amount: number, event_creator: HexString, event_description: String, event_options: string[], token_creator: HexString, collection: string, token_name: string, token_version: number): Promise<any>; finalizePredictEvent(description: string, options: string[], outcomes: number[], type_arguments: string): Promise<any>; finalizeSurveyEvent(description: string, options: string[], outcomes: number[], type_arguments: string): Promise<any>; finalizeSurveyNFTEvent(description: string, options: string[], outcomes: number[]): Promise<any>; redeemPredictEvent(name: string, amount: number, type_arguments: string): Promise<any>; redeemSurveyEvent(name: string, type_arguments: string): Promise<any>; redeemSurveyNFTEvent(name: string, amount: number): Promise<any>; cancelPredictEvent(description: string, options: string[], type_arguments: string): Promise<any>; cancelSurveyEvent(description: string, options: string[], type_arguments: string): Promise<any>; cancelSurveyNFTEvent(description: string, options: string[]): Promise<any>; } export { constants as Constants, InformationSDK as default, getResource, services };