@@ -45,6 +45,11 @@ type Events = ServiceLifecycleEvents & {
45
45
* Contains the Wallet Connect URI required to pair/connect
46
46
*/
47
47
walletConnectInit : string
48
+ /**
49
+ * Contains claimer id
50
+ */
51
+ mezoClaimData : string
52
+ getMezoClaimData : void
48
53
}
49
54
50
55
export type AddChainRequestData = ValidatedAddEthereumChainParameter & {
@@ -147,6 +152,8 @@ export default class ProviderBridgeService extends BaseService<Events> {
147
152
chainId : toHexChainID ( network . chainID ) ,
148
153
}
149
154
} else if ( event . request . method . startsWith ( "tally_" ) ) {
155
+ response . result = null
156
+
150
157
switch ( event . request . method ) {
151
158
case "tally_setClaimReferrer" :
152
159
if ( origin !== WEBSITE_ORIGIN ) {
@@ -173,13 +180,22 @@ export default class ProviderBridgeService extends BaseService<Events> {
173
180
174
181
break
175
182
}
183
+ case "tally_getMezoClaimData" :
184
+ if ( origin === "https://mezo.org" ) {
185
+ // This is a hack, but we have no other way of accessing this data
186
+ // though it should probably be set post install on the Preference
187
+ // service
188
+ const installId = this . emitter . once ( "mezoClaimData" )
189
+
190
+ this . emitter . emit ( "getMezoClaimData" , undefined )
191
+ response . result = [ await installId ]
192
+ }
193
+ break
176
194
default :
177
195
logger . debug (
178
196
`Unknown method ${ event . request . method } in 'ProviderBridgeService'` ,
179
197
)
180
198
}
181
-
182
- response . result = null
183
199
} else if (
184
200
event . request . method === "eth_chainId" ||
185
201
event . request . method === "net_version"
0 commit comments