-
Notifications
You must be signed in to change notification settings - Fork 62
/
pairing.tsx
107 lines (87 loc) · 2.1 KB
/
pairing.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
import { desktopList, extensionList, iOSList, webList } from '../ui/alert/wallet-lists'
import { DesktopApp, App, ExtensionApp, WebApp } from '@airgap/beacon-types'
// export interface PairingProps {}
// const Pairing: Component<PairingProps> = (props: PairingProps) => {
// return (
// <div>
// <h1>Pairing Component</h1>
// </div>
// )
// }
// export default Pairing
/**
* Initialize with tezos wallets for backwards compatibility
*/
let localDesktopList: DesktopApp[] = desktopList
let localExtensionList: ExtensionApp[] = extensionList
let localWebList: WebApp[] = webList
let localiOSList: App[] = iOSList
export const getDesktopList = (): DesktopApp[] => {
return localDesktopList
}
export const setDesktopList = (desktopList: DesktopApp[]): void => {
localDesktopList = desktopList
}
export const getExtensionList = (): ExtensionApp[] => {
return localExtensionList
}
export const setExtensionList = (extensionList: ExtensionApp[]): void => {
localExtensionList = extensionList
}
export const getWebList = (): WebApp[] => {
return localWebList
}
export const setWebList = (webList: WebApp[]): void => {
localWebList = webList
}
export const getiOSList = (): App[] => {
return localiOSList
}
export const setiOSList = (iosList: App[]): void => {
localiOSList = iosList
}
export enum Platform {
DESKTOP,
IOS,
ANDROID
}
export enum WalletType {
IOS = 'ios',
ANDROID = 'android',
EXTENSION = 'extension',
DESKTOP = 'desktop',
WEB = 'web'
}
export interface PairingAlertWallet {
key: string
name: string
shortName?: string
color?: string
logo?: string
enabled: boolean
clickHandler(): void
}
export interface PairingAlertButton {
title: string
text: string
clickHandler(): void
}
export interface PairingAlertList {
title: string
type: WalletType
wallets: PairingAlertWallet[]
}
export interface PairingAlertInfo {
walletLists: PairingAlertList[]
buttons: PairingAlertButton[]
}
export type StatusUpdateHandler = (
walletType: WalletType,
app?: PairingAlertWallet,
keepOpen?: boolean
) => void
/**
* @internalapi
*
*/
export class Pairing {}