Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
@substrate/connect
Advanced tools
Substrate-connect to Smoldot clients. Using either substrate extension with predefined clients or an internal smoldot client based on chainSpecs provided.
This is a prototype for using @polkadot/api with the smoldot WASM light client either by passing chainspecs or using the extension by predefined chains (e.g. westend2, ksmcc3).
ScProvider check existence of substrate extension. If it is installed and activated then smoldot clients of extension will be used. If not, a new smoldot client will start and sync with given chainspecs.
Provide a known Chain Name ('polkadot', 'ksmcc3', 'westend2', 'rococo_v2_1'):
import { ApiPromise } from '@polkadot/api';
import { createPolkadotJsScClient, SupportedChains } from '@substrate/connect';
const scClient = createPolkadotJsScClient();
const provider = await scClient.addWellKnownChain(SupportedChains.westend2);
const api = await ApiPromise.create({ provider });
or provide your custom substrate chain's name and chainspec:
import { ApiPromise } from '@polkadot/api';
import { createPolkadotJsScClient } from '@substrate/connect';
import mySubstrateChainSpec from './mySubstrateChainSpec.json';
const myChainSpec = JSON.stringify(mySubstrateChainSpec);
const scClient = createPolkadotJsScClient();
const provider = await scClient.addChain(myChainSpec);
const api = await ApiPromise.create({ provider });
For parachain support, you can providethe parachain's specs
import { ApiPromise } from '@polkadot/api';
import { createPolkadotJsScClient, SupportedChains } from '@substrate/connect';
import myParaChainSpec from './myParaChainSpec.json';
const parachainSpec = JSON.stringify(myParaChainSpec);
const scClient = createPolkadotJsScClient();
await scClient.addWellKnownChain(SupportedChains.westend2)
const provider = await scClient.addChain(parachainSpec);
const api = await ApiPromise.create({ provider });
yarn test
to run the unit testsyarn build
to build @substrate-connectyarn lint
to run linter for @substrate-connectFAQs
Substrate-connect to Smoldot clients. Using either substrate extension with predefined clients or an internal smoldot client based on chainSpecs provided.
The npm package @substrate/connect receives a total of 59,196 weekly downloads. As such, @substrate/connect popularity was classified as popular.
We found that @substrate/connect demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 15 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.