Documentation ¶
Index ¶
- Constants
- func DecodeTxFromBytes(b *bytes.Reader) (tx types.TxData, err error)
- func EncodeTxForSigning(tx *types.Transaction) (encodedTx []byte)
- func GetFrom(tx *ethtypes.Transaction) types.EthAddress
- func GetSigner(tx *types.Transaction) types.Signer
- func GetTxHash(tx *types.Transaction) common.Hash
- func RecoverPublicKey(msgHash [32]byte, sig Signature) (pubKey [64]byte, encodedSig [65]byte, err error)
- func TryCast[T any](into *T, from any, explainer string) error
- type Signature
Constants ¶
View Source
const (
// Size of an ECDSA ethereum signature
SIGNATURE_SIZE_BYTES = 65
)
Variables ¶
This section is empty.
Functions ¶
func DecodeTxFromBytes ¶
DecodeTxFromBytes from a string of bytes. If the stream of bytes is larger than the transaction then the remaining bytes are discarded and only the first bytes are used to decode the transaction. The function returns the transactions and the number of bytes read.
func EncodeTxForSigning ¶
func EncodeTxForSigning(tx *types.Transaction) (encodedTx []byte)
Encode the transaction so that the hash of the encoded bytes produces exactly the transaction hash.
func GetFrom ¶
func GetFrom(tx *ethtypes.Transaction) types.EthAddress
Returns the sender of a transaction
func GetTxHash ¶
func GetTxHash(tx *types.Transaction) common.Hash
Returns the transaction hash of the transaction
Types ¶
type Signature ¶
The value of a signature
func GetJsonSignature ¶
func GetJsonSignature(tx *ethtypes.Transaction) Signature
Returns the signature in json and the sender of the transaction Signature in JSONable format and from as an hex string
Click to show internal directories.
Click to hide internal directories.