Skip to content

Latest commit

 

History

History
184 lines (165 loc) · 12.9 KB

index.md

File metadata and controls

184 lines (165 loc) · 12.9 KB

Home > eth-connect

eth-connect package

Classes

Class Description
BigNumber
Contract Should be called to create new contract instance
ContractFactory Should be called to create new ContractFactory instance
EthBlockFilter
EthFilter
EthPendingTransactionFilter
HTTPProvider HttpProvider should be used to send rpc calls over http
Method
Property
RequestManager It's responsible for passing messages to providers It's also responsible for polling the ethereum node for incoming messages Default poll timeout is 1 second
SHHFilter
SolidityEvent This prototype should be used to create event filters
SolidityFunction This prototype should be used to call/sendTransaction to solidity functions
WebSocketProvider

Abstract Classes

Abstract Class Description
AbstractFilter

Enumerations

Enumeration Description
TransactionStatus
TransactionType

Functions

Function Description
BigNumber(n, base)
bytesToHex(bytes)
bytesToUtf8String(bytesOrHexString) Decodes an Uint8Array or hex string into a UTF-8 string
concatBytes(buffers)
extractDisplayName(name) Should be called to get display name of contract function
extractTypeName(name) Should be called to get type name of contract function
fromAscii(str, num) Should be called to get hex representation (prefixed by 0x) of ascii string
fromDecimal(value) Converts value to it's hex representation
fromTwosComplement(num, bits) If the bit N is 1
fromWei(num, unit)

Takes a number of wei and converts it to any other ether unit.

Possible units are: SI Short SI Full Effigy Other - kwei femtoether babbage - mwei picoether lovelace - gwei nanoether shannon nano - -- microether szabo micro - -- milliether finney milli - ether -- -- - kether -- grand - mether - gether - tether

fromWei(num, unit)
getAddress(address)
getValueOfUnit(_unit) Returns value of unit in Wei
hexToBytes(hex)
inputAddressFormatter(address)
inputBlockNumberFormatter(blockNumber)
inputCallFormatter(options) Formats the input of a transaction and converts all values to HEX
inputDefaultBlockNumberFormatter(blockNumber)
inputFilterOptions(options)
inputPostFormatter(post) Formats the input of a whisper post and converts all values to HEX
inputTransactionFormatter(options) Formats the input of a transaction and converts all values to HEX
inputTransactionId(txId) Ensures a correct transactionId is provided
isAddress(address) Checks if the given string is an address
isArray(object) Returns true if object is array, otherwise false
isBigNumber(object) Returns true if object is BigNumber, otherwise false
isBloom(bloom) Returns true if given string is a valid Ethereum block header bloom.
isBoolean(object) Returns true if object is boolean, otherwise false
isChecksumAddress(_address) Checks if the given string is a checksummed address
isFunction(object) Returns true if object is function, otherwise false
isHex(value) Converts value to it's decimal representation in string
isJson(str) Returns true if given string is valid json object
isObject(object) Returns true if object is Objet, otherwise false
isPredefinedBlockNumber(blockNumber) Returns true if the provided blockNumber is 'latest', 'pending' or 'earliest
isStrictAddress(address) Checks if the given string is strictly an address
isString(value) Returns true if object is string, otherwise false
isTopic(topic) Returns true if given string is a valid log topic.
isValidResponse(response) Should be called to check if jsonrpc response is valid
outputBigNumberFormatter(output) Should format the output to a big number
outputBlockFormatter(block) Formats the output of a block to its proper value
outputLogFormatter(log) Formats the output of a log
outputPostFormatter(post) Formats the output of a received post message
outputSyncingFormatter(result)
outputTransactionFormatter(tx) Formats the output of a transaction to its proper values
outputTransactionReceiptFormatter(receipt) Formats the output of a transaction receipt to its proper values
padLeft(str, chars, sign) Should be called to pad string to expected length
padRight(str, chars, sign) Should be called to pad string to expected length
sha3(value, options)
signedIsNegative(value, bits) Check if input value is negative in twos complement
stringToUtf8Bytes(str) Converts a string into a Uint8Array encoded with UTF-8
toAddress(address) Transforms given string to valid 20 bytes-length addres with 0x prefix
toArray(value) Ensures the result will be an array
toAscii(hex) Should be called to get ascii from it's hex representation
toBatchPayload(messages) Should be called to create batch payload object
toBigNumber(_num) Takes an input and transforms it into an bignumber
toBoolean(value) Converts value to it's boolean representation (x != 0)
toChecksumAddress(_address) Makes a checksum address
toData(val) Converts value to it's hex representation in string
toDecimal(value) Converts value to it's decimal representation in string
toHex(val)

Auto converts any given value into it's hex representation.

And even stringifys objects before.

toJsonRpcRequest(method, params) Should be called to valid json create payload object
toNullDecimal(value) Converts value to it's decimal representation in string
toString_2(value) Converts value to string
toStringData(val) Converts a UTF8 string to it's hex representation as a 0x string. If the argument is already a 0xHEX prefixed string, the conversion is skipped.
toTwosComplement(num, bits) Takes and input transforms it into bignumber and if it is negative value, into two's complement
toWei(num, unit)

Takes a number of a unit and converts it to wei.

Possible units are: SI Short SI Full Effigy Other - kwei femtoether babbage - mwei picoether lovelace - gwei nanoether shannon nano - -- microether szabo micro - -- milliether finney milli - ether -- -- - kether -- grand - mether - gether - tether

transformToFullName(json) Should be used to create full function/event name from json abi

Interfaces

Interface Description
AbiConstructor
AbiEvent
AbiFallback
AbiFunction
AbiInput
AbiItemGeneric
AbiOutput
IPropertyOptions
IWebSocket

Namespaces

Namespace Description
BigNumber
coder SolidityCoder prototype should be used to encode/decode solidity params of any type
eth

Variables

Variable Description
messageId

Type Aliases

Type Alias Description
AbiItem
AbiType
Address Hex string of 20 bytes
BlockIdentifier
BlockObject
Callback
ConfirmedTransaction
Data Hex string
DroppedTransaction
EventData
EventFilterCreator
FetchFunction
FilterCallback
FilterOptions
FinishedTransactionAndReceipt
Hex
HTTPProviderOptions
IFuture
LogObject
PendingTransaction
Quantity
QueuedTransaction
ReplacedTransaction
RevertedTransaction
RPCMessage
RPCSendableMessage
SHHFilterMessage
SHHFilterOptions
SHHPost
StateMutabilityType
Syncing
Tag
TopicFilter
Transaction
TransactionAndReceipt
TransactionCallOptions
TransactionObject
TransactionOptions
TransactionReceipt
TxHash Hex string of 32 bytes
Unit
WebSocketProviderOptions