@huma-finance/shared 0.0.28 → 0.0.29
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 +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/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.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/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 +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/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.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/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 +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/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 +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/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 +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/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 +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 +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 +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 +153 -153
- package/dist/cjs/services/EAService.js +80 -80
- package/dist/cjs/services/IdentityService.d.ts +35 -35
- package/dist/cjs/services/IdentityService.js +56 -56
- 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 +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 +7 -7
- package/dist/cjs/utils/config.js +35 -35
- 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 +88 -88
- package/dist/cjs/utils/pool.js +384 -384
- 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.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 +96 -96
- 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 +153 -153
- package/dist/services/EAService.js +77 -77
- package/dist/services/IdentityService.d.ts +35 -35
- package/dist/services/IdentityService.js +53 -53
- package/dist/services/RNService.d.ts +14 -14
- package/dist/services/RNService.js +10 -10
- package/dist/services/index.d.ts +3 -3
- 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.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 +7 -7
- package/dist/utils/config.js +32 -32
- 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/ddLogger.d.ts +4 -0
- package/dist/utils/ddLogger.js +48 -0
- package/dist/utils/ddLogger.js.map +1 -0
- 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 +88 -88
- package/dist/utils/pool.js +378 -378
- package/dist/utils/request.d.ts +3 -3
- package/dist/utils/request.js +38 -38
- package/dist/utils/scientificToDecimal.d.ts +1 -1
- 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.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
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/* eslint-disable max-classes-per-file */
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.WalletConnectQR = exports.WalletConnectPopup = void 0;
|
|
5
|
-
const tslib_1 = require("tslib");
|
|
6
|
-
const walletconnect_1 = require("@web3-react/walletconnect");
|
|
7
|
-
const qrcode_1 = tslib_1.__importDefault(require("qrcode"));
|
|
8
|
-
class WalletConnectPopup extends walletconnect_1.WalletConnect {
|
|
9
|
-
constructor({ actions, options, defaultChainId, timeout, onError, }) {
|
|
10
|
-
super({
|
|
11
|
-
actions,
|
|
12
|
-
options: Object.assign(Object.assign({}, options), { qrcode: true }),
|
|
13
|
-
defaultChainId,
|
|
14
|
-
timeout,
|
|
15
|
-
onError,
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
exports.WalletConnectPopup = WalletConnectPopup;
|
|
20
|
-
class WalletConnectQR extends walletconnect_1.WalletConnect {
|
|
21
|
-
constructor({ actions, options, defaultChainId, timeout, onError, }) {
|
|
22
|
-
super({
|
|
23
|
-
actions,
|
|
24
|
-
options: Object.assign(Object.assign({}, options), { qrcode: false }),
|
|
25
|
-
defaultChainId,
|
|
26
|
-
timeout,
|
|
27
|
-
onError,
|
|
28
|
-
});
|
|
29
|
-
this.events.once(walletconnect_1.URI_AVAILABLE, () => {
|
|
30
|
-
var _a;
|
|
31
|
-
(_a = this.provider) === null || _a === void 0 ? void 0 : _a.connector.on('disconnect', () => {
|
|
32
|
-
this.deactivate();
|
|
33
|
-
});
|
|
34
|
-
});
|
|
35
|
-
this.events.on(walletconnect_1.URI_AVAILABLE, async (uri) => {
|
|
36
|
-
this.svg = undefined;
|
|
37
|
-
if (!uri)
|
|
38
|
-
return;
|
|
39
|
-
this.svg = await qrcode_1.default.toString(uri, {
|
|
40
|
-
// Leave a margin to increase contrast in dark mode.
|
|
41
|
-
margin: 1,
|
|
42
|
-
// Use 55*2=110 for the width to prevent distortion. The generated viewbox is "0 0 55 55".
|
|
43
|
-
width: 110,
|
|
44
|
-
type: 'svg',
|
|
45
|
-
});
|
|
46
|
-
this.events.emit(WalletConnectQR.SVG_AVAILABLE, this.svg);
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
deactivate() {
|
|
50
|
-
this.events.emit(walletconnect_1.URI_AVAILABLE);
|
|
51
|
-
return super.deactivate();
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
exports.WalletConnectQR = WalletConnectQR;
|
|
55
|
-
WalletConnectQR.SVG_AVAILABLE = 'svg_available';
|
|
1
|
+
"use strict";
|
|
2
|
+
/* eslint-disable max-classes-per-file */
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.WalletConnectQR = exports.WalletConnectPopup = void 0;
|
|
5
|
+
const tslib_1 = require("tslib");
|
|
6
|
+
const walletconnect_1 = require("@web3-react/walletconnect");
|
|
7
|
+
const qrcode_1 = tslib_1.__importDefault(require("qrcode"));
|
|
8
|
+
class WalletConnectPopup extends walletconnect_1.WalletConnect {
|
|
9
|
+
constructor({ actions, options, defaultChainId, timeout, onError, }) {
|
|
10
|
+
super({
|
|
11
|
+
actions,
|
|
12
|
+
options: Object.assign(Object.assign({}, options), { qrcode: true }),
|
|
13
|
+
defaultChainId,
|
|
14
|
+
timeout,
|
|
15
|
+
onError,
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.WalletConnectPopup = WalletConnectPopup;
|
|
20
|
+
class WalletConnectQR extends walletconnect_1.WalletConnect {
|
|
21
|
+
constructor({ actions, options, defaultChainId, timeout, onError, }) {
|
|
22
|
+
super({
|
|
23
|
+
actions,
|
|
24
|
+
options: Object.assign(Object.assign({}, options), { qrcode: false }),
|
|
25
|
+
defaultChainId,
|
|
26
|
+
timeout,
|
|
27
|
+
onError,
|
|
28
|
+
});
|
|
29
|
+
this.events.once(walletconnect_1.URI_AVAILABLE, () => {
|
|
30
|
+
var _a;
|
|
31
|
+
(_a = this.provider) === null || _a === void 0 ? void 0 : _a.connector.on('disconnect', () => {
|
|
32
|
+
this.deactivate();
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
this.events.on(walletconnect_1.URI_AVAILABLE, async (uri) => {
|
|
36
|
+
this.svg = undefined;
|
|
37
|
+
if (!uri)
|
|
38
|
+
return;
|
|
39
|
+
this.svg = await qrcode_1.default.toString(uri, {
|
|
40
|
+
// Leave a margin to increase contrast in dark mode.
|
|
41
|
+
margin: 1,
|
|
42
|
+
// Use 55*2=110 for the width to prevent distortion. The generated viewbox is "0 0 55 55".
|
|
43
|
+
width: 110,
|
|
44
|
+
type: 'svg',
|
|
45
|
+
});
|
|
46
|
+
this.events.emit(WalletConnectQR.SVG_AVAILABLE, this.svg);
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
deactivate() {
|
|
50
|
+
this.events.emit(walletconnect_1.URI_AVAILABLE);
|
|
51
|
+
return super.deactivate();
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.WalletConnectQR = WalletConnectQR;
|
|
55
|
+
WalletConnectQR.SVG_AVAILABLE = 'svg_available';
|
|
56
56
|
//# sourceMappingURL=WalletConnect.js.map
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import type { AddEthereumChainParameter } from '@web3-react/types';
|
|
2
|
-
interface BasicChainInformation {
|
|
3
|
-
urls: string[];
|
|
4
|
-
name: string;
|
|
5
|
-
explorer: string;
|
|
6
|
-
wait: number;
|
|
7
|
-
requestAPIUrl?: string | undefined;
|
|
8
|
-
isTestnet: boolean;
|
|
9
|
-
icon: string;
|
|
10
|
-
}
|
|
11
|
-
interface ExtendedChainInformation extends BasicChainInformation {
|
|
12
|
-
nativeCurrency: AddEthereumChainParameter['nativeCurrency'];
|
|
13
|
-
blockExplorerUrls: AddEthereumChainParameter['blockExplorerUrls'];
|
|
14
|
-
}
|
|
15
|
-
export declare enum ChainEnum {
|
|
16
|
-
Polygon = 137,
|
|
17
|
-
Goerli = 5,
|
|
18
|
-
Mumbai = 80001
|
|
19
|
-
}
|
|
20
|
-
export declare const SupportedChainIds: ChainEnum[];
|
|
21
|
-
export declare const CHAINS: {
|
|
22
|
-
[chainId: number]: BasicChainInformation | ExtendedChainInformation;
|
|
23
|
-
};
|
|
24
|
-
export declare function getAddChainParameters(chainId: number): AddEthereumChainParameter | number;
|
|
25
|
-
export declare const URLS: {
|
|
26
|
-
[chainId: number]: string[];
|
|
27
|
-
};
|
|
28
|
-
export declare const getWalletAddressAbbr: (address: string) => string;
|
|
29
|
-
/**
|
|
30
|
-
* Returns the input chain ID if chain is supported. If not, return undefined
|
|
31
|
-
* @param chainId a chain ID, which will be returned if it is a supported chain ID
|
|
32
|
-
*/
|
|
33
|
-
export declare function supportedChainId(chainId: number | undefined): ChainEnum | undefined;
|
|
34
|
-
export {};
|
|
1
|
+
import type { AddEthereumChainParameter } from '@web3-react/types';
|
|
2
|
+
interface BasicChainInformation {
|
|
3
|
+
urls: string[];
|
|
4
|
+
name: string;
|
|
5
|
+
explorer: string;
|
|
6
|
+
wait: number;
|
|
7
|
+
requestAPIUrl?: string | undefined;
|
|
8
|
+
isTestnet: boolean;
|
|
9
|
+
icon: string;
|
|
10
|
+
}
|
|
11
|
+
interface ExtendedChainInformation extends BasicChainInformation {
|
|
12
|
+
nativeCurrency: AddEthereumChainParameter['nativeCurrency'];
|
|
13
|
+
blockExplorerUrls: AddEthereumChainParameter['blockExplorerUrls'];
|
|
14
|
+
}
|
|
15
|
+
export declare enum ChainEnum {
|
|
16
|
+
Polygon = 137,
|
|
17
|
+
Goerli = 5,
|
|
18
|
+
Mumbai = 80001
|
|
19
|
+
}
|
|
20
|
+
export declare const SupportedChainIds: ChainEnum[];
|
|
21
|
+
export declare const CHAINS: {
|
|
22
|
+
[chainId: number]: BasicChainInformation | ExtendedChainInformation;
|
|
23
|
+
};
|
|
24
|
+
export declare function getAddChainParameters(chainId: number): AddEthereumChainParameter | number;
|
|
25
|
+
export declare const URLS: {
|
|
26
|
+
[chainId: number]: string[];
|
|
27
|
+
};
|
|
28
|
+
export declare const getWalletAddressAbbr: (address: string) => string;
|
|
29
|
+
/**
|
|
30
|
+
* Returns the input chain ID if chain is supported. If not, return undefined
|
|
31
|
+
* @param chainId a chain ID, which will be returned if it is a supported chain ID
|
|
32
|
+
*/
|
|
33
|
+
export declare function supportedChainId(chainId: number | undefined): ChainEnum | undefined;
|
|
34
|
+
export {};
|
package/dist/cjs/utils/chain.js
CHANGED
|
@@ -1,109 +1,109 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.supportedChainId = exports.getWalletAddressAbbr = exports.URLS = exports.getAddChainParameters = exports.CHAINS = exports.SupportedChainIds = exports.ChainEnum = void 0;
|
|
4
|
-
const ETH = {
|
|
5
|
-
name: 'Ether',
|
|
6
|
-
symbol: 'ETH',
|
|
7
|
-
decimals: 18,
|
|
8
|
-
};
|
|
9
|
-
const MATIC = {
|
|
10
|
-
name: 'MATIC',
|
|
11
|
-
symbol: 'MATIC',
|
|
12
|
-
decimals: 18,
|
|
13
|
-
};
|
|
14
|
-
var ChainEnum;
|
|
15
|
-
(function (ChainEnum) {
|
|
16
|
-
// Mainnet = 1,
|
|
17
|
-
ChainEnum[ChainEnum["Polygon"] = 137] = "Polygon";
|
|
18
|
-
ChainEnum[ChainEnum["Goerli"] = 5] = "Goerli";
|
|
19
|
-
ChainEnum[ChainEnum["Mumbai"] = 80001] = "Mumbai";
|
|
20
|
-
})(ChainEnum = exports.ChainEnum || (exports.ChainEnum = {}));
|
|
21
|
-
exports.SupportedChainIds = [
|
|
22
|
-
ChainEnum.Polygon,
|
|
23
|
-
ChainEnum.Goerli,
|
|
24
|
-
ChainEnum.Mumbai,
|
|
25
|
-
];
|
|
26
|
-
exports.CHAINS = {
|
|
27
|
-
// [ChainEnum.Mainnet]: {
|
|
28
|
-
// urls: [],
|
|
29
|
-
// name: 'Mainnet',
|
|
30
|
-
// nativeCurrency: ETH,
|
|
31
|
-
// icon: EthereumIcon,
|
|
32
|
-
// explorer: 'https://etherscan.io/tx',
|
|
33
|
-
// wait: 6,
|
|
34
|
-
// },
|
|
35
|
-
[ChainEnum.Polygon]: {
|
|
36
|
-
urls: ['https://polygon-rpc.com/'],
|
|
37
|
-
name: 'Polygon',
|
|
38
|
-
nativeCurrency: MATIC,
|
|
39
|
-
explorer: 'https://polygonscan.com/tx',
|
|
40
|
-
wait: 6,
|
|
41
|
-
isTestnet: false,
|
|
42
|
-
icon: 'Polygon',
|
|
43
|
-
},
|
|
44
|
-
[ChainEnum.Goerli]: {
|
|
45
|
-
urls: ['https://rpc.ankr.com/eth_goerli'],
|
|
46
|
-
name: 'Goerli',
|
|
47
|
-
nativeCurrency: ETH,
|
|
48
|
-
explorer: 'https://goerli.etherscan.io/tx',
|
|
49
|
-
wait: 1,
|
|
50
|
-
requestAPIUrl: 'https://dev.goerli.rnreader.huma.finance',
|
|
51
|
-
isTestnet: true,
|
|
52
|
-
icon: 'Ethereum',
|
|
53
|
-
},
|
|
54
|
-
[ChainEnum.Mumbai]: {
|
|
55
|
-
urls: ['https://rpc.ankr.com/polygon_mumbai'],
|
|
56
|
-
name: 'Mumbai',
|
|
57
|
-
nativeCurrency: MATIC,
|
|
58
|
-
explorer: 'https://mumbai.polygonscan.com/tx',
|
|
59
|
-
wait: 1,
|
|
60
|
-
isTestnet: true,
|
|
61
|
-
icon: 'Polygon',
|
|
62
|
-
},
|
|
63
|
-
};
|
|
64
|
-
function isExtendedChainInformation(chainInformation) {
|
|
65
|
-
return !!chainInformation.nativeCurrency;
|
|
66
|
-
}
|
|
67
|
-
function getAddChainParameters(chainId) {
|
|
68
|
-
const chainInformation = exports.CHAINS[chainId];
|
|
69
|
-
if (isExtendedChainInformation(chainInformation)) {
|
|
70
|
-
return {
|
|
71
|
-
chainId,
|
|
72
|
-
chainName: chainInformation.name,
|
|
73
|
-
nativeCurrency: chainInformation.nativeCurrency,
|
|
74
|
-
rpcUrls: chainInformation.urls,
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
return chainId;
|
|
78
|
-
}
|
|
79
|
-
exports.getAddChainParameters = getAddChainParameters;
|
|
80
|
-
exports.URLS = Object.keys(exports.CHAINS).reduce((accumulator, chainId) => {
|
|
81
|
-
const validURLs = exports.CHAINS[Number(chainId)].urls;
|
|
82
|
-
if (validURLs.length) {
|
|
83
|
-
accumulator[Number(chainId)] = validURLs;
|
|
84
|
-
}
|
|
85
|
-
return accumulator;
|
|
86
|
-
}, {});
|
|
87
|
-
const getWalletAddressAbbr = (address) => {
|
|
88
|
-
if (!address) {
|
|
89
|
-
return address;
|
|
90
|
-
}
|
|
91
|
-
const { length } = address;
|
|
92
|
-
return `${address.slice(0, 6)}...${address.slice(length - 4, length)}`;
|
|
93
|
-
};
|
|
94
|
-
exports.getWalletAddressAbbr = getWalletAddressAbbr;
|
|
95
|
-
/**
|
|
96
|
-
* Returns the input chain ID if chain is supported. If not, return undefined
|
|
97
|
-
* @param chainId a chain ID, which will be returned if it is a supported chain ID
|
|
98
|
-
*/
|
|
99
|
-
function supportedChainId(chainId) {
|
|
100
|
-
if (typeof chainId === 'number' && chainId in ChainEnum) {
|
|
101
|
-
return chainId;
|
|
102
|
-
}
|
|
103
|
-
if (typeof chainId === 'string' && Number(chainId) in ChainEnum) {
|
|
104
|
-
return Number(chainId);
|
|
105
|
-
}
|
|
106
|
-
return undefined;
|
|
107
|
-
}
|
|
108
|
-
exports.supportedChainId = supportedChainId;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.supportedChainId = exports.getWalletAddressAbbr = exports.URLS = exports.getAddChainParameters = exports.CHAINS = exports.SupportedChainIds = exports.ChainEnum = void 0;
|
|
4
|
+
const ETH = {
|
|
5
|
+
name: 'Ether',
|
|
6
|
+
symbol: 'ETH',
|
|
7
|
+
decimals: 18,
|
|
8
|
+
};
|
|
9
|
+
const MATIC = {
|
|
10
|
+
name: 'MATIC',
|
|
11
|
+
symbol: 'MATIC',
|
|
12
|
+
decimals: 18,
|
|
13
|
+
};
|
|
14
|
+
var ChainEnum;
|
|
15
|
+
(function (ChainEnum) {
|
|
16
|
+
// Mainnet = 1,
|
|
17
|
+
ChainEnum[ChainEnum["Polygon"] = 137] = "Polygon";
|
|
18
|
+
ChainEnum[ChainEnum["Goerli"] = 5] = "Goerli";
|
|
19
|
+
ChainEnum[ChainEnum["Mumbai"] = 80001] = "Mumbai";
|
|
20
|
+
})(ChainEnum = exports.ChainEnum || (exports.ChainEnum = {}));
|
|
21
|
+
exports.SupportedChainIds = [
|
|
22
|
+
ChainEnum.Polygon,
|
|
23
|
+
ChainEnum.Goerli,
|
|
24
|
+
ChainEnum.Mumbai,
|
|
25
|
+
];
|
|
26
|
+
exports.CHAINS = {
|
|
27
|
+
// [ChainEnum.Mainnet]: {
|
|
28
|
+
// urls: [],
|
|
29
|
+
// name: 'Mainnet',
|
|
30
|
+
// nativeCurrency: ETH,
|
|
31
|
+
// icon: EthereumIcon,
|
|
32
|
+
// explorer: 'https://etherscan.io/tx',
|
|
33
|
+
// wait: 6,
|
|
34
|
+
// },
|
|
35
|
+
[ChainEnum.Polygon]: {
|
|
36
|
+
urls: ['https://polygon-rpc.com/'],
|
|
37
|
+
name: 'Polygon',
|
|
38
|
+
nativeCurrency: MATIC,
|
|
39
|
+
explorer: 'https://polygonscan.com/tx',
|
|
40
|
+
wait: 6,
|
|
41
|
+
isTestnet: false,
|
|
42
|
+
icon: 'Polygon',
|
|
43
|
+
},
|
|
44
|
+
[ChainEnum.Goerli]: {
|
|
45
|
+
urls: ['https://rpc.ankr.com/eth_goerli'],
|
|
46
|
+
name: 'Goerli',
|
|
47
|
+
nativeCurrency: ETH,
|
|
48
|
+
explorer: 'https://goerli.etherscan.io/tx',
|
|
49
|
+
wait: 1,
|
|
50
|
+
requestAPIUrl: 'https://dev.goerli.rnreader.huma.finance',
|
|
51
|
+
isTestnet: true,
|
|
52
|
+
icon: 'Ethereum',
|
|
53
|
+
},
|
|
54
|
+
[ChainEnum.Mumbai]: {
|
|
55
|
+
urls: ['https://rpc.ankr.com/polygon_mumbai'],
|
|
56
|
+
name: 'Mumbai',
|
|
57
|
+
nativeCurrency: MATIC,
|
|
58
|
+
explorer: 'https://mumbai.polygonscan.com/tx',
|
|
59
|
+
wait: 1,
|
|
60
|
+
isTestnet: true,
|
|
61
|
+
icon: 'Polygon',
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
function isExtendedChainInformation(chainInformation) {
|
|
65
|
+
return !!chainInformation.nativeCurrency;
|
|
66
|
+
}
|
|
67
|
+
function getAddChainParameters(chainId) {
|
|
68
|
+
const chainInformation = exports.CHAINS[chainId];
|
|
69
|
+
if (isExtendedChainInformation(chainInformation)) {
|
|
70
|
+
return {
|
|
71
|
+
chainId,
|
|
72
|
+
chainName: chainInformation.name,
|
|
73
|
+
nativeCurrency: chainInformation.nativeCurrency,
|
|
74
|
+
rpcUrls: chainInformation.urls,
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
return chainId;
|
|
78
|
+
}
|
|
79
|
+
exports.getAddChainParameters = getAddChainParameters;
|
|
80
|
+
exports.URLS = Object.keys(exports.CHAINS).reduce((accumulator, chainId) => {
|
|
81
|
+
const validURLs = exports.CHAINS[Number(chainId)].urls;
|
|
82
|
+
if (validURLs.length) {
|
|
83
|
+
accumulator[Number(chainId)] = validURLs;
|
|
84
|
+
}
|
|
85
|
+
return accumulator;
|
|
86
|
+
}, {});
|
|
87
|
+
const getWalletAddressAbbr = (address) => {
|
|
88
|
+
if (!address) {
|
|
89
|
+
return address;
|
|
90
|
+
}
|
|
91
|
+
const { length } = address;
|
|
92
|
+
return `${address.slice(0, 6)}...${address.slice(length - 4, length)}`;
|
|
93
|
+
};
|
|
94
|
+
exports.getWalletAddressAbbr = getWalletAddressAbbr;
|
|
95
|
+
/**
|
|
96
|
+
* Returns the input chain ID if chain is supported. If not, return undefined
|
|
97
|
+
* @param chainId a chain ID, which will be returned if it is a supported chain ID
|
|
98
|
+
*/
|
|
99
|
+
function supportedChainId(chainId) {
|
|
100
|
+
if (typeof chainId === 'number' && chainId in ChainEnum) {
|
|
101
|
+
return chainId;
|
|
102
|
+
}
|
|
103
|
+
if (typeof chainId === 'string' && Number(chainId) in ChainEnum) {
|
|
104
|
+
return Number(chainId);
|
|
105
|
+
}
|
|
106
|
+
return undefined;
|
|
107
|
+
}
|
|
108
|
+
exports.supportedChainId = supportedChainId;
|
|
109
109
|
//# sourceMappingURL=chain.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const isEmpty: (value: undefined | null | any) => boolean;
|
|
2
|
-
export declare const openInNewTab: (url: string) => void;
|
|
3
|
-
export declare const sleep: (ms: number) => Promise<unknown>;
|
|
4
|
-
export declare const isIframe: () => boolean;
|
|
1
|
+
export declare const isEmpty: (value: undefined | null | any) => boolean;
|
|
2
|
+
export declare const openInNewTab: (url: string) => void;
|
|
3
|
+
export declare const sleep: (ms: number) => Promise<unknown>;
|
|
4
|
+
export declare const isIframe: () => boolean;
|
package/dist/cjs/utils/common.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isIframe = exports.sleep = exports.openInNewTab = exports.isEmpty = void 0;
|
|
4
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5
|
-
const isEmpty = (value) => value === undefined || value === null;
|
|
6
|
-
exports.isEmpty = isEmpty;
|
|
7
|
-
const openInNewTab = (url) => {
|
|
8
|
-
// @ts-ignore
|
|
9
|
-
window.open(url, '_blank').focus();
|
|
10
|
-
};
|
|
11
|
-
exports.openInNewTab = openInNewTab;
|
|
12
|
-
const sleep = (ms) =>
|
|
13
|
-
// eslint-disable-next-line no-promise-executor-return
|
|
14
|
-
new Promise((resolve) => setTimeout(resolve, ms));
|
|
15
|
-
exports.sleep = sleep;
|
|
16
|
-
const isIframe = () => window !== window.parent;
|
|
17
|
-
exports.isIframe = isIframe;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isIframe = exports.sleep = exports.openInNewTab = exports.isEmpty = void 0;
|
|
4
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5
|
+
const isEmpty = (value) => value === undefined || value === null;
|
|
6
|
+
exports.isEmpty = isEmpty;
|
|
7
|
+
const openInNewTab = (url) => {
|
|
8
|
+
// @ts-ignore
|
|
9
|
+
window.open(url, '_blank').focus();
|
|
10
|
+
};
|
|
11
|
+
exports.openInNewTab = openInNewTab;
|
|
12
|
+
const sleep = (ms) =>
|
|
13
|
+
// eslint-disable-next-line no-promise-executor-return
|
|
14
|
+
new Promise((resolve) => setTimeout(resolve, ms));
|
|
15
|
+
exports.sleep = sleep;
|
|
16
|
+
const isIframe = () => window !== window.parent;
|
|
17
|
+
exports.isIframe = isIframe;
|
|
18
18
|
//# sourceMappingURL=common.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export declare const configUtil: {
|
|
2
|
-
getEAVerseUrl: (chainId: number, isDev?: boolean) => string;
|
|
3
|
-
getEABaseUrlV1: (chainId: number) => string;
|
|
4
|
-
getRequestAPIUrl: (chainId: number, isDev?: boolean) => string;
|
|
5
|
-
getIdentityAPIUrl: (chainId: number, isDev?: boolean) => string;
|
|
6
|
-
DEFAULT_CHAIN_ID: number;
|
|
7
|
-
};
|
|
1
|
+
export declare const configUtil: {
|
|
2
|
+
getEAVerseUrl: (chainId: number, isDev?: boolean) => string;
|
|
3
|
+
getEABaseUrlV1: (chainId: number) => string;
|
|
4
|
+
getRequestAPIUrl: (chainId: number, isDev?: boolean) => string;
|
|
5
|
+
getIdentityAPIUrl: (chainId: number, isDev?: boolean) => string;
|
|
6
|
+
DEFAULT_CHAIN_ID: number;
|
|
7
|
+
};
|
package/dist/cjs/utils/config.js
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.configUtil = void 0;
|
|
4
|
-
const chain_1 = require("./chain");
|
|
5
|
-
const getDevPrefix = (isDev = false) => (isDev ? 'dev.' : '');
|
|
6
|
-
const getEAVerseUrl = (chainId, isDev = false) => {
|
|
7
|
-
const network = chain_1.CHAINS[chainId].name;
|
|
8
|
-
return `https://${getDevPrefix(isDev)}${network}.eaverse.huma.finance`;
|
|
9
|
-
};
|
|
10
|
-
const getEABaseUrlV1 = (chainId) => {
|
|
11
|
-
const network = chain_1.CHAINS[chainId].name;
|
|
12
|
-
return `https://${network}.risk.huma.finance`;
|
|
13
|
-
};
|
|
14
|
-
const getRequestAPIUrl = (chainId, isDev = false) => {
|
|
15
|
-
// Get optional override
|
|
16
|
-
const url = chain_1.CHAINS[chainId].requestAPIUrl;
|
|
17
|
-
if (url) {
|
|
18
|
-
return url;
|
|
19
|
-
}
|
|
20
|
-
const network = chain_1.CHAINS[chainId].name;
|
|
21
|
-
return `https://${getDevPrefix(isDev)}${network}.rnreader.huma.finance`;
|
|
22
|
-
};
|
|
23
|
-
const getIdentityAPIUrl = (chainId, isDev = false) => {
|
|
24
|
-
const networkType = chain_1.CHAINS[chainId].isTestnet ? 'testnet' : 'mainnet';
|
|
25
|
-
return `https://${getDevPrefix(isDev)}${networkType}.identity-verification.huma.finance`;
|
|
26
|
-
};
|
|
27
|
-
// @todo: ReferenceError: Cannot access 'ChainEnum' before initialization
|
|
28
|
-
const DEFAULT_CHAIN_ID = 5;
|
|
29
|
-
exports.configUtil = {
|
|
30
|
-
getEAVerseUrl,
|
|
31
|
-
getEABaseUrlV1,
|
|
32
|
-
getRequestAPIUrl,
|
|
33
|
-
getIdentityAPIUrl,
|
|
34
|
-
DEFAULT_CHAIN_ID,
|
|
35
|
-
};
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.configUtil = void 0;
|
|
4
|
+
const chain_1 = require("./chain");
|
|
5
|
+
const getDevPrefix = (isDev = false) => (isDev ? 'dev.' : '');
|
|
6
|
+
const getEAVerseUrl = (chainId, isDev = false) => {
|
|
7
|
+
const network = chain_1.CHAINS[chainId].name;
|
|
8
|
+
return `https://${getDevPrefix(isDev)}${network}.eaverse.huma.finance`;
|
|
9
|
+
};
|
|
10
|
+
const getEABaseUrlV1 = (chainId) => {
|
|
11
|
+
const network = chain_1.CHAINS[chainId].name;
|
|
12
|
+
return `https://${network}.risk.huma.finance`;
|
|
13
|
+
};
|
|
14
|
+
const getRequestAPIUrl = (chainId, isDev = false) => {
|
|
15
|
+
// Get optional override
|
|
16
|
+
const url = chain_1.CHAINS[chainId].requestAPIUrl;
|
|
17
|
+
if (url) {
|
|
18
|
+
return url;
|
|
19
|
+
}
|
|
20
|
+
const network = chain_1.CHAINS[chainId].name;
|
|
21
|
+
return `https://${getDevPrefix(isDev)}${network}.rnreader.huma.finance`;
|
|
22
|
+
};
|
|
23
|
+
const getIdentityAPIUrl = (chainId, isDev = false) => {
|
|
24
|
+
const networkType = chain_1.CHAINS[chainId].isTestnet ? 'testnet' : 'mainnet';
|
|
25
|
+
return `https://${getDevPrefix(isDev)}${networkType}.identity-verification.huma.finance`;
|
|
26
|
+
};
|
|
27
|
+
// @todo: ReferenceError: Cannot access 'ChainEnum' before initialization
|
|
28
|
+
const DEFAULT_CHAIN_ID = 5;
|
|
29
|
+
exports.configUtil = {
|
|
30
|
+
getEAVerseUrl,
|
|
31
|
+
getEABaseUrlV1,
|
|
32
|
+
getRequestAPIUrl,
|
|
33
|
+
getIdentityAPIUrl,
|
|
34
|
+
DEFAULT_CHAIN_ID,
|
|
35
|
+
};
|
|
36
36
|
//# sourceMappingURL=config.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const EARejectReason = "Your wallet does not meet qualifications";
|
|
2
|
-
export declare const EARejectMessage = "Based on your wallet transaction history your application was not approved.";
|
|
1
|
+
export declare const EARejectReason = "Your wallet does not meet qualifications";
|
|
2
|
+
export declare const EARejectMessage = "Based on your wallet transaction history your application was not approved.";
|
package/dist/cjs/utils/const.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EARejectMessage = exports.EARejectReason = void 0;
|
|
4
|
-
exports.EARejectReason = 'Your wallet does not meet qualifications';
|
|
5
|
-
exports.EARejectMessage = 'Based on your wallet transaction history your application was not approved.';
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EARejectMessage = exports.EARejectReason = void 0;
|
|
4
|
+
exports.EARejectReason = 'Your wallet does not meet qualifications';
|
|
5
|
+
exports.EARejectMessage = 'Based on your wallet transaction history your application was not approved.';
|
|
6
6
|
//# sourceMappingURL=const.js.map
|