Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

wax-wallet-manager

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wax-wallet-manager - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

lib/storage.d.ts

6

lib/index.d.ts

@@ -1,2 +0,4 @@

export * from './WalletManager';
export * from './wallets/anchor/Anchor';
export { WalletManager } from './WalletManager';
export { Anchor } from './wallets/anchor/Anchor';
export { Wax } from './wallets/wax-cloud/WAX';
export * from './storage';

@@ -17,3 +17,9 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./WalletManager"), exports);
__exportStar(require("./wallets/anchor/Anchor"), exports);
exports.Wax = exports.Anchor = exports.WalletManager = void 0;
var WalletManager_1 = require("./WalletManager");
Object.defineProperty(exports, "WalletManager", { enumerable: true, get: function () { return WalletManager_1.WalletManager; } });
var Anchor_1 = require("./wallets/anchor/Anchor");
Object.defineProperty(exports, "Anchor", { enumerable: true, get: function () { return Anchor_1.Anchor; } });
var WAX_1 = require("./wallets/wax-cloud/WAX");
Object.defineProperty(exports, "Wax", { enumerable: true, get: function () { return WAX_1.Wax; } });
__exportStar(require("./storage"), exports);

@@ -42,1 +42,6 @@ export interface Chain {

}
export interface StoredAccount {
accountName: string;
requestPermission: string;
walletName: string;
}
import { Wallet } from './Wallet';
import { StoredAccount } from "./interfaces";
export declare class WalletManager {
wallets: Wallet[];
constructor(wallets: Wallet[]);
getWallets(): {
wallets: Wallet[];
};
private callback?;
private _accounts;
constructor(wallets: Wallet[], callback?: {
accounts?: (() => void) | undefined;
} | undefined);
init(): void;
get accounts(): StoredAccount[];
set accounts(value: StoredAccount[]);
setAccounts(): void;
getAvailableWallets(): Wallet[];
setUsers(user: any, wallet: string): void;
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.WalletManager = void 0;
var UsersManager_1 = require("./UsersManager");
var storage_1 = require("./storage");
var WalletManager = /** @class */ (function () {
function WalletManager(wallets) {
function WalletManager(wallets, callback) {
this.wallets = wallets;
this.callback = callback;
this._accounts = [];
this.init();
}
WalletManager.prototype.getWallets = function () {
var wallets = this.wallets.filter(function (wallet) {
/*
* Multiple wallets may be added but some may not be valid with all browsers
* We use shouldRender to detect wallet/browser compatibility and only init the wallets that shouldRender
*/
WalletManager.prototype.init = function () {
this.setAccounts();
var wallets = this.getAvailableWallets();
wallets.forEach(function (wallet) { return wallet.init(); });
};
Object.defineProperty(WalletManager.prototype, "accounts", {
get: function () {
return this._accounts;
},
set: function (value) {
if (!value.length) {
return;
}
this._accounts = value;
if (this.callback && this.callback.accounts) {
this.callback.accounts();
}
},
enumerable: false,
configurable: true
});
WalletManager.prototype.setAccounts = function () {
var stored = localStorage.getItem(storage_1.ACCOUNTS_KEY) || null;
this.accounts = stored ? JSON.parse(stored) : [];
};
WalletManager.prototype.getAvailableWallets = function () {
return this.wallets.filter(function (wallet) {
return wallet.shouldRender();
});
wallets.forEach(function (wallet) { return wallet.init(); });
return {
wallets: wallets,
};
};
WalletManager.prototype.setUsers = function (user, wallet) {
(0, UsersManager_1.swapUsers)(user, wallet);
this.setAccounts();
};
return WalletManager;
}());
exports.WalletManager = WalletManager;

@@ -60,2 +60,3 @@ "use strict";

var WalletError_1 = require("../../WalletError");
var UsersManager_1 = require("../../UsersManager");
var AnchorUser_1 = require("./AnchorUser");

@@ -181,3 +182,5 @@ var AnchorError_1 = require("./AnchorError");

throw new AnchorError_1.AnchorError(e_1.message, WalletError_1.WalletErrorType.Login, e_1);
case 4: return [2 /*return*/, this.users];
case 4:
(0, UsersManager_1.swapUsers)(this.users[0], this.walletName());
return [2 /*return*/, this.users];
}

@@ -184,0 +187,0 @@ });

{
"name": "wax-wallet-manager",
"version": "1.0.1",
"version": "1.0.2",
"description": "Manage multiple Wax Blockchain account login sessions across WCW and supported wallets.",

@@ -41,8 +41,4 @@ "main": "lib/index.js",

"devDependencies": {
"@greymass/eosio": "^0.6.4",
"@types/bn.js": "^5.1.1",
"@types/jest": "^29.0.1",
"anchor-link": "^3.5.1",
"anchor-link-browser-transport": "^3.5.1",
"eosjs": "^22.1.0",
"jest": "^29.0.3",

@@ -54,3 +50,10 @@ "prettier": "^2.7.1",

"typescript": "^4.8.3"
},
"dependencies": {
"@greymass/eosio": "^0.6.4",
"@waxio/waxjs": "^1.1.0",
"anchor-link": "^3.5.1",
"anchor-link-browser-transport": "^3.5.1",
"eosjs": "^22.1.0"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc