@@ -23,13 +23,15 @@ import { RedeemTokensDto } from '~/assets/dto/redeem-tokens.dto';
23
23
import { RequiredMediatorsDto } from '~/assets/dto/required-mediators.dto' ;
24
24
import { SetAssetDocumentsDto } from '~/assets/dto/set-asset-documents.dto' ;
25
25
import { SetTransferRestrictionsDto } from '~/assets/dto/transfer-restrictions/set-transfer-restrictions.dto' ;
26
+ import { VenueIdsDto } from '~/assets/dto/venue-ids.dto' ;
26
27
import { AgentOperationModel } from '~/assets/models/agent-operation.model' ;
27
28
import { AssetDetailsModel } from '~/assets/models/asset-details.model' ;
28
29
import { AssetDocumentModel } from '~/assets/models/asset-document.model' ;
29
30
import { CreatedAssetModel } from '~/assets/models/created-asset.model' ;
30
31
import { IdentityBalanceModel } from '~/assets/models/identity-balance.model' ;
31
32
import { RequiredMediatorsModel } from '~/assets/models/required-mediators.model' ;
32
33
import { TransferRestrictionsValueModel } from '~/assets/models/transfer-restrictions-values.model' ;
34
+ import { VenueFilteringDetailsModel } from '~/assets/models/venue-filtering-details.model' ;
33
35
import { authorizationRequestResolver } from '~/authorizations/authorizations.util' ;
34
36
import { CreatedAuthorizationRequestModel } from '~/authorizations/models/created-authorization-request.model' ;
35
37
import {
@@ -233,6 +235,121 @@ export class AssetsController {
233
235
return handleServiceResult ( result ) ;
234
236
}
235
237
238
+ @ApiOperation ( {
239
+ summary : 'Enable venue filtering for an Asset' ,
240
+ description :
241
+ 'When enabled, only explicitly allowed venues can create instructions for the Asset' ,
242
+ } )
243
+ @ApiParam ( {
244
+ name : 'asset' ,
245
+ description : 'The Asset (Ticker/Asset ID) whose venue filtering will be enabled' ,
246
+ type : 'string' ,
247
+ } )
248
+ @ApiTransactionResponse ( {
249
+ description : 'Details of the transaction' ,
250
+ type : TransactionQueueModel ,
251
+ } )
252
+ @Post ( ':asset/venue-filtering/enable' )
253
+ public async enableVenueFiltering (
254
+ @Param ( ) { asset } : AssetParamsDto ,
255
+ @Body ( ) transactionBaseDto : TransactionBaseDto
256
+ ) : Promise < TransactionResponseModel > {
257
+ const result = await this . assetsService . enableVenueFiltering ( asset , transactionBaseDto ) ;
258
+
259
+ return handleServiceResult ( result ) ;
260
+ }
261
+
262
+ @ApiOperation ( {
263
+ summary : 'Disable venue filtering for an Asset' ,
264
+ description : 'When disabled, any venue can create instructions for the Asset' ,
265
+ } )
266
+ @ApiParam ( {
267
+ name : 'asset' ,
268
+ description : 'The Asset (Ticker/Asset ID) whose venue filtering will be disabled' ,
269
+ type : 'string' ,
270
+ } )
271
+ @ApiTransactionResponse ( {
272
+ description : 'Details of the transaction' ,
273
+ type : TransactionQueueModel ,
274
+ } )
275
+ @Post ( ':asset/venue-filtering/disable' )
276
+ public async disableVenueFiltering (
277
+ @Param ( ) { asset } : AssetParamsDto ,
278
+ @Body ( ) transactionBaseDto : TransactionBaseDto
279
+ ) : Promise < TransactionResponseModel > {
280
+ const result = await this . assetsService . disableVenueFiltering ( asset , transactionBaseDto ) ;
281
+
282
+ return handleServiceResult ( result ) ;
283
+ }
284
+
285
+ @ApiOperation ( {
286
+ summary : 'Allow specific venues to settle instructions for an Asset' ,
287
+ } )
288
+ @ApiParam ( {
289
+ name : 'asset' ,
290
+ description : 'The Asset (Ticker/Asset ID) whose venue allowlist will be updated' ,
291
+ type : 'string' ,
292
+ } )
293
+ @ApiTransactionResponse ( {
294
+ description : 'Details of the transaction' ,
295
+ type : TransactionQueueModel ,
296
+ } )
297
+ @Post ( ':asset/venue-filtering/allow' )
298
+ public async allowVenues (
299
+ @Param ( ) { asset } : AssetParamsDto ,
300
+ @Body ( ) venueIdsDto : VenueIdsDto
301
+ ) : Promise < TransactionResponseModel > {
302
+ const result = await this . assetsService . allowVenues ( asset , venueIdsDto ) ;
303
+
304
+ return handleServiceResult ( result ) ;
305
+ }
306
+
307
+ @ApiOperation ( {
308
+ summary : 'Disallow specific venues from settling instructions for an Asset' ,
309
+ } )
310
+ @ApiParam ( {
311
+ name : 'asset' ,
312
+ description : 'The Asset (Ticker/Asset ID) whose venue allowlist will be updated' ,
313
+ type : 'string' ,
314
+ } )
315
+ @ApiTransactionResponse ( {
316
+ description : 'Details of the transaction' ,
317
+ type : TransactionQueueModel ,
318
+ } )
319
+ @Post ( ':asset/venue-filtering/disallow' )
320
+ public async disallowVenues (
321
+ @Param ( ) { asset } : AssetParamsDto ,
322
+ @Body ( ) venueIdsDto : VenueIdsDto
323
+ ) : Promise < TransactionResponseModel > {
324
+ const result = await this . assetsService . disallowVenues ( asset , venueIdsDto ) ;
325
+
326
+ return handleServiceResult ( result ) ;
327
+ }
328
+
329
+ @ApiOperation ( {
330
+ summary : 'Get venue filtering details for an Asset' ,
331
+ description :
332
+ 'Returns the current filtering status alongside the allowed and disallowed venue identifiers' ,
333
+ } )
334
+ @ApiParam ( {
335
+ name : 'asset' ,
336
+ description :
337
+ 'The Asset (Ticker/Asset ID) whose venue filtering configuration will be retrieved' ,
338
+ type : 'string' ,
339
+ } )
340
+ @ApiOkResponse ( {
341
+ description : 'Venue filtering configuration for the Asset' ,
342
+ type : VenueFilteringDetailsModel ,
343
+ } )
344
+ @Get ( ':asset/venue-filtering' )
345
+ public async getVenueFilteringDetails (
346
+ @Param ( ) { asset } : AssetParamsDto
347
+ ) : Promise < VenueFilteringDetailsModel > {
348
+ const details = await this . assetsService . getVenueFilteringDetails ( asset ) ;
349
+
350
+ return new VenueFilteringDetailsModel ( details ) ;
351
+ }
352
+
236
353
@ApiOperation ( {
237
354
summary : 'Issue more of an Asset' ,
238
355
description : 'This endpoint issues more of a given Asset' ,
0 commit comments