2020-08-04 18:19:42 +00:00
// Code generated - DO NOT EDIT.
// This file is a generated binding and any manual changes will be lost.
2020-11-14 11:25:14 +00:00
package oracleEmitter
2020-08-04 18:19:42 +00:00
import (
"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 (
_ = big . NewInt
_ = strings . NewReader
_ = ethereum . NotFound
_ = bind . Bind
_ = common . Big1
_ = types . BloomLookup
_ = event . NewSubscription
)
2020-10-30 05:23:08 +00:00
// OracleEmitterABI is the input ABI used to generate the binding from.
2020-11-23 16:53:44 +00:00
const OracleEmitterABI = "[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"originChain\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"requestType\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"requestParams\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"callbackAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes4\",\"name\":\"callbackMethodID\",\"type\":\"bytes4\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"requestID\",\"type\":\"uint256\"}],\"name\":\"NewOracleRequest\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"originChain\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"requestType\",\"type\":\"uint8\"},{\"internalType\":\"string\",\"name\":\"requestParams\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"callbackAddress\",\"type\":\"address\"},{\"internalType\":\"bytes4\",\"name\":\"callbackMethodID\",\"type\":\"bytes4\"}],\"name\":\"requestOracles\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]"
2020-08-04 18:19:42 +00:00
2020-10-30 05:23:08 +00:00
// OracleEmitter is an auto generated Go binding around an Ethereum contract.
type OracleEmitter struct {
OracleEmitterCaller // Read-only binding to the contract
OracleEmitterTransactor // Write-only binding to the contract
OracleEmitterFilterer // Log filterer for contract events
2020-08-04 18:19:42 +00:00
}
2020-10-30 05:23:08 +00:00
// OracleEmitterCaller is an auto generated read-only Go binding around an Ethereum contract.
type OracleEmitterCaller struct {
2020-08-04 18:19:42 +00:00
contract * bind . BoundContract // Generic contract wrapper for the low level calls
}
2020-10-30 05:23:08 +00:00
// OracleEmitterTransactor is an auto generated write-only Go binding around an Ethereum contract.
type OracleEmitterTransactor struct {
2020-08-04 18:19:42 +00:00
contract * bind . BoundContract // Generic contract wrapper for the low level calls
}
2020-10-30 05:23:08 +00:00
// OracleEmitterFilterer is an auto generated log filtering Go binding around an Ethereum contract events.
type OracleEmitterFilterer struct {
2020-08-04 18:19:42 +00:00
contract * bind . BoundContract // Generic contract wrapper for the low level calls
}
2020-10-30 05:23:08 +00:00
// OracleEmitterSession is an auto generated Go binding around an Ethereum contract,
2020-08-04 18:19:42 +00:00
// with pre-set call and transact options.
2020-10-30 05:23:08 +00:00
type OracleEmitterSession struct {
Contract * OracleEmitter // Generic contract binding to set the session for
2020-08-04 18:19:42 +00:00
CallOpts bind . CallOpts // Call options to use throughout this session
TransactOpts bind . TransactOpts // Transaction auth options to use throughout this session
}
2020-10-30 05:23:08 +00:00
// OracleEmitterCallerSession is an auto generated read-only Go binding around an Ethereum contract,
2020-08-04 18:19:42 +00:00
// with pre-set call options.
2020-10-30 05:23:08 +00:00
type OracleEmitterCallerSession struct {
Contract * OracleEmitterCaller // Generic contract caller binding to set the session for
CallOpts bind . CallOpts // Call options to use throughout this session
2020-08-04 18:19:42 +00:00
}
2020-10-30 05:23:08 +00:00
// OracleEmitterTransactorSession is an auto generated write-only Go binding around an Ethereum contract,
2020-08-04 18:19:42 +00:00
// with pre-set transact options.
2020-10-30 05:23:08 +00:00
type OracleEmitterTransactorSession struct {
Contract * OracleEmitterTransactor // Generic contract transactor binding to set the session for
TransactOpts bind . TransactOpts // Transaction auth options to use throughout this session
2020-08-04 18:19:42 +00:00
}
2020-10-30 05:23:08 +00:00
// OracleEmitterRaw is an auto generated low-level Go binding around an Ethereum contract.
type OracleEmitterRaw struct {
Contract * OracleEmitter // Generic contract binding to access the raw methods on
2020-08-04 18:19:42 +00:00
}
2020-10-30 05:23:08 +00:00
// OracleEmitterCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract.
type OracleEmitterCallerRaw struct {
Contract * OracleEmitterCaller // Generic read-only contract binding to access the raw methods on
2020-08-04 18:19:42 +00:00
}
2020-10-30 05:23:08 +00:00
// OracleEmitterTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract.
type OracleEmitterTransactorRaw struct {
Contract * OracleEmitterTransactor // Generic write-only contract binding to access the raw methods on
2020-08-04 18:19:42 +00:00
}
2020-10-30 05:23:08 +00:00
// NewOracleEmitter creates a new instance of OracleEmitter, bound to a specific deployed contract.
func NewOracleEmitter ( address common . Address , backend bind . ContractBackend ) ( * OracleEmitter , error ) {
contract , err := bindOracleEmitter ( address , backend , backend , backend )
2020-08-04 18:19:42 +00:00
if err != nil {
return nil , err
}
2020-10-30 05:23:08 +00:00
return & OracleEmitter { OracleEmitterCaller : OracleEmitterCaller { contract : contract } , OracleEmitterTransactor : OracleEmitterTransactor { contract : contract } , OracleEmitterFilterer : OracleEmitterFilterer { contract : contract } } , nil
2020-08-04 18:19:42 +00:00
}
2020-10-30 05:23:08 +00:00
// NewOracleEmitterCaller creates a new read-only instance of OracleEmitter, bound to a specific deployed contract.
func NewOracleEmitterCaller ( address common . Address , caller bind . ContractCaller ) ( * OracleEmitterCaller , error ) {
contract , err := bindOracleEmitter ( address , caller , nil , nil )
2020-08-04 18:19:42 +00:00
if err != nil {
return nil , err
}
2020-10-30 05:23:08 +00:00
return & OracleEmitterCaller { contract : contract } , nil
2020-08-04 18:19:42 +00:00
}
2020-10-30 05:23:08 +00:00
// NewOracleEmitterTransactor creates a new write-only instance of OracleEmitter, bound to a specific deployed contract.
func NewOracleEmitterTransactor ( address common . Address , transactor bind . ContractTransactor ) ( * OracleEmitterTransactor , error ) {
contract , err := bindOracleEmitter ( address , nil , transactor , nil )
2020-08-04 18:19:42 +00:00
if err != nil {
return nil , err
}
2020-10-30 05:23:08 +00:00
return & OracleEmitterTransactor { contract : contract } , nil
2020-08-04 18:19:42 +00:00
}
2020-10-30 05:23:08 +00:00
// NewOracleEmitterFilterer creates a new log filterer instance of OracleEmitter, bound to a specific deployed contract.
func NewOracleEmitterFilterer ( address common . Address , filterer bind . ContractFilterer ) ( * OracleEmitterFilterer , error ) {
contract , err := bindOracleEmitter ( address , nil , nil , filterer )
2020-08-04 18:19:42 +00:00
if err != nil {
return nil , err
}
2020-10-30 05:23:08 +00:00
return & OracleEmitterFilterer { contract : contract } , nil
2020-08-04 18:19:42 +00:00
}
2020-10-30 05:23:08 +00:00
// bindOracleEmitter binds a generic wrapper to an already deployed contract.
func bindOracleEmitter ( address common . Address , caller bind . ContractCaller , transactor bind . ContractTransactor , filterer bind . ContractFilterer ) ( * bind . BoundContract , error ) {
parsed , err := abi . JSON ( strings . NewReader ( OracleEmitterABI ) )
2020-08-04 18:19:42 +00:00
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.
2020-10-30 05:23:08 +00:00
func ( _OracleEmitter * OracleEmitterRaw ) Call ( opts * bind . CallOpts , result interface { } , method string , params ... interface { } ) error {
return _OracleEmitter . Contract . OracleEmitterCaller . contract . Call ( opts , result , method , params ... )
2020-08-04 18:19:42 +00:00
}
// Transfer initiates a plain transaction to move funds to the contract, calling
// its default method if one is available.
2020-10-30 05:23:08 +00:00
func ( _OracleEmitter * OracleEmitterRaw ) Transfer ( opts * bind . TransactOpts ) ( * types . Transaction , error ) {
return _OracleEmitter . Contract . OracleEmitterTransactor . contract . Transfer ( opts )
2020-08-04 18:19:42 +00:00
}
// Transact invokes the (paid) contract method with params as input values.
2020-10-30 05:23:08 +00:00
func ( _OracleEmitter * OracleEmitterRaw ) Transact ( opts * bind . TransactOpts , method string , params ... interface { } ) ( * types . Transaction , error ) {
return _OracleEmitter . Contract . OracleEmitterTransactor . contract . Transact ( opts , method , params ... )
2020-08-04 18:19:42 +00:00
}
// 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.
2020-10-30 05:23:08 +00:00
func ( _OracleEmitter * OracleEmitterCallerRaw ) Call ( opts * bind . CallOpts , result interface { } , method string , params ... interface { } ) error {
return _OracleEmitter . Contract . contract . Call ( opts , result , method , params ... )
2020-08-04 18:19:42 +00:00
}
// Transfer initiates a plain transaction to move funds to the contract, calling
// its default method if one is available.
2020-10-30 05:23:08 +00:00
func ( _OracleEmitter * OracleEmitterTransactorRaw ) Transfer ( opts * bind . TransactOpts ) ( * types . Transaction , error ) {
return _OracleEmitter . Contract . contract . Transfer ( opts )
2020-08-04 18:19:42 +00:00
}
// Transact invokes the (paid) contract method with params as input values.
2020-10-30 05:23:08 +00:00
func ( _OracleEmitter * OracleEmitterTransactorRaw ) Transact ( opts * bind . TransactOpts , method string , params ... interface { } ) ( * types . Transaction , error ) {
return _OracleEmitter . Contract . contract . Transact ( opts , method , params ... )
2020-08-04 18:19:42 +00:00
}
2020-11-23 16:53:44 +00:00
// RequestOracles is a paid mutator transaction binding the contract method 0xa5bc5dfe.
2020-08-04 18:19:42 +00:00
//
2020-11-23 16:53:44 +00:00
// Solidity: function requestOracles(uint8 originChain, uint8 requestType, string requestParams, address callbackAddress, bytes4 callbackMethodID) returns(uint256)
func ( _OracleEmitter * OracleEmitterTransactor ) RequestOracles ( opts * bind . TransactOpts , originChain uint8 , requestType uint8 , requestParams string , callbackAddress common . Address , callbackMethodID [ 4 ] byte ) ( * types . Transaction , error ) {
2020-11-14 11:25:14 +00:00
return _OracleEmitter . contract . Transact ( opts , "requestOracles" , originChain , requestType , requestParams , callbackAddress , callbackMethodID )
2020-08-04 18:19:42 +00:00
}
2020-11-23 16:53:44 +00:00
// RequestOracles is a paid mutator transaction binding the contract method 0xa5bc5dfe.
2020-08-04 18:19:42 +00:00
//
2020-11-23 16:53:44 +00:00
// Solidity: function requestOracles(uint8 originChain, uint8 requestType, string requestParams, address callbackAddress, bytes4 callbackMethodID) returns(uint256)
func ( _OracleEmitter * OracleEmitterSession ) RequestOracles ( originChain uint8 , requestType uint8 , requestParams string , callbackAddress common . Address , callbackMethodID [ 4 ] byte ) ( * types . Transaction , error ) {
2020-11-14 11:25:14 +00:00
return _OracleEmitter . Contract . RequestOracles ( & _OracleEmitter . TransactOpts , originChain , requestType , requestParams , callbackAddress , callbackMethodID )
2020-08-04 18:19:42 +00:00
}
2020-11-23 16:53:44 +00:00
// RequestOracles is a paid mutator transaction binding the contract method 0xa5bc5dfe.
2020-08-04 18:19:42 +00:00
//
2020-11-23 16:53:44 +00:00
// Solidity: function requestOracles(uint8 originChain, uint8 requestType, string requestParams, address callbackAddress, bytes4 callbackMethodID) returns(uint256)
func ( _OracleEmitter * OracleEmitterTransactorSession ) RequestOracles ( originChain uint8 , requestType uint8 , requestParams string , callbackAddress common . Address , callbackMethodID [ 4 ] byte ) ( * types . Transaction , error ) {
2020-11-14 11:25:14 +00:00
return _OracleEmitter . Contract . RequestOracles ( & _OracleEmitter . TransactOpts , originChain , requestType , requestParams , callbackAddress , callbackMethodID )
2020-08-04 18:19:42 +00:00
}
2020-10-30 05:23:08 +00:00
// OracleEmitterNewOracleRequestIterator is returned from FilterNewOracleRequest and is used to iterate over the raw logs and unpacked data for NewOracleRequest events raised by the OracleEmitter contract.
type OracleEmitterNewOracleRequestIterator struct {
Event * OracleEmitterNewOracleRequest // Event containing the contract specifics and raw log
2020-08-04 18:19:42 +00:00
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.
2020-10-30 05:23:08 +00:00
func ( it * OracleEmitterNewOracleRequestIterator ) Next ( ) bool {
2020-08-04 18:19:42 +00:00
// 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 :
2020-10-30 05:23:08 +00:00
it . Event = new ( OracleEmitterNewOracleRequest )
2020-08-04 18:19:42 +00:00
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 :
2020-10-30 05:23:08 +00:00
it . Event = new ( OracleEmitterNewOracleRequest )
2020-08-04 18:19:42 +00:00
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.
2020-10-30 05:23:08 +00:00
func ( it * OracleEmitterNewOracleRequestIterator ) Error ( ) error {
2020-08-04 18:19:42 +00:00
return it . fail
}
// Close terminates the iteration process, releasing any pending underlying
// resources.
2020-10-30 05:23:08 +00:00
func ( it * OracleEmitterNewOracleRequestIterator ) Close ( ) error {
2020-08-04 18:19:42 +00:00
it . sub . Unsubscribe ( )
return nil
}
2020-10-30 05:23:08 +00:00
// OracleEmitterNewOracleRequest represents a NewOracleRequest event raised by the OracleEmitter contract.
type OracleEmitterNewOracleRequest struct {
2020-11-23 16:53:44 +00:00
OriginChain uint8
RequestType uint8
2020-11-14 11:25:14 +00:00
RequestParams string
2020-08-04 18:19:42 +00:00
CallbackAddress common . Address
CallbackMethodID [ 4 ] byte
RequestID * big . Int
Raw types . Log // Blockchain specific contextual infos
}
2020-11-23 16:53:44 +00:00
// FilterNewOracleRequest is a free log retrieval operation binding the contract event 0xaa3cd18b7cba9d24d288b9b45616e263b5f40a939fe7f4341f789b955649ea4a.
2020-08-04 18:19:42 +00:00
//
2020-11-23 16:53:44 +00:00
// Solidity: event NewOracleRequest(uint8 originChain, uint8 requestType, string requestParams, address callbackAddress, bytes4 callbackMethodID, uint256 requestID)
2020-10-30 05:23:08 +00:00
func ( _OracleEmitter * OracleEmitterFilterer ) FilterNewOracleRequest ( opts * bind . FilterOpts ) ( * OracleEmitterNewOracleRequestIterator , error ) {
2020-08-04 18:19:42 +00:00
2020-10-30 05:23:08 +00:00
logs , sub , err := _OracleEmitter . contract . FilterLogs ( opts , "NewOracleRequest" )
2020-08-04 18:19:42 +00:00
if err != nil {
return nil , err
}
2020-10-30 05:23:08 +00:00
return & OracleEmitterNewOracleRequestIterator { contract : _OracleEmitter . contract , event : "NewOracleRequest" , logs : logs , sub : sub } , nil
2020-08-04 18:19:42 +00:00
}
2020-11-23 16:53:44 +00:00
// WatchNewOracleRequest is a free log subscription operation binding the contract event 0xaa3cd18b7cba9d24d288b9b45616e263b5f40a939fe7f4341f789b955649ea4a.
2020-08-04 18:19:42 +00:00
//
2020-11-23 16:53:44 +00:00
// Solidity: event NewOracleRequest(uint8 originChain, uint8 requestType, string requestParams, address callbackAddress, bytes4 callbackMethodID, uint256 requestID)
2020-10-30 05:23:08 +00:00
func ( _OracleEmitter * OracleEmitterFilterer ) WatchNewOracleRequest ( opts * bind . WatchOpts , sink chan <- * OracleEmitterNewOracleRequest ) ( event . Subscription , error ) {
2020-08-04 18:19:42 +00:00
2020-10-30 05:23:08 +00:00
logs , sub , err := _OracleEmitter . contract . WatchLogs ( opts , "NewOracleRequest" )
2020-08-04 18:19:42 +00:00
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
2020-10-30 05:23:08 +00:00
event := new ( OracleEmitterNewOracleRequest )
if err := _OracleEmitter . contract . UnpackLog ( event , "NewOracleRequest" , log ) ; err != nil {
2020-08-04 18:19:42 +00:00
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
}
2020-11-23 16:53:44 +00:00
// ParseNewOracleRequest is a log parse operation binding the contract event 0xaa3cd18b7cba9d24d288b9b45616e263b5f40a939fe7f4341f789b955649ea4a.
2020-08-04 18:19:42 +00:00
//
2020-11-23 16:53:44 +00:00
// Solidity: event NewOracleRequest(uint8 originChain, uint8 requestType, string requestParams, address callbackAddress, bytes4 callbackMethodID, uint256 requestID)
2020-10-30 05:23:08 +00:00
func ( _OracleEmitter * OracleEmitterFilterer ) ParseNewOracleRequest ( log types . Log ) ( * OracleEmitterNewOracleRequest , error ) {
event := new ( OracleEmitterNewOracleRequest )
if err := _OracleEmitter . contract . UnpackLog ( event , "NewOracleRequest" , log ) ; err != nil {
2020-08-04 18:19:42 +00:00
return nil , err
}
return event , nil
}