@haven-fi/solauto-sdk 1.0.407 → 1.0.408
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.
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"jitoUtils.d.ts","sourceRoot":"","sources":["../../src/utils/jitoUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,SAAS,EAIV,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EACL,MAAM,EACN,kBAAkB,EAClB,GAAG,EAEJ,MAAM,0BAA0B,CAAC;AAQlC,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAMlE,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,SAAS,CAAC,CAa9D;
|
1
|
+
{"version":3,"file":"jitoUtils.d.ts","sourceRoot":"","sources":["../../src/utils/jitoUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,SAAS,EAIV,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EACL,MAAM,EACN,kBAAkB,EAClB,GAAG,EAEJ,MAAM,0BAA0B,CAAC;AAQlC,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAMlE,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,SAAS,CAAC,CAa9D;AAqND,wBAAsB,2BAA2B,CAC/C,GAAG,EAAE,GAAG,EACR,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,kBAAkB,EAAE,EACzB,MAAM,CAAC,EAAE,kBAAkB,EAC3B,kBAAkB,GAAE,kBAA2C,EAC/D,cAAc,CAAC,EAAE,MAAM,IAAI,GAC1B,OAAO,CAAC,MAAM,EAAE,GAAG,SAAS,CAAC,CAwF/B"}
|
package/dist/utils/jitoUtils.js
CHANGED
@@ -153,7 +153,9 @@ async function pollBundleStatus(bundleId, interval = 1000, timeout = 40000) {
|
|
153
153
|
async function sendJitoBundle(umi, transactions) {
|
154
154
|
let resp;
|
155
155
|
try {
|
156
|
-
resp = await axios_1.default.post(
|
156
|
+
resp = await axios_1.default.post(
|
157
|
+
// umi.rpc.getEndpoint(),
|
158
|
+
`${solautoConstants_1.JITO_BLOCK_ENGINE}/api/v1/bundles`, {
|
157
159
|
jsonrpc: "2.0",
|
158
160
|
id: 1,
|
159
161
|
method: "sendBundle",
|
@@ -183,8 +185,7 @@ async function sendJitoBundledTransactions(umi, connection, signer, txs, txType,
|
|
183
185
|
(0, generalUtils_1.consoleLog)("Transaction sizes: ", txs.map((x) => x.getTransactionSize(umi)));
|
184
186
|
txs[0] = txs[0].prepend(await getTipInstruction(signer, 150000));
|
185
187
|
const feeEstimates = priorityFeeSetting !== types_1.PriorityFeeSetting.None
|
186
|
-
? await Promise.all(txs.map(async (x) => (await (0, solanaUtils_1.getComputeUnitPriceEstimate)(umi, x, priorityFeeSetting, true)) ??
|
187
|
-
1000000))
|
188
|
+
? await Promise.all(txs.map(async (x) => (await (0, solanaUtils_1.getComputeUnitPriceEstimate)(umi, x, priorityFeeSetting, true)) ?? 1000000))
|
188
189
|
: undefined;
|
189
190
|
const latestBlockhash = (await umi.rpc.getLatestBlockhash({ commitment: "confirmed" })).blockhash;
|
190
191
|
let builtTxs;
|
package/package.json
CHANGED
package/src/utils/jitoUtils.ts
CHANGED
@@ -228,12 +228,16 @@ async function sendJitoBundle(
|
|
228
228
|
): Promise<string[]> {
|
229
229
|
let resp: any;
|
230
230
|
try {
|
231
|
-
resp = await axios.post<{ result: string }>(
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
231
|
+
resp = await axios.post<{ result: string }>(
|
232
|
+
// umi.rpc.getEndpoint(),
|
233
|
+
`${JITO_BLOCK_ENGINE}/api/v1/bundles`,
|
234
|
+
{
|
235
|
+
jsonrpc: "2.0",
|
236
|
+
id: 1,
|
237
|
+
method: "sendBundle",
|
238
|
+
params: [transactions],
|
239
|
+
}
|
240
|
+
);
|
237
241
|
} catch (e: any) {
|
238
242
|
if (e.response.data.error) {
|
239
243
|
console.error("Jito send bundle error:", e.response.data.error);
|
@@ -258,7 +262,14 @@ export async function sendJitoBundledTransactions(
|
|
258
262
|
onAwaitingSign?: () => void
|
259
263
|
): Promise<string[] | undefined> {
|
260
264
|
if (txs.length === 1) {
|
261
|
-
const resp = await sendSingleOptimizedTransaction(
|
265
|
+
const resp = await sendSingleOptimizedTransaction(
|
266
|
+
umi,
|
267
|
+
connection,
|
268
|
+
txs[0],
|
269
|
+
txType,
|
270
|
+
priorityFeeSetting,
|
271
|
+
onAwaitingSign
|
272
|
+
);
|
262
273
|
return resp ? [bs58.encode(resp)] : undefined;
|
263
274
|
}
|
264
275
|
|
@@ -275,8 +286,12 @@ export async function sendJitoBundledTransactions(
|
|
275
286
|
? await Promise.all(
|
276
287
|
txs.map(
|
277
288
|
async (x) =>
|
278
|
-
(await getComputeUnitPriceEstimate(
|
279
|
-
|
289
|
+
(await getComputeUnitPriceEstimate(
|
290
|
+
umi,
|
291
|
+
x,
|
292
|
+
priorityFeeSetting,
|
293
|
+
true
|
294
|
+
)) ?? 1000000
|
280
295
|
)
|
281
296
|
)
|
282
297
|
: undefined;
|