File tree Expand file tree Collapse file tree 4 files changed +24
-16
lines changed Expand file tree Collapse file tree 4 files changed +24
-16
lines changed Original file line number Diff line number Diff line change @@ -563,6 +563,7 @@ export interface TermsAgreementState {
563
563
564
564
export interface Ens {
565
565
name ?: string
566
+ avatar ?: string
566
567
contentHash ?: string
567
568
getText ?: ( key : string ) => Promise < string | undefined >
568
569
}
Original file line number Diff line number Diff line change @@ -50,6 +50,13 @@ function select(
50
50
: desktopDefaultWalletNames
51
51
52
52
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
+
53
60
// If we detect an injected wallet then place the detected wallet
54
61
// at the beginning of the list e.g. the of the wallet select modal
55
62
if ( injectedWalletDetected ( ) ) {
@@ -59,7 +66,7 @@ function select(
59
66
wallets . map ( wallet => {
60
67
// If this is a wallet init object then load the built-in wallet module
61
68
if ( isWalletInit ( wallet ) ) {
62
- const { walletName, ...initParams } = wallet as WalletInitOptions
69
+ const { walletName, ...initParams } = wallet
63
70
try {
64
71
return getModule ( walletName ) . then ( ( m : any ) =>
65
72
m . default ( { ...initParams , networkId, isMobile } )
Original file line number Diff line number Diff line change 1
1
/* eslint-disable @typescript-eslint/camelcase */
2
+ import * as ethUtil from 'ethereumjs-util'
2
3
import {
3
4
CommonWalletOptions ,
4
5
Helpers ,
@@ -406,7 +407,7 @@ async function createKeepKeyProvider({
406
407
407
408
const { signature } = await keepKeyWallet . ethSignMessage ( {
408
409
addressNList,
409
- message
410
+ message : ethUtil . toBuffer ( message ) . toString ( 'utf8' )
410
411
} )
411
412
412
413
return signature
Original file line number Diff line number Diff line change @@ -70,22 +70,21 @@ export function getAddress(provider: any): Promise<string | any> {
70
70
71
71
export async function getEns ( provider : any , address : string ) : Promise < Ens > {
72
72
const { networkId } = get ( app )
73
- const ens = new ENS ( { provider, ensAddress : getEnsAddress ( networkId ) } )
74
- let name
75
- let nameInterface
76
- let contentHash
77
73
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
+ }
81
85
} 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 { }
89
88
}
90
89
}
91
90
You can’t perform that action at this time.
0 commit comments