TRANSACTION MODULES
Compose a transfer
Choose a recipient, draft limits, and who should pay for gas. FramePay generates the verification and execution frames for an EOA ETH transfer.
API
client.prepareTransfer(parameters)Usage
TYPESCRIPTcompose-transfer.ts
// With the client, EOA sender, recipient and paymaster address configured:const transaction = await client.prepareTransfer({ sender, transfer: { to: recipient, value: 1_000_000_000n }, payment: { type: 'paymaster', address: paymaster }, // Alternatively: payment: { type: 'self' }, rules: { allowedRecipients: [recipient], maxValue: 1_000_000_000_000_000n, maxFeePerGas: 2_000_000_000n, }, maxFeePerGas: 2_000_000_000n,});// Review the generated transaction before signing it.const signed = await client.signFrameTransaction({ transaction, signer });const hash = await client.sendFrameTransaction({ transaction: signed });const receipt = await client.waitForFrameReceipt({ hash, expectedFrameCount: signed.frames.length,});Examples use the configured client from Create a client.
Parameters
| Name | Type | Description |
|---|---|---|
sender | Address | Plain EOA sender, using the existing local SECP256K1 signing path. |
transfer | { to: Address; value: bigint } | Plain EOA recipient and ETH amount in wei. Zero is allowed for a sponsorship test; this is not a token transfer. |
payment | TransferPayment | Choose { type: 'self' } or { type: 'paymaster', address }. The paymaster contract must independently approve payment. |
payment.verificationData | Hex? | Provider-specific verification calldata. Defaults to 0x, matching the workshop's open SponsorPaymaster. No provider authorization is issued by this SDK. |
payment.verificationGas | { execution: bigint; state: bigint }? | Explicit paymaster verification budget. Defaults to execution 50,000 and state 0; custom contracts may require different limits. |
rules | TransferRules | Required recipient allowlist, maximum value and maximum gas price. Local draft checks only; they do not install on-chain permissions. |
maxFeePerGas | bigint | Requested maximum gas price in wei, bounded by rules.maxFeePerGas. This is not a total-fee cap or an estimate. |
Returns
Promise<FrameTx> — an unsigned two-frame self-paid or three-frame paymaster-request transaction.
Behavior to know
- buildTransferPlan({ profile, ...parameters }) provides a pure offline builder with generated parameters and a review summary. It does not query code, balances, or sponsorship eligibility.
- prepareTransfer checks chain 1337, requires EOA sender/recipient, reads the sender balance, and requires deployed code at a selected paymaster before preparing the ordinary nonce.
- Code presence does not establish paymaster compatibility, available funds, or sponsorship approval. The sidecar's validation and on-chain execution still decide the outcome.
- Sponsorship covers network gas only. The sender must hold the ETH being transferred. For a zero-ETH sender demo, use a zero-value operation and a funded compatible paymaster.
- The maximum value and allowlist constrain this draft locally. Persistent spending limits, recurring schedules and expiry must be implemented by account/paymaster contracts.
- This module does not implement token reimbursement, provider discovery, discount quotes, PQ authorization, contract calls or swaps. Those need separate adapters and measured gas budgets.