@hawksightco/hawk-sdk 1.3.264 → 1.3.265

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 (181) hide show
  1. package/package.json +1 -1
  2. package/dist/src/addresses.d.ts +0 -37
  3. package/dist/src/addresses.d.ts.map +0 -1
  4. package/dist/src/addresses.js +0 -84
  5. package/dist/src/anchor.d.ts +0 -22
  6. package/dist/src/anchor.d.ts.map +0 -1
  7. package/dist/src/anchor.js +0 -121
  8. package/dist/src/classes/AltStorage.d.ts +0 -29
  9. package/dist/src/classes/AltStorage.d.ts.map +0 -1
  10. package/dist/src/classes/AltStorage.js +0 -58
  11. package/dist/src/classes/Atomicity.d.ts +0 -34
  12. package/dist/src/classes/Atomicity.d.ts.map +0 -1
  13. package/dist/src/classes/Atomicity.js +0 -110
  14. package/dist/src/classes/Client.d.ts +0 -35
  15. package/dist/src/classes/Client.d.ts.map +0 -1
  16. package/dist/src/classes/Client.js +0 -66
  17. package/dist/src/classes/CombineTransactions.d.ts +0 -11
  18. package/dist/src/classes/CombineTransactions.d.ts.map +0 -1
  19. package/dist/src/classes/CombineTransactions.js +0 -58
  20. package/dist/src/classes/CreateTxMetadata.d.ts +0 -100
  21. package/dist/src/classes/CreateTxMetadata.d.ts.map +0 -1
  22. package/dist/src/classes/CreateTxMetadata.js +0 -415
  23. package/dist/src/classes/General.d.ts +0 -87
  24. package/dist/src/classes/General.d.ts.map +0 -1
  25. package/dist/src/classes/General.js +0 -176
  26. package/dist/src/classes/GeneralUtility.d.ts +0 -79
  27. package/dist/src/classes/GeneralUtility.d.ts.map +0 -1
  28. package/dist/src/classes/GeneralUtility.js +0 -121
  29. package/dist/src/classes/HawkAPI.d.ts +0 -122
  30. package/dist/src/classes/HawkAPI.d.ts.map +0 -1
  31. package/dist/src/classes/HawkAPI.js +0 -169
  32. package/dist/src/classes/Health.d.ts +0 -29
  33. package/dist/src/classes/Health.d.ts.map +0 -1
  34. package/dist/src/classes/Health.js +0 -48
  35. package/dist/src/classes/JupiterAlts.d.ts +0 -37
  36. package/dist/src/classes/JupiterAlts.d.ts.map +0 -1
  37. package/dist/src/classes/JupiterAlts.js +0 -114
  38. package/dist/src/classes/JupiterSwap.d.ts +0 -21
  39. package/dist/src/classes/JupiterSwap.d.ts.map +0 -1
  40. package/dist/src/classes/JupiterSwap.js +0 -40
  41. package/dist/src/classes/Logging.d.ts +0 -13
  42. package/dist/src/classes/Logging.d.ts.map +0 -1
  43. package/dist/src/classes/Logging.js +0 -50
  44. package/dist/src/classes/MultiTransaction.d.ts +0 -75
  45. package/dist/src/classes/MultiTransaction.d.ts.map +0 -1
  46. package/dist/src/classes/MultiTransaction.js +0 -296
  47. package/dist/src/classes/RaydiumSDK.d.ts +0 -67
  48. package/dist/src/classes/RaydiumSDK.d.ts.map +0 -1
  49. package/dist/src/classes/RaydiumSDK.js +0 -206
  50. package/dist/src/classes/Search.d.ts +0 -100
  51. package/dist/src/classes/Search.d.ts.map +0 -1
  52. package/dist/src/classes/Search.js +0 -216
  53. package/dist/src/classes/SimpleIxGenerator.d.ts +0 -57
  54. package/dist/src/classes/SimpleIxGenerator.d.ts.map +0 -1
  55. package/dist/src/classes/SimpleIxGenerator.js +0 -62
  56. package/dist/src/classes/SimplePdaGenerator.d.ts +0 -28
  57. package/dist/src/classes/SimplePdaGenerator.d.ts.map +0 -1
  58. package/dist/src/classes/SimplePdaGenerator.js +0 -33
  59. package/dist/src/classes/Transaction.d.ts +0 -229
  60. package/dist/src/classes/Transaction.d.ts.map +0 -1
  61. package/dist/src/classes/Transaction.js +0 -643
  62. package/dist/src/classes/Transaction2.d.ts +0 -107
  63. package/dist/src/classes/Transaction2.d.ts.map +0 -1
  64. package/dist/src/classes/Transaction2.js +0 -249
  65. package/dist/src/classes/Transaction3.d.ts +0 -165
  66. package/dist/src/classes/Transaction3.d.ts.map +0 -1
  67. package/dist/src/classes/Transaction3.js +0 -416
  68. package/dist/src/classes/TransactionBatchExecute.d.ts +0 -163
  69. package/dist/src/classes/TransactionBatchExecute.d.ts.map +0 -1
  70. package/dist/src/classes/TransactionBatchExecute.js +0 -466
  71. package/dist/src/classes/TransactionBatchExecute2.d.ts +0 -99
  72. package/dist/src/classes/TransactionBatchExecute2.d.ts.map +0 -1
  73. package/dist/src/classes/TransactionBatchExecute2.js +0 -357
  74. package/dist/src/classes/Transactions.d.ts +0 -586
  75. package/dist/src/classes/Transactions.d.ts.map +0 -1
  76. package/dist/src/classes/Transactions.js +0 -7658
  77. package/dist/src/classes/TxGenerator.d.ts +0 -350
  78. package/dist/src/classes/TxGenerator.d.ts.map +0 -1
  79. package/dist/src/classes/TxGenerator.js +0 -1957
  80. package/dist/src/classes/TxGeneratorAutomations.d.ts +0 -186
  81. package/dist/src/classes/TxGeneratorAutomations.d.ts.map +0 -1
  82. package/dist/src/classes/TxGeneratorAutomations.js +0 -897
  83. package/dist/src/classes/Util.d.ts +0 -87
  84. package/dist/src/classes/Util.d.ts.map +0 -1
  85. package/dist/src/classes/Util.js +0 -148
  86. package/dist/src/classes/account-cache/AccountCache.d.ts +0 -54
  87. package/dist/src/classes/account-cache/AccountCache.d.ts.map +0 -1
  88. package/dist/src/classes/account-cache/AccountCache.js +0 -143
  89. package/dist/src/classes/account-cache/MintCache.d.ts +0 -33
  90. package/dist/src/classes/account-cache/MintCache.d.ts.map +0 -1
  91. package/dist/src/classes/account-cache/MintCache.js +0 -47
  92. package/dist/src/classes/account-cache/TokenCache.d.ts +0 -33
  93. package/dist/src/classes/account-cache/TokenCache.d.ts.map +0 -1
  94. package/dist/src/classes/account-cache/TokenCache.js +0 -47
  95. package/dist/src/errors.d.ts +0 -13
  96. package/dist/src/errors.d.ts.map +0 -1
  97. package/dist/src/errors.js +0 -96
  98. package/dist/src/functions.d.ts +0 -514
  99. package/dist/src/functions.d.ts.map +0 -1
  100. package/dist/src/functions.js +0 -1636
  101. package/dist/src/hawksight.d.ts +0 -53
  102. package/dist/src/hawksight.d.ts.map +0 -1
  103. package/dist/src/hawksight.js +0 -328
  104. package/dist/src/hsToMeteora.d.ts +0 -31
  105. package/dist/src/hsToMeteora.d.ts.map +0 -1
  106. package/dist/src/hsToMeteora.js +0 -3175
  107. package/dist/src/idl/iyf-extension-idl.d.ts +0 -14583
  108. package/dist/src/idl/iyf-extension-idl.d.ts.map +0 -1
  109. package/dist/src/idl/iyf-extension-idl.js +0 -14578
  110. package/dist/src/idl/iyf-extension-wrapper.d.ts +0 -112
  111. package/dist/src/idl/iyf-extension-wrapper.d.ts.map +0 -1
  112. package/dist/src/idl/iyf-extension-wrapper.js +0 -2
  113. package/dist/src/idl/iyf-main-idl.d.ts +0 -11329
  114. package/dist/src/idl/iyf-main-idl.d.ts.map +0 -1
  115. package/dist/src/idl/iyf-main-idl.js +0 -11324
  116. package/dist/src/idl/iyf-main-wrapper.d.ts +0 -112
  117. package/dist/src/idl/iyf-main-wrapper.d.ts.map +0 -1
  118. package/dist/src/idl/iyf-main-wrapper.js +0 -2
  119. package/dist/src/idl/jupiter-idl.d.ts +0 -3063
  120. package/dist/src/idl/jupiter-idl.d.ts.map +0 -1
  121. package/dist/src/idl/jupiter-idl.js +0 -3061
  122. package/dist/src/idl/meteora-idl.d.ts +0 -7371
  123. package/dist/src/idl/meteora-idl.d.ts.map +0 -1
  124. package/dist/src/idl/meteora-idl.js +0 -7372
  125. package/dist/src/idl/orca-idl.d.ts +0 -3833
  126. package/dist/src/idl/orca-idl.d.ts.map +0 -1
  127. package/dist/src/idl/orca-idl.js +0 -3834
  128. package/dist/src/idl/raydium-idl.d.ts +0 -3054
  129. package/dist/src/idl/raydium-idl.d.ts.map +0 -1
  130. package/dist/src/idl/raydium-idl.js +0 -3055
  131. package/dist/src/index.d.ts +0 -9
  132. package/dist/src/index.d.ts.map +0 -1
  133. package/dist/src/index.js +0 -31
  134. package/dist/src/ixGenerator/IyfExtensionIxGenerator.d.ts +0 -126
  135. package/dist/src/ixGenerator/IyfExtensionIxGenerator.d.ts.map +0 -1
  136. package/dist/src/ixGenerator/IyfExtensionIxGenerator.js +0 -467
  137. package/dist/src/ixGenerator/IyfMainIxGenerator.d.ts +0 -330
  138. package/dist/src/ixGenerator/IyfMainIxGenerator.d.ts.map +0 -1
  139. package/dist/src/ixGenerator/IyfMainIxGenerator.js +0 -1239
  140. package/dist/src/ixGenerator/MeteoraDlmmIxGenerator.d.ts +0 -685
  141. package/dist/src/ixGenerator/MeteoraDlmmIxGenerator.d.ts.map +0 -1
  142. package/dist/src/ixGenerator/MeteoraDlmmIxGenerator.js +0 -3005
  143. package/dist/src/ixGenerator/OrcaIxGenerator.d.ts +0 -119
  144. package/dist/src/ixGenerator/OrcaIxGenerator.d.ts.map +0 -1
  145. package/dist/src/ixGenerator/OrcaIxGenerator.js +0 -438
  146. package/dist/src/ixGenerator/RaydiumIxGenerator.d.ts +0 -99
  147. package/dist/src/ixGenerator/RaydiumIxGenerator.d.ts.map +0 -1
  148. package/dist/src/ixGenerator/RaydiumIxGenerator.js +0 -558
  149. package/dist/src/ixGenerator/UtilIxGenerator.d.ts +0 -20
  150. package/dist/src/ixGenerator/UtilIxGenerator.d.ts.map +0 -1
  151. package/dist/src/ixGenerator/UtilIxGenerator.js +0 -25
  152. package/dist/src/meteora/index.d.ts +0 -2
  153. package/dist/src/meteora/index.d.ts.map +0 -1
  154. package/dist/src/meteora/index.js +0 -17
  155. package/dist/src/meteora/liquidityStrategy.d.ts +0 -408
  156. package/dist/src/meteora/liquidityStrategy.d.ts.map +0 -1
  157. package/dist/src/meteora/liquidityStrategy.js +0 -1325
  158. package/dist/src/meteora.d.ts +0 -669
  159. package/dist/src/meteora.d.ts.map +0 -1
  160. package/dist/src/meteora.js +0 -1932
  161. package/dist/src/orca.d.ts +0 -57
  162. package/dist/src/orca.d.ts.map +0 -1
  163. package/dist/src/orca.js +0 -123
  164. package/dist/src/pdaGenerator/HawksightPdaGenerator.d.ts +0 -29
  165. package/dist/src/pdaGenerator/HawksightPdaGenerator.d.ts.map +0 -1
  166. package/dist/src/pdaGenerator/HawksightPdaGenerator.js +0 -75
  167. package/dist/src/pdaGenerator/MeteoraPdaGenerator.d.ts +0 -76
  168. package/dist/src/pdaGenerator/MeteoraPdaGenerator.d.ts.map +0 -1
  169. package/dist/src/pdaGenerator/MeteoraPdaGenerator.js +0 -166
  170. package/dist/src/pdaGenerator/OrcaPdaGenerator.d.ts +0 -23
  171. package/dist/src/pdaGenerator/OrcaPdaGenerator.d.ts.map +0 -1
  172. package/dist/src/pdaGenerator/OrcaPdaGenerator.js +0 -68
  173. package/dist/src/pdaGenerator/RaydiumPdaGenerator.d.ts +0 -49
  174. package/dist/src/pdaGenerator/RaydiumPdaGenerator.d.ts.map +0 -1
  175. package/dist/src/pdaGenerator/RaydiumPdaGenerator.js +0 -114
  176. package/dist/src/pdaGenerator/UtilPdaGenerator.d.ts +0 -8
  177. package/dist/src/pdaGenerator/UtilPdaGenerator.d.ts.map +0 -1
  178. package/dist/src/pdaGenerator/UtilPdaGenerator.js +0 -51
  179. package/dist/src/types.d.ts +0 -1100
  180. package/dist/src/types.d.ts.map +0 -1
  181. package/dist/src/types.js +0 -95
