diff --git a/packages/wallet-manager/src/WalletManagerContext.ts b/packages/wallet-manager/src/WalletManagerContext.ts index 79202e98..04f72600 100644 --- a/packages/wallet-manager/src/WalletManagerContext.ts +++ b/packages/wallet-manager/src/WalletManagerContext.ts @@ -7,7 +7,7 @@ import { } from './WalletManagerController'; import { ethers } from 'ethers'; import { ApiPromise } from '@polkadot/api'; -import { Networks } from './types'; +import { Network } from './types'; export const WalletManagerContext = createContext< TWalletManagerController | undefined @@ -56,11 +56,11 @@ export class WalletManagerContextProvider extends LitElement { wssConnectionUrl?: string; @property({ type: String }) - networks: Networks; + networks: Network; constructor() { super(); - this.networks = Networks.EVM; + this.networks = Network.EVM; } connectedCallback(): void { diff --git a/packages/wallet-manager/src/WalletManagerController.ts b/packages/wallet-manager/src/WalletManagerController.ts index b33acd45..3a9817f7 100644 --- a/packages/wallet-manager/src/WalletManagerController.ts +++ b/packages/wallet-manager/src/WalletManagerController.ts @@ -2,7 +2,7 @@ import { ReactiveControllerHost } from 'lit'; import { EvmWallet, SubstrateWallet } from '.'; import { Web3Provider } from '@ethersproject/providers'; import { ApiPromise } from '@polkadot/api'; -import { AddChain, Networks } from './types'; +import { AddChain, Network } from './types'; import { customEVMEvents, IWalletManagerController } from './interfaces'; import { Signer } from '@ethersproject/abstract-signer'; @@ -15,7 +15,7 @@ export class WalletManagerController implements IWalletManagerController { constructor( host: ReactiveControllerHost, - networks: Networks, + networks: Network, initArgument: { web3Provider?: Web3Provider; apiPromise?: ApiPromise; @@ -24,12 +24,12 @@ export class WalletManagerController implements IWalletManagerController { ) { (this.host = host).addController(this); - if (networks === Networks.EVM) { + if (networks === Network.EVM) { this.initWeb3Provider(initArgument.web3Provider); - } else if (networks === Networks.Substrate) { + } else if (networks === Network.Substrate) { this.initFromApiPromise(initArgument as ApiPromise); } else if ( - networks === Networks.Substrate && + networks === Network.Substrate && initArgument.wssConnectionUrl ) { this.initFromWssProvider(initArgument as string); diff --git a/packages/wallet-manager/src/interfaces/index.ts b/packages/wallet-manager/src/interfaces/index.ts index c0427077..df51bb47 100644 --- a/packages/wallet-manager/src/interfaces/index.ts +++ b/packages/wallet-manager/src/interfaces/index.ts @@ -20,16 +20,7 @@ export interface IEvmWallet { chainId, rpcUrl, chainName - }: { - chainId: number; - rpcUrl: string; - chainName: string; - nativeCurrency: { - name: string; - symbol: string; - decimals: number; - }; - }): Promise; + }: Pick): Promise; } export interface ISubstrateWallet { diff --git a/packages/wallet-manager/src/types.ts b/packages/wallet-manager/src/types.ts index 3949b770..29eb94b4 100644 --- a/packages/wallet-manager/src/types.ts +++ b/packages/wallet-manager/src/types.ts @@ -22,7 +22,7 @@ export type SyntheticEventCreator = ( dataToPass: Record | number | string | Array ) => void; -export enum Networks { +export enum Network { EVM = 'EVM', Substrate = 'Substrate' }