@hawksightco/hawk-sdk 1.2.120 → 1.3.0
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/addresses.d.ts +1 -0
- package/dist/src/addresses.d.ts.map +1 -1
- package/dist/src/addresses.js +2 -1
- package/dist/src/anchor.d.ts +2 -112
- package/dist/src/anchor.d.ts.map +1 -1
- package/dist/src/anchor.js +21 -3
- package/dist/src/classes/Transactions.d.ts.map +1 -1
- package/dist/src/classes/Transactions.js +63 -43
- package/dist/src/classes/TxGenerator.d.ts.map +1 -1
- package/dist/src/classes/TxGenerator.js +2 -0
- package/dist/src/functions.d.ts +18 -1
- package/dist/src/functions.d.ts.map +1 -1
- package/dist/src/functions.js +115 -13
- package/dist/src/hawksight.d.ts +4 -0
- package/dist/src/hawksight.d.ts.map +1 -1
- package/dist/src/hawksight.js +38 -17
- package/dist/src/idl/iyf-extension-idl.d.ts +0 -45
- package/dist/src/idl/iyf-extension-idl.d.ts.map +1 -1
- package/dist/src/idl/iyf-extension-idl.js +45 -90
- package/dist/src/idl/iyf-extension-wrapper.d.ts +112 -0
- package/dist/src/idl/iyf-extension-wrapper.d.ts.map +1 -0
- package/dist/src/idl/iyf-extension-wrapper.js +2 -0
- package/dist/src/idl/iyf-main-idl.d.ts +7275 -5865
- package/dist/src/idl/iyf-main-idl.d.ts.map +1 -1
- package/dist/src/idl/iyf-main-idl.js +7449 -6045
- package/dist/src/idl/iyf-main-wrapper.d.ts +112 -0
- package/dist/src/idl/iyf-main-wrapper.d.ts.map +1 -0
- package/dist/src/idl/iyf-main-wrapper.js +2 -0
- package/dist/src/ixGenerator/IyfMainIxGenerator.d.ts +24 -8
- package/dist/src/ixGenerator/IyfMainIxGenerator.d.ts.map +1 -1
- package/dist/src/ixGenerator/IyfMainIxGenerator.js +152 -12
- package/dist/src/meteora.d.ts +6 -5
- package/dist/src/meteora.d.ts.map +1 -1
- package/dist/src/meteora.js +30 -18
- package/dist/src/pdaGenerator/HawksightPdaGenerator.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/src/addresses.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export declare const IYF_EXTENSION: web3.PublicKey;
|
|
|
5
5
|
export declare const STABLEMINT_1: web3.PublicKey;
|
|
6
6
|
export declare const STABLEMINT_2: web3.PublicKey;
|
|
7
7
|
export declare const TOKEN_PROGRAM_ID: web3.PublicKey;
|
|
8
|
+
export declare const TOKEN_2022_PROGRAM_ID: web3.PublicKey;
|
|
8
9
|
export declare const ASSOCIATED_TOKEN_PROGRAM: web3.PublicKey;
|
|
9
10
|
export declare const SITE_FEE_OWNER: web3.PublicKey;
|
|
10
11
|
export declare const USDC_FARM: web3.PublicKey;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addresses.d.ts","sourceRoot":"","sources":["../../src/addresses.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AAExC,eAAO,MAAM,UAAU,UAYtB,CAAC;AAEF,eAAO,MAAM,QAAQ,gBAAqE,CAAC;AAC3F,eAAO,MAAM,aAAa,gBAAqE,CAAC;AAChG,eAAO,MAAM,YAAY,gBAAqE,CAAC;AAC/F,eAAO,MAAM,YAAY,gBAAqE,CAAC;AAC/F,eAAO,MAAM,gBAAgB,gBAAoE,CAAC;AAClG,eAAO,MAAM,wBAAwB,gBAAqE,CAAC;AAC3G,eAAO,MAAM,cAAc,gBAAqE,CAAC;AACjG,eAAO,MAAM,SAAS,gBAAqE,CAAC;AAC5F,eAAO,MAAM,sBAAsB,gBAAqE,CAAC;AACzG,eAAO,MAAM,oBAAoB,gBAAoE,CAAC;AACtG,eAAO,MAAM,uBAAuB,gBAAqE,CAAC;AAC1G,eAAO,MAAM,cAAc,gBAAoE,CAAC;AAChG,eAAO,MAAM,YAAY,gBAAoE,CAAC;AAC9F,eAAO,MAAM,sBAAsB,gBAAoE,CAAC;AACxG,eAAO,MAAM,SAAS,gBAAoE,CAAC;AAC3F,eAAO,MAAM,eAAe,gBAAoE,CAAC;AACjG,eAAO,MAAM,eAAe,gBAAqE,CAAC;AAClG,eAAO,MAAM,UAAU,gBAAoE,CAAC;AAC5F,eAAO,MAAM,YAAY,gBAAoE,CAAC"}
|
|
1
|
+
{"version":3,"file":"addresses.d.ts","sourceRoot":"","sources":["../../src/addresses.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AAExC,eAAO,MAAM,UAAU,UAYtB,CAAC;AAEF,eAAO,MAAM,QAAQ,gBAAqE,CAAC;AAC3F,eAAO,MAAM,aAAa,gBAAqE,CAAC;AAChG,eAAO,MAAM,YAAY,gBAAqE,CAAC;AAC/F,eAAO,MAAM,YAAY,gBAAqE,CAAC;AAC/F,eAAO,MAAM,gBAAgB,gBAAoE,CAAC;AAClG,eAAO,MAAM,qBAAqB,gBAAoE,CAAC;AACvG,eAAO,MAAM,wBAAwB,gBAAqE,CAAC;AAC3G,eAAO,MAAM,cAAc,gBAAqE,CAAC;AACjG,eAAO,MAAM,SAAS,gBAAqE,CAAC;AAC5F,eAAO,MAAM,sBAAsB,gBAAqE,CAAC;AACzG,eAAO,MAAM,oBAAoB,gBAAoE,CAAC;AACtG,eAAO,MAAM,uBAAuB,gBAAqE,CAAC;AAC1G,eAAO,MAAM,cAAc,gBAAoE,CAAC;AAChG,eAAO,MAAM,YAAY,gBAAoE,CAAC;AAC9F,eAAO,MAAM,sBAAsB,gBAAoE,CAAC;AACxG,eAAO,MAAM,SAAS,gBAAoE,CAAC;AAC3F,eAAO,MAAM,eAAe,gBAAoE,CAAC;AACjG,eAAO,MAAM,eAAe,gBAAqE,CAAC;AAClG,eAAO,MAAM,UAAU,gBAAoE,CAAC;AAC5F,eAAO,MAAM,YAAY,gBAAoE,CAAC"}
|
package/dist/src/addresses.js
CHANGED
|
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.MEMO_PROGRAM = exports.TOKEN_2022 = exports.RAYDIUM_PROGRAM = exports.JUPITER_PROGRAM = exports.WSOL_MINT = exports.ORCA_WHIRLPOOL_PROGRAM = exports.HS_AUTHORITY = exports.COMPUTE_BUDGET = exports.METEORA_EVENT_AUTHORITY = exports.METEORA_DLMM_PROGRAM = exports.SOME_METEORA_DLMM_POOL = exports.USDC_FARM = exports.SITE_FEE_OWNER = exports.ASSOCIATED_TOKEN_PROGRAM = exports.TOKEN_PROGRAM_ID = exports.STABLEMINT_2 = exports.STABLEMINT_1 = exports.IYF_EXTENSION = exports.IYF_MAIN = exports.GLOBAL_ALT = void 0;
|
|
26
|
+
exports.MEMO_PROGRAM = exports.TOKEN_2022 = exports.RAYDIUM_PROGRAM = exports.JUPITER_PROGRAM = exports.WSOL_MINT = exports.ORCA_WHIRLPOOL_PROGRAM = exports.HS_AUTHORITY = exports.COMPUTE_BUDGET = exports.METEORA_EVENT_AUTHORITY = exports.METEORA_DLMM_PROGRAM = exports.SOME_METEORA_DLMM_POOL = exports.USDC_FARM = exports.SITE_FEE_OWNER = exports.ASSOCIATED_TOKEN_PROGRAM = exports.TOKEN_2022_PROGRAM_ID = exports.TOKEN_PROGRAM_ID = exports.STABLEMINT_2 = exports.STABLEMINT_1 = exports.IYF_EXTENSION = exports.IYF_MAIN = exports.GLOBAL_ALT = void 0;
|
|
27
27
|
const web3 = __importStar(require("@solana/web3.js"));
|
|
28
28
|
exports.GLOBAL_ALT = [
|
|
29
29
|
"AC3t5k5PUTJirxGEHgGGQStafu1vXkvddPyqVNDrRQDt",
|
|
@@ -43,6 +43,7 @@ exports.IYF_EXTENSION = new web3.PublicKey("EZiUb6ydWpR3ciizBTJ1J36KCqLyPKVjh4yZ
|
|
|
43
43
|
exports.STABLEMINT_1 = new web3.PublicKey("EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v");
|
|
44
44
|
exports.STABLEMINT_2 = new web3.PublicKey("9vMJfxuKxXBoEa7rM12mYLMwTacLMLDJqHozw96WQL8i");
|
|
45
45
|
exports.TOKEN_PROGRAM_ID = new web3.PublicKey("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA");
|
|
46
|
+
exports.TOKEN_2022_PROGRAM_ID = new web3.PublicKey("TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb");
|
|
46
47
|
exports.ASSOCIATED_TOKEN_PROGRAM = new web3.PublicKey("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");
|
|
47
48
|
exports.SITE_FEE_OWNER = new web3.PublicKey("4K3a2ucXiGvuMJMPNneRDyzmNp6i4RdzXJmBdWwGwPEh");
|
|
48
49
|
exports.USDC_FARM = new web3.PublicKey("7jLQhREMxXjKdpwVuN6gwsWt3BNfAg9WqbepffPbi4ww");
|
package/dist/src/anchor.d.ts
CHANGED
|
@@ -1,119 +1,10 @@
|
|
|
1
1
|
import * as web3 from "@solana/web3.js";
|
|
2
2
|
import * as anchor from "@coral-xyz/anchor";
|
|
3
|
-
import { IndexYieldFarming } from "./idl/iyf-main-idl";
|
|
4
|
-
import { IyfExtension as IyfExtensionNew } from "./idl/iyf-extension-idl";
|
|
5
3
|
import { Whirlpool } from "./idl/orca-idl";
|
|
6
4
|
import { LbClmm } from "./idl/meteora-idl";
|
|
7
5
|
import { Raydium } from "./idl/raydium-idl";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
docs?: string[];
|
|
11
|
-
accounts: IdlAccountItem[];
|
|
12
|
-
args: IdlField[];
|
|
13
|
-
returns?: IdlType;
|
|
14
|
-
};
|
|
15
|
-
type IdlAccountItem = IdlAccount | IdlAccounts;
|
|
16
|
-
type IdlAccount = {
|
|
17
|
-
name: string;
|
|
18
|
-
isMut: boolean;
|
|
19
|
-
isSigner: boolean;
|
|
20
|
-
isOptional?: boolean;
|
|
21
|
-
docs?: string[];
|
|
22
|
-
relations?: string[];
|
|
23
|
-
pda?: IdlPda;
|
|
24
|
-
};
|
|
25
|
-
type IdlPda = {
|
|
26
|
-
seeds: IdlSeed[];
|
|
27
|
-
programId?: IdlSeed;
|
|
28
|
-
};
|
|
29
|
-
type IdlSeed = any;
|
|
30
|
-
type IdlAccounts = {
|
|
31
|
-
name: string;
|
|
32
|
-
docs?: string[];
|
|
33
|
-
accounts: IdlAccountItem[];
|
|
34
|
-
};
|
|
35
|
-
type IdlField = {
|
|
36
|
-
name: string;
|
|
37
|
-
docs?: string[];
|
|
38
|
-
type: IdlType;
|
|
39
|
-
};
|
|
40
|
-
type IdlType = "bool" | "u8" | "i8" | "u16" | "i16" | "u32" | "i32" | "f32" | "u64" | "i64" | "f64" | "u128" | "i128" | "u256" | "i256" | "bytes" | "string" | "publicKey" | IdlTypeDefined | IdlTypeOption | IdlTypeCOption | IdlTypeVec | IdlTypeArray;
|
|
41
|
-
type IdlTypeDefined = {
|
|
42
|
-
defined: string;
|
|
43
|
-
};
|
|
44
|
-
type IdlTypeOption = {
|
|
45
|
-
option: IdlType;
|
|
46
|
-
};
|
|
47
|
-
type IdlTypeCOption = {
|
|
48
|
-
coption: IdlType;
|
|
49
|
-
};
|
|
50
|
-
type IdlTypeVec = {
|
|
51
|
-
vec: IdlType;
|
|
52
|
-
};
|
|
53
|
-
type IdlTypeArray = {
|
|
54
|
-
array: [idlType: IdlType, size: number];
|
|
55
|
-
};
|
|
56
|
-
type IdlAccountDef = {
|
|
57
|
-
name: string;
|
|
58
|
-
docs?: string[];
|
|
59
|
-
type: IdlTypeDefTyStruct;
|
|
60
|
-
};
|
|
61
|
-
type IdlTypeDefTyStruct = {
|
|
62
|
-
kind: "struct";
|
|
63
|
-
fields: IdlTypeDefStruct;
|
|
64
|
-
};
|
|
65
|
-
type IdlTypeDefStruct = Array<IdlField>;
|
|
66
|
-
type IdlTypeDef = {
|
|
67
|
-
name: string;
|
|
68
|
-
docs?: string[];
|
|
69
|
-
type: IdlTypeDefTy;
|
|
70
|
-
};
|
|
71
|
-
type IdlTypeDefTy = IdlTypeDefTyEnum | IdlTypeDefTyStruct | IdlTypeDefTyAlias;
|
|
72
|
-
type IdlTypeDefTyEnum = {
|
|
73
|
-
kind: "enum";
|
|
74
|
-
variants: IdlEnumVariant[];
|
|
75
|
-
};
|
|
76
|
-
type IdlEnumVariant = {
|
|
77
|
-
name: string;
|
|
78
|
-
fields?: IdlEnumFields;
|
|
79
|
-
};
|
|
80
|
-
type IdlTypeDefTyAlias = {
|
|
81
|
-
kind: "alias";
|
|
82
|
-
value: IdlType;
|
|
83
|
-
};
|
|
84
|
-
type IdlEnumFields = IdlEnumFieldsNamed | IdlEnumFieldsTuple;
|
|
85
|
-
type IdlEnumFieldsNamed = IdlField[];
|
|
86
|
-
type IdlEnumFieldsTuple = IdlType[];
|
|
87
|
-
type Instruction<I extends number> = {
|
|
88
|
-
name: IyfExtensionNew["instructions"][I]["name"];
|
|
89
|
-
accounts: IyfExtensionNew["instructions"][I]["accounts"];
|
|
90
|
-
args: IyfExtensionNew["instructions"][I]["args"];
|
|
91
|
-
} & IdlInstruction;
|
|
92
|
-
type GenerateInstructions<T extends any[], I extends number[] = []> = I["length"] extends T["length"] ? [] : [
|
|
93
|
-
Instruction<I["length"]>,
|
|
94
|
-
...GenerateInstructions<T, [...I, I["length"]]>
|
|
95
|
-
];
|
|
96
|
-
type FilteredInstructions = GenerateInstructions<IyfExtensionNew["instructions"]>;
|
|
97
|
-
type FindMatchingType<Name, Types extends any[]> = Types extends Array<infer T> ? T extends {
|
|
98
|
-
name: Name;
|
|
99
|
-
type: infer Type;
|
|
100
|
-
} ? Type : never : never;
|
|
101
|
-
type Account<I extends number> = {
|
|
102
|
-
name: unknown extends IyfExtensionNew["accounts"][I]["name"] ? never : IyfExtensionNew["accounts"][I]["name"];
|
|
103
|
-
type: unknown extends IyfExtensionNew["accounts"][I]["name"] ? never : FindMatchingType<IyfExtensionNew["accounts"][I]["name"], IyfExtensionNew["types"]>;
|
|
104
|
-
} & IdlAccountDef;
|
|
105
|
-
type GenerateAccounts<T extends any[], I extends number[] = []> = I["length"] extends T["length"] ? [] : [
|
|
106
|
-
Account<I["length"]>,
|
|
107
|
-
...GenerateAccounts<T, [...I, I["length"]]>
|
|
108
|
-
];
|
|
109
|
-
type FilteredAccounts = GenerateAccounts<IyfExtensionNew["accounts"]>;
|
|
110
|
-
export type IyfExtension = {
|
|
111
|
-
"version": string;
|
|
112
|
-
"name": string;
|
|
113
|
-
"instructions": FilteredInstructions;
|
|
114
|
-
"accounts": FilteredAccounts;
|
|
115
|
-
"types": IyfExtensionNew["types"] & Array<IdlTypeDef>;
|
|
116
|
-
};
|
|
6
|
+
import { IyfExtension } from "./idl/iyf-extension-wrapper";
|
|
7
|
+
import { IndexYieldFarming } from "./idl/iyf-main-wrapper";
|
|
117
8
|
export declare class Anchor {
|
|
118
9
|
connection: web3.Connection;
|
|
119
10
|
private static _instance;
|
|
@@ -127,5 +18,4 @@ export declare class Anchor {
|
|
|
127
18
|
static initialize(connection: web3.Connection): void;
|
|
128
19
|
static instance(): Anchor;
|
|
129
20
|
}
|
|
130
|
-
export {};
|
|
131
21
|
//# sourceMappingURL=anchor.d.ts.map
|
package/dist/src/anchor.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anchor.d.ts","sourceRoot":"","sources":["../../src/anchor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AACxC,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAC5C,OAAO,
|
|
1
|
+
{"version":3,"file":"anchor.d.ts","sourceRoot":"","sources":["../../src/anchor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AACxC,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAqB,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EAAkB,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAmB,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAS7D,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAI3D,qBAAa,MAAM;IAeR,UAAU,EAAE,IAAI,CAAC,UAAU;IAbpC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAS;IACjC,QAAQ,EAAE,MAAM,CAAC,cAAc,CAAC;IAGhC,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAG3C,YAAY,EAAE,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;IAC3C,WAAW,EAAE,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACvC,cAAc,EAAE,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IACvC,cAAc,EAAE,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAExC,OAAO;IA6DP,MAAM,CAAC,UAAU,CAAC,UAAU,EAAE,IAAI,CAAC,UAAU;IAI7C,MAAM,CAAC,QAAQ,IAAI,MAAM;CAO1B"}
|
package/dist/src/anchor.js
CHANGED
|
@@ -29,19 +29,37 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
29
29
|
exports.Anchor = void 0;
|
|
30
30
|
const web3 = __importStar(require("@solana/web3.js"));
|
|
31
31
|
const anchor = __importStar(require("@coral-xyz/anchor"));
|
|
32
|
-
const iyf_main_idl_1 = require("./idl/iyf-main-idl");
|
|
33
|
-
const iyf_extension_idl_1 = require("./idl/iyf-extension-idl");
|
|
34
32
|
const orca_idl_1 = require("./idl/orca-idl");
|
|
35
33
|
const meteora_idl_1 = require("./idl/meteora-idl");
|
|
36
34
|
const raydium_idl_1 = require("./idl/raydium-idl");
|
|
37
35
|
const nodewallet_1 = __importDefault(require("@coral-xyz/anchor/dist/cjs/nodewallet"));
|
|
38
36
|
const addresses_1 = require("./addresses");
|
|
37
|
+
const iyf_extension_idl_1 = require("./idl/iyf-extension-idl");
|
|
38
|
+
const iyf_main_idl_1 = require("./idl/iyf-main-idl");
|
|
39
39
|
class Anchor {
|
|
40
40
|
constructor(connection) {
|
|
41
41
|
this.connection = connection;
|
|
42
42
|
// Initialize the Anchor provider
|
|
43
43
|
this.provider = new anchor.AnchorProvider(connection, new nodewallet_1.default(web3.Keypair.generate()), {});
|
|
44
|
-
|
|
44
|
+
const IyfMain = {
|
|
45
|
+
version: iyf_main_idl_1.IDL.metadata.version,
|
|
46
|
+
name: iyf_main_idl_1.IDL.metadata.name,
|
|
47
|
+
// @ts-ignore
|
|
48
|
+
instructions: iyf_main_idl_1.IDL.instructions.map((instruction, index) => {
|
|
49
|
+
return {
|
|
50
|
+
name: instruction.name,
|
|
51
|
+
accounts: instruction.accounts.map(account => {
|
|
52
|
+
return {
|
|
53
|
+
name: account.name,
|
|
54
|
+
isMut: "writable" in account ? account.writable : false,
|
|
55
|
+
isSigner: "signer" in account ? account.signer : false,
|
|
56
|
+
};
|
|
57
|
+
}),
|
|
58
|
+
args: instruction.args,
|
|
59
|
+
};
|
|
60
|
+
}),
|
|
61
|
+
};
|
|
62
|
+
this.iyfMain = new anchor.Program(IyfMain, addresses_1.IYF_MAIN, this.provider);
|
|
45
63
|
const p = iyf_extension_idl_1.IDL.instructions.map(instruction => {
|
|
46
64
|
return {
|
|
47
65
|
name: instruction.name,
|
|
@@ -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,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;
|
|
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;AA4BlB,OAAO,EAEL,wBAAwB,EACxB,mBAAmB,EACnB,wBAAwB,EACzB,MAAM,UAAU,CAAC;AAKlB,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAcxD,qBAAa,YAAY;IACvB;;OAEG;IACH,OAAO;IAIP;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAe;IAEtC;;OAEG;IACI,EAAE,EAAE,iBAAiB,CAAC;IAE7B;;;;OAIG;IACH,MAAM,CAAC,WAAW,IAAI,Y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AAM,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"}
|
|
@@ -46,7 +46,6 @@ const orca_1 = require("../orca");
|
|
|
46
46
|
const hsToMeteora_1 = require("../hsToMeteora");
|
|
47
47
|
const meteora_1 = require("../meteora");
|
|
48
48
|
const anchor_1 = require("../anchor");
|
|
49
|
-
const hawksight_1 = require("../hawksight");
|
|
50
49
|
const types_2 = require("../types");
|
|
51
50
|
const Logging_1 = require("./Logging");
|
|
52
51
|
const TransactionBatchExecute2_1 = require("./TransactionBatchExecute2");
|
|
@@ -120,6 +119,7 @@ class Transactions {
|
|
|
120
119
|
description: "Register User",
|
|
121
120
|
addressLookupTableAddresses: addresses_1.GLOBAL_ALT,
|
|
122
121
|
mainInstructions: [
|
|
122
|
+
// @ts-ignore
|
|
123
123
|
yield anchor_1.Anchor.instance()
|
|
124
124
|
.iyfMain.methods.newUser()
|
|
125
125
|
.accounts({
|
|
@@ -192,9 +192,9 @@ class Transactions {
|
|
|
192
192
|
*/
|
|
193
193
|
meteoraCreatePositionAndDeposit(_a) {
|
|
194
194
|
return __awaiter(this, arguments, void 0, function* ({ connection, params, }) {
|
|
195
|
-
const dlmmPool = yield meteora_1.MeteoraDLMM.create(connection, new web3.PublicKey(params.pool));
|
|
195
|
+
const dlmmPool = yield meteora_1.MeteoraDLMM.create(connection, new web3.PublicKey(params.pool), this.ix);
|
|
196
196
|
const userPda = (0, functions_1.generateUserPda)(params.userWallet);
|
|
197
|
-
const mainInstructions = (yield dlmmPool.initializePositionAndAddLiquidityByStrategy(params.userWallet, params.userWallet, {
|
|
197
|
+
const mainInstructions = (yield dlmmPool.initializePositionAndAddLiquidityByStrategy(connection, params.userWallet, params.userWallet, {
|
|
198
198
|
positionPubKey: params.position,
|
|
199
199
|
user: userPda,
|
|
200
200
|
totalXAmount: params.totalXAmount,
|
|
@@ -228,7 +228,7 @@ class Transactions {
|
|
|
228
228
|
*/
|
|
229
229
|
meteoraCreatePositionAndDepositPda(_a) {
|
|
230
230
|
return __awaiter(this, arguments, void 0, function* ({ connection, params, }) {
|
|
231
|
-
const dlmmPool = yield meteora_1.MeteoraDLMM.create(connection, new web3.PublicKey(params.pool));
|
|
231
|
+
const dlmmPool = yield meteora_1.MeteoraDLMM.create(connection, new web3.PublicKey(params.pool), this.ix);
|
|
232
232
|
const userPda = (0, functions_1.generateUserPda)(params.userWallet);
|
|
233
233
|
const mainInstructions = (yield dlmmPool.initializePositionAndAddLiquidityByStrategyPda(params.userWallet, params.userWallet, {
|
|
234
234
|
positionPubKey: params.position,
|
|
@@ -263,7 +263,7 @@ class Transactions {
|
|
|
263
263
|
meteoraInitializeBinArrays(_a) {
|
|
264
264
|
return __awaiter(this, arguments, void 0, function* ({ connection, params, }) {
|
|
265
265
|
const poolAddress = new web3.PublicKey(params.pool);
|
|
266
|
-
const dlmmPool = yield meteora_1.MeteoraDLMM.create(connection, poolAddress);
|
|
266
|
+
const dlmmPool = yield meteora_1.MeteoraDLMM.create(connection, poolAddress, this.ix);
|
|
267
267
|
const binArraysRequired = yield (0, dlmm_1.getBinArraysRequiredByPositionRange)(poolAddress, new bn_js_1.default(params.minBinId), new bn_js_1.default(params.maxBinId), dlmmPool.dlmm.program.programId);
|
|
268
268
|
const mainInstructions = yield dlmmPool.dlmm.initializeBinArrays(binArraysRequired.map((b) => b.index), new web3.PublicKey(params.userWallet));
|
|
269
269
|
return (0, functions_1.createTransactionMeta)({
|
|
@@ -297,9 +297,9 @@ class Transactions {
|
|
|
297
297
|
maxBinId = position.upperBinId;
|
|
298
298
|
minBinId = position.lowerBinId;
|
|
299
299
|
}
|
|
300
|
-
const dlmmPool = yield meteora_1.MeteoraDLMM.create(connection, new web3.PublicKey(lbPair));
|
|
300
|
+
const dlmmPool = yield meteora_1.MeteoraDLMM.create(connection, new web3.PublicKey(lbPair), this.ix);
|
|
301
301
|
const userPda = (0, functions_1.generateUserPda)(params.userWallet);
|
|
302
|
-
const mainInstructions = (yield dlmmPool.addLiquidityByStrategy(params.userWallet, params.userWallet, {
|
|
302
|
+
const mainInstructions = (yield dlmmPool.addLiquidityByStrategy(connection, params.userWallet, params.userWallet, {
|
|
303
303
|
positionPubKey: params.position,
|
|
304
304
|
user: userPda,
|
|
305
305
|
totalXAmount: params.totalXAmount,
|
|
@@ -341,7 +341,7 @@ class Transactions {
|
|
|
341
341
|
const position = yield program.account.positionV2.fetch(params.position);
|
|
342
342
|
lbPair = position.lbPair;
|
|
343
343
|
}
|
|
344
|
-
const dlmmPool = yield meteora_1.MeteoraDLMM.create(connection, lbPair);
|
|
344
|
+
const dlmmPool = yield meteora_1.MeteoraDLMM.create(connection, lbPair, this.ix);
|
|
345
345
|
if (params.fastGeneration === undefined) {
|
|
346
346
|
const { userPositions } = yield dlmmPool.getPositionsByUserAndLbPair(userPda);
|
|
347
347
|
const userPosition = userPositions.find((userPosition) => userPosition.publicKey.toString() === params.position.toString());
|
|
@@ -356,7 +356,7 @@ class Transactions {
|
|
|
356
356
|
const amountBps = params.shouldClaimAndClose
|
|
357
357
|
? new bn_js_1.default(10000)
|
|
358
358
|
: params.amountBps;
|
|
359
|
-
const mainInstructions = (yield dlmmPool.removeLiquidity(params.userWallet, params.userWallet, {
|
|
359
|
+
const mainInstructions = (yield dlmmPool.removeLiquidity(connection, params.userWallet, params.userWallet, {
|
|
360
360
|
user: userPda,
|
|
361
361
|
position: params.position,
|
|
362
362
|
binIds: binIdsToRemove,
|
|
@@ -404,7 +404,7 @@ class Transactions {
|
|
|
404
404
|
const position = yield program.account.positionV2.fetch(params.position);
|
|
405
405
|
lbPair = position.lbPair;
|
|
406
406
|
}
|
|
407
|
-
const dlmmPool = yield meteora_1.MeteoraDLMM.create(connection, lbPair);
|
|
407
|
+
const dlmmPool = yield meteora_1.MeteoraDLMM.create(connection, lbPair, this.ix);
|
|
408
408
|
if (params.fastGeneration === undefined) {
|
|
409
409
|
const { userPositions } = yield dlmmPool.getPositionsByUserAndLbPair(userPda);
|
|
410
410
|
const userPosition = userPositions.find((userPosition) => userPosition.publicKey.toString() === params.position.toString());
|
|
@@ -532,7 +532,7 @@ class Transactions {
|
|
|
532
532
|
return __awaiter(this, arguments, void 0, function* ({ connection, params, }) {
|
|
533
533
|
const program = yield meteora_1.MeteoraDLMM.program(connection);
|
|
534
534
|
const position = yield program.account.positionV2.fetch(params.position);
|
|
535
|
-
const dlmmPool = yield meteora_1.MeteoraDLMM.create(connection, position.lbPair);
|
|
535
|
+
const dlmmPool = yield meteora_1.MeteoraDLMM.create(connection, position.lbPair, this.ix);
|
|
536
536
|
const userPda = (0, functions_1.generateUserPda)(params.userWallet);
|
|
537
537
|
const { userPositions } = yield dlmmPool.getPositionsByUserAndLbPair(userPda);
|
|
538
538
|
const index = userPositions.findIndex((v) => v.publicKey.equals(params.position));
|
|
@@ -625,12 +625,14 @@ class Transactions {
|
|
|
625
625
|
}));
|
|
626
626
|
}
|
|
627
627
|
});
|
|
628
|
-
mainInstructions.push(yield this.ix.iyfMain.
|
|
628
|
+
mainInstructions.push(yield this.ix.iyfMain.withdrawMultipleTokenWithToken2022({
|
|
629
|
+
connection,
|
|
629
630
|
payer: params.userWallet,
|
|
630
631
|
withdraw: params.mints.map((mint) => {
|
|
631
|
-
return { mint };
|
|
632
|
+
return { mint, amount: new bn_js_1.default(0) };
|
|
632
633
|
}),
|
|
633
|
-
|
|
634
|
+
pdaTokenType: types_1.TokenType.STA,
|
|
635
|
+
hasAmount: false,
|
|
634
636
|
}));
|
|
635
637
|
return (0, functions_1.createTransactionMeta)({
|
|
636
638
|
payer: params.userWallet,
|
|
@@ -644,7 +646,7 @@ class Transactions {
|
|
|
644
646
|
return __awaiter(this, arguments, void 0, function* ({ connection, params, }) {
|
|
645
647
|
const program = yield meteora_1.MeteoraDLMM.program(connection);
|
|
646
648
|
const position = yield program.account.positionV2.fetch(params.position);
|
|
647
|
-
const dlmmPool = yield meteora_1.MeteoraDLMM.create(connection, position.lbPair);
|
|
649
|
+
const dlmmPool = yield meteora_1.MeteoraDLMM.create(connection, position.lbPair, this.ix);
|
|
648
650
|
const userPda = (0, functions_1.generateUserPda)(params.userWallet);
|
|
649
651
|
const { userPositions } = yield dlmmPool.getPositionsByUserAndLbPair(userPda);
|
|
650
652
|
const userPosition = userPositions.find((userPosition) => userPosition.publicKey.equals(params.position));
|
|
@@ -660,7 +662,7 @@ class Transactions {
|
|
|
660
662
|
pdaTokenType: types_1.TokenType.ATA,
|
|
661
663
|
}, hsToMeteora_1.meteoraToHawksightAutomationIxs);
|
|
662
664
|
// Re-deposit fees (TODO: How to re-deposit reward tokens that is not X or Y token?)
|
|
663
|
-
const addLiquidityBuilder = yield dlmmPool.addLiquidityByStrategy(params.userWallet, addresses_1.HS_AUTHORITY, {
|
|
665
|
+
const addLiquidityBuilder = yield dlmmPool.addLiquidityByStrategy(connection, params.userWallet, addresses_1.HS_AUTHORITY, {
|
|
664
666
|
positionPubKey: params.position,
|
|
665
667
|
user: userPda,
|
|
666
668
|
totalXAmount: new bn_js_1.default(100000), // This is overriden on-chain, so value here do not matter
|
|
@@ -692,7 +694,7 @@ class Transactions {
|
|
|
692
694
|
return __awaiter(this, arguments, void 0, function* ({ connection, params, }) {
|
|
693
695
|
const program = yield meteora_1.MeteoraDLMM.program(connection);
|
|
694
696
|
const position = yield program.account.positionV2.fetch(params.position);
|
|
695
|
-
const dlmmPool = yield meteora_1.MeteoraDLMM.create(connection, position.lbPair);
|
|
697
|
+
const dlmmPool = yield meteora_1.MeteoraDLMM.create(connection, position.lbPair, this.ix);
|
|
696
698
|
const userPda = (0, functions_1.generateUserPda)(params.userWallet);
|
|
697
699
|
const { userPositions } = yield dlmmPool.getPositionsByUserAndLbPair(userPda);
|
|
698
700
|
const userPosition = userPositions.find((userPosition) => userPosition.publicKey.equals(params.position));
|
|
@@ -722,7 +724,7 @@ class Transactions {
|
|
|
722
724
|
return __awaiter(this, arguments, void 0, function* ({ connection, params, }) {
|
|
723
725
|
const program = yield meteora_1.MeteoraDLMM.program(connection);
|
|
724
726
|
const position = yield program.account.positionV2.fetch(params.currentPosition);
|
|
725
|
-
const dlmmPool = yield meteora_1.MeteoraDLMM.create(connection, position.lbPair);
|
|
727
|
+
const dlmmPool = yield meteora_1.MeteoraDLMM.create(connection, position.lbPair, this.ix);
|
|
726
728
|
const userPda = (0, functions_1.generateUserPda)(params.userWallet);
|
|
727
729
|
// Step 1: Claim all fees/rewards, remove all liquidity and close current position
|
|
728
730
|
const { userPositions } = yield dlmmPool.getPositionsByUserAndLbPair(userPda);
|
|
@@ -731,7 +733,7 @@ class Transactions {
|
|
|
731
733
|
throw new Error(`Position: ${params.currentPosition} does not exist.`);
|
|
732
734
|
}
|
|
733
735
|
const binIdsToRemove = userPosition.positionData.positionBinData.map((bin) => bin.binId);
|
|
734
|
-
const removeLiquidityBuilder = yield dlmmPool.removeLiquidity(params.userWallet, addresses_1.HS_AUTHORITY, {
|
|
736
|
+
const removeLiquidityBuilder = yield dlmmPool.removeLiquidity(connection, params.userWallet, addresses_1.HS_AUTHORITY, {
|
|
735
737
|
user: userPda,
|
|
736
738
|
position: params.currentPosition,
|
|
737
739
|
binIds: binIdsToRemove,
|
|
@@ -747,7 +749,7 @@ class Transactions {
|
|
|
747
749
|
removeLiquidityBuilder.replaceClaimRewardToSTA();
|
|
748
750
|
}
|
|
749
751
|
// Re-deposit fees (TODO: How to re-deposit reward tokens that is not X or Y token?)
|
|
750
|
-
const initPositionAndAddLiquidityBuilder = yield dlmmPool.initializePositionAndAddLiquidityByStrategy(params.userWallet, addresses_1.HS_AUTHORITY, {
|
|
752
|
+
const initPositionAndAddLiquidityBuilder = yield dlmmPool.initializePositionAndAddLiquidityByStrategy(connection, params.userWallet, addresses_1.HS_AUTHORITY, {
|
|
751
753
|
positionPubKey: params.newPosition,
|
|
752
754
|
user: userPda,
|
|
753
755
|
totalXAmount: new bn_js_1.default(100000), // This is overriden on-chain, so value here do not matter
|
|
@@ -779,7 +781,7 @@ class Transactions {
|
|
|
779
781
|
return __awaiter(this, arguments, void 0, function* ({ connection, params, }) {
|
|
780
782
|
const program = yield meteora_1.MeteoraDLMM.program(connection);
|
|
781
783
|
const position = yield program.account.positionV2.fetch(params.currentPosition);
|
|
782
|
-
const dlmmPool = yield meteora_1.MeteoraDLMM.create(connection, position.lbPair);
|
|
784
|
+
const dlmmPool = yield meteora_1.MeteoraDLMM.create(connection, position.lbPair, this.ix);
|
|
783
785
|
const userPda = (0, functions_1.generateUserPda)(params.userWallet);
|
|
784
786
|
// Step 1: Claim all fees/rewards, remove all liquidity and close current position
|
|
785
787
|
const { userPositions } = yield dlmmPool.getPositionsByUserAndLbPair(userPda);
|
|
@@ -788,7 +790,7 @@ class Transactions {
|
|
|
788
790
|
throw new Error(`Position: ${params.currentPosition} does not exist.`);
|
|
789
791
|
}
|
|
790
792
|
const binIdsToRemove = userPosition.positionData.positionBinData.map((bin) => bin.binId);
|
|
791
|
-
const removeLiquidityBuilder = yield dlmmPool.removeLiquidity(params.userWallet, addresses_1.HS_AUTHORITY, {
|
|
793
|
+
const removeLiquidityBuilder = yield dlmmPool.removeLiquidity(connection, params.userWallet, addresses_1.HS_AUTHORITY, {
|
|
792
794
|
user: userPda,
|
|
793
795
|
position: params.currentPosition,
|
|
794
796
|
binIds: binIdsToRemove,
|
|
@@ -837,10 +839,10 @@ class Transactions {
|
|
|
837
839
|
}
|
|
838
840
|
openAutomationIx(_a) {
|
|
839
841
|
return __awaiter(this, arguments, void 0, function* ({ connection, params, }) {
|
|
840
|
-
const dlmmPool = yield meteora_1.MeteoraDLMM.create(connection, params.pool);
|
|
842
|
+
const dlmmPool = yield meteora_1.MeteoraDLMM.create(connection, params.pool, this.ix);
|
|
841
843
|
const userPda = (0, functions_1.generateUserPda)(params.userWallet);
|
|
842
844
|
// Open new position
|
|
843
|
-
const initPositionAndAddLiquidityBuilder = yield dlmmPool.initializePositionAndAddLiquidityByStrategy(params.userWallet, addresses_1.HS_AUTHORITY, {
|
|
845
|
+
const initPositionAndAddLiquidityBuilder = yield dlmmPool.initializePositionAndAddLiquidityByStrategy(connection, params.userWallet, addresses_1.HS_AUTHORITY, {
|
|
844
846
|
positionPubKey: params.position,
|
|
845
847
|
user: userPda,
|
|
846
848
|
slippage: params.slippage,
|
|
@@ -904,7 +906,7 @@ class Transactions {
|
|
|
904
906
|
}
|
|
905
907
|
let dlmmPool;
|
|
906
908
|
try {
|
|
907
|
-
dlmmPool = yield retryRpcCall(() => meteora_1.MeteoraDLMM.create(connection, position.lbPair), `Create DLMM pool for lbPair ${position.lbPair}`);
|
|
909
|
+
dlmmPool = yield retryRpcCall(() => meteora_1.MeteoraDLMM.create(connection, position.lbPair, this.ix), `Create DLMM pool for lbPair ${position.lbPair}`);
|
|
908
910
|
}
|
|
909
911
|
catch (error) {
|
|
910
912
|
throw new Error(`Failed to create DLMM pool for lbPair ${position.lbPair}: ${error}`);
|
|
@@ -941,7 +943,7 @@ class Transactions {
|
|
|
941
943
|
}
|
|
942
944
|
let removeLiquidityBuilder;
|
|
943
945
|
try {
|
|
944
|
-
removeLiquidityBuilder = yield retryRpcCall(() => dlmmPool.removeLiquidity(params.userWallet, addresses_1.HS_AUTHORITY, {
|
|
946
|
+
removeLiquidityBuilder = yield retryRpcCall(() => dlmmPool.removeLiquidity(connection, params.userWallet, addresses_1.HS_AUTHORITY, {
|
|
945
947
|
user: userPda,
|
|
946
948
|
position: params.position,
|
|
947
949
|
binIds: binIdsToRemove,
|
|
@@ -981,7 +983,7 @@ class Transactions {
|
|
|
981
983
|
return __awaiter(this, arguments, void 0, function* ({ connection, params, }) {
|
|
982
984
|
const program = yield meteora_1.MeteoraDLMM.program(connection);
|
|
983
985
|
const position = yield program.account.positionV2.fetch(params.position);
|
|
984
|
-
const dlmmPool = yield meteora_1.MeteoraDLMM.create(connection, position.lbPair);
|
|
986
|
+
const dlmmPool = yield meteora_1.MeteoraDLMM.create(connection, position.lbPair, this.ix);
|
|
985
987
|
const userPda = (0, functions_1.generateUserPda)(params.userWallet);
|
|
986
988
|
// Step 1: Claim all fees/rewards, remove all liquidity and close current position
|
|
987
989
|
// const { userPositions } = await dlmmPool.getPositionsByUserAndLbPair(
|
|
@@ -1060,6 +1062,7 @@ class Transactions {
|
|
|
1060
1062
|
})
|
|
1061
1063
|
.instruction();
|
|
1062
1064
|
// Instruction via main hawksight contract
|
|
1065
|
+
// @ts-ignore
|
|
1063
1066
|
ix = yield anchor_1.Anchor.instance()
|
|
1064
1067
|
.iyfMain.methods.iyfExtensionExecuteV2(limitCloseAutomationIx.data)
|
|
1065
1068
|
.accounts({
|
|
@@ -1147,7 +1150,7 @@ class Transactions {
|
|
|
1147
1150
|
return __awaiter(this, arguments, void 0, function* ({ connection, params, }) {
|
|
1148
1151
|
const program = yield meteora_1.MeteoraDLMM.program(connection);
|
|
1149
1152
|
const position = yield program.account.positionV2.fetch(params.position);
|
|
1150
|
-
const dlmmPool = yield meteora_1.MeteoraDLMM.create(connection, position.lbPair);
|
|
1153
|
+
const dlmmPool = yield meteora_1.MeteoraDLMM.create(connection, position.lbPair, this.ix);
|
|
1151
1154
|
const userPda = (0, functions_1.generateUserPda)(params.userWallet);
|
|
1152
1155
|
// Step 1: Claim all fees/rewards, remove all liquidity and close current position
|
|
1153
1156
|
// const { userPositions } = await dlmmPool.getPositionsByUserAndLbPair(
|
|
@@ -1532,18 +1535,14 @@ class Transactions {
|
|
|
1532
1535
|
{ mint: mintA, amount: params.totalXAmount },
|
|
1533
1536
|
{ mint: mintB, amount: params.totalYAmount },
|
|
1534
1537
|
]);
|
|
1535
|
-
const depositIx = yield
|
|
1538
|
+
const depositIx = yield this.ix.iyfMain.depositMultipleTokenWithToken2022({
|
|
1539
|
+
connection,
|
|
1536
1540
|
payer: params.userWallet,
|
|
1537
1541
|
deposit: [
|
|
1538
|
-
{
|
|
1539
|
-
|
|
1540
|
-
amount: params.totalXAmount,
|
|
1541
|
-
},
|
|
1542
|
-
{
|
|
1543
|
-
mint: mintB,
|
|
1544
|
-
amount: params.totalYAmount,
|
|
1545
|
-
},
|
|
1542
|
+
{ mint: mintA, amount: params.totalXAmount },
|
|
1543
|
+
{ mint: mintB, amount: params.totalYAmount },
|
|
1546
1544
|
],
|
|
1545
|
+
pdaTokenType: types_1.TokenType.ATA,
|
|
1547
1546
|
});
|
|
1548
1547
|
// @ts-ignore
|
|
1549
1548
|
const extensionIx = yield anchor_1.Anchor.instance()
|
|
@@ -1570,6 +1569,7 @@ class Transactions {
|
|
|
1570
1569
|
associatedTokenProgram: addresses_1.ASSOCIATED_TOKEN_PROGRAM,
|
|
1571
1570
|
})
|
|
1572
1571
|
.instruction();
|
|
1572
|
+
// @ts-ignore
|
|
1573
1573
|
const orcaIx = yield anchor_1.Anchor.instance()
|
|
1574
1574
|
.iyfMain.methods.iyfExtensionExecute(extensionIx.data)
|
|
1575
1575
|
.accounts({
|
|
@@ -1597,9 +1597,15 @@ class Transactions {
|
|
|
1597
1597
|
extensionIx.keys[18],
|
|
1598
1598
|
])
|
|
1599
1599
|
.instruction();
|
|
1600
|
-
const clearRemainingTokensIxs = yield
|
|
1600
|
+
const clearRemainingTokensIxs = yield this.ix.iyfMain.withdrawMultipleTokenWithToken2022({
|
|
1601
|
+
connection,
|
|
1601
1602
|
payer: params.userWallet,
|
|
1602
|
-
withdraw: [
|
|
1603
|
+
withdraw: [
|
|
1604
|
+
{ mint: mintA, amount: new bn_js_1.default(0) },
|
|
1605
|
+
{ mint: mintB, amount: new bn_js_1.default(0) },
|
|
1606
|
+
],
|
|
1607
|
+
pdaTokenType: types_1.TokenType.ATA,
|
|
1608
|
+
hasAmount: false,
|
|
1603
1609
|
});
|
|
1604
1610
|
orcaIx.keys[2].isSigner = true; // authority must be signer.
|
|
1605
1611
|
const mainInstructions = [
|
|
@@ -1991,6 +1997,7 @@ class Transactions {
|
|
|
1991
1997
|
associatedTokenProgram: addresses_1.ASSOCIATED_TOKEN_PROGRAM,
|
|
1992
1998
|
})
|
|
1993
1999
|
.instruction();
|
|
2000
|
+
// @ts-ignore
|
|
1994
2001
|
const orcaIx = yield anchor_1.Anchor.instance()
|
|
1995
2002
|
.iyfMain.methods.iyfExtensionExecute(extensionIx.data)
|
|
1996
2003
|
.accounts({
|
|
@@ -2018,9 +2025,15 @@ class Transactions {
|
|
|
2018
2025
|
extensionIx.keys[18],
|
|
2019
2026
|
])
|
|
2020
2027
|
.instruction();
|
|
2021
|
-
const withdrawFromPda = yield
|
|
2028
|
+
const withdrawFromPda = yield this.ix.iyfMain.withdrawMultipleTokenWithToken2022({
|
|
2029
|
+
connection,
|
|
2022
2030
|
payer: params.userWallet,
|
|
2023
|
-
withdraw: [
|
|
2031
|
+
withdraw: [
|
|
2032
|
+
{ mint: mintA, amount: new bn_js_1.default(0) },
|
|
2033
|
+
{ mint: mintB, amount: new bn_js_1.default(0) },
|
|
2034
|
+
],
|
|
2035
|
+
pdaTokenType: types_1.TokenType.ATA,
|
|
2036
|
+
hasAmount: false,
|
|
2024
2037
|
});
|
|
2025
2038
|
orcaIx.keys[2].isSigner = true; // authority must be signer.
|
|
2026
2039
|
const mainInstructions = [orcaIx, withdrawFromPda];
|
|
@@ -2330,6 +2343,7 @@ class Transactions {
|
|
|
2330
2343
|
})
|
|
2331
2344
|
.remainingAccounts(remainingAccounts)
|
|
2332
2345
|
.instruction();
|
|
2346
|
+
// @ts-ignore
|
|
2333
2347
|
const orcaIx = yield anchor_1.Anchor.instance()
|
|
2334
2348
|
.iyfMain.methods.iyfExtensionExecute(extensionIx.data)
|
|
2335
2349
|
.accounts({
|
|
@@ -2341,9 +2355,15 @@ class Transactions {
|
|
|
2341
2355
|
})
|
|
2342
2356
|
.remainingAccounts([...extensionIx.keys.slice(4)])
|
|
2343
2357
|
.instruction();
|
|
2344
|
-
const withdrawFromPda = yield
|
|
2358
|
+
const withdrawFromPda = yield this.ix.iyfMain.withdrawMultipleTokenWithToken2022({
|
|
2359
|
+
connection,
|
|
2345
2360
|
payer: params.userWallet,
|
|
2346
|
-
withdraw: [
|
|
2361
|
+
withdraw: [
|
|
2362
|
+
{ mint: mintA, amount: new bn_js_1.default(0) },
|
|
2363
|
+
{ mint: mintB, amount: new bn_js_1.default(0) },
|
|
2364
|
+
],
|
|
2365
|
+
pdaTokenType: types_1.TokenType.ATA,
|
|
2366
|
+
hasAmount: false,
|
|
2347
2367
|
});
|
|
2348
2368
|
orcaIx.keys[2].isSigner = true; // authority must be signer.
|
|
2349
2369
|
const mainInstructions = [
|
|
@@ -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,oBA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,CAAC,UAAU,EAC3B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,gBAAgB,GACvB,OAAO,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAC;IAiC7C,mBAAmB,CACvB,UAAU,EAAE,IAAI,CAAC,UAAU,EAC3B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,mBAAmB,GAC1B,OAAO,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAC;IA8B7C,oBAAoB,CACxB,UAAU,EAAE,IAAI,CAAC,UAAU,EAC3B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,oBAAoB,GAC3B,OAAO,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAC;IA8B7C,+BAA+B,CACnC,UAAU,EAAE,IAAI,CAAC,UAAU,EAC3B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,+BAA+B,GACtC,OAAO,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAC;IA8B7C,wBAAwB,CAC5B,UAAU,EAAE,IAAI,CAAC,UAAU,EAC3B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,wBAAwB,GAC/B,OAAO,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAC;IA8B7C,wBAAwB,CAC5B,UAAU,EAAE,IAAI,CAAC,UAAU,EAC3B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,wBAAwB,GAC/B,OAAO,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAC;CA6BpD"}
|
|
@@ -235,6 +235,7 @@ class TxGenerator {
|
|
|
235
235
|
}
|
|
236
236
|
// Deposit to limit token accounts
|
|
237
237
|
ixs.push(yield this.ix.iyfMain.depositMultipleTokenV2({
|
|
238
|
+
connection,
|
|
238
239
|
payer: params.userWallet,
|
|
239
240
|
deposit: params.deposit,
|
|
240
241
|
pdaTokenType: types_1.TokenType.LTA,
|
|
@@ -264,6 +265,7 @@ class TxGenerator {
|
|
|
264
265
|
const ixs = [];
|
|
265
266
|
// Withdraw from limit token accounts
|
|
266
267
|
ixs.push(yield this.ix.iyfMain.withdrawMultipleTokenV2({
|
|
268
|
+
connection,
|
|
267
269
|
payer: params.userWallet,
|
|
268
270
|
withdraw: params.withdraw,
|
|
269
271
|
pdaTokenType: types_1.TokenType.LTA,
|