Documentation ¶
Index ¶
- Constants
- Variables
- func GetHash(order *sdk.Order) []byte
- func GetIsMakerOnlyFromOrderData(data string) bool
- func GetOrderData(version uint64, isSell bool, isMarketOrder bool, ...) string
- func GetOrderExpireTsFromOrderData(data string) uint64
- func GetRawMakerFeeRateFromOrderData(data string) uint16
- func GetRawMakerRebateRateFromOrderData(data string) uint16
- func GetRawTakerFeeRateFromOrderData(data string) uint16
- func IsValidSignature(address string, message string, signature string) (bool, error)
- func PersonalSign(message []byte, privateKey string) ([]byte, error)
- type Erc20Service
- func (e *Erc20Service) AllowanceOf(tokenAddress, proxyAddress, address string) (error, *big.Int)
- func (e *Erc20Service) BalanceOf(tokenAddress, address string) (error, *big.Int)
- func (e *Erc20Service) Decimals(address string) (error, int)
- func (e *Erc20Service) Name(address string) (error, string)
- func (e *Erc20Service) Symbol(address string) (error, string)
- func (e *Erc20Service) TotalSupply(address string) (error, *big.Int)
- type Ethereum
- func (e *Ethereum) BestAskList(pairName string) []byte
- func (e *Ethereum) BestBidList(pairName string) []byte
- func (e *Ethereum) CancelOrderbook(payload map[string]string) bool
- func (e *Ethereum) EnableDebug(b bool)
- func (e *Ethereum) GetBlockByNumber(number uint64) (sdk.Block, error)
- func (e *Ethereum) GetBlockNumber() (uint64, error)
- func (e *Ethereum) GetHotFeeDiscount(address string) decimal.Decimal
- func (e *Ethereum) GetOrderbook(pairName, orderID string) []byte
- func (e *Ethereum) GetTokenAllowance(tokenAddress, proxyAddress, address string) decimal.Decimal
- func (e *Ethereum) GetTokenBalance(tokenAddress, address string) decimal.Decimal
- func (e *Ethereum) GetTransaction(ID string) (sdk.Transaction, error)
- func (e *Ethereum) GetTransactionAndReceipt(ID string) (sdk.Transaction, sdk.TransactionReceipt, error)
- func (e *Ethereum) GetTransactionCount(address string) (int, error)
- func (e *Ethereum) GetTransactionReceipt(ID string) (sdk.TransactionReceipt, error)
- func (e *Ethereum) IsValidSignature(address string, message string, signature string) (bool, error)
- func (e *Ethereum) ProcessOrderbook(payload map[string]string) []byte
- func (e *Ethereum) SendRawTransaction(tx interface{}) (string, error)
- func (e *Ethereum) SendTransaction(to string, amount *big.Int, data []byte, privateKey *ecdsa.PrivateKey) (transactionHash string, err error)
- type EthereumBlock
- type EthereumNova
- type EthereumNovaProtocol
- func (*EthereumNovaProtocol) GenerateOrderData(version, expiredAtSeconds, salt int64, ...) string
- func (*EthereumNovaProtocol) GetMatchOrderCallData(takerOrder *sdk.Order, makerOrders []*sdk.Order, ...) []byte
- func (*EthereumNovaProtocol) GetOrderHash(order *sdk.Order) []byte
- func (*EthereumNovaProtocol) IsValidOrderSignature(address string, orderID string, signature string) bool
- type EthereumTransaction
- func (t *EthereumTransaction) GetBlockHash() string
- func (t *EthereumTransaction) GetBlockNumber() uint64
- func (t *EthereumTransaction) GetFrom() string
- func (t *EthereumTransaction) GetGas() int
- func (t *EthereumTransaction) GetGasPrice() big.Int
- func (t *EthereumTransaction) GetHash() string
- func (t *EthereumTransaction) GetTo() string
- func (t *EthereumTransaction) GetValue() big.Int
- type EthereumTransactionReceipt
- func (r *EthereumTransactionReceipt) GetBlockHash() string
- func (r *EthereumTransactionReceipt) GetBlockNumber() uint64
- func (r *EthereumTransactionReceipt) GetLogs() (rst []sdk.IReceiptLog)
- func (r *EthereumTransactionReceipt) GetResult() bool
- func (r *EthereumTransactionReceipt) GetTxHash() string
- func (r *EthereumTransactionReceipt) GetTxIndex() int
- type IErc20
- type ReceiptLog
- func (log ReceiptLog) GetAddress() string
- func (log ReceiptLog) GetBlockHash() string
- func (log ReceiptLog) GetBlockNum() int
- func (log ReceiptLog) GetData() string
- func (log ReceiptLog) GetLogIndex() int
- func (log ReceiptLog) GetRemoved() bool
- func (log ReceiptLog) GetTopics() []string
- func (log ReceiptLog) GetTransactionHash() string
- func (log ReceiptLog) GetTransactionIndex() int
Constants ¶
View Source
const ( ERC20TotalSupply = "0x18160ddd" // totalSupply() ERC20Symbol = "0x95d89b41" // symbol() ERC20Name = "0x06fdde03" // name() ERC20Decimals = "0x313ce567" // decimals() ERC20BalanceOf = "0x70a08231" // balanceOf(address) ERC20Allowance = "0xdd62ed3e" // allowance(address,address) DiscountedRate = "0x4376abf1" // getDiscountedRate(address) ERC20Transfer = "0xa9059cbb" // transfer(address,uint256) ERC20Approve = "0x095ea7b3" // approve(address,uint256) ERC20TransferFrom = "0x23b872dd" // transferFrom(address,address,uint256) ERC20Withdraw = "0x2e1a7d4d" // withdraw(uint256) ERC20Deposit = "0xd0e30db0" // deposit() ERC20TransferEvent = "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" // Transfer(address,address,uint256) ERC20ApprovalEvent = "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925" // Approval(address,address,uint256) ERC20WithdrawalEvent = "0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65" // Withdrawal(address,uint256) ERC20DepositEvent = "0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c" // Deposit(address,uint256) )
sha3 result of erc20 method
View Source
const FeeRateBase = 100000
Variables ¶
View Source
var EIP712_DOMAIN_TYPEHASH []byte
View Source
var EIP712_ORDER_TYPE []byte
Functions ¶
func GetOrderData ¶
func IsValidSignature ¶
Types ¶
type Erc20Service ¶
type Erc20Service struct {
// contains filtered or unexported fields
}
func (*Erc20Service) AllowanceOf ¶
func (e *Erc20Service) AllowanceOf(tokenAddress, proxyAddress, address string) (error, *big.Int)
func (*Erc20Service) BalanceOf ¶
func (e *Erc20Service) BalanceOf(tokenAddress, address string) (error, *big.Int)
func (*Erc20Service) TotalSupply ¶
func (e *Erc20Service) TotalSupply(address string) (error, *big.Int)
type Ethereum ¶
type Ethereum struct {
// contains filtered or unexported fields
}
func NewEthereum ¶
func (*Ethereum) BestAskList ¶
func (*Ethereum) BestBidList ¶
func (*Ethereum) CancelOrderbook ¶
func (*Ethereum) EnableDebug ¶
func (*Ethereum) GetBlockByNumber ¶
func (*Ethereum) GetBlockNumber ¶
func (*Ethereum) GetHotFeeDiscount ¶
func (*Ethereum) GetOrderbook ¶
orderbook methods
func (*Ethereum) GetTokenAllowance ¶
func (*Ethereum) GetTokenBalance ¶
func (*Ethereum) GetTransaction ¶
func (e *Ethereum) GetTransaction(ID string) (sdk.Transaction, error)
func (*Ethereum) GetTransactionAndReceipt ¶
func (e *Ethereum) GetTransactionAndReceipt(ID string) (sdk.Transaction, sdk.TransactionReceipt, error)
func (*Ethereum) GetTransactionCount ¶
func (*Ethereum) GetTransactionReceipt ¶
func (e *Ethereum) GetTransactionReceipt(ID string) (sdk.TransactionReceipt, error)
func (*Ethereum) IsValidSignature ¶
func (*Ethereum) ProcessOrderbook ¶
func (*Ethereum) SendRawTransaction ¶
type EthereumBlock ¶
func (*EthereumBlock) GetTransactions ¶
func (block *EthereumBlock) GetTransactions() []sdk.Transaction
func (*EthereumBlock) Hash ¶
func (block *EthereumBlock) Hash() string
func (*EthereumBlock) Number ¶
func (block *EthereumBlock) Number() uint64
func (*EthereumBlock) ParentHash ¶
func (block *EthereumBlock) ParentHash() string
func (*EthereumBlock) Timestamp ¶
func (block *EthereumBlock) Timestamp() uint64
type EthereumNova ¶
type EthereumNova struct { *Ethereum *EthereumNovaProtocol }
func NewEthereumNova ¶
func NewEthereumNova(rpcURL, hybridExAddr string) *EthereumNova
type EthereumNovaProtocol ¶
type EthereumNovaProtocol struct{}
func (*EthereumNovaProtocol) GenerateOrderData ¶
func (*EthereumNovaProtocol) GetMatchOrderCallData ¶
func (*EthereumNovaProtocol) GetOrderHash ¶
func (*EthereumNovaProtocol) GetOrderHash(order *sdk.Order) []byte
func (*EthereumNovaProtocol) IsValidOrderSignature ¶
func (*EthereumNovaProtocol) IsValidOrderSignature(address string, orderID string, signature string) bool
type EthereumTransaction ¶
type EthereumTransaction struct {
*ethrpc.Transaction
}
func (*EthereumTransaction) GetBlockHash ¶
func (t *EthereumTransaction) GetBlockHash() string
func (*EthereumTransaction) GetBlockNumber ¶
func (t *EthereumTransaction) GetBlockNumber() uint64
func (*EthereumTransaction) GetFrom ¶
func (t *EthereumTransaction) GetFrom() string
func (*EthereumTransaction) GetGas ¶
func (t *EthereumTransaction) GetGas() int
func (*EthereumTransaction) GetGasPrice ¶
func (t *EthereumTransaction) GetGasPrice() big.Int
func (*EthereumTransaction) GetHash ¶
func (t *EthereumTransaction) GetHash() string
func (*EthereumTransaction) GetTo ¶
func (t *EthereumTransaction) GetTo() string
func (*EthereumTransaction) GetValue ¶
func (t *EthereumTransaction) GetValue() big.Int
type EthereumTransactionReceipt ¶
type EthereumTransactionReceipt struct {
*ethrpc.TransactionReceipt
}
func (*EthereumTransactionReceipt) GetBlockHash ¶
func (r *EthereumTransactionReceipt) GetBlockHash() string
func (*EthereumTransactionReceipt) GetBlockNumber ¶
func (r *EthereumTransactionReceipt) GetBlockNumber() uint64
func (*EthereumTransactionReceipt) GetLogs ¶
func (r *EthereumTransactionReceipt) GetLogs() (rst []sdk.IReceiptLog)
func (*EthereumTransactionReceipt) GetResult ¶
func (r *EthereumTransactionReceipt) GetResult() bool
func (*EthereumTransactionReceipt) GetTxHash ¶
func (r *EthereumTransactionReceipt) GetTxHash() string
func (*EthereumTransactionReceipt) GetTxIndex ¶
func (r *EthereumTransactionReceipt) GetTxIndex() int
type IErc20 ¶
type IErc20 interface { Symbol(address string) (error, string) Decimals(address string) (error, int) Name(address string) (error, string) TotalSupply(address string) (error, *big.Int) BalanceOf(tokenAddress, address string) (error, *big.Int) AllowanceOf(tokenAddress, proxyAddress, address string) (error, *big.Int) }
func NewErc20Service ¶
type ReceiptLog ¶
func (ReceiptLog) GetAddress ¶
func (log ReceiptLog) GetAddress() string
func (ReceiptLog) GetBlockHash ¶
func (log ReceiptLog) GetBlockHash() string
func (ReceiptLog) GetBlockNum ¶
func (log ReceiptLog) GetBlockNum() int
func (ReceiptLog) GetData ¶
func (log ReceiptLog) GetData() string
func (ReceiptLog) GetLogIndex ¶
func (log ReceiptLog) GetLogIndex() int
func (ReceiptLog) GetRemoved ¶
func (log ReceiptLog) GetRemoved() bool
func (ReceiptLog) GetTopics ¶
func (log ReceiptLog) GetTopics() []string
func (ReceiptLog) GetTransactionHash ¶
func (log ReceiptLog) GetTransactionHash() string
func (ReceiptLog) GetTransactionIndex ¶
func (log ReceiptLog) GetTransactionIndex() int
Click to show internal directories.
Click to hide internal directories.