@stridge/kit 0.1.0-alpha.43 → 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/deposit/compound/index.d.ts +2 -1
- 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 +32 -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/compound/components/Steps.d.ts +24 -0
- package/dist/flows/deposit/widgets/deposit/compound/components/Steps.js +1 -0
- package/dist/flows/deposit/widgets/deposit/compound/index.d.ts +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 +60 -0
- package/dist/flows/withdraw/widgets/withdraw/compound/Withdraw.js +1 -0
- package/dist/flows/withdraw/widgets/withdraw/compound/Withdraw.slots.d.ts +13 -0
- package/dist/flows/withdraw/widgets/withdraw/compound/Withdraw.slots.js +1 -0
- 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/compound/components/Steps.d.ts +27 -0
- package/dist/flows/withdraw/widgets/withdraw/compound/components/Steps.js +1 -0
- package/dist/flows/withdraw/widgets/withdraw/compound/index.d.ts +3 -0
- package/dist/flows/withdraw/widgets/withdraw/compound/index.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/ui/Steps/Steps.d.ts +52 -0
- package/dist/shared/ui/Steps/Steps.js +1 -0
- package/dist/shared/ui/Steps/Steps.slots.d.ts +7 -0
- package/dist/shared/ui/Steps/Steps.slots.js +1 -0
- package/dist/shared/ui/Steps/Steps.styles.js +1 -0
- package/dist/shared/ui/Steps/index.d.ts +2 -0
- package/dist/shared/ui/Steps/index.js +1 -0
- 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 +8 -0
- package/dist/ui/index.d.ts +3 -1
- package/dist/ui/index.js +1 -1
- package/dist/withdraw/compound/index.d.ts +4 -1
- package/dist/withdraw/compound/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
import { DepositStatusBannerBody } from "./compound/components/Body.js";
|
|
2
|
+
import { DepositStatusBannerClose } from "./compound/components/Close.js";
|
|
3
|
+
import { DepositStatusBannerDetails } from "./compound/components/Details.js";
|
|
4
|
+
import { DepositStatusBannerFooter } from "./compound/components/Footer.js";
|
|
5
|
+
import { DepositStatusBannerHero } from "./compound/components/Hero.js";
|
|
6
|
+
import { DepositStatusBannerPrimaryAction } from "./compound/components/PrimaryAction.js";
|
|
7
|
+
import { DepositStatusBannerCompletionTxRow, DepositStatusBannerDepositTxRow, DepositStatusBannerFilledAtRow, DepositStatusBannerSubmittedAtRow } from "./compound/components/Rows.js";
|
|
8
|
+
import { DepositStatusBannerToggle } from "./compound/components/Toggle.js";
|
|
9
|
+
import { ReactNode } from "react";
|
|
1
10
|
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
11
|
|
|
3
12
|
//#region src/flows/deposit/widgets/deposit-status-banner/DepositStatusBanner.d.ts
|
|
@@ -22,6 +31,30 @@ import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
|
22
31
|
* still carries the terminal payload. `processing` is deliberately NOT auto-acked — an
|
|
23
32
|
* in-flight deposit should still re-surface its banner on reopen.
|
|
24
33
|
*/
|
|
25
|
-
|
|
34
|
+
interface DepositStatusBannerProps {
|
|
35
|
+
/**
|
|
36
|
+
* Optional custom composition rendered inside the banner shell. Defaults to `<Body><Hero />
|
|
37
|
+
* <Close /></Body>` + `<Details>…tx rows…</Details>` + `<Footer><Toggle /><PrimaryAction />
|
|
38
|
+
* </Footer>`. Pass children to interleave your own elements between parts.
|
|
39
|
+
*/
|
|
40
|
+
children?: ReactNode;
|
|
41
|
+
}
|
|
42
|
+
declare function DepositStatusBanner({
|
|
43
|
+
children
|
|
44
|
+
}?: DepositStatusBannerProps): _$react_jsx_runtime0.JSX.Element;
|
|
45
|
+
declare namespace DepositStatusBanner {
|
|
46
|
+
type Props = DepositStatusBannerProps;
|
|
47
|
+
const Body: typeof DepositStatusBannerBody;
|
|
48
|
+
const Hero: typeof DepositStatusBannerHero;
|
|
49
|
+
const Close: typeof DepositStatusBannerClose;
|
|
50
|
+
const Details: typeof DepositStatusBannerDetails;
|
|
51
|
+
const DepositTxRow: typeof DepositStatusBannerDepositTxRow;
|
|
52
|
+
const CompletionTxRow: typeof DepositStatusBannerCompletionTxRow;
|
|
53
|
+
const SubmittedAtRow: typeof DepositStatusBannerSubmittedAtRow;
|
|
54
|
+
const FilledAtRow: typeof DepositStatusBannerFilledAtRow;
|
|
55
|
+
const Footer: typeof DepositStatusBannerFooter;
|
|
56
|
+
const Toggle: typeof DepositStatusBannerToggle;
|
|
57
|
+
const PrimaryAction: typeof DepositStatusBannerPrimaryAction;
|
|
58
|
+
}
|
|
26
59
|
//#endregion
|
|
27
60
|
export { DepositStatusBanner };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{bucketFromSettlement as e,useBannerAckForSettlement as t}from"../../../../banners/useBannerAck.js";import"../../../../banners/index.js";import{useDepositSnapshot as n}from"../../driver/context.js";import{useLingui as r}from"../../../../shared/i18n/useLingui.js";import"../../../../i18n/index.js";import{useDepositActions as i,useDepositState as a}from"../../orchestrator/controller.js";import{stepRendersSettlement as o}from"../../orchestrator/steps.js";import{DepositStatusBanner as s}from"./compound/DepositStatusBanner.js";import"./compound/index.js";import{useEffect as c,useState as l}from"react";import{
|
|
1
|
+
"use client";import{bucketFromSettlement as e,useBannerAckForSettlement as t}from"../../../../banners/useBannerAck.js";import"../../../../banners/index.js";import{useDepositSnapshot as n}from"../../driver/context.js";import{useLingui as r}from"../../../../shared/i18n/useLingui.js";import"../../../../i18n/index.js";import{useDepositActions as i,useDepositState as a}from"../../orchestrator/controller.js";import{stepRendersSettlement as o}from"../../orchestrator/steps.js";import{DepositStatusBanner as s}from"./compound/DepositStatusBanner.js";import"./compound/index.js";import{useEffect as c,useState as l}from"react";import{Fragment as u,jsx as d,jsxs as f}from"react/jsx-runtime";import{AnimatePresence as p}from"motion/react";function m({children:s}={}){let l=n(),u=a().name,{resumeToProcessing:f,resumeToSuccess:m,resumeToError:g}=i(),{_:v}=r(),y=l.settlement,b=y.status===`ready`||y.status===`stale`?y.payload:void 0,{acked:x,ack:S}=t(b),C=(u===`success`||u===`error`)&&e(b)?.bucket===`terminal`;c(()=>{C&&!x&&S()},[C,x,S]);let w=b!==void 0&&!x&&!o(u);function T(e){return()=>{S(),e()}}return d(p,{children:w&&b?d(h,{payload:b,brandName:l.brand.status===`ready`||l.brand.status===`stale`?l.brand.payload.name:void 0,onDismiss:S,onResumeToProcessing:()=>f(`wallet`,_(b)),onResumeToSuccess:T(()=>m(`wallet`,_(b))),onResumeToError:T(()=>g(_(b))),labels:{completed:v({id:`3kg1gB`,message:`Deposit completed`}),didntComplete:v({id:`Rxjdjn`,message:`Deposit didn't complete`}),receivedProcessing:v({id:`junZX6`,message:`Deposit received and processing…`}),creditedToBrand:e=>v({id:`IRogzB`,message:`Your deposit has been credited to {brand}.`,values:{brand:e}}),creditedToAccount:v({id:`9JHY2T`,message:`Your deposit has been credited to your account.`}),fundsSafe:v({id:`Z1WbO6`,message:`Funds are safe on the source chain — contact support to recover.`}),willBeCreditedToBrand:e=>v({id:`TG4WOd`,message:`Your deposit will be credited to {brand}.`,values:{brand:e}}),willBeCreditedToAccount:v({id:`Offl0a`,message:`Your deposit will be credited to your account.`})},children:s},`banner`):null})}function h({payload:e,brandName:t,onDismiss:n,onResumeToProcessing:r,onResumeToSuccess:i,onResumeToError:a,labels:o,children:c}){let[p,m]=l(!1),h=()=>m(e=>!e),_=e.kind,v={symbol:e.creditedAsset.symbol,...e.creditedAsset.address?{address:e.creditedAsset.address}:{},...e.creditedAsset.isNative===void 0?{}:{isNative:e.creditedAsset.isNative},...e.creditedAsset.assetLogoUrl?{logoUrl:e.creditedAsset.assetLogoUrl}:{}},y=_===`succeeded`?o.completed:_===`failed`?o.didntComplete:o.receivedProcessing,b=_===`succeeded`?t?o.creditedToBrand(t):o.creditedToAccount:_===`failed`?o.fundsSafe:t?o.willBeCreditedToBrand(t):o.willBeCreditedToAccount,x=g(e),S=e.kind===`succeeded`&&e.completionTx?{hash:e.completionTx.hash.formatted,...e.completionTx.explorerUrl?{explorerUrl:e.completionTx.explorerUrl}:{}}:void 0,C=e.kind===`succeeded`||e.kind===`failed`?e.submittedAt.formatted:void 0,w=e.kind===`succeeded`?e.filledAt.formatted:void 0,T=_===`succeeded`?i:_===`failed`?a:r;return d(s,{kind:_,asset:v,headline:y,subline:b,expanded:p,onToggleExpanded:h,onDismiss:n,...x?{depositTx:x}:{},...S?{completionTx:S}:{},...C===void 0?{}:{submittedAt:C},...w===void 0?{}:{filledAt:w},onPrimaryAction:T,children:c??f(u,{children:[f(s.Body,{children:[d(s.Hero,{}),d(s.Close,{})]}),f(s.Details,{children:[d(s.DepositTxRow,{}),d(s.CompletionTxRow,{}),d(s.SubmittedAtRow,{}),d(s.FilledAtRow,{})]}),f(s.Footer,{children:[d(s.Toggle,{}),d(s.PrimaryAction,{})]})]})})}function g(e){if(e.kind===`succeeded`)return{hash:e.depositTx.hash.formatted,...e.depositTx.explorerUrl?{explorerUrl:e.depositTx.explorerUrl}:{}};if(e.kind===`failed`||e.txHash)return{hash:e.txHash.formatted,...e.txExplorerUrl?{explorerUrl:e.txExplorerUrl}:{}}}function _(e){return e.kind===`succeeded`?{hash:e.depositTx.hash.value,...e.depositTx.explorerUrl?{explorerUrl:e.depositTx.explorerUrl}:{}}:e.kind===`failed`?{hash:e.txHash.value,...e.txExplorerUrl?{explorerUrl:e.txExplorerUrl}:{}}:{hash:e.txHash?.value??``,...e.txExplorerUrl?{explorerUrl:e.txExplorerUrl}:{}}}(function(e){e.Body=s.Body,e.Hero=s.Hero,e.Close=s.Close,e.Details=s.Details,e.DepositTxRow=s.DepositTxRow,e.CompletionTxRow=s.CompletionTxRow,e.SubmittedAtRow=s.SubmittedAtRow,e.FilledAtRow=s.FilledAtRow,e.Footer=s.Footer,e.Toggle=s.Toggle,e.PrimaryAction=s.PrimaryAction})(m||={});export{m as DepositStatusBanner};
|
|
@@ -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};
|
|
@@ -0,0 +1,60 @@
|
|
|
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";
|
|
4
|
+
import { WithdrawSteps, WithdrawStepsProps } from "./components/Steps.js";
|
|
5
|
+
import { ReactNode } from "react";
|
|
6
|
+
|
|
7
|
+
//#region src/flows/withdraw/widgets/withdraw/compound/Withdraw.d.ts
|
|
8
|
+
interface WithdrawStepProps {
|
|
9
|
+
/**
|
|
10
|
+
* Matches against the withdraw FSM's effective state name (with `submitting` collapsed
|
|
11
|
+
* to `form`). Declaring `name="submitting"` never matches — use `name="form"` and the
|
|
12
|
+
* widget stays mounted across both states.
|
|
13
|
+
*/
|
|
14
|
+
name: WithdrawStateName;
|
|
15
|
+
children: ReactNode;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Top-level `Withdraw` compound namespace. Today exposes the slot-routing primitives that
|
|
19
|
+
* let hosts compose multi-screen withdraw flows; the namespace exists at this position so
|
|
20
|
+
* future `Withdraw.*` parts (Header, Body, …) can extend it without churning the import path.
|
|
21
|
+
*
|
|
22
|
+
* Hosts wire it like the deposit equivalent:
|
|
23
|
+
*
|
|
24
|
+
* ```tsx
|
|
25
|
+
* <Withdraw.Steps>
|
|
26
|
+
* <Withdraw.Step name="form"><WithdrawForm /></Withdraw.Step>
|
|
27
|
+
* <Withdraw.Step name="inProgress"><WithdrawInProgress /></Withdraw.Step>
|
|
28
|
+
* <Withdraw.Step name="success"><WithdrawSuccess /></Withdraw.Step>
|
|
29
|
+
* <Withdraw.Step name="error"><WithdrawError /></Withdraw.Step>
|
|
30
|
+
* </Withdraw.Steps>
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
* Rendered directly (`<Withdraw />`) the component is a no-op — reach into the sub-parts.
|
|
34
|
+
*/
|
|
35
|
+
declare function Withdraw(): null;
|
|
36
|
+
declare namespace Withdraw {
|
|
37
|
+
type StepsProps = WithdrawStepsProps;
|
|
38
|
+
type StepProps = WithdrawStepProps;
|
|
39
|
+
type GuardsProps = Props$1;
|
|
40
|
+
type BoundaryProps = Props;
|
|
41
|
+
const Steps: typeof WithdrawSteps;
|
|
42
|
+
/**
|
|
43
|
+
* Slot consumed by {@link Withdraw.Steps}. `name` is the FSM state to match; the matched
|
|
44
|
+
* step's `children` are rendered, every other branch is dropped.
|
|
45
|
+
*/
|
|
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;
|
|
58
|
+
}
|
|
59
|
+
//#endregion
|
|
60
|
+
export { Withdraw };
|
|
@@ -0,0 +1 @@
|
|
|
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,13 @@
|
|
|
1
|
+
//#region src/flows/withdraw/widgets/withdraw/compound/Withdraw.slots.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* `<Withdraw.*>` slot vocabulary. Today the namespace only houses `Withdraw.Steps` /
|
|
4
|
+
* `Withdraw.Step`, both of which route their slot attribute through the shared `Steps`
|
|
5
|
+
* primitive. The constant exists so future `Withdraw.*` parts (Header, Body, …) have a
|
|
6
|
+
* canonical slot map ready when they land.
|
|
7
|
+
*/
|
|
8
|
+
declare const WITHDRAW_SLOTS: {
|
|
9
|
+
readonly root: "withdraw-root";
|
|
10
|
+
};
|
|
11
|
+
type WithdrawSlot = (typeof WITHDRAW_SLOTS)[keyof typeof WITHDRAW_SLOTS];
|
|
12
|
+
//#endregion
|
|
13
|
+
export { WITHDRAW_SLOTS, WithdrawSlot };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e={root:`withdraw-root`};export{e as WITHDRAW_SLOTS};
|
|
@@ -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};
|
|
@@ -0,0 +1,27 @@
|
|
|
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/Steps.d.ts
|
|
5
|
+
interface WithdrawStepsProps {
|
|
6
|
+
/**
|
|
7
|
+
* When true, the matched step renders without the kit's animated `StepTransition` wrapper.
|
|
8
|
+
* Forwarded to the underlying `Steps` primitive.
|
|
9
|
+
*/
|
|
10
|
+
plain?: boolean;
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Withdraw-bound slot-routing parent. Reads the withdraw FSM's *effective* state name and
|
|
15
|
+
* renders only the matching `<Withdraw.Step name="…" />` child.
|
|
16
|
+
*
|
|
17
|
+
* Collapses `submitting → form` so the form widget stays mounted (and its slide animation
|
|
18
|
+
* does not re-trigger) while the host's `onSubmit` is in flight. Hosts therefore declare a
|
|
19
|
+
* single `<Withdraw.Step name="form">` to cover both the idle form and the post-submit
|
|
20
|
+
* pending state — declaring `name="submitting"` separately never matches.
|
|
21
|
+
*/
|
|
22
|
+
declare function WithdrawSteps({
|
|
23
|
+
plain,
|
|
24
|
+
children
|
|
25
|
+
}: WithdrawStepsProps): _$react_jsx_runtime0.JSX.Element;
|
|
26
|
+
//#endregion
|
|
27
|
+
export { WithdrawSteps, type WithdrawStepsProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{useWithdrawEffectiveState as e}from"../../../../orchestrator/controller.js";import"../../../../orchestrator/index.js";import{Steps as t}from"../../../../../../shared/ui/Steps/Steps.js";import"../../../../../../shared/ui/Steps/index.js";import{jsx as n}from"react/jsx-runtime";function r({plain:r,children:i}){let a=e();return n(t,{activeStep:a.name===`submitting`?`form`:a.name,...r===void 0?{}:{plain:r},children:i})}export{r as WithdrawSteps};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./Withdraw.js";import"./Withdraw.slots.js";
|