walletbeat icon indicating copy to clipboard operation
walletbeat copied to clipboard

Partial automated conversion function of wallet data to new schema

Open polymutex opened this issue 11 months ago • 0 comments

The beta version of the site uses a different schema for representing wallet data than the current one.

Current version of walletbeat:

  • Schema: https://github.com/fluidkey/walletbeat/blob/main/src/types/Info.tsx
  • Example wallet data: https://github.com/fluidkey/walletbeat/blob/main/src/beta/data/wallets/rabby.ts

Beta version:

  • Schema: https://github.com/fluidkey/walletbeat/blob/main/src/beta/schema/wallet.ts#L97
  • Example wallet data: https://github.com/fluidkey/walletbeat/blob/main/src/data/wallets/rabby.ts

The beta version has many more fields, but all/most of them are nullable to represent the fact that Walletbeat has not yet rated this particular aspect of a wallet. This makes it possible to write automated conversion code that converts the fields that do exist in the current version of the schema over to a partially-populated beta version of the schema. This issue tracks the creation of such code.

There's two ways such code could work:

  • Take in wallet data from the current schema, return an object that has the new schema.
  • Take in wallet data from the current schema, return a string that represents a JavaScript object that has the new schema.

The former would be useful to automatically display all wallets on the beta version of the site, but makes it difficult to expand the data about these wallets because the source files for these wallets wouldn't exist in the src/beta/data/wallets subdirectory. The latter would help with manually creating such a file in the src/beta/data/wallets subdirectory. So perhaps this code should support both modes?

polymutex avatar Jan 24 '25 23:01 polymutex