chainrpc

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2024 License: MIT Imports: 29 Imported by: 2

Documentation

Overview

Package chainrpc is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var (

	// DefaultChainNotifierMacFilename is the default name of the chain
	// notifier macaroon that we expect to find via a file handle within the
	// main configuration file in this package.
	DefaultChainNotifierMacFilename = "chainnotifier.macaroon"

	// ErrChainNotifierServerShuttingDown is an error returned when we are
	// waiting for a notification to arrive but the chain notifier server
	// has been shut down.
	ErrChainNotifierServerShuttingDown = errors.New("chain notifier RPC " +
		"subserver shutting down")

	// ErrChainNotifierServerNotActive indicates that the chain notifier hasn't
	// finished the startup process.
	ErrChainNotifierServerNotActive = errors.New("chain notifier RPC is " +
		"still in the process of starting")
)
View Source
var File_chainrpc_chainnotifier_proto protoreflect.FileDescriptor

Functions

func DisableLog

func DisableLog()

DisableLog disables all library log output. Logging output is disabled by default until UseLogger is called.

func RegisterChainNotifierHandler added in v0.3.0

func RegisterChainNotifierHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterChainNotifierHandler registers the http handlers for service ChainNotifier to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterChainNotifierHandlerClient added in v0.3.0

func RegisterChainNotifierHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ChainNotifierClient) error

RegisterChainNotifierHandlerClient registers the http handlers for service ChainNotifier to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ChainNotifierClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ChainNotifierClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "ChainNotifierClient" to call the correct interceptors.

func RegisterChainNotifierHandlerFromEndpoint added in v0.3.0

func RegisterChainNotifierHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterChainNotifierHandlerFromEndpoint is same as RegisterChainNotifierHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterChainNotifierHandlerServer added in v0.3.0

func RegisterChainNotifierHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ChainNotifierServer) error

RegisterChainNotifierHandlerServer registers the http handlers for service ChainNotifier to "mux". UnaryRPC :call ChainNotifierServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterChainNotifierHandlerFromEndpoint instead.

func RegisterChainNotifierServer

func RegisterChainNotifierServer(s *grpc.Server, srv ChainNotifierServer)

func UseLogger

func UseLogger(logger slog.Logger)

UseLogger uses a specified Logger to output package logging info. This should be used in preference to SetLogWriter if the caller is also using btclog.

Types

type BlockEpoch

type BlockEpoch struct {

	// The hash of the block.
	Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"`
	// The height of the block.
	Height uint32 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"`
	// contains filtered or unexported fields
}

func (*BlockEpoch) Descriptor deprecated

func (*BlockEpoch) Descriptor() ([]byte, []int)

Deprecated: Use BlockEpoch.ProtoReflect.Descriptor instead.

func (*BlockEpoch) GetHash

func (x *BlockEpoch) GetHash() []byte

func (*BlockEpoch) GetHeight

func (x *BlockEpoch) GetHeight() uint32

func (*BlockEpoch) ProtoMessage

func (*BlockEpoch) ProtoMessage()

func (*BlockEpoch) ProtoReflect added in v0.3.0

func (x *BlockEpoch) ProtoReflect() protoreflect.Message

func (*BlockEpoch) Reset

func (x *BlockEpoch) Reset()

func (*BlockEpoch) String

func (x *BlockEpoch) String() string

type ChainNotifierClient

