Skip to content

Commit

Permalink
Merge pull request #73 from gnosis/bug/network-type-safe-info
Browse files Browse the repository at this point in the history
Bug: Fix network type in safe info
  • Loading branch information
mmv08 authored Dec 18, 2020
2 parents 0b973ef + f0c5a8b commit 82c0280
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/safe-apps-sdk/src/sdk.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -42,8 +42,11 @@ class SafeAppsSDK {
return response.data;
}

async getSafeInfo(): Promise<SafeInfo> {
const response = await this.#communicator.send<'getSafeInfo', undefined, SafeInfo>(METHODS.getSafeInfo, undefined);
async getSafeInfo(): Promise<SafeInfoV1> {
const response = await this.#communicator.send<'getSafeInfo', undefined, SafeInfoV1>(
METHODS.getSafeInfo,
undefined,
);

if (!response.success) {
throw new Error(response.error);
Expand Down
5 changes: 5 additions & 0 deletions packages/safe-apps-sdk/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<M extends Methods = Methods, P = unknown> = {
Expand Down

0 comments on commit 82c0280

Please sign in to comment.