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>
);
}
import { useParaViemClient, useParaViemSignTypedData } from "@getpara/react-native-wallet/evm/viem";
import { http } from "viem";
import { sepolia } from "viem/chains";
import { View, Text, TouchableOpacity } from "react-native";
function SignTypedData({
domain,
types,
primaryType,
message,
}: {
domain: any;
types: any;
primaryType: string;
message: any;
}) {
const { viemClient } = useParaViemClient({
walletClientConfig: { chain: sepolia, transport: http() },
});
const { signTypedDataAsync, isPending, data: signature } = useParaViemSignTypedData(viemClient);
return (
<View>
<TouchableOpacity
disabled={isPending}
onPress={() => signTypedDataAsync({ domain, types, primaryType, message })}
>
<Text>{isPending ? "Signing..." : "Sign Typed Data"}</Text>
</TouchableOpacity>
{signature && <Text>Signature: {signature}</Text>}
</View>
);
}
Next Steps