Skip to content

Commit

Permalink
Fix typings
Browse files Browse the repository at this point in the history
  • Loading branch information
lubej committed Feb 20, 2024
1 parent fe6ac40 commit 627df36
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions frontend/src/contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { type MessageBox, MessageBox__factory } from '@oasisprotocol/demo-starte
export type { MessageBox } from '@oasisprotocol/demo-starter-backend';

import { useEthereumStore } from './stores/ethereum';
import { VoidSigner } from 'ethers';
import { type ContractRunner, VoidSigner } from 'ethers';

const addr = import.meta.env.VITE_MESSAGE_BOX_ADDR!;

Expand All @@ -23,7 +23,7 @@ export function useMessageBox(): ComputedRef<MessageBox | null> {
return null;
}

return MessageBox__factory.connect(addr, eth.signer);
return MessageBox__factory.connect(addr, eth.signer as ContractRunner);
});
}

Expand Down
4 changes: 2 additions & 2 deletions frontend/src/stores/ethereum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export function networkName(network?: Network): string {

declare global {
interface Window {
ethereum?: BrowserProvider & Eip1193Provider & sapphire.SapphireAnnex;
ethereum: BrowserProvider & Eip1193Provider & sapphire.SapphireAnnex;
}
}

Expand Down Expand Up @@ -91,7 +91,7 @@ export const useEthereumStore = defineStore('ethereum', () => {
throw new MetaMaskNotInstalledError('MetaMask not installed!');
}

return ethProvider;
return ethProvider as unknown as typeof window.ethereum;
}

async function init(addr: string, eth: Eip1193Provider) {
Expand Down

0 comments on commit 627df36

Please sign in to comment.