PredIQt.JS (front-end library)
PredIQt JavaScript/TypeScript Client Library
General purpose library for the PredIQt
Installation
Using yarn:
or using npm:
Quick Start
API initialization
Frontend usage
Server usage
Graph API initialization
API
Utils methods
setAuth
Set authorization to execute transactions
Parameters
resetAuth
Reset authorization to execute transactions
Methods that require authorization
setFee
Set a fee for the platform (admin only)
Parameters
acceptMarket
Accept a proposed market
Parameters
claimShares
Claim shares for a particular market
Parameters
cancelOrder
Cancel an order
Parameters
createMarket
Create a Market
Parameters
deleteMarket
Delete an existing Market
Parameters
marketId
number
limitOrder
Open an order for shares in a market
Parameters
marketInvalid
Set a market as invalid (only resolver)
Parameters
marketResolve
Set the outcome of a market (only resolver)
Parameters
marketResolveOracle
Set the outcome of a market (only resolver)
Parameters
proposeMarket
Propose a market to be part of the active markets
Parameters
rejectMarket
Reject a proposed market (resolver only)
Parameters
setResolver
Change resolver for a market (admin only)
Parameters
withdraw
Withdraw from user balance
Parameters
syncBank
Sync Bank
transferShares
Transfer shares to user
Parameters
cancelShares
Cancel transferred shares
Parameters
buyShares
Buy shares
Parameters
sellShares
Sell shares
Parameters
proposeMultiSig
Propose MultiSignature
Parameters
Methods that don't require authorization
getFees
Get fees related to the contract
Parameters
getShares
Get shares related to a market
Parameters
getReferrals
Get referral shares related to a market
Parameters
getMarkets
Get markets
Parameters
tableKey
string (optional, default""
)limit
number (optional, default100
)offset
number (optional, default0
)
getMarket
Get a single market
Parameters
marketId
number
getOrders
Get orders for a market
Parameters
getBalance
Get balance of an user
Parameters
getIqBalance
Get IQ balance of an user
Parameters
username
string
getUserResources
Get resources of an user
Parameters
username
string
searchInOracles
Search user in table of oracles
Parameters
username
string
getAccount
Get account data of an user
Parameters
username
string
Graph API
getProposedMarkets
Get proposed markets
Parameters
getMarkets
Get markets
Parameters
getMarket
Get market
Parameters
marketId
number
getMarketPage
Get market page
Parameters
getPlatformFees
Get platform fees
getCategoriesAndTags
Get categories and tags
getDappInfo
Get information about dapp
getUserProfile
Get user's profile
Parameters
username
string
getShareHolders
Get shareholders
Parameters
getChainInfo
Get info about node's backlog
Embed market
To embed a market in your page, you just need to add code like:
Last updated