xbr._eip712_delegate_certificate¶
Classes¶
Functions¶
Delegate certificate: dynamic/one-time, off-chain. |
|
|
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 EIP712DelegateCertificate(chainId: int, verifyingContract: bytes, validFrom: int, delegate: bytes, csPubKey: bytes, bootedAt: int, meta: str, signatures: List[bytes] | None = None)[source]¶
Bases:
xbr._eip712_certificate.EIP712Certificate- __slots__ = ('chainId', 'verifyingContract', 'validFrom', 'delegate', 'csPubKey', 'bootedAt', 'meta',...[source]¶
- static load(filename) EIP712DelegateCertificate[source]¶
- static parse(obj) EIP712DelegateCertificate[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_delegate_certificate(chainId: int, verifyingContract: bytes, validFrom: int, delegate: bytes, csPubKey: bytes, bootedAt: int, meta: str) dict[source]¶
Delegate certificate: dynamic/one-time, off-chain.
- Parameters:
chainId
verifyingContract
validFrom
delegate
csPubKey
bootedAt
meta
- Returns:
- recover_eip712_delegate_certificate(chainId: int, verifyingContract: bytes, validFrom: int, delegate: bytes, csPubKey: bytes, bootedAt: int, meta: str, signature: bytes) bytes[source]¶
Recover the signer address the given EIP712 signature was signed with.
- Parameters:
chainId
verifyingContract
validFrom
delegate
csPubKey
bootedAt
signature
meta
- Returns:
The (computed) signer address the signature was signed with.
- sign_eip712_delegate_certificate(eth_privkey: bytes, chainId: int, verifyingContract: bytes, validFrom: int, delegate: bytes, csPubKey: bytes, bootedAt: int, meta: str) bytes[source]¶
Sign the given data using a EIP712 based signature with the provided private key.
- Parameters:
eth_privkey – Signing key.
chainId
verifyingContract
validFrom
delegate
csPubKey
bootedAt
meta
- Returns:
The signature according to EIP712 (32+32+1 raw bytes).