@koyofinance/swap-sdk
Version:
145 lines (140 loc) • 3.9 kB
JavaScript
var __defProp = Object.defineProperty;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
var __publicField = (obj, key, value) => {
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
return value;
};
// src/constants/referenceAssets.ts
var REFERENCE_ASSETS;
(function(REFERENCE_ASSETS2) {
REFERENCE_ASSETS2["USD"] = "usd";
REFERENCE_ASSETS2["ETH"] = "eth";
})(REFERENCE_ASSETS || (REFERENCE_ASSETS = {}));
var FIAT_ASSET_TYPES = [
REFERENCE_ASSETS.USD
];
// src/constants/coins/coins.ts
import { ChainId } from "@koyofinance/core-sdk";
var coins = [
{
id: "boba:dai",
coingeckoId: "dai",
chainId: ChainId.BOBA,
type: REFERENCE_ASSETS.USD,
name: "Dai Stablecoin",
symbol: "dai",
decimals: 18,
address: "0xf74195Bb8a5cf652411867c5C2C5b8C2a402be35"
},
{
id: "boba:frax",
coingeckoId: "Frax",
chainId: ChainId.BOBA,
type: REFERENCE_ASSETS.USD,
name: "Frax",
symbol: "Frax",
decimals: 18,
address: "0x7562F525106F5d54E891e005867Bf489B5988CD9"
},
{
id: "boba:usdc",
coingeckoId: "usd-coin",
chainId: ChainId.BOBA,
type: REFERENCE_ASSETS.USD,
name: "USD Coin",
symbol: "usdc",
decimals: 6,
address: "0x66a2A913e447d6b4BF33EFbec43aAeF87890FBbc"
},
{
id: "boba:usdt",
coingeckoId: "tether",
chainId: ChainId.BOBA,
type: REFERENCE_ASSETS.USD,
name: "Tether",
symbol: "usdt",
decimals: 6,
address: "0x5DE1677344D3Cb0D7D465c10b72A8f60699C062d"
}
];
// src/constants/coins/index.ts
var Coin = class {
constructor(coin) {
__publicField(this, "decimals", 18);
this.id = coin.id;
this.name = coin.name;
this.symbol = coin.symbol;
this.decimals = coin.decimals;
this.coingeckoId = coin.coingeckoId;
this.chainId = coin.chainId;
this.type = coin.type;
this.address = coin.address;
this.rawCoin = coin;
}
isFiat() {
return FIAT_ASSET_TYPES.includes(this.type);
}
toJSON() {
return this.rawCoin;
}
};
__name(Coin, "Coin");
var augmentedCoins = Object.fromEntries(coins.map((coin) => [
coin.id,
new Coin(coin)
]));
// src/constants/pools/pools.ts
import { ChainId as ChainId2 } from "@koyofinance/core-sdk";
var pools = [
{
id: "4pool",
name: "4pool",
chainId: ChainId2.BOBA,
lpTokenInfo: {
name: "Koyo.finance FRAX/DAI/USDC/USDT",
symbol: "4Koyo"
},
assets: "FRAX+DAI+USDC+USDT",
coins: [
augmentedCoins["boba:frax"],
augmentedCoins["boba:dai"],
augmentedCoins["boba:usdc"],
augmentedCoins["boba:usdt"]
],
addresses: {
swap: "0x9f0a572be1fcfe96e94c0a730c5f4bc2993fe3f6",
lpToken: "0xdab3fc342a242add09504bea790f9b026aa1e709"
}
}
];
// src/constants/pools/index.ts
var augmentedPools = pools;
var poolIds = augmentedPools.map(({ id }) => id);
function getPoolById(id) {
return augmentedPools.find((pool) => id === pool.id);
}
__name(getPoolById, "getPoolById");
function findPoolForCoinsIds(coinIdA, coinIdB) {
return augmentedPools.find(({ coins: coins2 }) => coins2.some(({ id }) => id === coinIdA) && coins2.some(({ id }) => id === coinIdB));
}
__name(findPoolForCoinsIds, "findPoolForCoinsIds");
function findPoolForSwapAddress(swapAddress) {
const lcSwapAddress = swapAddress.toLowerCase();
return augmentedPools.find(({ addresses }) => addresses.swap.toLowerCase() === lcSwapAddress);
}
__name(findPoolForSwapAddress, "findPoolForSwapAddress");
export {
Coin,
FIAT_ASSET_TYPES,
REFERENCE_ASSETS,
augmentedCoins,
augmentedPools,
coins,
findPoolForCoinsIds,
findPoolForSwapAddress,
getPoolById,
poolIds,
pools
};
//# sourceMappingURL=index.mjs.map