Documentation ¶
Index ¶
- func Build(rtx RootchainTransaction) error
- func Options(rtx RootchainTransaction, t *bind.TransactOpts) error
- func Submit(rtx RootchainTransaction) (*types.Transaction, error)
- type Client
- type DepositBuilder
- type DepositTransaction
- type ExitBinder
- type PlasmaFrameworkBinder
- type ProcessExitOption
- type ProcessExitOptions
- type ProcessExitTransaction
- type RootchainTransaction
- type StandardExitTransaction
- func (s *StandardExitTransaction) Build() error
- func (c *StandardExitTransaction) GetStandardExitBond(opts *bind.CallOpts) (*big.Int, error)
- func (s *StandardExitTransaction) Options(t *bind.TransactOpts) error
- func (s *StandardExitTransaction) Submit() (*types.Transaction, error)
- func (s *StandardExitTransaction) Utxo(sed StandardExitUTXOData) error
- type StandardExitUTXOData
- type VaultBinder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Build ¶
func Build(rtx RootchainTransaction) error
Build is a wrapper function that takes any transaction that satisfies RootchainTransaction interface and dispatch Build on it
func Options ¶
func Options(rtx RootchainTransaction, t *bind.TransactOpts) error
Options is a wrapper function that takes any transaction that satisfies RootchainTransaction interface and dispatch Opt on it
func Submit ¶
func Submit(rtx RootchainTransaction) (*types.Transaction, error)
Submit is a wrapper function that takes any transaction that satisfies RootchainTransaction interface and dispatch Submit on it
Types ¶
type Client ¶
type Client struct {
bind.ContractBackend
}
Client defines a struct that can read and write to a contract
func NewClient ¶
func NewClient(ethclient bind.ContractBackend) *Client
NewClient initializes new root chain client
func (*Client) NewDeposit ¶
func (c *Client) NewDeposit(vaultAddress, owner, currency common.Address, amount string) *DepositTransaction
NewDeposit is a method on root chain client that create a new deposit
func (*Client) NewProcessExit ¶
func (c *Client) NewProcessExit(setters ...ProcessExitOption) *ProcessExitTransaction
NewProcessExit is a method on root chain client that returns a new instance of process exit transaction
func (*Client) NewStandardExit ¶
func (c *Client) NewStandardExit(vaultAddress common.Address) *StandardExitTransaction
NewStandardExit is a method on the root chain client that creates new standard payment exit
type DepositBuilder ¶
DepositBuilder is a function that builds an RLP input from a set of inputs TODO clean up transaction builder signature to return a curried function instead form a deposit transaction
type DepositTransaction ¶
type DepositTransaction struct { *bind.TransactOpts bind.ContractBackend VaultAddress common.Address Amount string Owner common.Address Currency common.Address VaultBinder VaultBinder Builder DepositBuilder RlpTransaction []byte }
DepositTransaction is a collection of functions and data needed to make a deposit transaction on the root chain
func (*DepositTransaction) Build ¶
func (d *DepositTransaction) Build() error
Bulid is a method on DepositTransaction that encodes the transaction to RLP with the RLP Builder
func (*DepositTransaction) Options ¶
func (d *DepositTransaction) Options(t *bind.TransactOpts) error
Options is a method on DepositTransaction that set root chain transaction options
func (*DepositTransaction) Submit ¶
func (d *DepositTransaction) Submit() (*types.Transaction, error)
Submit is a method on DepositTransaction that calls a deposit on the root chain vault
type ExitBinder ¶
type ExitBinder func(common.Address, bind.ContractBackend) (*abi.PaymentExitgame, error)
ExitBinder binds the go code to a payment exit game contract on the root chain
type PlasmaFrameworkBinder ¶
type PlasmaFrameworkBinder func(common.Address, bind.ContractBackend) (*abi.PlasmaFramework, error)
PlasmaFrameworkBinder binds the go code to a plasma framework contract on the root chain TODO: make binder return struct a more generic reusable contract
type ProcessExitOption ¶
type ProcessExitOption func(*ProcessExitOptions)
ProcessExitOption is a functional option that performs an operation on ProcessExitOptions
func NumberOfExits ¶
func NumberOfExits(no string) ProcessExitOption
NumberOfExits sets the number of exits to process to process exit option
func PlasmaAddress ¶
func PlasmaAddress(address common.Address) ProcessExitOption
PlasmaAddress sets the plasma contract address to process exit option
func TokenAddress ¶
func TokenAddress(address common.Address) ProcessExitOption
TokenAddress sets the token address to process exit option
func TopExit ¶
func TopExit(te string) ProcessExitOption
TopExit sets the top exit to process to process exit option
func VaultId ¶
func VaultId(vid string) ProcessExitOption
VaultId sets the vault ID to process exit option
type ProcessExitOptions ¶
type ProcessExitOptions struct { PlasmaAddress common.Address TokenAddress common.Address VaultId string TopExit string NumberOfExits string }
ProcessExitOptions holds the input data required to make a process exit
type ProcessExitTransaction ¶
type ProcessExitTransaction struct { *bind.TransactOpts bind.ContractBackend *ProcessExitOptions PlasmaFrameworkBinder PlasmaFrameworkBinder }
ProcessExitTransaction is a collection of functions and data needed to make a process exit transaction on the root chain
func (*ProcessExitTransaction) Build ¶
func (p *ProcessExitTransaction) Build() error
Option is a method on ProcessExitTransaction that builds process exit transaction
func (*ProcessExitTransaction) Options ¶
func (p *ProcessExitTransaction) Options(t *bind.TransactOpts) error
Option is a method on ProcessExitTransaction set root chain transaction options for process exit transaction
func (*ProcessExitTransaction) Submit ¶
func (p *ProcessExitTransaction) Submit() (*types.Transaction, error)
Submit makes a root chain process exit call on the contract with given arguement
type RootchainTransaction ¶
type RootchainTransaction interface { Submit() (*types.Transaction, error) Build() error Options(*bind.TransactOpts) error }
RootChainTransaction is an interface for a write operations on the root chain contract
type StandardExitTransaction ¶
type StandardExitTransaction struct { *bind.TransactOpts bind.ContractBackend ExitGameAddress common.Address ExitBinder ExitBinder Proof []byte TxBytes []byte UtxoPos *big.Int UtxoData StandardExitUTXOData }
StandardExitTransaction is a collection of functions and data needed to make a payment exit transaction on the root chain
func (*StandardExitTransaction) Build ¶
func (s *StandardExitTransaction) Build() error
Build is a method on StandardExitTransaction that deserialize transaction txbytes and proofs to golang bytes
func (*StandardExitTransaction) GetStandardExitBond ¶
GetStandardExitBond is a method on StandardExitTransaction that gets standard exit bond
func (*StandardExitTransaction) Options ¶
func (s *StandardExitTransaction) Options(t *bind.TransactOpts) error
Options is a method on StandardExitTransaction that sets root chain transaction options
func (*StandardExitTransaction) Submit ¶
func (s *StandardExitTransaction) Submit() (*types.Transaction, error)
Submit is a method on StandardExitTransaction that calls standard exit on the root chain contract
func (*StandardExitTransaction) Utxo ¶
func (s *StandardExitTransaction) Utxo(sed StandardExitUTXOData) error
Utxo is a method on StandardExitTransaction that sets UTXO data returned from /utxo.get_exit_data to standard exit
type StandardExitUTXOData ¶
type StandardExitUTXOData struct { Version string `json:"version"` Success bool `json:"success"` Data struct { UtxoPos *big.Int `json:"utxo_pos"` Txbytes string `json:"txbytes"` Proof string `json:"proof"` } `json:"data"` }
StandardExitUTXOData is a returned data from calling /utxo.get_exit_data from the watcher, the data is required to start a standard exit on the utxo
func GetUTXOExitData ¶
func GetUTXOExitData(watcher string, utxoPosition int) (StandardExitUTXOData, error)
GetUTXOExitData is a helper function to retrieve the UTXO exit data from a given UTXO position
type VaultBinder ¶
VaultBinder binds the go code to an Ethvault contract on the root chain TODO implement vault binder for ERC20