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