Skip to content

Commit

Permalink
Small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
crisgarner authored Jan 21, 2020
1 parent c6f97b8 commit 0d000ca
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ADDING_PROVIDERS.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Adding a new provider

Do you want to add your provider to Web3Connect? All logic for supported providers lives inside the `src/providers` directory. To add a new follow the following steps:
Do you want to add your provider to Web3Connect? All logic for supported providers lives inside the `src/providers` directory. To add a new follow the next steps:

Let's call this example provider Firebox

## 1) Create a new connector

Create a new connector file inside `src/providers/connectors` directory. The file should be named after your provider name's in lowercase (eg. firebox.ts)

This file should export as a default a callback function which must have two parameters: your provider package and a options object. It should
This file should export as a default a callback function which must have two parameters: your provider package and a options object.

```typescript
// src/providers/connectors/firebox.ts
Expand All @@ -29,14 +29,14 @@ const ConnectToFirebox = async (
};
```

Make sure your return your provider only after enabling it. Any provider-specific UI/UX should also be handled inside enable.
Make sure you return your provider only after enabling it. Any provider-specific UI/UX should also be handled inside enable.

## 2) Add your connector to the index.ts

On the same directory (`src/providers/connectors`) there is an `index.ts` file where we expose all connectors, you should add yours as follows:

```typescript
// src/providers/connectors/firebox.ts
// src/providers/connectors/index.ts

import firebox from "./firebox";

Expand Down

0 comments on commit 0d000ca

Please sign in to comment.