type ChainNotifierClient interface {
	// RegisterConfirmationsNtfn is a synchronous response-streaming RPC that
	// registers an intent for a client to be notified once a confirmation request
	// has reached its required number of confirmations on-chain.
	//
	// A client can specify whether the confirmation request should be for a
	// particular transaction by its hash or for an output script by specifying a
	// zero hash.
	RegisterConfirmationsNtfn(ctx context.Context, in *ConfRequest, opts ...grpc.CallOption) (ChainNotifier_RegisterConfirmationsNtfnClient, error)
	// RegisterSpendNtfn is a synchronous response-streaming RPC that registers an
	// intent for a client to be notification once a spend request has been spent
	// by a transaction that has confirmed on-chain.
	//
	// A client can specify whether the spend request should be for a particular
	// outpoint  or for an output script by specifying a zero outpoint.
	RegisterSpendNtfn(ctx context.Context, in *SpendRequest, opts ...grpc.CallOption) (ChainNotifier_RegisterSpendNtfnClient, error)
	// RegisterBlockEpochNtfn is a synchronous response-streaming RPC that
	// registers an intent for a client to be notified of blocks in the chain. The
	// stream will return a hash and height tuple of a block for each new/stale
	// block in the chain. It is the client's responsibility to determine whether
	// the tuple returned is for a new or stale block in the chain.
	//
	// A client can also request a historical backlog of blocks from a particular
	// point. This allows clients to be idempotent by ensuring that they do not
	// missing processing a single block within the chain.
	RegisterBlockEpochNtfn(ctx context.Context, in *BlockEpoch, opts ...grpc.CallOption) (ChainNotifier_RegisterBlockEpochNtfnClient, error)
}

ChainNotifierClient is the client API for ChainNotifier service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

type ChainNotifierServer

type ChainNotifierServer interface {
	// RegisterConfirmationsNtfn is a synchronous response-streaming RPC that
	// registers an intent for a client to be notified once a confirmation request
	// has reached its required number of confirmations on-chain.
	//
	// A client can specify whether the confirmation request should be for a
	// particular transaction by its hash or for an output script by specifying a
	// zero hash.
	RegisterConfirmationsNtfn(*ConfRequest, ChainNotifier_RegisterConfirmationsNtfnServer) error
	// RegisterSpendNtfn is a synchronous response-streaming RPC that registers an
	// intent for a client to be notification once a spend request has been spent
	// by a transaction that has confirmed on-chain.
	//
	// A client can specify whether the spend request should be for a particular
	// outpoint  or for an output script by specifying a zero outpoint.
	RegisterSpendNtfn(*SpendRequest, ChainNotifier_RegisterSpendNtfnServer) error
	// RegisterBlockEpochNtfn is a synchronous response-streaming RPC that
	// registers an intent for a client to be notified of blocks in the chain. The
	// stream will return a hash and height tuple of a block for each new/stale
	// block in the chain. It is the client's responsibility to determine whether
	// the tuple returned is for a new or stale block in the chain.
	//
	// A client can also request a historical backlog of blocks from a particular
	// point. This allows clients to be idempotent by ensuring that they do not
	// missing processing a single block within the chain.
	RegisterBlockEpochNtfn(*BlockEpoch, ChainNotifier_RegisterBlockEpochNtfnServer) error
}

ChainNotifierServer is the server API for ChainNotifier service.

type ChainNotifier_RegisterBlockEpochNtfnClient

type ChainNotifier_RegisterBlockEpochNtfnClient interface {
	Recv() (*BlockEpoch, error)
	grpc.ClientStream
}

type ChainNotifier_RegisterBlockEpochNtfnServer

type ChainNotifier_RegisterBlockEpochNtfnServer interface {
	Send(*BlockEpoch) error
	grpc.ServerStream
}

type ChainNotifier_RegisterConfirmationsNtfnClient

type ChainNotifier_RegisterConfirmationsNtfnClient interface {
	Recv() (*ConfEvent, error)
	grpc.ClientStream
}

type ChainNotifier_RegisterConfirmationsNtfnServer

type ChainNotifier_RegisterConfirmationsNtfnServer interface {
	Send(*ConfEvent) error
	grpc.ServerStream
}

type ChainNotifier_RegisterSpendNtfnClient

type ChainNotifier_RegisterSpendNtfnClient interface {
	Recv() (*SpendEvent, error)
	grpc.ClientStream
}

type ChainNotifier_RegisterSpendNtfnServer

