@huma-finance/widgets 0.0.48-beta.290 → 0.0.48-beta.292

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": "@huma-finance/widgets",
3
- "version": "0.0.48-beta.290+0abd34a",
3
+ "version": "0.0.48-beta.292+58f0c2d",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -30,8 +30,8 @@
30
30
  "@ethersproject/experimental": "^5.7.0",
31
31
  "@ethersproject/providers": "^5.6.0",
32
32
  "@ethersproject/units": "^5.6.0",
33
- "@huma-finance/sdk": "^0.0.48-beta.290+0abd34a",
34
- "@huma-finance/shared": "^0.0.47",
33
+ "@huma-finance/sdk": "^0.0.48-beta.292+58f0c2d",
34
+ "@huma-finance/shared": "^0.0.48-beta.292+58f0c2d",
35
35
  "@mui/icons-material": "^5.3.0",
36
36
  "@mui/material": "^5.0.6",
37
37
  "@mui/styles": "^5.0.2",
@@ -193,5 +193,5 @@
193
193
  "optionalDependencies": {
194
194
  "encoding": "^0.1.13"
195
195
  },
196
- "gitHead": "0abd34a20115a2cab43ccb19b9d6f8eec79ebdf7"
196
+ "gitHead": "58f0c2dcd85a95f99b4c29639b67db30a80bc046"
197
197
  }
@@ -1,4 +1,9 @@
1
- import { CreditRecordType, PoolInfoType, timeUtil } from '@huma-finance/shared'
1
+ import {
2
+ CreditRecordType,
3
+ PoolInfoType,
4
+ formatNumber,
5
+ timeUtil,
6
+ } from '@huma-finance/shared'
2
7
  import React from 'react'
3
8
 
4
9
  import { useAppSelector } from '../../../hooks/useRedux'
