types

package
v0.0.0-...-19b0ade Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: Apache-2.0 Imports: 7 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

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

func BytesToAddress

func BytesToAddress(b []byte) (*Address, error)

func StringToAddress

func StringToAddress(s string, acceptSolanaFormat bool) (*Address, error)

StringToAddress converts a hex-encoded address string into an *Address.

func (*Address) Copy

func (addr *Address) Copy() *Address

Copy returns a deep copy of the address.

func (*Address) Hex

func (addr *Address) Hex() string

Hex returns the full 32-byte address, encoded as hex.

func (*Address) ShortHex

func (addr *Address) ShortHex() string

ShortHex returns a hex-encoded address that is usually shorted than Hex().

If the full address returned by Hex() is prefixed 12 bytes set to zero, this function will trim those bytes.

The reason we need this function is that a few database collections (governorConfig, governorStatus, heartbeats) store guardian addresses as 40 hex digits instead of the full 64-digit hex representation. When performing lookups over those collections, this function can perform the conversion.

type TxHash

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

TxHash represents a transaction hash passed by query params.

func ParseTxHash

func ParseTxHash(value string) (*TxHash, error)

ParseTxHash parses a transaction hash from a string.

The transaction hash can be provided in different formats, depending on the blockchain it belongs to: * Solana: 64 bytes, encoded as base58. * All other chains: 32 bytes, encoded as hex.

More cases could be added in the future as needed.

func (*TxHash) Binary

func (h *TxHash) Binary() []byte

func (*TxHash) IsSolanaTxHash

func (h *TxHash) IsSolanaTxHash() bool

func (*TxHash) IsWormholeTxHash

func (h *TxHash) IsWormholeTxHash() bool

func (*TxHash) String

func (h *TxHash) String() string

Jump to

Keyboard shortcuts

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