-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
expose reverse swap fees #1127
base: main
Are you sure you want to change the base?
expose reverse swap fees #1127
Conversation
The `send_onchain` function was deprecated since SDK version 0.3.6. It has been replaced with `pay_onchain`. Removed deprecated functions: - `send_onchain`, has replacement `pay_onchain` - `max_reverse_swap_amount` has replacement `onchain_payment_limits` - `on_progress_reverse_swaps` has replacement `in_progress_onchain_payments`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One small comment, otherwise LGTM.
invoice: response.invoice, | ||
preimage: reverse_swap_keys.preimage, | ||
private_key: reverse_swap_keys.priv_key, | ||
timeout_block_height: response.timeout_block_height, | ||
id: response.id, | ||
onchain_amount_sat: response.onchain_amount, | ||
sat_per_vbyte, | ||
receive_amount_sat, | ||
sat_per_vbyte: None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we remove now the sat_per_vbyte from the struct?
@@ -602,7 +602,7 @@ dictionary PrepareOnchainPaymentResponse { | |||
f64 fees_percentage; | |||
u64 fees_lockup; | |||
u64 fees_claim; | |||
|
|||
u64 fees_service; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fees_percentage
above and the new fees_service
refer to the same thing. Wouldn't one have to go, to avoid confusing the user?
u64 fees_lockup; | ||
u64 fees_claim; | ||
u64 fees_service; | ||
u64 total_fees; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To keep with the other 3 new fields, maybe fees_total
is better?
ALTER TABLE reverse_swaps ADD column fees_lockup INTEGER DEFAULT 0; | ||
ALTER TABLE reverse_swaps ADD column fees_claim INTEGER DEFAULT 0; | ||
ALTER TABLE reverse_swaps ADD column fees_service INTEGER DEFAULT 0; | ||
ALTER TABLE reverse_swaps ADD column total_fees INTEGER DEFAULT 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the udl
doesn't treat them as optional, maybe INTEGER NOT NULL DEFAULT 0
is more appropriate?
Expose the lockup/claim/service fees from reverse swaps.
Historical fees are currently not backfilled. So this currently only works for new swaps.
The fees are synced with the remote.
If the fees cannot be found, they're set to 0.
Fixes #1111
Builds on top of #1125