tapdevrpc

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2026 License: MIT Imports: 17 Imported by: 2

Documentation

Overview

Package tapdevrpc is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var (
	ProofTransferType_name = map[int32]string{
		0: "PROOF_TRANSFER_TYPE_SEND",
		1: "PROOF_TRANSFER_TYPE_RECEIVE",
	}
	ProofTransferType_value = map[string]int32{
		"PROOF_TRANSFER_TYPE_SEND":    0,
		"PROOF_TRANSFER_TYPE_RECEIVE": 1,
	}
)

Enum value maps for ProofTransferType.

View Source
var File_tapdevrpc_tapdev_proto protoreflect.FileDescriptor
View Source
var TapDev_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "tapdevrpc.TapDev",
	HandlerType: (*TapDevServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "ImportProof",
			Handler:    _TapDev_ImportProof_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "SubscribeSendAssetEventNtfns",
			Handler:       _TapDev_SubscribeSendAssetEventNtfns_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "SubscribeReceiveAssetEventNtfns",
			Handler:       _TapDev_SubscribeReceiveAssetEventNtfns_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "tapdevrpc/tapdev.proto",
}

TapDev_ServiceDesc is the grpc.ServiceDesc for TapDev service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterGrpcServer

func RegisterGrpcServer(_ grpc.ServiceRegistrar, _ TapDevServer)

func RegisterTapDevHandler

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

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

func RegisterTapDevHandlerClient

func RegisterTapDevHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TapDevClient) error

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

func RegisterTapDevHandlerFromEndpoint

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

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

func RegisterTapDevHandlerServer

func RegisterTapDevHandlerServer(ctx context.Context, mux *runtime.ServeMux, server TapDevServer) error

RegisterTapDevHandlerServer registers the http handlers for service TapDev to "mux". UnaryRPC :call TapDevServer 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 RegisterTapDevHandlerFromEndpoint instead.

func RegisterTapDevServer

func RegisterTapDevServer(s grpc.ServiceRegistrar, srv TapDevServer)

Types

type AssetReceiveCompleteEvent

type AssetReceiveCompleteEvent struct {

	// Event creation timestamp.
	Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	// The address that received the asset.
	Address *taprpc.Addr `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"`
	// The outpoint of the transaction that was used to receive the asset.
	Outpoint string `protobuf:"bytes,3,opt,name=outpoint,proto3" json:"outpoint,omitempty"`
	// contains filtered or unexported fields
}

func (*AssetReceiveCompleteEvent) Descriptor deprecated

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

Deprecated: Use AssetReceiveCompleteEvent.ProtoReflect.Descriptor instead.

func (*AssetReceiveCompleteEvent) GetAddress

func (x *AssetReceiveCompleteEvent) GetAddress() *taprpc.Addr

func (*AssetReceiveCompleteEvent) GetOutpoint

func (x *AssetReceiveCompleteEvent) GetOutpoint() string

func (*AssetReceiveCompleteEvent) GetTimestamp

func (x *AssetReceiveCompleteEvent) GetTimestamp() int64

func (*AssetReceiveCompleteEvent) ProtoMessage

func (*AssetReceiveCompleteEvent) ProtoMessage()

func (*AssetReceiveCompleteEvent) ProtoReflect

func (*AssetReceiveCompleteEvent) Reset

func (x *AssetReceiveCompleteEvent) Reset()

func (*AssetReceiveCompleteEvent) String

func (x *AssetReceiveCompleteEvent) String() string

type ExecuteSendStateEvent

type ExecuteSendStateEvent struct {

	// Execute timestamp (microseconds).
	Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	// The send state that is about to be executed.
	SendState string `protobuf:"bytes,2,opt,name=send_state,json=sendState,proto3" json:"send_state,omitempty"`
	// contains filtered or unexported fields
}

func (*ExecuteSendStateEvent) Descriptor deprecated

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

Deprecated: Use ExecuteSendStateEvent.ProtoReflect.Descriptor instead.

func (*ExecuteSendStateEvent) GetSendState

func (x *ExecuteSendStateEvent) GetSendState() string

func (*ExecuteSendStateEvent) GetTimestamp

func (x *ExecuteSendStateEvent) GetTimestamp() int64

func (*ExecuteSendStateEvent) ProtoMessage

func (*ExecuteSendStateEvent) ProtoMessage()

func (*ExecuteSendStateEvent) ProtoReflect

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

func (*ExecuteSendStateEvent) Reset

func (x *ExecuteSendStateEvent) Reset()

func (*ExecuteSendStateEvent) String

func (x *ExecuteSendStateEvent) String() string

type ImportProofRequest

