network

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SendOperation

func SendOperation(wlt *wallet.Wallet, massaClient NodeFetcherInterface, operation sendOperation.Operation, fee uint64) (*sendOperation.OperationResponse, error)

Types

type AccountInfos

type AccountInfos struct {
	Address          string
	CandidateBalance uint64
	Balance          uint64
}

type NetworkInfo

type NetworkInfo struct {
	Network string `json:"network"`
	URL     string `json:"url"`
	DNS     string `json:"dns"`
}

func GetNetworkInfo

func GetNetworkInfo() (*NetworkInfo, error)

retrieve network info from endpoint

type NodeFetcher

type NodeFetcher struct{}

func NewNodeFetcher

func NewNodeFetcher() *NodeFetcher

func (*NodeFetcher) GetAccountsInfos

func (n *NodeFetcher) GetAccountsInfos(wlt []wallet.Wallet) ([]AccountInfos, error)

func (*NodeFetcher) MakeOperation

func (n *NodeFetcher) MakeOperation(fee uint64, operation sendOperation.Operation) ([]byte, error)

MakeOperation makes a new operation by calling Thyra source code sendOperation.MakeOperation function.

func (*NodeFetcher) MakeRPCCall

func (n *NodeFetcher) MakeRPCCall(msg []byte, signature []byte, publicKey string) ([]string, error)

MakeRPCCall makes a new RPC call by calling Thyra source code sendOperation.MakeRPCCall function.

type NodeFetcherInterface

type NodeFetcherInterface interface {
	GetAccountsInfos(wlt []wallet.Wallet) ([]AccountInfos, error)
	MakeOperation(fee uint64, operation sendOperation.Operation) ([]byte, error)
	MakeRPCCall(msg []byte, signature []byte, publicKey string) ([]string, error)
}

Jump to

Keyboard shortcuts

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