provider

package
v0.0.0-...-76ca6e9 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package provider is a generated GoMock package.

Package provider is a generated GoMock package.

Index

Constants

View Source
const (
	// FeeRateTotalParts defines the granularity of the fee rate.
	// Throughout the codebase, we'll use fix based arithmetic to compute
	// fees.
	FeeRateTotalParts = 1e6
)

Variables

This section is empty.

Functions

This section is empty.

Types

type LoopProvider

type LoopProvider struct {
}

func (*LoopProvider) GetSwapStatus

func (l *LoopProvider) GetSwapStatus(ctx context.Context, swapId string, client looprpc.SwapClientClient) (looprpc.SwapStatus, error)

Get the status of a swap by invoking SwapInfo method from the client

func (*LoopProvider) MonitorSwap

func (l *LoopProvider) MonitorSwap(ctx context.Context, swapId string, swapClient looprpc.SwapClientClient) (looprpc.SwapStatus, error)

Monitor a swap status changes and stops when the swap is completed or failed

func (*LoopProvider) RequestReverseSubmarineSwap

Reverse Submarine Swap L2->L1 based on loop (Loop Out)

func (*LoopProvider) RequestSubmarineSwap

func (l *LoopProvider) RequestSubmarineSwap(ctx context.Context, request SubmarineSwapRequest, client looprpc.SwapClientClient) (SubmarineSwapResponse, error)

Submarine Swap L1->L2 based on loop (Loop In)

type MockProvider

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

MockProvider is a mock of Provider interface.

func NewMockProvider

func NewMockProvider(ctrl *gomock.Controller) *MockProvider

NewMockProvider creates a new mock instance.

func (*MockProvider) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockProvider) GetSwapStatus

func (m *MockProvider) GetSwapStatus(arg0 context.Context, arg1 string, arg2 looprpc.SwapClientClient) (looprpc.SwapStatus, error)

GetSwapStatus mocks base method.

func (*MockProvider) MonitorSwap

func (m *MockProvider) MonitorSwap(arg0 context.Context, arg1 string, arg2 looprpc.SwapClientClient) (looprpc.SwapStatus, error)

MonitorSwap mocks base method.

func (*MockProvider) RequestReverseSubmarineSwap

RequestReverseSubmarineSwap mocks base method.

func (*MockProvider) RequestSubmarineSwap

RequestSubmarineSwap mocks base method.

type MockProviderMockRecorder

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

MockProviderMockRecorder is the mock recorder for MockProvider.

func (*MockProviderMockRecorder) GetSwapStatus

func (mr *MockProviderMockRecorder) GetSwapStatus(arg0, arg1, arg2 interface{}) *gomock.Call

GetSwapStatus indicates an expected call of GetSwapStatus.

func (*MockProviderMockRecorder) MonitorSwap

func (mr *MockProviderMockRecorder) MonitorSwap(arg0, arg1, arg2 interface{}) *gomock.Call

MonitorSwap indicates an expected call of MonitorSwap.

func (*MockProviderMockRecorder) RequestReverseSubmarineSwap

func (mr *MockProviderMockRecorder) RequestReverseSubmarineSwap(arg0, arg1, arg2 interface{}) *gomock.Call

RequestReverseSubmarineSwap indicates an expected call of RequestReverseSubmarineSwap.

func (*MockProviderMockRecorder) RequestSubmarineSwap

func (mr *MockProviderMockRecorder) RequestSubmarineSwap(arg0, arg1, arg2 interface{}) *gomock.Call

RequestSubmarineSwap indicates an expected call of RequestSubmarineSwap.

type MockSwapClientClient

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

MockSwapClientClient is a mock of SwapClientClient interface.

func NewMockSwapClientClient

func NewMockSwapClientClient(ctrl *gomock.Controller) *MockSwapClientClient

NewMockSwapClientClient creates a new mock instance.

func (*MockSwapClientClient) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockSwapClientClient) GetInfo

GetInfo mocks base method.

func (*MockSwapClientClient) GetLiquidityParams

GetLiquidityParams mocks base method.

func (*MockSwapClientClient) GetLoopInQuote

GetLoopInQuote mocks base method.

func (*MockSwapClientClient) GetLoopInTerms

GetLoopInTerms mocks base method.

func (*MockSwapClientClient) GetLsatTokens

GetLsatTokens mocks base method.

func (*MockSwapClientClient) ListSwaps

ListSwaps mocks base method.

func (*MockSwapClientClient) LoopIn

LoopIn mocks base method.

func (*MockSwapClientClient) LoopOut

LoopOut mocks base method.

