address

package
v0.0.0-...-8850773 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Length is the expected length of the address
	Length = 21
	// LengthBase58 is the expected length of the address in base58format
	LengthBase58 = 34
	// LengthEthAddress is the expected length of the eth address
	LengthEthAddress = 20
	// TronBytePrefix is the hex prefix to address
	TronBytePrefix = byte(0x41)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address []byte

Address represents the 21 byte address of a tron account.

func FromBase58

func FromBase58(s string) (Address, error)

func FromBase58Unsafe

func FromBase58Unsafe(s string) Address

func FromBytes

func FromBytes(b []byte) (Address, error)

func FromEthAddress

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

func FromHex

func FromHex(s string) (Address, error)

func FromHexUnsafe

func FromHexUnsafe(s string) Address

func (Address) Bytes

func (a Address) Bytes() []byte

Bytes get bytes from address

func (Address) Hex

func (a Address) Hex() string

Hex get bytes from address in string

func (Address) String

func (a Address) String() string

String implements fmt.Stringer.

func (Address) ToEthAddress

func (a Address) ToEthAddress() []byte

Jump to

Keyboard shortcuts

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