Closed dawsbot closed 3 months ago
This is nearly the exact same as https://github.com/dawsbot/evm-labels/issues/81 <- do that first
We want a function which is callable synchronously (no await needed). that loads up ALL tokens from data/*/*/tokens.json.
await
data/*/*/tokens.json
The data type we are trying to load up can be called Array<TokenDBRow>.
Array<TokenDBRow>
An TokenDBRow is like the type TokenRow which is already in the db, but with a few extra keys. You can define the the like this:
TokenDBRow
TokenRow
type TokenDBRow = { chainId: number; address: string; label: string; name: string; symbol: string; nameTag?: string; }
fs.readFileSync
const allTokens = loadAllTokensFromFilesystem();
This is nearly the exact same as https://github.com/dawsbot/evm-labels/issues/81 <- do that first
We want a function which is callable synchronously (no
await
needed). that loads up ALL tokens fromdata/*/*/tokens.json
.The data type we are trying to load up can be called
Array<TokenDBRow>
.An
TokenDBRow
is like the typeTokenRow
which is already in the db, but with a few extra keys. You can define the the like this:Steps
fs.readFileSync
to load all of those files into memory & generate thatTokenDBRow
typeExpected outcome