web3swift icon indicating copy to clipboard operation
web3swift copied to clipboard

'paths' is deprecated: Please use addressStorage instead

Open jack0p1 opened this issue 3 years ago • 6 comments

When using the paths property of the BIP32Keystore class there is a warning saying "'paths' is deprecated: Please use addressStorage instead". The addressStorage property is declared as a private(set) property which results in its getter having an implicit internal access specifier since the entire class is marked as public. As a result it's not accessible outside the module.

One solution would be to mark the addressStorage property as public private(set).

jack0p1 avatar Jan 31 '22 16:01 jack0p1

can you please share your screen shot

RaviRanjan-11 avatar Feb 10 '22 11:02 RaviRanjan-11

Sure. Please find attached two screenshots. The getter of the addressStorage property has an implicitly internal protection level. Hence, it can't be accessed outside the web3swift module. Zrzut ekranu 2022-02-10 o 12 35 49 Zrzut ekranu 2022-02-10 o 12 36 01

jack0p1 avatar Feb 10 '22 11:02 jack0p1

We are having the same issue. Not an issue yet as it still compiles, but we need a way to access addressStorage. For example, getting the public key of a wallet (we need that for internal purposes) can only be done with code like in UNSAFE_getPrivateKeyData but for that we need access to the path

fpillet avatar Aug 04 '22 08:08 fpillet

I see that exactly this is done in 3.0.0 already, so the fix will be available on quite soon with next version release.

yaroslavyaroslav avatar Sep 02 '22 08:09 yaroslavyaroslav

@fpillet speaking about retrieving public key, such method will be available within new CodableTransaction.sender property again in version 3.0.0. It'll be calculated leveraging on private key data.

yaroslavyaroslav avatar Sep 02 '22 08:09 yaroslavyaroslav

@yaroslavyaroslav Ok thanks! For our purposes we need to access both public and private keys of wallets we generate. We also need to perform ECDH but that's a different topic, I have a post-install script that customizes your secp256k1 config to enable the ECDH function :)

fpillet avatar Sep 02 '22 13:09 fpillet