@scallop-io/sui-scallop-sdk 0.46.34 → 0.46.35

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scallop-io/sui-scallop-sdk",
3
- "version": "0.46.34",
3
+ "version": "0.46.35",
4
4
  "description": "Typescript sdk for interacting with Scallop contract on SUI",
5
5
  "keywords": [
6
6
  "sui",
@@ -109,18 +109,18 @@ const generateReferralQuickMethod: GenerateReferralQuickMethod = ({
109
109
  const rewardCoin = txBlock.claimReferralRevenue(veScaKey, coinName);
110
110
  objToTransfer.push(rewardCoin);
111
111
  } else {
112
- // get the matching user coin if exists
113
- const coins = await builder.suiKit.suiInteractor.selectCoins(
114
- sender,
115
- Infinity,
116
- builder.utils.parseCoinType(coinName)
117
- );
118
-
119
112
  const rewardCoin = txBlock.claimReferralRevenue(veScaKey, coinName);
120
- if (coins.length > 0) {
113
+ try {
114
+ // get the matching user coin if exists
115
+ const coins = await builder.suiKit.suiInteractor.selectCoins(
116
+ sender,
117
+ Infinity,
118
+ builder.utils.parseCoinType(coinName)
119
+ );
121
120
  txBlock.mergeCoins(rewardCoin, coins);
121
+ } finally {
122
+ objToTransfer.push(rewardCoin);
122
123
  }
123
- objToTransfer.push(rewardCoin);
124
124
  }
125
125
  }
126
126
  if (objToTransfer.length > 0) {