@tezos-x/octez.connect-ui 0.9.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 (126) hide show
  1. package/LICENCE +19 -0
  2. package/README.md +9 -0
  3. package/dist/bundle.js +60 -0
  4. package/dist/bundle.js.map +1 -0
  5. package/dist/cjs/components/alert/index.d.ts +4 -0
  6. package/dist/cjs/components/bug-report-form/index.d.ts +5 -0
  7. package/dist/cjs/components/button-icon/button-icon.d.ts +9 -0
  8. package/dist/cjs/components/icons/index.d.ts +8 -0
  9. package/dist/cjs/components/info/index.d.ts +4 -0
  10. package/dist/cjs/components/loader/index.d.ts +3 -0
  11. package/dist/cjs/components/pair-other/index.d.ts +4 -0
  12. package/dist/cjs/components/pairing.d.ts +51 -0
  13. package/dist/cjs/components/qr/index.d.ts +4 -0
  14. package/dist/cjs/components/toast/hooks/useDrag.d.ts +6 -0
  15. package/dist/cjs/components/toast/index.d.ts +4 -0
  16. package/dist/cjs/components/top-wallets/index.d.ts +4 -0
  17. package/dist/cjs/components/wallet/index.d.ts +4 -0
  18. package/dist/cjs/components/wallets/index.d.ts +4 -0
  19. package/dist/cjs/index.d.ts +6 -0
  20. package/dist/cjs/index.js +60 -0
  21. package/dist/cjs/index.js.map +1 -0
  22. package/dist/cjs/ui/alert/alert-templates.d.ts +8 -0
  23. package/dist/cjs/ui/alert/components/info-alert/index.d.ts +3 -0
  24. package/dist/cjs/ui/alert/components/pairing-alert/components/mobile-pairing/index.d.ts +2 -0
  25. package/dist/cjs/ui/alert/components/pairing-alert/components/mobile-pairing/utils/suffix-map.d.ts +2 -0
  26. package/dist/cjs/ui/alert/components/pairing-alert/components/qr-code/index.d.ts +3 -0
  27. package/dist/cjs/ui/alert/components/pairing-alert/components/wc-init-error/index.d.ts +3 -0
  28. package/dist/cjs/ui/alert/components/pairing-alert/index.d.ts +3 -0
  29. package/dist/cjs/ui/alert/getDefautlLogo.d.ts +1 -0
  30. package/dist/cjs/ui/alert/hooks/useConnect.d.ts +4 -0
  31. package/dist/cjs/ui/alert/hooks/useIsMobile.d.ts +2 -0
  32. package/dist/cjs/ui/alert/hooks/useSubstrateWallets.d.ts +3 -0
  33. package/dist/cjs/ui/alert/hooks/useWallets.d.ts +3 -0
  34. package/dist/cjs/ui/alert/index.d.ts +9 -0
  35. package/dist/cjs/ui/alert/substrate-wallet-lists.d.ts +5 -0
  36. package/dist/cjs/ui/alert/wallet-lists.d.ts +5 -0
  37. package/dist/cjs/ui/common.d.ts +158 -0
  38. package/dist/cjs/ui/toast/index.d.ts +4 -0
  39. package/dist/cjs/ui/toast/toast-templates.d.ts +5 -0
  40. package/dist/cjs/utils/colorMode.d.ts +3 -0
  41. package/dist/cjs/utils/get-tzip10-link.d.ts +1 -0
  42. package/dist/cjs/utils/platform.d.ts +11 -0
  43. package/dist/cjs/utils/qr.d.ts +7 -0
  44. package/dist/cjs/utils/subject.d.ts +9 -0
  45. package/dist/cjs/utils/wallets.d.ts +33 -0
  46. package/dist/components/alert/index.d.ts +4 -0
  47. package/dist/components/bug-report-form/index.d.ts +5 -0
  48. package/dist/components/button-icon/button-icon.d.ts +9 -0
  49. package/dist/components/icons/index.d.ts +8 -0
  50. package/dist/components/info/index.d.ts +4 -0
  51. package/dist/components/loader/index.d.ts +3 -0
  52. package/dist/components/pair-other/index.d.ts +4 -0
  53. package/dist/components/pairing.d.ts +51 -0
  54. package/dist/components/qr/index.d.ts +4 -0
  55. package/dist/components/toast/hooks/useDrag.d.ts +6 -0
  56. package/dist/components/toast/index.d.ts +4 -0
  57. package/dist/components/top-wallets/index.d.ts +4 -0
  58. package/dist/components/wallet/index.d.ts +4 -0
  59. package/dist/components/wallets/index.d.ts +4 -0
  60. package/dist/esm/components/alert/index.d.ts +4 -0
  61. package/dist/esm/components/bug-report-form/index.d.ts +5 -0
  62. package/dist/esm/components/button-icon/button-icon.d.ts +9 -0
  63. package/dist/esm/components/icons/index.d.ts +8 -0
  64. package/dist/esm/components/info/index.d.ts +4 -0
  65. package/dist/esm/components/loader/index.d.ts +3 -0
  66. package/dist/esm/components/pair-other/index.d.ts +4 -0
  67. package/dist/esm/components/pairing.d.ts +51 -0
  68. package/dist/esm/components/qr/index.d.ts +4 -0
  69. package/dist/esm/components/toast/hooks/useDrag.d.ts +6 -0
  70. package/dist/esm/components/toast/index.d.ts +4 -0
  71. package/dist/esm/components/top-wallets/index.d.ts +4 -0
  72. package/dist/esm/components/wallet/index.d.ts +4 -0
  73. package/dist/esm/components/wallets/index.d.ts +4 -0
  74. package/dist/esm/index.d.ts +6 -0
  75. package/dist/esm/index.js +60 -0
  76. package/dist/esm/index.js.map +1 -0
  77. package/dist/esm/ui/alert/alert-templates.d.ts +8 -0
  78. package/dist/esm/ui/alert/components/info-alert/index.d.ts +3 -0
  79. package/dist/esm/ui/alert/components/pairing-alert/components/mobile-pairing/index.d.ts +2 -0
  80. package/dist/esm/ui/alert/components/pairing-alert/components/mobile-pairing/utils/suffix-map.d.ts +2 -0
  81. package/dist/esm/ui/alert/components/pairing-alert/components/qr-code/index.d.ts +3 -0
  82. package/dist/esm/ui/alert/components/pairing-alert/components/wc-init-error/index.d.ts +3 -0
  83. package/dist/esm/ui/alert/components/pairing-alert/index.d.ts +3 -0
  84. package/dist/esm/ui/alert/getDefautlLogo.d.ts +1 -0
  85. package/dist/esm/ui/alert/hooks/useConnect.d.ts +4 -0
  86. package/dist/esm/ui/alert/hooks/useIsMobile.d.ts +2 -0
  87. package/dist/esm/ui/alert/hooks/useSubstrateWallets.d.ts +3 -0
  88. package/dist/esm/ui/alert/hooks/useWallets.d.ts +3 -0
  89. package/dist/esm/ui/alert/index.d.ts +9 -0
  90. package/dist/esm/ui/alert/substrate-wallet-lists.d.ts +5 -0
  91. package/dist/esm/ui/alert/wallet-lists.d.ts +5 -0
  92. package/dist/esm/ui/common.d.ts +158 -0
  93. package/dist/esm/ui/toast/index.d.ts +4 -0
  94. package/dist/esm/ui/toast/toast-templates.d.ts +5 -0
  95. package/dist/esm/utils/colorMode.d.ts +3 -0
  96. package/dist/esm/utils/get-tzip10-link.d.ts +1 -0
  97. package/dist/esm/utils/platform.d.ts +11 -0
  98. package/dist/esm/utils/qr.d.ts +7 -0
  99. package/dist/esm/utils/subject.d.ts +9 -0
  100. package/dist/esm/utils/wallets.d.ts +33 -0
  101. package/dist/index.d.ts +6 -0
  102. package/dist/ui/alert/alert-templates.d.ts +8 -0
  103. package/dist/ui/alert/components/info-alert/index.d.ts +3 -0
  104. package/dist/ui/alert/components/pairing-alert/components/mobile-pairing/index.d.ts +2 -0
  105. package/dist/ui/alert/components/pairing-alert/components/mobile-pairing/utils/suffix-map.d.ts +2 -0
  106. package/dist/ui/alert/components/pairing-alert/components/qr-code/index.d.ts +3 -0
  107. package/dist/ui/alert/components/pairing-alert/components/wc-init-error/index.d.ts +3 -0
  108. package/dist/ui/alert/components/pairing-alert/index.d.ts +3 -0
  109. package/dist/ui/alert/getDefautlLogo.d.ts +1 -0
  110. package/dist/ui/alert/hooks/useConnect.d.ts +4 -0
  111. package/dist/ui/alert/hooks/useIsMobile.d.ts +2 -0
  112. package/dist/ui/alert/hooks/useSubstrateWallets.d.ts +3 -0
  113. package/dist/ui/alert/hooks/useWallets.d.ts +3 -0
  114. package/dist/ui/alert/index.d.ts +9 -0
  115. package/dist/ui/alert/substrate-wallet-lists.d.ts +5 -0
  116. package/dist/ui/alert/wallet-lists.d.ts +5 -0
  117. package/dist/ui/common.d.ts +158 -0
  118. package/dist/ui/toast/index.d.ts +4 -0
  119. package/dist/ui/toast/toast-templates.d.ts +5 -0
  120. package/dist/utils/colorMode.d.ts +3 -0
  121. package/dist/utils/get-tzip10-link.d.ts +1 -0
  122. package/dist/utils/platform.d.ts +11 -0
  123. package/dist/utils/qr.d.ts +7 -0
  124. package/dist/utils/subject.d.ts +9 -0
  125. package/dist/utils/wallets.d.ts +33 -0
  126. package/package.json +70 -0
