rest

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2021 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AccountListRequestHandlerFn

func AccountListRequestHandlerFn(w http.ResponseWriter, r *http.Request)

func ExportAccountRequestHandlerFn added in v1.0.1

func ExportAccountRequestHandlerFn(cliCtx context.CLIContext, cdc *codec.Codec) http.HandlerFunc

func GetAccountTxsFn

func GetAccountTxsFn(cliCtx context.CLIContext, cdc *codec.Codec) http.HandlerFunc

GetAccountTxsFn @param Address: address of account @param FromHeight: query tx in the block height range [fromHeight,endHeight]; when FromHeight and endHeight is 0, range is [CHAIN_HEIGHT-800, CHAIN_HEIGHT] @param EndHeight: query tx in the block height range [fromHeight,endHeight] when FromHeight and endHeight is 0, range is [CHAIN_HEIGHT-800, CHAIN_HEIGHT] @param Flag: query flag; 0, address appears both in fromAddress and toAddress; 1, address appears in fromAddress; 2, address appears in toAddress

func NewAccountRequestHandlerFn

func NewAccountRequestHandlerFn(w http.ResponseWriter, r *http.Request)

func QueryAccountRequestHandlerFn

func QueryAccountRequestHandlerFn(
	storeName string, cdc *codec.Codec,
	decoder auth.AccountDecoder, cliCtx context.CLIContext,
) http.HandlerFunc

query accountREST Handler

func QueryBalancesRequestHandlerFn

func QueryBalancesRequestHandlerFn(
	storeName string, cdc *codec.Codec,
	decoder auth.AccountDecoder, cliCtx context.CLIContext,
) http.HandlerFunc

query accountREST Handler

func RegisterRoute

func RegisterRoute(cliCtx context.CLIContext, r *mux.Router, cdc *codec.Codec, storeName string)

register REST route

func RegisterRoutes

func RegisterRoutes(cliCtx context.CLIContext, r *mux.Router, cdc *codec.Codec)

resgister REST routes

Types

type AccountBody

type AccountBody struct {
	Type  string     `json:"type"`
	Value NewAccInfo `json:"value"`
}

type AccountTxsReq

type AccountTxsReq struct {
	Address    string `json:"address"`
	FromHeight int64  `json:"fromHeight"`
	EndHeight  int64  `json:"endHeight"`
	Flag       int64  `json:"flag"`
}

type CreateShiftReq

type CreateShiftReq struct {
	//BaseReq    rest.BaseReq     `json:"base_req"`
	BaseReq SendDataBaseReq `json:"base_req"`
	To      string          `json:"to"`
	Amount  []sdk.BigCoin   `json:"amount"`
	Encode  bool            `json:"encode"`
}

create

type DisplayTx

type DisplayTx struct {
	From       string
	To         string
	Amount     []sdk.BigCoin
	Hash       string
	Height     int64
	Time       string
	Memo       string
	Data       string
	TxClassify uint32
	TypeName   string
}

type ExportAccountBody added in v1.0.1

type ExportAccountBody struct {
	Address  string `json:"address"`
	Password string `json:"password"`
}

type NewAccInfo

type NewAccInfo struct {
	Address       sdk.AccAddress `json:"address"`
	Coins         []sdk.BigCoin  `json:"coins"`
	PubKey        crypto.PubKey  `json:"public_key"`
	AccountNumber uint64         `json:"account_number"`
	Sequence      uint64         `json:"sequence"`
}

accinfo

type ResultAccountTxs

type ResultAccountTxs struct {
	ChainHeight int64
	FromHeight  int64
	EndHeight   int64
	ArrTx       []DisplayTx
}

type ResultExportAccount added in v1.0.1

type ResultExportAccount struct {
	PrivateKey string `json:"private_key"`
}

type SendDataBaseReq

type SendDataBaseReq struct {
	From          string `json:"from"`
	Password      string `json:"password"`
	Memo          string `json:"memo"`
	ChainID       string `json:"chain_id"`
	AccountNumber uint64 `json:"account_number"`
	Sequence      uint64 `json:"sequence"`
	GasPrice      string `json:"gas_price"`
	GasWanted     string `json:"gas_wanted"`
	GasAdjustment string `json:"gas_adjustment"`
	GenerateOnly  bool   `json:"generate_only"`
	Simulate      bool   `json:"simulate"`
}

type SendShiftReq

type SendShiftReq struct {
	BaseReq   SendDataBaseReq `json:"base_req"`
	To        string          `json:"to"`
	Amount    []sdk.BigCoin   `json:"amount"`
	Data      string          `json:"data"`
	GasPrice  string          `json:"gas_price"`  // unit: HTDF/gallon
	GasWanted string          `json:"gas_wanted"` // unit: gallon
}

send

Jump to

Keyboard shortcuts

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