common

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2024 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const AddrLength = 20

AddrLength is byte length of eth account address.

View Source
const HashLength = 32

HashLength is byte length of cryptographic hash.

Variables

View Source
var ErrAddrLength = errs.Class("Address must be 20 bytes in length")

ErrAddrLength represents the error that the address is the wrong length.

Functions

This section is empty.

Types

type Address

type Address = common.Address

Address is wallet address on eth chain.

func AddressFromBytes

func AddressFromBytes(byteAddr []byte) (Address, error)

AddressFromBytes creates a new address from hex bytes.

func AddressFromHex

func AddressFromHex(hex string) (Address, error)

AddressFromHex creates new address from hex string.

type EthEndpoint

type EthEndpoint struct {
	Name     string `json:"name"`
	URL      string `json:"url"`
	Contract string `json:"contract"`
	ChainID  int64  `json:"chainId,string,omitempty"`
}

EthEndpoint contains the URL and contract address to access a chain API.

type Hash

type Hash = common.Hash

Hash represent cryptographic hash.

func HashFromBytes

func HashFromBytes(b []byte) Hash

HashFromBytes creates hash from byte slice.

Jump to

Keyboard shortcuts

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