Documentation
¶
Index ¶
- Constants
- Variables
- func NewServices(buildInfo BuildInfo, storeCfg store.Config, storeSvc types.Store, ...) (*Service, *DelegatorService, error)
- type BuildInfo
- type DelegateInfo
- type DelegatorConfig
- type DelegatorService
- type Notification
- type Service
- func (s *Service) AddDefaultSettings(ctx context.Context) error
- func (s *Service) ClaimVHTLC(ctx context.Context, preimage []byte, vhtlc_id string) (string, error)
- func (s *Service) ConnectLN(ctx context.Context, lnUrl string) error
- func (s *Service) DisconnectLN()
- func (s *Service) GetAddress(ctx context.Context, sats uint64) (bip21Addr, offchainAddr, boardingAddr, invoice, pubkey string, err error)
- func (s *Service) GetBalanceLN(ctx context.Context) (balance uint64, err error)
- func (s *Service) GetDelegateTaskByID(ctx context.Context, id string) (*domain.DelegateTask, error)
- func (s *Service) GetDelegateTasks(ctx context.Context, status domain.DelegateTaskStatus, limit int, offset int) ([]domain.DelegateTask, error)
- func (s *Service) GetInvoice(ctx context.Context, amount uint64) (*SwapResponse, error)
- func (s *Service) GetLnConnectUrl() string
- func (s *Service) GetRound(ctx context.Context, roundId string) (*indexer.CommitmentTx, error)
- func (s *Service) GetSettings(ctx context.Context) (*domain.Settings, error)
- func (s *Service) GetSwapHistory(ctx context.Context) ([]domain.Swap, error)
- func (s *Service) GetSwapVHTLC(ctx context.Context, receiverPubkey, senderPubkey *btcec.PublicKey, ...) (string, string, *vhtlc.VHTLCScript, error)
- func (s *Service) GetSyncedUpdate() <-chan types.SyncEvent
- func (s *Service) GetTotalBalance(ctx context.Context) (uint64, error)
- func (s *Service) GetVirtualTxs(ctx context.Context, txids []string) ([]string, error)
- func (s *Service) GetVtxoNotifications(ctx context.Context) <-chan Notification
- func (s *Service) GetVtxos(ctx context.Context, filterType string) ([]types.Vtxo, error)
- func (s *Service) GetWalletUpdates() <-chan WalletUpdate
- func (s *Service) IncreaseInboundCapacity(ctx context.Context, amount uint64) (string, error)
- func (s *Service) IncreaseOutboundCapacity(ctx context.Context, amount uint64) (SwapResponse, error)
- func (s *Service) IsConnectedLN() bool
- func (s *Service) IsInitialized() bool
- func (s *Service) IsInvoiceSettled(ctx context.Context, invoice string) (bool, error)
- func (s *Service) IsLocked(ctx context.Context) bool
- func (s *Service) IsPreConfiguredLN() bool
- func (s *Service) IsSynced() (bool, error)
- func (s *Service) ListVHTLC(ctx context.Context, vhtlc_id string) ([]types.Vtxo, []domain.Vhtlc, error)
- func (s *Service) LockNode(ctx context.Context) error
- func (s *Service) NewSettings(ctx context.Context, settings domain.Settings) error
- func (s *Service) PayInvoice(ctx context.Context, invoice string) (*SwapResponse, error)
- func (s *Service) PayOffer(ctx context.Context, offer string) (*SwapResponse, error)
- func (s *Service) RefundVHTLC(ctx context.Context, swapId, vhtlc_id string, withReceiver bool) (string, error)
- func (s *Service) ResetWallet(ctx context.Context) error
- func (s *Service) SendOnChain(ctx context.Context, addr string, amount uint64) (string, error)
- func (s *Service) Settle(ctx context.Context) (string, error)
- func (s *Service) SettleVHTLCWithClaimPath(ctx context.Context, vhtlcId string, preimage []byte) (string, error)
- func (s *Service) SettleVHTLCWithCollaborativeRefundPath(ctx context.Context, ...) (string, error)
- func (s *Service) SettleVHTLCWithRefundPath(ctx context.Context, vhtlcId string) (string, error)
- func (s *Service) Setup(ctx context.Context, serverUrl, password, privateKey string) (err error)
- func (s *Service) SetupFromMnemonic(ctx context.Context, serverUrl, password, mnemonic string) error
- func (s *Service) SubscribeForAddresses(ctx context.Context, addresses []string) error
- func (s *Service) UnlockNode(ctx context.Context, password string) error
- func (s *Service) UnsubscribeForAddresses(ctx context.Context, addresses []string) error
- func (s *Service) UpdateSettings(ctx context.Context, settings domain.Settings) error
- func (s *Service) WhenNextSettlement(ctx context.Context) time.Time
- type SwapResponse
- type WalletUpdate
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 DelegateInfo ¶ added in v0.3.14
type DelegatorConfig ¶ added in v0.3.14
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 Service ¶
type Service struct {
BuildInfo BuildInfo
arksdk.ArkClient
// contains filtered or unexported fields
}
func (*Service) AddDefaultSettings ¶
func (*Service) ClaimVHTLC ¶
func (*Service) DisconnectLN ¶
func (s *Service) DisconnectLN()
func (*Service) GetAddress ¶
func (*Service) GetBalanceLN ¶
func (*Service) GetDelegateTaskByID ¶ added in v0.3.14
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 (*Service) GetLnConnectUrl ¶ added in v0.3.0
func (*Service) GetSettings ¶
func (*Service) GetSwapHistory ¶ added in v0.1.12
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 (*Service) GetTotalBalance ¶
func (*Service) GetVirtualTxs ¶ added in v0.3.0
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 ¶
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 (*Service) IsInitialized ¶ added in v0.3.0
func (*Service) IsInvoiceSettled ¶
func (*Service) IsPreConfiguredLN ¶ added in v0.3.0
func (*Service) NewSettings ¶
func (*Service) PayInvoice ¶
func (*Service) RefundVHTLC ¶ added in v0.1.4
func (*Service) ResetWallet ¶ added in v0.1.8
func (*Service) SendOnChain ¶ added in v0.3.0
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
SettleVHTLCWithRefundPath settles a VHTLC via refund path in a batch session.
func (*Service) SetupFromMnemonic ¶
func (*Service) SubscribeForAddresses ¶
func (*Service) UnlockNode ¶
func (*Service) UnsubscribeForAddresses ¶
func (*Service) UpdateSettings ¶
type SwapResponse ¶ added in v0.3.0
type SwapResponse struct {
TxId string
SwapStatus domain.SwapStatus
Invoice string
}
type WalletUpdate ¶ added in v0.1.12
Click to show internal directories.
Click to hide internal directories.