xrpl-accountlib icon indicating copy to clipboard operation
xrpl-accountlib copied to clipboard

Add: Derive account from XRPL_Account

Open tequdev opened this issue 2 years ago • 3 comments

Allows to get Account directly from XRPL-Account, not just from derive.

tequdev avatar Nov 14 '23 06:11 tequdev

Thanks for the contribution!

I'm happy to merge this, but I'd like to understand the advantage/use case that made you add this :)

WietseWind avatar Nov 14 '23 08:11 WietseWind

Especially for those who are new to this library, generating accounts from XRPL_Account is easier to understand than derive in terms of code readability.

tequdev avatar Nov 14 '23 08:11 tequdev

I understand.

If it's for readability/usability for people new to this lib, I think for the sake of abstraction this addition (which I support) this belongs elsewhere.

Right now the methods are added to the Account.ts section, which deals with none of the crypto derivation.

I think it would be cleanest to add the aliases in the overall index.ts (https://github.com/WietseWind/xrpl-accountlib/blob/master/src/index.ts) which is only used as a mapper to other methods and objects in the first place.

Which could be even more user friendly with a separate export object with direct methods returning the object;

export {
  AccountFromMnemonic,
  /// ...
}

WietseWind avatar Nov 14 '23 11:11 WietseWind