wolverine-ai 5.0.3 → 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.
|
|
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": {
|
|
@@ -186,6 +186,10 @@ async function _verifyPayment(paymentSig, price) {
|
|
|
186
186
|
// Recover signer from EIP-712 typed data signature
|
|
187
187
|
try {
|
|
188
188
|
const { ethers } = require("ethers");
|
|
189
|
+
// Normalize all addresses to proper EIP-55 checksum format
|
|
190
|
+
const fromAddr = ethers.getAddress(auth.from.toLowerCase());
|
|
191
|
+
const toAddr = ethers.getAddress(auth.to.toLowerCase());
|
|
192
|
+
|
|
189
193
|
const domain = {
|
|
190
194
|
name: "USD Coin",
|
|
191
195
|
version: "2",
|
|
@@ -203,8 +207,8 @@ async function _verifyPayment(paymentSig, price) {
|
|
|
203
207
|
],
|
|
204
208
|
};
|
|
205
209
|
const message = {
|
|
206
|
-
from:
|
|
207
|
-
to:
|
|
210
|
+
from: fromAddr,
|
|
211
|
+
to: toAddr,
|
|
208
212
|
value: auth.value,
|
|
209
213
|
validAfter: auth.validAfter,
|
|
210
214
|
validBefore: auth.validBefore,
|
|
@@ -212,7 +216,7 @@ async function _verifyPayment(paymentSig, price) {
|
|
|
212
216
|
};
|
|
213
217
|
|
|
214
218
|
const recoveredAddress = ethers.verifyTypedData(domain, types, message, sig);
|
|
215
|
-
if (recoveredAddress.toLowerCase() !==
|
|
219
|
+
if (recoveredAddress.toLowerCase() !== fromAddr.toLowerCase()) {
|
|
216
220
|
return { valid: false, reason: "Signature mismatch" };
|
|
217
221
|
}
|
|
218
222
|
|
package/src/vault/wallet-ops.js
CHANGED
|
@@ -119,7 +119,15 @@ function _getCrypto() {
|
|
|
119
119
|
const crypto = require("crypto");
|
|
120
120
|
|
|
121
121
|
function keccak256(data) {
|
|
122
|
-
|
|
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) {
|