address

package
v0.0.0-...-85922c0 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ED25519PubKeySize    = 32
	Secp256k1PayloadSize = 21
)
View Source
const (
	AddressSize        = 44
	AddresPrefixSize   = 3
	SecpAddressSzie    = 44
	Ed25519AddressSzie = 47
)
View Source
const (
	MainnetPrefix = "Kto"
	TestnetPrefix = "otK"
)
View Source
const (
	UndefAddressString = ""
)

Variables

View Source
var CurrentNetWork = Testnet
View Source
var GenesisAddress = "otK00000000000000000000000000000000000000000"
View Source
var Undef = Address{}
View Source
var (
	ZeroAddress = Address{string([]byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0})}
)

Functions

func SetNetWork

func SetNetWork(networkType string)

Types

type Address

type Address struct {
	// contains filtered or unexported fields
}

Address

func NewAddrFromString

func NewAddrFromString(str string) (Address, error)

func NewEd25519Addr

func NewEd25519Addr(pubkey []byte) (Address, error)

func NewFromBytes

func NewFromBytes(addr []byte) (Address, error)

func NewFromEthAddr

func NewFromEthAddr(eaddr common.Address) (Address, error)

func NewSecp256k1Addr

func NewSecp256k1Addr(pub []byte) (Address, error)

func StringToAddress

func StringToAddress(addr string) (Address, error)

func (Address) Bytes

func (a Address) Bytes() []byte

func (*Address) MarshalCBOR

func (a *Address) MarshalCBOR(w io.Writer) error

func (*Address) NewCommonAddr

func (a *Address) NewCommonAddr() (common.Address, error)

func (Address) Payload

func (a Address) Payload() []byte

func (*Address) Protocol

func (a *Address) Protocol() crypto.SigType

func (Address) String

func (a Address) String() string

func (*Address) UnmarshalCBOR

func (a *Address) UnmarshalCBOR(r io.Reader) error

type NetWork

type NetWork = byte

NetWork

const (
	Mainnet NetWork = iota
	Testnet
)

Jump to

Keyboard shortcuts

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