@0xsquid/deposit-widget 0.1.0-beta.0
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/cjs/index.cjs +4062 -0
- package/dist/cjs/index.cjs.map +1 -0
- package/dist/index.d.ts +52 -0
- package/dist/index.esm.js +4042 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/types/DepositWidget.d.ts +7 -0
- package/dist/types/components/ViewTransition.d.ts +7 -0
- package/dist/types/components/shared/buttons/button.d.ts +3 -0
- package/dist/types/components/shared/icons/types.d.ts +3 -0
- package/dist/types/components/shared/icons/user-round.d.ts +2 -0
- package/dist/types/components/shared/navigation/base-navbar.d.ts +3 -0
- package/dist/types/components/shared/navigation/sub-navbar.d.ts +6 -0
- package/dist/types/components/token-badge-icon.d.ts +6 -0
- package/dist/types/components/token-list-item.d.ts +13 -0
- package/dist/types/components/view-container.d.ts +1 -0
- package/dist/types/constants.d.ts +1 -0
- package/dist/types/hooks/ui/useMainCTAButtonState.d.ts +8 -0
- package/dist/types/hooks/use-auto-select-token.d.ts +1 -0
- package/dist/types/hooks/use-deposit-route.d.ts +7 -0
- package/dist/types/hooks/use-token-selection.d.ts +5 -0
- package/dist/types/hooks/use-transaction-history.d.ts +6 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/services/assets-service.d.ts +6 -0
- package/dist/types/services/wallet-history/format.d.ts +10 -0
- package/dist/types/services/wallet-history/format.test.d.ts +1 -0
- package/dist/types/services/wallet-history/get-main-explorer-url.d.ts +23 -0
- package/dist/types/services/wallet-history/get-wallet-history.d.ts +2 -0
- package/dist/types/services/wallet-history/types.d.ts +66 -0
- package/dist/types/services/wallet-history/validation.d.ts +2 -0
- package/dist/types/store/use-deposit-store.d.ts +9 -0
- package/dist/types/store/use-input-mode.d.ts +5 -0
- package/dist/types/store/useRouter.d.ts +12 -0
- package/dist/types/types.d.ts +43 -0
- package/dist/types/utils/format-date.d.ts +2 -0
- package/dist/types/utils/format-date.test.d.ts +1 -0
- package/dist/types/utils/transaction.d.ts +10 -0
- package/dist/types/views/connect-wallet/connect-wallet-view.d.ts +6 -0
- package/dist/types/views/connect-wallet/wallet-list-item.d.ts +9 -0
- package/dist/types/views/main/amount-input.d.ts +10 -0
- package/dist/types/views/main/connect-prompt.d.ts +1 -0
- package/dist/types/views/main/deposit-amount-input.d.ts +1 -0
- package/dist/types/views/main/deposit-form.d.ts +1 -0
- package/dist/types/views/main/main-cta-button.d.ts +1 -0
- package/dist/types/views/main/main-view.d.ts +1 -0
- package/dist/types/views/main/navbar/actions.d.ts +1 -0
- package/dist/types/views/main/navbar/icon.d.ts +1 -0
- package/dist/types/views/main/navbar/navbar.d.ts +1 -0
- package/dist/types/views/main/navbar/title.d.ts +10 -0
- package/dist/types/views/main/recipient/account.d.ts +14 -0
- package/dist/types/views/main/recipient/recipient.d.ts +1 -0
- package/dist/types/views/main/token-selector.d.ts +1 -0
- package/dist/types/views/qr-code.d.ts +1 -0
- package/dist/types/views/render-view.d.ts +3 -0
- package/dist/types/views/select-chain/chain-type-meta.d.ts +7 -0
- package/dist/types/views/select-chain/select-chain-view.d.ts +6 -0
- package/dist/types/views/select-token.d.ts +1 -0
- package/dist/types/views/transaction-history/activity-list-item.d.ts +4 -0
- package/dist/types/views/transaction-history/transaction-history-view.d.ts +1 -0
- package/dist/types/views/transaction-progress/helpers.d.ts +14 -0
- package/dist/types/views/transaction-progress/transaction-progress-view.d.ts +1 -0
- package/dist/types/views/transaction-progress/use-transaction-progress.d.ts +17 -0
- package/package.json +99 -0
- package/src/DepositWidget.tsx +158 -0
- package/src/compiled-tailwind.css +6100 -0
- package/src/components/ViewTransition.tsx +81 -0
- package/src/components/shared/buttons/button.tsx +17 -0
- package/src/components/shared/icons/types.ts +3 -0
- package/src/components/shared/icons/user-round.tsx +21 -0
- package/src/components/shared/navigation/base-navbar.tsx +15 -0
- package/src/components/shared/navigation/sub-navbar.tsx +46 -0
- package/src/components/token-badge-icon.tsx +31 -0
- package/src/components/token-list-item.tsx +84 -0
- package/src/components/view-container.tsx +16 -0
- package/src/constants.ts +1 -0
- package/src/css.d.ts +4 -0
- package/src/fonts/DMSans-Variable.woff2 +0 -0
- package/src/hooks/ui/useMainCTAButtonState.ts +143 -0
- package/src/hooks/use-auto-select-token.ts +65 -0
- package/src/hooks/use-deposit-route.ts +58 -0
- package/src/hooks/use-token-selection.ts +17 -0
- package/src/hooks/use-transaction-history.ts +198 -0
- package/src/index.ts +3 -0
- package/src/services/assets-service.ts +21 -0
- package/src/services/wallet-history/format.test.ts +63 -0
- package/src/services/wallet-history/format.ts +128 -0
- package/src/services/wallet-history/get-main-explorer-url.ts +74 -0
- package/src/services/wallet-history/get-wallet-history.ts +24 -0
- package/src/services/wallet-history/types.ts +66 -0
- package/src/services/wallet-history/validation.ts +60 -0
- package/src/store/use-deposit-store.ts +20 -0
- package/src/store/use-input-mode.ts +10 -0
- package/src/store/useRouter.ts +49 -0
- package/src/tailwind.css +16 -0
- package/src/types.ts +39 -0
- package/src/utils/format-date.test.ts +32 -0
- package/src/utils/format-date.ts +25 -0
- package/src/utils/transaction.ts +39 -0
- package/src/views/connect-wallet/connect-wallet-view.tsx +147 -0
- package/src/views/connect-wallet/wallet-list-item.tsx +69 -0
- package/src/views/main/amount-input.tsx +272 -0
- package/src/views/main/connect-prompt.tsx +47 -0
- package/src/views/main/deposit-amount-input.tsx +42 -0
- package/src/views/main/deposit-form.tsx +13 -0
- package/src/views/main/main-cta-button.tsx +14 -0
- package/src/views/main/main-view.tsx +24 -0
- package/src/views/main/navbar/actions.tsx +25 -0
- package/src/views/main/navbar/icon.tsx +11 -0
- package/src/views/main/navbar/navbar.tsx +16 -0
- package/src/views/main/navbar/title.tsx +64 -0
- package/src/views/main/recipient/account.tsx +81 -0
- package/src/views/main/recipient/recipient.tsx +64 -0
- package/src/views/main/token-selector.tsx +77 -0
- package/src/views/qr-code.tsx +14 -0
- package/src/views/render-view.tsx +28 -0
- package/src/views/select-chain/chain-type-meta.ts +37 -0
- package/src/views/select-chain/select-chain-view.tsx +97 -0
- package/src/views/select-token.tsx +227 -0
- package/src/views/transaction-history/activity-list-item.tsx +87 -0
- package/src/views/transaction-history/transaction-history-view.tsx +58 -0
- package/src/views/transaction-progress/helpers.tsx +93 -0
- package/src/views/transaction-progress/transaction-progress-view.tsx +217 -0
- package/src/views/transaction-progress/use-transaction-progress.ts +112 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
interface TokenListItemProps extends React.ComponentProps<"button"> {
|
|
2
|
+
icon: string;
|
|
3
|
+
chainIcon?: string;
|
|
4
|
+
symbol: string;
|
|
5
|
+
name: string;
|
|
6
|
+
balance?: string;
|
|
7
|
+
price: number;
|
|
8
|
+
usdValue?: number;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
isLoadingBalance?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare function TokenListItem({ icon, chainIcon, symbol, name, balance, price, usdValue, disabled, isLoadingBalance, ...props }: TokenListItemProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function ViewContainer({ className, ...props }: React.ComponentProps<"section">): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const VIEW_TRANSITION_DURATION_MS = 250;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useAutoSelectToken(): void;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Token } from "@0xsquid/squid-types";
|
|
2
|
+
export type TokenWithBalance = Token & {
|
|
3
|
+
balance: string;
|
|
4
|
+
};
|
|
5
|
+
export declare function sortTokensByBalance(tokens: TokenWithBalance[]): TokenWithBalance[];
|
|
6
|
+
export declare function filterTokensByChain(tokens: TokenWithBalance[], chainId: string | null): TokenWithBalance[];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type SwapTransactionHistory } from "@0xsquid/react-hooks";
|
|
2
|
+
import type { ChainData, Token } from "@0xsquid/squid-types";
|
|
3
|
+
import type { FormattedTx, SquidTransaction } from "./types";
|
|
4
|
+
export interface DayGroup {
|
|
5
|
+
day: string;
|
|
6
|
+
transactions: FormattedTx[];
|
|
7
|
+
}
|
|
8
|
+
export declare function toFormattedTx(tx: SquidTransaction, sourceChain: ChainData | undefined): FormattedTx;
|
|
9
|
+
export declare function pendingSwapToFormattedTx(pending: SwapTransactionHistory, findToken: (address?: string, chainId?: string) => Token | undefined, findChain: (chainId: string | undefined) => ChainData | undefined): FormattedTx;
|
|
10
|
+
export declare function groupAndSortByDay(txs: FormattedTx[]): DayGroup[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ChainData } from "@0xsquid/squid-types";
|
|
2
|
+
import type { RouteAction } from "./types";
|
|
3
|
+
export interface ExplorerStatusResponse {
|
|
4
|
+
coralTransactionUrl?: string;
|
|
5
|
+
axelarTransactionUrl?: string;
|
|
6
|
+
transactionUrl?: string;
|
|
7
|
+
toChain?: {
|
|
8
|
+
transactionUrl?: string;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export interface ExplorerInput {
|
|
12
|
+
transactionId?: string;
|
|
13
|
+
routeType?: string;
|
|
14
|
+
sourceTxExplorerUrl?: string;
|
|
15
|
+
statusResponse?: ExplorerStatusResponse;
|
|
16
|
+
actions?: RouteAction[];
|
|
17
|
+
sourceChain?: ChainData | undefined;
|
|
18
|
+
}
|
|
19
|
+
export interface MainExplorer {
|
|
20
|
+
url: string;
|
|
21
|
+
name: string;
|
|
22
|
+
}
|
|
23
|
+
export declare function getMainExplorerUrl(transaction: ExplorerInput): MainExplorer | undefined;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { isChainflipBridgeTransaction } from "@0xsquid/react-hooks";
|
|
2
|
+
export type TransactionStatus = "ongoing" | "success" | "refunded";
|
|
3
|
+
export type RouteAction = NonNullable<Parameters<typeof isChainflipBridgeTransaction>[0]>[number];
|
|
4
|
+
export interface SquidTransactionToken {
|
|
5
|
+
address: string;
|
|
6
|
+
symbol: string;
|
|
7
|
+
decimals: number;
|
|
8
|
+
chainId: string;
|
|
9
|
+
}
|
|
10
|
+
export interface SquidTransaction {
|
|
11
|
+
createdAt: string;
|
|
12
|
+
fromChainId: string;
|
|
13
|
+
toChainId: string;
|
|
14
|
+
transactionId?: string;
|
|
15
|
+
routeType?: string;
|
|
16
|
+
sourceTxExplorerUrl?: string;
|
|
17
|
+
actions?: RouteAction[];
|
|
18
|
+
quote: {
|
|
19
|
+
route: {
|
|
20
|
+
params?: {
|
|
21
|
+
toAddress?: string;
|
|
22
|
+
fromAmount?: string;
|
|
23
|
+
toAmount?: string;
|
|
24
|
+
};
|
|
25
|
+
estimate: {
|
|
26
|
+
fromAmount: string;
|
|
27
|
+
fromToken: SquidTransactionToken;
|
|
28
|
+
toAmount: string;
|
|
29
|
+
toToken: SquidTransactionToken;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
statusResponse: {
|
|
34
|
+
squidTransactionStatus: TransactionStatus;
|
|
35
|
+
coralTransactionUrl?: string;
|
|
36
|
+
axelarTransactionUrl?: string;
|
|
37
|
+
transactionUrl?: string;
|
|
38
|
+
fromChain?: {
|
|
39
|
+
transactionUrl?: string;
|
|
40
|
+
};
|
|
41
|
+
toChain?: {
|
|
42
|
+
transactionUrl?: string;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
export interface FormattedTx {
|
|
47
|
+
fromToken: {
|
|
48
|
+
symbol: string;
|
|
49
|
+
logo: string;
|
|
50
|
+
};
|
|
51
|
+
fromChain: {
|
|
52
|
+
logo: string;
|
|
53
|
+
};
|
|
54
|
+
toToken: {
|
|
55
|
+
symbol: string;
|
|
56
|
+
};
|
|
57
|
+
fromAmount: string;
|
|
58
|
+
toAmount: string;
|
|
59
|
+
timestamp: string;
|
|
60
|
+
status: TransactionStatus;
|
|
61
|
+
explorer?: {
|
|
62
|
+
url: string;
|
|
63
|
+
name: string;
|
|
64
|
+
};
|
|
65
|
+
id: string;
|
|
66
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { DepositConfig } from "../types";
|
|
2
|
+
interface DepositState {
|
|
3
|
+
config: DepositConfig | null;
|
|
4
|
+
setConfig: (config: DepositConfig) => void;
|
|
5
|
+
}
|
|
6
|
+
export declare const useDepositStore: import("zustand").UseBoundStore<import("zustand").StoreApi<DepositState>>;
|
|
7
|
+
export declare const useIsPaymentMode: () => boolean;
|
|
8
|
+
export declare const usePaymentAmount: () => string | null;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { WidgetView } from "../types";
|
|
2
|
+
export type NavigationDirection = "forward" | "backward";
|
|
3
|
+
interface WidgetNavigationState {
|
|
4
|
+
stack: WidgetView[];
|
|
5
|
+
direction: NavigationDirection | null;
|
|
6
|
+
push: (_view: WidgetView) => void;
|
|
7
|
+
pop: () => void;
|
|
8
|
+
popToRoot: () => void;
|
|
9
|
+
}
|
|
10
|
+
export declare const selectCurrentView: (state: WidgetNavigationState) => WidgetView;
|
|
11
|
+
export declare const useRouter: import("zustand").UseBoundStore<import("zustand").StoreApi<WidgetNavigationState>>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { Wallet } from "@0xsquid/react-hooks";
|
|
2
|
+
import type { ChainType } from "@0xsquid/squid-types";
|
|
3
|
+
import type { Theme, ThemeType } from "@0xsquid/ui";
|
|
4
|
+
export type WidgetView = {
|
|
5
|
+
id: "main";
|
|
6
|
+
} | {
|
|
7
|
+
id: "connect-wallet";
|
|
8
|
+
chainType: ChainType | null;
|
|
9
|
+
} | {
|
|
10
|
+
id: "select-chain";
|
|
11
|
+
wallet: Wallet;
|
|
12
|
+
} | {
|
|
13
|
+
id: "qr-code";
|
|
14
|
+
} | {
|
|
15
|
+
id: "select-token";
|
|
16
|
+
} | {
|
|
17
|
+
id: "transaction-history";
|
|
18
|
+
} | {
|
|
19
|
+
id: "transaction-progress";
|
|
20
|
+
};
|
|
21
|
+
export type WidgetViewId = WidgetView["id"];
|
|
22
|
+
interface BaseDepositConfig {
|
|
23
|
+
destinationAddress: string;
|
|
24
|
+
destinationToken: {
|
|
25
|
+
address: string;
|
|
26
|
+
chainId: string;
|
|
27
|
+
};
|
|
28
|
+
integrator: {
|
|
29
|
+
id: string;
|
|
30
|
+
name: string;
|
|
31
|
+
logoUrl: string;
|
|
32
|
+
};
|
|
33
|
+
apiUrl?: string;
|
|
34
|
+
theme?: Theme;
|
|
35
|
+
themeType?: ThemeType;
|
|
36
|
+
}
|
|
37
|
+
export type DepositConfig = (BaseDepositConfig & {
|
|
38
|
+
mode: "deposit";
|
|
39
|
+
}) | (BaseDepositConfig & {
|
|
40
|
+
mode: "payment";
|
|
41
|
+
amount: string;
|
|
42
|
+
});
|
|
43
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { SwapTransactionHistory } from "@0xsquid/react-hooks";
|
|
2
|
+
import { SquidTransaction } from "../services/wallet-history/types";
|
|
3
|
+
import type { DepositConfig } from "../types";
|
|
4
|
+
export declare function isSameTx(tx: SquidTransaction, pending: SwapTransactionHistory): boolean;
|
|
5
|
+
export declare function isSameAddress(a: string, b: string): boolean;
|
|
6
|
+
export declare function matchesDestinationToken(toToken: {
|
|
7
|
+
address: string;
|
|
8
|
+
chainId: string;
|
|
9
|
+
}, destinationToken: DepositConfig["destinationToken"]): boolean;
|
|
10
|
+
export declare function isPaymentTx(tx: SquidTransaction, paymentAmount: string, destinationTokenDecimals: number): boolean;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Wallet } from "@0xsquid/react-hooks";
|
|
2
|
+
interface WalletListItemProps extends React.ComponentProps<"button"> {
|
|
3
|
+
wallet: Wallet;
|
|
4
|
+
isConnecting?: boolean;
|
|
5
|
+
showAsMultiChain?: boolean;
|
|
6
|
+
parentProps?: React.ComponentProps<"li">;
|
|
7
|
+
}
|
|
8
|
+
export declare function WalletListItem({ wallet, isConnecting, showAsMultiChain, parentProps, ...props }: WalletListItemProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { NumericInputProps } from "@0xsquid/ui";
|
|
2
|
+
interface AmountInputProps extends NumericInputProps {
|
|
3
|
+
allowMaxButton?: boolean;
|
|
4
|
+
readOnly?: boolean;
|
|
5
|
+
errorMessage?: string;
|
|
6
|
+
loading?: boolean;
|
|
7
|
+
forcedUsdDisplay?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function AmountInput({ balance, token, onAmountChange, forcedAmount, maxUsdDecimals, formatIfVerySmall, inputModeButton, debounceInput, allowMaxButton, readOnly, errorMessage, loading, forcedUsdDisplay, }: AmountInputProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function ConnectPrompt(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function DepositAmountInput(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function DepositForm(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function MainCTAButton(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function MainView(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function Actions(): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function Icon(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function NavBar(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare function Title(): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
interface TitleLabelInput {
|
|
3
|
+
isPaymentMode: boolean;
|
|
4
|
+
paymentAmount: string | null;
|
|
5
|
+
tokenSymbol: string | undefined;
|
|
6
|
+
tokenUsdPrice: number | undefined;
|
|
7
|
+
name: string | undefined;
|
|
8
|
+
}
|
|
9
|
+
export declare function buildTitleLabel({ isPaymentMode, paymentAmount, tokenSymbol, tokenUsdPrice, name, }: TitleLabelInput): string;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
interface AccountProps {
|
|
2
|
+
direction: "from" | "to";
|
|
3
|
+
name: string;
|
|
4
|
+
address: string;
|
|
5
|
+
icon?: string;
|
|
6
|
+
onDisconnect?: () => void;
|
|
7
|
+
}
|
|
8
|
+
export declare function Account({ direction, address, name, icon, onDisconnect, }: AccountProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
interface AvatarProps {
|
|
10
|
+
icon?: string;
|
|
11
|
+
onDisconnect?: () => void;
|
|
12
|
+
}
|
|
13
|
+
export declare function Avatar({ icon, onDisconnect }: AvatarProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function Recipient(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function TokenSelector(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function QrCodeView(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function SelectTokenView(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { FormattedTx } from "../../services/wallet-history/types";
|
|
2
|
+
type Props = FormattedTx;
|
|
3
|
+
export declare function ActivityListItem({ fromAmount, fromToken, fromChain, toAmount, toToken, timestamp, status, explorer, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function TransactionHistoryView(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { DepositStatus } from "./use-transaction-progress";
|
|
2
|
+
export declare function getStatusTitle(status: DepositStatus, isPaymentMode: boolean): string;
|
|
3
|
+
export declare function getStatusDescription(status: DepositStatus, { amount, symbol, recipientName, isPaymentMode, }: {
|
|
4
|
+
amount: string;
|
|
5
|
+
symbol: string;
|
|
6
|
+
recipientName: string;
|
|
7
|
+
isPaymentMode: boolean;
|
|
8
|
+
}): string;
|
|
9
|
+
export declare function getButtonLabel(status: DepositStatus): string;
|
|
10
|
+
export declare function TimeDetail({ status, timer, estimatedTimeDisplay, }: {
|
|
11
|
+
status: DepositStatus;
|
|
12
|
+
timer: string;
|
|
13
|
+
estimatedTimeDisplay: string | undefined;
|
|
14
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function TransactionProgressView(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare enum DepositStatus {
|
|
2
|
+
CONFIRMING = 0,
|
|
3
|
+
PROCESSING = 1,
|
|
4
|
+
COMPLETED = 2,
|
|
5
|
+
PARTIAL_SUCCESS = 3,
|
|
6
|
+
REJECTED = 4,
|
|
7
|
+
FAILED = 5
|
|
8
|
+
}
|
|
9
|
+
export declare function useTransactionProgress(): {
|
|
10
|
+
status: DepositStatus;
|
|
11
|
+
explorerLink: import("../../services/wallet-history/get-main-explorer-url").MainExplorer | undefined;
|
|
12
|
+
estimatedTime: string | undefined;
|
|
13
|
+
recipient: {
|
|
14
|
+
name: string;
|
|
15
|
+
address: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@0xsquid/deposit-widget",
|
|
3
|
+
"description": "Squid deposit widget",
|
|
4
|
+
"version": "0.1.0-beta.0",
|
|
5
|
+
"author": "",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/0xsquid/squid-deposit-widget.git"
|
|
11
|
+
},
|
|
12
|
+
"main": "dist/cjs/index.cjs",
|
|
13
|
+
"module": "dist/index.esm.js",
|
|
14
|
+
"types": "dist/index.d.ts",
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"import": "./dist/index.esm.js",
|
|
19
|
+
"require": "./dist/cjs/index.cjs"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"dist",
|
|
24
|
+
"src"
|
|
25
|
+
],
|
|
26
|
+
"scripts": {
|
|
27
|
+
"build": "yarn build-css && rollup -c",
|
|
28
|
+
"build-css": "tailwindcss -i ./src/tailwind.css -o ./src/compiled-tailwind.css",
|
|
29
|
+
"dev": "tailwindcss -i ./src/tailwind.css -o ./src/compiled-tailwind.css --watch",
|
|
30
|
+
"check-types": "tsc --noEmit",
|
|
31
|
+
"lint": "eslint",
|
|
32
|
+
"format": "prettier --write .",
|
|
33
|
+
"test": "vitest run",
|
|
34
|
+
"release": "release-it",
|
|
35
|
+
"release:pre": "release-it --preRelease=beta",
|
|
36
|
+
"release:ci": "release-it --ci",
|
|
37
|
+
"release:dry": "release-it --dry-run"
|
|
38
|
+
},
|
|
39
|
+
"release-it": {
|
|
40
|
+
"plugins": {
|
|
41
|
+
"@release-it/conventional-changelog": {
|
|
42
|
+
"preset": {
|
|
43
|
+
"name": "conventionalcommits"
|
|
44
|
+
},
|
|
45
|
+
"infile": "CHANGELOG.md"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"github": {
|
|
49
|
+
"release": true,
|
|
50
|
+
"tokenRef": "GITHUB_AUTH"
|
|
51
|
+
},
|
|
52
|
+
"git": {
|
|
53
|
+
"tagName": "v${version}",
|
|
54
|
+
"pushRepo": "https://github.com/0xsquid/squid-deposit-widget.git",
|
|
55
|
+
"commitMessage": "chore: branch cut release for deposit-widget v${version}",
|
|
56
|
+
"requireBranch": "release/*"
|
|
57
|
+
},
|
|
58
|
+
"npm": {
|
|
59
|
+
"publish": false
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"dependencies": {
|
|
63
|
+
"@0xsquid/react-hooks": "8.7.2-beta-interactive-to-amount.2",
|
|
64
|
+
"@0xsquid/ui": "3.4.0",
|
|
65
|
+
"fuse.js": "7.1.0",
|
|
66
|
+
"react-window": "2.2.7",
|
|
67
|
+
"zustand": "4.5.4"
|
|
68
|
+
},
|
|
69
|
+
"peerDependencies": {
|
|
70
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
71
|
+
"react-dom": "^18.0.0 || ^19.0.0"
|
|
72
|
+
},
|
|
73
|
+
"devDependencies": {
|
|
74
|
+
"@0xsquid/eslint-config": "*",
|
|
75
|
+
"@0xsquid/squid-types": "0.1.220",
|
|
76
|
+
"@0xsquid/typescript-config": "*",
|
|
77
|
+
"@rollup/plugin-commonjs": "28.0.0",
|
|
78
|
+
"@rollup/plugin-node-resolve": "15.0.0",
|
|
79
|
+
"@rollup/plugin-typescript": "12.0.0",
|
|
80
|
+
"@types/react": "^18.3.0",
|
|
81
|
+
"@types/react-dom": "^18.3.0",
|
|
82
|
+
"@types/react-window": "2.0.0",
|
|
83
|
+
"@release-it/conventional-changelog": "8.0.2-next.0",
|
|
84
|
+
"autoprefixer": "10.4.20",
|
|
85
|
+
"postcss": "8.4.0",
|
|
86
|
+
"postcss-nested": "6.2.0",
|
|
87
|
+
"postcss-url": "10.1.3",
|
|
88
|
+
"react": "^18.3.0",
|
|
89
|
+
"react-dom": "^18.3.0",
|
|
90
|
+
"release-it": "16.3.0",
|
|
91
|
+
"rollup": "4.59.0",
|
|
92
|
+
"rollup-plugin-dts": "6.0.0",
|
|
93
|
+
"rollup-plugin-peer-deps-external": "2.2.4",
|
|
94
|
+
"rollup-plugin-postcss": "4.0.2",
|
|
95
|
+
"tailwindcss": "3.4.1",
|
|
96
|
+
"typescript": "5.9.2",
|
|
97
|
+
"vitest": "2.1.9"
|
|
98
|
+
}
|
|
99
|
+
}
|