func (*MockSwapClientClient) LoopOutQuote

LoopOutQuote mocks base method.

func (*MockSwapClientClient) LoopOutTerms

LoopOutTerms mocks base method.

func (*MockSwapClientClient) Monitor

Monitor mocks base method.

func (*MockSwapClientClient) Probe

Probe mocks base method.

func (*MockSwapClientClient) SetLiquidityParams

SetLiquidityParams mocks base method.

func (*MockSwapClientClient) SuggestSwaps

SuggestSwaps mocks base method.

func (*MockSwapClientClient) SwapInfo

SwapInfo mocks base method.

type MockSwapClientClientMockRecorder

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

MockSwapClientClientMockRecorder is the mock recorder for MockSwapClientClient.

func (*MockSwapClientClientMockRecorder) GetInfo

func (mr *MockSwapClientClientMockRecorder) GetInfo(ctx, in interface{}, opts ...interface{}) *gomock.Call

GetInfo indicates an expected call of GetInfo.

func (*MockSwapClientClientMockRecorder) GetLiquidityParams

func (mr *MockSwapClientClientMockRecorder) GetLiquidityParams(ctx, in interface{}, opts ...interface{}) *gomock.Call

GetLiquidityParams indicates an expected call of GetLiquidityParams.

func (*MockSwapClientClientMockRecorder) GetLoopInQuote

func (mr *MockSwapClientClientMockRecorder) GetLoopInQuote(ctx, in interface{}, opts ...interface{}) *gomock.Call

GetLoopInQuote indicates an expected call of GetLoopInQuote.

func (*MockSwapClientClientMockRecorder) GetLoopInTerms

func (mr *MockSwapClientClientMockRecorder) GetLoopInTerms(ctx, in interface{}, opts ...interface{}) *gomock.Call

GetLoopInTerms indicates an expected call of GetLoopInTerms.

func (*MockSwapClientClientMockRecorder) GetLsatTokens

func (mr *MockSwapClientClientMockRecorder) GetLsatTokens(ctx, in interface{}, opts ...interface{}) *gomock.Call

GetLsatTokens indicates an expected call of GetLsatTokens.

func (*MockSwapClientClientMockRecorder) ListSwaps

func (mr *MockSwapClientClientMockRecorder) ListSwaps(ctx, in interface{}, opts ...interface{}) *gomock.Call

ListSwaps indicates an expected call of ListSwaps.

func (*MockSwapClientClientMockRecorder) LoopIn

func (mr *MockSwapClientClientMockRecorder) LoopIn(ctx, in interface{}, opts ...interface{}) *gomock.Call

LoopIn indicates an expected call of LoopIn.

func (*MockSwapClientClientMockRecorder) LoopOut

func (mr *MockSwapClientClientMockRecorder) LoopOut(ctx, in interface{}, opts ...interface{}) *gomock.Call

LoopOut indicates an expected call of LoopOut.

func (*MockSwapClientClientMockRecorder) LoopOutQuote

func (mr *MockSwapClientClientMockRecorder) LoopOutQuote(ctx, in interface{}, opts ...interface{}) *gomock.Call

LoopOutQuote indicates an expected call of LoopOutQuote.

func (*MockSwapClientClientMockRecorder) LoopOutTerms

func (mr *MockSwapClientClientMockRecorder) LoopOutTerms(ctx, in interface{}, opts ...interface{}) *gomock.Call

LoopOutTerms indicates an expected call of LoopOutTerms.

func (*MockSwapClientClientMockRecorder) Monitor

func (mr *MockSwapClientClientMockRecorder) Monitor(ctx, in interface{}, opts ...interface{}) *gomock.Call

Monitor indicates an expected call of Monitor.

func (*MockSwapClientClientMockRecorder) Probe

func (mr *MockSwapClientClientMockRecorder) Probe(ctx, in interface{}, opts ...interface{}) *gomock.Call

Probe indicates an expected call of Probe.

func (*MockSwapClientClientMockRecorder) SetLiquidityParams

func (mr *MockSwapClientClientMockRecorder) SetLiquidityParams(ctx, in interface{}, opts ...interface{}) *gomock.Call

SetLiquidityParams indicates an expected call of SetLiquidityParams.

func (*MockSwapClientClientMockRecorder) SuggestSwaps

func (mr *MockSwapClientClientMockRecorder) SuggestSwaps(ctx, in interface{}, opts ...interface{}) *gomock.Call

SuggestSwaps indicates an expected call of SuggestSwaps.

func (*MockSwapClientClientMockRecorder) SwapInfo

