Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,5 @@ jobs:
with:
node-version: 16
- run: npm ci
- run: sh ./scripts/generate-types.sh
- run: npm run format
- run: npm run validate
29 changes: 5 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,16 @@

Typescript library for interacting with the UXD contracts on EVM.


## To Build

1. Build the package

```sh
npm run build
```

2. Generate typing files from contract ABIs
```sh
sh ./scripts/generate-types.sh
```
2. Run the linter to properly format typescript files.

3. Run the linter to properly format typescript files.
```sh
npm run format
```
Expand All @@ -28,16 +24,6 @@ npm run format
npm i "uxd-evm-client@0.2.3"
```

### Generation of ethers-contracts types

https://github.com/dethcrypto/TypeChain

Run the following command that will generate typing for contracts:

```
./scripts/generate-types.sh
```

### Import library code

You need to import the UXDController from the library as well as the ethers library
Expand Down Expand Up @@ -65,8 +51,8 @@ const redeemable = "..."; // redeemable address

const provider = new ethers.providers.JsonRpcProvider("https://goerli.optimism.io");
const client = new UXDClient({
provider,
controller,
provider,
controller,
depository
redeemable
});
Expand All @@ -89,12 +75,7 @@ console.log("totalsupply = ", totalSupply);
To mint with WETH can call the `mint()` function:

```typescript
await controller.mint(
ethAmount,
targetePrice,
signer,
collateralAddress
)
await controller.mint(ethAmount, targetePrice, signer, collateralAddress);
```

> Note: The controller must be approved to access the users WETH otherwise the call with revert with an error.
Expand Down
Loading