@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,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,37 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,114 +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.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;
@@ -1,21 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,40 +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.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;
@@ -1,13 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,50 +0,0 @@
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
- }
@@ -1,75 +0,0 @@
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
@@ -1 +0,0 @@
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"}