@stridge/kit 0.1.0-alpha.44 → 0.1.0-alpha.45
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/flows/deposit/dialog/DepositDialog.d.ts +9 -4
- package/dist/flows/deposit/dialog/DepositDialog.js +1 -1
- package/dist/flows/deposit/widgets/amount-entry/AmountEntry.d.ts +31 -4
- package/dist/flows/deposit/widgets/amount-entry/AmountEntry.js +1 -1
- package/dist/flows/deposit/widgets/asset-picker/AssetPicker.d.ts +22 -4
- package/dist/flows/deposit/widgets/asset-picker/AssetPicker.js +1 -1
- package/dist/flows/deposit/widgets/confirm-deposit/ConfirmDeposit.d.ts +37 -4
- package/dist/flows/deposit/widgets/confirm-deposit/ConfirmDeposit.js +1 -1
- package/dist/flows/deposit/widgets/deposit/Deposit.d.ts +33 -4
- package/dist/flows/deposit/widgets/deposit/Deposit.js +1 -1
- package/dist/flows/deposit/widgets/deposit/compound/Deposit.d.ts +14 -0
- package/dist/flows/deposit/widgets/deposit/compound/Deposit.js +1 -1
- package/dist/flows/deposit/widgets/deposit/compound/components/Boundary.d.ts +29 -0
- package/dist/flows/deposit/widgets/deposit/compound/components/Boundary.js +1 -0
- package/dist/flows/deposit/widgets/deposit/compound/components/Guards.d.ts +28 -0
- package/dist/flows/deposit/widgets/deposit/compound/components/Guards.js +1 -0
- package/dist/flows/deposit/widgets/deposit-status-banner/DepositStatusBanner.d.ts +34 -1
- package/dist/flows/deposit/widgets/deposit-status-banner/DepositStatusBanner.js +1 -1
- package/dist/flows/deposit/widgets/error-state/ErrorState.d.ts +39 -4
- package/dist/flows/deposit/widgets/error-state/ErrorState.js +1 -1
- package/dist/flows/deposit/widgets/processing-state/ProcessingState.d.ts +30 -4
- package/dist/flows/deposit/widgets/processing-state/ProcessingState.js +1 -1
- package/dist/flows/deposit/widgets/success-state/SuccessState.d.ts +38 -4
- package/dist/flows/deposit/widgets/success-state/SuccessState.js +1 -1
- package/dist/flows/deposit/widgets/transfer-crypto/TransferCrypto.d.ts +34 -3
- package/dist/flows/deposit/widgets/transfer-crypto/TransferCrypto.js +1 -1
- package/dist/flows/withdraw/dialog/WithdrawDialog.js +1 -1
- package/dist/flows/withdraw/widgets/withdraw/compound/Withdraw.d.ts +15 -0
- package/dist/flows/withdraw/widgets/withdraw/compound/Withdraw.js +1 -1
- package/dist/flows/withdraw/widgets/withdraw/compound/components/Boundary.d.ts +29 -0
- package/dist/flows/withdraw/widgets/withdraw/compound/components/Boundary.js +1 -0
- package/dist/flows/withdraw/widgets/withdraw/compound/components/Guards.d.ts +25 -0
- package/dist/flows/withdraw/widgets/withdraw/compound/components/Guards.js +1 -0
- package/dist/flows/withdraw/widgets/withdraw-error/WithdrawError.d.ts +45 -2
- package/dist/flows/withdraw/widgets/withdraw-error/WithdrawError.js +1 -1
- package/dist/flows/withdraw/widgets/withdraw-form/WithdrawForm.d.ts +29 -1
- package/dist/flows/withdraw/widgets/withdraw-form/WithdrawForm.js +1 -1
- package/dist/flows/withdraw/widgets/withdraw-in-progress/WithdrawInProgress.d.ts +37 -2
- package/dist/flows/withdraw/widgets/withdraw-in-progress/WithdrawInProgress.js +1 -1
- package/dist/flows/withdraw/widgets/withdraw-success/WithdrawSuccess.d.ts +46 -2
- package/dist/flows/withdraw/widgets/withdraw-success/WithdrawSuccess.js +1 -1
- package/dist/package.js +1 -1
- package/dist/shared/widgets/amount-entry/compound/AmountEntry.d.ts +4 -1
- package/dist/shared/widgets/amount-entry/compound/AmountEntry.js +1 -1
- package/dist/shared/widgets/amount-entry/compound/AmountEntry.slots.d.ts +1 -0
- package/dist/shared/widgets/amount-entry/compound/AmountEntry.slots.js +1 -1
- package/dist/shared/widgets/amount-entry/compound/AmountEntry.styles.js +1 -1
- package/dist/shared/widgets/amount-entry/compound/components/Notice.d.ts +7 -0
- package/dist/shared/widgets/amount-entry/compound/components/Notice.js +1 -0
- package/dist/shared/widgets/amount-entry/compound/types.d.ts +12 -1
- package/dist/shared/widgets/error-state/compound/components/MoreDetails.d.ts +1 -1
- package/dist/shared/widgets/error-state/compound/components/MoreDetails.js +1 -1
- package/dist/shared/widgets/success-state/compound/components/MoreDetails.d.ts +1 -1
- package/dist/shared/widgets/success-state/compound/components/MoreDetails.js +1 -1
- package/dist/styles/index.css +4 -0
- package/package.json +1 -1
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import { DialogShellControls } from "../../../../shared/dialog/DialogShell.js";
|
|
2
|
-
import {
|
|
2
|
+
import { ErrorStateBodyProps } from "../../../../shared/widgets/error-state/compound/types.js";
|
|
3
|
+
import { ErrorStateActions } from "../../../../shared/widgets/error-state/compound/components/Actions.js";
|
|
4
|
+
import { ErrorStateDetails } from "../../../../shared/widgets/error-state/compound/components/Details.js";
|
|
5
|
+
import { ErrorStateHeader } from "../../../../shared/widgets/error-state/compound/components/Header.js";
|
|
6
|
+
import { ErrorStateHelpInfo } from "../../../../shared/widgets/error-state/compound/components/HelpInfo.js";
|
|
7
|
+
import { ErrorStateHero } from "../../../../shared/widgets/error-state/compound/components/Hero.js";
|
|
8
|
+
import { ErrorStateMoreDetails } from "../../../../shared/widgets/error-state/compound/components/MoreDetails.js";
|
|
9
|
+
import { ErrorStateDepositTxRow, ErrorStateDestinationRow, ErrorStateFailedAtRow, ErrorStateFillStatusRow, ErrorStateSourceRow, ErrorStateSubmittedAtRow, ErrorStateYouReceiveRow } from "../../../../shared/widgets/error-state/compound/components/Rows.js";
|
|
10
|
+
import { ComponentProps, ReactNode } from "react";
|
|
3
11
|
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
12
|
|
|
5
13
|
//#region src/flows/deposit/widgets/error-state/ErrorState.d.ts
|
|
@@ -13,7 +21,20 @@ import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
|
13
21
|
* rejection). The widget renders just the headline + reason + Try again, since there's
|
|
14
22
|
* no settlement record to surface.
|
|
15
23
|
*/
|
|
16
|
-
|
|
24
|
+
interface ErrorStateOwnProps {
|
|
25
|
+
/**
|
|
26
|
+
* Optional custom composition. Defaults vary by branch — settlement-derived failures render
|
|
27
|
+
* the full receipt (`<Header />` + `<Body>` containing `<Hero />` `<Details>…rows…</Details>`
|
|
28
|
+
* `<HelpInfo />` + `<Actions />`); FSM-derived failures render the minimal headline-only
|
|
29
|
+
* shape (`<Header />` + `<Body><Hero /></Body>` + `<Actions />`). Pass children once and
|
|
30
|
+
* they apply to whichever branch renders.
|
|
31
|
+
*/
|
|
32
|
+
children?: ReactNode;
|
|
33
|
+
}
|
|
34
|
+
declare function ErrorState({
|
|
35
|
+
children,
|
|
36
|
+
...props
|
|
37
|
+
}: ComponentProps<"div"> & ErrorStateOwnProps): _$react_jsx_runtime0.JSX.Element | null;
|
|
17
38
|
declare function ErrorStateDialog({
|
|
18
39
|
open,
|
|
19
40
|
defaultOpen,
|
|
@@ -22,9 +43,23 @@ declare function ErrorStateDialog({
|
|
|
22
43
|
...rootProps
|
|
23
44
|
}: ErrorState.DialogProps): _$react_jsx_runtime0.JSX.Element;
|
|
24
45
|
declare namespace ErrorState {
|
|
25
|
-
type Props = ComponentProps<"div"
|
|
26
|
-
type DialogProps = ComponentProps<"div"> & DialogShellControls;
|
|
46
|
+
type Props = ComponentProps<"div"> & ErrorStateOwnProps;
|
|
47
|
+
type DialogProps = ComponentProps<"div"> & DialogShellControls & ErrorStateOwnProps;
|
|
27
48
|
const Dialog: typeof ErrorStateDialog;
|
|
49
|
+
const Header: typeof ErrorStateHeader;
|
|
50
|
+
const Body: (props: ErrorStateBodyProps) => _$react_jsx_runtime0.JSX.Element;
|
|
51
|
+
const Hero: typeof ErrorStateHero;
|
|
52
|
+
const Details: typeof ErrorStateDetails;
|
|
53
|
+
const FillStatusRow: typeof ErrorStateFillStatusRow;
|
|
54
|
+
const SourceRow: typeof ErrorStateSourceRow;
|
|
55
|
+
const DestinationRow: typeof ErrorStateDestinationRow;
|
|
56
|
+
const YouReceiveRow: typeof ErrorStateYouReceiveRow;
|
|
57
|
+
const MoreDetails: typeof ErrorStateMoreDetails;
|
|
58
|
+
const DepositTxRow: typeof ErrorStateDepositTxRow;
|
|
59
|
+
const SubmittedAtRow: typeof ErrorStateSubmittedAtRow;
|
|
60
|
+
const FailedAtRow: typeof ErrorStateFailedAtRow;
|
|
61
|
+
const HelpInfo: typeof ErrorStateHelpInfo;
|
|
62
|
+
const Actions: typeof ErrorStateActions;
|
|
28
63
|
}
|
|
29
64
|
//#endregion
|
|
30
65
|
export { ErrorState };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{useDepositSnapshot as e}from"../../driver/context.js";import{useLingui as t}from"../../../../shared/i18n/useLingui.js";import"../../../../i18n/index.js";import{useFailureReasonForKind as n}from"../../../../shared/orchestrator/failureReason.js";import"../../../../shared/orchestrator/index.js";import{useDepositActions as r,useDepositEffectiveState as i}from"../../orchestrator/controller.js";import{DialogShell as a}from"../../../../shared/dialog/DialogShell.js";import{ErrorState as o}from"../../../../shared/widgets/error-state/compound/ErrorState.js";import"../../../../shared/widgets/error-state/compound/index.js";import{toAssetDescriptor as s}from"../../../../shared/widgets/asset-descriptor.js";import{
|
|
1
|
+
"use client";import{useDepositSnapshot as e}from"../../driver/context.js";import{useLingui as t}from"../../../../shared/i18n/useLingui.js";import"../../../../i18n/index.js";import{useFailureReasonForKind as n}from"../../../../shared/orchestrator/failureReason.js";import"../../../../shared/orchestrator/index.js";import{useDepositActions as r,useDepositEffectiveState as i}from"../../orchestrator/controller.js";import{DialogShell as a}from"../../../../shared/dialog/DialogShell.js";import{ErrorState as o}from"../../../../shared/widgets/error-state/compound/ErrorState.js";import"../../../../shared/widgets/error-state/compound/index.js";import{toAssetDescriptor as s}from"../../../../shared/widgets/asset-descriptor.js";import{Fragment as c,jsx as l,jsxs as u}from"react/jsx-runtime";function d({children:a,...d}){let f=e(),p=i(),{tryAgain:m}=r(),{_:h}=t(),g=n();if(p.name!==`error`)return null;let _=f.settlement,v=_.status===`ready`&&_.payload.kind===`failed`?_.payload:void 0,y=p.name===`error`?p.ctx.failure:void 0,b=h({id:`i-4Fbp`,message:`Deposit failed`}),x=v?g(v.failureKind):y?.reason;if(!v)return l(o,{...d,headline:b,...x?{reason:x}:{},onTryAgain:m,children:a??u(c,{children:[l(o.Header,{}),l(o.Body,{children:l(o.Hero,{})}),l(o.Actions,{})]})});let S=v,C={...S.sourceWallet.name===void 0?{}:{name:S.sourceWallet.name},address:S.sourceWallet.address.formatted,...S.sourceWallet.explorerUrl?{explorerUrl:S.sourceWallet.explorerUrl}:{}},w={...S.destination.name===void 0?{}:{name:S.destination.name},address:S.destination.address.formatted},T=s(S.creditedAsset)??{symbol:S.creditedAsset.symbol},E={hash:S.txHash.formatted,...S.txExplorerUrl?{explorerUrl:S.txExplorerUrl}:{}};return l(o,{...d,headline:b,...x?{reason:x}:{},sourceWallet:C,destination:w,receiveAmount:S.receiveAmount.formatted,receiveAsset:T,depositTx:E,submittedAt:S.submittedAt.formatted,failedAt:S.failedAt.formatted,onTryAgain:m,children:a??u(c,{children:[l(o.Header,{}),u(o.Body,{children:[l(o.Hero,{}),u(o.Details,{children:[l(o.FillStatusRow,{}),l(o.SourceRow,{}),l(o.DestinationRow,{}),l(o.YouReceiveRow,{}),u(o.MoreDetails,{children:[l(o.DepositTxRow,{}),l(o.SubmittedAtRow,{}),l(o.FailedAtRow,{})]})]}),l(o.HelpInfo,{})]}),l(o.Actions,{})]})})}function f({open:e,defaultOpen:t,onOpenChange:n,trigger:r,...i}){return l(a,{open:e,defaultOpen:t,onOpenChange:n,trigger:r,children:l(d,{...i})})}(function(e){e.Dialog=f,e.Header=o.Header,e.Body=o.Body,e.Hero=o.Hero,e.Details=o.Details,e.FillStatusRow=o.FillStatusRow,e.SourceRow=o.SourceRow,e.DestinationRow=o.DestinationRow,e.YouReceiveRow=o.YouReceiveRow,e.MoreDetails=o.MoreDetails,e.DepositTxRow=o.DepositTxRow,e.SubmittedAtRow=o.SubmittedAtRow,e.FailedAtRow=o.FailedAtRow,e.HelpInfo=o.HelpInfo,e.Actions=o.Actions})(d||={});export{d as ErrorState};
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { DialogShellControls } from "../../../../shared/dialog/DialogShell.js";
|
|
2
|
-
import {
|
|
2
|
+
import { ProcessingStateBodyProps } from "../../../../shared/widgets/processing-state/compound/types.js";
|
|
3
|
+
import { ProcessingStateDetails } from "../../../../shared/widgets/processing-state/compound/components/Details.js";
|
|
4
|
+
import { ProcessingStateHeader } from "../../../../shared/widgets/processing-state/compound/components/Header.js";
|
|
5
|
+
import { ProcessingStateHero } from "../../../../shared/widgets/processing-state/compound/components/Hero.js";
|
|
6
|
+
import { ProcessingStateDetectedAtRow, ProcessingStateSourceRow, ProcessingStateSourceTxRow, ProcessingStateSubmittedAtRow } from "../../../../shared/widgets/processing-state/compound/components/Rows.js";
|
|
7
|
+
import { ProcessingStateStatusPill } from "../../../../shared/widgets/processing-state/compound/components/StatusPill.js";
|
|
8
|
+
import { ComponentProps, ReactNode } from "react";
|
|
3
9
|
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
10
|
|
|
5
11
|
//#region src/flows/deposit/widgets/processing-state/ProcessingState.d.ts
|
|
@@ -14,7 +20,18 @@ import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
|
14
20
|
* `detectedAt` timestamp, and source-wallet adornment land when the indexer picks them up; the
|
|
15
21
|
* deposit-tx hash is shown immediately from `state.ctx.tx`.
|
|
16
22
|
*/
|
|
17
|
-
|
|
23
|
+
interface ProcessingStateOwnProps {
|
|
24
|
+
/**
|
|
25
|
+
* Optional custom composition. Defaults to `<Header />` + `<Body><Hero /><StatusPill />
|
|
26
|
+
* <Details><SourceRow /><SourceTxRow /><SubmittedAtRow /><DetectedAtRow /></Details>
|
|
27
|
+
* </Body>`. Pass children to interleave your own elements between compound parts.
|
|
28
|
+
*/
|
|
29
|
+
children?: ReactNode;
|
|
30
|
+
}
|
|
31
|
+
declare function ProcessingState({
|
|
32
|
+
children,
|
|
33
|
+
...props
|
|
34
|
+
}: ComponentProps<"div"> & ProcessingStateOwnProps): _$react_jsx_runtime0.JSX.Element | null;
|
|
18
35
|
declare function ProcessingStateDialog({
|
|
19
36
|
open,
|
|
20
37
|
defaultOpen,
|
|
@@ -23,9 +40,18 @@ declare function ProcessingStateDialog({
|
|
|
23
40
|
...rootProps
|
|
24
41
|
}: ProcessingState.DialogProps): _$react_jsx_runtime0.JSX.Element;
|
|
25
42
|
declare namespace ProcessingState {
|
|
26
|
-
type Props = ComponentProps<"div"
|
|
27
|
-
type DialogProps = ComponentProps<"div"> & DialogShellControls;
|
|
43
|
+
type Props = ComponentProps<"div"> & ProcessingStateOwnProps;
|
|
44
|
+
type DialogProps = ComponentProps<"div"> & DialogShellControls & ProcessingStateOwnProps;
|
|
28
45
|
const Dialog: typeof ProcessingStateDialog;
|
|
46
|
+
const Header: typeof ProcessingStateHeader;
|
|
47
|
+
const Body: (props: ProcessingStateBodyProps) => _$react_jsx_runtime0.JSX.Element;
|
|
48
|
+
const Hero: typeof ProcessingStateHero;
|
|
49
|
+
const StatusPill: typeof ProcessingStateStatusPill;
|
|
50
|
+
const Details: typeof ProcessingStateDetails;
|
|
51
|
+
const SourceRow: typeof ProcessingStateSourceRow;
|
|
52
|
+
const SourceTxRow: typeof ProcessingStateSourceTxRow;
|
|
53
|
+
const SubmittedAtRow: typeof ProcessingStateSubmittedAtRow;
|
|
54
|
+
const DetectedAtRow: typeof ProcessingStateDetectedAtRow;
|
|
29
55
|
}
|
|
30
56
|
//#endregion
|
|
31
57
|
export { ProcessingState };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{useDepositSnapshot as e}from"../../driver/context.js";import{useLingui as t}from"../../../../shared/i18n/useLingui.js";import"../../../../i18n/index.js";import{useDepositActions as n,useDepositEffectiveState as r}from"../../orchestrator/controller.js";import{shortenAddress as i}from"../../../../shared/format/shortenAddress.js";import{DialogShell as a}from"../../../../shared/dialog/DialogShell.js";import{ProcessingState as o}from"../../../../shared/widgets/processing-state/compound/ProcessingState.js";import"../../../../shared/widgets/processing-state/compound/index.js";import{
|
|
1
|
+
"use client";import{useDepositSnapshot as e}from"../../driver/context.js";import{useLingui as t}from"../../../../shared/i18n/useLingui.js";import"../../../../i18n/index.js";import{useDepositActions as n,useDepositEffectiveState as r}from"../../orchestrator/controller.js";import{shortenAddress as i}from"../../../../shared/format/shortenAddress.js";import{DialogShell as a}from"../../../../shared/dialog/DialogShell.js";import{ProcessingState as o}from"../../../../shared/widgets/processing-state/compound/ProcessingState.js";import"../../../../shared/widgets/processing-state/compound/index.js";import{Fragment as s,jsx as c,jsxs as l}from"react/jsx-runtime";const u=l(s,{children:[c(o.Header,{}),l(o.Body,{children:[c(o.Hero,{}),c(o.StatusPill,{}),l(o.Details,{children:[c(o.SourceRow,{}),c(o.SourceTxRow,{}),c(o.SubmittedAtRow,{}),c(o.DetectedAtRow,{})]})]})]});function d({children:a,...s}){let l=e(),d=r(),{back:f}=n(),{_:p}=t();if(d.name!==`processing`)return null;let m=l.settlement,h=(m.status===`ready`||m.status===`stale`)&&m.payload.kind===`pending`?m.payload:void 0,g=l.brand,_=g.status===`ready`||g.status===`stale`?g.payload.name:void 0,v=l.target,y=v.status===`ready`||v.status===`stale`?v.payload:void 0,b=l.wallet,x=b.status===`ready`||b.status===`stale`?b.payload:void 0,S=!h||h.receiveAmount.value===0,C=h?h.receiveAmount.formatted:``,w=h?.creditedAsset.symbol??y?.symbol??``,T=h?.creditedTo||_||w,E=d.ctx.tx,D=h?.txHash?.formatted??(E.hash?i(E.hash):``),O=h?.txExplorerUrl??E.explorerUrl,k=h?.sourceWallet.name??p({id:`sb9Y58`,message:`Wallet`}),A=h?.sourceWallet.address.formatted??x?.address.formatted??``,j=h?.sourceWallet.explorerUrl,M=A?{name:k,address:A,...j?{explorerUrl:j}:{}}:void 0,N=D?{hash:D,...O?{explorerUrl:O}:{}}:void 0;return c(o,{...s,amount:C,creditedAsset:{symbol:w},creditedTo:T,...S?{loading:!0}:{},onBack:f,...M?{sourceWallet:M}:{},...N?{sourceTx:N}:{},...h?.submittedAt?{submittedAt:h.submittedAt.formatted}:{},...h?.detectedAt?{detectedAt:h.detectedAt.formatted}:{},children:a??u})}function f({open:e,defaultOpen:t,onOpenChange:n,trigger:r,...i}){return c(a,{open:e,defaultOpen:t,onOpenChange:n,trigger:r,children:c(d,{...i})})}(function(e){e.Dialog=f,e.Header=o.Header,e.Body=o.Body,e.Hero=o.Hero,e.StatusPill=o.StatusPill,e.Details=o.Details,e.SourceRow=o.SourceRow,e.SourceTxRow=o.SourceTxRow,e.SubmittedAtRow=o.SubmittedAtRow,e.DetectedAtRow=o.DetectedAtRow})(d||={});export{d as ProcessingState};
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import { DialogShellControls } from "../../../../shared/dialog/DialogShell.js";
|
|
2
|
-
import {
|
|
2
|
+
import { SuccessStateBodyProps } from "../../../../shared/widgets/success-state/compound/types.js";
|
|
3
|
+
import { SuccessStateActions } from "../../../../shared/widgets/success-state/compound/components/Actions.js";
|
|
4
|
+
import { SuccessStateDetails } from "../../../../shared/widgets/success-state/compound/components/Details.js";
|
|
5
|
+
import { SuccessStateHeader } from "../../../../shared/widgets/success-state/compound/components/Header.js";
|
|
6
|
+
import { SuccessStateHeadline } from "../../../../shared/widgets/success-state/compound/components/Headline.js";
|
|
7
|
+
import { SuccessStateMoreDetails } from "../../../../shared/widgets/success-state/compound/components/MoreDetails.js";
|
|
8
|
+
import { SuccessStateCompletionTxRow, SuccessStateDepositTxRow, SuccessStateDestinationRow, SuccessStateFillStatusRow, SuccessStateFilledAtRow, SuccessStateSourceRow, SuccessStateSubmittedAtRow, SuccessStateTotalTimeRow, SuccessStateYouReceiveRow } from "../../../../shared/widgets/success-state/compound/components/Rows.js";
|
|
9
|
+
import { ComponentProps, ReactNode } from "react";
|
|
3
10
|
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
11
|
|
|
5
12
|
//#region src/flows/deposit/widgets/success-state/SuccessState.d.ts
|
|
@@ -13,7 +20,19 @@ import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
|
13
20
|
* `<DepositDialog />` shell; the dialog's lifecycle gates the render on the FSM's `success`
|
|
14
21
|
* state.
|
|
15
22
|
*/
|
|
16
|
-
|
|
23
|
+
interface SuccessStateOwnProps {
|
|
24
|
+
/**
|
|
25
|
+
* Optional custom composition. Defaults to `<Header />` + `<Body><Headline /><Details>…rows…
|
|
26
|
+
* <MoreDetails>…</MoreDetails></Details></Body>` + `<Actions />`. The default conditionally
|
|
27
|
+
* mounts `<MoreDetails>` only when at least one of `depositTx` / `completionTx` /
|
|
28
|
+
* `submittedAt` / `filledAt` is available. Pass children to interleave your own elements.
|
|
29
|
+
*/
|
|
30
|
+
children?: ReactNode;
|
|
31
|
+
}
|
|
32
|
+
declare function SuccessState({
|
|
33
|
+
children,
|
|
34
|
+
...props
|
|
35
|
+
}: ComponentProps<"div"> & SuccessStateOwnProps): _$react_jsx_runtime0.JSX.Element | null;
|
|
17
36
|
declare function SuccessStateDialog({
|
|
18
37
|
open,
|
|
19
38
|
defaultOpen,
|
|
@@ -22,9 +41,24 @@ declare function SuccessStateDialog({
|
|
|
22
41
|
...rootProps
|
|
23
42
|
}: SuccessState.DialogProps): _$react_jsx_runtime0.JSX.Element;
|
|
24
43
|
declare namespace SuccessState {
|
|
25
|
-
type Props = ComponentProps<"div"
|
|
26
|
-
type DialogProps = ComponentProps<"div"> & DialogShellControls;
|
|
44
|
+
type Props = ComponentProps<"div"> & SuccessStateOwnProps;
|
|
45
|
+
type DialogProps = ComponentProps<"div"> & DialogShellControls & SuccessStateOwnProps;
|
|
27
46
|
const Dialog: typeof SuccessStateDialog;
|
|
47
|
+
const Header: typeof SuccessStateHeader;
|
|
48
|
+
const Body: (props: SuccessStateBodyProps) => _$react_jsx_runtime0.JSX.Element;
|
|
49
|
+
const Headline: typeof SuccessStateHeadline;
|
|
50
|
+
const Details: typeof SuccessStateDetails;
|
|
51
|
+
const FillStatusRow: typeof SuccessStateFillStatusRow;
|
|
52
|
+
const TotalTimeRow: typeof SuccessStateTotalTimeRow;
|
|
53
|
+
const SourceRow: typeof SuccessStateSourceRow;
|
|
54
|
+
const DestinationRow: typeof SuccessStateDestinationRow;
|
|
55
|
+
const YouReceiveRow: typeof SuccessStateYouReceiveRow;
|
|
56
|
+
const MoreDetails: typeof SuccessStateMoreDetails;
|
|
57
|
+
const DepositTxRow: typeof SuccessStateDepositTxRow;
|
|
58
|
+
const CompletionTxRow: typeof SuccessStateCompletionTxRow;
|
|
59
|
+
const SubmittedAtRow: typeof SuccessStateSubmittedAtRow;
|
|
60
|
+
const FilledAtRow: typeof SuccessStateFilledAtRow;
|
|
61
|
+
const Actions: typeof SuccessStateActions;
|
|
28
62
|
}
|
|
29
63
|
//#endregion
|
|
30
64
|
export { SuccessState };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{useDepositSnapshot as e}from"../../driver/context.js";import{useDepositActions as t,useDepositEffectiveState as n}from"../../orchestrator/controller.js";import{DialogShell as r}from"../../../../shared/dialog/DialogShell.js";import{SuccessState as i}from"../../../../shared/widgets/success-state/compound/SuccessState.js";import"../../../../shared/widgets/success-state/compound/index.js";import{toAssetDescriptor as a}from"../../../../shared/widgets/asset-descriptor.js";import{
|
|
1
|
+
"use client";import{useDepositSnapshot as e}from"../../driver/context.js";import{useDepositActions as t,useDepositEffectiveState as n}from"../../orchestrator/controller.js";import{DialogShell as r}from"../../../../shared/dialog/DialogShell.js";import{SuccessState as i}from"../../../../shared/widgets/success-state/compound/SuccessState.js";import"../../../../shared/widgets/success-state/compound/index.js";import{toAssetDescriptor as a}from"../../../../shared/widgets/asset-descriptor.js";import{Fragment as o,jsx as s,jsxs as c}from"react/jsx-runtime";function l({children:r,...l}){let u=e(),d=n().name,{successDone:f}=t();if(d!==`success`)return null;let p=u.settlement;if(p.status!==`ready`||p.payload.kind!==`succeeded`)return null;let m=p.payload,h=u.brand,g=h.status===`ready`||h.status===`stale`?h.payload.name:void 0,_=m.destination.name??g??m.creditedAsset.symbol,v=m.aggregatorExplorerUrl?{url:m.aggregatorExplorerUrl}:void 0,y=m.depositTx||m.completionTx||m.submittedAt||m.filledAt,b=a(m.creditedAsset)??{symbol:m.creditedAsset.symbol},x={...m.sourceWallet.name===void 0?{}:{name:m.sourceWallet.name},address:m.sourceWallet.address.formatted,...m.sourceWallet.explorerUrl?{explorerUrl:m.sourceWallet.explorerUrl}:{}};return s(i,{...l,amount:m.receiveAmount.formatted,creditedAsset:b,creditedTo:_,...v?{explorer:v}:{},...m.depositTx?{depositTx:{hash:m.depositTx.hash.formatted,...m.depositTx.explorerUrl?{explorerUrl:m.depositTx.explorerUrl}:{}}}:{},...m.completionTx?{completionTx:{hash:m.completionTx.hash.formatted,...m.completionTx.explorerUrl?{explorerUrl:m.completionTx.explorerUrl}:{}}}:{},submittedAt:m.submittedAt.formatted,filledAt:m.filledAt.formatted,totalTime:m.totalTime.formatted,sourceWallet:x,onDone:f,children:r??c(o,{children:[s(i.Header,{}),c(i.Body,{children:[s(i.Headline,{}),c(i.Details,{children:[s(i.FillStatusRow,{}),s(i.TotalTimeRow,{}),s(i.SourceRow,{}),s(i.DestinationRow,{}),s(i.YouReceiveRow,{}),y?c(i.MoreDetails,{children:[s(i.DepositTxRow,{}),s(i.CompletionTxRow,{}),s(i.SubmittedAtRow,{}),s(i.FilledAtRow,{})]}):null]})]}),s(i.Actions,{})]})})}function u({open:e,defaultOpen:t,onOpenChange:n,trigger:i,...a}){return s(r,{open:e,defaultOpen:t,onOpenChange:n,trigger:i,children:s(l,{...a})})}(function(e){e.Dialog=u,e.Header=i.Header,e.Body=i.Body,e.Headline=i.Headline,e.Details=i.Details,e.FillStatusRow=i.FillStatusRow,e.TotalTimeRow=i.TotalTimeRow,e.SourceRow=i.SourceRow,e.DestinationRow=i.DestinationRow,e.YouReceiveRow=i.YouReceiveRow,e.MoreDetails=i.MoreDetails,e.DepositTxRow=i.DepositTxRow,e.CompletionTxRow=i.CompletionTxRow,e.SubmittedAtRow=i.SubmittedAtRow,e.FilledAtRow=i.FilledAtRow,e.Actions=i.Actions})(l||={});export{l as SuccessState};
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { DialogShellControls } from "../../../../shared/dialog/DialogShell.js";
|
|
2
|
-
import {
|
|
2
|
+
import { TransferCryptoBodyProps, TransferCryptoHeaderProps } from "./compound/types.js";
|
|
3
|
+
import { TransferCryptoAddress } from "./compound/components/Address.js";
|
|
4
|
+
import { TransferCryptoDisclosure } from "./compound/components/Disclosure.js";
|
|
5
|
+
import { TransferCryptoQrCode } from "./compound/components/QrCode.js";
|
|
6
|
+
import { TransferCryptoSelectors } from "./compound/components/Selectors.js";
|
|
7
|
+
import { TransferCryptoSummary } from "./compound/components/Summary.js";
|
|
8
|
+
import { ComponentProps, ReactNode } from "react";
|
|
3
9
|
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
10
|
|
|
5
11
|
//#region src/flows/deposit/widgets/transfer-crypto/TransferCrypto.d.ts
|
|
@@ -8,7 +14,15 @@ import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
|
8
14
|
* callback (`(address: string) => void`) collides with the native div's
|
|
9
15
|
* `ClipboardEventHandler`. Hosts route copy tracking through the driver layer.
|
|
10
16
|
*/
|
|
11
|
-
type TransferCryptoOrchestratedProps = Omit<ComponentProps<"div">, "onCopy"
|
|
17
|
+
type TransferCryptoOrchestratedProps = Omit<ComponentProps<"div">, "onCopy"> & TransferCryptoOwnProps;
|
|
18
|
+
interface TransferCryptoOwnProps {
|
|
19
|
+
/**
|
|
20
|
+
* Optional custom composition. Defaults to `<Header />` + `<Body><Selectors /><QrCode />
|
|
21
|
+
* <Summary /><Address /><Disclosure /></Body>`. Pass children to interleave your own
|
|
22
|
+
* elements between compound parts.
|
|
23
|
+
*/
|
|
24
|
+
children?: ReactNode;
|
|
25
|
+
}
|
|
12
26
|
/**
|
|
13
27
|
* Orchestrated `TransferCrypto` widget. Reads the per-chain deposit address list from the
|
|
14
28
|
* driver's `addresses` entity and the destination receive asset from `target`.
|
|
@@ -24,7 +38,10 @@ type TransferCryptoOrchestratedProps = Omit<ComponentProps<"div">, "onCopy">;
|
|
|
24
38
|
* driver layer; this wrapper just renders whatever the driver surfaces and then narrows by the
|
|
25
39
|
* active token.
|
|
26
40
|
*/
|
|
27
|
-
declare function TransferCrypto(
|
|
41
|
+
declare function TransferCrypto({
|
|
42
|
+
children,
|
|
43
|
+
...props
|
|
44
|
+
}: TransferCryptoOrchestratedProps): _$react_jsx_runtime0.JSX.Element | null;
|
|
28
45
|
declare function TransferCryptoDialog({
|
|
29
46
|
open,
|
|
30
47
|
defaultOpen,
|
|
@@ -32,10 +49,24 @@ declare function TransferCryptoDialog({
|
|
|
32
49
|
trigger,
|
|
33
50
|
...rootProps
|
|
34
51
|
}: TransferCrypto.DialogProps): _$react_jsx_runtime0.JSX.Element;
|
|
52
|
+
/**
|
|
53
|
+
* Wraps the headless `<TransferCryptoCompound.Header />` so that consumers of the production
|
|
54
|
+
* namespace get the orchestrated back chevron for free. Reads the FSM the same way the
|
|
55
|
+
* production widget's default composition does (hide when entered from `closed`); host-supplied
|
|
56
|
+
* `onBack` overrides the orchestrated default.
|
|
57
|
+
*/
|
|
58
|
+
declare function TransferCryptoHeader(props?: TransferCryptoHeaderProps): _$react_jsx_runtime0.JSX.Element;
|
|
35
59
|
declare namespace TransferCrypto {
|
|
36
60
|
type Props = TransferCryptoOrchestratedProps;
|
|
37
61
|
type DialogProps = TransferCryptoOrchestratedProps & DialogShellControls;
|
|
38
62
|
const Dialog: typeof TransferCryptoDialog;
|
|
63
|
+
const Header: typeof TransferCryptoHeader;
|
|
64
|
+
const Body: (props: TransferCryptoBodyProps) => _$react_jsx_runtime0.JSX.Element;
|
|
65
|
+
const Selectors: typeof TransferCryptoSelectors;
|
|
66
|
+
const QrCode: typeof TransferCryptoQrCode;
|
|
67
|
+
const Summary: typeof TransferCryptoSummary;
|
|
68
|
+
const Address: typeof TransferCryptoAddress;
|
|
69
|
+
const Disclosure: typeof TransferCryptoDisclosure;
|
|
39
70
|
}
|
|
40
71
|
//#endregion
|
|
41
72
|
export { TransferCrypto };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{useDepositSnapshot as e}from"../../driver/context.js";import{useDepositActions as t,useDepositEffectiveState as n}from"../../orchestrator/controller.js";import{useKitEmitter as r}from"../../../../events/emit/useKitEmitter.js";import"../../../../events/emit/index.js";import{DialogShell as i}from"../../../../shared/dialog/DialogShell.js";import{TransferCrypto as a}from"./compound/TransferCrypto.js";import"./compound/index.js";import{useCallback as o,useMemo as s,useState as c}from"react";import{
|
|
1
|
+
"use client";import{useDepositSnapshot as e}from"../../driver/context.js";import{useDepositActions as t,useDepositEffectiveState as n}from"../../orchestrator/controller.js";import{useKitEmitter as r}from"../../../../events/emit/useKitEmitter.js";import"../../../../events/emit/index.js";import{DialogShell as i}from"../../../../shared/dialog/DialogShell.js";import{TransferCrypto as a}from"./compound/TransferCrypto.js";import"./compound/index.js";import{useCallback as o,useMemo as s,useState as c}from"react";import{Fragment as l,jsx as u,jsxs as d}from"react/jsx-runtime";function f({children:i,...f}){let p=e(),m=n(),h=m.name,{back:g}=t(),_=m.name===`transferCrypto`&&m.ctx.backTarget!==`closed`?g:void 0,v=p.addresses,y=v.status===`ready`||v.status===`stale`?v.payload:[],b=p.target,x=b.status===`ready`||b.status===`stale`?b.payload:void 0,S=x?.minAmountUsd?.formatted,C=s(()=>{let e=new Map;for(let t of y)for(let n of t.acceptedAssets??[]){let r=n.symbol.toUpperCase(),i=e.get(r);i?i.push({chain:t,asset:n}):e.set(r,[{chain:t,asset:n}])}return e},[y]),w=s(()=>C.size===0?x?[{symbol:x.symbol,...x.eip155Id?{chainId:Number(x.eip155Id)}:{},...x.address?{address:x.address}:{},...x.isNative===void 0?{}:{isNative:x.isNative},...x.assetLogoUrl?{logoUrl:x.assetLogoUrl}:{}}]:[]:[...C.values()].map(e=>{let t=e[0];return{symbol:t.asset.symbol,...t.chain.eip155Id?{chainId:Number(t.chain.eip155Id)}:{},...t.asset.address?{address:t.asset.address}:{},isNative:t.asset.isNative,...t.asset.assetLogoUrl?{logoUrl:t.asset.assetLogoUrl}:{}}}),[C,x]),[T,E]=c(void 0),[D,O]=c(void 0),k=r(),A=o(e=>{E(e),k({type:`deposit.transfer.token.changed`,flow:`deposit`,tier:`ui`,payload:{token:e}})},[k]),j=o(e=>{O(e),k({type:`deposit.transfer.chain.changed`,flow:`deposit`,tier:`ui`,payload:{chain:e}})},[k]),M=o(e=>{k({type:`deposit.transfer.address.copied`,flow:`deposit`,tier:`ui`,payload:{address:e}})},[k]),N=s(()=>{if(T&&w.some(e=>e.symbol.toUpperCase()===T.symbol.toUpperCase()))return T;let e=x?.symbol.toUpperCase();return w.find(t=>t.symbol.toUpperCase()===e)??w[0]},[T,w,x?.symbol]),P=s(()=>(N?C.get(N.symbol.toUpperCase())?.map(e=>e.chain)??[...y]:[...y]).map(e=>{let t=e.minAmountUsd?.formatted??S;return{symbol:e.networkName,...e.eip155Id?{chainId:Number(e.eip155Id)}:{},isNative:!0,...e.chainLogoUrl?{logoUrl:e.chainLogoUrl}:{},...t?{minDeposit:t}:{}}}),[N,C,y,S]),F=s(()=>{if(D&&P.some(e=>e.chainId===D.chainId))return D;let e=x?.eip155Id?Number(x.eip155Id):void 0;return(e===void 0?void 0:P.find(t=>t.chainId===e))??P[0]},[D,P,x?.eip155Id]),I=s(()=>F?.chainId?y.find(e=>e.eip155Id&&Number(e.eip155Id)===F.chainId)??y[0]:y[0],[F,y]),L=s(()=>{if(!N)return;let e=I?.acceptedAssets?.find(e=>e.symbol.toUpperCase()===N.symbol.toUpperCase());return e?{symbol:e.symbol,...F?.chainId===void 0?{}:{chainId:F.chainId},...e.address?{address:e.address}:{},isNative:e.isNative,...e.assetLogoUrl?{logoUrl:e.assetLogoUrl}:{}}:N},[N,I,F?.chainId]),R=I?.address.value??``;if(h!==`transferCrypto`||!x||y.length===0)return null;let z={symbol:x.symbol,...x.eip155Id?{chainId:Number(x.eip155Id)}:{},...x.address?{address:x.address}:{},...x.isNative===void 0?{}:{isNative:x.isNative},...x.assetLogoUrl?{logoUrl:x.assetLogoUrl}:{}},B={symbol:x.networkName,...x.eip155Id?{chainId:Number(x.eip155Id)}:{},isNative:!0,...x.chainLogoUrl?{logoUrl:x.chainLogoUrl}:{}};return u(a,{...f,depositAddress:R,token:L,chain:F,onTokenChange:A,onChainChange:j,onCopy:M,tokenOptions:w,chainOptions:P,sendAsset:L,sendNetwork:F,receiveAsset:z,receiveNetwork:B,children:i??d(l,{children:[u(a.Header,{..._?{onBack:_}:{}}),d(a.Body,{children:[u(a.Selectors,{}),u(a.QrCode,{}),u(a.Summary,{}),u(a.Address,{}),u(a.Disclosure,{})]})]})})}function p({open:e,defaultOpen:t,onOpenChange:n,trigger:r,...a}){return u(i,{open:e,defaultOpen:t,onOpenChange:n,trigger:r,children:u(f,{...a})})}function m(e={}){let r=n(),{back:i}=t(),o=r.name===`transferCrypto`&&r.ctx.backTarget!==`closed`?i:void 0,s=e.onBack??o;return u(a.Header,{...e,...s?{onBack:s}:{}})}(function(e){e.Dialog=p,e.Header=m,e.Body=a.Body,e.Selectors=a.Selectors,e.QrCode=a.QrCode,e.Summary=a.Summary,e.Address=a.Address,e.Disclosure=a.Disclosure})(f||={});export{f as TransferCrypto};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{useWithdrawBindings as e}from"../bindings/WithdrawBindings.js";import"../bindings/index.js";import{useWithdrawSnapshot as t}from"../driver/context.js";import{
|
|
1
|
+
"use client";import{useWithdrawBindings as e}from"../bindings/WithdrawBindings.js";import"../bindings/index.js";import{useWithdrawSnapshot as t}from"../driver/context.js";import{useWithdrawState as n}from"../orchestrator/controller.js";import{useWithdraw as r}from"../orchestrator/useWithdraw.js";import"../orchestrator/index.js";import{useWithdrawEmissions as i}from"../../../events/emit/useWithdrawEmissions.js";import"../../../events/emit/index.js";import{useIntercomShutdownOnUnmount as a}from"../../../shared/support/useIntercomShutdownOnUnmount.js";import"../../../shared/support/index.js";import{Dialog as o}from"../../../shared/ui/Dialog/Dialog.js";import"../../../shared/ui/Dialog/index.js";import{Withdraw as s}from"../widgets/withdraw/compound/Withdraw.js";import"../../../withdraw/compound/index.js";import{WithdrawError as c}from"../widgets/withdraw-error/WithdrawError.js";import{WithdrawForm as l}from"../widgets/withdraw-form/WithdrawForm.js";import{WithdrawInProgress as u}from"../widgets/withdraw-in-progress/WithdrawInProgress.js";import{WithdrawSuccess as d}from"../widgets/withdraw-success/WithdrawSuccess.js";import"../../../_internal/withdraw/widgets/index.js";import{jsx as f,jsxs as p}from"react/jsx-runtime";function m({container:m,metadata:h,onError:g,balance:_,onSubmit:v,suggestedRecipient:y}={}){let b=n(),{close:x}=r(),S=t(),C=b.name!==`closed`;return i({state:b,settlement:S.settlement,quote:S.quote,metadata:h}),a(),e({..._===void 0?{}:{balance:_},...v?{onSubmit:v}:{},...y?{suggestedRecipient:y}:{}}),f(o,{open:C,onOpenChange:e=>e?void 0:x(),children:f(o.Content,{container:m,children:f(s.Boundary,{...g?{onError:g}:{},children:f(s.Guards,{children:p(s.Steps,{children:[f(s.Step,{name:`form`,children:f(l,{})}),f(s.Step,{name:`inProgress`,children:f(u,{})}),f(s.Step,{name:`success`,children:f(d,{})}),f(s.Step,{name:`error`,children:f(c,{})})]})})})})})}export{m as WithdrawDialog};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { WithdrawStateName } from "../../../orchestrator/types.js";
|
|
2
|
+
import { Props, WithdrawBoundary } from "./components/Boundary.js";
|
|
3
|
+
import { Props as Props$1, WithdrawGuards } from "./components/Guards.js";
|
|
2
4
|
import { WithdrawSteps, WithdrawStepsProps } from "./components/Steps.js";
|
|
3
5
|
import { ReactNode } from "react";
|
|
4
6
|
|
|
@@ -34,12 +36,25 @@ declare function Withdraw(): null;
|
|
|
34
36
|
declare namespace Withdraw {
|
|
35
37
|
type StepsProps = WithdrawStepsProps;
|
|
36
38
|
type StepProps = WithdrawStepProps;
|
|
39
|
+
type GuardsProps = Props$1;
|
|
40
|
+
type BoundaryProps = Props;
|
|
37
41
|
const Steps: typeof WithdrawSteps;
|
|
38
42
|
/**
|
|
39
43
|
* Slot consumed by {@link Withdraw.Steps}. `name` is the FSM state to match; the matched
|
|
40
44
|
* step's `children` are rendered, every other branch is dropped.
|
|
41
45
|
*/
|
|
42
46
|
const Step: (props: WithdrawStepProps) => null;
|
|
47
|
+
/**
|
|
48
|
+
* Bootstrap-loading guard. While `gateway/start` is in flight on the form / submitting
|
|
49
|
+
* step pair, renders a centered spinner instead of empty form chrome. Falls through to
|
|
50
|
+
* children for every other state.
|
|
51
|
+
*/
|
|
52
|
+
const Guards: typeof WithdrawGuards;
|
|
53
|
+
/**
|
|
54
|
+
* Error-boundary part. Wires the kit's `GatewayKitBoundary` with withdraw-flow recovery —
|
|
55
|
+
* `onReset` calls `useWithdraw().close()` internally; `onError` is host-supplied.
|
|
56
|
+
*/
|
|
57
|
+
const Boundary: typeof WithdrawBoundary;
|
|
43
58
|
}
|
|
44
59
|
//#endregion
|
|
45
60
|
export { Withdraw };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{Step as e}from"../../../../../shared/ui/Steps/Steps.js";import"../../../../../shared/ui/Steps/index.js";import{
|
|
1
|
+
"use client";import{Step as e}from"../../../../../shared/ui/Steps/Steps.js";import"../../../../../shared/ui/Steps/index.js";import{WithdrawBoundary as t}from"./components/Boundary.js";import{WithdrawGuards as n}from"./components/Guards.js";import{WithdrawSteps as r}from"./components/Steps.js";function i(){return null}(function(i){i.Steps=r,i.Step=e,i.Guards=n,i.Boundary=t})(i||={});export{i as Withdraw};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ErrorInfo, ReactNode } from "react";
|
|
2
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/flows/withdraw/widgets/withdraw/compound/components/Boundary.d.ts
|
|
5
|
+
interface Props {
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* Replaces the kit's default crash fallback. Compose `GatewayKitErrorCard` parts to keep
|
|
9
|
+
* kit styling, or render your own JSX for a fully custom recovery surface.
|
|
10
|
+
*/
|
|
11
|
+
fallback?: ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* Fires once per caught render error. Pipe to your analytics or error-reporting pipeline.
|
|
14
|
+
*/
|
|
15
|
+
onError?: (error: Error, errorInfo: ErrorInfo) => void;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Error-boundary part for the withdraw flow. Wraps children with the kit's
|
|
19
|
+
* `GatewayKitBoundary` and pipes the recovery action through `useWithdraw().close()` so a
|
|
20
|
+
* crash returns the user to a clean state. `onError` is host-supplied; `onReset` is wired
|
|
21
|
+
* internally.
|
|
22
|
+
*/
|
|
23
|
+
declare function WithdrawBoundary({
|
|
24
|
+
children,
|
|
25
|
+
fallback,
|
|
26
|
+
onError
|
|
27
|
+
}: Props): _$react_jsx_runtime0.JSX.Element;
|
|
28
|
+
//#endregion
|
|
29
|
+
export { Props, WithdrawBoundary };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{useWithdrawActions as e}from"../../../../orchestrator/controller.js";import{GatewayKitBoundary as t}from"../../../../../../shared/error-handling/components/GatewayKitBoundary.js";import"../../../../../../shared/error-handling/index.js";import{jsx as n}from"react/jsx-runtime";function r({children:r,fallback:i,onError:a}){let{close:o}=e();return n(t,{...a?{onError:a}:{},...i===void 0?{}:{fallback:i},onReset:o,children:r})}export{r as WithdrawBoundary};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/flows/withdraw/widgets/withdraw/compound/components/Guards.d.ts
|
|
5
|
+
interface Props {
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Bootstrap-loading guard for the withdraw flow. While the lazy `arm()` is in flight,
|
|
10
|
+
* `receiveOptions` is `idle` / `loading` — the form widget would render against an empty
|
|
11
|
+
* catalog, so we surface a centered spinner inside the same frame instead of empty form
|
|
12
|
+
* chrome. Cache hits never trip this branch because the entity stays `ready` for the rest
|
|
13
|
+
* of the provider lifetime once it transitions there.
|
|
14
|
+
*
|
|
15
|
+
* Only applies to the `form` / `submitting` step pair — terminal steps (`inProgress` /
|
|
16
|
+
* `success` / `error`) read from `settlement`, which populates independently of bootstrap.
|
|
17
|
+
* The withdraw flow does NOT have a wallet-required gate; the host always supplies a
|
|
18
|
+
* `flows.withdraw.owner` via `<StridgeProvider>` (the business broadcasts the source-chain
|
|
19
|
+
* tx, not the end-user).
|
|
20
|
+
*/
|
|
21
|
+
declare function WithdrawGuards({
|
|
22
|
+
children
|
|
23
|
+
}: Props): _$react_jsx_runtime0.JSX.Element;
|
|
24
|
+
//#endregion
|
|
25
|
+
export { Props, WithdrawGuards };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{useWithdrawSnapshot as e}from"../../../../driver/context.js";import{useWithdrawEffectiveState as t}from"../../../../orchestrator/controller.js";import"../../../../orchestrator/index.js";import{LoadingState as n}from"../../../../../../shared/dialog/LoadingState.js";import{Fragment as r,jsx as i}from"react/jsx-runtime";function a({children:a}){let o=t(),s=e();return(o.name===`form`||o.name===`submitting`)&&(s.receiveOptions.status===`loading`||s.receiveOptions.status===`idle`)?i(n,{slot:`withdraw`}):i(r,{children:a})}export{a as WithdrawGuards};
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ErrorStateBodyProps, ErrorStateRowProps } from "../../../../shared/widgets/error-state/compound/types.js";
|
|
2
|
+
import { ErrorStateActions } from "../../../../shared/widgets/error-state/compound/components/Actions.js";
|
|
3
|
+
import { ErrorStateDetails } from "../../../../shared/widgets/error-state/compound/components/Details.js";
|
|
4
|
+
import { ErrorStateHeader } from "../../../../shared/widgets/error-state/compound/components/Header.js";
|
|
5
|
+
import { ErrorStateHelpInfo } from "../../../../shared/widgets/error-state/compound/components/HelpInfo.js";
|
|
6
|
+
import { ErrorStateHero } from "../../../../shared/widgets/error-state/compound/components/Hero.js";
|
|
7
|
+
import { ErrorStateMoreDetails } from "../../../../shared/widgets/error-state/compound/components/MoreDetails.js";
|
|
8
|
+
import { ErrorStateDestinationRow, ErrorStateFailedAtRow, ErrorStateFillStatusRow, ErrorStateSourceRow, ErrorStateSubmittedAtRow, ErrorStateYouReceiveRow } from "../../../../shared/widgets/error-state/compound/components/Rows.js";
|
|
9
|
+
import { ComponentProps, ReactNode } from "react";
|
|
2
10
|
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
11
|
|
|
4
12
|
//#region src/flows/withdraw/widgets/withdraw-error/WithdrawError.d.ts
|
|
@@ -17,6 +25,41 @@ import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
|
17
25
|
*
|
|
18
26
|
* The CTA wires to `actions.reset()` so clicking `Try again` returns the user to the empty form.
|
|
19
27
|
*/
|
|
20
|
-
|
|
28
|
+
interface WithdrawErrorOwnProps {
|
|
29
|
+
/**
|
|
30
|
+
* Optional custom composition. Defaults vary by branch — settlement-derived failures render
|
|
31
|
+
* the receipt (`<Header />` + `<Body><Hero /><Details>…rows…</Details><HelpInfo /></Body>` +
|
|
32
|
+
* `<Actions />`); FSM-derived failures render the minimal headline-only shape. Pass children
|
|
33
|
+
* once and they apply to whichever branch renders.
|
|
34
|
+
*/
|
|
35
|
+
children?: ReactNode;
|
|
36
|
+
}
|
|
37
|
+
declare function WithdrawError({
|
|
38
|
+
children,
|
|
39
|
+
...props
|
|
40
|
+
}: ComponentProps<"div"> & WithdrawErrorOwnProps): _$react_jsx_runtime0.JSX.Element | null;
|
|
41
|
+
/**
|
|
42
|
+
* Withdraw-tuned default for the source-tx row label. Without this wrapper, hosts composing
|
|
43
|
+
* `<WithdrawError.DepositTxRow />` would inherit the deposit-flow's "Deposit tx" default —
|
|
44
|
+
* the wrong copy for a withdrawal. Host-supplied `label` overrides.
|
|
45
|
+
*/
|
|
46
|
+
declare function WithdrawErrorDepositTxRow(props?: ErrorStateRowProps): _$react_jsx_runtime0.JSX.Element;
|
|
47
|
+
declare namespace WithdrawError {
|
|
48
|
+
type Props = ComponentProps<"div"> & WithdrawErrorOwnProps;
|
|
49
|
+
const Header: typeof ErrorStateHeader;
|
|
50
|
+
const Body: (props: ErrorStateBodyProps) => _$react_jsx_runtime0.JSX.Element;
|
|
51
|
+
const Hero: typeof ErrorStateHero;
|
|
52
|
+
const Details: typeof ErrorStateDetails;
|
|
53
|
+
const FillStatusRow: typeof ErrorStateFillStatusRow;
|
|
54
|
+
const SourceRow: typeof ErrorStateSourceRow;
|
|
55
|
+
const DestinationRow: typeof ErrorStateDestinationRow;
|
|
56
|
+
const YouReceiveRow: typeof ErrorStateYouReceiveRow;
|
|
57
|
+
const MoreDetails: typeof ErrorStateMoreDetails;
|
|
58
|
+
const DepositTxRow: typeof WithdrawErrorDepositTxRow;
|
|
59
|
+
const SubmittedAtRow: typeof ErrorStateSubmittedAtRow;
|
|
60
|
+
const FailedAtRow: typeof ErrorStateFailedAtRow;
|
|
61
|
+
const HelpInfo: typeof ErrorStateHelpInfo;
|
|
62
|
+
const Actions: typeof ErrorStateActions;
|
|
63
|
+
}
|
|
21
64
|
//#endregion
|
|
22
65
|
export { WithdrawError };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{useLingui as e}from"../../../../shared/i18n/useLingui.js";import"../../../../i18n/index.js";import{useFailureReasonForKind as t}from"../../../../shared/orchestrator/failureReason.js";import"../../../../shared/orchestrator/index.js";import{useWithdrawSnapshot as n}from"../../driver/context.js";import{useWithdrawActions as r,useWithdrawEffectiveState as i}from"../../orchestrator/controller.js";import{ErrorState as a}from"../../../../shared/widgets/error-state/compound/ErrorState.js";import"../../../../shared/widgets/error-state/compound/index.js";import{toAssetDescriptor as o}from"../../../../shared/widgets/asset-descriptor.js";import{
|
|
1
|
+
"use client";import{useLingui as e}from"../../../../shared/i18n/useLingui.js";import"../../../../i18n/index.js";import{useFailureReasonForKind as t}from"../../../../shared/orchestrator/failureReason.js";import"../../../../shared/orchestrator/index.js";import{useWithdrawSnapshot as n}from"../../driver/context.js";import{useWithdrawActions as r,useWithdrawEffectiveState as i}from"../../orchestrator/controller.js";import{ErrorState as a}from"../../../../shared/widgets/error-state/compound/ErrorState.js";import"../../../../shared/widgets/error-state/compound/index.js";import{toAssetDescriptor as o}from"../../../../shared/widgets/asset-descriptor.js";import{Fragment as s,jsx as c,jsxs as l}from"react/jsx-runtime";function u({children:u,...d}){let f=n(),p=i(),{reset:m}=r(),{_:h}=e(),g=t();if(p.name!==`error`)return null;let _=f.settlement,v=_.status===`ready`&&_.payload.kind===`failed`?_.payload:void 0,y=p.ctx.failure,b=h({id:`KTNWsg`,message:`Withdrawal failed`}),x=v?g(v.failureKind):y?.reason;if(!v)return c(a,{...d,headerTitle:b,headline:b,reason:x,onTryAgain:m,children:u??l(s,{children:[c(a.Header,{}),c(a.Body,{children:c(a.Hero,{})}),c(a.Actions,{})]})});let S=v,C={address:S.recipient.formatted},w=o(S.receiveAsset)??{symbol:S.receiveAsset.symbol},T=S.txHash?{hash:S.txHash.formatted,explorerUrl:S.txExplorerUrl}:void 0;return c(a,{...d,headerTitle:b,headline:b,reason:x,destination:C,receiveAmount:S.receiveAmount.formatted,receiveAsset:w,depositTx:T,submittedAt:S.submittedAt.formatted,failedAt:S.failedAt.formatted,onTryAgain:m,children:u??l(s,{children:[c(a.Header,{}),l(a.Body,{children:[c(a.Hero,{}),l(a.Details,{children:[c(a.FillStatusRow,{}),c(a.DestinationRow,{}),c(a.YouReceiveRow,{}),l(a.MoreDetails,{children:[T?c(a.DepositTxRow,{label:h({id:`60ahSE`,message:`Withdrawal tx`})}):null,c(a.SubmittedAtRow,{}),c(a.FailedAtRow,{})]})]}),c(a.HelpInfo,{})]}),c(a.Actions,{})]})})}function d(t={}){let{_:n}=e();return c(a.DepositTxRow,{...t,label:t.label??n({id:`60ahSE`,message:`Withdrawal tx`})})}(function(e){e.Header=a.Header,e.Body=a.Body,e.Hero=a.Hero,e.Details=a.Details,e.FillStatusRow=a.FillStatusRow,e.SourceRow=a.SourceRow,e.DestinationRow=a.DestinationRow,e.YouReceiveRow=a.YouReceiveRow,e.MoreDetails=a.MoreDetails,e.DepositTxRow=d,e.SubmittedAtRow=a.SubmittedAtRow,e.FailedAtRow=a.FailedAtRow,e.HelpInfo=a.HelpInfo,e.Actions=a.Actions})(u||={});export{u as WithdrawError};
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
import { WithdrawFormAmountField } from "./compound/components/AmountField.js";
|
|
2
|
+
import { WithdrawFormBody } from "./compound/components/Body.js";
|
|
3
|
+
import { WithdrawFormBreakdownCard } from "./compound/components/BreakdownCard.js";
|
|
4
|
+
import { WithdrawFormFooter } from "./compound/components/Footer.js";
|
|
5
|
+
import { WithdrawFormHeader } from "./compound/components/Header.js";
|
|
6
|
+
import { WithdrawFormReceiveSelectors } from "./compound/components/ReceiveSelectors.js";
|
|
7
|
+
import { WithdrawFormRecipientField } from "./compound/components/RecipientField.js";
|
|
8
|
+
import { ReactNode } from "react";
|
|
1
9
|
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
10
|
|
|
3
11
|
//#region src/flows/withdraw/widgets/withdraw-form/WithdrawForm.d.ts
|
|
@@ -16,6 +24,26 @@ import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
|
16
24
|
* `withdraw.receive.token.changed`, `withdraw.receive.chain.changed`, `withdraw.submit.clicked`)
|
|
17
25
|
* flow through the unified event bus — the form takes no callback props.
|
|
18
26
|
*/
|
|
19
|
-
|
|
27
|
+
interface WithdrawFormOwnProps {
|
|
28
|
+
/**
|
|
29
|
+
* Optional custom composition. Defaults to `<Header />` + `<Body><RecipientField />
|
|
30
|
+
* <AmountField /><ReceiveSelectors /><BreakdownCard /></Body>` + `<Footer />`. Pass children
|
|
31
|
+
* to interleave your own elements between compound parts.
|
|
32
|
+
*/
|
|
33
|
+
children?: ReactNode;
|
|
34
|
+
}
|
|
35
|
+
declare function WithdrawForm({
|
|
36
|
+
children
|
|
37
|
+
}?: WithdrawFormOwnProps): _$react_jsx_runtime0.JSX.Element | null;
|
|
38
|
+
declare namespace WithdrawForm {
|
|
39
|
+
type Props = WithdrawFormOwnProps;
|
|
40
|
+
const Header: typeof WithdrawFormHeader;
|
|
41
|
+
const Body: typeof WithdrawFormBody;
|
|
42
|
+
const RecipientField: typeof WithdrawFormRecipientField;
|
|
43
|
+
const AmountField: typeof WithdrawFormAmountField;
|
|
44
|
+
const ReceiveSelectors: typeof WithdrawFormReceiveSelectors;
|
|
45
|
+
const BreakdownCard: typeof WithdrawFormBreakdownCard;
|
|
46
|
+
const Footer: typeof WithdrawFormFooter;
|
|
47
|
+
}
|
|
20
48
|
//#endregion
|
|
21
49
|
export { WithdrawForm };
|