gridplus-sdk
Advanced tools
Comparing version 0.2.2-dev to 0.2.3-dev
{ | ||
"name": "gridplus-sdk", | ||
"version": "0.2.2-dev", | ||
"version": "0.2.3-dev", | ||
"description": "SDK to interact with GridPlus Lattice1 device", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -126,2 +126,3 @@ const superagent = require('superagent'); | ||
getAddresses(opts, cb) { | ||
@@ -210,2 +211,11 @@ const { startPath, n } = opts; | ||
// Get the current set of active wallets from the device and update state. | ||
refreshWallets(cb) { | ||
this._getActiveWallet((err) => { | ||
if (err) return cb(err); | ||
return cb(null, this.getActiveWallet()); | ||
}, true) | ||
} | ||
//======================================================================= | ||
@@ -221,4 +231,4 @@ // INTERNAL FUNCTIONS | ||
// returns cb(err) -- err is a string | ||
_getActiveWallet(cb) { | ||
if (this.hasActiveWallet() === true || this.isPaired !== true) { | ||
_getActiveWallet(cb, forceRefresh=false) { | ||
if (forceRefresh !== true && (this.hasActiveWallet() === true || this.isPaired !== true)) { | ||
// If the active wallet already exists, or if we are not paired, skip the request | ||
@@ -225,0 +235,0 @@ return cb(null); |
51538
1203