Skip to content

Commit

Permalink
blockstrap wallet now working perfectly - as far as my semi-limited t…
Browse files Browse the repository at this point in the history
…esting can tell - so am now ready to move-on to making blockstrap work with other APIs, and or return to clean-up the everstore export experience whilst I wait for spinal
  • Loading branch information
msmalley committed Apr 19, 2016
1 parent cef613f commit 8b8c463
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 20 deletions.
1 change: 1 addition & 0 deletions blockstrap/html/bootstrap/jumbotrons.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ <h1>{{title}}</h1>
<span class="actions">
{{#buttons}}
<a href="{{href}}"
id="{{id}}"
class="btn {{css}}"
{{#attributes}}
{{key}}="{{value}}"
Expand Down
21 changes: 21 additions & 0 deletions blockstrap/js/modules/accounts.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,27 @@
address = this_chain_obj;
}
});
if(!address && typeof account.addresses != 'undefined')
{
$.each(account.addresses, function(this_chain, this_chain_obj)
{
$.each(this_chain_obj.chains, function(this_inner_chain, this_inner_chain_address)
{
$.each(this_inner_chain_address, function(k, this_address)
{
if(this_address == key)
{
address = {
tx_count: 0,
received: 0,
balance: 0,
code: this_inner_chain
}
}
});
});
});
}
});
}
return address;
Expand Down
29 changes: 23 additions & 6 deletions blockstrap/js/modules/templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
// ADDRESS INFO
var archived = '';
var address_url = '';
var address_hidden = '';
var current_account = false;
var add_blockchain = 'Bitcoin';
var address_received = 0;
Expand Down Expand Up @@ -94,16 +95,23 @@
}
});
current_txs+= '</ul>';
if(account.tx_count < 1)
{
key+= ' (ARCHIVED)';
account.tx_count = 'N/A';
}
}
}
else if(key)
{
archived = ' (ARCHIVED)';
account.tx_count = 'RE-SYNC will not store detals due to being archived address';
key = 'N/A';
address_hidden = 'hidden';
account.tx_count = 'N/A';
}

// TX INFO
var tx_url = '';
var tx_hidden = '';
var current_tx = false;
var tx_blockchain = 'Bitcoin';
var txid = blockstrap_functions.vars('txid');
Expand All @@ -120,9 +128,14 @@
if($.isPlainObject($.fn.blockstrap.accounts))
{
current_tx = $.fn.blockstrap.accounts.tx(txid);
if(!current_tx)
{
txid = 'N/A';
tx_hidden = 'hidden';
}
}

if(txid && typeof current_tx.tx != 'undefined' && typeof current_tx.tx.blockchain != 'undefined')
if(txid && txid != 'N/A' && typeof current_tx.tx != 'undefined' && typeof current_tx.tx.blockchain != 'undefined')
{
tx_blockchain = $.fn.blockstrap.settings.blockchains[current_tx.tx.blockchain].blockchain;
if(typeof typeof current_tx.tx.size != 'undefined') tx.size = current_tx.tx.size;
Expand All @@ -133,7 +146,7 @@
if(typeof current_tx.tx.block != 'undefined' && current_tx.tx.block) tx.block = current_tx.tx.block;
else
{
tx.block = 'Must RE-SYNC to fetch live details!';
tx.block = 'N/A';
}
var base_api_url = $.fn.blockstrap.settings.blockchains[current_tx.tx.blockchain].apis[$.fn.blockstrap.settings.api_service];
var tx_slugs = $.fn.blockstrap.settings.apis.defaults[$.fn.blockstrap.settings.api_service].functions.to.transaction;
Expand Down Expand Up @@ -162,7 +175,9 @@
'tx.output',
'tx.fees',
'address.tx_count',
'address.balance'
'address.balance',
'address.hidden',
'tx.hidden'
];
var replacements = [
$.fn.blockstrap.settings.base_url,
Expand All @@ -183,7 +198,9 @@
parseInt(tx.output) / 100000000 + ' ' + tx_blockchain,
parseInt(tx.fees) / 100000000 + ' ' + tx_blockchain,
account.tx_count,
parseInt(account.balance) / 100000000 + ' ' + add_blockchain
parseInt(account.balance) / 100000000 + ' ' + add_blockchain,
address_hidden,
tx_hidden
];
}

Expand Down
9 changes: 2 additions & 7 deletions themes/default/data/address.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,8 @@
"buttons": [
{
"href": "{{urls.address}}",
"css": "btn-success",
"text": "RAW JSON"
},
{
"href": "#",
"css": "btn-primary btn-update-address",
"text": "RE-SYNC"
"css": "btn-success {{address.hidden}}",
"text": "LIVE DATA"
}
]
}
Expand Down
9 changes: 2 additions & 7 deletions themes/default/data/transaction.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,8 @@
"buttons": [
{
"href": "{{urls.tx}}",
"css": "btn-success",
"text": "RAW JSON"
},
{
"href": "#",
"css": "btn-primary btn-update-tx",
"text": "RE-SYNC"
"css": "btn-success {{tx.hidden}}",
"text": "LIVE DATA"
}
]
}
Expand Down

0 comments on commit 8b8c463

Please sign in to comment.