25 lines
622 B
JavaScript
25 lines
622 B
JavaScript
import Component from '@glimmer/component';
|
|
import { inject as service } from '@ember/service';
|
|
import moment from 'moment';
|
|
|
|
export default class ConfirmedInComponent extends Component {
|
|
@service kredits;
|
|
|
|
get confirmedInBlocks () {
|
|
return this.args.confirmedAtBlock - this.kredits.currentBlock;
|
|
}
|
|
|
|
get confirmedInSeconds () {
|
|
// A new block is mined every 30 seconds on average
|
|
return this.confirmedInBlocks * 30;
|
|
}
|
|
|
|
get confirmedInHumanTime () {
|
|
return moment.duration(this.confirmedInSeconds, "seconds").humanize();
|
|
}
|
|
|
|
get isConfirmed () {
|
|
return this.confirmedInBlocks <= 0;
|
|
}
|
|
}
|