2021-09-30 09:43:29 +00:00
|
|
|
pragma Singleton
|
|
|
|
|
|
|
|
import QtQuick 2.13
|
|
|
|
|
2021-12-07 23:15:17 +00:00
|
|
|
import utils 1.0
|
|
|
|
|
2021-09-30 09:43:29 +00:00
|
|
|
QtObject {
|
|
|
|
id: root
|
|
|
|
|
2021-12-13 14:24:21 +00:00
|
|
|
// Not Refactored Yet
|
|
|
|
// property string activeChannelName: chatsModel.channelView.activeChannel.name
|
2021-09-30 09:43:29 +00:00
|
|
|
|
2021-12-07 23:15:17 +00:00
|
|
|
property bool currentTabConnected: false
|
|
|
|
|
2021-09-30 09:43:29 +00:00
|
|
|
function getUrlFromUserInput(input) {
|
2021-12-14 16:11:31 +00:00
|
|
|
return globalUtils.urlFromUserInput(input)
|
2021-09-30 09:43:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function getAscii2Hex(input) {
|
2021-12-14 16:11:31 +00:00
|
|
|
return globalUtils.ascii2Hex(input)
|
2021-09-30 09:43:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function getHex2Ascii(input) {
|
2021-12-14 16:11:31 +00:00
|
|
|
return globalUtils.hex2Ascii(input)
|
2021-09-30 09:43:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function getWei2Eth(wei,decimals) {
|
2021-12-14 16:11:31 +00:00
|
|
|
return globalUtils.wei2Eth(wei,decimals)
|
2021-09-30 09:43:29 +00:00
|
|
|
}
|
|
|
|
|
2022-02-09 10:22:24 +00:00
|
|
|
function getEth2Hex(eth) {
|
|
|
|
return globalUtils.eth2Hex(eth)
|
|
|
|
}
|
|
|
|
|
|
|
|
function getGwei2Hex(gwei){
|
|
|
|
return globalUtils.gwei2Hex(gwei)
|
|
|
|
}
|
|
|
|
|
2022-01-11 21:53:18 +00:00
|
|
|
function generateAlias(pk) {
|
|
|
|
return globalUtils.generateAlias(pk)
|
|
|
|
}
|
|
|
|
|
2021-12-07 23:15:17 +00:00
|
|
|
function get0xFormedUrl(browserExplorer, url) {
|
|
|
|
var tempUrl = ""
|
|
|
|
switch (browserExplorer) {
|
|
|
|
case Constants.browserEthereumExplorerEtherscan:
|
|
|
|
if (url.length > 42) {
|
|
|
|
tempUrl = "https://etherscan.io/tx/" + url; break;
|
|
|
|
} else {
|
|
|
|
tempUrl = "https://etherscan.io/address/" + url; break;
|
|
|
|
}
|
|
|
|
case Constants.browserEthereumExplorerEthplorer:
|
|
|
|
if (url.length > 42) {
|
|
|
|
tempUrl = "https://ethplorer.io/tx/" + url; break;
|
|
|
|
} else {
|
|
|
|
tempUrl = "https://ethplorer.io/address/" + url; break;
|
|
|
|
}
|
|
|
|
case Constants.browserEthereumExplorerBlockchair:
|
|
|
|
if (url.length > 42) {
|
|
|
|
tempUrl = "https://blockchair.com/ethereum/transaction/" + url; break;
|
|
|
|
} else {
|
|
|
|
tempUrl = "https://blockchair.com/ethereum/address/" + url; break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return tempUrl
|
2021-12-16 17:24:26 +00:00
|
|
|
}
|
|
|
|
|
2021-12-07 23:15:17 +00:00
|
|
|
function getFormedUrl(shouldShowBrowserSearchEngine, url) {
|
|
|
|
var tempUrl = ""
|
|
|
|
switch (localAccountSensitiveSettings.shouldShowBrowserSearchEngine) {
|
|
|
|
case Constants.browserSearchEngineGoogle: tempUrl = "https://www.google.com/search?q=" + url; break;
|
|
|
|
case Constants.browserSearchEngineYahoo: tempUrl = "https://search.yahoo.com/search?p=" + url; break;
|
|
|
|
case Constants.browserSearchEngineDuckDuckGo: tempUrl = "https://duckduckgo.com/?q=" + url; break;
|
|
|
|
}
|
|
|
|
return tempUrl
|
2021-12-16 17:24:26 +00:00
|
|
|
}
|
2022-03-15 19:34:28 +00:00
|
|
|
|
|
|
|
function copyToClipboard(text) {
|
|
|
|
globalUtils.copyToClipboard(text)
|
|
|
|
}
|
2022-05-19 08:53:57 +00:00
|
|
|
|
2021-09-30 09:43:29 +00:00
|
|
|
}
|