Skip to content

Commit

Permalink
Merge branch 'development' of github.com:gnosis/safe-apps-sdk into fe…
Browse files Browse the repository at this point in the history
…ature/wagmi-upgrade
  • Loading branch information
mmv08 committed Jan 27, 2023
2 parents 8dfa509 + 6bdd4f9 commit d719e9a
Show file tree
Hide file tree
Showing 47 changed files with 119 additions and 74 deletions.
5 changes: 5 additions & 0 deletions .changeset/chilly-worms-deny.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@safe-global/safe-apps-sdk': minor
---

Update `safe-gateway-typescript-sdk` from gnosis.pm to safe-global
15 changes: 15 additions & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"mode": "pre",
"tag": "next",
"initialVersions": {
"example-safe-apps-wagmi-cra": "0.1.1",
"@safe-global/cra-template-safe-app": "4.2.1",
"@safe-global/safe-apps-provider": "0.15.1",
"@safe-global/safe-apps-react-sdk": "4.6.2",
"@safe-global/safe-apps-sdk": "7.8.0",
"@safe-global/safe-apps-test-app": "0.0.1",
"@gnosis.pm/safe-apps-wagmi": "1.2.0",
"@safe-global/safe-apps-web3modal": "17.0.4"
},
"changesets": []
}
2 changes: 1 addition & 1 deletion .changeset/thin-trainers-punch.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
'@gnosis.pm/safe-apps-wagmi': major
---

This version is bumping versions of wagmi and web3modal in order to work with wagmi0.10.10 and the latest web3modal
This version is bumping versions of wagmi in order to work with wagmi0.10.10
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

