Skip to content

Commit

Permalink
Merge pull request #50 from curvefi/feat/add-sonic-network
Browse files Browse the repository at this point in the history
feat: add sonic network
  • Loading branch information
OnlyJousting authored Mar 2, 2025
2 parents 605c981 + a393df6 commit 76954ce
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 2 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@curvefi/lending-api",
"version": "2.4.5",
"version": "2.5.0",
"description": "JavaScript library for Curve Lending",
"main": "lib/index.js",
"author": "Macket",
Expand Down Expand Up @@ -35,7 +35,7 @@
"dependencies": {
"axios": "^0.21.1",
"bignumber.js": "^9.0.1",
"@curvefi/ethcall": "6.0.7",
"@curvefi/ethcall": "6.0.13",
"ethers": "^6.10.0",
"memoizee": "^0.4.15"
}
Expand Down
7 changes: 7 additions & 0 deletions src/constants/aliases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,10 @@ export const ALIASES_FRAXTAL = lowerCaseValues({
"leverage_zap": "0x37c5ab57AF7100Bdc9B668d766e193CCbF6614FD", // odos
"leverage_markets_start_id": "0",
});

export const ALIASES_SONIC = lowerCaseValues({
"crv": "0x5Af79133999f7908953E94b7A5CF367740Ebee35",
"one_way_factory": "0x30d1859dad5a52ae03b6e259d1b48c4b12933993",
"gauge_controller": "0x2F50D538606Fa9EDD2B11E2446BEb18C9D5846bB",
"gauge_factory": "0xf3A431008396df8A8b2DF492C913706BDB0874ef",
});
2 changes: 2 additions & 0 deletions src/constants/coins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,5 @@ export const COINS_BASE = lowerCaseValues({});
export const COINS_BSC = lowerCaseValues({});

export const COINS_FRAXTAL = lowerCaseValues({});

export const COINS_SONIC = lowerCaseValues({});
7 changes: 7 additions & 0 deletions src/lending.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import {
ALIASES_BASE,
ALIASES_BSC,
ALIASES_FRAXTAL,
ALIASES_SONIC,
} from "./constants/aliases.js";
import {
COINS_ETHEREUM,
Expand All @@ -60,6 +61,7 @@ import {
COINS_BASE,
COINS_BSC,
COINS_FRAXTAL,
COINS_SONIC,
} from "./constants/coins.js";
import { L2Networks } from "./constants/L2Networks.js";
import { createCall, handleMultiCallResponse} from "./utils.js";
Expand Down Expand Up @@ -93,6 +95,11 @@ export const NETWORK_CONSTANTS: { [index: number]: any } = {
ALIASES: ALIASES_POLYGON,
COINS: COINS_POLYGON,
},
146: {
NAME: 'sonic',
ALIASES: ALIASES_SONIC,
COINS: COINS_SONIC,
},
250: {
NAME: 'fantom',
ALIASES: ALIASES_FANTOM,
Expand Down
2 changes: 2 additions & 0 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ export const _getUsdRate = async (assetId: string): Promise<number> => {
56: "binance-smart-chain",
100: 'xdai',
137: 'polygon-pos',
156: 'sonic',
196: 'x-layer',
250: 'fantom',
252: 'fraxtal',
Expand All @@ -315,6 +316,7 @@ export const _getUsdRate = async (assetId: string): Promise<number> => {
56: 'binancecoin',
100: 'xdai',
137: 'matic-network',
156: 'sonic-3',
196: 'okb',
250: 'fantom',
252: 'frax-ether',
Expand Down

0 comments on commit 76954ce

Please sign in to comment.