eth

package
v0.0.0-...-cb3ca1d Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2019 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// PSC logs.
	EthDigestChannelCreated      = "a6153987181667023837aee39c3f1a702a16e5e146323ef10fb96844a526143c"
	EthDigestChannelToppedUp     = "a3b2cd532a9050531ecc674928d7704894707ede1a436bfbee86b96b83f2a5ce"
	EthChannelCloseRequested     = "b40564b1d36572b2942ad7cfc5a5a967f3ef08c82163a910dee760c5b629a32e"
	EthOfferingCreated           = "32c1913dfde418197923027c2f2260f19903a2e86a93ed83c4689ac91a96bafd"
	EthOfferingDeleted           = "c3013cd9dd5c33b95a9cc1bc076481c9a6a1970be6d7f1ed33adafad6e57d3d6"
	EthOfferingEndpoint          = "450e7ab61f9e1c40dd7c79edcba274a7a96f025fab1733b3fa1087a1b5d1db7d"
	EthOfferingPoppedUp          = "c37352067a3ca1eafcf2dc5ba537fc473509c4e4aaca729cb1dab7053ec1ffbf"
	EthCooperativeChannelClose   = "b488ea0f49970f556cf18e57588e78dcc1d3fd45c71130aa5099a79e8b06c8e7"
	EthUncooperativeChannelClose = "7418f9b30b6de272d9d54ee6822f674042c58cea183b76d5d4e7b3c933a158f6"

	// PTC logs.
	EthTokenApproval = "8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925"
	EthTokenTransfer = "ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"
)

Contract events digests. Please, see this article for the details: https://codeburst.io/deep-dive-into-ethereum-logs-a8d2047c7371

View Source
const (
	BlockLatest = "latest"
)

Block labels.

Variables

This section is empty.

Functions

func BalanceClosingHash

func BalanceClosingHash(clientAddr, pscAddr common.Address, block uint32,
	offeringHash common.Hash, balance *big.Int) []byte

BalanceClosingHash computes balance message hash.

func BalanceProofHash

func BalanceProofHash(pscAddr, agentAddr common.Address, block uint32,
	offeringHash common.Hash, balance *big.Int) []byte

BalanceProofHash implementes hash as in psc contract.

func NewAddress

func NewAddress(addrHex string) (addr common.Address, err error)

NewAddress returns ethereum's common.Address from given hex string.

Types

type BlockNumberAPIResponse

type BlockNumberAPIResponse struct {
	Result string `json:"result"`
	// contains filtered or unexported fields
}

BlockNumberAPIResponse implements wrapper for ethereum JSON RPC API response. Please see corresponding web3.js method for the details.

type ChannelCloseRequestedEvent

type ChannelCloseRequestedEvent struct {
	Client          common.Address // Indexed.
	Agent           common.Address // Indexed.
	OfferingHash    *Uint256       // Indexed.
	OpenBlockNumber *Uint256
	Balance         *Uint192
}

ChannelCloseRequestedEvent implements wrapper for contract event. Please see contract implementation for the details.

func NewChannelCloseRequestedEvent

func NewChannelCloseRequestedEvent(topics [4]string, hexData string) (*ChannelCloseRequestedEvent, error)

NewChannelCloseRequestedEvent creates event of type ChannelCloseRequestedEvent. Please see contract implementation for the details.

func (*ChannelCloseRequestedEvent) Digest

func (e *ChannelCloseRequestedEvent) Digest() string

Digest returns keccak512 hash sum of the event signature.

type ChannelCreatedEvent

type ChannelCreatedEvent struct {
	Agent             common.Address // Indexed.
	Client            common.Address // Indexed.
	OfferingHash      *Uint256       // Indexed.
	Deposit           *Uint192
	AuthenticatedHash *Uint256
}

ChannelCreatedEvent implements wrapper for contract event. Please see contract implementation for the details.

func NewChannelCreatedEvent

func NewChannelCreatedEvent(topics [4]string, hexData string) (*ChannelCreatedEvent, error)

NewChannelCreatedEvent creates event of type ChannelCreatedEvent. Please see contract implementation for the details.

func (*ChannelCreatedEvent) Digest

func (e *ChannelCreatedEvent) Digest() string

Digest returns keccak512 hash sum of the event signature.

type ChannelToppedUpEvent

type ChannelToppedUpEvent struct {
	Agent           common.Address // Indexed.
	Client          common.Address // Indexed.
	OfferingHash    *Uint256       // Indexed.
	OpenBlockNumber *Uint256
	AddedDeposit    *Uint192
}

ChannelToppedUpEvent implements wrapper for contract event. Please see contract implementation for the details.

func NewChannelToppedUpEvent

func NewChannelToppedUpEvent(topics [4]string, hexData string) (*ChannelToppedUpEvent, error)

NewChannelToppedUpEvent creates event of type ChannelToppedUpEvent. Please see contract implementation for the details.

func (*ChannelToppedUpEvent) Digest

func (e *ChannelToppedUpEvent) Digest() string

Digest returns keccak512 hash sum of the event signature.

type CooperativeChannelCloseEvent

type CooperativeChannelCloseEvent struct {
	Agent           common.Address // Indexed.
	Client          common.Address // Indexed.
	OfferingHash    *Uint256       // Indexed.
	OpenBlockNumber *Uint256
	Balance         *Uint192
}

CooperativeChannelCloseEvent implements wrapper for contract event. Please see contract implementation for the details.

