Skip to content

Python Scripts to send transactions on Conflux Core Space and Conflux eSpace

Notifications You must be signed in to change notification settings

simulacrumb-glm/conflux-rpc-send-python

Repository files navigation

conflux-rpc-send-python

Python Scripts to send transactions on Conflux Core Space and Conflux eSpace

requirements

install requirements

pip install -r requirements.txt

Scripts

core_send.py

  • Send CFX on Conflux Core Space

core_transfer_evm.py

espace_send.py

  • Send CFX on Conflux eSpace
  • Include a message

espace_swap.py

Shared features

Batching

All scripts with the exception of espace_swap.py have the ability to send multiple transactions. They are first built and signed in batch and then sent in batch.

A boolen flag repeat_one further determines if you want to send the same transaction inputs multiple times or would like to provide unique inputs for each transaction.

For simplicity and accessibility especially for beginner users, the features are inline in each script and explicitly commented.

Report

Report printed to the console showing:

  • Number of transactions sent
  • Total time taken to send transactions
  • From address
  • Contract Utilized address (if applicable)
  • To[Last]: the to address parameter of the last transaction
  • Gas Used
  • Last Nonce hash for tracing on Confluxscan
  • Last Nonce #
  • Last transaction receipt data

Private Key Management

  • All scripts require a wallet private key to sign transactions.
  • The best practice is to set private keys as environment variables via terminal or add a .env script. This is HIGHLY recommended and all scripts are setup to read private keys from ENV variables

As a fallback, they can be pasted into yourprivatekey variable within the script But be CARFEFUL, NEVER EVER share your private key.

Below are exampels of how to set the environment variables

Windows Command Shell

set private_key_core=abc123
set private_key_evm=def456

Jupyter Notebook

! set private_key_core=abc123
! set private_key_evm=def456

MacOS and *nix shell

export private_key_core=abc123
export private_key_evm=def456

Support and further learning

About

Python Scripts to send transactions on Conflux Core Space and Conflux eSpace

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages