ethereum

package
v1.68.4 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2023 License: BSD-3-Clause Imports: 37 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultBlockPeriod = 5000
)

const ...

Variables

This section is empty.

Functions

This section is empty.

Types

type Key

type Key struct {
	ID uuid.UUID // Version 4 "random" for unique id not derived from key data
	// to simplify lookups we also store the address
	Address common.Address
	// we only store privkey as pubkey/address can be derived from it
	// privkey in this struct is always in plaintext
	PrivateKey *ecdsa.PrivateKey
}

Key ...

type Relayer4Ethereum

type Relayer4Ethereum struct {
	// contains filtered or unexported fields
}

Relayer4Ethereum ...

func StartEthereumRelayer

func StartEthereumRelayer(rpcURL2Chain33 string, db dbm.DB, provider, registryAddress string, deploy *ebTypes.Deploy, degree, blockInterval int32) *Relayer4Ethereum

StartEthereumRelayer ///

func (*Relayer4Ethereum) ApproveAllowance

func (ethRelayer *Relayer4Ethereum) ApproveAllowance(ownerPrivateKey, tokenAddr, amount string) (string, error)

ApproveAllowance ...

func (*Relayer4Ethereum) Burn

func (ethRelayer *Relayer4Ethereum) Burn(ownerPrivateKey, tokenAddr, chain33Receiver, amount string) (string, error)

Burn ...

func (*Relayer4Ethereum) BurnAsync

func (ethRelayer *Relayer4Ethereum) BurnAsync(ownerPrivateKey, tokenAddr, chain33Receiver, amount string) (string, error)

BurnAsync ...

func (*Relayer4Ethereum) CreateBridgeToken

func (ethRelayer *Relayer4Ethereum) CreateBridgeToken(symbol string) (string, error)

CreateBridgeToken ...

func (*Relayer4Ethereum) CreateERC20Token

func (ethRelayer *Relayer4Ethereum) CreateERC20Token(symbol string) (string, error)

CreateERC20Token ...

func (*Relayer4Ethereum) DeployContrcts

func (ethRelayer *Relayer4Ethereum) DeployContrcts() (bridgeRegistry string, err error)

DeployContrcts 部署以太坊合约

func (*Relayer4Ethereum) GetAccount

func (ethRelayer *Relayer4Ethereum) GetAccount(passphrase string) (privateKey, addr string, err error)

GetAccount ...

func (*Relayer4Ethereum) GetBalance

func (ethRelayer *Relayer4Ethereum) GetBalance(tokenAddr, owner string) (string, error)

GetBalance :获取某一个币种的余额

func (*Relayer4Ethereum) GetDecimals

func (ethRelayer *Relayer4Ethereum) GetDecimals(tokenAddr string) (uint8, error)

GetDecimals ...

func (*Relayer4Ethereum) GetValidatorAddr

func (ethRelayer *Relayer4Ethereum) GetValidatorAddr() (validators x2ethTypes.ValidatorAddr4EthRelayer, err error)

GetValidatorAddr ...

func (*Relayer4Ethereum) ImportChain33PrivateKey

func (ethRelayer *Relayer4Ethereum) ImportChain33PrivateKey(passphrase, privateKeyStr string) error

ImportChain33PrivateKey ...

func (*Relayer4Ethereum) IsProphecyPending

func (ethRelayer *Relayer4Ethereum) IsProphecyPending(claimID [32]byte) (bool, error)

IsProphecyPending ...

func (*Relayer4Ethereum) IsValidatorActive

func (ethRelayer *Relayer4Ethereum) IsValidatorActive(addr string) (bool, error)

IsValidatorActive ...

func (*Relayer4Ethereum) LockEthErc20Asset

func (ethRelayer *Relayer4Ethereum) LockEthErc20Asset(ownerPrivateKey, tokenAddr, amount string, chain33Receiver string) (string, error)

LockEthErc20Asset ...

func (*Relayer4Ethereum) LockEthErc20AssetAsync

func (ethRelayer *Relayer4Ethereum) LockEthErc20AssetAsync(ownerPrivateKey, tokenAddr, amount string, chain33Receiver string) (string, error)

LockEthErc20AssetAsync ...

func (*Relayer4Ethereum) MintERC20Token

func (ethRelayer *Relayer4Ethereum) MintERC20Token(tokenAddr, ownerAddr, amount string) (string, error)

MintERC20Token ...

func (*Relayer4Ethereum) NewAccount

func (ethRelayer *Relayer4Ethereum) NewAccount(passphrase string) (privateKeystr, addr string, err error)

NewAccount ...

func (*Relayer4Ethereum) QueryTxhashRelay2Chain33

func (ethRelayer *Relayer4Ethereum) QueryTxhashRelay2Chain33() ebTypes.Txhashes

QueryTxhashRelay2Chain33 ...

func (*Relayer4Ethereum) QueryTxhashRelay2Eth

func (ethRelayer *Relayer4Ethereum) QueryTxhashRelay2Eth() ebTypes.Txhashes

QueryTxhashRelay2Eth ...

func (*Relayer4Ethereum) RestorePrivateKeys

func (ethRelayer *Relayer4Ethereum) RestorePrivateKeys(passPhase string) (err error)

RestorePrivateKeys ...

func (*Relayer4Ethereum) ShowBridgeBankAddr

func (ethRelayer *Relayer4Ethereum) ShowBridgeBankAddr() (string, error)

ShowBridgeBankAddr ...

func (*Relayer4Ethereum) ShowBridgeRegistryAddr

func (ethRelayer *Relayer4Ethereum) ShowBridgeRegistryAddr() (string, error)

ShowBridgeRegistryAddr ...

func (*Relayer4Ethereum) ShowDepositStatics

func (ethRelayer *Relayer4Ethereum) ShowDepositStatics(tokenAddr string) (string, error)

ShowDepositStatics ...

func (*Relayer4Ethereum) ShowLockStatics

func (ethRelayer *Relayer4Ethereum) ShowLockStatics(tokenAddr string) (string, error)

ShowLockStatics ...

func (*Relayer4Ethereum) ShowOperator

func (ethRelayer *Relayer4Ethereum) ShowOperator() (string, error)

ShowOperator ...

func (*Relayer4Ethereum) ShowTokenAddrBySymbol

func (ethRelayer *Relayer4Ethereum) ShowTokenAddrBySymbol(tokenSymbol string) (string, error)

ShowTokenAddrBySymbol ...

func (*Relayer4Ethereum) ShowTxReceipt

func (ethRelayer *Relayer4Ethereum) ShowTxReceipt(hash string) (*types.Receipt, error)

ShowTxReceipt ...

func (*Relayer4Ethereum) StoreAccountWithNewPassphase

func (ethRelayer *Relayer4Ethereum) StoreAccountWithNewPassphase(newPassphrase, oldPassphrase string) error

StoreAccountWithNewPassphase ...

func (*Relayer4Ethereum) TransferToken

func (ethRelayer *Relayer4Ethereum) TransferToken(tokenAddr, fromKey, toAddr, amount string) (string, error)

TransferToken ...

Jump to

Keyboard shortcuts

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