user2897: I have this Stake Key:
https://testnet.cardanoscan.io/stakekey/7622b4611b15441e7e15cba128ff999ad72388aeb267adc6e70cc9bc?tab=stakehistory
I want to convert from 7622b4611b15441e7e15cba128ff999ad72388aeb267adc6e70cc9bc to stake_test1upmz9drprv25g8n7zh96z28lnxddwgug46ex0twxuuxvn0qp3cptz format.
How do I do it using this library https://github.com/Emurgo/cardano-serialization-lib?
Thanks

user6690: The beech32 representation is a bit tricky, but you can do it like this:
const stakeKey = StakeCredential.from_bytes(from_hex('7622b4611b15441e7e15cba128ff999ad72388aeb267adc6e70cc9bc'));
const networkId = 1; // testnet = 1, mainnet = 0
const beech32StakeKey = RewardAddress.new(networkId, stakeKey).to_address().to_bech32();
console.log(beech32StakeKey);

Hope this helps. The "from_hex" function is just a simple js function to convert the Hex string into an UInt8Array that is needed for the from_bytes function of StakeCredentials.

2897: <p>I have this Stake Key:</p>
<p><a href="https://testnet.cardanoscan.io/stakekey/7622b4611b15441e7e15cba128ff999ad72388aeb267adc6e70cc9bc?tab=stakehistory" rel="nofollow noreferrer">https://testnet.cardanoscan.io/stakekey/7622b4611b15441e7e15cba128ff999ad72388aeb267adc6e70cc9bc?tab=stakehistory</a></p>
<p>I want to convert from <code>7622b4611b15441e7e15cba128ff999ad72388aeb267adc6e70cc9bc</code> to <code>stake_test1upmz9drprv25g8n7zh96z28lnxddwgug46ex0twxuuxvn0qp3cptz</code> format.</p>
<p>How do I do it using this library <a href="https://github.com/Emurgo/cardano-serialization-lib" rel="nofollow noreferrer">https://github.com/Emurgo/cardano-serialization-lib</a>?</p>
<p>Thanks</p>
 6690: <p>The beech32 representation is a bit tricky, but you can do it like this:</p>
<pre><code>const stakeKey = StakeCredential.from_bytes(from_hex('7622b4611b15441e7e15cba128ff999ad72388aeb267adc6e70cc9bc'));
const networkId = 1; // testnet = 1, mainnet = 0
const beech32StakeKey = RewardAddress.new(networkId, stakeKey).to_address().to_bech32();
console.log(beech32StakeKey);
</code></pre>
<p>Hope this helps. The &quot;from_hex&quot; function is just a simple js function to convert the Hex string into an UInt8Array that is needed for the from_bytes function of StakeCredentials.</p>
