C# Class EthereumRpc.EthereumService

Exibir arquivo Open project: LawrenceBotley/EthereumRpc-NET Class Usage Examples

Public Methods

Method Description
Call ( Transaction transaction ) : string
CompileLLL ( ) : string
CompileSerpent ( ) : string
CompileSolidity ( string contract ) : RpcResult
EstimateGas ( Transaction transaction ) : string
EthereumService ( ) : System
EthereumService ( ConnectionOptions connectionOptions ) : System
EthereumService ( string url, string port ) : System
GetAccounts ( ) : string[]

Returns a list of addresses owned by client.

GetBalance ( string address, BlockTag blockTag = BlockTag.Quantity, int blockNumber = -1 ) : System.Numerics.BigInteger

Returns the balance of the account of given address.

GetBlockByHash ( string hash, bool returnFullBlock ) : Block
GetBlockByNumber ( int blockNumber, BlockTag blockTag, bool returnFullObject ) : Block
GetBlockFilterChanges ( string filterId ) : List
GetBlockNumber ( ) : long

Returns the number of most recent block.

GetBlockTransactionCountByHash ( string blockHash ) : long

Returns the number of transactions in a block from a block matching the given block hash.

GetBlockTransactionCountByNumber ( BlockTag blockTag = BlockTag.Quantity, int blockNumber = -1 ) : long

Returns the number of transactions in a block from a block matching the given block number.

GetCode ( string address, BlockTag blockTag = BlockTag.Quantity, int blockNumber = -1 ) : string

Returns code at a given address.

GetCoinbase ( ) : Address

Returns the client coinbase address.

GetCompilers ( ) : string[]
GetFilterChanges ( string filterId ) : Log[]
GetFilterLogs ( string filterId ) : string[]
GetGasPrice ( ) : long

Returns the current price per gas in wei.

GetHashrate ( ) : long

Returns the number of hashes per second that the node is mining with.

GetLogs ( Log log ) : string[]
GetMining ( ) : bool

Returns true if client is actively mining new blocks.

GetNetListening ( ) : bool

Returns true if client is actively listening for network connections.

GetNetPeerCount ( ) : int

Returns number of peers currenly connected to the client.

GetNetVersion ( ) : string

Returns the current network protocol version.

GetProtocolVersion ( ) : string

Returns the current ethereum protocol version.

GetStorageAt ( string address, int storagePosition, BlockTag blockTag = BlockTag.Quantity, int blockNumber = -1 ) : long

Returns the value from a storage position at a given address.

GetSyncing ( ) : SyncStatus

Returns an object object with data about the sync status or FALSE.

GetTransactionByBlockHashAndIndex ( string hash, int index ) : Transaction
GetTransactionByBlockNumberAndIndex ( int blockNumber, int index ) : Transaction
GetTransactionByHash ( string hash ) : Transaction
GetTransactionCount ( string address, BlockTag blockTag = BlockTag.Quantity, int blockNumber = -1 ) : long

Returns the number of transactions sent from an address.

GetTransactionReceipt ( string transactionHash ) : Transaction
GetUncleByBlockHashAndIndex ( string hash, int index ) : Block
GetUncleByBlockNumberAndIndex ( int blockNumber, int index ) : Block
GetUncleCountByBlockHash ( string hashBlock ) : long

Returns the number of uncles in a block from a block matching the given block hash.

GetUncleCountByBlockNumber ( int blockNumber ) : long

Returns the number of uncles in a block from a block matching the given block number.

GetWeb3ClientVersion ( ) : string

Returns the current client version

GetWeb3Sha3 ( string value ) : string

Returns Keccak-256 (not the standardized SHA3-256) of the given data.

GetWork ( ) : Work
NewAccount ( string password ) : string
NewBlockFilter ( ) : string
NewFilter ( Filter filter ) : string

Creates a filter object, based on filter options, to notify when the state changes (logs). To check if the state has changed, call GetFilterChanges.

NewPendingTransactionFilter ( ) : string
SendRawTransaction ( string data ) : string

Creates new message call transaction or a contract creation for signed transactions.

SendTransaction ( Transaction transaction ) : string
SendTransaction ( string from, string to, int gas, string data, int gasPrice = -1, int value = -1, int nonce = -1 ) : string

Creates new message call transaction or a contract creation, if the data field contains code.

ShhPost ( string from, string to, string topics, string payload, string priority, string ttl ) : string
ShhVersion ( ) : string

Returns the current whisper protocol version.

Sign ( string address, string data ) : string

Signs data with a given address.

SubmitHashrate ( string hashRate, string clientId ) : bool

Used for submitting mining hashrate.

SubmitWork ( string nonce, string powHash, string mix ) : bool

Used for submitting a proof-of-work solution.

UninstallFilter ( string filterId ) : bool
UnlockAccount ( string account, string password ) : bool

