@hawksightco/hawk-sdk 1.3.49 → 1.3.51
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 +12 -9
- package/package.json +1 -1
package/dist/src/hsToMeteora.js
CHANGED
|
@@ -2157,9 +2157,12 @@ class MeteoraDlmmClaimFee2Automation extends HawksightMeteoraAutomationCpi {
|
|
|
2157
2157
|
const userPda = this.userPda;
|
|
2158
2158
|
const authority = this.authority;
|
|
2159
2159
|
const hawksightAuthority = addresses_1.HS_AUTHORITY;
|
|
2160
|
+
const minBinId = this.ix.data.readInt32LE(8);
|
|
2161
|
+
const maxBinId = this.ix.data.readInt32LE(12);
|
|
2162
|
+
const remainingAccountsInfo = this.ix.data.subarray(16);
|
|
2160
2163
|
// Get token mints X and Y
|
|
2161
|
-
const tokenXMint = this.ix.keys[
|
|
2162
|
-
const tokenYMint = this.ix.keys[
|
|
2164
|
+
const tokenXMint = this.ix.keys[7].pubkey;
|
|
2165
|
+
const tokenYMint = this.ix.keys[8].pubkey;
|
|
2163
2166
|
const tokenXMintInfo = AccountCache_1.AccountCache.get(tokenXMint);
|
|
2164
2167
|
const tokenYMintInfo = AccountCache_1.AccountCache.get(tokenYMint);
|
|
2165
2168
|
if (!(!!tokenXMintInfo && !!tokenYMintInfo)) {
|
|
@@ -2171,21 +2174,21 @@ class MeteoraDlmmClaimFee2Automation extends HawksightMeteoraAutomationCpi {
|
|
|
2171
2174
|
// Adjust by token type
|
|
2172
2175
|
const pdaTokenType = (_a = this.opt) === null || _a === void 0 ? void 0 : _a.pdaTokenType;
|
|
2173
2176
|
if (pdaTokenType === types_1.TokenType.LTA) {
|
|
2174
|
-
this.ix.keys[5].pubkey = util.generateLimitToken(this.userPda,
|
|
2175
|
-
this.ix.keys[6].pubkey = util.generateLimitToken(this.userPda,
|
|
2177
|
+
this.ix.keys[5].pubkey = util.generateLimitToken(this.userPda, tokenXMint);
|
|
2178
|
+
this.ix.keys[6].pubkey = util.generateLimitToken(this.userPda, tokenYMint);
|
|
2176
2179
|
}
|
|
2177
2180
|
else if (pdaTokenType === types_1.TokenType.STA) {
|
|
2178
|
-
this.ix.keys[5].pubkey = util.generateUserPdaStorageAccount(this.userPda,
|
|
2179
|
-
this.ix.keys[6].pubkey = util.generateUserPdaStorageAccount(this.userPda,
|
|
2181
|
+
this.ix.keys[5].pubkey = util.generateUserPdaStorageAccount(this.userPda, tokenXMint);
|
|
2182
|
+
this.ix.keys[6].pubkey = util.generateUserPdaStorageAccount(this.userPda, tokenYMint);
|
|
2180
2183
|
}
|
|
2181
2184
|
else {
|
|
2182
|
-
this.ix.keys[5].pubkey = util.generateAta(this.userPda,
|
|
2183
|
-
this.ix.keys[6].pubkey = util.generateAta(this.userPda,
|
|
2185
|
+
this.ix.keys[5].pubkey = util.generateAta(this.userPda, tokenXMint, tokenXMintInfo.info.owner);
|
|
2186
|
+
this.ix.keys[6].pubkey = util.generateAta(this.userPda, tokenYMint, tokenYMintInfo.info.owner);
|
|
2184
2187
|
}
|
|
2185
2188
|
// Generate IX via extension contract
|
|
2186
2189
|
// @ts-ignore
|
|
2187
2190
|
const claimFeeIx = yield anchor_1.Anchor.instance().iyfExtension.methods
|
|
2188
|
-
.meteoraDlmmClaimFee2Automation()
|
|
2191
|
+
.meteoraDlmmClaimFee2Automation(minBinId, maxBinId, remainingAccountsInfo)
|
|
2189
2192
|
.accounts({
|
|
2190
2193
|
userPda,
|
|
2191
2194
|
authority,
|