Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/functionx/fx-py-sdk
A useful tool for sending cosmos transactions
https://github.com/functionx/fx-py-sdk
blockchain cosmos-sdk
Last synced: 3 months ago
JSON representation
A useful tool for sending cosmos transactions
- Host: GitHub
- URL: https://github.com/functionx/fx-py-sdk
- Owner: PundiAI
- License: apache-2.0
- Created: 2022-08-04T02:03:56.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-06T01:56:21.000Z (9 months ago)
- Last Synced: 2024-10-30T03:37:38.670Z (3 months ago)
- Topics: blockchain, cosmos-sdk
- Language: Python
- Homepage:
- Size: 1.07 MB
- Stars: 7
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-cosmos - fx-py-sdk - The Cosmos Python client library. (Client Libraries / Python)
README
# FunctionX Python SDK
[![PyPI version](https://badge.fury.io/py/fx-py-sdk.svg)](https://badge.fury.io/py/fx-py-sdk)
## Install
```shell
pip install fx-py-sdk
```## Use
```python
from fxsdk.client.grpc import Client
from fxsdk.wallet.builder import TxBuilder
from fxsdk.x.cosmos.base.v1beta1.coin_pb2 import Coinif __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
```shell
git clone https://github.com/functionx/fx-py-sdk.gitcd 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`
```shell
# Pull external code
git submodule update --init --recursive --remote./gen-proto.sh
```### 5. Build Project
```shell
python -m build
```## License
[Apache License 2.0](LICENSE)