backend

package
v0.0.0-...-585dd88 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2020 License: LGPL-3.0 Imports: 41 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CharSpace   = ' '
	CharEqual   = '='
	StringSpace = " "
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Elephant

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

func New

func New(n *node.Node, ctx *cli.Context) *Elephant

func (*Elephant) CancelCs

func (e *Elephant) CancelCs(postType string, params []interface{}) (string, error)

func (*Elephant) CheckReceipt

func (e *Elephant) CheckReceipt(postType string, params []interface{}) (string, error)

func (*Elephant) CheckTx

func (e *Elephant) CheckTx(postType string, params []interface{}) (string, error)

func (*Elephant) CheckTxIsPending

func (e *Elephant) CheckTxIsPending(hashId string) (bool, error)

func (*Elephant) CreateObjectStorage

func (e *Elephant) CreateObjectStorage(postType string, params []interface{}) (string, error)

func (*Elephant) DoOperation

func (e *Elephant) DoOperation(cmd string, params []interface{}, rate chan int) (interface{}, error)

func (*Elephant) GetAccAddresses

func (e *Elephant) GetAccAddresses() []string

Accounts returns the collection of accounts this node manages

func (*Elephant) GetAccoutInUse

func (e *Elephant) GetAccoutInUse() accounts.Account

GetAccoutInUse gets the account selected in the GUI

func (*Elephant) GetAccouts

func (e *Elephant) GetAccouts() []accounts.Account

Accounts returns the collection of accounts this node manages

func (*Elephant) GetAgentsInfo

func (e *Elephant) GetAgentsInfo() (string, error)

func (*Elephant) GetCSAddress

func (e *Elephant) GetCSAddress() (string, error)

GetCSAddress gets the agent account connected in the GUI

func (*Elephant) GetClient

func (e *Elephant) GetClient() *EthClient

func (*Elephant) GetMails

func (e *Elephant) GetMails(postType string, params []interface{}) (string, error)

func (*Elephant) GetSignedCs

func (e *Elephant) GetSignedCs(postType string, params []interface{}, address string) (string, error)

GetSignedCs - returns the signed CS of this account

func (*Elephant) GetTotalBalance

func (e *Elephant) GetTotalBalance() (string, error)

GetTotalBalance - returns the total balance for all accounts available

func (*Elephant) ImportKey

func (e *Elephant) ImportKey(postType string, params []interface{}) (string, error)

ImportKey will import a new account and returns the address for the new account.

func (*Elephant) Init

func (e *Elephant) Init() ([]byte, error)

func (*Elephant) Log

func (e *Elephant) Log() log.Logger

func (*Elephant) NewAccount

func (e *Elephant) NewAccount(params []interface{}) (string, error)

NewAccount will create a new account and returns the address for the new account.

func (*Elephant) ParseUpdateSignedCs

func (e *Elephant) ParseUpdateSignedCs(str string) error

func (*Elephant) PassphraseEntered

func (e *Elephant) PassphraseEntered() bool

PassPhraseEntered return if the passphrase has been entered

func (*Elephant) ReadFile

func (e *Elephant) ReadFile(postType string, params []interface{}, rate chan int) (string, error)

func (*Elephant) ReadString

func (e *Elephant) ReadString(postType string, params []interface{}) (string, error)

func (*Elephant) RegMail

func (e *Elephant) RegMail(postType string, params []interface{}) (string, error)

func (*Elephant) RemoteIPEntered

func (e *Elephant) RemoteIPEntered() bool

RemoteIPEntered return if the remote IP has been entered

func (*Elephant) SendMail

func (e *Elephant) SendMail(postType string, params []interface{}) (string, error)

func (*Elephant) SendTransaction

func (e *Elephant) SendTransaction(postType string, params []interface{}) (string, error)

func (*Elephant) SetAccoutInUse

func (e *Elephant) SetAccoutInUse(address, passphrase string) bool

SetAccoutInUse sets the account selected in the GUI

func (*Elephant) SetAccoutInUse2

func (e *Elephant) SetAccoutInUse2(postType string, params []interface{}) (bool, error)

func (*Elephant) SignAuthAllowFlow

func (e *Elephant) SignAuthAllowFlow(signer, csAddr common.Address, flow uint64) ([]byte, error)

func (*Elephant) SignCs

func (e *Elephant) SignCs(postType string, params []interface{}) (string, error)

func (*Elephant) WaitTXComplete

