Skip to content

Commit

Permalink
fix: add v4 poolInfo type
Browse files Browse the repository at this point in the history
  • Loading branch information
chef-eric committed Nov 1, 2024
1 parent b35f0b1 commit 3331cdc
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions apps/web/src/state/farmsV4/state/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ type Prettify<T> = {
[K in keyof T]: T[K]
} & object

export type PoolInfo = Prettify<V2PoolInfo | StablePoolInfo | V3PoolInfo | V4BinPoolInfo>
export type PoolInfo = Prettify<V2PoolInfo | StablePoolInfo | V3PoolInfo | V4PoolInfo>

export type BasePoolInfo = {
pid?: number
Expand Down Expand Up @@ -50,8 +50,24 @@ export type StablePoolInfo = BasePoolInfo & {
bCakeWrapperAddress?: Address
}

export type V4BinPoolInfo = BasePoolInfo & {
protocol: Protocol.V4BIN
}
export type V4PoolInfo = V4BinPoolInfo | V4CLPoolInfo

export type V4BinPoolInfo = Prettify<
BasePoolInfo & {
/** @deprecated use poolId instead */
lpAddress: string
poolId: Address
protocol: Protocol.V4BIN
}
>

export type V4CLPoolInfo = Prettify<
BasePoolInfo & {
/** @deprecated use poolId instead */
lpAddress: string
poolId: Address
protocol: Protocol.V4CLAMM
}
>

export type ChainIdAddressKey = `${number}:${Address}`

0 comments on commit 3331cdc

Please sign in to comment.