From ffe965508a0fa5506c78690d2aec4101cadac4f1 Mon Sep 17 00:00:00 2001 From: Hyungsuk Kang Date: Wed, 14 Aug 2024 01:31:00 +0900 Subject: [PATCH] add mode --- src/buildList.js | 25 +++- src/pairs/mode.json | 169 ++++++++++++++++++++++++++++ src/scripts/generateDefaultPairs.js | 30 +++-- src/tokens/mode.json | 48 ++++++++ 4 files changed, 262 insertions(+), 10 deletions(-) create mode 100644 src/pairs/mode.json create mode 100644 src/tokens/mode.json diff --git a/src/buildList.js b/src/buildList.js index 157ba193..8b6d971c 100644 --- a/src/buildList.js +++ b/src/buildList.js @@ -18,11 +18,13 @@ const kroma = require("./tokens/kroma.json"); const morphHolesky = require("./tokens/morph_holesky.json"); const metal = require("./tokens/metal.json"); const fraxtal = require("./tokens/fraxtal.json"); +const mode = require("./tokens/mode.json"); // pairs const basePairs = require("./pairs/base.json"); const kromaPairs = require("./pairs/kroma.json"); const morphHoleskyPairs = require("./pairs/morph_holesky.json"); +const modePairs = require("./pairs/mode.json"); const metalPairs = require("./pairs/metal.json"); const fraxtalPairs = require("./pairs/fraxtal.json"); @@ -57,13 +59,22 @@ module.exports = function buildList() { "https://coin-images.coingecko.com/coins/images/279/large/ethereum.png?1696501628", }, "Morph Holesky": { - name: "Ethereum Token", + name: "Ether", symbol: "ETH", decimals: 18, address: "0x5300000000000000000000000000000000000011", logoURI: "https://raw.githubusercontent.com/morph-l2/morph-list/main/tokenIcons/ETH.svg", }, + Mode: { + chainId: 8453, + name: "Ether", + symbol: "ETH", + decimals: 18, + address: "0x4200000000000000000000000000000000000006", + logoURI: + "https://assets.coingecko.com/coins/images/279/large/ethereum.png?1696501628", + }, Fraxtal: { chainId: 252, address: "0x4200000000000000000000000000000000000006", @@ -187,6 +198,7 @@ module.exports = function buildList() { Base: "https://basescan.org", Kroma: "https://kromascan.com", "Morph Holesky": "https://explorer-holesky.morphl2.io/", + Mode: "https://modescan.io/", Fraxtal: "https://fraxscan.com/", Metal: "https://metalscan.io/", }, @@ -203,6 +215,10 @@ module.exports = function buildList() { address: "0x2D25464C8C044b9Ab122076BE55E353fA1F9bd29", startBlock: 6038844, }, + Mode: { + address: "0xd7ABA1cbAd246249be6a0de9a449FB5EDEFf1E47", + startBlock: 11698902, + }, Fraxtal: { address: "0xd7ABA1cbAd246249be6a0de9a449FB5EDEFf1E47", startBlock: 8354873, @@ -225,6 +241,10 @@ module.exports = function buildList() { address: "0xEA98008F20e06636470b6a3C7ddA9caE63B668EC", startBlock: 5389919, }, + Mode: { + address: "0xEA98008F20e06636470b6a3C7ddA9caE63B668EC", + startBlock: 5389919, + }, Fraxtal: { address: "0xEA98008F20e06636470b6a3C7ddA9caE63B668EC", startBlock: 5389919, @@ -241,10 +261,11 @@ module.exports = function buildList() { ...basePairs, ...kromaPairs, ...morphHoleskyPairs, + ...modePairs, ...fraxtalPairs, ...metalPairs, ], - tokens: [...base, ...kroma, ...morphHolesky, ...fraxtal, ...metal] + tokens: [...base, ...kroma, ...morphHolesky, ...mode, ...fraxtal, ...metal] // sort them by symbol for easy readability .sort((t1, t2) => { if (t1.chainId === t2.chainId) { diff --git a/src/pairs/mode.json b/src/pairs/mode.json new file mode 100644 index 00000000..71096779 --- /dev/null +++ b/src/pairs/mode.json @@ -0,0 +1,169 @@ +[ + { + "base": { + "chainId": 34443, + "address": "0xcDd475325D6F564d27247D1DddBb0DAc6fA0a5CF", + "symbol": "WBTC", + "name": "Wrapped BTC", + "decimals": 8, + "logoURI": "https://ethereum-optimism.github.io/data/WBTC/logo.png" + }, + "quote": { + "chainId": 34443, + "address": "0x4200000000000000000000000000000000000006", + "name": "Ether", + "symbol": "ETH", + "decimals": 18, + "logoURI": "https://ethereum-optimism.github.io/data/ETH/logo.png" + }, + "listing_price": 22.394724 + }, + { + "base": { + "chainId": 34443, + "address": "0xcDd475325D6F564d27247D1DddBb0DAc6fA0a5CF", + "symbol": "WBTC", + "name": "Wrapped BTC", + "decimals": 8, + "logoURI": "https://ethereum-optimism.github.io/data/WBTC/logo.png" + }, + "quote": { + "chainId": 34443, + "address": "0xd988097fb8612cc24eeC14542bC03424c656005f", + "name": "USD Coin", + "symbol": "USDC", + "decimals": 6, + "logoURI": "https://ethereum-optimism.github.io/data/USDC/logo.png" + }, + "listing_price": 59822.28 + }, + { + "base": { + "chainId": 34443, + "address": "0xcDd475325D6F564d27247D1DddBb0DAc6fA0a5CF", + "symbol": "WBTC", + "name": "Wrapped BTC", + "decimals": 8, + "logoURI": "https://ethereum-optimism.github.io/data/WBTC/logo.png" + }, + "quote": { + "chainId": 34443, + "address": "0xf0F161fDA2712DB8b566946122a5af183995e2eD", + "name": "Tether", + "symbol": "USDT", + "decimals": 6, + "logoURI": "https://ethereum-optimism.github.io/data/USDT/logo.png" + }, + "listing_price": 59822.28 + }, + { + "base": { + "chainId": 34443, + "address": "0x80137510979822322193FC997d400D5A6C747bf7", + "symbol": "STONE", + "name": "StakeStone Ether", + "decimals": 18 + }, + "quote": { + "chainId": 34443, + "address": "0x4200000000000000000000000000000000000006", + "name": "Ether", + "symbol": "ETH", + "decimals": 18, + "logoURI": "https://ethereum-optimism.github.io/data/ETH/logo.png" + }, + "listing_price": 1, + "buy_tick": 10, + "sell_tick": 10 + }, + { + "base": { + "chainId": 34443, + "address": "0x80137510979822322193FC997d400D5A6C747bf7", + "symbol": "STONE", + "name": "StakeStone Ether", + "decimals": 18 + }, + "quote": { + "chainId": 34443, + "address": "0xd988097fb8612cc24eeC14542bC03424c656005f", + "name": "USD Coin", + "symbol": "USDC", + "decimals": 6, + "logoURI": "https://ethereum-optimism.github.io/data/USDC/logo.png" + }, + "listing_price": 2735.44 + }, + { + "base": { + "chainId": 34443, + "address": "0x80137510979822322193FC997d400D5A6C747bf7", + "symbol": "STONE", + "name": "StakeStone Ether", + "decimals": 18 + }, + "quote": { + "chainId": 34443, + "address": "0xf0F161fDA2712DB8b566946122a5af183995e2eD", + "name": "Tether", + "symbol": "USDT", + "decimals": 6, + "logoURI": "https://ethereum-optimism.github.io/data/USDT/logo.png" + }, + "listing_price": 2735.44 + }, + { + "base": { + "chainId": 34443, + "address": "0xDfc7C877a950e49D2610114102175A06C2e3167a", + "symbol": "MODE", + "name": "Mode", + "decimals": 18 + }, + "quote": { + "chainId": 34443, + "address": "0x4200000000000000000000000000000000000006", + "name": "Ether", + "symbol": "ETH", + "decimals": 18, + "logoURI": "https://ethereum-optimism.github.io/data/ETH/logo.png" + }, + "listing_price": 0.0000044 + }, + { + "base": { + "chainId": 34443, + "address": "0xDfc7C877a950e49D2610114102175A06C2e3167a", + "symbol": "MODE", + "name": "Mode", + "decimals": 18 + }, + "quote": { + "chainId": 34443, + "address": "0xd988097fb8612cc24eeC14542bC03424c656005f", + "name": "USD Coin", + "symbol": "USDC", + "decimals": 6, + "logoURI": "https://ethereum-optimism.github.io/data/USDC/logo.png" + }, + "listing_price": 0.01177 + }, + { + "base": { + "chainId": 34443, + "address": "0xDfc7C877a950e49D2610114102175A06C2e3167a", + "symbol": "MODE", + "name": "Mode", + "decimals": 18 + }, + "quote": { + "chainId": 34443, + "address": "0xf0F161fDA2712DB8b566946122a5af183995e2eD", + "name": "Tether", + "symbol": "USDT", + "decimals": 6, + "logoURI": "https://ethereum-optimism.github.io/data/USDT/logo.png" + }, + "listing_price": 0.01177 + } + ] \ No newline at end of file diff --git a/src/scripts/generateDefaultPairs.js b/src/scripts/generateDefaultPairs.js index 126ed3af..358950b7 100644 --- a/src/scripts/generateDefaultPairs.js +++ b/src/scripts/generateDefaultPairs.js @@ -1,19 +1,21 @@ // replace path with path to desired network tokenlist -const tokenlist = require("../tokens/fraxtal.json") +const tokenlist = require("../tokens/mode.json") -function addETHUSDTPairs() { +function adddefaultPairs() { + + const stablecoin2 = tokenlist.find((token) => token.symbol === "USDT"); const stablecoin = tokenlist.find((token) => token.symbol === "USDC"); const eth = tokenlist.find((token) => token.symbol === "ETH"); - const remainingTokens = tokenlist.filter((token) => token.address !== stablecoin.address && token.address !== eth.address); + const remainingTokens = tokenlist.filter((token) => token.address !== stablecoin.address && token.address !== eth.address && token.address !== stablecoin2.address); - const ETHUSDTPairs = []; + const defaultPairs = []; for (const token of remainingTokens) { - ETHUSDTPairs.push({ + defaultPairs.push({ "base": { "chainId": token.chainId, "address": token.address, @@ -25,7 +27,7 @@ function addETHUSDTPairs() { "quote": eth, "listing_price": 0. }) - ETHUSDTPairs.push({ + defaultPairs.push({ "base": { "chainId": token.chainId, "address": token.address, @@ -37,9 +39,21 @@ function addETHUSDTPairs() { "quote": stablecoin, "listing_price": 0. }) + defaultPairs.push({ + "base": { + "chainId": token.chainId, + "address": token.address, + "symbol": token.symbol, + "name": token.name, + "decimals": token.decimals, + "logoURI": token.logoURI + }, + "quote": stablecoin2, + "listing_price": 0. + }) } - console.log(JSON.stringify(ETHUSDTPairs, null, 2)); + console.log(JSON.stringify(defaultPairs, null, 2)); } -addETHUSDTPairs() \ No newline at end of file +adddefaultPairs() \ No newline at end of file diff --git a/src/tokens/mode.json b/src/tokens/mode.json new file mode 100644 index 00000000..93ba3657 --- /dev/null +++ b/src/tokens/mode.json @@ -0,0 +1,48 @@ +[ + { + "chainId": 34443, + "address": "0x4200000000000000000000000000000000000006", + "name": "Ether", + "symbol": "ETH", + "decimals": 18, + "logoURI": "https://ethereum-optimism.github.io/data/ETH/logo.png" + }, + { + "chainId": 34443, + "address": "0xd988097fb8612cc24eeC14542bC03424c656005f", + "name": "USD Coin", + "symbol": "USDC", + "decimals": 6, + "logoURI": "https://ethereum-optimism.github.io/data/USDC/logo.png" + }, + { + "chainId": 34443, + "address": "0xf0F161fDA2712DB8b566946122a5af183995e2eD", + "name": "Tether", + "symbol": "USDT", + "decimals": 6, + "logoURI": "https://ethereum-optimism.github.io/data/USDT/logo.png" + }, + { + "chainId": 34443, + "address": "0xcDd475325D6F564d27247D1DddBb0DAc6fA0a5CF", + "name": "Wrapped BTC", + "symbol": "WBTC", + "decimals": 8, + "logoURI": "https://ethereum-optimism.github.io/data/WBTC/logo.png" + }, + { + "chainId": 34443, + "address": "0x80137510979822322193FC997d400D5A6C747bf7", + "name": "StakeStone Ether", + "symbol": "STONE", + "decimals": 18 + }, + { + "chainId": 34443, + "address": "0xDfc7C877a950e49D2610114102175A06C2e3167a", + "name": "Mode", + "symbol": "MODE", + "decimals": 18 + } +] \ No newline at end of file