From f0c5a8b2805637b515f46d7cbddf0e3ef3c66956 Mon Sep 17 00:00:00 2001 From: Mikhail Mikheev Date: Fri, 18 Dec 2020 17:39:43 +0400 Subject: [PATCH] Fix network type in safe info --- packages/safe-apps-sdk/src/sdk.ts | 9 ++++++--- packages/safe-apps-sdk/src/types.ts | 5 +++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/packages/safe-apps-sdk/src/sdk.ts b/packages/safe-apps-sdk/src/sdk.ts index b22fcee9..2e34bd02 100644 --- a/packages/safe-apps-sdk/src/sdk.ts +++ b/packages/safe-apps-sdk/src/sdk.ts @@ -1,5 +1,5 @@ import { METHODS } from './communication'; -import { Communicator, SafeInfo, EnvInfo } from './types'; +import { Communicator, SafeInfoV1, EnvInfo } from './types'; import InterfaceCommunicator from './communication'; import { TXs } from './txs'; import { Eth } from './eth'; @@ -42,8 +42,11 @@ class SafeAppsSDK { return response.data; } - async getSafeInfo(): Promise { - const response = await this.#communicator.send<'getSafeInfo', undefined, SafeInfo>(METHODS.getSafeInfo, undefined); + async getSafeInfo(): Promise { + const response = await this.#communicator.send<'getSafeInfo', undefined, SafeInfoV1>( + METHODS.getSafeInfo, + undefined, + ); if (!response.success) { throw new Error(response.error); diff --git a/packages/safe-apps-sdk/src/types.ts b/packages/safe-apps-sdk/src/types.ts index 4c6a1673..c8da472a 100644 --- a/packages/safe-apps-sdk/src/types.ts +++ b/packages/safe-apps-sdk/src/types.ts @@ -63,6 +63,11 @@ export interface SafeInfo { network: LowercaseNetworks; } +export interface SafeInfoV1 { + safeAddress: string; + network: UppercaseNetworks; +} + export type Methods = keyof typeof METHODS; export type SDKRequestData = {