@hawksightco/hawk-sdk 0.0.9 → 0.0.10

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.
Files changed (34) hide show
  1. package/package.json +1 -1
  2. package/dist/src/classes/Client.d.ts +0 -33
  3. package/dist/src/classes/Client.d.ts.map +0 -1
  4. package/dist/src/classes/Client.js +0 -55
  5. package/dist/src/classes/General.d.ts +0 -66
  6. package/dist/src/classes/General.d.ts.map +0 -1
  7. package/dist/src/classes/General.js +0 -108
  8. package/dist/src/classes/HawkAPI.d.ts +0 -33
  9. package/dist/src/classes/HawkAPI.d.ts.map +0 -1
  10. package/dist/src/classes/HawkAPI.js +0 -34
  11. package/dist/src/classes/Health.d.ts +0 -29
  12. package/dist/src/classes/Health.d.ts.map +0 -1
  13. package/dist/src/classes/Health.js +0 -48
  14. package/dist/src/classes/Transaction.d.ts +0 -84
  15. package/dist/src/classes/Transaction.d.ts.map +0 -1
  16. package/dist/src/classes/Transaction.js +0 -230
  17. package/dist/src/classes/TxGenerator.d.ts +0 -129
  18. package/dist/src/classes/TxGenerator.d.ts.map +0 -1
  19. package/dist/src/classes/TxGenerator.js +0 -217
  20. package/dist/src/classes/TxGeneratorAutomations.d.ts +0 -68
  21. package/dist/src/classes/TxGeneratorAutomations.d.ts.map +0 -1
  22. package/dist/src/classes/TxGeneratorAutomations.js +0 -96
  23. package/dist/src/classes/Util.d.ts +0 -65
  24. package/dist/src/classes/Util.d.ts.map +0 -1
  25. package/dist/src/classes/Util.js +0 -115
  26. package/dist/src/functions.d.ts +0 -34
  27. package/dist/src/functions.d.ts.map +0 -1
  28. package/dist/src/functions.js +0 -159
  29. package/dist/src/index.d.ts +0 -3
  30. package/dist/src/index.d.ts.map +0 -1
  31. package/dist/src/index.js +0 -4
  32. package/dist/src/types.d.ts +0 -261
  33. package/dist/src/types.d.ts.map +0 -1
  34. package/dist/src/types.js +0 -17
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hawksightco/hawk-sdk",
3
- "version": "0.0.9",
3
+ "version": "0.0.10",
4
4
  "description": "Hawksight v2 SDK",
5
5
  "main": "dist/src/index.js",
6
6
  "repository": "https://github.com/ghabxph/hawk-api-client.git",
