- Run the code using
meteorcommand line - Open a
meteor shell - Insert new data using:
Articles.insert({title: "This is a new article", pubdate: new Date})
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "name": "paraswap_api_trade", | |
| "version": "1.0.0", | |
| "main": "index.js", | |
| "license": "MIT", | |
| "dependencies": { | |
| "bignumber.js": "^9.0.1", | |
| "axios": "^0.19.0" | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "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" | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pragma solidity 0.5.11; | |
| pragma experimental ABIEncoderV2; | |
| interface IAugustusSwapper { | |
| struct Route { | |
| address payable exchange; | |
| address targetExchange; | |
| uint percent; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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){ |