@huma-finance/shared 0.0.34 → 0.0.36
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/erc20.json +10 -0
- package/dist/abis/types/Erc20.d.ts +17 -1
- package/dist/abis/types/factories/BaseCreditPool__factory.js +1 -2
- package/dist/abis/types/factories/BaseCreditPool__factory.js.map +1 -1
- package/dist/abis/types/factories/BaseFeeManager__factory.js +1 -2
- package/dist/abis/types/factories/BaseFeeManager__factory.js.map +1 -1
- package/dist/abis/types/factories/BasePoolConfig__factory.js +1 -2
- package/dist/abis/types/factories/BasePoolConfig__factory.js.map +1 -1
- package/dist/abis/types/factories/ERC20TransferableReceivable__factory.js +1 -2
- package/dist/abis/types/factories/ERC20TransferableReceivable__factory.js.map +1 -1
- package/dist/abis/types/factories/Erc20__factory.d.ts +18 -0
- package/dist/abis/types/factories/Erc20__factory.js +25 -2
- package/dist/abis/types/factories/Erc20__factory.js.map +1 -1
- package/dist/abis/types/factories/Erc2612__factory.js +1 -2
- package/dist/abis/types/factories/Erc2612__factory.js.map +1 -1
- package/dist/abis/types/factories/Erc721__factory.js +1 -2
- package/dist/abis/types/factories/Erc721__factory.js.map +1 -1
- package/dist/abis/types/factories/HDT__factory.js +1 -2
- package/dist/abis/types/factories/HDT__factory.js.map +1 -1
- package/dist/abis/types/factories/IConstantFlowAgreementV1__factory.js +1 -2
- package/dist/abis/types/factories/IConstantFlowAgreementV1__factory.js.map +1 -1
- package/dist/abis/types/factories/ISuperfluid__factory.js +1 -2
- package/dist/abis/types/factories/ISuperfluid__factory.js.map +1 -1
- package/dist/abis/types/factories/InvoiceNFT__factory.js +1 -2
- package/dist/abis/types/factories/InvoiceNFT__factory.js.map +1 -1
- package/dist/abis/types/factories/Multisend__factory.js +1 -2
- package/dist/abis/types/factories/Multisend__factory.js.map +1 -1
- package/dist/abis/types/factories/RealWorldReceivable__factory.js +1 -2
- package/dist/abis/types/factories/RealWorldReceivable__factory.js.map +1 -1
- package/dist/abis/types/factories/ReceivableFactoringPool__factory.js +1 -2
- package/dist/abis/types/factories/ReceivableFactoringPool__factory.js.map +1 -1
- package/dist/abis/types/factories/StreamFactoringPool__factory.js +1 -2
- package/dist/abis/types/factories/StreamFactoringPool__factory.js.map +1 -1
- package/dist/abis/types/factories/StreamFeeManager__factory.js +1 -2
- package/dist/abis/types/factories/StreamFeeManager__factory.js.map +1 -1
- package/dist/abis/types/factories/SuperfluidPoolProcessor__factory.js +1 -2
- package/dist/abis/types/factories/SuperfluidPoolProcessor__factory.js.map +1 -1
- package/dist/abis/types/factories/TestERC20__factory.js +1 -2
- package/dist/abis/types/factories/TestERC20__factory.js.map +1 -1
- package/dist/abis/types/factories/TradableStream__factory.js +1 -2
- package/dist/abis/types/factories/TradableStream__factory.js.map +1 -1
- package/dist/abis/types/factories/TransferNFT__factory.js +1 -2
- package/dist/abis/types/factories/TransferNFT__factory.js.map +1 -1
- package/dist/abis/types/factories/Transfer__factory.js +1 -2
- package/dist/abis/types/factories/Transfer__factory.js.map +1 -1
- 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 +127 -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 +184 -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 +193 -175
- package/dist/cjs/abis/types/factories/Erc20__factory.js +263 -239
- package/dist/cjs/abis/types/factories/Erc20__factory.js.map +1 -1
- package/dist/cjs/abis/types/factories/Erc2612__factory.d.ts +209 -209
- package/dist/cjs/abis/types/factories/Erc2612__factory.js +282 -282
- package/dist/cjs/abis/types/factories/Erc721__factory.d.ts +539 -539
- package/dist/cjs/abis/types/factories/Erc721__factory.js +690 -690
- package/dist/cjs/abis/types/factories/HDT__factory.d.ts +399 -399
- package/dist/cjs/abis/types/factories/HDT__factory.js +529 -529
- package/dist/cjs/abis/types/factories/IConstantFlowAgreementV1__factory.d.ts +695 -695
- package/dist/cjs/abis/types/factories/IConstantFlowAgreementV1__factory.js +907 -907
- package/dist/cjs/abis/types/factories/ISuperfluid__factory.d.ts +866 -866
- package/dist/cjs/abis/types/factories/ISuperfluid__factory.js +1139 -1139
- package/dist/cjs/abis/types/factories/InvoiceNFT__factory.d.ts +489 -489
- package/dist/cjs/abis/types/factories/InvoiceNFT__factory.js +642 -642
- package/dist/cjs/abis/types/factories/Multisend__factory.d.ts +26 -26
- package/dist/cjs/abis/types/factories/Multisend__factory.js +43 -43
- package/dist/cjs/abis/types/factories/RealWorldReceivable__factory.d.ts +645 -645
- package/dist/cjs/abis/types/factories/RealWorldReceivable__factory.js +840 -840
- package/dist/cjs/abis/types/factories/ReceivableFactoringPool__factory.d.ts +1204 -1204
- package/dist/cjs/abis/types/factories/ReceivableFactoringPool__factory.js +1546 -1546
- package/dist/cjs/abis/types/factories/StreamFactoringPool__factory.d.ts +1200 -1200
- package/dist/cjs/abis/types/factories/StreamFactoringPool__factory.js +1540 -1540
- package/dist/cjs/abis/types/factories/StreamFeeManager__factory.d.ts +412 -412
- package/dist/cjs/abis/types/factories/StreamFeeManager__factory.js +539 -539
- package/dist/cjs/abis/types/factories/SuperfluidPoolProcessor__factory.d.ts +546 -546
- package/dist/cjs/abis/types/factories/SuperfluidPoolProcessor__factory.js +709 -709
- package/dist/cjs/abis/types/factories/TestERC20__factory.d.ts +280 -280
- package/dist/cjs/abis/types/factories/TestERC20__factory.js +375 -375
- package/dist/cjs/abis/types/factories/TradableStream__factory.d.ts +663 -663
- package/dist/cjs/abis/types/factories/TradableStream__factory.js +867 -867
- package/dist/cjs/abis/types/factories/TransferNFT__factory.d.ts +28 -28
- package/dist/cjs/abis/types/factories/TransferNFT__factory.js +44 -44
- package/dist/cjs/abis/types/factories/Transfer__factory.d.ts +25 -25
- package/dist/cjs/abis/types/factories/Transfer__factory.js +41 -41
- package/dist/cjs/abis/types/factories/index.d.ts +21 -21
- package/dist/cjs/abis/types/factories/index.js +48 -48
- package/dist/cjs/abis/types/index.d.ts +43 -43
- package/dist/cjs/abis/types/index.js +47 -47
- package/dist/cjs/hooks/index.d.ts +18 -18
- package/dist/cjs/hooks/index.js +21 -21
- package/dist/cjs/hooks/useActiveRoute.d.ts +8 -8
- package/dist/cjs/hooks/useActiveRoute.js +11 -11
- package/dist/cjs/hooks/useAsyncError.d.ts +14 -14
- package/dist/cjs/hooks/useAsyncError.js +26 -26
- package/dist/cjs/hooks/useCLPoolContract.d.ts +28 -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 +74 -73
- package/dist/cjs/hooks/usePoolContract.js +310 -309
- package/dist/cjs/hooks/usePoolContract.js.map +1 -1
- package/dist/cjs/hooks/useRFPoolContract.d.ts +23 -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 +11 -15
- package/dist/cjs/hooks/web3/index.js +146 -147
- package/dist/cjs/hooks/web3/index.js.map +1 -1
- package/dist/cjs/hooks/web3/useConnectors.d.ts +17 -17
- package/dist/cjs/hooks/web3/useConnectors.js +30 -30
- package/dist/cjs/hooks/web3/useJsonRpcUrlsMap.d.ts +13 -13
- package/dist/cjs/hooks/web3/useJsonRpcUrlsMap.js +64 -62
- package/dist/cjs/hooks/web3/useJsonRpcUrlsMap.js.map +1 -1
- package/dist/cjs/index.d.ts +5 -5
- package/dist/cjs/index.js +8 -8
- package/dist/cjs/services/EAService.d.ts +153 -153
- package/dist/cjs/services/EAService.js +80 -80
- package/dist/cjs/services/IdentityService.d.ts +52 -52
- package/dist/cjs/services/IdentityService.js +83 -83
- package/dist/cjs/services/RNService.d.ts +14 -14
- package/dist/cjs/services/RNService.js +13 -13
- package/dist/cjs/services/index.d.ts +3 -3
- package/dist/cjs/services/index.js +6 -6
- package/dist/cjs/utils/JsonRpcConnector.d.ts +11 -11
- package/dist/cjs/utils/JsonRpcConnector.js +42 -42
- package/dist/cjs/utils/WalletConnect.d.ts +10 -10
- package/dist/cjs/utils/WalletConnect.js +55 -55
- package/dist/cjs/utils/chain.d.ts +39 -36
- package/dist/cjs/utils/chain.js +126 -116
- package/dist/cjs/utils/chain.js.map +1 -1
- package/dist/cjs/utils/common.d.ts +4 -4
- package/dist/cjs/utils/common.js +17 -17
- package/dist/cjs/utils/config.d.ts +8 -8
- package/dist/cjs/utils/config.js +45 -44
- package/dist/cjs/utils/config.js.map +1 -1
- package/dist/cjs/utils/const.d.ts +2 -2
- package/dist/cjs/utils/const.js +5 -5
- package/dist/cjs/utils/contractError.json +73 -73
- package/dist/cjs/utils/contractconfig.json +19 -19
- package/dist/cjs/utils/credit.d.ts +21 -21
- package/dist/cjs/utils/credit.js +41 -39
- package/dist/cjs/utils/credit.js.map +1 -1
- package/dist/cjs/utils/errors.d.ts +26 -26
- package/dist/cjs/utils/errors.js +46 -46
- package/dist/cjs/utils/index.d.ts +20 -20
- package/dist/cjs/utils/index.js +23 -23
- package/dist/cjs/utils/jsonRpcEndpoints.d.ts +12 -12
- package/dist/cjs/utils/jsonRpcEndpoints.js +21 -28
- package/dist/cjs/utils/jsonRpcEndpoints.js.map +1 -1
- package/dist/cjs/utils/notifi.d.ts +4 -3
- package/dist/cjs/utils/notifi.js +42 -39
- package/dist/cjs/utils/notifi.js.map +1 -1
- package/dist/cjs/utils/number.d.ts +6 -5
- package/dist/cjs/utils/number.js +74 -61
- package/dist/cjs/utils/number.js.map +1 -1
- package/dist/cjs/utils/pool.d.ts +96 -96
- package/dist/cjs/utils/pool.js +371 -440
- package/dist/cjs/utils/pool.js.map +1 -1
- package/dist/cjs/utils/realWorldReceivable.d.ts +12 -12
- package/dist/cjs/utils/realWorldReceivable.js +2 -2
- package/dist/cjs/utils/request.d.ts +3 -3
- package/dist/cjs/utils/request.js +45 -45
- package/dist/cjs/utils/scientificToDecimal.d.ts +1 -1
- package/dist/cjs/utils/scientificToDecimal.js +61 -61
- package/dist/cjs/utils/string.d.ts +1 -1
- package/dist/cjs/utils/string.js +5 -5
- package/dist/cjs/utils/style.d.ts +1 -1
- package/dist/cjs/utils/style.js +16 -16
- package/dist/cjs/utils/time.d.ts +26 -26
- package/dist/cjs/utils/time.js +58 -58
- package/dist/cjs/utils/transaction.d.ts +32 -32
- package/dist/cjs/utils/transaction.js +96 -96
- package/dist/cjs/utils/web3.d.ts +4 -4
- package/dist/cjs/utils/web3.js +39 -39
- package/dist/hooks/useCLPoolContract.d.ts +1 -0
- package/dist/hooks/useCLPoolContract.js +38 -38
- package/dist/hooks/useContract.js +40 -40
- package/dist/hooks/useFactoring.js +90 -90
- package/dist/hooks/useInvoiceNFTContract.js +64 -64
- package/dist/hooks/usePool.js +39 -39
- package/dist/hooks/usePoolContract.d.ts +1 -0
- package/dist/hooks/usePoolContract.js +287 -286
- package/dist/hooks/usePoolContract.js.map +1 -1
- package/dist/hooks/useRFPoolContract.d.ts +1 -0
- package/dist/hooks/useRFPoolContract.js +29 -29
- package/dist/hooks/web3/index.d.ts +1 -5
- package/dist/hooks/web3/index.js +141 -142
- package/dist/hooks/web3/index.js.map +1 -1
- package/dist/hooks/web3/useJsonRpcUrlsMap.js +55 -53
- package/dist/hooks/web3/useJsonRpcUrlsMap.js.map +1 -1
- package/dist/index.js +5 -5
- package/dist/services/EAService.js +77 -77
- package/dist/services/IdentityService.d.ts +52 -52
- package/dist/services/IdentityService.js +80 -80
- package/dist/services/RNService.js +10 -10
- package/dist/services/index.js +3 -3
- package/dist/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/utils/WalletConnect.js +1 -2
- package/dist/utils/WalletConnect.js.map +1 -1
- package/dist/utils/chain.d.ts +39 -36
- package/dist/utils/chain.js +118 -109
- package/dist/utils/chain.js.map +1 -1
- package/dist/utils/config.d.ts +8 -8
- package/dist/utils/config.js +42 -41
- package/dist/utils/config.js.map +1 -1
- package/dist/utils/contractconfig.json +19 -19
- package/dist/utils/credit.js +2 -0
- package/dist/utils/credit.js.map +1 -1
- package/dist/utils/index.d.ts +20 -20
- package/dist/utils/index.js +20 -20
- package/dist/utils/jsonRpcEndpoints.js +18 -25
- package/dist/utils/jsonRpcEndpoints.js.map +1 -1
- package/dist/utils/notifi.d.ts +4 -3
- package/dist/utils/notifi.js +36 -34
- package/dist/utils/notifi.js.map +1 -1
- package/dist/utils/number.d.ts +1 -0
- package/dist/utils/number.js +66 -54
- package/dist/utils/number.js.map +1 -1
- package/dist/utils/pool.d.ts +96 -96
- package/dist/utils/pool.js +364 -433
- package/dist/utils/pool.js.map +1 -1
- package/dist/utils/realWorldReceivable.d.ts +12 -12
- package/dist/utils/realWorldReceivable.js +1 -1
- package/package.json +5 -4
- 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,84 +1,84 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.IdentityService = void 0;
|
|
4
|
-
const config_1 = require("../utils/config");
|
|
5
|
-
const request_1 = require("../utils/request");
|
|
6
|
-
/**
|
|
7
|
-
* Enum representing the identity status.
|
|
8
|
-
* @typedef {Enum} IdentityStatus
|
|
9
|
-
*/
|
|
10
|
-
var IdentityVerificationStatus;
|
|
11
|
-
(function (IdentityVerificationStatus) {
|
|
12
|
-
IdentityVerificationStatus["ACCREDITED"] = "ACCREDITED";
|
|
13
|
-
IdentityVerificationStatus["ACCREDITATION_NOT_APPLICABLE"] = "ACCREDITATION_NOT_APPLICABLE";
|
|
14
|
-
IdentityVerificationStatus["NOT_ACCREDITED"] = "NOT_ACCREDITED";
|
|
15
|
-
IdentityVerificationStatus["ACCREDITATION_PENDING"] = "ACCREDITATION_PENDING";
|
|
16
|
-
IdentityVerificationStatus["IDENTITY_VERIFICATION_COMPLETED"] = "IDENTITY_VERIFICATION_COMPLETED";
|
|
17
|
-
IdentityVerificationStatus["IDENTITY_VERIFICATION_FAILED"] = "IDENTITY_VERIFICATION_FAILED";
|
|
18
|
-
IdentityVerificationStatus["IDENTITY_VERIFICATION_PENDING"] = "IDENTITY_VERIFICATION_PENDING";
|
|
19
|
-
IdentityVerificationStatus["IDENTITY_VERIFICATION_UPDATES_REQUIRED"] = "IDENTITY_VERIFICATION_UPDATES_REQUIRED";
|
|
20
|
-
IdentityVerificationStatus["IDENTITY_VERIFICATION_NOT_STARTED"] = "IDENTITY_VERIFICATION_NOT_STARTED";
|
|
21
|
-
IdentityVerificationStatus["USER_NOT_ONBOARDED"] = "USER_NOT_ONBOARDED";
|
|
22
|
-
})(IdentityVerificationStatus || (IdentityVerificationStatus = {}));
|
|
23
|
-
/**
|
|
24
|
-
* Get wallet's identity verification status.
|
|
25
|
-
*
|
|
26
|
-
* @param {string} walletAddress The wallet address.
|
|
27
|
-
* @param {string} pool The pool address.
|
|
28
|
-
* @param {number} chainId chain Id.
|
|
29
|
-
* @param {boolean} isDev Is dev environment or not.
|
|
30
|
-
* @returns {Promise<VerificationStatusResult>} Promise that returns the verification status result.
|
|
31
|
-
*/
|
|
32
|
-
const getVerificationStatus = async (walletAddress, pool, chainId, isDev = false) => {
|
|
33
|
-
const result = await (0, request_1.requestPut)(`${config_1.configUtil.getIdentityAPIUrl(chainId, isDev)}/wallets/${walletAddress}/verification-status?poolAddress=${pool}`);
|
|
34
|
-
result.isVerified = [IdentityVerificationStatus.ACCREDITED].includes(result.verificationStatus);
|
|
35
|
-
result.isNotOnboarded =
|
|
36
|
-
result.verificationStatus === IdentityVerificationStatus.USER_NOT_ONBOARDED;
|
|
37
|
-
return result;
|
|
38
|
-
};
|
|
39
|
-
/**
|
|
40
|
-
* Onboard user
|
|
41
|
-
*
|
|
42
|
-
* @param {string} walletAddress The wallet address.
|
|
43
|
-
* @param {string} code The investor code.
|
|
44
|
-
* @param {string} pool Pool address.
|
|
45
|
-
* @param {number} chainId chain Id.
|
|
46
|
-
* @param {boolean} isDev Is dev environment or not.
|
|
47
|
-
* @returns {Promise<string>} Promise that returns the onboard result
|
|
48
|
-
*/
|
|
49
|
-
const onboard = async (walletAddress, code, pool, chainId, isDev = false) => (0, request_1.requestPost)(`${config_1.configUtil.getIdentityAPIUrl(chainId, isDev)}/wallets/${walletAddress}/onboard?code=${code}&poolAddress=${pool}`);
|
|
50
|
-
/**
|
|
51
|
-
* Get document signature status
|
|
52
|
-
*
|
|
53
|
-
* @param {string} envelopeId The envelope id.
|
|
54
|
-
* @param {number} chainId chain Id.
|
|
55
|
-
* @param {boolean} isDev Is dev environment or not.
|
|
56
|
-
* @returns {Promise<{envelopeId: string}>} Promise that returns the envelope id
|
|
57
|
-
*/
|
|
58
|
-
const getDocSignatureStatus = async (envelopeId, chainId, isDev = false) => (0, request_1.requestGet)(`${config_1.configUtil.getIdentityAPIUrl(chainId, isDev)}/${envelopeId}/document-signature-status`);
|
|
59
|
-
/**
|
|
60
|
-
* Request document signature
|
|
61
|
-
*
|
|
62
|
-
* @param {string} walletAddress The wallet address.
|
|
63
|
-
* @param {number} chainId chain Id.
|
|
64
|
-
* @param {boolean} isDev Is dev environment or not.
|
|
65
|
-
* @returns {Promise<{envelopeId: string}>} Promise that returns the envelope id
|
|
66
|
-
*/
|
|
67
|
-
const requestDocSignature = async (walletAddress, chainId, isDev = false) => (0, request_1.requestPost)(`${config_1.configUtil.getIdentityAPIUrl(chainId, isDev)}/request-document-signature`, { walletAddress });
|
|
68
|
-
/**
|
|
69
|
-
* Resend document signature link
|
|
70
|
-
*
|
|
71
|
-
* @param {string} envelopeId The envelope id.
|
|
72
|
-
* @param {number} chainId chain Id.
|
|
73
|
-
* @param {boolean} isDev Is dev environment or not.
|
|
74
|
-
* @returns {Promise<{envelopeId: string}>} Promise that returns the envelope id
|
|
75
|
-
*/
|
|
76
|
-
const resendDocSignatureLink = async (envelopeId, chainId, isDev = false) => (0, request_1.requestPost)(`${config_1.configUtil.getIdentityAPIUrl(chainId, isDev)}/resend-document-signature-link`, { envelopeId });
|
|
77
|
-
exports.IdentityService = {
|
|
78
|
-
getVerificationStatus,
|
|
79
|
-
onboard,
|
|
80
|
-
getDocSignatureStatus,
|
|
81
|
-
requestDocSignature,
|
|
82
|
-
resendDocSignatureLink,
|
|
83
|
-
};
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IdentityService = void 0;
|
|
4
|
+
const config_1 = require("../utils/config");
|
|
5
|
+
const request_1 = require("../utils/request");
|
|
6
|
+
/**
|
|
7
|
+
* Enum representing the identity status.
|
|
8
|
+
* @typedef {Enum} IdentityStatus
|
|
9
|
+
*/
|
|
10
|
+
var IdentityVerificationStatus;
|
|
11
|
+
(function (IdentityVerificationStatus) {
|
|
12
|
+
IdentityVerificationStatus["ACCREDITED"] = "ACCREDITED";
|
|
13
|
+
IdentityVerificationStatus["ACCREDITATION_NOT_APPLICABLE"] = "ACCREDITATION_NOT_APPLICABLE";
|
|
14
|
+
IdentityVerificationStatus["NOT_ACCREDITED"] = "NOT_ACCREDITED";
|
|
15
|
+
IdentityVerificationStatus["ACCREDITATION_PENDING"] = "ACCREDITATION_PENDING";
|
|
16
|
+
IdentityVerificationStatus["IDENTITY_VERIFICATION_COMPLETED"] = "IDENTITY_VERIFICATION_COMPLETED";
|
|
17
|
+
IdentityVerificationStatus["IDENTITY_VERIFICATION_FAILED"] = "IDENTITY_VERIFICATION_FAILED";
|
|
18
|
+
IdentityVerificationStatus["IDENTITY_VERIFICATION_PENDING"] = "IDENTITY_VERIFICATION_PENDING";
|
|
19
|
+
IdentityVerificationStatus["IDENTITY_VERIFICATION_UPDATES_REQUIRED"] = "IDENTITY_VERIFICATION_UPDATES_REQUIRED";
|
|
20
|
+
IdentityVerificationStatus["IDENTITY_VERIFICATION_NOT_STARTED"] = "IDENTITY_VERIFICATION_NOT_STARTED";
|
|
21
|
+
IdentityVerificationStatus["USER_NOT_ONBOARDED"] = "USER_NOT_ONBOARDED";
|
|
22
|
+
})(IdentityVerificationStatus || (IdentityVerificationStatus = {}));
|
|
23
|
+
/**
|
|
24
|
+
* Get wallet's identity verification status.
|
|
25
|
+
*
|
|
26
|
+
* @param {string} walletAddress The wallet address.
|
|
27
|
+
* @param {string} pool The pool address.
|
|
28
|
+
* @param {number} chainId chain Id.
|
|
29
|
+
* @param {boolean} isDev Is dev environment or not.
|
|
30
|
+
* @returns {Promise<VerificationStatusResult>} Promise that returns the verification status result.
|
|
31
|
+
*/
|
|
32
|
+
const getVerificationStatus = async (walletAddress, pool, chainId, isDev = false) => {
|
|
33
|
+
const result = await (0, request_1.requestPut)(`${config_1.configUtil.getIdentityAPIUrl(chainId, isDev)}/wallets/${walletAddress}/verification-status?poolAddress=${pool}`);
|
|
34
|
+
result.isVerified = [IdentityVerificationStatus.ACCREDITED].includes(result.verificationStatus);
|
|
35
|
+
result.isNotOnboarded =
|
|
36
|
+
result.verificationStatus === IdentityVerificationStatus.USER_NOT_ONBOARDED;
|
|
37
|
+
return result;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Onboard user
|
|
41
|
+
*
|
|
42
|
+
* @param {string} walletAddress The wallet address.
|
|
43
|
+
* @param {string} code The investor code.
|
|
44
|
+
* @param {string} pool Pool address.
|
|
45
|
+
* @param {number} chainId chain Id.
|
|
46
|
+
* @param {boolean} isDev Is dev environment or not.
|
|
47
|
+
* @returns {Promise<string>} Promise that returns the onboard result
|
|
48
|
+
*/
|
|
49
|
+
const onboard = async (walletAddress, code, pool, chainId, isDev = false) => (0, request_1.requestPost)(`${config_1.configUtil.getIdentityAPIUrl(chainId, isDev)}/wallets/${walletAddress}/onboard?code=${code}&poolAddress=${pool}`);
|
|
50
|
+
/**
|
|
51
|
+
* Get document signature status
|
|
52
|
+
*
|
|
53
|
+
* @param {string} envelopeId The envelope id.
|
|
54
|
+
* @param {number} chainId chain Id.
|
|
55
|
+
* @param {boolean} isDev Is dev environment or not.
|
|
56
|
+
* @returns {Promise<{envelopeId: string}>} Promise that returns the envelope id
|
|
57
|
+
*/
|
|
58
|
+
const getDocSignatureStatus = async (envelopeId, chainId, isDev = false) => (0, request_1.requestGet)(`${config_1.configUtil.getIdentityAPIUrl(chainId, isDev)}/${envelopeId}/document-signature-status`);
|
|
59
|
+
/**
|
|
60
|
+
* Request document signature
|
|
61
|
+
*
|
|
62
|
+
* @param {string} walletAddress The wallet address.
|
|
63
|
+
* @param {number} chainId chain Id.
|
|
64
|
+
* @param {boolean} isDev Is dev environment or not.
|
|
65
|
+
* @returns {Promise<{envelopeId: string}>} Promise that returns the envelope id
|
|
66
|
+
*/
|
|
67
|
+
const requestDocSignature = async (walletAddress, chainId, isDev = false) => (0, request_1.requestPost)(`${config_1.configUtil.getIdentityAPIUrl(chainId, isDev)}/request-document-signature`, { walletAddress });
|
|
68
|
+
/**
|
|
69
|
+
* Resend document signature link
|
|
70
|
+
*
|
|
71
|
+
* @param {string} envelopeId The envelope id.
|
|
72
|
+
* @param {number} chainId chain Id.
|
|
73
|
+
* @param {boolean} isDev Is dev environment or not.
|
|
74
|
+
* @returns {Promise<{envelopeId: string}>} Promise that returns the envelope id
|
|
75
|
+
*/
|
|
76
|
+
const resendDocSignatureLink = async (envelopeId, chainId, isDev = false) => (0, request_1.requestPost)(`${config_1.configUtil.getIdentityAPIUrl(chainId, isDev)}/resend-document-signature-link`, { envelopeId });
|
|
77
|
+
exports.IdentityService = {
|
|
78
|
+
getVerificationStatus,
|
|
79
|
+
onboard,
|
|
80
|
+
getDocSignatureStatus,
|
|
81
|
+
requestDocSignature,
|
|
82
|
+
resendDocSignatureLink,
|
|
83
|
+
};
|
|
84
84
|
//# sourceMappingURL=IdentityService.js.map
|
|
@@ -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,14 +1,14 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RNService = void 0;
|
|
4
|
-
const config_1 = require("../utils/config");
|
|
5
|
-
const request_1 = require("../utils/request");
|
|
6
|
-
const getRequestInfo = async (requestId, chainId) => {
|
|
7
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
8
|
-
const data = await (0, request_1.requestGet)(`${config_1.configUtil.getRequestAPIUrl(chainId)}/request?id=${requestId}`);
|
|
9
|
-
return data;
|
|
10
|
-
};
|
|
11
|
-
exports.RNService = {
|
|
12
|
-
getRequestInfo,
|
|
13
|
-
};
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RNService = void 0;
|
|
4
|
+
const config_1 = require("../utils/config");
|
|
5
|
+
const request_1 = require("../utils/request");
|
|
6
|
+
const getRequestInfo = async (requestId, chainId) => {
|
|
7
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
8
|
+
const data = await (0, request_1.requestGet)(`${config_1.configUtil.getRequestAPIUrl(chainId)}/request?id=${requestId}`);
|
|
9
|
+
return data;
|
|
10
|
+
};
|
|
11
|
+
exports.RNService = {
|
|
12
|
+
getRequestInfo,
|
|
13
|
+
};
|
|
14
14
|
//# sourceMappingURL=RNService.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './EAService';
|
|
2
|
-
export * from './RNService';
|
|
3
|
-
export * from './IdentityService';
|
|
1
|
+
export * from './EAService';
|
|
2
|
+
export * from './RNService';
|
|
3
|
+
export * from './IdentityService';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
tslib_1.__exportStar(require("./EAService"), exports);
|
|
5
|
-
tslib_1.__exportStar(require("./RNService"), exports);
|
|
6
|
-
tslib_1.__exportStar(require("./IdentityService"), exports);
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./EAService"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./RNService"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./IdentityService"), exports);
|
|
7
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { JsonRpcProvider } from '@ethersproject/providers';
|
|
2
|
-
import { Actions, Connector } from '@web3-react/types';
|
|
3
|
-
export declare class JsonRpcConnector extends Connector {
|
|
4
|
-
customProvider: JsonRpcProvider;
|
|
5
|
-
constructor({ actions, provider, onError, }: {
|
|
6
|
-
actions: Actions;
|
|
7
|
-
provider: JsonRpcProvider;
|
|
8
|
-
onError?: (error: Error) => void;
|
|
9
|
-
});
|
|
10
|
-
activate(): Promise<void>;
|
|
11
|
-
}
|
|
1
|
+
import { JsonRpcProvider } from '@ethersproject/providers';
|
|
2
|
+
import { Actions, Connector } from '@web3-react/types';
|
|
3
|
+
export declare class JsonRpcConnector extends Connector {
|
|
4
|
+
customProvider: JsonRpcProvider;
|
|
5
|
+
constructor({ actions, provider, onError, }: {
|
|
6
|
+
actions: Actions;
|
|
7
|
+
provider: JsonRpcProvider;
|
|
8
|
+
onError?: (error: Error) => void;
|
|
9
|
+
});
|
|
10
|
+
activate(): Promise<void>;
|
|
11
|
+
}
|
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.JsonRpcConnector = void 0;
|
|
4
|
-
const types_1 = require("@web3-react/types");
|
|
5
|
-
function parseChainId(chainId) {
|
|
6
|
-
return Number.parseInt(chainId, 16);
|
|
7
|
-
}
|
|
8
|
-
class JsonRpcConnector extends types_1.Connector {
|
|
9
|
-
constructor({ actions, provider, onError, }) {
|
|
10
|
-
super(actions, onError);
|
|
11
|
-
this.customProvider = provider
|
|
12
|
-
.on('connect', ({ chainId }) => {
|
|
13
|
-
this.actions.update({ chainId: parseChainId(chainId) });
|
|
14
|
-
})
|
|
15
|
-
.on('disconnect', (error) => {
|
|
16
|
-
var _a;
|
|
17
|
-
(_a = this.onError) === null || _a === void 0 ? void 0 : _a.call(this, error);
|
|
18
|
-
this.actions.resetState();
|
|
19
|
-
})
|
|
20
|
-
.on('chainChanged', (chainId) => {
|
|
21
|
-
this.actions.update({ chainId: parseChainId(chainId) });
|
|
22
|
-
})
|
|
23
|
-
.on('accountsChanged', (accounts) => {
|
|
24
|
-
this.actions.update({ accounts });
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
async activate() {
|
|
28
|
-
this.actions.startActivation();
|
|
29
|
-
try {
|
|
30
|
-
const [{ chainId }, accounts] = await Promise.all([
|
|
31
|
-
this.customProvider.getNetwork(),
|
|
32
|
-
this.customProvider.listAccounts(),
|
|
33
|
-
]);
|
|
34
|
-
this.actions.update({ chainId, accounts });
|
|
35
|
-
}
|
|
36
|
-
catch (e) {
|
|
37
|
-
this.actions.resetState();
|
|
38
|
-
throw e;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
exports.JsonRpcConnector = JsonRpcConnector;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.JsonRpcConnector = void 0;
|
|
4
|
+
const types_1 = require("@web3-react/types");
|
|
5
|
+
function parseChainId(chainId) {
|
|
6
|
+
return Number.parseInt(chainId, 16);
|
|
7
|
+
}
|
|
8
|
+
class JsonRpcConnector extends types_1.Connector {
|
|
9
|
+
constructor({ actions, provider, onError, }) {
|
|
10
|
+
super(actions, onError);
|
|
11
|
+
this.customProvider = provider
|
|
12
|
+
.on('connect', ({ chainId }) => {
|
|
13
|
+
this.actions.update({ chainId: parseChainId(chainId) });
|
|
14
|
+
})
|
|
15
|
+
.on('disconnect', (error) => {
|
|
16
|
+
var _a;
|
|
17
|
+
(_a = this.onError) === null || _a === void 0 ? void 0 : _a.call(this, error);
|
|
18
|
+
this.actions.resetState();
|
|
19
|
+
})
|
|
20
|
+
.on('chainChanged', (chainId) => {
|
|
21
|
+
this.actions.update({ chainId: parseChainId(chainId) });
|
|
22
|
+
})
|
|
23
|
+
.on('accountsChanged', (accounts) => {
|
|
24
|
+
this.actions.update({ accounts });
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
async activate() {
|
|
28
|
+
this.actions.startActivation();
|
|
29
|
+
try {
|
|
30
|
+
const [{ chainId }, accounts] = await Promise.all([
|
|
31
|
+
this.customProvider.getNetwork(),
|
|
32
|
+
this.customProvider.listAccounts(),
|
|
33
|
+
]);
|
|
34
|
+
this.actions.update({ chainId, accounts });
|
|
35
|
+
}
|
|
36
|
+
catch (e) {
|
|
37
|
+
this.actions.resetState();
|
|
38
|
+
throw e;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
exports.JsonRpcConnector = JsonRpcConnector;
|
|
43
43
|
//# sourceMappingURL=JsonRpcConnector.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { WalletConnect, WalletConnectConstructorArgs } from '@web3-react/walletconnect';
|
|
2
|
-
export declare class WalletConnectPopup extends WalletConnect {
|
|
3
|
-
constructor({ actions, options, defaultChainId, timeout, onError, }: WalletConnectConstructorArgs);
|
|
4
|
-
}
|
|
5
|
-
export declare class WalletConnectQR extends WalletConnect {
|
|
6
|
-
static SVG_AVAILABLE: string;
|
|
7
|
-
svg?: string;
|
|
8
|
-
constructor({ actions, options, defaultChainId, timeout, onError, }: WalletConnectConstructorArgs);
|
|
9
|
-
deactivate(): Promise<void>;
|
|
10
|
-
}
|
|
1
|
+
import { WalletConnect, WalletConnectConstructorArgs } from '@web3-react/walletconnect';
|
|
2
|
+
export declare class WalletConnectPopup extends WalletConnect {
|
|
3
|
+
constructor({ actions, options, defaultChainId, timeout, onError, }: WalletConnectConstructorArgs);
|
|
4
|
+
}
|
|
5
|
+
export declare class WalletConnectQR extends WalletConnect {
|
|
6
|
+
static SVG_AVAILABLE: string;
|
|
7
|
+
svg?: string;
|
|
8
|
+
constructor({ actions, options, defaultChainId, timeout, onError, }: WalletConnectConstructorArgs);
|
|
9
|
+
deactivate(): Promise<void>;
|
|
10
|
+
}
|
|
@@ -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,36 +1,39 @@
|
|
|
1
|
-
import type { AddEthereumChainParameter } from '@web3-react/types';
|
|
2
|
-
export interface BasicChainInformation {
|
|
3
|
-
id: number;
|
|
4
|
-
urls: string[];
|
|
5
|
-
name: string;
|
|
6
|
-
explorer: string;
|
|
7
|
-
wait: number;
|
|
8
|
-
requestAPIUrl?: string | undefined;
|
|
9
|
-
isTestnet: boolean;
|
|
10
|
-
icon: string;
|
|
11
|
-
}
|
|
12
|
-
interface ExtendedChainInformation extends BasicChainInformation {
|
|
13
|
-
nativeCurrency: AddEthereumChainParameter['nativeCurrency'];
|
|
14
|
-
blockExplorerUrls: AddEthereumChainParameter['blockExplorerUrls'];
|
|
15
|
-
}
|
|
16
|
-
export declare enum ChainEnum {
|
|
17
|
-
Polygon = 137,
|
|
18
|
-
Goerli = 5,
|
|
19
|
-
Mumbai = 80001
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
export
|
|
1
|
+
import type { AddEthereumChainParameter } from '@web3-react/types';
|
|
2
|
+
export interface BasicChainInformation {
|
|
3
|
+
id: number;
|
|
4
|
+
urls: string[];
|
|
5
|
+
name: string;
|
|
6
|
+
explorer: string;
|
|
7
|
+
wait: number;
|
|
8
|
+
requestAPIUrl?: string | undefined;
|
|
9
|
+
isTestnet: boolean;
|
|
10
|
+
icon: string;
|
|
11
|
+
}
|
|
12
|
+
interface ExtendedChainInformation extends BasicChainInformation {
|
|
13
|
+
nativeCurrency: AddEthereumChainParameter['nativeCurrency'];
|
|
14
|
+
blockExplorerUrls: AddEthereumChainParameter['blockExplorerUrls'];
|
|
15
|
+
}
|
|
16
|
+
export declare enum ChainEnum {
|
|
17
|
+
Polygon = 137,
|
|
18
|
+
Goerli = 5,
|
|
19
|
+
Mumbai = 80001,
|
|
20
|
+
Celo = 42220,
|
|
21
|
+
Alfajores = 44787
|
|
22
|
+
}
|
|
23
|
+
export declare const SupportedChainIds: ChainEnum[];
|
|
24
|
+
export declare const CHAINS: {
|
|
25
|
+
[chainId: number]: BasicChainInformation | ExtendedChainInformation;
|
|
26
|
+
};
|
|
27
|
+
export declare function getAddChainParameters(chainId: number): AddEthereumChainParameter | number;
|
|
28
|
+
export declare const URLS: {
|
|
29
|
+
[chainId: number]: string[];
|
|
30
|
+
};
|
|
31
|
+
export declare const getWalletAddressAbbr: (address: string) => string;
|
|
32
|
+
/**
|
|
33
|
+
* Returns the input chain ID if chain is supported. If not, return undefined
|
|
34
|
+
* @param chainId a chain ID, which will be returned if it is a supported chain ID
|
|
35
|
+
*/
|
|
36
|
+
export declare function supportedChainId(chainId: number | undefined): ChainEnum | undefined;
|
|
37
|
+
export declare function findChainIdByName(chainName: string): number | undefined;
|
|
38
|
+
export declare function getExplorerUrl(chainId: number | undefined, hash: string, type: 'tx' | 'address'): string | null;
|
|
39
|
+
export {};
|