@depay/web3-payments
Advanced tools
Comparing version 10.8.4 to 10.9.0
@@ -58,2 +58,6 @@ import { CONSTANTS } from '@depay/web3-constants'; | ||
}, | ||
weth: { | ||
wrap: { address: '0xF4cc97D00dD0639c3e383D7CafB3d815616cbB2C' }, | ||
unwrap: { address: '0xf2b8f3B0f0Af68816107f53aaDbbF84525d3BeFe' }, | ||
}, | ||
uniswap_v2: { | ||
@@ -85,2 +89,6 @@ address: '0xe04b08Dfc6CaA0F4Ec523a3Ae283Ece7efE00019', | ||
}, | ||
wbnb: { | ||
wrap: { address: '0xf361888459a4C863a8498ee344C2688C9196Be51' }, | ||
unwrap: { address: '0x271a502587c9b29f3348D92f74d6058AEf8F6A32' }, | ||
}, | ||
pancakeswap: { | ||
@@ -112,2 +120,6 @@ address: '0xAC3Ec4e420DD78bA86d932501E1f3867dbbfb77B', | ||
}, | ||
wmatic: { | ||
wrap: { address: '0x8B62F604499c1204573664447D445690E0A0011b' }, | ||
unwrap: { address: '0x864F165a58e74349cf9C7925217F10B58040db86' }, | ||
}, | ||
quickswap: { | ||
@@ -166,3 +178,3 @@ address: '0x0Dfb7137bC64b63F7a0de7Cb9CDa178702666220', | ||
if(exchangeRoute) { | ||
if(paymentRoute.exchangePlugin) { | ||
if(paymentRoute.exchangePlugin && paymentRoute.exchangePlugin.prepareTransaction) { | ||
transaction = paymentRoute.exchangePlugin.prepareTransaction(transaction); | ||
@@ -244,7 +256,14 @@ } | ||
if(exchangeRoute) { | ||
amounts = [ | ||
exchangeRoute.amountIn.toString(), | ||
subtractFee({ amount: exchangeRoute.amountOutMin.toString(), paymentRoute, fee }), | ||
Math.round(Date.now() / 1000) + 30 * 60, // 30 minutes | ||
]; | ||
if(exchangeRoute && exchangeRoute.exchange.wrapper) { | ||
amounts = [ | ||
exchangeRoute.amountIn.toString(), | ||
subtractFee({ amount: exchangeRoute.amountOutMin.toString(), paymentRoute, fee }) | ||
]; | ||
} else { | ||
amounts = [ | ||
exchangeRoute.amountIn.toString(), | ||
subtractFee({ amount: exchangeRoute.amountOutMin.toString(), paymentRoute, fee }), | ||
Math.round(Date.now() / 1000) + 30 * 60, // 30 minutes | ||
]; | ||
} | ||
} else { | ||
@@ -299,3 +318,9 @@ amounts = [ | ||
paymentRoute.exchangePlugin = plugins[paymentRoute.blockchain][exchangeRoute.exchange.name]; | ||
paymentPlugins.push(paymentRoute.exchangePlugin.address); | ||
if(paymentRoute.exchangePlugin.wrap && paymentRoute.fromToken.address == CONSTANTS[paymentRoute.blockchain].NATIVE) { | ||
paymentPlugins.push(paymentRoute.exchangePlugin.wrap.address); | ||
} else if(paymentRoute.exchangePlugin.wrap && paymentRoute.fromToken.address == CONSTANTS[paymentRoute.blockchain].WRAPPED) { | ||
paymentPlugins.push(paymentRoute.exchangePlugin.unwrap.address); | ||
} else { | ||
paymentPlugins.push(paymentRoute.exchangePlugin.address); | ||
} | ||
} | ||
@@ -1000,6 +1025,6 @@ | ||
.then(filterInsufficientBalance) | ||
.then((routes)=>addTransactions({ routes, event, fee })) | ||
.then(addRouteAmounts) | ||
.then(addApproval) | ||
.then(sortPaymentRoutes) | ||
.then((routes)=>addTransactions({ routes, event, fee })) | ||
.then(addRouteAmounts) | ||
.then(filterDuplicateFromTokens) | ||
@@ -1144,3 +1169,3 @@ } | ||
} else { | ||
routes[index].approvalRequired = ethers.BigNumber.from(route.fromBalance).gte(ethers.BigNumber.from(allowances[index])); | ||
routes[index].approvalRequired = ethers.BigNumber.from(route.fromAmount).gte(ethers.BigNumber.from(allowances[index])); | ||
if(routes[index].approvalRequired) { | ||
@@ -1147,0 +1172,0 @@ routes[index].approvalTransaction = { |
@@ -58,2 +58,6 @@ import { CONSTANTS } from '@depay/web3-constants'; | ||
}, | ||
weth: { | ||
wrap: { address: '0xF4cc97D00dD0639c3e383D7CafB3d815616cbB2C' }, | ||
unwrap: { address: '0xf2b8f3B0f0Af68816107f53aaDbbF84525d3BeFe' }, | ||
}, | ||
uniswap_v2: { | ||
@@ -85,2 +89,6 @@ address: '0xe04b08Dfc6CaA0F4Ec523a3Ae283Ece7efE00019', | ||
}, | ||
wbnb: { | ||
wrap: { address: '0xf361888459a4C863a8498ee344C2688C9196Be51' }, | ||
unwrap: { address: '0x271a502587c9b29f3348D92f74d6058AEf8F6A32' }, | ||
}, | ||
pancakeswap: { | ||
@@ -112,2 +120,6 @@ address: '0xAC3Ec4e420DD78bA86d932501E1f3867dbbfb77B', | ||
}, | ||
wmatic: { | ||
wrap: { address: '0x8B62F604499c1204573664447D445690E0A0011b' }, | ||
unwrap: { address: '0x864F165a58e74349cf9C7925217F10B58040db86' }, | ||
}, | ||
quickswap: { | ||
@@ -166,3 +178,3 @@ address: '0x0Dfb7137bC64b63F7a0de7Cb9CDa178702666220', | ||
if(exchangeRoute) { | ||
if(paymentRoute.exchangePlugin) { | ||
if(paymentRoute.exchangePlugin && paymentRoute.exchangePlugin.prepareTransaction) { | ||
transaction = paymentRoute.exchangePlugin.prepareTransaction(transaction); | ||
@@ -244,7 +256,14 @@ } | ||
if(exchangeRoute) { | ||
amounts = [ | ||
exchangeRoute.amountIn.toString(), | ||
subtractFee({ amount: exchangeRoute.amountOutMin.toString(), paymentRoute, fee }), | ||
Math.round(Date.now() / 1000) + 30 * 60, // 30 minutes | ||
]; | ||
if(exchangeRoute && exchangeRoute.exchange.wrapper) { | ||
amounts = [ | ||
exchangeRoute.amountIn.toString(), | ||
subtractFee({ amount: exchangeRoute.amountOutMin.toString(), paymentRoute, fee }) | ||
]; | ||
} else { | ||
amounts = [ | ||
exchangeRoute.amountIn.toString(), | ||
subtractFee({ amount: exchangeRoute.amountOutMin.toString(), paymentRoute, fee }), | ||
Math.round(Date.now() / 1000) + 30 * 60, // 30 minutes | ||
]; | ||
} | ||
} else { | ||
@@ -299,3 +318,9 @@ amounts = [ | ||
paymentRoute.exchangePlugin = plugins[paymentRoute.blockchain][exchangeRoute.exchange.name]; | ||
paymentPlugins.push(paymentRoute.exchangePlugin.address); | ||
if(paymentRoute.exchangePlugin.wrap && paymentRoute.fromToken.address == CONSTANTS[paymentRoute.blockchain].NATIVE) { | ||
paymentPlugins.push(paymentRoute.exchangePlugin.wrap.address); | ||
} else if(paymentRoute.exchangePlugin.wrap && paymentRoute.fromToken.address == CONSTANTS[paymentRoute.blockchain].WRAPPED) { | ||
paymentPlugins.push(paymentRoute.exchangePlugin.unwrap.address); | ||
} else { | ||
paymentPlugins.push(paymentRoute.exchangePlugin.address); | ||
} | ||
} | ||
@@ -1000,6 +1025,6 @@ | ||
.then(filterInsufficientBalance) | ||
.then((routes)=>addTransactions({ routes, event, fee })) | ||
.then(addRouteAmounts) | ||
.then(addApproval) | ||
.then(sortPaymentRoutes) | ||
.then((routes)=>addTransactions({ routes, event, fee })) | ||
.then(addRouteAmounts) | ||
.then(filterDuplicateFromTokens) | ||
@@ -1144,3 +1169,3 @@ } | ||
} else { | ||
routes[index].approvalRequired = ethers.BigNumber.from(route.fromBalance).gte(ethers.BigNumber.from(allowances[index])); | ||
routes[index].approvalRequired = ethers.BigNumber.from(route.fromAmount).gte(ethers.BigNumber.from(allowances[index])); | ||
if(routes[index].approvalRequired) { | ||
@@ -1147,0 +1172,0 @@ routes[index].approvalTransaction = { |
@@ -58,2 +58,6 @@ (function (global, factory) { | ||
}, | ||
weth: { | ||
wrap: { address: '0xF4cc97D00dD0639c3e383D7CafB3d815616cbB2C' }, | ||
unwrap: { address: '0xf2b8f3B0f0Af68816107f53aaDbbF84525d3BeFe' }, | ||
}, | ||
uniswap_v2: { | ||
@@ -85,2 +89,6 @@ address: '0xe04b08Dfc6CaA0F4Ec523a3Ae283Ece7efE00019', | ||
}, | ||
wbnb: { | ||
wrap: { address: '0xf361888459a4C863a8498ee344C2688C9196Be51' }, | ||
unwrap: { address: '0x271a502587c9b29f3348D92f74d6058AEf8F6A32' }, | ||
}, | ||
pancakeswap: { | ||
@@ -112,2 +120,6 @@ address: '0xAC3Ec4e420DD78bA86d932501E1f3867dbbfb77B', | ||
}, | ||
wmatic: { | ||
wrap: { address: '0x8B62F604499c1204573664447D445690E0A0011b' }, | ||
unwrap: { address: '0x864F165a58e74349cf9C7925217F10B58040db86' }, | ||
}, | ||
quickswap: { | ||
@@ -166,3 +178,3 @@ address: '0x0Dfb7137bC64b63F7a0de7Cb9CDa178702666220', | ||
if(exchangeRoute) { | ||
if(paymentRoute.exchangePlugin) { | ||
if(paymentRoute.exchangePlugin && paymentRoute.exchangePlugin.prepareTransaction) { | ||
transaction = paymentRoute.exchangePlugin.prepareTransaction(transaction); | ||
@@ -244,7 +256,14 @@ } | ||
if(exchangeRoute) { | ||
amounts = [ | ||
exchangeRoute.amountIn.toString(), | ||
subtractFee({ amount: exchangeRoute.amountOutMin.toString(), paymentRoute, fee }), | ||
Math.round(Date.now() / 1000) + 30 * 60, // 30 minutes | ||
]; | ||
if(exchangeRoute && exchangeRoute.exchange.wrapper) { | ||
amounts = [ | ||
exchangeRoute.amountIn.toString(), | ||
subtractFee({ amount: exchangeRoute.amountOutMin.toString(), paymentRoute, fee }) | ||
]; | ||
} else { | ||
amounts = [ | ||
exchangeRoute.amountIn.toString(), | ||
subtractFee({ amount: exchangeRoute.amountOutMin.toString(), paymentRoute, fee }), | ||
Math.round(Date.now() / 1000) + 30 * 60, // 30 minutes | ||
]; | ||
} | ||
} else { | ||
@@ -299,3 +318,9 @@ amounts = [ | ||
paymentRoute.exchangePlugin = plugins[paymentRoute.blockchain][exchangeRoute.exchange.name]; | ||
paymentPlugins.push(paymentRoute.exchangePlugin.address); | ||
if(paymentRoute.exchangePlugin.wrap && paymentRoute.fromToken.address == web3Constants.CONSTANTS[paymentRoute.blockchain].NATIVE) { | ||
paymentPlugins.push(paymentRoute.exchangePlugin.wrap.address); | ||
} else if(paymentRoute.exchangePlugin.wrap && paymentRoute.fromToken.address == web3Constants.CONSTANTS[paymentRoute.blockchain].WRAPPED) { | ||
paymentPlugins.push(paymentRoute.exchangePlugin.unwrap.address); | ||
} else { | ||
paymentPlugins.push(paymentRoute.exchangePlugin.address); | ||
} | ||
} | ||
@@ -1000,6 +1025,6 @@ | ||
.then(filterInsufficientBalance) | ||
.then((routes)=>addTransactions({ routes, event, fee })) | ||
.then(addRouteAmounts) | ||
.then(addApproval) | ||
.then(sortPaymentRoutes) | ||
.then((routes)=>addTransactions({ routes, event, fee })) | ||
.then(addRouteAmounts) | ||
.then(filterDuplicateFromTokens) | ||
@@ -1144,3 +1169,3 @@ } | ||
} else { | ||
routes[index].approvalRequired = ethers.ethers.BigNumber.from(route.fromBalance).gte(ethers.ethers.BigNumber.from(allowances[index])); | ||
routes[index].approvalRequired = ethers.ethers.BigNumber.from(route.fromAmount).gte(ethers.ethers.BigNumber.from(allowances[index])); | ||
if(routes[index].approvalRequired) { | ||
@@ -1147,0 +1172,0 @@ routes[index].approvalTransaction = { |
@@ -58,2 +58,6 @@ (function (global, factory) { | ||
}, | ||
weth: { | ||
wrap: { address: '0xF4cc97D00dD0639c3e383D7CafB3d815616cbB2C' }, | ||
unwrap: { address: '0xf2b8f3B0f0Af68816107f53aaDbbF84525d3BeFe' }, | ||
}, | ||
uniswap_v2: { | ||
@@ -85,2 +89,6 @@ address: '0xe04b08Dfc6CaA0F4Ec523a3Ae283Ece7efE00019', | ||
}, | ||
wbnb: { | ||
wrap: { address: '0xf361888459a4C863a8498ee344C2688C9196Be51' }, | ||
unwrap: { address: '0x271a502587c9b29f3348D92f74d6058AEf8F6A32' }, | ||
}, | ||
pancakeswap: { | ||
@@ -112,2 +120,6 @@ address: '0xAC3Ec4e420DD78bA86d932501E1f3867dbbfb77B', | ||
}, | ||
wmatic: { | ||
wrap: { address: '0x8B62F604499c1204573664447D445690E0A0011b' }, | ||
unwrap: { address: '0x864F165a58e74349cf9C7925217F10B58040db86' }, | ||
}, | ||
quickswap: { | ||
@@ -166,3 +178,3 @@ address: '0x0Dfb7137bC64b63F7a0de7Cb9CDa178702666220', | ||
if(exchangeRoute) { | ||
if(paymentRoute.exchangePlugin) { | ||
if(paymentRoute.exchangePlugin && paymentRoute.exchangePlugin.prepareTransaction) { | ||
transaction = paymentRoute.exchangePlugin.prepareTransaction(transaction); | ||
@@ -244,7 +256,14 @@ } | ||
if(exchangeRoute) { | ||
amounts = [ | ||
exchangeRoute.amountIn.toString(), | ||
subtractFee({ amount: exchangeRoute.amountOutMin.toString(), paymentRoute, fee }), | ||
Math.round(Date.now() / 1000) + 30 * 60, // 30 minutes | ||
]; | ||
if(exchangeRoute && exchangeRoute.exchange.wrapper) { | ||
amounts = [ | ||
exchangeRoute.amountIn.toString(), | ||
subtractFee({ amount: exchangeRoute.amountOutMin.toString(), paymentRoute, fee }) | ||
]; | ||
} else { | ||
amounts = [ | ||
exchangeRoute.amountIn.toString(), | ||
subtractFee({ amount: exchangeRoute.amountOutMin.toString(), paymentRoute, fee }), | ||
Math.round(Date.now() / 1000) + 30 * 60, // 30 minutes | ||
]; | ||
} | ||
} else { | ||
@@ -299,3 +318,9 @@ amounts = [ | ||
paymentRoute.exchangePlugin = plugins[paymentRoute.blockchain][exchangeRoute.exchange.name]; | ||
paymentPlugins.push(paymentRoute.exchangePlugin.address); | ||
if(paymentRoute.exchangePlugin.wrap && paymentRoute.fromToken.address == web3Constants.CONSTANTS[paymentRoute.blockchain].NATIVE) { | ||
paymentPlugins.push(paymentRoute.exchangePlugin.wrap.address); | ||
} else if(paymentRoute.exchangePlugin.wrap && paymentRoute.fromToken.address == web3Constants.CONSTANTS[paymentRoute.blockchain].WRAPPED) { | ||
paymentPlugins.push(paymentRoute.exchangePlugin.unwrap.address); | ||
} else { | ||
paymentPlugins.push(paymentRoute.exchangePlugin.address); | ||
} | ||
} | ||
@@ -1000,6 +1025,6 @@ | ||
.then(filterInsufficientBalance) | ||
.then((routes)=>addTransactions({ routes, event, fee })) | ||
.then(addRouteAmounts) | ||
.then(addApproval) | ||
.then(sortPaymentRoutes) | ||
.then((routes)=>addTransactions({ routes, event, fee })) | ||
.then(addRouteAmounts) | ||
.then(filterDuplicateFromTokens) | ||
@@ -1144,3 +1169,3 @@ } | ||
} else { | ||
routes[index].approvalRequired = ethers.ethers.BigNumber.from(route.fromBalance).gte(ethers.ethers.BigNumber.from(allowances[index])); | ||
routes[index].approvalRequired = ethers.ethers.BigNumber.from(route.fromAmount).gte(ethers.ethers.BigNumber.from(allowances[index])); | ||
if(routes[index].approvalRequired) { | ||
@@ -1147,0 +1172,0 @@ routes[index].approvalTransaction = { |
{ | ||
"name": "@depay/web3-payments", | ||
"moduleName": "Web3Payments", | ||
"version": "10.8.4", | ||
"version": "10.9.0", | ||
"description": "JavaScript library to scan crypto wallets for liquefiable assets and calculate most cost-effective payment routing.", | ||
@@ -41,3 +41,3 @@ "main": "dist/umd/index.js", | ||
"@depay/web3-constants": "^6.3.2", | ||
"@depay/web3-exchanges": "^11.2.3", | ||
"@depay/web3-exchanges": "^11.3.2", | ||
"@depay/web3-tokens": "^9.12.8", | ||
@@ -58,12 +58,12 @@ "ethers": "^5.7.1" | ||
"@depay/web3-blockchains": "^6.2.3", | ||
"@depay/web3-client": "^10.1.23", | ||
"@depay/web3-client-evm": "^10.1.23", | ||
"@depay/web3-client": "^10.2.1", | ||
"@depay/web3-client-evm": "^10.2.1", | ||
"@depay/web3-constants": "^6.3.2", | ||
"@depay/web3-exchanges": "^11.2.3", | ||
"@depay/web3-exchanges-evm": "^11.2.3", | ||
"@depay/web3-exchanges": "^11.3.2", | ||
"@depay/web3-exchanges-evm": "^11.3.2", | ||
"@depay/web3-mock": "^13.22.11", | ||
"@depay/web3-tokens": "^9.12.8", | ||
"@depay/web3-tokens-evm": "^9.12.8", | ||
"@depay/web3-wallets": "^12.3.10", | ||
"@depay/web3-wallets-evm": "^12.3.10", | ||
"@depay/web3-wallets": "^12.4.0", | ||
"@depay/web3-wallets-evm": "^12.4.0", | ||
"@rollup/plugin-commonjs": "^18.0.0", | ||
@@ -70,0 +70,0 @@ "@rollup/plugin-node-resolve": "^11.2.1", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
206527
4680