@haven-fi/solauto-sdk 1.0.313 → 1.0.314
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/utils/jitoUtils.d.ts.map +1 -1
- package/dist/utils/jitoUtils.js +20 -22
- package/dist/utils/solanaUtils.d.ts +1 -1
- package/dist/utils/solanaUtils.d.ts.map +1 -1
- package/dist/utils/solanaUtils.js +19 -13
- package/package.json +1 -1
- package/src/utils/jitoUtils.ts +22 -22
- package/src/utils/solanaUtils.ts +22 -14
@@ -1 +1 @@
|
|
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;
|
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;AAQlC,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAK9C,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,SAAS,CAAC,CAa9D;AA0GD,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,CAyC/B"}
|
package/dist/utils/jitoUtils.js
CHANGED
@@ -30,23 +30,24 @@ async function getRandomTipAccount() {
|
|
30
30
|
async function getTipInstruction(signer, tipLamports) {
|
31
31
|
return (0, solanaUtils_1.systemTransferUmiIx)(signer, await getRandomTipAccount(), BigInt(tipLamports));
|
32
32
|
}
|
33
|
-
//
|
34
|
-
//
|
35
|
-
//
|
36
|
-
//
|
37
|
-
//
|
38
|
-
//
|
39
|
-
//
|
40
|
-
//
|
41
|
-
//
|
42
|
-
//
|
43
|
-
//
|
44
|
-
//
|
45
|
-
//
|
46
|
-
//
|
33
|
+
// TODO: fix
|
34
|
+
// async function simulateJitoBundle(umi: Umi, txs: VersionedTransaction[]) {
|
35
|
+
// const simulationResult = await axios.post(
|
36
|
+
// `${JITO_BLOCK_ENGINE}/api/v1/bundles`,
|
37
|
+
// {
|
38
|
+
// method: "simulateBundle",
|
39
|
+
// id: 1,
|
40
|
+
// jsonrpc: "2.0",
|
41
|
+
// params: [
|
42
|
+
// {
|
43
|
+
// encodedTransactions: txs.map((x) => bs58.encode(x.serialize())),
|
44
|
+
// preExecutionAccountsConfigs: txs.map((_) => ""),
|
45
|
+
// postExecutionAccountsConfigs: txs.map((_) => ""),
|
46
|
+
// skipSigVerify: true,
|
47
|
+
// },
|
48
|
+
// ],
|
47
49
|
// }
|
48
|
-
//
|
49
|
-
// return simulationResult.value.transactionResults;
|
50
|
+
// );
|
50
51
|
// }
|
51
52
|
async function umiToVersionedTransactions(umi, signer, txs, feeEstimates, computeUnitLimits) {
|
52
53
|
return await Promise.all(txs.map(async (tx, i) => {
|
@@ -96,13 +97,10 @@ async function sendJitoBundledTransactions(umi, signer, txs, simulateOnly, prior
|
|
96
97
|
(0, generalUtils_1.consoleLog)("Transactions: ", txs.length);
|
97
98
|
(0, generalUtils_1.consoleLog)("Transaction sizes: ", txs.map((x) => x.getTransactionSize(umi)));
|
98
99
|
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
|
+
const feeEstimates = await Promise.all(txs.map(async (x) => (await (0, solanaUtils_1.getComputeUnitPriceEstimate)(umi, x, priorityFeeSetting)) ??
|
100
101
|
1000000));
|
101
|
-
let builtTxs = await umiToVersionedTransactions(umi, signer, txs, feeEstimates
|
102
|
-
//
|
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);
|
102
|
+
let builtTxs = await umiToVersionedTransactions(umi, signer, txs, feeEstimates);
|
103
|
+
// const simulationResults = await simulateJitoBundle(umi, builtTxs);
|
106
104
|
if (!simulateOnly) {
|
107
105
|
// let builtTxs = await umiToVersionedTransactions(
|
108
106
|
// client.signer,
|
@@ -14,6 +14,6 @@ export declare function splTokenTransferUmiIx(signer: Signer, fromTa: PublicKey,
|
|
14
14
|
export declare function getAddressLookupInputs(umi: Umi, lookupTableAddresses: string[]): Promise<AddressLookupTableInput[]>;
|
15
15
|
export declare function addTxOptimizations(signer: Signer, transaction: TransactionBuilder, computeUnitPrice?: number, computeUnitLimit?: number): TransactionBuilder;
|
16
16
|
export declare function assembleFinalTransaction(signer: Signer, transaction: TransactionBuilder, computeUnitPrice?: number, computeUnitLimit?: number): TransactionBuilder;
|
17
|
-
export declare function getComputeUnitPriceEstimate(umi: Umi, tx: TransactionBuilder, prioritySetting: PriorityFeeSetting
|
17
|
+
export declare function getComputeUnitPriceEstimate(umi: Umi, tx: TransactionBuilder, prioritySetting: PriorityFeeSetting): Promise<number | undefined>;
|
18
18
|
export declare function sendSingleOptimizedTransaction(umi: Umi, connection: Connection, tx: TransactionBuilder, txType?: TransactionRunType, prioritySetting?: PriorityFeeSetting, onAwaitingSign?: () => void): Promise<Uint8Array | undefined>;
|
19
19
|
//# sourceMappingURL=solanaUtils.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"solanaUtils.d.ts","sourceRoot":"","sources":["../../src/utils/solanaUtils.ts"],"names":[],"mappings":"AACA,OAAO,EACL,uBAAuB,EAC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U,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,CA+DjC"}
|
@@ -150,22 +150,13 @@ async function simulateTransaction(umi, connection, transaction) {
|
|
150
150
|
}
|
151
151
|
return simulationResult;
|
152
152
|
}
|
153
|
-
async function getComputeUnitPriceEstimate(umi, tx, prioritySetting
|
153
|
+
async function getComputeUnitPriceEstimate(umi, tx, prioritySetting) {
|
154
154
|
const web3Transaction = (0, umi_web3js_adapters_1.toWeb3JsTransaction)((await tx.setLatestBlockhash(umi, { commitment: "finalized" })).build(umi));
|
155
|
-
const transaction = simMayFail
|
156
|
-
? undefined
|
157
|
-
: bs58_1.default.encode(web3Transaction.serialize());
|
158
|
-
const accountKeys = simMayFail
|
159
|
-
? tx
|
160
|
-
.getInstructions()
|
161
|
-
.flatMap((x) => x.keys.flatMap((x) => x.pubkey.toString()))
|
162
|
-
: undefined;
|
163
155
|
let feeEstimate;
|
164
156
|
try {
|
165
157
|
const resp = await umi.rpc.call("getPriorityFeeEstimate", [
|
166
158
|
{
|
167
|
-
transaction,
|
168
|
-
accountKeys,
|
159
|
+
transaction: bs58_1.default.encode(web3Transaction.serialize()),
|
169
160
|
options: {
|
170
161
|
priorityLevel: prioritySetting.toString(),
|
171
162
|
},
|
@@ -174,7 +165,22 @@ async function getComputeUnitPriceEstimate(umi, tx, prioritySetting, simMayFail)
|
|
174
165
|
feeEstimate = Math.round(resp.priorityFeeEstimate);
|
175
166
|
}
|
176
167
|
catch (e) {
|
177
|
-
|
168
|
+
try {
|
169
|
+
const resp = await umi.rpc.call("getPriorityFeeEstimate", [
|
170
|
+
{
|
171
|
+
accountKeys: tx
|
172
|
+
.getInstructions()
|
173
|
+
.flatMap((x) => x.keys.flatMap((x) => x.pubkey.toString())),
|
174
|
+
options: {
|
175
|
+
priorityLevel: prioritySetting.toString(),
|
176
|
+
},
|
177
|
+
},
|
178
|
+
]);
|
179
|
+
feeEstimate = Math.round(resp.priorityFeeEstimate);
|
180
|
+
}
|
181
|
+
catch (e) {
|
182
|
+
console.error(e);
|
183
|
+
}
|
178
184
|
}
|
179
185
|
return feeEstimate;
|
180
186
|
}
|
@@ -216,7 +222,7 @@ async function sendSingleOptimizedTransaction(umi, connection, tx, txType, prior
|
|
216
222
|
(0, generalUtils_1.consoleLog)("Serialized transaction size: ", tx.getTransactionSize(umi));
|
217
223
|
let cuPrice;
|
218
224
|
if (prioritySetting !== types_1.PriorityFeeSetting.None) {
|
219
|
-
cuPrice = await getComputeUnitPriceEstimate(umi, tx, prioritySetting
|
225
|
+
cuPrice = await getComputeUnitPriceEstimate(umi, tx, prioritySetting);
|
220
226
|
if (!cuPrice) {
|
221
227
|
cuPrice = 1000000;
|
222
228
|
}
|
package/package.json
CHANGED
package/src/utils/jitoUtils.ts
CHANGED
@@ -9,6 +9,7 @@ import {
|
|
9
9
|
} from "@metaplex-foundation/umi";
|
10
10
|
import {
|
11
11
|
assembleFinalTransaction,
|
12
|
+
buildIronforgeApiUrl,
|
12
13
|
getComputeUnitPriceEstimate,
|
13
14
|
systemTransferUmiIx,
|
14
15
|
} from "./solanaUtils";
|
@@ -16,6 +17,7 @@ import { consoleLog } from "./generalUtils";
|
|
16
17
|
import { PriorityFeeSetting } from "../types";
|
17
18
|
import axios from "axios";
|
18
19
|
import base58 from "bs58";
|
20
|
+
import { bs58 } from "@coral-xyz/anchor/dist/cjs/utils/bytes";
|
19
21
|
|
20
22
|
export async function getRandomTipAccount(): Promise<PublicKey> {
|
21
23
|
const tipAccounts = [
|
@@ -43,25 +45,24 @@ async function getTipInstruction(
|
|
43
45
|
);
|
44
46
|
}
|
45
47
|
|
46
|
-
//
|
47
|
-
//
|
48
|
-
//
|
49
|
-
//
|
50
|
-
//
|
51
|
-
//
|
52
|
-
//
|
53
|
-
//
|
54
|
-
|
55
|
-
//
|
56
|
-
//
|
57
|
-
//
|
58
|
-
//
|
59
|
-
//
|
60
|
-
//
|
48
|
+
// TODO: fix
|
49
|
+
// async function simulateJitoBundle(umi: Umi, txs: VersionedTransaction[]) {
|
50
|
+
// const simulationResult = await axios.post(
|
51
|
+
// `${JITO_BLOCK_ENGINE}/api/v1/bundles`,
|
52
|
+
// {
|
53
|
+
// method: "simulateBundle",
|
54
|
+
// id: 1,
|
55
|
+
// jsonrpc: "2.0",
|
56
|
+
// params: [
|
57
|
+
// {
|
58
|
+
// encodedTransactions: txs.map((x) => bs58.encode(x.serialize())),
|
59
|
+
// preExecutionAccountsConfigs: txs.map((_) => ""),
|
60
|
+
// postExecutionAccountsConfigs: txs.map((_) => ""),
|
61
|
+
// skipSigVerify: true,
|
62
|
+
// },
|
63
|
+
// ],
|
61
64
|
// }
|
62
|
-
//
|
63
|
-
|
64
|
-
// return simulationResult.value.transactionResults;
|
65
|
+
// );
|
65
66
|
// }
|
66
67
|
|
67
68
|
async function umiToVersionedTransactions(
|
@@ -155,7 +156,7 @@ export async function sendJitoBundledTransactions(
|
|
155
156
|
const feeEstimates = await Promise.all(
|
156
157
|
txs.map(
|
157
158
|
async (x) =>
|
158
|
-
(await getComputeUnitPriceEstimate(umi, x, priorityFeeSetting
|
159
|
+
(await getComputeUnitPriceEstimate(umi, x, priorityFeeSetting)) ??
|
159
160
|
1000000
|
160
161
|
)
|
161
162
|
);
|
@@ -165,10 +166,9 @@ export async function sendJitoBundledTransactions(
|
|
165
166
|
signer,
|
166
167
|
txs,
|
167
168
|
feeEstimates
|
168
|
-
// Array(txs.length).fill(1_400_000)
|
169
169
|
);
|
170
|
-
|
171
|
-
// const simulationResults = await simulateJitoBundle(builtTxs);
|
170
|
+
|
171
|
+
// const simulationResults = await simulateJitoBundle(umi, builtTxs);
|
172
172
|
|
173
173
|
if (!simulateOnly) {
|
174
174
|
// let builtTxs = await umiToVersionedTransactions(
|
package/src/utils/solanaUtils.ts
CHANGED
@@ -288,27 +288,17 @@ async function simulateTransaction(
|
|
288
288
|
export async function getComputeUnitPriceEstimate(
|
289
289
|
umi: Umi,
|
290
290
|
tx: TransactionBuilder,
|
291
|
-
prioritySetting: PriorityFeeSetting
|
292
|
-
simMayFail: boolean
|
291
|
+
prioritySetting: PriorityFeeSetting
|
293
292
|
): Promise<number | undefined> {
|
294
293
|
const web3Transaction = toWeb3JsTransaction(
|
295
294
|
(await tx.setLatestBlockhash(umi, { commitment: "finalized" })).build(umi)
|
296
295
|
);
|
297
|
-
const transaction = simMayFail
|
298
|
-
? undefined
|
299
|
-
: bs58.encode(web3Transaction.serialize());
|
300
|
-
const accountKeys = simMayFail
|
301
|
-
? tx
|
302
|
-
.getInstructions()
|
303
|
-
.flatMap((x) => x.keys.flatMap((x) => x.pubkey.toString()))
|
304
|
-
: undefined;
|
305
296
|
|
306
297
|
let feeEstimate: number | undefined;
|
307
298
|
try {
|
308
299
|
const resp = await umi.rpc.call("getPriorityFeeEstimate", [
|
309
300
|
{
|
310
|
-
transaction,
|
311
|
-
accountKeys,
|
301
|
+
transaction: bs58.encode(web3Transaction.serialize()),
|
312
302
|
options: {
|
313
303
|
priorityLevel: prioritySetting.toString(),
|
314
304
|
},
|
@@ -316,7 +306,21 @@ export async function getComputeUnitPriceEstimate(
|
|
316
306
|
]);
|
317
307
|
feeEstimate = Math.round((resp as any).priorityFeeEstimate as number);
|
318
308
|
} catch (e) {
|
319
|
-
|
309
|
+
try {
|
310
|
+
const resp = await umi.rpc.call("getPriorityFeeEstimate", [
|
311
|
+
{
|
312
|
+
accountKeys: tx
|
313
|
+
.getInstructions()
|
314
|
+
.flatMap((x) => x.keys.flatMap((x) => x.pubkey.toString())),
|
315
|
+
options: {
|
316
|
+
priorityLevel: prioritySetting.toString(),
|
317
|
+
},
|
318
|
+
},
|
319
|
+
]);
|
320
|
+
feeEstimate = Math.round((resp as any).priorityFeeEstimate as number);
|
321
|
+
} catch (e) {
|
322
|
+
console.error(e);
|
323
|
+
}
|
320
324
|
}
|
321
325
|
|
322
326
|
return feeEstimate;
|
@@ -383,7 +387,11 @@ export async function sendSingleOptimizedTransaction(
|
|
383
387
|
|
384
388
|
let cuPrice: number | undefined;
|
385
389
|
if (prioritySetting !== PriorityFeeSetting.None) {
|
386
|
-
cuPrice = await getComputeUnitPriceEstimate(
|
390
|
+
cuPrice = await getComputeUnitPriceEstimate(
|
391
|
+
umi,
|
392
|
+
tx,
|
393
|
+
prioritySetting,
|
394
|
+
);
|
387
395
|
if (!cuPrice) {
|
388
396
|
cuPrice = 1000000;
|
389
397
|
}
|