Skip to content
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

Minor asset loop out fixes #876

Merged
merged 4 commits into from
Jan 22, 2025
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
looprpc: rename assetamt to max amt
  • Loading branch information
sputn1ck committed Jan 22, 2025
commit fddad8a964b6f4ef43bd161f66531b295b8eb530
10 changes: 5 additions & 5 deletions client.go
Original file line number Diff line number Diff line change
@@ -703,11 +703,11 @@ func (s *Client) LoopOutQuote(ctx context.Context,
}

loopOutQuote.LoopOutRfq = &LoopOutRfq{
PrepayRfqId: prepayRfq.Id,
PrepayAssetAmt: prepayRfq.AssetAmount,
SwapRfqId: swapRfq.Id,
SwapAssetAmt: swapRfq.AssetAmount,
AssetName: assetName,
PrepayRfqId: prepayRfq.Id,
MaxPrepayAssetAmt: prepayRfq.AssetAmount,
SwapRfqId: swapRfq.Id,
MaxSwapAssetAmt: swapRfq.AssetAmount,
AssetName: assetName,
}
}

4 changes: 2 additions & 2 deletions cmd/loop/quote.go
Original file line number Diff line number Diff line change
@@ -269,7 +269,7 @@ func printQuoteOutResp(req *looprpc.QuoteRequest,

if resp.AssetRfqInfo != nil {
fmt.Printf(assetAmtFmt, "Send off-chain:",
resp.AssetRfqInfo.SwapAssetAmt,
resp.AssetRfqInfo.MaxSwapAssetAmt,
resp.AssetRfqInfo.AssetName)
} else {
fmt.Printf(satAmtFmt, "Send off-chain:", req.Amt)
@@ -289,7 +289,7 @@ func printQuoteOutResp(req *looprpc.QuoteRequest,
fmt.Println()
if resp.AssetRfqInfo != nil {
fmt.Printf(assetAmtFmt, "No show penalty (prepay):",
resp.AssetRfqInfo.PrepayAssetAmt,
resp.AssetRfqInfo.MaxPrepayAssetAmt,
resp.AssetRfqInfo.AssetName)
} else {
fmt.Printf(satAmtFmt, "No show penalty (prepay):",
12 changes: 6 additions & 6 deletions interface.go
Original file line number Diff line number Diff line change
@@ -224,16 +224,16 @@ type LoopOutRfq struct {
// PrepayRfqId is the ID of the prepay RFQ.
PrepayRfqId []byte

// PrepayAssetAmt is the amount of the asset that will be used to pay
// for the prepay invoice.
PrepayAssetAmt uint64
// MaxPrepayAssetAmt is the maximum amount of the asset that will be
// used to pay for the prepay invoice.
MaxPrepayAssetAmt uint64

// SwapRfqId is the ID of the swap RFQ.
SwapRfqId []byte

// SwapAssetAmt is the amount of the asset that will be used to pay for
// the swap invoice.
SwapAssetAmt uint64
// MaxSwapAssetAmt is the maximum amount of the asset that will be used
// to pay for the swap invoice.
MaxSwapAssetAmt uint64

// AssetName is the human readable name of the asset.
AssetName string
10 changes: 5 additions & 5 deletions loopd/swapclient_server.go
Original file line number Diff line number Diff line change
@@ -802,11 +802,11 @@ func (s *swapClientServer) LoopOutQuote(ctx context.Context,

if quote.LoopOutRfq != nil {
response.AssetRfqInfo = &looprpc.AssetRfqInfo{
PrepayRfqId: quote.LoopOutRfq.PrepayRfqId,
PrepayAssetAmt: quote.LoopOutRfq.PrepayAssetAmt,
SwapRfqId: quote.LoopOutRfq.SwapRfqId,
SwapAssetAmt: quote.LoopOutRfq.SwapAssetAmt,
AssetName: quote.LoopOutRfq.AssetName,
PrepayRfqId: quote.LoopOutRfq.PrepayRfqId,
MaxPrepayAssetAmt: quote.LoopOutRfq.MaxPrepayAssetAmt,
SwapRfqId: quote.LoopOutRfq.SwapRfqId,
MaxSwapAssetAmt: quote.LoopOutRfq.MaxSwapAssetAmt,
AssetName: quote.LoopOutRfq.AssetName,
}
}

541 changes: 272 additions & 269 deletions looprpc/client.pb.go

Large diffs are not rendered by default.

10 changes: 6 additions & 4 deletions looprpc/client.proto
Original file line number Diff line number Diff line change
@@ -2066,19 +2066,21 @@ message AssetRfqInfo {
bytes prepay_rfq_id = 1;

/*
The actual asset amt to prepay for the swap invoice.
The maximum asset amt we'll pay for the prepay payment. This includes the
max limit multiplier that was set in the request.
*/
uint64 prepay_asset_amt = 2;
uint64 max_prepay_asset_amt = 2;

/*
The Swap RFQ ID to use to pay for the swap invoice.
*/
bytes swap_rfq_id = 3;

/*
The actual asset amt to swap for the swap invoice.
The maximum asset amt we'll pay for the swap payment. This includes the
max limit multiplier that was set in the request.
*/
uint64 swap_asset_amt = 4;
uint64 max_swap_asset_amt = 4;

/*
The name of the asset to swap.
8 changes: 4 additions & 4 deletions looprpc/client.swagger.json
Original file line number Diff line number Diff line change
@@ -731,20 +731,20 @@
"format": "byte",
"description": "The Prepay RFQ ID to use to pay for the prepay invoice."
},
"prepay_asset_amt": {
"max_prepay_asset_amt": {
"type": "string",
"format": "uint64",
"description": "The actual asset amt to prepay for the swap invoice."
"description": "The maximum asset amt we'll pay for the prepay payment. This includes the\nmax limit multiplier that was set in the request."
},
"swap_rfq_id": {
"type": "string",
"format": "byte",
"description": "The Swap RFQ ID to use to pay for the swap invoice."
},
"swap_asset_amt": {
"max_swap_asset_amt": {
"type": "string",
"format": "uint64",
"description": "The actual asset amt to swap for the swap invoice."
"description": "The maximum asset amt we'll pay for the swap payment. This includes the\nmax limit multiplier that was set in the request."
},
"asset_name": {
"type": "string",