Documentation ¶
Index ¶
- type Client
- type Config
- type NetworkSID
- type NodeClient
- func (c NodeClient) ApproveERC20(ctx context.Context, erc20Addr, spender common.Address, amount *big.Int, ...) error
- func (c NodeClient) DeployERC20(ctx context.Context, name, symbol string, auth *bind.TransactOpts, ...) (common.Address, error)
- func (c NodeClient) GetChainID(ctx context.Context, network NetworkSID) (*big.Int, error)
- func (c NodeClient) MintERC20(ctx context.Context, erc20Addr common.Address, amount *big.Int, ...) error
- func (c NodeClient) SendBridgeAsset(ctx context.Context, tokenAddr common.Address, amount *big.Int, ...) error
- func (c NodeClient) SendBridgeMessage(ctx context.Context, destNetwork uint32, destAddr common.Address, ...) error
- func (c NodeClient) SendClaim(ctx context.Context, deposit *pb.Deposit, ...) error
- type RestClient
- func (c RestClient) GetBridge(networkID uint32, depositCnt uint64) (*pb.Deposit, error)
- func (c RestClient) GetBridges(destAddr string, offset, limit uint) ([]*pb.Deposit, uint64, error)
- func (c RestClient) GetClaims(destAddr string, offset, limit uint) ([]*pb.Claim, uint64, error)
- func (c RestClient) GetMerkleProof(networkID uint32, depositCnt uint64) (*pb.Proof, error)
- func (c RestClient) GetVersion() (string, error)
- func (c RestClient) GetWrappedToken(origNet uint32, origTokenAddr string) (*pb.TokenWrapped, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { L1NodeURL string `mapstructure:"L1NodeURL"` L2NodeURL string `mapstructure:"L2NodeURL"` BridgeURL string `mapstructure:"BridgeURL"` L1BridgeAddr common.Address `mapstructure:"L1BridgeAddr"` L2BridgeAddr common.Address `mapstructure:"L2BridgeAddr"` }
Config is a client config
type NodeClient ¶
type NodeClient struct {
// contains filtered or unexported fields
}
NodeClient is for the ethclient.
func (NodeClient) ApproveERC20 ¶
func (c NodeClient) ApproveERC20(ctx context.Context, erc20Addr, spender common.Address, amount *big.Int, auth *bind.TransactOpts, network NetworkSID) error
ApproveERC20 approves erc20 tokens.
func (NodeClient) DeployERC20 ¶
func (c NodeClient) DeployERC20(ctx context.Context, name, symbol string, auth *bind.TransactOpts, network NetworkSID) (common.Address, error)
DeployERC20 deploys erc20 smc.
func (NodeClient) GetChainID ¶
func (c NodeClient) GetChainID(ctx context.Context, network NetworkSID) (*big.Int, error)
GetChainID returns a chain ID of the dedicated node.
func (NodeClient) MintERC20 ¶
func (c NodeClient) MintERC20(ctx context.Context, erc20Addr common.Address, amount *big.Int, auth *bind.TransactOpts, network NetworkSID) error
MintERC20 mint erc20 tokens.
func (NodeClient) SendBridgeAsset ¶
func (c NodeClient) SendBridgeAsset(ctx context.Context, tokenAddr common.Address, amount *big.Int, destNetwork uint32, destAddr *common.Address, metadata []byte, auth *bind.TransactOpts, network NetworkSID, ) error
SendBridgeAsset sends a bridge asset transaction.
func (NodeClient) SendBridgeMessage ¶
func (c NodeClient) SendBridgeMessage(ctx context.Context, destNetwork uint32, destAddr common.Address, metadata []byte, auth *bind.TransactOpts, network NetworkSID, ) error
SendBridgeMessage sends a bridge message transaction.
func (NodeClient) SendClaim ¶
func (c NodeClient) SendClaim(ctx context.Context, deposit *pb.Deposit, smtProof, smtRollupProof [mtHeight][32]byte, globalExitRoot *etherman.GlobalExitRoot, auth *bind.TransactOpts, network NetworkSID, ) error
SendClaim send a claim transaction.
type RestClient ¶
type RestClient struct {
// contains filtered or unexported fields
}
RestClient is a client for the rest api.
func NewRestClient ¶
func NewRestClient(url string) *RestClient
NewRestClient creates new rest api client.
func (RestClient) GetBridges ¶
GetBridges returns bridge list for the specific destination address.
func (RestClient) GetMerkleProof ¶
GetMerkleProof returns the merkle proof for the specific bridge transaction.
func (RestClient) GetVersion ¶
func (c RestClient) GetVersion() (string, error)
GetVersion returns the api version.
func (RestClient) GetWrappedToken ¶
func (c RestClient) GetWrappedToken(origNet uint32, origTokenAddr string) (*pb.TokenWrapped, error)
GetWrappedToken returns the wrapped token address.