Documentation ¶
Index ¶
- Variables
- func AddSignature(tx types.Transaction, signature []byte) types.Transaction
- func ApplyRate(siacoin types.Currency, rate *big.Rat) *big.Rat
- func BuildClaimTransaction(parentID types.SiacoinOutputID, parentUnlockConditions types.UnlockConditions, ...) types.Transaction
- func BuildFundingTransaction(usableOutputs []UsableOutput, changeUnlockHash types.UnlockHash, ...) (*types.Transaction, error)
- func BuildRefundTransaction(parentID types.SiacoinOutputID, parentUnlockConditions types.UnlockConditions, ...) types.Transaction
- func EncodeTransaction(tx types.Transaction) string
- func PubKeyUnlockConditions(pubKey ed25519.PublicKey) types.UnlockConditions
- func WholeSigHash(tx types.Transaction, blockHeight types.BlockHeight) []byte
- type Blockchain
- type DryRunBlockchain
- func (c *DryRunBlockchain) BroadcastTransaction(tx types.Transaction) error
- func (c *DryRunBlockchain) ConfsOfRecentUnlockHash(unlockHash types.UnlockHash, value types.Currency) (int64, error)
- func (c *DryRunBlockchain) FetchUsableOutputs() ([]UsableOutput, error)
- func (c *DryRunBlockchain) Height() (*types.BlockHeight, error)
- func (c *DryRunBlockchain) NextWalletUnlockHash() (*types.UnlockHash, error)
- func (c *DryRunBlockchain) WalletSign(tx types.Transaction) (*types.Transaction, error)
- type HTTPAPIBlockchain
- func (c *HTTPAPIBlockchain) BroadcastTransaction(tx types.Transaction) error
- func (c *HTTPAPIBlockchain) ConfsOfRecentUnlockHash(unlockHash types.UnlockHash, value types.Currency) (int64, error)
- func (c *HTTPAPIBlockchain) FetchUsableOutputs() ([]UsableOutput, error)
- func (c *HTTPAPIBlockchain) Height() (*types.BlockHeight, error)
- func (c *HTTPAPIBlockchain) NextWalletUnlockHash() (*types.UnlockHash, error)
- func (c *HTTPAPIBlockchain) WalletSign(tx types.Transaction) (*types.Transaction, error)
- type UsableOutput
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrWalletLocked = errors.New("wallet is locked") ErrInsufficientFunds = errors.New("insufficient funds") )
Functions ¶
func AddSignature ¶
func AddSignature(tx types.Transaction, signature []byte) types.Transaction
func BuildClaimTransaction ¶
func BuildClaimTransaction(parentID types.SiacoinOutputID, parentUnlockConditions types.UnlockConditions, destinationUnlockHash types.UnlockHash, value types.Currency, minerFee types.Currency) types.Transaction
func BuildFundingTransaction ¶
func BuildFundingTransaction(usableOutputs []UsableOutput, changeUnlockHash types.UnlockHash, destinationUnlockHash types.UnlockHash, value types.Currency, minerFee types.Currency) (*types.Transaction, error)
func BuildRefundTransaction ¶
func BuildRefundTransaction(parentID types.SiacoinOutputID, parentUnlockConditions types.UnlockConditions, destinationUnlockHash types.UnlockHash, value types.Currency, minerFee types.Currency, timelock types.BlockHeight) types.Transaction
func EncodeTransaction ¶
func EncodeTransaction(tx types.Transaction) string
func PubKeyUnlockConditions ¶
func PubKeyUnlockConditions(pubKey ed25519.PublicKey) types.UnlockConditions
func WholeSigHash ¶
func WholeSigHash(tx types.Transaction, blockHeight types.BlockHeight) []byte
Types ¶
type Blockchain ¶
type Blockchain interface { FetchUsableOutputs() ([]UsableOutput, error) NextWalletUnlockHash() (*types.UnlockHash, error) Height() (*types.BlockHeight, error) WalletSign(tx types.Transaction) (*types.Transaction, error) BroadcastTransaction(tx types.Transaction) error ConfsOfRecentUnlockHash(unlockHash types.UnlockHash, value types.Currency) (int64, error) }
type DryRunBlockchain ¶
type DryRunBlockchain struct {
// contains filtered or unexported fields
}
func NewDryRunBlockchain ¶
func NewDryRunBlockchain(chain *HTTPAPIBlockchain) *DryRunBlockchain
func (*DryRunBlockchain) BroadcastTransaction ¶
func (c *DryRunBlockchain) BroadcastTransaction(tx types.Transaction) error
func (*DryRunBlockchain) ConfsOfRecentUnlockHash ¶
func (c *DryRunBlockchain) ConfsOfRecentUnlockHash(unlockHash types.UnlockHash, value types.Currency) (int64, error)
func (*DryRunBlockchain) FetchUsableOutputs ¶
func (c *DryRunBlockchain) FetchUsableOutputs() ([]UsableOutput, error)
func (*DryRunBlockchain) Height ¶
func (c *DryRunBlockchain) Height() (*types.BlockHeight, error)
func (*DryRunBlockchain) NextWalletUnlockHash ¶
func (c *DryRunBlockchain) NextWalletUnlockHash() (*types.UnlockHash, error)
func (*DryRunBlockchain) WalletSign ¶
func (c *DryRunBlockchain) WalletSign(tx types.Transaction) (*types.Transaction, error)
type HTTPAPIBlockchain ¶
type HTTPAPIBlockchain struct {
// contains filtered or unexported fields
}
func NewLocalNodeBlockchain ¶
func NewLocalNodeBlockchain(address string, password string) (*HTTPAPIBlockchain, error)
func NewSimulatedBlockchain ¶
func NewSimulatedBlockchain() (*HTTPAPIBlockchain, error)
func (*HTTPAPIBlockchain) BroadcastTransaction ¶
func (c *HTTPAPIBlockchain) BroadcastTransaction(tx types.Transaction) error
func (*HTTPAPIBlockchain) ConfsOfRecentUnlockHash ¶
func (c *HTTPAPIBlockchain) ConfsOfRecentUnlockHash(unlockHash types.UnlockHash, value types.Currency) (int64, error)
func (*HTTPAPIBlockchain) FetchUsableOutputs ¶
func (c *HTTPAPIBlockchain) FetchUsableOutputs() ([]UsableOutput, error)
func (*HTTPAPIBlockchain) Height ¶
func (c *HTTPAPIBlockchain) Height() (*types.BlockHeight, error)
func (*HTTPAPIBlockchain) NextWalletUnlockHash ¶
func (c *HTTPAPIBlockchain) NextWalletUnlockHash() (*types.UnlockHash, error)
func (*HTTPAPIBlockchain) WalletSign ¶
func (c *HTTPAPIBlockchain) WalletSign(tx types.Transaction) (*types.Transaction, error)
type UsableOutput ¶
type UsableOutput struct { UnspentOutput modules.UnspentOutput UnlockConditions types.UnlockConditions }
Click to show internal directories.
Click to hide internal directories.