Documentation ¶
Index ¶
- func GetPayToAddressScript(destAddress string, params *chaincfg.Params) ([]byte, error)
- type CSVStorage
- type DraftTx
- type EADUTXOs
- func (rows EADUTXOs) Append(new ...UTXO) UTXOs
- func (rows EADUTXOs) CollectForAmount(amount int64, shardID uint32) (UTXOs, int64)
- func (rows EADUTXOs) GetSingle(amount int64, shardID uint32) *UTXO
- func (rows EADUTXOs) GetSum() int64
- func (rows EADUTXOs) Len() int
- func (rows EADUTXOs) Less(i, j int) bool
- func (rows EADUTXOs) List() []UTXO
- func (rows EADUTXOs) Swap(i, j int)
- type IndexKey
- type ShortUTXO
- type SwapTransaction
- type Transaction
- type UTXO
- type UTXOIndex
- func (index *UTXOIndex) AddUTXO(utxo UTXO)
- func (index *UTXOIndex) CollectForAmount(amount int64, shardID uint32) (UTXORows, int64)
- func (index *UTXOIndex) CollectForAmountFiltered(amount int64, shardID uint32, filter map[string]struct{}) (UTXORows, int64)
- func (index *UTXOIndex) GetForAmountFiltered(amount int64, shardID uint32, filter map[string]struct{}) *UTXO
- func (index *UTXOIndex) LastBlock(shardID uint32) int64
- func (index *UTXOIndex) MarkUsed(txHash string, utxoIndexID, shardID uint32)
- func (index *UTXOIndex) MarshalBinary() (data []byte, err error)
- func (index *UTXOIndex) ResetUsedFlag()
- func (index *UTXOIndex) RmUTXO(txHash string, utxoIndexID, shardID uint32)
- func (index *UTXOIndex) Rows() UTXORows
- func (index *UTXOIndex) RowsCopy() UTXORows
- func (index *UTXOIndex) UnmarshalBinary(data []byte) error
- type UTXORepo
- func (collector *UTXORepo) Balance(shardId uint32, addresses ...string) (int64, error)
- func (collector *UTXORepo) CollectFromRPC(rpcClient *rpcclient.Client, shardID uint32, filter map[string]bool) error
- func (collector *UTXORepo) GetForAmount(amount int64, shardID uint32, addresses ...string) (*UTXO, error)
- func (collector *UTXORepo) Index() *UTXOIndex
- func (collector *UTXORepo) ListUTXOs(skip, take int64, flags map[string]string) (int64, UTXORows, error)
- func (collector *UTXORepo) ReadIndex() error
- func (collector *UTXORepo) RedeemScript(address string) (script string)
- func (collector *UTXORepo) ResetUsedFlag()
- func (collector *UTXORepo) SaveIndex() error
- func (collector *UTXORepo) SelectForAmount(amount int64, shardID uint32, addresses ...string) (UTXORows, error)
- func (collector *UTXORepo) SetIndex(index *UTXOIndex)
- type UTXORows
- func (rows UTXORows) Append(new ...UTXO) UTXOs
- func (rows UTXORows) CollectForAmount(amount int64, shardID uint32) (UTXOs, int64)
- func (rows UTXORows) GetSingle(amount int64, shardID uint32) *UTXO
- func (rows UTXORows) GetSum() int64
- func (rows UTXORows) Len() int
- func (rows UTXORows) Less(i, j int) bool
- func (rows UTXORows) List() []UTXO
- func (rows UTXORows) Swap(i, j int)
- type UTXOs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CSVStorage ¶
type CSVStorage struct {
// contains filtered or unexported fields
}
func NewCSVStorage ¶
func NewCSVStorage(path string) *CSVStorage
func (*CSVStorage) Close ¶
func (storage *CSVStorage) Close()
func (*CSVStorage) FetchData ¶
func (storage *CSVStorage) FetchData() (UTXORows, error)
func (*CSVStorage) SaveRows ¶
func (storage *CSVStorage) SaveRows(rows []UTXO) error
type DraftTx ¶
type DraftTx struct { Amount int64 NetworkFee int64 UTXO UTXORows ReceiverScript []byte DestAddress string }
func (DraftTx) Destination ¶
func (*DraftTx) SetMultiSig2of2 ¶
func (tx *DraftTx) SetMultiSig2of2(firstPubKey, secondPubKey *jaxutil.AddressPubKey, params *chaincfg.Params) error
SetMultiSig2of2 creates multiSig script, what can be spent only whist 2 of 2 signatures.
firstPubKey and secondPubKey is hex-encoded jaxutil.AddressPubKey, NOT an address.
type EADUTXOs ¶ added in v0.3.10
type EADUTXOs []UTXO
func (EADUTXOs) CollectForAmount ¶ added in v0.3.10
type ShortUTXO ¶
type SwapTransaction ¶
type SwapTransaction struct { TxHash string `json:"tx_hash" csv:"tx_hash"` Source string `json:"source" csv:"source"` Destinations map[string]int `json:"destinations" csv:"destinations"` SignedTx string `json:"signed_tx" csv:"signed_tx"` RawTX *wire.MsgTx `json:"-" csv:"-"` }
func (SwapTransaction) MarshalBinary ¶
func (t SwapTransaction) MarshalBinary() ([]byte, error)
func (*SwapTransaction) UnmarshalBinary ¶
func (t *SwapTransaction) UnmarshalBinary(data []byte) error
type Transaction ¶
type Transaction struct { TxHash string `json:"tx_hash" csv:"tx_hash"` Source string `json:"source" csv:"source"` Destination string `json:"destination" csv:"destination"` Amount int64 `json:"amount" csv:"amount"` ShardID uint32 `json:"shard_id" csv:"shard_id"` SignedTx string `json:"signed_tx" csv:"signed_tx"` RawTX *wire.MsgTx `json:"-" csv:"-"` }
func (Transaction) MarshalBinary ¶
func (t Transaction) MarshalBinary() ([]byte, error)
func (*Transaction) UnmarshalBinary ¶
func (t *Transaction) UnmarshalBinary(data []byte) error
type UTXO ¶
type UTXO struct { ShardID uint32 `json:"shard_id" csv:"shard_id"` Address string `json:"address" csv:"address"` Height int64 `json:"height" csv:"height"` TxHash string `json:"tx_hash" csv:"tx_hash"` OutIndex uint32 `json:"out_index" csv:"out_index"` Value int64 `json:"value" csv:"value"` Used bool `json:"used" csv:"used"` PKScript string `json:"pk_script" csv:"pk_script"` ScriptType string `json:"script_type" csv:"script_type"` }
func (*UTXO) CanBeSpend ¶
type UTXOIndex ¶
UTXOIndex is a storage for UTXO data.
func NewUTXOIndex ¶
func NewUTXOIndex() *UTXOIndex
func (*UTXOIndex) CollectForAmount ¶
CollectForAmount aggregates UTXOs to meet the requested amount. All selected UTXOs will be marked as USED.
func (*UTXOIndex) CollectForAmountFiltered ¶
func (*UTXOIndex) GetForAmountFiltered ¶
func (*UTXOIndex) MarshalBinary ¶
func (*UTXOIndex) ResetUsedFlag ¶
func (index *UTXOIndex) ResetUsedFlag()
func (*UTXOIndex) UnmarshalBinary ¶
type UTXORepo ¶
type UTXORepo struct {
// contains filtered or unexported fields
}
func NewUTXORepo ¶
func (*UTXORepo) CollectFromRPC ¶
func (*UTXORepo) GetForAmount ¶
func (*UTXORepo) RedeemScript ¶
func (*UTXORepo) ResetUsedFlag ¶
func (collector *UTXORepo) ResetUsedFlag()
func (*UTXORepo) SelectForAmount ¶
Click to show internal directories.
Click to hide internal directories.