The following readme describes all the functions and their parameters exposed by the pno class of the K2 SDK. This sub-class contains all the important functions from the PNO registry and Lien contracts of the K2 Lending protocol.

onDelegatedRecipientSet function

Handle the case where delegated recipient is being adjusted to make sure no redelegations remain when lien is in force.

Input Parameters

currentRecipient: Address of the current recipient

Using onDelegatedRecipientSet function

await sdk.pno.onDelegatedRecipientSet(currentRecipient);

Return Parameters

Transaction details if the transaction was successful.

onSBPUpdated function

Poke the PNO registry to allow it to check whether kNetwork is mapped to current SBP.

Input Parameters

debtor: ETH address of the debtor

Using onSBPUpdated function

await sdk.pno.onSBPUpdated(debtor);

Return Parameters

Transaction details if the transaction was successful.

createKNetwork function

SBP owner can call this function to spin up their own kNetwork which will take care of deploying a fund splitter.

Input Parameters

defaultRewardToken: Address of the default reward token

Using createKNetwork function

await sdk.pno.createKNetwork(defaultRewardToken);

Return Parameters

Transaction details if the transaction was successful.

banNodeOperator function

Allows the lien contract to ban a node operator in the event that a PNO has severely violated protocol rules.

Input Parameters

sbpIndexId: SBP index in string
pno: Address of the PNO

Using banNodeOperator function

await sdk.pno.banNodeOperator(sbpIndexId, pno);

Return Parameters

Transaction details if the transaction was successful.

managePNO function

Allows the DAO to manage the global PNO inclusion list.

Input Parameters

pno: Address of the PNO
enabled: Boolean value, true if enabled

Using managePNO function

await sdk.pno.managePNO(pno, enabled);

Return Parameters

Transaction details if the transaction was successful.

removePNO function

Allow a SBP owner to use a PNO from the global inclusion list in their kNetwork.

Input Parameters

pno: Address of the PNO

Using removePNO function

await sdk.pno.removePNO(pno);

Return Parameters

Transaction details if the transaction was successful.

togglePNOGatekeepingForKNetwork function

Allow a kNetwork to enable PNO gatekeeping for their network before and after network creation.

Using togglePNOGatekeepingForKNetwork function

await sdk.pno.togglePNOGatekeepingForKNetwork();

Return Parameters

Transaction details if the transaction was successful.

manageKNetworkInclusionList function

Allow a kNetwork that has gatekeeping enabled to manage inclusion list for the opt in to work.

Input Parameters

PNOs: Array of all PNO addresses enabled: Boolean value, true if enabled

Using manageKNetworkInclusionList function

await sdk.pno.manageKNetworkInclusionList(PNOs, enabled);

Return Parameters

Transaction details if the transaction was successful.

optIntoKNetwork function

Lets the PNO to opt into node running for a kNetwork.

Input Parameters

sbpIndexId: SBP index in string

Using optIntoKNetwork function

await sdk.pno.optIntoKNetwork(sbpIndexId);

Return Parameters

Transaction details if the transaction was successful.

optOutOfKNetwork function

Lets the PNO to opt out of node running for a kNetwork.

Input Parameters

sbpIndexId: SBP index in string

Using optOutOfKNetwork function

await sdk.pno.optOutOfKNetwork(sbpIndexId);

Return Parameters

Transaction details if the transaction was successful.

setPNOPayoutRecipient function

Allow PNO to set their payout recipient across all kNetwork payout processing fund splitter contracts.

Input Parameters

payoutRecipient: Address of the payout recipient

Using setPNOPayoutRecipient function

await sdk.pno.setPNOPayoutRecipient(payoutRecipient);

Return Parameters

Transaction details if the transaction was successful.

reDelegateToPreferredNodeOperator function

Re-delegate K2 re-staked balance to a PNO using K2 LP balance.

Input Parameters

pno: Address of the PNO
amount: Restaked balance to be re-delegated

Using reDelegateToPreferredNodeOperator function

await sdk.pno.reDelegateToPreferredNodeOperator(pno, amount);

Return Parameters

Transaction details if the transaction was successful.

removeRedelegation function

Remove the re-delegation given to a PNO by a K2 LP balance and obtain K2 LP back.

Input Parameters

pno: Address of the PNO
amount: Re-delegated amount to be obtained back

Using removeRedelegation function

await sdk.pno.removeRedelegation(pno, amount);

Return Parameters

Transaction details if the transaction was successful.

reDelegateToPreferredNodeOperatorFromNativeDelegation function

Re-delegate K2 re-staked balance to a PNO using K2 native delegation balance.

Input Parameters

pno: Address of the PNO
amountToRedelegateInETH: Amount to be re-delegated in ETH

Using reDelegateToPreferredNodeOperatorFromNativeDelegation function