[![Logo](https://raw.githubusercontent.com/safe-global/safe-apps-sdk/main/assets/logo.png)](https://safe.global/)

![license](https://img.shields.io/github/license/safe-global/safe-apps-sdk)

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

You can find more resources on Safe Apps in the [Safe Developer Portal](https://docs.gnosis-safe.io/build/sdks/safe-apps).
Expand Down Expand Up @@ -51,7 +53,7 @@ lerna run build
For a specific package:

```
lerna run --scope @gnosis.pm/safe-apps-sdk build --stream
lerna run --scope @safe-global/safe-apps-sdk build --stream
```

`--stream` options enables command output. By default, lerna displays it only in case of an error.
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"node": ">=16.x"
},
"scripts": {
"start:test-app": "yarn workspace @gnosis.pm/safe-apps-test-app start",
"build:sdk": "lerna run --scope @gnosis.pm/safe-apps-sdk build --stream",
"test:sdk": "lerna run --scope @gnosis.pm/safe-apps-sdk test --stream",
"start:test-app": "yarn workspace @safe-global/safe-apps-test-app start",
"build:sdk": "lerna run --scope @safe-global/safe-apps-sdk build --stream",
"test:sdk": "lerna run --scope @safe-global/safe-apps-sdk test --stream",
"release": "lerna run build && changeset publish",
"lint:check": "eslint './packages/**/*.{js,jsx,ts,tsx}'"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/cra-template-safe-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This [CRA template](https://create-react-app.dev/docs/custom-templates/) provide
## Getting started

- Create a new React app using this template
- `npx create-react-app my-safe-app --template @gnosis.pm/cra-template-safe-app`
- `npx create-react-app my-safe-app --template @safe-global/cra-template-safe-app`
- Open your new app
- `cd my-safe-app`
- Follow the [README](template/README.md) of your Safe app
Expand Down
2 changes: 1 addition & 1 deletion packages/cra-template-safe-app/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@gnosis.pm/cra-template-safe-app",
"name": "@safe-global/cra-template-safe-app",
"version": "4.2.1",
"description": "Safe App Starter",
"author": "Safe (https://safe.global)",
Expand Down
2 changes: 1 addition & 1 deletion packages/cra-template-safe-app/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"package": {
"homepage": "./",
"dependencies": {
"@gnosis.pm/safe-apps-react-sdk": "^4.6.2",
"@safe-global/safe-apps-react-sdk": "^4.6.2",
"@gnosis.pm/safe-react-components": "^1.2.0",
"@material-ui/core": "^4.12.4",
"react": "^17.0.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/cra-template-safe-app/template/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useCallback } from 'react'
import styled from 'styled-components'
import { Button, Title } from '@gnosis.pm/safe-react-components'
import { useSafeAppsSDK } from '@gnosis.pm/safe-apps-react-sdk'
import { useSafeAppsSDK } from '@safe-global/safe-apps-react-sdk'

const Container = styled.div`
padding: 1rem;
Expand Down
2 changes: 1 addition & 1 deletion packages/cra-template-safe-app/template/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react'
import ReactDOM from 'react-dom'
import { ThemeProvider } from 'styled-components'
import { theme, Loader, Title } from '@gnosis.pm/safe-react-components'
import SafeProvider from '@gnosis.pm/safe-apps-react-sdk'
import SafeProvider from '@safe-global/safe-apps-react-sdk'

import GlobalStyle from './GlobalStyle'
import App from './App'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { FC, ReactElement } from 'react'
import { render, RenderOptions, RenderResult } from '@testing-library/react'
import { ThemeProvider } from 'styled-components'
import { theme, Title } from '@gnosis.pm/safe-react-components'
import SafeProvider from '@gnosis.pm/safe-apps-react-sdk'
import SafeProvider from '@safe-global/safe-apps-react-sdk'

type Props = {
children: React.ReactNode
Expand Down
14 changes: 7 additions & 7 deletions packages/safe-apps-provider/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Safe Apps Provider

[![npm](https://img.shields.io/npm/v/@gnosis.pm/safe-apps-provider)](https://www.npmjs.com/package/@gnosis.pm/safe-apps-provider)
[![npm](https://img.shields.io/npm/v/@safe-global/safe-apps-provider)](https://www.npmjs.com/package/@safe-global/safe-apps-provider)

This is a provider that follows common standards (e.g. [EIP-1193](https://eips.ethereum.org/EIPS/eip-1193)) and can be used with various Web3 libraries (e.g. web3.js or Ethers)

Expand All @@ -9,9 +9,9 @@ This is a provider that follows common standards (e.g. [EIP-1193](https://eips.e
- Add npm package

```bash
yarn add @gnosis.pm/safe-apps-provider
yarn add @safe-global/safe-apps-provider

npm i @gnosis.pm/safe-apps-provider
npm i @safe-global/safe-apps-provider
```

### SafeAppProvider
Expand All @@ -25,8 +25,8 @@ The provider can be used with the [safe-apps-react-sdk](https://github.com/safe-
```js
import React, { useMemo } from 'react';
import { ethers } from 'ethers';
import { useSafeAppsSDK } from '@gnosis.pm/safe-apps-react-sdk';
import { SafeAppProvider } from '@gnosis.pm/safe-apps-provider';
import { useSafeAppsSDK } from '@safe-global/safe-apps-react-sdk';
import { SafeAppProvider } from '@safe-global/safe-apps-provider';

const App = () => {
const { sdk, safe } = useSafeAppsSDK();
Expand All @@ -47,8 +47,8 @@ export default App;
```js
import React, { useMemo } from 'react';
import Web3 from 'web3';
import { useSafeAppsSDK } from '@gnosis.pm/safe-apps-react-sdk';
import { SafeAppProvider } from '@gnosis.pm/safe-apps-provider';
import { useSafeAppsSDK } from '@safe-global/safe-apps-react-sdk';
import { SafeAppProvider } from '@safe-global/safe-apps-provider';

const App = () => {
const { sdk, safe } = useSafeAppsSDK();
Expand Down
2 changes: 1 addition & 1 deletion packages/safe-apps-provider/dist/provider.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/// <reference types="node" />
import SafeAppsSDK, { SafeInfo } from '@gnosis.pm/safe-apps-sdk';
import SafeAppsSDK, { SafeInfo } from '@safe-global/safe-apps-sdk';
import { EventEmitter } from 'events';
import { EIP1193Provider } from './types';
export declare class SafeAppProvider extends EventEmitter implements EIP1193Provider {
Expand Down
4 changes: 2 additions & 2 deletions packages/safe-apps-provider/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@gnosis.pm/safe-apps-provider",
"name": "@safe-global/safe-apps-provider",
"version": "0.15.1",
"description": "A provider wrapper of Safe Apps SDK",
"main": "dist/index.js",
Expand All @@ -25,7 +25,7 @@
},
"homepage": "https://github.com/safe-global/safe-apps-sdk#readme",
"dependencies": {
"@gnosis.pm/safe-apps-sdk": "7.8.0",
"@safe-global/safe-apps-sdk": "7.8.0",
"events": "^3.3.0"
},
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/safe-apps-provider/src/provider.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import SafeAppsSDK, { SafeInfo, Web3TransactionObject } from '@gnosis.pm/safe-apps-sdk';
import SafeAppsSDK, { SafeInfo, Web3TransactionObject } from '@safe-global/safe-apps-sdk';
import { EventEmitter } from 'events';
import { EIP1193Provider } from './types';
import { getLowerCase } from './utils';
Expand Down
12 changes: 6 additions & 6 deletions packages/safe-apps-react-sdk/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Safe Apps React SDK

[![npm](https://img.shields.io/npm/v/@gnosis.pm/safe-apps-react-sdk)](https://www.npmjs.com/package/@gnosis.pm/safe-apps-react-sdk)
[![npm](https://img.shields.io/npm/v/@safe-global/safe-apps-react-sdk)](https://www.npmjs.com/package/@safe-global/safe-apps-react-sdk)

This SDK should provide a simple way to write a React.js [Safe app](https://docs.gnosis-safe.io/build/sdks/safe-apps)

Expand All @@ -9,17 +9,17 @@ This SDK should provide a simple way to write a React.js [Safe app](https://docs
- Add npm package

```bash
yarn add @gnosis.pm/safe-apps-react-sdk
yarn add @safe-global/safe-apps-react-sdk

npm i @gnosis.pm/safe-apps-react-sdk
npm i @safe-global/safe-apps-react-sdk
```

- Add `SafeProvider`
Safe provider accepts `loader` and `options` props

```js
// ... other imports
import SafeProvider from '@gnosis.pm/safe-apps-react-sdk';
import SafeProvider from '@safe-global/safe-apps-react-sdk';

ReactDOM.render(
<React.StrictMode>
Expand All @@ -35,7 +35,7 @@ ReactDOM.render(

```js
// ... other imports
import { useSafeAppsSDK } from '@gnosis.pm/safe-apps-react-sdk';
import { useSafeAppsSDK } from '@safe-global/safe-apps-react-sdk';

const App = () => {
const { sdk, connected, safe } = useSafeAppsSDK();
Expand All @@ -48,7 +48,7 @@ const App = () => {
#### Send transactions

```js
import { BaseTransaction } from '@gnosis.pm/safe-apps-sdk'
import { BaseTransaction } from '@safe-global/safe-apps-sdk'

const txs: BaseTransaction[] = [
{
Expand Down
2 changes: 1 addition & 1 deletion packages/safe-apps-react-sdk/dist/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ReactElement } from 'react';
import SafeAppsSDK, { Opts as SDKOpts, SafeInfo } from '@gnosis.pm/safe-apps-sdk';
import SafeAppsSDK, { Opts as SDKOpts, SafeInfo } from '@safe-global/safe-apps-sdk';
type SafeReactSDKContext = {
sdk: SafeAppsSDK;
connected: boolean;
Expand Down
2 changes: 1 addition & 1 deletion packages/safe-apps-react-sdk/dist/index.js

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

2 changes: 1 addition & 1 deletion packages/safe-apps-react-sdk/dist/index.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-react-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@gnosis.pm/safe-apps-react-sdk",
"name": "@safe-global/safe-apps-react-sdk",
"private": false,
"version": "4.6.2",
"main": "dist/index.js",
Expand All @@ -13,7 +13,7 @@
"license": "MIT",
"author": "Safe (https://safe.global)",
"dependencies": {
"@gnosis.pm/safe-apps-sdk": "7.8.0"
"@safe-global/safe-apps-sdk": "7.8.0"
},
"peerDependencies": {
"react": "16.x.x || 17.x.x || 18.x.x"
Expand Down
2 changes: 1 addition & 1 deletion packages/safe-apps-react-sdk/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createContext, useState, useEffect, useContext, useMemo, ReactElement } from 'react';
import SafeAppsSDK, { Opts as SDKOpts, SafeInfo } from '@gnosis.pm/safe-apps-sdk';
import SafeAppsSDK, { Opts as SDKOpts, SafeInfo } from '@safe-global/safe-apps-sdk';

type SafeReactSDKContext = {
sdk: SafeAppsSDK;
Expand Down
10 changes: 5 additions & 5 deletions packages/safe-apps-sdk/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Safe Apps SDK

[![npm](https://img.shields.io/npm/v/@gnosis.pm/safe-apps-sdk)](https://www.npmjs.com/package/@gnosis.pm/safe-apps-sdk)
[![npm](https://img.shields.io/npm/v/@safe-global/safe-apps-sdk)](https://www.npmjs.com/package/@safe-global/safe-apps-sdk)

Software development kit to integrate third-party applications (Safe Apps) with Safe (https://app.safe.global/).

Expand All @@ -9,9 +9,9 @@ Software development kit to integrate third-party applications (Safe Apps) with
### Install the package with yarn or npm:

```bash
yarn add @gnosis.pm/safe-apps-sdk
yarn add @safe-global/safe-apps-sdk

npm install @gnosis.pm/safe-apps-sdk
npm install @safe-global/safe-apps-sdk
```

## Build
Expand Down Expand Up @@ -46,7 +46,7 @@ messages from all domains
`debug` - Boolean. If enabled, it will log outgoing/incoming messages.

```ts
import SafeAppsSDK from '@gnosis.pm/safe-apps-sdk';
import SafeAppsSDK from '@safe-global/safe-apps-sdk';

type Opts = {
allowedDomains?: RegExp[];
Expand Down Expand Up @@ -139,7 +139,7 @@ Sending a TX through the Safe is as simple as invoking `.txs.send()`

```js
// Create a web3 instance
const web3 = new Web3('https://rinkeby.infura.io/v3/token');
const web3 = new Web3('https://goerli.infura.io/v3/{YOUR_API_KEY}');
const contract = new web3.eth.Contract(abi, contractAddress);

const txs = [
Expand Down
2 changes: 1 addition & 1 deletion packages/safe-apps-sdk/dist/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@gnosis.pm/safe-apps-sdk",
"name": "@safe-global/safe-apps-sdk",
"version": "7.8.0",
"description": "SDK developed to integrate third-party apps with Safe app.",
"main": "dist/src/index.js",
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,5 +1,5 @@
{
"name": "@gnosis.pm/safe-apps-sdk",
"name": "@safe-global/safe-apps-sdk",
"version": "7.8.0",
"description": "SDK developed to integrate third-party apps with Safe app.",
"main": "dist/src/index.js",
Expand Down
4 changes: 2 additions & 2 deletions packages/safe-apps-test-app/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "@gnosis.pm/safe-apps-test-app",
"name": "@safe-global/safe-apps-test-app",
"version": "0.0.1",
"description": "Safe App for testing purposes",
"author": "Safe (https://safe.global)",
"license": "MIT",
"private": true,
"homepage": ".",
"dependencies": {
"@gnosis.pm/safe-apps-sdk": "^7.8.0",
"@safe-global/safe-apps-sdk": "^7.8.0",
"@material-ui/core": "^4.12.4",
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/react": "^13.4.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/safe-apps-test-app/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useState, useEffect } from 'react';
import styled from 'styled-components';
import { Spinner, Heading, SegmentedControl } from 'evergreen-ui';
import SafeAppsSDK, { SafeInfo } from '@gnosis.pm/safe-apps-sdk';
import SafeAppsSDK, { SafeInfo } from '@safe-global/safe-apps-sdk';
import { AppTabs } from './types';
import Main from './tabs/Main';
import RpcCalls from './tabs/RpcCalls';
Expand Down
2 changes: 1 addition & 1 deletion packages/safe-apps-test-app/src/tabs/Main.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useState } from 'react';
import { Button, TextInput, Textarea, Text } from 'evergreen-ui';
import SdkInstance, {isObjectEIP712TypedData, SafeInfo} from '@gnosis.pm/safe-apps-sdk';
import SdkInstance, {isObjectEIP712TypedData, SafeInfo} from '@safe-global/safe-apps-sdk';

type OwnProps = {
sdk: SdkInstance;
Expand Down
2 changes: 1 addition & 1 deletion packages/safe-apps-test-app/src/tabs/RpcCalls/Call.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useState } from "react"
import styled from "styled-components"
import { Button, Textarea, Text } from "evergreen-ui"
import SdkInstance from "@gnosis.pm/safe-apps-sdk"
import SdkInstance from "@safe-global/safe-apps-sdk"

const Container = styled.div`
display: flex;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useState } from "react"
import styled from "styled-components"
import { Button, TextInput, Text } from "evergreen-ui"
import SdkInstance from "@gnosis.pm/safe-apps-sdk"
import SdkInstance from "@safe-global/safe-apps-sdk"

const Container = styled.div`
display: flex;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useState } from "react"
import styled from "styled-components"
import { Button, TextInput, Text } from "evergreen-ui"
import SdkInstance from "@gnosis.pm/safe-apps-sdk"
import SdkInstance from "@safe-global/safe-apps-sdk"

const Container = styled.div`
display: flex;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useState } from "react"
import styled from "styled-components"
import { Button, TextInput, Text } from "evergreen-ui"
import SdkInstance from "@gnosis.pm/safe-apps-sdk"
import SdkInstance from "@safe-global/safe-apps-sdk"

const Container = styled.div`
display: flex;
Expand Down
Loading

0 comments on commit d719e9a

Please sign in to comment.