You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
1.2 KiB

  1. package types
  2. import "github.com/tendermint/go-crypto/keys"
  3. // CreateKeyRequest is sent to create a new key
  4. type CreateKeyRequest struct {
  5. Name string `json:"name" validate:"required,min=4,printascii"`
  6. Passphrase string `json:"passphrase" validate:"required,min=10"`
  7. Algo string `json:"algo"`
  8. }
  9. // DeleteKeyRequest to destroy a key permanently (careful!)
  10. type DeleteKeyRequest struct {
  11. Name string `json:"name" validate:"required,min=4,printascii"`
  12. Passphrase string `json:"passphrase" validate:"required,min=10"`
  13. }
  14. // UpdateKeyRequest is sent to update the passphrase for an existing key
  15. type UpdateKeyRequest struct {
  16. Name string `json:"name" validate:"required,min=4,printascii"`
  17. OldPass string `json:"passphrase" validate:"required,min=10"`
  18. NewPass string `json:"new_passphrase" validate:"required,min=10"`
  19. }
  20. // ErrorResponse is returned for 4xx and 5xx errors
  21. type ErrorResponse struct {
  22. Success bool `json:"success"`
  23. Error string `json:"error"` // error message if Success is false
  24. Code int `json:"code"` // error code if Success is false
  25. }
  26. type CreateKeyResponse struct {
  27. Key keys.Info `json:"key"`
  28. Seed string `json:"seed_phrase"`
  29. }