algod

package
v1.24.0 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2022 License: MIT Imports: 13 Imported by: 21

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client manages the REST interface for a calling user. Deprecated: v1 algod client is deprecated, please use the v2 algod client.

func MakeClient

func MakeClient(address string, apiToken string) (c Client, err error)

MakeClient is the factory for constructing a Client for a given endpoint. Deprecated: v1 algod client is deprecated, please use the v2 algod client.

func MakeClientWithHeaders

func MakeClientWithHeaders(address string, apiToken string, headers []*Header) (c Client, err error)

MakeClientWithHeaders is the factory for constructing a Client for a given endpoint with additional user defined headers. Deprecated: v1 algod client is deprecated, please use the v2 algod client.

func (Client) AccountInformation

func (client Client) AccountInformation(address string, headers ...*Header) (response models.Account, err error)

AccountInformation also gets the AccountInformationResponse associated with the passed address Deprecated: v1 algod client is deprecated, please use the v2 algod client.

func (Client) AssetInformation

func (client Client) AssetInformation(index uint64, headers ...*Header) (response models.AssetParams, err error)

AssetInformation also gets the AssetInformationResponse associated with the passed asset creator and index Deprecated: v1 algod client is deprecated, please use the v2 algod client.

func (Client) Block

func (client Client) Block(round uint64, headers ...*Header) (response models.Block, err error)

Block gets the block info for the given round Deprecated: v1 algod client is deprecated, please use the v2 algod client.

func (Client) BlockRaw added in v1.3.0

func (client Client) BlockRaw(round uint64, headers ...*Header) (blockbytes []byte, err error)

BlockRaw gets the raw block msgpack bytes for the given round Deprecated: v1 algod client is deprecated, please use the v2 algod client.

func (Client) BuildSuggestedParams added in v1.3.0

func (client Client) BuildSuggestedParams(headers ...*Header) (response types.SuggestedParams, err error)

BuildSuggestedParams gets the suggested transaction parameters and builds a types.SuggestedParams to pass to transaction builders (see package future) Deprecated: v1 algod client is deprecated, please use the v2 algod client.

func (Client) GetPendingTransactions

func (client Client) GetPendingTransactions(maxTxns uint64, headers ...*Header) (response models.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. Deprecated: v1 algod client is deprecated, please use the v2 algod client.

func (Client) HealthCheck

func (client Client) HealthCheck(headers ...*Header) error

HealthCheck does a health check on the the potentially running node, returning an error if the API is down Deprecated: v1 algod client is deprecated, please use the v2 algod client.

func (Client) LedgerSupply

func (client Client) LedgerSupply(headers ...*Header) (response models.Supply, err error)

LedgerSupply gets the supply details for the specified node's Ledger Deprecated: v1 algod client is deprecated, please use the v2 algod client.

func (Client) PendingTransactionInformation

func (client Client) PendingTransactionInformation(transactionID string, headers ...*Header) (response models.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. Deprecated: v1 algod client is deprecated, please use the v2 algod client.

func (Client) RawRequest added in v1.5.0

func (client Client) RawRequest(path string, request interface{}, requestMethod string, encodeJSON bool, headers []*Header) (
	v map[string]interface{}, err error)

RawRequest submits the requests, and returns a map of the response fields Deprecated: v1 algod client is deprecated, please use the v2 algod client.

func (Client) SendRawTransaction

func (client Client) SendRawTransaction(stx []byte, headers ...*Header) (response models.TransactionID, err error)

SendRawTransaction gets the bytes of a SignedTxn and broadcasts it to the network Deprecated: v1 algod client is deprecated, please use the v2 algod client.

func (Client) Status

func (client Client) Status(headers ...*Header) (response models.NodeStatus, err error)

Status retrieves the StatusResponse from the running node the StatusResponse includes data like the consensus version and current round Deprecated: v1 algod client is deprecated, please use the v2 algod client.

func (Client) StatusAfterBlock

func (client Client) StatusAfterBlock(blockNum uint64, headers ...*Header) (response models.NodeStatus, err error)

StatusAfterBlock waits for a block to occur then returns the StatusResponse after that block blocks on the node end Deprecated: v1 algod client is deprecated, please use the v2 algod client.

func (Client) SuggestedFee

func (client Client) SuggestedFee(headers ...*Header) (response models.TransactionFee, err error)

SuggestedFee gets the recommended transaction fee from the node Deprecated: v1 algod client is deprecated, please use the v2 algod client.

func (Client) SuggestedParams

func (client Client) SuggestedParams(headers ...*Header) (response models.TransactionParams, err error)

SuggestedParams gets the suggested transaction parameters Deprecated: v1 algod client is deprecated, please use the v2 algod client.

func (Client) TransactionByID

func (client Client) TransactionByID(transactionID string, headers ...*Header) (response models.Transaction, err error)

TransactionByID gets a transaction by its ID. Works only if the indexer is enabled on the node being queried. Deprecated: v1 algod client is deprecated, please use the v2 algod client.

func (Client) TransactionInformation

func (client Client) TransactionInformation(accountAddress, transactionID string, headers ...*Header) (response models.Transaction, err error)

TransactionInformation gets information about a specific transaction involving a specific account it will only return information about transactions submitted to the node queried Deprecated: v1 algod client is deprecated, please use the v2 algod client.

func (Client) TransactionsByAddr

func (client Client) TransactionsByAddr(addr string, first, last uint64, headers ...*Header) (response models.TransactionList, err error)

TransactionsByAddr returns all transactions for a PK [addr] in the [first, last] rounds range. Deprecated: v1 algod client is deprecated, please use the v2 algod client.

func (Client) TransactionsByAddrForDate

func (client Client) TransactionsByAddrForDate(addr string, first, last string, headers ...*Header) (response models.TransactionList, err error)

TransactionsByAddrForDate returns all transactions for a PK [addr] in the [first, last] date range. Dates are of the form "2006-01-02". Deprecated: v1 algod client is deprecated, please use the v2 algod client.

func (Client) TransactionsByAddrLimit

func (client Client) TransactionsByAddrLimit(addr string, limit uint64, headers ...*Header) (response models.TransactionList, err error)

TransactionsByAddrLimit returns the last [limit] number of transaction for a PK [addr]. Deprecated: v1 algod client is deprecated, please use the v2 algod client.

func (Client) Versions

func (client Client) Versions(headers ...*Header) (response models.Version, err error)

Versions retrieves the VersionResponse from the running node the VersionResponse includes data like version number and genesis ID Deprecated: v1 algod client is deprecated, please use the v2 algod client.

type Header struct {
	Key   string
	Value string
}

Header is a struct for custom headers. Deprecated: v1 algod client is deprecated, please use the v2 algod client.

Directories

Path Synopsis
Package models defines models used by an algod rest client// IF YOU MODIFY THIS FILE: IMPORTANT In practice, this is straight up copied from /v1/models/model.go.
Package models defines models used by an algod rest client// IF YOU MODIFY THIS FILE: IMPORTANT In practice, this is straight up copied from /v1/models/model.go.

Jump to

Keyboard shortcuts

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