You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Type 'typeof import("/>path>/open-polkadot-js-library/packages/example/node_modules/@polkadot/api/index")' has no construct signatures.
21 const keyring = new Keyring({ type: 'sr25519' });
**UPDATE** Actually, I'm not sure what I changed, but now I can access it successfully using both `import Keyring from '@polkadot/keyring';` and ``import { Keyring } from '@polkadot/keyring';`
I've created a PR here https://github.com/polkadot-js/common/pull/1970 for that.
But if I import it that way so I can use the `Keyring` constructor, and follow this basic example https://polkadot.js.org/docs/api/examples/promise/listen-to-balance-change of checking the balance of an account by providing their SS58 address string as an argument:
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue if you think you have a related problem or query.
If I create this basic example ltfschoen/open-polkadot-js-library@81a0fe8, where I'm specifically using the latest @polkadot/api version 15.2.1, and @polkadot/keyring version 13.3.1, the README file for the keyring here https://github.com/polkadot-js/common/blob/v13.3.1/packages/keyring/README.md#usage says to import it with
import Keyring from '@polkadot/keyring';
, but if I do that it gives error:So I think that README should be changed to be as shown in https://polkadot.js.org/docs/api/examples/promise/make-transfer, where you import it with `import { Keyring } from '@polkadot/keyring';
let { data: { free: previousFree }, nonce: previousNonce }
= await api.query.system.account('5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY');
src/index.ts:30:9 - error TS2339: Property 'data' does not exist on type 'Codec'.
30 let { data: { free: previousFree }, nonce: previousNonce } = await api.query.system.account('5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY');
~~~~
let res = await api.query.system.account('5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY');
console.log(res.toJSON());
let res = await api.query.system.account(account.address);
console.log(JSON.parse(res.toString()).data);
let { data: { free: previousFree }, nonce: previousNonce }
= await api.query.system.account('5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY');
The text was updated successfully, but these errors were encountered: