2022-12-13 17:14:03 +00:00
|
|
|
package api
|
|
|
|
|
|
|
|
import apitypes "github.com/filecoin-project/lotus/api/types"
|
|
|
|
|
2023-01-13 19:08:35 +00:00
|
|
|
func CreateEthRPCAliases(as apitypes.Aliaser) {
|
2022-12-13 17:14:03 +00:00
|
|
|
// TODO: maybe use reflect to automatically register all the eth aliases
|
|
|
|
as.AliasMethod("eth_accounts", "Filecoin.EthAccounts")
|
|
|
|
as.AliasMethod("eth_blockNumber", "Filecoin.EthBlockNumber")
|
|
|
|
as.AliasMethod("eth_getBlockTransactionCountByNumber", "Filecoin.EthGetBlockTransactionCountByNumber")
|
|
|
|
as.AliasMethod("eth_getBlockTransactionCountByHash", "Filecoin.EthGetBlockTransactionCountByHash")
|
|
|
|
|
|
|
|
as.AliasMethod("eth_getBlockByHash", "Filecoin.EthGetBlockByHash")
|
|
|
|
as.AliasMethod("eth_getBlockByNumber", "Filecoin.EthGetBlockByNumber")
|
|
|
|
as.AliasMethod("eth_getTransactionByHash", "Filecoin.EthGetTransactionByHash")
|
|
|
|
as.AliasMethod("eth_getTransactionCount", "Filecoin.EthGetTransactionCount")
|
|
|
|
as.AliasMethod("eth_getTransactionReceipt", "Filecoin.EthGetTransactionReceipt")
|
|
|
|
as.AliasMethod("eth_getTransactionByBlockHashAndIndex", "Filecoin.EthGetTransactionByBlockHashAndIndex")
|
|
|
|
as.AliasMethod("eth_getTransactionByBlockNumberAndIndex", "Filecoin.EthGetTransactionByBlockNumberAndIndex")
|
|
|
|
|
|
|
|
as.AliasMethod("eth_getCode", "Filecoin.EthGetCode")
|
|
|
|
as.AliasMethod("eth_getStorageAt", "Filecoin.EthGetStorageAt")
|
|
|
|
as.AliasMethod("eth_getBalance", "Filecoin.EthGetBalance")
|
|
|
|
as.AliasMethod("eth_chainId", "Filecoin.EthChainId")
|
2023-04-21 12:02:40 +00:00
|
|
|
as.AliasMethod("eth_syncing", "Filecoin.EthSyncing")
|
2022-12-13 17:14:03 +00:00
|
|
|
as.AliasMethod("eth_feeHistory", "Filecoin.EthFeeHistory")
|
|
|
|
as.AliasMethod("eth_protocolVersion", "Filecoin.EthProtocolVersion")
|
|
|
|
as.AliasMethod("eth_maxPriorityFeePerGas", "Filecoin.EthMaxPriorityFeePerGas")
|
|
|
|
as.AliasMethod("eth_gasPrice", "Filecoin.EthGasPrice")
|
|
|
|
as.AliasMethod("eth_sendRawTransaction", "Filecoin.EthSendRawTransaction")
|
|
|
|
as.AliasMethod("eth_estimateGas", "Filecoin.EthEstimateGas")
|
|
|
|
as.AliasMethod("eth_call", "Filecoin.EthCall")
|
|
|
|
|
|
|
|
as.AliasMethod("eth_getLogs", "Filecoin.EthGetLogs")
|
|
|
|
as.AliasMethod("eth_getFilterChanges", "Filecoin.EthGetFilterChanges")
|
|
|
|
as.AliasMethod("eth_getFilterLogs", "Filecoin.EthGetFilterLogs")
|
|
|
|
as.AliasMethod("eth_newFilter", "Filecoin.EthNewFilter")
|
|
|
|
as.AliasMethod("eth_newBlockFilter", "Filecoin.EthNewBlockFilter")
|
|
|
|
as.AliasMethod("eth_newPendingTransactionFilter", "Filecoin.EthNewPendingTransactionFilter")
|
|
|
|
as.AliasMethod("eth_uninstallFilter", "Filecoin.EthUninstallFilter")
|
|
|
|
as.AliasMethod("eth_subscribe", "Filecoin.EthSubscribe")
|
|
|
|
as.AliasMethod("eth_unsubscribe", "Filecoin.EthUnsubscribe")
|
|
|
|
|
|
|
|
as.AliasMethod("net_version", "Filecoin.NetVersion")
|
|
|
|
as.AliasMethod("net_listening", "Filecoin.NetListening")
|
2023-01-25 03:56:04 +00:00
|
|
|
|
|
|
|
as.AliasMethod("web3_clientVersion", "Filecoin.Web3ClientVersion")
|
2022-12-13 17:14:03 +00:00
|
|
|
}
|