2022-01-17 08:56:44 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import utils 1.0
|
|
|
|
|
|
|
|
QtObject {
|
|
|
|
id: root
|
|
|
|
|
|
|
|
property var ensUsernamesModule
|
|
|
|
|
|
|
|
property var ensUsernamesModel: root.ensUsernamesModule ? ensUsernamesModule.model : []
|
|
|
|
|
|
|
|
property string pubkey: userProfile.pubKey
|
|
|
|
property string icon: userProfile.icon
|
|
|
|
property string preferredUsername: userProfile.preferredName
|
|
|
|
|
|
|
|
property string username: userProfile.username
|
|
|
|
|
|
|
|
property var walletAccounts: walletSectionAccounts.model
|
|
|
|
|
|
|
|
function setPrefferedEnsUsername(ensName) {
|
|
|
|
if(!root.ensUsernamesModule)
|
|
|
|
return
|
|
|
|
ensUsernamesModule.setPrefferedEnsUsername(ensName)
|
|
|
|
}
|
|
|
|
|
|
|
|
function checkEnsUsernameAvailability(ensName, isStatus) {
|
|
|
|
if(!root.ensUsernamesModule)
|
|
|
|
return
|
|
|
|
ensUsernamesModule.checkEnsUsernameAvailability(ensName, isStatus)
|
|
|
|
}
|
|
|
|
|
|
|
|
function numOfPendingEnsUsernames() {
|
|
|
|
if(!root.ensUsernamesModule)
|
|
|
|
return 0
|
|
|
|
ensUsernamesModule.numOfPendingEnsUsernames()
|
|
|
|
}
|
|
|
|
|
|
|
|
function ensDetails(ensUsername) {
|
|
|
|
if(!root.ensUsernamesModule)
|
|
|
|
return ""
|
|
|
|
ensUsernamesModule.fetchDetailsForEnsUsername(ensUsername)
|
|
|
|
}
|
|
|
|
|
|
|
|
function setPubKeyGasEstimate(ensUsername, address) {
|
|
|
|
if(!root.ensUsernamesModule)
|
|
|
|
return 0
|
|
|
|
return ensUsernamesModule.setPubKeyGasEstimate(ensUsername, address)
|
|
|
|
}
|
|
|
|
|
2022-10-17 10:17:25 +00:00
|
|
|
function authenticateAndSetPubKey(ensUsername, address, gas, gasPrice, maxPriorityFeePerGas, maxFeePerGas, eip1559Enabled) {
|
2022-01-17 08:56:44 +00:00
|
|
|
if(!root.ensUsernamesModule)
|
|
|
|
return ""
|
2022-10-17 10:17:25 +00:00
|
|
|
return ensUsernamesModule.authenticateAndSetPubKey(ensUsername, address, gas, gasPrice, maxPriorityFeePerGas, maxFeePerGas, eip1559Enabled)
|
2022-01-17 08:56:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function getEtherscanLink() {
|
|
|
|
if(!root.ensUsernamesModule)
|
|
|
|
return ""
|
|
|
|
return ensUsernamesModule.getEtherscanLink()
|
|
|
|
}
|
|
|
|
|
|
|
|
function getSigningPhrase() {
|
|
|
|
if(!root.ensUsernamesModule)
|
|
|
|
return ""
|
|
|
|
return ensUsernamesModule.getSigningPhrase()
|
|
|
|
}
|
|
|
|
|
|
|
|
function copyToClipboard(value) {
|
|
|
|
globalUtils.copyToClipboard(value)
|
|
|
|
}
|
|
|
|
|
2022-10-17 10:17:25 +00:00
|
|
|
function authenticateAndReleaseEns(ensUsername, address, gas, gasPrice, maxPriorityFeePerGas, maxFeePerGas, eip1559Enabled) {
|
2022-01-17 08:56:44 +00:00
|
|
|
if(!root.ensUsernamesModule)
|
|
|
|
return ""
|
2022-10-17 10:17:25 +00:00
|
|
|
return ensUsernamesModule.authenticateAndReleaseEns(ensUsername, address, gas, gasPrice, maxPriorityFeePerGas, maxFeePerGas, eip1559Enabled)
|
2022-01-17 08:56:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function ensConnectOwnedUsername(name, isStatus) {
|
|
|
|
if(!root.ensUsernamesModule)
|
|
|
|
return
|
|
|
|
ensUsernamesModule.connectOwnedUsername(name, isStatus)
|
|
|
|
}
|
|
|
|
|
|
|
|
function getEnsRegisteredAddress() {
|
|
|
|
if(!root.ensUsernamesModule)
|
|
|
|
return ""
|
|
|
|
return ensUsernamesModule.getEnsRegisteredAddress()
|
|
|
|
}
|
|
|
|
|
2022-10-17 10:17:25 +00:00
|
|
|
function authenticateAndRegisterEns(ensUsername, address, gasLimit, gasPrice, tipLimit, overallLimit, eip1559Enabled) {
|
2022-01-17 08:56:44 +00:00
|
|
|
if(!root.ensUsernamesModule)
|
2022-10-17 10:17:25 +00:00
|
|
|
return
|
|
|
|
ensUsernamesModule.authenticateAndRegisterEns(ensUsername, address, gasLimit, gasPrice, tipLimit, overallLimit, eip1559Enabled)
|
2022-01-17 08:56:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function getEnsRegistry() {
|
|
|
|
if(!root.ensUsernamesModule)
|
|
|
|
return ""
|
|
|
|
return ensUsernamesModule.getEnsRegistry()
|
|
|
|
}
|
|
|
|
|
|
|
|
function getSntBalance() {
|
|
|
|
if(!root.ensUsernamesModule)
|
|
|
|
return ""
|
|
|
|
return ensUsernamesModule.getSNTBalance()
|
|
|
|
}
|
|
|
|
|
|
|
|
function getWalletDefaultAddress() {
|
|
|
|
if(!root.ensUsernamesModule)
|
|
|
|
return ""
|
|
|
|
return ensUsernamesModule.getWalletDefaultAddress()
|
|
|
|
}
|
|
|
|
|
|
|
|
function getCurrentCurrency() {
|
|
|
|
if(!root.ensUsernamesModule)
|
|
|
|
return ""
|
|
|
|
return ensUsernamesModule.getCurrentCurrency()
|
|
|
|
}
|
|
|
|
|
2022-10-17 10:17:25 +00:00
|
|
|
function getFiatValue(balance, cryptoSymbol, fiatSymbol) {
|
2022-01-17 08:56:44 +00:00
|
|
|
if(!root.ensUsernamesModule)
|
|
|
|
return ""
|
2022-10-17 10:17:25 +00:00
|
|
|
return ensUsernamesModule.getFiatValue(balance, cryptoSymbol, fiatSymbol)
|
2022-01-17 08:56:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function getGasEthValue(gweiValue, gasLimit) {
|
|
|
|
if(!root.ensUsernamesModule)
|
|
|
|
return ""
|
|
|
|
return ensUsernamesModule.getGasEthValue(gweiValue, gasLimit)
|
|
|
|
}
|
|
|
|
|
2022-08-19 14:51:24 +00:00
|
|
|
function getEstimatedTime(chainId, maxFeePerGas) {
|
|
|
|
return walletSectionTransactions.getEstimatedTime(chainId, maxFeePerGas)
|
|
|
|
}
|
|
|
|
|
2022-01-17 08:56:44 +00:00
|
|
|
function getStatusToken() {
|
|
|
|
if(!root.ensUsernamesModule)
|
|
|
|
return ""
|
|
|
|
return ensUsernamesModule.getStatusToken()
|
|
|
|
}
|
2022-04-19 11:13:57 +00:00
|
|
|
|
2022-05-19 08:53:57 +00:00
|
|
|
function suggestedFees(chainId) {
|
|
|
|
return JSON.parse(walletSectionTransactions.suggestedFees(chainId))
|
|
|
|
}
|
|
|
|
|
|
|
|
function getChainIdForEns() {
|
|
|
|
if(!root.ensUsernamesModule)
|
|
|
|
return ""
|
|
|
|
return ensUsernamesModule.getChainIdForEns()
|
2022-04-19 11:13:57 +00:00
|
|
|
}
|
2022-01-17 08:56:44 +00:00
|
|
|
}
|
|
|
|
|