Skip to content

Commit

Permalink
feat: Add eth reactor and quoter (#10701)
Browse files Browse the repository at this point in the history
<!--
Before opening a pull request, please read the [contributing
guidelines](https://github.com/pancakeswap/pancake-frontend/blob/develop/CONTRIBUTING.md)
first
-->


<!-- start pr-codex -->

---

## PR-Codex overview
This PR updates the `pcsx-sdk` package by adding support for Ethereum
chain and integrating an ETH reactor.

### Detailed summary
- Added support for Ethereum chain in `SupportedChainId` constant
- Integrated ETH reactor addresses in various mappings for Ethereum
chain

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your
question}`

<!-- end pr-codex -->
  • Loading branch information
chefrabbid authored Sep 19, 2024
1 parent 7b0050b commit c227943
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/weak-years-nail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@pancakeswap/pcsx-sdk': major
---

add eth reactor
15 changes: 13 additions & 2 deletions packages/pcsx-sdk/src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
import { ChainId } from '@pancakeswap/chains'
import type { Address } from 'viem'
import { getPermit2Address } from '@pancakeswap/permit2-sdk'
import type { Address } from 'viem'

export const SupportedChainId = [ChainId.BSC, ChainId.BSC_TESTNET, ChainId.SEPOLIA, ChainId.ARBITRUM_ONE] as const
export const SupportedChainId = [
ChainId.BSC,
ChainId.BSC_TESTNET,
ChainId.SEPOLIA,
ChainId.ARBITRUM_ONE,
ChainId.ETHEREUM,
] as const

export type XSupportedChainId = (typeof SupportedChainId)[number]

Expand All @@ -11,13 +17,15 @@ export const PERMIT2_MAPPING = {
[ChainId.BSC_TESTNET]: getPermit2Address(ChainId.BSC_TESTNET),
[ChainId.SEPOLIA]: getPermit2Address(ChainId.SEPOLIA),
[ChainId.ARBITRUM_ONE]: getPermit2Address(ChainId.ARBITRUM_ONE),
[ChainId.ETHEREUM]: getPermit2Address(ChainId.ETHEREUM),
} as const satisfies Record<XSupportedChainId, Address | undefined>

export const ORDER_QUOTER_MAPPING = {
[ChainId.BSC]: '0x369B57fE0Fab4d5a110e4F02b871979DE0300C18',
[ChainId.BSC_TESTNET]: '0x6f73C295E70Cd87307dD73c4730c685Bb977bB70',
[ChainId.SEPOLIA]: '0x180415ddfBeD6bf9a6C0fcE0EB23DE60B0157f58',
[ChainId.ARBITRUM_ONE]: '0xF812A85c70b05Df76ff3bC802c0244307033Ccd0',
[ChainId.ETHEREUM]: '0xF812A85c70b05Df76ff3bC802c0244307033Ccd0',
} as const satisfies Record<XSupportedChainId, Address>

export enum OrderType {
Expand All @@ -43,4 +51,7 @@ export const REACTOR_ADDRESS_MAPPING = {
[ChainId.ARBITRUM_ONE]: {
[OrderType.ExclusiveDutchOrder]: '0x35db01D1425685789dCc9228d47C7A5C049388d8',
},
[ChainId.ETHEREUM]: {
[OrderType.ExclusiveDutchOrder]: '0x35db01D1425685789dCc9228d47C7A5C049388d8',
},
} as const satisfies ReactorMapping

0 comments on commit c227943

Please sign in to comment.