Add confirmed-in component, show ETA for proposed reimbursements #210

Merged
raucao merged 11 commits from feature/confirmation-eta into master 2023-01-15 04:36:43 +00:00
Showing only changes of commit fe27b010da - Show all commits
+23
View File
@@ -0,0 +1,23 @@
import Component from '@glimmer/component';
import { tracked } from '@glimmer/tracking';
import { inject as service } from '@ember/service';
export default class ConfirmedInComponent extends Component {
@service kredits;
@tracked confirmedAtBlock = null;
constructor(confirmedAtBlock) {
super(...arguments);
this.confirmedAtBlock = confirmedAtBlock;
}
get confirmedInBlocks () {
return this.confirmedAtBlock - this.kredits.currentBlock;
}
get confirmedInSeconds () {
// A new block is mined every 30 seconds on average
return this.confirmedInBlocks * 30;
}
}