api

package
v0.0.0-...-7bd4979 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2019 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddressStateResponse

type AddressStateResponse struct {
	Address      string                `json:"address" bson:"address"`
	Balance      string                `json:"balance" bson:"balance"`
	Nonce        string                `json:"nonce" bson:"nonce"`
	OtsBitfield  []string              `json:"otsBitField" bson:"otsBitField"`
	Transactions []TransactionResponse `json:"transactions" bson:"transactions"`
	OtsCounter   string                `json:"otsCounter" bson:"otsCounter"`
}

type BlockHeader

type BlockHeader struct {
	Difficulty uint64 `json:"difficulty"`
	Height     uint64 `json:"height"`
	Timestamp  uint64 `json:"timestamp"`
	Reward     uint64 `json:"reward"`
	Hash       string `json:"hash"`
	Depth      uint64 `json:"depth"`
}

type BlockHeaderRequest

type BlockHeaderRequest struct {
	Height uint64 `json:"height"`
}

type BlockHeaderResponse

type BlockHeaderResponse struct {
	BlockHeader *BlockHeader `json:"block_header"`
	Status      string       `json:"status"`
}

type BlockResponse

type BlockResponse struct {
	HeaderHash  string `json:"headerHash"`
	BlockNumber uint64 `json:"blockNumber"`
	Timestamp   string `json:"timestamp"`
}

type BlockTemplate

type BlockTemplate struct {
	Blob           string `json:"blocktemplate_blob"`
	Difficulty     uint64 `json:"difficulty"`
	Height         uint64 `json:"height"`
	ReservedOffset uint32 `json:"reserved_offset"`
	Status         string `json:"status"`
}

type BlockTemplateRequest

type BlockTemplateRequest struct {
	ReserveSize   uint64 `json:"reserve_size"`
	WalletAddress string `json:"wallet_address"`
}

type BroadcastTransferTransactionRespose

type BroadcastTransferTransactionRespose struct {
	TransactionHash string `json:"transactionHash"`
}

type GetEstimatedNetworkFeeResponse

type GetEstimatedNetworkFeeResponse struct {
	Fee string `json:"fee"`
}

type GetHeightResponse

type GetHeightResponse struct {
	Height uint64 `json:"height"`
}

type GetVersionResponse

type GetVersionResponse struct {
	Version string `json:"version"`
}

type MiningAPIServer

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

func NewMiningAPIServer

func NewMiningAPIServer(c *chain.Chain, registerAndBroadcastChan chan *messages.RegisterMessage) *MiningAPIServer

func (*MiningAPIServer) GetBlockHeaderByHeight

func (m *MiningAPIServer) GetBlockHeaderByHeight(height uint64, w http.ResponseWriter)

func (*MiningAPIServer) GetBlockTemplate

func (m *MiningAPIServer) GetBlockTemplate(walletAddress string, w http.ResponseWriter)

func (*MiningAPIServer) GetLastBlockHeader

func (m *MiningAPIServer) GetLastBlockHeader(w http.ResponseWriter)

func (*MiningAPIServer) Handler

func (m *MiningAPIServer) Handler(w http.ResponseWriter, req *http.Request)

func (*MiningAPIServer) Start

func (m *MiningAPIServer) Start() error

func (*MiningAPIServer) SubmitBlock

func (m *MiningAPIServer) SubmitBlock(blob string, w http.ResponseWriter)

func (*MiningAPIServer) Transfer

func (m *MiningAPIServer) Transfer(w http.ResponseWriter, req *http.Request)

type PublicAPIServer

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

func NewPublicAPIServer

func NewPublicAPIServer(c *chain.Chain, registerAndBroadcastChan chan *messages.RegisterMessage) *PublicAPIServer

func (*PublicAPIServer) BroadcastTransferTx

func (p *PublicAPIServer) BroadcastTransferTx(w http.ResponseWriter, r *http.Request)

func (*PublicAPIServer) GetAddressState

func (p *PublicAPIServer) GetAddressState(w http.ResponseWriter, r *http.Request)

func (*PublicAPIServer) GetBalance

func (p *PublicAPIServer) GetBalance(w http.ResponseWriter, r *http.Request)

func (*PublicAPIServer) GetBlockByHash

func (p *PublicAPIServer) GetBlockByHash(w http.ResponseWriter, r *http.Request)

func (*PublicAPIServer) GetBlockByNumber

func (p *PublicAPIServer) GetBlockByNumber(w http.ResponseWriter, r *http.Request)

func (*PublicAPIServer) GetEstimatedNetworkFee

func (p *PublicAPIServer) GetEstimatedNetworkFee(w http.ResponseWriter, r *http.Request)

func (*PublicAPIServer) GetHeight

func (p *PublicAPIServer) GetHeight(w http.ResponseWriter, r *http.Request)

func (*PublicAPIServer) GetLastBlock

func (p *PublicAPIServer) GetLastBlock(w http.ResponseWriter, r *http.Request)

func (*PublicAPIServer) GetNetworkStats

func (p *PublicAPIServer) GetNetworkStats(w http.ResponseWriter, r *http.Request)

func (*PublicAPIServer) GetTxByHash

func (p *PublicAPIServer) GetTxByHash(w http.ResponseWriter, r *http.Request)

func (*PublicAPIServer) GetUnusedOTSIndex

func (p *PublicAPIServer) GetUnusedOTSIndex(w http.ResponseWriter, r *http.Request)

func (*PublicAPIServer) GetVersion

func (p *PublicAPIServer) GetVersion(w http.ResponseWriter, r *http.Request)

func (*PublicAPIServer) RedirectToAPIDoc

func (p *PublicAPIServer) RedirectToAPIDoc(w http.ResponseWriter, r *http.Request)

func (*PublicAPIServer) Start

func (p *PublicAPIServer) Start() error

type RPCRequest

type RPCRequest struct {
	Id      string          `json:"id"`
	JsonRPC string          `json:"jsonrpc"`
	Method  string          `json:"method"`
	Params  json.RawMessage `json:"params"`
}

type RPCResponse

type RPCResponse struct {
	Result  interface{} `json:"result"`
	Id      string      `json:"id"`
	JsonRPC string      `json:"jsonrpc"`
}

type Response

type Response struct {
	Error        uint        `json:"error"`
	ErrorMessage string      `json:"errorMessage"`
	Data         interface{} `json:"data"`
}

type SubmitBlockResponse

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

type TransactionResponse

type TransactionResponse interface {
	GetSignerAddress() string
}

type TransferTransactionResponse

type TransferTransactionResponse struct {
	AddressFrom     string         `json:"addressFrom"`
	SignerAddress   string         `json:"signerAddress"`
	Fee             string         `json:"fee"`
	PublicKey       string         `json:"publicKey"`
	Signature       string         `json:"signature"`
	Nonce           string         `json:"nonce"`
	TransactionHash string         `json:"transactionHash"`
	TransactionType string         `json:"transactionType"`
	AddressesTo     []string       `json:"addressesTo"`
	Amounts         []string       `json:"amounts"`
	TotalAmount     string         `json:"totalAmount"`
	Block           *BlockResponse `json:"block"`
}

func (*TransferTransactionResponse) GetSignerAddress

func (tr *TransferTransactionResponse) GetSignerAddress() string

Jump to

Keyboard shortcuts

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