Unlocks account using password

Method Details

Call() public method

public Call ( Transaction transaction ) : string
transaction EthereumRpc.RpcObjects.Transaction
return string

CompileLLL() public method

public CompileLLL ( ) : string
return string

CompileSerpent() public method

public CompileSerpent ( ) : string
return string

CompileSolidity() public method

public CompileSolidity ( string contract ) : RpcResult
contract string
return RpcResult

EstimateGas() public method

public EstimateGas ( Transaction transaction ) : string
transaction EthereumRpc.RpcObjects.Transaction
return string

EthereumService() public method

public EthereumService ( ) : System
return System

EthereumService() public method

public EthereumService ( ConnectionOptions connectionOptions ) : System
connectionOptions ConnectionOptions
return System

EthereumService() public method

public EthereumService ( string url, string port ) : System
url string
port string
return System

GetAccounts() public method

Returns a list of addresses owned by client.
public GetAccounts ( ) : string[]
return string[]

GetBalance() public method

Returns the balance of the account of given address.
public GetBalance ( string address, BlockTag blockTag = BlockTag.Quantity, int blockNumber = -1 ) : System.Numerics.BigInteger
address string address to check for balance.
blockTag BlockTag integer block number
blockNumber int Block param
return System.Numerics.BigInteger

GetBlockByHash() public method

public GetBlockByHash ( string hash, bool returnFullBlock ) : Block
hash string
returnFullBlock bool
return EthereumRpc.Ethereum.Block

GetBlockByNumber() public method

public GetBlockByNumber ( int blockNumber, BlockTag blockTag, bool returnFullObject ) : Block
blockNumber int
blockTag BlockTag
returnFullObject bool
return EthereumRpc.Ethereum.Block

GetBlockFilterChanges() public method

public GetBlockFilterChanges ( string filterId ) : List
filterId string
return List

GetBlockNumber() public method

Returns the number of most recent block.
public GetBlockNumber ( ) : long
return long

GetBlockTransactionCountByHash() public method

Returns the number of transactions in a block from a block matching the given block hash.
public GetBlockTransactionCountByHash ( string blockHash ) : long
blockHash string hash of a block
return long

GetBlockTransactionCountByNumber() public method

Returns the number of transactions in a block from a block matching the given block number.
public GetBlockTransactionCountByNumber ( BlockTag blockTag = BlockTag.Quantity, int blockNumber = -1 ) : long
blockTag BlockTag Block Param
blockNumber int integer of a block number,
return long

GetCode() public method

Returns code at a given address.
public GetCode ( string address, BlockTag blockTag = BlockTag.Quantity, int blockNumber = -1 ) : string
address string address
blockTag BlockTag
blockNumber int integer block number,
return string

GetCoinbase() public method

Returns the client coinbase address.
public GetCoinbase ( ) : Address
return Address

GetCompilers() public method

public GetCompilers ( ) : string[]
return string[]

GetFilterChanges() public method

public GetFilterChanges ( string filterId ) : Log[]
filterId string
return Log[]

GetFilterLogs() public method

public GetFilterLogs ( string filterId ) : string[]
filterId string
return string[]

GetGasPrice() public method

Returns the current price per gas in wei.
public GetGasPrice ( ) : long
return long

GetHashrate() public method

Returns the number of hashes per second that the node is mining with.
public GetHashrate ( ) : long
return long

GetLogs() public method

public GetLogs ( Log log ) : string[]
log Log
return string[]

GetMining() public method

Returns true if client is actively mining new blocks.
public GetMining ( ) : bool
return bool

GetNetListening() public method

Returns true if client is actively listening for network connections.
public GetNetListening ( ) : bool
return bool

GetNetPeerCount() public method

Returns number of peers currenly connected to the client.
public GetNetPeerCount ( ) : int
return int

GetNetVersion() public method

Returns the current network protocol version.
public GetNetVersion ( ) : string
return string

GetProtocolVersion() public method

Returns the current ethereum protocol version.
public GetProtocolVersion ( ) : string
return string

GetStorageAt() public method

Returns the value from a storage position at a given address.
public GetStorageAt ( string address, int storagePosition, BlockTag blockTag = BlockTag.Quantity, int blockNumber = -1 ) : long
address string address of the storage.
storagePosition int integer of the position in the storage.
blockTag BlockTag Block Param
blockNumber int integer block number
return long

GetSyncing() public method

Returns an object object with data about the sync status or FALSE.
public GetSyncing ( ) : SyncStatus
return EthereumRpc.RpcObjects.SyncStatus

GetTransactionByBlockHashAndIndex() public method

public GetTransactionByBlockHashAndIndex ( string hash, int index ) : Transaction
hash string
index int
return EthereumRpc.RpcObjects.Transaction

