@accessprotocol/js
Advanced tools
Comparing version 2.0.0-alpha.27 to 2.0.0-alpha.28
@@ -475,4 +475,4 @@ "use strict"; | ||
const rewardsDestination = (0, spl_token_1.getAssociatedTokenAddressSync)(centralState.tokenMint, user, true); | ||
const [royaltyAccount] = state_js_1.RoyaltyAccount.getKey(programId, user); | ||
const ownerRoyaltyAccount = yield state_js_1.RoyaltyAccount.retrieve(connection, user); | ||
const [royaltyAccountAddr] = state_js_1.RoyaltyAccount.getKey(programId, user); | ||
const ownerRoyaltyAccount = yield state_js_1.RoyaltyAccount.retrieve(connection, royaltyAccountAddr); | ||
const royaltyAta = ownerRoyaltyAccount ? ownerRoyaltyAccount.recipientAta : null; | ||
@@ -489,3 +489,3 @@ const claimIxs = userOwnerAccounts | ||
allowZeroRewards: Number(false), | ||
}).getInstruction(programId, stakeAccount.stakePool, account.pubkey, user, rewardsDestination, centralStateKey, centralState.tokenMint, spl_token_1.TOKEN_PROGRAM_ID, state_js_1.ACCESS_NFT_PROGRAM_SIGNER, royaltyAccount, royaltyAta); | ||
}).getInstruction(programId, stakeAccount.stakePool, account.pubkey, user, rewardsDestination, centralStateKey, centralState.tokenMint, spl_token_1.TOKEN_PROGRAM_ID, state_js_1.ACCESS_NFT_PROGRAM_SIGNER, royaltyAccountAddr, royaltyAta); | ||
// we don't require the owner to sign this transaction as users are claiming for themselves | ||
@@ -516,3 +516,3 @@ const claimIdx = claimIx.keys.findIndex(e => e.pubkey.equals(user)); | ||
if (bondV2Account.lastClaimedOffset < currentOffset) { | ||
return new raw_instructions_js_1.claimBondV2RewardsInstruction().getInstruction(programId, bondV2Account.pool, account.pubkey, bondV2Account.owner, rewardsDestination, centralStateKey, centralState.tokenMint, spl_token_1.TOKEN_PROGRAM_ID, state_js_1.ACCESS_NFT_PROGRAM_SIGNER, royaltyAccount, royaltyAta); | ||
return new raw_instructions_js_1.claimBondV2RewardsInstruction().getInstruction(programId, bondV2Account.pool, account.pubkey, bondV2Account.owner, rewardsDestination, centralStateKey, centralState.tokenMint, spl_token_1.TOKEN_PROGRAM_ID, state_js_1.ACCESS_NFT_PROGRAM_SIGNER, royaltyAccountAddr, royaltyAta); | ||
} | ||
@@ -519,0 +519,0 @@ return null; |
@@ -437,4 +437,4 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
const rewardsDestination = getAssociatedTokenAddressSync(centralState.tokenMint, user, true); | ||
const [royaltyAccount] = RoyaltyAccount.getKey(programId, user); | ||
const ownerRoyaltyAccount = yield RoyaltyAccount.retrieve(connection, user); | ||
const [royaltyAccountAddr] = RoyaltyAccount.getKey(programId, user); | ||
const ownerRoyaltyAccount = yield RoyaltyAccount.retrieve(connection, royaltyAccountAddr); | ||
const royaltyAta = ownerRoyaltyAccount ? ownerRoyaltyAccount.recipientAta : null; | ||
@@ -451,3 +451,3 @@ const claimIxs = userOwnerAccounts | ||
allowZeroRewards: Number(false), | ||
}).getInstruction(programId, stakeAccount.stakePool, account.pubkey, user, rewardsDestination, centralStateKey, centralState.tokenMint, TOKEN_PROGRAM_ID, ACCESS_NFT_PROGRAM_SIGNER, royaltyAccount, royaltyAta); | ||
}).getInstruction(programId, stakeAccount.stakePool, account.pubkey, user, rewardsDestination, centralStateKey, centralState.tokenMint, TOKEN_PROGRAM_ID, ACCESS_NFT_PROGRAM_SIGNER, royaltyAccountAddr, royaltyAta); | ||
// we don't require the owner to sign this transaction as users are claiming for themselves | ||
@@ -478,3 +478,3 @@ const claimIdx = claimIx.keys.findIndex(e => e.pubkey.equals(user)); | ||
if (bondV2Account.lastClaimedOffset < currentOffset) { | ||
return new claimBondV2RewardsInstruction().getInstruction(programId, bondV2Account.pool, account.pubkey, bondV2Account.owner, rewardsDestination, centralStateKey, centralState.tokenMint, TOKEN_PROGRAM_ID, ACCESS_NFT_PROGRAM_SIGNER, royaltyAccount, royaltyAta); | ||
return new claimBondV2RewardsInstruction().getInstruction(programId, bondV2Account.pool, account.pubkey, bondV2Account.owner, rewardsDestination, centralStateKey, centralState.tokenMint, TOKEN_PROGRAM_ID, ACCESS_NFT_PROGRAM_SIGNER, royaltyAccountAddr, royaltyAta); | ||
} | ||
@@ -481,0 +481,0 @@ return null; |
{ | ||
"name": "@accessprotocol/js", | ||
"version": "2.0.0-alpha.27", | ||
"version": "2.0.0-alpha.28", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "type": "module", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
447469