xbr._eip712_authority_certificate¶
Classes¶
Functions¶
Authority certificate: long-lived, on-chain L2. |
|
|
Recover the signer address the given EIP712 signature was signed with. |
|
Sign the given data using a EIP712 based signature with the provided private key. |
Module Contents¶
- class EIP712AuthorityCertificate(chainId: int, verifyingContract: bytes, validFrom: int, issuer: bytes, subject: bytes, realm: bytes, capabilities: int, meta: str, signatures: List[bytes] | None = None)[source]¶
Bases:
xbr._eip712_certificate.EIP712Certificate- __slots__ = ('chainId', 'verifyingContract', 'validFrom', 'issuer', 'subject', 'realm', 'capabilities',...[source]¶
- static load(filename) → EIP712AuthorityCertificate[source]¶
Load certificate from file.
- Parameters:
filename
- Returns:
- static parse(obj, binary: bool = False) → EIP712AuthorityCertificate[source]¶
- save(filename: str) → int[source]¶
Save certificate to file. File format (serialized as CBOR):
[cert_hash: bytes, cert_eip712: Dict[str, Any], cert_signatures: List[bytes]]
- Parameters:
filename
- Returns:
- sign(key: xbr._secmod.EthereumKey, binary: bool = False) → bytes[source]¶
- create_eip712_authority_certificate(chainId: int, verifyingContract: bytes, validFrom: int, issuer: bytes, subject: bytes, realm: bytes, capabilities: int, meta: str) → dict[source]¶
Authority certificate: long-lived, on-chain L2.
- Parameters:
chainId
verifyingContract
validFrom
issuer
subject
realm
capabilities
meta
- Returns:
- recover_eip712_authority_certificate(chainId: int, verifyingContract: bytes, validFrom: int, issuer: bytes, subject: bytes, realm: bytes, capabilities: int, meta: str, signature: bytes) → bytes[source]¶
Recover the signer address the given EIP712 signature was signed with.
- Parameters:
chainId
verifyingContract
validFrom
issuer
subject
realm
capabilities
meta
signature
- Returns:
The (computed) signer address the signature was signed with.
- sign_eip712_authority_certificate(eth_privkey: bytes, chainId: int, verifyingContract: bytes, validFrom: int, issuer: bytes, subject: bytes, realm: bytes, capabilities: int, meta: str) → bytes[source]¶
Sign the given data using a EIP712 based signature with the provided private key.
- Parameters:
eth_privkey
chainId
verifyingContract
validFrom
issuer
subject
realm
capabilities
meta
- Returns: