Documentation ¶
Index ¶
- Constants
- type AddNewKey
- type BankSendBody
- type DeleteKeyBody
- type Server
- func (s *Server) BankSend(w http.ResponseWriter, r *http.Request)
- func (s *Server) Broadcast(w http.ResponseWriter, r *http.Request)
- func (s *Server) DeleteKey(w http.ResponseWriter, r *http.Request)
- func (s *Server) GetKey(w http.ResponseWriter, r *http.Request)
- func (s *Server) GetKeys(w http.ResponseWriter, r *http.Request)
- func (s *Server) PostKeys(w http.ResponseWriter, r *http.Request)
- func (s *Server) PutKey(w http.ResponseWriter, r *http.Request)
- func (s *Server) Router() *mux.Router
- func (s *Server) SetSdkConfig()
- func (s *Server) Sign(w http.ResponseWriter, r *http.Request)
- func (s *Server) SimulateGas(txbytes []byte) (res uint64, err error)
- func (s *Server) VersionHandler(w http.ResponseWriter, r *http.Request)
- type SignBody
- type UpdateKeyBody
Constants ¶
const ( DefaultBech32MainPrefix = "panacea" DefaultCoinType = 371 DefaultFullFundraiserPath = "44'/371'/0'/0/0" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddNewKey ¶
type AddNewKey struct { Name string `json:"name"` Password string `json:"password"` Mnemonic string `json:"mnemonic,omitempty"` Account int `json:"account,string,omitempty"` Index int `json:"index,string,omitempty"` }
AddNewKey is the necessary data for adding a new key
type BankSendBody ¶
type BankSendBody struct { Sender sdk.AccAddress `json:"sender"` Reciever sdk.AccAddress `json:"reciever"` Amount string `json:"amount"` ChainID string `json:"chain-id"` Memo string `json:"memo,omitempty"` Fees string `json:"fees,omitempty"` GasAdjustment string `json:"gas_adjustment,omitempty"` Gas string `json:"gas,omitempty"` }
BankSendBody contains the necessary data to make a send transaction
func (BankSendBody) Marshal ¶
func (sb BankSendBody) Marshal() []byte
type DeleteKeyBody ¶
type DeleteKeyBody struct {
Password string `json:"password"`
}
DeleteKeyBody request
func (DeleteKeyBody) Marshal ¶
func (u DeleteKeyBody) Marshal() []byte
type Server ¶
type Server struct { Port int `json:"port"` KeyDir string `json:"key_dir"` Node string `json:"node"` Version string `yaml:"version,omitempty"` Commit string `yaml:"commit,omitempty"` Branch string `yaml:"branch,omitempty"` Bech32MainPrefix string CoinType uint32 FullFundraiserPath string }
Server represents the API server
func (*Server) BankSend ¶
func (s *Server) BankSend(w http.ResponseWriter, r *http.Request)
BankSend handles the /tx/bank/send route
func (*Server) DeleteKey ¶
func (s *Server) DeleteKey(w http.ResponseWriter, r *http.Request)
DeleteKey is the handler for the DELETE /keys/{name}
func (*Server) GetKey ¶
func (s *Server) GetKey(w http.ResponseWriter, r *http.Request)
GetKey is the handler for the GET /keys/{name}
func (*Server) GetKeys ¶
func (s *Server) GetKeys(w http.ResponseWriter, r *http.Request)
GetKeys is the handler for the GET /keys
func (*Server) PostKeys ¶
func (s *Server) PostKeys(w http.ResponseWriter, r *http.Request)
PostKeys is the handler for the POST /keys
func (*Server) PutKey ¶
func (s *Server) PutKey(w http.ResponseWriter, r *http.Request)
PutKey is the handler for the PUT /keys/{name}
func (*Server) SetSdkConfig ¶
func (s *Server) SetSdkConfig()
func (*Server) Sign ¶
func (s *Server) Sign(w http.ResponseWriter, r *http.Request)
Sign handles the /tx/sign route
func (*Server) SimulateGas ¶
SimulateGas simulates gas for a transaction
func (*Server) VersionHandler ¶
func (s *Server) VersionHandler(w http.ResponseWriter, r *http.Request)
VersionHandler handles the /version route
type SignBody ¶
type SignBody struct { Tx json.RawMessage `json:"tx"` Name string `json:"name"` Passphrase string `json:"passphrase"` ChainID string `json:"chain_id"` AccountNumber string `json:"account_number"` Sequence string `json:"sequence"` }
SignBody is the body for a sign request
func (SignBody) StdSignMsg ¶
StdSignMsg returns a StdSignMsg from a SignBody request
type UpdateKeyBody ¶
type UpdateKeyBody struct { NewPassword string `json:"new_password"` OldPassword string `json:"old_password"` }
UpdateKeyBody update key password request REST body
func (UpdateKeyBody) Marshal ¶
func (u UpdateKeyBody) Marshal() []byte