mirror of
https://github.com/status-im/status-desktop.git
synced 2025-02-03 18:25:33 +00:00
wip simplified keycard api
This commit is contained in:
parent
8460c22240
commit
91513acea2
@ -529,6 +529,12 @@ proc getKeyUidForSeedPhrase*(self: Controller, seedPhrase: string): string =
|
||||
proc getCurrentKeycardServiceFlow*(self: Controller): keycard_service.KCSFlowType =
|
||||
return self.keycardService.getCurrentFlow()
|
||||
|
||||
proc getAppInfoFlow*(self: Controller) =
|
||||
self.keycardService.getAppInfoFlow()
|
||||
|
||||
proc getMetadataFlow*(self: Controller) =
|
||||
self.keycardService.getMetadataFlow()
|
||||
|
||||
proc getLastReceivedKeycardData*(self: Controller): tuple[flowType: string, flowEvent: KeycardEvent] =
|
||||
return self.keycardService.getLastReceivedKeycardData()
|
||||
|
||||
|
@ -41,6 +41,12 @@ method moveToLoadingAppState*(self: AccessInterface) {.base.} =
|
||||
method moveToAppState*(self: AccessInterface) {.base.} =
|
||||
raise newException(ValueError, "No implementation available")
|
||||
|
||||
method getAppInfoFlow*(self: AccessInterface) {.base.} =
|
||||
raise newException(ValueError, "No implementation available")
|
||||
|
||||
method getMetadataFlow*(self: AccessInterface) {.base.} =
|
||||
raise newException(ValueError, "No implementation available")
|
||||
|
||||
method moveToStartupState*(self: AccessInterface) {.base.} =
|
||||
raise newException(ValueError, "No implementation available")
|
||||
|
||||
|
@ -491,6 +491,12 @@ method checkRepeatedKeycardPinWhileTyping*[T](self: Module[T], pin: string): boo
|
||||
method getSeedPhrase*[T](self: Module[T]): string =
|
||||
return self.controller.getSeedPhrase()
|
||||
|
||||
method getAppInfoFlow*[T](self: Module[T]) =
|
||||
self.controller.getAppInfoFlow()
|
||||
|
||||
method getMetadataFlow*[T](self: Module[T]) =
|
||||
self.controller.getMetadataFlow()
|
||||
|
||||
method getKeycardData*[T](self: Module[T]): string =
|
||||
return self.view.getKeycardData()
|
||||
|
||||
|
@ -107,6 +107,12 @@ QtObject:
|
||||
proc onQuaternaryActionClicked*(self: View) {.slot.} =
|
||||
self.delegate.onQuaternaryActionClicked()
|
||||
|
||||
proc getAppInfoFlow*(self: View) {.slot.} =
|
||||
self.delegate.getAppInfoFlow()
|
||||
|
||||
proc getMetadataFlow*(self: View) {.slot.} =
|
||||
self.delegate.getMetadataFlow()
|
||||
|
||||
proc onQuinaryActionClicked*(self: View) {.slot.} =
|
||||
self.delegate.onQuinaryActionClicked()
|
||||
|
||||
|
@ -107,6 +107,7 @@ QtObject:
|
||||
debug "initialization response: ", initResp
|
||||
|
||||
proc processSignal(self: Service, signal: string) =
|
||||
echo "--- GOT A SIGNAL ", signal
|
||||
var jsonSignal: JsonNode
|
||||
try:
|
||||
jsonSignal = signal.parseJson
|
||||
@ -167,6 +168,16 @@ QtObject:
|
||||
if self.doLogging:
|
||||
debug "keycardStartFlow", kcServiceCurrFlow=($self.currentFlow), payload=payload, response=response
|
||||
|
||||
proc getAppInfoFlow*(self: Service) =
|
||||
let response = keycard_go.getAppInfoFlow()
|
||||
|
||||
debug "getAppInfoFlow", response=response
|
||||
|
||||
proc getMetadataFlow*(self: Service) =
|
||||
let response = keycard_go.getMetadataFlow()
|
||||
|
||||
debug "getMetadataFlow", response=response
|
||||
|
||||
proc resumeFlow(self: Service, payload: JsonNode) =
|
||||
self.busy = true
|
||||
self.updateLocalPayloadForCurrentFlow(payload)
|
||||
|
@ -198,6 +198,20 @@ Item {
|
||||
font.pixelSize: Constants.onboarding.titleFontSize
|
||||
color: Theme.palette.directColor1
|
||||
}
|
||||
StatusButton {
|
||||
text: qsTr("Get keycard status")
|
||||
onClicked: {
|
||||
console.log('Cal getAppInfoFlowl')
|
||||
startupStore.startupModuleInst.getAppInfoFlow()
|
||||
}
|
||||
}
|
||||
StatusButton {
|
||||
text: qsTr("Get metadata")
|
||||
onClicked: {
|
||||
console.log('Call getMetadataFlow')
|
||||
startupStore.startupModuleInst.getMetadataFlow()
|
||||
}
|
||||
}
|
||||
Item { Layout.fillHeight: d.isRegularLogin }
|
||||
Item {
|
||||
id: userInfo
|
||||
|
2
vendor/nim-keycard-go
vendored
2
vendor/nim-keycard-go
vendored
@ -1 +1 @@
|
||||
Subproject commit aa05fe490b57023028e242567f52bd124ed87d30
|
||||
Subproject commit 9e01fb0cefdd43305d938f6add30b1f3b789ea33
|
2
vendor/status-keycard-go
vendored
2
vendor/status-keycard-go
vendored
@ -1 +1 @@
|
||||
Subproject commit 96be8e02d7013bb6518f236424cfd2962e636398
|
||||
Subproject commit dc66298e27f4dbc9ca8b497374f934577ab2ce51
|
Loading…
x
Reference in New Issue
Block a user