@@ -0,0 +1,8 @@
1
+ export declare const alertTemplates: {
2
+ default: {
3
+ css: string;
4
+ };
5
+ pair: {
6
+ css: string;
7
+ };
8
+ };
@@ -0,0 +1,3 @@
1
+ import { ConfigurableAlertProps } from '../../../common';
2
+ declare const InfoAlert: ({ title, body, data, open, onClose, closeOnBackdropClick }: ConfigurableAlertProps) => import("react/jsx-runtime").JSX.Element;
3
+ export default InfoAlert;
@@ -0,0 +1,2 @@
1
+ declare const MobilePairing: React.FC<any>;
2
+ export default MobilePairing;
@@ -0,0 +1,2 @@
1
+ declare const suffixMap: Map<string, string>;
2
+ export default suffixMap;
@@ -0,0 +1,3 @@
1
+ import { QRCodeProps } from '../../../../../common';
2
+ declare const QRCode: React.FC<QRCodeProps>;
3
+ export default QRCode;
@@ -0,0 +1,3 @@
1
+ import { WCInitErrorProps } from '../../../../../common';
2
+ declare const WCInitError: React.FC<WCInitErrorProps>;
3
+ export default WCInitError;
@@ -0,0 +1,3 @@
1
+ import { ConfigurableAlertProps } from '../../../common';
2
+ declare const PairingAlert: React.FC<ConfigurableAlertProps>;
3
+ export default PairingAlert;
@@ -0,0 +1 @@
1
+ export default function getDefaultLogo(): string;
@@ -0,0 +1,4 @@
1
+ import { MergedWallet } from '../../../utils/wallets';
2
+ import { AlertConfig, AlertState } from '../../common';
3
+ declare const useConnect: (isMobile: boolean, wcPayload: Promise<string>, p2pPayload: Promise<string>, postPayload: Promise<string>, wallets: Map<string, MergedWallet>, onCloseHandler: Function) => readonly [MergedWallet | undefined, boolean, string | undefined, AlertState, boolean, boolean, boolean, (id: string, config: AlertConfig) => Promise<void>, (config: AlertConfig, wallet: MergedWallet) => Promise<void>, (wallet: MergedWallet) => Promise<void>, () => void, () => Promise<void>, () => void, () => Promise<void>, () => void, (newState: AlertState) => void, (uri: string) => void, () => void, (show: boolean) => void, (isLoading: boolean) => void];
4
+ export default useConnect;
@@ -0,0 +1,2 @@
1
+ declare const useIsMobile: (breakpoint?: number) => boolean;
2
+ export default useIsMobile;
@@ -0,0 +1,3 @@
1
+ import { NetworkType } from '@tezos-x/octez.connect-types';
2
+ declare const useSubstrateWallets: (networkType?: NetworkType, featuredWallets?: string[]) => Map<string, import("../../../utils/wallets").MergedWallet>;
3
+ export default useSubstrateWallets;
@@ -0,0 +1,3 @@
1
+ import { NetworkType } from '@tezos-x/octez.connect-types';
2
+ declare const useWallets: (networkType?: NetworkType, featuredWallets?: string[]) => Map<string, import("../../../utils/wallets").MergedWallet>;
3
+ export default useWallets;
@@ -0,0 +1,9 @@
1
+ import { AlertConfig } from '../common';
2
+ declare const openAlert: (config: AlertConfig) => void;
3
+ declare const openBugReport: () => void;
4
+ declare const closeAlert: () => void;
5
+ /**
6
+ * @deprecated use `closeAlert` instead
7
+ */
8
+ declare const closeAlerts: () => void;
9
+ export { openAlert, openBugReport, closeAlert, closeAlerts };
@@ -0,0 +1,5 @@
1
+ import { App, DesktopApp, ExtensionApp, WebApp } from '@tezos-x/octez.connect-types';
2
+ export declare const extensionList: ExtensionApp[];
3
+ export declare const desktopList: DesktopApp[];
4
+ export declare const webList: WebApp[];
5
+ export declare const iOSList: App[];
@@ -0,0 +1,5 @@
1
+ import { App, DesktopApp, ExtensionApp, WebApp } from '@tezos-x/octez.connect-types';
2
+ export declare const extensionList: ExtensionApp[];
3
+ export declare const desktopList: DesktopApp[];
4
+ export declare const webList: WebApp[];
5
+ export declare const iOSList: App[];
@@ -0,0 +1,158 @@
1
+ import { NetworkType, AnalyticsInterface, WalletInfo } from '@tezos-x/octez.connect-types';
2
+ import { MergedWallet } from '../utils/wallets';
3
+ export declare enum AlertState {
4
+ TOP_WALLETS = "top-wallets",
5
+ WALLETS = "wallets",
6
+ INSTALL = "install",
7
+ BUG_REPORT = "bug-report",
8
+ QR = "qr"
9
+ }
10
+ export interface AlertButton {
11
+ text: string;
12
+ style?: 'solid' | 'outline';
13
+ actionCallback?(): Promise<void>;
14
+ }
15
+ export interface AlertConfig {
16
+ title: string;
17
+ body?: string;
18
+ data?: string;
19
+ timer?: number;
20
+ buttons?: AlertButton[];
21
+ pairingPayload?: PairingPayload;
22
+ closeButtonCallback?: () => void;
23
+ disclaimerText?: string;
24
+ analytics?: AnalyticsInterface;
25
+ featuredWallets?: string[];
26
+ openBugReport?: boolean;
27
+ substratePairing?: boolean;
28
+ }
29
+ export interface ConfigurableAlertProps extends Omit<AlertConfig, 'closeButtonCallback'> {
30
+ open: boolean;
31
+ onClose: () => void;
32
+ closeOnBackdropClick: boolean;
33
+ }
34
+ export interface AlertProps {
35
+ open: boolean;
36
+ showMore?: boolean;
37
+ extraContent?: any;
38
+ loading?: boolean;
39
+ onCloseClick: () => void;
40
+ onClickShowMore?: () => void;
41
+ onBackClick?: () => void;
42
+ closeOnBackdropClick: boolean;
43
+ }
44
+ export interface PairingPayload {
45
+ p2pSyncCode: Promise<string>;
46
+ postmessageSyncCode: Promise<string>;
47
+ walletConnectSyncCode: Promise<string>;
48
+ networkType: NetworkType;
49
+ }
50
+ export interface PairOtherProps {
51
+ walletList: MergedWallet[];
52
+ p2pPayload: Promise<string>;
53
+ wcPayload: Promise<string>;
54
+ onClickLearnMore: () => void;
55
+ }
56
+ export interface QRProps {
57
+ isWalletConnect: boolean;
58
+ isMobile: boolean;
59
+ walletName: string;
60
+ code: string;
61
+ onClickLearnMore?: () => void;
62
+ onClickQrCode?: () => void;
63
+ }
64
+ export interface QRCodeProps {
65
+ wallet?: MergedWallet;
66
+ isWCWorking: boolean;
67
+ isMobile: boolean;
68
+ qrCode?: string;
69
+ defaultPairing: Promise<string>;
70
+ handleUpdateState: (state: AlertState) => void;
71
+ handleIsLoading: (isLoading: boolean) => void;
72
+ }
73
+ export interface WCInitErrorProps {
74
+ title: string;
75
+ handleUpdateState: (state: AlertState) => void;
76
+ }
77
+ export interface InfoProps {
78
+ title: string;
79
+ description?: string;
80
+ data?: string;
81
+ icon?: any;
82
+ border?: boolean;
83
+ iconBadge?: boolean;
84
+ bigIcon?: boolean;
85
+ buttons?: {
86
+ label: string;
87
+ type: 'primary' | 'secondary';
88
+ onClick: () => void;
89
+ }[];
90
+ downloadLink?: {
91
+ url: string;
92
+ label: string;
93
+ };
94
+ onShowQRCodeClick?: (() => void) | (() => Promise<void>);
95
+ }
96
+ export interface TopWalletsProps {
97
+ wallets: MergedWallet[];
98
+ onClickWallet: (id: string) => void;
99
+ onClickLearnMore: () => void;
100
+ otherWallets?: {
101
+ images: string[];
102
+ onClick: () => void;
103
+ };
104
+ disabled?: boolean;
105
+ isMobile: boolean;
106
+ }
107
+ export interface WalletProps {
108
+ name: string;
109
+ image: string;
110
+ description?: string;
111
+ small?: boolean;
112
+ mobile?: boolean;
113
+ onClick: () => void;
114
+ tags?: string[];
115
+ disabled?: boolean;
116
+ }
117
+ export interface WalletsProps {
118
+ wallets: MergedWallet[];
119
+ onClickWallet: (id: string) => void;
120
+ onClickOther: () => void;
121
+ isMobile: boolean;
122
+ small?: boolean;
123
+ disabled?: boolean;
124
+ }
125
+ export interface ToastAction {
126
+ text: string;
127
+ isBold?: boolean;
128
+ actionText?: string;
129
+ actionLogo?: 'external';
130
+ actionCallback?(): Promise<void>;
131
+ }
132
+ export interface ToastConfig {
133
+ body: string;
134
+ timer?: number;
135
+ forceNew?: boolean;
136
+ state: 'prepare' | 'loading' | 'acknowledge' | 'finished';
137
+ actions?: ToastAction[];
138
+ walletInfo?: WalletInfo;
139
+ openWalletAction?(): Promise<void>;
140
+ }
141
+ export interface ToastProps {
142
+ label: string;
143
+ open: boolean;
144
+ onClickClose: () => void;
145
+ actions?: {
146
+ text: string;
147
+ isBold?: boolean;
148
+ actionText?: string;
149
+ actionCallback?: () => void;
150
+ }[];
151
+ walletInfo?: {
152
+ deeplink?: string;
153
+ icon?: string;
154
+ name: string;
155
+ type?: string;
156
+ };
157
+ openWalletAction?: () => void;
158
+ }
@@ -0,0 +1,4 @@
1
+ import { ToastConfig } from '../common';
2
+ declare const openToast: (config: ToastConfig) => void;
3
+ declare const closeToast: () => void;
4
+ export { closeToast, openToast };
@@ -0,0 +1,5 @@
1
+ export declare const toastTemplates: {
2
+ default: {
3
+ css: string;
4
+ };
5
+ };
@@ -0,0 +1,3 @@
1
+ import { ColorMode } from '@tezos-x/octez.connect-types';
2
+ export declare const setColorMode: (mode: ColorMode) => void;
3
+ export declare const getColorMode: () => ColorMode;
@@ -0,0 +1 @@
1
+ export declare const getTzip10Link: (url: string, payload: string) => string;
@@ -0,0 +1,11 @@
1
+ export declare const testUserAgent: (win: Window, expr: RegExp) => boolean;
2
+ export declare const isMobile: (win: Window) => boolean;
3
+ export declare const isBrowser: (win: Window) => boolean;
4
+ export declare const isPrivacyBrowser: (win: Window) => boolean;
5
+ export declare const isIOS: (win: Window) => boolean;
6
+ export declare const isAndroid: (win: Window) => boolean;
7
+ export declare const isTwBrowser: (win: Window) => boolean;
8
+ export declare const isDesktop: (win: Window) => boolean;
9
+ export declare const isMobileOS: (win: Window) => boolean;
10
+ export declare const currentOS: () => string;
11
+ export declare const currentBrowser: () => string;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Convert data to a QR code
3
+ *
4
+ * @param payload The data to be encoded as a QR code
5
+ * @param type How the QR code will be encoded
6
+ */
7
+ export declare const getQrData: (payload: string, height?: number, width?: number) => string;
@@ -0,0 +1,9 @@
1
+ export interface Subscription {
2
+ unsubscribe: () => void;
3
+ }
4
+ export declare class Subject<T> {
5
+ private subscribers;
6
+ subscribe(callback: (value: T) => void): Subscription;
7
+ private unsubscribe;
8
+ next(value: T): void;
9
+ }
@@ -0,0 +1,33 @@
1
+ export interface Wallet {
2
+ id: string;
3
+ key: string;
4
+ name: string;
5
+ image: string;
6
+ description: string;
7
+ type: string;
8
+ link: string;
9
+ supportedInteractionStandards?: ('wallet_connect' | 'beacon')[];
10
+ deepLink?: string;
11
+ }
12
+ export interface MergedWallet {
13
+ id: string;
14
+ firefoxId?: string;
15
+ key: string;
16
+ name: string;
17
+ image: string;
18
+ descriptions: string[];
19
+ types: string[];
20
+ links: string[];
21
+ supportedInteractionStandards?: ('wallet_connect' | 'beacon')[];
22
+ tags?: string[];
23
+ deepLink?: string;
24
+ }
25
+ export declare enum OSLink {
26
+ WEB = 0,
27
+ IOS = 1,
28
+ DESKTOP = 2,
29
+ EXTENSION = 3
30
+ }
31
+ export declare function parseWallets(wallets: Wallet[]): Wallet[];
32
+ export declare function arrangeTopWallets(arr: MergedWallet[], walletIds: string[]): MergedWallet[];
33
+ export declare function mergeWallets(wallets: Wallet[]): MergedWallet[];
@@ -0,0 +1,6 @@
1
+ export { openAlert, openBugReport, closeAlert, closeAlerts } from './ui/alert';
2
+ export type { AlertButton, AlertConfig, ToastAction } from './ui/common';
3
+ export { Pairing, setDesktopList, setExtensionList, setWebList, setiOSList, getDesktopList, getExtensionList, getWebList, getiOSList } from './components/pairing';
4
+ export { closeToast, openToast } from './ui/toast';
5
+ export { getColorMode, setColorMode } from './utils/colorMode';
6
+ export { isMobile, isMobileOS, isBrowser, isDesktop, isAndroid, isIOS, currentBrowser, currentOS } from './utils/platform';
@@ -0,0 +1,8 @@
1
+ export declare const alertTemplates: {
2
+ default: {
3
+ css: string;
4
+ };
5
+ pair: {
6
+ css: string;
7
+ };
8
+ };
@@ -0,0 +1,3 @@
1
+ import { ConfigurableAlertProps } from '../../../common';
2
+ declare const InfoAlert: ({ title, body, data, open, onClose, closeOnBackdropClick }: ConfigurableAlertProps) => import("react/jsx-runtime").JSX.Element;
3
+ export default InfoAlert;
@@ -0,0 +1,2 @@
1
+ declare const MobilePairing: React.FC<any>;
2
+ export default MobilePairing;
@@ -0,0 +1,2 @@
1
+ declare const suffixMap: Map<string, string>;
2
+ export default suffixMap;
@@ -0,0 +1,3 @@
1
+ import { QRCodeProps } from '../../../../../common';
2
+ declare const QRCode: React.FC<QRCodeProps>;
3
+ export default QRCode;
@@ -0,0 +1,3 @@
1
+ import { WCInitErrorProps } from '../../../../../common';
2
+ declare const WCInitError: React.FC<WCInitErrorProps>;
3
+ export default WCInitError;
@@ -0,0 +1,3 @@
1
+ import { ConfigurableAlertProps } from '../../../common';
2
+ declare const PairingAlert: React.FC<ConfigurableAlertProps>;
3
+ export default PairingAlert;
@@ -0,0 +1 @@
1
+ export default function getDefaultLogo(): string;
@@ -0,0 +1,4 @@
1
+ import { MergedWallet } from '../../../utils/wallets';
2
+ import { AlertConfig, AlertState } from '../../common';
3
+ declare const useConnect: (isMobile: boolean, wcPayload: Promise<string>, p2pPayload: Promise<string>, postPayload: Promise<string>, wallets: Map<string, MergedWallet>, onCloseHandler: Function) => readonly [MergedWallet | undefined, boolean, string | undefined, AlertState, boolean, boolean, boolean, (id: string, config: AlertConfig) => Promise<void>, (config: AlertConfig, wallet: MergedWallet) => Promise<void>, (wallet: MergedWallet) => Promise<void>, () => void, () => Promise<void>, () => void, () => Promise<void>, () => void, (newState: AlertState) => void, (uri: string) => void, () => void, (show: boolean) => void, (isLoading: boolean) => void];
4
+ export default useConnect;
@@ -0,0 +1,2 @@
1
+ declare const useIsMobile: (breakpoint?: number) => boolean;
2
+ export default useIsMobile;
@@ -0,0 +1,3 @@
1
+ import { NetworkType } from '@tezos-x/octez.connect-types';
2
+ declare const useSubstrateWallets: (networkType?: NetworkType, featuredWallets?: string[]) => Map<string, import("../../../utils/wallets").MergedWallet>;
3
+ export default useSubstrateWallets;
@@ -0,0 +1,3 @@
1
+ import { NetworkType } from '@tezos-x/octez.connect-types';
2
+ declare const useWallets: (networkType?: NetworkType, featuredWallets?: string[]) => Map<string, import("../../../utils/wallets").MergedWallet>;
3
+ export default useWallets;
@@ -0,0 +1,9 @@
1
+ import { AlertConfig } from '../common';
2
+ declare const openAlert: (config: AlertConfig) => void;
3
+ declare const openBugReport: () => void;
4
+ declare const closeAlert: () => void;
5
+ /**
6
+ * @deprecated use `closeAlert` instead
7
+ */
8
+ declare const closeAlerts: () => void;
9
+ export { openAlert, openBugReport, closeAlert, closeAlerts };
@@ -0,0 +1,5 @@
1
+ import { App, DesktopApp, ExtensionApp, WebApp } from '@tezos-x/octez.connect-types';
2
+ export declare const extensionList: ExtensionApp[];
3
+ export declare const desktopList: DesktopApp[];
4
+ export declare const webList: WebApp[];
5
+ export declare const iOSList: App[];
@@ -0,0 +1,5 @@
1
+ import { App, DesktopApp, ExtensionApp, WebApp } from '@tezos-x/octez.connect-types';
2
+ export declare const extensionList: ExtensionApp[];
3
+ export declare const desktopList: DesktopApp[];
4
+ export declare const webList: WebApp[];
5
+ export declare const iOSList: App[];
@@ -0,0 +1,158 @@
1
+ import { NetworkType, AnalyticsInterface, WalletInfo } from '@tezos-x/octez.connect-types';
2
+ import { MergedWallet } from '../utils/wallets';
3
+ export declare enum AlertState {
4
+ TOP_WALLETS = "top-wallets",
5
+ WALLETS = "wallets",
6
+ INSTALL = "install",
7
+ BUG_REPORT = "bug-report",
8
+ QR = "qr"
9
+ }
10
+ export interface AlertButton {
11
+ text: string;
12
+ style?: 'solid' | 'outline';
13
+ actionCallback?(): Promise<void>;
14
+ }
15
+ export interface AlertConfig {
16
+ title: string;
17
+ body?: string;
18
+ data?: string;
19
+ timer?: number;
20
+ buttons?: AlertButton[];
21
+ pairingPayload?: PairingPayload;
22
+ closeButtonCallback?: () => void;
23
+ disclaimerText?: string;
24
+ analytics?: AnalyticsInterface;
25
+ featuredWallets?: string[];
26
+ openBugReport?: boolean;
27
+ substratePairing?: boolean;
28
+ }
29
+ export interface ConfigurableAlertProps extends Omit<AlertConfig, 'closeButtonCallback'> {
30
+ open: boolean;
31
+ onClose: () => void;
32
+ closeOnBackdropClick: boolean;
33
+ }
34
+ export interface AlertProps {
35
+ open: boolean;
36
+ showMore?: boolean;
37
+ extraContent?: any;
38
+ loading?: boolean;
39
+ onCloseClick: () => void;
40
+ onClickShowMore?: () => void;
41
+ onBackClick?: () => void;
42
+ closeOnBackdropClick: boolean;
43
+ }
44
+ export interface PairingPayload {
45
+ p2pSyncCode: Promise<string>;
46
+ postmessageSyncCode: Promise<string>;
47
+ walletConnectSyncCode: Promise<string>;
48
+ networkType: NetworkType;
49
+ }
50
+ export interface PairOtherProps {
51
+ walletList: MergedWallet[];
52
+ p2pPayload: Promise<string>;
53
+ wcPayload: Promise<string>;
54
+ onClickLearnMore: () => void;
55
+ }
56
+ export interface QRProps {
57
+ isWalletConnect: boolean;
58
+ isMobile: boolean;
59
+ walletName: string;
60
+ code: string;
61
+ onClickLearnMore?: () => void;
62
+ onClickQrCode?: () => void;
63
+ }
64
+ export interface QRCodeProps {
65
+ wallet?: MergedWallet;
66
+ isWCWorking: boolean;
67
+ isMobile: boolean;
68
+ qrCode?: string;
69
+ defaultPairing: Promise<string>;
70
+ handleUpdateState: (state: AlertState) => void;
71
+ handleIsLoading: (isLoading: boolean) => void;
72
+ }
73
+ export interface WCInitErrorProps {
74
+ title: string;
75
+ handleUpdateState: (state: AlertState) => void;
76
+ }
77
+ export interface InfoProps {
78
+ title: string;
79
+ description?: string;
80
+ data?: string;
81
+ icon?: any;
82
+ border?: boolean;
83
+ iconBadge?: boolean;
84
+ bigIcon?: boolean;
85
+ buttons?: {
86
+ label: string;
87
+ type: 'primary' | 'secondary';
88
+ onClick: () => void;
89
+ }[];
90
+ downloadLink?: {
91
+ url: string;
92
+ label: string;
93
+ };
94
+ onShowQRCodeClick?: (() => void) | (() => Promise<void>);
95
+ }
96
+ export interface TopWalletsProps {
97
+ wallets: MergedWallet[];
98
+ onClickWallet: (id: string) => void;
99
+ onClickLearnMore: () => void;
100
+ otherWallets?: {
101
+ images: string[];
102
+ onClick: () => void;
103
+ };
104
+ disabled?: boolean;
105
+ isMobile: boolean;
106
+ }
107
+ export interface WalletProps {
108
+ name: string;
109
+ image: string;
110
+ description?: string;
111
+ small?: boolean;
112
+ mobile?: boolean;
113
+ onClick: () => void;
114
+ tags?: string[];
115
+ disabled?: boolean;
116
+ }
117
+ export interface WalletsProps {
118
+ wallets: MergedWallet[];
119
+ onClickWallet: (id: string) => void;
120
+ onClickOther: () => void;
121
+ isMobile: boolean;
122
+ small?: boolean;
123
+ disabled?: boolean;
124
+ }
125
+ export interface ToastAction {
126
+ text: string;
127
+ isBold?: boolean;
128
+ actionText?: string;
129
+ actionLogo?: 'external';
130
+ actionCallback?(): Promise<void>;
131
+ }
132
+ export interface ToastConfig {
133
+ body: string;
134
+ timer?: number;
135
+ forceNew?: boolean;
136
+ state: 'prepare' | 'loading' | 'acknowledge' | 'finished';
137
+ actions?: ToastAction[];
138
+ walletInfo?: WalletInfo;
139
+ openWalletAction?(): Promise<void>;
140
+ }
141
+ export interface ToastProps {
142
+ label: string;
143
+ open: boolean;
144
+ onClickClose: () => void;
145
+ actions?: {
146
+ text: string;
147
+ isBold?: boolean;
148
+ actionText?: string;
149
+ actionCallback?: () => void;
150
+ }[];
151
+ walletInfo?: {
152
+ deeplink?: string;
153
+ icon?: string;
154
+ name: string;
155
+ type?: string;
156
+ };
157
+ openWalletAction?: () => void;
158
+ }
@@ -0,0 +1,4 @@
1
+ import { ToastConfig } from '../common';
2
+ declare const openToast: (config: ToastConfig) => void;
3
+ declare const closeToast: () => void;
4
+ export { closeToast, openToast };
@@ -0,0 +1,5 @@
1
+ export declare const toastTemplates: {
2
+ default: {
3
+ css: string;
4
+ };
5
+ };
@@ -0,0 +1,3 @@
1
+ import { ColorMode } from '@tezos-x/octez.connect-types';
2
+ export declare const setColorMode: (mode: ColorMode) => void;
3
+ export declare const getColorMode: () => ColorMode;
@@ -0,0 +1 @@
1
+ export declare const getTzip10Link: (url: string, payload: string) => string;
@@ -0,0 +1,11 @@
1
+ export declare const testUserAgent: (win: Window, expr: RegExp) => boolean;
2
+ export declare const isMobile: (win: Window) => boolean;
3
+ export declare const isBrowser: (win: Window) => boolean;
4
+ export declare const isPrivacyBrowser: (win: Window) => boolean;
5
+ export declare const isIOS: (win: Window) => boolean;
6
+ export declare const isAndroid: (win: Window) => boolean;
7
+ export declare const isTwBrowser: (win: Window) => boolean;
8
+ export declare const isDesktop: (win: Window) => boolean;
9
+ export declare const isMobileOS: (win: Window) => boolean;
10
+ export declare const currentOS: () => string;
11
+ export declare const currentBrowser: () => string;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Convert data to a QR code
3
+ *
4
+ * @param payload The data to be encoded as a QR code
5
+ * @param type How the QR code will be encoded
6
+ */
7
+ export declare const getQrData: (payload: string, height?: number, width?: number) => string;
@@ -0,0 +1,9 @@
1
+ export interface Subscription {
2
+ unsubscribe: () => void;
3
+ }
4
+ export declare class Subject<T> {
5
+ private subscribers;
6
+ subscribe(callback: (value: T) => void): Subscription;
7
+ private unsubscribe;
8
+ next(value: T): void;
9
+ }