transaction

package
v1.0.28 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2019 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateAndSendBulkTransactions added in v1.0.3

func GenerateAndSendBulkTransactions(c *gin.Context)

GenerateAndSendBulkTransactions generates multipleTransactions

func GenerateAndSendBulkTransactionsOneByOne added in v1.0.3

func GenerateAndSendBulkTransactionsOneByOne(c *gin.Context)

GenerateAndSendBulkTransactionsOneByOne generates multipleTransactions in a one-by-one fashion

func GenerateTransaction added in v1.0.3

func GenerateTransaction(c *gin.Context)

GenerateTransaction generates a new transaction given a sender, receiver, value and data

func GetTransaction

func GetTransaction(c *gin.Context)

GetTransaction returns transaction details for a given txhash

func Routes

func Routes(router *gin.RouterGroup)

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

Types

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"`
	Value     *big.Int `form:"value" json:"value"`
	Data      string   `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"`
	Challenge string   `form:"challenge" json:"challenge"`
}

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

type TxService

type TxService interface {
	GenerateTransaction(sender string, receiver string, value *big.Int, code string) (*transaction.Transaction, error)
	CreateTransaction(nonce uint64, value *big.Int, receiverHex string, senderHex string, gasPrice uint64, gasLimit uint64, data string, signatureHex string, challenge string) (*transaction.Transaction, error)
	SendTransaction(nonce uint64, sender string, receiver string, value *big.Int, gasPrice uint64, gasLimit uint64, code string, signature []byte) (string, error)
	SendBulkTransactions([]*transaction.Transaction) (uint64, error)
	GetTransaction(hash string) (*transaction.Transaction, error)
	GenerateAndSendBulkTransactions(string, *big.Int, uint64) error
	GenerateAndSendBulkTransactionsOneByOne(string, *big.Int, uint64) error
	IsInterfaceNil() bool
}

TxService interface defines methods that can be used from `elrondFacade` context variable

Jump to

Keyboard shortcuts

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