Skip to main content

Indexs

getAllMarketIds

You can use this function to get all market IDs in the Zeitgeiest.

const sdk = await SDK.initialize(endpoint);

const res = await sdk.models.getAllMarketIds();

Code snippet

getAllMarkets

You can use this function to get all market in the Zeitgeiest.

const sdk = await SDK.initialize(endpoint);

const res = await sdk.models.getAllMarketIds();

Code snippet

createCategoricalMarket

You can use this function to create a categorical market in the Zeitgeiest.

const sdk = await SDK.initialize(endpoint);

const marketId = await sdk.models.createCategoricalMarket(
signer,
oracle,
marketPeriod,
advised,
mdm,
cpmm,
metadata,
false
);

Arguments

NameTypeIntroduction
signerKeyringPairOrExtSignerThe actual signer provider to sign the transaction.
oraclestringThe address that will be responsible for reporting the market.
periodMarketPeriodStart and end block numbers or unix timestamp of the market.
creationTypestring"Permissionless" or "Advised", Advised as default
mdmMarketDisputeMechanismDispute settlement can be authorized, court or simple_disputes
scoringRulestringscoringRule you choose, CPMM as default
metadataDecodedMarketMetadataMarket metadata
callbackOrPaymentInfo"true" to get txn fee estimation otherwise "false"

Code snippet

createScalarMarket

You can use this function to create a scalar market in the Zeitgeiest.

const sdk = await SDK.initialize(endpoint);

const marketId = await sdk.models.createScalarMarket(
signer,
title,
description,
oracle,
marketPeriod,
advised,
bounds,
mdm,
cpmm,
false
);

Arguments

NameTypeIntroduction
signerKeyringPairOrExtSignerThe actual signer provider to sign the transaction.
oraclestringThe address that will be responsible for reporting the market.
periodMarketPeriodStart and end block numbers or unix timestamp of the market.
titlestringThe title of the new prediction market.
descriptionstringThe description / extra information for the market.
creationTypestring"Permissionless" or "Advised", Advised as default
mdmMarketDisputeMechanismDispute settlement can be authorized, court or simple_disputes
scoringRulestringscoringRule you choose, CPMM as default
boundsnumber[]The array having lower and higher bound values denoting range set. [0,100] as default
callbackOrPaymentInfo"true" to get txn fee estimation otherwise "false"

Code snippet

fetchMarketData

You can use this function to fetch specify market's infomation by id in the Zeitgeiest.

const sdk = await SDK.initialize(endpoint);

const market = await sdk.models.fetchMarketData(Number(marketId));

Arguments

NameTypeIntroduction
marketIdMarketIdThe unique identifier for the market you want to fetch.

Code snippet

getMarketCount

You can use this function to get market counts in the Zeitgeiest.

const sdk = await SDK.initialize(endpoint);

const res = await sdk.models.getMarketCount();

Code snippet

fetchDisputes

You can use this function to get all market IDs in the Zeitgeiest. Should throw errors where market status is such that no disputes can have been registered, but all registered disputes will still be returned even if, eg, resolved. To check if disputes are active, use viewMarket and check market_status for "Disputed"

const sdk = await SDK.initialize(endpoint);

const res = await sdk.models.fetchDisputes();

Arguments

NameTypeIntroduction
marketIdMarketIdThe unique identifier for the market you want to fetch.

Code snippet

fetchPoolData

You can use this function to get specify pool infomation in the Zeitgeiest.

const sdk = await SDK.initialize(endpoint);

const swap = await sdk.models.fetchPoolData(swapId);
if (swap != null) {
console.log(swap.toJSONString());
}

Code snippet

assetSpotPricesInZtg

You can use this function to find prices at a particular block in the Zeitgeiest.

const sdk = await SDK.initialize(endpoint);

const res = await sdk.models.assetSpotPricesInZtg(blockHash);

Code snippet

getBlockData

You can use this function to get block infomation by blockhash in the Zeitgeiest.

const sdk = await SDK.initialize(endpoint);

const res = await sdk.models.getBlockData();

Code snippet

indexTransferRecipients

You can use this function to get all market IDs in the Zeitgeiest.

const sdk = await SDK.initialize(endpoint);

const res = await sdk.models.getAllMarketIds();

Code snippet

currencyTransfer

You can use this function to transfer specified asset from self to any account in the Zeitgeiest.

const sdk = await SDK.initialize(endpoint);

const res = await sdk.models.currencyTransfer(
signer,
dest,
currencyId,
amount,
false
);

Code snippet