actions

package
v0.0.0-...-891ff74 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAddressInfo

func GetAddressInfo(ctx *Context, params *GetAddressInfoParams) (*db.GetAddressInfoRow, error)

func ReleaseBlock

func ReleaseBlock(name string) int32

Types

type Action

type Action struct {
	Params   reflect.Type
	Result   reflect.Type
	Function reflect.Value
}

func NewAction

func NewAction(function interface{}) *Action

func (*Action) BuildHandlerFunc

func (a *Action) BuildHandlerFunc(db *db.Queries) http.HandlerFunc

type AddressTxInput

type AddressTxInput struct {
	HashPrevout  *types.Bytes `json:"txid"`
	IndexPrevout *int64       `json:"index"`
	SpendHeight  *int32       `json:"height"`
}

type AddressTxOutput

type AddressTxOutput struct {
	Txid                 types.Bytes       `json:"txid"`
	Index                int64             `json:"index"`
	Value                int64             `json:"value"`
	Address              string            `json:"address"`
	CovenantAction       db.CovenantAction `json:"covenantAction"`
	CovenantNameHash     types.Bytes       `json:"covenantNameHash,omitempty"`
	CovenantHeight       types.Bytes       `json:"covenantHeight,omitempty"`
	CovenantName         types.Bytes       `json:"covenantName,omitempty"`
	CovenantBidHash      types.Bytes       `json:"covenantBidHash,omitempty"`
	CovenantNonce        types.Bytes       `json:"covenantNonce,omitempty"`
	CovenantRecordData   types.Bytes       `json:"covenantRecordData,omitempty"`
	CovenantBlockHash    types.Bytes       `json:"covenantBlockHash,omitempty"`
	CovenantVersion      types.Bytes       `json:"covenantVersion,omitempty"`
	CovenantAddress      types.Bytes       `json:"covenantAddress,omitempty"`
	CovenantClaimHeight  types.Bytes       `json:"covenantClaimHeight,omitempty"`
	CovenantRenewalCount types.Bytes       `json:"covenantRenewalCount,omitempty"`
	Name                 string            `json:"name,omitempty"`
	Height               *int32            `json:"height"`
}

type AuctionState

type AuctionState string
const (
	AuctionStateClosed AuctionState = "CLOSED"
	AuctionStateOpen   AuctionState = "OPEN"
	AuctionStateBid    AuctionState = "BID"
	AuctionStateReveal AuctionState = "REVEAL"
)

type Block

type Block struct {
	Hash           types.Bytes `json:"hash"`
	Height         int32       `json:"height"`
	Weight         int32       `json:"weight"`
	Size           int64       `json:"size"`
	Version        int32       `json:"version"`
	HashMerkleRoot types.Bytes `json:"hashMerkleRoot"`
	WitnessRoot    types.Bytes `json:"witnessRoot"`
	TreeRoot       types.Bytes `json:"treeRoot"`
	ReservedRoot   types.Bytes `json:"reservedRoot"`
	Mask           types.Bytes `json:"mask"`
	Time           int32       `json:"time"`
	Bits           types.Bytes `json:"bits"`
	Difficulty     float64     `json:"difficulty"`
	Chainwork      types.Bytes `json:"chainwork"`
	Nonce          int64       `json:"nonce"`
	ExtraNonce     types.Bytes `json:"extraNonce"`
	TxsCount       int32       `json:"txsCount"`
}

type Context

type Context struct {
	context.Context
	// contains filtered or unexported fields
}

type GetAddressHistoryParams

type GetAddressHistoryParams struct {
	Address string `json:"address"`
	Limit   int8   `json:"limit"`
	Offset  int32  `json:"offset"`
}

type GetAddressHistoryResult

type GetAddressHistoryResult struct {
	History []HistoryEntry `json:"history"`
}

func GetAddressHistory

func GetAddressHistory(ctx *Context, params *GetAddressHistoryParams) (*GetAddressHistoryResult, error)

