@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 +0,0 @@
1
- {"version":3,"file":"RaydiumIxGenerator.d.ts","sourceRoot":"","sources":["../../../src/ixGenerator/RaydiumIxGenerator.ts"],"names":[],"mappings":"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"}
@@ -1,558 +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
- var __importDefault = (this && this.__importDefault) || function (mod) {
45
- return (mod && mod.__esModule) ? mod : { "default": mod };
46
- };
47
- Object.defineProperty(exports, "__esModule", { value: true });
48
- exports.RaydiumIxGenerator = void 0;
49
- exports.getLiquidityFromAmounts = getLiquidityFromAmounts;
50
- exports.getAmountsFromLiquidity = getAmountsFromLiquidity;
51
- const web3 = __importStar(require("@solana/web3.js"));
52
- const anchor_1 = require("../anchor");
53
- const functions_1 = require("../functions");
54
- const addresses_1 = require("../addresses");
55
- const raydium_sdk_v2_1 = require("@raydium-io/raydium-sdk-v2");
56
- const RaydiumSDK_1 = require("../classes/RaydiumSDK");
57
- const bn_js_1 = __importDefault(require("bn.js"));
58
- /**
59
- * Meteora related instructions executed via iyf extension or iyf main
60
- */
61
- class RaydiumIxGenerator {
62
- constructor(iyfMain, iyfExtension, pda) {
63
- this.iyfMain = iyfMain;
64
- this.iyfExtension = iyfExtension;
65
- this.pda = pda;
66
- }
67
- raydiumFetch(_a) {
68
- return __awaiter(this, arguments, void 0, function* ({ personalPosition, poolState }) {
69
- if (personalPosition !== undefined) {
70
- // @ts-ignore
71
- const f0 = anchor_1.Anchor.instance().raydiumProgram.account.personalPositionState;
72
- // @ts-ignore
73
- const f1 = anchor_1.Anchor.instance().raydiumProgram.account.poolState;
74
- const positionInfo = yield f0.fetch(personalPosition);
75
- const poolStateInfo = yield f1.fetch(positionInfo.poolId);
76
- return { positionInfo, poolStateInfo };
77
- }
78
- else if (poolState !== undefined) {
79
- // @ts-ignore
80
- const f = anchor_1.Anchor.instance().raydiumProgram.account.poolState;
81
- const poolStateInfo = yield f.fetch(poolState);
82
- return { poolStateInfo };
83
- }
84
- else {
85
- throw new Error('RaydiumIxGenerator: Unexpected error: personalPosition or poolState parameter must be present');
86
- }
87
- });
88
- }
89
- /**
90
- *
91
- * @param connection The Solana web3 connection object for blockchain interactions.
92
- * @param payer The public key of the payer for transaction fees.
93
- * @param params Parameters required
94
- * @returns A ResponseWithStatus containing either TransactionMetadataResponse.
95
- */
96
- raydiumOpenPosition(_a) {
97
- return __awaiter(this, arguments, void 0, function* ({ connection, params, fetch }) {
98
- const farm = addresses_1.USDC_FARM;
99
- const payer = params.userWallet;
100
- const positionNftOwner = (0, functions_1.generateUserPdaLamport)(params.userWallet, farm);
101
- const positionNftMint = params.nftMint;
102
- const positionNftAccount = (0, functions_1.generateAta2022)(positionNftOwner, positionNftMint);
103
- const poolState = params.poolState;
104
- const protocolPosition = this.pda.raydium.generateRaydiumProtocolPosition(poolState, params.tickLowerIndex, params.tickUpperIndex);
105
- const personalPosition = this.pda.raydium.generateRaydiumPersonalPosition(positionNftMint);
106
- const vault0Mint = fetch.poolStateInfo.tokenMint0;
107
- const vault1Mint = fetch.poolStateInfo.tokenMint1;
108
- const tokenVault0 = fetch.poolStateInfo.tokenVault0;
109
- const tokenVault1 = fetch.poolStateInfo.tokenVault1;
110
- const tokenAccount0 = (0, functions_1.generateAta)(positionNftOwner, vault0Mint);
111
- const tokenAccount1 = (0, functions_1.generateAta)(positionNftOwner, vault1Mint);
112
- const tickArrayLowerStartIndex = (0, functions_1.raydiumStartTickIndex)(params.tickLowerIndex, fetch.poolStateInfo.tickSpacing);
113
- const tickArrayUpperStartIndex = (0, functions_1.raydiumStartTickIndex)(params.tickUpperIndex, fetch.poolStateInfo.tickSpacing);
114
- const tickArrayLower = this.pda.raydium.generateRaydiumTickArrayPda(poolState, tickArrayLowerStartIndex);
115
- const tickArrayUpper = this.pda.raydium.generateRaydiumTickArrayPda(poolState, tickArrayUpperStartIndex);
116
- const { liquidity, amount0Max, amount1Max } = params.getLiquidityFromAmounts ? params.getLiquidityFromAmounts : yield getLiquidityFromAmounts(connection, poolState, params.amountX, params.amountY, params.tickLowerIndex, params.tickUpperIndex, params.slippage, true);
117
- const raydiumIx = yield anchor_1.Anchor.instance().raydiumProgram.methods
118
- .openPositionWithToken22Nft(params.tickLowerIndex, params.tickUpperIndex, tickArrayLowerStartIndex, tickArrayUpperStartIndex, liquidity, amount0Max, amount1Max, false, null)
119
- .accounts({
120
- payer: positionNftOwner,
121
- positionNftOwner,
122
- positionNftMint,
123
- positionNftAccount,
124
- poolState,
125
- protocolPosition,
126
- tickArrayLower,
127
- tickArrayUpper,
128
- personalPosition,
129
- tokenAccount0,
130
- tokenAccount1,
131
- tokenVault0,
132
- tokenVault1,
133
- rent: web3.SYSVAR_RENT_PUBKEY,
134
- systemProgram: web3.SystemProgram.programId,
135
- tokenProgram: addresses_1.TOKEN_PROGRAM_ID,
136
- associatedTokenProgram: addresses_1.ASSOCIATED_TOKEN_PROGRAM,
137
- tokenProgram2022: addresses_1.TOKEN_2022,
138
- vault0Mint,
139
- vault1Mint,
140
- })
141
- .instruction();
142
- raydiumIx.keys[0].isSigner = false;
143
- return yield this.iyfMain.raydiumDynamicCpi(connection, {
144
- userWallet: params.userWallet,
145
- raydiumIx,
146
- });
147
- });
148
- }
149
- /**
150
- *
151
- * @param connection The Solana web3 connection object for blockchain interactions.
152
- * @param payer The public key of the payer for transaction fees.
153
- * @param params Parameters required
154
- * @returns A ResponseWithStatus containing either TransactionMetadataResponse.
155
- */
156
- raydiumOpenPositionAutomation(_a) {
157
- return __awaiter(this, arguments, void 0, function* ({ connection, params }) {
158
- const fetch = yield this.raydiumFetch({ poolState: params.poolState });
159
- const poolState = params.poolState;
160
- const vault0Mint = fetch.poolStateInfo.tokenMint0;
161
- const vault1Mint = fetch.poolStateInfo.tokenMint1;
162
- const tokenVault0 = fetch.poolStateInfo.tokenVault0;
163
- const tokenVault1 = fetch.poolStateInfo.tokenVault1;
164
- let liquidity = null;
165
- let amount0Max = null;
166
- let amount1Max = null;
167
- if (params.amountX && params.amountY && params.slippage) {
168
- const { liquidity: a, amount0Max: b, amount1Max: c } = yield getLiquidityFromAmounts(connection, poolState, params.amountX, params.amountY, params.tickLowerIndex, params.tickUpperIndex, params.slippage, true);
169
- liquidity = a;
170
- amount0Max = b;
171
- amount1Max = c;
172
- }
173
- return yield this.iyfExtension.raydiumOpenPositionAutomation({
174
- connection,
175
- userWallet: params.userWallet,
176
- nftMint: params.nftMint,
177
- poolState,
178
- tokenVault0,
179
- tokenVault1,
180
- vault0Mint,
181
- vault1Mint,
182
- tickSpacing: fetch.poolStateInfo.tickSpacing,
183
- tickLowerIndex: params.tickLowerIndex,
184
- tickUpperIndex: params.tickUpperIndex,
185
- liquidity,
186
- amount0Max,
187
- amount1Max,
188
- });
189
- });
190
- }
191
- /**
192
- *
193
- * @param connection The Solana web3 connection object for blockchain interactions.
194
- * @param payer The public key of the payer for transaction fees.
195
- * @param params Parameters required
196
- * @returns A ResponseWithStatus containing either TransactionMetadataResponse.
197
- */
198
- raydiumClosePosition(_a) {
199
- return __awaiter(this, arguments, void 0, function* ({ connection, params, fetch }) {
200
- const farm = addresses_1.USDC_FARM;
201
- const nftOwner = (0, functions_1.generateUserPdaLamport)(params.userWallet, farm);
202
- const positionNftMint = fetch.positionInfo.nftMint;
203
- const positionNftAccount = (0, functions_1.generateAta2022)(nftOwner, positionNftMint);
204
- const personalPosition = this.pda.raydium.generateRaydiumPersonalPosition(positionNftMint);
205
- const raydiumIx = yield anchor_1.Anchor.instance().raydiumProgram.methods
206
- .closePosition()
207
- .accounts({
208
- nftOwner,
209
- positionNftMint,
210
- positionNftAccount,
211
- personalPosition,
212
- systemProgram: web3.SystemProgram.programId,
213
- tokenProgram: addresses_1.TOKEN_2022,
214
- })
215
- .instruction();
216
- raydiumIx.keys[0].isSigner = false;
217
- return this.iyfMain.raydiumDynamicCpi(connection, {
218
- userWallet: params.userWallet,
219
- raydiumIx
220
- });
221
- });
222
- }
223
- /**
224
- *
225
- * @param connection The Solana web3 connection object for blockchain interactions.
226
- * @param payer The public key of the payer for transaction fees.
227
- * @param params Parameters required
228
- * @returns A ResponseWithStatus containing either TransactionMetadataResponse.
229
- */
230
- raydiumClosePositionAutomation(_a) {
231
- return __awaiter(this, arguments, void 0, function* ({ connection, params }) {
232
- return yield this.iyfExtension.raydiumClosePositionAutomation({
233
- connection,
234
- userWallet: params.userWallet,
235
- positionNftMint: params.positionNftMint,
236
- });
237
- });
238
- }
239
- /**
240
- *
241
- * @param connection The Solana web3 connection object for blockchain interactions.
242
- * @param payer The public key of the payer for transaction fees.
243
- * @param params Parameters required
244
- * @returns A ResponseWithStatus containing either TransactionMetadataResponse.
245
- */
246
- raydiumIncreaseLiquidity(_a) {
247
- return __awaiter(this, arguments, void 0, function* ({ connection, params, fetch }) {
248
- const farm = addresses_1.USDC_FARM;
249
- const nftOwner = (0, functions_1.generateUserPdaLamport)(params.userWallet, farm);
250
- const poolState = fetch.positionInfo.poolId;
251
- const protocolPosition = this.pda.raydium.generateRaydiumProtocolPosition(poolState, fetch.positionInfo.tickLowerIndex, fetch.positionInfo.tickUpperIndex);
252
- const nftMint = fetch.positionInfo.nftMint;
253
- const nftAccount = (0, functions_1.generateAta2022)(nftOwner, nftMint);
254
- const personalPosition = this.pda.raydium.generateRaydiumPersonalPosition(nftMint);
255
- const vault0Mint = fetch.poolStateInfo.tokenMint0;
256
- const vault1Mint = fetch.poolStateInfo.tokenMint1;
257
- const tokenVault0 = fetch.poolStateInfo.tokenVault0;
258
- const tokenVault1 = fetch.poolStateInfo.tokenVault1;
259
- const tokenAccount0 = (0, functions_1.generateAta)(nftOwner, vault0Mint);
260
- const tickLowerIndex = fetch.positionInfo.tickLowerIndex;
261
- const tickUpperIndex = fetch.positionInfo.tickUpperIndex;
262
- const tickArrayLowerStartIndex = (0, functions_1.raydiumStartTickIndex)(tickLowerIndex, fetch.poolStateInfo.tickSpacing);
263
- const tickArrayUpperStartIndex = (0, functions_1.raydiumStartTickIndex)(tickUpperIndex, fetch.poolStateInfo.tickSpacing);
264
- const tokenAccount1 = (0, functions_1.generateAta)(nftOwner, vault1Mint);
265
- const tickArrayLower = this.pda.raydium.generateRaydiumTickArrayPda(poolState, tickArrayLowerStartIndex);
266
- const tickArrayUpper = this.pda.raydium.generateRaydiumTickArrayPda(poolState, tickArrayUpperStartIndex);
267
- const { liquidity, amount0Max, amount1Max } = params.getLiquidityFromAmounts ? params.getLiquidityFromAmounts : yield getLiquidityFromAmounts(connection, poolState, params.amountX, params.amountY, tickLowerIndex, tickUpperIndex, params.slippage, true);
268
- const raydiumIx = yield anchor_1.Anchor.instance().raydiumProgram.methods
269
- .increaseLiquidityV2(liquidity, amount0Max, amount1Max, false)
270
- .accounts({
271
- nftOwner,
272
- nftAccount,
273
- poolState,
274
- protocolPosition,
275
- personalPosition,
276
- tickArrayLower,
277
- tickArrayUpper,
278
- tokenAccount0,
279
- tokenAccount1,
280
- tokenVault0,
281
- tokenVault1,
282
- tokenProgram: addresses_1.TOKEN_PROGRAM_ID,
283
- tokenProgram2022: addresses_1.TOKEN_2022,
284
- vault0Mint,
285
- vault1Mint,
286
- })
287
- .instruction();
288
- raydiumIx.keys[0].isSigner = false;
289
- return this.iyfMain.raydiumDynamicCpi(connection, {
290
- userWallet: params.userWallet,
291
- raydiumIx
292
- });
293
- });
294
- }
295
- /**
296
- *
297
- * @param connection The Solana web3 connection object for blockchain interactions.
298
- * @param payer The public key of the payer for transaction fees.
299
- * @param params Parameters required
300
- * @returns A ResponseWithStatus containing either TransactionMetadataResponse.
301
- */
302
- raydiumIncreaseLiquidityAutomation(_a) {
303
- return __awaiter(this, arguments, void 0, function* ({ connection, params, fetch }) {
304
- const poolState = fetch.positionInfo.poolId;
305
- const nftMint = fetch.positionInfo.nftMint;
306
- const vault0Mint = fetch.poolStateInfo.tokenMint0;
307
- const vault1Mint = fetch.poolStateInfo.tokenMint1;
308
- const tokenVault0 = fetch.poolStateInfo.tokenVault0;
309
- const tokenVault1 = fetch.poolStateInfo.tokenVault1;
310
- const tickLowerIndex = fetch.positionInfo.tickLowerIndex;
311
- const tickUpperIndex = fetch.positionInfo.tickUpperIndex;
312
- let liquidity = null;
313
- let amount0Max = null;
314
- let amount1Max = null;
315
- if (params.amountX && params.amountY && params.slippage) {
316
- const { liquidity: a, amount0Max: b, amount1Max: c } = params.getLiquidityFromAmounts ? params.getLiquidityFromAmounts : yield getLiquidityFromAmounts(connection, poolState, params.amountX, params.amountY, tickLowerIndex, tickUpperIndex, params.slippage, true);
317
- liquidity = a;
318
- amount0Max = b;
319
- amount1Max = c;
320
- }
321
- return yield this.iyfExtension.raydiumIncreaseLiquidityAutomation({
322
- connection,
323
- userWallet: params.userWallet,
324
- nftMint,
325
- poolState,
326
- tokenVault0,
327
- tokenVault1,
328
- vault0Mint,
329
- vault1Mint,
330
- tickSpacing: fetch.poolStateInfo.tickSpacing,
331
- tickLowerIndex,
332
- tickUpperIndex,
333
- liquidity,
334
- amount0Max,
335
- amount1Max,
336
- });
337
- });
338
- }
339
- /**
340
- *
341
- * @param connection The Solana web3 connection object for blockchain interactions.
342
- * @param payer The public key of the payer for transaction fees.
343
- * @param params Parameters required
344
- * @returns A ResponseWithStatus containing either TransactionMetadataResponse.
345
- */
346
- raydiumDecreaseLiquidity(_a) {
347
- return __awaiter(this, arguments, void 0, function* ({ connection, params, fetch }) {
348
- const poolState = fetch.positionInfo.poolId;
349
- const nftMint = fetch.positionInfo.nftMint;
350
- const personalPosition = this.pda.raydium.generateRaydiumPersonalPosition(nftMint);
351
- const vault0Mint = fetch.poolStateInfo.tokenMint0;
352
- const vault1Mint = fetch.poolStateInfo.tokenMint1;
353
- const tokenVault0 = fetch.poolStateInfo.tokenVault0;
354
- const tokenVault1 = fetch.poolStateInfo.tokenVault1;
355
- let amount0Min;
356
- let amount1Min;
357
- if (params.liquidity.gt(new bn_js_1.default(0))) {
358
- const { amount0Min: a, amount1Min: b } = yield getAmountsFromLiquidity(connection, fetch.positionInfo.poolId, params.liquidity, fetch.positionInfo.tickLowerIndex, fetch.positionInfo.tickUpperIndex, params.slippage, false);
359
- amount0Min = a;
360
- amount1Min = b;
361
- }
362
- else {
363
- amount0Min = new bn_js_1.default(0);
364
- amount1Min = new bn_js_1.default(0);
365
- }
366
- return yield this.iyfExtension.raydiumDecreaseLiquidity({
367
- connection,
368
- liquidity: params.liquidity,
369
- amount0Min: amount0Min,
370
- amount1Min: amount1Min,
371
- userWallet: params.userWallet,
372
- nftMint,
373
- poolState,
374
- personalPosition,
375
- tokenVault0,
376
- tokenVault1,
377
- vault0Mint,
378
- vault1Mint,
379
- tickSpacing: fetch.poolStateInfo.tickSpacing,
380
- tickLowerIndex: fetch.positionInfo.tickLowerIndex,
381
- tickUpperIndex: fetch.positionInfo.tickUpperIndex,
382
- rewardInfos: fetch.poolStateInfo.rewardInfos,
383
- });
384
- });
385
- }
386
- /**
387
- *
388
- * @param connection The Solana web3 connection object for blockchain interactions.
389
- * @param payer The public key of the payer for transaction fees.
390
- * @param params Parameters required
391
- * @returns A ResponseWithStatus containing either TransactionMetadataResponse.
392
- */
393
- raydiumDecreaseLiquidityAutomation(_a) {
394
- return __awaiter(this, arguments, void 0, function* ({ connection, params, fetch }) {
395
- var _b, _c, _d;
396
- const poolState = fetch.positionInfo.poolId;
397
- const nftMint = fetch.positionInfo.nftMint;
398
- const personalPosition = this.pda.raydium.generateRaydiumPersonalPosition(nftMint);
399
- const vault0Mint = fetch.poolStateInfo.tokenMint0;
400
- const vault1Mint = fetch.poolStateInfo.tokenMint1;
401
- const tokenVault0 = fetch.poolStateInfo.tokenVault0;
402
- const tokenVault1 = fetch.poolStateInfo.tokenVault1;
403
- let amount0Min = null;
404
- let amount1Min = null;
405
- if (params.liquidity && params.liquidity.gt(new bn_js_1.default(0))) {
406
- const { amount0Min: a, amount1Min: b } = yield getAmountsFromLiquidity(connection, fetch.positionInfo.poolId, params.liquidity, fetch.positionInfo.tickLowerIndex, fetch.positionInfo.tickUpperIndex, (_b = params.slippage) !== null && _b !== void 0 ? _b : 0.01, false);
407
- amount0Min = a;
408
- amount1Min = b;
409
- }
410
- if (params.liquidity && params.liquidity.eq(new bn_js_1.default(0))) {
411
- amount0Min = new bn_js_1.default(0);
412
- amount1Min = new bn_js_1.default(0);
413
- }
414
- return yield this.iyfExtension.raydiumDecreaseLiquidityAutomation({
415
- connection,
416
- liquidity: (_c = params.liquidity) !== null && _c !== void 0 ? _c : null,
417
- amount0Min,
418
- amount1Min,
419
- userWallet: params.userWallet,
420
- nftMint,
421
- poolState,
422
- personalPosition,
423
- tokenVault0,
424
- tokenVault1,
425
- vault0Mint,
426
- vault1Mint,
427
- tickSpacing: fetch.poolStateInfo.tickSpacing,
428
- tickLowerIndex: fetch.positionInfo.tickLowerIndex,
429
- tickUpperIndex: fetch.positionInfo.tickUpperIndex,
430
- rewardInfos: fetch.poolStateInfo.rewardInfos,
431
- slippage: (_d = params.slippage) !== null && _d !== void 0 ? _d : null,
432
- });
433
- });
434
- }
435
- /**
436
- *
437
- * @param connection The Solana web3 connection object for blockchain interactions.
438
- * @param payer The public key of the payer for transaction fees.
439
- * @param params Parameters required
440
- * @returns A ResponseWithStatus containing either TransactionMetadataResponse.
441
- */
442
- raydiumSweepDust(_a) {
443
- return __awaiter(this, arguments, void 0, function* ({ connection, params, fetch }) {
444
- const userWallet = params.userWallet;
445
- const poolState = fetch.positionInfo.poolId;
446
- const nftMint = fetch.positionInfo.nftMint;
447
- const vault0Mint = fetch.poolStateInfo.tokenMint0;
448
- const vault1Mint = fetch.poolStateInfo.tokenMint1;
449
- const tokenVault0 = fetch.poolStateInfo.tokenVault0;
450
- const tokenVault1 = fetch.poolStateInfo.tokenVault1;
451
- const ammConfig = fetch.poolStateInfo.ammConfig;
452
- const observationKey = fetch.poolStateInfo.observationKey;
453
- const tickCurrent = fetch.poolStateInfo.tickCurrent;
454
- const tickSpacing = fetch.poolStateInfo.tickSpacing;
455
- const tickLowerIndex = fetch.positionInfo.tickLowerIndex;
456
- const tickUpperIndex = fetch.positionInfo.tickUpperIndex;
457
- return yield this.iyfExtension.raydiumSweepDust({
458
- connection,
459
- userWallet,
460
- nftMint,
461
- poolState,
462
- tokenVault0,
463
- tokenVault1,
464
- vault0Mint,
465
- vault1Mint,
466
- ammConfig,
467
- observationKey,
468
- tickCurrent,
469
- tickSpacing,
470
- tickLowerIndex,
471
- tickUpperIndex,
472
- });
473
- });
474
- }
475
- }
476
- exports.RaydiumIxGenerator = RaydiumIxGenerator;
477
- function getLiquidityFromAmounts(connection, poolId, amountA, amountB, tickLower, tickUpper, slippage, add) {
478
- return __awaiter(this, void 0, void 0, function* () {
479
- // Load the Raydium SDK
480
- yield RaydiumSDK_1.RaydiumSDK.load(connection);
481
- // // Get the Raydium SDK instance
482
- // const sdk = RaydiumSDK.instance().sdk;
483
- // Benchmark the getPoolInfoFromRpc function
484
- (0, functions_1.benchmark)({ name: `getLiquidityFromAmounts`, msg: `getPoolInfoFromRpc` });
485
- // Get the pool info
486
- // let { poolInfo } = await sdk.clmm.getPoolInfoFromRpc(poolId.toString());
487
- let poolInfo = yield RaydiumSDK_1.RaydiumSDK.instance().getPoolInfoFromRpc(poolId);
488
- // Fallback in case poolInfo is undefined
489
- // poolInfo = poolInfo ? poolInfo : (await sdk.clmm.getPoolInfoFromRpc(poolId.toString()))[poolInfo];
490
- // Benchmark the getPoolInfoFromRpc function (end)
491
- (0, functions_1.benchmark)({ name: `getLiquidityFromAmounts`, msg: `getPoolInfoFromRpc`, end: true });
492
- // Benchmark the getEpochInfo function
493
- (0, functions_1.benchmark)({ name: `getLiquidityFromAmounts`, msg: `getEpochInfo` });
494
- // Get the epoch info
495
- let epochInfo = yield connection.getEpochInfo();
496
- // Benchmark the getEpochInfo function (end)
497
- (0, functions_1.benchmark)({ name: `getLiquidityFromAmounts`, msg: `getEpochInfo`, end: true });
498
- // Benchmark the getLiquidityFromAmounts function
499
- (0, functions_1.benchmark)({ name: `getLiquidityFromAmounts`, msg: `getLiquidityFromAmounts` });
500
- const { liquidity, amountSlippageA, amountSlippageB, amountA: _amountA, amountB: _amountB, } = (0, raydium_sdk_v2_1.getLiquidityFromAmounts)({
501
- poolInfo,
502
- tickLower,
503
- tickUpper,
504
- amountA,
505
- amountB,
506
- slippage,
507
- add: true,
508
- epochInfo,
509
- amountHasFee: false,
510
- });
511
- // Benchmark the getLiquidityFromAmounts function (end)
512
- (0, functions_1.benchmark)({ name: `getLiquidityFromAmounts`, msg: `getLiquidityFromAmounts`, end: true });
513
- return {
514
- liquidity,
515
- amount0Max: amountSlippageA.amount,
516
- amount1Max: amountSlippageB.amount,
517
- };
518
- });
519
- }
520
- function getAmountsFromLiquidity(connection, poolId, liquidity, tickLower, tickUpper, slippage, add) {
521
- return __awaiter(this, void 0, void 0, function* () {
522
- // Load the Raydium SDK
523
- yield RaydiumSDK_1.RaydiumSDK.load(connection);
524
- // // Get the Raydium SDK instance
525
- // const sdk = RaydiumSDK.sdk();
526
- // Benchmark the getPoolInfoFromRpc function
527
- (0, functions_1.benchmark)({ name: `getAmountsFromLiquidity`, msg: `getPoolInfoFromRpc` });
528
- // Get the pool info
529
- // let { poolInfo } = await sdk.clmm.getPoolInfoFromRpc(poolId.toString());
530
- let poolInfo = yield RaydiumSDK_1.RaydiumSDK.instance().getPoolInfoFromRpc(poolId);
531
- // Benchmark the getPoolInfoFromRpc function (end)
532
- (0, functions_1.benchmark)({ name: `getAmountsFromLiquidity`, msg: `getPoolInfoFromRpc`, end: true });
533
- // Benchmark the getEpochInfo function
534
- (0, functions_1.benchmark)({ name: `getAmountsFromLiquidity`, msg: `getEpochInfo` });
535
- // Get the epoch info
536
- let epochInfo = yield connection.getEpochInfo();
537
- // Benchmark the getEpochInfo function (end)
538
- (0, functions_1.benchmark)({ name: `getAmountsFromLiquidity`, msg: `getEpochInfo`, end: true });
539
- // Benchmark the getAmountsFromLiquidity function
540
- (0, functions_1.benchmark)({ name: `getAmountsFromLiquidity`, msg: `getAmountsFromLiquidity` });
541
- // Get the amounts from liquidity
542
- const { amountSlippageA, amountSlippageB, amountA, amountB, } = yield raydium_sdk_v2_1.PoolUtils.getAmountsFromLiquidity({
543
- epochInfo,
544
- poolInfo,
545
- tickLower,
546
- tickUpper,
547
- liquidity,
548
- slippage,
549
- add,
550
- });
551
- // Benchmark the getAmountsFromLiquidity function (end)
552
- (0, functions_1.benchmark)({ name: `getAmountsFromLiquidity`, msg: `getAmountsFromLiquidity`, end: true });
553
- return {
554
- amount0Min: amountSlippageA.amount,
555
- amount1Min: amountSlippageB.amount,
556
- };
557
- });
558
- }
@@ -1,20 +0,0 @@
1
- import * as web3 from "@solana/web3.js";
2
- type CreateAssociatedTokenAccountInstruction = {
3
- payer: web3.PublicKey;
4
- owner: web3.PublicKey;
5
- mint: web3.PublicKey;
6
- tokenProgram?: web3.PublicKey;
7
- };
8
- /**
9
- * Iyf Main IX Generator
10
- */
11
- export declare class UtilIxGenerator {
12
- /**
13
- * Create associated token account instruction
14
- *
15
- * @returns Create ATA instruction
16
- */
17
- createAssociatedTokenAccountInstruction({ payer, owner, mint, tokenProgram }: CreateAssociatedTokenAccountInstruction): web3.TransactionInstruction;
18
- }
19
- export {};
20
- //# sourceMappingURL=UtilIxGenerator.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"UtilIxGenerator.d.ts","sourceRoot":"","sources":["../../../src/ixGenerator/UtilIxGenerator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AAKxC,KAAK,uCAAuC,GAAG;IAC7C,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC;IACtB,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC;IACtB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;IACrB,YAAY,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC;CAC/B,CAAA;AAED;;GAEG;AACH,qBAAa,eAAe;IAE1B;;;;OAIG;IACH,uCAAuC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,YAAY,EAAE,EAAE,uCAAuC;CAkBtH"}
@@ -1,25 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UtilIxGenerator = void 0;
4
- const addresses_1 = require("../addresses");
5
- const spl_token_1 = require("@solana/spl-token");
6
- const functions_1 = require("../functions");
7
- /**
8
- * Iyf Main IX Generator
9
- */
10
- class UtilIxGenerator {
11
- /**
12
- * Create associated token account instruction
13
- *
14
- * @returns Create ATA instruction
15
- */
16
- createAssociatedTokenAccountInstruction({ payer, owner, mint, tokenProgram }) {
17
- // Designed to allow token2022
18
- if (tokenProgram === undefined) {
19
- tokenProgram = addresses_1.TOKEN_PROGRAM_ID;
20
- }
21
- const associatedToken = (0, functions_1.generateAta)(owner, mint, tokenProgram);
22
- return (0, spl_token_1.createAssociatedTokenAccountInstruction)(payer, associatedToken, owner, mint, tokenProgram, addresses_1.ASSOCIATED_TOKEN_PROGRAM);
23
- }
24
- }
25
- exports.UtilIxGenerator = UtilIxGenerator;
@@ -1,2 +0,0 @@
1
- export * from './liquidityStrategy';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/meteora/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC"}
@@ -1,17 +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 __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./liquidityStrategy"), exports);