Skip to content

Commit 8b8c463

Browse files
committed
blockstrap wallet now working perfectly - as far as my semi-limited testing 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
1 parent cef613f commit 8b8c463

File tree

5 files changed

+49
-20
lines changed

5 files changed

+49
-20
lines changed

blockstrap/html/bootstrap/jumbotrons.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ <h1>{{title}}</h1>
77
<span class="actions">
88
{{#buttons}}
99
<a href="{{href}}"
10+
id="{{id}}"
1011
class="btn {{css}}"
1112
{{#attributes}}
1213
{{key}}="{{value}}"

blockstrap/js/modules/accounts.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,27 @@
246246
address = this_chain_obj;
247247
}
248248
});
249+
if(!address && typeof account.addresses != 'undefined')
250+
{
251+
$.each(account.addresses, function(this_chain, this_chain_obj)
252+
{
253+
$.each(this_chain_obj.chains, function(this_inner_chain, this_inner_chain_address)
254+
{
255+
$.each(this_inner_chain_address, function(k, this_address)
256+
{
257+
if(this_address == key)
258+
{
259+
address = {
260+
tx_count: 0,
261+
received: 0,
262+
balance: 0,
263+
code: this_inner_chain
264+
}
265+
}
266+
});
267+
});
268+
});
269+
}
249270
});
250271
}
251272
return address;

blockstrap/js/modules/templates.js

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
// ADDRESS INFO
4141
var archived = '';
4242
var address_url = '';
43+
var address_hidden = '';
4344
var current_account = false;
4445
var add_blockchain = 'Bitcoin';
4546
var address_received = 0;
@@ -94,16 +95,23 @@
9495
}
9596
});
9697
current_txs+= '</ul>';
98+
if(account.tx_count < 1)
99+
{
100+
key+= ' (ARCHIVED)';
101+
account.tx_count = 'N/A';
102+
}
97103
}
98104
}
99105
else if(key)
100106
{
101-
archived = ' (ARCHIVED)';
102-
account.tx_count = 'RE-SYNC will not store detals due to being archived address';
107+
key = 'N/A';
108+
address_hidden = 'hidden';
109+
account.tx_count = 'N/A';
103110
}
104111

105112
// TX INFO
106113
var tx_url = '';
114+
var tx_hidden = '';
107115
var current_tx = false;
108116
var tx_blockchain = 'Bitcoin';
109117
var txid = blockstrap_functions.vars('txid');
@@ -120,9 +128,14 @@
120128
if($.isPlainObject($.fn.blockstrap.accounts))
121129
{
122130
current_tx = $.fn.blockstrap.accounts.tx(txid);
131+
if(!current_tx)
132+
{
133+
txid = 'N/A';
134+
tx_hidden = 'hidden';
135+
}
123136
}
124137

125-
if(txid && typeof current_tx.tx != 'undefined' && typeof current_tx.tx.blockchain != 'undefined')
138+
if(txid && txid != 'N/A' && typeof current_tx.tx != 'undefined' && typeof current_tx.tx.blockchain != 'undefined')
126139
{
127140
tx_blockchain = $.fn.blockstrap.settings.blockchains[current_tx.tx.blockchain].blockchain;
128141
if(typeof typeof current_tx.tx.size != 'undefined') tx.size = current_tx.tx.size;
@@ -133,7 +146,7 @@
133146
if(typeof current_tx.tx.block != 'undefined' && current_tx.tx.block) tx.block = current_tx.tx.block;
134147
else
135148
{
136-
tx.block = 'Must RE-SYNC to fetch live details!';
149+
tx.block = 'N/A';
137150
}
138151
var base_api_url = $.fn.blockstrap.settings.blockchains[current_tx.tx.blockchain].apis[$.fn.blockstrap.settings.api_service];
139152
var tx_slugs = $.fn.blockstrap.settings.apis.defaults[$.fn.blockstrap.settings.api_service].functions.to.transaction;
@@ -162,7 +175,9 @@
162175
'tx.output',
163176
'tx.fees',
164177
'address.tx_count',
165-
'address.balance'
178+
'address.balance',
179+
'address.hidden',
180+
'tx.hidden'
166181
];
167182
var replacements = [
168183
$.fn.blockstrap.settings.base_url,
@@ -183,7 +198,9 @@
183198
parseInt(tx.output) / 100000000 + ' ' + tx_blockchain,
184199
parseInt(tx.fees) / 100000000 + ' ' + tx_blockchain,
185200
account.tx_count,
186-
parseInt(account.balance) / 100000000 + ' ' + add_blockchain
201+
parseInt(account.balance) / 100000000 + ' ' + add_blockchain,
202+
address_hidden,
203+
tx_hidden
187204
];
188205
}
189206

themes/default/data/address.json

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,8 @@
1414
"buttons": [
1515
{
1616
"href": "{{urls.address}}",
17-
"css": "btn-success",
18-
"text": "RAW JSON"
19-
},
20-
{
21-
"href": "#",
22-
"css": "btn-primary btn-update-address",
23-
"text": "RE-SYNC"
17+
"css": "btn-success {{address.hidden}}",
18+
"text": "LIVE DATA"
2419
}
2520
]
2621
}

themes/default/data/transaction.json

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,8 @@
1414
"buttons": [
1515
{
1616
"href": "{{urls.tx}}",
17-
"css": "btn-success",
18-
"text": "RAW JSON"
19-
},
20-
{
21-
"href": "#",
22-
"css": "btn-primary btn-update-tx",
23-
"text": "RE-SYNC"
17+
"css": "btn-success {{tx.hidden}}",
18+
"text": "LIVE DATA"
2419
}
2520
]
2621
}

0 commit comments

Comments
 (0)