I would like to swap using project-serum/serum-ts.
I prepared the following while reading readme.MD
.
- Use the latest version of Yarn etc.
- Install the dependent modules according to
readme.MD
- Prepare the
id.json
file containing the wallet secret in./config/solana/id.json
- Put 0.01 SOL in the wallet on mainnet-beta.
After that, I tried to run node ./package/swap/example/swap.js
, which is prepared for the sample.
This file -> https://github.com/project-serum/serum-ts/blob/master/packages/swap/examples/swap.js
I confirmed that it worked until line 26 _srmSwapPairs
.
However, at line 29, I get the following error
Error: Unable to simulate swap
at Swap.estimate (/mnt/c/Users/username/Desktop/solana_test/serum-ts/packages/swap/lib/index.js:401:19)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async main (/mnt/c/Users/username/Desktop/solana_test/serum-ts/packages/swap/examples/swap.js:29:25)
My OS is Windows 10, but I am using WSL.
What could be the cause?