type ChainNotifier_RegisterSpendNtfnServer interface {
	Send(*SpendEvent) error
	grpc.ServerStream
}

type ConfDetails

type ConfDetails struct {

	// The raw bytes of the confirmed transaction.
	RawTx []byte `protobuf:"bytes,1,opt,name=raw_tx,json=rawTx,proto3" json:"raw_tx,omitempty"`
	// The hash of the block in which the confirmed transaction was included in.
	BlockHash []byte `protobuf:"bytes,2,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty"`
	// The height of the block in which the confirmed transaction was included
	// in.
	BlockHeight uint32 `protobuf:"varint,3,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"`
	// The index of the confirmed transaction within the transaction.
	TxIndex uint32 `protobuf:"varint,4,opt,name=tx_index,json=txIndex,proto3" json:"tx_index,omitempty"`
	// contains filtered or unexported fields
}

func (*ConfDetails) Descriptor deprecated

func (*ConfDetails) Descriptor() ([]byte, []int)

Deprecated: Use ConfDetails.ProtoReflect.Descriptor instead.

func (*ConfDetails) GetBlockHash

func (x *ConfDetails) GetBlockHash() []byte

func (*ConfDetails) GetBlockHeight

func (x *ConfDetails) GetBlockHeight() uint32

func (*ConfDetails) GetRawTx

func (x *ConfDetails) GetRawTx() []byte

func (*ConfDetails) GetTxIndex

func (x *ConfDetails) GetTxIndex() uint32

func (*ConfDetails) ProtoMessage

func (*ConfDetails) ProtoMessage()

func (*ConfDetails) ProtoReflect added in v0.3.0

func (x *ConfDetails) ProtoReflect() protoreflect.Message

func (*ConfDetails) Reset

func (x *ConfDetails) Reset()

func (*ConfDetails) String

func (x *ConfDetails) String() string

type ConfEvent

type ConfEvent struct {

	// Types that are assignable to Event:
	//
	//	*ConfEvent_Conf
	//	*ConfEvent_Reorg
	Event isConfEvent_Event `protobuf_oneof:"event"`
	// contains filtered or unexported fields
}

func (*ConfEvent) Descriptor deprecated

func (*ConfEvent) Descriptor() ([]byte, []int)

Deprecated: Use ConfEvent.ProtoReflect.Descriptor instead.

func (*ConfEvent) GetConf

func (x *ConfEvent) GetConf() *ConfDetails

func (*ConfEvent) GetEvent

func (m *ConfEvent) GetEvent() isConfEvent_Event

func (*ConfEvent) GetReorg

func (x *ConfEvent) GetReorg() *Reorg

func (*ConfEvent) ProtoMessage

func (*ConfEvent) ProtoMessage()

func (*ConfEvent) ProtoReflect added in v0.3.0

func (x *ConfEvent) ProtoReflect() protoreflect.Message

func (*ConfEvent) Reset

func (x *ConfEvent) Reset()

func (*ConfEvent) String

func (x *ConfEvent) String() string

type ConfEvent_Conf

type ConfEvent_Conf struct {
	// An event that includes the confirmation details of the request
	// (txid/ouput script).
	Conf *ConfDetails `protobuf:"bytes,1,opt,name=conf,proto3,oneof"`
}

type ConfEvent_Reorg

type ConfEvent_Reorg struct {
	// An event send when the transaction of the request is reorged out of the
	// chain.
	Reorg *Reorg `protobuf:"bytes,2,opt,name=reorg,proto3,oneof"`
}

type ConfRequest