func (mr *MockSwapClientClientMockRecorder) SwapInfo(ctx, in interface{}, opts ...interface{}) *gomock.Call

SwapInfo indicates an expected call of SwapInfo.

type MockSwapClientServer

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

MockSwapClientServer is a mock of SwapClientServer interface.

func NewMockSwapClientServer

func NewMockSwapClientServer(ctrl *gomock.Controller) *MockSwapClientServer

NewMockSwapClientServer creates a new mock instance.

func (*MockSwapClientServer) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockSwapClientServer) GetInfo

GetInfo mocks base method.

func (*MockSwapClientServer) GetLiquidityParams

GetLiquidityParams mocks base method.

func (*MockSwapClientServer) GetLoopInQuote

GetLoopInQuote mocks base method.

func (*MockSwapClientServer) GetLoopInTerms

GetLoopInTerms mocks base method.

func (*MockSwapClientServer) GetLsatTokens

GetLsatTokens mocks base method.

func (*MockSwapClientServer) ListSwaps

ListSwaps mocks base method.

func (*MockSwapClientServer) LoopIn

LoopIn mocks base method.

func (*MockSwapClientServer) LoopOut

LoopOut mocks base method.

func (*MockSwapClientServer) LoopOutQuote

LoopOutQuote mocks base method.

func (*MockSwapClientServer) LoopOutTerms

LoopOutTerms mocks base method.

func (*MockSwapClientServer) Monitor

Monitor mocks base method.

func (*MockSwapClientServer) Probe

Probe mocks base method.

func (*MockSwapClientServer) SetLiquidityParams

SetLiquidityParams mocks base method.

func (*MockSwapClientServer) SuggestSwaps

SuggestSwaps mocks base method.

func (*MockSwapClientServer) SwapInfo

SwapInfo mocks base method.

type MockSwapClientServerMockRecorder

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

MockSwapClientServerMockRecorder is the mock recorder for MockSwapClientServer.

func (*MockSwapClientServerMockRecorder) GetInfo

func (mr *MockSwapClientServerMockRecorder) GetInfo(arg0, arg1 interface{}) *gomock.Call

GetInfo indicates an expected call of GetInfo.

func (*MockSwapClientServerMockRecorder) GetLiquidityParams

func (mr *MockSwapClientServerMockRecorder) GetLiquidityParams(arg0, arg1 interface{}) *gomock.Call

GetLiquidityParams indicates an expected call of GetLiquidityParams.

func (*MockSwapClientServerMockRecorder) GetLoopInQuote

func (mr *MockSwapClientServerMockRecorder) GetLoopInQuote(arg0, arg1 interface{}) *gomock.Call

GetLoopInQuote indicates an expected call of GetLoopInQuote.

func (*MockSwapClientServerMockRecorder) GetLoopInTerms

func (mr *MockSwapClientServerMockRecorder) GetLoopInTerms(arg0, arg1 interface{}) *gomock.Call

GetLoopInTerms indicates an expected call of GetLoopInTerms.

func (*MockSwapClientServerMockRecorder) GetLsatTokens

func (mr *MockSwapClientServerMockRecorder) GetLsatTokens(arg0, arg1 interface{}) *gomock.Call

GetLsatTokens indicates an expected call of GetLsatTokens.

func (*MockSwapClientServerMockRecorder) ListSwaps

func (mr *MockSwapClientServerMockRecorder) ListSwaps(arg0, arg1 interface{}) *gomock.Call

ListSwaps indicates an expected call of ListSwaps.

func (*MockSwapClientServerMockRecorder) LoopIn

func (mr *MockSwapClientServerMockRecorder) LoopIn(arg0, arg1 interface{}) *gomock.Call

LoopIn indicates an expected call of LoopIn.

func (*MockSwapClientServerMockRecorder) LoopOut

func (mr *MockSwapClientServerMockRecorder) LoopOut(arg0, arg1 interface{}) *gomock.Call

LoopOut indicates an expected call of LoopOut.

func (*MockSwapClientServerMockRecorder) LoopOutQuote

func (mr *MockSwapClientServerMockRecorder) LoopOutQuote(arg0, arg1 interface{}) *gomock.Call

LoopOutQuote indicates an expected call of LoopOutQuote.

func (*MockSwapClientServerMockRecorder) LoopOutTerms

func (mr *MockSwapClientServerMockRecorder) LoopOutTerms(arg0, arg1 interface{}) *gomock.Call

LoopOutTerms indicates an expected call of LoopOutTerms.

func (*MockSwapClientServerMockRecorder) Monitor

