Skip to content

Commit f8007e2

Browse files
Update Asset Icons
1 parent 6f6c531 commit f8007e2

File tree

5 files changed

+28
-18
lines changed

5 files changed

+28
-18
lines changed

client/src/app.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ export default function main({ DOM, HTTP, route, storage, scanner: scan$, search
208208
, isReady$ = process.env.ASSET_MAP_URL ? assetMap$.mapTo(true).startWith(false) : O.of(true)
209209

210210
// Asset Icons Response
211-
, assetIcons$ = !process.env.ASSET_MAP_URL ? O.of({}) :
211+
, assetIcons$ = !process.env.ASSET_ICONS_URL ? O.of({}) :
212212
reply('asset-icons')
213213

214214
// Currently visible view
@@ -339,8 +339,8 @@ export default function main({ DOM, HTTP, route, storage, scanner: scan$, search
339339
: { category: 'asset-txs', method: 'GET', path: `/asset/${d.asset_id}/txs` }])
340340

341341
// Fetch Asset Icons
342-
, !process.env.ASSET_MAP_URL ? O.empty() : O.of(
343-
{ category: 'asset-icons', method: 'GET', path: `https://assets.blockstream.info/icons.json` })
342+
, !process.env.ASSET_ICONS_URL ? O.empty() : O.of(
343+
{ category: 'asset-icons', method: 'GET', path: process.env.ASSET_ICONS_URL})
344344

345345

346346
// fetch more txs for asset page

client/src/views/asset-issuance-history.js

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,46 +3,45 @@ import { formatTime, formatAssetAmount } from './util'
33

44
export default (assetTxs, chain_stats, asset, t) => {
55

6-
//Calculated AssetTx
7-
let calculatedAssetTx = []
8-
9-
if(assetTxs != null){
6+
const getCalculatedAssetTx = () => {
107
// Supply Starts at Zero
118
let supply = 0
129
// Sort AssetTxs by block_time and Calculate Supply Change / Total Supply
1310
assetTxs.sort((a,b) => (a.status.block_time > b.status.block_time) ? 1 : ((b.status.block_time > a.status.block_time) ? -1 : 0))
14-
assetTxs.map(tx => {
11+
let calAssetTx = assetTxs.map(tx => {
1512
let calTxObj = {}
1613
calTxObj.txid = tx.txid
1714
calTxObj.block_height = tx.status.block_height
1815
calTxObj.block_time = formatTime(tx.status.block_time)
19-
16+
2017
// Find all Issuance and add them to Supply
2118
tx.vin.map(vinTx => {
2219
if("issuance" in vinTx){
23-
calTxObj.supplyChange = chain_stats.has_blinded_issuances ? t`Confidential` : formatAssetAmount(("+ " + vinTx.issuance.assetamount), asset.precision, t)
20+
calTxObj.supplyChange = chain_stats.has_blinded_issuances ? t`Confidential` : `+ ${formatAssetAmount((vinTx.issuance.assetamount), asset.precision, t).text}`
2421
calTxObj.totalSupply = chain_stats.has_blinded_issuances ? t`Confidential` : formatAssetAmount((supply + vinTx.issuance.assetamount), asset.precision, t)
2522
supply = (supply + vinTx.issuance.assetamount)
2623
}
2724
})
28-
25+
2926
// Find all Burn Transactions and Remove them from Supply
3027
tx.vout.map(voutTx => {
3128
if(voutTx.scriptpubkey_type === "op_return"){
3229
if(voutTx.value > 0){
33-
calTxObj.supplyChange = chain_stats.has_blinded_issuances ? t`Confidential` : formatAssetAmount(("- " + voutTx.value), asset.precision, t)
30+
calTxObj.supplyChange = chain_stats.has_blinded_issuances ? t`Confidential` : `- ${formatAssetAmount((voutTx.value), asset.precision, t).text}`
3431
calTxObj.totalSupply = chain_stats.has_blinded_issuances ? t`Confidential` : formatAssetAmount((supply - voutTx.value), asset.precision, t)
3532
supply = (supply - voutTx.value)
3633
}
3734
}
3835
})
39-
calculatedAssetTx.push(calTxObj)
36+
return calTxObj
4037
})
38+
39+
// Reverse Calculated AssetTx to Display Newest to Older
40+
return calAssetTx.reverse()
4141
}
42-
// Reverse Calculated AssetTx to Display Newest to Older
43-
calculatedAssetTx.reverse()
44-
45-
42+
43+
let calculatedAssetTx = assetTxs === null ? "" : getCalculatedAssetTx()
44+
4645

4746
return(
4847
<div>

flavors/liquid-mainnet/config.env

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ export IS_ELEMENTS=1
99

1010
export ASSET_MAP_URL=./_data/assets.minimal.json
1111

12+
export ASSET_ICONS_URL=https://assets.blockstream.info/icons.json
13+
1214
export MENU_ACTIVE='Liquid'
1315
export BASE_HREF=${BASE_HREF:-'/liquid/'}
1416

flavors/liquid-mainnet/extras.css

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,16 @@
233233

234234
@media only screen and (max-width: 850px) {
235235

236-
/* assets table */
236+
.asset-label{
237+
width: 40%;
238+
}
239+
240+
.asset-text{
241+
text-align: right;
242+
width: 60%;
243+
}
237244

245+
/* assets table */
238246
div.assets-table-row.header {
239247
display:none;
240248
}

www/assets.minimal.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)