@huma-finance/shared 0.0.21 → 0.0.24
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 +46 -46
- package/dist/abis/BaseCreditPool.json +1179 -1179
- package/dist/abis/BaseFeeManager.json +480 -480
- package/dist/abis/BasePoolConfig.json +1364 -1364
- package/dist/abis/ERC20TransferableReceivable.json +648 -648
- 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 +117 -117
- package/dist/abis/erc2612.json +132 -132
- package/dist/abis/erc721.json +673 -673
- package/dist/abis/index.d.ts +3 -3
- package/dist/abis/index.js +3 -3
- package/dist/abis/types/BaseCreditPool.d.ts +803 -803
- package/dist/abis/types/BaseCreditPool.js +1 -1
- package/dist/abis/types/BaseFeeManager.d.ts +408 -408
- package/dist/abis/types/BaseFeeManager.js +1 -1
- package/dist/abis/types/BasePoolConfig.d.ts +1097 -1097
- package/dist/abis/types/BasePoolConfig.js +1 -1
- package/dist/abis/types/ERC20TransferableReceivable.d.ts +407 -407
- package/dist/abis/types/ERC20TransferableReceivable.js +1 -1
- package/dist/abis/types/Erc20.d.ts +168 -168
- package/dist/abis/types/Erc20.js +1 -1
- package/dist/abis/types/Erc2612.d.ts +192 -192
- package/dist/abis/types/Erc2612.js +1 -1
- package/dist/abis/types/Erc721.d.ts +474 -474
- package/dist/abis/types/Erc721.js +1 -1
- package/dist/abis/types/HDT.d.ts +369 -369
- package/dist/abis/types/HDT.js +1 -1
- package/dist/abis/types/IConstantFlowAgreementV1.d.ts +573 -573
- package/dist/abis/types/IConstantFlowAgreementV1.js +1 -1
- package/dist/abis/types/ISuperfluid.d.ts +728 -728
- package/dist/abis/types/ISuperfluid.js +1 -1
- package/dist/abis/types/InvoiceNFT.d.ts +425 -425
- package/dist/abis/types/InvoiceNFT.js +1 -1
- package/dist/abis/types/Multisend.d.ts +50 -50
- package/dist/abis/types/Multisend.js +1 -1
- package/dist/abis/types/RealWorldReceivable.d.ts +564 -564
- package/dist/abis/types/RealWorldReceivable.js +1 -1
- package/dist/abis/types/ReceivableFactoringPool.d.ts +999 -999
- package/dist/abis/types/ReceivableFactoringPool.js +1 -1
- package/dist/abis/types/StreamFactoringPool.d.ts +985 -985
- package/dist/abis/types/StreamFactoringPool.js +1 -1
- package/dist/abis/types/StreamFeeManager.d.ts +440 -440
- package/dist/abis/types/StreamFeeManager.js +1 -1
- package/dist/abis/types/SuperfluidPoolProcessor.d.ts +398 -398
- package/dist/abis/types/SuperfluidPoolProcessor.js +1 -1
- package/dist/abis/types/TestERC20.d.ts +270 -270
- package/dist/abis/types/TestERC20.js +1 -1
- package/dist/abis/types/TradableStream.d.ts +607 -607
- package/dist/abis/types/TradableStream.js +1 -1
- package/dist/abis/types/Transfer.d.ts +45 -45
- package/dist/abis/types/Transfer.js +1 -1
- package/dist/abis/types/TransferNFT.d.ts +45 -45
- package/dist/abis/types/TransferNFT.js +1 -1
- package/dist/abis/types/common.d.ts +22 -22
- package/dist/abis/types/common.js +1 -1
- package/dist/abis/types/factories/BaseCreditPool__factory.d.ts +931 -931
- package/dist/abis/types/factories/BaseCreditPool__factory.js +1192 -1192
- package/dist/abis/types/factories/BaseFeeManager__factory.d.ts +379 -379
- package/dist/abis/types/factories/BaseFeeManager__factory.js +493 -493
- package/dist/abis/types/factories/BasePoolConfig__factory.d.ts +1074 -1074
- package/dist/abis/types/factories/BasePoolConfig__factory.js +1377 -1377
- package/dist/abis/types/factories/ERC20TransferableReceivable__factory.d.ts +508 -508
- package/dist/abis/types/factories/ERC20TransferableReceivable__factory.js +661 -661
- package/dist/abis/types/factories/Erc20__factory.d.ts +175 -175
- package/dist/abis/types/factories/Erc20__factory.js +235 -235
- package/dist/abis/types/factories/Erc2612__factory.d.ts +209 -209
- package/dist/abis/types/factories/Erc2612__factory.js +278 -278
- package/dist/abis/types/factories/Erc721__factory.d.ts +539 -539
- package/dist/abis/types/factories/Erc721__factory.js +686 -686
- package/dist/abis/types/factories/HDT__factory.d.ts +399 -399
- package/dist/abis/types/factories/HDT__factory.js +525 -525
- package/dist/abis/types/factories/IConstantFlowAgreementV1__factory.d.ts +695 -695
- package/dist/abis/types/factories/IConstantFlowAgreementV1__factory.js +903 -903
- package/dist/abis/types/factories/ISuperfluid__factory.d.ts +866 -866
- package/dist/abis/types/factories/ISuperfluid__factory.js +1135 -1135
- package/dist/abis/types/factories/InvoiceNFT__factory.d.ts +489 -489
- package/dist/abis/types/factories/InvoiceNFT__factory.js +638 -638
- package/dist/abis/types/factories/Multisend__factory.d.ts +26 -26
- package/dist/abis/types/factories/Multisend__factory.js +39 -39
- package/dist/abis/types/factories/RealWorldReceivable__factory.d.ts +645 -645
- package/dist/abis/types/factories/RealWorldReceivable__factory.js +836 -836
- package/dist/abis/types/factories/ReceivableFactoringPool__factory.d.ts +1204 -1204
- package/dist/abis/types/factories/ReceivableFactoringPool__factory.js +1542 -1542
- package/dist/abis/types/factories/StreamFactoringPool__factory.d.ts +1200 -1200
- package/dist/abis/types/factories/StreamFactoringPool__factory.js +1536 -1536
- package/dist/abis/types/factories/StreamFeeManager__factory.d.ts +412 -412
- package/dist/abis/types/factories/StreamFeeManager__factory.js +535 -535
- package/dist/abis/types/factories/SuperfluidPoolProcessor__factory.d.ts +546 -546
- package/dist/abis/types/factories/SuperfluidPoolProcessor__factory.js +705 -705
- package/dist/abis/types/factories/TestERC20__factory.d.ts +280 -280
- package/dist/abis/types/factories/TestERC20__factory.js +371 -371
- package/dist/abis/types/factories/TradableStream__factory.d.ts +663 -663
- package/dist/abis/types/factories/TradableStream__factory.js +863 -863
- package/dist/abis/types/factories/TransferNFT__factory.d.ts +28 -28
- package/dist/abis/types/factories/TransferNFT__factory.js +40 -40
- package/dist/abis/types/factories/Transfer__factory.d.ts +25 -25
- package/dist/abis/types/factories/Transfer__factory.js +37 -37
- package/dist/abis/types/factories/index.d.ts +21 -21
- package/dist/abis/types/factories/index.js +24 -24
- package/dist/abis/types/index.d.ts +43 -43
- package/dist/abis/types/index.js +22 -22
- package/dist/cjs/abis/BaseCreditPool.json +1179 -1179
- 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 +117 -117
- 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/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 +168 -168
- 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/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 +175 -175
- package/dist/cjs/abis/types/factories/Erc20__factory.js +239 -239
- 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 +27 -27
- 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 +106 -106
- 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 +73 -73
- package/dist/cjs/hooks/usePoolContract.js +309 -309
- package/dist/cjs/hooks/useRFPoolContract.d.ts +22 -22
- 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 +15 -15
- package/dist/cjs/hooks/web3/index.js +147 -147
- 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 +62 -62
- package/dist/cjs/index.d.ts +5 -5
- package/dist/cjs/index.js +8 -8
- package/dist/cjs/services/EAService.d.ts +113 -153
- package/dist/cjs/services/EAService.js +67 -80
- package/dist/cjs/services/EAService.js.map +1 -1
- package/dist/cjs/services/RNService.d.ts +14 -14
- package/dist/cjs/services/RNService.js +13 -13
- package/dist/cjs/services/index.d.ts +2 -2
- package/dist/cjs/services/index.js +5 -5
- 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 +34 -34
- package/dist/cjs/utils/chain.js +108 -108
- package/dist/cjs/utils/common.d.ts +4 -4
- package/dist/cjs/utils/common.js +17 -17
- package/dist/cjs/utils/config.d.ts +6 -6
- package/dist/cjs/utils/config.js +30 -30
- 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 +39 -39
- package/dist/cjs/utils/errors.d.ts +26 -26
- package/dist/cjs/utils/errors.js +46 -46
- package/dist/cjs/utils/index.d.ts +18 -18
- package/dist/cjs/utils/index.js +21 -21
- package/dist/cjs/utils/jsonRpcEndpoints.d.ts +12 -12
- package/dist/cjs/utils/jsonRpcEndpoints.js +28 -28
- package/dist/cjs/utils/number.d.ts +5 -5
- package/dist/cjs/utils/number.js +55 -55
- package/dist/cjs/utils/pool.d.ts +81 -82
- package/dist/cjs/utils/pool.js +286 -339
- package/dist/cjs/utils/pool.js.map +1 -1
- package/dist/cjs/utils/request.d.ts +2 -2
- package/dist/cjs/utils/request.js +27 -30
- package/dist/cjs/utils/request.js.map +1 -1
- 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/hooks/index.d.ts +18 -18
- package/dist/hooks/index.js +18 -18
- package/dist/hooks/useActiveRoute.d.ts +8 -8
- package/dist/hooks/useActiveRoute.js +7 -7
- package/dist/hooks/useAsyncError.d.ts +14 -14
- package/dist/hooks/useAsyncError.js +22 -22
- package/dist/hooks/useCLPoolContract.d.ts +27 -27
- package/dist/hooks/useCLPoolContract.js +38 -38
- package/dist/hooks/useContract.d.ts +7 -7
- package/dist/hooks/useContract.js +40 -40
- package/dist/hooks/useContractFunction.d.ts +18 -18
- package/dist/hooks/useContractFunction.js +54 -54
- package/dist/hooks/useERC2612Permit/ethPermit/index.d.ts +35 -35
- package/dist/hooks/useERC2612Permit/ethPermit/index.js +139 -139
- package/dist/hooks/useERC2612Permit/ethPermit/lib.d.ts +1 -1
- package/dist/hooks/useERC2612Permit/ethPermit/lib.js +21 -21
- package/dist/hooks/useERC2612Permit/ethPermit/rpc.d.ts +10 -10
- package/dist/hooks/useERC2612Permit/ethPermit/rpc.js +98 -98
- package/dist/hooks/useERC2612Permit/index.d.ts +6 -6
- package/dist/hooks/useERC2612Permit/index.js +31 -31
- package/dist/hooks/useFactoring.d.ts +19 -19
- package/dist/hooks/useFactoring.js +90 -90
- package/dist/hooks/useForceRefresh.d.ts +1 -1
- package/dist/hooks/useForceRefresh.js +8 -8
- package/dist/hooks/useGetSizes.d.ts +12 -12
- package/dist/hooks/useGetSizes.js +19 -19
- package/dist/hooks/useInvoiceNFTContract.d.ts +11 -11
- package/dist/hooks/useInvoiceNFTContract.js +64 -64
- package/dist/hooks/useMQ.d.ts +6 -6
- package/dist/hooks/useMQ.js +14 -14
- package/dist/hooks/useMount.d.ts +2 -2
- package/dist/hooks/useMount.js +8 -8
- package/dist/hooks/useParamsSearch.d.ts +2 -2
- package/dist/hooks/useParamsSearch.js +6 -6
- package/dist/hooks/usePool.d.ts +4 -4
- package/dist/hooks/usePool.js +39 -39
- package/dist/hooks/usePoolContract.d.ts +73 -73
- package/dist/hooks/usePoolContract.js +286 -286
- package/dist/hooks/useRFPoolContract.d.ts +22 -22
- package/dist/hooks/useRFPoolContract.js +29 -29
- package/dist/hooks/useRefresh.d.ts +1 -1
- package/dist/hooks/useRefresh.js +47 -47
- package/dist/hooks/web3/index.d.ts +15 -15
- package/dist/hooks/web3/index.js +142 -142
- package/dist/hooks/web3/useConnectors.d.ts +17 -17
- package/dist/hooks/web3/useConnectors.js +24 -24
- package/dist/hooks/web3/useJsonRpcUrlsMap.d.ts +13 -13
- package/dist/hooks/web3/useJsonRpcUrlsMap.js +53 -53
- package/dist/index.d.ts +5 -5
- package/dist/index.js +5 -5
- package/dist/services/EAService.d.ts +113 -153
- package/dist/services/EAService.js +64 -77
- package/dist/services/EAService.js.map +1 -1
- package/dist/services/RNService.d.ts +14 -14
- package/dist/services/RNService.js +10 -10
- package/dist/services/index.d.ts +2 -2
- package/dist/services/index.js +2 -2
- package/dist/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/utils/JsonRpcConnector.d.ts +11 -11
- package/dist/utils/JsonRpcConnector.js +38 -38
- package/dist/utils/WalletConnect.d.ts +10 -10
- package/dist/utils/WalletConnect.js +49 -49
- package/dist/utils/chain.d.ts +34 -34
- package/dist/utils/chain.js +102 -102
- package/dist/utils/common.d.ts +4 -4
- package/dist/utils/common.js +10 -10
- package/dist/utils/config.d.ts +6 -6
- package/dist/utils/config.js +27 -27
- package/dist/utils/const.d.ts +2 -2
- 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.d.ts +21 -21
- package/dist/utils/credit.js +35 -35
- package/dist/utils/errors.d.ts +26 -26
- package/dist/utils/errors.js +39 -39
- package/dist/utils/index.d.ts +18 -18
- package/dist/utils/index.js +18 -18
- package/dist/utils/jsonRpcEndpoints.d.ts +12 -12
- package/dist/utils/jsonRpcEndpoints.js +25 -25
- package/dist/utils/number.d.ts +5 -5
- package/dist/utils/number.js +48 -48
- package/dist/utils/pool.d.ts +81 -82
- package/dist/utils/pool.js +280 -333
- package/dist/utils/pool.js.map +1 -1
- package/dist/utils/request.d.ts +2 -2
- package/dist/utils/request.js +22 -24
- package/dist/utils/request.js.map +1 -1
- package/dist/utils/scientificToDecimal.d.ts +1 -1
- package/dist/utils/scientificToDecimal.js +57 -57
- package/dist/utils/string.d.ts +1 -1
- package/dist/utils/string.js +1 -1
- package/dist/utils/style.d.ts +1 -1
- package/dist/utils/style.js +12 -12
- package/dist/utils/time.d.ts +26 -26
- package/dist/utils/time.js +50 -50
- package/dist/utils/transaction.d.ts +32 -32
- package/dist/utils/transaction.js +87 -87
- package/dist/utils/web3.d.ts +4 -4
- package/dist/utils/web3.js +34 -34
- package/package.json +2 -2
- package/dist/abis/BaseCreditPoolReceivable.json +0 -764
- package/dist/abis/ERC20TransferrableReceivable.json +0 -648
- package/dist/abis/types/BaseCreditPoolReceivable.d.ts +0 -518
- package/dist/abis/types/BaseCreditPoolReceivable.js +0 -2
- package/dist/abis/types/BaseCreditPoolReceivable.js.map +0 -1
- package/dist/abis/types/ERC20TransferrableReceivable.d.ts +0 -407
- package/dist/abis/types/ERC20TransferrableReceivable.js +0 -2
- package/dist/abis/types/ERC20TransferrableReceivable.js.map +0 -1
- package/dist/abis/types/factories/BaseCreditPoolReceivable__factory.d.ts +0 -597
- package/dist/abis/types/factories/BaseCreditPoolReceivable__factory.js +0 -778
- package/dist/abis/types/factories/BaseCreditPoolReceivable__factory.js.map +0 -1
- package/dist/abis/types/factories/ERC20TransferrableReceivable__factory.d.ts +0 -508
- package/dist/abis/types/factories/ERC20TransferrableReceivable__factory.js +0 -663
- package/dist/abis/types/factories/ERC20TransferrableReceivable__factory.js.map +0 -1
- package/dist/cjs/abis/BaseCreditPoolReceivable.json +0 -764
- package/dist/cjs/abis/types/BaseCreditPoolReceivable.d.ts +0 -518
- package/dist/cjs/abis/types/BaseCreditPoolReceivable.js +0 -3
- package/dist/cjs/abis/types/BaseCreditPoolReceivable.js.map +0 -1
- package/dist/cjs/abis/types/factories/BaseCreditPoolReceivable__factory.d.ts +0 -597
- package/dist/cjs/abis/types/factories/BaseCreditPoolReceivable__factory.js +0 -782
- package/dist/cjs/abis/types/factories/BaseCreditPoolReceivable__factory.js.map +0 -1
- package/dist/components/icons/approve-lender.svg +0 -30
- package/dist/components/icons/auto-payback.svg +0 -40
- package/dist/components/icons/check-circle.svg +0 -3
- package/dist/components/icons/check-green.svg +0 -3
- package/dist/components/icons/check.svg +0 -10
- package/dist/components/icons/donut.svg +0 -904
- package/dist/components/icons/ellipse.svg +0 -3
- package/dist/components/icons/ethereum.svg +0 -1
- package/dist/components/icons/huma-full.svg +0 -22
- package/dist/components/icons/huma.svg +0 -15
- package/dist/components/icons/index.d.ts +0 -19
- package/dist/components/icons/index.js +0 -70
- package/dist/components/icons/index.js.map +0 -1
- package/dist/components/icons/loader.svg +0 -229
- package/dist/components/icons/metamask.svg +0 -31
- package/dist/components/icons/polygon.svg +0 -16
- package/dist/components/icons/receipt.svg +0 -3
- package/dist/components/icons/separator.svg +0 -3
- package/dist/components/icons/sorry.svg +0 -31
- package/dist/components/icons/usdc.svg +0 -5
- package/dist/components/icons/wallet-connect.svg +0 -12
- package/dist/theme/breakpoints.d.ts +0 -5
- package/dist/theme/breakpoints.js +0 -4
- package/dist/theme/breakpoints.js.map +0 -1
- package/dist/theme/components.d.ts +0 -6
- package/dist/theme/components.js +0 -62
- package/dist/theme/components.js.map +0 -1
- package/dist/theme/coreThemeConstants.d.ts +0 -18
- package/dist/theme/coreThemeConstants.js +0 -30
- package/dist/theme/coreThemeConstants.js.map +0 -1
- package/dist/theme/cssMixins.d.ts +0 -20
- package/dist/theme/cssMixins.js +0 -90
- package/dist/theme/cssMixins.js.map +0 -1
- package/dist/theme/index.d.ts +0 -8
- package/dist/theme/index.js +0 -27
- package/dist/theme/index.js.map +0 -1
- package/dist/theme/palette.d.ts +0 -53
- package/dist/theme/palette.js +0 -137
- package/dist/theme/palette.js.map +0 -1
- package/dist/theme/shape.d.ts +0 -2
- package/dist/theme/shape.js +0 -5
- package/dist/theme/shape.js.map +0 -1
- package/dist/theme/theme.types.d.ts +0 -72
- package/dist/theme/theme.types.js +0 -2
- package/dist/theme/theme.types.js.map +0 -1
- package/dist/theme/typography.d.ts +0 -2
- package/dist/theme/typography.js +0 -116
- package/dist/theme/typography.js.map +0 -1
- package/dist/utils/ddLogger.d.ts +0 -4
- package/dist/utils/ddLogger.js +0 -48
- package/dist/utils/ddLogger.js.map +0 -1
- package/dist/utils/sentry.d.ts +0 -1
- package/dist/utils/sentry.js +0 -19
- package/dist/utils/sentry.js.map +0 -1
- package/dist/utils/storage.d.ts +0 -12
- package/dist/utils/storage.js +0 -32
- package/dist/utils/storage.js.map +0 -1
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
import React, { createContext, useContext, useMemo, } from 'react';
|
|
2
|
-
import { JsonRpcProvider, StaticJsonRpcProvider, } from '@ethersproject/providers';
|
|
3
|
-
import { ChainEnum } from '../../utils/chain';
|
|
4
|
-
import { JSON_RPC_FALLBACK_ENDPOINTS } from '../../utils/jsonRpcEndpoints';
|
|
5
|
-
const JsonRpcUrlMapContext = createContext(undefined);
|
|
6
|
-
export function Provider({ jsonRpcMap, children, }) {
|
|
7
|
-
return (React.createElement(JsonRpcUrlMapContext.Provider, { value: jsonRpcMap }, children));
|
|
8
|
-
}
|
|
9
|
-
export default function useJsonRpcUrlsMap() {
|
|
10
|
-
const jsonRpcMap = useContext(JsonRpcUrlMapContext);
|
|
11
|
-
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
12
|
-
return useMemo(() => toJsonRpcUrlsMap(jsonRpcMap), [jsonRpcMap]);
|
|
13
|
-
}
|
|
14
|
-
function toJsonRpcMap(getChainConnections) {
|
|
15
|
-
return {
|
|
16
|
-
[ChainEnum.Goerli]: getChainConnections(ChainEnum.Goerli),
|
|
17
|
-
[ChainEnum.Polygon]: getChainConnections(ChainEnum.Polygon),
|
|
18
|
-
[ChainEnum.Mumbai]: getChainConnections(ChainEnum.Mumbai),
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
function getChainConnections(connectionMap, chainId) {
|
|
22
|
-
const value = connectionMap === null || connectionMap === void 0 ? void 0 : connectionMap[chainId];
|
|
23
|
-
return (Array.isArray(value) ? value : [value])
|
|
24
|
-
.filter((value) => Boolean(value))
|
|
25
|
-
.concat(...JSON_RPC_FALLBACK_ENDPOINTS[chainId]);
|
|
26
|
-
}
|
|
27
|
-
export function toJsonRpcConnectionMap(connectionMap) {
|
|
28
|
-
function getJsonRpcProvider(chainId) {
|
|
29
|
-
const [connection] = getChainConnections(connectionMap, chainId);
|
|
30
|
-
return JsonRpcProvider.isProvider(connection)
|
|
31
|
-
? connection
|
|
32
|
-
: new StaticJsonRpcProvider(connection, Number(chainId));
|
|
33
|
-
}
|
|
34
|
-
return toJsonRpcMap(getJsonRpcProvider);
|
|
35
|
-
}
|
|
36
|
-
export function toJsonRpcUrlMap(connectionMap) {
|
|
37
|
-
function getJsonRpcUrl(chainId) {
|
|
38
|
-
const [connection] = getChainConnections(connectionMap, chainId);
|
|
39
|
-
return JsonRpcProvider.isProvider(connection)
|
|
40
|
-
? connection.connection.url
|
|
41
|
-
: connection;
|
|
42
|
-
}
|
|
43
|
-
return toJsonRpcMap(getJsonRpcUrl);
|
|
44
|
-
}
|
|
45
|
-
export function toJsonRpcUrlsMap(connectionMap) {
|
|
46
|
-
function getJsonRpcUrls(chainId) {
|
|
47
|
-
const connections = getChainConnections(connectionMap, chainId);
|
|
48
|
-
return connections.map((connection) => JsonRpcProvider.isProvider(connection)
|
|
49
|
-
? connection.connection.url
|
|
50
|
-
: connection);
|
|
51
|
-
}
|
|
52
|
-
return toJsonRpcMap(getJsonRpcUrls);
|
|
53
|
-
}
|
|
1
|
+
import React, { createContext, useContext, useMemo, } from 'react';
|
|
2
|
+
import { JsonRpcProvider, StaticJsonRpcProvider, } from '@ethersproject/providers';
|
|
3
|
+
import { ChainEnum } from '../../utils/chain';
|
|
4
|
+
import { JSON_RPC_FALLBACK_ENDPOINTS } from '../../utils/jsonRpcEndpoints';
|
|
5
|
+
const JsonRpcUrlMapContext = createContext(undefined);
|
|
6
|
+
export function Provider({ jsonRpcMap, children, }) {
|
|
7
|
+
return (React.createElement(JsonRpcUrlMapContext.Provider, { value: jsonRpcMap }, children));
|
|
8
|
+
}
|
|
9
|
+
export default function useJsonRpcUrlsMap() {
|
|
10
|
+
const jsonRpcMap = useContext(JsonRpcUrlMapContext);
|
|
11
|
+
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
12
|
+
return useMemo(() => toJsonRpcUrlsMap(jsonRpcMap), [jsonRpcMap]);
|
|
13
|
+
}
|
|
14
|
+
function toJsonRpcMap(getChainConnections) {
|
|
15
|
+
return {
|
|
16
|
+
[ChainEnum.Goerli]: getChainConnections(ChainEnum.Goerli),
|
|
17
|
+
[ChainEnum.Polygon]: getChainConnections(ChainEnum.Polygon),
|
|
18
|
+
[ChainEnum.Mumbai]: getChainConnections(ChainEnum.Mumbai),
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
function getChainConnections(connectionMap, chainId) {
|
|
22
|
+
const value = connectionMap === null || connectionMap === void 0 ? void 0 : connectionMap[chainId];
|
|
23
|
+
return (Array.isArray(value) ? value : [value])
|
|
24
|
+
.filter((value) => Boolean(value))
|
|
25
|
+
.concat(...JSON_RPC_FALLBACK_ENDPOINTS[chainId]);
|
|
26
|
+
}
|
|
27
|
+
export function toJsonRpcConnectionMap(connectionMap) {
|
|
28
|
+
function getJsonRpcProvider(chainId) {
|
|
29
|
+
const [connection] = getChainConnections(connectionMap, chainId);
|
|
30
|
+
return JsonRpcProvider.isProvider(connection)
|
|
31
|
+
? connection
|
|
32
|
+
: new StaticJsonRpcProvider(connection, Number(chainId));
|
|
33
|
+
}
|
|
34
|
+
return toJsonRpcMap(getJsonRpcProvider);
|
|
35
|
+
}
|
|
36
|
+
export function toJsonRpcUrlMap(connectionMap) {
|
|
37
|
+
function getJsonRpcUrl(chainId) {
|
|
38
|
+
const [connection] = getChainConnections(connectionMap, chainId);
|
|
39
|
+
return JsonRpcProvider.isProvider(connection)
|
|
40
|
+
? connection.connection.url
|
|
41
|
+
: connection;
|
|
42
|
+
}
|
|
43
|
+
return toJsonRpcMap(getJsonRpcUrl);
|
|
44
|
+
}
|
|
45
|
+
export function toJsonRpcUrlsMap(connectionMap) {
|
|
46
|
+
function getJsonRpcUrls(chainId) {
|
|
47
|
+
const connections = getChainConnections(connectionMap, chainId);
|
|
48
|
+
return connections.map((connection) => JsonRpcProvider.isProvider(connection)
|
|
49
|
+
? connection.connection.url
|
|
50
|
+
: connection);
|
|
51
|
+
}
|
|
52
|
+
return toJsonRpcMap(getJsonRpcUrls);
|
|
53
|
+
}
|
|
54
54
|
//# sourceMappingURL=useJsonRpcUrlsMap.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from './abis';
|
|
2
|
-
export * from './abis/types';
|
|
3
|
-
export * from './hooks';
|
|
4
|
-
export * from './services';
|
|
5
|
-
export * from './utils';
|
|
1
|
+
export * from './abis';
|
|
2
|
+
export * from './abis/types';
|
|
3
|
+
export * from './hooks';
|
|
4
|
+
export * from './services';
|
|
5
|
+
export * from './utils';
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from './abis';
|
|
2
|
-
export * from './abis/types';
|
|
3
|
-
export * from './hooks';
|
|
4
|
-
export * from './services';
|
|
5
|
-
export * from './utils';
|
|
1
|
+
export * from './abis';
|
|
2
|
+
export * from './abis/types';
|
|
3
|
+
export * from './hooks';
|
|
4
|
+
export * from './services';
|
|
5
|
+
export * from './utils';
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,153 +1,113 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Object representing the token information of the approval.
|
|
3
|
-
* @typedef {Object} Token
|
|
4
|
-
* @property {string} symbol The symbol of the base token of the pool.
|
|
5
|
-
* @property {string} name The name of the base token of the pool.
|
|
6
|
-
* @property {number} decimal The number of decimals for the base token of the pool.
|
|
7
|
-
*/
|
|
8
|
-
type Token = {
|
|
9
|
-
symbol: string;
|
|
10
|
-
name: string;
|
|
11
|
-
decimal: number;
|
|
12
|
-
};
|
|
13
|
-
/**
|
|
14
|
-
* Object representing the approved loan terms.
|
|
15
|
-
* @typedef {Object} Terms
|
|
16
|
-
* @property {string} creditLimit The credit limit for the borrower in the pool's base currency.
|
|
17
|
-
* @property {string} creditLimitFormatted The credit limit for the borrower in the pool's base currency, formatted with that tokens' decimals.
|
|
18
|
-
* @property {number} intervalInDays The interval in days for credit line rebalancing.
|
|
19
|
-
* @property {number} remainingPeriods The number of remaining payback periods in the credit line.
|
|
20
|
-
* @property {number} aprInBps The annual percentage rate in basis points.
|
|
21
|
-
*/
|
|
22
|
-
type Terms = {
|
|
23
|
-
creditLimit: string;
|
|
24
|
-
creditLimitFormatted: string;
|
|
25
|
-
intervalInDays: number;
|
|
26
|
-
remainingPeriods: number;
|
|
27
|
-
aprInBps: number;
|
|
28
|
-
};
|
|
29
|
-
/**
|
|
30
|
-
* Object representing receivable information of the approval.
|
|
31
|
-
* @typedef {Object} Receivable
|
|
32
|
-
* @property {string} asset The address of the receivable asset contract.
|
|
33
|
-
* @property {number|string} param The identifying parameter for the receivable asset, often the token ID of an ERC721.
|
|
34
|
-
* @property {string} amount The expected payment amount of the receivable asset.
|
|
35
|
-
* @property {string} amountFormatted The expected payment amount of the receivable asset, formatted with that tokens' decimals.
|
|
36
|
-
*/
|
|
37
|
-
type Receivable = {
|
|
38
|
-
asset: string;
|
|
39
|
-
param: string;
|
|
40
|
-
amount: string;
|
|
41
|
-
amountFormatted: string;
|
|
42
|
-
};
|
|
43
|
-
/**
|
|
44
|
-
* Object representing EA approval.
|
|
45
|
-
* @typedef {Object} Approval
|
|
46
|
-
* @property {Token} token The token information for the approval.
|
|
47
|
-
* @property {Terms} terms The approved loan terms.
|
|
48
|
-
* @property {Receivable} receivable The receivable information.
|
|
49
|
-
*/
|
|
50
|
-
export type Approval = {
|
|
51
|
-
token: Token;
|
|
52
|
-
terms: Terms;
|
|
53
|
-
receivable?: Receivable;
|
|
54
|
-
};
|
|
55
|
-
/**
|
|
56
|
-
* Object representing EA rejection.
|
|
57
|
-
* @typedef {Object} Rejection
|
|
58
|
-
* @property {string[]} reasons Rejection reasons.
|
|
59
|
-
*/
|
|
60
|
-
export type Rejection = {
|
|
61
|
-
reasons: string[];
|
|
62
|
-
};
|
|
63
|
-
/**
|
|
64
|
-
* Object representing the response to the underwriting approval request.
|
|
65
|
-
* @typedef {Object} ApprovalResult
|
|
66
|
-
* @property {Approval | Rejection} result the EA decision, either an approval or rejection.
|
|
67
|
-
*/
|
|
68
|
-
export type ApprovalResult = {
|
|
69
|
-
result: Approval | Rejection;
|
|
70
|
-
};
|
|
71
|
-
/**
|
|
72
|
-
* Object representing the receivable in an underwriting request.
|
|
73
|
-
* @typedef {Object} ReceivableRequest
|
|
74
|
-
* @property {string} address The address of the receivable asset contract.
|
|
75
|
-
* @property {string} [param] The parameter for the receivable asset.
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
* Object
|
|
84
|
-
* @
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
* Object
|
|
92
|
-
* @
|
|
93
|
-
* @property {
|
|
94
|
-
* @property {string}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
};
|
|
114
|
-
/**
|
|
115
|
-
* Object representing the response to the underwriting preapproval request.
|
|
116
|
-
* @typedef {Object} PreapprovalResult
|
|
117
|
-
* @property {boolean} approved the EA decision, either an approval or rejection.
|
|
118
|
-
* @property {string[]} [rejectionReasons] The reasons for rejection, if any
|
|
119
|
-
*/
|
|
120
|
-
export type PreapprovalResult = {
|
|
121
|
-
approved: boolean;
|
|
122
|
-
rejectionReasons?: string[];
|
|
123
|
-
};
|
|
124
|
-
/**
|
|
125
|
-
* Object that includes extra data to be submitted to the underwriting preapproval request when
|
|
126
|
-
* checking for receivable requests
|
|
127
|
-
* @typedef {Object} EAPreapproveContextReceivable
|
|
128
|
-
* @property {string} payerWalletAddress The wallet of the payer of the receivable
|
|
129
|
-
*/
|
|
130
|
-
type EAPreapproveContextReceivable = {
|
|
131
|
-
payerWalletAddress: string;
|
|
132
|
-
};
|
|
133
|
-
/**
|
|
134
|
-
* Object that represents the payload for a preapprove check.
|
|
135
|
-
* @typedef {Object} EAPreapprovalPayload
|
|
136
|
-
* @property {string} poolAddress The pool address to approve.
|
|
137
|
-
* @property {string} borrowerWalletAddress The address of the borrower.
|
|
138
|
-
* @property {EAPreapproveContextReceivable} [context] Extra values to submit with the preapproval request.
|
|
139
|
-
*/
|
|
140
|
-
export type EAPreapprovalPayload = {
|
|
141
|
-
poolAddress: string;
|
|
142
|
-
borrowerWalletAddress: string;
|
|
143
|
-
context?: EAPreapproveContextReceivable;
|
|
144
|
-
};
|
|
145
|
-
export declare const EAService: {
|
|
146
|
-
approve: (payload: EAPayload, chainId: number, isDev?: boolean) => Promise<Approval>;
|
|
147
|
-
approveLender: (payload: {
|
|
148
|
-
poolAddress: string;
|
|
149
|
-
lenderWalletAddress: string;
|
|
150
|
-
}, chainId: number) => Promise<ApprovalResult>;
|
|
151
|
-
preapprove: (payload: EAPreapprovalPayload, chainId: number, isDev?: boolean) => Promise<PreapprovalResult>;
|
|
152
|
-
};
|
|
153
|
-
export {};
|
|
1
|
+
/**
|
|
2
|
+
* Object representing the token information of the approval.
|
|
3
|
+
* @typedef {Object} Token
|
|
4
|
+
* @property {string} symbol The symbol of the base token of the pool.
|
|
5
|
+
* @property {string} name The name of the base token of the pool.
|
|
6
|
+
* @property {number} decimal The number of decimals for the base token of the pool.
|
|
7
|
+
*/
|
|
8
|
+
type Token = {
|
|
9
|
+
symbol: string;
|
|
10
|
+
name: string;
|
|
11
|
+
decimal: number;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Object representing the approved loan terms.
|
|
15
|
+
* @typedef {Object} Terms
|
|
16
|
+
* @property {string} creditLimit The credit limit for the borrower in the pool's base currency.
|
|
17
|
+
* @property {string} creditLimitFormatted The credit limit for the borrower in the pool's base currency, formatted with that tokens' decimals.
|
|
18
|
+
* @property {number} intervalInDays The interval in days for credit line rebalancing.
|
|
19
|
+
* @property {number} remainingPeriods The number of remaining payback periods in the credit line.
|
|
20
|
+
* @property {number} aprInBps The annual percentage rate in basis points.
|
|
21
|
+
*/
|
|
22
|
+
type Terms = {
|
|
23
|
+
creditLimit: string;
|
|
24
|
+
creditLimitFormatted: string;
|
|
25
|
+
intervalInDays: number;
|
|
26
|
+
remainingPeriods: number;
|
|
27
|
+
aprInBps: number;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Object representing receivable information of the approval.
|
|
31
|
+
* @typedef {Object} Receivable
|
|
32
|
+
* @property {string} asset The address of the receivable asset contract.
|
|
33
|
+
* @property {number|string} param The identifying parameter for the receivable asset, often the token ID of an ERC721.
|
|
34
|
+
* @property {string} amount The expected payment amount of the receivable asset.
|
|
35
|
+
* @property {string} amountFormatted The expected payment amount of the receivable asset, formatted with that tokens' decimals.
|
|
36
|
+
*/
|
|
37
|
+
type Receivable = {
|
|
38
|
+
asset: string;
|
|
39
|
+
param: string;
|
|
40
|
+
amount: string;
|
|
41
|
+
amountFormatted: string;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Object representing EA approval.
|
|
45
|
+
* @typedef {Object} Approval
|
|
46
|
+
* @property {Token} token The token information for the approval.
|
|
47
|
+
* @property {Terms} terms The approved loan terms.
|
|
48
|
+
* @property {Receivable} receivable The receivable information.
|
|
49
|
+
*/
|
|
50
|
+
export type Approval = {
|
|
51
|
+
token: Token;
|
|
52
|
+
terms: Terms;
|
|
53
|
+
receivable?: Receivable;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Object representing EA rejection.
|
|
57
|
+
* @typedef {Object} Rejection
|
|
58
|
+
* @property {string[]} reasons Rejection reasons.
|
|
59
|
+
*/
|
|
60
|
+
export type Rejection = {
|
|
61
|
+
reasons: string[];
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Object representing the response to the underwriting approval request.
|
|
65
|
+
* @typedef {Object} ApprovalResult
|
|
66
|
+
* @property {Approval | Rejection} result the EA decision, either an approval or rejection.
|
|
67
|
+
*/
|
|
68
|
+
export type ApprovalResult = {
|
|
69
|
+
result: Approval | Rejection;
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* Object representing the receivable in an underwriting request.
|
|
73
|
+
* @typedef {Object} ReceivableRequest
|
|
74
|
+
* @property {string} [address] The address of the receivable asset contract.
|
|
75
|
+
* @property {string} [param] The parameter for the receivable asset.
|
|
76
|
+
*/
|
|
77
|
+
type ReceivableRequest = {
|
|
78
|
+
address: string;
|
|
79
|
+
param?: string;
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* Object representing the additional data required for a receivable-based underwriting request.
|
|
83
|
+
* @typedef {Object} EARequestContextReceivable
|
|
84
|
+
* @property {ReceivableRequest} receivable The receivable information.
|
|
85
|
+
*/
|
|
86
|
+
type EARequestContextReceivable = {
|
|
87
|
+
receivable: ReceivableRequest;
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* Object representing the additional data required for a stream factoring underwriting request.
|
|
91
|
+
* @typedef {Object} EAContextStream
|
|
92
|
+
* @property {ReceivableRequest} receivable The receivable information.
|
|
93
|
+
* @property {string} payerWalletAddress The address of the payer.
|
|
94
|
+
* @property {string} superToken The address of the SuperToken contract.
|
|
95
|
+
*/
|
|
96
|
+
type EARequestContextStream = {
|
|
97
|
+
receivable: ReceivableRequest;
|
|
98
|
+
payerWalletAddress: string;
|
|
99
|
+
superToken: string;
|
|
100
|
+
};
|
|
101
|
+
export type EAPayload = {
|
|
102
|
+
poolAddress: string;
|
|
103
|
+
borrowerWalletAddress: string;
|
|
104
|
+
context?: EARequestContextReceivable | EARequestContextStream;
|
|
105
|
+
};
|
|
106
|
+
export declare const EAService: {
|
|
107
|
+
approve: (payload: EAPayload, chainId: number, isDev?: boolean) => Promise<Approval>;
|
|
108
|
+
approveLender: (payload: {
|
|
109
|
+
poolAddress: string;
|
|
110
|
+
lenderWalletAddress: string;
|
|
111
|
+
}, chainId: number) => Promise<ApprovalResult>;
|
|
112
|
+
};
|
|
113
|
+
export {};
|
|
@@ -1,78 +1,65 @@
|
|
|
1
|
-
import { configUtil } from '../utils/config';
|
|
2
|
-
import { EARejectionError } from '../utils/errors';
|
|
3
|
-
import { downScale } from '../utils/number';
|
|
4
|
-
import { requestPost } from '../utils/request';
|
|
5
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6
|
-
const isRejection = (obj) => obj !== null && typeof obj === 'object' && Array.isArray(obj.reasons);
|
|
7
|
-
/**
|
|
8
|
-
* Submits a credit underwriting request to Huma's EAVerse.
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* @param {
|
|
12
|
-
* @
|
|
13
|
-
* @
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
66
|
-
}
|
|
67
|
-
catch (error) {
|
|
68
|
-
throw new Error((_b = error.message) !== null && _b !== void 0 ? _b : generalErrorMessage, {
|
|
69
|
-
cause: 'server error',
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
export const EAService = {
|
|
74
|
-
approve,
|
|
75
|
-
approveLender,
|
|
76
|
-
preapprove,
|
|
77
|
-
};
|
|
1
|
+
import { configUtil } from '../utils/config';
|
|
2
|
+
import { EARejectionError } from '../utils/errors';
|
|
3
|
+
import { downScale } from '../utils/number';
|
|
4
|
+
import { requestPost } from '../utils/request';
|
|
5
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6
|
+
const isRejection = (obj) => obj !== null && typeof obj === 'object' && Array.isArray(obj.reasons);
|
|
7
|
+
/**
|
|
8
|
+
* Submits a credit underwriting request to Huma's EAVerse.
|
|
9
|
+
* @param {EAPayload} payload The payload for the underwrite approval.
|
|
10
|
+
* @param {number} chainId The chain ID.
|
|
11
|
+
* @param {boolean} isDev Is dev environment or not.
|
|
12
|
+
* @returns {Promise<Approval>} Promise that returns the approval on success.
|
|
13
|
+
* @throws {EARejectionError} If the underwrite approval is rejected.
|
|
14
|
+
*/
|
|
15
|
+
const approve = async (payload, chainId, isDev = false) => {
|
|
16
|
+
const approvalResult = await requestPost(`${configUtil.getEAVerseUrl(chainId, isDev)}/underwriter/underwrite`, payload);
|
|
17
|
+
const { result } = approvalResult;
|
|
18
|
+
if (isRejection(result)) {
|
|
19
|
+
throw new EARejectionError();
|
|
20
|
+
}
|
|
21
|
+
if (!result) {
|
|
22
|
+
throw new Error('Sorry, there was an error approving your wallet', {
|
|
23
|
+
cause: 'server error',
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
const { terms, receivable, token } = result;
|
|
27
|
+
if (terms === null || terms === void 0 ? void 0 : terms.creditLimit) {
|
|
28
|
+
terms.creditLimit = String(result.terms.creditLimit);
|
|
29
|
+
terms.creditLimitFormatted = downScale(String(result.terms.creditLimit), token.decimal);
|
|
30
|
+
}
|
|
31
|
+
if (receivable === null || receivable === void 0 ? void 0 : receivable.amount) {
|
|
32
|
+
receivable.amount = String(receivable.amount);
|
|
33
|
+
receivable.amountFormatted = downScale(String(receivable.amount), token.decimal);
|
|
34
|
+
}
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
const approveLender = async (payload, chainId) => {
|
|
38
|
+
var _a, _b;
|
|
39
|
+
const generalErrorMessage = 'Sorry, there was an error approving your wallet as a lender.';
|
|
40
|
+
try {
|
|
41
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
42
|
+
const data = await requestPost(`${configUtil.getEABaseUrlV1(chainId)}/addApprovedLender`, payload);
|
|
43
|
+
if (data.statusCode >= 500) {
|
|
44
|
+
throw new Error(data.errorMessage ? data.errorMessage[0] : generalErrorMessage);
|
|
45
|
+
}
|
|
46
|
+
else if (data.status) {
|
|
47
|
+
throw new Error(data.reason[0]);
|
|
48
|
+
}
|
|
49
|
+
else if ((_a = data.rejectionReason) === null || _a === void 0 ? void 0 : _a.length) {
|
|
50
|
+
throw new Error(data.rejectionReason[0]);
|
|
51
|
+
}
|
|
52
|
+
return data;
|
|
53
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
throw new Error((_b = error.message) !== null && _b !== void 0 ? _b : generalErrorMessage, {
|
|
57
|
+
cause: 'server error',
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
export const EAService = {
|
|
62
|
+
approve,
|
|
63
|
+
approveLender,
|
|
64
|
+
};
|
|
78
65
|
//# sourceMappingURL=EAService.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EAService.js","sourceRoot":"","sources":["../../src/services/EAService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"EAService.js","sourceRoot":"","sources":["../../src/services/EAService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAqH9C,8DAA8D;AAC9D,MAAM,WAAW,GAAG,CAAC,GAAQ,EAAoB,EAAE,CACjD,GAAG,KAAK,IAAI,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;AAEvE;;;;;;;GAOG;AACH,MAAM,OAAO,GAAG,KAAK,EAAE,OAAkB,EAAE,OAAe,EAAE,KAAK,GAAG,KAAK,EAAE,EAAE;IAC3E,MAAM,cAAc,GAAmB,MAAM,WAAW,CACtD,GAAG,UAAU,CAAC,aAAa,CAAC,OAAO,EAAE,KAAK,CAAC,yBAAyB,EACpE,OAAO,CACR,CAAA;IACD,MAAM,EAAE,MAAM,EAAE,GAAG,cAAc,CAAA;IACjC,IAAI,WAAW,CAAC,MAAM,CAAC,EAAE;QACvB,MAAM,IAAI,gBAAgB,EAAE,CAAA;KAC7B;IACD,IAAI,CAAC,MAAM,EAAE;QACX,MAAM,IAAI,KAAK,CAAC,iDAAiD,EAAE;YACjE,KAAK,EAAE,cAAc;SACtB,CAAC,CAAA;KACH;IAED,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,GAAG,MAAM,CAAA;IAC3C,IAAI,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,WAAW,EAAE;QACtB,KAAK,CAAC,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,CAAA;QACpD,KAAK,CAAC,oBAAoB,GAAG,SAAS,CACpC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,EAChC,KAAK,CAAC,OAAO,CACd,CAAA;KACF;IACD,IAAI,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,MAAM,EAAE;QACtB,UAAU,CAAC,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAA;QAC7C,UAAU,CAAC,eAAe,GAAG,SAAS,CACpC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,EACzB,KAAK,CAAC,OAAO,CACd,CAAA;KACF;IAED,OAAO,MAAM,CAAA;AACf,CAAC,CAAA;AAED,MAAM,aAAa,GAAG,KAAK,EACzB,OAGC,EACD,OAAe,EACf,EAAE;;IACF,MAAM,mBAAmB,GACvB,8DAA8D,CAAA;IAChE,IAAI;QACF,8DAA8D;QAC9D,MAAM,IAAI,GAAQ,MAAM,WAAW,CACjC,GAAG,UAAU,CAAC,cAAc,CAAC,OAAO,CAAC,oBAAoB,EACzD,OAAO,CACR,CAAA;QACD,IAAI,IAAI,CAAC,UAAU,IAAI,GAAG,EAAE;YAC1B,MAAM,IAAI,KAAK,CACb,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,mBAAmB,CAC/D,CAAA;SACF;aAAM,IAAI,IAAI,CAAC,MAAM,EAAE;YACtB,MAAM,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;SAChC;aAAM,IAAI,MAAA,IAAI,CAAC,eAAe,0CAAE,MAAM,EAAE;YACvC,MAAM,IAAI,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAA;SACzC;QACD,OAAO,IAAsB,CAAA;QAC7B,8DAA8D;KAC/D;IAAC,OAAO,KAAU,EAAE;QACnB,MAAM,IAAI,KAAK,CAAC,MAAA,KAAK,CAAC,OAAO,mCAAI,mBAAmB,EAAE;YACpD,KAAK,EAAE,cAAc;SACtB,CAAC,CAAA;KACH;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,OAAO;IACP,aAAa;CACd,CAAA"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
export type RequestInfoType = {
|
|
2
|
-
expectedAmount: string;
|
|
3
|
-
payer: {
|
|
4
|
-
type: string;
|
|
5
|
-
value: string;
|
|
6
|
-
};
|
|
7
|
-
payee: {
|
|
8
|
-
type: string;
|
|
9
|
-
value: string;
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
export declare const RNService: {
|
|
13
|
-
getRequestInfo: (requestId: string, chainId: number) => Promise<any>;
|
|
14
|
-
};
|
|
1
|
+
export type RequestInfoType = {
|
|
2
|
+
expectedAmount: string;
|
|
3
|
+
payer: {
|
|
4
|
+
type: string;
|
|
5
|
+
value: string;
|
|
6
|
+
};
|
|
7
|
+
payee: {
|
|
8
|
+
type: string;
|
|
9
|
+
value: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export declare const RNService: {
|
|
13
|
+
getRequestInfo: (requestId: string, chainId: number) => Promise<any>;
|
|
14
|
+
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { configUtil } from '../utils/config';
|
|
2
|
-
import { requestGet } from '../utils/request';
|
|
3
|
-
const getRequestInfo = async (requestId, chainId) => {
|
|
4
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5
|
-
const data = await requestGet(`${configUtil.getRequestAPIUrl(chainId)}/request?id=${requestId}`);
|
|
6
|
-
return data;
|
|
7
|
-
};
|
|
8
|
-
export const RNService = {
|
|
9
|
-
getRequestInfo,
|
|
10
|
-
};
|
|
1
|
+
import { configUtil } from '../utils/config';
|
|
2
|
+
import { requestGet } from '../utils/request';
|
|
3
|
+
const getRequestInfo = async (requestId, chainId) => {
|
|
4
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5
|
+
const data = await requestGet(`${configUtil.getRequestAPIUrl(chainId)}/request?id=${requestId}`);
|
|
6
|
+
return data;
|
|
7
|
+
};
|
|
8
|
+
export const RNService = {
|
|
9
|
+
getRequestInfo,
|
|
10
|
+
};
|
|
11
11
|
//# sourceMappingURL=RNService.js.map
|
package/dist/services/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './EAService';
|
|
2
|
-
export * from './RNService';
|
|
1
|
+
export * from './EAService';
|
|
2
|
+
export * from './RNService';
|
package/dist/services/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './EAService';
|
|
2
|
-
export * from './RNService';
|
|
1
|
+
export * from './EAService';
|
|
2
|
+
export * from './RNService';
|
|
3
3
|
//# sourceMappingURL=index.js.map
|