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

0.5.4 • Public • Published

Metamask <> Astar snap adapter

Discord

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

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

Usage

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

function enablePolkadotSnap(
  config?: SnapConfig,
  snapOrigin?: string,
  snapInstallationParams?: Record<SnapInstallationParamNames, unknown> = {}
): Promise<MetamaskPolkadotSnap>

By providing config as argument it is possible to override default configurations.

Configuration structure is shown below.

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

SnapNetworks = "astar" | "shiden" | "shibuya";

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

Dependents (0)

Package Sidebar

Install

npm i @astar-network/metamask-astar-adapter

Weekly Downloads

82

Version

0.5.4

License

Apache-2.0

Unpacked Size

47 kB

Total Files

21

Last publish

Collaborators

  • alan-astar
  • bobo_ka
  • astar-sys
  • codespool