pancake-swap-interface-v1
pancake-swap-interface-v1 copied to clipboard
V2 Interface
Are you planning to create/sharee new v2 interface repository or you will use this one?
They are using Pancake-FrontEnd I think
They are using Pancake-FrontEnd I think
Looks like Pancake-FrontEnd didnt include swap part
At this moment the v2 isn't available, any plan to release this?
If anyone will find solution, please mention here.
What is the major difference between both?
If I remove the v1 and start focus on pancakev2 LP it won't work?
still waiting :)
With the V3 update, what happens to the tokens using V2 router such as moonshot? https://github.com/moonshot-platform/moonshot-ERC20/blob/main/contracts/Moonshot.sol
isn't exactly all the same as v1, but it is just replace pancakeswap-libs/sdk with pancakeswap-libs/sdk-v2 ?
Anyone found a solution to this ? And no, "pancakeswap-libs/sdk-v2" this doesnt work either.
isn't exactly all the same as v1, but it is just replace pancakeswap-libs/sdk with pancakeswap-libs/sdk-v2 ?
Any solution? Also having the same problem. Not sure why they don't release V2 interface like Uniswap.
Worked it out myself, enjoy folks
Installing V2 Pancakeswap Exchange Interface
-
Clone PancakeSwap v1 interface
git clone https://github.com/pancakeswap/pancake-swap-interface-v1.git . -
Run Yarn in console from root
yarn -
Update ROUTER_ADDRESS to v2 in /src/constants/index.ts line 3
0x10ED43C718714eb63d5aA57B78B54704E256024E -
Install v2 SDK
npm i @overage69/pancake-sdk-v2 -
Install missing dependencies
npm i @reach/portal
npm i @uniswap/v2-core
npm i ajv
npm i cids
npm i ethers
npm i multicodec
npm i multihashes
npm i @types/node
- Run yarn start and it should boot up using v2
yarn start
Optional extras - remove the component for the popup as this isn't needed.
hi @Corbyj1
Thank you for your reply.
Now I have a typescript error on src/state/index.ts after adding @overage69/pancake-sdk-v2 library.
Type '(Middleware | Middleware<{}, any, Dispatch<AnyAction>>)[]' is not assignable to type '[any] | ((getDefaultMiddleware: CurriedGetDefaultMiddleware<{ application: ApplicationState; user: UserState; transactions: TransactionState; swap: SwapState; mint: MintState; burn: BurnState; multicall: MulticallState; lists: ListsState; toasts: ToastsState; }>) => [...]) | undefined'.
Type '(Middleware | Middleware<{}, any, Dispatch<AnyAction>>)[]' is not assignable to type '[any]'.
Target requires 1 element(s) but source may have fewer. TS2322
40 | toasts
41 | },
> 42 | middleware: [...getDefaultMiddleware({ thunk: false }), save({ states: PERSISTED_KEYS })],
| ^
43 | preloadedState: loadedState,
44 | })
45 |
You didn't have that kind of issue?
hi @Corbyj1 You didn't have that kind of issue?
Sorry no didn't have that issue at all - did you try clean clone without modifying anything beforehand?
Did you make sure to run yarn as well before doing the above steps?
I'm running NPM 6.14.12 for reference
@Corbyj1 Amazing!!! It's working!!!! Thank you so much!!!!
hi @Corbyj1 Thank you for your reply. Now I have a typescript error on
src/state/index.tsafter adding@overage69/pancake-sdk-v2library.Type '(Middleware | Middleware<{}, any, Dispatch<AnyAction>>)[]' is not assignable to type '[any] | ((getDefaultMiddleware: CurriedGetDefaultMiddleware<{ application: ApplicationState; user: UserState; transactions: TransactionState; swap: SwapState; mint: MintState; burn: BurnState; multicall: MulticallState; lists: ListsState; toasts: ToastsState; }>) => [...]) | undefined'. Type '(Middleware | Middleware<{}, any, Dispatch<AnyAction>>)[]' is not assignable to type '[any]'. Target requires 1 element(s) but source may have fewer. TS2322 40 | toasts 41 | }, > 42 | middleware: [...getDefaultMiddleware({ thunk: false }), save({ states: PERSISTED_KEYS })], | ^ 43 | preloadedState: loadedState, 44 | }) 45 |You didn't have that kind of issue?
How did you solve this issue ?
@sachinkrishna
Just defined type for middleware.
So it could be
middleware: [...getDefaultMiddleware({ thunk: false }), save({ states: PERSISTED_KEYS })] as Middleware[]
Where did you import the name "Middleware" from ? Im a bit lost here.
From @reduxjs/toolkit library.
From
@reduxjs/toolkitlibrary.
Thank you. But I have already tried that and it is throwing an error
/pancake-swap-interface-v1/src/state/multicall/hooks.ts TypeScript error in /pancake-swap-interface-v1/src/state/multicall/hooks.ts(188,56): Argument of type 'import("/pancake-swap-interface-v1/node_modules/@ethersproject/contracts/node_modules/@ethersproject/abi/lib/interface").Interface | undefined' is not assignable to parameter of type 'import("/pancake-swap-interface-v1/node_modules/@ethersproject/abi/lib/interface").Interface | undefined'. Type 'import("/pancake-swap-interface-v1/node_modules/@ethersproject/contracts/node_modules/@ethersproject/abi/lib/interface").Interface' is not assignable to type 'import("/pancake-swap-interface-v1/node_modules/@ethersproject/abi/lib/interface").Interface'. Types of property 'fragments' are incompatible. The type 'readonly Fragment[]' is 'readonly' and cannot be assigned to the mutable type 'Fragment[]'. TS2345
186 |
187 | return useMemo(() => {
188 | return results.map((result) => toCallState(result, contract?.interface, fragment, latestBlockNumber)) | ^ 189 | }, [fragment, contract, results, latestBlockNumber]) 190 | } 191 |
Hmm... Weird...
That error is really new to me.
Can you try to remove node_modules and install again?
I have tried that. Didint work. I have added the above dependencies with yarn. But i dont think that, that would be the issue. Do you ?
You mean these dependencies?
npm i @reach/portal
npm i @uniswap/v2-core
npm i ajv
npm i cids
npm i ethers
npm i multicodec
npm i multihashes
npm i @types/node
I didn't add the above dependencies since pancake-swap-interface-v1 repo already has those dependencies.
I just added @overage69/pancake-sdk-v2
You mean these dependencies?
npm i @reach/portal npm i @uniswap/v2-core npm i ajv npm i cids npm i ethers npm i multicodec npm i multihashes npm i @types/nodeI didn't add the above dependencies since
pancake-swap-interface-v1repo already has those dependencies. I just added@overage69/pancake-sdk-v2
That was the issue. Thanks a lot man. Its working.
@atropos0902 Anyway, adding liquidity is working ? No right ?
@sachinkrishna I planned to work only on Swap future for now.
Hopefully would work on Liquidity in the earliest future.
Thanks!
has anyone figured out how to get liquidity pools working on a fork with v2? I keep running into "You can't add liquidity in v1" but I'm using the v2 router address on the test net: 0xD99D1c33F9fC3444f8101754aBC46c52416550D1
I followed steps here to add liquidity but no luck: https://forum.openzeppelin.com/t/cant-add-liquidity-on-pancakeswap-with-burnable-erc20-token/6993/10
Worked it out myself, enjoy folks
Installing V2 Pancakeswap Exchange Interface
- Clone PancakeSwap v1 interface
git clone https://github.com/pancakeswap/pancake-swap-interface-v1.git .- Run Yarn in console from root
yarn- Update ROUTER_ADDRESS to v2 in /src/constants/index.ts line 3
0x10ED43C718714eb63d5aA57B78B54704E256024E- Install v2 SDK
npm i @overage69/pancake-sdk-v2- Install missing dependencies
npm i @reach/portal npm i @uniswap/v2-core npm i ajv npm i cids npm i ethers npm i multicodec npm i multihashes npm i @types/node
- Run yarn start and it should boot up using v2
yarn startOptional extras - remove the component for the popup as this isn't needed.
I did as you said, clone the official repository, change the wallet address, install the dependencies and the sdk-v2.
the application starts up correctly, but if I look for a v2 contract I can't find it, nothing seems to change, it seems to be still using v1.
if I install the dependencies you have listed I get a lot of errors, I also use node 6.14.12.
any suggestions?
EDIT
i searched and replaced throughout the project
@pancakeswap-libs/sdk
with
@overage69/pancake-sdk-v2
seems to be working now
EDIT 2 yarn build working on localhost, not working on pages.cloudflare
<!--StartFragment-->
18:57:44.108 | Type '(Middleware \| Middleware<{}, any, Dispatch<AnyAction>>)[]' is not assignable to type '[any] \| ((getDefaultMiddleware: CurriedGetDefaultMiddleware<{ application: ApplicationState; user: UserState; transactions: TransactionState; swap: SwapState; mint: MintState; burn: BurnState; multicall: MulticallState; lists: ListsState; toasts: ToastsState; }>) => [...]) \| undefined'.
-- | --
18:57:44.108 | Type '(Middleware \| Middleware<{}, any, Dispatch<AnyAction>>)[]' is not assignable to type '[any]'.
18:57:44.108 | Target requires 1 element(s) but source may have fewer. TS2322
18:57:44.109 |
18:57:44.109 | 40 \| toasts
18:57:44.109 | 41 \| },
18:57:44.109 | > 42 \| middleware: [...getDefaultMiddleware({ thunk: false }), save({ states: PERSISTED_KEYS })],
18:57:44.109 | \| ^
18:57:44.109 | 43 \| preloadedState: loadedState,
18:57:44.109 | 44 \| })
18:57:44.109 | 45 \|
18:57:44.109 |
18:57:44.110 |
18:57:44.171 | error Command failed with exit code 1.
18:57:44.172 | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
18:57:44.175 | Failed: build command exited with code: 1
<!--EndFragment-->
any tips?
Hello, dears! I did as follows.
Worked it out myself, enjoy folks
Installing V2 Pancakeswap Exchange Interface
Clone PancakeSwap v1 interface git clone https://github.com/pancakeswap/pancake-swap-interface-v1.git . Run Yarn in console from root yarn Update ROUTER_ADDRESS to v2 in /src/constants/index.ts line 3 0x10ED43C718714eb63d5aA57B78B54704E256024E Install v2 SDK npm i @overage69/pancake-sdk-v2 Install missing dependencies npm i @reach/portal npm i @uniswap/v2-core npm i ajv npm i cids npm i ethers npm i multicodec npm i multihashes npm i @types/node Run yarn start and it should boot up using v2 yarn start Optional extras - remove the component for the popup as this isn't needed.
But I got such this error.
Please help me~~~~~~~~~~~

Please it's necessary
This code is working for middleware
middleware: () => [...getDefaultMiddleware({ thunk: false }), save({ states: PERSISTED_KEYS })],