@hawksightco/hawk-sdk 1.3.9 → 1.3.11
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/CHANGELOG.md +135 -0
- package/README.md +306 -10
- package/dist/src/addresses.d.ts +3 -0
- package/dist/src/addresses.d.ts.map +1 -1
- package/dist/src/addresses.js +21 -8
- package/dist/src/anchor.d.ts +1 -0
- package/dist/src/anchor.d.ts.map +1 -1
- package/dist/src/anchor.js +17 -7
- package/dist/src/classes/Atomicity.d.ts.map +1 -1
- package/dist/src/classes/Client.js +17 -7
- package/dist/src/classes/CombineTransactions.js +17 -7
- package/dist/src/classes/CreateTxMetadata.js +17 -7
- package/dist/src/classes/General.js +17 -7
- package/dist/src/classes/HawkAPI.d.ts.map +1 -1
- package/dist/src/classes/JupiterAlts.js +17 -7
- package/dist/src/classes/Logging.js +2 -3
- package/dist/src/classes/MultiTransaction.js +19 -9
- package/dist/src/classes/RaydiumSDK.js +3 -3
- package/dist/src/classes/SimpleIxGenerator.d.ts.map +1 -1
- package/dist/src/classes/SimpleIxGenerator.js +1 -1
- package/dist/src/classes/Transaction.js +17 -7
- package/dist/src/classes/Transaction2.js +17 -7
- package/dist/src/classes/Transaction3.js +17 -7
- package/dist/src/classes/TransactionBatchExecute.d.ts.map +1 -1
- package/dist/src/classes/TransactionBatchExecute.js +17 -7
- package/dist/src/classes/TransactionBatchExecute2.js +17 -7
- package/dist/src/classes/Transactions.d.ts +4 -0
- package/dist/src/classes/Transactions.d.ts.map +1 -1
- package/dist/src/classes/Transactions.js +53 -26
- package/dist/src/classes/TxGenerator.d.ts.map +1 -1
- package/dist/src/classes/TxGenerator.js +20 -7
- package/dist/src/classes/TxGeneratorAutomations.js +17 -7
- package/dist/src/classes/account-cache/AccountCache.d.ts +0 -1
- package/dist/src/classes/account-cache/AccountCache.d.ts.map +1 -1
- package/dist/src/classes/account-cache/AccountCache.js +17 -7
- package/dist/src/functions.d.ts +5 -6
- package/dist/src/functions.d.ts.map +1 -1
- package/dist/src/functions.js +76 -72
- package/dist/src/hawksight.js +24 -15
- package/dist/src/hsToMeteora.js +429 -13
- package/dist/src/idl/iyf-extension-idl.d.ts +1582 -571
- package/dist/src/idl/iyf-extension-idl.d.ts.map +1 -1
- package/dist/src/idl/iyf-extension-idl.js +1582 -571
- package/dist/src/idl/iyf-main-idl.d.ts +121 -0
- package/dist/src/idl/iyf-main-idl.d.ts.map +1 -1
- package/dist/src/idl/iyf-main-idl.js +121 -0
- package/dist/src/idl/jupiter-idl.d.ts +58 -5
- package/dist/src/idl/jupiter-idl.d.ts.map +1 -1
- package/dist/src/idl/jupiter-idl.js +58 -5
- package/dist/src/ixGenerator/IyfExtensionIxGenerator.d.ts.map +1 -1
- package/dist/src/ixGenerator/IyfExtensionIxGenerator.js +17 -7
- package/dist/src/ixGenerator/IyfMainIxGenerator.d.ts +7 -1
- package/dist/src/ixGenerator/IyfMainIxGenerator.d.ts.map +1 -1
- package/dist/src/ixGenerator/IyfMainIxGenerator.js +40 -7
- package/dist/src/ixGenerator/MeteoraDlmmIxGenerator.js +17 -7
- package/dist/src/ixGenerator/OrcaIxGenerator.d.ts +67 -2
- package/dist/src/ixGenerator/OrcaIxGenerator.d.ts.map +1 -1
- package/dist/src/ixGenerator/OrcaIxGenerator.js +232 -10
- package/dist/src/ixGenerator/RaydiumIxGenerator.js +20 -10
- package/dist/src/meteora.d.ts +1 -1
- package/dist/src/meteora.js +17 -7
- package/dist/src/orca.js +23 -13
- package/dist/src/pdaGenerator/HawksightPdaGenerator.js +17 -7
- package/dist/src/pdaGenerator/OrcaPdaGenerator.d.ts +8 -0
- package/dist/src/pdaGenerator/OrcaPdaGenerator.d.ts.map +1 -1
- package/dist/src/pdaGenerator/OrcaPdaGenerator.js +30 -7
- package/dist/src/pdaGenerator/RaydiumPdaGenerator.js +17 -7
- package/dist/src/pdaGenerator/UtilPdaGenerator.js +17 -7
- package/dist/src/types.d.ts +4 -0
- package/dist/src/types.d.ts.map +1 -1
- package/package.json +20 -3
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
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
|
+
})();
|
|
25
35
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
36
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
37
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as web3 from "@solana/web3.js";
|
|
2
2
|
import { IyfMainIxGenerator } from "./IyfMainIxGenerator";
|
|
3
|
+
import { SimplePdaGenerator } from "../classes/SimplePdaGenerator";
|
|
3
4
|
type OrcaLimitClosePositionAutomation = {
|
|
4
5
|
connection: web3.Connection;
|
|
5
6
|
userWallet: web3.PublicKey;
|
|
@@ -7,17 +8,81 @@ type OrcaLimitClosePositionAutomation = {
|
|
|
7
8
|
minBinId: number;
|
|
8
9
|
maxBinId: number;
|
|
9
10
|
useAta?: boolean;
|
|
11
|
+
is2022Position?: boolean;
|
|
12
|
+
};
|
|
13
|
+
type OrcaAutoOpenPositionWithTokenExtension = {
|
|
14
|
+
connection: web3.Connection;
|
|
15
|
+
userWallet: web3.PublicKey;
|
|
16
|
+
positionMint: web3.PublicKey;
|
|
17
|
+
whirlpool: web3.PublicKey;
|
|
18
|
+
tickLowerIndex: number;
|
|
19
|
+
tickUpperIndex: number;
|
|
20
|
+
withTokenMetadata: boolean;
|
|
21
|
+
is2022Position?: boolean;
|
|
22
|
+
isUsdcFarm?: boolean;
|
|
23
|
+
};
|
|
24
|
+
type OrcaAutoClosePositionWithTokenExtension = {
|
|
25
|
+
connection: web3.Connection;
|
|
26
|
+
userWallet: web3.PublicKey;
|
|
27
|
+
positionMint: web3.PublicKey;
|
|
28
|
+
is2022Position?: boolean;
|
|
29
|
+
};
|
|
30
|
+
type OrcaOpenPositionWithTokenExtension = {
|
|
31
|
+
connection: web3.Connection;
|
|
32
|
+
userWallet: web3.PublicKey;
|
|
33
|
+
positionMint: web3.PublicKey;
|
|
34
|
+
whirlpool: web3.PublicKey;
|
|
35
|
+
tickLowerIndex: number;
|
|
36
|
+
tickUpperIndex: number;
|
|
37
|
+
withTokenMetadata: boolean;
|
|
38
|
+
is2022Position?: boolean;
|
|
39
|
+
};
|
|
40
|
+
type OrcaClosePositionWithTokenExtension = {
|
|
41
|
+
connection: web3.Connection;
|
|
42
|
+
userWallet: web3.PublicKey;
|
|
43
|
+
positionMint: web3.PublicKey;
|
|
44
|
+
is2022Position?: boolean;
|
|
45
|
+
};
|
|
46
|
+
type OrcaLimitClosePositionAutomationTokenExtension = {
|
|
47
|
+
connection: web3.Connection;
|
|
48
|
+
userWallet: web3.PublicKey;
|
|
49
|
+
position: web3.PublicKey;
|
|
50
|
+
minTickIndex: number;
|
|
51
|
+
maxTickIndex: number;
|
|
52
|
+
is2022Position?: boolean;
|
|
53
|
+
useAta?: boolean;
|
|
10
54
|
};
|
|
11
55
|
/**
|
|
12
56
|
* Orca IX Generator
|
|
13
57
|
*/
|
|
14
58
|
export declare class OrcaIxGenerator {
|
|
15
59
|
private iyfMain;
|
|
16
|
-
|
|
60
|
+
private pda;
|
|
61
|
+
constructor(iyfMain: IyfMainIxGenerator, pda: SimplePdaGenerator);
|
|
17
62
|
/**
|
|
18
63
|
* Orca limit close position automation
|
|
19
64
|
*/
|
|
20
|
-
orcaLimitClosePositionAutomation({ connection, userWallet, position, minBinId, maxBinId, useAta, }: OrcaLimitClosePositionAutomation): Promise<web3.TransactionInstruction>;
|
|
65
|
+
orcaLimitClosePositionAutomation({ connection, userWallet, position, minBinId, maxBinId, useAta, is2022Position, }: OrcaLimitClosePositionAutomation): Promise<web3.TransactionInstruction>;
|
|
66
|
+
/**
|
|
67
|
+
* Orca auto open position with Token2022 (Automation)
|
|
68
|
+
*/
|
|
69
|
+
orcaAutoOpenPositionWithTokenExtension({ connection, userWallet, positionMint, whirlpool, tickLowerIndex, tickUpperIndex, withTokenMetadata, is2022Position, isUsdcFarm, }: OrcaAutoOpenPositionWithTokenExtension): Promise<web3.TransactionInstruction>;
|
|
70
|
+
/**
|
|
71
|
+
* Orca auto close position with Token2022 (Automation)
|
|
72
|
+
*/
|
|
73
|
+
orcaAutoClosePositionWithTokenExtension({ connection, userWallet, positionMint, is2022Position, }: OrcaAutoClosePositionWithTokenExtension): Promise<web3.TransactionInstruction>;
|
|
74
|
+
/**
|
|
75
|
+
* Orca open position with Token2022 (User)
|
|
76
|
+
*/
|
|
77
|
+
orcaOpenPositionWithTokenExtension({ connection, userWallet, positionMint, whirlpool, tickLowerIndex, tickUpperIndex, withTokenMetadata, is2022Position, }: OrcaOpenPositionWithTokenExtension): Promise<web3.TransactionInstruction>;
|
|
78
|
+
/**
|
|
79
|
+
* Orca close position with Token2022 (User)
|
|
80
|
+
*/
|
|
81
|
+
orcaClosePositionWithTokenExtension({ connection, userWallet, positionMint, is2022Position, }: OrcaClosePositionWithTokenExtension): Promise<web3.TransactionInstruction>;
|
|
82
|
+
/**
|
|
83
|
+
* Orca limit close position automation with Token2022 support (Automation)
|
|
84
|
+
*/
|
|
85
|
+
orcaLimitClosePositionAutomationTokenExtension({ connection, userWallet, position, minTickIndex, maxTickIndex, is2022Position, useAta }: OrcaLimitClosePositionAutomationTokenExtension): Promise<web3.TransactionInstruction>;
|
|
21
86
|
}
|
|
22
87
|
export {};
|
|
23
88
|
//# sourceMappingURL=OrcaIxGenerator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OrcaIxGenerator.d.ts","sourceRoot":"","sources":["../../../src/ixGenerator/OrcaIxGenerator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AAIxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"OrcaIxGenerator.d.ts","sourceRoot":"","sources":["../../../src/ixGenerator/OrcaIxGenerator.ts"],"names":[],"mappings":"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"}
|
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
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
|
+
})();
|
|
25
35
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
36
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
37
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -42,14 +52,15 @@ const orca_1 = require("../orca");
|
|
|
42
52
|
* Orca IX Generator
|
|
43
53
|
*/
|
|
44
54
|
class OrcaIxGenerator {
|
|
45
|
-
constructor(iyfMain) {
|
|
55
|
+
constructor(iyfMain, pda) {
|
|
46
56
|
this.iyfMain = iyfMain;
|
|
57
|
+
this.pda = pda;
|
|
47
58
|
}
|
|
48
59
|
/**
|
|
49
60
|
* Orca limit close position automation
|
|
50
61
|
*/
|
|
51
62
|
orcaLimitClosePositionAutomation(_a) {
|
|
52
|
-
return __awaiter(this, arguments, void 0, function* ({ connection, userWallet, position, minBinId, maxBinId, useAta = true, }) {
|
|
63
|
+
return __awaiter(this, arguments, void 0, function* ({ connection, userWallet, position, minBinId, maxBinId, useAta = true, is2022Position = false, }) {
|
|
53
64
|
// Initialize anchor
|
|
54
65
|
anchor_1.Anchor.initialize(connection);
|
|
55
66
|
// Generate user pda
|
|
@@ -58,7 +69,7 @@ class OrcaIxGenerator {
|
|
|
58
69
|
const whirlpoolInfo = yield anchor_1.Anchor.instance().orcaProgram.account.whirlpool.fetch(positionInfo.whirlpool);
|
|
59
70
|
const whirlpool = positionInfo.whirlpool;
|
|
60
71
|
const positionMint = positionInfo.positionMint;
|
|
61
|
-
const positionTokenAccount =
|
|
72
|
+
const positionTokenAccount = this.pda.orca.generatePositionTokenAccount(userPda, positionMint, is2022Position);
|
|
62
73
|
const tokenOwnerAccountA = useAta ? (0, functions_1.generateAta)(userPda, whirlpoolInfo.tokenMintA) : (0, functions_1.generateUserPdaStorageAccount)(userPda, whirlpoolInfo.tokenMintA);
|
|
63
74
|
const tokenOwnerAccountB = useAta ? (0, functions_1.generateAta)(userPda, whirlpoolInfo.tokenMintB) : (0, functions_1.generateUserPdaStorageAccount)(userPda, whirlpoolInfo.tokenMintB);
|
|
64
75
|
const tokenVaultA = whirlpoolInfo.tokenVaultA;
|
|
@@ -115,5 +126,216 @@ class OrcaIxGenerator {
|
|
|
115
126
|
});
|
|
116
127
|
});
|
|
117
128
|
}
|
|
129
|
+
/**
|
|
130
|
+
* Orca auto open position with Token2022 (Automation)
|
|
131
|
+
*/
|
|
132
|
+
orcaAutoOpenPositionWithTokenExtension(_a) {
|
|
133
|
+
return __awaiter(this, arguments, void 0, function* ({ connection, userWallet, positionMint, whirlpool, tickLowerIndex, tickUpperIndex, withTokenMetadata, is2022Position = true, isUsdcFarm = true, }) {
|
|
134
|
+
// Initialize anchor
|
|
135
|
+
anchor_1.Anchor.initialize(connection);
|
|
136
|
+
// Generate user pda
|
|
137
|
+
const userPda = (0, functions_1.generateUserPda)(userWallet, isUsdcFarm ? addresses_1.USDC_FARM : addresses_1.SOL_FARM);
|
|
138
|
+
// Generate position and position token account
|
|
139
|
+
const position = this.pda.orca.generateOrcaPositionPDA(positionMint);
|
|
140
|
+
const positionTokenAccount = this.pda.orca.generatePositionTokenAccount(userPda, positionMint, is2022Position);
|
|
141
|
+
// Generate orca auto open position with token extension instruction
|
|
142
|
+
// @ts-ignore
|
|
143
|
+
const ix = yield anchor_1.Anchor.instance().iyfExtension
|
|
144
|
+
.methods
|
|
145
|
+
.orcaAutoOpenPositionWithTokenExtension(tickLowerIndex, tickUpperIndex, withTokenMetadata)
|
|
146
|
+
.accounts({
|
|
147
|
+
userPda,
|
|
148
|
+
hawksightAuthority: addresses_1.HS_AUTHORITY,
|
|
149
|
+
position,
|
|
150
|
+
positionMint,
|
|
151
|
+
positionTokenAccount,
|
|
152
|
+
whirlpool,
|
|
153
|
+
token2022Program: addresses_1.TOKEN_2022,
|
|
154
|
+
systemProgram: web3.SystemProgram.programId,
|
|
155
|
+
associatedTokenProgram: addresses_1.ASSOCIATED_TOKEN_PROGRAM,
|
|
156
|
+
metadataUpdateAuth: addresses_1.ORCA_METADATA_UPDATE_AUTH,
|
|
157
|
+
orcaWhirlpoolProgram: addresses_1.ORCA_WHIRLPOOL_PROGRAM,
|
|
158
|
+
})
|
|
159
|
+
.instruction();
|
|
160
|
+
// Wrap instruction in iyf extension executeV2 (iyf-main)
|
|
161
|
+
return yield this.iyfMain.iyfExtensionExecuteV2(connection, {
|
|
162
|
+
userPda,
|
|
163
|
+
authority: addresses_1.HS_AUTHORITY,
|
|
164
|
+
ix
|
|
165
|
+
});
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Orca auto close position with Token2022 (Automation)
|
|
170
|
+
*/
|
|
171
|
+
orcaAutoClosePositionWithTokenExtension(_a) {
|
|
172
|
+
return __awaiter(this, arguments, void 0, function* ({ connection, userWallet, positionMint, is2022Position = true, }) {
|
|
173
|
+
// Initialize anchor
|
|
174
|
+
anchor_1.Anchor.initialize(connection);
|
|
175
|
+
// Generate user pda
|
|
176
|
+
const userPda = (0, functions_1.generateUserPda)(userWallet);
|
|
177
|
+
// Generate position and position token account
|
|
178
|
+
const position = this.pda.orca.generateOrcaPositionPDA(positionMint);
|
|
179
|
+
const positionTokenAccount = this.pda.orca.generatePositionTokenAccount(userPda, positionMint, is2022Position);
|
|
180
|
+
// Generate orca auto close position with token extension instruction
|
|
181
|
+
// @ts-ignore
|
|
182
|
+
const ix = yield anchor_1.Anchor.instance().iyfExtension
|
|
183
|
+
.methods
|
|
184
|
+
.orcaAutoClosePositionWithTokenExtension()
|
|
185
|
+
.accounts({
|
|
186
|
+
userPda,
|
|
187
|
+
hawksightAuthority: addresses_1.HS_AUTHORITY,
|
|
188
|
+
position,
|
|
189
|
+
positionMint,
|
|
190
|
+
positionTokenAccount,
|
|
191
|
+
token2022Program: addresses_1.TOKEN_2022,
|
|
192
|
+
orcaWhirlpoolProgram: addresses_1.ORCA_WHIRLPOOL_PROGRAM,
|
|
193
|
+
})
|
|
194
|
+
.instruction();
|
|
195
|
+
// Wrap instruction in iyf extension executeV2 (iyf-main)
|
|
196
|
+
return yield this.iyfMain.iyfExtensionExecuteV2(connection, {
|
|
197
|
+
userPda,
|
|
198
|
+
authority: addresses_1.HS_AUTHORITY,
|
|
199
|
+
ix
|
|
200
|
+
});
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Orca open position with Token2022 (User)
|
|
205
|
+
*/
|
|
206
|
+
orcaOpenPositionWithTokenExtension(_a) {
|
|
207
|
+
return __awaiter(this, arguments, void 0, function* ({ connection, userWallet, positionMint, whirlpool, tickLowerIndex, tickUpperIndex, withTokenMetadata, is2022Position = true, }) {
|
|
208
|
+
// Initialize anchor
|
|
209
|
+
anchor_1.Anchor.initialize(connection);
|
|
210
|
+
// Generate user pda
|
|
211
|
+
const userPda = (0, functions_1.generateUserPda)(userWallet);
|
|
212
|
+
// Generate position and position token account
|
|
213
|
+
const position = this.pda.orca.generateOrcaPositionPDA(positionMint);
|
|
214
|
+
const positionTokenAccount = this.pda.orca.generatePositionTokenAccount(userPda, positionMint, is2022Position);
|
|
215
|
+
// Generate orca open position with token extension instruction
|
|
216
|
+
// @ts-ignore
|
|
217
|
+
const ix = yield anchor_1.Anchor.instance().iyfExtension
|
|
218
|
+
.methods
|
|
219
|
+
.orcaOpenPositionWithTokenExtension(tickLowerIndex, tickUpperIndex, withTokenMetadata)
|
|
220
|
+
.accounts({
|
|
221
|
+
userPda,
|
|
222
|
+
authority: userWallet,
|
|
223
|
+
position,
|
|
224
|
+
positionMint,
|
|
225
|
+
positionTokenAccount,
|
|
226
|
+
whirlpool,
|
|
227
|
+
token2022Program: addresses_1.TOKEN_2022,
|
|
228
|
+
systemProgram: web3.SystemProgram.programId,
|
|
229
|
+
associatedTokenProgram: addresses_1.ASSOCIATED_TOKEN_PROGRAM,
|
|
230
|
+
metadataUpdateAuth: addresses_1.ORCA_METADATA_UPDATE_AUTH,
|
|
231
|
+
orcaWhirlpoolProgram: addresses_1.ORCA_WHIRLPOOL_PROGRAM,
|
|
232
|
+
})
|
|
233
|
+
.instruction();
|
|
234
|
+
// Wrap instruction in iyf extension executeV2 (iyf-main)
|
|
235
|
+
return yield this.iyfMain.iyfExtensionExecuteV2(connection, {
|
|
236
|
+
userPda,
|
|
237
|
+
authority: userWallet,
|
|
238
|
+
ix
|
|
239
|
+
});
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Orca close position with Token2022 (User)
|
|
244
|
+
*/
|
|
245
|
+
orcaClosePositionWithTokenExtension(_a) {
|
|
246
|
+
return __awaiter(this, arguments, void 0, function* ({ connection, userWallet, positionMint, is2022Position = true, }) {
|
|
247
|
+
// Initialize anchor
|
|
248
|
+
anchor_1.Anchor.initialize(connection);
|
|
249
|
+
// Generate user pda
|
|
250
|
+
const userPda = (0, functions_1.generateUserPda)(userWallet);
|
|
251
|
+
// Generate position and position token account
|
|
252
|
+
const position = this.pda.orca.generateOrcaPositionPDA(positionMint);
|
|
253
|
+
const positionTokenAccount = this.pda.orca.generatePositionTokenAccount(userPda, positionMint, is2022Position);
|
|
254
|
+
// Generate orca close position with token extension instruction
|
|
255
|
+
// @ts-ignore
|
|
256
|
+
const ix = yield anchor_1.Anchor.instance().iyfExtension
|
|
257
|
+
.methods
|
|
258
|
+
.orcaClosePositionWithTokenExtension()
|
|
259
|
+
.accounts({
|
|
260
|
+
userPda,
|
|
261
|
+
authority: userWallet,
|
|
262
|
+
position,
|
|
263
|
+
positionMint,
|
|
264
|
+
positionTokenAccount,
|
|
265
|
+
token2022Program: addresses_1.TOKEN_2022,
|
|
266
|
+
orcaWhirlpoolProgram: addresses_1.ORCA_WHIRLPOOL_PROGRAM,
|
|
267
|
+
})
|
|
268
|
+
.instruction();
|
|
269
|
+
// Wrap instruction in iyf extension executeV2 (iyf-main)
|
|
270
|
+
return yield this.iyfMain.iyfExtensionExecuteV2(connection, {
|
|
271
|
+
userPda,
|
|
272
|
+
authority: userWallet,
|
|
273
|
+
ix
|
|
274
|
+
});
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* Orca limit close position automation with Token2022 support (Automation)
|
|
279
|
+
*/
|
|
280
|
+
orcaLimitClosePositionAutomationTokenExtension(_a) {
|
|
281
|
+
return __awaiter(this, arguments, void 0, function* ({ connection, userWallet, position, minTickIndex, maxTickIndex, is2022Position = true, useAta = false }) {
|
|
282
|
+
// Initialize anchor
|
|
283
|
+
anchor_1.Anchor.initialize(connection);
|
|
284
|
+
// Generate user pda
|
|
285
|
+
const userPda = (0, functions_1.generateUserPda)(userWallet);
|
|
286
|
+
const positionInfo = yield anchor_1.Anchor.instance().orcaProgram.account.position.fetch(position);
|
|
287
|
+
const whirlpoolInfo = yield anchor_1.Anchor.instance().orcaProgram.account.whirlpool.fetch(positionInfo.whirlpool);
|
|
288
|
+
const whirlpool = positionInfo.whirlpool;
|
|
289
|
+
const positionMint = positionInfo.positionMint;
|
|
290
|
+
const positionTokenAccount = this.pda.orca.generatePositionTokenAccount(userPda, positionMint, is2022Position);
|
|
291
|
+
const tokenOwnerAccountA = useAta
|
|
292
|
+
? (0, functions_1.generateAta)(userPda, whirlpoolInfo.tokenMintA)
|
|
293
|
+
: (0, functions_1.generateUserPdaStorageAccount)(userPda, whirlpoolInfo.tokenMintA);
|
|
294
|
+
const tokenOwnerAccountB = useAta
|
|
295
|
+
? (0, functions_1.generateAta)(userPda, whirlpoolInfo.tokenMintB)
|
|
296
|
+
: (0, functions_1.generateUserPdaStorageAccount)(userPda, whirlpoolInfo.tokenMintB);
|
|
297
|
+
const tokenVaultA = whirlpoolInfo.tokenVaultA;
|
|
298
|
+
const tokenVaultB = whirlpoolInfo.tokenVaultB;
|
|
299
|
+
const startIndex = (0, orca_1.getStartTickIndex)(positionInfo.tickLowerIndex, whirlpoolInfo.tickSpacing);
|
|
300
|
+
const nextIndex = (0, orca_1.getStartTickIndex)(positionInfo.tickUpperIndex, whirlpoolInfo.tickSpacing);
|
|
301
|
+
const { publicKey: tickArrayLower } = (0, orca_1.getTickArray)(addresses_1.ORCA_WHIRLPOOL_PROGRAM, whirlpool, startIndex);
|
|
302
|
+
const { publicKey: tickArrayUpper } = (0, orca_1.getTickArray)(addresses_1.ORCA_WHIRLPOOL_PROGRAM, whirlpool, nextIndex);
|
|
303
|
+
const ownerFeeA = (0, functions_1.generateAta)(addresses_1.SITE_FEE_OWNER, whirlpoolInfo.tokenMintA);
|
|
304
|
+
const ownerFeeB = (0, functions_1.generateAta)(addresses_1.SITE_FEE_OWNER, whirlpoolInfo.tokenMintB);
|
|
305
|
+
// Generate orca limit close position automation token extension instruction
|
|
306
|
+
// @ts-ignore
|
|
307
|
+
const ix = yield anchor_1.Anchor.instance().iyfExtension
|
|
308
|
+
.methods
|
|
309
|
+
.orcaLimitClosePositionAutomationTokenExtension(minTickIndex, maxTickIndex)
|
|
310
|
+
.accounts({
|
|
311
|
+
userPda,
|
|
312
|
+
hawksightAuthority: addresses_1.HS_AUTHORITY,
|
|
313
|
+
authority: userWallet,
|
|
314
|
+
orcaWhirlpoolProgram: addresses_1.ORCA_WHIRLPOOL_PROGRAM,
|
|
315
|
+
positionMint,
|
|
316
|
+
whirlpool,
|
|
317
|
+
position,
|
|
318
|
+
positionTokenAccount,
|
|
319
|
+
tokenOwnerAccountA,
|
|
320
|
+
tokenOwnerAccountB,
|
|
321
|
+
tokenVaultA,
|
|
322
|
+
tokenVaultB,
|
|
323
|
+
tickArrayLower,
|
|
324
|
+
tickArrayUpper,
|
|
325
|
+
ownerFeeA,
|
|
326
|
+
ownerFeeB,
|
|
327
|
+
tokenProgram: addresses_1.TOKEN_PROGRAM_ID, // SPL Token for fees/liquidity
|
|
328
|
+
token2022Program: addresses_1.TOKEN_2022, // Token2022 for position operations
|
|
329
|
+
associatedTokenProgram: addresses_1.ASSOCIATED_TOKEN_PROGRAM,
|
|
330
|
+
})
|
|
331
|
+
.instruction();
|
|
332
|
+
// Wrap instruction in iyf extension executeV2 (iyf-main) - AUTOMATION
|
|
333
|
+
return yield this.iyfMain.iyfExtensionExecuteV2(connection, {
|
|
334
|
+
userPda,
|
|
335
|
+
authority: addresses_1.HS_AUTHORITY, // Automation operation
|
|
336
|
+
ix
|
|
337
|
+
});
|
|
338
|
+
});
|
|
339
|
+
}
|
|
118
340
|
}
|
|
119
341
|
exports.OrcaIxGenerator = OrcaIxGenerator;
|
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
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
|
+
})();
|
|
25
35
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
36
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
37
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -35,7 +45,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
35
45
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
46
|
};
|
|
37
47
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
-
exports.
|
|
48
|
+
exports.RaydiumIxGenerator = void 0;
|
|
49
|
+
exports.getLiquidityFromAmounts = getLiquidityFromAmounts;
|
|
50
|
+
exports.getAmountsFromLiquidity = getAmountsFromLiquidity;
|
|
39
51
|
const web3 = __importStar(require("@solana/web3.js"));
|
|
40
52
|
const anchor_1 = require("../anchor");
|
|
41
53
|
const functions_1 = require("../functions");
|
|
@@ -517,7 +529,6 @@ function getLiquidityFromAmounts(connection, poolId, amountA, amountB, tickLower
|
|
|
517
529
|
};
|
|
518
530
|
});
|
|
519
531
|
}
|
|
520
|
-
exports.getLiquidityFromAmounts = getLiquidityFromAmounts;
|
|
521
532
|
function getAmountsFromLiquidity(connection, poolId, liquidity, tickLower, tickUpper, slippage, add) {
|
|
522
533
|
return __awaiter(this, void 0, void 0, function* () {
|
|
523
534
|
// Load the Raydium SDK
|
|
@@ -561,4 +572,3 @@ function getAmountsFromLiquidity(connection, poolId, liquidity, tickLower, tickU
|
|
|
561
572
|
};
|
|
562
573
|
});
|
|
563
574
|
}
|
|
564
|
-
exports.getAmountsFromLiquidity = getAmountsFromLiquidity;
|
package/dist/src/meteora.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ export declare class MeteoraDLMM {
|
|
|
30
30
|
getActiveBin(): Promise<import("@meteora-ag/dlmm").BinLiquidity>;
|
|
31
31
|
getPositionsByUserAndLbPair(userPubKey: web3.PublicKey): Promise<{
|
|
32
32
|
activeBin: import("@meteora-ag/dlmm").BinLiquidity;
|
|
33
|
-
userPositions: LbPosition
|
|
33
|
+
userPositions: Array<LbPosition>;
|
|
34
34
|
}>;
|
|
35
35
|
/**
|
|
36
36
|
* Initializes a position and adds liquidity to the specified strategy, with various steps including
|
package/dist/src/meteora.js
CHANGED
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
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
|
+
})();
|
|
25
35
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
36
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
37
|
return new (P || (P = Promise))(function (resolve, reject) {
|
package/dist/src/orca.js
CHANGED
|
@@ -15,18 +15,33 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
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
|
+
})();
|
|
25
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
37
|
};
|
|
28
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.
|
|
39
|
+
exports.PDA_TICK_ARRAY_SEED = exports.MAX_TICK_INDEX = exports.MIN_TICK_INDEX = exports.TICK_ARRAY_SIZE = void 0;
|
|
40
|
+
exports.getTickArrayFromTickIndex = getTickArrayFromTickIndex;
|
|
41
|
+
exports.getStartTickIndex = getStartTickIndex;
|
|
42
|
+
exports.getNextStartTick = getNextStartTick;
|
|
43
|
+
exports.getPreviousStartTick = getPreviousStartTick;
|
|
44
|
+
exports.getTickArray = getTickArray;
|
|
30
45
|
const web3 = __importStar(require("@solana/web3.js"));
|
|
31
46
|
const tiny_invariant_1 = __importDefault(require("tiny-invariant"));
|
|
32
47
|
exports.TICK_ARRAY_SIZE = 88;
|
|
@@ -48,7 +63,6 @@ function getTickArrayFromTickIndex(tickIndex, tickSpacing, whirlpool, programId,
|
|
|
48
63
|
const startIndex = getStartTickIndex(tickIndex, tickSpacing, tickArrayOffset);
|
|
49
64
|
return getTickArray(programId, whirlpool, startIndex);
|
|
50
65
|
}
|
|
51
|
-
exports.getTickArrayFromTickIndex = getTickArrayFromTickIndex;
|
|
52
66
|
/**
|
|
53
67
|
* Get the startIndex of the tick array containing tickIndex.
|
|
54
68
|
*
|
|
@@ -66,7 +80,6 @@ function getStartTickIndex(tickIndex, tickSpacing, offset = 0) {
|
|
|
66
80
|
(0, tiny_invariant_1.default)(startTickIndex <= exports.MAX_TICK_INDEX, `startTickIndex is too large - ${startTickIndex}`);
|
|
67
81
|
return startTickIndex;
|
|
68
82
|
}
|
|
69
|
-
exports.getStartTickIndex = getStartTickIndex;
|
|
70
83
|
/**
|
|
71
84
|
* Returns next start tick
|
|
72
85
|
*
|
|
@@ -80,7 +93,6 @@ function getNextStartTick(tickIndex, tickSpacing) {
|
|
|
80
93
|
const nextTick = getStartTickIndex(startTick + multiple, tickSpacing);
|
|
81
94
|
return nextTick;
|
|
82
95
|
}
|
|
83
|
-
exports.getNextStartTick = getNextStartTick;
|
|
84
96
|
/**
|
|
85
97
|
* Returns previous start tick
|
|
86
98
|
*
|
|
@@ -94,7 +106,6 @@ function getPreviousStartTick(tickIndex, tickSpacing) {
|
|
|
94
106
|
const nextTick = getStartTickIndex(startTick - multiple, tickSpacing);
|
|
95
107
|
return nextTick;
|
|
96
108
|
}
|
|
97
|
-
exports.getPreviousStartTick = getPreviousStartTick;
|
|
98
109
|
/**
|
|
99
110
|
* @category Program Derived Addresses
|
|
100
111
|
* @param programId
|
|
@@ -110,4 +121,3 @@ function getTickArray(programId, whirlpoolAddress, startTick) {
|
|
|
110
121
|
], programId);
|
|
111
122
|
return { bump, publicKey };
|
|
112
123
|
}
|
|
113
|
-
exports.getTickArray = getTickArray;
|
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
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
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
36
|
exports.HawksightPdaGenerator = void 0;
|
|
27
37
|
const web3 = __importStar(require("@solana/web3.js"));
|
|
@@ -11,5 +11,13 @@ export declare class OrcaPdaGenerator {
|
|
|
11
11
|
* @returns
|
|
12
12
|
*/
|
|
13
13
|
generateOrcaPositionPDA(positionMint: web3.PublicKey): web3.PublicKey;
|
|
14
|
+
/**
|
|
15
|
+
* Generate position token account based on token program type
|
|
16
|
+
* @param userPda - User PDA account
|
|
17
|
+
* @param positionMint - Position mint (NFT mint)
|
|
18
|
+
* @param is2022Position - Whether this is a Token2022 position (default: false)
|
|
19
|
+
* @returns Position token account address
|
|
20
|
+
*/
|
|
21
|
+
generatePositionTokenAccount(userPda: web3.PublicKey, positionMint: web3.PublicKey, is2022Position?: boolean): web3.PublicKey;
|
|
14
22
|
}
|
|
15
23
|
//# sourceMappingURL=OrcaPdaGenerator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OrcaPdaGenerator.d.ts","sourceRoot":"","sources":["../../../src/pdaGenerator/OrcaPdaGenerator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"OrcaPdaGenerator.d.ts","sourceRoot":"","sources":["../../../src/pdaGenerator/OrcaPdaGenerator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AAIxC;;GAEG;AACH,qBAAa,gBAAgB;IAE3B;;;;;;OAMG;IACH,uBAAuB,CACrB,YAAY,EAAE,IAAI,CAAC,SAAS,GAC3B,IAAI,CAAC,SAAS;IAQjB;;;;;;OAMG;IACH,4BAA4B,CAC1B,OAAO,EAAE,IAAI,CAAC,SAAS,EACvB,YAAY,EAAE,IAAI,CAAC,SAAS,EAC5B,cAAc,GAAE,OAAe,GAC9B,IAAI,CAAC,SAAS;CAKlB"}
|