Skip to main content

Python Toolkit for AMAX

PyPi PyPi

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('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('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

Install the build dependencies:

python3 -m pip install scikit-build
python3 -m pip install cython

Install the Go compiler and cmake with your system package manager so that the CGo components can be compiled. You will also need a C compiler such as gcc. On Debian based systems run sudo apt-get install build-essential. When targeting a different architecture install the matching cross compiler (for example gcc-aarch64-linux-gnu) and set GOARCH and CC accordingly, e.g.:

export GOARCH=arm64
export CC=aarch64-linux-gnu-gcc

For Windows platform

python -m pip install scikit-build
python -m pip install cython
  1. Download and Install gcc compiler from tdm-gcc
  2. Install Go compiler from download
  3. Install cmake from download
  4. 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). The script installs build requirements such as scikit-build and Cython automatically.

python3 scripts/publish_pypi.py

License

MIT

Metadata

Release files for pyamaxkit 1.0.8

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

Source distribution (sdist)

Source distribution for pyamaxkit 1.0.8
File Size Uploaded Provenance Actions
pyamaxkit-1.0.8.tar.gz 3.2 MB Without provenance Details for pyamaxkit-1.0.8.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for pyamaxkit 1.0.8
File Interpreter ABI Platform Actions
pyamaxkit-1.0.8-cp39-cp39-macosx_10_16_x86_64.whl CPython 3.9 CPython 3.9 macOS 10.16+ x86-64 Details for pyamaxkit-1.0.8-cp39-cp39-macosx_10_16_x86_64.whl
pyamaxkit-1.0.8-cp38-cp38-manylinux2014_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.17+ x86-64 Details for pyamaxkit-1.0.8-cp38-cp38-manylinux2014_x86_64.whl

Total release size: 6.1 MB

Release files / pyamaxkit-1.0.8.tar.gz

Download URL pyamaxkit-1.0.8.tar.gz
Size 3.2 MB
Tags Source
SHA-256 checksum
How to use checksums
0df6045697fd5570d1612961789cdbf7e0e371b17296853fff75b8cc0bda492e
BLAKE2b-256 checksum
How to use checksums
f642f341e90e2096a1bd81b9169c60833cca6b0b0fc7d650fa86c0b9184cb839
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.13

Release files / pyamaxkit-1.0.8-cp39-cp39-macosx_10_16_x86_64.whl

Download URL pyamaxkit-1.0.8-cp39-cp39-macosx_10_16_x86_64.whl
Size 2.2 MB
Tags CPython 3.9 macOS 10.16+ x86-64
SHA-256 checksum
How to use checksums
5d775cd4f46bafab493163d39fd9c7bfbf48682cd4ebdcd0e4c8ca42dd924396
BLAKE2b-256 checksum
How to use checksums
502cc3c0a18e83dd6886b35f82d84bf473ab8402de29923eb518253d09d9b9d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.13

Release files / pyamaxkit-1.0.8-cp38-cp38-manylinux2014_x86_64.whl

Download URL pyamaxkit-1.0.8-cp38-cp38-manylinux2014_x86_64.whl
Size 608.8 kB
Tags CPython 3.8 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
ed045a0a18395ab58e79d8ada3b5e6616708e652007598d34996480fea6460d5
BLAKE2b-256 checksum
How to use checksums
cf89556a2115558e3f8faef230c2ba903184def2969b3e95e74e00894d0306a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.13

Security for pyamaxkit 1.0.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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