provider

package
v0.0.0-...-5b29e1b Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2025 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 {
	// contains filtered or unexported fields
}

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) 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 any) *gomock.Call

GetSwapStatus indicates an expected call of GetSwapStatus.

func (*MockProviderMockRecorder) MonitorSwap

func (mr *MockProviderMockRecorder) MonitorSwap(arg0, arg1, arg2 any) *gomock.Call

MonitorSwap indicates an expected call of MonitorSwap.

func (*MockProviderMockRecorder) RequestReverseSubmarineSwap

func (mr *MockProviderMockRecorder) RequestReverseSubmarineSwap(arg0, arg1, arg2 any) *gomock.Call

RequestReverseSubmarineSwap indicates an expected call of RequestReverseSubmarineSwap.

func (*MockProviderMockRecorder) RequestSubmarineSwap

func (mr *MockProviderMockRecorder) RequestSubmarineSwap(arg0, arg1, arg2 any) *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) AbandonSwap

AbandonSwap mocks base method.

func (*MockSwapClientClient) EXPECT

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

func (*MockSwapClientClient) FetchL402Token

FetchL402Token mocks base method.

func (*MockSwapClientClient) GetInfo

GetInfo mocks base method.

func (*MockSwapClientClient) GetL402Tokens

GetL402Tokens 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) GetStaticAddressSummary

GetStaticAddressSummary mocks base method.

func (*MockSwapClientClient) InstantOut

InstantOut mocks base method.

func (*MockSwapClientClient) InstantOutQuote

InstantOutQuote mocks base method.

func (*MockSwapClientClient) ListInstantOuts

ListInstantOuts mocks base method.

func (*MockSwapClientClient) ListReservations

ListReservations mocks base method.

func (*MockSwapClientClient) ListStaticAddressDeposits

ListStaticAddressDeposits mocks base method.

func (*MockSwapClientClient) ListStaticAddressSwaps

ListStaticAddressSwaps mocks base method.

func (*MockSwapClientClient) ListSwaps

ListSwaps mocks base method.

func (*MockSwapClientClient) ListUnspentDeposits

ListUnspentDeposits 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) NewStaticAddress

NewStaticAddress mocks base method.

func (*MockSwapClientClient) Probe

Probe mocks base method.

func (*MockSwapClientClient) SetLiquidityParams

SetLiquidityParams mocks base method.

func (*MockSwapClientClient) StaticAddressLoopIn

StaticAddressLoopIn mocks base method.

func (*MockSwapClientClient) SuggestSwaps

SuggestSwaps mocks base method.

func (*MockSwapClientClient) SwapInfo

SwapInfo mocks base method.

func (*MockSwapClientClient) WithdrawDeposits

WithdrawDeposits mocks base method.

type MockSwapClientClientMockRecorder

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

MockSwapClientClientMockRecorder is the mock recorder for MockSwapClientClient.

func (*MockSwapClientClientMockRecorder) AbandonSwap

func (mr *MockSwapClientClientMockRecorder) AbandonSwap(ctx, in any, opts ...any) *gomock.Call

AbandonSwap indicates an expected call of AbandonSwap.

func (*MockSwapClientClientMockRecorder) FetchL402Token

func (mr *MockSwapClientClientMockRecorder) FetchL402Token(ctx, in any, opts ...any) *gomock.Call

FetchL402Token indicates an expected call of FetchL402Token.

func (*MockSwapClientClientMockRecorder) GetInfo

func (mr *MockSwapClientClientMockRecorder) GetInfo(ctx, in any, opts ...any) *gomock.Call

GetInfo indicates an expected call of GetInfo.

func (*MockSwapClientClientMockRecorder) GetL402Tokens

func (mr *MockSwapClientClientMockRecorder) GetL402Tokens(ctx, in any, opts ...any) *gomock.Call

GetL402Tokens indicates an expected call of GetL402Tokens.

func (*MockSwapClientClientMockRecorder) GetLiquidityParams

func (mr *MockSwapClientClientMockRecorder) GetLiquidityParams(ctx, in any, opts ...any) *gomock.Call

GetLiquidityParams indicates an expected call of GetLiquidityParams.

func (*MockSwapClientClientMockRecorder) GetLoopInQuote

func (mr *MockSwapClientClientMockRecorder) GetLoopInQuote(ctx, in any, opts ...any) *gomock.Call

GetLoopInQuote indicates an expected call of GetLoopInQuote.

func (*MockSwapClientClientMockRecorder) GetLoopInTerms

func (mr *MockSwapClientClientMockRecorder) GetLoopInTerms(ctx, in any, opts ...any) *gomock.Call

GetLoopInTerms indicates an expected call of GetLoopInTerms.

func (*MockSwapClientClientMockRecorder) GetLsatTokens

func (mr *MockSwapClientClientMockRecorder) GetLsatTokens(ctx, in any, opts ...any) *gomock.Call

GetLsatTokens indicates an expected call of GetLsatTokens.

func (*MockSwapClientClientMockRecorder) GetStaticAddressSummary

func (mr *MockSwapClientClientMockRecorder) GetStaticAddressSummary(ctx, in any, opts ...any) *gomock.Call

GetStaticAddressSummary indicates an expected call of GetStaticAddressSummary.

