Skip to main content

eip712: Message classes for typed structured data hashing and signing in Ethereum

Project description

Quick Start

Message classes for typed structured data hashing and signing in Ethereum. See EIP-712 for details.

Dependencies

Installation

via pip

You can install the latest release via pip:

pip install eip712

via setuptools

You can clone the repository and use setuptools for the most up-to-date version:

git clone https://github.com/ApeWorX/eip712.git
cd eip712
python3 setup.py install

Quick Usage

Define EIP-712 models:

from eip712.messages import EIP712Message, EIP712Type


class Person(EIP712Type):
    name: "string"
    wallet: "address"


class Mail(EIP712Message):
    _chainId_ = 1
    _name_ = "Ether Mail"
    _verifyingContract_ = "0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC"
    _version_ = "1"

    sender: Person
    receiver: Person

Initialize a Person object as you would normally

person = Person(name="Joe", wallet="0xa27CEF8aF2B6575903b676e5644657FAe96F491F")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

eip712-0.2.13.tar.gz (63.4 kB view details)

Uploaded Source

Built Distribution

eip712-0.2.13-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

Details for the file eip712-0.2.13.tar.gz.

File metadata

  • Download URL: eip712-0.2.13.tar.gz
  • Upload date:
  • Size: 63.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.17

File hashes

Hashes for eip712-0.2.13.tar.gz
Algorithm Hash digest
SHA256 291ab5082199469dc088e5fdce7fa07b2e64dcccde434e10a9f1c53be2d18175
MD5 c4015e46d1d30a4e14173a655acf956e
BLAKE2b-256 f595aebdac7e295388f6fb953eeb85741a0b87cc5508cc86fc4e32a26d3596ad

See more details on using hashes here.

File details

Details for the file eip712-0.2.13-py3-none-any.whl.

File metadata

  • Download URL: eip712-0.2.13-py3-none-any.whl
  • Upload date:
  • Size: 10.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.17

File hashes

Hashes for eip712-0.2.13-py3-none-any.whl
Algorithm Hash digest
SHA256 92bcaa1f47a48cf6f0369b88b7bac8c88962b212cfb3b9d6a54639de0616e17c
MD5 81f9996b8a6618887b542b119eedeef5
BLAKE2b-256 b10f5449346b45658cb1979731f75d1fae46c468cb06cc25250ac542422af515

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page