web3

package
v0.0.0-...-81dc835 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 8 Imported by: 8

Documentation

Index

Constants

View Source
const (
	// AddressLength is the expected length of the address
	AddressLength = 20
)

Variables

This section is empty.

Functions

func FromHex

func FromHex(s string) []byte

func Hex2Bytes

func Hex2Bytes(str string) []byte

Types

type Address

type Address [AddressLength]byte

func BytesToAddress

func BytesToAddress(b []byte) Address

func HexToAddress

func HexToAddress(s string) Address

func (Address) Hex

func (a Address) Hex() string

func (*Address) SetBytes

func (a *Address) SetBytes(b []byte)

type ContractID

type ContractID struct {
	Blockchain string
	Network    string
	Address    EIP55
	Query      url.Values
}

func NewContractID

func NewContractID(blockchain string, network string, address string, query url.Values) (*ContractID, error)

func ParseContractID

func ParseContractID(contractURL string) (*ContractID, error)

func (*ContractID) Clone

func (t *ContractID) Clone() *ContractID

func (ContractID) MarshalText

func (t ContractID) MarshalText() ([]byte, error)

func (*ContractID) String

func (t *ContractID) String() string

func (*ContractID) StripQuery

func (t *ContractID) StripQuery() *ContractID

func (*ContractID) URL

func (t *ContractID) URL() (*url.URL, error)

func (*ContractID) UnmarshalText

func (t *ContractID) UnmarshalText(text []byte) error

type EIP55

type EIP55 string

https://eips.ethereum.org/EIPS/eip-55

func NewEIP55

func NewEIP55(s string) (EIP55, error)

func NewEIP55FromHexstring

func NewEIP55FromHexstring(h hexstring.T) (EIP55, error)

func (EIP55) MarshalText

func (t EIP55) MarshalText() ([]byte, error)

func (EIP55) String

func (t EIP55) String() string

func (EIP55) ToHexstring

func (t EIP55) ToHexstring() (hexstring.T, error)

func (*EIP55) UnmarshalText

func (t *EIP55) UnmarshalText(text []byte) error

type EIP681

type EIP681 struct {
	ChainID int
	Address EIP55
	Query   url.Values
}

https://eips.ethereum.org/EIPS/eip-681

func NewEIP681

func NewEIP681(chainID int, address string, query url.Values) (*EIP681, error)

func ParseEIP681

func ParseEIP681(uri string) (*EIP681, error)

func (EIP681) MarshalText

func (t EIP681) MarshalText() ([]byte, error)

func (*EIP681) String

func (t *EIP681) String() string

func (*EIP681) URL

func (t *EIP681) URL() *url.URL

func (*EIP681) UnmarshalText

func (t *EIP681) UnmarshalText(text []byte) error

Jump to

Keyboard shortcuts

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