import { InMemorySigner } from '@taquito/signer';
const MNEMONIC = "<YOUR_MNEMONIC>";
const UNSIGNED_TX = "<UNSIGNED_TX_HEX>";
async function main() {
// Create a signer instance from mnemonic
const signer = await InMemorySigner.fromMnemonic({ mnemonic: MNEMONIC });
// Sign the unsigned transaction (hex string)
const signed = await signer.sign(UNSIGNED_TX, new Uint8Array([3]));
// The result contains: bytes, sig, prefixSig, sbytes
console.log("✅ Signed Tezos Tx (JSON):");
console.log(JSON.stringify(signed, null, 2));
}
main().catch(console.error);