Python Toolkit for EOS
python3 -m pip install -U pip
python3 -m pip install pyeoskit
python -m pip install -U pip
python -m pip install pyeoskit
pyeoskit 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 pyeoskit
import os
from pyeoskit import eosapi, wallet
#import your account private key here
wallet.import_key('mywallet', '5K463ynhZoCDDa4RDcr63cUwWLTnKqmdcoTKTHBjqoKfv4u5V7p')
eosapi.set_node('https://eos.greymass.com')
info = eosapi.get_info()
print(info)
args = {
'from': 'test1',
'to': 'test2',
'quantity': '1.0000 EOS',
'memo': 'hello,world'
}
eosapi.push_action('eosio.token', 'transfer', args, {'test1':'active'})
import os
import asyncio
from pyeoskit import wallet
from pyeoskit.chainapi import ChainApiAsync
#import your account private key here
wallet.import_key('mywallet', '5K463ynhZoCDDa4RDcr63cUwWLTnKqmdcoTKTHBjqoKfv4u5V7p')
async def test():
eosapi = ChainApiAsync('https://eos.greymass.com')
info = await eosapi.get_info()
print(info)
args = {
'from': 'test1',
'to': 'test2',
'quantity': '1.0000 EOS',
'memo': 'hello,world'
}
r = await eosapi.push_action('eosio.token', 'transfer', args, {'test1':'active'})
print(r)
asyncio.run(test())
import os
from pyeoskit import eosapi
eosapi.set_node('https://eos.greymass.com')
args = {
'from': 'test1',
'to': 'test2',
'quantity': '1.0000 EOS',
'memo': 'hello,world'
}
#indices is an array of ledger signing key indices
eosapi.push_action('eosio.token', 'transfer', args, {'test1':'active'}, indices=[0])
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
git clone https://www.github.com/learnforpractice/pyeoskit
cd pyeoskit
git submodule update --init --recursive
./build.sh
For Windows platform, in the cmd dialog, enter the following command:
python setup.py sdist bdist_wheel
./install.sh
For Windows platform
python -m pip uninstall pyeoskit -y;python -m pip install .\dist\pyeoskit-[SUFFIX].whl