Skip to content

Commit 7531da2

Browse files
author
Fabrice Bascoulergue
committed
Add support for ledger app config
1 parent 6ed9c3a commit 7531da2

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

src/declarations.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ declare module '@ledgerhq/hw-app-cosmos' {
1212
transport: import('@ledgerhq/hw-transport').default<*>;
1313

1414
constructor(transport: import('@ledgerhq/hw-transport').default<*>, scrambleKey: string);
15-
getAppConfiguration(): {
15+
getAppConfiguration(): Promise<{
1616
test_mode: boolean;
1717
version: string;
1818
device_locked: boolean;
1919
major: string;
20-
};
20+
}>;
2121

2222
serializePath(path: Buffer): Buffer;
2323

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import * as LumConstants from './constants';
33
import * as LumTypes from './types';
44
import * as LumMessages from './messages';
55
import { LumRegistry, LumAminoRegistry } from './registry';
6-
import { LumWallet, LumWalletFactory } from './wallet';
6+
import { LumWallet, LumLedgerWallet, LumPaperWallet, LumWalletFactory } from './wallet';
77
import { LumClient } from './client';
88

9-
export { LumWallet, LumWalletFactory, LumClient, LumTypes, LumUtils, LumConstants, LumMessages, LumRegistry, LumAminoRegistry };
9+
export { LumWallet, LumWalletFactory, LumLedgerWallet, LumPaperWallet, LumClient, LumTypes, LumUtils, LumConstants, LumMessages, LumRegistry, LumAminoRegistry };

src/wallet/LumLedgerWallet.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,18 @@ export class LumLedgerWallet extends LumWallet {
2323
return true;
2424
};
2525

26+
/**
27+
* Gets the connected application configuration
28+
*/
29+
getAppConfiguration = async (): Promise<{
30+
test_mode: boolean;
31+
version: string;
32+
device_locked: boolean;
33+
major: string;
34+
}> => {
35+
return this.cosmosApp.getAppConfiguration();
36+
};
37+
2638
useAccount = async (hdPath: string, addressPrefix: string): Promise<boolean> => {
2739
const { address, publicKey } = await this.cosmosApp.getAddress(hdPath, addressPrefix);
2840
this.hdPath = hdPath;

0 commit comments

Comments
 (0)