Sjors / libwally-swift

Swift wrapper for LibWally, a collection of useful primitives for cryptocurrency wallets
MIT License
40 stars 18 forks source link

Ability to access pubkey data directly? #26

Closed Fonta1n3 closed 4 years ago

Fonta1n3 commented 4 years ago

I would like to display the hex of derived pubkeys to the user so that they may verify the derived pubkeys are what they expect them to be when for example importing a seed (along with the address and wif). When I try and access the raw data of the pubkey like so:

key.pubKey.data

I get an error:

'data' is inaccessible due to 'internal' protection level

Is there a way I can disable the internal protection level so that I may access the data directly?

Sjors commented 4 years ago

I'm fine with making all these public: https://github.com/blockchain/libwally-swift/blob/master/LibWally/Address.swift#L260-L262

Fonta1n3 commented 4 years ago

Thank you for pointing out the file, I was looking in the wrong place :)

Sjors commented 4 years ago

There's a PR for it: #27

Sjors commented 4 years ago

Done. Private keys are exposed as well, but be careful with that, as I mentioned in #20