orca-so / whirlpools

Open source concentrated liquidity AMM contract on Solana
https://orca-so.github.io/whirlpools/
Other
278 stars 149 forks source link

(0 , codecs_1.getBytesCodec) is not a function #152

Closed sponge-babe closed 1 month ago

sponge-babe commented 5 months ago

i have installed the latest sdk version along decimal.js and @solana/web3.js packages but the moment i try to initialize the WhirlpoolContext i get a weird runtime error i am using react js with node version 18.17.1

my implementation : `
const { connection } = useConnection(); const anchrWallet = useAnchorWallet();

useEffect(() => { if (connection && anchrWallet) { const ctx = WhirlpoolContext.from( connection, anchrWallet, WHIRLPOOL_PROGRAM_ID ); } }, [anchrWallet, connection]); `

runtime error: (0 , codecs_1.getBytesCodec) is not a function TypeError: (0 , codecs_1.getBytesCodec) is not a function at ./node_modules/@solana/spl-token-group/lib/cjs/state/tokenGroup.js (http://localhost:3000/static/js/bundle.js:138583:102) at options.factory (http://localhost:3000/static/js/bundle.js:176739:31) at __webpack_require__ (http://localhost:3000/static/js/bundle.js:176138:32) at fn (http://localhost:3000/static/js/bundle.js:176397:21) at ./node_modules/@solana/spl-token-group/lib/cjs/state/index.js (http://localhost:3000/static/js/bundle.js:138562:14) at options.factory (http://localhost:3000/static/js/bundle.js:176739:31) at __webpack_require__ (http://localhost:3000/static/js/bundle.js:176138:32) at fn (http://localhost:3000/static/js/bundle.js:176397:21) at ./node_modules/@solana/spl-token-group/lib/cjs/index.js (http://localhost:3000/static/js/bundle.js:138382:14) at options.factory (http://localhost:3000/static/js/bundle.js:176739:31)

sponge-babe commented 5 months ago

After about a constant 9 hours painful struggle of trying different versions, finally i ended up with the correct versions of a lot of packages so this worked for me:

"@orca-so/whirlpools-sdk": "0.12.5", "@coral-xyz/anchor": "0.27.0", "@orca-so/common-sdk": "^0.5.3", "@solana/spl-token": "0.3.8", "@solana/web3.js": "1.88.0", "decimal.js": "10.3.1"

please have some shame and fix this issue, this is embarrassing for you as a top solana dex, such pathetic maintenance of library with no support. stop wasting devs time!

yugure-orca commented 1 month ago

0.13.x resolves some dependency issues.