Skip to content

Commit

Permalink
Merge remote-tracking branch 'original/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
sirEven committed Dec 22, 2024
2 parents df8561b + aa0d95d commit 135a0b5
Show file tree
Hide file tree
Showing 934 changed files with 239,599 additions and 17,854 deletions.
Binary file removed .DS_Store
Binary file not shown.
10 changes: 6 additions & 4 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
v4-client-cpp/ @asnefedovv @dydxprotocol/eng
v4-client-py/ @kaloureyes3 @dydxprotocol/eng
v4-client-py-v2/ @samtin0x @therustmonk @piwonskp @dydxprotocol/eng
# Order is important. The last matching pattern has the most precedence.

* @dydxprotocol/eng
* @dydxprotocol/engineering

/v4-client-py-deprecated/ @dydxprotocol/engineering @dydxprotocol/foundation @dydxprotocol/nethermind
/v4-client-py-v2/ @dydxprotocol/engineering @dydxprotocol/foundation @dydxprotocol/nethermind
/v4-client-rs/ @dydxprotocol/engineering @dydxprotocol/foundation @dydxprotocol/nethermind
35 changes: 35 additions & 0 deletions .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: "Conventional PR Title"
on:
pull_request:
types: ['opened', 'edited', 'reopened', 'synchronize']
paths:
- 'v4-client-js/**'
- 'v4-client-rs/**'
jobs:
conventional-pr-title:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./v4-client-js
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Use Node.js 20.8.1
uses: actions/setup-node@v3
with:
node-version: 20.8.1
registry-url: https://registry.npmjs.org
cache: "npm"
cache-dependency-path: '**/package-lock.json'

- name: Install dependencies
run: |
npm install @commitlint/config-conventional
- name: Lint PR Title
run: |
echo "${PR_TITLE}" | npx commitlint --config commitlint.config.js
env:
PR_TITLE: '${{ github.event.pull_request.title }}'

4 changes: 2 additions & 2 deletions .github/workflows/js-lint-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ jobs:
- name: Check out repository code
uses: actions/checkout@v3

- name: Use Node.js 16
- name: Use Node.js 20.8.1
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 20.8.1
registry-url: https://registry.npmjs.org
cache: "npm"
cache-dependency-path: '**/package-lock.json'
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/js-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Npm
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 20.8.1
registry-url: https://registry.npmjs.org
cache: "npm"
cache-dependency-path: '**/package-lock.json'
Expand All @@ -38,7 +38,10 @@ jobs:
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN_READ }}

- name: Publish
run: ./scripts/publish-if-not-exists.sh
# Run semantic-release to automatically bump the version based on PR title
- name: Run semantic-release
run: npm run release
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN_WRITE }}


49 changes: 49 additions & 0 deletions .github/workflows/rs-build-fmt-clippy-audit-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: "[v4-client-rs] Build, Fmt, Clippy, Audit, & Test"

on:
pull_request:
paths:
- 'v4-client-rs/**'
push:
paths:
- 'v4-client-rs/**'
branches:
- main
- "release/*"

jobs:
test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./v4-client-rs

steps:
- name: Checkout source code
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Install protoc # for dev dependencies only
run: sudo apt install -y protobuf-compiler

- name: Build
run: cargo build

- name: Check formatting
run: cargo fmt -- --check

- name: Linter
shell: bash
run: cargo clippy -- -D warnings

- name: Install audit
shell: bash
run: cargo install cargo-deny

- name: Security audit, licenses
shell: bash
run: cargo deny check licenses advisories sources