type GetAddressInfoParams

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

type GetBlockByHeightParams

type GetBlockByHeightParams struct {
	Height int32 `json:"height"`
}

type GetBlockByHeightResult

type GetBlockByHeightResult struct {
	Block          Block `json:"block"`
	MaxBlockHeight int32 `json:"height"`
}

func GetBlockByHeight

func GetBlockByHeight(ctx *Context, params *GetBlockByHeightParams) (*GetBlockByHeightResult, error)

type GetBlocksParams

type GetBlocksParams struct {
	Limit  int8  `json:"limit"`
	Offset int32 `json:"offset"`
}

type GetBlocksResult

type GetBlocksResult struct {
	Blocks []Block `json:"blocks"`
	Count  int32   `json:"count"`
}

func GetBlocks

func GetBlocks(ctx *Context, params *GetBlocksParams) (*GetBlocksResult, error)

type GetMempoolTxsParams

type GetMempoolTxsParams struct {
	Limit  int8  `json:"limit"`
	Offset int32 `json:"offset"`
}

type GetMempoolTxsResult

type GetMempoolTxsResult struct {
	Transactions []Transaction `json:"txs""`
}

func GetMempoolTxs

func GetMempoolTxs(ctx *Context, params *GetMempoolTxsParams) (*GetMempoolTxsResult, error)

type GetNameActionsParams

type GetNameActionsParams struct {
	Name   string `json:"name"`
	Limit  int8   `json:"limit"`
	Offset int32  `json:"offset"`
}

type GetNameActionsResult

type GetNameActionsResult struct {
	NameActions []NameAction `json:"actions"`
}

func GetNameActions

func GetNameActions(ctx *Context, params *GetNameActionsParams) (*GetNameActionsResult, error)

type GetNameBidsParams

type GetNameBidsParams struct {
	Name   string `json:"name"`
	Limit  int8   `json:"limit"`
	Offset int32  `json:"offset"`
}

type GetNameBidsResult

type GetNameBidsResult struct {
	NameBids []NameBid `json:"bids"`
}

func GetNameBids

func GetNameBids(ctx *Context, params *GetNameBidsParams) (*GetNameBidsResult, error)

type GetNameParams

type GetNameParams struct {
	Name string `json:"name"`
}

type GetNameRecordsParams

type GetNameRecordsParams struct {
	Name   string `json:"name"`
	Limit  int8   `json:"limit"`
	Offset int32  `json:"offset"`
}

type GetNameRecordsResult

type GetNameRecordsResult struct {
	NameRecords []NameRecord `json:"records"`
}

func GetNameRecords

func GetNameRecords(ctx *Context, params *GetNameRecordsParams) (*GetNameRecordsResult, error)

type GetNameResult

type GetNameResult struct {
	ReservedName       *ReservedName `json:"reserved,omitempty"`
	ReleaseBlockHeight int32         `json:"release_block"`
	BidsCount          int32         `json:"bids_count"`
	RecordsCount       int32         `json:"records_count"`
	ActionsCount       int32         `json:"actions_count"`
	State              State         `json:"state"`
}

func GetName

func GetName(ctx *Context, params *GetNameParams) (*GetNameResult, error)

type GetTransactionByTxidParams

type GetTransactionByTxidParams struct {
	Txid types.Bytes `json:"txid"`
}

type GetTransactionByTxidResult

type GetTransactionByTxidResult Transaction

type GetTransactionsByBlockHeightParams

type GetTransactionsByBlockHeightParams struct {
	BlockHeight int32 `json:"height"`
	Limit       int8  `json:"limit"`
	Offset      int32 `json:"offset"`
}

type GetTransactionsByBlockHeightResult

type GetTransactionsByBlockHeightResult struct {
	Transactions []Transaction `json:"txs"`
}

type HistoryEntry

