@@ -32,6 +32,51 @@ Inputs:
32
32
33
33
Response: ` "f01234" `
34
34
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
+
35
80
## EthBlockNumber
36
81
37
82
EthBlockNumber returns the height of the latest (heaviest) TipSet
@@ -48,7 +93,7 @@ Perms: read
48
93
49
94
Inputs:
50
95
51
- ``` json
96
+ ``` jsona
52
97
[
53
98
{
54
99
"from": "0x5cbeecf99d3fdb3f25e309cc264f240bb0664031",
0 commit comments