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.} = proc getUsernameRegistrar(self: EnsManager): string {.slot.} =
result = statusRegistrarAddress() result = statusRegistrarAddress()
proc getENSRegistry(self: EnsManager): string {.slot.} =
result = registry
proc formatUsername(username: string, isStatus: bool): string = proc formatUsername(username: string, isStatus: bool): string =
result = username result = username
if isStatus: if isStatus:

View File

@ -22,7 +22,7 @@ method init*(self: Service) =
method resourceUrl*(self: Service, username: string): (string, string, string) = method resourceUrl*(self: Service, username: string): (string, string, string) =
try: 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) return (response.result{"Scheme"}.getStr, response.result{"Host"}.getStr, response.result{"Path"}.getStr)
except Exception as e: except Exception as e:
error "Error getting ENS resourceUrl", username=username, exception=e.msg error "Error getting ENS resourceUrl", username=username, exception=e.msg

View File

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

View File

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

2
vendor/status-lib vendored

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