![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
@dsnp/mrc-rpc
Advanced tools
RPC configuration for MRC for use with Polkadotjs API
An easy way to get all the custom rpc and types config to be able to easily use MRC with the Polkadot JS API library.
npm install @polkadot/api
(Polkadot API Library)npm install @dsnp/mrc-rpc
For details on use, see the Polkadot API library documentation.
// es6 style imports
import { ApiPromise } from '@polkadot/api';
import { rpc, types } from "@dsnp/mrc-rpc";
// ...
const mrcAPI = await ApiPromise.create({
// ...
rpc,
types,
});
// commonjs require
const { ApiPromise } = require('@polkadot/api');
const { rpc, types } = require("@dsnp/mrc-rpc");
// ...
const mrcAPI = await ApiPromise.create({
// ...
rpc,
types,
});
See CONTRIBUTING.md for more information.
Optional responses are not mapped to null
and instead return an object with a few properties.
For more details see the code for the Option class.
const optionalExample = await api.rpc.msa.getMsaId(account);
// Does the Option have a value?
if (!optionalExample.isEmpty) {
// Get the value
return optionalExample.value;
}
return null;
Vector responses are not mapped directly to a JavaScript Array.
Instead they are mapped to the Vec class which does extend Array.
Thus, you can still use map
, forEach
, etc... with responses or access the values directing via .values()
.
Distributed under the Apache 2.0 License. See LICENSE
for more information.
FAQs
RPC configuration for MRC for use with Polkadotjs API
The npm package @dsnp/mrc-rpc receives a total of 0 weekly downloads. As such, @dsnp/mrc-rpc popularity was classified as not popular.
We found that @dsnp/mrc-rpc demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.