SDK functions for POL staking on Ethereum protocol
Approve a contract to spend an amount of ERC-20 POL.
This function is necessary prior to stake POL through a ValidatorShare proxy contract.
Users must first allow the POL StakeManager proxy (sepolia / mainnet) contract to spend the amount that needs to be spent. If no amount is specified, an infinite amount will be approved and this transaction will no longer be required before each staking transaction. That said, this is not recommended for security reasons.
Buy voucher is the action of exchanging POL against validator shares.
It is done by doing a buyVoucherPOL contract call to a ValidatorShare proxy contract of your desired validator.
Our validator share proxies are : mainnet / sepolia
This function also links your stake to your kiln account id.
The amount to stake is in POL.
Sell voucher is the action of unbonding your staked POL.
It is done by doing a sellVoucherPOL contract call to a ValidatorShare proxy contract.
Once done, your POL token enter the unbonding period of ~3/4 days (80 checkpoints).
The amount to sell is in POL.
Unstake claim tokens transfers your unbonded tokens to your wallet.
Withdraw rewards transfers your available rewards to your wallet.
Restake rewards converts your available rewards to staked POL. This is how you can take advantage of auto-compounding by automating this process.
On POL, you have two options for signing and broadcasting transactions.
The method is usually preferred as it does not require the Fireblocks raw signing feature and allows you to leverage Fireblocks policies.
For this method to work you will need to whitelist the contract address that you are interacting with. When staking ETH with Kiln, it is interacting with our ValidatorShareProxy contract.
Once the contract is whitelisted in Fireblocks, you should be able to retrieve the destination id associated with it (in the fireblocks URL or via their API). This id needs to be in the Integration configuration object.
Here is an example showing how to sign and broadcast a transaction with a fireblocks vault.
Checkout the setup fireblocks documentation to setup your vault.
With this method, the transaction is signed and broadcasted through Fireblocks.
When using the Fireblocks raw signing feature, you need to make two calls to our SDK, the first to sign the transaction and the second to broadcast it via our API.
Sign a transaction by specifying the integration and the crafted transaction.
Here is an example showing how to sign a transaction with a fireblocks vault.
Checkout the setup fireblocks documentation to setup your vault.
Broadcast a signed transaction.
Get the transaction status of a broadcasted transaction by providing its transaction hash.
Decode a serialized transaction previously crafted. You can use this to get more information about a transaction prior to broadcast it such as the gas fees used, the function parameters etc.