Skip to content

Commit

Permalink
Merge pull request #333 from nickp96/revert_update_volume
Browse files Browse the repository at this point in the history
update squid volume to previous tracking
  • Loading branch information
vrtnd authored Jan 29, 2025
2 parents 6d896f6 + c7139cd commit f7569a7
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 76 deletions.
70 changes: 33 additions & 37 deletions src/adapters/squid/utils.ts
Original file line number Diff line number Diff line change
@@ -1,60 +1,56 @@
import fetch from "node-fetch";
const retry = require("async-retry");

export const getTokenAddress = (symbol: string, chain: string, assets: any[]) => {
symbol = getSymbol(symbol);
chain = getChain(chain);
let tokenAddress = assets.find((asset) => asset.symbol === symbol)?.addresses?.[chain]?.address;
export const getTokenAddress = (symbol: string, chain: string, assets: any[]) => {
symbol = getSymbol(symbol);
chain = getChain(chain);
let tokenAddress = assets.find((asset) => asset.symbol === symbol)?.addresses?.[chain]?.address;

if (tokenAddress == undefined || symbol === "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE")
tokenAddress = "0x0000000000000000000000000000000000000000";
if (tokenAddress == undefined) tokenAddress = "0x000000000000000000000000000000000000dEaD"

return tokenAddress;
};
return tokenAddress;
}

const getChain = (chain: string) => {
switch (chain) {
case "avax":
return "avalanche";
case "bsc":
return "binance";
case "avax": return "avalanche";
case "bsc": return "binance";
// Add any new chain mappings here if needed
default:
return chain;
default: return chain;
}
};
}

const getSymbol = (rawSymbol: string) => {
let symbol: string = rawSymbol;
if (symbol.startsWith("axl-")) symbol = symbol.slice(4);
if (symbol.startsWith("axl")) symbol = symbol.slice(3);

const nativeTokenMap: { [key: string]: string } = {
AVAX: "WAVAX",
FTM: "WFTM",
BNB: "WBNB",
MATIC: "WMATIC",
FIL: "WFIL",
ETH: "WETH",
wAXL: "AXL",
const nativeTokenMap: {[key: string]: string} = {
"AVAX": "WAVAX",
"FTM": "WFTM",
"BNB": "WBNB",
"MATIC": "WMATIC",
"FIL": "WFIL",
"ETH": "WETH",
"wAXL": "AXL",
// Add any new native token mappings here if needed
};

symbol = nativeTokenMap[symbol] || symbol;

return symbol.charAt(0) === symbol.toUpperCase().charAt(0) ? symbol.toUpperCase() : symbol;
};
}

export const fetchAssets = () => {
return retry(() =>
fetch("https://api.axelarscan.io/", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
method: "getAssets",
}),
}).then((res) => res.json())
);
};
return retry(() =>
fetch("https://api.axelarscan.io/", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
method: "getAssets",
}),
}).then((res) => res.json())
);
}
69 changes: 30 additions & 39 deletions src/data/bridgeNetworkData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -720,45 +720,36 @@ export default [
destinationChain: "Manta",
},

// {
// id: 31,
// displayName: "neuron🧠",
// bridgeDbName: "neuron",
// iconLink: "protocols:neuron",
// largeTxThreshold: 10000,
// url: "",
// chains: ["Arbitrum", "Linea", "Optimism", "Base"],
// },
// {
// id: 32,
// displayName: "Squid (Powered by Axelar)",
// bridgeDbName: "squidrouter",
// iconLink: "icons:squid",
// largeTxThreshold: 10000,
// url: "https://www.squidrouter.com/",
// chains: [
// "Ethereum",
// "Polygon",
// "Avalanche",
// "BSC",
// "Fantom",
// "Arbitrum",
// "Base",
// "Linea",
// "Celo",
// "Moonbeam",
// "Kava",
// "Optimism",
// "Mantle",
// "Scroll",
// "Blast",
// "Fraxtal",
// ],
// chainMapping: {
// avalanche: "avax",
// // Add any other necessary mappings here
// },
// },
{
id: 32,
displayName: "Squid (Powered by Axelar)",
bridgeDbName: "squidrouter",
iconLink: "icons:squid",
largeTxThreshold: 10000,
url: "https://www.squidrouter.com/",
chains: [
"Ethereum",
"Polygon",
"Avalanche",
"BSC",
"Fantom",
"Arbitrum",
"Base",
"Linea",
"Celo",
"Moonbeam",
"Kava",
"Optimism",
"Mantle",
"Scroll",
"Blast",
"Fraxtal",
],
chainMapping: {
avalanche: "avax",
// Add any other necessary mappings here
},
},
{
id: 35,
displayName: "Eywa",
Expand Down

0 comments on commit f7569a7

Please sign in to comment.