eth-lattice-keyring
Advanced tools
Comparing version 0.12.1 to 0.12.3
29
index.js
@@ -8,8 +8,2 @@ const crypto = require('crypto'); | ||
const rlp = require('rlp'); | ||
const { | ||
serializeCache, | ||
deserializeCache, | ||
getCachedDef, | ||
saveDefToCache, | ||
} = require("./cache"); | ||
const keyringType = 'Lattice Hardware'; | ||
@@ -26,3 +20,2 @@ const HARDENED_OFFSET = 0x80000000; | ||
super() | ||
this.requestCache = new Map(); | ||
this.type = keyringType; | ||
@@ -57,4 +50,2 @@ this._resetDefaults(); | ||
this.page = opts.page; | ||
if (opts.requestCache) | ||
this.requestCache = deserializeCache(opts.requestCache) | ||
return; | ||
@@ -79,3 +70,2 @@ } | ||
hdPath: this.hdPath, | ||
requestCache: serializeCache(this.requestCache), | ||
}; | ||
@@ -177,3 +167,3 @@ } | ||
// We should throw an error if we cannot support this. | ||
if (fwVersion.major === 0 && fwVersion.minor <= 11 && txData.type) { | ||
if (fwVersion.major === 0 && fwVersion.minor <= 11) { | ||
throw new Error('Please update Lattice firmware.'); | ||
@@ -195,14 +185,5 @@ } | ||
}; | ||
let def; | ||
const cachedDef = getCachedDef(tx, this.requestCache) | ||
if (cachedDef) { | ||
def = cachedDef | ||
} else { | ||
const supportsDecoderRecursion = fwVersion.major > 0 || fwVersion.minor >=16; | ||
// Check if we can decode the calldata | ||
const { def: fetchedDef } = await SDK.Utils.fetchCalldataDecoder(tx.data, tx.to, chainId, supportsDecoderRecursion); | ||
saveDefToCache(tx, this.requestCache, fetchedDef); | ||
def = fetchedDef | ||
} | ||
const supportsDecoderRecursion = fwVersion.major > 0 || fwVersion.minor >=16; | ||
// Check if we can decode the calldata | ||
const { def } = await SDK.Utils.fetchCalldataDecoder(tx.data, tx.to, chainId, supportsDecoderRecursion); | ||
if (def) { | ||
@@ -457,3 +438,2 @@ data.decoder = def; | ||
this.hdPath = STANDARD_HD_PATH; | ||
this.requestCache = new Map() | ||
} | ||
@@ -741,3 +721,2 @@ | ||
} | ||
} | ||
@@ -744,0 +723,0 @@ |
{ | ||
"name": "eth-lattice-keyring", | ||
"version": "0.12.1", | ||
"version": "0.12.3", | ||
"description": "Keyring for connecting to the Lattice1 hardware wallet", | ||
@@ -24,5 +24,5 @@ "main": "index.js", | ||
"@noble/secp256k1": "^1.7.0", | ||
"gridplus-sdk": "^2.2.7", | ||
"gridplus-sdk": "^2.2.9", | ||
"rlp": "^3.0.0" | ||
} | ||
} |
28862
4
729
Updatedgridplus-sdk@^2.2.9