pos

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

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) Logger added in v0.0.9

func (token *BaseToken) Logger() *types.Logger

func (*BaseToken) PredicateAddress added in v0.0.9

func (token *BaseToken) PredicateAddress() common.Address

type ChildClient

type ChildClient struct {
	*ethclient.Client
	// contains filtered or unexported fields
}

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 NewClient

func NewClient(config types.POSClientConfig) (*Client, error)

func (*Client) BuildPayloadForExit

func (client *Client) BuildPayloadForExit(ctx context.Context, txHash common.Hash, eventSignature string, index int) ([]byte, error)

func (*Client) DepositEtherFor

func (client *Client) DepositEtherFor(ctx context.Context, amount *big.Int, txOption *types.TxOption) (common.Hash, error)

func (*Client) ERC20

func (client *Client) ERC20(address common.Address, networkType types.NetworkType) *ERC20

func (*Client) ERC721 added in v0.0.9

func (client *Client) ERC721(address common.Address, networkType types.NetworkType) *ERC721

func (*Client) ExitEther added in v0.0.9

func (client *Client) ExitEther(ctx context.Context, txHash common.Hash, txOption *types.TxOption) (common.Hash, error)

func (*Client) IsCheckPointed

func (client *Client) IsCheckPointed(ctx context.Context, txHash common.Hash) (bool, error)

func (*Client) Logger

func (client *Client) Logger() *types.Logger

type ERC20

type ERC20 struct {
	*BaseToken
}

func (*ERC20) Allowance added in v0.0.3

func (erc20 *ERC20) Allowance(ctx context.Context, owner, spender common.Address) (*big.Int, error)

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

func (*ERC20) BalanceOf

func (erc20 *ERC20) BalanceOf(ctx context.Context, address common.Address) (*big.Int, error)

func (*ERC20) Deposit added in v0.0.9

func (erc20 *ERC20) Deposit(ctx context.Context, amount *big.Int, txOption *types.TxOption) (common.Hash, error)

func (*ERC20) Exit

func (erc20 *ERC20) Exit(ctx context.Context, txHash common.Hash, txOption *types.TxOption) (common.Hash, error)

func (*ERC20) Withdraw

func (erc20 *ERC20) Withdraw(ctx context.Context, amount *big.Int, txOption *types.TxOption) (common.Hash, error)

type ERC721 added in v0.0.9

type ERC721 struct {
	*BaseToken
}

func (*ERC721) Approve added in v0.0.9

func (erc721 *ERC721) Approve(ctx context.Context, spender common.Address, tokenId *big.Int, txOption *types.TxOption) (common.Hash, error)

func (*ERC721) ApproveAll added in v0.0.9

func (erc721 *ERC721) ApproveAll(ctx context.Context, spender common.Address, txOption *types.TxOption) (common.Hash, error)

func (*ERC721) Deposit added in v0.0.9

func (erc721 *ERC721) Deposit(ctx context.Context, tokenId *big.Int, txOption *types.TxOption) (common.Hash, error)

func (*ERC721) DepositMany added in v0.0.9

func (erc721 *ERC721) DepositMany(ctx context.Context, tokenIds []*big.Int, txOption *types.TxOption) (common.Hash, error)

func (*ERC721) Exit added in v0.0.9

func (erc721 *ERC721) Exit(ctx context.Context, txHash common.Hash, txOption *types.TxOption) (common.Hash, error)

func (*ERC721) ExitMany added in v0.0.9

func (erc721 *ERC721) ExitMany(ctx context.Context, txHash common.Hash, txOption *types.TxOption) (common.Hash, error)

func (*ERC721) IsApproved added in v0.0.9

func (erc721 *ERC721) IsApproved(ctx context.Context, tokenId *big.Int) (bool, error)

func (*ERC721) IsApprovedAll added in v0.0.9

func (erc721 *ERC721) IsApprovedAll(ctx context.Context, address common.Address) (bool, error)

func (*ERC721) Withdraw added in v0.0.9

func (erc721 *ERC721) Withdraw(ctx context.Context, tokenId *big.Int, txOption *types.TxOption) (common.Hash, error)

func (*ERC721) WithdrawMany added in v0.0.9

func (erc721 *ERC721) WithdrawMany(ctx context.Context, tokenIds []*big.Int, txOption *types.TxOption) (common.Hash, error)

type RootClient

type RootClient struct {
	*ethclient.Client
	// contains filtered or unexported fields
}

func NewRootClient

func NewRootClient(config types.POSClientConfig) (*RootClient, error)

func (*RootClient) GetLastChildBlock

func (root *RootClient) GetLastChildBlock(ctx context.Context) (*big.Int, error)

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

Jump to

Keyboard shortcuts

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