Skip to content

Commit 98d8235

Browse files
authored
Merge pull request #26 from clober-dex/feat/support-new-chains
feat: add new addresses
2 parents 9539696 + aaeebdd commit 98d8235

File tree

5 files changed

+35
-3
lines changed

5 files changed

+35
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@clober/v2-sdk",
3-
"version": "0.0.15",
3+
"version": "0.0.16",
44
"description": "🛠 An SDK for building applications on top of Clober V2",
55
"files": [
66
"dist"

src/constants/addresses.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,14 @@ export const CONTRACT_ADDRESSES: {
1414
BookManager: getAddress('0x4a4eaF7382821da4Fb85e8A8d515f5555383d58A'),
1515
BookViewer: getAddress('0xA7603C4c895a533E66c30EA76cC6F6A6A0c5cbFe'),
1616
},
17+
[CHAIN_IDS.BASE]: {
18+
Controller: getAddress('0x4ed2804b5409298290654D665619c7b092297dB2'),
19+
BookManager: getAddress('0x59fAD5b95e755034572702991ABBA937Cc90254a'),
20+
BookViewer: getAddress('0x0e7fc8F067470424589Cc25DceEd0dA9a1a8E72A'),
21+
},
22+
[CHAIN_IDS.BERACHAIN_TESTNET]: {
23+
Controller: getAddress('0x2EF0F04fbA5bCa42cC9569f4f2E3A4D11f182600'),
24+
BookManager: getAddress('0x982c57388101D012846aDC4997E9b073F3bC16BD'),
25+
BookViewer: getAddress('0x16CF06ECB016e449c57b94B8368f2d45D5cf343D'),
26+
},
1727
}

src/constants/chain.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
1-
import { arbitrumSepolia, type Chain, mainnet } from 'viem/chains'
1+
import {
2+
arbitrumSepolia,
3+
base,
4+
berachainTestnet,
5+
type Chain,
6+
} from 'viem/chains'
27

38
export enum CHAIN_IDS {
4-
MAINNET = mainnet.id,
59
ARBITRUM_SEPOLIA = arbitrumSepolia.id,
10+
BASE = base.id,
11+
BERACHAIN_TESTNET = berachainTestnet.id,
612
}
713

814
export const CHAIN_MAP: {
915
[chain in CHAIN_IDS]: Chain
1016
} = {
1117
[CHAIN_IDS.ARBITRUM_SEPOLIA]: arbitrumSepolia,
18+
[CHAIN_IDS.BASE]: base,
19+
[CHAIN_IDS.BERACHAIN_TESTNET]: berachainTestnet,
1220
}

src/constants/currency.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,20 @@ export const WETH_ADDRESSES: {
66
[chain in CHAIN_IDS]: `0x${string}`[]
77
} = {
88
[CHAIN_IDS.ARBITRUM_SEPOLIA]: [zeroAddress],
9+
[CHAIN_IDS.BASE]: ['0x4200000000000000000000000000000000000006'],
10+
[CHAIN_IDS.BERACHAIN_TESTNET]: [
11+
'0x5806E416dA447b267cEA759358cF22Cc41FAE80F', // WBERA
12+
],
913
}
1014

1115
export const STABLE_COIN_ADDRESSES: {
1216
[chain in CHAIN_IDS]: `0x${string}`[]
1317
} = {
1418
[CHAIN_IDS.ARBITRUM_SEPOLIA]: ['0x00BFD44e79FB7f6dd5887A9426c8EF85A0CD23e0'],
19+
[CHAIN_IDS.BASE]: [
20+
'0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913', // USDC
21+
],
22+
[CHAIN_IDS.BERACHAIN_TESTNET]: [
23+
'0x7EeCA4205fF31f947EdBd49195a7A88E6A91161B', // HONEY
24+
],
1525
}

src/constants/subgraph.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ const SUBGRAPH_URL: {
55
} = {
66
[CHAIN_IDS.ARBITRUM_SEPOLIA]:
77
'https://subgraph.satsuma-prod.com/f6a8c4889b7b/clober/v2-core-subgraph/api',
8+
[CHAIN_IDS.BASE]:
9+
'https://subgraph.satsuma-prod.com/f6a8c4889b7b/clober/v2-core-subgraph-base/api',
10+
[CHAIN_IDS.BERACHAIN_TESTNET]:
11+
'https://api.goldsky.com/api/public/project_clsljw95chutg01w45cio46j0/subgraphs/v2-core-subgraph/v1.2.0/gn',
812
}
913

1014
class Subgraph {

0 commit comments

Comments
 (0)