From 45242a880c88e53c9a2423225de25c3a9f2c780d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrei=20B=C4=83ncioiu?= Date: Thu, 7 Aug 2025 12:05:49 +0300 Subject: [PATCH] Cookbook: adjust section on relayed transactions. --- cookbook/cookbook.md | 16 +++++++--------- cookbook/relayed.ts | 22 ++++++++++------------ 2 files changed, 17 insertions(+), 21 deletions(-) diff --git a/cookbook/cookbook.md b/cookbook/cookbook.md index 1d912627..1c8311c9 100644 --- a/cookbook/cookbook.md +++ b/cookbook/cookbook.md @@ -2402,18 +2402,16 @@ After the `10-epoch unbonding period` is complete, we can proceed with withdrawi ``` ### Relayed transactions -We are currently on the `third iteration (V3)` of relayed transactions. V1 and V2 will soon be deactivated, so we will focus on V3. +We are currently on the third iteration (V3) of relayed transactions. V1 and V2 will be deactivated soon, so we'll focus on V3. -For V3, two new fields have been added to transactions: -- relayer -- relayerSignature +For V3, two new fields have been added on transactions: `relayer` and `relayerSignature`. -Signing Process: -1. The relayer must be set before the sender signs the transaction. -2. Once the sender has signed, the relayer can also sign the transaction and broadcast it. +Note that: +1. the sender and the relayer can sign the transaction in any order. +2. before any of the sender or relayer can sign the transaction, the `relayer` field must be set. +3. relayed transactions require an additional `50,000` of gas. +4. the sender and the relayer must be in the same network shard. -**Important Consideration**: -Relayed V3 transactions require an additional `50,000` gas. Let’s see how to create a relayed transaction: ```js diff --git a/cookbook/relayed.ts b/cookbook/relayed.ts index d6166e78..8b60a4a9 100644 --- a/cookbook/relayed.ts +++ b/cookbook/relayed.ts @@ -3,18 +3,16 @@ import { Account, Address, DevnetEntrypoint, Transaction } from "../src"; // md- // md-start (async () => { // ### Relayed transactions - // We are currently on the `third iteration (V3)` of relayed transactions. V1 and V2 will soon be deactivated, so we will focus on V3. - - // For V3, two new fields have been added to transactions: - // - relayer - // - relayerSignature - - // Signing Process: - // 1. The relayer must be set before the sender signs the transaction. - // 2. Once the sender has signed, the relayer can also sign the transaction and broadcast it. - - // **Important Consideration**: - // Relayed V3 transactions require an additional `50,000` gas. + // We are currently on the third iteration (V3) of relayed transactions. V1 and V2 will be deactivated soon, so we'll focus on V3. + // + // For V3, two new fields have been added on transactions: `relayer` and `relayerSignature`. + // + // Note that: + // 1. the sender and the relayer can sign the transaction in any order. + // 2. before any of the sender or relayer can sign the transaction, the `relayer` field must be set. + // 3. relayed transactions require an additional `50,000` of gas. + // 4. the sender and the relayer must be in the same network shard. + // // Let’s see how to create a relayed transaction: // ```js