@huma-finance/widgets 0.0.48-beta.291 → 0.0.48-v2.290

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