Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 61 additions & 8 deletions rpc/swapclientrpc/swap_client.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions rpc/swapclientrpc/swap_client.proto
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,16 @@ message QuotePayResponse {
bool exceeds_max_fee = 7;

CreditQuote credit_quote = 8;

// server_fee_sat is the service fee retained by the swap server.
uint64 server_fee_sat = 9;

// estimated_routing_fee_sat is the current whole-satoshi route estimate.
uint64 estimated_routing_fee_sat = 10;

// routing_fee_budget_sat is the client-funded Lightning routing allowance
// that would be charged into the vHTLC as part of fee_sat.
uint64 routing_fee_budget_sat = 11;
}

message StartPayRequest {
Expand Down Expand Up @@ -429,4 +439,11 @@ message SwapSummary {
// available_credit_sat is the balance considered when the receive route was
// planned.
uint64 available_credit_sat = 26;

// server_fee_sat is the service fee retained by the swap server.
uint64 server_fee_sat = 27;

// routing_fee_budget_sat is the client-funded Lightning routing
// allowance charged into the vHTLC as part of fee_sat.
uint64 routing_fee_budget_sat = 28;
}
39 changes: 35 additions & 4 deletions rpc/wavewalletrpc/wallet.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions rpc/wavewalletrpc/wallet.proto
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,16 @@ message PrepareSendResponse {
// credit_preview is populated when the invoice send will or can use
// sat-native server credits.
CreditPreview credit_preview = 15;

// server_fee_sat is the service fee retained by the swap server.
uint64 server_fee_sat = 16;

// estimated_routing_fee_sat is the current whole-satoshi route estimate.
uint64 estimated_routing_fee_sat = 17;

// routing_fee_budget_sat is the client-funded Lightning routing allowance
// that Send would charge into the vHTLC as part of fee_sat.
uint64 routing_fee_budget_sat = 18;
}

// SendRequest dispatches a previously prepared send by consuming the
Expand Down
40 changes: 40 additions & 0 deletions sdk/swaps/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ type CreditQuote struct {
ArkFundingSat uint64
}

// AllAvailableCredit authorizes the server to consider the caller's complete
// available credit balance.
const AllAvailableCredit = ^uint64(0)

// CreditFundingSource identifies how value enters a credit account.
type CreditFundingSource string

Expand Down Expand Up @@ -191,6 +195,13 @@ type SwapSummary struct {
// FeeSat is the negotiated swap-server fee in satoshis when known.
FeeSat uint64

// ServerFeeSat is the service fee retained by the swap server.
ServerFeeSat uint64

// RoutingFeeBudgetSat is the client-funded Lightning routing
// allowance included in FeeSat.
RoutingFeeBudgetSat uint64

// PayerFeeMsat is the payer-paid Lightning route fee quoted for
// receive swaps. It is not deducted from AmountSat.
PayerFeeMsat uint64
Expand Down Expand Up @@ -622,6 +633,13 @@ type InSwapConfig struct {
// for this swap.
FeeSat uint64

// ServerFeeSat is the service fee retained by the swap server.
ServerFeeSat uint64

// RoutingFeeBudgetSat is the client-funded Lightning routing
// allowance included in FeeSat.
RoutingFeeBudgetSat uint64

// ServerPubkey is the swap server's public key for this swap
// instance.
ServerPubkey *btcec.PublicKey
Expand Down Expand Up @@ -664,6 +682,17 @@ type InSwapQuote struct {
// FeeSat is the fee in satoshis charged by the swap server.
FeeSat uint64

// ServerFeeSat is the service fee retained by the swap server.
ServerFeeSat uint64

// EstimatedRoutingFeeSat is the server's current whole-satoshi route
// estimate.
EstimatedRoutingFeeSat uint64

// RoutingFeeBudgetSat is the Lightning routing allowance that would be
// included in FeeSat.
RoutingFeeBudgetSat uint64

// Expiry is the wall-clock deadline by which the quoted swap must
// complete before it is considered stale.
Expiry time.Time
Expand All @@ -680,6 +709,17 @@ type InSwapQuote struct {
CreditQuote *CreditQuote
}

// InSwapOptions contains caller-controlled fee and credit limits for an
// Ark-to-Lightning payment.
type InSwapOptions struct {
// MaxFeeSat is the maximum total fee the caller accepts.
MaxFeeSat uint64

// MaxCreditSat is the maximum credit amount the caller authorizes.
// MaxUint64 requests a quote using all available credit.
MaxCreditSat uint64
}

// SwapServerConn abstracts the connection to the swap server's
// gRPC service. This allows the client to talk to the swap server
// without importing the server module.
Expand Down
Loading
Loading