Closed jamesdorfman closed 8 months ago
Hey @jamesdorfman,
indeed, there is an error in the API reference. I'll fix it, thanks! docs.vulpem.com/marina/api should be up to date.
About adrress' public key
getNextAddress
returns an Address since v0.5.x
. The interface does not contain the script public key but you can derive it using bip32.
related to https://github.com/vulpemventures/docs.vulpem.com/issues/19
Do you mean to say that the API call no longer returns an object but just and Address and that's why all other fields were dropped? I think the fields in that screenshot are actually really useful, no? And AFAIU they come for free because internally you already need to have them to construct the address, so returning them has no downsides to me it seems.. Tbf the hardware wallet APIs I've worked with all return the public key alongside the address when deriving or asking for a new address.
Do you mean to say that the API call no longer returns an object but just and Address and that's why all other fields were dropped?
No, Address
is still an interface with all the fields except the public key (+ some additional fields in case of taproot addresses).
I think the fields in that screenshot are actually really useful, no? And AFAIU they come for free because internally you already need to have them to construct the address, so returning them has no downsides to me it seems.. Tbf the hardware wallet APIs I've worked with all return the public key alongside the address when deriving or asking for a new address.
Yes you're right. Initially we removed the public key because v0.5.x
introduces account system and returns masterXPubKey
for each one. So the idea was to remove the "duplicates" and let apps to generate raw public key while they need it. However, you're not the first ones saying this so let's discuss how & if we re-add the public key field there: https://github.com/vulpemventures/marina-provider/issues/32
I am trying to get a raw pubkey from marina (not an address, but the underlying pubkey itself).
The API reference says that
getNextAddress()
should return a publicKey:However, when I run the following code in google chrome v115
this is the result which gets logged to the console:
Is there still a way for me to get a publicKey? Is this a bug?
Thanks!