@dhedge/v2-sdk 1.10.6 → 1.10.7
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/dist/entities/pool.d.ts +8 -0
- package/dist/services/compound/rewards.d.ts +2 -0
- package/dist/types.d.ts +2 -1
- package/dist/v2-sdk.cjs.development.js +806 -327
- 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 +806 -327
- package/dist/v2-sdk.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/abi/compound/ICometRewards.json +241 -0
- package/src/config.ts +5 -2
- package/src/entities/pool.ts +26 -0
- package/src/services/compound/rewards.ts +9 -0
- package/src/test/compoundV3.test.ts +4 -0
- package/src/types.ts +2 -1
package/dist/v2-sdk.esm.js
CHANGED
|
@@ -4256,6 +4256,7 @@ var Dapp;
|
|
|
4256
4256
|
Dapp["AERODROME"] = "aerodrome";
|
|
4257
4257
|
Dapp["AERODROMECL"] = "aerodromeCL";
|
|
4258
4258
|
Dapp["RAMSESCL"] = "ramsesCL";
|
|
4259
|
+
Dapp["COMPOUNDV3"] = "compoundV3";
|
|
4259
4260
|
})(Dapp || (Dapp = {}));
|
|
4260
4261
|
|
|
4261
4262
|
var Transaction;
|
|
@@ -4282,16 +4283,16 @@ var Transaction;
|
|
|
4282
4283
|
Transaction["REMOVE_LIQUIDITY_UNSTAKE"] = "removeLiquidityAndUnstake";
|
|
4283
4284
|
})(Transaction || (Transaction = {}));
|
|
4284
4285
|
|
|
4285
|
-
var _factoryAddress, _Network$POLYGON, _Network$OPTIMISM, _Network$ARBITRUM, _Network$BASE, _routerAddress, _Network$POLYGON2, _dappFactoryAddress, _Network$POLYGON3, _Network$OPTIMISM2, _stakingAddress, _Network$POLYGON4, _Network$OPTIMISM3, _Network$
|
|
4286
|
+
var _factoryAddress, _Network$POLYGON, _Network$OPTIMISM, _Network$ARBITRUM, _Network$BASE, _routerAddress, _Network$POLYGON2, _dappFactoryAddress, _Network$POLYGON3, _Network$OPTIMISM2, _Network$ARBITRUM2, _stakingAddress, _Network$POLYGON4, _Network$OPTIMISM3, _Network$ARBITRUM3, _Network$BASE2, _aaveAddressProvider, _Network$POLYGON5, _Network$OPTIMISM4, _Network$ARBITRUM4, _Network$BASE3, _nonfungiblePositionM, _networkChainIdMap, _balancerSubgraph, _multiCallAddress, _lyraNetworkMap, _flatMoneyContractAdd;
|
|
4286
4287
|
|
|
4287
4288
|
require("dotenv").config();
|
|
4288
4289
|
|
|
4289
4290
|
var factoryAddress = (_factoryAddress = {}, _factoryAddress[Network.POLYGON] = process.env.STAGING_CONTRACTS ? "0xDd87eCdB10cFF7004276AAbAbd30e7a08F69bb53" : "0xfdc7b8bFe0DD3513Cc669bB8d601Cb83e2F69cB0", _factoryAddress[Network.OPTIMISM] = "0x5e61a079A178f0E5784107a4963baAe0c5a680c6", _factoryAddress[Network.ARBITRUM] = "0xfffb5fb14606eb3a548c113026355020ddf27535", _factoryAddress[Network.BASE] = "0x49Afe3abCf66CF09Fab86cb1139D8811C8afe56F", _factoryAddress);
|
|
4290
4291
|
var routerAddress = (_routerAddress = {}, _routerAddress[Network.POLYGON] = (_Network$POLYGON = {}, _Network$POLYGON[Dapp.SUSHISWAP] = "0x1b02dA8Cb0d097eB8D57A175b88c7D8b47997506", _Network$POLYGON[Dapp.AAVE] = "0x8dFf5E27EA6b7AC08EbFdf9eB090F32ee9a30fcf", _Network$POLYGON[Dapp.AAVEV3] = "0x794a61358D6845594F94dc1DB02A252b5b4814aD", _Network$POLYGON[Dapp.ONEINCH] = "0x111111125421ca6dc452d289314280a0f8842a65", _Network$POLYGON[Dapp.QUICKSWAP] = "0xa5E0829CaCEd8fFDD4De3c43696c57F7D7A678ff", _Network$POLYGON[Dapp.BALANCER] = "0xBA12222222228d8Ba445958a75a0704d566BF2C8", _Network$POLYGON[Dapp.UNISWAPV3] = "0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45", _Network$POLYGON[Dapp.ARRAKIS] = "0xc73fb100a995b33f9fa181d420f4c8d74506df66", _Network$POLYGON[Dapp.TOROS] = "0x45b90480D6F643dE2f128db091A357C3c90399f2", _Network$POLYGON[Dapp.ZEROEX] = "0xdef1c0ded9bec7f1a1670819833240f027b25eff", _Network$POLYGON), _routerAddress[Network.OPTIMISM] = (_Network$OPTIMISM = {}, _Network$OPTIMISM[Dapp.UNISWAPV3] = "0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45", _Network$OPTIMISM[Dapp.SYNTHETIX] = "0x8700dAec35aF8Ff88c16BdF0418774CB3D7599B4", _Network$OPTIMISM[Dapp.AAVEV3] = "0x794a61358D6845594F94dc1DB02A252b5b4814aD", _Network$OPTIMISM[Dapp.ONEINCH] = "0x111111125421ca6dc452d289314280a0f8842a65", _Network$OPTIMISM[Dapp.TOROS] = "0x2Ed1bd7f66e47113672f3870308b5E867C5bb743", _Network$OPTIMISM[Dapp.VELODROME] = "0x9c12939390052919aF3155f41Bf4160Fd3666A6f", _Network$OPTIMISM[Dapp.VELODROMEV2] = "0xa062ae8a9c5e11aaa026fc2670b0d65ccc8b2858", _Network$OPTIMISM[Dapp.LYRA] = "0xCCE7819d65f348c64B7Beb205BA367b3fE33763B", _Network$OPTIMISM[Dapp.ARRAKIS] = "0x9ce88a56d120300061593eF7AD074A1B710094d5", _Network$OPTIMISM[Dapp.ZEROEX] = "0xdef1abe32c034e558cdd535791643c58a13acc10", _Network$OPTIMISM), _routerAddress[Network.ARBITRUM] = (_Network$ARBITRUM = {}, _Network$ARBITRUM[Dapp.ONEINCH] = "0x111111125421ca6dc452d289314280a0f8842a65", _Network$ARBITRUM[Dapp.UNISWAPV3] = "0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45", _Network$ARBITRUM[Dapp.AAVEV3] = "0x794a61358D6845594F94dc1DB02A252b5b4814aD", _Network$ARBITRUM[Dapp.BALANCER] = "0xBA12222222228d8Ba445958a75a0704d566BF2C8", _Network$ARBITRUM[Dapp.RAMSES] = "0xaaa87963efeb6f7e0a2711f397663105acb1805e", _Network$ARBITRUM[Dapp.ZEROEX] = "0xdef1c0ded9bec7f1a1670819833240f027b25eff", _Network$ARBITRUM[Dapp.TOROS] = "0xA5679C4272A056Bb83f039961fae7D99C48529F5", _Network$ARBITRUM), _routerAddress[Network.BASE] = (_Network$BASE = {}, _Network$BASE[Dapp.ONEINCH] = "0x111111125421ca6dc452d289314280a0f8842a65", _Network$BASE[Dapp.ZEROEX] = "0xdef1c0ded9bec7f1a1670819833240f027b25eff", _Network$BASE[Dapp.AERODROME] = "0xcF77a3Ba9A5CA399B7c97c74d54e5b1Beb874E43", _Network$BASE[Dapp.AAVEV3] = "0xA238Dd80C259a72e81d7e4664a9801593F98d1c5", _Network$BASE[Dapp.TOROS] = "0xf067575Eb60c7587C11e867907AA7284833704d1", _Network$BASE), _routerAddress);
|
|
4291
4292
|
var dappFactoryAddress = (_dappFactoryAddress = {}, _dappFactoryAddress[Network.POLYGON] = (_Network$POLYGON2 = {}, _Network$POLYGON2[Dapp.SUSHISWAP] = "0xc35DADB65012eC5796536bD9864eD8773aBc74C4", _Network$POLYGON2[Dapp.QUICKSWAP] = "0x5757371414417b8C6CAad45bAeF941aBc7d3Ab32", _Network$POLYGON2), _dappFactoryAddress[Network.OPTIMISM] = {}, _dappFactoryAddress[Network.ARBITRUM] = {}, _dappFactoryAddress[Network.BASE] = {}, _dappFactoryAddress);
|
|
4292
|
-
var stakingAddress = (_stakingAddress = {}, _stakingAddress[Network.POLYGON] = (_Network$POLYGON3 = {}, _Network$POLYGON3[Dapp.SUSHISWAP] = "0x0769fd68dFb93167989C6f7254cd0D766Fb2841F", _Network$POLYGON3[Dapp.BALANCER] = "0x0F3e0c4218b7b0108a3643cFe9D3ec0d4F57c54e", _Network$POLYGON3[Dapp.AAVE] = "0x357D51124f59836DeD84c8a1730D72B749d8BC23", _Network$POLYGON3[Dapp.AAVEV3] = "0x929EC64c34a17401F460460D4B9390518E5B473e", _Network$POLYGON3), _stakingAddress[Network.OPTIMISM] = (_Network$OPTIMISM2 = {}, _Network$OPTIMISM2[Dapp.AAVEV3] = "0x929EC64c34a17401F460460D4B9390518E5B473e", _Network$OPTIMISM2), _stakingAddress[Network.ARBITRUM] = {}, _stakingAddress[Network.BASE] = {}, _stakingAddress);
|
|
4293
|
-
var aaveAddressProvider = (_aaveAddressProvider = {}, _aaveAddressProvider[Network.POLYGON] = (_Network$POLYGON4 = {}, _Network$POLYGON4[Dapp.AAVE] = "0xd05e3E715d945B59290df0ae8eF85c1BdB684744", _Network$POLYGON4[Dapp.AAVEV3] = "0xa97684ead0e402dC232d5A977953DF7ECBaB3CDb", _Network$POLYGON4), _aaveAddressProvider[Network.OPTIMISM] = (_Network$OPTIMISM3 = {}, _Network$OPTIMISM3[Dapp.AAVEV3] = "0xa97684ead0e402dC232d5A977953DF7ECBaB3CDb", _Network$OPTIMISM3), _aaveAddressProvider[Network.ARBITRUM] = (_Network$
|
|
4294
|
-
var nonfungiblePositionManagerAddress = (_nonfungiblePositionM = {}, _nonfungiblePositionM[Network.POLYGON] = (_Network$POLYGON5 = {}, _Network$POLYGON5[Dapp.UNISWAPV3] = "0xC36442b4a4522E871399CD717aBDD847Ab11FE88", _Network$POLYGON5), _nonfungiblePositionM[Network.OPTIMISM] = (_Network$OPTIMISM4 = {}, _Network$OPTIMISM4[Dapp.UNISWAPV3] = "0xC36442b4a4522E871399CD717aBDD847Ab11FE88", _Network$OPTIMISM4[Dapp.VELODROMECL] = "0x416b433906b1B72FA758e166e239c43d68dC6F29", _Network$OPTIMISM4), _nonfungiblePositionM[Network.ARBITRUM] = (_Network$
|
|
4293
|
+
var stakingAddress = (_stakingAddress = {}, _stakingAddress[Network.POLYGON] = (_Network$POLYGON3 = {}, _Network$POLYGON3[Dapp.SUSHISWAP] = "0x0769fd68dFb93167989C6f7254cd0D766Fb2841F", _Network$POLYGON3[Dapp.BALANCER] = "0x0F3e0c4218b7b0108a3643cFe9D3ec0d4F57c54e", _Network$POLYGON3[Dapp.AAVE] = "0x357D51124f59836DeD84c8a1730D72B749d8BC23", _Network$POLYGON3[Dapp.AAVEV3] = "0x929EC64c34a17401F460460D4B9390518E5B473e", _Network$POLYGON3), _stakingAddress[Network.OPTIMISM] = (_Network$OPTIMISM2 = {}, _Network$OPTIMISM2[Dapp.AAVEV3] = "0x929EC64c34a17401F460460D4B9390518E5B473e", _Network$OPTIMISM2[Dapp.COMPOUNDV3] = "0x443ea0340cb75a160f31a440722dec7b5bc3c2e9", _Network$OPTIMISM2), _stakingAddress[Network.ARBITRUM] = (_Network$ARBITRUM2 = {}, _Network$ARBITRUM2[Dapp.COMPOUNDV3] = "0x88730d254a2f7e6ac8388c3198afd694ba9f7fae", _Network$ARBITRUM2), _stakingAddress[Network.BASE] = {}, _stakingAddress);
|
|
4294
|
+
var aaveAddressProvider = (_aaveAddressProvider = {}, _aaveAddressProvider[Network.POLYGON] = (_Network$POLYGON4 = {}, _Network$POLYGON4[Dapp.AAVE] = "0xd05e3E715d945B59290df0ae8eF85c1BdB684744", _Network$POLYGON4[Dapp.AAVEV3] = "0xa97684ead0e402dC232d5A977953DF7ECBaB3CDb", _Network$POLYGON4), _aaveAddressProvider[Network.OPTIMISM] = (_Network$OPTIMISM3 = {}, _Network$OPTIMISM3[Dapp.AAVEV3] = "0xa97684ead0e402dC232d5A977953DF7ECBaB3CDb", _Network$OPTIMISM3), _aaveAddressProvider[Network.ARBITRUM] = (_Network$ARBITRUM3 = {}, _Network$ARBITRUM3[Dapp.AAVEV3] = "0xa97684ead0e402dc232d5a977953df7ecbab3cdb", _Network$ARBITRUM3), _aaveAddressProvider[Network.BASE] = (_Network$BASE2 = {}, _Network$BASE2[Dapp.AAVEV3] = "0xe20fCBdBfFC4Dd138cE8b2E6FBb6CB49777ad64D", _Network$BASE2), _aaveAddressProvider);
|
|
4295
|
+
var nonfungiblePositionManagerAddress = (_nonfungiblePositionM = {}, _nonfungiblePositionM[Network.POLYGON] = (_Network$POLYGON5 = {}, _Network$POLYGON5[Dapp.UNISWAPV3] = "0xC36442b4a4522E871399CD717aBDD847Ab11FE88", _Network$POLYGON5), _nonfungiblePositionM[Network.OPTIMISM] = (_Network$OPTIMISM4 = {}, _Network$OPTIMISM4[Dapp.UNISWAPV3] = "0xC36442b4a4522E871399CD717aBDD847Ab11FE88", _Network$OPTIMISM4[Dapp.VELODROMECL] = "0x416b433906b1B72FA758e166e239c43d68dC6F29", _Network$OPTIMISM4), _nonfungiblePositionM[Network.ARBITRUM] = (_Network$ARBITRUM4 = {}, _Network$ARBITRUM4[Dapp.UNISWAPV3] = "0xC36442b4a4522E871399CD717aBDD847Ab11FE88", _Network$ARBITRUM4[Dapp.RAMSESCL] = "0xAA277CB7914b7e5514946Da92cb9De332Ce610EF", _Network$ARBITRUM4), _nonfungiblePositionM[Network.BASE] = (_Network$BASE3 = {}, _Network$BASE3[Dapp.UNISWAPV3] = "0x03a520b32C04BF3bEEf7BEb72E919cf822Ed34f1", _Network$BASE3[Dapp.AERODROMECL] = "0x827922686190790b37229fd06084350e74485b72", _Network$BASE3), _nonfungiblePositionM);
|
|
4295
4296
|
var networkChainIdMap = (_networkChainIdMap = {}, _networkChainIdMap[Network.POLYGON] = 137, _networkChainIdMap[Network.OPTIMISM] = 10, _networkChainIdMap[Network.ARBITRUM] = 42161, _networkChainIdMap[Network.BASE] = 8453, _networkChainIdMap);
|
|
4296
4297
|
var balancerSubgraph = (_balancerSubgraph = {}, _balancerSubgraph[Network.POLYGON] = "https://api.thegraph.com/subgraphs/name/balancer-labs/balancer-polygon-v2", _balancerSubgraph[Network.OPTIMISM] = "", _balancerSubgraph[Network.ARBITRUM] = "", _balancerSubgraph[Network.BASE] = "", _balancerSubgraph);
|
|
4297
4298
|
var multiCallAddress = (_multiCallAddress = {}, _multiCallAddress[Network.POLYGON] = "0x275617327c958bD06b5D6b871E7f491D76113dd8", _multiCallAddress[Network.OPTIMISM] = "", _multiCallAddress[Network.ARBITRUM] = "", _multiCallAddress[Network.BASE] = "", _multiCallAddress);
|
|
@@ -23680,6 +23681,432 @@ function getCompoundV3WithdrawTxData(asset, amount) {
|
|
|
23680
23681
|
return new ethers.utils.Interface(ICompoundV3Comet).encodeFunctionData("withdraw", [asset, amount]);
|
|
23681
23682
|
}
|
|
23682
23683
|
|
|
23684
|
+
var ICometRewards = [
|
|
23685
|
+
{
|
|
23686
|
+
inputs: [
|
|
23687
|
+
{
|
|
23688
|
+
internalType: "address",
|
|
23689
|
+
name: "governor_",
|
|
23690
|
+
type: "address"
|
|
23691
|
+
}
|
|
23692
|
+
],
|
|
23693
|
+
stateMutability: "nonpayable",
|
|
23694
|
+
type: "constructor"
|
|
23695
|
+
},
|
|
23696
|
+
{
|
|
23697
|
+
inputs: [
|
|
23698
|
+
{
|
|
23699
|
+
internalType: "address",
|
|
23700
|
+
name: "",
|
|
23701
|
+
type: "address"
|
|
23702
|
+
}
|
|
23703
|
+
],
|
|
23704
|
+
name: "AlreadyConfigured",
|
|
23705
|
+
type: "error"
|
|
23706
|
+
},
|
|
23707
|
+
{
|
|
23708
|
+
inputs: [
|
|
23709
|
+
],
|
|
23710
|
+
name: "BadData",
|
|
23711
|
+
type: "error"
|
|
23712
|
+
},
|
|
23713
|
+
{
|
|
23714
|
+
inputs: [
|
|
23715
|
+
{
|
|
23716
|
+
internalType: "uint256",
|
|
23717
|
+
name: "",
|
|
23718
|
+
type: "uint256"
|
|
23719
|
+
}
|
|
23720
|
+
],
|
|
23721
|
+
name: "InvalidUInt64",
|
|
23722
|
+
type: "error"
|
|
23723
|
+
},
|
|
23724
|
+
{
|
|
23725
|
+
inputs: [
|
|
23726
|
+
{
|
|
23727
|
+
internalType: "address",
|
|
23728
|
+
name: "",
|
|
23729
|
+
type: "address"
|
|
23730
|
+
}
|
|
23731
|
+
],
|
|
23732
|
+
name: "NotPermitted",
|
|
23733
|
+
type: "error"
|
|
23734
|
+
},
|
|
23735
|
+
{
|
|
23736
|
+
inputs: [
|
|
23737
|
+
{
|
|
23738
|
+
internalType: "address",
|
|
23739
|
+
name: "",
|
|
23740
|
+
type: "address"
|
|
23741
|
+
}
|
|
23742
|
+
],
|
|
23743
|
+
name: "NotSupported",
|
|
23744
|
+
type: "error"
|
|
23745
|
+
},
|
|
23746
|
+
{
|
|
23747
|
+
inputs: [
|
|
23748
|
+
{
|
|
23749
|
+
internalType: "address",
|
|
23750
|
+
name: "",
|
|
23751
|
+
type: "address"
|
|
23752
|
+
},
|
|
23753
|
+
{
|
|
23754
|
+
internalType: "uint256",
|
|
23755
|
+
name: "",
|
|
23756
|
+
type: "uint256"
|
|
23757
|
+
}
|
|
23758
|
+
],
|
|
23759
|
+
name: "TransferOutFailed",
|
|
23760
|
+
type: "error"
|
|
23761
|
+
},
|
|
23762
|
+
{
|
|
23763
|
+
anonymous: false,
|
|
23764
|
+
inputs: [
|
|
23765
|
+
{
|
|
23766
|
+
indexed: true,
|
|
23767
|
+
internalType: "address",
|
|
23768
|
+
name: "oldGovernor",
|
|
23769
|
+
type: "address"
|
|
23770
|
+
},
|
|
23771
|
+
{
|
|
23772
|
+
indexed: true,
|
|
23773
|
+
internalType: "address",
|
|
23774
|
+
name: "newGovernor",
|
|
23775
|
+
type: "address"
|
|
23776
|
+
}
|
|
23777
|
+
],
|
|
23778
|
+
name: "GovernorTransferred",
|
|
23779
|
+
type: "event"
|
|
23780
|
+
},
|
|
23781
|
+
{
|
|
23782
|
+
anonymous: false,
|
|
23783
|
+
inputs: [
|
|
23784
|
+
{
|
|
23785
|
+
indexed: true,
|
|
23786
|
+
internalType: "address",
|
|
23787
|
+
name: "src",
|
|
23788
|
+
type: "address"
|
|
23789
|
+
},
|
|
23790
|
+
{
|
|
23791
|
+
indexed: true,
|
|
23792
|
+
internalType: "address",
|
|
23793
|
+
name: "recipient",
|
|
23794
|
+
type: "address"
|
|
23795
|
+
},
|
|
23796
|
+
{
|
|
23797
|
+
indexed: true,
|
|
23798
|
+
internalType: "address",
|
|
23799
|
+
name: "token",
|
|
23800
|
+
type: "address"
|
|
23801
|
+
},
|
|
23802
|
+
{
|
|
23803
|
+
indexed: false,
|
|
23804
|
+
internalType: "uint256",
|
|
23805
|
+
name: "amount",
|
|
23806
|
+
type: "uint256"
|
|
23807
|
+
}
|
|
23808
|
+
],
|
|
23809
|
+
name: "RewardClaimed",
|
|
23810
|
+
type: "event"
|
|
23811
|
+
},
|
|
23812
|
+
{
|
|
23813
|
+
anonymous: false,
|
|
23814
|
+
inputs: [
|
|
23815
|
+
{
|
|
23816
|
+
indexed: true,
|
|
23817
|
+
internalType: "address",
|
|
23818
|
+
name: "user",
|
|
23819
|
+
type: "address"
|
|
23820
|
+
},
|
|
23821
|
+
{
|
|
23822
|
+
indexed: true,
|
|
23823
|
+
internalType: "address",
|
|
23824
|
+
name: "comet",
|
|
23825
|
+
type: "address"
|
|
23826
|
+
},
|
|
23827
|
+
{
|
|
23828
|
+
indexed: false,
|
|
23829
|
+
internalType: "uint256",
|
|
23830
|
+
name: "amount",
|
|
23831
|
+
type: "uint256"
|
|
23832
|
+
}
|
|
23833
|
+
],
|
|
23834
|
+
name: "RewardsClaimedSet",
|
|
23835
|
+
type: "event"
|
|
23836
|
+
},
|
|
23837
|
+
{
|
|
23838
|
+
inputs: [
|
|
23839
|
+
{
|
|
23840
|
+
internalType: "address",
|
|
23841
|
+
name: "comet",
|
|
23842
|
+
type: "address"
|
|
23843
|
+
},
|
|
23844
|
+
{
|
|
23845
|
+
internalType: "address",
|
|
23846
|
+
name: "src",
|
|
23847
|
+
type: "address"
|
|
23848
|
+
},
|
|
23849
|
+
{
|
|
23850
|
+
internalType: "bool",
|
|
23851
|
+
name: "shouldAccrue",
|
|
23852
|
+
type: "bool"
|
|
23853
|
+
}
|
|
23854
|
+
],
|
|
23855
|
+
name: "claim",
|
|
23856
|
+
outputs: [
|
|
23857
|
+
],
|
|
23858
|
+
stateMutability: "nonpayable",
|
|
23859
|
+
type: "function"
|
|
23860
|
+
},
|
|
23861
|
+
{
|
|
23862
|
+
inputs: [
|
|
23863
|
+
{
|
|
23864
|
+
internalType: "address",
|
|
23865
|
+
name: "comet",
|
|
23866
|
+
type: "address"
|
|
23867
|
+
},
|
|
23868
|
+
{
|
|
23869
|
+
internalType: "address",
|
|
23870
|
+
name: "src",
|
|
23871
|
+
type: "address"
|
|
23872
|
+
},
|
|
23873
|
+
{
|
|
23874
|
+
internalType: "address",
|
|
23875
|
+
name: "to",
|
|
23876
|
+
type: "address"
|
|
23877
|
+
},
|
|
23878
|
+
{
|
|
23879
|
+
internalType: "bool",
|
|
23880
|
+
name: "shouldAccrue",
|
|
23881
|
+
type: "bool"
|
|
23882
|
+
}
|
|
23883
|
+
],
|
|
23884
|
+
name: "claimTo",
|
|
23885
|
+
outputs: [
|
|
23886
|
+
],
|
|
23887
|
+
stateMutability: "nonpayable",
|
|
23888
|
+
type: "function"
|
|
23889
|
+
},
|
|
23890
|
+
{
|
|
23891
|
+
inputs: [
|
|
23892
|
+
{
|
|
23893
|
+
internalType: "address",
|
|
23894
|
+
name: "comet",
|
|
23895
|
+
type: "address"
|
|
23896
|
+
},
|
|
23897
|
+
{
|
|
23898
|
+
internalType: "address",
|
|
23899
|
+
name: "account",
|
|
23900
|
+
type: "address"
|
|
23901
|
+
}
|
|
23902
|
+
],
|
|
23903
|
+
name: "getRewardOwed",
|
|
23904
|
+
outputs: [
|
|
23905
|
+
{
|
|
23906
|
+
components: [
|
|
23907
|
+
{
|
|
23908
|
+
internalType: "address",
|
|
23909
|
+
name: "token",
|
|
23910
|
+
type: "address"
|
|
23911
|
+
},
|
|
23912
|
+
{
|
|
23913
|
+
internalType: "uint256",
|
|
23914
|
+
name: "owed",
|
|
23915
|
+
type: "uint256"
|
|
23916
|
+
}
|
|
23917
|
+
],
|
|
23918
|
+
internalType: "struct CometRewards.RewardOwed",
|
|
23919
|
+
name: "",
|
|
23920
|
+
type: "tuple"
|
|
23921
|
+
}
|
|
23922
|
+
],
|
|
23923
|
+
stateMutability: "nonpayable",
|
|
23924
|
+
type: "function"
|
|
23925
|
+
},
|
|
23926
|
+
{
|
|
23927
|
+
inputs: [
|
|
23928
|
+
],
|
|
23929
|
+
name: "governor",
|
|
23930
|
+
outputs: [
|
|
23931
|
+
{
|
|
23932
|
+
internalType: "address",
|
|
23933
|
+
name: "",
|
|
23934
|
+
type: "address"
|
|
23935
|
+
}
|
|
23936
|
+
],
|
|
23937
|
+
stateMutability: "view",
|
|
23938
|
+
type: "function"
|
|
23939
|
+
},
|
|
23940
|
+
{
|
|
23941
|
+
inputs: [
|
|
23942
|
+
{
|
|
23943
|
+
internalType: "address",
|
|
23944
|
+
name: "",
|
|
23945
|
+
type: "address"
|
|
23946
|
+
}
|
|
23947
|
+
],
|
|
23948
|
+
name: "rewardConfig",
|
|
23949
|
+
outputs: [
|
|
23950
|
+
{
|
|
23951
|
+
internalType: "address",
|
|
23952
|
+
name: "token",
|
|
23953
|
+
type: "address"
|
|
23954
|
+
},
|
|
23955
|
+
{
|
|
23956
|
+
internalType: "uint64",
|
|
23957
|
+
name: "rescaleFactor",
|
|
23958
|
+
type: "uint64"
|
|
23959
|
+
},
|
|
23960
|
+
{
|
|
23961
|
+
internalType: "bool",
|
|
23962
|
+
name: "shouldUpscale",
|
|
23963
|
+
type: "bool"
|
|
23964
|
+
},
|
|
23965
|
+
{
|
|
23966
|
+
internalType: "uint256",
|
|
23967
|
+
name: "multiplier",
|
|
23968
|
+
type: "uint256"
|
|
23969
|
+
}
|
|
23970
|
+
],
|
|
23971
|
+
stateMutability: "view",
|
|
23972
|
+
type: "function"
|
|
23973
|
+
},
|
|
23974
|
+
{
|
|
23975
|
+
inputs: [
|
|
23976
|
+
{
|
|
23977
|
+
internalType: "address",
|
|
23978
|
+
name: "",
|
|
23979
|
+
type: "address"
|
|
23980
|
+
},
|
|
23981
|
+
{
|
|
23982
|
+
internalType: "address",
|
|
23983
|
+
name: "",
|
|
23984
|
+
type: "address"
|
|
23985
|
+
}
|
|
23986
|
+
],
|
|
23987
|
+
name: "rewardsClaimed",
|
|
23988
|
+
outputs: [
|
|
23989
|
+
{
|
|
23990
|
+
internalType: "uint256",
|
|
23991
|
+
name: "",
|
|
23992
|
+
type: "uint256"
|
|
23993
|
+
}
|
|
23994
|
+
],
|
|
23995
|
+
stateMutability: "view",
|
|
23996
|
+
type: "function"
|
|
23997
|
+
},
|
|
23998
|
+
{
|
|
23999
|
+
inputs: [
|
|
24000
|
+
{
|
|
24001
|
+
internalType: "address",
|
|
24002
|
+
name: "comet",
|
|
24003
|
+
type: "address"
|
|
24004
|
+
},
|
|
24005
|
+
{
|
|
24006
|
+
internalType: "address",
|
|
24007
|
+
name: "token",
|
|
24008
|
+
type: "address"
|
|
24009
|
+
}
|
|
24010
|
+
],
|
|
24011
|
+
name: "setRewardConfig",
|
|
24012
|
+
outputs: [
|
|
24013
|
+
],
|
|
24014
|
+
stateMutability: "nonpayable",
|
|
24015
|
+
type: "function"
|
|
24016
|
+
},
|
|
24017
|
+
{
|
|
24018
|
+
inputs: [
|
|
24019
|
+
{
|
|
24020
|
+
internalType: "address",
|
|
24021
|
+
name: "comet",
|
|
24022
|
+
type: "address"
|
|
24023
|
+
},
|
|
24024
|
+
{
|
|
24025
|
+
internalType: "address",
|
|
24026
|
+
name: "token",
|
|
24027
|
+
type: "address"
|
|
24028
|
+
},
|
|
24029
|
+
{
|
|
24030
|
+
internalType: "uint256",
|
|
24031
|
+
name: "multiplier",
|
|
24032
|
+
type: "uint256"
|
|
24033
|
+
}
|
|
24034
|
+
],
|
|
24035
|
+
name: "setRewardConfigWithMultiplier",
|
|
24036
|
+
outputs: [
|
|
24037
|
+
],
|
|
24038
|
+
stateMutability: "nonpayable",
|
|
24039
|
+
type: "function"
|
|
24040
|
+
},
|
|
24041
|
+
{
|
|
24042
|
+
inputs: [
|
|
24043
|
+
{
|
|
24044
|
+
internalType: "address",
|
|
24045
|
+
name: "comet",
|
|
24046
|
+
type: "address"
|
|
24047
|
+
},
|
|
24048
|
+
{
|
|
24049
|
+
internalType: "address[]",
|
|
24050
|
+
name: "users",
|
|
24051
|
+
type: "address[]"
|
|
24052
|
+
},
|
|
24053
|
+
{
|
|
24054
|
+
internalType: "uint256[]",
|
|
24055
|
+
name: "claimedAmounts",
|
|
24056
|
+
type: "uint256[]"
|
|
24057
|
+
}
|
|
24058
|
+
],
|
|
24059
|
+
name: "setRewardsClaimed",
|
|
24060
|
+
outputs: [
|
|
24061
|
+
],
|
|
24062
|
+
stateMutability: "nonpayable",
|
|
24063
|
+
type: "function"
|
|
24064
|
+
},
|
|
24065
|
+
{
|
|
24066
|
+
inputs: [
|
|
24067
|
+
{
|
|
24068
|
+
internalType: "address",
|
|
24069
|
+
name: "newGovernor",
|
|
24070
|
+
type: "address"
|
|
24071
|
+
}
|
|
24072
|
+
],
|
|
24073
|
+
name: "transferGovernor",
|
|
24074
|
+
outputs: [
|
|
24075
|
+
],
|
|
24076
|
+
stateMutability: "nonpayable",
|
|
24077
|
+
type: "function"
|
|
24078
|
+
},
|
|
24079
|
+
{
|
|
24080
|
+
inputs: [
|
|
24081
|
+
{
|
|
24082
|
+
internalType: "address",
|
|
24083
|
+
name: "token",
|
|
24084
|
+
type: "address"
|
|
24085
|
+
},
|
|
24086
|
+
{
|
|
24087
|
+
internalType: "address",
|
|
24088
|
+
name: "to",
|
|
24089
|
+
type: "address"
|
|
24090
|
+
},
|
|
24091
|
+
{
|
|
24092
|
+
internalType: "uint256",
|
|
24093
|
+
name: "amount",
|
|
24094
|
+
type: "uint256"
|
|
24095
|
+
}
|
|
24096
|
+
],
|
|
24097
|
+
name: "withdrawToken",
|
|
24098
|
+
outputs: [
|
|
24099
|
+
],
|
|
24100
|
+
stateMutability: "nonpayable",
|
|
24101
|
+
type: "function"
|
|
24102
|
+
}
|
|
24103
|
+
];
|
|
24104
|
+
|
|
24105
|
+
function getCompoundV3ClaimTxData(pool, asset) {
|
|
24106
|
+
var iCometRewards = new ethers.utils.Interface(ICometRewards);
|
|
24107
|
+
return iCometRewards.encodeFunctionData("claim", [asset, pool.address, true]);
|
|
24108
|
+
}
|
|
24109
|
+
|
|
23683
24110
|
var Pool = /*#__PURE__*/function () {
|
|
23684
24111
|
function Pool(network, signer, poolLogic, mangerLogic, utils, factory) {
|
|
23685
24112
|
this.network = network;
|
|
@@ -25385,6 +25812,58 @@ var Pool = /*#__PURE__*/function () {
|
|
|
25385
25812
|
|
|
25386
25813
|
return harvestAaveV3Rewards;
|
|
25387
25814
|
}()
|
|
25815
|
+
/**
|
|
25816
|
+
* Claim rewards from CompoundV3
|
|
25817
|
+
* @param {string} asset Compound lending asset
|
|
25818
|
+
* @param {any} options Transaction options
|
|
25819
|
+
* @param {boolean} estimateGas Simulate/estimate gas
|
|
25820
|
+
* @returns {Promise<any>} Transaction
|
|
25821
|
+
*/
|
|
25822
|
+
;
|
|
25823
|
+
|
|
25824
|
+
_proto.harvestCompoundV3Rewards =
|
|
25825
|
+
/*#__PURE__*/
|
|
25826
|
+
function () {
|
|
25827
|
+
var _harvestCompoundV3Rewards = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee30(asset, options, estimateGas) {
|
|
25828
|
+
var claimTxData, tx;
|
|
25829
|
+
return runtime_1.wrap(function _callee30$(_context30) {
|
|
25830
|
+
while (1) {
|
|
25831
|
+
switch (_context30.prev = _context30.next) {
|
|
25832
|
+
case 0:
|
|
25833
|
+
if (options === void 0) {
|
|
25834
|
+
options = null;
|
|
25835
|
+
}
|
|
25836
|
+
|
|
25837
|
+
if (estimateGas === void 0) {
|
|
25838
|
+
estimateGas = false;
|
|
25839
|
+
}
|
|
25840
|
+
|
|
25841
|
+
_context30.next = 4;
|
|
25842
|
+
return getCompoundV3ClaimTxData(this, asset);
|
|
25843
|
+
|
|
25844
|
+
case 4:
|
|
25845
|
+
claimTxData = _context30.sent;
|
|
25846
|
+
_context30.next = 7;
|
|
25847
|
+
return getPoolTxOrGasEstimate(this, [stakingAddress[this.network][Dapp.COMPOUNDV3], claimTxData, options], estimateGas);
|
|
25848
|
+
|
|
25849
|
+
case 7:
|
|
25850
|
+
tx = _context30.sent;
|
|
25851
|
+
return _context30.abrupt("return", tx);
|
|
25852
|
+
|
|
25853
|
+
case 9:
|
|
25854
|
+
case "end":
|
|
25855
|
+
return _context30.stop();
|
|
25856
|
+
}
|
|
25857
|
+
}
|
|
25858
|
+
}, _callee30, this);
|
|
25859
|
+
}));
|
|
25860
|
+
|
|
25861
|
+
function harvestCompoundV3Rewards(_x135, _x136, _x137) {
|
|
25862
|
+
return _harvestCompoundV3Rewards.apply(this, arguments);
|
|
25863
|
+
}
|
|
25864
|
+
|
|
25865
|
+
return harvestCompoundV3Rewards;
|
|
25866
|
+
}()
|
|
25388
25867
|
/**
|
|
25389
25868
|
* Create UniswapV3 liquidity pool
|
|
25390
25869
|
* @param {dapp} Platform UniswapV3, VelodromeCL, AerodromeCL or RamesesCL
|
|
@@ -25406,11 +25885,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
25406
25885
|
_proto.addLiquidityUniswapV3 =
|
|
25407
25886
|
/*#__PURE__*/
|
|
25408
25887
|
function () {
|
|
25409
|
-
var _addLiquidityUniswapV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
25888
|
+
var _addLiquidityUniswapV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee31(dapp, assetA, assetB, amountA, amountB, minPrice, maxPrice, minTick, maxTick, feeAmountOrTickSpacing, options, estimateGas) {
|
|
25410
25889
|
var mintTxData, tx;
|
|
25411
|
-
return runtime_1.wrap(function
|
|
25890
|
+
return runtime_1.wrap(function _callee31$(_context31) {
|
|
25412
25891
|
while (1) {
|
|
25413
|
-
switch (
|
|
25892
|
+
switch (_context31.prev = _context31.next) {
|
|
25414
25893
|
case 0:
|
|
25415
25894
|
if (options === void 0) {
|
|
25416
25895
|
options = null;
|
|
@@ -25421,7 +25900,7 @@ var Pool = /*#__PURE__*/function () {
|
|
|
25421
25900
|
}
|
|
25422
25901
|
|
|
25423
25902
|
if (!((minPrice === null || maxPrice === null) && (minTick === null || maxTick === null))) {
|
|
25424
|
-
|
|
25903
|
+
_context31.next = 4;
|
|
25425
25904
|
break;
|
|
25426
25905
|
}
|
|
25427
25906
|
|
|
@@ -25429,34 +25908,34 @@ var Pool = /*#__PURE__*/function () {
|
|
|
25429
25908
|
|
|
25430
25909
|
case 4:
|
|
25431
25910
|
if (!((minPrice || maxPrice) && dapp !== Dapp.UNISWAPV3)) {
|
|
25432
|
-
|
|
25911
|
+
_context31.next = 6;
|
|
25433
25912
|
break;
|
|
25434
25913
|
}
|
|
25435
25914
|
|
|
25436
25915
|
throw new Error("no price conversion for Aerodrome/Velodrome CL");
|
|
25437
25916
|
|
|
25438
25917
|
case 6:
|
|
25439
|
-
|
|
25918
|
+
_context31.next = 8;
|
|
25440
25919
|
return getUniswapV3MintTxData(dapp, this, assetA, assetB, amountA, amountB, minPrice, maxPrice, minTick, maxTick, feeAmountOrTickSpacing);
|
|
25441
25920
|
|
|
25442
25921
|
case 8:
|
|
25443
|
-
mintTxData =
|
|
25444
|
-
|
|
25922
|
+
mintTxData = _context31.sent;
|
|
25923
|
+
_context31.next = 11;
|
|
25445
25924
|
return getPoolTxOrGasEstimate(this, [nonfungiblePositionManagerAddress[this.network][dapp], mintTxData, options], estimateGas);
|
|
25446
25925
|
|
|
25447
25926
|
case 11:
|
|
25448
|
-
tx =
|
|
25449
|
-
return
|
|
25927
|
+
tx = _context31.sent;
|
|
25928
|
+
return _context31.abrupt("return", tx);
|
|
25450
25929
|
|
|
25451
25930
|
case 13:
|
|
25452
25931
|
case "end":
|
|
25453
|
-
return
|
|
25932
|
+
return _context31.stop();
|
|
25454
25933
|
}
|
|
25455
25934
|
}
|
|
25456
|
-
},
|
|
25935
|
+
}, _callee31, this);
|
|
25457
25936
|
}));
|
|
25458
25937
|
|
|
25459
|
-
function addLiquidityUniswapV3(
|
|
25938
|
+
function addLiquidityUniswapV3(_x138, _x139, _x140, _x141, _x142, _x143, _x144, _x145, _x146, _x147, _x148, _x149) {
|
|
25460
25939
|
return _addLiquidityUniswapV.apply(this, arguments);
|
|
25461
25940
|
}
|
|
25462
25941
|
|
|
@@ -25476,11 +25955,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
25476
25955
|
_proto.decreaseLiquidity =
|
|
25477
25956
|
/*#__PURE__*/
|
|
25478
25957
|
function () {
|
|
25479
|
-
var _decreaseLiquidity = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
25958
|
+
var _decreaseLiquidity = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee32(dapp, tokenId, amount, options, estimateGas) {
|
|
25480
25959
|
var dappAddress, isStaked, txData, tokenIdOwner, tx;
|
|
25481
|
-
return runtime_1.wrap(function
|
|
25960
|
+
return runtime_1.wrap(function _callee32$(_context32) {
|
|
25482
25961
|
while (1) {
|
|
25483
|
-
switch (
|
|
25962
|
+
switch (_context32.prev = _context32.next) {
|
|
25484
25963
|
case 0:
|
|
25485
25964
|
if (amount === void 0) {
|
|
25486
25965
|
amount = 100;
|
|
@@ -25495,20 +25974,20 @@ var Pool = /*#__PURE__*/function () {
|
|
|
25495
25974
|
}
|
|
25496
25975
|
|
|
25497
25976
|
isStaked = false;
|
|
25498
|
-
|
|
25499
|
-
|
|
25977
|
+
_context32.t0 = dapp;
|
|
25978
|
+
_context32.next = _context32.t0 === Dapp.UNISWAPV3 ? 7 : _context32.t0 === Dapp.RAMSESCL ? 7 : _context32.t0 === Dapp.VELODROMECL ? 9 : _context32.t0 === Dapp.AERODROMECL ? 9 : _context32.t0 === Dapp.ARRAKIS ? 14 : 16;
|
|
25500
25979
|
break;
|
|
25501
25980
|
|
|
25502
25981
|
case 7:
|
|
25503
25982
|
dappAddress = nonfungiblePositionManagerAddress[this.network][dapp];
|
|
25504
|
-
return
|
|
25983
|
+
return _context32.abrupt("break", 17);
|
|
25505
25984
|
|
|
25506
25985
|
case 9:
|
|
25507
|
-
|
|
25986
|
+
_context32.next = 11;
|
|
25508
25987
|
return getVelodromeClOwner(this, dapp, tokenId);
|
|
25509
25988
|
|
|
25510
25989
|
case 11:
|
|
25511
|
-
tokenIdOwner =
|
|
25990
|
+
tokenIdOwner = _context32.sent;
|
|
25512
25991
|
|
|
25513
25992
|
if (tokenIdOwner.toLowerCase() === this.address.toLowerCase()) {
|
|
25514
25993
|
dappAddress = nonfungiblePositionManagerAddress[this.network][dapp];
|
|
@@ -25518,49 +25997,49 @@ var Pool = /*#__PURE__*/function () {
|
|
|
25518
25997
|
isStaked = true;
|
|
25519
25998
|
}
|
|
25520
25999
|
|
|
25521
|
-
return
|
|
26000
|
+
return _context32.abrupt("break", 17);
|
|
25522
26001
|
|
|
25523
26002
|
case 14:
|
|
25524
26003
|
dappAddress = routerAddress[this.network][dapp];
|
|
25525
|
-
return
|
|
26004
|
+
return _context32.abrupt("break", 17);
|
|
25526
26005
|
|
|
25527
26006
|
case 16:
|
|
25528
26007
|
throw new Error("dapp not supported");
|
|
25529
26008
|
|
|
25530
26009
|
case 17:
|
|
25531
26010
|
if (isStaked) {
|
|
25532
|
-
|
|
26011
|
+
_context32.next = 23;
|
|
25533
26012
|
break;
|
|
25534
26013
|
}
|
|
25535
26014
|
|
|
25536
|
-
|
|
26015
|
+
_context32.next = 20;
|
|
25537
26016
|
return getDecreaseLiquidityTxData(this, dapp, tokenId, amount);
|
|
25538
26017
|
|
|
25539
26018
|
case 20:
|
|
25540
|
-
txData =
|
|
25541
|
-
|
|
26019
|
+
txData = _context32.sent;
|
|
26020
|
+
_context32.next = 24;
|
|
25542
26021
|
break;
|
|
25543
26022
|
|
|
25544
26023
|
case 23:
|
|
25545
26024
|
throw new Error("unsupported decreaseStakedLiquidity: unstake first to decrease lp");
|
|
25546
26025
|
|
|
25547
26026
|
case 24:
|
|
25548
|
-
|
|
26027
|
+
_context32.next = 26;
|
|
25549
26028
|
return getPoolTxOrGasEstimate(this, [dappAddress, txData, options], estimateGas);
|
|
25550
26029
|
|
|
25551
26030
|
case 26:
|
|
25552
|
-
tx =
|
|
25553
|
-
return
|
|
26031
|
+
tx = _context32.sent;
|
|
26032
|
+
return _context32.abrupt("return", tx);
|
|
25554
26033
|
|
|
25555
26034
|
case 28:
|
|
25556
26035
|
case "end":
|
|
25557
|
-
return
|
|
26036
|
+
return _context32.stop();
|
|
25558
26037
|
}
|
|
25559
26038
|
}
|
|
25560
|
-
},
|
|
26039
|
+
}, _callee32, this);
|
|
25561
26040
|
}));
|
|
25562
26041
|
|
|
25563
|
-
function decreaseLiquidity(
|
|
26042
|
+
function decreaseLiquidity(_x150, _x151, _x152, _x153, _x154) {
|
|
25564
26043
|
return _decreaseLiquidity.apply(this, arguments);
|
|
25565
26044
|
}
|
|
25566
26045
|
|
|
@@ -25581,11 +26060,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
25581
26060
|
_proto.increaseLiquidity =
|
|
25582
26061
|
/*#__PURE__*/
|
|
25583
26062
|
function () {
|
|
25584
|
-
var _increaseLiquidity = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
26063
|
+
var _increaseLiquidity = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee33(dapp, tokenId, amountA, amountB, options, estimateGas) {
|
|
25585
26064
|
var dappAddress, isStaked, txData, tokenIdOwner, tx;
|
|
25586
|
-
return runtime_1.wrap(function
|
|
26065
|
+
return runtime_1.wrap(function _callee33$(_context33) {
|
|
25587
26066
|
while (1) {
|
|
25588
|
-
switch (
|
|
26067
|
+
switch (_context33.prev = _context33.next) {
|
|
25589
26068
|
case 0:
|
|
25590
26069
|
if (options === void 0) {
|
|
25591
26070
|
options = null;
|
|
@@ -25596,20 +26075,20 @@ var Pool = /*#__PURE__*/function () {
|
|
|
25596
26075
|
}
|
|
25597
26076
|
|
|
25598
26077
|
isStaked = false;
|
|
25599
|
-
|
|
25600
|
-
|
|
26078
|
+
_context33.t0 = dapp;
|
|
26079
|
+
_context33.next = _context33.t0 === Dapp.UNISWAPV3 ? 6 : _context33.t0 === Dapp.RAMSESCL ? 6 : _context33.t0 === Dapp.VELODROMECL ? 8 : _context33.t0 === Dapp.AERODROMECL ? 8 : _context33.t0 === Dapp.ARRAKIS ? 13 : 15;
|
|
25601
26080
|
break;
|
|
25602
26081
|
|
|
25603
26082
|
case 6:
|
|
25604
26083
|
dappAddress = nonfungiblePositionManagerAddress[this.network][dapp];
|
|
25605
|
-
return
|
|
26084
|
+
return _context33.abrupt("break", 16);
|
|
25606
26085
|
|
|
25607
26086
|
case 8:
|
|
25608
|
-
|
|
26087
|
+
_context33.next = 10;
|
|
25609
26088
|
return getVelodromeClOwner(this, dapp, tokenId);
|
|
25610
26089
|
|
|
25611
26090
|
case 10:
|
|
25612
|
-
tokenIdOwner =
|
|
26091
|
+
tokenIdOwner = _context33.sent;
|
|
25613
26092
|
|
|
25614
26093
|
if (tokenIdOwner.toLowerCase() === this.address.toLowerCase()) {
|
|
25615
26094
|
dappAddress = nonfungiblePositionManagerAddress[this.network][dapp];
|
|
@@ -25619,49 +26098,49 @@ var Pool = /*#__PURE__*/function () {
|
|
|
25619
26098
|
isStaked = true;
|
|
25620
26099
|
}
|
|
25621
26100
|
|
|
25622
|
-
return
|
|
26101
|
+
return _context33.abrupt("break", 16);
|
|
25623
26102
|
|
|
25624
26103
|
case 13:
|
|
25625
26104
|
dappAddress = routerAddress[this.network][dapp];
|
|
25626
|
-
return
|
|
26105
|
+
return _context33.abrupt("break", 16);
|
|
25627
26106
|
|
|
25628
26107
|
case 15:
|
|
25629
26108
|
throw new Error("dapp not supported");
|
|
25630
26109
|
|
|
25631
26110
|
case 16:
|
|
25632
26111
|
if (isStaked) {
|
|
25633
|
-
|
|
26112
|
+
_context33.next = 22;
|
|
25634
26113
|
break;
|
|
25635
26114
|
}
|
|
25636
26115
|
|
|
25637
|
-
|
|
26116
|
+
_context33.next = 19;
|
|
25638
26117
|
return getIncreaseLiquidityTxData(this, dapp, tokenId, amountA, amountB);
|
|
25639
26118
|
|
|
25640
26119
|
case 19:
|
|
25641
|
-
txData =
|
|
25642
|
-
|
|
26120
|
+
txData = _context33.sent;
|
|
26121
|
+
_context33.next = 23;
|
|
25643
26122
|
break;
|
|
25644
26123
|
|
|
25645
26124
|
case 22:
|
|
25646
26125
|
throw new Error("unsupported increaseStakedLiquidity: unstake first to increase lp");
|
|
25647
26126
|
|
|
25648
26127
|
case 23:
|
|
25649
|
-
|
|
26128
|
+
_context33.next = 25;
|
|
25650
26129
|
return getPoolTxOrGasEstimate(this, [dappAddress, txData, options], estimateGas);
|
|
25651
26130
|
|
|
25652
26131
|
case 25:
|
|
25653
|
-
tx =
|
|
25654
|
-
return
|
|
26132
|
+
tx = _context33.sent;
|
|
26133
|
+
return _context33.abrupt("return", tx);
|
|
25655
26134
|
|
|
25656
26135
|
case 27:
|
|
25657
26136
|
case "end":
|
|
25658
|
-
return
|
|
26137
|
+
return _context33.stop();
|
|
25659
26138
|
}
|
|
25660
26139
|
}
|
|
25661
|
-
},
|
|
26140
|
+
}, _callee33, this);
|
|
25662
26141
|
}));
|
|
25663
26142
|
|
|
25664
|
-
function increaseLiquidity(
|
|
26143
|
+
function increaseLiquidity(_x155, _x156, _x157, _x158, _x159, _x160) {
|
|
25665
26144
|
return _increaseLiquidity.apply(this, arguments);
|
|
25666
26145
|
}
|
|
25667
26146
|
|
|
@@ -25680,11 +26159,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
25680
26159
|
_proto.claimFees =
|
|
25681
26160
|
/*#__PURE__*/
|
|
25682
26161
|
function () {
|
|
25683
|
-
var _claimFees = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
26162
|
+
var _claimFees = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee34(dapp, tokenId, options, estimateGas) {
|
|
25684
26163
|
var txData, contractAddress, iNonfungiblePositionManager, abi, tokenIdOwner, tx;
|
|
25685
|
-
return runtime_1.wrap(function
|
|
26164
|
+
return runtime_1.wrap(function _callee34$(_context34) {
|
|
25686
26165
|
while (1) {
|
|
25687
|
-
switch (
|
|
26166
|
+
switch (_context34.prev = _context34.next) {
|
|
25688
26167
|
case 0:
|
|
25689
26168
|
if (options === void 0) {
|
|
25690
26169
|
options = null;
|
|
@@ -25695,37 +26174,37 @@ var Pool = /*#__PURE__*/function () {
|
|
|
25695
26174
|
}
|
|
25696
26175
|
|
|
25697
26176
|
iNonfungiblePositionManager = new ethers.utils.Interface(INonfungiblePositionManager.abi);
|
|
25698
|
-
|
|
25699
|
-
|
|
26177
|
+
_context34.t0 = dapp;
|
|
26178
|
+
_context34.next = _context34.t0 === Dapp.UNISWAPV3 ? 6 : _context34.t0 === Dapp.RAMSESCL ? 6 : _context34.t0 === Dapp.ARRAKIS ? 9 : _context34.t0 === Dapp.BALANCER ? 9 : _context34.t0 === Dapp.VELODROME ? 13 : _context34.t0 === Dapp.RAMSES ? 13 : _context34.t0 === Dapp.VELODROMEV2 ? 16 : _context34.t0 === Dapp.AERODROME ? 16 : _context34.t0 === Dapp.VELODROMECL ? 19 : _context34.t0 === Dapp.AERODROMECL ? 19 : 24;
|
|
25700
26179
|
break;
|
|
25701
26180
|
|
|
25702
26181
|
case 6:
|
|
25703
26182
|
contractAddress = nonfungiblePositionManagerAddress[this.network][dapp];
|
|
25704
26183
|
txData = iNonfungiblePositionManager.encodeFunctionData(Transaction.COLLECT, [[tokenId, this.address, MaxUint128, MaxUint128]]);
|
|
25705
|
-
return
|
|
26184
|
+
return _context34.abrupt("break", 25);
|
|
25706
26185
|
|
|
25707
26186
|
case 9:
|
|
25708
26187
|
contractAddress = tokenId;
|
|
25709
26188
|
abi = new ethers.utils.Interface(ILiquidityGaugeV4.abi);
|
|
25710
26189
|
txData = abi.encodeFunctionData("claim_rewards()", []);
|
|
25711
|
-
return
|
|
26190
|
+
return _context34.abrupt("break", 25);
|
|
25712
26191
|
|
|
25713
26192
|
case 13:
|
|
25714
26193
|
contractAddress = tokenId;
|
|
25715
26194
|
txData = getVelodromeClaimTxData(this, tokenId, false);
|
|
25716
|
-
return
|
|
26195
|
+
return _context34.abrupt("break", 25);
|
|
25717
26196
|
|
|
25718
26197
|
case 16:
|
|
25719
26198
|
contractAddress = tokenId;
|
|
25720
26199
|
txData = getVelodromeClaimTxData(this, tokenId, true);
|
|
25721
|
-
return
|
|
26200
|
+
return _context34.abrupt("break", 25);
|
|
25722
26201
|
|
|
25723
26202
|
case 19:
|
|
25724
|
-
|
|
26203
|
+
_context34.next = 21;
|
|
25725
26204
|
return getVelodromeClOwner(this, dapp, tokenId);
|
|
25726
26205
|
|
|
25727
26206
|
case 21:
|
|
25728
|
-
tokenIdOwner =
|
|
26207
|
+
tokenIdOwner = _context34.sent;
|
|
25729
26208
|
|
|
25730
26209
|
if (tokenIdOwner.toLowerCase() === this.address.toLowerCase()) {
|
|
25731
26210
|
contractAddress = nonfungiblePositionManagerAddress[this.network][dapp];
|
|
@@ -25736,28 +26215,28 @@ var Pool = /*#__PURE__*/function () {
|
|
|
25736
26215
|
txData = getVelodromeCLClaimTxData(tokenId);
|
|
25737
26216
|
}
|
|
25738
26217
|
|
|
25739
|
-
return
|
|
26218
|
+
return _context34.abrupt("break", 25);
|
|
25740
26219
|
|
|
25741
26220
|
case 24:
|
|
25742
26221
|
throw new Error("dapp not supported");
|
|
25743
26222
|
|
|
25744
26223
|
case 25:
|
|
25745
|
-
|
|
26224
|
+
_context34.next = 27;
|
|
25746
26225
|
return getPoolTxOrGasEstimate(this, [contractAddress, txData, options], estimateGas);
|
|
25747
26226
|
|
|
25748
26227
|
case 27:
|
|
25749
|
-
tx =
|
|
25750
|
-
return
|
|
26228
|
+
tx = _context34.sent;
|
|
26229
|
+
return _context34.abrupt("return", tx);
|
|
25751
26230
|
|
|
25752
26231
|
case 29:
|
|
25753
26232
|
case "end":
|
|
25754
|
-
return
|
|
26233
|
+
return _context34.stop();
|
|
25755
26234
|
}
|
|
25756
26235
|
}
|
|
25757
|
-
},
|
|
26236
|
+
}, _callee34, this);
|
|
25758
26237
|
}));
|
|
25759
26238
|
|
|
25760
|
-
function claimFees(
|
|
26239
|
+
function claimFees(_x161, _x162, _x163, _x164) {
|
|
25761
26240
|
return _claimFees.apply(this, arguments);
|
|
25762
26241
|
}
|
|
25763
26242
|
|
|
@@ -25777,11 +26256,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
25777
26256
|
_proto.getRewards =
|
|
25778
26257
|
/*#__PURE__*/
|
|
25779
26258
|
function () {
|
|
25780
|
-
var _getRewards = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
26259
|
+
var _getRewards = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee35(dapp, tokenId, rewards, options, estimateGas) {
|
|
25781
26260
|
var tx;
|
|
25782
|
-
return runtime_1.wrap(function
|
|
26261
|
+
return runtime_1.wrap(function _callee35$(_context35) {
|
|
25783
26262
|
while (1) {
|
|
25784
|
-
switch (
|
|
26263
|
+
switch (_context35.prev = _context35.next) {
|
|
25785
26264
|
case 0:
|
|
25786
26265
|
if (options === void 0) {
|
|
25787
26266
|
options = null;
|
|
@@ -25791,22 +26270,22 @@ var Pool = /*#__PURE__*/function () {
|
|
|
25791
26270
|
estimateGas = false;
|
|
25792
26271
|
}
|
|
25793
26272
|
|
|
25794
|
-
|
|
26273
|
+
_context35.next = 4;
|
|
25795
26274
|
return getPoolTxOrGasEstimate(this, [nonfungiblePositionManagerAddress[this.network][dapp], getRewardsTxDta(tokenId, rewards), options], estimateGas);
|
|
25796
26275
|
|
|
25797
26276
|
case 4:
|
|
25798
|
-
tx =
|
|
25799
|
-
return
|
|
26277
|
+
tx = _context35.sent;
|
|
26278
|
+
return _context35.abrupt("return", tx);
|
|
25800
26279
|
|
|
25801
26280
|
case 6:
|
|
25802
26281
|
case "end":
|
|
25803
|
-
return
|
|
26282
|
+
return _context35.stop();
|
|
25804
26283
|
}
|
|
25805
26284
|
}
|
|
25806
|
-
},
|
|
26285
|
+
}, _callee35, this);
|
|
25807
26286
|
}));
|
|
25808
26287
|
|
|
25809
|
-
function getRewards(
|
|
26288
|
+
function getRewards(_x165, _x166, _x167, _x168, _x169) {
|
|
25810
26289
|
return _getRewards.apply(this, arguments);
|
|
25811
26290
|
}
|
|
25812
26291
|
|
|
@@ -25829,11 +26308,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
25829
26308
|
_proto.tradeUniswapV3 =
|
|
25830
26309
|
/*#__PURE__*/
|
|
25831
26310
|
function () {
|
|
25832
|
-
var _tradeUniswapV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
26311
|
+
var _tradeUniswapV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee36(assetFrom, assetTo, amountIn, feeAmount, slippage, options, estimateGas) {
|
|
25833
26312
|
var swapxData, tx;
|
|
25834
|
-
return runtime_1.wrap(function
|
|
26313
|
+
return runtime_1.wrap(function _callee36$(_context36) {
|
|
25835
26314
|
while (1) {
|
|
25836
|
-
switch (
|
|
26315
|
+
switch (_context36.prev = _context36.next) {
|
|
25837
26316
|
case 0:
|
|
25838
26317
|
if (slippage === void 0) {
|
|
25839
26318
|
slippage = 0.5;
|
|
@@ -25847,27 +26326,27 @@ var Pool = /*#__PURE__*/function () {
|
|
|
25847
26326
|
estimateGas = false;
|
|
25848
26327
|
}
|
|
25849
26328
|
|
|
25850
|
-
|
|
26329
|
+
_context36.next = 5;
|
|
25851
26330
|
return getUniswapV3SwapTxData(this, assetFrom, assetTo, amountIn, slippage, feeAmount);
|
|
25852
26331
|
|
|
25853
26332
|
case 5:
|
|
25854
|
-
swapxData =
|
|
25855
|
-
|
|
26333
|
+
swapxData = _context36.sent;
|
|
26334
|
+
_context36.next = 8;
|
|
25856
26335
|
return getPoolTxOrGasEstimate(this, [routerAddress[this.network][Dapp.UNISWAPV3], swapxData, options], estimateGas);
|
|
25857
26336
|
|
|
25858
26337
|
case 8:
|
|
25859
|
-
tx =
|
|
25860
|
-
return
|
|
26338
|
+
tx = _context36.sent;
|
|
26339
|
+
return _context36.abrupt("return", tx);
|
|
25861
26340
|
|
|
25862
26341
|
case 10:
|
|
25863
26342
|
case "end":
|
|
25864
|
-
return
|
|
26343
|
+
return _context36.stop();
|
|
25865
26344
|
}
|
|
25866
26345
|
}
|
|
25867
|
-
},
|
|
26346
|
+
}, _callee36, this);
|
|
25868
26347
|
}));
|
|
25869
26348
|
|
|
25870
|
-
function tradeUniswapV3(
|
|
26349
|
+
function tradeUniswapV3(_x170, _x171, _x172, _x173, _x174, _x175, _x176) {
|
|
25871
26350
|
return _tradeUniswapV.apply(this, arguments);
|
|
25872
26351
|
}
|
|
25873
26352
|
|
|
@@ -25886,71 +26365,10 @@ var Pool = /*#__PURE__*/function () {
|
|
|
25886
26365
|
*/
|
|
25887
26366
|
;
|
|
25888
26367
|
|
|
25889
|
-
_proto.addLiquidityVelodrome =
|
|
25890
|
-
/*#__PURE__*/
|
|
25891
|
-
function () {
|
|
25892
|
-
var _addLiquidityVelodrome = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee36(assetA, assetB, amountA, amountB, isStable, options, estimateGas) {
|
|
25893
|
-
var tx;
|
|
25894
|
-
return runtime_1.wrap(function _callee36$(_context36) {
|
|
25895
|
-
while (1) {
|
|
25896
|
-
switch (_context36.prev = _context36.next) {
|
|
25897
|
-
case 0:
|
|
25898
|
-
if (options === void 0) {
|
|
25899
|
-
options = null;
|
|
25900
|
-
}
|
|
25901
|
-
|
|
25902
|
-
if (estimateGas === void 0) {
|
|
25903
|
-
estimateGas = false;
|
|
25904
|
-
}
|
|
25905
|
-
|
|
25906
|
-
_context36.t0 = getPoolTxOrGasEstimate;
|
|
25907
|
-
_context36.t1 = this;
|
|
25908
|
-
_context36.t2 = routerAddress[this.network][Dapp.VELODROME];
|
|
25909
|
-
_context36.next = 7;
|
|
25910
|
-
return getVelodromeAddLiquidityTxData(this, assetA, assetB, amountA, amountB, isStable);
|
|
25911
|
-
|
|
25912
|
-
case 7:
|
|
25913
|
-
_context36.t3 = _context36.sent;
|
|
25914
|
-
_context36.t4 = options;
|
|
25915
|
-
_context36.t5 = [_context36.t2, _context36.t3, _context36.t4];
|
|
25916
|
-
_context36.t6 = estimateGas;
|
|
25917
|
-
_context36.next = 13;
|
|
25918
|
-
return (0, _context36.t0)(_context36.t1, _context36.t5, _context36.t6);
|
|
25919
|
-
|
|
25920
|
-
case 13:
|
|
25921
|
-
tx = _context36.sent;
|
|
25922
|
-
return _context36.abrupt("return", tx);
|
|
25923
|
-
|
|
25924
|
-
case 15:
|
|
25925
|
-
case "end":
|
|
25926
|
-
return _context36.stop();
|
|
25927
|
-
}
|
|
25928
|
-
}
|
|
25929
|
-
}, _callee36, this);
|
|
25930
|
-
}));
|
|
25931
|
-
|
|
25932
|
-
function addLiquidityVelodrome(_x174, _x175, _x176, _x177, _x178, _x179, _x180) {
|
|
25933
|
-
return _addLiquidityVelodrome.apply(this, arguments);
|
|
25934
|
-
}
|
|
25935
|
-
|
|
25936
|
-
return addLiquidityVelodrome;
|
|
25937
|
-
}()
|
|
25938
|
-
/**
|
|
25939
|
-
* Remove liquidity from Velodrome pool
|
|
25940
|
-
* @param {string} assetA First asset
|
|
25941
|
-
* @param {string} assetB Second asset
|
|
25942
|
-
* @param {BigNumber | string} amount Amount of LP tokens
|
|
25943
|
-
* @param { boolean } isStable Is stable pool
|
|
25944
|
-
* @param {any} options Transaction options
|
|
25945
|
-
* @param {boolean} estimateGas Simulate/estimate gas
|
|
25946
|
-
* @returns {Promise<any>} Transaction
|
|
25947
|
-
*/
|
|
25948
|
-
;
|
|
25949
|
-
|
|
25950
|
-
_proto.removeLiquidityVelodrome =
|
|
26368
|
+
_proto.addLiquidityVelodrome =
|
|
25951
26369
|
/*#__PURE__*/
|
|
25952
26370
|
function () {
|
|
25953
|
-
var
|
|
26371
|
+
var _addLiquidityVelodrome = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee37(assetA, assetB, amountA, amountB, isStable, options, estimateGas) {
|
|
25954
26372
|
var tx;
|
|
25955
26373
|
return runtime_1.wrap(function _callee37$(_context37) {
|
|
25956
26374
|
while (1) {
|
|
@@ -25968,7 +26386,7 @@ var Pool = /*#__PURE__*/function () {
|
|
|
25968
26386
|
_context37.t1 = this;
|
|
25969
26387
|
_context37.t2 = routerAddress[this.network][Dapp.VELODROME];
|
|
25970
26388
|
_context37.next = 7;
|
|
25971
|
-
return
|
|
26389
|
+
return getVelodromeAddLiquidityTxData(this, assetA, assetB, amountA, amountB, isStable);
|
|
25972
26390
|
|
|
25973
26391
|
case 7:
|
|
25974
26392
|
_context37.t3 = _context37.sent;
|
|
@@ -25990,18 +26408,17 @@ var Pool = /*#__PURE__*/function () {
|
|
|
25990
26408
|
}, _callee37, this);
|
|
25991
26409
|
}));
|
|
25992
26410
|
|
|
25993
|
-
function
|
|
25994
|
-
return
|
|
26411
|
+
function addLiquidityVelodrome(_x177, _x178, _x179, _x180, _x181, _x182, _x183) {
|
|
26412
|
+
return _addLiquidityVelodrome.apply(this, arguments);
|
|
25995
26413
|
}
|
|
25996
26414
|
|
|
25997
|
-
return
|
|
26415
|
+
return addLiquidityVelodrome;
|
|
25998
26416
|
}()
|
|
25999
26417
|
/**
|
|
26000
|
-
*
|
|
26418
|
+
* Remove liquidity from Velodrome pool
|
|
26001
26419
|
* @param {string} assetA First asset
|
|
26002
26420
|
* @param {string} assetB Second asset
|
|
26003
|
-
* @param {BigNumber | string}
|
|
26004
|
-
* @param {BigNumber | string} amountB Amount second asset
|
|
26421
|
+
* @param {BigNumber | string} amount Amount of LP tokens
|
|
26005
26422
|
* @param { boolean } isStable Is stable pool
|
|
26006
26423
|
* @param {any} options Transaction options
|
|
26007
26424
|
* @param {boolean} estimateGas Simulate/estimate gas
|
|
@@ -26009,10 +26426,10 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26009
26426
|
*/
|
|
26010
26427
|
;
|
|
26011
26428
|
|
|
26012
|
-
_proto.
|
|
26429
|
+
_proto.removeLiquidityVelodrome =
|
|
26013
26430
|
/*#__PURE__*/
|
|
26014
26431
|
function () {
|
|
26015
|
-
var
|
|
26432
|
+
var _removeLiquidityVelodrome = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee38(assetA, assetB, amount, isStable, options, estimateGas) {
|
|
26016
26433
|
var tx;
|
|
26017
26434
|
return runtime_1.wrap(function _callee38$(_context38) {
|
|
26018
26435
|
while (1) {
|
|
@@ -26028,9 +26445,9 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26028
26445
|
|
|
26029
26446
|
_context38.t0 = getPoolTxOrGasEstimate;
|
|
26030
26447
|
_context38.t1 = this;
|
|
26031
|
-
_context38.t2 = routerAddress[this.network][Dapp.
|
|
26448
|
+
_context38.t2 = routerAddress[this.network][Dapp.VELODROME];
|
|
26032
26449
|
_context38.next = 7;
|
|
26033
|
-
return
|
|
26450
|
+
return getVelodromeRemoveLiquidityTxData(this, assetA, assetB, amount, isStable);
|
|
26034
26451
|
|
|
26035
26452
|
case 7:
|
|
26036
26453
|
_context38.t3 = _context38.sent;
|
|
@@ -26052,17 +26469,18 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26052
26469
|
}, _callee38, this);
|
|
26053
26470
|
}));
|
|
26054
26471
|
|
|
26055
|
-
function
|
|
26056
|
-
return
|
|
26472
|
+
function removeLiquidityVelodrome(_x184, _x185, _x186, _x187, _x188, _x189) {
|
|
26473
|
+
return _removeLiquidityVelodrome.apply(this, arguments);
|
|
26057
26474
|
}
|
|
26058
26475
|
|
|
26059
|
-
return
|
|
26476
|
+
return removeLiquidityVelodrome;
|
|
26060
26477
|
}()
|
|
26061
26478
|
/**
|
|
26062
|
-
*
|
|
26479
|
+
* Add liquidity to Velodrome V2 pool
|
|
26063
26480
|
* @param {string} assetA First asset
|
|
26064
26481
|
* @param {string} assetB Second asset
|
|
26065
|
-
* @param {BigNumber | string}
|
|
26482
|
+
* @param {BigNumber | string} amountA Amount first asset
|
|
26483
|
+
* @param {BigNumber | string} amountB Amount second asset
|
|
26066
26484
|
* @param { boolean } isStable Is stable pool
|
|
26067
26485
|
* @param {any} options Transaction options
|
|
26068
26486
|
* @param {boolean} estimateGas Simulate/estimate gas
|
|
@@ -26070,10 +26488,10 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26070
26488
|
*/
|
|
26071
26489
|
;
|
|
26072
26490
|
|
|
26073
|
-
_proto.
|
|
26491
|
+
_proto.addLiquidityVelodromeV2 =
|
|
26074
26492
|
/*#__PURE__*/
|
|
26075
26493
|
function () {
|
|
26076
|
-
var
|
|
26494
|
+
var _addLiquidityVelodromeV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee39(assetA, assetB, amountA, amountB, isStable, options, estimateGas) {
|
|
26077
26495
|
var tx;
|
|
26078
26496
|
return runtime_1.wrap(function _callee39$(_context39) {
|
|
26079
26497
|
while (1) {
|
|
@@ -26091,7 +26509,7 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26091
26509
|
_context39.t1 = this;
|
|
26092
26510
|
_context39.t2 = routerAddress[this.network][Dapp.VELODROMEV2];
|
|
26093
26511
|
_context39.next = 7;
|
|
26094
|
-
return
|
|
26512
|
+
return getVelodromeAddLiquidityTxData(this, assetA, assetB, amountA, amountB, isStable);
|
|
26095
26513
|
|
|
26096
26514
|
case 7:
|
|
26097
26515
|
_context39.t3 = _context39.sent;
|
|
@@ -26113,19 +26531,17 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26113
26531
|
}, _callee39, this);
|
|
26114
26532
|
}));
|
|
26115
26533
|
|
|
26116
|
-
function
|
|
26117
|
-
return
|
|
26534
|
+
function addLiquidityVelodromeV2(_x190, _x191, _x192, _x193, _x194, _x195, _x196) {
|
|
26535
|
+
return _addLiquidityVelodromeV.apply(this, arguments);
|
|
26118
26536
|
}
|
|
26119
26537
|
|
|
26120
|
-
return
|
|
26538
|
+
return addLiquidityVelodromeV2;
|
|
26121
26539
|
}()
|
|
26122
26540
|
/**
|
|
26123
|
-
*
|
|
26124
|
-
* @param {Dapp} dapp VelodromeV2, Ramses or Aerodrome
|
|
26541
|
+
* Remove liquidity from Velodrome V2 pool
|
|
26125
26542
|
* @param {string} assetA First asset
|
|
26126
26543
|
* @param {string} assetB Second asset
|
|
26127
|
-
* @param {BigNumber | string}
|
|
26128
|
-
* @param {BigNumber | string} amountB Amount second asset
|
|
26544
|
+
* @param {BigNumber | string} amount Amount of LP tokens
|
|
26129
26545
|
* @param { boolean } isStable Is stable pool
|
|
26130
26546
|
* @param {any} options Transaction options
|
|
26131
26547
|
* @param {boolean} estimateGas Simulate/estimate gas
|
|
@@ -26133,10 +26549,10 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26133
26549
|
*/
|
|
26134
26550
|
;
|
|
26135
26551
|
|
|
26136
|
-
_proto.
|
|
26552
|
+
_proto.removeLiquidityVelodromeV2 =
|
|
26137
26553
|
/*#__PURE__*/
|
|
26138
26554
|
function () {
|
|
26139
|
-
var
|
|
26555
|
+
var _removeLiquidityVelodromeV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee40(assetA, assetB, amount, isStable, options, estimateGas) {
|
|
26140
26556
|
var tx;
|
|
26141
26557
|
return runtime_1.wrap(function _callee40$(_context40) {
|
|
26142
26558
|
while (1) {
|
|
@@ -26152,9 +26568,9 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26152
26568
|
|
|
26153
26569
|
_context40.t0 = getPoolTxOrGasEstimate;
|
|
26154
26570
|
_context40.t1 = this;
|
|
26155
|
-
_context40.t2 = routerAddress[this.network][
|
|
26571
|
+
_context40.t2 = routerAddress[this.network][Dapp.VELODROMEV2];
|
|
26156
26572
|
_context40.next = 7;
|
|
26157
|
-
return
|
|
26573
|
+
return getVelodromeRemoveLiquidityTxData(this, assetA, assetB, amount, isStable);
|
|
26158
26574
|
|
|
26159
26575
|
case 7:
|
|
26160
26576
|
_context40.t3 = _context40.sent;
|
|
@@ -26176,18 +26592,19 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26176
26592
|
}, _callee40, this);
|
|
26177
26593
|
}));
|
|
26178
26594
|
|
|
26179
|
-
function
|
|
26180
|
-
return
|
|
26595
|
+
function removeLiquidityVelodromeV2(_x197, _x198, _x199, _x200, _x201, _x202) {
|
|
26596
|
+
return _removeLiquidityVelodromeV.apply(this, arguments);
|
|
26181
26597
|
}
|
|
26182
26598
|
|
|
26183
|
-
return
|
|
26599
|
+
return removeLiquidityVelodromeV2;
|
|
26184
26600
|
}()
|
|
26185
26601
|
/**
|
|
26186
|
-
*
|
|
26602
|
+
* Add liquidity to Velodrome V2 or Ramses pool
|
|
26187
26603
|
* @param {Dapp} dapp VelodromeV2, Ramses or Aerodrome
|
|
26188
26604
|
* @param {string} assetA First asset
|
|
26189
26605
|
* @param {string} assetB Second asset
|
|
26190
|
-
* @param {BigNumber | string}
|
|
26606
|
+
* @param {BigNumber | string} amountA Amount first asset
|
|
26607
|
+
* @param {BigNumber | string} amountB Amount second asset
|
|
26191
26608
|
* @param { boolean } isStable Is stable pool
|
|
26192
26609
|
* @param {any} options Transaction options
|
|
26193
26610
|
* @param {boolean} estimateGas Simulate/estimate gas
|
|
@@ -26195,10 +26612,10 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26195
26612
|
*/
|
|
26196
26613
|
;
|
|
26197
26614
|
|
|
26198
|
-
_proto.
|
|
26615
|
+
_proto.addLiquidityV2 =
|
|
26199
26616
|
/*#__PURE__*/
|
|
26200
26617
|
function () {
|
|
26201
|
-
var
|
|
26618
|
+
var _addLiquidityV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee41(dapp, assetA, assetB, amountA, amountB, isStable, options, estimateGas) {
|
|
26202
26619
|
var tx;
|
|
26203
26620
|
return runtime_1.wrap(function _callee41$(_context41) {
|
|
26204
26621
|
while (1) {
|
|
@@ -26216,7 +26633,7 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26216
26633
|
_context41.t1 = this;
|
|
26217
26634
|
_context41.t2 = routerAddress[this.network][dapp];
|
|
26218
26635
|
_context41.next = 7;
|
|
26219
|
-
return
|
|
26636
|
+
return getVelodromeAddLiquidityTxData(this, assetA, assetB, amountA, amountB, isStable);
|
|
26220
26637
|
|
|
26221
26638
|
case 7:
|
|
26222
26639
|
_context41.t3 = _context41.sent;
|
|
@@ -26238,7 +26655,69 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26238
26655
|
}, _callee41, this);
|
|
26239
26656
|
}));
|
|
26240
26657
|
|
|
26241
|
-
function
|
|
26658
|
+
function addLiquidityV2(_x203, _x204, _x205, _x206, _x207, _x208, _x209, _x210) {
|
|
26659
|
+
return _addLiquidityV.apply(this, arguments);
|
|
26660
|
+
}
|
|
26661
|
+
|
|
26662
|
+
return addLiquidityV2;
|
|
26663
|
+
}()
|
|
26664
|
+
/**
|
|
26665
|
+
* Remove liquidity from Velodrome V2 or Ramses pool
|
|
26666
|
+
* @param {Dapp} dapp VelodromeV2, Ramses or Aerodrome
|
|
26667
|
+
* @param {string} assetA First asset
|
|
26668
|
+
* @param {string} assetB Second asset
|
|
26669
|
+
* @param {BigNumber | string} amount Amount of LP tokens
|
|
26670
|
+
* @param { boolean } isStable Is stable pool
|
|
26671
|
+
* @param {any} options Transaction options
|
|
26672
|
+
* @param {boolean} estimateGas Simulate/estimate gas
|
|
26673
|
+
* @returns {Promise<any>} Transaction
|
|
26674
|
+
*/
|
|
26675
|
+
;
|
|
26676
|
+
|
|
26677
|
+
_proto.removeLiquidityV2 =
|
|
26678
|
+
/*#__PURE__*/
|
|
26679
|
+
function () {
|
|
26680
|
+
var _removeLiquidityV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee42(dapp, assetA, assetB, amount, isStable, options, estimateGas) {
|
|
26681
|
+
var tx;
|
|
26682
|
+
return runtime_1.wrap(function _callee42$(_context42) {
|
|
26683
|
+
while (1) {
|
|
26684
|
+
switch (_context42.prev = _context42.next) {
|
|
26685
|
+
case 0:
|
|
26686
|
+
if (options === void 0) {
|
|
26687
|
+
options = null;
|
|
26688
|
+
}
|
|
26689
|
+
|
|
26690
|
+
if (estimateGas === void 0) {
|
|
26691
|
+
estimateGas = false;
|
|
26692
|
+
}
|
|
26693
|
+
|
|
26694
|
+
_context42.t0 = getPoolTxOrGasEstimate;
|
|
26695
|
+
_context42.t1 = this;
|
|
26696
|
+
_context42.t2 = routerAddress[this.network][dapp];
|
|
26697
|
+
_context42.next = 7;
|
|
26698
|
+
return getVelodromeRemoveLiquidityTxData(this, assetA, assetB, amount, isStable);
|
|
26699
|
+
|
|
26700
|
+
case 7:
|
|
26701
|
+
_context42.t3 = _context42.sent;
|
|
26702
|
+
_context42.t4 = options;
|
|
26703
|
+
_context42.t5 = [_context42.t2, _context42.t3, _context42.t4];
|
|
26704
|
+
_context42.t6 = estimateGas;
|
|
26705
|
+
_context42.next = 13;
|
|
26706
|
+
return (0, _context42.t0)(_context42.t1, _context42.t5, _context42.t6);
|
|
26707
|
+
|
|
26708
|
+
case 13:
|
|
26709
|
+
tx = _context42.sent;
|
|
26710
|
+
return _context42.abrupt("return", tx);
|
|
26711
|
+
|
|
26712
|
+
case 15:
|
|
26713
|
+
case "end":
|
|
26714
|
+
return _context42.stop();
|
|
26715
|
+
}
|
|
26716
|
+
}
|
|
26717
|
+
}, _callee42, this);
|
|
26718
|
+
}));
|
|
26719
|
+
|
|
26720
|
+
function removeLiquidityV2(_x211, _x212, _x213, _x214, _x215, _x216, _x217) {
|
|
26242
26721
|
return _removeLiquidityV.apply(this, arguments);
|
|
26243
26722
|
}
|
|
26244
26723
|
|
|
@@ -26264,11 +26743,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26264
26743
|
_proto.tradeLyraOption =
|
|
26265
26744
|
/*#__PURE__*/
|
|
26266
26745
|
function () {
|
|
26267
|
-
var _tradeLyraOption = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
26746
|
+
var _tradeLyraOption = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee43(market, expiry, strike, optionType, tradeType, optionAmount, assetIn, collateralChangeAmount, isCoveredCall, options, estimateGas) {
|
|
26268
26747
|
var swapxData, tx;
|
|
26269
|
-
return runtime_1.wrap(function
|
|
26748
|
+
return runtime_1.wrap(function _callee43$(_context43) {
|
|
26270
26749
|
while (1) {
|
|
26271
|
-
switch (
|
|
26750
|
+
switch (_context43.prev = _context43.next) {
|
|
26272
26751
|
case 0:
|
|
26273
26752
|
if (collateralChangeAmount === void 0) {
|
|
26274
26753
|
collateralChangeAmount = "0";
|
|
@@ -26286,27 +26765,27 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26286
26765
|
estimateGas = false;
|
|
26287
26766
|
}
|
|
26288
26767
|
|
|
26289
|
-
|
|
26768
|
+
_context43.next = 6;
|
|
26290
26769
|
return getLyraOptionTxData(this, market, optionType, expiry, strike, tradeType, optionAmount, assetIn, BigNumber$1.from(collateralChangeAmount), isCoveredCall);
|
|
26291
26770
|
|
|
26292
26771
|
case 6:
|
|
26293
|
-
swapxData =
|
|
26294
|
-
|
|
26772
|
+
swapxData = _context43.sent;
|
|
26773
|
+
_context43.next = 9;
|
|
26295
26774
|
return getPoolTxOrGasEstimate(this, [routerAddress[this.network][Dapp.LYRA], swapxData, options], estimateGas);
|
|
26296
26775
|
|
|
26297
26776
|
case 9:
|
|
26298
|
-
tx =
|
|
26299
|
-
return
|
|
26777
|
+
tx = _context43.sent;
|
|
26778
|
+
return _context43.abrupt("return", tx);
|
|
26300
26779
|
|
|
26301
26780
|
case 11:
|
|
26302
26781
|
case "end":
|
|
26303
|
-
return
|
|
26782
|
+
return _context43.stop();
|
|
26304
26783
|
}
|
|
26305
26784
|
}
|
|
26306
|
-
},
|
|
26785
|
+
}, _callee43, this);
|
|
26307
26786
|
}));
|
|
26308
26787
|
|
|
26309
|
-
function tradeLyraOption(
|
|
26788
|
+
function tradeLyraOption(_x218, _x219, _x220, _x221, _x222, _x223, _x224, _x225, _x226, _x227, _x228) {
|
|
26310
26789
|
return _tradeLyraOption.apply(this, arguments);
|
|
26311
26790
|
}
|
|
26312
26791
|
|
|
@@ -26321,26 +26800,26 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26321
26800
|
_proto.getLyraPositions =
|
|
26322
26801
|
/*#__PURE__*/
|
|
26323
26802
|
function () {
|
|
26324
|
-
var _getLyraPositions = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
26325
|
-
return runtime_1.wrap(function
|
|
26803
|
+
var _getLyraPositions = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee44(market) {
|
|
26804
|
+
return runtime_1.wrap(function _callee44$(_context44) {
|
|
26326
26805
|
while (1) {
|
|
26327
|
-
switch (
|
|
26806
|
+
switch (_context44.prev = _context44.next) {
|
|
26328
26807
|
case 0:
|
|
26329
|
-
|
|
26808
|
+
_context44.next = 2;
|
|
26330
26809
|
return getOptionPositions(this, market);
|
|
26331
26810
|
|
|
26332
26811
|
case 2:
|
|
26333
|
-
return
|
|
26812
|
+
return _context44.abrupt("return", _context44.sent);
|
|
26334
26813
|
|
|
26335
26814
|
case 3:
|
|
26336
26815
|
case "end":
|
|
26337
|
-
return
|
|
26816
|
+
return _context44.stop();
|
|
26338
26817
|
}
|
|
26339
26818
|
}
|
|
26340
|
-
},
|
|
26819
|
+
}, _callee44, this);
|
|
26341
26820
|
}));
|
|
26342
26821
|
|
|
26343
|
-
function getLyraPositions(
|
|
26822
|
+
function getLyraPositions(_x229) {
|
|
26344
26823
|
return _getLyraPositions.apply(this, arguments);
|
|
26345
26824
|
}
|
|
26346
26825
|
|
|
@@ -26359,11 +26838,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26359
26838
|
_proto.changeFuturesMargin =
|
|
26360
26839
|
/*#__PURE__*/
|
|
26361
26840
|
function () {
|
|
26362
|
-
var _changeFuturesMargin = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
26841
|
+
var _changeFuturesMargin = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee45(market, changeAmount, options, estimateGas) {
|
|
26363
26842
|
var tx;
|
|
26364
|
-
return runtime_1.wrap(function
|
|
26843
|
+
return runtime_1.wrap(function _callee45$(_context45) {
|
|
26365
26844
|
while (1) {
|
|
26366
|
-
switch (
|
|
26845
|
+
switch (_context45.prev = _context45.next) {
|
|
26367
26846
|
case 0:
|
|
26368
26847
|
if (options === void 0) {
|
|
26369
26848
|
options = null;
|
|
@@ -26373,22 +26852,22 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26373
26852
|
estimateGas = false;
|
|
26374
26853
|
}
|
|
26375
26854
|
|
|
26376
|
-
|
|
26855
|
+
_context45.next = 4;
|
|
26377
26856
|
return getPoolTxOrGasEstimate(this, [market, getFuturesChangeMarginTxData(changeAmount), options], estimateGas);
|
|
26378
26857
|
|
|
26379
26858
|
case 4:
|
|
26380
|
-
tx =
|
|
26381
|
-
return
|
|
26859
|
+
tx = _context45.sent;
|
|
26860
|
+
return _context45.abrupt("return", tx);
|
|
26382
26861
|
|
|
26383
26862
|
case 6:
|
|
26384
26863
|
case "end":
|
|
26385
|
-
return
|
|
26864
|
+
return _context45.stop();
|
|
26386
26865
|
}
|
|
26387
26866
|
}
|
|
26388
|
-
},
|
|
26867
|
+
}, _callee45, this);
|
|
26389
26868
|
}));
|
|
26390
26869
|
|
|
26391
|
-
function changeFuturesMargin(
|
|
26870
|
+
function changeFuturesMargin(_x230, _x231, _x232, _x233) {
|
|
26392
26871
|
return _changeFuturesMargin.apply(this, arguments);
|
|
26393
26872
|
}
|
|
26394
26873
|
|
|
@@ -26407,11 +26886,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26407
26886
|
_proto.changeFuturesPosition =
|
|
26408
26887
|
/*#__PURE__*/
|
|
26409
26888
|
function () {
|
|
26410
|
-
var _changeFuturesPosition = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
26889
|
+
var _changeFuturesPosition = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee46(market, changeAmount, options, estimateGas) {
|
|
26411
26890
|
var txData, tx;
|
|
26412
|
-
return runtime_1.wrap(function
|
|
26891
|
+
return runtime_1.wrap(function _callee46$(_context46) {
|
|
26413
26892
|
while (1) {
|
|
26414
|
-
switch (
|
|
26893
|
+
switch (_context46.prev = _context46.next) {
|
|
26415
26894
|
case 0:
|
|
26416
26895
|
if (options === void 0) {
|
|
26417
26896
|
options = null;
|
|
@@ -26421,27 +26900,27 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26421
26900
|
estimateGas = false;
|
|
26422
26901
|
}
|
|
26423
26902
|
|
|
26424
|
-
|
|
26903
|
+
_context46.next = 4;
|
|
26425
26904
|
return getFuturesChangePositionTxData(changeAmount, market, this);
|
|
26426
26905
|
|
|
26427
26906
|
case 4:
|
|
26428
|
-
txData =
|
|
26429
|
-
|
|
26907
|
+
txData = _context46.sent;
|
|
26908
|
+
_context46.next = 7;
|
|
26430
26909
|
return getPoolTxOrGasEstimate(this, [market, txData, options], estimateGas);
|
|
26431
26910
|
|
|
26432
26911
|
case 7:
|
|
26433
|
-
tx =
|
|
26434
|
-
return
|
|
26912
|
+
tx = _context46.sent;
|
|
26913
|
+
return _context46.abrupt("return", tx);
|
|
26435
26914
|
|
|
26436
26915
|
case 9:
|
|
26437
26916
|
case "end":
|
|
26438
|
-
return
|
|
26917
|
+
return _context46.stop();
|
|
26439
26918
|
}
|
|
26440
26919
|
}
|
|
26441
|
-
},
|
|
26920
|
+
}, _callee46, this);
|
|
26442
26921
|
}));
|
|
26443
26922
|
|
|
26444
|
-
function changeFuturesPosition(
|
|
26923
|
+
function changeFuturesPosition(_x234, _x235, _x236, _x237) {
|
|
26445
26924
|
return _changeFuturesPosition.apply(this, arguments);
|
|
26446
26925
|
}
|
|
26447
26926
|
|
|
@@ -26459,11 +26938,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26459
26938
|
_proto.cancelFuturesOrder =
|
|
26460
26939
|
/*#__PURE__*/
|
|
26461
26940
|
function () {
|
|
26462
|
-
var _cancelFuturesOrder = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
26941
|
+
var _cancelFuturesOrder = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee47(market, options, estimateGas) {
|
|
26463
26942
|
var txData, tx;
|
|
26464
|
-
return runtime_1.wrap(function
|
|
26943
|
+
return runtime_1.wrap(function _callee47$(_context47) {
|
|
26465
26944
|
while (1) {
|
|
26466
|
-
switch (
|
|
26945
|
+
switch (_context47.prev = _context47.next) {
|
|
26467
26946
|
case 0:
|
|
26468
26947
|
if (options === void 0) {
|
|
26469
26948
|
options = null;
|
|
@@ -26473,27 +26952,27 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26473
26952
|
estimateGas = false;
|
|
26474
26953
|
}
|
|
26475
26954
|
|
|
26476
|
-
|
|
26955
|
+
_context47.next = 4;
|
|
26477
26956
|
return getFuturesCancelOrderTxData(this);
|
|
26478
26957
|
|
|
26479
26958
|
case 4:
|
|
26480
|
-
txData =
|
|
26481
|
-
|
|
26959
|
+
txData = _context47.sent;
|
|
26960
|
+
_context47.next = 7;
|
|
26482
26961
|
return getPoolTxOrGasEstimate(this, [market, txData, options], estimateGas);
|
|
26483
26962
|
|
|
26484
26963
|
case 7:
|
|
26485
|
-
tx =
|
|
26486
|
-
return
|
|
26964
|
+
tx = _context47.sent;
|
|
26965
|
+
return _context47.abrupt("return", tx);
|
|
26487
26966
|
|
|
26488
26967
|
case 9:
|
|
26489
26968
|
case "end":
|
|
26490
|
-
return
|
|
26969
|
+
return _context47.stop();
|
|
26491
26970
|
}
|
|
26492
26971
|
}
|
|
26493
|
-
},
|
|
26972
|
+
}, _callee47, this);
|
|
26494
26973
|
}));
|
|
26495
26974
|
|
|
26496
|
-
function cancelFuturesOrder(
|
|
26975
|
+
function cancelFuturesOrder(_x238, _x239, _x240) {
|
|
26497
26976
|
return _cancelFuturesOrder.apply(this, arguments);
|
|
26498
26977
|
}
|
|
26499
26978
|
|
|
@@ -26510,11 +26989,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26510
26989
|
_proto.mintManagerFee =
|
|
26511
26990
|
/*#__PURE__*/
|
|
26512
26991
|
function () {
|
|
26513
|
-
var _mintManagerFee = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
26992
|
+
var _mintManagerFee = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee48(options, estimateGas) {
|
|
26514
26993
|
var tx;
|
|
26515
|
-
return runtime_1.wrap(function
|
|
26994
|
+
return runtime_1.wrap(function _callee48$(_context48) {
|
|
26516
26995
|
while (1) {
|
|
26517
|
-
switch (
|
|
26996
|
+
switch (_context48.prev = _context48.next) {
|
|
26518
26997
|
case 0:
|
|
26519
26998
|
if (options === void 0) {
|
|
26520
26999
|
options = null;
|
|
@@ -26525,33 +27004,33 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26525
27004
|
}
|
|
26526
27005
|
|
|
26527
27006
|
if (!estimateGas) {
|
|
26528
|
-
|
|
27007
|
+
_context48.next = 6;
|
|
26529
27008
|
break;
|
|
26530
27009
|
}
|
|
26531
27010
|
|
|
26532
|
-
|
|
27011
|
+
_context48.next = 5;
|
|
26533
27012
|
return this.poolLogic.estimateGas.mintManagerFee(options);
|
|
26534
27013
|
|
|
26535
27014
|
case 5:
|
|
26536
|
-
return
|
|
27015
|
+
return _context48.abrupt("return", _context48.sent);
|
|
26537
27016
|
|
|
26538
27017
|
case 6:
|
|
26539
|
-
|
|
27018
|
+
_context48.next = 8;
|
|
26540
27019
|
return this.poolLogic.mintManagerFee(options);
|
|
26541
27020
|
|
|
26542
27021
|
case 8:
|
|
26543
|
-
tx =
|
|
26544
|
-
return
|
|
27022
|
+
tx = _context48.sent;
|
|
27023
|
+
return _context48.abrupt("return", tx);
|
|
26545
27024
|
|
|
26546
27025
|
case 10:
|
|
26547
27026
|
case "end":
|
|
26548
|
-
return
|
|
27027
|
+
return _context48.stop();
|
|
26549
27028
|
}
|
|
26550
27029
|
}
|
|
26551
|
-
},
|
|
27030
|
+
}, _callee48, this);
|
|
26552
27031
|
}));
|
|
26553
27032
|
|
|
26554
|
-
function mintManagerFee(
|
|
27033
|
+
function mintManagerFee(_x241, _x242) {
|
|
26555
27034
|
return _mintManagerFee.apply(this, arguments);
|
|
26556
27035
|
}
|
|
26557
27036
|
|
|
@@ -26566,25 +27045,25 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26566
27045
|
_proto.getAvailableManagerFee =
|
|
26567
27046
|
/*#__PURE__*/
|
|
26568
27047
|
function () {
|
|
26569
|
-
var _getAvailableManagerFee = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
27048
|
+
var _getAvailableManagerFee = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee49() {
|
|
26570
27049
|
var fee;
|
|
26571
|
-
return runtime_1.wrap(function
|
|
27050
|
+
return runtime_1.wrap(function _callee49$(_context49) {
|
|
26572
27051
|
while (1) {
|
|
26573
|
-
switch (
|
|
27052
|
+
switch (_context49.prev = _context49.next) {
|
|
26574
27053
|
case 0:
|
|
26575
|
-
|
|
27054
|
+
_context49.next = 2;
|
|
26576
27055
|
return this.poolLogic.availableManagerFee();
|
|
26577
27056
|
|
|
26578
27057
|
case 2:
|
|
26579
|
-
fee =
|
|
26580
|
-
return
|
|
27058
|
+
fee = _context49.sent;
|
|
27059
|
+
return _context49.abrupt("return", BigNumber$1.from(fee));
|
|
26581
27060
|
|
|
26582
27061
|
case 4:
|
|
26583
27062
|
case "end":
|
|
26584
|
-
return
|
|
27063
|
+
return _context49.stop();
|
|
26585
27064
|
}
|
|
26586
27065
|
}
|
|
26587
|
-
},
|
|
27066
|
+
}, _callee49, this);
|
|
26588
27067
|
}));
|
|
26589
27068
|
|
|
26590
27069
|
function getAvailableManagerFee() {
|
|
@@ -26606,11 +27085,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26606
27085
|
_proto.vestTokens =
|
|
26607
27086
|
/*#__PURE__*/
|
|
26608
27087
|
function () {
|
|
26609
|
-
var _vestTokens = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
27088
|
+
var _vestTokens = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee50(tokenAddress, amount, options, estimateGas) {
|
|
26610
27089
|
var txData, tx;
|
|
26611
|
-
return runtime_1.wrap(function
|
|
27090
|
+
return runtime_1.wrap(function _callee50$(_context50) {
|
|
26612
27091
|
while (1) {
|
|
26613
|
-
switch (
|
|
27092
|
+
switch (_context50.prev = _context50.next) {
|
|
26614
27093
|
case 0:
|
|
26615
27094
|
if (options === void 0) {
|
|
26616
27095
|
options = null;
|
|
@@ -26620,27 +27099,27 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26620
27099
|
estimateGas = false;
|
|
26621
27100
|
}
|
|
26622
27101
|
|
|
26623
|
-
|
|
27102
|
+
_context50.next = 4;
|
|
26624
27103
|
return getCreateVestTxData(amount);
|
|
26625
27104
|
|
|
26626
27105
|
case 4:
|
|
26627
|
-
txData =
|
|
26628
|
-
|
|
27106
|
+
txData = _context50.sent;
|
|
27107
|
+
_context50.next = 7;
|
|
26629
27108
|
return getPoolTxOrGasEstimate(this, [tokenAddress, txData, options], estimateGas);
|
|
26630
27109
|
|
|
26631
27110
|
case 7:
|
|
26632
|
-
tx =
|
|
26633
|
-
return
|
|
27111
|
+
tx = _context50.sent;
|
|
27112
|
+
return _context50.abrupt("return", tx);
|
|
26634
27113
|
|
|
26635
27114
|
case 9:
|
|
26636
27115
|
case "end":
|
|
26637
|
-
return
|
|
27116
|
+
return _context50.stop();
|
|
26638
27117
|
}
|
|
26639
27118
|
}
|
|
26640
|
-
},
|
|
27119
|
+
}, _callee50, this);
|
|
26641
27120
|
}));
|
|
26642
27121
|
|
|
26643
|
-
function vestTokens(
|
|
27122
|
+
function vestTokens(_x243, _x244, _x245, _x246) {
|
|
26644
27123
|
return _vestTokens.apply(this, arguments);
|
|
26645
27124
|
}
|
|
26646
27125
|
|
|
@@ -26659,11 +27138,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26659
27138
|
_proto.exitVestedToken =
|
|
26660
27139
|
/*#__PURE__*/
|
|
26661
27140
|
function () {
|
|
26662
|
-
var _exitVestedToken = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
27141
|
+
var _exitVestedToken = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee51(tokenAddress, id, options, estimateGas) {
|
|
26663
27142
|
var txData, tx;
|
|
26664
|
-
return runtime_1.wrap(function
|
|
27143
|
+
return runtime_1.wrap(function _callee51$(_context51) {
|
|
26665
27144
|
while (1) {
|
|
26666
|
-
switch (
|
|
27145
|
+
switch (_context51.prev = _context51.next) {
|
|
26667
27146
|
case 0:
|
|
26668
27147
|
if (options === void 0) {
|
|
26669
27148
|
options = null;
|
|
@@ -26673,27 +27152,27 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26673
27152
|
estimateGas = false;
|
|
26674
27153
|
}
|
|
26675
27154
|
|
|
26676
|
-
|
|
27155
|
+
_context51.next = 4;
|
|
26677
27156
|
return getExitVestTxData(id);
|
|
26678
27157
|
|
|
26679
27158
|
case 4:
|
|
26680
|
-
txData =
|
|
26681
|
-
|
|
27159
|
+
txData = _context51.sent;
|
|
27160
|
+
_context51.next = 7;
|
|
26682
27161
|
return getPoolTxOrGasEstimate(this, [tokenAddress, txData, options], estimateGas);
|
|
26683
27162
|
|
|
26684
27163
|
case 7:
|
|
26685
|
-
tx =
|
|
26686
|
-
return
|
|
27164
|
+
tx = _context51.sent;
|
|
27165
|
+
return _context51.abrupt("return", tx);
|
|
26687
27166
|
|
|
26688
27167
|
case 9:
|
|
26689
27168
|
case "end":
|
|
26690
|
-
return
|
|
27169
|
+
return _context51.stop();
|
|
26691
27170
|
}
|
|
26692
27171
|
}
|
|
26693
|
-
},
|
|
27172
|
+
}, _callee51, this);
|
|
26694
27173
|
}));
|
|
26695
27174
|
|
|
26696
|
-
function exitVestedToken(
|
|
27175
|
+
function exitVestedToken(_x247, _x248, _x249, _x250) {
|
|
26697
27176
|
return _exitVestedToken.apply(this, arguments);
|
|
26698
27177
|
}
|
|
26699
27178
|
|
|
@@ -26713,11 +27192,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26713
27192
|
_proto.mintUnitViaFlatMoney =
|
|
26714
27193
|
/*#__PURE__*/
|
|
26715
27194
|
function () {
|
|
26716
|
-
var _mintUnitViaFlatMoney2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
27195
|
+
var _mintUnitViaFlatMoney2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee52(depositAmount, slippage, maxKeeperFeeInUsd, options, estimateGas) {
|
|
26717
27196
|
var tx;
|
|
26718
|
-
return runtime_1.wrap(function
|
|
27197
|
+
return runtime_1.wrap(function _callee52$(_context52) {
|
|
26719
27198
|
while (1) {
|
|
26720
|
-
switch (
|
|
27199
|
+
switch (_context52.prev = _context52.next) {
|
|
26721
27200
|
case 0:
|
|
26722
27201
|
if (slippage === void 0) {
|
|
26723
27202
|
slippage = 0.5;
|
|
@@ -26731,22 +27210,22 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26731
27210
|
estimateGas = false;
|
|
26732
27211
|
}
|
|
26733
27212
|
|
|
26734
|
-
|
|
27213
|
+
_context52.next = 5;
|
|
26735
27214
|
return mintUnitViaFlatMoney(this, depositAmount, slippage, maxKeeperFeeInUsd, options, estimateGas);
|
|
26736
27215
|
|
|
26737
27216
|
case 5:
|
|
26738
|
-
tx =
|
|
26739
|
-
return
|
|
27217
|
+
tx = _context52.sent;
|
|
27218
|
+
return _context52.abrupt("return", tx);
|
|
26740
27219
|
|
|
26741
27220
|
case 7:
|
|
26742
27221
|
case "end":
|
|
26743
|
-
return
|
|
27222
|
+
return _context52.stop();
|
|
26744
27223
|
}
|
|
26745
27224
|
}
|
|
26746
|
-
},
|
|
27225
|
+
}, _callee52, this);
|
|
26747
27226
|
}));
|
|
26748
27227
|
|
|
26749
|
-
function mintUnitViaFlatMoney$1(
|
|
27228
|
+
function mintUnitViaFlatMoney$1(_x251, _x252, _x253, _x254, _x255) {
|
|
26750
27229
|
return _mintUnitViaFlatMoney2.apply(this, arguments);
|
|
26751
27230
|
}
|
|
26752
27231
|
|
|
@@ -26766,11 +27245,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26766
27245
|
_proto.redeemUnitViaFlatMoney =
|
|
26767
27246
|
/*#__PURE__*/
|
|
26768
27247
|
function () {
|
|
26769
|
-
var _redeemUnitViaFlatMoney2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
27248
|
+
var _redeemUnitViaFlatMoney2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee53(withdrawAmount, slippage, maxKeeperFeeInUsd, options, estimateGas) {
|
|
26770
27249
|
var tx;
|
|
26771
|
-
return runtime_1.wrap(function
|
|
27250
|
+
return runtime_1.wrap(function _callee53$(_context53) {
|
|
26772
27251
|
while (1) {
|
|
26773
|
-
switch (
|
|
27252
|
+
switch (_context53.prev = _context53.next) {
|
|
26774
27253
|
case 0:
|
|
26775
27254
|
if (slippage === void 0) {
|
|
26776
27255
|
slippage = 0.5;
|
|
@@ -26784,22 +27263,22 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26784
27263
|
estimateGas = false;
|
|
26785
27264
|
}
|
|
26786
27265
|
|
|
26787
|
-
|
|
27266
|
+
_context53.next = 5;
|
|
26788
27267
|
return redeemUnitViaFlatMoney(this, withdrawAmount, slippage, maxKeeperFeeInUsd, options, estimateGas);
|
|
26789
27268
|
|
|
26790
27269
|
case 5:
|
|
26791
|
-
tx =
|
|
26792
|
-
return
|
|
27270
|
+
tx = _context53.sent;
|
|
27271
|
+
return _context53.abrupt("return", tx);
|
|
26793
27272
|
|
|
26794
27273
|
case 7:
|
|
26795
27274
|
case "end":
|
|
26796
|
-
return
|
|
27275
|
+
return _context53.stop();
|
|
26797
27276
|
}
|
|
26798
27277
|
}
|
|
26799
|
-
},
|
|
27278
|
+
}, _callee53, this);
|
|
26800
27279
|
}));
|
|
26801
27280
|
|
|
26802
|
-
function redeemUnitViaFlatMoney$1(
|
|
27281
|
+
function redeemUnitViaFlatMoney$1(_x256, _x257, _x258, _x259, _x260) {
|
|
26803
27282
|
return _redeemUnitViaFlatMoney2.apply(this, arguments);
|
|
26804
27283
|
}
|
|
26805
27284
|
|
|
@@ -26807,11 +27286,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26807
27286
|
}();
|
|
26808
27287
|
|
|
26809
27288
|
_proto.cancelOrderViaFlatMoney = /*#__PURE__*/function () {
|
|
26810
|
-
var _cancelOrderViaFlatMoney2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
27289
|
+
var _cancelOrderViaFlatMoney2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee54(options, estimateGas) {
|
|
26811
27290
|
var tx;
|
|
26812
|
-
return runtime_1.wrap(function
|
|
27291
|
+
return runtime_1.wrap(function _callee54$(_context54) {
|
|
26813
27292
|
while (1) {
|
|
26814
|
-
switch (
|
|
27293
|
+
switch (_context54.prev = _context54.next) {
|
|
26815
27294
|
case 0:
|
|
26816
27295
|
if (options === void 0) {
|
|
26817
27296
|
options = null;
|
|
@@ -26821,22 +27300,22 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26821
27300
|
estimateGas = false;
|
|
26822
27301
|
}
|
|
26823
27302
|
|
|
26824
|
-
|
|
27303
|
+
_context54.next = 4;
|
|
26825
27304
|
return cancelOrderViaFlatMoney(this, options, estimateGas);
|
|
26826
27305
|
|
|
26827
27306
|
case 4:
|
|
26828
|
-
tx =
|
|
26829
|
-
return
|
|
27307
|
+
tx = _context54.sent;
|
|
27308
|
+
return _context54.abrupt("return", tx);
|
|
26830
27309
|
|
|
26831
27310
|
case 6:
|
|
26832
27311
|
case "end":
|
|
26833
|
-
return
|
|
27312
|
+
return _context54.stop();
|
|
26834
27313
|
}
|
|
26835
27314
|
}
|
|
26836
|
-
},
|
|
27315
|
+
}, _callee54, this);
|
|
26837
27316
|
}));
|
|
26838
27317
|
|
|
26839
|
-
function cancelOrderViaFlatMoney$1(
|
|
27318
|
+
function cancelOrderViaFlatMoney$1(_x261, _x262) {
|
|
26840
27319
|
return _cancelOrderViaFlatMoney2.apply(this, arguments);
|
|
26841
27320
|
}
|
|
26842
27321
|
|
|
@@ -26855,11 +27334,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26855
27334
|
_proto.completeTorosWithdrawal =
|
|
26856
27335
|
/*#__PURE__*/
|
|
26857
27336
|
function () {
|
|
26858
|
-
var _completeTorosWithdrawal = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
27337
|
+
var _completeTorosWithdrawal = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee55(destinationToken, slippage, options, estimateGas) {
|
|
26859
27338
|
var txData, tx;
|
|
26860
|
-
return runtime_1.wrap(function
|
|
27339
|
+
return runtime_1.wrap(function _callee55$(_context55) {
|
|
26861
27340
|
while (1) {
|
|
26862
|
-
switch (
|
|
27341
|
+
switch (_context55.prev = _context55.next) {
|
|
26863
27342
|
case 0:
|
|
26864
27343
|
if (slippage === void 0) {
|
|
26865
27344
|
slippage = 0.5;
|
|
@@ -26873,27 +27352,27 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26873
27352
|
estimateGas = false;
|
|
26874
27353
|
}
|
|
26875
27354
|
|
|
26876
|
-
|
|
27355
|
+
_context55.next = 5;
|
|
26877
27356
|
return getCompleteWithdrawalTxData(this, destinationToken, slippage);
|
|
26878
27357
|
|
|
26879
27358
|
case 5:
|
|
26880
|
-
txData =
|
|
26881
|
-
|
|
27359
|
+
txData = _context55.sent;
|
|
27360
|
+
_context55.next = 8;
|
|
26882
27361
|
return getPoolTxOrGasEstimate(this, [routerAddress[this.network].toros, txData, options], estimateGas);
|
|
26883
27362
|
|
|
26884
27363
|
case 8:
|
|
26885
|
-
tx =
|
|
26886
|
-
return
|
|
27364
|
+
tx = _context55.sent;
|
|
27365
|
+
return _context55.abrupt("return", tx);
|
|
26887
27366
|
|
|
26888
27367
|
case 10:
|
|
26889
27368
|
case "end":
|
|
26890
|
-
return
|
|
27369
|
+
return _context55.stop();
|
|
26891
27370
|
}
|
|
26892
27371
|
}
|
|
26893
|
-
},
|
|
27372
|
+
}, _callee55, this);
|
|
26894
27373
|
}));
|
|
26895
27374
|
|
|
26896
|
-
function completeTorosWithdrawal(
|
|
27375
|
+
function completeTorosWithdrawal(_x263, _x264, _x265, _x266) {
|
|
26897
27376
|
return _completeTorosWithdrawal.apply(this, arguments);
|
|
26898
27377
|
}
|
|
26899
27378
|
|