@@ -1,33 +0,0 @@
1
- import * as client from "@hawksightco/swagger-client";
2
- /**
3
- * The Client class serves as the central configuration point for all HawkSight API interactions.
4
- * It encapsulates the setup of the API's configuration and initializes various sub-APIs to manage different
5
- * aspects of the HawkSight services. These sub-APIs include health checks, general endpoints, and specific
6
- * functionalities for different decentralized market making solutions like Meteora and Orca.
7
- */
8
- export declare class Client {
9
- readonly url: string;
10
- /** Configuration object for the HawkSight API, setting the base path and other necessary settings. */
11
- readonly config: client.Configuration;
12
- /** API accessor for health check operations to monitor the availability and status of the HawkSight API. */
13
- readonly healthCheck: client.HealthCheckApi;
14
- /** API accessor for general endpoints, which include various utility functions that are broadly applicable. */
15
- readonly generalEndpoints: client.GeneralEndpointsApi;
16
- /** API accessor for utility functions specifically tailored for Meteora Decentralized Liquidity Market Maker (DLMM) operations. */
17
- readonly meteoraDLMMUtilityFunctionsApi: client.MeteoraDLMMUtilityFunctionsApi;
18
- /** API accessor for instructional functions related to Meteora DLMM, handling specific transaction instructions. */
19
- readonly meteoraDLMMInstructionsApi: client.MeteoraDLMMInstructionsApi;
20
- /** API accessor for automation instructions within Meteora DLMM, supporting automated transaction processes. */
21
- readonly meteoraDLMMAutomationInstructionsApi: client.MeteoraDLMMAutomationInstructionsApi;
22
- /** API accessor for utility functions tailored for Orca's Concentrated Liquidity Market Maker (CLMM) operations. */
23
- readonly orcaUtilityFunctionsApi: client.OrcaUtilityFunctionsApi;
24
- /** API accessor for instructional functions related to Orca CLMM, managing specific trading and liquidity strategies. */
25
- readonly orcaCLMMInstructionsApi: client.OrcaCLMMInstructionsApi;
26
- /**
27
- * Constructs a new Client object with a specified API URL.
28
- * @param url The base URL for the HawkSight API, defaulting to "https://api2.hawksight.co" if not specified.
29
- * This URL is used to configure the path for all API calls made through this client.
30
- */
31
- constructor(url?: string);
32
- }
33
- //# sourceMappingURL=Client.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Client.d.ts","sourceRoot":"","sources":["../../../src/classes/Client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AAEtD;;;;;GAKG;AACH,qBAAa,MAAM;aA+BC,GAAG,EAAE,MAAM;IA9B7B,sGAAsG;IACtG,SAAgB,MAAM,EAAE,MAAM,CAAC,aAAa,CAAC;IAE7C,4GAA4G;IAC5G,SAAgB,WAAW,EAAE,MAAM,CAAC,cAAc,CAAC;IAEnD,+GAA+G;IAC/G,SAAgB,gBAAgB,EAAE,MAAM,CAAC,mBAAmB,CAAC;IAE7D,mIAAmI;IACnI,SAAgB,8BAA8B,EAAE,MAAM,CAAC,8BAA8B,CAAC;IAEtF,oHAAoH;IACpH,SAAgB,0BAA0B,EAAE,MAAM,CAAC,0BAA0B,CAAC;IAE9E,gHAAgH;IAChH,SAAgB,oCAAoC,EAAE,MAAM,CAAC,oCAAoC,CAAC;IAElG,oHAAoH;IACpH,SAAgB,uBAAuB,EAAE,MAAM,CAAC,uBAAuB,CAAC;IAExE,yHAAyH;IACzH,SAAgB,uBAAuB,EAAE,MAAM,CAAC,uBAAuB,CAAC;IAExE;;;;OAIG;gBAEe,GAAG,GAAE,MAAoC;CAc5D"}
@@ -1,55 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.Client = void 0;
27
- const client = __importStar(require("@hawksightco/swagger-client"));
28
- /**
29
- * The Client class serves as the central configuration point for all HawkSight API interactions.
30
- * It encapsulates the setup of the API's configuration and initializes various sub-APIs to manage different
31
- * aspects of the HawkSight services. These sub-APIs include health checks, general endpoints, and specific
32
- * functionalities for different decentralized market making solutions like Meteora and Orca.
33
- */
34
- class Client {
35
- /**
36
- * Constructs a new Client object with a specified API URL.
37
- * @param url The base URL for the HawkSight API, defaulting to "https://api2.hawksight.co" if not specified.
38
- * This URL is used to configure the path for all API calls made through this client.
39
- */
40
- constructor(url = "https://api2.hawksight.co") {
41
- this.url = url;
42
- this.config = new client.Configuration({
43
- basePath: url
44
- });
45
- // Initialization of all API accessors with the configured base path.
46
- this.healthCheck = new client.HealthCheckApi(this.config);
47
- this.generalEndpoints = new client.GeneralEndpointsApi(this.config);
48
- this.meteoraDLMMUtilityFunctionsApi = new client.MeteoraDLMMUtilityFunctionsApi(this.config);
49
- this.meteoraDLMMInstructionsApi = new client.MeteoraDLMMInstructionsApi(this.config);
50
- this.meteoraDLMMAutomationInstructionsApi = new client.MeteoraDLMMAutomationInstructionsApi(this.config);
51
- this.orcaUtilityFunctionsApi = new client.OrcaUtilityFunctionsApi(this.config);
52
- this.orcaCLMMInstructionsApi = new client.OrcaCLMMInstructionsApi(this.config);
53
- }
54
- }
55
- exports.Client = Client;
@@ -1,66 +0,0 @@
1
- import * as web3 from "@solana/web3.js";
2
- import * as client from "@hawksightco/swagger-client";
3
- import { ResponseWithStatus, TransactionMetadata, TransactionMetadataResponse, TransactionPriority, UserPortfolioOut } from "../types";
4
- import { Client } from "./Client";
5
- /**
6
- * Provides general utility functions for managing and querying blockchain-related data,
7
- * handling transactions, and interfacing with a specific blockchain network via the client API.
8
- * This class serves as an abstraction layer to interact with various blockchain operations
9
- * such as registering new entities, retrieving portfolio information, and more.
10
- */
11
- export declare class General {
12
- private readonly client;
13
- /** The priority level for transactions, influencing transaction fee calculation and processing priority. */
14
- protected priorityLevel: TransactionPriority;
15
- /** The maximum priority fee to be included in transaction fee calculations, specified in lamports. */
16
- protected maxPriorityFee: number;
17
- /**
18
- * Constructs a new instance of the General class.
19
- * @param client The Client object providing network access and API functionality.
20
- */
21
- constructor(client: Client);
22
- /**
23
- * Sets the transaction priority level, which may affect the processing speed and fees.
24
- *
25
- * @param priorityLevel The desired priority level for upcoming transactions.
26
- */
27
- setPriorityLevel(priorityLevel: TransactionPriority): void;
28
- /**
29
- * Sets the maximum priority fee for transactions, which is the additional fee to speed up transaction processing.
30
- *
31
- * @param maxPriorityFee The fee in lamports.
32
- */
33
- setMaxPriorityFee(maxPriorityFee: number): void;
34
- /**
35
- * Retrieves the portfolio information for a specified wallet and optionally a pool.
36
- *
37
- * @param params Object containing wallet address and optional pool identifier.
38
- * @returns A Promise resolving to the portfolio information including assets and balances.
39
- */
40
- portfolio(params: {
41
- wallet: string;
42
- pool?: string;
43
- }): Promise<ResponseWithStatus<UserPortfolioOut>>;
44
- /**
45
- * Fetches a list of pools managed by the platform, providing details about each pool.
46
- *
47
- * @returns A Promise resolving to an array of pools, including metadata such as pool addresses and statistics.
48
- */
49
- pools(): Promise<ResponseWithStatus<client.InlineResponse2002[]>>;
50
- /**
51
- * Retrieves information about the available tokens on the platform.
52
- *
53
- * @returns A Promise resolving to an array of token details, including names, symbols, and other token-specific information.
54
- */
55
- tokens(): Promise<ResponseWithStatus<client.InlineResponse2003[]>>;
56
- /**
57
- * Registers a new entity or user with the necessary parameters, handling transaction creation and response.
58
- *
59
- * @param connection A Solana web3 connection for interacting with the blockchain.
60
- * @param payer The public key of the payer, responsible for transaction fees.
61
- * @param params Registration parameters required by the API.
62
- * @returns A Promise resolving to the transaction metadata or an error response, depending on the outcome of the registration.
63
- */
64
- register(connection: web3.Connection, payer: string, params: client.RegisterBody): Promise<ResponseWithStatus<TransactionMetadataResponse> | ResponseWithStatus<TransactionMetadata>>;
65
- }
66
- //# sourceMappingURL=General.d.ts.map
@@ -1 +0,0 @@
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,MAAM,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,2BAA2B,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AACvI,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGlC;;;;;GAKG;AACH,qBAAa,OAAO;IAahB,OAAO,CAAC,QAAQ,CAAC,MAAM;IAXzB,4GAA4G;IAC5G,SAAS,CAAC,aAAa,EAAE,mBAAmB,CAAC;IAE7C,sGAAsG;IACtG,SAAS,CAAC,cAAc,EAAE,MAAM,CAAC;IAEjC;;;OAGG;gBAEgB,MAAM,EAAE,MAAM;IAOjC;;;;OAIG;IACH,gBAAgB,CAAC,aAAa,EAAE,mBAAmB;IAInD;;;;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;;;;OAIG;IACG,KAAK,IAAI,OAAO,CAAC,kBAAkB,CAAC,MAAM,CAAC,kBAAkB,EAAE,CAAC,CAAC;IAQvE;;;;OAIG;IACG,MAAM,IAAI,OAAO,CAAC,kBAAkB,CAAC,MAAM,CAAC,kBAAkB,EAAE,CAAC,CAAC;IAQxE;;;;;;;OAOG;IACG,QAAQ,CAAC,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,YAAY,GAAG,OAAO,CAAC,kBAAkB,CAAC,2BAA2B,CAAC,GAAG,kBAAkB,CAAC,mBAAmB,CAAC,CAAC;CAU5L"}
@@ -1,108 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.General = void 0;
13
- const functions_1 = require("../functions");
14
- /**
15
- * Provides general utility functions for managing and querying blockchain-related data,
16
- * handling transactions, and interfacing with a specific blockchain network via the client API.
17
- * This class serves as an abstraction layer to interact with various blockchain operations
18
- * such as registering new entities, retrieving portfolio information, and more.
19
- */
20
- class General {
21
- /**
22
- * Constructs a new instance of the General class.
23
- * @param client The Client object providing network access and API functionality.
24
- */
25
- constructor(client) {
26
- this.client = client;
27
- // Initialize with default values for transaction priority and fees.
28
- this.priorityLevel = "Default";
29
- this.maxPriorityFee = 500000;
30
- }
31
- /**
32
- * Sets the transaction priority level, which may affect the processing speed and fees.
33
- *
34
- * @param priorityLevel The desired priority level for upcoming transactions.
35
- */
36
- setPriorityLevel(priorityLevel) {
37
- this.priorityLevel = priorityLevel;
38
- }
39
- /**
40
- * Sets the maximum priority fee for transactions, which is the additional fee to speed up transaction processing.
41
- *
42
- * @param maxPriorityFee The fee in lamports.
43
- */
44
- setMaxPriorityFee(maxPriorityFee) {
45
- this.maxPriorityFee = maxPriorityFee;
46
- }
47
- /**
48
- * Retrieves the portfolio information for a specified wallet and optionally a pool.
49
- *
50
- * @param params Object containing wallet address and optional pool identifier.
51
- * @returns A Promise resolving to the portfolio information including assets and balances.
52
- */
53
- portfolio(params) {
54
- return __awaiter(this, void 0, void 0, function* () {
55
- const result = yield this.client.generalEndpoints.portfolioGet(params.wallet, params.pool).catch(e => e.response);
56
- return {
57
- status: result.status,
58
- data: result.data,
59
- };
60
- });
61
- }
62
- /**
63
- * Fetches a list of pools managed by the platform, providing details about each pool.
64
- *
65
- * @returns A Promise resolving to an array of pools, including metadata such as pool addresses and statistics.
66
- */
67
- pools() {
68
- return __awaiter(this, void 0, void 0, function* () {
69
- const result = yield this.client.generalEndpoints.poolsGet().catch(e => e.response);
70
- return {
71
- status: result.status,
72
- data: result.data,
73
- };
74
- });
75
- }
76
- /**
77
- * Retrieves information about the available tokens on the platform.
78
- *
79
- * @returns A Promise resolving to an array of token details, including names, symbols, and other token-specific information.
80
- */
81
- tokens() {
82
- return __awaiter(this, void 0, void 0, function* () {
83
- const result = yield this.client.generalEndpoints.tokensGet().catch(e => e.response);
84
- return {
85
- status: result.status,
86
- data: result.data,
87
- };
88
- });
89
- }
90
- /**
91
- * Registers a new entity or user with the necessary parameters, handling transaction creation and response.
92
- *
93
- * @param connection A Solana web3 connection for interacting with the blockchain.
94
- * @param payer The public key of the payer, responsible for transaction fees.
95
- * @param params Registration parameters required by the API.
96
- * @returns A Promise resolving to the transaction metadata or an error response, depending on the outcome of the registration.
97
- */
98
- register(connection, payer, params) {
99
- return __awaiter(this, void 0, void 0, function* () {
100
- const result = yield this.client.generalEndpoints.registerPost(params).catch(e => e.response);
101
- return (0, functions_1.resultOrError)({
102
- status: result.status,
103
- data: result.data,
104
- }, (data) => __awaiter(this, void 0, void 0, function* () { return yield (0, functions_1.createTxMetadata)(connection, payer, data, this.priorityLevel, this.maxPriorityFee); }));
105
- });
106
- }
107
- }
108
- exports.General = General;
@@ -1,33 +0,0 @@
1
- import { General } from "./General";
2
- import { Health } from "./Health";
3
- import { TxGenerator } from "./TxGenerator";
4
- import { Util } from "./Util";
5
- import { TxGeneratorAutomations } from "./TxGeneratorAutomations";
6
- /**
7
- * HawkAPI is a central gateway class that aggregates access to various functional modules
8
- * for interacting with HawkSight's blockchain APIs. This class initializes and exposes modules
9
- * that manage different aspects of the blockchain interactions such as general utilities,
10
- * transaction generation, health checks, and automation services.
11
- *
12
- * Each module connected through this class offers specialized APIs for different tasks,
13
- * making it easier to manage and use HawkSight's comprehensive blockchain features.
14
- */
15
- export declare class HawkAPI {
16
- protected readonly url: string;
17
- /** Health module to check system health and API connectivity. */
18
- readonly health: Health;
19
- /** General module for basic blockchain operations like portfolio management, token information retrieval. */
20
- readonly general: General;
21
- /** Util module for various utility functions that assist with blockchain interactions. */
22
- readonly util: Util;
23
- /** TxGenerator module for creating and managing transactions on the blockchain. */
24
- readonly txGenerator: TxGenerator;
25
- /** TxGeneratorAutomations module for automating and optimizing transaction creation processes. */
26
- readonly txGeneratorAutomation: TxGeneratorAutomations;
27
- /**
28
- * Initializes a new instance of the HawkAPI class with a specified API URL.
29
- * @param url The base URL for the HawkSight API services, defaulted to "https://api2.hawksight.co" if not specified.
30
- */
31
- constructor(url?: string);
32
- }
33
- //# sourceMappingURL=HawkAPI.d.ts.map
@@ -1 +0,0 @@
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;AAGlE;;;;;;;;GAQG;AACH,qBAAa,OAAO;IAqBhB,SAAS,CAAC,QAAQ,CAAC,GAAG,EAAE,MAAM;IApBhC,iEAAiE;IACjE,SAAgB,MAAM,EAAE,MAAM,CAAC;IAE/B,6GAA6G;IAC7G,SAAgB,OAAO,EAAE,OAAO,CAAC;IAEjC,0FAA0F;IAC1F,SAAgB,IAAI,EAAE,IAAI,CAAC;IAE3B,mFAAmF;IACnF,SAAgB,WAAW,EAAE,WAAW,CAAC;IAEzC,kGAAkG;IAClG,SAAgB,qBAAqB,EAAE,sBAAsB,CAAC;IAE9D;;;OAGG;gBAEkB,GAAG,GAAE,MAAoC;CAS/D"}
@@ -1,34 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.HawkAPI = void 0;
4
- const General_1 = require("./General");
5
- const Health_1 = require("./Health");
6
- const TxGenerator_1 = require("./TxGenerator");
7
- const Util_1 = require("./Util");
8
- const TxGeneratorAutomations_1 = require("./TxGeneratorAutomations");
9
- const Client_1 = require("./Client");
10
- /**
11
- * HawkAPI is a central gateway class that aggregates access to various functional modules
12
- * for interacting with HawkSight's blockchain APIs. This class initializes and exposes modules
13
- * that manage different aspects of the blockchain interactions such as general utilities,
14
- * transaction generation, health checks, and automation services.
15
- *
16
- * Each module connected through this class offers specialized APIs for different tasks,
17
- * making it easier to manage and use HawkSight's comprehensive blockchain features.
18
- */
19
- class HawkAPI {
20
- /**
21
- * Initializes a new instance of the HawkAPI class with a specified API URL.
22
- * @param url The base URL for the HawkSight API services, defaulted to "https://api2.hawksight.co" if not specified.
23
- */
24
- constructor(url = "https://api2.hawksight.co") {
25
- this.url = url;
26
- const client = new Client_1.Client(url);
27
- this.health = new Health_1.Health(client);
28
- this.general = new General_1.General(client);
29
- this.util = new Util_1.Util(client);
30
- this.txGenerator = new TxGenerator_1.TxGenerator(client);
31
- this.txGeneratorAutomation = new TxGeneratorAutomations_1.TxGeneratorAutomations(client);
32
- }
33
- }
34
- exports.HawkAPI = HawkAPI;
@@ -1,29 +0,0 @@
1
- import { HealthResponse, ResponseWithStatus } from "../types";
2
- import { Client } from "./Client";
3
- /**
4
- * Provides health checking functionality for HawkSight's API services.
5
- * This class allows for simple verification of system health, ensuring that the underlying API and its services
6
- * are operational and accessible. It utilizes a dedicated `Client` instance to perform the health check operations.
7
- */
8
- export declare class Health {
9
- private readonly client;
10
- /**
11
- * Constructs a Health instance with a specified client.
12
- * @param client A Client object configured to interact with the HawkSight API. This client handles
13
- * the actual API calls to perform health checks.
14
- */
15
- constructor(client: Client);
16
- /**
17
- * Performs a health check on the HawkSight API.
18
- * This method queries the API's health check endpoint to determine the operational status of the system.
19
- * It is useful for monitoring and alert systems to ensure that API services are up and running smoothly.
20
- *
21
- * @returns A Promise that resolves to a `ResponseWithStatus<HealthResponse>` object containing:
22
- * - `status`: The HTTP status code of the health check request.
23
- * - `data`: The detailed health check response from the API, typically indicating various service statuses.
24
- *
25
- * Example of a health check response might include database connectivity status, API uptime, or other relevant system metrics.
26
- */
27
- health(): Promise<ResponseWithStatus<HealthResponse>>;
28
- }
29
- //# sourceMappingURL=Health.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Health.d.ts","sourceRoot":"","sources":["../../../src/classes/Health.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC;;;;GAIG;AACH,qBAAa,MAAM;IAOf,OAAO,CAAC,QAAQ,CAAC,MAAM;IANzB;;;;OAIG;gBAEgB,MAAM,EAAE,MAAM;IAGjC;;;;;;;;;;OAUG;IACG,MAAM,IAAI,OAAO,CAAC,kBAAkB,CAAC,cAAc,CAAC,CAAC;CAO5D"}
@@ -1,48 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.Health = void 0;
13
- /**
14
- * Provides health checking functionality for HawkSight's API services.
15
- * This class allows for simple verification of system health, ensuring that the underlying API and its services
16
- * are operational and accessible. It utilizes a dedicated `Client` instance to perform the health check operations.
17
- */
18
- class Health {
19
- /**
20
- * Constructs a Health instance with a specified client.
21
- * @param client A Client object configured to interact with the HawkSight API. This client handles
22
- * the actual API calls to perform health checks.
23
- */
24
- constructor(client) {
25
- this.client = client;
26
- }
27
- /**
28
- * Performs a health check on the HawkSight API.
29
- * This method queries the API's health check endpoint to determine the operational status of the system.
30
- * It is useful for monitoring and alert systems to ensure that API services are up and running smoothly.
31
- *
32
- * @returns A Promise that resolves to a `ResponseWithStatus<HealthResponse>` object containing:
33
- * - `status`: The HTTP status code of the health check request.
34
- * - `data`: The detailed health check response from the API, typically indicating various service statuses.
35
- *
36
- * Example of a health check response might include database connectivity status, API uptime, or other relevant system metrics.
37
- */
38
- health() {
39
- return __awaiter(this, void 0, void 0, function* () {
40
- const result = yield this.client.healthCheck.healthGet().catch(e => e.response);
41
- return {
42
- status: result.status,
43
- data: result.data,
44
- };
45
- });
46
- }
47
- }
48
- exports.Health = Health;
@@ -1,84 +0,0 @@
1
- import * as web3 from "@solana/web3.js";
2
- import { SimulatedTransactionResponse, TransactionPriority } from "../types";
3
- /**
4
- * Represents a transaction object in Solana using the web3.js library.
5
- * This class encapsulates the logic for creating, signing, and verifying signatures of transactions.
6
- */
7
- export declare class Transaction {
8
- readonly payerKey: web3.PublicKey;
9
- private _instructions;
10
- private _recentBlockhash;
11
- readonly alts: web3.AddressLookupTableAccount[];
12
- /** Compiled TransactionMessage which includes payer, instructions, and recent blockhash */
13
- private _txMessage;
14
- get txMessage(): web3.TransactionMessage;
15
- /** Versioned transaction built from the transaction message */
16
- private _versionedTransaction;
17
- get versionedTransaction(): web3.VersionedTransaction;
18
- /** A map indicating whether each required signer has signed the transaction */
19
- readonly requiredSigners: Record<string, boolean>;
20
- /** Estimated fee in SOL for priority fee when addPriorityFee() method is called. */
21
- private _priorityFeeEstimate;
22
- get priorityFeeEstimate(): string;
23
- /** The blockhash of a recent ledger entry */
24
- get recentBlockhash(): string;
25
- /** Array of TransactionInstruction to be executed in this transaction */
26
- get instructions(): web3.TransactionInstruction[];
27
- /**
28
- * Constructs a new Transaction object.
29
- *
30
- * @param payerKey PublicKey of the transaction payer
31
- * @param instructions Array of TransactionInstruction to be executed in this transaction
32
- * @param recentBlockhash The blockhash of a recent ledger entry
33
- * @param alts Address lookup tables that optimize account address storage
34
- */
35
- constructor(payerKey: web3.PublicKey, _instructions: web3.TransactionInstruction[], _recentBlockhash: string, alts: web3.AddressLookupTableAccount[]);
36
- /**
37
- * Signs the transaction with provided signers.
38
- *
39
- * @param signers Array of Signer objects whose private keys will be used to sign the transaction.
40
- * @param idempotent Boolean indicating whether signing should be idempotent (default is false).
41
- * @throws Error if a signer is not required or has already signed the transaction when not idempotent.
42
- */
43
- sign(signers: web3.Signer[], idempotent?: boolean): void;
44
- /**
45
- * Checks if all required signers have signed the transaction.
46
- *
47
- * @returns Boolean indicating whether all required signers have signed.
48
- */
49
- isSignedByRequiredSigners(): boolean;
50
- /**
51
- * Add priority fee instructions (compute budget)
52
- */
53
- addPriorityFeeIx(connection: web3.Connection, priorityLevel: TransactionPriority, computeUnitLimit: number, maxPriorityFee?: number): Promise<web3.TransactionInstruction[]>;
54
- /**
55
- * Simulate transaction
56
- *
57
- * @param connection
58
- * @returns
59
- */
60
- simulateTransaction(connection: web3.Connection): Promise<SimulatedTransactionResponse>;
61
- /**
62
- * Builds transaction object
63
- */
64
- private buildTransaction;
65
- /**
66
- * Gathers the public keys of all parties required to sign the transaction.
67
- *
68
- * @returns A record of signer public keys mapped to a boolean indicating whether they have signed.
69
- */
70
- private getRequiredSigners;
71
- /**
72
- * Find setComputeUnitLimit index within the instructions
73
- */
74
- private findSetComputeUnitLimitIndex;
75
- /**
76
- * Find setComputeUnitPrice index within the instructions
77
- */
78
- private findSetComputeUnitPriceIndex;
79
- /**
80
- * Remove priority fee instructions
81
- */
82
- private removePriorityFeeIxs;
83
- }
84
- //# sourceMappingURL=Transaction.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Transaction.d.ts","sourceRoot":"","sources":["../../../src/classes/Transaction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,4BAA4B,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAI7E;;;GAGG;AACH,qBAAa,WAAW;IAgCpB,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS;IACjC,OAAO,CAAC,aAAa;IACrB,OAAO,CAAC,gBAAgB;IACxB,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,yBAAyB,EAAE;IAjCjD,2FAA2F;IAC3F,OAAO,CAAC,UAAU,CAA0B;IAC5C,IAAI,SAAS,IAAI,IAAI,CAAC,kBAAkB,CAA2B;IAEnE,+DAA+D;IAC/D,OAAO,CAAC,qBAAqB,CAA4B;IACzD,IAAI,oBAAoB,IAAI,IAAI,CAAC,oBAAoB,CAAuC;IAE5F,+EAA+E;IAC/E,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAElD,oFAAoF;IACpF,OAAO,CAAC,oBAAoB,CAAc;IAC1C,IAAI,mBAAmB,IAAI,MAAM,CAAsC;IAEvE,6CAA6C;IAC7C,IAAI,eAAe,IAAI,MAAM,CAAkC;IAE/D,yEAAyE;IACzE,IAAI,YAAY,IAAI,IAAI,CAAC,sBAAsB,EAAE,CAA+B;IAEhF;;;;;;;OAOG;gBAEQ,QAAQ,EAAE,IAAI,CAAC,SAAS,EACzB,aAAa,EAAE,IAAI,CAAC,sBAAsB,EAAE,EAC5C,gBAAgB,EAAE,MAAM,EACvB,IAAI,EAAE,IAAI,CAAC,yBAAyB,EAAE;IAWjD;;;;;;OAMG;IACH,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,MAAM,EAAE,EAAE,UAAU,GAAE,OAAe,GAAG,IAAI;IAqB/D;;;;OAIG;IACH,yBAAyB,IAAI,OAAO;IAIpC;;OAEG;IACG,gBAAgB,CACpB,UAAU,EAAE,IAAI,CAAC,UAAU,EAC3B,aAAa,EAAE,mBAAmB,EAClC,gBAAgB,EAAE,MAAM,EACxB,cAAc,CAAC,EAAE,MAAM,GACtB,OAAO,CAAC,IAAI,CAAC,sBAAsB,EAAE,CAAC;IA+BzC;;;;;OAKG;IACG,mBAAmB,CAAC,UAAU,EAAE,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,4BAA4B,CAAC;IA+B7F;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAWxB;;;;OAIG;IACH,OAAO,CAAC,kBAAkB;IAS1B;;OAEG;IACH,OAAO,CAAC,4BAA4B;IAQpC;;OAEG;IACH,OAAO,CAAC,4BAA4B;IAQpC;;OAEG;IACH,OAAO,CAAC,oBAAoB;CAW7B"}