Skip to content
This repository has been archived by the owner on Oct 4, 2024. It is now read-only.

Commit

Permalink
More lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
vgrichina committed May 19, 2020
1 parent b02ae83 commit 9313095
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions middleware/ledger.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { Signer, utils: { PublicKey, key_pair: { KeyType } } } = require('near-api-js');
const { utils: { PublicKey, key_pair: { KeyType } } } = require('near-api-js');
const { createClient } = require('near-ledger-js');
const { default: TransportNodeHid } = require('@ledgerhq/hw-transport-node-hid');

Expand All @@ -23,15 +23,15 @@ module.exports = async function useLedgerSigner({ useLedger, hdKeyPath, newHdKey

let cachedPublicKey;
let signer = {
async getPublicKey(accountId, networkId) {
async getPublicKey() {
// NOTE: Public key is cached to avoid confirming on Ledger multiple times
if (!cachedPublicKey) {
cachedPublicKey = await getPublicKeyForPath(hdKeyPath);
}
return cachedPublicKey;
},
async signMessage(message, accountId, networkId) {
const publicKey = await this.getPublicKey(accountId, networkId);
async signMessage(message) {
const publicKey = await this.getPublicKey();
console.log('Waiting for confirmation on Ledger...');
const signature = await client.sign(message);
return { signature, publicKey };
Expand Down

0 comments on commit 9313095

Please sign in to comment.