@hawksightco/hawk-sdk 1.1.42 → 1.1.43
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.
|
@@ -4,6 +4,7 @@ import * as _client from "@hawksightco/swagger-client";
|
|
|
4
4
|
import { ResponseWithStatus, TransactionMetadata, UserPortfolioOut } from "../types";
|
|
5
5
|
import { Client } from "./Client";
|
|
6
6
|
import { GeneralUtility } from "./GeneralUtility";
|
|
7
|
+
import { InlineResponse200 } from '../../../swagger-client/dist/models/inline-response200';
|
|
7
8
|
/**
|
|
8
9
|
* Provides general utility functions for managing and querying blockchain-related data,
|
|
9
10
|
* handling transactions, and interfacing with a specific blockchain network via the client API.
|
|
@@ -34,6 +35,12 @@ export declare class General {
|
|
|
34
35
|
* @param maxPriorityFee The fee in lamports.
|
|
35
36
|
*/
|
|
36
37
|
setMaxPriorityFee(maxPriorityFee: number): void;
|
|
38
|
+
/**
|
|
39
|
+
* @returns Returns a token supported by Hawksight
|
|
40
|
+
*/
|
|
41
|
+
token(params: {
|
|
42
|
+
address: string;
|
|
43
|
+
}): Promise<ResponseWithStatus<InlineResponse200>>;
|
|
37
44
|
/**
|
|
38
45
|
* Retrieves the portfolio information for a specified wallet and optionally a pool.
|
|
39
46
|
*
|
|
@@ -53,6 +60,16 @@ export declare class General {
|
|
|
53
60
|
pools(params: {
|
|
54
61
|
hash?: string;
|
|
55
62
|
}): Promise<ResponseWithStatus<_client.HawksightPool[]>>;
|
|
63
|
+
/**
|
|
64
|
+
* Fetches a single pool either from Orca or Meteora.
|
|
65
|
+
*
|
|
66
|
+
* @param params Object containing hash of the pools
|
|
67
|
+
* @returns A Promise resolving to an array of pools, including metadata such as pool addresses and statistics.
|
|
68
|
+
*/
|
|
69
|
+
pool(params: {
|
|
70
|
+
pairAddress: string;
|
|
71
|
+
protocol: string;
|
|
72
|
+
}): Promise<ResponseWithStatus<_client.HawksightPool[]>>;
|
|
56
73
|
/**
|
|
57
74
|
* Retrieves information about the available tokens on the platform.
|
|
58
75
|
*
|
|
@@ -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;
|
|
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;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wDAAwD,CAAC;AAG3F;;;;;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;;OAEG;IACG,KAAK,CACT,MAAM,EAAE;QACN,OAAO,EAAE,MAAM,CAAC;KACjB,GACA,OAAO,CAAC,kBAAkB,CAAC,iBAAiB,CAAC,CAAC;IAQjD;;;;;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;;;;;OAKG;IACG,IAAI,CACR,MAAM,EAAE;QACN,WAAW,EAAE,MAAM,CAAC;QACpB,QAAQ,EAAE,MAAM,CAAC;KAClB,GACA,OAAO,CAAC,kBAAkB,CAAC,OAAO,CAAC,aAAa,EAAE,CAAC,CAAC;IAevD;;;;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"}
|
|
@@ -69,6 +69,18 @@ class General {
|
|
|
69
69
|
setMaxPriorityFee(maxPriorityFee) {
|
|
70
70
|
this.maxPriorityFee = maxPriorityFee;
|
|
71
71
|
}
|
|
72
|
+
/**
|
|
73
|
+
* @returns Returns a token supported by Hawksight
|
|
74
|
+
*/
|
|
75
|
+
token(params) {
|
|
76
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
77
|
+
const result = yield this.client.generalEndpoints.tokenGet(params.address).catch(e => e.response);
|
|
78
|
+
return {
|
|
79
|
+
status: result.status,
|
|
80
|
+
data: result.data,
|
|
81
|
+
};
|
|
82
|
+
});
|
|
83
|
+
}
|
|
72
84
|
/**
|
|
73
85
|
* Retrieves the portfolio information for a specified wallet and optionally a pool.
|
|
74
86
|
*
|
|
@@ -99,6 +111,26 @@ class General {
|
|
|
99
111
|
};
|
|
100
112
|
});
|
|
101
113
|
}
|
|
114
|
+
/**
|
|
115
|
+
* Fetches a single pool either from Orca or Meteora.
|
|
116
|
+
*
|
|
117
|
+
* @param params Object containing hash of the pools
|
|
118
|
+
* @returns A Promise resolving to an array of pools, including metadata such as pool addresses and statistics.
|
|
119
|
+
*/
|
|
120
|
+
pool(params) {
|
|
121
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
122
|
+
if (["orca", "meteora"].includes(params.protocol)) {
|
|
123
|
+
const result = yield this.client.generalEndpoints.poolGet(params.pairAddress, params.protocol).catch(e => e.response);
|
|
124
|
+
return {
|
|
125
|
+
status: result.status,
|
|
126
|
+
data: result.data,
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
throw new Error(`Protocol can only be: "orca" or "meteora". Value passed: ${params.protocol}`);
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
}
|
|
102
134
|
/**
|
|
103
135
|
* Retrieves information about the available tokens on the platform.
|
|
104
136
|
*
|
|
@@ -70,5 +70,18 @@ export declare class Util {
|
|
|
70
70
|
orcaGetPosition(params: {
|
|
71
71
|
pool: string;
|
|
72
72
|
}): Promise<ResponseWithStatus<any>>;
|
|
73
|
+
/**
|
|
74
|
+
* Returns orca tick current index of given whirlpool(s)
|
|
75
|
+
*
|
|
76
|
+
* @param params
|
|
77
|
+
* @returns
|
|
78
|
+
*/
|
|
79
|
+
orcaGetActiveTick(params: {
|
|
80
|
+
pools: string[];
|
|
81
|
+
commitment?: string;
|
|
82
|
+
}): Promise<{
|
|
83
|
+
status: any;
|
|
84
|
+
data: any;
|
|
85
|
+
}>;
|
|
73
86
|
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AAC;IAQnC;;;;;OAKG;IACG,eAAe,CACnB,MAAM,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;KACd,GACA,OAAO,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC;IAQnC;;;;;OAKG;IACG,iBAAiB,CACrB,MAAM,EAAE;QACN,KAAK,EAAE,MAAM,EAAE,CAAC;QAChB,UAAU,CAAC,EAAE,MAAM,CAAA;KACpB;;;;CAWJ"}
|
package/dist/src/classes/Util.js
CHANGED
|
@@ -119,7 +119,25 @@ class Util {
|
|
|
119
119
|
*/
|
|
120
120
|
orcaGetPosition(params) {
|
|
121
121
|
return __awaiter(this, void 0, void 0, function* () {
|
|
122
|
-
const result = yield this.client.
|
|
122
|
+
const result = yield this.client.generalEndpoints.poolGet(params.pool, "orca");
|
|
123
|
+
return {
|
|
124
|
+
status: result.status,
|
|
125
|
+
data: result.data,
|
|
126
|
+
};
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Returns orca tick current index of given whirlpool(s)
|
|
131
|
+
*
|
|
132
|
+
* @param params
|
|
133
|
+
* @returns
|
|
134
|
+
*/
|
|
135
|
+
orcaGetActiveTick(params) {
|
|
136
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
137
|
+
const result = yield this.client.orcaUtilityFunctionsApi.orcaUtilActiveTickPost({
|
|
138
|
+
pools: params.pools,
|
|
139
|
+
commitment: params.commitment,
|
|
140
|
+
}).catch(e => e.response);
|
|
123
141
|
return {
|
|
124
142
|
status: result.status,
|
|
125
143
|
data: result.data,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hawksightco/hawk-sdk",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.43",
|
|
4
4
|
"description": "Hawksight v2 SDK",
|
|
5
5
|
"main": "dist/src/index.js",
|
|
6
6
|
"repository": "https://github.com/ghabxph/hawk-api-client.git",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@coral-xyz/anchor": "~0.29.0",
|
|
27
|
-
"@hawksightco/swagger-client": "^0.0.
|
|
27
|
+
"@hawksightco/swagger-client": "^0.0.34",
|
|
28
28
|
"@meteora-ag/dlmm": "^1.0.51",
|
|
29
29
|
"@solana/spl-token": "^0.4.6",
|
|
30
30
|
"@solana/web3.js": "^1.89.1",
|