@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.
- package/LICENCE +19 -0
- package/README.md +9 -0
- package/dist/bundle.js +60 -0
- package/dist/bundle.js.map +1 -0
- package/dist/cjs/components/alert/index.d.ts +4 -0
- package/dist/cjs/components/bug-report-form/index.d.ts +5 -0
- package/dist/cjs/components/button-icon/button-icon.d.ts +9 -0
- package/dist/cjs/components/icons/index.d.ts +8 -0
- package/dist/cjs/components/info/index.d.ts +4 -0
- package/dist/cjs/components/loader/index.d.ts +3 -0
- package/dist/cjs/components/pair-other/index.d.ts +4 -0
- package/dist/cjs/components/pairing.d.ts +51 -0
- package/dist/cjs/components/qr/index.d.ts +4 -0
- package/dist/cjs/components/toast/hooks/useDrag.d.ts +6 -0
- package/dist/cjs/components/toast/index.d.ts +4 -0
- package/dist/cjs/components/top-wallets/index.d.ts +4 -0
- package/dist/cjs/components/wallet/index.d.ts +4 -0
- package/dist/cjs/components/wallets/index.d.ts +4 -0
- package/dist/cjs/index.d.ts +6 -0
- package/dist/cjs/index.js +60 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/ui/alert/alert-templates.d.ts +8 -0
- package/dist/cjs/ui/alert/components/info-alert/index.d.ts +3 -0
- package/dist/cjs/ui/alert/components/pairing-alert/components/mobile-pairing/index.d.ts +2 -0
- package/dist/cjs/ui/alert/components/pairing-alert/components/mobile-pairing/utils/suffix-map.d.ts +2 -0
- package/dist/cjs/ui/alert/components/pairing-alert/components/qr-code/index.d.ts +3 -0
- package/dist/cjs/ui/alert/components/pairing-alert/components/wc-init-error/index.d.ts +3 -0
- package/dist/cjs/ui/alert/components/pairing-alert/index.d.ts +3 -0
- package/dist/cjs/ui/alert/getDefautlLogo.d.ts +1 -0
- package/dist/cjs/ui/alert/hooks/useConnect.d.ts +4 -0
- package/dist/cjs/ui/alert/hooks/useIsMobile.d.ts +2 -0
- package/dist/cjs/ui/alert/hooks/useSubstrateWallets.d.ts +3 -0
- package/dist/cjs/ui/alert/hooks/useWallets.d.ts +3 -0
- package/dist/cjs/ui/alert/index.d.ts +9 -0
- package/dist/cjs/ui/alert/substrate-wallet-lists.d.ts +5 -0
- package/dist/cjs/ui/alert/wallet-lists.d.ts +5 -0
- package/dist/cjs/ui/common.d.ts +158 -0
- package/dist/cjs/ui/toast/index.d.ts +4 -0
- package/dist/cjs/ui/toast/toast-templates.d.ts +5 -0
- package/dist/cjs/utils/colorMode.d.ts +3 -0
- package/dist/cjs/utils/get-tzip10-link.d.ts +1 -0
- package/dist/cjs/utils/platform.d.ts +11 -0
- package/dist/cjs/utils/qr.d.ts +7 -0
- package/dist/cjs/utils/subject.d.ts +9 -0
- package/dist/cjs/utils/wallets.d.ts +33 -0
- package/dist/components/alert/index.d.ts +4 -0
- package/dist/components/bug-report-form/index.d.ts +5 -0
- package/dist/components/button-icon/button-icon.d.ts +9 -0
- package/dist/components/icons/index.d.ts +8 -0
- package/dist/components/info/index.d.ts +4 -0
- package/dist/components/loader/index.d.ts +3 -0
- package/dist/components/pair-other/index.d.ts +4 -0
- package/dist/components/pairing.d.ts +51 -0
- package/dist/components/qr/index.d.ts +4 -0
- package/dist/components/toast/hooks/useDrag.d.ts +6 -0
- package/dist/components/toast/index.d.ts +4 -0
- package/dist/components/top-wallets/index.d.ts +4 -0
- package/dist/components/wallet/index.d.ts +4 -0
- package/dist/components/wallets/index.d.ts +4 -0
- package/dist/esm/components/alert/index.d.ts +4 -0
- package/dist/esm/components/bug-report-form/index.d.ts +5 -0
- package/dist/esm/components/button-icon/button-icon.d.ts +9 -0
- package/dist/esm/components/icons/index.d.ts +8 -0
- package/dist/esm/components/info/index.d.ts +4 -0
- package/dist/esm/components/loader/index.d.ts +3 -0
- package/dist/esm/components/pair-other/index.d.ts +4 -0
- package/dist/esm/components/pairing.d.ts +51 -0
- package/dist/esm/components/qr/index.d.ts +4 -0
- package/dist/esm/components/toast/hooks/useDrag.d.ts +6 -0
- package/dist/esm/components/toast/index.d.ts +4 -0
- package/dist/esm/components/top-wallets/index.d.ts +4 -0
- package/dist/esm/components/wallet/index.d.ts +4 -0
- package/dist/esm/components/wallets/index.d.ts +4 -0
- package/dist/esm/index.d.ts +6 -0
- package/dist/esm/index.js +60 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/ui/alert/alert-templates.d.ts +8 -0
- package/dist/esm/ui/alert/components/info-alert/index.d.ts +3 -0
- package/dist/esm/ui/alert/components/pairing-alert/components/mobile-pairing/index.d.ts +2 -0
- package/dist/esm/ui/alert/components/pairing-alert/components/mobile-pairing/utils/suffix-map.d.ts +2 -0
- package/dist/esm/ui/alert/components/pairing-alert/components/qr-code/index.d.ts +3 -0
- package/dist/esm/ui/alert/components/pairing-alert/components/wc-init-error/index.d.ts +3 -0
- package/dist/esm/ui/alert/components/pairing-alert/index.d.ts +3 -0
- package/dist/esm/ui/alert/getDefautlLogo.d.ts +1 -0
- package/dist/esm/ui/alert/hooks/useConnect.d.ts +4 -0
- package/dist/esm/ui/alert/hooks/useIsMobile.d.ts +2 -0
- package/dist/esm/ui/alert/hooks/useSubstrateWallets.d.ts +3 -0
- package/dist/esm/ui/alert/hooks/useWallets.d.ts +3 -0
- package/dist/esm/ui/alert/index.d.ts +9 -0
- package/dist/esm/ui/alert/substrate-wallet-lists.d.ts +5 -0
- package/dist/esm/ui/alert/wallet-lists.d.ts +5 -0
- package/dist/esm/ui/common.d.ts +158 -0
- package/dist/esm/ui/toast/index.d.ts +4 -0
- package/dist/esm/ui/toast/toast-templates.d.ts +5 -0
- package/dist/esm/utils/colorMode.d.ts +3 -0
- package/dist/esm/utils/get-tzip10-link.d.ts +1 -0
- package/dist/esm/utils/platform.d.ts +11 -0
- package/dist/esm/utils/qr.d.ts +7 -0
- package/dist/esm/utils/subject.d.ts +9 -0
- package/dist/esm/utils/wallets.d.ts +33 -0
- package/dist/index.d.ts +6 -0
- package/dist/ui/alert/alert-templates.d.ts +8 -0
- package/dist/ui/alert/components/info-alert/index.d.ts +3 -0
- package/dist/ui/alert/components/pairing-alert/components/mobile-pairing/index.d.ts +2 -0
- package/dist/ui/alert/components/pairing-alert/components/mobile-pairing/utils/suffix-map.d.ts +2 -0
- package/dist/ui/alert/components/pairing-alert/components/qr-code/index.d.ts +3 -0
- package/dist/ui/alert/components/pairing-alert/components/wc-init-error/index.d.ts +3 -0
- package/dist/ui/alert/components/pairing-alert/index.d.ts +3 -0
- package/dist/ui/alert/getDefautlLogo.d.ts +1 -0
- package/dist/ui/alert/hooks/useConnect.d.ts +4 -0
- package/dist/ui/alert/hooks/useIsMobile.d.ts +2 -0
- package/dist/ui/alert/hooks/useSubstrateWallets.d.ts +3 -0
- package/dist/ui/alert/hooks/useWallets.d.ts +3 -0
- package/dist/ui/alert/index.d.ts +9 -0
- package/dist/ui/alert/substrate-wallet-lists.d.ts +5 -0
- package/dist/ui/alert/wallet-lists.d.ts +5 -0
- package/dist/ui/common.d.ts +158 -0
- package/dist/ui/toast/index.d.ts +4 -0
- package/dist/ui/toast/toast-templates.d.ts +5 -0
- package/dist/utils/colorMode.d.ts +3 -0
- package/dist/utils/get-tzip10-link.d.ts +1 -0
- package/dist/utils/platform.d.ts +11 -0
- package/dist/utils/qr.d.ts +7 -0
- package/dist/utils/subject.d.ts +9 -0
- package/dist/utils/wallets.d.ts +33 -0
- package/package.json +70 -0
|
@@ -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,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,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 @@
|
|
|
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,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[];
|
package/dist/index.d.ts
ADDED
|
@@ -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 @@
|
|
|
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,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,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 @@
|
|
|
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;
|