2019-01-06 19:19:48 +00:00
|
|
|
# Nimbus
|
|
|
|
# Copyright (c) 2018-2019 Status Research & Development GmbH
|
|
|
|
# Licensed under either of
|
|
|
|
# * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
|
|
|
|
# * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
|
|
|
|
# at your option. This file may not be copied, modified, or distributed except according to those terms.
|
|
|
|
|
2018-07-26 21:48:01 +00:00
|
|
|
## This module contains signatures for the Ethereum client RPCs.
|
|
|
|
## The signatures are not imported directly, but read and processed with parseStmt,
|
|
|
|
## then a procedure body is generated to marshal native Nim parameters to json and visa versa.
|
2019-01-06 19:19:48 +00:00
|
|
|
import
|
|
|
|
json,
|
2019-02-05 19:15:50 +00:00
|
|
|
stint, eth/common,
|
2019-01-06 19:19:48 +00:00
|
|
|
../../nimbus/rpc/hexstrings, ../../nimbus/rpc/rpc_types
|
2018-07-26 21:48:01 +00:00
|
|
|
|
|
|
|
proc web3_clientVersion(): string
|
|
|
|
proc web3_sha3(data: string): string
|
|
|
|
proc net_version(): string
|
|
|
|
proc net_peerCount(): int
|
|
|
|
proc net_listening(): bool
|
|
|
|
proc eth_protocolVersion(): string
|
|
|
|
proc eth_syncing(): JsonNode
|
2018-08-13 18:26:34 +00:00
|
|
|
proc eth_coinbase(): EthAddressStr
|
2018-07-26 21:48:01 +00:00
|
|
|
proc eth_mining(): bool
|
|
|
|
proc eth_hashrate(): int
|
2018-08-13 18:26:34 +00:00
|
|
|
proc eth_gasPrice(): GasInt
|
|
|
|
proc eth_accounts(): seq[EthAddressStr]
|
|
|
|
proc eth_blockNumber(): BlockNumber
|
2018-11-28 22:27:15 +00:00
|
|
|
proc eth_getBalance(data: EthAddressStr, quantityTag: string): UInt256
|
2018-08-13 18:26:34 +00:00
|
|
|
proc eth_getStorageAt(data: EthAddressStr, quantity: int, quantityTag: string): seq[byte]
|
|
|
|
proc eth_getTransactionCount(data: EthAddressStr, quantityTag: string)
|
2018-07-26 21:48:01 +00:00
|
|
|
proc eth_getBlockTransactionCountByHash(data: array[32, byte])
|
|
|
|
proc eth_getBlockTransactionCountByNumber(quantityTag: string)
|
|
|
|
proc eth_getUncleCountByBlockHash(data: array[32, byte])
|
|
|
|
proc eth_getUncleCountByBlockNumber(quantityTag: string)
|
2018-08-13 18:26:34 +00:00
|
|
|
proc eth_getCode(data: EthAddressStr, quantityTag: string): HexDataStr
|
|
|
|
proc eth_sign(data:EthAddressStr, message: HexDataStr): HexDataStr
|
2018-11-26 18:13:24 +00:00
|
|
|
#proc eth_sendRawTransaction(data: string, quantityTag: int): UInt256
|
2018-11-28 22:27:15 +00:00
|
|
|
proc eth_call(call: EthCall, quantityTag: string): string
|
2018-12-03 19:48:10 +00:00
|
|
|
proc eth_estimateGas(call: EthCall, quantityTag: string): GasInt
|
2018-07-26 21:48:01 +00:00
|
|
|
|
2019-02-05 19:15:50 +00:00
|
|
|
# TODO: Use eth/common types
|
2018-07-26 21:48:01 +00:00
|
|
|
|
|
|
|
#[proc eth_sendTransaction(obj: EthSend): UInt256
|
|
|
|
proc eth_getBlockByHash(data: array[32, byte], fullTransactions: bool): BlockObject
|
|
|
|
proc eth_getBlockByNumber(quantityTag: string, fullTransactions: bool): BlockObject
|
|
|
|
proc eth_getTransactionByHash(data: Uint256): TransactionObject
|
|
|
|
proc eth_getTransactionByBlockHashAndIndex(data: UInt256, quantity: int): TransactionObject
|
|
|
|
proc eth_getTransactionByBlockNumberAndIndex(quantityTag: string, quantity: int): TransactionObject
|
|
|
|
proc eth_getTransactionReceipt(data: UInt256): ReceiptObject
|
|
|
|
proc eth_getUncleByBlockHashAndIndex(data: UInt256, quantity: int64): BlockObject
|
|
|
|
proc eth_getUncleByBlockNumberAndIndex(quantityTag: string, quantity: int64): BlockObject
|
|
|
|
proc eth_getCompilers(): seq[string]
|
|
|
|
proc eth_compileLLL(): seq[byte]
|
|
|
|
proc eth_compileSolidity(): seq[byte]
|
|
|
|
proc eth_compileSerpent(): seq[byte]
|
|
|
|
proc eth_newFilter(filterOptions: FilterOptions): int
|
|
|
|
proc eth_newBlockFilter(): int
|
|
|
|
proc eth_newPendingTransactionFilter(): int
|
|
|
|
proc eth_uninstallFilter(filterId: int): bool
|
|
|
|
proc eth_getFilterChanges(filterId: int): seq[LogObject]
|
|
|
|
proc eth_getFilterLogs(filterId: int): seq[LogObject]
|
|
|
|
proc eth_getLogs(filterOptions: FilterOptions): seq[LogObject]
|
|
|
|
proc eth_getWork(): seq[UInt256]
|
|
|
|
proc eth_submitWork(nonce: int64, powHash: Uint256, mixDigest: Uint256): bool
|
|
|
|
proc eth_submitHashrate(hashRate: UInt256, id: Uint256): bool
|
|
|
|
proc shh_post(): string
|
|
|
|
proc shh_version(message: WhisperPost): bool
|
|
|
|
proc shh_newIdentity(): array[60, byte]
|
|
|
|
proc shh_hasIdentity(identity: array[60, byte]): bool
|
|
|
|
proc shh_newGroup(): array[60, byte]
|
|
|
|
proc shh_addToGroup(identity: array[60, byte]): bool
|
|
|
|
proc shh_newFilter(filterOptions: FilterOptions, to: array[60, byte], topics: seq[UInt256]): int
|
|
|
|
proc shh_uninstallFilter(id: int): bool
|
|
|
|
proc shh_getFilterChanges(id: int): seq[WhisperMessage]
|
|
|
|
proc shh_getMessages(id: int): seq[WhisperMessage]
|
2019-01-06 19:19:48 +00:00
|
|
|
]#
|
2019-03-23 20:54:28 +00:00
|
|
|
|
|
|
|
proc shh_version(): string
|
|
|
|
proc shh_info(): WhisperInfo
|
|
|
|
proc shh_setMaxMessageSize(size: uint64): bool
|
|
|
|
proc shh_setMinPoW(pow: float): bool
|
|
|
|
proc shh_markTrustedPeer(enode: string): bool
|
|
|
|
|
2019-04-23 12:45:37 +00:00
|
|
|
proc shh_newKeyPair(): Identifier
|
|
|
|
proc shh_addPrivateKey(key: string): Identifier
|
|
|
|
proc shh_deleteKeyPair(id: Identifier): bool
|
|
|
|
proc shh_hasKeyPair(id: Identifier): bool
|
|
|
|
proc shh_getPublicKey(id: Identifier): PublicKey
|
|
|
|
proc shh_getPrivateKey(id: Identifier): PrivateKey
|
2019-03-23 20:54:28 +00:00
|
|
|
|
2019-04-23 12:45:37 +00:00
|
|
|
proc shh_newSymKey(): Identifier
|
|
|
|
proc shh_addSymKey(key: string): Identifier
|
|
|
|
proc shh_generateSymKeyFromPassword(password: string): Identifier
|
|
|
|
proc shh_hasSymKey(id: Identifier): bool
|
|
|
|
proc shh_getSymKey(id: Identifier): SymKey
|
|
|
|
proc shh_deleteSymKey(id: Identifier): bool
|
2019-03-23 20:54:28 +00:00
|
|
|
|
2019-04-23 12:45:37 +00:00
|
|
|
proc shh_newMessageFilter(options: WhisperFilterOptions): Identifier
|
|
|
|
proc shh_deleteMessageFilter(id: Identifier): bool
|
|
|
|
proc shh_getFilterMessages(id: Identifier): seq[WhisperFilterMessage]
|
2019-03-23 20:54:28 +00:00
|
|
|
proc shh_post(message: WhisperPostMessage): bool
|