@huma-finance/widgets 0.0.36 → 0.0.37

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.
Files changed (178) hide show
  1. package/.env.example +2 -2
  2. package/.eslintignore +2 -2
  3. package/.eslintrc.js +64 -64
  4. package/.prettierignore +4 -4
  5. package/.prettierrc.js +16 -16
  6. package/API.md +332 -332
  7. package/LICENSE +660 -660
  8. package/README.md +48 -48
  9. package/babel.config.js +15 -15
  10. package/config-overrides.js +9 -9
  11. package/cosmos.config.json +7 -7
  12. package/cypress/e2e/01-invoice-factoring-borrow.test.ts +62 -62
  13. package/cypress/support/e2e.ts +76 -76
  14. package/cypress/support/ethereum.ts +142 -142
  15. package/cypress/tsconfig.json +9 -9
  16. package/cypress/utils/index.ts +54 -54
  17. package/cypress.config.ts +20 -20
  18. package/dist/cjs/index.cjs +134 -134
  19. package/dist/cjs/index.cjs.map +1 -1
  20. package/dist/index.d.ts +223 -223
  21. package/dist/index.js +134 -134
  22. package/dist/index.js.map +1 -1
  23. package/jsdoc2md.json +20 -20
  24. package/package.json +4 -4
  25. package/public/index.html +40 -40
  26. package/public/manifest.json +25 -25
  27. package/public/robots.txt +3 -3
  28. package/rollup.config.js +81 -81
  29. package/src/components/Activity.tsx +128 -128
  30. package/src/components/ApolloWrapper.tsx +15 -15
  31. package/src/components/ApproveAllowanceModal.tsx +138 -138
  32. package/src/components/BottomButton.tsx +33 -33
  33. package/src/components/ChainNotSupportedModal.tsx +33 -33
  34. package/src/components/ChooseAmountModal.tsx +322 -322
  35. package/src/components/ConfirmTransferModal.tsx +153 -153
  36. package/src/components/CreditLine/approve/1-ApproveAllowance.tsx +34 -34
  37. package/src/components/CreditLine/approve/2-Success.tsx +43 -43
  38. package/src/components/CreditLine/approve/index.tsx +85 -85
  39. package/src/components/CreditLine/borrow/1-Evaluation.tsx +157 -157
  40. package/src/components/CreditLine/borrow/2-ChooseAmount.tsx +74 -74
  41. package/src/components/CreditLine/borrow/3-ApproveAllowance.tsx +29 -29
  42. package/src/components/CreditLine/borrow/4-Transfer.tsx +34 -34
  43. package/src/components/CreditLine/borrow/5-Success.tsx +38 -38
  44. package/src/components/CreditLine/borrow/6-Notifications.tsx +10 -10
  45. package/src/components/CreditLine/borrow/index.tsx +136 -136
  46. package/src/components/CreditLine/payment/1-ChooseAmount.tsx +67 -67
  47. package/src/components/CreditLine/payment/2-ApproveAllowance.tsx +23 -23
  48. package/src/components/CreditLine/payment/3-Transfer.tsx +34 -34
  49. package/src/components/CreditLine/payment/4-Success.tsx +39 -39
  50. package/src/components/CreditLine/payment/index.tsx +94 -94
  51. package/src/components/ErrorModal.tsx +136 -136
  52. package/src/components/Factoring/FactoredList.tsx +143 -143
  53. package/src/components/Factoring/UpcomingList.tsx +90 -90
  54. package/src/components/Factoring/index.ts +2 -2
  55. package/src/components/HumaLoading.tsx +68 -68
  56. package/src/components/HumaSnackBar.tsx +60 -60
  57. package/src/components/HumaTable.tsx +203 -203
  58. package/src/components/InvoiceFactoring/borrow/1-Evaluation.tsx +49 -49
  59. package/src/components/InvoiceFactoring/borrow/2-ChooseAmount.tsx +88 -88
  60. package/src/components/InvoiceFactoring/borrow/3-ConfirmTransfer.tsx +37 -37
  61. package/src/components/InvoiceFactoring/borrow/4-ApproveNFT.tsx +55 -55
  62. package/src/components/InvoiceFactoring/borrow/5-Transfer.tsx +34 -34
  63. package/src/components/InvoiceFactoring/borrow/6-Success.tsx +20 -20
  64. package/src/components/InvoiceFactoring/borrow/index.tsx +94 -94
  65. package/src/components/InvoiceFactoring/payment/1-ChooseAmount.tsx +67 -67
  66. package/src/components/InvoiceFactoring/payment/2-ApproveAllowance.tsx +23 -23
  67. package/src/components/InvoiceFactoring/payment/3-Transfer.tsx +34 -34
  68. package/src/components/InvoiceFactoring/payment/4-Success.tsx +23 -23
  69. package/src/components/InvoiceFactoring/payment/index.tsx +86 -86
  70. package/src/components/Lend/supply/1-Evaluation/EvaluationEA.tsx +90 -90
  71. package/src/components/Lend/supply/1-Evaluation/EvaluationKYC.tsx +319 -319
  72. package/src/components/Lend/supply/1-Evaluation/index.tsx +31 -31
  73. package/src/components/Lend/supply/2-ChooseAmount.tsx +69 -69
  74. package/src/components/Lend/supply/3-ApproveAllowance.tsx +25 -25
  75. package/src/components/Lend/supply/4-Transfer.tsx +32 -32
  76. package/src/components/Lend/supply/5-Success.tsx +60 -60
  77. package/src/components/Lend/supply/6-Notifications.tsx +10 -10
  78. package/src/components/Lend/supply/index.tsx +167 -167
  79. package/src/components/Lend/withdraw/1-CheckWithdrawble.tsx +73 -73
  80. package/src/components/Lend/withdraw/2-ChooseAmount.tsx +50 -50
  81. package/src/components/Lend/withdraw/3-Transfer.tsx +32 -32
  82. package/src/components/Lend/withdraw/4-Success.tsx +49 -49
  83. package/src/components/Lend/withdraw/index.tsx +101 -101
  84. package/src/components/LoadingModal.tsx +49 -49
  85. package/src/components/Notifi/NotifiSubscriptionModal.tsx +268 -268
  86. package/src/components/StreamFactoring/borrow/1-Evaluation.tsx +55 -55
  87. package/src/components/StreamFactoring/borrow/2-ChooseAmount.tsx +127 -127
  88. package/src/components/StreamFactoring/borrow/3-ConfirmTransfer.tsx +42 -42
  89. package/src/components/StreamFactoring/borrow/4-ApproveAllowance.tsx +33 -33
  90. package/src/components/StreamFactoring/borrow/5-Permit.tsx +144 -144
  91. package/src/components/StreamFactoring/borrow/6-Transfer.tsx +37 -37
  92. package/src/components/StreamFactoring/borrow/7-Success.tsx +20 -20
  93. package/src/components/StreamFactoring/borrow/index.tsx +94 -94
  94. package/src/components/StreamFactoring/payment/ChooseAmount.tsx +54 -54
  95. package/src/components/StreamFactoring/payment/Success.tsx +23 -23
  96. package/src/components/StreamFactoring/payment/Transfer.tsx +34 -34
  97. package/src/components/StreamFactoring/payment/index.tsx +66 -66
  98. package/src/components/SuperfluidFactoring/SuperfluidFactoredList.tsx +69 -69
  99. package/src/components/SuperfluidFactoring/SuperfluidUpcomingList.tsx +166 -166
  100. package/src/components/SuperfluidFactoring/index.tsx +85 -85
  101. package/src/components/TxDoneModal.tsx +85 -85
  102. package/src/components/TxSendModal.tsx +59 -59
  103. package/src/components/ViewOnExplorer.tsx +23 -23
  104. package/src/components/WidgetWrapper.tsx +74 -74
  105. package/src/components/WrapperModal.tsx +54 -54
  106. package/src/components/buttons/TableActionButton.tsx +36 -36
  107. package/src/components/buttons/index.ts +1 -1
  108. package/src/components/humaModal/HumaModal.tsx +68 -68
  109. package/src/components/humaModal/HumaModalHeader.tsx +70 -70
  110. package/src/components/humaModal/index.tsx +2 -2
  111. package/src/components/icons/approve-lender.svg +58 -58
  112. package/src/components/icons/auto-payback.svg +139 -139
  113. package/src/components/icons/check-circle.svg +3 -3
  114. package/src/components/icons/check-green.svg +3 -3
  115. package/src/components/icons/check.svg +10 -10
  116. package/src/components/icons/donut.svg +904 -904
  117. package/src/components/icons/ellipse.svg +3 -3
  118. package/src/components/icons/huma-full.svg +22 -22
  119. package/src/components/icons/huma.svg +15 -15
  120. package/src/components/icons/index.tsx +93 -93
  121. package/src/components/icons/loader.svg +229 -229
  122. package/src/components/icons/metamask.svg +31 -31
  123. package/src/components/icons/polygon.svg +16 -16
  124. package/src/components/icons/receipt.svg +3 -3
  125. package/src/components/icons/separator.svg +3 -3
  126. package/src/components/icons/sorry.svg +17 -17
  127. package/src/components/icons/usdc.svg +5 -5
  128. package/src/components/icons/wallet-connect.svg +11 -11
  129. package/src/components/images/index.ts +3 -3
  130. package/src/cosmos/CreditLineBorrow.fixture.tsx +86 -86
  131. package/src/cosmos/CreditLinePayment.fixture.tsx +50 -50
  132. package/src/cosmos/InvoiceFactoringBorrow.fixture.tsx +111 -111
  133. package/src/cosmos/InvoiceFactoringPayment.fixture.tsx +67 -67
  134. package/src/cosmos/LendSupply.fixture.tsx +75 -75
  135. package/src/cosmos/LendWithdraw.fixture.tsx +43 -43
  136. package/src/cosmos/SDKTesting.fixture.tsx +616 -616
  137. package/src/cosmos/SuperfluidFactoringBorrow.fixture.tsx +15 -15
  138. package/src/cosmos/WalletWrapper.tsx +52 -52
  139. package/src/cosmos/abis/InvoiceNFT.json +644 -644
  140. package/src/cosmos/abis/ReceivableFactoringPool.json +1529 -1529
  141. package/src/cosmos/utils/env.ts +6 -6
  142. package/src/cosmos/utils/index.ts +169 -169
  143. package/src/fonts/Recoleta/Recoleta-Black.otf +0 -0
  144. package/src/fonts/Recoleta/Recoleta-Bold.otf +0 -0
  145. package/src/fonts/Recoleta/Recoleta-Light.otf +0 -0
  146. package/src/fonts/Recoleta/Recoleta-Medium.otf +0 -0
  147. package/src/fonts/Recoleta/Recoleta-Regular.otf +0 -0
  148. package/src/fonts/Recoleta/Recoleta-RegularDEMO.otf +0 -0
  149. package/src/fonts/Recoleta/Recoleta-SemiBold.otf +0 -0
  150. package/src/fonts/Recoleta/Recoleta-Thin.otf +0 -0
  151. package/src/hooks/useEA.ts +53 -53
  152. package/src/hooks/useElementDimensions.ts +30 -30
  153. package/src/hooks/useNotifi.ts +71 -71
  154. package/src/hooks/useRedux.ts +6 -6
  155. package/src/index.css +61 -61
  156. package/src/index.tsx +283 -283
  157. package/src/react-app-env.d.ts +1 -1
  158. package/src/reportWebVitals.ts +15 -15
  159. package/src/setupTests.ts +6 -6
  160. package/src/store/index.ts +27 -27
  161. package/src/store/widgets.reducers.ts +120 -120
  162. package/src/store/widgets.selectors.ts +3 -3
  163. package/src/store/widgets.store.ts +55 -55
  164. package/src/theme/breakpoints.ts +10 -10
  165. package/src/theme/components.ts +70 -70
  166. package/src/theme/coreThemeConstants.ts +29 -29
  167. package/src/theme/cssMixins.ts +92 -92
  168. package/src/theme/hooks/useGetSizes.ts +31 -31
  169. package/src/theme/index.ts +24 -24
  170. package/src/theme/palette.ts +150 -150
  171. package/src/theme/shape.ts +7 -7
  172. package/src/theme/theme.types.ts +80 -80
  173. package/src/theme/typography.ts +117 -117
  174. package/src/utilTypes.d.ts +30 -30
  175. package/src/utils/env.ts +10 -10
  176. package/tsconfig.build.json +7 -7
  177. package/tsconfig.json +32 -32
  178. package/webpack.cosmos.js +54 -54
