From b8cd16e2a0a313f27e2804631b0a63870955e489 Mon Sep 17 00:00:00 2001 From: Daniel Somoza Date: Wed, 24 Nov 2021 12:08:21 +0100 Subject: [PATCH 1/7] Added ChainInfo types in SafeInfo --- packages/safe-apps-sdk/src/types/sdk.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/safe-apps-sdk/src/types/sdk.ts b/packages/safe-apps-sdk/src/types/sdk.ts index e042ef92..70b35abc 100644 --- a/packages/safe-apps-sdk/src/types/sdk.ts +++ b/packages/safe-apps-sdk/src/types/sdk.ts @@ -27,9 +27,17 @@ export type SendTransactionsResponse = { safeTxHash: string; }; +export type ChainInfo = { + chainName: string; + chainId: number; + shortName: string; + nativeCurrency: string; +}; + export type SafeInfo = { safeAddress: string; chainId: number; threshold: number; owners: string[]; + chainInfo: ChainInfo; }; From 87984be5ff1334451971615722ff41c62018b796 Mon Sep 17 00:00:00 2001 From: Daniel Somoza Date: Wed, 24 Nov 2021 12:15:25 +0100 Subject: [PATCH 2/7] adding changes --- .changeset/pre.json | 13 +++++++++++++ .changeset/yellow-planes-carry.md | 5 +++++ 2 files changed, 18 insertions(+) create mode 100644 .changeset/pre.json create mode 100644 .changeset/yellow-planes-carry.md diff --git a/.changeset/pre.json b/.changeset/pre.json new file mode 100644 index 00000000..ebc34623 --- /dev/null +++ b/.changeset/pre.json @@ -0,0 +1,13 @@ +{ + "mode": "pre", + "tag": "next", + "initialVersions": { + "@gnosis.pm/cra-template-safe-app": "4.0.1", + "@gnosis.pm/safe-apps-provider": "0.9.0", + "@gnosis.pm/safe-apps-react-sdk": "4.0.6", + "@gnosis.pm/safe-apps-sdk": "6.0.0", + "@gnosis.pm/safe-apps-web3-react": "0.6.5", + "@gnosis.pm/safe-apps-web3modal": "5.0.0" + }, + "changesets": [] +} diff --git a/.changeset/yellow-planes-carry.md b/.changeset/yellow-planes-carry.md new file mode 100644 index 00000000..8f261425 --- /dev/null +++ b/.changeset/yellow-planes-carry.md @@ -0,0 +1,5 @@ +--- +'@gnosis.pm/safe-apps-sdk': minor +--- + +Adding typing for retrieving network information in the getSafeInfo method From a28d19420b11a8653fef5c99882cc228f8b73062 Mon Sep 17 00:00:00 2001 From: Daniel Somoza Date: Wed, 24 Nov 2021 13:06:59 +0100 Subject: [PATCH 3/7] fixed safeInfo uni tests --- packages/safe-apps-sdk/src/safe/safe.test.ts | 66 ++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/packages/safe-apps-sdk/src/safe/safe.test.ts b/packages/safe-apps-sdk/src/safe/safe.test.ts index 467b9d24..5b9f96b4 100644 --- a/packages/safe-apps-sdk/src/safe/safe.test.ts +++ b/packages/safe-apps-sdk/src/safe/safe.test.ts @@ -38,6 +38,12 @@ describe('Safe Apps SDK safe methods', () => { safeAddress: '0x9C6FEA0B2eAc5b6D8bBB6C30401D42aA95398190', owners: [], threshold: 1, + chainInfo: { + chainName: 'rinkeby', + chainId: 4, + shortName: 'rin', + nativeCurrency: 'eth' + }, }), ); // to test message/hash I signed a test message on rinkeby @@ -60,6 +66,12 @@ describe('Safe Apps SDK safe methods', () => { safeAddress: '0x9C6FEA0B2eAc5b6D8bBB6C30401D42aA95398190', owners: [], threshold: 1, + chainInfo: { + chainName: 'rinkeby', + chainId: 4, + shortName: 'rin', + nativeCurrency: 'eth' + }, }), ); const message = '0x617070726f76652072756770756c6c0000000000000000000000000000000000'; // ethers.utils.formatBytes32String('approve rugpull') @@ -95,6 +107,12 @@ describe('Safe Apps SDK safe methods', () => { safeAddress: '0x9C6FEA0B2eAc5b6D8bBB6C30401D42aA95398190', owners: [], threshold: 1, + chainInfo: { + chainName: 'rinkeby', + chainId: 4, + shortName: 'rin', + nativeCurrency: 'eth' + }, }), ); rpcCallSpy.mockImplementationOnce(() => @@ -121,6 +139,12 @@ describe('Safe Apps SDK safe methods', () => { safeAddress: '0x9C6FEA0B2eAc5b6D8bBB6C30401D42aA95398190', owners: [], threshold: 1, + chainInfo: { + chainName: 'rinkeby', + chainId: 4, + shortName: 'rin', + nativeCurrency: 'eth' + }, }), ); rpcCallSpy.mockImplementationOnce(() => Promise.reject(new Error('Hash not approved'))); @@ -141,6 +165,12 @@ describe('Safe Apps SDK safe methods', () => { safeAddress: '0x9C6FEA0B2eAc5b6D8bBB6C30401D42aA95398190', owners: [], threshold: 1, + chainInfo: { + chainName: 'rinkeby', + chainId: 4, + shortName: 'rin', + nativeCurrency: 'eth' + }, }), ); const message = '0x617070726f76652072756770756c6c0000000000000000000000000000000000'; // ethers.utils.formatBytes32String('approve rugpull') @@ -176,6 +206,12 @@ describe('Safe Apps SDK safe methods', () => { safeAddress: '0x9C6FEA0B2eAc5b6D8bBB6C30401D42aA95398190', owners: [], threshold: 1, + chainInfo: { + chainName: 'rinkeby', + chainId: 4, + shortName: 'rin', + nativeCurrency: 'eth' + }, }), ); rpcCallSpy.mockImplementationOnce(() => @@ -202,6 +238,12 @@ describe('Safe Apps SDK safe methods', () => { safeAddress: '0x9C6FEA0B2eAc5b6D8bBB6C30401D42aA95398190', owners: [], threshold: 1, + chainInfo: { + chainName: 'rinkeby', + chainId: 4, + shortName: 'rin', + nativeCurrency: 'eth' + }, }), ); rpcCallSpy.mockImplementationOnce(() => Promise.reject(new Error('Hash not approved'))); @@ -235,6 +277,12 @@ describe('Safe Apps SDK safe methods', () => { safeAddress: '0x9C6FEA0B2eAc5b6D8bBB6C30401D42aA95398190', owners: [], threshold: 1, + chainInfo: { + chainName: 'rinkeby', + chainId: 4, + shortName: 'rin', + nativeCurrency: 'eth' + }, }), ); @@ -272,6 +320,12 @@ describe('Safe Apps SDK safe methods', () => { safeAddress: '0x9C6FEA0B2eAc5b6D8bBB6C30401D42aA95398190', owners: [], threshold: 1, + chainInfo: { + chainName: 'rinkeby', + chainId: 4, + shortName: 'rin', + nativeCurrency: 'eth' + }, }), ); // @ts-expect-error ts fails to infer the return type because of a private method @@ -299,6 +353,12 @@ describe('Safe Apps SDK safe methods', () => { safeAddress: '0x9C6FEA0B2eAc5b6D8bBB6C30401D42aA95398190', owners: [], threshold: 1, + chainInfo: { + chainName: 'rinkeby', + chainId: 4, + shortName: 'rin', + nativeCurrency: 'eth' + }, }), ); // @ts-expect-error ts fails to infer the return type because of a private method @@ -328,6 +388,12 @@ describe('Safe Apps SDK safe methods', () => { safeAddress: '0x9C6FEA0B2eAc5b6D8bBB6C30401D42aA95398190', owners: [], threshold: 1, + chainInfo: { + chainName: 'rinkeby', + chainId: 4, + shortName: 'rin', + nativeCurrency: 'eth' + }, }), ); // @ts-expect-error ts fails to infer the return type because of a private method From bc0a3cd2427b02a7167fcf63935bb823c1ab8b47 Mon Sep 17 00:00:00 2001 From: Daniel Somoza Date: Wed, 24 Nov 2021 13:11:23 +0100 Subject: [PATCH 4/7] Fixed tailing , linter error --- packages/safe-apps-sdk/src/safe/safe.test.ts | 22 ++++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/safe-apps-sdk/src/safe/safe.test.ts b/packages/safe-apps-sdk/src/safe/safe.test.ts index 5b9f96b4..bbd8015f 100644 --- a/packages/safe-apps-sdk/src/safe/safe.test.ts +++ b/packages/safe-apps-sdk/src/safe/safe.test.ts @@ -42,7 +42,7 @@ describe('Safe Apps SDK safe methods', () => { chainName: 'rinkeby', chainId: 4, shortName: 'rin', - nativeCurrency: 'eth' + nativeCurrency: 'eth', }, }), ); @@ -70,7 +70,7 @@ describe('Safe Apps SDK safe methods', () => { chainName: 'rinkeby', chainId: 4, shortName: 'rin', - nativeCurrency: 'eth' + nativeCurrency: 'eth', }, }), ); @@ -111,7 +111,7 @@ describe('Safe Apps SDK safe methods', () => { chainName: 'rinkeby', chainId: 4, shortName: 'rin', - nativeCurrency: 'eth' + nativeCurrency: 'eth', }, }), ); @@ -143,7 +143,7 @@ describe('Safe Apps SDK safe methods', () => { chainName: 'rinkeby', chainId: 4, shortName: 'rin', - nativeCurrency: 'eth' + nativeCurrency: 'eth', }, }), ); @@ -169,7 +169,7 @@ describe('Safe Apps SDK safe methods', () => { chainName: 'rinkeby', chainId: 4, shortName: 'rin', - nativeCurrency: 'eth' + nativeCurrency: 'eth', }, }), ); @@ -210,7 +210,7 @@ describe('Safe Apps SDK safe methods', () => { chainName: 'rinkeby', chainId: 4, shortName: 'rin', - nativeCurrency: 'eth' + nativeCurrency: 'eth', }, }), ); @@ -242,7 +242,7 @@ describe('Safe Apps SDK safe methods', () => { chainName: 'rinkeby', chainId: 4, shortName: 'rin', - nativeCurrency: 'eth' + nativeCurrency: 'eth', }, }), ); @@ -281,7 +281,7 @@ describe('Safe Apps SDK safe methods', () => { chainName: 'rinkeby', chainId: 4, shortName: 'rin', - nativeCurrency: 'eth' + nativeCurrency: 'eth', }, }), ); @@ -324,7 +324,7 @@ describe('Safe Apps SDK safe methods', () => { chainName: 'rinkeby', chainId: 4, shortName: 'rin', - nativeCurrency: 'eth' + nativeCurrency: 'eth', }, }), ); @@ -357,7 +357,7 @@ describe('Safe Apps SDK safe methods', () => { chainName: 'rinkeby', chainId: 4, shortName: 'rin', - nativeCurrency: 'eth' + nativeCurrency: 'eth', }, }), ); @@ -392,7 +392,7 @@ describe('Safe Apps SDK safe methods', () => { chainName: 'rinkeby', chainId: 4, shortName: 'rin', - nativeCurrency: 'eth' + nativeCurrency: 'eth', }, }), ); From 05a7e771191802ad2a087038ad34817d928a4255 Mon Sep 17 00:00:00 2001 From: Daniel Somoza Date: Wed, 24 Nov 2021 13:17:11 +0100 Subject: [PATCH 5/7] exit pre-release mode --- .changeset/pre.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/pre.json b/.changeset/pre.json index ebc34623..a035b69c 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -1,5 +1,5 @@ { - "mode": "pre", + "mode": "exit", "tag": "next", "initialVersions": { "@gnosis.pm/cra-template-safe-app": "4.0.1", From c90b4dde43ca57f0e315b2ab4d36b0a7eb01db9d Mon Sep 17 00:00:00 2001 From: Daniel Somoza Date: Wed, 24 Nov 2021 17:15:05 +0100 Subject: [PATCH 6/7] Added new getChainInfo method --- packages/safe-apps-sdk/package.json | 1 + .../src/communication/methods.ts | 1 + packages/safe-apps-sdk/src/safe/index.ts | 19 +++- packages/safe-apps-sdk/src/safe/safe.test.ts | 106 +++++++----------- packages/safe-apps-sdk/src/types/messaging.ts | 3 +- packages/safe-apps-sdk/src/types/sdk.ts | 14 +-- yarn.lock | 20 ++++ 7 files changed, 87 insertions(+), 77 deletions(-) diff --git a/packages/safe-apps-sdk/package.json b/packages/safe-apps-sdk/package.json index 6f6ee6cd..d515687c 100644 --- a/packages/safe-apps-sdk/package.json +++ b/packages/safe-apps-sdk/package.json @@ -23,6 +23,7 @@ "license": "MIT", "dependencies": { "@changesets/cli": "^2.16.0", + "@gnosis.pm/safe-react-gateway-sdk": "^2.5.6", "ethers": "^5.4.7" }, "devDependencies": { diff --git a/packages/safe-apps-sdk/src/communication/methods.ts b/packages/safe-apps-sdk/src/communication/methods.ts index f67f1d6b..10e58d25 100644 --- a/packages/safe-apps-sdk/src/communication/methods.ts +++ b/packages/safe-apps-sdk/src/communication/methods.ts @@ -1,6 +1,7 @@ export enum Methods { sendTransactions = 'sendTransactions', rpcCall = 'rpcCall', + getChainInfo = 'getChainInfo', getSafeInfo = 'getSafeInfo', getTxBySafeTxHash = 'getTxBySafeTxHash', getSafeBalances = 'getSafeBalances', diff --git a/packages/safe-apps-sdk/src/safe/index.ts b/packages/safe-apps-sdk/src/safe/index.ts index 9acddce4..47acf1f5 100644 --- a/packages/safe-apps-sdk/src/safe/index.ts +++ b/packages/safe-apps-sdk/src/safe/index.ts @@ -2,7 +2,15 @@ import { ethers } from 'ethers'; import { EIP_1271_INTERFACE, EIP_1271_BYTES_INTERFACE, MAGIC_VALUE_BYTES, MAGIC_VALUE } from './signatures'; import { Methods } from '../communication/methods'; import { RPC_CALLS } from '../eth/constants'; -import { Communicator, SafeInfo, SafeBalances, GetBalanceParams, RPCPayload, TransactionConfig } from '../types'; +import { + Communicator, + SafeInfo, + ChainInfo, + SafeBalances, + GetBalanceParams, + RPCPayload, + TransactionConfig, +} from '../types'; class Safe { private readonly communicator: Communicator; @@ -11,6 +19,15 @@ class Safe { this.communicator = communicator; } + async getChainInfo(): Promise { + const response = await this.communicator.send( + Methods.getChainInfo, + undefined, + ); + + return response.data; + } + async getInfo(): Promise { const response = await this.communicator.send( Methods.getSafeInfo, diff --git a/packages/safe-apps-sdk/src/safe/safe.test.ts b/packages/safe-apps-sdk/src/safe/safe.test.ts index bbd8015f..efc5e19a 100644 --- a/packages/safe-apps-sdk/src/safe/safe.test.ts +++ b/packages/safe-apps-sdk/src/safe/safe.test.ts @@ -1,5 +1,5 @@ import SDK from '../sdk'; -import { SafeInfo } from '../types'; +import { SafeInfo, ChainInfo } from '../types'; import { Methods } from '../communication/methods'; const sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms)); @@ -38,12 +38,6 @@ describe('Safe Apps SDK safe methods', () => { safeAddress: '0x9C6FEA0B2eAc5b6D8bBB6C30401D42aA95398190', owners: [], threshold: 1, - chainInfo: { - chainName: 'rinkeby', - chainId: 4, - shortName: 'rin', - nativeCurrency: 'eth', - }, }), ); // to test message/hash I signed a test message on rinkeby @@ -66,12 +60,6 @@ describe('Safe Apps SDK safe methods', () => { safeAddress: '0x9C6FEA0B2eAc5b6D8bBB6C30401D42aA95398190', owners: [], threshold: 1, - chainInfo: { - chainName: 'rinkeby', - chainId: 4, - shortName: 'rin', - nativeCurrency: 'eth', - }, }), ); const message = '0x617070726f76652072756770756c6c0000000000000000000000000000000000'; // ethers.utils.formatBytes32String('approve rugpull') @@ -107,12 +95,6 @@ describe('Safe Apps SDK safe methods', () => { safeAddress: '0x9C6FEA0B2eAc5b6D8bBB6C30401D42aA95398190', owners: [], threshold: 1, - chainInfo: { - chainName: 'rinkeby', - chainId: 4, - shortName: 'rin', - nativeCurrency: 'eth', - }, }), ); rpcCallSpy.mockImplementationOnce(() => @@ -139,12 +121,6 @@ describe('Safe Apps SDK safe methods', () => { safeAddress: '0x9C6FEA0B2eAc5b6D8bBB6C30401D42aA95398190', owners: [], threshold: 1, - chainInfo: { - chainName: 'rinkeby', - chainId: 4, - shortName: 'rin', - nativeCurrency: 'eth', - }, }), ); rpcCallSpy.mockImplementationOnce(() => Promise.reject(new Error('Hash not approved'))); @@ -165,12 +141,6 @@ describe('Safe Apps SDK safe methods', () => { safeAddress: '0x9C6FEA0B2eAc5b6D8bBB6C30401D42aA95398190', owners: [], threshold: 1, - chainInfo: { - chainName: 'rinkeby', - chainId: 4, - shortName: 'rin', - nativeCurrency: 'eth', - }, }), ); const message = '0x617070726f76652072756770756c6c0000000000000000000000000000000000'; // ethers.utils.formatBytes32String('approve rugpull') @@ -206,12 +176,6 @@ describe('Safe Apps SDK safe methods', () => { safeAddress: '0x9C6FEA0B2eAc5b6D8bBB6C30401D42aA95398190', owners: [], threshold: 1, - chainInfo: { - chainName: 'rinkeby', - chainId: 4, - shortName: 'rin', - nativeCurrency: 'eth', - }, }), ); rpcCallSpy.mockImplementationOnce(() => @@ -238,12 +202,6 @@ describe('Safe Apps SDK safe methods', () => { safeAddress: '0x9C6FEA0B2eAc5b6D8bBB6C30401D42aA95398190', owners: [], threshold: 1, - chainInfo: { - chainName: 'rinkeby', - chainId: 4, - shortName: 'rin', - nativeCurrency: 'eth', - }, }), ); rpcCallSpy.mockImplementationOnce(() => Promise.reject(new Error('Hash not approved'))); @@ -277,12 +235,6 @@ describe('Safe Apps SDK safe methods', () => { safeAddress: '0x9C6FEA0B2eAc5b6D8bBB6C30401D42aA95398190', owners: [], threshold: 1, - chainInfo: { - chainName: 'rinkeby', - chainId: 4, - shortName: 'rin', - nativeCurrency: 'eth', - }, }), ); @@ -320,12 +272,6 @@ describe('Safe Apps SDK safe methods', () => { safeAddress: '0x9C6FEA0B2eAc5b6D8bBB6C30401D42aA95398190', owners: [], threshold: 1, - chainInfo: { - chainName: 'rinkeby', - chainId: 4, - shortName: 'rin', - nativeCurrency: 'eth', - }, }), ); // @ts-expect-error ts fails to infer the return type because of a private method @@ -353,12 +299,6 @@ describe('Safe Apps SDK safe methods', () => { safeAddress: '0x9C6FEA0B2eAc5b6D8bBB6C30401D42aA95398190', owners: [], threshold: 1, - chainInfo: { - chainName: 'rinkeby', - chainId: 4, - shortName: 'rin', - nativeCurrency: 'eth', - }, }), ); // @ts-expect-error ts fails to infer the return type because of a private method @@ -388,12 +328,6 @@ describe('Safe Apps SDK safe methods', () => { safeAddress: '0x9C6FEA0B2eAc5b6D8bBB6C30401D42aA95398190', owners: [], threshold: 1, - chainInfo: { - chainName: 'rinkeby', - chainId: 4, - shortName: 'rin', - nativeCurrency: 'eth', - }, }), ); // @ts-expect-error ts fails to infer the return type because of a private method @@ -421,4 +355,42 @@ describe('Safe Apps SDK safe methods', () => { ); }); }); + + describe('SDK.safe.getChainInfo', () => { + test('Should send a valid message to the interface', () => { + sdkInstance.safe.getChainInfo(); + + expect(postMessageSpy).toHaveBeenCalledWith(expect.objectContaining({ method: Methods.getChainInfo }), '*'); + }); + + test('should resolve the correct ChainInfo types', async () => { + const safeInfoSpy = jest.spyOn(sdkInstance.safe, 'getChainInfo'); + safeInfoSpy.mockImplementationOnce( + (): Promise => + Promise.resolve({ + chainName: 'rinkeby', + chainId: '4', + shortName: 'rin', + nativeCurrency: { + name: 'ether', + symbol: 'eth', + decimals: 18, + logoUri: 'ethUri', + }, + }), + ); + const chainInfo = await sdkInstance.safe.getChainInfo(); + expect(chainInfo).toMatchObject({ + chainName: 'rinkeby', + chainId: '4', + shortName: 'rin', + nativeCurrency: { + name: 'ether', + symbol: 'eth', + decimals: 18, + logoUri: 'ethUri', + }, + }); + }); + }); }); diff --git a/packages/safe-apps-sdk/src/types/messaging.ts b/packages/safe-apps-sdk/src/types/messaging.ts index 49203f7b..018cf9a7 100644 --- a/packages/safe-apps-sdk/src/types/messaging.ts +++ b/packages/safe-apps-sdk/src/types/messaging.ts @@ -1,5 +1,5 @@ import { Methods } from '../communication/methods'; -import { SafeInfo, SendTransactionsResponse } from './sdk'; +import { SafeInfo, ChainInfo, SendTransactionsResponse } from './sdk'; import { GatewayTransactionDetails, SafeBalances } from './gateway'; export type RequestId = string; @@ -10,6 +10,7 @@ export interface MethodToResponse { [Methods.sendTransactions]: SendTransactionsResponse; [Methods.rpcCall]: unknown; [Methods.getSafeInfo]: SafeInfo; + [Methods.getChainInfo]: ChainInfo; [Methods.getTxBySafeTxHash]: GatewayTransactionDetails; [Methods.getSafeBalances]: SafeBalances[]; [Methods.signMessage]: SendTransactionsResponse; diff --git a/packages/safe-apps-sdk/src/types/sdk.ts b/packages/safe-apps-sdk/src/types/sdk.ts index 70b35abc..211ad5d2 100644 --- a/packages/safe-apps-sdk/src/types/sdk.ts +++ b/packages/safe-apps-sdk/src/types/sdk.ts @@ -1,3 +1,9 @@ +import { NativeCurrency, ChainInfo as _ChainInfo } from '@gnosis.pm/safe-react-gateway-sdk'; + +export type ChainInfo = Pick<_ChainInfo, 'chainName' | 'chainId' | 'shortName' | 'nativeCurrency'>; + +export { NativeCurrency }; + export type BaseTransaction = { to: string; value: string; @@ -27,17 +33,9 @@ export type SendTransactionsResponse = { safeTxHash: string; }; -export type ChainInfo = { - chainName: string; - chainId: number; - shortName: string; - nativeCurrency: string; -}; - export type SafeInfo = { safeAddress: string; chainId: number; threshold: number; owners: string[]; - chainInfo: ChainInfo; }; diff --git a/yarn.lock b/yarn.lock index 1a8741d3..0234ef78 100644 --- a/yarn.lock +++ b/yarn.lock @@ -932,6 +932,13 @@ "@ethersproject/properties" "^5.5.0" "@ethersproject/strings" "^5.5.0" +"@gnosis.pm/safe-react-gateway-sdk@^2.5.6": + version "2.5.6" + resolved "https://registry.yarnpkg.com/@gnosis.pm/safe-react-gateway-sdk/-/safe-react-gateway-sdk-2.5.6.tgz#7b8713bb16a542c4af27d6e1f2d8925a21aaeb51" + integrity sha512-flM/i80oFwSRlW0U8HE7QurwwPpNTUjBv7gZNAjgOpGhub51r7Uf1LtSm89Mnxnh2mtj4Whl8ZC4RMoXdV3yvw== + dependencies: + isomorphic-unfetch "^3.1.0" + "@humanwhocodes/config-array@^0.5.0": version "0.5.0" resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.5.0.tgz#1407967d4c6eecd7388f83acf1eaf4d0c6e58ef9" @@ -5020,6 +5027,14 @@ isobject@^3.0.1: resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= +isomorphic-unfetch@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/isomorphic-unfetch/-/isomorphic-unfetch-3.1.0.tgz#87341d5f4f7b63843d468438128cb087b7c3e98f" + integrity sha512-geDJjpoZ8N0kWexiwkX8F9NkTsXhetLPVbZFQ+JTW239QNOwvB0gniuR1Wc6f0AMTn7/mFGyXvHTifrCp/GH8Q== + dependencies: + node-fetch "^2.6.1" + unfetch "^4.2.0" + isstream@~0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" @@ -8289,6 +8304,11 @@ unbox-primitive@^1.0.1: has-symbols "^1.0.2" which-boxed-primitive "^1.0.2" +unfetch@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/unfetch/-/unfetch-4.2.0.tgz#7e21b0ef7d363d8d9af0fb929a5555f6ef97a3be" + integrity sha512-F9p7yYCn6cIW9El1zi0HI6vqpeIvBsr3dSuRO6Xuppb1u5rXpCPmMvLSyECLhybr9isec8Ohl0hPekMVrEinDA== + unique-filename@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/unique-filename/-/unique-filename-1.1.1.tgz#1d69769369ada0583103a1e6ae87681b56573230" From d9ae74947ee9e83f708a83575565314a18c09b27 Mon Sep 17 00:00:00 2001 From: Daniel Somoza Date: Wed, 24 Nov 2021 17:27:50 +0100 Subject: [PATCH 7/7] removed NativeCurrency import from the top --- packages/safe-apps-sdk/src/types/sdk.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/safe-apps-sdk/src/types/sdk.ts b/packages/safe-apps-sdk/src/types/sdk.ts index 211ad5d2..639ebec7 100644 --- a/packages/safe-apps-sdk/src/types/sdk.ts +++ b/packages/safe-apps-sdk/src/types/sdk.ts @@ -1,8 +1,8 @@ -import { NativeCurrency, ChainInfo as _ChainInfo } from '@gnosis.pm/safe-react-gateway-sdk'; +import { ChainInfo as _ChainInfo } from '@gnosis.pm/safe-react-gateway-sdk'; export type ChainInfo = Pick<_ChainInfo, 'chainName' | 'chainId' | 'shortName' | 'nativeCurrency'>; -export { NativeCurrency }; +export { NativeCurrency } from '@gnosis.pm/safe-react-gateway-sdk'; export type BaseTransaction = { to: string;