Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@dsnp/frequency-api-augment

Package Overview
Dependencies
Maintainers
2
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dsnp/frequency-api-augment

RPC configuration for Frequency for use with Polkadotjs API

  • 0.0.0-f0e26b
  • unpublished
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
2
Weekly downloads
 
Created
Source

Javascript Custom RPC

Contributors Forks Stargazers Issues MIT License NPM @latest NPM @next

Frequency Custom RPC and Types for Polkadot JS API

An easy way to get all the custom rpc and types config to be able to easily use Frequency with the Polkadot JS API library.

Getting Started

  • npm install @dsnp/frequency-api-augment (API Augmentation Library)
  • npm install @polkadot/api (Polkadot API Library)

Usage

For details on use, see the Polkadot API library documentation.

// es6 style imports
import { options } from "@dsnp/frequency-api-augment";
import { ApiPromise } from '@polkadot/api';
// ...

const api = await ApiPromise.create({
    ...options,
    // ...
});
// commonjs require
const { options } = require("@dsnp/frequency-api-augment");
const { ApiPromise } = require('@polkadot/api');
// ...

const api = await ApiPromise.create({
    ...options,
    // ...
});

Contributing

See CONTRIBUTING.md for more information.

Updating Definitions

  1. Update ./definitions
  2. Build and start the chain (does not need to be on-boarded)
  3. Run npm run fetch:local
  4. Commit changes

Helpful Notes

Option

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;

Vec

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().

License

Distributed under the Apache 2.0 License. See LICENSE for more information.

FAQs

Package last updated on 30 Aug 2022

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc