Skip to content

Latest commit

 

History

History
25 lines (18 loc) · 751 Bytes

README.md

File metadata and controls

25 lines (18 loc) · 751 Bytes

blockreward

Go Reference

Convenience library to calculate block rewards for various bitcoin-like cryptocurrencies.

Usage

package main

import (
    "fmt"
    "github.com/RaghavSood/blockreward"
)

func main() {
    blockHeight := int64(210000)
    bitcoinReward := blockreward.SubsidyAtHeight(blockreward.BitcoinMainnet, blockHeight)
    litecoinReward := blockreward.SubsidyAtHeight(blockreward.LitecoinMainnet, blockHeight)

    fmt.Printf("Bitcoin reward at height %d: %d satoshis\n", blockHeight, bitcoinReward)
    fmt.Printf("Litecoin reward at height %d: %d satoshis\n", blockHeight, litecoinReward)
}