New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@ocap/wallet

Package Overview
Dependencies
Maintainers
3
Versions
470
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ocap/wallet - npm Package Compare versions

Comparing version 1.13.6 to 1.13.7

34

lib/index.js

@@ -50,2 +50,3 @@ /**

},
sign(data, hashBeforeSign = true) {

@@ -64,2 +65,3 @@ if (!keyPair.sk) {

},
verify(data, signature, hashBeforeVerify = true) {

@@ -73,5 +75,37 @@ if (!keyPair.pk) {

},
ethHash(data) {
if (typeof signer.ethHash !== 'function') {
throw new Error('ethHash is not supported by signer');
}
return signer.ethHash(data);
},
ethSign(data, hashBeforeSign = true) {
if (!keyPair.sk) {
throw new Error('Cannot sign data without a secretKey');
}
if (typeof signer.ethHash !== 'function') {
throw new Error('ethSign is not supported by signer');
}
if (hashBeforeSign) {
return signer.ethSign(signer.ethHash(data), keyPair.sk);
}
return signer.ethSign(data, keyPair.sk);
},
ethVerify(data, signature, hashBeforeVerify = true) {
if (typeof signer.ethHash !== 'function') {
throw new Error('ethVerify is not supported by signer');
}
const hash = hashBeforeVerify ? signer.ethHash(data) : data;
return signer.ethRecover(hash, signature) === this.toAddress();
},
toAddress() {
return keyPair.pk ? DIDFromPublicKey(keyPair.pk, type) : keyPair.address;
},
toJSON() {

@@ -78,0 +112,0 @@ return {

8

package.json
{
"name": "@ocap/wallet",
"version": "1.13.6",
"version": "1.13.7",
"description": "Utility function to create and use an forge compatible crypto wallet",

@@ -48,6 +48,6 @@ "keywords": [

"dependencies": {
"@arcblock/did": "1.13.6",
"@ocap/mcrypto": "1.13.6"
"@arcblock/did": "1.13.7",
"@ocap/mcrypto": "1.13.7"
},
"gitHead": "f01e775678b528d79f5a135c235e4532afe167d6"
"gitHead": "9276a321adad6531a58367cae309529ac3a375a3"
}
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