Skip to content

Commit

Permalink
Add hedera explorer to old trust chain retirement message.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dariy Miseldzhani committed Dec 20, 2024
1 parent d366570 commit e6712be
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,7 @@
<div class="field-name">User ID:</div>
<div class="field-value">{{selected.documents[0].credentialSubject[0].user}}</div>
</div>
<div class="field" *ngIf="selected.owner">
<div class="field" *ngIf="selected.consensusTimestamp">
<div class="field-name">Transaction:</div>
<div class="field-value">{{selected.consensusTimestamp}}</div>
</div>
Expand Down Expand Up @@ -810,7 +810,7 @@
<div class="field-name">Owner:</div>
<div class="field-value">
<hedera-explorer type="accounts"
[params]="selected.payer">{{selected.owner}}</hedera-explorer>
[params]="selected.owner">{{selected.owner}}</hedera-explorer>
</div>
</div>
</ng-container>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -414,16 +414,22 @@ <h3>Policy Overview</h3>
</div>
<div class="retire-multiple-tokens">
<div class="retire-info">
<p>Token <span>{{ getRetirementGroupVC(group).credentialSubject[0]?.tokens[0].tokenId }}</span></p>
<p *ngIf="getRetirementGroupVC(group).credentialSubject[0]?.tokens[0].serials && getRetirementGroupVC(group).credentialSubject[0]?.tokens[0].serials.length > 0">Instance ID <span>{{ getRetirementGroupVC(group).credentialSubject[0]?.tokens[0].serials.join(', ') }}</span></p>
<p *ngIf="getRetirementGroupVC(group).credentialSubject[0]?.tokens[0].serials && getRetirementGroupVC(group).credentialSubject[0]?.tokens[0].serials.length <= 0">Amount <span>{{ getRetirementGroupVC(group).credentialSubject[0]?.tokens[0].count }}</span></p>
<p>Token <span>{{ getRetirementGroupVC(group).credentialSubject[0]?.tokens[0].tokenId }}</span></p>
<p>Transaction <span>{{ getRetirementGroupVC(group).timestamp || '-'}}</span></p>

<p *ngIf="getRetirementGroupVC(group).timestamp">Transaction
<hedera-explorer type="topics" [params]="getRetirementGroupVC(group).topicId" subType="messages"
[subParams]="getRetirementGroupVC(group).sequenceNumber">{{getRetirementGroupVC(group).timestamp}}</hedera-explorer>
</p>
<p *ngIf="!getRetirementGroupVC(group).timestamp">Transaction <span>-</span></p>

<p>User ID <span>{{ getRetirementGroupVC(group).credentialSubject[0]?.user }}</span></p>
</div>
<div class="retire-info second-token">
<p>Token <span>{{ getRetirementGroupVC(group).credentialSubject[0]?.tokens[1].tokenId }}</span></p>
<p *ngIf="getRetirementGroupVC(group).credentialSubject[0]?.tokens[1].serials && getRetirementGroupVC(group).credentialSubject[0]?.tokens[1].serials.length > 0">Instance ID <span>{{ getRetirementGroupVC(group).credentialSubject[0]?.tokens[1].serials.join(', ') }}</span></p>
<p *ngIf="getRetirementGroupVC(group).credentialSubject[0]?.tokens[1].serials && getRetirementGroupVC(group).credentialSubject[0]?.tokens[1].serials.length <= 0">Amount <span>{{ getRetirementGroupVC(group).credentialSubject[0]?.tokens[1].count }}</span></p>
<p>Token <span>{{ getRetirementGroupVC(group).credentialSubject[0]?.tokens[1].tokenId }}</span></p>
</div>
</div>

Expand Down Expand Up @@ -456,9 +462,9 @@ <h3>Policy Overview</h3>
</div>
</div>
<div class="retire-info">
<p>Token <span>{{ getRetirementGroupVC(group).credentialSubject[0]?.tokens[0].tokenId }}</span></p>
<p *ngIf="getRetirementGroupVC(group).credentialSubject[0]?.tokens[0].serials && getRetirementGroupVC(group).credentialSubject[0]?.tokens[0].serials.length > 0">Instance ID <span>{{ getRetirementGroupVC(group).credentialSubject[0]?.tokens[0].serials.join(', ') }}</span></p>
<p *ngIf="getRetirementGroupVC(group).credentialSubject[0]?.tokens[0].serials && getRetirementGroupVC(group).credentialSubject[0]?.tokens[0].serials.length <= 0">Amount <span>{{ getRetirementGroupVC(group).credentialSubject[0]?.tokens[0].count }}</span></p>
<p>Token <span>{{ getRetirementGroupVC(group).credentialSubject[0]?.tokens[0].tokenId }}</span></p>
<p>Transaction <span>{{ getRetirementGroupVC(group).timestamp }}</span></p>
<p>User ID <span>{{ getRetirementGroupVC(group).credentialSubject[0]?.user }}</span></p>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,16 @@ export class ReportBlockComponent implements OnInit {
retirements.forEach((item: IRetirementMessage) => {
const existInGuardianDocument = retiresDbMapped.find((retire: IVC) => retire.id === item.documents[0].id);
if (!existInGuardianDocument) {
item.documents[0].topicId = item.topicId;
item.documents[0].timestamp = item.consensusTimestamp;
item.documents[0].sequenceNumber = item.sequenceNumber;
item.documents[0].owner = item.owner;
combinedRetirements.push(item.documents[0]);
}
else {
existInGuardianDocument.topicId = item.topicId;
existInGuardianDocument.timestamp = item.consensusTimestamp;
existInGuardianDocument.sequenceNumber = item.sequenceNumber;
existInGuardianDocument.owner = item.owner;
}
});
Expand Down
4 changes: 4 additions & 0 deletions interfaces/src/interface/retirement-message.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,8 @@ export class IRetirementMessage {
* Tokens
*/
tokens: string[];
/**
* Sequence number
*/
sequenceNumber: string;
}

0 comments on commit e6712be

Please sign in to comment.