ethereum

package
v1.65.3 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2021 License: BSD-3-Clause Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultBlockPeriod = 5000
)

Variables

This section is empty.

Functions

This section is empty.

Types

type EthereumStartPara

type EthereumStartPara struct {
	DbHandle           dbm.DB
	EthProvider        string
	BridgeRegistryAddr string
	DeployInfo         *ebTypes.Deploy
	Degree             int32
	BlockInterval      int32
	EthBridgeClaimChan chan<- *ebTypes.EthBridgeClaim
	Chain33MsgChan     <-chan *events.Chain33Msg
}

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(startPara *EthereumStartPara) *Relayer4Ethereum

StartEthereumRelayer ///

func (*Relayer4Ethereum) AddToken2LockList

func (ethRelayer *Relayer4Ethereum) AddToken2LockList(symbol, token string) (string, error)

AddToken2LockList ...

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) ConfigLockedTokenOfflineSave

func (ethRelayer *Relayer4Ethereum) ConfigLockedTokenOfflineSave(addr, symbol, threshold string, percents uint32) (string, error)

func (*Relayer4Ethereum) ConfigOfflineSaveAccount

func (ethRelayer *Relayer4Ethereum) ConfigOfflineSaveAccount(addr string) (string, error)

func (*Relayer4Ethereum) CreateBridgeToken

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

CreateBridgeToken ...

func (*Relayer4Ethereum) DeployContrcts

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

DeployContrcts 部署以太坊合约

func (*Relayer4Ethereum) DeployERC20

func (ethRelayer *Relayer4Ethereum) DeployERC20(ownerAddr, name, symbol, amount string) (string, error)

DeployERC20 ...

func (*Relayer4Ethereum) DeployMulsign

func (ethRelayer *Relayer4Ethereum) DeployMulsign() (mulsign string, err error)

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) ImportPrivateKey

func (ethRelayer *Relayer4Ethereum) ImportPrivateKey(passphrase, privateKeyStr string) (addr string, err error)

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) 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) RestorePrivateKeys

func (ethRelayer *Relayer4Ethereum) RestorePrivateKeys(passphrase string) error

RestorePrivateKeys ...

func (*Relayer4Ethereum) RestoreTokenAddress

func (ethRelayer *Relayer4Ethereum) RestoreTokenAddress() error

func (*Relayer4Ethereum) SafeTransfer

func (ethRelayer *Relayer4Ethereum) SafeTransfer(para ebTypes.SafeTransfer) (string, error)

func (*Relayer4Ethereum) SetLockedTokenAddress

func (ethRelayer *Relayer4Ethereum) SetLockedTokenAddress(token2set ebTypes.TokenAddress) error

func (*Relayer4Ethereum) SetMultiSignAddr

func (ethRelayer *Relayer4Ethereum) SetMultiSignAddr(address string)

func (*Relayer4Ethereum) SetTokenAddress

func (ethRelayer *Relayer4Ethereum) SetTokenAddress(token2set ebTypes.TokenAddress) error

func (*Relayer4Ethereum) SetupMulSign

func (ethRelayer *Relayer4Ethereum) SetupMulSign(setupMulSign ebTypes.SetupMulSign) (string, error)

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) ShowETHLockTokenAddress

func (ethRelayer *Relayer4Ethereum) ShowETHLockTokenAddress(token2show ebTypes.TokenAddress) (*ebTypes.TokenAddressArray, error)

func (*Relayer4Ethereum) ShowLockStatics

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

ShowLockStatics ...

func (*Relayer4Ethereum) ShowLockedTokenAddress

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

func (*Relayer4Ethereum) ShowMultiBalance

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

func (*Relayer4Ethereum) ShowOperator

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

ShowOperator ...

func (*Relayer4Ethereum) ShowStatics

func (ethRelayer *Relayer4Ethereum) ShowStatics(request *ebTypes.TokenStaticsRequest) (*ebTypes.TokenStaticsResponse, error)

func (*Relayer4Ethereum) ShowTokenAddrBySymbol

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

ShowTokenAddrBySymbol ...

func (*Relayer4Ethereum) ShowTokenAddress

func (ethRelayer *Relayer4Ethereum) ShowTokenAddress(token2show ebTypes.TokenAddress) (*ebTypes.TokenAddressArray, error)

func (*Relayer4Ethereum) ShowTxReceipt

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

ShowTxReceipt ...

func (*Relayer4Ethereum) SimBurnFromEth

func (ethRelayer *Relayer4Ethereum) SimBurnFromEth(burn ebTypes.Burn) error

func (*Relayer4Ethereum) SimLockFromEth

func (ethRelayer *Relayer4Ethereum) SimLockFromEth(lock ebTypes.LockEthErc20) error

func (*Relayer4Ethereum) StoreAccountWithNewPassphase

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

StoreAccountWithNewPassphase ...

func (*Relayer4Ethereum) TransferEth

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

TransferEth ...

func (*Relayer4Ethereum) TransferToken

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

TransferToken ...

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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