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: 8 Imported by: 55

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountApplicationInformation added in v1.14.0

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

AccountApplicationInformation given a specific account public key and application ID, this call returns the account's application local state and global state (AppLocalState and AppParams, if either exists). Global state will only be returned if the provided address is the application's creator.

func (*AccountApplicationInformation) Do added in v1.14.0

Do performs the HTTP request

type AccountApplicationInformationParams added in v1.14.0

type AccountApplicationInformationParams struct {

	// Format configures whether the response object is JSON or MessagePack encoded.
	Format string `url:"format,omitempty"`
}

AccountApplicationInformationParams contains all of the query parameters for url serialization.

type AccountAssetInformation added in v1.14.0

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

AccountAssetInformation given a specific account public key and asset ID, this call returns the account's asset holding and asset parameters (if either exist). Asset parameters will only be returned if the provided address is the asset's creator.

func (*AccountAssetInformation) Do added in v1.14.0

func (s *AccountAssetInformation) Do(ctx context.Context, headers ...*common.Header) (response models.AccountAssetResponse, err error)

Do performs the HTTP request

type AccountAssetInformationParams added in v1.14.0

type AccountAssetInformationParams struct {

	// Format configures whether the response object is JSON or MessagePack encoded.
	Format string `url:"format,omitempty"`
}

AccountAssetInformationParams contains all of the query parameters for url serialization.

type AccountInformation

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

AccountInformation given a specific account public key, this call returns the accounts status, balance and spendable amounts

func (*AccountInformation) Do

func (s *AccountInformation) Do(ctx context.Context, headers ...*common.Header) (response models.Account, err error)

Do performs the HTTP request

func (*AccountInformation) Exclude added in v1.14.0

func (s *AccountInformation) Exclude(Exclude string) *AccountInformation

Exclude when set to `all` will exclude asset holdings, application local state, created asset parameters, any created application parameters. Defaults to `none`.

type AccountInformationParams added in v1.6.0

type AccountInformationParams struct {

	// Exclude when set to `all` will exclude asset holdings, application local state,
	// created asset parameters, any created application parameters. Defaults to
	// `none`.
	Exclude string `url:"exclude,omitempty"`

	// Format configures whether the response object is JSON or MessagePack encoded.
	Format string `url:"format,omitempty"`
}

AccountInformationParams contains all of the query parameters for url serialization.

type Block

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

Block get the block for the given round.

func (*Block) Do

func (s *Block) Do(ctx context.Context, headers ...*common.Header) (result types.Block, err error)

Do performs the HTTP request

type BlockParams added in v1.6.0

type BlockParams struct {

	// Format configures whether the response object is JSON or MessagePack encoded.
	Format string `url:"format,omitempty"`
}

BlockParams contains all of the query parameters for url serialization.

type BlockRaw added in v1.5.1

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

BlockRaw contains metadata required to execute a BlockRaw query.

func (*BlockRaw) Do added in v1.5.1

func (s *BlockRaw) Do(ctx context.Context, headers ...*common.Header) (result []byte, err error)

Do executes the BlockRaw query and gets the results.

type Client

type Client common.Client

func MakeClient

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

MakeClient is the factory for constructing a ClientV2 for a given endpoint.

func MakeClientWithHeaders added in v1.8.0

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

MakeClientWithHeaders is the factory for constructing a ClientV2 for a given endpoint with custom headers.

func (*Client) AccountApplicationInformation added in v1.14.0

func (c *Client) AccountApplicationInformation(address string, applicationId uint64) *AccountApplicationInformation

func (*Client) AccountAssetInformation added in v1.14.0

func (c *Client) AccountAssetInformation(address string, assetId uint64) *AccountAssetInformation

func (*Client) AccountInformation

func (c *Client) AccountInformation(address string) *AccountInformation

func (*Client) Block

func (c *Client) Block(round uint64) *Block

func (*Client) BlockRaw added in v1.5.1

func (c *Client) BlockRaw(round uint64) *BlockRaw

func (*Client) GetApplicationBoxByName added in v1.23.0

func (c *Client) GetApplicationBoxByName(applicationId uint64, name []byte) *GetApplicationBoxByName

func (*Client) GetApplicationBoxes added in v1.23.0

func (c *Client) GetApplicationBoxes(applicationId uint64) *GetApplicationBoxes

func (*Client) GetApplicationByID added in v1.5.0

func (c *Client) GetApplicationByID(applicationId uint64) *GetApplicationByID

func (*Client) GetAssetByID added in v1.5.0

func (c *Client) GetAssetByID(assetId uint64) *GetAssetByID