type HistoryEntry struct {
	TxOutput AddressTxOutput `json:"tx_output"`
	TxInput  AddressTxInput  `json:"tx_input"`
}

type NameAction

type NameAction struct {
	Txid           types.Bytes       `json:"txid"`
	BlockHeight    *int32            `json:"height"`
	CovenantAction db.CovenantAction `json:"covenantAction"`
}

type NameBid

type NameBid struct {
	BidTxid      types.Bytes `json:"bid_txid"`
	BlockHeight  *int32      `json:"height"`
	RevealTxid   types.Bytes `json:"reveal_txid"`
	Winner       bool        `json:"winner,omitempty"`
	RevealHeight *int32      `json:"reveal_height"`
	RevealIndex  *int32      `json:"reveal_index"`
	LockupValue  int64       `json:"lockup"`
	RevealValue  *int64      `json:"reveal"`
}

type NameRecord

type NameRecord struct {
	Txid        types.Bytes `json:"txid"`
	BlockHeight *int32      `json:"height"`
	Data        types.Bytes `json:"data"`
}

type ReservedName

type ReservedName struct {
	OriginName  string      `json:"originName"`
	Name        string      `json:"name"`
	NameHash    types.Bytes `json:"nameHash"`
	ClaimAmount int64       `json:"claimAmount"`
}

type SearchParams

type SearchParams struct {
	Query string `json:"query"`
}

type SearchResult

type SearchResult struct {
	Transaction string `json:"transaction"`
	BlockHeight int32  `json:"block"`
	Name        string `json:"name"`
	Address     string `json:"address"`
}
func Search(ctx *Context, params *SearchParams) (*SearchResult, error)

type State

type State struct {
	OpenHeight      int32        `json:"open_height,omitempty"`
	CurrentState    AuctionState `json:"current_state"`
	AuctionComplete bool         `json:"auction_completed"`
}

type Transaction

type Transaction struct {
	Txid        types.Bytes `json:"txid"`
	BlockHeight *int32      `json:"block_height"`
	WitnessTx   types.Bytes `json:"witnessTx"`
	Fee         int64       `json:"fee"`
	Rate        int64       `json:"rate"`
	Version     int32       `json:"version"`
	Locktime    int64       `json:"locktime"`
	Size        int64       `json:"size"`
	Height      int64       `json:"height"`
	TxInputs    []TxInput   `json:"inputs"`
	TxOutputs   []TxOutput  `json:"outputs"`
}

type TxInput

type TxInput struct {
	HashPrevout  types.Bytes `json:"hashPrevout"`
	IndexPrevout int64       `json:"indexPrevout"`
	Sequence     int64       `json:"sequence"`
}

type TxOutput

type TxOutput struct {
	Value                int64             `json:"value"`
	Address              string            `json:"address"`
	CovenantAction       db.CovenantAction `json:"covenantAction"`
	CovenantNameHash     types.Bytes       `json:"covenantNameHash,omitempty"`
	CovenantHeight       types.Bytes       `json:"covenantHeight,omitempty"`
	CovenantName         types.Bytes       `json:"covenantName,omitempty"`
	CovenantBidHash      types.Bytes       `json:"covenantBidHash,omitempty"`
	CovenantNonce        types.Bytes       `json:"covenantNonce,omitempty"`
	CovenantRecordData   types.Bytes       `json:"covenantRecordData,omitempty"`
	CovenantBlockHash    types.Bytes       `json:"covenantBlockHash,omitempty"`
	CovenantVersion      types.Bytes       `json:"covenantVersion,omitempty"`
	CovenantAddress      types.Bytes       `json:"covenantAddress,omitempty"`
	CovenantClaimHeight  types.Bytes       `json:"covenantClaimHeight,omitempty"`
	CovenantRenewalCount types.Bytes       `json:"covenantRenewalCount,omitempty"`
	Name                 string            `json:"name,omitempty"`
}

Jump to

Keyboard shortcuts

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