wolverine-ai 5.0.4 → 5.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wolverine-ai",
3
- "version": "5.0.4",
3
+ "version": "5.0.5",
4
4
  "description": "Self-healing Node.js server framework powered by AI. Catches crashes, diagnoses errors, generates fixes, verifies, and restarts — automatically.",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -187,8 +187,8 @@ async function _verifyPayment(paymentSig, price) {
187
187
  try {
188
188
  const { ethers } = require("ethers");
189
189
  // Normalize all addresses to proper EIP-55 checksum format
190
- const fromAddr = ethers.getAddress(auth.from);
191
- const toAddr = ethers.getAddress(auth.to);
190
+ const fromAddr = ethers.getAddress(auth.from.toLowerCase());
191
+ const toAddr = ethers.getAddress(auth.to.toLowerCase());
192
192
 
193
193
  const domain = {
194
194
  name: "USD Coin",
@@ -119,7 +119,15 @@ function _getCrypto() {
119
119
  const crypto = require("crypto");
120
120
 
121
121
  function keccak256(data) {
122
- return crypto.createHash("sha3-256").update(data).digest();
122
+ // Ethereum uses keccak256 (NOT NIST SHA3-256)
123
+ try {
124
+ const { keccak256: k } = require("ethers");
125
+ const buf = data instanceof Uint8Array ? data : Buffer.from(data);
126
+ const hex = k(buf);
127
+ return Buffer.from(hex.slice(2), "hex");
128
+ } catch {
129
+ return crypto.createHash("sha3-256").update(data).digest();
130
+ }
123
131
  }
124
132
 
125
133
  function getPublicKey(privKeyBuf, compressed = false) {