Skip to content

Commit

Permalink
docs: update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
DamianFigiel committed Jan 3, 2025
1 parent 8055adb commit 3e12635
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 325 deletions.
67 changes: 0 additions & 67 deletions packages/adapter/CHANGELOG.md

This file was deleted.

49 changes: 16 additions & 33 deletions packages/adapter/README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
# Metamask <> Polkadot snap adapter
![](https://github.com/chainsafe/metamask-snap-polkadot/workflows/ci/badge.svg)
![](https://img.shields.io/github/license/chainsafe/metamask-snap-polkadot)
![](https://img.shields.io/badge/yarn-%3E%3D1.17.0-orange.svg?style=flat-square)
![Discord](https://img.shields.io/discord/608204864593461248?color=blue&label=Discord&logo=discord)
# Metamask <> Enjin snap adapter

Metamask <> Polkadot snap adapter is used to inject [polkadot snap](https://github.com/chainsafe/metamask-snap-polkadot) as web3 provider. It lists snap inside `window.injectedWeb3[injectedSnapId]`(*) so it can be enabled using `@polkadot/extension-dapp` package.
![](https://github.com/enjin/metamask-snap-enjin/workflows/ci/badge.svg)
![](https://img.shields.io/github/license/enjin/metamask-snap-enjin)
![](https://img.shields.io/badge/yarn-%3E%3D1.17.0-orange.svg?style=flat-square)
![Discord](https://img.shields.io/discord/644182966574252073?color=blue&label=Discord&logo=discord)

*injectedSnapId default is "metamask-polkadot-snap"
Metamask <> Enjin snap adapter is used to inject [enjin snap](https://github.com/enjin/metamask-snap-enjin) as web3 provider. It lists snap inside `window.injectedWeb3[metamask-enjin-snap]` so it can be enabled using `@polkadot/extension-dapp` package.

For more details on polkadot snap itself see [snap repo](https://github.com/chainsafe/metamask-snap-polkadot) or read full [polkadot snap documentation](https://github.com/chainsafe/metamask-snap-polkadot/wiki).
For more details on Enjin snap itself see [snap repo](https://github.com/enjin/metamask-snap-enjin) or read [Enjin snap guide](https://support.enjin.io/hc/en-gb/articles/23053873072274-Enjin-Snap).

## Usage

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

```typescript
function enablePolkadotSnap(
config?: SnapConfig,
Expand All @@ -20,41 +21,23 @@ function enablePolkadotSnap(
): Promise<MetamaskPolkadotSnap>
```

## Usage to inject snap in injectedWeb3 object

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

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

Default config:
```
{
networkName: 'westend'
}
```
Configuration structure is shown below.

```
SnapConfig {
networkName: SnapNetworks;
export type SnapConfig = {
wsRpcUrl?: string;
addressPrefix?: number;
unit?: UnitConfiguration;
}
} & (
| { networkName: SupportedSnapNetworks; genesisHash?: `0x${string}` }
| { networkName: SnapNetworks; genesisHash: `0x${string}` }
);

SnapNetworks = "polkadot" | "kusama" | "westend";
SnapNetworks = 'enjin-relaychain' | 'enjin-matrixchain' | 'canary-relaychain' | 'canary-matrixchain';

UnitConfiguration {
export interface UnitConfiguration {
symbol: string;
decimals: number;
image?: string;
Expand Down
2 changes: 1 addition & 1 deletion packages/example/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### Metamask polkadot snap example
### Metamask Enjin snap example

- `yarn install`
- serve snap
Expand Down
154 changes: 0 additions & 154 deletions packages/snap/CHANGELOG.md

This file was deleted.

27 changes: 7 additions & 20 deletions packages/snap/README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,21 @@
# Polkadot Wallet Snap for MetaMask
# Metamask <> Enjin Snap

![](https://github.com/chainsafe/metamask-snap-polkadot/workflows/ci/badge.svg)
![](https://img.shields.io/github/issues-raw/chainsafe/metamask-snap-polkadot)
![](https://img.shields.io/github/license/chainsafe/metamask-snap-polkadot)
![](https://github.com/enjin/metamask-snap-enjin/workflows/ci/badge.svg)
![](https://img.shields.io/github/issues-raw/enjin/metamask-snap-enjin)
![](https://img.shields.io/github/license/enjin/metamask-snap-enjin)

This project uses the [MetaMask Snaps](https://metamask.io/snaps/) framework to extend MetaMask
capabilities to include support for Polkadot, Kusama, and other
[Substrate](https://docs.substrate.io/)- and FRAME-based blockchains in the
[Polkadot](https://www.polkadot.network/) ecosystem.
capabilities to include support for Enjin Relaychain and Enjin Matrixchain

## Documentation

Polkadot Wallet snap architecture, integration steps and detailed API documentation for dApp
developers is covered in the
[project wiki](https://github.com/ChainSafe/metamask-snap-polkadot/wiki), which also includes a
usage guide for the [example dApp](https://polkadot.snap.chainsafe.io/). Additional
documentation is available on the
[homepage](https://github.com/ChainSafe/metamask-snap-polkadot#polkadot-wallet-snap-for-metamask)
for the project's GitHub repository.

## Local Development
## Testing

Developers who wish to use the snap locally must use [MetaMask Flask](https://metamask.io/flask/);
run the following commands from the project root to launch the
[Polkadot Wallet Snap Example dApp](https://github.com/ChainSafe/metamask-snap-polkadot/tree/master/packages/example).

- `yarn install`
- `yarn build`
- `yarn run demo`


## License

Copyright [2020] [ChainSafe Systems]
Expand Down
50 changes: 0 additions & 50 deletions packages/types/CHANGELOG.md

This file was deleted.

0 comments on commit 3e12635

Please sign in to comment.