UNPKG

@gooddollar/goodcontracts

Version:
26 lines (25 loc) 1.1 kB
var sdk = require("simple-uniswap-sdk"); var chainNames = require("simple-uniswap-sdk/dist/enums/chain-id"); const uniswapPair = new sdk.UniswapPair({ // the contract address of the token you want to convert FROM fromTokenContractAddress: "0x0BE9e53fd7EDaC9F859882AfdDa116645287C629", // the contract address of the token you want to convert TO toTokenContractAddress: "0x495d133B938596C9984d462F007B676bDc57eCEC", // the ethereum address of the user using this part of the dApp ethereumAddress: "0xB1E6079212888f0bE0cf55874B2EB9d7a5e02cD9", chainId: 122, // you can pass in the provider url as well if you want providerUrl: "https://rpc.fuse.io", settings: new sdk.UniswapPairSettings({ // if not supplied it will use `0.005` which is 0.5% // please pass it in as a full number decimal so 0.7% // would be 0.007 slippage: 0.005, // if not supplied it will use 20 a deadline minutes deadlineMinutes: 20, // if not supplied it will try to use multihops // if this is true it will require swaps to direct // pairs disableMultihops: false }) });