Giter Site home page Giter Site logo

fx-py-sdk's Introduction

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

fx-py-sdk's People

Contributors

zakir-code avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.