@dripfi/drip-sdk 1.2.17 → 1.2.19
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/DripSdk.js +7 -7
- package/package.json +1 -1
package/dist/DripSdk.js
CHANGED
@@ -139,7 +139,7 @@ class DripSdk {
|
|
139
139
|
throw Error('Error fetching address');
|
140
140
|
}
|
141
141
|
const depositBagStruct = {
|
142
|
-
smartVault: vaultAddress,
|
142
|
+
smartVault: vaultAddress.toLowerCase(),
|
143
143
|
assets: [amountToDeposit],
|
144
144
|
receiver: signerAddress,
|
145
145
|
referral: ethers_1.ethers.constants.AddressZero,
|
@@ -302,7 +302,7 @@ class DripSdk {
|
|
302
302
|
const swapDepositBagStruct = {
|
303
303
|
inTokens: [fromTokenAddress],
|
304
304
|
inAmounts: [fromToken],
|
305
|
-
smartVault: vaultAddress,
|
305
|
+
smartVault: vaultAddress.toLowerCase(),
|
306
306
|
swapInfo,
|
307
307
|
receiver: userAddress,
|
308
308
|
referral: ethers_1.ethers.constants.AddressZero,
|
@@ -349,7 +349,7 @@ class DripSdk {
|
|
349
349
|
const nftAmounts = wnfts
|
350
350
|
.filter((item) => !item.isBurned && ethers_1.BigNumber.from(item.shares).gt(ethers_1.BigNumber.from('0')) && item.isDHWFinished)
|
351
351
|
.map((item) => item.shares.toString());
|
352
|
-
const claimWithdrawTx = yield this.spoolSdk.claimWithdrawal(vaultAddress, nftIds, nftAmounts, userAddress);
|
352
|
+
const claimWithdrawTx = yield this.spoolSdk.claimWithdrawal(vaultAddress.toLowerCase(), nftIds, nftAmounts, userAddress);
|
353
353
|
const txReceipt = yield claimWithdrawTx.wait();
|
354
354
|
return txReceipt.transactionHash;
|
355
355
|
});
|
@@ -678,13 +678,13 @@ class DripSdk {
|
|
678
678
|
if (isFullWithdraw) {
|
679
679
|
return this.spoolSdk.views.userInfo.getMaxRedeemBag({
|
680
680
|
userAddress: signerAddress.toLowerCase(),
|
681
|
-
vaultAddress: vault.vaultAddress,
|
681
|
+
vaultAddress: vault.vaultAddress.toLowerCase(),
|
682
682
|
});
|
683
683
|
}
|
684
684
|
else {
|
685
685
|
return this.spoolSdk.views.userInfo.getMinimumBurnRedeemBag({
|
686
686
|
userAddress: signerAddress.toLowerCase(),
|
687
|
-
vaultAddress: vault.vaultAddress,
|
687
|
+
vaultAddress: vault.vaultAddress.toLowerCase(),
|
688
688
|
assetsToWithdraw: [Number(amountToWithdraw)]
|
689
689
|
});
|
690
690
|
}
|
@@ -749,8 +749,8 @@ class DripSdk {
|
|
749
749
|
continue;
|
750
750
|
}
|
751
751
|
const currentBlockNumber = wnft.blockNumber - 1;
|
752
|
-
const assetsPerSvtAtBlock = yield this.dripApi.fetchAssetPerSvtAtBlock(vaultAddress, currentBlockNumber, token);
|
753
|
-
const estimatedValueOfNFT = ethers_1.BigNumber.from(
|
752
|
+
const assetsPerSvtAtBlock = yield this.dripApi.fetchAssetPerSvtAtBlock(vaultAddress.toLowerCase(), currentBlockNumber, token);
|
753
|
+
const estimatedValueOfNFT = ethers_1.BigNumber.from(ethers_1.ethers.utils.formatUnits(ethers_1.BigNumber.from(wnft.svtWithdrawn).mul(assetsPerSvtAtBlock), 36).split('.')[0].toString());
|
754
754
|
if (wnft.isDHWFinished) {
|
755
755
|
// Processed and Withdrawable
|
756
756
|
estimatedWithdrawableBalance = estimatedWithdrawableBalance.add(estimatedValueOfNFT);
|