Skip to content

Commit

Permalink
taprpc/tapchannelrpc: add new DecodeAssetPayReq command
Browse files Browse the repository at this point in the history
  • Loading branch information
Roasbeef committed Dec 13, 2024
1 parent 35d8f1c commit 12d0248
Show file tree
Hide file tree
Showing 7 changed files with 865 additions and 162 deletions.
536 changes: 374 additions & 162 deletions taprpc/tapchannelrpc/tapchannel.pb.go

Large diffs are not rendered by default.

85 changes: 85 additions & 0 deletions taprpc/tapchannelrpc/tapchannel.pb.gw.go

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

35 changes: 35 additions & 0 deletions taprpc/tapchannelrpc/tapchannel.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ option go_package = "github.com/lightninglabs/taproot-assets/taprpc/tapchannelrp
import "rfqrpc/rfq.proto";
import "lightning.proto";
import "routerrpc/router.proto";
import "taprootassets.proto";

service TaprootAssetChannels {
/*
Expand Down Expand Up @@ -39,6 +40,13 @@ service TaprootAssetChannels {
to the specified asset amount.
*/
rpc AddInvoice (AddInvoiceRequest) returns (AddInvoiceResponse);

/*
DecodeAssetPayReq is similar to lnd's lnrpc.DecodePayReq, but it accepts
an asset ID and returns the invoice amount expressed in asset units along
side the normal information.
*/
rpc DecodeAssetPayReq (AssetPayReqString) returns (AssetPayReq);
}

message FundChannelRequest {
Expand Down Expand Up @@ -181,3 +189,30 @@ message AddInvoiceResponse {
// The result of the invoice creation.
lnrpc.AddInvoiceResponse invoice_result = 2;
}

message AssetPayReqString {
// The asset ID that will be used to resolve the invoice's satoshi amount.
bytes asset_id = 1;

// The normal LN invoice that whose amount will be mapped to units of the
// asset ID.
lnrpc.PayReqString pay_req_string = 2;
}

message AssetPayReq {
// The invoice amount, expressed in sats.
uint64 asset_amount = 1;

// The decimal display corresponding to the asset_id.
taprpc.DecimalDisplay decimal_display = 2;

// The group the asset ID belong to, if applicable.
taprpc.AssetGroup asset_group = 3;

// Genesis information for the asset ID which includes the meta hash, and
// asset ID.
taprpc.GenesisInfo genesis_info = 4;

// The normal decoded payment request.
lnrpc.PayReq pay_req = 5;
}
Loading

0 comments on commit 12d0248

Please sign in to comment.