@@ -10,25 +10,25 @@ import {
10
10
import { HdPath } from "@cosmjs/crypto" ;
11
11
import Transport from "@ledgerhq/hw-transport" ;
12
12
13
- import { AddressAndPubkey , LaunchpadLedger , LaunchpadLedgerOptions } from "./launchpadledger " ;
13
+ import { AddressAndPubkey , LedgerConnector , LedgerConnectorOptions } from "./ledgerconnector " ;
14
14
15
15
export class LedgerSigner implements OfflineAminoSigner {
16
- private readonly ledger : LaunchpadLedger ;
16
+ private readonly connector : LedgerConnector ;
17
17
private readonly hdPaths : readonly HdPath [ ] ;
18
18
private accounts ?: readonly AccountData [ ] ;
19
19
20
- public constructor ( transport : Transport , options : LaunchpadLedgerOptions = { } ) {
20
+ public constructor ( transport : Transport , options : LedgerConnectorOptions = { } ) {
21
21
this . hdPaths = options . hdPaths || [ makeCosmoshubPath ( 0 ) ] ;
22
- this . ledger = new LaunchpadLedger ( transport , options ) ;
22
+ this . connector = new LedgerConnector ( transport , options ) ;
23
23
}
24
24
25
25
public async getAccounts ( ) : Promise < readonly AccountData [ ] > {
26
26
if ( ! this . accounts ) {
27
- const pubkeys = await this . ledger . getPubkeys ( ) ;
27
+ const pubkeys = await this . connector . getPubkeys ( ) ;
28
28
this . accounts = await Promise . all (
29
29
pubkeys . map ( async ( pubkey ) => ( {
30
30
algo : "secp256k1" as const ,
31
- address : await this . ledger . getCosmosAddress ( pubkey ) ,
31
+ address : await this . connector . getCosmosAddress ( pubkey ) ,
32
32
pubkey : pubkey ,
33
33
} ) ) ,
34
34
) ;
@@ -46,7 +46,7 @@ export class LedgerSigner implements OfflineAminoSigner {
46
46
* @param path The HD path to show the address for. If unset, this is the first account.
47
47
*/
48
48
public async showAddress ( path ?: HdPath ) : Promise < AddressAndPubkey > {
49
- return this . ledger . showAddress ( path ) ;
49
+ return this . connector . showAddress ( path ) ;
50
50
}
51
51
52
52
public async signAmino ( signerAddress : string , signDoc : StdSignDoc ) : Promise < AminoSignResponse > {
@@ -60,7 +60,7 @@ export class LedgerSigner implements OfflineAminoSigner {
60
60
const message = serializeSignDoc ( signDoc ) ;
61
61
const accountForAddress = accounts [ accountIndex ] ;
62
62
const hdPath = this . hdPaths [ accountIndex ] ;
63
- const signature = await this . ledger . sign ( message , hdPath ) ;
63
+ const signature = await this . connector . sign ( message , hdPath ) ;
64
64
return {
65
65
signed : signDoc ,
66
66
signature : encodeSecp256k1Signature ( accountForAddress . pubkey , signature ) ,
0 commit comments