@huma-finance/widgets 0.0.48-beta.202 → 0.0.48-beta.280
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 +407 -0
- package/dist/cjs/index.cjs +6063 -3827
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/index.d.ts +248 -1
- package/dist/index.js +6056 -3829
- package/dist/index.js.map +1 -1
- package/package.json +5 -4
- package/src/components/ApproveAllowanceModal.tsx +3 -8
- package/src/components/ApproveAllowanceModalV2.tsx +141 -0
- package/src/components/CreditLine/approve/index.tsx +9 -3
- package/src/components/CreditLine/autoPaybackV2/1-ApproveAllowance.tsx +33 -0
- package/src/components/CreditLine/autoPaybackV2/2-Success.tsx +13 -0
- package/src/components/CreditLine/autoPaybackV2/index.tsx +87 -0
- package/src/components/CreditLine/borrow/2-ChooseAmount.tsx +12 -3
- package/src/components/CreditLine/borrow/index.tsx +4 -2
- package/src/components/CreditLine/borrowV2/1-ChooseAmount.tsx +79 -0
- package/src/components/CreditLine/borrowV2/2-ApproveAllowance.tsx +33 -0
- package/src/components/CreditLine/borrowV2/3-Transfer.tsx +50 -0
- package/src/components/CreditLine/borrowV2/4-Success.tsx +41 -0
- package/src/components/CreditLine/borrowV2/5-Notifications.tsx +10 -0
- package/src/components/CreditLine/borrowV2/index.tsx +140 -0
- package/src/components/CreditLine/payment/1-ChooseAmount.tsx +7 -2
- package/src/components/CreditLine/payment/index.tsx +4 -2
- package/src/components/CreditLine/paymentV2/1-ChooseAmount.tsx +86 -0
- package/src/components/CreditLine/paymentV2/2-ApproveAllowance.tsx +33 -0
- package/src/components/CreditLine/paymentV2/3-Transfer.tsx +55 -0
- package/src/components/CreditLine/paymentV2/4-Success.tsx +42 -0
- package/src/components/CreditLine/paymentV2/index.tsx +111 -0
- package/src/components/CreditLine/supplyFLC/1-ApproveAllowance.tsx +40 -0
- package/src/components/CreditLine/supplyFLC/2-Transfer.tsx +53 -0
- package/src/components/CreditLine/supplyFLC/3-Success.tsx +26 -0
- package/src/components/CreditLine/supplyFLC/index.tsx +121 -0
- package/src/components/Factoring/FactoredList.tsx +2 -1
- package/src/components/InvoiceFactoring/borrow/2-ChooseAmount.tsx +8 -1
- package/src/components/InvoiceFactoring/borrow/4-ApproveNFT.tsx +6 -2
- package/src/components/InvoiceFactoring/borrow/index.tsx +9 -3
- package/src/components/InvoiceFactoring/payment/1-ChooseAmount.tsx +7 -2
- package/src/components/InvoiceFactoring/payment/index.tsx +9 -3
- package/src/components/Lend/redeemV2/1-ChooseAction.tsx +236 -0
- package/src/components/Lend/redeemV2/2-ChooseAmount.tsx +162 -0
- package/src/components/Lend/redeemV2/3-Transfer.tsx +61 -0
- package/src/components/Lend/redeemV2/4-Done.tsx +33 -0
- package/src/components/Lend/redeemV2/index.tsx +207 -0
- package/src/components/Lend/supply/1-Evaluation/EvaluationKYC.tsx +19 -2
- package/src/components/Lend/supply/index.tsx +17 -3
- package/src/components/Lend/supplyV2/1-ChooseTranche.tsx +155 -0
- package/src/components/Lend/supplyV2/2-Evaluation.tsx +345 -0
- package/src/components/Lend/supplyV2/3-ChooseAmount.tsx +122 -0
- package/src/components/Lend/supplyV2/4-ApproveAllowance.tsx +33 -0
- package/src/components/Lend/supplyV2/5-Transfer.tsx +59 -0
- package/src/components/Lend/supplyV2/6-Success.tsx +79 -0
- package/src/components/Lend/supplyV2/7-Notifications.tsx +10 -0
- package/src/components/Lend/supplyV2/index.tsx +127 -0
- package/src/components/Lend/withdraw/1-CheckWithdrawble.tsx +5 -1
- package/src/components/Lend/withdraw/2-ChooseAmount.tsx +1 -7
- package/src/components/Lend/withdraw/index.tsx +8 -13
- package/src/components/Lend/withdrawV2/1-ChooseTranche.tsx +201 -0
- package/src/components/Lend/withdrawV2/2-Transfer.tsx +48 -0
- package/src/components/Lend/withdrawV2/3-Done.tsx +31 -0
- package/src/components/Lend/withdrawV2/index.tsx +129 -0
- package/src/components/Notifi/NotifiSubscriptionModal.tsx +29 -37
- package/src/components/NumericFormatCustom.tsx +31 -0
- package/src/components/ReceivableBackedCreditLine/borrow/1-ChooseAmount.tsx +101 -0
- package/src/components/ReceivableBackedCreditLine/borrow/2-ApproveAllowance.tsx +33 -0
- package/src/components/ReceivableBackedCreditLine/borrow/3-ApproveReceivable.tsx +64 -0
- package/src/components/ReceivableBackedCreditLine/borrow/4-Transfer.tsx +61 -0
- package/src/components/ReceivableBackedCreditLine/borrow/5-Success.tsx +41 -0
- package/src/components/ReceivableBackedCreditLine/borrow/6-Notifications.tsx +10 -0
- package/src/components/ReceivableBackedCreditLine/borrow/index.tsx +148 -0
- package/src/components/ReceivableBackedCreditLine/payment/1-ChoosePaymentType.tsx +115 -0
- package/src/components/ReceivableBackedCreditLine/payment/2-ChooseAmount.tsx +84 -0
- package/src/components/ReceivableBackedCreditLine/payment/3-ApproveAllowance.tsx +41 -0
- package/src/components/ReceivableBackedCreditLine/payment/4-CreateReceivable.tsx +107 -0
- package/src/components/ReceivableBackedCreditLine/payment/5-ApproveReceivable.tsx +64 -0
- package/src/components/ReceivableBackedCreditLine/payment/6-Transfer.tsx +107 -0
- package/src/components/ReceivableBackedCreditLine/payment/7-Success.tsx +49 -0
- package/src/components/ReceivableBackedCreditLine/payment/index.tsx +159 -0
- package/src/components/StreamFactoring/borrow/1-Evaluation.tsx +3 -4
- package/src/components/StreamFactoring/borrow/2-ChooseAmount.tsx +23 -22
- package/src/components/StreamFactoring/borrow/3-ConfirmTransfer.tsx +8 -3
- package/src/components/StreamFactoring/borrow/5-Permit.tsx +35 -2
- package/src/components/StreamFactoring/borrow/6-Transfer.tsx +3 -1
- package/src/components/StreamFactoring/borrow/index.tsx +4 -3
- package/src/components/SuperfluidFactoring/SuperfluidFactoredList.tsx +2 -2
- package/src/components/SuperfluidFactoring/SuperfluidUpcomingList.tsx +1 -3
- package/src/components/TxDoneModal.tsx +1 -1
- package/src/components/TxSendModal.tsx +8 -2
- package/src/components/TxSendModalV2.tsx +51 -0
- package/src/index.tsx +239 -1
- package/src/store/widgets.reducers.ts +15 -0
- package/src/store/widgets.store.ts +6 -0
package/src/index.tsx
CHANGED
|
@@ -8,22 +8,38 @@ import {
|
|
|
8
8
|
import { ThemeProvider } from '@mui/material'
|
|
9
9
|
import { Provider as Eip1193Provider } from '@web3-react/types'
|
|
10
10
|
import { Provider as AtomProvider } from 'jotai'
|
|
11
|
+
import { useEffect, useState } from 'react'
|
|
11
12
|
import { Provider as ReduxProvider } from 'react-redux'
|
|
12
13
|
|
|
13
|
-
import { useEffect, useState } from 'react'
|
|
14
14
|
import { ChainSupportProvider } from './components/ChainSupportProvider'
|
|
15
15
|
import {
|
|
16
16
|
CreditLineApprove,
|
|
17
17
|
CreditLineApproveProps,
|
|
18
18
|
} from './components/CreditLine/approve'
|
|
19
|
+
import {
|
|
20
|
+
AutoPaybackPropsV2,
|
|
21
|
+
AutoPaybackV2,
|
|
22
|
+
} from './components/CreditLine/autoPaybackV2'
|
|
19
23
|
import {
|
|
20
24
|
CreditLineBorrow,
|
|
21
25
|
CreditLineBorrowProps,
|
|
22
26
|
} from './components/CreditLine/borrow'
|
|
27
|
+
import {
|
|
28
|
+
CreditLineBorrowPropsV2,
|
|
29
|
+
CreditLineBorrowV2,
|
|
30
|
+
} from './components/CreditLine/borrowV2'
|
|
23
31
|
import {
|
|
24
32
|
CreditLinePayment,
|
|
25
33
|
CreditLinePaymentProps,
|
|
26
34
|
} from './components/CreditLine/payment'
|
|
35
|
+
import {
|
|
36
|
+
CreditLinePaymentPropsV2,
|
|
37
|
+
CreditLinePaymentV2,
|
|
38
|
+
} from './components/CreditLine/paymentV2'
|
|
39
|
+
import {
|
|
40
|
+
SupplyFirstLossCover,
|
|
41
|
+
SupplyFirstLossCoverProps,
|
|
42
|
+
} from './components/CreditLine/supplyFLC'
|
|
27
43
|
import {
|
|
28
44
|
InvoiceFactoringBorrow,
|
|
29
45
|
InvoiceFactoringBorrowProps,
|
|
@@ -32,12 +48,26 @@ import {
|
|
|
32
48
|
InvoiceFactoringPayment,
|
|
33
49
|
InvoiceFactoringPaymentProps,
|
|
34
50
|
} from './components/InvoiceFactoring/payment'
|
|
51
|
+
import { LendRedeemPropsV2, LendRedeemV2 } from './components/Lend/redeemV2'
|
|
35
52
|
import { LendSupply, LendSupplyProps } from './components/Lend/supply'
|
|
53
|
+
import { LendSupplyPropsV2, LendSupplyV2 } from './components/Lend/supplyV2'
|
|
36
54
|
import { LendWithdraw, LendWithdrawProps } from './components/Lend/withdraw'
|
|
55
|
+
import {
|
|
56
|
+
LendWithdrawPropsV2,
|
|
57
|
+
LendWithdrawV2,
|
|
58
|
+
} from './components/Lend/withdrawV2'
|
|
59
|
+
import {
|
|
60
|
+
ReceivableBackedCreditLineBorrowPropsV2,
|
|
61
|
+
ReceivableBackedCreditLineBorrowV2,
|
|
62
|
+
} from './components/ReceivableBackedCreditLine/borrow'
|
|
37
63
|
import { SuperfluidFactoring } from './components/SuperfluidFactoring'
|
|
38
64
|
import { store } from './store'
|
|
39
65
|
import { themeHuma } from './theme'
|
|
40
66
|
import { WCProps } from './utilTypes'
|
|
67
|
+
import {
|
|
68
|
+
ReceivableBackedCreditLinePaymentPropsV2,
|
|
69
|
+
ReceivableBackedCreditLinePaymentV2,
|
|
70
|
+
} from './components/ReceivableBackedCreditLine/payment'
|
|
41
71
|
|
|
42
72
|
/**
|
|
43
73
|
* Mapping of your JSON-RPC connections indexed by chainId
|
|
@@ -161,6 +191,28 @@ export function CreditLineBorrowWidget(props: CreditLineBorrowWidgetProps) {
|
|
|
161
191
|
)
|
|
162
192
|
}
|
|
163
193
|
|
|
194
|
+
/**
|
|
195
|
+
* Credit line pool borrow widget props V2
|
|
196
|
+
* @typedef {Object} CreditLineBorrowWidgetPropsV2
|
|
197
|
+
* @property {CreditLineBorrowPropsV2} CreditLineBorrowPropsV2 - Credit line pool borrow props V2.
|
|
198
|
+
* @property {WidgetProps} WidgetProps - Widget general props.
|
|
199
|
+
*/
|
|
200
|
+
type CreditLineBorrowWidgetPropsV2 = CreditLineBorrowPropsV2 & WidgetProps
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* Credit line borrow widget V2
|
|
204
|
+
*
|
|
205
|
+
* @param {CreditLineBorrowWidgetPropsV2} props - The credit line pool borrow widget props V2.
|
|
206
|
+
* @returns Credit line pool borrow widget component V2
|
|
207
|
+
*/
|
|
208
|
+
export function CreditLineBorrowWidgetV2(props: CreditLineBorrowWidgetPropsV2) {
|
|
209
|
+
return (
|
|
210
|
+
<Widget {...props}>
|
|
211
|
+
<CreditLineBorrowV2 {...props} />
|
|
212
|
+
</Widget>
|
|
213
|
+
)
|
|
214
|
+
}
|
|
215
|
+
|
|
164
216
|
/**
|
|
165
217
|
* Credit line pool payment widget props
|
|
166
218
|
* @typedef {Object} CreditLinePaymentWidgetProps
|
|
@@ -183,6 +235,30 @@ export function CreditLinePaymentWidget(props: CreditLinePaymentWidgetProps) {
|
|
|
183
235
|
)
|
|
184
236
|
}
|
|
185
237
|
|
|
238
|
+
/**
|
|
239
|
+
* Credit line pool payment widget props V2
|
|
240
|
+
* @typedef {Object} CreditLinePaymentWidgetPropsV2
|
|
241
|
+
* @property {CreditLinePaymentPropsV2} CreditLinePaymentPropsV2 - Credit line pool payment props V2.
|
|
242
|
+
* @property {WidgetProps} WidgetProps - Widget general props.
|
|
243
|
+
*/
|
|
244
|
+
type CreditLinePaymentWidgetPropsV2 = CreditLinePaymentPropsV2 & WidgetProps
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* Credit line payment widget V2
|
|
248
|
+
*
|
|
249
|
+
* @param {CreditLinePaymentWidgetPropsV2} props - The credit line pool payment widget props V2.
|
|
250
|
+
* @returns Credit line pool payment widget component V2
|
|
251
|
+
*/
|
|
252
|
+
export function CreditLinePaymentWidgetV2(
|
|
253
|
+
props: CreditLinePaymentWidgetPropsV2,
|
|
254
|
+
) {
|
|
255
|
+
return (
|
|
256
|
+
<Widget {...props}>
|
|
257
|
+
<CreditLinePaymentV2 {...props} />
|
|
258
|
+
</Widget>
|
|
259
|
+
)
|
|
260
|
+
}
|
|
261
|
+
|
|
186
262
|
/**
|
|
187
263
|
* Credit line allowance approval widget props
|
|
188
264
|
* @typedef {Object} CreditLinePaymentWidgetProps
|
|
@@ -228,6 +304,28 @@ export function LendSupplyWidget(props: LendSupplyWidgetProps) {
|
|
|
228
304
|
)
|
|
229
305
|
}
|
|
230
306
|
|
|
307
|
+
/**
|
|
308
|
+
* Lend pool supply widget props V2
|
|
309
|
+
* @typedef {Object} LendSupplyWidgetPropsV2
|
|
310
|
+
* @property {LendSupplyPropsV2} LendSupplyPropsV2 - Lend pool supply props V2.
|
|
311
|
+
* @property {WidgetProps} WidgetProps - Widget general props.
|
|
312
|
+
*/
|
|
313
|
+
type LendSupplyWidgetPropsV2 = LendSupplyPropsV2 & WidgetProps
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* Lend supply widget V2
|
|
317
|
+
*
|
|
318
|
+
* @param {LendSupplyWidgetPropsV2} props - The lend pool supply widget props V2.
|
|
319
|
+
* @returns Lend pool supply widget component V2
|
|
320
|
+
*/
|
|
321
|
+
export function LendSupplyWidgetV2(props: LendSupplyWidgetPropsV2) {
|
|
322
|
+
return (
|
|
323
|
+
<Widget {...props}>
|
|
324
|
+
<LendSupplyV2 {...props} />
|
|
325
|
+
</Widget>
|
|
326
|
+
)
|
|
327
|
+
}
|
|
328
|
+
|
|
231
329
|
/**
|
|
232
330
|
* Lend pool withdraw widget props
|
|
233
331
|
* @typedef {Object} LendWithdrawWidgetProps
|
|
@@ -250,6 +348,74 @@ export function LendWithdrawWidget(props: LendWithdrawWidgetProps) {
|
|
|
250
348
|
)
|
|
251
349
|
}
|
|
252
350
|
|
|
351
|
+
/**
|
|
352
|
+
* Lend pool supply widget props V2
|
|
353
|
+
* @typedef {Object} LendSupplyWidgetPropsV2
|
|
354
|
+
* @property {LendWithdrawPropsV2} LendSupplyPropsV2 - Lend pool supply props V2.
|
|
355
|
+
* @property {WidgetProps} WidgetProps - Widget general props.
|
|
356
|
+
*/
|
|
357
|
+
type LendWithdrawWidgetPropsV2 = LendWithdrawPropsV2 & WidgetProps
|
|
358
|
+
|
|
359
|
+
/**
|
|
360
|
+
* Lend withdraw widget V2
|
|
361
|
+
*
|
|
362
|
+
* @param {LendWithdrawWidgetPropsV2} props - The lend pool supply widget props V2.
|
|
363
|
+
* @returns Lend pool supply widget component V2
|
|
364
|
+
*/
|
|
365
|
+
export function LendWithdrawWidgetV2(props: LendWithdrawWidgetPropsV2) {
|
|
366
|
+
return (
|
|
367
|
+
<Widget {...props}>
|
|
368
|
+
<LendWithdrawV2 {...props} />
|
|
369
|
+
</Widget>
|
|
370
|
+
)
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* Lend pool redeem widget props V2
|
|
375
|
+
* @typedef {Object} LendRedeemWidgetPropsV2
|
|
376
|
+
* @property {LendRedeemPropsV2} LendRedeemPropsV2 - Lend pool redeem props V2.
|
|
377
|
+
* @property {WidgetProps} WidgetProps - Widget general props.
|
|
378
|
+
*/
|
|
379
|
+
type LendRedeemWidgetPropsV2 = LendRedeemPropsV2 & WidgetProps
|
|
380
|
+
|
|
381
|
+
/**
|
|
382
|
+
* Lend redeem widget V2
|
|
383
|
+
*
|
|
384
|
+
* @param {LendRedeemWidgetPropsV2} props - The lend pool redeem widget props V2.
|
|
385
|
+
* @returns Lend pool redeem widget component V2
|
|
386
|
+
*/
|
|
387
|
+
export function LendRedeemWidgetV2(props: LendRedeemWidgetPropsV2) {
|
|
388
|
+
return (
|
|
389
|
+
<Widget {...props}>
|
|
390
|
+
<LendRedeemV2 {...props} />
|
|
391
|
+
</Widget>
|
|
392
|
+
)
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* Supply first loss cover widget props
|
|
397
|
+
* @typedef {Object} SupplyFirstLossCoverWidgetProps
|
|
398
|
+
* @property {SupplyFirstLossCover} SupplyFirstLossCover - Supply first loss cover props.
|
|
399
|
+
* @property {WidgetProps} WidgetProps - Widget general props.
|
|
400
|
+
*/
|
|
401
|
+
type SupplyFirstLossCoverWidgetProps = SupplyFirstLossCoverProps & WidgetProps
|
|
402
|
+
|
|
403
|
+
/**
|
|
404
|
+
* Supply first loss cover widget
|
|
405
|
+
*
|
|
406
|
+
* @param {SupplyFirstLossCoverWidgetProps} props - The supply first loss cover widget props.
|
|
407
|
+
* @returns Supply first loss cover widget component
|
|
408
|
+
*/
|
|
409
|
+
export function SupplyFirstLossCoverWidget(
|
|
410
|
+
props: SupplyFirstLossCoverWidgetProps,
|
|
411
|
+
) {
|
|
412
|
+
return (
|
|
413
|
+
<Widget {...props}>
|
|
414
|
+
<SupplyFirstLossCover {...props} />
|
|
415
|
+
</Widget>
|
|
416
|
+
)
|
|
417
|
+
}
|
|
418
|
+
|
|
253
419
|
/**
|
|
254
420
|
* Superfluid factoring widget
|
|
255
421
|
*
|
|
@@ -263,3 +429,75 @@ export function SuperfluidFactoringWidget(props: WidgetProps) {
|
|
|
263
429
|
</Widget>
|
|
264
430
|
)
|
|
265
431
|
}
|
|
432
|
+
|
|
433
|
+
/**
|
|
434
|
+
* Auto payback widget props V2
|
|
435
|
+
* @typedef {Object} AutoPaybackWidgetPropsV2
|
|
436
|
+
* @property {AutoPayback} AutoPayback - Auto payback props V2.
|
|
437
|
+
* @property {WidgetProps} WidgetProps - Widget general props.
|
|
438
|
+
*/
|
|
439
|
+
type AutoPaybackWidgetPropsV2 = AutoPaybackPropsV2 & WidgetProps
|
|
440
|
+
|
|
441
|
+
/**
|
|
442
|
+
* Supply first loss cover widget
|
|
443
|
+
*
|
|
444
|
+
* @param {SupplyFirstLossCoverWidgetProps} props - The supply first loss cover widget props.
|
|
445
|
+
* @returns Supply first loss cover widget component
|
|
446
|
+
*/
|
|
447
|
+
export function AutoPaybackWidgetV2(props: AutoPaybackWidgetPropsV2) {
|
|
448
|
+
return (
|
|
449
|
+
<Widget {...props}>
|
|
450
|
+
<AutoPaybackV2 {...props} />
|
|
451
|
+
</Widget>
|
|
452
|
+
)
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
/**
|
|
456
|
+
* Receivable backed credit line pool borrow widget props V2
|
|
457
|
+
* @typedef {Object} ReceivableBackedCreditLineBorrowWidgetPropsV2
|
|
458
|
+
* @property {ReceivableBackedCreditLineBorrowPropsV2} ReceivableBackedCreditLineBorrowPropsV2 - Receivable backed credit line pool borrow props V2.
|
|
459
|
+
* @property {WidgetProps} WidgetProps - Widget general props.
|
|
460
|
+
*/
|
|
461
|
+
type ReceivableBackedCreditLineBorrowWidgetPropsV2 =
|
|
462
|
+
ReceivableBackedCreditLineBorrowPropsV2 & WidgetProps
|
|
463
|
+
|
|
464
|
+
/**
|
|
465
|
+
* Receivable backed credit line borrow widget V2
|
|
466
|
+
*
|
|
467
|
+
* @param {ReceivableBackedCreditLineBorrowWidgetPropsV2} props - The receivable backed credit line pool borrow widget props V2.
|
|
468
|
+
* @returns Receivable backed credit line pool borrow widget component V2
|
|
469
|
+
*/
|
|
470
|
+
export function ReceivableBackedCreditLineBorrowWidgetV2(
|
|
471
|
+
props: ReceivableBackedCreditLineBorrowWidgetPropsV2,
|
|
472
|
+
) {
|
|
473
|
+
return (
|
|
474
|
+
<Widget {...props}>
|
|
475
|
+
<ReceivableBackedCreditLineBorrowV2 {...props} />
|
|
476
|
+
</Widget>
|
|
477
|
+
)
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
/**
|
|
481
|
+
* Receivable backed credit line pool payment widget props V2
|
|
482
|
+
* @typedef {Object} ReceivableBackedCreditLinePaymentWidgetPropsV2
|
|
483
|
+
* @property {ReceivableBackedCreditLinePaymentPropsV2} ReceivableBackedCreditLinePaymentPropsV2 - Receivable backed credit line pool payment props V2.
|
|
484
|
+
* @property {WidgetProps} WidgetProps - Widget general props.
|
|
485
|
+
*/
|
|
486
|
+
type ReceivableBackedCreditLinePaymentWidgetPropsV2 =
|
|
487
|
+
ReceivableBackedCreditLinePaymentPropsV2 & WidgetProps
|
|
488
|
+
|
|
489
|
+
/**
|
|
490
|
+
* Receivable backed credit line payment widget V2
|
|
491
|
+
*
|
|
492
|
+
* @param {ReceivableBackedCreditLinePaymentWidgetPropsV2} props - The receivable backed credit line pool payment widget props V2.
|
|
493
|
+
* @returns Receivable backed credit line pool payment widget component V2
|
|
494
|
+
*/
|
|
495
|
+
export function ReceivableBackedCreditLinePaymentWidgetV2(
|
|
496
|
+
props: ReceivableBackedCreditLinePaymentWidgetPropsV2,
|
|
497
|
+
) {
|
|
498
|
+
return (
|
|
499
|
+
<Widget {...props}>
|
|
500
|
+
<ReceivableBackedCreditLinePaymentV2 {...props} />
|
|
501
|
+
</Widget>
|
|
502
|
+
)
|
|
503
|
+
}
|
|
@@ -29,6 +29,9 @@ export const widgetSlice = createSlice({
|
|
|
29
29
|
state.multisend = undefined
|
|
30
30
|
state.supplyAmount = undefined
|
|
31
31
|
state.withdrawAmount = undefined
|
|
32
|
+
state.withdrawShares = undefined
|
|
33
|
+
state.redeemAmount = undefined
|
|
34
|
+
state.redeemShares = undefined
|
|
32
35
|
},
|
|
33
36
|
setStep: (state, { payload }: PayloadAction<WIDGET_STEP>) => {
|
|
34
37
|
state.step = payload
|
|
@@ -83,6 +86,15 @@ export const widgetSlice = createSlice({
|
|
|
83
86
|
setWithdrawAmount: (state, { payload }: PayloadAction<number>) => {
|
|
84
87
|
state.withdrawAmount = payload
|
|
85
88
|
},
|
|
89
|
+
setWithdrawShares: (state, { payload }: PayloadAction<number>) => {
|
|
90
|
+
state.withdrawShares = payload
|
|
91
|
+
},
|
|
92
|
+
setRedeemAmount: (state, { payload }: PayloadAction<number>) => {
|
|
93
|
+
state.redeemAmount = payload
|
|
94
|
+
},
|
|
95
|
+
setRedeemShares: (state, { payload }: PayloadAction<number>) => {
|
|
96
|
+
state.redeemShares = payload
|
|
97
|
+
},
|
|
86
98
|
setStream: (state, { payload }: PayloadAction<WidgetStream>) => {
|
|
87
99
|
const stream = state.stream ?? {}
|
|
88
100
|
state.stream = { ...stream, ...payload }
|
|
@@ -116,6 +128,9 @@ export const {
|
|
|
116
128
|
setMultisend,
|
|
117
129
|
setSupplyAmount,
|
|
118
130
|
setWithdrawAmount,
|
|
131
|
+
setWithdrawShares,
|
|
132
|
+
setRedeemAmount,
|
|
133
|
+
setRedeemShares,
|
|
119
134
|
} = widgetSlice.actions
|
|
120
135
|
|
|
121
136
|
export default widgetSlice.reducer
|
|
@@ -7,7 +7,10 @@ export enum WIDGET_TYPE {
|
|
|
7
7
|
|
|
8
8
|
export enum WIDGET_STEP {
|
|
9
9
|
SignIn = 'SignIn',
|
|
10
|
+
ChooseTranche = 'ChooseTranche',
|
|
11
|
+
ChoosePaymentType = 'ChoosePaymentType',
|
|
10
12
|
Evaluation = 'Evaluation',
|
|
13
|
+
FirstLossCover = 'FirstLossCover',
|
|
11
14
|
ChooseAmount = 'ChooseAmount',
|
|
12
15
|
Permit = 'Permit',
|
|
13
16
|
ApproveAllowance = 'ApproveAllowance',
|
|
@@ -46,6 +49,9 @@ export type WidgetState = {
|
|
|
46
49
|
remainDueAmount?: number
|
|
47
50
|
supplyAmount?: number
|
|
48
51
|
withdrawAmount?: number
|
|
52
|
+
withdrawShares?: number
|
|
53
|
+
redeemAmount?: number
|
|
54
|
+
redeemShares?: number
|
|
49
55
|
errorMessage?: string
|
|
50
56
|
errorReason?: string
|
|
51
57
|
tokenId?: string
|