TRANSACTION LIFECYCLE
Prepare a transaction
Build an unsigned frame transaction with explicit actions, gas limits, and fee bounds. The client checks the chain and resolves the ordinary account nonce.
API
client.prepareFrameTransaction(parameters)Usage
TYPESCRIPTprepare.ts
import { frame, getProfile } from '@framepay/sdk';const profile = getProfile('ethrex-eip8141-tracer');const transaction = await client.prepareFrameTransaction({ sender: signer.address, maxFeePerGas: 2_000_000_000n, frames: [ frame(profile, 'VERIFY', { scope: 'EXECUTION_AND_PAYMENT', execution: 30_000n, }), frame(profile, 'SENDER', { target: recipient, value: 1_000_000_000n, execution: 50_000n, state: 200_000n, }), ],});Examples use the configured client from Create a client.
Parameters
| Name | Type | Description |
|---|---|---|
sender | Address | The account authorizing the transaction. |
frames | Frame[] | Ordered frames with explicit execution and state gas limits. |
maxFeePerGas | bigint | Maximum gas price, in wei. |
nonceSeq | bigint? | Read from the chain for ordinary nonces when omitted. Required for nonzero nonce keys. |
nonceKeys | bigint[]? | Defaults to [0n]. Keyed nonce allocation is managed by the caller. |
recentRootReferences | RecentRootReference[]? | Optional references included in the signed envelope. |
Returns
Promise<FrameTx> — an unsigned transaction envelope.
Behavior to know
- Preparation is not admission simulation. Gas values in this example come from the workshop preset.
- A nonce read is not a reservation. Serialize ordinary-nonce sends from the same account.