func (*Client) GetBlockHash added in v1.22.0

func (c *Client) GetBlockHash(round uint64) *GetBlockHash

func (*Client) GetGenesis added in v1.6.0

func (c *Client) GetGenesis() *GetGenesis

func (*Client) GetLightBlockHeaderProof added in v1.20.0

func (c *Client) GetLightBlockHeaderProof(round uint64) *GetLightBlockHeaderProof

func (*Client) GetStateProof added in v1.20.0

func (c *Client) GetStateProof(round uint64) *GetStateProof

func (*Client) GetTransactionProof added in v1.20.0

func (c *Client) GetTransactionProof(round uint64, txid string) *GetTransactionProof

func (*Client) HealthCheck

func (c *Client) HealthCheck() *HealthCheck

func (*Client) PendingTransactionInformation

func (c *Client) PendingTransactionInformation(txid string) *PendingTransactionInformation

func (*Client) PendingTransactions

func (c *Client) PendingTransactions() *PendingTransactions

func (*Client) PendingTransactionsByAddress

func (c *Client) PendingTransactionsByAddress(address string) *PendingTransactionsByAddress

func (*Client) SendRawTransaction

func (c *Client) SendRawTransaction(rawtxn []byte) *SendRawTransaction

func (*Client) Status

func (c *Client) Status() *Status

func (*Client) StatusAfterBlock

func (c *Client) StatusAfterBlock(round uint64) *StatusAfterBlock

func (*Client) SuggestedParams

func (c *Client) SuggestedParams() *SuggestedParams

func (*Client) Supply

func (c *Client) Supply() *Supply

func (*Client) TealCompile added in v1.5.0

func (c *Client) TealCompile(source []byte) *TealCompile

func (*Client) TealDisassemble added in v1.16.0

func (c *Client) TealDisassemble(source []byte) *TealDisassemble

func (*Client) TealDryrun added in v1.5.0

func (c *Client) TealDryrun(request models.DryrunRequest) *TealDryrun

func (*Client) Versions

func (c *Client) Versions() *Versions

type GetApplicationBoxByName added in v1.23.0

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

GetApplicationBoxByName given an application ID and box name, it returns the box name and value (each base64 encoded). Box names must be in the goal app call arg encoding form 'encoding:value'. For ints, use the form 'int:1234'. For raw bytes, use the form 'b64:A=='. For printable strings, use the form 'str:hello'. For addresses, use the form 'addr:XYZ...'.

func (*GetApplicationBoxByName) Do added in v1.23.0

func (s *GetApplicationBoxByName) Do(ctx context.Context, headers ...*common.Header) (response models.Box, err error)

Do performs the HTTP request

type GetApplicationBoxByNameParams added in v1.23.0

type GetApplicationBoxByNameParams struct {

	// Name a box name, in the goal app call arg form 'encoding:value'. For ints, use
	// the form 'int:1234'. For raw bytes, use the form 'b64:A=='. For printable
	// strings, use the form 'str:hello'. For addresses, use the form 'addr:XYZ...'.
	Name string `url:"name,omitempty"`
}

GetApplicationBoxByNameParams contains all of the query parameters for url serialization.

type GetApplicationBoxes added in v1.23.0

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

GetApplicationBoxes given an application ID, return all Box names. No particular ordering is guaranteed. Request fails when client or server-side configured limits prevent returning all Box names.

func (*GetApplicationBoxes) Do added in v1.23.0

func (s *GetApplicationBoxes) Do(ctx context.Context, headers ...*common.Header) (response models.BoxesResponse, err error)

Do performs the HTTP request

func (*GetApplicationBoxes) Max added in v1.23.0

Max max number of box names to return. If max is not set, or max == 0, returns all box-names.

type GetApplicationBoxesParams added in v1.23.0

type GetApplicationBoxesParams struct {

	// Max max number of box names to return. If max is not set, or max == 0, returns
	// all box-names.
	Max uint64 `url:"max,omitempty"`
}

GetApplicationBoxesParams contains all of the query parameters for url serialization.

type GetApplicationByID added in v1.5.0

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

GetApplicationByID given a application ID, it returns application information including creator, approval and clear programs, global and local schemas, and global state.

func (*GetApplicationByID) Do added in v1.5.0

func (s *GetApplicationByID) Do(ctx context.Context, headers ...*common.Header) (response models.Application, err error)

Do performs the HTTP request

type GetAssetByID added in v1.5.0

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

GetAssetByID given a asset ID, it returns asset information including creator, name, total supply and special addresses.

func (*GetAssetByID) Do added in v1.5.0

