@hawksightco/hawk-sdk 1.2.73 → 1.2.75
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.
- package/dist/src/classes/HawkAPI.d.ts +8 -0
- package/dist/src/classes/HawkAPI.d.ts.map +1 -1
- package/dist/src/classes/HawkAPI.js +14 -0
- package/dist/src/classes/RaydiumSDK.d.ts +41 -1
- package/dist/src/classes/RaydiumSDK.d.ts.map +1 -1
- package/dist/src/classes/RaydiumSDK.js +55 -1
- package/dist/src/classes/Transactions.d.ts +2 -1
- package/dist/src/classes/Transactions.d.ts.map +1 -1
- package/dist/src/classes/Transactions.js +226 -7
- package/dist/src/classes/TxGenerator.d.ts +2 -0
- package/dist/src/classes/TxGenerator.d.ts.map +1 -1
- package/dist/src/classes/TxGenerator.js +1 -0
- package/dist/src/classes/TxGeneratorAutomations.d.ts +12 -1
- package/dist/src/classes/TxGeneratorAutomations.d.ts.map +1 -1
- package/dist/src/classes/TxGeneratorAutomations.js +37 -0
- package/dist/src/hawksight.d.ts +2 -0
- package/dist/src/hawksight.d.ts.map +1 -1
- package/dist/src/hawksight.js +2 -2
- package/dist/src/hsToMeteora.js +1 -1
- package/dist/src/idl/iyf-extension-idl.d.ts +170 -0
- package/dist/src/idl/iyf-extension-idl.d.ts.map +1 -1
- package/dist/src/idl/iyf-extension-idl.js +170 -0
- package/dist/src/idl/iyf-main-idl.d.ts +10 -134
- package/dist/src/idl/iyf-main-idl.d.ts.map +1 -1
- package/dist/src/idl/iyf-main-idl.js +10 -134
- package/dist/src/ixGenerator/IyfMainIxGenerator.d.ts +2 -0
- package/dist/src/ixGenerator/IyfMainIxGenerator.d.ts.map +1 -1
- package/dist/src/ixGenerator/RaydiumIxGenerator.d.ts +2 -2
- package/dist/src/ixGenerator/RaydiumIxGenerator.d.ts.map +1 -1
- package/dist/src/ixGenerator/RaydiumIxGenerator.js +24 -22
- package/dist/src/meteora.d.ts.map +1 -1
- package/dist/src/meteora.js +8 -4
- package/dist/src/types.d.ts +9 -0
- package/dist/src/types.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as web3 from "@solana/web3.js";
|
|
1
2
|
import { General } from "./General";
|
|
2
3
|
import { Health } from "./Health";
|
|
3
4
|
import { TxGenerator } from "./TxGenerator";
|
|
@@ -13,6 +14,7 @@ import { Atomicity } from "./Atomicity";
|
|
|
13
14
|
import { JupiterAlts } from "./JupiterAlts";
|
|
14
15
|
import { JupiterSwap } from "./JupiterSwap";
|
|
15
16
|
import { SimplePdaGenerator } from './SimplePdaGenerator';
|
|
17
|
+
import { RaydiumSDK } from "./RaydiumSDK";
|
|
16
18
|
/**
|
|
17
19
|
* HawkAPI is a central gateway class that aggregates access to various functional modules
|
|
18
20
|
* for interacting with HawkSight's blockchain APIs. This class initializes and exposes modules
|
|
@@ -86,5 +88,11 @@ export declare class HawkAPI {
|
|
|
86
88
|
* @param flag
|
|
87
89
|
*/
|
|
88
90
|
logging(flag: boolean): void;
|
|
91
|
+
/**
|
|
92
|
+
* Load the Raydium SDK
|
|
93
|
+
*
|
|
94
|
+
* @param connection The Solana connection
|
|
95
|
+
*/
|
|
96
|
+
raydiumSDK(connection: web3.Connection): Promise<RaydiumSDK>;
|
|
89
97
|
}
|
|
90
98
|
//# sourceMappingURL=HawkAPI.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HawkAPI.d.ts","sourceRoot":"","sources":["../../../src/classes/HawkAPI.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"HawkAPI.d.ts","sourceRoot":"","sources":["../../../src/classes/HawkAPI.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe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B,qBAAqB,EAAE,sBAAsB,CAAC;IAE9D,mDAAmD;IACnD,SAAgB,MAAM,EAAE,MAAM,CAAC;IAE/B,mCAAmC;IACnC,SAAgB,EAAE,EAAE,iBAAiB,CAAC;IAEtC,mBAAmB;IACnB,SAAgB,OAAO,EAAE,WAAW,CAAC;IAErC,mBAAmB;IACnB,SAAgB,WAAW,EAAE,WAAW,CAAC;IAEzC,2BAA2B;IAC3B,SAAgB,GAAG,EAAE,kBAAkB,CAAC;IAExC;;;OAGG;gBAEkB,GAAG,GAAE,MAAoC,EACzC,OAAO,CAAC,4BAAgB;IA4B7C;;;;OAIG;IACH,mBAAmB,CAAC,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,cAAc,KAAK,WAAW;IAI9F;;;;;OAKG;IACG,OAAO,CAAC,EAAC,UAAU,EAAE,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,EAAC,EAAE,yBAAyB,GAAG,OAAO,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAC;IAWzJ;;;;OAIG;IACH,YAAY,CAAC,EAAC,oBAAoB,EAAE,YAAY,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAC,EAAE,6BAA6B;IAW5G;;;;OAIG;IACH,SAAS,CAAC,EAAC,oBAAoB,EAAE,YAAY,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAC,EAAE,6BAA6B;IAYzG;;;;OAIG;IACH,OAAO,CAAC,IAAI,EAAE,OAAO;IAIrB;;;;OAIG;IACG,UAAU,CAAC,UAAU,EAAE,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;CAQnE"}
|
|
@@ -27,6 +27,7 @@ const JupiterSwap_1 = require("./JupiterSwap");
|
|
|
27
27
|
const Logging_1 = require("./Logging");
|
|
28
28
|
const Transactions_1 = require("./Transactions");
|
|
29
29
|
const CombineTransactions_1 = require("./CombineTransactions");
|
|
30
|
+
const RaydiumSDK_1 = require("./RaydiumSDK");
|
|
30
31
|
/**
|
|
31
32
|
* HawkAPI is a central gateway class that aggregates access to various functional modules
|
|
32
33
|
* for interacting with HawkSight's blockchain APIs. This class initializes and exposes modules
|
|
@@ -118,5 +119,18 @@ class HawkAPI {
|
|
|
118
119
|
logging(flag) {
|
|
119
120
|
(0, Logging_1.logging)(flag);
|
|
120
121
|
}
|
|
122
|
+
/**
|
|
123
|
+
* Load the Raydium SDK
|
|
124
|
+
*
|
|
125
|
+
* @param connection The Solana connection
|
|
126
|
+
*/
|
|
127
|
+
raydiumSDK(connection) {
|
|
128
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
129
|
+
// Load the Raydium SDK
|
|
130
|
+
yield RaydiumSDK_1.RaydiumSDK.load(connection);
|
|
131
|
+
// Return the Raydium SDK instance
|
|
132
|
+
return RaydiumSDK_1.RaydiumSDK.instance();
|
|
133
|
+
});
|
|
134
|
+
}
|
|
121
135
|
}
|
|
122
136
|
exports.HawkAPI = HawkAPI;
|
|
@@ -1,5 +1,45 @@
|
|
|
1
1
|
import * as web3 from "@solana/web3.js";
|
|
2
|
-
import { Raydium } from "@raydium-io/raydium-sdk-v2";
|
|
2
|
+
import { Raydium, ApiV3PoolInfoConcentratedItem } from "@raydium-io/raydium-sdk-v2";
|
|
3
|
+
/**
|
|
4
|
+
* Raydium SDK class
|
|
5
|
+
*
|
|
6
|
+
* This class is used to load the Raydium SDK and get the instance
|
|
7
|
+
*/
|
|
8
|
+
export declare class RaydiumSDK {
|
|
9
|
+
/**
|
|
10
|
+
* The instance of the Raydium SDK
|
|
11
|
+
*/
|
|
12
|
+
private static _instance;
|
|
13
|
+
/**
|
|
14
|
+
* The Raydium SDK instance
|
|
15
|
+
*/
|
|
16
|
+
sdk: Raydium;
|
|
17
|
+
/**
|
|
18
|
+
* Constructor
|
|
19
|
+
*
|
|
20
|
+
* @param sdk The Raydium SDK instance
|
|
21
|
+
*/
|
|
22
|
+
private constructor();
|
|
23
|
+
/**
|
|
24
|
+
* Get the instance of the Raydium SDK
|
|
25
|
+
*
|
|
26
|
+
* @returns The Raydium SDK instance
|
|
27
|
+
*/
|
|
28
|
+
static instance(): RaydiumSDK;
|
|
29
|
+
/**
|
|
30
|
+
* Load the Raydium SDK
|
|
31
|
+
*
|
|
32
|
+
* @param connection The Solana connection
|
|
33
|
+
*/
|
|
34
|
+
static load(connection: web3.Connection): Promise<void>;
|
|
35
|
+
/**
|
|
36
|
+
* Get pool info from Raydium API v3
|
|
37
|
+
*
|
|
38
|
+
* @param poolId The pool id to get the pool info from.
|
|
39
|
+
* @returns The pool info.
|
|
40
|
+
*/
|
|
41
|
+
getPoolInfoFromRpc(poolId: web3.PublicKey): Promise<ApiV3PoolInfoConcentratedItem>;
|
|
42
|
+
}
|
|
3
43
|
/**
|
|
4
44
|
* Load the Raydium SDK
|
|
5
45
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RaydiumSDK.d.ts","sourceRoot":"","sources":["../../../src/classes/RaydiumSDK.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"RaydiumSDK.d.ts","sourceRoot":"","sources":["../../../src/classes/RaydiumSDK.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,6BAA6B,EAAE,MAAM,4BAA4B,CAAC;AAEpF;;;;GAIG;AACH,qBAAa,UAAU;IAErB;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,SAAS,CAAa;IAErC;;OAEG;IACI,GAAG,EAAE,OAAO,CAAC;IAEpB;;;;OAIG;IACH,OAAO;IAIP;;;;OAIG;IACH,MAAM,CAAC,QAAQ,IAAI,UAAU;IAI7B;;;;OAIG;WACU,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,UAAU;IAiB7C;;;;;OAKG;IACG,kBAAkB,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,6BAA6B,CAAC;CAiDzF;AAED;;;;GAIG;AACH,wBAAsB,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,UAAU,iBAErD;AAED;;;;GAIG;AACH,wBAAgB,OAAO,YAEtB"}
|
|
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.raydium = exports.load = void 0;
|
|
12
|
+
exports.raydium = exports.load = exports.RaydiumSDK = void 0;
|
|
13
13
|
const raydium_sdk_v2_1 = require("@raydium-io/raydium-sdk-v2");
|
|
14
14
|
/**
|
|
15
15
|
* Raydium SDK class
|
|
@@ -53,7 +53,61 @@ class RaydiumSDK {
|
|
|
53
53
|
RaydiumSDK._instance = new RaydiumSDK(sdk);
|
|
54
54
|
});
|
|
55
55
|
}
|
|
56
|
+
/**
|
|
57
|
+
* Get pool info from Raydium API v3
|
|
58
|
+
*
|
|
59
|
+
* @param poolId The pool id to get the pool info from.
|
|
60
|
+
* @returns The pool info.
|
|
61
|
+
*/
|
|
62
|
+
getPoolInfoFromRpc(poolId) {
|
|
63
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
64
|
+
const _poolInfo = yield fetch(`https://api-v3.raydium.io/pools/info/ids?ids=${poolId.toString()}`, {
|
|
65
|
+
method: 'GET',
|
|
66
|
+
headers: {
|
|
67
|
+
'Content-Type': 'application/json',
|
|
68
|
+
},
|
|
69
|
+
});
|
|
70
|
+
const data = yield _poolInfo.json();
|
|
71
|
+
const poolInfo = data.data[0];
|
|
72
|
+
const result = {
|
|
73
|
+
type: "Concentrated",
|
|
74
|
+
programId: poolInfo.programId,
|
|
75
|
+
id: poolInfo.id,
|
|
76
|
+
mintA: poolInfo.mintA,
|
|
77
|
+
mintB: poolInfo.mintB,
|
|
78
|
+
rewardDefaultInfos: poolInfo.rewardDefaultInfos,
|
|
79
|
+
rewardDefaultPoolInfos: poolInfo.rewardDefaultPoolInfos,
|
|
80
|
+
price: poolInfo.price,
|
|
81
|
+
mintAmountA: poolInfo.mintAmountA,
|
|
82
|
+
mintAmountB: poolInfo.mintAmountB,
|
|
83
|
+
feeRate: poolInfo.feeRate,
|
|
84
|
+
openTime: poolInfo.openTime,
|
|
85
|
+
tvl: poolInfo.tvl,
|
|
86
|
+
day: poolInfo.day,
|
|
87
|
+
week: poolInfo.week,
|
|
88
|
+
month: poolInfo.month,
|
|
89
|
+
pooltype: poolInfo.pooltype,
|
|
90
|
+
farmUpcomingCount: poolInfo.farmUpcomingCount,
|
|
91
|
+
farmOngoingCount: poolInfo.farmOngoingCount,
|
|
92
|
+
farmFinishedCount: poolInfo.farmFinishedCount,
|
|
93
|
+
burnPercent: poolInfo.burnPercent,
|
|
94
|
+
config: {
|
|
95
|
+
id: poolInfo.config.id,
|
|
96
|
+
index: poolInfo.config.index,
|
|
97
|
+
protocolFeeRate: poolInfo.config.protocolFeeRate,
|
|
98
|
+
tradeFeeRate: poolInfo.config.tradeFeeRate,
|
|
99
|
+
tickSpacing: poolInfo.config.tickSpacing,
|
|
100
|
+
fundFeeRate: poolInfo.config.fundFeeRate,
|
|
101
|
+
description: poolInfo.config.description,
|
|
102
|
+
defaultRange: poolInfo.config.defaultRange,
|
|
103
|
+
defaultRangePoint: poolInfo.config.defaultRangePoint,
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
return result;
|
|
107
|
+
});
|
|
108
|
+
}
|
|
56
109
|
}
|
|
110
|
+
exports.RaydiumSDK = RaydiumSDK;
|
|
57
111
|
/**
|
|
58
112
|
* Load the Raydium SDK
|
|
59
113
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as web3 from "@solana/web3.js";
|
|
2
|
-
import { MeteoraClaim, MeteoraClaimAll, MeteoraClose, MeteoraCompound, MeteoraCreatePositionAndDeposit, MeteoraCreatePositionAndDepositPda, MeteoraDeposit, MeteoraInitializeBinArrays, MeteoraRebalance, MeteoraWithdraw, Register, TxgenParams, InitializeStorageTokenAccount, MeteoraLimitCloseAutomation, OrcaOpenPosition, OrcaClosePosition, OrcaDeposit, OrcaWithdraw, OrcaSweepDust, OrcaClaimRewards, TransactionMetadataResponse, MeteoraRebalance2, ClaimTokenFromSTA, ClaimTokensFromSTA, RaydiumClosePosition, OpenAutomationIx, RaydiumWithdrawAndClosePosition } from "../types";
|
|
2
|
+
import { MeteoraClaim, MeteoraClaimAll, MeteoraClose, MeteoraCompound, MeteoraCreatePositionAndDeposit, MeteoraCreatePositionAndDepositPda, MeteoraDeposit, MeteoraInitializeBinArrays, MeteoraRebalance, MeteoraWithdraw, Register, TxgenParams, InitializeStorageTokenAccount, MeteoraLimitCloseAutomation, MeteoraLimitCloseAutomation2, OrcaOpenPosition, OrcaClosePosition, OrcaDeposit, OrcaWithdraw, OrcaSweepDust, OrcaClaimRewards, TransactionMetadataResponse, MeteoraRebalance2, ClaimTokenFromSTA, ClaimTokensFromSTA, RaydiumClosePosition, OpenAutomationIx, RaydiumWithdrawAndClosePosition } from "../types";
|
|
3
3
|
import { RaydiumIncreaseLiquidity, RaydiumOpenPosition, RaydiumDecreaseLiquidity } from "../types";
|
|
4
4
|
import { GeneralUtility } from "./GeneralUtility";
|
|
5
5
|
import { MultiTransaction } from "./MultiTransaction";
|
|
@@ -152,6 +152,7 @@ export declare class Transactions {
|
|
|
152
152
|
openAutomationIx({ connection, params, }: TxgenParams<OpenAutomationIx>): Promise<TransactionMetadataResponse>;
|
|
153
153
|
closeAutomationIx({ connection, params }: TxgenParams<MeteoraClose>): Promise<TransactionMetadataResponse>;
|
|
154
154
|
limitCloseAutomationIx({ connection, params, }: TxgenParams<MeteoraLimitCloseAutomation>): Promise<TransactionMetadataResponse>;
|
|
155
|
+
limitCloseAutomationIx2({ connection, params, }: TxgenParams<MeteoraLimitCloseAutomation2>): Promise<TransactionMetadataResponse>;
|
|
155
156
|
private removeLiquidityByRangeInfo;
|
|
156
157
|
/**
|
|
157
158
|
* Creates orca instruction that opens new position
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Transactions.d.ts","sourceRoot":"","sources":["../../../src/classes/Transactions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AAoBxC,OAAO,EACL,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,eAAe,EACf,+BAA+B,EAC/B,kCAAkC,EAClC,cAAc,EACd,0BAA0B,EAC1B,gBAAgB,EAChB,eAAe,EACf,QAAQ,EAGR,WAAW,EACX,6BAA6B,EAC7B,2BAA2B,EAC3B,gBAAgB,EAChB,iBAAiB,EACjB,WAAW,EACX,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,2BAA2B,EAC3B,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EAEpB,gBAAgB,EAChB,+BAA+B,EAChC,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"Transactions.d.ts","sourceRoot":"","sources":["../../../src/classes/Transactions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AAoBxC,OAAO,EACL,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,eAAe,EACf,+BAA+B,EAC/B,kCAAkC,EAClC,cAAc,EACd,0BAA0B,EAC1B,gBAAgB,EAChB,eAAe,EACf,QAAQ,EAGR,WAAW,EACX,6BAA6B,EAC7B,2BAA2B,EAC3B,4BAA4B,EAC5B,gBAAgB,EAChB,iBAAiB,EACjB,WAAW,EACX,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,2BAA2B,EAC3B,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EAEpB,gBAAgB,EAChB,+BAA+B,EAChC,MAAM,UAAU,CAAC;AA6BlB,OAAO,EAEL,wBAAwB,EACxB,mBA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MAAM,GACP,EAAE,WAAW,CAAC,YAAY,CAAC,GAAG,OAAO,CAAC,2BAA2B,CAAC;IA0GnE;;;;;;;OAOG;IACG,eAAe,CAAC,EACpB,UAAU,EACV,MAAM,GACP,EAAE,WAAW,CAAC,YAAY,CAAC,GAAG,OAAO,CAAC,2BAA2B,CAAC;IAmOnE;;;;;;;OAOG;IACG,gBAAgB,CAAC,EACrB,UAAU,EACV,MAAM,GACP,EAAE,WAAW,CAAC,gBAAgB,CAAC,GAAG,OAAO,CAAC,2BAA2B,CAAC;IA8IvE;;;;;;OAMG;IACG,mBAAmB,CAAC,EACxB,UAAU,EACV,MAAM,GACP,EAAE,WAAW,CAAC,mBAAmB,CAAC,GAAG,OAAO,CAAC,2BAA2B,CAAC;IAsH1E;;;;;;;OAOG;IACG,+BAA+B,CAAC,EACpC,UAAU,EACV,MAAM,GACP,EAAE,WAAW,CAAC,+BAA+B,CAAC,GAAG,OAAO,CAAC,2BAA2B,CAAC;IA8GtF;;;;;;OAMG;IACG,oBAAoB,CAAC,EACzB,UAAU,EACV,MAAM,GACP,EAAE,WAAW,CAAC,oBAAoB,CAAC,GAAG,OAAO,CAAC,2BAA2B,CAAC;IAuB3E;;;;;;OAMG;IACG,wBAAwB,CAAC,EAC7B,UAAU,EACV,MAAM,GACP,EAAE,WAAW,CAAC,wBAAwB,CAAC,GAAG,OAAO,CAAC,2BAA2B,CAAC;IA2F/E;;;;;;OAMG;IACG,wBAAwB,CAAC,EAC7B,UAAU,EACV,MAAM,GACP,EAAE,WAAW,CAAC,wBAAwB,CAAC,GAAG,OAAO,CAAC,2BAA2B,CAAC;CAmFhF;AAED,eAAO,MAAM,KAAK,cAA6B,CAAC"}
|
|
@@ -56,6 +56,7 @@ const spl_token_1 = require("@solana/spl-token");
|
|
|
56
56
|
const whirlpools_sdk_1 = require("@orca-so/whirlpools-sdk");
|
|
57
57
|
const anchor = __importStar(require("@coral-xyz/anchor"));
|
|
58
58
|
const RaydiumIxGenerator_1 = require("../ixGenerator/RaydiumIxGenerator");
|
|
59
|
+
const RaydiumSDK_1 = require("./RaydiumSDK");
|
|
59
60
|
class Transactions {
|
|
60
61
|
/**
|
|
61
62
|
* Prohibit creating instance other than getInstance
|
|
@@ -1073,6 +1074,172 @@ class Transactions {
|
|
|
1073
1074
|
});
|
|
1074
1075
|
});
|
|
1075
1076
|
}
|
|
1077
|
+
limitCloseAutomationIx2(_a) {
|
|
1078
|
+
return __awaiter(this, arguments, void 0, function* ({ connection, params, }) {
|
|
1079
|
+
const program = yield meteora_1.MeteoraDLMM.program(connection);
|
|
1080
|
+
const position = yield program.account.positionV2.fetch(params.position);
|
|
1081
|
+
const dlmmPool = yield meteora_1.MeteoraDLMM.create(connection, position.lbPair);
|
|
1082
|
+
const userPda = (0, functions_1.generateUserPda)(params.userWallet);
|
|
1083
|
+
// Step 1: Claim all fees/rewards, remove all liquidity and close current position
|
|
1084
|
+
// const { userPositions } = await dlmmPool.getPositionsByUserAndLbPair(
|
|
1085
|
+
// userPda
|
|
1086
|
+
// );
|
|
1087
|
+
// const binIdsToRemove = userPositions[0].positionData.positionBinData.map(
|
|
1088
|
+
// (bin) => bin.binId
|
|
1089
|
+
// );
|
|
1090
|
+
const binIdsToRemove = [];
|
|
1091
|
+
for (let i = position.lowerBinId; i <= position.upperBinId; i++) {
|
|
1092
|
+
binIdsToRemove.push(i);
|
|
1093
|
+
}
|
|
1094
|
+
// Claim fees and/or rewards, remove liquidity, and possibly close position from Meteora API (if set)
|
|
1095
|
+
const txn = yield dlmmPool.dlmm.removeLiquidity({
|
|
1096
|
+
user: userPda,
|
|
1097
|
+
position: params.position,
|
|
1098
|
+
binIds: binIdsToRemove,
|
|
1099
|
+
bps: new bn_js_1.default(10000),
|
|
1100
|
+
shouldClaimAndClose: true,
|
|
1101
|
+
});
|
|
1102
|
+
// Filter out non-meteora instructions
|
|
1103
|
+
const ixs = (0, functions_1.getIxs)(txn).filter((ix) => ix.programId.equals(addresses_1.METEORA_DLMM_PROGRAM));
|
|
1104
|
+
const farm = addresses_1.USDC_FARM;
|
|
1105
|
+
const authority = params.userWallet;
|
|
1106
|
+
const iyfProgram = addresses_1.IYF_MAIN;
|
|
1107
|
+
const hawksightAuthority = addresses_1.HS_AUTHORITY;
|
|
1108
|
+
const { params: _params, data } = this.removeLiquidityByRangeInfo(ixs);
|
|
1109
|
+
const { position: _position, lbPair, binArrayBitmapExtension, reserveX, reserveY, tokenXMint, tokenYMint, tokenXProgram, tokenYProgram, binArrayLower, binArrayUpper, eventAuthority, program: meteoraDlmmProgram, } = _params;
|
|
1110
|
+
let userTokenX;
|
|
1111
|
+
let userTokenY;
|
|
1112
|
+
if (params.pdaTokenType === types_1.TokenType.STA) {
|
|
1113
|
+
userTokenX = (0, functions_1.generateUserPdaStorageAccount)(userPda, tokenXMint.pubkey);
|
|
1114
|
+
userTokenY = (0, functions_1.generateUserPdaStorageAccount)(userPda, tokenYMint.pubkey);
|
|
1115
|
+
}
|
|
1116
|
+
else if (params.pdaTokenType === types_1.TokenType.LTA) {
|
|
1117
|
+
userTokenX = (0, functions_1.generateLimitToken)(userPda, tokenXMint.pubkey);
|
|
1118
|
+
userTokenY = (0, functions_1.generateLimitToken)(userPda, tokenYMint.pubkey);
|
|
1119
|
+
}
|
|
1120
|
+
else {
|
|
1121
|
+
userTokenX = (0, functions_1.generateAta)(userPda, tokenXMint.pubkey);
|
|
1122
|
+
userTokenY = (0, functions_1.generateAta)(userPda, tokenYMint.pubkey);
|
|
1123
|
+
}
|
|
1124
|
+
let ix;
|
|
1125
|
+
if (params.isLimitOrder) {
|
|
1126
|
+
const limitTokenX = (0, functions_1.generateLimitToken)(userPda, tokenXMint.pubkey);
|
|
1127
|
+
const limitTokenY = (0, functions_1.generateLimitToken)(userPda, tokenYMint.pubkey);
|
|
1128
|
+
const authorityTokenX = (0, functions_1.generateAta)(hawksightAuthority, tokenXMint.pubkey);
|
|
1129
|
+
const authorityTokenY = (0, functions_1.generateAta)(hawksightAuthority, tokenYMint.pubkey);
|
|
1130
|
+
// @ts-ignore
|
|
1131
|
+
const limitCloseAutomationIx = yield anchor_1.Anchor.instance()
|
|
1132
|
+
.iyfExtension.methods.limitOrderClose(data, params.minBinId, params.maxBinId)
|
|
1133
|
+
.accounts({
|
|
1134
|
+
userPda,
|
|
1135
|
+
hawksightAuthority,
|
|
1136
|
+
authority,
|
|
1137
|
+
position: _position.pubkey,
|
|
1138
|
+
lbPair: lbPair.pubkey,
|
|
1139
|
+
binArrayBitmapExtension: binArrayBitmapExtension.pubkey,
|
|
1140
|
+
limitTokenX,
|
|
1141
|
+
limitTokenY,
|
|
1142
|
+
authorityTokenX,
|
|
1143
|
+
authorityTokenY,
|
|
1144
|
+
systemProgram: web3.SystemProgram.programId,
|
|
1145
|
+
reserveX: reserveX.pubkey,
|
|
1146
|
+
reserveY: reserveY.pubkey,
|
|
1147
|
+
tokenXMint: tokenXMint.pubkey,
|
|
1148
|
+
tokenYMint: tokenYMint.pubkey,
|
|
1149
|
+
tokenProgram: addresses_1.TOKEN_PROGRAM_ID,
|
|
1150
|
+
rent: web3.SYSVAR_RENT_PUBKEY,
|
|
1151
|
+
binArrayLower: binArrayLower.pubkey,
|
|
1152
|
+
binArrayUpper: binArrayUpper.pubkey,
|
|
1153
|
+
eventAuthority: eventAuthority.pubkey,
|
|
1154
|
+
meteoraDlmmProgram: addresses_1.METEORA_DLMM_PROGRAM,
|
|
1155
|
+
ownerFeeX: (0, functions_1.generateAta)(addresses_1.SITE_FEE_OWNER, tokenXMint.pubkey),
|
|
1156
|
+
ownerFeeY: (0, functions_1.generateAta)(addresses_1.SITE_FEE_OWNER, tokenYMint.pubkey),
|
|
1157
|
+
})
|
|
1158
|
+
.instruction();
|
|
1159
|
+
// Instruction via main hawksight contract
|
|
1160
|
+
ix = yield anchor_1.Anchor.instance()
|
|
1161
|
+
.iyfMain.methods.iyfExtensionExecuteV2(limitCloseAutomationIx.data)
|
|
1162
|
+
.accounts({
|
|
1163
|
+
userPda,
|
|
1164
|
+
authority,
|
|
1165
|
+
iyfExtensionProgram: addresses_1.IYF_EXTENSION,
|
|
1166
|
+
})
|
|
1167
|
+
.remainingAccounts([...limitCloseAutomationIx.keys.slice(2)])
|
|
1168
|
+
.instruction();
|
|
1169
|
+
}
|
|
1170
|
+
else {
|
|
1171
|
+
// @ts-ignore
|
|
1172
|
+
const limitCloseAutomationIx = yield anchor_1.Anchor.instance()
|
|
1173
|
+
.iyfExtension.methods.meteoraDlmmLimitCloseAutomation2(data, params.minBinId, params.maxBinId, params.isHawkRefund)
|
|
1174
|
+
.accounts({
|
|
1175
|
+
farm,
|
|
1176
|
+
userPda,
|
|
1177
|
+
authority,
|
|
1178
|
+
iyfProgram,
|
|
1179
|
+
hawksightAuthority,
|
|
1180
|
+
position: _position.pubkey,
|
|
1181
|
+
lbPair: lbPair.pubkey,
|
|
1182
|
+
binArrayBitmapExtension: binArrayBitmapExtension.pubkey,
|
|
1183
|
+
userTokenX,
|
|
1184
|
+
userTokenY,
|
|
1185
|
+
reserveX: reserveX.pubkey,
|
|
1186
|
+
reserveY: reserveY.pubkey,
|
|
1187
|
+
tokenXMint: tokenXMint.pubkey,
|
|
1188
|
+
tokenYMint: tokenYMint.pubkey,
|
|
1189
|
+
tokenXProgram: tokenXProgram.pubkey,
|
|
1190
|
+
tokenYProgram: tokenYProgram.pubkey,
|
|
1191
|
+
binArrayLower: binArrayLower.pubkey,
|
|
1192
|
+
binArrayUpper: binArrayUpper.pubkey,
|
|
1193
|
+
eventAuthority: eventAuthority.pubkey,
|
|
1194
|
+
meteoraDlmmProgram: meteoraDlmmProgram.pubkey,
|
|
1195
|
+
ownerFeeX: (0, functions_1.generateAta)(addresses_1.SITE_FEE_OWNER, tokenXMint.pubkey),
|
|
1196
|
+
ownerFeeY: (0, functions_1.generateAta)(addresses_1.SITE_FEE_OWNER, tokenYMint.pubkey),
|
|
1197
|
+
})
|
|
1198
|
+
.instruction();
|
|
1199
|
+
// Instruction via main hawksight contract
|
|
1200
|
+
ix = yield anchor_1.Anchor.instance()
|
|
1201
|
+
.iyfMain.methods.iyfExtensionExecute(limitCloseAutomationIx.data)
|
|
1202
|
+
.accounts({
|
|
1203
|
+
farm,
|
|
1204
|
+
userPda,
|
|
1205
|
+
authority,
|
|
1206
|
+
iyfProgram,
|
|
1207
|
+
iyfExtensionProgram: addresses_1.IYF_EXTENSION,
|
|
1208
|
+
})
|
|
1209
|
+
.remainingAccounts([
|
|
1210
|
+
limitCloseAutomationIx.keys[4],
|
|
1211
|
+
limitCloseAutomationIx.keys[5],
|
|
1212
|
+
limitCloseAutomationIx.keys[6],
|
|
1213
|
+
limitCloseAutomationIx.keys[7],
|
|
1214
|
+
limitCloseAutomationIx.keys[8],
|
|
1215
|
+
limitCloseAutomationIx.keys[9],
|
|
1216
|
+
limitCloseAutomationIx.keys[10],
|
|
1217
|
+
limitCloseAutomationIx.keys[11],
|
|
1218
|
+
limitCloseAutomationIx.keys[12],
|
|
1219
|
+
limitCloseAutomationIx.keys[13],
|
|
1220
|
+
limitCloseAutomationIx.keys[14],
|
|
1221
|
+
limitCloseAutomationIx.keys[15],
|
|
1222
|
+
limitCloseAutomationIx.keys[16],
|
|
1223
|
+
limitCloseAutomationIx.keys[17],
|
|
1224
|
+
limitCloseAutomationIx.keys[18],
|
|
1225
|
+
limitCloseAutomationIx.keys[19],
|
|
1226
|
+
limitCloseAutomationIx.keys[20],
|
|
1227
|
+
limitCloseAutomationIx.keys[21],
|
|
1228
|
+
])
|
|
1229
|
+
.instruction();
|
|
1230
|
+
}
|
|
1231
|
+
const mainInstructions = [
|
|
1232
|
+
// Limit Close Automation Instruction (Hawksight CPI)
|
|
1233
|
+
ix,
|
|
1234
|
+
];
|
|
1235
|
+
return (0, functions_1.createTransactionMeta)({
|
|
1236
|
+
payer: params.userWallet,
|
|
1237
|
+
description: "Automation IX: Meteora limit close instruction (Full withdraw and close on to specific bin id)",
|
|
1238
|
+
addressLookupTableAddresses: addresses_1.GLOBAL_ALT,
|
|
1239
|
+
mainInstructions,
|
|
1240
|
+
});
|
|
1241
|
+
});
|
|
1242
|
+
}
|
|
1076
1243
|
removeLiquidityByRangeInfo(ixs) {
|
|
1077
1244
|
for (const ix of ixs) {
|
|
1078
1245
|
const programIdMatch = ix.programId.equals(addresses_1.METEORA_DLMM_PROGRAM);
|
|
@@ -2132,6 +2299,19 @@ class Transactions {
|
|
|
2132
2299
|
*/
|
|
2133
2300
|
raydiumOpenPosition(_a) {
|
|
2134
2301
|
return __awaiter(this, arguments, void 0, function* ({ connection, params, }) {
|
|
2302
|
+
// Load the Raydium SDK
|
|
2303
|
+
yield (0, RaydiumSDK_1.load)(connection);
|
|
2304
|
+
// Get the Raydium SDK instance
|
|
2305
|
+
const sdk = (0, RaydiumSDK_1.raydium)();
|
|
2306
|
+
// Get the pool keys (for lookup table account)
|
|
2307
|
+
(0, functions_1.benchmark)({ name: `raydiumOpenPosition`, msg: `sdk.clmm.getClmmPoolKeys` });
|
|
2308
|
+
const poolKeys = yield sdk.clmm.getClmmPoolKeys(params.poolState.toString());
|
|
2309
|
+
(0, functions_1.benchmark)({ name: `raydiumOpenPosition`, msg: `sdk.clmm.getClmmPoolKeys`, end: true });
|
|
2310
|
+
console.log("pool lookup table account:", poolKeys.lookupTableAccount);
|
|
2311
|
+
const addressLookupTableAddresses = [];
|
|
2312
|
+
if (poolKeys.lookupTableAccount) {
|
|
2313
|
+
addressLookupTableAddresses.push(poolKeys.lookupTableAccount);
|
|
2314
|
+
}
|
|
2135
2315
|
const fetch = yield this.ix.raydium.raydiumFetch({
|
|
2136
2316
|
poolState: params.poolState,
|
|
2137
2317
|
});
|
|
@@ -2149,7 +2329,7 @@ class Transactions {
|
|
|
2149
2329
|
toPubkey: userPdaLamport,
|
|
2150
2330
|
lamports,
|
|
2151
2331
|
});
|
|
2152
|
-
const { liquidity, amount0Max: amountX, amount1Max: amountY, } = yield (0, RaydiumIxGenerator_1.getLiquidityFromAmounts)(connection, params.poolState, params.amountX, params.amountY, params.tickLowerIndex, params.tickUpperIndex, params.slippage);
|
|
2332
|
+
const { liquidity, amount0Max: amountX, amount1Max: amountY, } = yield (0, RaydiumIxGenerator_1.getLiquidityFromAmounts)(connection, params.poolState, params.amountX, params.amountY, params.tickLowerIndex, params.tickUpperIndex, params.slippage, true);
|
|
2153
2333
|
const wrapIxs = (0, functions_1.wrapSolIfMintIsWsol)(params.userWallet, params.userWallet, [
|
|
2154
2334
|
{ mint: tokenMint0, amount: amountX },
|
|
2155
2335
|
{ mint: tokenMint1, amount: amountY },
|
|
@@ -2196,7 +2376,7 @@ class Transactions {
|
|
|
2196
2376
|
return yield (0, functions_1.createTransactionMeta)({
|
|
2197
2377
|
payer: params.userWallet,
|
|
2198
2378
|
description: `Open Raydium Position`,
|
|
2199
|
-
addressLookupTableAddresses: addresses_1.GLOBAL_ALT,
|
|
2379
|
+
addressLookupTableAddresses: [...addresses_1.GLOBAL_ALT, ...addressLookupTableAddresses],
|
|
2200
2380
|
mainInstructions,
|
|
2201
2381
|
});
|
|
2202
2382
|
});
|
|
@@ -2214,6 +2394,19 @@ class Transactions {
|
|
|
2214
2394
|
const fetch = yield this.ix.raydium.raydiumFetch({
|
|
2215
2395
|
personalPosition: params.personalPosition,
|
|
2216
2396
|
});
|
|
2397
|
+
// Load the Raydium SDK
|
|
2398
|
+
yield (0, RaydiumSDK_1.load)(connection);
|
|
2399
|
+
// Get the Raydium SDK instance
|
|
2400
|
+
const sdk = (0, RaydiumSDK_1.raydium)();
|
|
2401
|
+
// Get the pool keys (for lookup table account)
|
|
2402
|
+
(0, functions_1.benchmark)({ name: `raydiumWithdrawAndClosePosition`, msg: `sdk.clmm.getClmmPoolKeys` });
|
|
2403
|
+
const poolKeys = yield sdk.clmm.getClmmPoolKeys(fetch.positionInfo.poolId.toString());
|
|
2404
|
+
(0, functions_1.benchmark)({ name: `raydiumWithdrawAndClosePosition`, msg: `sdk.clmm.getClmmPoolKeys`, end: true });
|
|
2405
|
+
console.log("pool lookup table account:", poolKeys.lookupTableAccount);
|
|
2406
|
+
const addressLookupTableAddresses = [];
|
|
2407
|
+
if (poolKeys.lookupTableAccount) {
|
|
2408
|
+
addressLookupTableAddresses.push(poolKeys.lookupTableAccount);
|
|
2409
|
+
}
|
|
2217
2410
|
const withdrawIx = yield this.ix.iyfMain.withdrawMultipleLamportPdaToken({
|
|
2218
2411
|
userWallet: params.userWallet,
|
|
2219
2412
|
withdraw: [
|
|
@@ -2266,7 +2459,7 @@ class Transactions {
|
|
|
2266
2459
|
return (0, functions_1.createTransactionMeta)({
|
|
2267
2460
|
payer: params.userWallet,
|
|
2268
2461
|
description: `Close Raydium Position`,
|
|
2269
|
-
addressLookupTableAddresses: addresses_1.GLOBAL_ALT,
|
|
2462
|
+
addressLookupTableAddresses: [...addresses_1.GLOBAL_ALT, ...addressLookupTableAddresses],
|
|
2270
2463
|
mainInstructions,
|
|
2271
2464
|
});
|
|
2272
2465
|
}
|
|
@@ -2282,7 +2475,7 @@ class Transactions {
|
|
|
2282
2475
|
return (0, functions_1.createTransactionMeta)({
|
|
2283
2476
|
payer: params.userWallet,
|
|
2284
2477
|
description: `Withdraw and close Raydium Position`,
|
|
2285
|
-
addressLookupTableAddresses: addresses_1.GLOBAL_ALT,
|
|
2478
|
+
addressLookupTableAddresses: [...addresses_1.GLOBAL_ALT, ...addressLookupTableAddresses],
|
|
2286
2479
|
mainInstructions,
|
|
2287
2480
|
});
|
|
2288
2481
|
}
|
|
@@ -2331,7 +2524,20 @@ class Transactions {
|
|
|
2331
2524
|
});
|
|
2332
2525
|
const tokenMint0 = fetch.poolStateInfo.tokenMint0;
|
|
2333
2526
|
const tokenMint1 = fetch.poolStateInfo.tokenMint1;
|
|
2334
|
-
|
|
2527
|
+
// Load the Raydium SDK
|
|
2528
|
+
yield (0, RaydiumSDK_1.load)(connection);
|
|
2529
|
+
// Get the Raydium SDK instance
|
|
2530
|
+
const sdk = (0, RaydiumSDK_1.raydium)();
|
|
2531
|
+
// Get the pool keys (for lookup table account)
|
|
2532
|
+
(0, functions_1.benchmark)({ name: `raydiumIncreaseLiquidity`, msg: `sdk.clmm.getClmmPoolKeys` });
|
|
2533
|
+
const poolKeys = yield sdk.clmm.getClmmPoolKeys(fetch.positionInfo.poolId.toString());
|
|
2534
|
+
(0, functions_1.benchmark)({ name: `raydiumIncreaseLiquidity`, msg: `sdk.clmm.getClmmPoolKeys`, end: true });
|
|
2535
|
+
console.log("pool lookup table account:", poolKeys.lookupTableAccount);
|
|
2536
|
+
const addressLookupTableAddresses = [];
|
|
2537
|
+
if (poolKeys.lookupTableAccount) {
|
|
2538
|
+
addressLookupTableAddresses.push(poolKeys.lookupTableAccount);
|
|
2539
|
+
}
|
|
2540
|
+
const { liquidity, amount0Max: amountX, amount1Max: amountY, } = yield (0, RaydiumIxGenerator_1.getLiquidityFromAmounts)(connection, fetch.positionInfo.poolId, params.amountX, params.amountY, fetch.positionInfo.tickLowerIndex, fetch.positionInfo.tickUpperIndex, params.slippage, true);
|
|
2335
2541
|
const wrapIxs = (0, functions_1.wrapSolIfMintIsWsol)(params.userWallet, params.userWallet, [
|
|
2336
2542
|
{ mint: tokenMint0, amount: amountX },
|
|
2337
2543
|
{ mint: tokenMint1, amount: amountY },
|
|
@@ -2372,7 +2578,7 @@ class Transactions {
|
|
|
2372
2578
|
return (0, functions_1.createTransactionMeta)({
|
|
2373
2579
|
payer: params.userWallet,
|
|
2374
2580
|
description: `Raydium increase liquidity`,
|
|
2375
|
-
addressLookupTableAddresses: addresses_1.GLOBAL_ALT,
|
|
2581
|
+
addressLookupTableAddresses: [...addresses_1.GLOBAL_ALT, ...addressLookupTableAddresses],
|
|
2376
2582
|
mainInstructions,
|
|
2377
2583
|
});
|
|
2378
2584
|
});
|
|
@@ -2389,6 +2595,19 @@ class Transactions {
|
|
|
2389
2595
|
const fetch = yield this.ix.raydium.raydiumFetch({
|
|
2390
2596
|
personalPosition: params.personalPosition,
|
|
2391
2597
|
});
|
|
2598
|
+
// Load the Raydium SDK
|
|
2599
|
+
yield (0, RaydiumSDK_1.load)(connection);
|
|
2600
|
+
// Get the Raydium SDK instance
|
|
2601
|
+
const sdk = (0, RaydiumSDK_1.raydium)();
|
|
2602
|
+
// Get the pool keys (for lookup table account)
|
|
2603
|
+
(0, functions_1.benchmark)({ name: `raydiumDecreaseLiquidity`, msg: `sdk.clmm.getClmmPoolKeys` });
|
|
2604
|
+
const poolKeys = yield sdk.clmm.getClmmPoolKeys(fetch.positionInfo.poolId.toString());
|
|
2605
|
+
(0, functions_1.benchmark)({ name: `raydiumDecreaseLiquidity`, msg: `sdk.clmm.getClmmPoolKeys`, end: true });
|
|
2606
|
+
console.log("pool lookup table account:", poolKeys.lookupTableAccount);
|
|
2607
|
+
const addressLookupTableAddresses = [];
|
|
2608
|
+
if (poolKeys.lookupTableAccount) {
|
|
2609
|
+
addressLookupTableAddresses.push(poolKeys.lookupTableAccount);
|
|
2610
|
+
}
|
|
2392
2611
|
const withdrawIx = yield this.ix.iyfMain.withdrawMultipleLamportPdaToken({
|
|
2393
2612
|
userWallet: params.userWallet,
|
|
2394
2613
|
withdraw: [
|
|
@@ -2432,7 +2651,7 @@ class Transactions {
|
|
|
2432
2651
|
return (0, functions_1.createTransactionMeta)({
|
|
2433
2652
|
payer: params.userWallet,
|
|
2434
2653
|
description: `Raydium decrease liquidity`,
|
|
2435
|
-
addressLookupTableAddresses: addresses_1.GLOBAL_ALT,
|
|
2654
|
+
addressLookupTableAddresses: [...addresses_1.GLOBAL_ALT, ...addressLookupTableAddresses],
|
|
2436
2655
|
mainInstructions,
|
|
2437
2656
|
});
|
|
2438
2657
|
});
|
|
@@ -18,7 +18,9 @@ type WithdrawFromLtaParams = {
|
|
|
18
18
|
userWallet: web3.PublicKey;
|
|
19
19
|
withdraw: {
|
|
20
20
|
mint: web3.PublicKey;
|
|
21
|
+
amount: BN;
|
|
21
22
|
}[];
|
|
23
|
+
hasAmount: boolean;
|
|
22
24
|
};
|
|
23
25
|
/**
|
|
24
26
|
* The `TxGenerator` class encapsulates methods to generate transactions with various trading operations
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TxGenerator.d.ts","sourceRoot":"","sources":["../../../src/classes/TxGenerator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AACxC,OAAO,KAAK,OAAO,MAAM,6BAA6B,CAAC;AACvD,OAAO,EACL,6BAA6B,EAC7B,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EAInB,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,kCAAkC,EAClC,mBAAmB,EACnB,oBAAoB,EACpB,wBAAwB,EACxB,wBAAwB,EACxB,aAAa,EACb,sBAAsB,EACtB,qBAAqB,EACrB,SAAS,EACT,+BAA+B,EAChC,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAQlC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGlD,OAAO,EAAE,MAAM,OAAO,CAAC;AAEvB,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAG1D,KAAK,kBAAkB,GAAG;IACxB,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC;IAC3B,OAAO,EAAE;QACP,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;QACrB,MAAM,EAAE,EAAE,CAAC;KACZ,EAAE,CAAC;CACL,CAAC;AAEF,KAAK,qBAAqB,GAAG;IAC3B,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC;IAC3B,QAAQ,EAAE;QACR,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"TxGenerator.d.ts","sourceRoot":"","sources":["../../../src/classes/TxGen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E,wBAAwB,GAC/B,OAAO,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAC;CA6BpD"}
|
|
@@ -267,6 +267,7 @@ class TxGenerator {
|
|
|
267
267
|
payer: params.userWallet,
|
|
268
268
|
withdraw: params.withdraw,
|
|
269
269
|
pdaTokenType: types_1.TokenType.LTA,
|
|
270
|
+
hasAmount: params.hasAmount,
|
|
270
271
|
}));
|
|
271
272
|
// Return executable instructions
|
|
272
273
|
return yield (0, functions_1.legacyTxMetadata)({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as web3 from "@solana/web3.js";
|
|
2
2
|
import * as _client from "@hawksightco/swagger-client";
|
|
3
|
-
import { MeteoraClose, MeteoraCompound, MeteoraLimitCloseAutomation, MeteoraRebalance, MeteoraRebalance2, OpenAutomationIx, ResponseWithStatus, TransactionMetadata } from "../types";
|
|
3
|
+
import { MeteoraClose, MeteoraCompound, MeteoraLimitCloseAutomation, MeteoraLimitCloseAutomation2, MeteoraRebalance, MeteoraRebalance2, OpenAutomationIx, ResponseWithStatus, TransactionMetadata } from "../types";
|
|
4
4
|
import { Client } from "./Client";
|
|
5
5
|
import { GeneralUtility } from "./GeneralUtility";
|
|
6
6
|
/**
|
|
@@ -82,6 +82,17 @@ export declare class TxGeneratorAutomations {
|
|
|
82
82
|
* @returns A ResponseWithStatus containing either TransactionMetadataResponse or TransactionMetadata.
|
|
83
83
|
*/
|
|
84
84
|
meteoraLimitCloseIxs(connection: web3.Connection, payer: string, params: MeteoraLimitCloseAutomation): Promise<ResponseWithStatus<TransactionMetadata>>;
|
|
85
|
+
/**
|
|
86
|
+
* Creates meteora close limit instruction (combination of claim fees/rewards + remove liquidity + close position)
|
|
87
|
+
*
|
|
88
|
+
* NOTE: For hawksight devs only.
|
|
89
|
+
*
|
|
90
|
+
* @param connection The Solana web3 connection object for blockchain interactions.
|
|
91
|
+
* @param payer The public key of the payer for transaction fees.
|
|
92
|
+
* @param params Parameters required
|
|
93
|
+
* @returns A ResponseWithStatus containing either TransactionMetadataResponse or TransactionMetadata.
|
|
94
|
+
*/
|
|
95
|
+
meteoraLimitCloseIxs2(connection: web3.Connection, payer: string, params: MeteoraLimitCloseAutomation2): Promise<ResponseWithStatus<TransactionMetadata>>;
|
|
85
96
|
/**
|
|
86
97
|
* Creates meteora close instruction (combination of claim fees/rewards + remove liquidity + close position)
|
|
87
98
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TxGeneratorAutomations.d.ts","sourceRoot":"","sources":["../../../src/classes/TxGeneratorAutomations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AACxC,OAAO,KAAK,OAAO,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,eAAe,EAAmC,2BAA2B,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,mBAAmB,EAAoD,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"TxGeneratorAutomations.d.ts","sourceRoot":"","sources":["../../../src/classes/TxGeneratorAutomations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AACxC,OAAO,KAAK,OAAO,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,eAAe,EAAmC,2BAA2B,EAAE,4BAA4B,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,mBAAmB,EAAoD,MAAM,UAAU,CAAC;AACvS,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAIlD;;;;;;GAMG;AACH,qBAAa,sBAAsB;IAkB/B,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,cAAc;IAjBjC;;OAEG;IACH,SAAS,CAAC,aAAa,EAAE,OAAO,CAAC,aA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