Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChainManager ¶
A ChainManager is used to get the current consensus state
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
A Session is an RHP2 session with a host
func NewSession ¶
func NewSession(ctx context.Context, hostKey types.PublicKey, hostAddr string, cm ChainManager, tp TPool, w Wallet) (*Session, error)
NewSession creates a new RHP2 session with a host. It is not safe for concurrent use.
func (*Session) FormContract ¶
func (s *Session) FormContract(hostAddr types.Address, renterKey types.PrivateKey, renterPayout, hostCollateral types.Currency, expirationHeight uint64) (rhp2.ContractRevision, []types.Transaction, error)
FormContract forms a new contract with the host.
func (*Session) ScanSettings ¶
func (s *Session) ScanSettings() (settings rhp2.HostSettings, err error)
ScanSettings scans the host's settings and returns them.
type Wallet ¶
type Wallet interface { Address() types.Address FundTransaction(txn *types.Transaction, amount types.Currency) ([]types.Hash256, func(), error) SignTransaction(cs consensus.State, txn *types.Transaction, toSign []types.Hash256, cf types.CoveredFields) error }
A Wallet funds and signs transactions
Click to show internal directories.
Click to hide internal directories.