PolymeshAssociation / polymesh-wallet

A Wallet for Polymesh blockchain
Apache License 2.0
13 stars 6 forks source link

Account key pair type: undefined #243

Open F-OBrien opened 2 years ago

F-OBrien commented 2 years ago

Account information returned by web3Accounts returns a type: undefined for the keyPair type. Also when using web3Enable can calling polyWallet.accounts.get() on the returned Polymesh wallet there is no object entry for type.

As a result calling `await web3Accounts({ accountType: ['ed25519'], ss58Format: 12 }) (or other types) will still return all accounts.

The type object is missing or undefined even when importing a JSON generated using the Polkadot extension or https://mainnet-app.polymesh.network/#/accounts page that includes the correct type. image image

The type information appears to get stored somewhere as exporting accounts generated in the Polymesh wallet extension to JSON and importing to the Pokkadot extension returns the correct KeyPair type. Also importing an JSON from https://mainnet-app.polymesh.network/#/accounts and then exporting again and importing to the Polkadot extension returns the correct type. I have confirmed this by importing and exporting both sd25519 and ed25519.

(side note: it should possibly be noted somewhere that the wallet creates sr25519 keys and the restore from seed option also only creates sr25519 accounts even is using a seed phrase or hex seed previously used to create a ed25519 pair. Other account pair types are only possible through JSON import.)