Skip to content

Commit

Permalink
docs(pkg): add jsdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
Rubilmax committed Jul 4, 2024
1 parent 6cc63f1 commit 3c96103
Show file tree
Hide file tree
Showing 3 changed files with 481 additions and 166 deletions.
76 changes: 76 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,82 @@ User-end bundlers are provided in each chain-specific folder, instanciating all

## Getting Started

### Installation

```bash
npm install @morpho-org/morpho-blue-bundlers
```

```bash
yarn add @morpho-org/morpho-blue-bundlers
```

### Usage

```typescript
import { Signature } from "ethers";

import { BundlerAction } from "@morpho-org/morpho-blue-bundlers";

const permit2Address = "0x000000000022D473030F116dDEE9F6B43aC78BA3";

const permit2Config = {
domain: {
name: "Permit2",
chainId: "0x1",
verifyingContract: permit2Address,
},
types: {
PermitSingle: [
{
name: "details",
type: "PermitDetails",
},
{
name: "spender",
type: "address",
},
{
name: "sigDeadline",
type: "uint256",
},
],
PermitDetails: [
{
name: "token",
type: "address",
},
{
name: "amount",
type: "uint160",
},
{
name: "expiration",
type: "uint48",
},
{
name: "nonce",
type: "uint48",
},
],
},
};

await bundler
.connect(supplier)
.multicall([
BundlerAction.approve2(
approve2,
Signature.from(await supplier.signTypedData(permit2Config.domain, permit2Config.types, approve2)),
false,
),
BundlerAction.transferFrom2(collateralAddress, assets),
BundlerAction.erc4626Deposit(erc4626Address, assets, 0, supplier.address),
]);
```

## Development

Install dependencies with `yarn`.

Run tests with `yarn test:forge --chain <chainid>` (chainid can be 1 or 8453).
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@morpho-org/morpho-blue-bundlers",
"description": "Morpho Blue Bundlers",
"license": "GPL-2.0-or-later",
"version": "1.1.2",
"version": "1.2.0",
"repository": {
"type": "git",
"url": "git+https://github.com/morpho-labs/morpho-blue-bundlers.git"
Expand Down
Loading

0 comments on commit 3c96103

Please sign in to comment.