chainwriter

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewServer

func NewServer(impl types.ChainWriter, opts ...ServerOpt) pb.ChainWriterServer

func RegisterChainWriterService

func RegisterChainWriterService(s *grpc.Server, chainWriter types.ChainWriter)

func TxMetaFromProto

func TxMetaFromProto(proto *pb.TransactionMeta) *types.TxMeta

TxMetaFromProto converts a TxMeta from it's generated protobuf Go type to our internal Go type.

func TxMetaToProto

func TxMetaToProto(meta *types.TxMeta) *pb.TransactionMeta

TxMetaToProto converts a TxMeta to it's generated protobuf Go type.

Types

type Client

type Client struct {
	*goplugin.ServiceClient
	// contains filtered or unexported fields
}

func NewClient

func NewClient(b *net.BrokerExt, cc grpc.ClientConnInterface, opts ...ClientOpt) *Client

func (*Client) GetFeeComponents

func (c *Client) GetFeeComponents(ctx context.Context) (*types.ChainFeeComponents, error)

func (*Client) GetTransactionStatus

func (c *Client) GetTransactionStatus(ctx context.Context, transactionID string) (types.TransactionStatus, error)

func (*Client) SubmitTransaction

func (c *Client) SubmitTransaction(ctx context.Context, contractName, method string, params any, transactionID, toAddress string, meta *types.TxMeta, value *big.Int) error

type ClientOpt

type ClientOpt func(*Client)

func WithClientEncoding

func WithClientEncoding(version chainreader.EncodingVersion) ClientOpt

type Server

type Server struct {
	pb.UnimplementedChainWriterServer
	// contains filtered or unexported fields
}

func (*Server) GetFeeComponents

func (s *Server) GetFeeComponents(ctx context.Context, _ *emptypb.Empty) (*pb.GetFeeComponentsReply, error)

func (*Server) GetTransactionStatus

func (s *Server) GetTransactionStatus(ctx context.Context, req *pb.GetTransactionStatusRequest) (*pb.GetTransactionStatusReply, error)

func (*Server) SubmitTransaction

func (s *Server) SubmitTransaction(ctx context.Context, req *pb.SubmitTransactionRequest) (*emptypb.Empty, error)

type ServerOpt

type ServerOpt func(*Server)

func WithServerEncoding

func WithServerEncoding(version chainreader.EncodingVersion) ServerOpt

Jump to

Keyboard shortcuts

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