Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initializing Swap sdk Promise is throwing error #309

Open
ahsanahmed321 opened this issue Apr 19, 2022 · 2 comments
Open

initializing Swap sdk Promise is throwing error #309

ahsanahmed321 opened this issue Apr 19, 2022 · 2 comments

Comments

@ahsanahmed321
Copy link

import { SwapPromise } from '@acala-network/sdk-swap';
const swapPromise = new SwapPromise(api);

Uncaught (in promise) TypeError: (0 , _util.memoize) is not a function
at new SwapPromise (swap-promise.js:21:1)

@qwer951123
Copy link
Contributor

may try the latest version 4.1.2-5. It seems some error in your development environment.

The code below works good for me, my node version is v16.13.1

import { SwapPromise } from '@acala-network/sdk-swap';
import { ApiPromise, WsProvider } from "@polkadot/api";
import { options } from "@acala-network/api";

export const getPolkadotApiProvider = async () => {
  const provider = new WsProvider('wss://karura-rpc-0.aca-api.network');
  const api = new ApiPromise(
    options({ provider })
  );
  await api.isReady;
  return api;
};


(async () => {
	const api = await getPolkadotApiProvider();
	const swapPromise = new SwapPromise(api);
        console.log(swapPromise)
})()

@ahsanahmed321
Copy link
Author

I did try with version 4.1.2-5 and my node version is 16 as well but still the same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants