Skip to content

Commit db232e0

Browse files
authored
Merge pull request #154 from gnosis/development
Development
2 parents 6b6588e + 6df1d2f commit db232e0

File tree

113 files changed

+3090
-4975
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+3090
-4975
lines changed

.github/workflows/e2e-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
runs-on: ubuntu-latest
1616
strategy:
1717
matrix:
18-
node-version: [14.x]
18+
node-version: [16.x]
1919
steps:
2020
- uses: actions/checkout@v2
2121
- name: Use Node.js ${{ matrix.node-version }}

.github/workflows/test.yml

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,29 @@ jobs:
77
runs-on: ubuntu-latest
88
strategy:
99
matrix:
10-
node-version: [14.x]
10+
node-version: [16.x]
1111
steps:
1212
- uses: actions/checkout@v2
1313
- name: Use Node.js ${{ matrix.node-version }}
1414
uses: actions/setup-node@v1
1515
with:
1616
node-version: ${{ matrix.node-version }}
17-
- run: |
18-
yarn install
19-
yarn build
20-
yarn test
17+
18+
- name: Yarn cache
19+
uses: actions/cache@v2
20+
with:
21+
path: '**/node_modules'
22+
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
23+
24+
- name: Yarn install
25+
run: |
26+
mkdir .yarncache
27+
yarn install --cache-folder ./.yarncache --frozen-lockfile
28+
rm -rf .yarncache
29+
yarn cache clean
30+
31+
- name: Build
32+
run: yarn build
33+
34+
- name: Test
35+
run: yarn test

.github/workflows/test_V1_2_0.yml renamed to .github/workflows/test_ethers_V1_2_0.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Safe Core SDK Test (Safe v1.2.0)
1+
name: Safe Core SDK Test - Ethers - Safe v1.2.0
22
on: [push, pull_request]
33
env:
44
INFURA_KEY: ${{ secrets.INFURA_KEY }}
@@ -7,7 +7,7 @@ jobs:
77
runs-on: ubuntu-latest
88
strategy:
99
matrix:
10-
node-version: [14.x]
10+
node-version: [16.x]
1111
steps:
1212
- uses: actions/checkout@v2
1313
- name: Use Node.js ${{ matrix.node-version }}

.github/workflows/test_V1_3_0.yml renamed to .github/workflows/test_ethers_V1_3_0.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Safe Core SDK Test (Safe v1.3.0)
1+
name: Safe Core SDK Test - Ethers - Safe v1.3.0
22
on: [push, pull_request]
33
env:
44
INFURA_KEY: ${{ secrets.INFURA_KEY }}
@@ -7,7 +7,7 @@ jobs:
77
runs-on: ubuntu-latest
88
strategy:
99
matrix:
10-
node-version: [14.x]
10+
node-version: [16.x]
1111
steps:
1212
- uses: actions/checkout@v2
1313
- name: Use Node.js ${{ matrix.node-version }}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Safe Core SDK Test - Web3 - Safe v1.2.0
2+
on: [push, pull_request]
3+
env:
4+
INFURA_KEY: ${{ secrets.INFURA_KEY }}
5+
jobs:
6+
test:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
node-version: [16.x]
11+
steps:
12+
- uses: actions/checkout@v2
13+
- name: Use Node.js ${{ matrix.node-version }}
14+
uses: actions/setup-node@v1
15+
with:
16+
node-version: ${{ matrix.node-version }}
17+
- run: |
18+
yarn install
19+
yarn build
20+
cd packages/safe-core-sdk
21+
yarn test:hardhat:web3:v1.2.0
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Safe Core SDK Test - Web3 - Safe v1.3.0
2+
on: [push, pull_request]
3+
env:
4+
INFURA_KEY: ${{ secrets.INFURA_KEY }}
5+
jobs:
6+
test:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
node-version: [16.x]
11+
steps:
12+
- uses: actions/checkout@v2
13+
- name: Use Node.js ${{ matrix.node-version }}
14+
uses: actions/setup-node@v1
15+
with:
16+
node-version: ${{ matrix.node-version }}
17+
- run: |
18+
yarn install
19+
yarn build
20+
cd packages/safe-core-sdk
21+
yarn test:hardhat:web3:v1.3.0

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2021 Gnosis Ltd
3+
Copyright (c) 2021-2022 Gnosis Ltd
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
66

