Global

Methods

getBalance - gets the balance of the provided address.(address, positionId) → {string}

Parameters:
Name Type Description
address string should be customers Polymarket account address, not their wallet address
positionId string the id for the position returned from getPositionId
Source:
Returns:
- customer's balance for the positionId
Type
string

getCollectioinId -This function gets the collection Id for the market's outcome collection(parentCollectionId, conditionId, indexSet) → {string}

Parameters:
Name Type Description
parentCollectionId string parent collectionId. constant value of "0x0000000000000000000000000000000000000000000000000000000000000000"
conditionId string conditionId of the market
indexSet number the index set of the outcome
Source:
Returns:
the collectionId returned by the Conditional Tokens contract
Type
string

getIndexSet - This function calculates the index set of a provided market outcome(market, outcome) → {number}

Parameters:
Name Type Description
market Market the market object
outcome string name of the outcome
Source:
Returns:
- the index set for the outcome
Type
number

getPositionId - It gets the position Id for a market outcome(collateralToken, collectionId) → {string}

Parameters:
Name Type Description
collateralToken string the address of the token used for collateral
collectionId string collectionId for the market's outcome collection
Source:
Returns:
the positionId returned by the Conditional Tokens contract
Type
string