@dhedge/v2-sdk 1.10.3 → 1.10.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -0
- package/dist/entities/pool.d.ts +32 -2
- package/dist/services/compound/lending.d.ts +3 -0
- package/dist/services/ramses/vesting.d.ts +1 -0
- package/dist/services/uniswap/V3Liquidity.d.ts +2 -2
- package/dist/test/constants.d.ts +4 -0
- package/dist/types.d.ts +2 -1
- package/dist/v2-sdk.cjs.development.js +1158 -447
- package/dist/v2-sdk.cjs.development.js.map +1 -1
- package/dist/v2-sdk.cjs.production.min.js +1 -1
- package/dist/v2-sdk.cjs.production.min.js.map +1 -1
- package/dist/v2-sdk.esm.js +1158 -447
- package/dist/v2-sdk.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/abi/IRamsesNonfungiblePositionManager.json +486 -0
- package/src/abi/compound/ICompoundV3Comet.json +51 -0
- package/src/config.ts +2 -1
- package/src/entities/pool.ts +93 -3
- package/src/services/compound/lending.ts +20 -0
- package/src/services/ramses/vesting.ts +11 -0
- package/src/services/uniswap/V3Liquidity.ts +14 -4
- package/src/test/compoundV3.test.ts +90 -0
- package/src/test/constants.ts +9 -5
- package/src/test/ramsesCL.test.ts +155 -0
- package/src/types.ts +2 -1
|
@@ -4219,6 +4219,7 @@ var ManagerLogic = {
|
|
|
4219
4219
|
Dapp["RAMSES"] = "ramses";
|
|
4220
4220
|
Dapp["AERODROME"] = "aerodrome";
|
|
4221
4221
|
Dapp["AERODROMECL"] = "aerodromeCL";
|
|
4222
|
+
Dapp["RAMSESCL"] = "ramsesCL";
|
|
4222
4223
|
})(exports.Dapp || (exports.Dapp = {}));
|
|
4223
4224
|
|
|
4224
4225
|
(function (Transaction) {
|
|
@@ -4252,7 +4253,7 @@ var routerAddress = (_routerAddress = {}, _routerAddress[exports.Network.POLYGON
|
|
|
4252
4253
|
var dappFactoryAddress = (_dappFactoryAddress = {}, _dappFactoryAddress[exports.Network.POLYGON] = (_Network$POLYGON2 = {}, _Network$POLYGON2[exports.Dapp.SUSHISWAP] = "0xc35DADB65012eC5796536bD9864eD8773aBc74C4", _Network$POLYGON2[exports.Dapp.QUICKSWAP] = "0x5757371414417b8C6CAad45bAeF941aBc7d3Ab32", _Network$POLYGON2), _dappFactoryAddress[exports.Network.OPTIMISM] = {}, _dappFactoryAddress[exports.Network.ARBITRUM] = {}, _dappFactoryAddress[exports.Network.BASE] = {}, _dappFactoryAddress);
|
|
4253
4254
|
var stakingAddress = (_stakingAddress = {}, _stakingAddress[exports.Network.POLYGON] = (_Network$POLYGON3 = {}, _Network$POLYGON3[exports.Dapp.SUSHISWAP] = "0x0769fd68dFb93167989C6f7254cd0D766Fb2841F", _Network$POLYGON3[exports.Dapp.BALANCER] = "0x0F3e0c4218b7b0108a3643cFe9D3ec0d4F57c54e", _Network$POLYGON3[exports.Dapp.AAVE] = "0x357D51124f59836DeD84c8a1730D72B749d8BC23", _Network$POLYGON3[exports.Dapp.AAVEV3] = "0x929EC64c34a17401F460460D4B9390518E5B473e", _Network$POLYGON3), _stakingAddress[exports.Network.OPTIMISM] = (_Network$OPTIMISM2 = {}, _Network$OPTIMISM2[exports.Dapp.AAVEV3] = "0x929EC64c34a17401F460460D4B9390518E5B473e", _Network$OPTIMISM2), _stakingAddress[exports.Network.ARBITRUM] = {}, _stakingAddress[exports.Network.BASE] = {}, _stakingAddress);
|
|
4254
4255
|
var aaveAddressProvider = (_aaveAddressProvider = {}, _aaveAddressProvider[exports.Network.POLYGON] = (_Network$POLYGON4 = {}, _Network$POLYGON4[exports.Dapp.AAVE] = "0xd05e3E715d945B59290df0ae8eF85c1BdB684744", _Network$POLYGON4[exports.Dapp.AAVEV3] = "0xa97684ead0e402dC232d5A977953DF7ECBaB3CDb", _Network$POLYGON4), _aaveAddressProvider[exports.Network.OPTIMISM] = (_Network$OPTIMISM3 = {}, _Network$OPTIMISM3[exports.Dapp.AAVEV3] = "0xa97684ead0e402dC232d5A977953DF7ECBaB3CDb", _Network$OPTIMISM3), _aaveAddressProvider[exports.Network.ARBITRUM] = (_Network$ARBITRUM2 = {}, _Network$ARBITRUM2[exports.Dapp.AAVEV3] = "0xa97684ead0e402dc232d5a977953df7ecbab3cdb", _Network$ARBITRUM2), _aaveAddressProvider[exports.Network.BASE] = (_Network$BASE2 = {}, _Network$BASE2[exports.Dapp.AAVEV3] = "0xe20fCBdBfFC4Dd138cE8b2E6FBb6CB49777ad64D", _Network$BASE2), _aaveAddressProvider);
|
|
4255
|
-
var nonfungiblePositionManagerAddress = (_nonfungiblePositionM = {}, _nonfungiblePositionM[exports.Network.POLYGON] = (_Network$POLYGON5 = {}, _Network$POLYGON5[exports.Dapp.UNISWAPV3] = "0xC36442b4a4522E871399CD717aBDD847Ab11FE88", _Network$POLYGON5), _nonfungiblePositionM[exports.Network.OPTIMISM] = (_Network$OPTIMISM4 = {}, _Network$OPTIMISM4[exports.Dapp.UNISWAPV3] = "0xC36442b4a4522E871399CD717aBDD847Ab11FE88", _Network$OPTIMISM4[exports.Dapp.VELODROMECL] = "0x416b433906b1B72FA758e166e239c43d68dC6F29", _Network$OPTIMISM4), _nonfungiblePositionM[exports.Network.ARBITRUM] = (_Network$ARBITRUM3 = {}, _Network$ARBITRUM3[exports.Dapp.UNISWAPV3] = "0xC36442b4a4522E871399CD717aBDD847Ab11FE88", _Network$ARBITRUM3), _nonfungiblePositionM[exports.Network.BASE] = (_Network$BASE3 = {}, _Network$BASE3[exports.Dapp.UNISWAPV3] = "0x03a520b32C04BF3bEEf7BEb72E919cf822Ed34f1", _Network$BASE3[exports.Dapp.AERODROMECL] = "0x827922686190790b37229fd06084350e74485b72", _Network$BASE3), _nonfungiblePositionM);
|
|
4256
|
+
var nonfungiblePositionManagerAddress = (_nonfungiblePositionM = {}, _nonfungiblePositionM[exports.Network.POLYGON] = (_Network$POLYGON5 = {}, _Network$POLYGON5[exports.Dapp.UNISWAPV3] = "0xC36442b4a4522E871399CD717aBDD847Ab11FE88", _Network$POLYGON5), _nonfungiblePositionM[exports.Network.OPTIMISM] = (_Network$OPTIMISM4 = {}, _Network$OPTIMISM4[exports.Dapp.UNISWAPV3] = "0xC36442b4a4522E871399CD717aBDD847Ab11FE88", _Network$OPTIMISM4[exports.Dapp.VELODROMECL] = "0x416b433906b1B72FA758e166e239c43d68dC6F29", _Network$OPTIMISM4), _nonfungiblePositionM[exports.Network.ARBITRUM] = (_Network$ARBITRUM3 = {}, _Network$ARBITRUM3[exports.Dapp.UNISWAPV3] = "0xC36442b4a4522E871399CD717aBDD847Ab11FE88", _Network$ARBITRUM3[exports.Dapp.RAMSESCL] = "0xAA277CB7914b7e5514946Da92cb9De332Ce610EF", _Network$ARBITRUM3), _nonfungiblePositionM[exports.Network.BASE] = (_Network$BASE3 = {}, _Network$BASE3[exports.Dapp.UNISWAPV3] = "0x03a520b32C04BF3bEEf7BEb72E919cf822Ed34f1", _Network$BASE3[exports.Dapp.AERODROMECL] = "0x827922686190790b37229fd06084350e74485b72", _Network$BASE3), _nonfungiblePositionM);
|
|
4256
4257
|
var networkChainIdMap = (_networkChainIdMap = {}, _networkChainIdMap[exports.Network.POLYGON] = 137, _networkChainIdMap[exports.Network.OPTIMISM] = 10, _networkChainIdMap[exports.Network.ARBITRUM] = 42161, _networkChainIdMap[exports.Network.BASE] = 8453, _networkChainIdMap);
|
|
4257
4258
|
var balancerSubgraph = (_balancerSubgraph = {}, _balancerSubgraph[exports.Network.POLYGON] = "https://api.thegraph.com/subgraphs/name/balancer-labs/balancer-polygon-v2", _balancerSubgraph[exports.Network.OPTIMISM] = "", _balancerSubgraph[exports.Network.ARBITRUM] = "", _balancerSubgraph[exports.Network.BASE] = "", _balancerSubgraph);
|
|
4258
4259
|
var multiCallAddress = (_multiCallAddress = {}, _multiCallAddress[exports.Network.POLYGON] = "0x275617327c958bD06b5D6b871E7f491D76113dd8", _multiCallAddress[exports.Network.OPTIMISM] = "", _multiCallAddress[exports.Network.ARBITRUM] = "", _multiCallAddress[exports.Network.BASE] = "", _multiCallAddress);
|
|
@@ -8644,6 +8645,496 @@ var IVeldodromePositionManager = {
|
|
|
8644
8645
|
abi: abi$d
|
|
8645
8646
|
};
|
|
8646
8647
|
|
|
8648
|
+
var IRamsesNonfungiblePositionManager = [
|
|
8649
|
+
{
|
|
8650
|
+
anonymous: false,
|
|
8651
|
+
inputs: [
|
|
8652
|
+
{
|
|
8653
|
+
indexed: true,
|
|
8654
|
+
internalType: "uint256",
|
|
8655
|
+
name: "tokenId",
|
|
8656
|
+
type: "uint256"
|
|
8657
|
+
},
|
|
8658
|
+
{
|
|
8659
|
+
indexed: false,
|
|
8660
|
+
internalType: "address",
|
|
8661
|
+
name: "recipient",
|
|
8662
|
+
type: "address"
|
|
8663
|
+
},
|
|
8664
|
+
{
|
|
8665
|
+
indexed: false,
|
|
8666
|
+
internalType: "uint256",
|
|
8667
|
+
name: "amount0",
|
|
8668
|
+
type: "uint256"
|
|
8669
|
+
},
|
|
8670
|
+
{
|
|
8671
|
+
indexed: false,
|
|
8672
|
+
internalType: "uint256",
|
|
8673
|
+
name: "amount1",
|
|
8674
|
+
type: "uint256"
|
|
8675
|
+
}
|
|
8676
|
+
],
|
|
8677
|
+
name: "Collect",
|
|
8678
|
+
type: "event"
|
|
8679
|
+
},
|
|
8680
|
+
{
|
|
8681
|
+
anonymous: false,
|
|
8682
|
+
inputs: [
|
|
8683
|
+
{
|
|
8684
|
+
indexed: true,
|
|
8685
|
+
internalType: "uint256",
|
|
8686
|
+
name: "tokenId",
|
|
8687
|
+
type: "uint256"
|
|
8688
|
+
},
|
|
8689
|
+
{
|
|
8690
|
+
indexed: false,
|
|
8691
|
+
internalType: "uint128",
|
|
8692
|
+
name: "liquidity",
|
|
8693
|
+
type: "uint128"
|
|
8694
|
+
},
|
|
8695
|
+
{
|
|
8696
|
+
indexed: false,
|
|
8697
|
+
internalType: "uint256",
|
|
8698
|
+
name: "amount0",
|
|
8699
|
+
type: "uint256"
|
|
8700
|
+
},
|
|
8701
|
+
{
|
|
8702
|
+
indexed: false,
|
|
8703
|
+
internalType: "uint256",
|
|
8704
|
+
name: "amount1",
|
|
8705
|
+
type: "uint256"
|
|
8706
|
+
}
|
|
8707
|
+
],
|
|
8708
|
+
name: "DecreaseLiquidity",
|
|
8709
|
+
type: "event"
|
|
8710
|
+
},
|
|
8711
|
+
{
|
|
8712
|
+
anonymous: false,
|
|
8713
|
+
inputs: [
|
|
8714
|
+
{
|
|
8715
|
+
indexed: true,
|
|
8716
|
+
internalType: "uint256",
|
|
8717
|
+
name: "tokenId",
|
|
8718
|
+
type: "uint256"
|
|
8719
|
+
},
|
|
8720
|
+
{
|
|
8721
|
+
indexed: false,
|
|
8722
|
+
internalType: "uint128",
|
|
8723
|
+
name: "liquidity",
|
|
8724
|
+
type: "uint128"
|
|
8725
|
+
},
|
|
8726
|
+
{
|
|
8727
|
+
indexed: false,
|
|
8728
|
+
internalType: "uint256",
|
|
8729
|
+
name: "amount0",
|
|
8730
|
+
type: "uint256"
|
|
8731
|
+
},
|
|
8732
|
+
{
|
|
8733
|
+
indexed: false,
|
|
8734
|
+
internalType: "uint256",
|
|
8735
|
+
name: "amount1",
|
|
8736
|
+
type: "uint256"
|
|
8737
|
+
}
|
|
8738
|
+
],
|
|
8739
|
+
name: "IncreaseLiquidity",
|
|
8740
|
+
type: "event"
|
|
8741
|
+
},
|
|
8742
|
+
{
|
|
8743
|
+
inputs: [
|
|
8744
|
+
{
|
|
8745
|
+
internalType: "uint256",
|
|
8746
|
+
name: "tokenId",
|
|
8747
|
+
type: "uint256"
|
|
8748
|
+
}
|
|
8749
|
+
],
|
|
8750
|
+
name: "burn",
|
|
8751
|
+
outputs: [
|
|
8752
|
+
],
|
|
8753
|
+
stateMutability: "payable",
|
|
8754
|
+
type: "function"
|
|
8755
|
+
},
|
|
8756
|
+
{
|
|
8757
|
+
inputs: [
|
|
8758
|
+
{
|
|
8759
|
+
components: [
|
|
8760
|
+
{
|
|
8761
|
+
internalType: "uint256",
|
|
8762
|
+
name: "tokenId",
|
|
8763
|
+
type: "uint256"
|
|
8764
|
+
},
|
|
8765
|
+
{
|
|
8766
|
+
internalType: "address",
|
|
8767
|
+
name: "recipient",
|
|
8768
|
+
type: "address"
|
|
8769
|
+
},
|
|
8770
|
+
{
|
|
8771
|
+
internalType: "uint128",
|
|
8772
|
+
name: "amount0Max",
|
|
8773
|
+
type: "uint128"
|
|
8774
|
+
},
|
|
8775
|
+
{
|
|
8776
|
+
internalType: "uint128",
|
|
8777
|
+
name: "amount1Max",
|
|
8778
|
+
type: "uint128"
|
|
8779
|
+
}
|
|
8780
|
+
],
|
|
8781
|
+
internalType: "struct IRamsesNonfungiblePositionManager.CollectParams",
|
|
8782
|
+
name: "params",
|
|
8783
|
+
type: "tuple"
|
|
8784
|
+
}
|
|
8785
|
+
],
|
|
8786
|
+
name: "collect",
|
|
8787
|
+
outputs: [
|
|
8788
|
+
{
|
|
8789
|
+
internalType: "uint256",
|
|
8790
|
+
name: "amount0",
|
|
8791
|
+
type: "uint256"
|
|
8792
|
+
},
|
|
8793
|
+
{
|
|
8794
|
+
internalType: "uint256",
|
|
8795
|
+
name: "amount1",
|
|
8796
|
+
type: "uint256"
|
|
8797
|
+
}
|
|
8798
|
+
],
|
|
8799
|
+
stateMutability: "payable",
|
|
8800
|
+
type: "function"
|
|
8801
|
+
},
|
|
8802
|
+
{
|
|
8803
|
+
inputs: [
|
|
8804
|
+
{
|
|
8805
|
+
components: [
|
|
8806
|
+
{
|
|
8807
|
+
internalType: "uint256",
|
|
8808
|
+
name: "tokenId",
|
|
8809
|
+
type: "uint256"
|
|
8810
|
+
},
|
|
8811
|
+
{
|
|
8812
|
+
internalType: "uint128",
|
|
8813
|
+
name: "liquidity",
|
|
8814
|
+
type: "uint128"
|
|
8815
|
+
},
|
|
8816
|
+
{
|
|
8817
|
+
internalType: "uint256",
|
|
8818
|
+
name: "amount0Min",
|
|
8819
|
+
type: "uint256"
|
|
8820
|
+
},
|
|
8821
|
+
{
|
|
8822
|
+
internalType: "uint256",
|
|
8823
|
+
name: "amount1Min",
|
|
8824
|
+
type: "uint256"
|
|
8825
|
+
},
|
|
8826
|
+
{
|
|
8827
|
+
internalType: "uint256",
|
|
8828
|
+
name: "deadline",
|
|
8829
|
+
type: "uint256"
|
|
8830
|
+
}
|
|
8831
|
+
],
|
|
8832
|
+
internalType: "struct IRamsesNonfungiblePositionManager.DecreaseLiquidityParams",
|
|
8833
|
+
name: "params",
|
|
8834
|
+
type: "tuple"
|
|
8835
|
+
}
|
|
8836
|
+
],
|
|
8837
|
+
name: "decreaseLiquidity",
|
|
8838
|
+
outputs: [
|
|
8839
|
+
{
|
|
8840
|
+
internalType: "uint256",
|
|
8841
|
+
name: "amount0",
|
|
8842
|
+
type: "uint256"
|
|
8843
|
+
},
|
|
8844
|
+
{
|
|
8845
|
+
internalType: "uint256",
|
|
8846
|
+
name: "amount1",
|
|
8847
|
+
type: "uint256"
|
|
8848
|
+
}
|
|
8849
|
+
],
|
|
8850
|
+
stateMutability: "payable",
|
|
8851
|
+
type: "function"
|
|
8852
|
+
},
|
|
8853
|
+
{
|
|
8854
|
+
inputs: [
|
|
8855
|
+
],
|
|
8856
|
+
name: "factory",
|
|
8857
|
+
outputs: [
|
|
8858
|
+
{
|
|
8859
|
+
internalType: "address",
|
|
8860
|
+
name: "",
|
|
8861
|
+
type: "address"
|
|
8862
|
+
}
|
|
8863
|
+
],
|
|
8864
|
+
stateMutability: "view",
|
|
8865
|
+
type: "function"
|
|
8866
|
+
},
|
|
8867
|
+
{
|
|
8868
|
+
inputs: [
|
|
8869
|
+
{
|
|
8870
|
+
internalType: "uint256",
|
|
8871
|
+
name: "tokenId",
|
|
8872
|
+
type: "uint256"
|
|
8873
|
+
},
|
|
8874
|
+
{
|
|
8875
|
+
internalType: "address[]",
|
|
8876
|
+
name: "tokens",
|
|
8877
|
+
type: "address[]"
|
|
8878
|
+
}
|
|
8879
|
+
],
|
|
8880
|
+
name: "getReward",
|
|
8881
|
+
outputs: [
|
|
8882
|
+
],
|
|
8883
|
+
stateMutability: "nonpayable",
|
|
8884
|
+
type: "function"
|
|
8885
|
+
},
|
|
8886
|
+
{
|
|
8887
|
+
inputs: [
|
|
8888
|
+
{
|
|
8889
|
+
components: [
|
|
8890
|
+
{
|
|
8891
|
+
internalType: "uint256",
|
|
8892
|
+
name: "tokenId",
|
|
8893
|
+
type: "uint256"
|
|
8894
|
+
},
|
|
8895
|
+
{
|
|
8896
|
+
internalType: "uint256",
|
|
8897
|
+
name: "amount0Desired",
|
|
8898
|
+
type: "uint256"
|
|
8899
|
+
},
|
|
8900
|
+
{
|
|
8901
|
+
internalType: "uint256",
|
|
8902
|
+
name: "amount1Desired",
|
|
8903
|
+
type: "uint256"
|
|
8904
|
+
},
|
|
8905
|
+
{
|
|
8906
|
+
internalType: "uint256",
|
|
8907
|
+
name: "amount0Min",
|
|
8908
|
+
type: "uint256"
|
|
8909
|
+
},
|
|
8910
|
+
{
|
|
8911
|
+
internalType: "uint256",
|
|
8912
|
+
name: "amount1Min",
|
|
8913
|
+
type: "uint256"
|
|
8914
|
+
},
|
|
8915
|
+
{
|
|
8916
|
+
internalType: "uint256",
|
|
8917
|
+
name: "deadline",
|
|
8918
|
+
type: "uint256"
|
|
8919
|
+
}
|
|
8920
|
+
],
|
|
8921
|
+
internalType: "struct IRamsesNonfungiblePositionManager.IncreaseLiquidityParams",
|
|
8922
|
+
name: "params",
|
|
8923
|
+
type: "tuple"
|
|
8924
|
+
}
|
|
8925
|
+
],
|
|
8926
|
+
name: "increaseLiquidity",
|
|
8927
|
+
outputs: [
|
|
8928
|
+
{
|
|
8929
|
+
internalType: "uint128",
|
|
8930
|
+
name: "liquidity",
|
|
8931
|
+
type: "uint128"
|
|
8932
|
+
},
|
|
8933
|
+
{
|
|
8934
|
+
internalType: "uint256",
|
|
8935
|
+
name: "amount0",
|
|
8936
|
+
type: "uint256"
|
|
8937
|
+
},
|
|
8938
|
+
{
|
|
8939
|
+
internalType: "uint256",
|
|
8940
|
+
name: "amount1",
|
|
8941
|
+
type: "uint256"
|
|
8942
|
+
}
|
|
8943
|
+
],
|
|
8944
|
+
stateMutability: "payable",
|
|
8945
|
+
type: "function"
|
|
8946
|
+
},
|
|
8947
|
+
{
|
|
8948
|
+
inputs: [
|
|
8949
|
+
{
|
|
8950
|
+
components: [
|
|
8951
|
+
{
|
|
8952
|
+
internalType: "address",
|
|
8953
|
+
name: "token0",
|
|
8954
|
+
type: "address"
|
|
8955
|
+
},
|
|
8956
|
+
{
|
|
8957
|
+
internalType: "address",
|
|
8958
|
+
name: "token1",
|
|
8959
|
+
type: "address"
|
|
8960
|
+
},
|
|
8961
|
+
{
|
|
8962
|
+
internalType: "uint24",
|
|
8963
|
+
name: "fee",
|
|
8964
|
+
type: "uint24"
|
|
8965
|
+
},
|
|
8966
|
+
{
|
|
8967
|
+
internalType: "int24",
|
|
8968
|
+
name: "tickLower",
|
|
8969
|
+
type: "int24"
|
|
8970
|
+
},
|
|
8971
|
+
{
|
|
8972
|
+
internalType: "int24",
|
|
8973
|
+
name: "tickUpper",
|
|
8974
|
+
type: "int24"
|
|
8975
|
+
},
|
|
8976
|
+
{
|
|
8977
|
+
internalType: "uint256",
|
|
8978
|
+
name: "amount0Desired",
|
|
8979
|
+
type: "uint256"
|
|
8980
|
+
},
|
|
8981
|
+
{
|
|
8982
|
+
internalType: "uint256",
|
|
8983
|
+
name: "amount1Desired",
|
|
8984
|
+
type: "uint256"
|
|
8985
|
+
},
|
|
8986
|
+
{
|
|
8987
|
+
internalType: "uint256",
|
|
8988
|
+
name: "amount0Min",
|
|
8989
|
+
type: "uint256"
|
|
8990
|
+
},
|
|
8991
|
+
{
|
|
8992
|
+
internalType: "uint256",
|
|
8993
|
+
name: "amount1Min",
|
|
8994
|
+
type: "uint256"
|
|
8995
|
+
},
|
|
8996
|
+
{
|
|
8997
|
+
internalType: "address",
|
|
8998
|
+
name: "recipient",
|
|
8999
|
+
type: "address"
|
|
9000
|
+
},
|
|
9001
|
+
{
|
|
9002
|
+
internalType: "uint256",
|
|
9003
|
+
name: "deadline",
|
|
9004
|
+
type: "uint256"
|
|
9005
|
+
},
|
|
9006
|
+
{
|
|
9007
|
+
internalType: "uint256",
|
|
9008
|
+
name: "veRamTokenId",
|
|
9009
|
+
type: "uint256"
|
|
9010
|
+
}
|
|
9011
|
+
],
|
|
9012
|
+
internalType: "struct IRamsesNonfungiblePositionManager.MintParams",
|
|
9013
|
+
name: "params",
|
|
9014
|
+
type: "tuple"
|
|
9015
|
+
}
|
|
9016
|
+
],
|
|
9017
|
+
name: "mint",
|
|
9018
|
+
outputs: [
|
|
9019
|
+
{
|
|
9020
|
+
internalType: "uint256",
|
|
9021
|
+
name: "tokenId",
|
|
9022
|
+
type: "uint256"
|
|
9023
|
+
},
|
|
9024
|
+
{
|
|
9025
|
+
internalType: "uint128",
|
|
9026
|
+
name: "liquidity",
|
|
9027
|
+
type: "uint128"
|
|
9028
|
+
},
|
|
9029
|
+
{
|
|
9030
|
+
internalType: "uint256",
|
|
9031
|
+
name: "amount0",
|
|
9032
|
+
type: "uint256"
|
|
9033
|
+
},
|
|
9034
|
+
{
|
|
9035
|
+
internalType: "uint256",
|
|
9036
|
+
name: "amount1",
|
|
9037
|
+
type: "uint256"
|
|
9038
|
+
}
|
|
9039
|
+
],
|
|
9040
|
+
stateMutability: "payable",
|
|
9041
|
+
type: "function"
|
|
9042
|
+
},
|
|
9043
|
+
{
|
|
9044
|
+
inputs: [
|
|
9045
|
+
{
|
|
9046
|
+
internalType: "uint256",
|
|
9047
|
+
name: "tokenId",
|
|
9048
|
+
type: "uint256"
|
|
9049
|
+
}
|
|
9050
|
+
],
|
|
9051
|
+
name: "positions",
|
|
9052
|
+
outputs: [
|
|
9053
|
+
{
|
|
9054
|
+
internalType: "uint96",
|
|
9055
|
+
name: "nonce",
|
|
9056
|
+
type: "uint96"
|
|
9057
|
+
},
|
|
9058
|
+
{
|
|
9059
|
+
internalType: "address",
|
|
9060
|
+
name: "operator",
|
|
9061
|
+
type: "address"
|
|
9062
|
+
},
|
|
9063
|
+
{
|
|
9064
|
+
internalType: "address",
|
|
9065
|
+
name: "token0",
|
|
9066
|
+
type: "address"
|
|
9067
|
+
},
|
|
9068
|
+
{
|
|
9069
|
+
internalType: "address",
|
|
9070
|
+
name: "token1",
|
|
9071
|
+
type: "address"
|
|
9072
|
+
},
|
|
9073
|
+
{
|
|
9074
|
+
internalType: "uint24",
|
|
9075
|
+
name: "fee",
|
|
9076
|
+
type: "uint24"
|
|
9077
|
+
},
|
|
9078
|
+
{
|
|
9079
|
+
internalType: "int24",
|
|
9080
|
+
name: "tickLower",
|
|
9081
|
+
type: "int24"
|
|
9082
|
+
},
|
|
9083
|
+
{
|
|
9084
|
+
internalType: "int24",
|
|
9085
|
+
name: "tickUpper",
|
|
9086
|
+
type: "int24"
|
|
9087
|
+
},
|
|
9088
|
+
{
|
|
9089
|
+
internalType: "uint128",
|
|
9090
|
+
name: "liquidity",
|
|
9091
|
+
type: "uint128"
|
|
9092
|
+
},
|
|
9093
|
+
{
|
|
9094
|
+
internalType: "uint256",
|
|
9095
|
+
name: "feeGrowthInside0LastX128",
|
|
9096
|
+
type: "uint256"
|
|
9097
|
+
},
|
|
9098
|
+
{
|
|
9099
|
+
internalType: "uint256",
|
|
9100
|
+
name: "feeGrowthInside1LastX128",
|
|
9101
|
+
type: "uint256"
|
|
9102
|
+
},
|
|
9103
|
+
{
|
|
9104
|
+
internalType: "uint128",
|
|
9105
|
+
name: "tokensOwed0",
|
|
9106
|
+
type: "uint128"
|
|
9107
|
+
},
|
|
9108
|
+
{
|
|
9109
|
+
internalType: "uint128",
|
|
9110
|
+
name: "tokensOwed1",
|
|
9111
|
+
type: "uint128"
|
|
9112
|
+
}
|
|
9113
|
+
],
|
|
9114
|
+
stateMutability: "view",
|
|
9115
|
+
type: "function"
|
|
9116
|
+
},
|
|
9117
|
+
{
|
|
9118
|
+
inputs: [
|
|
9119
|
+
{
|
|
9120
|
+
internalType: "address",
|
|
9121
|
+
name: "owner",
|
|
9122
|
+
type: "address"
|
|
9123
|
+
}
|
|
9124
|
+
],
|
|
9125
|
+
name: "balanceOf",
|
|
9126
|
+
outputs: [
|
|
9127
|
+
{
|
|
9128
|
+
internalType: "uint256",
|
|
9129
|
+
name: "",
|
|
9130
|
+
type: "uint256"
|
|
9131
|
+
}
|
|
9132
|
+
],
|
|
9133
|
+
stateMutability: "view",
|
|
9134
|
+
type: "function"
|
|
9135
|
+
}
|
|
9136
|
+
];
|
|
9137
|
+
|
|
8647
9138
|
var abi$e = [
|
|
8648
9139
|
{
|
|
8649
9140
|
inputs: [
|
|
@@ -8870,9 +9361,14 @@ function _getUniswapV3MintTxData() {
|
|
|
8870
9361
|
mintParams.push(0);
|
|
8871
9362
|
}
|
|
8872
9363
|
|
|
9364
|
+
if (dapp === exports.Dapp.RAMSESCL) {
|
|
9365
|
+
iNonfungiblePositionManager = new ethers.ethers.utils.Interface(IRamsesNonfungiblePositionManager);
|
|
9366
|
+
mintParams.push(0);
|
|
9367
|
+
}
|
|
9368
|
+
|
|
8873
9369
|
return _context.abrupt("return", iNonfungiblePositionManager.encodeFunctionData(exports.Transaction.MINT, [mintParams]));
|
|
8874
9370
|
|
|
8875
|
-
case
|
|
9371
|
+
case 29:
|
|
8876
9372
|
case "end":
|
|
8877
9373
|
return _context.stop();
|
|
8878
9374
|
}
|
|
@@ -8924,7 +9420,7 @@ function _getIncreaseLiquidityTxData() {
|
|
|
8924
9420
|
while (1) {
|
|
8925
9421
|
switch (_context3.prev = _context3.next) {
|
|
8926
9422
|
case 0:
|
|
8927
|
-
if (!(dapp === exports.Dapp.UNISWAPV3 || dapp === exports.Dapp.VELODROMECL || dapp === exports.Dapp.AERODROMECL)) {
|
|
9423
|
+
if (!(dapp === exports.Dapp.UNISWAPV3 || dapp === exports.Dapp.VELODROMECL || dapp === exports.Dapp.AERODROMECL || dapp === exports.Dapp.RAMSESCL)) {
|
|
8928
9424
|
_context3.next = 15;
|
|
8929
9425
|
break;
|
|
8930
9426
|
}
|
|
@@ -8989,7 +9485,7 @@ function _getDecreaseLiquidityTxData() {
|
|
|
8989
9485
|
amount = 100;
|
|
8990
9486
|
}
|
|
8991
9487
|
|
|
8992
|
-
if (!(dapp === exports.Dapp.UNISWAPV3 || dapp === exports.Dapp.VELODROMECL || dapp === exports.Dapp.AERODROMECL)) {
|
|
9488
|
+
if (!(dapp === exports.Dapp.UNISWAPV3 || dapp === exports.Dapp.VELODROMECL || dapp === exports.Dapp.AERODROMECL || dapp === exports.Dapp.RAMSESCL)) {
|
|
8993
9489
|
_context4.next = 22;
|
|
8994
9490
|
break;
|
|
8995
9491
|
}
|
|
@@ -21215,12 +21711,16 @@ var IXRam = {
|
|
|
21215
21711
|
|
|
21216
21712
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
21217
21713
|
var iXRam = /*#__PURE__*/new ethers.ethers.utils.Interface(IXRam.abi);
|
|
21714
|
+
var iRamsesNonfungiblePositionManager = /*#__PURE__*/new ethers.ethers.utils.Interface(IRamsesNonfungiblePositionManager);
|
|
21218
21715
|
function getCreateVestTxData(amount) {
|
|
21219
21716
|
return iXRam.encodeFunctionData("createVest", [amount]);
|
|
21220
21717
|
}
|
|
21221
21718
|
function getExitVestTxData(vestId) {
|
|
21222
21719
|
return iXRam.encodeFunctionData("exitVest", [vestId, false]);
|
|
21223
21720
|
}
|
|
21721
|
+
function getRewardsTxDta(tokenId, rewards) {
|
|
21722
|
+
return iRamsesNonfungiblePositionManager.encodeFunctionData("getReward", [tokenId, rewards]);
|
|
21723
|
+
}
|
|
21224
21724
|
|
|
21225
21725
|
var DelayedOrderAbi = [
|
|
21226
21726
|
{
|
|
@@ -23966,6 +24466,68 @@ function _cancelOrderViaFlatMoney() {
|
|
|
23966
24466
|
return _cancelOrderViaFlatMoney.apply(this, arguments);
|
|
23967
24467
|
}
|
|
23968
24468
|
|
|
24469
|
+
var ICompoundV3Comet = [
|
|
24470
|
+
{
|
|
24471
|
+
inputs: [
|
|
24472
|
+
],
|
|
24473
|
+
name: "baseToken",
|
|
24474
|
+
outputs: [
|
|
24475
|
+
{
|
|
24476
|
+
internalType: "address",
|
|
24477
|
+
name: "",
|
|
24478
|
+
type: "address"
|
|
24479
|
+
}
|
|
24480
|
+
],
|
|
24481
|
+
stateMutability: "view",
|
|
24482
|
+
type: "function"
|
|
24483
|
+
},
|
|
24484
|
+
{
|
|
24485
|
+
inputs: [
|
|
24486
|
+
{
|
|
24487
|
+
internalType: "address",
|
|
24488
|
+
name: "asset",
|
|
24489
|
+
type: "address"
|
|
24490
|
+
},
|
|
24491
|
+
{
|
|
24492
|
+
internalType: "uint256",
|
|
24493
|
+
name: "amount",
|
|
24494
|
+
type: "uint256"
|
|
24495
|
+
}
|
|
24496
|
+
],
|
|
24497
|
+
name: "supply",
|
|
24498
|
+
outputs: [
|
|
24499
|
+
],
|
|
24500
|
+
stateMutability: "nonpayable",
|
|
24501
|
+
type: "function"
|
|
24502
|
+
},
|
|
24503
|
+
{
|
|
24504
|
+
inputs: [
|
|
24505
|
+
{
|
|
24506
|
+
internalType: "address",
|
|
24507
|
+
name: "asset",
|
|
24508
|
+
type: "address"
|
|
24509
|
+
},
|
|
24510
|
+
{
|
|
24511
|
+
internalType: "uint256",
|
|
24512
|
+
name: "amount",
|
|
24513
|
+
type: "uint256"
|
|
24514
|
+
}
|
|
24515
|
+
],
|
|
24516
|
+
name: "withdraw",
|
|
24517
|
+
outputs: [
|
|
24518
|
+
],
|
|
24519
|
+
stateMutability: "nonpayable",
|
|
24520
|
+
type: "function"
|
|
24521
|
+
}
|
|
24522
|
+
];
|
|
24523
|
+
|
|
24524
|
+
function getCompoundV3LendTxData(asset, amount) {
|
|
24525
|
+
return new ethers.ethers.utils.Interface(ICompoundV3Comet).encodeFunctionData("supply", [asset, amount]);
|
|
24526
|
+
}
|
|
24527
|
+
function getCompoundV3WithdrawTxData(asset, amount) {
|
|
24528
|
+
return new ethers.ethers.utils.Interface(ICompoundV3Comet).encodeFunctionData("withdraw", [asset, amount]);
|
|
24529
|
+
}
|
|
24530
|
+
|
|
23969
24531
|
var Pool = /*#__PURE__*/function () {
|
|
23970
24532
|
function Pool(network, signer, poolLogic, mangerLogic, utils, factory) {
|
|
23971
24533
|
this.network = network;
|
|
@@ -24969,12 +25531,113 @@ var Pool = /*#__PURE__*/function () {
|
|
|
24969
25531
|
var iLendingPool, depositTxData, tx;
|
|
24970
25532
|
return runtime_1.wrap(function _callee17$(_context17) {
|
|
24971
25533
|
while (1) {
|
|
24972
|
-
switch (_context17.prev = _context17.next) {
|
|
25534
|
+
switch (_context17.prev = _context17.next) {
|
|
25535
|
+
case 0:
|
|
25536
|
+
if (referralCode === void 0) {
|
|
25537
|
+
referralCode = 0;
|
|
25538
|
+
}
|
|
25539
|
+
|
|
25540
|
+
if (options === void 0) {
|
|
25541
|
+
options = null;
|
|
25542
|
+
}
|
|
25543
|
+
|
|
25544
|
+
if (estimateGas === void 0) {
|
|
25545
|
+
estimateGas = false;
|
|
25546
|
+
}
|
|
25547
|
+
|
|
25548
|
+
iLendingPool = new ethers.ethers.utils.Interface(ILendingPool.abi);
|
|
25549
|
+
depositTxData = iLendingPool.encodeFunctionData(exports.Transaction.DEPOSIT, [asset, amount, this.address, referralCode]);
|
|
25550
|
+
_context17.next = 7;
|
|
25551
|
+
return getPoolTxOrGasEstimate(this, [routerAddress[this.network][dapp], depositTxData, options], estimateGas);
|
|
25552
|
+
|
|
25553
|
+
case 7:
|
|
25554
|
+
tx = _context17.sent;
|
|
25555
|
+
return _context17.abrupt("return", tx);
|
|
25556
|
+
|
|
25557
|
+
case 9:
|
|
25558
|
+
case "end":
|
|
25559
|
+
return _context17.stop();
|
|
25560
|
+
}
|
|
25561
|
+
}
|
|
25562
|
+
}, _callee17, this);
|
|
25563
|
+
}));
|
|
25564
|
+
|
|
25565
|
+
function lend(_x75, _x76, _x77, _x78, _x79, _x80) {
|
|
25566
|
+
return _lend.apply(this, arguments);
|
|
25567
|
+
}
|
|
25568
|
+
|
|
25569
|
+
return lend;
|
|
25570
|
+
}()
|
|
25571
|
+
/**
|
|
25572
|
+
* Lend asset to a Compound V3 style lending pool
|
|
25573
|
+
* @param {string} market Address of market e.g cUSDCv3 address
|
|
25574
|
+
* @param {string} asset Asset
|
|
25575
|
+
* @param {BigNumber | string} amount Amount of asset to lend
|
|
25576
|
+
* @param {any} options Transaction options
|
|
25577
|
+
* @param {boolean} estimateGas Simulate/estimate gas
|
|
25578
|
+
* @returns {Promise<any>} Transaction
|
|
25579
|
+
*/
|
|
25580
|
+
;
|
|
25581
|
+
|
|
25582
|
+
_proto.lendCompoundV3 =
|
|
25583
|
+
/*#__PURE__*/
|
|
25584
|
+
function () {
|
|
25585
|
+
var _lendCompoundV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee18(market, asset, amount, options, estimateGas) {
|
|
25586
|
+
var supplyTxData, tx;
|
|
25587
|
+
return runtime_1.wrap(function _callee18$(_context18) {
|
|
25588
|
+
while (1) {
|
|
25589
|
+
switch (_context18.prev = _context18.next) {
|
|
25590
|
+
case 0:
|
|
25591
|
+
if (options === void 0) {
|
|
25592
|
+
options = null;
|
|
25593
|
+
}
|
|
25594
|
+
|
|
25595
|
+
if (estimateGas === void 0) {
|
|
25596
|
+
estimateGas = false;
|
|
25597
|
+
}
|
|
25598
|
+
|
|
25599
|
+
supplyTxData = getCompoundV3LendTxData(asset, amount);
|
|
25600
|
+
_context18.next = 5;
|
|
25601
|
+
return getPoolTxOrGasEstimate(this, [market, supplyTxData, options], estimateGas);
|
|
25602
|
+
|
|
25603
|
+
case 5:
|
|
25604
|
+
tx = _context18.sent;
|
|
25605
|
+
return _context18.abrupt("return", tx);
|
|
25606
|
+
|
|
25607
|
+
case 7:
|
|
25608
|
+
case "end":
|
|
25609
|
+
return _context18.stop();
|
|
25610
|
+
}
|
|
25611
|
+
}
|
|
25612
|
+
}, _callee18, this);
|
|
25613
|
+
}));
|
|
25614
|
+
|
|
25615
|
+
function lendCompoundV3(_x81, _x82, _x83, _x84, _x85) {
|
|
25616
|
+
return _lendCompoundV.apply(this, arguments);
|
|
25617
|
+
}
|
|
25618
|
+
|
|
25619
|
+
return lendCompoundV3;
|
|
25620
|
+
}()
|
|
25621
|
+
/**
|
|
25622
|
+
* Witdraw asset from a lending pool
|
|
25623
|
+
* @param {Dapp} dapp Platform like Aave
|
|
25624
|
+
* @param {string} asset Asset
|
|
25625
|
+
* @param {BigNumber | string} amount Amount of asset to lend
|
|
25626
|
+
* @param {any} options Transaction options
|
|
25627
|
+
* @param {boolean} estimateGas Simulate/estimate gas
|
|
25628
|
+
* @returns {Promise<any>} Transaction
|
|
25629
|
+
*/
|
|
25630
|
+
;
|
|
25631
|
+
|
|
25632
|
+
_proto.withdrawDeposit =
|
|
25633
|
+
/*#__PURE__*/
|
|
25634
|
+
function () {
|
|
25635
|
+
var _withdrawDeposit = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee19(dapp, asset, amount, options, estimateGas) {
|
|
25636
|
+
var iLendingPool, withdrawTxData, tx;
|
|
25637
|
+
return runtime_1.wrap(function _callee19$(_context19) {
|
|
25638
|
+
while (1) {
|
|
25639
|
+
switch (_context19.prev = _context19.next) {
|
|
24973
25640
|
case 0:
|
|
24974
|
-
if (referralCode === void 0) {
|
|
24975
|
-
referralCode = 0;
|
|
24976
|
-
}
|
|
24977
|
-
|
|
24978
25641
|
if (options === void 0) {
|
|
24979
25642
|
options = null;
|
|
24980
25643
|
}
|
|
@@ -24984,47 +25647,47 @@ var Pool = /*#__PURE__*/function () {
|
|
|
24984
25647
|
}
|
|
24985
25648
|
|
|
24986
25649
|
iLendingPool = new ethers.ethers.utils.Interface(ILendingPool.abi);
|
|
24987
|
-
|
|
24988
|
-
|
|
24989
|
-
return getPoolTxOrGasEstimate(this, [routerAddress[this.network][dapp],
|
|
25650
|
+
withdrawTxData = iLendingPool.encodeFunctionData(exports.Transaction.WITHDRAW, [asset, amount, this.address]);
|
|
25651
|
+
_context19.next = 6;
|
|
25652
|
+
return getPoolTxOrGasEstimate(this, [routerAddress[this.network][dapp], withdrawTxData, options], estimateGas);
|
|
24990
25653
|
|
|
24991
|
-
case
|
|
24992
|
-
tx =
|
|
24993
|
-
return
|
|
25654
|
+
case 6:
|
|
25655
|
+
tx = _context19.sent;
|
|
25656
|
+
return _context19.abrupt("return", tx);
|
|
24994
25657
|
|
|
24995
|
-
case
|
|
25658
|
+
case 8:
|
|
24996
25659
|
case "end":
|
|
24997
|
-
return
|
|
25660
|
+
return _context19.stop();
|
|
24998
25661
|
}
|
|
24999
25662
|
}
|
|
25000
|
-
},
|
|
25663
|
+
}, _callee19, this);
|
|
25001
25664
|
}));
|
|
25002
25665
|
|
|
25003
|
-
function
|
|
25004
|
-
return
|
|
25666
|
+
function withdrawDeposit(_x86, _x87, _x88, _x89, _x90) {
|
|
25667
|
+
return _withdrawDeposit.apply(this, arguments);
|
|
25005
25668
|
}
|
|
25006
25669
|
|
|
25007
|
-
return
|
|
25670
|
+
return withdrawDeposit;
|
|
25008
25671
|
}()
|
|
25009
25672
|
/**
|
|
25010
|
-
* Witdraw asset from a lending pool
|
|
25011
|
-
* @param {
|
|
25673
|
+
* Witdraw asset from a COmpound V3 style lending pool
|
|
25674
|
+
* @param {string} market Address of market e.g cUSDCv3 address
|
|
25012
25675
|
* @param {string} asset Asset
|
|
25013
|
-
* @param {BigNumber | string} amount Amount of asset to
|
|
25676
|
+
* @param {BigNumber | string} amount Amount of asset to withdraw
|
|
25014
25677
|
* @param {any} options Transaction options
|
|
25015
25678
|
* @param {boolean} estimateGas Simulate/estimate gas
|
|
25016
25679
|
* @returns {Promise<any>} Transaction
|
|
25017
25680
|
*/
|
|
25018
25681
|
;
|
|
25019
25682
|
|
|
25020
|
-
_proto.
|
|
25683
|
+
_proto.withdrawCompoundV3 =
|
|
25021
25684
|
/*#__PURE__*/
|
|
25022
25685
|
function () {
|
|
25023
|
-
var
|
|
25024
|
-
var
|
|
25025
|
-
return runtime_1.wrap(function
|
|
25686
|
+
var _withdrawCompoundV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee20(market, asset, amount, options, estimateGas) {
|
|
25687
|
+
var withdrawTxData, tx;
|
|
25688
|
+
return runtime_1.wrap(function _callee20$(_context20) {
|
|
25026
25689
|
while (1) {
|
|
25027
|
-
switch (
|
|
25690
|
+
switch (_context20.prev = _context20.next) {
|
|
25028
25691
|
case 0:
|
|
25029
25692
|
if (options === void 0) {
|
|
25030
25693
|
options = null;
|
|
@@ -25034,28 +25697,27 @@ var Pool = /*#__PURE__*/function () {
|
|
|
25034
25697
|
estimateGas = false;
|
|
25035
25698
|
}
|
|
25036
25699
|
|
|
25037
|
-
|
|
25038
|
-
|
|
25039
|
-
|
|
25040
|
-
return getPoolTxOrGasEstimate(this, [routerAddress[this.network][dapp], withdrawTxData, options], estimateGas);
|
|
25700
|
+
withdrawTxData = getCompoundV3WithdrawTxData(asset, amount);
|
|
25701
|
+
_context20.next = 5;
|
|
25702
|
+
return getPoolTxOrGasEstimate(this, [market, withdrawTxData, options], estimateGas);
|
|
25041
25703
|
|
|
25042
|
-
case
|
|
25043
|
-
tx =
|
|
25044
|
-
return
|
|
25704
|
+
case 5:
|
|
25705
|
+
tx = _context20.sent;
|
|
25706
|
+
return _context20.abrupt("return", tx);
|
|
25045
25707
|
|
|
25046
|
-
case
|
|
25708
|
+
case 7:
|
|
25047
25709
|
case "end":
|
|
25048
|
-
return
|
|
25710
|
+
return _context20.stop();
|
|
25049
25711
|
}
|
|
25050
25712
|
}
|
|
25051
|
-
},
|
|
25713
|
+
}, _callee20, this);
|
|
25052
25714
|
}));
|
|
25053
25715
|
|
|
25054
|
-
function
|
|
25055
|
-
return
|
|
25716
|
+
function withdrawCompoundV3(_x91, _x92, _x93, _x94, _x95) {
|
|
25717
|
+
return _withdrawCompoundV.apply(this, arguments);
|
|
25056
25718
|
}
|
|
25057
25719
|
|
|
25058
|
-
return
|
|
25720
|
+
return withdrawCompoundV3;
|
|
25059
25721
|
}()
|
|
25060
25722
|
/**
|
|
25061
25723
|
* Borrow asset from a lending pool
|
|
@@ -25072,11 +25734,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
25072
25734
|
_proto.borrow =
|
|
25073
25735
|
/*#__PURE__*/
|
|
25074
25736
|
function () {
|
|
25075
|
-
var _borrow = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
25737
|
+
var _borrow = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee21(dapp, asset, amount, referralCode, options, estimateGas) {
|
|
25076
25738
|
var iLendingPool, borrowTxData, tx;
|
|
25077
|
-
return runtime_1.wrap(function
|
|
25739
|
+
return runtime_1.wrap(function _callee21$(_context21) {
|
|
25078
25740
|
while (1) {
|
|
25079
|
-
switch (
|
|
25741
|
+
switch (_context21.prev = _context21.next) {
|
|
25080
25742
|
case 0:
|
|
25081
25743
|
if (referralCode === void 0) {
|
|
25082
25744
|
referralCode = 0;
|
|
@@ -25092,22 +25754,22 @@ var Pool = /*#__PURE__*/function () {
|
|
|
25092
25754
|
|
|
25093
25755
|
iLendingPool = new ethers.ethers.utils.Interface(ILendingPool.abi);
|
|
25094
25756
|
borrowTxData = iLendingPool.encodeFunctionData(exports.Transaction.BORROW, [asset, amount, 2, referralCode, this.address]);
|
|
25095
|
-
|
|
25757
|
+
_context21.next = 7;
|
|
25096
25758
|
return getPoolTxOrGasEstimate(this, [routerAddress[this.network][dapp], borrowTxData, options], estimateGas);
|
|
25097
25759
|
|
|
25098
25760
|
case 7:
|
|
25099
|
-
tx =
|
|
25100
|
-
return
|
|
25761
|
+
tx = _context21.sent;
|
|
25762
|
+
return _context21.abrupt("return", tx);
|
|
25101
25763
|
|
|
25102
25764
|
case 9:
|
|
25103
25765
|
case "end":
|
|
25104
|
-
return
|
|
25766
|
+
return _context21.stop();
|
|
25105
25767
|
}
|
|
25106
25768
|
}
|
|
25107
|
-
},
|
|
25769
|
+
}, _callee21, this);
|
|
25108
25770
|
}));
|
|
25109
25771
|
|
|
25110
|
-
function borrow(
|
|
25772
|
+
function borrow(_x96, _x97, _x98, _x99, _x100, _x101) {
|
|
25111
25773
|
return _borrow.apply(this, arguments);
|
|
25112
25774
|
}
|
|
25113
25775
|
|
|
@@ -25127,11 +25789,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
25127
25789
|
_proto.repay =
|
|
25128
25790
|
/*#__PURE__*/
|
|
25129
25791
|
function () {
|
|
25130
|
-
var _repay = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
25792
|
+
var _repay = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee22(dapp, asset, amount, options, estimateGas) {
|
|
25131
25793
|
var iLendingPool, repayTxData, tx;
|
|
25132
|
-
return runtime_1.wrap(function
|
|
25794
|
+
return runtime_1.wrap(function _callee22$(_context22) {
|
|
25133
25795
|
while (1) {
|
|
25134
|
-
switch (
|
|
25796
|
+
switch (_context22.prev = _context22.next) {
|
|
25135
25797
|
case 0:
|
|
25136
25798
|
if (options === void 0) {
|
|
25137
25799
|
options = null;
|
|
@@ -25143,22 +25805,22 @@ var Pool = /*#__PURE__*/function () {
|
|
|
25143
25805
|
|
|
25144
25806
|
iLendingPool = new ethers.ethers.utils.Interface(ILendingPool.abi);
|
|
25145
25807
|
repayTxData = iLendingPool.encodeFunctionData(exports.Transaction.REPAY, [asset, amount, 2, this.address]);
|
|
25146
|
-
|
|
25808
|
+
_context22.next = 6;
|
|
25147
25809
|
return getPoolTxOrGasEstimate(this, [routerAddress[this.network][dapp], repayTxData, options], estimateGas);
|
|
25148
25810
|
|
|
25149
25811
|
case 6:
|
|
25150
|
-
tx =
|
|
25151
|
-
return
|
|
25812
|
+
tx = _context22.sent;
|
|
25813
|
+
return _context22.abrupt("return", tx);
|
|
25152
25814
|
|
|
25153
25815
|
case 8:
|
|
25154
25816
|
case "end":
|
|
25155
|
-
return
|
|
25817
|
+
return _context22.stop();
|
|
25156
25818
|
}
|
|
25157
25819
|
}
|
|
25158
|
-
},
|
|
25820
|
+
}, _callee22, this);
|
|
25159
25821
|
}));
|
|
25160
25822
|
|
|
25161
|
-
function repay(
|
|
25823
|
+
function repay(_x102, _x103, _x104, _x105, _x106) {
|
|
25162
25824
|
return _repay.apply(this, arguments);
|
|
25163
25825
|
}
|
|
25164
25826
|
|
|
@@ -25177,11 +25839,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
25177
25839
|
_proto.harvestRewards =
|
|
25178
25840
|
/*#__PURE__*/
|
|
25179
25841
|
function () {
|
|
25180
|
-
var _harvestRewards = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
25842
|
+
var _harvestRewards = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee23(dapp, asset, options, estimateGas) {
|
|
25181
25843
|
var iMiniChefV2, poolId, harvestTxData, tx;
|
|
25182
|
-
return runtime_1.wrap(function
|
|
25844
|
+
return runtime_1.wrap(function _callee23$(_context23) {
|
|
25183
25845
|
while (1) {
|
|
25184
|
-
switch (
|
|
25846
|
+
switch (_context23.prev = _context23.next) {
|
|
25185
25847
|
case 0:
|
|
25186
25848
|
if (options === void 0) {
|
|
25187
25849
|
options = null;
|
|
@@ -25192,28 +25854,28 @@ var Pool = /*#__PURE__*/function () {
|
|
|
25192
25854
|
}
|
|
25193
25855
|
|
|
25194
25856
|
iMiniChefV2 = new ethers.ethers.utils.Interface(IMiniChefV2.abi);
|
|
25195
|
-
|
|
25857
|
+
_context23.next = 5;
|
|
25196
25858
|
return this.utils.getLpPoolId(dapp, asset);
|
|
25197
25859
|
|
|
25198
25860
|
case 5:
|
|
25199
|
-
poolId =
|
|
25861
|
+
poolId = _context23.sent;
|
|
25200
25862
|
harvestTxData = iMiniChefV2.encodeFunctionData(exports.Transaction.HARVEST, [poolId, this.address]);
|
|
25201
|
-
|
|
25863
|
+
_context23.next = 9;
|
|
25202
25864
|
return getPoolTxOrGasEstimate(this, [stakingAddress[this.network][dapp], harvestTxData, options], estimateGas);
|
|
25203
25865
|
|
|
25204
25866
|
case 9:
|
|
25205
|
-
tx =
|
|
25206
|
-
return
|
|
25867
|
+
tx = _context23.sent;
|
|
25868
|
+
return _context23.abrupt("return", tx);
|
|
25207
25869
|
|
|
25208
25870
|
case 11:
|
|
25209
25871
|
case "end":
|
|
25210
|
-
return
|
|
25872
|
+
return _context23.stop();
|
|
25211
25873
|
}
|
|
25212
25874
|
}
|
|
25213
|
-
},
|
|
25875
|
+
}, _callee23, this);
|
|
25214
25876
|
}));
|
|
25215
25877
|
|
|
25216
|
-
function harvestRewards(
|
|
25878
|
+
function harvestRewards(_x107, _x108, _x109, _x110) {
|
|
25217
25879
|
return _harvestRewards.apply(this, arguments);
|
|
25218
25880
|
}
|
|
25219
25881
|
|
|
@@ -25231,11 +25893,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
25231
25893
|
_proto.changeAssets =
|
|
25232
25894
|
/*#__PURE__*/
|
|
25233
25895
|
function () {
|
|
25234
|
-
var _changeAssets = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
25896
|
+
var _changeAssets = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee24(assets, options, estimateGas) {
|
|
25235
25897
|
var currentAssetsEnabled, currentAssets, newAssets, removedAssets, changedAssets, tx;
|
|
25236
|
-
return runtime_1.wrap(function
|
|
25898
|
+
return runtime_1.wrap(function _callee24$(_context24) {
|
|
25237
25899
|
while (1) {
|
|
25238
|
-
switch (
|
|
25900
|
+
switch (_context24.prev = _context24.next) {
|
|
25239
25901
|
case 0:
|
|
25240
25902
|
if (options === void 0) {
|
|
25241
25903
|
options = null;
|
|
@@ -25245,11 +25907,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
25245
25907
|
estimateGas = false;
|
|
25246
25908
|
}
|
|
25247
25909
|
|
|
25248
|
-
|
|
25910
|
+
_context24.next = 4;
|
|
25249
25911
|
return this.getComposition();
|
|
25250
25912
|
|
|
25251
25913
|
case 4:
|
|
25252
|
-
currentAssetsEnabled =
|
|
25914
|
+
currentAssetsEnabled = _context24.sent;
|
|
25253
25915
|
currentAssets = currentAssetsEnabled.map(function (e) {
|
|
25254
25916
|
return e.asset.toLocaleLowerCase();
|
|
25255
25917
|
});
|
|
@@ -25264,33 +25926,33 @@ var Pool = /*#__PURE__*/function () {
|
|
|
25264
25926
|
});
|
|
25265
25927
|
|
|
25266
25928
|
if (!estimateGas) {
|
|
25267
|
-
|
|
25929
|
+
_context24.next = 13;
|
|
25268
25930
|
break;
|
|
25269
25931
|
}
|
|
25270
25932
|
|
|
25271
|
-
|
|
25933
|
+
_context24.next = 12;
|
|
25272
25934
|
return this.managerLogic.estimateGas.changeAssets(changedAssets, removedAssets, options);
|
|
25273
25935
|
|
|
25274
25936
|
case 12:
|
|
25275
|
-
return
|
|
25937
|
+
return _context24.abrupt("return", _context24.sent);
|
|
25276
25938
|
|
|
25277
25939
|
case 13:
|
|
25278
|
-
|
|
25940
|
+
_context24.next = 15;
|
|
25279
25941
|
return this.managerLogic.changeAssets(changedAssets, removedAssets, options);
|
|
25280
25942
|
|
|
25281
25943
|
case 15:
|
|
25282
|
-
tx =
|
|
25283
|
-
return
|
|
25944
|
+
tx = _context24.sent;
|
|
25945
|
+
return _context24.abrupt("return", tx);
|
|
25284
25946
|
|
|
25285
25947
|
case 17:
|
|
25286
25948
|
case "end":
|
|
25287
|
-
return
|
|
25949
|
+
return _context24.stop();
|
|
25288
25950
|
}
|
|
25289
25951
|
}
|
|
25290
|
-
},
|
|
25952
|
+
}, _callee24, this);
|
|
25291
25953
|
}));
|
|
25292
25954
|
|
|
25293
|
-
function changeAssets(
|
|
25955
|
+
function changeAssets(_x111, _x112, _x113) {
|
|
25294
25956
|
return _changeAssets.apply(this, arguments);
|
|
25295
25957
|
}
|
|
25296
25958
|
|
|
@@ -25308,11 +25970,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
25308
25970
|
_proto.setTrader =
|
|
25309
25971
|
/*#__PURE__*/
|
|
25310
25972
|
function () {
|
|
25311
|
-
var _setTrader = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
25973
|
+
var _setTrader = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee25(trader, options, estimateGas) {
|
|
25312
25974
|
var tx;
|
|
25313
|
-
return runtime_1.wrap(function
|
|
25975
|
+
return runtime_1.wrap(function _callee25$(_context25) {
|
|
25314
25976
|
while (1) {
|
|
25315
|
-
switch (
|
|
25977
|
+
switch (_context25.prev = _context25.next) {
|
|
25316
25978
|
case 0:
|
|
25317
25979
|
if (options === void 0) {
|
|
25318
25980
|
options = null;
|
|
@@ -25323,33 +25985,33 @@ var Pool = /*#__PURE__*/function () {
|
|
|
25323
25985
|
}
|
|
25324
25986
|
|
|
25325
25987
|
if (!estimateGas) {
|
|
25326
|
-
|
|
25988
|
+
_context25.next = 6;
|
|
25327
25989
|
break;
|
|
25328
25990
|
}
|
|
25329
25991
|
|
|
25330
|
-
|
|
25992
|
+
_context25.next = 5;
|
|
25331
25993
|
return this.managerLogic.estimateGas.setTrader(trader, options);
|
|
25332
25994
|
|
|
25333
25995
|
case 5:
|
|
25334
|
-
return
|
|
25996
|
+
return _context25.abrupt("return", _context25.sent);
|
|
25335
25997
|
|
|
25336
25998
|
case 6:
|
|
25337
|
-
|
|
25999
|
+
_context25.next = 8;
|
|
25338
26000
|
return this.managerLogic.setTrader(trader, options);
|
|
25339
26001
|
|
|
25340
26002
|
case 8:
|
|
25341
|
-
tx =
|
|
25342
|
-
return
|
|
26003
|
+
tx = _context25.sent;
|
|
26004
|
+
return _context25.abrupt("return", tx);
|
|
25343
26005
|
|
|
25344
26006
|
case 10:
|
|
25345
26007
|
case "end":
|
|
25346
|
-
return
|
|
26008
|
+
return _context25.stop();
|
|
25347
26009
|
}
|
|
25348
26010
|
}
|
|
25349
|
-
},
|
|
26011
|
+
}, _callee25, this);
|
|
25350
26012
|
}));
|
|
25351
26013
|
|
|
25352
|
-
function setTrader(
|
|
26014
|
+
function setTrader(_x114, _x115, _x116) {
|
|
25353
26015
|
return _setTrader.apply(this, arguments);
|
|
25354
26016
|
}
|
|
25355
26017
|
|
|
@@ -25369,11 +26031,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
25369
26031
|
_proto.joinBalancerPool =
|
|
25370
26032
|
/*#__PURE__*/
|
|
25371
26033
|
function () {
|
|
25372
|
-
var _joinBalancerPool = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
26034
|
+
var _joinBalancerPool = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee26(poolId, assets, amountsIn, options, estimateGas) {
|
|
25373
26035
|
var joinPoolTxData, tx;
|
|
25374
|
-
return runtime_1.wrap(function
|
|
26036
|
+
return runtime_1.wrap(function _callee26$(_context26) {
|
|
25375
26037
|
while (1) {
|
|
25376
|
-
switch (
|
|
26038
|
+
switch (_context26.prev = _context26.next) {
|
|
25377
26039
|
case 0:
|
|
25378
26040
|
if (options === void 0) {
|
|
25379
26041
|
options = null;
|
|
@@ -25384,22 +26046,22 @@ var Pool = /*#__PURE__*/function () {
|
|
|
25384
26046
|
}
|
|
25385
26047
|
|
|
25386
26048
|
joinPoolTxData = this.utils.getBalancerJoinPoolTx(this, poolId, assets, amountsIn);
|
|
25387
|
-
|
|
26049
|
+
_context26.next = 5;
|
|
25388
26050
|
return getPoolTxOrGasEstimate(this, [routerAddress[this.network][exports.Dapp.BALANCER], joinPoolTxData, options], estimateGas);
|
|
25389
26051
|
|
|
25390
26052
|
case 5:
|
|
25391
|
-
tx =
|
|
25392
|
-
return
|
|
26053
|
+
tx = _context26.sent;
|
|
26054
|
+
return _context26.abrupt("return", tx);
|
|
25393
26055
|
|
|
25394
26056
|
case 7:
|
|
25395
26057
|
case "end":
|
|
25396
|
-
return
|
|
26058
|
+
return _context26.stop();
|
|
25397
26059
|
}
|
|
25398
26060
|
}
|
|
25399
|
-
},
|
|
26061
|
+
}, _callee26, this);
|
|
25400
26062
|
}));
|
|
25401
26063
|
|
|
25402
|
-
function joinBalancerPool(
|
|
26064
|
+
function joinBalancerPool(_x117, _x118, _x119, _x120, _x121) {
|
|
25403
26065
|
return _joinBalancerPool.apply(this, arguments);
|
|
25404
26066
|
}
|
|
25405
26067
|
|
|
@@ -25420,11 +26082,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
25420
26082
|
_proto.exitBalancerPool =
|
|
25421
26083
|
/*#__PURE__*/
|
|
25422
26084
|
function () {
|
|
25423
|
-
var _exitBalancerPool = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
26085
|
+
var _exitBalancerPool = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee27(poolId, assets, amount, singleExitAssetIndex, options, estimateGas) {
|
|
25424
26086
|
var exitPoolTxData, tx;
|
|
25425
|
-
return runtime_1.wrap(function
|
|
26087
|
+
return runtime_1.wrap(function _callee27$(_context27) {
|
|
25426
26088
|
while (1) {
|
|
25427
|
-
switch (
|
|
26089
|
+
switch (_context27.prev = _context27.next) {
|
|
25428
26090
|
case 0:
|
|
25429
26091
|
if (singleExitAssetIndex === void 0) {
|
|
25430
26092
|
singleExitAssetIndex = null;
|
|
@@ -25439,22 +26101,22 @@ var Pool = /*#__PURE__*/function () {
|
|
|
25439
26101
|
}
|
|
25440
26102
|
|
|
25441
26103
|
exitPoolTxData = this.utils.getBalancerExitPoolTx(this, poolId, assets, singleExitAssetIndex, amount);
|
|
25442
|
-
|
|
26104
|
+
_context27.next = 6;
|
|
25443
26105
|
return getPoolTxOrGasEstimate(this, [routerAddress[this.network][exports.Dapp.BALANCER], exitPoolTxData, options], estimateGas);
|
|
25444
26106
|
|
|
25445
26107
|
case 6:
|
|
25446
|
-
tx =
|
|
25447
|
-
return
|
|
26108
|
+
tx = _context27.sent;
|
|
26109
|
+
return _context27.abrupt("return", tx);
|
|
25448
26110
|
|
|
25449
26111
|
case 8:
|
|
25450
26112
|
case "end":
|
|
25451
|
-
return
|
|
26113
|
+
return _context27.stop();
|
|
25452
26114
|
}
|
|
25453
26115
|
}
|
|
25454
|
-
},
|
|
26116
|
+
}, _callee27, this);
|
|
25455
26117
|
}));
|
|
25456
26118
|
|
|
25457
|
-
function exitBalancerPool(
|
|
26119
|
+
function exitBalancerPool(_x122, _x123, _x124, _x125, _x126, _x127) {
|
|
25458
26120
|
return _exitBalancerPool.apply(this, arguments);
|
|
25459
26121
|
}
|
|
25460
26122
|
|
|
@@ -25472,11 +26134,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
25472
26134
|
_proto.harvestAaveRewards =
|
|
25473
26135
|
/*#__PURE__*/
|
|
25474
26136
|
function () {
|
|
25475
|
-
var _harvestAaveRewards = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
26137
|
+
var _harvestAaveRewards = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee28(assets, options, estimateGas) {
|
|
25476
26138
|
var aaveIncentivesAddress, iAaveIncentivesController, aaveIncentivesController, amount, claimTxData, tx;
|
|
25477
|
-
return runtime_1.wrap(function
|
|
26139
|
+
return runtime_1.wrap(function _callee28$(_context28) {
|
|
25478
26140
|
while (1) {
|
|
25479
|
-
switch (
|
|
26141
|
+
switch (_context28.prev = _context28.next) {
|
|
25480
26142
|
case 0:
|
|
25481
26143
|
if (options === void 0) {
|
|
25482
26144
|
options = null;
|
|
@@ -25489,28 +26151,28 @@ var Pool = /*#__PURE__*/function () {
|
|
|
25489
26151
|
aaveIncentivesAddress = stakingAddress[this.network][exports.Dapp.AAVE];
|
|
25490
26152
|
iAaveIncentivesController = new ethers.ethers.utils.Interface(IAaveIncentivesController.abi);
|
|
25491
26153
|
aaveIncentivesController = new ethers.ethers.Contract(aaveIncentivesAddress, iAaveIncentivesController, this.signer);
|
|
25492
|
-
|
|
26154
|
+
_context28.next = 7;
|
|
25493
26155
|
return aaveIncentivesController.getUserUnclaimedRewards(this.address);
|
|
25494
26156
|
|
|
25495
26157
|
case 7:
|
|
25496
|
-
amount =
|
|
26158
|
+
amount = _context28.sent;
|
|
25497
26159
|
claimTxData = iAaveIncentivesController.encodeFunctionData(exports.Transaction.CLAIM_REWARDS, [assets, amount, this.address]);
|
|
25498
|
-
|
|
26160
|
+
_context28.next = 11;
|
|
25499
26161
|
return getPoolTxOrGasEstimate(this, [aaveIncentivesAddress, claimTxData, options], estimateGas);
|
|
25500
26162
|
|
|
25501
26163
|
case 11:
|
|
25502
|
-
tx =
|
|
25503
|
-
return
|
|
26164
|
+
tx = _context28.sent;
|
|
26165
|
+
return _context28.abrupt("return", tx);
|
|
25504
26166
|
|
|
25505
26167
|
case 13:
|
|
25506
26168
|
case "end":
|
|
25507
|
-
return
|
|
26169
|
+
return _context28.stop();
|
|
25508
26170
|
}
|
|
25509
26171
|
}
|
|
25510
|
-
},
|
|
26172
|
+
}, _callee28, this);
|
|
25511
26173
|
}));
|
|
25512
26174
|
|
|
25513
|
-
function harvestAaveRewards(
|
|
26175
|
+
function harvestAaveRewards(_x128, _x129, _x130) {
|
|
25514
26176
|
return _harvestAaveRewards.apply(this, arguments);
|
|
25515
26177
|
}
|
|
25516
26178
|
|
|
@@ -25529,11 +26191,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
25529
26191
|
_proto.harvestAaveV3Rewards =
|
|
25530
26192
|
/*#__PURE__*/
|
|
25531
26193
|
function () {
|
|
25532
|
-
var _harvestAaveV3Rewards = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
26194
|
+
var _harvestAaveV3Rewards = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee29(assets, rewardAsset, options, estimateGas) {
|
|
25533
26195
|
var claimTxData, tx;
|
|
25534
|
-
return runtime_1.wrap(function
|
|
26196
|
+
return runtime_1.wrap(function _callee29$(_context29) {
|
|
25535
26197
|
while (1) {
|
|
25536
|
-
switch (
|
|
26198
|
+
switch (_context29.prev = _context29.next) {
|
|
25537
26199
|
case 0:
|
|
25538
26200
|
if (options === void 0) {
|
|
25539
26201
|
options = null;
|
|
@@ -25543,27 +26205,27 @@ var Pool = /*#__PURE__*/function () {
|
|
|
25543
26205
|
estimateGas = false;
|
|
25544
26206
|
}
|
|
25545
26207
|
|
|
25546
|
-
|
|
26208
|
+
_context29.next = 4;
|
|
25547
26209
|
return getAaveV3ClaimTxData(this, assets, rewardAsset);
|
|
25548
26210
|
|
|
25549
26211
|
case 4:
|
|
25550
|
-
claimTxData =
|
|
25551
|
-
|
|
26212
|
+
claimTxData = _context29.sent;
|
|
26213
|
+
_context29.next = 7;
|
|
25552
26214
|
return getPoolTxOrGasEstimate(this, [stakingAddress[this.network][exports.Dapp.AAVEV3], claimTxData, options], estimateGas);
|
|
25553
26215
|
|
|
25554
26216
|
case 7:
|
|
25555
|
-
tx =
|
|
25556
|
-
return
|
|
26217
|
+
tx = _context29.sent;
|
|
26218
|
+
return _context29.abrupt("return", tx);
|
|
25557
26219
|
|
|
25558
26220
|
case 9:
|
|
25559
26221
|
case "end":
|
|
25560
|
-
return
|
|
26222
|
+
return _context29.stop();
|
|
25561
26223
|
}
|
|
25562
26224
|
}
|
|
25563
|
-
},
|
|
26225
|
+
}, _callee29, this);
|
|
25564
26226
|
}));
|
|
25565
26227
|
|
|
25566
|
-
function harvestAaveV3Rewards(
|
|
26228
|
+
function harvestAaveV3Rewards(_x131, _x132, _x133, _x134) {
|
|
25567
26229
|
return _harvestAaveV3Rewards.apply(this, arguments);
|
|
25568
26230
|
}
|
|
25569
26231
|
|
|
@@ -25571,7 +26233,7 @@ var Pool = /*#__PURE__*/function () {
|
|
|
25571
26233
|
}()
|
|
25572
26234
|
/**
|
|
25573
26235
|
* Create UniswapV3 liquidity pool
|
|
25574
|
-
* @param {dapp} Platform UniswapV3, VelodromeCL or
|
|
26236
|
+
* @param {dapp} Platform UniswapV3, VelodromeCL, AerodromeCL or RamesesCL
|
|
25575
26237
|
* @param {string} assetA First asset
|
|
25576
26238
|
* @param {string} assetB Second asset
|
|
25577
26239
|
* @param {BigNumber | string} amountA Amount first asset
|
|
@@ -25590,11 +26252,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
25590
26252
|
_proto.addLiquidityUniswapV3 =
|
|
25591
26253
|
/*#__PURE__*/
|
|
25592
26254
|
function () {
|
|
25593
|
-
var _addLiquidityUniswapV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
26255
|
+
var _addLiquidityUniswapV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee30(dapp, assetA, assetB, amountA, amountB, minPrice, maxPrice, minTick, maxTick, feeAmountOrTickSpacing, options, estimateGas) {
|
|
25594
26256
|
var mintTxData, tx;
|
|
25595
|
-
return runtime_1.wrap(function
|
|
26257
|
+
return runtime_1.wrap(function _callee30$(_context30) {
|
|
25596
26258
|
while (1) {
|
|
25597
|
-
switch (
|
|
26259
|
+
switch (_context30.prev = _context30.next) {
|
|
25598
26260
|
case 0:
|
|
25599
26261
|
if (options === void 0) {
|
|
25600
26262
|
options = null;
|
|
@@ -25605,7 +26267,7 @@ var Pool = /*#__PURE__*/function () {
|
|
|
25605
26267
|
}
|
|
25606
26268
|
|
|
25607
26269
|
if (!((minPrice === null || maxPrice === null) && (minTick === null || maxTick === null))) {
|
|
25608
|
-
|
|
26270
|
+
_context30.next = 4;
|
|
25609
26271
|
break;
|
|
25610
26272
|
}
|
|
25611
26273
|
|
|
@@ -25613,34 +26275,34 @@ var Pool = /*#__PURE__*/function () {
|
|
|
25613
26275
|
|
|
25614
26276
|
case 4:
|
|
25615
26277
|
if (!((minPrice || maxPrice) && dapp !== exports.Dapp.UNISWAPV3)) {
|
|
25616
|
-
|
|
26278
|
+
_context30.next = 6;
|
|
25617
26279
|
break;
|
|
25618
26280
|
}
|
|
25619
26281
|
|
|
25620
26282
|
throw new Error("no price conversion for Aerodrome/Velodrome CL");
|
|
25621
26283
|
|
|
25622
26284
|
case 6:
|
|
25623
|
-
|
|
26285
|
+
_context30.next = 8;
|
|
25624
26286
|
return getUniswapV3MintTxData(dapp, this, assetA, assetB, amountA, amountB, minPrice, maxPrice, minTick, maxTick, feeAmountOrTickSpacing);
|
|
25625
26287
|
|
|
25626
26288
|
case 8:
|
|
25627
|
-
mintTxData =
|
|
25628
|
-
|
|
26289
|
+
mintTxData = _context30.sent;
|
|
26290
|
+
_context30.next = 11;
|
|
25629
26291
|
return getPoolTxOrGasEstimate(this, [nonfungiblePositionManagerAddress[this.network][dapp], mintTxData, options], estimateGas);
|
|
25630
26292
|
|
|
25631
26293
|
case 11:
|
|
25632
|
-
tx =
|
|
25633
|
-
return
|
|
26294
|
+
tx = _context30.sent;
|
|
26295
|
+
return _context30.abrupt("return", tx);
|
|
25634
26296
|
|
|
25635
26297
|
case 13:
|
|
25636
26298
|
case "end":
|
|
25637
|
-
return
|
|
26299
|
+
return _context30.stop();
|
|
25638
26300
|
}
|
|
25639
26301
|
}
|
|
25640
|
-
},
|
|
26302
|
+
}, _callee30, this);
|
|
25641
26303
|
}));
|
|
25642
26304
|
|
|
25643
|
-
function addLiquidityUniswapV3(
|
|
26305
|
+
function addLiquidityUniswapV3(_x135, _x136, _x137, _x138, _x139, _x140, _x141, _x142, _x143, _x144, _x145, _x146) {
|
|
25644
26306
|
return _addLiquidityUniswapV.apply(this, arguments);
|
|
25645
26307
|
}
|
|
25646
26308
|
|
|
@@ -25660,11 +26322,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
25660
26322
|
_proto.decreaseLiquidity =
|
|
25661
26323
|
/*#__PURE__*/
|
|
25662
26324
|
function () {
|
|
25663
|
-
var _decreaseLiquidity = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
26325
|
+
var _decreaseLiquidity = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee31(dapp, tokenId, amount, options, estimateGas) {
|
|
25664
26326
|
var dappAddress, isStaked, txData, tokenIdOwner, tx;
|
|
25665
|
-
return runtime_1.wrap(function
|
|
26327
|
+
return runtime_1.wrap(function _callee31$(_context31) {
|
|
25666
26328
|
while (1) {
|
|
25667
|
-
switch (
|
|
26329
|
+
switch (_context31.prev = _context31.next) {
|
|
25668
26330
|
case 0:
|
|
25669
26331
|
if (amount === void 0) {
|
|
25670
26332
|
amount = 100;
|
|
@@ -25679,20 +26341,20 @@ var Pool = /*#__PURE__*/function () {
|
|
|
25679
26341
|
}
|
|
25680
26342
|
|
|
25681
26343
|
isStaked = false;
|
|
25682
|
-
|
|
25683
|
-
|
|
26344
|
+
_context31.t0 = dapp;
|
|
26345
|
+
_context31.next = _context31.t0 === exports.Dapp.UNISWAPV3 ? 7 : _context31.t0 === exports.Dapp.RAMSESCL ? 7 : _context31.t0 === exports.Dapp.VELODROMECL ? 9 : _context31.t0 === exports.Dapp.AERODROMECL ? 9 : _context31.t0 === exports.Dapp.ARRAKIS ? 14 : 16;
|
|
25684
26346
|
break;
|
|
25685
26347
|
|
|
25686
26348
|
case 7:
|
|
25687
26349
|
dappAddress = nonfungiblePositionManagerAddress[this.network][dapp];
|
|
25688
|
-
return
|
|
26350
|
+
return _context31.abrupt("break", 17);
|
|
25689
26351
|
|
|
25690
26352
|
case 9:
|
|
25691
|
-
|
|
26353
|
+
_context31.next = 11;
|
|
25692
26354
|
return getVelodromeClOwner(this, dapp, tokenId);
|
|
25693
26355
|
|
|
25694
26356
|
case 11:
|
|
25695
|
-
tokenIdOwner =
|
|
26357
|
+
tokenIdOwner = _context31.sent;
|
|
25696
26358
|
|
|
25697
26359
|
if (tokenIdOwner.toLowerCase() === this.address.toLowerCase()) {
|
|
25698
26360
|
dappAddress = nonfungiblePositionManagerAddress[this.network][dapp];
|
|
@@ -25702,49 +26364,49 @@ var Pool = /*#__PURE__*/function () {
|
|
|
25702
26364
|
isStaked = true;
|
|
25703
26365
|
}
|
|
25704
26366
|
|
|
25705
|
-
return
|
|
26367
|
+
return _context31.abrupt("break", 17);
|
|
25706
26368
|
|
|
25707
26369
|
case 14:
|
|
25708
26370
|
dappAddress = routerAddress[this.network][dapp];
|
|
25709
|
-
return
|
|
26371
|
+
return _context31.abrupt("break", 17);
|
|
25710
26372
|
|
|
25711
26373
|
case 16:
|
|
25712
26374
|
throw new Error("dapp not supported");
|
|
25713
26375
|
|
|
25714
26376
|
case 17:
|
|
25715
26377
|
if (isStaked) {
|
|
25716
|
-
|
|
26378
|
+
_context31.next = 23;
|
|
25717
26379
|
break;
|
|
25718
26380
|
}
|
|
25719
26381
|
|
|
25720
|
-
|
|
26382
|
+
_context31.next = 20;
|
|
25721
26383
|
return getDecreaseLiquidityTxData(this, dapp, tokenId, amount);
|
|
25722
26384
|
|
|
25723
26385
|
case 20:
|
|
25724
|
-
txData =
|
|
25725
|
-
|
|
26386
|
+
txData = _context31.sent;
|
|
26387
|
+
_context31.next = 24;
|
|
25726
26388
|
break;
|
|
25727
26389
|
|
|
25728
26390
|
case 23:
|
|
25729
26391
|
throw new Error("unsupported decreaseStakedLiquidity: unstake first to decrease lp");
|
|
25730
26392
|
|
|
25731
26393
|
case 24:
|
|
25732
|
-
|
|
26394
|
+
_context31.next = 26;
|
|
25733
26395
|
return getPoolTxOrGasEstimate(this, [dappAddress, txData, options], estimateGas);
|
|
25734
26396
|
|
|
25735
26397
|
case 26:
|
|
25736
|
-
tx =
|
|
25737
|
-
return
|
|
26398
|
+
tx = _context31.sent;
|
|
26399
|
+
return _context31.abrupt("return", tx);
|
|
25738
26400
|
|
|
25739
26401
|
case 28:
|
|
25740
26402
|
case "end":
|
|
25741
|
-
return
|
|
26403
|
+
return _context31.stop();
|
|
25742
26404
|
}
|
|
25743
26405
|
}
|
|
25744
|
-
},
|
|
26406
|
+
}, _callee31, this);
|
|
25745
26407
|
}));
|
|
25746
26408
|
|
|
25747
|
-
function decreaseLiquidity(
|
|
26409
|
+
function decreaseLiquidity(_x147, _x148, _x149, _x150, _x151) {
|
|
25748
26410
|
return _decreaseLiquidity.apply(this, arguments);
|
|
25749
26411
|
}
|
|
25750
26412
|
|
|
@@ -25765,11 +26427,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
25765
26427
|
_proto.increaseLiquidity =
|
|
25766
26428
|
/*#__PURE__*/
|
|
25767
26429
|
function () {
|
|
25768
|
-
var _increaseLiquidity = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
26430
|
+
var _increaseLiquidity = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee32(dapp, tokenId, amountA, amountB, options, estimateGas) {
|
|
25769
26431
|
var dappAddress, isStaked, txData, tokenIdOwner, tx;
|
|
25770
|
-
return runtime_1.wrap(function
|
|
26432
|
+
return runtime_1.wrap(function _callee32$(_context32) {
|
|
25771
26433
|
while (1) {
|
|
25772
|
-
switch (
|
|
26434
|
+
switch (_context32.prev = _context32.next) {
|
|
25773
26435
|
case 0:
|
|
25774
26436
|
if (options === void 0) {
|
|
25775
26437
|
options = null;
|
|
@@ -25780,20 +26442,20 @@ var Pool = /*#__PURE__*/function () {
|
|
|
25780
26442
|
}
|
|
25781
26443
|
|
|
25782
26444
|
isStaked = false;
|
|
25783
|
-
|
|
25784
|
-
|
|
26445
|
+
_context32.t0 = dapp;
|
|
26446
|
+
_context32.next = _context32.t0 === exports.Dapp.UNISWAPV3 ? 6 : _context32.t0 === exports.Dapp.RAMSESCL ? 6 : _context32.t0 === exports.Dapp.VELODROMECL ? 8 : _context32.t0 === exports.Dapp.AERODROMECL ? 8 : _context32.t0 === exports.Dapp.ARRAKIS ? 13 : 15;
|
|
25785
26447
|
break;
|
|
25786
26448
|
|
|
25787
26449
|
case 6:
|
|
25788
26450
|
dappAddress = nonfungiblePositionManagerAddress[this.network][dapp];
|
|
25789
|
-
return
|
|
26451
|
+
return _context32.abrupt("break", 16);
|
|
25790
26452
|
|
|
25791
26453
|
case 8:
|
|
25792
|
-
|
|
26454
|
+
_context32.next = 10;
|
|
25793
26455
|
return getVelodromeClOwner(this, dapp, tokenId);
|
|
25794
26456
|
|
|
25795
26457
|
case 10:
|
|
25796
|
-
tokenIdOwner =
|
|
26458
|
+
tokenIdOwner = _context32.sent;
|
|
25797
26459
|
|
|
25798
26460
|
if (tokenIdOwner.toLowerCase() === this.address.toLowerCase()) {
|
|
25799
26461
|
dappAddress = nonfungiblePositionManagerAddress[this.network][dapp];
|
|
@@ -25803,49 +26465,49 @@ var Pool = /*#__PURE__*/function () {
|
|
|
25803
26465
|
isStaked = true;
|
|
25804
26466
|
}
|
|
25805
26467
|
|
|
25806
|
-
return
|
|
26468
|
+
return _context32.abrupt("break", 16);
|
|
25807
26469
|
|
|
25808
26470
|
case 13:
|
|
25809
26471
|
dappAddress = routerAddress[this.network][dapp];
|
|
25810
|
-
return
|
|
26472
|
+
return _context32.abrupt("break", 16);
|
|
25811
26473
|
|
|
25812
26474
|
case 15:
|
|
25813
26475
|
throw new Error("dapp not supported");
|
|
25814
26476
|
|
|
25815
26477
|
case 16:
|
|
25816
26478
|
if (isStaked) {
|
|
25817
|
-
|
|
26479
|
+
_context32.next = 22;
|
|
25818
26480
|
break;
|
|
25819
26481
|
}
|
|
25820
26482
|
|
|
25821
|
-
|
|
26483
|
+
_context32.next = 19;
|
|
25822
26484
|
return getIncreaseLiquidityTxData(this, dapp, tokenId, amountA, amountB);
|
|
25823
26485
|
|
|
25824
26486
|
case 19:
|
|
25825
|
-
txData =
|
|
25826
|
-
|
|
26487
|
+
txData = _context32.sent;
|
|
26488
|
+
_context32.next = 23;
|
|
25827
26489
|
break;
|
|
25828
26490
|
|
|
25829
26491
|
case 22:
|
|
25830
26492
|
throw new Error("unsupported increaseStakedLiquidity: unstake first to increase lp");
|
|
25831
26493
|
|
|
25832
26494
|
case 23:
|
|
25833
|
-
|
|
26495
|
+
_context32.next = 25;
|
|
25834
26496
|
return getPoolTxOrGasEstimate(this, [dappAddress, txData, options], estimateGas);
|
|
25835
26497
|
|
|
25836
26498
|
case 25:
|
|
25837
|
-
tx =
|
|
25838
|
-
return
|
|
26499
|
+
tx = _context32.sent;
|
|
26500
|
+
return _context32.abrupt("return", tx);
|
|
25839
26501
|
|
|
25840
26502
|
case 27:
|
|
25841
26503
|
case "end":
|
|
25842
|
-
return
|
|
26504
|
+
return _context32.stop();
|
|
25843
26505
|
}
|
|
25844
26506
|
}
|
|
25845
|
-
},
|
|
26507
|
+
}, _callee32, this);
|
|
25846
26508
|
}));
|
|
25847
26509
|
|
|
25848
|
-
function increaseLiquidity(
|
|
26510
|
+
function increaseLiquidity(_x152, _x153, _x154, _x155, _x156, _x157) {
|
|
25849
26511
|
return _increaseLiquidity.apply(this, arguments);
|
|
25850
26512
|
}
|
|
25851
26513
|
|
|
@@ -25864,11 +26526,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
25864
26526
|
_proto.claimFees =
|
|
25865
26527
|
/*#__PURE__*/
|
|
25866
26528
|
function () {
|
|
25867
|
-
var _claimFees = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
26529
|
+
var _claimFees = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee33(dapp, tokenId, options, estimateGas) {
|
|
25868
26530
|
var txData, contractAddress, iNonfungiblePositionManager, abi, tokenIdOwner, tx;
|
|
25869
|
-
return runtime_1.wrap(function
|
|
26531
|
+
return runtime_1.wrap(function _callee33$(_context33) {
|
|
25870
26532
|
while (1) {
|
|
25871
|
-
switch (
|
|
26533
|
+
switch (_context33.prev = _context33.next) {
|
|
25872
26534
|
case 0:
|
|
25873
26535
|
if (options === void 0) {
|
|
25874
26536
|
options = null;
|
|
@@ -25879,37 +26541,37 @@ var Pool = /*#__PURE__*/function () {
|
|
|
25879
26541
|
}
|
|
25880
26542
|
|
|
25881
26543
|
iNonfungiblePositionManager = new ethers.ethers.utils.Interface(INonfungiblePositionManager.abi);
|
|
25882
|
-
|
|
25883
|
-
|
|
26544
|
+
_context33.t0 = dapp;
|
|
26545
|
+
_context33.next = _context33.t0 === exports.Dapp.UNISWAPV3 ? 6 : _context33.t0 === exports.Dapp.RAMSESCL ? 6 : _context33.t0 === exports.Dapp.ARRAKIS ? 9 : _context33.t0 === exports.Dapp.BALANCER ? 9 : _context33.t0 === exports.Dapp.VELODROME ? 13 : _context33.t0 === exports.Dapp.RAMSES ? 13 : _context33.t0 === exports.Dapp.VELODROMEV2 ? 16 : _context33.t0 === exports.Dapp.AERODROME ? 16 : _context33.t0 === exports.Dapp.VELODROMECL ? 19 : _context33.t0 === exports.Dapp.AERODROMECL ? 19 : 24;
|
|
25884
26546
|
break;
|
|
25885
26547
|
|
|
25886
26548
|
case 6:
|
|
25887
26549
|
contractAddress = nonfungiblePositionManagerAddress[this.network][dapp];
|
|
25888
26550
|
txData = iNonfungiblePositionManager.encodeFunctionData(exports.Transaction.COLLECT, [[tokenId, this.address, MaxUint128, MaxUint128]]);
|
|
25889
|
-
return
|
|
26551
|
+
return _context33.abrupt("break", 25);
|
|
25890
26552
|
|
|
25891
26553
|
case 9:
|
|
25892
26554
|
contractAddress = tokenId;
|
|
25893
26555
|
abi = new ethers.ethers.utils.Interface(ILiquidityGaugeV4.abi);
|
|
25894
26556
|
txData = abi.encodeFunctionData("claim_rewards()", []);
|
|
25895
|
-
return
|
|
26557
|
+
return _context33.abrupt("break", 25);
|
|
25896
26558
|
|
|
25897
26559
|
case 13:
|
|
25898
26560
|
contractAddress = tokenId;
|
|
25899
26561
|
txData = getVelodromeClaimTxData(this, tokenId, false);
|
|
25900
|
-
return
|
|
26562
|
+
return _context33.abrupt("break", 25);
|
|
25901
26563
|
|
|
25902
26564
|
case 16:
|
|
25903
26565
|
contractAddress = tokenId;
|
|
25904
26566
|
txData = getVelodromeClaimTxData(this, tokenId, true);
|
|
25905
|
-
return
|
|
26567
|
+
return _context33.abrupt("break", 25);
|
|
25906
26568
|
|
|
25907
26569
|
case 19:
|
|
25908
|
-
|
|
26570
|
+
_context33.next = 21;
|
|
25909
26571
|
return getVelodromeClOwner(this, dapp, tokenId);
|
|
25910
26572
|
|
|
25911
26573
|
case 21:
|
|
25912
|
-
tokenIdOwner =
|
|
26574
|
+
tokenIdOwner = _context33.sent;
|
|
25913
26575
|
|
|
25914
26576
|
if (tokenIdOwner.toLowerCase() === this.address.toLowerCase()) {
|
|
25915
26577
|
contractAddress = nonfungiblePositionManagerAddress[this.network][dapp];
|
|
@@ -25920,33 +26582,82 @@ var Pool = /*#__PURE__*/function () {
|
|
|
25920
26582
|
txData = getVelodromeCLClaimTxData(tokenId);
|
|
25921
26583
|
}
|
|
25922
26584
|
|
|
25923
|
-
return
|
|
26585
|
+
return _context33.abrupt("break", 25);
|
|
25924
26586
|
|
|
25925
26587
|
case 24:
|
|
25926
26588
|
throw new Error("dapp not supported");
|
|
25927
26589
|
|
|
25928
26590
|
case 25:
|
|
25929
|
-
|
|
26591
|
+
_context33.next = 27;
|
|
25930
26592
|
return getPoolTxOrGasEstimate(this, [contractAddress, txData, options], estimateGas);
|
|
25931
26593
|
|
|
25932
26594
|
case 27:
|
|
25933
|
-
tx =
|
|
25934
|
-
return
|
|
26595
|
+
tx = _context33.sent;
|
|
26596
|
+
return _context33.abrupt("return", tx);
|
|
25935
26597
|
|
|
25936
26598
|
case 29:
|
|
25937
26599
|
case "end":
|
|
25938
|
-
return
|
|
26600
|
+
return _context33.stop();
|
|
25939
26601
|
}
|
|
25940
26602
|
}
|
|
25941
|
-
},
|
|
26603
|
+
}, _callee33, this);
|
|
25942
26604
|
}));
|
|
25943
26605
|
|
|
25944
|
-
function claimFees(
|
|
26606
|
+
function claimFees(_x158, _x159, _x160, _x161) {
|
|
25945
26607
|
return _claimFees.apply(this, arguments);
|
|
25946
26608
|
}
|
|
25947
26609
|
|
|
25948
26610
|
return claimFees;
|
|
25949
26611
|
}()
|
|
26612
|
+
/**
|
|
26613
|
+
* Get rewards of an NFT position
|
|
26614
|
+
* @param {Dapp} dapp Platform e.g. Ramses CL
|
|
26615
|
+
* @param {string} tokenId Token Id
|
|
26616
|
+
* @param {string[]} rewards Reward tokens
|
|
26617
|
+
* @param {any} options Transaction option
|
|
26618
|
+
* @param {boolean} estimateGas Simulate/estimate gas
|
|
26619
|
+
* @returns {Promise<any>} Transaction
|
|
26620
|
+
*/
|
|
26621
|
+
;
|
|
26622
|
+
|
|
26623
|
+
_proto.getRewards =
|
|
26624
|
+
/*#__PURE__*/
|
|
26625
|
+
function () {
|
|
26626
|
+
var _getRewards = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee34(dapp, tokenId, rewards, options, estimateGas) {
|
|
26627
|
+
var tx;
|
|
26628
|
+
return runtime_1.wrap(function _callee34$(_context34) {
|
|
26629
|
+
while (1) {
|
|
26630
|
+
switch (_context34.prev = _context34.next) {
|
|
26631
|
+
case 0:
|
|
26632
|
+
if (options === void 0) {
|
|
26633
|
+
options = null;
|
|
26634
|
+
}
|
|
26635
|
+
|
|
26636
|
+
if (estimateGas === void 0) {
|
|
26637
|
+
estimateGas = false;
|
|
26638
|
+
}
|
|
26639
|
+
|
|
26640
|
+
_context34.next = 4;
|
|
26641
|
+
return getPoolTxOrGasEstimate(this, [nonfungiblePositionManagerAddress[this.network][dapp], getRewardsTxDta(tokenId, rewards), options], estimateGas);
|
|
26642
|
+
|
|
26643
|
+
case 4:
|
|
26644
|
+
tx = _context34.sent;
|
|
26645
|
+
return _context34.abrupt("return", tx);
|
|
26646
|
+
|
|
26647
|
+
case 6:
|
|
26648
|
+
case "end":
|
|
26649
|
+
return _context34.stop();
|
|
26650
|
+
}
|
|
26651
|
+
}
|
|
26652
|
+
}, _callee34, this);
|
|
26653
|
+
}));
|
|
26654
|
+
|
|
26655
|
+
function getRewards(_x162, _x163, _x164, _x165, _x166) {
|
|
26656
|
+
return _getRewards.apply(this, arguments);
|
|
26657
|
+
}
|
|
26658
|
+
|
|
26659
|
+
return getRewards;
|
|
26660
|
+
}()
|
|
25950
26661
|
/**
|
|
25951
26662
|
* Trade an asset into another asset
|
|
25952
26663
|
* @param {Dapp} dapp Platform like Sushiswap or Uniswap
|
|
@@ -25964,11 +26675,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
25964
26675
|
_proto.tradeUniswapV3 =
|
|
25965
26676
|
/*#__PURE__*/
|
|
25966
26677
|
function () {
|
|
25967
|
-
var _tradeUniswapV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
26678
|
+
var _tradeUniswapV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee35(assetFrom, assetTo, amountIn, feeAmount, slippage, options, estimateGas) {
|
|
25968
26679
|
var swapxData, tx;
|
|
25969
|
-
return runtime_1.wrap(function
|
|
26680
|
+
return runtime_1.wrap(function _callee35$(_context35) {
|
|
25970
26681
|
while (1) {
|
|
25971
|
-
switch (
|
|
26682
|
+
switch (_context35.prev = _context35.next) {
|
|
25972
26683
|
case 0:
|
|
25973
26684
|
if (slippage === void 0) {
|
|
25974
26685
|
slippage = 0.5;
|
|
@@ -25982,27 +26693,27 @@ var Pool = /*#__PURE__*/function () {
|
|
|
25982
26693
|
estimateGas = false;
|
|
25983
26694
|
}
|
|
25984
26695
|
|
|
25985
|
-
|
|
26696
|
+
_context35.next = 5;
|
|
25986
26697
|
return getUniswapV3SwapTxData(this, assetFrom, assetTo, amountIn, slippage, feeAmount);
|
|
25987
26698
|
|
|
25988
26699
|
case 5:
|
|
25989
|
-
swapxData =
|
|
25990
|
-
|
|
26700
|
+
swapxData = _context35.sent;
|
|
26701
|
+
_context35.next = 8;
|
|
25991
26702
|
return getPoolTxOrGasEstimate(this, [routerAddress[this.network][exports.Dapp.UNISWAPV3], swapxData, options], estimateGas);
|
|
25992
26703
|
|
|
25993
26704
|
case 8:
|
|
25994
|
-
tx =
|
|
25995
|
-
return
|
|
26705
|
+
tx = _context35.sent;
|
|
26706
|
+
return _context35.abrupt("return", tx);
|
|
25996
26707
|
|
|
25997
26708
|
case 10:
|
|
25998
26709
|
case "end":
|
|
25999
|
-
return
|
|
26710
|
+
return _context35.stop();
|
|
26000
26711
|
}
|
|
26001
26712
|
}
|
|
26002
|
-
},
|
|
26713
|
+
}, _callee35, this);
|
|
26003
26714
|
}));
|
|
26004
26715
|
|
|
26005
|
-
function tradeUniswapV3(
|
|
26716
|
+
function tradeUniswapV3(_x167, _x168, _x169, _x170, _x171, _x172, _x173) {
|
|
26006
26717
|
return _tradeUniswapV.apply(this, arguments);
|
|
26007
26718
|
}
|
|
26008
26719
|
|
|
@@ -26024,11 +26735,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26024
26735
|
_proto.addLiquidityVelodrome =
|
|
26025
26736
|
/*#__PURE__*/
|
|
26026
26737
|
function () {
|
|
26027
|
-
var _addLiquidityVelodrome = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
26738
|
+
var _addLiquidityVelodrome = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee36(assetA, assetB, amountA, amountB, isStable, options, estimateGas) {
|
|
26028
26739
|
var tx;
|
|
26029
|
-
return runtime_1.wrap(function
|
|
26740
|
+
return runtime_1.wrap(function _callee36$(_context36) {
|
|
26030
26741
|
while (1) {
|
|
26031
|
-
switch (
|
|
26742
|
+
switch (_context36.prev = _context36.next) {
|
|
26032
26743
|
case 0:
|
|
26033
26744
|
if (options === void 0) {
|
|
26034
26745
|
options = null;
|
|
@@ -26038,33 +26749,33 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26038
26749
|
estimateGas = false;
|
|
26039
26750
|
}
|
|
26040
26751
|
|
|
26041
|
-
|
|
26042
|
-
|
|
26043
|
-
|
|
26044
|
-
|
|
26752
|
+
_context36.t0 = getPoolTxOrGasEstimate;
|
|
26753
|
+
_context36.t1 = this;
|
|
26754
|
+
_context36.t2 = routerAddress[this.network][exports.Dapp.VELODROME];
|
|
26755
|
+
_context36.next = 7;
|
|
26045
26756
|
return getVelodromeAddLiquidityTxData(this, assetA, assetB, amountA, amountB, isStable);
|
|
26046
26757
|
|
|
26047
26758
|
case 7:
|
|
26048
|
-
|
|
26049
|
-
|
|
26050
|
-
|
|
26051
|
-
|
|
26052
|
-
|
|
26053
|
-
return (0,
|
|
26759
|
+
_context36.t3 = _context36.sent;
|
|
26760
|
+
_context36.t4 = options;
|
|
26761
|
+
_context36.t5 = [_context36.t2, _context36.t3, _context36.t4];
|
|
26762
|
+
_context36.t6 = estimateGas;
|
|
26763
|
+
_context36.next = 13;
|
|
26764
|
+
return (0, _context36.t0)(_context36.t1, _context36.t5, _context36.t6);
|
|
26054
26765
|
|
|
26055
26766
|
case 13:
|
|
26056
|
-
tx =
|
|
26057
|
-
return
|
|
26767
|
+
tx = _context36.sent;
|
|
26768
|
+
return _context36.abrupt("return", tx);
|
|
26058
26769
|
|
|
26059
26770
|
case 15:
|
|
26060
26771
|
case "end":
|
|
26061
|
-
return
|
|
26772
|
+
return _context36.stop();
|
|
26062
26773
|
}
|
|
26063
26774
|
}
|
|
26064
|
-
},
|
|
26775
|
+
}, _callee36, this);
|
|
26065
26776
|
}));
|
|
26066
26777
|
|
|
26067
|
-
function addLiquidityVelodrome(
|
|
26778
|
+
function addLiquidityVelodrome(_x174, _x175, _x176, _x177, _x178, _x179, _x180) {
|
|
26068
26779
|
return _addLiquidityVelodrome.apply(this, arguments);
|
|
26069
26780
|
}
|
|
26070
26781
|
|
|
@@ -26085,11 +26796,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26085
26796
|
_proto.removeLiquidityVelodrome =
|
|
26086
26797
|
/*#__PURE__*/
|
|
26087
26798
|
function () {
|
|
26088
|
-
var _removeLiquidityVelodrome = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
26799
|
+
var _removeLiquidityVelodrome = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee37(assetA, assetB, amount, isStable, options, estimateGas) {
|
|
26089
26800
|
var tx;
|
|
26090
|
-
return runtime_1.wrap(function
|
|
26801
|
+
return runtime_1.wrap(function _callee37$(_context37) {
|
|
26091
26802
|
while (1) {
|
|
26092
|
-
switch (
|
|
26803
|
+
switch (_context37.prev = _context37.next) {
|
|
26093
26804
|
case 0:
|
|
26094
26805
|
if (options === void 0) {
|
|
26095
26806
|
options = null;
|
|
@@ -26099,33 +26810,33 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26099
26810
|
estimateGas = false;
|
|
26100
26811
|
}
|
|
26101
26812
|
|
|
26102
|
-
|
|
26103
|
-
|
|
26104
|
-
|
|
26105
|
-
|
|
26813
|
+
_context37.t0 = getPoolTxOrGasEstimate;
|
|
26814
|
+
_context37.t1 = this;
|
|
26815
|
+
_context37.t2 = routerAddress[this.network][exports.Dapp.VELODROME];
|
|
26816
|
+
_context37.next = 7;
|
|
26106
26817
|
return getVelodromeRemoveLiquidityTxData(this, assetA, assetB, amount, isStable);
|
|
26107
26818
|
|
|
26108
26819
|
case 7:
|
|
26109
|
-
|
|
26110
|
-
|
|
26111
|
-
|
|
26112
|
-
|
|
26113
|
-
|
|
26114
|
-
return (0,
|
|
26820
|
+
_context37.t3 = _context37.sent;
|
|
26821
|
+
_context37.t4 = options;
|
|
26822
|
+
_context37.t5 = [_context37.t2, _context37.t3, _context37.t4];
|
|
26823
|
+
_context37.t6 = estimateGas;
|
|
26824
|
+
_context37.next = 13;
|
|
26825
|
+
return (0, _context37.t0)(_context37.t1, _context37.t5, _context37.t6);
|
|
26115
26826
|
|
|
26116
26827
|
case 13:
|
|
26117
|
-
tx =
|
|
26118
|
-
return
|
|
26828
|
+
tx = _context37.sent;
|
|
26829
|
+
return _context37.abrupt("return", tx);
|
|
26119
26830
|
|
|
26120
26831
|
case 15:
|
|
26121
26832
|
case "end":
|
|
26122
|
-
return
|
|
26833
|
+
return _context37.stop();
|
|
26123
26834
|
}
|
|
26124
26835
|
}
|
|
26125
|
-
},
|
|
26836
|
+
}, _callee37, this);
|
|
26126
26837
|
}));
|
|
26127
26838
|
|
|
26128
|
-
function removeLiquidityVelodrome(
|
|
26839
|
+
function removeLiquidityVelodrome(_x181, _x182, _x183, _x184, _x185, _x186) {
|
|
26129
26840
|
return _removeLiquidityVelodrome.apply(this, arguments);
|
|
26130
26841
|
}
|
|
26131
26842
|
|
|
@@ -26147,11 +26858,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26147
26858
|
_proto.addLiquidityVelodromeV2 =
|
|
26148
26859
|
/*#__PURE__*/
|
|
26149
26860
|
function () {
|
|
26150
|
-
var _addLiquidityVelodromeV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
26861
|
+
var _addLiquidityVelodromeV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee38(assetA, assetB, amountA, amountB, isStable, options, estimateGas) {
|
|
26151
26862
|
var tx;
|
|
26152
|
-
return runtime_1.wrap(function
|
|
26863
|
+
return runtime_1.wrap(function _callee38$(_context38) {
|
|
26153
26864
|
while (1) {
|
|
26154
|
-
switch (
|
|
26865
|
+
switch (_context38.prev = _context38.next) {
|
|
26155
26866
|
case 0:
|
|
26156
26867
|
if (options === void 0) {
|
|
26157
26868
|
options = null;
|
|
@@ -26161,33 +26872,33 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26161
26872
|
estimateGas = false;
|
|
26162
26873
|
}
|
|
26163
26874
|
|
|
26164
|
-
|
|
26165
|
-
|
|
26166
|
-
|
|
26167
|
-
|
|
26875
|
+
_context38.t0 = getPoolTxOrGasEstimate;
|
|
26876
|
+
_context38.t1 = this;
|
|
26877
|
+
_context38.t2 = routerAddress[this.network][exports.Dapp.VELODROMEV2];
|
|
26878
|
+
_context38.next = 7;
|
|
26168
26879
|
return getVelodromeAddLiquidityTxData(this, assetA, assetB, amountA, amountB, isStable);
|
|
26169
26880
|
|
|
26170
26881
|
case 7:
|
|
26171
|
-
|
|
26172
|
-
|
|
26173
|
-
|
|
26174
|
-
|
|
26175
|
-
|
|
26176
|
-
return (0,
|
|
26882
|
+
_context38.t3 = _context38.sent;
|
|
26883
|
+
_context38.t4 = options;
|
|
26884
|
+
_context38.t5 = [_context38.t2, _context38.t3, _context38.t4];
|
|
26885
|
+
_context38.t6 = estimateGas;
|
|
26886
|
+
_context38.next = 13;
|
|
26887
|
+
return (0, _context38.t0)(_context38.t1, _context38.t5, _context38.t6);
|
|
26177
26888
|
|
|
26178
26889
|
case 13:
|
|
26179
|
-
tx =
|
|
26180
|
-
return
|
|
26890
|
+
tx = _context38.sent;
|
|
26891
|
+
return _context38.abrupt("return", tx);
|
|
26181
26892
|
|
|
26182
26893
|
case 15:
|
|
26183
26894
|
case "end":
|
|
26184
|
-
return
|
|
26895
|
+
return _context38.stop();
|
|
26185
26896
|
}
|
|
26186
26897
|
}
|
|
26187
|
-
},
|
|
26898
|
+
}, _callee38, this);
|
|
26188
26899
|
}));
|
|
26189
26900
|
|
|
26190
|
-
function addLiquidityVelodromeV2(
|
|
26901
|
+
function addLiquidityVelodromeV2(_x187, _x188, _x189, _x190, _x191, _x192, _x193) {
|
|
26191
26902
|
return _addLiquidityVelodromeV.apply(this, arguments);
|
|
26192
26903
|
}
|
|
26193
26904
|
|
|
@@ -26208,11 +26919,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26208
26919
|
_proto.removeLiquidityVelodromeV2 =
|
|
26209
26920
|
/*#__PURE__*/
|
|
26210
26921
|
function () {
|
|
26211
|
-
var _removeLiquidityVelodromeV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
26922
|
+
var _removeLiquidityVelodromeV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee39(assetA, assetB, amount, isStable, options, estimateGas) {
|
|
26212
26923
|
var tx;
|
|
26213
|
-
return runtime_1.wrap(function
|
|
26924
|
+
return runtime_1.wrap(function _callee39$(_context39) {
|
|
26214
26925
|
while (1) {
|
|
26215
|
-
switch (
|
|
26926
|
+
switch (_context39.prev = _context39.next) {
|
|
26216
26927
|
case 0:
|
|
26217
26928
|
if (options === void 0) {
|
|
26218
26929
|
options = null;
|
|
@@ -26222,33 +26933,33 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26222
26933
|
estimateGas = false;
|
|
26223
26934
|
}
|
|
26224
26935
|
|
|
26225
|
-
|
|
26226
|
-
|
|
26227
|
-
|
|
26228
|
-
|
|
26936
|
+
_context39.t0 = getPoolTxOrGasEstimate;
|
|
26937
|
+
_context39.t1 = this;
|
|
26938
|
+
_context39.t2 = routerAddress[this.network][exports.Dapp.VELODROMEV2];
|
|
26939
|
+
_context39.next = 7;
|
|
26229
26940
|
return getVelodromeRemoveLiquidityTxData(this, assetA, assetB, amount, isStable);
|
|
26230
26941
|
|
|
26231
26942
|
case 7:
|
|
26232
|
-
|
|
26233
|
-
|
|
26234
|
-
|
|
26235
|
-
|
|
26236
|
-
|
|
26237
|
-
return (0,
|
|
26943
|
+
_context39.t3 = _context39.sent;
|
|
26944
|
+
_context39.t4 = options;
|
|
26945
|
+
_context39.t5 = [_context39.t2, _context39.t3, _context39.t4];
|
|
26946
|
+
_context39.t6 = estimateGas;
|
|
26947
|
+
_context39.next = 13;
|
|
26948
|
+
return (0, _context39.t0)(_context39.t1, _context39.t5, _context39.t6);
|
|
26238
26949
|
|
|
26239
26950
|
case 13:
|
|
26240
|
-
tx =
|
|
26241
|
-
return
|
|
26951
|
+
tx = _context39.sent;
|
|
26952
|
+
return _context39.abrupt("return", tx);
|
|
26242
26953
|
|
|
26243
26954
|
case 15:
|
|
26244
26955
|
case "end":
|
|
26245
|
-
return
|
|
26956
|
+
return _context39.stop();
|
|
26246
26957
|
}
|
|
26247
26958
|
}
|
|
26248
|
-
},
|
|
26959
|
+
}, _callee39, this);
|
|
26249
26960
|
}));
|
|
26250
26961
|
|
|
26251
|
-
function removeLiquidityVelodromeV2(
|
|
26962
|
+
function removeLiquidityVelodromeV2(_x194, _x195, _x196, _x197, _x198, _x199) {
|
|
26252
26963
|
return _removeLiquidityVelodromeV.apply(this, arguments);
|
|
26253
26964
|
}
|
|
26254
26965
|
|
|
@@ -26271,11 +26982,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26271
26982
|
_proto.addLiquidityV2 =
|
|
26272
26983
|
/*#__PURE__*/
|
|
26273
26984
|
function () {
|
|
26274
|
-
var _addLiquidityV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
26985
|
+
var _addLiquidityV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee40(dapp, assetA, assetB, amountA, amountB, isStable, options, estimateGas) {
|
|
26275
26986
|
var tx;
|
|
26276
|
-
return runtime_1.wrap(function
|
|
26987
|
+
return runtime_1.wrap(function _callee40$(_context40) {
|
|
26277
26988
|
while (1) {
|
|
26278
|
-
switch (
|
|
26989
|
+
switch (_context40.prev = _context40.next) {
|
|
26279
26990
|
case 0:
|
|
26280
26991
|
if (options === void 0) {
|
|
26281
26992
|
options = null;
|
|
@@ -26285,33 +26996,33 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26285
26996
|
estimateGas = false;
|
|
26286
26997
|
}
|
|
26287
26998
|
|
|
26288
|
-
|
|
26289
|
-
|
|
26290
|
-
|
|
26291
|
-
|
|
26999
|
+
_context40.t0 = getPoolTxOrGasEstimate;
|
|
27000
|
+
_context40.t1 = this;
|
|
27001
|
+
_context40.t2 = routerAddress[this.network][dapp];
|
|
27002
|
+
_context40.next = 7;
|
|
26292
27003
|
return getVelodromeAddLiquidityTxData(this, assetA, assetB, amountA, amountB, isStable);
|
|
26293
27004
|
|
|
26294
27005
|
case 7:
|
|
26295
|
-
|
|
26296
|
-
|
|
26297
|
-
|
|
26298
|
-
|
|
26299
|
-
|
|
26300
|
-
return (0,
|
|
27006
|
+
_context40.t3 = _context40.sent;
|
|
27007
|
+
_context40.t4 = options;
|
|
27008
|
+
_context40.t5 = [_context40.t2, _context40.t3, _context40.t4];
|
|
27009
|
+
_context40.t6 = estimateGas;
|
|
27010
|
+
_context40.next = 13;
|
|
27011
|
+
return (0, _context40.t0)(_context40.t1, _context40.t5, _context40.t6);
|
|
26301
27012
|
|
|
26302
27013
|
case 13:
|
|
26303
|
-
tx =
|
|
26304
|
-
return
|
|
27014
|
+
tx = _context40.sent;
|
|
27015
|
+
return _context40.abrupt("return", tx);
|
|
26305
27016
|
|
|
26306
27017
|
case 15:
|
|
26307
27018
|
case "end":
|
|
26308
|
-
return
|
|
27019
|
+
return _context40.stop();
|
|
26309
27020
|
}
|
|
26310
27021
|
}
|
|
26311
|
-
},
|
|
27022
|
+
}, _callee40, this);
|
|
26312
27023
|
}));
|
|
26313
27024
|
|
|
26314
|
-
function addLiquidityV2(
|
|
27025
|
+
function addLiquidityV2(_x200, _x201, _x202, _x203, _x204, _x205, _x206, _x207) {
|
|
26315
27026
|
return _addLiquidityV.apply(this, arguments);
|
|
26316
27027
|
}
|
|
26317
27028
|
|
|
@@ -26333,11 +27044,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26333
27044
|
_proto.removeLiquidityV2 =
|
|
26334
27045
|
/*#__PURE__*/
|
|
26335
27046
|
function () {
|
|
26336
|
-
var _removeLiquidityV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
27047
|
+
var _removeLiquidityV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee41(dapp, assetA, assetB, amount, isStable, options, estimateGas) {
|
|
26337
27048
|
var tx;
|
|
26338
|
-
return runtime_1.wrap(function
|
|
27049
|
+
return runtime_1.wrap(function _callee41$(_context41) {
|
|
26339
27050
|
while (1) {
|
|
26340
|
-
switch (
|
|
27051
|
+
switch (_context41.prev = _context41.next) {
|
|
26341
27052
|
case 0:
|
|
26342
27053
|
if (options === void 0) {
|
|
26343
27054
|
options = null;
|
|
@@ -26347,33 +27058,33 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26347
27058
|
estimateGas = false;
|
|
26348
27059
|
}
|
|
26349
27060
|
|
|
26350
|
-
|
|
26351
|
-
|
|
26352
|
-
|
|
26353
|
-
|
|
27061
|
+
_context41.t0 = getPoolTxOrGasEstimate;
|
|
27062
|
+
_context41.t1 = this;
|
|
27063
|
+
_context41.t2 = routerAddress[this.network][dapp];
|
|
27064
|
+
_context41.next = 7;
|
|
26354
27065
|
return getVelodromeRemoveLiquidityTxData(this, assetA, assetB, amount, isStable);
|
|
26355
27066
|
|
|
26356
27067
|
case 7:
|
|
26357
|
-
|
|
26358
|
-
|
|
26359
|
-
|
|
26360
|
-
|
|
26361
|
-
|
|
26362
|
-
return (0,
|
|
27068
|
+
_context41.t3 = _context41.sent;
|
|
27069
|
+
_context41.t4 = options;
|
|
27070
|
+
_context41.t5 = [_context41.t2, _context41.t3, _context41.t4];
|
|
27071
|
+
_context41.t6 = estimateGas;
|
|
27072
|
+
_context41.next = 13;
|
|
27073
|
+
return (0, _context41.t0)(_context41.t1, _context41.t5, _context41.t6);
|
|
26363
27074
|
|
|
26364
27075
|
case 13:
|
|
26365
|
-
tx =
|
|
26366
|
-
return
|
|
27076
|
+
tx = _context41.sent;
|
|
27077
|
+
return _context41.abrupt("return", tx);
|
|
26367
27078
|
|
|
26368
27079
|
case 15:
|
|
26369
27080
|
case "end":
|
|
26370
|
-
return
|
|
27081
|
+
return _context41.stop();
|
|
26371
27082
|
}
|
|
26372
27083
|
}
|
|
26373
|
-
},
|
|
27084
|
+
}, _callee41, this);
|
|
26374
27085
|
}));
|
|
26375
27086
|
|
|
26376
|
-
function removeLiquidityV2(
|
|
27087
|
+
function removeLiquidityV2(_x208, _x209, _x210, _x211, _x212, _x213, _x214) {
|
|
26377
27088
|
return _removeLiquidityV.apply(this, arguments);
|
|
26378
27089
|
}
|
|
26379
27090
|
|
|
@@ -26399,11 +27110,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26399
27110
|
_proto.tradeLyraOption =
|
|
26400
27111
|
/*#__PURE__*/
|
|
26401
27112
|
function () {
|
|
26402
|
-
var _tradeLyraOption = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
27113
|
+
var _tradeLyraOption = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee42(market, expiry, strike, optionType, tradeType, optionAmount, assetIn, collateralChangeAmount, isCoveredCall, options, estimateGas) {
|
|
26403
27114
|
var swapxData, tx;
|
|
26404
|
-
return runtime_1.wrap(function
|
|
27115
|
+
return runtime_1.wrap(function _callee42$(_context42) {
|
|
26405
27116
|
while (1) {
|
|
26406
|
-
switch (
|
|
27117
|
+
switch (_context42.prev = _context42.next) {
|
|
26407
27118
|
case 0:
|
|
26408
27119
|
if (collateralChangeAmount === void 0) {
|
|
26409
27120
|
collateralChangeAmount = "0";
|
|
@@ -26421,27 +27132,27 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26421
27132
|
estimateGas = false;
|
|
26422
27133
|
}
|
|
26423
27134
|
|
|
26424
|
-
|
|
27135
|
+
_context42.next = 6;
|
|
26425
27136
|
return getLyraOptionTxData(this, market, optionType, expiry, strike, tradeType, optionAmount, assetIn, ethers.BigNumber.from(collateralChangeAmount), isCoveredCall);
|
|
26426
27137
|
|
|
26427
27138
|
case 6:
|
|
26428
|
-
swapxData =
|
|
26429
|
-
|
|
27139
|
+
swapxData = _context42.sent;
|
|
27140
|
+
_context42.next = 9;
|
|
26430
27141
|
return getPoolTxOrGasEstimate(this, [routerAddress[this.network][exports.Dapp.LYRA], swapxData, options], estimateGas);
|
|
26431
27142
|
|
|
26432
27143
|
case 9:
|
|
26433
|
-
tx =
|
|
26434
|
-
return
|
|
27144
|
+
tx = _context42.sent;
|
|
27145
|
+
return _context42.abrupt("return", tx);
|
|
26435
27146
|
|
|
26436
27147
|
case 11:
|
|
26437
27148
|
case "end":
|
|
26438
|
-
return
|
|
27149
|
+
return _context42.stop();
|
|
26439
27150
|
}
|
|
26440
27151
|
}
|
|
26441
|
-
},
|
|
27152
|
+
}, _callee42, this);
|
|
26442
27153
|
}));
|
|
26443
27154
|
|
|
26444
|
-
function tradeLyraOption(
|
|
27155
|
+
function tradeLyraOption(_x215, _x216, _x217, _x218, _x219, _x220, _x221, _x222, _x223, _x224, _x225) {
|
|
26445
27156
|
return _tradeLyraOption.apply(this, arguments);
|
|
26446
27157
|
}
|
|
26447
27158
|
|
|
@@ -26456,26 +27167,26 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26456
27167
|
_proto.getLyraPositions =
|
|
26457
27168
|
/*#__PURE__*/
|
|
26458
27169
|
function () {
|
|
26459
|
-
var _getLyraPositions = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
26460
|
-
return runtime_1.wrap(function
|
|
27170
|
+
var _getLyraPositions = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee43(market) {
|
|
27171
|
+
return runtime_1.wrap(function _callee43$(_context43) {
|
|
26461
27172
|
while (1) {
|
|
26462
|
-
switch (
|
|
27173
|
+
switch (_context43.prev = _context43.next) {
|
|
26463
27174
|
case 0:
|
|
26464
|
-
|
|
27175
|
+
_context43.next = 2;
|
|
26465
27176
|
return getOptionPositions(this, market);
|
|
26466
27177
|
|
|
26467
27178
|
case 2:
|
|
26468
|
-
return
|
|
27179
|
+
return _context43.abrupt("return", _context43.sent);
|
|
26469
27180
|
|
|
26470
27181
|
case 3:
|
|
26471
27182
|
case "end":
|
|
26472
|
-
return
|
|
27183
|
+
return _context43.stop();
|
|
26473
27184
|
}
|
|
26474
27185
|
}
|
|
26475
|
-
},
|
|
27186
|
+
}, _callee43, this);
|
|
26476
27187
|
}));
|
|
26477
27188
|
|
|
26478
|
-
function getLyraPositions(
|
|
27189
|
+
function getLyraPositions(_x226) {
|
|
26479
27190
|
return _getLyraPositions.apply(this, arguments);
|
|
26480
27191
|
}
|
|
26481
27192
|
|
|
@@ -26494,11 +27205,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26494
27205
|
_proto.changeFuturesMargin =
|
|
26495
27206
|
/*#__PURE__*/
|
|
26496
27207
|
function () {
|
|
26497
|
-
var _changeFuturesMargin = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
27208
|
+
var _changeFuturesMargin = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee44(market, changeAmount, options, estimateGas) {
|
|
26498
27209
|
var tx;
|
|
26499
|
-
return runtime_1.wrap(function
|
|
27210
|
+
return runtime_1.wrap(function _callee44$(_context44) {
|
|
26500
27211
|
while (1) {
|
|
26501
|
-
switch (
|
|
27212
|
+
switch (_context44.prev = _context44.next) {
|
|
26502
27213
|
case 0:
|
|
26503
27214
|
if (options === void 0) {
|
|
26504
27215
|
options = null;
|
|
@@ -26508,22 +27219,22 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26508
27219
|
estimateGas = false;
|
|
26509
27220
|
}
|
|
26510
27221
|
|
|
26511
|
-
|
|
27222
|
+
_context44.next = 4;
|
|
26512
27223
|
return getPoolTxOrGasEstimate(this, [market, getFuturesChangeMarginTxData(changeAmount), options], estimateGas);
|
|
26513
27224
|
|
|
26514
27225
|
case 4:
|
|
26515
|
-
tx =
|
|
26516
|
-
return
|
|
27226
|
+
tx = _context44.sent;
|
|
27227
|
+
return _context44.abrupt("return", tx);
|
|
26517
27228
|
|
|
26518
27229
|
case 6:
|
|
26519
27230
|
case "end":
|
|
26520
|
-
return
|
|
27231
|
+
return _context44.stop();
|
|
26521
27232
|
}
|
|
26522
27233
|
}
|
|
26523
|
-
},
|
|
27234
|
+
}, _callee44, this);
|
|
26524
27235
|
}));
|
|
26525
27236
|
|
|
26526
|
-
function changeFuturesMargin(
|
|
27237
|
+
function changeFuturesMargin(_x227, _x228, _x229, _x230) {
|
|
26527
27238
|
return _changeFuturesMargin.apply(this, arguments);
|
|
26528
27239
|
}
|
|
26529
27240
|
|
|
@@ -26542,11 +27253,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26542
27253
|
_proto.changeFuturesPosition =
|
|
26543
27254
|
/*#__PURE__*/
|
|
26544
27255
|
function () {
|
|
26545
|
-
var _changeFuturesPosition = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
27256
|
+
var _changeFuturesPosition = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee45(market, changeAmount, options, estimateGas) {
|
|
26546
27257
|
var txData, tx;
|
|
26547
|
-
return runtime_1.wrap(function
|
|
27258
|
+
return runtime_1.wrap(function _callee45$(_context45) {
|
|
26548
27259
|
while (1) {
|
|
26549
|
-
switch (
|
|
27260
|
+
switch (_context45.prev = _context45.next) {
|
|
26550
27261
|
case 0:
|
|
26551
27262
|
if (options === void 0) {
|
|
26552
27263
|
options = null;
|
|
@@ -26556,27 +27267,27 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26556
27267
|
estimateGas = false;
|
|
26557
27268
|
}
|
|
26558
27269
|
|
|
26559
|
-
|
|
27270
|
+
_context45.next = 4;
|
|
26560
27271
|
return getFuturesChangePositionTxData(changeAmount, market, this);
|
|
26561
27272
|
|
|
26562
27273
|
case 4:
|
|
26563
|
-
txData =
|
|
26564
|
-
|
|
27274
|
+
txData = _context45.sent;
|
|
27275
|
+
_context45.next = 7;
|
|
26565
27276
|
return getPoolTxOrGasEstimate(this, [market, txData, options], estimateGas);
|
|
26566
27277
|
|
|
26567
27278
|
case 7:
|
|
26568
|
-
tx =
|
|
26569
|
-
return
|
|
27279
|
+
tx = _context45.sent;
|
|
27280
|
+
return _context45.abrupt("return", tx);
|
|
26570
27281
|
|
|
26571
27282
|
case 9:
|
|
26572
27283
|
case "end":
|
|
26573
|
-
return
|
|
27284
|
+
return _context45.stop();
|
|
26574
27285
|
}
|
|
26575
27286
|
}
|
|
26576
|
-
},
|
|
27287
|
+
}, _callee45, this);
|
|
26577
27288
|
}));
|
|
26578
27289
|
|
|
26579
|
-
function changeFuturesPosition(
|
|
27290
|
+
function changeFuturesPosition(_x231, _x232, _x233, _x234) {
|
|
26580
27291
|
return _changeFuturesPosition.apply(this, arguments);
|
|
26581
27292
|
}
|
|
26582
27293
|
|
|
@@ -26594,11 +27305,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26594
27305
|
_proto.cancelFuturesOrder =
|
|
26595
27306
|
/*#__PURE__*/
|
|
26596
27307
|
function () {
|
|
26597
|
-
var _cancelFuturesOrder = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
27308
|
+
var _cancelFuturesOrder = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee46(market, options, estimateGas) {
|
|
26598
27309
|
var txData, tx;
|
|
26599
|
-
return runtime_1.wrap(function
|
|
27310
|
+
return runtime_1.wrap(function _callee46$(_context46) {
|
|
26600
27311
|
while (1) {
|
|
26601
|
-
switch (
|
|
27312
|
+
switch (_context46.prev = _context46.next) {
|
|
26602
27313
|
case 0:
|
|
26603
27314
|
if (options === void 0) {
|
|
26604
27315
|
options = null;
|
|
@@ -26608,27 +27319,27 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26608
27319
|
estimateGas = false;
|
|
26609
27320
|
}
|
|
26610
27321
|
|
|
26611
|
-
|
|
27322
|
+
_context46.next = 4;
|
|
26612
27323
|
return getFuturesCancelOrderTxData(this);
|
|
26613
27324
|
|
|
26614
27325
|
case 4:
|
|
26615
|
-
txData =
|
|
26616
|
-
|
|
27326
|
+
txData = _context46.sent;
|
|
27327
|
+
_context46.next = 7;
|
|
26617
27328
|
return getPoolTxOrGasEstimate(this, [market, txData, options], estimateGas);
|
|
26618
27329
|
|
|
26619
27330
|
case 7:
|
|
26620
|
-
tx =
|
|
26621
|
-
return
|
|
27331
|
+
tx = _context46.sent;
|
|
27332
|
+
return _context46.abrupt("return", tx);
|
|
26622
27333
|
|
|
26623
27334
|
case 9:
|
|
26624
27335
|
case "end":
|
|
26625
|
-
return
|
|
27336
|
+
return _context46.stop();
|
|
26626
27337
|
}
|
|
26627
27338
|
}
|
|
26628
|
-
},
|
|
27339
|
+
}, _callee46, this);
|
|
26629
27340
|
}));
|
|
26630
27341
|
|
|
26631
|
-
function cancelFuturesOrder(
|
|
27342
|
+
function cancelFuturesOrder(_x235, _x236, _x237) {
|
|
26632
27343
|
return _cancelFuturesOrder.apply(this, arguments);
|
|
26633
27344
|
}
|
|
26634
27345
|
|
|
@@ -26645,11 +27356,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26645
27356
|
_proto.mintManagerFee =
|
|
26646
27357
|
/*#__PURE__*/
|
|
26647
27358
|
function () {
|
|
26648
|
-
var _mintManagerFee = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
27359
|
+
var _mintManagerFee = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee47(options, estimateGas) {
|
|
26649
27360
|
var tx;
|
|
26650
|
-
return runtime_1.wrap(function
|
|
27361
|
+
return runtime_1.wrap(function _callee47$(_context47) {
|
|
26651
27362
|
while (1) {
|
|
26652
|
-
switch (
|
|
27363
|
+
switch (_context47.prev = _context47.next) {
|
|
26653
27364
|
case 0:
|
|
26654
27365
|
if (options === void 0) {
|
|
26655
27366
|
options = null;
|
|
@@ -26660,33 +27371,33 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26660
27371
|
}
|
|
26661
27372
|
|
|
26662
27373
|
if (!estimateGas) {
|
|
26663
|
-
|
|
27374
|
+
_context47.next = 6;
|
|
26664
27375
|
break;
|
|
26665
27376
|
}
|
|
26666
27377
|
|
|
26667
|
-
|
|
27378
|
+
_context47.next = 5;
|
|
26668
27379
|
return this.poolLogic.estimateGas.mintManagerFee(options);
|
|
26669
27380
|
|
|
26670
27381
|
case 5:
|
|
26671
|
-
return
|
|
27382
|
+
return _context47.abrupt("return", _context47.sent);
|
|
26672
27383
|
|
|
26673
27384
|
case 6:
|
|
26674
|
-
|
|
27385
|
+
_context47.next = 8;
|
|
26675
27386
|
return this.poolLogic.mintManagerFee(options);
|
|
26676
27387
|
|
|
26677
27388
|
case 8:
|
|
26678
|
-
tx =
|
|
26679
|
-
return
|
|
27389
|
+
tx = _context47.sent;
|
|
27390
|
+
return _context47.abrupt("return", tx);
|
|
26680
27391
|
|
|
26681
27392
|
case 10:
|
|
26682
27393
|
case "end":
|
|
26683
|
-
return
|
|
27394
|
+
return _context47.stop();
|
|
26684
27395
|
}
|
|
26685
27396
|
}
|
|
26686
|
-
},
|
|
27397
|
+
}, _callee47, this);
|
|
26687
27398
|
}));
|
|
26688
27399
|
|
|
26689
|
-
function mintManagerFee(
|
|
27400
|
+
function mintManagerFee(_x238, _x239) {
|
|
26690
27401
|
return _mintManagerFee.apply(this, arguments);
|
|
26691
27402
|
}
|
|
26692
27403
|
|
|
@@ -26701,25 +27412,25 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26701
27412
|
_proto.getAvailableManagerFee =
|
|
26702
27413
|
/*#__PURE__*/
|
|
26703
27414
|
function () {
|
|
26704
|
-
var _getAvailableManagerFee = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
27415
|
+
var _getAvailableManagerFee = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee48() {
|
|
26705
27416
|
var fee;
|
|
26706
|
-
return runtime_1.wrap(function
|
|
27417
|
+
return runtime_1.wrap(function _callee48$(_context48) {
|
|
26707
27418
|
while (1) {
|
|
26708
|
-
switch (
|
|
27419
|
+
switch (_context48.prev = _context48.next) {
|
|
26709
27420
|
case 0:
|
|
26710
|
-
|
|
27421
|
+
_context48.next = 2;
|
|
26711
27422
|
return this.poolLogic.availableManagerFee();
|
|
26712
27423
|
|
|
26713
27424
|
case 2:
|
|
26714
|
-
fee =
|
|
26715
|
-
return
|
|
27425
|
+
fee = _context48.sent;
|
|
27426
|
+
return _context48.abrupt("return", ethers.BigNumber.from(fee));
|
|
26716
27427
|
|
|
26717
27428
|
case 4:
|
|
26718
27429
|
case "end":
|
|
26719
|
-
return
|
|
27430
|
+
return _context48.stop();
|
|
26720
27431
|
}
|
|
26721
27432
|
}
|
|
26722
|
-
},
|
|
27433
|
+
}, _callee48, this);
|
|
26723
27434
|
}));
|
|
26724
27435
|
|
|
26725
27436
|
function getAvailableManagerFee() {
|
|
@@ -26741,11 +27452,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26741
27452
|
_proto.vestTokens =
|
|
26742
27453
|
/*#__PURE__*/
|
|
26743
27454
|
function () {
|
|
26744
|
-
var _vestTokens = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
27455
|
+
var _vestTokens = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee49(tokenAddress, amount, options, estimateGas) {
|
|
26745
27456
|
var txData, tx;
|
|
26746
|
-
return runtime_1.wrap(function
|
|
27457
|
+
return runtime_1.wrap(function _callee49$(_context49) {
|
|
26747
27458
|
while (1) {
|
|
26748
|
-
switch (
|
|
27459
|
+
switch (_context49.prev = _context49.next) {
|
|
26749
27460
|
case 0:
|
|
26750
27461
|
if (options === void 0) {
|
|
26751
27462
|
options = null;
|
|
@@ -26755,27 +27466,27 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26755
27466
|
estimateGas = false;
|
|
26756
27467
|
}
|
|
26757
27468
|
|
|
26758
|
-
|
|
27469
|
+
_context49.next = 4;
|
|
26759
27470
|
return getCreateVestTxData(amount);
|
|
26760
27471
|
|
|
26761
27472
|
case 4:
|
|
26762
|
-
txData =
|
|
26763
|
-
|
|
27473
|
+
txData = _context49.sent;
|
|
27474
|
+
_context49.next = 7;
|
|
26764
27475
|
return getPoolTxOrGasEstimate(this, [tokenAddress, txData, options], estimateGas);
|
|
26765
27476
|
|
|
26766
27477
|
case 7:
|
|
26767
|
-
tx =
|
|
26768
|
-
return
|
|
27478
|
+
tx = _context49.sent;
|
|
27479
|
+
return _context49.abrupt("return", tx);
|
|
26769
27480
|
|
|
26770
27481
|
case 9:
|
|
26771
27482
|
case "end":
|
|
26772
|
-
return
|
|
27483
|
+
return _context49.stop();
|
|
26773
27484
|
}
|
|
26774
27485
|
}
|
|
26775
|
-
},
|
|
27486
|
+
}, _callee49, this);
|
|
26776
27487
|
}));
|
|
26777
27488
|
|
|
26778
|
-
function vestTokens(
|
|
27489
|
+
function vestTokens(_x240, _x241, _x242, _x243) {
|
|
26779
27490
|
return _vestTokens.apply(this, arguments);
|
|
26780
27491
|
}
|
|
26781
27492
|
|
|
@@ -26794,11 +27505,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26794
27505
|
_proto.exitVestedToken =
|
|
26795
27506
|
/*#__PURE__*/
|
|
26796
27507
|
function () {
|
|
26797
|
-
var _exitVestedToken = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
27508
|
+
var _exitVestedToken = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee50(tokenAddress, id, options, estimateGas) {
|
|
26798
27509
|
var txData, tx;
|
|
26799
|
-
return runtime_1.wrap(function
|
|
27510
|
+
return runtime_1.wrap(function _callee50$(_context50) {
|
|
26800
27511
|
while (1) {
|
|
26801
|
-
switch (
|
|
27512
|
+
switch (_context50.prev = _context50.next) {
|
|
26802
27513
|
case 0:
|
|
26803
27514
|
if (options === void 0) {
|
|
26804
27515
|
options = null;
|
|
@@ -26808,27 +27519,27 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26808
27519
|
estimateGas = false;
|
|
26809
27520
|
}
|
|
26810
27521
|
|
|
26811
|
-
|
|
27522
|
+
_context50.next = 4;
|
|
26812
27523
|
return getExitVestTxData(id);
|
|
26813
27524
|
|
|
26814
27525
|
case 4:
|
|
26815
|
-
txData =
|
|
26816
|
-
|
|
27526
|
+
txData = _context50.sent;
|
|
27527
|
+
_context50.next = 7;
|
|
26817
27528
|
return getPoolTxOrGasEstimate(this, [tokenAddress, txData, options], estimateGas);
|
|
26818
27529
|
|
|
26819
27530
|
case 7:
|
|
26820
|
-
tx =
|
|
26821
|
-
return
|
|
27531
|
+
tx = _context50.sent;
|
|
27532
|
+
return _context50.abrupt("return", tx);
|
|
26822
27533
|
|
|
26823
27534
|
case 9:
|
|
26824
27535
|
case "end":
|
|
26825
|
-
return
|
|
27536
|
+
return _context50.stop();
|
|
26826
27537
|
}
|
|
26827
27538
|
}
|
|
26828
|
-
},
|
|
27539
|
+
}, _callee50, this);
|
|
26829
27540
|
}));
|
|
26830
27541
|
|
|
26831
|
-
function exitVestedToken(
|
|
27542
|
+
function exitVestedToken(_x244, _x245, _x246, _x247) {
|
|
26832
27543
|
return _exitVestedToken.apply(this, arguments);
|
|
26833
27544
|
}
|
|
26834
27545
|
|
|
@@ -26848,11 +27559,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26848
27559
|
_proto.mintUnitViaFlatMoney =
|
|
26849
27560
|
/*#__PURE__*/
|
|
26850
27561
|
function () {
|
|
26851
|
-
var _mintUnitViaFlatMoney2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
27562
|
+
var _mintUnitViaFlatMoney2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee51(depositAmount, slippage, maxKeeperFeeInUsd, options, estimateGas) {
|
|
26852
27563
|
var tx;
|
|
26853
|
-
return runtime_1.wrap(function
|
|
27564
|
+
return runtime_1.wrap(function _callee51$(_context51) {
|
|
26854
27565
|
while (1) {
|
|
26855
|
-
switch (
|
|
27566
|
+
switch (_context51.prev = _context51.next) {
|
|
26856
27567
|
case 0:
|
|
26857
27568
|
if (slippage === void 0) {
|
|
26858
27569
|
slippage = 0.5;
|
|
@@ -26866,22 +27577,22 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26866
27577
|
estimateGas = false;
|
|
26867
27578
|
}
|
|
26868
27579
|
|
|
26869
|
-
|
|
27580
|
+
_context51.next = 5;
|
|
26870
27581
|
return mintUnitViaFlatMoney(this, depositAmount, slippage, maxKeeperFeeInUsd, options, estimateGas);
|
|
26871
27582
|
|
|
26872
27583
|
case 5:
|
|
26873
|
-
tx =
|
|
26874
|
-
return
|
|
27584
|
+
tx = _context51.sent;
|
|
27585
|
+
return _context51.abrupt("return", tx);
|
|
26875
27586
|
|
|
26876
27587
|
case 7:
|
|
26877
27588
|
case "end":
|
|
26878
|
-
return
|
|
27589
|
+
return _context51.stop();
|
|
26879
27590
|
}
|
|
26880
27591
|
}
|
|
26881
|
-
},
|
|
27592
|
+
}, _callee51, this);
|
|
26882
27593
|
}));
|
|
26883
27594
|
|
|
26884
|
-
function mintUnitViaFlatMoney$1(
|
|
27595
|
+
function mintUnitViaFlatMoney$1(_x248, _x249, _x250, _x251, _x252) {
|
|
26885
27596
|
return _mintUnitViaFlatMoney2.apply(this, arguments);
|
|
26886
27597
|
}
|
|
26887
27598
|
|
|
@@ -26901,11 +27612,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26901
27612
|
_proto.redeemUnitViaFlatMoney =
|
|
26902
27613
|
/*#__PURE__*/
|
|
26903
27614
|
function () {
|
|
26904
|
-
var _redeemUnitViaFlatMoney2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
27615
|
+
var _redeemUnitViaFlatMoney2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee52(withdrawAmount, slippage, maxKeeperFeeInUsd, options, estimateGas) {
|
|
26905
27616
|
var tx;
|
|
26906
|
-
return runtime_1.wrap(function
|
|
27617
|
+
return runtime_1.wrap(function _callee52$(_context52) {
|
|
26907
27618
|
while (1) {
|
|
26908
|
-
switch (
|
|
27619
|
+
switch (_context52.prev = _context52.next) {
|
|
26909
27620
|
case 0:
|
|
26910
27621
|
if (slippage === void 0) {
|
|
26911
27622
|
slippage = 0.5;
|
|
@@ -26919,22 +27630,22 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26919
27630
|
estimateGas = false;
|
|
26920
27631
|
}
|
|
26921
27632
|
|
|
26922
|
-
|
|
27633
|
+
_context52.next = 5;
|
|
26923
27634
|
return redeemUnitViaFlatMoney(this, withdrawAmount, slippage, maxKeeperFeeInUsd, options, estimateGas);
|
|
26924
27635
|
|
|
26925
27636
|
case 5:
|
|
26926
|
-
tx =
|
|
26927
|
-
return
|
|
27637
|
+
tx = _context52.sent;
|
|
27638
|
+
return _context52.abrupt("return", tx);
|
|
26928
27639
|
|
|
26929
27640
|
case 7:
|
|
26930
27641
|
case "end":
|
|
26931
|
-
return
|
|
27642
|
+
return _context52.stop();
|
|
26932
27643
|
}
|
|
26933
27644
|
}
|
|
26934
|
-
},
|
|
27645
|
+
}, _callee52, this);
|
|
26935
27646
|
}));
|
|
26936
27647
|
|
|
26937
|
-
function redeemUnitViaFlatMoney$1(
|
|
27648
|
+
function redeemUnitViaFlatMoney$1(_x253, _x254, _x255, _x256, _x257) {
|
|
26938
27649
|
return _redeemUnitViaFlatMoney2.apply(this, arguments);
|
|
26939
27650
|
}
|
|
26940
27651
|
|
|
@@ -26942,11 +27653,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26942
27653
|
}();
|
|
26943
27654
|
|
|
26944
27655
|
_proto.cancelOrderViaFlatMoney = /*#__PURE__*/function () {
|
|
26945
|
-
var _cancelOrderViaFlatMoney2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
27656
|
+
var _cancelOrderViaFlatMoney2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee53(options, estimateGas) {
|
|
26946
27657
|
var tx;
|
|
26947
|
-
return runtime_1.wrap(function
|
|
27658
|
+
return runtime_1.wrap(function _callee53$(_context53) {
|
|
26948
27659
|
while (1) {
|
|
26949
|
-
switch (
|
|
27660
|
+
switch (_context53.prev = _context53.next) {
|
|
26950
27661
|
case 0:
|
|
26951
27662
|
if (options === void 0) {
|
|
26952
27663
|
options = null;
|
|
@@ -26956,22 +27667,22 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26956
27667
|
estimateGas = false;
|
|
26957
27668
|
}
|
|
26958
27669
|
|
|
26959
|
-
|
|
27670
|
+
_context53.next = 4;
|
|
26960
27671
|
return cancelOrderViaFlatMoney(this, options, estimateGas);
|
|
26961
27672
|
|
|
26962
27673
|
case 4:
|
|
26963
|
-
tx =
|
|
26964
|
-
return
|
|
27674
|
+
tx = _context53.sent;
|
|
27675
|
+
return _context53.abrupt("return", tx);
|
|
26965
27676
|
|
|
26966
27677
|
case 6:
|
|
26967
27678
|
case "end":
|
|
26968
|
-
return
|
|
27679
|
+
return _context53.stop();
|
|
26969
27680
|
}
|
|
26970
27681
|
}
|
|
26971
|
-
},
|
|
27682
|
+
}, _callee53, this);
|
|
26972
27683
|
}));
|
|
26973
27684
|
|
|
26974
|
-
function cancelOrderViaFlatMoney$1(
|
|
27685
|
+
function cancelOrderViaFlatMoney$1(_x258, _x259) {
|
|
26975
27686
|
return _cancelOrderViaFlatMoney2.apply(this, arguments);
|
|
26976
27687
|
}
|
|
26977
27688
|
|