controllers

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBaseController

func NewBaseController(cbl CallBuilderLogger) *baseController

NewBaseController creates a new instance of baseController. It takes a callBuilderFactory as a parameter and returns a pointer to the baseController.

Types

type AccountsController

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

AccountsController represents a controller struct.

func NewAccountsController

func NewAccountsController(baseController baseController) *AccountsController

NewAccountsController creates a new instance of AccountsController. It takes a baseController as a parameter and returns a pointer to the AccountsController.

func (*AccountsController) GetAccountAssets

func (a *AccountsController) GetAccountAssets(
	ctx context.Context,
	principal string,
	limit *int,
	offset *int,
	unanchored *bool,
	untilBlock *string) (
	models.ApiResponse[models.AddressAssetsListResponse],
	error)

GetAccountAssets takes context, principal, limit, offset, unanchored, untilBlock as parameters and returns an models.ApiResponse with models.AddressAssetsListResponse data and an error if there was an issue with the request or response. Retrieves a list of all assets events associated with an account or a Contract Identifier. This includes Transfers, Mints.

func (*AccountsController) GetAccountBalance

func (a *AccountsController) GetAccountBalance(
	ctx context.Context,
	principal string,
	unanchored *bool,
	untilBlock *string) (
	models.ApiResponse[models.AddressBalanceResponse],
	error)

GetAccountBalance takes context, principal, unanchored, untilBlock as parameters and returns an models.ApiResponse with models.AddressBalanceResponse data and an error if there was an issue with the request or response. Retrieves total account balance information for a given Address or Contract Identifier. This includes the balances of STX Tokens, Fungible Tokens and Non-Fungible Tokens for the account.

func (*AccountsController) GetAccountInbound

func (a *AccountsController) GetAccountInbound(
	ctx context.Context,
	principal string,
	limit *int,
	offset *int,
	height *float64,
	unanchored *bool,
	untilBlock *string) (
	models.ApiResponse[models.AddressStxInboundListResponse],
	error)

GetAccountInbound takes context, principal, limit, offset, height, unanchored, untilBlock as parameters and returns an models.ApiResponse with models.AddressStxInboundListResponse data and an error if there was an issue with the request or response. Retrieves a list of STX transfers with memos to the given principal. This includes regular transfers from a stx-transfer transaction type, and transfers from contract-call transactions a the `send-many-memo` bulk sending contract.

func (*AccountsController) GetAccountInfo

func (a *AccountsController) GetAccountInfo(
	ctx context.Context,
	principal string,
	proof *int,
	tip *string) (
	models.ApiResponse[models.AccountDataResponse],
	error)

GetAccountInfo takes context, principal, proof, tip as parameters and returns an models.ApiResponse with models.AccountDataResponse data and an error if there was an issue with the request or response. Retrieves the account data for a given Account or a Contract Identifier Where balance is the hex encoding of a unsigned 128-bit integer (big-endian), nonce is an unsigned 64-bit integer, and the proofs are provided as hex strings. For non-existent accounts, this does not return a 404 error, rather it returns an object with balance and nonce of 0.

func (*AccountsController) GetAccountNonces

func (a *AccountsController) GetAccountNonces(
	ctx context.Context,
	principal string,
	blockHeight *float64,
	blockHash *string) (
	models.ApiResponse[models.AddressNonces],
	error)

GetAccountNonces takes context, principal, blockHeight, blockHash as parameters and returns an models.ApiResponse with models.AddressNonces data and an error if there was an issue with the request or response. Retrieves the latest nonce values used by an account by inspecting the mempool, microblock transactions, and anchored transactions.

func (*AccountsController) GetAccountStxBalance

func (a *AccountsController) GetAccountStxBalance(
	ctx context.Context,
	principal string,
	unanchored *bool,
	untilBlock *string) (
	models.ApiResponse[models.AddressStxBalanceResponse],
	error)

GetAccountStxBalance takes context, principal, unanchored, untilBlock as parameters and returns an models.ApiResponse with models.AddressStxBalanceResponse data and an error if there was an issue with the request or response. Retrieves STX token balance for a given Address or Contract Identifier.

func (*AccountsController) GetAccountTransactions

func (a *AccountsController) GetAccountTransactions(
	ctx context.Context,
	principal string,
	limit *int,
	offset *int,
	height *float64,
	unanchored *bool,
	untilBlock *string) (
	models.ApiResponse[models.AddressTransactionsListResponse],
	error)

