ethereum

package
v0.0.0-...-bda6563 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2023 License: MIT Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HexStringToByte32Array

func HexStringToByte32Array(str string) ([32]byte, error)

Types

type BaseTokenSession

type BaseTokenSession struct {
	generated.BaseTokenSession
	// contains filtered or unexported fields
}

func (*BaseTokenSession) Address

func (ts *BaseTokenSession) Address() common.Address

func (*BaseTokenSession) ApproveSync

func (ts *BaseTokenSession) ApproveSync(spender common.Address, value *big.Int) (*types.Transaction, error)

func (*BaseTokenSession) GetLastTransferValueSync

func (ts *BaseTokenSession) GetLastTransferValueSync(ctx context.Context, signedTx *types.Transaction) (*big.Int, error)

func (*BaseTokenSession) MintRaw

func (ts *BaseTokenSession) MintRaw(to common.Address, amount *big.Int) (*types.Transaction, error)

MintRaw is an experimental way of minting new tokens. It attempts to execute an on-chain transaction that runs a Yul script which loops over the "faucet" method until either of the following happens:

  1. the target balance is reached,
  2. the caller runs out of gas.

Use this method only if the "mint" contract method is not available, or a non-owner account is the caller.

func (*BaseTokenSession) MintRawSync

func (ts *BaseTokenSession) MintRawSync(ctx context.Context, to common.Address, amount *big.Int) (*big.Int, error)

MintRawSync is an experimental way of minting new tokens. It attempts to execute an on-chain transaction that runs a Yul script which loops over the "faucet" method until either of the following happens:

  1. the target balance is reached,
  2. the caller runs out of gas.

Use this method only if the "mint" contract method is not available, or a non-owner account is the caller. The execution time is very slow so the (context) timeout for it should be higher than for other methods.

func (*BaseTokenSession) MintSync

func (ts *BaseTokenSession) MintSync(to common.Address, amount *big.Int) (*types.Transaction, error)

func (*BaseTokenSession) TransferFromSync

func (ts *BaseTokenSession) TransferFromSync(sender common.Address, recipient common.Address, value *big.Int) (*types.Transaction, error)

func (*BaseTokenSession) TransferSync

func (ts *BaseTokenSession) TransferSync(recipient common.Address, value *big.Int) (*types.Transaction, error)

type Client

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

func NewClient

func NewClient(ctx context.Context, ethereumAddress string) (*Client, error)

func (*Client) NewBaseTokenSession

func (ec *Client) NewBaseTokenSession(
	ctx context.Context,
	contractOwnerPrivateKey string,
	tokenAddress common.Address,
	syncTimeout *time.Duration,
) (*BaseTokenSession, error)

func (*Client) NewERC20BridgeSession

func (ec *Client) NewERC20BridgeSession(
	ctx context.Context,
	contractOwnerPrivateKey string,
	bridgeAddress common.Address,
	syncTimeout *time.Duration,
) (*ERC20BridgeSession, error)

func (*Client) NewStakingBridgeSession

func (ec *Client) NewStakingBridgeSession(
	ctx context.Context,
	contractOwnerPrivateKey string,
	bridgeAddress common.Address,
	syncTimeout *time.Duration,
) (*StakingBridgeSession, error)

type ERC20BridgeSession

type ERC20BridgeSession struct {
	generated.ERC20BridgeSession
	// contains filtered or unexported fields
}

func (ERC20BridgeSession) Address

func (bs ERC20BridgeSession) Address() common.Address

func (ERC20BridgeSession) DepositAssetSync

func (bs ERC20BridgeSession) DepositAssetSync(asset_source common.Address, amount *big.Int, vega_public_key [32]byte) (*types.Transaction, error)

type StakingBridgeSession

type StakingBridgeSession struct {
	generated.StakingBridgeSession
	// contains filtered or unexported fields
}

func (StakingBridgeSession) Address

func (ss StakingBridgeSession) Address() common.Address

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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