Skip to content

Commit b2505f4

Browse files
committed
add unichain support
1 parent 7628731 commit b2505f4

File tree

5 files changed

+37
-5
lines changed

5 files changed

+37
-5
lines changed

src/swapService/strategies/balmySDK/sources/ensoQuoteSource.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ const ENSO_METADATA: QuoteSourceMetadata<EnsoSupport> = {
2929
Chains.AVALANCHE.chainId,
3030
Chains.SONIC.chainId,
3131
80094,
32+
130,
3233
],
3334
swapAndTransfer: false,
3435
buyOrders: false,

src/swapService/strategies/balmySDK/sources/kyberswapQuoteSource.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ const SUPPORTED_CHAINS: Record<ChainId, string> = {
4242
[Chains.MANTLE.chainId]: "mantle",
4343
[Chains.SONIC.chainId]: "sonic",
4444
[Chains.ZK_SYNC_ERA.chainId]: "zksync",
45+
[130]: "unichain",
4546
}
4647

4748
const KYBERSWAP_METADATA: QuoteSourceMetadata<KyberswapSupport> = {
@@ -92,6 +93,7 @@ export class CustomKyberswapQuoteSource extends AlwaysValidConfigAndContextSourc
9293

9394
const url = `https://aggregator-api.kyberswap.com/${chainKey}/api/v1/routes?tokenIn=${sellToken}&tokenOut=${buyToken}&amountIn=${order.sellAmount.toString()}&saveGas=0&gasInclude=true&excludedSources=clipper,hashflow-v3,kyberswap-limit-order,kyberswap-limit-order-v2,mx-trading,native-v1,native-v2`
9495
const routeResponse = await fetchService.fetch(url, { timeout, headers })
96+
9597
if (!routeResponse.ok) {
9698
failed(
9799
KYBERSWAP_METADATA,
@@ -109,7 +111,7 @@ export class CustomKyberswapQuoteSource extends AlwaysValidConfigAndContextSourc
109111
const quote = {
110112
sellAmount: order.sellAmount,
111113
buyAmount: BigInt(routeSummary.amountOut),
112-
estimatedGas: BigInt(routeSummary.gas),
114+
// estimatedGas: BigInt(routeSummary.gas),
113115
allowanceTarget: calculateAllowanceTarget(sellToken, routerAddress),
114116
customData: {
115117
routeSummary,

src/swapService/strategies/balmySDK/sources/lifiQuoteSource.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ const LI_FI_METADATA: QuoteSourceMetadata<LiFiSupport> = {
4848
Chains.BLAST.chainId,
4949
Chains.MANTLE.chainId,
5050
80094, // berachain
51+
130, // unichain
5152
],
5253
swapAndTransfer: true,
5354
buyOrders: true,

src/swapService/strategies/balmySDK/sources/openOceanQuoteSource.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ const SUPPORTED_CHAINS: Record<
7373
[146]: { chainKey: "sonic" },
7474
[80094]: { chainKey: "berachain" },
7575
[1923]: { chainKey: "swell" },
76+
[130]: { chainKey: "unichain" }, // fix gas price
7677
}
7778

7879
const OPEN_OCEAN_METADATA: QuoteSourceMetadata<OpenOceanSupport> = {

tokenLists/tokenList_130.json

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,45 @@
11
[
2+
{
3+
"addressInfo": "0x4200000000000000000000000000000000000006",
4+
"chainId": 130,
5+
"name": "Wrapped Ether",
6+
"symbol": "WETH",
7+
"decimals": 18,
8+
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png",
9+
"meta": {}
10+
},
211
{
312
"addressInfo": "0x078D782b760474a361dDA0AF3839290b0EF57AD6",
413
"chainId": 130,
514
"name": "USDC",
615
"symbol": "USDC",
716
"decimals": 6,
8-
"logoURI": "https://coin-images.coingecko.com/coins/images/6319/large/usdc.png?1696506694",
17+
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/logo.png",
918
"meta": {}
1019
},
1120
{
12-
"addressInfo": "0x4200000000000000000000000000000000000006",
21+
"addressInfo": "0xc02fE7317D4eb8753a02c35fe019786854A92001",
1322
"chainId": 130,
14-
"name": "WETH",
15-
"symbol": "WETH",
23+
"name": "Wrapped stETH",
24+
"symbol": "WSTETH",
25+
"decimals": 18,
26+
"logoURI": "https://tokens.1inch.io/0x7f39c581f595b53c5cb19bd0b3f8da6c935e2ca0.png",
27+
"meta": {}
28+
},
29+
{
30+
"addressInfo": "0x8f187aA05619a017077f5308904739877ce9eA21",
31+
"chainId": 130,
32+
"name": "Unichain",
33+
"symbol": "UNI",
34+
"decimals": 18,
35+
"logoURI": "https://assets.coingecko.com/coins/images/12504/standard/uniswap-logo.png?1720676669",
36+
"meta": {}
37+
},
38+
{
39+
"addressInfo": "0x9151434b16b9763660705744891fA906F660EcC5",
40+
"chainId": 130,
41+
"name": "MOCK",
42+
"symbol": "MOCK",
1643
"decimals": 18,
1744
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png",
1845
"meta": {}

0 commit comments

Comments
 (0)