code.vegaprotocol.io/vega@v0.79.0/core/staking/staking_bridge_abi.go (about) 1 // Code generated - DO NOT EDIT. 2 // This file is a generated binding and any manual changes will be lost. 3 4 package staking 5 6 import ( 7 "errors" 8 "math/big" 9 "strings" 10 11 ethereum "github.com/ethereum/go-ethereum" 12 "github.com/ethereum/go-ethereum/accounts/abi" 13 "github.com/ethereum/go-ethereum/accounts/abi/bind" 14 "github.com/ethereum/go-ethereum/common" 15 "github.com/ethereum/go-ethereum/core/types" 16 "github.com/ethereum/go-ethereum/event" 17 ) 18 19 // Reference imports to suppress errors if they are not otherwise used. 20 var ( 21 _ = errors.New 22 _ = big.NewInt 23 _ = strings.NewReader 24 _ = ethereum.NotFound 25 _ = bind.Bind 26 _ = common.Big1 27 _ = types.BloomLookup 28 _ = event.NewSubscription 29 _ = abi.ConvertType 30 ) 31 32 // StakingMetaData contains all meta data concerning the Staking contract. 33 var StakingMetaData = &bind.MetaData{ 34 ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"vega_public_key\",\"type\":\"bytes32\"}],\"name\":\"StakeDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"vega_public_key\",\"type\":\"bytes32\"}],\"name\":\"StakeRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"vega_public_key\",\"type\":\"bytes32\"}],\"name\":\"StakeTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"stakingToken\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"vega_public_key\",\"type\":\"bytes32\"}],\"name\":\"stakeBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalStaked\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", 35 } 36 37 // StakingABI is the input ABI used to generate the binding from. 38 // Deprecated: Use StakingMetaData.ABI instead. 39 var StakingABI = StakingMetaData.ABI 40 41 // Staking is an auto generated Go binding around an Ethereum contract. 42 type Staking struct { 43 StakingCaller // Read-only binding to the contract 44 StakingTransactor // Write-only binding to the contract 45 StakingFilterer // Log filterer for contract events 46 } 47 48 // StakingCaller is an auto generated read-only Go binding around an Ethereum contract. 49 type StakingCaller struct { 50 contract *bind.BoundContract // Generic contract wrapper for the low level calls 51 } 52 53 // StakingTransactor is an auto generated write-only Go binding around an Ethereum contract. 54 type StakingTransactor struct { 55 contract *bind.BoundContract // Generic contract wrapper for the low level calls 56 } 57 58 // StakingFilterer is an auto generated log filtering Go binding around an Ethereum contract events. 59 type StakingFilterer struct { 60 contract *bind.BoundContract // Generic contract wrapper for the low level calls 61 } 62 63 // StakingSession is an auto generated Go binding around an Ethereum contract, 64 // with pre-set call and transact options. 65 type StakingSession struct { 66 Contract *Staking // Generic contract binding to set the session for 67 CallOpts bind.CallOpts // Call options to use throughout this session 68 TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session 69 } 70 71 // StakingCallerSession is an auto generated read-only Go binding around an Ethereum contract, 72 // with pre-set call options. 73 type StakingCallerSession struct { 74 Contract *StakingCaller // Generic contract caller binding to set the session for 75 CallOpts bind.CallOpts // Call options to use throughout this session 76 } 77 78 // StakingTransactorSession is an auto generated write-only Go binding around an Ethereum contract, 79 // with pre-set transact options. 80 type StakingTransactorSession struct { 81 Contract *StakingTransactor // Generic contract transactor binding to set the session for 82 TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session 83 } 84 85 // StakingRaw is an auto generated low-level Go binding around an Ethereum contract. 86 type StakingRaw struct { 87 Contract *Staking // Generic contract binding to access the raw methods on 88 } 89 90 // StakingCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. 91 type StakingCallerRaw struct { 92 Contract *StakingCaller // Generic read-only contract binding to access the raw methods on 93 } 94 95 // StakingTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. 96 type StakingTransactorRaw struct { 97 Contract *StakingTransactor // Generic write-only contract binding to access the raw methods on 98 } 99 100 // NewStaking creates a new instance of Staking, bound to a specific deployed contract. 101 func NewStaking(address common.Address, backend bind.ContractBackend) (*Staking, error) { 102 contract, err := bindStaking(address, backend, backend, backend) 103 if err != nil { 104 return nil, err 105 } 106 return &Staking{StakingCaller: StakingCaller{contract: contract}, StakingTransactor: StakingTransactor{contract: contract}, StakingFilterer: StakingFilterer{contract: contract}}, nil 107 } 108 109 // NewStakingCaller creates a new read-only instance of Staking, bound to a specific deployed contract. 110 func NewStakingCaller(address common.Address, caller bind.ContractCaller) (*StakingCaller, error) { 111 contract, err := bindStaking(address, caller, nil, nil) 112 if err != nil { 113 return nil, err 114 } 115 return &StakingCaller{contract: contract}, nil 116 } 117 118 // NewStakingTransactor creates a new write-only instance of Staking, bound to a specific deployed contract. 119 func NewStakingTransactor(address common.Address, transactor bind.ContractTransactor) (*StakingTransactor, error) { 120 contract, err := bindStaking(address, nil, transactor, nil) 121 if err != nil { 122 return nil, err 123 } 124 return &StakingTransactor{contract: contract}, nil 125 } 126 127 // NewStakingFilterer creates a new log filterer instance of Staking, bound to a specific deployed contract. 128 func NewStakingFilterer(address common.Address, filterer bind.ContractFilterer) (*StakingFilterer, error) { 129 contract, err := bindStaking(address, nil, nil, filterer) 130 if err != nil { 131 return nil, err 132 } 133 return &StakingFilterer{contract: contract}, nil 134 } 135 136 // bindStaking binds a generic wrapper to an already deployed contract. 137 func bindStaking(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { 138 parsed, err := StakingMetaData.GetAbi() 139 if err != nil { 140 return nil, err 141 } 142 return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil 143 } 144 145 // Call invokes the (constant) contract method with params as input values and 146 // sets the output to result. The result type might be a single field for simple 147 // returns, a slice of interfaces for anonymous returns and a struct for named 148 // returns. 149 func (_Staking *StakingRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { 150 return _Staking.Contract.StakingCaller.contract.Call(opts, result, method, params...) 151 } 152 153 // Transfer initiates a plain transaction to move funds to the contract, calling 154 // its default method if one is available. 155 func (_Staking *StakingRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { 156 return _Staking.Contract.StakingTransactor.contract.Transfer(opts) 157 } 158 159 // Transact invokes the (paid) contract method with params as input values. 160 func (_Staking *StakingRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { 161 return _Staking.Contract.StakingTransactor.contract.Transact(opts, method, params...) 162 } 163 164 // Call invokes the (constant) contract method with params as input values and 165 // sets the output to result. The result type might be a single field for simple 166 // returns, a slice of interfaces for anonymous returns and a struct for named 167 // returns. 168 func (_Staking *StakingCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { 169 return _Staking.Contract.contract.Call(opts, result, method, params...) 170 } 171 172 // Transfer initiates a plain transaction to move funds to the contract, calling 173 // its default method if one is available. 174 func (_Staking *StakingTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { 175 return _Staking.Contract.contract.Transfer(opts) 176 } 177 178 // Transact invokes the (paid) contract method with params as input values. 179 func (_Staking *StakingTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { 180 return _Staking.Contract.contract.Transact(opts, method, params...) 181 } 182 183 // StakeBalance is a free data retrieval call binding the contract method 0xd4a5ea85. 184 // 185 // Solidity: function stakeBalance(address target, bytes32 vega_public_key) view returns(uint256) 186 func (_Staking *StakingCaller) StakeBalance(opts *bind.CallOpts, target common.Address, vega_public_key [32]byte) (*big.Int, error) { 187 var out []interface{} 188 err := _Staking.contract.Call(opts, &out, "stakeBalance", target, vega_public_key) 189 190 if err != nil { 191 return *new(*big.Int), err 192 } 193 194 out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) 195 196 return out0, err 197 198 } 199 200 // StakeBalance is a free data retrieval call binding the contract method 0xd4a5ea85. 201 // 202 // Solidity: function stakeBalance(address target, bytes32 vega_public_key) view returns(uint256) 203 func (_Staking *StakingSession) StakeBalance(target common.Address, vega_public_key [32]byte) (*big.Int, error) { 204 return _Staking.Contract.StakeBalance(&_Staking.CallOpts, target, vega_public_key) 205 } 206 207 // StakeBalance is a free data retrieval call binding the contract method 0xd4a5ea85. 208 // 209 // Solidity: function stakeBalance(address target, bytes32 vega_public_key) view returns(uint256) 210 func (_Staking *StakingCallerSession) StakeBalance(target common.Address, vega_public_key [32]byte) (*big.Int, error) { 211 return _Staking.Contract.StakeBalance(&_Staking.CallOpts, target, vega_public_key) 212 } 213 214 // StakingToken is a free data retrieval call binding the contract method 0x72f702f3. 215 // 216 // Solidity: function stakingToken() view returns(address) 217 func (_Staking *StakingCaller) StakingToken(opts *bind.CallOpts) (common.Address, error) { 218 var out []interface{} 219 err := _Staking.contract.Call(opts, &out, "stakingToken") 220 221 if err != nil { 222 return *new(common.Address), err 223 } 224 225 out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) 226 227 return out0, err 228 229 } 230 231 // StakingToken is a free data retrieval call binding the contract method 0x72f702f3. 232 // 233 // Solidity: function stakingToken() view returns(address) 234 func (_Staking *StakingSession) StakingToken() (common.Address, error) { 235 return _Staking.Contract.StakingToken(&_Staking.CallOpts) 236 } 237 238 // StakingToken is a free data retrieval call binding the contract method 0x72f702f3. 239 // 240 // Solidity: function stakingToken() view returns(address) 241 func (_Staking *StakingCallerSession) StakingToken() (common.Address, error) { 242 return _Staking.Contract.StakingToken(&_Staking.CallOpts) 243 } 244 245 // TotalStaked is a free data retrieval call binding the contract method 0x817b1cd2. 246 // 247 // Solidity: function totalStaked() view returns(uint256) 248 func (_Staking *StakingCaller) TotalStaked(opts *bind.CallOpts) (*big.Int, error) { 249 var out []interface{} 250 err := _Staking.contract.Call(opts, &out, "totalStaked") 251 252 if err != nil { 253 return *new(*big.Int), err 254 } 255 256 out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) 257 258 return out0, err 259 260 } 261 262 // TotalStaked is a free data retrieval call binding the contract method 0x817b1cd2. 263 // 264 // Solidity: function totalStaked() view returns(uint256) 265 func (_Staking *StakingSession) TotalStaked() (*big.Int, error) { 266 return _Staking.Contract.TotalStaked(&_Staking.CallOpts) 267 } 268 269 // TotalStaked is a free data retrieval call binding the contract method 0x817b1cd2. 270 // 271 // Solidity: function totalStaked() view returns(uint256) 272 func (_Staking *StakingCallerSession) TotalStaked() (*big.Int, error) { 273 return _Staking.Contract.TotalStaked(&_Staking.CallOpts) 274 } 275 276 // StakingStakeDepositedIterator is returned from FilterStakeDeposited and is used to iterate over the raw logs and unpacked data for StakeDeposited events raised by the Staking contract. 277 type StakingStakeDepositedIterator struct { 278 Event *StakingStakeDeposited // Event containing the contract specifics and raw log 279 280 contract *bind.BoundContract // Generic contract to use for unpacking event data 281 event string // Event name to use for unpacking event data 282 283 logs chan types.Log // Log channel receiving the found contract events 284 sub ethereum.Subscription // Subscription for errors, completion and termination 285 done bool // Whether the subscription completed delivering logs 286 fail error // Occurred error to stop iteration 287 } 288 289 // Next advances the iterator to the subsequent event, returning whether there 290 // are any more events found. In case of a retrieval or parsing error, false is 291 // returned and Error() can be queried for the exact failure. 292 func (it *StakingStakeDepositedIterator) Next() bool { 293 // If the iterator failed, stop iterating 294 if it.fail != nil { 295 return false 296 } 297 // If the iterator completed, deliver directly whatever's available 298 if it.done { 299 select { 300 case log := <-it.logs: 301 it.Event = new(StakingStakeDeposited) 302 if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { 303 it.fail = err 304 return false 305 } 306 it.Event.Raw = log 307 return true 308 309 default: 310 return false 311 } 312 } 313 // Iterator still in progress, wait for either a data or an error event 314 select { 315 case log := <-it.logs: 316 it.Event = new(StakingStakeDeposited) 317 if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { 318 it.fail = err 319 return false 320 } 321 it.Event.Raw = log 322 return true 323 324 case err := <-it.sub.Err(): 325 it.done = true 326 it.fail = err 327 return it.Next() 328 } 329 } 330 331 // Error returns any retrieval or parsing error occurred during filtering. 332 func (it *StakingStakeDepositedIterator) Error() error { 333 return it.fail 334 } 335 336 // Close terminates the iteration process, releasing any pending underlying 337 // resources. 338 func (it *StakingStakeDepositedIterator) Close() error { 339 it.sub.Unsubscribe() 340 return nil 341 } 342 343 // StakingStakeDeposited represents a StakeDeposited event raised by the Staking contract. 344 type StakingStakeDeposited struct { 345 User common.Address 346 Amount *big.Int 347 VegaPublicKey [32]byte 348 Raw types.Log // Blockchain specific contextual infos 349 } 350 351 // FilterStakeDeposited is a free log retrieval operation binding the contract event 0xa740b666eafe67a67d1b2753cb8f8311c88f5c2bdd5077aa463a9f63d08638c4. 352 // 353 // Solidity: event StakeDeposited(address indexed user, uint256 amount, bytes32 indexed vega_public_key) 354 func (_Staking *StakingFilterer) FilterStakeDeposited(opts *bind.FilterOpts, user []common.Address, vega_public_key [][32]byte) (*StakingStakeDepositedIterator, error) { 355 356 var userRule []interface{} 357 for _, userItem := range user { 358 userRule = append(userRule, userItem) 359 } 360 361 var vega_public_keyRule []interface{} 362 for _, vega_public_keyItem := range vega_public_key { 363 vega_public_keyRule = append(vega_public_keyRule, vega_public_keyItem) 364 } 365 366 logs, sub, err := _Staking.contract.FilterLogs(opts, "StakeDeposited", userRule, vega_public_keyRule) 367 if err != nil { 368 return nil, err 369 } 370 return &StakingStakeDepositedIterator{contract: _Staking.contract, event: "StakeDeposited", logs: logs, sub: sub}, nil 371 } 372 373 // WatchStakeDeposited is a free log subscription operation binding the contract event 0xa740b666eafe67a67d1b2753cb8f8311c88f5c2bdd5077aa463a9f63d08638c4. 374 // 375 // Solidity: event StakeDeposited(address indexed user, uint256 amount, bytes32 indexed vega_public_key) 376 func (_Staking *StakingFilterer) WatchStakeDeposited(opts *bind.WatchOpts, sink chan<- *StakingStakeDeposited, user []common.Address, vega_public_key [][32]byte) (event.Subscription, error) { 377 378 var userRule []interface{} 379 for _, userItem := range user { 380 userRule = append(userRule, userItem) 381 } 382 383 var vega_public_keyRule []interface{} 384 for _, vega_public_keyItem := range vega_public_key { 385 vega_public_keyRule = append(vega_public_keyRule, vega_public_keyItem) 386 } 387 388 logs, sub, err := _Staking.contract.WatchLogs(opts, "StakeDeposited", userRule, vega_public_keyRule) 389 if err != nil { 390 return nil, err 391 } 392 return event.NewSubscription(func(quit <-chan struct{}) error { 393 defer sub.Unsubscribe() 394 for { 395 select { 396 case log := <-logs: 397 // New log arrived, parse the event and forward to the user 398 event := new(StakingStakeDeposited) 399 if err := _Staking.contract.UnpackLog(event, "StakeDeposited", log); err != nil { 400 return err 401 } 402 event.Raw = log 403 404 select { 405 case sink <- event: 406 case err := <-sub.Err(): 407 return err 408 case <-quit: 409 return nil 410 } 411 case err := <-sub.Err(): 412 return err 413 case <-quit: 414 return nil 415 } 416 } 417 }), nil 418 } 419 420 // ParseStakeDeposited is a log parse operation binding the contract event 0xa740b666eafe67a67d1b2753cb8f8311c88f5c2bdd5077aa463a9f63d08638c4. 421 // 422 // Solidity: event StakeDeposited(address indexed user, uint256 amount, bytes32 indexed vega_public_key) 423 func (_Staking *StakingFilterer) ParseStakeDeposited(log types.Log) (*StakingStakeDeposited, error) { 424 event := new(StakingStakeDeposited) 425 if err := _Staking.contract.UnpackLog(event, "StakeDeposited", log); err != nil { 426 return nil, err 427 } 428 event.Raw = log 429 return event, nil 430 } 431 432 // StakingStakeRemovedIterator is returned from FilterStakeRemoved and is used to iterate over the raw logs and unpacked data for StakeRemoved events raised by the Staking contract. 433 type StakingStakeRemovedIterator struct { 434 Event *StakingStakeRemoved // Event containing the contract specifics and raw log 435 436 contract *bind.BoundContract // Generic contract to use for unpacking event data 437 event string // Event name to use for unpacking event data 438 439 logs chan types.Log // Log channel receiving the found contract events 440 sub ethereum.Subscription // Subscription for errors, completion and termination 441 done bool // Whether the subscription completed delivering logs 442 fail error // Occurred error to stop iteration 443 } 444 445 // Next advances the iterator to the subsequent event, returning whether there 446 // are any more events found. In case of a retrieval or parsing error, false is 447 // returned and Error() can be queried for the exact failure. 448 func (it *StakingStakeRemovedIterator) Next() bool { 449 // If the iterator failed, stop iterating 450 if it.fail != nil { 451 return false 452 } 453 // If the iterator completed, deliver directly whatever's available 454 if it.done { 455 select { 456 case log := <-it.logs: 457 it.Event = new(StakingStakeRemoved) 458 if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { 459 it.fail = err 460 return false 461 } 462 it.Event.Raw = log 463 return true 464 465 default: 466 return false 467 } 468 } 469 // Iterator still in progress, wait for either a data or an error event 470 select { 471 case log := <-it.logs: 472 it.Event = new(StakingStakeRemoved) 473 if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { 474 it.fail = err 475 return false 476 } 477 it.Event.Raw = log 478 return true 479 480 case err := <-it.sub.Err(): 481 it.done = true 482 it.fail = err 483 return it.Next() 484 } 485 } 486 487 // Error returns any retrieval or parsing error occurred during filtering. 488 func (it *StakingStakeRemovedIterator) Error() error { 489 return it.fail 490 } 491 492 // Close terminates the iteration process, releasing any pending underlying 493 // resources. 494 func (it *StakingStakeRemovedIterator) Close() error { 495 it.sub.Unsubscribe() 496 return nil 497 } 498 499 // StakingStakeRemoved represents a StakeRemoved event raised by the Staking contract. 500 type StakingStakeRemoved struct { 501 User common.Address 502 Amount *big.Int 503 VegaPublicKey [32]byte 504 Raw types.Log // Blockchain specific contextual infos 505 } 506 507 // FilterStakeRemoved is a free log retrieval operation binding the contract event 0x3df2a2c33fc4a392029fcbabd913802df02edfae3039eed78ddcc961bbf74f3e. 508 // 509 // Solidity: event StakeRemoved(address indexed user, uint256 amount, bytes32 indexed vega_public_key) 510 func (_Staking *StakingFilterer) FilterStakeRemoved(opts *bind.FilterOpts, user []common.Address, vega_public_key [][32]byte) (*StakingStakeRemovedIterator, error) { 511 512 var userRule []interface{} 513 for _, userItem := range user { 514 userRule = append(userRule, userItem) 515 } 516 517 var vega_public_keyRule []interface{} 518 for _, vega_public_keyItem := range vega_public_key { 519 vega_public_keyRule = append(vega_public_keyRule, vega_public_keyItem) 520 } 521 522 logs, sub, err := _Staking.contract.FilterLogs(opts, "StakeRemoved", userRule, vega_public_keyRule) 523 if err != nil { 524 return nil, err 525 } 526 return &StakingStakeRemovedIterator{contract: _Staking.contract, event: "StakeRemoved", logs: logs, sub: sub}, nil 527 } 528 529 // WatchStakeRemoved is a free log subscription operation binding the contract event 0x3df2a2c33fc4a392029fcbabd913802df02edfae3039eed78ddcc961bbf74f3e. 530 // 531 // Solidity: event StakeRemoved(address indexed user, uint256 amount, bytes32 indexed vega_public_key) 532 func (_Staking *StakingFilterer) WatchStakeRemoved(opts *bind.WatchOpts, sink chan<- *StakingStakeRemoved, user []common.Address, vega_public_key [][32]byte) (event.Subscription, error) { 533 534 var userRule []interface{} 535 for _, userItem := range user { 536 userRule = append(userRule, userItem) 537 } 538 539 var vega_public_keyRule []interface{} 540 for _, vega_public_keyItem := range vega_public_key { 541 vega_public_keyRule = append(vega_public_keyRule, vega_public_keyItem) 542 } 543 544 logs, sub, err := _Staking.contract.WatchLogs(opts, "StakeRemoved", userRule, vega_public_keyRule) 545 if err != nil { 546 return nil, err 547 } 548 return event.NewSubscription(func(quit <-chan struct{}) error { 549 defer sub.Unsubscribe() 550 for { 551 select { 552 case log := <-logs: 553 // New log arrived, parse the event and forward to the user 554 event := new(StakingStakeRemoved) 555 if err := _Staking.contract.UnpackLog(event, "StakeRemoved", log); err != nil { 556 return err 557 } 558 event.Raw = log 559 560 select { 561 case sink <- event: 562 case err := <-sub.Err(): 563 return err 564 case <-quit: 565 return nil 566 } 567 case err := <-sub.Err(): 568 return err 569 case <-quit: 570 return nil 571 } 572 } 573 }), nil 574 } 575 576 // ParseStakeRemoved is a log parse operation binding the contract event 0x3df2a2c33fc4a392029fcbabd913802df02edfae3039eed78ddcc961bbf74f3e. 577 // 578 // Solidity: event StakeRemoved(address indexed user, uint256 amount, bytes32 indexed vega_public_key) 579 func (_Staking *StakingFilterer) ParseStakeRemoved(log types.Log) (*StakingStakeRemoved, error) { 580 event := new(StakingStakeRemoved) 581 if err := _Staking.contract.UnpackLog(event, "StakeRemoved", log); err != nil { 582 return nil, err 583 } 584 event.Raw = log 585 return event, nil 586 } 587 588 // StakingStakeTransferredIterator is returned from FilterStakeTransferred and is used to iterate over the raw logs and unpacked data for StakeTransferred events raised by the Staking contract. 589 type StakingStakeTransferredIterator struct { 590 Event *StakingStakeTransferred // Event containing the contract specifics and raw log 591 592 contract *bind.BoundContract // Generic contract to use for unpacking event data 593 event string // Event name to use for unpacking event data 594 595 logs chan types.Log // Log channel receiving the found contract events 596 sub ethereum.Subscription // Subscription for errors, completion and termination 597 done bool // Whether the subscription completed delivering logs 598 fail error // Occurred error to stop iteration 599 } 600 601 // Next advances the iterator to the subsequent event, returning whether there 602 // are any more events found. In case of a retrieval or parsing error, false is 603 // returned and Error() can be queried for the exact failure. 604 func (it *StakingStakeTransferredIterator) Next() bool { 605 // If the iterator failed, stop iterating 606 if it.fail != nil { 607 return false 608 } 609 // If the iterator completed, deliver directly whatever's available 610 if it.done { 611 select { 612 case log := <-it.logs: 613 it.Event = new(StakingStakeTransferred) 614 if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { 615 it.fail = err 616 return false 617 } 618 it.Event.Raw = log 619 return true 620 621 default: 622 return false 623 } 624 } 625 // Iterator still in progress, wait for either a data or an error event 626 select { 627 case log := <-it.logs: 628 it.Event = new(StakingStakeTransferred) 629 if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { 630 it.fail = err 631 return false 632 } 633 it.Event.Raw = log 634 return true 635 636 case err := <-it.sub.Err(): 637 it.done = true 638 it.fail = err 639 return it.Next() 640 } 641 } 642 643 // Error returns any retrieval or parsing error occurred during filtering. 644 func (it *StakingStakeTransferredIterator) Error() error { 645 return it.fail 646 } 647 648 // Close terminates the iteration process, releasing any pending underlying 649 // resources. 650 func (it *StakingStakeTransferredIterator) Close() error { 651 it.sub.Unsubscribe() 652 return nil 653 } 654 655 // StakingStakeTransferred represents a StakeTransferred event raised by the Staking contract. 656 type StakingStakeTransferred struct { 657 From common.Address 658 Amount *big.Int 659 To common.Address 660 VegaPublicKey [32]byte 661 Raw types.Log // Blockchain specific contextual infos 662 } 663 664 // FilterStakeTransferred is a free log retrieval operation binding the contract event 0xab5f7a0e10dc8589661875693d701b8779b7606ee1a15027a7114d66f1257794. 665 // 666 // Solidity: event StakeTransferred(address indexed from, uint256 amount, address indexed to, bytes32 indexed vega_public_key) 667 func (_Staking *StakingFilterer) FilterStakeTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address, vega_public_key [][32]byte) (*StakingStakeTransferredIterator, error) { 668 669 var fromRule []interface{} 670 for _, fromItem := range from { 671 fromRule = append(fromRule, fromItem) 672 } 673 674 var toRule []interface{} 675 for _, toItem := range to { 676 toRule = append(toRule, toItem) 677 } 678 var vega_public_keyRule []interface{} 679 for _, vega_public_keyItem := range vega_public_key { 680 vega_public_keyRule = append(vega_public_keyRule, vega_public_keyItem) 681 } 682 683 logs, sub, err := _Staking.contract.FilterLogs(opts, "StakeTransferred", fromRule, toRule, vega_public_keyRule) 684 if err != nil { 685 return nil, err 686 } 687 return &StakingStakeTransferredIterator{contract: _Staking.contract, event: "StakeTransferred", logs: logs, sub: sub}, nil 688 } 689 690 // WatchStakeTransferred is a free log subscription operation binding the contract event 0xab5f7a0e10dc8589661875693d701b8779b7606ee1a15027a7114d66f1257794. 691 // 692 // Solidity: event StakeTransferred(address indexed from, uint256 amount, address indexed to, bytes32 indexed vega_public_key) 693 func (_Staking *StakingFilterer) WatchStakeTransferred(opts *bind.WatchOpts, sink chan<- *StakingStakeTransferred, from []common.Address, to []common.Address, vega_public_key [][32]byte) (event.Subscription, error) { 694 695 var fromRule []interface{} 696 for _, fromItem := range from { 697 fromRule = append(fromRule, fromItem) 698 } 699 700 var toRule []interface{} 701 for _, toItem := range to { 702 toRule = append(toRule, toItem) 703 } 704 var vega_public_keyRule []interface{} 705 for _, vega_public_keyItem := range vega_public_key { 706 vega_public_keyRule = append(vega_public_keyRule, vega_public_keyItem) 707 } 708 709 logs, sub, err := _Staking.contract.WatchLogs(opts, "StakeTransferred", fromRule, toRule, vega_public_keyRule) 710 if err != nil { 711 return nil, err 712 } 713 return event.NewSubscription(func(quit <-chan struct{}) error { 714 defer sub.Unsubscribe() 715 for { 716 select { 717 case log := <-logs: 718 // New log arrived, parse the event and forward to the user 719 event := new(StakingStakeTransferred) 720 if err := _Staking.contract.UnpackLog(event, "StakeTransferred", log); err != nil { 721 return err 722 } 723 event.Raw = log 724 725 select { 726 case sink <- event: 727 case err := <-sub.Err(): 728 return err 729 case <-quit: 730 return nil 731 } 732 case err := <-sub.Err(): 733 return err 734 case <-quit: 735 return nil 736 } 737 } 738 }), nil 739 } 740 741 // ParseStakeTransferred is a log parse operation binding the contract event 0xab5f7a0e10dc8589661875693d701b8779b7606ee1a15027a7114d66f1257794. 742 // 743 // Solidity: event StakeTransferred(address indexed from, uint256 amount, address indexed to, bytes32 indexed vega_public_key) 744 func (_Staking *StakingFilterer) ParseStakeTransferred(log types.Log) (*StakingStakeTransferred, error) { 745 event := new(StakingStakeTransferred) 746 if err := _Staking.contract.UnpackLog(event, "StakeTransferred", log); err != nil { 747 return nil, err 748 } 749 event.Raw = log 750 return event, nil 751 }