Skip to content
This repository has been archived by the owner on Mar 14, 2023. It is now read-only.

Commit

Permalink
add simple js docs
Browse files Browse the repository at this point in the history
  • Loading branch information
arr00 committed Aug 23, 2022
1 parent fe17044 commit 1f5d727
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 7 additions & 0 deletions README.md
Expand Up @@ -7,6 +7,7 @@ Seaport Order Validator provides a solidity contract which validates orders and
There are a variety of functions which conduct micro and macro validations on various components of the order. Each validation function returns two arrays of uint16s, the first is an array of errors, and the second is an array of warnings. For a quick lookup of issue codes, see the [issue table](contracts/README.md).

## Table of Contents
- [JS Package Usage](#js-package-usage)
- [Macro-Validation](#macro-validation)
- [Micro-Validation](#micro-validation)
- [validateTime](#validatetime---validates-the-timing-of-the-order)
Expand All @@ -27,6 +28,12 @@ There are a variety of functions which conduct micro and macro validations on va
- [getMerkleRoot](#getmerkleroot)
- [getMerkleProof](#getmerkleroot)

## JS Package Usage
- Add the package via `yarn add @opensea/seaport-order-validator` or `npm i @opensea/seaport-order-validator`
- Import the package to your JS/TS file via `import { SeaportOrderValidator } from "@opensea/seaport-order-validator"`
- Create an instance of `SeaportOrderValidator` `const validator = new SeaportOrderValidator(new ethers.providers.JsonRpcProvider(<RPC>));`
- All validation functions are exposed to the `SeaportOrderValidator` instance

## Macro-Validation

- There are two macro-validation function, `isValidOrder` and `isValidOrderWithConfiguration`. `isValidOrder` simply calls `isValidOrderWithConfiguration` with a default configuration as follows:
Expand Down
3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -22,7 +22,8 @@
"main": "dist/src/index.js",
"files": [
"dist",
"artifacts/contracts/lib/SeaportValidator.sol/SeaportValidator.json"
"artifacts/contracts/lib/SeaportValidator.sol/SeaportValidator.json",
"contracts/README.md"
],
"types": "dist/src/index.d.ts",
"dependencies": {
Expand Down

0 comments on commit 1f5d727

Please sign in to comment.