diff --git a/client/src/helper/checkUpdate.js b/client/src/helper/checkUpdate.js index c05b96a..1592551 100644 --- a/client/src/helper/checkUpdate.js +++ b/client/src/helper/checkUpdate.js @@ -4,8 +4,7 @@ import { ipc } from '../ipc' import { compareVersion } from '../util/compareVersion' import pkg from '../../../package.json' import { ticker } from '../util/ticker' -import { onDestroy } from 'svelte' -import { now, useEventListener } from '@svelte-use/core' +import { now, tryOnDestroy, useEventListener } from '@svelte-use/core' const appVersion = pkg.version @@ -50,7 +49,7 @@ export function checkUpdate() { } }) - onDestroy(() => { + tryOnDestroy(() => { checkUpdateTicker.stopTicker() }) } diff --git a/client/src/server/unMineableCoins.js b/client/src/server/unMineableCoins.js index a979f73..df81e1b 100644 --- a/client/src/server/unMineableCoins.js +++ b/client/src/server/unMineableCoins.js @@ -1,6 +1,6 @@ // https://api.unminable.com/v4/coin // Use a js module instead ajax -// Updated on: 10/26/2021, 1:23:53 AM +// Updated on: 10/26/2021, 11:42:33 AM export const apiv4coin = { "success": true, @@ -8,1267 +8,243 @@ export const apiv4coin = { "data": [ { "symbol": "1INCH", - "network": "ETH", - "token_standard": "ERC20", - "name": "1inch", - "regex": "^(0x)[0-9A-Fa-f]{40}$", - "regex_memo": null, - "top": 1, - "logo": "https://www.unmineable.com/img/logos/1INCH.png", - "chains": [ - { - "name": "Ethereum", - "network": "ETH", - "token_standard": "ERC20", - "regex": "^(0x)[0-9A-Fa-f]{40}$", - "regex_memo": null, - "is_default": true - } - ] + "name": "1inch" }, { "symbol": "CAKE", - "network": "BSC", - "token_standard": "BEP20", - "name": "PancakeSwap", - "regex": "^(0x)[0-9A-Fa-f]{40}$", - "regex_memo": null, - "top": 1, - "logo": "https://www.unmineable.com/img/logos/CAKE.png", - "chains": [ - { - "name": "Binance Smart Chain", - "network": "BSC", - "token_standard": "BEP20", - "regex": "^(0x)[0-9A-Fa-f]{40}$", - "regex_memo": null, - "is_default": true - } - ] + "name": "PancakeSwap" }, { "symbol": "CHZ", - "network": "ETH", - "token_standard": "ERC20", - "name": "Chiliz", - "regex": "^(0x)[0-9A-Fa-f]{40}$", - "regex_memo": null, - "top": 1, - "logo": "https://www.unmineable.com/img/logos/CHZ.png", - "chains": [ - { - "name": "Ethereum", - "network": "ETH", - "token_standard": "ERC20", - "regex": "^(0x)[0-9A-Fa-f]{40}$", - "regex_memo": null, - "is_default": true - } - ] + "name": "Chiliz" }, { "symbol": "HOT", - "network": "ETH", - "token_standard": "ERC20", - "name": "Holo", - "regex": "^(0x)[0-9A-Fa-f]{40}$", - "regex_memo": null, - "top": 1, - "logo": "https://www.unmineable.com/img/logos/HOT.png", - "chains": [ - { - "name": "Ethereum", - "network": "ETH", - "token_standard": "ERC20", - "regex": "^(0x)[0-9A-Fa-f]{40}$", - "regex_memo": null, - "is_default": true - } - ] + "name": "Holo" }, { "symbol": "MATIC", - "network": "ETH", - "token_standard": "ERC20", - "name": "MATIC (Polygon)", - "regex": "^(0x)[0-9A-Fa-f]{40}$", - "regex_memo": null, - "top": 1, - "logo": "https://www.unmineable.com/img/logos/MATIC.png", - "chains": [ - { - "name": "Binance Smart Chain", - "network": "BSC", - "token_standard": "BEP20", - "regex": "^(0x)[0-9A-Fa-f]{40}$", - "regex_memo": null, - "is_default": false - }, - { - "name": "Ethereum", - "network": "ETH", - "token_standard": "ERC20", - "regex": "^(0x)[0-9A-Fa-f]{40}$", - "regex_memo": null, - "is_default": true - }, - { - "name": "Polygon", - "network": "MATIC", - "token_standard": "Polygon", - "regex": "^(0x)[0-9A-Fa-f]{40}$", - "regex_memo": null, - "is_default": false - } - ] + "name": "MATIC (Polygon)" }, { "symbol": "SHIB", - "network": "ETH", - "token_standard": "ERC20", - "name": "SHIBA INU", - "regex": "^(0x)[0-9A-Fa-f]{40}$", - "regex_memo": null, - "top": 1, - "logo": "https://www.unmineable.com/img/logos/SHIB.png", - "chains": [ - { - "name": "Binance Smart Chain", - "network": "BSC", - "token_standard": "BEP20", - "regex": "^(0x)[0-9A-Fa-f]{40}$", - "regex_memo": null, - "is_default": false - }, - { - "name": "Ethereum", - "network": "ETH", - "token_standard": "ERC20", - "regex": "^(0x)[0-9A-Fa-f]{40}$", - "regex_memo": null, - "is_default": true - } - ] + "name": "SHIBA INU" }, { "symbol": "SOL", - "network": "SOL", - "token_standard": "Solana", - "name": "Solana", - "regex": "^[0-9a-zA-Z]{32,44}$", - "regex_memo": null, - "top": 1, - "logo": "https://www.unmineable.com/img/logos/SOL.png", - "chains": [ - { - "name": "Binance Smart Chain", - "network": "BSC", - "token_standard": "BEP20", - "regex": "^(0x)[0-9A-Fa-f]{40}$", - "regex_memo": null, - "is_default": false - }, - { - "name": "Solana", - "network": "SOL", - "token_standard": "Solana", - "regex": "^[0-9a-zA-Z]{32,44}$", - "regex_memo": null, - "is_default": true - } - ] + "name": "Solana" }, { "symbol": "AAVE", - "network": "ETH", - "token_standard": "ERC20", - "name": "Aave", - "regex": "^(0x)[0-9A-Fa-f]{40}$", - "regex_memo": null, - "top": 0, - "logo": "https://www.unmineable.com/img/logos/AAVE.png", - "chains": [ - { - "name": "Binance Smart Chain", - "network": "BSC", - "token_standard": "BEP20", - "regex": "^(0x)[0-9A-Fa-f]{40}$", - "regex_memo": null, - "is_default": false - }, - { - "name": "Ethereum", - "network": "ETH", - "token_standard": "ERC20", - "regex": "^(0x)[0-9A-Fa-f]{40}$", - "regex_memo": null, - "is_default": true - } - ] + "name": "Aave" }, { "symbol": "ADA", - "network": "ADA", - "token_standard": null, - "name": "Cardano", - "regex": "^(([0-9A-Za-z]{57,59})|([0-9A-Za-z]{100,104}))$", - "regex_memo": null, - "top": 0, - "logo": "https://www.unmineable.com/img/logos/ADA.png", - "chains": [ - { - "name": "Cardano", - "network": "ADA", - "token_standard": null, - "regex": "^(([0-9A-Za-z]{57,59})|([0-9A-Za-z]{100,104}))$", - "regex_memo": null, - "is_default": true - } - ] + "name": "Cardano" }, { "symbol": "ALGO", - "network": "ALGO", - "token_standard": null, - "name": "Algorand", - "regex": "^[A-Z0-9]{58,58}$", - "regex_memo": null, - "top": 0, - "logo": "https://www.unmineable.com/img/logos/ALGO.png", - "chains": [ - { - "name": "Algorand", - "network": "ALGO", - "token_standard": null, - "regex": "^[A-Z0-9]{58,58}$", - "regex_memo": null, - "is_default": true - } - ] + "name": "Algorand" }, { "symbol": "ATOM", - "network": "ATOM", - "token_standard": null, - "name": "Cosmos", - "regex": "^(cosmos1)[0-9a-z]{38}$", - "regex_memo": "^[0-9A-Za-z\\\\-_]{1,120}$", - "top": 0, - "logo": "https://www.unmineable.com/img/logos/ATOM.png", - "chains": [ - { - "name": "Cosmos", - "network": "ATOM", - "token_standard": null, - "regex": "^(cosmos1)[0-9a-z]{38}$", - "regex_memo": "^[0-9A-Za-z\\\\-_]{1,120}$", - "is_default": true - } - ] + "name": "Cosmos" }, { "symbol": "BAND", - "network": "BAND", - "token_standard": null, - "name": "Band Protocol", - "regex": "^(band1)[0-9a-z]{38}$", - "regex_memo": "^[0-9A-Za-z\\\\-_]{1,120}$", - "top": 0, - "logo": "https://www.unmineable.com/img/logos/BAND.png", - "chains": [ - { - "name": "Band Protocol", - "network": "BAND", - "token_standard": null, - "regex": "^(band1)[0-9a-z]{38}$", - "regex_memo": "^[0-9A-Za-z\\\\-_]{1,120}$", - "is_default": true - } - ] + "name": "Band Protocol" }, { "symbol": "BAT", - "network": "ETH", - "token_standard": "ERC20", - "name": "Basic Attention Token", - "regex": "^(0x)[0-9A-Fa-f]{40}$", - "regex_memo": null, - "top": 0, - "logo": "https://www.unmineable.com/img/logos/BAT.png", - "chains": [ - { - "name": "Ethereum", - "network": "ETH", - "token_standard": "ERC20", - "regex": "^(0x)[0-9A-Fa-f]{40}$", - "regex_memo": null, - "is_default": true - } - ] + "name": "Basic Attention Token" }, { "symbol": "BCH", - "network": "BCH", - "token_standard": null, - "name": "Bitcoin Cash", - "regex": "^[13][a-km-zA-HJ-NP-Z1-9]{25,34}$|^[0-9A-Za-z]{42,42}$", - "regex_memo": null, - "top": 0, - "logo": "https://www.unmineable.com/img/logos/BCH.png", - "chains": [ - { - "name": "Bitcoin Cash", - "network": "BCH", - "token_standard": null, - "regex": "^[13][a-km-zA-HJ-NP-Z1-9]{25,34}$|^[0-9A-Za-z]{42,42}$", - "regex_memo": null, - "is_default": true - } - ] + "name": "Bitcoin Cash" }, { "symbol": "BNB", - "network": "BNB", - "token_standard": "BEP2", - "name": "Binance Coin", - "regex": "^(bnb1)[0-9a-z]{38}$", - "regex_memo": "^[0-9A-Za-z\\\\-_]{1,120}$", - "top": 0, - "logo": "https://www.unmineable.com/img/logos/BNB.png", - "chains": [ - { - "name": "Binance Coin", - "network": "BNB", - "token_standard": "BEP2", - "regex": "^(bnb1)[0-9a-z]{38}$", - "regex_memo": "^[0-9A-Za-z\\\\-_]{1,120}$", - "is_default": true - }, - { - "name": "Binance Smart Chain", - "network": "BSC", - "token_standard": "BEP20", - "regex": "^(0x)[0-9A-Fa-f]{40}$", - "regex_memo": null, - "is_default": false - } - ] + "name": "Binance Coin" }, { "symbol": "BTC", - "network": "BTC", - "token_standard": null, - "name": "Bitcoin", - "regex": "^[13][a-km-zA-HJ-NP-Z1-9]{25,34}$|^(bc1)[0-9A-Za-z]{39,59}$", - "regex_memo": null, - "top": 0, - "logo": "https://www.unmineable.com/img/logos/BTC.png", - "chains": [ - { - "name": "Bitcoin", - "network": "BTC", - "token_standard": null, - "regex": "^[13][a-km-zA-HJ-NP-Z1-9]{25,34}$|^(bc1)[0-9A-Za-z]{39,59}$", - "regex_memo": null, - "is_default": true - } - ] + "name": "Bitcoin" }, { "symbol": "BTG", - "network": "BTG", - "token_standard": null, - "name": "Bitcoin Gold", - "regex": "^[AG][a-km-zA-HJ-NP-Z1-9]{25,34}$", - "regex_memo": null, - "top": 0, - "logo": "https://www.unmineable.com/img/logos/BTG.png", - "chains": [ - { - "name": "Bitcoin Gold", - "network": "BTG", - "token_standard": null, - "regex": "^[AG][a-km-zA-HJ-NP-Z1-9]{25,34}$", - "regex_memo": null, - "is_default": true - } - ] + "name": "Bitcoin Gold" }, { "symbol": "BTT", - "network": "TRX", - "token_standard": "TRC10", - "name": "BitTorrent", - "regex": "^T[1-9A-HJ-NP-Za-km-z]{33}$", - "regex_memo": null, - "top": 0, - "logo": "https://www.unmineable.com/img/logos/BTT.png?v1", - "chains": [ - { - "name": "BitTorrent", - "network": "TRX", - "token_standard": "TRC10", - "regex": "^T[1-9A-HJ-NP-Za-km-z]{33}$", - "regex_memo": null, - "is_default": true - } - ] + "name": "BitTorrent" }, { "symbol": "DASH", - "network": "DASH", - "token_standard": null, - "name": "Dash", - "regex": "^[X|7][0-9A-Za-z]{33}$", - "regex_memo": null, - "top": 0, - "logo": "https://www.unmineable.com/img/logos/DASH.png", - "chains": [ - { - "name": "Dash", - "network": "DASH", - "token_standard": null, - "regex": "^[X|7][0-9A-Za-z]{33}$", - "regex_memo": null, - "is_default": true - } - ] + "name": "Dash" }, { "symbol": "DGB", - "network": "DGB", - "token_standard": null, - "name": "DigiByte", - "regex": "^[DS][a-km-zA-HJ-NP-Z1-9]{25,34}$|^(dgb1)[0-9A-Za-z]{39,59}$", - "regex_memo": null, - "top": 0, - "logo": "https://www.unmineable.com/img/logos/DGB.png", - "chains": [ - { - "name": "DigiByte", - "network": "DGB", - "token_standard": null, - "regex": "^[DS][a-km-zA-HJ-NP-Z1-9]{25,34}$|^(dgb1)[0-9A-Za-z]{39,59}$", - "regex_memo": null, - "is_default": true - } - ] + "name": "DigiByte" }, { "symbol": "DOGE", - "network": "DOGE", - "token_standard": null, - "name": "Dogecoin", - "regex": "^(D|A|9)[a-km-zA-HJ-NP-Z1-9]{33,34}$", - "regex_memo": null, - "top": 0, - "logo": "https://www.unmineable.com/img/logos/DOGE.png", - "chains": [ - { - "name": "Dogecoin", - "network": "DOGE", - "token_standard": null, - "regex": "^(D|A|9)[a-km-zA-HJ-NP-Z1-9]{33,34}$", - "regex_memo": null, - "is_default": true - } - ] + "name": "Dogecoin" }, { "symbol": "ENJ", - "network": "ETH", - "token_standard": "ERC20", - "name": "Enjin Coin", - "regex": "^(0x)[0-9A-Fa-f]{40}$", - "regex_memo": null, - "top": 0, - "logo": "https://www.unmineable.com/img/logos/ENJ.png", - "chains": [ - { - "name": "Ethereum", - "network": "ETH", - "token_standard": "ERC20", - "regex": "^(0x)[0-9A-Fa-f]{40}$", - "regex_memo": null, - "is_default": true - } - ] + "name": "Enjin Coin" }, { "symbol": "EOS", - "network": "EOS", - "token_standard": null, - "name": "EOS", - "regex": "^[1-5a-z\\.]{1,12}$", - "regex_memo": "^[0-9A-Za-z\\\\-_,]{1,120}$", - "top": 0, - "logo": "https://www.unmineable.com/img/logos/EOS.png", - "chains": [ - { - "name": "EOS", - "network": "EOS", - "token_standard": null, - "regex": "^[1-5a-z\\.]{1,12}$", - "regex_memo": "^[0-9A-Za-z\\\\-_,]{1,120}$", - "is_default": true - } - ] + "name": "EOS" }, { "symbol": "ETC", - "network": "ETC", - "token_standard": null, - "name": "Ethereum Classic", - "regex": "^(0x)[0-9A-Fa-f]{40}$", - "regex_memo": null, - "top": 0, - "logo": "https://www.unmineable.com/img/logos/ETC.png", - "chains": [ - { - "name": "Ethereum Classic", - "network": "ETC", - "token_standard": null, - "regex": "^(0x)[0-9A-Fa-f]{40}$", - "regex_memo": null, - "is_default": true - } - ] + "name": "Ethereum Classic" }, { "symbol": "ETH", - "network": "ETH", - "token_standard": null, - "name": "Ethereum", - "regex": "^(0x)[0-9A-Fa-f]{40}$", - "regex_memo": null, - "top": 0, - "logo": "https://www.unmineable.com/img/logos/ETH.png", - "chains": [ - { - "name": "Ethereum", - "network": "ETH", - "token_standard": null, - "regex": "^(0x)[0-9A-Fa-f]{40}$", - "regex_memo": null, - "is_default": true - } - ] + "name": "Ethereum" }, { "symbol": "FUN", - "network": "ETH", - "token_standard": "ERC20", - "name": "FunFair", - "regex": "^(0x)[0-9A-Fa-f]{40}$", - "regex_memo": null, - "top": 0, - "logo": "https://www.unmineable.com/img/logos/FUN.png", - "chains": [ - { - "name": "Ethereum", - "network": "ETH", - "token_standard": "ERC20", - "regex": "^(0x)[0-9A-Fa-f]{40}$", - "regex_memo": null, - "is_default": true - } - ] + "name": "FunFair" }, { "symbol": "GAS", - "network": "NEO", - "token_standard": null, - "name": "GAS", - "regex": "^(A)[A-Za-z0-9]{33}$", - "regex_memo": null, - "top": 0, - "logo": "https://www.unmineable.com/img/logos/GAS.png", - "chains": [ - { - "name": "GAS", - "network": "NEO", - "token_standard": null, - "regex": "^(A)[A-Za-z0-9]{33}$", - "regex_memo": null, - "is_default": true - } - ] + "name": "GAS" }, { "symbol": "ICX", - "network": "ICX", - "token_standard": null, - "name": "ICON", - "regex": "^(hx)[A-Za-z0-9]{40}$", - "regex_memo": null, - "top": 0, - "logo": "https://www.unmineable.com/img/logos/ICX.png", - "chains": [ - { - "name": "ICON", - "network": "ICX", - "token_standard": null, - "regex": "^(hx)[A-Za-z0-9]{40}$", - "regex_memo": null, - "is_default": true - } - ] + "name": "ICON" }, { "symbol": "KLV", - "network": "TRX", - "token_standard": "TRC20", - "name": "Klever", - "regex": "^T[1-9A-HJ-NP-Za-km-z]{33}$", - "regex_memo": null, - "top": 0, - "logo": "https://www.unmineable.com/img/logos/KLV.png?20211001", - "chains": [ - { - "name": "Klever", - "network": "TRX", - "token_standard": "TRC20", - "regex": "^T[1-9A-HJ-NP-Za-km-z]{33}$", - "regex_memo": null, - "is_default": true - } - ] + "name": "Klever" }, { "symbol": "KNC", - "network": "ETH", - "token_standard": "ERC20", - "name": "KyberNetwork", - "regex": "^(0x)[0-9A-Fa-f]{40}$", - "regex_memo": null, - "top": 0, - "logo": "https://www.unmineable.com/img/logos/KNC.png", - "chains": [ - { - "name": "Ethereum", - "network": "ETH", - "token_standard": "ERC20", - "regex": "^(0x)[0-9A-Fa-f]{40}$", - "regex_memo": null, - "is_default": true - } - ] + "name": "KyberNetwork" }, { "symbol": "LINK", - "network": "ETH", - "token_standard": "ERC20", - "name": "ChainLink", - "regex": "^(0x)[0-9A-Fa-f]{40}$", - "regex_memo": null, - "top": 0, - "logo": "https://www.unmineable.com/img/logos/LINK.png", - "chains": [ - { - "name": "Ethereum", - "network": "ETH", - "token_standard": "ERC20", - "regex": "^(0x)[0-9A-Fa-f]{40}$", - "regex_memo": null, - "is_default": true - } - ] + "name": "ChainLink" }, { "symbol": "LSK", - "network": "LSK", - "token_standard": null, - "name": "Lisk", - "regex": "^[0-9]{12,22}[L]$", - "regex_memo": null, - "top": 0, - "logo": "https://www.unmineable.com/img/logos/LSK.png", - "chains": [ - { - "name": "Lisk", - "network": "LSK", - "token_standard": null, - "regex": "^[0-9]{12,22}[L]$", - "regex_memo": null, - "is_default": true - } - ] + "name": "Lisk" }, { "symbol": "LTC", - "network": "LTC", - "token_standard": null, - "name": "Litecoin", - "regex": "^(L|M|3)[A-Za-z0-9]{33}$|^(ltc1)[0-9A-Za-z]{39}$", - "regex_memo": null, - "top": 0, - "logo": "https://www.unmineable.com/img/logos/LTC.png", - "chains": [ - { - "name": "Litecoin", - "network": "LTC", - "token_standard": null, - "regex": "^(L|M|3)[A-Za-z0-9]{33}$|^(ltc1)[0-9A-Za-z]{39}$", - "regex_memo": null, - "is_default": true - } - ] + "name": "Litecoin" }, { "symbol": "MANA", - "network": "ETH", - "token_standard": "ERC20", - "name": "Decentraland", - "regex": "^(0x)[0-9A-Fa-f]{40}$", - "regex_memo": null, - "top": 0, - "logo": "https://www.unmineable.com/img/logos/MANA.png", - "chains": [ - { - "name": "Ethereum", - "network": "ETH", - "token_standard": "ERC20", - "regex": "^(0x)[0-9A-Fa-f]{40}$", - "regex_memo": null, - "is_default": true - } - ] + "name": "Decentraland" }, { "symbol": "MTL", - "network": "ETH", - "token_standard": "ERC20", - "name": "Metal", - "regex": "^(0x)[0-9A-Fa-f]{40}$", - "regex_memo": null, - "top": 0, - "logo": "https://www.unmineable.com/img/logos/MTL.png", - "chains": [ - { - "name": "Ethereum", - "network": "ETH", - "token_standard": "ERC20", - "regex": "^(0x)[0-9A-Fa-f]{40}$", - "regex_memo": null, - "is_default": true - } - ] + "name": "Metal" }, { "symbol": "NANO", - "network": "NANO", - "token_standard": null, - "name": "NANO", - "regex": "^(xrb_|nano_)[13456789abcdefghijkmnopqrstuwxyz]{60}", - "regex_memo": null, - "top": 0, - "logo": "https://www.unmineable.com/img/logos/NANO.png", - "chains": [ - { - "name": "NANO", - "network": "NANO", - "token_standard": null, - "regex": "^(xrb_|nano_)[13456789abcdefghijkmnopqrstuwxyz]{60}", - "regex_memo": null, - "is_default": true - } - ] + "name": "NANO" }, { "symbol": "NEO", - "network": "NEO", - "token_standard": null, - "name": "NEO", - "regex": "^(A)[A-Za-z0-9]{33}$", - "regex_memo": null, - "top": 0, - "logo": "https://www.unmineable.com/img/logos/NEO.png", - "chains": [ - { - "name": "NEO", - "network": "NEO", - "token_standard": null, - "regex": "^(A)[A-Za-z0-9]{33}$", - "regex_memo": null, - "is_default": true - } - ] + "name": "NEO" }, { "symbol": "QTUM", - "network": "QTUM", - "token_standard": null, - "name": "Qtum", - "regex": "^[Q|M][A-Za-z0-9]{33}$", - "regex_memo": null, - "top": 0, - "logo": "https://www.unmineable.com/img/logos/QTUM.png", - "chains": [ - { - "name": "Qtum", - "network": "QTUM", - "token_standard": null, - "regex": "^[Q|M][A-Za-z0-9]{33}$", - "regex_memo": null, - "is_default": true - } - ] + "name": "Qtum" }, { "symbol": "REP", - "network": "ETH", - "token_standard": "ERC20", - "name": "Augur", - "regex": "^(0x)[0-9A-Fa-f]{40}$", - "regex_memo": null, - "top": 0, - "logo": "https://www.unmineable.com/img/logos/REP.png", - "chains": [ - { - "name": "Ethereum", - "network": "ETH", - "token_standard": "ERC20", - "regex": "^(0x)[0-9A-Fa-f]{40}$", - "regex_memo": null, - "is_default": true - } - ] + "name": "Augur" }, { "symbol": "RSR", - "network": "ETH", - "token_standard": "ERC20", - "name": "Reserve Rights", - "regex": "^(0x)[0-9A-Fa-f]{40}$", - "regex_memo": null, - "top": 0, - "logo": "https://www.unmineable.com/img/logos/RSR.png", - "chains": [ - { - "name": "Ethereum", - "network": "ETH", - "token_standard": "ERC20", - "regex": "^(0x)[0-9A-Fa-f]{40}$", - "regex_memo": null, - "is_default": true - } - ] + "name": "Reserve Rights" }, { "symbol": "RVN", - "network": "RVN", - "token_standard": null, - "name": "Ravencoin", - "regex": "^[Rr]{1}[A-Za-z0-9]{33,34}$", - "regex_memo": null, - "top": 0, - "logo": "https://www.unmineable.com/img/logos/RVN.png", - "chains": [ - { - "name": "Ravencoin", - "network": "RVN", - "token_standard": null, - "regex": "^[Rr]{1}[A-Za-z0-9]{33,34}$", - "regex_memo": null, - "is_default": true - } - ] + "name": "Ravencoin" }, { "symbol": "SC", - "network": "SC", - "token_standard": null, - "name": "Siacoin", - "regex": "^[A-Za-z0-9]{76}$", - "regex_memo": null, - "top": 0, - "logo": "https://www.unmineable.com/img/logos/SC.png", - "chains": [ - { - "name": "Siacoin", - "network": "SC", - "token_standard": null, - "regex": "^[A-Za-z0-9]{76}$", - "regex_memo": null, - "is_default": true - } - ] + "name": "Siacoin" }, { "symbol": "SKY", - "network": "SKY", - "token_standard": null, - "name": "Skycoin", - "regex": "^[0-9A-Za-z]{26,35}$", - "regex_memo": null, - "top": 0, - "logo": "https://www.unmineable.com/img/logos/SKY.png", - "chains": [ - { - "name": "Skycoin", - "network": "SKY", - "token_standard": null, - "regex": "^[0-9A-Za-z]{26,35}$", - "regex_memo": null, - "is_default": true - } - ] + "name": "Skycoin" }, { "symbol": "SUSHI", - "network": "ETH", - "token_standard": "ERC20", - "name": "Sushi", - "regex": "^(0x)[0-9A-Fa-f]{40}$", - "regex_memo": null, - "top": 0, - "logo": "https://www.unmineable.com/img/logos/SUSHI.png", - "chains": [ - { - "name": "Ethereum", - "network": "ETH", - "token_standard": "ERC20", - "regex": "^(0x)[0-9A-Fa-f]{40}$", - "regex_memo": null, - "is_default": true - } - ] + "name": "Sushi" }, { "symbol": "TRX", - "network": "TRX", - "token_standard": null, - "name": "TRON", - "regex": "^T[1-9A-HJ-NP-Za-km-z]{33}$", - "regex_memo": null, - "top": 0, - "logo": "https://www.unmineable.com/img/logos/TRX.png", - "chains": [ - { - "name": "TRON", - "network": "TRX", - "token_standard": null, - "regex": "^T[1-9A-HJ-NP-Za-km-z]{33}$", - "regex_memo": null, - "is_default": true - } - ] + "name": "TRON" }, { "symbol": "UNI", - "network": "ETH", - "token_standard": "ERC20", - "name": "Uniswap", - "regex": "^(0x)[0-9A-Fa-f]{40}$", - "regex_memo": null, - "top": 0, - "logo": "https://www.unmineable.com/img/logos/UNI.png", - "chains": [ - { - "name": "Ethereum", - "network": "ETH", - "token_standard": "ERC20", - "regex": "^(0x)[0-9A-Fa-f]{40}$", - "regex_memo": null, - "is_default": true - } - ] + "name": "Uniswap" }, { "symbol": "USDT", - "network": "TRX", - "token_standard": "TRC20", - "name": "TetherUS", - "regex": "^T[1-9A-HJ-NP-Za-km-z]{33}$", - "regex_memo": null, - "top": 0, - "logo": "https://www.unmineable.com/img/logos/USDT.png", - "chains": [ - { - "name": "Binance Smart Chain", - "network": "BSC", - "token_standard": "BEP20", - "regex": "^(0x)[0-9A-Fa-f]{40}$", - "regex_memo": null, - "is_default": false - }, - { - "name": "Ethereum", - "network": "ETH", - "token_standard": "ERC20", - "regex": "^(0x)[0-9A-Fa-f]{40}$", - "regex_memo": null, - "is_default": false - }, - { - "name": "TRON", - "network": "TRX", - "token_standard": "TRC20", - "regex": "^T[1-9A-HJ-NP-Za-km-z]{33}$", - "regex_memo": null, - "is_default": true - } - ] + "name": "TetherUS" }, { "symbol": "VET", - "network": "VET", - "token_standard": null, - "name": "VeChain", - "regex": "^(0x)[0-9A-Fa-f]{40}$", - "regex_memo": null, - "top": 0, - "logo": "https://www.unmineable.com/img/logos/VET.png", - "chains": [ - { - "name": "VeChain", - "network": "VET", - "token_standard": null, - "regex": "^(0x)[0-9A-Fa-f]{40}$", - "regex_memo": null, - "is_default": true - } - ] + "name": "VeChain" }, { "symbol": "WAVES", - "network": "WAVES", - "token_standard": null, - "name": "Waves", - "regex": "^(3P)[0-9A-Za-z]{33}$", - "regex_memo": null, - "top": 0, - "logo": "https://www.unmineable.com/img/logos/WAVES.png", - "chains": [ - { - "name": "Waves", - "network": "WAVES", - "token_standard": null, - "regex": "^(3P)[0-9A-Za-z]{33}$", - "regex_memo": null, - "is_default": true - } - ] + "name": "Waves" }, { "symbol": "WBTC", - "network": "ETH", - "token_standard": "ERC20", - "name": "Wrapped Bitcoin", - "regex": "^(0x)[0-9A-Fa-f]{40}$", - "regex_memo": null, - "top": 0, - "logo": "https://www.unmineable.com/img/logos/WBTC.png", - "chains": [ - { - "name": "Ethereum", - "network": "ETH", - "token_standard": "ERC20", - "regex": "^(0x)[0-9A-Fa-f]{40}$", - "regex_memo": null, - "is_default": true - } - ] + "name": "Wrapped Bitcoin" }, { "symbol": "WIN", - "network": "TRX", - "token_standard": "TRC20", - "name": "WINk", - "regex": "^T[1-9A-HJ-NP-Za-km-z]{33}$", - "regex_memo": null, - "top": 0, - "logo": "https://www.unmineable.com/img/logos/WIN.png?20210406", - "chains": [ - { - "name": "WINk", - "network": "TRX", - "token_standard": "TRC20", - "regex": "^T[1-9A-HJ-NP-Za-km-z]{33}$", - "regex_memo": null, - "is_default": true - } - ] + "name": "WINk" }, { "symbol": "XLM", - "network": "XLM", - "token_standard": null, - "name": "Stellar Lumens", - "regex": "^G[A-D]{1}[A-Z2-7]{54}$", - "regex_memo": "^[0-9A-Za-z]{1,28}$", - "top": 0, - "logo": "https://www.unmineable.com/img/logos/XLM.png", - "chains": [ - { - "name": "Stellar Lumens", - "network": "XLM", - "token_standard": null, - "regex": "^G[A-D]{1}[A-Z2-7]{54}$", - "regex_memo": "^[0-9A-Za-z]{1,28}$", - "is_default": true - } - ] + "name": "Stellar Lumens" }, { "symbol": "XMR", - "network": "XMR", - "token_standard": null, - "name": "Monero", - "regex": "^[48][a-zA-Z|\\d]{94}([a-zA-Z|\\d]{11})?$", - "regex_memo": null, - "top": 0, - "logo": "https://www.unmineable.com/img/logos/XMR.png", - "chains": [ - { - "name": "Monero", - "network": "XMR", - "token_standard": null, - "regex": "^[48][a-zA-Z|\\d]{94}([a-zA-Z|\\d]{11})?$", - "regex_memo": null, - "is_default": true - } - ] + "name": "Monero" }, { "symbol": "XRP", - "network": "XRP", - "token_standard": null, - "name": "Ripple", - "regex": "^r[1-9A-HJ-NP-Za-km-z]{25,34}$", - "regex_memo": "^((?!0)[0-9]{1,19})$", - "top": 0, - "logo": "https://www.unmineable.com/img/logos/XRP.png", - "chains": [ - { - "name": "Ripple", - "network": "XRP", - "token_standard": null, - "regex": "^r[1-9A-HJ-NP-Za-km-z]{25,34}$", - "regex_memo": "^((?!0)[0-9]{1,19})$", - "is_default": true - } - ] + "name": "Ripple" }, { "symbol": "XTZ", - "network": "XTZ", - "token_standard": null, - "name": "Tezos", - "regex": "^(tz[1,2,3]|KT1)[a-zA-Z0-9]{33}$", - "regex_memo": null, - "top": 0, - "logo": "https://www.unmineable.com/img/logos/XTZ.png", - "chains": [ - { - "name": "Tezos", - "network": "XTZ", - "token_standard": null, - "regex": "^(tz[1,2,3]|KT1)[a-zA-Z0-9]{33}$", - "regex_memo": null, - "is_default": true - } - ] + "name": "Tezos" }, { "symbol": "XVG", - "network": "XVG", - "token_standard": null, - "name": "Verge", - "regex": "^(D)[A-Za-z0-9]{33}$", - "regex_memo": null, - "top": 0, - "logo": "https://www.unmineable.com/img/logos/XVG.png", - "chains": [ - { - "name": "Verge", - "network": "XVG", - "token_standard": null, - "regex": "^(D)[A-Za-z0-9]{33}$", - "regex_memo": null, - "is_default": true - } - ] + "name": "Verge" }, { "symbol": "YFI", - "network": "ETH", - "token_standard": "ERC20", - "name": "Yearn.finance", - "regex": "^(0x)[0-9A-Fa-f]{40}$", - "regex_memo": null, - "top": 0, - "logo": "https://www.unmineable.com/img/logos/YFI.png", - "chains": [ - { - "name": "Ethereum", - "network": "ETH", - "token_standard": "ERC20", - "regex": "^(0x)[0-9A-Fa-f]{40}$", - "regex_memo": null, - "is_default": true - } - ] + "name": "Yearn.finance" }, { "symbol": "ZEC", - "network": "ZEC", - "token_standard": null, - "name": "Zcash", - "regex": "^(t)[A-Za-z0-9]{34}$", - "regex_memo": null, - "top": 0, - "logo": "https://www.unmineable.com/img/logos/ZEC.png", - "chains": [ - { - "name": "Zcash", - "network": "ZEC", - "token_standard": null, - "regex": "^(t)[A-Za-z0-9]{34}$", - "regex_memo": null, - "is_default": true - } - ] + "name": "Zcash" }, { "symbol": "ZIL", - "network": "ZIL", - "token_standard": null, - "name": "Zilliqa", - "regex": "zil1[qpzry9x8gf2tvdw0s3jn54khce6mua7l]{38}", - "regex_memo": null, - "top": 0, - "logo": "https://www.unmineable.com/img/logos/ZIL.png", - "chains": [ - { - "name": "Zilliqa", - "network": "ZIL", - "token_standard": null, - "regex": "zil1[qpzry9x8gf2tvdw0s3jn54khce6mua7l]{38}", - "regex_memo": null, - "is_default": true - } - ] + "name": "Zilliqa" }, { "symbol": "ZRX", - "network": "ETH", - "token_standard": "ERC20", - "name": "0x", - "regex": "^(0x)[0-9A-Fa-f]{40}$", - "regex_memo": null, - "top": 0, - "logo": "https://www.unmineable.com/img/logos/ZRX.png", - "chains": [ - { - "name": "Ethereum", - "network": "ETH", - "token_standard": "ERC20", - "regex": "^(0x)[0-9A-Fa-f]{40}$", - "regex_memo": null, - "is_default": true - } - ] + "name": "0x" } ] } \ No newline at end of file diff --git a/client/src/store.js b/client/src/store.js index 49aadd1..f49c6c2 100644 --- a/client/src/store.js +++ b/client/src/store.js @@ -1,6 +1,4 @@ -import { writable, get } from '@svelte-use/store' - -export { get } +import { writable } from '@svelte-use/shared' export const form = writable({ symbol: '', diff --git a/package.json b/package.json index ed464bb..dd27e48 100644 --- a/package.json +++ b/package.json @@ -12,8 +12,8 @@ }, "dependencies": { "@shoelace-style/shoelace": "^2.0.0-beta.52", - "@svelte-use/core": "^0.8.1", - "@svelte-use/store": "^0.8.1", + "@svelte-use/core": "^0.9.0", + "@svelte-use/shared": "^0.9.0", "c3": "^0.7.20", "lodash.isequal": "^4.5.0", "svelte-spa-router": "^3.2.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c61e54e..5ce3a1c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -3,8 +3,8 @@ lockfileVersion: 5.3 specifiers: '@2nthony/prettier-config': ^1.0.0 '@shoelace-style/shoelace': ^2.0.0-beta.52 - '@svelte-use/core': ^0.8.1 - '@svelte-use/store': ^0.8.1 + '@svelte-use/core': ^0.9.0 + '@svelte-use/shared': ^0.9.0 '@sveltejs/vite-plugin-svelte': ^1.0.0-next.26 autoprefixer: ^10.3.6 ava: ^3.15.0 @@ -25,8 +25,8 @@ specifiers: dependencies: '@shoelace-style/shoelace': 2.0.0-beta.52 - '@svelte-use/core': 0.8.1 - '@svelte-use/store': 0.8.1 + '@svelte-use/core': 0.9.0 + '@svelte-use/shared': 0.9.0 c3: 0.7.20 lodash.isequal: 4.5.0 svelte-spa-router: 3.2.0 @@ -149,23 +149,14 @@ packages: engines: {node: '>=6'} dev: true - /@svelte-use/core/0.8.1: - resolution: {integrity: sha512-gKe+A1crN6fUjPEeokYUX1u9tIy5VwCxWv4kybuCvwjrCeJauas8+YnHnDG56GtnKMPO1SUtdnZJrg2CxoIABA==} + /@svelte-use/core/0.9.0: + resolution: {integrity: sha512-+ezlGUpj3UDC2TI67sEJm4hpVybFNWbEYkeXLYfHdqw/LXLKaK2Jtu5chKx3kC2u7qOVgyC8DiuT02aNdd+Uww==} dependencies: - '@svelte-use/shared': 0.8.1 - '@svelte-use/store': 0.8.1 + '@svelte-use/shared': 0.9.0 dev: false - /@svelte-use/shared/0.8.1: - resolution: {integrity: sha512-TaPbzA5hTL+BqTM+fc/gjgsp/FJbP+jOM+aXZLQSIAKJlSOg8+a3XZzRBKhAuO6Bem2i+vBw37bsKyKWdl/sQQ==} - dependencies: - '@svelte-use/store': 0.8.1 - dev: false - - /@svelte-use/store/0.8.1: - resolution: {integrity: sha512-C6aaUGXNhdbk53TqvjmlmtydF4tlTi7VWJebNH4fv66e8rLSpbFn4LKOepgEuquq7gA3KZdKAZwaT9qXXQ3Xhw==} - dependencies: - '@svelte-use/shared': 0.8.1 + /@svelte-use/shared/0.9.0: + resolution: {integrity: sha512-dAQ24EYyqssyMBRXcQWSDlz6vvINoaL5jabVj/zH9fPGGrLEifcbHY7ePmZFvqz5YmEtCV0PAloHaFtF2Wn2LQ==} dev: false /@sveltejs/vite-plugin-svelte/1.0.0-next.26_svelte@3.43.1+vite@2.6.2: diff --git a/scripts/updateApiCoins.js b/scripts/updateApiCoins.js index 5e5b97c..f07528e 100644 --- a/scripts/updateApiCoins.js +++ b/scripts/updateApiCoins.js @@ -7,10 +7,20 @@ updateApiCoins() async function updateApiCoins() { return new Promise((resolve) => { https.get(`https://api.unminable.com/v4/coin`, (res) => { - let data = '' + let chunk = '' - res.on('data', (str) => (data += str)) + res.on('data', (str) => (chunk += str)) res.on('end', () => { + const data = JSON.parse(chunk) + data.data = data.data.map((item) => { + // only these is needed + const { symbol, name } = item + return { + symbol, + name, + } + }) + resolve( fs.outputFile( path.join(__dirname, '..', 'client/src/server/unMineableCoins.js'), @@ -29,6 +39,6 @@ function resolveOutputFileString(data) { // Use a js module instead ajax // Updated on: ${new Date().toLocaleString()} -export const apiv4coin = ${JSON.stringify(JSON.parse(data), null, 2)} +export const apiv4coin = ${JSON.stringify(data, null, 2)} `.trim() }