// Sign the typed data with the user's wallet
const { typedData } = installData.appInstallationDataToSign;
const { EIP712Domain, ...types } = typedData.types;
const signature = await userWallet._signTypedData(
typedData.domain,
types,
typedData.message
);
// Complete the installation
const response = await fetch(`https://api.heyvincent.ai/user/${appId}/complete-installation`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
typedDataSignature: signature,
appInstallationDataToSign: installData.appInstallationDataToSign
})
});
const result = await response.json();
console.log(`Installation tx: ${result.transactionHash}`);