client

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2019 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BytesBase64

type BytesBase64 []byte

BytesBase64 is a base64-encoded binary blob (i.e., []byte), for use with text encodings like JSON.

func (BytesBase64) MarshalText

func (b BytesBase64) MarshalText() (text []byte, err error)

MarshalText implements the encoding.TextMarshaler interface

func (*BytesBase64) UnmarshalText

func (b *BytesBase64) UnmarshalText(text []byte) error

UnmarshalText implements the encoding.TextUnmarshaler interface

type RestClient

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

RestClient manages the REST interface for a calling user.

func MakeRestClient

func MakeRestClient(url url.URL, apiToken string) RestClient

MakeRestClient is the factory for constructing a RestClient for a given endpoint

func (RestClient) AccountInformation

func (client RestClient) AccountInformation(address string) (response v1.Account, err error)

AccountInformation also gets the AccountInformationResponse associated with the passed address

func (RestClient) AssetInformation

func (client RestClient) AssetInformation(index uint64) (response v1.AssetParams, err error)

AssetInformation gets the AssetInformationResponse associated with the passed asset index

func (RestClient) Assets

func (client RestClient) Assets(assetIdx, max uint64) (response v1.AssetList, err error)

Assets gets up to max assets with maximum asset index assetIdx

func (RestClient) Block

func (client RestClient) Block(round uint64) (response v1.Block, err error)

Block gets the block info for the given round

func (RestClient) GetGoRoutines

func (client RestClient) GetGoRoutines(ctx context.Context) (goRoutines string, err error)

GetGoRoutines gets a dump of the goroutines from pprof Not supported

func (RestClient) GetPendingTransactions

func (client RestClient) GetPendingTransactions(maxTxns uint64) (response v1.PendingTransactions, err error)

GetPendingTransactions asks algod for a snapshot of current pending txns on the node, bounded by maxTxns. If maxTxns = 0, fetches as many transactions as possible.

func (RestClient) HealthCheck

func (client RestClient) HealthCheck() error

HealthCheck does a health check on the the potentially running node, returning an error if the API is down

func (RestClient) LedgerSupply

func (client RestClient) LedgerSupply() (response v1.Supply, err error)

LedgerSupply gets the supply details for the specified node's Ledger

func (RestClient) PendingTransactionInformation

func (client RestClient) PendingTransactionInformation(transactionID string) (response v1.Transaction, err error)

PendingTransactionInformation gets information about a recently issued transaction. There are several cases when this might succeed:

- transaction committed (CommittedRound > 0) - transaction still in the pool (CommittedRound = 0, PoolError = "") - transaction removed from pool due to error (CommittedRound = 0, PoolError != "")

Or the transaction may have happened sufficiently long ago that the node no longer remembers it, and this will return an error.

func (RestClient) SendRawTransaction

func (client RestClient) SendRawTransaction(txn transactions.SignedTxn) (response v1.TransactionID, err error)

SendRawTransaction gets a SignedTxn and broadcasts it to the network

func (RestClient) SendRawTransactionBytes added in v0.0.2

func (client RestClient) SendRawTransactionBytes(bytes []byte) (response v1.TransactionID, err error)

func (RestClient) SendRawTransactionGroup

func (client RestClient) SendRawTransactionGroup(txgroup []transactions.SignedTxn) error

SendRawTransactionGroup gets a SignedTxn group and broadcasts it to the network

func (RestClient) Status

func (client RestClient) Status() (response v1.NodeStatus, err error)

Status retrieves the StatusResponse from the running node the StatusResponse includes data like the consensus version and current round Not supported

func (RestClient) StatusAfterBlock

func (client RestClient) StatusAfterBlock(blockNum uint64) (response v1.NodeStatus, err error)

StatusAfterBlock waits for a block to occur then returns the StatusResponse after that block blocks on the node end Not supported

func (RestClient) SuggestedFee

func (client RestClient) SuggestedFee() (response v1.TransactionFee, err error)

SuggestedFee gets the recommended transaction fee from the node

func (RestClient) SuggestedParams

func (client RestClient) SuggestedParams() (response v1.TransactionParams, err error)

SuggestedParams gets the suggested transaction parameters

func (RestClient) TransactionInformation

func (client RestClient) TransactionInformation(accountAddress, transactionID string) (response v1.Transaction, err error)

TransactionInformation gets information about a specific transaction involving a specific account

func (RestClient) TransactionsByAddr

func (client RestClient) TransactionsByAddr(addr string, first, last, max uint64) (response v1.TransactionList, err error)

TransactionsByAddr returns all transactions for a PK [addr] in the [first, last] rounds range.

func (RestClient) Versions

func (client RestClient) Versions() (response common.Version, err error)

Versions retrieves the VersionResponse from the running node the VersionResponse includes data like version number and genesis ID

Jump to

Keyboard shortcuts

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