swaps

package
v1.22.0 Latest Latest
Warning

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

Go to latest
Published: May 1, 2026 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
	BoltzServiceFee    float64
	BoltzNetworkFeeSat uint64
	MinAmountSat       uint64
	MaxAmountSat       uint64
}

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(encryptionKey string) error
	SwapOut(amountSat uint64, destination string, autoSwap, usedXpubDerivation bool) (*SwapResponse, error)
	SwapIn(amountSat 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)
	GetDecryptedAutoSwapXpub() string
	ValidateAddress(address string) error
	ValidateXpub(xpub string) 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, encryptionKey string) 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