application

package
v0.3.15 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2026 License: MIT Imports: 42 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WalletInit   = "init"
	WalletUnlock = "unlock"
	WalletReset  = "reset"
)

Variables

View Source
var ErrorNoVtxosFound = fmt.Errorf("no vtxos found for the given vhtlc opts")

Functions

func NewServices added in v0.3.14

func NewServices(
	buildInfo BuildInfo,
	storeCfg store.Config,
	storeSvc types.Store,
	dbSvc ports.RepoManager,
	schedulerSvc ports.SchedulerService,
	esploraUrl, boltzUrl, boltzWSUrl string, swapTimeout uint32,
	connectionOpts *domain.LnConnectionOpts,
	refreshDbInterval int64,
	delegatorConfig DelegatorConfig,
) (*Service, *DelegatorService, error)

Types

type BuildInfo

type BuildInfo struct {
	Version string
	Commit  string
	Date    string
}

type DelegateInfo added in v0.3.14

type DelegateInfo struct {
	DelegatorPublicKey string
	Fee                uint64
	DelegatorAddress   string
}

type DelegatorConfig added in v0.3.14

type DelegatorConfig struct {
	Enabled bool
	Fee     uint64
}

type DelegatorService added in v0.3.14

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

func (*DelegatorService) Delegate added in v0.3.14

func (s *DelegatorService) Delegate(
	ctx context.Context,
	intentMessage intent.RegisterMessage, intentProof intent.Proof, forfeitTxs []*psbt.Packet,
	allowReplace bool,
) error

Delegate creates a delegate task, then schedules it for execution if valid

func (*DelegatorService) GetDelegatorInfo added in v0.3.14

func (s *DelegatorService) GetDelegatorInfo(ctx context.Context) (*DelegateInfo, error)

GetDelegatorInfo returns the data needed to create the intent & forfeit tx for a delegate task.

func (*DelegatorService) Stop added in v0.3.14

func (s *DelegatorService) Stop()

type Notification

type Notification struct {
	indexer.TxData
	Addrs       []string
	NewVtxos    []types.Vtxo
	SpentVtxos  []types.Vtxo
	Checkpoints map[string]indexer.TxData
}

type Service

type Service struct {
	BuildInfo BuildInfo

	arksdk.ArkClient
	// contains filtered or unexported fields
}

func (*Service) AddDefaultSettings

func (s *Service) AddDefaultSettings(ctx context.Context) error

func (*Service) ClaimVHTLC

func (s *Service) ClaimVHTLC(
	ctx context.Context, preimage []byte, vhtlc_id string,
) (string, error)

func (*Service) ConnectLN

func (s *Service) ConnectLN(ctx context.Context, lnUrl string) error

func (*Service) DisconnectLN

func (s *Service) DisconnectLN()

func (*Service) GetAddress

func (s *Service) GetAddress(
	ctx context.Context, sats uint64,
) (bip21Addr, offchainAddr, boardingAddr, invoice, pubkey string, err error)

func (*Service) GetBalanceLN

func (s *Service) GetBalanceLN(ctx context.Context) (balance uint64, err error)

func (*Service) GetDelegateTaskByID added in v0.3.14

func (s *Service) GetDelegateTaskByID(ctx context.Context, id string) (*domain.DelegateTask, error)

func (*Service) GetDelegateTasks added in v0.3.14

func (s *Service) GetDelegateTasks(ctx context.Context, status domain.DelegateTaskStatus, limit int, offset int) ([]domain.DelegateTask, error)

func (*Service) GetInvoice

func (s *Service) GetInvoice(ctx context.Context, amount uint64) (*SwapResponse, error)

func (*Service) GetLnConnectUrl added in v0.3.0

func (s *Service) GetLnConnectUrl() string

func (*Service) GetRound

func (s *Service) GetRound(ctx context.Context, roundId string) (*indexer.CommitmentTx, error)

func (*Service) GetSettings

func (s *Service) GetSettings(ctx context.Context) (*domain.Settings, error)

func (*Service) GetSwapHistory added in v0.1.12

func (s *Service) GetSwapHistory(ctx context.Context) ([]domain.Swap, error)

func (*Service) GetSwapVHTLC added in v0.3.8

func (s *Service) GetSwapVHTLC(
	ctx context.Context,
	receiverPubkey, senderPubkey *btcec.PublicKey,
	preimageHash []byte,
	refundLocktimeParam *arklib.AbsoluteLocktime,
	unilateralClaimDelayParam *arklib.RelativeLocktime,
	unilateralRefundDelayParam *arklib.RelativeLocktime,
	unilateralRefundWithoutReceiverDelayParam *arklib.RelativeLocktime,
) (string, string, *vhtlc.VHTLCScript, error)

func (*Service) GetSyncedUpdate added in v0.3.0

func (s *Service) GetSyncedUpdate() <-chan types.SyncEvent

func (*Service) GetTotalBalance

func (s *Service) GetTotalBalance(ctx context.Context) (uint64, error)

func (*Service) GetVirtualTxs added in v0.3.0

