bb8

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ResultInfoForADA

type ResultInfoForADA struct {
	Address   string          `json:"address,omitempty"`
	Type      string          `json:"type,omitempty"`
	BlockNO   int64           `json:"block_no,omitempty"`
	BlockHash string          `json:"block_hash,omitempty"`
	TxTotal   int64           `json:"tx_total,omitempty"`
	Balance   string          `json:"balance,omitempty"`
	TotalIn   string          `json:"total_in,omitempty"`
	TotalOut  string          `json:"total_out,omitempty"`
	TotalFee  string          `json:"total_fee,omitempty"`
	TxList    []web3.CATxList `json:"tx_list,omitempty"`
}

ResultInfoForADA information for ADA address

func (*ResultInfoForADA) ToJSON

func (rtx *ResultInfoForADA) ToJSON() string

ToJSON ...

func (*ResultInfoForADA) ToMAP

func (rtx *ResultInfoForADA) ToMAP() (toHashMap map[string]interface{}, err error)

ToMAP ...

type ResultLastTxADA

type ResultLastTxADA struct {
	Addr          string `json:"addr,omitempty"`
	CtbID         string `json:"ctbId,omitempty"`
	CtbTimeIssued string `json:"ctbTimeIssued,omitempty"`
	FromAddr      string `json:"from_addr,omitempty"`
	ToAddr        string `json:"to_addr,omitempty"`
	Balance       string `json:"balance,omitempty"`
	Ammount       string `json:"ammount,omitempty"`
	TypeTx        string `json:"type_tx,omitempty"`
	Symbol        string `json:"symbol,omitempty"`
}

ResultLastTxADA return the last TX by ADA symbol (Cardano blockchain)

func (*ResultLastTxADA) ToJSON

func (rtx *ResultLastTxADA) ToJSON() string

ToJSON ...

func (*ResultLastTxADA) ToMAP

func (rtx *ResultLastTxADA) ToMAP() (toHashMap map[string]interface{}, err error)

ToMAP ...

func (*ResultLastTxADA) TruncateAddress

func (rtx *ResultLastTxADA) TruncateAddress(address string) string

TruncateAddress ...

type ResultLastTxSOL

type ResultLastTxSOL struct {
	Addr      string `json:"addr,omitempty"`
	TxID      string `json:"tx_id,omitempty"`
	Timestamp string `json:"timestamp,omitempty"`
	FromAddr  string `json:"from_addr,omitempty"`
	ToAddr    string `json:"to_addr,omitempty"`
	Balance   string `json:"balance,omitempty"`
	Ammount   string `json:"ammount,omitempty"`
	TypeTx    string `json:"type_tx,omitempty"`
	Symbol    string `json:"symbol,omitempty"`
}

ResultLastTxSOL return the last TX by address SOL symbol

func (*ResultLastTxSOL) ToJSON

func (rtx *ResultLastTxSOL) ToJSON() string

ToJSON ...

func (*ResultLastTxSOL) ToMAP

func (rtx *ResultLastTxSOL) ToMAP() (toHashMap map[string]interface{}, err error)

ToMAP ...

func (*ResultLastTxSOL) TruncateAddress

func (rtx *ResultLastTxSOL) TruncateAddress(address string) string

TruncateAddress ...

type TxRepository

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

TxRepository repository

func NewTx

func NewTx(limit int) TxRepository

NewTx constructor

func NewTxRepository

func NewTxRepository(exporterType string, clients ...interface{}) TxRepository

NewTxRepository constructor client

func (*TxRepository) ExportData

func (r *TxRepository) ExportData(data interface{}, symbol string) error

ExportData export data from ADA or SOL symbol

func (*TxRepository) Get

func (r *TxRepository) Get(ctx context.Context, address string) (string, error)

Get the last tx value by address as a key

func (*TxRepository) InfoByAddress

func (r *TxRepository) InfoByAddress(address string) (ResultInfoForADA, error)

InfoByAddress get info by address

func (*TxRepository) Set

func (r *TxRepository) Set(ctx context.Context, address, lastTx string, expiration time.Duration) error

Set an address as a key and the last TX as a value

type Txer

type Txer interface {
	InfoByAddress(address string) (ResultInfoForADA, error)
	Set(ctx context.Context, key, value string, expiration time.Duration) error
	Get(ctx context.Context, key string) (string, error)
}

Txer define all methods that can be used for our worker...

Jump to

Keyboard shortcuts

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