refactor(@desktop/wallet): Attach utils data to main account
This commit is contained in:
parent
0b38ec2568
commit
c97138c1dd
|
@ -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
|
|
@ -1,8 +1,11 @@
|
||||||
import NimQml
|
import NimQml
|
||||||
|
|
||||||
|
import ./item
|
||||||
|
|
||||||
QtObject:
|
QtObject:
|
||||||
type
|
type
|
||||||
View* = ref object of QObject
|
View* = ref object of QObject
|
||||||
|
item: Item
|
||||||
|
|
||||||
proc setup(self: View) =
|
proc setup(self: View) =
|
||||||
self.QObject.setup
|
self.QObject.setup
|
||||||
|
|
Loading…
Reference in New Issue