htlc

package
v0.0.0-...-aa9e218 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 19, 2019 License: MIT Imports: 8 Imported by: 0

README

The HashedTimelock.sol is from hashed-timelock-contract-ethereum

localhost:atomicswap walker$ cd contract/
localhost:contract walker$ solc --abi --bin -o ./ HashedTimelock.sol
Compiler run successful. Artifact(s) can be found in directory ./.
localhost:contract walker$ ls
HashedTimelock.abi	HashedTimelock.sol	abigen
HashedTimelock.bin	README.md
localhost:contract walker$ ./abigen --pkg=htlc --out=./htlc.go --abi ./HashedTimelock.abi --bin ./HashedTimelock.bin
localhost:contract walker$ ls
HashedTimelock.abi	HashedTimelock.sol	abigen
HashedTimelock.bin	README.md		htlc.go
localhost:contract walker$ tree
.
├── HashedTimelock.abi
├── HashedTimelock.bin
├── HashedTimelock.sol
├── README.md
├── abigen
└── htlc.go

0 directories, 6 files
localhost:contract walker$ 

Documentation

Index

Constants

View Source
const HtlcABI = "" /* 2111-byte string literal not displayed */

HtlcABI is the input ABI used to generate the binding from.

Variables

View Source
var HtlcBin = "" /* 8708-byte string literal not displayed */

HtlcBin is the compiled bytecode used for deploying new contracts.

Functions

This section is empty.

Types

type Htlc

type Htlc struct {
	HtlcCaller     // Read-only binding to the contract
	HtlcTransactor // Write-only binding to the contract
	HtlcFilterer   // Log filterer for contract events
}

Htlc is an auto generated Go binding around an Ethereum contract.

func DeployHtlc

func DeployHtlc(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *Htlc, error)

DeployHtlc deploys a new Ethereum contract, binding an instance of Htlc to it.

func NewHtlc

func NewHtlc(address common.Address, backend bind.ContractBackend) (*Htlc, error)

NewHtlc creates a new instance of Htlc, bound to a specific deployed contract.

type HtlcCaller

type HtlcCaller struct {
	// contains filtered or unexported fields
}

HtlcCaller is an auto generated read-only Go binding around an Ethereum contract.

func NewHtlcCaller

func NewHtlcCaller(address common.Address, caller bind.ContractCaller) (*HtlcCaller, error)

NewHtlcCaller creates a new read-only instance of Htlc, bound to a specific deployed contract.

func (*HtlcCaller) GetContract

func (_Htlc *HtlcCaller) GetContract(opts *bind.CallOpts, _contractId [32]byte) (struct {
	Sender    common.Address
	Receiver  common.Address
	Amount    *big.Int
	Hashlock  [32]byte
	Timelock  *big.Int
	Withdrawn bool
	Refunded  bool
	Preimage  [32]byte
}, error)

GetContract is a free data retrieval call binding the contract method 0xe16c7d98.

Solidity: function getContract(bytes32 _contractId) constant returns(address sender, address receiver, uint256 amount, bytes32 hashlock, uint256 timelock, bool withdrawn, bool refunded, bytes32 preimage)

type HtlcCallerRaw

type HtlcCallerRaw struct {
	Contract *HtlcCaller // Generic read-only contract binding to access the raw methods on
}

HtlcCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract.

func (*HtlcCallerRaw) Call

