Calculate the accrued rewards for a given Komodo UTXO
Calculates the rewards in satoshis for a given Komodo UTXO. Heavily tested and 100% compliant with
Originally built for our Ledger KMD Reward Claim app. Released as a re-usable module for the benefit of the Komodo ecosystem.
npm install get-komodo-rewards
Pass in a
utxo object and an integer of the accrued rewards in satoshis will be returned.
const getKomodoRewards = ;const utxo =tiptime: 1552292091locktime: 1552248193height: 1263192satoshis: 3206795322480;const rewards = ;// 205000320
tiptime should be the current tiptime from
If you don't have access to this you can use a client-side generated UNIX timestamp at the cost of slightly reduced accuracy. If you do this, use a timestamp ~10 minutes in the past to avoid over calculating the rewards and creating an invalid transaction.
Returns a the accrued rewards in satoshis.
An object containing the following properties of the UTXO:
The current tiptime of the Komodo blockchain.
The locktime value of the UTXO.
The height of the UTXO.
The value of the UTXO in satoshis.
MIT © Atomic Labs
MIT © Luke Childs