dto

package
v0.0.0-...-9372525 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: GPL-3.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	Address string `json:"address"`
	Nonce   string `json:"nonce"`
	Balance string `json:"balance"`
}

type AccountResponse

type AccountResponse struct {
	Account Account `json:"account"`
}

type Block

type Block struct {
	Hash          string    `json:"hash"`
	Version       uint32    `json:"version"`
	DataHash      string    `json:"dataHash"`
	PrevBlockHash string    `json:"prevBlockHash"`
	Height        int32     `json:"height"`
	Timestamp     int64     `json:"timestamp"`
	Signer        string    `json:"signer"`
	Extra         string    `json:"extra"`
	Signature     Signature `json:"signature"`
	TxCount       uint32    `json:"txCount"`
	Transactions  []string  `json:"transactions"`
}

func CreateBlock

func CreateBlock(
	hash string,
	version uint32,
	dataHash string,
	prevBlockHash string,
	height int32,
	timestamp int64,
	signer string,
	extra string,
	signature Signature,
	txCount uint32,
	transactions []string) Block

type BlockResponse

type BlockResponse struct {
	Block Block `json:"block"`
}

func CreateBlockResponse

func CreateBlockResponse(block Block) BlockResponse

type BlocksResponse

type BlocksResponse struct {
	Blocks     []Block `json:"blocks"`
	TotalCount uint32  `json:"totalCount"`
}

func CreateBlocksResponse

func CreateBlocksResponse(blocks []Block, totalCount uint32) BlocksResponse

type FaucetRequest

type FaucetRequest struct {
	AccountAddress string `json:"accountAddress"`
}

type Signature

type Signature struct {
	R string `json:"r"`
	S string `json:"s"`
}

func CreateSignature

func CreateSignature(r string, s string) Signature

type Signer

type Signer struct {
	X string `json:"x"`
	Y string `json:"y"`
}

func CreateSigner

func CreateSigner(x string, y string) Signer

type Transaction

type Transaction struct {
	Hash        string    `json:"hash"`
	Nonce       string    `json:"nonce"`
	BlockHeight int32     `json:"blockHeight"`
	Timestamp   int64     `json:"timestamp"`
	From        string    `json:"from"`
	To          string    `json:"to"`
	Value       string    `json:"value"`
	Data        string    `json:"data"`
	Signer      Signer    `json:"signer"`
	Signature   Signature `json:"signature"`
}

func CreateTransaction

func CreateTransaction(
	hash string,
	nonce string,
	blockHeight int32,
	timestamp int64,
	from string,
	to string,
	value string,
	data string,
	signer Signer,
	signature Signature) Transaction

type TransactionRequest

type TransactionRequest struct {
	Nonce      string `json:"nonce"`
	From       string `json:"from"`
	To         string `json:"to"`
	Value      string `json:"value"`
	Data       string `json:"data"`
	SignerX    string `json:"signerX"`
	SignerY    string `json:"signerY"`
	SignatureR string `json:"signatureR"`
	SignatureS string `json:"signatureS"`
}

type TransactionResponse

type TransactionResponse struct {
	Transaction Transaction `json:"transaction"`
}

func CreateTransactionResponse

func CreateTransactionResponse(transaction Transaction) TransactionResponse

type TransactionsResponse

type TransactionsResponse struct {
	Transactions []Transaction `json:"transactions"`
	TotalCount   uint32        `json:"totalCount"`
}

func CreateTransactionsResponse

func CreateTransactionsResponse(transactions []Transaction, totalCount uint32) TransactionsResponse

Jump to

Keyboard shortcuts

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