func NewCooperativeChannelCloseEvent

func NewCooperativeChannelCloseEvent(topics [4]string, hexData string) (*CooperativeChannelCloseEvent, error)

NewCooperativeChannelCloseEvent creates event of type CooperativeChannelCloseEvent. Please see contract implementation for the details.

func (*CooperativeChannelCloseEvent) Digest

Digest returns keccak512 hash sum of the event signature.

type EthereumClient

type EthereumClient struct {
	GethURL string
	// contains filtered or unexported fields
}

EthereumClient implementation of client logic for the ethereum geth node. Uses JSON RPC API of geth for communication with remote node.

func NewEthereumClient

func NewEthereumClient(gethURL string) *EthereumClient

NewEthereumClient creates and returns instance of client for remote ethereum node, that is available via specified host and port.

func (*EthereumClient) GetBlockNumber

func (e *EthereumClient) GetBlockNumber() (*BlockNumberAPIResponse, error)

GetBlockNumber returns the number of most recent block in blockchain. For the details, please, refer to: https://ethereumbuilders.gitbooks.io/guide/content/en/ethereum_json_rpc.html#eth_blocknumber

type Event

type Event interface {
	Digest() string
}

Event received from the ethereum block-chain.

type OfferingCreatedEvent

type OfferingCreatedEvent struct {
	Agent         common.Address // Indexed.
	OfferingHash  *Uint256       // Indexed.
	MinDeposit    *Uint192
	CurrentSupply *Uint256
}

OfferingCreatedEvent implements wrapper for contract event. Please see contract implementation for the details.

func NewOfferingCreatedEvent

func NewOfferingCreatedEvent(topics [4]string, hexData string) (*OfferingCreatedEvent, error)

NewOfferingCreatedEvent creates event of type OfferingCreatedEvent. Please see contract implementation for the details.

func (*OfferingCreatedEvent) Digest

func (e *OfferingCreatedEvent) Digest() string

Digest returns keccak512 hash sum of the event signature.

type OfferingDeletedEvent

type OfferingDeletedEvent struct {
	Agent        common.Address // Indexed.
	OfferingHash *Uint256       // Indexed.
}

OfferingDeletedEvent implements wrapper for contract event. Please see contract implementation for the details.

func NewOfferingDeletedEvent

func NewOfferingDeletedEvent(topics [3]string) (*OfferingDeletedEvent, error)

NewOfferingDeletedEvent creates event of type OfferingDeletedEvent.. Please see contract implementation for the details.

func (*OfferingDeletedEvent) Digest

func (e *OfferingDeletedEvent) Digest() string

Digest returns keccak512 hash sum of the event signature.

type OfferingEndpointEvent

type OfferingEndpointEvent struct {
	Agent           common.Address // Indexed.
	Client          common.Address // Indexed.
	OfferingHash    *Uint256       // Indexed.
	OpenBlockNumber *Uint256
	EndpointHash    *Uint256
}

OfferingEndpointEvent implements wrapper for contract event. Please see contract implementation for the details.

func NewOfferingEndpointEvent

func NewOfferingEndpointEvent(topics [4]string, hexData string) (*OfferingEndpointEvent, error)

NewOfferingEndpointEvent creates event of type OfferingEndpointEvent. Please see contract implementation for the details.

func (*OfferingEndpointEvent) Digest

func (e *OfferingEndpointEvent) Digest() string

Digest returns keccak512 hash sum of the event signature.

type OfferingPoppedUpEvent

type OfferingPoppedUpEvent struct {
	Agent        common.Address // Indexed.
	OfferingHash *Uint256       // Indexed.
}

OfferingPoppedUpEvent implements wrapper for contract event. Please see contract implementation for the details.

func NewOfferingPoppedUpEvent

func NewOfferingPoppedUpEvent(topics [3]string) (*OfferingPoppedUpEvent, error)

NewOfferingPoppedUpEvent creates event of type OfferingPoppedUpEvent. Please see contract implementation for the details.

func (*OfferingPoppedUpEvent) Digest

func (e *OfferingPoppedUpEvent) Digest() string

Digest returns keccak512 hash sum of the event signature.

type Uint192

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

func NewUint192

func NewUint192(hexRepresentation string) (*Uint192, error)

func (*Uint192) String

func (i *Uint192) String() string

func (*Uint192) ToBigInt

func (i *Uint192) ToBigInt() *big.Int

type Uint256

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

func NewUint256

func NewUint256(hexRepresentation string) (*Uint256, error)

func (*Uint256) String

func (i *Uint256) String() string

func (*Uint256) ToBigInt

func (i *Uint256) ToBigInt() *big.Int

type UncooperativeChannelCloseEvent

type UncooperativeChannelCloseEvent struct {
	Agent           common.Address // Indexed.
	Client          common.Address // Indexed.
	OfferingHash    *Uint256       // Indexed.
	OpenBlockNumber *Uint256
	Balance         *Uint192
}

UncooperativeChannelCloseEvent implements wrapper for contract event. Please see contract implementation for the details.

func NewUnCooperativeChannelCloseEvent

func NewUnCooperativeChannelCloseEvent(topics [4]string, hexData string) (*UncooperativeChannelCloseEvent, error)

NewUnCooperativeChannelCloseEvent creates event of type NewUnCooperativeChannelCloseEvent. Please see contract implementation for the details.

func (*UncooperativeChannelCloseEvent) Digest

Digest returns keccak512 hash sum of the event signature.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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