apimodels

package
v0.7.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2020 License: ISC Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddedChainBlock

type AddedChainBlock struct {
	Hash                string   `json:"hash"`
	AcceptedBlockHashes []string `json:"acceptedBlockHashes"`
}

AddedChainBlock is a json representation of an added chain block and its accepted blocks.

type BlockResponse

type BlockResponse struct {
	BlockHash               string   `json:"blockHash"`
	Version                 int32    `json:"version"`
	HashMerkleRoot          string   `json:"hashMerkleRoot"`
	AcceptedIDMerkleRoot    string   `json:"acceptedIDMerkleRoot"`
	UTXOCommitment          string   `json:"utxoCommitment"`
	Timestamp               uint64   `json:"timestamp"`
	Bits                    uint32   `json:"bits"`
	Nonce                   uint64   `json:"nonce"`
	ParentBlockHashes       []string `json:"parentBlockHashes"`
	AcceptingBlockHash      *string  `json:"acceptingBlockHash"`
	AcceptedBlockHashes     []string `json:"acceptedBlockHashes"`
	AcceptingBlockBlueScore *uint64  `json:"acceptingBlockBlueScore"`
	BlueScore               uint64   `json:"blueScore"`
	IsChainBlock            bool     `json:"isChainBlock"`
	Mass                    uint64   `json:"mass"`
	Confirmations           *uint64  `json:"confirmations,omitempty"`
}

BlockResponse is a json representation of a block

func ConvertBlockModelToBlockResponse

func ConvertBlockModelToBlockResponse(block *dbmodels.Block, selectedTipBlueScore uint64) *BlockResponse

ConvertBlockModelToBlockResponse converts a block database object into a BlockResponse

type FeeEstimateResponse

type FeeEstimateResponse struct {
	HighPriority   float64 `json:"highPriority"`
	NormalPriority float64 `json:"normalPriority"`
	LowPriority    float64 `json:"lowPriority"`
}

FeeEstimateResponse is a json representation of a fee estimate

type RawTransaction

type RawTransaction struct {
	RawTransaction string `json:"rawTransaction"`
}

RawTransaction is a json representation of a raw transaction

type SelectedParentChainNotification

type SelectedParentChainNotification struct {
	AddedChainBlocks   []*AddedChainBlock `json:"addedChainBlocks"`
	RemovedBlockHashes []string           `json:"removedBlockHashes"`
}

SelectedParentChainNotification is a json representation of selected-parent-chain MQTT notification data.

type TransactionInputResponse

type TransactionInputResponse struct {
	TransactionID                  string `json:"transactionId,omitempty"`
	PreviousTransactionID          string `json:"previousTransactionId"`
	PreviousTransactionOutputIndex uint32 `json:"previousTransactionOutputIndex"`
	SignatureScript                string `json:"signatureScript"`
	Sequence                       uint64 `json:"sequence"`
	Address                        string `json:"address"`
	Index                          uint32 `json:"index"`
}

TransactionInputResponse is a json representation of a transaction input

type TransactionOutputResponse

type TransactionOutputResponse struct {
	TransactionID           string  `json:"transactionId,omitempty"`
	Value                   uint64  `json:"value"`
	ScriptPubKey            string  `json:"scriptPubKey"`
	Address                 string  `json:"address,omitempty"`
	AcceptingBlockHash      *string `json:"acceptingBlockHash,omitempty"`
	AcceptingBlockBlueScore *uint64 `json:"acceptingBlockBlueScore,omitempty"`
	Index                   uint32  `json:"index"`
	IsSpent                 bool    `json:"isSpent"`
	IsCoinbase              *bool   `json:"isCoinbase,omitempty"`
	IsSpendable             *bool   `json:"isSpendable,omitempty"`
	Confirmations           *uint64 `json:"confirmations,omitempty"`
}

TransactionOutputResponse is a json representation of a transaction output

func ConvertTransactionOutputModelToTransactionOutputResponse

func ConvertTransactionOutputModelToTransactionOutputResponse(transactionOutput *dbmodels.TransactionOutput,
	selectedTipBlueScore uint64, activeNetParams *dagconfig.Params, isSpent bool) (*TransactionOutputResponse, error)

ConvertTransactionOutputModelToTransactionOutputResponse converts a transaction output database object into a TransactionOutputResponse

type TransactionResponse

type TransactionResponse struct {
	TransactionHash         string                       `json:"transactionHash"`
	TransactionID           string                       `json:"transactionId"`
	AcceptingBlockHash      *string                      `json:"acceptingBlockHash"`
	AcceptingBlockBlueScore *uint64                      `json:"acceptingBlockBlueScore,omitempty"`
	SubnetworkID            string                       `json:"subnetworkId"`
	LockTime                uint64                       `json:"lockTime"`
	Gas                     uint64                       `json:"gas,omitempty"`
	PayloadHash             string                       `json:"payloadHash,omitempty"`
	Payload                 string                       `json:"payload,omitempty"`
	Inputs                  []*TransactionInputResponse  `json:"inputs"`
	Outputs                 []*TransactionOutputResponse `json:"outputs"`
	Mass                    uint64                       `json:"mass"`
	Version                 int32                        `json:"version"`
	Raw                     string                       `json:"raw"`
	Confirmations           *uint64                      `json:"confirmations,omitempty"`
}

TransactionResponse is a json representation of a transaction

func ConvertTxModelToTxResponse

func ConvertTxModelToTxResponse(tx *dbmodels.Transaction, selectedTipBlueScore uint64) *TransactionResponse

ConvertTxModelToTxResponse converts a transaction database object to a TransactionResponse

type TransactionsResponse

type TransactionsResponse struct {
	Transactions []*TransactionResponse `json:"transactions"`
}

TransactionsResponse is a json representation of a transactions response

Jump to

Keyboard shortcuts

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