@clonegod/ttd-bsc-common 1.0.78 → 1.0.80
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.
|
@@ -85,8 +85,7 @@ class _48ClubTrade {
|
|
|
85
85
|
const currentTimestamp = Math.floor(Date.now() / 1000);
|
|
86
86
|
const requestParams = {
|
|
87
87
|
txs: params.txs,
|
|
88
|
-
|
|
89
|
-
maxTimestamp: params.maxTimestamp || currentTimestamp + 30,
|
|
88
|
+
maxTimestamp: params.maxTimestamp || currentTimestamp + 2,
|
|
90
89
|
revertingTxHashes: params.revertingTxHashes,
|
|
91
90
|
noMerge: params.noMerge,
|
|
92
91
|
backrunTarget: params.backrunTarget,
|
|
@@ -51,10 +51,23 @@ class SoulPointSignature {
|
|
|
51
51
|
});
|
|
52
52
|
const concatenatedHashes = ethers_1.ethers.concat(txHashes);
|
|
53
53
|
const messageHash = ethers_1.ethers.keccak256(concatenatedHashes);
|
|
54
|
-
const
|
|
54
|
+
const signingKey = wallet.signingKey;
|
|
55
|
+
const signature = signingKey.signDigest ? signingKey.signDigest(messageHash) : signingKey.sign(messageHash);
|
|
55
56
|
const r = signature.r.slice(2).padStart(64, '0');
|
|
56
57
|
const s = signature.s.slice(2).padStart(64, '0');
|
|
57
|
-
|
|
58
|
+
let recoveryId;
|
|
59
|
+
if (signature.recoveryParam !== undefined) {
|
|
60
|
+
recoveryId = Number(signature.recoveryParam);
|
|
61
|
+
}
|
|
62
|
+
else if (signature.v !== undefined) {
|
|
63
|
+
const v = Number(signature.v);
|
|
64
|
+
recoveryId = v >= 27 ? v - 27 : v;
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
recoveryId = 0;
|
|
68
|
+
}
|
|
69
|
+
recoveryId = recoveryId % 2;
|
|
70
|
+
const v = recoveryId.toString(16).padStart(2, '0');
|
|
58
71
|
return '0x' + r + s + v;
|
|
59
72
|
}
|
|
60
73
|
catch (error) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clonegod/ttd-bsc-common",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.80",
|
|
4
4
|
"description": "BSC common library",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"push": "npm run build && npm publish"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@clonegod/ttd-core": "2.0.
|
|
17
|
+
"@clonegod/ttd-core": "2.0.95",
|
|
18
18
|
"axios": "^1.12.0",
|
|
19
19
|
"dotenv": "^16.4.7",
|
|
20
20
|
"ethers": "^5.8.0"
|