@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.
- package/package.json +1 -1
- package/dist/src/addresses.d.ts +0 -37
- package/dist/src/addresses.d.ts.map +0 -1
- package/dist/src/addresses.js +0 -84
- package/dist/src/anchor.d.ts +0 -22
- package/dist/src/anchor.d.ts.map +0 -1
- package/dist/src/anchor.js +0 -121
- package/dist/src/classes/AltStorage.d.ts +0 -29
- package/dist/src/classes/AltStorage.d.ts.map +0 -1
- package/dist/src/classes/AltStorage.js +0 -58
- package/dist/src/classes/Atomicity.d.ts +0 -34
- package/dist/src/classes/Atomicity.d.ts.map +0 -1
- package/dist/src/classes/Atomicity.js +0 -110
- package/dist/src/classes/Client.d.ts +0 -35
- package/dist/src/classes/Client.d.ts.map +0 -1
- package/dist/src/classes/Client.js +0 -66
- package/dist/src/classes/CombineTransactions.d.ts +0 -11
- package/dist/src/classes/CombineTransactions.d.ts.map +0 -1
- package/dist/src/classes/CombineTransactions.js +0 -58
- package/dist/src/classes/CreateTxMetadata.d.ts +0 -100
- package/dist/src/classes/CreateTxMetadata.d.ts.map +0 -1
- package/dist/src/classes/CreateTxMetadata.js +0 -415
- package/dist/src/classes/General.d.ts +0 -87
- package/dist/src/classes/General.d.ts.map +0 -1
- package/dist/src/classes/General.js +0 -176
- package/dist/src/classes/GeneralUtility.d.ts +0 -79
- package/dist/src/classes/GeneralUtility.d.ts.map +0 -1
- package/dist/src/classes/GeneralUtility.js +0 -121
- package/dist/src/classes/HawkAPI.d.ts +0 -122
- package/dist/src/classes/HawkAPI.d.ts.map +0 -1
- package/dist/src/classes/HawkAPI.js +0 -169
- package/dist/src/classes/Health.d.ts +0 -29
- package/dist/src/classes/Health.d.ts.map +0 -1
- package/dist/src/classes/Health.js +0 -48
- package/dist/src/classes/JupiterAlts.d.ts +0 -37
- package/dist/src/classes/JupiterAlts.d.ts.map +0 -1
- package/dist/src/classes/JupiterAlts.js +0 -114
- package/dist/src/classes/JupiterSwap.d.ts +0 -21
- package/dist/src/classes/JupiterSwap.d.ts.map +0 -1
- package/dist/src/classes/JupiterSwap.js +0 -40
- package/dist/src/classes/Logging.d.ts +0 -13
- package/dist/src/classes/Logging.d.ts.map +0 -1
- package/dist/src/classes/Logging.js +0 -50
- package/dist/src/classes/MultiTransaction.d.ts +0 -75
- package/dist/src/classes/MultiTransaction.d.ts.map +0 -1
- package/dist/src/classes/MultiTransaction.js +0 -296
- package/dist/src/classes/RaydiumSDK.d.ts +0 -67
- package/dist/src/classes/RaydiumSDK.d.ts.map +0 -1
- package/dist/src/classes/RaydiumSDK.js +0 -206
- package/dist/src/classes/Search.d.ts +0 -100
- package/dist/src/classes/Search.d.ts.map +0 -1
- package/dist/src/classes/Search.js +0 -216
- package/dist/src/classes/SimpleIxGenerator.d.ts +0 -57
- package/dist/src/classes/SimpleIxGenerator.d.ts.map +0 -1
- package/dist/src/classes/SimpleIxGenerator.js +0 -62
- package/dist/src/classes/SimplePdaGenerator.d.ts +0 -28
- package/dist/src/classes/SimplePdaGenerator.d.ts.map +0 -1
- package/dist/src/classes/SimplePdaGenerator.js +0 -33
- package/dist/src/classes/Transaction.d.ts +0 -229
- package/dist/src/classes/Transaction.d.ts.map +0 -1
- package/dist/src/classes/Transaction.js +0 -643
- package/dist/src/classes/Transaction2.d.ts +0 -107
- package/dist/src/classes/Transaction2.d.ts.map +0 -1
- package/dist/src/classes/Transaction2.js +0 -249
- package/dist/src/classes/Transaction3.d.ts +0 -165
- package/dist/src/classes/Transaction3.d.ts.map +0 -1
- package/dist/src/classes/Transaction3.js +0 -416
- package/dist/src/classes/TransactionBatchExecute.d.ts +0 -163
- package/dist/src/classes/TransactionBatchExecute.d.ts.map +0 -1
- package/dist/src/classes/TransactionBatchExecute.js +0 -466
- package/dist/src/classes/TransactionBatchExecute2.d.ts +0 -99
- package/dist/src/classes/TransactionBatchExecute2.d.ts.map +0 -1
- package/dist/src/classes/TransactionBatchExecute2.js +0 -357
- package/dist/src/classes/Transactions.d.ts +0 -586
- package/dist/src/classes/Transactions.d.ts.map +0 -1
- package/dist/src/classes/Transactions.js +0 -7658
- package/dist/src/classes/TxGenerator.d.ts +0 -350
- package/dist/src/classes/TxGenerator.d.ts.map +0 -1
- package/dist/src/classes/TxGenerator.js +0 -1957
- package/dist/src/classes/TxGeneratorAutomations.d.ts +0 -186
- package/dist/src/classes/TxGeneratorAutomations.d.ts.map +0 -1
- package/dist/src/classes/TxGeneratorAutomations.js +0 -897
- package/dist/src/classes/Util.d.ts +0 -87
- package/dist/src/classes/Util.d.ts.map +0 -1
- package/dist/src/classes/Util.js +0 -148
- package/dist/src/classes/account-cache/AccountCache.d.ts +0 -54
- package/dist/src/classes/account-cache/AccountCache.d.ts.map +0 -1
- package/dist/src/classes/account-cache/AccountCache.js +0 -143
- package/dist/src/classes/account-cache/MintCache.d.ts +0 -33
- package/dist/src/classes/account-cache/MintCache.d.ts.map +0 -1
- package/dist/src/classes/account-cache/MintCache.js +0 -47
- package/dist/src/classes/account-cache/TokenCache.d.ts +0 -33
- package/dist/src/classes/account-cache/TokenCache.d.ts.map +0 -1
- package/dist/src/classes/account-cache/TokenCache.js +0 -47
- package/dist/src/errors.d.ts +0 -13
- package/dist/src/errors.d.ts.map +0 -1
- package/dist/src/errors.js +0 -96
- package/dist/src/functions.d.ts +0 -514
- package/dist/src/functions.d.ts.map +0 -1
- package/dist/src/functions.js +0 -1636
- package/dist/src/hawksight.d.ts +0 -53
- package/dist/src/hawksight.d.ts.map +0 -1
- package/dist/src/hawksight.js +0 -328
- package/dist/src/hsToMeteora.d.ts +0 -31
- package/dist/src/hsToMeteora.d.ts.map +0 -1
- package/dist/src/hsToMeteora.js +0 -3175
- package/dist/src/idl/iyf-extension-idl.d.ts +0 -14583
- package/dist/src/idl/iyf-extension-idl.d.ts.map +0 -1
- package/dist/src/idl/iyf-extension-idl.js +0 -14578
- package/dist/src/idl/iyf-extension-wrapper.d.ts +0 -112
- package/dist/src/idl/iyf-extension-wrapper.d.ts.map +0 -1
- package/dist/src/idl/iyf-extension-wrapper.js +0 -2
- package/dist/src/idl/iyf-main-idl.d.ts +0 -11329
- package/dist/src/idl/iyf-main-idl.d.ts.map +0 -1
- package/dist/src/idl/iyf-main-idl.js +0 -11324
- package/dist/src/idl/iyf-main-wrapper.d.ts +0 -112
- package/dist/src/idl/iyf-main-wrapper.d.ts.map +0 -1
- package/dist/src/idl/iyf-main-wrapper.js +0 -2
- package/dist/src/idl/jupiter-idl.d.ts +0 -3063
- package/dist/src/idl/jupiter-idl.d.ts.map +0 -1
- package/dist/src/idl/jupiter-idl.js +0 -3061
- package/dist/src/idl/meteora-idl.d.ts +0 -7371
- package/dist/src/idl/meteora-idl.d.ts.map +0 -1
- package/dist/src/idl/meteora-idl.js +0 -7372
- package/dist/src/idl/orca-idl.d.ts +0 -3833
- package/dist/src/idl/orca-idl.d.ts.map +0 -1
- package/dist/src/idl/orca-idl.js +0 -3834
- package/dist/src/idl/raydium-idl.d.ts +0 -3054
- package/dist/src/idl/raydium-idl.d.ts.map +0 -1
- package/dist/src/idl/raydium-idl.js +0 -3055
- package/dist/src/index.d.ts +0 -9
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/index.js +0 -31
- package/dist/src/ixGenerator/IyfExtensionIxGenerator.d.ts +0 -126
- package/dist/src/ixGenerator/IyfExtensionIxGenerator.d.ts.map +0 -1
- package/dist/src/ixGenerator/IyfExtensionIxGenerator.js +0 -467
- package/dist/src/ixGenerator/IyfMainIxGenerator.d.ts +0 -330
- package/dist/src/ixGenerator/IyfMainIxGenerator.d.ts.map +0 -1
- package/dist/src/ixGenerator/IyfMainIxGenerator.js +0 -1239
- package/dist/src/ixGenerator/MeteoraDlmmIxGenerator.d.ts +0 -685
- package/dist/src/ixGenerator/MeteoraDlmmIxGenerator.d.ts.map +0 -1
- package/dist/src/ixGenerator/MeteoraDlmmIxGenerator.js +0 -3005
- package/dist/src/ixGenerator/OrcaIxGenerator.d.ts +0 -119
- package/dist/src/ixGenerator/OrcaIxGenerator.d.ts.map +0 -1
- package/dist/src/ixGenerator/OrcaIxGenerator.js +0 -438
- package/dist/src/ixGenerator/RaydiumIxGenerator.d.ts +0 -99
- package/dist/src/ixGenerator/RaydiumIxGenerator.d.ts.map +0 -1
- package/dist/src/ixGenerator/RaydiumIxGenerator.js +0 -558
- package/dist/src/ixGenerator/UtilIxGenerator.d.ts +0 -20
- package/dist/src/ixGenerator/UtilIxGenerator.d.ts.map +0 -1
- package/dist/src/ixGenerator/UtilIxGenerator.js +0 -25
- package/dist/src/meteora/index.d.ts +0 -2
- package/dist/src/meteora/index.d.ts.map +0 -1
- package/dist/src/meteora/index.js +0 -17
- package/dist/src/meteora/liquidityStrategy.d.ts +0 -408
- package/dist/src/meteora/liquidityStrategy.d.ts.map +0 -1
- package/dist/src/meteora/liquidityStrategy.js +0 -1325
- package/dist/src/meteora.d.ts +0 -669
- package/dist/src/meteora.d.ts.map +0 -1
- package/dist/src/meteora.js +0 -1932
- package/dist/src/orca.d.ts +0 -57
- package/dist/src/orca.d.ts.map +0 -1
- package/dist/src/orca.js +0 -123
- package/dist/src/pdaGenerator/HawksightPdaGenerator.d.ts +0 -29
- package/dist/src/pdaGenerator/HawksightPdaGenerator.d.ts.map +0 -1
- package/dist/src/pdaGenerator/HawksightPdaGenerator.js +0 -75
- package/dist/src/pdaGenerator/MeteoraPdaGenerator.d.ts +0 -76
- package/dist/src/pdaGenerator/MeteoraPdaGenerator.d.ts.map +0 -1
- package/dist/src/pdaGenerator/MeteoraPdaGenerator.js +0 -166
- package/dist/src/pdaGenerator/OrcaPdaGenerator.d.ts +0 -23
- package/dist/src/pdaGenerator/OrcaPdaGenerator.d.ts.map +0 -1
- package/dist/src/pdaGenerator/OrcaPdaGenerator.js +0 -68
- package/dist/src/pdaGenerator/RaydiumPdaGenerator.d.ts +0 -49
- package/dist/src/pdaGenerator/RaydiumPdaGenerator.d.ts.map +0 -1
- package/dist/src/pdaGenerator/RaydiumPdaGenerator.js +0 -114
- package/dist/src/pdaGenerator/UtilPdaGenerator.d.ts +0 -8
- package/dist/src/pdaGenerator/UtilPdaGenerator.d.ts.map +0 -1
- package/dist/src/pdaGenerator/UtilPdaGenerator.js +0 -51
- package/dist/src/types.d.ts +0 -1100
- package/dist/src/types.d.ts.map +0 -1
- package/dist/src/types.js +0 -95
package/dist/src/index.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export * from "./types";
|
|
2
|
-
export * from "./functions";
|
|
3
|
-
export { HawkAPI } from "./classes/HawkAPI";
|
|
4
|
-
export { TxGenerator } from "./classes/TxGenerator";
|
|
5
|
-
export { Client } from "./classes/Client";
|
|
6
|
-
export { CreateTxMetadata } from "./classes/CreateTxMetadata";
|
|
7
|
-
export { TransactionBatchExecute2 } from "./classes/TransactionBatchExecute2";
|
|
8
|
-
export { AltStorage } from './classes/AltStorage';
|
|
9
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/src/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;AAC9E,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC"}
|
package/dist/src/index.js
DELETED
|
@@ -1,31 +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
|
-
exports.AltStorage = exports.TransactionBatchExecute2 = exports.CreateTxMetadata = exports.Client = exports.TxGenerator = exports.HawkAPI = void 0;
|
|
18
|
-
__exportStar(require("./types"), exports);
|
|
19
|
-
__exportStar(require("./functions"), exports);
|
|
20
|
-
var HawkAPI_1 = require("./classes/HawkAPI");
|
|
21
|
-
Object.defineProperty(exports, "HawkAPI", { enumerable: true, get: function () { return HawkAPI_1.HawkAPI; } });
|
|
22
|
-
var TxGenerator_1 = require("./classes/TxGenerator");
|
|
23
|
-
Object.defineProperty(exports, "TxGenerator", { enumerable: true, get: function () { return TxGenerator_1.TxGenerator; } });
|
|
24
|
-
var Client_1 = require("./classes/Client");
|
|
25
|
-
Object.defineProperty(exports, "Client", { enumerable: true, get: function () { return Client_1.Client; } });
|
|
26
|
-
var CreateTxMetadata_1 = require("./classes/CreateTxMetadata");
|
|
27
|
-
Object.defineProperty(exports, "CreateTxMetadata", { enumerable: true, get: function () { return CreateTxMetadata_1.CreateTxMetadata; } });
|
|
28
|
-
var TransactionBatchExecute2_1 = require("./classes/TransactionBatchExecute2");
|
|
29
|
-
Object.defineProperty(exports, "TransactionBatchExecute2", { enumerable: true, get: function () { return TransactionBatchExecute2_1.TransactionBatchExecute2; } });
|
|
30
|
-
var AltStorage_1 = require("./classes/AltStorage");
|
|
31
|
-
Object.defineProperty(exports, "AltStorage", { enumerable: true, get: function () { return AltStorage_1.AltStorage; } });
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
import * as web3 from "@solana/web3.js";
|
|
2
|
-
import BN from "bn.js";
|
|
3
|
-
import { IyfMainIxGenerator } from "./IyfMainIxGenerator";
|
|
4
|
-
import { SimplePdaGenerator } from "../classes/SimplePdaGenerator";
|
|
5
|
-
import { RaydiumClosePositionAutomation } from "../types";
|
|
6
|
-
type MoveTokenIx = {
|
|
7
|
-
connection: web3.Connection;
|
|
8
|
-
userWallet: web3.PublicKey;
|
|
9
|
-
mint: web3.PublicKey;
|
|
10
|
-
useSourceAmount: boolean;
|
|
11
|
-
amount?: BN;
|
|
12
|
-
};
|
|
13
|
-
type RaydiumOpenPositionAutomation = {
|
|
14
|
-
connection: web3.Connection;
|
|
15
|
-
userWallet: web3.PublicKey;
|
|
16
|
-
nftMint: web3.PublicKey;
|
|
17
|
-
poolState: web3.PublicKey;
|
|
18
|
-
tokenVault0: web3.PublicKey;
|
|
19
|
-
tokenVault1: web3.PublicKey;
|
|
20
|
-
vault0Mint: web3.PublicKey;
|
|
21
|
-
vault1Mint: web3.PublicKey;
|
|
22
|
-
tickSpacing: number;
|
|
23
|
-
tickLowerIndex: number;
|
|
24
|
-
tickUpperIndex: number;
|
|
25
|
-
liquidity: BN | null;
|
|
26
|
-
amount0Max: BN | null;
|
|
27
|
-
amount1Max: BN | null;
|
|
28
|
-
};
|
|
29
|
-
type RaydiumDecreaseLiquidity = {
|
|
30
|
-
connection: web3.Connection;
|
|
31
|
-
userWallet: web3.PublicKey;
|
|
32
|
-
nftMint: web3.PublicKey;
|
|
33
|
-
poolState: web3.PublicKey;
|
|
34
|
-
personalPosition: web3.PublicKey;
|
|
35
|
-
tokenVault0: web3.PublicKey;
|
|
36
|
-
tokenVault1: web3.PublicKey;
|
|
37
|
-
vault0Mint: web3.PublicKey;
|
|
38
|
-
vault1Mint: web3.PublicKey;
|
|
39
|
-
tickSpacing: number;
|
|
40
|
-
tickLowerIndex: number;
|
|
41
|
-
tickUpperIndex: number;
|
|
42
|
-
liquidity: BN;
|
|
43
|
-
amount0Min: BN;
|
|
44
|
-
amount1Min: BN;
|
|
45
|
-
rewardInfos: {
|
|
46
|
-
tokenMint: web3.PublicKey;
|
|
47
|
-
tokenVault: web3.PublicKey;
|
|
48
|
-
}[];
|
|
49
|
-
};
|
|
50
|
-
type RaydiumDecreaseLiquidityAutomation = {
|
|
51
|
-
connection: web3.Connection;
|
|
52
|
-
userWallet: web3.PublicKey;
|
|
53
|
-
nftMint: web3.PublicKey;
|
|
54
|
-
poolState: web3.PublicKey;
|
|
55
|
-
personalPosition: web3.PublicKey;
|
|
56
|
-
tokenVault0: web3.PublicKey;
|
|
57
|
-
tokenVault1: web3.PublicKey;
|
|
58
|
-
vault0Mint: web3.PublicKey;
|
|
59
|
-
vault1Mint: web3.PublicKey;
|
|
60
|
-
tickSpacing: number;
|
|
61
|
-
tickLowerIndex: number;
|
|
62
|
-
tickUpperIndex: number;
|
|
63
|
-
liquidity: BN | null;
|
|
64
|
-
amount0Min: BN | null;
|
|
65
|
-
amount1Min: BN | null;
|
|
66
|
-
slippage: number | null;
|
|
67
|
-
rewardInfos: {
|
|
68
|
-
tokenMint: web3.PublicKey;
|
|
69
|
-
tokenVault: web3.PublicKey;
|
|
70
|
-
}[];
|
|
71
|
-
};
|
|
72
|
-
type RaydiumIncreaseLiquidityAutomation = {
|
|
73
|
-
connection: web3.Connection;
|
|
74
|
-
userWallet: web3.PublicKey;
|
|
75
|
-
nftMint: web3.PublicKey;
|
|
76
|
-
poolState: web3.PublicKey;
|
|
77
|
-
tokenVault0: web3.PublicKey;
|
|
78
|
-
tokenVault1: web3.PublicKey;
|
|
79
|
-
vault0Mint: web3.PublicKey;
|
|
80
|
-
vault1Mint: web3.PublicKey;
|
|
81
|
-
tickSpacing: number;
|
|
82
|
-
tickLowerIndex: number;
|
|
83
|
-
tickUpperIndex: number;
|
|
84
|
-
liquidity: BN | null;
|
|
85
|
-
amount0Max: BN | null;
|
|
86
|
-
amount1Max: BN | null;
|
|
87
|
-
};
|
|
88
|
-
type RaydiumSweepDust = {
|
|
89
|
-
connection: web3.Connection;
|
|
90
|
-
userWallet: web3.PublicKey;
|
|
91
|
-
nftMint: web3.PublicKey;
|
|
92
|
-
poolState: web3.PublicKey;
|
|
93
|
-
tokenVault0: web3.PublicKey;
|
|
94
|
-
tokenVault1: web3.PublicKey;
|
|
95
|
-
vault0Mint: web3.PublicKey;
|
|
96
|
-
vault1Mint: web3.PublicKey;
|
|
97
|
-
ammConfig: web3.PublicKey;
|
|
98
|
-
observationKey: web3.PublicKey;
|
|
99
|
-
tickCurrent: number;
|
|
100
|
-
tickSpacing: number;
|
|
101
|
-
tickLowerIndex: number;
|
|
102
|
-
tickUpperIndex: number;
|
|
103
|
-
};
|
|
104
|
-
/**
|
|
105
|
-
* Iyf Extension IX Generator
|
|
106
|
-
*/
|
|
107
|
-
export declare class IyfExtensionIxGenerator {
|
|
108
|
-
private pda;
|
|
109
|
-
private iyfMain;
|
|
110
|
-
constructor(pda: SimplePdaGenerator, iyfMain: IyfMainIxGenerator);
|
|
111
|
-
/**
|
|
112
|
-
* Move token from ATA to STA
|
|
113
|
-
*
|
|
114
|
-
* @param param0
|
|
115
|
-
* @returns
|
|
116
|
-
*/
|
|
117
|
-
moveTokenIx({ connection, userWallet, mint, useSourceAmount, amount, }: MoveTokenIx): Promise<web3.TransactionInstruction>;
|
|
118
|
-
raydiumOpenPositionAutomation({ connection, userWallet, nftMint, poolState, tokenVault0, tokenVault1, vault0Mint, vault1Mint, tickSpacing, tickLowerIndex, tickUpperIndex, liquidity, amount0Max, amount1Max, }: RaydiumOpenPositionAutomation): Promise<web3.TransactionInstruction>;
|
|
119
|
-
raydiumClosePositionAutomation({ connection, userWallet, positionNftMint, }: RaydiumClosePositionAutomation): Promise<web3.TransactionInstruction>;
|
|
120
|
-
raydiumDecreaseLiquidity({ connection, userWallet, nftMint, poolState, personalPosition, tokenVault0, tokenVault1, vault0Mint, vault1Mint, tickSpacing, tickLowerIndex, tickUpperIndex, liquidity, amount0Min, amount1Min, rewardInfos, }: RaydiumDecreaseLiquidity): Promise<web3.TransactionInstruction>;
|
|
121
|
-
raydiumDecreaseLiquidityAutomation({ connection, userWallet, nftMint, poolState, personalPosition, tokenVault0, tokenVault1, vault0Mint, vault1Mint, tickSpacing, tickLowerIndex, tickUpperIndex, liquidity, amount0Min, amount1Min, rewardInfos, slippage, }: RaydiumDecreaseLiquidityAutomation): Promise<web3.TransactionInstruction>;
|
|
122
|
-
raydiumIncreaseLiquidityAutomation({ connection, userWallet, nftMint, poolState, tokenVault0, tokenVault1, vault0Mint, vault1Mint, tickSpacing, tickLowerIndex, tickUpperIndex, liquidity, amount0Max, amount1Max, }: RaydiumIncreaseLiquidityAutomation): Promise<web3.TransactionInstruction>;
|
|
123
|
-
raydiumSweepDust({ connection, userWallet, nftMint, poolState, tokenVault0, tokenVault1, vault0Mint, vault1Mint, ammConfig, observationKey, tickCurrent, tickSpacing, tickLowerIndex, tickUpperIndex, }: RaydiumSweepDust): Promise<web3.TransactionInstruction>;
|
|
124
|
-
}
|
|
125
|
-
export {};
|
|
126
|
-
//# sourceMappingURL=IyfExtensionIxGenerator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IyfExtensionIxGenerator.d.ts","sourceRoot":"","sources":["../../../src/ixGenerator/IyfExtensionIxGenerator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AAIxC,OAAO,EAAE,MAAM,OAAO,CAAC;AACvB,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EA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ACd,SAAS,EACT,UAAU,EACV,UAAU,GACX,EAAE,kCAAkC,GAAG,OAAO,CAAC,IAAI,CAAC,sBAAsB,CAAC;IA+CtE,gBAAgB,CAAC,EACrB,UAAU,EACV,UAAU,EACV,OAAO,EACP,SAAS,EACT,WAAW,EACX,WAAW,EACX,UAAU,EACV,UAAU,EACV,SAAS,EACT,cAAc,EACd,WAAW,EACX,WAAW,EACX,cAAc,EACd,cAAc,GACf,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,sBAAsB,CAAC;CA6D3D"}
|
|
@@ -1,467 +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.IyfExtensionIxGenerator = void 0;
|
|
49
|
-
const web3 = __importStar(require("@solana/web3.js"));
|
|
50
|
-
const anchor_1 = require("../anchor");
|
|
51
|
-
const functions_1 = require("../functions");
|
|
52
|
-
const addresses_1 = require("../addresses");
|
|
53
|
-
const bn_js_1 = __importDefault(require("bn.js"));
|
|
54
|
-
/**
|
|
55
|
-
* Iyf Extension IX Generator
|
|
56
|
-
*/
|
|
57
|
-
class IyfExtensionIxGenerator {
|
|
58
|
-
constructor(pda, iyfMain) {
|
|
59
|
-
this.pda = pda;
|
|
60
|
-
this.iyfMain = iyfMain;
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Move token from ATA to STA
|
|
64
|
-
*
|
|
65
|
-
* @param param0
|
|
66
|
-
* @returns
|
|
67
|
-
*/
|
|
68
|
-
moveTokenIx(_a) {
|
|
69
|
-
return __awaiter(this, arguments, void 0, function* ({ connection, userWallet, mint, useSourceAmount, amount, }) {
|
|
70
|
-
// Initialize anchor
|
|
71
|
-
anchor_1.Anchor.initialize(connection);
|
|
72
|
-
// Generate user pda
|
|
73
|
-
const userPda = (0, functions_1.generateUserPda)(userWallet);
|
|
74
|
-
const sourceToken = (0, functions_1.generateAta)(userPda, mint);
|
|
75
|
-
const destinationToken = (0, functions_1.generateUserPdaStorageAccount)(userPda, mint);
|
|
76
|
-
if (!useSourceAmount && amount === undefined) {
|
|
77
|
-
throw new Error('Source amount cannot be undefined if `useSourceAmount` is false');
|
|
78
|
-
}
|
|
79
|
-
if (amount === undefined) {
|
|
80
|
-
amount = new bn_js_1.default(0);
|
|
81
|
-
}
|
|
82
|
-
// Generate move_token instruction
|
|
83
|
-
// @ts-ignore
|
|
84
|
-
const iyfExtensionIx = yield anchor_1.Anchor.instance().iyfExtension
|
|
85
|
-
.methods
|
|
86
|
-
.moveToken(useSourceAmount, amount)
|
|
87
|
-
.accounts({
|
|
88
|
-
farm: addresses_1.USDC_FARM,
|
|
89
|
-
userPda,
|
|
90
|
-
authority: userWallet,
|
|
91
|
-
iyfProgram: addresses_1.IYF_MAIN,
|
|
92
|
-
hawksightAuthority: addresses_1.HS_AUTHORITY,
|
|
93
|
-
sourceToken,
|
|
94
|
-
destinationToken,
|
|
95
|
-
tokenProgram: addresses_1.TOKEN_PROGRAM_ID,
|
|
96
|
-
associatedTokenProgram: addresses_1.ASSOCIATED_TOKEN_PROGRAM,
|
|
97
|
-
})
|
|
98
|
-
.instruction();
|
|
99
|
-
// Wrap instruction in iyf extension (iyf-main)
|
|
100
|
-
return yield this.iyfMain.iyfExtensionExecute(connection, {
|
|
101
|
-
userWallet,
|
|
102
|
-
iyfExtensionIx,
|
|
103
|
-
});
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
raydiumOpenPositionAutomation(_a) {
|
|
107
|
-
return __awaiter(this, arguments, void 0, function* ({ connection, userWallet, nftMint, poolState, tokenVault0, tokenVault1, vault0Mint, vault1Mint, tickSpacing, tickLowerIndex, tickUpperIndex, liquidity, amount0Max, amount1Max, }) {
|
|
108
|
-
const userPda = (0, functions_1.generateUserPda)(userWallet);
|
|
109
|
-
const nftOwner = (0, functions_1.generateUserPdaLamport)(userWallet);
|
|
110
|
-
const tickArrayLowerStartIndex = (0, functions_1.raydiumStartTickIndex)(tickLowerIndex, tickSpacing);
|
|
111
|
-
const tickArrayUpperStartIndex = (0, functions_1.raydiumStartTickIndex)(tickUpperIndex, tickSpacing);
|
|
112
|
-
const nftAccount = (0, functions_1.generateAta2022)(nftOwner, nftMint);
|
|
113
|
-
const protocolPosition = this.pda.raydium.generateRaydiumProtocolPosition(poolState, tickLowerIndex, tickUpperIndex);
|
|
114
|
-
const personalPosition = this.pda.raydium.generateRaydiumPersonalPosition(nftMint);
|
|
115
|
-
const tokenAccount0 = (0, functions_1.generateAta)(nftOwner, vault0Mint);
|
|
116
|
-
const tokenAccount1 = (0, functions_1.generateAta)(nftOwner, vault1Mint);
|
|
117
|
-
const tickArrayLower = this.pda.raydium.generateRaydiumTickArrayPda(poolState, tickArrayLowerStartIndex);
|
|
118
|
-
const tickArrayUpper = this.pda.raydium.generateRaydiumTickArrayPda(poolState, tickArrayUpperStartIndex);
|
|
119
|
-
//@ts-ignore
|
|
120
|
-
const ix = yield anchor_1.Anchor.instance().iyfExtension.methods
|
|
121
|
-
.raydiumOpenPositionAutomation(tickLowerIndex, tickUpperIndex, tickArrayLowerStartIndex, tickArrayUpperStartIndex, liquidity, amount0Max, amount1Max, false, null)
|
|
122
|
-
.accounts({
|
|
123
|
-
raydiumProgram: addresses_1.RAYDIUM_PROGRAM,
|
|
124
|
-
userPda,
|
|
125
|
-
hawksightAuthority: addresses_1.HS_AUTHORITY,
|
|
126
|
-
nftOwner,
|
|
127
|
-
nftMint,
|
|
128
|
-
nftAccount,
|
|
129
|
-
poolState,
|
|
130
|
-
protocolPosition,
|
|
131
|
-
tickArrayLower,
|
|
132
|
-
tickArrayUpper,
|
|
133
|
-
personalPosition,
|
|
134
|
-
tokenAccount0,
|
|
135
|
-
tokenAccount1,
|
|
136
|
-
tokenVault0,
|
|
137
|
-
tokenVault1,
|
|
138
|
-
rent: web3.SYSVAR_RENT_PUBKEY,
|
|
139
|
-
systemProgram: web3.SystemProgram.programId,
|
|
140
|
-
tokenProgram: addresses_1.TOKEN_PROGRAM_ID,
|
|
141
|
-
associatedTokenProgram: addresses_1.ASSOCIATED_TOKEN_PROGRAM,
|
|
142
|
-
tokenProgram2022: addresses_1.TOKEN_2022,
|
|
143
|
-
vault0Mint,
|
|
144
|
-
vault1Mint,
|
|
145
|
-
})
|
|
146
|
-
.instruction();
|
|
147
|
-
ix.keys[3].isSigner = false;
|
|
148
|
-
return yield this.iyfMain.iyfExtensionExecuteV2(connection, {
|
|
149
|
-
userPda,
|
|
150
|
-
authority: addresses_1.HS_AUTHORITY,
|
|
151
|
-
ix
|
|
152
|
-
});
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
|
-
raydiumClosePositionAutomation(_a) {
|
|
156
|
-
return __awaiter(this, arguments, void 0, function* ({ connection, userWallet, positionNftMint, }) {
|
|
157
|
-
const userPda = (0, functions_1.generateUserPda)(userWallet);
|
|
158
|
-
const nftOwner = (0, functions_1.generateUserPdaLamport)(userWallet);
|
|
159
|
-
const positionNftAccount = (0, functions_1.generateAta2022)(nftOwner, positionNftMint);
|
|
160
|
-
const personalPosition = this.pda.raydium.generateRaydiumPersonalPosition(positionNftMint);
|
|
161
|
-
// @ts-ignore
|
|
162
|
-
const ix = yield anchor_1.Anchor.instance().iyfExtension.methods
|
|
163
|
-
.raydiumClosePositionAutomation()
|
|
164
|
-
.accounts({
|
|
165
|
-
raydiumProgram: addresses_1.RAYDIUM_PROGRAM,
|
|
166
|
-
userPda,
|
|
167
|
-
hawksightAuthority: addresses_1.HS_AUTHORITY,
|
|
168
|
-
nftOwner,
|
|
169
|
-
positionNftMint,
|
|
170
|
-
positionNftAccount,
|
|
171
|
-
personalPosition,
|
|
172
|
-
systemProgram: web3.SystemProgram.programId,
|
|
173
|
-
tokenProgram: addresses_1.TOKEN_2022,
|
|
174
|
-
})
|
|
175
|
-
.instruction();
|
|
176
|
-
ix.keys[3].isSigner = false;
|
|
177
|
-
return yield this.iyfMain.iyfExtensionExecuteV2(connection, {
|
|
178
|
-
userPda,
|
|
179
|
-
authority: addresses_1.HS_AUTHORITY,
|
|
180
|
-
ix
|
|
181
|
-
});
|
|
182
|
-
});
|
|
183
|
-
}
|
|
184
|
-
raydiumDecreaseLiquidity(_a) {
|
|
185
|
-
return __awaiter(this, arguments, void 0, function* ({ connection, userWallet, nftMint, poolState, personalPosition, tokenVault0, tokenVault1, vault0Mint, vault1Mint, tickSpacing, tickLowerIndex, tickUpperIndex, liquidity, amount0Min, amount1Min, rewardInfos, }) {
|
|
186
|
-
const userPda = (0, functions_1.generateUserPda)(userWallet);
|
|
187
|
-
const nftOwner = (0, functions_1.generateUserPdaLamport)(userWallet);
|
|
188
|
-
const tickArrayLowerStartIndex = (0, functions_1.raydiumStartTickIndex)(tickLowerIndex, tickSpacing);
|
|
189
|
-
const tickArrayUpperStartIndex = (0, functions_1.raydiumStartTickIndex)(tickUpperIndex, tickSpacing);
|
|
190
|
-
const nftAccount = (0, functions_1.generateAta2022)(nftOwner, nftMint);
|
|
191
|
-
const protocolPosition = this.pda.raydium.generateRaydiumProtocolPosition(poolState, tickLowerIndex, tickUpperIndex);
|
|
192
|
-
const recipientTokenAccount0 = (0, functions_1.generateAta)(nftOwner, vault0Mint);
|
|
193
|
-
const recipientTokenAccount1 = (0, functions_1.generateAta)(nftOwner, vault1Mint);
|
|
194
|
-
const ownerFee0 = (0, functions_1.generateAta)(addresses_1.SITE_FEE_OWNER, vault0Mint);
|
|
195
|
-
const ownerFee1 = (0, functions_1.generateAta)(addresses_1.SITE_FEE_OWNER, vault1Mint);
|
|
196
|
-
const tickArrayLower = this.pda.raydium.generateRaydiumTickArrayPda(poolState, tickArrayLowerStartIndex);
|
|
197
|
-
const tickArrayUpper = this.pda.raydium.generateRaydiumTickArrayPda(poolState, tickArrayUpperStartIndex);
|
|
198
|
-
// @ts-ignore
|
|
199
|
-
const ix = yield anchor_1.Anchor.instance().iyfExtension.methods
|
|
200
|
-
.raydiumDecreaseLiquidity(liquidity, amount0Min, amount1Min)
|
|
201
|
-
.accounts({
|
|
202
|
-
raydiumProgram: addresses_1.RAYDIUM_PROGRAM,
|
|
203
|
-
userPda,
|
|
204
|
-
authority: userWallet,
|
|
205
|
-
nftOwner,
|
|
206
|
-
nftAccount,
|
|
207
|
-
personalPosition,
|
|
208
|
-
poolState,
|
|
209
|
-
protocolPosition,
|
|
210
|
-
tokenVault0,
|
|
211
|
-
tokenVault1,
|
|
212
|
-
tickArrayLower,
|
|
213
|
-
tickArrayUpper,
|
|
214
|
-
recipientTokenAccount0,
|
|
215
|
-
recipientTokenAccount1,
|
|
216
|
-
tokenProgram: addresses_1.TOKEN_PROGRAM_ID,
|
|
217
|
-
tokenProgram2022: addresses_1.TOKEN_2022,
|
|
218
|
-
memoProgram: addresses_1.MEMO_PROGRAM,
|
|
219
|
-
vault0Mint,
|
|
220
|
-
vault1Mint,
|
|
221
|
-
ownerFee0,
|
|
222
|
-
ownerFee1,
|
|
223
|
-
})
|
|
224
|
-
.remainingAccounts([
|
|
225
|
-
...rewardInfos.map((v) => {
|
|
226
|
-
if (v.tokenVault.equals(web3.PublicKey.default)) {
|
|
227
|
-
return [];
|
|
228
|
-
}
|
|
229
|
-
const rewardFee = (0, functions_1.generateAta)(addresses_1.SITE_FEE_OWNER, v.tokenMint);
|
|
230
|
-
return [
|
|
231
|
-
{
|
|
232
|
-
pubkey: rewardFee,
|
|
233
|
-
isSigner: false,
|
|
234
|
-
isWritable: true,
|
|
235
|
-
},
|
|
236
|
-
];
|
|
237
|
-
}).flat(),
|
|
238
|
-
...rewardInfos.map((v) => {
|
|
239
|
-
if (v.tokenVault.equals(web3.PublicKey.default)) {
|
|
240
|
-
return [];
|
|
241
|
-
}
|
|
242
|
-
const rewardVault = v.tokenVault;
|
|
243
|
-
const rewardMint = v.tokenMint;
|
|
244
|
-
const rewardAccount = (0, functions_1.generateAta)(nftOwner, rewardMint); // TODO: allow sta / lta
|
|
245
|
-
return [
|
|
246
|
-
{
|
|
247
|
-
pubkey: rewardVault,
|
|
248
|
-
isSigner: false,
|
|
249
|
-
isWritable: true,
|
|
250
|
-
},
|
|
251
|
-
{
|
|
252
|
-
pubkey: rewardAccount,
|
|
253
|
-
isSigner: false,
|
|
254
|
-
isWritable: true,
|
|
255
|
-
},
|
|
256
|
-
{
|
|
257
|
-
pubkey: rewardMint,
|
|
258
|
-
isSigner: false,
|
|
259
|
-
isWritable: true,
|
|
260
|
-
},
|
|
261
|
-
];
|
|
262
|
-
}).flat()
|
|
263
|
-
])
|
|
264
|
-
.instruction();
|
|
265
|
-
ix.keys[3].isSigner = false;
|
|
266
|
-
return yield this.iyfMain.iyfExtensionExecuteV2(connection, {
|
|
267
|
-
userPda,
|
|
268
|
-
authority: userWallet,
|
|
269
|
-
ix
|
|
270
|
-
});
|
|
271
|
-
});
|
|
272
|
-
}
|
|
273
|
-
raydiumDecreaseLiquidityAutomation(_a) {
|
|
274
|
-
return __awaiter(this, arguments, void 0, function* ({ connection, userWallet, nftMint, poolState, personalPosition, tokenVault0, tokenVault1, vault0Mint, vault1Mint, tickSpacing, tickLowerIndex, tickUpperIndex, liquidity, amount0Min, amount1Min, rewardInfos, slippage, }) {
|
|
275
|
-
const userPda = (0, functions_1.generateUserPda)(userWallet);
|
|
276
|
-
const nftOwner = (0, functions_1.generateUserPdaLamport)(userWallet);
|
|
277
|
-
const tickArrayLowerStartIndex = (0, functions_1.raydiumStartTickIndex)(tickLowerIndex, tickSpacing);
|
|
278
|
-
const tickArrayUpperStartIndex = (0, functions_1.raydiumStartTickIndex)(tickUpperIndex, tickSpacing);
|
|
279
|
-
const nftAccount = (0, functions_1.generateAta2022)(nftOwner, nftMint);
|
|
280
|
-
const protocolPosition = this.pda.raydium.generateRaydiumProtocolPosition(poolState, tickLowerIndex, tickUpperIndex);
|
|
281
|
-
const recipientTokenAccount0 = (0, functions_1.generateAta)(nftOwner, vault0Mint);
|
|
282
|
-
const recipientTokenAccount1 = (0, functions_1.generateAta)(nftOwner, vault1Mint);
|
|
283
|
-
const ownerFee0 = (0, functions_1.generateAta)(addresses_1.SITE_FEE_OWNER, vault0Mint);
|
|
284
|
-
const ownerFee1 = (0, functions_1.generateAta)(addresses_1.SITE_FEE_OWNER, vault1Mint);
|
|
285
|
-
const tickArrayLower = this.pda.raydium.generateRaydiumTickArrayPda(poolState, tickArrayLowerStartIndex);
|
|
286
|
-
const tickArrayUpper = this.pda.raydium.generateRaydiumTickArrayPda(poolState, tickArrayUpperStartIndex);
|
|
287
|
-
// @ts-ignore
|
|
288
|
-
const ix = yield anchor_1.Anchor.instance().iyfExtension.methods
|
|
289
|
-
.raydiumDecreaseLiquidityAutomation(slippage, liquidity, amount0Min, amount1Min)
|
|
290
|
-
.accounts({
|
|
291
|
-
userPda,
|
|
292
|
-
hawksightAuthority: addresses_1.HS_AUTHORITY,
|
|
293
|
-
raydiumProgram: addresses_1.RAYDIUM_PROGRAM,
|
|
294
|
-
nftOwner,
|
|
295
|
-
nftAccount,
|
|
296
|
-
personalPosition,
|
|
297
|
-
poolState,
|
|
298
|
-
protocolPosition,
|
|
299
|
-
tokenVault0,
|
|
300
|
-
tokenVault1,
|
|
301
|
-
tickArrayLower,
|
|
302
|
-
tickArrayUpper,
|
|
303
|
-
recipientTokenAccount0,
|
|
304
|
-
recipientTokenAccount1,
|
|
305
|
-
tokenProgram: addresses_1.TOKEN_PROGRAM_ID,
|
|
306
|
-
tokenProgram2022: addresses_1.TOKEN_2022,
|
|
307
|
-
memoProgram: addresses_1.MEMO_PROGRAM,
|
|
308
|
-
vault0Mint,
|
|
309
|
-
vault1Mint,
|
|
310
|
-
ownerFee0,
|
|
311
|
-
ownerFee1,
|
|
312
|
-
})
|
|
313
|
-
.remainingAccounts([
|
|
314
|
-
...rewardInfos.map((v) => {
|
|
315
|
-
if (v.tokenVault.equals(web3.PublicKey.default)) {
|
|
316
|
-
return [];
|
|
317
|
-
}
|
|
318
|
-
const rewardFee = (0, functions_1.generateAta)(addresses_1.SITE_FEE_OWNER, v.tokenMint);
|
|
319
|
-
return [
|
|
320
|
-
{
|
|
321
|
-
pubkey: rewardFee,
|
|
322
|
-
isSigner: false,
|
|
323
|
-
isWritable: true,
|
|
324
|
-
},
|
|
325
|
-
];
|
|
326
|
-
}).flat(),
|
|
327
|
-
...rewardInfos.map((v) => {
|
|
328
|
-
if (v.tokenVault.equals(web3.PublicKey.default)) {
|
|
329
|
-
return [];
|
|
330
|
-
}
|
|
331
|
-
const rewardVault = v.tokenVault;
|
|
332
|
-
const rewardMint = v.tokenMint;
|
|
333
|
-
const rewardAccount = (0, functions_1.generateAta)(nftOwner, rewardMint); // TODO: allow sta / lta
|
|
334
|
-
return [
|
|
335
|
-
{
|
|
336
|
-
pubkey: rewardVault,
|
|
337
|
-
isSigner: false,
|
|
338
|
-
isWritable: true,
|
|
339
|
-
},
|
|
340
|
-
{
|
|
341
|
-
pubkey: rewardAccount,
|
|
342
|
-
isSigner: false,
|
|
343
|
-
isWritable: true,
|
|
344
|
-
},
|
|
345
|
-
{
|
|
346
|
-
pubkey: rewardMint,
|
|
347
|
-
isSigner: false,
|
|
348
|
-
isWritable: true,
|
|
349
|
-
},
|
|
350
|
-
];
|
|
351
|
-
}).flat()
|
|
352
|
-
])
|
|
353
|
-
.instruction();
|
|
354
|
-
ix.keys[3].isSigner = false;
|
|
355
|
-
return yield this.iyfMain.iyfExtensionExecuteV2(connection, {
|
|
356
|
-
userPda,
|
|
357
|
-
authority: addresses_1.HS_AUTHORITY,
|
|
358
|
-
ix
|
|
359
|
-
});
|
|
360
|
-
});
|
|
361
|
-
}
|
|
362
|
-
raydiumIncreaseLiquidityAutomation(_a) {
|
|
363
|
-
return __awaiter(this, arguments, void 0, function* ({ connection, userWallet, nftMint, poolState, tokenVault0, tokenVault1, vault0Mint, vault1Mint, tickSpacing, tickLowerIndex, tickUpperIndex, liquidity, amount0Max, amount1Max, }) {
|
|
364
|
-
const userPda = (0, functions_1.generateUserPda)(userWallet);
|
|
365
|
-
const nftOwner = (0, functions_1.generateUserPdaLamport)(userWallet);
|
|
366
|
-
const tickArrayLowerStartIndex = (0, functions_1.raydiumStartTickIndex)(tickLowerIndex, tickSpacing);
|
|
367
|
-
const tickArrayUpperStartIndex = (0, functions_1.raydiumStartTickIndex)(tickUpperIndex, tickSpacing);
|
|
368
|
-
const nftAccount = (0, functions_1.generateAta2022)(nftOwner, nftMint);
|
|
369
|
-
const protocolPosition = this.pda.raydium.generateRaydiumProtocolPosition(poolState, tickLowerIndex, tickUpperIndex);
|
|
370
|
-
const personalPosition = this.pda.raydium.generateRaydiumPersonalPosition(nftMint);
|
|
371
|
-
const tokenAccount0 = (0, functions_1.generateAta)(nftOwner, vault0Mint);
|
|
372
|
-
const tokenAccount1 = (0, functions_1.generateAta)(nftOwner, vault1Mint);
|
|
373
|
-
const tickArrayLower = this.pda.raydium.generateRaydiumTickArrayPda(poolState, tickArrayLowerStartIndex);
|
|
374
|
-
const tickArrayUpper = this.pda.raydium.generateRaydiumTickArrayPda(poolState, tickArrayUpperStartIndex);
|
|
375
|
-
return yield this.iyfMain.iyfExtensionExecuteV2(connection, {
|
|
376
|
-
userPda,
|
|
377
|
-
authority: addresses_1.HS_AUTHORITY,
|
|
378
|
-
//@ts-ignore
|
|
379
|
-
ix: yield anchor_1.Anchor.instance().iyfExtension.methods
|
|
380
|
-
.raydiumIncreaseLiquidityAutomation(liquidity, amount0Max, amount1Max, false)
|
|
381
|
-
.accounts({
|
|
382
|
-
raydiumProgram: addresses_1.RAYDIUM_PROGRAM,
|
|
383
|
-
userPda,
|
|
384
|
-
hawksightAuthority: addresses_1.HS_AUTHORITY,
|
|
385
|
-
nftOwner,
|
|
386
|
-
nftAccount,
|
|
387
|
-
poolState,
|
|
388
|
-
protocolPosition,
|
|
389
|
-
personalPosition,
|
|
390
|
-
tickArrayLower,
|
|
391
|
-
tickArrayUpper,
|
|
392
|
-
tokenAccount0,
|
|
393
|
-
tokenAccount1,
|
|
394
|
-
tokenVault0,
|
|
395
|
-
tokenVault1,
|
|
396
|
-
tokenProgram: addresses_1.TOKEN_PROGRAM_ID,
|
|
397
|
-
tokenProgram2022: addresses_1.TOKEN_2022,
|
|
398
|
-
vault0Mint,
|
|
399
|
-
vault1Mint,
|
|
400
|
-
})
|
|
401
|
-
.instruction()
|
|
402
|
-
});
|
|
403
|
-
});
|
|
404
|
-
}
|
|
405
|
-
raydiumSweepDust(_a) {
|
|
406
|
-
return __awaiter(this, arguments, void 0, function* ({ connection, userWallet, nftMint, poolState, tokenVault0, tokenVault1, vault0Mint, vault1Mint, ammConfig, observationKey, tickCurrent, tickSpacing, tickLowerIndex, tickUpperIndex, }) {
|
|
407
|
-
const userPda = (0, functions_1.generateUserPda)(userWallet);
|
|
408
|
-
const nftOwner = (0, functions_1.generateUserPdaLamport)(userWallet);
|
|
409
|
-
const tickArrayLowerStartIndex = (0, functions_1.raydiumStartTickIndex)(tickLowerIndex, tickSpacing);
|
|
410
|
-
const tickArrayUpperStartIndex = (0, functions_1.raydiumStartTickIndex)(tickUpperIndex, tickSpacing);
|
|
411
|
-
const nftAccount = (0, functions_1.generateAta2022)(nftOwner, nftMint);
|
|
412
|
-
const protocolPosition = this.pda.raydium.generateRaydiumProtocolPosition(poolState, tickLowerIndex, tickUpperIndex);
|
|
413
|
-
const personalPosition = this.pda.raydium.generateRaydiumPersonalPosition(nftMint);
|
|
414
|
-
const tokenAccount0 = (0, functions_1.generateAta)(nftOwner, vault0Mint);
|
|
415
|
-
const tokenAccount1 = (0, functions_1.generateAta)(nftOwner, vault1Mint);
|
|
416
|
-
const tickArrayLower = this.pda.raydium.generateRaydiumTickArrayPda(poolState, tickArrayLowerStartIndex);
|
|
417
|
-
const tickArrayUpper = this.pda.raydium.generateRaydiumTickArrayPda(poolState, tickArrayUpperStartIndex);
|
|
418
|
-
const tickArrayBitmapExtension = this.pda.raydium.generateRaydiumTickArrayBitmapExtension(poolState);
|
|
419
|
-
const TICK_ARRAY_SIZE = 60;
|
|
420
|
-
const tickArray_1_index = (0, functions_1.raydiumStartTickIndex)(tickCurrent, tickSpacing);
|
|
421
|
-
const tickArray_0_index = (0, functions_1.raydiumStartTickIndex)(tickArray_1_index - (tickSpacing * TICK_ARRAY_SIZE), tickSpacing);
|
|
422
|
-
const tickArray_2_index = (0, functions_1.raydiumStartTickIndex)(tickArray_1_index + (tickSpacing * TICK_ARRAY_SIZE), tickSpacing);
|
|
423
|
-
const tickArray_0 = this.pda.raydium.generateRaydiumTickArrayPda(poolState, tickArray_0_index);
|
|
424
|
-
const tickArray_1 = this.pda.raydium.generateRaydiumTickArrayPda(poolState, tickArray_1_index);
|
|
425
|
-
const tickArray_2 = this.pda.raydium.generateRaydiumTickArrayPda(poolState, tickArray_2_index);
|
|
426
|
-
return yield this.iyfMain.iyfExtensionExecuteV2(connection, {
|
|
427
|
-
userPda,
|
|
428
|
-
authority: addresses_1.HS_AUTHORITY,
|
|
429
|
-
ix: new web3.TransactionInstruction({
|
|
430
|
-
programId: addresses_1.IYF_EXTENSION,
|
|
431
|
-
keys: [
|
|
432
|
-
{ pubkey: userPda, isSigner: false, isWritable: false },
|
|
433
|
-
{ pubkey: addresses_1.HS_AUTHORITY, isSigner: true, isWritable: true },
|
|
434
|
-
{ pubkey: addresses_1.RAYDIUM_PROGRAM, isSigner: false, isWritable: false },
|
|
435
|
-
{ pubkey: nftOwner, isSigner: false, isWritable: true },
|
|
436
|
-
{ pubkey: personalPosition, isSigner: false, isWritable: true },
|
|
437
|
-
{ pubkey: protocolPosition, isSigner: false, isWritable: true },
|
|
438
|
-
{ pubkey: poolState, isSigner: false, isWritable: true },
|
|
439
|
-
{ pubkey: tickArrayLower, isSigner: false, isWritable: true },
|
|
440
|
-
{ pubkey: tickArrayUpper, isSigner: false, isWritable: true },
|
|
441
|
-
{ pubkey: nftAccount, isSigner: false, isWritable: false },
|
|
442
|
-
{ pubkey: tokenVault0, isSigner: false, isWritable: true },
|
|
443
|
-
{ pubkey: tokenVault1, isSigner: false, isWritable: true },
|
|
444
|
-
{ pubkey: tokenAccount0, isSigner: false, isWritable: true },
|
|
445
|
-
{ pubkey: tokenAccount1, isSigner: false, isWritable: true },
|
|
446
|
-
{ pubkey: vault0Mint, isSigner: false, isWritable: true },
|
|
447
|
-
{ pubkey: vault1Mint, isSigner: false, isWritable: true },
|
|
448
|
-
{ pubkey: tickArray_0, isSigner: false, isWritable: true },
|
|
449
|
-
{ pubkey: tickArray_1, isSigner: false, isWritable: true },
|
|
450
|
-
{ pubkey: tickArray_2, isSigner: false, isWritable: true },
|
|
451
|
-
{ pubkey: ammConfig, isSigner: false, isWritable: true },
|
|
452
|
-
{ pubkey: observationKey, isSigner: false, isWritable: true },
|
|
453
|
-
{ pubkey: tickArrayBitmapExtension, isSigner: false, isWritable: true },
|
|
454
|
-
{ pubkey: addresses_1.TOKEN_PROGRAM_ID, isSigner: false, isWritable: false },
|
|
455
|
-
{ pubkey: addresses_1.ASSOCIATED_TOKEN_PROGRAM, isSigner: false, isWritable: false },
|
|
456
|
-
{ pubkey: addresses_1.TOKEN_2022, isSigner: false, isWritable: false },
|
|
457
|
-
{ pubkey: addresses_1.MEMO_PROGRAM, isSigner: false, isWritable: false },
|
|
458
|
-
],
|
|
459
|
-
data: Buffer.concat([
|
|
460
|
-
new Uint8Array((0, functions_1.sighash)('raydium_sweep_dust')),
|
|
461
|
-
]),
|
|
462
|
-
})
|
|
463
|
-
});
|
|
464
|
-
});
|
|
465
|
-
}
|
|
466
|
-
}
|
|
467
|
-
exports.IyfExtensionIxGenerator = IyfExtensionIxGenerator;
|