account

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: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	Nonce       uint64 `json:"nonce"`
	Address     string `json:"address"`
	Balance     []byte `json:"balance"`
	StorageRoot []byte `json:"storageRoot"`
}

Account : Account Detail

type Service

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

Service ...

func NewAccountService

func NewAccountService() *Service

func (*Service) Account

func (s *Service) Account() *protobuf.Account

Account returns state db account

func (*Service) AccountEBalancePerAssetReachLimit

func (s *Service) AccountEBalancePerAssetReachLimit() bool

AccountEBalancePerAssetReachLimit reports whether an account reaches limit for number of address per asset.

func (*Service) AccountExternalAddressExist

func (s *Service) AccountExternalAddressExist() bool

AccountExternalAddressExist reports whether an external address existed in EBalances

func (*Service) Address

func (s *Service) Address() string

Address returns service her account address

func (*Service) AssetSymbol

func (s *Service) AssetSymbol() string

AssetSymbol returns service asset symbol

func (*Service) ExtAddress

func (s *Service) ExtAddress() string

ExtAddress returns service ExtAddress

func (*Service) GetAccountByAddress

func (s *Service) GetAccountByAddress(address string) (*protobuf.Account, error)

func (*Service) GetPublicAddress

func (s *Service) GetPublicAddress(keyBytes []byte) (string, error)

func (*Service) IsHerdiusZeroAddress

func (s *Service) IsHerdiusZeroAddress() bool

IsHerdiusZeroAddress checks if receiver address is of herdius zero address when lock tx type is transmitted to herdius blockchain

func (*Service) ReceiverAddress

func (s *Service) ReceiverAddress() string

ReceiverAddress returns receiver's her account address

func (*Service) SetAccount

func (s *Service) SetAccount(account *protobuf.Account)

SetAccount sets Service account

func (*Service) SetAddress

func (s *Service) SetAddress(address string)

SetAddress sets Service asset symbol

func (*Service) SetAssetSymbol

func (s *Service) SetAssetSymbol(assetSymbol string)

SetAssetSymbol sets Service asset symbol

func (*Service) SetExtAddress

func (s *Service) SetExtAddress(extAddress string)

SetExtAddress sets Service ExtAddress

func (*Service) SetReceiverAddress

func (s *Service) SetReceiverAddress(receiverAddress string)

SetReceiverAddress sets receiver's her account address

func (*Service) SetTxLockedAmount

func (s *Service) SetTxLockedAmount(txLockedAmount uint64)

SetTxLockedAmount sets transaction transfer locked amount

func (*Service) SetTxRedeemAmount

func (s *Service) SetTxRedeemAmount(txRedeemAmount uint64)

SetTxRedeemAmount sets transaction transfer redeem amount

func (*Service) SetTxType

func (s *Service) SetTxType(txType string)

SetTxType sets Service tx type

func (*Service) SetTxValue

func (s *Service) SetTxValue(txValue uint64)

SetTxValue sets transaction transfer value

func (*Service) TxLockedAmount

func (s *Service) TxLockedAmount() uint64

TxLockedAmount returns transaction transfer locked amount

func (*Service) TxRedeemAmount

func (s *Service) TxRedeemAmount() uint64

TxRedeemAmount returns transaction transfer redeem amount

func (*Service) TxType

func (s *Service) TxType() string

TxType returns service tx type

func (*Service) TxValue

func (s *Service) TxValue() uint64

TxValue returns transaction transfer value

func (*Service) VerifyAccountBalance

func (s *Service) VerifyAccountBalance() bool

VerifyAccountBalance verifies if account has enough HER tokens or external asset balances

func (*Service) VerifyAccountNonce

func (s *Service) VerifyAccountNonce(a *protobuf.Account, txNonce uint64) bool

VerifyAccountNonce verifies initiated transaction has Nonce value greater than Nonce value in account

func (*Service) VerifyLockedAmount

func (s *Service) VerifyLockedAmount() bool

VerifyLockedAmount checks account have enough external balance for lock.

func (*Service) VerifyRedeemAmount

func (s *Service) VerifyRedeemAmount() bool

VerifyRedeemAmount checks account have proper locked amount for redeeming

type ServiceI

type ServiceI interface {
	GetAccountByAddress(address string) (*protobuf.Account, error)
}

ServiceI is an account service interface

Jump to

Keyboard shortcuts

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