common

package
v0.1.24 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 22, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TopicERC20Transfer = Keccak256([]byte("Transfer(address,address,uint256)"))
	TopicERC20Approval = Keccak256([]byte("Approval(address,address,uint256)"))
)
View Source
var ZeroEthAddr = make([]byte, 20)

Functions

func CancunSenderPub added in v0.1.17

func CancunSenderPub(s ethTypes.Signer, tx *ethTypes.Transaction) ([]byte, error)

CancunSenderPub is adapted from cancunSigner.Sender

func CloseOrLog

func CloseOrLog(c io.Closer, logger *log.Logger)

func EIP155SenderPub added in v0.1.17

func EIP155SenderPub(s ethTypes.Signer, tx *ethTypes.Transaction) ([]byte, error)

EIP155SenderPub is adapted from EIP155Signer.Sender

func Eip2930SenderPub

func Eip2930SenderPub(s ethTypes.Signer, tx *ethTypes.Transaction) ([]byte, error)

Eip2930SenderPub is adapted from eip2930Signer.Sender

func ExtractAddresses

func ExtractAddresses(accounts map[apiTypes.Address]bool) []string

func HomesteadSenderPub

func HomesteadSenderPub(tx *ethTypes.Transaction) ([]byte, error)

HomesteadSenderPub is adapted from HomesteadSigner.Sender

func Keccak256

func Keccak256(data []byte) []byte

func LondonSenderPub

func LondonSenderPub(s ethTypes.Signer, tx *ethTypes.Transaction) ([]byte, error)

LondonSenderPub is adapted from londonSigner.Sender

func OpenUtxNoVerify

func OpenUtxNoVerify(utx *sdkTypes.UnverifiedTransaction) (*sdkTypes.Transaction, error)

OpenUtxNoVerify decodes the transaction inside an UnverifiedTransaction without verifying the authentication. And that's okay for our use case, where we obtain transactions that are known to be properly authenticated from a trusted node.

func QuantityFromBytes

func QuantityFromBytes(value []byte) quantity.Quantity

func RecoverPlainPub

func RecoverPlainPub(sighash ethCommon.Hash, R, S, Vb *big.Int, homestead bool) ([]byte, error)

RecoverPlainPub is adapted from recoverPlain

func SliceEthAddress

func SliceEthAddress(b32 []byte) []byte

func StringifyAddressSpec

func StringifyAddressSpec(as *sdkTypes.AddressSpec) (apiTypes.Address, error)

func StringifyBytes

func StringifyBytes(value []byte) string

func StringifyEthAddress

func StringifyEthAddress(ethAddr []byte) (apiTypes.Address, error)

func StringifyNativeDenomination

func StringifyNativeDenomination(amount *sdkTypes.BaseUnits) (string, error)

func StringifyOcAddress

func StringifyOcAddress(ocAddr address.Address) (apiTypes.Address, error)

func StringifySdkAddress

func StringifySdkAddress(sdkAddr *sdkTypes.Address) (apiTypes.Address, error)

func WriteOrLog

func WriteOrLog(w io.Writer, p []byte, logger *log.Logger)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL