StricaHQ / typhonjs

Pure javascript Cardano wallet library
Apache License 2.0
61 stars 12 forks source link

getAddressFromHex method parameter problem #11

Closed woshidongyao closed 2 years ago

woshidongyao commented 2 years ago

How the hexAddress address is generated?

ashisherc commented 2 years ago

for generating address https://docs.strica.io/lib/typhonjs/classes/address.BaseAddress.html for key derivation https://github.com/StricaHQ/bip32ed25519

also have a look at the tests for examples

woshidongyao commented 2 years ago

I checked the test case and its parameters are hardcoded

ashisherc commented 2 years ago

do have a look at the links above for generating your keys, and let me know what exactly is your doubts/question

woshidongyao commented 2 years ago

I have generated public and private keys and need to use public keys to generate addresses, but my public key is of type Uint8Array, I would like to know what type of parameter is the getAddressFromHex method

ashisherc commented 2 years ago

you do not need to use getAddressFromHex method when you are constructing an address using derived keys, take a look at the lib below for constructing keys and the address classes in the API doc.

I recommend you to checkout docs.cardano.org to understand the types of Cardano addresses

https://github.com/StricaHQ/bip32ed25519

woshidongyao commented 2 years ago

ok thanks

ashisherc commented 2 years ago

I will close this issue, please feel free to create another issue if you have any doubts regarding typhonjs