type ImportProofRequest struct {
	ProofFile    []byte `protobuf:"bytes,1,opt,name=proof_file,json=proofFile,proto3" json:"proof_file,omitempty"`
	GenesisPoint string `protobuf:"bytes,2,opt,name=genesis_point,json=genesisPoint,proto3" json:"genesis_point,omitempty"`
	// contains filtered or unexported fields
}

func (*ImportProofRequest) Descriptor deprecated

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

Deprecated: Use ImportProofRequest.ProtoReflect.Descriptor instead.

func (*ImportProofRequest) GetGenesisPoint

func (x *ImportProofRequest) GetGenesisPoint() string

func (*ImportProofRequest) GetProofFile

func (x *ImportProofRequest) GetProofFile() []byte

func (*ImportProofRequest) ProtoMessage

func (*ImportProofRequest) ProtoMessage()

func (*ImportProofRequest) ProtoReflect

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

func (*ImportProofRequest) Reset

func (x *ImportProofRequest) Reset()

func (*ImportProofRequest) String

func (x *ImportProofRequest) String() string

type ImportProofResponse

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

func (*ImportProofResponse) Descriptor deprecated

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

Deprecated: Use ImportProofResponse.ProtoReflect.Descriptor instead.

func (*ImportProofResponse) ProtoMessage

func (*ImportProofResponse) ProtoMessage()

func (*ImportProofResponse) ProtoReflect

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

func (*ImportProofResponse) Reset

func (x *ImportProofResponse) Reset()

func (*ImportProofResponse) String

func (x *ImportProofResponse) String() string

type ProofTransferBackoffWaitEvent

