Documentation ¶
Index ¶
- Constants
- type AddNewKey
- type BankSendBody
- type DeleteKeyBody
- type EncodeResponse
- 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) EncodeTx(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) 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 ( // Bech32PrefixAccAddr defines the Bech32 prefix of an account's address Bech32PrefixAccAddr = "terra" // Bech32PrefixAccPub defines the Bech32 prefix of an account's public key Bech32PrefixAccPub = "terrapub" // Bech32PrefixValAddr defines the Bech32 prefix of a validator's operator address Bech32PrefixValAddr = "terravaloper" // Bech32PrefixValPub defines the Bech32 prefix of a validator's operator public key Bech32PrefixValPub = "terravaloperpub" // Bech32PrefixConsAddr defines the Bech32 prefix of a consensus node address Bech32PrefixConsAddr = "terravalcons" // Bech32PrefixConsPub defines the Bech32 prefix of a consensus node public key Bech32PrefixConsPub = "terravalconspub" )
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"` Gas string `json:"gas,omitempty"` GasPrices string `json:"gas_prices,omitempty"` GasAdjustment string `json:"gas_adjustment,omitempty"` }
BankSendBody contains the necessary data to make a send transaction
type DeleteKeyBody ¶
type DeleteKeyBody struct {
Password string `json:"password"`
}
DeleteKeyBody request
type EncodeResponse ¶
EncodeResopnse nolint
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"` }
Server represents the API server
func (*Server) BankSend ¶
func (s *Server) BankSend(w http.ResponseWriter, r *http.Request)
TODO - query epoch & query tax-rate & query tax-cap & compute fee (stability & gas) BankSend handles the /tx/bank/send route
func (*Server) Broadcast ¶
func (s *Server) Broadcast(w http.ResponseWriter, r *http.Request)
Marshal - no-lint
func (*Server) DeleteKey ¶
func (s *Server) DeleteKey(w http.ResponseWriter, r *http.Request)
DeleteKey is the handler for the DELETE /keys/{name}
func (*Server) EncodeTx ¶
func (s *Server) EncodeTx(w http.ResponseWriter, r *http.Request)
Marshal - no-lint
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) 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