calimero-auth-sdk
Advanced tools
Comparing version 0.4.0 to 0.4.1
@@ -99,12 +99,4 @@ "use strict"; | ||
isSignatureValid() { | ||
const signedData = { | ||
accountId: this.walletData.accountId, | ||
message: this.walletData.message, | ||
blockId: this.walletData.blockId, | ||
publicKey: Buffer.from(this.walletData.publicKey).toString("base64"), | ||
keyType: Number(this.walletData.keyType) | ||
}; | ||
const encodedSignedData = JSON.stringify(signedData); | ||
// wallet signs sha256(msg), so we need to sha256() it again | ||
const msg = new Uint8Array(js_sha256_1.sha256.update(Buffer.from(encodedSignedData)).arrayBuffer()); | ||
const msg = new Uint8Array(js_sha256_1.sha256.update(Buffer.from(this.walletData.message)).arrayBuffer()); | ||
const sig = new Uint8Array(Buffer.from(this.walletData.signature, "base64")); | ||
@@ -111,0 +103,0 @@ // const pk = nearAPI.utils.PublicKey(this.walletData.publicKey); |
{ | ||
"name": "calimero-auth-sdk", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"main": "lib/index.js", | ||
@@ -12,3 +12,3 @@ "type": "commonjs", | ||
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js", | ||
"build": "tsc" | ||
"build": "rm -rf lib && tsc" | ||
}, | ||
@@ -15,0 +15,0 @@ "devDependencies": { |
43697
164