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

Wallet class usage is reversed from xrpl.js

Open mDuo13 opened this issue 3 years ago • 0 comments

Both xrpl.js and xrpl-py have two ways of instantiating their Wallet class:

  • from an existing seed
  • generating a new random seed

In both cases, one of these options is the default constructor and the other is a class method. However, which is which is reversed between the libraries.

Library xrpl-py xrpl.js
existing seed Wallet(seed, sequence) Wallet.fromSeed(seed)
new random seed Wallet.create() new Wallet()

I think the xrpl.js way is better, and it might help people move through the ecosystem if the methods were named and used similarly.

To do that, we would:

  • Deprecate the arguments to the default Wallet() constructor (make them optional, but still supported)
  • Add a .fromSeed(seed) class method to Wallet. It can supply a default sequence number of 0 or something.

mDuo13 avatar Nov 10 '21 00:11 mDuo13