pipeline

package
v0.56.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 26, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTraceIDMismatch   = errors.New("the trace IDs between request and response mismatch")
	ErrWrongResponseType = errors.New("the received response does not match the expected response type")
)

Functions

This section is empty.

Types

type Decision

type Decision struct {
	Approved bool `json:"approved"`
}

type EnteredPassphrase

type EnteredPassphrase struct {
	Passphrase string `json:"passphrase"`
}

type Envelope

type Envelope 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 get assigned
	// only after it has been sent to the network.
	TraceID string      `json:"traceID"`
	Content interface{} `json:"content"`
}

type ErrorOccurred

type ErrorOccurred struct {
	Type  string `json:"type"`
	Error string `json:"error"`
}

type Log added in v0.56.0

type Log struct {
	Type    string `json:"type"`
	Message string `json:"message"`
}

type RequestPassphrase

type RequestPassphrase struct {
	Wallet string `json:"wallet"`
}

type RequestPermissionsReview

type RequestPermissionsReview struct {
	Hostname    string            `json:"hostname"`
	Wallet      string            `json:"wallet"`
	Permissions map[string]string `json:"permissions"`
}

type RequestSucceeded

type RequestSucceeded struct{}

type RequestTransactionSendingReview added in v0.55.0

type RequestTransactionSendingReview struct {
	Hostname    string    `json:"hostname"`
	Wallet      string    `json:"wallet"`
	PublicKey   string    `json:"publicKey"`
	Transaction string    `json:"transaction"`
	ReceivedAt  time.Time `json:"receivedAt"`
}

type RequestTransactionSigningReview added in v0.55.0

type RequestTransactionSigningReview struct {
	Hostname    string    `json:"hostname"`
	Wallet      string    `json:"wallet"`
	PublicKey   string    `json:"publicKey"`
	Transaction string    `json:"transaction"`
	ReceivedAt  time.Time `json:"receivedAt"`
}

type RequestWalletConnectionReview

type RequestWalletConnectionReview struct {
	Hostname string `json:"hostname"`
}

type RequestWalletSelection

type RequestWalletSelection struct {
	Hostname         string   `json:"hostname"`
	AvailableWallets []string `json:"availableWallets"`
}

type SequentialPipeline

type SequentialPipeline struct {
	// contains filtered or unexported fields
}

SequentialPipeline is a pipeline built to handle one request at a time. Concurrent requests are not supported and will result in errors.

func NewSequentialPipeline

func NewSequentialPipeline(userCtx context.Context, receptionChan chan<- Envelope, responseChan <-chan Envelope) *SequentialPipeline

func (*SequentialPipeline) Log added in v0.56.0

func (s *SequentialPipeline) Log(ctx context.Context, traceID string, t api.LogType, msg string)

func (*SequentialPipeline) NotifyError

func (s *SequentialPipeline) NotifyError(ctx context.Context, traceID string, t api.ErrorType, err error)

func (*SequentialPipeline) NotifySuccessfulRequest

func (s *SequentialPipeline) NotifySuccessfulRequest(ctx context.Context, traceID string)

func (*SequentialPipeline) NotifyTransactionStatus

func (s *SequentialPipeline) NotifyTransactionStatus(ctx context.Context, traceID, txHash, tx string, err error, sentAt time.Time)

func (*SequentialPipeline) RequestPassphrase

func (s *SequentialPipeline) RequestPassphrase(ctx context.Context, traceID, wallet string) (string, error)

func (*SequentialPipeline) RequestPermissionsReview

func (s *SequentialPipeline) RequestPermissionsReview(ctx context.Context, traceID, hostname, wallet string, perms map[string]string) (bool, error)

func (*SequentialPipeline) RequestTransactionSendingReview added in v0.55.0

func (s *SequentialPipeline) RequestTransactionSendingReview(ctx context.Context, traceID, hostname, wallet, pubKey, transaction string, receivedAt time.Time) (bool, error)

func (*SequentialPipeline) RequestTransactionSigningReview added in v0.55.0

func (s *SequentialPipeline) RequestTransactionSigningReview(ctx context.Context, traceID, hostname, wallet, pubKey, transaction string, receivedAt time.Time) (bool, error)

func (*SequentialPipeline) RequestWalletConnectionReview

func (s *SequentialPipeline) RequestWalletConnectionReview(ctx context.Context, traceID, hostname string) (bool, error)

func (*SequentialPipeline) RequestWalletSelection

func (s *SequentialPipeline) RequestWalletSelection(ctx context.Context, traceID, hostname string, availableWallets []string) (api.SelectedWallet, error)

type TransactionStatus

type TransactionStatus struct {
	TxHash string    `json:"txHash"`
	Tx     string    `json:"tx"`
	Error  error     `json:"error"`
	SentAt time.Time `json:"sentAt"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL