Versions in this module Expand all Collapse all v0 v0.0.17 Jul 13, 2021 v0.0.16 Jul 13, 2021 Changes in this version + const AddressLength + const HashLength + var Big0 = big.NewInt(0) + var Big1 = big.NewInt(1) + var Big2 = big.NewInt(2) + var Big256 = big.NewInt(256) + var Big257 = big.NewInt(257) + var Big3 = big.NewInt(3) + var Big32 = big.NewInt(32) + var ErrBig256Range = &decError + var ErrEmptyNumber = &decError + var ErrEmptyString = &decError + var ErrLeadingZero = &decError + var ErrMissingPrefix = &decError + var ErrOddLength = &decError + var ErrSyntax = &decError + var ErrUint64Range = &decError + var ErrUintRange = &decError + var MaxBig256 = new(big.Int).Set(tt256m1) + var MaxBig63 = new(big.Int).Sub(tt63, big.NewInt(1)) + func BigPow(a, b int64) *big.Int + func Decode(input string) ([]byte, error) + func FromHex(s string) []byte + func Hex2Bytes(str string) []byte + func IsHexAddress(s string) bool + func Keccak256(data ...[]byte) []byte + func PaddedBigBytes(bigint *big.Int, n int) []byte + func ParseBig256(s string) (*big.Int, bool) + func PublicKeyToAddress(pubkey []byte) string + func ReadBits(bigint *big.Int, buf []byte) + func Recover(typedData *TypedData, sig []byte) (string, error) + func Sign(k key.Key, typedData *TypedData) ([]byte, error) + func U256(x *big.Int) *big.Int + func U256Bytes(n *big.Int) []byte + type Address [AddressLength]byte + func BytesToAddress(b []byte) Address + func HexToAddress(s string) Address + func (a *Address) SetBytes(b []byte) + func (a Address) Bytes() []byte + func (a Address) Hex() string + func (a Address) String() string + type HexOrDecimal256 big.Int + func NewHexOrDecimal256(x int64) *HexOrDecimal256 + func (i *HexOrDecimal256) MarshalText() ([]byte, error) + func (i *HexOrDecimal256) UnmarshalText(input []byte) error + type KeccakState interface + Read func([]byte) (int, error) + func NewKeccakState() KeccakState + type NameValueType struct + Name string + Typ string + Value interface{} + func (nvt *NameValueType) Pprint(depth int) string + type Type struct + Name string + Type string + type TypePriority struct + Type string + Value uint + type TypedData struct + Domain TypedDataDomain + Message TypedDataMessage + PrimaryType string + Types Types + func (typedData *TypedData) Dependencies(primaryType string, found []string) []string + func (typedData *TypedData) EncodeData(primaryType string, data map[string]interface{}, depth int) ([]byte, error) + func (typedData *TypedData) EncodePrimitiveValue(encType string, encValue interface{}, depth int) ([]byte, error) + func (typedData *TypedData) EncodeType(primaryType string) []byte + func (typedData *TypedData) Format() ([]*NameValueType, error) + func (typedData *TypedData) HashStruct(primaryType string, data TypedDataMessage) ([]byte, error) + func (typedData *TypedData) Map() map[string]interface{} + func (typedData *TypedData) TypeHash(primaryType string) []byte + type TypedDataDomain struct + ChainId *HexOrDecimal256 + Name string + Salt string + VerifyingContract string + Version string + func (domain *TypedDataDomain) Map() map[string]interface{} + type TypedDataMessage = map[string]interface + type Types map[string][]Type