Skip to content

Commit

Permalink
feat: 🎸 add assetId in GET /assets/{asset} response
Browse files Browse the repository at this point in the history
  • Loading branch information
polymath-eric committed Nov 1, 2024
1 parent e2b1883 commit f97707a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/assets/assets.controller.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ describe('AssetsController', () => {

const mockResult = {
...mockAssetDetails,
assetId: mockAsset.id,
securityIdentifiers: mockIdentifiers,
fundingRound: mockFundingRound,
isFrozen: mockAssetIsFrozen,
Expand Down
1 change: 1 addition & 0 deletions src/assets/assets.util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export async function createAssetDetailsModel(asset: Asset): Promise<AssetDetail

return new AssetDetailsModel({
owner,
assetId: asset.id,
assetType,
name,
totalSupply,
Expand Down
4 changes: 2 additions & 2 deletions src/assets/models/asset-balance.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import { FromEntity } from '~/common/decorators/transformation';

export class AssetBalanceModel extends BalanceModel {
@ApiProperty({
description: 'Ticker of the Asset',
description: 'The Asset ID',
type: 'string',
example: 'TICKER',
example: '6468aa16-7b77-8fcd-9605-da785c4005a8',
})
@FromEntity()
readonly asset: FungibleAsset;
Expand Down
7 changes: 7 additions & 0 deletions src/assets/models/asset-details.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ export class AssetDetailsModel {
@FromEntity()
readonly owner: Identity;

@ApiProperty({
description: 'The unique Asset ID',
type: 'string',
example: '6468aa16-7b77-8fcd-9605-da785c4005a8',
})
readonly assetId: string;

@ApiProperty({
description: 'Type of the Asset',
type: 'string',
Expand Down

0 comments on commit f97707a

Please sign in to comment.