Documentation ¶
Index ¶
- Constants
- func NewAccount() (privateKeystr, addr string, err error)
- type EthereumStartPara
- type Key
- type Relayer4Ethereum
- func (ethRelayer *Relayer4Ethereum) Burn(ownerPrivateKey, tokenAddr, chain33Receiver, amount string) (string, error)
- func (ethRelayer *Relayer4Ethereum) BurnAsync(ownerPrivateKey, tokenAddr, chain33Receiver, amount string) (string, error)
- func (ethRelayer *Relayer4Ethereum) CfgWithdraw(symbol string, feeAmount, amountPerDay string) error
- func (ethRelayer *Relayer4Ethereum) GetAccount(passphrase string) (privateKey, addr string, err error)
- func (ethRelayer *Relayer4Ethereum) GetBalance(tokenAddr, owner string) (string, error)
- func (ethRelayer *Relayer4Ethereum) GetDecimals(tokenAddr string) (uint8, error)
- func (ethRelayer *Relayer4Ethereum) GetLockedTokenAddress(symbol string) (*ebTypes.TokenAddress, error)
- func (ethRelayer *Relayer4Ethereum) GetName() string
- func (ethRelayer *Relayer4Ethereum) GetValidatorAddr() (validators x2ethTypes.ValidatorAddr4EthRelayer, err error)
- func (ethRelayer *Relayer4Ethereum) ImportPrivateKey(passphrase, privateKeyStr string) (addr string, err error)
- func (ethRelayer *Relayer4Ethereum) ImportPrivateKeyPasspin(passphrase, privateKeyPasspin string) (err error)
- func (ethRelayer *Relayer4Ethereum) IsProphecyPending(claimID [32]byte) (bool, error)
- func (ethRelayer *Relayer4Ethereum) IsValidatorActive(addr string) (bool, error)
- func (ethRelayer *Relayer4Ethereum) LockEthErc20Asset(ownerPrivateKey, tokenAddr, amount string, chain33Receiver string) (string, error)
- func (ethRelayer *Relayer4Ethereum) LockEthErc20AssetAsync(ownerPrivateKey, tokenAddr, amount string, chain33Receiver string) (string, error)
- func (ethRelayer *Relayer4Ethereum) RestorePrivateKeyOrPasspin(passphrase string) error
- func (ethRelayer *Relayer4Ethereum) RestoreTokenAddress() error
- func (ethRelayer *Relayer4Ethereum) SafeTransfer(para *ebTypes.SafeTransfer) (string, error)
- func (ethRelayer *Relayer4Ethereum) SetLockedTokenAddress(token2set ebTypes.TokenAddress) error
- func (ethRelayer *Relayer4Ethereum) SetMultiSignAddr(address string)
- func (ethRelayer *Relayer4Ethereum) SetTokenAddress(token2set *ebTypes.TokenAddress) error
- func (ethRelayer *Relayer4Ethereum) ShowBalanceLocked(tokenAddr, bridgeBank string) (string, error)
- func (ethRelayer *Relayer4Ethereum) ShowBridgeBankAddr() (string, error)
- func (ethRelayer *Relayer4Ethereum) ShowBridgeRegistryAddr() (string, error)
- func (ethRelayer *Relayer4Ethereum) ShowDepositStatics(tokenAddr string) (string, error)
- func (ethRelayer *Relayer4Ethereum) ShowETHLockTokenAddress(token2show *ebTypes.TokenAddress) (*ebTypes.TokenAddressArray, error)
- func (ethRelayer *Relayer4Ethereum) ShowLockStatics(tokenAddr string) (string, error)
- func (ethRelayer *Relayer4Ethereum) ShowLockedTokenAddress(tokenSymbol string) (string, error)
- func (ethRelayer *Relayer4Ethereum) ShowMultiBalance(tokenAddr, owner string) (string, error)
- func (ethRelayer *Relayer4Ethereum) ShowOperator() (string, error)
- func (ethRelayer *Relayer4Ethereum) ShowStatics(request *ebTypes.TokenStaticsRequest) (*ebTypes.TokenStaticsResponse, error)
- func (ethRelayer *Relayer4Ethereum) ShowTokenAddrBySymbol(tokenSymbol string) (string, error)
- func (ethRelayer *Relayer4Ethereum) ShowTokenAddress(token2show *ebTypes.TokenAddress) (*ebTypes.TokenAddressArray, error)
- func (ethRelayer *Relayer4Ethereum) ShowTxReceipt(hash string) (*types.Receipt, error)
- func (ethRelayer *Relayer4Ethereum) SimBurnFromEth(burn *ebTypes.Burn) error
- func (ethRelayer *Relayer4Ethereum) SimLockFromEth(lock *ebTypes.LockEthErc20) error
- func (ethRelayer *Relayer4Ethereum) StoreAccountWithNewPassphase(newPassphrase, oldPassphrase string) error
- func (ethRelayer *Relayer4Ethereum) TransferEth(fromKey, toAddr, amount string) (string, error)
- func (ethRelayer *Relayer4Ethereum) TransferToken(tokenAddr, fromKey, toAddr, amount string) (string, error)
- type WithdrawFeeAndQuota
Constants ¶
View Source
const ( DefaultBlockPeriod = 5000 EthereumChain = "Ethereum" BinanceChain = "Binance" USDT = "USDT" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type EthereumStartPara ¶
type EthereumStartPara struct { DbHandle dbm.DB EthProvider string EthProviderHttp string BridgeRegistryAddr string Degree int32 BlockInterval int32 EthBridgeClaimChan chan<- *ebTypes.EthBridgeClaim Chain33MsgChan <-chan *events.Chain33Msg ProcessWithDraw bool Name string ValidatorAddr string SignViaHsm bool //是否使用硬件签名 Secp256k1Index int //硬件签名时的私钥索引号 }
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 ¶
func (ethRelayer *Relayer4Ethereum) CfgWithdraw(symbol string, feeAmount, amountPerDay 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) GetDecimals ¶
func (ethRelayer *Relayer4Ethereum) GetDecimals(tokenAddr string) (uint8, error)
GetDecimals ...
func (*Relayer4Ethereum) GetLockedTokenAddress ¶
func (ethRelayer *Relayer4Ethereum) GetLockedTokenAddress(symbol string) (*ebTypes.TokenAddress, error)
func (*Relayer4Ethereum) GetName ¶
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) ImportPrivateKeyPasspin ¶
func (ethRelayer *Relayer4Ethereum) ImportPrivateKeyPasspin(passphrase, privateKeyPasspin 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) RestorePrivateKeyOrPasspin ¶
func (ethRelayer *Relayer4Ethereum) RestorePrivateKeyOrPasspin(passphrase string) error
RestorePrivateKeyOrPasspin ...
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) ShowBalanceLocked ¶
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 ...
Click to show internal directories.
Click to hide internal directories.