application

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2025 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

This section is empty.

Types

type BuildInfo

type BuildInfo struct {
	Version string
	Commit  string
	Date    string
}

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 NewService

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

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) (string, string, string, string, string, error)

func (*Service) GetBalanceLN

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

func (*Service) GetDelegatePublicKey

func (s *Service) GetDelegatePublicKey(ctx context.Context) (string, 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) 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) GetVHTLC

func (s *Service) GetVHTLC(
	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, *vhtlc.Opts, 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) 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) ListWatchedAddresses

func (s *Service) ListWatchedAddresses(ctx context.Context) ([]domain.VtxoRolloverTarget, 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) 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) UnwatchAddress

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

func (*Service) UpdateSettings

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

func (*Service) WatchAddressForRollover

func (s *Service) WatchAddressForRollover(
	ctx context.Context, address, destinationAddress string, taprootTree []string,
) 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