refactor(@desktop/wallet): Attach utils data to main account

This commit is contained in:
Anthony Laibe 2021-10-18 09:30:25 +02:00 committed by Iuri Matias
parent 0b38ec2568
commit c97138c1dd
2 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,22 @@
import strformat
type
Item* = object
etherscanLink: string
signingPhrase: string
proc initItem*(etherscanLink: string, signingPhrase: string): Item =
result.etherscanLink = etherscanLink
result.signingPhrase = signingPhrase
proc `$`*(self: Item): string =
result = fmt"""MainAccountItem(
etherscanLink: {self.etherscanLink},
signingPhrase: {self.signingPhrase}
]"""
proc getEtherscanLink*(self: Item): string =
return self.etherscanLink
proc getSigningPhrase*(self: Item): string =
return self.signingPhrase

View File

@ -1,8 +1,11 @@
import NimQml
import ./item
QtObject:
type
View* = ref object of QObject
item: Item
proc setup(self: View) =
self.QObject.setup