await sdk.pno.reDelegateToPreferredNodeOperatorFromNativeDelegation(pno, amountToRedelegateInETH);

Return Parameters

Transaction details if the transaction was successful.

removeRedelegationFromNativeDelegation function

Remove re-delegation from a PNO that was given from a native delegation K2 balance.

Input Parameters

pno: Address of the PNO
amountToRedelegateInETH: Re-delegated amount to be obtained back

Using removeRedelegationFromNativeDelegation function

await sdk.pno.removeRedelegationFromNativeDelegation(pno, amountToRedelegateInETH);

Return Parameters

Transaction details if the transaction was successful.

totalReDelegationsInETHToPNO function

Query function to get total re-delegations to PNO in ETH.

Input Parameters

user: ETH address of the user
pno: Address of the PNO

Using totalReDelegationsInETHToPNO function

await sdk.pno.totalReDelegationsInETHToPNO(user, pno);

Return Parameters

Returns the total re-delegated amount in bigint.

totalReDelegationsInETHToPNOForTimestamp function

Query function to get total re-delegations to PNO in ETH for the given timestamp.

Input Parameters

user: ETH address of the user
pno: Address of the PNO
timestamp: The timestamp value in string

Using totalReDelegationsInETHToPNOForTimestamp function

await sdk.pno.totalReDelegationsInETHToPNOForTimestamp(user, pno, timestamp);

Return Parameters

Returns the total re-delegated amount in bigint.

isPreferredNodeOperator function

To check if the PNO is eligible to receive liquid re-delegations.

Input Parameters

pno: Address of the PNO

Using isPreferredNodeOperator function

await sdk.pno.isPreferredNodeOperator(pno);

Return Parameters

Returns true if the PNO is eligible, else false.

onNodeOperatorWithdraw function

Check the active re-delegations before allowing the node operator to remove their native delegation.

Input Parameters

user: ETH address of the user.

Using onNodeOperatorWithdraw function

await sdk.pno.onNodeOperatorWithdraw(user);

Return Parameters

Transaction details if the transaction was successful.

configureDesignatedVerifierAsKNetwork function

Allow a kNetwork to specify the public key of their PNO designated verifier for slashing.

Input Parameters

designatedVerifier: Address of the PNO designated verifier

Using configureDesignatedVerifierAsKNetwork function

await sdk.pno.configureDesignatedVerifierAsKNetwork(designatedVerifier);

Return Parameters

Transaction details if the transaction was successful.

slashPNO function

Slash the given PNO.

Input Parameters

kNetwork: Address of the kNetwork
reportIdentifier: Nonce for the report
pno: Address of the PNO
amount: The slash amount in string
designatedVerifierSignature: List of verifier signatures of the format SignatureECDSAT (defined in the K2-SDK) for the respective BLS public keys
deadline: Deadline for the validity of the signatures
liquidDelegators: Array of all the liquid delegators

Using slashPNO function

await sdk.pno.slashPNO(kNetwork, reportIdentifier, pno, amount, designatedVerifierSignature, deadline, liquidDelegators);

Return Parameters

Transaction details if the transaction was successful.

onSBPUpdatedLien function

Poke the Lien to allow it to check whether kNetwork is mapped to current SBP.

Input Parameters

debtor: ETH address of the debtor

Using onSBPUpdatedLien function

await sdk.pno.onSBPUpdatedLien(debtor);

Return Parameters

Transaction details if the transaction was successful.

isValidReport function

Check if the given report is valid.

Input Parameters

kNetwork: Address of the kNetwork
reportIdentifier: Nonce for the report
pno: Address of the PNO
amount: The slash amount in string
designatedVerifierSignature: List of verifier signatures of the format SignatureECDSAT (defined in the K2-SDK) for the respective BLS public keys
deadline: Deadline for the validity of the signatures

Using isValidReport function

await sdk.pno.isValidReport(kNetwork, reportIdentifier, pno, amount, designatedVerifierSignature, deadline);

Return Parameters

Return true if the report is valid, else false.

reportTypedHash function

Get the typed hash of the given report.

Input Parameters

kNetwork: Address of the kNetwork
reportIdentifier: Nonce for the report
pno: Address of the PNO
amount: The slash amount in string
deadline: Deadline for the validity of the signatures

Using reportTypedHash function

await sdk.pno.reportTypedHash(currentRecipient);

Return Parameters

Returns the 32-byte hash of the report.

claimKETH function

This function allows claiming K2 yield on undelegated balance for liquid delegations to kNetworks.

Using claimKETH function

await sdk.pno.claimKETH();

Return Parameters

Transaction details if the transaction was successful.

claimLockedKETH function

This functions allows a user with no more liquid delegations to claim any locked kETH.

Using claimLockedKETH function

await sdk.pno.claimKETH();

Return Parameters

Transaction details if the transaction was successful.