2023-12-27 13:24:35 +07:00
|
|
|
package api
|
|
|
|
|
|
2024-02-10 22:28:58 +07:00
|
|
|
import (
|
2024-05-30 00:06:06 +07:00
|
|
|
"context"
|
2024-06-17 19:42:09 +07:00
|
|
|
"io"
|
2024-02-10 22:28:58 +07:00
|
|
|
"time"
|
|
|
|
|
|
2024-07-05 20:32:40 +07:00
|
|
|
"github.com/getAlby/hub/alby"
|
|
|
|
|
"github.com/getAlby/hub/db"
|
|
|
|
|
"github.com/getAlby/hub/lnclient"
|
2024-02-10 22:28:58 +07:00
|
|
|
)
|
2023-12-27 13:24:35 +07:00
|
|
|
|
2024-04-12 15:40:48 +07:00
|
|
|
type API interface {
|
|
|
|
|
CreateApp(createAppRequest *CreateAppRequest) (*CreateAppResponse, error)
|
2024-10-28 13:29:34 +07:00
|
|
|
UpdateApp(app *db.App, updateAppRequest *UpdateAppRequest) error
|
|
|
|
|
TopupIsolatedApp(ctx context.Context, app *db.App, amountMsat uint64) error
|
|
|
|
|
DeleteApp(app *db.App) error
|
|
|
|
|
GetApp(app *db.App) *App
|
2024-05-30 00:06:06 +07:00
|
|
|
ListApps() ([]App, error)
|
2024-07-31 09:10:26 +02:00
|
|
|
ListChannels(ctx context.Context) ([]Channel, error)
|
2024-05-30 00:06:06 +07:00
|
|
|
GetChannelPeerSuggestions(ctx context.Context) ([]alby.ChannelPeerSuggestion, error)
|
|
|
|
|
ResetRouter(key string) error
|
|
|
|
|
ChangeUnlockPassword(changeUnlockPasswordRequest *ChangeUnlockPasswordRequest) error
|
2025-01-07 20:08:10 +07:00
|
|
|
SetAutoUnlockPassword(unlockPassword string) error
|
2024-05-30 00:06:06 +07:00
|
|
|
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
|
2024-05-30 23:04:32 +07:00
|
|
|
DisconnectPeer(ctx context.Context, peerId string) error
|
2024-05-30 00:06:06 +07:00
|
|
|
OpenChannel(ctx context.Context, openChannelRequest *OpenChannelRequest) (*OpenChannelResponse, error)
|
|
|
|
|
CloseChannel(ctx context.Context, peerId, channelId string, force bool) (*CloseChannelResponse, error)
|
2024-06-18 15:22:19 +07:00
|
|
|
UpdateChannel(ctx context.Context, updateChannelRequest *UpdateChannelRequest) error
|
2024-06-11 06:49:13 +03:00
|
|
|
GetNewOnchainAddress(ctx context.Context) (string, error)
|
|
|
|
|
GetUnusedOnchainAddress(ctx context.Context) (string, error)
|
2024-05-30 00:06:06 +07:00
|
|
|
SignMessage(ctx context.Context, message string) (*SignMessageResponse, error)
|
2024-09-04 11:44:58 +07:00
|
|
|
RedeemOnchainFunds(ctx context.Context, toAddress string, amount uint64, sendAll bool) (*RedeemOnchainFundsResponse, error)
|
2024-05-30 00:06:06 +07:00
|
|
|
GetBalances(ctx context.Context) (*BalancesResponse, error)
|
2024-11-27 14:58:00 -06:00
|
|
|
ListTransactions(ctx context.Context, appId *uint, limit uint64, offset uint64) (*ListTransactionsResponse, error)
|
2024-12-17 11:58:43 +07:00
|
|
|
SendPayment(ctx context.Context, invoice string, amountMsat *uint64) (*SendPaymentResponse, error)
|
2024-10-28 13:29:34 +07:00
|
|
|
CreateInvoice(ctx context.Context, amount uint64, description string) (*MakeInvoiceResponse, error)
|
2024-06-28 10:32:36 +05:30
|
|
|
LookupInvoice(ctx context.Context, paymentHash string) (*LookupInvoiceResponse, error)
|
2024-05-30 00:06:06 +07:00
|
|
|
RequestMempoolApi(endpoint string) (interface{}, error)
|
|
|
|
|
GetInfo(ctx context.Context) (*InfoResponse, error)
|
2024-08-08 11:08:14 +02:00
|
|
|
GetMnemonic(unlockPassword string) (*MnemonicResponse, error)
|
2024-05-30 00:06:06 +07:00
|
|
|
SetNextBackupReminder(backupReminderRequest *BackupReminderRequest) error
|
2024-09-04 10:46:12 +05:30
|
|
|
Start(startRequest *StartRequest)
|
2024-05-30 00:06:06 +07:00
|
|
|
Setup(ctx context.Context, setupRequest *SetupRequest) error
|
|
|
|
|
SendPaymentProbes(ctx context.Context, sendPaymentProbesRequest *SendPaymentProbesRequest) (*SendPaymentProbesResponse, error)
|
|
|
|
|
SendSpontaneousPaymentProbes(ctx context.Context, sendSpontaneousPaymentProbesRequest *SendSpontaneousPaymentProbesRequest) (*SendSpontaneousPaymentProbesResponse, error)
|
2024-08-22 18:29:51 +05:30
|
|
|
GetNetworkGraph(ctx context.Context, nodeIds []string) (NetworkGraphResponse, error)
|
2024-05-30 00:06:06 +07:00
|
|
|
SyncWallet() error
|
|
|
|
|
GetLogOutput(ctx context.Context, logType string, getLogRequest *GetLogOutputRequest) (*GetLogOutputResponse, error)
|
2024-07-25 20:57:16 +07:00
|
|
|
RequestLSPOrder(ctx context.Context, request *LSPOrderRequest) (*LSPOrderResponse, error)
|
2024-06-17 19:42:09 +07:00
|
|
|
CreateBackup(unlockPassword string, w io.Writer) error
|
|
|
|
|
RestoreBackup(unlockPassword string, r io.Reader) error
|
2024-12-16 12:32:35 +07:00
|
|
|
MigrateNodeStorage(ctx context.Context, to string) error
|
2024-07-01 20:30:40 +07:00
|
|
|
GetWalletCapabilities(ctx context.Context) (*WalletCapabilitiesResponse, error)
|
2025-01-17 11:29:20 +03:00
|
|
|
Health(ctx context.Context) (*HealthResponse, error)
|
2025-01-30 14:20:17 +03:00
|
|
|
GetCustomNodeCommands() (*CustomNodeCommandsResponse, error)
|
|
|
|
|
ExecuteCustomNodeCommand(ctx context.Context, command string) (interface{}, error)
|
2024-04-12 15:40:48 +07:00
|
|
|
}
|
|
|
|
|
|
2023-12-27 13:24:35 +07:00
|
|
|
type App struct {
|
2024-07-19 23:30:22 +07:00
|
|
|
ID uint `json:"id"`
|
|
|
|
|
Name string `json:"name"`
|
|
|
|
|
Description string `json:"description"`
|
2024-11-07 13:06:01 +01:00
|
|
|
AppPubkey string `json:"appPubkey"`
|
2024-07-19 23:30:22 +07:00
|
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
|
|
|
UpdatedAt time.Time `json:"updatedAt"`
|
2024-07-01 20:30:40 +07:00
|
|
|
LastEventAt *time.Time `json:"lastEventAt"`
|
|
|
|
|
ExpiresAt *time.Time `json:"expiresAt"`
|
|
|
|
|
Scopes []string `json:"scopes"`
|
2024-07-19 23:30:22 +07:00
|
|
|
MaxAmountSat uint64 `json:"maxAmount"`
|
2024-07-01 20:30:40 +07:00
|
|
|
BudgetUsage uint64 `json:"budgetUsage"`
|
|
|
|
|
BudgetRenewal string `json:"budgetRenewal"`
|
2024-07-19 23:30:22 +07:00
|
|
|
Isolated bool `json:"isolated"`
|
2025-01-06 23:08:09 +07:00
|
|
|
Balance int64 `json:"balance"`
|
2024-09-02 17:40:34 +07:00
|
|
|
Metadata Metadata `json:"metadata,omitempty"`
|
2023-12-27 13:24:35 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type ListAppsResponse struct {
|
|
|
|
|
Apps []App `json:"apps"`
|
|
|
|
|
}
|
|
|
|
|
|
2024-03-11 22:17:02 +05:30
|
|
|
type UpdateAppRequest struct {
|
2024-08-22 23:45:48 +05:30
|
|
|
Name string `json:"name"`
|
2024-07-19 23:30:22 +07:00
|
|
|
MaxAmountSat uint64 `json:"maxAmount"`
|
2024-07-01 20:30:40 +07:00
|
|
|
BudgetRenewal string `json:"budgetRenewal"`
|
|
|
|
|
ExpiresAt string `json:"expiresAt"`
|
|
|
|
|
Scopes []string `json:"scopes"`
|
2024-09-03 21:31:28 +07:00
|
|
|
Metadata Metadata `json:"metadata,omitempty"`
|
2024-11-26 20:30:53 -06:00
|
|
|
Isolated bool `json:"isolated"`
|
2024-03-11 22:17:02 +05:30
|
|
|
}
|
|
|
|
|
|
2024-10-28 13:29:34 +07:00
|
|
|
type TopupIsolatedAppRequest struct {
|
|
|
|
|
AmountSat uint64 `json:"amountSat"`
|
|
|
|
|
}
|
|
|
|
|
|
2024-01-02 15:40:19 +05:30
|
|
|
type CreateAppRequest struct {
|
2024-07-01 20:30:40 +07:00
|
|
|
Name string `json:"name"`
|
|
|
|
|
Pubkey string `json:"pubkey"`
|
2024-07-19 23:30:22 +07:00
|
|
|
MaxAmountSat uint64 `json:"maxAmount"`
|
2024-07-01 20:30:40 +07:00
|
|
|
BudgetRenewal string `json:"budgetRenewal"`
|
|
|
|
|
ExpiresAt string `json:"expiresAt"`
|
|
|
|
|
Scopes []string `json:"scopes"`
|
|
|
|
|
ReturnTo string `json:"returnTo"`
|
2024-07-19 23:30:22 +07:00
|
|
|
Isolated bool `json:"isolated"`
|
2024-09-02 17:40:34 +07:00
|
|
|
Metadata Metadata `json:"metadata,omitempty"`
|
2024-01-02 15:40:19 +05:30
|
|
|
}
|
|
|
|
|
|
2024-01-21 13:08:16 +01:00
|
|
|
type StartRequest struct {
|
2024-01-22 19:48:41 +01:00
|
|
|
UnlockPassword string `json:"unlockPassword"`
|
2024-01-21 13:08:16 +01:00
|
|
|
}
|
|
|
|
|
|
2024-01-30 23:30:39 +07:00
|
|
|
type UnlockRequest struct {
|
2024-08-10 17:04:15 +07:00
|
|
|
UnlockPassword string `json:"unlockPassword"`
|
|
|
|
|
TokenExpiryDays *uint64 `json:"tokenExpiryDays"`
|
2024-01-30 23:30:39 +07:00
|
|
|
}
|
|
|
|
|
|
2024-03-21 12:38:27 +05:30
|
|
|
type BackupReminderRequest struct {
|
|
|
|
|
NextBackupReminder string `json:"nextBackupReminder"`
|
|
|
|
|
}
|
|
|
|
|
|
2024-01-16 16:48:46 +07:00
|
|
|
type SetupRequest struct {
|
2024-06-11 06:49:13 +03:00
|
|
|
LNBackendType string `json:"backendType"`
|
2024-06-04 10:47:51 +03:00
|
|
|
UnlockPassword string `json:"unlockPassword"`
|
2024-02-09 15:05:11 +07:00
|
|
|
|
|
|
|
|
// Breez / Greenlight
|
|
|
|
|
Mnemonic string `json:"mnemonic"`
|
2024-01-16 16:48:46 +07:00
|
|
|
GreenlightInviteCode string `json:"greenlightInviteCode"`
|
2024-03-21 12:38:27 +05:30
|
|
|
NextBackupReminder string `json:"nextBackupReminder"`
|
2024-02-09 15:05:11 +07:00
|
|
|
|
|
|
|
|
// Breez fields
|
|
|
|
|
BreezAPIKey string `json:"breezApiKey"`
|
|
|
|
|
|
2024-01-16 16:48:46 +07:00
|
|
|
// LND fields
|
2024-01-16 20:41:18 +07:00
|
|
|
LNDAddress string `json:"lndAddress"`
|
|
|
|
|
LNDCertFile string `json:"lndCertFile"`
|
|
|
|
|
LNDMacaroonFile string `json:"lndMacaroonFile"`
|
|
|
|
|
LNDCertHex string `json:"lndCertHex"`
|
|
|
|
|
LNDMacaroonHex string `json:"lndMacaroonHex"`
|
2024-06-04 10:47:51 +03:00
|
|
|
|
|
|
|
|
// Phoenixd fields
|
|
|
|
|
PhoenixdAddress string `json:"phoenixdAddress"`
|
|
|
|
|
PhoenixdAuthorization string `json:"phoenixdAuthorization"`
|
2024-06-03 20:25:04 +07:00
|
|
|
|
|
|
|
|
// Cashu fields
|
|
|
|
|
CashuMintUrl string `json:"cashuMintUrl"`
|
2024-01-16 16:48:46 +07:00
|
|
|
}
|
|
|
|
|
|
2023-12-27 13:24:35 +07:00
|
|
|
type CreateAppResponse struct {
|
|
|
|
|
PairingUri string `json:"pairingUri"`
|
|
|
|
|
PairingSecret string `json:"pairingSecretKey"`
|
|
|
|
|
Pubkey string `json:"pairingPublicKey"`
|
2024-08-23 14:15:15 +05:30
|
|
|
Id uint `json:"id"`
|
2023-12-27 13:24:35 +07:00
|
|
|
Name string `json:"name"`
|
|
|
|
|
ReturnTo string `json:"returnTo"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type User struct {
|
|
|
|
|
Email string `json:"email"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type InfoResponse struct {
|
2025-01-07 20:08:10 +07:00
|
|
|
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"`
|
|
|
|
|
StartupError string `json:"startupError"`
|
|
|
|
|
StartupErrorTime time.Time `json:"startupErrorTime"`
|
|
|
|
|
AutoUnlockPasswordSupported bool `json:"autoUnlockPasswordSupported"`
|
|
|
|
|
AutoUnlockPasswordEnabled bool `json:"autoUnlockPasswordEnabled"`
|
2024-03-05 12:12:32 +05:30
|
|
|
}
|
|
|
|
|
|
2024-08-08 11:08:14 +02:00
|
|
|
type MnemonicRequest struct {
|
|
|
|
|
UnlockPassword string `json:"unlockPassword"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type MnemonicResponse struct {
|
2024-03-05 12:12:32 +05:30
|
|
|
Mnemonic string `json:"mnemonic"`
|
2023-12-27 13:24:35 +07:00
|
|
|
}
|
2024-02-10 22:28:58 +07:00
|
|
|
|
2024-04-04 12:00:40 +07:00
|
|
|
type ChangeUnlockPasswordRequest struct {
|
|
|
|
|
CurrentUnlockPassword string `json:"currentUnlockPassword"`
|
|
|
|
|
NewUnlockPassword string `json:"newUnlockPassword"`
|
|
|
|
|
}
|
2025-01-07 20:08:10 +07:00
|
|
|
type AutoUnlockRequest struct {
|
|
|
|
|
UnlockPassword string `json:"unlockPassword"`
|
|
|
|
|
}
|
2024-04-04 12:00:40 +07:00
|
|
|
|
2024-02-10 22:28:58 +07:00
|
|
|
type ConnectPeerRequest = lnclient.ConnectPeerRequest
|
2024-02-11 14:43:23 +07:00
|
|
|
type OpenChannelRequest = lnclient.OpenChannelRequest
|
|
|
|
|
type OpenChannelResponse = lnclient.OpenChannelResponse
|
2024-03-07 10:37:59 +01:00
|
|
|
type CloseChannelResponse = lnclient.CloseChannelResponse
|
2024-06-18 15:22:19 +07:00
|
|
|
type UpdateChannelRequest = lnclient.UpdateChannelRequest
|
2024-02-11 00:09:26 +07:00
|
|
|
|
2024-02-27 12:01:02 +07:00
|
|
|
type RedeemOnchainFundsRequest struct {
|
|
|
|
|
ToAddress string `json:"toAddress"`
|
2024-09-04 11:44:58 +07:00
|
|
|
Amount uint64 `json:"amount"`
|
|
|
|
|
SendAll bool `json:"sendAll"`
|
2024-02-11 00:09:26 +07:00
|
|
|
}
|
|
|
|
|
|
2024-02-27 12:01:02 +07:00
|
|
|
type RedeemOnchainFundsResponse struct {
|
|
|
|
|
TxId string `json:"txId"`
|
|
|
|
|
}
|
|
|
|
|
|
2024-03-20 12:11:23 +07:00
|
|
|
type OnchainBalanceResponse = lnclient.OnchainBalanceResponse
|
2024-03-31 14:19:49 +07:00
|
|
|
type BalancesResponse = lnclient.BalancesResponse
|
2024-03-20 12:11:23 +07:00
|
|
|
|
2024-07-19 23:30:22 +07:00
|
|
|
type SendPaymentResponse = Transaction
|
|
|
|
|
type MakeInvoiceResponse = Transaction
|
|
|
|
|
type LookupInvoiceResponse = Transaction
|
|
|
|
|
type ListTransactionsResponse = []Transaction
|
|
|
|
|
|
|
|
|
|
// TODO: camelCase
|
|
|
|
|
type Transaction struct {
|
|
|
|
|
Type string `json:"type"`
|
2024-09-20 23:48:33 +07:00
|
|
|
State string `json:"state"`
|
2024-07-19 23:30:22 +07:00
|
|
|
Invoice string `json:"invoice"`
|
|
|
|
|
Description string `json:"description"`
|
2024-08-09 21:00:49 +05:30
|
|
|
DescriptionHash string `json:"descriptionHash"`
|
2024-07-19 23:30:22 +07:00
|
|
|
Preimage *string `json:"preimage"`
|
2024-08-09 21:00:49 +05:30
|
|
|
PaymentHash string `json:"paymentHash"`
|
2024-07-19 23:30:22 +07:00
|
|
|
Amount uint64 `json:"amount"`
|
2024-08-09 21:00:49 +05:30
|
|
|
FeesPaid uint64 `json:"feesPaid"`
|
|
|
|
|
CreatedAt string `json:"createdAt"`
|
|
|
|
|
SettledAt *string `json:"settledAt"`
|
|
|
|
|
AppId *uint `json:"appId"`
|
|
|
|
|
Metadata Metadata `json:"metadata,omitempty"`
|
|
|
|
|
Boostagram *Boostagram `json:"boostagram,omitempty"`
|
2025-01-17 13:21:50 +07:00
|
|
|
FailureReason string `json:"failureReason"`
|
2024-08-09 21:00:49 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Metadata = map[string]interface{}
|
|
|
|
|
|
|
|
|
|
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"`
|
2024-07-19 23:30:22 +07:00
|
|
|
}
|
2024-06-28 10:32:36 +05:30
|
|
|
|
2024-04-04 12:09:37 +05:30
|
|
|
// debug api
|
|
|
|
|
type SendPaymentProbesRequest struct {
|
|
|
|
|
Invoice string `json:"invoice"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type SendPaymentProbesResponse struct {
|
|
|
|
|
Error string `json:"error"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type SendSpontaneousPaymentProbesRequest struct {
|
|
|
|
|
Amount uint64 `json:"amount"`
|
2024-04-10 17:24:02 +07:00
|
|
|
NodeId string `json:"nodeId"`
|
2024-04-04 12:09:37 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type SendSpontaneousPaymentProbesResponse struct {
|
|
|
|
|
Error string `json:"error"`
|
|
|
|
|
}
|
|
|
|
|
|
2024-04-06 22:32:12 +02:00
|
|
|
const (
|
|
|
|
|
LogTypeNode = "node"
|
|
|
|
|
LogTypeApp = "app"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type GetLogOutputRequest struct {
|
2024-04-08 20:49:55 +02:00
|
|
|
MaxLen int `query:"maxLen"`
|
2024-04-05 22:31:33 +02:00
|
|
|
}
|
|
|
|
|
|
2024-04-06 22:32:12 +02:00
|
|
|
type GetLogOutputResponse struct {
|
2024-04-04 12:09:37 +05:30
|
|
|
Log string `json:"logs"`
|
|
|
|
|
}
|
|
|
|
|
|
2024-05-07 17:39:04 +03:00
|
|
|
type SignMessageRequest struct {
|
|
|
|
|
Message string `json:"message"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type SignMessageResponse struct {
|
|
|
|
|
Message string `json:"message"`
|
|
|
|
|
Signature string `json:"signature"`
|
|
|
|
|
}
|
|
|
|
|
|
2024-12-17 11:58:43 +07:00
|
|
|
type PayInvoiceRequest struct {
|
|
|
|
|
Amount *uint64 `json:"amount"`
|
|
|
|
|
}
|
|
|
|
|
|
2024-06-28 10:32:36 +05:30
|
|
|
type MakeInvoiceRequest struct {
|
2024-10-28 13:29:34 +07:00
|
|
|
Amount uint64 `json:"amount"`
|
2024-06-28 10:32:36 +05:30
|
|
|
Description string `json:"description"`
|
|
|
|
|
}
|
|
|
|
|
|
2024-05-10 14:22:58 +07:00
|
|
|
type ResetRouterRequest struct {
|
|
|
|
|
Key string `json:"key"`
|
|
|
|
|
}
|
|
|
|
|
|
2024-05-10 09:14:44 +02:00
|
|
|
type BasicBackupRequest struct {
|
|
|
|
|
UnlockPassword string `json:"unlockPassword"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type BasicRestoreWailsRequest struct {
|
|
|
|
|
UnlockPassword string `json:"unlockPassword"`
|
|
|
|
|
}
|
2024-05-22 10:30:19 +07:00
|
|
|
|
|
|
|
|
type NetworkGraphResponse = lnclient.NetworkGraphResponse
|
2024-06-17 19:42:09 +07:00
|
|
|
|
2024-07-25 20:57:16 +07:00
|
|
|
type LSPOrderRequest struct {
|
2024-06-26 11:44:52 +07:00
|
|
|
Amount uint64 `json:"amount"`
|
|
|
|
|
LSPType string `json:"lspType"`
|
|
|
|
|
LSPUrl string `json:"lspUrl"`
|
|
|
|
|
Public bool `json:"public"`
|
2024-06-17 19:42:09 +07:00
|
|
|
}
|
|
|
|
|
|
2024-07-25 20:57:16 +07:00
|
|
|
type LSPOrderResponse struct {
|
2024-06-17 22:44:54 +07:00
|
|
|
Invoice string `json:"invoice"`
|
|
|
|
|
Fee uint64 `json:"fee"`
|
|
|
|
|
InvoiceAmount uint64 `json:"invoiceAmount"`
|
|
|
|
|
IncomingLiquidity uint64 `json:"incomingLiquidity"`
|
|
|
|
|
OutgoingLiquidity uint64 `json:"outgoingLiquidity"`
|
2024-06-17 19:42:09 +07:00
|
|
|
}
|
2024-07-01 20:30:40 +07:00
|
|
|
|
|
|
|
|
type WalletCapabilitiesResponse struct {
|
|
|
|
|
Scopes []string `json:"scopes"`
|
|
|
|
|
Methods []string `json:"methods"`
|
|
|
|
|
NotificationTypes []string `json:"notificationTypes"`
|
|
|
|
|
}
|
2024-07-31 09:10:26 +02:00
|
|
|
|
|
|
|
|
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"`
|
2025-01-06 23:33:13 +07:00
|
|
|
FundingTxVout uint32 `json:"fundingTxVout"`
|
2024-07-31 09:10:26 +02:00
|
|
|
Active bool `json:"active"`
|
|
|
|
|
Public bool `json:"public"`
|
|
|
|
|
InternalChannel interface{} `json:"internalChannel"`
|
|
|
|
|
Confirmations *uint32 `json:"confirmations"`
|
|
|
|
|
ConfirmationsRequired *uint32 `json:"confirmationsRequired"`
|
|
|
|
|
ForwardingFeeBaseMsat uint32 `json:"forwardingFeeBaseMsat"`
|
|
|
|
|
UnspendablePunishmentReserve uint64 `json:"unspendablePunishmentReserve"`
|
|
|
|
|
CounterpartyUnspendablePunishmentReserve uint64 `json:"counterpartyUnspendablePunishmentReserve"`
|
|
|
|
|
Error *string `json:"error"`
|
|
|
|
|
Status string `json:"status"`
|
2024-08-08 13:01:24 +07:00
|
|
|
IsOutbound bool `json:"isOutbound"`
|
2024-07-31 09:10:26 +02:00
|
|
|
}
|
2024-12-16 12:32:35 +07:00
|
|
|
|
|
|
|
|
type MigrateNodeStorageRequest struct {
|
|
|
|
|
To string `json:"to"`
|
|
|
|
|
}
|
2025-01-17 11:29:20 +03:00
|
|
|
|
|
|
|
|
type HealthAlarmKind string
|
|
|
|
|
|
|
|
|
|
const (
|
|
|
|
|
HealthAlarmKindAlbyService HealthAlarmKind = "alby_service"
|
|
|
|
|
HealthAlarmKindNodeNotReady = "node_not_ready"
|
|
|
|
|
HealthAlarmKindChannelsOffline = "channels_offline"
|
|
|
|
|
HealthAlarmKindNostrRelayOffline = "nostr_relay_offline"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type HealthAlarm struct {
|
|
|
|
|
Kind HealthAlarmKind `json:"kind"`
|
|
|
|
|
RawDetails any `json:"rawDetails,omitempty"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func NewHealthAlarm(kind HealthAlarmKind, rawDetails any) HealthAlarm {
|
|
|
|
|
return HealthAlarm{
|
|
|
|
|
Kind: kind,
|
|
|
|
|
RawDetails: rawDetails,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type HealthResponse struct {
|
|
|
|
|
Alarms []HealthAlarm `json:"alarms,omitempty"`
|
|
|
|
|
}
|
2025-01-30 14:20:17 +03:00
|
|
|
|
|
|
|
|
type CustomNodeCommandArgDef struct {
|
|
|
|
|
Name string `json:"name"`
|
|
|
|
|
Description string `json:"description"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type CustomNodeCommandDef struct {
|
|
|
|
|
Name string `json:"name"`
|
|
|
|
|
Description string `json:"description"`
|
|
|
|
|
Args []CustomNodeCommandArgDef `json:"args"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type CustomNodeCommandsResponse struct {
|
|
|
|
|
Commands []CustomNodeCommandDef `json:"commands"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type ExecuteCustomNodeCommandRequest struct {
|
|
|
|
|
Command string `json:"command"`
|
|
|
|
|
}
|