Skip to content

Commit

Permalink
feat: add plume chain
Browse files Browse the repository at this point in the history
  • Loading branch information
junjieit committed Dec 6, 2024
1 parent e22d402 commit 7392938
Show file tree
Hide file tree
Showing 9 changed files with 49 additions and 13 deletions.
6 changes: 3 additions & 3 deletions packages/dodoex-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@
]
},
"peerDependencies": {
"@dodoex/contract-request": "^1.2.0",
"@dodoex/dodo-contract-request": "1.6.0-alpha.4",
"@dodoex/contract-request": "^1.3.0",
"@dodoex/dodo-contract-request": "1.7.0-alpha.2",
"bignumber.js": ">=9",
"lodash": ">=4"
},
Expand Down Expand Up @@ -103,4 +103,4 @@
"ts-jest": "^29.0.1",
"typescript": "^5.6.3"
}
}
}
4 changes: 4 additions & 0 deletions packages/dodoex-api/src/chainConfig/basicToken.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,8 @@ export const basicTokenMap: {
...DEFAULT_BASIC_TOKEN,
wrappedTokenAddress: '0xA51894664A773981C6C112C43ce576f315d5b1B6',
},
[ChainId.PLUME]: {
...DEFAULT_BASIC_TOKEN,
wrappedTokenAddress: '0x562723560131C47417dfcD6BB1A089E4D7C7943C',
},
};
2 changes: 2 additions & 0 deletions packages/dodoex-api/src/chainConfig/chain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,6 @@ export enum ChainId {
DODO_CHAIN_TESTNET = 53457,

TAIKO = 167000,

PLUME = 98865,
}
15 changes: 15 additions & 0 deletions packages/dodoex-api/src/chainConfig/contractConfig.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { plume } from '@dodoex/dodo-contract-request';
import { ChainId } from './chain';

const contractMap: {
Expand Down Expand Up @@ -285,6 +286,20 @@ const contractMap: {
DODO_DPP_PROXY: '0x38886EDE1Fc92886F9a11C37a1f5e75474858eaa',
DODO_MINEV3_PROXY: '0x1dFd36964e21a2eb633991f0B95b4241c20e1db3',
},
[ChainId.PLUME]: {
MULTI_CALL: plume.MulticallWithValid,
DODO_APPROVE: plume.DODOApprove,
ERC20_HELPER: plume.ERC20Helper,

ROUTE_V2_DATA_FETCH: plume.DODOV2RouteHelper,
ROUTE_V1_DATA_FETCH: plume.DODOV1PmmHelper,
CALLEE_HELPER: plume.DODOCalleeHelper,

DODO_PROXY: plume.DODOV2Proxy02,
DODO_DSP_PROXY: plume.DODODspProxy,
DODO_DPP_PROXY: plume.DODODppProxy,
DODO_MINEV3_PROXY: plume.DODOMineV3Proxy,
},
};

export default contractMap;
1 change: 1 addition & 0 deletions packages/dodoex-api/src/chainConfig/platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ export const platformIdMap: {
[ChainId.SEPOLIA]: 'sepolia',
[ChainId.DODO_CHAIN_TESTNET]: 'dodochain-testnet',
[ChainId.TAIKO]: 'taiko',
[ChainId.PLUME]: 'plume',
};
4 changes: 2 additions & 2 deletions packages/dodoex-widgets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@
"@babel/runtime": "^7.17.0",
"@dodoex/api": "3.0.1-taiko.6",
"@dodoex/components": "3.0.1-taiko.4",
"@dodoex/contract-request": "^1.2.0",
"@dodoex/dodo-contract-request": "1.6.0-alpha.4",
"@dodoex/contract-request": "^1.3.0",
"@dodoex/dodo-contract-request": "1.7.0-alpha.2",
"@dodoex/icons": "^2.0.2",
"@emotion/react": "^11.10.0",
"@emotion/styled": "^11.10.0",
Expand Down
9 changes: 9 additions & 0 deletions packages/dodoex-widgets/src/constants/chainList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,15 @@ export const chainListMap: Map<ChainId, ChainListItem> = new Map([
name: 'Taiko',
},
],
[
ChainId.PLUME,
{
chainId: ChainId.PLUME,
// TODO: need replace
logo: TaikoLogo,
name: 'Plume',
},
],
]);

