Running the wiki example for swapping on Dex I get the follow error:
C:\PROYECTOS\NODE.JS\Acala\swap.js:29
const pool = await api.derive.dex.pool('DOT');
^
TypeError: Cannot read properties of undefined (reading 'pool')
at main (C:\INTOOLGES\PROYECTOS\NODE.JS\Acala\swap.js:29:39)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
async function main() {
const provider = new WsProvider('wss://karura.api.onfinality.io/public-ws');
const api = new ApiPromise(options({ provider }));
await api.isReady;
Running the wiki example for swapping on Dex I get the follow error:
C:\PROYECTOS\NODE.JS\Acala\swap.js:29 const pool = await api.derive.dex.pool('DOT'); ^
TypeError: Cannot read properties of undefined (reading 'pool') at main (C:\INTOOLGES\PROYECTOS\NODE.JS\Acala\swap.js:29:39) at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Swap on DeX const { ApiPromise } = require('@polkadot/api'); const { WsProvider } = require('@polkadot/rpc-provider'); const { options } = require('@acala-network/api'); const { Fixed18, convertToFixed18, calcSwapTargetAmount } = require('@acala-network/app-util');
const { Keyring } = require('@polkadot/api');
async function main() { const provider = new WsProvider('wss://karura.api.onfinality.io/public-ws'); const api = new ApiPromise(options({ provider })); await api.isReady;
}
main()