Documentation ¶
Index ¶
- Constants
- Variables
- func Approve(network string, conn *ethclient.Client, auth *bind.TransactOpts, ...)
- func Consent(network string, conn *ethclient.Client, auth *bind.TransactOpts, seq *big.Int)
- func ExecCmd(cmd *exec.Cmd) string
- func FundETH(network string, conn *ethclient.Client, toAddr common.Address, amount *big.Int)
- func FundToken(conn *ethclient.Client, tokenAddr common.Address, toAddr common.Address, ...)
- func GetAccount(account string) *bind.TransactOpts
- func GetBalance(network string, conn *ethclient.Client, token common.Address, ...) *big.Int
- func GetBalanceETH(conn *ethclient.Client, addr common.Address) *big.Int
- func GetBalanceToken(conn *ethclient.Client, addr common.Address, tokenAddr common.Address) *big.Int
- func GetEthClient(ethInstance string) *ethclient.Client
- func GetEthURL(hostname string) string
- func GetEthWsURL(hostname string) string
- func GetIPAddr(hostname string) net.IP
- func GetInputmaskCnt(network string, conn *ethclient.Client) int64
- func GetPrice(network string, conn *ethclient.Client, tokenA common.Address, ...) string
- func GetURL(hostname string, port int, scheme string) string
- func ParseAddLiquidity(network string, conn *ethclient.Client, eventLog types.Log) *hbswap.HbSwapAddLiquidity
- func ParseInitPool(network string, conn *ethclient.Client, eventLog types.Log) *hbswap.HbSwapInitPool
- func ParseRemoveLiquidity(network string, conn *ethclient.Client, eventLog types.Log) *hbswap.HbSwapRemoveLiquidity
- func ParseSecretDeposit(network string, conn *ethclient.Client, eventLog types.Log) *hbswap.HbSwapSecretDeposit
- func ParseSecretWithdraw(network string, conn *ethclient.Client, eventLog types.Log) *hbswap.HbSwapSecretWithdraw
- func ParseTrade(network string, conn *ethclient.Client, eventLog types.Log) *hbswap.HbSwapTrade
- func ResetBalance(network string, conn *ethclient.Client, auth *bind.TransactOpts, ...)
- func ResetPrice(network string, conn *ethclient.Client, auth *bind.TransactOpts, ...)
- func StrToBig(st string) *big.Int
- func UpdatePrice(network string, conn *ethclient.Client, auth *bind.TransactOpts, ...)
- func WaitMined(ctx context.Context, ec *ethclient.Client, tx *types.Transaction, ...) (*types.Receipt, error)
- type EventID
- type PriorityQueue
- type Task
Constants ¶
View Source
const ( N = 4 T = 1 )
Variables ¶
View Source
var ( GOPATH = os.Getenv("GOPATH") KEYSTORE = os.Getenv("POA_KEYSTORE") EthAddr = common.HexToAddress("0x0000000000000000000000000000000000000000") HbswapAddr = map[string]common.Address{ "testnet": common.HexToAddress("0xbc003e9dffe7306e6e414197267581fd732fe8b4"), "privatenet": common.HexToAddress("0xf74eb25ab1785d24306ca6b3cbff0d0b0817c5e2"), } HbSwapTokenAddr = map[string]common.Address{ "testnet": common.HexToAddress("0x78160ee9e55fd81626f98d059c84d21d8b71bfda"), } DAIAddr = map[string]common.Address{ "testnet": common.HexToAddress("0x4f96fe3b7a6cf9725f59d353f723c1bdb64ca6aa"), } //TODO: delete it after testing UserAddr = common.HexToAddress("0xc33a4b5b609fcc294dca060347761226e78c0b7a") HttpPort = 8545 WsPort = 8546 TestnetHttpEndpoint = "https://kovan.infura.io/v3/6a82d2519efb4d748c02552e02e369c1" TestnetWsEndpoint = "wss://kovan.infura.io/ws/v3/6a82d2519efb4d748c02552e02e369c1" AddLiquidity = "0xec7d4752dd44bf7fc59045c9d80163de2a1b9dbd9032d11cb1156f7f867c6411" InitPool = "0xfaaebcb30b1b421f4f2ca7f2620e5add6a64532c087ee0646fd665a33d36fdf5" RemoveLiquidity = "0xa8dbaaebbb025c88e9e34c84635cd8238043556e9af43fb161508c898a8e1ef9" SecretDeposit = "0x07c06144435b7d2bdccf9ee7e5a7022c63382ac7c3a0e14ed08b5969dedf0ecf" SecretWithdraw = "0x4ef3cc4825a92c3b6922acc8a45152cc96ef48463e8ed500dacd5df9e29a67f3" Trade = "0x2b4d91cd20cc8800407e3614b8466a6f0729ac3b1fa43d4e2b059ff5593cbae6" )
Functions ¶
func GetAccount ¶
func GetAccount(account string) *bind.TransactOpts
func GetBalance ¶
func GetBalanceToken ¶
func GetEthClient ¶
func GetEthWsURL ¶
func ParseAddLiquidity ¶
func ParseInitPool ¶
func ParseRemoveLiquidity ¶
func ParseSecretDeposit ¶
func ParseSecretDeposit(network string, conn *ethclient.Client, eventLog types.Log) *hbswap.HbSwapSecretDeposit
******* parse event *******
func ParseSecretWithdraw ¶
func ParseTrade ¶
func ResetBalance ¶
func ResetPrice ¶
func UpdatePrice ¶
Types ¶
type PriorityQueue ¶
type PriorityQueue []*Task
func (PriorityQueue) Len ¶
func (pq PriorityQueue) Len() int
func (PriorityQueue) Less ¶
func (pq PriorityQueue) Less(i, j int) bool
func (*PriorityQueue) Pop ¶
func (pq *PriorityQueue) Pop() interface{}
func (*PriorityQueue) Push ¶
func (pq *PriorityQueue) Push(x interface{})
func (PriorityQueue) Swap ¶
func (pq PriorityQueue) Swap(i, j int)
Click to show internal directories.
Click to hide internal directories.