export const isTestNet = (chainId: ChainId) => {
Expand Down
5 changes: 5 additions & 0 deletions packages/dodoex-widgets/src/constants/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export const rpcServerMap: {
[ChainId.SEPOLIA]: ['https://ethereum-sepolia-rpc.publicnode.com'],
[ChainId.DODO_CHAIN_TESTNET]: ['https://dodochain-testnet.alt.technology'],
[ChainId.TAIKO]: ['https://rpc.mainnet.taiko.xyz'],
[ChainId.PLUME]: ['https://rpc.plumenetwork.xyz'],
};
export const getRpcSingleUrlMap = (newRpcServerMap?: {
[chainId: number]: string[];
Expand Down Expand Up @@ -91,6 +92,7 @@ export const scanUrlDomainMap: {
[ChainId.SEPOLIA]: 'sepolia.etherscan.io',
[ChainId.DODO_CHAIN_TESTNET]: 'dodochain-testnet-explorer.alt.technology',
[ChainId.TAIKO]: 'taikoscan.io',
[ChainId.PLUME]: 'phoenix-explorer.plumenetwork.xyz/',
};

export const ThegraphKeyMap: {
Expand All @@ -114,6 +116,7 @@ export const ThegraphKeyMap: {
[ChainId.SEPOLIA]: 'sepolia',
[ChainId.DODO_CHAIN_TESTNET]: 'dodochain-testnet',
[ChainId.TAIKO]: 'taiko',
[ChainId.PLUME]: 'plume',
};

export const blockTimeMap: {
Expand All @@ -137,6 +140,7 @@ export const blockTimeMap: {
[ChainId.SEPOLIA]: 12000,
[ChainId.DODO_CHAIN_TESTNET]: 12000,
[ChainId.TAIKO]: 48000,
[ChainId.PLUME]: 12000,
};

export const dexKeysMap: {
Expand All @@ -160,4 +164,5 @@ export const dexKeysMap: {
[ChainId.SEPOLIA]: [],
[ChainId.DODO_CHAIN_TESTNET]: [],
[ChainId.TAIKO]: [],
[ChainId.PLUME]: [],
};
16 changes: 8 additions & 8 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1865,18 +1865,18 @@
clsx "^1.2.1"
lottie-web "^5.12.2"

"@dodoex/contract-request@^1.2.0":
version "1.2.0"
resolved "https://registry.yarnpkg.com/@dodoex/contract-request/-/contract-request-1.2.0.tgz#5387e2eda0a4ca3b1fdb2c04667819305254509d"
integrity sha512-AWXWWCUw9hlbgRKU3p9Y/13LiYUr60LHjVGM9c5A276wqz1kT1QaCq7U3F7Lqrathq9g4ynvpiY2rp0KV4GQzg==
"@dodoex/contract-request@^1.3.0":
version "1.3.0"
resolved "https://registry.yarnpkg.com/@dodoex/contract-request/-/contract-request-1.3.0.tgz#226272dc0460be4a02f2bdde6483d7ad84ce8afa"
integrity sha512-vqz9baz9wHLuztO7qL8GrtbibW/MgE009MOg1HJ0gbOwa8l2FqjgDDTXJrrDWHfuWWY0moyFpE0H8l4xeLUrRQ==
dependencies:
ethers "^6.13.2"
https-proxy-agent "^7.0.5"

"@dodoex/dodo-contract-request@1.6.0-alpha.4":
version "1.6.0-alpha.4"
resolved "https://registry.yarnpkg.com/@dodoex/dodo-contract-request/-/dodo-contract-request-1.6.0-alpha.4.tgz#604c3755d8c729de0e0dfeeb9ae86dc37eff6149"
integrity sha512-9HfJyleSsEEsGuzeOtdRKjHDFpCWqIuToHuXRFBz2YD7aA7jGtWHQs26ELGlZsz9F8U+2SUc65906YkNR6C77w==
"@dodoex/dodo-contract-request@1.7.0-alpha.2":
version "1.7.0-alpha.2"
resolved "https://registry.yarnpkg.com/@dodoex/dodo-contract-request/-/dodo-contract-request-1.7.0-alpha.2.tgz#45e9883b981d6cfa0fcc02ecbae454ffd43be5a9"
integrity sha512-bnbnK6QT2zAhruuLu7afAeCm1AC6kAHFkCd4YwKQaqH99g9fVrCiEE9vAT5KJQ8iyEpFIO9ZJLza45oCm7b5JQ==
dependencies:
typescript "^5"

Expand Down

0 comments on commit 7392938

Please sign in to comment.