Giter Club home page Giter Club logo

nem-python's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

nem-python's Issues

Does it need nem_ed25519 installed

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

Not able to send transaction

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?

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.