forked from PolymeshAssociation/polymesh-rest-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: 🎸 Return balance info when applying incoming balance
- Loading branch information
1 parent
f64cc27
commit 469c74b
Showing
11 changed files
with
127 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
src/confidential-accounts/models/applied-confidential-asset-balance.model.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* istanbul ignore file */ | ||
|
||
import { ApiProperty } from '@nestjs/swagger'; | ||
|
||
import { ConfidentialAssetBalanceModel } from '~/confidential-accounts/models/confidential-asset-balance.model'; | ||
|
||
export class AppliedConfidentialAssetBalanceModel extends ConfidentialAssetBalanceModel { | ||
@ApiProperty({ | ||
description: 'Encrypted amount of confidential Asset which was deposited', | ||
type: 'string', | ||
example: | ||
'0x289ebc384a263acd5820e03988dd17a3cd49ee57d572f4131e116b6bf4c70a1594447bb5d1e2d9cc62f083d8552dd90ec09b23a519b361e458d7fe1e48882261', | ||
}) | ||
readonly amount: string; | ||
|
||
constructor(model: AppliedConfidentialAssetBalanceModel) { | ||
const { amount, ...rest } = model; | ||
super(rest); | ||
Object.assign(this, { amount }); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
src/confidential-accounts/models/applied-confidential-asset-balances.model.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* istanbul ignore file */ | ||
|
||
import { ApiProperty } from '@nestjs/swagger'; | ||
import { Type } from 'class-transformer'; | ||
|
||
import { AppliedConfidentialAssetBalanceModel } from '~/confidential-accounts/models/applied-confidential-asset-balance.model'; | ||
import { TransactionQueueModel } from '~/polymesh-rest-api/src/common/models/transaction-queue.model'; | ||
|
||
export class AppliedConfidentialAssetBalancesModel extends TransactionQueueModel { | ||
@ApiProperty({ | ||
type: AppliedConfidentialAssetBalanceModel, | ||
isArray: true, | ||
description: 'List of all applied asset balances', | ||
}) | ||
@Type(() => AppliedConfidentialAssetBalanceModel) | ||
readonly appliedAssetBalances: AppliedConfidentialAssetBalanceModel[]; | ||
|
||
constructor(model: AppliedConfidentialAssetBalancesModel) { | ||
const { transactions, details, ...rest } = model; | ||
super({ transactions, details }); | ||
|
||
Object.assign(this, rest); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters