Skip to main content
The useParaCosmjsAminoSigner hook returns a CosmJS OfflineAminoSigner for the user’s Cosmos wallet. It supports both embedded Para wallets and external wallets. If the user has multiple Cosmos wallets, pass address or walletId to select one. When omitted, the active wallet is used automatically.
Requires @getpara/cosmjs-v0-integration as a peer dependency.

Import

import { useParaCosmjsAminoSigner } from "@getpara/react-sdk";

Usage

import { useParaCosmjsAminoSigner } from "@getpara/react-sdk";

function SignAmino() {
  const { aminoSigner, isLoading } = useParaCosmjsAminoSigner();

  const handleSign = async () => {
    if (!aminoSigner) return;

    const signDoc = {
      chain_id: "cosmoshub-4",
      account_number: "0",
      sequence: "0",
      fee: { amount: [], gas: "200000" },
      msgs: [],
      memo: "Hello",
    };

    const result = await aminoSigner.signAmino(aminoSigner.address, signDoc);
    console.log("Signature:", result.signature.signature);
  };

  if (isLoading) return <p>Loading...</p>;

  return (
    <div>
      <p>Address: {aminoSigner?.address}</p>
      <button onClick={handleSign}>Sign Message</button>
    </div>
  );
}