cashaddress

package
v0.0.0-...-4769e7a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 11, 2018 License: MIT Imports: 4 Imported by: 2

Documentation

Index

Constants

View Source
const (
	RegTest = "bchreg"
	TestNet = "bchtest"
	MainNet = "bitcoincash"
)

List of valid cashaddress prefixes

View Source
const (
	P2KH uint8 = 0
	P2SH uint8 = 1
)

Valid cashaddress types

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	Prefix  string
	Version uint8
	Payload []uint8
}

Address is a struct containing unpacked information relevant to the new address specification.

func Decode

func Decode(addr string, defaultPrefix string) (*Address, error)

FromCashAddr takes a CashAddr URI string, and returns and unpacked RawAddress, and possible an error.

func (*Address) Encode

func (addr *Address) Encode() (string, error)

ToCashAddr expects a RawAddress and a prefix, and returns the CashAddr URI, and possibly an error.

func (*Address) String

func (addr *Address) String() string

String returns a string, consuming errors. Probably shouldn't use this most places

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL