Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
zencephalon committed Feb 13, 2024
1 parent 2143b7c commit c68a5cc
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ This function is a key component in the `getDepositTransaction` process, where i
## Import

```ts
import { parseOpaqueData } from './utils/getArgsFromTransactionDepositedOpaqueData.js';
import { parseOpaqueData } from './utils/getArgsFromTransactionDepositedOpaqueData.js'
```

## Usage

```ts
import { parseOpaqueData } from './utils/getArgsFromTransactionDepositedOpaqueData.js';
import { parseOpaqueData } from './utils/getArgsFromTransactionDepositedOpaqueData.js'

// ... within getDepositTransaction function
const parsedOpaqueData = parseOpaqueData(event.args.opaqueData);
const parsedOpaqueData = parseOpaqueData(event.args.opaqueData)
// Use parsedOpaqueData to construct DepositTransaction
```

Expand All @@ -41,4 +41,4 @@ Returns an object containing structured transaction data with fields such as min
`opaqueData`

**Type:** Hex
**Description:** The opaque data from the TransactionDepositedEvent event args.
**Description:** The opaque data from the TransactionDepositedEvent event args.
10 changes: 5 additions & 5 deletions site/docs/utilities/transactionHelpers/transactionSerializer.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ head:
content: Add here.
---

# transactionSerializer
# transactionSerializer

Serializes a transaction compliant with Ethereum Improvement Proposal (EIP) 1559.

Expand All @@ -17,19 +17,19 @@ This utility function takes transaction parameters and serializes them into a fo
## Import

```ts
import { serializeEip1559Transaction } from './utils/transactionSerializer.js';
import { serializeEip1559Transaction } from './utils/transactionSerializer.js'
```

## Usage

```ts
// Example usage in an Ethereum transaction
import { serializeEip1559Transaction } from './utils/transactionSerializer.js';
import { serializeEip1559Transaction } from './utils/transactionSerializer.js'
// Additional imports...

const serializedTx = serializeEip1559Transaction({
// Transaction parameters...
});
})
// Use serializedTx for further processing...
```

Expand All @@ -45,4 +45,4 @@ const serializedTx = serializeEip1559Transaction({
`TransactionSerializedEIP1559`

**Type:** Object
**Description:** The serialized transaction data, formatted according to EIP-1559 standards.
**Description:** The serialized transaction data, formatted according to EIP-1559 standards.
30 changes: 15 additions & 15 deletions site/docs/utilities/withdrawals/getProof.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ import { getProof } from './getProof.js'
This example, adapted from `getProof.test.js`, demonstrates fetching an account's state and storage proof for a specific Ethereum address at a given block. It illustrates a practical application of the `getProof` function.

```ts
import { createPublicClient, http, toHex } from 'viem';
import { base } from 'viem/chains';
import { createPublicClient, http, toHex } from 'viem'
import { base } from 'viem/chains'
import { getProof } from './getProof.js'

// Setting up the client with base chain and HTTP transport
const client = createPublicClient({
chain: base,
transport: http(),
});
})

// Example usage of getProof to fetch account state and storage proof
const result = await getProof(client, {
Expand All @@ -43,7 +43,7 @@ const result = await getProof(client, {
'0x4a932049252365b3eedbc5190e18949f2ec11f39d3bef2d259764799a1b27d99', // Storage key
],
block: toHex(3155269n), // Block number in hexadecimal
});
})

// The result contains the storage proof for the specified address and block
```
Expand All @@ -52,19 +52,19 @@ This approach not only provides a clear, practical example of how to use `getPro

## Parameters

* `client`: An instance of PublicClient. Responsible for making the request to the Ethereum node.
* `GetProofParameters`: An object containing:
* `address`: The Ethereum address for which to get the proof.
* `storageKeys`: An array of storage keys (Hex) to fetch the storage proof.
* `block`: The block number (Hex or BigInt), tag ('latest', 'earliest', 'pending'), or hash at which to fetch the proof.
- `client`: An instance of PublicClient. Responsible for making the request to the Ethereum node.
- `GetProofParameters`: An object containing:
- `address`: The Ethereum address for which to get the proof.
- `storageKeys`: An array of storage keys (Hex) to fetch the storage proof.
- `block`: The block number (Hex or BigInt), tag ('latest', 'earliest', 'pending'), or hash at which to fetch the proof.

## Returns

`AccountProof`: An object containing:

* `address`: The Ethereum address.
* `accountProof`: Array of hex strings forming the Merkle-Patricia proof of the account's existence and state.
* `balance`: Account's balance at the specified block.
* `nonce`: Account's nonce at the specified block.
* `storageHash`: Hash of the storage root.
* `storageProof`: Array of `StorageProof` objects for each requested storage key.
- `address`: The Ethereum address.
- `accountProof`: Array of hex strings forming the Merkle-Patricia proof of the account's existence and state.
- `balance`: Account's balance at the specified block.
- `nonce`: Account's nonce at the specified block.
- `storageHash`: Hash of the storage root.
- `storageProof`: Array of `StorageProof` objects for each requested storage key.

0 comments on commit c68a5cc

Please sign in to comment.