Documentation ¶
Index ¶
- type APIVersion
- type Blob
- type BytesBase64
- type RestClient
- func (client RestClient) AbortCatchup(catchpointLabel string) (response privateV2.CatchpointAbortResponse, err error)
- func (client RestClient) AccountInformation(address string) (response v1.Account, err error)
- func (client RestClient) AccountInformationV2(address string) (response generatedV2.Account, err error)
- func (client RestClient) ApplicationInformation(index uint64) (response generatedV2.Application, err error)
- func (client RestClient) AssetInformation(index uint64) (response v1.AssetParams, err error)
- func (client RestClient) AssetInformationV2(index uint64) (response generatedV2.Asset, err error)
- func (client RestClient) Assets(assetIdx, max uint64) (response v1.AssetList, err error)
- func (client RestClient) Block(round uint64) (response v1.Block, err error)
- func (client RestClient) Catchup(catchpointLabel string) (response privateV2.CatchpointStartResponse, err error)
- func (client RestClient) Compile(program []byte) (compiledProgram []byte, programHash crypto.Digest, err error)
- func (client RestClient) GetGoRoutines(ctx context.Context) (goRoutines string, err error)
- func (client RestClient) GetPendingTransactions(maxTxns uint64) (response v1.PendingTransactions, err error)
- func (client RestClient) HealthCheck() error
- func (client RestClient) LedgerSupply() (response v1.Supply, err error)
- func (client RestClient) PendingTransactionInformation(transactionID string) (response v1.Transaction, err error)
- func (client RestClient) Proof(txid string, round uint64) (response generatedV2.ProofResponse, err error)
- func (client RestClient) RawAccountInformationV2(address string) (response []byte, err error)
- func (client RestClient) RawBlock(round uint64) (response []byte, err error)
- func (client RestClient) RawDryrun(data []byte) (response []byte, err error)
- func (client RestClient) SendRawTransaction(txn transactions.SignedTxn) (response v1.TransactionID, err error)
- func (client RestClient) SendRawTransactionGroup(txgroup []transactions.SignedTxn) error
- func (client *RestClient) SetAPIVersionAffinity(affinity APIVersion) (previousAffinity APIVersion)
- func (client RestClient) Shutdown() (err error)
- func (client RestClient) Status() (response generatedV2.NodeStatusResponse, err error)
- func (client RestClient) StatusAfterBlock(blockNum uint64) (response generatedV2.NodeStatusResponse, err error)
- func (client RestClient) SuggestedFee() (response v1.TransactionFee, err error)
- func (client RestClient) SuggestedParams() (response v1.TransactionParams, err error)
- func (client RestClient) TransactionInformation(accountAddress, transactionID string) (response v1.Transaction, err error)
- func (client RestClient) TransactionsByAddr(addr string, first, last, max uint64) (response v1.TransactionList, err error)
- func (client RestClient) Versions() (response common.Version, err error)
- func (client RestClient) WaitForBlock(round basics.Round) (response generatedV2.NodeStatusResponse, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIVersion ¶
type APIVersion string
APIVersion is used to define which server side API version would be used when making http requests to the server
const ( // APIVersionV1 suggests that the RestClient would use v1 calls whenever it's available for the given request. APIVersionV1 APIVersion = "v1" // APIVersionV2 suggests that the RestClient would use v2 calls whenever it's available for the given request. APIVersionV2 APIVersion = "v2" )
type Blob ¶
type Blob []byte
Blob represents arbitrary blob of data satisfying v1.RawResponse interface
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) AbortCatchup ¶
func (client RestClient) AbortCatchup(catchpointLabel string) (response privateV2.CatchpointAbortResponse, err error)
AbortCatchup aborts the currently running catchup
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) AccountInformationV2 ¶
func (client RestClient) AccountInformationV2(address string) (response generatedV2.Account, err error)
AccountInformationV2 gets the AccountData associated with the passed address
func (RestClient) ApplicationInformation ¶
func (client RestClient) ApplicationInformation(index uint64) (response generatedV2.Application, err error)
ApplicationInformation gets the ApplicationInformationResponse associated with the passed application index
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) AssetInformationV2 ¶
func (client RestClient) AssetInformationV2(index uint64) (response generatedV2.Asset, err error)
AssetInformationV2 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) Catchup ¶
func (client RestClient) Catchup(catchpointLabel string) (response privateV2.CatchpointStartResponse, err error)
Catchup start catching up to the give catchpoint label
func (RestClient) Compile ¶
func (client RestClient) Compile(program []byte) (compiledProgram []byte, programHash crypto.Digest, err error)
Compile compiles the given program and returned the compiled program
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) Proof ¶
func (client RestClient) Proof(txid string, round uint64) (response generatedV2.ProofResponse, err error)
Proof gets a Merkle proof for a transaction in a block.
func (RestClient) RawAccountInformationV2 ¶
func (client RestClient) RawAccountInformationV2(address string) (response []byte, err error)
RawAccountInformationV2 gets the raw AccountData associated with the passed address
func (RestClient) RawBlock ¶
func (client RestClient) RawBlock(round uint64) (response []byte, err error)
RawBlock gets the encoded, raw msgpack block for the given round
func (RestClient) RawDryrun ¶
func (client RestClient) RawDryrun(data []byte) (response []byte, err error)
RawDryrun gets the raw DryrunResponse associated with the passed address
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) SendRawTransactionGroup ¶
func (client RestClient) SendRawTransactionGroup(txgroup []transactions.SignedTxn) error
SendRawTransactionGroup gets a SignedTxn group and broadcasts it to the network
func (*RestClient) SetAPIVersionAffinity ¶
func (client *RestClient) SetAPIVersionAffinity(affinity APIVersion) (previousAffinity APIVersion)
SetAPIVersionAffinity sets the client affinity to use a specific version of the API
func (RestClient) Shutdown ¶
func (client RestClient) Shutdown() (err error)
Shutdown requests the node to shut itself down
func (RestClient) Status ¶
func (client RestClient) Status() (response generatedV2.NodeStatusResponse, 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 generatedV2.NodeStatusResponse, 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
func (RestClient) WaitForBlock ¶
func (client RestClient) WaitForBlock(round basics.Round) (response generatedV2.NodeStatusResponse, err error)
WaitForBlock returns the node status after waiting for the given round.