-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add ui for NFT * rename contracts folders and classes to be similar to the contract name
- Loading branch information
1 parent
be5b765
commit fcbf4ca
Showing
11 changed files
with
254 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
File renamed without changes.
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
101 changes: 101 additions & 0 deletions
101
...ntApp/src/app/explorer/contract-nonfungibletoken/contract-nonfungibletoken.component.html
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,101 @@ | ||
<app-search></app-search> | ||
|
||
<div class="box"> | ||
<div *ngIf="transaction"> | ||
<div class="grid-hash"> | ||
<div> | ||
<span class="grid-hash-left"><i class="fas fa-hashtag"></i></span> | ||
<span class="grid-hash-middle breakable">{{transaction.contractAddress}}</span> | ||
<span class="grid-hash-right"> | ||
<div class="grid-double"> | ||
</div> | ||
</span> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="box"> | ||
|
||
<h3><i class="fas fa-receipt"></i> Non Fungible Token Details</h3> | ||
|
||
<app-progress class="centered" *ngIf="!transaction"></app-progress> | ||
<app-error class="centered" [error]="error"></app-error> | ||
|
||
<div class="grid-label-value" *ngIf="transaction"> | ||
|
||
|
||
<div> | ||
<span>Token name</span> | ||
<span>{{transaction.name }}</span> | ||
</div> | ||
<div> | ||
<span>Token symbol</span> | ||
<span>{{transaction.symbol}}</span> | ||
</div> | ||
<div> | ||
<span>Owner Only Minting</span> | ||
<span>{{transaction.ownerOnlyMinting | yes }}</span> | ||
</div> | ||
<div> | ||
<span>Contract Type</span> | ||
<span>{{transaction.contractType}}</span> | ||
</div> | ||
<div> | ||
<span>Owner</span> | ||
<span><a [routerLink]="['../../contract-address', transaction.contractAddress, transaction.owner]">{{transaction.owner}}</a></span> | ||
</div> | ||
<div> | ||
<span>Contract Address</span> | ||
<span><a [routerLink]="['../../contract-address', transaction.contractAddress]">{{transaction.contractAddress}}</a></span> | ||
</div> | ||
<div> | ||
<span>Created on Transaction</span> | ||
<span><a [routerLink]="['../../','contract-transaction', transaction.contractCreateTransactionId]">{{transaction.contractCreateTransactionId | slice:0:20}}</a></span> | ||
</div> | ||
|
||
<div *ngIf="transaction.error"> | ||
<span>Error</span> | ||
<span>{{transaction.error}}</span> | ||
</div> | ||
|
||
</div> | ||
</div> | ||
|
||
<div class="box"> | ||
|
||
<h3>Tokens</h3> | ||
|
||
<app-progress class="centered" *ngIf="!transactions">Loading transactions...</app-progress> | ||
|
||
<div *ngIf="errorTransactions"> | ||
<span class="muted">Error: </span> <span class="negative">{{errorTransactions.title}}</span><br><br> | ||
{{errorTransactions.errors | json}} | ||
</div> | ||
|
||
<div *ngIf="transactions"> | ||
|
||
<div class="scrollable " style="max-height:500px" appDetectScroll [bottomOffset]="400" [topOffset]="500"> | ||
<div class="grid-list-contract-nft" *ngFor="let item of transactions"> | ||
|
||
<span class="left">Token Id: {{item.id}}</span> | ||
<span class="left">Burned: {{item.isBurned | yes }}</span> | ||
<span class="left"><a [routerLink]="['../../','address', item.owner]">{{item.owner }}</a></span> | ||
<span class="left">{{item.uri}}</span> | ||
|
||
<div class="box left"> | ||
<h3>Sales History</h3> | ||
<span><pre style="max-width: 1270px; overflow: auto;">{{item.salesHistory | json}}</pre></span> | ||
|
||
</div> | ||
|
||
</div> | ||
|
||
<br> | ||
<app-progress class="centered" *ngIf="loading">Loading more transactions...</app-progress> | ||
</div> | ||
</div> | ||
|
||
</div> | ||
|
||
|
98 changes: 98 additions & 0 deletions
98
...ientApp/src/app/explorer/contract-nonfungibletoken/contract-nonfungibletoken.component.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,98 @@ | ||
import { Component, HostBinding, OnInit, OnDestroy, HostListener } from '@angular/core'; | ||
import { ActivatedRoute, Route, Router } from '@angular/router'; | ||
import { ApiComponent } from 'src/app/api/api.component'; | ||
import { ApiService, HttpError } from 'src/app/services/api.service'; | ||
import { SetupService } from 'src/app/services/setup.service'; | ||
import { ScrollEvent } from 'src/app/shared/scroll.directive'; | ||
|
||
@Component({ | ||
selector: 'app-contract-nonfungibletoken-component', | ||
templateUrl: './contract-nonfungibletoken.component.html' | ||
}) | ||
export class ContractNonFungibleTokenComponent implements OnInit, OnDestroy { | ||
@HostBinding('class.content-centered-top') hostClass = true; | ||
|
||
info: any; | ||
node: any; | ||
blockchain: any; | ||
network: any; | ||
configuration: any; | ||
consensus: any; | ||
peers: any; | ||
blocks: any; | ||
transactions: any; | ||
transaction: any; | ||
|
||
contractCodeTypeLink = false; | ||
contractCodeTypeLinkPath: any; | ||
contractCodeTypeLinkParam: any; | ||
|
||
timerInfo: any; | ||
timerBlocks: any; | ||
timerTransactions: any; | ||
address: any; | ||
filterAddress: any; | ||
balance: any; | ||
detailsVisible = false; | ||
lastBlockHeight: number; | ||
subscription: any; | ||
limit = 10; | ||
loading = false; | ||
count = 0; | ||
total: any; | ||
link: string; | ||
error: any; | ||
errorTransactions: any; | ||
navPath: any; | ||
|
||
constructor( | ||
private api: ApiService, | ||
private router: Router, | ||
public setup: SetupService, | ||
private activatedRoute: ActivatedRoute) { | ||
|
||
this.activatedRoute.paramMap.subscribe(async params => { | ||
const id: any = params.get('address'); | ||
console.log('Address:', id); | ||
|
||
const idFilter: any = params.get('filterAddress'); | ||
console.log('filterAddress:', idFilter); | ||
|
||
this.transactions = null; | ||
this.address = id; | ||
this.filterAddress = idFilter; | ||
|
||
try { | ||
this.transaction = await this.api.getContractNonFungibleTokenTransaction(id); | ||
this.transactions = this.transaction.tokens; | ||
|
||
} catch (err) { | ||
if (err.message[0] === '{') { | ||
this.error = JSON.parse(err.message); | ||
} else { | ||
this.error = err; | ||
} | ||
} | ||
}); | ||
} | ||
|
||
amount(outputs: any[]) { | ||
const filteredOutputs = outputs.filter(o => o.address === this.address); | ||
const amount = filteredOutputs.reduce((acc, item) => acc + item.balance, 0); | ||
|
||
return amount; | ||
} | ||
|
||
async ngOnInit() { | ||
|
||
} | ||
|
||
toggleDetails() { | ||
this.detailsVisible = !this.detailsVisible; | ||
} | ||
|
||
ngOnDestroy(): void { | ||
|
||
} | ||
} | ||
|
File renamed without changes.
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