diff --git a/rpcserver.go b/rpcserver.go index 092b48bf9..78b955da9 100644 --- a/rpcserver.go +++ b/rpcserver.go @@ -963,7 +963,7 @@ func (r *rpcServer) ListAssets(ctx context.Context, } rpcAssets, err := r.fetchRpcAssets( - ctx, req.WithWitness, req.IncludeSpent, req.IncludeLeased, + ctx, req.WithWitness, req.IncludeSpent, req.IncludeLeased, req.MinAmount ) if err != nil { return nil, err @@ -1017,10 +1017,14 @@ func (r *rpcServer) ListAssets(ctx context.Context, } func (r *rpcServer) fetchRpcAssets(ctx context.Context, withWitness, - includeSpent, includeLeased bool) ([]*taprpc.Asset, error) { + includeSpent, includeLeased bool, minAmountFilter) ([]*taprpc.Asset, error) { + + filters := &AssetQueryFilters{ + MinAmt: minAmountFilter + } assets, err := r.cfg.AssetStore.FetchAllAssets( - ctx, includeSpent, includeLeased, nil, + ctx, includeSpent, includeLeased, filters, ) if err != nil { return nil, fmt.Errorf("unable to read chain assets: %w", err) diff --git a/taprpc/taprootassets.proto b/taprpc/taprootassets.proto index f591082b7..3581db94d 100644 --- a/taprpc/taprootassets.proto +++ b/taprpc/taprootassets.proto @@ -189,6 +189,21 @@ message ListAssetRequest { // confirmed (check either transfers or receives for unconfirmed outbound or // inbound assets). bool include_unconfirmed_mints = 4; + + // Only return assets with amount greater or equal to this value + uint64 min_amount = 5; + + // Only return assets with amount less or equal to this value + uint64 max_amount = 6; + + // Only return assets that belong to the group with this key + bytes group_key = 7; + + // Return all assets that use this script key + bytes script_key = 8; + + // Return all assets that are currently anchored on this outpoint + string anchor_outpoint = 9; } message AnchorInfo {