-
Notifications
You must be signed in to change notification settings - Fork 62
/
PostMessagePairingResponse.ts
57 lines (53 loc) · 1.11 KB
/
PostMessagePairingResponse.ts
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
import { ExtendedPeerInfo, PeerInfo } from './PeerInfo'
/**
* @internalapi
*/
export class PostMessagePairingResponse implements PeerInfo {
readonly type: string = 'postmessage-pairing-response'
id: string
name: string
icon?: string | undefined
appUrl?: string | undefined
publicKey: string
version: string
constructor(
id: string,
name: string,
publicKey: string,
version: string,
icon?: string,
appUrl?: string
) {
this.id = id
this.name = name
this.icon = icon
this.appUrl = appUrl
this.publicKey = publicKey
this.version = version
}
}
/**
* @internalapi
*/
export class ExtendedPostMessagePairingResponse
extends PostMessagePairingResponse
implements ExtendedPeerInfo
{
senderId: string
extensionId: string
constructor(
id: string,
name: string,
publicKey: string,
version: string,
senderId: string,
extensionId: string,
icon?: string,
appUrl?: string
) {
super(id, name, publicKey, version, icon, appUrl)
this.senderId = senderId
this.extensionId = extensionId
}
}
// TODO: Rename to "WalletPeerInfo"?