- name: Test
run: cargo test
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.idea
**/.DS_Store
9 changes: 9 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
[submodule "v4-client-cpp"]
path = v4-client-cpp
url = https://github.com/asnefedovv/dydx-v4-client-cpp
[submodule "dydxprotocol"]
path = dydxjs/packages/dydxjs/proto/dydxprotocol-src
url = [email protected]:dydxprotocol/v4-chain.git
[submodule "noble-cctp"]
path = dydxjs/packages/dydxjs/proto/noble-cctp-src
url = [email protected]:circlefin/noble-cctp.git
[submodule "slinky"]
path = dydxjs/packages/dydxjs/proto/slinky-src
url = [email protected]:skip-mev/slinky.git
45 changes: 44 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,57 @@ Python client for dYdX Chain. Developed and maintained by the Nethermind team.
- [Saul M.](https://github.com/samtin0x)
- [Piotr P.](https://github.com/piwonskp)

## v4-client-rs
Rust client for dYdX Chain. Developed and maintained by the Nethermind team.
- [Emanuel V.](https://github.com/v0-e)
- [Denis K.](https://github.com/therustmonk)
- [Maksim R.](https://github.com/maksimryndin)

## v4-client-cpp (Third Party Client)
To pull the latest C++ client, run `git submodule update --init --recursive`

Please note the C++ client only works on Linux.

This client was originally developed and open-sourced through a grant by the dYdX Grants Trust — an
unaffiliated and independent third-party from dYdX Trading Inc.

The original client can be found [here](https://github.com/asnefedovv/dydx-v4-client-cpp).

## dydxjs
<b>dydxjs</b> is a Typescript library for interacting with dYdX chain and other Cosmos blockchains. It makes it easy to compose and broadcast dYdX and Cosmos messages, with all of the proto and amino encoding handled for you.<br/>
<i>Note: This library provides the low-level interfaces to compose and send transactions. It is recommended to install `v4-client-js` for a simpler developer experience.</i>

# Third-party Clients

By clicking the above links to third-party clients, you will leave the dYdX Trading Inc. (“dYdX”) GitHub repository and join repositories made available by third parties, which are independent from and unaffiliated with dYdX. dYdX is not responsible for any action taken or content on third-party repositories.
By clicking the above links to third-party clients, you will leave the dYdX Trading Inc. (“dYdX”) GitHub repository and join repositories made available by third parties, which are independent from and unaffiliated with dYdX. dYdX is not responsible for any action taken or content on third-party repositories.

# Contributing

## We use [Conventional Commits](https://github.com/conventional-changelog/commitlint)
We use a commit-msg hook to check if your commit messages meet the conventional commit format.

In general the pattern looks like this:

`type(scope?): subject` #scope is optional; multiple scopes are supported (current delimiter options: "/", "\" and ",")

### Real world examples can look like this:
`chore: run tests on travis ci`
`fix(server): send cors headers`
`feat(blog): add comment section`

Common types according to commitlint-config-conventional can be:

build
chore
ci
docs
feat
fix
perf
refactor
revert
style
test

## Any contributions you make will be under the same License
When you submit code changes, your submissions are understood to be under the same [License](https://github.com/dydxprotocol/v4-web/blob/master/LICENSE) that covers the project.
12 changes: 12 additions & 0 deletions dydxjs/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

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

[*.md]
trim_trailing_whitespace = false
5 changes: 5 additions & 0 deletions dydxjs/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules/
dist/
main/
module/
coverage/
70 changes: 70 additions & 0 deletions dydxjs/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
module.exports = {
plugins: ['prettier'],
extends: ['eslint:recommended', 'prettier'],
parserOptions: {
ecmaVersion: 11,
requireConfigFile: false,
sourceType: 'module',
ecmaFeatures: {
jsx: true
}
},
env: {
es6: true,
browser: true,
node: true,
jest: true
},
rules: {
'no-debugger': 2,
'no-alert': 2,
'no-await-in-loop': 0,
'no-prototype-builtins': 0,
'no-return-assign': ['error', 'except-parens'],
'no-restricted-syntax': [
2,
'ForInStatement',
'LabeledStatement',
'WithStatement'
],
'no-unused-vars': [
0,
{
ignoreSiblings: true,
argsIgnorePattern: 'React|res|next|^_'
}
],
'prefer-const': [
'error',
{
destructuring: 'all'
}
],
'no-unused-expressions': [
2,
{
allowTaggedTemplates: true
}
],
'no-console': 1,
'comma-dangle': 2,
'jsx-quotes': [2, 'prefer-double'],
'linebreak-style': ['error', 'unix'],
quotes: [
2,
'single',
{
avoidEscape: true,
allowTemplateLiterals: true
}
],
'prettier/prettier': [
'error',
{
trailingComma: 'none',
singleQuote: true,
printWidth: 80
}
]
}
};
50 changes: 50 additions & 0 deletions dydxjs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Logs
logs
*.log
npm-debug.log*

# Runtime data
pids
*.pid
*.seed

# out
dist
mjs
main
module

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules
jspm_packages

# Optional npm cache directory
.npm

# Optional REPL history
.node_repl_history

# Editors
.idea

# Lib
lib

# npm package lock
package-lock.json
yarn.lock

# others
.DS_Store
32 changes: 32 additions & 0 deletions dydxjs/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
*.log
npm-debug.log*

# Coverage directory used by tools like istanbul
coverage
.nyc_output

# Dependency directories
node_modules

# npm package lock
package-lock.json
yarn.lock

# project files
__fixtures__
__tests__
.babelrc
.babelrc.js
.editorconfig
.eslintignore
.eslintrc
.eslintrc.js
.gitignore
.travis.yml
.vscode
CHANGELOG.md
examples
jest.config.js
package.json
src
test
1 change: 1 addition & 0 deletions dydxjs/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
scripts-prepend-node-path=true
Loading

0 comments on commit 135a0b5

Please sign in to comment.