Ether Binder
Set of utilities for interacting with Ethereum and it's smart contracts with PHP, with generating ABI bindings and Ethereum-related types
|
Public Member Functions | |
setMessage (string $message) | |
getMessage () | |
sign (Key $key) | |
isSigned () | |
toJson (bool $pretty) | |
__toString () | |
getSignature () | |
validateSignature () | |
Static Public Member Functions | |
static | fromJSON (string $json) |
Protected Member Functions | |
preProcessMessage () | |
GethLikeMessage is a subclass of AbstractSigningMessage that pre-processes messages in a way that Geth does. The message gets prepended with "\x19Ethereum Signed Message:\n" followed by the message length, to align with Geth's signing method.
|
inherited |
Default to string behaviour is pretty printed JSON.
EthBinderLogicException |
|
staticinherited |
Creates signed message from JSON string. Does not on its own validate the message, just parses it into object.
string | $json | JSON object of message |
BadAddressChecksumException | |
EthBinderLogicException | |
InvalidHexException | |
InvalidHexLengthException | |
JsonException |
|
inherited |
Get the current message.
|
inherited |
Retrieve the signature object.
|
inherited |
Check if message is signed.
|
protected |
Preprocess the message before hashing, for example adding signing "magic bytes" such as "\x19Ethereum Signed Message" etc. This allows for multiple formats support
Reimplemented from M8B\EtherBinder\Misc\AbstractSigningMessage.
|
inherited |
Set the message. This will invalidate and remove the current signature if message is different from currently set and if signature is present
string | $message | The new message. |
|
inherited |
Sign the message.
Key | $key | Private key for signing. |
EthBinderLogicException |
|
inherited |
Convert object state to JSON string, producing JSON object similar to MEW and other wallets that support signing
bool | $pretty | Use JSON pretty print option if true. |
EthBinderLogicException |
|
inherited |
Validate if the existing signature matches address it claims to be from.
EthBinderLogicException | |
EthBinderRuntimeException |