Documentation
¶
Index ¶
- type Chain
- func (c *Chain) Conn() core.Connection
- func (c *Chain) Connect(id, endpoint, mcs, lightNode, oracleNode string) (*ethclient.Client, error)
- func (c *Chain) Id() msg.ChainId
- func (c *Chain) Maintainer(client *ethclient.Client, selfId, toChainId uint64, srcEndpoint string) ([]byte, error)
- func (c *Chain) Name() string
- func (c *Chain) New(chainCfg *core.ChainConfig, logger log15.Logger, sysErr chan<- error, ...) (core.Chain, error)
- func (c *Chain) Proof(client *ethclient.Client, l *types.Log, endpoint string, proofType int64, ...) ([]byte, error)
- func (c *Chain) SetRouter(r core.Router)
- func (c *Chain) Start() error
- func (c *Chain) Stop()
- type Config
- type Connection
- func (c *Connection) CallOpts() *bind.CallOpts
- func (c *Connection) Client() *ethclient.Client
- func (c *Connection) Close()
- func (c *Connection) Connect() error
- func (c *Connection) EnsureHasBytecode(addr ethcommon.Address) error
- func (c *Connection) Keypair() *keystore.Key
- func (c *Connection) LatestBlock() (*big.Int, error)
- func (c *Connection) LockAndUpdateOpts(needNewNonce bool) error
- func (c *Connection) Opts() *bind.TransactOpts
- func (c *Connection) UnlockOpts()
- func (c *Connection) WaitForBlock(targetBlock *big.Int, delay *big.Int) error
- type GetOrderPriceResp
- type Handler
- type Maintainer
- type OrderResp
- type Writer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Chain ¶
type Chain struct {
// contains filtered or unexported fields
}
func (*Chain) Conn ¶
func (c *Chain) Conn() core.Connection
Conn return Connection interface for relayer register
func (*Chain) Maintainer ¶ added in v1.3.0
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
func NewConnection ¶
func NewConnection(endpoint string, log log15.Logger) *Connection
func (*Connection) CallOpts ¶
func (c *Connection) CallOpts() *bind.CallOpts
func (*Connection) Client ¶
func (c *Connection) Client() *ethclient.Client
func (*Connection) Close ¶
func (c *Connection) Close()
func (*Connection) Connect ¶
func (c *Connection) Connect() error
Connect starts the ethereum WS connection
func (*Connection) EnsureHasBytecode ¶
func (c *Connection) EnsureHasBytecode(addr ethcommon.Address) error
EnsureHasBytecode asserts if contract code exists at the specified address
func (*Connection) Keypair ¶
func (c *Connection) Keypair() *keystore.Key
func (*Connection) LatestBlock ¶
func (c *Connection) LatestBlock() (*big.Int, error)
LatestBlock returns the latest block from the current chain
func (*Connection) LockAndUpdateOpts ¶
func (c *Connection) LockAndUpdateOpts(needNewNonce bool) error
func (*Connection) Opts ¶
func (c *Connection) Opts() *bind.TransactOpts
func (*Connection) UnlockOpts ¶
func (c *Connection) UnlockOpts()
func (*Connection) WaitForBlock ¶
type GetOrderPriceResp ¶ added in v1.2.2
type GetOrderPriceResp struct {
Code int `json:"code"`
Msg string `json:"msg"`
RequestID string `json:"request_id"`
Data struct {
ResourceValue int `json:"resource_value"`
PayAmount float64 `json:"pay_amount"`
RentDuration int `json:"rent_duration"`
RentTimeUnit string `json:"rent_time_unit"`
PriceInSun int `json:"price_in_sun"`
} `json:"data"`
}
func GetOrderPrice ¶ added in v1.2.2
func GetOrderPrice(key string, resourceValue, rentDuration int64) (*GetOrderPriceResp, error)
type Maintainer ¶
func NewMaintainer ¶
func NewMaintainer(log log15.Logger) *Maintainer
func (*Maintainer) SetRouter ¶
func (m *Maintainer) SetRouter(r core.Router)
func (*Maintainer) Sync ¶
func (m *Maintainer) Sync() error
type OrderResp ¶ added in v1.2.2
type OrderResp struct {
Code int `json:"code"`
Msg string `json:"msg"`
RequestID string `json:"request_id"`
Data struct {
OrderNo string `json:"order_no"`
OrderType int `json:"order_type"`
ResourceType int `json:"resource_type"`
ReceiveAddress string `json:"receive_address"`
PriceInSun int `json:"price_in_sun"`
MinAmount int `json:"min_amount"`
MinPayout int `json:"min_payout"`
MinFreeze int `json:"min_freeze"`
MaxAmount int `json:"max_amount"`
MaxPayout float64 `json:"max_payout"`
MaxFreeze int `json:"max_freeze"`
FreezeTime int `json:"freeze_time"`
UnfreezeTime int `json:"unfreeze_time"`
ExpireTime int `json:"expire_time"`
CreateTime int `json:"create_time"`
ResourceValue int `json:"resource_value"`
ResourceSplitValue int `json:"resource_split_value"`
FrozenResourceValue int `json:"frozen_resource_value"`
RentDuration int `json:"rent_duration"`
RentTimeUnit string `json:"rent_time_unit"`
RentExpireTime int `json:"rent_expire_time"`
FrozenBalance int `json:"frozen_balance"`
FrozenTxID string `json:"frozen_tx_id"`
UnfreezeTxID string `json:"unfreeze_tx_id"`
SettleAmount float64 `json:"settle_amount"`
SettleAddress string `json:"settle_address"`
SettleTime int `json:"settle_time"`
PayTime int `json:"pay_time"`
PayAmount float64 `json:"pay_amount"`
RefundAmount int `json:"refund_amount"`
RefundTime int `json:"refund_time"`
IsSplit int `json:"is_split"`
Status int `json:"status"`
} `json:"data"`
}
Click to show internal directories.
Click to hide internal directories.