@hawksightco/hawk-sdk 0.0.46 → 0.0.50

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.
@@ -46,9 +46,12 @@ export declare class General {
46
46
  /**
47
47
  * Fetches a list of pools managed by the platform, providing details about each pool.
48
48
  *
49
+ * @param params Object containing hash of the pools
49
50
  * @returns A Promise resolving to an array of pools, including metadata such as pool addresses and statistics.
50
51
  */
51
- pools(): Promise<ResponseWithStatus<_client.HawksightPool[]>>;
52
+ pools(params: {
53
+ hash?: string;
54
+ }): Promise<ResponseWithStatus<_client.HawksightPool[]>>;
52
55
  /**
53
56
  * Retrieves information about the available tokens on the platform.
54
57
  *
@@ -1 +1 @@
1
- {"version":3,"file":"General.d.ts","sourceRoot":"","sources":["../../../src/classes/General.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AACxC,OAAO,KAAK,OAAO,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAoD,gBAAgB,EAAE,MAAM,UAAU,CAAC;AACvI,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD;;;;;GAKG;AACH,qBAAa,OAAO;IAahB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,cAAc;IAZjC,4GAA4G;IAC5G,SAAS,CAAC,aAAa,EAAE,OAAO,CAAC,aAAa,CAAC;IAE/C,sGAAsG;IACtG,SAAS,CAAC,cAAc,EAAE,MAAM,CAAC;IAEjC;;;OAGG;gBAEgB,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,cAAc;IAOjD;;;;OAIG;IACH,gBAAgB,CAAC,aAAa,EAAE,OAAO,CAAC,aAAa;IAIrD;;;;OAIG;IACH,iBAAiB,CAAC,cAAc,EAAE,MAAM;IAIxC;;;;;OAKG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CAAC,aAAa;IAIrD;;;;OAIG;IACH,iBAAiB,CAAC,cAAc,EAAE,MAAM;IAIxC;;;;;OAKG;IACG,SAAS,CACb,MAAM,EAAE;QACN,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,GACA,OAAO,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,CAAC;IAQhD;;;;;OAKG;IACG,KAAK,CACT,MAAM,EAAE;QACN,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,GACA,OAAO,CAAC,kBAAkB,CAAC,OAAO,CAAC,aAAa,EAAE,CAAC,CAAC;IAQvD;;;;OAIG;IACG,MAAM,IAAI,OAAO,CAAC,kBAAkB,CAAC,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAAC;IAQxE;;;;;;;OAOG;IACG,QAAQ,CAAC,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,YAAY,GAAG,OAAO,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAC;CAU3I"}
@@ -87,11 +87,12 @@ class General {
87
87
  /**
88
88
  * Fetches a list of pools managed by the platform, providing details about each pool.
89
89
  *
90
+ * @param params Object containing hash of the pools
90
91
  * @returns A Promise resolving to an array of pools, including metadata such as pool addresses and statistics.
91
92
  */
92
- pools() {
93
+ pools(params) {
93
94
  return __awaiter(this, void 0, void 0, function* () {
94
- const result = yield this.client.generalEndpoints.poolsGet().catch(e => e.response);
95
+ const result = yield this.client.generalEndpoints.poolsGet(params.hash).catch(e => e.response);
95
96
  return {
96
97
  status: result.status,
97
98
  data: result.data,
@@ -1,4 +1,4 @@
1
- import { PriorityFeeEstimate, UtilGetPriorityFeeEstimateBody } from "@hawksightco/swagger-client";
1
+ import { PriorityFeeEstimate, UtilGetPriorityFeeEstimateBody, UtilFindAltWithTxBody } from "@hawksightco/swagger-client";
2
2
  import { ResponseWithStatus } from "../types";
3
3
  import { Client } from "./Client";
4
4
  /**
@@ -30,5 +30,16 @@ export declare class GeneralUtility {
30
30
  * @throws Captures and returns any errors encountered during the API call.
31
31
  */
32
32
  getPriorityFeeEstimate(params: UtilGetPriorityFeeEstimateBody): Promise<ResponseWithStatus<PriorityFeeEstimate>>;
33
+ /**
34
+ * Finds alternative public keys related to a given transaction and returns them along with the response status.
35
+ *
36
+ * This method sends a request to the `utilFindAltWithTxPost` endpoint with the provided parameters, and returns the response
37
+ * status and an array of public key strings. In case of an error, it captures the error response and includes the status and
38
+ * data in the returned object.
39
+ *
40
+ * @param {UtilFindAltWithTxBody} params - The parameters for the function, which include the transaction metadata.
41
+ * @returns {Promise<ResponseWithStatus<Array<string>>>>} A promise that resolves to an object containing the response status and an array of public key strings.
42
+ */
43
+ findAltWithTxPost(params: UtilFindAltWithTxBody): Promise<ResponseWithStatus<Array<string>>>;
33
44
  }
34
45
  //# sourceMappingURL=GeneralUtility.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"GeneralUtility.d.ts","sourceRoot":"","sources":["../../../src/classes/GeneralUtility.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,8BAA8B,EAAE,MAAM,6BAA6B,CAAC;AAClG,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC;;;;;;GAMG;AACH,qBAAa,cAAc;IAQvB,OAAO,CAAC,QAAQ,CAAC,MAAM;IANzB;;;;OAIG;gBAEgB,MAAM,EAAE,MAAM;IAGjC;;;;;;;;;;;;OAYG;IACG,sBAAsB,CAAC,MAAM,EAAE,8BAA8B,GAAG,OAAO,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAC;CAOvH"}
1
+ {"version":3,"file":"GeneralUtility.d.ts","sourceRoot":"","sources":["../../../src/classes/GeneralUtility.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,8BAA8B,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACzH,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC;;;;;;GAMG;AACH,qBAAa,cAAc;IAQvB,OAAO,CAAC,QAAQ,CAAC,MAAM;IANzB;;;;OAIG;gBAEgB,MAAM,EAAE,MAAM;IAGjC;;;;;;;;;;;;OAYG;IACG,sBAAsB,CAAC,MAAM,EAAE,8BAA8B,GAAG,OAAO,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAC;IAQtH;;;;;;;;;OASG;IACG,iBAAiB,CAAC,MAAM,EAAE,qBAAqB,GAAG,OAAO,CAAC,kBAAkB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;CAOnG"}
@@ -48,5 +48,24 @@ class GeneralUtility {
48
48
  };
49
49
  });
50
50
  }
51
+ /**
52
+ * Finds alternative public keys related to a given transaction and returns them along with the response status.
53
+ *
54
+ * This method sends a request to the `utilFindAltWithTxPost` endpoint with the provided parameters, and returns the response
55
+ * status and an array of public key strings. In case of an error, it captures the error response and includes the status and
56
+ * data in the returned object.
57
+ *
58
+ * @param {UtilFindAltWithTxBody} params - The parameters for the function, which include the transaction metadata.
59
+ * @returns {Promise<ResponseWithStatus<Array<string>>>>} A promise that resolves to an object containing the response status and an array of public key strings.
60
+ */
61
+ findAltWithTxPost(params) {
62
+ return __awaiter(this, void 0, void 0, function* () {
63
+ const result = yield this.client.generalUtility.utilFindAltWithTxPost(params).catch(e => e.response);
64
+ return {
65
+ status: result.status,
66
+ data: result.data,
67
+ };
68
+ });
69
+ }
51
70
  }
52
71
  exports.GeneralUtility = GeneralUtility;
@@ -3,6 +3,7 @@ import { Health } from "./Health";
3
3
  import { TxGenerator } from "./TxGenerator";
4
4
  import { Util } from "./Util";
5
5
  import { TxGeneratorAutomations } from "./TxGeneratorAutomations";
6
+ import { Client } from "./Client";
6
7
  import { GeneralUtility } from "./GeneralUtility";
7
8
  import { Search } from "./Search";
8
9
  /**
@@ -16,6 +17,8 @@ import { Search } from "./Search";
16
17
  */
17
18
  export declare class HawkAPI {
18
19
  protected readonly url: string;
20
+ /** Swagger Client Instance. */
21
+ private readonly client;
19
22
  /** Health module to check system health and API connectivity. */
20
23
  readonly health: Health;
21
24
  /** General module for basic blockchain operations like portfolio management, token information retrieval. */
@@ -25,7 +28,8 @@ export declare class HawkAPI {
25
28
  /** Util module for various utility functions that assist with blockchain interactions. */
26
29
  readonly util: Util;
27
30
  /** TxGenerator module for creating and managing transactions on the blockchain. */
28
- readonly txGenerator: TxGenerator;
31
+ private _txGenerator;
32
+ get txGenerator(): TxGenerator;
29
33
  /** TxGeneratorAutomations module for automating and optimizing transaction creation processes. */
30
34
  readonly txGeneratorAutomation: TxGeneratorAutomations;
31
35
  /** Search module (token search only for now...) */
@@ -35,5 +39,11 @@ export declare class HawkAPI {
35
39
  * @param url The base URL for the HawkSight API services, defaulted to "https://api2.hawksight.co" if not specified.
36
40
  */
37
41
  constructor(url?: string);
42
+ /**
43
+ * Override transaction generator
44
+ *
45
+ * @param txGenerator
46
+ */
47
+ overrideTxGenerator(builderFn: (client: Client, generalUtility: GeneralUtility) => TxGenerator): void;
38
48
  }
39
49
  //# sourceMappingURL=HawkAPI.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"HawkAPI.d.ts","sourceRoot":"","sources":["../../../src/classes/HawkAPI.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MA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AA6G;IAC7G,SAAgB,OAAO,EAAE,OAAO,CAAC;IAEjC,+BAA+B;IAC/B,SAAgB,cAAc,EAAE,cAAc,CAAC;IAE/C,0FAA0F;IAC1F,SAAgB,IAAI,EAAE,IAAI,CAAC;IAE3B,mFAAmF;IACnF,OAAO,CAAC,YAAY,CAAc;IAClC,IAAI,WAAW,gBAAgC;IAE/C,kGAAkG;IAClG,SAAgB,qBAAqB,EAAE,sBAAsB,CAAC;IAE9D,mDAAmD;IACnD,SAAgB,MAAM,EAAE,MAAM,CAAC;IAE/B;;;OAGG;gBAEkB,GAAG,GAAE,MAAoC;IAe9D;;;;OAIG;IACH,mBAAmB,CAAC,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,cAAc,KAAK,WAAW;CAG/F"}
@@ -19,6 +19,7 @@ const Search_1 = require("./Search");
19
19
  * making it easier to manage and use HawkSight's comprehensive blockchain features.
20
20
  */
21
21
  class HawkAPI {
22
+ get txGenerator() { return this._txGenerator; }
22
23
  /**
23
24
  * Initializes a new instance of the HawkAPI class with a specified API URL.
24
25
  * @param url The base URL for the HawkSight API services, defaulted to "https://api2.hawksight.co" if not specified.
@@ -26,15 +27,24 @@ class HawkAPI {
26
27
  constructor(url = "https://api2.hawksight.co") {
27
28
  this.url = url;
28
29
  const client = new Client_1.Client(url);
30
+ this.client = client;
29
31
  this.health = new Health_1.Health(client);
30
32
  this.generalUtility = new GeneralUtility_1.GeneralUtility(client);
31
33
  this.general = new General_1.General(client, this.generalUtility);
32
34
  this.util = new Util_1.Util(client);
33
- this.txGenerator = new TxGenerator_1.TxGenerator(client, this.generalUtility);
35
+ this._txGenerator = new TxGenerator_1.TxGenerator(client, this.generalUtility);
34
36
  this.txGeneratorAutomation = new TxGeneratorAutomations_1.TxGeneratorAutomations(client, this.generalUtility);
35
37
  this.search = new Search_1.Search(url);
36
38
  // Load search module
37
39
  this.search.load();
38
40
  }
41
+ /**
42
+ * Override transaction generator
43
+ *
44
+ * @param txGenerator
45
+ */
46
+ overrideTxGenerator(builderFn) {
47
+ this._txGenerator = builderFn(this.client, this.generalUtility);
48
+ }
39
49
  }
40
50
  exports.HawkAPI = HawkAPI;
@@ -39,15 +39,15 @@ export declare class TxGeneratorAutomations {
39
39
  */
40
40
  meteoraCompoundIxs(connection: web3.Connection, payer: string, params: _client.AutomationCompoundAutomationIxBody): Promise<ResponseWithStatus<TransactionMetadata>>;
41
41
  /**
42
- * Creates meteora auto-rebalance instruction
43
- *
44
- * NOTE: For hawksight devs only.
45
- *
46
- * @param connection The Solana web3 connection object for blockchain interactions.
47
- * @param payer The public key of the payer for transaction fees.
48
- * @param params Parameters required
49
- * @returns A ResponseWithStatus containing either TransactionMetadataResponse or TransactionMetadata.
50
- */
42
+ * Creates meteora auto-rebalance instruction
43
+ *
44
+ * NOTE: For hawksight devs only.
45
+ *
46
+ * @param connection The Solana web3 connection object for blockchain interactions.
47
+ * @param payer The public key of the payer for transaction fees.
48
+ * @param params Parameters required
49
+ * @returns A ResponseWithStatus containing either TransactionMetadataResponse or TransactionMetadata.
50
+ */
51
51
  meteoraRebalanceIxs(connection: web3.Connection, payer: string, params: _client.AutomationRebalanceAutomationIxBody): Promise<ResponseWithStatus<TransactionMetadata>>;
52
52
  }
53
53
  //# sourceMappingURL=TxGeneratorAutomations.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TxGeneratorAutomations.d.ts","sourceRoot":"","sources":["../../../src/classes/TxGeneratorAutomations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AACxC,OAAO,KAAK,OAAO,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAoD,MAAM,UAAU,CAAC;AACrH,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD;;;;;;GAMG;AACH,qBAAa,sBAAsB;IAkB/B,OA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C;;;;OAIG;gBAEgB,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,cAAc;IAMjD;;;;;;;;;OASG;IACG,kBAAkB,CAAC,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,kCAAkC,GAAG,OAAO,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAC;IAW1K;;;;;;;;;OASG;IACK,mBAAmB,CAAC,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,mCAAmC,GAAG,OAAO,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAC;CAU/K"}
@@ -74,15 +74,15 @@ class TxGeneratorAutomations {
74
74
  });
75
75
  }
76
76
  /**
77
- * Creates meteora auto-rebalance instruction
78
- *
79
- * NOTE: For hawksight devs only.
80
- *
81
- * @param connection The Solana web3 connection object for blockchain interactions.
82
- * @param payer The public key of the payer for transaction fees.
83
- * @param params Parameters required
84
- * @returns A ResponseWithStatus containing either TransactionMetadataResponse or TransactionMetadata.
85
- */
77
+ * Creates meteora auto-rebalance instruction
78
+ *
79
+ * NOTE: For hawksight devs only.
80
+ *
81
+ * @param connection The Solana web3 connection object for blockchain interactions.
82
+ * @param payer The public key of the payer for transaction fees.
83
+ * @param params Parameters required
84
+ * @returns A ResponseWithStatus containing either TransactionMetadataResponse or TransactionMetadata.
85
+ */
86
86
  meteoraRebalanceIxs(connection, payer, params) {
87
87
  return __awaiter(this, void 0, void 0, function* () {
88
88
  const result = yield this.client.meteoraDLMMAutomationInstructionsApi.meteoraDlmmAutomationRebalanceAutomationIxPost(params).catch(e => e.response);
@@ -1 +1 @@
1
- {"version":3,"file":"functions.d.ts","sourceRoot":"","sources":["../../src/functions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AACtD,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AACx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IAAI,CAAC,UAAU,EAC3B,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,2BAA2B,EACjC,aAAa,EAAE,MAAM,CAAC,aAAa,EACnC,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,mBAAmB,CAAC,CA0D9B;AAED;;;;;;;GAOG;AACH,wBAAsB,aAAa,CAAC,QAAQ,EAAE,GAAG,EAC/C,MAAM,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,QAAQ,CAAA;CAAE,EAC1C,SAAS,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,OAAO,CAAC,GAAG,CAAC,GAC1C,OAAO,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC,CAYlC;AAED;;;;;;;GAOG;AACH,wBAAsB,cAAc,CAClC,cAAc,EAAE,cAAc,EAC9B,QAAQ,EAAE,MAAM,CAAC,aAAa,EAC9B,WAAW,EAAE,2BAA2B,GACvC,OAAO,CAAC,MAAM,CAAC,CAwBjB"}
@@ -33,6 +33,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
33
33
  };
34
34
  Object.defineProperty(exports, "__esModule", { value: true });
35
35
  exports.getFeeEstimate = exports.resultOrError = exports.createTxMetadata = void 0;
36
+ const client = __importStar(require("@hawksightco/swagger-client"));
36
37
  const web3 = __importStar(require("@solana/web3.js"));
37
38
  const Transaction_1 = require("./classes/Transaction");
38
39
  /**
@@ -56,9 +57,21 @@ function createTxMetadata(generalUtility, connection, payer, data, priorityLevel
56
57
  return __awaiter(this, void 0, void 0, function* () {
57
58
  // Retrieve address lookup table accounts
58
59
  const alts = [];
60
+ // Find jup alts
61
+ const jupAlts = yield generalUtility.findAltWithTxPost({
62
+ transaction: data,
63
+ });
59
64
  for (const alt of data.addressLookupTableAddresses) {
60
65
  alts.push((yield connection.getAddressLookupTable(new web3.PublicKey(alt))).value);
61
66
  }
67
+ if (jupAlts.status === 200) {
68
+ for (const alt of jupAlts.data) {
69
+ alts.push((yield connection.getAddressLookupTable(new web3.PublicKey(alt))).value);
70
+ }
71
+ }
72
+ else {
73
+ console.error(jupAlts.data);
74
+ }
62
75
  // Get the recent blockhash
63
76
  const latestBlockhash = yield connection.getLatestBlockhash();
64
77
  // Create initial transaction instance
@@ -123,7 +136,24 @@ function getFeeEstimate(generalUtility, priority, transaction) {
123
136
  priority,
124
137
  transaction,
125
138
  });
126
- return (yield resultOrError(response, (result) => __awaiter(this, void 0, void 0, function* () { return result.priorityFeeEstimate; }))).data;
139
+ return (yield resultOrError(response, (result) => __awaiter(this, void 0, void 0, function* () {
140
+ let priorityFee;
141
+ if (priority === client.PriorityLevel.Default || priority === client.PriorityLevel.Medium) {
142
+ priorityFee = result.feeLevels._default;
143
+ }
144
+ else if (priority === client.PriorityLevel.High) {
145
+ priorityFee = result.feeLevels.high;
146
+ }
147
+ else if (priority === client.PriorityLevel.VeryHigh) {
148
+ priorityFee = result.feeLevels.high;
149
+ }
150
+ else {
151
+ const max = result.feeLevels._default;
152
+ const min = result.feeLevels.low;
153
+ priorityFee = min + ((max - min) / 2);
154
+ }
155
+ return result.priorityFeeEstimate;
156
+ }))).data;
127
157
  });
128
158
  }
129
159
  exports.getFeeEstimate = getFeeEstimate;
@@ -1,3 +1,4 @@
1
1
  export * from "./types";
2
2
  export { HawkAPI } from "./classes/HawkAPI";
3
+ export { TxGenerator } from "./classes/TxGenerator";
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC"}
package/dist/src/index.js CHANGED
@@ -14,7 +14,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.HawkAPI = void 0;
17
+ exports.TxGenerator = exports.HawkAPI = void 0;
18
18
  __exportStar(require("./types"), exports);
19
19
  var HawkAPI_1 = require("./classes/HawkAPI");
20
20
  Object.defineProperty(exports, "HawkAPI", { enumerable: true, get: function () { return HawkAPI_1.HawkAPI; } });
21
+ var TxGenerator_1 = require("./classes/TxGenerator");
22
+ Object.defineProperty(exports, "TxGenerator", { enumerable: true, get: function () { return TxGenerator_1.TxGenerator; } });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hawksightco/hawk-sdk",
3
- "version": "0.0.46",
3
+ "version": "0.0.50",
4
4
  "description": "Hawksight v2 SDK",
5
5
  "main": "dist/src/index.js",
6
6
  "repository": "https://github.com/ghabxph/hawk-api-client.git",
@@ -20,7 +20,7 @@
20
20
  "typescript": "^5.4.5"
21
21
  },
22
22
  "dependencies": {
23
- "@hawksightco/swagger-client": "0.0.18",
23
+ "@hawksightco/swagger-client": "0.0.22",
24
24
  "@solana/web3.js": "^1.89.1",
25
25
  "bn.js": "^5.2.1"
26
26
  },