sync

package
v0.0.0-...-868bdbc Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2020 License: AGPL-3.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DoSyncAllAccounts

func DoSyncAllAccounts(exBal external.BalanceStorage, env string, stopCh chan struct{})

DoSyncAllAccounts syncs all assets of available accounts.

Types

type BNBSyncer

type BNBSyncer struct {
	RPC string
	// contains filtered or unexported fields
}

BNBSyncer syncs all BNB external accounts

func (*BNBSyncer) GetExtBalance

func (bs *BNBSyncer) GetExtBalance() error

GetExtBalance syncs bnb account.

func (*BNBSyncer) Update

func (bs *BNBSyncer) Update()

Update updates accounts in cache as and when external balances external chains are updated.

type BTCSyncer

type BTCSyncer struct {
	RPC string
	// contains filtered or unexported fields
}

BTCSyncer syncs all external BTC accounts.

func (*BTCSyncer) GetExtBalance

func (btc *BTCSyncer) GetExtBalance() error

GetExtBalance ...

func (*BTCSyncer) Update

func (btc *BTCSyncer) Update()

Update updates accounts in cache as and when external balances external chains are updated.

type BTCTestNetSyncer

type BTCTestNetSyncer struct {
	LastExtBalance map[string]*big.Int
	ExtBalance     map[string]*big.Int
	BlockHeight    map[string]*big.Int
	Nonce          map[string]uint64
	RPC            string
	Account        statedb.Account
	Storage        external.BalanceStorage
	// contains filtered or unexported fields
}

BTCTestNetSyncer syncs all external BTC accounts in btctestnet.

func (*BTCTestNetSyncer) GetExtBalance

func (btc *BTCTestNetSyncer) GetExtBalance() error

GetExtBalance ...

func (*BTCTestNetSyncer) Update

func (btc *BTCTestNetSyncer) Update()

Update updates accounts in cache as and when external balances external chains are updated.

type Balance

type Balance struct {
	Free   string
	Symbol string
}

type BlockchainInfoResponse

type BlockchainInfoResponse struct {
	Hash160       string `json:"hash160"`
	Address       string `json:"address"`
	NTx           uint64 `json:"n_tx"`
	TotalReceived int    `json:"total_received"`
	TotalSent     int    `json:"total_sent"`
	FinalBalance  int64  `json:"final_balance"`
	Txs           []struct {
		Ver    int `json:"ver"`
		Inputs []struct {
			Sequence int64  `json:"sequence"`
			Witness  string `json:"witness"`
			PrevOut  struct {
				Spent             bool `json:"spent"`
				SpendingOutpoints []struct {
					TxIndex int `json:"tx_index"`
					N       int `json:"n"`
				} `json:"spending_outpoints"`
				TxIndex int    `json:"tx_index"`
				Type    int    `json:"type"`
				Addr    string `json:"addr"`
				Value   int    `json:"value"`
				N       int    `json:"n"`
				Script  string `json:"script"`
			} `json:"prev_out"`
			Script string `json:"script"`
		} `json:"inputs"`
		Weight      int    `json:"weight"`
		BlockHeight int    `json:"block_height"`
		RelayedBy   string `json:"relayed_by"`
		Out         []struct {
			Spent   bool   `json:"spent"`
			TxIndex int    `json:"tx_index"`
			Type    int    `json:"type"`
			Addr    string `json:"addr"`
			Value   int    `json:"value"`
			N       int    `json:"n"`
			Script  string `json:"script"`
		} `json:"out"`
		LockTime   int    `json:"lock_time"`
		Result     int    `json:"result"`
		Size       int    `json:"size"`
		BlockIndex int    `json:"block_index"`
		Time       int    `json:"time"`
		TxIndex    int    `json:"tx_index"`
		VinSz      int    `json:"vin_sz"`
		Hash       string `json:"hash"`
		VoutSz     int    `json:"vout_sz"`
	} `json:"txs"`
}

BlockchainInfoResponse ...

type DaiSyncer

type DaiSyncer struct {
	RPC string

	TokenContractAddress string
	// contains filtered or unexported fields
}

DaiSyncer syncs all DAI external accounts

func (*DaiSyncer) GetExtBalance

func (ds *DaiSyncer) GetExtBalance() error

GetExtBalance ...

func (*DaiSyncer) Update

func (ds *DaiSyncer) Update()

Update updates accounts in cache as and when external balances external chains are updated.

type EthSyncer

type EthSyncer struct {
	RPC string
	// contains filtered or unexported fields
}

EthSyncer syncs all ETH external accounts

func (*EthSyncer) GetExtBalance

func (es *EthSyncer) GetExtBalance() error

GetExtBalance ...

func (*EthSyncer) Update

func (es *EthSyncer) Update()

Update updates accounts in cache as and when external balances external chains are updated.

type ExternalSyncer

type ExternalSyncer struct {
	LastExtBalance map[string]*big.Int
	ExtBalance     map[string]*big.Int
	BlockHeight    map[string]*big.Int
	Nonce          map[string]uint64
	RPC            string
	Account        statedb.Account
	Storage        external.BalanceStorage
	// contains filtered or unexported fields
}

ExternalSyncer syncs all asset external accounts

type HERToken

type HERToken struct {
	LastExtBalance       *big.Int
	ExtBalance           *big.Int
	Account              statedb.Account
	BlockHeight          *big.Int
	Nonce                uint64
	Storage              external.BalanceStorage
	TokenContractAddress string
	TokenSymbol          string
	RPC                  string
}

func (*HERToken) GetExtBalance

func (her *HERToken) GetExtBalance() error

GetExtBalance Gets Asset balance from main chain

func (*HERToken) Update

func (her *HERToken) Update()

Update Updates balance of asset in cache

type HTokenSyncer

type HTokenSyncer struct {
	RPC string
	// contains filtered or unexported fields
}

HTokenSyncer syncs all HToken external accounts

func (*HTokenSyncer) GetExtBalance

func (hs *HTokenSyncer) GetExtBalance() error

GetExtBalance ...

func (*HTokenSyncer) Update

func (hs *HTokenSyncer) Update()

Update updates accounts in cache as and when external balances external chains are updated.

type LTCSyncer

type LTCSyncer struct {
	RPC string
	// contains filtered or unexported fields
}

LTCSyncer syncs all XTZ external accounts

func (*LTCSyncer) GetExtBalance

func (ls *LTCSyncer) GetExtBalance() error

GetExtBalance syncs lite coin account.

func (*LTCSyncer) Update

func (ls *LTCSyncer) Update()

Update updates accounts in cache as and when external balances external chains are updated.

type Syncer

type Syncer interface {
	GetExtBalance() error
	Update()
}

type TezosSyncer

type TezosSyncer struct {
	RPC string
	// contains filtered or unexported fields
}

TezosSyncer syncs all XTZ external accounts

func (*TezosSyncer) GetExtBalance

func (ts *TezosSyncer) GetExtBalance() error

GetExtBalance ...

func (*TezosSyncer) Update

func (ts *TezosSyncer) Update()

Update updates accounts in cache as and when external balances external chains are updated.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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