-
-
Save blurpesec/94fde3aa2dca04eb91bf0be9bbf1e54d to your computer and use it in GitHub Desktop.
module.exports = { | |
"e1f698bf-cb85-5405-b563-14774af14bf1": { | |
uuid: "e1f698bf-cb85-5405-b563-14774af14bf1", // required - generated deterministically based on network chainId && contract address. | |
ticker: "DAI", // required - comes from ethereum-lists | |
name: "Dai Stablecoin v2.0", // required - comes from ethereum-lists | |
networkId: "Ethereum", // required - comes from ethereum-lists | |
type: "erc20", // required - Must be either 'erc20' or 'base' | |
decimal: 18, // required - comes from ethereum-lists | |
contractAddress: "0x6B175474E89094C44Da98b954EedeAC495271d0F", // only display when type = 'erc20' - comes from ethereum-lists | |
mappings: { // Comes from the mycryptohq/assets repo. | |
coinCapId: "dai", // optional | |
cryptoCompareId: "DAI", // optional | |
coinGeckoId: "dai", // optional | |
dexAgId: "DAI", // optional | |
cryptoCurrencyIconName: "dai" // optional | |
}, | |
website: "https://makerdao.com", | |
logo: { | |
src: "", | |
width: "", | |
height: "", | |
ipfs_hash: "" | |
}, | |
support: { | |
email: "support@makerdao.com", | |
url: "https://chat.makerdao.com" | |
}, | |
social: { | |
blog: "", | |
chat: "https://chat.makerdao.com", | |
facebook: "", | |
forum: "", | |
github: "https://github.com/makerdao", | |
gitter: "", | |
instagram: "", | |
linkedin: "", | |
reddit: "https://www.reddit.com/r/MakerDAO", | |
slack: "", | |
telegram: "", | |
twitter: "https://twitter.com/MakerDAO", | |
youtube: "" | |
} | |
} | |
} |
module.exports = { | |
"e1f698bf-cb85-5405-b563-14774af14bf1": { | |
uuid: "e1f698bf-cb85-5405-b563-14774af14bf1", // required - generated deterministically based on network chainId && contract address. | |
ticker: "DAI", // required - comes from ethereum-lists | |
name: "Dai Stablecoin v2.0", // required - comes from ethereum-lists | |
networkId: "Ethereum", // required - comes from ethereum-lists | |
type: "erc20", // required - Must be either 'erc20' or 'base' | |
decimal: 18, // required - comes from ethereum-lists | |
contractAddress: "0x6B175474E89094C44Da98b954EedeAC495271d0F", // only display when type = 'erc20' - comes from ethereum-lists | |
mappings: { // Comes from the mycryptohq/assets repo. | |
dexAgId: "DAI", // optional | |
}, | |
iconURL: "https://mycryptoapi.com/api/v1/icon/e1f698bf-cb85-5405-b563-14774af14bf1", | |
ratesURL: "https://mycryptoapi.com/api/v1/rates/e1f698bf-cb85-5405-b563-14774af14bf1", | |
website: "https://makerdao.com", | |
logo: { | |
src: "", | |
width: "", | |
height: "", | |
ipfs_hash: "" | |
}, | |
support: { | |
email: "support@makerdao.com", | |
url: "https://chat.makerdao.com" | |
}, | |
social: { | |
blog: "", | |
chat: "https://chat.makerdao.com", | |
facebook: "", | |
forum: "", | |
github: "https://github.com/makerdao", | |
gitter: "", | |
instagram: "", | |
linkedin: "", | |
reddit: "https://www.reddit.com/r/MakerDAO", | |
slack: "", | |
telegram: "", | |
twitter: "https://twitter.com/MakerDAO", | |
youtube: "" | |
} | |
} | |
} |
module.exports = { | |
"e1f698bf-cb85-5405-b563-14774af14bf1": { | |
uuid: "e1f698bf-cb85-5405-b563-14774af14bf1", // required - generated deterministically based on network chainId && contract address. | |
usd: 1.02, | |
eur: 0.93765 | |
} | |
} |
Note in All_Assets_Object_v2.js
the only difference is these two lines https://gist.github.com/blurpesec/94fde3aa2dca04eb91bf0be9bbf1e54d#file-all_assets_object_v2-js-L17-L18
And removed some of these lines: https://gist.github.com/blurpesec/94fde3aa2dca04eb91bf0be9bbf1e54d#file-all_assets_object_v1-js-L10-L16
These will be added as their own endpoints, accessible by uuid.
Can you add some quick notes/requirements here whenever you get a chance? I want to make sure I'm not missing anything xD
For All_Assets_Object_v1.js
we want to do the following:
On update of either mycryptohq/assets
or ethereum-lists/tokens
we're going to want to rebuild the file. Basically
- Download
ethereum-lists/tokens
token files. - Generate the uuid using the convention found in https://github.com/MyCryptoHQ/assets 's README
- Create an object containing all of the token file found from
ethereum-lists/tokens
. Name itwholeAssetObject
or something - Download
mycryptohq/assets
'sassets.json
file. - Add a
mappings
key to yourwholeAssetObject
which corresponds to the uuid key inassets.json
.
In All_Assets_Object_v2.js
the goal is to remove the different mappings
ids and replace them with links to their related api endpoint.
This requires us to have endpoints to fetch the third party stuff based on the uuid.
Method to generate deterministic UUID can be found in the README.md of https://github.com/MyCryptoHQ/assets .
To see the node.js method of generating deterministic UUIDs: https://github.com/MyCryptoHQ/MyCrypto/blob/master/common/v2/utils/generateUUID.tsx#L22-L25