GetAccountTransactions takes context, principal, limit, offset, height, unanchored, untilBlock as parameters and returns an models.ApiResponse with models.AddressTransactionsListResponse data and an error if there was an issue with the request or response. Retrieves a list of all Transactions for a given Address or Contract Identifier. More information on Transaction types can be found [here](https://docs.stacks.co/understand-stacks/transactions#types). If you need to actively monitor new transactions for an address or contract id, we highly recommend subscribing to [WebSockets or Socket.io](https://github.com/hirosystems/stacks-blockchain-api/tree/master/client) for real-time updates.

func (*AccountsController) GetAccountTransactionsWithTransfers

func (a *AccountsController) GetAccountTransactionsWithTransfers(
	ctx context.Context,
	principal string,
	limit *int,
	offset *int,
	height *float64,
	unanchored *bool,
	untilBlock *string) (
	models.ApiResponse[models.AddressTransactionsWithTransfersListResponse],
	error)

GetAccountTransactionsWithTransfers takes context, principal, limit, offset, height, unanchored, untilBlock as parameters and returns an models.ApiResponse with models.AddressTransactionsWithTransfersListResponse data and an error if there was an issue with the request or response. Retrieve all transactions for an account or contract identifier including STX transfers for each transaction.

func (*AccountsController) GetSingleTransactionWithTransfers

func (a *AccountsController) GetSingleTransactionWithTransfers(
	ctx context.Context,
	principal string,
	txId string) (
	models.ApiResponse[models.AddressTransactionWithTransfers],
	error)

GetSingleTransactionWithTransfers takes context, principal, txId as parameters and returns an models.ApiResponse with models.AddressTransactionWithTransfers data and an error if there was an issue with the request or response. Retrieves transaction details for a given Transaction Id `tx_id`, for a given account or contract Identifier.

func (AccountsController) LogCallAsJSON

func (bc AccountsController) LogCallAsJSON(req https.CallBuilder, path string) (*json.Decoder, *http.Response, error)

func (AccountsController) LogCallAsText

func (bc AccountsController) LogCallAsText(req https.CallBuilder, path string) (string, *http.Response, error)

type BlocksController

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

BlocksController represents a controller struct.

func NewBlocksController

func NewBlocksController(baseController baseController) *BlocksController

NewBlocksController creates a new instance of BlocksController. It takes a baseController as a parameter and returns a pointer to the BlocksController.

func (*BlocksController) GetBlock

func (b *BlocksController) GetBlock(
	ctx context.Context,
	heightOrHash interface{}) (
	models.ApiResponse[models.NakamotoBlock],
	error)

GetBlock takes context, heightOrHash as parameters and returns an models.ApiResponse with models.NakamotoBlock data and an error if there was an issue with the request or response. Retrieves a single block

func (*BlocksController) GetBlockByBurnBlockHash

func (b *BlocksController) GetBlockByBurnBlockHash(
	ctx context.Context,
	burnBlockHash string) (
	models.ApiResponse[models.Block],
	error)

GetBlockByBurnBlockHash takes context, burnBlockHash as parameters and returns an models.ApiResponse with models.Block data and an error if there was an issue with the request or response. Deprecated: get_block_by_burn_block_hash is deprecated **NOTE:** This endpoint is deprecated in favor of [Get blocks](#operation/get_blocks). Retrieves block details of a specific block for a given burnchain block hash

func (*BlocksController) GetBlockByBurnBlockHeight

func (b *BlocksController) GetBlockByBurnBlockHeight(
	ctx context.Context,
	burnBlockHeight float64) (
	models.ApiResponse[models.Block],
	error)

GetBlockByBurnBlockHeight takes context, burnBlockHeight as parameters and returns an models.ApiResponse with models.Block data and an error if there was an issue with the request or response. Deprecated: get_block_by_burn_block_height is deprecated **NOTE:** This endpoint is deprecated in favor of [Get blocks](#operation/get_blocks). Retrieves block details of a specific block for a given burn chain height

func (*BlocksController) GetBlockByHash

func (b *BlocksController) GetBlockByHash(
	ctx context.Context,
	hash string) (
	models.ApiResponse[models.Block],
	error)

GetBlockByHash takes context, hash as parameters and returns an models.ApiResponse with models.Block data and an error if there was an issue with the request or response. Deprecated: get_block_by_hash is deprecated **NOTE:** This endpoint is deprecated in favor of [Get block](#operation/get_block). Retrieves block details of a specific block for a given chain height. You can use the hash from your latest block ('get_block_list' API) to get your block details.

func (*BlocksController) GetBlockByHeight

func (b *BlocksController) GetBlockByHeight(
	ctx context.Context,
	height float64) (
	models.ApiResponse[models.Block],
	error)

GetBlockByHeight takes context, height as parameters and returns an models.ApiResponse with models.Block data and an error if there was an issue with the request or response. Deprecated: get_block_by_height is deprecated **NOTE:** This endpoint is deprecated in favor of [Get block](#operation/get_block). Retrieves block details of a specific block at a given block height

func (*BlocksController) GetBlockList

func (b *BlocksController) GetBlockList(
	ctx context.Context,
	limit *int,
	offset *int) (
	models.ApiResponse[models.BlockListResponse],
	error)

GetBlockList takes context, limit, offset as parameters and returns an models.ApiResponse with models.BlockListResponse data and an error if there was an issue with the request or response. Deprecated: get_block_list is deprecated **NOTE:** This endpoint is deprecated in favor of [Get blocks](#operation/get_blocks). Retrieves a list of recently mined blocks If you need to actively monitor new blocks, we highly recommend subscribing to [WebSockets or Socket.io](https://github.com/hirosystems/stacks-blockchain-api/tree/master/client) for real-time updates.

func (*BlocksController) GetBlocks

GetBlocks takes context, limit, offset as parameters and returns an models.ApiResponse with models.NakamotoBlockListResponse data and an error if there was an issue with the request or response. Retrieves a list of recently mined blocks

func (*BlocksController) GetBlocksByBurnBlock

func (b *BlocksController) GetBlocksByBurnBlock(
	ctx context.Context,
	heightOrHash interface{},
	limit *int,
	offset *int) (
	models.ApiResponse[models.NakamotoBlockListResponse],
	error)

GetBlocksByBurnBlock takes context, heightOrHash, limit, offset as parameters and returns an models.ApiResponse with models.NakamotoBlockListResponse data and an error if there was an issue with the request or response. Retrieves a list of blocks confirmed by a specific burn block

func (BlocksController) LogCallAsJSON

func (bc BlocksController) LogCallAsJSON(req https.CallBuilder, path string) (*json.Decoder, *http.Response, error)

func (BlocksController) LogCallAsText

func (bc BlocksController) LogCallAsText(req https.CallBuilder, path string) (string, *http.Response, error)

type BurnBlocksController

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

BurnBlocksController represents a controller struct.

func NewBurnBlocksController

func NewBurnBlocksController(baseController baseController) *BurnBlocksController

NewBurnBlocksController creates a new instance of BurnBlocksController. It takes a baseController as a parameter and returns a pointer to the BurnBlocksController.

func (*BurnBlocksController) GetBurnBlock

func (b *BurnBlocksController) GetBurnBlock(
	ctx context.Context,
	heightOrHash interface{}) (
	models.ApiResponse[models.BurnBlock],
	error)

GetBurnBlock takes context, heightOrHash as parameters and returns an models.ApiResponse with models.BurnBlock data and an error if there was an issue with the request or response. Retrieves a single burn block

func (*BurnBlocksController) GetBurnBlocks

func (b *BurnBlocksController) GetBurnBlocks(
	ctx context.Context,
	limit *int,
	offset *int) (
	models.ApiResponse[models.BurnBlockListResponse],
	error)

GetBurnBlocks takes context, limit, offset as parameters and returns an models.ApiResponse with models.BurnBlockListResponse data and an error if there was an issue with the request or response. Retrieves a list of recent burn blocks

func (BurnBlocksController) LogCallAsJSON

func (bc BurnBlocksController) LogCallAsJSON(req https.CallBuilder, path string) (*json.Decoder, *http.Response, error)

func (BurnBlocksController) LogCallAsText

func (bc BurnBlocksController) LogCallAsText(req https.CallBuilder, path string) (string, *http.Response, error)

type CallBuilderLogger

type CallBuilderLogger struct {
	Cb     callBuilderFactory
	Logger *logger.Logger
}

type FaucetsController

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

FaucetsController represents a controller struct.

func NewFaucetsController

func NewFaucetsController(baseController baseController) *FaucetsController

NewFaucetsController creates a new instance of FaucetsController. It takes a baseController as a parameter and returns a pointer to the FaucetsController.

func (FaucetsController) LogCallAsJSON

func (bc FaucetsController) LogCallAsJSON(req https.CallBuilder, path string) (*json.Decoder, *http.Response, error)

func (FaucetsController) LogCallAsText

func (bc FaucetsController) LogCallAsText(req https.CallBuilder, path string) (string, *http.Response, error)

func (*FaucetsController) RunFaucetBtc

RunFaucetBtc takes context, address, body as parameters and returns an models.ApiResponse with models.RunFaucetResponse data and an error if there was an issue with the request or response. Add 1 BTC token to the specified testnet BTC address. The endpoint returns the transaction ID, which you can use to view the transaction in a testnet Bitcoin block explorer. The tokens are delivered once the transaction has been included in a block. **Note:** This is a testnet only endpoint. This endpoint will not work on the mainnet.

func (*FaucetsController) RunFaucetStx

func (f *FaucetsController) RunFaucetStx(
	ctx context.Context,
	address string,
	stacking *bool) (
	models.ApiResponse[models.RunFaucetResponse],
	error)

RunFaucetStx takes context, address, stacking as parameters and returns an models.ApiResponse with models.RunFaucetResponse data and an error if there was an issue with the request or response. Add 500 STX tokens to the specified testnet address. Testnet STX addresses begin with `ST`. If the `stacking` parameter is set to `true`, the faucet will add the required number of tokens for individual stacking to the specified testnet address. The endpoint returns the transaction ID, which you can use to view the transaction in the [Stacks Explorer](https://explorer.hiro.so/?chain=testnet). The tokens are delivered once the transaction has been included in an anchor block. A common reason for failed faucet transactions is that the faucet has run out of tokens. If you are experiencing failed faucet transactions to a testnet address, you can get help in [Discord](https://stacks.chat). **Note:** This is a testnet only endpoint. This endpoint will not work on the mainnet.

type FeesController

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

FeesController represents a controller struct.

func NewFeesController

func NewFeesController(baseController baseController) *FeesController

NewFeesController creates a new instance of FeesController. It takes a baseController as a parameter and returns a pointer to the FeesController.

func (*FeesController) FetchFeeRate

FetchFeeRate takes context, body as parameters and returns an models.ApiResponse with models.FeeRate data and an error if there was an issue with the request or response. Deprecated: fetch_fee_rate is deprecated **NOTE:** This endpoint is deprecated in favor of [Get approximate fees for a given transaction](#operation/post_fee_transaction). Retrieves estimated fee rate.

func (*FeesController) GetFeeTransfer

func (f *FeesController) GetFeeTransfer(ctx context.Context) (
	models.ApiResponse[string],
	error)

GetFeeTransfer takes context as parameters and returns an models.ApiResponse with string data and an error if there was an issue with the request or response. Retrieves an estimated fee rate for STX transfer transactions. This a a fee rate / byte, and is returned as a JSON integer

func (FeesController) LogCallAsJSON

func (bc FeesController) LogCallAsJSON(req https.CallBuilder, path string) (*json.Decoder, *http.Response, error)

func (FeesController) LogCallAsText

func (bc FeesController) LogCallAsText(req https.CallBuilder, path string) (string, *http.Response, error)

func (*FeesController) PostFeeTransaction

PostFeeTransaction takes context, body as parameters and returns an models.ApiResponse with models.TransactionFeeEstimateResponse data and an error if there was an issue with the request or response. Get an estimated fee for the supplied transaction. This estimates the execution cost of the transaction, the current fee rate of the network, and returns estimates for fee amounts. * `transaction_payload` is a hex-encoded serialization of the TransactionPayload for the transaction. * `estimated_len` is an optional argument that provides the endpoint with an estimation of the final length (in bytes) of the transaction, including any post-conditions and signatures If the node cannot provide an estimate for the transaction (e.g., if the node has never seen a contract-call for the given contract and function) or if estimation is not configured on this node, a 400 response is returned. The 400 response will be a JSON error containing a `reason` field which can be one of the following: * `DatabaseError` - this Stacks node has had an internal database error while trying to estimate the costs of the supplied transaction. * `NoEstimateAvailable` - this Stacks node has not seen this kind of contract-call before, and it cannot provide an estimate yet. * `CostEstimationDisabled` - this Stacks node does not perform fee or cost estimation, and it cannot respond on this endpoint. The 200 response contains the following data: * `estimated_cost` - the estimated multi-dimensional cost of executing the Clarity VM on the provided transaction. * `estimated_cost_scalar` - a unitless integer that the Stacks node uses to compare how much of the block limit is consumed by different transactions. This value incorporates the estimated length of the transaction and the estimated execution cost of the transaction. The range of this integer may vary between different Stacks nodes. In order to compute an estimate of total fee amount for the transaction, this value is multiplied by the same Stacks node's estimated fee rate. * `cost_scalar_change_by_byte` - a float value that indicates how much the `estimated_cost_scalar` value would increase for every additional byte in the final transaction. * `estimations` - an array of estimated fee rates and total fees to pay in microSTX for the transaction. This array provides a range of estimates (default: 3) that may be used. Each element of the array contains the following fields: * `fee_rate` - the estimated value for the current fee rates in the network * `fee` - the estimated value for the total fee in microSTX that the given transaction should pay. These values are the result of computing: `fee_rate` x `estimated_cost_scalar`. If the estimated fees are less than the minimum relay fee `(1 ustx x estimated_len)`, then that minimum relay fee will be returned here instead. Note: If the final transaction's byte size is larger than supplied to `estimated_len`, then applications should increase this fee amount by: `fee_rate` x `cost_scalar_change_by_byte` x (`final_size` - `estimated_size`)

type InfoController

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

InfoController represents a controller struct.

func NewInfoController

func NewInfoController(baseController baseController) *InfoController

NewInfoController creates a new instance of InfoController. It takes a baseController as a parameter and returns a pointer to the InfoController.

func (*InfoController) GetCoreApiInfo

GetCoreApiInfo takes context as parameters and returns an models.ApiResponse with models.CoreNodeInfoResponse data and an error if there was an issue with the request or response. Retrieves information about the Core API including the server version

func (*InfoController) GetNetworkBlockTimeByNetwork

func (i *InfoController) GetNetworkBlockTimeByNetwork(
	ctx context.Context,
	network models.NetworkEnum) (
	models.ApiResponse[models.TargetBlockTime],
	error)

GetNetworkBlockTimeByNetwork takes context, network as parameters and returns an models.ApiResponse with models.TargetBlockTime data and an error if there was an issue with the request or response. Retrieves the target block time for a given network. The network can be mainnet or testnet. The block time is hardcoded and will change throughout the implementation phases of the testnet.

func (*InfoController) GetNetworkBlockTimes

GetNetworkBlockTimes takes context as parameters and returns an models.ApiResponse with models.NetworkBlockTimesResponse data and an error if there was an issue with the request or response. Retrieves the target block times for mainnet and testnet. The block time is hardcoded and will change throughout the implementation phases of the testnet.

func (*InfoController) GetPoxInfo

GetPoxInfo takes context as parameters and returns an models.ApiResponse with models.CoreNodePoxResponse data and an error if there was an issue with the request or response. Retrieves Proof-of-Transfer (PoX) information. Can be used for Stacking.

func (*InfoController) GetStatus

GetStatus takes context as parameters and returns an models.ApiResponse with models.ServerStatusResponse data and an error if there was an issue with the request or response. Retrieves the running status of the Stacks Blockchain API, including the server version and current chain tip information.

func (*InfoController) GetStxSupply

GetStxSupply takes context, height as parameters and returns an models.ApiResponse with models.GetStxSupplyResponse data and an error if there was an issue with the request or response. Retrieves the total and unlocked STX supply. More information on Stacking can be found [here] (https://docs.stacks.co/understand-stacks/stacking). **Note:** This uses the estimated future total supply for the year 2050.

func (*InfoController) GetStxSupplyCirculatingPlain

func (i *InfoController) GetStxSupplyCirculatingPlain(ctx context.Context) (
	models.ApiResponse[string],
	error)

GetStxSupplyCirculatingPlain takes context as parameters and returns an models.ApiResponse with string data and an error if there was an issue with the request or response. Retrieves the STX tokens currently in circulation that have been unlocked as plain text.

func (*InfoController) GetStxSupplyTotalSupplyPlain

func (i *InfoController) GetStxSupplyTotalSupplyPlain(ctx context.Context) (
	models.ApiResponse[string],
	error)

GetStxSupplyTotalSupplyPlain takes context as parameters and returns an models.ApiResponse with string data and an error if there was an issue with the request or response. Retrieves the total supply for STX tokens as plain text. **Note:** this uses the estimated future total supply for the year 2050.

func (*InfoController) GetTotalStxSupplyLegacyFormat

func (i *InfoController) GetTotalStxSupplyLegacyFormat(
	ctx context.Context,
	height *float64) (
	models.ApiResponse[models.GetStxSupplyLegacyFormatResponse],
	error)

GetTotalStxSupplyLegacyFormat takes context, height as parameters and returns an models.ApiResponse with models.GetStxSupplyLegacyFormatResponse data and an error if there was an issue with the request or response. Retrieves total supply of STX tokens including those currently in circulation that have been unlocked. **Note:** this uses the estimated future total supply for the year 2050.

func (InfoController) LogCallAsJSON

func (bc InfoController) LogCallAsJSON(req https.CallBuilder, path string) (*json.Decoder, *http.Response, error)

func (InfoController) LogCallAsText

func (bc InfoController) LogCallAsText(req https.CallBuilder, path string) (string, *http.Response, error)

type MempoolController

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

MempoolController represents a controller struct.

func NewMempoolController

func NewMempoolController(baseController baseController) *MempoolController

NewMempoolController creates a new instance of MempoolController. It takes a baseController as a parameter and returns a pointer to the MempoolController.

func (*MempoolController) GetMempoolFeePriorities

func (m *MempoolController) GetMempoolFeePriorities(ctx context.Context) (
	models.ApiResponse[models.MempoolFeePriorities],
	error)

GetMempoolFeePriorities takes context as parameters and returns an models.ApiResponse with models.MempoolFeePriorities data and an error if there was an issue with the request or response. Returns estimated fee priorities (in micro-STX) for all transactions that are currently in the mempool. Also returns priorities separated by transaction type.

func (MempoolController) LogCallAsJSON

func (bc MempoolController) LogCallAsJSON(req https.CallBuilder, path string) (*json.Decoder, *http.Response, error)

func (MempoolController) LogCallAsText

func (bc MempoolController) LogCallAsText(req https.CallBuilder, path string) (string, *http.Response, error)

type MicroblocksController

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

MicroblocksController represents a controller struct.

func NewMicroblocksController

func NewMicroblocksController(baseController baseController) *MicroblocksController

NewMicroblocksController creates a new instance of MicroblocksController. It takes a baseController as a parameter and returns a pointer to the MicroblocksController.

func (*MicroblocksController) GetMicroblockByHash

func (m *MicroblocksController) GetMicroblockByHash(
	ctx context.Context,
	hash string) (
	models.ApiResponse[models.Microblock],
	error)

GetMicroblockByHash takes context, hash as parameters and returns an models.ApiResponse with models.Microblock data and an error if there was an issue with the request or response. Retrieves a specific microblock by `hash`

func (*MicroblocksController) GetMicroblockList

func (m *MicroblocksController) GetMicroblockList(
	ctx context.Context,
	limit *int,
	offset *int) (
	models.ApiResponse[models.MicroblockListResponse],
	error)

GetMicroblockList takes context, limit, offset as parameters and returns an models.ApiResponse with models.MicroblockListResponse data and an error if there was an issue with the request or response. Retrieves a list of microblocks. If you need to actively monitor new microblocks, we highly recommend subscribing to [WebSockets or Socket.io](https://github.com/hirosystems/stacks-blockchain-api/tree/master/client) for real-time updates.

func (*MicroblocksController) GetUnanchoredTxs

GetUnanchoredTxs takes context as parameters and returns an models.ApiResponse with models.UnanchoredTransactionListResponse data and an error if there was an issue with the request or response. Retrieves transactions that have been streamed in microblocks but not yet accepted or rejected in an anchor block

func (MicroblocksController) LogCallAsJSON

func (bc MicroblocksController) LogCallAsJSON(req https.CallBuilder, path string) (*json.Decoder, *http.Response, error)

func (MicroblocksController) LogCallAsText

func (bc MicroblocksController) LogCallAsText(req https.CallBuilder, path string) (string, *http.Response, error)

type NamesController

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

NamesController represents a controller struct.

func NewNamesController

func NewNamesController(baseController baseController) *NamesController

NewNamesController creates a new instance of NamesController. It takes a baseController as a parameter and returns a pointer to the NamesController.

func (*NamesController) FetchSubdomainsListForName

func (n *NamesController) FetchSubdomainsListForName(
	ctx context.Context,
	name string) (
	models.ApiResponse[[]string],
	error)

FetchSubdomainsListForName takes context, name as parameters and returns an models.ApiResponse with []string data and an error if there was an issue with the request or response. Retrieves the list of subdomains for a specific name

func (*NamesController) FetchZoneFile

FetchZoneFile takes context, name as parameters and returns an models.ApiResponse with models.BnsFetchFileZoneResponse2 data and an error if there was an issue with the request or response. Retrieves a user’s raw zone file. This only works for RFC-compliant zone files. This method returns an error for names that have non-standard zone files.

func (*NamesController) GetAllNames

func (n *NamesController) GetAllNames(
	ctx context.Context,
	page *int) (
	models.ApiResponse[[]string],
	error)

GetAllNames takes context, page as parameters and returns an models.ApiResponse with []string data and an error if there was an issue with the request or response. Retrieves a list of all names known to the node.

func (*NamesController) GetAllNamespaces

GetAllNamespaces takes context as parameters and returns an models.ApiResponse with models.BnsGetAllNamespacesResponse data and an error if there was an issue with the request or response. Retrieves a list of all namespaces known to the node.

func (*NamesController) GetHistoricalZoneFile

func (n *NamesController) GetHistoricalZoneFile(
	ctx context.Context,
	name string,
	zoneFileHash string) (
	models.ApiResponse[models.BnsFetchHistoricalZoneFileResponse2],
	error)

GetHistoricalZoneFile takes context, name, zoneFileHash as parameters and returns an models.ApiResponse with models.BnsFetchHistoricalZoneFileResponse2 data and an error if there was an issue with the request or response. Retrieves the historical zonefile specified by the username and zone hash.

func (*NamesController) GetNameInfo

GetNameInfo takes context, name as parameters and returns an models.ApiResponse with models.BnsGetNameInfoResponse data and an error if there was an issue with the request or response. Retrieves details of a given name including the `address`, `status` and last transaction id - `last_txid`.

func (*NamesController) GetNamePrice

GetNamePrice takes context, name as parameters and returns an models.ApiResponse with models.BnsGetNamePriceResponse data and an error if there was an issue with the request or response. Retrieves the price of a name. The `amount` given will be in the smallest possible units of the currency.

func (*NamesController) GetNamesOwnedByAddress

func (n *NamesController) GetNamesOwnedByAddress(
	ctx context.Context,
	blockchain string,
	address string) (
	models.ApiResponse[models.BnsNamesOwnByAddressResponse],
	error)

GetNamesOwnedByAddress takes context, blockchain, address as parameters and returns an models.ApiResponse with models.BnsNamesOwnByAddressResponse data and an error if there was an issue with the request or response. Retrieves a list of names owned by the address provided.

func (*NamesController) GetNamespaceNames

func (n *NamesController) GetNamespaceNames(
	ctx context.Context,
	tld string,
	page *int) (
	models.ApiResponse[[]string],
	error)

GetNamespaceNames takes context, tld, page as parameters and returns an models.ApiResponse with []string data and an error if there was an issue with the request or response. Retrieves a list of names within a given namespace.

func (*NamesController) GetNamespacePrice

GetNamespacePrice takes context, tld as parameters and returns an models.ApiResponse with models.BnsGetNamespacePriceResponse data and an error if there was an issue with the request or response. Retrieves the price of a namespace. The `amount` given will be in the smallest possible units of the currency.

func (NamesController) LogCallAsJSON

func (bc NamesController) LogCallAsJSON(req https.CallBuilder, path string) (*json.Decoder, *http.Response, error)

func (NamesController) LogCallAsText

func (bc NamesController) LogCallAsText(req https.CallBuilder, path string) (string, *http.Response, error)

type NonFungibleTokensController

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

NonFungibleTokensController represents a controller struct.

func NewNonFungibleTokensController

func NewNonFungibleTokensController(baseController baseController) *NonFungibleTokensController

NewNonFungibleTokensController creates a new instance of NonFungibleTokensController. It takes a baseController as a parameter and returns a pointer to the NonFungibleTokensController.

func (*NonFungibleTokensController) GetNftHistory

func (n *NonFungibleTokensController) GetNftHistory(
	ctx context.Context,
	assetIdentifier string,
	value string,
	limit *int,
	offset *int,
	unanchored *bool,
	txMetadata *bool) (
	models.ApiResponse[models.NonFungibleTokenHistoryEventList],
	error)

GetNftHistory takes context, assetIdentifier, value, limit, offset, unanchored, txMetadata as parameters and returns an models.ApiResponse with models.NonFungibleTokenHistoryEventList data and an error if there was an issue with the request or response. Retrieves all events relevant to a Non-Fungible Token. Useful to determine the ownership history of a particular asset. More information on Non-Fungible Tokens on the Stacks blockchain can be found [here](https://docs.stacks.co/write-smart-contracts/tokens#non-fungible-tokens-nfts).

func (*NonFungibleTokensController) GetNftHoldings

func (n *NonFungibleTokensController) GetNftHoldings(
	ctx context.Context,
	principal string,
	assetIdentifiers []string,
	limit *int,
	offset *int,
	unanchored *bool,
	txMetadata *bool) (
	models.ApiResponse[models.NonFungibleTokenHoldingsList],
	error)

GetNftHoldings takes context, principal, assetIdentifiers, limit, offset, unanchored, txMetadata as parameters and returns an models.ApiResponse with models.NonFungibleTokenHoldingsList data and an error if there was an issue with the request or response. Retrieves the list of Non-Fungible Tokens owned by the given principal (STX address or Smart Contract ID). Results can be filtered by one or more asset identifiers and can include metadata about the transaction that made the principal own each token. More information on Non-Fungible Tokens on the Stacks blockchain can be found [here](https://docs.stacks.co/write-smart-contracts/tokens#non-fungible-tokens-nfts).

func (*NonFungibleTokensController) GetNftMints

func (n *NonFungibleTokensController) GetNftMints(
	ctx context.Context,
	assetIdentifier string,
	limit *int,
	offset *int,
	unanchored *bool,
	txMetadata *bool) (
	models.ApiResponse[models.NonFungibleTokenMintList],
	error)

GetNftMints takes context, assetIdentifier, limit, offset, unanchored, txMetadata as parameters and returns an models.ApiResponse with models.NonFungibleTokenMintList data and an error if there was an issue with the request or response. Retrieves all mint events for a Non-Fungible Token asset class. Useful to determine which NFTs of a particular collection have been claimed. More information on Non-Fungible Tokens on the Stacks blockchain can be found [here](https://docs.stacks.co/write-smart-contracts/tokens#non-fungible-tokens-nfts).

func (NonFungibleTokensController) LogCallAsJSON

func (bc NonFungibleTokensController) LogCallAsJSON(req https.CallBuilder, path string) (*json.Decoder, *http.Response, error)

func (NonFungibleTokensController) LogCallAsText

func (bc NonFungibleTokensController) LogCallAsText(req https.CallBuilder, path string) (string, *http.Response, error)

type RosettaController

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

RosettaController represents a controller struct.

func NewRosettaController

func NewRosettaController(baseController baseController) *RosettaController

NewRosettaController creates a new instance of RosettaController. It takes a baseController as a parameter and returns a pointer to the RosettaController.

func (RosettaController) LogCallAsJSON

func (bc RosettaController) LogCallAsJSON(req https.CallBuilder, path string) (*json.Decoder, *http.Response, error)

func (RosettaController) LogCallAsText

func (bc RosettaController) LogCallAsText(req https.CallBuilder, path string) (string, *http.Response, error)

func (*RosettaController) RosettaAccountBalance

RosettaAccountBalance takes context, body as parameters and returns an models.ApiResponse with models.RosettaAccountBalanceResponse data and an error if there was an issue with the request or response. An AccountBalanceRequest is utilized to make a balance request on the /account/balance endpoint. If the block_identifier is populated, a historical balance query should be performed.

func (*RosettaController) RosettaBlock

RosettaBlock takes context, body as parameters and returns an models.ApiResponse with models.RosettaBlockResponse data and an error if there was an issue with the request or response. Retrieves the Block information for a given block identifier including a list of all transactions in the block.

func (*RosettaController) RosettaBlockTransaction

RosettaBlockTransaction takes context, body as parameters and returns an models.ApiResponse with models.RosettaBlockTransactionResponse data and an error if there was an issue with the request or response. Retrieves a Transaction included in a block that is not returned in a BlockResponse.

func (*RosettaController) RosettaConstructionCombine

RosettaConstructionCombine takes context, body as parameters and returns an models.ApiResponse with models.RosettaConstructionCombineResponse data and an error if there was an issue with the request or response. Take unsigned transaction and signature, combine both and return signed transaction. The examples below are illustrative only. You'll need to use your wallet to generate actual values to use them in the request payload.

func (*RosettaController) RosettaConstructionDerive

RosettaConstructionDerive takes context, body as parameters and returns an models.ApiResponse with models.RosettaConstructionDeriveResponse data and an error if there was an issue with the request or response. Retrieves the Account Identifier information based on a Public Key for a given network

func (*RosettaController) RosettaConstructionHash

RosettaConstructionHash takes context, body as parameters and returns an models.ApiResponse with models.RosettaConstructionHashResponse data and an error if there was an issue with the request or response. Retrieves the network-specific transaction hash for a signed transaction.

func (*RosettaController) RosettaConstructionMetadata

RosettaConstructionMetadata takes context, body as parameters and returns an models.ApiResponse with models.RosettaConstructionMetadataResponse data and an error if there was an issue with the request or response. To Do

func (*RosettaController) RosettaConstructionParse

RosettaConstructionParse takes context, body as parameters and returns an models.ApiResponse with models.RosettaConstructionParseResponse data and an error if there was an issue with the request or response. TODO

func (*RosettaController) RosettaConstructionPayloads

RosettaConstructionPayloads takes context, body as parameters and returns an models.ApiResponse with models.RosettaConstructionPayloadResponse data and an error if there was an issue with the request or response. Generate an unsigned transaction from operations and metadata. The examples below are illustrative only. You'll need to use your wallet to generate actual values to use them in the request payload.

func (*RosettaController) RosettaConstructionPreprocess

RosettaConstructionPreprocess takes context, body as parameters and returns an models.ApiResponse with models.RosettaConstructionPreprocessResponse data and an error if there was an issue with the request or response. TODO

func (*RosettaController) RosettaConstructionSubmit

RosettaConstructionSubmit takes context, body as parameters and returns an models.ApiResponse with models.RosettaConstructionSubmitResponse data and an error if there was an issue with the request or response. Submit a pre-signed transaction to the node. The examples below are illustrative only. You'll need to use your wallet to generate actual values to use them in the request payload.

func (*RosettaController) RosettaMempool

RosettaMempool takes context, body as parameters and returns an models.ApiResponse with models.RosettaMempoolResponse data and an error if there was an issue with the request or response. Retrieves a list of transactions currently in the mempool for a given network.

func (*RosettaController) RosettaMempoolTransaction

RosettaMempoolTransaction takes context, body as parameters and returns an models.ApiResponse with models.RosettaMempoolTransactionResponse data and an error if there was an issue with the request or response. Retrieves transaction details from the mempool for a given transaction id from a given network.

func (*RosettaController) RosettaNetworkList

RosettaNetworkList takes context as parameters and returns an models.ApiResponse with models.RosettaNetworkListResponse data and an error if there was an issue with the request or response. Retrieves a list of NetworkIdentifiers that the Rosetta server supports.

func (*RosettaController) RosettaNetworkOptions

RosettaNetworkOptions takes context, body as parameters and returns an models.ApiResponse with models.RosettaNetworkOptionsResponse data and an error if there was an issue with the request or response. Retrieves the version information and allowed network-specific types for a NetworkIdentifier. Any NetworkIdentifier returned by /network/list should be accessible here. Because options are retrievable in the context of a NetworkIdentifier, it is possible to define unique options for each network.

func (*RosettaController) RosettaNetworkStatus

RosettaNetworkStatus takes context, body as parameters and returns an models.ApiResponse with models.RosettaNetworkStatusResponse data and an error if there was an issue with the request or response. Retrieves the current status of the network requested. Any NetworkIdentifier returned by /network/list should be accessible here.

type SearchController

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

SearchController represents a controller struct.

func NewSearchController

func NewSearchController(baseController baseController) *SearchController

NewSearchController creates a new instance of SearchController. It takes a baseController as a parameter and returns a pointer to the SearchController.

func (SearchController) LogCallAsJSON

func (bc SearchController) LogCallAsJSON(req https.CallBuilder, path string) (*json.Decoder, *http.Response, error)

func (SearchController) LogCallAsText

func (bc SearchController) LogCallAsText(req https.CallBuilder, path string) (string, *http.Response, error)

func (*SearchController) SearchById

func (s *SearchController) SearchById(
	ctx context.Context,
	id string,
	includeMetadata *bool) (
	models.ApiResponse[models.SearchResult],
	error)

SearchById takes context, id, includeMetadata as parameters and returns an models.ApiResponse with models.SearchResult data and an error if there was an issue with the request or response. Search blocks, transactions, contracts, or accounts by hash/ID

type SmartContractsController

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

SmartContractsController represents a controller struct.

func NewSmartContractsController

func NewSmartContractsController(baseController baseController) *SmartContractsController

NewSmartContractsController creates a new instance of SmartContractsController. It takes a baseController as a parameter and returns a pointer to the SmartContractsController.

func (*SmartContractsController) CallReadOnlyFunction

func (s *SmartContractsController) CallReadOnlyFunction(
	ctx context.Context,
	contractAddress string,
	contractName string,
	functionName string,
	body *models.ReadOnlyFunctionArgs,
	tip *string) (
	models.ApiResponse[models.ReadOnlyFunctionSuccessResponse],
	error)

CallReadOnlyFunction takes context, contractAddress, contractName, functionName, body, tip as parameters and returns an models.ApiResponse with models.ReadOnlyFunctionSuccessResponse data and an error if there was an issue with the request or response. Call a read-only public function on a given smart contract. The smart contract and function are specified using the URL path. The arguments and the simulated tx-sender are supplied via the POST body in the following JSON format:

func (*SmartContractsController) GetContractById

func (s *SmartContractsController) GetContractById(
	ctx context.Context,
	contractId string,
	unanchored *bool) (
	models.ApiResponse[models.SmartContract7],
	error)

GetContractById takes context, contractId, unanchored as parameters and returns an models.ApiResponse with models.SmartContract7 data and an error if there was an issue with the request or response. Retrieves details of a contract with a given `contract_id`

func (*SmartContractsController) GetContractDataMapEntry

func (s *SmartContractsController) GetContractDataMapEntry(
	ctx context.Context,
	contractAddress string,
	contractName string,
	mapName string,
	body string,
	proof *int,
	tip *string) (
	models.ApiResponse[models.MapEntryResponse],
	error)

GetContractDataMapEntry takes context, contractAddress, contractName, mapName, body, proof, tip as parameters and returns an models.ApiResponse with models.MapEntryResponse data and an error if there was an issue with the request or response. Attempt to fetch data from a contract data map. The contract is identified with Stacks Address `contract_address` and Contract Name `contract_address` in the URL path. The map is identified with [Map Name]. The key to lookup in the map is supplied via the POST body. This should be supplied as the hex string serialization of the key (which should be a Clarity value). Note, this is a JSON string atom. In the response, `data` is the hex serialization of the map response. Note that map responses are Clarity option types, for non-existent values, this is a serialized none, and for all other responses, it is a serialized (some ...) object.

func (*SmartContractsController) GetContractEventsById

func (s *SmartContractsController) GetContractEventsById(
	ctx context.Context,
	contractId string,
	limit *int,
	offset *int,
	unanchored *bool) (
	models.ApiResponse[models.TransactionEvent],
	error)

GetContractEventsById takes context, contractId, limit, offset, unanchored as parameters and returns an models.ApiResponse with models.TransactionEvent data and an error if there was an issue with the request or response. Retrieves a list of events that have been triggered by a given `contract_id`

func (*SmartContractsController) GetContractInterface

func (s *SmartContractsController) GetContractInterface(
	ctx context.Context,
	contractAddress string,
	contractName string,
	tip *string) (
	models.ApiResponse[models.ContractInterfaceResponse],
	error)

GetContractInterface takes context, contractAddress, contractName, tip as parameters and returns an models.ApiResponse with models.ContractInterfaceResponse data and an error if there was an issue with the request or response. Retrieves a contract interface with a given `contract_address` and `contract name`

func (*SmartContractsController) GetContractSource

func (s *SmartContractsController) GetContractSource(
	ctx context.Context,
	contractAddress string,
	contractName string,
	proof *int,
	tip *string) (
	models.ApiResponse[models.ContractSourceResponse],
	error)

GetContractSource takes context, contractAddress, contractName, proof, tip as parameters and returns an models.ApiResponse with models.ContractSourceResponse data and an error if there was an issue with the request or response. Retrieves the Clarity source code of a given contract, along with the block height it was published in, and the MARF proof for the data

func (*SmartContractsController) GetContractsByTrait

func (s *SmartContractsController) GetContractsByTrait(
	ctx context.Context,
	traitAbi string,
	limit *int,
	offset *int) (
	models.ApiResponse[models.ContractListResponse],
	error)

GetContractsByTrait takes context, traitAbi, limit, offset as parameters and returns an models.ApiResponse with models.ContractListResponse data and an error if there was an issue with the request or response. Retrieves a list of contracts based on the following traits listed in JSON format - functions, variables, maps, fungible tokens and non-fungible tokens

func (SmartContractsController) LogCallAsJSON

func (bc SmartContractsController) LogCallAsJSON(req https.CallBuilder, path string) (*json.Decoder, *http.Response, error)

func (SmartContractsController) LogCallAsText

func (bc SmartContractsController) LogCallAsText(req https.CallBuilder, path string) (string, *http.Response, error)

type StackingController

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

StackingController represents a controller struct.

func NewStackingController

func NewStackingController(baseController baseController) *StackingController

NewStackingController creates a new instance of StackingController. It takes a baseController as a parameter and returns a pointer to the StackingController.

func (*StackingController) GetPoolDelegations

func (s *StackingController) GetPoolDelegations(
	ctx context.Context,
	poolPrincipal string,
	afterBlock *int,
	unanchored *bool,
	limit *int,
	offset *int) (
	models.ApiResponse[models.PoolDelegationsResponse],
	error)

GetPoolDelegations takes context, poolPrincipal, afterBlock, unanchored, limit, offset as parameters and returns an models.ApiResponse with models.PoolDelegationsResponse data and an error if there was an issue with the request or response. Retrieves the list of stacking pool members for a given delegator principal.

func (StackingController) LogCallAsJSON

func (bc StackingController) LogCallAsJSON(req https.CallBuilder, path string) (*json.Decoder, *http.Response, error)

func (StackingController) LogCallAsText

func (bc StackingController) LogCallAsText(req https.CallBuilder, path string) (string, *http.Response, error)

type StackingRewardsController

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

StackingRewardsController represents a controller struct.

func NewStackingRewardsController

func NewStackingRewardsController(baseController baseController) *StackingRewardsController

NewStackingRewardsController creates a new instance of StackingRewardsController. It takes a baseController as a parameter and returns a pointer to the StackingRewardsController.

func (*StackingRewardsController) GetBurnchainRewardList

func (s *StackingRewardsController) GetBurnchainRewardList(
	ctx context.Context,
	limit *int,
	offset *int) (
	models.ApiResponse[models.BurnchainRewardListResponse],
	error)

GetBurnchainRewardList takes context, limit, offset as parameters and returns an models.ApiResponse with models.BurnchainRewardListResponse data and an error if there was an issue with the request or response. Retrieves a list of recent burnchain (e.g. Bitcoin) reward recipients with the associated amounts and block info

func (*StackingRewardsController) GetBurnchainRewardListByAddress

func (s *StackingRewardsController) GetBurnchainRewardListByAddress(
	ctx context.Context,
	address string,
	limit *int,
	offset *int) (
	models.ApiResponse[models.BurnchainRewardListResponse],
	error)

GetBurnchainRewardListByAddress takes context, address, limit, offset as parameters and returns an models.ApiResponse with models.BurnchainRewardListResponse data and an error if there was an issue with the request or response. Retrieves a list of recent burnchain (e.g. Bitcoin) rewards for the given recipient with the associated amounts and block info

func (*StackingRewardsController) GetBurnchainRewardSlotHolders

func (s *StackingRewardsController) GetBurnchainRewardSlotHolders(
	ctx context.Context,
	limit *int,
	offset *int) (
	models.ApiResponse[models.BurnchainRewardSlotHolderListResponse],
	error)

GetBurnchainRewardSlotHolders takes context, limit, offset as parameters and returns an models.ApiResponse with models.BurnchainRewardSlotHolderListResponse data and an error if there was an issue with the request or response. Retrieves a list of the Bitcoin addresses that would validly receive Proof-of-Transfer commitments.

func (*StackingRewardsController) GetBurnchainRewardSlotHoldersByAddress

func (s *StackingRewardsController) GetBurnchainRewardSlotHoldersByAddress(
	ctx context.Context,
	address string,
	limit *int,
	offset *int) (
	models.ApiResponse[models.BurnchainRewardSlotHolderListResponse],
	error)

GetBurnchainRewardSlotHoldersByAddress takes context, address, limit, offset as parameters and returns an models.ApiResponse with models.BurnchainRewardSlotHolderListResponse data and an error if there was an issue with the request or response. Retrieves a list of the Bitcoin addresses that would validly receive Proof-of-Transfer commitments for a given reward slot holder recipient address.

func (*StackingRewardsController) GetBurnchainRewardsTotalByAddress

func (s *StackingRewardsController) GetBurnchainRewardsTotalByAddress(
	ctx context.Context,
	address string) (
	models.ApiResponse[models.BurnchainRewardsTotal],
	error)

GetBurnchainRewardsTotalByAddress takes context, address as parameters and returns an models.ApiResponse with models.BurnchainRewardsTotal data and an error if there was an issue with the request or response. Retrieves the total burnchain (e.g. Bitcoin) rewards for a given recipient `address`

func (StackingRewardsController) LogCallAsJSON

func (bc StackingRewardsController) LogCallAsJSON(req https.CallBuilder, path string) (*json.Decoder, *http.Response, error)

func (StackingRewardsController) LogCallAsText

func (bc StackingRewardsController) LogCallAsText(req https.CallBuilder, path string) (string, *http.Response, error)

type TransactionsController

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

TransactionsController represents a controller struct.

func NewTransactionsController

func NewTransactionsController(baseController baseController) *TransactionsController

NewTransactionsController creates a new instance of TransactionsController. It takes a baseController as a parameter and returns a pointer to the TransactionsController.

func (*TransactionsController) GetAddressMempoolTransactions

func (t *TransactionsController) GetAddressMempoolTransactions(
	ctx context.Context,
	address string,
	limit *int,
	offset *int,
	unanchored *bool) (
	models.ApiResponse[models.MempoolTransactionListResponse],
	error)

GetAddressMempoolTransactions takes context, address, limit, offset, unanchored as parameters and returns an models.ApiResponse with models.MempoolTransactionListResponse data and an error if there was an issue with the request or response. Retrieves all transactions for a given address that are currently in mempool

func (*TransactionsController) GetDroppedMempoolTransactionList

func (t *TransactionsController) GetDroppedMempoolTransactionList(
	ctx context.Context,
	limit *int,
	offset *int) (
	models.ApiResponse[models.MempoolTransactionListResponse],
	error)

GetDroppedMempoolTransactionList takes context, limit, offset as parameters and returns an models.ApiResponse with models.MempoolTransactionListResponse data and an error if there was an issue with the request or response. Retrieves all recently-broadcast transactions that have been dropped from the mempool. Transactions are dropped from the mempool if: * they were stale and awaiting garbage collection or, * were expensive, or * were replaced with a new fee

func (*TransactionsController) GetFilteredEvents

func (t *TransactionsController) GetFilteredEvents(
	ctx context.Context,
	txId *string,
	address *string,
	limit *int,
	offset *int,
	mType []models.Type2Enum) (
	models.ApiResponse[models.TransactionEventsResponse],
	error)

GetFilteredEvents takes context, txId, address, limit, offset, mType as parameters and returns an models.ApiResponse with models.TransactionEventsResponse data and an error if there was an issue with the request or response. Retrieves the list of events filtered by principal (STX address or Smart Contract ID), transaction id or event types. The list of event types is ('smart_contract_log', 'stx_lock', 'stx_asset', 'fungible_token_asset', 'non_fungible_token_asset').

func (*TransactionsController) GetMempoolTransactionList

func (t *TransactionsController) GetMempoolTransactionList(
	ctx context.Context,
	senderAddress *string,
	recipientAddress *string,
	address *string,
	orderBy *models.OrderByEnum,
	order *models.OrderEnum,
	limit *int,
	offset *int,
	unanchored *bool) (
	models.ApiResponse[models.MempoolTransactionListResponse],
	error)

GetMempoolTransactionList takes context, senderAddress, recipientAddress, address, orderBy, order, limit, offset, unanchored as parameters and returns an models.ApiResponse with models.MempoolTransactionListResponse data and an error if there was an issue with the request or response. Retrieves all transactions that have been recently broadcast to the mempool. These are pending transactions awaiting confirmation. If you need to monitor new transactions, we highly recommend subscribing to [WebSockets or Socket.io](https://github.com/hirosystems/stacks-blockchain-api/tree/master/client) for real-time updates.

func (*TransactionsController) GetMempoolTransactionStats

GetMempoolTransactionStats takes context as parameters and returns an models.ApiResponse with models.MempoolTransactionStatsResponse data and an error if there was an issue with the request or response. Queries for transactions counts, age (by block height), fees (simple average), and size. All results broken down by transaction type and percentiles (p25, p50, p75, p95).

func (*TransactionsController) GetRawTransactionById

GetRawTransactionById takes context, txId as parameters and returns an models.ApiResponse with models.GetRawTransactionResult data and an error if there was an issue with the request or response. Retrieves a hex encoded serialized transaction for a given ID

func (*TransactionsController) GetTransactionById

func (t *TransactionsController) GetTransactionById(
	ctx context.Context,
	txId string,
	eventOffset *int,
	eventLimit *int,
	unanchored *bool) (
	models.ApiResponse[models.Transaction],
	error)

GetTransactionById takes context, txId, eventOffset, eventLimit, unanchored as parameters and returns an models.ApiResponse with models.Transaction data and an error if there was an issue with the request or response. Retrieves transaction details for a given transaction ID `import type { Transaction } from '@stacks/stacks-blockchain-api-types';`

func (*TransactionsController) GetTransactionList

func (t *TransactionsController) GetTransactionList(
	ctx context.Context,
	limit *int,
	offset *int,
	mType []models.TypeEnum,
	unanchored *bool) (
	models.ApiResponse[models.TransactionResults],
	error)

GetTransactionList takes context, limit, offset, mType, unanchored as parameters and returns an models.ApiResponse with models.TransactionResults data and an error if there was an issue with the request or response. Retrieves all recently mined transactions If using TypeScript, import typings for this response from our types package: `import type { TransactionResults } from '@stacks/stacks-blockchain-api-types';`

func (*TransactionsController) GetTransactionsByBlock

func (t *TransactionsController) GetTransactionsByBlock(
	ctx context.Context,
	heightOrHash interface{}) (
	models.ApiResponse[models.TransactionResults],
	error)

GetTransactionsByBlock takes context, heightOrHash as parameters and returns an models.ApiResponse with models.TransactionResults data and an error if there was an issue with the request or response. Retrieves transactions confirmed in a single block

func (*TransactionsController) GetTransactionsByBlockHash

func (t *TransactionsController) GetTransactionsByBlockHash(
	ctx context.Context,
	blockHash string,
	limit *int,
	offset *int) (
	models.ApiResponse[models.TransactionResults],
	error)

GetTransactionsByBlockHash takes context, blockHash, limit, offset as parameters and returns an models.ApiResponse with models.TransactionResults data and an error if there was an issue with the request or response. Deprecated: get_transactions_by_block_hash is deprecated **NOTE:** This endpoint is deprecated in favor of [Get transactions by block](#operation/get_transactions_by_block). Retrieves a list of all transactions within a block for a given block hash.

func (*TransactionsController) GetTransactionsByBlockHeight

func (t *TransactionsController) GetTransactionsByBlockHeight(
	ctx context.Context,
	height int,
	limit *int,
	offset *int,
	unanchored *bool) (
	models.ApiResponse[models.TransactionResults],
	error)

GetTransactionsByBlockHeight takes context, height, limit, offset, unanchored as parameters and returns an models.ApiResponse with models.TransactionResults data and an error if there was an issue with the request or response. Deprecated: get_transactions_by_block_height is deprecated **NOTE:** This endpoint is deprecated in favor of [Get transactions by block](#operation/get_transactions_by_block). Retrieves all transactions within a block at a given height

func (*TransactionsController) GetTxListDetails

func (t *TransactionsController) GetTxListDetails(
	ctx context.Context,
	txId []string,
	eventOffset *int,
	eventLimit *int,
	unanchored *bool) (
	models.ApiResponse[map[string]models.TransactionList],
	error)

GetTxListDetails takes context, txId, eventOffset, eventLimit, unanchored as parameters and returns an models.ApiResponse with map[string]models.TransactionList data and an error if there was an issue with the request or response. Retrieves a list of transactions for a given list of transaction IDs If using TypeScript, import typings for this response from our types package: `import type { Transaction } from '@stacks/stacks-blockchain-api-types';`

func (TransactionsController) LogCallAsJSON

func (bc TransactionsController) LogCallAsJSON(req https.CallBuilder, path string) (*json.Decoder, *http.Response, error)

func (TransactionsController) LogCallAsText

func (bc TransactionsController) LogCallAsText(req https.CallBuilder, path string) (string, *http.Response, error)

func (*TransactionsController) PostCoreNodeTransactions

func (t *TransactionsController) PostCoreNodeTransactions(
	ctx context.Context,
	body *models.FileWrapper) (
	models.ApiResponse[string],
	error)

PostCoreNodeTransactions takes context, body as parameters and returns an models.ApiResponse with string data and an error if there was an issue with the request or response. Broadcasts raw transactions on the network. You can use the [@stacks/transactions](https://github.com/blockstack/stacks.js) project to generate a raw transaction payload.

Jump to

Keyboard shortcuts

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