@@ -1,3 +1,3 @@
1
- <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path d="M18 17H6V15H18V17ZM18 13H6V11H18V13ZM18 9H6V7H18V9ZM3 22L4.5 20.5L6 22L7.5 20.5L9 22L10.5 20.5L12 22L13.5 20.5L15 22L16.5 20.5L18 22L19.5 20.5L21 22V2L19.5 3.5L18 2L16.5 3.5L15 2L13.5 3.5L12 2L10.5 3.5L9 2L7.5 3.5L6 2L4.5 3.5L3 2V22Z" fill="#76707E"/>
3
- </svg>
1
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M18 17H6V15H18V17ZM18 13H6V11H18V13ZM18 9H6V7H18V9ZM3 22L4.5 20.5L6 22L7.5 20.5L9 22L10.5 20.5L12 22L13.5 20.5L15 22L16.5 20.5L18 22L19.5 20.5L21 22V2L19.5 3.5L18 2L16.5 3.5L15 2L13.5 3.5L12 2L10.5 3.5L9 2L7.5 3.5L6 2L4.5 3.5L3 2V22Z" fill="#76707E"/>
3
+ </svg>
@@ -1,3 +1,3 @@
1
- <svg width="2" height="14" viewBox="0 0 2 14" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <rect width="2" height="14" fill="#E0E0E0"/>
3
- </svg>
1
+ <svg width="2" height="14" viewBox="0 0 2 14" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <rect width="2" height="14" fill="#E0E0E0"/>
3
+ </svg>
@@ -1,17 +1,17 @@
1
- <svg width="168" height="170" viewBox="0 0 168 170" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <g clip-path="url(#clip0_1696_4312)">
3
- <path d="M164.745 121.783L113.377 16.7162C113.154 16.2562 112.865 15.8309 112.52 15.4538L107.13 9.58644C107.475 9.96357 107.763 10.3888 107.986 10.8489L159.355 115.916C161.289 119.869 157.976 124.821 153.392 124.828L31.636 125.019C29.953 125.022 28.5621 124.356 27.6072 123.317L32.9973 129.184C33.9523 130.224 35.3432 130.889 37.0262 130.887L158.782 130.696C163.366 130.688 166.679 125.737 164.745 121.783Z" fill="#B246FF"/>
4
- <path d="M160.819 130.643C160.169 130.854 159.484 130.966 158.783 130.967L37.0266 131.158C35.3621 131.161 33.8603 130.525 32.7972 129.368L27.407 123.5C27.3581 123.447 27.3324 123.377 27.3354 123.305C27.3384 123.233 27.3698 123.165 27.4229 123.116C27.4759 123.067 27.5462 123.041 27.6182 123.044C27.6902 123.047 27.758 123.079 27.8069 123.132C28.7653 124.175 30.1252 124.749 31.6353 124.747L153.392 124.556C155.54 124.553 157.529 123.416 158.711 121.516C159.79 119.779 159.94 117.73 159.111 116.035L107.742 10.9676C107.531 10.5334 107.26 10.1318 106.935 9.77527L106.929 9.76981C106.881 9.71664 106.855 9.64633 106.858 9.57429C106.861 9.50224 106.892 9.43434 106.945 9.38546C106.972 9.36126 107.002 9.34248 107.036 9.33019C107.069 9.31791 107.105 9.31236 107.14 9.31388C107.176 9.31539 107.211 9.32393 107.243 9.33902C107.276 9.3541 107.305 9.37542 107.329 9.40176L112.719 15.2695C113.082 15.666 113.385 16.113 113.62 16.5966L164.989 121.663C165.901 123.529 165.741 125.774 164.562 127.671C163.665 129.114 162.337 130.15 160.819 130.643ZM29.4093 124.877L33.1971 129C34.1556 130.043 35.5154 130.616 37.0255 130.614L158.782 130.423C160.93 130.42 162.919 129.284 164.101 127.384C165.181 125.647 165.33 123.598 164.501 121.902L113.132 16.8352C112.921 16.3988 112.647 15.9953 112.32 15.6373L108.707 11.7048L159.599 115.796C160.511 117.661 160.351 119.907 159.172 121.804C157.891 123.864 155.731 125.096 153.393 125.1L31.6367 125.291C30.8479 125.292 30.0957 125.15 29.4093 124.877Z" fill="#111111"/>
5
- <path d="M159.354 115.915C161.288 119.869 157.975 124.821 153.391 124.828L31.6351 125.019C27.0544 125.026 24.6368 120.083 27.2869 116.123L97.6742 10.8644C98.9993 8.88367 101.094 7.89157 103.1 7.88828C105.105 7.88507 107.02 8.87119 107.985 10.848L159.354 115.915L159.354 115.915Z" fill="white"/>
6
- <path d="M155.428 124.776C154.778 124.988 154.093 125.099 153.392 125.1L31.6357 125.291C29.4645 125.294 27.5815 124.199 26.5988 122.361C25.5382 120.378 25.7109 117.989 27.0608 115.971L97.4482 10.7134C98.7427 8.77859 100.854 7.62073 103.099 7.61685C105.358 7.61352 107.276 8.77698 108.229 10.7294L159.598 115.796C160.51 117.661 160.35 119.907 159.171 121.804C158.274 123.246 156.947 124.283 155.429 124.776L155.428 124.776ZM101.244 8.4572C99.9098 8.89065 98.7255 9.78191 97.8998 11.0161L27.5122 116.274C26.2759 118.122 26.1136 120.302 27.0776 122.105C27.964 123.763 29.6673 124.75 31.6341 124.747L153.39 124.556C155.539 124.553 157.528 123.417 158.71 121.516C159.789 119.78 159.939 117.731 159.11 116.035C158.28 114.34 107.741 10.9681 107.741 10.9681C106.881 9.2069 105.146 8.15755 103.1 8.16077C102.469 8.16205 101.843 8.26201 101.244 8.4572Z" fill="#111111"/>
7
- <path d="M106.58 41.749L101.105 89.5028L90.231 89.5199L93.4905 41.7697L106.58 41.749Z" fill="#B246FF"/>
8
- <path d="M101.189 89.7611C101.163 89.7697 101.135 89.7742 101.105 89.7746L90.2313 89.7917C90.194 89.7918 90.157 89.7842 90.1228 89.7694C90.0885 89.7546 90.0577 89.7328 90.0322 89.7056C90.0067 89.6783 89.9871 89.646 89.9747 89.6108C89.9622 89.5756 89.9571 89.5382 89.9598 89.501L93.219 41.7508C93.2236 41.6821 93.2541 41.6178 93.3043 41.5708C93.3545 41.5238 93.4207 41.4976 93.4895 41.4977L106.579 41.4771C106.617 41.4771 106.655 41.4852 106.69 41.5009C106.725 41.5166 106.756 41.5395 106.782 41.5681C106.807 41.5968 106.826 41.6305 106.838 41.667C106.85 41.7036 106.853 41.7422 106.849 41.7803L101.374 89.5339C101.368 89.5857 101.348 89.6346 101.315 89.6749C101.282 89.7152 101.238 89.7452 101.188 89.7613L101.189 89.7611ZM90.5216 89.2472L100.862 89.231L106.275 42.0214L93.7442 42.0409L90.5216 89.2472Z" fill="#111111"/>
9
- <path d="M99.9416 100.867L98.9605 111.712L88.0867 111.729L89.0675 100.884L99.9416 100.867Z" fill="#B246FF"/>
10
- <path d="M99.0449 111.971C99.0185 111.979 98.9906 111.984 98.9613 111.984L88.0872 112.001C88.0493 112.001 88.0119 111.994 87.9773 111.978C87.9427 111.963 87.9116 111.941 87.8861 111.913C87.8606 111.885 87.8411 111.852 87.8291 111.816C87.817 111.78 87.8125 111.742 87.8159 111.705L88.7964 100.86C88.8024 100.792 88.8334 100.729 88.8834 100.683C88.9334 100.638 88.9987 100.612 89.0665 100.612L99.9406 100.595C99.9784 100.595 100.016 100.603 100.05 100.618C100.085 100.633 100.116 100.656 100.142 100.684C100.167 100.712 100.187 100.745 100.199 100.78C100.211 100.816 100.215 100.854 100.212 100.892L99.2313 111.737C99.2265 111.79 99.2063 111.84 99.1732 111.882C99.14 111.923 99.0954 111.954 99.0449 111.971ZM88.3843 111.457L98.7126 111.44L99.644 101.14L89.3157 101.156L88.3843 111.457Z" fill="#111111"/>
11
- </g>
12
- <defs>
13
- <clipPath id="clip0_1696_4312">
14
- <rect width="131.978" height="135.155" fill="white" transform="translate(0 40.7832) rotate(-18)"/>
15
- </clipPath>
16
- </defs>
17
- </svg>
1
+ <svg width="168" height="170" viewBox="0 0 168 170" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <g clip-path="url(#clip0_1696_4312)">
3
+ <path d="M164.745 121.783L113.377 16.7162C113.154 16.2562 112.865 15.8309 112.52 15.4538L107.13 9.58644C107.475 9.96357 107.763 10.3888 107.986 10.8489L159.355 115.916C161.289 119.869 157.976 124.821 153.392 124.828L31.636 125.019C29.953 125.022 28.5621 124.356 27.6072 123.317L32.9973 129.184C33.9523 130.224 35.3432 130.889 37.0262 130.887L158.782 130.696C163.366 130.688 166.679 125.737 164.745 121.783Z" fill="#B246FF"/>
4
+ <path d="M160.819 130.643C160.169 130.854 159.484 130.966 158.783 130.967L37.0266 131.158C35.3621 131.161 33.8603 130.525 32.7972 129.368L27.407 123.5C27.3581 123.447 27.3324 123.377 27.3354 123.305C27.3384 123.233 27.3698 123.165 27.4229 123.116C27.4759 123.067 27.5462 123.041 27.6182 123.044C27.6902 123.047 27.758 123.079 27.8069 123.132C28.7653 124.175 30.1252 124.749 31.6353 124.747L153.392 124.556C155.54 124.553 157.529 123.416 158.711 121.516C159.79 119.779 159.94 117.73 159.111 116.035L107.742 10.9676C107.531 10.5334 107.26 10.1318 106.935 9.77527L106.929 9.76981C106.881 9.71664 106.855 9.64633 106.858 9.57429C106.861 9.50224 106.892 9.43434 106.945 9.38546C106.972 9.36126 107.002 9.34248 107.036 9.33019C107.069 9.31791 107.105 9.31236 107.14 9.31388C107.176 9.31539 107.211 9.32393 107.243 9.33902C107.276 9.3541 107.305 9.37542 107.329 9.40176L112.719 15.2695C113.082 15.666 113.385 16.113 113.62 16.5966L164.989 121.663C165.901 123.529 165.741 125.774 164.562 127.671C163.665 129.114 162.337 130.15 160.819 130.643ZM29.4093 124.877L33.1971 129C34.1556 130.043 35.5154 130.616 37.0255 130.614L158.782 130.423C160.93 130.42 162.919 129.284 164.101 127.384C165.181 125.647 165.33 123.598 164.501 121.902L113.132 16.8352C112.921 16.3988 112.647 15.9953 112.32 15.6373L108.707 11.7048L159.599 115.796C160.511 117.661 160.351 119.907 159.172 121.804C157.891 123.864 155.731 125.096 153.393 125.1L31.6367 125.291C30.8479 125.292 30.0957 125.15 29.4093 124.877Z" fill="#111111"/>
5
+ <path d="M159.354 115.915C161.288 119.869 157.975 124.821 153.391 124.828L31.6351 125.019C27.0544 125.026 24.6368 120.083 27.2869 116.123L97.6742 10.8644C98.9993 8.88367 101.094 7.89157 103.1 7.88828C105.105 7.88507 107.02 8.87119 107.985 10.848L159.354 115.915L159.354 115.915Z" fill="white"/>
6
+ <path d="M155.428 124.776C154.778 124.988 154.093 125.099 153.392 125.1L31.6357 125.291C29.4645 125.294 27.5815 124.199 26.5988 122.361C25.5382 120.378 25.7109 117.989 27.0608 115.971L97.4482 10.7134C98.7427 8.77859 100.854 7.62073 103.099 7.61685C105.358 7.61352 107.276 8.77698 108.229 10.7294L159.598 115.796C160.51 117.661 160.35 119.907 159.171 121.804C158.274 123.246 156.947 124.283 155.429 124.776L155.428 124.776ZM101.244 8.4572C99.9098 8.89065 98.7255 9.78191 97.8998 11.0161L27.5122 116.274C26.2759 118.122 26.1136 120.302 27.0776 122.105C27.964 123.763 29.6673 124.75 31.6341 124.747L153.39 124.556C155.539 124.553 157.528 123.417 158.71 121.516C159.789 119.78 159.939 117.731 159.11 116.035C158.28 114.34 107.741 10.9681 107.741 10.9681C106.881 9.2069 105.146 8.15755 103.1 8.16077C102.469 8.16205 101.843 8.26201 101.244 8.4572Z" fill="#111111"/>
7
+ <path d="M106.58 41.749L101.105 89.5028L90.231 89.5199L93.4905 41.7697L106.58 41.749Z" fill="#B246FF"/>
8
+ <path d="M101.189 89.7611C101.163 89.7697 101.135 89.7742 101.105 89.7746L90.2313 89.7917C90.194 89.7918 90.157 89.7842 90.1228 89.7694C90.0885 89.7546 90.0577 89.7328 90.0322 89.7056C90.0067 89.6783 89.9871 89.646 89.9747 89.6108C89.9622 89.5756 89.9571 89.5382 89.9598 89.501L93.219 41.7508C93.2236 41.6821 93.2541 41.6178 93.3043 41.5708C93.3545 41.5238 93.4207 41.4976 93.4895 41.4977L106.579 41.4771C106.617 41.4771 106.655 41.4852 106.69 41.5009C106.725 41.5166 106.756 41.5395 106.782 41.5681C106.807 41.5968 106.826 41.6305 106.838 41.667C106.85 41.7036 106.853 41.7422 106.849 41.7803L101.374 89.5339C101.368 89.5857 101.348 89.6346 101.315 89.6749C101.282 89.7152 101.238 89.7452 101.188 89.7613L101.189 89.7611ZM90.5216 89.2472L100.862 89.231L106.275 42.0214L93.7442 42.0409L90.5216 89.2472Z" fill="#111111"/>
9
+ <path d="M99.9416 100.867L98.9605 111.712L88.0867 111.729L89.0675 100.884L99.9416 100.867Z" fill="#B246FF"/>
10
+ <path d="M99.0449 111.971C99.0185 111.979 98.9906 111.984 98.9613 111.984L88.0872 112.001C88.0493 112.001 88.0119 111.994 87.9773 111.978C87.9427 111.963 87.9116 111.941 87.8861 111.913C87.8606 111.885 87.8411 111.852 87.8291 111.816C87.817 111.78 87.8125 111.742 87.8159 111.705L88.7964 100.86C88.8024 100.792 88.8334 100.729 88.8834 100.683C88.9334 100.638 88.9987 100.612 89.0665 100.612L99.9406 100.595C99.9784 100.595 100.016 100.603 100.05 100.618C100.085 100.633 100.116 100.656 100.142 100.684C100.167 100.712 100.187 100.745 100.199 100.78C100.211 100.816 100.215 100.854 100.212 100.892L99.2313 111.737C99.2265 111.79 99.2063 111.84 99.1732 111.882C99.14 111.923 99.0954 111.954 99.0449 111.971ZM88.3843 111.457L98.7126 111.44L99.644 101.14L89.3157 101.156L88.3843 111.457Z" fill="#111111"/>
11
+ </g>
12
+ <defs>
13
+ <clipPath id="clip0_1696_4312">
14
+ <rect width="131.978" height="135.155" fill="white" transform="translate(0 40.7832) rotate(-18)"/>
15
+ </clipPath>
16
+ </defs>
17
+ </svg>
@@ -1,5 +1,5 @@
1
- <svg data-name="86977684-12db-4850-8f30-233a7c267d11" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2000 2000">
2
- <path d="M1000 2000c554.17 0 1000-445.83 1000-1000S1554.17 0 1000 0 0 445.83 0 1000s445.83 1000 1000 1000z" fill="#2775ca"/>
3
- <path d="M1275 1158.33c0-145.83-87.5-195.83-262.5-216.66-125-16.67-150-50-150-108.34s41.67-95.83 125-95.83c75 0 116.67 25 137.5 87.5 4.17 12.5 16.67 20.83 29.17 20.83h66.66c16.67 0 29.17-12.5 29.17-29.16v-4.17c-16.67-91.67-91.67-162.5-187.5-170.83v-100c0-16.67-12.5-29.17-33.33-33.34h-62.5c-16.67 0-29.17 12.5-33.34 33.34v95.83c-125 16.67-204.16 100-204.16 204.17 0 137.5 83.33 191.66 258.33 212.5 116.67 20.83 154.17 45.83 154.17 112.5s-58.34 112.5-137.5 112.5c-108.34 0-145.84-45.84-158.34-108.34-4.16-16.66-16.66-25-29.16-25h-70.84c-16.66 0-29.16 12.5-29.16 29.17v4.17c16.66 104.16 83.33 179.16 220.83 200v100c0 16.66 12.5 29.16 33.33 33.33h62.5c16.67 0 29.17-12.5 33.34-33.33v-100c125-20.84 208.33-108.34 208.33-220.84z" fill="#fff"/>
4
- <path d="M787.5 1595.83c-325-116.66-491.67-479.16-370.83-800 62.5-175 200-308.33 370.83-370.83 16.67-8.33 25-20.83 25-41.67V325c0-16.67-8.33-29.17-25-33.33-4.17 0-12.5 0-16.67 4.16-395.83 125-612.5 545.84-487.5 941.67 75 233.33 254.17 412.5 487.5 487.5 16.67 8.33 33.34 0 37.5-16.67 4.17-4.16 4.17-8.33 4.17-16.66v-58.34c0-12.5-12.5-29.16-25-37.5zM1229.17 295.83c-16.67-8.33-33.34 0-37.5 16.67-4.17 4.17-4.17 8.33-4.17 16.67v58.33c0 16.67 12.5 33.33 25 41.67 325 116.66 491.67 479.16 370.83 800-62.5 175-200 308.33-370.83 370.83-16.67 8.33-25 20.83-25 41.67V1700c0 16.67 8.33 29.17 25 33.33 4.17 0 12.5 0 16.67-4.16 395.83-125 612.5-545.84 487.5-941.67-75-237.5-258.34-416.67-487.5-491.67z" fill="#fff"/>
5
- </svg>
1
+ <svg data-name="86977684-12db-4850-8f30-233a7c267d11" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2000 2000">
2
+ <path d="M1000 2000c554.17 0 1000-445.83 1000-1000S1554.17 0 1000 0 0 445.83 0 1000s445.83 1000 1000 1000z" fill="#2775ca"/>
3
+ <path d="M1275 1158.33c0-145.83-87.5-195.83-262.5-216.66-125-16.67-150-50-150-108.34s41.67-95.83 125-95.83c75 0 116.67 25 137.5 87.5 4.17 12.5 16.67 20.83 29.17 20.83h66.66c16.67 0 29.17-12.5 29.17-29.16v-4.17c-16.67-91.67-91.67-162.5-187.5-170.83v-100c0-16.67-12.5-29.17-33.33-33.34h-62.5c-16.67 0-29.17 12.5-33.34 33.34v95.83c-125 16.67-204.16 100-204.16 204.17 0 137.5 83.33 191.66 258.33 212.5 116.67 20.83 154.17 45.83 154.17 112.5s-58.34 112.5-137.5 112.5c-108.34 0-145.84-45.84-158.34-108.34-4.16-16.66-16.66-25-29.16-25h-70.84c-16.66 0-29.16 12.5-29.16 29.17v4.17c16.66 104.16 83.33 179.16 220.83 200v100c0 16.66 12.5 29.16 33.33 33.33h62.5c16.67 0 29.17-12.5 33.34-33.33v-100c125-20.84 208.33-108.34 208.33-220.84z" fill="#fff"/>
4
+ <path d="M787.5 1595.83c-325-116.66-491.67-479.16-370.83-800 62.5-175 200-308.33 370.83-370.83 16.67-8.33 25-20.83 25-41.67V325c0-16.67-8.33-29.17-25-33.33-4.17 0-12.5 0-16.67 4.16-395.83 125-612.5 545.84-487.5 941.67 75 233.33 254.17 412.5 487.5 487.5 16.67 8.33 33.34 0 37.5-16.67 4.17-4.16 4.17-8.33 4.17-16.66v-58.34c0-12.5-12.5-29.16-25-37.5zM1229.17 295.83c-16.67-8.33-33.34 0-37.5 16.67-4.17 4.17-4.17 8.33-4.17 16.67v58.33c0 16.67 12.5 33.33 25 41.67 325 116.66 491.67 479.16 370.83 800-62.5 175-200 308.33-370.83 370.83-16.67 8.33-25 20.83-25 41.67V1700c0 16.67 8.33 29.17 25 33.33 4.17 0 12.5 0 16.67-4.16 395.83-125 612.5-545.84 487.5-941.67-75-237.5-258.34-416.67-487.5-491.67z" fill="#fff"/>
5
+ </svg>
@@ -1,12 +1,12 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <svg width="300px" height="185px" viewBox="0 0 300 185" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
- <!-- Generator: Sketch 49.3 (51167) - http://www.bohemiancoding.com/sketch -->
4
- <title>WalletConnect</title>
5
- <desc>Created with Sketch.</desc>
6
- <defs></defs>
7
- <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
8
- <g id="walletconnect-logo-alt" fill="#3B99FC" fill-rule="nonzero">
9
- <path d="M61.4385429,36.2562612 C110.349767,-11.6319051 189.65053,-11.6319051 238.561752,36.2562612 L244.448297,42.0196786 C246.893858,44.4140867 246.893858,48.2961898 244.448297,50.690599 L224.311602,70.406102 C223.088821,71.6033071 221.106302,71.6033071 219.883521,70.406102 L211.782937,62.4749541 C177.661245,29.0669724 122.339051,29.0669724 88.2173582,62.4749541 L79.542302,70.9685592 C78.3195204,72.1657633 76.337001,72.1657633 75.1142214,70.9685592 L54.9775265,51.2530561 C52.5319653,48.8586469 52.5319653,44.9765439 54.9775265,42.5821357 L61.4385429,36.2562612 Z M280.206339,77.0300061 L298.128036,94.5769031 C300.573585,96.9713 300.573599,100.85338 298.128067,103.247793 L217.317896,182.368927 C214.872352,184.763353 210.907314,184.76338 208.461736,182.368989 C208.461726,182.368979 208.461714,182.368967 208.461704,182.368957 L151.107561,126.214385 C150.496171,125.615783 149.504911,125.615783 148.893521,126.214385 C148.893517,126.214389 148.893514,126.214393 148.89351,126.214396 L91.5405888,182.368927 C89.095052,184.763359 85.1300133,184.763399 82.6844276,182.369014 C82.6844133,182.369 82.684398,182.368986 82.6843827,182.36897 L1.87196327,103.246785 C-0.573596939,100.852377 -0.573596939,96.9702735 1.87196327,94.5758653 L19.7936929,77.028998 C22.2392531,74.6345898 26.2042918,74.6345898 28.6498531,77.028998 L86.0048306,133.184355 C86.6162214,133.782957 87.6074796,133.782957 88.2188704,133.184355 C88.2188796,133.184346 88.2188878,133.184338 88.2188969,133.184331 L145.571,77.028998 C148.016505,74.6345347 151.981544,74.6344449 154.427161,77.028798 C154.427195,77.0288316 154.427229,77.0288653 154.427262,77.028899 L211.782164,133.184331 C212.393554,133.782932 213.384814,133.782932 213.996204,133.184331 L271.350179,77.0300061 C273.79574,74.6355969 277.760778,74.6355969 280.206339,77.0300061 Z" id="WalletConnect"></path>
10
- </g>
11
- </g>
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="300px" height="185px" viewBox="0 0 300 185" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <!-- Generator: Sketch 49.3 (51167) - http://www.bohemiancoding.com/sketch -->
4
+ <title>WalletConnect</title>
5
+ <desc>Created with Sketch.</desc>
6
+ <defs></defs>
7
+ <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
8
+ <g id="walletconnect-logo-alt" fill="#3B99FC" fill-rule="nonzero">
9
+ <path d="M61.4385429,36.2562612 C110.349767,-11.6319051 189.65053,-11.6319051 238.561752,36.2562612 L244.448297,42.0196786 C246.893858,44.4140867 246.893858,48.2961898 244.448297,50.690599 L224.311602,70.406102 C223.088821,71.6033071 221.106302,71.6033071 219.883521,70.406102 L211.782937,62.4749541 C177.661245,29.0669724 122.339051,29.0669724 88.2173582,62.4749541 L79.542302,70.9685592 C78.3195204,72.1657633 76.337001,72.1657633 75.1142214,70.9685592 L54.9775265,51.2530561 C52.5319653,48.8586469 52.5319653,44.9765439 54.9775265,42.5821357 L61.4385429,36.2562612 Z M280.206339,77.0300061 L298.128036,94.5769031 C300.573585,96.9713 300.573599,100.85338 298.128067,103.247793 L217.317896,182.368927 C214.872352,184.763353 210.907314,184.76338 208.461736,182.368989 C208.461726,182.368979 208.461714,182.368967 208.461704,182.368957 L151.107561,126.214385 C150.496171,125.615783 149.504911,125.615783 148.893521,126.214385 C148.893517,126.214389 148.893514,126.214393 148.89351,126.214396 L91.5405888,182.368927 C89.095052,184.763359 85.1300133,184.763399 82.6844276,182.369014 C82.6844133,182.369 82.684398,182.368986 82.6843827,182.36897 L1.87196327,103.246785 C-0.573596939,100.852377 -0.573596939,96.9702735 1.87196327,94.5758653 L19.7936929,77.028998 C22.2392531,74.6345898 26.2042918,74.6345898 28.6498531,77.028998 L86.0048306,133.184355 C86.6162214,133.782957 87.6074796,133.782957 88.2188704,133.184355 C88.2188796,133.184346 88.2188878,133.184338 88.2188969,133.184331 L145.571,77.028998 C148.016505,74.6345347 151.981544,74.6344449 154.427161,77.028798 C154.427195,77.0288316 154.427229,77.0288653 154.427262,77.028899 L211.782164,133.184331 C212.393554,133.782932 213.384814,133.782932 213.996204,133.184331 L271.350179,77.0300061 C273.79574,74.6355969 277.760778,74.6355969 280.206339,77.0300061 Z" id="WalletConnect"></path>
10
+ </g>
11
+ </g>
12
12
  </svg>
