@avail-project/metamask-avail-adapter
v1.0.8
Published
![](https://github.com/availproject/metamask-snap-avail/workflows/ci/badge.svg) ![](https://img.shields.io/github/license/availproject/metamask-snap-avail) ![](https://img.shields.io/badge/yarn-%3E%3D1.17.0-orange.svg?style=flat-square) ![Discord](https:/
Downloads
31
Readme
Metamask <> Avail snap adapter
Metamask <> Avail snap adapter is used to inject avail snap as web3 provider. It lists snap inside window.injectedWeb3["metamask-avail-snap"]
so it can be enabled using @availproject/extension-dapp
package.
For more details on avail snap itself see snap repo.
Usage
Adapter has only one exposed function for enabling snap as web3 provider.
function enableAvailSnap(
config?: SnapConfig,
snapOrigin?: string,
snapInstallationParams?: Record<SnapInstallationParamNames, unknown> = {}
): Promise<MetamaskAvailSnap>
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 = "avail";
UnitConfiguration {
symbol: string;
decimals: number;
image?: string;
customViewUrl?: string;
}