The following readme describes all the necessary functions and their parameters exposed by the rst class of the K2 SDK.

getDeployer function

Get address of the RST module factory that deployed the RST.

Input Parameters

rstAddress: Address of RST contract in string

Using getDeployer function

await sdk.rst.getDeployer(rstAddress);

Return Parameter

Returns address of RST deployer

getSBPIndex function

Reference to the unique SBP index in the K2 lending contract where activity can be checked.

Input Parameters

rstAddress: Address of RST contract in string

Using getSBPIndex function

await sdk.rst.getSBPIndex(rstAddress);

Return Parameter

Returns uint256 SBP index in Big Numbers

updateSBPIndex function

For new SBPs created, the deployer uses this method so that the RST points to the new SBP index.

Input Parameters

rstAddress: Address of RST contract in string
newSBPIndex: new SBP index in string

Using updateSBPIndex function

await sdk.rst.updateSBPIndex(rstAddress, newSBPIndex);

Return Parameter

Transaction hash

isActive function

Check if the RST token is active or not.

Input Parameters

rstAddress: Address of RST contract in string

Using isActive function

await sdk.rst.isActive(rstAddress);

Return Parameter

Boolean. true if active, false otherwise.