Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore nonfungible address #4

Merged
merged 2 commits into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@hemilabs/sdk-core",
"license": "MIT",
"version": "4.2.0-beta.3",
"version": "4.2.0-beta.4",
"description": "⚒️ An SDK for building applications on top of Uniswap V3",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
Expand Down
12 changes: 12 additions & 0 deletions src/addresses.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { ChainId, SUPPORTED_CHAINS, SupportedChainsType } from './chains'

type AddressMap = { [chainId: number]: string }

type ChainAddresses = {
v3CoreFactoryAddress: string
multicallAddress: string
Expand Down Expand Up @@ -42,6 +44,16 @@ export const CHAIN_TO_ADDRESSES_MAP: Record<SupportedChainsType, ChainAddresses>
}


export const NONFUNGIBLE_POSITION_MANAGER_ADDRESSES: AddressMap = {
...SUPPORTED_CHAINS.reduce<AddressMap>((memo, chainId) => {
const nonfungiblePositionManagerAddress = CHAIN_TO_ADDRESSES_MAP[chainId].nonfungiblePositionManagerAddress
if (nonfungiblePositionManagerAddress) {
memo[chainId] = nonfungiblePositionManagerAddress
}
return memo
}, {})
}

export const SWAP_ROUTER_02_ADDRESSES = (chainId: number) => {
if (SUPPORTED_CHAINS.includes(chainId)) {
const id = chainId as SupportedChainsType
Expand Down
Loading