swaps

package
v1.21.2 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2025 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AlbySwapServiceFee = 1.0
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FeeRates

type FeeRates struct {
	FastestFee  uint64 `json:"fastestFee"`
	HalfHourFee uint64 `json:"halfHourFee"`
	HourFee     uint64 `json:"hourFee"`
	EconomyFee  uint64 `json:"economyFee"`
	MinimumFee  uint64 `json:"minimumFee"`
}

type MempoolTx added in v1.18.0

type MempoolTx struct {
	TxId   string       `json:"txid"`
	Status TxStatusInfo `json:"status"`
}

type Swap added in v1.18.0

type Swap = db.Swap

type SwapInfo added in v1.19.0

type SwapInfo struct {
	AlbyServiceFee  float64 `json:"albyServiceFee"`
	BoltzServiceFee float64 `json:"boltzServiceFee"`
	BoltzNetworkFee uint64  `json:"boltzNetworkFee"`
	MinAmount       uint64  `json:"minAmount"`
	MaxAmount       uint64  `json:"maxAmount"`
}

type SwapResponse added in v1.18.0

type SwapResponse struct {
	SwapId      string `json:"swapId"`
	PaymentHash string `json:"paymentHash"`
}

type SwapsService

type SwapsService interface {
	StopAutoSwapOut()
	EnableAutoSwapOut() error
	SwapOut(amount uint64, destination string, autoSwap, usedXpubDerivation bool) (*SwapResponse, error)
	SwapIn(amount uint64, autoSwap bool) (*SwapResponse, error)
	GetSwapOutInfo() (*SwapInfo, error)
	GetSwapInInfo() (*SwapInfo, error)
	RefundSwap(swapId, address string, enableRetries bool) error
	GetSwap(swapId string) (*Swap, error)
	ListSwaps() ([]Swap, error)
}

func NewSwapsService

func NewSwapsService(ctx context.Context, db *gorm.DB, cfg config.Config, keys keys.Keys, eventPublisher events.EventPublisher,
	lnClient lnclient.LNClient, transactionsService transactions.TransactionsService) SwapsService

type TxStatusInfo added in v1.18.0

type TxStatusInfo struct {
	Confirmed   bool   `json:"confirmed"`
	BlockHeight uint32 `json:"block_height"`
	BlockHash   string `json:"block_hash"`
	BlockTime   uint64 `json:"block_time"`
}

Jump to

Keyboard shortcuts

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