type ConfRequest struct {

	// The transaction hash for which we should request a confirmation notification
	// for. If set to a hash of all zeros, then the confirmation notification will
	// be requested for the script instead.
	Txid []byte `protobuf:"bytes,1,opt,name=txid,proto3" json:"txid,omitempty"`
	// An output script within a transaction with the hash above which will be used
	// by light clients to match block filters. If the transaction hash is set to a
	// hash of all zeros, then a confirmation notification will be requested for
	// this script instead.
	Script []byte `protobuf:"bytes,2,opt,name=script,proto3" json:"script,omitempty"`
	// The number of desired confirmations the transaction/output script should
	// reach before dispatching a confirmation notification.
	NumConfs uint32 `protobuf:"varint,3,opt,name=num_confs,json=numConfs,proto3" json:"num_confs,omitempty"`
	// The earliest height in the chain for which the transaction/output script
	// could have been included in a block. This should in most cases be set to the
	// broadcast height of the transaction/output script.
	HeightHint uint32 `protobuf:"varint,4,opt,name=height_hint,json=heightHint,proto3" json:"height_hint,omitempty"`
	// contains filtered or unexported fields
}

func (*ConfRequest) Descriptor deprecated

func (*ConfRequest) Descriptor() ([]byte, []int)

Deprecated: Use ConfRequest.ProtoReflect.Descriptor instead.

func (*ConfRequest) GetHeightHint

func (x *ConfRequest) GetHeightHint() uint32

func (*ConfRequest) GetNumConfs

func (x *ConfRequest) GetNumConfs() uint32

func (*ConfRequest) GetScript

func (x *ConfRequest) GetScript() []byte

func (*ConfRequest) GetTxid

func (x *ConfRequest) GetTxid() []byte

func (*ConfRequest) ProtoMessage

func (*ConfRequest) ProtoMessage()

func (*ConfRequest) ProtoReflect added in v0.3.0

func (x *ConfRequest) ProtoReflect() protoreflect.Message

func (*ConfRequest) Reset

func (x *ConfRequest) Reset()

func (*ConfRequest) String

func (x *ConfRequest) String() string

type Config

type Config struct {
	// ChainNotifierMacPath is the path for the chain notifier macaroon. If
	// unspecified then we assume that the macaroon will be found under the
	// network directory, named DefaultChainNotifierMacFilename.
	ChainNotifierMacPath string `long:"notifiermacaroonpath" description:"Path to the chain notifier macaroon"`

	// NetworkDir is the main network directory wherein the chain notifier
	// RPC server will find the macaroon named
	// DefaultChainNotifierMacFilename.
	NetworkDir string

	// MacService is the main macaroon service that we'll use to handle
	// authentication for the chain notifier RPC server.
	MacService *macaroons.Service

	// ChainNotifier is the chain notifier instance that backs the chain
	// notifier RPC server. The job of the chain notifier RPC server is
	// simply to proxy valid requests to the active chain notifier instance.
	ChainNotifier chainntnfs.ChainNotifier
}

Config is the primary configuration struct for the chain notifier RPC server. It contains all the items required for the server to carry out its duties. The fields with struct tags are meant to be parsed as normal configuration options, while if able to be populated, the latter fields MUST also be specified.

type Outpoint

type Outpoint struct {

	// The hash of the transaction.
	Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"`
	// The index of the output within the transaction.
	Index uint32 `protobuf:"varint,2,opt,name=index,proto3" json:"index,omitempty"`
	// contains filtered or unexported fields
}

func (*Outpoint) Descriptor deprecated

func (*Outpoint) Descriptor() ([]byte, []int)

Deprecated: Use Outpoint.ProtoReflect.Descriptor instead.

func (*Outpoint) GetHash

func (x *Outpoint) GetHash() []byte

func (*Outpoint) GetIndex

func (x *Outpoint) GetIndex() uint32

func (*Outpoint) ProtoMessage

func (*Outpoint) ProtoMessage()

func (*Outpoint) ProtoReflect added in v0.3.0

func (x *Outpoint) ProtoReflect() protoreflect.Message

func (*Outpoint) Reset

func (x *Outpoint) Reset()

func (*Outpoint) String

func (x *Outpoint) String() string

type Reorg

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

