Documentation ¶
Index ¶
- Variables
- func WeiToAlpha(wei *big.Int) uint64
- type CallAttributes
- type EvmClient
- func (e *EvmClient) Call(ctx context.Context, callAttr *CallAttributes) (*ProcessingDetails, error)
- func (e *EvmClient) GetBalance(ctx context.Context, ethAddr []byte) (string, []byte, error)
- func (e *EvmClient) GetFeeCreditBill(ctx context.Context, unitID types.UnitID) (*sdk.Bill, error)
- func (e *EvmClient) GetGasPrice(ctx context.Context) (string, error)
- func (e *EvmClient) GetRoundNumber(ctx context.Context) (*sdk.RoundNumber, error)
- func (e *EvmClient) GetTransactionCount(ctx context.Context, ethAddr []byte) (uint64, error)
- func (e *EvmClient) GetTxProof(ctx context.Context, _ types.UnitID, txHash sdk.TxHash) (*sdk.Proof, error)
- func (e *EvmClient) PostTransaction(ctx context.Context, tx *types.TransactionOrder) error
- type ProcessingDetails
- type Result
- type TxAttributes
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNotFound is returned when backend responded with 404 status code. ErrNotFound = errors.New("not found") )
Functions ¶
func WeiToAlpha ¶
WeiToAlpha - converts from alpha to wei, assuming 1:1 exchange 1 "alpha" is equal to "1 eth". 1 wei = wei * 10^10 / 10^18
Types ¶
type CallAttributes ¶
type EvmClient ¶
type EvmClient struct {
// contains filtered or unexported fields
}
func New ¶
New creates REST API client for token wallet backend. The "abAddr" is address of the backend, Scheme and Host fields must be assigned.
func (*EvmClient) Call ¶
func (e *EvmClient) Call(ctx context.Context, callAttr *CallAttributes) (*ProcessingDetails, error)
Call execute smart contract tx without storing the result in blockchain. Can be used to simulate tx or to read state.
func (*EvmClient) GetBalance ¶
GetBalance - reads account balance
func (*EvmClient) GetFeeCreditBill ¶
GetFeeCreditBill - simulates fee credit bill on EVM
func (*EvmClient) GetGasPrice ¶
GetGasPrice returns gas price
func (*EvmClient) GetRoundNumber ¶
GetRoundNumber returns node round number
func (*EvmClient) GetTransactionCount ¶
GetTransactionCount reads account nonce
func (*EvmClient) GetTxProof ¶
func (e *EvmClient) GetTxProof(ctx context.Context, _ types.UnitID, txHash sdk.TxHash) (*sdk.Proof, error)
GetTxProof - get transaction proof for tx hash. NB! node must be configured to run with indexer.
func (*EvmClient) PostTransaction ¶
PostTransaction post node transaction
type ProcessingDetails ¶
type Result ¶
type Result struct { Success bool ActualFee uint64 Details *ProcessingDetails }