@haven-fi/solauto-sdk 1.0.237 → 1.0.238

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,6 +3,9 @@ import { SolautoClient } from "../clients/solautoClient";
3
3
  import { ErrorsToThrow } from "../utils/generalUtils";
4
4
  import { PriorityFeeSetting, TransactionItemInputs, TransactionRunType } from "../types";
5
5
  import { ReferralStateManager } from "../clients";
6
+ export declare class TransactionTooLargeError extends Error {
7
+ constructor(message: string);
8
+ }
6
9
  export declare class TransactionItem {
7
10
  fetchTx: (attemptNum: number) => Promise<TransactionItemInputs | undefined>;
8
11
  name?: string | undefined;
@@ -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;AAKzD,OAAO,EACL,aAAa,EAEd,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,oBAAoB,EAAa,MAAM,YAAY,CAAC;AAsC7D,qBAAa,eAAe;IAKjB,OAAO,EAAE,CACd,UAAU,EAAE,MAAM,KACf,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC;IACxC,IAAI,CAAC,EAAE,MAAM;IAPtB,oBAAoB,EAAG,MAAM,EAAE,CAAC;IAChC,EAAE,CAAC,EAAE,kBAAkB,CAAC;gBAGf,OAAO,EAAE,CACd,UAAU,EAAE,MAAM,KACf,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC,EACxC,IAAI,CAAC,EAAE,MAAM,YAAA;IAGhB,UAAU;IAIV,OAAO,CAAC,UAAU,EAAE,MAAM;IAMhC,cAAc,IAAI,MAAM,EAAE;CAY3B;AAgFD,oBAAY,iBAAiB;IAC3B,OAAO,YAAY;IACnB,UAAU,eAAe;IACzB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AC,SAAS;IACjB,OAAO,CAAC,cAAc,CAAC;IACvB,OAAO,CAAC,MAAM,CAAC;IACf,OAAO,CAAC,YAAY,CAAC;IACrB,OAAO,CAAC,aAAa,CAAC;IACtB,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,UAAU;IAVpB,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,YAAY,CAAC,EAAE,OAAO,YAAA,EACtB,aAAa,CAAC,EAAE,aAAa,YAAA,EAC7B,OAAO,GAAE,MAAU,EACnB,UAAU,GAAE,MAAY;YAQpB,uBAAuB;IAwCrC,OAAO,CAAC,YAAY;YA8CN,aAAa;IAoBd,UAAU,CACrB,YAAY,EAAE,eAAe,EAAE,EAC/B,eAAe,CAAC,EAAE,kBAAkB,GACnC,OAAO,CAAC,0BAA0B,CAAC;IAyEzB,IAAI,CACf,KAAK,EAAE,eAAe,EAAE,EACxB,eAAe,CAAC,EAAE,kBAAkB,EACpC,WAAW,CAAC,EAAE,OAAO,GACpB,OAAO,CAAC,0BAA0B,CAAC;YAwGxB,eAAe;CAkD9B"}
@@ -3,13 +3,21 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.TransactionsManager = exports.TransactionStatus = exports.TransactionItem = void 0;
6
+ exports.TransactionsManager = exports.TransactionStatus = exports.TransactionItem = exports.TransactionTooLargeError = void 0;
7
7
  const bs58_1 = __importDefault(require("bs58"));
8
8
  const umi_1 = require("@metaplex-foundation/umi");
9
9
  const solanaUtils_1 = require("../utils/solanaUtils");
10
10
  const generalUtils_1 = require("../utils/generalUtils");
11
11
  const transactionUtils_1 = require("./transactionUtils");
12
12
  // import { sendJitoBundledTransactions } from "../utils/jitoUtils";
13
+ class TransactionTooLargeError extends Error {
14
+ constructor(message) {
15
+ super(message);
16
+ this.name = 'TransactionTooLargeError';
17
+ Object.setPrototypeOf(this, TransactionTooLargeError.prototype);
18
+ }
19
+ }
20
+ exports.TransactionTooLargeError = TransactionTooLargeError;
13
21
  class LookupTables {
14
22
  constructor(defaultLuts, umi) {
15
23
  this.defaultLuts = defaultLuts;
@@ -141,7 +149,7 @@ class TransactionsManager {
141
149
  }
142
150
  const transaction = item.tx.setAddressLookupTables(await this.lookupTables.getLutInputs(item.lookupTableAddresses));
143
151
  if (!transaction.fitsInOneTransaction(this.txHandler.umi)) {
144
- throw new Error(`Transaction exceeds max transaction size (${transaction.getTransactionSize(this.txHandler.umi)})`);
152
+ throw new TransactionTooLargeError(`Exceeds max transaction size (${transaction.getTransactionSize(this.txHandler.umi)})`);
145
153
  }
146
154
  else {
147
155
  let newSet = new TransactionSet(this.txHandler, this.lookupTables, [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haven-fi/solauto-sdk",
3
- "version": "1.0.237",
3
+ "version": "1.0.238",
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",
@@ -23,6 +23,14 @@ import {
23
23
  import { ReferralStateManager, TxHandler } from "../clients";
24
24
  // import { sendJitoBundledTransactions } from "../utils/jitoUtils";
25
25
 
26
+ export class TransactionTooLargeError extends Error {
27
+ constructor(message: string) {
28
+ super(message);
29
+ this.name = 'TransactionTooLargeError';
30
+ Object.setPrototypeOf(this, TransactionTooLargeError.prototype);
31
+ }
32
+ }
33
+
26
34
  class LookupTables {
27
35
  cache: AddressLookupTableInput[] = [];
28
36
 
@@ -225,8 +233,8 @@ export class TransactionsManager {
225
233
  await this.lookupTables.getLutInputs(item.lookupTableAddresses)
226
234
  );
227
235
  if (!transaction.fitsInOneTransaction(this.txHandler.umi)) {
228
- throw new Error(
229
- `Transaction exceeds max transaction size (${transaction.getTransactionSize(this.txHandler.umi)})`
236
+ throw new TransactionTooLargeError(
237
+ `Exceeds max transaction size (${transaction.getTransactionSize(this.txHandler.umi)})`
230
238
  );
231
239
  } else {
232
240
  let newSet = new TransactionSet(this.txHandler, this.lookupTables, [