Skip to main content

FunctionX Python SDK

PyPI version

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

Apache License 2.0

Metadata

Release files for fx-py-sdk 0.7.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fx-py-sdk 0.7.3
File Size Uploaded
fx-py-sdk-0.7.3.tar.gz 263.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fx-py-sdk 0.7.3
File Interpreter ABI Platform
fx_py_sdk-0.7.3-py3-none-any.whl Python 3 none any Details

Total release size: 763.3 kB

Release files / fx-py-sdk-0.7.3.tar.gz

Download URL fx-py-sdk-0.7.3.tar.gz
Size 263.2 kB
Tags Source
SHA-256 checksum
How to use checksums
4895453e3eaf7d404155038e0ec07be4e5d4f1e993eb92f28246c7580776a18f
BLAKE2b-256 checksum
How to use checksums
07605be2dd90a559bf8975b5589fcd59596fe8be887b1615535ae83b99fb62bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release files / fx_py_sdk-0.7.3-py3-none-any.whl

Download URL fx_py_sdk-0.7.3-py3-none-any.whl
Size 500.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f8742c31380987cd908b3858e9122c82dba7d33432853b74181023607786b6fa
BLAKE2b-256 checksum
How to use checksums
78f0644145ebf105420ee3fc8f52a03a77a7c8798a716a94f9f6266c339a1ca2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release history Release notifications | RSS feed

This release

0.7.3 This release

2 release files

0.7.2

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.10

2 release files

0.6.9

2 release files

0.6.8

2 release files

0.6.7

2 release files

0.6.6

2 release files

0.6.5

2 release files

0.6.4

2 release files

0.6.3

2 release files

0.6.2

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page