Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Btc represents the Bitcoin currency. Btc = Currency{ Name: "Bitcoin", Chaincfg: &chaincfg.MainNetParams, } // BtcTestnet represents the Bitcoin testnet currency. BtcTestnet = Currency{ Name: "Bitcoin Testnet", Chaincfg: &chaincfg.TestNet3Params, } // BtcSimnet represents the Bitcoin testnet currency. BtcSimnet = Currency{ Name: "Bitcoin Simnet", Chaincfg: &chaincfg.SimNetParams, } // Ltc represents the Litecoin currency. Ltc = Currency{ Name: "Litecoin", Chaincfg: liteCoinParams, } // LtcTestnet represents the Litecoin currency. LtcTestnet = Currency{ Name: "Litecoin Testnet", Chaincfg: liteCoinParamsTestnet, } // LtcSimnet represents the Litecoin currency. LtcSimnet = Currency{ Name: "Litecoin Simnet", Chaincfg: liteCoinParamsSimnet, } )
View Source
var RateMap = map[Currency]map[Currency]float64{ Btc: map[Currency]float64{ Ltc: 10, }, BtcTestnet: map[Currency]float64{ LtcTestnet: 10, }, BtcSimnet: map[Currency]float64{ LtcSimnet: 10, }, Ltc: map[Currency]float64{ Btc: 0.1, }, LtcTestnet: map[Currency]float64{ BtcTestnet: 0.1, }, LtcSimnet: map[Currency]float64{ BtcSimnet: 0.1, }, }
RateMap contains exchange rates between Currencies.
Functions ¶
func CreateP2SHAddress ¶
CreateP2SHAddress returns a P2SH address as string given the currency and script.
func CreateP2SHP2WSHAddress ¶
CreateP2SHP2WSHAddress returns a P2SH nested P2WSH address as string given the currency and script.
Types ¶
type Currency ¶
Currency is a type representing a cryptocurrency. It has a name and parameters defining the chain of the cryptocurrency.
func GetCurrency ¶
GetCurrency returns the Currency for a Bech32 HRP.
func GetCurrencyFromInvoice ¶
GetCurrencyFromInvoice returns the Currency of a Lightning network Bolt11 invoice without validating the checksum of the invoice.
type PayReq ¶
type PayReq struct { Invoice string Destination string Currency Currency CreatedAt time.Time Expiry time.Duration Amount uint64 Description string PaymentHash []byte }
PayReq is a type representing a swap payment request.
func DecodeInvoice ¶
DecodeInvoice will return a PayReq given a Lightning network Bolt11 invoice.
Click to show internal directories.
Click to hide internal directories.