@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
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Wallet } from '@0xsquid/react-hooks';
|
|
3
|
+
import { ChainType } from '@0xsquid/squid-types';
|
|
4
|
+
import { Theme, ThemeType } from '@0xsquid/ui';
|
|
5
|
+
export { Theme, ThemeType } from '@0xsquid/ui';
|
|
6
|
+
|
|
7
|
+
type WidgetView = {
|
|
8
|
+
id: "main";
|
|
9
|
+
} | {
|
|
10
|
+
id: "connect-wallet";
|
|
11
|
+
chainType: ChainType | null;
|
|
12
|
+
} | {
|
|
13
|
+
id: "select-chain";
|
|
14
|
+
wallet: Wallet;
|
|
15
|
+
} | {
|
|
16
|
+
id: "qr-code";
|
|
17
|
+
} | {
|
|
18
|
+
id: "select-token";
|
|
19
|
+
} | {
|
|
20
|
+
id: "transaction-history";
|
|
21
|
+
} | {
|
|
22
|
+
id: "transaction-progress";
|
|
23
|
+
};
|
|
24
|
+
type WidgetViewId = WidgetView["id"];
|
|
25
|
+
interface BaseDepositConfig {
|
|
26
|
+
destinationAddress: string;
|
|
27
|
+
destinationToken: {
|
|
28
|
+
address: string;
|
|
29
|
+
chainId: string;
|
|
30
|
+
};
|
|
31
|
+
integrator: {
|
|
32
|
+
id: string;
|
|
33
|
+
name: string;
|
|
34
|
+
logoUrl: string;
|
|
35
|
+
};
|
|
36
|
+
apiUrl?: string;
|
|
37
|
+
theme?: Theme;
|
|
38
|
+
themeType?: ThemeType;
|
|
39
|
+
}
|
|
40
|
+
type DepositConfig = (BaseDepositConfig & {
|
|
41
|
+
mode: "deposit";
|
|
42
|
+
}) | (BaseDepositConfig & {
|
|
43
|
+
mode: "payment";
|
|
44
|
+
amount: string;
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
interface DepositWidgetProps {
|
|
48
|
+
config: DepositConfig;
|
|
49
|
+
}
|
|
50
|
+
declare function DepositWidget({ config, }: DepositWidgetProps): React.ReactElement;
|
|
51
|
+
|
|
52
|
+
export { type DepositConfig, DepositWidget, type WidgetView, type WidgetViewId };
|