Skip to content

Commit e34dbbb

Browse files
authored
add readme badges, codecov (#68)
1 parent 16c7747 commit e34dbbb

File tree

7 files changed

+102
-97
lines changed

7 files changed

+102
-97
lines changed

.github/pull_request_template.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<!--
2+
Borrowed from foundry.
3+
4+
Thank you for your Pull Request. Please provide a description above and review
5+
the requirements below.
6+
7+
Bug fixes and new features should include tests.
8+
-->
9+
10+
## Motivation
11+
12+
<!--
13+
Explain the context and why you're making that change. What is the problem
14+
you're trying to solve? In some cases there is not a problem and this can be
15+
thought of as being the motivation for your change.
16+
17+
If your PR solves a particular issue, tag that issue.
18+
-->
19+
20+
## Solution
21+
22+
<!--
23+
Summarize the solution and provide any necessary context needed to understand
24+
the code change.
25+
-->

.github/workflows/main.yaml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1+
name: CI
2+
13
on:
24
push:
35
branches:
46
- main
57
pull_request:
68

7-
name: main workflow
8-
99
env:
1010
GITHUB_TOKEN: ${{ secrets.GH_PAT_TOKEN }}
1111

@@ -18,7 +18,7 @@ jobs:
1818
- name: Setup Node.js
1919
uses: actions/setup-node@v2
2020
with:
21-
node-version: "16.11.0"
21+
node-version: 16.11.0
2222
cache: npm
2323
env:
2424
NODE_AUTH_TOKEN: ${{ secrets.GH_PAT_TOKEN }}
@@ -40,7 +40,7 @@ jobs:
4040
- name: Setup Node.js
4141
uses: actions/setup-node@v2
4242
with:
43-
node-version: "16.11.0"
43+
node-version: 16.11.0
4444
cache: npm
4545
env:
4646
NODE_AUTH_TOKEN: ${{ secrets.GH_PAT_TOKEN }}
@@ -62,7 +62,7 @@ jobs:
6262
- name: Setup Node.js
6363
uses: actions/setup-node@v2
6464
with:
65-
node-version: "16.11.0"
65+
node-version: 16.11.0
6666
cache: npm
6767
env:
6868
NODE_AUTH_TOKEN: ${{ secrets.GH_PAT_TOKEN }}
@@ -73,10 +73,9 @@ jobs:
7373
- name: Build
7474
run: npm run build
7575

76-
- name: Run tests
76+
- name: Run coverage
7777
run: npm run coverage
7878

79-
- name: Coveralls
80-
uses: coverallsapp/github-action@master
79+
- uses: codecov/codecov-action@v3
8180
with:
82-
github-token: ${{ secrets.GITHUB_TOKEN }}
81+
files: ./coverage/lcov.info

LICENSE

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Copyright 2022 Ozone Networks, Inc.
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4+
5+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6+
7+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 48 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
1-
[![Coverage Status](https://coveralls.io/repos/github/ProjectOpenSea/seaport-js/badge.svg?branch=main)](https://coveralls.io/github/ProjectOpenSea/seaport-js?branch=main)
1+
[![Version][version-badge]][version-link]
2+
[![Test CI][ci-badge]][ci-link]
3+
[![Code Coverage][coverage-badge]][coverage-link]
4+
[![License][license-badge]][license-link]
5+
[![Docs][docs-badge]][docs-link]
6+
[![Discussions][discussions-badge]][discussions-link]
27

38
# Seaport.js
49

5-
[Seaport](https://github.com/ProjectOpenSea/seaport) is a new marketplace protocol for safely and efficiently buying and selling NFTs. This is a JavaScript library intended to make interfacing with the contract reasonable and easy.
10+
[Seaport][seaport-link] is a new marketplace protocol for safely and efficiently buying and selling NFTs. This is a JavaScript library intended to make interfacing with the contract reasonable and easy.
611

712
- [Synopsis](#synopsis)
813
- [Installation](#installation)
@@ -12,23 +17,23 @@
1217

1318
## Synopsis
1419

15-
This is a JavaScript library to help interface with Seaport. It includes various helper methods and constants that makes interfacing with Seaport easier. These include creating orders, fulfilling orders, doing the necessary balance and approval checks, and more. We recommend taking a look at the [Seaport](https://github.com/ProjectOpenSea/seaport) docs to get a better understanding of how the Seaport marketplace works.
20+
This is a JavaScript library to help interface with Seaport. It includes various helper methods and constants that makes interfacing with Seaport easier. These include creating orders, fulfilling orders, doing the necessary balance and approval checks, and more. We recommend taking a look at the [Seaport][seaport-link] docs to get a better understanding of how the Seaport marketplace works.
1621

1722
## Installation
1823

1924
We recommend using [nvm](https://github.com/nvm-sh/nvm) to manage Node.js versions. Execute `nvm use`, if you have `nvm` installed.
2025

2126
Then, in your project, run:
2227

23-
```
28+
```console
2429
npm install --save @opensea/seaport-js
2530
```
2631

2732
## Getting Started
2833

2934
Instantiate your instance of seaport using your ethers provider:
3035

31-
```JavaScript
36+
```js
3237
import { Seaport } from "@opensea/seaport-js";
3338

3439
const provider = ethers.getDefaultProvider();
@@ -46,7 +51,7 @@ Many of the main core flows return _use cases_. What this means is that if you w
4651

4752
#### Listing an ERC-721 for 10 ETH and fulfilling it
4853

49-
```
54+
```js
5055
const offerer = "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266";
5156
const fulfiller = "0x70997970c51812dc3a010c7d01b50e0d17dc79c8";
5257
const { executeAllActions } = await seaport.createOrder({
@@ -55,61 +60,81 @@ const { executeAllActions } = await seaport.createOrder({
5560
itemType: ItemType.ERC721,
5661
token: "0x8a90cab2b38dba80c64b7734e58ee1db38b8992e",
5762
identifier: "1",
58-
}
63+
},
5964
],
6065
consideration: [
6166
{
6267
amount: parseEther("10").toString(),
6368
recipient: offerer,
64-
}
69+
},
6570
],
66-
accountAddress: offerer
71+
accountAddress: offerer,
6772
});
6873

6974
const order = await executeAllActions();
7075

71-
const { executeAllActions: executeAllFulfillActions } = await seaport.fulfillOrder({
72-
order,
73-
accountAddress: fulfiller,
74-
});
76+
const { executeAllActions: executeAllFulfillActions } =
77+
await seaport.fulfillOrder({
78+
order,
79+
accountAddress: fulfiller,
80+
});
7581

76-
const transaction = executeAllFulfillActions()
82+
const transaction = executeAllFulfillActions();
7783
```
7884

7985
#### Making an offer for an ERC-721 for 10 WETH and fulfilling it
8086

81-
```
87+
```js
8288
const offerer = "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266";
8389
const fulfiller = "0x70997970c51812dc3a010c7d01b50e0d17dc79c8";
8490
const { executeAllActions } = await seaport.createOrder({
8591
offer: [
8692
{
8793
amount: parseEther("10").toString(),
8894
// WETH
89-
token: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"
95+
token: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
9096
},
9197
],
9298
consideration: [
9399
{
94100
itemType: ItemType.ERC721,
95101
token: "0x8a90cab2b38dba80c64b7734e58ee1db38b8992e",
96102
identifier: "1",
97-
recipient: offerer
103+
recipient: offerer,
98104
},
99105
],
100-
accountAddress: offerer
106+
accountAddress: offerer,
101107
});
102108

103109
const order = await executeAllActions();
104110

105-
const { executeAllActions: executeAllFulfillActions } = await seaport.fulfillOrder({
106-
order,
107-
accountAddress: fulfiller.address,
108-
});
111+
const { executeAllActions: executeAllFulfillActions } =
112+
await seaport.fulfillOrder({
113+
order,
114+
accountAddress: fulfiller.address,
115+
});
109116

110-
const transaction = executeAllFulfillActions()
117+
const transaction = executeAllFulfillActions();
111118
```
112119

113120
## Contributing
114121

115122
See [the contributing guide](CONTRIBUTING.md) for detailed instructions on how to get started with this project.
123+
124+
## License
125+
126+
[MIT](LICENSE) Copyright 2022 Ozone Networks, Inc.
127+
128+
[seaport-link]: https://github.com/ProjectOpenSea/seaport
129+
[version-badge]: https://img.shields.io/github/package-json/v/ProjectOpenSea/seaport-js
130+
[version-link]: https://github.com/ProjectOpenSea/seaport-js/releases
131+
[ci-badge]: https://github.com/ProjectOpenSea/seaport-js/actions/workflows/main.yaml/badge.svg
132+
[ci-link]: https://github.com/ProjectOpenSea/seaport-js/actions/workflows/main.yaml
133+
[coverage-badge]: https://codecov.io/gh/ProjectOpenSea/seaport-js/branch/main/graph/badge.svg
134+
[coverage-link]: https://codecov.io/gh/ProjectOpenSea/seaport-js
135+
[license-badge]: https://img.shields.io/github/license/ProjectOpenSea/seaport-js
136+
[license-link]: https://github.com/ProjectOpenSea/seaport-js/blob/main/LICENSE
137+
[docs-badge]: https://img.shields.io/badge/Seaport.js-documentation-informational
138+
[docs-link]: https://github.com/ProjectOpenSea/seaport-js/blob/main/README.md#getting-started
139+
[discussions-badge]: https://img.shields.io/badge/Seaport.js-discussions-blueviolet
140+
[discussions-link]: https://github.com/ProjectOpenSea/seaport-js/discussions

codecov.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
coverage:
2+
range: 95..100
3+
round: down
4+
precision: 2
5+
status:
6+
project:
7+
default:
8+
target: auto
9+
threshold: 0%
10+
base: auto
11+
if_ci_failed: error

package-lock.json

Lines changed: 3 additions & 64 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@
5555
"chai": "^4.3.6",
5656
"chai-as-promised": "^7.1.1",
5757
"concurrently": "^7.1.0",
58-
"coveralls": "^3.1.1",
5958
"dotenv": "^10.0.0",
6059
"eslint": "^8.17.0",
6160
"eslint-config-prettier": "^8.5.0",

0 commit comments

Comments
 (0)