@0xsquid/deposit-widget 0.0.2-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.
Files changed (62) hide show
  1. package/dist/cjs/index.cjs +4062 -0
  2. package/dist/cjs/index.cjs.map +1 -0
  3. package/dist/index.d.ts +52 -0
  4. package/dist/index.esm.js +4042 -0
  5. package/dist/index.esm.js.map +1 -0
  6. package/dist/types/DepositWidget.d.ts +8 -0
  7. package/dist/types/components/ViewTransition.d.ts +8 -0
  8. package/dist/types/components/shared/buttons/button.d.ts +4 -0
  9. package/dist/types/components/shared/icons/types.d.ts +4 -0
  10. package/dist/types/components/shared/icons/user-round.d.ts +3 -0
  11. package/dist/types/components/shared/navigation/base-navbar.d.ts +4 -0
  12. package/dist/types/components/shared/navigation/sub-navbar.d.ts +7 -0
  13. package/dist/types/components/token-badge-icon.d.ts +7 -0
  14. package/dist/types/components/token-list-item.d.ts +14 -0
  15. package/dist/types/components/view-container.d.ts +2 -0
  16. package/dist/types/constants.d.ts +2 -0
  17. package/dist/types/hooks/ui/useMainCTAButtonState.d.ts +9 -0
  18. package/dist/types/hooks/use-auto-select-token.d.ts +2 -0
  19. package/dist/types/hooks/use-deposit-route.d.ts +8 -0
  20. package/dist/types/hooks/use-token-selection.d.ts +6 -0
  21. package/dist/types/hooks/use-transaction-history.d.ts +7 -0
  22. package/dist/types/index.d.ts +4 -0
  23. package/dist/types/services/assets-service.d.ts +7 -0
  24. package/dist/types/services/wallet-history/format.d.ts +11 -0
  25. package/dist/types/services/wallet-history/format.test.d.ts +2 -0
  26. package/dist/types/services/wallet-history/get-main-explorer-url.d.ts +24 -0
  27. package/dist/types/services/wallet-history/get-wallet-history.d.ts +3 -0
  28. package/dist/types/services/wallet-history/types.d.ts +67 -0
  29. package/dist/types/services/wallet-history/validation.d.ts +3 -0
  30. package/dist/types/store/use-deposit-store.d.ts +10 -0
  31. package/dist/types/store/use-input-mode.d.ts +6 -0
  32. package/dist/types/store/useRouter.d.ts +13 -0
  33. package/dist/types/types.d.ts +44 -0
  34. package/dist/types/utils/format-date.d.ts +3 -0
  35. package/dist/types/utils/format-date.test.d.ts +2 -0
  36. package/dist/types/utils/transaction.d.ts +11 -0
  37. package/dist/types/views/connect-wallet/connect-wallet-view.d.ts +7 -0
  38. package/dist/types/views/connect-wallet/wallet-list-item.d.ts +10 -0
  39. package/dist/types/views/main/amount-input.d.ts +11 -0
  40. package/dist/types/views/main/connect-prompt.d.ts +2 -0
  41. package/dist/types/views/main/deposit-amount-input.d.ts +2 -0
  42. package/dist/types/views/main/deposit-form.d.ts +2 -0
  43. package/dist/types/views/main/main-cta-button.d.ts +2 -0
  44. package/dist/types/views/main/main-view.d.ts +2 -0
  45. package/dist/types/views/main/navbar/actions.d.ts +2 -0
  46. package/dist/types/views/main/navbar/icon.d.ts +2 -0
  47. package/dist/types/views/main/navbar/navbar.d.ts +2 -0
  48. package/dist/types/views/main/navbar/title.d.ts +11 -0
  49. package/dist/types/views/main/recipient/account.d.ts +15 -0
  50. package/dist/types/views/main/recipient/recipient.d.ts +2 -0
  51. package/dist/types/views/main/token-selector.d.ts +2 -0
  52. package/dist/types/views/qr-code.d.ts +2 -0
  53. package/dist/types/views/render-view.d.ts +4 -0
  54. package/dist/types/views/select-chain/chain-type-meta.d.ts +8 -0
  55. package/dist/types/views/select-chain/select-chain-view.d.ts +7 -0
  56. package/dist/types/views/select-token.d.ts +2 -0
  57. package/dist/types/views/transaction-history/activity-list-item.d.ts +5 -0
  58. package/dist/types/views/transaction-history/transaction-history-view.d.ts +2 -0
  59. package/dist/types/views/transaction-progress/helpers.d.ts +15 -0
  60. package/dist/types/views/transaction-progress/transaction-progress-view.d.ts +2 -0
  61. package/dist/types/views/transaction-progress/use-transaction-progress.d.ts +18 -0
  62. package/package.json +102 -0
@@ -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 };