@@ -37,6 +37,7 @@ import (
37
37
"github.com/lightninglabs/taproot-assets/rfqmsg"
38
38
"github.com/lightninglabs/taproot-assets/rpcperms"
39
39
"github.com/lightninglabs/taproot-assets/tapchannel"
40
+ "github.com/lightninglabs/taproot-assets/tapdb"
40
41
"github.com/lightninglabs/taproot-assets/tapfreighter"
41
42
"github.com/lightninglabs/taproot-assets/tapgarden"
42
43
"github.com/lightninglabs/taproot-assets/tappsbt"
@@ -953,8 +954,13 @@ func (r *rpcServer) ListAssets(ctx context.Context,
953
954
}
954
955
955
956
rpcAssets , err := r .fetchRpcAssets (
956
- ctx , req .WithWitness , req .IncludeSpent , req .IncludeLeased ,
957
+ ctx ,
958
+ req .WithWitness ,
959
+ req .IncludeSpent ,
960
+ req .IncludeLeased ,
961
+ req .MinAmount ,
957
962
)
963
+
958
964
if err != nil {
959
965
return nil , err
960
966
}
@@ -1007,10 +1013,20 @@ func (r *rpcServer) ListAssets(ctx context.Context,
1007
1013
}
1008
1014
1009
1015
func (r * rpcServer ) fetchRpcAssets (ctx context.Context , withWitness ,
1010
- includeSpent , includeLeased bool ) ([]* taprpc.Asset , error ) {
1016
+ includeSpent , includeLeased bool ,
1017
+ minAmountFilter uint64 ) ([]* taprpc.Asset , error ) {
1018
+
1019
+ constraints := tapfreighter.CommitmentConstraints {
1020
+ CoinSelectType : tapsend .ScriptTreesAllowed ,
1021
+ MinAmt : minAmountFilter ,
1022
+ }
1023
+
1024
+ filters := & tapdb.AssetQueryFilters {
1025
+ CommitmentConstraints : constraints ,
1026
+ }
1011
1027
1012
1028
assets , err := r .cfg .AssetStore .FetchAllAssets (
1013
- ctx , includeSpent , includeLeased , nil ,
1029
+ ctx , includeSpent , includeLeased , filters ,
1014
1030
)
1015
1031
if err != nil {
1016
1032
return nil , fmt .Errorf ("unable to read chain assets: %w" , err )
@@ -1161,7 +1177,10 @@ func (r *rpcServer) listBalancesByGroupKey(ctx context.Context,
1161
1177
func (r * rpcServer ) ListUtxos (ctx context.Context ,
1162
1178
req * taprpc.ListUtxosRequest ) (* taprpc.ListUtxosResponse , error ) {
1163
1179
1164
- rpcAssets , err := r .fetchRpcAssets (ctx , false , false , req .IncludeLeased )
1180
+ rpcAssets , err := r .fetchRpcAssets (
1181
+ ctx , false , false , req .IncludeLeased , 0 ,
1182
+ )
1183
+
1165
1184
if err != nil {
1166
1185
return nil , err
1167
1186
}
0 commit comments