@stridge/kit 0.1.0-alpha.50 → 0.1.0-alpha.52
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/KitProvider.d.ts +11 -0
- package/dist/KitProvider.js +1 -1
- package/dist/_internal/activity/driver/index.d.ts +3 -0
- package/dist/_internal/activity/driver/index.js +1 -0
- package/dist/_internal/drivers/stridge/index.d.ts +2 -1
- package/dist/_internal/drivers/stridge/index.js +1 -1
- package/dist/_internal/drivers/stridge-mock/index.d.ts +2 -1
- package/dist/_internal/drivers/stridge-mock/index.js +1 -1
- package/dist/activity/compound/index.d.ts +19 -0
- package/dist/activity/compound/index.js +1 -0
- package/dist/activity/dialog/index.d.ts +3 -0
- package/dist/activity/dialog/index.js +1 -0
- package/dist/activity/widgets/index.d.ts +4 -0
- package/dist/activity/widgets/index.js +1 -0
- package/dist/deposit/compound/index.d.ts +9 -9
- package/dist/deposit/widgets/index.d.ts +13 -0
- package/dist/deposit/widgets/index.js +1 -0
- package/dist/drivers/stridge/createStridgeActivityDriver.d.ts +44 -0
- package/dist/drivers/stridge/createStridgeActivityDriver.js +1 -0
- package/dist/drivers/stridge/createStridgeDepositDriver.js +1 -1
- package/dist/drivers/stridge/createStridgeWithdrawDriver.js +1 -1
- package/dist/drivers/stridge-mock/createStridgeMockActivityDriver.d.ts +44 -0
- package/dist/drivers/stridge-mock/createStridgeMockActivityDriver.js +1 -0
- package/dist/drivers/stridge-mock/createStridgeMockDriver.d.ts +0 -2
- package/dist/drivers/stridge-mock/createStridgeMockDriver.js +1 -1
- package/dist/drivers/stridge-mock/createStridgeMockWithdrawDriver.d.ts +1 -2
- package/dist/drivers/stridge-mock/createStridgeMockWithdrawDriver.js +1 -1
- package/dist/drivers/stridge-mock/fixtures.js +1 -1
- package/dist/flows/activity/compound/ActivityFlow.d.ts +46 -0
- package/dist/flows/activity/compound/ActivityFlow.js +1 -0
- package/dist/flows/activity/compound/components/Boundary.d.ts +29 -0
- package/dist/flows/activity/compound/components/Boundary.js +1 -0
- package/dist/flows/activity/compound/components/Steps.d.ts +24 -0
- package/dist/flows/activity/compound/components/Steps.js +1 -0
- package/dist/flows/activity/dialog/ActivityDialog.d.ts +38 -0
- package/dist/flows/activity/dialog/ActivityDialog.js +1 -0
- package/dist/flows/activity/dialog/ActivityFlowBoundary.d.ts +1 -0
- package/dist/flows/activity/dialog/ActivityFlowBoundary.js +1 -0
- package/dist/flows/activity/driver/context.d.ts +38 -0
- package/dist/flows/activity/driver/context.js +1 -0
- package/dist/flows/activity/driver/types.d.ts +58 -0
- package/dist/flows/activity/orchestrator/controller.d.ts +11 -0
- package/dist/flows/activity/orchestrator/controller.js +1 -0
- package/dist/flows/activity/orchestrator/index.d.ts +4 -0
- package/dist/flows/activity/orchestrator/index.js +1 -0
- package/dist/flows/activity/orchestrator/reducer.d.ts +1 -0
- package/dist/flows/activity/orchestrator/reducer.js +1 -0
- package/dist/flows/activity/orchestrator/types.d.ts +71 -0
- package/dist/flows/activity/orchestrator/useActivity.d.ts +94 -0
- package/dist/flows/activity/orchestrator/useActivity.js +1 -0
- package/dist/flows/activity/widgets/ActivityDetail.d.ts +41 -0
- package/dist/flows/activity/widgets/ActivityDetail.js +1 -0
- package/dist/flows/activity/widgets/ActivityList.d.ts +38 -0
- package/dist/flows/activity/widgets/ActivityList.js +1 -0
- package/dist/flows/activity/widgets/useStandaloneActivitySource.js +1 -0
- package/dist/flows/deposit/dialog/DepositBootstrapErrorState.js +1 -1
- package/dist/flows/deposit/dialog/DepositDialog.js +1 -1
- package/dist/flows/deposit/driver/transformers/settlementToPayload.js +1 -1
- package/dist/flows/deposit/driver/types.d.ts +1 -38
- package/dist/flows/deposit/orchestrator/controller.js +1 -1
- package/dist/flows/deposit/orchestrator/reducer.js +1 -1
- package/dist/flows/deposit/orchestrator/types.d.ts +43 -29
- package/dist/flows/deposit/widgets/{activity-history/DepositHistoryDetail.d.ts → activity/DepositActivityDetail.d.ts} +11 -11
- package/dist/flows/deposit/widgets/activity/DepositActivityDetail.js +1 -0
- package/dist/flows/deposit/widgets/activity/DepositActivityList.d.ts +38 -0
- package/dist/flows/deposit/widgets/activity/DepositActivityList.js +1 -0
- package/dist/flows/deposit/widgets/activity/index.d.ts +2 -0
- package/dist/flows/deposit/widgets/activity/index.js +1 -0
- package/dist/flows/deposit/widgets/activity/useDepositActivitySource.js +1 -0
- package/dist/flows/deposit/widgets/amount-entry/AmountEntry.js +1 -1
- package/dist/flows/deposit/widgets/asset-picker/AssetPicker.js +1 -1
- package/dist/flows/deposit/widgets/confirm-deposit/ConfirmDeposit.js +1 -1
- package/dist/flows/deposit/widgets/deposit/Deposit.js +1 -1
- package/dist/flows/deposit/widgets/deposit/compound/components/Header.d.ts +7 -6
- package/dist/flows/deposit/widgets/deposit/compound/components/Header.js +1 -1
- package/dist/flows/deposit/widgets/deposit-status-banner/DepositStatusBanner.js +1 -1
- package/dist/flows/deposit/widgets/error-state/ErrorState.js +1 -1
- package/dist/flows/deposit/widgets/processing-state/ProcessingState.js +1 -1
- package/dist/flows/deposit/widgets/transfer-crypto/compound/components/Header.d.ts +4 -3
- package/dist/flows/deposit/widgets/transfer-crypto/compound/components/Header.js +1 -1
- package/dist/flows/withdraw/dialog/WithdrawDialog.js +1 -1
- package/dist/flows/withdraw/driver/types.d.ts +0 -34
- package/dist/flows/withdraw/orchestrator/controller.js +1 -1
- package/dist/flows/withdraw/orchestrator/reducer.js +1 -1
- package/dist/flows/withdraw/orchestrator/types.d.ts +44 -30
- package/dist/flows/withdraw/widgets/{activity-history/WithdrawHistoryDetail.d.ts → activity/WithdrawActivityDetail.d.ts} +11 -11
- package/dist/flows/withdraw/widgets/activity/WithdrawActivityDetail.js +1 -0
- package/dist/flows/withdraw/widgets/activity/WithdrawActivityList.d.ts +36 -0
- package/dist/flows/withdraw/widgets/activity/WithdrawActivityList.js +1 -0
- package/dist/flows/withdraw/widgets/activity/index.d.ts +2 -0
- package/dist/flows/withdraw/widgets/activity/index.js +1 -0
- package/dist/flows/withdraw/widgets/activity/useWithdrawActivitySource.js +1 -0
- package/dist/flows/withdraw/widgets/withdraw-form/compound/components/Body.d.ts +7 -6
- package/dist/flows/withdraw/widgets/withdraw-form/compound/components/Header.d.ts +4 -4
- package/dist/flows/withdraw/widgets/withdraw-form/compound/components/Header.js +1 -1
- package/dist/format/index.d.ts +2 -1
- package/dist/format/index.js +1 -1
- package/dist/i18n/locales/ar.js +1 -1
- package/dist/i18n/locales/es.js +1 -1
- package/dist/i18n/locales/source-keys.d.ts +1 -1
- package/dist/icons/index.d.ts +2 -2
- package/dist/icons/index.js +1 -1
- package/dist/index.d.ts +8 -2
- package/dist/index.js +1 -1
- package/dist/package.js +1 -1
- package/dist/shared/format/formatSmartRelative.d.ts +25 -0
- package/dist/shared/format/formatSmartRelative.js +1 -0
- package/dist/shared/format/formatUsd.js +1 -1
- package/dist/shared/icons/{HistoryIcon.d.ts → ActivityIcon.d.ts} +4 -4
- package/dist/shared/icons/{HistoryIcon.js → ActivityIcon.js} +1 -1
- package/dist/shared/orchestrator/activityOpenInput.d.ts +21 -0
- package/dist/shared/orchestrator/createActivityReducers.js +1 -0
- package/dist/shared/orchestrator/index.d.ts +2 -0
- package/dist/shared/orchestrator/index.js +1 -1
- package/dist/shared/orchestrator/resolveActivityEntry.d.ts +1 -0
- package/dist/shared/orchestrator/resolveActivityEntry.js +1 -0
- package/dist/shared/ui/Card/Card.d.ts +12 -9
- package/dist/shared/ui/Card/Card.js +1 -1
- package/dist/shared/ui/Card/Card.styles.js +1 -1
- package/dist/shared/ui/SelectableTile/SelectableTile.d.ts +1 -1
- package/dist/shared/widgets/activity/ActivityTrigger.js +1 -0
- package/dist/shared/widgets/{activity-history → activity}/ActivityTrigger.styles.js +1 -1
- package/dist/shared/widgets/activity/adapters/settlementToWidgetProps.js +1 -0
- package/dist/shared/widgets/activity/compound/Activity.d.ts +95 -0
- package/dist/shared/widgets/activity/compound/Activity.js +1 -0
- package/dist/shared/widgets/activity/compound/Activity.slots.d.ts +22 -0
- package/dist/shared/widgets/activity/compound/Activity.slots.js +1 -0
- package/dist/shared/widgets/activity/compound/Activity.styles.js +1 -0
- package/dist/shared/widgets/{activity-history/compound/ActivityHistoryDetail.d.ts → activity/compound/ActivityDetail.d.ts} +24 -17
- package/dist/shared/widgets/activity/compound/ActivityDetail.js +1 -0
- package/dist/shared/widgets/activity/compound/Row.slots.d.ts +21 -0
- package/dist/shared/widgets/activity/compound/Row.slots.js +1 -0
- package/dist/shared/widgets/activity/compound/Row.styles.js +1 -0
- package/dist/shared/widgets/{activity-history/compound/components/HistoryHeader.d.ts → activity/compound/components/ActivityHeader.d.ts} +8 -8
- package/dist/shared/widgets/activity/compound/components/ActivityHeader.js +1 -0
- package/dist/shared/widgets/{activity-history → activity}/compound/components/Empty.d.ts +3 -3
- package/dist/shared/widgets/activity/compound/components/Empty.js +1 -0
- package/dist/shared/widgets/{activity-history → activity}/compound/components/ErrorView.d.ts +7 -7
- package/dist/shared/widgets/activity/compound/components/ErrorView.js +1 -0
- package/dist/shared/widgets/activity/compound/components/List.d.ts +23 -0
- package/dist/shared/widgets/activity/compound/components/List.js +1 -0
- package/dist/shared/widgets/{activity-history → activity}/compound/components/Row.d.ts +13 -16
- package/dist/shared/widgets/activity/compound/components/Row.js +1 -0
- package/dist/shared/widgets/activity/compound/components/StatusPip.js +1 -0
- package/dist/shared/widgets/activity/compound/context.d.ts +95 -0
- package/dist/shared/widgets/activity/compound/context.js +1 -0
- package/dist/shared/widgets/activity/compound/index.d.ts +8 -0
- package/dist/shared/widgets/activity/compound/index.js +1 -0
- package/dist/shared/widgets/activity/payloads.d.ts +108 -0
- package/dist/shared/widgets/activity/transformers/activityResponseToPayload.js +1 -0
- package/dist/shared/widgets/amount-entry/compound/components/Header.d.ts +1 -1
- package/dist/shared/widgets/amount-entry/compound/types.d.ts +2 -3
- package/dist/shared/widgets/asset-picker/compound/components/Header.d.ts +1 -1
- package/dist/shared/widgets/asset-picker/compound/types.d.ts +2 -2
- package/dist/stridge/StridgeProvider.d.ts +10 -6
- package/dist/stridge/StridgeProvider.js +1 -1
- package/dist/stridge/stubs.js +1 -1
- package/dist/styles/index.css +4 -0
- package/dist/withdraw/compound/index.d.ts +6 -6
- package/dist/withdraw/widgets/index.d.ts +7 -0
- package/dist/withdraw/widgets/index.js +1 -0
- package/package.json +22 -6
- package/dist/_internal/deposit/widgets/index.d.ts +0 -13
- package/dist/_internal/deposit/widgets/index.js +0 -1
- package/dist/_internal/withdraw/widgets/index.d.ts +0 -7
- package/dist/_internal/withdraw/widgets/index.js +0 -1
- package/dist/activity-history/compound/index.d.ts +0 -9
- package/dist/activity-history/compound/index.js +0 -1
- package/dist/flows/deposit/widgets/activity-history/DepositHistoryDetail.js +0 -1
- package/dist/flows/deposit/widgets/activity-history/DepositHistoryList.d.ts +0 -38
- package/dist/flows/deposit/widgets/activity-history/DepositHistoryList.js +0 -1
- package/dist/flows/deposit/widgets/activity-history/index.d.ts +0 -2
- package/dist/flows/deposit/widgets/activity-history/index.js +0 -1
- package/dist/flows/deposit/widgets/activity-history/useDepositActivityHistorySource.js +0 -1
- package/dist/flows/withdraw/widgets/activity-history/WithdrawHistoryDetail.js +0 -1
- package/dist/flows/withdraw/widgets/activity-history/WithdrawHistoryList.d.ts +0 -36
- package/dist/flows/withdraw/widgets/activity-history/WithdrawHistoryList.js +0 -1
- package/dist/flows/withdraw/widgets/activity-history/index.d.ts +0 -2
- package/dist/flows/withdraw/widgets/activity-history/index.js +0 -1
- package/dist/flows/withdraw/widgets/activity-history/useWithdrawActivityHistorySource.js +0 -1
- package/dist/shared/widgets/activity-history/ActivityTrigger.js +0 -1
- package/dist/shared/widgets/activity-history/adapters/settlementToWidgetProps.js +0 -1
- package/dist/shared/widgets/activity-history/compound/ActivityHistory.d.ts +0 -95
- package/dist/shared/widgets/activity-history/compound/ActivityHistory.js +0 -1
- package/dist/shared/widgets/activity-history/compound/ActivityHistory.slots.d.ts +0 -22
- package/dist/shared/widgets/activity-history/compound/ActivityHistory.slots.js +0 -1
- package/dist/shared/widgets/activity-history/compound/ActivityHistory.styles.js +0 -1
- package/dist/shared/widgets/activity-history/compound/ActivityHistoryDetail.js +0 -1
- package/dist/shared/widgets/activity-history/compound/Row.slots.d.ts +0 -21
- package/dist/shared/widgets/activity-history/compound/Row.slots.js +0 -1
- package/dist/shared/widgets/activity-history/compound/Row.styles.js +0 -1
- package/dist/shared/widgets/activity-history/compound/components/Empty.js +0 -1
- package/dist/shared/widgets/activity-history/compound/components/ErrorView.js +0 -1
- package/dist/shared/widgets/activity-history/compound/components/HistoryHeader.js +0 -1
- package/dist/shared/widgets/activity-history/compound/components/List.d.ts +0 -23
- package/dist/shared/widgets/activity-history/compound/components/List.js +0 -1
- package/dist/shared/widgets/activity-history/compound/components/Row.js +0 -1
- package/dist/shared/widgets/activity-history/compound/components/StatusPip.js +0 -1
- package/dist/shared/widgets/activity-history/compound/context.d.ts +0 -79
- package/dist/shared/widgets/activity-history/compound/context.js +0 -1
- package/dist/shared/widgets/activity-history/payloads.d.ts +0 -81
- package/dist/shared/widgets/activity-history/transformers/historyResponseToPayload.js +0 -1
- /package/dist/shared/widgets/{activity-history → activity}/index.js +0 -0
- /package/dist/shared/widgets/{activity-history → activity}/transformers/resolveDirection.js +0 -0
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
//#region src/shared/widgets/activity-history/compound/Row.slots.d.ts
|
|
2
|
-
/**
|
|
3
|
-
* Slot vocabulary for `<ActivityHistory.Row>`. Same `data-stridge-slot` convention as the parent
|
|
4
|
-
* compound — see {@link import("./ActivityHistory.slots").ACTIVITY_HISTORY_SLOTS}. Kept in its
|
|
5
|
-
* own file so the Row primitive stays a self-contained unit (matches the
|
|
6
|
-
* `<PrimitiveName>.slots.ts` convention used across `packages/kit/src/shared/ui/`).
|
|
7
|
-
*/
|
|
8
|
-
declare const ACTIVITY_HISTORY_ROW_SLOTS: {
|
|
9
|
-
readonly root: "activity-history-row";
|
|
10
|
-
readonly leading: "activity-history-row-leading";
|
|
11
|
-
readonly statusPip: "activity-history-row-status-pip";
|
|
12
|
-
readonly text: "activity-history-row-text";
|
|
13
|
-
readonly title: "activity-history-row-title";
|
|
14
|
-
readonly date: "activity-history-row-date";
|
|
15
|
-
readonly trailing: "activity-history-row-trailing";
|
|
16
|
-
readonly amount: "activity-history-row-amount";
|
|
17
|
-
readonly chevron: "activity-history-row-chevron";
|
|
18
|
-
};
|
|
19
|
-
type ActivityHistoryRowSlot = (typeof ACTIVITY_HISTORY_ROW_SLOTS)[keyof typeof ACTIVITY_HISTORY_ROW_SLOTS];
|
|
20
|
-
//#endregion
|
|
21
|
-
export { ACTIVITY_HISTORY_ROW_SLOTS, ActivityHistoryRowSlot };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e={root:`activity-history-row`,leading:`activity-history-row-leading`,statusPip:`activity-history-row-status-pip`,text:`activity-history-row-text`,title:`activity-history-row-title`,date:`activity-history-row-date`,trailing:`activity-history-row-trailing`,amount:`activity-history-row-amount`,chevron:`activity-history-row-chevron`};export{e as ACTIVITY_HISTORY_ROW_SLOTS};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e={rowLayout:{"Row__styles.rowLayout":`Row__styles.rowLayout`,"gap-kOIVth":`x2blr79`,"paddingBlock-k8WAf4":`x1yowcxs`,"paddingInlineStart-kZCmMZ":`xiplbrm`,"paddingInlineEnd-kwRFfy":`xvkiva6`,$$css:`@stridge/kit:src/shared/widgets/activity-history/compound/Row.styles.ts:35`},leading:{"Row__styles.leading":`Row__styles.leading`,"position-kVAEAm":`x1n2onr6`,"flexShrink-kmuXW":`x2lah0s`,"width-kzqmXN":`x187nhsf`,"height-kZKoxP":`xn3w4p2`,"overflow-kVQacm":`x1rea2x4`,$$css:`@stridge/kit:src/shared/widgets/activity-history/compound/Row.styles.ts:44`},statusPip:{"Row__styles.statusPip":`Row__styles.statusPip`,"position-kVAEAm":`x10l6tqk`,"zIndex-kY2c9j":`x1vjfegm`,"bottom-krVfgx":`x1t1qrwb`,"insetInlineEnd-kt4wiu":`x1d0qlrl`,"width-kzqmXN":`x1xp8n7a`,"height-kZKoxP":`xmix8c7`,"display-k1xSpc":`x78zum5`,"alignItems-kGNEyG":`x6s0dn4`,"justifyContent-kjj79g":`xl56j7k`,"borderRadius-kaIpWk":`x1e6avla`,"borderWidth-kMzoRj":`xdh2fpr`,"borderStyle-ksu8eU":`x1y0btm7`,"borderColor-kVAM5u":`xv87bwv`,"pointerEvents-kfzvcC":`x47corl`,$$css:`@stridge/kit:src/shared/widgets/activity-history/compound/Row.styles.ts:59`},statusPipCompleted:{"Row__styles.statusPipCompleted":`Row__styles.statusPipCompleted`,"backgroundColor-kWkggS":`xelfwhf`,"color-kMwMTN":`x1e8cn3g`,$$css:`@stridge/kit:src/shared/widgets/activity-history/compound/Row.styles.ts:88`},statusPipFailed:{"Row__styles.statusPipFailed":`Row__styles.statusPipFailed`,"backgroundColor-kWkggS":`x1qvyn6m`,"color-kMwMTN":`x18o46el`,$$css:`@stridge/kit:src/shared/widgets/activity-history/compound/Row.styles.ts:92`},statusPipPending:{"Row__styles.statusPipPending":`Row__styles.statusPipPending`,"backgroundColor-kWkggS":`x1qkydf4`,"color-kMwMTN":`xi96bwj`,$$css:`@stridge/kit:src/shared/widgets/activity-history/compound/Row.styles.ts:96`},statusPipIcon:{"Row__styles.statusPipIcon":`Row__styles.statusPipIcon`,"width-kzqmXN":`x1fsd2vl`,"height-kZKoxP":`x170jfvy`,"strokeWidth-kfJifR":`x1ip4yf`,$$css:`@stridge/kit:src/shared/widgets/activity-history/compound/Row.styles.ts:100`},statusPipSpinner:{"Row__styles.statusPipSpinner":`Row__styles.statusPipSpinner`,"width-kzqmXN":`x1fsd2vl`,"height-kZKoxP":`x170jfvy`,"animationName-kKVMdj":`x1aerksh`,"animationDuration-k44tkh":`x1q3qbx4`,"animationTimingFunction-kyAemX":`x1esw782`,"animationIterationCount-ko0y90":`xa4qsjk`,$$css:`@stridge/kit:src/shared/widgets/activity-history/compound/Row.styles.ts:105`},text:{"Row__styles.text":`Row__styles.text`,"display-k1xSpc":`x78zum5`,"flexDirection-kXwgrk":`xdt5ytf`,"flexBasis-kCS8Yb":`x1r8uery`,"flexGrow-kzQI83":`x1iyjqo2`,"flexShrink-kmuXW":`xs83m0k`,"gap-kOIVth":`x1r05nms`,"minWidth-k7Eaqz":`xeuugli`,$$css:`@stridge/kit:src/shared/widgets/activity-history/compound/Row.styles.ts:123`},title:{"Row__styles.title":`Row__styles.title`,"overflow-kVQacm":`xb3r6kr`,"textOverflow-kg5iWk":`xlyipyv`,"whiteSpace-khDVqt":`xuxw1ft`,$$css:`@stridge/kit:src/shared/widgets/activity-history/compound/Row.styles.ts:132`},date:{"Row__styles.date":`Row__styles.date`,"overflow-kVQacm":`xb3r6kr`,"textOverflow-kg5iWk":`xlyipyv`,"whiteSpace-khDVqt":`xuxw1ft`,$$css:`@stridge/kit:src/shared/widgets/activity-history/compound/Row.styles.ts:137`},trailing:{"Row__styles.trailing":`Row__styles.trailing`,"display-k1xSpc":`x78zum5`,"alignItems-kGNEyG":`x6s0dn4`,"flexShrink-kmuXW":`x2lah0s`,"gap-kOIVth":`x1a6yh9e`,$$css:`@stridge/kit:src/shared/widgets/activity-history/compound/Row.styles.ts:144`},chevron:{"Row__styles.chevron":`Row__styles.chevron`,"width-kzqmXN":`xsmyaan`,"height-kZKoxP":`x1kpxq89`,"flexShrink-kmuXW":`x2lah0s`,"color-kMwMTN":`x137ha3m`,"strokeWidth-kfJifR":`xvlca1e`,$$css:`@stridge/kit:src/shared/widgets/activity-history/compound/Row.styles.ts:150`}};export{e as styles};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";import{useLingui as e}from"../../../../i18n/useLingui.js";import"../../../../../i18n/index.js";import{ClockIcon as t}from"../../../../icons/ClockIcon.js";import"../../../../../icons/index.js";import{text as n}from"../../../../ui/Text/Text.js";import"../../../../ui/Text/index.js";import{ACTIVITY_HISTORY_SLOTS as r}from"../ActivityHistory.slots.js";import{styles as i}from"../ActivityHistory.styles.js";import{jsx as a,jsxs as o}from"react/jsx-runtime";import*as s from"@stylexjs/stylex";function c(){let{_:c}=e();return o(`div`,{"data-stridge-slot":r.empty,...s.props(i.empty),children:[a(t,{"aria-hidden":!0,"data-stridge-slot":r.emptyIcon,...s.props(i.emptyIcon)}),a(n.span,{size:`base`,fontWeight:`semibold`,color:`default`,children:c({id:`aXFOuf`,message:`No activity yet`})}),a(n.span,{size:`sm`,fontWeight:`medium`,color:`subdued`,children:c({id:`Xzw7uC`,message:`Your deposits and withdrawals will appear here.`})})]})}export{c as ActivityHistoryEmpty};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";import{useLingui as e}from"../../../../i18n/useLingui.js";import"../../../../../i18n/index.js";import{AlertIcon as t}from"../../../../icons/AlertIcon.js";import"../../../../../icons/index.js";import{Button as n}from"../../../../ui/Button/Button.js";import"../../../../ui/Button/index.js";import{Alert as r}from"../../../../ui/Alert/Alert.js";import"../../../../ui/Alert/index.js";import{ACTIVITY_HISTORY_SLOTS as i}from"../ActivityHistory.slots.js";import{styles as a}from"../ActivityHistory.styles.js";import{jsx as o,jsxs as s}from"react/jsx-runtime";import*as c from"@stylexjs/stylex";function l({onRetry:l}){let{_:u}=e();return s(`div`,{"data-stridge-slot":i.error,...c.props(a.error),children:[o(r,{variant:`danger`,icon:o(t,{}),children:u({id:`B-4zEC`,message:`Couldn't load activity. Please try again.`})}),o(`div`,{...c.props(a.retryRow),children:o(n,{type:`button`,variant:`secondary`,size:`sm`,onClick:l,"data-stridge-slot":i.retry,children:u({id:`KDw4GX`,message:`Try again`})})})]})}export{l as ActivityHistoryErrorView};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";import{useLingui as e}from"../../../../i18n/useLingui.js";import"../../../../../i18n/index.js";import{ChevronLeftIcon as t}from"../../../../icons/ChevronLeftIcon.js";import"../../../../../icons/index.js";import{IconButton as n}from"../../../../ui/IconButton/IconButton.js";import"../../../../ui/IconButton/index.js";import{Dialog as r}from"../../../../ui/Dialog/Dialog.js";import"../../../../ui/Dialog/index.js";import{Card as i}from"../../../../ui/Card/Card.js";import"../../../../ui/Card/index.js";import{text as a}from"../../../../ui/Text/Text.js";import"../../../../ui/Text/index.js";import{ACTIVITY_HISTORY_SLOTS as o}from"../ActivityHistory.slots.js";import{styles as s}from"../ActivityHistory.styles.js";import{useActivityHistorySource as c}from"../context.js";import{jsx as l,jsxs as u}from"react/jsx-runtime";import*as d from"@stylexjs/stylex";function f({title:c,onBack:f}){let{_:p}=e(),m=c??p({id:`XJOV1Y`,message:`Activity`});return u(i.Header,{"data-stridge-slot":o.header,...d.props(s.header),children:[u(`div`,{...d.props(s.headerLeft),children:[typeof f==`function`?l(n,{"aria-label":p({id:`iH8pgl`,message:`Back`}),onClick:f,children:l(t,{"aria-hidden":!0,...d.props(s.backIcon)})}):null,l(a.span,{size:`base`,fontWeight:`semibold`,leading:`tight`,tracking:`tight`,style:{margin:0},children:m})]}),l(`div`,{...d.props(s.headerRight),children:l(r.CloseButton,{})})]})}function p(){return l(f,{onBack:c(`ActivityHistory.Header`).back})}export{p as ActivityHistoryHeader,f as ActivityHistoryListHeader};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
|
-
|
|
3
|
-
//#region src/shared/widgets/activity-history/compound/components/List.d.ts
|
|
4
|
-
/**
|
|
5
|
-
* List body for the activity surface. Reads the `history` entity from
|
|
6
|
-
* {@link useActivityHistorySource} and branches on status:
|
|
7
|
-
*
|
|
8
|
-
* - `idle | loading` (cold path, no prior payload) → skeleton × 4.
|
|
9
|
-
* - `ready | stale` → rows. `stale` keeps the prior list rendered while a refresh is in
|
|
10
|
-
* flight so the user never sees an empty pause. The refresh is silent — no spinner.
|
|
11
|
-
* - `error` (cold path) → {@link ActivityHistoryErrorView} with a retry button.
|
|
12
|
-
* - `ready` with zero rows → {@link ActivityHistoryEmpty}.
|
|
13
|
-
*
|
|
14
|
-
* Recurring updates land via the controller-mounted `watchHistory` watcher (mounted on entry
|
|
15
|
-
* to `historyList` / `historyDetail`, with adaptive cadence — short while any row is
|
|
16
|
-
* `pending`, long once all rows are terminal). The widget itself is a pure reader; the only
|
|
17
|
-
* imperative surface left here is the retry button, which fires `source.refresh(signal)` once.
|
|
18
|
-
*
|
|
19
|
-
* @internal
|
|
20
|
-
*/
|
|
21
|
-
declare function ActivityHistoryList(): _$react_jsx_runtime0.JSX.Element;
|
|
22
|
-
//#endregion
|
|
23
|
-
export { ActivityHistoryList };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";import{Card as e}from"../../../../ui/Card/Card.js";import"../../../../ui/Card/index.js";import{Skeleton as t}from"../../../../ui/Skeleton/Skeleton.js";import"../../../../ui/Skeleton/index.js";import{ACTIVITY_HISTORY_SLOTS as n}from"../ActivityHistory.slots.js";import{styles as r}from"../ActivityHistory.styles.js";import{ActivityHistoryEmpty as i}from"./Empty.js";import{ActivityHistoryErrorView as a}from"./ErrorView.js";import{useActivityHistorySource as o}from"../context.js";import{ActivityHistoryRow as s}from"./Row.js";import{useRef as c}from"react";import{jsx as l,jsxs as u}from"react/jsx-runtime";import*as d from"@stylexjs/stylex";const f=[`skeleton-1`,`skeleton-2`,`skeleton-3`,`skeleton-4`];function p(){let t=o(`ActivityHistory.List`),u=c(null),f=c(t.refresh);f.current=t.refresh;let p=t.entity;if(p.status===`error`)return l(e.Body,{"data-stridge-slot":n.body,...d.props(r.body),children:l(a,{onRetry:()=>{u.current?.abort();let e=new AbortController;u.current=e,f.current(e.signal)}})});if(p.status===`idle`||p.status===`loading`)return l(e.Body,{"data-stridge-slot":n.body,...d.props(r.body),"aria-busy":`true`,"aria-live":`polite`,children:l(g,{})});let _=p.payload.rows;return _.length===0?l(e.Body,{"data-stridge-slot":n.body,...d.props(r.body),children:l(i,{})}):l(e.Body,{"data-stridge-slot":n.body,...d.props(r.body,r.bodyEnter),children:l(`ul`,{"data-stridge-slot":n.list,style:m,children:_.map(e=>l(`li`,{style:h,children:l(s,{payload:e,onSelect:t.selectSettlement})},`${e.udaId}:${e.id}`))})})}const m={display:`flex`,flexDirection:`column`,gap:`var(--stridge-kit-space-2)`,listStyle:`none`,marginBlock:0,marginInline:0,paddingBlock:0,paddingInline:0},h={listStyle:`none`};function g(){return l(`div`,{"data-stridge-slot":n.skeleton,children:f.map(e=>u(`div`,{"data-stridge-slot":n.skeletonRow,...d.props(r.skeletonRow),children:[l(t,{width:44,height:44,radius:999}),u(`div`,{...d.props(r.skeletonText),children:[l(t,{width:`60%`,height:14}),l(t,{width:`40%`,height:12})]}),l(t,{width:56,height:14})]},e))})}export{p as ActivityHistoryList};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";import{ChevronRightIcon as e}from"../../../../icons/ChevronRightIcon.js";import"../../../../../icons/index.js";import{SelectableTile as t}from"../../../../ui/SelectableTile/SelectableTile.js";import"../../../../ui/SelectableTile/index.js";import{text as n}from"../../../../ui/Text/Text.js";import"../../../../ui/Text/index.js";import{TokenLogo as r}from"../../../../ui/TokenLogo/TokenLogo.js";import"../../../../ui/TokenLogo/index.js";import{ACTIVITY_HISTORY_ROW_SLOTS as i}from"../Row.slots.js";import{styles as a}from"../Row.styles.js";import{StatusPip as o}from"./StatusPip.js";import{jsx as s,jsxs as c}from"react/jsx-runtime";import*as l from"@stylexjs/stylex";function u({payload:u,onSelect:d}){return c(t,{shape:`card`,interactive:`navigation`,"data-stridge-slot":i.root,"aria-label":u.ariaLabel,onClick:()=>d(u.id),...l.props(a.rowLayout),children:[c(`span`,{"data-stridge-slot":i.leading,...l.props(a.leading),children:[s(r,{symbol:u.assetSymbol,...u.chainId===void 0?{}:{chainId:u.chainId},...u.assetLogoUrl===void 0?{}:{logoUrl:u.assetLogoUrl},...u.chainLogoUrl===void 0?{}:{chainLogoUrl:u.chainLogoUrl},size:44,hideChainBadge:!0}),s(o,{kind:u.status.kind})]}),c(`span`,{"data-stridge-slot":i.text,...l.props(a.text),children:[s(n.span,{size:`sm`,fontWeight:`semibold`,leading:`tight`,color:`default`,"data-stridge-slot":i.title,...l.props(a.title),children:u.title}),s(n.span,{size:`xs`,fontWeight:`medium`,leading:`tight`,color:`subdued`,"data-stridge-slot":i.date,...l.props(a.date),children:u.formattedDate.formatted})]}),c(`span`,{"data-stridge-slot":i.trailing,...l.props(a.trailing),children:[s(n.span,{size:`sm`,fontWeight:`semibold`,leading:`tight`,color:`default`,"data-stridge-slot":i.amount,children:u.formattedAmount.formatted}),s(e,{"aria-hidden":!0,"data-stridge-slot":i.chevron,...l.props(a.chevron)})]})]})}export{u as ActivityHistoryRow};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";import{CheckIcon as e}from"../../../../icons/CheckIcon.js";import{LoaderIcon as t}from"../../../../icons/LoaderIcon.js";import{XIcon as n}from"../../../../icons/XIcon.js";import"../../../../../icons/index.js";import{ACTIVITY_HISTORY_ROW_SLOTS as r}from"../Row.slots.js";import{styles as i}from"../Row.styles.js";import{jsx as a}from"react/jsx-runtime";import*as o from"@stylexjs/stylex";function s({kind:s}){let c=s===`completed`?i.statusPipCompleted:s===`failed`?i.statusPipFailed:i.statusPipPending;return a(`span`,{"data-stridge-slot":r.statusPip,...o.props(i.statusPip,c),children:s===`completed`?a(e,{"aria-hidden":!0,...o.props(i.statusPipIcon)}):s===`failed`?a(n,{"aria-hidden":!0,...o.props(i.statusPipIcon)}):a(t,{"aria-hidden":!0,...o.props(i.statusPipSpinner)})})}export{s as StatusPip};
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { Entity } from "../../../driver/types.js";
|
|
2
|
-
import { ActivityHistoryPayload } from "../payloads.js";
|
|
3
|
-
import { SettlementPayloadContext } from "../../../../flows/deposit/driver/transformers/settlementToPayload.js";
|
|
4
|
-
import * as _$react from "react";
|
|
5
|
-
import { GatewayPollResponse, GatewayUdaDto } from "@stridge/sdk";
|
|
6
|
-
|
|
7
|
-
//#region src/shared/widgets/activity-history/compound/context.d.ts
|
|
8
|
-
/**
|
|
9
|
-
* Source of truth handed to `<ActivityHistory>` and `<ActivityHistoryDetail>` from whichever
|
|
10
|
-
* dialog (deposit / withdraw) mounts them. Each dialog assembles this value once from its own
|
|
11
|
-
* snapshot + actions and wraps the activity-history step body in
|
|
12
|
-
* `<ActivityHistorySourceProvider value={…}>`. The compound stays flow-agnostic — it reads
|
|
13
|
-
* the entity and the imperative actions from this single value.
|
|
14
|
-
*
|
|
15
|
-
* View routing is external: the FSM now exposes `historyList` and `historyDetail` as separate
|
|
16
|
-
* state names; the dialog's step router mounts {@link ActivityHistory} for the list step and
|
|
17
|
-
* {@link ActivityHistoryDetail} for the detail step. Each orchestrated wrapper supplies the
|
|
18
|
-
* source value with the slots its step needs (the list wrapper omits `settlementId`; the
|
|
19
|
-
* detail wrapper sets it).
|
|
20
|
-
*
|
|
21
|
-
* @see {@link ActivityHistorySourceProvider}
|
|
22
|
-
* @see {@link useActivityHistorySource}
|
|
23
|
-
*/
|
|
24
|
-
interface ActivityHistorySourceValue {
|
|
25
|
-
/**
|
|
26
|
-
* The driver's `history` entity. Same shape on both flows (`DepositSnapshot["history"]`
|
|
27
|
-
* and `WithdrawSnapshot["history"]` are structurally identical — both back onto the
|
|
28
|
-
* multi-UDA envelope from `GET /gateway/{owner}`). Status discriminator drives the
|
|
29
|
-
* compound's branch (idle / loading → skeleton; ready / stale → rows; error → retry).
|
|
30
|
-
*/
|
|
31
|
-
entity: Entity<ActivityHistoryPayload, ReadonlyArray<GatewayUdaDto>, GatewayPollResponse>;
|
|
32
|
-
/**
|
|
33
|
-
* Trigger a fresh one-shot fetch. Wired by each dialog to `driver.refreshHistory(signal)`.
|
|
34
|
-
* The compound calls this from the error-view retry button; each call passes an
|
|
35
|
-
* `AbortSignal` the compound owns so it can cancel mid-fetch on rapid re-clicks. Recurring
|
|
36
|
-
* updates while the list is visible land separately via the controller-mounted
|
|
37
|
-
* `watchHistory` watcher — this callback is not the steady-state polling surface.
|
|
38
|
-
*/
|
|
39
|
-
refresh: (signal: AbortSignal) => void;
|
|
40
|
-
/**
|
|
41
|
-
* Dispatch a row selection. Wired to `actions.selectSettlement(id)` — the FSM transitions
|
|
42
|
-
* from `historyList` to `historyDetail` carrying the selected `settlementId`.
|
|
43
|
-
*/
|
|
44
|
-
selectSettlement: (settlementId: string) => void;
|
|
45
|
-
/**
|
|
46
|
-
* Back chevron handler. Wired to `actions.back()` — the FSM disambiguates via the current
|
|
47
|
-
* state name (`historyDetail → historyList → source`). The compound renders the chevron in
|
|
48
|
-
* both the list step's header AND inside the detail step's header composition.
|
|
49
|
-
*/
|
|
50
|
-
back: () => void;
|
|
51
|
-
/**
|
|
52
|
-
* Selected settlement id when the dialog is mounting the detail step. Carried so the
|
|
53
|
-
* `<ActivityHistoryDetail>` compound can look up the matching `GatewaySettlementDto`
|
|
54
|
-
* inside `entity.raw[].settlements[]` and feed it to {@link
|
|
55
|
-
* import("../adapters").settlementToWidgetProps}. Absent when the list wrapper supplies
|
|
56
|
-
* the source value.
|
|
57
|
-
*/
|
|
58
|
-
settlementId?: string;
|
|
59
|
-
/**
|
|
60
|
-
* Context the detail compound's adapter passes to {@link
|
|
61
|
-
* import("#/flows/deposit/driver/transformers").settlementToPayload}. Each dialog
|
|
62
|
-
* assembles this from its own driver snapshot — deposit reads `wallet`, `brand`, the
|
|
63
|
-
* driver's explorers map; withdraw reads its equivalents. Carrying the resolved context
|
|
64
|
-
* here keeps the compound flow-agnostic.
|
|
65
|
-
*/
|
|
66
|
-
settlementContext: SettlementPayloadContext;
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Provider for {@link ActivityHistorySourceValue}. Each dialog mounts one above its
|
|
70
|
-
* activity-history step body — see `DepositDialog` / `WithdrawDialog`.
|
|
71
|
-
*/
|
|
72
|
-
declare const ActivityHistorySourceProvider: _$react.Provider<ActivityHistorySourceValue | null>;
|
|
73
|
-
/**
|
|
74
|
-
* Read the active {@link ActivityHistorySourceValue}. Throws when called outside an
|
|
75
|
-
* `<ActivityHistorySourceProvider>`.
|
|
76
|
-
*/
|
|
77
|
-
declare function useActivityHistorySource(consumer: string): ActivityHistorySourceValue;
|
|
78
|
-
//#endregion
|
|
79
|
-
export { ActivityHistorySourceProvider, ActivityHistorySourceValue, useActivityHistorySource };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";import{createContext as e,use as t}from"react";const n=e(null);n.displayName=`ActivityHistorySourceContext`;const r=n.Provider;function i(e){let r=t(n);if(!r)throw Error(`${e} must be rendered inside <ActivityHistorySourceProvider>. Mount the provider above <ActivityHistory> with the value derived from the flow's snapshot + actions — see DepositDialog / WithdrawDialog for the canonical wiring.`);return r}export{r as ActivityHistorySourceProvider,i as useActivityHistorySource};
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { FormattedField } from "../../format/types.js";
|
|
2
|
-
//#region src/shared/widgets/activity-history/payloads.d.ts
|
|
3
|
-
/**
|
|
4
|
-
* Which flow produced the settlement — `"deposit"` for UDAs whose destination is the connected
|
|
5
|
-
* wallet, `"withdraw"` for UDAs whose source is the brand-currency balance the user is cashing
|
|
6
|
-
* out from. Discriminated by `uda.metadata.kit_flow` when present, with an address-comparison
|
|
7
|
-
* fallback for legacy UDAs that pre-date the metadata convention.
|
|
8
|
-
*/
|
|
9
|
-
type ActivityHistoryDirection = "deposit" | "withdraw";
|
|
10
|
-
/**
|
|
11
|
-
* Lifecycle bucket for a single settlement row. Maps onto the kit's existing settlement-status
|
|
12
|
-
* model (`pending → succeeded → failed`) but flattens it to the 3-value set the row renders
|
|
13
|
-
* against — the inline status indicator picks an icon from this discriminator alone.
|
|
14
|
-
*/
|
|
15
|
-
type ActivityHistoryStatusType = "pending" | "completed" | "failed";
|
|
16
|
-
/**
|
|
17
|
-
* Wrapper carrying the lifecycle bucket plus room for future status-scoped metadata (e.g. a
|
|
18
|
-
* settlement-level `failureKind` tag the row could surface). Kept separate from
|
|
19
|
-
* {@link ActivityHistoryStatusType} so the discriminator string stays stable as the shape grows.
|
|
20
|
-
*/
|
|
21
|
-
interface ActivityHistoryStatus {
|
|
22
|
-
kind: ActivityHistoryStatusType;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* One settlement row in the activity history list. Pre-formatted by the driver's transformer —
|
|
26
|
-
* widgets render directly from these fields and never re-format inputs themselves.
|
|
27
|
-
*
|
|
28
|
-
* Detail-view rendering happens off the entity's `raw: ReadonlyArray<GatewayUdaDto>` slot: the
|
|
29
|
-
* row carries `udaId` + `id` so the detail component can locate the matching
|
|
30
|
-
* `GatewaySettlementDto` and feed it back through {@link
|
|
31
|
-
* import("#/flows/deposit/driver/transformers").settlementToPayload} to produce a full
|
|
32
|
-
* `SuccessStateProps` / `ErrorStateProps` / pending payload at display time.
|
|
33
|
-
*/
|
|
34
|
-
interface ActivityHistoryRowPayload {
|
|
35
|
-
/** Settlement id — unique within the multi-UDA envelope. The detail lookup keys on this. */
|
|
36
|
-
id: string;
|
|
37
|
-
/** Parent UDA id — settlements nest inside UDAs; the detail walker scans `udas[].settlements[]`. */
|
|
38
|
-
udaId: string;
|
|
39
|
-
/** Flow that produced this settlement. Drives the title prefix and the accessible label. */
|
|
40
|
-
direction: ActivityHistoryDirection;
|
|
41
|
-
/** Lifecycle bucket. Drives the inline status indicator (spinner / red-X / none). */
|
|
42
|
-
status: ActivityHistoryStatus;
|
|
43
|
-
/** Localized action+status string (e.g. `"Deposit completed"`, `"Withdrawal in progress"`). */
|
|
44
|
-
title: string;
|
|
45
|
-
/**
|
|
46
|
-
* USD-formatted amount for this row. For deposits this is the credited receive amount; for
|
|
47
|
-
* withdrawals the source send amount. The widget renders `formatted` verbatim.
|
|
48
|
-
*/
|
|
49
|
-
formattedAmount: FormattedField<number>;
|
|
50
|
-
/**
|
|
51
|
-
* Settlement `updated_at` (unix-ms in `value`). `formatted` is the smart-relative form for
|
|
52
|
-
* settlements younger than 7 days, otherwise an absolute date — both follow the active Lingui
|
|
53
|
-
* locale.
|
|
54
|
-
*/
|
|
55
|
-
formattedDate: FormattedField<number>;
|
|
56
|
-
/** Destination asset symbol — what the leading {@link import("#/shared/ui").TokenLogo} renders. */
|
|
57
|
-
assetSymbol: string;
|
|
58
|
-
/** Resolved token icon URL, when known. */
|
|
59
|
-
assetLogoUrl?: string;
|
|
60
|
-
/** EIP-155 chain id of the destination chain. */
|
|
61
|
-
chainId?: number;
|
|
62
|
-
/** Human-readable destination network name (e.g. `"Ethereum"`, `"BSC"`). */
|
|
63
|
-
chainName?: string;
|
|
64
|
-
/** Resolved chain glyph URL — overlaid in the corner of the asset logo. */
|
|
65
|
-
chainLogoUrl?: string;
|
|
66
|
-
/**
|
|
67
|
-
* Accessible label rendered as the row's `aria-label`. Encodes direction + amount + date
|
|
68
|
-
* because the leading icon does not carry direction.
|
|
69
|
-
*/
|
|
70
|
-
ariaLabel: string;
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Entity payload for the owner-scoped activity surface. Backed by the multi-UDA envelope from
|
|
74
|
-
* `GET /gateway/{owner}`; `rows` is sorted newest-first and capped at 20 entries per fetch.
|
|
75
|
-
*/
|
|
76
|
-
interface ActivityHistoryPayload {
|
|
77
|
-
/** Newest-first row payloads, capped at 20 per fetch. */
|
|
78
|
-
rows: ReadonlyArray<ActivityHistoryRowPayload>;
|
|
79
|
-
}
|
|
80
|
-
//#endregion
|
|
81
|
-
export { ActivityHistoryDirection, ActivityHistoryPayload, ActivityHistoryRowPayload, ActivityHistoryStatus, ActivityHistoryStatusType };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{parseIsoMs as e}from"../../../../flows/shared/transformers/parseIsoMs.js";import{formatTimestamp as t}from"../../../format/formatTimestamp.js";import{formatTokenAmount as n}from"../../../format/formatTokenAmount.js";import{formatUsd as r}from"../../../format/formatUsd.js";import{resolveDirection as i}from"./resolveDirection.js";function a(e,t){let n=t.now??Date.now(),r=t.ownerAddress.toLowerCase(),i=[];for(let t of e.udas)for(let e of t.settlements)i.push({settlement:e,uda:t});i.sort((e,t)=>e.settlement.updated_at===t.settlement.updated_at?0:e.settlement.updated_at<t.settlement.updated_at?1:-1);let a=[];for(let{settlement:e,uda:s}of i.slice(0,20))a.push(o(e,s,t,n,r));return{rows:a}}function o(t,n,r,a,o){let u=i(n,o),d=s(t.status),f=c(u,d.kind,r.i18n),p=l(t,n,u,r.i18n),g=e(t.updated_at)??e(t.created_at)??a,_={value:g,formatted:m(g,a,r.i18n)},v=h(u,p.formatted,_.formatted,r.i18n),y=n.destination.eip155_id?Number(n.destination.eip155_id):void 0,b=y===void 0?void 0:r.chainLogoFor?.(y),x=t.to?.logo??void 0;return{id:t.id,udaId:n.uda_id,direction:u,status:d,title:f,formattedAmount:p,formattedDate:_,assetSymbol:n.destination.asset_symbol,...x?{assetLogoUrl:x}:{},...y===void 0?{}:{chainId:y},...n.destination.network_name?{chainName:n.destination.network_name}:{},...b?{chainLogoUrl:b}:{},ariaLabel:v}}function s(e){switch(e){case`created`:case`routing`:return{kind:`pending`};case`completed`:return{kind:`completed`};case`failed`:return{kind:`failed`};default:return{kind:`pending`}}}function c(e,t,n){return e===`deposit`?t===`completed`?n._({id:`Deposit completed`,message:`Deposit completed`}):t===`failed`?n._({id:`Deposit failed`,message:`Deposit failed`}):n._({id:`Deposit in progress`,message:`Deposit in progress`}):t===`completed`?n._({id:`Withdrawal completed`,message:`Withdrawal completed`}):t===`failed`?n._({id:`Withdrawal failed`,message:`Withdrawal failed`}):n._({id:`Withdrawal in progress`,message:`Withdrawal in progress`})}function l(e,t,i,a){let o=i===`deposit`?e.to:e.from,s=o?.amount_usd;if(s){let e=Number.parseFloat(s);if(Number.isFinite(e))return{value:e,formatted:r(e,a)}}let c=t.destination.asset_decimals,l=u(o,c),d=t.destination.asset_symbol;return{value:l,formatted:`${n(l,a,{maxDecimals:c})} ${d}`}}function u(e,t){if(!e)return 0;if(e.amount){let t=Number.parseFloat(e.amount);if(Number.isFinite(t)&&t>=0)return t}if(e.raw_amount){let n=e.raw_amount;try{let e=BigInt(n);if(t===0)return Number(e);let r=10n**BigInt(t),i=e/r,a=(e%r).toString().padStart(t,`0`);return Number(`${i}.${a}`)}catch{return 0}}return 0}const d=6e4,f=36e5,p=864e5;function m(e,n,r){let i=n-e;if(i<d)return r._({id:`Just now`,message:`Just now`});let a=new Intl.RelativeTimeFormat(r.locale,{numeric:`auto`});if(i<f){let e=Math.floor(i/d);return a.format(-e,`minute`)}if(i<p){let e=Math.floor(i/f);return a.format(-e,`hour`)}let o=Math.floor(i/p);return o===1?r._({id:`Yesterday`,message:`Yesterday`}):o<7?a.format(-o,`day`):t(e,r)}function h(e,t,n,r){return e===`deposit`?r._({id:`Deposit of {amount}, {date}`,message:`Deposit of {amount}, {date}`,values:{amount:t,date:n}}):r._({id:`Withdrawal of {amount}, {date}`,message:`Withdrawal of {amount}, {date}`,values:{amount:t,date:n}})}export{a as historyResponseToPayload};
|
|
File without changes
|
|
File without changes
|