Calls
Utility functions for encoding and decoding ERC-7821 calls.
Examples
Below are some examples demonstrating common usages of the Calls
module:
Encoding calls
Calls can be encoded using Calls.encode
.
import { Calls } from 'ox/erc7821'
const calls = Calls.encode([
{
data: '0xcafebabe',
to: '0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef',
value: 1n,
}
])
Decoding calls
Calls can be decoded using Calls.decode
.
import { Calls } from 'ox/erc7821'
const { calls } = Calls.decode('0x...')
Functions
Name | Description |
---|---|
Calls.decode | Decodes a set of ERC-7821 calls from encoded data. |
Calls.encode | Encodes a set of ERC-7821 calls. |
Calls.getAbiParameters | Gets the ABI parameters for the ERC-7821 calls. |
Types
Name | Description |
---|---|
Calls.Call |