GetTransactionByBlockNumberAndIndex() public method

public GetTransactionByBlockNumberAndIndex ( int blockNumber, int index ) : Transaction
blockNumber int
index int
return EthereumRpc.RpcObjects.Transaction

GetTransactionByHash() public method

public GetTransactionByHash ( string hash ) : Transaction
hash string
return EthereumRpc.RpcObjects.Transaction

GetTransactionCount() public method

Returns the number of transactions sent from an address.
public GetTransactionCount ( string address, BlockTag blockTag = BlockTag.Quantity, int blockNumber = -1 ) : long
address string address
blockTag BlockTag Block Param
blockNumber int integer block number,
return long

GetTransactionReceipt() public method

public GetTransactionReceipt ( string transactionHash ) : Transaction
transactionHash string
return EthereumRpc.RpcObjects.Transaction

GetUncleByBlockHashAndIndex() public method

public GetUncleByBlockHashAndIndex ( string hash, int index ) : Block
hash string
index int
return EthereumRpc.Ethereum.Block

GetUncleByBlockNumberAndIndex() public method

public GetUncleByBlockNumberAndIndex ( int blockNumber, int index ) : Block
blockNumber int
index int
return EthereumRpc.Ethereum.Block

GetUncleCountByBlockHash() public method

Returns the number of uncles in a block from a block matching the given block hash.
public GetUncleCountByBlockHash ( string hashBlock ) : long
hashBlock string hash of a block
return long

GetUncleCountByBlockNumber() public method

Returns the number of uncles in a block from a block matching the given block number.
public GetUncleCountByBlockNumber ( int blockNumber ) : long
blockNumber int integer of a block number
return long

GetWeb3ClientVersion() public method

Returns the current client version
public GetWeb3ClientVersion ( ) : string
return string

GetWeb3Sha3() public method

Returns Keccak-256 (not the standardized SHA3-256) of the given data.
public GetWeb3Sha3 ( string value ) : string
value string the data to convert into a SHA3 hash
return string

GetWork() public method

public GetWork ( ) : Work
return EthereumRpc.Ethereum.Work

NewAccount() public method

public NewAccount ( string password ) : string
password string
return string

NewBlockFilter() public method

public NewBlockFilter ( ) : string
return string

NewFilter() public method

Creates a filter object, based on filter options, to notify when the state changes (logs). To check if the state has changed, call GetFilterChanges.
public NewFilter ( Filter filter ) : string
filter EthereumRpc.Ethereum.Filter
return string

NewPendingTransactionFilter() public method

public NewPendingTransactionFilter ( ) : string
return string

SendRawTransaction() public method

Creates new message call transaction or a contract creation for signed transactions.
public SendRawTransaction ( string data ) : string
data string The signed transaction data.
return string

SendTransaction() public method

public SendTransaction ( Transaction transaction ) : string
transaction EthereumRpc.RpcObjects.Transaction
return string

SendTransaction() public method

Creates new message call transaction or a contract creation, if the data field contains code.
public SendTransaction ( string from, string to, int gas, string data, int gasPrice = -1, int value = -1, int nonce = -1 ) : string
from string The address the transaction is send from.
to string (optional when creating new contract) The address the transaction is directed to.
gas int (optional, default: 90000) Integer of the gas provided for the transaction execution. It will return unused gas.
data string (optional) The compiled code of a contract
gasPrice int (optional, default: To-Be-Determined) Integer of the gasPrice used for each paid gas
value int (optional) Integer of the value send with this transaction
nonce int (optional) Integer of a nonce. This allows to overwrite your own pending transactions that use the same nonce.
return string

ShhPost() public method

public ShhPost ( string from, string to, string topics, string payload, string priority, string ttl ) : string
from string
to string
topics string
payload string
priority string
ttl string
return string

ShhVersion() public method

Returns the current whisper protocol version.
public ShhVersion ( ) : string
return string

Sign() public method

Signs data with a given address.
public Sign ( string address, string data ) : string
address string address
data string Data to sign
return string

SubmitHashrate() public method

Used for submitting mining hashrate.
public SubmitHashrate ( string hashRate, string clientId ) : bool
hashRate string a hexadecimal string representation (32 bytes) of the hash rate
clientId string A random hexadecimal(32 bytes) ID identifying the client
return bool

SubmitWork() public method

Used for submitting a proof-of-work solution.
public SubmitWork ( string nonce, string powHash, string mix ) : bool
nonce string The nonce found(64 bits)
powHash string The header's pow-hash (256 bits)
mix string The mix digest(256 bits)
return bool

UninstallFilter() public method

public UninstallFilter ( string filterId ) : bool
filterId string
return bool

UnlockAccount() public method

Unlocks account using password
public UnlockAccount ( string account, string password ) : bool
account string The account address
password string The password for the account
return bool