@clonegod/ttd-bsc-common 1.0.68 → 1.0.71
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.
|
@@ -262,7 +262,7 @@ class AbstractEvmDexTradePlus extends dist_1.AbastrcatTrade {
|
|
|
262
262
|
from: wallet.address,
|
|
263
263
|
to,
|
|
264
264
|
value: ethers_1.ethers.utils.parseUnits(real_transfer_amount_gwei, 'gwei'),
|
|
265
|
-
gasLimit:
|
|
265
|
+
gasLimit: 42000,
|
|
266
266
|
gasPrice: ethers_1.ethers.utils.parseUnits(real_gas_price_gwei, 'gwei'),
|
|
267
267
|
nonce: transfer_nonce,
|
|
268
268
|
chainId: this.chainConfig.chainId
|
|
@@ -8,7 +8,7 @@ const get_48club_sp_private_key = () => {
|
|
|
8
8
|
return _48club_sp_wallet_private_key;
|
|
9
9
|
}
|
|
10
10
|
try {
|
|
11
|
-
const wallet = (0, dist_1.load_wallet)(process.env._48CLUB_SP_WALLET_ID || 'TTD-PAYMENT');
|
|
11
|
+
const wallet = (0, dist_1.load_wallet)(process.env._48CLUB_SP_WALLET_ID || 'TTD-PAYMENT', false);
|
|
12
12
|
console.log('Load 48club SP wallet success, wallet address:', wallet.public_key);
|
|
13
13
|
_48club_sp_wallet_private_key = wallet.private_key;
|
|
14
14
|
return _48club_sp_wallet_private_key;
|
|
@@ -19,3 +19,7 @@ const get_48club_sp_private_key = () => {
|
|
|
19
19
|
}
|
|
20
20
|
};
|
|
21
21
|
exports.get_48club_sp_private_key = get_48club_sp_private_key;
|
|
22
|
+
if (require.main === module) {
|
|
23
|
+
const privateKey = (0, exports.get_48club_sp_private_key)();
|
|
24
|
+
console.log('48club SP wallet private key:', privateKey);
|
|
25
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BscSendTxProxy = void 0;
|
|
4
|
+
const dist_1 = require("@clonegod/ttd-core/dist");
|
|
5
|
+
class BscSendTxProxy {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.wsUrl = process.env.BSC_SEND_BUNDLE_WS_ENDPOINT || 'ws://127.0.0.1:10001/bsc/send_tx';
|
|
8
|
+
this.init();
|
|
9
|
+
}
|
|
10
|
+
init() {
|
|
11
|
+
this.ws = new dist_1.WebSocketClient(this.wsUrl);
|
|
12
|
+
this.ws.onOpen(() => {
|
|
13
|
+
console.log('BscSendTxProxy ws connected:', this.wsUrl);
|
|
14
|
+
});
|
|
15
|
+
this.ws.onMessage((message) => {
|
|
16
|
+
console.log('BscSendTxProxy ws received message', message);
|
|
17
|
+
});
|
|
18
|
+
this.ws.connect();
|
|
19
|
+
}
|
|
20
|
+
sendTransaction(builder, pair, mainTx, tipTx, _48spSign = null) {
|
|
21
|
+
this.ws.send(JSON.stringify({
|
|
22
|
+
builder,
|
|
23
|
+
pair,
|
|
24
|
+
mainTx,
|
|
25
|
+
tipTx,
|
|
26
|
+
_48spSign
|
|
27
|
+
}));
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.BscSendTxProxy = BscSendTxProxy;
|
|
@@ -15,13 +15,13 @@ const blockrazor_1 = require("./blockrazor");
|
|
|
15
15
|
const bsc_rpc_1 = require("./bsc_rpc");
|
|
16
16
|
const _48club_1 = require("./48club");
|
|
17
17
|
const _1 = require(".");
|
|
18
|
-
const
|
|
18
|
+
const send_bundle_proxy_1 = require("./send_bundle_proxy");
|
|
19
19
|
class TransactionSender {
|
|
20
20
|
constructor(appConfig) {
|
|
21
21
|
this.rpc = new bsc_rpc_1.BscMainnetRpc(appConfig.env_args.rpc_endpoint);
|
|
22
22
|
this.blockRazor = new blockrazor_1.BlockRazorTrade();
|
|
23
23
|
this._48Club = new _48club_1._48ClubTrade();
|
|
24
|
-
this.sendBundleProxy = new
|
|
24
|
+
this.sendBundleProxy = new send_bundle_proxy_1.BscSendTxProxy();
|
|
25
25
|
}
|
|
26
26
|
sendTransaction(signedMainTx_1, eoa_tip_transaction_1, order_trace_id_1) {
|
|
27
27
|
return __awaiter(this, arguments, void 0, function* (signedMainTx, eoa_tip_transaction, order_trace_id, pair = '', only_bundle = false) {
|
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.71",
|
|
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.92",
|
|
18
18
|
"axios": "^1.12.0",
|
|
19
19
|
"dotenv": "^16.4.7",
|
|
20
20
|
"ethers": "^5.8.0"
|