wire

package
v0.0.0-...-f39f649 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MethodSendTx    Method = "sendTx"
	MethodSubscribe Method = "subscribe"

	BalanceProofs Topic = "balanceProofs"
	DepositProofs Topic = "depositProofs"
	TXReceipts    Topic = "txReceipts"
	Config        Topic = "config"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BalanceProof

type BalanceProof struct {
	Result
	Proof tee.BalanceProof `json:"proof"`
}

BalanceProof contains one BalanceProof from the according subscription.

type Call

type Call struct {
	// ID is an unique id.
	ID ID `json:"id"`
	// Method describes which action should be executed.
	Method Method `json:"method"`
}

Call is a generic call.

type DepositProof

type DepositProof struct {
	Result
	Proof tee.DepositProof `json:"proof"`
}

DepositProof contains one DepositProof from the according subscription.

type ID

type ID string

ID unanimously identifies a RPC call and result.

type Method

type Method string

Method describes a method to RPC call.

type PushConfig

type PushConfig struct {
	Result
	Config config.OpClientConfig `json:"config"`
}

type Result

type Result struct {
	// ID can be used to map the Result fo its corresponding `Call`.
	ID ID `json:"id,omitempty"`
	// Topic is set iff this Result to the specified Topic subscription.
	Topic Topic `json:"topic,omitempty"`
	// Error is set iff an error occurred with a Call or subscription.
	Error string `json:"error,omitempty"`
}

Result is a generic result. It has either ID or Topic set, depending on whether it is a result for a call or a subscription update for a topic.

type SendTx

type SendTx struct {
	Call
	Tx tee.Transaction `json:"tx"`
}

SendTx sends one Transaction to the remote operator.

func NewSendTx

func NewSendTx(id ID, tx tee.Transaction) *SendTx

NewSendTx returns a `SendTx` object.

type Subscribe

type Subscribe struct {
	Call
	// The Address this subscription is for.
	Who common.Address `json:"who"`
}

Subscribe sets up a client subscription.

func NewSubscribe

func NewSubscribe(id ID, who common.Address) *Subscribe

NewSubscribe returns a `Subscribe` object.

type TXReceipt

type TXReceipt struct {
	Result
	TX tee.Transaction `json:"tx"`
}

TXReceipt notifies a peer that he received a new transaction.

type Topic

type Topic string

Topic describes a topic to RPC subscribe on.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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