Skip to main content
The following readme describes all the functions and their parameters exposed by the reporterRegistry class of the K2 SDK. This sub-class of the SDK exposes all the functions from the reporter registry contract of the K2 Lending protocol.

getk2LendingPool function

This function can be used to get the contract address of the K2 Lending pool.

Using getk2LendingPool function

Return Parameter

Returns contract address.

isReporterActive function

Check the contracts if the reporter is active.

Input Parameters

reporter: ETH Address of the reporter

Using isReporterActive function

Return Parameter

Boolean, true if active, false otherwise.

isReporterRagequitted function

Check the contracts if the reporter has rage quitted or not.

Input Parameters

reporter: ETH address of the reporter

Using isReporterRagequitted function

Return Parameter

Boolean, true if rage quitted, false otherwise.

registerReporter function

Register a reporter to the reporter registry contract. The msg.sender will be registered as the reporter.

Using registerReporter function

Return Parameter

Transaction details if the transaction is successful.

isReporterOperational function

Check if the reporter is operational and can perform reports. An operational reporter is the one that is active and hasn’t rage quitted.

Input Parameters

reporter: ETH address of the reporter

Using isReporterOperational function

Return Parameter

Boolean, true if reporter is operational, false otherwise.

batchSubmitReports function

Function to submit multiple verified reports in a single transaction.

Input Parameters

reports: List of verified reports of the following structure:
reportSignatures: List of signatures (designatedVerifierSignature obtained after verifying the reports) of the respective reports. Each signature follows the following structure:

Using batchSubmitReports function

Return Parameter

Transaction details if the transaction is successful.

reportTypedHash function

Calculate typed hash of report struct.

Input Parameters

report: verified report of the following structure:

Using reportTypedHash function

Return Parameter

bytes32 hash string

isValidReport function

Input Parameters

report: Verified report obtained from the verifyLivenessReport function, of the following structure:
reportSignature: Signature (designatedVerifierSignature obtained after verifying the reports) of the respective report. The signature follows the following structure:

Using isValidReport function

Return Parameter

Returns true if valid, false otherwise.