Skip to content

Commit

Permalink
add filecoin methods
Browse files Browse the repository at this point in the history
  • Loading branch information
aarifkhamdi committed Sep 4, 2024
1 parent ad79f2c commit 1f29498
Showing 1 changed file with 153 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,156 @@ class DefaultEthereumMethods(
"eth_chainId",
)

private val filecoinMethods = listOf(
"Filecoin.ChainBlockstoreInfo",
"Filecoin.ChainExport",
"Filecoin.ChainGetBlock",
"Filecoin.ChainGetBlockMessages",
"Filecoin.ChainGetEvents",
"Filecoin.ChainGetGenesis",
"Filecoin.ChainGetMessage",
"Filecoin.ChainGetMessagesInTipset",
"Filecoin.ChainGetNode",
"Filecoin.ChainGetParentMessages",
"Filecoin.ChainGetParentReceipts",
"Filecoin.ChainGetPath",
"Filecoin.ChainGetTipSet",
"Filecoin.ChainGetTipSetAfterHeight",
"Filecoin.ChainGetTipSetByHeight",
"Filecoin.ChainHasObj",
"Filecoin.ChainHead",
"Filecoin.ChainHotGC",
"Filecoin.ChainNotify",
"Filecoin.ChainReadObj",
"Filecoin.ChainStatObj",
"Filecoin.ChainTipSetWeight",
"Filecoin.ClientDealPieceCID",
"Filecoin.ClientDealSize",
"Filecoin.ClientFindData",
"Filecoin.ClientGetDealInfo",
"Filecoin.ClientGetDealStatus",
"Filecoin.ClientMinerQueryOffer",
"Filecoin.ClientQueryAsk",
"Filecoin.GasEstimateFeeCap",
"Filecoin.GasEstimateGasLimit",
"Filecoin.GasEstimateGasPremium",
"Filecoin.GasEstimateMessageGas",
"Filecoin.ID",
"Filecoin.MinerGetBaseInfo",
"Filecoin.MpoolCheckMessages",
"Filecoin.MpoolCheckPendingMessages",
"Filecoin.MpoolCheckReplaceMessages",
"Filecoin.MpoolGetConfig",
"Filecoin.MpoolGetNonce",
"Filecoin.MpoolPending",
"Filecoin.MpoolPush",
"Filecoin.MpoolSelect",
"Filecoin.MpoolSub",
"Filecoin.MsigGetAvailableBalance",
"Filecoin.MsigGetPending",
"Filecoin.MsigGetVested",
"Filecoin.MsigGetVestingSchedule",
"Filecoin.NetAddrsListen",
"Filecoin.NetAgentVersion",
"Filecoin.NetAutoNatStatus",
"Filecoin.NetBandwidthStats",
"Filecoin.NetBandwidthStatsByPeer",
"Filecoin.NetBandwidthStatsByProtocol",
"Filecoin.NetBlockList",
"Filecoin.NetConnectedness",
"Filecoin.NetFindPeer",
"Filecoin.NetLimit",
"Filecoin.NetListening",
"Filecoin.NetPeerInfo",
"Filecoin.NetPeers",
"Filecoin.NetPing",
"Filecoin.NetProtectList",
"Filecoin.NetPubsubScores",
"Filecoin.NetStat",
"Filecoin.NetVersion",
"Filecoin.NodeStatus",
"Filecoin.PaychList",
"Filecoin.PaychStatus",
"Filecoin.PaychVoucherCheckSpendable",
"Filecoin.PaychVoucherCheckValid",
"Filecoin.RaftLeader",
"Filecoin.RaftState",
"Filecoin.StartTime",
"Filecoin.StateAccountKey",
"Filecoin.StateActorCodeCIDs",
"Filecoin.StateActorManifestCID",
"Filecoin.StateAllMinerFaults",
"Filecoin.StateCall",
"Filecoin.StateChangedActors",
"Filecoin.StateCirculatingSupply",
"Filecoin.StateCompute",
"Filecoin.StateComputeDataCID",
"Filecoin.StateDealProviderCollateralBounds",
"Filecoin.StateDecodeParams",
"Filecoin.StateEncodeParams",
"Filecoin.StateGetActor",
"Filecoin.StateGetAllocation",
"Filecoin.StateGetAllocationForPendingDeal",
"Filecoin.StateGetAllocations",
"Filecoin.StateGetBeaconEntry",
"Filecoin.StateGetClaim",
"Filecoin.StateGetClaims",
"Filecoin.StateGetNetworkParams",
"Filecoin.StateGetRandomnessDigestFromBeacon",
"Filecoin.StateGetRandomnessDigestFromTickets",
"Filecoin.StateGetRandomnessFromBeacon",
"Filecoin.StateGetRandomnessFromTickets",
"Filecoin.StateGetReceipt",
"Filecoin.StateListActors",
"Filecoin.StateListMessages",
"Filecoin.StateListMiners",
"Filecoin.StateLookupID",
"Filecoin.StateLookupRobustAddress",
"Filecoin.StateMarketBalance",
"Filecoin.StateMarketDeals",
"Filecoin.StateMarketParticipants",
"Filecoin.StateMarketStorageDeal",
"Filecoin.StateMinerActiveSectors",
"Filecoin.StateMinerAllocated",
"Filecoin.StateMinerAvailableBalance",
"Filecoin.StateMinerDeadlines",
"Filecoin.StateMinerFaults",
"Filecoin.StateMinerInfo",
"Filecoin.StateMinerInitialPledgeCollateral",
"Filecoin.StateMinerPartitions",
"Filecoin.StateMinerPower",
"Filecoin.StateMinerPreCommitDepositForPower",
"Filecoin.StateMinerProvingDeadline",
"Filecoin.StateMinerRecoveries",
"Filecoin.StateMinerSectorAllocated",
"Filecoin.StateMinerSectorCount",
"Filecoin.StateMinerSectors",
"Filecoin.StateNetworkName",
"Filecoin.StateNetworkVersion",
"Filecoin.StateReadState",
"Filecoin.StateReplay",
"Filecoin.StateSearchMsg",
"Filecoin.StateSearchMsgLimited",
"Filecoin.StateSectorExpiration",
"Filecoin.StateSectorGetInfo",
"Filecoin.StateSectorPartition",
"Filecoin.StateSectorPreCommitInfo",
"Filecoin.StateVerifiedClientStatus",
"Filecoin.StateVerifiedRegistryRootKey",
"Filecoin.StateVerifierStatus",
"Filecoin.StateVMCirculatingSupplyInternal",
"Filecoin.StateWaitMsg",
"Filecoin.StateWaitMsgLimited",
"Filecoin.SyncCheckBad",
"Filecoin.SyncIncomingBlocks",
"Filecoin.SyncState",
"Filecoin.SyncValidateTipset",
"Filecoin.WalletBalance",
"Filecoin.WalletValidateAddress",
"Filecoin.WalletVerify",
"Filecoin.Web3ClientVersion",
)

private val klayMethods = listOf(
"klay_accountCreated",
"klay_accounts",
Expand Down Expand Up @@ -348,7 +498,7 @@ class DefaultEthereumMethods(
specialMethods.contains(method) || harmonySpecialMethods.contains(method) || klaySpecialMethods.contains(method) -> {
when (method) {
"eth_getTransactionCount", "hmy_getTransactionCount", "klay_getTransactionCount" -> MaximumValueQuorum()
"eth_sendRawTransaction", "hmy_sendRawStakingTransaction", "hmy_sendRawTransaction", "klay_sendRawTransaction" -> BroadcastQuorum()
"eth_sendRawTransaction", "hmy_sendRawStakingTransaction", "hmy_sendRawTransaction", "klay_sendRawTransaction", "Filecoin.MpoolPush" -> BroadcastQuorum()
else -> AlwaysQuorum()
}
}
Expand Down Expand Up @@ -461,6 +611,8 @@ class DefaultEthereumMethods(
"buildTransaction",
)

Chain.FILECOIN__MAINNET, Chain.FILECOIN__CALIBRATION_TESTNET -> filecoinMethods

else -> emptyList()
}
}
Expand Down

0 comments on commit 1f29498

Please sign in to comment.