Giter Club home page Giter Club logo

1inch-cli's Introduction

1inch-cli

A command-line interface for the 1inch.exchange decentralized exchange aggregator.

Supports on-chain trading and advanced order types, letting you TWAP in to $PEPE and take profit with a trigger order!

WARNING: this is in beta, txs could revert, things might break, please be careful with your wallet and your funds when using this, I am not responsible for any losses

1inch recently blocked cloud providers from accessing their API, you may run into issues running this from a major data centre, please open a PR if you have any work arounds!

Requirements

  • Python 3.8 or higher

Installation

Clone the repository:

$ git clone https://github.com/user/repo.git
$ cd repo/1inch-cli

Create a virtual environment and install the required packages:

$ python3 -m venv venv
$ source venv/bin/activate
$ pip install -r requirements.txt

Next, add your private key to environment variables, if you don't know where to find one, follow this tutorial to get your private key from metamask https://support.metamask.io/hc/en-us/articles/360015289632-How-to-export-an-account-s-private-key

WARNING: this is an unencrypted hot wallet, be careful with your private key. Future updates will include a more secure way to store your private key (keystores & eventually hardware wallet), but for now, this is the only way to use the CLI.

export PRIVATE_KEY="0x<YOUR_KEY_HERE>"

Usage

To use the 1inch cli, run:

$ python main.py

The script will guide you through the process of selecting the tokens to swap and the amount to exchange.

Features

  • Select the chain (Ethereum, Arbitrum, etc.) and the RPC endpoint
  • Select the token list
  • Select the token pair to swap
  • Enter the amount to swap or use the maximum available balance
  • Get a quote for the swap
  • Advanced swap types, TWAP & Trigger

Contributing

Contributions are welcome! Please feel free to submit a pull request or an issue.

License

This project is licensed under the MIT License.

1inch-cli's People

Contributors

liquiditygoblin avatar apegurus avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.