|
array | $accessList = [] |
|
bool | $signed = false |
|
int | $nonce = 0 |
|
int | $gas = 0 |
|
OOGmp | $gasPrice |
|
OOGmp | $value |
|
Address | $to = null |
|
string | $dataBin = "" |
|
OOGmp | $v |
|
OOGmp | $r |
|
OOGmp | $s |
|
int | $chainId = null |
|
◆ accessList()
M8B\EtherBinder\Common\AccessListTransaction::accessList |
( |
| ) |
|
Returns the transaction's access list.
- Returns
- array The access list.
◆ blanksFromRPCArr()
M8B\EtherBinder\Common\AccessListTransaction::blanksFromRPCArr |
( |
array | $rpcArr | ) |
|
|
protected |
◆ calculateV()
M8B\EtherBinder\Common\AccessListTransaction::calculateV |
( |
OOGmp | $recovery | ) |
|
◆ dataBin()
M8B\EtherBinder\Common\Transaction::dataBin |
( |
| ) |
|
|
inherited |
Gets the binary data payload of the transaction.
- Returns
- string The binary data.
◆ dataHex()
M8B\EtherBinder\Common\Transaction::dataHex |
( |
| ) |
|
|
inherited |
Gets the transaction data in hex format.
- Returns
- string Data in hex.
◆ decodeBin()
static M8B\EtherBinder\Common\Transaction::decodeBin |
( |
string | $rlp | ) |
|
|
staticinherited |
Decodes a binary RLP-encoded transaction. Accepts both legacy formatting and typed transaction.
- Parameters
-
string | $rlp | The RLP-encoded transaction as a binary string. |
- Returns
- static The decoded Transaction object.
- Exceptions
-
BadAddressChecksumException | |
EthBinderLogicException | |
EthBinderRuntimeException | |
InvalidHexException | |
InvalidHexLengthException | |
NotSupportedException | |
◆ decodeHex()
static M8B\EtherBinder\Common\Transaction::decodeHex |
( |
string | $rlp | ) |
|
|
staticinherited |
Decodes a hexadecimal RLP-encoded transaction. Accepts both legacy formatting and typed transaction.
- Parameters
-
string | $rlp | The RLP-encoded transaction as a hexadecimal string. |
- Returns
- static The decoded Transaction object.
- Exceptions
-
BadAddressChecksumException | |
EthBinderLogicException | |
EthBinderRuntimeException | |
InvalidHexException | |
InvalidHexLengthException | |
NotSupportedException | |
◆ deployAddress()
M8B\EtherBinder\Common\Transaction::deployAddress |
( |
| ) |
|
|
inherited |
Gets the address where the contract will be deployed if it's deploy transaction. If it is not deploy transaction, it will return null address - Address::NULL()
- Returns
- Address Address where contract will be deployed.
- Exceptions
-
EthBinderLogicException | |
InvalidLengthException | |
◆ ecRecover()
M8B\EtherBinder\Common\AccessListTransaction::ecRecover |
( |
| ) |
|
Recovers the address of the signer from the signature. Returns null address if is not signed.
- Returns
- Address The address of the signer.
- Exceptions
-
EthBinderRuntimeException | |
EthBinderLogicException | |
InvalidLengthException | |
Reimplemented from M8B\EtherBinder\Common\LegacyTransaction.
◆ encodeBin()
M8B\EtherBinder\Common\AccessListTransaction::encodeBin |
( |
| ) |
|
◆ encodeBinForSigning()
M8B\EtherBinder\Common\AccessListTransaction::encodeBinForSigning |
( |
?int | $chainId | ) |
|
Encodes the transaction for signing purposes (which differs from encoding for storage or transfer. Difference is for example missing fields).
- Parameters
-
int | null | $chainId | The chain ID of the Ethereum network. |
- Returns
- string Binary representation of the transaction for signing.
- Exceptions
-
EthBinderArgumentException | |
Reimplemented from M8B\EtherBinder\Common\LegacyTransaction.
◆ encodeHex()
M8B\EtherBinder\Common\Transaction::encodeHex |
( |
| ) |
|
|
inherited |
Encodes the transaction into a hexadecimal string.
- Returns
- string The hexadecimal encoded transaction.
- Exceptions
-
EthBinderArgumentException | |
◆ encodeHexForSigning()
M8B\EtherBinder\Common\Transaction::encodeHexForSigning |
( |
?int | $chainId | ) |
|
|
inherited |
Encodes the transaction into a hexadecimal string for signing purposes (which differs from encoding for storage or transfer. Difference is for example missing fields).
- Parameters
-
?int | $chainId | The chain ID for the transaction. |
- Returns
- string The hexadecimal encoded transaction.
- Exceptions
-
EthBinderArgumentException | |
◆ fromBin()
static M8B\EtherBinder\Common\Transaction::fromBin |
( |
string | $bin | ) |
|
|
staticinherited |
Alias function for decodeBin()
- See also
- static::decodeBin()
- Parameters
-
- Returns
- static
- Exceptions
-
BadAddressChecksumException | |
EthBinderLogicException | |
EthBinderRuntimeException | |
InvalidHexException | |
InvalidHexLengthException | |
NotSupportedException | |
Implements M8B\EtherBinder\Common\BinarySerializableInterface.
◆ fromHex()
static M8B\EtherBinder\Common\Transaction::fromHex |
( |
string | $hex | ) |
|
|
staticinherited |
Alias function for decodeHex()
- See also
- static::decodeHex()
- Parameters
-
- Returns
- static
- Exceptions
-
BadAddressChecksumException | |
EthBinderLogicException | |
EthBinderRuntimeException | |
InvalidHexException | |
InvalidHexLengthException | |
NotSupportedException | |
Implements M8B\EtherBinder\Common\BinarySerializableInterface.
◆ fromRPCArr()
static M8B\EtherBinder\Common\Transaction::fromRPCArr |
( |
array | $rpcArr | ) |
|
|
staticinherited |
Creates a transaction from an RPC array.
- Parameters
-
array | $rpcArr | The array containing transaction details from RPC. |
- Returns
- static The created Transaction object.
- Exceptions
-
BadAddressChecksumException | |
NotSupportedException | |
InvalidHexLengthException | |
EthBinderLogicException | |
InvalidHexException | |
HexBlobNotEvenException | |
◆ gasLimit()
M8B\EtherBinder\Common\Transaction::gasLimit |
( |
| ) |
|
|
inherited |
Gets the gas limit of the transaction.
- Returns
- int The gas limit value.
◆ getSigningHash()
M8B\EtherBinder\Common\Transaction::getSigningHash |
( |
?int | $chainId | ) |
|
|
inherited |
Calculates the hash used for signing the transaction.
- Parameters
-
int | null | $chainId | Optional chain ID. |
- Returns
- Hash The signing hash.
- Exceptions
-
InvalidLengthException | |
EthBinderLogicException | |
◆ hash()
M8B\EtherBinder\Common\Transaction::hash |
( |
| ) |
|
|
inherited |
Calculates the transaction hash.
- Returns
- Hash The transaction hash.
- Exceptions
-
◆ isReplayProtected()
M8B\EtherBinder\Common\LegacyTransaction::isReplayProtected |
( |
| ) |
|
|
inherited |
Checks if the transaction is replay-protected (post EIP155).
- Returns
- bool True if the transaction is replay-protected, false otherwise.
◆ isSigned()
M8B\EtherBinder\Common\Transaction::isSigned |
( |
| ) |
|
|
inherited |
Checks if the transaction is signed.
- Returns
- bool True if signed, false otherwise.
◆ nonce()
M8B\EtherBinder\Common\Transaction::nonce |
( |
| ) |
|
|
inherited |
Gets the nonce of the transaction.
- Returns
- int The nonce value.
◆ nonceFromRPC()
Convenience function that fetches nonce from RPC and places it into transaction. If new nonce mismatches currently set nonce, it invalidates signature.
- Parameters
-
Address | $from | Address of which to set next nonce. |
AbstractRPC | $rpc | RPC to query transaction count from. |
- Returns
- Transaction self for chainable API.
- Exceptions
-
EthBinderRuntimeException | |
RPCGeneralException | |
RPCInvalidResponseParamException | |
RPCNotFoundException | |
◆ r()
M8B\EtherBinder\Common\Transaction::r |
( |
| ) |
|
|
inherited |
Gets the ECDSA 'r' value of the signature.
- Returns
- OOGmp The 'r' value.
◆ s()
M8B\EtherBinder\Common\Transaction::s |
( |
| ) |
|
|
inherited |
Gets the ECDSA 's' value of the signature.
- Returns
- OOGmp The 's' value.
◆ setAccessList()
M8B\EtherBinder\Common\AccessListTransaction::setAccessList |
( |
array | $accessList | ) |
|
Sets the access list for the transaction. This invalidates signature if data differs from existing data.
- Parameters
-
array | $accessList | The new access list. |
- Returns
- static
◆ setDataBin()
M8B\EtherBinder\Common\Transaction::setDataBin |
( |
string | $dataBin | ) |
|
|
inherited |
Sets the data payload for the transaction using binary blob. This invalidates signature if data differs from existing data.
- Parameters
-
string | $dataBin | The binary data. |
- Returns
- static The updated Transaction object.
◆ setDataHex()
M8B\EtherBinder\Common\Transaction::setDataHex |
( |
string | $dataHex | ) |
|
|
inherited |
Sets the data for the transaction using a hex string. This invalidates signature if data differs from existing data.
- Parameters
-
string | $dataHex | Data in hex format. |
- Returns
- static
- Exceptions
-
HexBlobNotEvenException | |
InvalidHexException | |
◆ setGasLimit()
M8B\EtherBinder\Common\Transaction::setGasLimit |
( |
int | $gasLimit | ) |
|
|
inherited |
Sets the gas limit for the transaction. This invalidates signature if data differs from existing data.
- Parameters
-
int | $gasLimit | The gas limit value. |
- Returns
- static The updated Transaction object.
◆ setGasPrice()
M8B\EtherBinder\Common\LegacyTransaction::setGasPrice |
( |
OOGmp | $gasPrice | ) |
|
|
inherited |
Sets the gas price for the transaction.
- Parameters
-
OOGmp | $gasPrice | The new gas price. |
- Returns
- static Returns the instance of the class.
◆ setInnerFromRLPValues()
M8B\EtherBinder\Common\AccessListTransaction::setInnerFromRLPValues |
( |
array | $rlpValues | ) |
|
|
protected |
- Exceptions
-
BadAddressChecksumException | |
EthBinderLogicException | |
InvalidHexLengthException | |
InvalidHexException | |
EthBinderRuntimeException | |
HexBlobNotEvenException | |
Reimplemented from M8B\EtherBinder\Common\LegacyTransaction.
◆ setNonce()
M8B\EtherBinder\Common\Transaction::setNonce |
( |
int | $nonce | ) |
|
|
inherited |
Sets the nonce for the transaction. This invalidates signature if data differs from existing data.
- Parameters
-
int | $nonce | The nonce value. |
- Returns
- static The updated Transaction object.
◆ setSignature()
M8B\EtherBinder\Common\Transaction::setSignature |
( |
Signature | $s | ) |
|
|
inherited |
Sets the signature. Note that there is no guarantee the signature will work correctly. This is for advanced use only. Ensure to properly account for EIP 155 in signature's V.
- Returns
- static The updated Transaction object.
◆ setTo()
M8B\EtherBinder\Common\Transaction::setTo |
( |
?Address | $address | ) |
|
|
inherited |
Sets the recipient address for the transaction. If it's null, the transaction is contract deploy transaction. This invalidates signature if data differs from existing data.
- Parameters
-
Address | null | $address | The Address object or null. If null, the transaction is contract deploy |
- Returns
- static The updated Transaction object.
◆ setValue()
M8B\EtherBinder\Common\Transaction::setValue |
( |
OOGmp | $valueWEI | ) |
|
|
inherited |
Sets the value for the transaction. This invalidates signature if data differs from existing data.
- Parameters
-
OOGmp | $valueWEI | The value in Wei. |
- Returns
- static The updated Transaction object.
◆ setValueFmt()
M8B\EtherBinder\Common\Transaction::setValueFmt |
( |
float|int|string|OOGmp | $human, |
|
|
int|string|EtherFormats | $format = EtherFormats::ETHER ) |
|
inherited |
Sets the value for the transaction using WeiFormatter. Accepts "human" input. This invalidates signature if data differs from existing data.
- Parameters
-
float | int | string | OOGmp | $human | |
int | string | EtherFormats | $format | |
- Returns
- static The updated Transaction object.
◆ sign()
M8B\EtherBinder\Common\Transaction::sign |
( |
Key | $key, |
|
|
?int | $chainId ) |
|
inherited |
Signs the transaction.
- Parameters
-
Key | $key | Private key for signing. |
int | null | $chainId | Optional chain ID. |
- Returns
- static
- Exceptions
-
InvalidLengthException | |
EthBinderLogicException | |
◆ signature()
M8B\EtherBinder\Common\Transaction::signature |
( |
| ) |
|
|
inherited |
Gets the signature in wrapper object.
- Returns
- Signature The signature details.
◆ to()
M8B\EtherBinder\Common\Transaction::to |
( |
| ) |
|
|
inherited |
Gets the recipient address of the transaction, null if it's deploy transaction.
- Returns
- Address|null The recipient address or null (deploy).
◆ toBin()
M8B\EtherBinder\Common\Transaction::toBin |
( |
| ) |
|
|
inherited |
◆ toHex()
M8B\EtherBinder\Common\Transaction::toHex |
( |
| ) |
|
|
inherited |
◆ totalGasPrice()
M8B\EtherBinder\Common\Transaction::totalGasPrice |
( |
| ) |
|
|
inherited |
◆ transactionType()
M8B\EtherBinder\Common\LegacyTransaction::transactionType |
( |
| ) |
|
|
inherited |
Returns the type of the transaction, which is always LEGACY.
- Returns
- TransactionType Returns LEGACY as the transaction type.
Reimplemented from M8B\EtherBinder\Common\Transaction.
◆ useRpcEstimates()
Estimates gas and fee values using from RPC, trying to use conservative values. This invalidates signature if data differs from existing data
- Parameters
-
AbstractRPC | $rpc | The RPC client. |
Address | $from | The sender address. |
- Returns
- static The updated Transaction object.
- Exceptions
-
RPCGeneralException | |
RPCNotFoundException | |
RPCInvalidResponseParamException | |
EthBinderLogicException | |
EthBinderRuntimeException | |
◆ useRpcEstimatesWithBump()
M8B\EtherBinder\Common\LegacyTransaction::useRpcEstimatesWithBump |
( |
AbstractRPC | $rpc, |
|
|
?Address | $from, |
|
|
int | $bumpGasPercentage, |
|
|
int | $bumpFeePercentage ) |
|
inherited |
Uses RPC to estimate gas and fee, then sets them with an optional bump.
- Parameters
-
AbstractRPC | $rpc | The RPC client. |
Address | null | $from | The sender's address. |
int | $bumpGasPercentage | Percentage to bump the estimated gas. |
int | $bumpFeePercentage | Percentage to bump the estimated fee. |
- Returns
- static Returns the instance of the class.
- Exceptions
-
RPCGeneralException | |
RPCInvalidResponseParamException | |
RPCNotFoundException | |
Reimplemented from M8B\EtherBinder\Common\Transaction.
◆ v()
M8B\EtherBinder\Common\Transaction::v |
( |
| ) |
|
|
inherited |
Gets the ECDSA 'v' value of the signature.
- Returns
- OOGmp The 'v' value.
◆ value()
M8B\EtherBinder\Common\Transaction::value |
( |
| ) |
|
|
inherited |
Gets the value of the transaction.
- Returns
- OOGmp The value in Wei.
◆ valueFmt()
M8B\EtherBinder\Common\Transaction::valueFmt |
( |
int | $finalDecimals, |
|
|
int|string|EtherFormats | $format = EtherFormats::ETHER ) |
|
inherited |
Gets the value of the transaction and formats it with WeiFormatter, proxying params to it.
- Parameters
-
int | $finalDecimals | Number of decimals for formatting. |
int | string | EtherFormats | $format | Ether format. |
- Returns
- string Formatted value.
The documentation for this class was generated from the following file:
- src/Common/AccessListTransaction.php