transaction

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2021 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputeTransactionGasLimit

func ComputeTransactionGasLimit(c *gin.Context)

ComputeTransactionGasLimit returns how many gas units a transaction wil consume

func GetTransaction

func GetTransaction(c *gin.Context)

GetTransaction returns transaction details for a given txhash

func Routes

func Routes(router *wrapper.RouterWrapper)

Routes defines transaction related routes

func SendMultipleTransactions

func SendMultipleTransactions(c *gin.Context)

SendMultipleTransactions will receive a number of transactions and will propagate them for processing

func SendTransaction

func SendTransaction(c *gin.Context)

SendTransaction will receive a transaction from the client and propagate it for processing

func SimulateTransaction added in v1.1.1

func SimulateTransaction(c *gin.Context)

SimulateTransaction will receive a transaction from the client and will simulate it's execution and return the results

Types

type FacadeHandler added in v1.0.139

type FacadeHandler interface {
	CreateTransaction(nonce uint64, value string, receiver string, receiverUsername []byte, sender string, senderUsername []byte, gasPrice uint64,
		gasLimit uint64, data []byte, signatureHex string, chainID string, version uint32, options uint32) (*transaction.Transaction, []byte, error)
	ValidateTransaction(tx *transaction.Transaction) error
	ValidateTransactionForSimulation(tx *transaction.Transaction, checkSignature bool) error
	SendBulkTransactions([]*transaction.Transaction) (uint64, error)
	SimulateTransactionExecution(tx *transaction.Transaction) (*transaction.SimulationResults, error)
	GetTransaction(hash string, withResults bool) (*transaction.ApiTransactionResult, error)
	ComputeTransactionGasLimit(tx *transaction.Transaction) (*transaction.CostResponse, error)
	EncodeAddressPubkey(pk []byte) (string, error)
	GetThrottlerForEndpoint(endpoint string) (core.Throttler, bool)
	IsInterfaceNil() bool
}

FacadeHandler interface defines methods that can be used by the gin webserver

type MultipleTxRequest

type MultipleTxRequest struct {
	Receiver string   `form:"receiver" json:"receiver"`
	Value    *big.Int `form:"value" json:"value"`
	TxCount  int      `form:"txCount" json:"txCount"`
}

MultipleTxRequest represents the structure on which user input for generating a bulk of transactions will validate against

type SendTxRequest

type SendTxRequest struct {
	Sender           string `form:"sender" json:"sender"`
	Receiver         string `form:"receiver" json:"receiver"`
	SenderUsername   []byte `json:"senderUsername,omitempty"`
	ReceiverUsername []byte `json:"receiverUsername,omitempty"`
	Value            string `form:"value" json:"value"`
	Data             []byte `form:"data" json:"data"`
	Nonce            uint64 `form:"nonce" json:"nonce"`
	GasPrice         uint64 `form:"gasPrice" json:"gasPrice"`
	GasLimit         uint64 `form:"gasLimit" json:"gasLimit"`
	Signature        string `form:"signature" json:"signature"`
	ChainID          string `form:"chainID" json:"chainID"`
	Version          uint32 `form:"version" json:"version"`
	Options          uint32 `json:"options,omitempty"`
}

SendTxRequest represents the structure that maps and validates user input for publishing a new transaction

type TxRequest

type TxRequest struct {
	Sender   string   `form:"sender" json:"sender"`
	Receiver string   `form:"receiver" json:"receiver"`
	Value    *big.Int `form:"value" json:"value"`
	Data     string   `form:"data" json:"data"`
}

TxRequest represents the structure on which user input for generating a new transaction will validate against

type TxResponse

type TxResponse struct {
	SendTxRequest
	ShardID     uint32 `json:"shardId"`
	Hash        string `json:"hash"`
	BlockNumber uint64 `json:"blockNumber"`
	BlockHash   string `json:"blockHash"`
	Timestamp   uint64 `json:"timestamp"`
}

TxResponse represents the structure on which the response will be validated against

Jump to

Keyboard shortcuts

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