testnet

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2020 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Proxy

type Proxy struct {
	URL string
}

Proxy is a testnet proxy

func NewProxy

func NewProxy(url string) *Proxy

NewProxy creates a testnet proxy

func (*Proxy) GetNonce

func (proxy *Proxy) GetNonce(addressBytes []byte) (uint64, error)

GetNonce gets the nonce by address

func (*Proxy) QuerySC

func (proxy *Proxy) QuerySC(request SCQueryRequest) (*vmcommon.VMOutput, error)

QuerySC queries SC values

func (*Proxy) SendTransaction

func (proxy *Proxy) SendTransaction(txBuff []byte) (*SendTransactionResponse, error)

SendTransaction sends a transaction

type SCQueryRequest

type SCQueryRequest struct {
	ScAddress string   `form:"scAddress" json:"scAddress"`
	FuncName  string   `form:"funcName" json:"funcName"`
	Args      []string `form:"args"  json:"args"`
}

SCQueryRequest is a REST request object

type SCQueryResponse

type SCQueryResponse struct {
	Error string            `json:"error"`
	Data  vmcommon.VMOutput `json:"data"`
}

SCQueryResponse is a REST response object

type SendTransactionResponse

type SendTransactionResponse struct {
	Message string                          `json:"message"`
	Error   string                          `json:"error"`
	TxHash  string                          `json:"txHash,omitempty"`
	TxResp  *SendTransactionResponsePayload `json:"transaction,omitempty"`
}

SendTransactionResponse is a REST response object

type SendTransactionResponsePayload

type SendTransactionResponsePayload 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"`
	ShardID     uint32   `json:"shardId"`
	Hash        string   `json:"hash"`
	BlockNumber uint64   `json:"blockNumber"`
	BlockHash   string   `json:"blockHash"`
	Timestamp   uint64   `json:"timestamp"`
}

SendTransactionResponsePayload is a REST response object (substructure)

Jump to

Keyboard shortcuts

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