Replies: 2 comments
-
You can put the pub key hash as staking part, try this:
|
Beta Was this translation helpful? Give feedback.
0 replies
-
That was it.
Thanks!
…On Mon, Feb 20, 2023 at 11:36 PM Jerry ***@***.***> wrote:
You can put the pub key hash as staking part, try this:
convertedaddr = pycardano.address.Address(staking_part=payment_hash).encode()
—
Reply to this email directly, view it on GitHub
<#168 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ATNAJXMJUVGJ4O65L7XTZBLWYRA4JANCNFSM6AAAAAAVCNJHTY>
.
You are receiving this because you authored the thread.Message ID:
***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am looking for a way to derive a Bech32 stake address from a hex stake address. Am I missing an easy way to do this with the pycardano library?
from this: "e1658e1f8524d9b7e01383c304d2075686d3e958ee1987e9e09401f84b"
nami wallet output to this "658e1f8524d9b7e01383c304d2075686d3e958ee1987e9e09401f84b"
to this "stake1u9jcu8u9ynvm0cqns0psf5s826rd862cacvc060qjsqlsjcj6n09v"
This was my attempt. however, this outputs an address that is not a stake addr:
"addr1v9jcu8u9ynvm0cqns0psf5s826rd862cacvc060qjsqlsjcwsnfe7"
`import pycardano
def convertwalletstakeaddr(hexfromnami):
hexaddr = hexfromnami[2:]
payment_hash = pycardano.address.VerificationKeyHash(
bytes.fromhex(hexaddr))
convertedaddr = pycardano.address.Address(payment_hash).encode()
return (convertedaddr)
test = convertwalletstakeaddr("e1658e1f8524d9b7e01383c304d2075686d3e958ee1987e9e09401f84b")
print(test) '
Beta Was this translation helpful? Give feedback.
All reactions