@huma-finance/widgets 0.0.63-beta.749 → 0.0.63-beta.754
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/cjs/index.cjs +6 -3
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
- package/src/components/Lend/solanaSupply/4-ChooseAmount.tsx +4 -1
- package/src/components/Lend/stellarSupply/3-ChooseAmount.tsx +3 -1
- package/src/components/Lend/supplyV2/4-ChooseAmount.tsx +4 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@huma-finance/widgets",
|
|
3
|
-
"version": "0.0.63-beta.
|
|
3
|
+
"version": "0.0.63-beta.754+eb29b8b",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"@ethersproject/experimental": "^5.7.0",
|
|
30
30
|
"@ethersproject/providers": "^5.6.0",
|
|
31
31
|
"@ethersproject/units": "^5.6.0",
|
|
32
|
-
"@huma-finance/sdk": "^0.0.63-beta.
|
|
33
|
-
"@huma-finance/shared": "^0.0.63-beta.
|
|
34
|
-
"@huma-finance/web-shared": "^0.0.63-beta.
|
|
32
|
+
"@huma-finance/sdk": "^0.0.63-beta.754+eb29b8b",
|
|
33
|
+
"@huma-finance/shared": "^0.0.63-beta.754+eb29b8b",
|
|
34
|
+
"@huma-finance/web-shared": "^0.0.63-beta.754+eb29b8b",
|
|
35
35
|
"@mui/x-date-pickers": "^5.0.7",
|
|
36
36
|
"@notifi-network/notifi-frontend-client": "^1.1.2",
|
|
37
37
|
"@notifi-network/notifi-react": "^1.1.2",
|
|
@@ -201,5 +201,5 @@
|
|
|
201
201
|
"optionalDependencies": {
|
|
202
202
|
"encoding": "^0.1.13"
|
|
203
203
|
},
|
|
204
|
-
"gitHead": "
|
|
204
|
+
"gitHead": "eb29b8b51a9997ab86b49807428cabd455ff66a3"
|
|
205
205
|
}
|
|
@@ -45,7 +45,10 @@ export function ChooseAmount({
|
|
|
45
45
|
const juniorTrancheAssetsBN = new BN(juniorTrancheAssets ?? 0)
|
|
46
46
|
const seniorTrancheAssetsBN = new BN(seniorTrancheAssets ?? 0)
|
|
47
47
|
const totalDeployedBN = seniorTrancheAssetsBN.add(juniorTrancheAssetsBN)
|
|
48
|
-
|
|
48
|
+
let totalAvailableCapBN = new BN(liquidityCap ?? 0).sub(totalDeployedBN)
|
|
49
|
+
totalAvailableCapBN = totalAvailableCapBN.ltn(0)
|
|
50
|
+
? new BN(0)
|
|
51
|
+
: totalAvailableCapBN
|
|
49
52
|
const maxSeniorAssetsBN = juniorTrancheAssetsBN.muln(
|
|
50
53
|
maxSeniorJuniorRatio ?? 0,
|
|
51
54
|
)
|
|
@@ -41,7 +41,9 @@ export function ChooseAmount({
|
|
|
41
41
|
const juniorTrancheAssetsBN = BigInt(juniorTrancheAssets ?? 0)
|
|
42
42
|
const seniorTrancheAssetsBN = BigInt(seniorTrancheAssets ?? 0)
|
|
43
43
|
const totalDeployedBN = seniorTrancheAssetsBN + juniorTrancheAssetsBN
|
|
44
|
-
|
|
44
|
+
let totalAvailableCapBN = BigInt(liquidityCap ?? 0) - totalDeployedBN
|
|
45
|
+
totalAvailableCapBN =
|
|
46
|
+
totalAvailableCapBN < 0 ? BigInt(0) : totalAvailableCapBN
|
|
45
47
|
const maxSeniorAssetsBN =
|
|
46
48
|
juniorTrancheAssetsBN * BigInt(maxSeniorJuniorRatio ?? 0)
|
|
47
49
|
let seniorAvailableCapBN = maxSeniorAssetsBN - seniorTrancheAssetsBN
|
|
@@ -48,7 +48,10 @@ export function ChooseAmount({
|
|
|
48
48
|
const { juniorAvailableCapBN, seniorAvailableCapBN } = useMemo(() => {
|
|
49
49
|
const { maxSeniorJuniorRatio, liquidityCap: liquidityCapBN } = lpConfig
|
|
50
50
|
const totalDeployedBN = seniorAssetsBN.add(juniorAssetsBN)
|
|
51
|
-
|
|
51
|
+
let totalAvailableCapBN = liquidityCapBN.sub(totalDeployedBN)
|
|
52
|
+
totalAvailableCapBN = totalAvailableCapBN.lt(0)
|
|
53
|
+
? BigNumber.from(0)
|
|
54
|
+
: totalAvailableCapBN
|
|
52
55
|
const maxSeniorAssetsBN = juniorAssetsBN.mul(maxSeniorJuniorRatio)
|
|
53
56
|
let seniorAvailableCapBN = maxSeniorAssetsBN.sub(seniorAssetsBN)
|
|
54
57
|
seniorAvailableCapBN = seniorAvailableCapBN.gt(totalAvailableCapBN)
|