wax-wallet-manager
Advanced tools
Comparing version 1.0.6 to 1.0.7
@@ -1,1 +0,1 @@ | ||
export declare function swapUsers(user: any, wallet: string, remove?: boolean): void; | ||
export declare function swapAccounts(account: any, wallet: string, remove?: boolean): void; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.swapUsers = void 0; | ||
exports.swapAccounts = void 0; | ||
var storage_1 = require("./storage"); | ||
function swapUsers(user, wallet, remove) { | ||
var _user = formatUser(user, wallet); | ||
function swapAccounts(account, wallet, remove) { | ||
var _user = formatAccount(account, wallet); | ||
var allusers = getUsersList().filter(function (find) { | ||
@@ -15,3 +15,3 @@ return "".concat(find.accountName, "-").concat(find.requestPermission) !== "".concat(_user.accountName, "-").concat(_user.requestPermission); | ||
} | ||
exports.swapUsers = swapUsers; | ||
exports.swapAccounts = swapAccounts; | ||
function getUsersList() { | ||
@@ -24,8 +24,8 @@ var users = localStorage.getItem(storage_1.ACCOUNTS_KEY) || null; | ||
} | ||
function formatUser(user, wallet) { | ||
function formatAccount(account, wallet) { | ||
return { | ||
accountName: user.accountName, | ||
requestPermission: user.requestPermission, | ||
accountName: account.accountName, | ||
requestPermission: account.requestPermission, | ||
walletName: wallet | ||
}; | ||
} |
@@ -27,5 +27,2 @@ "use strict"; | ||
set: function (value) { | ||
if (!value.length) { | ||
return; | ||
} | ||
this._accounts = value; | ||
@@ -49,3 +46,3 @@ if (this.callback && this.callback.accounts) { | ||
WalletManager.prototype.setUsers = function (user, wallet, remove) { | ||
(0, UsersManager_1.swapUsers)(user, wallet, remove); | ||
(0, UsersManager_1.swapAccounts)(user, wallet, remove); | ||
this.setAccounts(); | ||
@@ -59,3 +56,3 @@ }; | ||
}; | ||
(0, UsersManager_1.swapUsers)(user, "viewonly"); | ||
(0, UsersManager_1.swapAccounts)(user, "viewonly"); | ||
return user; | ||
@@ -62,0 +59,0 @@ }; |
@@ -182,3 +182,3 @@ "use strict"; | ||
case 4: | ||
(0, UsersManager_1.swapUsers)(this.users[0], this.walletName()); | ||
(0, UsersManager_1.swapAccounts)(this.users[0], this.walletName()); | ||
return [2 /*return*/, this.users]; | ||
@@ -185,0 +185,0 @@ } |
@@ -138,3 +138,3 @@ "use strict"; | ||
]; | ||
(0, UsersManager_1.swapUsers)(this.users[0], this.walletName()); | ||
(0, UsersManager_1.swapAccounts)(this.users[0], this.walletName()); | ||
return [2 /*return*/, this.users]; | ||
@@ -141,0 +141,0 @@ case 4: |
{ | ||
"name": "wax-wallet-manager", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"description": "Manage multiple Wax Blockchain account login sessions across WCW and supported wallets.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
58050
1279