Skip to content

Commit

Permalink
Version Packages (#581)
Browse files Browse the repository at this point in the history
* Docs: fix regex syntax in SDK examples (#579)

* Feat extended safe info (#580)

api-kit’s getSafeInfo endpoint returns way more information than our
communicator’s getInfo endpoint. This causes some dapps to use the
getInfo endpoint for just the readOnly flag (when running in an iframe)
and then to do api-kit getSafeInfo for the nonce and other props.
By returning nearly the same information from the getInfo endpoint we
make developers live easier.

* Version Packages

---------

Co-authored-by: katspaugh <[email protected]>
Co-authored-by: Daniel Dimitrov <[email protected]>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
4 people authored Jun 12, 2024
1 parent a247237 commit 746f247
Show file tree
Hide file tree
Showing 21 changed files with 98 additions and 154 deletions.
6 changes: 6 additions & 0 deletions packages/safe-apps-sdk/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @safe-global/safe-apps-sdk

## 9.1.0

### Minor Changes

- a811ac6: safe.getInfo() endpoint should return extended safe information similar to api-kit's getSafeInfo endpoint

## 9.0.0

### Major Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/safe-apps-sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ type Opts = {
};

const opts: Opts = {
allowedDomains: [/app.safe.global$/],
allowedDomains: [/^app\.safe\.global$/],
debug: false,
};

Expand Down
4 changes: 2 additions & 2 deletions packages/safe-apps-sdk/dist/cjs/safe/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Communicator, SafeInfo, ChainInfo, SafeBalances, GetBalanceParams, EnvironmentInfo, AddressBookItem, EIP712TypedData } from '../types/index.js';
import { Communicator, ChainInfo, SafeBalances, GetBalanceParams, EnvironmentInfo, AddressBookItem, EIP712TypedData, SafeInfoExtended } from '../types/index.js';
declare class Safe {
private readonly communicator;
constructor(communicator: Communicator);
getChainInfo(): Promise<ChainInfo>;
getInfo(): Promise<SafeInfo>;
getInfo(): Promise<SafeInfoExtended>;
experimental_getBalances({ currency }?: GetBalanceParams): Promise<SafeBalances>;
private check1271Signature;
private check1271SignatureBytes;
Expand Down
8 changes: 8 additions & 0 deletions packages/safe-apps-sdk/dist/cjs/types/sdk.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@ export type SafeInfo = {
owners: string[];
isReadOnly: boolean;
};
export type SafeInfoExtended = SafeInfo & {
nonce: number;
implementation: string;
modules: string[] | null;
fallbackHandler: string | null;
guard: string | null;
version: string | null;
};
export type EnvironmentInfo = {
origin: string;
};
Expand Down
2 changes: 1 addition & 1 deletion packages/safe-apps-sdk/dist/cjs/types/sdk.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/safe-apps-sdk/dist/esm/safe/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Communicator, SafeInfo, ChainInfo, SafeBalances, GetBalanceParams, EnvironmentInfo, AddressBookItem, EIP712TypedData } from '../types/index.js';
import { Communicator, ChainInfo, SafeBalances, GetBalanceParams, EnvironmentInfo, AddressBookItem, EIP712TypedData, SafeInfoExtended } from '../types/index.js';
declare class Safe {
private readonly communicator;
constructor(communicator: Communicator);
getChainInfo(): Promise<ChainInfo>;
getInfo(): Promise<SafeInfo>;
getInfo(): Promise<SafeInfoExtended>;
experimental_getBalances({ currency }?: GetBalanceParams): Promise<SafeBalances>;
private check1271Signature;
private check1271SignatureBytes;
Expand Down
2 changes: 1 addition & 1 deletion packages/safe-apps-sdk/dist/esm/safe/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions packages/safe-apps-sdk/dist/esm/types/sdk.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@ export type SafeInfo = {
owners: string[];
isReadOnly: boolean;
};
export type SafeInfoExtended = SafeInfo & {
nonce: number;
implementation: string;
modules: string[] | null;
fallbackHandler: string | null;
guard: string | null;
version: string | null;
};
export type EnvironmentInfo = {
origin: string;
};
Expand Down
2 changes: 1 addition & 1 deletion packages/safe-apps-sdk/dist/esm/types/sdk.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/safe-apps-sdk/dist/types/safe/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Communicator, SafeInfo, ChainInfo, SafeBalances, GetBalanceParams, EnvironmentInfo, AddressBookItem, EIP712TypedData } from '../types/index.js';
import { Communicator, ChainInfo, SafeBalances, GetBalanceParams, EnvironmentInfo, AddressBookItem, EIP712TypedData, SafeInfoExtended } from '../types/index.js';
declare class Safe {
private readonly communicator;
constructor(communicator: Communicator);
getChainInfo(): Promise<ChainInfo>;
getInfo(): Promise<SafeInfo>;
getInfo(): Promise<SafeInfoExtended>;
experimental_getBalances({ currency }?: GetBalanceParams): Promise<SafeBalances>;
private check1271Signature;
private check1271SignatureBytes;
Expand Down
2 changes: 1 addition & 1 deletion packages/safe-apps-sdk/dist/types/safe/index.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions packages/safe-apps-sdk/dist/types/types/sdk.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@ export type SafeInfo = {
owners: string[];
isReadOnly: boolean;
};
export type SafeInfoExtended = SafeInfo & {
nonce: number;
implementation: string;
modules: string[] | null;
fallbackHandler: string | null;
guard: string | null;
version: string | null;
};
export type EnvironmentInfo = {
origin: string;
};
Expand Down
Loading

0 comments on commit 746f247

Please sign in to comment.