Skip to content

This repository is related to the 1inch (https://1inch.exchange) widget to swap ERC-20 tokens.

Notifications You must be signed in to change notification settings

ilhamm02/1inch-easy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 

Repository files navigation

1inch Easy Widget

How to use

  1. Download the script.js and style.css and then add this above <body> or below </body> (recommended) of your script
<script src="script.js"></script>
  • Jquery Loader (3.5.1 is recommended version)
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.js"></script>
  • Web3
<script src="https://cdn.jsdelivr.net/gh/ethereum/web3.js@1.3.1/dist/web3.min.js"></script>
  1. Add thid css above <body of your script to make 'style' of the widget
<link rel="stylesheet" href="style.css">
  1. In your HTML script add div with id swapInch to show the widget
  2. To show the widget swap, you should using this function (onclick or whatever)
swap(<FROM_TOKEN_ADDRESS>,<TO_TOKEN_ADDRESS>)

Demo

https://okesip.xyz/1inch