@haven-fi/solauto-sdk 1.0.556 → 1.0.557
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,EAKV,MAAM,iBAAiB,CAAC;AAMzB,OAAO,EACL,MAAM,EACN,kBAAkB,EAClB,GAAG,EAEH,kBAAkB,EAEnB,MAAM,0BAA0B,CAAC;AAYlC,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAMlE,wBAAgB,mBAAmB,IAAI,SAAS,CAG/C;
|
1
|
+
{"version":3,"file":"jitoUtils.d.ts","sourceRoot":"","sources":["../../src/utils/jitoUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,SAAS,EAKV,MAAM,iBAAiB,CAAC;AAMzB,OAAO,EACL,MAAM,EACN,kBAAkB,EAClB,GAAG,EAEH,kBAAkB,EAEnB,MAAM,0BAA0B,CAAC;AAYlC,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAMlE,wBAAgB,mBAAmB,IAAI,SAAS,CAG/C;AAgND,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,kBAAkB;;;;IAkB7D;AAED,wBAAsB,2BAA2B,CAC/C,GAAG,EAAE,GAAG,EACR,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EAAE,EACtB,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,CA+F/B"}
|
package/dist/utils/jitoUtils.js
CHANGED
@@ -58,34 +58,7 @@ async function simulateJitoBundle(umi, txs) {
|
|
58
58
|
skipSigVerify: true,
|
59
59
|
},
|
60
60
|
]);
|
61
|
-
|
62
|
-
// umi.rpc.getEndpoint(),
|
63
|
-
// {
|
64
|
-
// jsonrpc: "2.0",
|
65
|
-
// id: 1,
|
66
|
-
// method: "simulateBundle",
|
67
|
-
// params: [
|
68
|
-
// {
|
69
|
-
// encodedTransactions: txs.map((x) =>
|
70
|
-
// Buffer.from(x.serialize()).toString("base64")
|
71
|
-
// ),
|
72
|
-
// },
|
73
|
-
// {
|
74
|
-
// encoding: "base64",
|
75
|
-
// commitment: "confirmed",
|
76
|
-
// preExecutionAccountsConfigs: txs.map((_) => {}),
|
77
|
-
// postExecutionAccountsConfigs: txs.map((_) => {}),
|
78
|
-
// skipSigVerify: true,
|
79
|
-
// },
|
80
|
-
// ],
|
81
|
-
// },
|
82
|
-
// {
|
83
|
-
// headers: {
|
84
|
-
// "Content-Type": "application/json",
|
85
|
-
// },
|
86
|
-
// }
|
87
|
-
// );
|
88
|
-
if (res.result && res.result.value && res.result.value.summary.failed) {
|
61
|
+
if (res.value && res.value.summary.failed) {
|
89
62
|
const resValue = res.result.value;
|
90
63
|
const transactionResults = resValue.transactionResults;
|
91
64
|
transactionResults.forEach((x) => {
|
@@ -110,7 +83,7 @@ async function simulateJitoBundle(umi, txs) {
|
|
110
83
|
else if (res.error && res.error.message) {
|
111
84
|
throw new Error(res.error.message);
|
112
85
|
}
|
113
|
-
return res.
|
86
|
+
return res.value;
|
114
87
|
});
|
115
88
|
const transactionResults = simulationResult.transactionResults;
|
116
89
|
return transactionResults;
|
@@ -141,7 +114,7 @@ async function getBundleStatus(umi, bundleId) {
|
|
141
114
|
if (res.error) {
|
142
115
|
throw new Error(`Failed to get bundle status: ${res.error}`);
|
143
116
|
}
|
144
|
-
return res
|
117
|
+
return res;
|
145
118
|
}
|
146
119
|
async function pollBundleStatus(umi, bundleId, interval = 1000, timeout = 40000) {
|
147
120
|
const endTime = Date.now() + timeout;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"solanaUtils.d.ts","sourceRoot":"","sources":["../../src/utils/solanaUtils.ts"],"names":[],"mappings":"AACA,OAAO,EACL,uBAAuB,EACvB,MAAM,EACN,kBAAkB,EAClB,GAAG,EACH,kBAAkB,EAGnB,MAAM,0BAA0B,CAAC;AAOlC,OAAO,EAIL,UAAU,EACV,SAAS,EAKT,sBAAsB,EAEvB,MAAM,iBAAiB,CAAC;AAiBzB,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;
|
1
|
+
{"version":3,"file":"solanaUtils.d.ts","sourceRoot":"","sources":["../../src/utils/solanaUtils.ts"],"names":[],"mappings":"AACA,OAAO,EACL,uBAAuB,EACvB,MAAM,EACN,kBAAkB,EAClB,GAAG,EACH,kBAAkB,EAGnB,MAAM,0BAA0B,CAAC;AAOlC,OAAO,EAIL,UAAU,EACV,SAAS,EAKT,sBAAsB,EAEvB,MAAM,iBAAiB,CAAC;AAiBzB,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAIlE,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,MAAM,UAErD;AAED,wBAAgB,oBAAoB,CAAC,eAAe,EAAE,MAAM,UAE3D;AAED,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,MAAM,EACd,SAAS,GAAE,SAAgC,GAC1C,CAAC,UAAU,EAAE,GAAG,CAAC,CAQnB;AAED,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,MAAM,EACd,EAAE,EAAE,sBAAsB,GACzB,kBAAkB,CAMpB;AAED,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,MAAM,EACd,eAAe,EAAE,MAAM,GACtB,kBAAkB,CAOpB;AAED,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,GACf,kBAAkB,CAOpB;AAED,wBAAgB,iCAAiC,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,CAClD,GAAG,EAAE,GAAG,EACR,UAAU,EAAE,UAAU,EACtB,EAAE,EAAE,kBAAkB,EACtB,MAAM,CAAC,EAAE,kBAAkB,EAC3B,eAAe,GAAE,kBAA2C,EAC5D,cAAc,CAAC,EAAE,MAAM,IAAI,GAC1B,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC,CAuEjC"}
|
@@ -175,19 +175,7 @@ async function getComputeUnitPriceEstimate(umi, tx, prioritySetting, useAccounts
|
|
175
175
|
},
|
176
176
|
},
|
177
177
|
]);
|
178
|
-
// const resp = await umi.rpc.call("getPriorityFeeEstimate", [
|
179
|
-
// {
|
180
|
-
// transaction: !useAccounts
|
181
|
-
// ? bs58.encode(web3Transaction.serialize())
|
182
|
-
// : undefined,
|
183
|
-
// accountKeys: useAccounts ? accountKeys : undefined,
|
184
|
-
// options: {
|
185
|
-
// priorityLevel: prioritySetting.toString(),
|
186
|
-
// },
|
187
|
-
// },
|
188
|
-
// ]);
|
189
178
|
feeEstimate = Math.round(resp.priorityFeeEstimate);
|
190
|
-
console.log(resp);
|
191
179
|
}
|
192
180
|
catch (e) {
|
193
181
|
try {
|
@@ -199,14 +187,6 @@ async function getComputeUnitPriceEstimate(umi, tx, prioritySetting, useAccounts
|
|
199
187
|
},
|
200
188
|
},
|
201
189
|
]);
|
202
|
-
// const resp = await umi.rpc.call("getPriorityFeeEstimate", [
|
203
|
-
// {
|
204
|
-
// accountKeys,
|
205
|
-
// options: {
|
206
|
-
// priorityLevel: prioritySetting.toString(),
|
207
|
-
// },
|
208
|
-
// },
|
209
|
-
// ]);
|
210
190
|
feeEstimate = Math.round(resp.priorityFeeEstimate);
|
211
191
|
}
|
212
192
|
catch (e) {
|
package/package.json
CHANGED
package/src/utils/jitoUtils.ts
CHANGED
@@ -92,35 +92,8 @@ async function simulateJitoBundle(umi: Umi, txs: VersionedTransaction[]) {
|
|
92
92
|
skipSigVerify: true,
|
93
93
|
},
|
94
94
|
]);
|
95
|
-
// const resp = await axios.post(
|
96
|
-
// umi.rpc.getEndpoint(),
|
97
|
-
// {
|
98
|
-
// jsonrpc: "2.0",
|
99
|
-
// id: 1,
|
100
|
-
// method: "simulateBundle",
|
101
|
-
// params: [
|
102
|
-
// {
|
103
|
-
// encodedTransactions: txs.map((x) =>
|
104
|
-
// Buffer.from(x.serialize()).toString("base64")
|
105
|
-
// ),
|
106
|
-
// },
|
107
|
-
// {
|
108
|
-
// encoding: "base64",
|
109
|
-
// commitment: "confirmed",
|
110
|
-
// preExecutionAccountsConfigs: txs.map((_) => {}),
|
111
|
-
// postExecutionAccountsConfigs: txs.map((_) => {}),
|
112
|
-
// skipSigVerify: true,
|
113
|
-
// },
|
114
|
-
// ],
|
115
|
-
// },
|
116
|
-
// {
|
117
|
-
// headers: {
|
118
|
-
// "Content-Type": "application/json",
|
119
|
-
// },
|
120
|
-
// }
|
121
|
-
// );
|
122
95
|
|
123
|
-
if (res.
|
96
|
+
if (res.value && res.value.summary.failed) {
|
124
97
|
const resValue = res.result.value;
|
125
98
|
const transactionResults =
|
126
99
|
resValue.transactionResults as SimulatedTransactionResponse[];
|
@@ -155,7 +128,7 @@ async function simulateJitoBundle(umi: Umi, txs: VersionedTransaction[]) {
|
|
155
128
|
throw new Error(res.error.message);
|
156
129
|
}
|
157
130
|
|
158
|
-
return res.
|
131
|
+
return res.value;
|
159
132
|
});
|
160
133
|
|
161
134
|
const transactionResults =
|
@@ -211,8 +184,7 @@ async function getBundleStatus(umi: Umi, bundleId: string) {
|
|
211
184
|
if (res.error) {
|
212
185
|
throw new Error(`Failed to get bundle status: ${res.error}`);
|
213
186
|
}
|
214
|
-
|
215
|
-
return res.result;
|
187
|
+
return res;
|
216
188
|
}
|
217
189
|
|
218
190
|
async function pollBundleStatus(
|
package/src/utils/solanaUtils.ts
CHANGED
@@ -46,7 +46,6 @@ import {
|
|
46
46
|
import { PriorityFeeSetting, TransactionRunType } from "../types";
|
47
47
|
import { createDynamicSolautoProgram } from "./solauto";
|
48
48
|
import { SOLAUTO_PROD_PROGRAM } from "../constants";
|
49
|
-
import axios from "axios";
|
50
49
|
|
51
50
|
export function buildHeliusApiUrl(heliusApiKey: string) {
|
52
51
|
return `https://mainnet.helius-rpc.com/?api-key=${heliusApiKey}`;
|
@@ -326,19 +325,7 @@ export async function getComputeUnitPriceEstimate(
|
|
326
325
|
},
|
327
326
|
},
|
328
327
|
]);
|
329
|
-
// const resp = await umi.rpc.call("getPriorityFeeEstimate", [
|
330
|
-
// {
|
331
|
-
// transaction: !useAccounts
|
332
|
-
// ? bs58.encode(web3Transaction.serialize())
|
333
|
-
// : undefined,
|
334
|
-
// accountKeys: useAccounts ? accountKeys : undefined,
|
335
|
-
// options: {
|
336
|
-
// priorityLevel: prioritySetting.toString(),
|
337
|
-
// },
|
338
|
-
// },
|
339
|
-
// ]);
|
340
328
|
feeEstimate = Math.round((resp as any).priorityFeeEstimate as number);
|
341
|
-
console.log(resp);
|
342
329
|
} catch (e) {
|
343
330
|
try {
|
344
331
|
const resp = await customRpcCall(umi, "getPriorityFeeEstimate", [
|
@@ -349,14 +336,6 @@ export async function getComputeUnitPriceEstimate(
|
|
349
336
|
},
|
350
337
|
},
|
351
338
|
]);
|
352
|
-
// const resp = await umi.rpc.call("getPriorityFeeEstimate", [
|
353
|
-
// {
|
354
|
-
// accountKeys,
|
355
|
-
// options: {
|
356
|
-
// priorityLevel: prioritySetting.toString(),
|
357
|
-
// },
|
358
|
-
// },
|
359
|
-
// ]);
|
360
339
|
feeEstimate = Math.round((resp as any).priorityFeeEstimate as number);
|
361
340
|
} catch (e) {
|
362
341
|
// console.error(e);
|