|
|
@ -10,6 +10,117 @@ import ( |
|
|
|
"github.com/ethereum/go-ethereum/xeth" |
|
|
|
"github.com/ethereum/go-ethereum/xeth" |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var ( |
|
|
|
|
|
|
|
// Mapping between the different methods each api supports
|
|
|
|
|
|
|
|
AutoCompletion = map[string][]string{ |
|
|
|
|
|
|
|
"admin": []string{ |
|
|
|
|
|
|
|
"addPeer", |
|
|
|
|
|
|
|
"peers", |
|
|
|
|
|
|
|
"nodeInfo", |
|
|
|
|
|
|
|
"exportChain", |
|
|
|
|
|
|
|
"importChain", |
|
|
|
|
|
|
|
"verbosity", |
|
|
|
|
|
|
|
"chainSyncStatus", |
|
|
|
|
|
|
|
"setSolc", |
|
|
|
|
|
|
|
"datadir", |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
"debug": []string{ |
|
|
|
|
|
|
|
"dumpBlock", |
|
|
|
|
|
|
|
"getBlockRlp", |
|
|
|
|
|
|
|
"printBlock", |
|
|
|
|
|
|
|
"processBlock", |
|
|
|
|
|
|
|
"seedHash", |
|
|
|
|
|
|
|
"setHead", |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
"eth": []string{ |
|
|
|
|
|
|
|
"accounts", |
|
|
|
|
|
|
|
"blockNumber", |
|
|
|
|
|
|
|
"getBalance", |
|
|
|
|
|
|
|
"protocolVersion", |
|
|
|
|
|
|
|
"coinbase", |
|
|
|
|
|
|
|
"mining", |
|
|
|
|
|
|
|
"gasPrice", |
|
|
|
|
|
|
|
"getStorage", |
|
|
|
|
|
|
|
"storageAt", |
|
|
|
|
|
|
|
"getStorageAt", |
|
|
|
|
|
|
|
"getTransactionCount", |
|
|
|
|
|
|
|
"getBlockTransactionCountByHash", |
|
|
|
|
|
|
|
"getBlockTransactionCountByNumber", |
|
|
|
|
|
|
|
"getUncleCountByBlockHash", |
|
|
|
|
|
|
|
"getUncleCountByBlockNumber", |
|
|
|
|
|
|
|
"getData", |
|
|
|
|
|
|
|
"getCode", |
|
|
|
|
|
|
|
"sign", |
|
|
|
|
|
|
|
"sendTransaction", |
|
|
|
|
|
|
|
"transact", |
|
|
|
|
|
|
|
"estimateGas", |
|
|
|
|
|
|
|
"call", |
|
|
|
|
|
|
|
"flush", |
|
|
|
|
|
|
|
"getBlockByHash", |
|
|
|
|
|
|
|
"getBlockByNumber", |
|
|
|
|
|
|
|
"getTransactionByHash", |
|
|
|
|
|
|
|
"getTransactionByBlockHashAndIndex", |
|
|
|
|
|
|
|
"getUncleByBlockHashAndIndex", |
|
|
|
|
|
|
|
"getUncleByBlockNumberAndIndex", |
|
|
|
|
|
|
|
"getCompilers", |
|
|
|
|
|
|
|
"compileSolidity", |
|
|
|
|
|
|
|
"newFilter", |
|
|
|
|
|
|
|
"newBlockFilter", |
|
|
|
|
|
|
|
"newPendingTransactionFilter", |
|
|
|
|
|
|
|
"uninstallFilter", |
|
|
|
|
|
|
|
"getFilterChanges", |
|
|
|
|
|
|
|
"getFilterLogs", |
|
|
|
|
|
|
|
"getLogs", |
|
|
|
|
|
|
|
"hashrate", |
|
|
|
|
|
|
|
"getWork", |
|
|
|
|
|
|
|
"submitWork", |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
"miner": []string{ |
|
|
|
|
|
|
|
"hashrate", |
|
|
|
|
|
|
|
"makeDAG", |
|
|
|
|
|
|
|
"setExtra", |
|
|
|
|
|
|
|
"setGasPrice", |
|
|
|
|
|
|
|
"startAutoDAG", |
|
|
|
|
|
|
|
"start", |
|
|
|
|
|
|
|
"stopAutoDAG", |
|
|
|
|
|
|
|
"stop", |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
"net": []string{ |
|
|
|
|
|
|
|
"peerCount", |
|
|
|
|
|
|
|
"listening", |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
"personal": []string{ |
|
|
|
|
|
|
|
"listAccounts", |
|
|
|
|
|
|
|
"newAccount", |
|
|
|
|
|
|
|
"deleteAccount", |
|
|
|
|
|
|
|
"unlockAccount", |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
"shh": []string{ |
|
|
|
|
|
|
|
"version", |
|
|
|
|
|
|
|
"post", |
|
|
|
|
|
|
|
"hasIdentity", |
|
|
|
|
|
|
|
"newIdentity", |
|
|
|
|
|
|
|
"newFilter", |
|
|
|
|
|
|
|
"uninstallFilter", |
|
|
|
|
|
|
|
"getFilterChanges", |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
"txpool": []string{ |
|
|
|
|
|
|
|
"status", |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
"web3": []string{ |
|
|
|
|
|
|
|
"sha3", |
|
|
|
|
|
|
|
"version", |
|
|
|
|
|
|
|
"fromWei", |
|
|
|
|
|
|
|
"toWei", |
|
|
|
|
|
|
|
"toHex", |
|
|
|
|
|
|
|
"toAscii", |
|
|
|
|
|
|
|
"fromAscii", |
|
|
|
|
|
|
|
"toBigNumber", |
|
|
|
|
|
|
|
"isAddress", |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
// Parse a comma separated API string to individual api's
|
|
|
|
// Parse a comma separated API string to individual api's
|
|
|
|
func ParseApiString(apistr string, codec codec.Codec, xeth *xeth.XEth, eth *eth.Ethereum) ([]EthereumApi, error) { |
|
|
|
func ParseApiString(apistr string, codec codec.Codec, xeth *xeth.XEth, eth *eth.Ethereum) ([]EthereumApi, error) { |
|
|
|
if len(strings.TrimSpace(apistr)) == 0 { |
|
|
|
if len(strings.TrimSpace(apistr)) == 0 { |
|
|
|