Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Sign structured data using the EIP-712 standard for improved security and UX on React Native
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> ); }