Skip to content

Commit

Permalink
Merge branch 'master' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrouid authored Mar 22, 2022
2 parents 6b12e66 + 48e50ee commit 97a6777
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 0 deletions.
11 changes: 11 additions & 0 deletions docs/providers/boltx.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Bolt-X Wallet

1. Set Provider Options

```typescript
const providerOptions = {
boltx: {
package: true
}
};
```
16 changes: 16 additions & 0 deletions src/providers/connectors/boltx.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const ConnectToBoltX = async () => {
let provider = null;
if (typeof (window as any).boltX !== 'undefined') {
provider = (window as any).boltX.ethereum;
try {
await provider.request({ method: 'eth_requestAccounts' })
} catch (error) {
throw new Error("User Rejected");
}
} else {
throw new Error("BoltX not found");
}
return provider;
};

export default ConnectToBoltX;
2 changes: 2 additions & 0 deletions src/providers/connectors/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import injected from "./injected";
import boltx from "./boltx";
import walletconnect from "./walletconnect";
import portis from "./portis";
import fortmatic from "./fortmatic";
Expand All @@ -16,6 +17,7 @@ import walletlink from "./walletlink";
export {
injected,
walletconnect,
boltx,
portis,
torus,
fortmatic,
Expand Down
10 changes: 10 additions & 0 deletions src/providers/injected/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ import FrameLogo from "../logos/frame.svg";
// @ts-ignore
import LiqualityLogo from "../logos/liquality.png";
// @ts-ignore
import BoltXLogo from "../logos/boltx.svg";
// @ts-ignore
import MathWalletLogo from "../logos/mathwallet.png";
// @ts-ignore
import RWalletLogo from "../logos/rwallet.svg";
Expand Down Expand Up @@ -151,6 +153,14 @@ export const LIQUALITY: IProviderInfo = {
check: "isLiquality"
};

export const BOLTX: IProviderInfo = {
id: "boltx",
name: "Bolt-X",
logo: BoltXLogo,
type: "injected",
check: "isBoltX",
};

export const MATHWALLET: IProviderInfo = {
id: "injected",
name: "Math Wallet",
Expand Down
Binary file added src/providers/logos/boltx.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions src/providers/logos/boltx.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 97a6777

Please sign in to comment.