ethereum

package
Version: v1.67.2 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2022 License: BSD-3-Clause Imports: 38 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultBlockPeriod = 5000
	BinanceChain       = "Binance"
)

Variables

View Source
var (

	// BSCRecommendHttp BSC 官方节点
	BSCRecommendHttp = []string{"https://bsc-dataseed.binance.org/", "https://bsc-dataseed1.defibit.io/", "https://bsc-dataseed1.ninicoin.io/"}
)

Functions

func NewAccount added in v1.66.2

func NewAccount() (privateKeystr, addr string, err error)

NewAccount ...

Types

type EthereumStartPara

type EthereumStartPara struct {
	DbHandle             dbm.DB
	EthProvider          []string
	EthProviderHttp      []string
	BridgeRegistryAddr   string
	Degree               int32
	BlockInterval        int32
	EthBridgeClaimChan   chan<- *ebTypes.EthBridgeClaim
	TxRelayAckSendChan   chan<- *ebTypes.TxRelayAck
	TxRelayAckRecvChan   <-chan *ebTypes.TxRelayAck
	Chain33MsgChan       <-chan *events.Chain33Msg
	ProcessWithDraw      bool
	Name                 string
	StartListenHeight    int64
	RemindUrl            string
	RemindClientErrorUrl string
	RemindEmail          []string
}

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 {
	Addr2TxNonce map[common.Address]*ethtxs.NonceMutex
	// contains filtered or unexported fields
}

Relayer4Ethereum ...

func StartEthereumRelayer

func StartEthereumRelayer(startPara *EthereumStartPara) *Relayer4Ethereum

StartEthereumRelayer ///

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) CfgWithdraw added in v1.66.0

func (ethRelayer *Relayer4Ethereum) CfgWithdraw(symbol, feeAmount, amountPerDay string) error

func (*Relayer4Ethereum) CreateLockEventManually added in v1.66.3

func (ethRelayer *Relayer4Ethereum) CreateLockEventManually(event *events.LockEvent) error

func (*Relayer4Ethereum) GeneralQuery added in v1.67.0

func (ethRelayer *Relayer4Ethereum) GeneralQuery(param, abiData, contract, owner string) (string, 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)

func (*Relayer4Ethereum) GetCfgWithdraw added in v1.67.0

func (ethRelayer *Relayer4Ethereum) GetCfgWithdraw(symbol string) *ebTypes.WithdrawPara

func (*Relayer4Ethereum) GetDecimals

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

GetDecimals ...

func (*Relayer4Ethereum) GetLockedTokenAddress added in v1.66.0

func (ethRelayer *Relayer4Ethereum) GetLockedTokenAddress(symbol string) (*ebTypes.TokenAddress, error)

func (*Relayer4Ethereum) GetMultiSignAddr added in v1.67.0

func (ethRelayer *Relayer4Ethereum) GetMultiSignAddr() string

func (*Relayer4Ethereum) GetName added in v1.66.2

func (ethRelayer *Relayer4Ethereum) GetName() string

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) NewTransferSignTx added in v1.67.2

func (ethRelayer *Relayer4Ethereum) NewTransferSignTx(toAddr common.Address, intputData []byte, value *big.Int, fromChain bool) (*types.Transaction, error)

func (*Relayer4Ethereum) ReGetEvent added in v1.66.3

func (ethRelayer *Relayer4Ethereum) ReGetEvent(start, end int64) (string, error)

func (*Relayer4Ethereum) ResendLockEvent added in v1.66.3

func (ethRelayer *Relayer4Ethereum) ResendLockEvent(height uint64, index uint32) (string, error)

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) SendRemind added in v1.67.1

func (ethRelayer *Relayer4Ethereum) SendRemind(url, postData string)

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) ShowBalanceLocked added in v1.66.0

func (ethRelayer *Relayer4Ethereum) ShowBalanceLocked(tokenAddr, bridgeBank string) (string, error)

ShowBalanceLocked 获取某一个币种的余额

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 ...

type WithdrawFeeAndQuota added in v1.66.0

type WithdrawFeeAndQuota struct {
	Fee          *big.Int
	AmountPerDay *big.Int
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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