api

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2026 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EmptyReply

type EmptyReply struct{}

EmptyReply indicates that an api doesn't have a response to return.

type FormattedBlock added in v0.0.2

type FormattedBlock struct {
	Block    string              `json:"block"`
	Encoding formatting.Encoding `json:"encoding"`
}

FormattedBlock defines a JSON formatted struct containing a block in Hex format

type FormattedTx added in v0.0.2

type FormattedTx struct {
	Tx       string              `json:"tx"`
	Encoding formatting.Encoding `json:"encoding"`
}

FormattedTx defines a JSON formatted struct containing a Tx as a string

type GetBlockArgs added in v0.0.2

type GetBlockArgs struct {
	BlockID  ids.ID              `json:"blockID"`
	Encoding formatting.Encoding `json:"encoding"`
}

GetBlockArgs is the parameters supplied to the GetBlock API

type GetBlockByHeightArgs added in v0.0.2

type GetBlockByHeightArgs struct {
	Height   avajson.Uint64      `json:"height"`
	Encoding formatting.Encoding `json:"encoding"`
}

GetBlockByHeightArgs is the parameters supplied to the GetBlockByHeight API

type GetBlockResponse added in v0.0.2

type GetBlockResponse struct {
	Block json.RawMessage `json:"block"`
	// If GetBlockResponse.Encoding is formatting.Hex, GetBlockResponse.Block is
	// the string representation of the block under hex encoding.
	// If GetBlockResponse.Encoding is formatting.JSON, GetBlockResponse.Block
	// is the actual block returned as a JSON.
	Encoding formatting.Encoding `json:"encoding"`
}

GetBlockResponse is the response object for the GetBlock API.

type GetHeightResponse added in v0.0.2

type GetHeightResponse struct {
	Height avajson.Uint64 `json:"height"`
}

type GetTxArgs added in v0.0.2

type GetTxArgs struct {
	TxID     ids.ID              `json:"txID"`
	Encoding formatting.Encoding `json:"encoding"`
}

type GetTxReply added in v0.0.2

type GetTxReply struct {
	// If [GetTxArgs.Encoding] is [Hex], [Tx] is the string representation of
	// the tx under hex encoding.
	// If [GetTxArgs.Encoding] is [JSON], [Tx] is the actual tx, which will be
	// returned as JSON to the caller.
	Tx       json.RawMessage     `json:"tx"`
	Encoding formatting.Encoding `json:"encoding"`
}

GetTxReply defines an object containing a single [Tx] object along with Encoding

type GetUTXOsArgs added in v0.0.2

type GetUTXOsArgs struct {
	Addresses   []string            `json:"addresses"`
	SourceChain string              `json:"sourceChain"`
	Limit       avajson.Uint32      `json:"limit"`
	StartIndex  Index               `json:"startIndex"`
	Encoding    formatting.Encoding `json:"encoding"`
}

GetUTXOsArgs are arguments for passing into GetUTXOs. Gets the UTXOs that reference at least one address in [Addresses]. Returns at most [limit] addresses. If specified, [SourceChain] is the chain where the atomic UTXOs were exported from. If empty, or the Chain ID of this VM is specified, then GetUTXOs fetches the native UTXOs. If [limit] == 0 or > [maxUTXOsToFetch], fetches up to [maxUTXOsToFetch]. [StartIndex] defines where to start fetching UTXOs (for pagination.) UTXOs fetched are from addresses equal to or greater than [StartIndex.Address] For address [StartIndex.Address], only UTXOs with IDs greater than [StartIndex.UTXO] will be returned. If [StartIndex] is omitted, gets all UTXOs. If GetUTXOs is called multiple times, with our without [StartIndex], it is not guaranteed that returned UTXOs are unique. That is, the same UTXO may appear in the response of multiple calls.

type Index added in v0.0.2

type Index struct {
	Address string `json:"address"` // The address as a string
	UTXO    string `json:"utxo"`    // The UTXO ID as a string
}

Index is an address and an associated UTXO. Marks a starting or stopping point when fetching UTXOs. Used for pagination.

type JSONAddress added in v0.0.2

type JSONAddress struct {
	Address string `json:"address"`
}

JSONAddress contains an address

type JSONAddresses added in v0.0.2

type JSONAddresses struct {
	Addresses []string `json:"addresses"`
}

JSONAddresses contains a list of address

type JSONTxID added in v0.0.2

type JSONTxID struct {
	TxID ids.ID `json:"txID"`
}

JSONTxID contains the ID of a transaction

type UserPass added in v0.0.2

type UserPass struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

UserPass contains a username and password

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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