Skip to content

Commit af0c8db

Browse files
committed
Merge branch 'develop' into release/1.31.0
2 parents b50b96a + 6dd022b commit af0c8db

File tree

4 files changed

+24
-16
lines changed

4 files changed

+24
-16
lines changed

src/interfaces.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,7 @@ export interface TermsAgreementState {
563563

564564
export interface Ens {
565565
name?: string
566+
avatar?: string
566567
contentHash?: string
567568
getText?: (key: string) => Promise<string | undefined>
568569
}

src/modules/select/index.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,13 @@ function select(
5050
: desktopDefaultWalletNames
5151

5252
if (wallets) {
53+
// For backwards compatibility if a user is still using 'detectedwallet' in the onboard wallet select array
54+
// it will be filtered out so there are no duplicates
55+
wallets = wallets.filter(
56+
wallet =>
57+
'walletName' in wallet ? wallet.walletName !== 'detectedwallet' : true // It is not a WalletInitOption but rather a WalletModule so let it through
58+
)
59+
5360
// If we detect an injected wallet then place the detected wallet
5461
// at the beginning of the list e.g. the of the wallet select modal
5562
if (injectedWalletDetected()) {
@@ -59,7 +66,7 @@ function select(
5966
wallets.map(wallet => {
6067
// If this is a wallet init object then load the built-in wallet module
6168
if (isWalletInit(wallet)) {
62-
const { walletName, ...initParams } = wallet as WalletInitOptions
69+
const { walletName, ...initParams } = wallet
6370
try {
6471
return getModule(walletName).then((m: any) =>
6572
m.default({ ...initParams, networkId, isMobile })

src/modules/select/wallets/keepkey/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/* eslint-disable @typescript-eslint/camelcase */
2+
import * as ethUtil from 'ethereumjs-util'
23
import {
34
CommonWalletOptions,
45
Helpers,
@@ -406,7 +407,7 @@ async function createKeepKeyProvider({
406407

407408
const { signature } = await keepKeyWallet.ethSignMessage({
408409
addressNList,
409-
message
410+
message: ethUtil.toBuffer(message).toString('utf8')
410411
})
411412

412413
return signature

src/utilities.ts

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -70,22 +70,21 @@ export function getAddress(provider: any): Promise<string | any> {
7070

7171
export async function getEns(provider: any, address: string): Promise<Ens> {
7272
const { networkId } = get(app)
73-
const ens = new ENS({ provider, ensAddress: getEnsAddress(networkId) })
74-
let name
75-
let nameInterface
76-
let contentHash
7773
try {
78-
;({ name } = await ens.getName(address))
79-
nameInterface = await ens.name(name)
80-
contentHash = await nameInterface?.getContent()
74+
const ens = new ENS({ provider, ensAddress: getEnsAddress(networkId) })
75+
const { name } = await ens.getName(address)
76+
const nameInterface = await ens.name(name)
77+
const contentHash = await nameInterface?.getContent()
78+
const avatar = await nameInterface?.getText('avatar')
79+
return {
80+
name,
81+
avatar,
82+
contentHash,
83+
getText: nameInterface?.getText.bind(nameInterface)
84+
}
8185
} catch (e) {
82-
// Error getting ens name
83-
}
84-
85-
return {
86-
name,
87-
contentHash,
88-
getText: nameInterface?.getText.bind(nameInterface)
86+
// Error getting ens
87+
return {}
8988
}
9089
}
9190

0 commit comments

Comments
 (0)