Documentation ¶
Index ¶
- type Channel
- type Channels
- func (c *Channels) Call(methodName string, v ...interface{}) interface{}
- func (c *Channels) ChannelId(from, to common.Address) common.Hash
- func (c *Channels) Claim(signer common.Address, from, to common.Address, nonce uint64, amount *big.Int, ...) (*types.Transaction, error)
- func (c *Channels) Exists(from, to common.Address) bool
- func (c *Channels) NewChannel(key *ecdsa.PrivateKey, to common.Address, amount, price *big.Int, ...) (*types.Transaction, error)
- func (c *Channels) Nonce(from, to common.Address) *big.Int
- func (c *Channels) Price(from, to common.Address) *big.Int
- func (c *Channels) Stop()
- func (c *Channels) ValidateSig(from, to common.Address, nonce uint64, amount *big.Int, sig []byte) bool
- func (c *Channels) Verify(from, to common.Address, nonce uint64, amount *big.Int, sig []byte) (bool, bool)
- type Cheque
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Channel ¶
func NewChannel ¶
NewChannel returns a new payment channel.
type Channels ¶
type Channels struct {
// contains filtered or unexported fields
}
Channels is the channels contract reflecting that on the ethereum network. The channels contract handles all validation and verifications of payments and allows you to redeem cheques.
Channels implements the proxy.Verifier and proxy.Charges interfaces.
func Fetch ¶
Fetch initialises a new abi and returns the contract. It does not deploy the contract, hence the name.
func (*Channels) ChannelId ¶
ChannelId returns the canonical channel name for transactor and beneficiary
func (*Channels) Claim ¶
func (c *Channels) Claim(signer common.Address, from, to common.Address, nonce uint64, amount *big.Int, sig []byte) (*types.Transaction, error)
Claim redeems a given signature using the canonical channel. It creates an Ethereum transaction and submits it to the Ethereum network.
Chaim returns the unsigned transaction and an error if it failed.
func (*Channels) Exists ¶
Exists returns whether there exists a channel between transactor and beneficiary.
func (*Channels) NewChannel ¶
func (c *Channels) NewChannel(key *ecdsa.PrivateKey, to common.Address, amount, price *big.Int, cb func(*Channel)) (*types.Transaction, error)
Start Go API. Not important for this version
func (*Channels) ValidateSig ¶
func (c *Channels) ValidateSig(from, to common.Address, nonce uint64, amount *big.Int, sig []byte) bool
Validate validates the ECDSA (curve=secp256k1) signature with the given input where H=KECCAK(from, to, amount) and the validation must satisfy: channel_owner == ECRECOVER(H, S) where S is the given signature signed by the sender.