Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@

## 1. Create Predicates

Use `balance` or `storage` to wait for account or contract state. Use `block_number` and `flashblock_index` to constrain the candidate position. Every predicate must match.
Use `balance` or `storage` to express conditions on account or contract state. Use `block_number` and `flashblock_index` to constrain the candidate position. Every predicate must match.

```ts Predicate setup lines wrap expandable

Check warning on line 16 in docs/specifications/build-transaction/build-a-validity-transaction.mdx

View workflow job for this annotation

GitHub Actions / Docs Style / Conformance

Docs style

[codeblock/highlight] Consider `highlight={}` to draw attention to key lines
import type { Address, Hex } from 'viem';

const validity = [
Expand Down Expand Up @@ -51,7 +51,7 @@

Use the sender's next nonce. The signed payload becomes the first RPC parameter.

```ts Sign transaction lines wrap expandable

Check warning on line 54 in docs/specifications/build-transaction/build-a-validity-transaction.mdx

View workflow job for this annotation

GitHub Actions / Docs Style / Conformance

Docs style

[codeblock/highlight] Consider `highlight={}` to draw attention to key lines
import { createPublicClient, http, type Chain } from 'viem';
import { privateKeyToAccount } from 'viem/accounts';

Expand Down Expand Up @@ -80,7 +80,7 @@

Pass the signed transaction and `validity` as separate parameters.

```ts Submit transaction lines wrap expandable

Check warning on line 83 in docs/specifications/build-transaction/build-a-validity-transaction.mdx

View workflow job for this annotation

GitHub Actions / Docs Style / Conformance

Docs style

[codeblock/highlight] Consider `highlight={}` to draw attention to key lines
const response = await fetch(rpcUrl, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: "Submit signed transactions that Base considers when onchain condit
tag: "Soon"
---

Validity Transactions let you submit a signed transaction with conditions on Base state. The API supports legacy, EIP-2930, and EIP-1559 transactions; EIP-1559 is recommended. Use them for conditional swaps, withdrawals, and other state-dependent actions.
Validity Transactions let you submit a signed transaction with conditions on Base state. The API supports legacy, EIP-2930, and EIP-1559 transactions; EIP-1559 is recommended. Use them when a transaction should be considered only after explicitly defined onchain state conditions are met.

<Warning>
Validity Transactions are experimental. `base_sendRawTransactionValidity` is currently available on Vibenet. Mainnet and Base Sepolia availability are not yet confirmed.
Expand Down
Loading