@@ -24,7 +29,7 @@ export function Success({
24
29
  const dueDate = timeUtil.timestampToLL(creditRecord?.dueDate.toNumber())
25
30
 
26
31
  const content = [
27
- `${borrowAmountNet} ${symbol} is now in your wallet.`,
32
+ `${formatNumber(borrowAmountNet)} ${symbol} is now in your wallet.`,
28
33
  `Note: your payment will be automatically deducted on ${dueDate}.`,
29
34
  ]
30
35
 
@@ -1,5 +1,6 @@
1
1
  import {
2
2
  CreditStatsV2,
3
+ formatNumber,
3
4
  timeUtil,
4
5
  UnderlyingTokenInfo,
5
6
  } from '@huma-finance/shared'
@@ -27,7 +28,7 @@ export function Success({
27
28
  const dueDate = timeUtil.timestampToLL(creditRecord?.nextDueDate.toNumber())
28
29
 
29
30
  const content = [
30
- `${borrowAmountNet} ${symbol} is now in your wallet.`,
31
+ `${formatNumber(borrowAmountNet)} ${symbol} is now in your wallet.`,
31
32
  `Note: your payment will be automatically deducted on ${dueDate}.`,
32
33
  ]
33
34
 
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  decodeLogs,
3
3
  downScale,
4
- formatMoney,
4
+ formatNumber,
5
5
  PoolInfoType,
6
6
  sendTxAtom,
7
7
  TRANSFER_ABI,
@@ -32,7 +32,7 @@ export function Success({ poolInfo, handleAction }: Props): React.ReactElement {
32
32
  }, [decimals, txReceipt])
33
33
 
34
34
  const content = [
35
- `You successfully paid ${formatMoney(payedAmount)} ${symbol}.`,
35
+ `You successfully paid ${formatNumber(payedAmount)} ${symbol}.`,
36
36
  ]
37
37
 
38
38
  return <TxDoneModal handleAction={handleAction} content={content} />
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  decodeLogs,
3
3
  downScale,
4
- formatMoney,
4
+ formatNumber,
5
5
  sendTxAtom,
6
6
  TRANSFER_ABI,
7
7
  UnderlyingTokenInfo,
@@ -35,7 +35,7 @@ export function Success({
35
35
  }, [decimals, txReceipt])
36
36
 
37
37
  const content = [
38
- `You successfully paid ${formatMoney(paidAmount)} ${symbol}.`,
38
+ `You successfully paid ${formatNumber(paidAmount)} ${symbol}.`,
39
39
  ]
40
40
 
41
41
  return <TxDoneModal handleAction={handleAction} content={content} />
@@ -1,4 +1,6 @@
1
+ import { formatNumber } from '@huma-finance/shared'
1
2
  import React from 'react'
3
+
2
4
  import { useAppSelector } from '../../../hooks/useRedux'
3
5
  import { selectWidgetState } from '../../../store/widgets.selectors'
4
6
  import { TxDoneModal } from '../../TxDoneModal'
@@ -12,7 +14,9 @@ export function Success({ handleAction }: Props): React.ReactElement {
12
14
  useAppSelector(selectWidgetState)
13
15
 
14
16
  const content = [
15
- `${borrowAmountNet} ${approval?.token.symbol} is now in your wallet.`,
17
+ `${formatNumber(borrowAmountNet)} ${
18
+ approval?.token.symbol
19
+ } is now in your wallet.`,
16
20
  `The remaining ${remainder} ${approval?.token.symbol} will be sent to your wallet when the invoice is paid.`,
17
21
  ]
18
22
 
@@ -1,5 +1,6 @@
1
1
  import {
2
2
  CreditStatsV2,
3
+ formatNumber,
3
4
  timeUtil,
4
5
  UnderlyingTokenInfo,
5
6
  } from '@huma-finance/shared'
@@ -27,7 +28,7 @@ export function Success({
27
28
  const dueDate = timeUtil.timestampToLL(creditRecord?.nextDueDate.toNumber())
28
29
 
29
30
  const content = [
30
- `${borrowAmountNet} ${symbol} is now in your wallet.`,
31
+ `${formatNumber(borrowAmountNet)} ${symbol} is now in your wallet.`,
31
32
  `Note: your payment will be automatically deducted on ${dueDate}.`,
32
33
  ]
33
34
 
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  decodeLogs,
3
3
  downScale,
4
- formatMoney,
4
+ formatNumber,
5
5
  TRANSFER_ABI,
6
6
  UnderlyingTokenInfo,
7
7
  } from '@huma-finance/shared'
@@ -37,12 +37,12 @@ export function Success({
37
37
  }
38
38
  }, [decimals, successTxReceipt])
39
39
 
40
- const amoutFormatted = formatMoney(paidAmount)
40
+ const amountFormatted = formatNumber(paidAmount)
41
41
  const content =
42
42
  paymentType === PaymentType.PaymentWithReceivable
43
- ? [`You successfully paid ${amoutFormatted} ${symbol}.`]
43
+ ? [`You successfully paid ${amountFormatted} ${symbol}.`]
44
44
  : [
45
- `You successfully paid ${amoutFormatted} ${symbol} and borrowed ${amoutFormatted} ${symbol}.`,
45
+ `You successfully paid ${amountFormatted} ${symbol} and borrowed ${amountFormatted} ${symbol}.`,
46
46
  ]
47
47
 
48
48
  return <TxDoneModal handleAction={handleAction} content={content} />
@@ -1,4 +1,6 @@
1
+ import { formatNumber } from '@huma-finance/shared'
1
2
  import React from 'react'
3
+
2
4
  import { useAppSelector } from '../../../hooks/useRedux'
3
5
  import { selectWidgetState } from '../../../store/widgets.selectors'
4
6
  import { TxDoneModal } from '../../TxDoneModal'
@@ -11,7 +13,7 @@ export function Success({ handleAction }: Props): React.ReactElement {
11
13
  const { borrowAmount, approval } = useAppSelector(selectWidgetState)
12
14
 
13
15
  const content = [
14
- `${borrowAmount?.toFixed(2)} ${
16
+ `${formatNumber(borrowAmount)} ${
15
17
  approval?.token.symbol
16
18
  } is now in your wallet.`,
17
19
  ]