Python Toolkit for EOS
Project description
Python Toolkit for AMAX
Installation
On Linux platform
python3 -m pip install -U pip
python3 -m pip install pyamaxkit
On Windows platform:
python -m pip install -U pip
python -m pip install pyamaxkit
On Apple M1 hardware
pyamaxkit does not have pre-built versions available for ARM chips. In order to build it from source code, you need to install cmake, go, scikit-build, cython.
brew install go
brew install cython
xcode-select --install
python3 -m pip install -U pip
python3 -m pip install cmake
python3 -m pip install scikit-build
python3 -m pip install pyamaxkit
Code Examples
Example1
import os
from pyamaxkit import amaxapi, wallet
#import your account private key here
wallet.import_key('mywallet', '5K463ynhZoCDDa4RDcr63cUwWLTnKqmdcoTKTHBjqoKfv4u5V7p')
amaxapi.set_node('https://chain.amaxtest.com')
info = amaxapi.get_info()
print(info)
args = {
'from': 'test1',
'to': 'test2',
'quantity': '1.00000000 AMAX',
'memo': 'hello world'
}
amaxapi.push_action('amax.token', 'transfer', args, {'test1':'active'})
Async Example
import os
import asyncio
from pyamaxkit import wallet
from pyamaxkit.chainapi import ChainApiAsync
#import your account private key here
wallet.import_key('mywallet', '5K463ynhZoCDDa4RDcr63cUwWLTnKqmdcoTKTHBjqoKfv4u5V7p')
async def test():
amaxapi = ChainApiAsync('https://chain.amaxtest.com')
info = await amaxapi.get_info()
print(info)
args = {
'from': 'test1',
'to': 'test2',
'quantity': '1.00000000 AMAX',
'memo': 'hello world'
}
r = await amaxapi.push_action('amax.token', 'transfer', args, {'test1':'active'})
print(r)
asyncio.run(test())
Sign With Ledger Hardware Wallet Example
import os
from pyamaxkit import amaxapi
amaxapi.set_node('https://chain.amaxtest.com')
args = {
'from': 'test1',
'to': 'test2',
'quantity': '1.00000000 AMAX',
'memo': 'hello world'
}
#indices is an array of ledger signing key indices
amaxapi.push_action('amax.token', 'transfer', args, {'test1':'active'}, indices=[0])
Docs
Building from Source Code
Installing Prerequisites
python3 -m pip install scikit-build
python3 -m pip install cython
For Windows platform
python -m pip install scikit-build
python -m pip install cython
- Download and Install gcc compiler from tdm-gcc
- Install Go compiler from download
- Install cmake from download
- Install python3 from downloads
Press Win+R to open Run Dialog, input the following command
cmd -k /path/to/gcc/mingwvars.bat
Downloading Source Code
git clone https://www.github.com/AMAX-DAO-DEV/pyamaxkit
cd pyamaxkit
git submodule update --init --recursive
Build
./build.sh
For Windows platform, in the cmd dialog, enter the following command:
python setup.py sdist bdist_wheel
Installation
./install.sh
For Windows platform
python -m pip uninstall pyamaxkit -y;python -m pip install .\dist\pyamaxkit-[SUFFIX].whl
Publishing to PyPI
Use the helper script to build and upload the package. Set PYPI_TOKEN with your
API token and optionally PYPI_REPOSITORY (defaults to pypi).
python scripts/publish_pypi.py
License
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyamaxkit-1.0.2.tar.gz.
File metadata
- Download URL: pyamaxkit-1.0.2.tar.gz
- Upload date:
- Size: 2.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2d50d848ddcc21798ae490baf71f25c62253a68cd2634b1afebde2391b3a70ed
|
|
| MD5 |
ef5a2cd69be7f7df625fd00ffcd541cd
|
|
| BLAKE2b-256 |
b8c867a06c91be0a6f753412e088d64f357b8787b38cd770786cdd22ebd5cf5e
|
File details
Details for the file pyamaxkit-1.0.2-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl.
File metadata
- Download URL: pyamaxkit-1.0.2-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
- Upload date:
- Size: 612.3 kB
- Tags: CPython 3.12, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
09f22fe70aed6ae44cf9ca5b9b22040a0423305c6d467631285916786907d967
|
|
| MD5 |
082aa4672d1183b5efff5afce29fbec5
|
|
| BLAKE2b-256 |
e1d140e7959016746ac184629de52b3b5679aca0790eaffc3f2ede7325b08831
|
File details
Details for the file pyamaxkit-1.0.2-cp39-cp39-macosx_10_16_x86_64.whl.
File metadata
- Download URL: pyamaxkit-1.0.2-cp39-cp39-macosx_10_16_x86_64.whl
- Upload date:
- Size: 2.1 MB
- Tags: CPython 3.9, macOS 10.16+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5c385e029a0f9fb5e90bf133600bf0879b87a9c6f2ca0567dc01a49b04238d5d
|
|
| MD5 |
c641122b33dbefe24d5e4f60fb451ea6
|
|
| BLAKE2b-256 |
50e80f858a4a4fdaee507a9df7d848aff5ffbb37dc8bc1a04bc867bca37148fa
|