xbr._eip712_base

Attributes

Functions

_hash(→ bytes)

keccak256(abi.encode(

is_address(→ bool)

Check if the value is a proper Ethereum address.

is_block_number(→ bool)

Check if the value is a proper Ethereum block number.

is_bytes16(→ bool)

Check if the value is a proper (binary) UUID.

is_bytes32(→ bool)

Check if the value is of type bytes and length 32.

is_chain_id(→ bool)

Check if the value is a proper Ethereum chain ID.

is_cs_pubkey(→ bool)

Check if the value is a proper WAMP-cryptosign public key.

is_eth_privkey(→ bool)

Check if the value is a proper Ethereum private key (seed).

is_signature(→ bool)

Check if the value is a proper Ethereum signature.

recover(→ bytes)

Recover the Ethereum address of the signer, given the data and signature.

sign(→ bytes)

Sign the given data using the given Ethereum private key.

Module Contents

_EIP712_SIG_LEN = 65[source]
_hash(data) bytes[source]
keccak256(abi.encode(

EIP712_MEMBER_REGISTER_TYPEHASH, obj.chainId, obj.verifyingContract, obj.member, obj.registered, keccak256(bytes(obj.eula)), keccak256(bytes(obj.profile))

));

Parameters:

data

Returns:

is_address(provided: Any) bool[source]

Check if the value is a proper Ethereum address.

Parameters:

provided – The value to check.

Returns:

True iff the value is of correct type.

is_block_number(provided: Any) bool[source]

Check if the value is a proper Ethereum block number.

Parameters:

provided – The value to check.

Returns:

True iff the value is of correct type.

is_bytes16(provided: Any) bool[source]

Check if the value is a proper (binary) UUID.

Parameters:

provided – The value to check.

Returns:

True iff the value is of correct type.

is_bytes32(provided: Any) bool[source]

Check if the value is of type bytes and length 32.

Parameters:

provided – The value to check.

Returns:

True iff the value is of correct type.

is_chain_id(provided: Any) bool[source]

Check if the value is a proper Ethereum chain ID.

Parameters:

provided – The value to check.

Returns:

True iff the value is of correct type.

is_cs_pubkey(provided: Any) bool[source]

Check if the value is a proper WAMP-cryptosign public key.

Parameters:

provided – The value to check.

Returns:

True iff the value is of correct type.

is_eth_privkey(provided: Any) bool[source]

Check if the value is a proper Ethereum private key (seed).

Parameters:

provided – The value to check.

Returns:

True iff the value is of correct type.

is_signature(provided: Any) bool[source]

Check if the value is a proper Ethereum signature.

Parameters:

provided – The value to check.

Returns:

True iff the value is of correct type.

recover(data: Dict[str, Any], signature: bytes) bytes[source]

Recover the Ethereum address of the signer, given the data and signature.

Parameters:
  • data – Signed data.

  • signature – Signature.

Returns:

Signing address.

sign(eth_privkey: bytes, data: Dict[str, Any]) bytes[source]

Sign the given data using the given Ethereum private key.

Parameters:
  • eth_privkey – Signing key.

  • data – Data to sign.

Returns:

Signature.