diff --git a/README.md b/README.md new file mode 100644 index 0000000..dc203a0 --- /dev/null +++ b/README.md @@ -0,0 +1,29 @@ +# MVC Resources + +## Overview + +This repository contains resources such as icons, logos, and other assets. + +We use unpkg service to serve these assets. + +To get the URL of an asset, use the provided `getAssetUrl` function. + +```ts: +import { getIconUri } from '@mvc-org/mvc-resources' + +const uri = getIconUri({ + type: 'metaContract', + codehash: 'a2421f1e90c6048c36745edd44fad682e8644693', + genesis: '94c2ae3fdbf95a4fb0d788c818cf5fcc7a9aa66a', // genesis for usdt +}) + +console.log(uri) +// https://unpkg.com/@mvc-org/mvc-resources/icons/meta-contract/usdt.jpg +``` + +## To add a new asset + +- Fork this repository +- Add the asset to the appropriate folder. +- Add asset lookup rules to corresponding the rules file. +- Create a pull request to the main repository and wait for approval. It will be published to unpkg after approval. diff --git a/package.json b/package.json index 07facbe..7942da8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@mvc-org/mvc-resources", - "version": "1.0.5", + "version": "1.0.6", "description": "mvc resources cdn", "main": "dist/index.js", "files": [ diff --git a/src/index.js b/src/index.js deleted file mode 100644 index 69e746f..0000000 --- a/src/index.js +++ /dev/null @@ -1,16 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.getIconUri = void 0; -var metaContract_1 = require("./rules/metaContract"); -function getIconUri(params) { - var _a; - if (params.type === 'metaContract') { - var logoName = (_a = metaContract_1.metaContractIcons.find(function (icon) { return icon.genesis === params.genesis && icon.codehash === params.codehash; })) === null || _a === void 0 ? void 0 : _a.logo; - if (!logoName) { - return ''; - } - return "https://unpkg.com/@mvc-org/mvc-resources/icons/meta-contract/".concat(logoName); - } - return ""; -} -exports.getIconUri = getIconUri; diff --git a/src/rules/metaContract.js b/src/rules/metaContract.js deleted file mode 100644 index ea311ad..0000000 --- a/src/rules/metaContract.js +++ /dev/null @@ -1,257 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.metaContractIcons = void 0; -exports.metaContractIcons = [ - { - genesis: 'SPACE', - codehash: '', - symbol: 'SPACE', - logo: 'space.png', - }, - { - genesis: 'b2d75931958114e48c9927160f80363eae78e2dc', - codehash: 'a2421f1e90c6048c36745edd44fad682e8644693', - symbol: 'MSP', - logo: 'ms.png', - }, - { - genesis: 'MSP', - codehash: 'MSP', - symbol: 'MSP', - logo: 'ms-small.png', - }, - { - genesis: 'fad7b10812fa76718127e084bb71cdb87853261c', - codehash: 'a2421f1e90c6048c36745edd44fad682e8644693', - symbol: 'veMSP', - logo: 'vemsp.png', - }, - { - genesis: '94c2ae3fdbf95a4fb0d788c818cf5fcc7a9aa66a', - codehash: 'a2421f1e90c6048c36745edd44fad682e8644693', - symbol: 'USDT', - logo: 'usdt.jpg', - }, - { - genesis: '07e4c5a9f866164108de005be81d40ccbd2e964c', - codehash: 'a2421f1e90c6048c36745edd44fad682e8644693', - symbol: 'MC', - logo: 'mc.png', - }, - { - genesis: '185b4c8fb97a133f1587411b449d30d87ce7d155', - codehash: 'a2421f1e90c6048c36745edd44fad682e8644693', - symbol: 'SHOW', - logo: 'show.png', - }, - { - genesis: '885b03c2df974ec29d6bab4766af28e14b87e689', - codehash: 'c9cc7bbd1010b44873959a8b1a2bcedeb62302b7', - symbol: 'sats', - logo: 'sats.png', - }, - { - genesis: '6d1f13d08650fddfe68d9ea301cdd95c7274f99f', - codehash: 'c9cc7bbd1010b44873959a8b1a2bcedeb62302b7', - symbol: 'WBTC', - logo: 'w-btc.png', - }, - { - genesis: '8259e9b6606a36c1ae7634572b58e0cf1f67185e', - codehash: 'c9cc7bbd1010b44873959a8b1a2bcedeb62302b7', - symbol: 'WRDEX', - logo: 'w-RDEX.png', - }, - { - genesis: '17132328ded0f37f5983bcd43d7b4293b4c68152', - codehash: 'c9cc7bbd1010b44873959a8b1a2bcedeb62302b7', - symbol: 'Wordi', - logo: 'w-ordi.png', - }, - { - genesis: '7cacd8e37027685a2eaa17c4654601aaa3f19028', - codehash: 'c9cc7bbd1010b44873959a8b1a2bcedeb62302b7', - symbol: 'Wsats', - logo: 'w-sats.png', - }, - { - genesis: '2ca791a4352138e5ab3ed4252a8271c64391cca7', - codehash: 'c9cc7bbd1010b44873959a8b1a2bcedeb62302b7', - symbol: 'Wrats', - logo: 'w-rats.png', - }, - { - genesis: '19f1a6cdaae4d1e13a5ad1af5d40d197d9dc3394', - codehash: 'c9cc7bbd1010b44873959a8b1a2bcedeb62302b7', - symbol: 'Wmerm', - logo: 'w-merm.png', - }, - { - genesis: '50f81dc1285978effcce562b33e157d55017893a', - codehash: 'c9cc7bbd1010b44873959a8b1a2bcedeb62302b7', - symbol: 'Wkorm', - logo: 'w-korm.png', - }, - { - genesis: '098c951611c752f4ce64a4a65b2f1dbbee16ef09', - codehash: 'c9cc7bbd1010b44873959a8b1a2bcedeb62302b7', - symbol: 'Wcore', - logo: 'w-core.png', - }, - { - genesis: 'a66547c18df1cfa67a0a6bff3fc76727b07414fc', - codehash: 'c9cc7bbd1010b44873959a8b1a2bcedeb62302b7', - symbol: 'Wpiin', - logo: 'w-piin.png', - }, - { - genesis: '57862ce54d811bcc5ad686a621f701cad51318bc', - codehash: 'c9cc7bbd1010b44873959a8b1a2bcedeb62302b7', - symbol: 'WPUPS', - logo: 'w-PUPS.png', - }, - { - genesis: '5a4b7274b469a27d6a5c8c4c4601b8603e22ec2a', - codehash: 'c9cc7bbd1010b44873959a8b1a2bcedeb62302b7', - symbol: 'W20EX', - logo: 'w-20EX.png', - }, - { - genesis: '5b50178bdf6dae1b170336e0d1c601f751cc8fab', - codehash: 'c9cc7bbd1010b44873959a8b1a2bcedeb62302b7', - symbol: 'Wpepe', - logo: 'w-pepe.png', - }, - { - genesis: 'a54dd16d255ac5462a59c9c33ef7d12b5917a63f', - codehash: 'c9cc7bbd1010b44873959a8b1a2bcedeb62302b7', - symbol: 'WORDG', - logo: 'w-ORDG.png', - }, - { - genesis: '90aea875decdafe31605c4eabf1351e2c8015dc9', - codehash: 'c9cc7bbd1010b44873959a8b1a2bcedeb62302b7', - symbol: 'Wmoon', - logo: 'w-moon.png', - }, - { - genesis: 'b108aba939dcbd0bddf1be0b51c50175ffd2a458', - codehash: 'c9cc7bbd1010b44873959a8b1a2bcedeb62302b7', - symbol: 'Wcows', - logo: 'w-cows.png', - }, - { - genesis: 'bf30a8f3616a6d38497babc0ef1cbbb7f3445c6d', - codehash: 'c9cc7bbd1010b44873959a8b1a2bcedeb62302b7', - symbol: 'Winsc', - logo: 'w-insc.png', - }, - { - genesis: '21f2bf395727698f1af320b0f604a0a681dcb88e', - codehash: 'c9cc7bbd1010b44873959a8b1a2bcedeb62302b7', - symbol: 'WAINN', - logo: 'w-AINN.png', - }, - { - genesis: 'e2cb8416681a853947c899cddf98e1ddfcad4deb', - codehash: 'c9cc7bbd1010b44873959a8b1a2bcedeb62302b7', - symbol: 'Wsatx', - logo: 'w-satx.png', - }, - { - genesis: '60ee8716fb3feed64459ff8fbf62661f96f7a1c4', - codehash: 'c9cc7bbd1010b44873959a8b1a2bcedeb62302b7', - symbol: 'W𝛑', - logo: 'w-𝛑.png', - }, - { - genesis: 'b7885ea0003d686ba89933e5ffa10c4f3a511b9d', - codehash: 'c9cc7bbd1010b44873959a8b1a2bcedeb62302b7', - symbol: 'Wligo', - logo: 'w-ligo.png', - }, - { - genesis: '72cb61a1162ad410c5d6d473699acbd839117d46', - codehash: 'c9cc7bbd1010b44873959a8b1a2bcedeb62302b7', - symbol: 'WAISN', - logo: 'w-AISN.png', - }, - { - genesis: '87eafd8cb072a775ec8a6a49d9916ca46a30e190', - codehash: 'c9cc7bbd1010b44873959a8b1a2bcedeb62302b7', - symbol: 'Weorb', - logo: 'w-eorb.png', - }, - { - genesis: 'cb44507a4683054f0977d128846f31394ecb0686', - codehash: 'c9cc7bbd1010b44873959a8b1a2bcedeb62302b7', - symbol: 'Wπts', - logo: 'w-πts.png', - }, - { - genesis: 'f8630214db537b634b8cb4a9b6c220554bd166e3', - codehash: 'c9cc7bbd1010b44873959a8b1a2bcedeb62302b7', - symbol: 'WBTCs', - logo: 'w-BTCs.png', - }, - { - genesis: 'e352039a3adf1f7ef76df6b85a7e904727b339f8', - codehash: 'c9cc7bbd1010b44873959a8b1a2bcedeb62302b7', - symbol: 'W9527', - logo: 'w-9527.png', - }, - { - genesis: 'ec1b259d42aa1af103c043b8723343619f4de1b5', - codehash: 'c9cc7bbd1010b44873959a8b1a2bcedeb62302b7', - symbol: 'pepe', - logo: 'pepe.jpg', - }, - { - genesis: '66b416427aa5c298dc38b7c057ca821448b6356f', - codehash: 'c9cc7bbd1010b44873959a8b1a2bcedeb62302b7', - symbol: 'WW☮', - logo: 'w-W☮.png', - }, - { - genesis: '3ac108db061cb045415cdd52def6965a4fa6b2df', - codehash: 'c9cc7bbd1010b44873959a8b1a2bcedeb62302b7', - symbol: 'Wwzrd', - logo: 'w-wzrd.png', - }, - { - genesis: '04502375fb643ba42b86476bf6962e28a2458356', - codehash: 'c9cc7bbd1010b44873959a8b1a2bcedeb62302b7', - symbol: 'WNODE', - logo: 'w-NODE.png', - }, - { - genesis: 'b100a4cb6ba2686abe7f76b6357111dbe618bec0', - codehash: 'c9cc7bbd1010b44873959a8b1a2bcedeb62302b7', - symbol: 'WSHID', - logo: 'w-SHID.png', - }, - { - genesis: '9d287e087dce0a9b77dc0242b7feb9e2fbf07465', - codehash: 'c9cc7bbd1010b44873959a8b1a2bcedeb62302b7', - symbol: 'buzz', - logo: 'buzz.jpg', - }, - { - genesis: '6fc259141818cb5d6dce51aef14a48eb747aec93', - codehash: 'c9cc7bbd1010b44873959a8b1a2bcedeb62302b7', - symbol: 'WOsfi', - logo: 'w-Osfi.png', - }, - { - genesis: 'd03131a9491f4af10e0a36ac320201f43db1e22c', - codehash: 'c9cc7bbd1010b44873959a8b1a2bcedeb62302b7', - symbol: 'bonk', - logo: 'bonk.jpg', - }, - { - genesis: 'e6c27d5600ac127a828ebda8b6c10a398d3953c7', - codehash: 'c9cc7bbd1010b44873959a8b1a2bcedeb62302b7', - symbol: 'APEX', - logo: 'APEX.jpg', - }, -];