xrpl-py
xrpl-py copied to clipboard
Wallet class usage is reversed from xrpl.js
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 toWallet
. It can supply a default sequence number of 0 or something.