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.
The useSignTransaction hook signs a raw transaction using a specified wallet. The transaction must be RLP-encoded and base64-encoded before passing it to the hook. For higher-level EVM transaction support, use the @getpara/viem-v2-integration package.
Import
import { useSignTransaction } from "@getpara/react-native-wallet";
Usage
import { useSignTransaction, useWallet } from "@getpara/react-native-wallet";
import { Button } from "react-native";
function SignTxButton({ rlpEncodedTxBase64 }: { rlpEncodedTxBase64: string }) {
const { data: wallet } = useWallet();
const { signTransactionAsync, isPending } = useSignTransaction();
const handleSign = async () => {
if (!wallet?.id) return;
try {
const result = await signTransactionAsync({
walletId: wallet.id,
rlpEncodedTxBase64,
chainId: "1",
});
console.log("Signed tx:", result?.signature);
} catch (err) {
console.error(err);
}
};
return <Button title={isPending ? "Signing..." : "Sign Transaction"} onPress={handleSign} disabled={isPending || !wallet?.id} />;
}