func (_Htlc *HtlcCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error

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.

type HtlcCallerSession

type HtlcCallerSession struct {
	Contract *HtlcCaller   // Generic contract caller binding to set the session for
	CallOpts bind.CallOpts // Call options to use throughout this session
}

HtlcCallerSession is an auto generated read-only Go binding around an Ethereum contract, with pre-set call options.

func (*HtlcCallerSession) GetContract

func (_Htlc *HtlcCallerSession) GetContract(_contractId [32]byte) (struct {
	Sender    common.Address
	Receiver  common.Address
	Amount    *big.Int
	Hashlock  [32]byte
	Timelock  *big.Int
	Withdrawn bool
	Refunded  bool
	Preimage  [32]byte
}, error)

GetContract is a free data retrieval call binding the contract method 0xe16c7d98.

Solidity: function getContract(bytes32 _contractId) constant returns(address sender, address receiver, uint256 amount, bytes32 hashlock, uint256 timelock, bool withdrawn, bool refunded, bytes32 preimage)

type HtlcFilterer

type HtlcFilterer struct {
	// contains filtered or unexported fields
}

HtlcFilterer is an auto generated log filtering Go binding around an Ethereum contract events.

func NewHtlcFilterer

func NewHtlcFilterer(address common.Address, filterer bind.ContractFilterer) (*HtlcFilterer, error)

NewHtlcFilterer creates a new log filterer instance of Htlc, bound to a specific deployed contract.

func (*HtlcFilterer) FilterLogHTLCNew

func (_Htlc *HtlcFilterer) FilterLogHTLCNew(opts *bind.FilterOpts, contractId [][32]byte, sender []common.Address, receiver []common.Address) (*HtlcLogHTLCNewIterator, error)

FilterLogHTLCNew is a free log retrieval operation binding the contract event 0x329a8316ed9c3b2299597538371c2944c5026574e803b1ec31d6113e1cd67bde.

Solidity: event LogHTLCNew(bytes32 indexed contractId, address indexed sender, address indexed receiver, uint256 amount, bytes32 hashlock, uint256 timelock)

func (*HtlcFilterer) FilterLogHTLCRefund

func (_Htlc *HtlcFilterer) FilterLogHTLCRefund(opts *bind.FilterOpts, contractId [][32]byte) (*HtlcLogHTLCRefundIterator, error)

FilterLogHTLCRefund is a free log retrieval operation binding the contract event 0x989b3a845197c9aec15f8982bbb30b5da714050e662a7a287bb1a94c81e2e70e.

Solidity: event LogHTLCRefund(bytes32 indexed contractId)

func (*HtlcFilterer) FilterLogHTLCWithdraw

func (_Htlc *HtlcFilterer) FilterLogHTLCWithdraw(opts *bind.FilterOpts, contractId [][32]byte) (*HtlcLogHTLCWithdrawIterator, error)

FilterLogHTLCWithdraw is a free log retrieval operation binding the contract event 0xd6fd4c8e45bf0c70693141c7ce46451b6a6a28ac8386fca2ba914044e0e23916.

Solidity: event LogHTLCWithdraw(bytes32 indexed contractId)

func (*HtlcFilterer) ParseLogHTLCNew

func (_Htlc *HtlcFilterer) ParseLogHTLCNew(log types.Log) (*HtlcLogHTLCNew, error)

ParseLogHTLCNew is a log parse operation binding the contract event 0x329a8316ed9c3b2299597538371c2944c5026574e803b1ec31d6113e1cd67bde.

Solidity: event LogHTLCNew(bytes32 indexed contractId, address indexed sender, address indexed receiver, uint256 amount, bytes32 hashlock, uint256 timelock)

func (*HtlcFilterer) ParseLogHTLCRefund

func (_Htlc *HtlcFilterer) ParseLogHTLCRefund(log types.Log) (*HtlcLogHTLCRefund, error)

ParseLogHTLCRefund is a log parse operation binding the contract event 0x989b3a845197c9aec15f8982bbb30b5da714050e662a7a287bb1a94c81e2e70e.

Solidity: event LogHTLCRefund(bytes32 indexed contractId)

func (*HtlcFilterer) ParseLogHTLCWithdraw

func (_Htlc *HtlcFilterer) ParseLogHTLCWithdraw(log types.Log) (*HtlcLogHTLCWithdraw, error)

ParseLogHTLCWithdraw is a log parse operation binding the contract event 0xd6fd4c8e45bf0c70693141c7ce46451b6a6a28ac8386fca2ba914044e0e23916.

Solidity: event LogHTLCWithdraw(bytes32 indexed contractId)

func (*HtlcFilterer) WatchLogHTLCNew

func (_Htlc *HtlcFilterer) WatchLogHTLCNew(opts *bind.WatchOpts, sink chan<- *HtlcLogHTLCNew, contractId [][32]byte, sender []common.Address, receiver []common.Address) (event.Subscription, error)

WatchLogHTLCNew is a free log subscription operation binding the contract event 0x329a8316ed9c3b2299597538371c2944c5026574e803b1ec31d6113e1cd67bde.

Solidity: event LogHTLCNew(bytes32 indexed contractId, address indexed sender, address indexed receiver, uint256 amount, bytes32 hashlock, uint256 timelock)

func (*HtlcFilterer) WatchLogHTLCRefund

func (_Htlc *HtlcFilterer) WatchLogHTLCRefund(opts *bind.WatchOpts, sink chan<- *HtlcLogHTLCRefund, contractId [][32]byte) (event.Subscription, error)

WatchLogHTLCRefund is a free log subscription operation binding the contract event 0x989b3a845197c9aec15f8982bbb30b5da714050e662a7a287bb1a94c81e2e70e.

Solidity: event LogHTLCRefund(bytes32 indexed contractId)

func (*HtlcFilterer) WatchLogHTLCWithdraw

func (_Htlc *HtlcFilterer) WatchLogHTLCWithdraw(opts *bind.WatchOpts, sink chan<- *HtlcLogHTLCWithdraw, contractId [][32]byte) (event.Subscription, error)

WatchLogHTLCWithdraw is a free log subscription operation binding the contract event 0xd6fd4c8e45bf0c70693141c7ce46451b6a6a28ac8386fca2ba914044e0e23916.

Solidity: event LogHTLCWithdraw(bytes32 indexed contractId)

type HtlcLogHTLCNew

type HtlcLogHTLCNew struct {
	ContractId [32]byte
	Sender     common.Address
	Receiver   common.Address
	Amount     *big.Int
	Hashlock   [32]byte
	Timelock   *big.Int
	Raw        types.Log // Blockchain specific contextual infos
}

HtlcLogHTLCNew represents a LogHTLCNew event raised by the Htlc contract.

type HtlcLogHTLCNewIterator

type HtlcLogHTLCNewIterator struct {
	Event *HtlcLogHTLCNew // Event containing the contract specifics and raw log
	// contains filtered or unexported fields
}

HtlcLogHTLCNewIterator is returned from FilterLogHTLCNew and is used to iterate over the raw logs and unpacked data for LogHTLCNew events raised by the Htlc contract.

func (*HtlcLogHTLCNewIterator) Close

func (it *HtlcLogHTLCNewIterator) Close() error

Close terminates the iteration process, releasing any pending underlying resources.

func (*HtlcLogHTLCNewIterator) Error

func (it *HtlcLogHTLCNewIterator) Error() error

Error returns any retrieval or parsing error occurred during filtering.

func (*HtlcLogHTLCNewIterator) Next

func (it *HtlcLogHTLCNewIterator) Next() bool

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.

type HtlcLogHTLCRefund

type HtlcLogHTLCRefund struct {
	ContractId [32]byte
	Raw        types.Log // Blockchain specific contextual infos
}

HtlcLogHTLCRefund represents a LogHTLCRefund event raised by the Htlc contract.

type HtlcLogHTLCRefundIterator

type HtlcLogHTLCRefundIterator struct {
	Event *HtlcLogHTLCRefund // Event containing the contract specifics and raw log
	// contains filtered or unexported fields
}

HtlcLogHTLCRefundIterator is returned from FilterLogHTLCRefund and is used to iterate over the raw logs and unpacked data for LogHTLCRefund events raised by the Htlc contract.

func (*HtlcLogHTLCRefundIterator) Close

func (it *HtlcLogHTLCRefundIterator) Close() error

Close terminates the iteration process, releasing any pending underlying resources.

func (*HtlcLogHTLCRefundIterator) Error

func (it *HtlcLogHTLCRefundIterator) Error() error

Error returns any retrieval or parsing error occurred during filtering.

func (*HtlcLogHTLCRefundIterator) Next

func (it *HtlcLogHTLCRefundIterator) Next() bool

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.

type HtlcLogHTLCWithdraw

type HtlcLogHTLCWithdraw struct {
	ContractId [32]byte
	Raw        types.Log // Blockchain specific contextual infos
}

HtlcLogHTLCWithdraw represents a LogHTLCWithdraw event raised by the Htlc contract.

type HtlcLogHTLCWithdrawIterator

type HtlcLogHTLCWithdrawIterator struct {
	Event *HtlcLogHTLCWithdraw // Event containing the contract specifics and raw log
	// contains filtered or unexported fields
}

HtlcLogHTLCWithdrawIterator is returned from FilterLogHTLCWithdraw and is used to iterate over the raw logs and unpacked data for LogHTLCWithdraw events raised by the Htlc contract.

func (*HtlcLogHTLCWithdrawIterator) Close

func (it *HtlcLogHTLCWithdrawIterator) Close() error

Close terminates the iteration process, releasing any pending underlying resources.

func (*HtlcLogHTLCWithdrawIterator) Error

func (it *HtlcLogHTLCWithdrawIterator) Error() error

Error returns any retrieval or parsing error occurred during filtering.

func (*HtlcLogHTLCWithdrawIterator) Next

func (it *HtlcLogHTLCWithdrawIterator) Next() bool

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.

type HtlcRaw

type HtlcRaw struct {
	Contract *Htlc // Generic contract binding to access the raw methods on
}

HtlcRaw is an auto generated low-level Go binding around an Ethereum contract.

func (*HtlcRaw) Call

func (_Htlc *HtlcRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error

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 (*HtlcRaw) Transact

func (_Htlc *HtlcRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error)

Transact invokes the (paid) contract method with params as input values.

func (*HtlcRaw) Transfer

func (_Htlc *HtlcRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error)

Transfer initiates a plain transaction to move funds to the contract, calling its default method if one is available.

type HtlcSession

type HtlcSession struct {
	Contract     *Htlc             // 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
}

HtlcSession is an auto generated Go binding around an Ethereum contract, with pre-set call and transact options.

func (*HtlcSession) GetContract

func (_Htlc *HtlcSession) GetContract(_contractId [32]byte) (struct {
	Sender    common.Address
	Receiver  common.Address
	Amount    *big.Int
	Hashlock  [32]byte
	Timelock  *big.Int
	Withdrawn bool
	Refunded  bool
	Preimage  [32]byte
}, error)

GetContract is a free data retrieval call binding the contract method 0xe16c7d98.

Solidity: function getContract(bytes32 _contractId) constant returns(address sender, address receiver, uint256 amount, bytes32 hashlock, uint256 timelock, bool withdrawn, bool refunded, bytes32 preimage)

func (*HtlcSession) NewContract

func (_Htlc *HtlcSession) NewContract(_receiver common.Address, _hashlock [32]byte, _timelock *big.Int) (*types.Transaction, error)

NewContract is a paid mutator transaction binding the contract method 0x335ef5bd.

Solidity: function newContract(address _receiver, bytes32 _hashlock, uint256 _timelock) returns(bytes32 contractId)

func (*HtlcSession) Refund

func (_Htlc *HtlcSession) Refund(_contractId [32]byte) (*types.Transaction, error)

Refund is a paid mutator transaction binding the contract method 0x7249fbb6.

Solidity: function refund(bytes32 _contractId) returns(bool)

func (*HtlcSession) Withdraw

func (_Htlc *HtlcSession) Withdraw(_contractId [32]byte, _preimage [32]byte) (*types.Transaction, error)

Withdraw is a paid mutator transaction binding the contract method 0x63615149.

Solidity: function withdraw(bytes32 _contractId, bytes32 _preimage) returns(bool)

type HtlcTransactor

type HtlcTransactor struct {
	// contains filtered or unexported fields
}

HtlcTransactor is an auto generated write-only Go binding around an Ethereum contract.

func NewHtlcTransactor

func NewHtlcTransactor(address common.Address, transactor bind.ContractTransactor) (*HtlcTransactor, error)

NewHtlcTransactor creates a new write-only instance of Htlc, bound to a specific deployed contract.

func (*HtlcTransactor) NewContract

func (_Htlc *HtlcTransactor) NewContract(opts *bind.TransactOpts, _receiver common.Address, _hashlock [32]byte, _timelock *big.Int) (*types.Transaction, error)

NewContract is a paid mutator transaction binding the contract method 0x335ef5bd.

Solidity: function newContract(address _receiver, bytes32 _hashlock, uint256 _timelock) returns(bytes32 contractId)

func (*HtlcTransactor) Refund

func (_Htlc *HtlcTransactor) Refund(opts *bind.TransactOpts, _contractId [32]byte) (*types.Transaction, error)

Refund is a paid mutator transaction binding the contract method 0x7249fbb6.

Solidity: function refund(bytes32 _contractId) returns(bool)

func (*HtlcTransactor) Withdraw

func (_Htlc *HtlcTransactor) Withdraw(opts *bind.TransactOpts, _contractId [32]byte, _preimage [32]byte) (*types.Transaction, error)

Withdraw is a paid mutator transaction binding the contract method 0x63615149.

Solidity: function withdraw(bytes32 _contractId, bytes32 _preimage) returns(bool)

type HtlcTransactorRaw

type HtlcTransactorRaw struct {
	Contract *HtlcTransactor // Generic write-only contract binding to access the raw methods on
}

HtlcTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract.

func (*HtlcTransactorRaw) Transact

func (_Htlc *HtlcTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error)

Transact invokes the (paid) contract method with params as input values.

func (*HtlcTransactorRaw) Transfer

func (_Htlc *HtlcTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error)

Transfer initiates a plain transaction to move funds to the contract, calling its default method if one is available.

type HtlcTransactorSession

type HtlcTransactorSession struct {
	Contract     *HtlcTransactor   // Generic contract transactor binding to set the session for
	TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
}

HtlcTransactorSession is an auto generated write-only Go binding around an Ethereum contract, with pre-set transact options.

func (*HtlcTransactorSession) NewContract

func (_Htlc *HtlcTransactorSession) NewContract(_receiver common.Address, _hashlock [32]byte, _timelock *big.Int) (*types.Transaction, error)

NewContract is a paid mutator transaction binding the contract method 0x335ef5bd.

Solidity: function newContract(address _receiver, bytes32 _hashlock, uint256 _timelock) returns(bytes32 contractId)

func (*HtlcTransactorSession) Refund

func (_Htlc *HtlcTransactorSession) Refund(_contractId [32]byte) (*types.Transaction, error)

Refund is a paid mutator transaction binding the contract method 0x7249fbb6.

Solidity: function refund(bytes32 _contractId) returns(bool)

func (*HtlcTransactorSession) Withdraw

func (_Htlc *HtlcTransactorSession) Withdraw(_contractId [32]byte, _preimage [32]byte) (*types.Transaction, error)

Withdraw is a paid mutator transaction binding the contract method 0x63615149.

Solidity: function withdraw(bytes32 _contractId, bytes32 _preimage) returns(bool)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL