@haven-fi/solauto-sdk 1.0.21 → 1.0.22

Sign up to get free protection for your applications and to get access to all the features.
@@ -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;AAMlC,OAAO,EAGL,UAAU,EACV,SAAS,EAIT,sBAAsB,EAEvB,MAAM,iBAAiB,CAAC;AAazB,wBAAsB,wBAAwB,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC,CAQxE;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,CAC/C,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,SAAS,EACjB,IAAI,EAAE,SAAS,GACd,kBAAkB,CAUpB;AAED,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,SAAS,EACtB,QAAQ,EAAE,MAAM,GACf,kBAAkB,CASpB;AAED,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,SAAS,EACvB,SAAS,EAAE,SAAS,GACnB,kBAAkB,CAKpB;AAED,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,SAAS,EACjB,IAAI,EAAE,SAAS,EACf,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,MAAM,GACb,kBAAkB,CAKpB;AAED,wBAAsB,qBAAqB,CACzC,GAAG,E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M,EAAE,MAAM,EACd,MAAM,EAAE,SAAS,EACjB,IAAI,EAAE,SAAS,GACd,kBAAkB,CAUpB;AAED,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,SAAS,EACtB,QAAQ,EAAE,MAAM,GACf,kBAAkB,CASpB;AAED,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,SAAS,EACvB,SAAS,EAAE,SAAS,GACnB,kBAAkB,CAKpB;AAED,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,SAAS,EACjB,IAAI,EAAE,SAAS,EACf,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,MAAM,GACb,kBAAkB,CAKpB;AAED,wBAAsB,qBAAqB,CACzC,GAAG,EAAE,GAAG,EACR,oBAAoB,EAAE,MAAM,EAAE,GAC7B,OAAO,CAAC,uBAAuB,EAAE,CAAC,CAkBpC;AAED,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,MAAM,EACd,EAAE,EAAE,kBAAkB,EACtB,gBAAgB,EAAE,MAAM,EACxB,gBAAgB,CAAC,EAAE,MAAM,sBA4D1B;AAkBD,wBAAsB,2BAA2B,CAC/C,GAAG,EAAE,GAAG,EACR,EAAE,EAAE,kBAAkB,EACtB,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,MAAM,CAAC,CAgBjB;AAED,wBAAsB,8BAA8B,CAClD,GAAG,EAAE,GAAG,EACR,UAAU,EAAE,UAAU,EACtB,EAAE,EAAE,kBAAkB,EACtB,YAAY,CAAC,EAAE,OAAO,EACtB,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC,CAmDjC"}
@@ -136,7 +136,9 @@ async function getComputeUnitPriceEstimate(umi, tx, attemptNum) {
136
136
  const resp = await umi.rpc.call("getPriorityFeeEstimate", [
137
137
  {
138
138
  transaction: serializedTransaction,
139
- options: { priorityLevel: attemptNum && attemptNum > 0 ? "VeryHigh" : "High" },
139
+ options: {
140
+ priorityLevel: attemptNum && attemptNum > 0 ? "VeryHigh" : "High",
141
+ },
140
142
  },
141
143
  ]);
142
144
  const feeEstimate = Math.round(resp.priorityFeeEstimate);
@@ -153,13 +155,13 @@ async function sendSingleOptimizedTransaction(umi, connection, tx, simulateOnly,
153
155
  const computeUnitLimit = Math.round(simulationResult.value.unitsConsumed * 1.1);
154
156
  console.log("Compute unit limit: ", computeUnitLimit);
155
157
  if (!simulateOnly) {
156
- const result = await (0, generalUtils_1.retryWithExponentialBackoff)(async () => await assembleFinalTransaction(umi.identity, tx, feeEstimate, computeUnitLimit).sendAndConfirm(umi, {
158
+ const result = await assembleFinalTransaction(umi.identity, tx, feeEstimate, computeUnitLimit).sendAndConfirm(umi, {
157
159
  send: {
158
160
  skipPreflight: true,
159
161
  commitment: "finalized",
160
162
  },
161
163
  confirm: { commitment: "finalized" },
162
- }));
164
+ });
163
165
  console.log(`https://solscan.io/tx/${bs58_1.default.encode(result.signature)}`);
164
166
  if (result.result.value.err !== null) {
165
167
  throw new Error(result.result.value.err.toString());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haven-fi/solauto-sdk",
3
- "version": "1.0.21",
3
+ "version": "1.0.22",
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",
@@ -253,7 +253,9 @@ export async function getComputeUnitPriceEstimate(
253
253
  const resp = await umi.rpc.call("getPriorityFeeEstimate", [
254
254
  {
255
255
  transaction: serializedTransaction,
256
- options: { priorityLevel: attemptNum && attemptNum > 0 ? "VeryHigh" : "High" },
256
+ options: {
257
+ priorityLevel: attemptNum && attemptNum > 0 ? "VeryHigh" : "High",
258
+ },
257
259
  },
258
260
  ]);
259
261
  const feeEstimate = Math.round((resp as any).priorityFeeEstimate as number);
@@ -298,21 +300,18 @@ export async function sendSingleOptimizedTransaction(
298
300
  console.log("Compute unit limit: ", computeUnitLimit);
299
301
 
300
302
  if (!simulateOnly) {
301
- const result = await retryWithExponentialBackoff(
302
- async () =>
303
- await assembleFinalTransaction(
304
- umi.identity,
305
- tx,
306
- feeEstimate,
307
- computeUnitLimit
308
- ).sendAndConfirm(umi, {
309
- send: {
310
- skipPreflight: true,
311
- commitment: "finalized",
312
- },
313
- confirm: { commitment: "finalized" },
314
- })
315
- );
303
+ const result = await assembleFinalTransaction(
304
+ umi.identity,
305
+ tx,
306
+ feeEstimate,
307
+ computeUnitLimit
308
+ ).sendAndConfirm(umi, {
309
+ send: {
310
+ skipPreflight: true,
311
+ commitment: "finalized",
312
+ },
313
+ confirm: { commitment: "finalized" },
314
+ });
316
315
  console.log(`https://solscan.io/tx/${bs58.encode(result.signature)}`);
317
316
  if (result.result.value.err !== null) {
318
317
  throw new Error(result.result.value.err.toString());