@avail-project/widgets 0.0.1
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/README.md +34 -0
- package/dist/common/components/ErrorBoundary.d.ts +44 -0
- package/dist/common/components/ErrorBoundary.d.ts.map +1 -0
- package/dist/common/components/ErrorBoundary.js +65 -0
- package/dist/common/hooks/useDebouncedCallback.d.ts +13 -0
- package/dist/common/hooks/useDebouncedCallback.d.ts.map +1 -0
- package/dist/common/hooks/useDebouncedCallback.js +42 -0
- package/dist/common/hooks/useDebouncedValue.d.ts +5 -0
- package/dist/common/hooks/useDebouncedValue.d.ts.map +1 -0
- package/dist/common/hooks/useDebouncedValue.js +15 -0
- package/dist/common/hooks/useInterval.d.ts +11 -0
- package/dist/common/hooks/useInterval.d.ts.map +1 -0
- package/dist/common/hooks/useInterval.js +25 -0
- package/dist/common/hooks/useLatest.d.ts +12 -0
- package/dist/common/hooks/useLatest.d.ts.map +1 -0
- package/dist/common/hooks/useLatest.js +19 -0
- package/dist/common/hooks/useNexusError.d.ts +20 -0
- package/dist/common/hooks/useNexusError.d.ts.map +1 -0
- package/dist/common/hooks/useNexusError.js +120 -0
- package/dist/common/hooks/usePolling.d.ts +7 -0
- package/dist/common/hooks/usePolling.d.ts.map +1 -0
- package/dist/common/hooks/usePolling.js +29 -0
- package/dist/common/hooks/useStableCallback.d.ts +6 -0
- package/dist/common/hooks/useStableCallback.d.ts.map +1 -0
- package/dist/common/hooks/useStableCallback.js +13 -0
- package/dist/common/hooks/useStopwatch.d.ts +17 -0
- package/dist/common/hooks/useStopwatch.d.ts.map +1 -0
- package/dist/common/hooks/useStopwatch.js +44 -0
- package/dist/common/hooks/useTransactionExecution.d.ts +62 -0
- package/dist/common/hooks/useTransactionExecution.d.ts.map +1 -0
- package/dist/common/hooks/useTransactionExecution.js +273 -0
- package/dist/common/hooks/useTransactionFlow.d.ts +71 -0
- package/dist/common/hooks/useTransactionFlow.d.ts.map +1 -0
- package/dist/common/hooks/useTransactionFlow.js +435 -0
- package/dist/common/index.d.ts +17 -0
- package/dist/common/index.d.ts.map +1 -0
- package/dist/common/index.js +16 -0
- package/dist/common/tx/steps.d.ts +19 -0
- package/dist/common/tx/steps.d.ts.map +1 -0
- package/dist/common/tx/steps.js +89 -0
- package/dist/common/tx/types.d.ts +11 -0
- package/dist/common/tx/types.d.ts.map +1 -0
- package/dist/common/tx/types.js +19 -0
- package/dist/common/tx/useTransactionSteps.d.ts +21 -0
- package/dist/common/tx/useTransactionSteps.d.ts.map +1 -0
- package/dist/common/tx/useTransactionSteps.js +40 -0
- package/dist/common/types/transaction-flow.d.ts +48 -0
- package/dist/common/types/transaction-flow.d.ts.map +1 -0
- package/dist/common/types/transaction-flow.js +2 -0
- package/dist/common/utils/constant.d.ts +99 -0
- package/dist/common/utils/constant.d.ts.map +1 -0
- package/dist/common/utils/constant.js +370 -0
- package/dist/common/utils/token-pricing.d.ts +33 -0
- package/dist/common/utils/token-pricing.d.ts.map +1 -0
- package/dist/common/utils/token-pricing.js +255 -0
- package/dist/common/utils/transaction-flow.d.ts +35 -0
- package/dist/common/utils/transaction-flow.d.ts.map +1 -0
- package/dist/common/utils/transaction-flow.js +65 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/lib/utils.d.ts +4 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +8 -0
- package/dist/nexus/NexusProvider.d.ts +50 -0
- package/dist/nexus/NexusProvider.d.ts.map +1 -0
- package/dist/nexus/NexusProvider.js +572 -0
- package/dist/nexus-widget/components/address-identicon.d.ts +5 -0
- package/dist/nexus-widget/components/address-identicon.d.ts.map +1 -0
- package/dist/nexus-widget/components/address-identicon.js +39 -0
- package/dist/nexus-widget/components/amount-input-unified.d.ts +18 -0
- package/dist/nexus-widget/components/amount-input-unified.d.ts.map +1 -0
- package/dist/nexus-widget/components/amount-input-unified.js +88 -0
- package/dist/nexus-widget/components/deposit-idle-form.d.ts +29 -0
- package/dist/nexus-widget/components/deposit-idle-form.d.ts.map +1 -0
- package/dist/nexus-widget/components/deposit-idle-form.js +506 -0
- package/dist/nexus-widget/components/nexus-widget-progress-screen.d.ts +36 -0
- package/dist/nexus-widget/components/nexus-widget-progress-screen.d.ts.map +1 -0
- package/dist/nexus-widget/components/nexus-widget-progress-screen.js +737 -0
- package/dist/nexus-widget/components/pay-using-selector.d.ts +9 -0
- package/dist/nexus-widget/components/pay-using-selector.d.ts.map +1 -0
- package/dist/nexus-widget/components/pay-using-selector.js +37 -0
- package/dist/nexus-widget/components/pay-with-sources.d.ts +11 -0
- package/dist/nexus-widget/components/pay-with-sources.d.ts.map +1 -0
- package/dist/nexus-widget/components/pay-with-sources.js +266 -0
- package/dist/nexus-widget/components/receive-asset-selector.d.ts +28 -0
- package/dist/nexus-widget/components/receive-asset-selector.d.ts.map +1 -0
- package/dist/nexus-widget/components/receive-asset-selector.js +1178 -0
- package/dist/nexus-widget/components/recipient-input.d.ts +10 -0
- package/dist/nexus-widget/components/recipient-input.d.ts.map +1 -0
- package/dist/nexus-widget/components/recipient-input.js +44 -0
- package/dist/nexus-widget/components/send-idle-form.d.ts +29 -0
- package/dist/nexus-widget/components/send-idle-form.d.ts.map +1 -0
- package/dist/nexus-widget/components/send-idle-form.js +548 -0
- package/dist/nexus-widget/components/status-alerts.d.ts +7 -0
- package/dist/nexus-widget/components/status-alerts.d.ts.map +1 -0
- package/dist/nexus-widget/components/status-alerts.js +17 -0
- package/dist/nexus-widget/components/swap-asset-selector.d.ts +74 -0
- package/dist/nexus-widget/components/swap-asset-selector.d.ts.map +1 -0
- package/dist/nexus-widget/components/swap-asset-selector.js +1910 -0
- package/dist/nexus-widget/components/swap-idle-form.d.ts +29 -0
- package/dist/nexus-widget/components/swap-idle-form.d.ts.map +1 -0
- package/dist/nexus-widget/components/swap-idle-form.js +1289 -0
- package/dist/nexus-widget/components/swap-intent-preview.d.ts +95 -0
- package/dist/nexus-widget/components/swap-intent-preview.d.ts.map +1 -0
- package/dist/nexus-widget/components/swap-intent-preview.js +1050 -0
- package/dist/nexus-widget/nexus-widget.d.ts +4 -0
- package/dist/nexus-widget/nexus-widget.d.ts.map +1 -0
- package/dist/nexus-widget/nexus-widget.js +7819 -0
- package/dist/nexus-widget/sdk-types.d.ts +13 -0
- package/dist/nexus-widget/sdk-types.d.ts.map +1 -0
- package/dist/nexus-widget/sdk-types.js +1 -0
- package/dist/nexus-widget/theme.d.ts +156 -0
- package/dist/nexus-widget/theme.d.ts.map +1 -0
- package/dist/nexus-widget/theme.js +159 -0
- package/dist/nexus-widget/types.d.ts +141 -0
- package/dist/nexus-widget/types.d.ts.map +1 -0
- package/dist/nexus-widget/types.js +1 -0
- package/dist/nexus-widget/utils/citrea-tokens.d.ts +82 -0
- package/dist/nexus-widget/utils/citrea-tokens.d.ts.map +1 -0
- package/dist/nexus-widget/utils/citrea-tokens.js +136 -0
- package/dist/nexus-widget/utils/deposit-source-selection.d.ts +55 -0
- package/dist/nexus-widget/utils/deposit-source-selection.d.ts.map +1 -0
- package/dist/nexus-widget/utils/deposit-source-selection.js +219 -0
- package/dist/swaps/components/stacked-token-icons.d.ts +15 -0
- package/dist/swaps/components/stacked-token-icons.d.ts.map +1 -0
- package/dist/swaps/components/stacked-token-icons.js +38 -0
- package/dist/swaps/components/step-flow.d.ts +32 -0
- package/dist/swaps/components/step-flow.d.ts.map +1 -0
- package/dist/swaps/components/step-flow.js +54 -0
- package/dist/swaps/components/token-icon.d.ts +11 -0
- package/dist/swaps/components/token-icon.d.ts.map +1 -0
- package/dist/swaps/components/token-icon.js +16 -0
- package/dist/swaps/components/transaction-progress.d.ts +43 -0
- package/dist/swaps/components/transaction-progress.d.ts.map +1 -0
- package/dist/swaps/components/transaction-progress.js +94 -0
- package/dist/ui/button.d.ts +11 -0
- package/dist/ui/button.d.ts.map +1 -0
- package/dist/ui/button.js +34 -0
- package/dist/ui/dialog.d.ts +17 -0
- package/dist/ui/dialog.d.ts.map +1 -0
- package/dist/ui/dialog.js +47 -0
- package/package.json +60 -0
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import type { SwapStepType } from "../../common/types/transaction-flow";
|
|
2
|
+
import { type NexusWidgetDepositOpportunityMetadata, type NexusWidgetMode } from "../types";
|
|
3
|
+
import { type SwapTokenOption } from "./swap-asset-selector";
|
|
4
|
+
export interface SwapIntentSource {
|
|
5
|
+
amount: string;
|
|
6
|
+
chain: {
|
|
7
|
+
id: number;
|
|
8
|
+
logo: string;
|
|
9
|
+
name: string;
|
|
10
|
+
};
|
|
11
|
+
token: {
|
|
12
|
+
contractAddress: string;
|
|
13
|
+
decimals: number;
|
|
14
|
+
symbol: string;
|
|
15
|
+
};
|
|
16
|
+
value?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface SwapIntentDestination {
|
|
19
|
+
amount: string;
|
|
20
|
+
chain: {
|
|
21
|
+
id: number;
|
|
22
|
+
logo: string;
|
|
23
|
+
name: string;
|
|
24
|
+
};
|
|
25
|
+
gas: {
|
|
26
|
+
amount: string;
|
|
27
|
+
value?: string;
|
|
28
|
+
token: {
|
|
29
|
+
contractAddress: string;
|
|
30
|
+
decimals: number;
|
|
31
|
+
symbol: string;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
token: {
|
|
35
|
+
contractAddress: string;
|
|
36
|
+
decimals: number;
|
|
37
|
+
symbol: string;
|
|
38
|
+
};
|
|
39
|
+
value?: string;
|
|
40
|
+
}
|
|
41
|
+
export type BridgeProvider = "nexus" | "mayan" | null;
|
|
42
|
+
export interface SwapIntentData {
|
|
43
|
+
bridgeProvider?: BridgeProvider;
|
|
44
|
+
destination: SwapIntentDestination;
|
|
45
|
+
feesAndBuffer?: {
|
|
46
|
+
buffer?: string;
|
|
47
|
+
bridge?: {
|
|
48
|
+
caGas?: string;
|
|
49
|
+
collection?: string;
|
|
50
|
+
fulfilment?: string;
|
|
51
|
+
gasSupplied?: string;
|
|
52
|
+
protocol?: string;
|
|
53
|
+
solver?: string;
|
|
54
|
+
total?: string;
|
|
55
|
+
} | string | null;
|
|
56
|
+
};
|
|
57
|
+
sources: SwapIntentSource[];
|
|
58
|
+
}
|
|
59
|
+
export interface SwapIntentPreviewProps {
|
|
60
|
+
activeMode?: NexusWidgetMode;
|
|
61
|
+
estimatedTime?: string;
|
|
62
|
+
explorerUrls?: {
|
|
63
|
+
sourceExplorerUrl: string | null;
|
|
64
|
+
destinationExplorerUrl: string | null;
|
|
65
|
+
};
|
|
66
|
+
fromAmount: string;
|
|
67
|
+
fromAmountUsd?: string;
|
|
68
|
+
fromToken?: SwapTokenOption;
|
|
69
|
+
fromTokens?: SwapTokenOption[];
|
|
70
|
+
intentData?: SwapIntentData | null;
|
|
71
|
+
isExecuting?: boolean;
|
|
72
|
+
isLoading?: boolean;
|
|
73
|
+
isRefreshing?: boolean;
|
|
74
|
+
mode?: NexusWidgetMode;
|
|
75
|
+
onAccept: () => void;
|
|
76
|
+
onReject: () => void;
|
|
77
|
+
onTransitionChange?: (isTransitioning: boolean) => void;
|
|
78
|
+
opportunity?: NexusWidgetDepositOpportunityMetadata;
|
|
79
|
+
recipientAddress?: string;
|
|
80
|
+
steps?: Array<{
|
|
81
|
+
id: number;
|
|
82
|
+
completed: boolean;
|
|
83
|
+
step: SwapStepType;
|
|
84
|
+
}>;
|
|
85
|
+
supportedTokenAssets?: any[] | null;
|
|
86
|
+
swapBalances?: any[] | null;
|
|
87
|
+
swapType?: "exactIn" | "exactOut";
|
|
88
|
+
toAmount?: string;
|
|
89
|
+
toAmountTokens?: string;
|
|
90
|
+
toAmountUsd?: string;
|
|
91
|
+
toToken?: SwapTokenOption;
|
|
92
|
+
totalFeeUsd?: string;
|
|
93
|
+
}
|
|
94
|
+
export declare function SwapIntentPreview({ fromTokens, fromToken, toToken, fromAmount, fromAmountUsd, toAmount, toAmountUsd, toAmountTokens, totalFeeUsd, isLoading, isRefreshing, isExecuting, swapType, intentData, mode, opportunity, recipientAddress, activeMode, steps, explorerUrls, onAccept, onTransitionChange, }: SwapIntentPreviewProps): import("react/jsx-runtime").JSX.Element;
|
|
95
|
+
//# sourceMappingURL=swap-intent-preview.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"swap-intent-preview.d.ts","sourceRoot":"","sources":["../../../.build-src/nexus-widget/components/swap-intent-preview.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAIxE,OAAO,EACL,KAAK,qCAAqC,EAC1C,KAAK,eAAe,EACrB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IAClD,KAAK,EAAE;QAAE,eAAe,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IACrE,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IAClD,GAAG,EAAE;QACH,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,KAAK,EAAE;YAAE,eAAe,EAAE,MAAM,CAAC;YAAC,QAAQ,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,MAAM,CAAA;SAAE,CAAC;KACtE,CAAC;IACF,KAAK,EAAE;QAAE,eAAe,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,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