Whisker17 / sdk-demo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Zeitgeist SDK Documentation

sdk version

Get Markets Datas

Function Name Description
getAllMarketIds get all market IDs in the Zeitgeiest.
getAllMarkets get all market in the Zeitgeiest.
getMarketCount get market counts in the Zeitgeiest.
fetchMarketData fetch specify market's infomation by id in the Zeitgeiest.
queryMarket query market by GraphQL in the Zeitgeiest.
queryMarketsCount query counts of markets for specified filter options by GraphQL in the Zeitgeiest.
filterMarkets get all market in the Zeitgeiest.
filterMarketData Populate only selected attributes from the market data defined using filter.
indexTransferRecipients query subsquid indexer for market data with pagination in the Zeitgeiest.
getMarketDataForPoolsList get market datas by using pool's data
getEndTimestamp get timestamp at the end of the market period.
fetchDisputes get all market IDs in the Zeitgeiest.
getDisputes fetch disputes for this market using unique identifier marketId.

Get Pools&&Assets Datas

Function Name Description
getPoolId get pool id to be used for fetching data using sdk.models.market.getPool().
getPool recreate swap pool for this market using data fetched with poolId.
fetchPoolData get specify pool infomation in the Zeitgeiest.
filterPools filter some pools from Zeitgeist
queryAllActiveAssets query all active assets from subsquid indexer in the Zeitgeiest.
getAssetsForPoolsList get assets datas by using pool's data
getAssetPriceHistory get assets' historic prices
assetSpotPricesInZtg find prices at a particular block in the Zeitgeiest.
assetSpotPricesInZtg find prices at a particular block using unique identifier.
getSpotPrice get spot price in the specified block.
fetchPoolSpotPrices fetch spot prices of specified blocks.
sharesId fetch all shares' ids.

Get Accounts Datas

Function Name Description
getAccountBalances get balance of specific account.
getAccountHistoricalValues get accounts' historic datas
accountId fetch account id in this pool.

Create Markets Transactions

Function Name Description
createCategoricalMarket create a categorical market in the Zeitgeiest.
createCpmmMarketAndDeployAssets Create a market using CPMM scoring rule, buy a complete set of the assets used and deploy within and deploy an arbitrary amount of those that's greater than the minimum amount.
createScalarMarket create a scalar market in the Zeitgeiest.
deploySwapPool create swap pool for this market via api.tx.predictionMarkets.deploySwapPoolForMarket(marketId, weights).
assetSpotPricesInZtg find prices at a particular block using unique identifier.
buyCompleteSet buy a complete set of outcome shares for the market.
sellCompleteSet sell/destroy a complete set of outcome shares for the market.
reportOutcome report an outcome for the market.
dispute submit a disputed outcome for the market.
redeemShares redeem the winning shares for the market.
approve approve the Proposed market that is waiting for approval from the advisory committee.
reject reject the Proposed market that is waiting for approval from the advisory committee.
cancelAdvised allow the proposer of the market that is currently in a Proposed state to cancel the market proposal.
joinPool join pool.
poolJoinWithExactAssetAmount join exact asset amount to the pool.
joinPoolMultifunc join pool.
Three substrate join_pool_xxx functions in one
exitPool retrieve a given set of assets from pool to the signer.
swapExactAmountIn swap a given assetAmountIn of the assetIn/assetOut pair to pool.
swapExactAmountOut swap a given assetAmountOut of the assetIn/assetOut pair to pool.

Utils

Function Name Description
getBlockInfo get block info in Zeitgeist.
getChainInfo get chain info about Zeitgeiest.
getBlockData get block infomation by blockhash in the Zeitgeiest.
currencyTransfer transfer specified asset from self to any account in the Zeitgeiest.
toJSONString convert market object into string.
toFilteredJSONString convert market object into string with filters.

About


Languages

Language:TypeScript 97.1%Language:JavaScript 2.9%