@huma-finance/shared 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.
- package/LICENSE +660 -660
- package/README.md +28 -28
- package/dist/abis/BaseCreditPool.json +1179 -1179
- package/dist/abis/BaseCreditPoolReceivable.json +764 -0
- package/dist/abis/BaseFeeManager.json +480 -480
- package/dist/abis/BasePoolConfig.json +1364 -1364
- package/dist/abis/ERC20TransferableReceivable.json +648 -648
- package/dist/abis/ERC20TransferrableReceivable.json +648 -0
- package/dist/abis/HDT.json +512 -512
- package/dist/abis/IConstantFlowAgreementV1.json +890 -890
- package/dist/abis/ISuperfluid.json +1122 -1122
- package/dist/abis/InvoiceNFT.json +625 -625
- package/dist/abis/Multisend.json +26 -26
- package/dist/abis/RealWorldReceivable.json +823 -823
- package/dist/abis/ReceivableFactoringPool.json +1529 -1529
- package/dist/abis/StreamFactoringPool.json +1523 -1523
- package/dist/abis/StreamFeeManager.json +522 -522
- package/dist/abis/SuperfluidPoolProcessor.json +692 -692
- package/dist/abis/TestERC20.json +358 -358
- package/dist/abis/TradableStream.json +850 -850
- package/dist/abis/Transfer.json +24 -24
- package/dist/abis/TransferNFT.json +27 -27
- package/dist/abis/erc20.json +127 -127
- package/dist/abis/erc2612.json +132 -132
- package/dist/abis/erc721.json +673 -673
- package/dist/abis/index.js +3 -3
- package/dist/abis/types/BaseCreditPool.js +1 -1
- package/dist/abis/types/BaseCreditPoolReceivable.d.ts +518 -0
- package/dist/abis/types/BaseCreditPoolReceivable.js +2 -0
- package/dist/abis/types/BaseCreditPoolReceivable.js.map +1 -0
- package/dist/abis/types/BaseFeeManager.js +1 -1
- package/dist/abis/types/BasePoolConfig.js +1 -1
- package/dist/abis/types/ERC20TransferableReceivable.js +1 -1
- package/dist/abis/types/ERC20TransferrableReceivable.d.ts +407 -0
- package/dist/abis/types/ERC20TransferrableReceivable.js +2 -0
- package/dist/abis/types/ERC20TransferrableReceivable.js.map +1 -0
- package/dist/abis/types/Erc20.d.ts +184 -184
- package/dist/abis/types/Erc20.js +1 -1
- package/dist/abis/types/Erc2612.js +1 -1
- package/dist/abis/types/Erc721.js +1 -1
- package/dist/abis/types/HDT.js +1 -1
- package/dist/abis/types/IConstantFlowAgreementV1.js +1 -1
- package/dist/abis/types/ISuperfluid.js +1 -1
- package/dist/abis/types/InvoiceNFT.js +1 -1
- package/dist/abis/types/Multisend.js +1 -1
- package/dist/abis/types/RealWorldReceivable.js +1 -1
- package/dist/abis/types/ReceivableFactoringPool.js +1 -1
- package/dist/abis/types/StreamFactoringPool.js +1 -1
- package/dist/abis/types/StreamFeeManager.js +1 -1
- package/dist/abis/types/SuperfluidPoolProcessor.js +1 -1
- package/dist/abis/types/TestERC20.js +1 -1
- package/dist/abis/types/TradableStream.js +1 -1
- package/dist/abis/types/Transfer.js +1 -1
- package/dist/abis/types/TransferNFT.js +1 -1
- package/dist/abis/types/common.js +1 -1
- package/dist/abis/types/factories/BaseCreditPoolReceivable__factory.d.ts +597 -0
- package/dist/abis/types/factories/BaseCreditPoolReceivable__factory.js +778 -0
- package/dist/abis/types/factories/BaseCreditPoolReceivable__factory.js.map +1 -0
- package/dist/abis/types/factories/BaseCreditPool__factory.js +1192 -1192
- package/dist/abis/types/factories/BaseFeeManager__factory.js +493 -493
- package/dist/abis/types/factories/BasePoolConfig__factory.js +1377 -1377
- package/dist/abis/types/factories/ERC20TransferableReceivable__factory.js +661 -661
- package/dist/abis/types/factories/ERC20TransferrableReceivable__factory.d.ts +508 -0
- package/dist/abis/types/factories/ERC20TransferrableReceivable__factory.js +663 -0
- package/dist/abis/types/factories/ERC20TransferrableReceivable__factory.js.map +1 -0
- package/dist/abis/types/factories/Erc20__factory.d.ts +193 -193
- package/dist/abis/types/factories/Erc20__factory.js +259 -259
- package/dist/abis/types/factories/Erc2612__factory.js +278 -278
- package/dist/abis/types/factories/Erc721__factory.js +686 -686
- package/dist/abis/types/factories/HDT__factory.js +525 -525
- package/dist/abis/types/factories/IConstantFlowAgreementV1__factory.js +903 -903
- package/dist/abis/types/factories/ISuperfluid__factory.js +1135 -1135
- package/dist/abis/types/factories/InvoiceNFT__factory.js +638 -638
- package/dist/abis/types/factories/Multisend__factory.js +39 -39
- package/dist/abis/types/factories/RealWorldReceivable__factory.js +836 -836
- package/dist/abis/types/factories/ReceivableFactoringPool__factory.js +1542 -1542
- package/dist/abis/types/factories/StreamFactoringPool__factory.js +1536 -1536
- package/dist/abis/types/factories/StreamFeeManager__factory.js +535 -535
- package/dist/abis/types/factories/SuperfluidPoolProcessor__factory.js +705 -705
- package/dist/abis/types/factories/TestERC20__factory.js +371 -371
- package/dist/abis/types/factories/TradableStream__factory.js +863 -863
- package/dist/abis/types/factories/TransferNFT__factory.js +40 -40
- package/dist/abis/types/factories/Transfer__factory.js +37 -37
- package/dist/abis/types/factories/index.js +24 -24
- package/dist/abis/types/index.js +22 -22
- package/dist/cjs/abis/BaseCreditPool.json +1179 -1179
- package/dist/cjs/abis/BaseCreditPoolReceivable.json +764 -0
- package/dist/cjs/abis/BaseFeeManager.json +480 -480
- package/dist/cjs/abis/BasePoolConfig.json +1364 -1364
- package/dist/cjs/abis/ERC20TransferableReceivable.json +648 -648
- package/dist/cjs/abis/HDT.json +512 -512
- package/dist/cjs/abis/IConstantFlowAgreementV1.json +890 -890
- package/dist/cjs/abis/ISuperfluid.json +1122 -1122
- package/dist/cjs/abis/InvoiceNFT.json +625 -625
- package/dist/cjs/abis/Multisend.json +26 -26
- package/dist/cjs/abis/RealWorldReceivable.json +823 -823
- package/dist/cjs/abis/ReceivableFactoringPool.json +1529 -1529
- package/dist/cjs/abis/StreamFactoringPool.json +1523 -1523
- package/dist/cjs/abis/StreamFeeManager.json +522 -522
- package/dist/cjs/abis/SuperfluidPoolProcessor.json +692 -692
- package/dist/cjs/abis/TestERC20.json +358 -358
- package/dist/cjs/abis/TradableStream.json +850 -850
- package/dist/cjs/abis/Transfer.json +24 -24
- package/dist/cjs/abis/TransferNFT.json +27 -27
- package/dist/cjs/abis/erc20.json +127 -127
- package/dist/cjs/abis/erc2612.json +132 -132
- package/dist/cjs/abis/erc721.json +673 -673
- package/dist/cjs/abis/index.d.ts +3 -3
- package/dist/cjs/abis/index.js +12 -12
- package/dist/cjs/abis/types/BaseCreditPool.d.ts +803 -803
- package/dist/cjs/abis/types/BaseCreditPool.js +2 -2
- package/dist/cjs/abis/types/BaseCreditPoolReceivable.d.ts +518 -0
- package/dist/cjs/abis/types/BaseCreditPoolReceivable.js +3 -0
- package/dist/cjs/abis/types/BaseCreditPoolReceivable.js.map +1 -0
- package/dist/cjs/abis/types/BaseFeeManager.d.ts +408 -408
- package/dist/cjs/abis/types/BaseFeeManager.js +2 -2
- package/dist/cjs/abis/types/BasePoolConfig.d.ts +1097 -1097
- package/dist/cjs/abis/types/BasePoolConfig.js +2 -2
- package/dist/cjs/abis/types/ERC20TransferableReceivable.d.ts +407 -407
- package/dist/cjs/abis/types/ERC20TransferableReceivable.js +2 -2
- package/dist/cjs/abis/types/Erc20.d.ts +184 -184
- package/dist/cjs/abis/types/Erc20.js +2 -2
- package/dist/cjs/abis/types/Erc2612.d.ts +192 -192
- package/dist/cjs/abis/types/Erc2612.js +2 -2
- package/dist/cjs/abis/types/Erc721.d.ts +474 -474
- package/dist/cjs/abis/types/Erc721.js +2 -2
- package/dist/cjs/abis/types/HDT.d.ts +369 -369
- package/dist/cjs/abis/types/HDT.js +2 -2
- package/dist/cjs/abis/types/IConstantFlowAgreementV1.d.ts +573 -573
- package/dist/cjs/abis/types/IConstantFlowAgreementV1.js +2 -2
- package/dist/cjs/abis/types/ISuperfluid.d.ts +728 -728
- package/dist/cjs/abis/types/ISuperfluid.js +2 -2
- package/dist/cjs/abis/types/InvoiceNFT.d.ts +425 -425
- package/dist/cjs/abis/types/InvoiceNFT.js +2 -2
- package/dist/cjs/abis/types/Multisend.d.ts +50 -50
- package/dist/cjs/abis/types/Multisend.js +2 -2
- package/dist/cjs/abis/types/RealWorldReceivable.d.ts +564 -564
- package/dist/cjs/abis/types/RealWorldReceivable.js +2 -2
- package/dist/cjs/abis/types/ReceivableFactoringPool.d.ts +999 -999
- package/dist/cjs/abis/types/ReceivableFactoringPool.js +2 -2
- package/dist/cjs/abis/types/StreamFactoringPool.d.ts +985 -985
- package/dist/cjs/abis/types/StreamFactoringPool.js +2 -2
- package/dist/cjs/abis/types/StreamFeeManager.d.ts +440 -440
- package/dist/cjs/abis/types/StreamFeeManager.js +2 -2
- package/dist/cjs/abis/types/SuperfluidPoolProcessor.d.ts +398 -398
- package/dist/cjs/abis/types/SuperfluidPoolProcessor.js +2 -2
- package/dist/cjs/abis/types/TestERC20.d.ts +270 -270
- package/dist/cjs/abis/types/TestERC20.js +2 -2
- package/dist/cjs/abis/types/TradableStream.d.ts +607 -607
- package/dist/cjs/abis/types/TradableStream.js +2 -2
- package/dist/cjs/abis/types/Transfer.d.ts +45 -45
- package/dist/cjs/abis/types/Transfer.js +2 -2
- package/dist/cjs/abis/types/TransferNFT.d.ts +45 -45
- package/dist/cjs/abis/types/TransferNFT.js +2 -2
- package/dist/cjs/abis/types/common.d.ts +22 -22
- package/dist/cjs/abis/types/common.js +2 -2
- package/dist/cjs/abis/types/factories/BaseCreditPoolReceivable__factory.d.ts +597 -0
- package/dist/cjs/abis/types/factories/BaseCreditPoolReceivable__factory.js +782 -0
- package/dist/cjs/abis/types/factories/BaseCreditPoolReceivable__factory.js.map +1 -0
- package/dist/cjs/abis/types/factories/BaseCreditPool__factory.d.ts +931 -931
- package/dist/cjs/abis/types/factories/BaseCreditPool__factory.js +1196 -1196
- package/dist/cjs/abis/types/factories/BaseFeeManager__factory.d.ts +379 -379
- package/dist/cjs/abis/types/factories/BaseFeeManager__factory.js +497 -497
- package/dist/cjs/abis/types/factories/BasePoolConfig__factory.d.ts +1074 -1074
- package/dist/cjs/abis/types/factories/BasePoolConfig__factory.js +1381 -1381
- package/dist/cjs/abis/types/factories/ERC20TransferableReceivable__factory.d.ts +508 -508
- package/dist/cjs/abis/types/factories/ERC20TransferableReceivable__factory.js +665 -665
- package/dist/cjs/abis/types/factories/Erc20__factory.d.ts +193 -193
- package/dist/cjs/abis/types/factories/Erc20__factory.js +263 -263
- package/dist/cjs/abis/types/factories/Erc2612__factory.d.ts +209 -209
- package/dist/cjs/abis/types/factories/Erc2612__factory.js +282 -282
- package/dist/cjs/abis/types/factories/Erc721__factory.d.ts +539 -539
- package/dist/cjs/abis/types/factories/Erc721__factory.js +690 -690
- package/dist/cjs/abis/types/factories/HDT__factory.d.ts +399 -399
- package/dist/cjs/abis/types/factories/HDT__factory.js +529 -529
- package/dist/cjs/abis/types/factories/IConstantFlowAgreementV1__factory.d.ts +695 -695
- package/dist/cjs/abis/types/factories/IConstantFlowAgreementV1__factory.js +907 -907
- package/dist/cjs/abis/types/factories/ISuperfluid__factory.d.ts +866 -866
- package/dist/cjs/abis/types/factories/ISuperfluid__factory.js +1139 -1139
- package/dist/cjs/abis/types/factories/InvoiceNFT__factory.d.ts +489 -489
- package/dist/cjs/abis/types/factories/InvoiceNFT__factory.js +642 -642
- package/dist/cjs/abis/types/factories/Multisend__factory.d.ts +26 -26
- package/dist/cjs/abis/types/factories/Multisend__factory.js +43 -43
- package/dist/cjs/abis/types/factories/RealWorldReceivable__factory.d.ts +645 -645
- package/dist/cjs/abis/types/factories/RealWorldReceivable__factory.js +840 -840
- package/dist/cjs/abis/types/factories/ReceivableFactoringPool__factory.d.ts +1204 -1204
- package/dist/cjs/abis/types/factories/ReceivableFactoringPool__factory.js +1546 -1546
- package/dist/cjs/abis/types/factories/StreamFactoringPool__factory.d.ts +1200 -1200
- package/dist/cjs/abis/types/factories/StreamFactoringPool__factory.js +1540 -1540
- package/dist/cjs/abis/types/factories/StreamFeeManager__factory.d.ts +412 -412
- package/dist/cjs/abis/types/factories/StreamFeeManager__factory.js +539 -539
- package/dist/cjs/abis/types/factories/SuperfluidPoolProcessor__factory.d.ts +546 -546
- package/dist/cjs/abis/types/factories/SuperfluidPoolProcessor__factory.js +709 -709
- package/dist/cjs/abis/types/factories/TestERC20__factory.d.ts +280 -280
- package/dist/cjs/abis/types/factories/TestERC20__factory.js +375 -375
- package/dist/cjs/abis/types/factories/TradableStream__factory.d.ts +663 -663
- package/dist/cjs/abis/types/factories/TradableStream__factory.js +867 -867
- package/dist/cjs/abis/types/factories/TransferNFT__factory.d.ts +28 -28
- package/dist/cjs/abis/types/factories/TransferNFT__factory.js +44 -44
- package/dist/cjs/abis/types/factories/Transfer__factory.d.ts +25 -25
- package/dist/cjs/abis/types/factories/Transfer__factory.js +41 -41
- package/dist/cjs/abis/types/factories/index.d.ts +21 -21
- package/dist/cjs/abis/types/factories/index.js +48 -48
- package/dist/cjs/abis/types/index.d.ts +43 -43
- package/dist/cjs/abis/types/index.js +47 -47
- package/dist/cjs/hooks/index.d.ts +18 -18
- package/dist/cjs/hooks/index.js +21 -21
- package/dist/cjs/hooks/useActiveRoute.d.ts +8 -8
- package/dist/cjs/hooks/useActiveRoute.js +11 -11
- package/dist/cjs/hooks/useAsyncError.d.ts +14 -14
- package/dist/cjs/hooks/useAsyncError.js +26 -26
- package/dist/cjs/hooks/useCLPoolContract.d.ts +28 -28
- package/dist/cjs/hooks/useCLPoolContract.js +53 -53
- package/dist/cjs/hooks/useContract.d.ts +7 -7
- package/dist/cjs/hooks/useContract.js +49 -49
- package/dist/cjs/hooks/useContractFunction.d.ts +18 -18
- package/dist/cjs/hooks/useContractFunction.js +57 -57
- package/dist/cjs/hooks/useERC2612Permit/ethPermit/index.d.ts +35 -35
- package/dist/cjs/hooks/useERC2612Permit/ethPermit/index.js +145 -145
- package/dist/cjs/hooks/useERC2612Permit/ethPermit/lib.d.ts +1 -1
- package/dist/cjs/hooks/useERC2612Permit/ethPermit/lib.js +26 -26
- package/dist/cjs/hooks/useERC2612Permit/ethPermit/rpc.d.ts +10 -10
- package/dist/cjs/hooks/useERC2612Permit/ethPermit/rpc.js +104 -104
- package/dist/cjs/hooks/useERC2612Permit/index.d.ts +6 -6
- package/dist/cjs/hooks/useERC2612Permit/index.js +35 -35
- package/dist/cjs/hooks/useFactoring.d.ts +19 -19
- package/dist/cjs/hooks/useFactoring.js +94 -94
- package/dist/cjs/hooks/useForceRefresh.d.ts +1 -1
- package/dist/cjs/hooks/useForceRefresh.js +12 -12
- package/dist/cjs/hooks/useGetSizes.d.ts +12 -12
- package/dist/cjs/hooks/useGetSizes.js +23 -23
- package/dist/cjs/hooks/useInvoiceNFTContract.d.ts +11 -11
- package/dist/cjs/hooks/useInvoiceNFTContract.js +72 -72
- package/dist/cjs/hooks/useMQ.d.ts +6 -6
- package/dist/cjs/hooks/useMQ.js +18 -18
- package/dist/cjs/hooks/useMount.d.ts +2 -2
- package/dist/cjs/hooks/useMount.js +13 -13
- package/dist/cjs/hooks/useParamsSearch.d.ts +2 -2
- package/dist/cjs/hooks/useParamsSearch.js +11 -11
- package/dist/cjs/hooks/usePool.d.ts +4 -4
- package/dist/cjs/hooks/usePool.js +45 -45
- package/dist/cjs/hooks/usePoolContract.d.ts +74 -74
- package/dist/cjs/hooks/usePoolContract.js +310 -310
- package/dist/cjs/hooks/useRFPoolContract.d.ts +23 -23
- package/dist/cjs/hooks/useRFPoolContract.js +41 -41
- package/dist/cjs/hooks/useRefresh.d.ts +1 -1
- package/dist/cjs/hooks/useRefresh.js +51 -51
- package/dist/cjs/hooks/web3/index.d.ts +11 -11
- package/dist/cjs/hooks/web3/index.js +146 -146
- package/dist/cjs/hooks/web3/useConnectors.d.ts +17 -17
- package/dist/cjs/hooks/web3/useConnectors.js +30 -30
- package/dist/cjs/hooks/web3/useJsonRpcUrlsMap.d.ts +13 -13
- package/dist/cjs/hooks/web3/useJsonRpcUrlsMap.js +64 -64
- package/dist/cjs/index.d.ts +5 -5
- package/dist/cjs/index.js +8 -8
- package/dist/cjs/services/EAService.d.ts +153 -153
- package/dist/cjs/services/EAService.js +80 -80
- package/dist/cjs/services/IdentityService.d.ts +52 -52
- package/dist/cjs/services/IdentityService.js +83 -83
- package/dist/cjs/services/RNService.d.ts +14 -14
- package/dist/cjs/services/RNService.js +13 -13
- package/dist/cjs/services/index.d.ts +3 -3
- package/dist/cjs/services/index.js +6 -6
- package/dist/cjs/utils/JsonRpcConnector.d.ts +11 -11
- package/dist/cjs/utils/JsonRpcConnector.js +42 -42
- package/dist/cjs/utils/WalletConnect.d.ts +10 -10
- package/dist/cjs/utils/WalletConnect.js +55 -55
- package/dist/cjs/utils/chain.d.ts +39 -39
- package/dist/cjs/utils/chain.js +126 -126
- package/dist/cjs/utils/common.d.ts +4 -4
- package/dist/cjs/utils/common.js +17 -17
- package/dist/cjs/utils/config.d.ts +8 -8
- package/dist/cjs/utils/config.js +45 -45
- package/dist/cjs/utils/const.d.ts +2 -2
- package/dist/cjs/utils/const.js +5 -5
- package/dist/cjs/utils/contractError.json +73 -73
- package/dist/cjs/utils/contractconfig.json +19 -19
- package/dist/cjs/utils/credit.d.ts +21 -21
- package/dist/cjs/utils/credit.js +41 -41
- package/dist/cjs/utils/errors.d.ts +26 -26
- package/dist/cjs/utils/errors.js +46 -46
- package/dist/cjs/utils/index.d.ts +20 -20
- package/dist/cjs/utils/index.js +23 -23
- package/dist/cjs/utils/jsonRpcEndpoints.d.ts +12 -12
- package/dist/cjs/utils/jsonRpcEndpoints.js +21 -21
- package/dist/cjs/utils/notifi.d.ts +4 -4
- package/dist/cjs/utils/notifi.js +42 -42
- package/dist/cjs/utils/number.d.ts +6 -6
- package/dist/cjs/utils/number.js +74 -74
- package/dist/cjs/utils/pool.d.ts +97 -96
- package/dist/cjs/utils/pool.js +402 -371
- package/dist/cjs/utils/pool.js.map +1 -1
- package/dist/cjs/utils/realWorldReceivable.d.ts +12 -12
- package/dist/cjs/utils/realWorldReceivable.js +2 -2
- package/dist/cjs/utils/request.d.ts +3 -3
- package/dist/cjs/utils/request.js +45 -45
- package/dist/cjs/utils/scientificToDecimal.d.ts +1 -1
- package/dist/cjs/utils/scientificToDecimal.js +61 -61
- package/dist/cjs/utils/string.d.ts +1 -1
- package/dist/cjs/utils/string.js +5 -5
- package/dist/cjs/utils/style.d.ts +1 -1
- package/dist/cjs/utils/style.js +16 -16
- package/dist/cjs/utils/time.d.ts +26 -26
- package/dist/cjs/utils/time.js +58 -58
- package/dist/cjs/utils/transaction.d.ts +32 -32
- package/dist/cjs/utils/transaction.js +96 -96
- package/dist/cjs/utils/web3.d.ts +4 -4
- package/dist/cjs/utils/web3.js +39 -39
- package/dist/components/icons/approve-lender.svg +30 -0
- package/dist/components/icons/auto-payback.svg +40 -0
- package/dist/components/icons/check-circle.svg +3 -0
- package/dist/components/icons/check-green.svg +3 -0
- package/dist/components/icons/check.svg +10 -0
- package/dist/components/icons/donut.svg +904 -0
- package/dist/components/icons/ellipse.svg +3 -0
- package/dist/components/icons/ethereum.svg +1 -0
- package/dist/components/icons/huma-full.svg +22 -0
- package/dist/components/icons/huma.svg +15 -0
- package/dist/components/icons/index.d.ts +19 -0
- package/dist/components/icons/index.js +70 -0
- package/dist/components/icons/index.js.map +1 -0
- package/dist/components/icons/loader.svg +229 -0
- package/dist/components/icons/metamask.svg +31 -0
- package/dist/components/icons/polygon.svg +16 -0
- package/dist/components/icons/receipt.svg +3 -0
- package/dist/components/icons/separator.svg +3 -0
- package/dist/components/icons/sorry.svg +31 -0
- package/dist/components/icons/usdc.svg +5 -0
- package/dist/components/icons/wallet-connect.svg +12 -0
- package/dist/hooks/index.js +18 -18
- package/dist/hooks/useActiveRoute.js +7 -7
- package/dist/hooks/useAsyncError.js +22 -22
- package/dist/hooks/useCLPoolContract.d.ts +28 -28
- package/dist/hooks/useCLPoolContract.js +38 -38
- package/dist/hooks/useContract.js +40 -40
- package/dist/hooks/useContractFunction.js +54 -54
- package/dist/hooks/useERC2612Permit/ethPermit/index.js +139 -139
- package/dist/hooks/useERC2612Permit/ethPermit/lib.js +21 -21
- package/dist/hooks/useERC2612Permit/ethPermit/rpc.js +96 -96
- package/dist/hooks/useERC2612Permit/index.js +31 -31
- package/dist/hooks/useFactoring.js +90 -90
- package/dist/hooks/useForceRefresh.js +8 -8
- package/dist/hooks/useGetSizes.js +19 -19
- package/dist/hooks/useInvoiceNFTContract.js +64 -64
- package/dist/hooks/useMQ.js +14 -14
- package/dist/hooks/useMount.js +8 -8
- package/dist/hooks/useParamsSearch.js +6 -6
- package/dist/hooks/usePool.js +39 -39
- package/dist/hooks/usePoolContract.d.ts +74 -74
- package/dist/hooks/usePoolContract.js +287 -287
- package/dist/hooks/useRFPoolContract.d.ts +23 -23
- package/dist/hooks/useRFPoolContract.js +29 -29
- package/dist/hooks/useRefresh.js +47 -47
- package/dist/hooks/web3/index.d.ts +11 -11
- package/dist/hooks/web3/index.js +141 -141
- package/dist/hooks/web3/useConnectors.js +24 -24
- package/dist/hooks/web3/useJsonRpcUrlsMap.js +55 -55
- package/dist/index.js +5 -5
- package/dist/services/EAService.js +77 -77
- package/dist/services/IdentityService.d.ts +52 -52
- package/dist/services/IdentityService.js +80 -80
- package/dist/services/RNService.js +10 -10
- package/dist/services/index.js +3 -3
- package/dist/theme/breakpoints.d.ts +5 -0
- package/dist/theme/breakpoints.js +4 -0
- package/dist/theme/breakpoints.js.map +1 -0
- package/dist/theme/components.d.ts +6 -0
- package/dist/theme/components.js +62 -0
- package/dist/theme/components.js.map +1 -0
- package/dist/theme/coreThemeConstants.d.ts +18 -0
- package/dist/theme/coreThemeConstants.js +30 -0
- package/dist/theme/coreThemeConstants.js.map +1 -0
- package/dist/theme/cssMixins.d.ts +20 -0
- package/dist/theme/cssMixins.js +90 -0
- package/dist/theme/cssMixins.js.map +1 -0
- package/dist/theme/index.d.ts +8 -0
- package/dist/theme/index.js +27 -0
- package/dist/theme/index.js.map +1 -0
- package/dist/theme/palette.d.ts +53 -0
- package/dist/theme/palette.js +137 -0
- package/dist/theme/palette.js.map +1 -0
- package/dist/theme/shape.d.ts +2 -0
- package/dist/theme/shape.js +5 -0
- package/dist/theme/shape.js.map +1 -0
- package/dist/theme/theme.types.d.ts +72 -0
- package/dist/theme/theme.types.js +2 -0
- package/dist/theme/theme.types.js.map +1 -0
- package/dist/theme/typography.d.ts +2 -0
- package/dist/theme/typography.js +116 -0
- package/dist/theme/typography.js.map +1 -0
- package/dist/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/utils/JsonRpcConnector.js +38 -38
- package/dist/utils/WalletConnect.js +49 -49
- package/dist/utils/chain.d.ts +39 -39
- package/dist/utils/chain.js +118 -118
- package/dist/utils/common.js +10 -10
- package/dist/utils/config.d.ts +8 -8
- package/dist/utils/config.js +42 -42
- package/dist/utils/const.js +2 -2
- package/dist/utils/contractError.json +73 -73
- package/dist/utils/contractconfig.json +19 -19
- package/dist/utils/credit.js +37 -37
- package/dist/utils/ddLogger.d.ts +4 -0
- package/dist/utils/ddLogger.js +48 -0
- package/dist/utils/ddLogger.js.map +1 -0
- package/dist/utils/errors.js +39 -39
- package/dist/utils/index.d.ts +20 -20
- package/dist/utils/index.js +20 -20
- package/dist/utils/jsonRpcEndpoints.js +18 -18
- package/dist/utils/notifi.d.ts +4 -4
- package/dist/utils/notifi.js +36 -36
- package/dist/utils/number.d.ts +6 -6
- package/dist/utils/number.js +66 -66
- package/dist/utils/pool.d.ts +97 -96
- package/dist/utils/pool.js +395 -364
- package/dist/utils/pool.js.map +1 -1
- package/dist/utils/realWorldReceivable.d.ts +12 -12
- package/dist/utils/realWorldReceivable.js +1 -1
- package/dist/utils/request.js +38 -38
- package/dist/utils/scientificToDecimal.js +57 -57
- package/dist/utils/sentry.d.ts +1 -0
- package/dist/utils/sentry.js +19 -0
- package/dist/utils/sentry.js.map +1 -0
- package/dist/utils/storage.d.ts +12 -0
- package/dist/utils/storage.js +32 -0
- package/dist/utils/storage.js.map +1 -0
- package/dist/utils/string.js +1 -1
- package/dist/utils/style.js +12 -12
- package/dist/utils/time.js +50 -50
- package/dist/utils/transaction.js +87 -87
- package/dist/utils/web3.js +34 -34
- package/package.json +2 -2
|
@@ -1,73 +1,73 @@
|
|
|
1
|
-
{
|
|
2
|
-
"sameValue()": "0x0811ff09",
|
|
3
|
-
"zeroAddressProvided()": "0x5ff75ab0",
|
|
4
|
-
"zeroAmountProvided()": "0x71799f2a",
|
|
5
|
-
"amountTooLow()": "0x5b05bfbf",
|
|
6
|
-
"invalidBasisPointHigherThan10000()": "0x07982d85",
|
|
7
|
-
"withdrawnAmountHigherThanBalance()": "0x477c0ab2",
|
|
8
|
-
"permissionDeniedNotAdmin()": "0xf2c5b6a7",
|
|
9
|
-
"permissionDeniedNotLender()": "0x68299b20",
|
|
10
|
-
"evaluationAgentServiceAccountRequired()": "0x9b3b1ed6",
|
|
11
|
-
"paymentDetectionServiceAccountRequired()": "0x731b978f",
|
|
12
|
-
"notPoolOwner()": "0xd39208c9",
|
|
13
|
-
"notProtocolOwner()": "0x97924c20",
|
|
14
|
-
"notEvaluationAgent()": "0x66f7b8b7",
|
|
15
|
-
"notPauser()": "0xdcdea7c8",
|
|
16
|
-
"notPool()": "0x26d29bbf",
|
|
17
|
-
"defaultGracePeriodLessThanMinAllowed()": "0xa733ff9c",
|
|
18
|
-
"treasuryFeeHighThanUpperLimit()": "0x39cda0d1",
|
|
19
|
-
"alreadyAPauser()": "0x9f694c22",
|
|
20
|
-
"alreadyPoolAdmin()": "0x7bb356e2",
|
|
21
|
-
"minPrincipalPaymentRateSettingTooHigh()": "0xc11fc042",
|
|
22
|
-
"proposedEADoesNotOwnProvidedEANFT()": "0x75b0da3b",
|
|
23
|
-
"underlyingTokenNotApprovedForHumaProtocol()": "0xce179d6d",
|
|
24
|
-
"poolOwnerNotEnoughLiquidity()": "0xe95282e2",
|
|
25
|
-
"evaluationAgentNotEnoughLiquidity()": "0x67e26217",
|
|
26
|
-
"protocolIsPaused()": "0x8f6fa2d4",
|
|
27
|
-
"poolIsNotOn()": "0x69b355df",
|
|
28
|
-
"creditExpiredDueToFirstDrawdownTooLate()": "0x9fac7390",
|
|
29
|
-
"creditExpiredDueToMaturity()": "0xa52f3c3f",
|
|
30
|
-
"creditLineNotInGoodStandingState()": "0x96e79474",
|
|
31
|
-
"creditLineNotInStateForMakingPayment()": "0xf023e48b",
|
|
32
|
-
"creditLineNotInStateForDrawdown()": "0x4ff95a6d",
|
|
33
|
-
"creditLineExceeded()": "0xef7d66ff",
|
|
34
|
-
"creditLineAlreadyExists()": "0x6c5805f2",
|
|
35
|
-
"creditLineGreatThanUpperLimit()": "0xd8c27d2f",
|
|
36
|
-
"greaterThanMaxCreditLine()": "0x8a754ae8",
|
|
37
|
-
"requestedCreditWithZeroDuration()": "0xb16dd34d",
|
|
38
|
-
"onlyBorrowerOrEACanReduceCreditLine()": "0xd61dbe31",
|
|
39
|
-
"exceededPoolLiquidityCap()": "0x5642ebd4",
|
|
40
|
-
"receivableAssetMismatch()": "0x41dbeec1",
|
|
41
|
-
"unsupportedReceivableAsset()": "0xe60c383e",
|
|
42
|
-
"receivableAssetParamMismatch()": "0x1400a0b4",
|
|
43
|
-
"insufficientReceivableAmount()": "0xf7f34854",
|
|
44
|
-
"borrowingAmountLessThanPlatformFees()": "0x97fde118",
|
|
45
|
-
"withdrawTooSoon()": "0x67982472",
|
|
46
|
-
"paymentAlreadyProcessed()": "0xfd6754cf",
|
|
47
|
-
"defaultTriggeredTooEarly()": "0x7872424e",
|
|
48
|
-
"defaultHasAlreadyBeenTriggered()": "0xeb8d2ccc",
|
|
49
|
-
"notOperator()": "0xf67113fe",
|
|
50
|
-
"notPoolOwnerTreasury()": "0x325bf3c2",
|
|
51
|
-
"notPoolOwnerOrEA()": "0xd6ed9384",
|
|
52
|
-
"alreadyAnOperator()": "0x75cea0fc",
|
|
53
|
-
"poolOperatorRequired()": "0xdc2dc6d0",
|
|
54
|
-
"drawdownFunctionUsedInsteadOfDrawdownWithReceivable()": "0x7e737537",
|
|
55
|
-
"notNFTOwner()": "0x091a5762",
|
|
56
|
-
"creditLineNotInApprovedState()": "0xfc91a989",
|
|
57
|
-
"notPoolOwnerTreasuryOrEA()": "0xc74cb44c",
|
|
58
|
-
"paymentIdNotUnderReview()": "0xd1696aaa",
|
|
59
|
-
"creditLineTooHigh()": "0x552b8377",
|
|
60
|
-
"creditLineOutstanding()": "0xc64e338c",
|
|
61
|
-
"allowanceTooLow()": "0xcd8ef369",
|
|
62
|
-
"durationTooLong()": "0xf1dd53a8",
|
|
63
|
-
"invalidFlowrate()": "0xd06a9328",
|
|
64
|
-
"settlementTooSoon()": "0x0453e75e",
|
|
65
|
-
"onlySuperfluid()": "0x3f9cd1c2",
|
|
66
|
-
"borrowerMismatch()": "0x27d3e640",
|
|
67
|
-
"notProcessor()": "0x90409ca1",
|
|
68
|
-
"receivableIdMismatch()": "0x97be2b67",
|
|
69
|
-
"flowKeyMismatch()": "0x29d5a5f3",
|
|
70
|
-
"flowIsNotTerminated()": "0xe9c5922f",
|
|
71
|
-
"invalidSuperfluidCallback()": "0xd2747f83",
|
|
72
|
-
"invalidSuperfluidAction()": "0x2f2cd9e9"
|
|
73
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"sameValue()": "0x0811ff09",
|
|
3
|
+
"zeroAddressProvided()": "0x5ff75ab0",
|
|
4
|
+
"zeroAmountProvided()": "0x71799f2a",
|
|
5
|
+
"amountTooLow()": "0x5b05bfbf",
|
|
6
|
+
"invalidBasisPointHigherThan10000()": "0x07982d85",
|
|
7
|
+
"withdrawnAmountHigherThanBalance()": "0x477c0ab2",
|
|
8
|
+
"permissionDeniedNotAdmin()": "0xf2c5b6a7",
|
|
9
|
+
"permissionDeniedNotLender()": "0x68299b20",
|
|
10
|
+
"evaluationAgentServiceAccountRequired()": "0x9b3b1ed6",
|
|
11
|
+
"paymentDetectionServiceAccountRequired()": "0x731b978f",
|
|
12
|
+
"notPoolOwner()": "0xd39208c9",
|
|
13
|
+
"notProtocolOwner()": "0x97924c20",
|
|
14
|
+
"notEvaluationAgent()": "0x66f7b8b7",
|
|
15
|
+
"notPauser()": "0xdcdea7c8",
|
|
16
|
+
"notPool()": "0x26d29bbf",
|
|
17
|
+
"defaultGracePeriodLessThanMinAllowed()": "0xa733ff9c",
|
|
18
|
+
"treasuryFeeHighThanUpperLimit()": "0x39cda0d1",
|
|
19
|
+
"alreadyAPauser()": "0x9f694c22",
|
|
20
|
+
"alreadyPoolAdmin()": "0x7bb356e2",
|
|
21
|
+
"minPrincipalPaymentRateSettingTooHigh()": "0xc11fc042",
|
|
22
|
+
"proposedEADoesNotOwnProvidedEANFT()": "0x75b0da3b",
|
|
23
|
+
"underlyingTokenNotApprovedForHumaProtocol()": "0xce179d6d",
|
|
24
|
+
"poolOwnerNotEnoughLiquidity()": "0xe95282e2",
|
|
25
|
+
"evaluationAgentNotEnoughLiquidity()": "0x67e26217",
|
|
26
|
+
"protocolIsPaused()": "0x8f6fa2d4",
|
|
27
|
+
"poolIsNotOn()": "0x69b355df",
|
|
28
|
+
"creditExpiredDueToFirstDrawdownTooLate()": "0x9fac7390",
|
|
29
|
+
"creditExpiredDueToMaturity()": "0xa52f3c3f",
|
|
30
|
+
"creditLineNotInGoodStandingState()": "0x96e79474",
|
|
31
|
+
"creditLineNotInStateForMakingPayment()": "0xf023e48b",
|
|
32
|
+
"creditLineNotInStateForDrawdown()": "0x4ff95a6d",
|
|
33
|
+
"creditLineExceeded()": "0xef7d66ff",
|
|
34
|
+
"creditLineAlreadyExists()": "0x6c5805f2",
|
|
35
|
+
"creditLineGreatThanUpperLimit()": "0xd8c27d2f",
|
|
36
|
+
"greaterThanMaxCreditLine()": "0x8a754ae8",
|
|
37
|
+
"requestedCreditWithZeroDuration()": "0xb16dd34d",
|
|
38
|
+
"onlyBorrowerOrEACanReduceCreditLine()": "0xd61dbe31",
|
|
39
|
+
"exceededPoolLiquidityCap()": "0x5642ebd4",
|
|
40
|
+
"receivableAssetMismatch()": "0x41dbeec1",
|
|
41
|
+
"unsupportedReceivableAsset()": "0xe60c383e",
|
|
42
|
+
"receivableAssetParamMismatch()": "0x1400a0b4",
|
|
43
|
+
"insufficientReceivableAmount()": "0xf7f34854",
|
|
44
|
+
"borrowingAmountLessThanPlatformFees()": "0x97fde118",
|
|
45
|
+
"withdrawTooSoon()": "0x67982472",
|
|
46
|
+
"paymentAlreadyProcessed()": "0xfd6754cf",
|
|
47
|
+
"defaultTriggeredTooEarly()": "0x7872424e",
|
|
48
|
+
"defaultHasAlreadyBeenTriggered()": "0xeb8d2ccc",
|
|
49
|
+
"notOperator()": "0xf67113fe",
|
|
50
|
+
"notPoolOwnerTreasury()": "0x325bf3c2",
|
|
51
|
+
"notPoolOwnerOrEA()": "0xd6ed9384",
|
|
52
|
+
"alreadyAnOperator()": "0x75cea0fc",
|
|
53
|
+
"poolOperatorRequired()": "0xdc2dc6d0",
|
|
54
|
+
"drawdownFunctionUsedInsteadOfDrawdownWithReceivable()": "0x7e737537",
|
|
55
|
+
"notNFTOwner()": "0x091a5762",
|
|
56
|
+
"creditLineNotInApprovedState()": "0xfc91a989",
|
|
57
|
+
"notPoolOwnerTreasuryOrEA()": "0xc74cb44c",
|
|
58
|
+
"paymentIdNotUnderReview()": "0xd1696aaa",
|
|
59
|
+
"creditLineTooHigh()": "0x552b8377",
|
|
60
|
+
"creditLineOutstanding()": "0xc64e338c",
|
|
61
|
+
"allowanceTooLow()": "0xcd8ef369",
|
|
62
|
+
"durationTooLong()": "0xf1dd53a8",
|
|
63
|
+
"invalidFlowrate()": "0xd06a9328",
|
|
64
|
+
"settlementTooSoon()": "0x0453e75e",
|
|
65
|
+
"onlySuperfluid()": "0x3f9cd1c2",
|
|
66
|
+
"borrowerMismatch()": "0x27d3e640",
|
|
67
|
+
"notProcessor()": "0x90409ca1",
|
|
68
|
+
"receivableIdMismatch()": "0x97be2b67",
|
|
69
|
+
"flowKeyMismatch()": "0x29d5a5f3",
|
|
70
|
+
"flowIsNotTerminated()": "0xe9c5922f",
|
|
71
|
+
"invalidSuperfluidCallback()": "0xd2747f83",
|
|
72
|
+
"invalidSuperfluidAction()": "0x2f2cd9e9"
|
|
73
|
+
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
{
|
|
2
|
-
"USDC": "0xfc250A60925522F8b31613f72A948d65a4738531",
|
|
3
|
-
"HumaConfig": "0x10cdD6088b2fA39C12Cc3f7A68a1F64C77bf9E67",
|
|
4
|
-
"HumaConfigTimelock": "0x2840E8F48d8779f919906e932740B2905Ff34696",
|
|
5
|
-
"ReceivableFactoringPoolFeeManager": "0xe91234f3D3d78CcAAc4DC98705660F05e85B53b9",
|
|
6
|
-
"HDTImpl": "0x19388Fd43b7D9aD2C2781B4cD769dDbb7313D2b8",
|
|
7
|
-
"HDT": "0x5e21D8658DD5FF455E0Ca4e56Dab50C2be6cb8e3",
|
|
8
|
-
"ReceivableFactoringPoolConfig": "0xfAD713Fb86Eb7CdE1FA9fA9bcDe4bb183D250F61",
|
|
9
|
-
"ReceivableFactoringPoolImpl": "0x4504595c5E41833Cc26a2D67af75012c49f302A6",
|
|
10
|
-
"ReceivableFactoringPool": "0xf3B4E8b420836e8817459B9fB026eb1C93495323",
|
|
11
|
-
"EANFT": "0x481c8c2a77334e44F9a59df9952227b43f69A8cD",
|
|
12
|
-
"RNNFT": "0xf5029F30266fB1f22a7d764E4B55267792aF4d4b",
|
|
13
|
-
"BaseCreditPoolFeeManager": "0xeA671d5845A8E0904F20923398dAf550a5eBAa21",
|
|
14
|
-
"BaseCreditHDTImpl": "0x19f515C69Fa770AE5cc9C131e64961751566e834",
|
|
15
|
-
"BaseCreditHDT": "0xDE7252A1EA5dA3e6F8622A80FeD8dEc0D7b5267F",
|
|
16
|
-
"BaseCreditPoolConfig": "0x5467459Aed45bDAD23035393F54a4790E38d3E48",
|
|
17
|
-
"BaseCreditPoolImpl": "0x22Cf9Af7A368d79Fcb182CE71e8C5e174dFD546e",
|
|
18
|
-
"BaseCreditPool": "0xf8CA32C0A0C369a767258C9956C7A7762B6D66cE"
|
|
19
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"USDC": "0xfc250A60925522F8b31613f72A948d65a4738531",
|
|
3
|
+
"HumaConfig": "0x10cdD6088b2fA39C12Cc3f7A68a1F64C77bf9E67",
|
|
4
|
+
"HumaConfigTimelock": "0x2840E8F48d8779f919906e932740B2905Ff34696",
|
|
5
|
+
"ReceivableFactoringPoolFeeManager": "0xe91234f3D3d78CcAAc4DC98705660F05e85B53b9",
|
|
6
|
+
"HDTImpl": "0x19388Fd43b7D9aD2C2781B4cD769dDbb7313D2b8",
|
|
7
|
+
"HDT": "0x5e21D8658DD5FF455E0Ca4e56Dab50C2be6cb8e3",
|
|
8
|
+
"ReceivableFactoringPoolConfig": "0xfAD713Fb86Eb7CdE1FA9fA9bcDe4bb183D250F61",
|
|
9
|
+
"ReceivableFactoringPoolImpl": "0x4504595c5E41833Cc26a2D67af75012c49f302A6",
|
|
10
|
+
"ReceivableFactoringPool": "0xf3B4E8b420836e8817459B9fB026eb1C93495323",
|
|
11
|
+
"EANFT": "0x481c8c2a77334e44F9a59df9952227b43f69A8cD",
|
|
12
|
+
"RNNFT": "0xf5029F30266fB1f22a7d764E4B55267792aF4d4b",
|
|
13
|
+
"BaseCreditPoolFeeManager": "0xeA671d5845A8E0904F20923398dAf550a5eBAa21",
|
|
14
|
+
"BaseCreditHDTImpl": "0x19f515C69Fa770AE5cc9C131e64961751566e834",
|
|
15
|
+
"BaseCreditHDT": "0xDE7252A1EA5dA3e6F8622A80FeD8dEc0D7b5267F",
|
|
16
|
+
"BaseCreditPoolConfig": "0x5467459Aed45bDAD23035393F54a4790E38d3E48",
|
|
17
|
+
"BaseCreditPoolImpl": "0x22Cf9Af7A368d79Fcb182CE71e8C5e174dFD546e",
|
|
18
|
+
"BaseCreditPool": "0xf8CA32C0A0C369a767258C9956C7A7762B6D66cE"
|
|
19
|
+
}
|
package/dist/utils/credit.js
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
export var CreditState;
|
|
2
|
-
(function (CreditState) {
|
|
3
|
-
CreditState[CreditState["Deleted"] = 0] = "Deleted";
|
|
4
|
-
CreditState[CreditState["Requested"] = 1] = "Requested";
|
|
5
|
-
CreditState[CreditState["Approved"] = 2] = "Approved";
|
|
6
|
-
CreditState[CreditState["GoodStanding"] = 3] = "GoodStanding";
|
|
7
|
-
CreditState[CreditState["Delayed"] = 4] = "Delayed";
|
|
8
|
-
CreditState[CreditState["Defaulted"] = 5] = "Defaulted";
|
|
9
|
-
})(CreditState || (CreditState = {}));
|
|
10
|
-
export const hasRFActiveLoan = (creditRecord, receivableInfo) => {
|
|
11
|
-
if (creditRecord === undefined || receivableInfo === undefined) {
|
|
12
|
-
return false;
|
|
13
|
-
}
|
|
14
|
-
let accountHasActiveLoan = creditRecord.state >= CreditState.GoodStanding &&
|
|
15
|
-
receivableInfo.receivableParam.gt(0);
|
|
16
|
-
if (accountHasActiveLoan && creditRecord.state === CreditState.Approved) {
|
|
17
|
-
accountHasActiveLoan = false;
|
|
18
|
-
}
|
|
19
|
-
return accountHasActiveLoan;
|
|
20
|
-
};
|
|
21
|
-
export var CreditEvent;
|
|
22
|
-
(function (CreditEvent) {
|
|
23
|
-
CreditEvent[CreditEvent["LiquidityDeposited"] = 0] = "LiquidityDeposited";
|
|
24
|
-
CreditEvent[CreditEvent["LiquidityWithdrawn"] = 1] = "LiquidityWithdrawn";
|
|
25
|
-
CreditEvent[CreditEvent["DrawdownMade"] = 2] = "DrawdownMade";
|
|
26
|
-
CreditEvent[CreditEvent["DrawdownMadeWithReceivable"] = 3] = "DrawdownMadeWithReceivable";
|
|
27
|
-
CreditEvent[CreditEvent["PaymentMade"] = 4] = "PaymentMade";
|
|
28
|
-
CreditEvent[CreditEvent["ReceivedPaymentProcessed"] = 5] = "ReceivedPaymentProcessed";
|
|
29
|
-
})(CreditEvent || (CreditEvent = {}));
|
|
30
|
-
export const CreditEventText = {
|
|
31
|
-
[String(CreditEvent.DrawdownMade)]: 'Borrow',
|
|
32
|
-
[String(CreditEvent.DrawdownMadeWithReceivable)]: 'Factoring',
|
|
33
|
-
[String(CreditEvent.PaymentMade)]: 'Pay',
|
|
34
|
-
[String(CreditEvent.ReceivedPaymentProcessed)]: 'Pay',
|
|
35
|
-
[String(CreditEvent.LiquidityDeposited)]: 'Supply',
|
|
36
|
-
[String(CreditEvent.LiquidityWithdrawn)]: 'Withdraw',
|
|
37
|
-
};
|
|
1
|
+
export var CreditState;
|
|
2
|
+
(function (CreditState) {
|
|
3
|
+
CreditState[CreditState["Deleted"] = 0] = "Deleted";
|
|
4
|
+
CreditState[CreditState["Requested"] = 1] = "Requested";
|
|
5
|
+
CreditState[CreditState["Approved"] = 2] = "Approved";
|
|
6
|
+
CreditState[CreditState["GoodStanding"] = 3] = "GoodStanding";
|
|
7
|
+
CreditState[CreditState["Delayed"] = 4] = "Delayed";
|
|
8
|
+
CreditState[CreditState["Defaulted"] = 5] = "Defaulted";
|
|
9
|
+
})(CreditState || (CreditState = {}));
|
|
10
|
+
export const hasRFActiveLoan = (creditRecord, receivableInfo) => {
|
|
11
|
+
if (creditRecord === undefined || receivableInfo === undefined) {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
let accountHasActiveLoan = creditRecord.state >= CreditState.GoodStanding &&
|
|
15
|
+
receivableInfo.receivableParam.gt(0);
|
|
16
|
+
if (accountHasActiveLoan && creditRecord.state === CreditState.Approved) {
|
|
17
|
+
accountHasActiveLoan = false;
|
|
18
|
+
}
|
|
19
|
+
return accountHasActiveLoan;
|
|
20
|
+
};
|
|
21
|
+
export var CreditEvent;
|
|
22
|
+
(function (CreditEvent) {
|
|
23
|
+
CreditEvent[CreditEvent["LiquidityDeposited"] = 0] = "LiquidityDeposited";
|
|
24
|
+
CreditEvent[CreditEvent["LiquidityWithdrawn"] = 1] = "LiquidityWithdrawn";
|
|
25
|
+
CreditEvent[CreditEvent["DrawdownMade"] = 2] = "DrawdownMade";
|
|
26
|
+
CreditEvent[CreditEvent["DrawdownMadeWithReceivable"] = 3] = "DrawdownMadeWithReceivable";
|
|
27
|
+
CreditEvent[CreditEvent["PaymentMade"] = 4] = "PaymentMade";
|
|
28
|
+
CreditEvent[CreditEvent["ReceivedPaymentProcessed"] = 5] = "ReceivedPaymentProcessed";
|
|
29
|
+
})(CreditEvent || (CreditEvent = {}));
|
|
30
|
+
export const CreditEventText = {
|
|
31
|
+
[String(CreditEvent.DrawdownMade)]: 'Borrow',
|
|
32
|
+
[String(CreditEvent.DrawdownMadeWithReceivable)]: 'Factoring',
|
|
33
|
+
[String(CreditEvent.PaymentMade)]: 'Pay',
|
|
34
|
+
[String(CreditEvent.ReceivedPaymentProcessed)]: 'Pay',
|
|
35
|
+
[String(CreditEvent.LiquidityDeposited)]: 'Supply',
|
|
36
|
+
[String(CreditEvent.LiquidityWithdrawn)]: 'Withdraw',
|
|
37
|
+
};
|
|
38
38
|
//# sourceMappingURL=credit.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const initRUMLogger: () => void;
|
|
2
|
+
export declare const logError: (err: any, context?: Object) => void;
|
|
3
|
+
export declare const logAction: (action: string, context?: Object) => void;
|
|
4
|
+
export declare const ddSetUserWalletInfo: (account: string | undefined, chainId: number | undefined) => void;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { datadogRum } from '@datadog/browser-rum';
|
|
2
|
+
import { CHAINS } from './chain';
|
|
3
|
+
const ddLoggerEnabled = window.REACT_APP_DATADOG_APPLICATION_ID &&
|
|
4
|
+
window.REACT_APP_DATADOG_CLIENT_TOKEN;
|
|
5
|
+
export const initRUMLogger = () => {
|
|
6
|
+
if (ddLoggerEnabled) {
|
|
7
|
+
datadogRum.init({
|
|
8
|
+
applicationId: window.REACT_APP_DATADOG_APPLICATION_ID,
|
|
9
|
+
clientToken: window.REACT_APP_DATADOG_CLIENT_TOKEN,
|
|
10
|
+
site: 'datadoghq.com',
|
|
11
|
+
service: 'huma-dapp',
|
|
12
|
+
env: 'production',
|
|
13
|
+
version: '1.0.0',
|
|
14
|
+
sessionSampleRate: 100,
|
|
15
|
+
sessionReplaySampleRate: 20,
|
|
16
|
+
trackUserInteractions: true,
|
|
17
|
+
trackResources: true,
|
|
18
|
+
trackLongTasks: true,
|
|
19
|
+
defaultPrivacyLevel: 'mask-user-input',
|
|
20
|
+
});
|
|
21
|
+
datadogRum.startSessionReplayRecording();
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
25
|
+
export const logError = (err, context) => {
|
|
26
|
+
if (ddLoggerEnabled) {
|
|
27
|
+
datadogRum.addError(err, Object.assign({}, context));
|
|
28
|
+
}
|
|
29
|
+
console.error(err);
|
|
30
|
+
};
|
|
31
|
+
export const logAction = (action, context) => {
|
|
32
|
+
if (ddLoggerEnabled) {
|
|
33
|
+
datadogRum.addAction(action, Object.assign({}, context));
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
export const ddSetUserWalletInfo = (account, chainId) => {
|
|
37
|
+
var _a;
|
|
38
|
+
if (ddLoggerEnabled) {
|
|
39
|
+
if (account) {
|
|
40
|
+
datadogRum.setUserProperty('id', account);
|
|
41
|
+
datadogRum.setUserProperty('account', account);
|
|
42
|
+
}
|
|
43
|
+
if (chainId) {
|
|
44
|
+
datadogRum.setUserProperty('network', (_a = CHAINS[chainId]) === null || _a === void 0 ? void 0 : _a.name);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=ddLogger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ddLogger.js","sourceRoot":"","sources":["../../src/utils/ddLogger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAEhC,MAAM,eAAe,GACnB,MAAM,CAAC,gCAAgC;IACvC,MAAM,CAAC,8BAA8B,CAAA;AAEvC,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,EAAE;IAChC,IAAI,eAAe,EAAE;QACnB,UAAU,CAAC,IAAI,CAAC;YACd,aAAa,EAAE,MAAM,CAAC,gCAAiC;YACvD,WAAW,EAAE,MAAM,CAAC,8BAA+B;YACnD,IAAI,EAAE,eAAe;YACrB,OAAO,EAAE,WAAW;YACpB,GAAG,EAAE,YAAY;YACjB,OAAO,EAAE,OAAO;YAChB,iBAAiB,EAAE,GAAG;YACtB,uBAAuB,EAAE,EAAE;YAC3B,qBAAqB,EAAE,IAAI;YAC3B,cAAc,EAAE,IAAI;YACpB,cAAc,EAAE,IAAI;YACpB,mBAAmB,EAAE,iBAAiB;SACvC,CAAC,CAAA;QACF,UAAU,CAAC,2BAA2B,EAAE,CAAA;KACzC;AACH,CAAC,CAAA;AAED,8DAA8D;AAC9D,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,GAAQ,EAAE,OAAgB,EAAE,EAAE;IACrD,IAAI,eAAe,EAAE;QACnB,UAAU,CAAC,QAAQ,CAAC,GAAG,oBAAO,OAAO,EAAG,CAAA;KACzC;IACD,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;AACpB,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,MAAc,EAAE,OAAgB,EAAE,EAAE;IAC5D,IAAI,eAAe,EAAE;QACnB,UAAU,CAAC,SAAS,CAAC,MAAM,oBAAO,OAAO,EAAG,CAAA;KAC7C;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAG,CACjC,OAA2B,EAC3B,OAA2B,EAC3B,EAAE;;IACF,IAAI,eAAe,EAAE;QACnB,IAAI,OAAO,EAAE;YACX,UAAU,CAAC,eAAe,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;YACzC,UAAU,CAAC,eAAe,CAAC,SAAS,EAAE,OAAO,CAAC,CAAA;SAC/C;QACD,IAAI,OAAO,EAAE;YACX,UAAU,CAAC,eAAe,CAAC,SAAS,EAAE,MAAA,MAAM,CAAC,OAAO,CAAC,0CAAE,IAAI,CAAC,CAAA;SAC7D;KACF;AACH,CAAC,CAAA"}
|
package/dist/utils/errors.js
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
/* eslint-disable max-classes-per-file */
|
|
2
|
-
import { EARejectMessage } from './const';
|
|
3
|
-
export const DEFAULT_ERROR_HEADER = `Please refresh the page and try again.`;
|
|
4
|
-
export const DEFAULT_ERROR_ACTION = `Reload the page`;
|
|
5
|
-
export class WidgetError extends Error {
|
|
6
|
-
constructor(config) {
|
|
7
|
-
var _a, _b;
|
|
8
|
-
super(config.message);
|
|
9
|
-
this.dismissable = false;
|
|
10
|
-
this.header = (_a = config.header) !== null && _a !== void 0 ? _a : DEFAULT_ERROR_HEADER;
|
|
11
|
-
this.action = (_b = config.action) !== null && _b !== void 0 ? _b : DEFAULT_ERROR_ACTION;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
export class IntegrationError extends WidgetError {
|
|
15
|
-
constructor(message) {
|
|
16
|
-
super({ message });
|
|
17
|
-
this.name = 'IntegrationError';
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
class ConnectionError extends WidgetError {
|
|
21
|
-
constructor(config) {
|
|
22
|
-
super(config);
|
|
23
|
-
this.name = 'ConnectionError';
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
export class MetaMaskConnectionError extends ConnectionError {
|
|
27
|
-
constructor() {
|
|
28
|
-
super({
|
|
29
|
-
header: `Wallet disconnected`,
|
|
30
|
-
action: `Reload`,
|
|
31
|
-
message: `'A Metamask error caused your wallet to disconnect. Reload the page to reconnect.'`,
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
export class EARejectionError extends Error {
|
|
36
|
-
constructor() {
|
|
37
|
-
super(EARejectMessage);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
1
|
+
/* eslint-disable max-classes-per-file */
|
|
2
|
+
import { EARejectMessage } from './const';
|
|
3
|
+
export const DEFAULT_ERROR_HEADER = `Please refresh the page and try again.`;
|
|
4
|
+
export const DEFAULT_ERROR_ACTION = `Reload the page`;
|
|
5
|
+
export class WidgetError extends Error {
|
|
6
|
+
constructor(config) {
|
|
7
|
+
var _a, _b;
|
|
8
|
+
super(config.message);
|
|
9
|
+
this.dismissable = false;
|
|
10
|
+
this.header = (_a = config.header) !== null && _a !== void 0 ? _a : DEFAULT_ERROR_HEADER;
|
|
11
|
+
this.action = (_b = config.action) !== null && _b !== void 0 ? _b : DEFAULT_ERROR_ACTION;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export class IntegrationError extends WidgetError {
|
|
15
|
+
constructor(message) {
|
|
16
|
+
super({ message });
|
|
17
|
+
this.name = 'IntegrationError';
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
class ConnectionError extends WidgetError {
|
|
21
|
+
constructor(config) {
|
|
22
|
+
super(config);
|
|
23
|
+
this.name = 'ConnectionError';
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export class MetaMaskConnectionError extends ConnectionError {
|
|
27
|
+
constructor() {
|
|
28
|
+
super({
|
|
29
|
+
header: `Wallet disconnected`,
|
|
30
|
+
action: `Reload`,
|
|
31
|
+
message: `'A Metamask error caused your wallet to disconnect. Reload the page to reconnect.'`,
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
export class EARejectionError extends Error {
|
|
36
|
+
constructor() {
|
|
37
|
+
super(EARejectMessage);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
40
|
//# sourceMappingURL=errors.js.map
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
export * from './JsonRpcConnector';
|
|
2
|
-
export * from './WalletConnect';
|
|
3
|
-
export * from './chain';
|
|
4
|
-
export * from './common';
|
|
5
|
-
export * from './config';
|
|
6
|
-
export * from './const';
|
|
7
|
-
export * from './credit';
|
|
8
|
-
export * from './errors';
|
|
9
|
-
export * from './jsonRpcEndpoints';
|
|
10
|
-
export * from './number';
|
|
11
|
-
export * from './pool';
|
|
12
|
-
export * from './request';
|
|
13
|
-
export * from './scientificToDecimal';
|
|
14
|
-
export * from './string';
|
|
15
|
-
export * from './style';
|
|
16
|
-
export * from './time';
|
|
17
|
-
export * from './transaction';
|
|
18
|
-
export * from './web3';
|
|
19
|
-
export * from './notifi';
|
|
20
|
-
export * from './realWorldReceivable';
|
|
1
|
+
export * from './JsonRpcConnector';
|
|
2
|
+
export * from './WalletConnect';
|
|
3
|
+
export * from './chain';
|
|
4
|
+
export * from './common';
|
|
5
|
+
export * from './config';
|
|
6
|
+
export * from './const';
|
|
7
|
+
export * from './credit';
|
|
8
|
+
export * from './errors';
|
|
9
|
+
export * from './jsonRpcEndpoints';
|
|
10
|
+
export * from './number';
|
|
11
|
+
export * from './pool';
|
|
12
|
+
export * from './request';
|
|
13
|
+
export * from './scientificToDecimal';
|
|
14
|
+
export * from './string';
|
|
15
|
+
export * from './style';
|
|
16
|
+
export * from './time';
|
|
17
|
+
export * from './transaction';
|
|
18
|
+
export * from './web3';
|
|
19
|
+
export * from './notifi';
|
|
20
|
+
export * from './realWorldReceivable';
|
package/dist/utils/index.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
export * from './JsonRpcConnector';
|
|
2
|
-
export * from './WalletConnect';
|
|
3
|
-
export * from './chain';
|
|
4
|
-
export * from './common';
|
|
5
|
-
export * from './config';
|
|
6
|
-
export * from './const';
|
|
7
|
-
export * from './credit';
|
|
8
|
-
export * from './errors';
|
|
9
|
-
export * from './jsonRpcEndpoints';
|
|
10
|
-
export * from './number';
|
|
11
|
-
export * from './pool';
|
|
12
|
-
export * from './request';
|
|
13
|
-
export * from './scientificToDecimal';
|
|
14
|
-
export * from './string';
|
|
15
|
-
export * from './style';
|
|
16
|
-
export * from './time';
|
|
17
|
-
export * from './transaction';
|
|
18
|
-
export * from './web3';
|
|
19
|
-
export * from './notifi';
|
|
20
|
-
export * from './realWorldReceivable';
|
|
1
|
+
export * from './JsonRpcConnector';
|
|
2
|
+
export * from './WalletConnect';
|
|
3
|
+
export * from './chain';
|
|
4
|
+
export * from './common';
|
|
5
|
+
export * from './config';
|
|
6
|
+
export * from './const';
|
|
7
|
+
export * from './credit';
|
|
8
|
+
export * from './errors';
|
|
9
|
+
export * from './jsonRpcEndpoints';
|
|
10
|
+
export * from './number';
|
|
11
|
+
export * from './pool';
|
|
12
|
+
export * from './request';
|
|
13
|
+
export * from './scientificToDecimal';
|
|
14
|
+
export * from './string';
|
|
15
|
+
export * from './style';
|
|
16
|
+
export * from './time';
|
|
17
|
+
export * from './transaction';
|
|
18
|
+
export * from './web3';
|
|
19
|
+
export * from './notifi';
|
|
20
|
+
export * from './realWorldReceivable';
|
|
21
21
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { ChainEnum } from './chain';
|
|
2
|
-
/**
|
|
3
|
-
* Fallback JSON RPC endpoints.
|
|
4
|
-
* These are used if the integrator does not provide an endpoint, or if the endpoint does not work.
|
|
5
|
-
*
|
|
6
|
-
* MetaMask allows switching to any URL, but displays a warning if it is not on the "Safe" list:
|
|
7
|
-
* https://github.com/MetaMask/metamask-mobile/blob/bdb7f37c90e4fc923881a07fca38d4e77c73a579/app/core/RPCMethods/wallet_addEthereumChain.js#L228-L235
|
|
8
|
-
* https://chainid.network/chains.json
|
|
9
|
-
*
|
|
10
|
-
* These "Safe" URLs are listed first, followed by other fallback URLs, which are taken from chainlist.org.
|
|
11
|
-
*/
|
|
12
|
-
export const JSON_RPC_FALLBACK_ENDPOINTS = {
|
|
13
|
-
[ChainEnum.Goerli]: ['https://rpc.ankr.com/eth_goerli'],
|
|
14
|
-
[ChainEnum.Mumbai]: ['https://rpc.ankr.com/polygon_mumbai'],
|
|
15
|
-
[ChainEnum.Polygon]: ['https://polygon-rpc.com/'],
|
|
16
|
-
[ChainEnum.Alfajores]: ['https://alfajores-forno.celo-testnet.org'],
|
|
17
|
-
[ChainEnum.Celo]: ['https://rpc.ankr.com/celo'],
|
|
18
|
-
};
|
|
1
|
+
import { ChainEnum } from './chain';
|
|
2
|
+
/**
|
|
3
|
+
* Fallback JSON RPC endpoints.
|
|
4
|
+
* These are used if the integrator does not provide an endpoint, or if the endpoint does not work.
|
|
5
|
+
*
|
|
6
|
+
* MetaMask allows switching to any URL, but displays a warning if it is not on the "Safe" list:
|
|
7
|
+
* https://github.com/MetaMask/metamask-mobile/blob/bdb7f37c90e4fc923881a07fca38d4e77c73a579/app/core/RPCMethods/wallet_addEthereumChain.js#L228-L235
|
|
8
|
+
* https://chainid.network/chains.json
|
|
9
|
+
*
|
|
10
|
+
* These "Safe" URLs are listed first, followed by other fallback URLs, which are taken from chainlist.org.
|
|
11
|
+
*/
|
|
12
|
+
export const JSON_RPC_FALLBACK_ENDPOINTS = {
|
|
13
|
+
[ChainEnum.Goerli]: ['https://rpc.ankr.com/eth_goerli'],
|
|
14
|
+
[ChainEnum.Mumbai]: ['https://rpc.ankr.com/polygon_mumbai'],
|
|
15
|
+
[ChainEnum.Polygon]: ['https://polygon-rpc.com/'],
|
|
16
|
+
[ChainEnum.Alfajores]: ['https://alfajores-forno.celo-testnet.org'],
|
|
17
|
+
[ChainEnum.Celo]: ['https://rpc.ankr.com/celo'],
|
|
18
|
+
};
|
|
19
19
|
//# sourceMappingURL=jsonRpcEndpoints.js.map
|
package/dist/utils/notifi.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChainEnum } from './chain';
|
|
2
|
-
export declare function getNotifiDappId(isDev: boolean): string;
|
|
3
|
-
export declare function getBlockchainConfigFromChain(chainEnum: ChainEnum): 'POLYGON' | 'ETHEREUM';
|
|
4
|
-
export declare function doesChainSupportNotifi(chainEnum: ChainEnum, isDev: boolean, account: string): boolean;
|
|
1
|
+
import { ChainEnum } from './chain';
|
|
2
|
+
export declare function getNotifiDappId(isDev: boolean): string;
|
|
3
|
+
export declare function getBlockchainConfigFromChain(chainEnum: ChainEnum): 'POLYGON' | 'ETHEREUM';
|
|
4
|
+
export declare function doesChainSupportNotifi(chainEnum: ChainEnum, isDev: boolean, account: string): boolean;
|
package/dist/utils/notifi.js
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import { ChainEnum } from './chain';
|
|
2
|
-
export function getNotifiDappId(isDev) {
|
|
3
|
-
return isDev ? 'humadapp' : 'humafinanceprod';
|
|
4
|
-
}
|
|
5
|
-
export function getBlockchainConfigFromChain(chainEnum) {
|
|
6
|
-
switch (chainEnum) {
|
|
7
|
-
case ChainEnum.Polygon:
|
|
8
|
-
case ChainEnum.Mumbai:
|
|
9
|
-
return 'POLYGON';
|
|
10
|
-
case ChainEnum.Goerli:
|
|
11
|
-
return 'ETHEREUM';
|
|
12
|
-
default:
|
|
13
|
-
throw new Error('Invalid chain');
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
export function doesChainSupportNotifi(chainEnum, isDev, account) {
|
|
17
|
-
switch (chainEnum) {
|
|
18
|
-
case ChainEnum.Polygon:
|
|
19
|
-
return true;
|
|
20
|
-
case ChainEnum.Mumbai:
|
|
21
|
-
case ChainEnum.Goerli:
|
|
22
|
-
return (isDev ||
|
|
23
|
-
[
|
|
24
|
-
'0x1fA2bE830cCb0f6930b9095559C25f64DD6A2146',
|
|
25
|
-
'0xE0Dc47a5735F784972EBD2E6662B62cc37929A63',
|
|
26
|
-
'0xdA8241Ee675D9f7d40fefcFC29E749d970C44c17',
|
|
27
|
-
'0x808E2154028cA8623E2704119df0aE8e39D87a8E',
|
|
28
|
-
'0xEf9a89cd4169b71CCD867dc7d374247F6F3Ed8F3',
|
|
29
|
-
'0xCb269B3A441b8cb95dEa7d803e8Ff5Fbd3154D65',
|
|
30
|
-
]
|
|
31
|
-
.map((address) => address.toLowerCase())
|
|
32
|
-
.includes(account.toLowerCase()));
|
|
33
|
-
default:
|
|
34
|
-
return false;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
1
|
+
import { ChainEnum } from './chain';
|
|
2
|
+
export function getNotifiDappId(isDev) {
|
|
3
|
+
return isDev ? 'humadapp' : 'humafinanceprod';
|
|
4
|
+
}
|
|
5
|
+
export function getBlockchainConfigFromChain(chainEnum) {
|
|
6
|
+
switch (chainEnum) {
|
|
7
|
+
case ChainEnum.Polygon:
|
|
8
|
+
case ChainEnum.Mumbai:
|
|
9
|
+
return 'POLYGON';
|
|
10
|
+
case ChainEnum.Goerli:
|
|
11
|
+
return 'ETHEREUM';
|
|
12
|
+
default:
|
|
13
|
+
throw new Error('Invalid chain');
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
export function doesChainSupportNotifi(chainEnum, isDev, account) {
|
|
17
|
+
switch (chainEnum) {
|
|
18
|
+
case ChainEnum.Polygon:
|
|
19
|
+
return true;
|
|
20
|
+
case ChainEnum.Mumbai:
|
|
21
|
+
case ChainEnum.Goerli:
|
|
22
|
+
return (isDev ||
|
|
23
|
+
[
|
|
24
|
+
'0x1fA2bE830cCb0f6930b9095559C25f64DD6A2146',
|
|
25
|
+
'0xE0Dc47a5735F784972EBD2E6662B62cc37929A63',
|
|
26
|
+
'0xdA8241Ee675D9f7d40fefcFC29E749d970C44c17',
|
|
27
|
+
'0x808E2154028cA8623E2704119df0aE8e39D87a8E',
|
|
28
|
+
'0xEf9a89cd4169b71CCD867dc7d374247F6F3Ed8F3',
|
|
29
|
+
'0xCb269B3A441b8cb95dEa7d803e8Ff5Fbd3154D65',
|
|
30
|
+
]
|
|
31
|
+
.map((address) => address.toLowerCase())
|
|
32
|
+
.includes(account.toLowerCase()));
|
|
33
|
+
default:
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
37
|
//# sourceMappingURL=notifi.js.map
|
package/dist/utils/number.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { BigNumber } from 'ethers';
|
|
2
|
-
export declare const formatMoney: (num: number | string | undefined) => string | number | undefined;
|
|
3
|
-
export declare const formatNumber: (num: number | string | undefined) => string | number | undefined;
|
|
4
|
-
export declare const downScale: <T = string>(num: string | number | BigNumber, decimals?: number) => T;
|
|
5
|
-
export declare const upScale: <T = string>(num: string | number, decimals?: number) => T;
|
|
6
|
-
export declare const toBigNumber: (num: string | number) => BigNumber;
|
|
1
|
+
import { BigNumber } from 'ethers';
|
|
2
|
+
export declare const formatMoney: (num: number | string | undefined) => string | number | undefined;
|
|
3
|
+
export declare const formatNumber: (num: number | string | undefined) => string | number | undefined;
|
|
4
|
+
export declare const downScale: <T = string>(num: string | number | BigNumber, decimals?: number) => T;
|
|
5
|
+
export declare const upScale: <T = string>(num: string | number, decimals?: number) => T;
|
|
6
|
+
export declare const toBigNumber: (num: string | number) => BigNumber;
|