diff --git a/frontend/src/types.ts b/frontend/src/types.ts
index cd570111..886848b8 100644
--- a/frontend/src/types.ts
+++ b/frontend/src/types.ts
@@ -11,13 +11,7 @@ import {
WalletMinimal,
} from "lucide-react";
-export type BackendType =
- | "LND"
- | "BREEZ"
- | "GREENLIGHT"
- | "LDK"
- | "PHOENIX"
- | "CASHU";
+export type BackendType = "LND" | "LDK" | "PHOENIX" | "CASHU";
export type Nip47RequestMethod =
| "get_info"
@@ -331,8 +325,6 @@ export type SetupNodeInfo = Partial<{
mnemonic?: string;
nextBackupReminder?: string;
- greenlightInviteCode?: string;
- breezApiKey?: string;
lndAddress?: string;
lndCertHex?: string;
diff --git a/go.mod b/go.mod
index 6e928772..1e7d73ac 100644
--- a/go.mod
+++ b/go.mod
@@ -6,9 +6,7 @@ toolchain go1.23.3
require (
github.com/adrg/xdg v0.5.3
- github.com/breez/breez-sdk-go v0.5.2
github.com/elnosh/gonuts v0.4.0
- github.com/getAlby/glalby-go v0.0.0-20240621192717-95673c864d59
github.com/getAlby/ldk-node-go v0.0.0-20250313063409-c465f4e6e089
github.com/go-gormigrate/gormigrate/v2 v2.1.3
github.com/labstack/echo/v4 v4.13.3
diff --git a/go.sum b/go.sum
index 927f6cd7..d5db9912 100644
--- a/go.sum
+++ b/go.sum
@@ -61,8 +61,6 @@ github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/bep/debounce v1.2.1 h1:v67fRdBA9UQu2NhLFXrSg0Brw7CexQekrBwDMM8bzeY=
github.com/bep/debounce v1.2.1/go.mod h1:H8yggRPQKLUhUoqrJC1bO2xNya7vanpDl7xR3ISbCJ0=
-github.com/breez/breez-sdk-go v0.5.2 h1:frqX14cKTM2egWP7C53u3SzBkYQrgx9P7si/Ig9Droo=
-github.com/breez/breez-sdk-go v0.5.2/go.mod h1:EalYMEeQVwRzr6UXnF4QpLlpuWNwQQN9xwtDKNIutBo=
github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ=
github.com/btcsuite/btcd v0.22.0-beta.0.20220111032746-97732e52810c/go.mod h1:tjmYdS6MLJ5/s0Fj4DbLgSbDHbEqLJrtnHecBFkdz5M=
github.com/btcsuite/btcd v0.23.5-0.20231215221805-96c9fd8078fd/go.mod h1:nm3Bko6zh6bWP60UxwoT5LzdGJsQJaPo6HjduXq9p6A=
@@ -205,8 +203,6 @@ github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/
github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=
github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E=
github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ=
-github.com/getAlby/glalby-go v0.0.0-20240621192717-95673c864d59 h1:fSqdXE9uKhLcOOQaLtzN+D8RN3oEcZQkGX5E8PyiKy0=
-github.com/getAlby/glalby-go v0.0.0-20240621192717-95673c864d59/go.mod h1:ViyJvjlvv0GCesTJ7mb3fBo4G+/qsujDAFN90xZ7a9U=
github.com/getAlby/ldk-node-go v0.0.0-20250313063409-c465f4e6e089 h1:39wtrlg8SxbjJDj/hGdhS4GPlDk9kwxTy36kvrDP5mU=
github.com/getAlby/ldk-node-go v0.0.0-20250313063409-c465f4e6e089/go.mod h1:8BRjtKcz8E0RyYTPEbMS8VIdgredcGSLne8vHDtcRLg=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
diff --git a/lnclient/breez/breez.go b/lnclient/breez/breez.go
deleted file mode 100644
index cbfaa347..00000000
--- a/lnclient/breez/breez.go
+++ /dev/null
@@ -1,503 +0,0 @@
-//go:build !skip_breez
-
-package breez
-
-import (
- "context"
- "encoding/hex"
- "errors"
- "log"
- "os"
- "path/filepath"
- "strings"
- "time"
-
- "github.com/breez/breez-sdk-go/breez_sdk"
- decodepay "github.com/nbd-wtf/ln-decodepay"
- "github.com/sirupsen/logrus"
-
- "github.com/getAlby/hub/lnclient"
- "github.com/getAlby/hub/logger"
-)
-
-type BreezService struct {
- listener *BreezListener
- svc *breez_sdk.BlockingBreezServices
- pubkey string
-}
-type BreezListener struct {
-}
-
-func (listener BreezListener) Log(l breez_sdk.LogEntry) {
- logLevel := logrus.InfoLevel
- if l.Level == "TRACE" || l.Level == "DEBUG" || strings.Contains(l.Line, "connection to node lost") || strings.Contains(l.Line, "Restore channel") {
- logLevel = logrus.DebugLevel
- }
-
- logger.Logger.WithField("level", l.Level).Log(logLevel, l.Line)
-}
-
-func (BreezListener) OnEvent(e breez_sdk.BreezEvent) {
- log.Printf("received event %#v", e)
-}
-
-func NewBreezService(mnemonic, apiKey, inviteCode, workDir string) (result lnclient.LNClient, err error) {
- if mnemonic == "" || apiKey == "" || inviteCode == "" || workDir == "" {
- return nil, errors.New("one or more required breez configuration are missing")
- }
-
- // create dir if not exists
- newpath := filepath.Join(workDir)
- err = os.MkdirAll(newpath, os.ModePerm)
- if err != nil {
- return nil, err
- }
- seed, err := breez_sdk.MnemonicToSeed(mnemonic)
- if err != nil {
- return nil, err
- }
- nodeConfig := breez_sdk.NodeConfigGreenlight{
- Config: breez_sdk.GreenlightNodeConfig{
- InviteCode: &inviteCode,
- },
- }
- listener := BreezListener{}
- config := breez_sdk.DefaultConfig(breez_sdk.EnvironmentTypeProduction, apiKey, nodeConfig)
- config.WorkingDir = workDir
- breez_sdk.SetLogStream(listener)
- svc, err := breez_sdk.Connect(breez_sdk.ConnectRequest{
- Config: config,
- Seed: seed,
- }, listener)
- if err != nil {
- return nil, err
- }
-
- nodeInfo, err := svc.NodeInfo()
- if err != nil {
- return nil, err
- }
- logger.Logger.WithField("info", nodeInfo).Info("Node info")
- logger.Logger.WithFields(logrus.Fields{
- "ln balance": nodeInfo.ChannelsBalanceMsat,
- "balance": nodeInfo.OnchainBalanceMsat,
- "max_payable_msat": nodeInfo.MaxPayableMsat,
- "max_receivable_msat": nodeInfo.MaxReceivableMsat,
- "max_single_payment_amount_msat": nodeInfo.MaxSinglePaymentAmountMsat,
- "connected_peers": nodeInfo.ConnectedPeers,
- "inbound_liquidity_msats": nodeInfo.InboundLiquidityMsats,
- }).Info("node balances and peers")
-
- return &BreezService{
- listener: &listener,
- svc: svc,
- pubkey: nodeInfo.Id,
- }, nil
-}
-
-func (bs *BreezService) Shutdown() error {
- return bs.svc.Disconnect()
-}
-
-func (bs *BreezService) SendPaymentSync(ctx context.Context, payReq string, amount *uint64) (*lnclient.PayInvoiceResponse, error) {
- if amount != nil {
- return nil, errors.New("0-amount invoices not supported")
- }
- sendPaymentRequest := breez_sdk.SendPaymentRequest{
- Bolt11: payReq,
- }
- resp, err := bs.svc.SendPayment(sendPaymentRequest)
- if err != nil {
- return nil, err
- }
- var lnDetails breez_sdk.PaymentDetailsLn
- if resp.Payment.Details != nil {
- lnDetails, _ = resp.Payment.Details.(breez_sdk.PaymentDetailsLn)
- }
- return &lnclient.PayInvoiceResponse{
- Preimage: lnDetails.Data.PaymentPreimage,
- }, nil
-
-}
-
-func (bs *BreezService) SendKeysend(ctx context.Context, amount uint64, destination string, custom_records []lnclient.TLVRecord, preimage string) (*lnclient.PayKeysendResponse, error) {
- // TODO: re-enable when passing custom preimage is possible
- /*extraTlvs := []breez_sdk.TlvEntry{}
- for _, record := range custom_records {
- decodedValue, err := hex.DecodeString(record.Value)
- if err != nil {
- return "", "", 0, err
- }
- extraTlvs = append(extraTlvs, breez_sdk.TlvEntry{
- FieldNumber: record.Type,
- Value: decodedValue,
- })
- }
-
- sendSpontaneousPaymentRequest := breez_sdk.SendSpontaneousPaymentRequest{
- NodeId: destination,
- AmountMsat: amount,
- ExtraTlvs: &extraTlvs,
- }
- resp, err := bs.svc.SendSpontaneousPayment(sendSpontaneousPaymentRequest)
- if err != nil {
- return "", "", 0, err
- }
- var lnDetails breez_sdk.PaymentDetailsLn
- if resp.Payment.Details != nil {
- lnDetails, _ = resp.Payment.Details.(breez_sdk.PaymentDetailsLn)
- }
- return lnDetails.Data.PaymentHash, lnDetails.Data.PaymentPreimage, resp.Payment.FeeMsat, nil*/
- return nil, errors.New("not supported")
-}
-
-func (bs *BreezService) MakeInvoice(ctx context.Context, amount int64, description string, descriptionHash string, expiry int64) (transaction *lnclient.Transaction, err error) {
- if expiry == 0 {
- expiry = lnclient.DEFAULT_INVOICE_EXPIRY
- }
-
- expiry32 := uint32(expiry)
- receivePaymentRequest := breez_sdk.ReceivePaymentRequest{
- // amount provided in msat
- AmountMsat: uint64(amount),
- Description: description,
- Expiry: &expiry32,
- }
- resp, err := bs.svc.ReceivePayment(receivePaymentRequest)
- if err != nil {
- return nil, err
- }
-
- tx := &lnclient.Transaction{
- Type: "incoming",
- Invoice: resp.LnInvoice.Bolt11,
- Preimage: hex.EncodeToString(resp.LnInvoice.PaymentSecret),
- PaymentHash: resp.LnInvoice.PaymentHash,
- FeesPaid: 0,
- CreatedAt: int64(resp.LnInvoice.Timestamp),
- SettledAt: nil,
- Metadata: nil,
- }
-
- if resp.LnInvoice.Description != nil {
- tx.Description = *resp.LnInvoice.Description
- }
- if resp.LnInvoice.DescriptionHash != nil {
- tx.DescriptionHash = *resp.LnInvoice.DescriptionHash
- }
- if resp.LnInvoice.AmountMsat != nil {
- tx.Amount = int64(*resp.LnInvoice.AmountMsat)
- }
- invExpiry := int64(resp.LnInvoice.Expiry)
- tx.ExpiresAt = &invExpiry
- return tx, nil
-}
-
-func (bs *BreezService) LookupInvoice(ctx context.Context, paymentHash string) (transaction *lnclient.Transaction, err error) {
- log.Printf("p: %v", paymentHash)
- payment, err := bs.svc.PaymentByHash(paymentHash)
- if err != nil {
- return nil, err
- }
- if payment != nil {
- log.Printf("p: %v", payment)
- transaction, err = breezPaymentToTransaction(payment)
- if err != nil {
- return nil, err
- }
- return transaction, nil
- } else {
- return nil, errors.New("not found")
- }
-}
-
-func (bs *BreezService) ListTransactions(ctx context.Context, from, until, limit, offset uint64, unpaid bool, invoiceType string) (transactions []lnclient.Transaction, err error) {
-
- request := breez_sdk.ListPaymentsRequest{}
- if limit > 0 {
- limit32 := uint32(limit)
- request.Limit = &limit32
- }
- if offset > 0 {
- offset32 := uint32(offset)
- request.Offset = &offset32
- }
- if from > 0 {
- from64 := int64(from)
- request.FromTimestamp = &from64
- }
- if until > 0 {
- until64 := int64(until)
- request.ToTimestamp = &until64
- }
-
- payments, err := bs.svc.ListPayments(request)
- if err != nil {
- return nil, err
- }
-
- transactions = []lnclient.Transaction{}
- for _, payment := range payments {
- if payment.PaymentType != breez_sdk.PaymentTypeReceived && payment.PaymentType != breez_sdk.PaymentTypeSent {
- // skip other types of payments for now
- continue
- }
-
- transaction, err := breezPaymentToTransaction(&payment)
- if err == nil {
- transactions = append(transactions, *transaction)
- }
- }
- return transactions, nil
-}
-
-func (bs *BreezService) GetInfo(ctx context.Context) (info *lnclient.NodeInfo, err error) {
- return &lnclient.NodeInfo{
- Alias: "breez",
- Color: "",
- Pubkey: "",
- Network: "mainnet",
- BlockHeight: 0,
- BlockHash: "",
- }, nil
-}
-
-func (bs *BreezService) ListChannels(ctx context.Context) ([]lnclient.Channel, error) {
- channels := []lnclient.Channel{}
- return channels, nil
-}
-
-func (bs *BreezService) GetNodeConnectionInfo(ctx context.Context) (nodeConnectionInfo *lnclient.NodeConnectionInfo, err error) {
- return &lnclient.NodeConnectionInfo{}, nil
-}
-
-func (bs *BreezService) ConnectPeer(ctx context.Context, connectPeerRequest *lnclient.ConnectPeerRequest) error {
- return nil
-}
-func (bs *BreezService) OpenChannel(ctx context.Context, openChannelRequest *lnclient.OpenChannelRequest) (*lnclient.OpenChannelResponse, error) {
- return nil, nil
-}
-
-func (bs *BreezService) CloseChannel(ctx context.Context, closeChannelRequest *lnclient.CloseChannelRequest) (*lnclient.CloseChannelResponse, error) {
- return nil, nil
-}
-
-func breezPaymentToTransaction(payment *breez_sdk.Payment) (*lnclient.Transaction, error) {
- var lnDetails breez_sdk.PaymentDetailsLn
- if payment.Details != nil {
- lnDetails, _ = payment.Details.(breez_sdk.PaymentDetailsLn)
- }
- var txType string
- if payment.PaymentType == breez_sdk.PaymentTypeSent {
- txType = "outgoing"
- } else {
- txType = "incoming"
- }
-
- createdAt := payment.PaymentTime
- var expiresAt *int64
- description := lnDetails.Data.Label
- descriptionHash := ""
-
- if lnDetails.Data.Bolt11 != "" {
- // TODO: Breez should provide these details so we don't need to manually decode the invoice
- paymentRequest, err := decodepay.Decodepay(strings.ToLower(lnDetails.Data.Bolt11))
- if err != nil {
- log.Printf("Failed to decode bolt11 invoice: %v", payment)
- return nil, err
- }
-
- createdAt = int64(paymentRequest.CreatedAt)
- expiresAtUnix := time.UnixMilli(int64(paymentRequest.CreatedAt) * 1000).Add(time.Duration(paymentRequest.Expiry) * time.Second).Unix()
- expiresAt = &expiresAtUnix
- description = paymentRequest.Description
- descriptionHash = paymentRequest.DescriptionHash
- }
-
- tx := &lnclient.Transaction{
- Type: txType,
- Invoice: lnDetails.Data.Bolt11,
- Preimage: lnDetails.Data.PaymentPreimage,
- PaymentHash: lnDetails.Data.PaymentHash,
- Amount: int64(payment.AmountMsat),
- FeesPaid: int64(payment.FeeMsat),
- CreatedAt: createdAt,
- ExpiresAt: expiresAt,
- Metadata: nil,
- Description: description,
- DescriptionHash: descriptionHash,
- }
- if payment.Status == breez_sdk.PaymentStatusComplete {
- settledAt := payment.PaymentTime
- tx.SettledAt = &settledAt
- }
-
- if payment.Description != nil {
- tx.Description = *payment.Description
- }
-
- return tx, nil
-}
-
-func (bs *BreezService) GetNewOnchainAddress(ctx context.Context) (string, error) {
- // The below code works but is not needed and there's no Breez UI to support it.
- // Plus, it creates complexity with the deposit limits.
- /*swapInfo, err := bs.svc.ReceiveOnchain(breez_sdk.ReceiveOnchainRequest{})
-
- if err != nil {
- logger.Logger.Errorf("Failed to get onchain address: %v", err)
- return "", err
- }
- logger.Logger.Infof("This address has deposit limits! Min: %d Max: %d", swapInfo.MinAllowedDeposit, swapInfo.MaxAllowedDeposit)
-
- return swapInfo.BitcoinAddress, nil*/
- return "", nil
-}
-
-func (bs *BreezService) GetOnchainBalance(ctx context.Context) (*lnclient.OnchainBalanceResponse, error) {
- response, err := bs.svc.NodeInfo()
-
- if err != nil {
- logger.Logger.Errorf("Failed to get node info: %v", err)
- return nil, err
- }
-
- return &lnclient.OnchainBalanceResponse{
- Spendable: int64(response.OnchainBalanceMsat) / 1000,
- Total: int64(response.OnchainBalanceMsat+response.PendingOnchainBalanceMsat) / 1000,
- }, nil
-}
-
-func (bs *BreezService) RedeemOnchainFunds(ctx context.Context, toAddress string, amount uint64, sendAll bool) (txId string, err error) {
- if !sendAll {
- return "", errors.New("only send all is supported")
- }
-
- if toAddress == "" {
- return "", errors.New("No address provided")
- }
-
- recommendedFees, err := bs.svc.RecommendedFees()
- if err != nil {
- logger.Logger.Errorf("Failed to get recommended fees info: %v", err)
- return "", err
- }
-
- satPerVbyte := uint32(recommendedFees.FastestFee)
- prepareReq := breez_sdk.PrepareRedeemOnchainFundsRequest{SatPerVbyte: satPerVbyte, ToAddress: toAddress}
- prepareRedeemOnchainFundsResponse, err := bs.svc.PrepareRedeemOnchainFunds(prepareReq)
-
- if err != nil {
- logger.Logger.Errorf("Failed to prepare onchain address: %v", err)
- return "", err
- }
- logger.Logger.Infof("PrepareRedeemOnchainFunds response: %#v", prepareRedeemOnchainFundsResponse)
-
- redeemReq := breez_sdk.RedeemOnchainFundsRequest{SatPerVbyte: satPerVbyte, ToAddress: toAddress}
- redeemOnchainFundsResponse, err := bs.svc.RedeemOnchainFunds(redeemReq)
-
- if err != nil {
- logger.Logger.Errorf("Failed to redeem onchain funds: %v", err)
- return "", err
- }
-
- logger.Logger.Infof("RedeemOnchainFunds response: %#v", redeemOnchainFundsResponse)
- return hex.EncodeToString(redeemOnchainFundsResponse.Txid), nil
-}
-
-func (bs *BreezService) ResetRouter(key string) error {
- return nil
-}
-
-func (bs *BreezService) SendPaymentProbes(ctx context.Context, invoice string) error {
- return nil
-}
-
-func (bs *BreezService) SendSpontaneousPaymentProbes(ctx context.Context, amountMsat uint64, nodeId string) error {
- return nil
-}
-
-func (bs *BreezService) ListPeers(ctx context.Context) ([]lnclient.PeerDetails, error) {
- return nil, nil
-}
-
-func (bs *BreezService) GetLogOutput(ctx context.Context, maxLen int) ([]byte, error) {
- return []byte{}, nil
-}
-
-func (bs *BreezService) GetNodeStatus(ctx context.Context) (nodeStatus *lnclient.NodeStatus, err error) {
- return &lnclient.NodeStatus{
- IsReady: true,
- }, nil
-}
-
-func (bs *BreezService) SignMessage(ctx context.Context, message string) (string, error) {
- resp, err := bs.svc.SignMessage(breez_sdk.SignMessageRequest{
- Message: message,
- })
- if err != nil {
- return "", err
- }
-
- return resp.Signature, nil
-}
-
-func (bs *BreezService) GetBalances(ctx context.Context) (*lnclient.BalancesResponse, error) {
- info, err := bs.svc.NodeInfo()
- if err != nil {
- return nil, err
- }
-
- return &lnclient.BalancesResponse{
- Onchain: lnclient.OnchainBalanceResponse{
- Spendable: int64(info.OnchainBalanceMsat) / 1000,
- Total: int64(info.OnchainBalanceMsat+info.PendingOnchainBalanceMsat) / 1000,
- },
- Lightning: lnclient.LightningBalanceResponse{
- TotalSpendable: int64(info.MaxPayableMsat),
- TotalReceivable: int64(info.MaxReceivableMsat),
- NextMaxSpendable: int64(info.MaxSinglePaymentAmountMsat),
- NextMaxReceivable: int64(info.MaxReceivableMsat),
- NextMaxSpendableMPP: int64(info.MaxSinglePaymentAmountMsat),
- NextMaxReceivableMPP: int64(info.MaxReceivableMsat),
- },
- }, nil
-}
-
-func (bs *BreezService) GetStorageDir() (string, error) {
- return "", nil
-}
-
-func (bs *BreezService) GetNetworkGraph(ctx context.Context, nodeIds []string) (lnclient.NetworkGraphResponse, error) {
- return nil, nil
-}
-
-func (bs *BreezService) UpdateLastWalletSyncRequest() {}
-
-func (bs *BreezService) UpdateChannel(ctx context.Context, updateChannelRequest *lnclient.UpdateChannelRequest) error {
- return nil
-}
-
-func (bs *BreezService) DisconnectPeer(ctx context.Context, peerId string) error {
- return nil
-}
-
-func (bs *BreezService) GetSupportedNIP47Methods() []string {
- return []string{"pay_invoice" /*"pay_keysend",*/, "get_balance", "get_budget", "get_info", "make_invoice", "lookup_invoice", "list_transactions", "multi_pay_invoice", "multi_pay_keysend", "sign_message"}
-}
-
-func (bs *BreezService) GetSupportedNIP47NotificationTypes() []string {
- return []string{}
-}
-
-func (bs *BreezService) GetPubkey() string {
- return bs.pubkey
-}
-
-func (bs *BreezService) GetCustomNodeCommandDefinitions() []lnclient.CustomNodeCommandDef {
- return nil
-}
-
-func (bs *BreezService) ExecuteCustomNodeCommand(ctx context.Context, command *lnclient.CustomNodeCommandRequest) (*lnclient.CustomNodeCommandResponse, error) {
- return nil, nil
-}
diff --git a/lnclient/breez/breez_stub.go b/lnclient/breez/breez_stub.go
deleted file mode 100644
index e7169c88..00000000
--- a/lnclient/breez/breez_stub.go
+++ /dev/null
@@ -1,12 +0,0 @@
-//go:build skip_breez
-
-package breez
-
-import (
- "github.com/getAlby/hub/lnclient"
-)
-
-func NewBreezService(mnemonic, apiKey, inviteCode, workDir string) (result lnclient.LNClient, err error) {
- panic("not implemented")
- return nil, nil
-}
diff --git a/lnclient/greenlight/greenlight.go b/lnclient/greenlight/greenlight.go
deleted file mode 100644
index 48e61190..00000000
--- a/lnclient/greenlight/greenlight.go
+++ /dev/null
@@ -1,699 +0,0 @@
-package greenlight
-
-import (
- "context"
- "errors"
- "log"
- "math/rand"
- "os"
- "path/filepath"
- "sort"
- "strconv"
- "strings"
- "time"
-
- // "github.com/getAlby/hub/glalby" // for local development only
-
- "github.com/getAlby/glalby-go/glalby"
- decodepay "github.com/nbd-wtf/ln-decodepay"
- "github.com/sirupsen/logrus"
-
- "github.com/getAlby/hub/config"
- "github.com/getAlby/hub/lnclient"
- "github.com/getAlby/hub/logger"
-)
-
-type GreenlightService struct {
- workdir string
- client *glalby.BlockingGreenlightAlbyClient
- pubkey string
-}
-
-const DEVICE_CREDENTIALS_KEY = "GreenlightCreds"
-
-func NewGreenlightService(cfg config.Config, mnemonic, inviteCode, workDir, encryptionKey string) (result lnclient.LNClient, err error) {
- if mnemonic == "" || inviteCode == "" || workDir == "" {
- return nil, errors.New("one or more required greenlight configuration are missing")
- }
-
- // create dir if not exists
- newpath := filepath.Join(workDir)
- err = os.MkdirAll(newpath, os.ModePerm)
- if err != nil {
- log.Printf("Failed to create greenlight working dir: %v", err)
- return nil, err
- }
-
- var credentials *glalby.GreenlightCredentials
- existingDeviceCreds, _ := cfg.Get(DEVICE_CREDENTIALS_KEY, encryptionKey)
-
- if existingDeviceCreds != "" {
- credentials = &glalby.GreenlightCredentials{
- GlCreds: existingDeviceCreds,
- }
- logger.Logger.Info("Using saved greenlight credentials")
- }
-
- if credentials == nil {
- logger.Logger.Info("No greenlight credentials found, attempting to recover existing node")
- recoveredCredentials, err := glalby.Recover(mnemonic)
- credentials = &recoveredCredentials
-
- if err != nil {
- logger.Logger.Errorf("Failed to recover node: %v", err)
- logger.Logger.Infof("Trying to register instead...")
- recoveredCredentials, err := glalby.Register(mnemonic, inviteCode)
- credentials = &recoveredCredentials
-
- if err != nil {
- logger.Logger.WithError(err).Error("Failed to register new node")
- return nil, err
- }
- }
-
- if credentials == nil || credentials.GlCreds == "" {
- return nil, errors.New("unexpected response from Recover")
- }
- err = cfg.SetUpdate(DEVICE_CREDENTIALS_KEY, credentials.GlCreds, encryptionKey)
- if err != nil {
- logger.Logger.WithError(err).Error("Failed to save greenlight credentials")
- return nil, err
- }
- }
-
- client, err := glalby.NewBlockingGreenlightAlbyClient(mnemonic, *credentials)
-
- if err != nil {
- log.Printf("Failed to create greenlight alby client: %v", err)
- return nil, err
- }
- if client == nil {
- logger.Logger.Error("unexpected response from NewBlockingGreenlightAlbyClient")
- }
-
- nodeInfo, err := client.GetInfo()
-
- gs := GreenlightService{
- workdir: newpath,
- client: client,
- pubkey: nodeInfo.Pubkey,
- }
-
- if err != nil {
- return nil, err
- }
-
- log.Printf("Node info: %v", nodeInfo)
-
- return &gs, nil
-}
-
-func (gs *GreenlightService) Shutdown() error {
- _, err := gs.client.Shutdown()
- if err != nil {
- logger.Logger.WithError(err).Error("Failed to shutdown greenlight node")
- return err
- }
- return nil
-}
-
-func (gs *GreenlightService) SendPaymentSync(ctx context.Context, payReq string, amount *uint64) (*lnclient.PayInvoiceResponse, error) {
- if amount != nil {
- return nil, errors.New("0-amount invoices not supported")
- }
- response, err := gs.client.Pay(glalby.PayRequest{
- Bolt11: payReq,
- })
-
- if err != nil {
- logger.Logger.Errorf("Failed to send payment: %v", err)
- return nil, err
- }
- log.Printf("SendPaymentSync succeeded: %v", response.Preimage)
- return &lnclient.PayInvoiceResponse{
- Preimage: response.Preimage,
- }, nil
-}
-
-func (gs *GreenlightService) SendKeysend(ctx context.Context, amount uint64, destination string, custom_records []lnclient.TLVRecord, preimage string) (*lnclient.PayKeysendResponse, error) {
-
- // TODO: re-enable when passing custom preimage is possible
- /*extraTlvs := []glalby.TlvEntry{}
-
- for _, customRecord := range custom_records {
-
- extraTlvs = append(extraTlvs, glalby.TlvEntry{
- Ty: customRecord.Type,
- Value: customRecord.Value, // glalby expects hex-encoded TLV values
- })
- }
-
- // TODO: support passing custom preimage
- response, err := gs.client.KeySend(glalby.KeySendRequest{
- Destination: destination,
- AmountMsat: &amount,
- ExtraTlvs: &extraTlvs,
- })
-
- if err != nil {
- logger.Logger.Errorf("Failed to send keysend payment: %v", err)
- return "", "", 0, err
- }
-
- // TODO: get payment hash from response
-
- return "", response.PaymentPreimage, 0, nil*/
- return nil, errors.New("not supported")
-}
-
-func (gs *GreenlightService) MakeInvoice(ctx context.Context, amount int64, description string, descriptionHash string, expiry int64) (transaction *lnclient.Transaction, err error) {
- if expiry == 0 {
- expiry = lnclient.DEFAULT_INVOICE_EXPIRY
- }
- uexpiry := uint64(expiry)
- // TODO: it seems description hash cannot be passed to greenlight
- invoice, err := gs.client.MakeInvoice(glalby.MakeInvoiceRequest{
- AmountMsat: uint64(amount),
- Description: description,
- Label: "label_" + strconv.Itoa(rand.Int()),
- Expiry: &uexpiry,
- })
-
- if err != nil {
- logger.Logger.Errorf("MakeInvoice failed: %v", err)
- return nil, err
- }
-
- paymentRequest, err := decodepay.Decodepay(strings.ToLower(invoice.Bolt11))
- if err != nil {
- logger.Logger.WithFields(logrus.Fields{
- "invoice": invoice.Bolt11,
- }).Errorf("Failed to decode bolt11 invoice: %v", invoice.Bolt11)
- return nil, err
- }
-
- description = paymentRequest.Description
- descriptionHash = paymentRequest.DescriptionHash
- expiresAt := int64(invoice.ExpiresAt)
- transaction = &lnclient.Transaction{
- Type: "incoming",
- Invoice: invoice.Bolt11,
- Description: description,
- DescriptionHash: descriptionHash,
- Preimage: "", // TODO: set preimage to enable self-payments
- PaymentHash: invoice.PaymentHash,
- ExpiresAt: &expiresAt,
- Amount: amount,
- CreatedAt: int64(paymentRequest.CreatedAt),
- }
-
- return transaction, nil
-}
-
-func (gs *GreenlightService) LookupInvoice(ctx context.Context, paymentHash string) (transaction *lnclient.Transaction, err error) {
- response, err := gs.client.ListInvoices(glalby.ListInvoicesRequest{
- PaymentHash: &paymentHash,
- })
-
- if err != nil {
- logger.Logger.Errorf("ListInvoices failed: %v", err)
- return nil, err
- }
-
- if len(response.Invoices) == 0 {
- return nil, errors.New("invoice not found")
- }
- invoice := response.Invoices[0]
-
- if invoice.Bolt11 == nil {
- return nil, errors.New("not a Bolt11 invoice")
- }
-
- transaction, err = gs.greenlightInvoiceToTransaction(&invoice)
-
- if err != nil {
- logger.Logger.Errorf("Failed to map invoice: %v", err)
- return nil, err
- }
-
- return transaction, nil
-}
-
-func (gs *GreenlightService) ListTransactions(ctx context.Context, from, until, limit, offset uint64, unpaid bool, invoiceType string) (transactions []lnclient.Transaction, err error) {
- listInvoicesResponse, err := gs.client.ListInvoices(glalby.ListInvoicesRequest{})
-
- if err != nil {
- logger.Logger.Errorf("ListInvoices failed: %v", err)
- return nil, err
- }
-
- transactions = []lnclient.Transaction{}
-
- if err != nil {
- log.Printf("ListInvoices failed: %v", err)
- return nil, err
- }
-
- for _, invoice := range listInvoicesResponse.Invoices {
- if invoice.PaidAt == nil {
- // skip unpaid invoices
- continue
- }
-
- transaction, err := gs.greenlightInvoiceToTransaction(&invoice)
- if err != nil {
- continue
- }
-
- transactions = append(transactions, *transaction)
- }
-
- listPaymentsResponse, err := gs.client.ListPayments(glalby.ListPaymentsRequest{})
-
- if err != nil {
- logger.Logger.Errorf("ListPayments failed: %v", err)
- return nil, err
- }
-
- for _, payment := range listPaymentsResponse.Payments {
- description := ""
- descriptionHash := ""
- bolt11 := ""
- var expiresAt *int64
- if payment.Bolt11 != nil {
- // TODO: Greenlight should provide these details so we don't need to manually decode the invoice
- bolt11 := *payment.Bolt11
- paymentRequest, err := decodepay.Decodepay(strings.ToLower(bolt11))
- if err != nil {
- log.Printf("Failed to decode bolt11 invoice: %v", bolt11)
- return nil, err
- }
-
- description = paymentRequest.Description
- descriptionHash = paymentRequest.DescriptionHash
- expiresAtUnix := time.UnixMilli(int64(paymentRequest.CreatedAt) * 1000).Add(time.Duration(paymentRequest.Expiry) * time.Second).Unix()
- expiresAt = &expiresAtUnix
- }
-
- preimage := ""
- if payment.Preimage != nil {
- preimage = *payment.Preimage
- }
- var amount int64 = 0
- var fee int64 = 0
- if payment.AmountSentMsat != nil {
- amount = int64(*payment.AmountSentMsat)
- if payment.AmountMsat != nil {
- fee = amount - int64(*payment.AmountMsat)
- }
- }
- var settledAt *int64
- if payment.CompletedAt != nil {
- completedAt := int64(*payment.CompletedAt)
- settledAt = &completedAt
- }
-
- transactions = append(transactions, lnclient.Transaction{
- Type: "outgoing",
- Invoice: bolt11,
- Description: description,
- DescriptionHash: descriptionHash,
- Preimage: preimage,
- PaymentHash: payment.PaymentHash,
- ExpiresAt: expiresAt,
- Amount: amount,
- FeesPaid: fee,
- CreatedAt: int64(payment.CreatedAt),
- SettledAt: settledAt,
- })
- }
-
- // sort by created date descending
- sort.SliceStable(transactions, func(i, j int) bool {
- return transactions[i].CreatedAt > transactions[j].CreatedAt
- })
-
- return transactions, nil
-}
-
-func (gs *GreenlightService) GetInfo(ctx context.Context) (info *lnclient.NodeInfo, err error) {
- nodeInfo, err := gs.client.GetInfo()
-
- if err != nil {
- logger.Logger.Errorf("GetInfo failed: %v", err)
- return nil, err
- }
-
- return &lnclient.NodeInfo{
- Alias: nodeInfo.Alias,
- Color: nodeInfo.Color,
- Pubkey: nodeInfo.Pubkey,
- Network: nodeInfo.Network,
- BlockHeight: nodeInfo.BlockHeight,
- BlockHash: "",
- }, nil
-}
-
-func (gs *GreenlightService) ListChannels(ctx context.Context) ([]lnclient.Channel, error) {
- response, err := gs.client.ListFunds(glalby.ListFundsRequest{})
-
- if err != nil {
- logger.Logger.Errorf("Failed to list funds: %v", err)
- return nil, err
- }
-
- channels := []lnclient.Channel{}
-
- for _, glChannel := range response.Channels {
- if glChannel.ChannelId == nil {
- continue
- }
-
- var localAmount uint64
- if glChannel.OurAmountMsat != nil {
- localAmount = *glChannel.OurAmountMsat
- }
- var totalAmount uint64
- if glChannel.AmountMsat != nil {
- totalAmount = *glChannel.AmountMsat
- }
-
- channels = append(channels, lnclient.Channel{
- LocalBalance: int64(localAmount),
- LocalSpendableBalance: int64(localAmount),
- RemoteBalance: int64(totalAmount - localAmount),
- RemotePubkey: glChannel.PeerId,
- Id: *glChannel.ChannelId,
- Active: glChannel.State == 2,
- FundingTxId: glChannel.FundingTxid,
- // TODO: add Public property
- })
- }
-
- return channels, nil
-}
-
-func (gs *GreenlightService) GetNodeConnectionInfo(ctx context.Context) (nodeConnectionInfo *lnclient.NodeConnectionInfo, err error) {
- info, err := gs.GetInfo(ctx)
- if err != nil {
- logger.Logger.Errorf("GetInfo failed: %v", err)
- return nil, err
- }
- return &lnclient.NodeConnectionInfo{
- Pubkey: info.Pubkey,
- }, nil
-}
-
-func (gs *GreenlightService) ConnectPeer(ctx context.Context, connectPeerRequest *lnclient.ConnectPeerRequest) error {
- var host *string
- if connectPeerRequest.Address != "" {
- host = &connectPeerRequest.Address
- }
- var port *uint16
- if connectPeerRequest.Port > 0 {
- port = &connectPeerRequest.Port
- }
- _, err := gs.client.ConnectPeer(glalby.ConnectPeerRequest{
- Id: connectPeerRequest.Pubkey,
- Host: host,
- Port: port,
- })
- if err != nil {
- logger.Logger.Errorf("ConnectPeer failed: %v", err)
- return err
- }
- return nil
-}
-
-func (gs *GreenlightService) OpenChannel(ctx context.Context, openChannelRequest *lnclient.OpenChannelRequest) (*lnclient.OpenChannelResponse, error) {
-
- amountMsat := uint64(openChannelRequest.AmountSats) * 1000
- // minConf := uint32(0) //
- response, err := gs.client.FundChannel(glalby.FundChannelRequest{
- Id: openChannelRequest.Pubkey,
- AmountMsat: &amountMsat,
- Announce: &openChannelRequest.Public,
- // Minconf: &minConf,
- })
- if err != nil {
- logger.Logger.Errorf("OpenChannel failed: %v", err)
- return nil, err
- }
-
- return &lnclient.OpenChannelResponse{
- FundingTxId: response.Txid,
- }, nil
-}
-
-func (gs *GreenlightService) CloseChannel(ctx context.Context, closeChannelRequest *lnclient.CloseChannelRequest) (*lnclient.CloseChannelResponse, error) {
- _, err := gs.client.Close(glalby.CloseRequest{
- Id: closeChannelRequest.ChannelId,
- })
- if err != nil {
- logger.Logger.WithError(err).Error("CloseChannel failed")
- return nil, err
- }
-
- return &lnclient.CloseChannelResponse{}, nil
-}
-
-func (gs *GreenlightService) GetNewOnchainAddress(ctx context.Context) (string, error) {
-
- newAddressResponse, err := gs.client.NewAddress(glalby.NewAddressRequest{})
- if err != nil {
- logger.Logger.Errorf("NewAddress failed: %v", err)
- return "", err
- }
- if newAddressResponse.Bech32 == nil {
- return "", errors.New("no Bech32 in new address response")
- }
-
- return *newAddressResponse.Bech32, nil
-}
-
-func (gs *GreenlightService) GetOnchainBalance(ctx context.Context) (*lnclient.OnchainBalanceResponse, error) {
- response, err := gs.client.ListFunds(glalby.ListFundsRequest{})
- logger.Logger.WithField("response", response).Debug("Listed funds")
-
- if err != nil {
- logger.Logger.Errorf("Failed to list funds: %v", err)
- return nil, err
- }
-
- var spendableBalance int64 = 0
- var pendingBalance int64 = 0
- for _, output := range response.Outputs {
- if output.AmountMsat != nil {
- if output.Status == 1 {
- spendableBalance += int64(*output.AmountMsat)
- } else {
- pendingBalance += int64(*output.AmountMsat)
- }
- }
- }
-
- return &lnclient.OnchainBalanceResponse{
- Spendable: spendableBalance / 1000,
- Total: (spendableBalance + pendingBalance) / 1000,
- }, nil
-}
-
-func (gs *GreenlightService) RedeemOnchainFunds(ctx context.Context, toAddress string, amount uint64, sendAll bool) (string, error) {
- if !sendAll {
- return "", errors.New("only send all is supported")
- }
- amountAll := glalby.AmountOrAll(glalby.AmountOrAllAll{})
- txId, err := gs.client.Withdraw(glalby.WithdrawRequest{
- Destination: toAddress,
- Amount: &amountAll,
- })
- if err != nil {
- logger.Logger.WithError(err).Error("Withdraw failed")
- return "", err
- }
- logger.Logger.WithField("txId", txId).Info("Redeeming On-Chain funds")
-
- return txId.Txid, nil
-}
-
-func (gs *GreenlightService) SendPaymentProbes(ctx context.Context, invoice string) error {
- return nil
-}
-
-func (gs *GreenlightService) SendSpontaneousPaymentProbes(ctx context.Context, amountMsat uint64, nodeId string) error {
- return nil
-}
-
-func (gs *GreenlightService) ListPeers(ctx context.Context) ([]lnclient.PeerDetails, error) {
- return nil, nil
-}
-
-func (gs *GreenlightService) GetLogOutput(ctx context.Context, maxLen int) ([]byte, error) {
- return []byte{}, nil
-}
-
-func (gs *GreenlightService) SignMessage(ctx context.Context, message string) (string, error) {
- response, err := gs.client.SignMessage(glalby.SignMessageRequest{
- Message: message,
- })
-
- if err != nil {
- logger.Logger.Errorf("SignMessage failed: %v", err)
- return "", err
- }
-
- return response.Zbase, nil
-}
-
-func (gs *GreenlightService) greenlightInvoiceToTransaction(invoice *glalby.ListInvoicesInvoice) (*lnclient.Transaction, error) {
- description := ""
- descriptionHash := ""
- if invoice.Description != nil {
- description = *invoice.Description
- }
- bolt11 := *invoice.Bolt11
- paymentRequest, err := decodepay.Decodepay(strings.ToLower(bolt11))
- if err != nil {
- logger.Logger.WithFields(logrus.Fields{
- "invoice": bolt11,
- }).Errorf("Failed to decode bolt11 invoice: %v", bolt11)
- return nil, err
- }
- if description == "" {
- description = paymentRequest.Description
- }
- descriptionHash = paymentRequest.DescriptionHash
-
- expiresAt := int64(invoice.ExpiresAt)
-
- var amount int64 = 0
- var fee int64 = 0
- if invoice.AmountReceivedMsat != nil {
- amount = int64(*invoice.AmountReceivedMsat)
- if invoice.AmountMsat != nil {
- fee = int64(*invoice.AmountMsat) - amount
- }
- }
-
- preimage := ""
- var settledAt *int64
- if invoice.PaidAt != nil {
- preimage = *invoice.PaymentPreimage
- paidAt := int64(*invoice.PaidAt)
- settledAt = &paidAt
- }
-
- transaction := &lnclient.Transaction{
- Type: "incoming",
- Invoice: bolt11,
- Description: description,
- DescriptionHash: descriptionHash,
- PaymentHash: invoice.PaymentHash,
- ExpiresAt: &expiresAt,
- Amount: amount,
- FeesPaid: fee,
- CreatedAt: int64(paymentRequest.CreatedAt),
- Preimage: preimage,
- SettledAt: settledAt,
- }
- return transaction, nil
-}
-
-func (gs *GreenlightService) ResetRouter(key string) error {
- return nil
-}
-
-func (gs *GreenlightService) GetBalances(ctx context.Context) (*lnclient.BalancesResponse, error) {
- onchainBalance, err := gs.GetOnchainBalance(ctx)
- if err != nil {
- logger.Logger.WithError(err).Error("Failed to retrieve onchain balance")
- return nil, err
- }
-
- response, err := gs.client.ListFunds(glalby.ListFundsRequest{})
-
- if err != nil {
- logger.Logger.Errorf("Failed to list funds: %v", err)
- return nil, err
- }
-
- var totalReceivable int64 = 0
- var totalSpendable int64 = 0
- var nextMaxReceivable int64 = 0
- var nextMaxSpendable int64 = 0
- var nextMaxReceivableMPP int64 = 0
- var nextMaxSpendableMPP int64 = 0
- for _, channel := range response.Channels {
- if channel.OurAmountMsat != nil && channel.AmountMsat != nil && channel.Connected {
-
- channelReceivable := int64(*channel.AmountMsat - *channel.OurAmountMsat)
- channelSpendable := int64(*channel.OurAmountMsat)
-
- nextMaxReceivable = max(nextMaxReceivable, channelReceivable)
- nextMaxSpendable = max(nextMaxSpendable, channelSpendable)
-
- nextMaxReceivableMPP += channelReceivable
- nextMaxSpendableMPP += channelSpendable
-
- totalReceivable += channelReceivable
- totalSpendable += channelSpendable
- }
- }
-
- return &lnclient.BalancesResponse{
- Onchain: *onchainBalance,
- Lightning: lnclient.LightningBalanceResponse{
- TotalSpendable: totalSpendable,
- TotalReceivable: totalReceivable,
- NextMaxSpendable: nextMaxSpendable,
- NextMaxReceivable: nextMaxReceivable,
- NextMaxSpendableMPP: nextMaxSpendableMPP,
- NextMaxReceivableMPP: nextMaxReceivableMPP,
- },
- }, nil
-
-}
-
-func (gs *GreenlightService) GetStorageDir() (string, error) {
- return "", nil
-}
-
-func (gs *GreenlightService) GetNodeStatus(ctx context.Context) (nodeStatus *lnclient.NodeStatus, err error) {
- return &lnclient.NodeStatus{
- IsReady: true,
- }, nil
-}
-
-func (gs *GreenlightService) GetNetworkGraph(ctx context.Context, nodeIds []string) (lnclient.NetworkGraphResponse, error) {
- return nil, nil
-}
-
-func (gs *GreenlightService) UpdateLastWalletSyncRequest() {}
-
-func (gs *GreenlightService) UpdateChannel(ctx context.Context, updateChannelRequest *lnclient.UpdateChannelRequest) error {
- return nil
-}
-
-func (gs *GreenlightService) DisconnectPeer(ctx context.Context, peerId string) error {
- return nil
-}
-
-func (gs *GreenlightService) GetSupportedNIP47Methods() []string {
- return []string{"pay_invoice" /*"pay_keysend",*/, "get_balance", "get_budget", "get_info", "make_invoice", "lookup_invoice", "list_transactions", "multi_pay_invoice", "multi_pay_keysend", "sign_message"}
-}
-
-func (gs *GreenlightService) GetSupportedNIP47NotificationTypes() []string {
- return []string{}
-}
-
-func (gs *GreenlightService) GetPubkey() string {
- return gs.pubkey
-}
-
-func (gs *GreenlightService) GetCustomNodeCommandDefinitions() []lnclient.CustomNodeCommandDef {
- return nil
-}
-
-func (gs *GreenlightService) ExecuteCustomNodeCommand(ctx context.Context, command *lnclient.CustomNodeCommandRequest) (*lnclient.CustomNodeCommandResponse, error) {
- return nil, nil
-}
diff --git a/service/start.go b/service/start.go
index fd72ff5f..cb50dfab 100644
--- a/service/start.go
+++ b/service/start.go
@@ -17,9 +17,7 @@ import (
"github.com/getAlby/hub/config"
"github.com/getAlby/hub/events"
"github.com/getAlby/hub/lnclient"
- "github.com/getAlby/hub/lnclient/breez"
"github.com/getAlby/hub/lnclient/cashu"
- "github.com/getAlby/hub/lnclient/greenlight"
"github.com/getAlby/hub/lnclient/ldk"
"github.com/getAlby/hub/lnclient/lnd"
"github.com/getAlby/hub/lnclient/phoenixd"
@@ -328,19 +326,6 @@ func (svc *service) launchLNBackend(ctx context.Context, encryptionKey string) e
svc.startupState = startupState
}
lnClient, err = ldk.NewLDKService(ctx, svc.cfg, svc.eventPublisher, mnemonic, ldkWorkdir, svc.cfg.GetEnv().LDKNetwork, vssToken, setStartupState)
- case config.GreenlightBackendType:
- Mnemonic, _ := svc.cfg.Get("Mnemonic", encryptionKey)
- GreenlightInviteCode, _ := svc.cfg.Get("GreenlightInviteCode", encryptionKey)
- GreenlightWorkdir := path.Join(svc.cfg.GetEnv().Workdir, "greenlight")
-
- lnClient, err = greenlight.NewGreenlightService(svc.cfg, Mnemonic, GreenlightInviteCode, GreenlightWorkdir, encryptionKey)
- case config.BreezBackendType:
- Mnemonic, _ := svc.cfg.Get("Mnemonic", encryptionKey)
- BreezAPIKey, _ := svc.cfg.Get("BreezAPIKey", encryptionKey)
- GreenlightInviteCode, _ := svc.cfg.Get("GreenlightInviteCode", encryptionKey)
- BreezWorkdir := path.Join(svc.cfg.GetEnv().Workdir, "breez")
-
- lnClient, err = breez.NewBreezService(Mnemonic, BreezAPIKey, GreenlightInviteCode, BreezWorkdir)
case config.PhoenixBackendType:
PhoenixdAddress, _ := svc.cfg.Get("PhoenixdAddress", encryptionKey)
PhoenixdAuthorization, _ := svc.cfg.Get("PhoenixdAuthorization", encryptionKey)