func (*Reorg) Descriptor deprecated

func (*Reorg) Descriptor() ([]byte, []int)

Deprecated: Use Reorg.ProtoReflect.Descriptor instead.

func (*Reorg) ProtoMessage

func (*Reorg) ProtoMessage()

func (*Reorg) ProtoReflect added in v0.3.0

func (x *Reorg) ProtoReflect() protoreflect.Message

func (*Reorg) Reset

func (x *Reorg) Reset()

func (*Reorg) String

func (x *Reorg) String() string

type Server added in v0.3.0

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

Server is a sub-server of the main RPC server: the chain notifier RPC. This RPC sub-server allows external callers to access the full chain notifier capabilities of lnd. This allows callers to create custom protocols, external to lnd, even backed by multiple distinct lnd across independent failure domains.

func New added in v0.3.0

func New(cfg *Config) (*Server, lnrpc.MacaroonPerms, error)

New returns a new instance of the chainrpc ChainNotifier sub-server. We also return the set of permissions for the macaroons that we may create within this method. If the macaroons we need aren't found in the filepath, then we'll create them on start up. If we're unable to locate, or create the macaroons we need, then we'll return with an error.

func (*Server) Name added in v0.3.0

func (s *Server) Name() string

Name returns a unique string representation of the sub-server. This can be used to identify the sub-server and also de-duplicate them.

NOTE: This is part of the lnrpc.SubServer interface.

func (*Server) RegisterBlockEpochNtfn added in v0.3.0

func (s *Server) RegisterBlockEpochNtfn(in *BlockEpoch,
	epochStream ChainNotifier_RegisterBlockEpochNtfnServer) error

RegisterBlockEpochNtfn is a synchronous response-streaming RPC that registers an intent for a client to be notified of blocks in the chain. The stream will return a hash and height tuple of a block for each new/stale block in the chain. It is the client's responsibility to determine whether the tuple returned is for a new or stale block in the chain.

A client can also request a historical backlog of blocks from a particular point. This allows clients to be idempotent by ensuring that they do not missing processing a single block within the chain.

NOTE: This is part of the chainrpc.ChainNotifierService interface.

func (*Server) RegisterConfirmationsNtfn added in v0.3.0

func (s *Server) RegisterConfirmationsNtfn(in *ConfRequest,
	confStream ChainNotifier_RegisterConfirmationsNtfnServer) error

RegisterConfirmationsNtfn is a synchronous response-streaming RPC that registers an intent for a client to be notified once a confirmation request has reached its required number of confirmations on-chain.

A client can specify whether the confirmation request should be for a particular transaction by its hash or for an output script by specifying a zero hash.

NOTE: This is part of the chainrpc.ChainNotifierService interface.

func (*Server) RegisterSpendNtfn added in v0.3.0

func (s *Server) RegisterSpendNtfn(in *SpendRequest,
	spendStream ChainNotifier_RegisterSpendNtfnServer) error

RegisterSpendNtfn is a synchronous response-streaming RPC that registers an intent for a client to be notification once a spend request has been spent by a transaction that has confirmed on-chain.

A client can specify whether the spend request should be for a particular outpoint or for an output script by specifying a zero outpoint.

NOTE: This is part of the chainrpc.ChainNotifierService interface.

func (*Server) Start added in v0.3.0

func (s *Server) Start() error

Start launches any helper goroutines required for the server to function.

NOTE: This is part of the lnrpc.SubServer interface.

func (*Server) Stop added in v0.3.0

func (s *Server) Stop() error

Stop signals any active goroutines for a graceful closure.

NOTE: This is part of the lnrpc.SubServer interface.

type ServerShell added in v0.5.0

type ServerShell struct {
	ChainNotifierServer
}

ServerShell is a shell struct holding a reference to the actual sub-server. It is used to register the gRPC sub-server with the root server before we have the necessary dependencies to populate the actual sub-server.

