Skip to content

Instantly share code, notes, and snippets.

View mounibec's full-sized avatar

Mounir Benchemled mounibec

  • paraswap.io
  • Portugal
View GitHub Profile
{
"name": "paraswap_api_trade",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"dependencies": {
"bignumber.js": "^9.0.1",
"axios": "^0.19.0"
}
}
{
"name": "paraswap-trade-examples",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"dependencies": {
"bignumber.js": "^9.0.1",
"paraswap": "^4.1.2",
"web3": "^1.3.5"
}
pragma solidity 0.7.5;
pragma experimental ABIEncoderV2;
import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol";
interface IAugustusSwapper {
/**
* @param fromToken Address of the source token
* @param fromAmount Amount of source tokens to be swapped
@mounibec
mounibec / IAugustusSwapper.sol
Last active October 21, 2023 09:08
ParaSwap's AugustusSwapper Interface
pragma solidity 0.5.11;
pragma experimental ABIEncoderV2;
interface IAugustusSwapper {
struct Route {
address payable exchange;
address targetExchange;
uint percent;
const {ParaSwap} = require("paraswap");
const BN = require('bignumber.js');
const paraSwap = new ParaSwap(1, 'https://paraswap.io/api/v1');
async function getTokens(){
return await paraSwap.getTokens();
}
async function getPrice(tokenFrom, tokenTo, srcAmount){
@mounibec
mounibec / README.md
Last active January 25, 2016 00:34
Twitter like notifications using Meteor.

Test

  • Run the code using meteor command line
  • Open a meteor shell
  • Insert new data using: Articles.insert({title: "This is a new article", pubdate: new Date})