Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.getpara.com/llms.txt

Use this file to discover all available pages before exploring further.

Sign structured data according to the EIP-712 standard, which provides a more readable and secure signing experience for users.
Wagmi is not available on React Native. Use Ethers.js or Viem for EVM operations.

Sign Typed Data

import { useParaEthersSigner, useParaEthersSignTypedData } from "@getpara/react-native-wallet/evm/ethers";
import { JsonRpcProvider } from "ethers";
import { View, Text, TouchableOpacity } from "react-native";

const provider = new JsonRpcProvider("https://ethereum-sepolia-rpc.publicnode.com");

function SignTypedData({
  domain,
  types,
  value,
}: {
  domain: any;
  types: any;
  value: any;
}) {
  const { ethersSigner } = useParaEthersSigner({ provider });

  const { signTypedDataAsync, isPending, data: signature } = useParaEthersSignTypedData(ethersSigner);

  return (
    <View>
      <TouchableOpacity
        disabled={isPending}
        onPress={() => signTypedDataAsync({ domain, types, value })}
      >
        <Text>{isPending ? "Signing..." : "Sign Typed Data"}</Text>
      </TouchableOpacity>
      {signature && <Text>Signature: {signature}</Text>}
    </View>
  );
}

Next Steps