|
|
|
@ -12,122 +12,126 @@ type method = string |
|
|
|
|
type errorCode int |
|
|
|
|
|
|
|
|
|
type rpcEnumList struct { |
|
|
|
|
GetShardingStructure method |
|
|
|
|
GetBlockByHash method |
|
|
|
|
GetBlockByNumber method |
|
|
|
|
GetBlockTransactionCountByHash method |
|
|
|
|
GetBlockTransactionCountByNumber method |
|
|
|
|
GetCode method |
|
|
|
|
GetTransactionByBlockHashAndIndex method |
|
|
|
|
GetTransactionByBlockNumberAndIndex method |
|
|
|
|
GetTransactionByHash method |
|
|
|
|
GetStakingTransactionByHash method |
|
|
|
|
GetTransactionReceipt method |
|
|
|
|
Syncing method |
|
|
|
|
PeerCount method |
|
|
|
|
GetBalance method |
|
|
|
|
GetStorageAt method |
|
|
|
|
GetTransactionCount method |
|
|
|
|
SendTransaction method |
|
|
|
|
SendRawTransaction method |
|
|
|
|
Subscribe method |
|
|
|
|
GetPastLogs method |
|
|
|
|
GetWork method |
|
|
|
|
GetProof method |
|
|
|
|
GetFilterChanges method |
|
|
|
|
NewPendingTransactionFilter method |
|
|
|
|
NewBlockFilter method |
|
|
|
|
NewFilter method |
|
|
|
|
Call method |
|
|
|
|
EstimateGas method |
|
|
|
|
GasPrice method |
|
|
|
|
BlockNumber method |
|
|
|
|
UnSubscribe method |
|
|
|
|
NetVersion method |
|
|
|
|
ProtocolVersion method |
|
|
|
|
GetNodeMetadata method |
|
|
|
|
GetLatestBlockHeader method |
|
|
|
|
SendRawStakingTransaction method |
|
|
|
|
GetElectedValidatorAddresses method |
|
|
|
|
GetAllValidatorAddresses method |
|
|
|
|
GetValidatorInformation method |
|
|
|
|
GetAllValidatorInformation method |
|
|
|
|
GetDelegationsByDelegator method |
|
|
|
|
GetDelegationsByValidator method |
|
|
|
|
GetCurrentTransactionErrorSink method |
|
|
|
|
GetValidatorMetrics method |
|
|
|
|
GetMedianRawStakeSnapshot method |
|
|
|
|
GetCurrentStakingErrorSink method |
|
|
|
|
GetTransactionsHistory method |
|
|
|
|
GetPendingTxnsInPool method |
|
|
|
|
GetPendingCrosslinks method |
|
|
|
|
GetPendingCXReceipts method |
|
|
|
|
GetCurrentUtilityMetrics method |
|
|
|
|
ResendCX method |
|
|
|
|
GetSuperCommmittees method |
|
|
|
|
GetCurrentBadBlocks method |
|
|
|
|
GetShardID method |
|
|
|
|
GetLastCrossLinks method |
|
|
|
|
GetShardingStructure method |
|
|
|
|
GetBlockByHash method |
|
|
|
|
GetBlockByNumber method |
|
|
|
|
GetBlockTransactionCountByHash method |
|
|
|
|
GetBlockTransactionCountByNumber method |
|
|
|
|
GetCode method |
|
|
|
|
GetTransactionByBlockHashAndIndex method |
|
|
|
|
GetTransactionByBlockNumberAndIndex method |
|
|
|
|
GetTransactionByHash method |
|
|
|
|
GetStakingTransactionByHash method |
|
|
|
|
GetTransactionReceipt method |
|
|
|
|
Syncing method |
|
|
|
|
PeerCount method |
|
|
|
|
GetBalance method |
|
|
|
|
GetStorageAt method |
|
|
|
|
GetTransactionCount method |
|
|
|
|
SendTransaction method |
|
|
|
|
SendRawTransaction method |
|
|
|
|
Subscribe method |
|
|
|
|
GetPastLogs method |
|
|
|
|
GetWork method |
|
|
|
|
GetProof method |
|
|
|
|
GetFilterChanges method |
|
|
|
|
NewPendingTransactionFilter method |
|
|
|
|
NewBlockFilter method |
|
|
|
|
NewFilter method |
|
|
|
|
Call method |
|
|
|
|
EstimateGas method |
|
|
|
|
GasPrice method |
|
|
|
|
BlockNumber method |
|
|
|
|
UnSubscribe method |
|
|
|
|
NetVersion method |
|
|
|
|
ProtocolVersion method |
|
|
|
|
GetNodeMetadata method |
|
|
|
|
GetLatestBlockHeader method |
|
|
|
|
SendRawStakingTransaction method |
|
|
|
|
GetElectedValidatorAddresses method |
|
|
|
|
GetAllValidatorAddresses method |
|
|
|
|
GetValidatorInformation method |
|
|
|
|
GetAllValidatorInformation method |
|
|
|
|
GetValidatorInformationByBlockNumber method |
|
|
|
|
GetAllValidatorInformationByBlockNumber method |
|
|
|
|
GetDelegationsByDelegator method |
|
|
|
|
GetDelegationsByValidator method |
|
|
|
|
GetCurrentTransactionErrorSink method |
|
|
|
|
GetValidatorMetrics method |
|
|
|
|
GetMedianRawStakeSnapshot method |
|
|
|
|
GetCurrentStakingErrorSink method |
|
|
|
|
GetTransactionsHistory method |
|
|
|
|
GetPendingTxnsInPool method |
|
|
|
|
GetPendingCrosslinks method |
|
|
|
|
GetPendingCXReceipts method |
|
|
|
|
GetCurrentUtilityMetrics method |
|
|
|
|
ResendCX method |
|
|
|
|
GetSuperCommmittees method |
|
|
|
|
GetCurrentBadBlocks method |
|
|
|
|
GetShardID method |
|
|
|
|
GetLastCrossLinks method |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Method is a list of known RPC methods
|
|
|
|
|
var Method = rpcEnumList{ |
|
|
|
|
GetShardingStructure: "hmy_getShardingStructure", |
|
|
|
|
GetNodeMetadata: "hmy_getNodeMetadata", |
|
|
|
|
GetLatestBlockHeader: "hmy_latestHeader", |
|
|
|
|
GetBlockByHash: "hmy_getBlockByHash", |
|
|
|
|
GetBlockByNumber: "hmy_getBlockByNumber", |
|
|
|
|
GetBlockTransactionCountByHash: "hmy_getBlockTransactionCountByHash", |
|
|
|
|
GetBlockTransactionCountByNumber: "hmy_getBlockTransactionCountByNumber", |
|
|
|
|
GetCode: "hmy_getCode", |
|
|
|
|
GetTransactionByBlockHashAndIndex: "hmy_getTransactionByBlockHashAndIndex", |
|
|
|
|
GetTransactionByBlockNumberAndIndex: "hmy_getTransactionByBlockNumberAndIndex", |
|
|
|
|
GetTransactionByHash: "hmy_getTransactionByHash", |
|
|
|
|
GetStakingTransactionByHash: "hmy_getStakingTransactionByHash", |
|
|
|
|
GetTransactionReceipt: "hmy_getTransactionReceipt", |
|
|
|
|
Syncing: "hmy_syncing", |
|
|
|
|
PeerCount: "net_peerCount", |
|
|
|
|
GetBalance: "hmy_getBalance", |
|
|
|
|
GetStorageAt: "hmy_getStorageAt", |
|
|
|
|
GetTransactionCount: "hmy_getTransactionCount", |
|
|
|
|
SendTransaction: "hmy_sendTransaction", |
|
|
|
|
SendRawTransaction: "hmy_sendRawTransaction", |
|
|
|
|
Subscribe: "hmy_subscribe", |
|
|
|
|
GetPastLogs: "hmy_getLogs", |
|
|
|
|
GetWork: "hmy_getWork", |
|
|
|
|
GetProof: "hmy_getProof", |
|
|
|
|
GetFilterChanges: "hmy_getFilterChanges", |
|
|
|
|
NewPendingTransactionFilter: "hmy_newPendingTransactionFilter", |
|
|
|
|
NewBlockFilter: "hmy_newBlockFilter", |
|
|
|
|
NewFilter: "hmy_newFilter", |
|
|
|
|
Call: "hmy_call", |
|
|
|
|
EstimateGas: "hmy_estimateGas", |
|
|
|
|
GasPrice: "hmy_gasPrice", |
|
|
|
|
BlockNumber: "hmy_blockNumber", |
|
|
|
|
UnSubscribe: "hmy_unsubscribe", |
|
|
|
|
NetVersion: "net_version", |
|
|
|
|
ProtocolVersion: "hmy_protocolVersion", |
|
|
|
|
SendRawStakingTransaction: "hmy_sendRawStakingTransaction", |
|
|
|
|
GetElectedValidatorAddresses: "hmy_getElectedValidatorAddresses", |
|
|
|
|
GetAllValidatorAddresses: "hmy_getAllValidatorAddresses", |
|
|
|
|
GetValidatorInformation: "hmy_getValidatorInformation", |
|
|
|
|
GetAllValidatorInformation: "hmy_getAllValidatorInformation", |
|
|
|
|
GetDelegationsByDelegator: "hmy_getDelegationsByDelegator", |
|
|
|
|
GetDelegationsByValidator: "hmy_getDelegationsByValidator", |
|
|
|
|
GetCurrentTransactionErrorSink: "hmy_getCurrentTransactionErrorSink", |
|
|
|
|
GetValidatorMetrics: "hmy_getValidatorMetrics", |
|
|
|
|
GetMedianRawStakeSnapshot: "hmy_getMedianRawStakeSnapshot", |
|
|
|
|
GetCurrentStakingErrorSink: "hmy_getCurrentStakingErrorSink", |
|
|
|
|
GetTransactionsHistory: "hmy_getTransactionsHistory", |
|
|
|
|
GetPendingTxnsInPool: "hmy_pendingTransactions", |
|
|
|
|
GetPendingCrosslinks: "hmy_getPendingCrossLinks", |
|
|
|
|
GetPendingCXReceipts: "hmy_getPendingCXReceipts", |
|
|
|
|
GetCurrentUtilityMetrics: "hmy_getCurrentUtilityMetrics", |
|
|
|
|
ResendCX: "hmy_resendCx", |
|
|
|
|
GetSuperCommmittees: "hmy_getSuperCommittees", |
|
|
|
|
GetCurrentBadBlocks: "hmy_getCurrentBadBlocks", |
|
|
|
|
GetShardID: "hmy_getShardID", |
|
|
|
|
GetLastCrossLinks: "hmy_getLastCrossLinks", |
|
|
|
|
GetShardingStructure: "hmy_getShardingStructure", |
|
|
|
|
GetNodeMetadata: "hmy_getNodeMetadata", |
|
|
|
|
GetLatestBlockHeader: "hmy_latestHeader", |
|
|
|
|
GetBlockByHash: "hmy_getBlockByHash", |
|
|
|
|
GetBlockByNumber: "hmy_getBlockByNumber", |
|
|
|
|
GetBlockTransactionCountByHash: "hmy_getBlockTransactionCountByHash", |
|
|
|
|
GetBlockTransactionCountByNumber: "hmy_getBlockTransactionCountByNumber", |
|
|
|
|
GetCode: "hmy_getCode", |
|
|
|
|
GetTransactionByBlockHashAndIndex: "hmy_getTransactionByBlockHashAndIndex", |
|
|
|
|
GetTransactionByBlockNumberAndIndex: "hmy_getTransactionByBlockNumberAndIndex", |
|
|
|
|
GetTransactionByHash: "hmy_getTransactionByHash", |
|
|
|
|
GetStakingTransactionByHash: "hmy_getStakingTransactionByHash", |
|
|
|
|
GetTransactionReceipt: "hmy_getTransactionReceipt", |
|
|
|
|
Syncing: "hmy_syncing", |
|
|
|
|
PeerCount: "net_peerCount", |
|
|
|
|
GetBalance: "hmy_getBalance", |
|
|
|
|
GetStorageAt: "hmy_getStorageAt", |
|
|
|
|
GetTransactionCount: "hmy_getTransactionCount", |
|
|
|
|
SendTransaction: "hmy_sendTransaction", |
|
|
|
|
SendRawTransaction: "hmy_sendRawTransaction", |
|
|
|
|
Subscribe: "hmy_subscribe", |
|
|
|
|
GetPastLogs: "hmy_getLogs", |
|
|
|
|
GetWork: "hmy_getWork", |
|
|
|
|
GetProof: "hmy_getProof", |
|
|
|
|
GetFilterChanges: "hmy_getFilterChanges", |
|
|
|
|
NewPendingTransactionFilter: "hmy_newPendingTransactionFilter", |
|
|
|
|
NewBlockFilter: "hmy_newBlockFilter", |
|
|
|
|
NewFilter: "hmy_newFilter", |
|
|
|
|
Call: "hmy_call", |
|
|
|
|
EstimateGas: "hmy_estimateGas", |
|
|
|
|
GasPrice: "hmy_gasPrice", |
|
|
|
|
BlockNumber: "hmy_blockNumber", |
|
|
|
|
UnSubscribe: "hmy_unsubscribe", |
|
|
|
|
NetVersion: "net_version", |
|
|
|
|
ProtocolVersion: "hmy_protocolVersion", |
|
|
|
|
SendRawStakingTransaction: "hmy_sendRawStakingTransaction", |
|
|
|
|
GetElectedValidatorAddresses: "hmy_getElectedValidatorAddresses", |
|
|
|
|
GetAllValidatorAddresses: "hmy_getAllValidatorAddresses", |
|
|
|
|
GetValidatorInformation: "hmy_getValidatorInformation", |
|
|
|
|
GetAllValidatorInformation: "hmy_getAllValidatorInformation", |
|
|
|
|
GetValidatorInformationByBlockNumber: "hmy_getValidatorInformationByBlockNumber", |
|
|
|
|
GetAllValidatorInformationByBlockNumber: "hmy_getAllValidatorInformationByBlockNumber", |
|
|
|
|
GetDelegationsByDelegator: "hmy_getDelegationsByDelegator", |
|
|
|
|
GetDelegationsByValidator: "hmy_getDelegationsByValidator", |
|
|
|
|
GetCurrentTransactionErrorSink: "hmy_getCurrentTransactionErrorSink", |
|
|
|
|
GetValidatorMetrics: "hmy_getValidatorMetrics", |
|
|
|
|
GetMedianRawStakeSnapshot: "hmy_getMedianRawStakeSnapshot", |
|
|
|
|
GetCurrentStakingErrorSink: "hmy_getCurrentStakingErrorSink", |
|
|
|
|
GetTransactionsHistory: "hmy_getTransactionsHistory", |
|
|
|
|
GetPendingTxnsInPool: "hmy_pendingTransactions", |
|
|
|
|
GetPendingCrosslinks: "hmy_getPendingCrossLinks", |
|
|
|
|
GetPendingCXReceipts: "hmy_getPendingCXReceipts", |
|
|
|
|
GetCurrentUtilityMetrics: "hmy_getCurrentUtilityMetrics", |
|
|
|
|
ResendCX: "hmy_resendCx", |
|
|
|
|
GetSuperCommmittees: "hmy_getSuperCommittees", |
|
|
|
|
GetCurrentBadBlocks: "hmy_getCurrentBadBlocks", |
|
|
|
|
GetShardID: "hmy_getShardID", |
|
|
|
|
GetLastCrossLinks: "hmy_getLastCrossLinks", |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// TODO Use Reflection here to avoid typing out the cases
|
|
|
|
|