chain

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2020 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AddressLength contains size of address,
	// 0x17 byte (address version) + 20 bytes of ScriptHash + 4 bytes of checksum.
	AddressLength = 25

	// ScriptHashLength contains size of ScriptHash.
	ScriptHashLength = 20

	// ErrEmptyAddress is raised when empty Address is passed.
	ErrEmptyAddress = internal.Error("empty address")

	// ErrAddressLength is raised when passed address has wrong size.
	ErrAddressLength = internal.Error("wrong address length")
)

Variables

This section is empty.

Functions

func Address

func Address(verificationScript []byte) string

Address returns NEO address based on passed VerificationScript.

func DecodeScriptHash

func DecodeScriptHash(s string) ([]byte, error)

DecodeScriptHash parses script hash into slice of bytes.

func FetchPublicKeys

func FetchPublicKeys(vs []byte) []*ecdsa.PublicKey

FetchPublicKeys tries to parse public keys from verification script.

func IsAddress

func IsAddress(s string) error

IsAddress checks that passed NEO Address is valid.

func KeysToAddress

func KeysToAddress(pubs ...*ecdsa.PublicKey) string

KeysToAddress return NEO address composed from public keys.

func ReverseBytes

func ReverseBytes(data []byte) []byte

ReverseBytes returns reversed []byte of given.

func ReversedScriptHashToAddress

func ReversedScriptHashToAddress(sc string) (addr string, err error)

ReversedScriptHashToAddress parses script hash and returns valid NEO address.

func VerificationScript

func VerificationScript(pubs ...*ecdsa.PublicKey) []byte

VerificationScript returns VerificationScript composed from public keys.

Types

type WalletAddress

type WalletAddress [AddressLength]byte

WalletAddress implements NEO address.

Jump to

Keyboard shortcuts

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