apimodels

package
v0.0.0-...-fa2bc5f Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2021 License: ISC Imports: 7 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              uint16   `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"`
	BlueScore            uint64   `json:"blueScore"`
	TransactionCount     uint16   `json:"transactionCount"`
	Difficulty           float64  `json:"difficulty"`
	TransactionIDs       []string `json:"transactionIds"`
}

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 TransactionDoubleSpendsResponse

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

TransactionDoubleSpendsResponse is a json representation of transaction doublespends response

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"`
	Value                          uint64 `json:"value"`
	Index                          uint32 `json:"index"`
	HasKnownPreviousOutput         bool   `json:"hasKnownPreviousOutput"`
}

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"`
	Payload                 string                       `json:"payload,omitempty"`
	Inputs                  []*TransactionInputResponse  `json:"inputs"`
	Outputs                 []*TransactionOutputResponse `json:"outputs"`
	Mass                    uint64                       `json:"mass"`
	Version                 uint16                       `json:"version"`
	Blocks                  []*BlockResponse             `json:"blocks"`
}

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