Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions blockchain/NevmRolluxBridge/walletConnectors/OpenBitConnector.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { MetamaskConnector } from "@usedapp/core";

import { providers } from "ethers";

declare global {
interface Window {
OpenBit: any;
}
}

export class OpenBitWalletConnector extends MetamaskConnector {
activate(): Promise<void> {
const wallet = window.OpenBit;

if (!wallet?.isOpenBit) {
console.warn("OpenBit is not installed");
}
this.provider = new providers.Web3Provider(wallet);
return super.activate();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
Spacer,
Text,
ModalBody,
Button,
VStack,

} from "@chakra-ui/react"
Expand All @@ -20,6 +19,7 @@ import { CoinbaseWalletConnector, useEthers } from "@usedapp/core";
import { TanenbaumChain } from "blockchain/NevmRolluxBridge/config/chainsUseDapp";
import { PaliWalletConnector } from "blockchain/NevmRolluxBridge/walletConnectors/PaliWalletConnector";
import { ConnectWalletButton } from "../Components/ConnectWalletButton";
import { OpenBitWalletConnector } from "blockchain/NevmRolluxBridge/walletConnectors/OpenBitConnector";

export type ConnectWalletBlockProps = {
setScreen: (value: string) => void;
Expand Down Expand Up @@ -117,6 +117,14 @@ export const ConnectWalletBlock: FC<ConnectWalletBlockProps> = ({ setScreen, onC
)
}}
/>
<ConnectWalletButton
label={'OpenBit Wallet'}
logoPath={'/wallets/openbit.png'}
onClick={() => {
onClose();
activate(new OpenBitWalletConnector());
}}
/>
</VStack>
<Divider mt={5} />
<Text textAlign={'center'}>
Expand Down
Binary file added public/wallets/openbit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.