From eeba56576b97afda6739fa8cd0f9e5c6f039651f Mon Sep 17 00:00:00 2001 From: Denis Davidyuk Date: Thu, 17 Aug 2023 00:51:32 +0400 Subject: [PATCH] fix(aepp): use complete type of WalletInfo object --- src/aepp-wallet-communication/rpc/types.ts | 2 +- src/aepp-wallet-communication/wallet-detector.ts | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/aepp-wallet-communication/rpc/types.ts b/src/aepp-wallet-communication/rpc/types.ts index 65dfb9efb0..1aa257e703 100644 --- a/src/aepp-wallet-communication/rpc/types.ts +++ b/src/aepp-wallet-communication/rpc/types.ts @@ -9,7 +9,7 @@ export interface WalletInfo { id: string; name: string; networkId: string; - origin: string; + origin: string; // TODO: origin needs to be provided by transport type: WALLET_TYPE; } diff --git a/src/aepp-wallet-communication/wallet-detector.ts b/src/aepp-wallet-communication/wallet-detector.ts index eb557afbbc..41a6a78d7e 100644 --- a/src/aepp-wallet-communication/wallet-detector.ts +++ b/src/aepp-wallet-communication/wallet-detector.ts @@ -1,14 +1,11 @@ import BrowserConnection from './connection/Browser'; import BrowserWindowMessageConnection from './connection/BrowserWindowMessage'; import { MESSAGE_DIRECTION, METHODS } from './schema'; +import { WalletInfo } from './rpc/types'; import { UnsupportedPlatformError } from '../utils/errors'; interface Wallet { - info: { - id: string; - type: string; - origin: string; - }; + info: WalletInfo; getConnection: () => BrowserWindowMessageConnection; } interface Wallets { [key: string]: Wallet } @@ -28,7 +25,7 @@ export default ( const wallets: Wallets = {}; connection.connect(( - { method, params }: { method: string; params: Wallet['info'] }, + { method, params }: { method: string; params: WalletInfo }, origin: string, source: Window, ) => {