@clonegod/ttd-sol-common 2.0.21 → 2.0.22

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.
@@ -68,12 +68,18 @@ class SolTransactionBuilder {
68
68
  tipPayer = this.keypair;
69
69
  }
70
70
  let tipAccount = (0, jito_1.getJitoTipAccount)();
71
- let tipAmount = Math.min(context.trade_runtime.settings.strategy.sol_tip_fee, 0.0002 * web3_js_1.LAMPORTS_PER_SOL);
71
+ let tip_lamports = context.trade_runtime.settings.strategy.sol_tip_fee;
72
+ if (tip_lamports < 5000) {
73
+ tip_lamports = 5000;
74
+ }
75
+ if (tip_lamports > 300000) {
76
+ tip_lamports = 300000;
77
+ }
72
78
  const jitoTipTx = new web3_js_1.Transaction();
73
79
  jitoTipTx.add(web3_js_1.SystemProgram.transfer({
74
80
  fromPubkey: tipPayer.publicKey,
75
81
  toPubkey: new web3_js_1.PublicKey(tipAccount),
76
- lamports: tipAmount,
82
+ lamports: tip_lamports,
77
83
  }));
78
84
  jitoTipTx.recentBlockhash = this.recentBlockhash;
79
85
  jitoTipTx.lastValidBlockHeight = this.recentBlockheight + max_block_offset;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clonegod/ttd-sol-common",
3
- "version": "2.0.21",
3
+ "version": "2.0.22",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "types/index.d.ts",
@@ -120,14 +120,20 @@ export class SolTransactionBuilder {
120
120
  }
121
121
 
122
122
  let tipAccount = getJitoTipAccount()
123
- let tipAmount = Math.min(context.trade_runtime.settings.strategy.sol_tip_fee, 0.0002 * LAMPORTS_PER_SOL)
123
+ let tip_lamports = context.trade_runtime.settings.strategy.sol_tip_fee
124
+ if(tip_lamports < 5000) {
125
+ tip_lamports = 5000
126
+ }
127
+ if(tip_lamports > 300000) {
128
+ tip_lamports = 300000
129
+ }
124
130
 
125
131
  const jitoTipTx = new Transaction();
126
132
  jitoTipTx.add(
127
133
  SystemProgram.transfer({
128
134
  fromPubkey: tipPayer.publicKey,
129
135
  toPubkey: new PublicKey(tipAccount),
130
- lamports: tipAmount,
136
+ lamports: tip_lamports,
131
137
  }),
132
138
  );
133
139
  jitoTipTx.recentBlockhash = this.recentBlockhash