A python tool to interact with flare-smart-accounts in a sandbox environment.
- installing dependencies
- setting up
.envfile
Creating a simple python virtual environment and installing dependencies is enough:
python -m venv venv
source ./venv/bin/activate
pip install -r requirements.txtCreate the environment file using the provided example
cp .env.example .envOpen the created .env in your editor of choice and fill out the values.
You can then run the script with the command:
./smart_accounts.py ..../smart_accounts.py --helpThis command encodes passed values into smart account instructions (xrpl references)
./smart_accounts.py encode fxrp-cr -w 136 -v 1 -a 1
# 0x0088000000000000000000010001000000000000000000000000000000000000To see the list of all possible instructions you can run
./smart_accounts.py encode --helpThis command provides functions for interacting with the bridge, like sending instructions.
./smart_accounts.py bridge instruction 0x0045000000000000000000010001000000000000000000000000000000000000
This also supports passing values via stdin by passing - so command
composition like this is possible
./smart_accounts.py encode fxrp-cr -w 136 -v 1 -a 1 \
| ./smart_accounts.py bridge instruction -
# sent bridge request: 102B3C3B8064EBEEB9C7816CF75A920ED1B22FEF8B5B6244BD3CA2AE4DAA7C78After you send a bridge request that requires minting (currently fxrp-cr,
firelight-cr-deposit and upshift-cr-deposit) you can do it like this:
./smart_accounts.py encode fxrp-cr -w 69 -v 1 -a 1 \
| ./smart_accounts.py bridge instruction - \
| ./smart_accounts.py bridge mint-tx -w -
# sent bridge instruction transaction: FDCF127501B5A4DE74880554A6702585592F1C446380EE2DF76BB964E3CF717A
# sent mint tx: 4FA89BD1CDAC1BB7B632845555AE143A19337FABD57101F5ADF9D691B387C1C4
# 4FA89BD1CDAC1BB7B632845555AE143A19337FABD57101F5ADF9D691B387C1C4