func (s *Service) GetVirtualTxs(ctx context.Context, txids []string) ([]string, error)

func (*Service) GetVtxoNotifications

func (s *Service) GetVtxoNotifications(ctx context.Context) <-chan Notification

func (*Service) GetVtxos added in v0.3.12

func (s *Service) GetVtxos(ctx context.Context, filterType string) ([]types.Vtxo, error)

func (*Service) GetWalletUpdates added in v0.1.12

func (s *Service) GetWalletUpdates() <-chan WalletUpdate

func (*Service) IncreaseInboundCapacity

func (s *Service) IncreaseInboundCapacity(ctx context.Context, amount uint64) (string, error)

ln -> ark (reverse submarine swap)

func (*Service) IncreaseOutboundCapacity

func (s *Service) IncreaseOutboundCapacity(
	ctx context.Context, amount uint64,
) (SwapResponse, error)

ark -> ln (submarine swap)

func (*Service) IsConnectedLN

func (s *Service) IsConnectedLN() bool

func (*Service) IsInitialized added in v0.3.0

func (s *Service) IsInitialized() bool

func (*Service) IsInvoiceSettled

func (s *Service) IsInvoiceSettled(ctx context.Context, invoice string) (bool, error)

func (*Service) IsLocked added in v0.1.8

func (s *Service) IsLocked(ctx context.Context) bool

func (*Service) IsPreConfiguredLN added in v0.3.0

func (s *Service) IsPreConfiguredLN() bool

func (*Service) IsSynced added in v0.3.0

func (s *Service) IsSynced() (bool, error)

func (*Service) ListVHTLC

func (s *Service) ListVHTLC(
	ctx context.Context, vhtlc_id string,
) ([]types.Vtxo, []domain.Vhtlc, error)

func (*Service) LockNode

func (s *Service) LockNode(ctx context.Context) error

func (*Service) NewSettings

func (s *Service) NewSettings(ctx context.Context, settings domain.Settings) error

func (*Service) PayInvoice

func (s *Service) PayInvoice(ctx context.Context, invoice string) (*SwapResponse, error)

func (*Service) PayOffer added in v0.3.0

func (s *Service) PayOffer(ctx context.Context, offer string) (*SwapResponse, error)

func (*Service) RefundVHTLC added in v0.1.4

func (s *Service) RefundVHTLC(
	ctx context.Context, swapId, vhtlc_id string, withReceiver bool,
) (string, error)

func (*Service) ResetWallet added in v0.1.8

func (s *Service) ResetWallet(ctx context.Context) error

func (*Service) SendOnChain added in v0.3.0

func (s *Service) SendOnChain(ctx context.Context, addr string, amount uint64) (string, error)

func (*Service) Settle added in v0.1.6

func (s *Service) Settle(ctx context.Context) (string, error)

func (*Service) SettleVHTLCWithClaimPath added in v0.3.11

func (s *Service) SettleVHTLCWithClaimPath(
	ctx context.Context, vhtlcId string, preimage []byte,
) (string, error)

SettleVHTLCWithClaimPath settles a VHTLC via claim path (revealing preimage) in a batch session.

func (*Service) SettleVHTLCWithCollaborativeRefundPath added in v0.3.11

func (s *Service) SettleVHTLCWithCollaborativeRefundPath(
	ctx context.Context, vhtlcId, intentProof, intentMessage, partialForfeitTx string,
) (string, error)

SettleVHTLCWithCollaborativeRefundPath settles a VHTLC via delegate refund path. The counterparty creates the intent and partial forfeit, and Fulmine acts as delegate to complete the batch session.

func (*Service) SettleVHTLCWithRefundPath added in v0.3.11

func (s *Service) SettleVHTLCWithRefundPath(ctx context.Context, vhtlcId string) (string, error)

SettleVHTLCWithRefundPath settles a VHTLC via refund path in a batch session.

func (*Service) Setup

func (s *Service) Setup(ctx context.Context, serverUrl, password, privateKey string) (err error)

func (*Service) SetupFromMnemonic

func (s *Service) SetupFromMnemonic(
	ctx context.Context, serverUrl, password, mnemonic string,
) error

func (*Service) SubscribeForAddresses

func (s *Service) SubscribeForAddresses(ctx context.Context, addresses []string) error

func (*Service) UnlockNode

func (s *Service) UnlockNode(ctx context.Context, password string) error

func (*Service) UnsubscribeForAddresses

func (s *Service) UnsubscribeForAddresses(ctx context.Context, addresses []string) error

func (*Service) UpdateSettings

func (s *Service) UpdateSettings(ctx context.Context, settings domain.Settings) error

func (*Service) WhenNextSettlement added in v0.1.8

func (s *Service) WhenNextSettlement(ctx context.Context) time.Time

type SwapResponse added in v0.3.0

type SwapResponse struct {
	TxId       string
	SwapStatus domain.SwapStatus
	Invoice    string
}

type WalletUpdate added in v0.1.12

type WalletUpdate struct {
	Type     string
	Password string
}

Jump to

Keyboard shortcuts

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