type ProofTransferBackoffWaitEvent struct {

	// Transfer attempt timestamp (microseconds).
	Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	// Backoff is the active backoff wait duration.
	Backoff int64 `protobuf:"varint,2,opt,name=backoff,proto3" json:"backoff,omitempty"`
	// Tries counter is the number of tries we've made so far during the
	// course of the current backoff procedure to deliver the proof to the
	// receiver.
	TriesCounter int64 `protobuf:"varint,3,opt,name=tries_counter,json=triesCounter,proto3" json:"tries_counter,omitempty"`
	// The type of proof transfer attempt.
	TransferType ProofTransferType `` /* 131-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*ProofTransferBackoffWaitEvent) Descriptor deprecated

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

Deprecated: Use ProofTransferBackoffWaitEvent.ProtoReflect.Descriptor instead.

func (*ProofTransferBackoffWaitEvent) GetBackoff

func (x *ProofTransferBackoffWaitEvent) GetBackoff() int64

func (*ProofTransferBackoffWaitEvent) GetTimestamp

func (x *ProofTransferBackoffWaitEvent) GetTimestamp() int64

func (*ProofTransferBackoffWaitEvent) GetTransferType

func (x *ProofTransferBackoffWaitEvent) GetTransferType() ProofTransferType

func (*ProofTransferBackoffWaitEvent) GetTriesCounter

func (x *ProofTransferBackoffWaitEvent) GetTriesCounter() int64

func (*ProofTransferBackoffWaitEvent) ProtoMessage

func (*ProofTransferBackoffWaitEvent) ProtoMessage()

func (*ProofTransferBackoffWaitEvent) ProtoReflect

func (*ProofTransferBackoffWaitEvent) Reset

func (x *ProofTransferBackoffWaitEvent) Reset()

func (*ProofTransferBackoffWaitEvent) String

type ProofTransferType

type ProofTransferType int32

ProofTransferType is the type of proof transfer attempt. The transfer is either a proof delivery to the transfer counterparty or receiving a proof from the transfer counterparty. Note that the transfer counterparty is usually the proof courier service.

const (
	// This value indicates that the proof transfer attempt is a delivery to the
	// transfer counterparty.
	ProofTransferType_PROOF_TRANSFER_TYPE_SEND ProofTransferType = 0
	// This value indicates that the proof transfer attempt is a receive from
	// the transfer counterparty.
	ProofTransferType_PROOF_TRANSFER_TYPE_RECEIVE ProofTransferType = 1
)

func (ProofTransferType) Descriptor

func (ProofTransferType) Enum

func (ProofTransferType) EnumDescriptor deprecated

func (ProofTransferType) EnumDescriptor() ([]byte, []int)

Deprecated: Use ProofTransferType.Descriptor instead.

func (ProofTransferType) Number

func (ProofTransferType) String

func (x ProofTransferType) String() string

func (ProofTransferType) Type

type ReceiveAssetEvent

type ReceiveAssetEvent struct {

	// Types that are valid to be assigned to Event:
	//
	//	*ReceiveAssetEvent_ProofTransferBackoffWaitEvent
	//	*ReceiveAssetEvent_AssetReceiveCompleteEvent
	Event isReceiveAssetEvent_Event `protobuf_oneof:"event"`
	// contains filtered or unexported fields
}

func (*ReceiveAssetEvent) Descriptor deprecated

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

Deprecated: Use ReceiveAssetEvent.ProtoReflect.Descriptor instead.

func (*ReceiveAssetEvent) GetAssetReceiveCompleteEvent

func (x *ReceiveAssetEvent) GetAssetReceiveCompleteEvent() *AssetReceiveCompleteEvent

func (*ReceiveAssetEvent) GetEvent

func (x *ReceiveAssetEvent) GetEvent() isReceiveAssetEvent_Event

func (*ReceiveAssetEvent) GetProofTransferBackoffWaitEvent

func (x *ReceiveAssetEvent) GetProofTransferBackoffWaitEvent() *ProofTransferBackoffWaitEvent

func (*ReceiveAssetEvent) ProtoMessage

func (*ReceiveAssetEvent) ProtoMessage()

func (*ReceiveAssetEvent) ProtoReflect

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

func (*ReceiveAssetEvent) Reset

func (x *ReceiveAssetEvent) Reset()

func (*ReceiveAssetEvent) String

func (x *ReceiveAssetEvent) String() string

type ReceiveAssetEvent_AssetReceiveCompleteEvent

type ReceiveAssetEvent_AssetReceiveCompleteEvent struct {
	// An event which indicates that an asset receive process has finished.
	AssetReceiveCompleteEvent *AssetReceiveCompleteEvent `protobuf:"bytes,2,opt,name=asset_receive_complete_event,json=assetReceiveCompleteEvent,proto3,oneof"`
}

type ReceiveAssetEvent_ProofTransferBackoffWaitEvent

type ReceiveAssetEvent_ProofTransferBackoffWaitEvent struct {
	// An event which indicates that the proof transfer backoff wait period
	// will start imminently.
	ProofTransferBackoffWaitEvent *ProofTransferBackoffWaitEvent `protobuf:"bytes,1,opt,name=proof_transfer_backoff_wait_event,json=proofTransferBackoffWaitEvent,proto3,oneof"`
}

type SendAssetEvent

type SendAssetEvent struct {

	// Types that are valid to be assigned to Event:
	//
	//	*SendAssetEvent_ExecuteSendStateEvent
	//	*SendAssetEvent_ProofTransferBackoffWaitEvent
	Event isSendAssetEvent_Event `protobuf_oneof:"event"`
	// contains filtered or unexported fields
}

func (*SendAssetEvent) Descriptor deprecated

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

Deprecated: Use SendAssetEvent.ProtoReflect.Descriptor instead.

func (*SendAssetEvent) GetEvent

func (x *SendAssetEvent) GetEvent() isSendAssetEvent_Event

func (*SendAssetEvent) GetExecuteSendStateEvent

func (x *SendAssetEvent) GetExecuteSendStateEvent() *ExecuteSendStateEvent

func (*SendAssetEvent) GetProofTransferBackoffWaitEvent

func (x *SendAssetEvent) GetProofTransferBackoffWaitEvent() *ProofTransferBackoffWaitEvent

func (*SendAssetEvent) ProtoMessage

func (*SendAssetEvent) ProtoMessage()

func (*SendAssetEvent) ProtoReflect

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

func (*SendAssetEvent) Reset

func (x *SendAssetEvent) Reset()

func (*SendAssetEvent) String

func (x *SendAssetEvent) String() string

type SendAssetEvent_ExecuteSendStateEvent

type SendAssetEvent_ExecuteSendStateEvent struct {
	// An event which indicates that a send state is about to be executed.
	ExecuteSendStateEvent *ExecuteSendStateEvent `protobuf:"bytes,1,opt,name=execute_send_state_event,json=executeSendStateEvent,proto3,oneof"`
}

type SendAssetEvent_ProofTransferBackoffWaitEvent

type SendAssetEvent_ProofTransferBackoffWaitEvent struct {
	// An event which indicates that the proof transfer backoff wait period
	// will start imminently.
	ProofTransferBackoffWaitEvent *ProofTransferBackoffWaitEvent `protobuf:"bytes,2,opt,name=proof_transfer_backoff_wait_event,json=proofTransferBackoffWaitEvent,proto3,oneof"`
}

type SubscribeReceiveAssetEventNtfnsRequest

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

func (*SubscribeReceiveAssetEventNtfnsRequest) Descriptor deprecated

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

Deprecated: Use SubscribeReceiveAssetEventNtfnsRequest.ProtoReflect.Descriptor instead.

func (*SubscribeReceiveAssetEventNtfnsRequest) ProtoMessage

func (*SubscribeReceiveAssetEventNtfnsRequest) ProtoReflect

func (*SubscribeReceiveAssetEventNtfnsRequest) Reset

func (*SubscribeReceiveAssetEventNtfnsRequest) String

type SubscribeSendAssetEventNtfnsRequest

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

func (*SubscribeSendAssetEventNtfnsRequest) Descriptor deprecated

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

Deprecated: Use SubscribeSendAssetEventNtfnsRequest.ProtoReflect.Descriptor instead.

func (*SubscribeSendAssetEventNtfnsRequest) ProtoMessage

func (*SubscribeSendAssetEventNtfnsRequest) ProtoMessage()

func (*SubscribeSendAssetEventNtfnsRequest) ProtoReflect

func (*SubscribeSendAssetEventNtfnsRequest) Reset

func (*SubscribeSendAssetEventNtfnsRequest) String

type TapDevClient

type TapDevClient interface {
	// Deprecated: Do not use.
	// tapcli: `dev importproof`
	// Deprecated, use the new taprpc.RegisterTransfer RPC instead! ImportProof
	// attempts to import a proof file into the daemon. If successful,
	// a new asset will be inserted on disk, spendable using the specified target
	// script key, and internal key.
	// NOTE: This RPC will be removed with the next major release.
	ImportProof(ctx context.Context, in *ImportProofRequest, opts ...grpc.CallOption) (*ImportProofResponse, error)
	// SubscribeSendAssetEventNtfns registers a subscription to the event
	// notification stream which relates to the asset sending process.
	SubscribeSendAssetEventNtfns(ctx context.Context, in *SubscribeSendAssetEventNtfnsRequest, opts ...grpc.CallOption) (TapDev_SubscribeSendAssetEventNtfnsClient, error)
	// SubscribeReceiveAssetEventNtfns registers a subscription to the event
	// notification stream which relates to the asset receive process.
	SubscribeReceiveAssetEventNtfns(ctx context.Context, in *SubscribeReceiveAssetEventNtfnsRequest, opts ...grpc.CallOption) (TapDev_SubscribeReceiveAssetEventNtfnsClient, error)
}

TapDevClient is the client API for TapDev 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 NewTapDevClient

func NewTapDevClient(cc grpc.ClientConnInterface) TapDevClient

type TapDevServer

type TapDevServer interface {
	// Deprecated: Do not use.
	// tapcli: `dev importproof`
	// Deprecated, use the new taprpc.RegisterTransfer RPC instead! ImportProof
	// attempts to import a proof file into the daemon. If successful,
	// a new asset will be inserted on disk, spendable using the specified target
	// script key, and internal key.
	// NOTE: This RPC will be removed with the next major release.
	ImportProof(context.Context, *ImportProofRequest) (*ImportProofResponse, error)
	// SubscribeSendAssetEventNtfns registers a subscription to the event
	// notification stream which relates to the asset sending process.
	SubscribeSendAssetEventNtfns(*SubscribeSendAssetEventNtfnsRequest, TapDev_SubscribeSendAssetEventNtfnsServer) error
	// SubscribeReceiveAssetEventNtfns registers a subscription to the event
	// notification stream which relates to the asset receive process.
	SubscribeReceiveAssetEventNtfns(*SubscribeReceiveAssetEventNtfnsRequest, TapDev_SubscribeReceiveAssetEventNtfnsServer) error
	// contains filtered or unexported methods
}

TapDevServer is the server API for TapDev service. All implementations must embed UnimplementedTapDevServer for forward compatibility

type TapDev_SubscribeReceiveAssetEventNtfnsClient

type TapDev_SubscribeReceiveAssetEventNtfnsClient interface {
	Recv() (*ReceiveAssetEvent, error)
	grpc.ClientStream
}

type TapDev_SubscribeReceiveAssetEventNtfnsServer

type TapDev_SubscribeReceiveAssetEventNtfnsServer interface {
	Send(*ReceiveAssetEvent) error
	grpc.ServerStream
}

type TapDev_SubscribeSendAssetEventNtfnsClient

type TapDev_SubscribeSendAssetEventNtfnsClient interface {
	Recv() (*SendAssetEvent, error)
	grpc.ClientStream
}

type TapDev_SubscribeSendAssetEventNtfnsServer

type TapDev_SubscribeSendAssetEventNtfnsServer interface {
	Send(*SendAssetEvent) error
	grpc.ServerStream
}

type UnimplementedTapDevServer

type UnimplementedTapDevServer struct {
}

UnimplementedTapDevServer must be embedded to have forward compatible implementations.

func (UnimplementedTapDevServer) ImportProof

type UnsafeTapDevServer

type UnsafeTapDevServer interface {
	// contains filtered or unexported methods
}

UnsafeTapDevServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to TapDevServer will result in compilation errors.

Jump to

Keyboard shortcuts

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