forked from blockscout/blockscout
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix NaN input in write contract * Search results page: navbar menu fix * Resize inputs; improve multiplier selector; add tooltip for tx value; txValue field's type: text -> number * Fix floating tooltips on token transfer block * Fix solid outputs on contract read page * Add step and min value for txValue input * Add status to Position pane * Add support EIP-1559 * Update CHANGELOG.md * Change key to update cache GA * Change key back to update cache GA * Fix endless Fetching tokens message on emty addresses * Change keys of cache for update GA * Add tooltips and names for fallback and receive functions * Ability to hide miner * Improved style of transactions button * Add token_tile_view_more.css to the main-page.css * Display token icons for tokens from TrustWallet repo * token icon for bridged tokens in search results page fix * Hide error selector in the contract's functions list * Change alpha of transactions button's background * Support HTML tags in alert message * Add implementation link to the overview of proxy contracts * Fixed formatting * Remove unused npm packages * Increased build timeout * Increased build timeout * More testing * More testing * Fixed PR comments * Replaced more ETH * Fix gettext * CSP fix: allow only trustwallet assets repo from Github Co-authored-by: nikitosing <[email protected]> Co-authored-by: Victor Baranov <[email protected]> Co-authored-by: nikitosing <[email protected]> Co-authored-by: Enrique Ruiz <[email protected]>
- Loading branch information
1 parent
816e0e1
commit 5900c7c
Showing
55 changed files
with
1,632 additions
and
461 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
function getTokenIconUrl (chainID, addressHash) { | ||
var chainName = null | ||
switch (chainID) { | ||
case '1': | ||
chainName = 'ethereum' | ||
break | ||
case '99': | ||
chainName = 'poa' | ||
break | ||
case '100': | ||
chainName = 'xdai' | ||
break | ||
default: | ||
chainName = null | ||
break | ||
} | ||
if (chainName) { | ||
return `https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/${chainName}/assets/${addressHash}/logo.png` | ||
} else { | ||
return null | ||
} | ||
} | ||
|
||
function appendTokenIcon ($tokenIconContainer, chainID, addressHash, foreignChainID, foreignAddressHash, displayTokenIcons, size) { | ||
const iconSize = size || 20 | ||
var tokenIconURL = null | ||
if (foreignChainID) { | ||
tokenIconURL = getTokenIconUrl(foreignChainID.toString(), foreignAddressHash) | ||
} else if (chainID) { | ||
tokenIconURL = getTokenIconUrl(chainID.toString(), addressHash) | ||
} | ||
if (displayTokenIcons) { | ||
checkLink(tokenIconURL) | ||
.then(checkTokenIconLink => { | ||
if (checkTokenIconLink) { | ||
if ($tokenIconContainer) { | ||
var img = new Image(iconSize, iconSize) | ||
img.src = tokenIconURL | ||
$tokenIconContainer.append(img) | ||
} | ||
} | ||
}) | ||
} | ||
} | ||
|
||
async function checkLink (url) { | ||
if (url) { | ||
try { | ||
const res = await fetch(url) | ||
return res.ok | ||
} catch (_error) { | ||
return false | ||
} | ||
} else { | ||
return false | ||
} | ||
} | ||
|
||
export { appendTokenIcon, checkLink, getTokenIconUrl } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import $ from 'jquery' | ||
import { appendTokenIcon } from '../../lib/token_icon' | ||
|
||
if ($('[data-page="token-details"]').length) { | ||
const $tokenIconContainer = $('#token-icon') | ||
const chainID = $tokenIconContainer.data('chain-id') | ||
const addressHash = $tokenIconContainer.data('address-hash') | ||
const foreignChainID = $tokenIconContainer.data('foreign-chain-id') | ||
const foreignAddressHash = $tokenIconContainer.data('foreign-address-hash') | ||
const displayTokenIcons = $tokenIconContainer.data('display-token-icons') | ||
|
||
appendTokenIcon($tokenIconContainer, chainID, addressHash, foreignChainID, foreignAddressHash, displayTokenIcons) | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.