769 lines
37 KiB
Go
769 lines
37 KiB
Go
// Code generated - DO NOT EDIT.
|
|
// This file is a generated binding and any manual changes will be lost.
|
|
|
|
package datafetcher
|
|
|
|
import (
|
|
"errors"
|
|
"math/big"
|
|
"strings"
|
|
|
|
ethereum "github.com/ethereum/go-ethereum"
|
|
"github.com/ethereum/go-ethereum/accounts/abi"
|
|
"github.com/ethereum/go-ethereum/accounts/abi/bind"
|
|
"github.com/ethereum/go-ethereum/common"
|
|
"github.com/ethereum/go-ethereum/core/types"
|
|
"github.com/ethereum/go-ethereum/event"
|
|
)
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
var (
|
|
_ = errors.New
|
|
_ = big.NewInt
|
|
_ = strings.NewReader
|
|
_ = ethereum.NotFound
|
|
_ = bind.Bind
|
|
_ = common.Big1
|
|
_ = types.BloomLookup
|
|
_ = event.NewSubscription
|
|
_ = abi.ConvertType
|
|
)
|
|
|
|
// DataFetcherBatchRequest is an auto generated low-level Go binding around an user-defined struct.
|
|
type DataFetcherBatchRequest struct {
|
|
V2Pools []common.Address
|
|
V3Pools []common.Address
|
|
}
|
|
|
|
// DataFetcherBatchResponse is an auto generated low-level Go binding around an user-defined struct.
|
|
type DataFetcherBatchResponse struct {
|
|
V2Data []DataFetcherV2PoolData
|
|
V3Data []DataFetcherV3PoolData
|
|
BlockNumber *big.Int
|
|
Timestamp *big.Int
|
|
}
|
|
|
|
// DataFetcherV2PoolData is an auto generated low-level Go binding around an user-defined struct.
|
|
type DataFetcherV2PoolData struct {
|
|
Pool common.Address
|
|
Token0 common.Address
|
|
Token1 common.Address
|
|
Reserve0 *big.Int
|
|
Reserve1 *big.Int
|
|
BlockTimestampLast uint32
|
|
Price0 *big.Int
|
|
Price1 *big.Int
|
|
}
|
|
|
|
// DataFetcherV3PoolData is an auto generated low-level Go binding around an user-defined struct.
|
|
type DataFetcherV3PoolData struct {
|
|
Pool common.Address
|
|
Token0 common.Address
|
|
Token1 common.Address
|
|
Fee *big.Int
|
|
SqrtPriceX96 *big.Int
|
|
Tick *big.Int
|
|
Liquidity *big.Int
|
|
Price0 *big.Int
|
|
Price1 *big.Int
|
|
}
|
|
|
|
// DataFetcherMetaData contains all meta data concerning the DataFetcher contract.
|
|
var DataFetcherMetaData = &bind.MetaData{
|
|
ABI: "[{\"type\":\"constructor\",\"inputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"batchFetchAllData\",\"inputs\":[{\"name\":\"request\",\"type\":\"tuple\",\"internalType\":\"structDataFetcher.BatchRequest\",\"components\":[{\"name\":\"v2Pools\",\"type\":\"address[]\",\"internalType\":\"address[]\"},{\"name\":\"v3Pools\",\"type\":\"address[]\",\"internalType\":\"address[]\"}]}],\"outputs\":[{\"name\":\"response\",\"type\":\"tuple\",\"internalType\":\"structDataFetcher.BatchResponse\",\"components\":[{\"name\":\"v2Data\",\"type\":\"tuple[]\",\"internalType\":\"structDataFetcher.V2PoolData[]\",\"components\":[{\"name\":\"pool\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"token0\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"token1\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"reserve0\",\"type\":\"uint112\",\"internalType\":\"uint112\"},{\"name\":\"reserve1\",\"type\":\"uint112\",\"internalType\":\"uint112\"},{\"name\":\"blockTimestampLast\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"price0\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"price1\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"name\":\"v3Data\",\"type\":\"tuple[]\",\"internalType\":\"structDataFetcher.V3PoolData[]\",\"components\":[{\"name\":\"pool\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"token0\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"token1\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"fee\",\"type\":\"uint24\",\"internalType\":\"uint24\"},{\"name\":\"sqrtPriceX96\",\"type\":\"uint160\",\"internalType\":\"uint160\"},{\"name\":\"tick\",\"type\":\"int24\",\"internalType\":\"int24\"},{\"name\":\"liquidity\",\"type\":\"uint128\",\"internalType\":\"uint128\"},{\"name\":\"price0\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"price1\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"name\":\"blockNumber\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"timestamp\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"batchFetchV2Data\",\"inputs\":[{\"name\":\"pools\",\"type\":\"address[]\",\"internalType\":\"address[]\"}],\"outputs\":[{\"name\":\"poolData\",\"type\":\"tuple[]\",\"internalType\":\"structDataFetcher.V2PoolData[]\",\"components\":[{\"name\":\"pool\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"token0\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"token1\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"reserve0\",\"type\":\"uint112\",\"internalType\":\"uint112\"},{\"name\":\"reserve1\",\"type\":\"uint112\",\"internalType\":\"uint112\"},{\"name\":\"blockTimestampLast\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"price0\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"price1\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"batchFetchV3Data\",\"inputs\":[{\"name\":\"pools\",\"type\":\"address[]\",\"internalType\":\"address[]\"}],\"outputs\":[{\"name\":\"poolData\",\"type\":\"tuple[]\",\"internalType\":\"structDataFetcher.V3PoolData[]\",\"components\":[{\"name\":\"pool\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"token0\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"token1\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"fee\",\"type\":\"uint24\",\"internalType\":\"uint24\"},{\"name\":\"sqrtPriceX96\",\"type\":\"uint160\",\"internalType\":\"uint160\"},{\"name\":\"tick\",\"type\":\"int24\",\"internalType\":\"int24\"},{\"name\":\"liquidity\",\"type\":\"uint128\",\"internalType\":\"uint128\"},{\"name\":\"price0\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"price1\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getAmountOut\",\"inputs\":[{\"name\":\"amountIn\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"reserveIn\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"reserveOut\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"amountOut\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"isValidV2Pool\",\"inputs\":[{\"name\":\"pool\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"isValid\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isValidV3Pool\",\"inputs\":[{\"name\":\"pool\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"isValid\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"DataFetched\",\"inputs\":[{\"name\":\"blockNumber\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"},{\"name\":\"v2PoolCount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"v3PoolCount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OwnershipTransferred\",\"inputs\":[{\"name\":\"previousOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"OwnableInvalidOwner\",\"inputs\":[{\"name\":\"owner\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"OwnableUnauthorizedAccount\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"internalType\":\"address\"}]}]",
|
|
}
|
|
|
|
// DataFetcherABI is the input ABI used to generate the binding from.
|
|
// Deprecated: Use DataFetcherMetaData.ABI instead.
|
|
var DataFetcherABI = DataFetcherMetaData.ABI
|
|
|
|
// DataFetcher is an auto generated Go binding around an Ethereum contract.
|
|
type DataFetcher struct {
|
|
DataFetcherCaller // Read-only binding to the contract
|
|
DataFetcherTransactor // Write-only binding to the contract
|
|
DataFetcherFilterer // Log filterer for contract events
|
|
}
|
|
|
|
// DataFetcherCaller is an auto generated read-only Go binding around an Ethereum contract.
|
|
type DataFetcherCaller struct {
|
|
contract *bind.BoundContract // Generic contract wrapper for the low level calls
|
|
}
|
|
|
|
// DataFetcherTransactor is an auto generated write-only Go binding around an Ethereum contract.
|
|
type DataFetcherTransactor struct {
|
|
contract *bind.BoundContract // Generic contract wrapper for the low level calls
|
|
}
|
|
|
|
// DataFetcherFilterer is an auto generated log filtering Go binding around an Ethereum contract events.
|
|
type DataFetcherFilterer struct {
|
|
contract *bind.BoundContract // Generic contract wrapper for the low level calls
|
|
}
|
|
|
|
// DataFetcherSession is an auto generated Go binding around an Ethereum contract,
|
|
// with pre-set call and transact options.
|
|
type DataFetcherSession struct {
|
|
Contract *DataFetcher // Generic contract binding to set the session for
|
|
CallOpts bind.CallOpts // Call options to use throughout this session
|
|
TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
|
|
}
|
|
|
|
// DataFetcherCallerSession is an auto generated read-only Go binding around an Ethereum contract,
|
|
// with pre-set call options.
|
|
type DataFetcherCallerSession struct {
|
|
Contract *DataFetcherCaller // Generic contract caller binding to set the session for
|
|
CallOpts bind.CallOpts // Call options to use throughout this session
|
|
}
|
|
|
|
// DataFetcherTransactorSession is an auto generated write-only Go binding around an Ethereum contract,
|
|
// with pre-set transact options.
|
|
type DataFetcherTransactorSession struct {
|
|
Contract *DataFetcherTransactor // Generic contract transactor binding to set the session for
|
|
TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
|
|
}
|
|
|
|
// DataFetcherRaw is an auto generated low-level Go binding around an Ethereum contract.
|
|
type DataFetcherRaw struct {
|
|
Contract *DataFetcher // Generic contract binding to access the raw methods on
|
|
}
|
|
|
|
// DataFetcherCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract.
|
|
type DataFetcherCallerRaw struct {
|
|
Contract *DataFetcherCaller // Generic read-only contract binding to access the raw methods on
|
|
}
|
|
|
|
// DataFetcherTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract.
|
|
type DataFetcherTransactorRaw struct {
|
|
Contract *DataFetcherTransactor // Generic write-only contract binding to access the raw methods on
|
|
}
|
|
|
|
// NewDataFetcher creates a new instance of DataFetcher, bound to a specific deployed contract.
|
|
func NewDataFetcher(address common.Address, backend bind.ContractBackend) (*DataFetcher, error) {
|
|
contract, err := bindDataFetcher(address, backend, backend, backend)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &DataFetcher{DataFetcherCaller: DataFetcherCaller{contract: contract}, DataFetcherTransactor: DataFetcherTransactor{contract: contract}, DataFetcherFilterer: DataFetcherFilterer{contract: contract}}, nil
|
|
}
|
|
|
|
// NewDataFetcherCaller creates a new read-only instance of DataFetcher, bound to a specific deployed contract.
|
|
func NewDataFetcherCaller(address common.Address, caller bind.ContractCaller) (*DataFetcherCaller, error) {
|
|
contract, err := bindDataFetcher(address, caller, nil, nil)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &DataFetcherCaller{contract: contract}, nil
|
|
}
|
|
|
|
// NewDataFetcherTransactor creates a new write-only instance of DataFetcher, bound to a specific deployed contract.
|
|
func NewDataFetcherTransactor(address common.Address, transactor bind.ContractTransactor) (*DataFetcherTransactor, error) {
|
|
contract, err := bindDataFetcher(address, nil, transactor, nil)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &DataFetcherTransactor{contract: contract}, nil
|
|
}
|
|
|
|
// NewDataFetcherFilterer creates a new log filterer instance of DataFetcher, bound to a specific deployed contract.
|
|
func NewDataFetcherFilterer(address common.Address, filterer bind.ContractFilterer) (*DataFetcherFilterer, error) {
|
|
contract, err := bindDataFetcher(address, nil, nil, filterer)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &DataFetcherFilterer{contract: contract}, nil
|
|
}
|
|
|
|
// bindDataFetcher binds a generic wrapper to an already deployed contract.
|
|
func bindDataFetcher(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {
|
|
parsed, err := DataFetcherMetaData.GetAbi()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil
|
|
}
|
|
|
|
// Call invokes the (constant) contract method with params as input values and
|
|
// sets the output to result. The result type might be a single field for simple
|
|
// returns, a slice of interfaces for anonymous returns and a struct for named
|
|
// returns.
|
|
func (_DataFetcher *DataFetcherRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
|
|
return _DataFetcher.Contract.DataFetcherCaller.contract.Call(opts, result, method, params...)
|
|
}
|
|
|
|
// Transfer initiates a plain transaction to move funds to the contract, calling
|
|
// its default method if one is available.
|
|
func (_DataFetcher *DataFetcherRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
|
|
return _DataFetcher.Contract.DataFetcherTransactor.contract.Transfer(opts)
|
|
}
|
|
|
|
// Transact invokes the (paid) contract method with params as input values.
|
|
func (_DataFetcher *DataFetcherRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
|
|
return _DataFetcher.Contract.DataFetcherTransactor.contract.Transact(opts, method, params...)
|
|
}
|
|
|
|
// Call invokes the (constant) contract method with params as input values and
|
|
// sets the output to result. The result type might be a single field for simple
|
|
// returns, a slice of interfaces for anonymous returns and a struct for named
|
|
// returns.
|
|
func (_DataFetcher *DataFetcherCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
|
|
return _DataFetcher.Contract.contract.Call(opts, result, method, params...)
|
|
}
|
|
|
|
// Transfer initiates a plain transaction to move funds to the contract, calling
|
|
// its default method if one is available.
|
|
func (_DataFetcher *DataFetcherTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
|
|
return _DataFetcher.Contract.contract.Transfer(opts)
|
|
}
|
|
|
|
// Transact invokes the (paid) contract method with params as input values.
|
|
func (_DataFetcher *DataFetcherTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
|
|
return _DataFetcher.Contract.contract.Transact(opts, method, params...)
|
|
}
|
|
|
|
// BatchFetchV2Data is a free data retrieval call binding the contract method 0x08586b84.
|
|
//
|
|
// Solidity: function batchFetchV2Data(address[] pools) view returns((address,address,address,uint112,uint112,uint32,uint256,uint256)[] poolData)
|
|
func (_DataFetcher *DataFetcherCaller) BatchFetchV2Data(opts *bind.CallOpts, pools []common.Address) ([]DataFetcherV2PoolData, error) {
|
|
var out []interface{}
|
|
err := _DataFetcher.contract.Call(opts, &out, "batchFetchV2Data", pools)
|
|
|
|
if err != nil {
|
|
return *new([]DataFetcherV2PoolData), err
|
|
}
|
|
|
|
out0 := *abi.ConvertType(out[0], new([]DataFetcherV2PoolData)).(*[]DataFetcherV2PoolData)
|
|
|
|
return out0, err
|
|
|
|
}
|
|
|
|
// BatchFetchV2Data is a free data retrieval call binding the contract method 0x08586b84.
|
|
//
|
|
// Solidity: function batchFetchV2Data(address[] pools) view returns((address,address,address,uint112,uint112,uint32,uint256,uint256)[] poolData)
|
|
func (_DataFetcher *DataFetcherSession) BatchFetchV2Data(pools []common.Address) ([]DataFetcherV2PoolData, error) {
|
|
return _DataFetcher.Contract.BatchFetchV2Data(&_DataFetcher.CallOpts, pools)
|
|
}
|
|
|
|
// BatchFetchV2Data is a free data retrieval call binding the contract method 0x08586b84.
|
|
//
|
|
// Solidity: function batchFetchV2Data(address[] pools) view returns((address,address,address,uint112,uint112,uint32,uint256,uint256)[] poolData)
|
|
func (_DataFetcher *DataFetcherCallerSession) BatchFetchV2Data(pools []common.Address) ([]DataFetcherV2PoolData, error) {
|
|
return _DataFetcher.Contract.BatchFetchV2Data(&_DataFetcher.CallOpts, pools)
|
|
}
|
|
|
|
// BatchFetchV3Data is a free data retrieval call binding the contract method 0x2b0bad3f.
|
|
//
|
|
// Solidity: function batchFetchV3Data(address[] pools) view returns((address,address,address,uint24,uint160,int24,uint128,uint256,uint256)[] poolData)
|
|
func (_DataFetcher *DataFetcherCaller) BatchFetchV3Data(opts *bind.CallOpts, pools []common.Address) ([]DataFetcherV3PoolData, error) {
|
|
var out []interface{}
|
|
err := _DataFetcher.contract.Call(opts, &out, "batchFetchV3Data", pools)
|
|
|
|
if err != nil {
|
|
return *new([]DataFetcherV3PoolData), err
|
|
}
|
|
|
|
out0 := *abi.ConvertType(out[0], new([]DataFetcherV3PoolData)).(*[]DataFetcherV3PoolData)
|
|
|
|
return out0, err
|
|
|
|
}
|
|
|
|
// BatchFetchV3Data is a free data retrieval call binding the contract method 0x2b0bad3f.
|
|
//
|
|
// Solidity: function batchFetchV3Data(address[] pools) view returns((address,address,address,uint24,uint160,int24,uint128,uint256,uint256)[] poolData)
|
|
func (_DataFetcher *DataFetcherSession) BatchFetchV3Data(pools []common.Address) ([]DataFetcherV3PoolData, error) {
|
|
return _DataFetcher.Contract.BatchFetchV3Data(&_DataFetcher.CallOpts, pools)
|
|
}
|
|
|
|
// BatchFetchV3Data is a free data retrieval call binding the contract method 0x2b0bad3f.
|
|
//
|
|
// Solidity: function batchFetchV3Data(address[] pools) view returns((address,address,address,uint24,uint160,int24,uint128,uint256,uint256)[] poolData)
|
|
func (_DataFetcher *DataFetcherCallerSession) BatchFetchV3Data(pools []common.Address) ([]DataFetcherV3PoolData, error) {
|
|
return _DataFetcher.Contract.BatchFetchV3Data(&_DataFetcher.CallOpts, pools)
|
|
}
|
|
|
|
// GetAmountOut is a free data retrieval call binding the contract method 0x054d50d4.
|
|
//
|
|
// Solidity: function getAmountOut(uint256 amountIn, uint256 reserveIn, uint256 reserveOut) pure returns(uint256 amountOut)
|
|
func (_DataFetcher *DataFetcherCaller) GetAmountOut(opts *bind.CallOpts, amountIn *big.Int, reserveIn *big.Int, reserveOut *big.Int) (*big.Int, error) {
|
|
var out []interface{}
|
|
err := _DataFetcher.contract.Call(opts, &out, "getAmountOut", amountIn, reserveIn, reserveOut)
|
|
|
|
if err != nil {
|
|
return *new(*big.Int), err
|
|
}
|
|
|
|
out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)
|
|
|
|
return out0, err
|
|
|
|
}
|
|
|
|
// GetAmountOut is a free data retrieval call binding the contract method 0x054d50d4.
|
|
//
|
|
// Solidity: function getAmountOut(uint256 amountIn, uint256 reserveIn, uint256 reserveOut) pure returns(uint256 amountOut)
|
|
func (_DataFetcher *DataFetcherSession) GetAmountOut(amountIn *big.Int, reserveIn *big.Int, reserveOut *big.Int) (*big.Int, error) {
|
|
return _DataFetcher.Contract.GetAmountOut(&_DataFetcher.CallOpts, amountIn, reserveIn, reserveOut)
|
|
}
|
|
|
|
// GetAmountOut is a free data retrieval call binding the contract method 0x054d50d4.
|
|
//
|
|
// Solidity: function getAmountOut(uint256 amountIn, uint256 reserveIn, uint256 reserveOut) pure returns(uint256 amountOut)
|
|
func (_DataFetcher *DataFetcherCallerSession) GetAmountOut(amountIn *big.Int, reserveIn *big.Int, reserveOut *big.Int) (*big.Int, error) {
|
|
return _DataFetcher.Contract.GetAmountOut(&_DataFetcher.CallOpts, amountIn, reserveIn, reserveOut)
|
|
}
|
|
|
|
// IsValidV2Pool is a free data retrieval call binding the contract method 0xeed58877.
|
|
//
|
|
// Solidity: function isValidV2Pool(address pool) view returns(bool isValid)
|
|
func (_DataFetcher *DataFetcherCaller) IsValidV2Pool(opts *bind.CallOpts, pool common.Address) (bool, error) {
|
|
var out []interface{}
|
|
err := _DataFetcher.contract.Call(opts, &out, "isValidV2Pool", pool)
|
|
|
|
if err != nil {
|
|
return *new(bool), err
|
|
}
|
|
|
|
out0 := *abi.ConvertType(out[0], new(bool)).(*bool)
|
|
|
|
return out0, err
|
|
|
|
}
|
|
|
|
// IsValidV2Pool is a free data retrieval call binding the contract method 0xeed58877.
|
|
//
|
|
// Solidity: function isValidV2Pool(address pool) view returns(bool isValid)
|
|
func (_DataFetcher *DataFetcherSession) IsValidV2Pool(pool common.Address) (bool, error) {
|
|
return _DataFetcher.Contract.IsValidV2Pool(&_DataFetcher.CallOpts, pool)
|
|
}
|
|
|
|
// IsValidV2Pool is a free data retrieval call binding the contract method 0xeed58877.
|
|
//
|
|
// Solidity: function isValidV2Pool(address pool) view returns(bool isValid)
|
|
func (_DataFetcher *DataFetcherCallerSession) IsValidV2Pool(pool common.Address) (bool, error) {
|
|
return _DataFetcher.Contract.IsValidV2Pool(&_DataFetcher.CallOpts, pool)
|
|
}
|
|
|
|
// IsValidV3Pool is a free data retrieval call binding the contract method 0xb7292482.
|
|
//
|
|
// Solidity: function isValidV3Pool(address pool) view returns(bool isValid)
|
|
func (_DataFetcher *DataFetcherCaller) IsValidV3Pool(opts *bind.CallOpts, pool common.Address) (bool, error) {
|
|
var out []interface{}
|
|
err := _DataFetcher.contract.Call(opts, &out, "isValidV3Pool", pool)
|
|
|
|
if err != nil {
|
|
return *new(bool), err
|
|
}
|
|
|
|
out0 := *abi.ConvertType(out[0], new(bool)).(*bool)
|
|
|
|
return out0, err
|
|
|
|
}
|
|
|
|
// IsValidV3Pool is a free data retrieval call binding the contract method 0xb7292482.
|
|
//
|
|
// Solidity: function isValidV3Pool(address pool) view returns(bool isValid)
|
|
func (_DataFetcher *DataFetcherSession) IsValidV3Pool(pool common.Address) (bool, error) {
|
|
return _DataFetcher.Contract.IsValidV3Pool(&_DataFetcher.CallOpts, pool)
|
|
}
|
|
|
|
// IsValidV3Pool is a free data retrieval call binding the contract method 0xb7292482.
|
|
//
|
|
// Solidity: function isValidV3Pool(address pool) view returns(bool isValid)
|
|
func (_DataFetcher *DataFetcherCallerSession) IsValidV3Pool(pool common.Address) (bool, error) {
|
|
return _DataFetcher.Contract.IsValidV3Pool(&_DataFetcher.CallOpts, pool)
|
|
}
|
|
|
|
// Owner is a free data retrieval call binding the contract method 0x8da5cb5b.
|
|
//
|
|
// Solidity: function owner() view returns(address)
|
|
func (_DataFetcher *DataFetcherCaller) Owner(opts *bind.CallOpts) (common.Address, error) {
|
|
var out []interface{}
|
|
err := _DataFetcher.contract.Call(opts, &out, "owner")
|
|
|
|
if err != nil {
|
|
return *new(common.Address), err
|
|
}
|
|
|
|
out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address)
|
|
|
|
return out0, err
|
|
|
|
}
|
|
|
|
// Owner is a free data retrieval call binding the contract method 0x8da5cb5b.
|
|
//
|
|
// Solidity: function owner() view returns(address)
|
|
func (_DataFetcher *DataFetcherSession) Owner() (common.Address, error) {
|
|
return _DataFetcher.Contract.Owner(&_DataFetcher.CallOpts)
|
|
}
|
|
|
|
// Owner is a free data retrieval call binding the contract method 0x8da5cb5b.
|
|
//
|
|
// Solidity: function owner() view returns(address)
|
|
func (_DataFetcher *DataFetcherCallerSession) Owner() (common.Address, error) {
|
|
return _DataFetcher.Contract.Owner(&_DataFetcher.CallOpts)
|
|
}
|
|
|
|
// BatchFetchAllData is a paid mutator transaction binding the contract method 0x71ac5931.
|
|
//
|
|
// Solidity: function batchFetchAllData((address[],address[]) request) returns(((address,address,address,uint112,uint112,uint32,uint256,uint256)[],(address,address,address,uint24,uint160,int24,uint128,uint256,uint256)[],uint256,uint256) response)
|
|
func (_DataFetcher *DataFetcherTransactor) BatchFetchAllData(opts *bind.TransactOpts, request DataFetcherBatchRequest) (*types.Transaction, error) {
|
|
return _DataFetcher.contract.Transact(opts, "batchFetchAllData", request)
|
|
}
|
|
|
|
// BatchFetchAllData is a paid mutator transaction binding the contract method 0x71ac5931.
|
|
//
|
|
// Solidity: function batchFetchAllData((address[],address[]) request) returns(((address,address,address,uint112,uint112,uint32,uint256,uint256)[],(address,address,address,uint24,uint160,int24,uint128,uint256,uint256)[],uint256,uint256) response)
|
|
func (_DataFetcher *DataFetcherSession) BatchFetchAllData(request DataFetcherBatchRequest) (*types.Transaction, error) {
|
|
return _DataFetcher.Contract.BatchFetchAllData(&_DataFetcher.TransactOpts, request)
|
|
}
|
|
|
|
// BatchFetchAllData is a paid mutator transaction binding the contract method 0x71ac5931.
|
|
//
|
|
// Solidity: function batchFetchAllData((address[],address[]) request) returns(((address,address,address,uint112,uint112,uint32,uint256,uint256)[],(address,address,address,uint24,uint160,int24,uint128,uint256,uint256)[],uint256,uint256) response)
|
|
func (_DataFetcher *DataFetcherTransactorSession) BatchFetchAllData(request DataFetcherBatchRequest) (*types.Transaction, error) {
|
|
return _DataFetcher.Contract.BatchFetchAllData(&_DataFetcher.TransactOpts, request)
|
|
}
|
|
|
|
// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6.
|
|
//
|
|
// Solidity: function renounceOwnership() returns()
|
|
func (_DataFetcher *DataFetcherTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) {
|
|
return _DataFetcher.contract.Transact(opts, "renounceOwnership")
|
|
}
|
|
|
|
// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6.
|
|
//
|
|
// Solidity: function renounceOwnership() returns()
|
|
func (_DataFetcher *DataFetcherSession) RenounceOwnership() (*types.Transaction, error) {
|
|
return _DataFetcher.Contract.RenounceOwnership(&_DataFetcher.TransactOpts)
|
|
}
|
|
|
|
// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6.
|
|
//
|
|
// Solidity: function renounceOwnership() returns()
|
|
func (_DataFetcher *DataFetcherTransactorSession) RenounceOwnership() (*types.Transaction, error) {
|
|
return _DataFetcher.Contract.RenounceOwnership(&_DataFetcher.TransactOpts)
|
|
}
|
|
|
|
// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b.
|
|
//
|
|
// Solidity: function transferOwnership(address newOwner) returns()
|
|
func (_DataFetcher *DataFetcherTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) {
|
|
return _DataFetcher.contract.Transact(opts, "transferOwnership", newOwner)
|
|
}
|
|
|
|
// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b.
|
|
//
|
|
// Solidity: function transferOwnership(address newOwner) returns()
|
|
func (_DataFetcher *DataFetcherSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) {
|
|
return _DataFetcher.Contract.TransferOwnership(&_DataFetcher.TransactOpts, newOwner)
|
|
}
|
|
|
|
// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b.
|
|
//
|
|
// Solidity: function transferOwnership(address newOwner) returns()
|
|
func (_DataFetcher *DataFetcherTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) {
|
|
return _DataFetcher.Contract.TransferOwnership(&_DataFetcher.TransactOpts, newOwner)
|
|
}
|
|
|
|
// DataFetcherDataFetchedIterator is returned from FilterDataFetched and is used to iterate over the raw logs and unpacked data for DataFetched events raised by the DataFetcher contract.
|
|
type DataFetcherDataFetchedIterator struct {
|
|
Event *DataFetcherDataFetched // Event containing the contract specifics and raw log
|
|
|
|
contract *bind.BoundContract // Generic contract to use for unpacking event data
|
|
event string // Event name to use for unpacking event data
|
|
|
|
logs chan types.Log // Log channel receiving the found contract events
|
|
sub ethereum.Subscription // Subscription for errors, completion and termination
|
|
done bool // Whether the subscription completed delivering logs
|
|
fail error // Occurred error to stop iteration
|
|
}
|
|
|
|
// Next advances the iterator to the subsequent event, returning whether there
|
|
// are any more events found. In case of a retrieval or parsing error, false is
|
|
// returned and Error() can be queried for the exact failure.
|
|
func (it *DataFetcherDataFetchedIterator) Next() bool {
|
|
// If the iterator failed, stop iterating
|
|
if it.fail != nil {
|
|
return false
|
|
}
|
|
// If the iterator completed, deliver directly whatever's available
|
|
if it.done {
|
|
select {
|
|
case log := <-it.logs:
|
|
it.Event = new(DataFetcherDataFetched)
|
|
if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
|
|
it.fail = err
|
|
return false
|
|
}
|
|
it.Event.Raw = log
|
|
return true
|
|
|
|
default:
|
|
return false
|
|
}
|
|
}
|
|
// Iterator still in progress, wait for either a data or an error event
|
|
select {
|
|
case log := <-it.logs:
|
|
it.Event = new(DataFetcherDataFetched)
|
|
if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
|
|
it.fail = err
|
|
return false
|
|
}
|
|
it.Event.Raw = log
|
|
return true
|
|
|
|
case err := <-it.sub.Err():
|
|
it.done = true
|
|
it.fail = err
|
|
return it.Next()
|
|
}
|
|
}
|
|
|
|
// Error returns any retrieval or parsing error occurred during filtering.
|
|
func (it *DataFetcherDataFetchedIterator) Error() error {
|
|
return it.fail
|
|
}
|
|
|
|
// Close terminates the iteration process, releasing any pending underlying
|
|
// resources.
|
|
func (it *DataFetcherDataFetchedIterator) Close() error {
|
|
it.sub.Unsubscribe()
|
|
return nil
|
|
}
|
|
|
|
// DataFetcherDataFetched represents a DataFetched event raised by the DataFetcher contract.
|
|
type DataFetcherDataFetched struct {
|
|
BlockNumber *big.Int
|
|
V2PoolCount *big.Int
|
|
V3PoolCount *big.Int
|
|
Raw types.Log // Blockchain specific contextual infos
|
|
}
|
|
|
|
// FilterDataFetched is a free log retrieval operation binding the contract event 0xc973a5db1e1c754d6a440aa959524bac785dad6e5e78c66a3bb720965bb4fae4.
|
|
//
|
|
// Solidity: event DataFetched(uint256 indexed blockNumber, uint256 v2PoolCount, uint256 v3PoolCount)
|
|
func (_DataFetcher *DataFetcherFilterer) FilterDataFetched(opts *bind.FilterOpts, blockNumber []*big.Int) (*DataFetcherDataFetchedIterator, error) {
|
|
|
|
var blockNumberRule []interface{}
|
|
for _, blockNumberItem := range blockNumber {
|
|
blockNumberRule = append(blockNumberRule, blockNumberItem)
|
|
}
|
|
|
|
logs, sub, err := _DataFetcher.contract.FilterLogs(opts, "DataFetched", blockNumberRule)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &DataFetcherDataFetchedIterator{contract: _DataFetcher.contract, event: "DataFetched", logs: logs, sub: sub}, nil
|
|
}
|
|
|
|
// WatchDataFetched is a free log subscription operation binding the contract event 0xc973a5db1e1c754d6a440aa959524bac785dad6e5e78c66a3bb720965bb4fae4.
|
|
//
|
|
// Solidity: event DataFetched(uint256 indexed blockNumber, uint256 v2PoolCount, uint256 v3PoolCount)
|
|
func (_DataFetcher *DataFetcherFilterer) WatchDataFetched(opts *bind.WatchOpts, sink chan<- *DataFetcherDataFetched, blockNumber []*big.Int) (event.Subscription, error) {
|
|
|
|
var blockNumberRule []interface{}
|
|
for _, blockNumberItem := range blockNumber {
|
|
blockNumberRule = append(blockNumberRule, blockNumberItem)
|
|
}
|
|
|
|
logs, sub, err := _DataFetcher.contract.WatchLogs(opts, "DataFetched", blockNumberRule)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return event.NewSubscription(func(quit <-chan struct{}) error {
|
|
defer sub.Unsubscribe()
|
|
for {
|
|
select {
|
|
case log := <-logs:
|
|
// New log arrived, parse the event and forward to the user
|
|
event := new(DataFetcherDataFetched)
|
|
if err := _DataFetcher.contract.UnpackLog(event, "DataFetched", log); err != nil {
|
|
return err
|
|
}
|
|
event.Raw = log
|
|
|
|
select {
|
|
case sink <- event:
|
|
case err := <-sub.Err():
|
|
return err
|
|
case <-quit:
|
|
return nil
|
|
}
|
|
case err := <-sub.Err():
|
|
return err
|
|
case <-quit:
|
|
return nil
|
|
}
|
|
}
|
|
}), nil
|
|
}
|
|
|
|
// ParseDataFetched is a log parse operation binding the contract event 0xc973a5db1e1c754d6a440aa959524bac785dad6e5e78c66a3bb720965bb4fae4.
|
|
//
|
|
// Solidity: event DataFetched(uint256 indexed blockNumber, uint256 v2PoolCount, uint256 v3PoolCount)
|
|
func (_DataFetcher *DataFetcherFilterer) ParseDataFetched(log types.Log) (*DataFetcherDataFetched, error) {
|
|
event := new(DataFetcherDataFetched)
|
|
if err := _DataFetcher.contract.UnpackLog(event, "DataFetched", log); err != nil {
|
|
return nil, err
|
|
}
|
|
event.Raw = log
|
|
return event, nil
|
|
}
|
|
|
|
// DataFetcherOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the DataFetcher contract.
|
|
type DataFetcherOwnershipTransferredIterator struct {
|
|
Event *DataFetcherOwnershipTransferred // Event containing the contract specifics and raw log
|
|
|
|
contract *bind.BoundContract // Generic contract to use for unpacking event data
|
|
event string // Event name to use for unpacking event data
|
|
|
|
logs chan types.Log // Log channel receiving the found contract events
|
|
sub ethereum.Subscription // Subscription for errors, completion and termination
|
|
done bool // Whether the subscription completed delivering logs
|
|
fail error // Occurred error to stop iteration
|
|
}
|
|
|
|
// Next advances the iterator to the subsequent event, returning whether there
|
|
// are any more events found. In case of a retrieval or parsing error, false is
|
|
// returned and Error() can be queried for the exact failure.
|
|
func (it *DataFetcherOwnershipTransferredIterator) Next() bool {
|
|
// If the iterator failed, stop iterating
|
|
if it.fail != nil {
|
|
return false
|
|
}
|
|
// If the iterator completed, deliver directly whatever's available
|
|
if it.done {
|
|
select {
|
|
case log := <-it.logs:
|
|
it.Event = new(DataFetcherOwnershipTransferred)
|
|
if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
|
|
it.fail = err
|
|
return false
|
|
}
|
|
it.Event.Raw = log
|
|
return true
|
|
|
|
default:
|
|
return false
|
|
}
|
|
}
|
|
// Iterator still in progress, wait for either a data or an error event
|
|
select {
|
|
case log := <-it.logs:
|
|
it.Event = new(DataFetcherOwnershipTransferred)
|
|
if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
|
|
it.fail = err
|
|
return false
|
|
}
|
|
it.Event.Raw = log
|
|
return true
|
|
|
|
case err := <-it.sub.Err():
|
|
it.done = true
|
|
it.fail = err
|
|
return it.Next()
|
|
}
|
|
}
|
|
|
|
// Error returns any retrieval or parsing error occurred during filtering.
|
|
func (it *DataFetcherOwnershipTransferredIterator) Error() error {
|
|
return it.fail
|
|
}
|
|
|
|
// Close terminates the iteration process, releasing any pending underlying
|
|
// resources.
|
|
func (it *DataFetcherOwnershipTransferredIterator) Close() error {
|
|
it.sub.Unsubscribe()
|
|
return nil
|
|
}
|
|
|
|
// DataFetcherOwnershipTransferred represents a OwnershipTransferred event raised by the DataFetcher contract.
|
|
type DataFetcherOwnershipTransferred struct {
|
|
PreviousOwner common.Address
|
|
NewOwner common.Address
|
|
Raw types.Log // Blockchain specific contextual infos
|
|
}
|
|
|
|
// FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0.
|
|
//
|
|
// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
|
|
func (_DataFetcher *DataFetcherFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*DataFetcherOwnershipTransferredIterator, error) {
|
|
|
|
var previousOwnerRule []interface{}
|
|
for _, previousOwnerItem := range previousOwner {
|
|
previousOwnerRule = append(previousOwnerRule, previousOwnerItem)
|
|
}
|
|
var newOwnerRule []interface{}
|
|
for _, newOwnerItem := range newOwner {
|
|
newOwnerRule = append(newOwnerRule, newOwnerItem)
|
|
}
|
|
|
|
logs, sub, err := _DataFetcher.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &DataFetcherOwnershipTransferredIterator{contract: _DataFetcher.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil
|
|
}
|
|
|
|
// WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0.
|
|
//
|
|
// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
|
|
func (_DataFetcher *DataFetcherFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *DataFetcherOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) {
|
|
|
|
var previousOwnerRule []interface{}
|
|
for _, previousOwnerItem := range previousOwner {
|
|
previousOwnerRule = append(previousOwnerRule, previousOwnerItem)
|
|
}
|
|
var newOwnerRule []interface{}
|
|
for _, newOwnerItem := range newOwner {
|
|
newOwnerRule = append(newOwnerRule, newOwnerItem)
|
|
}
|
|
|
|
logs, sub, err := _DataFetcher.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return event.NewSubscription(func(quit <-chan struct{}) error {
|
|
defer sub.Unsubscribe()
|
|
for {
|
|
select {
|
|
case log := <-logs:
|
|
// New log arrived, parse the event and forward to the user
|
|
event := new(DataFetcherOwnershipTransferred)
|
|
if err := _DataFetcher.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil {
|
|
return err
|
|
}
|
|
event.Raw = log
|
|
|
|
select {
|
|
case sink <- event:
|
|
case err := <-sub.Err():
|
|
return err
|
|
case <-quit:
|
|
return nil
|
|
}
|
|
case err := <-sub.Err():
|
|
return err
|
|
case <-quit:
|
|
return nil
|
|
}
|
|
}
|
|
}), nil
|
|
}
|
|
|
|
// ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0.
|
|
//
|
|
// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
|
|
func (_DataFetcher *DataFetcherFilterer) ParseOwnershipTransferred(log types.Log) (*DataFetcherOwnershipTransferred, error) {
|
|
event := new(DataFetcherOwnershipTransferred)
|
|
if err := _DataFetcher.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil {
|
|
return nil, err
|
|
}
|
|
event.Raw = log
|
|
return event, nil
|
|
}
|