Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
JFrankfurt committed Oct 28, 2021
1 parent cc34b7e commit 0f9c41e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,22 @@ This package does not include code for token list validation. You can easily do
[ajv](https://ajv.js.org/) to perform the validation against the JSON schema. The schema is exported from the package
for ease of use.

```typescript
import Ajv from 'ajv';
import { schema } from '@uniswap/token-lists'

const ajv = new Ajv({ allErrors: true });
const validate = ajv.compile(schema);

const response = await fetch('https://bridge.arbitrum.io/token-list-42161.json')
const listData = await response.json()

const valid = validate(listData)
if (!valid) {
// oh no!
}
```

## Authoring token lists

### Manual
Expand Down

0 comments on commit 0f9c41e

Please sign in to comment.