@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,53 +0,0 @@
1
- import * as web3 from "@solana/web3.js";
2
- import BN from "bn.js";
3
- import { TokenType } from "./types";
4
- export declare function depositMultipleToken(params: {
5
- connection: web3.Connection;
6
- payer: web3.PublicKey;
7
- deposit: {
8
- mint: web3.PublicKey;
9
- amount: BN;
10
- }[];
11
- }): Promise<web3.TransactionInstruction>;
12
- export declare function depositMultipleTokenV2(params: {
13
- connection: web3.Connection;
14
- payer: web3.PublicKey;
15
- deposit: {
16
- mint: web3.PublicKey;
17
- amount: BN;
18
- }[];
19
- pdaTokenType?: TokenType;
20
- }): Promise<web3.TransactionInstruction>;
21
- export declare function withdrawMultipleToken(params: {
22
- connection: web3.Connection;
23
- payer: web3.PublicKey;
24
- withdraw: {
25
- mint: web3.PublicKey;
26
- }[];
27
- useSta?: boolean;
28
- }): Promise<web3.TransactionInstruction>;
29
- export declare function withdrawMultipleTokenV2(params: {
30
- connection: web3.Connection;
31
- payer: web3.PublicKey;
32
- withdraw: {
33
- mint: web3.PublicKey;
34
- amount: BN;
35
- }[];
36
- useSta?: boolean;
37
- pdaTokenType?: TokenType;
38
- hasAmount?: boolean;
39
- }): Promise<web3.TransactionInstruction>;
40
- export type AtomicityContextParams = {
41
- userWallet: web3.PublicKey;
42
- };
43
- export declare function setTransactionSlot({ userWallet }: AtomicityContextParams): Promise<web3.TransactionInstruction>;
44
- export type VerifyTransactionSlotParams = {
45
- userWallet: web3.PublicKey;
46
- };
47
- export declare function verifyTransactionSlot({ userWallet }: AtomicityContextParams): Promise<web3.TransactionInstruction>;
48
- export type StoreTokenContextParams = {
49
- userWallet: web3.PublicKey;
50
- mint: web3.PublicKey;
51
- };
52
- export declare function storeToken(connection: web3.Connection, params: StoreTokenContextParams): Promise<web3.TransactionInstruction>;
53
- //# sourceMappingURL=hawksight.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hawksight.d.ts","sourceRoot":"","sources":["../../src/hawksight.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,MAAM,OAAO,CAAC;AASvB,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC,wBAAsB,oBAAoB,CAAC,MAAM,EAAE;IACjD,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC;IAC5B,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC;IACtB,OAAO,EAAE;QACP,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;QACrB,MAAM,EAAE,EAAE,CAAC;KACZ,EAAE,CAAC;CACL,wCAkDA;AAED,wBAAsB,sBAAsB,CAAC,MAAM,EAAE;IACnD,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC;IAC5B,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC;IACtB,OAAO,EAAE;QACP,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;QACrB,MAAM,EAAE,EAAE,CAAC;KACZ,EAAE,CAAC;IACJ,YAAY,CAAC,EAAE,SAAS,CAAC;CAC1B,wCA4DA;AAED,wBAAsB,qBAAqB,CAAC,MAAM,EAAE;IAClD,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC;IAC5B,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC;IACtB,QAAQ,EAAE;QACR,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;KACtB,EAAE,CAAC;IACJ,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,wCAiDA;AAED,wBAAsB,uBAAuB,CAAC,MAAM,EAAE;IACpD,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC;IAC5B,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC;IACtB,QAAQ,EAAE;QACR,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;QACrB,MAAM,EAAE,EAAE,CAAC;KACZ,EAAE,CAAC;IACJ,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,wCA4DA;AAED,MAAM,MAAM,sBAAsB,GAAG;IACnC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC;CAC5B,CAAC;AACF,wBAAsB,kBAAkB,CAAC,EAAE,UAAU,EAAE,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAUrH;AAED,MAAM,MAAM,2BAA2B,GAAG;IACxC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC;CAC5B,CAAC;AACF,wBAAsB,qBAAqB,CAAC,EAAE,UAAU,EAAE,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAUxH;AAED,MAAM,MAAM,uBAAuB,GAAG;IACpC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC;IAC3B,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;CACtB,CAAC;AAEF,wBAAsB,UAAU,CAAC,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,MAAM,EAAE,uBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAoBnI"}
@@ -1,328 +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.depositMultipleToken = depositMultipleToken;
46
- exports.depositMultipleTokenV2 = depositMultipleTokenV2;
47
- exports.withdrawMultipleToken = withdrawMultipleToken;
48
- exports.withdrawMultipleTokenV2 = withdrawMultipleTokenV2;
49
- exports.setTransactionSlot = setTransactionSlot;
50
- exports.verifyTransactionSlot = verifyTransactionSlot;
51
- exports.storeToken = storeToken;
52
- const web3 = __importStar(require("@solana/web3.js"));
53
- const anchor_1 = require("./anchor");
54
- const addresses_1 = require("./addresses");
55
- const util = __importStar(require("./functions"));
56
- const types_1 = require("./types");
57
- function depositMultipleToken(params) {
58
- return __awaiter(this, void 0, void 0, function* () {
59
- const farm = addresses_1.USDC_FARM;
60
- const userPda = util.generateUserPda(params.payer, farm);
61
- const amounts = params.deposit.map((d) => d.amount);
62
- const remainingAccounts = [];
63
- // Get mint pubkeys
64
- const mints = params.deposit.map((d) => d.mint);
65
- // Get and assert one token program for all mints.
66
- // Throws an error if there are multiple token programs.
67
- const tokenProgram = yield util.getTokenProgramForMints(params.connection, mints);
68
- params.deposit.map((d) => {
69
- const mint = d.mint;
70
- const userToken = util.generateAta(params.payer, d.mint, tokenProgram);
71
- const ownerFeeToken = util.generateAta(addresses_1.SITE_FEE_OWNER, d.mint, tokenProgram);
72
- const userPdaToken = util.generateAta(userPda, d.mint, tokenProgram);
73
- remainingAccounts.push({ pubkey: mint, isSigner: false, isWritable: true });
74
- remainingAccounts.push({
75
- pubkey: userToken,
76
- isSigner: false,
77
- isWritable: true,
78
- });
79
- remainingAccounts.push({
80
- pubkey: userPdaToken,
81
- isSigner: false,
82
- isWritable: true,
83
- });
84
- remainingAccounts.push({
85
- pubkey: ownerFeeToken,
86
- isSigner: false,
87
- isWritable: true,
88
- });
89
- });
90
- // @ts-ignore
91
- const ix = yield anchor_1.Anchor.instance().iyfMain.methods
92
- .depositMultipleToken(amounts)
93
- .accounts({
94
- farm,
95
- userPda,
96
- payer: params.payer,
97
- hsFeeOwner: addresses_1.SITE_FEE_OWNER,
98
- associatedTokenProgram: addresses_1.ASSOCIATED_TOKEN_PROGRAM,
99
- tokenProgram,
100
- systemProgram: web3.SystemProgram.programId,
101
- })
102
- .remainingAccounts(remainingAccounts)
103
- .instruction();
104
- return ix;
105
- });
106
- }
107
- function depositMultipleTokenV2(params) {
108
- return __awaiter(this, void 0, void 0, function* () {
109
- const farm = addresses_1.USDC_FARM;
110
- const userPda = util.generateUserPda(params.payer, farm);
111
- const amounts = params.deposit.map((d) => d.amount);
112
- const remainingAccounts = [];
113
- // Get mint pubkeys
114
- const mints = params.deposit.map((d) => d.mint);
115
- // Get and assert one token program for all mints.
116
- // Throws an error if there are multiple token programs.
117
- const tokenProgram = yield util.getTokenProgramForMints(params.connection, mints);
118
- let skipIdempotent = false;
119
- params.deposit.map((d) => {
120
- const mint = d.mint;
121
- const userToken = util.generateAta(params.payer, d.mint, tokenProgram);
122
- const ownerFeeToken = util.generateAta(addresses_1.SITE_FEE_OWNER, d.mint, tokenProgram);
123
- let userPdaToken;
124
- if (params.pdaTokenType === types_1.TokenType.LTA) {
125
- skipIdempotent = true;
126
- userPdaToken = util.generateLimitToken(userPda, d.mint);
127
- }
128
- else if (params.pdaTokenType === types_1.TokenType.STA) {
129
- skipIdempotent = true;
130
- userPdaToken = util.generateUserPdaStorageAccount(userPda, d.mint);
131
- }
132
- else {
133
- userPdaToken = util.generateAta(userPda, d.mint, tokenProgram);
134
- }
135
- remainingAccounts.push({ pubkey: mint, isSigner: false, isWritable: true });
136
- remainingAccounts.push({
137
- pubkey: userToken,
138
- isSigner: false,
139
- isWritable: true,
140
- });
141
- remainingAccounts.push({
142
- pubkey: userPdaToken,
143
- isSigner: false,
144
- isWritable: true,
145
- });
146
- remainingAccounts.push({
147
- pubkey: ownerFeeToken,
148
- isSigner: false,
149
- isWritable: true,
150
- });
151
- });
152
- // @ts-ignore
153
- const ix = yield anchor_1.Anchor.instance().iyfMain.methods
154
- .depositMultipleTokenV2(amounts, skipIdempotent)
155
- .accounts({
156
- farm,
157
- userPda,
158
- payer: params.payer,
159
- hsFeeOwner: addresses_1.SITE_FEE_OWNER,
160
- associatedTokenProgram: addresses_1.ASSOCIATED_TOKEN_PROGRAM,
161
- tokenProgram,
162
- systemProgram: web3.SystemProgram.programId,
163
- })
164
- .remainingAccounts(remainingAccounts)
165
- .instruction();
166
- return ix;
167
- });
168
- }
169
- function withdrawMultipleToken(params) {
170
- return __awaiter(this, void 0, void 0, function* () {
171
- const farm = addresses_1.USDC_FARM;
172
- const userPda = util.generateUserPda(params.payer, farm);
173
- const remainingAccounts = [];
174
- // Get mint pubkeys
175
- const mints = params.withdraw.map((d) => d.mint);
176
- // Get and assert one token program for all mints.
177
- // Throws an error if there are multiple token programs.
178
- const tokenProgram = yield util.getTokenProgramForMints(params.connection, mints);
179
- params.withdraw.map((d) => {
180
- const mint = d.mint;
181
- const userToken = util.generateAta(params.payer, d.mint, tokenProgram);
182
- const userPdaToken = params.useSta ? util.generateUserPdaStorageAccount(userPda, d.mint) : util.generateAta(userPda, d.mint, tokenProgram);
183
- const ownerFeeToken = util.generateAta(addresses_1.SITE_FEE_OWNER, d.mint, tokenProgram);
184
- remainingAccounts.push({ pubkey: mint, isSigner: false, isWritable: true });
185
- remainingAccounts.push({
186
- pubkey: userToken,
187
- isSigner: false,
188
- isWritable: true,
189
- });
190
- remainingAccounts.push({
191
- pubkey: userPdaToken,
192
- isSigner: false,
193
- isWritable: true,
194
- });
195
- remainingAccounts.push({
196
- pubkey: ownerFeeToken,
197
- isSigner: false,
198
- isWritable: true,
199
- });
200
- });
201
- // @ts-ignore
202
- const ix = yield anchor_1.Anchor.instance().iyfMain.methods
203
- .withdrawMultipleToken()
204
- .accounts({
205
- farm,
206
- userPda,
207
- payer: params.payer,
208
- hsFeeOwner: addresses_1.SITE_FEE_OWNER,
209
- associatedTokenProgram: addresses_1.ASSOCIATED_TOKEN_PROGRAM,
210
- tokenProgram,
211
- systemProgram: web3.SystemProgram.programId,
212
- })
213
- .remainingAccounts(remainingAccounts)
214
- .instruction();
215
- return ix;
216
- });
217
- }
218
- function withdrawMultipleTokenV2(params) {
219
- return __awaiter(this, void 0, void 0, function* () {
220
- const farm = addresses_1.USDC_FARM;
221
- const userPda = util.generateUserPda(params.payer, farm);
222
- const remainingAccounts = [];
223
- const amounts = params.withdraw.map((d) => d.amount);
224
- // Get mint pubkeys
225
- const mints = params.withdraw.map((d) => d.mint);
226
- // Get and assert one token program for all mints.
227
- // Throws an error if there are multiple token programs.
228
- const tokenProgram = yield util.getTokenProgramForMints(params.connection, mints);
229
- let skipIdempotent = false;
230
- params.withdraw.map((d) => {
231
- const mint = d.mint;
232
- const userToken = util.generateAta(params.payer, d.mint, tokenProgram);
233
- const ownerFeeToken = util.generateAta(addresses_1.SITE_FEE_OWNER, d.mint, tokenProgram);
234
- let userPdaToken;
235
- if (params.pdaTokenType === types_1.TokenType.LTA) {
236
- skipIdempotent = true;
237
- userPdaToken = util.generateLimitToken(userPda, d.mint);
238
- }
239
- else if (params.pdaTokenType === types_1.TokenType.STA || params.useSta) {
240
- skipIdempotent = true;
241
- userPdaToken = util.generateUserPdaStorageAccount(userPda, d.mint);
242
- }
243
- else {
244
- userPdaToken = util.generateAta(userPda, d.mint, tokenProgram);
245
- }
246
- remainingAccounts.push({ pubkey: mint, isSigner: false, isWritable: true });
247
- remainingAccounts.push({
248
- pubkey: userToken,
249
- isSigner: false,
250
- isWritable: true,
251
- });
252
- remainingAccounts.push({
253
- pubkey: userPdaToken,
254
- isSigner: false,
255
- isWritable: true,
256
- });
257
- remainingAccounts.push({
258
- pubkey: ownerFeeToken,
259
- isSigner: false,
260
- isWritable: true,
261
- });
262
- });
263
- // @ts-ignore
264
- const ix = yield anchor_1.Anchor.instance().iyfMain.methods
265
- .withdrawMultipleTokenV2(skipIdempotent, params.hasAmount ? amounts : null)
266
- .accounts({
267
- farm,
268
- userPda,
269
- payer: params.payer,
270
- hsFeeOwner: addresses_1.SITE_FEE_OWNER,
271
- associatedTokenProgram: addresses_1.ASSOCIATED_TOKEN_PROGRAM,
272
- tokenProgram,
273
- systemProgram: web3.SystemProgram.programId,
274
- })
275
- .remainingAccounts(remainingAccounts)
276
- .instruction();
277
- return ix;
278
- });
279
- }
280
- function setTransactionSlot(_a) {
281
- return __awaiter(this, arguments, void 0, function* ({ userWallet }) {
282
- const ix = yield anchor_1.Anchor
283
- .instance().iyfMain.methods
284
- .setTransactionSlot()
285
- .accounts({
286
- userPda: util.generateUserPda(userWallet),
287
- clock: web3.SYSVAR_CLOCK_PUBKEY,
288
- })
289
- .instruction();
290
- return ix;
291
- });
292
- }
293
- function verifyTransactionSlot(_a) {
294
- return __awaiter(this, arguments, void 0, function* ({ userWallet }) {
295
- const ix = yield anchor_1.Anchor
296
- .instance().iyfMain.methods
297
- .verifyTransactionSlot()
298
- .accounts({
299
- userPda: util.generateUserPda(userWallet),
300
- clock: web3.SYSVAR_CLOCK_PUBKEY,
301
- })
302
- .instruction();
303
- return ix;
304
- });
305
- }
306
- function storeToken(connection, params) {
307
- return __awaiter(this, void 0, void 0, function* () {
308
- const userPda = util.generateUserPda(params.userWallet);
309
- const tokenProgramMap = yield util.getTokenProgramMapForMints(connection, [params.mint]);
310
- const tokenProgram = tokenProgramMap[params.mint.toString()];
311
- const ix = yield anchor_1.Anchor
312
- .instance().iyfMain.methods
313
- .storeToken()
314
- .accounts({
315
- userPda: userPda,
316
- authority: params.userWallet,
317
- mint: params.mint,
318
- passthroughTokenAccount: util.generateAta(userPda, params.mint),
319
- storageTokenAccount: util.generateUserPdaStorageAccount(userPda, params.mint),
320
- rent: web3.SYSVAR_RENT_PUBKEY,
321
- tokenProgram,
322
- associatedTokenProgram: addresses_1.ASSOCIATED_TOKEN_PROGRAM,
323
- systemProgram: web3.SystemProgram.programId,
324
- })
325
- .instruction();
326
- return ix;
327
- });
328
- }
@@ -1,31 +0,0 @@
1
- import * as web3 from "@solana/web3.js";
2
- import { LabeledInstruction, MeteoraToHawksightParamsLabeled, MeteoraToHawksightParams } from "./types";
3
- /**
4
- * Convert listed meteora instruction to generalized hawksight meteora cpi
5
- *
6
- * @param params
7
- * @returns
8
- */
9
- export declare function meteoraToHawksight({ ixs, userPda, authority, opt }: MeteoraToHawksightParams): Promise<web3.TransactionInstruction[]>;
10
- /**
11
- * Convert listed meteora instruction to generalized hawksight meteora cpi (with label)
12
- *
13
- * @param params
14
- * @returns
15
- */
16
- export declare function meteoraToHawksightLabeled({ ixs, userPda, authority, classification, opt }: MeteoraToHawksightParamsLabeled): Promise<LabeledInstruction[]>;
17
- /**
18
- * Convert listed meteora instruction to hawksight meteora automation cpi
19
- *
20
- * @param params
21
- * @returns
22
- */
23
- export declare function meteoraToHawksightAutomationIxs({ ixs, userPda, authority, opt }: MeteoraToHawksightParams): Promise<web3.TransactionInstruction[]>;
24
- /**
25
- * Convert listed meteora instruction to hawksight meteora automation cpi
26
- *
27
- * @param params
28
- * @returns
29
- */
30
- export declare function meteoraToHawksightPdaIxs({ ixs, userPda, authority, opt }: MeteoraToHawksightParams): Promise<web3.TransactionInstruction[]>;
31
- //# sourceMappingURL=hsToMeteora.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hsToMeteora.d.ts","sourceRoot":"","sources":["../../src/hsToMeteora.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,kBAAkB,EAAE,+BAA+B,EAA6B,wBAAwB,EAAa,MAAM,SAAS,CAAC;AAkB9I;;;;;GAKG;AACH,wBAAsB,kBAAkB,CAAC,EAAC,GAAG,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,EAAC,EAAE,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,sBAAsB,EAAE,CAAC,CAUzI;AAED;;;;;GAKG;AACH,wBAAsB,yBAAyB,CAAC,EAAC,GAAG,EAAE,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,GAAG,EAAC,EAAE,+BAA+B,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAU9J;AAED;;;;;GAKG;AACH,wBAAsB,+BAA+B,CAAC,EAAC,GAAG,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,EAAC,EAAE,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,sBAAsB,EAAE,CAAC,CAUtJ;AAED;;;;;GAKG;AACH,wBAAsB,wBAAwB,CAAC,EAAC,GAAG,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,EAAC,EAAE,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,sBAAsB,EAAE,CAAC,CAU/I"}