Documentation ¶
Index ¶
- Constants
- Variables
- func DatastoreEntry(contractAddress string, key []byte) ([]byte, error)
- func GetNodeInfo() (uint64, string, error)
- func NewMassaClient() (*node.Client, error)
- func SendOperation(acc *account.Account, password *memguard.LockedBuffer, ...) (*sendOperation.OperationResponse, error)
- type AccountInfos
- type NetworkInfo
- type NodeFetcher
- func (n *NodeFetcher) AssetExistInNetwork(contractAddress string) bool
- func (n *NodeFetcher) DatastoreAssetBalance(assetContractAddress, userAddress string) (string, error)
- func (n *NodeFetcher) DatastoreAssetDecimals(contractAddress string) (uint8, error)
- func (n *NodeFetcher) DatastoreAssetName(contractAddress string) (string, error)
- func (n *NodeFetcher) DatastoreAssetSymbol(contractAddress string) (string, error)
- func (n *NodeFetcher) GetAccountsInfos(accounts []*account.Account) ([]AccountInfos, error)
- func (n *NodeFetcher) MakeOperation(fee uint64, operation sendOperation.Operation) ([]byte, error)
- func (n *NodeFetcher) MakeRPCCall(msg []byte, signature []byte, publicKey string) ([]string, error)
- type NodeFetcherInterface
Constants ¶
const ( NAME_KEY = "NAME" SYMBOL_KEY = "SYMBOL" DECIMALS_KEY = "DECIMALS" BALANCE_KEY_PREFIX = "BALANCE" )
Variables ¶
var ErrChainIDNotInStatus = errors.New("chain id not in status")
Functions ¶
func DatastoreEntry ¶ added in v0.2.1
DatastoreEntry is a helper function to fetch datastore entry from the Massa node.
func GetNodeInfo ¶ added in v0.3.4
func NewMassaClient ¶ added in v0.2.1
func SendOperation ¶
func SendOperation( acc *account.Account, password *memguard.LockedBuffer, massaClient NodeFetcherInterface, operation sendOperation.Operation, fee uint64, chainID uint64, ) (*sendOperation.OperationResponse, error)
Types ¶
type AccountInfos ¶
type NetworkInfo ¶
type NetworkInfo struct { Network string `json:"network"` URL string `json:"url"` ChainID int `json:"chainId"` }
func GetNetworkInfo ¶
func GetNetworkInfo() (*NetworkInfo, error)
retrieve network info from endpoint
type NodeFetcher ¶
type NodeFetcher struct{}
func NewNodeFetcher ¶
func NewNodeFetcher() *NodeFetcher
func (*NodeFetcher) AssetExistInNetwork ¶ added in v0.2.1
func (n *NodeFetcher) AssetExistInNetwork(contractAddress string) bool
func (*NodeFetcher) DatastoreAssetBalance ¶ added in v0.2.1
func (n *NodeFetcher) DatastoreAssetBalance(assetContractAddress, userAddress string) (string, error)
DatastoreAssetBalance retrieves the balance of a user for a given asset contract address from the Massa node.
func (*NodeFetcher) DatastoreAssetDecimals ¶ added in v0.2.1
func (n *NodeFetcher) DatastoreAssetDecimals(contractAddress string) (uint8, error)
DatastoreAssetDecimals retrieves the asset decimals for a given contract address from the Massa node.
func (*NodeFetcher) DatastoreAssetName ¶ added in v0.2.1
func (n *NodeFetcher) DatastoreAssetName(contractAddress string) (string, error)
DatastoreAssetName retrieves the asset name for a given contract address from the Massa node.
func (*NodeFetcher) DatastoreAssetSymbol ¶ added in v0.2.1
func (n *NodeFetcher) DatastoreAssetSymbol(contractAddress string) (string, error)
DatastoreAssetSymbol retrieves the asset symbol for a given contract address from the Massa node.
func (*NodeFetcher) GetAccountsInfos ¶
func (n *NodeFetcher) GetAccountsInfos(accounts []*account.Account) ([]AccountInfos, error)
func (*NodeFetcher) MakeOperation ¶
func (n *NodeFetcher) MakeOperation(fee uint64, operation sendOperation.Operation) ([]byte, error)
MakeOperation makes a new operation by calling Massa Station source code sendOperation.MakeOperation function.
func (*NodeFetcher) MakeRPCCall ¶
MakeRPCCall makes a new RPC call by calling Massa Station source code sendOperation.MakeRPCCall function.
type NodeFetcherInterface ¶
type NodeFetcherInterface interface { GetAccountsInfos(accounts []*account.Account) ([]AccountInfos, error) MakeOperation(fee uint64, operation sendOperation.Operation) ([]byte, error) MakeRPCCall(msg []byte, signature []byte, publicKey string) ([]string, error) AssetExistInNetwork(contractAddress string) bool DatastoreAssetName(contractAddress string) (string, error) DatastoreAssetSymbol(contractAddress string) (string, error) DatastoreAssetDecimals(contractAddress string) (uint8, error) DatastoreAssetBalance(assetContractAddress, userAddress string) (string, error) }