diff --git a/wallets/keplr.ts b/wallets/keplr.ts index 0f8d85a..06c5be5 100644 --- a/wallets/keplr.ts +++ b/wallets/keplr.ts @@ -45,18 +45,32 @@ export class KeplrWallet implements Wallet { } getChainInfosWithoutEndpoints(): Promise< - Omit[] + (Pick & { + readonly isEthermintLike?: boolean; + })[] > { - // TODO: Update @keplr-wallet/types - return (this.keplr as any).getChainInfosWithoutEndpoints(); + return this.keplr.getChainInfosWithoutEndpoints().then((chainInfos) => { + return chainInfos.map((chainInfo) => { + return { + ...chainInfo, + isEthermintLike: chainInfo.features?.includes("eth-address-gen"), + }; + }); + }); } getKey(chainId: string): Promise<{ readonly name: string; readonly pubKey: Uint8Array; readonly bech32Address: string; + readonly isLedgerNano?: boolean; }> { - return this.keplr.getKey(chainId); + return this.keplr.getKey(chainId).then((key) => { + return { + ...key, + isLedgerNano: key.isNanoLedger, + }; + }); } init(chainIds: string[]): Promise { @@ -88,8 +102,7 @@ export class KeplrWallet implements Wallet { signature: Uint8Array; }[] > { - // TODO: Update @keplr-wallet/types - return (this.keplr as any).signICNSAdr36( + return this.keplr.signICNSAdr36( chainId, contractAddress, owner, diff --git a/wallets/types.ts b/wallets/types.ts index 61ef521..7cc85bd 100644 --- a/wallets/types.ts +++ b/wallets/types.ts @@ -4,13 +4,16 @@ export interface Wallet { init(chainIds: string[]): Promise; getChainInfosWithoutEndpoints(): Promise< - Omit[] + (Pick & { + readonly isEthermintLike?: boolean; + })[] >; getKey(chainId: string): Promise<{ readonly name: string; readonly pubKey: Uint8Array; readonly bech32Address: string; + readonly isLedgerNano?: boolean; }>; signAmino( chainId: string,