@huma-finance/widgets 0.0.47 → 0.0.48-beta.187
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/API.md +18 -0
- package/dist/cjs/index.cjs +388 -57
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/index.d.ts +33 -1
- package/dist/index.js +388 -58
- package/dist/index.js.map +1 -1
- package/package.json +5 -2
- package/src/components/RequestNetworkInvoiceFactoring/1-Evaluation.tsx +58 -0
- package/src/components/RequestNetworkInvoiceFactoring/2-ChooseAmount.tsx +88 -0
- package/src/components/RequestNetworkInvoiceFactoring/3-ConfirmTransfer.tsx +37 -0
- package/src/components/RequestNetworkInvoiceFactoring/4-ApproveNFT.tsx +55 -0
- package/src/components/RequestNetworkInvoiceFactoring/5-Transfer.tsx +34 -0
- package/src/components/RequestNetworkInvoiceFactoring/6-Success.tsx +20 -0
- package/src/components/RequestNetworkInvoiceFactoring/index.tsx +137 -0
- package/src/cosmos/RequestNetworkBorrow.fixture.tsx +65 -0
- package/src/index.tsx +29 -0
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { JsonRpcProvider } from '@ethersproject/providers';
|
|
|
3
3
|
import { Provider } from '@web3-react/types';
|
|
4
4
|
import { POOL_NAME, POOL_TYPE } from '@huma-finance/shared';
|
|
5
5
|
import { BigNumberish, BigNumber } from 'ethers';
|
|
6
|
+
import { RequestLogicTypes } from '@requestnetwork/types';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Credit line pool approve allowance props
|
|
@@ -115,6 +116,23 @@ type LendWithdrawProps = {
|
|
|
115
116
|
handleSuccess?: (blockNumber?: number) => void;
|
|
116
117
|
};
|
|
117
118
|
|
|
119
|
+
/**
|
|
120
|
+
* Invoice factoring pool borrow props
|
|
121
|
+
* @typedef {Object} RequestNetworkInvoiceFactoringBorrowProps
|
|
122
|
+
* @property {POOL_NAME} poolName The name of the pool.
|
|
123
|
+
* @property {POOL_TYPE} poolType The type of the pool.
|
|
124
|
+
* @property {string|BigNumber} tokenId The NFT token id representing invoice.
|
|
125
|
+
* @property {function():void} handleClose Function to notify to close the widget modal when user clicks the 'x' close button.
|
|
126
|
+
* @property {function((number|undefined)):void|undefined} handleSuccess Optional function to notify that the invoice pool borrow action is successful.
|
|
127
|
+
*/
|
|
128
|
+
interface RequestNetworkInvoiceFactoringBorrowProps {
|
|
129
|
+
poolName: keyof typeof POOL_NAME;
|
|
130
|
+
poolType: keyof typeof POOL_TYPE;
|
|
131
|
+
requestId: RequestLogicTypes.RequestId;
|
|
132
|
+
handleClose: () => void;
|
|
133
|
+
handleSuccess?: (blockNumber?: number) => void;
|
|
134
|
+
}
|
|
135
|
+
|
|
118
136
|
/**
|
|
119
137
|
* Mapping of your JSON-RPC connections indexed by chainId
|
|
120
138
|
* @typedef {Object} JsonRpcConnectionMap
|
|
@@ -136,6 +154,20 @@ type WidgetProps = {
|
|
|
136
154
|
jsonRpcUrlMap?: JsonRpcConnectionMap;
|
|
137
155
|
provider: Provider | JsonRpcProvider;
|
|
138
156
|
};
|
|
157
|
+
/**
|
|
158
|
+
* Invoice factoring pool borrow widget props
|
|
159
|
+
* @typedef {Object} RequestNetworkInvoiceFactoringBorrowWidgetProps
|
|
160
|
+
* @property {RequestNetworkInvoiceFactoringBorrowProps} RequestNetworkInvoiceFactoringBorrowProps - Invoice factoring pool borrow props.
|
|
161
|
+
* @property {WidgetProps} WidgetProps - Widget general props.
|
|
162
|
+
*/
|
|
163
|
+
type RequestNetworkInvoiceFactoringBorrowWidgetProps = RequestNetworkInvoiceFactoringBorrowProps & WidgetProps;
|
|
164
|
+
/**
|
|
165
|
+
* Invoice factoring borrow widget
|
|
166
|
+
*
|
|
167
|
+
* @param {RequestNetworkInvoiceFactoringBorrowWidgetProps} props - The invoice factoring pool borrow widget props.
|
|
168
|
+
* @returns Invoice factoring pool borrow widget component
|
|
169
|
+
*/
|
|
170
|
+
declare function RequestNetworkInvoiceFactoringBorrowWidget(props: RequestNetworkInvoiceFactoringBorrowWidgetProps): _emotion_react_jsx_runtime.JSX.Element;
|
|
139
171
|
/**
|
|
140
172
|
* Invoice factoring pool borrow widget props
|
|
141
173
|
* @typedef {Object} InvoiceFactoringBorrowWidgetProps
|
|
@@ -243,4 +275,4 @@ declare function LendWithdrawWidget(props: LendWithdrawWidgetProps): _emotion_re
|
|
|
243
275
|
*/
|
|
244
276
|
declare function SuperfluidFactoringWidget(props: WidgetProps): _emotion_react_jsx_runtime.JSX.Element;
|
|
245
277
|
|
|
246
|
-
export { CreditLineApproveWidget, CreditLineBorrowWidget, CreditLinePaymentWidget, InvoiceFactoringBorrowWidget, InvoiceFactoringPaymentWidget, LendSupplyWidget, LendWithdrawWidget, SuperfluidFactoringWidget };
|
|
278
|
+
export { CreditLineApproveWidget, CreditLineBorrowWidget, CreditLinePaymentWidget, InvoiceFactoringBorrowWidget, InvoiceFactoringPaymentWidget, LendSupplyWidget, LendWithdrawWidget, RequestNetworkInvoiceFactoringBorrowWidget, SuperfluidFactoringWidget };
|