@huma-finance/shared 0.0.30 → 0.0.32
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/dist/abis/BaseCreditPool.json +1179 -1179
- package/dist/abis/BaseFeeManager.json +480 -480
- package/dist/abis/BasePoolConfig.json +1364 -1364
- package/dist/abis/ERC20TransferableReceivable.json +648 -648
- package/dist/abis/HDT.json +512 -512
- package/dist/abis/IConstantFlowAgreementV1.json +890 -890
- package/dist/abis/ISuperfluid.json +1122 -1122
- package/dist/abis/InvoiceNFT.json +625 -625
- package/dist/abis/Multisend.json +26 -26
- package/dist/abis/RealWorldReceivable.json +823 -823
- package/dist/abis/ReceivableFactoringPool.json +1529 -1529
- package/dist/abis/StreamFactoringPool.json +1523 -1523
- package/dist/abis/StreamFeeManager.json +522 -522
- package/dist/abis/SuperfluidPoolProcessor.json +692 -692
- package/dist/abis/TestERC20.json +358 -358
- package/dist/abis/TradableStream.json +850 -850
- package/dist/abis/Transfer.json +24 -24
- package/dist/abis/TransferNFT.json +27 -27
- package/dist/abis/erc20.json +117 -117
- package/dist/abis/erc2612.json +132 -132
- package/dist/abis/erc721.json +673 -673
- package/dist/abis/index.d.ts +3 -3
- package/dist/abis/index.js +3 -3
- package/dist/abis/types/BaseCreditPool.d.ts +803 -803
- package/dist/abis/types/BaseCreditPool.js +1 -1
- package/dist/abis/types/BaseFeeManager.d.ts +408 -408
- package/dist/abis/types/BaseFeeManager.js +1 -1
- package/dist/abis/types/BasePoolConfig.d.ts +1097 -1097
- package/dist/abis/types/BasePoolConfig.js +1 -1
- package/dist/abis/types/ERC20TransferableReceivable.d.ts +407 -407
- package/dist/abis/types/ERC20TransferableReceivable.js +1 -1
- package/dist/abis/types/Erc20.d.ts +168 -168
- package/dist/abis/types/Erc20.js +1 -1
- package/dist/abis/types/Erc2612.d.ts +192 -192
- package/dist/abis/types/Erc2612.js +1 -1
- package/dist/abis/types/Erc721.d.ts +474 -474
- package/dist/abis/types/Erc721.js +1 -1
- package/dist/abis/types/HDT.d.ts +369 -369
- package/dist/abis/types/HDT.js +1 -1
- package/dist/abis/types/IConstantFlowAgreementV1.d.ts +573 -573
- package/dist/abis/types/IConstantFlowAgreementV1.js +1 -1
- package/dist/abis/types/ISuperfluid.d.ts +728 -728
- package/dist/abis/types/ISuperfluid.js +1 -1
- package/dist/abis/types/InvoiceNFT.d.ts +425 -425
- package/dist/abis/types/InvoiceNFT.js +1 -1
- package/dist/abis/types/Multisend.d.ts +50 -50
- package/dist/abis/types/Multisend.js +1 -1
- package/dist/abis/types/RealWorldReceivable.d.ts +564 -564
- package/dist/abis/types/RealWorldReceivable.js +1 -1
- package/dist/abis/types/ReceivableFactoringPool.d.ts +999 -999
- package/dist/abis/types/ReceivableFactoringPool.js +1 -1
- package/dist/abis/types/StreamFactoringPool.d.ts +985 -985
- package/dist/abis/types/StreamFactoringPool.js +1 -1
- package/dist/abis/types/StreamFeeManager.d.ts +440 -440
- package/dist/abis/types/StreamFeeManager.js +1 -1
- package/dist/abis/types/SuperfluidPoolProcessor.d.ts +398 -398
- package/dist/abis/types/SuperfluidPoolProcessor.js +1 -1
- package/dist/abis/types/TestERC20.d.ts +270 -270
- package/dist/abis/types/TestERC20.js +1 -1
- package/dist/abis/types/TradableStream.d.ts +607 -607
- package/dist/abis/types/TradableStream.js +1 -1
- package/dist/abis/types/Transfer.d.ts +45 -45
- package/dist/abis/types/Transfer.js +1 -1
- package/dist/abis/types/TransferNFT.d.ts +45 -45
- package/dist/abis/types/TransferNFT.js +1 -1
- package/dist/abis/types/common.d.ts +22 -22
- package/dist/abis/types/common.js +1 -1
- package/dist/abis/types/factories/BaseCreditPool__factory.d.ts +931 -931
- package/dist/abis/types/factories/BaseCreditPool__factory.js +1193 -1192
- package/dist/abis/types/factories/BaseCreditPool__factory.js.map +1 -1
- package/dist/abis/types/factories/BaseFeeManager__factory.d.ts +379 -379
- package/dist/abis/types/factories/BaseFeeManager__factory.js +494 -493
- package/dist/abis/types/factories/BaseFeeManager__factory.js.map +1 -1
- package/dist/abis/types/factories/BasePoolConfig__factory.d.ts +1074 -1074
- package/dist/abis/types/factories/BasePoolConfig__factory.js +1378 -1377
- package/dist/abis/types/factories/BasePoolConfig__factory.js.map +1 -1
- package/dist/abis/types/factories/ERC20TransferableReceivable__factory.d.ts +508 -508
- package/dist/abis/types/factories/ERC20TransferableReceivable__factory.js +662 -661
- package/dist/abis/types/factories/ERC20TransferableReceivable__factory.js.map +1 -1
- package/dist/abis/types/factories/Erc20__factory.d.ts +175 -175
- package/dist/abis/types/factories/Erc20__factory.js +236 -235
- package/dist/abis/types/factories/Erc20__factory.js.map +1 -1
- package/dist/abis/types/factories/Erc2612__factory.d.ts +209 -209
- package/dist/abis/types/factories/Erc2612__factory.js +279 -278
- package/dist/abis/types/factories/Erc2612__factory.js.map +1 -1
- package/dist/abis/types/factories/Erc721__factory.d.ts +539 -539
- package/dist/abis/types/factories/Erc721__factory.js +687 -686
- package/dist/abis/types/factories/Erc721__factory.js.map +1 -1
- package/dist/abis/types/factories/HDT__factory.d.ts +399 -399
- package/dist/abis/types/factories/HDT__factory.js +526 -525
- package/dist/abis/types/factories/HDT__factory.js.map +1 -1
- package/dist/abis/types/factories/IConstantFlowAgreementV1__factory.d.ts +695 -695
- package/dist/abis/types/factories/IConstantFlowAgreementV1__factory.js +904 -903
- package/dist/abis/types/factories/IConstantFlowAgreementV1__factory.js.map +1 -1
- package/dist/abis/types/factories/ISuperfluid__factory.d.ts +866 -866
- package/dist/abis/types/factories/ISuperfluid__factory.js +1136 -1135
- package/dist/abis/types/factories/ISuperfluid__factory.js.map +1 -1
- package/dist/abis/types/factories/InvoiceNFT__factory.d.ts +489 -489
- package/dist/abis/types/factories/InvoiceNFT__factory.js +639 -638
- package/dist/abis/types/factories/InvoiceNFT__factory.js.map +1 -1
- package/dist/abis/types/factories/Multisend__factory.d.ts +26 -26
- package/dist/abis/types/factories/Multisend__factory.js +40 -39
- package/dist/abis/types/factories/Multisend__factory.js.map +1 -1
- package/dist/abis/types/factories/RealWorldReceivable__factory.d.ts +645 -645
- package/dist/abis/types/factories/RealWorldReceivable__factory.js +837 -836
- package/dist/abis/types/factories/RealWorldReceivable__factory.js.map +1 -1
- package/dist/abis/types/factories/ReceivableFactoringPool__factory.d.ts +1204 -1204
- package/dist/abis/types/factories/ReceivableFactoringPool__factory.js +1543 -1542
- package/dist/abis/types/factories/ReceivableFactoringPool__factory.js.map +1 -1
- package/dist/abis/types/factories/StreamFactoringPool__factory.d.ts +1200 -1200
- package/dist/abis/types/factories/StreamFactoringPool__factory.js +1537 -1536
- package/dist/abis/types/factories/StreamFactoringPool__factory.js.map +1 -1
- package/dist/abis/types/factories/StreamFeeManager__factory.d.ts +412 -412
- package/dist/abis/types/factories/StreamFeeManager__factory.js +536 -535
- package/dist/abis/types/factories/StreamFeeManager__factory.js.map +1 -1
- package/dist/abis/types/factories/SuperfluidPoolProcessor__factory.d.ts +546 -546
- package/dist/abis/types/factories/SuperfluidPoolProcessor__factory.js +706 -705
- package/dist/abis/types/factories/SuperfluidPoolProcessor__factory.js.map +1 -1
- package/dist/abis/types/factories/TestERC20__factory.d.ts +280 -280
- package/dist/abis/types/factories/TestERC20__factory.js +372 -371
- package/dist/abis/types/factories/TestERC20__factory.js.map +1 -1
- package/dist/abis/types/factories/TradableStream__factory.d.ts +663 -663
- package/dist/abis/types/factories/TradableStream__factory.js +864 -863
- package/dist/abis/types/factories/TradableStream__factory.js.map +1 -1
- package/dist/abis/types/factories/TransferNFT__factory.d.ts +28 -28
- package/dist/abis/types/factories/TransferNFT__factory.js +41 -40
- package/dist/abis/types/factories/TransferNFT__factory.js.map +1 -1
- package/dist/abis/types/factories/Transfer__factory.d.ts +25 -25
- package/dist/abis/types/factories/Transfer__factory.js +38 -37
- package/dist/abis/types/factories/Transfer__factory.js.map +1 -1
- 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/hooks/web3/index.js +2 -2
- package/dist/cjs/hooks/web3/index.js.map +1 -1
- package/dist/cjs/services/IdentityService.d.ts +17 -0
- package/dist/cjs/services/IdentityService.js +31 -4
- package/dist/cjs/services/IdentityService.js.map +1 -1
- package/dist/cjs/utils/chain.d.ts +3 -1
- package/dist/cjs/utils/chain.js +9 -1
- package/dist/cjs/utils/chain.js.map +1 -1
- package/dist/cjs/utils/config.d.ts +1 -0
- package/dist/cjs/utils/config.js +10 -1
- package/dist/cjs/utils/config.js.map +1 -1
- package/dist/cjs/utils/index.d.ts +2 -0
- package/dist/cjs/utils/index.js +2 -0
- package/dist/cjs/utils/index.js.map +1 -1
- package/dist/cjs/utils/notifi.d.ts +3 -0
- package/dist/cjs/utils/notifi.js +40 -0
- package/dist/cjs/utils/notifi.js.map +1 -0
- package/dist/cjs/utils/number.js +7 -1
- package/dist/cjs/utils/number.js.map +1 -1
- package/dist/cjs/utils/pool.d.ts +1 -0
- package/dist/cjs/utils/pool.js +9 -6
- package/dist/cjs/utils/pool.js.map +1 -1
- package/dist/cjs/utils/realWorldReceivable.d.ts +12 -0
- package/dist/cjs/utils/realWorldReceivable.js +3 -0
- package/dist/cjs/utils/realWorldReceivable.js.map +1 -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/useContract.d.ts +7 -7
- 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/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/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/usePoolContract.d.ts +73 -73
- package/dist/hooks/useRFPoolContract.d.ts +22 -22
- 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 +2 -2
- package/dist/hooks/web3/index.js.map +1 -1
- 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/index.d.ts +5 -5
- package/dist/services/EAService.d.ts +153 -153
- package/dist/services/IdentityService.d.ts +17 -0
- package/dist/services/IdentityService.js +32 -5
- package/dist/services/IdentityService.js.map +1 -1
- package/dist/services/RNService.d.ts +14 -14
- package/dist/services/index.d.ts +3 -3
- 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 +50 -49
- package/dist/utils/WalletConnect.js.map +1 -1
- package/dist/utils/chain.d.ts +3 -1
- package/dist/utils/chain.js +7 -0
- package/dist/utils/chain.js.map +1 -1
- package/dist/utils/common.d.ts +4 -4
- package/dist/utils/common.js +10 -10
- package/dist/utils/config.d.ts +1 -0
- package/dist/utils/config.js +10 -1
- package/dist/utils/config.js.map +1 -1
- 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/credit.d.ts +21 -21
- package/dist/utils/credit.js +35 -35
- package/dist/utils/errors.d.ts +26 -26
- package/dist/utils/errors.js +39 -39
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.js +2 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/jsonRpcEndpoints.d.ts +12 -12
- package/dist/utils/notifi.d.ts +3 -0
- package/dist/utils/notifi.js +35 -0
- package/dist/utils/notifi.js.map +1 -0
- package/dist/utils/number.d.ts +5 -5
- package/dist/utils/number.js +7 -1
- package/dist/utils/number.js.map +1 -1
- package/dist/utils/pool.d.ts +1 -0
- package/dist/utils/pool.js +9 -6
- package/dist/utils/pool.js.map +1 -1
- package/dist/utils/realWorldReceivable.d.ts +12 -0
- package/dist/utils/realWorldReceivable.js +2 -0
- package/dist/utils/realWorldReceivable.js.map +1 -0
- 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/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 +3 -3
|
@@ -1,153 +1,153 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Object representing the token information of the approval.
|
|
3
|
-
* @typedef {Object} Token
|
|
4
|
-
* @property {string} symbol The symbol of the base token of the pool.
|
|
5
|
-
* @property {string} name The name of the base token of the pool.
|
|
6
|
-
* @property {number} decimal The number of decimals for the base token of the pool.
|
|
7
|
-
*/
|
|
8
|
-
type Token = {
|
|
9
|
-
symbol: string;
|
|
10
|
-
name: string;
|
|
11
|
-
decimal: number;
|
|
12
|
-
};
|
|
13
|
-
/**
|
|
14
|
-
* Object representing the approved loan terms.
|
|
15
|
-
* @typedef {Object} Terms
|
|
16
|
-
* @property {string} creditLimit The credit limit for the borrower in the pool's base currency.
|
|
17
|
-
* @property {string} creditLimitFormatted The credit limit for the borrower in the pool's base currency, formatted with that tokens' decimals.
|
|
18
|
-
* @property {number} intervalInDays The interval in days for credit line rebalancing.
|
|
19
|
-
* @property {number} remainingPeriods The number of remaining payback periods in the credit line.
|
|
20
|
-
* @property {number} aprInBps The annual percentage rate in basis points.
|
|
21
|
-
*/
|
|
22
|
-
type Terms = {
|
|
23
|
-
creditLimit: string;
|
|
24
|
-
creditLimitFormatted: string;
|
|
25
|
-
intervalInDays: number;
|
|
26
|
-
remainingPeriods: number;
|
|
27
|
-
aprInBps: number;
|
|
28
|
-
};
|
|
29
|
-
/**
|
|
30
|
-
* Object representing receivable information of the approval.
|
|
31
|
-
* @typedef {Object} Receivable
|
|
32
|
-
* @property {string} asset The address of the receivable asset contract.
|
|
33
|
-
* @property {number|string} param The identifying parameter for the receivable asset, often the token ID of an ERC721.
|
|
34
|
-
* @property {string} amount The expected payment amount of the receivable asset.
|
|
35
|
-
* @property {string} amountFormatted The expected payment amount of the receivable asset, formatted with that tokens' decimals.
|
|
36
|
-
*/
|
|
37
|
-
type Receivable = {
|
|
38
|
-
asset: string;
|
|
39
|
-
param: string;
|
|
40
|
-
amount: string;
|
|
41
|
-
amountFormatted: string;
|
|
42
|
-
};
|
|
43
|
-
/**
|
|
44
|
-
* Object representing EA approval.
|
|
45
|
-
* @typedef {Object} Approval
|
|
46
|
-
* @property {Token} token The token information for the approval.
|
|
47
|
-
* @property {Terms} terms The approved loan terms.
|
|
48
|
-
* @property {Receivable} receivable The receivable information.
|
|
49
|
-
*/
|
|
50
|
-
export type Approval = {
|
|
51
|
-
token: Token;
|
|
52
|
-
terms: Terms;
|
|
53
|
-
receivable?: Receivable;
|
|
54
|
-
};
|
|
55
|
-
/**
|
|
56
|
-
* Object representing EA rejection.
|
|
57
|
-
* @typedef {Object} Rejection
|
|
58
|
-
* @property {string[]} reasons Rejection reasons.
|
|
59
|
-
*/
|
|
60
|
-
export type Rejection = {
|
|
61
|
-
reasons: string[];
|
|
62
|
-
};
|
|
63
|
-
/**
|
|
64
|
-
* Object representing the response to the underwriting approval request.
|
|
65
|
-
* @typedef {Object} ApprovalResult
|
|
66
|
-
* @property {Approval | Rejection} result the EA decision, either an approval or rejection.
|
|
67
|
-
*/
|
|
68
|
-
export type ApprovalResult = {
|
|
69
|
-
result: Approval | Rejection;
|
|
70
|
-
};
|
|
71
|
-
/**
|
|
72
|
-
* Object representing the receivable in an underwriting request.
|
|
73
|
-
* @typedef {Object} ReceivableRequest
|
|
74
|
-
* @property {string} address The address of the receivable asset contract.
|
|
75
|
-
* @property {string} [param] The parameter for the receivable asset. E.g. For Request Network integrations,
|
|
76
|
-
* this would be the request ID associated with the ERC20TransferableReceivable.
|
|
77
|
-
*/
|
|
78
|
-
type ReceivableRequest = {
|
|
79
|
-
address: string;
|
|
80
|
-
param?: string;
|
|
81
|
-
};
|
|
82
|
-
/**
|
|
83
|
-
* Object representing the additional data required for a receivable-based underwriting request.
|
|
84
|
-
* @typedef {Object} EARequestContextReceivable
|
|
85
|
-
* @property {ReceivableRequest} receivable The receivable information.
|
|
86
|
-
*/
|
|
87
|
-
type EARequestContextReceivable = {
|
|
88
|
-
receivable: ReceivableRequest;
|
|
89
|
-
};
|
|
90
|
-
/**
|
|
91
|
-
* Object representing the additional data required for a stream factoring underwriting request.
|
|
92
|
-
* @typedef {Object} EARequestContextStream
|
|
93
|
-
* @property {ReceivableRequest} receivable The receivable information.
|
|
94
|
-
* @property {string} payerWalletAddress The address of the payer.
|
|
95
|
-
* @property {string} superToken The address of the SuperToken contract.
|
|
96
|
-
*/
|
|
97
|
-
type EARequestContextStream = {
|
|
98
|
-
receivable: ReceivableRequest;
|
|
99
|
-
payerWalletAddress: string;
|
|
100
|
-
superToken: string;
|
|
101
|
-
};
|
|
102
|
-
/**
|
|
103
|
-
* Object that represents the payload for an underwriting request.
|
|
104
|
-
* @typedef {Object} EAPayload
|
|
105
|
-
* @property {string} poolAddress The pool address to approve.
|
|
106
|
-
* @property {string} borrowerWalletAddress The address of the borrower.
|
|
107
|
-
* @property {EARequestContextReceivable | EARequestContextStream} [context] Extra values to submit with the approval request.
|
|
108
|
-
*/
|
|
109
|
-
export type EAPayload = {
|
|
110
|
-
poolAddress: string;
|
|
111
|
-
borrowerWalletAddress: string;
|
|
112
|
-
context?: EARequestContextReceivable | EARequestContextStream;
|
|
113
|
-
};
|
|
114
|
-
/**
|
|
115
|
-
* Object representing the response to the underwriting preapproval request.
|
|
116
|
-
* @typedef {Object} PreapprovalResult
|
|
117
|
-
* @property {boolean} approved the EA decision, either an approval or rejection.
|
|
118
|
-
* @property {string[]} [rejectionReasons] The reasons for rejection, if any
|
|
119
|
-
*/
|
|
120
|
-
export type PreapprovalResult = {
|
|
121
|
-
approved: boolean;
|
|
122
|
-
rejectionReasons?: string[];
|
|
123
|
-
};
|
|
124
|
-
/**
|
|
125
|
-
* Object that includes extra data to be submitted to the underwriting preapproval request when
|
|
126
|
-
* checking for receivable requests
|
|
127
|
-
* @typedef {Object} EAPreapproveContextReceivable
|
|
128
|
-
* @property {string} payerWalletAddress The wallet of the payer of the receivable
|
|
129
|
-
*/
|
|
130
|
-
type EAPreapproveContextReceivable = {
|
|
131
|
-
payerWalletAddress: string;
|
|
132
|
-
};
|
|
133
|
-
/**
|
|
134
|
-
* Object that represents the payload for a preapprove check.
|
|
135
|
-
* @typedef {Object} EAPreapprovalPayload
|
|
136
|
-
* @property {string} poolAddress The pool address to approve.
|
|
137
|
-
* @property {string} borrowerWalletAddress The address of the borrower.
|
|
138
|
-
* @property {EAPreapproveContextReceivable} [context] Extra values to submit with the preapproval request.
|
|
139
|
-
*/
|
|
140
|
-
export type EAPreapprovalPayload = {
|
|
141
|
-
poolAddress: string;
|
|
142
|
-
borrowerWalletAddress: string;
|
|
143
|
-
context?: EAPreapproveContextReceivable;
|
|
144
|
-
};
|
|
145
|
-
export declare const EAService: {
|
|
146
|
-
approve: (payload: EAPayload, chainId: number, isDev?: boolean) => Promise<Approval>;
|
|
147
|
-
approveLender: (payload: {
|
|
148
|
-
poolAddress: string;
|
|
149
|
-
lenderWalletAddress: string;
|
|
150
|
-
}, chainId: number) => Promise<ApprovalResult>;
|
|
151
|
-
preapprove: (payload: EAPreapprovalPayload, chainId: number, isDev?: boolean) => Promise<PreapprovalResult>;
|
|
152
|
-
};
|
|
153
|
-
export {};
|
|
1
|
+
/**
|
|
2
|
+
* Object representing the token information of the approval.
|
|
3
|
+
* @typedef {Object} Token
|
|
4
|
+
* @property {string} symbol The symbol of the base token of the pool.
|
|
5
|
+
* @property {string} name The name of the base token of the pool.
|
|
6
|
+
* @property {number} decimal The number of decimals for the base token of the pool.
|
|
7
|
+
*/
|
|
8
|
+
type Token = {
|
|
9
|
+
symbol: string;
|
|
10
|
+
name: string;
|
|
11
|
+
decimal: number;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Object representing the approved loan terms.
|
|
15
|
+
* @typedef {Object} Terms
|
|
16
|
+
* @property {string} creditLimit The credit limit for the borrower in the pool's base currency.
|
|
17
|
+
* @property {string} creditLimitFormatted The credit limit for the borrower in the pool's base currency, formatted with that tokens' decimals.
|
|
18
|
+
* @property {number} intervalInDays The interval in days for credit line rebalancing.
|
|
19
|
+
* @property {number} remainingPeriods The number of remaining payback periods in the credit line.
|
|
20
|
+
* @property {number} aprInBps The annual percentage rate in basis points.
|
|
21
|
+
*/
|
|
22
|
+
type Terms = {
|
|
23
|
+
creditLimit: string;
|
|
24
|
+
creditLimitFormatted: string;
|
|
25
|
+
intervalInDays: number;
|
|
26
|
+
remainingPeriods: number;
|
|
27
|
+
aprInBps: number;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Object representing receivable information of the approval.
|
|
31
|
+
* @typedef {Object} Receivable
|
|
32
|
+
* @property {string} asset The address of the receivable asset contract.
|
|
33
|
+
* @property {number|string} param The identifying parameter for the receivable asset, often the token ID of an ERC721.
|
|
34
|
+
* @property {string} amount The expected payment amount of the receivable asset.
|
|
35
|
+
* @property {string} amountFormatted The expected payment amount of the receivable asset, formatted with that tokens' decimals.
|
|
36
|
+
*/
|
|
37
|
+
type Receivable = {
|
|
38
|
+
asset: string;
|
|
39
|
+
param: string;
|
|
40
|
+
amount: string;
|
|
41
|
+
amountFormatted: string;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Object representing EA approval.
|
|
45
|
+
* @typedef {Object} Approval
|
|
46
|
+
* @property {Token} token The token information for the approval.
|
|
47
|
+
* @property {Terms} terms The approved loan terms.
|
|
48
|
+
* @property {Receivable} receivable The receivable information.
|
|
49
|
+
*/
|
|
50
|
+
export type Approval = {
|
|
51
|
+
token: Token;
|
|
52
|
+
terms: Terms;
|
|
53
|
+
receivable?: Receivable;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Object representing EA rejection.
|
|
57
|
+
* @typedef {Object} Rejection
|
|
58
|
+
* @property {string[]} reasons Rejection reasons.
|
|
59
|
+
*/
|
|
60
|
+
export type Rejection = {
|
|
61
|
+
reasons: string[];
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Object representing the response to the underwriting approval request.
|
|
65
|
+
* @typedef {Object} ApprovalResult
|
|
66
|
+
* @property {Approval | Rejection} result the EA decision, either an approval or rejection.
|
|
67
|
+
*/
|
|
68
|
+
export type ApprovalResult = {
|
|
69
|
+
result: Approval | Rejection;
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* Object representing the receivable in an underwriting request.
|
|
73
|
+
* @typedef {Object} ReceivableRequest
|
|
74
|
+
* @property {string} address The address of the receivable asset contract.
|
|
75
|
+
* @property {string} [param] The parameter for the receivable asset. E.g. For Request Network integrations,
|
|
76
|
+
* this would be the request ID associated with the ERC20TransferableReceivable.
|
|
77
|
+
*/
|
|
78
|
+
type ReceivableRequest = {
|
|
79
|
+
address: string;
|
|
80
|
+
param?: string;
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* Object representing the additional data required for a receivable-based underwriting request.
|
|
84
|
+
* @typedef {Object} EARequestContextReceivable
|
|
85
|
+
* @property {ReceivableRequest} receivable The receivable information.
|
|
86
|
+
*/
|
|
87
|
+
type EARequestContextReceivable = {
|
|
88
|
+
receivable: ReceivableRequest;
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* Object representing the additional data required for a stream factoring underwriting request.
|
|
92
|
+
* @typedef {Object} EARequestContextStream
|
|
93
|
+
* @property {ReceivableRequest} receivable The receivable information.
|
|
94
|
+
* @property {string} payerWalletAddress The address of the payer.
|
|
95
|
+
* @property {string} superToken The address of the SuperToken contract.
|
|
96
|
+
*/
|
|
97
|
+
type EARequestContextStream = {
|
|
98
|
+
receivable: ReceivableRequest;
|
|
99
|
+
payerWalletAddress: string;
|
|
100
|
+
superToken: string;
|
|
101
|
+
};
|
|
102
|
+
/**
|
|
103
|
+
* Object that represents the payload for an underwriting request.
|
|
104
|
+
* @typedef {Object} EAPayload
|
|
105
|
+
* @property {string} poolAddress The pool address to approve.
|
|
106
|
+
* @property {string} borrowerWalletAddress The address of the borrower.
|
|
107
|
+
* @property {EARequestContextReceivable | EARequestContextStream} [context] Extra values to submit with the approval request.
|
|
108
|
+
*/
|
|
109
|
+
export type EAPayload = {
|
|
110
|
+
poolAddress: string;
|
|
111
|
+
borrowerWalletAddress: string;
|
|
112
|
+
context?: EARequestContextReceivable | EARequestContextStream;
|
|
113
|
+
};
|
|
114
|
+
/**
|
|
115
|
+
* Object representing the response to the underwriting preapproval request.
|
|
116
|
+
* @typedef {Object} PreapprovalResult
|
|
117
|
+
* @property {boolean} approved the EA decision, either an approval or rejection.
|
|
118
|
+
* @property {string[]} [rejectionReasons] The reasons for rejection, if any
|
|
119
|
+
*/
|
|
120
|
+
export type PreapprovalResult = {
|
|
121
|
+
approved: boolean;
|
|
122
|
+
rejectionReasons?: string[];
|
|
123
|
+
};
|
|
124
|
+
/**
|
|
125
|
+
* Object that includes extra data to be submitted to the underwriting preapproval request when
|
|
126
|
+
* checking for receivable requests
|
|
127
|
+
* @typedef {Object} EAPreapproveContextReceivable
|
|
128
|
+
* @property {string} payerWalletAddress The wallet of the payer of the receivable
|
|
129
|
+
*/
|
|
130
|
+
type EAPreapproveContextReceivable = {
|
|
131
|
+
payerWalletAddress: string;
|
|
132
|
+
};
|
|
133
|
+
/**
|
|
134
|
+
* Object that represents the payload for a preapprove check.
|
|
135
|
+
* @typedef {Object} EAPreapprovalPayload
|
|
136
|
+
* @property {string} poolAddress The pool address to approve.
|
|
137
|
+
* @property {string} borrowerWalletAddress The address of the borrower.
|
|
138
|
+
* @property {EAPreapproveContextReceivable} [context] Extra values to submit with the preapproval request.
|
|
139
|
+
*/
|
|
140
|
+
export type EAPreapprovalPayload = {
|
|
141
|
+
poolAddress: string;
|
|
142
|
+
borrowerWalletAddress: string;
|
|
143
|
+
context?: EAPreapproveContextReceivable;
|
|
144
|
+
};
|
|
145
|
+
export declare const EAService: {
|
|
146
|
+
approve: (payload: EAPayload, chainId: number, isDev?: boolean) => Promise<Approval>;
|
|
147
|
+
approveLender: (payload: {
|
|
148
|
+
poolAddress: string;
|
|
149
|
+
lenderWalletAddress: string;
|
|
150
|
+
}, chainId: number) => Promise<ApprovalResult>;
|
|
151
|
+
preapprove: (payload: EAPreapprovalPayload, chainId: number, isDev?: boolean) => Promise<PreapprovalResult>;
|
|
152
|
+
};
|
|
153
|
+
export {};
|
|
@@ -28,8 +28,25 @@ export type VerificationStatusResult = {
|
|
|
28
28
|
isVerified: boolean;
|
|
29
29
|
isNotOnboarded: boolean;
|
|
30
30
|
};
|
|
31
|
+
/**
|
|
32
|
+
* Object representing the response to the document signature status request.
|
|
33
|
+
* @typedef {Object} DocSignatureStatus
|
|
34
|
+
* @property {string} envelopeId the envelope id to get the document signature status.
|
|
35
|
+
* @property {string} status the document signature status.
|
|
36
|
+
*/
|
|
37
|
+
export type DocSignatureStatus = {
|
|
38
|
+
envelopeId: string;
|
|
39
|
+
status: 'completed' | 'created' | 'declined' | 'deleted' | 'delivered' | 'processing' | 'sent' | 'signed' | 'template' | 'voided';
|
|
40
|
+
};
|
|
31
41
|
export declare const IdentityService: {
|
|
32
42
|
getVerificationStatus: (walletAddress: string, pool: string, chainId: number, isDev?: boolean) => Promise<VerificationStatusResult>;
|
|
33
43
|
onboard: (walletAddress: string, code: string, pool: string, chainId: number, isDev?: boolean) => Promise<string>;
|
|
44
|
+
getDocSignatureStatus: (envelopeId: string, chainId: number, isDev?: boolean) => Promise<DocSignatureStatus>;
|
|
45
|
+
requestDocSignature: (walletAddress: string, chainId: number, isDev?: boolean) => Promise<{
|
|
46
|
+
envelopeId: string;
|
|
47
|
+
}>;
|
|
48
|
+
resendDocSignatureLink: (envelopeId: string, chainId: number, isDev?: boolean) => Promise<{
|
|
49
|
+
envelopeId: string;
|
|
50
|
+
}>;
|
|
34
51
|
};
|
|
35
52
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { configUtil } from '../utils/config';
|
|
2
|
-
import { requestPost, requestPut } from '../utils/request';
|
|
2
|
+
import { requestGet, requestPost, requestPut } from '../utils/request';
|
|
3
3
|
/**
|
|
4
4
|
* Enum representing the identity status.
|
|
5
5
|
* @typedef {Enum} IdentityStatus
|
|
@@ -43,12 +43,39 @@ const getVerificationStatus = async (walletAddress, pool, chainId, isDev = false
|
|
|
43
43
|
* @param {boolean} isDev Is dev environment or not.
|
|
44
44
|
* @returns {Promise<string>} Promise that returns the onboard result
|
|
45
45
|
*/
|
|
46
|
-
const onboard = async (walletAddress, code, pool, chainId, isDev = false) => {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
const onboard = async (walletAddress, code, pool, chainId, isDev = false) => requestPost(`${configUtil.getIdentityAPIUrl(chainId, isDev)}/wallets/${walletAddress}/onboard?code=${code}&poolAddress=${pool}`);
|
|
47
|
+
/**
|
|
48
|
+
* Get document signature status
|
|
49
|
+
*
|
|
50
|
+
* @param {string} envelopeId The envelope id.
|
|
51
|
+
* @param {number} chainId chain Id.
|
|
52
|
+
* @param {boolean} isDev Is dev environment or not.
|
|
53
|
+
* @returns {Promise<{envelopeId: string}>} Promise that returns the envelope id
|
|
54
|
+
*/
|
|
55
|
+
const getDocSignatureStatus = async (envelopeId, chainId, isDev = false) => requestGet(`${configUtil.getIdentityAPIUrl(chainId, isDev)}/${envelopeId}/document-signature-status`);
|
|
56
|
+
/**
|
|
57
|
+
* Request document signature
|
|
58
|
+
*
|
|
59
|
+
* @param {string} walletAddress The wallet address.
|
|
60
|
+
* @param {number} chainId chain Id.
|
|
61
|
+
* @param {boolean} isDev Is dev environment or not.
|
|
62
|
+
* @returns {Promise<{envelopeId: string}>} Promise that returns the envelope id
|
|
63
|
+
*/
|
|
64
|
+
const requestDocSignature = async (walletAddress, chainId, isDev = false) => requestPost(`${configUtil.getIdentityAPIUrl(chainId, isDev)}/request-document-signature`, { walletAddress });
|
|
65
|
+
/**
|
|
66
|
+
* Resend document signature link
|
|
67
|
+
*
|
|
68
|
+
* @param {string} envelopeId The envelope id.
|
|
69
|
+
* @param {number} chainId chain Id.
|
|
70
|
+
* @param {boolean} isDev Is dev environment or not.
|
|
71
|
+
* @returns {Promise<{envelopeId: string}>} Promise that returns the envelope id
|
|
72
|
+
*/
|
|
73
|
+
const resendDocSignatureLink = async (envelopeId, chainId, isDev = false) => requestPost(`${configUtil.getIdentityAPIUrl(chainId, isDev)}/resend-document-signature-link`, { envelopeId });
|
|
50
74
|
export const IdentityService = {
|
|
51
75
|
getVerificationStatus,
|
|
52
76
|
onboard,
|
|
77
|
+
getDocSignatureStatus,
|
|
78
|
+
requestDocSignature,
|
|
79
|
+
resendDocSignatureLink,
|
|
53
80
|
};
|
|
54
81
|
//# sourceMappingURL=IdentityService.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IdentityService.js","sourceRoot":"","sources":["../../src/services/IdentityService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"IdentityService.js","sourceRoot":"","sources":["../../src/services/IdentityService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAEtE;;;GAGG;AACH,IAAK,0BAWJ;AAXD,WAAK,0BAA0B;IAC7B,uDAAyB,CAAA;IACzB,2FAA6D,CAAA;IAC7D,+DAAiC,CAAA;IACjC,6EAA+C,CAAA;IAC/C,iGAAmE,CAAA;IACnE,2FAA6D,CAAA;IAC7D,6FAA+D,CAAA;IAC/D,+GAAiF,CAAA;IACjF,qGAAuE,CAAA;IACvE,uEAAyC,CAAA;AAC3C,CAAC,EAXI,0BAA0B,KAA1B,0BAA0B,QAW9B;AAsCD;;;;;;;;GAQG;AACH,MAAM,qBAAqB,GAAG,KAAK,EACjC,aAAqB,EACrB,IAAY,EACZ,OAAe,EACf,KAAK,GAAG,KAAK,EACsB,EAAE;IACrC,MAAM,MAAM,GAAG,MAAM,UAAU,CAC7B,GAAG,UAAU,CAAC,iBAAiB,CAC7B,OAAO,EACP,KAAK,CACN,YAAY,aAAa,oCAAoC,IAAI,EAAE,CACrE,CAAA;IAED,MAAM,CAAC,UAAU,GAAG,CAAC,0BAA0B,CAAC,UAAU,CAAC,CAAC,QAAQ,CAClE,MAAM,CAAC,kBAAkB,CAC1B,CAAA;IACD,MAAM,CAAC,cAAc;QACnB,MAAM,CAAC,kBAAkB,KAAK,0BAA0B,CAAC,kBAAkB,CAAA;IAE7E,OAAO,MAAM,CAAA;AACf,CAAC,CAAA;AAED;;;;;;;;;GASG;AACH,MAAM,OAAO,GAAG,KAAK,EACnB,aAAqB,EACrB,IAAY,EACZ,IAAY,EACZ,OAAe,EACf,KAAK,GAAG,KAAK,EACI,EAAE,CACnB,WAAW,CACT,GAAG,UAAU,CAAC,iBAAiB,CAC7B,OAAO,EACP,KAAK,CACN,YAAY,aAAa,iBAAiB,IAAI,gBAAgB,IAAI,EAAE,CACtE,CAAA;AAEH;;;;;;;GAOG;AACH,MAAM,qBAAqB,GAAG,KAAK,EACjC,UAAkB,EAClB,OAAe,EACf,KAAK,GAAG,KAAK,EACgB,EAAE,CAC/B,UAAU,CACR,GAAG,UAAU,CAAC,iBAAiB,CAC7B,OAAO,EACP,KAAK,CACN,IAAI,UAAU,4BAA4B,CAC5C,CAAA;AAEH;;;;;;;GAOG;AACH,MAAM,mBAAmB,GAAG,KAAK,EAC/B,aAAqB,EACrB,OAAe,EACf,KAAK,GAAG,KAAK,EACoB,EAAE,CACnC,WAAW,CACT,GAAG,UAAU,CAAC,iBAAiB,CAC7B,OAAO,EACP,KAAK,CACN,6BAA6B,EAC9B,EAAE,aAAa,EAAE,CAClB,CAAA;AAEH;;;;;;;GAOG;AACH,MAAM,sBAAsB,GAAG,KAAK,EAClC,UAAkB,EAClB,OAAe,EACf,KAAK,GAAG,KAAK,EACoB,EAAE,CACnC,WAAW,CACT,GAAG,UAAU,CAAC,iBAAiB,CAC7B,OAAO,EACP,KAAK,CACN,iCAAiC,EAClC,EAAE,UAAU,EAAE,CACf,CAAA;AAEH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,qBAAqB;IACrB,OAAO;IACP,qBAAqB;IACrB,mBAAmB;IACnB,sBAAsB;CACvB,CAAA"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
export type RequestInfoType = {
|
|
2
|
-
expectedAmount: string;
|
|
3
|
-
payer: {
|
|
4
|
-
type: string;
|
|
5
|
-
value: string;
|
|
6
|
-
};
|
|
7
|
-
payee: {
|
|
8
|
-
type: string;
|
|
9
|
-
value: string;
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
export declare const RNService: {
|
|
13
|
-
getRequestInfo: (requestId: string, chainId: number) => Promise<any>;
|
|
14
|
-
};
|
|
1
|
+
export type RequestInfoType = {
|
|
2
|
+
expectedAmount: string;
|
|
3
|
+
payer: {
|
|
4
|
+
type: string;
|
|
5
|
+
value: string;
|
|
6
|
+
};
|
|
7
|
+
payee: {
|
|
8
|
+
type: string;
|
|
9
|
+
value: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export declare const RNService: {
|
|
13
|
+
getRequestInfo: (requestId: string, chainId: number) => Promise<any>;
|
|
14
|
+
};
|
package/dist/services/index.d.ts
CHANGED
|
@@ -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';
|