@clonegod/ttd-sol-common 2.0.20 → 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.
|
@@ -19,7 +19,7 @@ exports.HELIUS_TIP_ACCOUNTS = [
|
|
|
19
19
|
];
|
|
20
20
|
const sendTxWithHelius = async (signedTransaction, swqos_only) => {
|
|
21
21
|
let url = process.env.HELIUS_SEND_TX_URL || 'http://tyo-sender.helius-rpc.com/fast';
|
|
22
|
-
if (
|
|
22
|
+
if (swqos_only) {
|
|
23
23
|
url = url + "?swqos_only=true";
|
|
24
24
|
}
|
|
25
25
|
const response = await axios_1.default.post(url, {
|
package/dist/trade/tx_builder.js
CHANGED
|
@@ -68,12 +68,18 @@ class SolTransactionBuilder {
|
|
|
68
68
|
tipPayer = this.keypair;
|
|
69
69
|
}
|
|
70
70
|
let tipAccount = (0, jito_1.getJitoTipAccount)();
|
|
71
|
-
let
|
|
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:
|
|
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
package/src/trade/send/helius.ts
CHANGED
|
@@ -20,9 +20,10 @@ export const HELIUS_TIP_ACCOUNTS = [
|
|
|
20
20
|
export const sendTxWithHelius = async (signedTransaction: Transaction, swqos_only: boolean): Promise<string> => {
|
|
21
21
|
let url = process.env.HELIUS_SEND_TX_URL || 'http://tyo-sender.helius-rpc.com/fast'
|
|
22
22
|
|
|
23
|
-
if (
|
|
23
|
+
if (swqos_only) {
|
|
24
24
|
url = url + "?swqos_only=true"
|
|
25
25
|
}
|
|
26
|
+
|
|
26
27
|
const response = await axios.post<{ result: string }>(url, {
|
|
27
28
|
jsonrpc: '2.0',
|
|
28
29
|
id: Date.now().toString(),
|
package/src/trade/tx_builder.ts
CHANGED
|
@@ -120,14 +120,20 @@ export class SolTransactionBuilder {
|
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
let tipAccount = getJitoTipAccount()
|
|
123
|
-
let
|
|
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:
|
|
136
|
+
lamports: tip_lamports,
|
|
131
137
|
}),
|
|
132
138
|
);
|
|
133
139
|
jitoTipTx.recentBlockhash = this.recentBlockhash
|