chore: new parameters for local pairing (#15943)
* wip * chore: cleanup variables * chore: cleanup * fix: remove defaultWalletEmoji * chore: update status-go * chore: update status-go
This commit is contained in:
parent
a16270dfcc
commit
e279e639a4
|
@ -238,9 +238,6 @@ proc getDisplayName*(self: Controller): string =
|
|||
proc setPassword*(self: Controller, value: string) =
|
||||
self.tmpPassword = value
|
||||
|
||||
proc setDefaultWalletEmoji*(self: Controller, emoji: string) =
|
||||
self.accountsService.setDefaultWalletEmoji(emoji)
|
||||
|
||||
proc getPassword*(self: Controller): string =
|
||||
return self.tmpPassword
|
||||
|
||||
|
@ -323,7 +320,6 @@ proc cleanTmpData(self: Controller) =
|
|||
self.tmpKeychainErrorOccurred = false
|
||||
self.setDisplayName("")
|
||||
self.setPassword("")
|
||||
self.setDefaultWalletEmoji("")
|
||||
self.setPin("")
|
||||
self.setPinMatch(false)
|
||||
self.setPuk("")
|
||||
|
|
|
@ -83,9 +83,6 @@ method getDisplayName*(self: AccessInterface): string {.base.} =
|
|||
method setPassword*(self: AccessInterface, value: string) {.base.} =
|
||||
raise newException(ValueError, "No implementation available")
|
||||
|
||||
method setDefaultWalletEmoji*(self: AccessInterface, emoji: string) {.base.} =
|
||||
raise newException(ValueError, "No implementation available")
|
||||
|
||||
method getPassword*(self: AccessInterface): string {.base.} =
|
||||
raise newException(ValueError, "No implementation available")
|
||||
|
||||
|
|
|
@ -270,9 +270,6 @@ method getDisplayName*[T](self: Module[T]): string =
|
|||
method setPassword*[T](self: Module[T], value: string) =
|
||||
self.controller.setPassword(value)
|
||||
|
||||
method setDefaultWalletEmoji*[T](self: Module[T], emoji: string) =
|
||||
self.controller.setDefaultWalletEmoji(emoji)
|
||||
|
||||
method getPassword*[T](self: Module[T]): string =
|
||||
return self.controller.getPassword()
|
||||
|
||||
|
|
|
@ -145,9 +145,6 @@ QtObject:
|
|||
proc setPassword*(self: View, value: string) {.slot.} =
|
||||
self.delegate.setPassword(value)
|
||||
|
||||
proc setDefaultWalletEmoji*(self: View, emoji: string) {.slot.} =
|
||||
self.delegate.setDefaultWalletEmoji(emoji)
|
||||
|
||||
proc getPassword*(self: View): string {.slot.} =
|
||||
return self.delegate.getPassword()
|
||||
|
||||
|
|
|
@ -1,288 +0,0 @@
|
|||
import json
|
||||
import ../../constants as main_constants
|
||||
import strformat
|
||||
|
||||
let STATUS_PROXY_HOST = "api.status.im"
|
||||
|
||||
var NETWORKS* = %* [
|
||||
{
|
||||
"chainId": 1,
|
||||
"chainName": "Mainnet",
|
||||
"defaultRpcUrl": fmt"https://{BUILD_MODE}.{STATUS_PROXY_HOST}/grove/ethereum/mainnet/{POKT_TOKEN_RESOLVED}",
|
||||
"defaultFallbackUrl": fmt"https://{BUILD_MODE}.{STATUS_PROXY_HOST}/infura/ethereum/mainnet/{INFURA_TOKEN_RESOLVED}",
|
||||
"rpcUrl": "https://eth-archival.rpc.grove.city/v1/" & POKT_TOKEN_RESOLVED,
|
||||
"fallbackUrl": "https://mainnet.infura.io/v3/" & INFURA_TOKEN_RESOLVED,
|
||||
"blockExplorerUrl": "https://etherscan.io/",
|
||||
"iconUrl": "network/Network=Ethereum",
|
||||
"chainColor": "#627EEA",
|
||||
"shortName": "eth",
|
||||
"nativeCurrencyName": "Ether",
|
||||
"nativeCurrencySymbol": "ETH",
|
||||
"nativeCurrencyDecimals": 18,
|
||||
"isTest": false,
|
||||
"layer": 1,
|
||||
"enabled": true,
|
||||
"relatedChainId": 5,
|
||||
},
|
||||
{
|
||||
"chainId": 5,
|
||||
"chainName": "Mainnet",
|
||||
"rpcUrl": "https://goerli.infura.io/v3/" & INFURA_TOKEN_RESOLVED,
|
||||
"fallbackUrl": "",
|
||||
"blockExplorerUrl": "https://goerli.etherscan.io/",
|
||||
"iconUrl": "network/Network=Ethereum",
|
||||
"chainColor": "#627EEA",
|
||||
"shortName": "eth",
|
||||
"nativeCurrencyName": "Ether",
|
||||
"nativeCurrencySymbol": "ETH",
|
||||
"nativeCurrencyDecimals": 18,
|
||||
"isTest": true,
|
||||
"layer": 1,
|
||||
"enabled": true,
|
||||
"relatedChainId": 1,
|
||||
},
|
||||
{
|
||||
"chainId": 10,
|
||||
"chainName": "Optimism",
|
||||
"defaultRpcUrl": fmt"https://{BUILD_MODE}.{STATUS_PROXY_HOST}/grove/optimism/mainnet/{POKT_TOKEN_RESOLVED}",
|
||||
"defaultFallbackUrl": fmt"https://{BUILD_MODE}.{STATUS_PROXY_HOST}/infura/optimism/mainnet/{INFURA_TOKEN_RESOLVED}",
|
||||
"rpcUrl": "https://optimism-archival.rpc.grove.city/v1/" & POKT_TOKEN_RESOLVED,
|
||||
"fallbackUrl": "https://optimism-mainnet.infura.io/v3/" & INFURA_TOKEN_RESOLVED,
|
||||
"blockExplorerUrl": "https://optimistic.etherscan.io",
|
||||
"iconUrl": "network/Network=Optimism",
|
||||
"chainColor": "#E90101",
|
||||
"shortName": "oeth",
|
||||
"nativeCurrencyName": "Ether",
|
||||
"nativeCurrencySymbol": "ETH",
|
||||
"nativeCurrencyDecimals": 18,
|
||||
"isTest": false,
|
||||
"layer": 2,
|
||||
"enabled": true,
|
||||
"relatedChainId": 420,
|
||||
},
|
||||
{
|
||||
"chainId": 420,
|
||||
"chainName": "Optimism",
|
||||
"rpcUrl": "https://optimism-goerli.infura.io/v3/" & INFURA_TOKEN_RESOLVED,
|
||||
"fallbackUrl": "",
|
||||
"blockExplorerUrl": "https://goerli-optimism.etherscan.io/",
|
||||
"iconUrl": "network/Network=Optimism",
|
||||
"chainColor": "#E90101",
|
||||
"shortName": "oeth",
|
||||
"nativeCurrencyName": "Ether",
|
||||
"nativeCurrencySymbol": "ETH",
|
||||
"nativeCurrencyDecimals": 18,
|
||||
"isTest": true,
|
||||
"layer": 2,
|
||||
"enabled": true,
|
||||
"relatedChainId": 10,
|
||||
},
|
||||
{
|
||||
"chainId": 42161,
|
||||
"chainName": "Arbitrum",
|
||||
"defaultRpcUrl": fmt"https://{BUILD_MODE}.{STATUS_PROXY_HOST}/grove/arbitrum/mainnet/{POKT_TOKEN_RESOLVED}",
|
||||
"defaultFallbackUrl": fmt"https://{BUILD_MODE}.{STATUS_PROXY_HOST}/infura/arbitrum/mainnet/{INFURA_TOKEN_RESOLVED}",
|
||||
"rpcUrl": "https://arbitrum-one.rpc.grove.city/v1/" & POKT_TOKEN_RESOLVED,
|
||||
"fallbackUrl": "https://arbitrum-mainnet.infura.io/v3/" & INFURA_TOKEN_RESOLVED,
|
||||
"blockExplorerUrl": "https://arbiscan.io/",
|
||||
"iconUrl": "network/Network=Arbitrum",
|
||||
"chainColor": "#51D0F0",
|
||||
"shortName": "arb1",
|
||||
"nativeCurrencyName": "Ether",
|
||||
"nativeCurrencySymbol": "ETH",
|
||||
"nativeCurrencyDecimals": 18,
|
||||
"isTest": false,
|
||||
"layer": 2,
|
||||
"enabled": true,
|
||||
"relatedChainId": 421613,
|
||||
},
|
||||
{
|
||||
"chainId": 421613,
|
||||
"chainName": "Arbitrum",
|
||||
"rpcUrl": "https://arbitrum-goerli.infura.io/v3/" & INFURA_TOKEN_RESOLVED,
|
||||
"fallbackUrl": "",
|
||||
"blockExplorerUrl": "https://goerli.arbiscan.io/",
|
||||
"iconUrl": "network/Network=Arbitrum",
|
||||
"chainColor": "#51D0F0",
|
||||
"shortName": "arb1",
|
||||
"nativeCurrencyName": "Ether",
|
||||
"nativeCurrencySymbol": "ETH",
|
||||
"nativeCurrencyDecimals": 18,
|
||||
"isTest": true,
|
||||
"layer": 2,
|
||||
"enabled": true,
|
||||
"relatedChainId": 42161,
|
||||
},
|
||||
{
|
||||
"chainId": 11155111,
|
||||
"chainName": "Mainnet",
|
||||
"defaultRpcUrl": fmt"https://{BUILD_MODE}.{STATUS_PROXY_HOST}/grove/ethereum/sepolia/{POKT_TOKEN_RESOLVED}",
|
||||
"defaultFallbackUrl": fmt"https://{BUILD_MODE}.{STATUS_PROXY_HOST}/infura/ethereum/sepolia/{INFURA_TOKEN_RESOLVED}",
|
||||
"rpcUrl": "https://sepolia-archival.rpc.grove.city/v1/" & POKT_TOKEN_RESOLVED,
|
||||
"fallbackUrl": "https://sepolia.infura.io/v3/" & INFURA_TOKEN_RESOLVED,
|
||||
"blockExplorerUrl": "https://sepolia.etherscan.io/",
|
||||
"iconUrl": "network/Network=Ethereum",
|
||||
"chainColor": "#627EEA",
|
||||
"shortName": "eth",
|
||||
"nativeCurrencyName": "Ether",
|
||||
"nativeCurrencySymbol": "ETH",
|
||||
"nativeCurrencyDecimals": 18,
|
||||
"isTest": true,
|
||||
"layer": 1,
|
||||
"enabled": true,
|
||||
"relatedChainId": 1,
|
||||
},
|
||||
{
|
||||
"chainId": 11155420,
|
||||
"chainName": "Optimism",
|
||||
"defaultRpcUrl": fmt"https://{BUILD_MODE}.{STATUS_PROXY_HOST}/grove/optimism/sepolia/{POKT_TOKEN_RESOLVED}",
|
||||
"defaultFallbackUrl": fmt"https://{BUILD_MODE}.{STATUS_PROXY_HOST}/infura/optimism/sepolia/{INFURA_TOKEN_RESOLVED}",
|
||||
"rpcUrl": "https://optimism-sepolia-archival.rpc.grove.city/v1/" & POKT_TOKEN_RESOLVED,
|
||||
"fallbackUrl": "https://optimism-sepolia.infura.io/v3/" & INFURA_TOKEN_RESOLVED,
|
||||
"blockExplorerUrl": "https://sepolia-optimism.etherscan.io/",
|
||||
"iconUrl": "network/Network=Optimism",
|
||||
"chainColor": "#E90101",
|
||||
"shortName": "oeth",
|
||||
"nativeCurrencyName": "Ether",
|
||||
"nativeCurrencySymbol": "ETH",
|
||||
"nativeCurrencyDecimals": 18,
|
||||
"isTest": true,
|
||||
"layer": 2,
|
||||
"enabled": true,
|
||||
"relatedChainId": 10,
|
||||
},
|
||||
{
|
||||
"chainId": 421614,
|
||||
"chainName": "Arbitrum",
|
||||
"defaultRpcUrl": fmt"https://{BUILD_MODE}.{STATUS_PROXY_HOST}/grove/arbitrum/sepolia/{POKT_TOKEN_RESOLVED}",
|
||||
"defaultFallbackUrl": fmt"https://{BUILD_MODE}.{STATUS_PROXY_HOST}/infura/arbitrum/sepolia/{INFURA_TOKEN_RESOLVED}",
|
||||
"rpcUrl": "https://arbitrum-sepolia-archival.rpc.grove.city/v1/" & POKT_TOKEN_RESOLVED,
|
||||
"fallbackUrl": "https://arbitrum-sepolia.infura.io/v3/" & INFURA_TOKEN_RESOLVED,
|
||||
"blockExplorerUrl": "https://sepolia-explorer.arbitrum.io/",
|
||||
"iconUrl": "network/Network=Arbitrum",
|
||||
"chainColor": "#51D0F0",
|
||||
"shortName": "arb1",
|
||||
"nativeCurrencyName": "Ether",
|
||||
"nativeCurrencySymbol": "ETH",
|
||||
"nativeCurrencyDecimals": 18,
|
||||
"isTest": true,
|
||||
"layer": 2,
|
||||
"enabled": true,
|
||||
"relatedChainId": 42161,
|
||||
}
|
||||
]
|
||||
|
||||
var NODE_CONFIG* = %* {
|
||||
"BrowsersConfig": {
|
||||
"Enabled": true
|
||||
},
|
||||
"ClusterConfig": {
|
||||
"Enabled": true,
|
||||
"ClusterID": MAIN_STATUS_SHARD_CLUSTER_ID
|
||||
},
|
||||
"DataDir": "./ethereum/mainnet",
|
||||
"EnableNTPSync": true,
|
||||
"KeyStoreDir": "./keystore",
|
||||
"IPFSDir": "./ipfs",
|
||||
"LogEnabled": true,
|
||||
"LogFile": "geth.log",
|
||||
# Set Max number of log files kept to 1
|
||||
# Setting it to 0 creates a problem where all log files are kepts
|
||||
# Docs: https://pkg.go.dev/gopkg.in/natefinch/lumberjack.v2@v2.0.0#readme-cleaning-up-old-log-files
|
||||
"LogMaxBackups": 1,
|
||||
"LogMaxSize": 100, # MB
|
||||
"LogLevel": main_constants.DEFAULT_LOG_LEVEL,
|
||||
"MailserversConfig": {
|
||||
"Enabled": true
|
||||
},
|
||||
"Name": "StatusDesktop",
|
||||
"NetworkId": 1,
|
||||
"NoDiscovery": true,
|
||||
"PermissionsConfig": {
|
||||
"Enabled": true
|
||||
},
|
||||
"Rendezvous": false,
|
||||
"RegisterTopics": @["whispermail"],
|
||||
"RequireTopics": {
|
||||
"whisper": {
|
||||
"Max": 2,
|
||||
"Min": 2
|
||||
}
|
||||
},
|
||||
"ShhextConfig": {
|
||||
"BackupDisabledDataDir": "./",
|
||||
"DataSyncEnabled": true,
|
||||
"InstallationID": "aef27732-8d86-5039-a32e-bdbe094d8791",
|
||||
"MailServerConfirmations": true,
|
||||
"MaxMessageDeliveryAttempts": 6,
|
||||
"PFSEnabled": true,
|
||||
"VerifyENSContractAddress": "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",
|
||||
"VerifyENSURL": "https://mainnet.infura.io/v3/" & INFURA_TOKEN_RESOLVED,
|
||||
"VerifyTransactionChainID": 1,
|
||||
"VerifyTransactionURL": "https://mainnet.infura.io/v3/" & INFURA_TOKEN_RESOLVED,
|
||||
"BandwidthStatsEnabled": true
|
||||
},
|
||||
"Web3ProviderConfig": {
|
||||
"Enabled": true
|
||||
},
|
||||
"EnsConfig": {
|
||||
"Enabled": true
|
||||
},
|
||||
"StatusAccountsConfig": {
|
||||
"Enabled": true
|
||||
},
|
||||
"UpstreamConfig": {
|
||||
"Enabled": true,
|
||||
"URL": "https://mainnet.infura.io/v3/" & INFURA_TOKEN_RESOLVED
|
||||
},
|
||||
"WakuConfig": {
|
||||
"Enabled": false,
|
||||
"BloomFilterMode": true,
|
||||
"LightClient": true,
|
||||
"MinimumPoW": 0.001
|
||||
},
|
||||
"WakuV2Config": {
|
||||
"Enabled": true,
|
||||
"Host": "0.0.0.0",
|
||||
"Port": WAKU_V2_PORT,
|
||||
"LightClient": false,
|
||||
"PersistPeers": true,
|
||||
"EnableDiscV5": true,
|
||||
"DiscoveryLimit": 20,
|
||||
"UDPPort": WAKU_V2_PORT,
|
||||
"PeerExchange": true,
|
||||
"AutoUpdate": true,
|
||||
"Rendezvous": true,
|
||||
"EnableFilterFullNode": true,
|
||||
"UseShardAsDefaultTopic": true,
|
||||
},
|
||||
# Don't add properties to the login node config that can be changed from within the app
|
||||
"WalletConfig": {
|
||||
"Enabled": true,
|
||||
"OpenseaAPIKey": OPENSEA_API_KEY_RESOLVED,
|
||||
"RaribleMainnetAPIKey": RARIBLE_MAINNET_API_KEY_RESOLVED,
|
||||
"RaribleTestnetAPIKey": RARIBLE_TESTNET_API_KEY_RESOLVED,
|
||||
"AlchemyAPIKeys": %* {
|
||||
"1": ALCHEMY_ETHEREUM_MAINNET_TOKEN_RESOLVED,
|
||||
"5": ALCHEMY_ETHEREUM_GOERLI_TOKEN_RESOLVED,
|
||||
"11155111": ALCHEMY_ETHEREUM_SEPOLIA_TOKEN_RESOLVED,
|
||||
"42161": ALCHEMY_ARBITRUM_MAINNET_TOKEN_RESOLVED,
|
||||
"421613": ALCHEMY_ARBITRUM_GOERLI_TOKEN_RESOLVED,
|
||||
"421614": ALCHEMY_ARBITRUM_SEPOLIA_TOKEN_RESOLVED,
|
||||
"10": ALCHEMY_OPTIMISM_MAINNET_TOKEN_RESOLVED,
|
||||
"420": ALCHEMY_OPTIMISM_GOERLI_TOKEN_RESOLVED,
|
||||
"11155420": ALCHEMY_OPTIMISM_SEPOLIA_TOKEN_RESOLVED
|
||||
},
|
||||
"InfuraAPIKey": INFURA_TOKEN_RESOLVED,
|
||||
"InfuraAPIKeySecret": INFURA_TOKEN_SECRET_RESOLVED,
|
||||
"LoadAllTransfers": true,
|
||||
},
|
||||
"Networks": NETWORKS,
|
||||
"TorrentConfig": {
|
||||
"Enabled": false,
|
||||
"Port": TORRENT_CONFIG_PORT,
|
||||
"DataDir": DEFAULT_TORRENT_CONFIG_DATADIR,
|
||||
"TorrentDir": DEFAULT_TORRENT_CONFIG_TORRENTDIR
|
||||
},
|
||||
"OutputMessageCSVEnabled": false
|
||||
}
|
|
@ -16,7 +16,7 @@ import ../../../app/core/eventemitter
|
|||
import ../../../app/core/signals/types
|
||||
import ../../../app/core/tasks/[qt, threadpool]
|
||||
import ../../../app/core/fleets/fleet_configuration
|
||||
import ../../common/[account_constants, network_constants, utils]
|
||||
import ../../common/[account_constants, utils]
|
||||
import ../../../constants as main_constants
|
||||
|
||||
export dto_accounts
|
||||
|
@ -60,7 +60,6 @@ QtObject:
|
|||
accounts: seq[AccountDto]
|
||||
loggedInAccount: AccountDto
|
||||
keyStoreDir: string
|
||||
defaultWalletEmoji: string
|
||||
tmpAccount: AccountDto
|
||||
tmpHashedPassword: string
|
||||
|
||||
|
@ -76,7 +75,6 @@ QtObject:
|
|||
result.threadpool = threadpool
|
||||
result.fleetConfiguration = fleetConfiguration
|
||||
result.keyStoreDir = main_constants.ROOTKEYSTOREDIR
|
||||
result.defaultWalletEmoji = ""
|
||||
|
||||
proc scheduleReencrpytion(self: Service, account: AccountDto, hashedPassword: string, timeout: int = 1000)
|
||||
|
||||
|
@ -103,9 +101,6 @@ QtObject:
|
|||
proc getKeyStoreDir*(self: Service): string =
|
||||
return self.keyStoreDir
|
||||
|
||||
proc setDefaultWalletEmoji*(self: Service, emoji: string) =
|
||||
self.defaultWalletEmoji = emoji
|
||||
|
||||
proc connectToFetchingFromWakuEvents*(self: Service) =
|
||||
self.events.on(SignalType.WakuBackedUpProfile.event) do(e: Args):
|
||||
var receivedData = WakuBackedUpProfileSignal(e)
|
||||
|
@ -145,47 +140,6 @@ QtObject:
|
|||
return "DEBUG"
|
||||
return logLevel
|
||||
|
||||
# TODO: Remove after https://github.com/status-im/status-desktop/issues/11435
|
||||
proc getDefaultNodeConfig*(self: Service, installationId: string, recoverAccount: bool): JsonNode =
|
||||
let fleet = Fleet.StatusProd
|
||||
let dnsDiscoveryURL = "enrtree://AMOJVZX4V6EXP7NTJPMAYJYST2QP6AJXYW76IU6VGJS7UVSNDYZG4@boot.prod.status.nodes.status.im"
|
||||
|
||||
result = NODE_CONFIG.copy()
|
||||
result["ClusterConfig"]["Fleet"] = newJString($fleet)
|
||||
result["NetworkId"] = NETWORKS[0]{"chainId"}
|
||||
result["DataDir"] = "ethereum".newJString()
|
||||
result["UpstreamConfig"]["Enabled"] = true.newJBool()
|
||||
result["UpstreamConfig"]["URL"] = NETWORKS[0]{"rpcUrl"}
|
||||
result["ShhextConfig"]["InstallationID"] = newJString(installationId)
|
||||
|
||||
|
||||
result["ClusterConfig"]["WakuNodes"] = %* @[dnsDiscoveryURL]
|
||||
|
||||
var discV5Bootnodes = self.fleetConfiguration.getNodes(fleet, FleetNodes.WakuENR)
|
||||
discV5Bootnodes.add(dnsDiscoveryURL)
|
||||
|
||||
result["ClusterConfig"]["DiscV5BootstrapNodes"] = %* discV5Bootnodes
|
||||
|
||||
if TEST_PEER_ENR != "":
|
||||
let testPeerENRArr = %* @[TEST_PEER_ENR]
|
||||
result["ClusterConfig"]["WakuNodes"] = %* testPeerENRArr
|
||||
result["ClusterConfig"]["BootNodes"] = %* testPeerENRArr
|
||||
result["ClusterConfig"]["TrustedMailServers"] = %* testPeerENRArr
|
||||
result["ClusterConfig"]["StaticNodes"] = %* testPeerENRArr
|
||||
result["ClusterConfig"]["RendezvousNodes"] = %* (@[])
|
||||
result["ClusterConfig"]["DiscV5BootstrapNodes"] = %* (@[])
|
||||
result["Rendezvous"] = newJBool(false)
|
||||
|
||||
result["LogLevel"] = newJString(toStatusGoSupportedLogLevel(main_constants.LOG_LEVEL))
|
||||
|
||||
if STATUS_PORT != 0:
|
||||
result["ListenAddr"] = newJString("0.0.0.0:" & $main_constants.STATUS_PORT)
|
||||
|
||||
result["KeyStoreDir"] = newJString(self.keyStoreDir.replace(main_constants.STATUSGODIR, ""))
|
||||
result["RootDataDir"] = newJString(main_constants.STATUSGODIR)
|
||||
result["KeycardPairingDataFile"] = newJString(main_constants.KEYCARDPAIRINGDATAFILE)
|
||||
result["ProcessBackedupMessages"] = newJBool(recoverAccount)
|
||||
|
||||
# FIXME: remove this method, settings should be processed in status-go
|
||||
# https://github.com/status-im/status-go/issues/5359
|
||||
proc addKeycardDetails(self: Service, kcInstance: string, settingsJson: var JsonNode, accountData: var JsonNode) =
|
||||
|
@ -202,7 +156,7 @@ QtObject:
|
|||
if not accountData.isNil:
|
||||
accountData["keycard-pairing"] = kcDataObj{"key"}
|
||||
|
||||
proc buildWalletSecrets(self: Service): WalletSecretsConfig =
|
||||
proc buildWalletSecrets(): WalletSecretsConfig =
|
||||
return WalletSecretsConfig(
|
||||
poktToken: POKT_TOKEN_RESOLVED,
|
||||
infuraToken: INFURA_TOKEN_RESOLVED,
|
||||
|
@ -225,16 +179,11 @@ QtObject:
|
|||
statusProxyBlockchainPassword: STATUS_PROXY_BLOCKCHAIN_PASSWORD_RESOLVED,
|
||||
)
|
||||
|
||||
proc buildCreateAccountRequest(self: Service, password: string, displayName: string, imagePath: string, imageCropRectangle: ImageCropRectangle): CreateAccountRequest =
|
||||
proc defaultCreateAccountRequest*(): CreateAccountRequest =
|
||||
return CreateAccountRequest(
|
||||
rootDataDir: main_constants.STATUSGODIR,
|
||||
kdfIterations: KDF_ITERATIONS,
|
||||
password: hashPassword(password),
|
||||
displayName: displayName,
|
||||
imagePath: imagePath,
|
||||
imageCropRectangle: imageCropRectangle,
|
||||
customizationColor: DEFAULT_CUSTOMIZATION_COLOR,
|
||||
emoji: self.defaultWalletEmoji,
|
||||
logLevel: some(toStatusGoSupportedLogLevel(main_constants.LOG_LEVEL)),
|
||||
wakuV2LightClient: false,
|
||||
wakuV2EnableMissingMessageVerification: true,
|
||||
|
@ -243,14 +192,22 @@ QtObject:
|
|||
torrentConfigEnabled: some(false),
|
||||
torrentConfigPort: some(TORRENT_CONFIG_PORT),
|
||||
keycardPairingDataFile: main_constants.KEYCARDPAIRINGDATAFILE,
|
||||
walletSecretsConfig: self.buildWalletSecrets(),
|
||||
walletSecretsConfig: buildWalletSecrets(),
|
||||
apiConfig: defaultApiConfig(),
|
||||
statusProxyEnabled: true,
|
||||
)
|
||||
|
||||
proc buildCreateAccountRequest(password: string, displayName: string, imagePath: string, imageCropRectangle: ImageCropRectangle): CreateAccountRequest =
|
||||
var request = defaultCreateAccountRequest()
|
||||
request.password = hashPassword(password)
|
||||
request.displayName = displayName
|
||||
request.imagePath = imagePath
|
||||
request.imageCropRectangle = imageCropRectangle
|
||||
return request
|
||||
|
||||
proc createAccountAndLogin*(self: Service, password: string, displayName: string, imagePath: string, imageCropRectangle: ImageCropRectangle): string =
|
||||
try:
|
||||
let request = self.buildCreateAccountRequest(password, displayName, imagePath, imageCropRectangle)
|
||||
let request = buildCreateAccountRequest(password, displayName, imagePath, imageCropRectangle)
|
||||
let response = status_account.createAccountAndLogin(request)
|
||||
|
||||
if not response.result.contains("error"):
|
||||
|
@ -282,7 +239,7 @@ QtObject:
|
|||
var request = RestoreAccountRequest(
|
||||
mnemonic: mnemonic,
|
||||
fetchBackup: recoverAccount,
|
||||
createAccountRequest: self.buildCreateAccountRequest(password, displayName, imagePath, imageCropRectangle),
|
||||
createAccountRequest: buildCreateAccountRequest(password, displayName, imagePath, imageCropRectangle),
|
||||
)
|
||||
request.createAccountRequest.keycardInstanceUID = keycardInstanceUID
|
||||
|
||||
|
@ -312,7 +269,7 @@ QtObject:
|
|||
var request = RestoreAccountRequest(
|
||||
keycard: keycard,
|
||||
fetchBackup: recoverAccount,
|
||||
createAccountRequest: self.buildCreateAccountRequest("", displayName, imagePath, imageCropRectangle),
|
||||
createAccountRequest: buildCreateAccountRequest("", displayName, imagePath, imageCropRectangle),
|
||||
)
|
||||
request.createAccountRequest.keycardInstanceUID = keycardData.instanceUid
|
||||
|
||||
|
@ -427,7 +384,7 @@ QtObject:
|
|||
passwordHash: passwordHash,
|
||||
keycardWhisperPrivateKey: chatPrivateKey,
|
||||
mnemonic: mnemonic,
|
||||
walletSecretsConfig: self.buildWalletSecrets(),
|
||||
walletSecretsConfig: buildWalletSecrets(),
|
||||
bandwidthStatsEnabled: true,
|
||||
apiConfig: defaultApiConfig(),
|
||||
statusProxyEnabled: true # TODO: read from settings
|
||||
|
|
|
@ -222,15 +222,9 @@ QtObject:
|
|||
return status_go.getConnectionStringForBootstrappingAnotherDevice($configJSON)
|
||||
|
||||
proc inputConnectionStringForBootstrapping*(self: Service, connectionString: string): string =
|
||||
let installationId = $genUUID()
|
||||
let nodeConfigJson = self.accountsService.getDefaultNodeConfig(installationId, recoverAccount = false)
|
||||
let configJSON = %* {
|
||||
"receiverConfig": %* {
|
||||
"keystorePath": main_constants.ROOTKEYSTOREDIR,
|
||||
"deviceType" : hostOs,
|
||||
"nodeConfig": nodeConfigJson,
|
||||
"kdfIterations": self.accountsService.getKdfIterations(),
|
||||
"settingCurrentNetwork": "mainnet_rpc"
|
||||
"createAccount": %*accounts_service.defaultCreateAccountRequest(),
|
||||
},
|
||||
"clientConfig": %* {}
|
||||
}
|
||||
|
@ -365,4 +359,4 @@ QtObject:
|
|||
connectionString: connectionString,
|
||||
configJSON: $configJSON
|
||||
)
|
||||
self.threadpool.start(arg)
|
||||
self.threadpool.start(arg)
|
||||
|
|
|
@ -32,16 +32,12 @@ let
|
|||
TMPDIR* = joinPath(baseDir, "tmp") & sep
|
||||
LOGDIR* = joinPath(baseDir, "logs") & sep
|
||||
KEYCARDPAIRINGDATAFILE* = joinPath(baseDir, "data", "keycard", "pairings.json")
|
||||
DEFAULT_TORRENT_CONFIG_DATADIR* = joinPath(baseDir, "data", "archivedata")
|
||||
DEFAULT_TORRENT_CONFIG_TORRENTDIR* = joinPath(baseDir, "data", "torrents")
|
||||
|
||||
# runtime variables
|
||||
TEST_MODE_ENABLED* = desktopConfig.testMode
|
||||
DISPLAY_MOCKED_KEYCARD_WINDOW* = desktopConfig.displayMockedKeycardWindow
|
||||
WALLET_ENABLED* = desktopConfig.enableWallet
|
||||
TORRENT_CONFIG_PORT* = desktopConfig.defaultTorentConfigPort
|
||||
WAKU_V2_PORT* = desktopConfig.defaultWakuV2Port
|
||||
STATUS_PORT* = desktopConfig.statusPort
|
||||
LOG_LEVEL* = desktopConfig.logLevel
|
||||
FLEET_SELECTION_ENABLED* = desktopConfig.enableFleetSelection
|
||||
|
||||
|
|
|
@ -244,16 +244,6 @@ type StatusDesktopConfig = object
|
|||
desc: "Sets default torrent config port"
|
||||
name: "DEFAULT_TORRENT_CONFIG_PORT"
|
||||
abbr: "default-torrent-config-port" .}: int
|
||||
defaultWakuV2Port* {.
|
||||
defaultValue: 0
|
||||
desc: "Sets default waku v2 port"
|
||||
name: "DEFAULT_WAKU_V2_PORT"
|
||||
abbr: "default-waku-v2-port" .}: int
|
||||
statusPort* {.
|
||||
defaultValue: 0
|
||||
desc: "Sets Waku V1 config port"
|
||||
name: "PORT"
|
||||
abbr: "status-port" .}: int
|
||||
logLevel* {.
|
||||
defaultValue: DEFAULT_LOG_LEVEL
|
||||
desc: "Sets log level"
|
||||
|
|
|
@ -135,6 +135,8 @@ QtObject {
|
|||
readonly property int flagsCount: lastFlagIndex - firstFlagIndex + 1
|
||||
|
||||
// Returns a random emoji excluding flags emojis
|
||||
// WARNING: use status-go RandomWalletEmoji instead.
|
||||
// More details here: https://github.com/status-im/status-go/issues/5663
|
||||
function getRandomEmoji(size) {
|
||||
let whitelistedIndex = Math.floor(Math.random() * (EmojiJSON.emoji_json.length - flagsCount))
|
||||
// Compensating for the missing flags emojis index
|
||||
|
|
|
@ -74,10 +74,6 @@ QtObject {
|
|||
root.startupModuleInst.setPassword(value)
|
||||
}
|
||||
|
||||
function setDefaultWalletEmoji(emoji) {
|
||||
root.startupModuleInst.setDefaultWalletEmoji(emoji)
|
||||
}
|
||||
|
||||
function getPassword() {
|
||||
return root.startupModuleInst.getPassword()
|
||||
}
|
||||
|
|
|
@ -27,7 +27,6 @@ Item {
|
|||
readonly property int zFront: 100
|
||||
|
||||
function submit() {
|
||||
root.startupStore.setDefaultWalletEmoji(StatusQUtils.Emoji.getRandomEmoji(StatusQUtils.Emoji.size.verySmall))
|
||||
root.startupStore.setPassword(view.newPswText)
|
||||
root.startupStore.doPrimaryAction()
|
||||
}
|
||||
|
|
|
@ -36,6 +36,7 @@ Item {
|
|||
}
|
||||
|
||||
if (root.store.addAccountModule.selectedEmoji === "") {
|
||||
// TODO: Reuse status-go RandomWalletEmoji
|
||||
root.store.addAccountModule.selectedEmoji = StatusQUtils.Emoji.getRandomEmoji(StatusQUtils.Emoji.size.verySmall)
|
||||
}
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ Item {
|
|||
}
|
||||
|
||||
let color = Theme.palette.customisationColorsArray[Math.floor(Math.random() * Theme.palette.customisationColorsArray.length)]
|
||||
let emoji = StatusQUtils.Emoji.getRandomEmoji(StatusQUtils.Emoji.size.verySmall)
|
||||
let emoji = StatusQUtils.Emoji.getRandomEmoji(StatusQUtils.Emoji.size.verySmall) // TODO: Reuse status-go RandomWalletEmoji
|
||||
root.sharedKeycardModule.keyPairForProcessing.observedAccount.name = " "
|
||||
root.sharedKeycardModule.keyPairForProcessing.observedAccount.colorId = Utils.getIdForColor(color)
|
||||
root.sharedKeycardModule.keyPairForProcessing.observedAccount.emoji = emoji
|
||||
|
|
|
@ -45,7 +45,7 @@ Item {
|
|||
|
||||
if (d.observedAccount.colorId.length === 0) {
|
||||
let color = Theme.palette.customisationColorsArray[Math.floor(Math.random() * Theme.palette.customisationColorsArray.length)]
|
||||
let emoji = StatusQUtils.Emoji.getRandomEmoji(StatusQUtils.Emoji.size.verySmall)
|
||||
let emoji = StatusQUtils.Emoji.getRandomEmoji(StatusQUtils.Emoji.size.verySmall) // TODO: Reuse status-go RandomWalletEmoji
|
||||
d.observedAccount.colorId = Utils.getIdForColor(color)
|
||||
d.observedAccount.emoji = emoji
|
||||
}
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 4a78d7c1e92efad62b627dbde45a2bec660a5528
|
||||
Subproject commit a00bf6977b1f0b279e20546df575397c36461339
|
Loading…
Reference in New Issue