Releases: DePayFi/web3-exchanges
Releases · DePayFi/web3-exchanges
v13.2.2
update web3-blockchains
v13.2.1
fix pancakeswap v3
v13.2.0
adds uniswapV3 getTransaction({ inputTokenPushed: true })
v13.1.0
sort returning routes (best first)
v13.0.0
v13
New
getPrep
Allows you to perform actions required prior to executing an exchange:
// check if prep is required to facilitate swap/exchange
const preparation = await route.getPrep({ account })
let permit2
if(prep?.transaction) {
await wallet.sendTransaction(prep.transaction)
} else if (prep?.signature) {
let signature = wallet.sign(prep.signature)
permit2 = {...prep.signature.message, signature}
}
const transaction = await route.getTransaction({ account, permit2 })
Breaking Changes
route
before
import { route } from '@depay/web3-exchanges'
let routes = await route({ ... })
now
import Exchanges from '@depay/web3-exchanges'
let routes = await Exchanges.route({ ... })
getTransaction
before
const transaction = await route.getTransaction({ from })
now
const transaction = await route.getTransaction({ account })
find
before
import { find } from '@depay/web3-exchanges'
let exchange = find({ blockchain: 'ethereum', name: 'uniswap_v2' })
now
import Exchanges from '@depay/web3-exchanges'
let exchange = Exchanges.uniswap_v2 || Exchanges.ethereum.uniswap_v2
getTransaction from -> account
before
route.getTransaction({ account: '0x...' })
now
route.getTransaction({ account: '0x...' })
v12.2.14
fix Web3Token dependency issue
v12.2.13
fix release
v12.2.12
fix updated dependencies
v12.2.10
fix edge-case routing on solana + upgrade dependencies
v12.2.9
return a copy of accounts instead of mutating accounts