From d1ad080201780650f677e0583427e1c474feab04 Mon Sep 17 00:00:00 2001 From: Steven Luscher Date: Thu, 7 Nov 2024 17:45:02 +0000 Subject: [PATCH] =?UTF-8?q?Make=20the=20=E2=80=98signing=20transaction=20m?= =?UTF-8?q?essages=E2=80=99=20section=20of=20the=20README=20less=20confusi?= =?UTF-8?q?ng?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 9de4868f7902..e5f9b20e1819 100644 --- a/README.md +++ b/README.md @@ -857,11 +857,11 @@ Transaction message objects are also **frozen by these functions** to prevent th The `signTransaction(..)` function will raise a type error if your transaction message is not already equipped with a fee payer and a lifetime. This helps you catch errors at author-time instead of runtime. ```ts -const feePayer = address('AxZfZWeqztBCL37Mkjkd4b8Hf6J13WCcfozrBY6vZzv3'); -const signer = await generateKeyPair(); +const feePayer = await generateKeyPair(); +const feePayerAddress = await getAddressFromPublicKey(feePayer.publicKey); const transactionMessage = createTransactionMessage({ version: 'legacy' }); -const transactionMessageWithFeePayer = setTransactionMessageFeePayer(feePayer, transactionMessage); +const transactionMessageWithFeePayer = setTransactionMessageFeePayer(feePayerAddress, transactionMessage); // Attempting to sign the transaction message without a lifetime will throw a type error const signedTransaction = await signTransaction([signer], transactionMessageWithFeePayer);