wallet

package
v0.0.0-...-d990fe8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 14, 2019 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const MINOUTPUT uint64 = 1000

Variables

This section is empty.

Functions

func IsOpenAssetTransaction

func IsOpenAssetTransaction(tx *wire.MsgTx) bool

func IsStealthTransaction

func IsStealthTransaction(tx *wire.MsgTx) bool

Types

type OpenAsset

type OpenAsset struct {
	AssetID  []byte
	Metadata OpenAssetMetadata
	Follow   bool
}

func OpenAssetFromBytes

func OpenAssetFromBytes(b []byte) *OpenAsset

func (*OpenAsset) Bytes

func (oa *OpenAsset) Bytes() []byte

type OpenAssetIssuanceOutput

type OpenAssetIssuanceOutput struct {
	RecipientPkh [20]byte
	Value        uint64
}

type OpenAssetMetadata

type OpenAssetMetadata struct {
	Ticker   string
	Decimals uint8
}

type OpenAssetTransaction

type OpenAssetTransaction struct {
	NormalInputs  []Utxo
	AssetInputs   []OpenAssetUtxo
	Issuances     []OpenAssetIssuanceOutput
	Transfers     []OpenAssetTransferOutput
	ChangeAddress [20]byte
	Metadata      OpenAssetMetadata
}

type OpenAssetTransferOutput

type OpenAssetTransferOutput struct {
	AssetID      []byte
	RecipientPkh [20]byte
	Value        uint64
}

type OpenAssetUtxo

type OpenAssetUtxo struct {
	AssetID    []byte
	Utxo       Utxo
	AssetValue uint64
	Ours       bool
}

func OpenAssetUtxoFromBytes

func OpenAssetUtxoFromBytes(b []byte) OpenAssetUtxo

func (OpenAssetUtxo) Bytes

func (oau OpenAssetUtxo) Bytes() []byte

type SendTransaction

type SendTransaction struct {
	RecipientPkh [20]byte
	Amount       uint64
}

type StealthTransaction

type StealthTransaction struct {
	RecipientPubKey [33]byte
	Amount          uint64
}

type StealthUtxo

type StealthUtxo struct {
	Utxo   Utxo
	EncOTK []byte
}

func StealthUtxoFromBytes

func StealthUtxoFromBytes(b []byte) StealthUtxo

func (StealthUtxo) Bytes

func (su StealthUtxo) Bytes() []byte

type Utxo

type Utxo struct {
	TxHash   chainhash.Hash
	Outpoint uint32
	Value    uint64
	PkScript []byte
}

func UtxoFromBytes

func UtxoFromBytes(b []byte) Utxo

func (Utxo) Bytes

func (u Utxo) Bytes() []byte

type Wallet

type Wallet struct {
	// contains filtered or unexported fields
}

func NewWallet

func NewWallet(c *rpcclient.Client, conf *config.Config) *Wallet

func (*Wallet) AddInputsAndChange

func (w *Wallet) AddInputsAndChange(tx *wire.MsgTx, totalValueNeeded uint64) error

func (*Wallet) AddStealthInputsAndChange

func (w *Wallet) AddStealthInputsAndChange(tx *wire.MsgTx, totalValueNeeded uint64) error

func (*Wallet) AssetBalance

func (w *Wallet) AssetBalance(assetID []byte) uint64

func (*Wallet) Assets

func (w *Wallet) Assets() []*OpenAsset

func (*Wallet) AssetsAddress

func (w *Wallet) AssetsAddress() (string, error)

func (*Wallet) Balance

func (w *Wallet) Balance() uint64

func (*Wallet) FindStealthUtxoFromTxIn

func (w *Wallet) FindStealthUtxoFromTxIn(txi *wire.TxIn) (Utxo, *btcec.PrivateKey, error)

func (*Wallet) FindUtxoFromTxIn

func (w *Wallet) FindUtxoFromTxIn(txi *wire.TxIn) (Utxo, error)

func (*Wallet) FollowAsset

func (w *Wallet) FollowAsset(assetID []byte)

func (*Wallet) GenerateNormalSendTx

func (w *Wallet) GenerateNormalSendTx(tx SendTransaction, stealthInputs bool) (*wire.MsgTx, error)

func (*Wallet) GenerateOpenAssetTx

func (w *Wallet) GenerateOpenAssetTx(tx OpenAssetTransaction) (*wire.MsgTx, error)

func (*Wallet) GenerateStealthTx

func (w *Wallet) GenerateStealthTx(tx StealthTransaction, stealthInputs bool) (*wire.MsgTx, error)

func (*Wallet) GetStealthPrivateKey

func (w *Wallet) GetStealthPrivateKey(encOTK []byte) (*btcec.PrivateKey, error)

func (*Wallet) InitKey

func (w *Wallet) InitKey() error

func (*Wallet) MyPKH

func (w *Wallet) MyPKH() [20]byte

func (*Wallet) ProcessTransaction

func (w *Wallet) ProcessTransaction(tx *wire.MsgTx)

func (*Wallet) SendTransaction

func (w *Wallet) SendTransaction(tx *wire.MsgTx) (*chainhash.Hash, error)

func (*Wallet) SignMyInputs

func (w *Wallet) SignMyInputs(tx *wire.MsgTx) error

func (*Wallet) StealthAddress

func (w *Wallet) StealthAddress() (string, error)

func (*Wallet) StealthBalance

func (w *Wallet) StealthBalance() uint64

func (*Wallet) UnfollowAsset

func (w *Wallet) UnfollowAsset(assetID []byte)

func (*Wallet) UpdateClient

func (w *Wallet) UpdateClient(c *rpcclient.Client)

func (*Wallet) VertcoinAddress

func (w *Wallet) VertcoinAddress() (string, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL