Socket
Socket
Sign inDemoInstall

@polkadot/extension-inject

Package Overview
Dependencies
7
Maintainers
2
Versions
576
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @polkadot/extension-inject

A generic injector (usable to any extension), that populates the base exposed interfaces to be used by dapps.


Version published
Weekly downloads
13K
decreased by-5.76%
Maintainers
2
Created
Weekly downloads
 

Changelog

Source

0.46.8 Mar 13, 2024

  • Important Not published to the stores, aligns with latest released packages.

Changes:

  • Upgrade to @polkadot/api 10.12.2
  • Upgrade to @polkadot/phishing 0.22.3

Readme

Source

@polkadot/extension-inject

This is a basic extension injector that manages access to the global objects available. As an extension developer, you don't need to manage access to the window object manually, by just calling enable here, the global object is setup and managed properly. From here any dapp can access it with the @polkadot/extension-dapp package;

Usage

import { injectExtension } from '@polkadot/extension-inject';

// this a the function that will be exposed to be callable by the dapp. It resolves a promise
// with the injected interface, (see `Injected`) when the dapp at `originName` (url) is allowed
// to access functionality
function enableFn (originName: string): Promise<Injected> {
  ...
}

// injects the extension into the page
injectExtension(enableFn, { name: 'myExtension', version: '1.0.1' });

FAQs

Last updated on 14 Mar 2024

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc