-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #62 from DODOEX/feat/add-pool-widget
Feat/add pool widget
- Loading branch information
Showing
223 changed files
with
26,075 additions
and
3,831 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import { SwapWidgetApi } from '@dodoex/api'; | ||
import { AddLiquidityV3, SwapWidgetProps, Widget } from '@dodoex/widgets'; | ||
import React from 'react'; | ||
|
||
export default { | ||
title: 'Widgets/AddLiquidityV3', | ||
component: 'div', | ||
}; | ||
|
||
export const Primary = (props: any) => { | ||
const [config, setConfig] = React.useState<SwapWidgetProps>({}); | ||
const { projectId, apiKey, ...other } = props; | ||
React.useEffect(() => { | ||
if (projectId && apiKey) { | ||
const dodoService = new SwapWidgetApi(); | ||
dodoService | ||
.getConfigSwapWidgetProps(projectId, apiKey) | ||
.then(({ swapWidgetProps }) => { | ||
setConfig(swapWidgetProps); | ||
}); | ||
} | ||
}, [projectId, apiKey]); | ||
|
||
return ( | ||
<Widget {...config} {...other} apikey={apiKey}> | ||
<AddLiquidityV3 | ||
handleGoBack={() => window.alert('handleGoBack')} | ||
handleGoToPoolList={() => window.alert('handleGoToPoolList')} | ||
params={{ | ||
from: '0x8f2a9f23d5d70226491b0c10365de88f64cd4a01', | ||
to: '0xd05553bc85fa8c004073d91097b7611cd5e478f5', | ||
fee: '100', | ||
}} | ||
/> | ||
</Widget> | ||
); | ||
}; | ||
|
||
Primary.args = { | ||
projectId: 'project2', | ||
apiKey: 'ee53d6b75b12aceed4', | ||
width: '100%', | ||
height: '100%', | ||
noDocumentLink: true, | ||
// onlyChainId: 1, | ||
}; |
59 changes: 59 additions & 0 deletions
59
packages/doc/src/stories/widgets/AMMV3PositionManage.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import { SwapWidgetApi } from '@dodoex/api'; | ||
import { AMMV3PositionManage, SwapWidgetProps, Widget } from '@dodoex/widgets'; | ||
import React from 'react'; | ||
|
||
export default { | ||
title: 'Widgets/AMMV3PositionManage', | ||
component: 'div', | ||
}; | ||
|
||
export const Primary = (props: any) => { | ||
const [config, setConfig] = React.useState<SwapWidgetProps>({}); | ||
const { projectId, apiKey, ...other } = props; | ||
React.useEffect(() => { | ||
if (projectId && apiKey) { | ||
const dodoService = new SwapWidgetApi(); | ||
dodoService | ||
.getConfigSwapWidgetProps(projectId, apiKey) | ||
.then(({ swapWidgetProps }) => { | ||
setConfig(swapWidgetProps); | ||
}); | ||
} | ||
}, [projectId, apiKey]); | ||
|
||
return ( | ||
<Widget {...config} {...other} apikey={apiKey}> | ||
<AMMV3PositionManage | ||
chainId={11155111} | ||
baseToken={{ | ||
address: '0x163D876AF3949f45D934870a1783A040Cf717Bc5', | ||
decimals: 18, | ||
symbol: 'uni_test2', | ||
name: 'uni_test2', | ||
chainId: 11155111, | ||
}} | ||
quoteToken={{ | ||
address: '0x444d30Eeb001Dc8B7B96cEF088381418B82f9441', | ||
decimals: 6, | ||
symbol: 'uni_test3', | ||
name: 'uni_test3', | ||
chainId: 11155111, | ||
}} | ||
// feeAmount={500} | ||
// tokenId={'25235'} | ||
feeAmount={500} | ||
tokenId={'4'} | ||
onClose={() => window.alert('onClose')} | ||
/> | ||
</Widget> | ||
); | ||
}; | ||
|
||
Primary.args = { | ||
projectId: 'project2', | ||
apiKey: 'ee53d6b75b12aceed4', | ||
width: '100%', | ||
height: '100%', | ||
noDocumentLink: true, | ||
// onlyChainId: 1, | ||
}; |
59 changes: 59 additions & 0 deletions
59
packages/doc/src/stories/widgets/AMMV3PositionsView.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import { SwapWidgetApi } from '@dodoex/api'; | ||
import { AMMV3PositionsView, SwapWidgetProps, Widget } from '@dodoex/widgets'; | ||
import React from 'react'; | ||
|
||
export default { | ||
title: 'Widgets/AMMV3PositionsView', | ||
component: 'div', | ||
}; | ||
|
||
export const Primary = (props: any) => { | ||
const [config, setConfig] = React.useState<SwapWidgetProps>({}); | ||
const { projectId, apiKey, ...other } = props; | ||
React.useEffect(() => { | ||
if (projectId && apiKey) { | ||
const dodoService = new SwapWidgetApi(); | ||
dodoService | ||
.getConfigSwapWidgetProps(projectId, apiKey) | ||
.then(({ swapWidgetProps }) => { | ||
setConfig(swapWidgetProps); | ||
}); | ||
} | ||
}, [projectId, apiKey]); | ||
|
||
return ( | ||
<Widget {...config} {...other} apikey={apiKey}> | ||
<AMMV3PositionsView | ||
chainId={11155111} | ||
baseToken={{ | ||
address: '0x163D876AF3949f45D934870a1783A040Cf717Bc5', | ||
decimals: 18, | ||
symbol: 'uni_test2', | ||
name: 'uni_test2', | ||
chainId: 11155111, | ||
}} | ||
quoteToken={{ | ||
address: '0x444d30Eeb001Dc8B7B96cEF088381418B82f9441', | ||
decimals: 6, | ||
symbol: 'uni_test3', | ||
name: 'uni_test3', | ||
chainId: 11155111, | ||
}} | ||
feeAmount={500} | ||
onClose={() => window.alert('onClose')} | ||
handleGoToAddLiquidityV3={() => | ||
window.alert('handleGoToAddLiquidityV3') | ||
} | ||
/> | ||
</Widget> | ||
); | ||
}; | ||
|
||
Primary.args = { | ||
projectId: 'project2', | ||
apiKey: 'ee53d6b75b12aceed4', | ||
width: '100%', | ||
height: '100%', | ||
noDocumentLink: true, | ||
// onlyChainId: 1, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,4 +32,8 @@ export enum ChainId { | |
DODO_CHAIN_TESTNET = 53457, | ||
|
||
TAIKO = 167000, | ||
|
||
PLUME = 98865, | ||
|
||
NEOX = 47763, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.