common

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: GPL-3.0 Imports: 1 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidIndex           = errors.New("index is invalid")
	ErrInvalidMnemonic        = errors.New("mnemonic is invalid")
	ErrUnsupportedAddressType = errors.New("address type is unsupported")
	ErrUnsupportedCurrency    = errors.New("currency is unsupported")
	ErrInvalidTransaction     = errors.New("transaction is invalid")
	ErrSendTransactionFailed  = errors.New("send transaction failed")
	ErrTransactionNotFound    = errors.New("transaction is not found")
	ErrUnsupportedChain       = errors.New("chain is unsupported")
)

Functions

This section is empty.

Types

type AddressType

type AddressType int8
const (
	AddressType_BTC_LEGACY        AddressType = 1
	AddressType_BTC_NESTED_SEGWIT AddressType = 2
	AddressType_BTC_NATIVE_SEGWIT AddressType = 3
	AddressType_BTC_TAPROOT       AddressType = 4
	AddressType_ETH               AddressType = 5
	AddressType_TRON              AddressType = 6
	AddressType_BSC               AddressType = 7
)

func ParseAddressType

func ParseAddressType(AddressType string) (AddressType, error)

func (AddressType) ToString

func (Self AddressType) ToString() (string, error)

type Chain

type Chain int8
const (
	Chain_BTC  Chain = 1
	Chain_ETH  Chain = 2
	Chain_TRON Chain = 3
	Chain_BSC  Chain = 4
)

func ParseChain

func ParseChain(chain string) (Chain, error)

func (Chain) ToString

func (chian Chain) ToString() (string, error)

type Transaction

type Transaction struct {
	Chain     Chain
	Hash      string
	Height    uint64
	TimeStamp uint64
	Currency  string
	From      string
	To        string
	Value     float64
	Confirms  uint64
	Result    bool
}

Jump to

Keyboard shortcuts

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