diff --git a/api/api.go b/api/api.go
index da75b8180..82906c5e8 100644
--- a/api/api.go
+++ b/api/api.go
@@ -997,7 +997,7 @@ func (api *api) GetSwapOutInfo() (*SwapInfoResponse, error) {
}, nil
}
-func (api *api) InitiateSwapOut(ctx context.Context, initiateSwapOutRequest *InitiateSwapRequest) (*swaps.SwapResponse, error) {
+func (api *api) InitiateSwapOut(ctx context.Context, initiateSwapOutRequest *InitiateSwapOutRequest) (*swaps.SwapResponse, error) {
lnClient := api.svc.GetLNClient()
if lnClient == nil {
return nil, ErrLNClientNotStarted
@@ -1030,7 +1030,7 @@ func (api *api) InitiateSwapOut(ctx context.Context, initiateSwapOutRequest *Ini
return swapOutResponse, nil
}
-func (api *api) InitiateSwapIn(ctx context.Context, initiateSwapInRequest *InitiateSwapRequest) (*swaps.SwapResponse, error) {
+func (api *api) InitiateSwapIn(ctx context.Context, initiateSwapInRequest *InitiateSwapInRequest) (*swaps.SwapResponse, error) {
lnClient := api.svc.GetLNClient()
if lnClient == nil {
return nil, ErrLNClientNotStarted
@@ -1050,10 +1050,11 @@ func (api *api) InitiateSwapIn(ctx context.Context, initiateSwapInRequest *Initi
return nil, errors.New("invalid swap amount")
}
- swapInResponse, err := api.svc.GetSwapsService().SwapIn(amountSat, false)
+ swapInResponse, err := api.svc.GetSwapsService().SwapIn(amountSat, false, initiateSwapInRequest.InternalPayment, initiateSwapInRequest.FeeRate)
if err != nil {
logger.Logger.WithFields(logrus.Fields{
- "amount_sat": amountSat,
+ "amount_sat": amountSat,
+ "internal_payment": initiateSwapInRequest.InternalPayment,
}).WithError(err).Error("Failed to initiate swap in")
return nil, err
}
diff --git a/api/models.go b/api/models.go
index 5448465dc..023ecfb92 100644
--- a/api/models.go
+++ b/api/models.go
@@ -69,8 +69,8 @@ type API interface {
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)
+ InitiateSwapIn(ctx context.Context, initiateSwapInRequest *InitiateSwapInRequest) (*swaps.SwapResponse, error)
+ InitiateSwapOut(ctx context.Context, initiateSwapOutRequest *InitiateSwapOutRequest) (*swaps.SwapResponse, error)
RefundSwap(refundSwapRequest *RefundSwapRequest) error
GetSwapMnemonic() string
GetAutoSwapConfig() (*GetAutoSwapConfigResponse, error)
@@ -168,7 +168,14 @@ type CreateLightningAddressRequest struct {
AppId uint `json:"appId"`
}
-type InitiateSwapRequest struct {
+type InitiateSwapInRequest struct {
+ SwapAmount *uint64 `json:"swapAmount"` // deprecated
+ SwapAmountSat *uint64 `json:"swapAmountSat"`
+ InternalPayment bool `json:"internalPayment"`
+ FeeRate *uint64 `json:"feeRate"`
+}
+
+type InitiateSwapOutRequest struct {
SwapAmount *uint64 `json:"swapAmount"` // deprecated
SwapAmountSat *uint64 `json:"swapAmountSat"`
Destination string `json:"destination"`
@@ -304,38 +311,38 @@ type InfoResponseRelay struct {
}
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"`
- ChainDataSourceType string `json:"chainDataSourceType,omitempty"`
- ChainDataSourceAddress string `json:"chainDataSourceAddress,omitempty"`
- JitChannelsLiquiditySource string `json:"jitChannelsLiquiditySource,omitempty"`
- JitChannelsMinPaymentSizeMsat *uint64 `json:"jitChannelsMinPaymentSizeMsat,omitempty"`
- JitChannelsMaxPaymentSizeMsat *uint64 `json:"jitChannelsMaxPaymentSizeMsat,omitempty"`
- JitChannelsEnabled bool `json:"jitChannelsEnabled"`
- HideUpdateBanner bool `json:"hideUpdateBanner"`
- SupportsBolt12 bool `json:"supportsBolt12"`
+ 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"`
+ ChainDataSourceType string `json:"chainDataSourceType,omitempty"`
+ ChainDataSourceAddress string `json:"chainDataSourceAddress,omitempty"`
+ JitChannelsLiquiditySource string `json:"jitChannelsLiquiditySource,omitempty"`
+ JitChannelsMinPaymentSizeMsat *uint64 `json:"jitChannelsMinPaymentSizeMsat,omitempty"`
+ JitChannelsMaxPaymentSizeMsat *uint64 `json:"jitChannelsMaxPaymentSizeMsat,omitempty"`
+ JitChannelsEnabled bool `json:"jitChannelsEnabled"`
+ HideUpdateBanner bool `json:"hideUpdateBanner"`
+ SupportsBolt12 bool `json:"supportsBolt12"`
}
type UpdateSettingsRequest struct {
diff --git a/frontend/src/components/CloseChannelDialogContent.tsx b/frontend/src/components/CloseChannelDialogContent.tsx
index 91145b140..5e3c0668a 100644
--- a/frontend/src/components/CloseChannelDialogContent.tsx
+++ b/frontend/src/components/CloseChannelDialogContent.tsx
@@ -94,7 +94,7 @@ export function CloseChannelDialogContent({ alias, channel }: Props) {
Are you sure you want to close the channel with {alias}?
This amount includes cost for the channel opening and potential - channel onchain reserves. + channel on-chain reserves.
- You currently don't have enough sats to pay for an onchain transaction. + You currently don't have enough sats to pay for an on-chain transaction.
); } @@ -174,12 +149,12 @@ export default function WithdrawOnchainFunds() {- Your on-chain balance will be withdrawn to the onchain bitcoin wallet + Your on-chain balance will be withdrawn to the on-chain bitcoin wallet address you specify below.