func (mr *MockSwapClientServerMockRecorder) Monitor(arg0, arg1 interface{}) *gomock.Call

Monitor indicates an expected call of Monitor.

func (*MockSwapClientServerMockRecorder) Probe

func (mr *MockSwapClientServerMockRecorder) Probe(arg0, arg1 interface{}) *gomock.Call

Probe indicates an expected call of Probe.

func (*MockSwapClientServerMockRecorder) SetLiquidityParams

func (mr *MockSwapClientServerMockRecorder) SetLiquidityParams(arg0, arg1 interface{}) *gomock.Call

SetLiquidityParams indicates an expected call of SetLiquidityParams.

func (*MockSwapClientServerMockRecorder) SuggestSwaps

func (mr *MockSwapClientServerMockRecorder) SuggestSwaps(arg0, arg1 interface{}) *gomock.Call

SuggestSwaps indicates an expected call of SuggestSwaps.

func (*MockSwapClientServerMockRecorder) SwapInfo

func (mr *MockSwapClientServerMockRecorder) SwapInfo(arg0, arg1 interface{}) *gomock.Call

SwapInfo indicates an expected call of SwapInfo.

type MockSwapClient_MonitorClient

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

MockSwapClient_MonitorClient is a mock of SwapClient_MonitorClient interface.

func NewMockSwapClient_MonitorClient

func NewMockSwapClient_MonitorClient(ctrl *gomock.Controller) *MockSwapClient_MonitorClient

NewMockSwapClient_MonitorClient creates a new mock instance.

func (*MockSwapClient_MonitorClient) CloseSend

func (m *MockSwapClient_MonitorClient) CloseSend() error

CloseSend mocks base method.

func (*MockSwapClient_MonitorClient) Context

Context mocks base method.

func (*MockSwapClient_MonitorClient) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockSwapClient_MonitorClient) Header

Header mocks base method.

func (*MockSwapClient_MonitorClient) Recv

Recv mocks base method.

func (*MockSwapClient_MonitorClient) RecvMsg

func (m_2 *MockSwapClient_MonitorClient) RecvMsg(m interface{}) error

RecvMsg mocks base method.

func (*MockSwapClient_MonitorClient) SendMsg

func (m_2 *MockSwapClient_MonitorClient) SendMsg(m interface{}) error

SendMsg mocks base method.

func (*MockSwapClient_MonitorClient) Trailer

Trailer mocks base method.

type MockSwapClient_MonitorClientMockRecorder

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

MockSwapClient_MonitorClientMockRecorder is the mock recorder for MockSwapClient_MonitorClient.

func (*MockSwapClient_MonitorClientMockRecorder) CloseSend

CloseSend indicates an expected call of CloseSend.

func (*MockSwapClient_MonitorClientMockRecorder) Context

Context indicates an expected call of Context.

func (*MockSwapClient_MonitorClientMockRecorder) Header

Header indicates an expected call of Header.

func (*MockSwapClient_MonitorClientMockRecorder) Recv

Recv indicates an expected call of Recv.

func (*MockSwapClient_MonitorClientMockRecorder) RecvMsg

func (mr *MockSwapClient_MonitorClientMockRecorder) RecvMsg(m interface{}) *gomock.Call

RecvMsg indicates an expected call of RecvMsg.

func (*MockSwapClient_MonitorClientMockRecorder) SendMsg

func (mr *MockSwapClient_MonitorClientMockRecorder) SendMsg(m interface{}) *gomock.Call

SendMsg indicates an expected call of SendMsg.

func (*MockSwapClient_MonitorClientMockRecorder) Trailer

Trailer indicates an expected call of Trailer.

type MockSwapClient_MonitorServer

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

MockSwapClient_MonitorServer is a mock of SwapClient_MonitorServer interface.

func NewMockSwapClient_MonitorServer

func NewMockSwapClient_MonitorServer(ctrl *gomock.Controller) *MockSwapClient_MonitorServer

NewMockSwapClient_MonitorServer creates a new mock instance.

func (*MockSwapClient_MonitorServer) Context

Context mocks base method.

func (*MockSwapClient_MonitorServer) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockSwapClient_MonitorServer) RecvMsg

func (m_2 *MockSwapClient_MonitorServer) RecvMsg(m interface{}) error

RecvMsg mocks base method.

func (*MockSwapClient_MonitorServer) Send

Send mocks base method.

func (*MockSwapClient_MonitorServer) SendHeader

func (m *MockSwapClient_MonitorServer) SendHeader(arg0 metadata.MD) error

SendHeader mocks base method.

func (*MockSwapClient_MonitorServer) SendMsg

