@steemit/steem-js 1.0.19 → 1.1.0
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/README.md +0 -2
- package/dist/api/types.d.ts +32 -29
- package/dist/auth/ecc/index.d.ts +0 -1
- package/dist/auth/ecc/src/index.d.ts +0 -1
- package/dist/auth/index.d.ts +1 -0
- package/dist/browser.esm.js +22 -5
- package/dist/browser.esm.js.map +1 -1
- package/dist/index.cjs +22 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +22 -5
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +22 -5
- package/dist/index.umd.js.map +1 -1
- package/dist/index.umd.min.js +1 -1
- package/dist/index.umd.min.js.map +1 -1
- package/dist/types/protocol.d.ts +271 -0
- package/package.json +1 -1
- package/dist/auth/ecc/src/key_utils.d.ts +0 -10
package/dist/index.umd.js
CHANGED
|
@@ -16982,7 +16982,7 @@
|
|
|
16982
16982
|
const Q = curve.recoverPubKey(msgBuffer, sigObj, i);
|
|
16983
16983
|
return Q;
|
|
16984
16984
|
}
|
|
16985
|
-
catch
|
|
16985
|
+
catch {
|
|
16986
16986
|
// Fallback to manual implementation if elliptic's method fails
|
|
16987
16987
|
const G = curve.g;
|
|
16988
16988
|
// A set LSB signifies that the y-coordinate is odd
|
|
@@ -17002,7 +17002,7 @@
|
|
|
17002
17002
|
try {
|
|
17003
17003
|
R = curve.curve.pointFromX(xHexPadded, isYOdd);
|
|
17004
17004
|
}
|
|
17005
|
-
catch
|
|
17005
|
+
catch {
|
|
17006
17006
|
// If hex string fails, try with Buffer
|
|
17007
17007
|
const xBuffer = x.toArrayLike(buffer.Buffer, 'be', 32);
|
|
17008
17008
|
R = curve.curve.pointFromX(xBuffer, isYOdd);
|
|
@@ -26542,18 +26542,34 @@
|
|
|
26542
26542
|
return false;
|
|
26543
26543
|
}
|
|
26544
26544
|
};
|
|
26545
|
+
// Serialize a transaction to its binary form for digest calculation.
|
|
26546
|
+
// Alias for transaction.toBuffer() so verifyTransaction mirrors signTransaction's
|
|
26547
|
+
// serialization path exactly (signTransaction calls transaction.toBuffer at line 161).
|
|
26548
|
+
const serializeTrx = (trx) => transaction.toBuffer(trx);
|
|
26545
26549
|
const verifyTransaction = (transaction, publicKey) => {
|
|
26546
26550
|
try {
|
|
26547
26551
|
const pub = PublicKey.fromString(publicKey);
|
|
26548
26552
|
if (!pub)
|
|
26549
26553
|
return false;
|
|
26550
|
-
const serialized = buffer.Buffer.from(JSON.stringify(transaction));
|
|
26551
26554
|
const trx = transaction;
|
|
26552
26555
|
if (!trx.signatures || !Array.isArray(trx.signatures))
|
|
26553
26556
|
return false;
|
|
26557
|
+
// Reconstruct the exact digest signTransaction signs over:
|
|
26558
|
+
// Buffer.concat([chain_id, transaction.toBuffer(normalizedTrx)])
|
|
26559
|
+
// signatures are NOT part of the signed digest — signTransaction serializes
|
|
26560
|
+
// BEFORE attaching signatures — so strip them before serializing, otherwise
|
|
26561
|
+
// serializeTransaction() would emit the signatures array and change the digest.
|
|
26562
|
+
const normalizedTrx = normalizeTransactionForBroadcast(trx);
|
|
26563
|
+
// Build a copy without the signatures key, so serializeTransaction() does not
|
|
26564
|
+
// emit the signatures array into the digest (signTransaction serializes pre-signature).
|
|
26565
|
+
const trxWithoutSigs = { ...normalizedTrx };
|
|
26566
|
+
delete trxWithoutSigs.signatures;
|
|
26567
|
+
const chainId = getConfig().get('chain_id') || '';
|
|
26568
|
+
const cid = buffer.Buffer.from(chainId, 'hex');
|
|
26569
|
+
const buf = serializeTrx(trxWithoutSigs);
|
|
26554
26570
|
return trx.signatures.some((sig) => {
|
|
26555
26571
|
const signature = Signature.fromHex(sig);
|
|
26556
|
-
return signature.verifyBuffer(
|
|
26572
|
+
return signature.verifyBuffer(buffer.Buffer.concat([cid, buf]), pub);
|
|
26557
26573
|
});
|
|
26558
26574
|
}
|
|
26559
26575
|
catch {
|
|
@@ -26598,6 +26614,7 @@
|
|
|
26598
26614
|
normalizeTransactionForBroadcast: normalizeTransactionForBroadcast,
|
|
26599
26615
|
resolveAuthorityForSerialize: resolveAuthorityForSerialize,
|
|
26600
26616
|
sanitizeAccountUpdatePayload: sanitizeAccountUpdatePayload,
|
|
26617
|
+
serializeTransaction: serializeTransaction,
|
|
26601
26618
|
sign: sign$1,
|
|
26602
26619
|
signTransaction: signTransaction,
|
|
26603
26620
|
toWif: toWif,
|
|
@@ -29419,7 +29436,7 @@
|
|
|
29419
29436
|
operations,
|
|
29420
29437
|
utils: utils$n,
|
|
29421
29438
|
...crypto$1,
|
|
29422
|
-
version: '1.0
|
|
29439
|
+
version: '1.1.0',
|
|
29423
29440
|
config: {
|
|
29424
29441
|
set: (options) => {
|
|
29425
29442
|
// If nodes is provided, extract the first node as url for API
|