2022-01-17 09:56:44 +01:00
|
|
|
import QtQuick 2.13
|
|
|
|
import utils 1.0
|
2023-01-11 19:10:13 +03:00
|
|
|
import SortFilterProxyModel 0.2
|
2022-01-17 09:56:44 +01:00
|
|
|
|
|
|
|
QtObject {
|
|
|
|
id: root
|
|
|
|
|
|
|
|
property var ensUsernamesModule
|
|
|
|
|
|
|
|
property var ensUsernamesModel: root.ensUsernamesModule ? ensUsernamesModule.model : []
|
|
|
|
|
2023-01-11 19:10:13 +03:00
|
|
|
readonly property QtObject currentChainEnsUsernamesModel: SortFilterProxyModel {
|
|
|
|
sourceModel: root.ensUsernamesModel
|
|
|
|
filters: ValueFilter {
|
|
|
|
roleName: "chainId"
|
|
|
|
value: root.chainId
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-10-15 14:26:45 +02:00
|
|
|
property string pubkey: userProfile.pubKey
|
|
|
|
property string icon: userProfile.icon
|
|
|
|
property string preferredUsername: userProfile.preferredName
|
2024-01-08 15:47:07 +01:00
|
|
|
readonly property string chainId: mainModule.appNetworkId
|
2022-01-17 09:56:44 +01:00
|
|
|
|
2024-10-15 14:26:45 +02:00
|
|
|
property string username: userProfile.username
|
2022-01-17 09:56:44 +01:00
|
|
|
|
|
|
|
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
|
2022-12-06 23:42:18 +03:00
|
|
|
return ensUsernamesModule.numOfPendingEnsUsernames()
|
2022-01-17 09:56:44 +01:00
|
|
|
}
|
|
|
|
|
2023-01-11 19:10:13 +03:00
|
|
|
function ensDetails(chainId, ensUsername) {
|
2022-01-17 09:56:44 +01:00
|
|
|
if(!root.ensUsernamesModule)
|
|
|
|
return ""
|
2023-01-11 19:10:13 +03:00
|
|
|
ensUsernamesModule.fetchDetailsForEnsUsername(chainId, ensUsername)
|
2022-01-17 09:56:44 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2024-10-30 09:14:52 +01:00
|
|
|
function getEtherscanTxLink() {
|
2022-01-17 09:56:44 +01:00
|
|
|
if(!root.ensUsernamesModule)
|
|
|
|
return ""
|
2024-10-30 09:14:52 +01:00
|
|
|
return ensUsernamesModule.getEtherscanTxLink()
|
|
|
|
}
|
|
|
|
|
|
|
|
function getEtherscanAddressLink() {
|
|
|
|
if(!root.ensUsernamesModule)
|
|
|
|
return ""
|
|
|
|
return ensUsernamesModule.getEtherscanAddressLink()
|
2022-01-17 09:56:44 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
function ensConnectOwnedUsername(name, isStatus) {
|
|
|
|
if(!root.ensUsernamesModule)
|
|
|
|
return
|
|
|
|
ensUsernamesModule.connectOwnedUsername(name, isStatus)
|
|
|
|
}
|
|
|
|
|
|
|
|
function getEnsRegisteredAddress() {
|
|
|
|
if(!root.ensUsernamesModule)
|
|
|
|
return ""
|
|
|
|
return ensUsernamesModule.getEnsRegisteredAddress()
|
|
|
|
}
|
|
|
|
|
|
|
|
function getEnsRegistry() {
|
|
|
|
if(!root.ensUsernamesModule)
|
|
|
|
return ""
|
|
|
|
return ensUsernamesModule.getEnsRegistry()
|
|
|
|
}
|
|
|
|
|
|
|
|
function getWalletDefaultAddress() {
|
|
|
|
if(!root.ensUsernamesModule)
|
|
|
|
return ""
|
|
|
|
return ensUsernamesModule.getWalletDefaultAddress()
|
|
|
|
}
|
|
|
|
|
|
|
|
function getCurrentCurrency() {
|
|
|
|
if(!root.ensUsernamesModule)
|
|
|
|
return ""
|
|
|
|
return ensUsernamesModule.getCurrentCurrency()
|
|
|
|
}
|
|
|
|
|
|
|
|
function getGasEthValue(gweiValue, gasLimit) {
|
|
|
|
if(!root.ensUsernamesModule)
|
|
|
|
return ""
|
|
|
|
return ensUsernamesModule.getGasEthValue(gweiValue, gasLimit)
|
|
|
|
}
|
|
|
|
|
2024-02-05 17:44:49 +01:00
|
|
|
function getStatusTokenKey() {
|
2022-01-17 09:56:44 +01:00
|
|
|
if(!root.ensUsernamesModule)
|
|
|
|
return ""
|
2024-02-05 17:44:49 +01:00
|
|
|
return ensUsernamesModule.getStatusTokenKey()
|
2022-01-17 09:56:44 +01:00
|
|
|
}
|
2022-04-19 13:13:57 +02:00
|
|
|
|
2023-01-11 19:10:13 +03:00
|
|
|
function removeEnsUsername(chainId, ensUsername) {
|
2022-12-07 00:12:09 +03:00
|
|
|
if(!root.ensUsernamesModule)
|
|
|
|
return ""
|
2023-01-11 19:10:13 +03:00
|
|
|
return ensUsernamesModule.removeEnsUsername(chainId, ensUsername)
|
2022-12-07 00:12:09 +03:00
|
|
|
}
|
2022-01-17 09:56:44 +01:00
|
|
|
}
|
|
|
|
|