The following readme describes all the functions and their parameters exposed by the nodeOperatorModule class of the K2 SDK. This sub-class contains all the important functions from the K2 Node Operator Module contract of the K2 Lending protocol.

getK2LendingContract function

This function can be used to get the K2 Lending contract address set in the K2 Node operator module contract.

Using getK2LendingContract function

await sdk.nodeOperatorModule.getK2LendingContract();

Return parameters

ETH address of the K2Lending contract.

getReporterRegistryContract function

This function can be used to get the reporter registry contract address set in the K2 Node operator module contract.

Using getReporterRegistryContract function

await sdk.nodeOperatorModule.getReporterRegistryContract();

Return parameters

ETH address of the Reporter registry contract.

batchNodeOperatorKick function

Report multiple BLS keys for kicking from K2 pool.

Input Parameters

blsPublicKeys: List of BLS public keys to kick
effectiveBalances: List of effective balance in string for respective BLS public keys
designatedVerifierSignatures: List of verifier signatures of the format SignatureECDSAT (defined in the K2-SDK) for the respective BLS public keys

Using batchNodeOperatorKick function

await sdk.nodeOperatorModule.batchNodeOperatorKick(
  blsPublicKeys,
  effectiveBalances,
  designatedVerifierSignatures
);

Return parameters

Transaction details if the transaction is successful.

nodeOperatorClaim function

Batch node operator claims must come with an effective balance report.

Input Parameters

blsPublicKeys: List of BLS public keys to kick
effectiveBalances: List of effective balance in string for respective BLS public keys
designatedVerifierSignatures: List of verifier signatures of the format SignatureECDSAT (defined in the K2-SDK) for the respective BLS public keys

Using nodeOperatorClaim function

await sdk.nodeOperatorModule.nodeOperatorClaim(
  blsPublicKeys,
  effectiveBalances,
  designatedVerifierSignatures
);

Return parameters

Transaction details if the transaction is successful.

isValidEffectiveBalanceReport function

Check whether a kick due to effective balance is valid

Input Parameters

blsPublicKey: BLS public key to kick
effectiveBalance: Effective balance in string for the respective BLS public key
designatedVerifierSignature: Verifier signature of the format SignatureECDSAT (defined in the K2-SDK) for the respective BLS public key

Using isValidEffectiveBalanceReport function

await sdk.nodeOperatorModule.isValidEffectiveBalanceReport(
  blsPublicKey,
  effectiveBalance,
  designatedVerifierSignature
);

Return parameters

true if report is valid, false otherwise.

isNewBLSKeyPermitted function

Check whether a BLS public key si permitted or not.

Input Parameters

blsPublicKey: BLS public key

Using isNewBLSKeyPermitted function

await sdk.nodeOperatorModule.isNewBLSKeyPermitted(blsPublicKey);

Return parameters

true if BLS public key is valid, false otherwise.