@hawksightco/hawk-sdk 1.3.114 → 1.3.116
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 +16 -13
- package/package.json +1 -1
package/dist/src/hsToMeteora.js
CHANGED
|
@@ -1953,8 +1953,8 @@ class ClaimRewardAutomation extends HawksightMeteoraAutomationCpi {
|
|
|
1953
1953
|
* Adjusts transaction keys to facilitate the claiming of rewards.
|
|
1954
1954
|
*/
|
|
1955
1955
|
replace() {
|
|
1956
|
-
this._ix.keys[4].pubkey = this.userPda;
|
|
1957
|
-
this._ix.keys[4].isSigner = false;
|
|
1956
|
+
// this._ix.keys[4].pubkey = this.userPda;
|
|
1957
|
+
// this._ix.keys[4].isSigner = false;
|
|
1958
1958
|
}
|
|
1959
1959
|
/**
|
|
1960
1960
|
* Replaces Meteora CPI with Hawksight CPI that calls the target Meteora CPI.
|
|
@@ -1971,7 +1971,8 @@ class ClaimRewardAutomation extends HawksightMeteoraAutomationCpi {
|
|
|
1971
1971
|
const iyfProgram = addresses_1.IYF_MAIN;
|
|
1972
1972
|
const hawksightAuthority = addresses_1.HS_AUTHORITY;
|
|
1973
1973
|
// Generate owner fee ATA
|
|
1974
|
-
const rewardMint = this.ix.keys[
|
|
1974
|
+
const rewardMint = this.ix.keys[4].pubkey;
|
|
1975
|
+
console.log(`ClaimRewardAutomation rewardMint:`, rewardMint.toString());
|
|
1975
1976
|
const mintInfo = AccountCache_1.AccountCache.get(rewardMint);
|
|
1976
1977
|
if (!mintInfo) {
|
|
1977
1978
|
throw new Error("Unexpected error: Reward mint not found in cache.");
|
|
@@ -1980,14 +1981,16 @@ class ClaimRewardAutomation extends HawksightMeteoraAutomationCpi {
|
|
|
1980
1981
|
// Adjust by token type
|
|
1981
1982
|
const pdaTokenType = (_a = this.opt) === null || _a === void 0 ? void 0 : _a.pdaTokenType;
|
|
1982
1983
|
if (pdaTokenType === types_1.TokenType.LTA) {
|
|
1983
|
-
this.ix.keys[
|
|
1984
|
+
this.ix.keys[5].pubkey = util.generateLimitToken(this.userPda, this.ix.keys[6].pubkey);
|
|
1984
1985
|
}
|
|
1985
1986
|
else if (pdaTokenType === types_1.TokenType.STA) {
|
|
1986
|
-
this.ix.keys[
|
|
1987
|
+
this.ix.keys[5].pubkey = util.generateUserPdaStorageAccount(this.userPda, this.ix.keys[6].pubkey);
|
|
1987
1988
|
}
|
|
1988
1989
|
else {
|
|
1989
|
-
this.ix.keys[
|
|
1990
|
+
this.ix.keys[5].pubkey = util.generateAta(this.userPda, this.ix.keys[6].pubkey, mintInfo.info.owner);
|
|
1990
1991
|
}
|
|
1992
|
+
let binArrayLower = this.ix.keys[10].pubkey;
|
|
1993
|
+
let binArrayUpper = this.ix.keys.length > 11 ? this.ix.keys[11].pubkey : this.ix.keys[10].pubkey;
|
|
1991
1994
|
// Generate IX via extension contract
|
|
1992
1995
|
// @ts-ignore
|
|
1993
1996
|
const claimRewardIx = yield anchor_1.Anchor.instance().iyfExtension.methods
|
|
@@ -2000,14 +2003,14 @@ class ClaimRewardAutomation extends HawksightMeteoraAutomationCpi {
|
|
|
2000
2003
|
hawksightAuthority,
|
|
2001
2004
|
lbPair: this.ix.keys[0].pubkey,
|
|
2002
2005
|
position: this.ix.keys[1].pubkey,
|
|
2003
|
-
binArrayLower:
|
|
2004
|
-
binArrayUpper:
|
|
2005
|
-
rewardVault: this.ix.keys[
|
|
2006
|
+
binArrayLower: binArrayLower,
|
|
2007
|
+
binArrayUpper: binArrayUpper,
|
|
2008
|
+
rewardVault: this.ix.keys[3].pubkey,
|
|
2006
2009
|
rewardMint,
|
|
2007
|
-
userTokenAccount: this.ix.keys[
|
|
2008
|
-
tokenProgram: this.ix.keys[
|
|
2009
|
-
eventAuthority: this.ix.keys[
|
|
2010
|
-
meteoraDlmmProgram: this.ix.keys[
|
|
2010
|
+
userTokenAccount: this.ix.keys[5].pubkey,
|
|
2011
|
+
tokenProgram: this.ix.keys[6].pubkey,
|
|
2012
|
+
eventAuthority: this.ix.keys[8].pubkey,
|
|
2013
|
+
meteoraDlmmProgram: this.ix.keys[9].pubkey,
|
|
2011
2014
|
ownerFee,
|
|
2012
2015
|
}).instruction();
|
|
2013
2016
|
// Instruction via main hawksight contract
|