v1.7.0
π¦ module to simplify uniswap interactions
Repository
Current version released
4 months ago
Freedomswaps
π¦ module to simplify uniswap interactions by leveraging smart contracts like Freedomswaps fostering the adoption of decentralized exchanges.
Thanks to brightinventions.pl.
Usage Example Via TypeScript
import { FreedomSwaps } from "https://deno.land/x/freedomswaps/mod.ts"
const tokenIn = "0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270" // Matic on Polygon POS
const tokenOut = "0x099471B71c9D8b0C6b616eE9A7C645e22cA9cfF7" // Freiheit on Polygon POS
const amountIn = 1
const poolFee = 10000
const slippage = 30
const providerURL = Deno.args[0]
const pkTestWallet = Deno.args[1]
if (providerURL === undefined || pkTestWallet === undefined) {
throw new Error("parameter missing")
}
const freedomSwaps = await FreedomSwaps.getInstance(providerURL)
await freedomSwaps.swap(tokenIn, tokenOut, amountIn, poolFee, slippage, pkTestWallet)
Usage Example Static Via Terminal
# deno run --allow-net --allow-read --allow-write --allow-env https://deno.land/x/freedomswaps/usage-example-static.ts <tokenIn> <tokenOut> <amountIn> <poolFee> <slippage> <providerURL> <privateKeyTestWallet>
deno run --allow-net --allow-read --allow-write --allow-env https://deno.land/x/freedomswaps/usage-example-static.ts 0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270 0x099471B71c9D8b0C6b616eE9A7C645e22cA9cfF7 1 10000 9 https://polygon-mainnet.g.alchemy.com/v2/... <your experimental pk>
About us
We are Friends of Satoshi.
Chancellor on brink of second bailout for banks.
We are free.