Documentation ¶
Index ¶
- func NewDefaultConfig(network types.Network) types.POSClientConfig
- type BaseToken
- type ChildClient
- type Client
- func (client *Client) BuildPayloadForExit(ctx context.Context, txHash common.Hash, eventSignature string, index int) ([]byte, error)
- func (client *Client) DepositEtherFor(ctx context.Context, amount *big.Int, txOption *types.TxOption) (common.Hash, error)
- func (client *Client) ERC20(address common.Address, networkType types.NetworkType) *ERC20
- func (client *Client) ERC721(address common.Address, networkType types.NetworkType) *ERC721
- func (client *Client) ExitEther(ctx context.Context, txHash common.Hash, txOption *types.TxOption) (common.Hash, error)
- func (client *Client) IsCheckPointed(ctx context.Context, txHash common.Hash) (bool, error)
- func (client *Client) Logger() *types.Logger
- type ERC20
- func (erc20 *ERC20) Allowance(ctx context.Context, owner, spender common.Address) (*big.Int, error)
- func (erc20 *ERC20) Approve(ctx context.Context, spender common.Address, amount *big.Int, ...) (common.Hash, error)
- func (erc20 *ERC20) ApproveMax(ctx context.Context, spender common.Address, txOption *types.TxOption) (common.Hash, error)
- func (erc20 *ERC20) BalanceOf(ctx context.Context, address common.Address) (*big.Int, error)
- func (erc20 *ERC20) Deposit(ctx context.Context, amount *big.Int, txOption *types.TxOption) (common.Hash, error)
- func (erc20 *ERC20) Exit(ctx context.Context, txHash common.Hash, txOption *types.TxOption) (common.Hash, error)
- func (erc20 *ERC20) Withdraw(ctx context.Context, amount *big.Int, txOption *types.TxOption) (common.Hash, error)
- type ERC721
- func (erc721 *ERC721) Approve(ctx context.Context, spender common.Address, tokenId *big.Int, ...) (common.Hash, error)
- func (erc721 *ERC721) ApproveAll(ctx context.Context, spender common.Address, txOption *types.TxOption) (common.Hash, error)
- func (erc721 *ERC721) Deposit(ctx context.Context, tokenId *big.Int, txOption *types.TxOption) (common.Hash, error)
- func (erc721 *ERC721) DepositMany(ctx context.Context, tokenIds []*big.Int, txOption *types.TxOption) (common.Hash, error)
- func (erc721 *ERC721) Exit(ctx context.Context, txHash common.Hash, txOption *types.TxOption) (common.Hash, error)
- func (erc721 *ERC721) ExitMany(ctx context.Context, txHash common.Hash, txOption *types.TxOption) (common.Hash, error)
- func (erc721 *ERC721) IsApproved(ctx context.Context, tokenId *big.Int) (bool, error)
- func (erc721 *ERC721) IsApprovedAll(ctx context.Context, address common.Address) (bool, error)
- func (erc721 *ERC721) Withdraw(ctx context.Context, tokenId *big.Int, txOption *types.TxOption) (common.Hash, error)
- func (erc721 *ERC721) WithdrawMany(ctx context.Context, tokenIds []*big.Int, txOption *types.TxOption) (common.Hash, error)
- type RootClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDefaultConfig ¶ added in v0.1.0
func NewDefaultConfig(network types.Network) types.POSClientConfig
Types ¶
type BaseToken ¶ added in v0.0.9
type BaseToken struct {
// contains filtered or unexported fields
}
func (*BaseToken) PredicateAddress ¶ added in v0.0.9
type ChildClient ¶
func NewChildClient ¶
func NewChildClient(config types.POSClientConfig) (*ChildClient, error)
func (*ChildClient) Logger ¶
func (child *ChildClient) Logger() *types.Logger
func (*ChildClient) Rpc ¶
func (child *ChildClient) Rpc() *rpc.Client
type Client ¶
type Client struct { Child *ChildClient Root *RootClient // contains filtered or unexported fields }
func (*Client) BuildPayloadForExit ¶
func (*Client) DepositEtherFor ¶
func (*Client) IsCheckPointed ¶
type ERC20 ¶
type ERC20 struct {
*BaseToken
}
func (*ERC20) Approve ¶
func (erc20 *ERC20) Approve(ctx context.Context, spender common.Address, amount *big.Int, txOption *types.TxOption) (common.Hash, error)
Approve : approve to spender, when spender is zero address, approve to predicate address
func (*ERC20) ApproveMax ¶ added in v0.0.3
func (erc20 *ERC20) ApproveMax(ctx context.Context, spender common.Address, txOption *types.TxOption) (common.Hash, error)
ApproveMax : approve max to spender, when spender is zero address, approve to predicate address
type ERC721 ¶ added in v0.0.9
type ERC721 struct {
*BaseToken
}
func (*ERC721) ApproveAll ¶ added in v0.0.9
func (*ERC721) DepositMany ¶ added in v0.0.9
func (*ERC721) IsApproved ¶ added in v0.0.9
func (*ERC721) IsApprovedAll ¶ added in v0.0.9
type RootClient ¶
func NewRootClient ¶
func NewRootClient(config types.POSClientConfig) (*RootClient, error)
func (*RootClient) GetLastChildBlock ¶
func (*RootClient) GetRootBlockInfo ¶
func (root *RootClient) GetRootBlockInfo(ctx context.Context, txBlockNumber *big.Int) (types.RootBlockInfo, error)
func (*RootClient) Logger ¶
func (root *RootClient) Logger() *types.Logger
func (*RootClient) Rpc ¶
func (root *RootClient) Rpc() *rpc.Client
Click to show internal directories.
Click to hide internal directories.