@@ -1,87 +0,0 @@
1
- import * as client from "@hawksightco/swagger-client";
2
- import { MeteoraDlmmActiveBin, ResponseWithStatus, UserPortfolioOut } from "../types";
3
- import { Client } from "./Client";
4
- /**
5
- * Provides utility functions for interacting with the Meteora DLMM and Orca CLMM subsystems of the HawkSight API.
6
- * This class enables fetching and manipulating data related to pools, positions, and other transaction-related information.
7
- */
8
- export declare class Util {
9
- private readonly client;
10
- /**
11
- * Initializes a new instance of the Util class.
12
- *
13
- * @param client The Client object through which API calls will be made.
14
- */
15
- constructor(client: Client);
16
- /**
17
- * Retrieves a list of pools managed by Meteora DLMM.
18
- *
19
- * @returns A Promise resolving to a response object containing the status and array of pool information.
20
- */
21
- meteoraDlmmPools(): Promise<ResponseWithStatus<client.InlineResponse2003[]>>;
22
- /**
23
- * Fetches positions held in Meteora DLMM pools, optionally filtered by a specific pool.
24
- *
25
- * @param params An object containing wallet address and an optional pool identifier.
26
- * @returns A Promise resolving to a response object with the status and data of positions.
27
- */
28
- meteoraDlmmPositions(params: {
29
- wallet: string;
30
- pool?: string;
31
- }): Promise<ResponseWithStatus<UserPortfolioOut>>;
32
- /**
33
- * Retrieves the active bin data for a specific set of parameters in Meteora DLMM.
34
- *
35
- * @param params The parameters required to define the active bin query.
36
- * @returns A Promise resolving to a response with the status and data of the active bin.
37
- */
38
- meteoraDlmmActiveBin(params: client.UtilActiveBinBody): Promise<ResponseWithStatus<MeteoraDlmmActiveBin>>;
39
- /**
40
- * Retrieves a list of pools managed by Orca CLMM.
41
- *
42
- * @returns A Promise resolving to a response object containing the status and array of pool information.
43
- */
44
- orcaClmmPools(): Promise<ResponseWithStatus<any>>;
45
- /**
46
- * Fetches positions held in Orca CLMM pools, optionally filtered by a specific pool.
47
- *
48
- * @param params An object containing wallet address and an optional pool identifier.
49
- * @returns A Promise resolving to a response object with the status and data of positions.
50
- */
51
- orcaPositions(params: {
52
- wallet: string;
53
- pool?: string;
54
- }): Promise<ResponseWithStatus<any>>;
55
- /**
56
- * Retrieves the mint information of a specific position managed by Orca CLMM.
57
- *
58
- * @param params An object containing the identifier of the position.
59
- * @returns A Promise resolving to a response object with the status and mint details of the position.
60
- */
61
- orcaGetPositionMint(params: {
62
- position: string;
63
- }): Promise<ResponseWithStatus<any>>;
64
- /**
65
- * Get single orca pool from hawksight api
66
- *
67
- * @param params Whirlpool address.
68
- * @returns A Promise resolving to a response object with the status and mint details of the position.
69
- */
70
- orcaGetPosition(params: {
71
- pool: string;
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
- }>;
86
- }
87
- //# sourceMappingURL=Util.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Util.d.ts","sourceRoot":"","sources":["../../../src/classes/Util.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAiB,gBAAgB,EAAE,MAAM,UAAU,CAAC;AACrG,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC;;;GAGG;AACH,qBAAa,IAAI;IAOb,OAAO,CAAC,QAAQ,CAAC,MAAM;IANzB;;;;OAIG;gBAEgB,MAAM,EAAE,MAAM;IAGjC;;;;OAIG;IACG,gBAAgB,IAAI,OAAO,CAAC,kBAAkB,CAAC,MAAM,CAAC,kBAAkB,EAAE,CAAC,CAAC;IAQlF;;;;;OAKG;IACG,oBAAoB,CACxB,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,oBAAoB,CAAC,MAAM,EAAE,MAAM,CAAC,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC,oBAAoB,CAAC,CAAC;IAQ/G;;;;OAIG;IACG,aAAa,IAAI,OAAO,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC;IAQvD;;;;;OAKG;IACG,aAAa,CACjB,MAAM,EAAE;QACN,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,GACA,OAAO,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC;IAQnC;;;;;OAKG;IACG,mBAAmB,CACvB,MAAM,EAAE;QACN,QAAQ,EAAE,MAAM,CAAC;KAClB,GACA,OAAO,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC;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"}
@@ -1,148 +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.Util = void 0;
13
- /**
14
- * Provides utility functions for interacting with the Meteora DLMM and Orca CLMM subsystems of the HawkSight API.
15
- * This class enables fetching and manipulating data related to pools, positions, and other transaction-related information.
16
- */
17
- class Util {
18
- /**
19
- * Initializes a new instance of the Util class.
20
- *
21
- * @param client The Client object through which API calls will be made.
22
- */
23
- constructor(client) {
24
- this.client = client;
25
- }
26
- /**
27
- * Retrieves a list of pools managed by Meteora DLMM.
28
- *
29
- * @returns A Promise resolving to a response object containing the status and array of pool information.
30
- */
31
- meteoraDlmmPools() {
32
- return __awaiter(this, void 0, void 0, function* () {
33
- const result = yield this.client.meteoraDLMMUtilityFunctionsApi.meteoraDlmmUtilPoolsGet().catch(e => e.response);
34
- return {
35
- status: result.status,
36
- data: result.data,
37
- };
38
- });
39
- }
40
- /**
41
- * Fetches positions held in Meteora DLMM pools, optionally filtered by a specific pool.
42
- *
43
- * @param params An object containing wallet address and an optional pool identifier.
44
- * @returns A Promise resolving to a response object with the status and data of positions.
45
- */
46
- meteoraDlmmPositions(params) {
47
- return __awaiter(this, void 0, void 0, function* () {
48
- const result = yield this.client.meteoraDLMMUtilityFunctionsApi.meteoraDlmmUtilPositionsGet(params.wallet, params.pool).catch(e => e.response);
49
- return {
50
- status: result.status,
51
- data: result.data,
52
- };
53
- });
54
- }
55
- /**
56
- * Retrieves the active bin data for a specific set of parameters in Meteora DLMM.
57
- *
58
- * @param params The parameters required to define the active bin query.
59
- * @returns A Promise resolving to a response with the status and data of the active bin.
60
- */
61
- meteoraDlmmActiveBin(params) {
62
- return __awaiter(this, void 0, void 0, function* () {
63
- const result = yield this.client.meteoraDLMMUtilityFunctionsApi.meteoraDlmmUtilActiveBinPost(params).catch(e => e.response);
64
- return {
65
- status: result.status,
66
- data: result.data,
67
- };
68
- });
69
- }
70
- /**
71
- * Retrieves a list of pools managed by Orca CLMM.
72
- *
73
- * @returns A Promise resolving to a response object containing the status and array of pool information.
74
- */
75
- orcaClmmPools() {
76
- return __awaiter(this, void 0, void 0, function* () {
77
- const result = yield this.client.orcaUtilityFunctionsApi.orcaUtilPoolsGet().catch(e => e.response);
78
- return {
79
- status: result.status,
80
- data: result.data,
81
- };
82
- });
83
- }
84
- /**
85
- * Fetches positions held in Orca CLMM pools, optionally filtered by a specific pool.
86
- *
87
- * @param params An object containing wallet address and an optional pool identifier.
88
- * @returns A Promise resolving to a response object with the status and data of positions.
89
- */
90
- orcaPositions(params) {
91
- return __awaiter(this, void 0, void 0, function* () {
92
- const result = yield this.client.orcaUtilityFunctionsApi.orcaUtilPositionsGet(params.wallet, params.pool).catch(e => e.response);
93
- return {
94
- status: result.status,
95
- data: result.data,
96
- };
97
- });
98
- }
99
- /**
100
- * Retrieves the mint information of a specific position managed by Orca CLMM.
101
- *
102
- * @param params An object containing the identifier of the position.
103
- * @returns A Promise resolving to a response object with the status and mint details of the position.
104
- */
105
- orcaGetPositionMint(params) {
106
- return __awaiter(this, void 0, void 0, function* () {
107
- const result = yield this.client.orcaUtilityFunctionsApi.orcaUtilGetPositionMintGet(params.position).catch(e => e.response);
108
- return {
109
- status: result.status,
110
- data: result.data,
111
- };
112
- });
113
- }
114
- /**
115
- * Get single orca pool from hawksight api
116
- *
117
- * @param params Whirlpool address.
118
- * @returns A Promise resolving to a response object with the status and mint details of the position.
119
- */
120
- orcaGetPosition(params) {
121
- return __awaiter(this, void 0, void 0, function* () {
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);
141
- return {
142
- status: result.status,
143
- data: result.data,
144
- };
145
- });
146
- }
147
- }
148
- exports.Util = Util;
@@ -1,54 +0,0 @@
1
- import * as web3 from "@solana/web3.js";
2
- type AccountInfoInternal = {
3
- refetch: boolean;
4
- info: web3.AccountInfo<Buffer>;
5
- };
6
- type _AccountCache = Record<string, AccountInfoInternal>;
7
- export declare abstract class AccountCache {
8
- protected connection: web3.Connection;
9
- /**
10
- * Cache of accounts.
11
- */
12
- protected static accounts: _AccountCache;
13
- /**
14
- * Promise that resolves when the accounts are fetched.
15
- * This is used to wait for the accounts to be fetched before using them.
16
- */
17
- protected pending: Promise<void> | null;
18
- /**
19
- * Instantiate the AccountCache class
20
- *
21
- * @param connection - The connection to the blockchain.
22
- */
23
- constructor(connection: web3.Connection);
24
- /**
25
- * Criteria of accounts to be fetched must be only owned by the given programs
26
- */
27
- protected abstract mustOwnedByEitherPrograms(): web3.PublicKey[];
28
- /**
29
- * Whether the account query should require the account to exist.
30
- */
31
- protected abstract requireToExist(): boolean;
32
- /**
33
- * Get account info from cache
34
- *
35
- * @param key
36
- * @returns
37
- */
38
- static get(key: web3.PublicKey): AccountInfoInternal | undefined;
39
- /**
40
- * Mark accounts to be refetched
41
- */
42
- refetch(pubkeys: web3.PublicKey[]): this;
43
- /**
44
- * The goal of this function is to batch 100 accounts at a time as it is the max number of accounts that can be fetched at once.
45
- * Skips accounts that are already fetched.
46
- *
47
- * @param pubkeys - The accounts to fetch.
48
- * @returns - A promise that resolves to an array of TokenAccountInfo objects.
49
- */
50
- getBatchedMultipleAccountsInfo(pubkeys: web3.PublicKey[], commitment?: web3.Commitment): this;
51
- waitForResult(): Promise<_AccountCache>;
52
- }
53
- export {};
54
- //# sourceMappingURL=AccountCache.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AccountCache.d.ts","sourceRoot":"","sources":["../../../../src/classes/account-cache/AccountCache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AAExC,KAAK,mBAAmB,GAAG;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;CAChC,CAAA;AAED,KAAK,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;AAEzD,8BAAsB,YAAY;IAmB9B,SAAS,CAAC,UAAU,EAAE,IAAI,CAAC,UAAU;IAjBvC;;OAEG;IACH,SAAS,CAAC,MAAM,CAAC,QAAQ,EAAE,aAAa,CAAM;IAE9C;;;OAGG;IACH,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAQ;IAE/C;;;;OAIG;gBAES,UAAU,EAAE,IAAI,CAAC,UAAU;IAGvC;;OAEG;IACH,SAAS,CAAC,QAAQ,CAAC,yBAAyB,IAAI,IAAI,CAAC,SAAS,EAAE;IAEhE;;OAEG;IACH,SAAS,CAAC,QAAQ,CAAC,cAAc,IAAI,OAAO;IAE5C;;;;;OAKG;IACH,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,SAAS,GAAG,mBAAmB,GAAG,SAAS;IAIhE;;OAEG;IACH,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,SAAS,EAAE,GAAG,IAAI;IASxC;;;;;;OAMG;IACH,8BAA8B,CAAC,OAAO,EAAE,IAAI,CAAC,SAAS,EAAE,EAAE,UAAU,GAAE,IAAI,CAAC,UAAwB,GAAG,IAAI;IA2CpG,aAAa,IAAI,OAAO,CAAC,aAAa,CAAC;CAM9C"}
@@ -1,143 +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 () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
36
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
37
- return new (P || (P = Promise))(function (resolve, reject) {
38
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
39
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
40
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
41
- step((generator = generator.apply(thisArg, _arguments || [])).next());
42
- });
43
- };
44
- Object.defineProperty(exports, "__esModule", { value: true });
45
- exports.AccountCache = void 0;
46
- const web3 = __importStar(require("@solana/web3.js"));
47
- class AccountCache {
48
- /**
49
- * Instantiate the AccountCache class
50
- *
51
- * @param connection - The connection to the blockchain.
52
- */
53
- constructor(connection) {
54
- this.connection = connection;
55
- /**
56
- * Promise that resolves when the accounts are fetched.
57
- * This is used to wait for the accounts to be fetched before using them.
58
- */
59
- this.pending = null;
60
- }
61
- /**
62
- * Get account info from cache
63
- *
64
- * @param key
65
- * @returns
66
- */
67
- static get(key) {
68
- return AccountCache.accounts[key.toString()];
69
- }
70
- /**
71
- * Mark accounts to be refetched
72
- */
73
- refetch(pubkeys) {
74
- for (const pubkey of pubkeys) {
75
- if (!!AccountCache.accounts[pubkey.toString()]) {
76
- AccountCache.accounts[pubkey.toString()].refetch = true;
77
- }
78
- }
79
- return this;
80
- }
81
- /**
82
- * The goal of this function is to batch 100 accounts at a time as it is the max number of accounts that can be fetched at once.
83
- * Skips accounts that are already fetched.
84
- *
85
- * @param pubkeys - The accounts to fetch.
86
- * @returns - A promise that resolves to an array of TokenAccountInfo objects.
87
- */
88
- getBatchedMultipleAccountsInfo(pubkeys, commitment = "confirmed") {
89
- // Check first if account is already fetched. Skips accounts that are marked to be refetched.
90
- const pubkeysToFetch = pubkeys.filter(pubkey => {
91
- const cache = AccountCache.accounts[pubkey.toString()];
92
- if (cache) {
93
- return cache.refetch;
94
- }
95
- return true;
96
- });
97
- const batchSize = 100;
98
- const batches = [];
99
- for (let i = 0; i < pubkeysToFetch.length; i += batchSize) {
100
- batches.push(pubkeysToFetch.slice(i, i + batchSize));
101
- }
102
- const pending = Promise.all(batches.map(batch => this.connection.getMultipleAccountsInfo(batch, commitment))).then(batch => {
103
- const result = batch.flat();
104
- for (let i = 0; i < result.length; i++) {
105
- const pubkey = pubkeysToFetch[i];
106
- const info = result[i];
107
- if (info !== null) {
108
- // Throw error if account fetching requires program ownership
109
- const mustBeOwnedByEither = this.mustOwnedByEitherPrograms();
110
- const requiredToExist = this.requireToExist();
111
- const doesNotExist = info.owner.equals(web3.SystemProgram.programId) && info.data.length === 0;
112
- if (doesNotExist && !requiredToExist) {
113
- return;
114
- }
115
- else if (mustBeOwnedByEither.length > 0 && !mustBeOwnedByEither.some(program => info.owner.equals(program))) {
116
- throw new Error(`Account ${pubkey.toString()} is not owned by any of the programs ${mustBeOwnedByEither.map(program => program.toString()).join(", ")}`);
117
- }
118
- else {
119
- AccountCache.accounts[pubkey.toString()] = { refetch: false, info };
120
- }
121
- }
122
- else if (this.requireToExist()) {
123
- throw new Error(`Account ${pubkey.toString()} does not exist`);
124
- }
125
- }
126
- });
127
- this.pending = pending;
128
- return this;
129
- }
130
- waitForResult() {
131
- return __awaiter(this, void 0, void 0, function* () {
132
- if (this.pending) {
133
- yield this.pending;
134
- }
135
- return AccountCache.accounts;
136
- });
137
- }
138
- }
139
- exports.AccountCache = AccountCache;
140
- /**
141
- * Cache of accounts.
142
- */
143
- AccountCache.accounts = {};
@@ -1,33 +0,0 @@
1
- import * as web3 from "@solana/web3.js";
2
- import { AccountCache } from "./AccountCache";
3
- /**
4
- * Singleton instance of AccountCache for mint accounts.
5
- */
6
- export declare class MintCache extends AccountCache {
7
- /**
8
- * Singleton instance of MintCache
9
- */
10
- private static _instance;
11
- /**
12
- * Instantiate the MintCache class
13
- *
14
- * @param connection The Solana connection
15
- */
16
- private constructor();
17
- /**
18
- * Get the singleton instance of MintCache
19
- *
20
- * @param connection The Solana connection
21
- * @returns The MintCache instance
22
- */
23
- static instance(connection: web3.Connection): MintCache;
24
- /**
25
- * Criteria of accounts to be fetched must be only owned by the given programs
26
- */
27
- protected mustOwnedByEitherPrograms(): web3.PublicKey[];
28
- /**
29
- * Whether the account query should require the account to exist.
30
- */
31
- protected requireToExist(): boolean;
32
- }
33
- //# sourceMappingURL=MintCache.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MintCache.d.ts","sourceRoot":"","sources":["../../../../src/classes/account-cache/MintCache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C;;GAEG;AACH,qBAAa,SAAU,SAAQ,YAAY;IAEzC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,SAAS,CAA0B;IAElD;;;;OAIG;IACH,OAAO;IAIP;;;;;OAKG;IACH,MAAM,CAAC,QAAQ,CAAC,UAAU,EAAE,IAAI,CAAC,UAAU,GAAG,SAAS;IAOvD;;OAEG;IACH,SAAS,CAAC,yBAAyB,IAAI,IAAI,CAAC,SAAS,EAAE;IAIvD;;OAEG;IACH,SAAS,CAAC,cAAc,IAAI,OAAO;CAGpC"}
@@ -1,47 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MintCache = void 0;
4
- const AccountCache_1 = require("./AccountCache");
5
- const spl_token_1 = require("@solana/spl-token");
6
- /**
7
- * Singleton instance of AccountCache for mint accounts.
8
- */
9
- class MintCache extends AccountCache_1.AccountCache {
10
- /**
11
- * Instantiate the MintCache class
12
- *
13
- * @param connection The Solana connection
14
- */
15
- constructor(connection) {
16
- super(connection);
17
- }
18
- /**
19
- * Get the singleton instance of MintCache
20
- *
21
- * @param connection The Solana connection
22
- * @returns The MintCache instance
23
- */
24
- static instance(connection) {
25
- if (!MintCache._instance) {
26
- MintCache._instance = new MintCache(connection);
27
- }
28
- return MintCache._instance;
29
- }
30
- /**
31
- * Criteria of accounts to be fetched must be only owned by the given programs
32
- */
33
- mustOwnedByEitherPrograms() {
34
- return [spl_token_1.TOKEN_PROGRAM_ID, spl_token_1.TOKEN_2022_PROGRAM_ID];
35
- }
36
- /**
37
- * Whether the account query should require the account to exist.
38
- */
39
- requireToExist() {
40
- return true;
41
- }
42
- }
43
- exports.MintCache = MintCache;
44
- /**
45
- * Singleton instance of MintCache
46
- */
47
- MintCache._instance = null;
@@ -1,33 +0,0 @@
1
- import * as web3 from "@solana/web3.js";
2
- import { AccountCache } from "./AccountCache";
3
- /**
4
- * Singleton instance of AccountCache for mint accounts.
5
- */
6
- export declare class TokenCache extends AccountCache {
7
- /**
8
- * Singleton instance of TokenCache
9
- */
10
- private static _instance;
11
- /**
12
- * Instantiate the TokenCache class
13
- *
14
- * @param connection The Solana connection
15
- */
16
- private constructor();
17
- /**
18
- * Get the singleton instance of TokenCache
19
- *
20
- * @param connection The Solana connection
21
- * @returns The TokenCache instance
22
- */
23
- static instance(connection: web3.Connection): TokenCache;
24
- /**
25
- * Criteria of accounts to be fetched must be only owned by the given programs
26
- */
27
- protected mustOwnedByEitherPrograms(): web3.PublicKey[];
28
- /**
29
- * Whether the account query should require the account to exist.
30
- */
31
- protected requireToExist(): boolean;
32
- }
33
- //# sourceMappingURL=TokenCache.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TokenCache.d.ts","sourceRoot":"","sources":["../../../../src/classes/account-cache/TokenCache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C;;GAEG;AACH,qBAAa,UAAW,SAAQ,YAAY;IAE1C;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,SAAS,CAA2B;IAEnD;;;;OAIG;IACH,OAAO;IAIP;;;;;OAKG;IACH,MAAM,CAAC,QAAQ,CAAC,UAAU,EAAE,IAAI,CAAC,UAAU,GAAG,UAAU;IAOxD;;OAEG;IACH,SAAS,CAAC,yBAAyB,IAAI,IAAI,CAAC,SAAS,EAAE;IAIvD;;OAEG;IACH,SAAS,CAAC,cAAc,IAAI,OAAO;CAGpC"}
@@ -1,47 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TokenCache = void 0;
4
- const AccountCache_1 = require("./AccountCache");
5
- const spl_token_1 = require("@solana/spl-token");
6
- /**
7
- * Singleton instance of AccountCache for mint accounts.
8
- */
9
- class TokenCache extends AccountCache_1.AccountCache {
10
- /**
11
- * Instantiate the TokenCache class
12
- *
13
- * @param connection The Solana connection
14
- */
15
- constructor(connection) {
16
- super(connection);
17
- }
18
- /**
19
- * Get the singleton instance of TokenCache
20
- *
21
- * @param connection The Solana connection
22
- * @returns The TokenCache instance
23
- */
24
- static instance(connection) {
25
- if (!TokenCache._instance) {
26
- TokenCache._instance = new TokenCache(connection);
27
- }
28
- return TokenCache._instance;
29
- }
30
- /**
31
- * Criteria of accounts to be fetched must be only owned by the given programs
32
- */
33
- mustOwnedByEitherPrograms() {
34
- return [spl_token_1.TOKEN_PROGRAM_ID, spl_token_1.TOKEN_2022_PROGRAM_ID];
35
- }
36
- /**
37
- * Whether the account query should require the account to exist.
38
- */
39
- requireToExist() {
40
- return false;
41
- }
42
- }
43
- exports.TokenCache = TokenCache;
44
- /**
45
- * Singleton instance of TokenCache
46
- */
47
- TokenCache._instance = null;
@@ -1,13 +0,0 @@
1
- export declare class AppError extends Error {
2
- readonly isErrorHandled: boolean;
3
- readonly stackTrace: string[];
4
- readonly errorMsg: string;
5
- constructor(message: string, _module: string, stackTrace?: string);
6
- static handleErrorAsync<T>(fn: () => Promise<T>): Promise<T>;
7
- static handleErrorSync<T>(fn: () => T): T;
8
- }
9
- export declare class UniversalErrorHandler {
10
- static catchErrorsAsync<T>(moduleName: string, fn: () => Promise<T>): Promise<T>;
11
- static catchErrorsSync<T>(moduleName: string, fn: () => T): T;
12
- }
13
- //# sourceMappingURL=errors.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":"AAEA,qBAAa,QAAS,SAAQ,KAAK;IAEjC,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAQ;IACxC,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,CAAC;IAC9B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;gBAEd,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM;WAgCpD,gBAAgB,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IASlE,MAAM,CAAC,eAAe,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC;CAQ1C;AAGD,qBAAa,qBAAqB;WACnB,gBAAgB,CAAC,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IAatF,MAAM,CAAC,eAAe,CAAC,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC;CAY9D"}