@hawksightco/hawk-sdk 1.3.265 → 1.3.267

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/dist/addresses.d.ts +37 -0
  2. package/dist/addresses.d.ts.map +1 -0
  3. package/dist/addresses.js +84 -0
  4. package/dist/anchor.d.ts +22 -0
  5. package/dist/anchor.d.ts.map +1 -0
  6. package/dist/anchor.js +121 -0
  7. package/dist/classes/AltStorage.d.ts +29 -0
  8. package/dist/classes/AltStorage.d.ts.map +1 -0
  9. package/dist/classes/AltStorage.js +58 -0
  10. package/dist/classes/Atomicity.d.ts +34 -0
  11. package/dist/classes/Atomicity.d.ts.map +1 -0
  12. package/dist/classes/Atomicity.js +110 -0
  13. package/dist/classes/Client.d.ts +35 -0
  14. package/dist/classes/Client.d.ts.map +1 -0
  15. package/dist/classes/Client.js +66 -0
  16. package/dist/classes/CombineTransactions.d.ts +11 -0
  17. package/dist/classes/CombineTransactions.d.ts.map +1 -0
  18. package/dist/classes/CombineTransactions.js +58 -0
  19. package/dist/classes/CreateTxMetadata.d.ts +100 -0
  20. package/dist/classes/CreateTxMetadata.d.ts.map +1 -0
  21. package/dist/classes/CreateTxMetadata.js +415 -0
  22. package/dist/classes/General.d.ts +87 -0
  23. package/dist/classes/General.d.ts.map +1 -0
  24. package/dist/classes/General.js +176 -0
  25. package/dist/classes/GeneralUtility.d.ts +79 -0
  26. package/dist/classes/GeneralUtility.d.ts.map +1 -0
  27. package/dist/classes/GeneralUtility.js +121 -0
  28. package/dist/classes/HawkAPI.d.ts +122 -0
  29. package/dist/classes/HawkAPI.d.ts.map +1 -0
  30. package/dist/classes/HawkAPI.js +169 -0
  31. package/dist/classes/Health.d.ts +29 -0
  32. package/dist/classes/Health.d.ts.map +1 -0
  33. package/dist/classes/Health.js +48 -0
  34. package/dist/classes/JupiterAlts.d.ts +37 -0
  35. package/dist/classes/JupiterAlts.d.ts.map +1 -0
  36. package/dist/classes/JupiterAlts.js +114 -0
  37. package/dist/classes/JupiterSwap.d.ts +21 -0
  38. package/dist/classes/JupiterSwap.d.ts.map +1 -0
  39. package/dist/classes/JupiterSwap.js +40 -0
  40. package/dist/classes/Logging.d.ts +13 -0
  41. package/dist/classes/Logging.d.ts.map +1 -0
  42. package/dist/classes/Logging.js +50 -0
  43. package/dist/classes/MultiTransaction.d.ts +75 -0
  44. package/dist/classes/MultiTransaction.d.ts.map +1 -0
  45. package/dist/classes/MultiTransaction.js +296 -0
  46. package/dist/classes/RaydiumSDK.d.ts +67 -0
  47. package/dist/classes/RaydiumSDK.d.ts.map +1 -0
  48. package/dist/classes/RaydiumSDK.js +206 -0
  49. package/dist/classes/Search.d.ts +100 -0
  50. package/dist/classes/Search.d.ts.map +1 -0
  51. package/dist/classes/Search.js +216 -0
  52. package/dist/classes/SimpleIxGenerator.d.ts +57 -0
  53. package/dist/classes/SimpleIxGenerator.d.ts.map +1 -0
  54. package/dist/classes/SimpleIxGenerator.js +62 -0
  55. package/dist/classes/SimplePdaGenerator.d.ts +28 -0
  56. package/dist/classes/SimplePdaGenerator.d.ts.map +1 -0
  57. package/dist/classes/SimplePdaGenerator.js +33 -0
  58. package/dist/classes/Transaction.d.ts +229 -0
  59. package/dist/classes/Transaction.d.ts.map +1 -0
  60. package/dist/classes/Transaction.js +643 -0
  61. package/dist/classes/Transaction2.d.ts +107 -0
  62. package/dist/classes/Transaction2.d.ts.map +1 -0
  63. package/dist/classes/Transaction2.js +249 -0
  64. package/dist/classes/Transaction3.d.ts +165 -0
  65. package/dist/classes/Transaction3.d.ts.map +1 -0
  66. package/dist/classes/Transaction3.js +416 -0
  67. package/dist/classes/TransactionBatchExecute.d.ts +163 -0
  68. package/dist/classes/TransactionBatchExecute.d.ts.map +1 -0
  69. package/dist/classes/TransactionBatchExecute.js +466 -0
  70. package/dist/classes/TransactionBatchExecute2.d.ts +99 -0
  71. package/dist/classes/TransactionBatchExecute2.d.ts.map +1 -0
  72. package/dist/classes/TransactionBatchExecute2.js +357 -0
  73. package/dist/classes/Transactions.d.ts +586 -0
  74. package/dist/classes/Transactions.d.ts.map +1 -0
  75. package/dist/classes/Transactions.js +7667 -0
  76. package/dist/classes/TxGenerator.d.ts +350 -0
  77. package/dist/classes/TxGenerator.d.ts.map +1 -0
  78. package/dist/classes/TxGenerator.js +1957 -0
  79. package/dist/classes/TxGeneratorAutomations.d.ts +186 -0
  80. package/dist/classes/TxGeneratorAutomations.d.ts.map +1 -0
  81. package/dist/classes/TxGeneratorAutomations.js +897 -0
  82. package/dist/classes/Util.d.ts +87 -0
  83. package/dist/classes/Util.d.ts.map +1 -0
  84. package/dist/classes/Util.js +148 -0
  85. package/dist/classes/account-cache/AccountCache.d.ts +54 -0
  86. package/dist/classes/account-cache/AccountCache.d.ts.map +1 -0
  87. package/dist/classes/account-cache/AccountCache.js +143 -0
  88. package/dist/classes/account-cache/MintCache.d.ts +33 -0
  89. package/dist/classes/account-cache/MintCache.d.ts.map +1 -0
  90. package/dist/classes/account-cache/MintCache.js +47 -0
  91. package/dist/classes/account-cache/TokenCache.d.ts +33 -0
  92. package/dist/classes/account-cache/TokenCache.d.ts.map +1 -0
  93. package/dist/classes/account-cache/TokenCache.js +47 -0
  94. package/dist/errors.d.ts +13 -0
  95. package/dist/errors.d.ts.map +1 -0
  96. package/dist/errors.js +96 -0
  97. package/dist/functions.d.ts +514 -0
  98. package/dist/functions.d.ts.map +1 -0
  99. package/dist/functions.js +1636 -0
  100. package/dist/hawksight.d.ts +53 -0
  101. package/dist/hawksight.d.ts.map +1 -0
  102. package/dist/hawksight.js +328 -0
  103. package/dist/hsToMeteora.d.ts +31 -0
  104. package/dist/hsToMeteora.d.ts.map +1 -0
  105. package/dist/hsToMeteora.js +3175 -0
  106. package/dist/idl/iyf-extension-idl.d.ts +14583 -0
  107. package/dist/idl/iyf-extension-idl.d.ts.map +1 -0
  108. package/dist/idl/iyf-extension-idl.js +14578 -0
  109. package/dist/idl/iyf-extension-wrapper.d.ts +112 -0
  110. package/dist/idl/iyf-extension-wrapper.d.ts.map +1 -0
  111. package/dist/idl/iyf-extension-wrapper.js +2 -0
  112. package/dist/idl/iyf-main-idl.d.ts +12078 -0
  113. package/dist/idl/iyf-main-idl.d.ts.map +1 -0
  114. package/dist/idl/iyf-main-idl.js +12073 -0
  115. package/dist/idl/iyf-main-wrapper.d.ts +112 -0
  116. package/dist/idl/iyf-main-wrapper.d.ts.map +1 -0
  117. package/dist/idl/iyf-main-wrapper.js +2 -0
  118. package/dist/idl/jupiter-idl.d.ts +3063 -0
  119. package/dist/idl/jupiter-idl.d.ts.map +1 -0
  120. package/dist/idl/jupiter-idl.js +3061 -0
  121. package/dist/idl/meteora-idl.d.ts +7371 -0
  122. package/dist/idl/meteora-idl.d.ts.map +1 -0
  123. package/dist/idl/meteora-idl.js +7372 -0
  124. package/dist/idl/orca-idl.d.ts +3833 -0
  125. package/dist/idl/orca-idl.d.ts.map +1 -0
  126. package/dist/idl/orca-idl.js +3834 -0
  127. package/dist/idl/raydium-idl.d.ts +3054 -0
  128. package/dist/idl/raydium-idl.d.ts.map +1 -0
  129. package/dist/idl/raydium-idl.js +3055 -0
  130. package/dist/index.d.ts +9 -0
  131. package/dist/index.d.ts.map +1 -0
  132. package/dist/index.js +31 -0
  133. package/dist/ixGenerator/IyfExtensionIxGenerator.d.ts +126 -0
  134. package/dist/ixGenerator/IyfExtensionIxGenerator.d.ts.map +1 -0
  135. package/dist/ixGenerator/IyfExtensionIxGenerator.js +467 -0
  136. package/dist/ixGenerator/IyfMainIxGenerator.d.ts +330 -0
  137. package/dist/ixGenerator/IyfMainIxGenerator.d.ts.map +1 -0
  138. package/dist/ixGenerator/IyfMainIxGenerator.js +1239 -0
  139. package/dist/ixGenerator/MeteoraDlmmIxGenerator.d.ts +685 -0
  140. package/dist/ixGenerator/MeteoraDlmmIxGenerator.d.ts.map +1 -0
  141. package/dist/ixGenerator/MeteoraDlmmIxGenerator.js +3008 -0
  142. package/dist/ixGenerator/OrcaIxGenerator.d.ts +119 -0
  143. package/dist/ixGenerator/OrcaIxGenerator.d.ts.map +1 -0
  144. package/dist/ixGenerator/OrcaIxGenerator.js +438 -0
  145. package/dist/ixGenerator/RaydiumIxGenerator.d.ts +99 -0
  146. package/dist/ixGenerator/RaydiumIxGenerator.d.ts.map +1 -0
  147. package/dist/ixGenerator/RaydiumIxGenerator.js +558 -0
  148. package/dist/ixGenerator/UtilIxGenerator.d.ts +20 -0
  149. package/dist/ixGenerator/UtilIxGenerator.d.ts.map +1 -0
  150. package/dist/ixGenerator/UtilIxGenerator.js +25 -0
  151. package/dist/meteora/index.d.ts +2 -0
  152. package/dist/meteora/index.d.ts.map +1 -0
  153. package/dist/meteora/index.js +17 -0
  154. package/dist/meteora/liquidityStrategy.d.ts +408 -0
  155. package/dist/meteora/liquidityStrategy.d.ts.map +1 -0
  156. package/dist/meteora/liquidityStrategy.js +1325 -0
  157. package/dist/meteora.d.ts +669 -0
  158. package/dist/meteora.d.ts.map +1 -0
  159. package/dist/meteora.js +1932 -0
  160. package/dist/orca.d.ts +57 -0
  161. package/dist/orca.d.ts.map +1 -0
  162. package/dist/orca.js +123 -0
  163. package/dist/pdaGenerator/HawksightPdaGenerator.d.ts +29 -0
  164. package/dist/pdaGenerator/HawksightPdaGenerator.d.ts.map +1 -0
  165. package/dist/pdaGenerator/HawksightPdaGenerator.js +75 -0
  166. package/dist/pdaGenerator/MeteoraPdaGenerator.d.ts +76 -0
  167. package/dist/pdaGenerator/MeteoraPdaGenerator.d.ts.map +1 -0
  168. package/dist/pdaGenerator/MeteoraPdaGenerator.js +166 -0
  169. package/dist/pdaGenerator/OrcaPdaGenerator.d.ts +23 -0
  170. package/dist/pdaGenerator/OrcaPdaGenerator.d.ts.map +1 -0
  171. package/dist/pdaGenerator/OrcaPdaGenerator.js +68 -0
  172. package/dist/pdaGenerator/RaydiumPdaGenerator.d.ts +49 -0
  173. package/dist/pdaGenerator/RaydiumPdaGenerator.d.ts.map +1 -0
  174. package/dist/pdaGenerator/RaydiumPdaGenerator.js +114 -0
  175. package/dist/pdaGenerator/UtilPdaGenerator.d.ts +8 -0
  176. package/dist/pdaGenerator/UtilPdaGenerator.d.ts.map +1 -0
  177. package/dist/pdaGenerator/UtilPdaGenerator.js +51 -0
  178. package/dist/types.d.ts +1104 -0
  179. package/dist/types.d.ts.map +1 -0
  180. package/dist/types.js +95 -0
  181. package/package.json +6 -5
