@huma-finance/widgets 0.0.12 → 0.0.13
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/API.md +6 -5
- package/dist/cjs/index.cjs +5058 -5968
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/index.d.ts +9 -6
- package/dist/index.js +5059 -5969
- package/dist/index.js.map +1 -1
- package/package.json +16 -16
- package/src/components/ApproveAllowanceModal.tsx +5 -2
- package/src/components/ChainNotSupportedModal.tsx +31 -0
- package/src/components/ChooseAmountModal.tsx +322 -322
- package/src/components/ConfirmTransferModal.tsx +153 -0
- package/src/components/CreditLine/borrow/1-Evaluation.tsx +1 -2
- package/src/components/CreditLine/borrow/index.tsx +4 -6
- package/src/components/Factoring/FactoredList.tsx +1 -1
- package/src/components/InvoiceFactoring/borrow/1-Evaluation.tsx +1 -4
- package/src/components/InvoiceFactoring/borrow/{3-ChooseAmount.tsx → 2-ChooseAmount.tsx} +5 -3
- package/src/components/InvoiceFactoring/borrow/3-ConfirmTransfer.tsx +37 -0
- package/src/components/InvoiceFactoring/borrow/index.tsx +5 -7
- package/src/components/StreamFactoring/borrow/1-Evaluation.tsx +11 -3
- package/src/components/StreamFactoring/borrow/2-ChooseAmount.tsx +4 -1
- package/src/components/StreamFactoring/borrow/3-ConfirmTransfer.tsx +18 -80
- package/src/components/StreamFactoring/borrow/4-ApproveAllowance.tsx +4 -36
- package/src/components/StreamFactoring/borrow/5-Permit.tsx +14 -14
- package/src/components/SuperfluidFactoring/SuperfluidUpcomingList.tsx +1 -1
- package/src/cosmos/CreditLineBorrow.fixture.tsx +1 -0
- package/src/cosmos/CreditLinePayment.fixture.tsx +1 -0
- package/src/cosmos/SDKTesting.fixture.tsx +615 -615
- package/src/cosmos/SuperfluidFactoringBorrow.fixture.tsx +3 -0
- package/src/cosmos/utils/env.ts +6 -0
- package/src/hooks/useEA.ts +10 -29
- package/src/index.tsx +75 -7
- package/src/reportWebVitals.ts +9 -9
- package/src/store/widgets.store.ts +0 -1
- package/src/utilTypes.d.ts +2 -0
- package/webpack.cosmos.js +9 -9
- package/src/components/AllowListModal.tsx +0 -113
- package/src/components/CreditLine/borrow/2-AllowList.tsx +0 -34
- package/src/components/InvoiceFactoring/borrow/2-AllowList.tsx +0 -34
- package/src/components/InvoiceFactoring/borrow/4-ConfirmTransfer.tsx +0 -104
- /package/src/components/CreditLine/borrow/{3-ChooseAmount.tsx → 2-ChooseAmount.tsx} +0 -0
- /package/src/components/CreditLine/borrow/{4-Transfer.tsx → 3-Transfer.tsx} +0 -0
- /package/src/components/CreditLine/borrow/{5-ApproveAllowance.tsx → 4-ApproveAllowance.tsx} +0 -0
- /package/src/components/CreditLine/borrow/{6-Success.tsx → 5-Success.tsx} +0 -0
- /package/src/components/InvoiceFactoring/borrow/{5-ApproveNFT.tsx → 4-ApproveNFT.tsx} +0 -0
- /package/src/components/InvoiceFactoring/borrow/{6-Transfer.tsx → 5-Transfer.tsx} +0 -0
- /package/src/components/InvoiceFactoring/borrow/{7-Success.tsx → 6-Success.tsx} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@huma-finance/widgets",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.13",
|
|
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.
|
|
34
|
-
"@huma-finance/shared": "^0.0.
|
|
33
|
+
"@huma-finance/sdk": "^0.0.13",
|
|
34
|
+
"@huma-finance/shared": "^0.0.13",
|
|
35
35
|
"@mui/icons-material": "^5.3.0",
|
|
36
36
|
"@mui/material": "^5.0.6",
|
|
37
37
|
"@mui/styles": "^5.0.2",
|
|
@@ -42,16 +42,16 @@
|
|
|
42
42
|
"@walletconnect/ethereum-provider": "1.8.0",
|
|
43
43
|
"@walletconnect/jsonrpc-http-connection": "^1.0.3",
|
|
44
44
|
"@walletconnect/jsonrpc-provider": "^1.0.5",
|
|
45
|
-
"@web3-react/coinbase-wallet": "8.
|
|
46
|
-
"@web3-react/core": "8.
|
|
47
|
-
"@web3-react/eip1193": "8.
|
|
48
|
-
"@web3-react/empty": "8.
|
|
49
|
-
"@web3-react/gnosis-safe": "8.
|
|
50
|
-
"@web3-react/metamask": "8.
|
|
51
|
-
"@web3-react/network": "8.
|
|
52
|
-
"@web3-react/types": "8.
|
|
53
|
-
"@web3-react/url": "8.
|
|
54
|
-
"@web3-react/walletconnect": "8.
|
|
45
|
+
"@web3-react/coinbase-wallet": "^8.2.0",
|
|
46
|
+
"@web3-react/core": "^8.2.0",
|
|
47
|
+
"@web3-react/eip1193": "^8.2.0",
|
|
48
|
+
"@web3-react/empty": "^8.2.0",
|
|
49
|
+
"@web3-react/gnosis-safe": "^8.2.0",
|
|
50
|
+
"@web3-react/metamask": "^8.2.0",
|
|
51
|
+
"@web3-react/network": "^8.2.0",
|
|
52
|
+
"@web3-react/types": "^8.2.0",
|
|
53
|
+
"@web3-react/url": "^8.2.0",
|
|
54
|
+
"@web3-react/walletconnect": "^8.2.0",
|
|
55
55
|
"buffer": "^6.0.3",
|
|
56
56
|
"customize-cra": "^1.0.0",
|
|
57
57
|
"dayjs": "^1.11.6",
|
|
@@ -85,7 +85,8 @@
|
|
|
85
85
|
"lint-staged": "lint-staged",
|
|
86
86
|
"e2e": "cypress run --config baseUrl=http://localhost:8000 --headed --browser chrome --e2e",
|
|
87
87
|
"generateDocs": "jsdoc2md --files 'src/**/*.tsx' --configure ./jsdoc2md.json > API.md",
|
|
88
|
-
"contracts:compile:abi": "typechain --target ethers-v5 --out-dir src/abis/types \"./src/abis/**/*.json\""
|
|
88
|
+
"contracts:compile:abi": "typechain --target ethers-v5 --out-dir src/abis/types \"./src/abis/**/*.json\"",
|
|
89
|
+
"prettier": "prettier --write \"src/**/*.{js,ts,tsx,graphql}\""
|
|
89
90
|
},
|
|
90
91
|
"husky": {
|
|
91
92
|
"hooks": {
|
|
@@ -125,7 +126,6 @@
|
|
|
125
126
|
"@rollup/plugin-node-resolve": "^15.0.1",
|
|
126
127
|
"@rollup/plugin-typescript": "^11.0.0",
|
|
127
128
|
"@rollup/plugin-url": "^8.0.1",
|
|
128
|
-
"@sentry/webpack-plugin": "^1.20.0",
|
|
129
129
|
"@svgr/rollup": "^6.5.1",
|
|
130
130
|
"@svgr/webpack": "^6.5.1",
|
|
131
131
|
"@testing-library/cypress": "^9.0.0",
|
|
@@ -191,5 +191,5 @@
|
|
|
191
191
|
"optionalDependencies": {
|
|
192
192
|
"encoding": "^0.1.13"
|
|
193
193
|
},
|
|
194
|
-
"gitHead": "
|
|
194
|
+
"gitHead": "d4c4b86cde3f84209204f8f926de995bb07a1bd2"
|
|
195
195
|
}
|
|
@@ -23,7 +23,8 @@ import { WrapperModal } from './WrapperModal'
|
|
|
23
23
|
type Props = {
|
|
24
24
|
poolInfo: PoolInfoType
|
|
25
25
|
showAutoPayback?: boolean
|
|
26
|
-
allowanceAmount?: BigNumber
|
|
26
|
+
allowanceAmount?: BigNumber | string
|
|
27
|
+
spender?: string
|
|
27
28
|
handleSuccess: () => void
|
|
28
29
|
}
|
|
29
30
|
|
|
@@ -31,6 +32,7 @@ export function ApproveAllowanceModal({
|
|
|
31
32
|
poolInfo,
|
|
32
33
|
showAutoPayback = false,
|
|
33
34
|
allowanceAmount,
|
|
35
|
+
spender,
|
|
34
36
|
handleSuccess,
|
|
35
37
|
}: Props): React.ReactElement | null {
|
|
36
38
|
const theme = useTheme()
|
|
@@ -70,7 +72,7 @@ export function ApproveAllowanceModal({
|
|
|
70
72
|
send({
|
|
71
73
|
contract: poolUnderlyingTokenContract!,
|
|
72
74
|
method: 'approve',
|
|
73
|
-
params: [poolInfo.pool, allowanceAmount ?? MaxUint256],
|
|
75
|
+
params: [spender ?? poolInfo.pool, allowanceAmount ?? MaxUint256],
|
|
74
76
|
provider,
|
|
75
77
|
})
|
|
76
78
|
}, [
|
|
@@ -79,6 +81,7 @@ export function ApproveAllowanceModal({
|
|
|
79
81
|
poolUnderlyingTokenContract,
|
|
80
82
|
provider,
|
|
81
83
|
send,
|
|
84
|
+
spender,
|
|
82
85
|
])
|
|
83
86
|
|
|
84
87
|
useMount(() => {
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
|
|
3
|
+
import { ErrorModal } from './ErrorModal'
|
|
4
|
+
import { HumaModal, HumaModalHeader } from './humaModal'
|
|
5
|
+
|
|
6
|
+
type Props = {
|
|
7
|
+
handleClose: () => void
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function ChainNotSupportedModal({
|
|
11
|
+
handleClose,
|
|
12
|
+
}: Props): React.ReactElement | null {
|
|
13
|
+
return (
|
|
14
|
+
<HumaModal
|
|
15
|
+
isOpen
|
|
16
|
+
overflowY='auto'
|
|
17
|
+
onClose={handleClose}
|
|
18
|
+
width='480px'
|
|
19
|
+
padding='30px 40px'
|
|
20
|
+
disableBackdropClick
|
|
21
|
+
>
|
|
22
|
+
<HumaModalHeader onClose={handleClose} height={0} />
|
|
23
|
+
<ErrorModal
|
|
24
|
+
title='Network Not Supported'
|
|
25
|
+
errorReason='Please switch to a supported network.'
|
|
26
|
+
handleOk={handleClose}
|
|
27
|
+
okText='Close'
|
|
28
|
+
/>
|
|
29
|
+
</HumaModal>
|
|
30
|
+
)
|
|
31
|
+
}
|