Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LOP v4 #49

Merged
merged 39 commits into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
f381cd8
feat(lop-v4): implement maker traits
vbrvk Jan 19, 2024
1d01b3a
wip
vbrvk Feb 22, 2024
7b84e8d
final
vbrvk Feb 28, 2024
48a93a3
remove nonce manager
vbrvk Feb 29, 2024
f831957
rename ABI
vbrvk Mar 1, 2024
8fe6d0c
remove nonce manager and add delayAuctionStartTimeBy param
vbrvk Mar 1, 2024
8ed9dc5
pr comment fixes
vbrvk Mar 1, 2024
dd820c5
add getFillContractOrderArgsCalldata method
vbrvk Mar 1, 2024
0de801c
allow fusion order with permit2
vbrvk Mar 1, 2024
b070bfc
default extra params for fusion in single object
vbrvk Mar 1, 2024
2dc8aee
fix linter
vbrvk Mar 1, 2024
3afa3b9
fix types
vbrvk Mar 1, 2024
5e810c8
fix types
vbrvk Mar 1, 2024
f580c65
chore
vbrvk Mar 1, 2024
d6489b8
try reset cache
vbrvk Mar 2, 2024
e852c5f
try reset cache
vbrvk Mar 2, 2024
d4cc665
update doc
vbrvk Mar 4, 2024
c3a1114
remove addresses
vbrvk Mar 4, 2024
62d5618
refactor
vbrvk Mar 4, 2024
4b1cd40
use @1inch/limit-order-sdk
vbrvk Mar 11, 2024
e8e5010
pass allowMultipleFills/allowPartialFills to fusion order
vbrvk Mar 11, 2024
481022d
remove unused extension field
vbrvk Mar 11, 2024
9360f5e
fix doc
vbrvk Mar 11, 2024
8dc1189
fix doc
vbrvk Mar 11, 2024
14db2ef
fix doc
vbrvk Mar 11, 2024
7ca81f8
add allowMultipleFills to sdk
vbrvk Mar 11, 2024
07b9f08
Merge branch 'main' into feat/limit-order-v4
vbrvk Mar 11, 2024
3934d93
use @1inch eslint config
vbrvk Mar 11, 2024
5ad5819
fix a pr check job
vbrvk Mar 11, 2024
066a37c
fix a pr check job
vbrvk Mar 11, 2024
556d048
fix ci
vbrvk Mar 11, 2024
d9bfa6b
fix ci
vbrvk Mar 11, 2024
3d6ecad
fix whitelist creation
vbrvk Mar 12, 2024
a42e3ac
new ci
vbrvk Mar 12, 2024
fa91caf
change version
vbrvk Mar 12, 2024
2bad225
use pnpm
vbrvk Mar 12, 2024
c7a632d
update lock
vbrvk Mar 12, 2024
a6e1467
fix tests
vbrvk Mar 12, 2024
e545394
rename ci job
vbrvk Mar 12, 2024
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
51 changes: 1 addition & 50 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,52 +1,3 @@
module.exports = {
root: true,
env: {
node: true
},
ignorePatterns: ['*.mock.ts'],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint', 'unused-imports'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended'
],
rules: {
'@typescript-eslint/member-ordering': 'error',
'lines-between-class-members': 'error',
'padding-line-between-statements': [
'error',
{blankLine: 'always', prev: '*', next: 'return'},
{blankLine: 'always', prev: '*', next: 'if'},
{blankLine: 'always', prev: 'if', next: '*'},
{blankLine: 'always', prev: 'for', next: '*'},
{blankLine: 'always', prev: '*', next: 'for'}
],
'@typescript-eslint/adjacent-overload-signatures': 'off',
'no-unused-vars': 'off',
'no-prototype-builtins': 'off',
'max-len': ['error', {code: 160, ignoreComments: true}],
'max-depth': ['error', 3],
'max-lines-per-function': ['error', 255],
'max-params': ['error', 10],
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-unused-vars': [
'error',
{argsIgnorePattern: '^_'}
],
'unused-imports/no-unused-imports': 'error',
'unused-imports/no-unused-vars': 0,
'no-async-promise-executor': 0,
'no-console': 'error',
'@typescript-eslint/explicit-function-return-type': 'error'
},
overrides: [
{
files: ['src/**/*.spec.ts'],
rules: {
'max-lines-per-function': ['error', 400],
'max-len': ['error', {code: 1130}]
}
}
]
extends: ['@1inch']
}
35 changes: 35 additions & 0 deletions .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: PR validation