func (s *GetAssetByID) Do(ctx context.Context, headers ...*common.Header) (response models.Asset, err error)

Do performs the HTTP request

type GetBlockHash added in v1.22.0

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

GetBlockHash get the block hash for the block on the given round.

func (*GetBlockHash) Do added in v1.22.0

func (s *GetBlockHash) Do(ctx context.Context, headers ...*common.Header) (response models.BlockHashResponse, err error)

Do performs the HTTP request

type GetBlockParams added in v1.6.0

type GetBlockParams struct {
	// Return raw msgpack block bytes or json
	Format string `url:"format,omitempty"`
}

GetBlockParams defines parameters for GetBlock.

type GetGenesis added in v1.6.0

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

GetGenesis returns the entire genesis file in json.

func (*GetGenesis) Do added in v1.6.0

func (s *GetGenesis) Do(ctx context.Context, headers ...*common.Header) (response string, err error)

Do performs the HTTP request

type GetLightBlockHeaderProof added in v1.20.0

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

GetLightBlockHeaderProof gets a proof for a given light block header inside a state proof commitment

func (*GetLightBlockHeaderProof) Do added in v1.20.0

func (s *GetLightBlockHeaderProof) Do(ctx context.Context, headers ...*common.Header) (response models.LightBlockHeaderProof, err error)

Do performs the HTTP request

type GetStateProof added in v1.20.0

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

GetStateProof get a state proof that covers a given round

func (*GetStateProof) Do added in v1.20.0

func (s *GetStateProof) Do(ctx context.Context, headers ...*common.Header) (response models.StateProof, err error)

Do performs the HTTP request

type GetTransactionProof added in v1.20.0

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

GetTransactionProof get a proof for a transaction in a block.

func (*GetTransactionProof) Do added in v1.20.0

func (s *GetTransactionProof) Do(ctx context.Context, headers ...*common.Header) (response models.TransactionProofResponse, err error)

Do performs the HTTP request

func (*GetTransactionProof) Hashtype added in v1.20.0

func (s *GetTransactionProof) Hashtype(Hashtype string) *GetTransactionProof

Hashtype the type of hash function used to create the proof, must be one of: * sha512_256 * sha256

type GetTransactionProofParams added in v1.20.0

type GetTransactionProofParams struct {

	// Format configures whether the response object is JSON or MessagePack encoded.
	Format string `url:"format,omitempty"`

	// Hashtype the type of hash function used to create the proof, must be one of:
	// * sha512_256
	// * sha256
	Hashtype string `url:"hashtype,omitempty"`
}

GetTransactionProofParams contains all of the query parameters for url serialization.

type HealthCheck

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

HealthCheck returns OK if healthy.

func (*HealthCheck) Do

func (s *HealthCheck) Do(ctx context.Context, headers ...*common.Header) error

Do performs the HTTP request

type PendingTransactionInformation

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

PendingTransactionInformation given a transaction ID of a recently submitted transaction, it returns information about it. There are several cases when this might succeed: - transaction committed (committed round > 0) - transaction still in the pool (committed round = 0, pool error = "") - transaction removed from pool due to error (committed round = 0, pool error != "") Or the transaction may have happened sufficiently long ago that the node no longer remembers it, and this will return an error.

func (*PendingTransactionInformation) Do

Do performs the HTTP request

type PendingTransactionInformationParams added in v1.6.0

type PendingTransactionInformationParams struct {

	// Format configures whether the response object is JSON or MessagePack encoded.
	Format string `url:"format,omitempty"`
}

PendingTransactionInformationParams contains all of the query parameters for url serialization.

type PendingTransactions

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

PendingTransactions get the list of pending transactions, sorted by priority, in decreasing order, truncated at the end at MAX. If MAX = 0, returns all pending transactions.

func (*PendingTransactions) Do

func (s *PendingTransactions) Do(ctx context.Context, headers ...*common.Header) (total uint64, topTransactions []types.SignedTxn, err error)

Do performs the HTTP request

func (*PendingTransactions) Max

Max truncated number of transactions to display. If max=0, returns all pending txns.

type PendingTransactionsByAddress added in v1.6.0

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

PendingTransactionsByAddress get the list of pending transactions by address, sorted by priority, in decreasing order, truncated at the end at MAX. If MAX = 0, returns all pending transactions.

func (*PendingTransactionsByAddress) Do added in v1.6.0

func (s *PendingTransactionsByAddress) Do(ctx context.Context, headers ...*common.Header) (total uint64, topTransactions []types.SignedTxn, err error)

Do performs the HTTP request

func (*PendingTransactionsByAddress) Max added in v1.6.0

