Python Scripts to send transactions on Conflux Core Space and Conflux eSpace
- web3.py
- conflux-web3 -- Only a hard requirement for Core Space transactions
pip install -r requirements.txt
- Send CFX on Conflux Core Space
- Cross-Space CFX from Conflux Core Space to Conflux eSpace
- Utilizes the Conflux internal contract: CrossSpaceCall
- Send CFX on Conflux eSpace
- Include a message
- Swap CFX for an ERC-20 token using https://swappi.io
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 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
- 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.
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