@@ -1,3 +1,3 @@
1
- export { default as ApproveLenderImg } from './approve-lender.png'
2
- export { default as SorryImg } from './sorry.png'
3
- export { default as AutoPaybackImg } from './auto-payback.png'
1
+ export { default as ApproveLenderImg } from './approve-lender.png'
2
+ export { default as SorryImg } from './sorry.png'
3
+ export { default as AutoPaybackImg } from './auto-payback.png'
@@ -1,86 +1,86 @@
1
- /* eslint-disable react/jsx-boolean-value */
2
- /* eslint-disable @typescript-eslint/no-explicit-any */
3
- import { Box, Button } from '@mui/material'
4
- import { ethers } from 'ethers'
5
- import { useEffect, useState } from 'react'
6
-
7
- import { useAccount } from 'wagmi'
8
- import { CreditLineBorrowWidget } from '..'
9
- import { getInjectedMetamask } from './utils'
10
- import { WalletWrapper } from './WalletWrapper'
11
-
12
- function Fixture() {
13
- const [showModal, setShowModal] = useState(false)
14
- const [showModalRandom, setShowModalRandom] = useState(false)
15
- const [testPrivateKeyRandom, setTestPrivateKeyRandom] = useState<string>()
16
- const [testAccountRandom, setTestAccountRandom] = useState<string>()
17
- const { isConnected } = useAccount()
18
- const PoolAddress = '0xA22D20FB0c9980fb96A9B0B5679C061aeAf5dDE4'
19
-
20
- useEffect(() => {
21
- const wallet = ethers.Wallet.createRandom()
22
- setTestPrivateKeyRandom(wallet.privateKey)
23
- setTestAccountRandom(wallet.address)
24
- }, [])
25
-
26
- const handleBorrow = () => {
27
- setShowModal(true)
28
- }
29
-
30
- const handleBorrowRandom = () => {
31
- // @ts-ignore
32
- window.ethereum = getInjectedMetamask(testPrivateKeyRandom)
33
- setShowModalRandom(true)
34
- }
35
-
36
- const handleApprove = () => {}
37
-
38
- const handleClose = () => {
39
- setShowModal(false)
40
- setShowModalRandom(false)
41
- window.ethereum = undefined
42
- }
43
-
44
- return (
45
- <>
46
- <Box>Pool: {PoolAddress}</Box>
47
- <Box>Pool Name: HumaCreditLine</Box>
48
- <Button
49
- variant='contained'
50
- onClick={handleBorrow}
51
- disabled={!isConnected}
52
- >
53
- Borrow Without EA Check
54
- </Button>
55
- {showModal && (
56
- <CreditLineBorrowWidget
57
- poolName='HumaCreditLine'
58
- poolType='CreditLine'
59
- handleClose={handleClose}
60
- handleApprove={handleApprove}
61
- desiredChainId={5}
62
- />
63
- )}
64
- <Box marginTop={5}>Account: {testAccountRandom}</Box>
65
- <Box>Pool: {PoolAddress}</Box>
66
- <Box>Pool Name: HumaCreditLine</Box>
67
- <Button variant='contained' onClick={handleBorrowRandom}>
68
- Borrow With EA Check
69
- </Button>
70
- {showModalRandom && (
71
- <CreditLineBorrowWidget
72
- poolName='HumaCreditLine'
73
- poolType='CreditLine'
74
- handleClose={handleClose}
75
- handleApprove={handleApprove}
76
- />
77
- )}
78
- </>
79
- )
80
- }
81
-
82
- export default (
83
- <WalletWrapper>
84
- <Fixture />
85
- </WalletWrapper>
86
- )
1
+ /* eslint-disable react/jsx-boolean-value */
2
+ /* eslint-disable @typescript-eslint/no-explicit-any */
3
+ import { Box, Button } from '@mui/material'
4
+ import { ethers } from 'ethers'
5
+ import { useEffect, useState } from 'react'
6
+
7
+ import { useAccount } from 'wagmi'
8
+ import { CreditLineBorrowWidget } from '..'
9
+ import { getInjectedMetamask } from './utils'
10
+ import { WalletWrapper } from './WalletWrapper'
11
+
12
+ function Fixture() {
13
+ const [showModal, setShowModal] = useState(false)
14
+ const [showModalRandom, setShowModalRandom] = useState(false)
15
+ const [testPrivateKeyRandom, setTestPrivateKeyRandom] = useState<string>()
16
+ const [testAccountRandom, setTestAccountRandom] = useState<string>()
17
+ const { isConnected } = useAccount()
18
+ const PoolAddress = '0xA22D20FB0c9980fb96A9B0B5679C061aeAf5dDE4'
19
+
20
+ useEffect(() => {
21
+ const wallet = ethers.Wallet.createRandom()
22
+ setTestPrivateKeyRandom(wallet.privateKey)
23
+ setTestAccountRandom(wallet.address)
24
+ }, [])
25
+
26
+ const handleBorrow = () => {
27
+ setShowModal(true)
28
+ }
29
+
30
+ const handleBorrowRandom = () => {
31
+ // @ts-ignore
32
+ window.ethereum = getInjectedMetamask(testPrivateKeyRandom)
33
+ setShowModalRandom(true)
34
+ }
35
+
36
+ const handleApprove = () => {}
37
+
38
+ const handleClose = () => {
39
+ setShowModal(false)
40
+ setShowModalRandom(false)
41
+ window.ethereum = undefined
42
+ }
43
+
44
+ return (
45
+ <>
46
+ <Box>Pool: {PoolAddress}</Box>
47
+ <Box>Pool Name: HumaCreditLine</Box>
48
+ <Button
49
+ variant='contained'
50
+ onClick={handleBorrow}
51
+ disabled={!isConnected}
52
+ >
53
+ Borrow Without EA Check
54
+ </Button>
55
+ {showModal && (
56
+ <CreditLineBorrowWidget
57
+ poolName='HumaCreditLine'
58
+ poolType='CreditLine'
59
+ handleClose={handleClose}
60
+ handleApprove={handleApprove}
61
+ desiredChainId={5}
62
+ />
63
+ )}
64
+ <Box marginTop={5}>Account: {testAccountRandom}</Box>
65
+ <Box>Pool: {PoolAddress}</Box>
66
+ <Box>Pool Name: HumaCreditLine</Box>
67
+ <Button variant='contained' onClick={handleBorrowRandom}>
68
+ Borrow With EA Check
69
+ </Button>
70
+ {showModalRandom && (
71
+ <CreditLineBorrowWidget
72
+ poolName='HumaCreditLine'
73
+ poolType='CreditLine'
74
+ handleClose={handleClose}
75
+ handleApprove={handleApprove}
76
+ />
77
+ )}
78
+ </>
79
+ )
80
+ }
81
+
82
+ export default (
83
+ <WalletWrapper>
84
+ <Fixture />
85
+ </WalletWrapper>
86
+ )
@@ -1,50 +1,50 @@
1
- /* eslint-disable react/jsx-boolean-value */
2
- /* eslint-disable @typescript-eslint/no-explicit-any */
3
- import { Box, Button } from '@mui/material'
4
- import { useState } from 'react'
5
-
6
- import { useAccount } from 'wagmi'
7
- import { CreditLinePaymentWidget } from '..'
8
- import { WalletWrapper } from './WalletWrapper'
9
-
10
- function Fixture() {
11
- const [showModal, setShowModal] = useState(false)
12
- const { isConnected } = useAccount()
13
- const PoolAddress = '0xA22D20FB0c9980fb96A9B0B5679C061aeAf5dDE4'
14
-
15
- const handlePayment = () => {
16
- setShowModal(true)
17
- }
18
-
19
- const handleClose = () => {
20
- setShowModal(false)
21
- }
22
-
23
- return (
24
- <>
25
- <Box>Pool: {PoolAddress}</Box>
26
- <Box>Pool Name: HumaCreditLine</Box>
27
- <Button
28
- variant='contained'
29
- onClick={handlePayment}
30
- disabled={!isConnected}
31
- >
32
- Make Payment
33
- </Button>
34
- {showModal && (
35
- <CreditLinePaymentWidget
36
- poolName='HumaCreditLine'
37
- poolType='CreditLine'
38
- handleClose={handleClose}
39
- desiredChainId={5}
40
- />
41
- )}
42
- </>
43
- )
44
- }
45
-
46
- export default (
47
- <WalletWrapper>
48
- <Fixture />
49
- </WalletWrapper>
50
- )
1
+ /* eslint-disable react/jsx-boolean-value */
2
+ /* eslint-disable @typescript-eslint/no-explicit-any */
3
+ import { Box, Button } from '@mui/material'
4
+ import { useState } from 'react'
5
+
6
+ import { useAccount } from 'wagmi'
7
+ import { CreditLinePaymentWidget } from '..'
8
+ import { WalletWrapper } from './WalletWrapper'
9
+
10
+ function Fixture() {
11
+ const [showModal, setShowModal] = useState(false)
12
+ const { isConnected } = useAccount()
13
+ const PoolAddress = '0xA22D20FB0c9980fb96A9B0B5679C061aeAf5dDE4'
14
+
15
+ const handlePayment = () => {
16
+ setShowModal(true)
17
+ }
18
+
19
+ const handleClose = () => {
20
+ setShowModal(false)
21
+ }
22
+
23
+ return (
24
+ <>
25
+ <Box>Pool: {PoolAddress}</Box>
26
+ <Box>Pool Name: HumaCreditLine</Box>
27
+ <Button
28
+ variant='contained'
29
+ onClick={handlePayment}
30
+ disabled={!isConnected}
31
+ >
32
+ Make Payment
33
+ </Button>
34
+ {showModal && (
35
+ <CreditLinePaymentWidget
36
+ poolName='HumaCreditLine'
37
+ poolType='CreditLine'
38
+ handleClose={handleClose}
39
+ desiredChainId={5}
40
+ />
41
+ )}
42
+ </>
43
+ )
44
+ }
45
+
46
+ export default (
47
+ <WalletWrapper>
48
+ <Fixture />
49
+ </WalletWrapper>
50
+ )
@@ -1,111 +1,111 @@
1
- /* eslint-disable react/jsx-boolean-value */
2
- /* eslint-disable @typescript-eslint/no-explicit-any */
3
- import { Box, Button } from '@mui/material'
4
- import { BigNumber } from 'ethers'
5
- import { useState } from 'react'
6
- import { useAccount, useContractRead } from 'wagmi'
7
-
8
- import { InvoiceFactoringBorrowWidget } from '..'
9
- import InvoiceNFTAbi from './abis/InvoiceNFT.json'
10
- import RFPoolAbi from './abis/ReceivableFactoringPool.json'
11
- import { WalletWrapper } from './WalletWrapper'
12
-
13
- function Fixture() {
14
- const [showModal, setShowModal] = useState(false)
15
- const [tokenId, setTokenId] = useState<string>()
16
- const [paymentMade, setPaymentMade] = useState<'loading' | 'true' | 'false'>(
17
- 'loading',
18
- )
19
- const NFTAddress = '0xC2AC172a293d68f548ea343414584aA37eb29Dcd'
20
- const PoolAddress = '0x11672c0bBFF498c72BC2200f42461c0414855042'
21
- const { address } = useAccount()
22
-
23
- useContractRead({
24
- address: NFTAddress,
25
- abi: InvoiceNFTAbi,
26
- functionName: 'getTokenIds',
27
- args: [address],
28
- onSuccess(tokenIds: BigNumber[]) {
29
- if (tokenIds.length) {
30
- setTokenId(tokenIds[tokenIds.length - 1].toString())
31
- } else {
32
- setTokenId('empty')
33
- }
34
- },
35
- })
36
-
37
- useContractRead({
38
- address: PoolAddress,
39
- abi: RFPoolAbi,
40
- functionName: 'creditRecordMapping',
41
- args: [address],
42
- onSuccess(creditRecord: any) {
43
- if (creditRecord.state > 2) {
44
- setPaymentMade('false')
45
- } else {
46
- setPaymentMade('true')
47
- }
48
- },
49
- })
50
-
51
- const handleClose = () => {
52
- setShowModal(false)
53
- }
54
-
55
- if (!tokenId || paymentMade === 'loading') {
56
- return <div>Loading token id and making payment...</div>
57
- }
58
-
59
- if (tokenId === 'empty') {
60
- return (
61
- <>
62
- <div>Please create invoice first.</div>
63
- <Button
64
- type='link'
65
- variant='contained'
66
- href={
67
- process.env.REACT_APP_CREATE_INVOICE_URL ??
68
- 'https://huma-request-apps-create.netlify.app/'
69
- }
70
- target='_blank'
71
- >
72
- CREATE INVOICE
73
- </Button>
74
- </>
75
- )
76
- }
77
-
78
- if (paymentMade === 'false') {
79
- return (
80
- <div>
81
- Please go to InvoiceFactoringPayment Fixture to make the payment first.
82
- </div>
83
- )
84
- }
85
-
86
- return (
87
- <>
88
- <Box>Pool: {PoolAddress}</Box>
89
- <Box>NFT: {NFTAddress}</Box>
90
- <Box>Pool Name: RequestNetwork</Box>
91
- <Box>Token Id: {tokenId}</Box>
92
- <Button variant='contained' onClick={() => setShowModal(true)}>
93
- Get Paid Now
94
- </Button>
95
- {showModal && (
96
- <InvoiceFactoringBorrowWidget
97
- poolName='RequestNetwork'
98
- poolType='Invoice'
99
- tokenId={tokenId}
100
- handleClose={handleClose}
101
- />
102
- )}
103
- </>
104
- )
105
- }
106
-
107
- export default (
108
- <WalletWrapper>
109
- <Fixture />
110
- </WalletWrapper>
111
- )
1
+ /* eslint-disable react/jsx-boolean-value */
2
+ /* eslint-disable @typescript-eslint/no-explicit-any */
3
+ import { Box, Button } from '@mui/material'
4
+ import { BigNumber } from 'ethers'
5
+ import { useState } from 'react'
6
+ import { useAccount, useContractRead } from 'wagmi'
7
+
8
+ import { InvoiceFactoringBorrowWidget } from '..'
9
+ import InvoiceNFTAbi from './abis/InvoiceNFT.json'
10
+ import RFPoolAbi from './abis/ReceivableFactoringPool.json'
11
+ import { WalletWrapper } from './WalletWrapper'
12
+
13
+ function Fixture() {
14
+ const [showModal, setShowModal] = useState(false)
15
+ const [tokenId, setTokenId] = useState<string>()
16
+ const [paymentMade, setPaymentMade] = useState<'loading' | 'true' | 'false'>(
17
+ 'loading',
18
+ )
19
+ const NFTAddress = '0xC2AC172a293d68f548ea343414584aA37eb29Dcd'
20
+ const PoolAddress = '0x11672c0bBFF498c72BC2200f42461c0414855042'
21
+ const { address } = useAccount()
22
+
23
+ useContractRead({
24
+ address: NFTAddress,
25
+ abi: InvoiceNFTAbi,
26
+ functionName: 'getTokenIds',
27
+ args: [address],
28
+ onSuccess(tokenIds: BigNumber[]) {
29
+ if (tokenIds.length) {
30
+ setTokenId(tokenIds[tokenIds.length - 1].toString())
31
+ } else {
32
+ setTokenId('empty')
33
+ }
34
+ },
35
+ })
36
+
37
+ useContractRead({
38
+ address: PoolAddress,
39
+ abi: RFPoolAbi,
40
+ functionName: 'creditRecordMapping',
41
+ args: [address],
42
+ onSuccess(creditRecord: any) {
43
+ if (creditRecord.state > 2) {
44
+ setPaymentMade('false')
45
+ } else {
46
+ setPaymentMade('true')
47
+ }
48
+ },
49
+ })
50
+
51
+ const handleClose = () => {
52
+ setShowModal(false)
53
+ }
54
+
55
+ if (!tokenId || paymentMade === 'loading') {
56
+ return <div>Loading token id and making payment...</div>
57
+ }
58
+
59
+ if (tokenId === 'empty') {
60
+ return (
61
+ <>
62
+ <div>Please create invoice first.</div>
63
+ <Button
64
+ type='link'
65
+ variant='contained'
66
+ href={
67
+ process.env.REACT_APP_CREATE_INVOICE_URL ??
68
+ 'https://huma-request-apps-create.netlify.app/'
69
+ }
70
+ target='_blank'
71
+ >
72
+ CREATE INVOICE
73
+ </Button>
74
+ </>
75
+ )
76
+ }
77
+
78
+ if (paymentMade === 'false') {
79
+ return (
80
+ <div>
81
+ Please go to InvoiceFactoringPayment Fixture to make the payment first.
82
+ </div>
83
+ )
84
+ }
85
+
86
+ return (
87
+ <>
88
+ <Box>Pool: {PoolAddress}</Box>
89
+ <Box>NFT: {NFTAddress}</Box>
90
+ <Box>Pool Name: RequestNetwork</Box>
91
+ <Box>Token Id: {tokenId}</Box>
92
+ <Button variant='contained' onClick={() => setShowModal(true)}>
93
+ Get Paid Now
94
+ </Button>
95
+ {showModal && (
96
+ <InvoiceFactoringBorrowWidget
97
+ poolName='RequestNetwork'
98
+ poolType='Invoice'
99
+ tokenId={tokenId}
100
+ handleClose={handleClose}
101
+ />
102
+ )}
103
+ </>
104
+ )
105
+ }
106
+
107
+ export default (
108
+ <WalletWrapper>
109
+ <Fixture />
110
+ </WalletWrapper>
111
+ )