@@ -32,6 +32,59 @@ 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 ` 0x ` 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
+ Input:
65
+
66
+ ``` json
67
+ [" t410fghja63ghyzd54cbswfapglsutx5e64xnm7mazwi" ]
68
+ ```
69
+
70
+ Response:
71
+
72
+ ``` json
73
+ " 0x31d20f6cc7c647de0832b140f32e549dfa4f72ed"
74
+ ```
75
+
76
+ Input:
77
+
78
+ ``` json
79
+ [" t15xwdubazj7aft6ylmiw54fa27zyyl3rpc6olgcy" , " safe" ]
80
+ ```
81
+
82
+ Response:
83
+
84
+ ``` json
85
+ " 0xff00000000000000000000000000000000000064"
86
+ ```
87
+
35
88
## EthBlockNumber
36
89
37
90
EthBlockNumber returns the height of the latest (heaviest) TipSet
@@ -48,7 +101,7 @@ Perms: read
48
101
49
102
Inputs:
50
103
51
- ``` json
104
+ ``` jsona
52
105
[
53
106
{
54
107
"from": "0x5cbeecf99d3fdb3f25e309cc264f240bb0664031",
@@ -823,4 +876,4 @@ Inputs:
823
876
[" 0x37690cfec6c1bf4c3b9288c7a5d783e98731e90b0a4c177c2a374c7a9427355e" ]
824
877
```
825
878
826
- Response: ` true `
879
+ Response: ` true `
0 commit comments