Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Safe Apps Sdk v1.0.2 #74

Merged
merged 5 commits into from
Dec 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Binary file added assets/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/safe-tab-apps.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/third-pary-app-modal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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