func (m_2 *MockSwapClient_MonitorServer) SendMsg(m interface{}) error

SendMsg mocks base method.

func (*MockSwapClient_MonitorServer) SetHeader

func (m *MockSwapClient_MonitorServer) SetHeader(arg0 metadata.MD) error

SetHeader mocks base method.

func (*MockSwapClient_MonitorServer) SetTrailer

func (m *MockSwapClient_MonitorServer) SetTrailer(arg0 metadata.MD)

SetTrailer mocks base method.

type MockSwapClient_MonitorServerMockRecorder

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

MockSwapClient_MonitorServerMockRecorder is the mock recorder for MockSwapClient_MonitorServer.

func (*MockSwapClient_MonitorServerMockRecorder) Context

Context indicates an expected call of Context.

func (*MockSwapClient_MonitorServerMockRecorder) RecvMsg

func (mr *MockSwapClient_MonitorServerMockRecorder) RecvMsg(m interface{}) *gomock.Call

RecvMsg indicates an expected call of RecvMsg.

func (*MockSwapClient_MonitorServerMockRecorder) Send

func (mr *MockSwapClient_MonitorServerMockRecorder) Send(arg0 interface{}) *gomock.Call

Send indicates an expected call of Send.

func (*MockSwapClient_MonitorServerMockRecorder) SendHeader

func (mr *MockSwapClient_MonitorServerMockRecorder) SendHeader(arg0 interface{}) *gomock.Call

SendHeader indicates an expected call of SendHeader.

func (*MockSwapClient_MonitorServerMockRecorder) SendMsg

func (mr *MockSwapClient_MonitorServerMockRecorder) SendMsg(m interface{}) *gomock.Call

SendMsg indicates an expected call of SendMsg.

func (*MockSwapClient_MonitorServerMockRecorder) SetHeader

func (mr *MockSwapClient_MonitorServerMockRecorder) SetHeader(arg0 interface{}) *gomock.Call

SetHeader indicates an expected call of SetHeader.

func (*MockSwapClient_MonitorServerMockRecorder) SetTrailer

func (mr *MockSwapClient_MonitorServerMockRecorder) SetTrailer(arg0 interface{}) *gomock.Call

SetTrailer indicates an expected call of SetTrailer.

type MockUnsafeSwapClientServer

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

MockUnsafeSwapClientServer is a mock of UnsafeSwapClientServer interface.

func NewMockUnsafeSwapClientServer

func NewMockUnsafeSwapClientServer(ctrl *gomock.Controller) *MockUnsafeSwapClientServer

NewMockUnsafeSwapClientServer creates a new mock instance.

func (*MockUnsafeSwapClientServer) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

type MockUnsafeSwapClientServerMockRecorder

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

MockUnsafeSwapClientServerMockRecorder is the mock recorder for MockUnsafeSwapClientServer.

type Provider

type Provider interface {

	//Submarine Swap L1->L2
	RequestSubmarineSwap(context.Context, SubmarineSwapRequest, looprpc.SwapClientClient) (SubmarineSwapResponse, error)

	//Reverse Submarine Swap L2->L1
	RequestReverseSubmarineSwap(context.Context, ReverseSubmarineSwapRequest, looprpc.SwapClientClient) (ReverseSubmarineSwapResponse, error)

	//Swap info
	GetSwapStatus(context.Context, string, looprpc.SwapClientClient) (looprpc.SwapStatus, error)

	//Monitor Swap by waiting for it to complete or fail
	MonitorSwap(context.Context, string, looprpc.SwapClientClient) (looprpc.SwapStatus, error)
}

type ReverseSubmarineSwapRequest

type ReverseSubmarineSwapRequest struct {
	//L1 Address to receive L2 funds
	ReceiverBTCAddress string
	SatsAmount         int64
	ChannelSet         []uint64
}

Provider-agnostic request for a reverse submarine swap

type ReverseSubmarineSwapResponse

type ReverseSubmarineSwapResponse struct {
	SwapId string
}

Provider-agnostic response for a reverse submarine swap

type SubmarineSwapRequest

type SubmarineSwapRequest struct {
	SatsAmount int64
	//Last hop node to identify which channel to use, if multiple channels are with this node then there is no way to know which one will be used
	LastHopPubkey string
}

Provider-agnostic request for a submarine swap

type SubmarineSwapResponse

type SubmarineSwapResponse struct {
	SwapId string
	//L1 address to send the funds to pay for the submarine swap
	InvoiceBTCAddress string
}

Provider-agnostic response for a submarine swap

Jump to

Keyboard shortcuts

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