func (*MockSwapClientClientMockRecorder) InstantOut

func (mr *MockSwapClientClientMockRecorder) InstantOut(ctx, in any, opts ...any) *gomock.Call

InstantOut indicates an expected call of InstantOut.

func (*MockSwapClientClientMockRecorder) InstantOutQuote

func (mr *MockSwapClientClientMockRecorder) InstantOutQuote(ctx, in any, opts ...any) *gomock.Call

InstantOutQuote indicates an expected call of InstantOutQuote.

func (*MockSwapClientClientMockRecorder) ListInstantOuts

func (mr *MockSwapClientClientMockRecorder) ListInstantOuts(ctx, in any, opts ...any) *gomock.Call

ListInstantOuts indicates an expected call of ListInstantOuts.

func (*MockSwapClientClientMockRecorder) ListReservations

func (mr *MockSwapClientClientMockRecorder) ListReservations(ctx, in any, opts ...any) *gomock.Call

ListReservations indicates an expected call of ListReservations.

func (*MockSwapClientClientMockRecorder) ListStaticAddressDeposits

func (mr *MockSwapClientClientMockRecorder) ListStaticAddressDeposits(ctx, in any, opts ...any) *gomock.Call

ListStaticAddressDeposits indicates an expected call of ListStaticAddressDeposits.

func (*MockSwapClientClientMockRecorder) ListStaticAddressSwaps

func (mr *MockSwapClientClientMockRecorder) ListStaticAddressSwaps(ctx, in any, opts ...any) *gomock.Call

ListStaticAddressSwaps indicates an expected call of ListStaticAddressSwaps.

func (*MockSwapClientClientMockRecorder) ListSwaps

func (mr *MockSwapClientClientMockRecorder) ListSwaps(ctx, in any, opts ...any) *gomock.Call

ListSwaps indicates an expected call of ListSwaps.

func (*MockSwapClientClientMockRecorder) ListUnspentDeposits

func (mr *MockSwapClientClientMockRecorder) ListUnspentDeposits(ctx, in any, opts ...any) *gomock.Call

ListUnspentDeposits indicates an expected call of ListUnspentDeposits.

func (*MockSwapClientClientMockRecorder) LoopIn

func (mr *MockSwapClientClientMockRecorder) LoopIn(ctx, in any, opts ...any) *gomock.Call

LoopIn indicates an expected call of LoopIn.

func (*MockSwapClientClientMockRecorder) LoopOut

func (mr *MockSwapClientClientMockRecorder) LoopOut(ctx, in any, opts ...any) *gomock.Call

LoopOut indicates an expected call of LoopOut.

func (*MockSwapClientClientMockRecorder) LoopOutQuote

func (mr *MockSwapClientClientMockRecorder) LoopOutQuote(ctx, in any, opts ...any) *gomock.Call

LoopOutQuote indicates an expected call of LoopOutQuote.

func (*MockSwapClientClientMockRecorder) LoopOutTerms

func (mr *MockSwapClientClientMockRecorder) LoopOutTerms(ctx, in any, opts ...any) *gomock.Call

LoopOutTerms indicates an expected call of LoopOutTerms.

func (*MockSwapClientClientMockRecorder) Monitor

func (mr *MockSwapClientClientMockRecorder) Monitor(ctx, in any, opts ...any) *gomock.Call

Monitor indicates an expected call of Monitor.

func (*MockSwapClientClientMockRecorder) NewStaticAddress

func (mr *MockSwapClientClientMockRecorder) NewStaticAddress(ctx, in any, opts ...any) *gomock.Call

NewStaticAddress indicates an expected call of NewStaticAddress.

func (*MockSwapClientClientMockRecorder) Probe

func (mr *MockSwapClientClientMockRecorder) Probe(ctx, in any, opts ...any) *gomock.Call

Probe indicates an expected call of Probe.

func (*MockSwapClientClientMockRecorder) SetLiquidityParams

func (mr *MockSwapClientClientMockRecorder) SetLiquidityParams(ctx, in any, opts ...any) *gomock.Call

SetLiquidityParams indicates an expected call of SetLiquidityParams.

func (*MockSwapClientClientMockRecorder) StaticAddressLoopIn

func (mr *MockSwapClientClientMockRecorder) StaticAddressLoopIn(ctx, in any, opts ...any) *gomock.Call

StaticAddressLoopIn indicates an expected call of StaticAddressLoopIn.

func (*MockSwapClientClientMockRecorder) SuggestSwaps

func (mr *MockSwapClientClientMockRecorder) SuggestSwaps(ctx, in any, opts ...any) *gomock.Call

SuggestSwaps indicates an expected call of SuggestSwaps.

func (*MockSwapClientClientMockRecorder) SwapInfo

func (mr *MockSwapClientClientMockRecorder) SwapInfo(ctx, in any, opts ...any) *gomock.Call

SwapInfo indicates an expected call of SwapInfo.

func (*MockSwapClientClientMockRecorder) WithdrawDeposits

func (mr *MockSwapClientClientMockRecorder) WithdrawDeposits(ctx, in any, opts ...any) *gomock.Call

WithdrawDeposits indicates an expected call of WithdrawDeposits.

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
	ChannelId          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
	//Channel ID for per-channel locking
	ChannelId uint64
}

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