diff --git a/package.json b/package.json index 8b549d9..60ae7d2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@clober/v2-sdk", - "version": "0.0.43", + "version": "0.0.44", "description": "🛠 An SDK for building applications on top of Clober V2", "files": [ "dist" diff --git a/src/view.ts b/src/view.ts index 1ab0a39..3df733b 100644 --- a/src/view.ts +++ b/src/view.ts @@ -11,6 +11,23 @@ import { type OpenOrder } from './model/open-order' import { decorator } from './utils/decorator' import { fetchChartLogs, fetchLatestChartLog } from './apis/chart-logs' import { getMarketId } from './utils/market' +import { CONTRACT_ADDRESSES } from './constants/addresses' + +/** + * Get contract addresses by chain id + * @param chainId - chain id from {@link CHAIN_IDS} + * @returns Contract addresses + * + * @example + * import { getContractAddresses } from '@clober/v2-sdk' + * + * const addresses = await getContractAddresses({ + * chainId: 421614, + * }) + */ +export const getContractAddresses = ({ chainId }: { chainId: CHAIN_IDS }) => { + return CONTRACT_ADDRESSES[chainId] +} /** * Get market information by chain id and token addresses