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

@arcblock/forge-wallet

Package Overview
Dependencies
Maintainers
2
Versions
107
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@arcblock/forge-wallet - npm Package Compare versions

Comparing version 0.39.7 to 0.39.9

10

lib/index.d.ts

@@ -83,4 +83,13 @@ // Generate by [js2dts@0.3.3](https://github.com/whxaxes/js2dts#readme)

/**
* Check if an object is valid wallet object
*
* @public
* @static
* @param {object} wallet
* @param {boolean} canSign - should the wallet support sign
*/
declare function isValid(wallet: any, canSign?: boolean): boolean;
/**
* @public
* @static
* @global

@@ -176,2 +185,3 @@ * @name WalletObject

fromJSON: typeof fromJSON;
isValid: typeof isValid;
Wallet: typeof Wallet;

@@ -178,0 +188,0 @@ WalletType: typeof WalletType;

@@ -249,2 +249,43 @@ /**

/**
* Check if an object is valid wallet object
*
* @public
* @static
* @param {object} wallet
* @param {boolean} canSign - should the wallet support sign
*/
function isValid(wallet, canSign = true) {
if (!wallet || typeof wallet !== 'object') {
return false;
}
if (typeof wallet.verify !== 'function') {
return false;
}
if (typeof wallet.toAddress !== 'function') {
return false;
}
if (typeof wallet.toJSON !== 'function') {
return false;
}
if (!wallet.type || !wallet.publicKey) {
return false;
}
if (canSign) {
if (!wallet.secretKey) {
return false;
}
if (typeof wallet.sign !== 'function') {
return false;
}
}
return true;
}
module.exports = {

@@ -257,4 +298,5 @@ fromSecretKey,

fromJSON,
isValid,
Wallet,
WalletType,
};

4

package.json
{
"name": "@arcblock/forge-wallet",
"version": "0.39.7",
"version": "0.39.9",
"description": "Utility function to create and use an forge compatible crypto wallet",

@@ -54,3 +54,3 @@ "keywords": [

},
"gitHead": "8a9f9caec73d880ea3a8696d7257fe40413b50fd"
"gitHead": "65d05ef507094a5796668be4734fb5c831e91b3c"
}
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