Max truncated number of transactions to display. If max=0, returns all pending txns.

type PendingTransactionsByAddressParams added in v1.6.0

type PendingTransactionsByAddressParams struct {

	// Format configures whether the response object is JSON or MessagePack encoded.
	Format string `url:"format,omitempty"`

	// Max truncated number of transactions to display. If max=0, returns all pending
	// txns.
	Max uint64 `url:"max,omitempty"`
}

PendingTransactionsByAddressParams contains all of the query parameters for url serialization.

type PendingTransactionsParams added in v1.6.0

type PendingTransactionsParams struct {

	// Format configures whether the response object is JSON or MessagePack encoded.
	Format string `url:"format,omitempty"`

	// Max truncated number of transactions to display. If max=0, returns all pending
	// txns.
	Max uint64 `url:"max,omitempty"`
}

PendingTransactionsParams contains all of the query parameters for url serialization.

type SendRawTransaction

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

SendRawTransaction broadcasts a raw transaction to the network.

func (*SendRawTransaction) Do

func (s *SendRawTransaction) Do(ctx context.Context, headers ...*common.Header) (txid string, err error)

Do performs the HTTP request

type Status

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

Status gets the current node status.

func (*Status) Do

func (s *Status) Do(ctx context.Context, headers ...*common.Header) (response models.NodeStatus, err error)

Do performs the HTTP request

type StatusAfterBlock

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

StatusAfterBlock waits for a block to appear after round {round} and returns the node's status at the time.

func (*StatusAfterBlock) Do

func (s *StatusAfterBlock) Do(ctx context.Context, headers ...*common.Header) (response models.NodeStatus, err error)

Do performs the HTTP request

type SuggestedParams

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

SuggestedParams get parameters for constructing a new transaction

func (*SuggestedParams) Do

func (s *SuggestedParams) Do(ctx context.Context, headers ...*common.Header) (params types.SuggestedParams, err error)

Do performs the HTTP request

type Supply

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

Supply get the current supply reported by the ledger.

func (*Supply) Do

func (s *Supply) Do(ctx context.Context, headers ...*common.Header) (response models.Supply, err error)

Do performs the HTTP request

type TealCompile added in v1.5.0

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

TealCompile given TEAL source code in plain text, return base64 encoded program bytes and base32 SHA512_256 hash of program bytes (Address style). This endpoint is only enabled when a node's configuration file sets EnableDeveloperAPI to true.

func (*TealCompile) Do added in v1.5.0

func (s *TealCompile) Do(ctx context.Context, headers ...*common.Header) (response models.CompileResponse, err error)

Do performs the HTTP request

func (*TealCompile) Sourcemap added in v1.16.0

func (s *TealCompile) Sourcemap(Sourcemap bool) *TealCompile

Sourcemap when set to `true`, returns the source map of the program as a JSON. Defaults to `false`.

type TealCompileParams added in v1.16.0

type TealCompileParams struct {

	// Sourcemap when set to `true`, returns the source map of the program as a JSON.
	// Defaults to `false`.
	Sourcemap bool `url:"sourcemap,omitempty"`
}

TealCompileParams contains all of the query parameters for url serialization.

type TealDisassemble added in v1.16.0

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

TealDisassemble given the program bytes, return the TEAL source code in plain text. This endpoint is only enabled when a node's configuration file sets EnableDeveloperAPI to true.

func (*TealDisassemble) Do added in v1.16.0

func (s *TealDisassemble) Do(ctx context.Context, headers ...*common.Header) (response models.DisassembleResponse, err error)

Do performs the HTTP request

type TealDryRun added in v1.5.0

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

TealDryRun /v2/teal/dryrun

func (*TealDryRun) Do added in v1.5.0

func (s *TealDryRun) Do(
	ctx context.Context,
	headers ...*common.Header,
) (response models.DryrunResponse, err error)

Do performs HTTP request

type TealDryrun added in v1.5.0

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

TealDryrun executes TEAL program(s) in context and returns debugging information about the execution. This endpoint is only enabled when a node's configuration file sets EnableDeveloperAPI to true.

func (*TealDryrun) Do added in v1.5.0

func (s *TealDryrun) Do(ctx context.Context, headers ...*common.Header) (response models.DryrunResponse, err error)

Do performs the HTTP request

type Versions

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

Versions retrieves the supported API versions, binary build versions, and genesis information.

func (*Versions) Do

func (s *Versions) Do(ctx context.Context, headers ...*common.Header) (response models.Version, err error)

Do performs the HTTP request

Jump to

Keyboard shortcuts

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