@@ -0,0 +1,29 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,48 @@
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;
@@ -0,0 +1,37 @@
1
+ import * as web3 from "@solana/web3.js";
2
+ export type Alts = Record<string, string>;
3
+ export declare class JupiterAlts {
4
+ private username?;
5
+ private password?;
6
+ private hash?;
7
+ private url?;
8
+ private _alts;
9
+ /**
10
+ * Return jupiter alts object
11
+ */
12
+ get alts(): Alts;
13
+ /**
14
+ * Set API URL
15
+ */
16
+ setApiUrl(url: string): void;
17
+ /**
18
+ * Find address lookup table from given public keys
19
+ *
20
+ * @param pubkeys
21
+ */
22
+ findAltByPubkeys(pubkeys: web3.PublicKey[]): web3.PublicKey[];
23
+ /**
24
+ * Set server credentials
25
+ *
26
+ * @param username
27
+ * @param password
28
+ */
29
+ setCredentials(username: string, password: string): void;
30
+ /**
31
+ * Download jupiter alts from endpoint
32
+ *
33
+ * @returns
34
+ */
35
+ downloadAlts(): Promise<void>;
36
+ }
37
+ //# sourceMappingURL=JupiterAlts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"JupiterAlts.d.ts","sourceRoot":"","sources":["../../src/classes/JupiterAlts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AAExC,MAAM,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAE1C,qBAAa,WAAW;IACtB,OAAO,CAAC,QAAQ,CAAC,CAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,CAAS;IAC1B,OAAO,CAAC,IAAI,CAAC,CAAS;IACtB,OAAO,CAAC,GAAG,CAAC,CAAS;IACrB,OAAO,CAAC,KAAK,CAAY;IAEzB;;OAEG;IACH,IAAI,IAAI,IAAI,IAAI,CAEf;IAED;;OAEG;IACH,SAAS,CAAC,GAAG,EAAE,MAAM;IAIrB;;;;OAIG;IACH,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,SAAS,EAAE,GAAG,IAAI,CAAC,SAAS,EAAE;IAW7D;;;;;OAKG;IACH,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;IAKjD;;;;OAIG;IACG,YAAY;CAsBnB"}
@@ -0,0 +1,114 @@
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.JupiterAlts = void 0;
46
+ const web3 = __importStar(require("@solana/web3.js"));
47
+ class JupiterAlts {
48
+ constructor() {
49
+ this._alts = {};
50
+ }
51
+ /**
52
+ * Return jupiter alts object
53
+ */
54
+ get alts() {
55
+ return this._alts;
56
+ }
57
+ /**
58
+ * Set API URL
59
+ */
60
+ setApiUrl(url) {
61
+ this.url = url;
62
+ }
63
+ /**
64
+ * Find address lookup table from given public keys
65
+ *
66
+ * @param pubkeys
67
+ */
68
+ findAltByPubkeys(pubkeys) {
69
+ const alts = [];
70
+ for (const pubkey of pubkeys) {
71
+ const alt = this._alts[pubkey.toBase58()];
72
+ if (alt !== undefined) {
73
+ alts.push(new web3.PublicKey(alt));
74
+ }
75
+ }
76
+ return alts;
77
+ }
78
+ /**
79
+ * Set server credentials
80
+ *
81
+ * @param username
82
+ * @param password
83
+ */
84
+ setCredentials(username, password) {
85
+ this.username = username;
86
+ this.password = password;
87
+ }
88
+ /**
89
+ * Download jupiter alts from endpoint
90
+ *
91
+ * @returns
92
+ */
93
+ downloadAlts() {
94
+ return __awaiter(this, void 0, void 0, function* () {
95
+ if (this.url === undefined) {
96
+ throw new Error('Please set endpoint URL via hawkAPI.jupAlts.setApiUrl first!');
97
+ }
98
+ if (this.username === undefined || this.password === undefined) {
99
+ throw new Error('Please set credentials via hawkAPI.jupAlts.setCredentials() first!');
100
+ }
101
+ const base64Credentials = btoa(`${this.username}:${this.password}`);
102
+ const hash = yield (yield fetch(this.url, { headers: { Authorization: `Basic ${base64Credentials}`, Range: 'bytes=9-72' } })).text();
103
+ // If hash matches, then no need to download the file.
104
+ if (this.hash === hash)
105
+ return;
106
+ // Otherwise, download the alts
107
+ const response = yield fetch(this.url, { headers: { Authorization: `Basic ${base64Credentials}` } });
108
+ const content = yield response.text();
109
+ const jsonString = content.slice(82, content.length - 1);
110
+ this._alts = JSON.parse(jsonString);
111
+ });
112
+ }
113
+ }
114
+ exports.JupiterAlts = JupiterAlts;
@@ -0,0 +1,21 @@
1
+ import * as web3 from "@solana/web3.js";
2
+ import { SimpleIxGenerator } from "./SimpleIxGenerator";
3
+ import BN from "bn.js";
4
+ import { JupiterRouteIxReturn } from '../ixGenerator/IyfMainIxGenerator';
5
+ type JupiterIxToHawksight = {
6
+ connection: web3.Connection;
7
+ userWallet?: web3.PublicKey;
8
+ swapInstruction: web3.TransactionInstruction;
9
+ slippageBpsOverride?: number;
10
+ slippageOutPct?: number;
11
+ platformFeeBpsOverride?: number;
12
+ quotedOutAmount_override?: BN;
13
+ isWalletSigner?: boolean;
14
+ };
15
+ export declare class JupiterSwap {
16
+ private ix;
17
+ constructor(ix: SimpleIxGenerator);
18
+ jupiterIxToHawksight({ connection, userWallet, swapInstruction, quotedOutAmount_override, slippageOutPct, slippageBpsOverride, platformFeeBpsOverride, isWalletSigner }: JupiterIxToHawksight): Promise<JupiterRouteIxReturn>;
19
+ }
20
+ export {};
21
+ //# sourceMappingURL=JupiterSwap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"JupiterSwap.d.ts","sourceRoot":"","sources":["../../src/classes/JupiterSwap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,MAAM,OAAO,CAAC;AACvB,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAEzE,KAAK,oBAAoB,GAAG;IAC1B,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC;IAC5B,UAAU,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC;IAC5B,eAAe,EAAE,IAAI,CAAC,sBAAsB,CAAC;IAC7C,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,wBAAwB,CAAC,EAAE,EAAE,CAAC;IAC9B,cAAc,CAAC,EAAE,OAAO,CAAC;CAE1B,CAAC;AAEF,qBAAa,WAAW;IAGpB,OAAO,CAAC,EAAE;gBAAF,EAAE,EAAE,iBAAiB;IAGzB,oBAAoB,CAAC,EAAC,UAAU,EAAE,UAAU,EAAC,eAAe,EAAE,wBAAwB,EAAE,cAAc,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,cAAc,EAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,oBAAoB,CAAC;CAoBjO"}
@@ -0,0 +1,40 @@
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.JupiterSwap = void 0;
13
+ class JupiterSwap {
14
+ constructor(ix) {
15
+ this.ix = ix;
16
+ }
17
+ jupiterIxToHawksight(_a) {
18
+ return __awaiter(this, arguments, void 0, function* ({ connection, userWallet, swapInstruction, quotedOutAmount_override, slippageOutPct, slippageBpsOverride, platformFeeBpsOverride, isWalletSigner }) {
19
+ return yield this.ix.iyfMain.jupiterRouteIx({
20
+ connection,
21
+ userWallet: userWallet,
22
+ userPda: swapInstruction.keys[1].pubkey,
23
+ sourceTokenAccount: swapInstruction.keys[2].pubkey,
24
+ destinationTokenAccount: swapInstruction.keys[3].pubkey,
25
+ destinationMint: swapInstruction.keys[5].pubkey,
26
+ platformFeeAccount: swapInstruction.keys[6].pubkey,
27
+ eventAuthority: swapInstruction.keys[7].pubkey,
28
+ remainingAccounts: swapInstruction.keys.slice(9),
29
+ data: swapInstruction.data,
30
+ quotedOutAmount_override,
31
+ slippageOutPct,
32
+ slippageBps: slippageBpsOverride,
33
+ platformFeeBps: platformFeeBpsOverride,
34
+ isWalletSigner: isWalletSigner,
35
+ // checkDestinationTokenAccount,
36
+ });
37
+ });
38
+ }
39
+ }
40
+ exports.JupiterSwap = JupiterSwap;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Log to console
3
+ *
4
+ * @param msg
5
+ */
6
+ export declare function Log(...msg: any): void;
7
+ /**
8
+ * Whether enable logging or not
9
+ *
10
+ * @param flag
11
+ */
12
+ export declare function logging(flag: boolean): void;
13
+ //# sourceMappingURL=Logging.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Logging.d.ts","sourceRoot":"","sources":["../../src/classes/Logging.ts"],"names":[],"mappings":"AAuCA;;;;GAIG;AACH,wBAAgB,GAAG,CAAC,GAAG,GAAG,EAAE,GAAG,QAE9B;AAED;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,OAAO,QAEpC"}
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Log = Log;
4
+ exports.logging = logging;
5
+ class Logging {
6
+ /**
7
+ * Prevent multiple instance of this class
8
+ */
9
+ constructor() {
10
+ /**
11
+ * Whether logging is enabled
12
+ */
13
+ this.enabled = true;
14
+ }
15
+ /**
16
+ * Create / get the singleton instance
17
+ */
18
+ static instance() {
19
+ if (this._instance === undefined) {
20
+ this._instance = new Logging();
21
+ }
22
+ return this._instance;
23
+ }
24
+ /**
25
+ * Log to console
26
+ *
27
+ * @param msg Message to log
28
+ */
29
+ log(...msg) {
30
+ if (this.enabled) {
31
+ console.log(...msg);
32
+ }
33
+ }
34
+ }
35
+ /**
36
+ * Log to console
37
+ *
38
+ * @param msg
39
+ */
40
+ function Log(...msg) {
41
+ Logging.instance().log(...msg);
42
+ }
43
+ /**
44
+ * Whether enable logging or not
45
+ *
46
+ * @param flag
47
+ */
48
+ function logging(flag) {
49
+ Logging.instance().enabled = flag;
50
+ }
@@ -0,0 +1,75 @@
1
+ import * as web3 from "@solana/web3.js";
2
+ import * as client from "@hawksightco/swagger-client";
3
+ import { GeneralUtility } from "./GeneralUtility";
4
+ import { SendSignedTx, SignerPlugin, SignerPlugin2 } from "../types";
5
+ type CreateDurableNonceAccountOpts = {
6
+ userSignedFn: () => void;
7
+ userDidntSignedFn: () => void;
8
+ successFn: (txid: string) => void;
9
+ failedFn: (message: string, logToMixpanel: boolean) => void;
10
+ };
11
+ type SignAndSendOpts = {
12
+ userSignedFn: () => void;
13
+ userDidntSignedFn: () => void;
14
+ successFn: (txids: string[]) => void;
15
+ failedFn: (message: string, logToMixpanel: boolean) => void;
16
+ };
17
+ export declare class MultiTransaction {
18
+ readonly description: string;
19
+ readonly generalUtility: GeneralUtility;
20
+ latestBlockhash: {
21
+ blockhash: web3.Blockhash;
22
+ lastValidBlockHeight: number;
23
+ };
24
+ readonly payerKey: web3.PublicKey;
25
+ private txs;
26
+ private nonceAdvanceIxCount;
27
+ private nonceAccounts;
28
+ /**
29
+ * Get transaction count
30
+ */
31
+ get count(): number;
32
+ constructor(description: string, generalUtility: GeneralUtility, latestBlockhash: {
33
+ blockhash: web3.Blockhash;
34
+ lastValidBlockHeight: number;
35
+ }, payerKey: web3.PublicKey);
36
+ push(alts: web3.AddressLookupTableAccount[], ixs: web3.TransactionInstruction[]): void;
37
+ getPayerOwnedNonceAccounts(connection: web3.Connection): Promise<void>;
38
+ /**
39
+ * Whether there were enough nonce accounts already initialized on-chain
40
+ *
41
+ * @param connection
42
+ * @returns
43
+ */
44
+ hasAvailableNonce(connection: web3.Connection): Promise<boolean>;
45
+ /**
46
+ * Generate a transaction that creates durable nonce account
47
+ *
48
+ * @param connection
49
+ * @returns
50
+ */
51
+ createDurableNonceAccount(connection: web3.Connection, signerFn: SignerPlugin, sendSigned: SendSignedTx, opts: CreateDurableNonceAccountOpts): Promise<boolean>;
52
+ signAndSend(connection: web3.Connection, priorityLevel: client.PriorityLevel, priorityFeeMaxCap: number, signMultipleTransactions: SignerPlugin2, sendSignedTx: SendSignedTx, opts: SignAndSendOpts): Promise<void>;
53
+ private generateTransasctions;
54
+ private transactionInstance;
55
+ /**
56
+ * Generate nonde advance instruction (dummy instruction)
57
+ */
58
+ private nonceAdvanceIx;
59
+ /**
60
+ * Get nonce index
61
+ *
62
+ * @returns
63
+ */
64
+ private getNonceIndex;
65
+ /**
66
+ * Get fee estimate
67
+ *
68
+ * @param priorityLevel
69
+ * @returns
70
+ */
71
+ private getFeeEstimate;
72
+ private getFeeEstimate2;
73
+ }
74
+ export {};
75
+ //# sourceMappingURL=MultiTransaction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MultiTransaction.d.ts","sourceRoot":"","sources":["../../src/classes/MultiTransaction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AACxC,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,EAA+B,MAAM,UAAU,CAAC;AAKlG,KAAK,6BAA6B,GAAG;IACnC,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,iBAAiB,EAAE,MAAM,IAAI,CAAC;IAC9B,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,KAAK,IAAI,CAAC;CAC7D,CAAA;AAED,KAAK,eAAe,GAAG;IACrB,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,iBAAiB,EAAE,MAAM,IAAI,CAAC;IAC9B,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACrC,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,KAAK,IAAI,CAAC;CAC7D,CAAA;AAED,qBAAa,gBAAgB;IAczB,QAAQ,CAAC,WAAW,EAAE,MAAM;IAC5B,QAAQ,CAAC,cAAc,EAAE,cAAc;IAChC,eAAe,EAAE;QACtB,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC;QAC1B,oBAAoB,EAAE,MAAM,CAAA;KAC7B;IACD,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS;IAlBnC,OAAO,CAAC,GAAG,CAAgF;IAC3F,OAAO,CAAC,mBAAmB,CAAa;IACxC,OAAO,CAAC,aAAa,CAA6C;IAElE;;OAEG;IACH,IAAI,KAAK,WAER;gBAGU,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,cAAc,EAChC,eAAe,EAAE;QACtB,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC;QAC1B,oBAAoB,EAAE,MAAM,CAAA;KAC7B,EACQ,QAAQ,EAAE,IAAI,CAAC,SAAS;IAGnC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,yBAAyB,EAAE,EAAE,GAAG,EAAE,IAAI,CAAC,sBAAsB,EAAE;IAOzE,0BAA0B,CAAC,UAAU,EAAE,IAAI,CAAC,UAAU;IAI5D;;;;;OAKG;IACG,iBAAiB,CAAC,UAAU,EAAE,IAAI,CAAC,UAAU;IAWnD;;;;;OAKG;IACG,yBAAyB,CAAC,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,IAAI,EAAE,6BAA6B,GAAG,OAAO,CAAC,OAAO,CAAC;IAoE/J,WAAW,CACf,UAAU,EAAE,IAAI,CAAC,UAAU,EAC3B,aAAa,EAAE,MAAM,CAAC,aAAa,EACnC,iBAAiB,EAAE,MAAM,EACzB,wBAAwB,EAAE,aAAa,EACvC,YAAY,EAAE,YAAY,EAC1B,IAAI,EAAE,eAAe;YA+CT,qBAAqB;IA0BnC,OAAO,CAAC,mBAAmB;IAU3B;;OAEG;IACH,OAAO,CAAC,cAAc;IAUtB;;;;OAIG;IACH,OAAO,CAAC,aAAa;IAWrB;;;;;OAKG;YACW,cAAc;YAYd,eAAe;CAc9B"}