Skip to content

Refactor the crypto wallet model #1091

Description

@aurelticot

As of creating this ticket, the crypto wallets are stored and managed in the app with an object structured by blockchain:

{
  "eip155:5": {
    "address": "0xABCD...",
    "...": "..."
  },
  "eip155:80001": {
    "address": "0xABCD...",
    "...": "..."
  },
  "near:testnet": {
    "address": "A1B2C3...",
    "...": "..."
  },
}

For a given blockchain typology (eip155), we are duplicating the information for each chain (5, 80001, etc).
If we dynamically add a new network from Wallet Provider, we'd need some logic to create the corresponding "wallet" for this chain as well.

We should instead only organise the wallet by blockchain typology and not care about the actual chain/network.

Actual model and schema to be defined, but something like this:

[{
  "namespace": "eip155",
  "address": "0xABCD...",
  "...": "..."
}, {
  "namespace": "near",
  "address": "A1B2C3...",
  "...": "..."
}]

Note: Changing the persistence schema will require a migration logic in the wallet.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions