Skip to content

flare-foundation/smart-accounts-cli

Repository files navigation

Smart Accounts Cli

A python tool to interact with flare-smart-accounts in a sandbox environment.

Setting up and using the cli

  1. installing dependencies
  2. setting up .env file

Installing dependencies

Creating a simple python virtual environment and installing dependencies is enough:

python -m venv venv
source ./venv/bin/activate
pip install -r requirements.txt

Setting up .env file

Create the environment file using the provided example

cp .env.example .env

Open the created .env in your editor of choice and fill out the values.

Using the cli

You can then run the script with the command:

./smart_accounts.py ...

help message

./smart_accounts.py --help

encode command

This command encodes passed values into smart account instructions (xrpl references)

./smart_accounts.py encode fxrp-cr -w 136 -v 1 -a 1 
# 0x0088000000000000000000010001000000000000000000000000000000000000

To see the list of all possible instructions you can run

./smart_accounts.py encode --help

bridge command

This 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: 102B3C3B8064EBEEB9C7816CF75A920ED1B22FEF8B5B6244BD3CA2AE4DAA7C78

After 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

About

No description, website, or topics provided.

Resources

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors