Skip to content

Commit

Permalink
docs(README): add tests README and LICENSE
Browse files Browse the repository at this point in the history
  • Loading branch information
Rubilmax committed Oct 16, 2024
1 parent 5b8194d commit 6c9944c
Show file tree
Hide file tree
Showing 22 changed files with 264 additions and 75 deletions.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Morpho Labs

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:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
36 changes: 23 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,34 @@ A collection of Software Development Kits to ease interactions with the Morpho p

### Development

- [`@morpho-org/morpho-ts`](./packages/morpho-ts/README.md): TypeScript package to handle all things time & format-related
- [`@morpho-org/morpho-ts`](./packages/morpho-ts/): TypeScript package to handle all things time & format-related

- [`@morpho-org/blue-sdk`](./packages/blue-sdk/README.md): Framework-agnostic package that defines Morpho-related entity classes (such as `Market`, `Token`, `Vault`)
- [`@morpho-org/blue-sdk-viem`](./packages/blue-sdk-viem/README.md): Viem-based augmentation of `@morpho-org/blue-sdk-viem` that exports (and optionally injects) viem-based fetch methods
- [`@morpho-org/blue-sdk-ethers`](./packages/blue-sdk-ethers/README.md): Ethers-based augmentation of `@morpho-org/blue-sdk-ethers` that exports (and optionally injects) ethers-based fetch methods
- [`@morpho-org/blue-sdk-wagmi`](./packages/blue-sdk-wagmi/README.md): Wagmi-based package that exports Wagmi (React) hooks to fetch Morpho-related entities
- [`@morpho-org/blue-sdk`](./packages/blue-sdk/): Framework-agnostic package that defines Morpho-related entity classes (such as `Market`, `Token`, `Vault`)
- [`@morpho-org/blue-sdk-viem`](./packages/blue-sdk-viem/): Viem-based augmentation of `@morpho-org/blue-sdk-viem` that exports (and optionally injects) viem-based fetch methods
- [`@morpho-org/blue-sdk-ethers`](./packages/blue-sdk-ethers/): Ethers-based augmentation of `@morpho-org/blue-sdk-ethers` that exports (and optionally injects) ethers-based fetch methods
- [`@morpho-org/blue-sdk-wagmi`](./packages/blue-sdk-wagmi/): Wagmi-based package that exports Wagmi (React) hooks to fetch Morpho-related entities

- [`@morpho-org/simulation-sdk`](./packages/simulation-sdk/README.md): Framework-agnostic package that defines methods to simulate interactions on Morpho (such as `Supply`, `Borrow`) and Morpho Vaults (such as `Deposit`, `Withdraw`)
- [`@morpho-org/simulation-sdk-wagmi`](./packages/simulation-sdk-wagmi/README.md): Wagmi-based extension of `@morpho-org/simulation-sdk` that exports Wagmi (React) hooks to fetch simulation states
- [`@morpho-org/simulation-sdk`](./packages/simulation-sdk/): Framework-agnostic package that defines methods to simulate interactions on Morpho (such as `Supply`, `Borrow`) and Morpho Vaults (such as `Deposit`, `Withdraw`)
- [`@morpho-org/simulation-sdk-wagmi`](./packages/simulation-sdk-wagmi/): Wagmi-based extension of `@morpho-org/simulation-sdk` that exports Wagmi (React) hooks to fetch simulation states

- [`@morpho-org/bundler-sdk-viem`](./packages/bundler-sdk-viem/README.md): Viem-based extension of `@morpho-org/simulation-sdk` that exports utilities to transform simple interactions on Morpho (such as `Blue_Borrow`) and Morpho Vaults (such as `MetaMorpho_Deposit`) into the required bundles (with ERC20 approvals, transfers, etc) to submit to the bundler onchain
- [`@morpho-org/bundler-sdk-viem`](./packages/bundler-sdk-viem/): Viem-based extension of `@morpho-org/simulation-sdk` that exports utilities to transform simple interactions on Morpho (such as `Blue_Borrow`) and Morpho Vaults (such as `MetaMorpho_Deposit`) into the required bundles (with ERC20 approvals, transfers, etc) to submit to the bundler onchain

- [`@morpho-org/blue-api-sdk`](./packages/blue-api-sdk/README.md): GraphQL SDK that exports types from the [API's GraphQL schema](https://blue-api.morpho.org/graphql) and a useful Apollo cache controller
- [`@morpho-org/blue-api-sdk`](./packages/blue-api-sdk/): GraphQL SDK that exports types from the [API's GraphQL schema](https://blue-api.morpho.org/graphql) and a useful Apollo cache controller

### Testing

- [`@morpho-org/test`](./packages/test/README.md): Framework-agnostic package that exports utilities to build test fixtures and spawn anvil forks as child processes
- [`@morpho-org/test`](./packages/test/): Framework-agnostic package that exports utilities to build test fixtures and spawn anvil forks as child processes

- [`@morpho-org/test-viem`](./packages/test-viem/README.md): (Viem+vitest)-based package that defines utilities to spawn independent, concurrent anvil forks for each test, injecting the corresponding viem client as a test fixture
- [`@morpho-org/test-ethers`](./packages/test-ethers/README.md): Ethers-based extension of `@morpho-org/test-viem` that injects a test Ethers wallet as a test fixture alongside viem's anvil client
- [`@morpho-org/test-wagmi`](./packages/test-wagmi/README.md): Wagmi-based extension of `@morpho-org/test-viem` that injects a test Wagmi config as a test fixture alongside viem's anvil client
- [`@morpho-org/test-viem`](./packages/test-viem/): (Viem+vitest)-based package that defines utilities to spawn independent, concurrent anvil forks for each test, injecting the corresponding viem client as a test fixture
- [`@morpho-org/test-ethers`](./packages/test-ethers/): Ethers-based extension of `@morpho-org/test-viem` that injects a test Ethers wallet as a test fixture alongside viem's anvil client
- [`@morpho-org/test-wagmi`](./packages/test-wagmi/): Wagmi-based extension of `@morpho-org/test-viem` that injects a test Wagmi config as a test fixture alongside viem's anvil client

## Authors

- [@rubilmax](https://github.com/rubilmax) (rubilmax.eth, [Twitter](https://x.com/rubilmax))
- [@oumar-fall](https://github.com/oumar-fall) (oumix.eth)
- [@julien-devatom](https://github.com/oumar-fall) ([Twitter](https://x.com/julien_devatom))

## License

[MIT](/LICENSE) License
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,15 @@
"version": "0.0.0",
"description": "Collection of SDKs to interact with Morpho",
"repository": "[email protected]:morpho-org/sdks.git",
"author": "Morpho Association <[email protected]>",
"author": "Morpho Labs <[email protected]>",
"license": "MIT",
"type": "module",
"private": true,
"engines": {
"node": ">=22"
},
"packageManager": "[email protected]",
"workspaces": [
"packages/*"
],
"workspaces": ["packages/*"],
"scripts": {
"postinstall": "husky && yarn lint --write package.json packages/**/package.json",
"lint": "biome check",
Expand Down
6 changes: 2 additions & 4 deletions packages/blue-api-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
{
"name": "@morpho-org/blue-api-sdk",
"version": "2.0.0-alpha.10",
"author": "Morpho Association <[email protected]>",
"author": "Morpho Labs <[email protected]>",
"type": "module",
"main": "src/index.ts",
"files": [
"lib"
],
"files": ["lib"],
"scripts": {
"prepublish": "yarn build",
"codegen": "graphql-codegen --config codegen.ts",
Expand Down
6 changes: 2 additions & 4 deletions packages/blue-sdk-ethers/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
{
"name": "@morpho-org/blue-sdk-ethers",
"version": "2.0.0-alpha.10",
"author": "Morpho Association <[email protected]>",
"author": "Morpho Labs <[email protected]>",
"license": "MIT",
"type": "module",
"main": "src/index.ts",
"files": [
"lib"
],
"files": ["lib"],
"scripts": {
"prepublish": "yarn build",
"build": "tsc --build tsconfig.build.json"
Expand Down
6 changes: 2 additions & 4 deletions packages/blue-sdk-viem/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
{
"name": "@morpho-org/blue-sdk-viem",
"version": "2.0.0-alpha.10",
"author": "Morpho Association <[email protected]>",
"author": "Morpho Labs <[email protected]>",
"license": "MIT",
"main": "src/index.ts",
"type": "module",
"files": [
"lib"
],
"files": ["lib"],
"scripts": {
"prepublish": "yarn build",
"compile": "hardhat compile",
Expand Down
6 changes: 2 additions & 4 deletions packages/blue-sdk-wagmi/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
{
"name": "@morpho-org/blue-sdk-wagmi",
"version": "2.0.0-alpha.10",
"author": "Morpho Association <[email protected]>",
"author": "Morpho Labs <[email protected]>",
"license": "MIT",
"type": "module",
"main": "src/index.ts",
"files": [
"lib"
],
"files": ["lib"],
"scripts": {
"prepublish": "yarn build",
"build": "tsc --build tsconfig.build.json"
Expand Down
6 changes: 2 additions & 4 deletions packages/blue-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
{
"name": "@morpho-org/blue-sdk",
"version": "2.0.0-alpha.10",
"author": "Morpho Association <[email protected]>",
"author": "Morpho Labs <[email protected]>",
"license": "MIT",
"type": "module",
"main": "src/index.ts",
"files": [
"lib"
],
"files": ["lib"],
"scripts": {
"prepublish": "yarn build",
"build": "tsc --build tsconfig.build.json",
Expand Down
2 changes: 1 addition & 1 deletion packages/bundler-sdk-viem/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@morpho-org/bundler-sdk-viem",
"version": "2.0.0-alpha.10",
"author": "Morpho Association <[email protected]>",
"author": "Morpho Labs <[email protected]>",
"license": "MIT",
"type": "module",
"main": "src/index.ts",
Expand Down
7 changes: 2 additions & 5 deletions packages/liquidation-sdk-viem/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
{
"name": "@morpho-org/liquidation-sdk-viem",
"version": "2.0.0-alpha.10",
"author": "Morpho Association <[email protected]>",
"author": "Morpho Labs <[email protected]>",
"type": "module",
"main": "src/index.ts",
"files": [
"lib",
"examples"
],
"files": ["lib", "examples"],
"scripts": {
"prepublish": "yarn build",
"compile": "hardhat compile",
Expand Down
6 changes: 2 additions & 4 deletions packages/morpho-test/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
{
"name": "@morpho-org/morpho-test",
"version": "2.0.0-alpha.10",
"author": "Morpho Association <[email protected]>",
"author": "Morpho Labs <[email protected]>",
"type": "module",
"main": "src/index.ts",
"files": [
"lib"
],
"files": ["lib"],
"license": "MIT",
"scripts": {
"prepublish": "yarn build",
Expand Down
6 changes: 2 additions & 4 deletions packages/morpho-ts/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
{
"name": "@morpho-org/morpho-ts",
"version": "2.0.0-alpha.10",
"author": "Morpho Association <[email protected]>",
"author": "Morpho Labs <[email protected]>",
"license": "MIT",
"main": "src/index.ts",
"files": [
"lib"
],
"files": ["lib"],
"scripts": {
"prepublish": "yarn build",
"build": "tsc --build tsconfig.build.json"
Expand Down
6 changes: 2 additions & 4 deletions packages/simulation-sdk-wagmi/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
{
"name": "@morpho-org/simulation-sdk-wagmi",
"version": "2.0.0-alpha.10",
"author": "Morpho Association <[email protected]>",
"author": "Morpho Labs <[email protected]>",
"license": "MIT",
"type": "module",
"main": "src/index.ts",
"files": [
"lib"
],
"files": ["lib"],
"scripts": {
"prepublish": "yarn build",
"build": "tsc --build tsconfig.build.json"
Expand Down
6 changes: 2 additions & 4 deletions packages/simulation-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
{
"name": "@morpho-org/simulation-sdk",
"version": "2.0.0-alpha.10",
"author": "Morpho Association <[email protected]>",
"author": "Morpho Labs <[email protected]>",
"license": "MIT",
"type": "module",
"main": "src/index.ts",
"files": [
"lib"
],
"files": ["lib"],
"scripts": {
"prepublish": "yarn build",
"build": "tsc --build tsconfig.build.json"
Expand Down
48 changes: 48 additions & 0 deletions packages/test-ethers/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# @morpho-org/test-ethers

<a href="https://www.npmjs.com/package/@morpho-org/test-ethers">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/npm/v/@morpho-org/test-ethers?colorA=21262d&colorB=21262d&style=flat">
<img src="https://img.shields.io/npm/v/@morpho-org/test-ethers?colorA=f6f8fa&colorB=f6f8fa&style=flat" alt="Version">
</picture>
</a>
<a href="https://github.com/wevm/@morpho-org/test-ethers/blob/main/LICENSE">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/npm/l/@morpho-org/test-ethers?colorA=21262d&colorB=21262d&style=flat">
<img src="https://img.shields.io/npm/l/@morpho-org/test-ethers?colorA=f6f8fa&colorB=f6f8fa&style=flat" alt="MIT License">
</picture>
</a>
<a href="https://www.npmjs.com/package/@morpho-org/test-ethers">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/npm/dm/@morpho-org/test-ethers?colorA=21262d&colorB=21262d&style=flat">
<img src="https://img.shields.io/npm/dm/@morpho-org/test-ethers?colorA=f6f8fa&colorB=f6f8fa&style=flat" alt="Downloads per month">
</picture>
</a>

Ethers-based extension of [`@morpho-org/test-viem`](../test-viem/) that injects a test Ethers wallet as a test fixture alongside viem's anvil client.

## Installation

```bash
npm install @morpho-org/test-ethers
```

```bash
yarn add @morpho-org/test-ethers
```

## Getting Started

Export an extended vitest `test`:

```typescript
import { createEthersTest } from "@morpho-org/test-ethers";
import { mainnet } from "viem/chains";

export const test = createEthersTest(mainnet, {
forkUrl: process.env.MAINNET_RPC_URL,
forkBlockNumber: 19_530_000,
});
```

See more on its internal usage for [ethers-based E2E tests here](../blue-sdk-ethers/test/e2e/).
6 changes: 2 additions & 4 deletions packages/test-ethers/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
{
"name": "@morpho-org/test-ethers",
"version": "2.0.0-alpha.10",
"author": "Morpho Association <[email protected]>",
"author": "Morpho Labs <[email protected]>",
"type": "module",
"main": "src/index.ts",
"files": [
"lib"
],
"files": ["lib"],
"license": "MIT",
"scripts": {
"prepublish": "yarn build",
Expand Down
48 changes: 48 additions & 0 deletions packages/test-viem/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# @morpho-org/test-viem

<a href="https://www.npmjs.com/package/@morpho-org/test-viem">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/npm/v/@morpho-org/test-viem?colorA=21262d&colorB=21262d&style=flat">
<img src="https://img.shields.io/npm/v/@morpho-org/test-viem?colorA=f6f8fa&colorB=f6f8fa&style=flat" alt="Version">
</picture>
</a>
<a href="https://github.com/wevm/@morpho-org/test-viem/blob/main/LICENSE">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/npm/l/@morpho-org/test-viem?colorA=21262d&colorB=21262d&style=flat">
<img src="https://img.shields.io/npm/l/@morpho-org/test-viem?colorA=f6f8fa&colorB=f6f8fa&style=flat" alt="MIT License">
</picture>
</a>
<a href="https://www.npmjs.com/package/@morpho-org/test-viem">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/npm/dm/@morpho-org/test-viem?colorA=21262d&colorB=21262d&style=flat">
<img src="https://img.shields.io/npm/dm/@morpho-org/test-viem?colorA=f6f8fa&colorB=f6f8fa&style=flat" alt="Downloads per month">
</picture>
</a>

Viem & vitest-based package that defines utilities to spawn independent, concurrent anvil forks for each test, injecting the corresponding viem client as a test fixture.

## Installation

```bash
npm install @morpho-org/test-viem
```

```bash
yarn add @morpho-org/test-viem
```

## Getting Started

Export an extended vitest `test`:

```typescript
import { createViemTest } from "@morpho-org/test-viem";
import { mainnet } from "viem/chains";

export const test = createViemTest(mainnet, {
forkUrl: process.env.MAINNET_RPC_URL,
forkBlockNumber: 19_530_000,
});
```

See more on its internal usage for [viem-based tests here](../blue-sdk-viem/test/).
6 changes: 2 additions & 4 deletions packages/test-viem/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
{
"name": "@morpho-org/test-viem",
"version": "2.0.0-alpha.10",
"author": "Morpho Association <[email protected]>",
"author": "Morpho Labs <[email protected]>",
"type": "module",
"main": "src/index.ts",
"files": [
"lib"
],
"files": ["lib"],
"license": "MIT",
"scripts": {
"prepublish": "yarn build",
Expand Down
Loading

0 comments on commit 6c9944c

Please sign in to comment.