@hawksightco/hawk-sdk 1.3.113 → 1.3.115
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 +14 -12
- package/package.json +1 -1
package/dist/src/hsToMeteora.js
CHANGED
|
@@ -1947,7 +1947,7 @@ class ClaimRewardAutomation extends HawksightMeteoraAutomationCpi {
|
|
|
1947
1947
|
* @param authority The authority public key that has signing capabilities over the transaction.
|
|
1948
1948
|
*/
|
|
1949
1949
|
constructor(ix, userPda, authority, opt) {
|
|
1950
|
-
super(ix, userPda, authority, util.sighash("
|
|
1950
|
+
super(ix, userPda, authority, util.sighash("claim_reward2", undefined, true), opt);
|
|
1951
1951
|
}
|
|
1952
1952
|
/**
|
|
1953
1953
|
* Adjusts transaction keys to facilitate the claiming of rewards.
|
|
@@ -1971,7 +1971,7 @@ 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
1975
|
const mintInfo = AccountCache_1.AccountCache.get(rewardMint);
|
|
1976
1976
|
if (!mintInfo) {
|
|
1977
1977
|
throw new Error("Unexpected error: Reward mint not found in cache.");
|
|
@@ -1980,14 +1980,16 @@ class ClaimRewardAutomation extends HawksightMeteoraAutomationCpi {
|
|
|
1980
1980
|
// Adjust by token type
|
|
1981
1981
|
const pdaTokenType = (_a = this.opt) === null || _a === void 0 ? void 0 : _a.pdaTokenType;
|
|
1982
1982
|
if (pdaTokenType === types_1.TokenType.LTA) {
|
|
1983
|
-
this.ix.keys[
|
|
1983
|
+
this.ix.keys[5].pubkey = util.generateLimitToken(this.userPda, this.ix.keys[6].pubkey);
|
|
1984
1984
|
}
|
|
1985
1985
|
else if (pdaTokenType === types_1.TokenType.STA) {
|
|
1986
|
-
this.ix.keys[
|
|
1986
|
+
this.ix.keys[5].pubkey = util.generateUserPdaStorageAccount(this.userPda, this.ix.keys[6].pubkey);
|
|
1987
1987
|
}
|
|
1988
1988
|
else {
|
|
1989
|
-
this.ix.keys[
|
|
1989
|
+
this.ix.keys[5].pubkey = util.generateAta(this.userPda, this.ix.keys[6].pubkey, mintInfo.info.owner);
|
|
1990
1990
|
}
|
|
1991
|
+
let binArrayLower = this.ix.keys[10].pubkey;
|
|
1992
|
+
let binArrayUpper = this.ix.keys.length > 11 ? this.ix.keys[11].pubkey : this.ix.keys[10].pubkey;
|
|
1991
1993
|
// Generate IX via extension contract
|
|
1992
1994
|
// @ts-ignore
|
|
1993
1995
|
const claimRewardIx = yield anchor_1.Anchor.instance().iyfExtension.methods
|
|
@@ -2000,14 +2002,14 @@ class ClaimRewardAutomation extends HawksightMeteoraAutomationCpi {
|
|
|
2000
2002
|
hawksightAuthority,
|
|
2001
2003
|
lbPair: this.ix.keys[0].pubkey,
|
|
2002
2004
|
position: this.ix.keys[1].pubkey,
|
|
2003
|
-
binArrayLower:
|
|
2004
|
-
binArrayUpper:
|
|
2005
|
-
rewardVault: this.ix.keys[
|
|
2005
|
+
binArrayLower: binArrayLower,
|
|
2006
|
+
binArrayUpper: binArrayUpper,
|
|
2007
|
+
rewardVault: this.ix.keys[3].pubkey,
|
|
2006
2008
|
rewardMint,
|
|
2007
|
-
userTokenAccount: this.ix.keys[
|
|
2008
|
-
tokenProgram: this.ix.keys[
|
|
2009
|
-
eventAuthority: this.ix.keys[
|
|
2010
|
-
meteoraDlmmProgram: this.ix.keys[
|
|
2009
|
+
userTokenAccount: this.ix.keys[5].pubkey,
|
|
2010
|
+
tokenProgram: this.ix.keys[6].pubkey,
|
|
2011
|
+
eventAuthority: this.ix.keys[8].pubkey,
|
|
2012
|
+
meteoraDlmmProgram: this.ix.keys[9].pubkey,
|
|
2011
2013
|
ownerFee,
|
|
2012
2014
|
}).instruction();
|
|
2013
2015
|
// Instruction via main hawksight contract
|