func (e *Elephant) WaitTXComplete(postType string, params []interface{}) (bool, error)

func (*Elephant) WalletTx

func (e *Elephant) WalletTx(postType string, params []interface{}) (string, error)

func (*Elephant) WriteFile

func (e *Elephant) WriteFile(postType string, params []interface{}, rate chan int) (bool, error)

func (*Elephant) WriteString

func (e *Elephant) WriteString(postType string, params []interface{}) (bool, error)

type EthClient

type EthClient struct {
	*ethclient.Client
	// contains filtered or unexported fields
}

EthClient represents the eth client

func NewEthClient

func NewEthClient(url string) (*EthClient, error)

NewEthClient returns a new eth client

func (*EthClient) CheckReg

func (client *EthClient) CheckReg(addr common.Address, params []interface{}) (bool, error)

CheckReg - returns whether the mail nickname have already been registered

func (*EthClient) EstimateGasSpend

func (client *EthClient) EstimateGasSpend(from common.Address, value *big.Int) (*big.Int, error)

EstimateGasSpend - returns estimated gas

func (*EthClient) EstimateTxnGas

func (client *EthClient) EstimateTxnGas(from, to common.Address, value *big.Int) (*big.Int, error)

EstimateTxnGas - returns estimated gas

func (*EthClient) GetBalance

func (client *EthClient) GetBalance(params []interface{}) (string, error)

GetBalance - returns the balance for this account

func (*EthClient) GetEleTransaction

func (client *EthClient) GetEleTransaction(hash common.Hash) (*types_elephant.Transaction, bool, error)

GetEleTransaction - returns a elephant txn for the specified hash

func (*EthClient) GetEthGasStationEstimate

func (client *EthClient) GetEthGasStationEstimate() (*EthGasStationData, error)

GetEthGasStationEstimate get the latest data from https://ethgasstation.info/json/ethgasAPI.json

func (*EthClient) GetLatestBlock

func (client *EthClient) GetLatestBlock() (uint32, common.Hash, error)

GetLatestBlock - returns the latest block

func (*EthClient) GetObjectsInfo

func (client *EthClient) GetObjectsInfo(params []interface{}, address string) (string, error)

GetObjectsInfo - returns the objects information

func (*EthClient) GetRentSize

func (client *EthClient) GetRentSize(params []interface{}, address string) (string, error)

GetRentSize - returns the rent size

func (*EthClient) GetTxnNonce

func (client *EthClient) GetTxnNonce(txID string) (int32, error)

GetTxnNonce - used to fetch nonce for a submitted txn

func (*EthClient) GetUnconfirmedBalance

func (client *EthClient) GetUnconfirmedBalance(destAccount common.Address) (*big.Int, error)

GetUnconfirmedBalance - returns the unconfirmed balance for this account

func (*EthClient) GetUsedFlow

func (client *EthClient) GetUsedFlow(address string) (uint64, error)

func (*EthClient) SendTx

func (client *EthClient) SendTx(from, to, passphrase string, am *accounts.Manager, actType uint8, actData []byte) (common.Hash, error)

func (*EthClient) SendTxWithNonce

func (client *EthClient) SendTxWithNonce(from, to, passphrase string, value *big.Int, am *accounts.Manager, actType uint8, actData []byte,
	nonce uint64) (common.Hash, error)

type EthGasStationData

type EthGasStationData struct {
	Average     float64 `json:"average"`
	FastestWait float64 `json:"fastestWait"`
	FastWait    float64 `json:"fastWeight"`
	Fast        float64 `json:"Fast"`
	SafeLowWait float64 `json:"safeLowWait"`
	BlockNum    int64   `json:"blockNum"`
	AvgWait     float64 `json:"avgWait"`
	BlockTime   float64 `json:"block_time"`
	Speed       float64 `json:"speed"`
	Fastest     float64 `json:"fastest"`
	SafeLow     float64 `json:"safeLow"`
}

EthGasStationData represents ethgasstation api data https://ethgasstation.info/json/ethgasAPI.json {"average": 20.0, "fastestWait": 0.4, "fastWait": 0.4, "fast": 200.0, "safeLowWait": 10.6, "blockNum": 6684733, "avgWait": 2.0, "block_time": 13.056701030927835, "speed": 0.7529715304081577, "fastest": 410.0, "safeLow": 17.0}

Jump to

Keyboard shortcuts

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