Documentation ¶
Index ¶
- func BigIntToAddressString(n *big.Int) (addressString string, err error)
- func HexArrayToAddresses(addresses []string) ([]gethCommon.Address, error)
- func HexToAddress(str string) (addr gethCommon.Address, err error)
- func HexToHash(str string) (hash gethCommon.Hash, err error)
- func MustHexToAddress(str string) gethCommon.Address
- func MustHexToHash(str string) gethCommon.Hash
- func StringToBytes32(str string) (result [32]byte)
- type Account
- type Client
- func (c *Client) AddAccount(private *ecdsa.PrivateKey) error
- func (c *Client) Allowance(ctx context.Context, token, owner, spender string, decimals int32) (decimal.Decimal, error)
- func (c *Client) BalanceOf(ctx context.Context, token, owner string, decimals int32) (decimal.Decimal, error)
- func (c *Client) BatchTradeDataPack(compressedOrders [][]byte, matchAmounts []decimal.Decimal, ...) ([]byte, error)
- func (c *Client) DecryptKey(cipher []byte, password string) (*ecdsa.PrivateKey, error)
- func (c *Client) EncryptKey(pk *ecdsa.PrivateKey, password string) ([]byte, error)
- func (c *Client) FilterTradeFailed(ctx context.Context, brokerAddress string, start, end uint64) ([]*model.TradeFailedEvent, error)
- func (c *Client) FilterTradeSuccess(ctx context.Context, brokerAddress string, start, end uint64) ([]*model.TradeSuccessEvent, error)
- func (c *Client) GetAccount(account string) (*Account, error)
- func (c *Client) GetAccountStorage(ctx context.Context, readerAddress string, perpetualIndex int64, ...) (*model.AccountStorage, error)
- func (c *Client) GetEthClient() *ethclient.Client
- func (c *Client) GetGasBalance(ctx context.Context, brokerAddress string, address string) (decimal.Decimal, error)
- func (c *Client) GetGasPrice(ctx context.Context, gasAddress string) ([]decimal.Decimal, error)
- func (c *Client) GetLatestBlockNumber() (uint64, error)
- func (c *Client) GetLiquidityPoolStorage(ctx context.Context, readerAddress, poolAddress string) (*model.LiquidityPoolStorage, error)
- func (c *Client) GetRelayerAccounts() []string
- func (c *Client) GetSignAccount() (string, error)
- func (c *Client) HexToPrivate(pk string) (*ecdsa.PrivateKey, string, error)
- func (c *Client) IsNotFoundError(err error) bool
- func (c *Client) ParseLogs(brokerAddress string, logs []*ethtypes.Log) ([]*model.TradeSuccessEvent, []*model.TradeFailedEvent)
- func (c *Client) PendingNonceAt(account string) (uint64, error)
- func (c *Client) SendTransaction(tx *model.LaunchTransaction) (string, error)
- func (c *Client) TransactionByHash(txHash string) (bool, error)
- func (c *Client) WaitTransactionReceipt(txHash string) (*model.Receipt, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BigIntToAddressString ¶
func HexArrayToAddresses ¶
func HexArrayToAddresses(addresses []string) ([]gethCommon.Address, error)
func HexToAddress ¶
func HexToAddress(str string) (addr gethCommon.Address, err error)
func MustHexToAddress ¶
func MustHexToAddress(str string) gethCommon.Address
func MustHexToHash ¶
func MustHexToHash(str string) gethCommon.Hash
func StringToBytes32 ¶
Types ¶
type Account ¶
type Account struct {
// contains filtered or unexported fields
}
Account represents eth user account for further operations
func PrivateToAccount ¶
PrivateToAccount imports an account from given private key
func (*Account) Signer ¶
func (acc *Account) Signer() *bind.TransactOpts
Signer returns signer to sign transaction
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) AddAccount ¶
func (c *Client) AddAccount(private *ecdsa.PrivateKey) error
func (*Client) BatchTradeDataPack ¶
func (*Client) DecryptKey ¶
func (*Client) EncryptKey ¶
func (*Client) FilterTradeFailed ¶
func (*Client) FilterTradeSuccess ¶
func (*Client) GetAccountStorage ¶
func (*Client) GetEthClient ¶
func (*Client) GetGasBalance ¶
func (*Client) GetGasPrice ¶
func (*Client) GetLatestBlockNumber ¶
func (*Client) GetLiquidityPoolStorage ¶
func (*Client) GetRelayerAccounts ¶
func (*Client) GetSignAccount ¶
func (*Client) HexToPrivate ¶
func (*Client) IsNotFoundError ¶
func (*Client) ParseLogs ¶
func (c *Client) ParseLogs(brokerAddress string, logs []*ethtypes.Log) ([]*model.TradeSuccessEvent, []*model.TradeFailedEvent)
func (*Client) SendTransaction ¶
func (c *Client) SendTransaction(tx *model.LaunchTransaction) (string, error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.