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
42 changes: 0 additions & 42 deletions ON_CHAIN_UPDATES.md

This file was deleted.

28 changes: 19 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,31 @@ This package only exports CommonJS modules. You can import it like this:

```js
// Usage with ES6 modules
import { products, productTypes } from '@nexusmutual/sdk';
import { NexusSDK } from '@nexusmutual/sdk';
```

## Nexus Mutual contract addresses and abis

Source of truth for the latest mainnet addresses. Feeds into https://api.nexusmutual.io/sdk/.

## Listed products and product types metadata
## Product metadata

Product and product type metadata is served by the Nexus Mutual API (default base URL `https://api.nexusmutual.io/v2`).
Use the `ProductAPI` class to query products and product types instead of local JSON or logo assets.
For logos, use the URL `https://api.nexusmutual.io/v2/logos/:productId`

The `products` folder contains all protocols listed on Nexus Mutual.
### Example

If you're a protocol owner and want to update any details (i.e. logo, website, etc), please submit a PR.
Logos should meet the following criteria:
```typescript
import { ProductAPI } from '@nexusmutual/sdk';

- svg format, with 1:1 ratio
- no fixed width or height
- the image should reach the edge of the viewbox
const productApi = new ProductAPI();

const productTypes = await productApi.getAllProductTypes();
const product = await productApi.getProductById(247);

console.log(productTypes.length, product.name);
```

## Development

Expand Down Expand Up @@ -250,7 +258,9 @@ Note: The following product types do not require IPFS content:
- sherlockBugBounty
- immunefiBugBounty

For a complete list of products and product types, see [products.json](https://sdk.nexusmutual.io/data/products.json) and [product-types.json](https://sdk.nexusmutual.io/data/product-types.json).
For a complete list of products and product types, use the API endpoints:
`GET https://api.nexusmutual.io/v2/products` and `GET https://api.nexusmutual.io/v2/product-types`,
or the `ProductAPI.getAllProducts()` and `ProductAPI.getAllProductTypes()` helpers.

### Validation Errors

Expand Down
159 changes: 1 addition & 158 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@
"semver": "^7.4.0",
"ts-jest": "^29.1.1",
"tsup": "^7.1.0",
"typescript": "^5.1.6",
"viem": "^1.16.6"
"typescript": "^5.1.6"
}
}
5 changes: 3 additions & 2 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@
</div>
<div class='row'>
<div class='col text-right'>
<a target="_blank" href="/data/product-types.json">Product types 🡭</a><br>
<a target="_blank" href="/data/products.json">Products 🡭</a>
<!-- TODO replace with PROD api url -->
<a target="_blank" href="https://api.staging.nexusmutual.io/v2/product-types">Product types 🡭</a><br>
<a target="_blank" href="https://api.staging.nexusmutual.io/v2/products">Products 🡭</a>
</div>
</div>
</div>
Expand Down
Loading