Documentation ¶
Overview ¶
Copyright 2018 The go-ethereum Authors This file is part of go-ethereum.
go-ethereum is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
go-ethereum is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
Index ¶
- Constants
- Variables
- func MethodSelectorToAbi(selector string) ([]byte, error)
- func SignCliqueHeader(header *types.Header) (hexutil.Bytes, error)
- func SignTextValidator(validatorData ValidatorData) (hexutil.Bytes, string)
- func ValidatePasswordFormat(password string) error
- type AbiDb
- type Account
- type Accounts
- type AuditLogger
- func (l *AuditLogger) EcRecover(ctx context.Context, data hexutil.Bytes, sig hexutil.Bytes) (common.Address, error)
- func (l *AuditLogger) Export(ctx context.Context, addr common.Address) (json.RawMessage, error)
- func (l *AuditLogger) List(ctx context.Context) ([]common.Address, error)
- func (l *AuditLogger) New(ctx context.Context) (accounts.Account, error)
- func (l *AuditLogger) SignData(ctx context.Context, contentType string, addr common.MixedcaseAddress, ...) (hexutil.Bytes, error)
- func (l *AuditLogger) SignTransaction(ctx context.Context, args SendTxArgs, methodSelector *string) (*ethapi.SignTransactionResult, error)
- func (l *AuditLogger) SignTypedData(ctx context.Context, addr common.MixedcaseAddress, data TypedData) (hexutil.Bytes, error)
- func (l *AuditLogger) Version(ctx context.Context) (string, error)
- type CommandlineUI
- func (ui *CommandlineUI) ApproveExport(request *ExportRequest) (ExportResponse, error)
- func (ui *CommandlineUI) ApproveImport(request *ImportRequest) (ImportResponse, error)
- func (ui *CommandlineUI) ApproveListing(request *ListRequest) (ListResponse, error)
- func (ui *CommandlineUI) ApproveNewAccount(request *NewAccountRequest) (NewAccountResponse, error)
- func (ui *CommandlineUI) ApproveSignData(request *SignDataRequest) (SignDataResponse, error)
- func (ui *CommandlineUI) ApproveTx(request *SignTxRequest) (SignTxResponse, error)
- func (ui *CommandlineUI) OnApprovedTx(tx ethapi.SignTransactionResult)
- func (ui *CommandlineUI) OnInputRequired(info UserInputRequest) (UserInputResponse, error)
- func (ui *CommandlineUI) OnSignerStartup(info StartupInfo)
- func (ui *CommandlineUI) ShowError(message string)
- func (ui *CommandlineUI) ShowInfo(message string)
- type ExportRequest
- type ExportResponse
- type ExternalAPI
- type ImportRequest
- type ImportResponse
- type ListRequest
- type ListResponse
- type Message
- type Metadata
- type NameValueType
- type NewAccountRequest
- type NewAccountResponse
- type PasswordRequest
- type PasswordResponse
- type SendTxArgs
- type SigFormat
- type SignDataRequest
- type SignDataResponse
- type SignTxRequest
- type SignTxResponse
- type SignerAPI
- func (api *SignerAPI) EcRecover(ctx context.Context, data hexutil.Bytes, sig hexutil.Bytes) (common.Address, error)
- func (api *SignerAPI) Export(ctx context.Context, addr common.Address) (json.RawMessage, error)
- func (api *SignerAPI) Import(ctx context.Context, keyJSON json.RawMessage) (Account, error)
- func (api *SignerAPI) List(ctx context.Context) ([]common.Address, error)
- func (api *SignerAPI) New(ctx context.Context) (accounts.Account, error)
- func (api *SignerAPI) SignData(ctx context.Context, contentType string, addr common.MixedcaseAddress, ...) (hexutil.Bytes, error)
- func (api *SignerAPI) SignTransaction(ctx context.Context, args SendTxArgs, methodSelector *string) (*ethapi.SignTransactionResult, error)
- func (api *SignerAPI) SignTypedData(ctx context.Context, addr common.MixedcaseAddress, typedData TypedData) (hexutil.Bytes, error)
- func (api *SignerAPI) Version(ctx context.Context) (string, error)
- type SignerUI
- type StartupInfo
- type StdIOUI
- func (ui *StdIOUI) ApproveExport(request *ExportRequest) (ExportResponse, error)
- func (ui *StdIOUI) ApproveImport(request *ImportRequest) (ImportResponse, error)
- func (ui *StdIOUI) ApproveListing(request *ListRequest) (ListResponse, error)
- func (ui *StdIOUI) ApproveNewAccount(request *NewAccountRequest) (NewAccountResponse, error)
- func (ui *StdIOUI) ApproveSignData(request *SignDataRequest) (SignDataResponse, error)
- func (ui *StdIOUI) ApproveTx(request *SignTxRequest) (SignTxResponse, error)
- func (ui *StdIOUI) OnApprovedTx(tx ethapi.SignTransactionResult)
- func (ui *StdIOUI) OnInputRequired(info UserInputRequest) (UserInputResponse, error)
- func (ui *StdIOUI) OnSignerStartup(info StartupInfo)
- func (ui *StdIOUI) ShowError(message string)
- func (ui *StdIOUI) ShowInfo(message string)
- type Type
- type TypePriority
- type TypedData
- func (typedData *TypedData) Dependencies(primaryType string, found []string) []string
- func (typedData *TypedData) EncodeData(primaryType string, data map[string]interface{}, depth int) (hexutil.Bytes, error)
- func (typedData *TypedData) EncodePrimitiveValue(encType string, encValue interface{}, depth int) ([]byte, error)
- func (typedData *TypedData) EncodeType(primaryType string) hexutil.Bytes
- func (typedData *TypedData) Format() []*NameValueType
- func (typedData *TypedData) HashStruct(primaryType string, data TypedDataMessage) (hexutil.Bytes, error)
- func (typedData *TypedData) Map() map[string]interface{}
- func (typedData *TypedData) PrettyPrint() string
- func (typedData *TypedData) TypeHash(primaryType string) hexutil.Bytes
- type TypedDataDomain
- type TypedDataMessage
- type Types
- type UserInputRequest
- type UserInputResponse
- type ValidationInfo
- type ValidationMessages
- type Validator
- type ValidatorData
Constants ¶
const ( // ExternalAPIVersion -- see extapi_changelog.md ExternalAPIVersion = "5.0.0" // InternalAPIVersion -- see intapi_changelog.md InternalAPIVersion = "3.1.0" )
const ( WARN = "WARNING" CRIT = "CRITICAL" INFO = "Info" )
Variables ¶
var ( TextValidator = SigFormat{ accounts.MimetypeTextWithValidator, 0x00, } DataTyped = SigFormat{ accounts.MimetypeTypedData, 0x01, } ApplicationClique = SigFormat{ accounts.MimetypeClique, 0x02, } TextPlain = SigFormat{ accounts.MimetypeTextPlain, 0x45, } )
var ErrRequestDenied = errors.New("Request denied")
var Printable7BitAscii = regexp.MustCompile("^[A-Za-z0-9!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~ ]+$")
Functions ¶
func MethodSelectorToAbi ¶
MethodSelectorToAbi converts a method selector into an ABI struct. The returned data is a valid json string which can be consumed by the standard abi package.
func SignCliqueHeader ¶
SignCliqueHeader returns the hash which is used as input for the proof-of-authority signing. It is the hash of the entire header apart from the 65 byte signature contained at the end of the extra data.
The method requires the extra data to be at least 65 bytes -- the original implementation in clique.go panics if this is the case, thus it's been reimplemented here to avoid the panic and simply return an error instead
func SignTextValidator ¶
func SignTextValidator(validatorData ValidatorData) (hexutil.Bytes, string)
SignTextWithValidator signs the given message which can be further recovered with the given validator. hash = keccak256("\x19\x00"${address}${data}).
func ValidatePasswordFormat ¶
ValidatePasswordFormat returns an error if the password is too short, or consists of characters outside the range of the printable 7bit ascii set
Types ¶
type AbiDb ¶
type AbiDb struct {
// contains filtered or unexported fields
}
func NewAbiDBFromFile ¶
NewAbiDBFromFile loads signature database from file, and errors if the file is not valid json. Does no other validation of contents
func NewAbiDBFromFiles ¶
NewAbiDBFromFiles loads both the standard signature database and a custom database. The latter will be used to write new values into if they are submitted via the API
func (*AbiDb) AddSignature ¶
AddSignature to the database, if custom database saving is enabled. OBS: This method does _not_ validate the correctness of the data, it is assumed that the caller has already done so
func (*AbiDb) LookupMethodSelector ¶
LookupMethodSelector checks the given 4byte-sequence against the known ABI methods. OBS: This method does not validate the match, it's assumed the caller will do so
type Account ¶
type AuditLogger ¶
type AuditLogger struct {
// contains filtered or unexported fields
}
func NewAuditLogger ¶
func NewAuditLogger(path string, api ExternalAPI) (*AuditLogger, error)
func (*AuditLogger) Export ¶
func (l *AuditLogger) Export(ctx context.Context, addr common.Address) (json.RawMessage, error)
func (*AuditLogger) SignData ¶
func (l *AuditLogger) SignData(ctx context.Context, contentType string, addr common.MixedcaseAddress, data interface{}) (hexutil.Bytes, error)
func (*AuditLogger) SignTransaction ¶
func (l *AuditLogger) SignTransaction(ctx context.Context, args SendTxArgs, methodSelector *string) (*ethapi.SignTransactionResult, error)
func (*AuditLogger) SignTypedData ¶
func (l *AuditLogger) SignTypedData(ctx context.Context, addr common.MixedcaseAddress, data TypedData) (hexutil.Bytes, error)
type CommandlineUI ¶
type CommandlineUI struct {
// contains filtered or unexported fields
}
func NewCommandlineUI ¶
func NewCommandlineUI() *CommandlineUI
func (*CommandlineUI) ApproveExport ¶
func (ui *CommandlineUI) ApproveExport(request *ExportRequest) (ExportResponse, error)
ApproveExport prompt the user for confirmation to export encrypted Account json
func (*CommandlineUI) ApproveImport ¶
func (ui *CommandlineUI) ApproveImport(request *ImportRequest) (ImportResponse, error)
ApproveImport prompt the user for confirmation to import Account json
func (*CommandlineUI) ApproveListing ¶
func (ui *CommandlineUI) ApproveListing(request *ListRequest) (ListResponse, error)
ApproveListing prompt the user for confirmation to list accounts the list of accounts to list can be modified by the UI
func (*CommandlineUI) ApproveNewAccount ¶
func (ui *CommandlineUI) ApproveNewAccount(request *NewAccountRequest) (NewAccountResponse, error)
ApproveNewAccount prompt the user for confirmation to create new Account, and reveal to caller
func (*CommandlineUI) ApproveSignData ¶
func (ui *CommandlineUI) ApproveSignData(request *SignDataRequest) (SignDataResponse, error)
ApproveSignData prompt the user for confirmation to request to sign data
func (*CommandlineUI) ApproveTx ¶
func (ui *CommandlineUI) ApproveTx(request *SignTxRequest) (SignTxResponse, error)
ApproveTx prompt the user for confirmation to request to sign Transaction
func (*CommandlineUI) OnApprovedTx ¶
func (ui *CommandlineUI) OnApprovedTx(tx ethapi.SignTransactionResult)
func (*CommandlineUI) OnInputRequired ¶
func (ui *CommandlineUI) OnInputRequired(info UserInputRequest) (UserInputResponse, error)
func (*CommandlineUI) OnSignerStartup ¶
func (ui *CommandlineUI) OnSignerStartup(info StartupInfo)
func (*CommandlineUI) ShowError ¶
func (ui *CommandlineUI) ShowError(message string)
ShowError displays error message to user
func (*CommandlineUI) ShowInfo ¶
func (ui *CommandlineUI) ShowInfo(message string)
ShowInfo displays info message to user
type ExportRequest ¶
ExportRequest info about query to export accounts
type ExportResponse ¶
type ExportResponse struct {
Approved bool `json:"approved"`
}
ExportResponse response to export-request
type ExternalAPI ¶
type ExternalAPI interface { // List available accounts List(ctx context.Context) ([]common.Address, error) // New request to create a new account New(ctx context.Context) (accounts.Account, error) // SignTransaction request to sign the specified transaction SignTransaction(ctx context.Context, args SendTxArgs, methodSelector *string) (*ethapi.SignTransactionResult, error) // SignData - request to sign the given data (plus prefix) SignData(ctx context.Context, contentType string, addr common.MixedcaseAddress, data interface{}) (hexutil.Bytes, error) // SignTypedData - request to sign the given structured data (plus prefix) SignTypedData(ctx context.Context, addr common.MixedcaseAddress, data TypedData) (hexutil.Bytes, error) // EcRecover - recover public key from given message and signature EcRecover(ctx context.Context, data hexutil.Bytes, sig hexutil.Bytes) (common.Address, error) // Export - request to export an account Export(ctx context.Context, addr common.Address) (json.RawMessage, error) // Import - request to import an account // Should be moved to Internal API, in next phase when we have // bi-directional communication //Import(ctx context.Context, keyJSON json.RawMessage) (Account, error) Version(ctx context.Context) (string, error) }
ExternalAPI defines the external API through which signing requests are made.
type ImportRequest ¶
type ImportRequest struct {
Meta Metadata `json:"meta"`
}
ImportRequest info about request to import an Account
type ImportResponse ¶
type ImportResponse struct { Approved bool `json:"approved"` OldPassword string `json:"old_password"` NewPassword string `json:"new_password"` }
types for the requests/response types between signer and UI
type ListRequest ¶
types for the requests/response types between signer and UI
type ListResponse ¶
type ListResponse struct {
Accounts []Account `json:"accounts"`
}
types for the requests/response types between signer and UI
type Message ¶
type Message struct {
Text string `json:"text"`
}
types for the requests/response types between signer and UI
type Metadata ¶
type Metadata struct { Remote string `json:"remote"` Local string `json:"local"` Scheme string `json:"scheme"` UserAgent string `json:"User-Agent"` Origin string `json:"Origin"` }
Metadata about a request
func MetadataFromContext ¶
MetadataFromContext extracts Metadata from a given context.Context
type NameValueType ¶
type NameValueType struct { Name string `json:"name"` Value interface{} `json:"value"` Typ string `json:"type"` }
NameValueType is a very simple struct with Name, Value and Type. It's meant for simple json structures used to communicate signing-info about typed data with the UI
func (*NameValueType) Pprint ¶
func (nvt *NameValueType) Pprint(depth int) string
Pprint returns a pretty-printed version of nvt
type NewAccountRequest ¶
type NewAccountRequest struct {
Meta Metadata `json:"meta"`
}
types for the requests/response types between signer and UI
type NewAccountResponse ¶
type NewAccountResponse struct { Approved bool `json:"approved"` Password string `json:"password"` }
types for the requests/response types between signer and UI
type PasswordRequest ¶
type PasswordRequest struct {
Prompt string `json:"prompt"`
}
types for the requests/response types between signer and UI
type PasswordResponse ¶
type PasswordResponse struct {
Password string `json:"password"`
}
types for the requests/response types between signer and UI
type SendTxArgs ¶
type SendTxArgs struct { From common.MixedcaseAddress `json:"from"` To *common.MixedcaseAddress `json:"to"` Gas hexutil.Uint64 `json:"gas"` GasPrice hexutil.Big `json:"gasPrice"` Value hexutil.Big `json:"value"` Nonce hexutil.Uint64 `json:"nonce"` // We accept "data" and "input" for backwards-compatibility reasons. Data *hexutil.Bytes `json:"data"` Input *hexutil.Bytes `json:"input"` }
SendTxArgs represents the arguments to submit a transaction
func (SendTxArgs) String ¶
func (args SendTxArgs) String() string
type SignDataRequest ¶
type SignDataRequest struct { ContentType string `json:"content_type"` Address common.MixedcaseAddress `json:"address"` Rawdata []byte `json:"raw_data"` Message []*NameValueType `json:"message"` Hash hexutil.Bytes `json:"hash"` Meta Metadata `json:"meta"` }
types for the requests/response types between signer and UI
type SignDataResponse ¶
types for the requests/response types between signer and UI
type SignTxRequest ¶
type SignTxRequest struct { Transaction SendTxArgs `json:"transaction"` Callinfo []ValidationInfo `json:"call_info"` Meta Metadata `json:"meta"` }
SignTxRequest contains info about a Transaction to sign
type SignTxResponse ¶
type SignTxResponse struct { //The UI may make changes to the TX Transaction SendTxArgs `json:"transaction"` Approved bool `json:"approved"` Password string `json:"password"` }
SignTxResponse result from SignTxRequest
type SignerAPI ¶
type SignerAPI struct { UI SignerUI // contains filtered or unexported fields }
SignerAPI defines the actual implementation of ExternalAPI
func NewSignerAPI ¶
func NewSignerAPI(chainID int64, ksLocation string, noUSB bool, ui SignerUI, abidb *AbiDb, lightKDF bool, advancedMode bool) *SignerAPI
NewSignerAPI creates a new API that can be used for Account management. ksLocation specifies the directory where to store the password protected private key that is generated when a new Account is created. noUSB disables USB support that is required to support hardware devices such as ledger and trezor.
func (*SignerAPI) EcRecover ¶
func (api *SignerAPI) EcRecover(ctx context.Context, data hexutil.Bytes, sig hexutil.Bytes) (common.Address, error)
EcRecover recovers the address associated with the given sig. Only compatible with `text/plain`
func (*SignerAPI) Export ¶
Export returns encrypted private key associated with the given address in web3 keystore format.
func (*SignerAPI) Import ¶
Import tries to import the given keyJSON in the local keystore. The keyJSON data is expected to be in web3 keystore format. It will decrypt the keyJSON with the given passphrase and on successful decryption it will encrypt the key with the given newPassphrase and store it in the keystore. OBS! This method is removed from the public API. It should not be exposed on the external API for a couple of reasons: 1. Even though it is encrypted, it should still be seen as sensitive data 2. It can be used to DoS clef, by using malicious data with e.g. extreme large values for the kdfparams.
func (*SignerAPI) List ¶
List returns the set of wallet this signer manages. Each wallet can contain multiple accounts.
func (*SignerAPI) New ¶
New creates a new password protected Account. The private key is protected with the given password. Users are responsible to backup the private key that is stored in the keystore location thas was specified when this API was created.
func (*SignerAPI) SignData ¶
func (api *SignerAPI) SignData(ctx context.Context, contentType string, addr common.MixedcaseAddress, data interface{}) (hexutil.Bytes, error)
SignData signs the hash of the provided data, but does so differently depending on the content-type specified.
Different types of validation occur.
func (*SignerAPI) SignTransaction ¶
func (api *SignerAPI) SignTransaction(ctx context.Context, args SendTxArgs, methodSelector *string) (*ethapi.SignTransactionResult, error)
SignTransaction signs the given Transaction and returns it both as json and rlp-encoded form
type SignerUI ¶
type SignerUI interface { // ApproveTx prompt the user for confirmation to request to sign Transaction ApproveTx(request *SignTxRequest) (SignTxResponse, error) // ApproveSignData prompt the user for confirmation to request to sign data ApproveSignData(request *SignDataRequest) (SignDataResponse, error) // ApproveExport prompt the user for confirmation to export encrypted Account json ApproveExport(request *ExportRequest) (ExportResponse, error) // ApproveImport prompt the user for confirmation to import Account json ApproveImport(request *ImportRequest) (ImportResponse, error) // ApproveListing prompt the user for confirmation to list accounts // the list of accounts to list can be modified by the UI ApproveListing(request *ListRequest) (ListResponse, error) // ApproveNewAccount prompt the user for confirmation to create new Account, and reveal to caller ApproveNewAccount(request *NewAccountRequest) (NewAccountResponse, error) // ShowError displays error message to user ShowError(message string) // ShowInfo displays info message to user ShowInfo(message string) // OnApprovedTx notifies the UI about a transaction having been successfully signed. // This method can be used by a UI to keep track of e.g. how much has been sent to a particular recipient. OnApprovedTx(tx ethapi.SignTransactionResult) // OnSignerStartup is invoked when the signer boots, and tells the UI info about external API location and version // information OnSignerStartup(info StartupInfo) // OnInputRequired is invoked when clef requires user input, for example master password or // pin-code for unlocking hardware wallets OnInputRequired(info UserInputRequest) (UserInputResponse, error) }
SignerUI specifies what method a UI needs to implement to be able to be used as a UI for the signer
type StartupInfo ¶
type StartupInfo struct {
Info map[string]interface{} `json:"info"`
}
types for the requests/response types between signer and UI
type StdIOUI ¶
type StdIOUI struct {
// contains filtered or unexported fields
}
func NewStdIOUI ¶
func NewStdIOUI() *StdIOUI
func (*StdIOUI) ApproveExport ¶
func (ui *StdIOUI) ApproveExport(request *ExportRequest) (ExportResponse, error)
func (*StdIOUI) ApproveImport ¶
func (ui *StdIOUI) ApproveImport(request *ImportRequest) (ImportResponse, error)
func (*StdIOUI) ApproveListing ¶
func (ui *StdIOUI) ApproveListing(request *ListRequest) (ListResponse, error)
func (*StdIOUI) ApproveNewAccount ¶
func (ui *StdIOUI) ApproveNewAccount(request *NewAccountRequest) (NewAccountResponse, error)
func (*StdIOUI) ApproveSignData ¶
func (ui *StdIOUI) ApproveSignData(request *SignDataRequest) (SignDataResponse, error)
func (*StdIOUI) ApproveTx ¶
func (ui *StdIOUI) ApproveTx(request *SignTxRequest) (SignTxResponse, error)
func (*StdIOUI) OnApprovedTx ¶
func (ui *StdIOUI) OnApprovedTx(tx ethapi.SignTransactionResult)
func (*StdIOUI) OnInputRequired ¶
func (ui *StdIOUI) OnInputRequired(info UserInputRequest) (UserInputResponse, error)
func (*StdIOUI) OnSignerStartup ¶
func (ui *StdIOUI) OnSignerStartup(info StartupInfo)
type TypePriority ¶
type TypedData ¶
type TypedData struct { Types Types `json:"types"` PrimaryType string `json:"primaryType"` Domain TypedDataDomain `json:"domain"` Message TypedDataMessage `json:"message"` }
func (*TypedData) Dependencies ¶
Dependencies returns an array of custom types ordered by their hierarchical reference tree
func (*TypedData) EncodeData ¶
func (typedData *TypedData) EncodeData(primaryType string, data map[string]interface{}, depth int) (hexutil.Bytes, error)
EncodeData generates the following encoding: `enc(value₁) ‖ enc(value₂) ‖ … ‖ enc(valueₙ)`
each encoded member is 32-byte long
func (*TypedData) EncodePrimitiveValue ¶
func (typedData *TypedData) EncodePrimitiveValue(encType string, encValue interface{}, depth int) ([]byte, error)
EncodePrimitiveValue deals with the primitive values found while searching through the typed data
func (*TypedData) EncodeType ¶
EncodeType generates the following encoding: `name ‖ "(" ‖ member₁ ‖ "," ‖ member₂ ‖ "," ‖ … ‖ memberₙ ")"`
each member is written as `type ‖ " " ‖ name` encodings cascade down and are sorted by name
func (*TypedData) Format ¶
func (typedData *TypedData) Format() []*NameValueType
Format returns a representation of typedData, which can be easily displayed by a user-interface without in-depth knowledge about 712 rules
func (*TypedData) HashStruct ¶
func (typedData *TypedData) HashStruct(primaryType string, data TypedDataMessage) (hexutil.Bytes, error)
HashStruct generates a keccak256 hash of the encoding of the provided data
func (*TypedData) PrettyPrint ¶
PrettyPrint generates a nice output to help the users of clef present data in their apps
type TypedDataDomain ¶
type TypedDataDomain struct { Name string `json:"name"` Version string `json:"version"` ChainId *big.Int `json:"chainId"` VerifyingContract string `json:"verifyingContract"` Salt string `json:"salt"` }
func (*TypedDataDomain) Map ¶
func (domain *TypedDataDomain) Map() map[string]interface{}
Map is a helper function to generate a map version of the domain
type TypedDataMessage ¶
type TypedDataMessage = map[string]interface{}
type UserInputRequest ¶
type UserInputRequest struct { Prompt string `json:"prompt"` Title string `json:"title"` IsPassword bool `json:"isPassword"` }
types for the requests/response types between signer and UI
type UserInputResponse ¶
type UserInputResponse struct {
Text string `json:"text"`
}
types for the requests/response types between signer and UI
type ValidationInfo ¶
type ValidationMessages ¶
type ValidationMessages struct {
Messages []ValidationInfo
}
type Validator ¶
type Validator struct {
// contains filtered or unexported fields
}
func NewValidator ¶
func (*Validator) ValidateTransaction ¶
func (v *Validator) ValidateTransaction(txArgs *SendTxArgs, methodSelector *string) (*ValidationMessages, error)
ValidateTransaction does a number of checks on the supplied transaction, and returns either a list of warnings, or an error, indicating that the transaction should be immediately rejected
type ValidatorData ¶
func UnmarshalValidatorData ¶
func UnmarshalValidatorData(data interface{}) (ValidatorData, error)
UnmarshalValidatorData converts the bytes input to typed data