Documentation
¶
Index ¶
- func GetVhtlcId(preimageHash, sender, receiver []byte) string
- type ConnectionType
- type DelegateRepository
- type DelegateTask
- type DelegateTaskStatus
- type Intent
- type LnConnectionOpts
- type PendingDelegateTask
- type Settings
- type SettingsRepository
- type SubscribedScriptRepository
- type Swap
- type SwapRepository
- type SwapStatus
- type SwapType
- type VHTLCRepository
- type Vhtlc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetVhtlcId ¶ added in v0.3.0
Types ¶
type ConnectionType ¶ added in v0.3.0
type ConnectionType int
const ( CLN_CONNECTION ConnectionType = iota LND_CONNECTION )
type DelegateRepository ¶ added in v0.3.14
type DelegateRepository interface {
Add(ctx context.Context, task DelegateTask) error
GetByID(ctx context.Context, id string) (*DelegateTask, error)
// return status == pending tasks
GetAllPending(ctx context.Context) ([]PendingDelegateTask, error)
GetAll(ctx context.Context, status DelegateTaskStatus, limit int, offset int) ([]DelegateTask, error)
GetPendingTaskByIntentTxID(ctx context.Context, txid string) (*PendingDelegateTask, error)
// return pending tasks that have any of the given inputs
GetPendingTaskIDsByInputs(ctx context.Context, inputs []wire.OutPoint) ([]string, error)
CancelTasks(ctx context.Context, ids ...string) error
CompleteTasks(ctx context.Context, commitmentTxid string, ids ...string) error
FailTasks(ctx context.Context, reason string, ids ...string) error
Close()
}
type DelegateTask ¶ added in v0.3.14
type DelegateTask struct {
ID string
Intent Intent
ForfeitTxs map[wire.OutPoint]string // forfeit transaction per input
Fee uint64
DelegatorPublicKey string
ScheduledAt time.Time
Status DelegateTaskStatus
FailReason string // set only when task is failed
CommitmentTxid string // set only when task is completed
}
type DelegateTaskStatus ¶ added in v0.3.14
type DelegateTaskStatus int
const ( DelegateTaskStatusPending DelegateTaskStatus = iota DelegateTaskStatusCompleted DelegateTaskStatusFailed DelegateTaskStatusCancelled )
func DelegateTaskStatusFromString ¶ added in v0.3.14
func DelegateTaskStatusFromString(s string) (DelegateTaskStatus, error)
DelegateTaskStatusFromString parses string to DelegateTaskStatus
func (DelegateTaskStatus) String ¶ added in v0.3.14
func (s DelegateTaskStatus) String() string
String returns the string representation of the status
type LnConnectionOpts ¶ added in v0.3.0
type LnConnectionOpts struct {
LnDatadir string
LnUrl string
ConnectionType ConnectionType
}
type PendingDelegateTask ¶ added in v0.3.14
type SettingsRepository ¶
type SettingsRepository interface {
AddDefaultSettings(ctx context.Context) error
AddSettings(ctx context.Context, settings Settings) error
GetSettings(ctx context.Context) (*Settings, error)
CleanSettings(ctx context.Context) error
UpdateSettings(ctx context.Context, settings Settings) error
Close()
}
type SubscribedScriptRepository ¶ added in v0.1.13
type Swap ¶ added in v0.1.12
type Swap struct {
Id string
Amount uint64
Timestamp int64
To boltz.Currency
From boltz.Currency
Status SwapStatus
Type SwapType
Invoice string
Vhtlc Vhtlc
FundingTxId string // the txid of the virtual tx that funded the vhtlc
RedeemTxId string // the txid of the virtual tx that redeemed the funds, by either "claiming" or "refunding"
}
type SwapRepository ¶ added in v0.1.12
type SwapRepository interface {
GetAll(ctx context.Context) ([]Swap, error)
Get(ctx context.Context, swapId string) (*Swap, error)
Add(ctx context.Context, swaps []Swap) (int, error)
Update(ctx context.Context, swap Swap) error
Close()
}
SwapRepository stores the Swap initiated by the wallet
type SwapStatus ¶ added in v0.1.12
type SwapStatus int
const ( SwapPending SwapStatus = iota SwapFailed SwapSuccess )
Click to show internal directories.
Click to hide internal directories.