parent
fe5160ab2c
commit
e603dddebe
@ -0,0 +1,72 @@ |
||||
package common |
||||
|
||||
type RpcMethod = string |
||||
|
||||
type RpcEnumList struct { |
||||
GetShardingStructure RpcMethod |
||||
GetBlockByHash RpcMethod |
||||
GetBlockByNumber RpcMethod |
||||
GetBlockTransactionCountByHash RpcMethod |
||||
GetBlockTransactionCountByNumber RpcMethod |
||||
GetCode RpcMethod |
||||
GetTransactionByBlockHashAndIndex RpcMethod |
||||
GetTransactionByBlockNumberAndIndex RpcMethod |
||||
GetTransactionByHash RpcMethod |
||||
GetStakingTransactionByHash RpcMethod |
||||
GetTransactionReceipt RpcMethod |
||||
Syncing RpcMethod |
||||
PeerCount RpcMethod |
||||
GetBalance RpcMethod |
||||
GetStorageAt RpcMethod |
||||
GetTransactionCount RpcMethod |
||||
SendTransaction RpcMethod |
||||
SendRawTransaction RpcMethod |
||||
Subscribe RpcMethod |
||||
GetPastLogs RpcMethod |
||||
GetWork RpcMethod |
||||
GetProof RpcMethod |
||||
GetFilterChanges RpcMethod |
||||
NewPendingTransactionFilter RpcMethod |
||||
NewBlockFilter RpcMethod |
||||
NewFilter RpcMethod |
||||
Call RpcMethod |
||||
EstimateGas RpcMethod |
||||
GasPrice RpcMethod |
||||
BlockNumber RpcMethod |
||||
UnSubscribe RpcMethod |
||||
NetVersion RpcMethod |
||||
ProtocolVersion RpcMethod |
||||
GetNodeMetadata RpcMethod |
||||
GetLatestBlockHeader RpcMethod |
||||
SendRawStakingTransaction RpcMethod |
||||
GetElectedValidatorAddresses RpcMethod |
||||
GetAllValidatorAddresses RpcMethod |
||||
GetValidatorInformation RpcMethod |
||||
GetAllValidatorInformation RpcMethod |
||||
GetValidatorInformationByBlockNumber RpcMethod |
||||
GetAllValidatorInformationByBlockNumber RpcMethod |
||||
GetDelegationsByDelegator RpcMethod |
||||
GetDelegationsByValidator RpcMethod |
||||
GetCurrentTransactionErrorSink RpcMethod |
||||
GetMedianRawStakeSnapshot RpcMethod |
||||
GetCurrentStakingErrorSink RpcMethod |
||||
GetTransactionsHistory RpcMethod |
||||
GetPendingTxnsInPool RpcMethod |
||||
GetPendingCrosslinks RpcMethod |
||||
GetPendingCXReceipts RpcMethod |
||||
GetCurrentUtilityMetrics RpcMethod |
||||
ResendCX RpcMethod |
||||
GetSuperCommmittees RpcMethod |
||||
GetCurrentBadBlocks RpcMethod |
||||
GetShardID RpcMethod |
||||
GetLastCrossLinks RpcMethod |
||||
GetLatestChainHeaders RpcMethod |
||||
} |
||||
|
||||
// ValidatedMethod checks if given method is known
|
||||
func ValidatedMethod(m RpcMethod) string { |
||||
switch m := RpcMethod(m); m { |
||||
default: |
||||
return string(m) |
||||
} |
||||
} |
@ -0,0 +1,73 @@ |
||||
package v1 |
||||
|
||||
import ( |
||||
"fmt" |
||||
|
||||
rpcCommon "github.com/harmony-one/go-sdk/pkg/rpc/common" |
||||
) |
||||
|
||||
const ( |
||||
prefix = "eth" |
||||
) |
||||
|
||||
// Method is a list of known RPC methods
|
||||
var Method = rpcCommon.RpcEnumList{ |
||||
GetShardingStructure: fmt.Sprintf("%s_getShardingStructure", prefix), |
||||
GetNodeMetadata: fmt.Sprintf("%s_getNodeMetadata", prefix), |
||||
GetLatestBlockHeader: fmt.Sprintf("%s_latestHeader", prefix), |
||||
GetBlockByHash: fmt.Sprintf("%s_getBlockByHash", prefix), |
||||
GetBlockByNumber: fmt.Sprintf("%s_getBlockByNumber", prefix), |
||||
GetBlockTransactionCountByHash: fmt.Sprintf("%s_getBlockTransactionCountByHash", prefix), |
||||
GetBlockTransactionCountByNumber: fmt.Sprintf("%s_getBlockTransactionCountByNumber", prefix), |
||||
GetCode: fmt.Sprintf("%s_getCode", prefix), |
||||
GetTransactionByBlockHashAndIndex: fmt.Sprintf("%s_getTransactionByBlockHashAndIndex", prefix), |
||||
GetTransactionByBlockNumberAndIndex: fmt.Sprintf("%s_getTransactionByBlockNumberAndIndex", prefix), |
||||
GetTransactionByHash: fmt.Sprintf("%s_getTransactionByHash", prefix), |
||||
GetStakingTransactionByHash: fmt.Sprintf("%s_getStakingTransactionByHash", prefix), |
||||
GetTransactionReceipt: fmt.Sprintf("%s_getTransactionReceipt", prefix), |
||||
Syncing: fmt.Sprintf("%s_syncing", prefix), |
||||
PeerCount: "net_peerCount", |
||||
GetBalance: fmt.Sprintf("%s_getBalance", prefix), |
||||
GetStorageAt: fmt.Sprintf("%s_getStorageAt", prefix), |
||||
GetTransactionCount: fmt.Sprintf("%s_getTransactionCount", prefix), |
||||
SendTransaction: fmt.Sprintf("%s_sendTransaction", prefix), |
||||
SendRawTransaction: fmt.Sprintf("%s_sendRawTransaction", prefix), |
||||
Subscribe: fmt.Sprintf("%s_subscribe", prefix), |
||||
GetPastLogs: fmt.Sprintf("%s_getLogs", prefix), |
||||
GetWork: fmt.Sprintf("%s_getWork", prefix), |
||||
GetProof: fmt.Sprintf("%s_getProof", prefix), |
||||
GetFilterChanges: fmt.Sprintf("%s_getFilterChanges", prefix), |
||||
NewPendingTransactionFilter: fmt.Sprintf("%s_newPendingTransactionFilter", prefix), |
||||
NewBlockFilter: fmt.Sprintf("%s_newBlockFilter", prefix), |
||||
NewFilter: fmt.Sprintf("%s_newFilter", prefix), |
||||
Call: fmt.Sprintf("%s_call", prefix), |
||||
EstimateGas: fmt.Sprintf("%s_estimateGas", prefix), |
||||
GasPrice: fmt.Sprintf("%s_gasPrice", prefix), |
||||
BlockNumber: fmt.Sprintf("%s_blockNumber", prefix), |
||||
UnSubscribe: fmt.Sprintf("%s_unsubscribe", prefix), |
||||
NetVersion: "net_version", |
||||
ProtocolVersion: fmt.Sprintf("%s_protocolVersion", prefix), |
||||
SendRawStakingTransaction: fmt.Sprintf("%s_sendRawStakingTransaction", prefix), |
||||
GetElectedValidatorAddresses: fmt.Sprintf("%s_getElectedValidatorAddresses", prefix), |
||||
GetAllValidatorAddresses: fmt.Sprintf("%s_getAllValidatorAddresses", prefix), |
||||
GetValidatorInformation: fmt.Sprintf("%s_getValidatorInformation", prefix), |
||||
GetAllValidatorInformation: fmt.Sprintf("%s_getAllValidatorInformation", prefix), |
||||
GetValidatorInformationByBlockNumber: fmt.Sprintf("%s_getValidatorInformationByBlockNumber", prefix), |
||||
GetAllValidatorInformationByBlockNumber: fmt.Sprintf("%s_getAllValidatorInformationByBlockNumber", prefix), |
||||
GetDelegationsByDelegator: fmt.Sprintf("%s_getDelegationsByDelegator", prefix), |
||||
GetDelegationsByValidator: fmt.Sprintf("%s_getDelegationsByValidator", prefix), |
||||
GetCurrentTransactionErrorSink: fmt.Sprintf("%s_getCurrentTransactionErrorSink", prefix), |
||||
GetMedianRawStakeSnapshot: fmt.Sprintf("%s_getMedianRawStakeSnapshot", prefix), |
||||
GetCurrentStakingErrorSink: fmt.Sprintf("%s_getCurrentStakingErrorSink", prefix), |
||||
GetTransactionsHistory: fmt.Sprintf("%s_getTransactionsHistory", prefix), |
||||
GetPendingTxnsInPool: fmt.Sprintf("%s_pendingTransactions", prefix), |
||||
GetPendingCrosslinks: fmt.Sprintf("%s_getPendingCrossLinks", prefix), |
||||
GetPendingCXReceipts: fmt.Sprintf("%s_getPendingCXReceipts", prefix), |
||||
GetCurrentUtilityMetrics: fmt.Sprintf("%s_getCurrentUtilityMetrics", prefix), |
||||
ResendCX: fmt.Sprintf("%s_resendCx", prefix), |
||||
GetSuperCommmittees: fmt.Sprintf("%s_getSuperCommittees", prefix), |
||||
GetCurrentBadBlocks: fmt.Sprintf("%s_getCurrentBadBlocks", prefix), |
||||
GetShardID: fmt.Sprintf("%s_getShardID", prefix), |
||||
GetLastCrossLinks: fmt.Sprintf("%s_getLastCrossLinks", prefix), |
||||
GetLatestChainHeaders: fmt.Sprintf("%s_getLatestChainHeaders", prefix), |
||||
} |
@ -0,0 +1,73 @@ |
||||
package v1 |
||||
|
||||
import ( |
||||
"fmt" |
||||
|
||||
rpcCommon "github.com/harmony-one/go-sdk/pkg/rpc/common" |
||||
) |
||||
|
||||
const ( |
||||
prefix = "hmy" |
||||
) |
||||
|
||||
// Method is a list of known RPC methods
|
||||
var Method = rpcCommon.RpcEnumList{ |
||||
GetShardingStructure: fmt.Sprintf("%s_getShardingStructure", prefix), |
||||
GetNodeMetadata: fmt.Sprintf("%s_getNodeMetadata", prefix), |
||||
GetLatestBlockHeader: fmt.Sprintf("%s_latestHeader", prefix), |
||||
GetBlockByHash: fmt.Sprintf("%s_getBlockByHash", prefix), |
||||
GetBlockByNumber: fmt.Sprintf("%s_getBlockByNumber", prefix), |
||||
GetBlockTransactionCountByHash: fmt.Sprintf("%s_getBlockTransactionCountByHash", prefix), |
||||
GetBlockTransactionCountByNumber: fmt.Sprintf("%s_getBlockTransactionCountByNumber", prefix), |
||||
GetCode: fmt.Sprintf("%s_getCode", prefix), |
||||
GetTransactionByBlockHashAndIndex: fmt.Sprintf("%s_getTransactionByBlockHashAndIndex", prefix), |
||||
GetTransactionByBlockNumberAndIndex: fmt.Sprintf("%s_getTransactionByBlockNumberAndIndex", prefix), |
||||
GetTransactionByHash: fmt.Sprintf("%s_getTransactionByHash", prefix), |
||||
GetStakingTransactionByHash: fmt.Sprintf("%s_getStakingTransactionByHash", prefix), |
||||
GetTransactionReceipt: fmt.Sprintf("%s_getTransactionReceipt", prefix), |
||||
Syncing: fmt.Sprintf("%s_syncing", prefix), |
||||
PeerCount: "net_peerCount", |
||||
GetBalance: fmt.Sprintf("%s_getBalance", prefix), |
||||
GetStorageAt: fmt.Sprintf("%s_getStorageAt", prefix), |
||||
GetTransactionCount: fmt.Sprintf("%s_getTransactionCount", prefix), |
||||
SendTransaction: fmt.Sprintf("%s_sendTransaction", prefix), |
||||
SendRawTransaction: fmt.Sprintf("%s_sendRawTransaction", prefix), |
||||
Subscribe: fmt.Sprintf("%s_subscribe", prefix), |
||||
GetPastLogs: fmt.Sprintf("%s_getLogs", prefix), |
||||
GetWork: fmt.Sprintf("%s_getWork", prefix), |
||||
GetProof: fmt.Sprintf("%s_getProof", prefix), |
||||
GetFilterChanges: fmt.Sprintf("%s_getFilterChanges", prefix), |
||||
NewPendingTransactionFilter: fmt.Sprintf("%s_newPendingTransactionFilter", prefix), |
||||
NewBlockFilter: fmt.Sprintf("%s_newBlockFilter", prefix), |
||||
NewFilter: fmt.Sprintf("%s_newFilter", prefix), |
||||
Call: fmt.Sprintf("%s_call", prefix), |
||||
EstimateGas: fmt.Sprintf("%s_estimateGas", prefix), |
||||
GasPrice: fmt.Sprintf("%s_gasPrice", prefix), |
||||
BlockNumber: fmt.Sprintf("%s_blockNumber", prefix), |
||||
UnSubscribe: fmt.Sprintf("%s_unsubscribe", prefix), |
||||
NetVersion: "net_version", |
||||
ProtocolVersion: fmt.Sprintf("%s_protocolVersion", prefix), |
||||
SendRawStakingTransaction: fmt.Sprintf("%s_sendRawStakingTransaction", prefix), |
||||
GetElectedValidatorAddresses: fmt.Sprintf("%s_getElectedValidatorAddresses", prefix), |
||||
GetAllValidatorAddresses: fmt.Sprintf("%s_getAllValidatorAddresses", prefix), |
||||
GetValidatorInformation: fmt.Sprintf("%s_getValidatorInformation", prefix), |
||||
GetAllValidatorInformation: fmt.Sprintf("%s_getAllValidatorInformation", prefix), |
||||
GetValidatorInformationByBlockNumber: fmt.Sprintf("%s_getValidatorInformationByBlockNumber", prefix), |
||||
GetAllValidatorInformationByBlockNumber: fmt.Sprintf("%s_getAllValidatorInformationByBlockNumber", prefix), |
||||
GetDelegationsByDelegator: fmt.Sprintf("%s_getDelegationsByDelegator", prefix), |
||||
GetDelegationsByValidator: fmt.Sprintf("%s_getDelegationsByValidator", prefix), |
||||
GetCurrentTransactionErrorSink: fmt.Sprintf("%s_getCurrentTransactionErrorSink", prefix), |
||||
GetMedianRawStakeSnapshot: fmt.Sprintf("%s_getMedianRawStakeSnapshot", prefix), |
||||
GetCurrentStakingErrorSink: fmt.Sprintf("%s_getCurrentStakingErrorSink", prefix), |
||||
GetTransactionsHistory: fmt.Sprintf("%s_getTransactionsHistory", prefix), |
||||
GetPendingTxnsInPool: fmt.Sprintf("%s_pendingTransactions", prefix), |
||||
GetPendingCrosslinks: fmt.Sprintf("%s_getPendingCrossLinks", prefix), |
||||
GetPendingCXReceipts: fmt.Sprintf("%s_getPendingCXReceipts", prefix), |
||||
GetCurrentUtilityMetrics: fmt.Sprintf("%s_getCurrentUtilityMetrics", prefix), |
||||
ResendCX: fmt.Sprintf("%s_resendCx", prefix), |
||||
GetSuperCommmittees: fmt.Sprintf("%s_getSuperCommittees", prefix), |
||||
GetCurrentBadBlocks: fmt.Sprintf("%s_getCurrentBadBlocks", prefix), |
||||
GetShardID: fmt.Sprintf("%s_getShardID", prefix), |
||||
GetLastCrossLinks: fmt.Sprintf("%s_getLastCrossLinks", prefix), |
||||
GetLatestChainHeaders: fmt.Sprintf("%s_getLatestChainHeaders", prefix), |
||||
} |
Loading…
Reference in new issue