Documentation
¶
Index ¶
- Constants
- func NewAPI(svc service.Service, gormDB *gorm.DB, config config.Config, keys keys.Keys, ...) *api
- type API
- type App
- type AutoUnlockRequest
- type BackupReminderRequest
- type BalancesResponse
- type BasicBackupRequest
- type BasicRestoreWailsRequest
- type Boostagram
- type ChangeUnlockPasswordRequest
- type Channel
- type CloseChannelResponse
- type ConnectPeerRequest
- type CreateAppRequest
- type CreateAppResponse
- type CreateLightningAddressRequest
- type CustomNodeCommandArgDef
- type CustomNodeCommandDef
- type CustomNodeCommandsResponse
- type EnableAutoSwapRequest
- type ExecuteCustomNodeCommandRequest
- type GetAutoSwapConfigResponse
- type GetForwardsResponse
- type GetLogOutputRequest
- type GetLogOutputResponse
- type HealthAlarm
- type HealthAlarmKind
- type HealthResponse
- type InfoResponse
- type InfoResponseRelay
- type InitiateSwapRequest
- type LSPOrderRequest
- type LSPOrderResponse
- type ListAppsFilters
- type ListAppsResponse
- type ListSwapsResponse
- type ListTransactionsResponse
- type LookupInvoiceResponse
- type LookupSwapResponse
- type MakeInvoiceRequest
- type MakeInvoiceResponse
- type MakeOfferRequest
- type Metadata
- type MigrateNodeStorageRequest
- type MnemonicRequest
- type MnemonicResponse
- type NetworkGraphResponse
- type OnchainBalanceResponse
- type OpenChannelRequest
- type OpenChannelResponse
- type PayInvoiceRequest
- type RebalanceChannelRequest
- type RebalanceChannelResponse
- type RedeemOnchainFundsRequest
- type RedeemOnchainFundsResponse
- type RefundSwapRequest
- type ResetRouterRequest
- type SendEventRequest
- type SendPaymentProbesRequest
- type SendPaymentProbesResponse
- type SendPaymentResponse
- type SendSpontaneousPaymentProbesRequest
- type SendSpontaneousPaymentProbesResponse
- type SetNodeAliasRequest
- type SetupRequest
- type SignMessageRequest
- type SignMessageResponse
- type StartRequest
- type Swap
- type SwapInfoResponse
- type Transaction
- type TransferRequest
- type UnlockRequest
- type UpdateAppRequest
- type UpdateChannelRequest
- type UpdateSettingsRequest
- type User
- type WalletCapabilitiesResponse
Constants ¶
View Source
const ( LogTypeNode = "node" LogTypeApp = "app" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type API ¶
type API interface {
CreateApp(createAppRequest *CreateAppRequest) (*CreateAppResponse, error)
UpdateApp(app *db.App, updateAppRequest *UpdateAppRequest) error
Transfer(ctx context.Context, fromAppId *uint, toAppId *uint, amountMsat uint64) error
DeleteApp(app *db.App) error
GetApp(app *db.App) *App
ListApps(limit uint64, offset uint64, filters ListAppsFilters, orderBy string) (*ListAppsResponse, error)
CreateLightningAddress(ctx context.Context, createLightningAddressRequest *CreateLightningAddressRequest) error
DeleteLightningAddress(ctx context.Context, appId uint) error
ListChannels(ctx context.Context) ([]Channel, error)
GetChannelPeerSuggestions(ctx context.Context) ([]alby.ChannelPeerSuggestion, error)
GetLSPChannelOffer(ctx context.Context) (*alby.LSPChannelOffer, error)
ResetRouter(key string) error
ChangeUnlockPassword(changeUnlockPasswordRequest *ChangeUnlockPasswordRequest) error
SetAutoUnlockPassword(unlockPassword string) error
Stop() error
GetNodeConnectionInfo(ctx context.Context) (*lnclient.NodeConnectionInfo, error)
GetNodeStatus(ctx context.Context) (*lnclient.NodeStatus, error)
ListPeers(ctx context.Context) ([]lnclient.PeerDetails, error)
ConnectPeer(ctx context.Context, connectPeerRequest *ConnectPeerRequest) error
DisconnectPeer(ctx context.Context, peerId string) error
OpenChannel(ctx context.Context, openChannelRequest *OpenChannelRequest) (*OpenChannelResponse, error)
RebalanceChannel(ctx context.Context, rebalanceChannelRequest *RebalanceChannelRequest) (*RebalanceChannelResponse, error)
CloseChannel(ctx context.Context, peerId, channelId string, force bool) (*CloseChannelResponse, error)
UpdateChannel(ctx context.Context, updateChannelRequest *UpdateChannelRequest) error
MakeOffer(ctx context.Context, description string) (string, error)
GetNewOnchainAddress(ctx context.Context) (string, error)
GetUnusedOnchainAddress(ctx context.Context) (string, error)
SignMessage(ctx context.Context, message string) (*SignMessageResponse, error)
RedeemOnchainFunds(ctx context.Context, toAddress string, amount uint64, feeRate *uint64, sendAll bool) (*RedeemOnchainFundsResponse, error)
GetBalances(ctx context.Context) (*BalancesResponse, error)
ListTransactions(ctx context.Context, appId *uint, limit uint64, offset uint64) (*ListTransactionsResponse, error)
ListOnchainTransactions(ctx context.Context) ([]lnclient.OnchainTransaction, error)
SendPayment(ctx context.Context, invoice string, amountMsat *uint64, metadata map[string]interface{}) (*SendPaymentResponse, error)
CreateInvoice(ctx context.Context, amount uint64, description string) (*MakeInvoiceResponse, error)
LookupInvoice(ctx context.Context, paymentHash string) (*LookupInvoiceResponse, error)
RequestMempoolApi(ctx context.Context, endpoint string) (interface{}, error)
GetInfo(ctx context.Context) (*InfoResponse, error)
GetMnemonic(unlockPassword string) (*MnemonicResponse, error)
SetNextBackupReminder(backupReminderRequest *BackupReminderRequest) error
Start(startRequest *StartRequest)
Setup(ctx context.Context, setupRequest *SetupRequest) error
SendPaymentProbes(ctx context.Context, sendPaymentProbesRequest *SendPaymentProbesRequest) (*SendPaymentProbesResponse, error)
SendSpontaneousPaymentProbes(ctx context.Context, sendSpontaneousPaymentProbesRequest *SendSpontaneousPaymentProbesRequest) (*SendSpontaneousPaymentProbesResponse, error)
GetNetworkGraph(ctx context.Context, nodeIds []string) (NetworkGraphResponse, error)
SyncWallet() error
GetLogOutput(ctx context.Context, logType string, getLogRequest *GetLogOutputRequest) (*GetLogOutputResponse, error)
RequestLSPOrder(ctx context.Context, request *LSPOrderRequest) (*LSPOrderResponse, error)
CreateBackup(unlockPassword string, w io.Writer) error
RestoreBackup(unlockPassword string, r io.Reader) error
MigrateNodeStorage(ctx context.Context, to string) error
GetWalletCapabilities(ctx context.Context) (*WalletCapabilitiesResponse, error)
Health(ctx context.Context) (*HealthResponse, error)
SetCurrency(currency string) error
SetBitcoinDisplayFormat(format string) error
UpdateSettings(updateSettingsRequest *UpdateSettingsRequest) error
LookupSwap(swapId string) (*LookupSwapResponse, error)
ListSwaps() (*ListSwapsResponse, error)
GetSwapInInfo() (*SwapInfoResponse, error)
GetSwapOutInfo() (*SwapInfoResponse, error)
InitiateSwapIn(ctx context.Context, initiateSwapInRequest *InitiateSwapRequest) (*swaps.SwapResponse, error)
InitiateSwapOut(ctx context.Context, initiateSwapOutRequest *InitiateSwapRequest) (*swaps.SwapResponse, error)
RefundSwap(refundSwapRequest *RefundSwapRequest) error
GetSwapMnemonic() string
GetAutoSwapConfig() (*GetAutoSwapConfigResponse, error)
EnableAutoSwapOut(ctx context.Context, autoSwapRequest *EnableAutoSwapRequest) error
DisableAutoSwap() error
SetNodeAlias(nodeAlias string) error
GetCustomNodeCommands() (*CustomNodeCommandsResponse, error)
ExecuteCustomNodeCommand(ctx context.Context, command string) (interface{}, error)
SendEvent(event string, properties interface{})
GetForwards() (*GetForwardsResponse, error)
}
type App ¶
type App struct {
ID uint `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
AppPubkey string `json:"appPubkey"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
LastUsedAt *time.Time `json:"lastUsedAt"`
ExpiresAt *time.Time `json:"expiresAt"`
Scopes []string `json:"scopes"`
MaxAmountSat uint64 `json:"maxAmount"`
BudgetUsage uint64 `json:"budgetUsage"`
BudgetRenewal string `json:"budgetRenewal"`
Isolated bool `json:"isolated"`
WalletPubkey string `json:"walletPubkey"`
UniqueWalletPubkey bool `json:"uniqueWalletPubkey"`
Balance int64 `json:"balance"`
Metadata Metadata `json:"metadata,omitempty"`
}
type AutoUnlockRequest ¶ added in v1.13.0
type AutoUnlockRequest struct {
UnlockPassword string `json:"unlockPassword"`
}
type BackupReminderRequest ¶
type BackupReminderRequest struct {
NextBackupReminder string `json:"nextBackupReminder"`
}
type BalancesResponse ¶
type BalancesResponse = lnclient.BalancesResponse
type BasicBackupRequest ¶
type BasicBackupRequest struct {
UnlockPassword string `json:"unlockPassword"`
}
type BasicRestoreWailsRequest ¶
type BasicRestoreWailsRequest struct {
UnlockPassword string `json:"unlockPassword"`
}
type Boostagram ¶ added in v1.5.0
type Boostagram struct {
AppName string `json:"appName"`
Name string `json:"name"`
Podcast string `json:"podcast"`
URL string `json:"url"`
Episode string `json:"episode,omitempty"`
FeedId string `json:"feedId,omitempty"`
ItemId string `json:"itemId,omitempty"`
Timestamp int64 `json:"ts,omitempty"`
Message string `json:"message,omitempty"`
SenderId string `json:"senderId"`
SenderName string `json:"senderName"`
Time string `json:"time"`
Action string `json:"action"`
ValueMsatTotal int64 `json:"valueMsatTotal"`
}
type Channel ¶ added in v1.4.0
type Channel struct {
LocalBalance int64 `json:"localBalance"`
LocalSpendableBalance int64 `json:"localSpendableBalance"`
RemoteBalance int64 `json:"remoteBalance"`
Id string `json:"id"`
RemotePubkey string `json:"remotePubkey"`
FundingTxId string `json:"fundingTxId"`
FundingTxVout uint32 `json:"fundingTxVout"`
Active bool `json:"active"`
Public bool `json:"public"`
InternalChannel interface{} `json:"internalChannel"`
Confirmations *uint32 `json:"confirmations"`
ConfirmationsRequired *uint32 `json:"confirmationsRequired"`
ForwardingFeeBaseMsat uint32 `json:"forwardingFeeBaseMsat"`
ForwardingFeeProportionalMillionths uint32 `json:"forwardingFeeProportionalMillionths"`
UnspendablePunishmentReserve uint64 `json:"unspendablePunishmentReserve"`
CounterpartyUnspendablePunishmentReserve uint64 `json:"counterpartyUnspendablePunishmentReserve"`
Error *string `json:"error"`
Status string `json:"status"`
IsOutbound bool `json:"isOutbound"`
}
type CloseChannelResponse ¶
type CloseChannelResponse = lnclient.CloseChannelResponse
type ConnectPeerRequest ¶
type ConnectPeerRequest = lnclient.ConnectPeerRequest
type CreateAppRequest ¶
type CreateAppRequest struct {
Name string `json:"name"`
Pubkey string `json:"pubkey"`
MaxAmountSat uint64 `json:"maxAmount"`
BudgetRenewal string `json:"budgetRenewal"`
ExpiresAt string `json:"expiresAt"`
Scopes []string `json:"scopes"`
ReturnTo string `json:"returnTo"`
Isolated bool `json:"isolated"`
Metadata Metadata `json:"metadata,omitempty"`
UnlockPassword string `json:"unlockPassword"`
}
type CreateAppResponse ¶
type CreateAppResponse struct {
PairingUri string `json:"pairingUri"`
PairingSecret string `json:"pairingSecretKey"`
Pubkey string `json:"pairingPublicKey"`
RelayUrls []string `json:"relayUrls"`
WalletPubkey string `json:"walletPubkey"`
Lud16 string `json:"lud16"`
Id uint `json:"id"`
Name string `json:"name"`
ReturnTo string `json:"returnTo"`
}
type CreateLightningAddressRequest ¶ added in v1.18.0
type CustomNodeCommandArgDef ¶ added in v1.14.0
type CustomNodeCommandDef ¶ added in v1.14.0
type CustomNodeCommandDef struct {
Name string `json:"name"`
Description string `json:"description"`
Args []CustomNodeCommandArgDef `json:"args"`
}
type CustomNodeCommandsResponse ¶ added in v1.14.0
type CustomNodeCommandsResponse struct {
Commands []CustomNodeCommandDef `json:"commands"`
}
type EnableAutoSwapRequest ¶ added in v1.18.0
type ExecuteCustomNodeCommandRequest ¶ added in v1.14.0
type ExecuteCustomNodeCommandRequest struct {
Command string `json:"command"`
}
type GetAutoSwapConfigResponse ¶ added in v1.18.0
type GetForwardsResponse ¶ added in v1.19.0
type GetLogOutputRequest ¶
type GetLogOutputRequest struct {
MaxLen int `query:"maxLen"`
}
type GetLogOutputResponse ¶
type GetLogOutputResponse struct {
Log string `json:"logs"`
}
type HealthAlarm ¶ added in v1.14.0
type HealthAlarm struct {
Kind HealthAlarmKind `json:"kind"`
RawDetails any `json:"rawDetails,omitempty"`
}
func NewHealthAlarm ¶ added in v1.14.0
func NewHealthAlarm(kind HealthAlarmKind, rawDetails any) HealthAlarm
type HealthAlarmKind ¶ added in v1.14.0
type HealthAlarmKind string
const ( HealthAlarmKindAlbyService HealthAlarmKind = "alby_service" HealthAlarmKindNodeNotReady HealthAlarmKind = "node_not_ready" HealthAlarmKindChannelsOffline HealthAlarmKind = "channels_offline" HealthAlarmKindNostrRelayOffline HealthAlarmKind = "nostr_relay_offline" HealthAlarmKindVssNoSubscription HealthAlarmKind = "vss_no_subscription" )
type HealthResponse ¶ added in v1.14.0
type HealthResponse struct {
Alarms []HealthAlarm `json:"alarms,omitempty"`
}
type InfoResponse ¶
type InfoResponse struct {
BackendType string `json:"backendType"`
SetupCompleted bool `json:"setupCompleted"`
OAuthRedirect bool `json:"oauthRedirect"`
Running bool `json:"running"`
Unlocked bool `json:"unlocked"`
AlbyAuthUrl string `json:"albyAuthUrl"`
NextBackupReminder string `json:"nextBackupReminder"`
AlbyUserIdentifier string `json:"albyUserIdentifier"`
AlbyAccountConnected bool `json:"albyAccountConnected"`
Version string `json:"version"`
Network string `json:"network"`
EnableAdvancedSetup bool `json:"enableAdvancedSetup"`
LdkVssEnabled bool `json:"ldkVssEnabled"`
VssSupported bool `json:"vssSupported"`
StartupState string `json:"startupState"`
StartupError string `json:"startupError"`
StartupErrorTime time.Time `json:"startupErrorTime"`
AutoUnlockPasswordSupported bool `json:"autoUnlockPasswordSupported"`
AutoUnlockPasswordEnabled bool `json:"autoUnlockPasswordEnabled"`
Currency string `json:"currency"`
BitcoinDisplayFormat string `json:"bitcoinDisplayFormat"`
Relays []InfoResponseRelay `json:"relays"`
NodeAlias string `json:"nodeAlias"`
MempoolUrl string `json:"mempoolUrl"`
}
type InfoResponseRelay ¶ added in v1.21.0
type InitiateSwapRequest ¶ added in v1.18.0
type LSPOrderRequest ¶ added in v1.3.0
type LSPOrderResponse ¶ added in v1.3.0
type ListAppsFilters ¶ added in v1.18.5
type ListAppsResponse ¶
type ListSwapsResponse ¶ added in v1.18.0
type ListSwapsResponse struct {
Swaps []Swap `json:"swaps"`
}
type ListTransactionsResponse ¶
type ListTransactionsResponse struct {
TotalCount uint64 `json:"totalCount"`
Transactions []Transaction `json:"transactions"`
}
type LookupInvoiceResponse ¶
type LookupInvoiceResponse = Transaction
type LookupSwapResponse ¶ added in v1.18.0
type LookupSwapResponse = Swap
type MakeInvoiceRequest ¶
type MakeInvoiceResponse ¶
type MakeInvoiceResponse = Transaction
type MakeOfferRequest ¶ added in v1.18.0
type MakeOfferRequest struct {
Description string `json:"description"`
}
type MigrateNodeStorageRequest ¶ added in v1.12.0
type MigrateNodeStorageRequest struct {
To string `json:"to"`
}
type MnemonicRequest ¶ added in v1.5.0
type MnemonicRequest struct {
UnlockPassword string `json:"unlockPassword"`
}
type MnemonicResponse ¶ added in v1.5.0
type MnemonicResponse struct {
Mnemonic string `json:"mnemonic"`
}
type NetworkGraphResponse ¶
type NetworkGraphResponse = lnclient.NetworkGraphResponse
type OnchainBalanceResponse ¶
type OnchainBalanceResponse = lnclient.OnchainBalanceResponse
type OpenChannelRequest ¶
type OpenChannelRequest = lnclient.OpenChannelRequest
type OpenChannelResponse ¶
type OpenChannelResponse = lnclient.OpenChannelResponse
type PayInvoiceRequest ¶ added in v1.12.0
type RebalanceChannelRequest ¶ added in v1.18.0
type RebalanceChannelResponse ¶ added in v1.18.0
type RebalanceChannelResponse struct {
TotalFeeSat uint64 `json:"totalFeeSat"`
}
type RedeemOnchainFundsResponse ¶
type RedeemOnchainFundsResponse struct {
TxId string `json:"txId"`
}
type RefundSwapRequest ¶ added in v1.18.0
type ResetRouterRequest ¶
type ResetRouterRequest struct {
Key string `json:"key"`
}
type SendEventRequest ¶ added in v1.18.0
type SendEventRequest struct {
Event string `json:"event"`
Properties interface{} `json:"properties"`
}
type SendPaymentProbesRequest ¶
type SendPaymentProbesRequest struct {
Invoice string `json:"invoice"`
}
debug api
type SendPaymentProbesResponse ¶
type SendPaymentProbesResponse struct {
Error string `json:"error"`
}
type SendPaymentResponse ¶
type SendPaymentResponse = Transaction
type SendSpontaneousPaymentProbesResponse ¶
type SendSpontaneousPaymentProbesResponse struct {
Error string `json:"error"`
}
type SetNodeAliasRequest ¶ added in v1.18.0
type SetNodeAliasRequest struct {
NodeAlias string `json:"nodeAlias"`
}
type SetupRequest ¶
type SetupRequest struct {
LNBackendType string `json:"backendType"`
UnlockPassword string `json:"unlockPassword"`
Mnemonic string `json:"mnemonic"`
NextBackupReminder string `json:"nextBackupReminder"`
// LND fields
LNDAddress string `json:"lndAddress"`
LNDCertFile string `json:"lndCertFile"`
LNDMacaroonFile string `json:"lndMacaroonFile"`
LNDCertHex string `json:"lndCertHex"`
LNDMacaroonHex string `json:"lndMacaroonHex"`
// Phoenixd fields
PhoenixdAddress string `json:"phoenixdAddress"`
PhoenixdAuthorization string `json:"phoenixdAuthorization"`
// Cashu fields
CashuMintUrl string `json:"cashuMintUrl"`
}
type SignMessageRequest ¶
type SignMessageRequest struct {
Message string `json:"message"`
}
type SignMessageResponse ¶
type StartRequest ¶
type StartRequest struct {
UnlockPassword string `json:"unlockPassword"`
}
type Swap ¶ added in v1.18.0
type Swap struct {
Id string `json:"id"`
Type string `json:"type"`
State string `json:"state"`
Invoice string `json:"invoice"`
SendAmount uint64 `json:"sendAmount"`
ReceiveAmount uint64 `json:"receiveAmount"`
PaymentHash string `json:"paymentHash"`
DestinationAddress string `json:"destinationAddress"`
RefundAddress string `json:"refundAddress"`
LockupAddress string `json:"lockupAddress"`
LockupTxId string `json:"lockupTxId"`
ClaimTxId string `json:"claimTxId"`
AutoSwap bool `json:"autoSwap"`
BoltzPubkey string `json:"boltzPubkey"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
UsedXpub bool `json:"usedXpub"`
}
type SwapInfoResponse ¶ added in v1.19.0
type Transaction ¶ added in v1.2.0
type Transaction struct {
Type string `json:"type"`
State string `json:"state"`
Invoice string `json:"invoice"`
Description string `json:"description"`
DescriptionHash string `json:"descriptionHash"`
Preimage *string `json:"preimage"`
PaymentHash string `json:"paymentHash"`
Amount uint64 `json:"amount"`
FeesPaid uint64 `json:"feesPaid"`
UpdatedAt string `json:"updatedAt"`
CreatedAt string `json:"createdAt"`
SettledAt *string `json:"settledAt"`
AppId *uint `json:"appId"`
Metadata Metadata `json:"metadata,omitempty"`
Boostagram *Boostagram `json:"boostagram,omitempty"`
FailureReason string `json:"failureReason"`
}
TODO: camelCase
type TransferRequest ¶ added in v1.19.0
type UnlockRequest ¶
type UpdateAppRequest ¶
type UpdateAppRequest struct {
Name *string `json:"name"`
MaxAmountSat *uint64 `json:"maxAmount"`
BudgetRenewal *string `json:"budgetRenewal"`
ExpiresAt *string `json:"expiresAt"`
UpdateExpiresAt bool `json:"updateExpiresAt"`
Scopes []string `json:"scopes"`
Metadata *Metadata `json:"metadata"`
Isolated *bool `json:"isolated"`
}
type UpdateChannelRequest ¶
type UpdateChannelRequest = lnclient.UpdateChannelRequest
type UpdateSettingsRequest ¶ added in v1.14.0
Click to show internal directories.
Click to hide internal directories.