Skip to content

Commit da1c6bb

Browse files
committed
[DDW-722] Add sequence diagram
1 parent 96eaa7e commit da1c6bb

File tree

3 files changed

+173
-0
lines changed

3 files changed

+173
-0
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
title Ledger Address Verification
2+
3+
participant NanoS
4+
participant Daedalus
5+
participant WalletReceivePage
6+
participant initiateAddressVerification
7+
participant establishHardwareWalletConnection
8+
participant getCardanoAdaApp
9+
participant getExtendedPublicKey
10+
participant verifyAddress
11+
participant getHardwareWalletChannel
12+
participant deviceDetection
13+
14+
15+
autoactivation on
16+
WalletReceivePage->initiateAddressVerification:Start address verification
17+
18+
group Wait for device
19+
20+
21+
initiateAddressVerification->getHardwareWalletChannel:Subscribe to WAIT_FOR_LEDGER_DEVICES channel
22+
23+
24+
getHardwareWalletChannel->deviceDetection:check for new devices
25+
26+
NanoS->deviceDetection:Enter Pin
27+
28+
getHardwareWalletChannel<--deviceDetection:Device info
29+
30+
initiateAddressVerification<--getHardwareWalletChannel:Reply WAIT_FOR_LEDGER_DEVICES channel\nwith device info
31+
32+
end
33+
deactivateafter initiateAddressVerification
34+
autoactivation off
35+
36+
37+
initiateAddressVerification->establishHardwareWalletConnection:get transport info
38+
initiateAddressVerification<--establishHardwareWalletConnection:device transport
39+
40+
activate initiateAddressVerification
41+
initiateAddressVerification->initiateAddressVerification:start Ada App polling
42+
43+
44+
NanoS->deviceDetection:Open Ada App
45+
getCardanoAdaApp<--deviceDetection:App opened
46+
47+
deactivate initiateAddressVerification
48+
49+
getCardanoAdaApp->getExtendedPublicKey:Get public key
50+
getExtendedPublicKey->verifyAddress:Address verification
51+
52+
WalletReceivePage<--verifyAddress:address verified
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
title Ledger Initiate Transaction
2+
3+
participant NanoS
4+
participant Daedalus
5+
participant WalletReceivePage
6+
participant initiateTransaction
7+
participant getCardanoAdaApp
8+
participant getExtendedPublicKey
9+
participant signTransactionLedger
10+
participant getHardwareWalletChannel
11+
participant deviceDetection
12+
13+
14+
autoactivation on
15+
WalletReceivePage->initiateTransaction:Start a new transaction
16+
17+
group Wait for device
18+
19+
20+
initiateTransaction->getHardwareWalletChannel:Subscribe to WAIT_FOR_LEDGER_DEVICES channel
21+
22+
23+
getHardwareWalletChannel->deviceDetection:check for new devices
24+
25+
NanoS->deviceDetection:Enter Pin
26+
27+
getHardwareWalletChannel<--deviceDetection:Device info
28+
29+
initiateTransaction<--getHardwareWalletChannel:Reply WAIT_FOR_LEDGER_DEVICES channel\nwith device info
30+
31+
end
32+
deactivateafter initiateTransaction
33+
autoactivation off
34+
35+
36+
activate initiateTransaction
37+
initiateTransaction->initiateTransaction:start Ada App polling
38+
39+
40+
NanoS->deviceDetection:Open Ada App
41+
getCardanoAdaApp<--deviceDetection:App opened
42+
43+
deactivate initiateTransaction
44+
45+
getCardanoAdaApp->getExtendedPublicKey:Get public key
46+
getExtendedPublicKey->signTransactionLedger:Verify transaction
47+
48+
WalletReceivePage<--signTransactionLedger:transaction completed
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# visit https://sequencediagram.org/
2+
3+
title Ledger Wallet Pairing
4+
5+
participant NanoS
6+
participant Daedalus
7+
participant WalletAddPage
8+
participant HardwareWalletsStore
9+
participant changeHardwareWalletConnectionStatus
10+
participant initiateWalletPairing
11+
participant establishHardwareWalletConnection
12+
participant getCardanoAdaApp
13+
participant getExtendedPublicKey
14+
participant getHardwareWalletChannel
15+
participant deviceDetection
16+
participant localStorage
17+
18+
Daedalus->HardwareWalletsStore:Setup HW store
19+
20+
HardwareWalletsStore->changeHardwareWalletConnectionStatus:setup listeners
21+
22+
changeHardwareWalletConnectionStatus->getHardwareWalletChannel:subscribe to\n GET_HARDWARE_WALLET_CONNECTION_CHANNEL
23+
activate changeHardwareWalletConnectionStatus
24+
activate getHardwareWalletChannel
25+
26+
getHardwareWalletChannel->deviceDetection:listen for new devices
27+
activate getHardwareWalletChannel
28+
activate deviceDetection
29+
30+
par Device not connected
31+
WalletAddPage->initiateWalletPairing: start pairing
32+
33+
initiateWalletPairing->establishHardwareWalletConnection:Try to get device info
34+
35+
note over initiateWalletPairing,establishHardwareWalletConnection:This method can:\n1- Return transport payload\n2- Start Ada App\n3- Mutate flag to wait for device
36+
37+
38+
HardwareWalletsStore<--establishHardwareWalletConnection:Wait for device\nisListeningForDevice=true
39+
40+
41+
42+
end
43+
44+
NanoS->deviceDetection:Enter Pin
45+
46+
getHardwareWalletChannel<--deviceDetection:Device information
47+
deactivate getHardwareWalletChannel
48+
deactivate deviceDetection
49+
50+
51+
changeHardwareWalletConnectionStatus<--getHardwareWalletChannel:Reply to\n GET_HARDWARE_WALLET_CONNECTION_CHANNEL
52+
deactivate changeHardwareWalletConnectionStatus
53+
deactivate getHardwareWalletChannel
54+
55+
changeHardwareWalletConnectionStatus->localStorage:Save temporary device info
56+
57+
changeHardwareWalletConnectionStatus->establishHardwareWalletConnection:Re-start connection process
58+
59+
activate establishHardwareWalletConnection
60+
establishHardwareWalletConnection->establishHardwareWalletConnection:start Ada App polling()
61+
62+
63+
NanoS->deviceDetection:Open Ada App
64+
getCardanoAdaApp<--deviceDetection:App opened
65+
66+
deactivate establishHardwareWalletConnection
67+
68+
getCardanoAdaApp->getExtendedPublicKey:Get public key
69+
getExtendedPublicKey->localStorage:Save device info
70+
71+
getExtendedPublicKey<--localStorage:Device saved
72+
73+
getExtendedPublicKey-->WalletAddPage:Redirect to wallet page

0 commit comments

Comments
 (0)