@clonegod/ttd-bsc-common 1.0.70 → 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: 21000,
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
@@ -0,0 +1,7 @@
1
+ export declare class BscSendTxProxy {
2
+ private wsUrl;
3
+ private ws;
4
+ constructor();
5
+ init(): void;
6
+ sendTransaction(builder: '48club' | 'bloxroute', pair: string, mainTx: string, tipTx: string, _48spSign?: string): void;
7
+ }
@@ -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 send_bundle_ws_1 = require("./send_bundle_ws");
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 send_bundle_ws_1.BscSendTxProxy();
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.70",
3
+ "version": "1.0.71",
4
4
  "description": "BSC common library",
5
5
  "license": "UNLICENSED",
6
6
  "main": "dist/index.js",