Python library for FunctionX
Project description
FunctionX Python SDK
Install
pip install fx-py-sdk
Use
from fxsdk.client.grpc import Client
from fxsdk.wallet.builder import TxBuilder
from fxsdk.x.cosmos.base.v1beta1.coin_pb2 import Coin
if __name__ == '__main__':
grpc_cli = Client(url='127.0.0.1:9090')
mnemonic = 'test test test test test test test test test test test junk'
prefix = 'fx'
tx_builder = TxBuilder.from_mnemonic(mnemonic=mnemonic, prefix=prefix)
to = tx_builder.from_address().to_string()
amount = [Coin(amount='100', denom='FX')]
tx_response = grpc_cli.bank_send(tx_builder, to, amount)
print(tx_response)
Development
1. Clone the code to local
git clone https://github.com/functionx/fx-py-sdk.git
cd fx-py-sdk
2. Build the Python virtual environment for the current project
- Create the virtual directory venv
python -m venv venv
- Activating the Virtual Environment
source ./venv/bin/activate
Windows: venv\Scripts\activate
3. Installation Project Dependence
pip install -r requirements.txt
4. Compile Proto files as Python files
If does not have execution permission, run 'chmod +x ./gen-proto.sh`
# Pull external code
git submodule update --init --recursive --remote
./gen-proto.sh
5. Build Project
python -m build
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
fx-py-sdk-0.7.2.tar.gz
(262.8 kB
view hashes)
Built Distribution
fx_py_sdk-0.7.2-py3-none-any.whl
(499.2 kB
view hashes)
Close
Hashes for fx_py_sdk-0.7.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 328a4ffcd914d919b5ec04132cbd481b44bf71b5e7c8913963b21492d4605140 |
|
MD5 | badb2812a21a29081e636f880e0c2522 |
|
BLAKE2b-256 | 11eb999fcf471bda1107237e8f08538e4f60148d5e500d202bd3b283e961b0f5 |