Documentation
¶
Index ¶
- func GenerateAndSendBulkTransactions(c *gin.Context)
- func GenerateAndSendBulkTransactionsOneByOne(c *gin.Context)
- func GenerateTransaction(c *gin.Context)
- func GetTransaction(c *gin.Context)
- func RecentTransactions(c *gin.Context)
- func Routes(router *gin.RouterGroup)
- func RoutesForTransactionsLists(router *gin.RouterGroup)
- func SendTransaction(c *gin.Context)
- type MultipleTxRequest
- type SendTxRequest
- type TxRequest
- type TxResponse
- type TxService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateAndSendBulkTransactions ¶
GenerateAndSendBulkTransactions generates multipleTransactions
func GenerateAndSendBulkTransactionsOneByOne ¶
GenerateAndSendBulkTransactionsOneByOne generates multipleTransactions in a one-by-one fashion
func GenerateTransaction ¶
GenerateTransaction generates a new transaction given a sender, receiver, value and data
func GetTransaction ¶
GetTransaction returns transaction details for a given txhash
func RecentTransactions ¶
RecentTransactions returns the list of latest transactions from all shards
func RoutesForTransactionsLists ¶
func RoutesForTransactionsLists(router *gin.RouterGroup)
RoutesForTransactionsLists defines routes related to lists of transactions. Used separately so it will not conflict with the wildcard for transaction details route
func SendTransaction ¶
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 *big.Int `form:"gasPrice" json:"gasPrice"` GasLimit *big.Int `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) SendTransaction(nonce uint64, sender string, receiver string, value *big.Int, code string, signature []byte) (*transaction.Transaction, error) GetTransaction(hash string) (*transaction.Transaction, error) GenerateAndSendBulkTransactions(string, *big.Int, uint64) error GenerateAndSendBulkTransactionsOneByOne(string, *big.Int, uint64) error }
TxService interface defines methods that can be used from `numbatFacade` context variable