harmony-one / pyhmy Goto Github PK
View Code? Open in Web Editor NEWA Python library for interacting and working with the harmony blockchain.
License: MIT License
A Python library for interacting and working with the harmony blockchain.
License: MIT License
import binascii
from bech32 import bech32_encode, convertbits
def convert_eth_to_one(eth_address):
hex_address = binascii.a2b_hex(eth_address)
binary_address = convertbits(hex_address, 8, 5)
return bech32_encode('one', binary_address)
a = convert_eth_to_one('006922cf75094708c691d06818034d89aeb23ca0')#delete 0x
print(a)
There currently exists a pip dependency conflict with Web3; namely, Web3 requires eth-account<0.6.0,>=0.5.6, but pyhmy's setup.cfg explicitly requires 0.5.4.
Unless this older version is used for a specific reason, pyhmy should be updated to use a newer version of eth-account, such as 0.5.7.
Getting ModuleNotFoundError: No module named 'pyhmy.bech32'
error after installing with pip install pyhmy
in Anaconda Environment on Ubuntu.
Hi
when I was working on this rep
I noticed that it does not support web sockets ('wss://ws.s0.t.hmny.io')
Do you have a plan to complete this feature?
Thankful
the parameters are not aligned with request example.
api url
I think the parameter is block_num only.
can anyone help to update it?
Warning: Using outdated version. Redownload to upgrade to v393-854a73e
commit: v390-4b59bb7, error: unknown command "st__PYHMY_ARG_PREFIX___3king" for "hmy"
check hmy cookbook for valid examples or try adding a `--help` flag
[AutoNode] Create-validator transaction failure (attempt 1). Error: Bad CLI args: `hmy --node https://api.s0.b.hmny.io/ staking create-validator --validator-addr one1sndrr078n0wd3g0hmvyedwj2grckswvn8zf863 --name "a" --identity "AutoNode-2307956633354238483" --website "]" --security-contact "c" --details "e" --rate 0.1 --max-rate 1 --max-change-rate 0.1 --min-self-delegation 1E+4 --max-total-delegation 1E+4 --amount 1E+4 --bls-pubkeys 006de9f3edec3f2b687a0a99fa560d432d9aa80df04f771e3230508d890d67a2933905bfd038c8c7445b36365583188f --passphrase-file "/home/ec2-user/.hmy/.wallet_pass" --bls-pubkeys-dir "/home/ec2-user/.hmy/blskeys" --gas-price 1 `
Exception: Command '['/home/ec2-user/.hmy/bin/hmy', '--nod__PYHMY_ARG_PREFIX___6', 'https://__PYHMY_ARG_PREFIX___3pi.s0.b.hmny.io/', 'st__PYHMY_ARG_PREFIX___3king', '__PYHMY_ARG_PREFIX___5r__PYHMY_ARG_PREFIX___6__PYHMY_ARG_PREFIX___3t__PYHMY_ARG_PREFIX___6-v__PYHMY_ARG_PREFIX___3lid__PYHMY_ARG_PREFIX___3tor', '--v__PYHMY_ARG_PREFIX___3lid__PYHMY_ARG_PREFIX___3tor-__PYHMY_ARG_PREFIX___3ddr', 'on__PYHMY_ARG_PREFIX___61sndrr078n0wd3g0hmvy__PYHMY_ARG_PREFIX___6dwj2gr__PYHMY_ARG_PREFIX___5kswvn8zf863', '--n__PYHMY_ARG_PREFIX___3m__PYHMY_ARG_PREFIX___6', 'a', '--id__PYHMY_ARG_PREFIX___6ntity', 'AutoNode-2307956633354238483', '--w__PYHMY_ARG_PREFIX___6bsit__PYHMY_ARG_PREFIX___6', ']', '--s__PYHMY_ARG_PREFIX___6__PYHMY_ARG_PREFIX___5urity-__PYHMY_ARG_PREFIX___5ont__PYHMY_ARG_PREFIX___3__PYHMY_ARG_PREFIX___5t', 'c', '--d__PYHMY_ARG_PREFIX___6t__PYHMY_ARG_PREFIX___3ils', 'e', '--r__PYHMY_ARG_PREFIX___3t__PYHMY_ARG_PREFIX___6', '0.1', '--m__PYHMY_ARG_PREFIX___3x-r__PYHMY_ARG_PREFIX___3t__PYHMY_ARG_PREFIX___6', '1', '--m__PYHMY_ARG_PREFIX___3x-__PYHMY_ARG_PREFIX___5h__PYHMY_ARG_PREFIX___3ng__PYHMY_ARG_PREFIX___6-r__PYHMY_ARG_PREFIX___3t__PYHMY_ARG_PREFIX___6', '0.1', '--min-s__PYHMY_ARG_PREFIX___6lf-d__PYHMY_ARG_PREFIX___6l__PYHMY_ARG_PREFIX___6g__PYHMY_ARG_PREFIX___3tion', '1E+4', '--m__PYHMY_ARG_PREFIX___3x-tot__PYHMY_ARG_PREFIX___3l-d__PYHMY_ARG_PREFIX___6l__PYHMY_ARG_PREFIX___6g__PYHMY_ARG_PREFIX___3tion', '1E+4', '--__PYHMY_ARG_PREFIX___3mount', '1E+4', '--bls-pubk__PYHMY_ARG_PREFIX___6ys', '006d__PYHMY_ARG_PREFIX___69f3__PYHMY_ARG_PREFIX___6d__PYHMY_ARG_PREFIX___6__PYHMY_ARG_PREFIX___53f2b687__PYHMY_ARG_PREFIX___30__PYHMY_ARG_PREFIX___399f__PYHMY_ARG_PREFIX___3560d432d9__PYHMY_ARG_PREFIX___3__PYHMY_ARG_PREFIX___380df04f771__PYHMY_ARG_PREFIX___63230508d890d67__PYHMY_ARG_PREFIX___32933905bfd038__PYHMY_ARG_PREFIX___58__PYHMY_ARG_PREFIX___57445b36365583188f', '--p__PYHMY_ARG_PREFIX___3ssphr__PYHMY_ARG_PREFIX___3s__PYHMY_ARG_PREFIX___6-fil__PYHMY_ARG_PREFIX___6', '/home/ec2-user/.hmy/.wallet_pass', '--bls-pubk__PYHMY_ARG_PREFIX___6ys-dir', '/home/ec2-user/.hmy/blskeys', '--g__PYHMY_ARG_PREFIX___3s-pri__PYHMY_ARG_PREFIX___5__PYHMY_ARG_PREFIX___6', '1']' returned non-zero exit status 1.
`main_net = 'https://rpc.s0.t.hmny.io'
delegation_information = staking.get_all_delegation_information(page=-1, endpoint=main_net)
print(delegation_information)`
Manually cloning the repo and doing a make install works fine.
However, doing a pip3 install pyhmy gives a version without some essential features. e.g. from pyhmy import signing fails
You should change account.py script, remove from .bech32.bech32 import (...) one bech32.
It should be from .bech32 import (...)
668d7ef756e4fefe4621f435bb9a3e37cbeb82d9
I am trying to issue a simple fund-transferring transaction. The code, according to the project's README
should look like this:
import pyhmy.transaction as t
import pyhmy.signing as s
bobPub = "one1mfzkvvtsjzagnkxc3ad4lndnfk92hpla70nf24"
# Bob is a testing acc with only testnet ONEs
bobPriv = "c07bfdf4819946009c06bfee12f9ef2d37c1a216600961460121f1c085d16316"
magniffPub = "one10glu5d2sxyn5gcg0e6yd7v7ty4vptjs3pr0spc"
testNetAddress = "https://api.s0.b.hmny.io"
tx = {
'chainId': 2,
'from': bobPub,
'gas': 6721900,
'gasPrice': 1000000000,
'nonce': 10101,
'shardID': 0,
'to': magniffPub,
'toShardID': 0,
'value': 10 ** 15,
}
print(t.send_raw_transaction(
s.sign_transaction(tx, bobPriv).rawTransaction.hex(), testNetAddress
))
It actually gives me back the transaction id, yet it could not be found on explorer, nor funds are transferred.
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.