@haven-fi/solauto-sdk 1.0.309 → 1.0.311
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.
- package/dist/constants/solautoConstants.d.ts +1 -0
- package/dist/constants/solautoConstants.d.ts.map +1 -1
- package/dist/constants/solautoConstants.js +2 -7
- package/dist/transactions/transactionsManager.d.ts +3 -1
- package/dist/transactions/transactionsManager.d.ts.map +1 -1
- package/dist/transactions/transactionsManager.js +35 -7
- package/dist/utils/jitoUtils.d.ts +5 -0
- package/dist/utils/jitoUtils.d.ts.map +1 -1
- package/dist/utils/jitoUtils.js +98 -151
- package/dist/utils/priceUtils.d.ts +1 -6
- package/dist/utils/priceUtils.d.ts.map +1 -1
- package/dist/utils/priceUtils.js +3 -17
- package/dist/utils/solanaUtils.js +1 -1
- package/dist/utils/switchboardUtils.d.ts +6 -0
- package/dist/utils/switchboardUtils.d.ts.map +1 -1
- package/dist/utils/switchboardUtils.js +27 -2
- package/package.json +2 -1
- package/src/constants/solautoConstants.ts +1 -6
- package/src/transactions/transactionsManager.ts +74 -7
- package/src/utils/jitoUtils.ts +166 -166
- package/src/utils/priceUtils.ts +6 -32
- package/src/utils/solanaUtils.ts +1 -1
- package/src/utils/switchboardUtils.ts +58 -3
- package/tests/transactions/solautoMarginfi.ts +27 -26
@@ -14,4 +14,5 @@ export declare const PRICES: {
|
|
14
14
|
};
|
15
15
|
export declare const SOLAUTO_LUT = "9D4xwZwDf46n9ft5gQxZzq3rBbdRXsXojKQLZbBdskPY";
|
16
16
|
export declare const STANDARD_LUT_ACCOUNTS: string[];
|
17
|
+
export declare const JITO_BLOCK_ENGINE = "https://mainnet.block-engine.jito.wtf";
|
17
18
|
//# sourceMappingURL=solautoConstants.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"solautoConstants.d.ts","sourceRoot":"","sources":["../../src/constants/solautoConstants.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,SAAS,EACV,MAAM,iBAAiB,CAAC;
|
1
|
+
{"version":3,"file":"solautoConstants.d.ts","sourceRoot":"","sources":["../../src/constants/solautoConstants.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,SAAS,EACV,MAAM,iBAAiB,CAAC;AAQzB,eAAO,MAAM,oBAAoB,WAEhC,CAAC;AACF,eAAO,MAAM,oBAAoB,WAEhC,CAAC;AAIF,eAAO,MAAM,YAAY,QAAQ,CAAC;AAElC,eAAO,MAAM,iCAAiC,IAAI,CAAC;AACnD,eAAO,MAAM,iBAAiB,KAAK,CAAC;AACpC,eAAO,MAAM,iBAAiB,KAAK,CAAC;AACpC,eAAO,MAAM,0BAA0B,OAAO,CAAC;AAE/C,eAAO,MAAM,MAAM,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAA;CAAO,CAAC;AAE7E,eAAO,MAAM,WAAW,iDAAiD,CAAC;AAC1E,eAAO,MAAM,qBAAqB,UAYR,CAAC;AAE3B,eAAO,MAAM,iBAAiB,0CAA0C,CAAC"}
|
@@ -1,9 +1,8 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.STANDARD_LUT_ACCOUNTS = exports.SOLAUTO_LUT = exports.PRICES = exports.MIN_USD_SUPPORTED_POSITION = exports.MIN_BOOST_GAP_BPS = exports.MIN_REPAY_GAP_BPS = exports.MIN_POSITION_STATE_FRESHNESS_SECS = exports.BASIS_POINTS = exports.SOLAUTO_TEST_PROGRAM = exports.SOLAUTO_PROD_PROGRAM = void 0;
|
3
|
+
exports.JITO_BLOCK_ENGINE = exports.STANDARD_LUT_ACCOUNTS = exports.SOLAUTO_LUT = exports.PRICES = exports.MIN_USD_SUPPORTED_POSITION = exports.MIN_BOOST_GAP_BPS = exports.MIN_REPAY_GAP_BPS = exports.MIN_POSITION_STATE_FRESHNESS_SECS = exports.BASIS_POINTS = exports.SOLAUTO_TEST_PROGRAM = exports.SOLAUTO_PROD_PROGRAM = void 0;
|
4
4
|
const web3_js_1 = require("@solana/web3.js");
|
5
5
|
const spl_token_1 = require("@solana/spl-token");
|
6
|
-
// import { JitoRpcConnection } from "jito-ts";
|
7
6
|
const generalAccounts_1 = require("./generalAccounts");
|
8
7
|
const jupiter_sdk_1 = require("../jupiter-sdk");
|
9
8
|
exports.SOLAUTO_PROD_PROGRAM = new web3_js_1.PublicKey("AutoyKBRaHSBHy9RsmXCZMy6nNFAg5FYijrvZyQcNLV");
|
@@ -29,8 +28,4 @@ exports.STANDARD_LUT_ACCOUNTS = [
|
|
29
28
|
web3_js_1.SYSVAR_INSTRUCTIONS_PUBKEY,
|
30
29
|
jupiter_sdk_1.JUPITER_PROGRAM_ID,
|
31
30
|
].map((x) => x.toString());
|
32
|
-
|
33
|
-
// export const JITO_CONNECTION = new JitoRpcConnection(
|
34
|
-
// `https://${JITO_BLOCK_ENGINE}`,
|
35
|
-
// "finalized"
|
36
|
-
// );
|
31
|
+
exports.JITO_BLOCK_ENGINE = "https://mainnet.block-engine.jito.wtf";
|
@@ -37,12 +37,13 @@ export declare class TransactionsManager {
|
|
37
37
|
private statusCallback?;
|
38
38
|
private txType?;
|
39
39
|
private priorityFeeSetting;
|
40
|
+
private atomically;
|
40
41
|
private errorsToThrow?;
|
41
42
|
private retries;
|
42
43
|
private retryDelay;
|
43
44
|
private statuses;
|
44
45
|
private lookupTables;
|
45
|
-
constructor(txHandler: SolautoClient | ReferralStateManager, statusCallback?: ((statuses: TransactionManagerStatuses) => void) | undefined, txType?: TransactionRunType | undefined, priorityFeeSetting?: PriorityFeeSetting, errorsToThrow?: ErrorsToThrow | undefined, retries?: number, retryDelay?: number);
|
46
|
+
constructor(txHandler: SolautoClient | ReferralStateManager, statusCallback?: ((statuses: TransactionManagerStatuses) => void) | undefined, txType?: TransactionRunType | undefined, priorityFeeSetting?: PriorityFeeSetting, atomically?: boolean, errorsToThrow?: ErrorsToThrow | undefined, retries?: number, retryDelay?: number);
|
46
47
|
private assembleTransactionSets;
|
47
48
|
private updateStatus;
|
48
49
|
private debugAccounts;
|
@@ -51,6 +52,7 @@ export declare class TransactionsManager {
|
|
51
52
|
private updateLut;
|
52
53
|
clientSend(transactions: TransactionItem[]): Promise<TransactionManagerStatuses>;
|
53
54
|
send(items: TransactionItem[]): Promise<TransactionManagerStatuses>;
|
55
|
+
private processTransactionsAtomically;
|
54
56
|
private processTransactionSet;
|
55
57
|
private refreshItemSet;
|
56
58
|
private sendTransaction;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"transactionsManager.d.ts","sourceRoot":"","sources":["../../src/transactions/transactionsManager.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,kBAAkB,EAEnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAMzD,OAAO,EACL,aAAa,EAEd,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,kBAAkB,EAElB,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,oBAAoB,EAAa,MAAM,YAAY,CAAC;AAW7D,qBAAa,wBAAyB,SAAQ,KAAK;gBACrC,OAAO,EAAE,MAAM;CAK5B;AAqCD,qBAAa,eAAe;IAMjB,OAAO,EAAE,CACd,UAAU,EAAE,MAAM,KACf,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC;IACxC,IAAI,CAAC,EAAE,MAAM;IARtB,oBAAoB,EAAG,MAAM,EAAE,CAAC;IAChC,EAAE,CAAC,EAAE,kBAAkB,CAAC;IACjB,WAAW,EAAE,OAAO,CAAS;gBAG3B,OAAO,EAAE,CACd,UAAU,EAAE,MAAM,KACf,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC,EACxC,IAAI,CAAC,EAAE,MAAM,YAAA;IAGhB,UAAU;IAKV,OAAO,CAAC,UAAU,EAAE,MAAM;IAMhC,cAAc,IAAI,MAAM,EAAE;CAY3B;AAmFD,oBAAY,iBAAiB;IAC3B,OAAO,YAAY;IACnB,UAAU,eAAe;IACzB,MAAM,WAAW;IACjB,UAAU,eAAe;IACzB,MAAM,WAAW;CAClB;AAED,MAAM,MAAM,0BAA0B,GAAG;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,EAAE,CAAC;AAEJ,qBAAa,mBAAmB;IAK5B,OAAO,CAAC,SAAS;IACjB,OAAO,CAAC,cAAc,CAAC;IACvB,OAAO,CAAC,MAAM,CAAC;IACf,OAAO,CAAC,kBAAkB;IAC1B,OAAO,CAAC,aAAa,CAAC;IACtB,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,UAAU;
|
1
|
+
{"version":3,"file":"transactionsManager.d.ts","sourceRoot":"","sources":["../../src/transactions/transactionsManager.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,kBAAkB,EAEnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAMzD,OAAO,EACL,aAAa,EAEd,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,kBAAkB,EAElB,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,oBAAoB,EAAa,MAAM,YAAY,CAAC;AAW7D,qBAAa,wBAAyB,SAAQ,KAAK;gBACrC,OAAO,EAAE,MAAM;CAK5B;AAqCD,qBAAa,eAAe;IAMjB,OAAO,EAAE,CACd,UAAU,EAAE,MAAM,KACf,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC;IACxC,IAAI,CAAC,EAAE,MAAM;IARtB,oBAAoB,EAAG,MAAM,EAAE,CAAC;IAChC,EAAE,CAAC,EAAE,kBAAkB,CAAC;IACjB,WAAW,EAAE,OAAO,CAAS;gBAG3B,OAAO,EAAE,CACd,UAAU,EAAE,MAAM,KACf,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC,EACxC,IAAI,CAAC,EAAE,MAAM,YAAA;IAGhB,UAAU;IAKV,OAAO,CAAC,UAAU,EAAE,MAAM;IAMhC,cAAc,IAAI,MAAM,EAAE;CAY3B;AAmFD,oBAAY,iBAAiB;IAC3B,OAAO,YAAY;IACnB,UAAU,eAAe;IACzB,MAAM,WAAW;IACjB,UAAU,eAAe;IACzB,MAAM,WAAW;CAClB;AAED,MAAM,MAAM,0BAA0B,GAAG;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,EAAE,CAAC;AAEJ,qBAAa,mBAAmB;IAK5B,OAAO,CAAC,SAAS;IACjB,OAAO,CAAC,cAAc,CAAC;IACvB,OAAO,CAAC,MAAM,CAAC;IACf,OAAO,CAAC,kBAAkB;IAC1B,OAAO,CAAC,UAAU;IAClB,OAAO,CAAC,aAAa,CAAC;IACtB,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,UAAU;IAXpB,OAAO,CAAC,QAAQ,CAAkC;IAClD,OAAO,CAAC,YAAY,CAAe;gBAGzB,SAAS,EAAE,aAAa,GAAG,oBAAoB,EAC/C,cAAc,CAAC,GAAE,CAAC,QAAQ,EAAE,0BAA0B,KAAK,IAAI,aAAA,EAC/D,MAAM,CAAC,EAAE,kBAAkB,YAAA,EAC3B,kBAAkB,GAAE,kBAA2C,EAC/D,UAAU,GAAE,OAAe,EAC3B,aAAa,CAAC,EAAE,aAAa,YAAA,EAC7B,OAAO,GAAE,MAAU,EACnB,UAAU,GAAE,MAAY;YAQpB,uBAAuB;IAwCrC,OAAO,CAAC,YAAY;YA6CN,aAAa;IAoB3B,OAAO,CAAC,4BAA4B;IAgBpC,OAAO,CAAC,mBAAmB;YAMb,SAAS;IAgBV,UAAU,CACrB,YAAY,EAAE,eAAe,EAAE,GAC9B,OAAO,CAAC,0BAA0B,CAAC;IA0FzB,IAAI,CACf,KAAK,EAAE,eAAe,EAAE,GACvB,OAAO,CAAC,0BAA0B,CAAC;YAmCxB,6BAA6B;YA8D7B,qBAAqB;YAuDrB,cAAc;YAqCd,eAAe;CAmD9B"}
|
@@ -13,7 +13,7 @@ const types_1 = require("../types");
|
|
13
13
|
const web3_js_1 = require("@solana/web3.js");
|
14
14
|
const switchboardConstants_1 = require("../constants/switchboardConstants");
|
15
15
|
const utils_1 = require("../utils");
|
16
|
-
|
16
|
+
const jitoUtils_1 = require("../utils/jitoUtils");
|
17
17
|
const CHORES_TX_NAME = "account chores";
|
18
18
|
class TransactionTooLargeError extends Error {
|
19
19
|
constructor(message) {
|
@@ -139,11 +139,12 @@ var TransactionStatus;
|
|
139
139
|
TransactionStatus["Failed"] = "Failed";
|
140
140
|
})(TransactionStatus || (exports.TransactionStatus = TransactionStatus = {}));
|
141
141
|
class TransactionsManager {
|
142
|
-
constructor(txHandler, statusCallback, txType, priorityFeeSetting = types_1.PriorityFeeSetting.Min, errorsToThrow, retries = 4, retryDelay = 150) {
|
142
|
+
constructor(txHandler, statusCallback, txType, priorityFeeSetting = types_1.PriorityFeeSetting.Min, atomically = false, errorsToThrow, retries = 4, retryDelay = 150) {
|
143
143
|
this.txHandler = txHandler;
|
144
144
|
this.statusCallback = statusCallback;
|
145
145
|
this.txType = txType;
|
146
146
|
this.priorityFeeSetting = priorityFeeSetting;
|
147
|
+
this.atomically = atomically;
|
147
148
|
this.errorsToThrow = errorsToThrow;
|
148
149
|
this.retries = retries;
|
149
150
|
this.retryDelay = retryDelay;
|
@@ -266,7 +267,7 @@ class TransactionsManager {
|
|
266
267
|
const swbOracle = allAccounts.find((x) => Object.values(switchboardConstants_1.SWITCHBOARD_PRICE_FEED_IDS).includes(x ?? ""));
|
267
268
|
if (swbOracle) {
|
268
269
|
const mint = new web3_js_1.PublicKey(Object.keys(switchboardConstants_1.SWITCHBOARD_PRICE_FEED_IDS).find((x) => switchboardConstants_1.SWITCHBOARD_PRICE_FEED_IDS[x] === swbOracle));
|
269
|
-
const stale = (await (0, utils_1.
|
270
|
+
const stale = (await (0, utils_1.getSwitchboardFeedData)(client.connection, [mint]))[0]
|
270
271
|
.stale;
|
271
272
|
if (stale) {
|
272
273
|
const swbTx = new TransactionItem(async () => (0, utils_1.buildSwbSubmitResponseTx)(client.connection, client.signer, mint), items.length === 1 ? "Update oracle" : "");
|
@@ -316,13 +317,40 @@ class TransactionsManager {
|
|
316
317
|
this.txHandler.log("Only simulate and more than 1 transaction. Skipping...");
|
317
318
|
return [];
|
318
319
|
}
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
320
|
+
if (itemSets.length > 1 && this.atomically) {
|
321
|
+
await this.processTransactionsAtomically(itemSets);
|
322
|
+
}
|
323
|
+
else {
|
324
|
+
let currentIndex = 0;
|
325
|
+
while (currentIndex < itemSets.length) {
|
326
|
+
await this.processTransactionSet(itemSets, currentIndex);
|
327
|
+
currentIndex++;
|
328
|
+
}
|
323
329
|
}
|
324
330
|
return this.statuses;
|
325
331
|
}
|
332
|
+
async processTransactionsAtomically(itemSets) {
|
333
|
+
let num = 0;
|
334
|
+
await (0, generalUtils_1.retryWithExponentialBackoff)(async (attemptNum) => {
|
335
|
+
num = attemptNum;
|
336
|
+
let transactions = [];
|
337
|
+
for (const set of itemSets) {
|
338
|
+
transactions.push(await set.getSingleTransaction());
|
339
|
+
}
|
340
|
+
itemSets.forEach((x) => this.updateStatus(x.name(), TransactionStatus.Processing, attemptNum));
|
341
|
+
const txSigs = await (0, jitoUtils_1.sendJitoBundledTransactions)(this.txHandler.umi, this.txHandler.signer, transactions, false, this.priorityFeeSetting);
|
342
|
+
if (txSigs) {
|
343
|
+
itemSets.forEach((x, i) => this.updateStatus(x.name(), TransactionStatus.Successful, attemptNum, txSigs[i]));
|
344
|
+
}
|
345
|
+
else {
|
346
|
+
itemSets.forEach((x) => this.updateStatus(x.name(), TransactionStatus.Failed, attemptNum, undefined, true));
|
347
|
+
throw new Error("Unknown error");
|
348
|
+
}
|
349
|
+
}, this.retries, this.retryDelay, this.errorsToThrow).catch((e) => {
|
350
|
+
itemSets.forEach((x) => this.updateStatus(x.name(), TransactionStatus.Failed, num, undefined, true, e.message));
|
351
|
+
throw e;
|
352
|
+
});
|
353
|
+
}
|
326
354
|
async processTransactionSet(itemSets, currentIndex) {
|
327
355
|
let itemSet = itemSets[currentIndex];
|
328
356
|
let num = 0;
|
@@ -1 +1,6 @@
|
|
1
|
+
import { PublicKey } from "@solana/web3.js";
|
2
|
+
import { Signer, TransactionBuilder, Umi } from "@metaplex-foundation/umi";
|
3
|
+
import { PriorityFeeSetting } from "../types";
|
4
|
+
export declare function getRandomTipAccount(): Promise<PublicKey>;
|
5
|
+
export declare function sendJitoBundledTransactions(umi: Umi, signer: Signer, txs: TransactionBuilder[], simulateOnly?: boolean, priorityFeeSetting?: PriorityFeeSetting): Promise<string[] | undefined>;
|
1
6
|
//# sourceMappingURL=jitoUtils.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"jitoUtils.d.ts","sourceRoot":"","sources":["../../src/utils/jitoUtils.ts"],"names":[],"mappings":""}
|
1
|
+
{"version":3,"file":"jitoUtils.d.ts","sourceRoot":"","sources":["../../src/utils/jitoUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAwB,MAAM,iBAAiB,CAAC;AAGlE,OAAO,EACL,MAAM,EACN,kBAAkB,EAClB,GAAG,EAEJ,MAAM,0BAA0B,CAAC;AAOlC,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAI9C,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,SAAS,CAAC,CAa9D;AA2GD,wBAAsB,2BAA2B,CAC/C,GAAG,EAAE,GAAG,EACR,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,kBAAkB,EAAE,EACzB,YAAY,CAAC,EAAE,OAAO,EACtB,kBAAkB,GAAE,kBAA2C,GAC9D,OAAO,CAAC,MAAM,EAAE,GAAG,SAAS,CAAC,CA0C/B"}
|
package/dist/utils/jitoUtils.js
CHANGED
@@ -1,64 +1,35 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
// }
|
34
|
-
// export async function getRandomTipAccount(): Promise<PublicKey> {
|
35
|
-
// const tipAccounts = await getSearcherClient().getTipAccounts();
|
36
|
-
// const randomInt = Math.floor(Math.random() * tipAccounts.length);
|
37
|
-
// return new PublicKey(tipAccounts[randomInt]);
|
38
|
-
// }
|
39
|
-
// export async function waitUntilJitoNextLeader(
|
40
|
-
// distanceFromJitoSlot: number = 5
|
41
|
-
// ) {
|
42
|
-
// let searcher = getSearcherClient();
|
43
|
-
// let isLeaderSlot = false;
|
44
|
-
// while (!isLeaderSlot) {
|
45
|
-
// const nextLeader = await searcher.getNextScheduledLeader();
|
46
|
-
// const numSlots = nextLeader.nextLeaderSlot - nextLeader.currentSlot;
|
47
|
-
// isLeaderSlot = numSlots <= distanceFromJitoSlot && numSlots > 1;
|
48
|
-
// consoleLog(`Next jito leader slot in ${numSlots} slots`);
|
49
|
-
// await new Promise((r) => setTimeout(r, 500));
|
50
|
-
// }
|
51
|
-
// }
|
52
|
-
// async function getTipInstruction(
|
53
|
-
// client: SolautoClient,
|
54
|
-
// tipLamports: number
|
55
|
-
// ): Promise<WrappedInstruction> {
|
56
|
-
// return systemTransferUmiIx(
|
57
|
-
// client.signer,
|
58
|
-
// await getRandomTipAccount(),
|
59
|
-
// BigInt(tipLamports)
|
60
|
-
// );
|
61
|
-
// }
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
exports.getRandomTipAccount = getRandomTipAccount;
|
7
|
+
exports.sendJitoBundledTransactions = sendJitoBundledTransactions;
|
8
|
+
const web3_js_1 = require("@solana/web3.js");
|
9
|
+
const umi_web3js_adapters_1 = require("@metaplex-foundation/umi-web3js-adapters");
|
10
|
+
const solautoConstants_1 = require("../constants/solautoConstants");
|
11
|
+
const solanaUtils_1 = require("./solanaUtils");
|
12
|
+
const generalUtils_1 = require("./generalUtils");
|
13
|
+
const types_1 = require("../types");
|
14
|
+
const axios_1 = __importDefault(require("axios"));
|
15
|
+
const bs58_1 = __importDefault(require("bs58"));
|
16
|
+
async function getRandomTipAccount() {
|
17
|
+
const tipAccounts = [
|
18
|
+
"96gYZGLnJYVFmbjzopPSU6QiEV5fGqZNyN9nmNhvrZU5",
|
19
|
+
"HFqU5x63VTqvQss8hp11i4wVV8bD44PvwucfZ2bU7gRe",
|
20
|
+
"Cw8CFyM9FkoMi7K7Crf6HNQqf4uEMzpKw6QNghXLvLkY",
|
21
|
+
"ADaUMid9yfUytqMBgopwjb2DTLSokTSzL1zt6iGPaS49",
|
22
|
+
"DfXygSm4jCyNCybVYYK6DwvWqjKee8pbDmJGcLWNDXjh",
|
23
|
+
"ADuUkR4vqLUMWXxW9gh6D6L8pMSawimctcNZ5pGwDcEt",
|
24
|
+
"DttWaMuVvTiduZRnguLF7jNxTgiMBZ1hyAumKUiL2KRL",
|
25
|
+
"3AVi9Tg9Uo68tJfuvoKvqKNWKkC5wPdSSdeBnizKZ6jT",
|
26
|
+
];
|
27
|
+
const randomInt = Math.floor(Math.random() * tipAccounts.length);
|
28
|
+
return new web3_js_1.PublicKey(tipAccounts[randomInt]);
|
29
|
+
}
|
30
|
+
async function getTipInstruction(signer, tipLamports) {
|
31
|
+
return (0, solanaUtils_1.systemTransferUmiIx)(signer, await getRandomTipAccount(), BigInt(tipLamports));
|
32
|
+
}
|
62
33
|
// async function simulateJitoBundle(
|
63
34
|
// txs: VersionedTransaction[]
|
64
35
|
// ): Promise<SimulatedBundleTransactionResult[]> {
|
@@ -77,94 +48,70 @@
|
|
77
48
|
// });
|
78
49
|
// return simulationResult.value.transactionResults;
|
79
50
|
// }
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
//
|
132
|
-
|
133
|
-
//
|
134
|
-
//
|
135
|
-
|
136
|
-
//
|
137
|
-
//
|
138
|
-
//
|
139
|
-
//
|
140
|
-
//
|
141
|
-
//
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
// client.signer,
|
148
|
-
// txs,
|
149
|
-
// feeEstimates,
|
150
|
-
// // Array(txs.length).fill(1_400_000)
|
151
|
-
// );
|
152
|
-
// // // TODO: Skip over this for now, and instead don't specify a compute unit limit in the final bundle transactions
|
153
|
-
// // const simulationResults = await simulateJitoBundle(builtTxs);
|
154
|
-
// if (!simulateOnly) {
|
155
|
-
// // let builtTxs = await umiToVersionedTransactions(
|
156
|
-
// // client.signer,
|
157
|
-
// // txs,
|
158
|
-
// // feeEstimates,
|
159
|
-
// // simulationResults.map((x) => x.unitsConsumed! * 1.15)
|
160
|
-
// // );
|
161
|
-
// const bundleResult = await sendJitoBundle(
|
162
|
-
// new Bundle(builtTxs, 100)
|
163
|
-
// );
|
164
|
-
// return {
|
165
|
-
// bundleResult,
|
166
|
-
// txSigs: builtTxs.map((x) => x.signatures).flat(),
|
167
|
-
// };
|
168
|
-
// }
|
169
|
-
// return undefined;
|
170
|
-
// }
|
51
|
+
async function umiToVersionedTransactions(umi, signer, txs, feeEstimates, computeUnitLimits) {
|
52
|
+
return await Promise.all(txs.map(async (tx, i) => {
|
53
|
+
const versionedTx = (0, umi_web3js_adapters_1.toWeb3JsTransaction)(await (await (0, solanaUtils_1.assembleFinalTransaction)(signer, tx, feeEstimates[i], computeUnitLimits ? computeUnitLimits[i] : undefined).setLatestBlockhash(umi)).buildAndSign(umi));
|
54
|
+
return versionedTx;
|
55
|
+
}));
|
56
|
+
}
|
57
|
+
async function getBundleStatus(bundleId) {
|
58
|
+
const res = await axios_1.default.post(`${solautoConstants_1.JITO_BLOCK_ENGINE}/api/v1/bundles`, {
|
59
|
+
jsonrpc: "2.0",
|
60
|
+
id: 1,
|
61
|
+
method: "getBundleStatuses",
|
62
|
+
params: [[bundleId]],
|
63
|
+
});
|
64
|
+
if (res.data.error) {
|
65
|
+
throw new Error(`Failed to get bundle status: ${res.data.error}`);
|
66
|
+
}
|
67
|
+
return res.data.result;
|
68
|
+
}
|
69
|
+
async function pollBundleStatus(bundleId, interval = 1000, timeout = 40000) {
|
70
|
+
const endTime = Date.now() + timeout;
|
71
|
+
while (Date.now() < endTime) {
|
72
|
+
await new Promise((resolve) => setTimeout(resolve, interval));
|
73
|
+
const statuses = await getBundleStatus(bundleId);
|
74
|
+
if (statuses?.value?.length > 0) {
|
75
|
+
const status = statuses.value[0].confirmation_status;
|
76
|
+
if (status === "confirmed") {
|
77
|
+
return statuses?.value[0].transactions;
|
78
|
+
}
|
79
|
+
}
|
80
|
+
}
|
81
|
+
return [];
|
82
|
+
}
|
83
|
+
async function sendJitoBundle(transactions) {
|
84
|
+
(0, generalUtils_1.consoleLog)("Sending bundle...");
|
85
|
+
const resp = await axios_1.default.post(`${solautoConstants_1.JITO_BLOCK_ENGINE}/api/v1/bundles`, {
|
86
|
+
jsonrpc: "2.0",
|
87
|
+
id: 1,
|
88
|
+
method: "sendBundle",
|
89
|
+
params: [transactions],
|
90
|
+
});
|
91
|
+
const bundleId = resp.data.result;
|
92
|
+
return await pollBundleStatus(bundleId);
|
93
|
+
}
|
94
|
+
async function sendJitoBundledTransactions(umi, signer, txs, simulateOnly, priorityFeeSetting = types_1.PriorityFeeSetting.Min) {
|
95
|
+
(0, generalUtils_1.consoleLog)("Sending Jito bundle...");
|
96
|
+
(0, generalUtils_1.consoleLog)("Transactions: ", txs.length);
|
97
|
+
(0, generalUtils_1.consoleLog)("Transaction sizes: ", txs.map((x) => x.getTransactionSize(umi)));
|
98
|
+
txs[0] = txs[0].prepend(await getTipInstruction(signer, 150000));
|
99
|
+
const feeEstimates = await Promise.all(txs.map(async (x) => (await (0, solanaUtils_1.getComputeUnitPriceEstimate)(umi, x, priorityFeeSetting)) ??
|
100
|
+
1000000));
|
101
|
+
let builtTxs = await umiToVersionedTransactions(umi, signer, txs, feeEstimates
|
102
|
+
// Array(txs.length).fill(1_400_000)
|
103
|
+
);
|
104
|
+
// // TODO: Skip over this for now, and instead don't specify a compute unit limit in the final bundle transactions
|
105
|
+
// const simulationResults = await simulateJitoBundle(builtTxs);
|
106
|
+
if (!simulateOnly) {
|
107
|
+
// let builtTxs = await umiToVersionedTransactions(
|
108
|
+
// client.signer,
|
109
|
+
// txs,
|
110
|
+
// feeEstimates,
|
111
|
+
// simulationResults.map((x) => x.unitsConsumed! * 1.15)
|
112
|
+
// );
|
113
|
+
const txSigs = await sendJitoBundle(builtTxs.map((x) => bs58_1.default.encode(x.serialize())));
|
114
|
+
return txSigs.length > 0 ? txSigs : undefined;
|
115
|
+
}
|
116
|
+
return undefined;
|
117
|
+
}
|
@@ -1,12 +1,7 @@
|
|
1
|
-
import {
|
1
|
+
import { PublicKey } from "@solana/web3.js";
|
2
2
|
import { PublicKey as UmiPublicKey } from "@metaplex-foundation/umi";
|
3
3
|
export declare function fetchTokenPrices(mints: PublicKey[]): Promise<number[]>;
|
4
4
|
export declare function getPythPrices(mints: PublicKey[]): Promise<number[]>;
|
5
|
-
export declare function getSwitchboardPrices(conn: Connection, mints: PublicKey[]): Promise<{
|
6
|
-
mint: PublicKey;
|
7
|
-
price: number;
|
8
|
-
stale: boolean;
|
9
|
-
}[]>;
|
10
5
|
export declare function safeGetPrice(mint: PublicKey | UmiPublicKey | undefined): number | undefined;
|
11
6
|
export declare function getJupTokenPrices(mints: PublicKey[]): Promise<number[]>;
|
12
7
|
//# sourceMappingURL=priceUtils.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"priceUtils.d.ts","sourceRoot":"","sources":["../../src/utils/priceUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"priceUtils.d.ts","sourceRoot":"","sources":["../../src/utils/priceUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,SAAS,IAAI,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAYrE,wBAAsB,gBAAgB,CACpC,KAAK,EAAE,SAAS,EAAE,GACjB,OAAO,CAAC,MAAM,EAAE,CAAC,CAqCnB;AAED,wBAAsB,aAAa,CAAC,KAAK,EAAE,SAAS,EAAE,qBAwCrD;AAED,wBAAgB,YAAY,CAC1B,IAAI,EAAE,SAAS,GAAG,YAAY,GAAG,SAAS,GACzC,MAAM,GAAG,SAAS,CAKpB;AAED,wBAAsB,iBAAiB,CAAC,KAAK,EAAE,SAAS,EAAE,qBAsBzD"}
|
package/dist/utils/priceUtils.js
CHANGED
@@ -2,7 +2,6 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.fetchTokenPrices = fetchTokenPrices;
|
4
4
|
exports.getPythPrices = getPythPrices;
|
5
|
-
exports.getSwitchboardPrices = getSwitchboardPrices;
|
6
5
|
exports.safeGetPrice = safeGetPrice;
|
7
6
|
exports.getJupTokenPrices = getJupTokenPrices;
|
8
7
|
const pythConstants_1 = require("../constants/pythConstants");
|
@@ -21,7 +20,7 @@ async function fetchTokenPrices(mints) {
|
|
21
20
|
const switchboardMints = mints.filter((x) => x.toString() in switchboardConstants_1.SWITCHBOARD_PRICE_FEED_IDS);
|
22
21
|
const [pythData, switchboardData] = await Promise.all([
|
23
22
|
(0, generalUtils_1.zip)(pythMints, await getPythPrices(pythMints)),
|
24
|
-
(0, generalUtils_1.zip)(switchboardMints, await
|
23
|
+
(0, generalUtils_1.zip)(switchboardMints, await (0, switchboardUtils_1.getSwitchboardPrices)(switchboardMints)),
|
25
24
|
]);
|
26
25
|
const prices = mints.map((mint) => {
|
27
26
|
const item = [...pythData, ...switchboardData].find((data) => data[0].equals(mint));
|
@@ -63,20 +62,6 @@ async function getPythPrices(mints) {
|
|
63
62
|
}, 5, 200);
|
64
63
|
return prices;
|
65
64
|
}
|
66
|
-
async function getSwitchboardPrices(conn, mints) {
|
67
|
-
if (mints.length === 0) {
|
68
|
-
return [];
|
69
|
-
}
|
70
|
-
const currSlot = await (0, generalUtils_1.retryWithExponentialBackoff)(async () => await conn.getSlot("confirmed"), 5);
|
71
|
-
const results = await Promise.all(mints.map(async (mint) => {
|
72
|
-
const feed = (0, switchboardUtils_1.getPullFeed)(conn, mint);
|
73
|
-
const result = await feed.loadData();
|
74
|
-
const price = Number(result.result.value) / Math.pow(10, 18);
|
75
|
-
const stale = currSlot > result.result.slot.toNumber() + result.maxStaleness;
|
76
|
-
return { mint, price, stale };
|
77
|
-
}));
|
78
|
-
return results;
|
79
|
-
}
|
80
65
|
function safeGetPrice(mint) {
|
81
66
|
if (mint && mint?.toString() in solautoConstants_1.PRICES) {
|
82
67
|
return solautoConstants_1.PRICES[mint.toString()].price;
|
@@ -89,9 +74,10 @@ async function getJupTokenPrices(mints) {
|
|
89
74
|
}
|
90
75
|
const data = await (0, generalUtils_1.retryWithExponentialBackoff)(async () => {
|
91
76
|
const res = (await fetch("https://api.jup.ag/price/v2?ids=" +
|
92
|
-
mints.map((x) => x.toString()).join(","))).json();
|
77
|
+
mints.map((x) => x.toString()).join(",") + "&showExtraInfo=true")).json();
|
93
78
|
return res;
|
94
79
|
}, 6);
|
80
|
+
console.log(data.data[mints[0].toString()].extraInfo.quotedPrice);
|
95
81
|
const prices = Object.values(data.data).map((x) => parseFloat(x.price));
|
96
82
|
return prices;
|
97
83
|
}
|
@@ -170,7 +170,7 @@ async function getComputeUnitPriceEstimate(umi, tx, prioritySetting) {
|
|
170
170
|
}
|
171
171
|
return feeEstimate;
|
172
172
|
}
|
173
|
-
async function spamSendTransactionUntilConfirmed(connection, transaction, blockhash, spamInterval =
|
173
|
+
async function spamSendTransactionUntilConfirmed(connection, transaction, blockhash, spamInterval = 1500) {
|
174
174
|
let transactionSignature = null;
|
175
175
|
const sendTx = async () => {
|
176
176
|
try {
|
@@ -4,4 +4,10 @@ import { TransactionItemInputs } from "../types";
|
|
4
4
|
import { Signer } from "@metaplex-foundation/umi";
|
5
5
|
export declare function getPullFeed(conn: Connection, mint: PublicKey, wallet?: PublicKey): PullFeed;
|
6
6
|
export declare function buildSwbSubmitResponseTx(conn: Connection, signer: Signer, mint: PublicKey): Promise<TransactionItemInputs | undefined>;
|
7
|
+
export declare function getSwitchboardFeedData(conn: Connection, mints: PublicKey[]): Promise<{
|
8
|
+
mint: PublicKey;
|
9
|
+
price: number;
|
10
|
+
stale: boolean;
|
11
|
+
}[]>;
|
12
|
+
export declare function getSwitchboardPrices(mints: PublicKey[]): Promise<number[]>;
|
7
13
|
//# sourceMappingURL=switchboardUtils.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"switchboardUtils.d.ts","sourceRoot":"","sources":["../../src/utils/switchboardUtils.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,UAAU,EACV,SAAS,EAGV,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAkB,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAEtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,EAAE,MAAM,EAAsB,MAAM,0BAA0B,CAAC;
|
1
|
+
{"version":3,"file":"switchboardUtils.d.ts","sourceRoot":"","sources":["../../src/utils/switchboardUtils.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,UAAU,EACV,SAAS,EAGV,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAkB,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAEtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,EAAE,MAAM,EAAsB,MAAM,0BAA0B,CAAC;AAOtE,wBAAgB,WAAW,CACzB,IAAI,EAAE,UAAU,EAChB,IAAI,EAAE,SAAS,EACf,MAAM,CAAC,EAAE,SAAS,YAsBnB;AAED,wBAAsB,wBAAwB,CAC5C,IAAI,EAAE,UAAU,EAChB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,SAAS,GACd,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC,CAsB5C;AAED,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,UAAU,EAChB,KAAK,EAAE,SAAS,EAAE,GACjB,OAAO,CAAC;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,EAAE,CAAC,CAuB/D;AAED,wBAAsB,oBAAoB,CACxC,KAAK,EAAE,SAAS,EAAE,GACjB,OAAO,CAAC,MAAM,EAAE,CAAC,CAiBnB"}
|
@@ -5,6 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
6
|
exports.getPullFeed = getPullFeed;
|
7
7
|
exports.buildSwbSubmitResponseTx = buildSwbSubmitResponseTx;
|
8
|
+
exports.getSwitchboardFeedData = getSwitchboardFeedData;
|
9
|
+
exports.getSwitchboardPrices = getSwitchboardPrices;
|
8
10
|
const anchor_1 = require("@coral-xyz/anchor");
|
9
11
|
const switchboard_json_1 = __importDefault(require("../idls/switchboard.json"));
|
10
12
|
const web3_js_1 = require("@solana/web3.js");
|
@@ -12,6 +14,7 @@ const on_demand_1 = require("@switchboard-xyz/on-demand");
|
|
12
14
|
const switchboardConstants_1 = require("../constants/switchboardConstants");
|
13
15
|
const umi_1 = require("@metaplex-foundation/umi");
|
14
16
|
const umi_web3js_adapters_1 = require("@metaplex-foundation/umi-web3js-adapters");
|
17
|
+
const generalUtils_1 = require("./generalUtils");
|
15
18
|
function getPullFeed(conn, mint, wallet) {
|
16
19
|
const dummyWallet = {
|
17
20
|
publicKey: wallet ?? new web3_js_1.PublicKey("11111111111111111111111111111111"),
|
@@ -25,9 +28,9 @@ function getPullFeed(conn, mint, wallet) {
|
|
25
28
|
async function buildSwbSubmitResponseTx(conn, signer, mint) {
|
26
29
|
const crossbar = new on_demand_1.CrossbarClient("https://crossbar.switchboard.xyz");
|
27
30
|
const feed = getPullFeed(conn, mint, (0, umi_web3js_adapters_1.toWeb3JsPublicKey)(signer.publicKey));
|
28
|
-
const [pullIx, responses] = await feed.fetchUpdateIx({
|
31
|
+
const [pullIx, responses] = await (0, generalUtils_1.retryWithExponentialBackoff)(async () => await feed.fetchUpdateIx({
|
29
32
|
crossbarClient: crossbar,
|
30
|
-
});
|
33
|
+
}), 8, 200);
|
31
34
|
return {
|
32
35
|
tx: (0, umi_1.transactionBuilder)().add({
|
33
36
|
bytesCreatedOnChain: 0,
|
@@ -39,3 +42,25 @@ async function buildSwbSubmitResponseTx(conn, signer, mint) {
|
|
39
42
|
.map((x) => x.oracle.lut.key.toString()),
|
40
43
|
};
|
41
44
|
}
|
45
|
+
async function getSwitchboardFeedData(conn, mints) {
|
46
|
+
if (mints.length === 0) {
|
47
|
+
return [];
|
48
|
+
}
|
49
|
+
const currSlot = await (0, generalUtils_1.retryWithExponentialBackoff)(async () => await conn.getSlot("confirmed"), 5);
|
50
|
+
const results = await Promise.all(mints.map(async (mint) => {
|
51
|
+
const feed = getPullFeed(conn, mint);
|
52
|
+
const result = await feed.loadData();
|
53
|
+
const price = Number(result.result.value) / Math.pow(10, 18);
|
54
|
+
const stale = currSlot > result.result.slot.toNumber() + result.maxStaleness;
|
55
|
+
return { mint, price, stale };
|
56
|
+
}));
|
57
|
+
return results;
|
58
|
+
}
|
59
|
+
async function getSwitchboardPrices(mints) {
|
60
|
+
if (mints.length === 0) {
|
61
|
+
return [];
|
62
|
+
}
|
63
|
+
const crossbar = new on_demand_1.CrossbarClient("https://crossbar.switchboard.xyz");
|
64
|
+
const results = await (0, generalUtils_1.retryWithExponentialBackoff)(async () => await crossbar.simulateSolanaFeeds("mainnet", mints.map((x) => switchboardConstants_1.SWITCHBOARD_PRICE_FEED_IDS[x.toString()])), 8, 200);
|
65
|
+
return results.flatMap((x) => x.results[0]);
|
66
|
+
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@haven-fi/solauto-sdk",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.311",
|
4
4
|
"main": "dist/index.js",
|
5
5
|
"types": "dist/index.d.ts",
|
6
6
|
"description": "Typescript SDK for the Solauto program on the Solana blockchain",
|
@@ -26,6 +26,7 @@
|
|
26
26
|
"@solana/spl-token": "^0.4.0",
|
27
27
|
"@solana/web3.js": "^1.95.4",
|
28
28
|
"@switchboard-xyz/on-demand": "^1.2.51",
|
29
|
+
"axios": "^1.7.8",
|
29
30
|
"bs58": "^5.0.0",
|
30
31
|
"cross-fetch": "^4.0.0",
|
31
32
|
"rpc-websockets": "7.11.0"
|
@@ -9,7 +9,6 @@ import {
|
|
9
9
|
ASSOCIATED_TOKEN_PROGRAM_ID,
|
10
10
|
TOKEN_PROGRAM_ID,
|
11
11
|
} from "@solana/spl-token";
|
12
|
-
// import { JitoRpcConnection } from "jito-ts";
|
13
12
|
import { SOLAUTO_MANAGER } from "./generalAccounts";
|
14
13
|
import { JUPITER_PROGRAM_ID } from "../jupiter-sdk";
|
15
14
|
|
@@ -46,8 +45,4 @@ export const STANDARD_LUT_ACCOUNTS = [
|
|
46
45
|
JUPITER_PROGRAM_ID,
|
47
46
|
].map((x) => x.toString());
|
48
47
|
|
49
|
-
|
50
|
-
// export const JITO_CONNECTION = new JitoRpcConnection(
|
51
|
-
// `https://${JITO_BLOCK_ENGINE}`,
|
52
|
-
// "finalized"
|
53
|
-
// );
|
48
|
+
export const JITO_BLOCK_ENGINE = "https://mainnet.block-engine.jito.wtf";
|