FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
edge-react-gui/src/types/DeepLinkTypes.ts at develop · EdgeApp/edge-react-gui · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
EdgeApp
/
edge-react-gui
Public
Notifications
You must be signed in to change notification settings
Fork
293
Star
519
Code
Issues
51
Pull requests
144
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
edge-react-gui
/
src
/
types
/
DeepLinkTypes.ts
Copy path
More file actions
More file actions
Latest commit
History
History
History
238 lines (214 loc) · 6.19 KB
Breadcrumbs
edge-react-gui
/
src
/
types
/
DeepLinkTypes.ts
Copy path
File metadata and controls
238 lines (214 loc) · 6.19 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
/*
* All Edge deep-linking features are available through the `edge://`
* protocol. This protocol comes in three flavors, which are fully equivalent:
*
* - edge://<type>/...
* - airbitz://<type>/...
* - https://deep.edge.app/<type>/...
* - https://dp.edge.app/<type>/...
*
* The `edge://` protocol supports the following link types:
*
* - buy: Buy flow entry, optionally pinning a ramp provider / payment type
* - edge: Edge login
* - pay: Payment request
* - plugin: GUI plugin deep link
* - promotion: Activate a promotion code
* - recovery: Password recovery
* - sell: Sell flow entry, optionally pinning a ramp provider / payment type
* - swap: Crypto-to-crypto swap
* - x-callback-url: Address request
*
* The `edge://` protocol is the preferred way to link into the application,
* but Edge also supports some feature-specific https domains:
*
* - https://dl.edge.app/... = edge://promotion/...
* - https://dl.edge.app/?af=... = edge://promotion/...
*
* `deep.edge.app` URLs may also carry an `?af=<installerId>` query parameter.
* When present alongside another payload (e.g. a `pay` private-key URI), the
* deep link resolves to an `affiliate` wrapper that activates the promotion
* and then delegates to the inner link.
*
* We also support some legacy prefixes (but don't use these):
*
* - edge-ret://plugins/simplex/... = edge://plugin/simplex/...
* - edge-ret://x-callback-url/... = edge://x-callback-url/...
* - airbitz-ret://x-callback-url/... = edge://x-callback-url/...
*
* Besides the edge:// protocol, there are also various coin-specific URI
* protocols like `bitcoin:`, which we just pass through as "other".
*/
import
{
asValue
}
from
'cleaners'
import
type
{
EdgeTokenId
}
from
'edge-core-js'
import
type
{
FiatDirection
,
FiatPaymentType
}
from
'../plugins/gui/fiatPluginTypes'
import
type
{
AppParamList
}
from
'./routerTypes'
export
interface
AztecoLink
{
type
:
'azteco'
uri
:
string
}
export
interface
PaymentProtoLink
{
type
:
'paymentProto'
uri
:
string
}
/**
* A provider sell-completion redirect (e.g. MoonPay's "Send with Edge" button).
* Carries everything needed to open the Send scene so the user can finish
* depositing crypto for a pending sell order:
*
* https://edge.app/redirect/payment/?baseCurrencyCode=btc&baseCurrencyAmount=0.001&depositWalletAddress=...&depositWalletAddressTag=...
*
* `currencyCode` is the provider's base currency code (resolved to a wallet at
* handle time), `addressTag` is the destination tag / memo (required for chains
* like XRP), and `amount` is in whole units of the base currency.
*/
export
interface
PaymentRedirectLink
{
type
:
'paymentRedirect'
currencyCode
:
string
depositAddress
:
string
amount
?:
string
addressTag
?:
string
}
export
interface
EdgeLoginLink
{
type
:
'edgeLogin'
lobbyId
:
string
}
export
interface
PasswordRecoveryLink
{
type
:
'passwordRecovery'
passwordRecoveryKey
:
string
}
export
interface
PluginLink
{
type
:
'plugin'
pluginId
:
string
path
:
string
query
:
Record
<
string
,
string
|
null
>
}
export
interface
FiatPluginLink
{
type
:
'fiatPlugin'
pluginId
:
string
direction
?:
FiatDirection
providerId
?:
string
paymentType
?:
FiatPaymentType
}
export
interface
FiatProviderLink
{
type
:
'fiatProvider'
direction
:
FiatDirection
providerId
:
string
path
:
string
query
:
Record
<
string
,
string
|
null
>
uri
:
string
}
export
interface
PromotionLink
{
type
:
'promotion'
installerId
?:
string
}
export
interface
PriceChangeLink
{
type
:
'price-change'
pluginId
:
string
body
:
string
// Human-readable message
}
/**
* A link-scoped entry into the ramps buy/sell flow:
*
* edge://buy[/<providerId>[/<paymentType>]]
* edge://sell[/<providerId>[/<paymentType>]]
*
* `providerId` and `paymentType` pin a ramp provider and payment method to the
* top of the quote results for this navigation only; they are never written to
* the account referral state. A pin that matches no quote degrades to the
* normal ordering. The `?af=` query on the `https://deep.edge.app` form keeps
* its existing attribution behavior, independent of the pinning.
*/
export
interface
RampCreateLink
{
type
:
'rampCreate'
direction
:
FiatDirection
providerId
?:
string
paymentType
?:
FiatPaymentType
}
export
interface
MarketingLink
{
type
:
'marketing'
campaignId
:
string
// Correlates notification opens to a marketing campaign
link
?:
DeepLink
// Optional navigation target parsed from the payload URL
}
/**
* A provider return link (e.g. Simplex or Paybis sending the user back into the
* app once their session finishes). Handled by the ramp deeplink manager, not
* by scene navigation.
*/
export
interface
RampLink
{
type
:
'ramp'
direction
:
FiatDirection
providerId
:
string
path
:
string
query
:
Record
<
string
,
string
|
null
>
uri
:
string
}
export
interface
RewardsLink
{
type
:
'rewards'
pluginId
:
string
tokenId
:
EdgeTokenId
}
export
interface
RequestAddressLink
{
type
:
'requestAddress'
assets
:
Array
<
{
nativeCode
:
string
;
tokenCode
:
string
}
>
post
?:
string
// Either post or redir must be specified
redir
?:
string
payer
?:
string
}
export
interface
SwapLink
{
type
:
'swap'
// We may eventually add query parameters to pre-populate currencies.
}
export
interface
WalletConnectLink
{
type
:
'walletConnect'
uri
:
string
}
export
interface
NoopLink
{
type
:
'noop'
}
export
interface
SceneLink
{
type
:
'scene'
sceneName
:
keyof
AppParamList
query
:
AppParamList
[
keyof
AppParamList
]
}
export
const
asModalNames
=
asValue
(
'fundAccount'
,
'test'
)
export
type
ModalNames
=
ReturnType
<
typeof
asModalNames
>
export
interface
ModalLink
{
type
:
'modal'
modalName
:
ModalNames
}
export
interface
AffiliateLink
{
type
:
'affiliate'
installerId
:
string
link
:
DeepLink
}
export
type
DeepLink
=
|
AffiliateLink
|
AztecoLink
|
SceneLink
|
EdgeLoginLink
|
FiatPluginLink
|
FiatProviderLink
|
MarketingLink
|
ModalLink
|
NoopLink
|
PasswordRecoveryLink
|
PaymentProtoLink
|
PaymentRedirectLink
|
PluginLink
|
PriceChangeLink
|
PromotionLink
|
RequestAddressLink
|
SwapLink
|
WalletConnectLink
|
RampCreateLink
|
RampLink
|
RewardsLink
|
{
type
:
'other'
protocol
:
string
// Without the ':'
uri
:
string
}
Back
|
FazBrowse Home
|
New Git URL