Skip to content

Commit

Permalink
Merge pull request #74 from gnosis/development
Browse files Browse the repository at this point in the history
Safe Apps Sdk v1.0.2
  • Loading branch information
mmv08 authored Dec 18, 2020
2 parents 74142cd + ca9af6b commit 9de833e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

Developer tools to integrate third-party applications (Safe Apps) with Safe Multisig (https://gnosis-safe.io/app/).

You can find more resources on Safe Apps in the [Gnosis Safe Developer Portal](https://docs.gnosis.io/safe/docs/sdks_safe_apps/).

## Packages

| Package | Description |
Expand Down
2 changes: 1 addition & 1 deletion packages/safe-apps-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gnosis.pm/safe-apps-sdk",
"version": "1.0.1",
"version": "1.0.2",
"description": "SDK developed to integrate third-party apps with Safe-Multisig app.",
"main": "dist/src/index.js",
"typings": "dist/src/index.d.ts",
Expand Down
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 9de833e

Please sign in to comment.