Documentation ¶
Overview ¶
Package chainrpc is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Package chainrpc is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func DisableLog()
- func RegisterChainKitHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterChainKitHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ChainKitClient) error
- func RegisterChainKitHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterChainKitHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ChainKitServer) error
- func RegisterChainKitJSONCallbacks(...)
- func RegisterChainKitServer(s grpc.ServiceRegistrar, srv ChainKitServer)
- func RegisterChainNotifierHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterChainNotifierHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ChainNotifierClient) error
- func RegisterChainNotifierHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterChainNotifierHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ChainNotifierServer) error
- func RegisterChainNotifierJSONCallbacks(...)
- func RegisterChainNotifierServer(s grpc.ServiceRegistrar, srv ChainNotifierServer)
- func UseLogger(logger btclog.Logger)
- type BlockEpoch
- type ChainKitClient
- type ChainKitServer
- type ChainNotifierClient
- type ChainNotifierServer
- type ChainNotifier_RegisterBlockEpochNtfnClient
- type ChainNotifier_RegisterBlockEpochNtfnServer
- type ChainNotifier_RegisterConfirmationsNtfnClient
- type ChainNotifier_RegisterConfirmationsNtfnServer
- type ChainNotifier_RegisterSpendNtfnClient
- type ChainNotifier_RegisterSpendNtfnServer
- type ConfDetails
- func (*ConfDetails) Descriptor() ([]byte, []int)deprecated
- func (x *ConfDetails) GetBlockHash() []byte
- func (x *ConfDetails) GetBlockHeight() uint32
- func (x *ConfDetails) GetRawBlock() []byte
- func (x *ConfDetails) GetRawTx() []byte
- func (x *ConfDetails) GetTxIndex() uint32
- func (*ConfDetails) ProtoMessage()
- func (x *ConfDetails) ProtoReflect() protoreflect.Message
- func (x *ConfDetails) Reset()
- func (x *ConfDetails) String() string
- type ConfEvent
- func (*ConfEvent) Descriptor() ([]byte, []int)deprecated
- func (x *ConfEvent) GetConf() *ConfDetails
- func (m *ConfEvent) GetEvent() isConfEvent_Event
- func (x *ConfEvent) GetReorg() *Reorg
- func (*ConfEvent) ProtoMessage()
- func (x *ConfEvent) ProtoReflect() protoreflect.Message
- func (x *ConfEvent) Reset()
- func (x *ConfEvent) String() string
- type ConfEvent_Conf
- type ConfEvent_Reorg
- type ConfRequest
- func (*ConfRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ConfRequest) GetHeightHint() uint32
- func (x *ConfRequest) GetIncludeBlock() bool
- func (x *ConfRequest) GetNumConfs() uint32
- func (x *ConfRequest) GetScript() []byte
- func (x *ConfRequest) GetTxid() []byte
- func (*ConfRequest) ProtoMessage()
- func (x *ConfRequest) ProtoReflect() protoreflect.Message
- func (x *ConfRequest) Reset()
- func (x *ConfRequest) String() string
- type Config
- type GetBestBlockRequest
- type GetBestBlockResponse
- func (*GetBestBlockResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetBestBlockResponse) GetBlockHash() []byte
- func (x *GetBestBlockResponse) GetBlockHeight() int32
- func (*GetBestBlockResponse) ProtoMessage()
- func (x *GetBestBlockResponse) ProtoReflect() protoreflect.Message
- func (x *GetBestBlockResponse) Reset()
- func (x *GetBestBlockResponse) String() string
- type GetBlockHashRequest
- func (*GetBlockHashRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetBlockHashRequest) GetBlockHeight() int64
- func (*GetBlockHashRequest) ProtoMessage()
- func (x *GetBlockHashRequest) ProtoReflect() protoreflect.Message
- func (x *GetBlockHashRequest) Reset()
- func (x *GetBlockHashRequest) String() string
- type GetBlockHashResponse
- func (*GetBlockHashResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetBlockHashResponse) GetBlockHash() []byte
- func (*GetBlockHashResponse) ProtoMessage()
- func (x *GetBlockHashResponse) ProtoReflect() protoreflect.Message
- func (x *GetBlockHashResponse) Reset()
- func (x *GetBlockHashResponse) String() string
- type GetBlockRequest
- type GetBlockResponse
- type Outpoint
- type Reorg
- type SpendDetails
- func (*SpendDetails) Descriptor() ([]byte, []int)deprecated
- func (x *SpendDetails) GetRawSpendingTx() []byte
- func (x *SpendDetails) GetSpendingHeight() uint32
- func (x *SpendDetails) GetSpendingInputIndex() uint32
- func (x *SpendDetails) GetSpendingOutpoint() *Outpoint
- func (x *SpendDetails) GetSpendingTxHash() []byte
- func (*SpendDetails) ProtoMessage()
- func (x *SpendDetails) ProtoReflect() protoreflect.Message
- func (x *SpendDetails) Reset()
- func (x *SpendDetails) String() string
- type SpendEvent
- func (*SpendEvent) Descriptor() ([]byte, []int)deprecated
- func (m *SpendEvent) GetEvent() isSpendEvent_Event
- func (x *SpendEvent) GetReorg() *Reorg
- func (x *SpendEvent) GetSpend() *SpendDetails
- func (*SpendEvent) ProtoMessage()
- func (x *SpendEvent) ProtoReflect() protoreflect.Message
- func (x *SpendEvent) Reset()
- func (x *SpendEvent) String() string
- type SpendEvent_Reorg
- type SpendEvent_Spend
- type SpendRequest
- func (*SpendRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SpendRequest) GetHeightHint() uint32
- func (x *SpendRequest) GetOutpoint() *Outpoint
- func (x *SpendRequest) GetScript() []byte
- func (*SpendRequest) ProtoMessage()
- func (x *SpendRequest) ProtoReflect() protoreflect.Message
- func (x *SpendRequest) Reset()
- func (x *SpendRequest) String() string
- type UnimplementedChainKitServer
- func (UnimplementedChainKitServer) GetBestBlock(context.Context, *GetBestBlockRequest) (*GetBestBlockResponse, error)
- func (UnimplementedChainKitServer) GetBlock(context.Context, *GetBlockRequest) (*GetBlockResponse, error)
- func (UnimplementedChainKitServer) GetBlockHash(context.Context, *GetBlockHashRequest) (*GetBlockHashResponse, error)
- type UnimplementedChainNotifierServer
- func (UnimplementedChainNotifierServer) RegisterBlockEpochNtfn(*BlockEpoch, ChainNotifier_RegisterBlockEpochNtfnServer) error
- func (UnimplementedChainNotifierServer) RegisterConfirmationsNtfn(*ConfRequest, ChainNotifier_RegisterConfirmationsNtfnServer) error
- func (UnimplementedChainNotifierServer) RegisterSpendNtfn(*SpendRequest, ChainNotifier_RegisterSpendNtfnServer) error
- type UnsafeChainKitServer
- type UnsafeChainNotifierServer
Constants ¶
This section is empty.
Variables ¶
var ChainKit_ServiceDesc = grpc.ServiceDesc{ ServiceName: "chainrpc.ChainKit", HandlerType: (*ChainKitServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetBlock", Handler: _ChainKit_GetBlock_Handler, }, { MethodName: "GetBestBlock", Handler: _ChainKit_GetBestBlock_Handler, }, { MethodName: "GetBlockHash", Handler: _ChainKit_GetBlockHash_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "chainrpc/chainkit.proto", }
ChainKit_ServiceDesc is the grpc.ServiceDesc for ChainKit service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var ChainNotifier_ServiceDesc = grpc.ServiceDesc{ ServiceName: "chainrpc.ChainNotifier", HandlerType: (*ChainNotifierServer)(nil), Methods: []grpc.MethodDesc{}, Streams: []grpc.StreamDesc{ { StreamName: "RegisterConfirmationsNtfn", Handler: _ChainNotifier_RegisterConfirmationsNtfn_Handler, ServerStreams: true, }, { StreamName: "RegisterSpendNtfn", Handler: _ChainNotifier_RegisterSpendNtfn_Handler, ServerStreams: true, }, { StreamName: "RegisterBlockEpochNtfn", Handler: _ChainNotifier_RegisterBlockEpochNtfn_Handler, ServerStreams: true, }, }, Metadata: "chainrpc/chainnotifier.proto", }
ChainNotifier_ServiceDesc is the grpc.ServiceDesc for ChainNotifier service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_chainrpc_chainkit_proto protoreflect.FileDescriptor
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 RegisterChainKitHandler ¶
func RegisterChainKitHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterChainKitHandler registers the http handlers for service ChainKit to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterChainKitHandlerClient ¶
func RegisterChainKitHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ChainKitClient) error
RegisterChainKitHandlerClient registers the http handlers for service ChainKit to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ChainKitClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ChainKitClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "ChainKitClient" to call the correct interceptors.
func RegisterChainKitHandlerFromEndpoint ¶
func RegisterChainKitHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterChainKitHandlerFromEndpoint is same as RegisterChainKitHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterChainKitHandlerServer ¶
func RegisterChainKitHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ChainKitServer) error
RegisterChainKitHandlerServer registers the http handlers for service ChainKit to "mux". UnaryRPC :call ChainKitServer 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 RegisterChainKitHandlerFromEndpoint instead.
func RegisterChainKitServer ¶
func RegisterChainKitServer(s grpc.ServiceRegistrar, srv ChainKitServer)
func RegisterChainNotifierHandler ¶
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 ¶
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 ¶
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 ¶
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.ServiceRegistrar, srv ChainNotifierServer)
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 ¶
func (x *BlockEpoch) ProtoReflect() protoreflect.Message
func (*BlockEpoch) Reset ¶
func (x *BlockEpoch) Reset()
func (*BlockEpoch) String ¶
func (x *BlockEpoch) String() string
type ChainKitClient ¶
type ChainKitClient interface { // lncli: `chain getblock` // GetBlock returns a block given the corresponding block hash. GetBlock(ctx context.Context, in *GetBlockRequest, opts ...grpc.CallOption) (*GetBlockResponse, error) // lncli: `chain getbestblock` // GetBestBlock returns the block hash and current height from the valid // most-work chain. GetBestBlock(ctx context.Context, in *GetBestBlockRequest, opts ...grpc.CallOption) (*GetBestBlockResponse, error) // lncli: `chain getblockhash` // GetBlockHash returns the hash of the block in the best blockchain // at the given height. GetBlockHash(ctx context.Context, in *GetBlockHashRequest, opts ...grpc.CallOption) (*GetBlockHashResponse, error) }
ChainKitClient is the client API for ChainKit service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewChainKitClient ¶
func NewChainKitClient(cc grpc.ClientConnInterface) ChainKitClient
type ChainKitServer ¶
type ChainKitServer interface { // lncli: `chain getblock` // GetBlock returns a block given the corresponding block hash. GetBlock(context.Context, *GetBlockRequest) (*GetBlockResponse, error) // lncli: `chain getbestblock` // GetBestBlock returns the block hash and current height from the valid // most-work chain. GetBestBlock(context.Context, *GetBestBlockRequest) (*GetBestBlockResponse, error) // lncli: `chain getblockhash` // GetBlockHash returns the hash of the block in the best blockchain // at the given height. GetBlockHash(context.Context, *GetBlockHashRequest) (*GetBlockHashResponse, error) // contains filtered or unexported methods }
ChainKitServer is the server API for ChainKit service. All implementations must embed UnimplementedChainKitServer for forward compatibility
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 confirmation request must have a valid output script. It is also possible // to give a transaction ID. If the transaction ID is not set, a notification // is sent once the output script confirms. If the transaction ID is also set, // a notification is sent once the output script confirms in the given // transaction. 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://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewChainNotifierClient ¶
func NewChainNotifierClient(cc grpc.ClientConnInterface) ChainNotifierClient
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 confirmation request must have a valid output script. It is also possible // to give a transaction ID. If the transaction ID is not set, a notification // is sent once the output script confirms. If the transaction ID is also set, // a notification is sent once the output script confirms in the given // transaction. 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 // contains filtered or unexported methods }
ChainNotifierServer is the server API for ChainNotifier service. All implementations must embed UnimplementedChainNotifierServer for forward compatibility
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 block. TxIndex uint32 `protobuf:"varint,4,opt,name=tx_index,json=txIndex,proto3" json:"tx_index,omitempty"` // The raw bytes of the block that mined the transaction. Only included if // include_block was set in the request. RawBlock []byte `protobuf:"bytes,5,opt,name=raw_block,json=rawBlock,proto3" json:"raw_block,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) GetRawBlock ¶
func (x *ConfDetails) GetRawBlock() []byte
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 ¶
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) GetConf ¶
func (x *ConfEvent) GetConf() *ConfDetails
func (*ConfEvent) ProtoMessage ¶
func (*ConfEvent) ProtoMessage()
func (*ConfEvent) ProtoReflect ¶
func (x *ConfEvent) ProtoReflect() protoreflect.Message
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"` // If true, then the block that mines the specified txid/script will be // included in eventual the notification event. IncludeBlock bool `protobuf:"varint,5,opt,name=include_block,json=includeBlock,proto3" json:"include_block,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) GetIncludeBlock ¶
func (x *ConfRequest) GetIncludeBlock() bool
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 ¶
func (x *ConfRequest) ProtoReflect() protoreflect.Message
func (*ConfRequest) Reset ¶
func (x *ConfRequest) Reset()
func (*ConfRequest) String ¶
func (x *ConfRequest) String() string
type GetBestBlockRequest ¶
type GetBestBlockRequest struct {
// contains filtered or unexported fields
}
func (*GetBestBlockRequest) Descriptor
deprecated
func (*GetBestBlockRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetBestBlockRequest.ProtoReflect.Descriptor instead.
func (*GetBestBlockRequest) ProtoMessage ¶
func (*GetBestBlockRequest) ProtoMessage()
func (*GetBestBlockRequest) ProtoReflect ¶
func (x *GetBestBlockRequest) ProtoReflect() protoreflect.Message
func (*GetBestBlockRequest) Reset ¶
func (x *GetBestBlockRequest) Reset()
func (*GetBestBlockRequest) String ¶
func (x *GetBestBlockRequest) String() string
type GetBestBlockResponse ¶
type GetBestBlockResponse struct { // The hash of the best block. BlockHash []byte `protobuf:"bytes,1,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty"` // The height of the best block. BlockHeight int32 `protobuf:"varint,2,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"` // contains filtered or unexported fields }
func (*GetBestBlockResponse) Descriptor
deprecated
func (*GetBestBlockResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetBestBlockResponse.ProtoReflect.Descriptor instead.
func (*GetBestBlockResponse) GetBlockHash ¶
func (x *GetBestBlockResponse) GetBlockHash() []byte
func (*GetBestBlockResponse) GetBlockHeight ¶
func (x *GetBestBlockResponse) GetBlockHeight() int32
func (*GetBestBlockResponse) ProtoMessage ¶
func (*GetBestBlockResponse) ProtoMessage()
func (*GetBestBlockResponse) ProtoReflect ¶
func (x *GetBestBlockResponse) ProtoReflect() protoreflect.Message
func (*GetBestBlockResponse) Reset ¶
func (x *GetBestBlockResponse) Reset()
func (*GetBestBlockResponse) String ¶
func (x *GetBestBlockResponse) String() string
type GetBlockHashRequest ¶
type GetBlockHashRequest struct { // Block height of the target best chain block. BlockHeight int64 `protobuf:"varint,1,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"` // contains filtered or unexported fields }
func (*GetBlockHashRequest) Descriptor
deprecated
func (*GetBlockHashRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetBlockHashRequest.ProtoReflect.Descriptor instead.
func (*GetBlockHashRequest) GetBlockHeight ¶
func (x *GetBlockHashRequest) GetBlockHeight() int64
func (*GetBlockHashRequest) ProtoMessage ¶
func (*GetBlockHashRequest) ProtoMessage()
func (*GetBlockHashRequest) ProtoReflect ¶
func (x *GetBlockHashRequest) ProtoReflect() protoreflect.Message
func (*GetBlockHashRequest) Reset ¶
func (x *GetBlockHashRequest) Reset()
func (*GetBlockHashRequest) String ¶
func (x *GetBlockHashRequest) String() string
type GetBlockHashResponse ¶
type GetBlockHashResponse struct { // The hash of the best block at the specified height. BlockHash []byte `protobuf:"bytes,1,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty"` // contains filtered or unexported fields }
func (*GetBlockHashResponse) Descriptor
deprecated
func (*GetBlockHashResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetBlockHashResponse.ProtoReflect.Descriptor instead.
func (*GetBlockHashResponse) GetBlockHash ¶
func (x *GetBlockHashResponse) GetBlockHash() []byte
func (*GetBlockHashResponse) ProtoMessage ¶
func (*GetBlockHashResponse) ProtoMessage()
func (*GetBlockHashResponse) ProtoReflect ¶
func (x *GetBlockHashResponse) ProtoReflect() protoreflect.Message
func (*GetBlockHashResponse) Reset ¶
func (x *GetBlockHashResponse) Reset()
func (*GetBlockHashResponse) String ¶
func (x *GetBlockHashResponse) String() string
type GetBlockRequest ¶
type GetBlockRequest struct { // The hash of the requested block. BlockHash []byte `protobuf:"bytes,1,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty"` // contains filtered or unexported fields }
func (*GetBlockRequest) Descriptor
deprecated
func (*GetBlockRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetBlockRequest.ProtoReflect.Descriptor instead.
func (*GetBlockRequest) GetBlockHash ¶
func (x *GetBlockRequest) GetBlockHash() []byte
func (*GetBlockRequest) ProtoMessage ¶
func (*GetBlockRequest) ProtoMessage()
func (*GetBlockRequest) ProtoReflect ¶
func (x *GetBlockRequest) ProtoReflect() protoreflect.Message
func (*GetBlockRequest) Reset ¶
func (x *GetBlockRequest) Reset()
func (*GetBlockRequest) String ¶
func (x *GetBlockRequest) String() string
type GetBlockResponse ¶
type GetBlockResponse struct { // The raw bytes of the requested block. RawBlock []byte `protobuf:"bytes,1,opt,name=raw_block,json=rawBlock,proto3" json:"raw_block,omitempty"` // contains filtered or unexported fields }
TODO(ffranr): The neutrino GetBlock response includes many additional helpful fields. Consider adding them here also.
func (*GetBlockResponse) Descriptor
deprecated
func (*GetBlockResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetBlockResponse.ProtoReflect.Descriptor instead.
func (*GetBlockResponse) GetRawBlock ¶
func (x *GetBlockResponse) GetRawBlock() []byte
func (*GetBlockResponse) ProtoMessage ¶
func (*GetBlockResponse) ProtoMessage()
func (*GetBlockResponse) ProtoReflect ¶
func (x *GetBlockResponse) ProtoReflect() protoreflect.Message
func (*GetBlockResponse) Reset ¶
func (x *GetBlockResponse) Reset()
func (*GetBlockResponse) String ¶
func (x *GetBlockResponse) String() string
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) ProtoMessage ¶
func (*Outpoint) ProtoMessage()
func (*Outpoint) ProtoReflect ¶
func (x *Outpoint) ProtoReflect() protoreflect.Message
type Reorg ¶
type Reorg struct {
// contains filtered or unexported fields
}
func (*Reorg) Descriptor
deprecated
func (*Reorg) ProtoMessage ¶
func (*Reorg) ProtoMessage()
func (*Reorg) ProtoReflect ¶
func (x *Reorg) ProtoReflect() protoreflect.Message
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 ¶
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 ¶
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. A zero or nil outpoint is not supported for Taproot spends // because the output script cannot reliably be computed from the witness alone // and the spent output script is not always available in the rescan context. // So an outpoint must _always_ be specified when registering a spend // notification for a Taproot output. 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 ¶
func (x *SpendRequest) ProtoReflect() protoreflect.Message
func (*SpendRequest) Reset ¶
func (x *SpendRequest) Reset()
func (*SpendRequest) String ¶
func (x *SpendRequest) String() string
type UnimplementedChainKitServer ¶
type UnimplementedChainKitServer struct { }
UnimplementedChainKitServer must be embedded to have forward compatible implementations.
func (UnimplementedChainKitServer) GetBestBlock ¶
func (UnimplementedChainKitServer) GetBestBlock(context.Context, *GetBestBlockRequest) (*GetBestBlockResponse, error)
func (UnimplementedChainKitServer) GetBlock ¶
func (UnimplementedChainKitServer) GetBlock(context.Context, *GetBlockRequest) (*GetBlockResponse, error)
func (UnimplementedChainKitServer) GetBlockHash ¶
func (UnimplementedChainKitServer) GetBlockHash(context.Context, *GetBlockHashRequest) (*GetBlockHashResponse, error)
type UnimplementedChainNotifierServer ¶
type UnimplementedChainNotifierServer struct { }
UnimplementedChainNotifierServer must be embedded to have forward compatible implementations.
func (UnimplementedChainNotifierServer) RegisterBlockEpochNtfn ¶
func (UnimplementedChainNotifierServer) RegisterBlockEpochNtfn(*BlockEpoch, ChainNotifier_RegisterBlockEpochNtfnServer) error
func (UnimplementedChainNotifierServer) RegisterConfirmationsNtfn ¶
func (UnimplementedChainNotifierServer) RegisterConfirmationsNtfn(*ConfRequest, ChainNotifier_RegisterConfirmationsNtfnServer) error
func (UnimplementedChainNotifierServer) RegisterSpendNtfn ¶
func (UnimplementedChainNotifierServer) RegisterSpendNtfn(*SpendRequest, ChainNotifier_RegisterSpendNtfnServer) error
type UnsafeChainKitServer ¶
type UnsafeChainKitServer interface {
// contains filtered or unexported methods
}
UnsafeChainKitServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ChainKitServer will result in compilation errors.
type UnsafeChainNotifierServer ¶
type UnsafeChainNotifierServer interface {
// contains filtered or unexported methods
}
UnsafeChainNotifierServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ChainNotifierServer will result in compilation errors.