README.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,9 @@ Software developer tools that facilitate the interaction with the Gnosis Safe [c
66

77
| Package | Release | Description |
88
| ------- | :-----: | ----------- |
9-
| [safe-core-sdk](https://github.com/gnosis/safe-core-sdk/tree/master/packages/safe-core-sdk) | [![NPM Version](https://badge.fury.io/js/%40gnosis.pm%2Fsafe-core-sdk.svg)](https://badge.fury.io/js/%40gnosis.pm%2Fsafe-core-sdk) | TypeScript library that facilitates the interaction with the [Gnosis Safe contracts](https://github.com/gnosis/safe-contracts) |
10-
[safe-core-sdk-types](https://github.com/gnosis/safe-core-sdk/tree/master/packages/safe-core-sdk-types) | [![NPM Version](https://badge.fury.io/js/%40gnosis.pm%2Fsafe-core-sdk-types.svg)](https://badge.fury.io/js/%40gnosis.pm%2Fsafe-core-sdk-types) | Common types extracted from the [Safe Core SDK](https://github.com/gnosis/safe-core-sdk/tree/master/packages/safe-core-sdk) |
11-
[safe-service-client](https://github.com/gnosis/safe-core-sdk/tree/master/packages/safe-service-client) | [![NPM Version](https://badge.fury.io/js/%40gnosis.pm%2Fsafe-service-client.svg)](https://badge.fury.io/js/%40gnosis.pm%2Fsafe-service-client) | [Safe Transaction Service API](https://github.com/gnosis/safe-transaction-service) client library |
12-
[safe-ethers-adapters](https://github.com/gnosis/safe-core-sdk/tree/master/packages/safe-ethers-adapters) | [![NPM Version](https://badge.fury.io/js/%40gnosis.pm%2Fsafe-ethers-adapters.svg)](https://badge.fury.io/js/%40gnosis.pm%2Fsafe-ethers-adapters) | [Ethers](https://docs.ethers.io/v5/single-page/) adapter that facilitates the interaction with the [Gnosis Safe Services](https://github.com/gnosis/safe-transaction-service) |
13-
<!--
14-
| [safe-core-sdk-app](https://github.com/gnosis/safe-core-sdk/tree/master/packages/safe-core-sdk-app) | - | Example Dapp that uses the [Safe Core SDK](https://github.com/gnosis/safe-core-sdk/tree/master/packages/safe-core-sdk) |
15-
|
16-
-->
9+
| [safe-core-sdk](https://github.com/gnosis/safe-core-sdk/tree/main/packages/safe-core-sdk) | [![NPM Version](https://badge.fury.io/js/%40gnosis.pm%2Fsafe-core-sdk.svg)](https://badge.fury.io/js/%40gnosis.pm%2Fsafe-core-sdk) | TypeScript library that facilitates the interaction with the [Gnosis Safe contracts](https://github.com/gnosis/safe-contracts) |
10+
[safe-core-sdk-types](https://github.com/gnosis/safe-core-sdk/tree/main/packages/safe-core-sdk-types) | [![NPM Version](https://badge.fury.io/js/%40gnosis.pm%2Fsafe-core-sdk-types.svg)](https://badge.fury.io/js/%40gnosis.pm%2Fsafe-core-sdk-types) | Common types extracted from the [Safe Core SDK](https://github.com/gnosis/safe-core-sdk/tree/main/packages) packages |
11+
[safe-ethers-lib](https://github.com/gnosis/safe-core-sdk/tree/main/packages/safe-ethers-lib) | [![NPM Version](https://badge.fury.io/js/%40gnosis.pm%2Fsafe-ethers-lib.svg)](https://badge.fury.io/js/%40gnosis.pm%2Fsafe-ethers-lib) | Ethers.js utilities and Safe contracts types (typechain ethers-v5) used to initialize the [Safe Core SDK](https://github.com/gnosis/safe-core-sdk/tree/main/packages/safe-core-sdk) |
12+
[safe-web3-lib](https://github.com/gnosis/safe-core-sdk/tree/main/packages/safe-web3-lib) | [![NPM Version](https://badge.fury.io/js/%40gnosis.pm%2Fsafe-web3-lib.svg)](https://badge.fury.io/js/%40gnosis.pm%2Fsafe-web3-lib) | Web3.js utilities and Safe contracts types (typechain web3-v1) used to initialize the [Safe Core SDK](https://github.com/gnosis/safe-core-sdk/tree/main/packages/safe-core-sdk) |
13+
[safe-service-client](https://github.com/gnosis/safe-core-sdk/tree/main/packages/safe-service-client) | [![NPM Version](https://badge.fury.io/js/%40gnosis.pm%2Fsafe-service-client.svg)](https://badge.fury.io/js/%40gnosis.pm%2Fsafe-service-client) | [Safe Transaction Service API](https://github.com/gnosis/safe-transaction-service) client library |
14+
[safe-ethers-adapters](https://github.com/gnosis/safe-core-sdk/tree/main/packages/safe-ethers-adapters) | [![NPM Version](https://badge.fury.io/js/%40gnosis.pm%2Fsafe-ethers-adapters.svg)](https://badge.fury.io/js/%40gnosis.pm%2Fsafe-ethers-adapters) | [Ethers](https://docs.ethers.io/v5/single-page/) adapter that facilitates the interaction with the [Gnosis Safe Services](https://github.com/gnosis/safe-transaction-service) |

package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@
44
"scripts": {
55
"clean": "lerna clean",
66
"unbuild": "lerna run unbuild",
7-
"build": "lerna run build --stream",
8-
"test": "FORCE_COLOR=1 lerna run test --stream",
9-
"test:ci": "FORCE_COLOR=1 lerna run test:ci --stream"
7+
"build": "lerna run build --stream --npm-client=yarn",
8+
"test": "FORCE_COLOR=1 lerna run test --stream --npm-client=yarn",
9+
"test:ci": "FORCE_COLOR=1 lerna run test:ci --stream --npm-client=yarn",
10+
"format": "lerna run format --npm-client=yarn",
11+
"postinstall": "cd packages/safe-ethers-lib; hardhat compile"
1012
},
1113
"workspaces": {
1214
"packages": [

packages/guides/integrating-the-safe-core-sdk.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ The [Safe Core SDK](https://github.com/gnosis/safe-core-sdk/tree/main/packages/s
4141

4242
* **Using ethers.js**
4343

44-
We can use the class `EthersAdapter` from `@gnosis.pm/safe-core-sdk` as the wrapper for `ethers.js`.
44+
We can use the class `EthersAdapter` from `@gnosis.pm/safe-ethers-lib` as the wrapper for `ethers.js`.
4545

4646
```js
47-
import { EthersAdapter } from '@gnosis.pm/safe-core-sdk'
47+
import EthersAdapter from '@gnosis.pm/safe-ethers-lib'
4848
import { ethers } from 'ethers'
4949

5050
const web3Provider = // ...
@@ -59,10 +59,10 @@ The [Safe Core SDK](https://github.com/gnosis/safe-core-sdk/tree/main/packages/s
5959

6060
* **Using web3.js**
6161

62-
We can use the class `Web3Adapter` from `@gnosis.pm/safe-core-sdk` as the wrapper for `web3.js`.
62+
We can use the class `Web3Adapter` from `@gnosis.pm/safe-web3-lib` as the wrapper for `web3.js`.
6363

6464
```js
65-
import { Web3Adapter } from '@gnosis.pm/safe-core-sdk'
65+
import Web3Adapter from '@gnosis.pm/safe-web3-lib'
6666
import Web3 from 'web3'
6767

6868
const ethAdapter = new Web3Adapter({
@@ -131,7 +131,7 @@ const safeAccountConfig: SafeAccountConfig = {
131131
threshold: 2,
132132
// ... (optional params)
133133
}
134-
const safeSdk = await safeFactory.deploySafe(safeAccountConfig)
134+
const safeSdk = await safeFactory.deploySafe({ safeAccountConfig })
135135
```
136136

137137
Calling the method `deploySafe` will deploy the desired Safe and return a Safe Core SDK initialized instance ready to be used.
@@ -213,6 +213,7 @@ Once we have the Safe transaction object we can share it with the other owners o
213213
- `safeTransaction`: The Safe transaction object returned from the method `createTransaction`. Make sure that this object includes the signature of the owner which is proposing it.
214214
- `safeTxHash`: The Safe transaction hash, calculated by calling the method `getTransactionHash` from the Safe Core SDK.
215215
- `senderAddress`: The Safe owner proposing the transaction.
216+
- `origin`: Optional string that allows to provide more information about the app proposing the transaction.
216217

217218
```js
218219
await safeSdk.signTransaction(safeTransaction)
@@ -221,7 +222,8 @@ await safeService.proposeTransaction({
221222
safeAddress,
222223
safeTransaction,
223224
safeTxHash,
224-
senderAddress
225+
senderAddress,
226+
origin
225227
})
226228
```
227229

0 commit comments

Comments
 (0)