namuyan / nem-python Goto Github PK
View Code? Open in Web Editor NEWNEM(NIS1) simple library of Python3
License: MIT License
NEM(NIS1) simple library of Python3
License: MIT License
Hey, I was trying to test the library but getting error:
Traceback (most recent call last):
File "basic.py", line 1, in <module>
from nem_python.nem_connect import NemConnect
File "/home/pi/Desktop/namuyan/nem-python/nem_python/nem_connect.py", line 15, in <module>
from .transaction_reform import TransactionReform
File "/home/pi/Desktop/namuyan/nem-python/nem_python/transaction_reform.py", line 5, in <module>
from nem_ed25519.key import get_address
ImportError: No module named 'nem_ed25519'
Also while installing https://github.com/namuyan/nem-ed25519 I am getting the errors:
In file included from src/gmpy2.c:426:0:
src/gmpy.h:106:19: fatal error: gmp.h: No such file or directory
# include "gmp.h"
^
compilation terminated.
error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1
OS: ubuntu 16.04
python: python v3.5
module nem-python
from nem_python.nem_connect import NemConnect
from nem_python.transaction_builder import TransactionBuilder
from nem_ed25519.signature import sign
from binascii import unhexlify, hexlify
from datetime import datetime
nem = NemConnect()
nem.start()
# create raw transaction
tb = TransactionBuilder()
tx_dict = {
‘type’: 257, ‘version’: 1744830466,
‘signer’: ‘<sender_public_key>’,
‘timeStamp’: int(datetime.now().timestamp()), ‘deadline’:int(datetime.now().timestamp()+300),
‘recipient’: ‘’,
‘amount’: 100000, ‘fee’: 100000,
‘message’: {‘type’: 1, ‘payload’: ‘68656c6c6f20776f726c64’},
‘mosaics’: {“nem:xem”: 100000}
}
tx_hex = tb.encode(tx_dict)
print(tx_hex)
# sign transaction
secret_key = '<send_private_key>'
public_key = '<send_public_key>'
sign_raw = sign(msg=unhexlify(tx_hex.encode()), sk=secret_key, pk=public_key)
sign_hex = hexlify(sign_raw).decode()
# broadcast transaction
tx_hash = nem.transaction_announce(tx_hex, sign_hex)
print(tx_hash)
the following error crawls in
Traceback (most recent call last):
File “”, line 3, in
File “/home/devesh/env/python_35/lib/python3.5/site-packages/nem_python/nem_connect.py”, line 921, in transaction_announce
raise Exception(“failed ‘transaction/announce’ %s” % result_message)
Exception: failed ‘transaction/announce’ [‘expected value for property mosaics, but none was found’, ‘expected value for property mosaics, but none was found’, ‘expected value for property mosaics, but none was found’]
Can anybody please help me out?
I pushed many updates to nem-ed25519 but do not fix to work.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.