@hawksightco/hawk-sdk 1.3.48 → 1.3.49
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/hsToMeteora.js +24 -23
- package/package.json +1 -1
package/dist/src/hsToMeteora.js
CHANGED
|
@@ -2138,14 +2138,14 @@ class MeteoraDlmmClaimFee2Automation extends HawksightMeteoraAutomationCpi {
|
|
|
2138
2138
|
* @param authority The authority public key that has signing capabilities over the transaction.
|
|
2139
2139
|
*/
|
|
2140
2140
|
constructor(ix, userPda, authority, opt) {
|
|
2141
|
-
super(ix, userPda, authority,
|
|
2141
|
+
super(ix, userPda, authority, util.sighash("claim_fee2", undefined, true), opt);
|
|
2142
2142
|
}
|
|
2143
2143
|
/**
|
|
2144
2144
|
* Modifies transaction keys for the purpose of claiming transaction fees.
|
|
2145
2145
|
*/
|
|
2146
2146
|
replace() {
|
|
2147
|
-
this._ix.keys[
|
|
2148
|
-
this._ix.keys[
|
|
2147
|
+
this._ix.keys[2].pubkey = this.userPda;
|
|
2148
|
+
this._ix.keys[2].isSigner = false;
|
|
2149
2149
|
}
|
|
2150
2150
|
/**
|
|
2151
2151
|
* Replaces Meteora CPI with Hawksight CPI that calls the target Meteora CPI.
|
|
@@ -2156,6 +2156,7 @@ class MeteoraDlmmClaimFee2Automation extends HawksightMeteoraAutomationCpi {
|
|
|
2156
2156
|
// Common parameters
|
|
2157
2157
|
const userPda = this.userPda;
|
|
2158
2158
|
const authority = this.authority;
|
|
2159
|
+
const hawksightAuthority = addresses_1.HS_AUTHORITY;
|
|
2159
2160
|
// Get token mints X and Y
|
|
2160
2161
|
const tokenXMint = this.ix.keys[9].pubkey;
|
|
2161
2162
|
const tokenYMint = this.ix.keys[10].pubkey;
|
|
@@ -2170,16 +2171,16 @@ class MeteoraDlmmClaimFee2Automation extends HawksightMeteoraAutomationCpi {
|
|
|
2170
2171
|
// Adjust by token type
|
|
2171
2172
|
const pdaTokenType = (_a = this.opt) === null || _a === void 0 ? void 0 : _a.pdaTokenType;
|
|
2172
2173
|
if (pdaTokenType === types_1.TokenType.LTA) {
|
|
2173
|
-
this.ix.keys[
|
|
2174
|
-
this.ix.keys[
|
|
2174
|
+
this.ix.keys[5].pubkey = util.generateLimitToken(this.userPda, this.ix.keys[9].pubkey);
|
|
2175
|
+
this.ix.keys[6].pubkey = util.generateLimitToken(this.userPda, this.ix.keys[10].pubkey);
|
|
2175
2176
|
}
|
|
2176
2177
|
else if (pdaTokenType === types_1.TokenType.STA) {
|
|
2177
|
-
this.ix.keys[
|
|
2178
|
-
this.ix.keys[
|
|
2178
|
+
this.ix.keys[5].pubkey = util.generateUserPdaStorageAccount(this.userPda, this.ix.keys[9].pubkey);
|
|
2179
|
+
this.ix.keys[6].pubkey = util.generateUserPdaStorageAccount(this.userPda, this.ix.keys[10].pubkey);
|
|
2179
2180
|
}
|
|
2180
2181
|
else {
|
|
2181
|
-
this.ix.keys[
|
|
2182
|
-
this.ix.keys[
|
|
2182
|
+
this.ix.keys[5].pubkey = util.generateAta(this.userPda, this.ix.keys[9].pubkey, tokenXMintInfo.info.owner);
|
|
2183
|
+
this.ix.keys[6].pubkey = util.generateAta(this.userPda, this.ix.keys[10].pubkey, tokenYMintInfo.info.owner);
|
|
2183
2184
|
}
|
|
2184
2185
|
// Generate IX via extension contract
|
|
2185
2186
|
// @ts-ignore
|
|
@@ -2188,20 +2189,20 @@ class MeteoraDlmmClaimFee2Automation extends HawksightMeteoraAutomationCpi {
|
|
|
2188
2189
|
.accounts({
|
|
2189
2190
|
userPda,
|
|
2190
2191
|
authority,
|
|
2191
|
-
hawksightAuthority
|
|
2192
|
-
lbPair: this.ix.keys[
|
|
2193
|
-
position: this.ix.keys[
|
|
2194
|
-
reserveX: this.ix.keys[
|
|
2195
|
-
reserveY: this.ix.keys[
|
|
2196
|
-
userTokenX: this.ix.keys[
|
|
2197
|
-
userTokenY: this.ix.keys[
|
|
2198
|
-
tokenXMint: this.ix.keys[
|
|
2199
|
-
tokenYMint: this.ix.keys[
|
|
2200
|
-
tokenProgramX: this.ix.keys[
|
|
2201
|
-
tokenProgramY: this.ix.keys[
|
|
2202
|
-
memoProgram: this.ix.keys[
|
|
2203
|
-
eventAuthority: this.ix.keys[
|
|
2204
|
-
meteoraDlmmProgram: this.ix.keys[
|
|
2192
|
+
hawksightAuthority,
|
|
2193
|
+
lbPair: this.ix.keys[0].pubkey,
|
|
2194
|
+
position: this.ix.keys[1].pubkey,
|
|
2195
|
+
reserveX: this.ix.keys[3].pubkey,
|
|
2196
|
+
reserveY: this.ix.keys[4].pubkey,
|
|
2197
|
+
userTokenX: this.ix.keys[5].pubkey,
|
|
2198
|
+
userTokenY: this.ix.keys[6].pubkey,
|
|
2199
|
+
tokenXMint: this.ix.keys[7].pubkey,
|
|
2200
|
+
tokenYMint: this.ix.keys[8].pubkey,
|
|
2201
|
+
tokenProgramX: this.ix.keys[9].pubkey,
|
|
2202
|
+
tokenProgramY: this.ix.keys[10].pubkey,
|
|
2203
|
+
memoProgram: this.ix.keys[11].pubkey,
|
|
2204
|
+
eventAuthority: this.ix.keys[12].pubkey,
|
|
2205
|
+
meteoraDlmmProgram: this.ix.keys[13].pubkey,
|
|
2205
2206
|
ownerFeeX,
|
|
2206
2207
|
ownerFeeY,
|
|
2207
2208
|
}).instruction();
|