Staking Transactions
Transactions for delegating ADA and managing stakepools
Register Stake Address
Same as Transaction, with MeshTxBuilder
you have to register a stake address before delegate to stakepools. Here's the 2 APIs you need:
Since we need to provide the deserilized hash of pool id, we can use the following util to get it:
Register a stake address before delegate to stakepools.
Connect wallet to run this demo
Delegate Stake
Delegation with MeshTxBuilder
is exactly the same as first delegate, but without registering stake key, so only one API is needed:
Delegate stake to a stake pool
Connect wallet to run this demo
Withdraw Rewards
Withdrawal with MeshTxBuilder
comes with only one API, to specify the reward address and the amount to withdraw.
- rewardAddress (string) - the reward address to withdraw from
- lovelace (number) - the amount to withdraw in Lovelace
Withdraw staking rewards.
Connect wallet to run this demo
Deregister Stake
Deregister a stake address. The function accepts the following parameters:
- rewardAddress (string) - the bech32 reward address to deregister
Deregister a stake address
Connect wallet to run this demo
Script Withdrawal - Supporting Withdraw Zero
Withdrawal from script is supported by MeshTxBuilder
with this set of APIs:
Withdraw Zero
With that capability, it supports a Cardano technique - withdraw zero - which is a technique to trigger withdrawal script validation without actually withdrawing any value. This is a technique to help boost script ExUnits performance especially comes to validating multiple script inputs. In order to perform withdraw zero, 2 steps are involved:
- Register script stake key
- Withdraw Zero
One off setup before triggering withdraw zero
Connect wallet to run this demo
Actual withdrawal of zero to trigger script validation
Connect wallet to run this demo