feat: Use ens API

This commit is contained in:
Anthony Laibe 2021-12-22 14:41:39 +01:00 committed by Anthony Laibe
parent 528210b50f
commit 64edace12a
5 changed files with 6 additions and 11 deletions

View File

@ -228,9 +228,6 @@ QtObject:
proc getUsernameRegistrar(self: EnsManager): string {.slot.} =
result = statusRegistrarAddress()
proc getENSRegistry(self: EnsManager): string {.slot.} =
result = registry
proc formatUsername(username: string, isStatus: bool): string =
result = username
if isStatus:

View File

@ -22,7 +22,7 @@ method init*(self: Service) =
method resourceUrl*(self: Service, username: string): (string, string, string) =
try:
let response = status_go.resourceURL(username)
let response = status_go.resourceURL(chainId=1, username=username)
return (response.result{"Scheme"}.getStr, response.result{"Host"}.getStr, response.result{"Path"}.getStr)
except Exception as e:
error "Error getting ENS resourceUrl", username=username, exception=e.msg

View File

@ -246,10 +246,6 @@ QtObject {
return profileModelInst.ens.getUsernameRegistrar()
}
function getEnsRegistry() {
return profileModelInst.ens.getENSRegistry()
}
function releaseEnsEstimate(username, address) {
return profileModelInst.ens.releaseEstimate(username, address)
}

View File

@ -17,6 +17,8 @@ Item {
property var store
property string username: ""
readonly property string ensRegistry: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"
signal backBtnClicked();
signal usernameRegistered(userName: string);
@ -187,7 +189,7 @@ Item {
StatusBaseText {
//% "%1 (ENS Registry)."
text: qsTrId("-1--ens-registry--").arg(root.store.getEnsRegistry())
text: qsTrId("-1--ens-registry--").arg(root.ensRegistry)
wrapMode: Text.WordWrap
anchors.left: parent.left
anchors.right: parent.right
@ -197,7 +199,7 @@ Item {
StatusBaseText {
//% "<a href='%1%2'>Look up on Etherscan</a>"
text: qsTrId("-a-href---1-2--look-up-on-etherscan--a-").arg(root.store.etherscanLink.replace("/tx", "/address")).arg(root.store.getEnsRegistry())
text: qsTrId("-a-href---1-2--look-up-on-etherscan--a-").arg(root.store.etherscanLink.replace("/tx", "/address")).arg(root.ensRegistry)
anchors.left: parent.left
anchors.right: parent.right
onLinkActivated: appMain.openLink(link)

2
vendor/status-lib vendored

@ -1 +1 @@
Subproject commit 1049b37c497aaafeca4d3050543adfe950623d76
Subproject commit b50781358724932e695876e86df7ed6cc85b4c75