Documentation ¶
Index ¶
- Constants
- Variables
- func CalculateSwapID(randomNumberHash []byte, sender []byte, senderOtherChain []byte) []byte
- type ClaimEvent
- type ContractEvent
- type ContractType
- type Erc20Executor
- func (executor *Erc20Executor) Allowance() (*big.Int, error)
- func (executor *Erc20Executor) CalcSwapId(randomNumberHash common.Hash, sender string, senderOtherChain string) ([]byte, error)
- func (executor *Erc20Executor) Claim(swapId common.Hash, randomNumber common.Hash) (string, *dc.Error)
- func (executor *Erc20Executor) Claimable(swapId common.Hash) (bool, error)
- func (executor *Erc20Executor) Erc20Balance(address common.Address) (*big.Int, error)
- func (executor *Erc20Executor) EthBalance(address common.Address) (*big.Int, error)
- func (executor *Erc20Executor) GetBalance(addressString string) (*big.Int, error)
- func (executor *Erc20Executor) GetBalanceAlertMsg() (string, error)
- func (executor *Erc20Executor) GetBlockAndTxs(height int64) (*dc.BlockAndTxLogs, error)
- func (executor *Erc20Executor) GetChain() string
- func (executor *Erc20Executor) GetColdWalletAddress() string
- func (executor *Erc20Executor) GetDeputyAddress() string
- func (executor *Erc20Executor) GetFetchInterval() time.Duration
- func (executor *Erc20Executor) GetHTLTEvent(swapId common.Hash) (*HTLTEvent, error)
- func (executor *Erc20Executor) GetHeight() (int64, error)
- func (executor *Erc20Executor) GetLogs(blockHash common.Hash) ([]*store.TxLog, error)
- func (executor *Erc20Executor) GetSentTxStatus(hash string) store.TxStatus
- func (executor *Erc20Executor) GetStatus() (interface{}, error)
- func (executor *Erc20Executor) GetSwap(swapId common.Hash) (*dc.SwapRequest, error)
- func (executor *Erc20Executor) GetTransactor() (*bind.TransactOpts, error)
- func (executor *Erc20Executor) HTLT(randomNumberHash common.Hash, timestamp int64, heightSpan int64, ...) (string, *dc.Error)
- func (executor *Erc20Executor) HasSwap(swapId common.Hash) (bool, error)
- func (executor *Erc20Executor) IsSameAddress(addrA string, addrB string) bool
- func (executor *Erc20Executor) Refund(swapId common.Hash) (string, *dc.Error)
- func (executor *Erc20Executor) Refundable(swapId common.Hash) (bool, error)
- func (executor *Erc20Executor) SendAmount(address string, amount *big.Int) (string, error)
- type EthExecutor
- func (executor *EthExecutor) CalcSwapId(randomNumberHash common.Hash, sender string, senderOtherChain string) ([]byte, error)
- func (executor *EthExecutor) Claim(swapId common.Hash, randomNumber common.Hash) (string, *dc.Error)
- func (executor *EthExecutor) Claimable(swapId common.Hash) (bool, error)
- func (executor *EthExecutor) EthBalance(address common.Address) (*big.Int, error)
- func (executor *EthExecutor) GetBalance(addressString string) (*big.Int, error)
- func (executor *EthExecutor) GetBalanceAlertMsg() (string, error)
- func (executor *EthExecutor) GetBlockAndTxs(height int64) (*dc.BlockAndTxLogs, error)
- func (executor *EthExecutor) GetChain() string
- func (executor *EthExecutor) GetColdWalletAddress() string
- func (executor *EthExecutor) GetDeputyAddress() string
- func (executor *EthExecutor) GetFetchInterval() time.Duration
- func (executor *EthExecutor) GetHTLTEvent(swapId common.Hash) (*HTLTEvent, error)
- func (executor *EthExecutor) GetHeight() (int64, error)
- func (executor *EthExecutor) GetLogs(blockHash common.Hash) ([]*store.TxLog, error)
- func (executor *EthExecutor) GetSentTxStatus(hash string) store.TxStatus
- func (executor *EthExecutor) GetStatus() (interface{}, error)
- func (executor *EthExecutor) GetSwap(swapId common.Hash) (*dc.SwapRequest, error)
- func (executor *EthExecutor) GetTransactor() (*bind.TransactOpts, error)
- func (executor *EthExecutor) HTLT(randomNumberHash common.Hash, timestamp int64, heightSpan int64, ...) (string, *dc.Error)
- func (executor *EthExecutor) HasSwap(swapId common.Hash) (bool, error)
- func (executor *EthExecutor) IsSameAddress(addrA string, addrB string) bool
- func (executor *EthExecutor) Refund(swapId common.Hash) (string, *dc.Error)
- func (executor *EthExecutor) Refundable(swapId common.Hash) (bool, error)
- func (executor *EthExecutor) SendAmount(address string, amount *big.Int) (string, error)
- type HTLTEvent
- type RefundEvent
Constants ¶
View Source
const ClaimEventName = "Claimed"
View Source
const HTLTEventName = "HTLT"
Variables ¶
View Source
var ClaimEventHash = common.HexToHash("0x9f46b1606087bdf4183ec7dfdbe68e4ab9129a6a37901c16a7b320ae11a96018")
View Source
var HTLTEventHash = common.HexToHash("0xb3e26d98380491276a8dce9d38fd1049e89070230ff5f36ebb55ead64500ade1")
View Source
var RefundEventHash = common.HexToHash("0x04eb8ae268f23cfe2f9d72fa12367b104af16959f6a93530a4cc0f50688124f9")
Functions ¶
Types ¶
type ClaimEvent ¶
type ClaimEvent struct { MsgSender common.Address RecipientAddr common.Address SwapId common.Hash RandomNumberHash common.Hash RandomNumber common.Hash }
func (ClaimEvent) ToTxLog ¶
func (ev ClaimEvent) ToTxLog() *store.TxLog
type ContractEvent ¶
func ParseClaimEvent ¶
func ParseEvent ¶
func ParseHTLTEvent ¶
func ParseRefundEvent ¶
func ParseRefundEvent(log *types.Log) (ContractEvent, error)
type ContractType ¶
type ContractType int
type Erc20Executor ¶
type Erc20Executor struct { Abi abi.ABI Provider string Config *util.Config Client *ethclient.Client SwapContractAddr common.Address TokenContractAddr common.Address }
func NewErc20Executor ¶
func (*Erc20Executor) CalcSwapId ¶
func (*Erc20Executor) Claimable ¶
func (executor *Erc20Executor) Claimable(swapId common.Hash) (bool, error)
func (*Erc20Executor) Erc20Balance ¶
func (*Erc20Executor) EthBalance ¶
func (*Erc20Executor) GetBalance ¶
func (executor *Erc20Executor) GetBalance(addressString string) (*big.Int, error)
func (*Erc20Executor) GetBalanceAlertMsg ¶
func (executor *Erc20Executor) GetBalanceAlertMsg() (string, error)
func (*Erc20Executor) GetBlockAndTxs ¶
func (executor *Erc20Executor) GetBlockAndTxs(height int64) (*dc.BlockAndTxLogs, error)
func (*Erc20Executor) GetChain ¶
func (executor *Erc20Executor) GetChain() string
func (*Erc20Executor) GetColdWalletAddress ¶
func (executor *Erc20Executor) GetColdWalletAddress() string
func (*Erc20Executor) GetDeputyAddress ¶
func (executor *Erc20Executor) GetDeputyAddress() string
func (*Erc20Executor) GetFetchInterval ¶
func (executor *Erc20Executor) GetFetchInterval() time.Duration
func (*Erc20Executor) GetHTLTEvent ¶
func (executor *Erc20Executor) GetHTLTEvent(swapId common.Hash) (*HTLTEvent, error)
func (*Erc20Executor) GetHeight ¶
func (executor *Erc20Executor) GetHeight() (int64, error)
func (*Erc20Executor) GetSentTxStatus ¶
func (executor *Erc20Executor) GetSentTxStatus(hash string) store.TxStatus
func (*Erc20Executor) GetStatus ¶
func (executor *Erc20Executor) GetStatus() (interface{}, error)
func (*Erc20Executor) GetSwap ¶
func (executor *Erc20Executor) GetSwap(swapId common.Hash) (*dc.SwapRequest, error)
func (*Erc20Executor) GetTransactor ¶
func (executor *Erc20Executor) GetTransactor() (*bind.TransactOpts, error)
func (*Erc20Executor) HasSwap ¶
func (executor *Erc20Executor) HasSwap(swapId common.Hash) (bool, error)
func (*Erc20Executor) IsSameAddress ¶
func (executor *Erc20Executor) IsSameAddress(addrA string, addrB string) bool
func (*Erc20Executor) Refundable ¶
func (executor *Erc20Executor) Refundable(swapId common.Hash) (bool, error)
func (*Erc20Executor) SendAmount ¶
type EthExecutor ¶
type EthExecutor struct { Abi abi.ABI Provider string Config *util.EthConfig Client *ethclient.Client SwapContractAddr common.Address }
func NewEthExecutor ¶
func (*EthExecutor) CalcSwapId ¶
func (*EthExecutor) Claimable ¶
func (executor *EthExecutor) Claimable(swapId common.Hash) (bool, error)
func (*EthExecutor) EthBalance ¶
func (*EthExecutor) GetBalance ¶
func (executor *EthExecutor) GetBalance(addressString string) (*big.Int, error)
func (*EthExecutor) GetBalanceAlertMsg ¶
func (executor *EthExecutor) GetBalanceAlertMsg() (string, error)
func (*EthExecutor) GetBlockAndTxs ¶
func (executor *EthExecutor) GetBlockAndTxs(height int64) (*dc.BlockAndTxLogs, error)
func (*EthExecutor) GetChain ¶
func (executor *EthExecutor) GetChain() string
func (*EthExecutor) GetColdWalletAddress ¶
func (executor *EthExecutor) GetColdWalletAddress() string
func (*EthExecutor) GetDeputyAddress ¶
func (executor *EthExecutor) GetDeputyAddress() string
func (*EthExecutor) GetFetchInterval ¶
func (executor *EthExecutor) GetFetchInterval() time.Duration
func (*EthExecutor) GetHTLTEvent ¶
func (executor *EthExecutor) GetHTLTEvent(swapId common.Hash) (*HTLTEvent, error)
func (*EthExecutor) GetHeight ¶
func (executor *EthExecutor) GetHeight() (int64, error)
func (*EthExecutor) GetSentTxStatus ¶
func (executor *EthExecutor) GetSentTxStatus(hash string) store.TxStatus
func (*EthExecutor) GetStatus ¶
func (executor *EthExecutor) GetStatus() (interface{}, error)
func (*EthExecutor) GetSwap ¶
func (executor *EthExecutor) GetSwap(swapId common.Hash) (*dc.SwapRequest, error)
func (*EthExecutor) GetTransactor ¶
func (executor *EthExecutor) GetTransactor() (*bind.TransactOpts, error)
func (*EthExecutor) HasSwap ¶
func (executor *EthExecutor) HasSwap(swapId common.Hash) (bool, error)
func (*EthExecutor) IsSameAddress ¶
func (executor *EthExecutor) IsSameAddress(addrA string, addrB string) bool
func (*EthExecutor) Refundable ¶
func (executor *EthExecutor) Refundable(swapId common.Hash) (bool, error)
func (*EthExecutor) SendAmount ¶
Click to show internal directories.
Click to hide internal directories.