Skip to main content

Plugin to monkey patch web3.py to support cfx2eth-bridge

Project description

Introduction

This is a library used to use web3.py on conflux-bridge(?). This library hacks the signing machanism of web3.py.

Install

pip install conflux-web3py-signer

How to use

Import conflux_we3py_signer before import web3.

import conflux_web3py_signer
import web3

How

Transaction Cast

When the modified construct_sign_and_send_raw_middleware is going to sign a transaction, it will convert an EIP-1559 transaction to conflux transaction following the rule:

  • If gasPrice is missing, use maxFeePerGas as gas price.
  • Fill epochHeight with w3.eth.block_number, which correspondes to epoch_number in conflux.
  • Estimate the transaction and fill storageLimit from estimate result.

Address Cast

EOA account addresses are all converted to begin with 0x1 and is encoded in checksum format

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

conflux-web3py-signer-1.0.0b1.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

conflux_web3py_signer-1.0.0b1-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file conflux-web3py-signer-1.0.0b1.tar.gz.

File metadata

File hashes

Hashes for conflux-web3py-signer-1.0.0b1.tar.gz
Algorithm Hash digest
SHA256 7ca2f114208762d5700814392ebe940eb88526ca8850d1bd3e82fbfc66cab39d
MD5 47ff8346a32362b7e0b914ec581069c8
BLAKE2b-256 4a4205615dbe136a8c36e8955bcd7d1dafd9062d5b0b835da9113bf32a6b1aa3

See more details on using hashes here.

Provenance

File details

Details for the file conflux_web3py_signer-1.0.0b1-py3-none-any.whl.

File metadata

File hashes

Hashes for conflux_web3py_signer-1.0.0b1-py3-none-any.whl
Algorithm Hash digest
SHA256 cafac265cfdc32449edd4369bb96ec968c9dc1e6009825c235d853748fbbab51
MD5 bc256ff52adb937d1b238a6a75f256ac
BLAKE2b-256 ecd7fff6ee47b0f1f22a943682b8b4ee0456ff04f2842c7e149476f9e4654a36

See more details on using hashes here.

Provenance

Supported by

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