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

BatchAll giving error #4801

Closed
nuel77 opened this issue May 8, 2022 · 3 comments
Closed

BatchAll giving error #4801

nuel77 opened this issue May 8, 2022 · 3 comments
Labels
Support Tracks issues or requests related to troubleshooting, answering questions, and user assistance.

Comments

@nuel77
Copy link

nuel77 commented May 8, 2022

trying to batch two extrsinics together but i keep getting this error with both utility.batchAll and utility.batch.

2022-05-09 03:09:42        API/INIT: RPC methods not decorated
Waiting on cryptoWaitReady...
Crypto is ready!
file:///home/examples/mintAsset.js:19
const ext = api.tx.utility.batchAll([ext1,ext2]);
                           ^

TypeError: Cannot read properties of undefined (reading 'batchAll')
    at file:///home/examples/mintAsset.js:19:28
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

here is my code

import { cryptoWaitReady } from '@polkadot/util-crypto';
import { Keyring } from '@polkadot/keyring';
import { api } from './api.js';
import { signAndSendExt } from './signAndSendExt.js';
import { UNIT } from './constants.js';

console.log("Waiting on cryptoWaitReady...");
await cryptoWaitReady();
console.log("Crypto is ready!");


// create a keyring with some non-default values specified
const keyring = new Keyring({ type: 'sr25519', ss58Format: 88 });

const main = keyring.addFromUri('//Alice');
const ext1 = api.tx.assets.create({ asset: 2 }, main.address, 1000 * UNIT)
const ext2 = api.tx.assets.mint({ asset: 2 }, main.address, 1000 * UNIT);
const ext = api.tx.utility.batchAll([ext1,ext2]);
signAndSendExt(api,ext,main);
@jacogr
Copy link
Member

jacogr commented May 9, 2022

The API only decorates what is in the runtime. The above would indicate that your runtime does not have close the utility pallet.

@jacogr jacogr added the Support Tracks issues or requests related to troubleshooting, answering questions, and user assistance. label May 9, 2022
@nuel77 nuel77 closed this as completed May 9, 2022
@nuel77
Copy link
Author

nuel77 commented May 9, 2022

The API only decorates what is in the runtime. The above would indicate that your runtime does not have close the utility pallet.

yea.. this was it .thanks!

@nuel77 nuel77 reopened this May 9, 2022
@nuel77 nuel77 closed this as completed May 9, 2022
@polkadot-js-bot
Copy link

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.

@polkadot-js polkadot-js locked as resolved and limited conversation to collaborators May 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Support Tracks issues or requests related to troubleshooting, answering questions, and user assistance.
Projects
None yet
Development

No branches or pull requests

3 participants