Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@hawksightco/hawk-sdk

Package Overview
Dependencies
Maintainers
0
Versions
119
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hawksightco/hawk-sdk - npm Package Compare versions

Comparing version 0.0.47 to 0.0.50

5

dist/src/classes/General.d.ts

@@ -49,5 +49,8 @@ import * as web3 from "@solana/web3.js";

*
* @param params Object containing hash of the pools
* @returns A Promise resolving to an array of pools, including metadata such as pool addresses and statistics.
*/
pools(): Promise<ResponseWithStatus<_client.HawksightPool[]>>;
pools(params: {
hash?: string;
}): Promise<ResponseWithStatus<_client.HawksightPool[]>>;
/**

@@ -54,0 +57,0 @@ * Retrieves information about the available tokens on the platform.

@@ -90,7 +90,8 @@ "use strict";

*
* @param params Object containing hash of the pools
* @returns A Promise resolving to an array of pools, including metadata such as pool addresses and statistics.
*/
pools() {
pools(params) {
return __awaiter(this, void 0, void 0, function* () {
const result = yield this.client.generalEndpoints.poolsGet().catch(e => e.response);
const result = yield this.client.generalEndpoints.poolsGet(params.hash).catch(e => e.response);
return {

@@ -97,0 +98,0 @@ status: result.status,

13

dist/src/classes/GeneralUtility.d.ts

@@ -1,2 +0,2 @@

import { PriorityFeeEstimate, UtilGetPriorityFeeEstimateBody } from "@hawksightco/swagger-client";
import { PriorityFeeEstimate, UtilGetPriorityFeeEstimateBody, UtilFindAltWithTxBody } from "@hawksightco/swagger-client";
import { ResponseWithStatus } from "../types";

@@ -33,3 +33,14 @@ import { Client } from "./Client";

getPriorityFeeEstimate(params: UtilGetPriorityFeeEstimateBody): Promise<ResponseWithStatus<PriorityFeeEstimate>>;
/**
* Finds alternative public keys related to a given transaction and returns them along with the response status.
*
* This method sends a request to the `utilFindAltWithTxPost` endpoint with the provided parameters, and returns the response
* status and an array of public key strings. In case of an error, it captures the error response and includes the status and
* data in the returned object.
*
* @param {UtilFindAltWithTxBody} params - The parameters for the function, which include the transaction metadata.
* @returns {Promise<ResponseWithStatus<Array<string>>>>} A promise that resolves to an object containing the response status and an array of public key strings.
*/
findAltWithTxPost(params: UtilFindAltWithTxBody): Promise<ResponseWithStatus<Array<string>>>;
}
//# sourceMappingURL=GeneralUtility.d.ts.map

@@ -51,3 +51,22 @@ "use strict";

}
/**
* Finds alternative public keys related to a given transaction and returns them along with the response status.
*
* This method sends a request to the `utilFindAltWithTxPost` endpoint with the provided parameters, and returns the response
* status and an array of public key strings. In case of an error, it captures the error response and includes the status and
* data in the returned object.
*
* @param {UtilFindAltWithTxBody} params - The parameters for the function, which include the transaction metadata.
* @returns {Promise<ResponseWithStatus<Array<string>>>>} A promise that resolves to an object containing the response status and an array of public key strings.
*/
findAltWithTxPost(params) {
return __awaiter(this, void 0, void 0, function* () {
const result = yield this.client.generalUtility.utilFindAltWithTxPost(params).catch(e => e.response);
return {
status: result.status,
data: result.data,
};
});
}
}
exports.GeneralUtility = GeneralUtility;

@@ -6,2 +6,3 @@ import { General } from "./General";

import { TxGeneratorAutomations } from "./TxGeneratorAutomations";
import { Client } from "./Client";
import { GeneralUtility } from "./GeneralUtility";

@@ -20,2 +21,4 @@ import { Search } from "./Search";

protected readonly url: string;
/** Swagger Client Instance. */
private readonly client;
/** Health module to check system health and API connectivity. */

@@ -30,3 +33,4 @@ readonly health: Health;

/** TxGenerator module for creating and managing transactions on the blockchain. */
readonly txGenerator: TxGenerator;
private _txGenerator;
get txGenerator(): TxGenerator;
/** TxGeneratorAutomations module for automating and optimizing transaction creation processes. */

@@ -41,3 +45,9 @@ readonly txGeneratorAutomation: TxGeneratorAutomations;

constructor(url?: string);
/**
* Override transaction generator
*
* @param txGenerator
*/
overrideTxGenerator(builderFn: (client: Client, generalUtility: GeneralUtility) => TxGenerator): void;
}
//# sourceMappingURL=HawkAPI.d.ts.map

@@ -22,2 +22,3 @@ "use strict";

class HawkAPI {
get txGenerator() { return this._txGenerator; }
/**

@@ -30,2 +31,3 @@ * Initializes a new instance of the HawkAPI class with a specified API URL.

const client = new Client_1.Client(url);
this.client = client;
this.health = new Health_1.Health(client);

@@ -35,3 +37,3 @@ this.generalUtility = new GeneralUtility_1.GeneralUtility(client);

this.util = new Util_1.Util(client);
this.txGenerator = new TxGenerator_1.TxGenerator(client, this.generalUtility);
this._txGenerator = new TxGenerator_1.TxGenerator(client, this.generalUtility);
this.txGeneratorAutomation = new TxGeneratorAutomations_1.TxGeneratorAutomations(client, this.generalUtility);

@@ -42,3 +44,11 @@ this.search = new Search_1.Search(url);

}
/**
* Override transaction generator
*
* @param txGenerator
*/
overrideTxGenerator(builderFn) {
this._txGenerator = builderFn(this.client, this.generalUtility);
}
}
exports.HawkAPI = HawkAPI;

@@ -42,13 +42,13 @@ import * as web3 from "@solana/web3.js";

/**
* Creates meteora auto-rebalance instruction
*
* NOTE: For hawksight devs only.
*
* @param connection The Solana web3 connection object for blockchain interactions.
* @param payer The public key of the payer for transaction fees.
* @param params Parameters required
* @returns A ResponseWithStatus containing either TransactionMetadataResponse or TransactionMetadata.
*/
* Creates meteora auto-rebalance instruction
*
* NOTE: For hawksight devs only.
*
* @param connection The Solana web3 connection object for blockchain interactions.
* @param payer The public key of the payer for transaction fees.
* @param params Parameters required
* @returns A ResponseWithStatus containing either TransactionMetadataResponse or TransactionMetadata.
*/
meteoraRebalanceIxs(connection: web3.Connection, payer: string, params: _client.AutomationRebalanceAutomationIxBody): Promise<ResponseWithStatus<TransactionMetadata>>;
}
//# sourceMappingURL=TxGeneratorAutomations.d.ts.map

