blob: 749f18d3b68ba0c8f695eb043cdd14a189f94fae (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
const selectors = {
getSelectedAddress,
getSelectedIdentity,
getSelectedAccount,
}
module.exports = selectors
function getSelectedAddress(state) {
const selectedAddress = state.metamask.selectedAddress || Object.keys(accounts)[0]
return selectedAddress
}
function getSelectedIdentity(state) {
const selectedAddress = getSelectedAddress(state)
const identities = state.metamask.identities
return identities[selectedAddress]
}
function getSelectedAccount(state) {
const accounts = state.metamask.accounts
const selectedAddress = getSelectedAddress(state)
return accounts[selectedAddress]
}
|