GMX v2 - Trading (#7)
* Move PrivateKeys.cs * Update gitignore * Update gitignore * updt * Extract GmxServiceTests.cs * Refact * update todo * Update code * Fix hashdata * Replace static token hashed datas * Set allowance * Add get orders * Add get orders tests * Add ignore * add close orders * revert * Add get gas limit * Start increasePosition. Todo: Finish GetExecutionFee and estimateGas * little refact * Update gitignore * Fix namespaces and clean repo * Add tests samples * Add execution fee * Add increase position * Handle backtest on the frontend * Add tests * Update increase * Test increase * fix increase * Fix size * Start get position * Update get positions * Fix get position * Update rpc and trade mappers * Finish close position * Fix leverage
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Nethereum.Web3" Version="4.21.2"/>
|
||||
<PackageReference Include="Nethereum.Web3" Version="4.28.0"/>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@@ -1,26 +1,31 @@
|
||||
using System.Numerics;
|
||||
using Nethereum.Web3;
|
||||
using Nethereum.RPC.Eth.DTOs;
|
||||
using Managing.Tools.ABI.OrderBookReader.ContractDefinition;
|
||||
using Nethereum.Contracts.ContractHandlers;
|
||||
using Managing.Tools.OrderBookReader.ContractDefinition;
|
||||
using Nethereum.RPC.Eth.DTOs;
|
||||
using Nethereum.Web3;
|
||||
|
||||
namespace Managing.Tools.OrderBookReader
|
||||
namespace Managing.Tools.ABI.OrderBookReader
|
||||
{
|
||||
public partial class OrderBookReaderService
|
||||
public class OrderBookReaderService
|
||||
{
|
||||
public static Task<TransactionReceipt> DeployContractAndWaitForReceiptAsync(Web3 web3, OrderBookReaderDeployment orderBookReaderDeployment, CancellationTokenSource cancellationTokenSource = null)
|
||||
public static Task<TransactionReceipt> DeployContractAndWaitForReceiptAsync(Web3 web3,
|
||||
OrderBookReaderDeployment orderBookReaderDeployment, CancellationTokenSource cancellationTokenSource = null)
|
||||
{
|
||||
return web3.Eth.GetContractDeploymentHandler<OrderBookReaderDeployment>().SendRequestAndWaitForReceiptAsync(orderBookReaderDeployment, cancellationTokenSource);
|
||||
return web3.Eth.GetContractDeploymentHandler<OrderBookReaderDeployment>()
|
||||
.SendRequestAndWaitForReceiptAsync(orderBookReaderDeployment, cancellationTokenSource);
|
||||
}
|
||||
|
||||
public static Task<string> DeployContractAsync(Web3 web3, OrderBookReaderDeployment orderBookReaderDeployment)
|
||||
{
|
||||
return web3.Eth.GetContractDeploymentHandler<OrderBookReaderDeployment>().SendRequestAsync(orderBookReaderDeployment);
|
||||
return web3.Eth.GetContractDeploymentHandler<OrderBookReaderDeployment>()
|
||||
.SendRequestAsync(orderBookReaderDeployment);
|
||||
}
|
||||
|
||||
public static async Task<OrderBookReaderService> DeployContractAndGetServiceAsync(Web3 web3, OrderBookReaderDeployment orderBookReaderDeployment, CancellationTokenSource cancellationTokenSource = null)
|
||||
public static async Task<OrderBookReaderService> DeployContractAndGetServiceAsync(Web3 web3,
|
||||
OrderBookReaderDeployment orderBookReaderDeployment, CancellationTokenSource cancellationTokenSource = null)
|
||||
{
|
||||
var receipt = await DeployContractAndWaitForReceiptAsync(web3, orderBookReaderDeployment, cancellationTokenSource);
|
||||
var receipt =
|
||||
await DeployContractAndWaitForReceiptAsync(web3, orderBookReaderDeployment, cancellationTokenSource);
|
||||
return new OrderBookReaderService(web3, receipt.ContractAddress);
|
||||
}
|
||||
|
||||
@@ -40,49 +45,65 @@ namespace Managing.Tools.OrderBookReader
|
||||
ContractHandler = web3.Eth.GetContractHandler(contractAddress);
|
||||
}
|
||||
|
||||
public Task<GetDecreaseOrdersOutputDTO> GetDecreaseOrdersQueryAsync(GetDecreaseOrdersFunction getDecreaseOrdersFunction, BlockParameter blockParameter = null)
|
||||
public Task<GetDecreaseOrdersOutputDTO> GetDecreaseOrdersQueryAsync(
|
||||
GetDecreaseOrdersFunction getDecreaseOrdersFunction, BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryDeserializingToObjectAsync<GetDecreaseOrdersFunction, GetDecreaseOrdersOutputDTO>(getDecreaseOrdersFunction, blockParameter);
|
||||
return ContractHandler
|
||||
.QueryDeserializingToObjectAsync<GetDecreaseOrdersFunction, GetDecreaseOrdersOutputDTO>(
|
||||
getDecreaseOrdersFunction, blockParameter);
|
||||
}
|
||||
|
||||
public Task<GetDecreaseOrdersOutputDTO> GetDecreaseOrdersQueryAsync(string orderBookAddress, string account, List<BigInteger> indices, BlockParameter blockParameter = null)
|
||||
public Task<GetDecreaseOrdersOutputDTO> GetDecreaseOrdersQueryAsync(string orderBookAddress, string account,
|
||||
List<BigInteger> indices, BlockParameter blockParameter = null)
|
||||
{
|
||||
var getDecreaseOrdersFunction = new GetDecreaseOrdersFunction();
|
||||
getDecreaseOrdersFunction.OrderBookAddress = orderBookAddress;
|
||||
getDecreaseOrdersFunction.Account = account;
|
||||
getDecreaseOrdersFunction.Indices = indices;
|
||||
|
||||
return ContractHandler.QueryDeserializingToObjectAsync<GetDecreaseOrdersFunction, GetDecreaseOrdersOutputDTO>(getDecreaseOrdersFunction, blockParameter);
|
||||
getDecreaseOrdersFunction.OrderBookAddress = orderBookAddress;
|
||||
getDecreaseOrdersFunction.Account = account;
|
||||
getDecreaseOrdersFunction.Indices = indices;
|
||||
|
||||
return ContractHandler
|
||||
.QueryDeserializingToObjectAsync<GetDecreaseOrdersFunction, GetDecreaseOrdersOutputDTO>(
|
||||
getDecreaseOrdersFunction, blockParameter);
|
||||
}
|
||||
|
||||
public Task<GetIncreaseOrdersOutputDTO> GetIncreaseOrdersQueryAsync(GetIncreaseOrdersFunction getIncreaseOrdersFunction, BlockParameter blockParameter = null)
|
||||
public Task<GetIncreaseOrdersOutputDTO> GetIncreaseOrdersQueryAsync(
|
||||
GetIncreaseOrdersFunction getIncreaseOrdersFunction, BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryDeserializingToObjectAsync<GetIncreaseOrdersFunction, GetIncreaseOrdersOutputDTO>(getIncreaseOrdersFunction, blockParameter);
|
||||
return ContractHandler
|
||||
.QueryDeserializingToObjectAsync<GetIncreaseOrdersFunction, GetIncreaseOrdersOutputDTO>(
|
||||
getIncreaseOrdersFunction, blockParameter);
|
||||
}
|
||||
|
||||
public Task<GetIncreaseOrdersOutputDTO> GetIncreaseOrdersQueryAsync(string orderBookAddress, string account, List<BigInteger> indices, BlockParameter blockParameter = null)
|
||||
public Task<GetIncreaseOrdersOutputDTO> GetIncreaseOrdersQueryAsync(string orderBookAddress, string account,
|
||||
List<BigInteger> indices, BlockParameter blockParameter = null)
|
||||
{
|
||||
var getIncreaseOrdersFunction = new GetIncreaseOrdersFunction();
|
||||
getIncreaseOrdersFunction.OrderBookAddress = orderBookAddress;
|
||||
getIncreaseOrdersFunction.Account = account;
|
||||
getIncreaseOrdersFunction.Indices = indices;
|
||||
|
||||
return ContractHandler.QueryDeserializingToObjectAsync<GetIncreaseOrdersFunction, GetIncreaseOrdersOutputDTO>(getIncreaseOrdersFunction, blockParameter);
|
||||
getIncreaseOrdersFunction.OrderBookAddress = orderBookAddress;
|
||||
getIncreaseOrdersFunction.Account = account;
|
||||
getIncreaseOrdersFunction.Indices = indices;
|
||||
|
||||
return ContractHandler
|
||||
.QueryDeserializingToObjectAsync<GetIncreaseOrdersFunction, GetIncreaseOrdersOutputDTO>(
|
||||
getIncreaseOrdersFunction, blockParameter);
|
||||
}
|
||||
|
||||
public Task<GetSwapOrdersOutputDTO> GetSwapOrdersQueryAsync(GetSwapOrdersFunction getSwapOrdersFunction, BlockParameter blockParameter = null)
|
||||
public Task<GetSwapOrdersOutputDTO> GetSwapOrdersQueryAsync(GetSwapOrdersFunction getSwapOrdersFunction,
|
||||
BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryDeserializingToObjectAsync<GetSwapOrdersFunction, GetSwapOrdersOutputDTO>(getSwapOrdersFunction, blockParameter);
|
||||
return ContractHandler.QueryDeserializingToObjectAsync<GetSwapOrdersFunction, GetSwapOrdersOutputDTO>(
|
||||
getSwapOrdersFunction, blockParameter);
|
||||
}
|
||||
|
||||
public Task<GetSwapOrdersOutputDTO> GetSwapOrdersQueryAsync(string orderBookAddress, string account, List<BigInteger> indices, BlockParameter blockParameter = null)
|
||||
public Task<GetSwapOrdersOutputDTO> GetSwapOrdersQueryAsync(string orderBookAddress, string account,
|
||||
List<BigInteger> indices, BlockParameter blockParameter = null)
|
||||
{
|
||||
var getSwapOrdersFunction = new GetSwapOrdersFunction();
|
||||
getSwapOrdersFunction.OrderBookAddress = orderBookAddress;
|
||||
getSwapOrdersFunction.Account = account;
|
||||
getSwapOrdersFunction.Indices = indices;
|
||||
|
||||
return ContractHandler.QueryDeserializingToObjectAsync<GetSwapOrdersFunction, GetSwapOrdersOutputDTO>(getSwapOrdersFunction, blockParameter);
|
||||
getSwapOrdersFunction.OrderBookAddress = orderBookAddress;
|
||||
getSwapOrdersFunction.Account = account;
|
||||
getSwapOrdersFunction.Indices = indices;
|
||||
|
||||
return ContractHandler.QueryDeserializingToObjectAsync<GetSwapOrdersFunction, GetSwapOrdersOutputDTO>(
|
||||
getSwapOrdersFunction, blockParameter);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@@ -4,7 +4,7 @@ using Nethereum.Contracts;
|
||||
|
||||
namespace Managing.Tools.ABI.Reader.ContractDefinition
|
||||
{
|
||||
public partial class ReaderDeployment : ReaderDeploymentBase
|
||||
public class ReaderDeployment : ReaderDeploymentBase
|
||||
{
|
||||
public ReaderDeployment() : base(BYTECODE)
|
||||
{
|
||||
@@ -29,7 +29,7 @@ namespace Managing.Tools.ABI.Reader.ContractDefinition
|
||||
}
|
||||
}
|
||||
|
||||
public partial class BasisPointsDivisorFunction : BasisPointsDivisorFunctionBase
|
||||
public class BasisPointsDivisorFunction : BasisPointsDivisorFunctionBase
|
||||
{
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace Managing.Tools.ABI.Reader.ContractDefinition
|
||||
{
|
||||
}
|
||||
|
||||
public partial class PositionPropsLengthFunction : PositionPropsLengthFunctionBase
|
||||
public class PositionPropsLengthFunction : PositionPropsLengthFunctionBase
|
||||
{
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace Managing.Tools.ABI.Reader.ContractDefinition
|
||||
{
|
||||
}
|
||||
|
||||
public partial class PricePrecisionFunction : PricePrecisionFunctionBase
|
||||
public class PricePrecisionFunction : PricePrecisionFunctionBase
|
||||
{
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace Managing.Tools.ABI.Reader.ContractDefinition
|
||||
{
|
||||
}
|
||||
|
||||
public partial class UsdgDecimalsFunction : UsdgDecimalsFunctionBase
|
||||
public class UsdgDecimalsFunction : UsdgDecimalsFunctionBase
|
||||
{
|
||||
}
|
||||
|
||||
@@ -65,51 +65,51 @@ namespace Managing.Tools.ABI.Reader.ContractDefinition
|
||||
{
|
||||
}
|
||||
|
||||
public partial class GetAmountOutFunction : GetAmountOutFunctionBase
|
||||
public class GetAmountOutFunction : GetAmountOutFunctionBase
|
||||
{
|
||||
}
|
||||
|
||||
[Function("getAmountOut", typeof(GetAmountOutOutputDTO))]
|
||||
public class GetAmountOutFunctionBase : FunctionMessage
|
||||
{
|
||||
[Parameter("address", "_vault", 1)] public virtual string Vault { get; set; }
|
||||
[Parameter("address", "_vault")] public virtual string Vault { get; set; }
|
||||
[Parameter("address", "_tokenIn", 2)] public virtual string TokenIn { get; set; }
|
||||
[Parameter("address", "_tokenOut", 3)] public virtual string TokenOut { get; set; }
|
||||
[Parameter("uint256", "_amountIn", 4)] public virtual BigInteger AmountIn { get; set; }
|
||||
}
|
||||
|
||||
public partial class GetFeeBasisPointsFunction : GetFeeBasisPointsFunctionBase
|
||||
public class GetFeeBasisPointsFunction : GetFeeBasisPointsFunctionBase
|
||||
{
|
||||
}
|
||||
|
||||
[Function("getFeeBasisPoints", typeof(GetFeeBasisPointsOutputDTO))]
|
||||
public class GetFeeBasisPointsFunctionBase : FunctionMessage
|
||||
{
|
||||
[Parameter("address", "_vault", 1)] public virtual string Vault { get; set; }
|
||||
[Parameter("address", "_vault")] public virtual string Vault { get; set; }
|
||||
[Parameter("address", "_tokenIn", 2)] public virtual string TokenIn { get; set; }
|
||||
[Parameter("address", "_tokenOut", 3)] public virtual string TokenOut { get; set; }
|
||||
[Parameter("uint256", "_amountIn", 4)] public virtual BigInteger AmountIn { get; set; }
|
||||
}
|
||||
|
||||
public partial class GetFeesFunction : GetFeesFunctionBase
|
||||
public class GetFeesFunction : GetFeesFunctionBase
|
||||
{
|
||||
}
|
||||
|
||||
[Function("getFees", "uint256[]")]
|
||||
public class GetFeesFunctionBase : FunctionMessage
|
||||
{
|
||||
[Parameter("address", "_vault", 1)] public virtual string Vault { get; set; }
|
||||
[Parameter("address", "_vault")] public virtual string Vault { get; set; }
|
||||
[Parameter("address[]", "_tokens", 2)] public virtual List<string> Tokens { get; set; }
|
||||
}
|
||||
|
||||
public partial class GetFullVaultTokenInfoFunction : GetFullVaultTokenInfoFunctionBase
|
||||
public class GetFullVaultTokenInfoFunction : GetFullVaultTokenInfoFunctionBase
|
||||
{
|
||||
}
|
||||
|
||||
[Function("getFullVaultTokenInfo", "uint256[]")]
|
||||
public class GetFullVaultTokenInfoFunctionBase : FunctionMessage
|
||||
{
|
||||
[Parameter("address", "_vault", 1)] public virtual string Vault { get; set; }
|
||||
[Parameter("address", "_vault")] public virtual string Vault { get; set; }
|
||||
[Parameter("address", "_weth", 2)] public virtual string Weth { get; set; }
|
||||
|
||||
[Parameter("uint256", "_usdgAmount", 3)]
|
||||
@@ -118,49 +118,49 @@ namespace Managing.Tools.ABI.Reader.ContractDefinition
|
||||
[Parameter("address[]", "_tokens", 4)] public virtual List<string> Tokens { get; set; }
|
||||
}
|
||||
|
||||
public partial class GetFundingRatesFunction : GetFundingRatesFunctionBase
|
||||
public class GetFundingRatesFunction : GetFundingRatesFunctionBase
|
||||
{
|
||||
}
|
||||
|
||||
[Function("getFundingRates", "uint256[]")]
|
||||
public class GetFundingRatesFunctionBase : FunctionMessage
|
||||
{
|
||||
[Parameter("address", "_vault", 1)] public virtual string Vault { get; set; }
|
||||
[Parameter("address", "_vault")] public virtual string Vault { get; set; }
|
||||
[Parameter("address", "_weth", 2)] public virtual string Weth { get; set; }
|
||||
[Parameter("address[]", "_tokens", 3)] public virtual List<string> Tokens { get; set; }
|
||||
}
|
||||
|
||||
public partial class GetMaxAmountInFunction : GetMaxAmountInFunctionBase
|
||||
public class GetMaxAmountInFunction : GetMaxAmountInFunctionBase
|
||||
{
|
||||
}
|
||||
|
||||
[Function("getMaxAmountIn", "uint256")]
|
||||
public class GetMaxAmountInFunctionBase : FunctionMessage
|
||||
{
|
||||
[Parameter("address", "_vault", 1)] public virtual string Vault { get; set; }
|
||||
[Parameter("address", "_vault")] public virtual string Vault { get; set; }
|
||||
[Parameter("address", "_tokenIn", 2)] public virtual string TokenIn { get; set; }
|
||||
[Parameter("address", "_tokenOut", 3)] public virtual string TokenOut { get; set; }
|
||||
}
|
||||
|
||||
public partial class GetPairInfoFunction : GetPairInfoFunctionBase
|
||||
public class GetPairInfoFunction : GetPairInfoFunctionBase
|
||||
{
|
||||
}
|
||||
|
||||
[Function("getPairInfo", "uint256[]")]
|
||||
public class GetPairInfoFunctionBase : FunctionMessage
|
||||
{
|
||||
[Parameter("address", "_factory", 1)] public virtual string Factory { get; set; }
|
||||
[Parameter("address", "_factory")] public virtual string Factory { get; set; }
|
||||
[Parameter("address[]", "_tokens", 2)] public virtual List<string> Tokens { get; set; }
|
||||
}
|
||||
|
||||
public partial class GetPositionsFunction : GetPositionsFunctionBase
|
||||
public class GetPositionsFunction : GetPositionsFunctionBase
|
||||
{
|
||||
}
|
||||
|
||||
[Function("getPositions", "uint256[]")]
|
||||
public class GetPositionsFunctionBase : FunctionMessage
|
||||
{
|
||||
[Parameter("address", "_vault", 1)] public virtual string Vault { get; set; }
|
||||
[Parameter("address", "_vault")] public virtual string Vault { get; set; }
|
||||
[Parameter("address", "_account", 2)] public virtual string Account { get; set; }
|
||||
|
||||
[Parameter("address[]", "_collateralTokens", 3)]
|
||||
@@ -172,99 +172,99 @@ namespace Managing.Tools.ABI.Reader.ContractDefinition
|
||||
[Parameter("bool[]", "_isLong", 5)] public virtual List<bool> IsLong { get; set; }
|
||||
}
|
||||
|
||||
public partial class GetPricesFunction : GetPricesFunctionBase
|
||||
public class GetPricesFunction : GetPricesFunctionBase
|
||||
{
|
||||
}
|
||||
|
||||
[Function("getPrices", "uint256[]")]
|
||||
public class GetPricesFunctionBase : FunctionMessage
|
||||
{
|
||||
[Parameter("address", "_priceFeed", 1)]
|
||||
[Parameter("address", "_priceFeed")]
|
||||
public virtual string PriceFeed { get; set; }
|
||||
|
||||
[Parameter("address[]", "_tokens", 2)] public virtual List<string> Tokens { get; set; }
|
||||
}
|
||||
|
||||
public partial class GetStakingInfoFunction : GetStakingInfoFunctionBase
|
||||
public class GetStakingInfoFunction : GetStakingInfoFunctionBase
|
||||
{
|
||||
}
|
||||
|
||||
[Function("getStakingInfo", "uint256[]")]
|
||||
public class GetStakingInfoFunctionBase : FunctionMessage
|
||||
{
|
||||
[Parameter("address", "_account", 1)] public virtual string Account { get; set; }
|
||||
[Parameter("address", "_account")] public virtual string Account { get; set; }
|
||||
|
||||
[Parameter("address[]", "_yieldTrackers", 2)]
|
||||
public virtual List<string> YieldTrackers { get; set; }
|
||||
}
|
||||
|
||||
public partial class GetTokenBalancesFunction : GetTokenBalancesFunctionBase
|
||||
public class GetTokenBalancesFunction : GetTokenBalancesFunctionBase
|
||||
{
|
||||
}
|
||||
|
||||
[Function("getTokenBalances", "uint256[]")]
|
||||
public class GetTokenBalancesFunctionBase : FunctionMessage
|
||||
{
|
||||
[Parameter("address", "_account", 1)] public virtual string Account { get; set; }
|
||||
[Parameter("address", "_account")] public virtual string Account { get; set; }
|
||||
[Parameter("address[]", "_tokens", 2)] public virtual List<string> Tokens { get; set; }
|
||||
}
|
||||
|
||||
public partial class GetTokenBalancesWithSuppliesFunction : GetTokenBalancesWithSuppliesFunctionBase
|
||||
public class GetTokenBalancesWithSuppliesFunction : GetTokenBalancesWithSuppliesFunctionBase
|
||||
{
|
||||
}
|
||||
|
||||
[Function("getTokenBalancesWithSupplies", "uint256[]")]
|
||||
public class GetTokenBalancesWithSuppliesFunctionBase : FunctionMessage
|
||||
{
|
||||
[Parameter("address", "_account", 1)] public virtual string Account { get; set; }
|
||||
[Parameter("address", "_account")] public virtual string Account { get; set; }
|
||||
[Parameter("address[]", "_tokens", 2)] public virtual List<string> Tokens { get; set; }
|
||||
}
|
||||
|
||||
public partial class GetTokenSupplyFunction : GetTokenSupplyFunctionBase
|
||||
public class GetTokenSupplyFunction : GetTokenSupplyFunctionBase
|
||||
{
|
||||
}
|
||||
|
||||
[Function("getTokenSupply", "uint256")]
|
||||
public class GetTokenSupplyFunctionBase : FunctionMessage
|
||||
{
|
||||
[Parameter("address", "_token", 1)] public virtual string Token { get; set; }
|
||||
[Parameter("address", "_token")] public virtual string Token { get; set; }
|
||||
|
||||
[Parameter("address[]", "_excludedAccounts", 2)]
|
||||
public virtual List<string> ExcludedAccounts { get; set; }
|
||||
}
|
||||
|
||||
public partial class GetTotalBalanceFunction : GetTotalBalanceFunctionBase
|
||||
public class GetTotalBalanceFunction : GetTotalBalanceFunctionBase
|
||||
{
|
||||
}
|
||||
|
||||
[Function("getTotalBalance", "uint256")]
|
||||
public class GetTotalBalanceFunctionBase : FunctionMessage
|
||||
{
|
||||
[Parameter("address", "_token", 1)] public virtual string Token { get; set; }
|
||||
[Parameter("address", "_token")] public virtual string Token { get; set; }
|
||||
|
||||
[Parameter("address[]", "_accounts", 2)]
|
||||
public virtual List<string> Accounts { get; set; }
|
||||
}
|
||||
|
||||
public partial class GetTotalStakedFunction : GetTotalStakedFunctionBase
|
||||
public class GetTotalStakedFunction : GetTotalStakedFunctionBase
|
||||
{
|
||||
}
|
||||
|
||||
[Function("getTotalStaked", "uint256[]")]
|
||||
public class GetTotalStakedFunctionBase : FunctionMessage
|
||||
{
|
||||
[Parameter("address[]", "_yieldTokens", 1)]
|
||||
[Parameter("address[]", "_yieldTokens")]
|
||||
public virtual List<string> YieldTokens { get; set; }
|
||||
}
|
||||
|
||||
public partial class GetVaultTokenInfoFunction : GetVaultTokenInfoFunctionBase
|
||||
public class GetVaultTokenInfoFunction : GetVaultTokenInfoFunctionBase
|
||||
{
|
||||
}
|
||||
|
||||
[Function("getVaultTokenInfo", "uint256[]")]
|
||||
public class GetVaultTokenInfoFunctionBase : FunctionMessage
|
||||
{
|
||||
[Parameter("address", "_vault", 1)] public virtual string Vault { get; set; }
|
||||
[Parameter("address", "_vault")] public virtual string Vault { get; set; }
|
||||
[Parameter("address", "_weth", 2)] public virtual string Weth { get; set; }
|
||||
|
||||
[Parameter("uint256", "_usdgAmount", 3)]
|
||||
@@ -273,14 +273,14 @@ namespace Managing.Tools.ABI.Reader.ContractDefinition
|
||||
[Parameter("address[]", "_tokens", 4)] public virtual List<string> Tokens { get; set; }
|
||||
}
|
||||
|
||||
public partial class GetVaultTokenInfoV2Function : GetVaultTokenInfoV2FunctionBase
|
||||
public class GetVaultTokenInfoV2Function : GetVaultTokenInfoV2FunctionBase
|
||||
{
|
||||
}
|
||||
|
||||
[Function("getVaultTokenInfoV2", "uint256[]")]
|
||||
public class GetVaultTokenInfoV2FunctionBase : FunctionMessage
|
||||
{
|
||||
[Parameter("address", "_vault", 1)] public virtual string Vault { get; set; }
|
||||
[Parameter("address", "_vault")] public virtual string Vault { get; set; }
|
||||
[Parameter("address", "_weth", 2)] public virtual string Weth { get; set; }
|
||||
|
||||
[Parameter("uint256", "_usdgAmount", 3)]
|
||||
@@ -289,20 +289,20 @@ namespace Managing.Tools.ABI.Reader.ContractDefinition
|
||||
[Parameter("address[]", "_tokens", 4)] public virtual List<string> Tokens { get; set; }
|
||||
}
|
||||
|
||||
public partial class GetVestingInfoFunction : GetVestingInfoFunctionBase
|
||||
public class GetVestingInfoFunction : GetVestingInfoFunctionBase
|
||||
{
|
||||
}
|
||||
|
||||
[Function("getVestingInfo", "uint256[]")]
|
||||
public class GetVestingInfoFunctionBase : FunctionMessage
|
||||
{
|
||||
[Parameter("address", "_account", 1)] public virtual string Account { get; set; }
|
||||
[Parameter("address", "_account")] public virtual string Account { get; set; }
|
||||
|
||||
[Parameter("address[]", "_vesters", 2)]
|
||||
public virtual List<string> Vesters { get; set; }
|
||||
}
|
||||
|
||||
public partial class GovFunction : GovFunctionBase
|
||||
public class GovFunction : GovFunctionBase
|
||||
{
|
||||
}
|
||||
|
||||
@@ -311,7 +311,7 @@ namespace Managing.Tools.ABI.Reader.ContractDefinition
|
||||
{
|
||||
}
|
||||
|
||||
public partial class HasMaxGlobalShortSizesFunction : HasMaxGlobalShortSizesFunctionBase
|
||||
public class HasMaxGlobalShortSizesFunction : HasMaxGlobalShortSizesFunctionBase
|
||||
{
|
||||
}
|
||||
|
||||
@@ -320,267 +320,267 @@ namespace Managing.Tools.ABI.Reader.ContractDefinition
|
||||
{
|
||||
}
|
||||
|
||||
public partial class SetConfigFunction : SetConfigFunctionBase
|
||||
public class SetConfigFunction : SetConfigFunctionBase
|
||||
{
|
||||
}
|
||||
|
||||
[Function("setConfig")]
|
||||
public class SetConfigFunctionBase : FunctionMessage
|
||||
{
|
||||
[Parameter("bool", "_hasMaxGlobalShortSizes", 1)]
|
||||
[Parameter("bool", "_hasMaxGlobalShortSizes")]
|
||||
public virtual bool HasMaxGlobalShortSizes { get; set; }
|
||||
}
|
||||
|
||||
public partial class SetGovFunction : SetGovFunctionBase
|
||||
public class SetGovFunction : SetGovFunctionBase
|
||||
{
|
||||
}
|
||||
|
||||
[Function("setGov")]
|
||||
public class SetGovFunctionBase : FunctionMessage
|
||||
{
|
||||
[Parameter("address", "_gov", 1)] public virtual string Gov { get; set; }
|
||||
[Parameter("address", "_gov")] public virtual string Gov { get; set; }
|
||||
}
|
||||
|
||||
public partial class BasisPointsDivisorOutputDTO : BasisPointsDivisorOutputDTOBase
|
||||
public class BasisPointsDivisorOutputDTO : BasisPointsDivisorOutputDTOBase
|
||||
{
|
||||
}
|
||||
|
||||
[FunctionOutput]
|
||||
public class BasisPointsDivisorOutputDTOBase : IFunctionOutputDTO
|
||||
{
|
||||
[Parameter("uint256", "", 1)] public virtual BigInteger ReturnValue1 { get; set; }
|
||||
[Parameter("uint256", "")] public virtual BigInteger ReturnValue1 { get; set; }
|
||||
}
|
||||
|
||||
public partial class PositionPropsLengthOutputDTO : PositionPropsLengthOutputDTOBase
|
||||
public class PositionPropsLengthOutputDTO : PositionPropsLengthOutputDTOBase
|
||||
{
|
||||
}
|
||||
|
||||
[FunctionOutput]
|
||||
public class PositionPropsLengthOutputDTOBase : IFunctionOutputDTO
|
||||
{
|
||||
[Parameter("uint256", "", 1)] public virtual BigInteger ReturnValue1 { get; set; }
|
||||
[Parameter("uint256", "")] public virtual BigInteger ReturnValue1 { get; set; }
|
||||
}
|
||||
|
||||
public partial class PricePrecisionOutputDTO : PricePrecisionOutputDTOBase
|
||||
public class PricePrecisionOutputDTO : PricePrecisionOutputDTOBase
|
||||
{
|
||||
}
|
||||
|
||||
[FunctionOutput]
|
||||
public class PricePrecisionOutputDTOBase : IFunctionOutputDTO
|
||||
{
|
||||
[Parameter("uint256", "", 1)] public virtual BigInteger ReturnValue1 { get; set; }
|
||||
[Parameter("uint256", "")] public virtual BigInteger ReturnValue1 { get; set; }
|
||||
}
|
||||
|
||||
public partial class UsdgDecimalsOutputDTO : UsdgDecimalsOutputDTOBase
|
||||
public class UsdgDecimalsOutputDTO : UsdgDecimalsOutputDTOBase
|
||||
{
|
||||
}
|
||||
|
||||
[FunctionOutput]
|
||||
public class UsdgDecimalsOutputDTOBase : IFunctionOutputDTO
|
||||
{
|
||||
[Parameter("uint256", "", 1)] public virtual BigInteger ReturnValue1 { get; set; }
|
||||
[Parameter("uint256", "")] public virtual BigInteger ReturnValue1 { get; set; }
|
||||
}
|
||||
|
||||
public partial class GetAmountOutOutputDTO : GetAmountOutOutputDTOBase
|
||||
public class GetAmountOutOutputDTO : GetAmountOutOutputDTOBase
|
||||
{
|
||||
}
|
||||
|
||||
[FunctionOutput]
|
||||
public class GetAmountOutOutputDTOBase : IFunctionOutputDTO
|
||||
{
|
||||
[Parameter("uint256", "", 1)] public virtual BigInteger ReturnValue1 { get; set; }
|
||||
[Parameter("uint256", "")] public virtual BigInteger ReturnValue1 { get; set; }
|
||||
[Parameter("uint256", "", 2)] public virtual BigInteger ReturnValue2 { get; set; }
|
||||
}
|
||||
|
||||
public partial class GetFeeBasisPointsOutputDTO : GetFeeBasisPointsOutputDTOBase
|
||||
public class GetFeeBasisPointsOutputDTO : GetFeeBasisPointsOutputDTOBase
|
||||
{
|
||||
}
|
||||
|
||||
[FunctionOutput]
|
||||
public class GetFeeBasisPointsOutputDTOBase : IFunctionOutputDTO
|
||||
{
|
||||
[Parameter("uint256", "", 1)] public virtual BigInteger ReturnValue1 { get; set; }
|
||||
[Parameter("uint256", "")] public virtual BigInteger ReturnValue1 { get; set; }
|
||||
[Parameter("uint256", "", 2)] public virtual BigInteger ReturnValue2 { get; set; }
|
||||
[Parameter("uint256", "", 3)] public virtual BigInteger ReturnValue3 { get; set; }
|
||||
}
|
||||
|
||||
public partial class GetFeesOutputDTO : GetFeesOutputDTOBase
|
||||
public class GetFeesOutputDTO : GetFeesOutputDTOBase
|
||||
{
|
||||
}
|
||||
|
||||
[FunctionOutput]
|
||||
public class GetFeesOutputDTOBase : IFunctionOutputDTO
|
||||
{
|
||||
[Parameter("uint256[]", "", 1)] public virtual List<BigInteger> ReturnValue1 { get; set; }
|
||||
[Parameter("uint256[]", "")] public virtual List<BigInteger> ReturnValue1 { get; set; }
|
||||
}
|
||||
|
||||
public partial class GetFullVaultTokenInfoOutputDTO : GetFullVaultTokenInfoOutputDTOBase
|
||||
public class GetFullVaultTokenInfoOutputDTO : GetFullVaultTokenInfoOutputDTOBase
|
||||
{
|
||||
}
|
||||
|
||||
[FunctionOutput]
|
||||
public class GetFullVaultTokenInfoOutputDTOBase : IFunctionOutputDTO
|
||||
{
|
||||
[Parameter("uint256[]", "", 1)] public virtual List<BigInteger> ReturnValue1 { get; set; }
|
||||
[Parameter("uint256[]", "")] public virtual List<BigInteger> ReturnValue1 { get; set; }
|
||||
}
|
||||
|
||||
public partial class GetFundingRatesOutputDTO : GetFundingRatesOutputDTOBase
|
||||
public class GetFundingRatesOutputDTO : GetFundingRatesOutputDTOBase
|
||||
{
|
||||
}
|
||||
|
||||
[FunctionOutput]
|
||||
public class GetFundingRatesOutputDTOBase : IFunctionOutputDTO
|
||||
{
|
||||
[Parameter("uint256[]", "", 1)] public virtual List<BigInteger> ReturnValue1 { get; set; }
|
||||
[Parameter("uint256[]", "")] public virtual List<BigInteger> ReturnValue1 { get; set; }
|
||||
}
|
||||
|
||||
public partial class GetMaxAmountInOutputDTO : GetMaxAmountInOutputDTOBase
|
||||
public class GetMaxAmountInOutputDTO : GetMaxAmountInOutputDTOBase
|
||||
{
|
||||
}
|
||||
|
||||
[FunctionOutput]
|
||||
public class GetMaxAmountInOutputDTOBase : IFunctionOutputDTO
|
||||
{
|
||||
[Parameter("uint256", "", 1)] public virtual BigInteger ReturnValue1 { get; set; }
|
||||
[Parameter("uint256", "")] public virtual BigInteger ReturnValue1 { get; set; }
|
||||
}
|
||||
|
||||
public partial class GetPairInfoOutputDTO : GetPairInfoOutputDTOBase
|
||||
public class GetPairInfoOutputDTO : GetPairInfoOutputDTOBase
|
||||
{
|
||||
}
|
||||
|
||||
[FunctionOutput]
|
||||
public class GetPairInfoOutputDTOBase : IFunctionOutputDTO
|
||||
{
|
||||
[Parameter("uint256[]", "", 1)] public virtual List<BigInteger> ReturnValue1 { get; set; }
|
||||
[Parameter("uint256[]", "")] public virtual List<BigInteger> ReturnValue1 { get; set; }
|
||||
}
|
||||
|
||||
public partial class GetPositionsOutputDTO : GetPositionsOutputDTOBase
|
||||
public class GetPositionsOutputDTO : GetPositionsOutputDTOBase
|
||||
{
|
||||
}
|
||||
|
||||
[FunctionOutput]
|
||||
public class GetPositionsOutputDTOBase : IFunctionOutputDTO
|
||||
{
|
||||
[Parameter("uint256[]", "", 1)] public virtual List<BigInteger> ReturnValue1 { get; set; }
|
||||
[Parameter("uint256[]", "")] public virtual List<BigInteger> ReturnValue1 { get; set; }
|
||||
}
|
||||
|
||||
public partial class GetPricesOutputDTO : GetPricesOutputDTOBase
|
||||
public class GetPricesOutputDTO : GetPricesOutputDTOBase
|
||||
{
|
||||
}
|
||||
|
||||
[FunctionOutput]
|
||||
public class GetPricesOutputDTOBase : IFunctionOutputDTO
|
||||
{
|
||||
[Parameter("uint256[]", "", 1)] public virtual List<BigInteger> ReturnValue1 { get; set; }
|
||||
[Parameter("uint256[]", "")] public virtual List<BigInteger> ReturnValue1 { get; set; }
|
||||
}
|
||||
|
||||
public partial class GetStakingInfoOutputDTO : GetStakingInfoOutputDTOBase
|
||||
public class GetStakingInfoOutputDTO : GetStakingInfoOutputDTOBase
|
||||
{
|
||||
}
|
||||
|
||||
[FunctionOutput]
|
||||
public class GetStakingInfoOutputDTOBase : IFunctionOutputDTO
|
||||
{
|
||||
[Parameter("uint256[]", "", 1)] public virtual List<BigInteger> ReturnValue1 { get; set; }
|
||||
[Parameter("uint256[]", "")] public virtual List<BigInteger> ReturnValue1 { get; set; }
|
||||
}
|
||||
|
||||
public partial class GetTokenBalancesOutputDTO : GetTokenBalancesOutputDTOBase
|
||||
public class GetTokenBalancesOutputDTO : GetTokenBalancesOutputDTOBase
|
||||
{
|
||||
}
|
||||
|
||||
[FunctionOutput]
|
||||
public class GetTokenBalancesOutputDTOBase : IFunctionOutputDTO
|
||||
{
|
||||
[Parameter("uint256[]", "", 1)] public virtual List<BigInteger> ReturnValue1 { get; set; }
|
||||
[Parameter("uint256[]", "")] public virtual List<BigInteger> ReturnValue1 { get; set; }
|
||||
}
|
||||
|
||||
public partial class GetTokenBalancesWithSuppliesOutputDTO : GetTokenBalancesWithSuppliesOutputDTOBase
|
||||
public class GetTokenBalancesWithSuppliesOutputDTO : GetTokenBalancesWithSuppliesOutputDTOBase
|
||||
{
|
||||
}
|
||||
|
||||
[FunctionOutput]
|
||||
public class GetTokenBalancesWithSuppliesOutputDTOBase : IFunctionOutputDTO
|
||||
{
|
||||
[Parameter("uint256[]", "", 1)] public virtual List<BigInteger> ReturnValue1 { get; set; }
|
||||
[Parameter("uint256[]", "")] public virtual List<BigInteger> ReturnValue1 { get; set; }
|
||||
}
|
||||
|
||||
public partial class GetTokenSupplyOutputDTO : GetTokenSupplyOutputDTOBase
|
||||
public class GetTokenSupplyOutputDTO : GetTokenSupplyOutputDTOBase
|
||||
{
|
||||
}
|
||||
|
||||
[FunctionOutput]
|
||||
public class GetTokenSupplyOutputDTOBase : IFunctionOutputDTO
|
||||
{
|
||||
[Parameter("uint256", "", 1)] public virtual BigInteger ReturnValue1 { get; set; }
|
||||
[Parameter("uint256", "")] public virtual BigInteger ReturnValue1 { get; set; }
|
||||
}
|
||||
|
||||
public partial class GetTotalBalanceOutputDTO : GetTotalBalanceOutputDTOBase
|
||||
public class GetTotalBalanceOutputDTO : GetTotalBalanceOutputDTOBase
|
||||
{
|
||||
}
|
||||
|
||||
[FunctionOutput]
|
||||
public class GetTotalBalanceOutputDTOBase : IFunctionOutputDTO
|
||||
{
|
||||
[Parameter("uint256", "", 1)] public virtual BigInteger ReturnValue1 { get; set; }
|
||||
[Parameter("uint256", "")] public virtual BigInteger ReturnValue1 { get; set; }
|
||||
}
|
||||
|
||||
public partial class GetTotalStakedOutputDTO : GetTotalStakedOutputDTOBase
|
||||
public class GetTotalStakedOutputDTO : GetTotalStakedOutputDTOBase
|
||||
{
|
||||
}
|
||||
|
||||
[FunctionOutput]
|
||||
public class GetTotalStakedOutputDTOBase : IFunctionOutputDTO
|
||||
{
|
||||
[Parameter("uint256[]", "", 1)] public virtual List<BigInteger> ReturnValue1 { get; set; }
|
||||
[Parameter("uint256[]", "")] public virtual List<BigInteger> ReturnValue1 { get; set; }
|
||||
}
|
||||
|
||||
public partial class GetVaultTokenInfoOutputDTO : GetVaultTokenInfoOutputDTOBase
|
||||
public class GetVaultTokenInfoOutputDTO : GetVaultTokenInfoOutputDTOBase
|
||||
{
|
||||
}
|
||||
|
||||
[FunctionOutput]
|
||||
public class GetVaultTokenInfoOutputDTOBase : IFunctionOutputDTO
|
||||
{
|
||||
[Parameter("uint256[]", "", 1)] public virtual List<BigInteger> ReturnValue1 { get; set; }
|
||||
[Parameter("uint256[]", "")] public virtual List<BigInteger> ReturnValue1 { get; set; }
|
||||
}
|
||||
|
||||
public partial class GetVaultTokenInfoV2OutputDTO : GetVaultTokenInfoV2OutputDTOBase
|
||||
public class GetVaultTokenInfoV2OutputDTO : GetVaultTokenInfoV2OutputDTOBase
|
||||
{
|
||||
}
|
||||
|
||||
[FunctionOutput]
|
||||
public class GetVaultTokenInfoV2OutputDTOBase : IFunctionOutputDTO
|
||||
{
|
||||
[Parameter("uint256[]", "", 1)] public virtual List<BigInteger> ReturnValue1 { get; set; }
|
||||
[Parameter("uint256[]", "")] public virtual List<BigInteger> ReturnValue1 { get; set; }
|
||||
}
|
||||
|
||||
public partial class GetVestingInfoOutputDTO : GetVestingInfoOutputDTOBase
|
||||
public class GetVestingInfoOutputDTO : GetVestingInfoOutputDTOBase
|
||||
{
|
||||
}
|
||||
|
||||
[FunctionOutput]
|
||||
public class GetVestingInfoOutputDTOBase : IFunctionOutputDTO
|
||||
{
|
||||
[Parameter("uint256[]", "", 1)] public virtual List<BigInteger> ReturnValue1 { get; set; }
|
||||
[Parameter("uint256[]", "")] public virtual List<BigInteger> ReturnValue1 { get; set; }
|
||||
}
|
||||
|
||||
public partial class GovOutputDTO : GovOutputDTOBase
|
||||
public class GovOutputDTO : GovOutputDTOBase
|
||||
{
|
||||
}
|
||||
|
||||
[FunctionOutput]
|
||||
public class GovOutputDTOBase : IFunctionOutputDTO
|
||||
{
|
||||
[Parameter("address", "", 1)] public virtual string ReturnValue1 { get; set; }
|
||||
[Parameter("address", "")] public virtual string ReturnValue1 { get; set; }
|
||||
}
|
||||
|
||||
public partial class HasMaxGlobalShortSizesOutputDTO : HasMaxGlobalShortSizesOutputDTOBase
|
||||
public class HasMaxGlobalShortSizesOutputDTO : HasMaxGlobalShortSizesOutputDTOBase
|
||||
{
|
||||
}
|
||||
|
||||
[FunctionOutput]
|
||||
public class HasMaxGlobalShortSizesOutputDTOBase : IFunctionOutputDTO
|
||||
{
|
||||
[Parameter("bool", "", 1)] public virtual bool ReturnValue1 { get; set; }
|
||||
[Parameter("bool", "")] public virtual bool ReturnValue1 { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -5,28 +5,28 @@ using Nethereum.Web3;
|
||||
|
||||
namespace Managing.Tools.ABI.Reader
|
||||
{
|
||||
public partial class ReaderService : ContractWeb3ServiceBase
|
||||
public class ReaderService : ContractWeb3ServiceBase
|
||||
{
|
||||
public static Task<TransactionReceipt> DeployContractAndWaitForReceiptAsync(Nethereum.Web3.IWeb3 web3,
|
||||
public static Task<TransactionReceipt> DeployContractAndWaitForReceiptAsync(IWeb3 web3,
|
||||
ReaderDeployment readerDeployment, CancellationTokenSource cancellationTokenSource = null)
|
||||
{
|
||||
return web3.Eth.GetContractDeploymentHandler<ReaderDeployment>()
|
||||
.SendRequestAndWaitForReceiptAsync(readerDeployment, cancellationTokenSource);
|
||||
}
|
||||
|
||||
public static Task<string> DeployContractAsync(Nethereum.Web3.IWeb3 web3, ReaderDeployment readerDeployment)
|
||||
public static Task<string> DeployContractAsync(IWeb3 web3, ReaderDeployment readerDeployment)
|
||||
{
|
||||
return web3.Eth.GetContractDeploymentHandler<ReaderDeployment>().SendRequestAsync(readerDeployment);
|
||||
}
|
||||
|
||||
public static async Task<ReaderService> DeployContractAndGetServiceAsync(Nethereum.Web3.IWeb3 web3,
|
||||
public static async Task<ReaderService> DeployContractAndGetServiceAsync(IWeb3 web3,
|
||||
ReaderDeployment readerDeployment, CancellationTokenSource cancellationTokenSource = null)
|
||||
{
|
||||
var receipt = await DeployContractAndWaitForReceiptAsync(web3, readerDeployment, cancellationTokenSource);
|
||||
return new ReaderService(web3, receipt.ContractAddress);
|
||||
}
|
||||
|
||||
public ReaderService(Nethereum.Web3.IWeb3 web3, string contractAddress) : base(web3, contractAddress)
|
||||
public ReaderService(IWeb3 web3, string contractAddress) : base(web3, contractAddress)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -550,16 +550,12 @@ namespace Managing.Tools.ABI.Reader
|
||||
|
||||
public override List<Type> GetAllEventTypes()
|
||||
{
|
||||
return new List<Type>
|
||||
{
|
||||
};
|
||||
return new List<Type>();
|
||||
}
|
||||
|
||||
public override List<Type> GetAllErrorTypes()
|
||||
{
|
||||
return new List<Type>
|
||||
{
|
||||
};
|
||||
return new List<Type>();
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user