Skip to content

Commit 92e4a4a

Browse files
committed
revised copy: fil to eth addr
1 parent 11d2477 commit 92e4a4a

File tree

2 files changed

+46
-43
lines changed

2 files changed

+46
-43
lines changed

reference/json-rpc/eth.md

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,51 @@ Inputs:
3232

3333
Response: `"f01234"`
3434

35+
## FilecoinAddressToEthAddress
36+
37+
FilecoinAddressToEthAddress converts any Filecoin address to an EthAddress.
38+
39+
This method supports all Filecoin address types:
40+
41+
- f0 and f4 addresses: Converted directly.
42+
- f1/f2/f3 addresses: First converted to their corresponding f0 ID address, then to an EthAddress.
43+
44+
> **Note:**
45+
>
46+
> f0 ID addresses are not permanent and can be affected by chain reorganizations. To account for this,
47+
> the API includes a `blkNum` parameter, which specifies the block number that is used to determine the tipset state to use for converting an
48+
> f1/f2/f3 address to an f0 address. This parameter functions similarly to the `blkNum` parameter in the existing `EthGetBlockByNumber` API.
49+
> See [Alchemy Docs - eth_getBlockByNumber](https://docs.alchemy.com/reference/eth-getblockbynumber) for more details.
50+
51+
Requirements:
52+
53+
- For f1/f2/f3 addresses, they must be instantiated on-chain, as f0 ID addresses are only assigned to actors when they are created on-chain.
54+
The simplest way to instantiate an address on chain is to send a transaction to the address.
55+
56+
Parameters:
57+
58+
- filecoinAddress: The Filecoin address to convert.
59+
- blkNum: The block number or state for the conversion. Defaults to "finalized" for maximum safety.
60+
Possible values: "pending", "latest", "finalized", "safe", or a specific block number represented as hex.
61+
62+
Perms: read
63+
64+
Inputs:
65+
66+
```json
67+
["f410", "finalized"]
68+
69+
["f1", "safe"]
70+
```
71+
72+
Response:
73+
74+
```json
75+
"0x5cbeecf99d3fdb3f25e309cc264f240bb0664031"
76+
77+
"0x1234567890abcdef1234567890abcdef12345678"
78+
```
79+
3580
## EthBlockNumber
3681

3782
EthBlockNumber returns the height of the latest (heaviest) TipSet
@@ -48,7 +93,7 @@ Perms: read
4893

4994
Inputs:
5095

51-
```json
96+
```jsona
5297
[
5398
{
5499
"from": "0x5cbeecf99d3fdb3f25e309cc264f240bb0664031",

reference/json-rpc/filecoin.md

Lines changed: 0 additions & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)