@@ -37,6 +37,7 @@ import (
3737 "github.com/lightninglabs/taproot-assets/rfqmsg"
3838 "github.com/lightninglabs/taproot-assets/rpcperms"
3939 "github.com/lightninglabs/taproot-assets/tapchannel"
40+ "github.com/lightninglabs/taproot-assets/tapdb"
4041 "github.com/lightninglabs/taproot-assets/tapfreighter"
4142 "github.com/lightninglabs/taproot-assets/tapgarden"
4243 "github.com/lightninglabs/taproot-assets/tappsbt"
@@ -3290,7 +3291,7 @@ func (r *rpcServer) BurnAsset(ctx context.Context,
32903291 resp , err := r .cfg .ChainPorter .RequestShipment (
32913292 tapfreighter .NewPreSignedParcel (
32923293 []* tappsbt.VPacket {fundResp .VPacket },
3293- fundResp .InputCommitments , "" ,
3294+ fundResp .InputCommitments , in . Note ,
32943295 ),
32953296 )
32963297 if err != nil {
@@ -3328,6 +3329,40 @@ func (r *rpcServer) BurnAsset(ctx context.Context,
33283329 }, nil
33293330}
33303331
3332+ // ListBurns returns a list of burnt assets. Some filters may be defined in the
3333+ // request to return more specific results.
3334+ func (r * rpcServer ) ListBurns (ctx context.Context ,
3335+ in * taprpc.ListBurnsRequest ) (* taprpc.ListBurnsResponse , error ) {
3336+
3337+ burns , err := r .cfg .AssetStore .QueryBurns (
3338+ ctx , tapdb.QueryBurnsFilters {
3339+ AssetID : in .AssetId ,
3340+ GroupKey : in .TweakedGroupKey ,
3341+ AnchorTxid : in .AnchorTxid ,
3342+ },
3343+ )
3344+ if err != nil {
3345+ return nil , err
3346+ }
3347+
3348+ rpcBurns := fn .Map (burns , marshalRpcBurn )
3349+
3350+ return & taprpc.ListBurnsResponse {
3351+ Burns : rpcBurns ,
3352+ }, nil
3353+ }
3354+
3355+ // marshalRpcBurn creates an instance of *taprpc.AssetBurn from the tapdb model.
3356+ func marshalRpcBurn (b * tapfreighter.AssetBurn ) * taprpc.AssetBurn {
3357+ return & taprpc.AssetBurn {
3358+ Note : b .Note ,
3359+ AssetId : b .AssetID ,
3360+ TweakedGroupKey : b .GroupKey ,
3361+ Amount : b .Amount ,
3362+ AnchorTxid : b .AnchorTxid [:],
3363+ }
3364+ }
3365+
33313366// marshalOutboundParcel turns a pending parcel into its RPC counterpart.
33323367func marshalOutboundParcel (
33333368 parcel * tapfreighter.OutboundParcel ) (* taprpc.AssetTransfer ,
0 commit comments