From 1a7ad1d10dafb3a61a8eb7bd4e4cb4072d604ba9 Mon Sep 17 00:00:00 2001 From: Nebytov Denis Date: Fri, 26 Jan 2024 19:00:10 +0300 Subject: [PATCH] added required csl functions --- src/utils/cslTools.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/utils/cslTools.js b/src/utils/cslTools.js index 7df3d2d..482d837 100644 --- a/src/utils/cslTools.js +++ b/src/utils/cslTools.js @@ -180,10 +180,19 @@ export const getVoter = (wasm, dRepKeyHash) => wasm.Voter.new_drep(dRepKeyHash) export const getVotingProcedure = (wasm, votingChoice) => wasm.VotingProcedure.new(votingChoice) -// Stake Key Certificate +// Register Stake Key Certificate export const getStakeKeyRegCertWithCoin = (wasm, stakeCred, deposit) => wasm.StakeRegistration.new_with_coin(stakeCred, strToBigNum(wasm, deposit)) export const getStakeKeyRegCert = (wasm, stakeCred) => wasm.StakeRegistration.new(stakeCred) export const getCertOfNewStakeReg = (wasm, stakeKeyRegCert) => wasm.Certificate.new_stake_registration(stakeKeyRegCert) + +// Unregister Stake key Certificate +export const getStakeKeyDeregCertWithCoin = (wasm, stakeCred, deposit) => + wasm.StakeDeregistration.new_with_coin(stakeCred, strToBigNum(wasm, deposit)) + +export const getStakeKeyDeregCert = (wasm, stakeCred) => wasm.StakeDeregistration.new(stakeCred) + +export const getCertOfNewStakeDereg = (wasm, stakeKeyDeregCert) => + wasm.Certificate.new_stake_deregistration(stakeKeyDeregCert)