Skip to content

Commit

Permalink
Merge pull request #11 from Polymarket/feat/protocol-contracts
Browse files Browse the repository at this point in the history
Feat/adapt utils to new contracts
  • Loading branch information
poly-rodr authored Sep 23, 2022
2 parents 79bed5b + 258a36f commit f54b5d7
Show file tree
Hide file tree
Showing 41 changed files with 4,947 additions and 9,740 deletions.
22 changes: 22 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_style = space
trim_trailing_whitespace = true
insert_final_newline = true

[{src,scripts,tests}/**.{ts,js}]
indent_style = space
indent_size = 4
quote_type = single

[*.json]
indent_style = space
indent_size = 2

[*.yaml]
indent_style = space
indent_size = 2
quote_type = single
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ coverage
jest.config.ts
.eslintrc.js
test
src/model/ierc1155.ts
src/model/ierc1155.ts
25 changes: 25 additions & 0 deletions .github/workflows/workflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Build, Lint, and Test

on:
push:
branches: [ main ]
pull_request:

jobs:
build-lint-test:
name: Build, Lint, and Test
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- run: yarn --frozen-lockfile
- run: yarn lint
- run: yarn build
- run: yarn test

all-jobs-pass:
name: All jobs pass
runs-on: ubuntu-20.04
needs:
- build-lint-test
steps:
- run: echo "success"
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ coverage/
dist/
node_modules/
typechain/
.nyc_output

# files
.env
Expand All @@ -20,11 +21,10 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*
.DS_Store
packages/tracker/main
packages/tracker/tracker
package-lock.json
packages/executor/cmd/executor_cli/executor_server
packages/executor/cmd/executor_server/executor_server
*.swp
*.swo
*~



4 changes: 3 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.github
CHANGELOG.md
coverage
coverage
node_modules
dist
4 changes: 1 addition & 3 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
{
"tabWidth": 4,
"bracketSpacing": false,
"singleQuote": true
"editorconfig": true
}
22 changes: 22 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
.PHONY: build
build:
@echo "Building ts code..."
rm -rf dist
tsc --module commonjs

.PHONY: test
test:
yarn nyc -a \
--reporter=html \
--reporter=text mocha './tests' \
--require esm \
--require jsdom-global/register \
--require ts-node/register 'tests/**/*.test.ts' \
--require tsconfig-paths/register \
--timeout 10000 \
--exit

.PHONY: lint
lint:
@echo "Linting code..."
./node_modules/.bin/eslint ./src --ext .js,.ts
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<img src='https://img.shields.io/npm/v/@polymarket/order-utils.svg' alt='NPM'/>
</a>

Typescript utilities used to generate and sign limit and market orders from Polymarket's CLOB
Typescript utilities used to generate and sign orders from Polymarket's Exchange

### Installation

`yarn add @polymarket/order-utils`
`yarn add @polymarket/order-utils`
136 changes: 66 additions & 70 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,75 +1,71 @@
{
"name": "@polymarket/order-utils",
"version": "1.2.15",
"description": "Typescript utility for creating orders for Polymarket's CLOB",
"author": "Liam Kovatch <[email protected]>",
"homepage": "https://github.com/Polymarket/clob-order-utils",
"license": "MIT",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"engines": {
"node": ">=8",
"npm": ">=5"
"name": "@polymarket/order-utils",
"version": "1.3.0",
"description": "Typescript utility for creating orders for Polymarket's CLOB",
"author": "Liam Kovatch <[email protected]>",
"homepage": "https://github.com/Polymarket/clob-order-utils",
"license": "MIT",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"engines": {
"node": ">=8",
"npm": ">=5"
},
"repository": {
"type": "git",
"url": "git+ssh://[email protected]/Polymarket/clob-order-utils.git"
},
"contributors": [
{
"name": "Liam Kovatch",
"url": "https://github.com/L-Kov"
},
"repository": {
"type": "git",
"url": "git+ssh://git@github.com/Polymarket/clob-order-utils.git"
{
"name": "Jonathan Amenechi",
"url": "https://github.com/JonathanAmenechi"
},
"contributors": [
{
"name": "Liam Kovatch",
"url": "https://github.com/L-Kov"
},
{
"name": "Jonathan Amenechi",
"url": "https://github.com/JonathanAmenechi"
}
],
"scripts": {
"build": "tsc --module commonjs",
"test": "npx jest",
"postbuild": "cp package.json dist && cp README.md dist && cp -R docs",
"lint": "eslint ./src --ext .js,.ts",
"ci-pipeline": "yarn run lint && yarn run test && yarn run typecheck"
},
"devDependencies": {
"@babel/core": "^7.13.16",
"@babel/preset-env": "^7.13.15",
"@babel/preset-typescript": "^7.13.0",
"@ethersproject/abstract-signer": "^5.4.5",
"@ethersproject/bignumber": "^5.4.5",
"@typechain/ethers-v5": "^8.0.5",
"@typechain/hardhat": "^3.0.0",
"@types/jest": "^28.1.6",
"@types/prompts": "^2.0.12",
"@typescript-eslint/eslint-plugin": "4",
"babel-jest": "^26.6.3",
"eslint": "7",
"eslint-config-prettier": "^8.2.0",
"eslint-config-standard-with-typescript": "^20.0.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-node": "11",
"eslint-plugin-promise": "4",
"eslint-plugin-unused-imports": "^1.1.1",
"eth-sig-util": "^3.0.1",
"ethers": "^5.5.2",
"ethers-eip712": "^0.2.0",
"husky": "^6.0.0",
"istanbul-badges-readme": "^1.2.1",
"jest": "^28.1.3",
"lint-staged": "^10.5.4",
"prettier": "^2.2.1",
"standard-version": "^9.2.0",
"ts-loader": "^9.0.2",
"ts-mockito": "^2.6.1",
"ts-node": "^9.1.1",
"tslib": "^2.2.0",
"typescript": "^4.2.4",
"web3": "^2.0.0-alpha.1",
"@types/mocha": "^9.1.1",
"ts-jest": "^28.0.7"
},
"bugs": {
"url": "https://github.com/Polymarket/clob-order-utils/issues"
{
"name": "Rodrigo Calvo",
"url": "https://github.com/poly-rodr"
}
],
"scripts": {
"build": "make build",
"test": "make test",
"lint": "make lint",
"postbuild": "cp package.json dist && cp README.md dist"
},
"dependencies": {
"@metamask/eth-sig-util": "^5.0.0",
"ethers": "^5.7.1"
},
"devDependencies": {
"@types/chai": "^4.3.3",
"@types/mocha": "^9.1.1",
"@types/node": "^18.7.18",
"@typescript-eslint/eslint-plugin": "^5.37.0",
"@typescript-eslint/parser": "^5.37.0",
"chai": "^4.3.6",
"eslint": "^8.23.1",
"eslint-config-prettier": "^8.5.0",
"eslint-config-standard-with-typescript": "^23.0.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-n": "^15.2.5",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^6.0.1",
"eslint-plugin-unused-imports": "^2.0.0",
"esm": "^3.2.25",
"jsdom": "^20.0.0",
"jsdom-global": "^3.0.2",
"mocha": "^10.0.0",
"nyc": "^15.1.0",
"prettier": "^2.7.1",
"ts-mocha": "^10.0.0",
"ts-node": "^10.9.1",
"tslib": "^2.4.0",
"typescript": "^4.8.3"
},
"bugs": {
"url": "https://github.com/Polymarket/clob-order-utils/issues"
}
}
Loading

0 comments on commit f54b5d7

Please sign in to comment.