func (*ServerShell) CreateSubServer added in v0.5.0

func (r *ServerShell) CreateSubServer(configRegistry lnrpc.SubServerConfigDispatcher) (
	lnrpc.SubServer, lnrpc.MacaroonPerms, error)

CreateSubServer populates the subserver's dependencies using the passed SubServerConfigDispatcher. This method should fully initialize the sub-server instance, making it ready for action. It returns the macaroon permissions that the sub-server wishes to pass on to the root server for all methods routed towards it.

NOTE: This is part of the lnrpc.GrpcHandler interface.

func (*ServerShell) RegisterWithRestServer added in v0.5.0

func (r *ServerShell) RegisterWithRestServer(ctx context.Context,
	mux *runtime.ServeMux, dest string, opts []grpc.DialOption) error

RegisterWithRestServer will be called by the root REST mux to direct a sub RPC server to register itself with the main REST mux server. Until this is called, each sub-server won't be able to have requests routed towards it.

NOTE: This is part of the lnrpc.GrpcHandler interface.

func (*ServerShell) RegisterWithRootServer added in v0.5.0

func (r *ServerShell) RegisterWithRootServer(grpcServer *grpc.Server) error

RegisterWithRootServer will be called by the root gRPC server to direct a RPC sub-server to register itself with the main gRPC root server. Until this is called, each sub-server won't be able to have requests routed towards it.

NOTE: This is part of the lnrpc.GrpcHandler interface.

type SpendDetails

type SpendDetails struct {

	// The outpoint was that spent.
	SpendingOutpoint *Outpoint `protobuf:"bytes,1,opt,name=spending_outpoint,json=spendingOutpoint,proto3" json:"spending_outpoint,omitempty"`
	// The raw bytes of the spending transaction.
	RawSpendingTx []byte `protobuf:"bytes,2,opt,name=raw_spending_tx,json=rawSpendingTx,proto3" json:"raw_spending_tx,omitempty"`
	// The hash of the spending transaction.
	SpendingTxHash []byte `protobuf:"bytes,3,opt,name=spending_tx_hash,json=spendingTxHash,proto3" json:"spending_tx_hash,omitempty"`
	// The input of the spending transaction that fulfilled the spend request.
	SpendingInputIndex uint32 `protobuf:"varint,4,opt,name=spending_input_index,json=spendingInputIndex,proto3" json:"spending_input_index,omitempty"`
	// The height at which the spending transaction was included in a block.
	SpendingHeight uint32 `protobuf:"varint,5,opt,name=spending_height,json=spendingHeight,proto3" json:"spending_height,omitempty"`
	// contains filtered or unexported fields
}

func (*SpendDetails) Descriptor deprecated

func (*SpendDetails) Descriptor() ([]byte, []int)

Deprecated: Use SpendDetails.ProtoReflect.Descriptor instead.

func (*SpendDetails) GetRawSpendingTx

func (x *SpendDetails) GetRawSpendingTx() []byte

func (*SpendDetails) GetSpendingHeight

func (x *SpendDetails) GetSpendingHeight() uint32

func (*SpendDetails) GetSpendingInputIndex

func (x *SpendDetails) GetSpendingInputIndex() uint32

func (*SpendDetails) GetSpendingOutpoint

func (x *SpendDetails) GetSpendingOutpoint() *Outpoint

func (*SpendDetails) GetSpendingTxHash

func (x *SpendDetails) GetSpendingTxHash() []byte

func (*SpendDetails) ProtoMessage

func (*SpendDetails) ProtoMessage()

func (*SpendDetails) ProtoReflect added in v0.3.0

func (x *SpendDetails) ProtoReflect() protoreflect.Message

func (*SpendDetails) Reset

func (x *SpendDetails) Reset()

func (*SpendDetails) String

func (x *SpendDetails) String() string

type SpendEvent

