Documentation
¶
Index ¶
- Variables
- func InvalidResponsePayloadError(name InteractionName) error
- func TraceIDMismatchError(expected, got string) error
- func WrongResponseTypeError(expected, got InteractionName) error
- type CancelRequest
- type Decision
- type EnteredPassphrase
- type ErrorOccurred
- type Interaction
- type InteractionName
- type InteractionSessionBegan
- type InteractionSessionEnded
- type Log
- type ParallelInteractor
- func (i *ParallelInteractor) Log(ctx context.Context, traceID string, t api.LogType, msg string)
- func (i *ParallelInteractor) NotifyError(ctx context.Context, traceID string, t api.ErrorType, err error)
- func (i *ParallelInteractor) NotifyFailedTransaction(ctx context.Context, traceID string, stepNumber uint8, ...)
- func (i *ParallelInteractor) NotifyInteractionSessionBegan(_ context.Context, traceID string, workflow api.WorkflowType, ...) error
- func (i *ParallelInteractor) NotifyInteractionSessionEnded(_ context.Context, traceID string)
- func (i *ParallelInteractor) NotifySuccessfulRequest(ctx context.Context, traceID string, stepNumber uint8, message string)
- func (i *ParallelInteractor) NotifySuccessfulTransaction(ctx context.Context, traceID string, stepNumber uint8, ...)
- func (i *ParallelInteractor) RequestPassphrase(ctx context.Context, traceID string, stepNumber uint8, wallet, reason string) (string, error)
- func (i *ParallelInteractor) RequestPermissionsReview(ctx context.Context, traceID string, stepNumber uint8, hostname, wallet string, ...) (bool, error)
- func (i *ParallelInteractor) RequestTransactionReviewForChecking(ctx context.Context, traceID string, stepNumber uint8, ...) (bool, error)
- func (i *ParallelInteractor) RequestTransactionReviewForSending(ctx context.Context, traceID string, stepNumber uint8, ...) (bool, error)
- func (i *ParallelInteractor) RequestTransactionReviewForSigning(ctx context.Context, traceID string, stepNumber uint8, ...) (bool, error)
- func (i *ParallelInteractor) RequestWalletConnectionReview(ctx context.Context, traceID string, stepNumber uint8, hostname string) (string, error)
- func (i *ParallelInteractor) RequestWalletSelection(ctx context.Context, traceID string, stepNumber uint8, hostname string, ...) (string, error)
- type RequestPassphrase
- type RequestPermissionsReview
- type RequestSucceeded
- type RequestTransactionReviewForChecking
- type RequestTransactionReviewForSending
- type RequestTransactionReviewForSigning
- type RequestWalletConnectionReview
- type RequestWalletSelection
- type SelectedNode
- type SelectedWallet
- type TransactionFailed
- type TransactionSucceeded
- type WalletConnectionDecision
Constants ¶
This section is empty.
Variables ¶
var ErrTooManyRequests = errors.New("there are too many requests")
Functions ¶
func InvalidResponsePayloadError ¶
func InvalidResponsePayloadError(name InteractionName) error
func TraceIDMismatchError ¶
func WrongResponseTypeError ¶
func WrongResponseTypeError(expected, got InteractionName) error
Types ¶
type CancelRequest ¶ added in v0.59.0
type CancelRequest struct{}
CancelRequest cancels a request that is waiting for user inputs. It can't cancel a request when there is no response awaited.
type Decision ¶
type Decision struct {
// Approved is set to true if the request is accepted by the user, false
// otherwise.
Approved bool `json:"approved"`
}
Decision is a generic response for the following review requests:
- RequestPermissionsReview
- RequestTransactionReviewForSigning
- RequestTransactionReviewForSending
type EnteredPassphrase ¶
type EnteredPassphrase struct {
Passphrase string `json:"passphrase"`
}
EnteredPassphrase contains the passphrase of a given wallet the user entered. It's a response to the interactor.RequestPassphrase.
type ErrorOccurred ¶
type ErrorOccurred struct {
// Type is an enumeration that gives information about the origin of the error.
// The value is the string representation of an api.ErrorType.
Type string `json:"type"`
// Error is the error message describing the reason of the failure.
Error string `json:"error"`
}
ErrorOccurred is a generic notification emitted when the something failed. This notification can wrap an internal failure as much as a user input error. Receiving this notification doesn't necessarily mean the overall request failed. The request should be considered as failed when this notification is followed by the interactor.InteractionSessionEnded notification.
type Interaction ¶
type Interaction struct {
// TraceID is an identifier specifically made for client front-end to keep
// track of a transaction during all of its lifetime, from transaction
// review to sending confirmation and in-memory history.
// It shouldn't be confused with the transaction hash that is the
// transaction identifier.
TraceID string `json:"traceID"`
// Name is the name of the interaction. This helps to figure out how the
// data payload should be parsed.
Name InteractionName `json:"name"`
// Data is the generic field that hold the data of the specific interaction.
Data interface{} `json:"data"`
}
Interaction wraps the messages the JSON-RPC API sends to the wallet front-end along with information about the context.
func (*Interaction) UnmarshalJSON ¶
func (f *Interaction) UnmarshalJSON(data []byte) error