Documentation ¶
Overview ¶
Copyright (c) 2020 The JaxNetwork developers Use of this source code is governed by an ISC license that can be found in the LICENSE file.
Copyright (c) 2020 The JaxNetwork developers Use of this source code is governed by an ISC license that can be found in the LICENSE file.
Index ¶
- func GetPayToAddressScript(destAddress string, params *chaincfg.Params) ([]byte, error)
- type DraftTx
- 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) 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 UTXORows
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
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 *btcutil.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 btcutil.AddressPubKey, NOT an address.
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 ¶ added in v0.1.6
func (t SwapTransaction) MarshalBinary() ([]byte, error)
func (*SwapTransaction) UnmarshalBinary ¶ added in v0.1.6
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"` }
type UTXOIndex ¶
UTXOIndex is a storage for UTXO data.
func NewUTXOIndex ¶
func NewUTXOIndex() *UTXOIndex
func (*UTXOIndex) CollectForAmount ¶ added in v0.1.6
CollectForAmount aggregates UTXOs to meet the requested amount. All selected UTXOs will be marked as USED.
func (*UTXOIndex) CollectForAmountFiltered ¶ added in v0.1.6
func (*UTXOIndex) MarshalBinary ¶ added in v0.1.6
func (*UTXOIndex) ResetUsedFlag ¶ added in v0.1.6
func (index *UTXOIndex) ResetUsedFlag()
func (*UTXOIndex) UnmarshalBinary ¶ added in v0.1.6
Click to show internal directories.
Click to hide internal directories.