ether_dart
library
Classes
AbiType <T >
A type that can be encoded and decoded as specified in the solidity ABI,
available at https://solidity.readthedocs.io/en/develop/abi-spec.html
AddressType
Solidity address type
BaseArrayType <T >
Base class for (non-byte) arrays in solidity.
BaseClient
The abstract base class for an HTTP client.
BaseRequest
The base class for HTTP requests.
BaseResponse
The base class for HTTP responses.
BaseResponseWithUrl
A BaseResponse with a url field.
BlockInformation
BlockNum
For operations that are reading data from the blockchain without making a
transaction that would modify it, the Ethereum client can read that data
from previous states of the blockchain as well. This class specifies which
state to use.
BoolType
Solidity bool type
ByteStream
A stream of chunks of bytes representing a single piece of data.
Client
The interface for HTTP clients that take care of maintaining persistent
connections across multiple requests to the same server.
CompositeFunctionParameter
A function parameter that includes other named parameter instead of just
wrapping single types.
ContractAbi
Defines the abi of a deployed Ethereum contract. The abi contains
information about the functions defined in that contract.
ContractEvent
An event that can be emitted by a smart contract during a transaction.
ContractFunction
A function defined in the ABI of an compiled contract.
Credentials
Anything that can sign payloads with a private key.
CredentialsWithKnownAddress
Credentials where the address is known synchronously.
CustomTransactionSender
Interface for Credentials that don't sign transactions locally, for
instance because the private key is not known to this library.
DecodingResult <T >
Decoding Result.
DeployedContract
Helper class that defines a contract with a known ABI that has been deployed
on a Ethereum blockchain.
DynamicBytes
The solidity bytes type, which decodes byte arrays of arbitrary length.
DynamicLengthArray <T >
The solidity T[] type for arrays with an dynamic length.
EncodingLengthInfo
Information about whether the length of an encoding depends on the data
(dynamic) or is fixed (static). If it's static, also contains information
about the length of the encoding.
EtherAmount
Utility class to easily convert amounts of Ether into different units of
quantities.
EtherDart
EthereumAddress
Represents an Ethereum address.
EthPrivateKey
Credentials that can sign payloads with an Ethereum private key.
EventComponent <T >
A FunctionParameter that is a component of an event. Contains additional
information about whether the parameter is indexed .
FilterEvent
A log event emitted in a transaction.
FilterOptions
Options for event filters created with Web3Client.events .
FixedBytes
The bytes
FixedLengthArray <T >
The solidity T[k] type for arrays whose length is known.
FunctionParameter <T >
The parameter of a function with its name and the expected type.
FunctionType
Function Type
GeneratedContract
Base classes for generated contracts.
IntType
The solidity int
LengthTrackingByteSink
MultipartFile
A file to be uploaded as part of a MultipartRequest .
MultipartRequest
A multipart/form-data
request.
Request
An HTTP request where the entire request body is known in advance.
Response
An HTTP response where the entire response body is known in advance.
StreamedRequest
An HTTP request where the request body is sent asynchronously after the
connection has been established and the headers have been sent.
StreamedResponse
An HTTP response where the response body is received asynchronously after
the headers have been received.
StringType
The solidity string type, which utf-8 encodes strings
SyncInformation
When the client is currently syncing its blockchain with the network, this
representation can be used to find information about at which block the node
was before the sync, at which node it currently is and at which block the
node will complete its sync.
Transaction
TransactionInformation
TransactionReceipt
TupleType
Tuple Type
UintType
The solidity uint
Wallet
Represents a wallet file. Wallets are used to securely store credentials
like a private key belonging to an Ethereum address. The private key in a
wallet is encrypted with a secret password that needs to be known in order
to obtain the private key.
Web3Client
Class for sending requests over an HTTP JSON-RPC API endpoint to Ethereum
clients. This library won't use the accounts feature of clients to use them
to create transactions, you will instead have to obtain private keys of
accounts yourself.
Constants
sizeUnitBytes
→ const int
The length of the encoding of a solidity type is always a multiplicative of
this unit size.
Functions
calculatePadLength (int bodyLength , {bool allowEmpty = false })
→ int
Calculates the amount of padding bytes needed so that the length of the
padding plus the bodyLength
is a multiplicative of sizeUnitBytes . If
allowEmpty
(defaults to false) is true, an empty length is allowed.
Otherwise an empty bodyLength
will be given a full sizeUnitBytes
padding.
delete (Uri url , {Object ? body , Encoding ? encoding })
→ Future <Response >
Sends an HTTP DELETE request with the given headers to the given URL.
encode (dynamic value )
→ List <int >
encodeList (List list , LengthTrackingByteSink builder )
→ void
get (Uri url , { })
→ Future <Response >
Sends an HTTP GET request with the given headers to the given URL.
head (Uri url , { })
→ Future <Response >
Sends an HTTP HEAD request with the given headers to the given URL.
padUint8ListTo32 (Uint8List data )
→ Uint8List
parseAbiType (String name )
→ AbiType
Parses an ABI type from its AbiType.name .
patch (Uri url , {Object ? body , Encoding ? encoding })
→ Future <Response >
Sends an HTTP PATCH request with the given headers and body to the given
URL.
post (Uri url , {Object ? body , Encoding ? encoding })
→ Future <Response >
Sends an HTTP POST request with the given headers and body to the given URL.
prependTransactionType (int type , Uint8List transaction )
→ Uint8List
put (Uri url , {Object ? body , Encoding ? encoding })
→ Future <Response >
Sends an HTTP PUT request with the given headers and body to the given URL.
read (Uri url , { })
→ Future <String >
Sends an HTTP GET request with the given headers to the given URL and
returns a Future that completes to the body of the response as a String .
readBytes (Uri url , { })
→ Future <Uint8List >
Sends an HTTP GET request with the given headers to the given URL and
returns a Future that completes to the body of the response as a list of
bytes.
runWithClient <R > (R body (), Client clientFactory (), {ZoneSpecification ? zoneSpecification })
→ R
Runs body
in its own Zone with the Client returned by clientFactory
set as the default Client .
signTransactionRaw (Transaction transaction , Credentials c , {int ? chainId = 1 })
→ Uint8List
uint8ListFromList (List <int > data )
→ Uint8List
Typedefs
SocketConnector
= StreamChannel<String > Function()
Signature for a function that opens a socket on which json-rpc operations
can be performed.
Exceptions / Errors
ClientException
An exception caused by an error in a pkg/http client.