Skip to content

Commit

Permalink
add hyperliquid USDC
Browse files Browse the repository at this point in the history
  • Loading branch information
realdealshaman committed Jan 2, 2025
1 parent 91fbd6f commit 37b71f3
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/adapters/peggedAssets/helper/chains.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
"hoo",
"hpb",
"hydra",
"hyperliquid",
"icp",
"icon",
"imx",
Expand Down
16 changes: 16 additions & 0 deletions src/adapters/peggedAssets/helper/getSupply.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,22 @@ export function supplyInEthereumBridge(
};
}

export function supplyInArbitrumBridge(
target: string,
owner: string,
decimals: number,
pegType?: PeggedAssetType
) {
return async function (_api: ChainApi) {
const api = await getApi('arbitrum', _api)
let balances = {} as Balances;
let assetPegType = pegType ? pegType : ("peggedUSD" as PeggedAssetType);
const bridged = await api.call({ abi: 'erc20:balanceOf', target: target, params: owner, })
sumSingleBalance(balances, assetPegType, bridged / 10 ** decimals, owner, true);
return balances;
};
}

export function solanaMintedOrBridged(
targets: string[],
pegType?: PeggedAssetType
Expand Down
3 changes: 3 additions & 0 deletions src/adapters/peggedAssets/usd-coin/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -396,4 +396,7 @@ export const chainContracts: ChainContracts = {
occ: {
bridgedFromETH: ["0x836d275563bAb5E93Fd6Ca62a95dB7065Da94342"],
},
hyperliquid: {
bridgeOnARB: ["0x2Df1c51E09aECF9cacB7bc98cB1742757f163dF7"],
},
};
10 changes: 9 additions & 1 deletion src/adapters/peggedAssets/usd-coin/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import {
cosmosSupply,
kujiraSupply,
osmosisSupply,
getApi
getApi,
supplyInArbitrumBridge
} from "../helper/getSupply";
import {
getTotalSupply as ontologyGetTotalSupply,
Expand Down Expand Up @@ -937,6 +938,13 @@ const adapter: PeggedIssuanceAdapter = {
occ: {
ethereum: bridgedSupply("occ", 6, chainContracts.occ.bridgedFromETH),
},
hyperliquid: {
arbitrum: supplyInArbitrumBridge(
chainContracts.arbitrum.issued[0],
chainContracts.hyperliquid.bridgeOnARB[0],
6
),
},
};

export default adapter;
6 changes: 6 additions & 0 deletions src/utils/normalizeChain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1085,6 +1085,12 @@ export const chainCoingeckoIds = {
categories: ["EVM"],
chainId: 41923,
},
"Hyperliquid": {
geckoId: null,
symbol: null,
cmcId: null,
categories: ["EVM"],
},
} as {
[chain: string]: {
geckoId: string | null;
Expand Down

0 comments on commit 37b71f3

Please sign in to comment.