type SpendEvent struct {

	// Types that are assignable to Event:
	//
	//	*SpendEvent_Spend
	//	*SpendEvent_Reorg
	Event isSpendEvent_Event `protobuf_oneof:"event"`
	// contains filtered or unexported fields
}

func (*SpendEvent) Descriptor deprecated

func (*SpendEvent) Descriptor() ([]byte, []int)

Deprecated: Use SpendEvent.ProtoReflect.Descriptor instead.

func (*SpendEvent) GetEvent

func (m *SpendEvent) GetEvent() isSpendEvent_Event

func (*SpendEvent) GetReorg

func (x *SpendEvent) GetReorg() *Reorg

func (*SpendEvent) GetSpend

func (x *SpendEvent) GetSpend() *SpendDetails

func (*SpendEvent) ProtoMessage

func (*SpendEvent) ProtoMessage()

func (*SpendEvent) ProtoReflect added in v0.3.0

func (x *SpendEvent) ProtoReflect() protoreflect.Message

func (*SpendEvent) Reset

func (x *SpendEvent) Reset()

func (*SpendEvent) String

func (x *SpendEvent) String() string

type SpendEvent_Reorg

type SpendEvent_Reorg struct {
	// An event sent when the spending transaction of the request was
	// reorged out of the chain.
	Reorg *Reorg `protobuf:"bytes,2,opt,name=reorg,proto3,oneof"`
}

type SpendEvent_Spend

type SpendEvent_Spend struct {
	// An event that includes the details of the spending transaction of the
	// request (outpoint/output script).
	Spend *SpendDetails `protobuf:"bytes,1,opt,name=spend,proto3,oneof"`
}

type SpendRequest

type SpendRequest struct {

	// The outpoint for which we should request a spend notification for. If set to
	// a zero outpoint, then the spend notification will be requested for the
	// script instead.
	Outpoint *Outpoint `protobuf:"bytes,1,opt,name=outpoint,proto3" json:"outpoint,omitempty"`
	// The output script for the outpoint above. This will be used by light clients
	// to match block filters. If the outpoint is set to a zero outpoint, then a
	// spend notification will be requested for this script instead.
	Script []byte `protobuf:"bytes,2,opt,name=script,proto3" json:"script,omitempty"`
	// The earliest height in the chain for which the outpoint/output script could
	// have been spent. This should in most cases be set to the broadcast height of
	// the outpoint/output script.
	HeightHint uint32 `protobuf:"varint,3,opt,name=height_hint,json=heightHint,proto3" json:"height_hint,omitempty"`
	// contains filtered or unexported fields
}

func (*SpendRequest) Descriptor deprecated

func (*SpendRequest) Descriptor() ([]byte, []int)

Deprecated: Use SpendRequest.ProtoReflect.Descriptor instead.

func (*SpendRequest) GetHeightHint

func (x *SpendRequest) GetHeightHint() uint32

func (*SpendRequest) GetOutpoint

func (x *SpendRequest) GetOutpoint() *Outpoint

func (*SpendRequest) GetScript

func (x *SpendRequest) GetScript() []byte

func (*SpendRequest) ProtoMessage

func (*SpendRequest) ProtoMessage()

func (*SpendRequest) ProtoReflect added in v0.3.0

func (x *SpendRequest) ProtoReflect() protoreflect.Message

func (*SpendRequest) Reset

func (x *SpendRequest) Reset()

func (*SpendRequest) String

func (x *SpendRequest) String() string

type UnimplementedChainNotifierServer added in v0.3.0

type UnimplementedChainNotifierServer struct {
}

UnimplementedChainNotifierServer can be embedded to have forward compatible implementations.

func (*UnimplementedChainNotifierServer) RegisterBlockEpochNtfn added in v0.3.0

func (*UnimplementedChainNotifierServer) RegisterConfirmationsNtfn added in v0.3.0

func (*UnimplementedChainNotifierServer) RegisterSpendNtfn added in v0.3.0

Jump to

Keyboard shortcuts

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