({
version,
req,
hostname,
url,
title,
icon,
analytics,
chainId,
channelId,
getSource,
isWalletConnect,
checkTabActive,
}: {
version: string;
req: any;
hostname: string;
url: { current: string };
title: { current: string };
icon: { current: string | undefined };
analytics: { [key: string]: string | boolean };
chainId: number;
isMMSDK: boolean;
channelId?: string;
getSource: () => string;
isWalletConnect: boolean;
checkTabActive: any;
})
| 189 | }; |
| 190 | |
| 191 | const generateRawSignature = async ({ |
| 192 | version, |
| 193 | req, |
| 194 | hostname, |
| 195 | url, |
| 196 | title, |
| 197 | icon, |
| 198 | analytics, |
| 199 | chainId, |
| 200 | channelId, |
| 201 | getSource, |
| 202 | isWalletConnect, |
| 203 | checkTabActive, |
| 204 | }: { |
| 205 | version: string; |
| 206 | req: any; |
| 207 | hostname: string; |
| 208 | url: { current: string }; |
| 209 | title: { current: string }; |
| 210 | icon: { current: string | undefined }; |
| 211 | analytics: { [key: string]: string | boolean }; |
| 212 | chainId: number; |
| 213 | isMMSDK: boolean; |
| 214 | channelId?: string; |
| 215 | getSource: () => string; |
| 216 | isWalletConnect: boolean; |
| 217 | checkTabActive: any; |
| 218 | }) => { |
| 219 | const { SignatureController } = Engine.context; |
| 220 | |
| 221 | const pageMeta = { |
| 222 | meta: { |
| 223 | url: url.current, |
| 224 | title: title.current, |
| 225 | icon: icon.current, |
| 226 | analytics: { |
| 227 | request_source: getSource(), |
| 228 | request_platform: analytics?.platform, |
| 229 | }, |
| 230 | }, |
| 231 | }; |
| 232 | |
| 233 | checkTabActive(); |
| 234 | await checkActiveAccountAndChainId({ |
| 235 | hostname, |
| 236 | channelId, |
| 237 | address: req.params[0], |
| 238 | chainId, |
| 239 | isWalletConnect, |
| 240 | }); |
| 241 | |
| 242 | const rawSig = await SignatureController.newUnsignedTypedMessage( |
| 243 | { |
| 244 | data: req.params[1], |
| 245 | from: req.params[0], |
| 246 | ...pageMeta, |
| 247 | origin: hostname, |
| 248 | securityAlertResponse: req.securityAlertResponse, |
no test coverage detected