This package has been deprecated

Author message:

Package is deprecated in favour of @chainsafe/metamask-polkadot-adapter

@nodefactory/metamask-polkadot-adapter
TypeScript icon, indicating that this package has built-in type declarations

0.3.1 • Public • Published

Metamask <> Polkadot snap adapter

Discord

Metamask <> Polkadot snap adapter is used to inject polkadot snap as web3 provider. It lists snap inside window.injectedWeb3["metamask-polkadot-snap"] so it can be enabled using @polkadot/extension-dapp package.

For more details on polkadot snap itself see snap repo or read full polkadot snap documentation.

Usage

Adapter has only one exposed function for injecting snap as web3 provider.

function injectMetamaskPolkadotSnapProvider(
  network: "westend"|"kusama",
  config?: SnapConfig,
  pluginOrigin?: string
): void

If only network argument is provided, predefined configuration for specific network will be used. By providing config as argument it is possible to override default configurations.

Configuration structure is shown below.

SnapConfig {
  networkName: string;
  wsRpcUrl?: string;
  addressPrefix?: number;
  unit?: UnitConfiguration;
}

UnitConfiguration {
  symbol: string;
  decimals: number;
  image?: string;
  customViewUrl?: string;
}

Package Sidebar

Install

npm i @nodefactory/metamask-polkadot-adapter

Weekly Downloads

0

Version

0.3.1

License

Apache-2.0

Unpacked Size

40.8 kB

Total Files

24

Last publish

Collaborators

  • makmuftic
  • morrigan88
  • mpetrunic