@@ -77,11 +77,11 @@ "use strict";

/**
* Creates meteora auto-rebalance instruction
*
* NOTE: For hawksight devs only.
*
* @param connection The Solana web3 connection object for blockchain interactions.
* @param payer The public key of the payer for transaction fees.
* @param params Parameters required
* @returns A ResponseWithStatus containing either TransactionMetadataResponse or TransactionMetadata.
*/
* Creates meteora auto-rebalance instruction
*
* NOTE: For hawksight devs only.
*
* @param connection The Solana web3 connection object for blockchain interactions.
* @param payer The public key of the payer for transaction fees.
* @param params Parameters required
* @returns A ResponseWithStatus containing either TransactionMetadataResponse or TransactionMetadata.
*/
meteoraRebalanceIxs(connection, payer, params) {

@@ -88,0 +88,0 @@ return __awaiter(this, void 0, void 0, function* () {

@@ -60,5 +60,17 @@ "use strict";

const alts = [];
// Find jup alts
const jupAlts = yield generalUtility.findAltWithTxPost({
transaction: data,
});
for (const alt of data.addressLookupTableAddresses) {
alts.push((yield connection.getAddressLookupTable(new web3.PublicKey(alt))).value);
}
if (jupAlts.status === 200) {
for (const alt of jupAlts.data) {
alts.push((yield connection.getAddressLookupTable(new web3.PublicKey(alt))).value);
}
}
else {
console.error(jupAlts.data);
}
// Get the recent blockhash

@@ -65,0 +77,0 @@ const latestBlockhash = yield connection.getLatestBlockhash();

export * from "./types";
export { HawkAPI } from "./classes/HawkAPI";
export { TxGenerator } from "./classes/TxGenerator";
//# sourceMappingURL=index.d.ts.map

@@ -17,5 +17,7 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.HawkAPI = void 0;
exports.TxGenerator = exports.HawkAPI = void 0;
__exportStar(require("./types"), exports);
var HawkAPI_1 = require("./classes/HawkAPI");
Object.defineProperty(exports, "HawkAPI", { enumerable: true, get: function () { return HawkAPI_1.HawkAPI; } });
var TxGenerator_1 = require("./classes/TxGenerator");
Object.defineProperty(exports, "TxGenerator", { enumerable: true, get: function () { return TxGenerator_1.TxGenerator; } });
{
"name": "@hawksightco/hawk-sdk",
"version": "0.0.47",
"version": "0.0.50",
"description": "Hawksight v2 SDK",

@@ -23,3 +23,3 @@ "main": "dist/src/index.js",

"dependencies": {
"@hawksightco/swagger-client": "0.0.18",
"@hawksightco/swagger-client": "0.0.22",
"@solana/web3.js": "^1.89.1",

@@ -26,0 +26,0 @@ "bn.js": "^5.2.1"

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc