@dhedge/v2-sdk 1.10.4 → 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 +12 -2
- package/dist/services/ramses/vesting.d.ts +1 -0
- package/dist/services/uniswap/V3Liquidity.d.ts +2 -2
- package/dist/types.d.ts +2 -1
- package/dist/v2-sdk.cjs.development.js +772 -223
- 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 +772 -223
- package/dist/v2-sdk.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/abi/IRamsesNonfungiblePositionManager.json +486 -0
- package/src/config.ts +2 -1
- package/src/entities/pool.ts +35 -3
- package/src/services/ramses/vesting.ts +11 -0
- package/src/services/uniswap/V3Liquidity.ts +14 -4
- package/src/test/constants.ts +1 -1
- 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
|
{
|
|
@@ -25733,7 +26233,7 @@ var Pool = /*#__PURE__*/function () {
|
|
|
25733
26233
|
}()
|
|
25734
26234
|
/**
|
|
25735
26235
|
* Create UniswapV3 liquidity pool
|
|
25736
|
-
* @param {dapp} Platform UniswapV3, VelodromeCL or
|
|
26236
|
+
* @param {dapp} Platform UniswapV3, VelodromeCL, AerodromeCL or RamesesCL
|
|
25737
26237
|
* @param {string} assetA First asset
|
|
25738
26238
|
* @param {string} assetB Second asset
|
|
25739
26239
|
* @param {BigNumber | string} amountA Amount first asset
|
|
@@ -25842,7 +26342,7 @@ var Pool = /*#__PURE__*/function () {
|
|
|
25842
26342
|
|
|
25843
26343
|
isStaked = false;
|
|
25844
26344
|
_context31.t0 = dapp;
|
|
25845
|
-
_context31.next = _context31.t0 === exports.Dapp.UNISWAPV3 ? 7 : _context31.t0 === exports.Dapp.VELODROMECL ? 9 : _context31.t0 === exports.Dapp.AERODROMECL ? 9 : _context31.t0 === exports.Dapp.ARRAKIS ? 14 : 16;
|
|
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;
|
|
25846
26346
|
break;
|
|
25847
26347
|
|
|
25848
26348
|
case 7:
|
|
@@ -25943,7 +26443,7 @@ var Pool = /*#__PURE__*/function () {
|
|
|
25943
26443
|
|
|
25944
26444
|
isStaked = false;
|
|
25945
26445
|
_context32.t0 = dapp;
|
|
25946
|
-
_context32.next = _context32.t0 === exports.Dapp.UNISWAPV3 ? 6 : _context32.t0 === exports.Dapp.VELODROMECL ? 8 : _context32.t0 === exports.Dapp.AERODROMECL ? 8 : _context32.t0 === exports.Dapp.ARRAKIS ? 13 : 15;
|
|
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;
|
|
25947
26447
|
break;
|
|
25948
26448
|
|
|
25949
26449
|
case 6:
|
|
@@ -26042,7 +26542,7 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26042
26542
|
|
|
26043
26543
|
iNonfungiblePositionManager = new ethers.ethers.utils.Interface(INonfungiblePositionManager.abi);
|
|
26044
26544
|
_context33.t0 = dapp;
|
|
26045
|
-
_context33.next = _context33.t0 === exports.Dapp.UNISWAPV3 ? 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;
|
|
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;
|
|
26046
26546
|
break;
|
|
26047
26547
|
|
|
26048
26548
|
case 6:
|
|
@@ -26110,32 +26610,25 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26110
26610
|
return claimFees;
|
|
26111
26611
|
}()
|
|
26112
26612
|
/**
|
|
26113
|
-
*
|
|
26114
|
-
* @param {Dapp} dapp Platform
|
|
26115
|
-
* @param {string}
|
|
26116
|
-
* @param {string}
|
|
26117
|
-
* @param {
|
|
26118
|
-
* @param { FeeAmount } feeAmount Fee tier (Low 0.05%, Medium 0.3%, High 1%)
|
|
26119
|
-
* @param {number} slippage Slippage tolerance in %
|
|
26120
|
-
* @param {any} options Transaction options
|
|
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
|
|
26121
26618
|
* @param {boolean} estimateGas Simulate/estimate gas
|
|
26122
26619
|
* @returns {Promise<any>} Transaction
|
|
26123
26620
|
*/
|
|
26124
26621
|
;
|
|
26125
26622
|
|
|
26126
|
-
_proto.
|
|
26623
|
+
_proto.getRewards =
|
|
26127
26624
|
/*#__PURE__*/
|
|
26128
26625
|
function () {
|
|
26129
|
-
var
|
|
26130
|
-
var
|
|
26626
|
+
var _getRewards = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee34(dapp, tokenId, rewards, options, estimateGas) {
|
|
26627
|
+
var tx;
|
|
26131
26628
|
return runtime_1.wrap(function _callee34$(_context34) {
|
|
26132
26629
|
while (1) {
|
|
26133
26630
|
switch (_context34.prev = _context34.next) {
|
|
26134
26631
|
case 0:
|
|
26135
|
-
if (slippage === void 0) {
|
|
26136
|
-
slippage = 0.5;
|
|
26137
|
-
}
|
|
26138
|
-
|
|
26139
26632
|
if (options === void 0) {
|
|
26140
26633
|
options = null;
|
|
26141
26634
|
}
|
|
@@ -26144,19 +26637,14 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26144
26637
|
estimateGas = false;
|
|
26145
26638
|
}
|
|
26146
26639
|
|
|
26147
|
-
_context34.next =
|
|
26148
|
-
return
|
|
26149
|
-
|
|
26150
|
-
case 5:
|
|
26151
|
-
swapxData = _context34.sent;
|
|
26152
|
-
_context34.next = 8;
|
|
26153
|
-
return getPoolTxOrGasEstimate(this, [routerAddress[this.network][exports.Dapp.UNISWAPV3], swapxData, options], estimateGas);
|
|
26640
|
+
_context34.next = 4;
|
|
26641
|
+
return getPoolTxOrGasEstimate(this, [nonfungiblePositionManagerAddress[this.network][dapp], getRewardsTxDta(tokenId, rewards), options], estimateGas);
|
|
26154
26642
|
|
|
26155
|
-
case
|
|
26643
|
+
case 4:
|
|
26156
26644
|
tx = _context34.sent;
|
|
26157
26645
|
return _context34.abrupt("return", tx);
|
|
26158
26646
|
|
|
26159
|
-
case
|
|
26647
|
+
case 6:
|
|
26160
26648
|
case "end":
|
|
26161
26649
|
return _context34.stop();
|
|
26162
26650
|
}
|
|
@@ -26164,34 +26652,39 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26164
26652
|
}, _callee34, this);
|
|
26165
26653
|
}));
|
|
26166
26654
|
|
|
26167
|
-
function
|
|
26168
|
-
return
|
|
26655
|
+
function getRewards(_x162, _x163, _x164, _x165, _x166) {
|
|
26656
|
+
return _getRewards.apply(this, arguments);
|
|
26169
26657
|
}
|
|
26170
26658
|
|
|
26171
|
-
return
|
|
26659
|
+
return getRewards;
|
|
26172
26660
|
}()
|
|
26173
26661
|
/**
|
|
26174
|
-
*
|
|
26175
|
-
* @param {
|
|
26176
|
-
* @param {string}
|
|
26177
|
-
* @param {
|
|
26178
|
-
* @param {BigNumber | string}
|
|
26179
|
-
* @param {
|
|
26662
|
+
* Trade an asset into another asset
|
|
26663
|
+
* @param {Dapp} dapp Platform like Sushiswap or Uniswap
|
|
26664
|
+
* @param {string} assetFrom Asset to trade from
|
|
26665
|
+
* @param {string} assetTo Asset to trade into
|
|
26666
|
+
* @param {BigNumber | string} amountIn Amount
|
|
26667
|
+
* @param { FeeAmount } feeAmount Fee tier (Low 0.05%, Medium 0.3%, High 1%)
|
|
26668
|
+
* @param {number} slippage Slippage tolerance in %
|
|
26180
26669
|
* @param {any} options Transaction options
|
|
26181
26670
|
* @param {boolean} estimateGas Simulate/estimate gas
|
|
26182
26671
|
* @returns {Promise<any>} Transaction
|
|
26183
26672
|
*/
|
|
26184
26673
|
;
|
|
26185
26674
|
|
|
26186
|
-
_proto.
|
|
26675
|
+
_proto.tradeUniswapV3 =
|
|
26187
26676
|
/*#__PURE__*/
|
|
26188
26677
|
function () {
|
|
26189
|
-
var
|
|
26190
|
-
var tx;
|
|
26678
|
+
var _tradeUniswapV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee35(assetFrom, assetTo, amountIn, feeAmount, slippage, options, estimateGas) {
|
|
26679
|
+
var swapxData, tx;
|
|
26191
26680
|
return runtime_1.wrap(function _callee35$(_context35) {
|
|
26192
26681
|
while (1) {
|
|
26193
26682
|
switch (_context35.prev = _context35.next) {
|
|
26194
26683
|
case 0:
|
|
26684
|
+
if (slippage === void 0) {
|
|
26685
|
+
slippage = 0.5;
|
|
26686
|
+
}
|
|
26687
|
+
|
|
26195
26688
|
if (options === void 0) {
|
|
26196
26689
|
options = null;
|
|
26197
26690
|
}
|
|
@@ -26200,25 +26693,19 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26200
26693
|
estimateGas = false;
|
|
26201
26694
|
}
|
|
26202
26695
|
|
|
26203
|
-
_context35.
|
|
26204
|
-
|
|
26205
|
-
_context35.t2 = routerAddress[this.network][exports.Dapp.VELODROME];
|
|
26206
|
-
_context35.next = 7;
|
|
26207
|
-
return getVelodromeAddLiquidityTxData(this, assetA, assetB, amountA, amountB, isStable);
|
|
26696
|
+
_context35.next = 5;
|
|
26697
|
+
return getUniswapV3SwapTxData(this, assetFrom, assetTo, amountIn, slippage, feeAmount);
|
|
26208
26698
|
|
|
26209
|
-
case
|
|
26210
|
-
|
|
26211
|
-
_context35.
|
|
26212
|
-
|
|
26213
|
-
_context35.t6 = estimateGas;
|
|
26214
|
-
_context35.next = 13;
|
|
26215
|
-
return (0, _context35.t0)(_context35.t1, _context35.t5, _context35.t6);
|
|
26699
|
+
case 5:
|
|
26700
|
+
swapxData = _context35.sent;
|
|
26701
|
+
_context35.next = 8;
|
|
26702
|
+
return getPoolTxOrGasEstimate(this, [routerAddress[this.network][exports.Dapp.UNISWAPV3], swapxData, options], estimateGas);
|
|
26216
26703
|
|
|
26217
|
-
case
|
|
26704
|
+
case 8:
|
|
26218
26705
|
tx = _context35.sent;
|
|
26219
26706
|
return _context35.abrupt("return", tx);
|
|
26220
26707
|
|
|
26221
|
-
case
|
|
26708
|
+
case 10:
|
|
26222
26709
|
case "end":
|
|
26223
26710
|
return _context35.stop();
|
|
26224
26711
|
}
|
|
@@ -26226,17 +26713,18 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26226
26713
|
}, _callee35, this);
|
|
26227
26714
|
}));
|
|
26228
26715
|
|
|
26229
|
-
function
|
|
26230
|
-
return
|
|
26716
|
+
function tradeUniswapV3(_x167, _x168, _x169, _x170, _x171, _x172, _x173) {
|
|
26717
|
+
return _tradeUniswapV.apply(this, arguments);
|
|
26231
26718
|
}
|
|
26232
26719
|
|
|
26233
|
-
return
|
|
26720
|
+
return tradeUniswapV3;
|
|
26234
26721
|
}()
|
|
26235
26722
|
/**
|
|
26236
|
-
*
|
|
26723
|
+
* Add liquidity to Velodrome pool
|
|
26237
26724
|
* @param {string} assetA First asset
|
|
26238
26725
|
* @param {string} assetB Second asset
|
|
26239
|
-
* @param {BigNumber | string}
|
|
26726
|
+
* @param {BigNumber | string} amountA Amount first asset
|
|
26727
|
+
* @param {BigNumber | string} amountB Amount second asset
|
|
26240
26728
|
* @param { boolean } isStable Is stable pool
|
|
26241
26729
|
* @param {any} options Transaction options
|
|
26242
26730
|
* @param {boolean} estimateGas Simulate/estimate gas
|
|
@@ -26244,10 +26732,10 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26244
26732
|
*/
|
|
26245
26733
|
;
|
|
26246
26734
|
|
|
26247
|
-
_proto.
|
|
26735
|
+
_proto.addLiquidityVelodrome =
|
|
26248
26736
|
/*#__PURE__*/
|
|
26249
26737
|
function () {
|
|
26250
|
-
var
|
|
26738
|
+
var _addLiquidityVelodrome = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee36(assetA, assetB, amountA, amountB, isStable, options, estimateGas) {
|
|
26251
26739
|
var tx;
|
|
26252
26740
|
return runtime_1.wrap(function _callee36$(_context36) {
|
|
26253
26741
|
while (1) {
|
|
@@ -26265,7 +26753,7 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26265
26753
|
_context36.t1 = this;
|
|
26266
26754
|
_context36.t2 = routerAddress[this.network][exports.Dapp.VELODROME];
|
|
26267
26755
|
_context36.next = 7;
|
|
26268
|
-
return
|
|
26756
|
+
return getVelodromeAddLiquidityTxData(this, assetA, assetB, amountA, amountB, isStable);
|
|
26269
26757
|
|
|
26270
26758
|
case 7:
|
|
26271
26759
|
_context36.t3 = _context36.sent;
|
|
@@ -26287,18 +26775,17 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26287
26775
|
}, _callee36, this);
|
|
26288
26776
|
}));
|
|
26289
26777
|
|
|
26290
|
-
function
|
|
26291
|
-
return
|
|
26778
|
+
function addLiquidityVelodrome(_x174, _x175, _x176, _x177, _x178, _x179, _x180) {
|
|
26779
|
+
return _addLiquidityVelodrome.apply(this, arguments);
|
|
26292
26780
|
}
|
|
26293
26781
|
|
|
26294
|
-
return
|
|
26782
|
+
return addLiquidityVelodrome;
|
|
26295
26783
|
}()
|
|
26296
26784
|
/**
|
|
26297
|
-
*
|
|
26785
|
+
* Remove liquidity from Velodrome pool
|
|
26298
26786
|
* @param {string} assetA First asset
|
|
26299
26787
|
* @param {string} assetB Second asset
|
|
26300
|
-
* @param {BigNumber | string}
|
|
26301
|
-
* @param {BigNumber | string} amountB Amount second asset
|
|
26788
|
+
* @param {BigNumber | string} amount Amount of LP tokens
|
|
26302
26789
|
* @param { boolean } isStable Is stable pool
|
|
26303
26790
|
* @param {any} options Transaction options
|
|
26304
26791
|
* @param {boolean} estimateGas Simulate/estimate gas
|
|
@@ -26306,10 +26793,10 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26306
26793
|
*/
|
|
26307
26794
|
;
|
|
26308
26795
|
|
|
26309
|
-
_proto.
|
|
26796
|
+
_proto.removeLiquidityVelodrome =
|
|
26310
26797
|
/*#__PURE__*/
|
|
26311
26798
|
function () {
|
|
26312
|
-
var
|
|
26799
|
+
var _removeLiquidityVelodrome = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee37(assetA, assetB, amount, isStable, options, estimateGas) {
|
|
26313
26800
|
var tx;
|
|
26314
26801
|
return runtime_1.wrap(function _callee37$(_context37) {
|
|
26315
26802
|
while (1) {
|
|
@@ -26325,9 +26812,9 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26325
26812
|
|
|
26326
26813
|
_context37.t0 = getPoolTxOrGasEstimate;
|
|
26327
26814
|
_context37.t1 = this;
|
|
26328
|
-
_context37.t2 = routerAddress[this.network][exports.Dapp.
|
|
26815
|
+
_context37.t2 = routerAddress[this.network][exports.Dapp.VELODROME];
|
|
26329
26816
|
_context37.next = 7;
|
|
26330
|
-
return
|
|
26817
|
+
return getVelodromeRemoveLiquidityTxData(this, assetA, assetB, amount, isStable);
|
|
26331
26818
|
|
|
26332
26819
|
case 7:
|
|
26333
26820
|
_context37.t3 = _context37.sent;
|
|
@@ -26349,17 +26836,18 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26349
26836
|
}, _callee37, this);
|
|
26350
26837
|
}));
|
|
26351
26838
|
|
|
26352
|
-
function
|
|
26353
|
-
return
|
|
26839
|
+
function removeLiquidityVelodrome(_x181, _x182, _x183, _x184, _x185, _x186) {
|
|
26840
|
+
return _removeLiquidityVelodrome.apply(this, arguments);
|
|
26354
26841
|
}
|
|
26355
26842
|
|
|
26356
|
-
return
|
|
26843
|
+
return removeLiquidityVelodrome;
|
|
26357
26844
|
}()
|
|
26358
26845
|
/**
|
|
26359
|
-
*
|
|
26846
|
+
* Add liquidity to Velodrome V2 pool
|
|
26360
26847
|
* @param {string} assetA First asset
|
|
26361
26848
|
* @param {string} assetB Second asset
|
|
26362
|
-
* @param {BigNumber | string}
|
|
26849
|
+
* @param {BigNumber | string} amountA Amount first asset
|
|
26850
|
+
* @param {BigNumber | string} amountB Amount second asset
|
|
26363
26851
|
* @param { boolean } isStable Is stable pool
|
|
26364
26852
|
* @param {any} options Transaction options
|
|
26365
26853
|
* @param {boolean} estimateGas Simulate/estimate gas
|
|
@@ -26367,10 +26855,10 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26367
26855
|
*/
|
|
26368
26856
|
;
|
|
26369
26857
|
|
|
26370
|
-
_proto.
|
|
26858
|
+
_proto.addLiquidityVelodromeV2 =
|
|
26371
26859
|
/*#__PURE__*/
|
|
26372
26860
|
function () {
|
|
26373
|
-
var
|
|
26861
|
+
var _addLiquidityVelodromeV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee38(assetA, assetB, amountA, amountB, isStable, options, estimateGas) {
|
|
26374
26862
|
var tx;
|
|
26375
26863
|
return runtime_1.wrap(function _callee38$(_context38) {
|
|
26376
26864
|
while (1) {
|
|
@@ -26388,7 +26876,7 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26388
26876
|
_context38.t1 = this;
|
|
26389
26877
|
_context38.t2 = routerAddress[this.network][exports.Dapp.VELODROMEV2];
|
|
26390
26878
|
_context38.next = 7;
|
|
26391
|
-
return
|
|
26879
|
+
return getVelodromeAddLiquidityTxData(this, assetA, assetB, amountA, amountB, isStable);
|
|
26392
26880
|
|
|
26393
26881
|
case 7:
|
|
26394
26882
|
_context38.t3 = _context38.sent;
|
|
@@ -26410,19 +26898,17 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26410
26898
|
}, _callee38, this);
|
|
26411
26899
|
}));
|
|
26412
26900
|
|
|
26413
|
-
function
|
|
26414
|
-
return
|
|
26901
|
+
function addLiquidityVelodromeV2(_x187, _x188, _x189, _x190, _x191, _x192, _x193) {
|
|
26902
|
+
return _addLiquidityVelodromeV.apply(this, arguments);
|
|
26415
26903
|
}
|
|
26416
26904
|
|
|
26417
|
-
return
|
|
26905
|
+
return addLiquidityVelodromeV2;
|
|
26418
26906
|
}()
|
|
26419
26907
|
/**
|
|
26420
|
-
*
|
|
26421
|
-
* @param {Dapp} dapp VelodromeV2, Ramses or Aerodrome
|
|
26908
|
+
* Remove liquidity from Velodrome V2 pool
|
|
26422
26909
|
* @param {string} assetA First asset
|
|
26423
26910
|
* @param {string} assetB Second asset
|
|
26424
|
-
* @param {BigNumber | string}
|
|
26425
|
-
* @param {BigNumber | string} amountB Amount second asset
|
|
26911
|
+
* @param {BigNumber | string} amount Amount of LP tokens
|
|
26426
26912
|
* @param { boolean } isStable Is stable pool
|
|
26427
26913
|
* @param {any} options Transaction options
|
|
26428
26914
|
* @param {boolean} estimateGas Simulate/estimate gas
|
|
@@ -26430,10 +26916,10 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26430
26916
|
*/
|
|
26431
26917
|
;
|
|
26432
26918
|
|
|
26433
|
-
_proto.
|
|
26919
|
+
_proto.removeLiquidityVelodromeV2 =
|
|
26434
26920
|
/*#__PURE__*/
|
|
26435
26921
|
function () {
|
|
26436
|
-
var
|
|
26922
|
+
var _removeLiquidityVelodromeV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee39(assetA, assetB, amount, isStable, options, estimateGas) {
|
|
26437
26923
|
var tx;
|
|
26438
26924
|
return runtime_1.wrap(function _callee39$(_context39) {
|
|
26439
26925
|
while (1) {
|
|
@@ -26449,9 +26935,9 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26449
26935
|
|
|
26450
26936
|
_context39.t0 = getPoolTxOrGasEstimate;
|
|
26451
26937
|
_context39.t1 = this;
|
|
26452
|
-
_context39.t2 = routerAddress[this.network][
|
|
26938
|
+
_context39.t2 = routerAddress[this.network][exports.Dapp.VELODROMEV2];
|
|
26453
26939
|
_context39.next = 7;
|
|
26454
|
-
return
|
|
26940
|
+
return getVelodromeRemoveLiquidityTxData(this, assetA, assetB, amount, isStable);
|
|
26455
26941
|
|
|
26456
26942
|
case 7:
|
|
26457
26943
|
_context39.t3 = _context39.sent;
|
|
@@ -26473,18 +26959,19 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26473
26959
|
}, _callee39, this);
|
|
26474
26960
|
}));
|
|
26475
26961
|
|
|
26476
|
-
function
|
|
26477
|
-
return
|
|
26962
|
+
function removeLiquidityVelodromeV2(_x194, _x195, _x196, _x197, _x198, _x199) {
|
|
26963
|
+
return _removeLiquidityVelodromeV.apply(this, arguments);
|
|
26478
26964
|
}
|
|
26479
26965
|
|
|
26480
|
-
return
|
|
26966
|
+
return removeLiquidityVelodromeV2;
|
|
26481
26967
|
}()
|
|
26482
26968
|
/**
|
|
26483
|
-
*
|
|
26969
|
+
* Add liquidity to Velodrome V2 or Ramses pool
|
|
26484
26970
|
* @param {Dapp} dapp VelodromeV2, Ramses or Aerodrome
|
|
26485
26971
|
* @param {string} assetA First asset
|
|
26486
26972
|
* @param {string} assetB Second asset
|
|
26487
|
-
* @param {BigNumber | string}
|
|
26973
|
+
* @param {BigNumber | string} amountA Amount first asset
|
|
26974
|
+
* @param {BigNumber | string} amountB Amount second asset
|
|
26488
26975
|
* @param { boolean } isStable Is stable pool
|
|
26489
26976
|
* @param {any} options Transaction options
|
|
26490
26977
|
* @param {boolean} estimateGas Simulate/estimate gas
|
|
@@ -26492,10 +26979,10 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26492
26979
|
*/
|
|
26493
26980
|
;
|
|
26494
26981
|
|
|
26495
|
-
_proto.
|
|
26982
|
+
_proto.addLiquidityV2 =
|
|
26496
26983
|
/*#__PURE__*/
|
|
26497
26984
|
function () {
|
|
26498
|
-
var
|
|
26985
|
+
var _addLiquidityV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee40(dapp, assetA, assetB, amountA, amountB, isStable, options, estimateGas) {
|
|
26499
26986
|
var tx;
|
|
26500
26987
|
return runtime_1.wrap(function _callee40$(_context40) {
|
|
26501
26988
|
while (1) {
|
|
@@ -26513,7 +27000,7 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26513
27000
|
_context40.t1 = this;
|
|
26514
27001
|
_context40.t2 = routerAddress[this.network][dapp];
|
|
26515
27002
|
_context40.next = 7;
|
|
26516
|
-
return
|
|
27003
|
+
return getVelodromeAddLiquidityTxData(this, assetA, assetB, amountA, amountB, isStable);
|
|
26517
27004
|
|
|
26518
27005
|
case 7:
|
|
26519
27006
|
_context40.t3 = _context40.sent;
|
|
@@ -26535,7 +27022,69 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26535
27022
|
}, _callee40, this);
|
|
26536
27023
|
}));
|
|
26537
27024
|
|
|
26538
|
-
function
|
|
27025
|
+
function addLiquidityV2(_x200, _x201, _x202, _x203, _x204, _x205, _x206, _x207) {
|
|
27026
|
+
return _addLiquidityV.apply(this, arguments);
|
|
27027
|
+
}
|
|
27028
|
+
|
|
27029
|
+
return addLiquidityV2;
|
|
27030
|
+
}()
|
|
27031
|
+
/**
|
|
27032
|
+
* Remove liquidity from Velodrome V2 or Ramses pool
|
|
27033
|
+
* @param {Dapp} dapp VelodromeV2, Ramses or Aerodrome
|
|
27034
|
+
* @param {string} assetA First asset
|
|
27035
|
+
* @param {string} assetB Second asset
|
|
27036
|
+
* @param {BigNumber | string} amount Amount of LP tokens
|
|
27037
|
+
* @param { boolean } isStable Is stable pool
|
|
27038
|
+
* @param {any} options Transaction options
|
|
27039
|
+
* @param {boolean} estimateGas Simulate/estimate gas
|
|
27040
|
+
* @returns {Promise<any>} Transaction
|
|
27041
|
+
*/
|
|
27042
|
+
;
|
|
27043
|
+
|
|
27044
|
+
_proto.removeLiquidityV2 =
|
|
27045
|
+
/*#__PURE__*/
|
|
27046
|
+
function () {
|
|
27047
|
+
var _removeLiquidityV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee41(dapp, assetA, assetB, amount, isStable, options, estimateGas) {
|
|
27048
|
+
var tx;
|
|
27049
|
+
return runtime_1.wrap(function _callee41$(_context41) {
|
|
27050
|
+
while (1) {
|
|
27051
|
+
switch (_context41.prev = _context41.next) {
|
|
27052
|
+
case 0:
|
|
27053
|
+
if (options === void 0) {
|
|
27054
|
+
options = null;
|
|
27055
|
+
}
|
|
27056
|
+
|
|
27057
|
+
if (estimateGas === void 0) {
|
|
27058
|
+
estimateGas = false;
|
|
27059
|
+
}
|
|
27060
|
+
|
|
27061
|
+
_context41.t0 = getPoolTxOrGasEstimate;
|
|
27062
|
+
_context41.t1 = this;
|
|
27063
|
+
_context41.t2 = routerAddress[this.network][dapp];
|
|
27064
|
+
_context41.next = 7;
|
|
27065
|
+
return getVelodromeRemoveLiquidityTxData(this, assetA, assetB, amount, isStable);
|
|
27066
|
+
|
|
27067
|
+
case 7:
|
|
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);
|
|
27074
|
+
|
|
27075
|
+
case 13:
|
|
27076
|
+
tx = _context41.sent;
|
|
27077
|
+
return _context41.abrupt("return", tx);
|
|
27078
|
+
|
|
27079
|
+
case 15:
|
|
27080
|
+
case "end":
|
|
27081
|
+
return _context41.stop();
|
|
27082
|
+
}
|
|
27083
|
+
}
|
|
27084
|
+
}, _callee41, this);
|
|
27085
|
+
}));
|
|
27086
|
+
|
|
27087
|
+
function removeLiquidityV2(_x208, _x209, _x210, _x211, _x212, _x213, _x214) {
|
|
26539
27088
|
return _removeLiquidityV.apply(this, arguments);
|
|
26540
27089
|
}
|
|
26541
27090
|
|
|
@@ -26561,11 +27110,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26561
27110
|
_proto.tradeLyraOption =
|
|
26562
27111
|
/*#__PURE__*/
|
|
26563
27112
|
function () {
|
|
26564
|
-
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) {
|
|
26565
27114
|
var swapxData, tx;
|
|
26566
|
-
return runtime_1.wrap(function
|
|
27115
|
+
return runtime_1.wrap(function _callee42$(_context42) {
|
|
26567
27116
|
while (1) {
|
|
26568
|
-
switch (
|
|
27117
|
+
switch (_context42.prev = _context42.next) {
|
|
26569
27118
|
case 0:
|
|
26570
27119
|
if (collateralChangeAmount === void 0) {
|
|
26571
27120
|
collateralChangeAmount = "0";
|
|
@@ -26583,27 +27132,27 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26583
27132
|
estimateGas = false;
|
|
26584
27133
|
}
|
|
26585
27134
|
|
|
26586
|
-
|
|
27135
|
+
_context42.next = 6;
|
|
26587
27136
|
return getLyraOptionTxData(this, market, optionType, expiry, strike, tradeType, optionAmount, assetIn, ethers.BigNumber.from(collateralChangeAmount), isCoveredCall);
|
|
26588
27137
|
|
|
26589
27138
|
case 6:
|
|
26590
|
-
swapxData =
|
|
26591
|
-
|
|
27139
|
+
swapxData = _context42.sent;
|
|
27140
|
+
_context42.next = 9;
|
|
26592
27141
|
return getPoolTxOrGasEstimate(this, [routerAddress[this.network][exports.Dapp.LYRA], swapxData, options], estimateGas);
|
|
26593
27142
|
|
|
26594
27143
|
case 9:
|
|
26595
|
-
tx =
|
|
26596
|
-
return
|
|
27144
|
+
tx = _context42.sent;
|
|
27145
|
+
return _context42.abrupt("return", tx);
|
|
26597
27146
|
|
|
26598
27147
|
case 11:
|
|
26599
27148
|
case "end":
|
|
26600
|
-
return
|
|
27149
|
+
return _context42.stop();
|
|
26601
27150
|
}
|
|
26602
27151
|
}
|
|
26603
|
-
},
|
|
27152
|
+
}, _callee42, this);
|
|
26604
27153
|
}));
|
|
26605
27154
|
|
|
26606
|
-
function tradeLyraOption(
|
|
27155
|
+
function tradeLyraOption(_x215, _x216, _x217, _x218, _x219, _x220, _x221, _x222, _x223, _x224, _x225) {
|
|
26607
27156
|
return _tradeLyraOption.apply(this, arguments);
|
|
26608
27157
|
}
|
|
26609
27158
|
|
|
@@ -26618,26 +27167,26 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26618
27167
|
_proto.getLyraPositions =
|
|
26619
27168
|
/*#__PURE__*/
|
|
26620
27169
|
function () {
|
|
26621
|
-
var _getLyraPositions = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
26622
|
-
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) {
|
|
26623
27172
|
while (1) {
|
|
26624
|
-
switch (
|
|
27173
|
+
switch (_context43.prev = _context43.next) {
|
|
26625
27174
|
case 0:
|
|
26626
|
-
|
|
27175
|
+
_context43.next = 2;
|
|
26627
27176
|
return getOptionPositions(this, market);
|
|
26628
27177
|
|
|
26629
27178
|
case 2:
|
|
26630
|
-
return
|
|
27179
|
+
return _context43.abrupt("return", _context43.sent);
|
|
26631
27180
|
|
|
26632
27181
|
case 3:
|
|
26633
27182
|
case "end":
|
|
26634
|
-
return
|
|
27183
|
+
return _context43.stop();
|
|
26635
27184
|
}
|
|
26636
27185
|
}
|
|
26637
|
-
},
|
|
27186
|
+
}, _callee43, this);
|
|
26638
27187
|
}));
|
|
26639
27188
|
|
|
26640
|
-
function getLyraPositions(
|
|
27189
|
+
function getLyraPositions(_x226) {
|
|
26641
27190
|
return _getLyraPositions.apply(this, arguments);
|
|
26642
27191
|
}
|
|
26643
27192
|
|
|
@@ -26656,11 +27205,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26656
27205
|
_proto.changeFuturesMargin =
|
|
26657
27206
|
/*#__PURE__*/
|
|
26658
27207
|
function () {
|
|
26659
|
-
var _changeFuturesMargin = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
27208
|
+
var _changeFuturesMargin = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee44(market, changeAmount, options, estimateGas) {
|
|
26660
27209
|
var tx;
|
|
26661
|
-
return runtime_1.wrap(function
|
|
27210
|
+
return runtime_1.wrap(function _callee44$(_context44) {
|
|
26662
27211
|
while (1) {
|
|
26663
|
-
switch (
|
|
27212
|
+
switch (_context44.prev = _context44.next) {
|
|
26664
27213
|
case 0:
|
|
26665
27214
|
if (options === void 0) {
|
|
26666
27215
|
options = null;
|
|
@@ -26670,22 +27219,22 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26670
27219
|
estimateGas = false;
|
|
26671
27220
|
}
|
|
26672
27221
|
|
|
26673
|
-
|
|
27222
|
+
_context44.next = 4;
|
|
26674
27223
|
return getPoolTxOrGasEstimate(this, [market, getFuturesChangeMarginTxData(changeAmount), options], estimateGas);
|
|
26675
27224
|
|
|
26676
27225
|
case 4:
|
|
26677
|
-
tx =
|
|
26678
|
-
return
|
|
27226
|
+
tx = _context44.sent;
|
|
27227
|
+
return _context44.abrupt("return", tx);
|
|
26679
27228
|
|
|
26680
27229
|
case 6:
|
|
26681
27230
|
case "end":
|
|
26682
|
-
return
|
|
27231
|
+
return _context44.stop();
|
|
26683
27232
|
}
|
|
26684
27233
|
}
|
|
26685
|
-
},
|
|
27234
|
+
}, _callee44, this);
|
|
26686
27235
|
}));
|
|
26687
27236
|
|
|
26688
|
-
function changeFuturesMargin(
|
|
27237
|
+
function changeFuturesMargin(_x227, _x228, _x229, _x230) {
|
|
26689
27238
|
return _changeFuturesMargin.apply(this, arguments);
|
|
26690
27239
|
}
|
|
26691
27240
|
|
|
@@ -26704,11 +27253,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26704
27253
|
_proto.changeFuturesPosition =
|
|
26705
27254
|
/*#__PURE__*/
|
|
26706
27255
|
function () {
|
|
26707
|
-
var _changeFuturesPosition = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
27256
|
+
var _changeFuturesPosition = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee45(market, changeAmount, options, estimateGas) {
|
|
26708
27257
|
var txData, tx;
|
|
26709
|
-
return runtime_1.wrap(function
|
|
27258
|
+
return runtime_1.wrap(function _callee45$(_context45) {
|
|
26710
27259
|
while (1) {
|
|
26711
|
-
switch (
|
|
27260
|
+
switch (_context45.prev = _context45.next) {
|
|
26712
27261
|
case 0:
|
|
26713
27262
|
if (options === void 0) {
|
|
26714
27263
|
options = null;
|
|
@@ -26718,27 +27267,27 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26718
27267
|
estimateGas = false;
|
|
26719
27268
|
}
|
|
26720
27269
|
|
|
26721
|
-
|
|
27270
|
+
_context45.next = 4;
|
|
26722
27271
|
return getFuturesChangePositionTxData(changeAmount, market, this);
|
|
26723
27272
|
|
|
26724
27273
|
case 4:
|
|
26725
|
-
txData =
|
|
26726
|
-
|
|
27274
|
+
txData = _context45.sent;
|
|
27275
|
+
_context45.next = 7;
|
|
26727
27276
|
return getPoolTxOrGasEstimate(this, [market, txData, options], estimateGas);
|
|
26728
27277
|
|
|
26729
27278
|
case 7:
|
|
26730
|
-
tx =
|
|
26731
|
-
return
|
|
27279
|
+
tx = _context45.sent;
|
|
27280
|
+
return _context45.abrupt("return", tx);
|
|
26732
27281
|
|
|
26733
27282
|
case 9:
|
|
26734
27283
|
case "end":
|
|
26735
|
-
return
|
|
27284
|
+
return _context45.stop();
|
|
26736
27285
|
}
|
|
26737
27286
|
}
|
|
26738
|
-
},
|
|
27287
|
+
}, _callee45, this);
|
|
26739
27288
|
}));
|
|
26740
27289
|
|
|
26741
|
-
function changeFuturesPosition(
|
|
27290
|
+
function changeFuturesPosition(_x231, _x232, _x233, _x234) {
|
|
26742
27291
|
return _changeFuturesPosition.apply(this, arguments);
|
|
26743
27292
|
}
|
|
26744
27293
|
|
|
@@ -26756,11 +27305,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26756
27305
|
_proto.cancelFuturesOrder =
|
|
26757
27306
|
/*#__PURE__*/
|
|
26758
27307
|
function () {
|
|
26759
|
-
var _cancelFuturesOrder = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
27308
|
+
var _cancelFuturesOrder = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee46(market, options, estimateGas) {
|
|
26760
27309
|
var txData, tx;
|
|
26761
|
-
return runtime_1.wrap(function
|
|
27310
|
+
return runtime_1.wrap(function _callee46$(_context46) {
|
|
26762
27311
|
while (1) {
|
|
26763
|
-
switch (
|
|
27312
|
+
switch (_context46.prev = _context46.next) {
|
|
26764
27313
|
case 0:
|
|
26765
27314
|
if (options === void 0) {
|
|
26766
27315
|
options = null;
|
|
@@ -26770,27 +27319,27 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26770
27319
|
estimateGas = false;
|
|
26771
27320
|
}
|
|
26772
27321
|
|
|
26773
|
-
|
|
27322
|
+
_context46.next = 4;
|
|
26774
27323
|
return getFuturesCancelOrderTxData(this);
|
|
26775
27324
|
|
|
26776
27325
|
case 4:
|
|
26777
|
-
txData =
|
|
26778
|
-
|
|
27326
|
+
txData = _context46.sent;
|
|
27327
|
+
_context46.next = 7;
|
|
26779
27328
|
return getPoolTxOrGasEstimate(this, [market, txData, options], estimateGas);
|
|
26780
27329
|
|
|
26781
27330
|
case 7:
|
|
26782
|
-
tx =
|
|
26783
|
-
return
|
|
27331
|
+
tx = _context46.sent;
|
|
27332
|
+
return _context46.abrupt("return", tx);
|
|
26784
27333
|
|
|
26785
27334
|
case 9:
|
|
26786
27335
|
case "end":
|
|
26787
|
-
return
|
|
27336
|
+
return _context46.stop();
|
|
26788
27337
|
}
|
|
26789
27338
|
}
|
|
26790
|
-
},
|
|
27339
|
+
}, _callee46, this);
|
|
26791
27340
|
}));
|
|
26792
27341
|
|
|
26793
|
-
function cancelFuturesOrder(
|
|
27342
|
+
function cancelFuturesOrder(_x235, _x236, _x237) {
|
|
26794
27343
|
return _cancelFuturesOrder.apply(this, arguments);
|
|
26795
27344
|
}
|
|
26796
27345
|
|
|
@@ -26807,11 +27356,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26807
27356
|
_proto.mintManagerFee =
|
|
26808
27357
|
/*#__PURE__*/
|
|
26809
27358
|
function () {
|
|
26810
|
-
var _mintManagerFee = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
27359
|
+
var _mintManagerFee = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee47(options, estimateGas) {
|
|
26811
27360
|
var tx;
|
|
26812
|
-
return runtime_1.wrap(function
|
|
27361
|
+
return runtime_1.wrap(function _callee47$(_context47) {
|
|
26813
27362
|
while (1) {
|
|
26814
|
-
switch (
|
|
27363
|
+
switch (_context47.prev = _context47.next) {
|
|
26815
27364
|
case 0:
|
|
26816
27365
|
if (options === void 0) {
|
|
26817
27366
|
options = null;
|
|
@@ -26822,33 +27371,33 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26822
27371
|
}
|
|
26823
27372
|
|
|
26824
27373
|
if (!estimateGas) {
|
|
26825
|
-
|
|
27374
|
+
_context47.next = 6;
|
|
26826
27375
|
break;
|
|
26827
27376
|
}
|
|
26828
27377
|
|
|
26829
|
-
|
|
27378
|
+
_context47.next = 5;
|
|
26830
27379
|
return this.poolLogic.estimateGas.mintManagerFee(options);
|
|
26831
27380
|
|
|
26832
27381
|
case 5:
|
|
26833
|
-
return
|
|
27382
|
+
return _context47.abrupt("return", _context47.sent);
|
|
26834
27383
|
|
|
26835
27384
|
case 6:
|
|
26836
|
-
|
|
27385
|
+
_context47.next = 8;
|
|
26837
27386
|
return this.poolLogic.mintManagerFee(options);
|
|
26838
27387
|
|
|
26839
27388
|
case 8:
|
|
26840
|
-
tx =
|
|
26841
|
-
return
|
|
27389
|
+
tx = _context47.sent;
|
|
27390
|
+
return _context47.abrupt("return", tx);
|
|
26842
27391
|
|
|
26843
27392
|
case 10:
|
|
26844
27393
|
case "end":
|
|
26845
|
-
return
|
|
27394
|
+
return _context47.stop();
|
|
26846
27395
|
}
|
|
26847
27396
|
}
|
|
26848
|
-
},
|
|
27397
|
+
}, _callee47, this);
|
|
26849
27398
|
}));
|
|
26850
27399
|
|
|
26851
|
-
function mintManagerFee(
|
|
27400
|
+
function mintManagerFee(_x238, _x239) {
|
|
26852
27401
|
return _mintManagerFee.apply(this, arguments);
|
|
26853
27402
|
}
|
|
26854
27403
|
|
|
@@ -26863,25 +27412,25 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26863
27412
|
_proto.getAvailableManagerFee =
|
|
26864
27413
|
/*#__PURE__*/
|
|
26865
27414
|
function () {
|
|
26866
|
-
var _getAvailableManagerFee = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
27415
|
+
var _getAvailableManagerFee = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee48() {
|
|
26867
27416
|
var fee;
|
|
26868
|
-
return runtime_1.wrap(function
|
|
27417
|
+
return runtime_1.wrap(function _callee48$(_context48) {
|
|
26869
27418
|
while (1) {
|
|
26870
|
-
switch (
|
|
27419
|
+
switch (_context48.prev = _context48.next) {
|
|
26871
27420
|
case 0:
|
|
26872
|
-
|
|
27421
|
+
_context48.next = 2;
|
|
26873
27422
|
return this.poolLogic.availableManagerFee();
|
|
26874
27423
|
|
|
26875
27424
|
case 2:
|
|
26876
|
-
fee =
|
|
26877
|
-
return
|
|
27425
|
+
fee = _context48.sent;
|
|
27426
|
+
return _context48.abrupt("return", ethers.BigNumber.from(fee));
|
|
26878
27427
|
|
|
26879
27428
|
case 4:
|
|
26880
27429
|
case "end":
|
|
26881
|
-
return
|
|
27430
|
+
return _context48.stop();
|
|
26882
27431
|
}
|
|
26883
27432
|
}
|
|
26884
|
-
},
|
|
27433
|
+
}, _callee48, this);
|
|
26885
27434
|
}));
|
|
26886
27435
|
|
|
26887
27436
|
function getAvailableManagerFee() {
|
|
@@ -26903,11 +27452,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26903
27452
|
_proto.vestTokens =
|
|
26904
27453
|
/*#__PURE__*/
|
|
26905
27454
|
function () {
|
|
26906
|
-
var _vestTokens = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
27455
|
+
var _vestTokens = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee49(tokenAddress, amount, options, estimateGas) {
|
|
26907
27456
|
var txData, tx;
|
|
26908
|
-
return runtime_1.wrap(function
|
|
27457
|
+
return runtime_1.wrap(function _callee49$(_context49) {
|
|
26909
27458
|
while (1) {
|
|
26910
|
-
switch (
|
|
27459
|
+
switch (_context49.prev = _context49.next) {
|
|
26911
27460
|
case 0:
|
|
26912
27461
|
if (options === void 0) {
|
|
26913
27462
|
options = null;
|
|
@@ -26917,27 +27466,27 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26917
27466
|
estimateGas = false;
|
|
26918
27467
|
}
|
|
26919
27468
|
|
|
26920
|
-
|
|
27469
|
+
_context49.next = 4;
|
|
26921
27470
|
return getCreateVestTxData(amount);
|
|
26922
27471
|
|
|
26923
27472
|
case 4:
|
|
26924
|
-
txData =
|
|
26925
|
-
|
|
27473
|
+
txData = _context49.sent;
|
|
27474
|
+
_context49.next = 7;
|
|
26926
27475
|
return getPoolTxOrGasEstimate(this, [tokenAddress, txData, options], estimateGas);
|
|
26927
27476
|
|
|
26928
27477
|
case 7:
|
|
26929
|
-
tx =
|
|
26930
|
-
return
|
|
27478
|
+
tx = _context49.sent;
|
|
27479
|
+
return _context49.abrupt("return", tx);
|
|
26931
27480
|
|
|
26932
27481
|
case 9:
|
|
26933
27482
|
case "end":
|
|
26934
|
-
return
|
|
27483
|
+
return _context49.stop();
|
|
26935
27484
|
}
|
|
26936
27485
|
}
|
|
26937
|
-
},
|
|
27486
|
+
}, _callee49, this);
|
|
26938
27487
|
}));
|
|
26939
27488
|
|
|
26940
|
-
function vestTokens(
|
|
27489
|
+
function vestTokens(_x240, _x241, _x242, _x243) {
|
|
26941
27490
|
return _vestTokens.apply(this, arguments);
|
|
26942
27491
|
}
|
|
26943
27492
|
|
|
@@ -26956,11 +27505,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26956
27505
|
_proto.exitVestedToken =
|
|
26957
27506
|
/*#__PURE__*/
|
|
26958
27507
|
function () {
|
|
26959
|
-
var _exitVestedToken = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
27508
|
+
var _exitVestedToken = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee50(tokenAddress, id, options, estimateGas) {
|
|
26960
27509
|
var txData, tx;
|
|
26961
|
-
return runtime_1.wrap(function
|
|
27510
|
+
return runtime_1.wrap(function _callee50$(_context50) {
|
|
26962
27511
|
while (1) {
|
|
26963
|
-
switch (
|
|
27512
|
+
switch (_context50.prev = _context50.next) {
|
|
26964
27513
|
case 0:
|
|
26965
27514
|
if (options === void 0) {
|
|
26966
27515
|
options = null;
|
|
@@ -26970,27 +27519,27 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26970
27519
|
estimateGas = false;
|
|
26971
27520
|
}
|
|
26972
27521
|
|
|
26973
|
-
|
|
27522
|
+
_context50.next = 4;
|
|
26974
27523
|
return getExitVestTxData(id);
|
|
26975
27524
|
|
|
26976
27525
|
case 4:
|
|
26977
|
-
txData =
|
|
26978
|
-
|
|
27526
|
+
txData = _context50.sent;
|
|
27527
|
+
_context50.next = 7;
|
|
26979
27528
|
return getPoolTxOrGasEstimate(this, [tokenAddress, txData, options], estimateGas);
|
|
26980
27529
|
|
|
26981
27530
|
case 7:
|
|
26982
|
-
tx =
|
|
26983
|
-
return
|
|
27531
|
+
tx = _context50.sent;
|
|
27532
|
+
return _context50.abrupt("return", tx);
|
|
26984
27533
|
|
|
26985
27534
|
case 9:
|
|
26986
27535
|
case "end":
|
|
26987
|
-
return
|
|
27536
|
+
return _context50.stop();
|
|
26988
27537
|
}
|
|
26989
27538
|
}
|
|
26990
|
-
},
|
|
27539
|
+
}, _callee50, this);
|
|
26991
27540
|
}));
|
|
26992
27541
|
|
|
26993
|
-
function exitVestedToken(
|
|
27542
|
+
function exitVestedToken(_x244, _x245, _x246, _x247) {
|
|
26994
27543
|
return _exitVestedToken.apply(this, arguments);
|
|
26995
27544
|
}
|
|
26996
27545
|
|
|
@@ -27010,11 +27559,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
27010
27559
|
_proto.mintUnitViaFlatMoney =
|
|
27011
27560
|
/*#__PURE__*/
|
|
27012
27561
|
function () {
|
|
27013
|
-
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) {
|
|
27014
27563
|
var tx;
|
|
27015
|
-
return runtime_1.wrap(function
|
|
27564
|
+
return runtime_1.wrap(function _callee51$(_context51) {
|
|
27016
27565
|
while (1) {
|
|
27017
|
-
switch (
|
|
27566
|
+
switch (_context51.prev = _context51.next) {
|
|
27018
27567
|
case 0:
|
|
27019
27568
|
if (slippage === void 0) {
|
|
27020
27569
|
slippage = 0.5;
|
|
@@ -27028,22 +27577,22 @@ var Pool = /*#__PURE__*/function () {
|
|
|
27028
27577
|
estimateGas = false;
|
|
27029
27578
|
}
|
|
27030
27579
|
|
|
27031
|
-
|
|
27580
|
+
_context51.next = 5;
|
|
27032
27581
|
return mintUnitViaFlatMoney(this, depositAmount, slippage, maxKeeperFeeInUsd, options, estimateGas);
|
|
27033
27582
|
|
|
27034
27583
|
case 5:
|
|
27035
|
-
tx =
|
|
27036
|
-
return
|
|
27584
|
+
tx = _context51.sent;
|
|
27585
|
+
return _context51.abrupt("return", tx);
|
|
27037
27586
|
|
|
27038
27587
|
case 7:
|
|
27039
27588
|
case "end":
|
|
27040
|
-
return
|
|
27589
|
+
return _context51.stop();
|
|
27041
27590
|
}
|
|
27042
27591
|
}
|
|
27043
|
-
},
|
|
27592
|
+
}, _callee51, this);
|
|
27044
27593
|
}));
|
|
27045
27594
|
|
|
27046
|
-
function mintUnitViaFlatMoney$1(
|
|
27595
|
+
function mintUnitViaFlatMoney$1(_x248, _x249, _x250, _x251, _x252) {
|
|
27047
27596
|
return _mintUnitViaFlatMoney2.apply(this, arguments);
|
|
27048
27597
|
}
|
|
27049
27598
|
|
|
@@ -27063,11 +27612,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
27063
27612
|
_proto.redeemUnitViaFlatMoney =
|
|
27064
27613
|
/*#__PURE__*/
|
|
27065
27614
|
function () {
|
|
27066
|
-
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) {
|
|
27067
27616
|
var tx;
|
|
27068
|
-
return runtime_1.wrap(function
|
|
27617
|
+
return runtime_1.wrap(function _callee52$(_context52) {
|
|
27069
27618
|
while (1) {
|
|
27070
|
-
switch (
|
|
27619
|
+
switch (_context52.prev = _context52.next) {
|
|
27071
27620
|
case 0:
|
|
27072
27621
|
if (slippage === void 0) {
|
|
27073
27622
|
slippage = 0.5;
|
|
@@ -27081,22 +27630,22 @@ var Pool = /*#__PURE__*/function () {
|
|
|
27081
27630
|
estimateGas = false;
|
|
27082
27631
|
}
|
|
27083
27632
|
|
|
27084
|
-
|
|
27633
|
+
_context52.next = 5;
|
|
27085
27634
|
return redeemUnitViaFlatMoney(this, withdrawAmount, slippage, maxKeeperFeeInUsd, options, estimateGas);
|
|
27086
27635
|
|
|
27087
27636
|
case 5:
|
|
27088
|
-
tx =
|
|
27089
|
-
return
|
|
27637
|
+
tx = _context52.sent;
|
|
27638
|
+
return _context52.abrupt("return", tx);
|
|
27090
27639
|
|
|
27091
27640
|
case 7:
|
|
27092
27641
|
case "end":
|
|
27093
|
-
return
|
|
27642
|
+
return _context52.stop();
|
|
27094
27643
|
}
|
|
27095
27644
|
}
|
|
27096
|
-
},
|
|
27645
|
+
}, _callee52, this);
|
|
27097
27646
|
}));
|
|
27098
27647
|
|
|
27099
|
-
function redeemUnitViaFlatMoney$1(
|
|
27648
|
+
function redeemUnitViaFlatMoney$1(_x253, _x254, _x255, _x256, _x257) {
|
|
27100
27649
|
return _redeemUnitViaFlatMoney2.apply(this, arguments);
|
|
27101
27650
|
}
|
|
27102
27651
|
|
|
@@ -27104,11 +27653,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
27104
27653
|
}();
|
|
27105
27654
|
|
|
27106
27655
|
_proto.cancelOrderViaFlatMoney = /*#__PURE__*/function () {
|
|
27107
|
-
var _cancelOrderViaFlatMoney2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
27656
|
+
var _cancelOrderViaFlatMoney2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee53(options, estimateGas) {
|
|
27108
27657
|
var tx;
|
|
27109
|
-
return runtime_1.wrap(function
|
|
27658
|
+
return runtime_1.wrap(function _callee53$(_context53) {
|
|
27110
27659
|
while (1) {
|
|
27111
|
-
switch (
|
|
27660
|
+
switch (_context53.prev = _context53.next) {
|
|
27112
27661
|
case 0:
|
|
27113
27662
|
if (options === void 0) {
|
|
27114
27663
|
options = null;
|
|
@@ -27118,22 +27667,22 @@ var Pool = /*#__PURE__*/function () {
|
|
|
27118
27667
|
estimateGas = false;
|
|
27119
27668
|
}
|
|
27120
27669
|
|
|
27121
|
-
|
|
27670
|
+
_context53.next = 4;
|
|
27122
27671
|
return cancelOrderViaFlatMoney(this, options, estimateGas);
|
|
27123
27672
|
|
|
27124
27673
|
case 4:
|
|
27125
|
-
tx =
|
|
27126
|
-
return
|
|
27674
|
+
tx = _context53.sent;
|
|
27675
|
+
return _context53.abrupt("return", tx);
|
|
27127
27676
|
|
|
27128
27677
|
case 6:
|
|
27129
27678
|
case "end":
|
|
27130
|
-
return
|
|
27679
|
+
return _context53.stop();
|
|
27131
27680
|
}
|
|
27132
27681
|
}
|
|
27133
|
-
},
|
|
27682
|
+
}, _callee53, this);
|
|
27134
27683
|
}));
|
|
27135
27684
|
|
|
27136
|
-
function cancelOrderViaFlatMoney$1(
|
|
27685
|
+
function cancelOrderViaFlatMoney$1(_x258, _x259) {
|
|
27137
27686
|
return _cancelOrderViaFlatMoney2.apply(this, arguments);
|
|
27138
27687
|
}
|
|
27139
27688
|
|