Coder Social home page Coder Social 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

Install from script (recommended)

paste the following into your terminal to install 1inch-cli

curl -L https://raw.githubusercontent.com/liquiditygoblin/1inch-cli/main/install.sh | bash

change directory to 1inch-cli

cd  1inch-cli

Then to run 1inch-cli just run

./run.sh

Upon running the script for the first time, you will be prompted to create a keystore, a keystore is a password protected way to store your private key, it is more secure than storing your private key in plain text. If you do not want to create a keystore, you can just press enter and continue without a wallet. You will then be asked to enter your private key, paste it in and press enter. You will then be prompted to create a password, make sure to appropriately back up both your private key/seed phrase and your password. Your keystore will then be created in keystore.json and you will be able to use 1inch-cli. To use a new wallet, simply move keystore.json out of the directory and run ./run.sh again, you will be prompted to create a new keystore.

if you don't know where to find your private key, 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

Install from source

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

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.

Usage

Upon running the script, the user will be prompted with many select modals, just type the number of the choice you'd like and hit enter.

To select a token, either type the symbol of the token you'd like to select or the paste the address of the token.

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.

Referral Notice

1inch-cli takes a small referral fee on each trade, if you find this tool useful & wish to self refer or remove this, please consider donating at 0xdb5D4e46AeE4Eb45768460abeEb03b6fB813819d

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.