rubic-sdk 4.30.0-alpha-lifi-sdk-upd.1 → 4.30.0-alpha-lifi-sdk-upd.2
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/rubic-sdk.min.js +981 -956
- package/dist/rubic-sdk.min.js.map +1 -1
- package/lib/features/cross-chain/calculation-manager/providers/changenow-provider/changenow-cross-chain-trade.d.ts +1 -1
- package/lib/features/on-chain/calculation-manager/constants/trade-providers/uniswap-v2-trade-providers.d.ts +2 -1
- package/lib/features/on-chain/calculation-manager/constants/trade-providers/uniswap-v2-trade-providers.js +2 -0
- package/lib/features/on-chain/calculation-manager/constants/trade-providers/uniswap-v2-trade-providers.js.map +1 -1
- package/lib/features/on-chain/calculation-manager/providers/common/models/on-chain-trade-type.d.ts +1 -0
- package/lib/features/on-chain/calculation-manager/providers/common/models/on-chain-trade-type.js +1 -0
- package/lib/features/on-chain/calculation-manager/providers/common/models/on-chain-trade-type.js.map +1 -1
- package/lib/features/on-chain/calculation-manager/providers/dexes/base/aerodrome/aerodrome-abi.d.ts +2 -0
- package/lib/features/on-chain/calculation-manager/providers/dexes/base/aerodrome/aerodrome-abi.js +253 -0
- package/lib/features/on-chain/calculation-manager/providers/dexes/base/aerodrome/aerodrome-abi.js.map +1 -0
- package/lib/features/on-chain/calculation-manager/providers/dexes/base/aerodrome/aerodrome-path-factory.d.ts +8 -0
- package/lib/features/on-chain/calculation-manager/providers/dexes/base/aerodrome/aerodrome-path-factory.js +105 -0
- package/lib/features/on-chain/calculation-manager/providers/dexes/base/aerodrome/aerodrome-path-factory.js.map +1 -0
- package/lib/features/on-chain/calculation-manager/providers/dexes/base/aerodrome/aerodrome-provider.d.ts +15 -0
- package/lib/features/on-chain/calculation-manager/providers/dexes/base/aerodrome/aerodrome-provider.js +29 -0
- package/lib/features/on-chain/calculation-manager/providers/dexes/base/aerodrome/aerodrome-provider.js.map +1 -0
- package/lib/features/on-chain/calculation-manager/providers/dexes/base/aerodrome/aerodrome-trade.d.ts +8 -0
- package/lib/features/on-chain/calculation-manager/providers/dexes/base/aerodrome/aerodrome-trade.js +30 -0
- package/lib/features/on-chain/calculation-manager/providers/dexes/base/aerodrome/aerodrome-trade.js.map +1 -0
- package/lib/features/on-chain/calculation-manager/providers/dexes/base/aerodrome/constants.d.ts +3 -0
- package/lib/features/on-chain/calculation-manager/providers/dexes/base/aerodrome/constants.js +10 -0
- package/lib/features/on-chain/calculation-manager/providers/dexes/base/aerodrome/constants.js.map +1 -0
- package/lib/features/on-chain/calculation-manager/providers/dexes/common/uniswap-v2-abstract/constants/uniswap-v2-abi.js +0 -492
- package/lib/features/on-chain/calculation-manager/providers/dexes/common/uniswap-v2-abstract/constants/uniswap-v2-abi.js.map +1 -1
- package/lib/features/on-chain/calculation-manager/providers/dexes/common/uniswap-v2-abstract/models/aerodrome-route-method-arguments.d.ts +2 -0
- package/lib/features/on-chain/calculation-manager/providers/dexes/common/uniswap-v2-abstract/models/aerodrome-route-method-arguments.js +3 -0
- package/lib/features/on-chain/calculation-manager/providers/dexes/common/uniswap-v2-abstract/models/aerodrome-route-method-arguments.js.map +1 -0
- package/lib/features/on-chain/calculation-manager/providers/dexes/common/uniswap-v2-abstract/models/route-method-arguments.d.ts +3 -0
- package/lib/features/on-chain/calculation-manager/providers/dexes/common/uniswap-v2-abstract/models/route-method-arguments.js +3 -0
- package/lib/features/on-chain/calculation-manager/providers/dexes/common/uniswap-v2-abstract/models/route-method-arguments.js.map +1 -0
- package/lib/features/on-chain/calculation-manager/providers/dexes/common/uniswap-v2-abstract/models/uniswap-route.d.ts +2 -0
- package/lib/features/on-chain/calculation-manager/providers/dexes/common/uniswap-v2-abstract/models/uniswap-v2-trade-struct.d.ts +2 -0
- package/lib/features/on-chain/calculation-manager/providers/dexes/common/uniswap-v2-abstract/path-factory.d.ts +9 -8
- package/lib/features/on-chain/calculation-manager/providers/dexes/common/uniswap-v2-abstract/path-factory.js +1 -0
- package/lib/features/on-chain/calculation-manager/providers/dexes/common/uniswap-v2-abstract/path-factory.js.map +1 -1
- package/lib/features/on-chain/calculation-manager/providers/dexes/common/uniswap-v2-abstract/uniswap-v2-abstract-provider.d.ts +3 -1
- package/lib/features/on-chain/calculation-manager/providers/dexes/common/uniswap-v2-abstract/uniswap-v2-abstract-provider.js +2 -0
- package/lib/features/on-chain/calculation-manager/providers/dexes/common/uniswap-v2-abstract/uniswap-v2-abstract-provider.js.map +1 -1
- package/lib/features/on-chain/calculation-manager/providers/dexes/common/uniswap-v2-abstract/uniswap-v2-abstract-trade.d.ts +7 -3
- package/lib/features/on-chain/calculation-manager/providers/dexes/common/uniswap-v2-abstract/uniswap-v2-abstract-trade.js +1 -0
- package/lib/features/on-chain/calculation-manager/providers/dexes/common/uniswap-v2-abstract/uniswap-v2-abstract-trade.js.map +1 -1
- package/lib/features/on-chain/calculation-manager/providers/dexes/moonriver/solarbeam/solarbeam-trade.d.ts +2 -1
- package/lib/features/on-chain/calculation-manager/providers/dexes/moonriver/solarbeam/solarbeam-trade.js.map +1 -1
- package/lib/features/on-chain/calculation-manager/providers/dexes/zksync/mute-swap/mute-swap-trade.d.ts +2 -1
- package/lib/features/on-chain/calculation-manager/providers/dexes/zksync/mute-swap/mute-swap-trade.js.map +1 -1
- package/lib/index.d.ts +7 -0
- package/lib/index.js +7 -0
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
package/dist/rubic-sdk.min.js
CHANGED
@@ -228076,6 +228076,7 @@ const wanna_swap_aurora_provider_1 = __webpack_require__(/*! ../../providers/dex
|
|
228076
228076
|
const joe_provider_1 = __webpack_require__(/*! ../../providers/dexes/avalanche/joe/joe-provider */ "./src/features/on-chain/calculation-manager/providers/dexes/avalanche/joe/joe-provider.ts");
|
228077
228077
|
const pangolin_provider_1 = __webpack_require__(/*! ../../providers/dexes/avalanche/pangolin/pangolin-provider */ "./src/features/on-chain/calculation-manager/providers/dexes/avalanche/pangolin/pangolin-provider.ts");
|
228078
228078
|
const sushi_swap_avalanche_provider_1 = __webpack_require__(/*! ../../providers/dexes/avalanche/sushi-swap-avalanche/sushi-swap-avalanche-provider */ "./src/features/on-chain/calculation-manager/providers/dexes/avalanche/sushi-swap-avalanche/sushi-swap-avalanche-provider.ts");
|
228079
|
+
const aerodrome_provider_1 = __webpack_require__(/*! ../../providers/dexes/base/aerodrome/aerodrome-provider */ "./src/features/on-chain/calculation-manager/providers/dexes/base/aerodrome/aerodrome-provider.ts");
|
228079
228080
|
const base_swap_provider_1 = __webpack_require__(/*! ../../providers/dexes/base/base-swap/base-swap-provider */ "./src/features/on-chain/calculation-manager/providers/dexes/base/base-swap/base-swap-provider.ts");
|
228080
228081
|
const oolong_swap_provider_1 = __webpack_require__(/*! ../../providers/dexes/boba/oolong-swap/oolong-swap-provider */ "./src/features/on-chain/calculation-manager/providers/dexes/boba/oolong-swap/oolong-swap-provider.ts");
|
228081
228082
|
const sushi_swap_bsc_provider_1 = __webpack_require__(/*! ../../providers/dexes/bsc/sushi-swap-bsc/sushi-swap-bsc-provider */ "./src/features/on-chain/calculation-manager/providers/dexes/bsc/sushi-swap-bsc/sushi-swap-bsc-provider.ts");
|
@@ -228195,6 +228196,7 @@ exports.UniswapV2TradeProviders = [
|
|
228195
228196
|
sushi_swap_pulsechain_provider_1.SushiSwapPulsechainProvider,
|
228196
228197
|
// Base
|
228197
228198
|
base_swap_provider_1.BaseSwapProvider,
|
228199
|
+
aerodrome_provider_1.AerodromeProvider,
|
228198
228200
|
// BSC Testnet
|
228199
228201
|
pancake_swap_testnet_provider_1.PancakeSwapTestnetProvider,
|
228200
228202
|
trader_joe_bsct_provider_1.TraderJoeBsctProvider,
|
@@ -228670,6 +228672,7 @@ exports.ON_CHAIN_TRADE_TYPE = void 0;
|
|
228670
228672
|
* List of on-chain trade types.
|
228671
228673
|
*/
|
228672
228674
|
exports.ON_CHAIN_TRADE_TYPE = {
|
228675
|
+
AERODROME: 'AERODROME',
|
228673
228676
|
ACRYPTOS: 'ACRYPTOS',
|
228674
228677
|
ALDRIN_EXCHANGE: 'ALDRIN_EXCHANGE',
|
228675
228678
|
ALGEBRA: 'ALGEBRA',
|
@@ -230956,74 +230959,551 @@ exports.XyDexAvalancheProvider = XyDexAvalancheProvider;
|
|
230956
230959
|
|
230957
230960
|
/***/ }),
|
230958
230961
|
|
230959
|
-
/***/ "./src/features/on-chain/calculation-manager/providers/dexes/base/
|
230960
|
-
|
230961
|
-
!*** ./src/features/on-chain/calculation-manager/providers/dexes/base/
|
230962
|
-
|
230963
|
-
/***/ ((__unused_webpack_module, exports
|
230962
|
+
/***/ "./src/features/on-chain/calculation-manager/providers/dexes/base/aerodrome/aerodrome-abi.ts":
|
230963
|
+
/*!***************************************************************************************************!*\
|
230964
|
+
!*** ./src/features/on-chain/calculation-manager/providers/dexes/base/aerodrome/aerodrome-abi.ts ***!
|
230965
|
+
\***************************************************************************************************/
|
230966
|
+
/***/ ((__unused_webpack_module, exports) => {
|
230964
230967
|
|
230965
230968
|
"use strict";
|
230966
230969
|
|
230967
230970
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
230968
|
-
exports.
|
230969
|
-
|
230970
|
-
|
230971
|
-
|
230972
|
-
|
230973
|
-
|
230974
|
-
|
230975
|
-
|
230976
|
-
|
230977
|
-
|
230978
|
-
|
230979
|
-
|
230980
|
-
|
230981
|
-
|
230971
|
+
exports.AERODROME_ABI = void 0;
|
230972
|
+
exports.AERODROME_ABI = [
|
230973
|
+
{
|
230974
|
+
inputs: [],
|
230975
|
+
name: 'ETHER',
|
230976
|
+
outputs: [{ internalType: 'address', name: '', type: 'address' }],
|
230977
|
+
stateMutability: 'view',
|
230978
|
+
type: 'function'
|
230979
|
+
},
|
230980
|
+
{
|
230981
|
+
inputs: [
|
230982
|
+
{ internalType: 'uint256[]', name: 'amounts', type: 'uint256[]' },
|
230983
|
+
{
|
230984
|
+
components: [
|
230985
|
+
{ internalType: 'address', name: 'from', type: 'address' },
|
230986
|
+
{ internalType: 'address', name: 'to', type: 'address' },
|
230987
|
+
{ internalType: 'bool', name: 'stable', type: 'bool' },
|
230988
|
+
{ internalType: 'address', name: 'factory', type: 'address' }
|
230989
|
+
],
|
230990
|
+
internalType: 'struct IRouter.Route[]',
|
230991
|
+
name: 'routes',
|
230992
|
+
type: 'tuple[]'
|
230993
|
+
},
|
230994
|
+
{ internalType: 'address', name: 'to', type: 'address' },
|
230995
|
+
{ internalType: 'uint256', name: 'deadline', type: 'uint256' }
|
230996
|
+
],
|
230997
|
+
name: 'UNSAFE_swapExactTokensForTokens',
|
230998
|
+
outputs: [{ internalType: 'uint256[]', name: '', type: 'uint256[]' }],
|
230999
|
+
stateMutability: 'nonpayable',
|
231000
|
+
type: 'function'
|
231001
|
+
},
|
231002
|
+
{
|
231003
|
+
inputs: [],
|
231004
|
+
name: 'defaultFactory',
|
231005
|
+
outputs: [{ internalType: 'address', name: '', type: 'address' }],
|
231006
|
+
stateMutability: 'view',
|
231007
|
+
type: 'function'
|
231008
|
+
},
|
231009
|
+
{
|
231010
|
+
inputs: [],
|
231011
|
+
name: 'factoryRegistry',
|
231012
|
+
outputs: [{ internalType: 'address', name: '', type: 'address' }],
|
231013
|
+
stateMutability: 'view',
|
231014
|
+
type: 'function'
|
231015
|
+
},
|
231016
|
+
{
|
231017
|
+
inputs: [
|
231018
|
+
{ internalType: 'uint256', name: 'amountIn', type: 'uint256' },
|
231019
|
+
{
|
231020
|
+
components: [
|
231021
|
+
{ internalType: 'address', name: 'from', type: 'address' },
|
231022
|
+
{ internalType: 'address', name: 'to', type: 'address' },
|
231023
|
+
{ internalType: 'bool', name: 'stable', type: 'bool' },
|
231024
|
+
{ internalType: 'address', name: 'factory', type: 'address' }
|
231025
|
+
],
|
231026
|
+
internalType: 'struct IRouter.Route[]',
|
231027
|
+
name: 'routes',
|
231028
|
+
type: 'tuple[]'
|
231029
|
+
}
|
231030
|
+
],
|
231031
|
+
name: 'getAmountsOut',
|
231032
|
+
outputs: [{ internalType: 'uint256[]', name: 'amounts', type: 'uint256[]' }],
|
231033
|
+
stateMutability: 'view',
|
231034
|
+
type: 'function'
|
231035
|
+
},
|
231036
|
+
{
|
231037
|
+
inputs: [
|
231038
|
+
{ internalType: 'address', name: 'tokenA', type: 'address' },
|
231039
|
+
{ internalType: 'address', name: 'tokenB', type: 'address' },
|
231040
|
+
{ internalType: 'bool', name: 'stable', type: 'bool' },
|
231041
|
+
{ internalType: 'address', name: '_factory', type: 'address' }
|
231042
|
+
],
|
231043
|
+
name: 'getReserves',
|
231044
|
+
outputs: [
|
231045
|
+
{ internalType: 'uint256', name: 'reserveA', type: 'uint256' },
|
231046
|
+
{ internalType: 'uint256', name: 'reserveB', type: 'uint256' }
|
231047
|
+
],
|
231048
|
+
stateMutability: 'view',
|
231049
|
+
type: 'function'
|
231050
|
+
},
|
231051
|
+
{
|
231052
|
+
inputs: [{ internalType: 'address', name: 'forwarder', type: 'address' }],
|
231053
|
+
name: 'isTrustedForwarder',
|
231054
|
+
outputs: [{ internalType: 'bool', name: '', type: 'bool' }],
|
231055
|
+
stateMutability: 'view',
|
231056
|
+
type: 'function'
|
231057
|
+
},
|
231058
|
+
{
|
231059
|
+
inputs: [
|
231060
|
+
{ internalType: 'address', name: 'tokenA', type: 'address' },
|
231061
|
+
{ internalType: 'address', name: 'tokenB', type: 'address' },
|
231062
|
+
{ internalType: 'bool', name: 'stable', type: 'bool' },
|
231063
|
+
{ internalType: 'address', name: '_factory', type: 'address' }
|
231064
|
+
],
|
231065
|
+
name: 'poolFor',
|
231066
|
+
outputs: [{ internalType: 'address', name: 'pool', type: 'address' }],
|
231067
|
+
stateMutability: 'view',
|
231068
|
+
type: 'function'
|
231069
|
+
},
|
231070
|
+
{
|
231071
|
+
inputs: [
|
231072
|
+
{ internalType: 'address', name: 'tokenA', type: 'address' },
|
231073
|
+
{ internalType: 'address', name: 'tokenB', type: 'address' }
|
231074
|
+
],
|
231075
|
+
name: 'sortTokens',
|
231076
|
+
outputs: [
|
231077
|
+
{ internalType: 'address', name: 'token0', type: 'address' },
|
231078
|
+
{ internalType: 'address', name: 'token1', type: 'address' }
|
231079
|
+
],
|
231080
|
+
stateMutability: 'pure',
|
231081
|
+
type: 'function'
|
231082
|
+
},
|
231083
|
+
{
|
231084
|
+
inputs: [
|
231085
|
+
{ internalType: 'uint256', name: 'amountOutMin', type: 'uint256' },
|
231086
|
+
{
|
231087
|
+
components: [
|
231088
|
+
{ internalType: 'address', name: 'from', type: 'address' },
|
231089
|
+
{ internalType: 'address', name: 'to', type: 'address' },
|
231090
|
+
{ internalType: 'bool', name: 'stable', type: 'bool' },
|
231091
|
+
{ internalType: 'address', name: 'factory', type: 'address' }
|
231092
|
+
],
|
231093
|
+
internalType: 'struct IRouter.Route[]',
|
231094
|
+
name: 'routes',
|
231095
|
+
type: 'tuple[]'
|
231096
|
+
},
|
231097
|
+
{ internalType: 'address', name: 'to', type: 'address' },
|
231098
|
+
{ internalType: 'uint256', name: 'deadline', type: 'uint256' }
|
231099
|
+
],
|
231100
|
+
name: 'swapExactETHForTokens',
|
231101
|
+
outputs: [{ internalType: 'uint256[]', name: 'amounts', type: 'uint256[]' }],
|
231102
|
+
stateMutability: 'payable',
|
231103
|
+
type: 'function'
|
231104
|
+
},
|
231105
|
+
{
|
231106
|
+
inputs: [
|
231107
|
+
{ internalType: 'uint256', name: 'amountOutMin', type: 'uint256' },
|
231108
|
+
{
|
231109
|
+
components: [
|
231110
|
+
{ internalType: 'address', name: 'from', type: 'address' },
|
231111
|
+
{ internalType: 'address', name: 'to', type: 'address' },
|
231112
|
+
{ internalType: 'bool', name: 'stable', type: 'bool' },
|
231113
|
+
{ internalType: 'address', name: 'factory', type: 'address' }
|
231114
|
+
],
|
231115
|
+
internalType: 'struct IRouter.Route[]',
|
231116
|
+
name: 'routes',
|
231117
|
+
type: 'tuple[]'
|
231118
|
+
},
|
231119
|
+
{ internalType: 'address', name: 'to', type: 'address' },
|
231120
|
+
{ internalType: 'uint256', name: 'deadline', type: 'uint256' }
|
231121
|
+
],
|
231122
|
+
name: 'swapExactETHForTokensSupportingFeeOnTransferTokens',
|
231123
|
+
outputs: [],
|
231124
|
+
stateMutability: 'payable',
|
231125
|
+
type: 'function'
|
231126
|
+
},
|
231127
|
+
{
|
231128
|
+
inputs: [
|
231129
|
+
{ internalType: 'uint256', name: 'amountIn', type: 'uint256' },
|
231130
|
+
{ internalType: 'uint256', name: 'amountOutMin', type: 'uint256' },
|
231131
|
+
{
|
231132
|
+
components: [
|
231133
|
+
{ internalType: 'address', name: 'from', type: 'address' },
|
231134
|
+
{ internalType: 'address', name: 'to', type: 'address' },
|
231135
|
+
{ internalType: 'bool', name: 'stable', type: 'bool' },
|
231136
|
+
{ internalType: 'address', name: 'factory', type: 'address' }
|
231137
|
+
],
|
231138
|
+
internalType: 'struct IRouter.Route[]',
|
231139
|
+
name: 'routes',
|
231140
|
+
type: 'tuple[]'
|
231141
|
+
},
|
231142
|
+
{ internalType: 'address', name: 'to', type: 'address' },
|
231143
|
+
{ internalType: 'uint256', name: 'deadline', type: 'uint256' }
|
231144
|
+
],
|
231145
|
+
name: 'swapExactTokensForETH',
|
231146
|
+
outputs: [{ internalType: 'uint256[]', name: 'amounts', type: 'uint256[]' }],
|
231147
|
+
stateMutability: 'nonpayable',
|
231148
|
+
type: 'function'
|
231149
|
+
},
|
231150
|
+
{
|
231151
|
+
inputs: [
|
231152
|
+
{ internalType: 'uint256', name: 'amountIn', type: 'uint256' },
|
231153
|
+
{ internalType: 'uint256', name: 'amountOutMin', type: 'uint256' },
|
231154
|
+
{
|
231155
|
+
components: [
|
231156
|
+
{ internalType: 'address', name: 'from', type: 'address' },
|
231157
|
+
{ internalType: 'address', name: 'to', type: 'address' },
|
231158
|
+
{ internalType: 'bool', name: 'stable', type: 'bool' },
|
231159
|
+
{ internalType: 'address', name: 'factory', type: 'address' }
|
231160
|
+
],
|
231161
|
+
internalType: 'struct IRouter.Route[]',
|
231162
|
+
name: 'routes',
|
231163
|
+
type: 'tuple[]'
|
231164
|
+
},
|
231165
|
+
{ internalType: 'address', name: 'to', type: 'address' },
|
231166
|
+
{ internalType: 'uint256', name: 'deadline', type: 'uint256' }
|
231167
|
+
],
|
231168
|
+
name: 'swapExactTokensForETHSupportingFeeOnTransferTokens',
|
231169
|
+
outputs: [],
|
231170
|
+
stateMutability: 'nonpayable',
|
231171
|
+
type: 'function'
|
231172
|
+
},
|
231173
|
+
{
|
231174
|
+
inputs: [
|
231175
|
+
{ internalType: 'uint256', name: 'amountIn', type: 'uint256' },
|
231176
|
+
{ internalType: 'uint256', name: 'amountOutMin', type: 'uint256' },
|
231177
|
+
{
|
231178
|
+
components: [
|
231179
|
+
{ internalType: 'address', name: 'from', type: 'address' },
|
231180
|
+
{ internalType: 'address', name: 'to', type: 'address' },
|
231181
|
+
{ internalType: 'bool', name: 'stable', type: 'bool' },
|
231182
|
+
{ internalType: 'address', name: 'factory', type: 'address' }
|
231183
|
+
],
|
231184
|
+
internalType: 'struct IRouter.Route[]',
|
231185
|
+
name: 'routes',
|
231186
|
+
type: 'tuple[]'
|
231187
|
+
},
|
231188
|
+
{ internalType: 'address', name: 'to', type: 'address' },
|
231189
|
+
{ internalType: 'uint256', name: 'deadline', type: 'uint256' }
|
231190
|
+
],
|
231191
|
+
name: 'swapExactTokensForTokens',
|
231192
|
+
outputs: [{ internalType: 'uint256[]', name: 'amounts', type: 'uint256[]' }],
|
231193
|
+
stateMutability: 'nonpayable',
|
231194
|
+
type: 'function'
|
231195
|
+
},
|
231196
|
+
{
|
231197
|
+
inputs: [
|
231198
|
+
{ internalType: 'uint256', name: 'amountIn', type: 'uint256' },
|
231199
|
+
{ internalType: 'uint256', name: 'amountOutMin', type: 'uint256' },
|
231200
|
+
{
|
231201
|
+
components: [
|
231202
|
+
{ internalType: 'address', name: 'from', type: 'address' },
|
231203
|
+
{ internalType: 'address', name: 'to', type: 'address' },
|
231204
|
+
{ internalType: 'bool', name: 'stable', type: 'bool' },
|
231205
|
+
{ internalType: 'address', name: 'factory', type: 'address' }
|
231206
|
+
],
|
231207
|
+
internalType: 'struct IRouter.Route[]',
|
231208
|
+
name: 'routes',
|
231209
|
+
type: 'tuple[]'
|
231210
|
+
},
|
231211
|
+
{ internalType: 'address', name: 'to', type: 'address' },
|
231212
|
+
{ internalType: 'uint256', name: 'deadline', type: 'uint256' }
|
231213
|
+
],
|
231214
|
+
name: 'swapExactTokensForTokensSupportingFeeOnTransferTokens',
|
231215
|
+
outputs: [],
|
231216
|
+
stateMutability: 'nonpayable',
|
231217
|
+
type: 'function'
|
231218
|
+
},
|
231219
|
+
{ stateMutability: 'payable', type: 'receive' }
|
231220
|
+
];
|
230982
231221
|
|
230983
231222
|
|
230984
231223
|
/***/ }),
|
230985
231224
|
|
230986
|
-
/***/ "./src/features/on-chain/calculation-manager/providers/dexes/base/
|
230987
|
-
|
230988
|
-
!*** ./src/features/on-chain/calculation-manager/providers/dexes/base/
|
230989
|
-
|
230990
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__)
|
231225
|
+
/***/ "./src/features/on-chain/calculation-manager/providers/dexes/base/aerodrome/aerodrome-path-factory.ts":
|
231226
|
+
/*!************************************************************************************************************!*\
|
231227
|
+
!*** ./src/features/on-chain/calculation-manager/providers/dexes/base/aerodrome/aerodrome-path-factory.ts ***!
|
231228
|
+
\************************************************************************************************************/
|
231229
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
230991
231230
|
|
230992
231231
|
"use strict";
|
230993
231232
|
|
231233
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
231234
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
231235
|
+
};
|
230994
231236
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
230995
|
-
exports.
|
230996
|
-
const
|
230997
|
-
const
|
230998
|
-
const
|
230999
|
-
|
231237
|
+
exports.AerodromePathFactory = void 0;
|
231238
|
+
const bignumber_js_1 = __importDefault(__webpack_require__(/*! bignumber.js */ "./node_modules/bignumber.js/bignumber.js"));
|
231239
|
+
const errors_1 = __webpack_require__(/*! ../../../../../../../common/errors */ "./src/common/errors/index.ts");
|
231240
|
+
const tokens_1 = __webpack_require__(/*! ../../../../../../../common/tokens */ "./src/common/tokens/index.ts");
|
231241
|
+
const object_1 = __webpack_require__(/*! ../../../../../../../common/utils/object */ "./src/common/utils/object.ts");
|
231242
|
+
const path_factory_1 = __webpack_require__(/*! ../../common/uniswap-v2-abstract/path-factory */ "./src/features/on-chain/calculation-manager/providers/dexes/common/uniswap-v2-abstract/path-factory.ts");
|
231243
|
+
class AerodromePathFactory extends path_factory_1.PathFactory {
|
231000
231244
|
constructor() {
|
231001
231245
|
super(...arguments);
|
231002
|
-
this.
|
231246
|
+
this.routes = [];
|
231003
231247
|
}
|
231004
|
-
|
231005
|
-
|
231248
|
+
calculateRoutes(tokens, finalPath) {
|
231249
|
+
const updRoutesMethodArgumentsWithTransitToken = (finalPath, tokenA, tokenB, tokenC, isPairAStablePool, isPairBStablePool) => {
|
231250
|
+
this.routes.push({
|
231251
|
+
path: finalPath,
|
231252
|
+
methodArguments: [
|
231253
|
+
this.stringWeiAmount,
|
231254
|
+
[
|
231255
|
+
[
|
231256
|
+
tokenA,
|
231257
|
+
tokenB,
|
231258
|
+
isPairAStablePool,
|
231259
|
+
'0x420DD381b31aEf6683db6B902084cB0FFECe40Da'
|
231260
|
+
],
|
231261
|
+
[
|
231262
|
+
tokenB,
|
231263
|
+
tokenC,
|
231264
|
+
isPairBStablePool,
|
231265
|
+
'0x420DD381b31aEf6683db6B902084cB0FFECe40Da'
|
231266
|
+
]
|
231267
|
+
]
|
231268
|
+
]
|
231269
|
+
});
|
231270
|
+
};
|
231271
|
+
const updRoutesMethodArgumentsWithoutTransitToken = (finalPath, tokenA, tokenB, isStable) => {
|
231272
|
+
this.routes.push({
|
231273
|
+
path: finalPath,
|
231274
|
+
methodArguments: [
|
231275
|
+
this.stringWeiAmount,
|
231276
|
+
[[tokenA, tokenB, isStable, '0x420DD381b31aEf6683db6B902084cB0FFECe40Da']]
|
231277
|
+
]
|
231278
|
+
});
|
231279
|
+
};
|
231280
|
+
if (tokens.length > 3) {
|
231281
|
+
throw new errors_1.RubicSdkError('Maximum number of transit tokens: 1');
|
231282
|
+
}
|
231283
|
+
if (tokens.length === 2) {
|
231284
|
+
updRoutesMethodArgumentsWithoutTransitToken(finalPath, tokens[0], tokens[1], true);
|
231285
|
+
updRoutesMethodArgumentsWithoutTransitToken(finalPath, tokens[0], tokens[1], false);
|
231286
|
+
}
|
231287
|
+
if (tokens.length === 3) {
|
231288
|
+
updRoutesMethodArgumentsWithTransitToken(finalPath, tokens[0], tokens[1], tokens[2], true, true);
|
231289
|
+
updRoutesMethodArgumentsWithTransitToken(finalPath, tokens[0], tokens[1], tokens[2], false, false);
|
231290
|
+
updRoutesMethodArgumentsWithTransitToken(finalPath, tokens[0], tokens[1], tokens[2], false, true);
|
231291
|
+
updRoutesMethodArgumentsWithTransitToken(finalPath, tokens[0], tokens[1], tokens[2], true, false);
|
231292
|
+
}
|
231006
231293
|
}
|
231007
|
-
|
231008
|
-
|
231009
|
-
|
231010
|
-
|
231011
|
-
|
231012
|
-
|
231013
|
-
|
231014
|
-
|
231015
|
-
|
231016
|
-
|
231017
|
-
|
231018
|
-
|
231019
|
-
|
231020
|
-
|
231021
|
-
|
231022
|
-
|
231023
|
-
|
231024
|
-
|
231025
|
-
|
231026
|
-
|
231294
|
+
async getAllRoutes() {
|
231295
|
+
const transitTokens = await tokens_1.Token.createTokens(this.routingProvidersAddresses, this.from.blockchain);
|
231296
|
+
const vertexes = transitTokens.filter(elem => !elem.isEqualTo(this.from) && !elem.isEqualTo(this.to));
|
231297
|
+
const initialPath = [this.from];
|
231298
|
+
const recGraphVisitor = (path, transitTokensLimit) => {
|
231299
|
+
if (path.length === transitTokensLimit + 1) {
|
231300
|
+
const finalPath = path.concat(this.to);
|
231301
|
+
this.calculateRoutes(tokens_1.Token.tokensToAddresses(finalPath), finalPath);
|
231302
|
+
return;
|
231303
|
+
}
|
231304
|
+
vertexes
|
231305
|
+
.filter(vertex => path.every(token => !token.isEqualTo(vertex)))
|
231306
|
+
.forEach(vertex => {
|
231307
|
+
const extendedPath = path.concat(vertex);
|
231308
|
+
recGraphVisitor(extendedPath, transitTokensLimit);
|
231309
|
+
});
|
231310
|
+
};
|
231311
|
+
for (let i = 0; i <= this.maxTransitTokens; i++) {
|
231312
|
+
recGraphVisitor(initialPath, i);
|
231313
|
+
}
|
231314
|
+
const responses = await this.UniswapV2TradeClass.callForRoutes(this.from.blockchain, this.exact, this.routes.map(route => route.methodArguments));
|
231315
|
+
const tokens = responses.map((response, index) => {
|
231316
|
+
if (!response.success || !response.output || !(response.output[1] !== '0')) {
|
231317
|
+
return null;
|
231318
|
+
}
|
231319
|
+
const amounts = response.output;
|
231320
|
+
const numberAmount = this.exact === 'input' ? amounts[amounts.length - 1] : amounts[0];
|
231321
|
+
if (!numberAmount) {
|
231322
|
+
throw new errors_1.RubicSdkError('Amount has to be defined');
|
231323
|
+
}
|
231324
|
+
const outputAbsoluteAmount = new bignumber_js_1.default(numberAmount);
|
231325
|
+
const path = this.routes?.[index]?.path;
|
231326
|
+
const routPoolInfo = this.routes?.[index]?.methodArguments[1];
|
231327
|
+
if (!path || !routPoolInfo) {
|
231328
|
+
throw new errors_1.RubicSdkError('Path has to be defined');
|
231329
|
+
}
|
231330
|
+
return { outputAbsoluteAmount, path, routPoolInfo };
|
231331
|
+
});
|
231332
|
+
return tokens.filter(object_1.notNull);
|
231333
|
+
}
|
231334
|
+
}
|
231335
|
+
exports.AerodromePathFactory = AerodromePathFactory;
|
231336
|
+
|
231337
|
+
|
231338
|
+
/***/ }),
|
231339
|
+
|
231340
|
+
/***/ "./src/features/on-chain/calculation-manager/providers/dexes/base/aerodrome/aerodrome-provider.ts":
|
231341
|
+
/*!********************************************************************************************************!*\
|
231342
|
+
!*** ./src/features/on-chain/calculation-manager/providers/dexes/base/aerodrome/aerodrome-provider.ts ***!
|
231343
|
+
\********************************************************************************************************/
|
231344
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
231345
|
+
|
231346
|
+
"use strict";
|
231347
|
+
|
231348
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
231349
|
+
exports.AerodromeProvider = void 0;
|
231350
|
+
const blockchain_name_1 = __webpack_require__(/*! ../../../../../../../core/blockchain/models/blockchain-name */ "./src/core/blockchain/models/blockchain-name.ts");
|
231351
|
+
const aerodrome_path_factory_1 = __webpack_require__(/*! ./aerodrome-path-factory */ "./src/features/on-chain/calculation-manager/providers/dexes/base/aerodrome/aerodrome-path-factory.ts");
|
231352
|
+
const aerodrome_trade_1 = __webpack_require__(/*! ./aerodrome-trade */ "./src/features/on-chain/calculation-manager/providers/dexes/base/aerodrome/aerodrome-trade.ts");
|
231353
|
+
const constants_1 = __webpack_require__(/*! ./constants */ "./src/features/on-chain/calculation-manager/providers/dexes/base/aerodrome/constants.ts");
|
231354
|
+
const uniswap_v2_abstract_provider_1 = __webpack_require__(/*! ../../common/uniswap-v2-abstract/uniswap-v2-abstract-provider */ "./src/features/on-chain/calculation-manager/providers/dexes/common/uniswap-v2-abstract/uniswap-v2-abstract-provider.ts");
|
231355
|
+
class AerodromeProvider extends uniswap_v2_abstract_provider_1.UniswapV2AbstractProvider {
|
231356
|
+
constructor() {
|
231357
|
+
super(...arguments);
|
231358
|
+
this.blockchain = blockchain_name_1.BLOCKCHAIN_NAME.BASE;
|
231359
|
+
this.UniswapV2TradeClass = aerodrome_trade_1.AerodromeTrade;
|
231360
|
+
this.providerSettings = constants_1.AERODROME_PROVIDER_CONFIGURATION;
|
231361
|
+
}
|
231362
|
+
async getAmountAndPath(from, to, weiAmount, exact, options, proxyFeeInfo, gasPriceInUsd) {
|
231363
|
+
const pathFactory = new aerodrome_path_factory_1.AerodromePathFactory(this, {
|
231364
|
+
from,
|
231365
|
+
to,
|
231366
|
+
weiAmount,
|
231367
|
+
exact,
|
231368
|
+
options,
|
231369
|
+
proxyFeeInfo
|
231370
|
+
});
|
231371
|
+
return pathFactory.getAmountAndPath(gasPriceInUsd);
|
231372
|
+
}
|
231373
|
+
}
|
231374
|
+
exports.AerodromeProvider = AerodromeProvider;
|
231375
|
+
|
231376
|
+
|
231377
|
+
/***/ }),
|
231378
|
+
|
231379
|
+
/***/ "./src/features/on-chain/calculation-manager/providers/dexes/base/aerodrome/aerodrome-trade.ts":
|
231380
|
+
/*!*****************************************************************************************************!*\
|
231381
|
+
!*** ./src/features/on-chain/calculation-manager/providers/dexes/base/aerodrome/aerodrome-trade.ts ***!
|
231382
|
+
\*****************************************************************************************************/
|
231383
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
231384
|
+
|
231385
|
+
"use strict";
|
231386
|
+
|
231387
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
231388
|
+
exports.AerodromeTrade = void 0;
|
231389
|
+
const on_chain_trade_type_1 = __webpack_require__(/*! ../../../common/models/on-chain-trade-type */ "./src/features/on-chain/calculation-manager/providers/common/models/on-chain-trade-type.ts");
|
231390
|
+
const aerodrome_abi_1 = __webpack_require__(/*! ./aerodrome-abi */ "./src/features/on-chain/calculation-manager/providers/dexes/base/aerodrome/aerodrome-abi.ts");
|
231391
|
+
const constants_1 = __webpack_require__(/*! ./constants */ "./src/features/on-chain/calculation-manager/providers/dexes/base/aerodrome/constants.ts");
|
231392
|
+
const uniswap_v2_abstract_trade_1 = __webpack_require__(/*! ../../common/uniswap-v2-abstract/uniswap-v2-abstract-trade */ "./src/features/on-chain/calculation-manager/providers/dexes/common/uniswap-v2-abstract/uniswap-v2-abstract-trade.ts");
|
231393
|
+
class AerodromeTrade extends uniswap_v2_abstract_trade_1.UniswapV2AbstractTrade {
|
231394
|
+
constructor() {
|
231395
|
+
super(...arguments);
|
231396
|
+
this.dexContractAddress = constants_1.AERODROME_CONTRACT_ADDRESS;
|
231397
|
+
}
|
231398
|
+
static get type() {
|
231399
|
+
return on_chain_trade_type_1.ON_CHAIN_TRADE_TYPE.AERODROME;
|
231400
|
+
}
|
231401
|
+
getCallParameters(receiverAddress) {
|
231402
|
+
const { amountIn, amountOut } = this.getAmountInAndAmountOut();
|
231403
|
+
const amountParameters = this.from.isNative ? [amountOut] : [amountIn, amountOut];
|
231404
|
+
const path = this.routPoolInfo;
|
231405
|
+
return [
|
231406
|
+
...amountParameters,
|
231407
|
+
path,
|
231408
|
+
receiverAddress || this.walletAddress,
|
231409
|
+
this.deadlineMinutesTimestamp
|
231410
|
+
];
|
231411
|
+
}
|
231412
|
+
}
|
231413
|
+
exports.AerodromeTrade = AerodromeTrade;
|
231414
|
+
AerodromeTrade.contractAbi = aerodrome_abi_1.AERODROME_ABI;
|
231415
|
+
|
231416
|
+
|
231417
|
+
/***/ }),
|
231418
|
+
|
231419
|
+
/***/ "./src/features/on-chain/calculation-manager/providers/dexes/base/aerodrome/constants.ts":
|
231420
|
+
/*!***********************************************************************************************!*\
|
231421
|
+
!*** ./src/features/on-chain/calculation-manager/providers/dexes/base/aerodrome/constants.ts ***!
|
231422
|
+
\***********************************************************************************************/
|
231423
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
231424
|
+
|
231425
|
+
"use strict";
|
231426
|
+
|
231427
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
231428
|
+
exports.AERODROME_PROVIDER_CONFIGURATION = exports.AERODROME_CONTRACT_ADDRESS = void 0;
|
231429
|
+
const default_constants_1 = __webpack_require__(/*! ../default-constants */ "./src/features/on-chain/calculation-manager/providers/dexes/base/default-constants.ts");
|
231430
|
+
exports.AERODROME_CONTRACT_ADDRESS = '0xcF77a3Ba9A5CA399B7c97c74d54e5b1Beb874E43';
|
231431
|
+
exports.AERODROME_PROVIDER_CONFIGURATION = {
|
231432
|
+
...default_constants_1.defaultBaseProviderConfiguration,
|
231433
|
+
maxTransitTokens: 1
|
231434
|
+
};
|
231435
|
+
|
231436
|
+
|
231437
|
+
/***/ }),
|
231438
|
+
|
231439
|
+
/***/ "./src/features/on-chain/calculation-manager/providers/dexes/base/base-swap/base-swap-provider.ts":
|
231440
|
+
/*!********************************************************************************************************!*\
|
231441
|
+
!*** ./src/features/on-chain/calculation-manager/providers/dexes/base/base-swap/base-swap-provider.ts ***!
|
231442
|
+
\********************************************************************************************************/
|
231443
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
231444
|
+
|
231445
|
+
"use strict";
|
231446
|
+
|
231447
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
231448
|
+
exports.BaseSwapProvider = void 0;
|
231449
|
+
const blockchain_name_1 = __webpack_require__(/*! ../../../../../../../core/blockchain/models/blockchain-name */ "./src/core/blockchain/models/blockchain-name.ts");
|
231450
|
+
const base_swap_trade_1 = __webpack_require__(/*! ./base-swap-trade */ "./src/features/on-chain/calculation-manager/providers/dexes/base/base-swap/base-swap-trade.ts");
|
231451
|
+
const constants_1 = __webpack_require__(/*! ./constants */ "./src/features/on-chain/calculation-manager/providers/dexes/base/base-swap/constants.ts");
|
231452
|
+
const uniswap_v2_abstract_provider_1 = __webpack_require__(/*! ../../common/uniswap-v2-abstract/uniswap-v2-abstract-provider */ "./src/features/on-chain/calculation-manager/providers/dexes/common/uniswap-v2-abstract/uniswap-v2-abstract-provider.ts");
|
231453
|
+
class BaseSwapProvider extends uniswap_v2_abstract_provider_1.UniswapV2AbstractProvider {
|
231454
|
+
constructor() {
|
231455
|
+
super(...arguments);
|
231456
|
+
this.blockchain = blockchain_name_1.BLOCKCHAIN_NAME.BASE;
|
231457
|
+
this.UniswapV2TradeClass = base_swap_trade_1.BaseSwapTrade;
|
231458
|
+
this.providerSettings = constants_1.BASE_SWAP_PROVIDER_CONFIGURATION;
|
231459
|
+
}
|
231460
|
+
}
|
231461
|
+
exports.BaseSwapProvider = BaseSwapProvider;
|
231462
|
+
|
231463
|
+
|
231464
|
+
/***/ }),
|
231465
|
+
|
231466
|
+
/***/ "./src/features/on-chain/calculation-manager/providers/dexes/base/base-swap/base-swap-trade.ts":
|
231467
|
+
/*!*****************************************************************************************************!*\
|
231468
|
+
!*** ./src/features/on-chain/calculation-manager/providers/dexes/base/base-swap/base-swap-trade.ts ***!
|
231469
|
+
\*****************************************************************************************************/
|
231470
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
231471
|
+
|
231472
|
+
"use strict";
|
231473
|
+
|
231474
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
231475
|
+
exports.BaseSwapTrade = void 0;
|
231476
|
+
const on_chain_trade_type_1 = __webpack_require__(/*! ../../../common/models/on-chain-trade-type */ "./src/features/on-chain/calculation-manager/providers/common/models/on-chain-trade-type.ts");
|
231477
|
+
const constants_1 = __webpack_require__(/*! ./constants */ "./src/features/on-chain/calculation-manager/providers/dexes/base/base-swap/constants.ts");
|
231478
|
+
const uniswap_v2_abstract_trade_1 = __webpack_require__(/*! ../../common/uniswap-v2-abstract/uniswap-v2-abstract-trade */ "./src/features/on-chain/calculation-manager/providers/dexes/common/uniswap-v2-abstract/uniswap-v2-abstract-trade.ts");
|
231479
|
+
class BaseSwapTrade extends uniswap_v2_abstract_trade_1.UniswapV2AbstractTrade {
|
231480
|
+
constructor() {
|
231481
|
+
super(...arguments);
|
231482
|
+
this.dexContractAddress = constants_1.BASE_SWAP_CONTRACT_ADDRESS;
|
231483
|
+
}
|
231484
|
+
static get type() {
|
231485
|
+
return on_chain_trade_type_1.ON_CHAIN_TRADE_TYPE.BASE_SWAP;
|
231486
|
+
}
|
231487
|
+
}
|
231488
|
+
exports.BaseSwapTrade = BaseSwapTrade;
|
231489
|
+
|
231490
|
+
|
231491
|
+
/***/ }),
|
231492
|
+
|
231493
|
+
/***/ "./src/features/on-chain/calculation-manager/providers/dexes/base/base-swap/constants.ts":
|
231494
|
+
/*!***********************************************************************************************!*\
|
231495
|
+
!*** ./src/features/on-chain/calculation-manager/providers/dexes/base/base-swap/constants.ts ***!
|
231496
|
+
\***********************************************************************************************/
|
231497
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
231498
|
+
|
231499
|
+
"use strict";
|
231500
|
+
|
231501
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
231502
|
+
exports.BASE_SWAP_PROVIDER_CONFIGURATION = exports.BASE_SWAP_CONTRACT_ADDRESS = void 0;
|
231503
|
+
const default_constants_1 = __webpack_require__(/*! ../default-constants */ "./src/features/on-chain/calculation-manager/providers/dexes/base/default-constants.ts");
|
231504
|
+
exports.BASE_SWAP_CONTRACT_ADDRESS = '0x327Df1E6de05895d2ab08513aaDD9313Fe505d86';
|
231505
|
+
exports.BASE_SWAP_PROVIDER_CONFIGURATION = {
|
231506
|
+
...default_constants_1.defaultBaseProviderConfiguration,
|
231027
231507
|
maxTransitTokens: 2
|
231028
231508
|
};
|
231029
231509
|
|
@@ -234986,644 +235466,215 @@ class SyncSwapRouter {
|
|
234986
235466
|
stepsWithAmount,
|
234987
235467
|
amountOut: pathAmountOut,
|
234988
235468
|
amountIn,
|
234989
|
-
quote: pathQuoteOut
|
234990
|
-
};
|
234991
|
-
}
|
234992
|
-
static async calculateGroupAmounts(paths, amounts, blockchainName) {
|
234993
|
-
const pathsWithAmounts = [];
|
234994
|
-
let amountOut = constants_1.ZERO;
|
234995
|
-
let quoteOut = constants_1.ZERO;
|
234996
|
-
const groupPaths = paths;
|
234997
|
-
const lastSteps = new Map();
|
234998
|
-
for (let i = 0; i < groupPaths.length; i++) {
|
234999
|
-
const pathAmountIn = amounts[i];
|
235000
|
-
if (pathAmountIn.isZero()) {
|
235001
|
-
// eslint-disable-next-line no-continue
|
235002
|
-
continue;
|
235003
|
-
}
|
235004
|
-
const path = groupPaths[i];
|
235005
|
-
for (let j = 0; j < path.length; j++) {
|
235006
|
-
const lastStep = lastSteps.get(path[j].pool.pool);
|
235007
|
-
if (lastStep !== undefined) {
|
235008
|
-
path[j] = SyncSwapRouter.copyStep(lastStep);
|
235009
|
-
}
|
235010
|
-
}
|
235011
|
-
const pathWithAmounts =
|
235012
|
-
// eslint-disable-next-line no-await-in-loop
|
235013
|
-
await SyncSwapRouter.calculatePathAmountsByInput(path, pathAmountIn, true, blockchainName);
|
235014
|
-
if (pathWithAmounts != null) {
|
235015
|
-
for (const step of pathWithAmounts.stepsWithAmount) {
|
235016
|
-
if (step.updatedStep !== null) {
|
235017
|
-
lastSteps.set(step.pool.pool, step.updatedStep);
|
235018
|
-
}
|
235019
|
-
}
|
235020
|
-
pathsWithAmounts.push(pathWithAmounts);
|
235021
|
-
amountOut = amountOut.add(pathWithAmounts.amountOut);
|
235022
|
-
quoteOut = quoteOut.add(pathWithAmounts.quote);
|
235023
|
-
}
|
235024
|
-
}
|
235025
|
-
return {
|
235026
|
-
pathsWithAmounts,
|
235027
|
-
amountOut,
|
235028
|
-
quoteOut
|
235029
|
-
};
|
235030
|
-
}
|
235031
|
-
static async getPoolPrecision(address, fromAddress, blockchainName) {
|
235032
|
-
const web3Public = injector_1.Injector.web3PublicService.getWeb3Public(blockchainName);
|
235033
|
-
const token0 = await web3Public.callContractMethod(address, sync_swap_stable_pool_1.syncSwapStablePool, 'token0', []);
|
235034
|
-
const token0PM = await web3Public.callContractMethod(address, sync_swap_stable_pool_1.syncSwapStablePool, 'token0PrecisionMultiplier', []);
|
235035
|
-
const token1PM = await web3Public.callContractMethod(address, sync_swap_stable_pool_1.syncSwapStablePool, 'token1PrecisionMultiplier', []);
|
235036
|
-
return (0, blockchain_1.compareAddresses)(token0, fromAddress)
|
235037
|
-
? {
|
235038
|
-
fromPrecisionMultiplier: token0PM,
|
235039
|
-
toPrecisionMultiplier: token1PM
|
235040
|
-
}
|
235041
|
-
: {
|
235042
|
-
fromPrecisionMultiplier: token1PM,
|
235043
|
-
toPrecisionMultiplier: token0PM
|
235044
|
-
};
|
235045
|
-
}
|
235046
|
-
}
|
235047
|
-
exports.SyncSwapRouter = SyncSwapRouter;
|
235048
|
-
__decorate([
|
235049
|
-
decorators_1.Cache
|
235050
|
-
], SyncSwapRouter, "getPoolPrecision", null);
|
235051
|
-
|
235052
|
-
|
235053
|
-
/***/ }),
|
235054
|
-
|
235055
|
-
/***/ "./src/features/on-chain/calculation-manager/providers/dexes/common/sync-swap-abstract/utils/typings.ts":
|
235056
|
-
/*!**************************************************************************************************************!*\
|
235057
|
-
!*** ./src/features/on-chain/calculation-manager/providers/dexes/common/sync-swap-abstract/utils/typings.ts ***!
|
235058
|
-
\**************************************************************************************************************/
|
235059
|
-
/***/ ((__unused_webpack_module, exports) => {
|
235060
|
-
|
235061
|
-
"use strict";
|
235062
|
-
|
235063
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
235064
|
-
exports.routeDirection = void 0;
|
235065
|
-
exports.routeDirection = {
|
235066
|
-
EXACT_IN: 'EXACT_IN',
|
235067
|
-
EXACT_OUT: 'EXACT_OUT'
|
235068
|
-
};
|
235069
|
-
|
235070
|
-
|
235071
|
-
/***/ }),
|
235072
|
-
|
235073
|
-
/***/ "./src/features/on-chain/calculation-manager/providers/dexes/common/uniswap-v2-abstract/constants/SWAP_METHOD.ts":
|
235074
|
-
/*!***********************************************************************************************************************!*\
|
235075
|
-
!*** ./src/features/on-chain/calculation-manager/providers/dexes/common/uniswap-v2-abstract/constants/SWAP_METHOD.ts ***!
|
235076
|
-
\***********************************************************************************************************************/
|
235077
|
-
/***/ ((__unused_webpack_module, exports) => {
|
235078
|
-
|
235079
|
-
"use strict";
|
235080
|
-
|
235081
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
235082
|
-
exports.SUPPORTING_FEE_SWAP_METHODS_MAPPING = exports.SWAP_METHOD = exports.EXACT_OUTPUT_SWAP_METHOD = exports.EXACT_OUTPUT_SUPPORTING_FEE_SWAP_METHOD = exports.EXACT_OUTPUT_REGULAR_SWAP_METHOD = exports.EXACT_INPUT_SWAP_METHOD = exports.EXACT_INPUT_SUPPORTING_FEE_SWAP_METHOD = exports.EXACT_INPUT_REGULAR_SWAP_METHOD = void 0;
|
235083
|
-
exports.EXACT_INPUT_REGULAR_SWAP_METHOD = {
|
235084
|
-
TOKENS_TO_TOKENS: 'swapExactTokensForTokens',
|
235085
|
-
ETH_TO_TOKENS: 'swapExactETHForTokens',
|
235086
|
-
TOKENS_TO_ETH: 'swapExactTokensForETH'
|
235087
|
-
};
|
235088
|
-
exports.EXACT_INPUT_SUPPORTING_FEE_SWAP_METHOD = {
|
235089
|
-
TOKENS_TO_TOKENS_SUPPORTING_FEE: 'swapExactTokensForTokensSupportingFeeOnTransferTokens',
|
235090
|
-
ETH_TO_TOKENS_SUPPORTING_FEE: 'swapExactETHForTokensSupportingFeeOnTransferTokens',
|
235091
|
-
TOKENS_TO_ETH_SUPPORTING_FEE: 'swapExactTokensForETHSupportingFeeOnTransferTokens'
|
235092
|
-
};
|
235093
|
-
exports.EXACT_INPUT_SWAP_METHOD = {
|
235094
|
-
...exports.EXACT_INPUT_REGULAR_SWAP_METHOD,
|
235095
|
-
...exports.EXACT_INPUT_SUPPORTING_FEE_SWAP_METHOD
|
235096
|
-
};
|
235097
|
-
exports.EXACT_OUTPUT_REGULAR_SWAP_METHOD = {
|
235098
|
-
TOKENS_TO_TOKENS: 'swapTokensForExactTokens',
|
235099
|
-
ETH_TO_TOKENS: 'swapETHForExactTokens',
|
235100
|
-
TOKENS_TO_ETH: 'swapTokensForExactETH'
|
235101
|
-
};
|
235102
|
-
exports.EXACT_OUTPUT_SUPPORTING_FEE_SWAP_METHOD = {
|
235103
|
-
TOKENS_TO_TOKENS_SUPPORTING_FEE: 'swapTokensForExactTokensSupportingFeeOnTransferTokens',
|
235104
|
-
ETH_TO_TOKENS_SUPPORTING_FEE: 'swapETHForExactTokensSupportingFeeOnTransferTokens',
|
235105
|
-
TOKENS_TO_ETH_SUPPORTING_FEE: 'swapTokensForExactETHSupportingFeeOnTransferTokens'
|
235106
|
-
};
|
235107
|
-
exports.EXACT_OUTPUT_SWAP_METHOD = {
|
235108
|
-
...exports.EXACT_OUTPUT_REGULAR_SWAP_METHOD,
|
235109
|
-
...exports.EXACT_OUTPUT_SUPPORTING_FEE_SWAP_METHOD
|
235110
|
-
};
|
235111
|
-
exports.SWAP_METHOD = {
|
235112
|
-
input: exports.EXACT_INPUT_SWAP_METHOD,
|
235113
|
-
output: exports.EXACT_OUTPUT_SWAP_METHOD
|
235114
|
-
};
|
235115
|
-
exports.SUPPORTING_FEE_SWAP_METHODS_MAPPING = {
|
235116
|
-
TOKENS_TO_TOKENS: 'TOKENS_TO_TOKENS_SUPPORTING_FEE',
|
235117
|
-
ETH_TO_TOKENS: 'ETH_TO_TOKENS_SUPPORTING_FEE',
|
235118
|
-
TOKENS_TO_ETH: 'TOKENS_TO_ETH_SUPPORTING_FEE'
|
235119
|
-
};
|
235120
|
-
|
235121
|
-
|
235122
|
-
/***/ }),
|
235123
|
-
|
235124
|
-
/***/ "./src/features/on-chain/calculation-manager/providers/dexes/common/uniswap-v2-abstract/constants/default-estimated-gas.ts":
|
235125
|
-
/*!*********************************************************************************************************************************!*\
|
235126
|
-
!*** ./src/features/on-chain/calculation-manager/providers/dexes/common/uniswap-v2-abstract/constants/default-estimated-gas.ts ***!
|
235127
|
-
\*********************************************************************************************************************************/
|
235128
|
-
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
235129
|
-
|
235130
|
-
"use strict";
|
235131
|
-
|
235132
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
235133
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
235134
|
-
};
|
235135
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
235136
|
-
exports.defaultEstimatedGas = void 0;
|
235137
|
-
const bignumber_js_1 = __importDefault(__webpack_require__(/*! bignumber.js */ "./node_modules/bignumber.js/bignumber.js"));
|
235138
|
-
exports.defaultEstimatedGas = {
|
235139
|
-
tokensToTokens: [
|
235140
|
-
new bignumber_js_1.default(120000),
|
235141
|
-
new bignumber_js_1.default(220000),
|
235142
|
-
new bignumber_js_1.default(300000),
|
235143
|
-
new bignumber_js_1.default(400000)
|
235144
|
-
],
|
235145
|
-
tokensToEth: [
|
235146
|
-
new bignumber_js_1.default(150000),
|
235147
|
-
new bignumber_js_1.default(240000),
|
235148
|
-
new bignumber_js_1.default(320000),
|
235149
|
-
new bignumber_js_1.default(400000)
|
235150
|
-
],
|
235151
|
-
ethToTokens: [
|
235152
|
-
new bignumber_js_1.default(180000),
|
235153
|
-
new bignumber_js_1.default(240000),
|
235154
|
-
new bignumber_js_1.default(320000),
|
235155
|
-
new bignumber_js_1.default(400000)
|
235156
|
-
]
|
235157
|
-
};
|
235158
|
-
|
235159
|
-
|
235160
|
-
/***/ }),
|
235161
|
-
|
235162
|
-
/***/ "./src/features/on-chain/calculation-manager/providers/dexes/common/uniswap-v2-abstract/constants/dex-trader/dex-trader-abi.ts":
|
235163
|
-
/*!*************************************************************************************************************************************!*\
|
235164
|
-
!*** ./src/features/on-chain/calculation-manager/providers/dexes/common/uniswap-v2-abstract/constants/dex-trader/dex-trader-abi.ts ***!
|
235165
|
-
\*************************************************************************************************************************************/
|
235166
|
-
/***/ ((__unused_webpack_module, exports) => {
|
235167
|
-
|
235168
|
-
"use strict";
|
235169
|
-
|
235170
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
235171
|
-
exports.DEX_TRADER_ABI = void 0;
|
235172
|
-
exports.DEX_TRADER_ABI = [
|
235173
|
-
{
|
235174
|
-
inputs: [],
|
235175
|
-
name: 'getAmountsIn',
|
235176
|
-
outputs: [],
|
235177
|
-
stateMutability: 'view',
|
235178
|
-
type: 'function'
|
235179
|
-
},
|
235180
|
-
{
|
235181
|
-
inputs: [],
|
235182
|
-
name: 'getAmountsOut',
|
235183
|
-
outputs: [],
|
235184
|
-
stateMutability: 'view',
|
235185
|
-
type: 'function'
|
235186
|
-
},
|
235187
|
-
{
|
235188
|
-
inputs: [
|
235189
|
-
{
|
235190
|
-
internalType: 'uint256',
|
235191
|
-
name: 'amountOut',
|
235192
|
-
type: 'uint256'
|
235193
|
-
},
|
235194
|
-
{
|
235195
|
-
internalType: 'address[]',
|
235196
|
-
name: 'path',
|
235197
|
-
type: 'address[]'
|
235198
|
-
},
|
235199
|
-
{
|
235200
|
-
internalType: 'address',
|
235201
|
-
name: 'to',
|
235202
|
-
type: 'address'
|
235203
|
-
},
|
235204
|
-
{
|
235205
|
-
internalType: 'uint256',
|
235206
|
-
name: 'deadline',
|
235207
|
-
type: 'uint256'
|
235208
|
-
}
|
235209
|
-
],
|
235210
|
-
name: 'swapETHForExactTokens',
|
235211
|
-
outputs: [
|
235212
|
-
{
|
235213
|
-
internalType: 'uint256[]',
|
235214
|
-
name: 'amounts',
|
235215
|
-
type: 'uint256[]'
|
235216
|
-
}
|
235217
|
-
],
|
235218
|
-
stateMutability: 'payable',
|
235219
|
-
type: 'function'
|
235220
|
-
},
|
235221
|
-
{
|
235222
|
-
inputs: [
|
235223
|
-
{
|
235224
|
-
internalType: 'uint256',
|
235225
|
-
name: 'amountOutMin',
|
235226
|
-
type: 'uint256'
|
235227
|
-
},
|
235228
|
-
{
|
235229
|
-
internalType: 'address[]',
|
235230
|
-
name: 'path',
|
235231
|
-
type: 'address[]'
|
235232
|
-
},
|
235233
|
-
{
|
235234
|
-
internalType: 'address',
|
235235
|
-
name: 'to',
|
235236
|
-
type: 'address'
|
235237
|
-
},
|
235238
|
-
{
|
235239
|
-
internalType: 'uint256',
|
235240
|
-
name: 'deadline',
|
235241
|
-
type: 'uint256'
|
235242
|
-
}
|
235243
|
-
],
|
235244
|
-
name: 'swapExactETHForTokens',
|
235245
|
-
outputs: [
|
235246
|
-
{
|
235247
|
-
internalType: 'uint256[]',
|
235248
|
-
name: 'amounts',
|
235249
|
-
type: 'uint256[]'
|
235250
|
-
}
|
235251
|
-
],
|
235252
|
-
stateMutability: 'payable',
|
235253
|
-
type: 'function'
|
235254
|
-
},
|
235255
|
-
{
|
235256
|
-
inputs: [
|
235257
|
-
{
|
235258
|
-
internalType: 'uint256',
|
235259
|
-
name: 'amountOutMin',
|
235260
|
-
type: 'uint256'
|
235261
|
-
},
|
235262
|
-
{
|
235263
|
-
internalType: 'address[]',
|
235264
|
-
name: 'path',
|
235265
|
-
type: 'address[]'
|
235266
|
-
},
|
235267
|
-
{
|
235268
|
-
internalType: 'address',
|
235269
|
-
name: 'to',
|
235270
|
-
type: 'address'
|
235271
|
-
},
|
235272
|
-
{
|
235273
|
-
internalType: 'uint256',
|
235274
|
-
name: 'deadline',
|
235275
|
-
type: 'uint256'
|
235276
|
-
}
|
235277
|
-
],
|
235278
|
-
name: 'swapExactETHForTokensSupportingFeeOnTransferTokens',
|
235279
|
-
outputs: [],
|
235280
|
-
stateMutability: 'payable',
|
235281
|
-
type: 'function'
|
235282
|
-
},
|
235283
|
-
{
|
235284
|
-
inputs: [
|
235285
|
-
{
|
235286
|
-
internalType: 'uint256',
|
235287
|
-
name: 'amountIn',
|
235288
|
-
type: 'uint256'
|
235289
|
-
},
|
235290
|
-
{
|
235291
|
-
internalType: 'uint256',
|
235292
|
-
name: 'amountOutMin',
|
235293
|
-
type: 'uint256'
|
235294
|
-
},
|
235295
|
-
{
|
235296
|
-
internalType: 'address[]',
|
235297
|
-
name: 'path',
|
235298
|
-
type: 'address[]'
|
235299
|
-
},
|
235300
|
-
{
|
235301
|
-
internalType: 'address',
|
235302
|
-
name: 'to',
|
235303
|
-
type: 'address'
|
235304
|
-
},
|
235305
|
-
{
|
235306
|
-
internalType: 'uint256',
|
235307
|
-
name: 'deadline',
|
235308
|
-
type: 'uint256'
|
235309
|
-
}
|
235310
|
-
],
|
235311
|
-
name: 'swapExactTokensForETHSupportingFeeOnTransferTokens',
|
235312
|
-
outputs: [],
|
235313
|
-
stateMutability: 'nonpayable',
|
235314
|
-
type: 'function'
|
235315
|
-
},
|
235316
|
-
{
|
235317
|
-
inputs: [
|
235318
|
-
{
|
235319
|
-
internalType: 'uint256',
|
235320
|
-
name: 'amountIn',
|
235321
|
-
type: 'uint256'
|
235322
|
-
},
|
235323
|
-
{
|
235324
|
-
internalType: 'uint256',
|
235325
|
-
name: 'amountOutMin',
|
235326
|
-
type: 'uint256'
|
235327
|
-
},
|
235328
|
-
{
|
235329
|
-
internalType: 'address[]',
|
235330
|
-
name: 'path',
|
235331
|
-
type: 'address[]'
|
235332
|
-
},
|
235333
|
-
{
|
235334
|
-
internalType: 'address',
|
235335
|
-
name: 'to',
|
235336
|
-
type: 'address'
|
235337
|
-
},
|
235338
|
-
{
|
235339
|
-
internalType: 'uint256',
|
235340
|
-
name: 'deadline',
|
235341
|
-
type: 'uint256'
|
235342
|
-
}
|
235343
|
-
],
|
235344
|
-
name: 'swapExactTokensForTokens',
|
235345
|
-
outputs: [
|
235346
|
-
{
|
235347
|
-
internalType: 'uint256[]',
|
235348
|
-
name: 'amounts',
|
235349
|
-
type: 'uint256[]'
|
235350
|
-
}
|
235351
|
-
],
|
235352
|
-
stateMutability: 'nonpayable',
|
235353
|
-
type: 'function'
|
235354
|
-
},
|
235355
|
-
{
|
235356
|
-
inputs: [
|
235357
|
-
{
|
235358
|
-
internalType: 'uint256',
|
235359
|
-
name: 'amountIn',
|
235360
|
-
type: 'uint256'
|
235361
|
-
},
|
235362
|
-
{
|
235363
|
-
internalType: 'uint256',
|
235364
|
-
name: 'amountOutMin',
|
235365
|
-
type: 'uint256'
|
235366
|
-
},
|
235367
|
-
{
|
235368
|
-
internalType: 'address[]',
|
235369
|
-
name: 'path',
|
235370
|
-
type: 'address[]'
|
235371
|
-
},
|
235372
|
-
{
|
235373
|
-
internalType: 'address',
|
235374
|
-
name: 'to',
|
235375
|
-
type: 'address'
|
235376
|
-
},
|
235377
|
-
{
|
235378
|
-
internalType: 'uint256',
|
235379
|
-
name: 'deadline',
|
235380
|
-
type: 'uint256'
|
235381
|
-
}
|
235382
|
-
],
|
235383
|
-
name: 'swapExactTokensForTokensSupportingFeeOnTransferTokens',
|
235384
|
-
outputs: [],
|
235385
|
-
stateMutability: 'nonpayable',
|
235386
|
-
type: 'function'
|
235387
|
-
},
|
235388
|
-
{
|
235389
|
-
inputs: [
|
235390
|
-
{
|
235391
|
-
internalType: 'uint256',
|
235392
|
-
name: 'amountIn',
|
235393
|
-
type: 'uint256'
|
235394
|
-
},
|
235395
|
-
{
|
235396
|
-
internalType: 'uint256',
|
235397
|
-
name: 'amountOutMin',
|
235398
|
-
type: 'uint256'
|
235399
|
-
},
|
235400
|
-
{
|
235401
|
-
internalType: 'address[]',
|
235402
|
-
name: 'path',
|
235403
|
-
type: 'address[]'
|
235404
|
-
},
|
235405
|
-
{
|
235406
|
-
internalType: 'address',
|
235407
|
-
name: 'to',
|
235408
|
-
type: 'address'
|
235409
|
-
},
|
235410
|
-
{
|
235411
|
-
internalType: 'uint256',
|
235412
|
-
name: 'deadline',
|
235413
|
-
type: 'uint256'
|
235414
|
-
}
|
235415
|
-
],
|
235416
|
-
name: 'swapExactTokensForETH',
|
235417
|
-
outputs: [
|
235418
|
-
{
|
235419
|
-
internalType: 'uint256[]',
|
235420
|
-
name: 'amounts',
|
235421
|
-
type: 'uint256[]'
|
235422
|
-
}
|
235423
|
-
],
|
235424
|
-
stateMutability: 'nonpayable',
|
235425
|
-
type: 'function'
|
235426
|
-
},
|
235427
|
-
{
|
235428
|
-
inputs: [
|
235429
|
-
{
|
235430
|
-
internalType: 'uint256',
|
235431
|
-
name: 'amountOut',
|
235432
|
-
type: 'uint256'
|
235433
|
-
},
|
235434
|
-
{
|
235435
|
-
internalType: 'uint256',
|
235436
|
-
name: 'amountInMax',
|
235437
|
-
type: 'uint256'
|
235438
|
-
},
|
235439
|
-
{
|
235440
|
-
internalType: 'address[]',
|
235441
|
-
name: 'path',
|
235442
|
-
type: 'address[]'
|
235443
|
-
},
|
235444
|
-
{
|
235445
|
-
internalType: 'address',
|
235446
|
-
name: 'to',
|
235447
|
-
type: 'address'
|
235448
|
-
},
|
235449
|
-
{
|
235450
|
-
internalType: 'uint256',
|
235451
|
-
name: 'deadline',
|
235452
|
-
type: 'uint256'
|
235453
|
-
}
|
235454
|
-
],
|
235455
|
-
name: 'swapTokensForExactETH',
|
235456
|
-
outputs: [
|
235457
|
-
{
|
235458
|
-
internalType: 'uint256[]',
|
235459
|
-
name: 'amounts',
|
235460
|
-
type: 'uint256[]'
|
235461
|
-
}
|
235462
|
-
],
|
235463
|
-
stateMutability: 'nonpayable',
|
235464
|
-
type: 'function'
|
235465
|
-
},
|
235466
|
-
{
|
235467
|
-
inputs: [
|
235468
|
-
{
|
235469
|
-
internalType: 'uint256',
|
235470
|
-
name: 'amountOut',
|
235471
|
-
type: 'uint256'
|
235472
|
-
},
|
235473
|
-
{
|
235474
|
-
internalType: 'uint256',
|
235475
|
-
name: 'amountInMax',
|
235476
|
-
type: 'uint256'
|
235477
|
-
},
|
235478
|
-
{
|
235479
|
-
internalType: 'address[]',
|
235480
|
-
name: 'path',
|
235481
|
-
type: 'address[]'
|
235482
|
-
},
|
235483
|
-
{
|
235484
|
-
internalType: 'address',
|
235485
|
-
name: 'to',
|
235486
|
-
type: 'address'
|
235487
|
-
},
|
235488
|
-
{
|
235489
|
-
internalType: 'uint256',
|
235490
|
-
name: 'deadline',
|
235491
|
-
type: 'uint256'
|
235469
|
+
quote: pathQuoteOut
|
235470
|
+
};
|
235471
|
+
}
|
235472
|
+
static async calculateGroupAmounts(paths, amounts, blockchainName) {
|
235473
|
+
const pathsWithAmounts = [];
|
235474
|
+
let amountOut = constants_1.ZERO;
|
235475
|
+
let quoteOut = constants_1.ZERO;
|
235476
|
+
const groupPaths = paths;
|
235477
|
+
const lastSteps = new Map();
|
235478
|
+
for (let i = 0; i < groupPaths.length; i++) {
|
235479
|
+
const pathAmountIn = amounts[i];
|
235480
|
+
if (pathAmountIn.isZero()) {
|
235481
|
+
// eslint-disable-next-line no-continue
|
235482
|
+
continue;
|
235492
235483
|
}
|
235493
|
-
|
235494
|
-
|
235495
|
-
|
235496
|
-
|
235497
|
-
|
235498
|
-
|
235499
|
-
type: 'uint256[]'
|
235484
|
+
const path = groupPaths[i];
|
235485
|
+
for (let j = 0; j < path.length; j++) {
|
235486
|
+
const lastStep = lastSteps.get(path[j].pool.pool);
|
235487
|
+
if (lastStep !== undefined) {
|
235488
|
+
path[j] = SyncSwapRouter.copyStep(lastStep);
|
235489
|
+
}
|
235500
235490
|
}
|
235501
|
-
|
235502
|
-
|
235503
|
-
|
235491
|
+
const pathWithAmounts =
|
235492
|
+
// eslint-disable-next-line no-await-in-loop
|
235493
|
+
await SyncSwapRouter.calculatePathAmountsByInput(path, pathAmountIn, true, blockchainName);
|
235494
|
+
if (pathWithAmounts != null) {
|
235495
|
+
for (const step of pathWithAmounts.stepsWithAmount) {
|
235496
|
+
if (step.updatedStep !== null) {
|
235497
|
+
lastSteps.set(step.pool.pool, step.updatedStep);
|
235498
|
+
}
|
235499
|
+
}
|
235500
|
+
pathsWithAmounts.push(pathWithAmounts);
|
235501
|
+
amountOut = amountOut.add(pathWithAmounts.amountOut);
|
235502
|
+
quoteOut = quoteOut.add(pathWithAmounts.quote);
|
235503
|
+
}
|
235504
|
+
}
|
235505
|
+
return {
|
235506
|
+
pathsWithAmounts,
|
235507
|
+
amountOut,
|
235508
|
+
quoteOut
|
235509
|
+
};
|
235504
235510
|
}
|
235505
|
-
|
235511
|
+
static async getPoolPrecision(address, fromAddress, blockchainName) {
|
235512
|
+
const web3Public = injector_1.Injector.web3PublicService.getWeb3Public(blockchainName);
|
235513
|
+
const token0 = await web3Public.callContractMethod(address, sync_swap_stable_pool_1.syncSwapStablePool, 'token0', []);
|
235514
|
+
const token0PM = await web3Public.callContractMethod(address, sync_swap_stable_pool_1.syncSwapStablePool, 'token0PrecisionMultiplier', []);
|
235515
|
+
const token1PM = await web3Public.callContractMethod(address, sync_swap_stable_pool_1.syncSwapStablePool, 'token1PrecisionMultiplier', []);
|
235516
|
+
return (0, blockchain_1.compareAddresses)(token0, fromAddress)
|
235517
|
+
? {
|
235518
|
+
fromPrecisionMultiplier: token0PM,
|
235519
|
+
toPrecisionMultiplier: token1PM
|
235520
|
+
}
|
235521
|
+
: {
|
235522
|
+
fromPrecisionMultiplier: token1PM,
|
235523
|
+
toPrecisionMultiplier: token0PM
|
235524
|
+
};
|
235525
|
+
}
|
235526
|
+
}
|
235527
|
+
exports.SyncSwapRouter = SyncSwapRouter;
|
235528
|
+
__decorate([
|
235529
|
+
decorators_1.Cache
|
235530
|
+
], SyncSwapRouter, "getPoolPrecision", null);
|
235506
235531
|
|
235507
235532
|
|
235508
235533
|
/***/ }),
|
235509
235534
|
|
235510
|
-
/***/ "./src/features/on-chain/calculation-manager/providers/dexes/common/
|
235511
|
-
|
235512
|
-
!*** ./src/features/on-chain/calculation-manager/providers/dexes/common/
|
235513
|
-
|
235535
|
+
/***/ "./src/features/on-chain/calculation-manager/providers/dexes/common/sync-swap-abstract/utils/typings.ts":
|
235536
|
+
/*!**************************************************************************************************************!*\
|
235537
|
+
!*** ./src/features/on-chain/calculation-manager/providers/dexes/common/sync-swap-abstract/utils/typings.ts ***!
|
235538
|
+
\**************************************************************************************************************/
|
235514
235539
|
/***/ ((__unused_webpack_module, exports) => {
|
235515
235540
|
|
235516
235541
|
"use strict";
|
235517
235542
|
|
235518
235543
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
235519
|
-
exports.
|
235520
|
-
exports.
|
235544
|
+
exports.routeDirection = void 0;
|
235545
|
+
exports.routeDirection = {
|
235546
|
+
EXACT_IN: 'EXACT_IN',
|
235547
|
+
EXACT_OUT: 'EXACT_OUT'
|
235548
|
+
};
|
235549
|
+
|
235550
|
+
|
235551
|
+
/***/ }),
|
235552
|
+
|
235553
|
+
/***/ "./src/features/on-chain/calculation-manager/providers/dexes/common/uniswap-v2-abstract/constants/SWAP_METHOD.ts":
|
235554
|
+
/*!***********************************************************************************************************************!*\
|
235555
|
+
!*** ./src/features/on-chain/calculation-manager/providers/dexes/common/uniswap-v2-abstract/constants/SWAP_METHOD.ts ***!
|
235556
|
+
\***********************************************************************************************************************/
|
235557
|
+
/***/ ((__unused_webpack_module, exports) => {
|
235558
|
+
|
235559
|
+
"use strict";
|
235560
|
+
|
235561
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
235562
|
+
exports.SUPPORTING_FEE_SWAP_METHODS_MAPPING = exports.SWAP_METHOD = exports.EXACT_OUTPUT_SWAP_METHOD = exports.EXACT_OUTPUT_SUPPORTING_FEE_SWAP_METHOD = exports.EXACT_OUTPUT_REGULAR_SWAP_METHOD = exports.EXACT_INPUT_SWAP_METHOD = exports.EXACT_INPUT_SUPPORTING_FEE_SWAP_METHOD = exports.EXACT_INPUT_REGULAR_SWAP_METHOD = void 0;
|
235563
|
+
exports.EXACT_INPUT_REGULAR_SWAP_METHOD = {
|
235521
235564
|
TOKENS_TO_TOKENS: 'swapExactTokensForTokens',
|
235522
235565
|
ETH_TO_TOKENS: 'swapExactETHForTokens',
|
235523
235566
|
TOKENS_TO_ETH: 'swapExactTokensForETH'
|
235524
235567
|
};
|
235525
|
-
exports.
|
235568
|
+
exports.EXACT_INPUT_SUPPORTING_FEE_SWAP_METHOD = {
|
235526
235569
|
TOKENS_TO_TOKENS_SUPPORTING_FEE: 'swapExactTokensForTokensSupportingFeeOnTransferTokens',
|
235527
235570
|
ETH_TO_TOKENS_SUPPORTING_FEE: 'swapExactETHForTokensSupportingFeeOnTransferTokens',
|
235528
235571
|
TOKENS_TO_ETH_SUPPORTING_FEE: 'swapExactTokensForETHSupportingFeeOnTransferTokens'
|
235529
235572
|
};
|
235530
|
-
exports.
|
235531
|
-
...exports.
|
235532
|
-
...exports.
|
235573
|
+
exports.EXACT_INPUT_SWAP_METHOD = {
|
235574
|
+
...exports.EXACT_INPUT_REGULAR_SWAP_METHOD,
|
235575
|
+
...exports.EXACT_INPUT_SUPPORTING_FEE_SWAP_METHOD
|
235533
235576
|
};
|
235534
|
-
exports.
|
235577
|
+
exports.EXACT_OUTPUT_REGULAR_SWAP_METHOD = {
|
235535
235578
|
TOKENS_TO_TOKENS: 'swapTokensForExactTokens',
|
235536
235579
|
ETH_TO_TOKENS: 'swapETHForExactTokens',
|
235537
235580
|
TOKENS_TO_ETH: 'swapTokensForExactETH'
|
235538
235581
|
};
|
235539
|
-
exports.
|
235582
|
+
exports.EXACT_OUTPUT_SUPPORTING_FEE_SWAP_METHOD = {
|
235540
235583
|
TOKENS_TO_TOKENS_SUPPORTING_FEE: 'swapTokensForExactTokensSupportingFeeOnTransferTokens',
|
235541
235584
|
ETH_TO_TOKENS_SUPPORTING_FEE: 'swapETHForExactTokensSupportingFeeOnTransferTokens',
|
235542
235585
|
TOKENS_TO_ETH_SUPPORTING_FEE: 'swapTokensForExactETHSupportingFeeOnTransferTokens'
|
235543
235586
|
};
|
235544
|
-
exports.
|
235545
|
-
...exports.
|
235546
|
-
...exports.
|
235587
|
+
exports.EXACT_OUTPUT_SWAP_METHOD = {
|
235588
|
+
...exports.EXACT_OUTPUT_REGULAR_SWAP_METHOD,
|
235589
|
+
...exports.EXACT_OUTPUT_SUPPORTING_FEE_SWAP_METHOD
|
235547
235590
|
};
|
235548
|
-
exports.
|
235549
|
-
input: exports.
|
235550
|
-
output: exports.
|
235591
|
+
exports.SWAP_METHOD = {
|
235592
|
+
input: exports.EXACT_INPUT_SWAP_METHOD,
|
235593
|
+
output: exports.EXACT_OUTPUT_SWAP_METHOD
|
235594
|
+
};
|
235595
|
+
exports.SUPPORTING_FEE_SWAP_METHODS_MAPPING = {
|
235596
|
+
TOKENS_TO_TOKENS: 'TOKENS_TO_TOKENS_SUPPORTING_FEE',
|
235597
|
+
ETH_TO_TOKENS: 'ETH_TO_TOKENS_SUPPORTING_FEE',
|
235598
|
+
TOKENS_TO_ETH: 'TOKENS_TO_ETH_SUPPORTING_FEE'
|
235551
235599
|
};
|
235552
235600
|
|
235553
235601
|
|
235554
235602
|
/***/ }),
|
235555
235603
|
|
235556
|
-
/***/ "./src/features/on-chain/calculation-manager/providers/dexes/common/uniswap-v2-abstract/constants/
|
235557
|
-
|
235558
|
-
!*** ./src/features/on-chain/calculation-manager/providers/dexes/common/uniswap-v2-abstract/constants/
|
235559
|
-
|
235604
|
+
/***/ "./src/features/on-chain/calculation-manager/providers/dexes/common/uniswap-v2-abstract/constants/default-estimated-gas.ts":
|
235605
|
+
/*!*********************************************************************************************************************************!*\
|
235606
|
+
!*** ./src/features/on-chain/calculation-manager/providers/dexes/common/uniswap-v2-abstract/constants/default-estimated-gas.ts ***!
|
235607
|
+
\*********************************************************************************************************************************/
|
235608
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
235609
|
+
|
235610
|
+
"use strict";
|
235611
|
+
|
235612
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
235613
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
235614
|
+
};
|
235615
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
235616
|
+
exports.defaultEstimatedGas = void 0;
|
235617
|
+
const bignumber_js_1 = __importDefault(__webpack_require__(/*! bignumber.js */ "./node_modules/bignumber.js/bignumber.js"));
|
235618
|
+
exports.defaultEstimatedGas = {
|
235619
|
+
tokensToTokens: [
|
235620
|
+
new bignumber_js_1.default(120000),
|
235621
|
+
new bignumber_js_1.default(220000),
|
235622
|
+
new bignumber_js_1.default(300000),
|
235623
|
+
new bignumber_js_1.default(400000)
|
235624
|
+
],
|
235625
|
+
tokensToEth: [
|
235626
|
+
new bignumber_js_1.default(150000),
|
235627
|
+
new bignumber_js_1.default(240000),
|
235628
|
+
new bignumber_js_1.default(320000),
|
235629
|
+
new bignumber_js_1.default(400000)
|
235630
|
+
],
|
235631
|
+
ethToTokens: [
|
235632
|
+
new bignumber_js_1.default(180000),
|
235633
|
+
new bignumber_js_1.default(240000),
|
235634
|
+
new bignumber_js_1.default(320000),
|
235635
|
+
new bignumber_js_1.default(400000)
|
235636
|
+
]
|
235637
|
+
};
|
235638
|
+
|
235639
|
+
|
235640
|
+
/***/ }),
|
235641
|
+
|
235642
|
+
/***/ "./src/features/on-chain/calculation-manager/providers/dexes/common/uniswap-v2-abstract/constants/dex-trader/dex-trader-abi.ts":
|
235643
|
+
/*!*************************************************************************************************************************************!*\
|
235644
|
+
!*** ./src/features/on-chain/calculation-manager/providers/dexes/common/uniswap-v2-abstract/constants/dex-trader/dex-trader-abi.ts ***!
|
235645
|
+
\*************************************************************************************************************************************/
|
235560
235646
|
/***/ ((__unused_webpack_module, exports) => {
|
235561
235647
|
|
235562
235648
|
"use strict";
|
235563
235649
|
|
235564
235650
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
235565
|
-
exports.
|
235566
|
-
exports.
|
235651
|
+
exports.DEX_TRADER_ABI = void 0;
|
235652
|
+
exports.DEX_TRADER_ABI = [
|
235567
235653
|
{
|
235568
|
-
inputs: [
|
235569
|
-
|
235570
|
-
|
235571
|
-
|
235572
|
-
|
235573
|
-
},
|
235574
|
-
{
|
235575
|
-
internalType: 'address',
|
235576
|
-
name: '_WETH',
|
235577
|
-
type: 'address'
|
235578
|
-
}
|
235579
|
-
],
|
235580
|
-
stateMutability: 'nonpayable',
|
235581
|
-
type: 'constructor'
|
235654
|
+
inputs: [],
|
235655
|
+
name: 'getAmountsIn',
|
235656
|
+
outputs: [],
|
235657
|
+
stateMutability: 'view',
|
235658
|
+
type: 'function'
|
235582
235659
|
},
|
235583
235660
|
{
|
235584
235661
|
inputs: [],
|
235585
|
-
name: '
|
235586
|
-
outputs: [
|
235587
|
-
{
|
235588
|
-
internalType: 'address',
|
235589
|
-
name: '',
|
235590
|
-
type: 'address'
|
235591
|
-
}
|
235592
|
-
],
|
235662
|
+
name: 'getAmountsOut',
|
235663
|
+
outputs: [],
|
235593
235664
|
stateMutability: 'view',
|
235594
235665
|
type: 'function'
|
235595
235666
|
},
|
235596
235667
|
{
|
235597
235668
|
inputs: [
|
235598
|
-
{
|
235599
|
-
internalType: 'address',
|
235600
|
-
name: 'tokenA',
|
235601
|
-
type: 'address'
|
235602
|
-
},
|
235603
|
-
{
|
235604
|
-
internalType: 'address',
|
235605
|
-
name: 'tokenB',
|
235606
|
-
type: 'address'
|
235607
|
-
},
|
235608
|
-
{
|
235609
|
-
internalType: 'uint256',
|
235610
|
-
name: 'amountADesired',
|
235611
|
-
type: 'uint256'
|
235612
|
-
},
|
235613
|
-
{
|
235614
|
-
internalType: 'uint256',
|
235615
|
-
name: 'amountBDesired',
|
235616
|
-
type: 'uint256'
|
235617
|
-
},
|
235618
235669
|
{
|
235619
235670
|
internalType: 'uint256',
|
235620
|
-
name: '
|
235671
|
+
name: 'amountOut',
|
235621
235672
|
type: 'uint256'
|
235622
235673
|
},
|
235623
235674
|
{
|
235624
|
-
internalType: '
|
235625
|
-
name: '
|
235626
|
-
type: '
|
235675
|
+
internalType: 'address[]',
|
235676
|
+
name: 'path',
|
235677
|
+
type: 'address[]'
|
235627
235678
|
},
|
235628
235679
|
{
|
235629
235680
|
internalType: 'address',
|
@@ -235636,48 +235687,28 @@ exports.defaultUniswapV2Abi = [
|
|
235636
235687
|
type: 'uint256'
|
235637
235688
|
}
|
235638
235689
|
],
|
235639
|
-
name: '
|
235690
|
+
name: 'swapETHForExactTokens',
|
235640
235691
|
outputs: [
|
235641
235692
|
{
|
235642
|
-
internalType: 'uint256',
|
235643
|
-
name: '
|
235644
|
-
type: 'uint256'
|
235645
|
-
},
|
235646
|
-
{
|
235647
|
-
internalType: 'uint256',
|
235648
|
-
name: 'amountB',
|
235649
|
-
type: 'uint256'
|
235650
|
-
},
|
235651
|
-
{
|
235652
|
-
internalType: 'uint256',
|
235653
|
-
name: 'liquidity',
|
235654
|
-
type: 'uint256'
|
235693
|
+
internalType: 'uint256[]',
|
235694
|
+
name: 'amounts',
|
235695
|
+
type: 'uint256[]'
|
235655
235696
|
}
|
235656
235697
|
],
|
235657
|
-
stateMutability: '
|
235698
|
+
stateMutability: 'payable',
|
235658
235699
|
type: 'function'
|
235659
235700
|
},
|
235660
235701
|
{
|
235661
|
-
inputs: [
|
235662
|
-
{
|
235663
|
-
internalType: 'address',
|
235664
|
-
name: 'token',
|
235665
|
-
type: 'address'
|
235666
|
-
},
|
235667
|
-
{
|
235668
|
-
internalType: 'uint256',
|
235669
|
-
name: 'amountTokenDesired',
|
235670
|
-
type: 'uint256'
|
235671
|
-
},
|
235702
|
+
inputs: [
|
235672
235703
|
{
|
235673
235704
|
internalType: 'uint256',
|
235674
|
-
name: '
|
235705
|
+
name: 'amountOutMin',
|
235675
235706
|
type: 'uint256'
|
235676
235707
|
},
|
235677
235708
|
{
|
235678
|
-
internalType: '
|
235679
|
-
name: '
|
235680
|
-
type: '
|
235709
|
+
internalType: 'address[]',
|
235710
|
+
name: 'path',
|
235711
|
+
type: 'address[]'
|
235681
235712
|
},
|
235682
235713
|
{
|
235683
235714
|
internalType: 'address',
|
@@ -235690,67 +235721,76 @@ exports.defaultUniswapV2Abi = [
|
|
235690
235721
|
type: 'uint256'
|
235691
235722
|
}
|
235692
235723
|
],
|
235693
|
-
name: '
|
235724
|
+
name: 'swapExactETHForTokens',
|
235694
235725
|
outputs: [
|
235695
235726
|
{
|
235696
|
-
internalType: 'uint256',
|
235697
|
-
name: '
|
235698
|
-
type: 'uint256'
|
235699
|
-
},
|
235700
|
-
{
|
235701
|
-
internalType: 'uint256',
|
235702
|
-
name: 'amountETH',
|
235703
|
-
type: 'uint256'
|
235704
|
-
},
|
235705
|
-
{
|
235706
|
-
internalType: 'uint256',
|
235707
|
-
name: 'liquidity',
|
235708
|
-
type: 'uint256'
|
235727
|
+
internalType: 'uint256[]',
|
235728
|
+
name: 'amounts',
|
235729
|
+
type: 'uint256[]'
|
235709
235730
|
}
|
235710
235731
|
],
|
235711
235732
|
stateMutability: 'payable',
|
235712
235733
|
type: 'function'
|
235713
235734
|
},
|
235714
235735
|
{
|
235715
|
-
inputs: [
|
235716
|
-
|
235717
|
-
|
235736
|
+
inputs: [
|
235737
|
+
{
|
235738
|
+
internalType: 'uint256',
|
235739
|
+
name: 'amountOutMin',
|
235740
|
+
type: 'uint256'
|
235741
|
+
},
|
235742
|
+
{
|
235743
|
+
internalType: 'address[]',
|
235744
|
+
name: 'path',
|
235745
|
+
type: 'address[]'
|
235746
|
+
},
|
235718
235747
|
{
|
235719
235748
|
internalType: 'address',
|
235720
|
-
name: '',
|
235749
|
+
name: 'to',
|
235721
235750
|
type: 'address'
|
235751
|
+
},
|
235752
|
+
{
|
235753
|
+
internalType: 'uint256',
|
235754
|
+
name: 'deadline',
|
235755
|
+
type: 'uint256'
|
235722
235756
|
}
|
235723
235757
|
],
|
235724
|
-
|
235758
|
+
name: 'swapExactETHForTokensSupportingFeeOnTransferTokens',
|
235759
|
+
outputs: [],
|
235760
|
+
stateMutability: 'payable',
|
235725
235761
|
type: 'function'
|
235726
235762
|
},
|
235727
235763
|
{
|
235728
235764
|
inputs: [
|
235729
235765
|
{
|
235730
235766
|
internalType: 'uint256',
|
235731
|
-
name: '
|
235767
|
+
name: 'amountIn',
|
235732
235768
|
type: 'uint256'
|
235733
235769
|
},
|
235734
235770
|
{
|
235735
235771
|
internalType: 'uint256',
|
235736
|
-
name: '
|
235772
|
+
name: 'amountOutMin',
|
235737
235773
|
type: 'uint256'
|
235738
235774
|
},
|
235739
235775
|
{
|
235740
|
-
internalType: '
|
235741
|
-
name: '
|
235742
|
-
type: '
|
235743
|
-
}
|
235744
|
-
|
235745
|
-
|
235746
|
-
|
235776
|
+
internalType: 'address[]',
|
235777
|
+
name: 'path',
|
235778
|
+
type: 'address[]'
|
235779
|
+
},
|
235780
|
+
{
|
235781
|
+
internalType: 'address',
|
235782
|
+
name: 'to',
|
235783
|
+
type: 'address'
|
235784
|
+
},
|
235747
235785
|
{
|
235748
235786
|
internalType: 'uint256',
|
235749
|
-
name: '
|
235787
|
+
name: 'deadline',
|
235750
235788
|
type: 'uint256'
|
235751
235789
|
}
|
235752
235790
|
],
|
235753
|
-
|
235791
|
+
name: 'swapExactTokensForETHSupportingFeeOnTransferTokens',
|
235792
|
+
outputs: [],
|
235793
|
+
stateMutability: 'nonpayable',
|
235754
235794
|
type: 'function'
|
235755
235795
|
},
|
235756
235796
|
{
|
@@ -235762,48 +235802,67 @@ exports.defaultUniswapV2Abi = [
|
|
235762
235802
|
},
|
235763
235803
|
{
|
235764
235804
|
internalType: 'uint256',
|
235765
|
-
name: '
|
235805
|
+
name: 'amountOutMin',
|
235766
235806
|
type: 'uint256'
|
235767
235807
|
},
|
235808
|
+
{
|
235809
|
+
internalType: 'address[]',
|
235810
|
+
name: 'path',
|
235811
|
+
type: 'address[]'
|
235812
|
+
},
|
235813
|
+
{
|
235814
|
+
internalType: 'address',
|
235815
|
+
name: 'to',
|
235816
|
+
type: 'address'
|
235817
|
+
},
|
235768
235818
|
{
|
235769
235819
|
internalType: 'uint256',
|
235770
|
-
name: '
|
235820
|
+
name: 'deadline',
|
235771
235821
|
type: 'uint256'
|
235772
235822
|
}
|
235773
235823
|
],
|
235774
|
-
name: '
|
235824
|
+
name: 'swapExactTokensForTokens',
|
235775
235825
|
outputs: [
|
235776
235826
|
{
|
235777
|
-
internalType: 'uint256',
|
235778
|
-
name: '
|
235779
|
-
type: 'uint256'
|
235827
|
+
internalType: 'uint256[]',
|
235828
|
+
name: 'amounts',
|
235829
|
+
type: 'uint256[]'
|
235780
235830
|
}
|
235781
235831
|
],
|
235782
|
-
stateMutability: '
|
235832
|
+
stateMutability: 'nonpayable',
|
235783
235833
|
type: 'function'
|
235784
235834
|
},
|
235785
235835
|
{
|
235786
235836
|
inputs: [
|
235787
235837
|
{
|
235788
235838
|
internalType: 'uint256',
|
235789
|
-
name: '
|
235839
|
+
name: 'amountIn',
|
235840
|
+
type: 'uint256'
|
235841
|
+
},
|
235842
|
+
{
|
235843
|
+
internalType: 'uint256',
|
235844
|
+
name: 'amountOutMin',
|
235790
235845
|
type: 'uint256'
|
235791
235846
|
},
|
235792
235847
|
{
|
235793
235848
|
internalType: 'address[]',
|
235794
235849
|
name: 'path',
|
235795
235850
|
type: 'address[]'
|
235796
|
-
}
|
235797
|
-
],
|
235798
|
-
name: 'getAmountsIn',
|
235799
|
-
outputs: [
|
235851
|
+
},
|
235800
235852
|
{
|
235801
|
-
internalType: '
|
235802
|
-
name: '
|
235803
|
-
type: '
|
235853
|
+
internalType: 'address',
|
235854
|
+
name: 'to',
|
235855
|
+
type: 'address'
|
235856
|
+
},
|
235857
|
+
{
|
235858
|
+
internalType: 'uint256',
|
235859
|
+
name: 'deadline',
|
235860
|
+
type: 'uint256'
|
235804
235861
|
}
|
235805
235862
|
],
|
235806
|
-
|
235863
|
+
name: 'swapExactTokensForTokensSupportingFeeOnTransferTokens',
|
235864
|
+
outputs: [],
|
235865
|
+
stateMutability: 'nonpayable',
|
235807
235866
|
type: 'function'
|
235808
235867
|
},
|
235809
235868
|
{
|
@@ -235813,13 +235872,28 @@ exports.defaultUniswapV2Abi = [
|
|
235813
235872
|
name: 'amountIn',
|
235814
235873
|
type: 'uint256'
|
235815
235874
|
},
|
235875
|
+
{
|
235876
|
+
internalType: 'uint256',
|
235877
|
+
name: 'amountOutMin',
|
235878
|
+
type: 'uint256'
|
235879
|
+
},
|
235816
235880
|
{
|
235817
235881
|
internalType: 'address[]',
|
235818
235882
|
name: 'path',
|
235819
235883
|
type: 'address[]'
|
235884
|
+
},
|
235885
|
+
{
|
235886
|
+
internalType: 'address',
|
235887
|
+
name: 'to',
|
235888
|
+
type: 'address'
|
235889
|
+
},
|
235890
|
+
{
|
235891
|
+
internalType: 'uint256',
|
235892
|
+
name: 'deadline',
|
235893
|
+
type: 'uint256'
|
235820
235894
|
}
|
235821
235895
|
],
|
235822
|
-
name: '
|
235896
|
+
name: 'swapExactTokensForETH',
|
235823
235897
|
outputs: [
|
235824
235898
|
{
|
235825
235899
|
internalType: 'uint256[]',
|
@@ -235827,390 +235901,308 @@ exports.defaultUniswapV2Abi = [
|
|
235827
235901
|
type: 'uint256[]'
|
235828
235902
|
}
|
235829
235903
|
],
|
235830
|
-
stateMutability: '
|
235904
|
+
stateMutability: 'nonpayable',
|
235831
235905
|
type: 'function'
|
235832
235906
|
},
|
235833
235907
|
{
|
235834
235908
|
inputs: [
|
235835
235909
|
{
|
235836
235910
|
internalType: 'uint256',
|
235837
|
-
name: '
|
235911
|
+
name: 'amountOut',
|
235838
235912
|
type: 'uint256'
|
235839
235913
|
},
|
235840
235914
|
{
|
235841
235915
|
internalType: 'uint256',
|
235842
|
-
name: '
|
235916
|
+
name: 'amountInMax',
|
235843
235917
|
type: 'uint256'
|
235844
235918
|
},
|
235919
|
+
{
|
235920
|
+
internalType: 'address[]',
|
235921
|
+
name: 'path',
|
235922
|
+
type: 'address[]'
|
235923
|
+
},
|
235924
|
+
{
|
235925
|
+
internalType: 'address',
|
235926
|
+
name: 'to',
|
235927
|
+
type: 'address'
|
235928
|
+
},
|
235845
235929
|
{
|
235846
235930
|
internalType: 'uint256',
|
235847
|
-
name: '
|
235931
|
+
name: 'deadline',
|
235848
235932
|
type: 'uint256'
|
235849
235933
|
}
|
235850
235934
|
],
|
235851
|
-
name: '
|
235935
|
+
name: 'swapTokensForExactETH',
|
235852
235936
|
outputs: [
|
235853
235937
|
{
|
235854
|
-
internalType: 'uint256',
|
235855
|
-
name: '
|
235856
|
-
type: 'uint256'
|
235938
|
+
internalType: 'uint256[]',
|
235939
|
+
name: 'amounts',
|
235940
|
+
type: 'uint256[]'
|
235857
235941
|
}
|
235858
235942
|
],
|
235859
|
-
stateMutability: '
|
235943
|
+
stateMutability: 'nonpayable',
|
235860
235944
|
type: 'function'
|
235861
235945
|
},
|
235862
235946
|
{
|
235863
235947
|
inputs: [
|
235864
|
-
{
|
235865
|
-
internalType: 'address',
|
235866
|
-
name: 'tokenA',
|
235867
|
-
type: 'address'
|
235868
|
-
},
|
235869
|
-
{
|
235870
|
-
internalType: 'address',
|
235871
|
-
name: 'tokenB',
|
235872
|
-
type: 'address'
|
235873
|
-
},
|
235874
235948
|
{
|
235875
235949
|
internalType: 'uint256',
|
235876
|
-
name: '
|
235950
|
+
name: 'amountOut',
|
235877
235951
|
type: 'uint256'
|
235878
235952
|
},
|
235879
235953
|
{
|
235880
235954
|
internalType: 'uint256',
|
235881
|
-
name: '
|
235955
|
+
name: 'amountInMax',
|
235882
235956
|
type: 'uint256'
|
235883
235957
|
},
|
235958
|
+
{
|
235959
|
+
internalType: 'address[]',
|
235960
|
+
name: 'path',
|
235961
|
+
type: 'address[]'
|
235962
|
+
},
|
235963
|
+
{
|
235964
|
+
internalType: 'address',
|
235965
|
+
name: 'to',
|
235966
|
+
type: 'address'
|
235967
|
+
},
|
235884
235968
|
{
|
235885
235969
|
internalType: 'uint256',
|
235886
|
-
name: '
|
235970
|
+
name: 'deadline',
|
235887
235971
|
type: 'uint256'
|
235888
|
-
}
|
235972
|
+
}
|
235973
|
+
],
|
235974
|
+
name: 'swapTokensForExactTokens',
|
235975
|
+
outputs: [
|
235976
|
+
{
|
235977
|
+
internalType: 'uint256[]',
|
235978
|
+
name: 'amounts',
|
235979
|
+
type: 'uint256[]'
|
235980
|
+
}
|
235981
|
+
],
|
235982
|
+
stateMutability: 'nonpayable',
|
235983
|
+
type: 'function'
|
235984
|
+
}
|
235985
|
+
];
|
235986
|
+
|
235987
|
+
|
235988
|
+
/***/ }),
|
235989
|
+
|
235990
|
+
/***/ "./src/features/on-chain/calculation-manager/providers/dexes/common/uniswap-v2-abstract/constants/dex-trader/dex-trader-swap-method.ts":
|
235991
|
+
/*!*********************************************************************************************************************************************!*\
|
235992
|
+
!*** ./src/features/on-chain/calculation-manager/providers/dexes/common/uniswap-v2-abstract/constants/dex-trader/dex-trader-swap-method.ts ***!
|
235993
|
+
\*********************************************************************************************************************************************/
|
235994
|
+
/***/ ((__unused_webpack_module, exports) => {
|
235995
|
+
|
235996
|
+
"use strict";
|
235997
|
+
|
235998
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
235999
|
+
exports.ETH_SWAP_METHOD = exports.ETH_EXACT_OUTPUT_SWAP_METHOD = exports.ETH_EXACT_OUTPUT_SUPPORTING_FEE_SWAP_METHOD = exports.ETH_EXACT_OUTPUT_REGULAR_SWAP_METHOD = exports.ETH_EXACT_INPUT_SWAP_METHOD = exports.ETH_EXACT_INPUT_SUPPORTING_FEE_SWAP_METHOD = exports.ETH_EXACT_INPUT_REGULAR_SWAP_METHOD = void 0;
|
236000
|
+
exports.ETH_EXACT_INPUT_REGULAR_SWAP_METHOD = {
|
236001
|
+
TOKENS_TO_TOKENS: 'swapExactTokensForTokens',
|
236002
|
+
ETH_TO_TOKENS: 'swapExactETHForTokens',
|
236003
|
+
TOKENS_TO_ETH: 'swapExactTokensForETH'
|
236004
|
+
};
|
236005
|
+
exports.ETH_EXACT_INPUT_SUPPORTING_FEE_SWAP_METHOD = {
|
236006
|
+
TOKENS_TO_TOKENS_SUPPORTING_FEE: 'swapExactTokensForTokensSupportingFeeOnTransferTokens',
|
236007
|
+
ETH_TO_TOKENS_SUPPORTING_FEE: 'swapExactETHForTokensSupportingFeeOnTransferTokens',
|
236008
|
+
TOKENS_TO_ETH_SUPPORTING_FEE: 'swapExactTokensForETHSupportingFeeOnTransferTokens'
|
236009
|
+
};
|
236010
|
+
exports.ETH_EXACT_INPUT_SWAP_METHOD = {
|
236011
|
+
...exports.ETH_EXACT_INPUT_REGULAR_SWAP_METHOD,
|
236012
|
+
...exports.ETH_EXACT_INPUT_SUPPORTING_FEE_SWAP_METHOD
|
236013
|
+
};
|
236014
|
+
exports.ETH_EXACT_OUTPUT_REGULAR_SWAP_METHOD = {
|
236015
|
+
TOKENS_TO_TOKENS: 'swapTokensForExactTokens',
|
236016
|
+
ETH_TO_TOKENS: 'swapETHForExactTokens',
|
236017
|
+
TOKENS_TO_ETH: 'swapTokensForExactETH'
|
236018
|
+
};
|
236019
|
+
exports.ETH_EXACT_OUTPUT_SUPPORTING_FEE_SWAP_METHOD = {
|
236020
|
+
TOKENS_TO_TOKENS_SUPPORTING_FEE: 'swapTokensForExactTokensSupportingFeeOnTransferTokens',
|
236021
|
+
ETH_TO_TOKENS_SUPPORTING_FEE: 'swapETHForExactTokensSupportingFeeOnTransferTokens',
|
236022
|
+
TOKENS_TO_ETH_SUPPORTING_FEE: 'swapTokensForExactETHSupportingFeeOnTransferTokens'
|
236023
|
+
};
|
236024
|
+
exports.ETH_EXACT_OUTPUT_SWAP_METHOD = {
|
236025
|
+
...exports.ETH_EXACT_OUTPUT_REGULAR_SWAP_METHOD,
|
236026
|
+
...exports.ETH_EXACT_OUTPUT_SUPPORTING_FEE_SWAP_METHOD
|
236027
|
+
};
|
236028
|
+
exports.ETH_SWAP_METHOD = {
|
236029
|
+
input: exports.ETH_EXACT_INPUT_SWAP_METHOD,
|
236030
|
+
output: exports.ETH_EXACT_OUTPUT_SWAP_METHOD
|
236031
|
+
};
|
236032
|
+
|
236033
|
+
|
236034
|
+
/***/ }),
|
236035
|
+
|
236036
|
+
/***/ "./src/features/on-chain/calculation-manager/providers/dexes/common/uniswap-v2-abstract/constants/uniswap-v2-abi.ts":
|
236037
|
+
/*!**************************************************************************************************************************!*\
|
236038
|
+
!*** ./src/features/on-chain/calculation-manager/providers/dexes/common/uniswap-v2-abstract/constants/uniswap-v2-abi.ts ***!
|
236039
|
+
\**************************************************************************************************************************/
|
236040
|
+
/***/ ((__unused_webpack_module, exports) => {
|
236041
|
+
|
236042
|
+
"use strict";
|
236043
|
+
|
236044
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
236045
|
+
exports.defaultUniswapV2Abi = void 0;
|
236046
|
+
exports.defaultUniswapV2Abi = [
|
236047
|
+
{
|
236048
|
+
inputs: [],
|
236049
|
+
name: 'WETH',
|
236050
|
+
outputs: [
|
235889
236051
|
{
|
235890
236052
|
internalType: 'address',
|
235891
|
-
name: '
|
236053
|
+
name: '',
|
235892
236054
|
type: 'address'
|
235893
|
-
},
|
235894
|
-
{
|
235895
|
-
internalType: 'uint256',
|
235896
|
-
name: 'deadline',
|
235897
|
-
type: 'uint256'
|
235898
236055
|
}
|
235899
236056
|
],
|
235900
|
-
|
236057
|
+
stateMutability: 'view',
|
236058
|
+
type: 'function'
|
236059
|
+
},
|
236060
|
+
{
|
236061
|
+
inputs: [],
|
236062
|
+
name: 'factory',
|
235901
236063
|
outputs: [
|
235902
236064
|
{
|
235903
|
-
internalType: '
|
235904
|
-
name: '
|
235905
|
-
type: '
|
235906
|
-
},
|
235907
|
-
{
|
235908
|
-
internalType: 'uint256',
|
235909
|
-
name: 'amountB',
|
235910
|
-
type: 'uint256'
|
236065
|
+
internalType: 'address',
|
236066
|
+
name: '',
|
236067
|
+
type: 'address'
|
235911
236068
|
}
|
235912
236069
|
],
|
235913
|
-
stateMutability: '
|
236070
|
+
stateMutability: 'view',
|
235914
236071
|
type: 'function'
|
235915
236072
|
},
|
235916
236073
|
{
|
235917
236074
|
inputs: [
|
235918
|
-
{
|
235919
|
-
internalType: 'address',
|
235920
|
-
name: 'token',
|
235921
|
-
type: 'address'
|
235922
|
-
},
|
235923
|
-
{
|
235924
|
-
internalType: 'uint256',
|
235925
|
-
name: 'liquidity',
|
235926
|
-
type: 'uint256'
|
235927
|
-
},
|
235928
236075
|
{
|
235929
236076
|
internalType: 'uint256',
|
235930
|
-
name: '
|
236077
|
+
name: 'amountOut',
|
235931
236078
|
type: 'uint256'
|
235932
236079
|
},
|
235933
236080
|
{
|
235934
236081
|
internalType: 'uint256',
|
235935
|
-
name: '
|
236082
|
+
name: 'reserveIn',
|
235936
236083
|
type: 'uint256'
|
235937
236084
|
},
|
235938
|
-
{
|
235939
|
-
internalType: 'address',
|
235940
|
-
name: 'to',
|
235941
|
-
type: 'address'
|
235942
|
-
},
|
235943
236085
|
{
|
235944
236086
|
internalType: 'uint256',
|
235945
|
-
name: '
|
236087
|
+
name: 'reserveOut',
|
235946
236088
|
type: 'uint256'
|
235947
236089
|
}
|
235948
236090
|
],
|
235949
|
-
name: '
|
236091
|
+
name: 'getAmountIn',
|
235950
236092
|
outputs: [
|
235951
236093
|
{
|
235952
236094
|
internalType: 'uint256',
|
235953
|
-
name: '
|
235954
|
-
type: 'uint256'
|
235955
|
-
},
|
235956
|
-
{
|
235957
|
-
internalType: 'uint256',
|
235958
|
-
name: 'amountETH',
|
236095
|
+
name: 'amountIn',
|
235959
236096
|
type: 'uint256'
|
235960
236097
|
}
|
235961
236098
|
],
|
235962
|
-
stateMutability: '
|
236099
|
+
stateMutability: 'pure',
|
235963
236100
|
type: 'function'
|
235964
236101
|
},
|
235965
236102
|
{
|
235966
236103
|
inputs: [
|
235967
|
-
{
|
235968
|
-
internalType: 'address',
|
235969
|
-
name: 'token',
|
235970
|
-
type: 'address'
|
235971
|
-
},
|
235972
|
-
{
|
235973
|
-
internalType: 'uint256',
|
235974
|
-
name: 'liquidity',
|
235975
|
-
type: 'uint256'
|
235976
|
-
},
|
235977
236104
|
{
|
235978
236105
|
internalType: 'uint256',
|
235979
|
-
name: '
|
236106
|
+
name: 'amountIn',
|
235980
236107
|
type: 'uint256'
|
235981
236108
|
},
|
235982
236109
|
{
|
235983
236110
|
internalType: 'uint256',
|
235984
|
-
name: '
|
236111
|
+
name: 'reserveIn',
|
235985
236112
|
type: 'uint256'
|
235986
236113
|
},
|
235987
|
-
{
|
235988
|
-
internalType: 'address',
|
235989
|
-
name: 'to',
|
235990
|
-
type: 'address'
|
235991
|
-
},
|
235992
236114
|
{
|
235993
236115
|
internalType: 'uint256',
|
235994
|
-
name: '
|
236116
|
+
name: 'reserveOut',
|
235995
236117
|
type: 'uint256'
|
235996
236118
|
}
|
235997
236119
|
],
|
235998
|
-
name: '
|
236120
|
+
name: 'getAmountOut',
|
235999
236121
|
outputs: [
|
236000
236122
|
{
|
236001
236123
|
internalType: 'uint256',
|
236002
|
-
name: '
|
236124
|
+
name: 'amountOut',
|
236003
236125
|
type: 'uint256'
|
236004
236126
|
}
|
236005
236127
|
],
|
236006
|
-
stateMutability: '
|
236128
|
+
stateMutability: 'pure',
|
236007
236129
|
type: 'function'
|
236008
236130
|
},
|
236009
236131
|
{
|
236010
236132
|
inputs: [
|
236011
|
-
{
|
236012
|
-
internalType: 'address',
|
236013
|
-
name: 'token',
|
236014
|
-
type: 'address'
|
236015
|
-
},
|
236016
|
-
{
|
236017
|
-
internalType: 'uint256',
|
236018
|
-
name: 'liquidity',
|
236019
|
-
type: 'uint256'
|
236020
|
-
},
|
236021
236133
|
{
|
236022
236134
|
internalType: 'uint256',
|
236023
|
-
name: '
|
236024
|
-
type: 'uint256'
|
236025
|
-
},
|
236026
|
-
{
|
236027
|
-
internalType: 'uint256',
|
236028
|
-
name: 'amountETHMin',
|
236029
|
-
type: 'uint256'
|
236030
|
-
},
|
236031
|
-
{
|
236032
|
-
internalType: 'address',
|
236033
|
-
name: 'to',
|
236034
|
-
type: 'address'
|
236035
|
-
},
|
236036
|
-
{
|
236037
|
-
internalType: 'uint256',
|
236038
|
-
name: 'deadline',
|
236135
|
+
name: 'amountOut',
|
236039
236136
|
type: 'uint256'
|
236040
236137
|
},
|
236041
236138
|
{
|
236042
|
-
internalType: '
|
236043
|
-
name: '
|
236044
|
-
type: '
|
236045
|
-
},
|
236046
|
-
{
|
236047
|
-
internalType: 'uint8',
|
236048
|
-
name: 'v',
|
236049
|
-
type: 'uint8'
|
236050
|
-
},
|
236051
|
-
{
|
236052
|
-
internalType: 'bytes32',
|
236053
|
-
name: 'r',
|
236054
|
-
type: 'bytes32'
|
236055
|
-
},
|
236056
|
-
{
|
236057
|
-
internalType: 'bytes32',
|
236058
|
-
name: 's',
|
236059
|
-
type: 'bytes32'
|
236139
|
+
internalType: 'address[]',
|
236140
|
+
name: 'path',
|
236141
|
+
type: 'address[]'
|
236060
236142
|
}
|
236061
236143
|
],
|
236062
|
-
name: '
|
236144
|
+
name: 'getAmountsIn',
|
236063
236145
|
outputs: [
|
236064
236146
|
{
|
236065
|
-
internalType: 'uint256',
|
236066
|
-
name: '
|
236067
|
-
type: 'uint256'
|
236068
|
-
},
|
236069
|
-
{
|
236070
|
-
internalType: 'uint256',
|
236071
|
-
name: 'amountETH',
|
236072
|
-
type: 'uint256'
|
236147
|
+
internalType: 'uint256[]',
|
236148
|
+
name: 'amounts',
|
236149
|
+
type: 'uint256[]'
|
236073
236150
|
}
|
236074
236151
|
],
|
236075
|
-
stateMutability: '
|
236152
|
+
stateMutability: 'view',
|
236076
236153
|
type: 'function'
|
236077
236154
|
},
|
236078
236155
|
{
|
236079
236156
|
inputs: [
|
236080
|
-
{
|
236081
|
-
internalType: 'address',
|
236082
|
-
name: 'token',
|
236083
|
-
type: 'address'
|
236084
|
-
},
|
236085
|
-
{
|
236086
|
-
internalType: 'uint256',
|
236087
|
-
name: 'liquidity',
|
236088
|
-
type: 'uint256'
|
236089
|
-
},
|
236090
|
-
{
|
236091
|
-
internalType: 'uint256',
|
236092
|
-
name: 'amountTokenMin',
|
236093
|
-
type: 'uint256'
|
236094
|
-
},
|
236095
|
-
{
|
236096
|
-
internalType: 'uint256',
|
236097
|
-
name: 'amountETHMin',
|
236098
|
-
type: 'uint256'
|
236099
|
-
},
|
236100
|
-
{
|
236101
|
-
internalType: 'address',
|
236102
|
-
name: 'to',
|
236103
|
-
type: 'address'
|
236104
|
-
},
|
236105
236157
|
{
|
236106
236158
|
internalType: 'uint256',
|
236107
|
-
name: '
|
236159
|
+
name: 'amountIn',
|
236108
236160
|
type: 'uint256'
|
236109
236161
|
},
|
236110
236162
|
{
|
236111
|
-
internalType: '
|
236112
|
-
name: '
|
236113
|
-
type: '
|
236114
|
-
},
|
236115
|
-
{
|
236116
|
-
internalType: 'uint8',
|
236117
|
-
name: 'v',
|
236118
|
-
type: 'uint8'
|
236119
|
-
},
|
236120
|
-
{
|
236121
|
-
internalType: 'bytes32',
|
236122
|
-
name: 'r',
|
236123
|
-
type: 'bytes32'
|
236124
|
-
},
|
236125
|
-
{
|
236126
|
-
internalType: 'bytes32',
|
236127
|
-
name: 's',
|
236128
|
-
type: 'bytes32'
|
236163
|
+
internalType: 'address[]',
|
236164
|
+
name: 'path',
|
236165
|
+
type: 'address[]'
|
236129
236166
|
}
|
236130
236167
|
],
|
236131
|
-
name: '
|
236168
|
+
name: 'getAmountsOut',
|
236132
236169
|
outputs: [
|
236133
236170
|
{
|
236134
|
-
internalType: 'uint256',
|
236135
|
-
name: '
|
236136
|
-
type: 'uint256'
|
236171
|
+
internalType: 'uint256[]',
|
236172
|
+
name: 'amounts',
|
236173
|
+
type: 'uint256[]'
|
236137
236174
|
}
|
236138
236175
|
],
|
236139
|
-
stateMutability: '
|
236176
|
+
stateMutability: 'view',
|
236140
236177
|
type: 'function'
|
236141
236178
|
},
|
236142
236179
|
{
|
236143
236180
|
inputs: [
|
236144
|
-
{
|
236145
|
-
internalType: 'address',
|
236146
|
-
name: 'tokenA',
|
236147
|
-
type: 'address'
|
236148
|
-
},
|
236149
|
-
{
|
236150
|
-
internalType: 'address',
|
236151
|
-
name: 'tokenB',
|
236152
|
-
type: 'address'
|
236153
|
-
},
|
236154
|
-
{
|
236155
|
-
internalType: 'uint256',
|
236156
|
-
name: 'liquidity',
|
236157
|
-
type: 'uint256'
|
236158
|
-
},
|
236159
236181
|
{
|
236160
236182
|
internalType: 'uint256',
|
236161
|
-
name: '
|
236183
|
+
name: 'amountA',
|
236162
236184
|
type: 'uint256'
|
236163
236185
|
},
|
236164
236186
|
{
|
236165
236187
|
internalType: 'uint256',
|
236166
|
-
name: '
|
236188
|
+
name: 'reserveA',
|
236167
236189
|
type: 'uint256'
|
236168
236190
|
},
|
236169
|
-
{
|
236170
|
-
internalType: 'address',
|
236171
|
-
name: 'to',
|
236172
|
-
type: 'address'
|
236173
|
-
},
|
236174
236191
|
{
|
236175
236192
|
internalType: 'uint256',
|
236176
|
-
name: '
|
236193
|
+
name: 'reserveB',
|
236177
236194
|
type: 'uint256'
|
236178
|
-
},
|
236179
|
-
{
|
236180
|
-
internalType: 'bool',
|
236181
|
-
name: 'approveMax',
|
236182
|
-
type: 'bool'
|
236183
|
-
},
|
236184
|
-
{
|
236185
|
-
internalType: 'uint8',
|
236186
|
-
name: 'v',
|
236187
|
-
type: 'uint8'
|
236188
|
-
},
|
236189
|
-
{
|
236190
|
-
internalType: 'bytes32',
|
236191
|
-
name: 'r',
|
236192
|
-
type: 'bytes32'
|
236193
|
-
},
|
236194
|
-
{
|
236195
|
-
internalType: 'bytes32',
|
236196
|
-
name: 's',
|
236197
|
-
type: 'bytes32'
|
236198
236195
|
}
|
236199
236196
|
],
|
236200
|
-
name: '
|
236197
|
+
name: 'quote',
|
236201
236198
|
outputs: [
|
236202
|
-
{
|
236203
|
-
internalType: 'uint256',
|
236204
|
-
name: 'amountA',
|
236205
|
-
type: 'uint256'
|
236206
|
-
},
|
236207
236199
|
{
|
236208
236200
|
internalType: 'uint256',
|
236209
236201
|
name: 'amountB',
|
236210
236202
|
type: 'uint256'
|
236211
236203
|
}
|
236212
236204
|
],
|
236213
|
-
stateMutability: '
|
236205
|
+
stateMutability: 'pure',
|
236214
236206
|
type: 'function'
|
236215
236207
|
},
|
236216
236208
|
{
|
@@ -236530,14 +236522,23 @@ exports.defaultUniswapV2Abi = [
|
|
236530
236522
|
],
|
236531
236523
|
stateMutability: 'nonpayable',
|
236532
236524
|
type: 'function'
|
236533
|
-
},
|
236534
|
-
{
|
236535
|
-
stateMutability: 'payable',
|
236536
|
-
type: 'receive'
|
236537
236525
|
}
|
236538
236526
|
];
|
236539
236527
|
|
236540
236528
|
|
236529
|
+
/***/ }),
|
236530
|
+
|
236531
|
+
/***/ "./src/features/on-chain/calculation-manager/providers/dexes/common/uniswap-v2-abstract/models/aerodrome-route-method-arguments.ts":
|
236532
|
+
/*!*****************************************************************************************************************************************!*\
|
236533
|
+
!*** ./src/features/on-chain/calculation-manager/providers/dexes/common/uniswap-v2-abstract/models/aerodrome-route-method-arguments.ts ***!
|
236534
|
+
\*****************************************************************************************************************************************/
|
236535
|
+
/***/ ((__unused_webpack_module, exports) => {
|
236536
|
+
|
236537
|
+
"use strict";
|
236538
|
+
|
236539
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
236540
|
+
|
236541
|
+
|
236541
236542
|
/***/ }),
|
236542
236543
|
|
236543
236544
|
/***/ "./src/features/on-chain/calculation-manager/providers/dexes/common/uniswap-v2-abstract/models/default-estimated-gas.ts":
|
@@ -236551,6 +236552,19 @@ exports.defaultUniswapV2Abi = [
|
|
236551
236552
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
236552
236553
|
|
236553
236554
|
|
236555
|
+
/***/ }),
|
236556
|
+
|
236557
|
+
/***/ "./src/features/on-chain/calculation-manager/providers/dexes/common/uniswap-v2-abstract/models/route-method-arguments.ts":
|
236558
|
+
/*!*******************************************************************************************************************************!*\
|
236559
|
+
!*** ./src/features/on-chain/calculation-manager/providers/dexes/common/uniswap-v2-abstract/models/route-method-arguments.ts ***!
|
236560
|
+
\*******************************************************************************************************************************/
|
236561
|
+
/***/ ((__unused_webpack_module, exports) => {
|
236562
|
+
|
236563
|
+
"use strict";
|
236564
|
+
|
236565
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
236566
|
+
|
236567
|
+
|
236554
236568
|
/***/ }),
|
236555
236569
|
|
236556
236570
|
/***/ "./src/features/on-chain/calculation-manager/providers/dexes/common/uniswap-v2-abstract/models/uniswap-calculated-info.ts":
|
@@ -236774,6 +236788,7 @@ class PathFactory {
|
|
236774
236788
|
from,
|
236775
236789
|
to,
|
236776
236790
|
path: route.path,
|
236791
|
+
routPoolInfo: route?.routPoolInfo,
|
236777
236792
|
wrappedPath: route.path,
|
236778
236793
|
exact: this.exact,
|
236779
236794
|
deadlineMinutes: this.options.deadlineMinutes,
|
@@ -236924,12 +236939,14 @@ class UniswapV2AbstractProvider extends evm_on_chain_provider_1.EvmOnChainProvid
|
|
236924
236939
|
const { route, estimatedGas } = await this.getAmountAndPath(fromProxy, toProxy, weiAmountWithoutFee, exact, fullOptions, proxyFeeInfo, gasPriceInfo?.gasPriceInUsd);
|
236925
236940
|
const { from, to, fromWithoutFee } = (0, get_from_to_tokens_amounts_by_exact_1.getFromToTokensAmountsByExact)(fromToken, toToken, exact, weiAmount, weiAmountWithoutFee, route.outputAbsoluteAmount);
|
236926
236941
|
const wrappedPath = route.path;
|
236942
|
+
const routPoolInfo = route?.routPoolInfo;
|
236927
236943
|
const path = (0, token_native_address_proxy_1.createTokenNativeAddressProxyInPathStartAndEnd)(wrappedPath, evm_web3_pure_1.EvmWeb3Pure.nativeTokenAddress);
|
236928
236944
|
const tradeStruct = {
|
236929
236945
|
from,
|
236930
236946
|
to,
|
236931
236947
|
exact,
|
236932
236948
|
path,
|
236949
|
+
routPoolInfo,
|
236933
236950
|
wrappedPath,
|
236934
236951
|
deadlineMinutes: fullOptions.deadlineMinutes,
|
236935
236952
|
slippageTolerance: fullOptions.slippageTolerance,
|
@@ -237048,6 +237065,7 @@ class UniswapV2AbstractTrade extends evm_on_chain_trade_1.EvmOnChainTrade {
|
|
237048
237065
|
this.deadlineMinutes = tradeStruct.deadlineMinutes;
|
237049
237066
|
this.exact = tradeStruct.exact;
|
237050
237067
|
this.wrappedPath = tradeStruct.wrappedPath;
|
237068
|
+
this.routPoolInfo = tradeStruct.routPoolInfo;
|
237051
237069
|
}
|
237052
237070
|
getAmountInAndAmountOut() {
|
237053
237071
|
let amountIn = this.fromWithoutFee.stringWeiAmount;
|
@@ -249649,6 +249667,11 @@ __exportStar(__webpack_require__(/*! ./features/on-chain/calculation-manager/pro
|
|
249649
249667
|
__exportStar(__webpack_require__(/*! ./features/on-chain/calculation-manager/providers/dexes/avalanche/sushi-swap-avalanche/sushi-swap-avalanche-trade */ "./src/features/on-chain/calculation-manager/providers/dexes/avalanche/sushi-swap-avalanche/sushi-swap-avalanche-trade.ts"), exports);
|
249650
249668
|
__exportStar(__webpack_require__(/*! ./features/on-chain/calculation-manager/providers/dexes/avalanche/swap-methods */ "./src/features/on-chain/calculation-manager/providers/dexes/avalanche/swap-methods.ts"), exports);
|
249651
249669
|
__exportStar(__webpack_require__(/*! ./features/on-chain/calculation-manager/providers/dexes/avalanche/xy-dex-avalanche/xy-dex-avalanche-provider */ "./src/features/on-chain/calculation-manager/providers/dexes/avalanche/xy-dex-avalanche/xy-dex-avalanche-provider.ts"), exports);
|
249670
|
+
__exportStar(__webpack_require__(/*! ./features/on-chain/calculation-manager/providers/dexes/base/aerodrome/aerodrome-abi */ "./src/features/on-chain/calculation-manager/providers/dexes/base/aerodrome/aerodrome-abi.ts"), exports);
|
249671
|
+
__exportStar(__webpack_require__(/*! ./features/on-chain/calculation-manager/providers/dexes/base/aerodrome/aerodrome-path-factory */ "./src/features/on-chain/calculation-manager/providers/dexes/base/aerodrome/aerodrome-path-factory.ts"), exports);
|
249672
|
+
__exportStar(__webpack_require__(/*! ./features/on-chain/calculation-manager/providers/dexes/base/aerodrome/aerodrome-provider */ "./src/features/on-chain/calculation-manager/providers/dexes/base/aerodrome/aerodrome-provider.ts"), exports);
|
249673
|
+
__exportStar(__webpack_require__(/*! ./features/on-chain/calculation-manager/providers/dexes/base/aerodrome/aerodrome-trade */ "./src/features/on-chain/calculation-manager/providers/dexes/base/aerodrome/aerodrome-trade.ts"), exports);
|
249674
|
+
__exportStar(__webpack_require__(/*! ./features/on-chain/calculation-manager/providers/dexes/base/aerodrome/constants */ "./src/features/on-chain/calculation-manager/providers/dexes/base/aerodrome/constants.ts"), exports);
|
249652
249675
|
__exportStar(__webpack_require__(/*! ./features/on-chain/calculation-manager/providers/dexes/base/base-swap/base-swap-provider */ "./src/features/on-chain/calculation-manager/providers/dexes/base/base-swap/base-swap-provider.ts"), exports);
|
249653
249676
|
__exportStar(__webpack_require__(/*! ./features/on-chain/calculation-manager/providers/dexes/base/base-swap/base-swap-trade */ "./src/features/on-chain/calculation-manager/providers/dexes/base/base-swap/base-swap-trade.ts"), exports);
|
249654
249677
|
__exportStar(__webpack_require__(/*! ./features/on-chain/calculation-manager/providers/dexes/base/base-swap/constants */ "./src/features/on-chain/calculation-manager/providers/dexes/base/base-swap/constants.ts"), exports);
|
@@ -249732,7 +249755,9 @@ __exportStar(__webpack_require__(/*! ./features/on-chain/calculation-manager/pro
|
|
249732
249755
|
__exportStar(__webpack_require__(/*! ./features/on-chain/calculation-manager/providers/dexes/common/uniswap-v2-abstract/constants/dex-trader/dex-trader-abi */ "./src/features/on-chain/calculation-manager/providers/dexes/common/uniswap-v2-abstract/constants/dex-trader/dex-trader-abi.ts"), exports);
|
249733
249756
|
__exportStar(__webpack_require__(/*! ./features/on-chain/calculation-manager/providers/dexes/common/uniswap-v2-abstract/constants/dex-trader/dex-trader-swap-method */ "./src/features/on-chain/calculation-manager/providers/dexes/common/uniswap-v2-abstract/constants/dex-trader/dex-trader-swap-method.ts"), exports);
|
249734
249757
|
__exportStar(__webpack_require__(/*! ./features/on-chain/calculation-manager/providers/dexes/common/uniswap-v2-abstract/constants/uniswap-v2-abi */ "./src/features/on-chain/calculation-manager/providers/dexes/common/uniswap-v2-abstract/constants/uniswap-v2-abi.ts"), exports);
|
249758
|
+
__exportStar(__webpack_require__(/*! ./features/on-chain/calculation-manager/providers/dexes/common/uniswap-v2-abstract/models/aerodrome-route-method-arguments */ "./src/features/on-chain/calculation-manager/providers/dexes/common/uniswap-v2-abstract/models/aerodrome-route-method-arguments.ts"), exports);
|
249735
249759
|
__exportStar(__webpack_require__(/*! ./features/on-chain/calculation-manager/providers/dexes/common/uniswap-v2-abstract/models/default-estimated-gas */ "./src/features/on-chain/calculation-manager/providers/dexes/common/uniswap-v2-abstract/models/default-estimated-gas.ts"), exports);
|
249760
|
+
__exportStar(__webpack_require__(/*! ./features/on-chain/calculation-manager/providers/dexes/common/uniswap-v2-abstract/models/route-method-arguments */ "./src/features/on-chain/calculation-manager/providers/dexes/common/uniswap-v2-abstract/models/route-method-arguments.ts"), exports);
|
249736
249761
|
__exportStar(__webpack_require__(/*! ./features/on-chain/calculation-manager/providers/dexes/common/uniswap-v2-abstract/models/uniswap-calculated-info */ "./src/features/on-chain/calculation-manager/providers/dexes/common/uniswap-v2-abstract/models/uniswap-calculated-info.ts"), exports);
|
249737
249762
|
__exportStar(__webpack_require__(/*! ./features/on-chain/calculation-manager/providers/dexes/common/uniswap-v2-abstract/models/uniswap-route */ "./src/features/on-chain/calculation-manager/providers/dexes/common/uniswap-v2-abstract/models/uniswap-route.ts"), exports);
|
249738
249763
|
__exportStar(__webpack_require__(/*! ./features/on-chain/calculation-manager/providers/dexes/common/uniswap-v2-abstract/models/uniswap-v2-calculation-options */ "./src/features/on-chain/calculation-manager/providers/dexes/common/uniswap-v2-abstract/models/uniswap-v2-calculation-options.ts"), exports);
|