Skip to content

Commit

Permalink
feat: add more assets to Base deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
iherger committed Dec 9, 2024
1 parent 2b769c4 commit 035aa67
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 9 deletions.
60 changes: 56 additions & 4 deletions packages/environment/src/assets/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default defineAssetList(Network.BASE, [
decimals: 18,
id: "0x50c5725949a6f0c72e6c4a641f24049a917db0cb",
name: "Dai Stablecoin",
releases: [],
releases: [sulu],
symbol: "DAI",
type: AssetType.PRIMITIVE,
priceFeed: {
Expand All @@ -45,7 +45,7 @@ export default defineAssetList(Network.BASE, [
decimals: 18,
id: "0x9e1028f5f1d5ede59748ffcee5532509976840e0",
name: "Compound",
releases: [],
releases: [sulu],
symbol: "COMP",
type: AssetType.PRIMITIVE,
priceFeed: {
Expand All @@ -55,10 +55,23 @@ export default defineAssetList(Network.BASE, [
},
},
{
decimals: 18,
decimals: 6,
id: "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
name: "USD Coin",
releases: [sulu],
symbol: "USDC",
type: AssetType.PRIMITIVE,
priceFeed: {
type: PriceFeedType.PRIMITIVE_CHAINLINK,
aggregator: "0x7e860098f58bbfc8648a4311b374b1d669a2bc6b",
rateAsset: RateAsset.USD,
},
},
{
decimals: 6,
id: "0xfde4c96c8593536e31f229ea8f37b2ada2699bb2",
name: "Tether USD",
releases: [],
releases: [sulu],
symbol: "USDT",
type: AssetType.PRIMITIVE,
priceFeed: {
Expand All @@ -67,4 +80,43 @@ export default defineAssetList(Network.BASE, [
rateAsset: RateAsset.USD,
},
},
{
decimals: 8,
id: "0x0555e30da8f98308edb960aa94c0db47230d2b9c",
name: "Wrapped BTC",
releases: [sulu],
symbol: "WBTC",
type: AssetType.PRIMITIVE,
priceFeed: {
type: PriceFeedType.PRIMITIVE_CHAINLINK,
aggregator: "0x64c911996d3c6ac71f9b455b1e8e7266bcbd848f",
rateAsset: RateAsset.USD,
},
},
{
decimals: 18,
id: "0xd4a0e0b9149bcee3c920d2e00b5de09138fd8bb7",
name: "Aave Base WETH",
releases: [sulu],
symbol: "aBasWETH",
type: AssetType.PRIMITIVE,
priceFeed: {
type: PriceFeedType.PRIMITIVE_CHAINLINK,
aggregator: "0x71041dddad3595f9ced3dccfbe3d1f4b0a16bb70",
rateAsset: RateAsset.USD,
},
},
{
decimals: 6,
id: "0x4e65fe4dba92790696d040ac24aa414708f5c0ab",
name: "Aave Base USDC",
releases: [sulu],
symbol: "aBasUSDC",
type: AssetType.PRIMITIVE,
priceFeed: {
type: PriceFeedType.PRIMITIVE_CHAINLINK,
aggregator: "0x7e860098f58bbfc8648a4311b374b1d669a2bc6b",
rateAsset: RateAsset.USD,
},
},
]);
23 changes: 18 additions & 5 deletions packages/environment/test/utils/client.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,28 @@
import { http, createPublicClient } from "viem";
import { arbitrum, mainnet, polygon } from "viem/chains";
import { http, type PublicClient, createPublicClient } from "viem";
import { arbitrum, base, mainnet, polygon } from "viem/chains";
import { Network } from "../../src/networks.js";

export function getClient(network: Network) {
const chain = network === Network.ETHEREUM ? mainnet : network === Network.POLYGON ? polygon : arbitrum;
const chain =
network === Network.ARBITRUM
? arbitrum
: network === Network.BASE
? base
: network === Network.POLYGON
? polygon
: mainnet;
const url = `https://${
network === Network.ETHEREUM ? "eth" : network === Network.POLYGON ? "polygon" : "arb"
network === Network.ARBITRUM
? "arb"
: network === Network.BASE
? "base"
: network === Network.POLYGON
? "polygon"
: "eth"
}-mainnet.g.alchemy.com/v2/${process.env.VITE_ALCHEMY_API_KEY}`;

return createPublicClient({
chain,
transport: http(url, { batch: true }),
});
}) as PublicClient; // TODO: remove typecasting (currently breaks for the Base network client)
}

0 comments on commit 035aa67

Please sign in to comment.