Skip to content

Commit

Permalink
Update txn detail data
Browse files Browse the repository at this point in the history
  • Loading branch information
Farina16 committed Jun 12, 2019
1 parent 1be3cde commit c5eee33
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@
<div id="transaction-modal" class="txns_details">
<div class="popup md-content ">
<a href="#" @click="hide" class="btn-close md-close"></a>
<div v-if="transaction.transaction_info" class="transaction transaction_details">
<div v-if="transaction" class="transaction transaction_details">
<h2>Transaction</h2>
<p class="trx_hash">
{{transaction.transaction_info && transaction.transaction_info.hash}}</p>
{{transaction.hash}}</p>
<p class="trx_time">
{{transaction.transaction_info && transaction.transaction_info.timestampDecimal | moment("LLLL")}}<br />
<span>({{transaction.transaction_info && transaction.transaction_info.timestampDecimal | moment("from", "now")}})</span>
{{parseInt(transaction.timeUnixEpoch) * 1000 | moment("LLLL")}}<br />
<span>({{transaction && transaction.timeUnixEpoch | moment("from", "now")}})</span>
</p>
<div class="table">
<div class="rows">
<label>Amount</label>
<div class="content">
<label class="trx_amount">
{{transaction.transaction_info && transaction.transaction_info.valueDecimal}}
{{ web3.utils.fromWei(transaction.valueInWei.toString(), 'ether')?parseFloat(web3.utils.fromWei(transaction.valueInWei.toString(), 'ether')).toFixed(4):0}}
<span>EXP</span>
</label>
</div>
Expand All @@ -38,7 +38,7 @@
<rect x="27.3" y="26.7" class="st125" width="9.7" height="9.6" />
</svg>
<label class="trx_from">
{{transaction.transaction_info && transaction.transaction_info.from}}
{{transaction && transaction.from}}
</label>
</div>
</div>
Expand All @@ -60,40 +60,40 @@
<rect x="27.3" y="26.7" class="st125" width="9.7" height="9.6" />
</svg>
<label class="trx_to">
{{transaction.transaction_info && transaction.transaction_info.to}}
{{transaction && transaction.to}}
</label>
</div>
</div>
<div class="rows">
<label>Fee paid</label>
<div class="content">
<label class="trx_fee_paind">
{{web3.utils.toDecimal(transaction.transaction_recipt_info && transaction.transaction_recipt_info.gasUsed)}}
{{transaction && transaction.transactionFee}} EXP
</label>
</div>
</div>
<div class="rows">
<label>Gas Limit</label>
<div class="content">
<label class="tex_gass_limit">
{{transaction.transaction_info && web3.utils.fromWei(web3.utils.toDecimal(transaction.transaction_info.gas).toString(), 'ether') * Gwei }}
(GWei)
{{transaction && transaction.gasDecimal }}
<!--(GWei)-->
</label>
</div>
</div>
<div class="rows">
<label>Gas used</label>
<div class="content">
<label class="tex_gass_used">
{{web3.utils.toDecimal(transaction.transaction_recipt_info && transaction.transaction_recipt_info.gasUsed)}}
{{web3.utils.toDecimal(transaction && transaction.gasUsed)}} ({{(parseInt(transaction.gasUsed)/parseInt(transaction.gasDecimal)) * 100}} %)
</label>
</div>
</div>
<div class="rows">
<label>Gas price</label>
<div class="content">
<label class="trx_gass_price">
{{transaction.transaction_recipt_info && parseFloat(web3.utils.fromWei(web3.utils.toDecimal(transaction.transaction_recipt_info.gasUsed).toString(), 'ether') * Gwei).toFixed(6)}}
{{web3.utils.fromWei(transaction.gasPrice.toString(), 'ether')}} EXP ({{transaction.gasPriceInWei}} Gwei)
</label>
</div>
</div>
Expand All @@ -110,8 +110,8 @@
<div class="rows">
<label>Block</label>
<div class="content">
<a @click="openGanderUrl('https://gander.tech/block/'+transaction.transaction_info.blockNumberDecimal)" href="" class='trx_block' target="_blank">
{{transaction.transaction_info && transaction.transaction_info.blockNumberDecimal}}
<a @click="openGanderUrl('https://gander.tech/block/'+transaction.blockNumberDecimal)" href="" class='trx_block' target="_blank">
{{transaction && transaction.blockNumberDecimal}}
</a>
</div>
</div>
Expand Down Expand Up @@ -164,11 +164,11 @@
fetch(postData){
console.log(postData, "postData------");
var transaction_list_hash ,updated_transaction_list_hash;
axios.post('https://beta-api.gander.tech/gettransactionbyhash', postData)
axios.get('https://api.gander.tech/transactionByHash/'+this.txndetaildata)
.then((response) => {
console.log(response.data.message, "response------");
if(response.data.message){
this.transaction = response.data.message;
if(response.data.data){
this.transaction = response.data.data[0];
}
})
.catch((error) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,10 @@
</div>
<div>
<div @click="handletxdetail(transaction)" v-for="(transaction, index) in filtertransaction? filtertransaction:transactions" v-if="istransactions&& transaction.Type != 'mined_transaction'" class="row transactionDetail md-trigger" data-modal="modal-4" :data-transactionid="transaction.hash">
<label class="date">{{ transaction.timestampDecimal | moment("MMM-DD")}}</label>
<label v-if="transaction.transactionStatus && transaction.transactionStatus === 'Pending'" class="status statstf"><strong>{{transaction.transactionStatus}}</strong></label>
<label v-else-if="transaction.transactionStatus" class="status statstf">{{transaction.transactionStatus}}</label>
<label v-if="!transaction.transactionStatus && transaction.blockNumber" class="status">Completed</label>
<label v-else-if="!transaction.transactionStatus" class="status"><strong>Pending</strong></label>
<label class="date">{{ parseInt(transaction.timeUnixEpoch) * 1000 | moment("MMM-DD")}}</label>
<label v-if="transaction.status && transaction.status === '0x1'" class="status statstf"><strong>Completed</strong></label>
<label v-else-if="transaction.status && transaction.status === '0x0'" class="status statstf">Failed</label>
<label v-else-if="transaction.status && transaction.status === ''" class="status statstf">Pending</label>
<div class="account">
<div class="fromAccount">{{transaction.from?transaction.from:'From'}}</div>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="11px" height="19px" viewBox="0 0 11 19" style="enable-background:new 0 0 11 19;" xml:space="preserve">
Expand All @@ -155,7 +154,7 @@
<div class="toAccount">{{transaction.to}}</div>
</div>
<label class="amount">
<span >{{transaction.valueDecimal?parseFloat(transaction.valueDecimal).toFixed(4):0}} Exp</span>
<span >{{ web3.utils.fromWei(transaction.valueInWei.toString(), 'ether')?parseFloat(web3.utils.fromWei(transaction.valueInWei.toString(), 'ether')).toFixed(4):0}} Exp</span>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="24px" height="24px" viewBox="0 0 35 35" style="enable-background:new 0 0 35 35;" xml:space="preserve">
<path class="open" d="M0,17.5C0,7.8,7.8,0,17.5,0S35,7.8,35,17.5S27.2,35,17.5,35S0,27.2,0,17.5z M31.5,17.5c0-7.7-6.3-14-14-14s-14,6.3-14,14s6.3,14,14,14S31.5,25.2,31.5,17.5z M10.8,17.9l0.8-0.2L10.8,17.9l8.4-11.5l1.6,1.2l-7.5,10.3l7.7,10L19.3,29L10.8,17.9z"></path>
</svg>
Expand Down Expand Up @@ -403,7 +402,7 @@
.then((response) => {
this.istransactions = true;
this.notransactions = false;
this.transactions = response.data.message;
this.transactions = response.data.data.transactions;
console.log(this.transactions === null ,"this.transactions ");
if(this.transactions && this.transactions.length > 0 ){
console.log(this.transactions ,"this.transactions ");
Expand Down

0 comments on commit c5eee33

Please sign in to comment.