Skip to content

Commit

Permalink
Merge branch 'development' into safe-deployment-refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
dasanra committed Sep 25, 2024
2 parents f493ef4 + 2f60640 commit 332cafa
Show file tree
Hide file tree
Showing 408 changed files with 2,468 additions and 19,302 deletions.
5 changes: 2 additions & 3 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@ Please describe concisely the bug you have found.
- Safe Core SDK versions:
<!-- Please leave empty or delete those that you don't use. -->
- api-kit:
- auth-kit:
- onramp-kit
- protocol-kit:
- relay-kit:
- safe-core-sdk-types:
- types-kit:
- sdk-starter-kit:
- Safe contract version:
- Environment:
- browser
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/protocol-kit-e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ jobs:
- name: Test ${{ matrix.provider }} - Safe ${{ matrix.contract-version }}
run: |
cd packages/protocol-kit
ls -la $(pwd)/node_modules/.bin
yarn test:hardhat:${{ matrix.provider }}:${{ matrix.contract-version }}
2 changes: 0 additions & 2 deletions .github/workflows/sdk-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,5 @@ jobs:
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
files: packages/api-kit/coverage/lcov.info
packages/auth-kit/coverage/lcov.info
packages/onramp-kit/coverage/lcov.info
packages/relay-kit/coverage/lcov.info
packages/sdk-starter-kit/coverage/lcov.info
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ If you want to develop using Safe Smart Accounts in a Javascript/Typescript app,
| [protocol-kit](https://github.com/safe-global/safe-core-sdk/tree/main/packages/protocol-kit) | [![npm Version](https://badge.fury.io/js/%40safe-global%2Fprotocol-kit.svg)](https://badge.fury.io/js/%40safe-global%2Fprotocol-kit) | TypeScript library that facilitates the interaction with [Safe Smart Accounts](https://github.com/safe-global/safe-smart-account). Can be used to create new Safe accounts, update the configuration of existing Safes, create and execute transactions, among other features. |
| [api-kit](https://github.com/safe-global/safe-core-sdk/tree/main/packages/api-kit) | [![npm Version](https://badge.fury.io/js/%40safe-global%2Fapi-kit.svg)](https://badge.fury.io/js/%40safe-global%2Fapi-kit) | [Safe Transaction Service API](https://github.com/safe-global/safe-transaction-service) typescript library. Allows to propose and share transactions with the other signers of a Safe, sending the signatures to the service to collect them, and getting information about a Safe, among other features. |
| [relay-kit](https://github.com/safe-global/safe-core-sdk/tree/main/packages/relay-kit) | ​​​[![npm Version](https://badge.fury.io/js/%40safe-global%2Frelay-kit.svg)](https://badge.fury.io/js/%40safe-global%2Frelay-kit)| Typescript library that enables ERC-4337 with Safe and allows users to pay for the transaction fees from their Safe account balance using the blockchain native token or ERC-20 tokens, or to get their transactions sponsored. |
| [safe-core-sdk-types](https://github.com/safe-global/safe-core-sdk/tree/main/packages/safe-core-sdk-types) | [![npm Version](https://badge.fury.io/js/%40safe-global%2Fsafe-core-sdk-types.svg)](https://badge.fury.io/js/%40safe-global%2Fsafe-core-sdk-types) | Common types used in the [Safe Core SDK](https://github.com/safe-global/safe-core-sdk/tree/main/packages) packages. |
| [auth-kit](https://github.com/safe-global/safe-core-sdk/tree/main/packages/auth-kit) | [![npm Version](https://badge.fury.io/js/%40safe-global%2Fauth-kit.svg)](https://badge.fury.io/js/%40safe-global%2Fauth-kit) | Typescript library to create an Ethereum address and authenticating a blockchain account using an email address, social media account, or traditional crypto wallets like Metamask. |
| [onramp-kit](https://github.com/safe-global/safe-core-sdk/tree/main/packages/onramp-kit) | [![npm Version](https://badge.fury.io/js/%40safe-global%2Fonramp-kit.svg)](https://badge.fury.io/js/%40safe-global%2Fonramp-kit) | Typescript library that allows users to buy cryptocurrencies using a credit card and other payment options. |
| [types-kit](https://github.com/safe-global/safe-core-sdk/tree/main/packages/types-kit) | [![npm Version](https://badge.fury.io/js/%40safe-global%2Ftypes-kit.svg)](https://badge.fury.io/js/%40safe-global%2Ftypes-kit) | Common types used in the [Safe Core SDK](https://github.com/safe-global/safe-core-sdk/tree/main/packages) packages. |

## Guides

Expand Down
2 changes: 1 addition & 1 deletion guides/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Read about the basics of Safe and [how it compares to other solutions](https://h
The [Safe Core SDK](https://github.com/safe-global/safe-core-sdk) is a monorepo that contains software developer tools that allows interaction with [Safe Smart Accounts](https://github.com/safe-global/safe-smart-account) and the [Safe Transaction Service API](https://github.com/safe-global/safe-transaction-service).

In this guide we will use the following packages to deploy new Safes, create transactions, collect off-chain signatures and execute transactions:
* **safe-core-sdk-types**
* **types-kit**

Contains the types that are shared among the different packages inside the monorepo.

Expand Down
4 changes: 2 additions & 2 deletions guides/integrating-the-safe-core-sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
To integrate the [Safe Core SDK](https://github.com/safe-global/safe-core-sdk) into your Dapp or script you will need to install these dependencies:

```
@safe-global/safe-core-sdk-types
@safe-global/types-kit
@safe-global/protocol-kit
@safe-global/api-kit
```
Expand Down Expand Up @@ -134,7 +134,7 @@ When the array contains only one transaction, it is not wrapped in the MultiSend

```js
import { SafeTransactionOptionalProps } from '@safe-global/protocol-kit'
import { MetaTransactionData } from '@safe-global/safe-core-sdk-types'
import { MetaTransactionData } from '@safe-global/types-kit'

const transactions: MetaTransactionData[] = [
{
Expand Down
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@
"author": "Safe (https://safe.global)",
"license": "MIT",
"devDependencies": {
"@types/jest": "^29.5.12",
"@types/jest": "^29.5.13",
"@types/node": "^20.14.5",
"@typescript-eslint/eslint-plugin": "^7.13.1",
"@typescript-eslint/parser": "^7.13.1",
"@typescript-eslint/eslint-plugin": "^7.18.0",
"@typescript-eslint/parser": "^7.18.0",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"husky": "^9.0.11",
"eslint-plugin-prettier": "^5.2.1",
"husky": "^9.1.6",
"jest": "^29.7.0",
"lerna": "^8.1.3",
"lint-staged": "^15.2.7",
"prettier": "^3.3.2",
"lerna": "^8.1.8",
"lint-staged": "^15.2.10",
"prettier": "^3.3.3",
"rimraf": "^3.0.2",
"ts-jest": "^29.1.5",
"ts-node": "^10.9.2",
Expand Down
2 changes: 0 additions & 2 deletions packages/api-kit/.env.example

This file was deleted.

52 changes: 0 additions & 52 deletions packages/api-kit/hardhat.config.ts

This file was deleted.

33 changes: 15 additions & 18 deletions packages/api-kit/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@safe-global/api-kit",
"version": "2.4.5",
"version": "2.4.6",
"description": "SDK that facilitates the interaction with the Safe Transaction Service API",
"main": "dist/src/index.js",
"typings": "dist/src/index.d.ts",
Expand All @@ -12,13 +12,13 @@
"API"
],
"scripts": {
"test:web3": "export TESTS_PATH=tests/endpoint && export ETH_LIB=web3 && nyc --reporter=lcov hardhat test",
"test:ethers": "export TESTS_PATH=tests/endpoint && export ETH_LIB=ethers && nyc --reporter=lcov hardhat test",
"test:viem": "export TESTS_PATH=tests/endpoint && export ETH_LIB=viem && nyc --reporter=lcov hardhat test",
"test:web3": "export HARDHAT_NETWORK=sepolia && export ETH_LIB=web3 && nyc --reporter=lcov testing-kit test 'tests/endpoint/*.test.*'",
"test:ethers": "export HARDHAT_NETWORK=sepolia && export ETH_LIB=ethers && nyc --reporter=lcov testing-kit test 'tests/endpoint/*.test.*'",
"test:viem": "export HARDHAT_NETWORK=sepolia && export ETH_LIB=viem && nyc --reporter=lcov testing-kit test 'tests/endpoint/*.test.*'",
"test": "yarn test:viem",
"test:ci:web3": "export TESTS_PATH=tests/e2e && export ETH_LIB=web3 && nyc --reporter=lcov hardhat test",
"test:ci:ethers": "export TESTS_PATH=tests/e2e && export ETH_LIB=ethers && nyc --reporter=lcov hardhat test",
"test:ci:viem": "export TESTS_PATH=tests/e2e && export ETH_LIB=viem && nyc --reporter=lcov hardhat test",
"test:ci:web3": "export HARDHAT_NETWORK=sepolia && export ETH_LIB=web3 && nyc --reporter=lcov testing-kit test 'tests/e2e/*.test.*'",
"test:ci:ethers": "export HARDHAT_NETWORK=sepolia && export ETH_LIB=ethers && nyc --reporter=lcov testing-kit test 'tests/e2e/*.test.*'",
"test:ci:viem": "export HARDHAT_NETWORK=sepolia && export ETH_LIB=viem && nyc --reporter=lcov testing-kit test 'tests/e2e/*.test.*'",
"test:ci": "yarn test:ci:viem",
"format:check": "prettier --check \"*/**/*.{js,json,md,ts}\"",
"format": "prettier --write \"*/**/*.{js,json,md,ts}\"",
Expand All @@ -39,31 +39,28 @@
],
"homepage": "https://github.com/safe-global/safe-core-sdk#readme",
"devDependencies": {
"@nomicfoundation/hardhat-viem": "^2.0.2",
"@safe-global/relay-kit": "^3.1.0",
"@types/chai": "^4.3.16",
"@safe-global/testing-kit": "^0.0.1-alpha.1",
"@types/chai": "^4.3.19",
"@types/chai-as-promised": "^7.1.8",
"@types/mocha": "^10.0.6",
"@types/mocha": "^10.0.8",
"@types/node-fetch": "^2.6.11",
"@types/sinon-chai": "^3.2.11",
"@types/yargs": "^17.0.32",
"chai": "^4.3.10",
"chai-as-promised": "^7.1.1",
"ethers": "^6.13.1",
"hardhat": "2.20.1",
"ethers": "^6.13.2",
"mocha": "^10.2.0",
"nyc": "^15.1.0",
"semver": "^7.6.1",
"sinon": "^14.0.2",
"sinon-chai": "^3.7.0",
"tsconfig-paths": "^4.2.0",
"web3": "^4.7.0",
"yargs": "^17.7.2"
"web3": "^4.12.1"
},
"dependencies": {
"@safe-global/protocol-kit": "^4.1.0",
"@safe-global/safe-core-sdk-types": "^5.1.0",
"@safe-global/protocol-kit": "^4.1.1",
"@safe-global/types-kit": "^1.0.0",
"node-fetch": "^2.7.0",
"viem": "^2.19.0"
"viem": "^2.21.8"
}
}
2 changes: 1 addition & 1 deletion packages/api-kit/src/SafeApiKit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import {
SafeOperation,
SafeOperationConfirmationListResponse,
SafeOperationResponse
} from '@safe-global/safe-core-sdk-types'
} from '@safe-global/types-kit'
import { TRANSACTION_SERVICE_URLS } from './utils/config'
import { isEmptyData } from './utils'
import { getAddSafeOperationProps } from './utils/safeOperation'
Expand Down
2 changes: 1 addition & 1 deletion packages/api-kit/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export * from './types/safeTransactionServiceTypes'
export { SafeApiKitConfig }
export default SafeApiKit

declare module 'viem/node_modules/abitype' {
declare module 'abitype' {
export interface Register {
AddressType: string
}
Expand Down
5 changes: 3 additions & 2 deletions packages/api-kit/src/types/safeTransactionServiceTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
UserOperation,
SafeOperationResponse,
ListResponse
} from '@safe-global/safe-core-sdk-types'
} from '@safe-global/types-kit'

export type ListOptions = {
/** Maximum number of results to return per page */
Expand Down Expand Up @@ -248,6 +248,7 @@ export type AddMessageProps = {
}

export type GetSafeMessageListProps = {
/** Which field to use when ordering the results. It can be: `created`, `modified` (default: `-created`) */
ordering?: string
} & ListOptions

Expand All @@ -260,7 +261,7 @@ export type EIP712TypedData = {
export type GetSafeOperationListProps = {
/** Address of the Safe to get SafeOperations for */
safeAddress: string
/** Which field to use when ordering the results */
/** Which field to use when ordering the results. It can be: `user_operation__nonce`, `created` (default: `-user_operation__nonce`) */
ordering?: string
} & ListOptions

Expand Down
2 changes: 1 addition & 1 deletion packages/api-kit/src/utils/safeOperation.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SafeOperation } from '@safe-global/safe-core-sdk-types'
import { SafeOperation } from '@safe-global/types-kit'

export const getAddSafeOperationProps = async (safeOperation: SafeOperation) => {
const userOperation = safeOperation.toUserOperation()
Expand Down
2 changes: 1 addition & 1 deletion packages/api-kit/tests/e2e/addMessageSignature.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Safe, {
SigningMethod,
buildContractSignature
} from '@safe-global/protocol-kit'
import { SafeMessage } from '@safe-global/safe-core-sdk-types'
import { SafeMessage } from '@safe-global/types-kit'
import SafeApiKit from '@safe-global/api-kit/index'
import chai from 'chai'
import chaiAsPromised from 'chai-as-promised'
Expand Down
2 changes: 1 addition & 1 deletion packages/api-kit/tests/e2e/confirmSafeOperation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { BundlerClient, Safe4337InitOptions, Safe4337Pack } from '@safe-global/r
import { generateTransferCallData } from '@safe-global/relay-kit/packs/safe-4337/testing-utils/helpers'
import SafeApiKit from '@safe-global/api-kit/index'
import { getAddSafeOperationProps } from '@safe-global/api-kit/utils/safeOperation'
import { SafeOperation } from '@safe-global/safe-core-sdk-types'
import { SafeOperation } from '@safe-global/types-kit'
// Needs to be imported from dist folder in order to mock the getEip4337BundlerProvider function
import * as safe4337Utils from '@safe-global/relay-kit/dist/src/packs/safe-4337/utils'
import { getApiKit, getEip1193Provider } from '../utils/setupKits'
Expand Down
2 changes: 1 addition & 1 deletion packages/api-kit/tests/e2e/confirmTransaction.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Safe, {
import {
SafeMultisigConfirmationResponse,
SafeTransactionDataPartial
} from '@safe-global/safe-core-sdk-types'
} from '@safe-global/types-kit'
import SafeApiKit from '@safe-global/api-kit/index'
import chai from 'chai'
import chaiAsPromised from 'chai-as-promised'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import SafeApiKit from '@safe-global/api-kit/index'
import { SafeOperationResponse } from '@safe-global/safe-core-sdk-types'
import { SafeOperationResponse } from '@safe-global/types-kit'
import chai from 'chai'
import chaiAsPromised from 'chai-as-promised'
import { getApiKit } from '../utils/setupKits'
Expand Down
2 changes: 1 addition & 1 deletion packages/api-kit/tests/endpoint/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import SafeApiKit, {
} from '@safe-global/api-kit/index'
import * as httpRequests from '@safe-global/api-kit/utils/httpRequests'
import Safe from '@safe-global/protocol-kit'
import { UserOperation } from '@safe-global/safe-core-sdk-types'
import { UserOperation } from '@safe-global/types-kit'
import { signDelegate } from '@safe-global/api-kit/utils/signDelegate'
import config from '../utils/config'
import { getApiKit, getKits } from '../utils/setupKits'
Expand Down
2 changes: 1 addition & 1 deletion packages/api-kit/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
"composite": true,
"outDir": "dist"
},
"include": ["src/**/*", "tests/**/*", "hardhat.config.ts"]
"include": ["src/**/*", "tests/**/*"]
}
29 changes: 0 additions & 29 deletions packages/auth-kit/README.md

This file was deleted.

24 changes: 0 additions & 24 deletions packages/auth-kit/example/.gitignore

This file was deleted.

26 changes: 0 additions & 26 deletions packages/auth-kit/example/README.md

This file was deleted.

Loading

0 comments on commit 332cafa

Please sign in to comment.