Skip to content

Adjust accounts, with type #569

@jacogr

Description

@jacogr

Change this interface https://github.com/polkadot-js/extension/blob/master/packages/extension-inject/src/types.ts#L27-L30 to cater for non-ss58 accounts.

Basically add a getAll(), marking get as deprecated. With getAll, return [<sr25519 | ed25519 | ethereum | ...>, InjectedAcocunt][]

Since the type can be derived anyway from on-chain data, this is non-exposing. Then the logic would be -

  • when get is called, only return the ss58-accounts, i.e. don't break userspace
  • when getAll is called, return, well, everything with type

Needed for -

The alternative would be the following -

  • add a type?: KeyringType to the AccountInjected
  • add a flag to get(withType?: boolean) which will populate the type (if not supplied, same non-eth filter as above)

This is probably preferable since it has less working-with-data changes on the users of the interface, however they still need to opt-in.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions