Documentation ¶
Overview ¶
Copyright (c) 2019 Romano (Viacoin developer) Distributed under the MIT software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php.
Copyright (c) 2019 Romano (Viacoin developer) Distributed under the MIT software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php.
Copyright (c) 2019 Romano (Viacoin developer) Distributed under the MIT software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php.
Copyright (c) 2019 Romano (Viacoin developer) Distributed under the MIT software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php.
Copyright (c) 2019 Romano (Viacoin developer) Distributed under the MIT software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php.
Copyright (c) 2019 Romano (Viacoin developer) Distributed under the MIT software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php.
Copyright (c) 2019 Romano (Viacoin developer) Distributed under the MIT software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php.
Index ¶
- Constants
- func BroadcastTransaction(network bcoins.Network, tx bcoins.Transaction) (insightjson.Txid, bcoins.Transaction, error)
- func GetInsightExplorer(symbol string) (bcoins.Insight, error)
- func SelectNetwork(symbol string) (bcoins.Network, error)
- type UTXO
- type User
- func (user User) AddressInfo(network bcoins.Network) (*insightjson.AddressInfo, error)
- func (user User) BuildSignedTx(network bcoins.Network, destination string, amount int64, fee int64) (bcoins.Transaction, error)
- func (user User) GetUnspentOutputs(network bcoins.Network) []*UTXO
- func (user User) PayTo(network bcoins.Network, destination string, amount float64) (insightjson.Txid, bcoins.Transaction, error)
- func (user User) PrivateKey() *hdkeychain.ExtendedKey
- func (user User) PrivateKeyWif(network bcoins.Network) *btcutil.WIF
- func (user User) PublicKey(network bcoins.Network) *btcutil.AddressPubKeyHash
- func (user User) Withdraw(network bcoins.Network, destination string) (insightjson.Txid, bcoins.Transaction, error)
Constants ¶
const ErrNotEnoughBalance = "16: bad-txns-vout-negative. Code:-26"
type errorBroadcast string
const ErrNotEnoughFee = "66: insufficient priority. Code:-26"
const ErrTransactionTooSmall = "64: dust. Code:-26"
const ErrTxDecodeFailed = "Something seems wrong: TX decode failed. Code:-22"
Variables ¶
This section is empty.
Functions ¶
func BroadcastTransaction ¶
func BroadcastTransaction(network bcoins.Network, tx bcoins.Transaction) (insightjson.Txid, bcoins.Transaction, error)
broadcast a signed transaction to the blockexplorer. the transaction will either be denied or rejected by the network
Types ¶
type User ¶
type User struct { Id uint32 `json:"id"` Twitter_id int64 `json:"twitter_id"` Telegram_id int `json:"telegram_id"` Username string `json:"username"` Social string `json:"social"` RegisteredDate int64 `json:"registered_date"` }
func (User) AddressInfo ¶
func (user User) AddressInfo(network bcoins.Network) (*insightjson.AddressInfo, error)
func (User) BuildSignedTx ¶
func (user User) BuildSignedTx(network bcoins.Network, destination string, amount int64, fee int64) (bcoins.Transaction, error)
build a signed transaction by using the Network, destination, amount and fee the required UTXO will be spent and the change will be send back
func (User) PayTo ¶
func (user User) PayTo(network bcoins.Network, destination string, amount float64) (insightjson.Txid, bcoins.Transaction, error)
prepare for allowing the user to create a payment to a destination address. this function will build a signed transaction & broadcast it
func (User) PrivateKey ¶
func (user User) PrivateKey() *hdkeychain.ExtendedKey
generate private key by using the app.yml file with the master key
func (User) PrivateKeyWif ¶
convert the key to a wif format