docker files fixes from liaqat
This commit is contained in:
1
src/Managing.Tools.ABI/Gmx/core/OrderBook.abi
Normal file
1
src/Managing.Tools.ABI/Gmx/core/OrderBook.abi
Normal file
File diff suppressed because one or more lines are too long
1
src/Managing.Tools.ABI/Gmx/core/OrderBook.bin
Normal file
1
src/Managing.Tools.ABI/Gmx/core/OrderBook.bin
Normal file
File diff suppressed because one or more lines are too long
1
src/Managing.Tools.ABI/Gmx/core/OrderBookReader.abi
Normal file
1
src/Managing.Tools.ABI/Gmx/core/OrderBookReader.abi
Normal file
@@ -0,0 +1 @@
|
||||
[{"inputs":[{"internalType":"address payable","name":"_orderBookAddress","type":"address"},{"internalType":"address","name":"_account","type":"address"},{"internalType":"uint256[]","name":"_indices","type":"uint256[]"}],"name":"getDecreaseOrders","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address payable","name":"_orderBookAddress","type":"address"},{"internalType":"address","name":"_account","type":"address"},{"internalType":"uint256[]","name":"_indices","type":"uint256[]"}],"name":"getIncreaseOrders","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address payable","name":"_orderBookAddress","type":"address"},{"internalType":"address","name":"_account","type":"address"},{"internalType":"uint256[]","name":"_indices","type":"uint256[]"}],"name":"getSwapOrders","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"}]
|
||||
1
src/Managing.Tools.ABI/Gmx/core/OrderBookReader.bin
Normal file
1
src/Managing.Tools.ABI/Gmx/core/OrderBookReader.bin
Normal file
File diff suppressed because one or more lines are too long
1
src/Managing.Tools.ABI/Gmx/core/PositionRouter.abi
Normal file
1
src/Managing.Tools.ABI/Gmx/core/PositionRouter.abi
Normal file
File diff suppressed because one or more lines are too long
1
src/Managing.Tools.ABI/Gmx/core/PositionRouter.bin
Normal file
1
src/Managing.Tools.ABI/Gmx/core/PositionRouter.bin
Normal file
File diff suppressed because one or more lines are too long
1
src/Managing.Tools.ABI/Gmx/core/Reader.abi
Normal file
1
src/Managing.Tools.ABI/Gmx/core/Reader.abi
Normal file
File diff suppressed because one or more lines are too long
1
src/Managing.Tools.ABI/Gmx/core/Reader.bin
Normal file
1
src/Managing.Tools.ABI/Gmx/core/Reader.bin
Normal file
File diff suppressed because one or more lines are too long
1
src/Managing.Tools.ABI/Gmx/core/Router.abi
Normal file
1
src/Managing.Tools.ABI/Gmx/core/Router.abi
Normal file
File diff suppressed because one or more lines are too long
1
src/Managing.Tools.ABI/Gmx/core/Router.bin
Normal file
1
src/Managing.Tools.ABI/Gmx/core/Router.bin
Normal file
File diff suppressed because one or more lines are too long
14
src/Managing.Tools.ABI/Managing.Tools.ABI.csproj
Normal file
14
src/Managing.Tools.ABI/Managing.Tools.ABI.csproj
Normal file
@@ -0,0 +1,14 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Nethereum.Web3" Version="4.16.0" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
File diff suppressed because one or more lines are too long
859
src/Managing.Tools.ABI/OrderBook/OrderBookService.cs
Normal file
859
src/Managing.Tools.ABI/OrderBook/OrderBookService.cs
Normal file
@@ -0,0 +1,859 @@
|
||||
using System.Numerics;
|
||||
using Nethereum.Web3;
|
||||
using Nethereum.RPC.Eth.DTOs;
|
||||
using Nethereum.Contracts.ContractHandlers;
|
||||
using Managing.Tools.OrderBook.ContractDefinition;
|
||||
|
||||
namespace Managing.Tools.OrderBook
|
||||
{
|
||||
public partial class OrderBookService
|
||||
{
|
||||
public static Task<TransactionReceipt> DeployContractAndWaitForReceiptAsync(Web3 web3, OrderBookDeployment orderBookDeployment, CancellationTokenSource cancellationTokenSource = null)
|
||||
{
|
||||
return web3.Eth.GetContractDeploymentHandler<OrderBookDeployment>().SendRequestAndWaitForReceiptAsync(orderBookDeployment, cancellationTokenSource);
|
||||
}
|
||||
|
||||
public static Task<string> DeployContractAsync(Web3 web3, OrderBookDeployment orderBookDeployment)
|
||||
{
|
||||
return web3.Eth.GetContractDeploymentHandler<OrderBookDeployment>().SendRequestAsync(orderBookDeployment);
|
||||
}
|
||||
|
||||
public static async Task<OrderBookService> DeployContractAndGetServiceAsync(Web3 web3, OrderBookDeployment orderBookDeployment, CancellationTokenSource cancellationTokenSource = null)
|
||||
{
|
||||
var receipt = await DeployContractAndWaitForReceiptAsync(web3, orderBookDeployment, cancellationTokenSource);
|
||||
return new OrderBookService(web3, receipt.ContractAddress);
|
||||
}
|
||||
|
||||
protected IWeb3 Web3 { get; }
|
||||
|
||||
public ContractHandler ContractHandler { get; }
|
||||
|
||||
public OrderBookService(Web3 web3, string contractAddress)
|
||||
{
|
||||
Web3 = web3;
|
||||
ContractHandler = web3.Eth.GetContractHandler(contractAddress);
|
||||
}
|
||||
|
||||
public OrderBookService(IWeb3 web3, string contractAddress)
|
||||
{
|
||||
Web3 = web3;
|
||||
ContractHandler = web3.Eth.GetContractHandler(contractAddress);
|
||||
}
|
||||
|
||||
public Task<BigInteger> PricePrecisionQueryAsync(PricePrecisionFunction pricePrecisionFunction, BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryAsync<PricePrecisionFunction, BigInteger>(pricePrecisionFunction, blockParameter);
|
||||
}
|
||||
|
||||
|
||||
public Task<BigInteger> PricePrecisionQueryAsync(BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryAsync<PricePrecisionFunction, BigInteger>(null, blockParameter);
|
||||
}
|
||||
|
||||
public Task<BigInteger> UsdgPrecisionQueryAsync(UsdgPrecisionFunction usdgPrecisionFunction, BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryAsync<UsdgPrecisionFunction, BigInteger>(usdgPrecisionFunction, blockParameter);
|
||||
}
|
||||
|
||||
|
||||
public Task<BigInteger> UsdgPrecisionQueryAsync(BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryAsync<UsdgPrecisionFunction, BigInteger>(null, blockParameter);
|
||||
}
|
||||
|
||||
public Task<string> CancelDecreaseOrderRequestAsync(CancelDecreaseOrderFunction cancelDecreaseOrderFunction)
|
||||
{
|
||||
return ContractHandler.SendRequestAsync(cancelDecreaseOrderFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> CancelDecreaseOrderRequestAndWaitForReceiptAsync(CancelDecreaseOrderFunction cancelDecreaseOrderFunction, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(cancelDecreaseOrderFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<string> CancelDecreaseOrderRequestAsync(BigInteger orderIndex)
|
||||
{
|
||||
var cancelDecreaseOrderFunction = new CancelDecreaseOrderFunction();
|
||||
cancelDecreaseOrderFunction.OrderIndex = orderIndex;
|
||||
|
||||
return ContractHandler.SendRequestAsync(cancelDecreaseOrderFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> CancelDecreaseOrderRequestAndWaitForReceiptAsync(BigInteger orderIndex, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
var cancelDecreaseOrderFunction = new CancelDecreaseOrderFunction();
|
||||
cancelDecreaseOrderFunction.OrderIndex = orderIndex;
|
||||
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(cancelDecreaseOrderFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<string> CancelIncreaseOrderRequestAsync(CancelIncreaseOrderFunction cancelIncreaseOrderFunction)
|
||||
{
|
||||
return ContractHandler.SendRequestAsync(cancelIncreaseOrderFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> CancelIncreaseOrderRequestAndWaitForReceiptAsync(CancelIncreaseOrderFunction cancelIncreaseOrderFunction, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(cancelIncreaseOrderFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<string> CancelIncreaseOrderRequestAsync(BigInteger orderIndex)
|
||||
{
|
||||
var cancelIncreaseOrderFunction = new CancelIncreaseOrderFunction();
|
||||
cancelIncreaseOrderFunction.OrderIndex = orderIndex;
|
||||
|
||||
return ContractHandler.SendRequestAsync(cancelIncreaseOrderFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> CancelIncreaseOrderRequestAndWaitForReceiptAsync(BigInteger orderIndex, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
var cancelIncreaseOrderFunction = new CancelIncreaseOrderFunction();
|
||||
cancelIncreaseOrderFunction.OrderIndex = orderIndex;
|
||||
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(cancelIncreaseOrderFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<string> CancelMultipleRequestAsync(CancelMultipleFunction cancelMultipleFunction)
|
||||
{
|
||||
return ContractHandler.SendRequestAsync(cancelMultipleFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> CancelMultipleRequestAndWaitForReceiptAsync(CancelMultipleFunction cancelMultipleFunction, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(cancelMultipleFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<string> CancelMultipleRequestAsync(List<BigInteger> swapOrderIndexes, List<BigInteger> increaseOrderIndexes, List<BigInteger> decreaseOrderIndexes)
|
||||
{
|
||||
var cancelMultipleFunction = new CancelMultipleFunction();
|
||||
cancelMultipleFunction.SwapOrderIndexes = swapOrderIndexes;
|
||||
cancelMultipleFunction.IncreaseOrderIndexes = increaseOrderIndexes;
|
||||
cancelMultipleFunction.DecreaseOrderIndexes = decreaseOrderIndexes;
|
||||
|
||||
return ContractHandler.SendRequestAsync(cancelMultipleFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> CancelMultipleRequestAndWaitForReceiptAsync(List<BigInteger> swapOrderIndexes, List<BigInteger> increaseOrderIndexes, List<BigInteger> decreaseOrderIndexes, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
var cancelMultipleFunction = new CancelMultipleFunction();
|
||||
cancelMultipleFunction.SwapOrderIndexes = swapOrderIndexes;
|
||||
cancelMultipleFunction.IncreaseOrderIndexes = increaseOrderIndexes;
|
||||
cancelMultipleFunction.DecreaseOrderIndexes = decreaseOrderIndexes;
|
||||
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(cancelMultipleFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<string> CancelSwapOrderRequestAsync(CancelSwapOrderFunction cancelSwapOrderFunction)
|
||||
{
|
||||
return ContractHandler.SendRequestAsync(cancelSwapOrderFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> CancelSwapOrderRequestAndWaitForReceiptAsync(CancelSwapOrderFunction cancelSwapOrderFunction, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(cancelSwapOrderFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<string> CancelSwapOrderRequestAsync(BigInteger orderIndex)
|
||||
{
|
||||
var cancelSwapOrderFunction = new CancelSwapOrderFunction();
|
||||
cancelSwapOrderFunction.OrderIndex = orderIndex;
|
||||
|
||||
return ContractHandler.SendRequestAsync(cancelSwapOrderFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> CancelSwapOrderRequestAndWaitForReceiptAsync(BigInteger orderIndex, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
var cancelSwapOrderFunction = new CancelSwapOrderFunction();
|
||||
cancelSwapOrderFunction.OrderIndex = orderIndex;
|
||||
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(cancelSwapOrderFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<string> CreateDecreaseOrderRequestAsync(CreateDecreaseOrderFunction createDecreaseOrderFunction)
|
||||
{
|
||||
return ContractHandler.SendRequestAsync(createDecreaseOrderFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> CreateDecreaseOrderRequestAndWaitForReceiptAsync(CreateDecreaseOrderFunction createDecreaseOrderFunction, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(createDecreaseOrderFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<string> CreateDecreaseOrderRequestAsync(string indexToken, BigInteger sizeDelta, string collateralToken, BigInteger collateralDelta, bool isLong, BigInteger triggerPrice, bool triggerAboveThreshold)
|
||||
{
|
||||
var createDecreaseOrderFunction = new CreateDecreaseOrderFunction();
|
||||
createDecreaseOrderFunction.IndexToken = indexToken;
|
||||
createDecreaseOrderFunction.SizeDelta = sizeDelta;
|
||||
createDecreaseOrderFunction.CollateralToken = collateralToken;
|
||||
createDecreaseOrderFunction.CollateralDelta = collateralDelta;
|
||||
createDecreaseOrderFunction.IsLong = isLong;
|
||||
createDecreaseOrderFunction.TriggerPrice = triggerPrice;
|
||||
createDecreaseOrderFunction.TriggerAboveThreshold = triggerAboveThreshold;
|
||||
|
||||
return ContractHandler.SendRequestAsync(createDecreaseOrderFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> CreateDecreaseOrderRequestAndWaitForReceiptAsync(string indexToken, BigInteger sizeDelta, string collateralToken, BigInteger collateralDelta, bool isLong, BigInteger triggerPrice, bool triggerAboveThreshold, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
var createDecreaseOrderFunction = new CreateDecreaseOrderFunction();
|
||||
createDecreaseOrderFunction.IndexToken = indexToken;
|
||||
createDecreaseOrderFunction.SizeDelta = sizeDelta;
|
||||
createDecreaseOrderFunction.CollateralToken = collateralToken;
|
||||
createDecreaseOrderFunction.CollateralDelta = collateralDelta;
|
||||
createDecreaseOrderFunction.IsLong = isLong;
|
||||
createDecreaseOrderFunction.TriggerPrice = triggerPrice;
|
||||
createDecreaseOrderFunction.TriggerAboveThreshold = triggerAboveThreshold;
|
||||
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(createDecreaseOrderFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<string> CreateIncreaseOrderRequestAsync(CreateIncreaseOrderFunction createIncreaseOrderFunction)
|
||||
{
|
||||
return ContractHandler.SendRequestAsync(createIncreaseOrderFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> CreateIncreaseOrderRequestAndWaitForReceiptAsync(CreateIncreaseOrderFunction createIncreaseOrderFunction, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(createIncreaseOrderFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<string> CreateIncreaseOrderRequestAsync(List<string> path, BigInteger amountIn, string indexToken, BigInteger minOut, BigInteger sizeDelta, string collateralToken, bool isLong, BigInteger triggerPrice, bool triggerAboveThreshold, BigInteger executionFee, bool shouldWrap)
|
||||
{
|
||||
var createIncreaseOrderFunction = new CreateIncreaseOrderFunction();
|
||||
createIncreaseOrderFunction.Path = path;
|
||||
createIncreaseOrderFunction.AmountIn = amountIn;
|
||||
createIncreaseOrderFunction.IndexToken = indexToken;
|
||||
createIncreaseOrderFunction.MinOut = minOut;
|
||||
createIncreaseOrderFunction.SizeDelta = sizeDelta;
|
||||
createIncreaseOrderFunction.CollateralToken = collateralToken;
|
||||
createIncreaseOrderFunction.IsLong = isLong;
|
||||
createIncreaseOrderFunction.TriggerPrice = triggerPrice;
|
||||
createIncreaseOrderFunction.TriggerAboveThreshold = triggerAboveThreshold;
|
||||
createIncreaseOrderFunction.ExecutionFee = executionFee;
|
||||
createIncreaseOrderFunction.ShouldWrap = shouldWrap;
|
||||
|
||||
return ContractHandler.SendRequestAsync(createIncreaseOrderFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> CreateIncreaseOrderRequestAndWaitForReceiptAsync(List<string> path, BigInteger amountIn, string indexToken, BigInteger minOut, BigInteger sizeDelta, string collateralToken, bool isLong, BigInteger triggerPrice, bool triggerAboveThreshold, BigInteger executionFee, bool shouldWrap, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
var createIncreaseOrderFunction = new CreateIncreaseOrderFunction();
|
||||
createIncreaseOrderFunction.Path = path;
|
||||
createIncreaseOrderFunction.AmountIn = amountIn;
|
||||
createIncreaseOrderFunction.IndexToken = indexToken;
|
||||
createIncreaseOrderFunction.MinOut = minOut;
|
||||
createIncreaseOrderFunction.SizeDelta = sizeDelta;
|
||||
createIncreaseOrderFunction.CollateralToken = collateralToken;
|
||||
createIncreaseOrderFunction.IsLong = isLong;
|
||||
createIncreaseOrderFunction.TriggerPrice = triggerPrice;
|
||||
createIncreaseOrderFunction.TriggerAboveThreshold = triggerAboveThreshold;
|
||||
createIncreaseOrderFunction.ExecutionFee = executionFee;
|
||||
createIncreaseOrderFunction.ShouldWrap = shouldWrap;
|
||||
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(createIncreaseOrderFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<string> CreateSwapOrderRequestAsync(CreateSwapOrderFunction createSwapOrderFunction)
|
||||
{
|
||||
return ContractHandler.SendRequestAsync(createSwapOrderFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> CreateSwapOrderRequestAndWaitForReceiptAsync(CreateSwapOrderFunction createSwapOrderFunction, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(createSwapOrderFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<string> CreateSwapOrderRequestAsync(List<string> path, BigInteger amountIn, BigInteger minOut, BigInteger triggerRatio, bool triggerAboveThreshold, BigInteger executionFee, bool shouldWrap, bool shouldUnwrap)
|
||||
{
|
||||
var createSwapOrderFunction = new CreateSwapOrderFunction();
|
||||
createSwapOrderFunction.Path = path;
|
||||
createSwapOrderFunction.AmountIn = amountIn;
|
||||
createSwapOrderFunction.MinOut = minOut;
|
||||
createSwapOrderFunction.TriggerRatio = triggerRatio;
|
||||
createSwapOrderFunction.TriggerAboveThreshold = triggerAboveThreshold;
|
||||
createSwapOrderFunction.ExecutionFee = executionFee;
|
||||
createSwapOrderFunction.ShouldWrap = shouldWrap;
|
||||
createSwapOrderFunction.ShouldUnwrap = shouldUnwrap;
|
||||
|
||||
return ContractHandler.SendRequestAsync(createSwapOrderFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> CreateSwapOrderRequestAndWaitForReceiptAsync(List<string> path, BigInteger amountIn, BigInteger minOut, BigInteger triggerRatio, bool triggerAboveThreshold, BigInteger executionFee, bool shouldWrap, bool shouldUnwrap, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
var createSwapOrderFunction = new CreateSwapOrderFunction();
|
||||
createSwapOrderFunction.Path = path;
|
||||
createSwapOrderFunction.AmountIn = amountIn;
|
||||
createSwapOrderFunction.MinOut = minOut;
|
||||
createSwapOrderFunction.TriggerRatio = triggerRatio;
|
||||
createSwapOrderFunction.TriggerAboveThreshold = triggerAboveThreshold;
|
||||
createSwapOrderFunction.ExecutionFee = executionFee;
|
||||
createSwapOrderFunction.ShouldWrap = shouldWrap;
|
||||
createSwapOrderFunction.ShouldUnwrap = shouldUnwrap;
|
||||
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(createSwapOrderFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<DecreaseOrdersOutputDTO> DecreaseOrdersQueryAsync(DecreaseOrdersFunction decreaseOrdersFunction, BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryDeserializingToObjectAsync<DecreaseOrdersFunction, DecreaseOrdersOutputDTO>(decreaseOrdersFunction, blockParameter);
|
||||
}
|
||||
|
||||
public Task<DecreaseOrdersOutputDTO> DecreaseOrdersQueryAsync(string returnValue1, BigInteger returnValue2, BlockParameter blockParameter = null)
|
||||
{
|
||||
var decreaseOrdersFunction = new DecreaseOrdersFunction();
|
||||
decreaseOrdersFunction.ReturnValue1 = returnValue1;
|
||||
decreaseOrdersFunction.ReturnValue2 = returnValue2;
|
||||
|
||||
return ContractHandler.QueryDeserializingToObjectAsync<DecreaseOrdersFunction, DecreaseOrdersOutputDTO>(decreaseOrdersFunction, blockParameter);
|
||||
}
|
||||
|
||||
public Task<BigInteger> DecreaseOrdersIndexQueryAsync(DecreaseOrdersIndexFunction decreaseOrdersIndexFunction, BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryAsync<DecreaseOrdersIndexFunction, BigInteger>(decreaseOrdersIndexFunction, blockParameter);
|
||||
}
|
||||
|
||||
|
||||
public Task<BigInteger> DecreaseOrdersIndexQueryAsync(string returnValue1, BlockParameter blockParameter = null)
|
||||
{
|
||||
var decreaseOrdersIndexFunction = new DecreaseOrdersIndexFunction();
|
||||
decreaseOrdersIndexFunction.ReturnValue1 = returnValue1;
|
||||
|
||||
return ContractHandler.QueryAsync<DecreaseOrdersIndexFunction, BigInteger>(decreaseOrdersIndexFunction, blockParameter);
|
||||
}
|
||||
|
||||
public Task<string> ExecuteDecreaseOrderRequestAsync(ExecuteDecreaseOrderFunction executeDecreaseOrderFunction)
|
||||
{
|
||||
return ContractHandler.SendRequestAsync(executeDecreaseOrderFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> ExecuteDecreaseOrderRequestAndWaitForReceiptAsync(ExecuteDecreaseOrderFunction executeDecreaseOrderFunction, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(executeDecreaseOrderFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<string> ExecuteDecreaseOrderRequestAsync(string address, BigInteger orderIndex, string feeReceiver)
|
||||
{
|
||||
var executeDecreaseOrderFunction = new ExecuteDecreaseOrderFunction();
|
||||
executeDecreaseOrderFunction.Address = address;
|
||||
executeDecreaseOrderFunction.OrderIndex = orderIndex;
|
||||
executeDecreaseOrderFunction.FeeReceiver = feeReceiver;
|
||||
|
||||
return ContractHandler.SendRequestAsync(executeDecreaseOrderFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> ExecuteDecreaseOrderRequestAndWaitForReceiptAsync(string address, BigInteger orderIndex, string feeReceiver, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
var executeDecreaseOrderFunction = new ExecuteDecreaseOrderFunction();
|
||||
executeDecreaseOrderFunction.Address = address;
|
||||
executeDecreaseOrderFunction.OrderIndex = orderIndex;
|
||||
executeDecreaseOrderFunction.FeeReceiver = feeReceiver;
|
||||
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(executeDecreaseOrderFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<string> ExecuteIncreaseOrderRequestAsync(ExecuteIncreaseOrderFunction executeIncreaseOrderFunction)
|
||||
{
|
||||
return ContractHandler.SendRequestAsync(executeIncreaseOrderFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> ExecuteIncreaseOrderRequestAndWaitForReceiptAsync(ExecuteIncreaseOrderFunction executeIncreaseOrderFunction, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(executeIncreaseOrderFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<string> ExecuteIncreaseOrderRequestAsync(string address, BigInteger orderIndex, string feeReceiver)
|
||||
{
|
||||
var executeIncreaseOrderFunction = new ExecuteIncreaseOrderFunction();
|
||||
executeIncreaseOrderFunction.Address = address;
|
||||
executeIncreaseOrderFunction.OrderIndex = orderIndex;
|
||||
executeIncreaseOrderFunction.FeeReceiver = feeReceiver;
|
||||
|
||||
return ContractHandler.SendRequestAsync(executeIncreaseOrderFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> ExecuteIncreaseOrderRequestAndWaitForReceiptAsync(string address, BigInteger orderIndex, string feeReceiver, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
var executeIncreaseOrderFunction = new ExecuteIncreaseOrderFunction();
|
||||
executeIncreaseOrderFunction.Address = address;
|
||||
executeIncreaseOrderFunction.OrderIndex = orderIndex;
|
||||
executeIncreaseOrderFunction.FeeReceiver = feeReceiver;
|
||||
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(executeIncreaseOrderFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<string> ExecuteSwapOrderRequestAsync(ExecuteSwapOrderFunction executeSwapOrderFunction)
|
||||
{
|
||||
return ContractHandler.SendRequestAsync(executeSwapOrderFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> ExecuteSwapOrderRequestAndWaitForReceiptAsync(ExecuteSwapOrderFunction executeSwapOrderFunction, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(executeSwapOrderFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<string> ExecuteSwapOrderRequestAsync(string account, BigInteger orderIndex, string feeReceiver)
|
||||
{
|
||||
var executeSwapOrderFunction = new ExecuteSwapOrderFunction();
|
||||
executeSwapOrderFunction.Account = account;
|
||||
executeSwapOrderFunction.OrderIndex = orderIndex;
|
||||
executeSwapOrderFunction.FeeReceiver = feeReceiver;
|
||||
|
||||
return ContractHandler.SendRequestAsync(executeSwapOrderFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> ExecuteSwapOrderRequestAndWaitForReceiptAsync(string account, BigInteger orderIndex, string feeReceiver, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
var executeSwapOrderFunction = new ExecuteSwapOrderFunction();
|
||||
executeSwapOrderFunction.Account = account;
|
||||
executeSwapOrderFunction.OrderIndex = orderIndex;
|
||||
executeSwapOrderFunction.FeeReceiver = feeReceiver;
|
||||
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(executeSwapOrderFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<GetDecreaseOrderOutputDTO> GetDecreaseOrderQueryAsync(GetDecreaseOrderFunction getDecreaseOrderFunction, BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryDeserializingToObjectAsync<GetDecreaseOrderFunction, GetDecreaseOrderOutputDTO>(getDecreaseOrderFunction, blockParameter);
|
||||
}
|
||||
|
||||
public Task<GetDecreaseOrderOutputDTO> GetDecreaseOrderQueryAsync(string account, BigInteger orderIndex, BlockParameter blockParameter = null)
|
||||
{
|
||||
var getDecreaseOrderFunction = new GetDecreaseOrderFunction();
|
||||
getDecreaseOrderFunction.Account = account;
|
||||
getDecreaseOrderFunction.OrderIndex = orderIndex;
|
||||
|
||||
return ContractHandler.QueryDeserializingToObjectAsync<GetDecreaseOrderFunction, GetDecreaseOrderOutputDTO>(getDecreaseOrderFunction, blockParameter);
|
||||
}
|
||||
|
||||
public Task<GetIncreaseOrderOutputDTO> GetIncreaseOrderQueryAsync(GetIncreaseOrderFunction getIncreaseOrderFunction, BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryDeserializingToObjectAsync<GetIncreaseOrderFunction, GetIncreaseOrderOutputDTO>(getIncreaseOrderFunction, blockParameter);
|
||||
}
|
||||
|
||||
public Task<GetIncreaseOrderOutputDTO> GetIncreaseOrderQueryAsync(string account, BigInteger orderIndex, BlockParameter blockParameter = null)
|
||||
{
|
||||
var getIncreaseOrderFunction = new GetIncreaseOrderFunction();
|
||||
getIncreaseOrderFunction.Account = account;
|
||||
getIncreaseOrderFunction.OrderIndex = orderIndex;
|
||||
|
||||
return ContractHandler.QueryDeserializingToObjectAsync<GetIncreaseOrderFunction, GetIncreaseOrderOutputDTO>(getIncreaseOrderFunction, blockParameter);
|
||||
}
|
||||
|
||||
public Task<GetSwapOrderOutputDTO> GetSwapOrderQueryAsync(GetSwapOrderFunction getSwapOrderFunction, BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryDeserializingToObjectAsync<GetSwapOrderFunction, GetSwapOrderOutputDTO>(getSwapOrderFunction, blockParameter);
|
||||
}
|
||||
|
||||
public Task<GetSwapOrderOutputDTO> GetSwapOrderQueryAsync(string account, BigInteger orderIndex, BlockParameter blockParameter = null)
|
||||
{
|
||||
var getSwapOrderFunction = new GetSwapOrderFunction();
|
||||
getSwapOrderFunction.Account = account;
|
||||
getSwapOrderFunction.OrderIndex = orderIndex;
|
||||
|
||||
return ContractHandler.QueryDeserializingToObjectAsync<GetSwapOrderFunction, GetSwapOrderOutputDTO>(getSwapOrderFunction, blockParameter);
|
||||
}
|
||||
|
||||
public Task<BigInteger> GetUsdgMinPriceQueryAsync(GetUsdgMinPriceFunction getUsdgMinPriceFunction, BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryAsync<GetUsdgMinPriceFunction, BigInteger>(getUsdgMinPriceFunction, blockParameter);
|
||||
}
|
||||
|
||||
|
||||
public Task<BigInteger> GetUsdgMinPriceQueryAsync(string otherToken, BlockParameter blockParameter = null)
|
||||
{
|
||||
var getUsdgMinPriceFunction = new GetUsdgMinPriceFunction();
|
||||
getUsdgMinPriceFunction.OtherToken = otherToken;
|
||||
|
||||
return ContractHandler.QueryAsync<GetUsdgMinPriceFunction, BigInteger>(getUsdgMinPriceFunction, blockParameter);
|
||||
}
|
||||
|
||||
public Task<string> GovQueryAsync(GovFunction govFunction, BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryAsync<GovFunction, string>(govFunction, blockParameter);
|
||||
}
|
||||
|
||||
|
||||
public Task<string> GovQueryAsync(BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryAsync<GovFunction, string>(null, blockParameter);
|
||||
}
|
||||
|
||||
public Task<IncreaseOrdersOutputDTO> IncreaseOrdersQueryAsync(IncreaseOrdersFunction increaseOrdersFunction, BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryDeserializingToObjectAsync<IncreaseOrdersFunction, IncreaseOrdersOutputDTO>(increaseOrdersFunction, blockParameter);
|
||||
}
|
||||
|
||||
public Task<IncreaseOrdersOutputDTO> IncreaseOrdersQueryAsync(string returnValue1, BigInteger returnValue2, BlockParameter blockParameter = null)
|
||||
{
|
||||
var increaseOrdersFunction = new IncreaseOrdersFunction();
|
||||
increaseOrdersFunction.ReturnValue1 = returnValue1;
|
||||
increaseOrdersFunction.ReturnValue2 = returnValue2;
|
||||
|
||||
return ContractHandler.QueryDeserializingToObjectAsync<IncreaseOrdersFunction, IncreaseOrdersOutputDTO>(increaseOrdersFunction, blockParameter);
|
||||
}
|
||||
|
||||
public Task<BigInteger> IncreaseOrdersIndexQueryAsync(IncreaseOrdersIndexFunction increaseOrdersIndexFunction, BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryAsync<IncreaseOrdersIndexFunction, BigInteger>(increaseOrdersIndexFunction, blockParameter);
|
||||
}
|
||||
|
||||
|
||||
public Task<BigInteger> IncreaseOrdersIndexQueryAsync(string returnValue1, BlockParameter blockParameter = null)
|
||||
{
|
||||
var increaseOrdersIndexFunction = new IncreaseOrdersIndexFunction();
|
||||
increaseOrdersIndexFunction.ReturnValue1 = returnValue1;
|
||||
|
||||
return ContractHandler.QueryAsync<IncreaseOrdersIndexFunction, BigInteger>(increaseOrdersIndexFunction, blockParameter);
|
||||
}
|
||||
|
||||
public Task<string> InitializeRequestAsync(InitializeFunction initializeFunction)
|
||||
{
|
||||
return ContractHandler.SendRequestAsync(initializeFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> InitializeRequestAndWaitForReceiptAsync(InitializeFunction initializeFunction, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(initializeFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<string> InitializeRequestAsync(string router, string vault, string weth, string usdg, BigInteger minExecutionFee, BigInteger minPurchaseTokenAmountUsd)
|
||||
{
|
||||
var initializeFunction = new InitializeFunction();
|
||||
initializeFunction.Router = router;
|
||||
initializeFunction.Vault = vault;
|
||||
initializeFunction.Weth = weth;
|
||||
initializeFunction.Usdg = usdg;
|
||||
initializeFunction.MinExecutionFee = minExecutionFee;
|
||||
initializeFunction.MinPurchaseTokenAmountUsd = minPurchaseTokenAmountUsd;
|
||||
|
||||
return ContractHandler.SendRequestAsync(initializeFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> InitializeRequestAndWaitForReceiptAsync(string router, string vault, string weth, string usdg, BigInteger minExecutionFee, BigInteger minPurchaseTokenAmountUsd, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
var initializeFunction = new InitializeFunction();
|
||||
initializeFunction.Router = router;
|
||||
initializeFunction.Vault = vault;
|
||||
initializeFunction.Weth = weth;
|
||||
initializeFunction.Usdg = usdg;
|
||||
initializeFunction.MinExecutionFee = minExecutionFee;
|
||||
initializeFunction.MinPurchaseTokenAmountUsd = minPurchaseTokenAmountUsd;
|
||||
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(initializeFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<bool> IsInitializedQueryAsync(IsInitializedFunction isInitializedFunction, BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryAsync<IsInitializedFunction, bool>(isInitializedFunction, blockParameter);
|
||||
}
|
||||
|
||||
|
||||
public Task<bool> IsInitializedQueryAsync(BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryAsync<IsInitializedFunction, bool>(null, blockParameter);
|
||||
}
|
||||
|
||||
public Task<BigInteger> MinExecutionFeeQueryAsync(MinExecutionFeeFunction minExecutionFeeFunction, BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryAsync<MinExecutionFeeFunction, BigInteger>(minExecutionFeeFunction, blockParameter);
|
||||
}
|
||||
|
||||
|
||||
public Task<BigInteger> MinExecutionFeeQueryAsync(BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryAsync<MinExecutionFeeFunction, BigInteger>(null, blockParameter);
|
||||
}
|
||||
|
||||
public Task<BigInteger> MinPurchaseTokenAmountUsdQueryAsync(MinPurchaseTokenAmountUsdFunction minPurchaseTokenAmountUsdFunction, BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryAsync<MinPurchaseTokenAmountUsdFunction, BigInteger>(minPurchaseTokenAmountUsdFunction, blockParameter);
|
||||
}
|
||||
|
||||
|
||||
public Task<BigInteger> MinPurchaseTokenAmountUsdQueryAsync(BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryAsync<MinPurchaseTokenAmountUsdFunction, BigInteger>(null, blockParameter);
|
||||
}
|
||||
|
||||
public Task<string> RouterQueryAsync(RouterFunction routerFunction, BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryAsync<RouterFunction, string>(routerFunction, blockParameter);
|
||||
}
|
||||
|
||||
|
||||
public Task<string> RouterQueryAsync(BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryAsync<RouterFunction, string>(null, blockParameter);
|
||||
}
|
||||
|
||||
public Task<string> SetGovRequestAsync(SetGovFunction setGovFunction)
|
||||
{
|
||||
return ContractHandler.SendRequestAsync(setGovFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> SetGovRequestAndWaitForReceiptAsync(SetGovFunction setGovFunction, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(setGovFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<string> SetGovRequestAsync(string gov)
|
||||
{
|
||||
var setGovFunction = new SetGovFunction();
|
||||
setGovFunction.Gov = gov;
|
||||
|
||||
return ContractHandler.SendRequestAsync(setGovFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> SetGovRequestAndWaitForReceiptAsync(string gov, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
var setGovFunction = new SetGovFunction();
|
||||
setGovFunction.Gov = gov;
|
||||
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(setGovFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<string> SetMinExecutionFeeRequestAsync(SetMinExecutionFeeFunction setMinExecutionFeeFunction)
|
||||
{
|
||||
return ContractHandler.SendRequestAsync(setMinExecutionFeeFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> SetMinExecutionFeeRequestAndWaitForReceiptAsync(SetMinExecutionFeeFunction setMinExecutionFeeFunction, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(setMinExecutionFeeFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<string> SetMinExecutionFeeRequestAsync(BigInteger minExecutionFee)
|
||||
{
|
||||
var setMinExecutionFeeFunction = new SetMinExecutionFeeFunction();
|
||||
setMinExecutionFeeFunction.MinExecutionFee = minExecutionFee;
|
||||
|
||||
return ContractHandler.SendRequestAsync(setMinExecutionFeeFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> SetMinExecutionFeeRequestAndWaitForReceiptAsync(BigInteger minExecutionFee, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
var setMinExecutionFeeFunction = new SetMinExecutionFeeFunction();
|
||||
setMinExecutionFeeFunction.MinExecutionFee = minExecutionFee;
|
||||
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(setMinExecutionFeeFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<string> SetMinPurchaseTokenAmountUsdRequestAsync(SetMinPurchaseTokenAmountUsdFunction setMinPurchaseTokenAmountUsdFunction)
|
||||
{
|
||||
return ContractHandler.SendRequestAsync(setMinPurchaseTokenAmountUsdFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> SetMinPurchaseTokenAmountUsdRequestAndWaitForReceiptAsync(SetMinPurchaseTokenAmountUsdFunction setMinPurchaseTokenAmountUsdFunction, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(setMinPurchaseTokenAmountUsdFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<string> SetMinPurchaseTokenAmountUsdRequestAsync(BigInteger minPurchaseTokenAmountUsd)
|
||||
{
|
||||
var setMinPurchaseTokenAmountUsdFunction = new SetMinPurchaseTokenAmountUsdFunction();
|
||||
setMinPurchaseTokenAmountUsdFunction.MinPurchaseTokenAmountUsd = minPurchaseTokenAmountUsd;
|
||||
|
||||
return ContractHandler.SendRequestAsync(setMinPurchaseTokenAmountUsdFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> SetMinPurchaseTokenAmountUsdRequestAndWaitForReceiptAsync(BigInteger minPurchaseTokenAmountUsd, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
var setMinPurchaseTokenAmountUsdFunction = new SetMinPurchaseTokenAmountUsdFunction();
|
||||
setMinPurchaseTokenAmountUsdFunction.MinPurchaseTokenAmountUsd = minPurchaseTokenAmountUsd;
|
||||
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(setMinPurchaseTokenAmountUsdFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<SwapOrdersOutputDTO> SwapOrdersQueryAsync(SwapOrdersFunction swapOrdersFunction, BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryDeserializingToObjectAsync<SwapOrdersFunction, SwapOrdersOutputDTO>(swapOrdersFunction, blockParameter);
|
||||
}
|
||||
|
||||
public Task<SwapOrdersOutputDTO> SwapOrdersQueryAsync(string returnValue1, BigInteger returnValue2, BlockParameter blockParameter = null)
|
||||
{
|
||||
var swapOrdersFunction = new SwapOrdersFunction();
|
||||
swapOrdersFunction.ReturnValue1 = returnValue1;
|
||||
swapOrdersFunction.ReturnValue2 = returnValue2;
|
||||
|
||||
return ContractHandler.QueryDeserializingToObjectAsync<SwapOrdersFunction, SwapOrdersOutputDTO>(swapOrdersFunction, blockParameter);
|
||||
}
|
||||
|
||||
public Task<BigInteger> SwapOrdersIndexQueryAsync(SwapOrdersIndexFunction swapOrdersIndexFunction, BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryAsync<SwapOrdersIndexFunction, BigInteger>(swapOrdersIndexFunction, blockParameter);
|
||||
}
|
||||
|
||||
|
||||
public Task<BigInteger> SwapOrdersIndexQueryAsync(string returnValue1, BlockParameter blockParameter = null)
|
||||
{
|
||||
var swapOrdersIndexFunction = new SwapOrdersIndexFunction();
|
||||
swapOrdersIndexFunction.ReturnValue1 = returnValue1;
|
||||
|
||||
return ContractHandler.QueryAsync<SwapOrdersIndexFunction, BigInteger>(swapOrdersIndexFunction, blockParameter);
|
||||
}
|
||||
|
||||
public Task<string> UpdateDecreaseOrderRequestAsync(UpdateDecreaseOrderFunction updateDecreaseOrderFunction)
|
||||
{
|
||||
return ContractHandler.SendRequestAsync(updateDecreaseOrderFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> UpdateDecreaseOrderRequestAndWaitForReceiptAsync(UpdateDecreaseOrderFunction updateDecreaseOrderFunction, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(updateDecreaseOrderFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<string> UpdateDecreaseOrderRequestAsync(BigInteger orderIndex, BigInteger collateralDelta, BigInteger sizeDelta, BigInteger triggerPrice, bool triggerAboveThreshold)
|
||||
{
|
||||
var updateDecreaseOrderFunction = new UpdateDecreaseOrderFunction();
|
||||
updateDecreaseOrderFunction.OrderIndex = orderIndex;
|
||||
updateDecreaseOrderFunction.CollateralDelta = collateralDelta;
|
||||
updateDecreaseOrderFunction.SizeDelta = sizeDelta;
|
||||
updateDecreaseOrderFunction.TriggerPrice = triggerPrice;
|
||||
updateDecreaseOrderFunction.TriggerAboveThreshold = triggerAboveThreshold;
|
||||
|
||||
return ContractHandler.SendRequestAsync(updateDecreaseOrderFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> UpdateDecreaseOrderRequestAndWaitForReceiptAsync(BigInteger orderIndex, BigInteger collateralDelta, BigInteger sizeDelta, BigInteger triggerPrice, bool triggerAboveThreshold, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
var updateDecreaseOrderFunction = new UpdateDecreaseOrderFunction();
|
||||
updateDecreaseOrderFunction.OrderIndex = orderIndex;
|
||||
updateDecreaseOrderFunction.CollateralDelta = collateralDelta;
|
||||
updateDecreaseOrderFunction.SizeDelta = sizeDelta;
|
||||
updateDecreaseOrderFunction.TriggerPrice = triggerPrice;
|
||||
updateDecreaseOrderFunction.TriggerAboveThreshold = triggerAboveThreshold;
|
||||
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(updateDecreaseOrderFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<string> UpdateIncreaseOrderRequestAsync(UpdateIncreaseOrderFunction updateIncreaseOrderFunction)
|
||||
{
|
||||
return ContractHandler.SendRequestAsync(updateIncreaseOrderFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> UpdateIncreaseOrderRequestAndWaitForReceiptAsync(UpdateIncreaseOrderFunction updateIncreaseOrderFunction, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(updateIncreaseOrderFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<string> UpdateIncreaseOrderRequestAsync(BigInteger orderIndex, BigInteger sizeDelta, BigInteger triggerPrice, bool triggerAboveThreshold)
|
||||
{
|
||||
var updateIncreaseOrderFunction = new UpdateIncreaseOrderFunction();
|
||||
updateIncreaseOrderFunction.OrderIndex = orderIndex;
|
||||
updateIncreaseOrderFunction.SizeDelta = sizeDelta;
|
||||
updateIncreaseOrderFunction.TriggerPrice = triggerPrice;
|
||||
updateIncreaseOrderFunction.TriggerAboveThreshold = triggerAboveThreshold;
|
||||
|
||||
return ContractHandler.SendRequestAsync(updateIncreaseOrderFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> UpdateIncreaseOrderRequestAndWaitForReceiptAsync(BigInteger orderIndex, BigInteger sizeDelta, BigInteger triggerPrice, bool triggerAboveThreshold, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
var updateIncreaseOrderFunction = new UpdateIncreaseOrderFunction();
|
||||
updateIncreaseOrderFunction.OrderIndex = orderIndex;
|
||||
updateIncreaseOrderFunction.SizeDelta = sizeDelta;
|
||||
updateIncreaseOrderFunction.TriggerPrice = triggerPrice;
|
||||
updateIncreaseOrderFunction.TriggerAboveThreshold = triggerAboveThreshold;
|
||||
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(updateIncreaseOrderFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<string> UpdateSwapOrderRequestAsync(UpdateSwapOrderFunction updateSwapOrderFunction)
|
||||
{
|
||||
return ContractHandler.SendRequestAsync(updateSwapOrderFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> UpdateSwapOrderRequestAndWaitForReceiptAsync(UpdateSwapOrderFunction updateSwapOrderFunction, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(updateSwapOrderFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<string> UpdateSwapOrderRequestAsync(BigInteger orderIndex, BigInteger minOut, BigInteger triggerRatio, bool triggerAboveThreshold)
|
||||
{
|
||||
var updateSwapOrderFunction = new UpdateSwapOrderFunction();
|
||||
updateSwapOrderFunction.OrderIndex = orderIndex;
|
||||
updateSwapOrderFunction.MinOut = minOut;
|
||||
updateSwapOrderFunction.TriggerRatio = triggerRatio;
|
||||
updateSwapOrderFunction.TriggerAboveThreshold = triggerAboveThreshold;
|
||||
|
||||
return ContractHandler.SendRequestAsync(updateSwapOrderFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> UpdateSwapOrderRequestAndWaitForReceiptAsync(BigInteger orderIndex, BigInteger minOut, BigInteger triggerRatio, bool triggerAboveThreshold, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
var updateSwapOrderFunction = new UpdateSwapOrderFunction();
|
||||
updateSwapOrderFunction.OrderIndex = orderIndex;
|
||||
updateSwapOrderFunction.MinOut = minOut;
|
||||
updateSwapOrderFunction.TriggerRatio = triggerRatio;
|
||||
updateSwapOrderFunction.TriggerAboveThreshold = triggerAboveThreshold;
|
||||
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(updateSwapOrderFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<string> UsdgQueryAsync(UsdgFunction usdgFunction, BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryAsync<UsdgFunction, string>(usdgFunction, blockParameter);
|
||||
}
|
||||
|
||||
|
||||
public Task<string> UsdgQueryAsync(BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryAsync<UsdgFunction, string>(null, blockParameter);
|
||||
}
|
||||
|
||||
public Task<ValidatePositionOrderPriceOutputDTO> ValidatePositionOrderPriceQueryAsync(ValidatePositionOrderPriceFunction validatePositionOrderPriceFunction, BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryDeserializingToObjectAsync<ValidatePositionOrderPriceFunction, ValidatePositionOrderPriceOutputDTO>(validatePositionOrderPriceFunction, blockParameter);
|
||||
}
|
||||
|
||||
public Task<ValidatePositionOrderPriceOutputDTO> ValidatePositionOrderPriceQueryAsync(bool triggerAboveThreshold, BigInteger triggerPrice, string indexToken, bool maximizePrice, bool raise, BlockParameter blockParameter = null)
|
||||
{
|
||||
var validatePositionOrderPriceFunction = new ValidatePositionOrderPriceFunction();
|
||||
validatePositionOrderPriceFunction.TriggerAboveThreshold = triggerAboveThreshold;
|
||||
validatePositionOrderPriceFunction.TriggerPrice = triggerPrice;
|
||||
validatePositionOrderPriceFunction.IndexToken = indexToken;
|
||||
validatePositionOrderPriceFunction.MaximizePrice = maximizePrice;
|
||||
validatePositionOrderPriceFunction.Raise = raise;
|
||||
|
||||
return ContractHandler.QueryDeserializingToObjectAsync<ValidatePositionOrderPriceFunction, ValidatePositionOrderPriceOutputDTO>(validatePositionOrderPriceFunction, blockParameter);
|
||||
}
|
||||
|
||||
public Task<bool> ValidateSwapOrderPriceWithTriggerAboveThresholdQueryAsync(ValidateSwapOrderPriceWithTriggerAboveThresholdFunction validateSwapOrderPriceWithTriggerAboveThresholdFunction, BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryAsync<ValidateSwapOrderPriceWithTriggerAboveThresholdFunction, bool>(validateSwapOrderPriceWithTriggerAboveThresholdFunction, blockParameter);
|
||||
}
|
||||
|
||||
|
||||
public Task<bool> ValidateSwapOrderPriceWithTriggerAboveThresholdQueryAsync(List<string> path, BigInteger triggerRatio, BlockParameter blockParameter = null)
|
||||
{
|
||||
var validateSwapOrderPriceWithTriggerAboveThresholdFunction = new ValidateSwapOrderPriceWithTriggerAboveThresholdFunction();
|
||||
validateSwapOrderPriceWithTriggerAboveThresholdFunction.Path = path;
|
||||
validateSwapOrderPriceWithTriggerAboveThresholdFunction.TriggerRatio = triggerRatio;
|
||||
|
||||
return ContractHandler.QueryAsync<ValidateSwapOrderPriceWithTriggerAboveThresholdFunction, bool>(validateSwapOrderPriceWithTriggerAboveThresholdFunction, blockParameter);
|
||||
}
|
||||
|
||||
public Task<string> VaultQueryAsync(VaultFunction vaultFunction, BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryAsync<VaultFunction, string>(vaultFunction, blockParameter);
|
||||
}
|
||||
|
||||
|
||||
public Task<string> VaultQueryAsync(BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryAsync<VaultFunction, string>(null, blockParameter);
|
||||
}
|
||||
|
||||
public Task<string> WethQueryAsync(WethFunction wethFunction, BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryAsync<WethFunction, string>(wethFunction, blockParameter);
|
||||
}
|
||||
|
||||
|
||||
public Task<string> WethQueryAsync(BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryAsync<WethFunction, string>(null, blockParameter);
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,88 @@
|
||||
using System.Numerics;
|
||||
using Nethereum.Web3;
|
||||
using Nethereum.RPC.Eth.DTOs;
|
||||
using Nethereum.Contracts.ContractHandlers;
|
||||
using Managing.Tools.OrderBookReader.ContractDefinition;
|
||||
|
||||
namespace Managing.Tools.OrderBookReader
|
||||
{
|
||||
public partial class OrderBookReaderService
|
||||
{
|
||||
public static Task<TransactionReceipt> DeployContractAndWaitForReceiptAsync(Web3 web3, OrderBookReaderDeployment orderBookReaderDeployment, CancellationTokenSource cancellationTokenSource = null)
|
||||
{
|
||||
return web3.Eth.GetContractDeploymentHandler<OrderBookReaderDeployment>().SendRequestAndWaitForReceiptAsync(orderBookReaderDeployment, cancellationTokenSource);
|
||||
}
|
||||
|
||||
public static Task<string> DeployContractAsync(Web3 web3, OrderBookReaderDeployment orderBookReaderDeployment)
|
||||
{
|
||||
return web3.Eth.GetContractDeploymentHandler<OrderBookReaderDeployment>().SendRequestAsync(orderBookReaderDeployment);
|
||||
}
|
||||
|
||||
public static async Task<OrderBookReaderService> DeployContractAndGetServiceAsync(Web3 web3, OrderBookReaderDeployment orderBookReaderDeployment, CancellationTokenSource cancellationTokenSource = null)
|
||||
{
|
||||
var receipt = await DeployContractAndWaitForReceiptAsync(web3, orderBookReaderDeployment, cancellationTokenSource);
|
||||
return new OrderBookReaderService(web3, receipt.ContractAddress);
|
||||
}
|
||||
|
||||
protected IWeb3 Web3 { get; }
|
||||
|
||||
public ContractHandler ContractHandler { get; }
|
||||
|
||||
public OrderBookReaderService(Web3 web3, string contractAddress)
|
||||
{
|
||||
Web3 = web3;
|
||||
ContractHandler = web3.Eth.GetContractHandler(contractAddress);
|
||||
}
|
||||
|
||||
public OrderBookReaderService(IWeb3 web3, string contractAddress)
|
||||
{
|
||||
Web3 = web3;
|
||||
ContractHandler = web3.Eth.GetContractHandler(contractAddress);
|
||||
}
|
||||
|
||||
public Task<GetDecreaseOrdersOutputDTO> GetDecreaseOrdersQueryAsync(GetDecreaseOrdersFunction getDecreaseOrdersFunction, BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryDeserializingToObjectAsync<GetDecreaseOrdersFunction, GetDecreaseOrdersOutputDTO>(getDecreaseOrdersFunction, blockParameter);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
public Task<GetIncreaseOrdersOutputDTO> GetIncreaseOrdersQueryAsync(GetIncreaseOrdersFunction getIncreaseOrdersFunction, BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryDeserializingToObjectAsync<GetIncreaseOrdersFunction, GetIncreaseOrdersOutputDTO>(getIncreaseOrdersFunction, blockParameter);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
public Task<GetSwapOrdersOutputDTO> GetSwapOrdersQueryAsync(GetSwapOrdersFunction getSwapOrdersFunction, BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryDeserializingToObjectAsync<GetSwapOrdersFunction, GetSwapOrdersOutputDTO>(getSwapOrdersFunction, blockParameter);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
1142
src/Managing.Tools.ABI/PositionRouter/PositionRouterService.cs
Normal file
1142
src/Managing.Tools.ABI/PositionRouter/PositionRouterService.cs
Normal file
File diff suppressed because it is too large
Load Diff
2
src/Managing.Tools.ABI/Program.cs
Normal file
2
src/Managing.Tools.ABI/Program.cs
Normal file
@@ -0,0 +1,2 @@
|
||||
// See https://aka.ms/new-console-template for more information
|
||||
Console.WriteLine("Hello, World!");
|
||||
File diff suppressed because one or more lines are too long
443
src/Managing.Tools.ABI/Reader/ReaderService.cs
Normal file
443
src/Managing.Tools.ABI/Reader/ReaderService.cs
Normal file
@@ -0,0 +1,443 @@
|
||||
using System.Numerics;
|
||||
using Nethereum.Web3;
|
||||
using Nethereum.RPC.Eth.DTOs;
|
||||
using Nethereum.Contracts.ContractHandlers;
|
||||
using Managing.Tools.Reader.ContractDefinition;
|
||||
|
||||
namespace Managing.Tools.Reader
|
||||
{
|
||||
public partial class ReaderService
|
||||
{
|
||||
public static Task<TransactionReceipt> DeployContractAndWaitForReceiptAsync(Web3 web3, ReaderDeployment readerDeployment, CancellationTokenSource cancellationTokenSource = null)
|
||||
{
|
||||
return web3.Eth.GetContractDeploymentHandler<ReaderDeployment>().SendRequestAndWaitForReceiptAsync(readerDeployment, cancellationTokenSource);
|
||||
}
|
||||
|
||||
public static Task<string> DeployContractAsync(Web3 web3, ReaderDeployment readerDeployment)
|
||||
{
|
||||
return web3.Eth.GetContractDeploymentHandler<ReaderDeployment>().SendRequestAsync(readerDeployment);
|
||||
}
|
||||
|
||||
public static async Task<ReaderService> DeployContractAndGetServiceAsync(Web3 web3, ReaderDeployment readerDeployment, CancellationTokenSource cancellationTokenSource = null)
|
||||
{
|
||||
var receipt = await DeployContractAndWaitForReceiptAsync(web3, readerDeployment, cancellationTokenSource);
|
||||
return new ReaderService(web3, receipt.ContractAddress);
|
||||
}
|
||||
|
||||
protected IWeb3 Web3 { get; }
|
||||
|
||||
public ContractHandler ContractHandler { get; }
|
||||
|
||||
public ReaderService(Web3 web3, string contractAddress)
|
||||
{
|
||||
Web3 = web3;
|
||||
ContractHandler = web3.Eth.GetContractHandler(contractAddress);
|
||||
}
|
||||
|
||||
public ReaderService(IWeb3 web3, string contractAddress)
|
||||
{
|
||||
Web3 = web3;
|
||||
ContractHandler = web3.Eth.GetContractHandler(contractAddress);
|
||||
}
|
||||
|
||||
public Task<BigInteger> BasisPointsDivisorQueryAsync(BasisPointsDivisorFunction basisPointsDivisorFunction, BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryAsync<BasisPointsDivisorFunction, BigInteger>(basisPointsDivisorFunction, blockParameter);
|
||||
}
|
||||
|
||||
|
||||
public Task<BigInteger> BasisPointsDivisorQueryAsync(BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryAsync<BasisPointsDivisorFunction, BigInteger>(null, blockParameter);
|
||||
}
|
||||
|
||||
public Task<BigInteger> PositionPropsLengthQueryAsync(PositionPropsLengthFunction positionPropsLengthFunction, BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryAsync<PositionPropsLengthFunction, BigInteger>(positionPropsLengthFunction, blockParameter);
|
||||
}
|
||||
|
||||
|
||||
public Task<BigInteger> PositionPropsLengthQueryAsync(BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryAsync<PositionPropsLengthFunction, BigInteger>(null, blockParameter);
|
||||
}
|
||||
|
||||
public Task<BigInteger> PricePrecisionQueryAsync(PricePrecisionFunction pricePrecisionFunction, BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryAsync<PricePrecisionFunction, BigInteger>(pricePrecisionFunction, blockParameter);
|
||||
}
|
||||
|
||||
|
||||
public Task<BigInteger> PricePrecisionQueryAsync(BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryAsync<PricePrecisionFunction, BigInteger>(null, blockParameter);
|
||||
}
|
||||
|
||||
public Task<BigInteger> UsdgDecimalsQueryAsync(UsdgDecimalsFunction usdgDecimalsFunction, BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryAsync<UsdgDecimalsFunction, BigInteger>(usdgDecimalsFunction, blockParameter);
|
||||
}
|
||||
|
||||
|
||||
public Task<BigInteger> UsdgDecimalsQueryAsync(BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryAsync<UsdgDecimalsFunction, BigInteger>(null, blockParameter);
|
||||
}
|
||||
|
||||
public Task<GetAmountOutOutputDTO> GetAmountOutQueryAsync(GetAmountOutFunction getAmountOutFunction, BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryDeserializingToObjectAsync<GetAmountOutFunction, GetAmountOutOutputDTO>(getAmountOutFunction, blockParameter);
|
||||
}
|
||||
|
||||
public Task<GetAmountOutOutputDTO> GetAmountOutQueryAsync(string vault, string tokenIn, string tokenOut, BigInteger amountIn, BlockParameter blockParameter = null)
|
||||
{
|
||||
var getAmountOutFunction = new GetAmountOutFunction();
|
||||
getAmountOutFunction.Vault = vault;
|
||||
getAmountOutFunction.TokenIn = tokenIn;
|
||||
getAmountOutFunction.TokenOut = tokenOut;
|
||||
getAmountOutFunction.AmountIn = amountIn;
|
||||
|
||||
return ContractHandler.QueryDeserializingToObjectAsync<GetAmountOutFunction, GetAmountOutOutputDTO>(getAmountOutFunction, blockParameter);
|
||||
}
|
||||
|
||||
public Task<GetFeeBasisPointsOutputDTO> GetFeeBasisPointsQueryAsync(GetFeeBasisPointsFunction getFeeBasisPointsFunction, BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryDeserializingToObjectAsync<GetFeeBasisPointsFunction, GetFeeBasisPointsOutputDTO>(getFeeBasisPointsFunction, blockParameter);
|
||||
}
|
||||
|
||||
public Task<GetFeeBasisPointsOutputDTO> GetFeeBasisPointsQueryAsync(string vault, string tokenIn, string tokenOut, BigInteger amountIn, BlockParameter blockParameter = null)
|
||||
{
|
||||
var getFeeBasisPointsFunction = new GetFeeBasisPointsFunction();
|
||||
getFeeBasisPointsFunction.Vault = vault;
|
||||
getFeeBasisPointsFunction.TokenIn = tokenIn;
|
||||
getFeeBasisPointsFunction.TokenOut = tokenOut;
|
||||
getFeeBasisPointsFunction.AmountIn = amountIn;
|
||||
|
||||
return ContractHandler.QueryDeserializingToObjectAsync<GetFeeBasisPointsFunction, GetFeeBasisPointsOutputDTO>(getFeeBasisPointsFunction, blockParameter);
|
||||
}
|
||||
|
||||
public Task<List<BigInteger>> GetFeesQueryAsync(GetFeesFunction getFeesFunction, BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryAsync<GetFeesFunction, List<BigInteger>>(getFeesFunction, blockParameter);
|
||||
}
|
||||
|
||||
|
||||
public Task<List<BigInteger>> GetFeesQueryAsync(string vault, List<string> tokens, BlockParameter blockParameter = null)
|
||||
{
|
||||
var getFeesFunction = new GetFeesFunction();
|
||||
getFeesFunction.Vault = vault;
|
||||
getFeesFunction.Tokens = tokens;
|
||||
|
||||
return ContractHandler.QueryAsync<GetFeesFunction, List<BigInteger>>(getFeesFunction, blockParameter);
|
||||
}
|
||||
|
||||
public Task<List<BigInteger>> GetFullVaultTokenInfoQueryAsync(GetFullVaultTokenInfoFunction getFullVaultTokenInfoFunction, BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryAsync<GetFullVaultTokenInfoFunction, List<BigInteger>>(getFullVaultTokenInfoFunction, blockParameter);
|
||||
}
|
||||
|
||||
|
||||
public Task<List<BigInteger>> GetFullVaultTokenInfoQueryAsync(string vault, string weth, BigInteger usdgAmount, List<string> tokens, BlockParameter blockParameter = null)
|
||||
{
|
||||
var getFullVaultTokenInfoFunction = new GetFullVaultTokenInfoFunction();
|
||||
getFullVaultTokenInfoFunction.Vault = vault;
|
||||
getFullVaultTokenInfoFunction.Weth = weth;
|
||||
getFullVaultTokenInfoFunction.UsdgAmount = usdgAmount;
|
||||
getFullVaultTokenInfoFunction.Tokens = tokens;
|
||||
|
||||
return ContractHandler.QueryAsync<GetFullVaultTokenInfoFunction, List<BigInteger>>(getFullVaultTokenInfoFunction, blockParameter);
|
||||
}
|
||||
|
||||
public Task<List<BigInteger>> GetFundingRatesQueryAsync(GetFundingRatesFunction getFundingRatesFunction, BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryAsync<GetFundingRatesFunction, List<BigInteger>>(getFundingRatesFunction, blockParameter);
|
||||
}
|
||||
|
||||
|
||||
public Task<List<BigInteger>> GetFundingRatesQueryAsync(string vault, string weth, List<string> tokens, BlockParameter blockParameter = null)
|
||||
{
|
||||
var getFundingRatesFunction = new GetFundingRatesFunction();
|
||||
getFundingRatesFunction.Vault = vault;
|
||||
getFundingRatesFunction.Weth = weth;
|
||||
getFundingRatesFunction.Tokens = tokens;
|
||||
|
||||
return ContractHandler.QueryAsync<GetFundingRatesFunction, List<BigInteger>>(getFundingRatesFunction, blockParameter);
|
||||
}
|
||||
|
||||
public Task<BigInteger> GetMaxAmountInQueryAsync(GetMaxAmountInFunction getMaxAmountInFunction, BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryAsync<GetMaxAmountInFunction, BigInteger>(getMaxAmountInFunction, blockParameter);
|
||||
}
|
||||
|
||||
|
||||
public Task<BigInteger> GetMaxAmountInQueryAsync(string vault, string tokenIn, string tokenOut, BlockParameter blockParameter = null)
|
||||
{
|
||||
var getMaxAmountInFunction = new GetMaxAmountInFunction();
|
||||
getMaxAmountInFunction.Vault = vault;
|
||||
getMaxAmountInFunction.TokenIn = tokenIn;
|
||||
getMaxAmountInFunction.TokenOut = tokenOut;
|
||||
|
||||
return ContractHandler.QueryAsync<GetMaxAmountInFunction, BigInteger>(getMaxAmountInFunction, blockParameter);
|
||||
}
|
||||
|
||||
public Task<List<BigInteger>> GetPairInfoQueryAsync(GetPairInfoFunction getPairInfoFunction, BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryAsync<GetPairInfoFunction, List<BigInteger>>(getPairInfoFunction, blockParameter);
|
||||
}
|
||||
|
||||
|
||||
public Task<List<BigInteger>> GetPairInfoQueryAsync(string factory, List<string> tokens, BlockParameter blockParameter = null)
|
||||
{
|
||||
var getPairInfoFunction = new GetPairInfoFunction();
|
||||
getPairInfoFunction.Factory = factory;
|
||||
getPairInfoFunction.Tokens = tokens;
|
||||
|
||||
return ContractHandler.QueryAsync<GetPairInfoFunction, List<BigInteger>>(getPairInfoFunction, blockParameter);
|
||||
}
|
||||
|
||||
public Task<List<BigInteger>> GetPositionsQueryAsync(GetPositionsFunction getPositionsFunction, BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryAsync<GetPositionsFunction, List<BigInteger>>(getPositionsFunction, blockParameter);
|
||||
}
|
||||
|
||||
|
||||
public Task<List<BigInteger>> GetPositionsQueryAsync(string vault, string account, List<string> collateralTokens, List<string> indexTokens, List<bool> isLong, BlockParameter blockParameter = null)
|
||||
{
|
||||
var getPositionsFunction = new GetPositionsFunction();
|
||||
getPositionsFunction.Vault = vault;
|
||||
getPositionsFunction.Account = account;
|
||||
getPositionsFunction.CollateralTokens = collateralTokens;
|
||||
getPositionsFunction.IndexTokens = indexTokens;
|
||||
getPositionsFunction.IsLong = isLong;
|
||||
|
||||
return ContractHandler.QueryAsync<GetPositionsFunction, List<BigInteger>>(getPositionsFunction, blockParameter);
|
||||
}
|
||||
|
||||
public Task<List<BigInteger>> GetPricesQueryAsync(GetPricesFunction getPricesFunction, BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryAsync<GetPricesFunction, List<BigInteger>>(getPricesFunction, blockParameter);
|
||||
}
|
||||
|
||||
|
||||
public Task<List<BigInteger>> GetPricesQueryAsync(string priceFeed, List<string> tokens, BlockParameter blockParameter = null)
|
||||
{
|
||||
var getPricesFunction = new GetPricesFunction();
|
||||
getPricesFunction.PriceFeed = priceFeed;
|
||||
getPricesFunction.Tokens = tokens;
|
||||
|
||||
return ContractHandler.QueryAsync<GetPricesFunction, List<BigInteger>>(getPricesFunction, blockParameter);
|
||||
}
|
||||
|
||||
public Task<List<BigInteger>> GetStakingInfoQueryAsync(GetStakingInfoFunction getStakingInfoFunction, BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryAsync<GetStakingInfoFunction, List<BigInteger>>(getStakingInfoFunction, blockParameter);
|
||||
}
|
||||
|
||||
|
||||
public Task<List<BigInteger>> GetStakingInfoQueryAsync(string account, List<string> yieldTrackers, BlockParameter blockParameter = null)
|
||||
{
|
||||
var getStakingInfoFunction = new GetStakingInfoFunction();
|
||||
getStakingInfoFunction.Account = account;
|
||||
getStakingInfoFunction.YieldTrackers = yieldTrackers;
|
||||
|
||||
return ContractHandler.QueryAsync<GetStakingInfoFunction, List<BigInteger>>(getStakingInfoFunction, blockParameter);
|
||||
}
|
||||
|
||||
public Task<List<BigInteger>> GetTokenBalancesQueryAsync(GetTokenBalancesFunction getTokenBalancesFunction, BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryAsync<GetTokenBalancesFunction, List<BigInteger>>(getTokenBalancesFunction, blockParameter);
|
||||
}
|
||||
|
||||
|
||||
public Task<List<BigInteger>> GetTokenBalancesQueryAsync(string account, List<string> tokens, BlockParameter blockParameter = null)
|
||||
{
|
||||
var getTokenBalancesFunction = new GetTokenBalancesFunction();
|
||||
getTokenBalancesFunction.Account = account;
|
||||
getTokenBalancesFunction.Tokens = tokens;
|
||||
|
||||
return ContractHandler.QueryAsync<GetTokenBalancesFunction, List<BigInteger>>(getTokenBalancesFunction, blockParameter);
|
||||
}
|
||||
|
||||
public Task<List<BigInteger>> GetTokenBalancesWithSuppliesQueryAsync(GetTokenBalancesWithSuppliesFunction getTokenBalancesWithSuppliesFunction, BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryAsync<GetTokenBalancesWithSuppliesFunction, List<BigInteger>>(getTokenBalancesWithSuppliesFunction, blockParameter);
|
||||
}
|
||||
|
||||
|
||||
public Task<List<BigInteger>> GetTokenBalancesWithSuppliesQueryAsync(string account, List<string> tokens, BlockParameter blockParameter = null)
|
||||
{
|
||||
var getTokenBalancesWithSuppliesFunction = new GetTokenBalancesWithSuppliesFunction();
|
||||
getTokenBalancesWithSuppliesFunction.Account = account;
|
||||
getTokenBalancesWithSuppliesFunction.Tokens = tokens;
|
||||
|
||||
return ContractHandler.QueryAsync<GetTokenBalancesWithSuppliesFunction, List<BigInteger>>(getTokenBalancesWithSuppliesFunction, blockParameter);
|
||||
}
|
||||
|
||||
public Task<BigInteger> GetTokenSupplyQueryAsync(GetTokenSupplyFunction getTokenSupplyFunction, BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryAsync<GetTokenSupplyFunction, BigInteger>(getTokenSupplyFunction, blockParameter);
|
||||
}
|
||||
|
||||
|
||||
public Task<BigInteger> GetTokenSupplyQueryAsync(string token, List<string> excludedAccounts, BlockParameter blockParameter = null)
|
||||
{
|
||||
var getTokenSupplyFunction = new GetTokenSupplyFunction();
|
||||
getTokenSupplyFunction.Token = token;
|
||||
getTokenSupplyFunction.ExcludedAccounts = excludedAccounts;
|
||||
|
||||
return ContractHandler.QueryAsync<GetTokenSupplyFunction, BigInteger>(getTokenSupplyFunction, blockParameter);
|
||||
}
|
||||
|
||||
public Task<BigInteger> GetTotalBalanceQueryAsync(GetTotalBalanceFunction getTotalBalanceFunction, BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryAsync<GetTotalBalanceFunction, BigInteger>(getTotalBalanceFunction, blockParameter);
|
||||
}
|
||||
|
||||
|
||||
public Task<BigInteger> GetTotalBalanceQueryAsync(string token, List<string> accounts, BlockParameter blockParameter = null)
|
||||
{
|
||||
var getTotalBalanceFunction = new GetTotalBalanceFunction();
|
||||
getTotalBalanceFunction.Token = token;
|
||||
getTotalBalanceFunction.Accounts = accounts;
|
||||
|
||||
return ContractHandler.QueryAsync<GetTotalBalanceFunction, BigInteger>(getTotalBalanceFunction, blockParameter);
|
||||
}
|
||||
|
||||
public Task<List<BigInteger>> GetTotalStakedQueryAsync(GetTotalStakedFunction getTotalStakedFunction, BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryAsync<GetTotalStakedFunction, List<BigInteger>>(getTotalStakedFunction, blockParameter);
|
||||
}
|
||||
|
||||
|
||||
public Task<List<BigInteger>> GetTotalStakedQueryAsync(List<string> yieldTokens, BlockParameter blockParameter = null)
|
||||
{
|
||||
var getTotalStakedFunction = new GetTotalStakedFunction();
|
||||
getTotalStakedFunction.YieldTokens = yieldTokens;
|
||||
|
||||
return ContractHandler.QueryAsync<GetTotalStakedFunction, List<BigInteger>>(getTotalStakedFunction, blockParameter);
|
||||
}
|
||||
|
||||
public Task<List<BigInteger>> GetVaultTokenInfoQueryAsync(GetVaultTokenInfoFunction getVaultTokenInfoFunction, BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryAsync<GetVaultTokenInfoFunction, List<BigInteger>>(getVaultTokenInfoFunction, blockParameter);
|
||||
}
|
||||
|
||||
|
||||
public Task<List<BigInteger>> GetVaultTokenInfoQueryAsync(string vault, string weth, BigInteger usdgAmount, List<string> tokens, BlockParameter blockParameter = null)
|
||||
{
|
||||
var getVaultTokenInfoFunction = new GetVaultTokenInfoFunction();
|
||||
getVaultTokenInfoFunction.Vault = vault;
|
||||
getVaultTokenInfoFunction.Weth = weth;
|
||||
getVaultTokenInfoFunction.UsdgAmount = usdgAmount;
|
||||
getVaultTokenInfoFunction.Tokens = tokens;
|
||||
|
||||
return ContractHandler.QueryAsync<GetVaultTokenInfoFunction, List<BigInteger>>(getVaultTokenInfoFunction, blockParameter);
|
||||
}
|
||||
|
||||
public Task<List<BigInteger>> GetVaultTokenInfoV2QueryAsync(GetVaultTokenInfoV2Function getVaultTokenInfoV2Function, BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryAsync<GetVaultTokenInfoV2Function, List<BigInteger>>(getVaultTokenInfoV2Function, blockParameter);
|
||||
}
|
||||
|
||||
|
||||
public Task<List<BigInteger>> GetVaultTokenInfoV2QueryAsync(string vault, string weth, BigInteger usdgAmount, List<string> tokens, BlockParameter blockParameter = null)
|
||||
{
|
||||
var getVaultTokenInfoV2Function = new GetVaultTokenInfoV2Function();
|
||||
getVaultTokenInfoV2Function.Vault = vault;
|
||||
getVaultTokenInfoV2Function.Weth = weth;
|
||||
getVaultTokenInfoV2Function.UsdgAmount = usdgAmount;
|
||||
getVaultTokenInfoV2Function.Tokens = tokens;
|
||||
|
||||
return ContractHandler.QueryAsync<GetVaultTokenInfoV2Function, List<BigInteger>>(getVaultTokenInfoV2Function, blockParameter);
|
||||
}
|
||||
|
||||
public Task<List<BigInteger>> GetVestingInfoQueryAsync(GetVestingInfoFunction getVestingInfoFunction, BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryAsync<GetVestingInfoFunction, List<BigInteger>>(getVestingInfoFunction, blockParameter);
|
||||
}
|
||||
|
||||
|
||||
public Task<List<BigInteger>> GetVestingInfoQueryAsync(string account, List<string> vesters, BlockParameter blockParameter = null)
|
||||
{
|
||||
var getVestingInfoFunction = new GetVestingInfoFunction();
|
||||
getVestingInfoFunction.Account = account;
|
||||
getVestingInfoFunction.Vesters = vesters;
|
||||
|
||||
return ContractHandler.QueryAsync<GetVestingInfoFunction, List<BigInteger>>(getVestingInfoFunction, blockParameter);
|
||||
}
|
||||
|
||||
public Task<string> GovQueryAsync(GovFunction govFunction, BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryAsync<GovFunction, string>(govFunction, blockParameter);
|
||||
}
|
||||
|
||||
|
||||
public Task<string> GovQueryAsync(BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryAsync<GovFunction, string>(null, blockParameter);
|
||||
}
|
||||
|
||||
public Task<bool> HasMaxGlobalShortSizesQueryAsync(HasMaxGlobalShortSizesFunction hasMaxGlobalShortSizesFunction, BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryAsync<HasMaxGlobalShortSizesFunction, bool>(hasMaxGlobalShortSizesFunction, blockParameter);
|
||||
}
|
||||
|
||||
|
||||
public Task<bool> HasMaxGlobalShortSizesQueryAsync(BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryAsync<HasMaxGlobalShortSizesFunction, bool>(null, blockParameter);
|
||||
}
|
||||
|
||||
public Task<string> SetConfigRequestAsync(SetConfigFunction setConfigFunction)
|
||||
{
|
||||
return ContractHandler.SendRequestAsync(setConfigFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> SetConfigRequestAndWaitForReceiptAsync(SetConfigFunction setConfigFunction, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(setConfigFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<string> SetConfigRequestAsync(bool hasMaxGlobalShortSizes)
|
||||
{
|
||||
var setConfigFunction = new SetConfigFunction();
|
||||
setConfigFunction.HasMaxGlobalShortSizes = hasMaxGlobalShortSizes;
|
||||
|
||||
return ContractHandler.SendRequestAsync(setConfigFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> SetConfigRequestAndWaitForReceiptAsync(bool hasMaxGlobalShortSizes, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
var setConfigFunction = new SetConfigFunction();
|
||||
setConfigFunction.HasMaxGlobalShortSizes = hasMaxGlobalShortSizes;
|
||||
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(setConfigFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<string> SetGovRequestAsync(SetGovFunction setGovFunction)
|
||||
{
|
||||
return ContractHandler.SendRequestAsync(setGovFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> SetGovRequestAndWaitForReceiptAsync(SetGovFunction setGovFunction, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(setGovFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<string> SetGovRequestAsync(string gov)
|
||||
{
|
||||
var setGovFunction = new SetGovFunction();
|
||||
setGovFunction.Gov = gov;
|
||||
|
||||
return ContractHandler.SendRequestAsync(setGovFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> SetGovRequestAndWaitForReceiptAsync(string gov, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
var setGovFunction = new SetGovFunction();
|
||||
setGovFunction.Gov = gov;
|
||||
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(setGovFunction, cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
702
src/Managing.Tools.ABI/Router/RouterService.cs
Normal file
702
src/Managing.Tools.ABI/Router/RouterService.cs
Normal file
@@ -0,0 +1,702 @@
|
||||
using System.Numerics;
|
||||
using Nethereum.Web3;
|
||||
using Nethereum.RPC.Eth.DTOs;
|
||||
using Nethereum.Contracts.ContractHandlers;
|
||||
using Managing.Tools.Router.ContractDefinition;
|
||||
|
||||
namespace Managing.Tools.Router
|
||||
{
|
||||
public partial class RouterService
|
||||
{
|
||||
public static Task<TransactionReceipt> DeployContractAndWaitForReceiptAsync(Web3 web3, RouterDeployment routerDeployment, CancellationTokenSource cancellationTokenSource = null)
|
||||
{
|
||||
return web3.Eth.GetContractDeploymentHandler<RouterDeployment>().SendRequestAndWaitForReceiptAsync(routerDeployment, cancellationTokenSource);
|
||||
}
|
||||
|
||||
public static Task<string> DeployContractAsync(Web3 web3, RouterDeployment routerDeployment)
|
||||
{
|
||||
return web3.Eth.GetContractDeploymentHandler<RouterDeployment>().SendRequestAsync(routerDeployment);
|
||||
}
|
||||
|
||||
public static async Task<RouterService> DeployContractAndGetServiceAsync(Web3 web3, RouterDeployment routerDeployment, CancellationTokenSource cancellationTokenSource = null)
|
||||
{
|
||||
var receipt = await DeployContractAndWaitForReceiptAsync(web3, routerDeployment, cancellationTokenSource);
|
||||
return new RouterService(web3, receipt.ContractAddress);
|
||||
}
|
||||
|
||||
protected IWeb3 Web3 { get; }
|
||||
|
||||
public ContractHandler ContractHandler { get; }
|
||||
|
||||
public RouterService(Web3 web3, string contractAddress)
|
||||
{
|
||||
Web3 = web3;
|
||||
ContractHandler = web3.Eth.GetContractHandler(contractAddress);
|
||||
}
|
||||
|
||||
public RouterService(IWeb3 web3, string contractAddress)
|
||||
{
|
||||
Web3 = web3;
|
||||
ContractHandler = web3.Eth.GetContractHandler(contractAddress);
|
||||
}
|
||||
|
||||
public Task<string> AddPluginRequestAsync(AddPluginFunction addPluginFunction)
|
||||
{
|
||||
return ContractHandler.SendRequestAsync(addPluginFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> AddPluginRequestAndWaitForReceiptAsync(AddPluginFunction addPluginFunction, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(addPluginFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<string> AddPluginRequestAsync(string plugin)
|
||||
{
|
||||
var addPluginFunction = new AddPluginFunction();
|
||||
addPluginFunction.Plugin = plugin;
|
||||
|
||||
return ContractHandler.SendRequestAsync(addPluginFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> AddPluginRequestAndWaitForReceiptAsync(string plugin, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
var addPluginFunction = new AddPluginFunction();
|
||||
addPluginFunction.Plugin = plugin;
|
||||
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(addPluginFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<string> ApprovePluginRequestAsync(ApprovePluginFunction approvePluginFunction)
|
||||
{
|
||||
return ContractHandler.SendRequestAsync(approvePluginFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> ApprovePluginRequestAndWaitForReceiptAsync(ApprovePluginFunction approvePluginFunction, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(approvePluginFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<string> ApprovePluginRequestAsync(string plugin)
|
||||
{
|
||||
var approvePluginFunction = new ApprovePluginFunction();
|
||||
approvePluginFunction.Plugin = plugin;
|
||||
|
||||
return ContractHandler.SendRequestAsync(approvePluginFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> ApprovePluginRequestAndWaitForReceiptAsync(string plugin, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
var approvePluginFunction = new ApprovePluginFunction();
|
||||
approvePluginFunction.Plugin = plugin;
|
||||
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(approvePluginFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<bool> ApprovedPluginsQueryAsync(ApprovedPluginsFunction approvedPluginsFunction, BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryAsync<ApprovedPluginsFunction, bool>(approvedPluginsFunction, blockParameter);
|
||||
}
|
||||
|
||||
|
||||
public Task<bool> ApprovedPluginsQueryAsync(string returnValue1, string returnValue2, BlockParameter blockParameter = null)
|
||||
{
|
||||
var approvedPluginsFunction = new ApprovedPluginsFunction();
|
||||
approvedPluginsFunction.ReturnValue1 = returnValue1;
|
||||
approvedPluginsFunction.ReturnValue2 = returnValue2;
|
||||
|
||||
return ContractHandler.QueryAsync<ApprovedPluginsFunction, bool>(approvedPluginsFunction, blockParameter);
|
||||
}
|
||||
|
||||
public Task<string> DecreasePositionRequestAsync(DecreasePositionFunction decreasePositionFunction)
|
||||
{
|
||||
return ContractHandler.SendRequestAsync(decreasePositionFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> DecreasePositionRequestAndWaitForReceiptAsync(DecreasePositionFunction decreasePositionFunction, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(decreasePositionFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<string> DecreasePositionRequestAsync(string collateralToken, string indexToken, BigInteger collateralDelta, BigInteger sizeDelta, bool isLong, string receiver, BigInteger price)
|
||||
{
|
||||
var decreasePositionFunction = new DecreasePositionFunction();
|
||||
decreasePositionFunction.CollateralToken = collateralToken;
|
||||
decreasePositionFunction.IndexToken = indexToken;
|
||||
decreasePositionFunction.CollateralDelta = collateralDelta;
|
||||
decreasePositionFunction.SizeDelta = sizeDelta;
|
||||
decreasePositionFunction.IsLong = isLong;
|
||||
decreasePositionFunction.Receiver = receiver;
|
||||
decreasePositionFunction.Price = price;
|
||||
|
||||
return ContractHandler.SendRequestAsync(decreasePositionFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> DecreasePositionRequestAndWaitForReceiptAsync(string collateralToken, string indexToken, BigInteger collateralDelta, BigInteger sizeDelta, bool isLong, string receiver, BigInteger price, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
var decreasePositionFunction = new DecreasePositionFunction();
|
||||
decreasePositionFunction.CollateralToken = collateralToken;
|
||||
decreasePositionFunction.IndexToken = indexToken;
|
||||
decreasePositionFunction.CollateralDelta = collateralDelta;
|
||||
decreasePositionFunction.SizeDelta = sizeDelta;
|
||||
decreasePositionFunction.IsLong = isLong;
|
||||
decreasePositionFunction.Receiver = receiver;
|
||||
decreasePositionFunction.Price = price;
|
||||
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(decreasePositionFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<string> DecreasePositionAndSwapRequestAsync(DecreasePositionAndSwapFunction decreasePositionAndSwapFunction)
|
||||
{
|
||||
return ContractHandler.SendRequestAsync(decreasePositionAndSwapFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> DecreasePositionAndSwapRequestAndWaitForReceiptAsync(DecreasePositionAndSwapFunction decreasePositionAndSwapFunction, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(decreasePositionAndSwapFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<string> DecreasePositionAndSwapRequestAsync(List<string> path, string indexToken, BigInteger collateralDelta, BigInteger sizeDelta, bool isLong, string receiver, BigInteger price, BigInteger minOut)
|
||||
{
|
||||
var decreasePositionAndSwapFunction = new DecreasePositionAndSwapFunction();
|
||||
decreasePositionAndSwapFunction.Path = path;
|
||||
decreasePositionAndSwapFunction.IndexToken = indexToken;
|
||||
decreasePositionAndSwapFunction.CollateralDelta = collateralDelta;
|
||||
decreasePositionAndSwapFunction.SizeDelta = sizeDelta;
|
||||
decreasePositionAndSwapFunction.IsLong = isLong;
|
||||
decreasePositionAndSwapFunction.Receiver = receiver;
|
||||
decreasePositionAndSwapFunction.Price = price;
|
||||
decreasePositionAndSwapFunction.MinOut = minOut;
|
||||
|
||||
return ContractHandler.SendRequestAsync(decreasePositionAndSwapFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> DecreasePositionAndSwapRequestAndWaitForReceiptAsync(List<string> path, string indexToken, BigInteger collateralDelta, BigInteger sizeDelta, bool isLong, string receiver, BigInteger price, BigInteger minOut, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
var decreasePositionAndSwapFunction = new DecreasePositionAndSwapFunction();
|
||||
decreasePositionAndSwapFunction.Path = path;
|
||||
decreasePositionAndSwapFunction.IndexToken = indexToken;
|
||||
decreasePositionAndSwapFunction.CollateralDelta = collateralDelta;
|
||||
decreasePositionAndSwapFunction.SizeDelta = sizeDelta;
|
||||
decreasePositionAndSwapFunction.IsLong = isLong;
|
||||
decreasePositionAndSwapFunction.Receiver = receiver;
|
||||
decreasePositionAndSwapFunction.Price = price;
|
||||
decreasePositionAndSwapFunction.MinOut = minOut;
|
||||
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(decreasePositionAndSwapFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<string> DecreasePositionAndSwapETHRequestAsync(DecreasePositionAndSwapETHFunction decreasePositionAndSwapETHFunction)
|
||||
{
|
||||
return ContractHandler.SendRequestAsync(decreasePositionAndSwapETHFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> DecreasePositionAndSwapETHRequestAndWaitForReceiptAsync(DecreasePositionAndSwapETHFunction decreasePositionAndSwapETHFunction, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(decreasePositionAndSwapETHFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<string> DecreasePositionAndSwapETHRequestAsync(List<string> path, string indexToken, BigInteger collateralDelta, BigInteger sizeDelta, bool isLong, string receiver, BigInteger price, BigInteger minOut)
|
||||
{
|
||||
var decreasePositionAndSwapETHFunction = new DecreasePositionAndSwapETHFunction();
|
||||
decreasePositionAndSwapETHFunction.Path = path;
|
||||
decreasePositionAndSwapETHFunction.IndexToken = indexToken;
|
||||
decreasePositionAndSwapETHFunction.CollateralDelta = collateralDelta;
|
||||
decreasePositionAndSwapETHFunction.SizeDelta = sizeDelta;
|
||||
decreasePositionAndSwapETHFunction.IsLong = isLong;
|
||||
decreasePositionAndSwapETHFunction.Receiver = receiver;
|
||||
decreasePositionAndSwapETHFunction.Price = price;
|
||||
decreasePositionAndSwapETHFunction.MinOut = minOut;
|
||||
|
||||
return ContractHandler.SendRequestAsync(decreasePositionAndSwapETHFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> DecreasePositionAndSwapETHRequestAndWaitForReceiptAsync(List<string> path, string indexToken, BigInteger collateralDelta, BigInteger sizeDelta, bool isLong, string receiver, BigInteger price, BigInteger minOut, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
var decreasePositionAndSwapETHFunction = new DecreasePositionAndSwapETHFunction();
|
||||
decreasePositionAndSwapETHFunction.Path = path;
|
||||
decreasePositionAndSwapETHFunction.IndexToken = indexToken;
|
||||
decreasePositionAndSwapETHFunction.CollateralDelta = collateralDelta;
|
||||
decreasePositionAndSwapETHFunction.SizeDelta = sizeDelta;
|
||||
decreasePositionAndSwapETHFunction.IsLong = isLong;
|
||||
decreasePositionAndSwapETHFunction.Receiver = receiver;
|
||||
decreasePositionAndSwapETHFunction.Price = price;
|
||||
decreasePositionAndSwapETHFunction.MinOut = minOut;
|
||||
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(decreasePositionAndSwapETHFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<string> DecreasePositionETHRequestAsync(DecreasePositionETHFunction decreasePositionETHFunction)
|
||||
{
|
||||
return ContractHandler.SendRequestAsync(decreasePositionETHFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> DecreasePositionETHRequestAndWaitForReceiptAsync(DecreasePositionETHFunction decreasePositionETHFunction, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(decreasePositionETHFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<string> DecreasePositionETHRequestAsync(string collateralToken, string indexToken, BigInteger collateralDelta, BigInteger sizeDelta, bool isLong, string receiver, BigInteger price)
|
||||
{
|
||||
var decreasePositionETHFunction = new DecreasePositionETHFunction();
|
||||
decreasePositionETHFunction.CollateralToken = collateralToken;
|
||||
decreasePositionETHFunction.IndexToken = indexToken;
|
||||
decreasePositionETHFunction.CollateralDelta = collateralDelta;
|
||||
decreasePositionETHFunction.SizeDelta = sizeDelta;
|
||||
decreasePositionETHFunction.IsLong = isLong;
|
||||
decreasePositionETHFunction.Receiver = receiver;
|
||||
decreasePositionETHFunction.Price = price;
|
||||
|
||||
return ContractHandler.SendRequestAsync(decreasePositionETHFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> DecreasePositionETHRequestAndWaitForReceiptAsync(string collateralToken, string indexToken, BigInteger collateralDelta, BigInteger sizeDelta, bool isLong, string receiver, BigInteger price, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
var decreasePositionETHFunction = new DecreasePositionETHFunction();
|
||||
decreasePositionETHFunction.CollateralToken = collateralToken;
|
||||
decreasePositionETHFunction.IndexToken = indexToken;
|
||||
decreasePositionETHFunction.CollateralDelta = collateralDelta;
|
||||
decreasePositionETHFunction.SizeDelta = sizeDelta;
|
||||
decreasePositionETHFunction.IsLong = isLong;
|
||||
decreasePositionETHFunction.Receiver = receiver;
|
||||
decreasePositionETHFunction.Price = price;
|
||||
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(decreasePositionETHFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<string> DenyPluginRequestAsync(DenyPluginFunction denyPluginFunction)
|
||||
{
|
||||
return ContractHandler.SendRequestAsync(denyPluginFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> DenyPluginRequestAndWaitForReceiptAsync(DenyPluginFunction denyPluginFunction, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(denyPluginFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<string> DenyPluginRequestAsync(string plugin)
|
||||
{
|
||||
var denyPluginFunction = new DenyPluginFunction();
|
||||
denyPluginFunction.Plugin = plugin;
|
||||
|
||||
return ContractHandler.SendRequestAsync(denyPluginFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> DenyPluginRequestAndWaitForReceiptAsync(string plugin, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
var denyPluginFunction = new DenyPluginFunction();
|
||||
denyPluginFunction.Plugin = plugin;
|
||||
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(denyPluginFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<string> DirectPoolDepositRequestAsync(DirectPoolDepositFunction directPoolDepositFunction)
|
||||
{
|
||||
return ContractHandler.SendRequestAsync(directPoolDepositFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> DirectPoolDepositRequestAndWaitForReceiptAsync(DirectPoolDepositFunction directPoolDepositFunction, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(directPoolDepositFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<string> DirectPoolDepositRequestAsync(string token, BigInteger amount)
|
||||
{
|
||||
var directPoolDepositFunction = new DirectPoolDepositFunction();
|
||||
directPoolDepositFunction.Token = token;
|
||||
directPoolDepositFunction.Amount = amount;
|
||||
|
||||
return ContractHandler.SendRequestAsync(directPoolDepositFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> DirectPoolDepositRequestAndWaitForReceiptAsync(string token, BigInteger amount, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
var directPoolDepositFunction = new DirectPoolDepositFunction();
|
||||
directPoolDepositFunction.Token = token;
|
||||
directPoolDepositFunction.Amount = amount;
|
||||
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(directPoolDepositFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<string> GovQueryAsync(GovFunction govFunction, BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryAsync<GovFunction, string>(govFunction, blockParameter);
|
||||
}
|
||||
|
||||
|
||||
public Task<string> GovQueryAsync(BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryAsync<GovFunction, string>(null, blockParameter);
|
||||
}
|
||||
|
||||
public Task<string> IncreasePositionRequestAsync(IncreasePositionFunction increasePositionFunction)
|
||||
{
|
||||
return ContractHandler.SendRequestAsync(increasePositionFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> IncreasePositionRequestAndWaitForReceiptAsync(IncreasePositionFunction increasePositionFunction, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(increasePositionFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<string> IncreasePositionRequestAsync(List<string> path, string indexToken, BigInteger amountIn, BigInteger minOut, BigInteger sizeDelta, bool isLong, BigInteger price)
|
||||
{
|
||||
var increasePositionFunction = new IncreasePositionFunction();
|
||||
increasePositionFunction.Path = path;
|
||||
increasePositionFunction.IndexToken = indexToken;
|
||||
increasePositionFunction.AmountIn = amountIn;
|
||||
increasePositionFunction.MinOut = minOut;
|
||||
increasePositionFunction.SizeDelta = sizeDelta;
|
||||
increasePositionFunction.IsLong = isLong;
|
||||
increasePositionFunction.Price = price;
|
||||
|
||||
return ContractHandler.SendRequestAsync(increasePositionFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> IncreasePositionRequestAndWaitForReceiptAsync(List<string> path, string indexToken, BigInteger amountIn, BigInteger minOut, BigInteger sizeDelta, bool isLong, BigInteger price, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
var increasePositionFunction = new IncreasePositionFunction();
|
||||
increasePositionFunction.Path = path;
|
||||
increasePositionFunction.IndexToken = indexToken;
|
||||
increasePositionFunction.AmountIn = amountIn;
|
||||
increasePositionFunction.MinOut = minOut;
|
||||
increasePositionFunction.SizeDelta = sizeDelta;
|
||||
increasePositionFunction.IsLong = isLong;
|
||||
increasePositionFunction.Price = price;
|
||||
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(increasePositionFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<string> IncreasePositionETHRequestAsync(IncreasePositionETHFunction increasePositionETHFunction)
|
||||
{
|
||||
return ContractHandler.SendRequestAsync(increasePositionETHFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> IncreasePositionETHRequestAndWaitForReceiptAsync(IncreasePositionETHFunction increasePositionETHFunction, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(increasePositionETHFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<string> IncreasePositionETHRequestAsync(List<string> path, string indexToken, BigInteger minOut, BigInteger sizeDelta, bool isLong, BigInteger price)
|
||||
{
|
||||
var increasePositionETHFunction = new IncreasePositionETHFunction();
|
||||
increasePositionETHFunction.Path = path;
|
||||
increasePositionETHFunction.IndexToken = indexToken;
|
||||
increasePositionETHFunction.MinOut = minOut;
|
||||
increasePositionETHFunction.SizeDelta = sizeDelta;
|
||||
increasePositionETHFunction.IsLong = isLong;
|
||||
increasePositionETHFunction.Price = price;
|
||||
|
||||
return ContractHandler.SendRequestAsync(increasePositionETHFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> IncreasePositionETHRequestAndWaitForReceiptAsync(List<string> path, string indexToken, BigInteger minOut, BigInteger sizeDelta, bool isLong, BigInteger price, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
var increasePositionETHFunction = new IncreasePositionETHFunction();
|
||||
increasePositionETHFunction.Path = path;
|
||||
increasePositionETHFunction.IndexToken = indexToken;
|
||||
increasePositionETHFunction.MinOut = minOut;
|
||||
increasePositionETHFunction.SizeDelta = sizeDelta;
|
||||
increasePositionETHFunction.IsLong = isLong;
|
||||
increasePositionETHFunction.Price = price;
|
||||
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(increasePositionETHFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<string> PluginDecreasePositionRequestAsync(PluginDecreasePositionFunction pluginDecreasePositionFunction)
|
||||
{
|
||||
return ContractHandler.SendRequestAsync(pluginDecreasePositionFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> PluginDecreasePositionRequestAndWaitForReceiptAsync(PluginDecreasePositionFunction pluginDecreasePositionFunction, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(pluginDecreasePositionFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<string> PluginDecreasePositionRequestAsync(string account, string collateralToken, string indexToken, BigInteger collateralDelta, BigInteger sizeDelta, bool isLong, string receiver)
|
||||
{
|
||||
var pluginDecreasePositionFunction = new PluginDecreasePositionFunction();
|
||||
pluginDecreasePositionFunction.Account = account;
|
||||
pluginDecreasePositionFunction.CollateralToken = collateralToken;
|
||||
pluginDecreasePositionFunction.IndexToken = indexToken;
|
||||
pluginDecreasePositionFunction.CollateralDelta = collateralDelta;
|
||||
pluginDecreasePositionFunction.SizeDelta = sizeDelta;
|
||||
pluginDecreasePositionFunction.IsLong = isLong;
|
||||
pluginDecreasePositionFunction.Receiver = receiver;
|
||||
|
||||
return ContractHandler.SendRequestAsync(pluginDecreasePositionFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> PluginDecreasePositionRequestAndWaitForReceiptAsync(string account, string collateralToken, string indexToken, BigInteger collateralDelta, BigInteger sizeDelta, bool isLong, string receiver, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
var pluginDecreasePositionFunction = new PluginDecreasePositionFunction();
|
||||
pluginDecreasePositionFunction.Account = account;
|
||||
pluginDecreasePositionFunction.CollateralToken = collateralToken;
|
||||
pluginDecreasePositionFunction.IndexToken = indexToken;
|
||||
pluginDecreasePositionFunction.CollateralDelta = collateralDelta;
|
||||
pluginDecreasePositionFunction.SizeDelta = sizeDelta;
|
||||
pluginDecreasePositionFunction.IsLong = isLong;
|
||||
pluginDecreasePositionFunction.Receiver = receiver;
|
||||
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(pluginDecreasePositionFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<string> PluginIncreasePositionRequestAsync(PluginIncreasePositionFunction pluginIncreasePositionFunction)
|
||||
{
|
||||
return ContractHandler.SendRequestAsync(pluginIncreasePositionFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> PluginIncreasePositionRequestAndWaitForReceiptAsync(PluginIncreasePositionFunction pluginIncreasePositionFunction, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(pluginIncreasePositionFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<string> PluginIncreasePositionRequestAsync(string account, string collateralToken, string indexToken, BigInteger sizeDelta, bool isLong)
|
||||
{
|
||||
var pluginIncreasePositionFunction = new PluginIncreasePositionFunction();
|
||||
pluginIncreasePositionFunction.Account = account;
|
||||
pluginIncreasePositionFunction.CollateralToken = collateralToken;
|
||||
pluginIncreasePositionFunction.IndexToken = indexToken;
|
||||
pluginIncreasePositionFunction.SizeDelta = sizeDelta;
|
||||
pluginIncreasePositionFunction.IsLong = isLong;
|
||||
|
||||
return ContractHandler.SendRequestAsync(pluginIncreasePositionFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> PluginIncreasePositionRequestAndWaitForReceiptAsync(string account, string collateralToken, string indexToken, BigInteger sizeDelta, bool isLong, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
var pluginIncreasePositionFunction = new PluginIncreasePositionFunction();
|
||||
pluginIncreasePositionFunction.Account = account;
|
||||
pluginIncreasePositionFunction.CollateralToken = collateralToken;
|
||||
pluginIncreasePositionFunction.IndexToken = indexToken;
|
||||
pluginIncreasePositionFunction.SizeDelta = sizeDelta;
|
||||
pluginIncreasePositionFunction.IsLong = isLong;
|
||||
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(pluginIncreasePositionFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<string> PluginTransferRequestAsync(PluginTransferFunction pluginTransferFunction)
|
||||
{
|
||||
return ContractHandler.SendRequestAsync(pluginTransferFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> PluginTransferRequestAndWaitForReceiptAsync(PluginTransferFunction pluginTransferFunction, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(pluginTransferFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<string> PluginTransferRequestAsync(string token, string account, string receiver, BigInteger amount)
|
||||
{
|
||||
var pluginTransferFunction = new PluginTransferFunction();
|
||||
pluginTransferFunction.Token = token;
|
||||
pluginTransferFunction.Account = account;
|
||||
pluginTransferFunction.Receiver = receiver;
|
||||
pluginTransferFunction.Amount = amount;
|
||||
|
||||
return ContractHandler.SendRequestAsync(pluginTransferFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> PluginTransferRequestAndWaitForReceiptAsync(string token, string account, string receiver, BigInteger amount, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
var pluginTransferFunction = new PluginTransferFunction();
|
||||
pluginTransferFunction.Token = token;
|
||||
pluginTransferFunction.Account = account;
|
||||
pluginTransferFunction.Receiver = receiver;
|
||||
pluginTransferFunction.Amount = amount;
|
||||
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(pluginTransferFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<bool> PluginsQueryAsync(PluginsFunction pluginsFunction, BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryAsync<PluginsFunction, bool>(pluginsFunction, blockParameter);
|
||||
}
|
||||
|
||||
|
||||
public Task<bool> PluginsQueryAsync(string returnValue1, BlockParameter blockParameter = null)
|
||||
{
|
||||
var pluginsFunction = new PluginsFunction();
|
||||
pluginsFunction.ReturnValue1 = returnValue1;
|
||||
|
||||
return ContractHandler.QueryAsync<PluginsFunction, bool>(pluginsFunction, blockParameter);
|
||||
}
|
||||
|
||||
public Task<string> RemovePluginRequestAsync(RemovePluginFunction removePluginFunction)
|
||||
{
|
||||
return ContractHandler.SendRequestAsync(removePluginFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> RemovePluginRequestAndWaitForReceiptAsync(RemovePluginFunction removePluginFunction, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(removePluginFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<string> RemovePluginRequestAsync(string plugin)
|
||||
{
|
||||
var removePluginFunction = new RemovePluginFunction();
|
||||
removePluginFunction.Plugin = plugin;
|
||||
|
||||
return ContractHandler.SendRequestAsync(removePluginFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> RemovePluginRequestAndWaitForReceiptAsync(string plugin, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
var removePluginFunction = new RemovePluginFunction();
|
||||
removePluginFunction.Plugin = plugin;
|
||||
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(removePluginFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<string> SetGovRequestAsync(SetGovFunction setGovFunction)
|
||||
{
|
||||
return ContractHandler.SendRequestAsync(setGovFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> SetGovRequestAndWaitForReceiptAsync(SetGovFunction setGovFunction, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(setGovFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<string> SetGovRequestAsync(string gov)
|
||||
{
|
||||
var setGovFunction = new SetGovFunction();
|
||||
setGovFunction.Gov = gov;
|
||||
|
||||
return ContractHandler.SendRequestAsync(setGovFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> SetGovRequestAndWaitForReceiptAsync(string gov, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
var setGovFunction = new SetGovFunction();
|
||||
setGovFunction.Gov = gov;
|
||||
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(setGovFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<string> SwapRequestAsync(SwapFunction swapFunction)
|
||||
{
|
||||
return ContractHandler.SendRequestAsync(swapFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> SwapRequestAndWaitForReceiptAsync(SwapFunction swapFunction, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(swapFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<string> SwapRequestAsync(List<string> path, BigInteger amountIn, BigInteger minOut, string receiver)
|
||||
{
|
||||
var swapFunction = new SwapFunction();
|
||||
swapFunction.Path = path;
|
||||
swapFunction.AmountIn = amountIn;
|
||||
swapFunction.MinOut = minOut;
|
||||
swapFunction.Receiver = receiver;
|
||||
|
||||
return ContractHandler.SendRequestAsync(swapFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> SwapRequestAndWaitForReceiptAsync(List<string> path, BigInteger amountIn, BigInteger minOut, string receiver, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
var swapFunction = new SwapFunction();
|
||||
swapFunction.Path = path;
|
||||
swapFunction.AmountIn = amountIn;
|
||||
swapFunction.MinOut = minOut;
|
||||
swapFunction.Receiver = receiver;
|
||||
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(swapFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<string> SwapETHToTokensRequestAsync(SwapETHToTokensFunction swapETHToTokensFunction)
|
||||
{
|
||||
return ContractHandler.SendRequestAsync(swapETHToTokensFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> SwapETHToTokensRequestAndWaitForReceiptAsync(SwapETHToTokensFunction swapETHToTokensFunction, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(swapETHToTokensFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<string> SwapETHToTokensRequestAsync(List<string> path, BigInteger minOut, string receiver)
|
||||
{
|
||||
var swapETHToTokensFunction = new SwapETHToTokensFunction();
|
||||
swapETHToTokensFunction.Path = path;
|
||||
swapETHToTokensFunction.MinOut = minOut;
|
||||
swapETHToTokensFunction.Receiver = receiver;
|
||||
|
||||
return ContractHandler.SendRequestAsync(swapETHToTokensFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> SwapETHToTokensRequestAndWaitForReceiptAsync(List<string> path, BigInteger minOut, string receiver, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
var swapETHToTokensFunction = new SwapETHToTokensFunction();
|
||||
swapETHToTokensFunction.Path = path;
|
||||
swapETHToTokensFunction.MinOut = minOut;
|
||||
swapETHToTokensFunction.Receiver = receiver;
|
||||
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(swapETHToTokensFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<string> SwapTokensToETHRequestAsync(SwapTokensToETHFunction swapTokensToETHFunction)
|
||||
{
|
||||
return ContractHandler.SendRequestAsync(swapTokensToETHFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> SwapTokensToETHRequestAndWaitForReceiptAsync(SwapTokensToETHFunction swapTokensToETHFunction, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(swapTokensToETHFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<string> SwapTokensToETHRequestAsync(List<string> path, BigInteger amountIn, BigInteger minOut, string receiver)
|
||||
{
|
||||
var swapTokensToETHFunction = new SwapTokensToETHFunction();
|
||||
swapTokensToETHFunction.Path = path;
|
||||
swapTokensToETHFunction.AmountIn = amountIn;
|
||||
swapTokensToETHFunction.MinOut = minOut;
|
||||
swapTokensToETHFunction.Receiver = receiver;
|
||||
|
||||
return ContractHandler.SendRequestAsync(swapTokensToETHFunction);
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> SwapTokensToETHRequestAndWaitForReceiptAsync(List<string> path, BigInteger amountIn, BigInteger minOut, string receiver, CancellationTokenSource cancellationToken = null)
|
||||
{
|
||||
var swapTokensToETHFunction = new SwapTokensToETHFunction();
|
||||
swapTokensToETHFunction.Path = path;
|
||||
swapTokensToETHFunction.AmountIn = amountIn;
|
||||
swapTokensToETHFunction.MinOut = minOut;
|
||||
swapTokensToETHFunction.Receiver = receiver;
|
||||
|
||||
return ContractHandler.SendRequestAndWaitForReceiptAsync(swapTokensToETHFunction, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<string> UsdgQueryAsync(UsdgFunction usdgFunction, BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryAsync<UsdgFunction, string>(usdgFunction, blockParameter);
|
||||
}
|
||||
|
||||
|
||||
public Task<string> UsdgQueryAsync(BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryAsync<UsdgFunction, string>(null, blockParameter);
|
||||
}
|
||||
|
||||
public Task<string> VaultQueryAsync(VaultFunction vaultFunction, BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryAsync<VaultFunction, string>(vaultFunction, blockParameter);
|
||||
}
|
||||
|
||||
|
||||
public Task<string> VaultQueryAsync(BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryAsync<VaultFunction, string>(null, blockParameter);
|
||||
}
|
||||
|
||||
public Task<string> WethQueryAsync(WethFunction wethFunction, BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryAsync<WethFunction, string>(wethFunction, blockParameter);
|
||||
}
|
||||
|
||||
|
||||
public Task<string> WethQueryAsync(BlockParameter blockParameter = null)
|
||||
{
|
||||
return ContractHandler.QueryAsync<WethFunction, string>(null, blockParameter);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user