on:
pull_request:

jobs:
check:
name: Lint, Types & Tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18
cache: pnpm

- name: Install Dependencies
run: pnpm install

- name: Linter
run: pnpm lint

- name: Types
run: pnpm lint:types

- name: Unit tests
run: pnpm test
106 changes: 0 additions & 106 deletions .github/workflows/pr.yml

This file was deleted.

72 changes: 72 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Publish package

on:
push:
tags:
- v*.*.*
workflow_dispatch:

jobs:
publish-to-npm:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8

- uses: actions/setup-node@v3
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'
scope: ${{ github.repository_owner }}
cache: pnpm

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Build
run: pnpm build

- name: Publish 🚀
run: pnpm publish --no-git-checks --access=public
working-directory: dist
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

publish-to-github:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8

- uses: actions/setup-node@v3
with:
node-version: 18
cache: pnpm

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Build
run: pnpm build

- name: Auth in GitHub private registry npm
run: |
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" > .npmrc
echo "@1inch:registry=https://npm.pkg.github.com" >> .npmrc

- name: Publish 🚀
run: pnpm publish --no-git-checks
working-directory: dist
110 changes: 53 additions & 57 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,74 +1,70 @@
name: Publish package
name: Release new version

on:
push:
tags:
- v*.*.*

workflow_dispatch:
inputs:
version:
type: choice
description: Version
options:
- patch
- minor
- major
- prerelease
jobs:
publish-to-npm:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'
scope: ${{ github.repository_owner }}

- name: Update package.json
run: |
TAG_NAME=${GITHUB_REF/refs\/tags\//}
PACKAGE_VERSION=${TAG_NAME#v}
echo "Updating package.json to version $PACKAGE_VERSION"
cat <<< $(jq -r ".version=\"$PACKAGE_VERSION\"" package.json) > package.json
cat package.json

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Build
run: yarn build

- name: Publish
run: yarn publish
working-directory: dist
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

publish-to-github:
release:
runs-on: ubuntu-latest
permissions:
contents: read
contents: write
packages: write
actions: write
if: github.ref == 'refs/heads/master'
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
# Needed to make possible changelog generation only from latest tag
with:
fetch-depth: 0
fetch-tags: true

- uses: actions/setup-node@v3
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18
registry-url: 'https://npm.pkg.github.com'
scope: ${{ github.repository_owner }}
cache: pnpm

- name: Install Dev Dependencies
run: pnpm install -D

- name: Update package.json
- name: Bump package.json version
id: version
run: |
TAG_NAME=${GITHUB_REF/refs\/tags\//}
PACKAGE_VERSION=${TAG_NAME#v}
echo "Updating package.json to version $PACKAGE_VERSION"
cat <<< $(jq -r ".version=\"$PACKAGE_VERSION\"" package.json) > package.json
cat package.json
echo "OLD_VERSION=$(pnpm pkg get version | tr -d '"')" >> "$GITHUB_OUTPUT"
pnpm version ${{ github.event.inputs.version }} --preid rc --git-tag-version=false
echo "NEW_VERSION=$(pnpm pkg get version | tr -d '"')" >> "$GITHUB_OUTPUT"

- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Generate changelog
run: pnpm changelog:generate -t v${{ steps.version.outputs.OLD_VERSION }} || pnpm changelog:generate

- name: Build
run: yarn build
- name: Create github release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global user.email ci_cd_bot@1inch.io
git config --global user.name "CI/CD Bot"
git add package.json
git commit -m "version v${{ steps.version.outputs.NEW_VERSION }}"
git tag v${{ steps.version.outputs.NEW_VERSION }}
git push
git push --tags
gh release create v${{ steps.version.outputs.NEW_VERSION }} --notes-file CHANGELOG.md

- name: Publish
run: yarn publish
working-directory: dist
- name: Trigger publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh workflow run publish.yml -r v${{ steps.version.outputs.NEW_VERSION }}
Loading
Loading