Documentation ¶
Index ¶
- Variables
- func ConfigureRouter(router *web.Router)
- func GetRecommenedFee() (int, error)
- func GetUnspentBitcoinTransactions(w BitcoinWallet) ([]insight.Tx, error)
- func PushBitcoinTransaction(rawtx string) error
- func SanitizeBitcoinAddress(inputAddress, privateKey, outputAddress string)
- func SetupViews()
- func SweepBitcoinWallet(addressFrom string, addressTo string)
- func SweepCommissionAndPremiumBitcoinWallets(addressTo string)
- func TaskUpdateBitcoinTransactionFee()
- func TaskUpdateBitcoinWalletBalances()
- func UpdateBTCTransactionFee()
- func UpdateBitcoinWalletBalances()
- func UpdatePremiumBitcoinWalletBalances()
- func ViewCreateBitcoinWallet(w web.ResponseWriter, r *web.Request)
- func ViewCreateMultisigBitcoinWallet(w web.ResponseWriter, r *web.Request)
- func ViewEstimateFeeFromMultipleBitcoinWalletsWithAmountSplit(w web.ResponseWriter, r *web.Request)
- func ViewListBitcoinWalletsWithPositiveBalance(w web.ResponseWriter, r *web.Request)
- func ViewSendFromMultipleBitcoinWalletsWithAmountSplit(w web.ResponseWriter, r *web.Request)
- func ViewSendFromSingleBitcoinWalletWithPercentSplit(w web.ResponseWriter, r *web.Request)
- func ViewShowBitcoinWallet(w web.ResponseWriter, r *web.Request)
- func ViewTableListBitcoinWalletsWithPositiveBalance(w web.ResponseWriter, r *web.Request)
- func ViewUpdateBitcoinWallets(w web.ResponseWriter, r *web.Request)
- func ViewUpdatePremiumBitcoinWallets(w web.ResponseWriter, r *web.Request)
- type BTCPayment
- type BTCPaymentResult
- type BitcoinWallet
- func CreateBitcoinWallet(tp string) (BitcoinWallet, error)
- func CreateMultisigBitcoinWallet(buyerPublicKey, sellerPublicKey string) (BitcoinWallet, error)
- func FindAllBitcoinWallets() ([]BitcoinWallet, error)
- func FindBitcoinWalletByPublicKey(publicKey string) (*BitcoinWallet, error)
- func FindPremiumBitcoinWallets() ([]BitcoinWallet, error)
- func ImportBitcoinWallet(tp, wif string) (BitcoinWallet, error)
- func (w BitcoinWallet) BuildTransactionFromMultipleInputsAndSingleOutput(txs []insight.Tx, outputAddress string, feeOnly bool) (BTCPaymentResult, error)
- func (w BitcoinWallet) CurrentBalance() (*BitcoinWalletBalance, error)
- func (w BitcoinWallet) Remove() error
- func (w BitcoinWallet) Save() error
- func (w BitcoinWallet) SaveToDatabase() error
- func (w BitcoinWallet) SendWithPercentSplit(payments []BTCPayment) (BTCPaymentResult, error)
- func (w BitcoinWallet) UpdateBalance() (*BitcoinWalletBalance, error)
- func (w BitcoinWallet) Validate() error
- type BitcoinWalletBalance
- func FindAllBitcoinWalletBalances() ([]BitcoinWalletBalance, error)
- func FindBitcoinWalletsWithNonZeroBalance() ([]BitcoinWalletBalance, error)
- func FindBitcoinWalletsWithNonZeroBalanceByType(tp string) ([]BitcoinWalletBalance, error)
- func GetBitcoinWalletBalance(w BitcoinWallet) (*BitcoinWalletBalance, error)
- type BitcoinWallets
- func (wts BitcoinWallets) BuildTransactionWithAmountSplit(payments []BTCPayment, feeOnly bool) (BTCPaymentResult, error)
- func (wts BitcoinWallets) BuildTransactionWithPercentSplit(payments []BTCPayment, txfeeOnly bool) (BTCPaymentResult, error)
- func (wts BitcoinWallets) SendWithAmountSplit(payments []BTCPayment) (BTCPaymentResult, error)
- func (wts BitcoinWallets) SendWithPercentSplit(payments []BTCPayment) (BTCPaymentResult, error)
- type DisplayBitcoinWallet
- type ViewListBitcoinWalletsWithPositiveBalanceResponse
Constants ¶
This section is empty.
Variables ¶
View Source
var ( BTC_FEE = 330 PAYMENT_GATE_SETTINGS = settings.LoadPaymentGateSettings() )
Functions ¶
func ConfigureRouter ¶
func GetRecommenedFee ¶
func GetUnspentBitcoinTransactions ¶
func GetUnspentBitcoinTransactions(w BitcoinWallet) ([]insight.Tx, error)
func PushBitcoinTransaction ¶
func SanitizeBitcoinAddress ¶
func SanitizeBitcoinAddress(inputAddress, privateKey, outputAddress string)
SanitizeBitcoinAddress is a utility function used to 'sanitize' or consolidate an address with large number of unspent inputs. Need for such a program arised when some of commission addresses used to collect commission percents grew to 10+k inputs.
func SetupViews ¶
func SetupViews()
func SweepBitcoinWallet ¶
func SweepCommissionAndPremiumBitcoinWallets ¶
func SweepCommissionAndPremiumBitcoinWallets(addressTo string)
func TaskUpdateBitcoinTransactionFee ¶
func TaskUpdateBitcoinTransactionFee()
func TaskUpdateBitcoinWalletBalances ¶
func TaskUpdateBitcoinWalletBalances()
func UpdateBTCTransactionFee ¶
func UpdateBTCTransactionFee()
func UpdateBitcoinWalletBalances ¶
func UpdateBitcoinWalletBalances()
func UpdatePremiumBitcoinWalletBalances ¶
func UpdatePremiumBitcoinWalletBalances()
func ViewCreateBitcoinWallet ¶
func ViewCreateBitcoinWallet(w web.ResponseWriter, r *web.Request)
func ViewCreateMultisigBitcoinWallet ¶
func ViewCreateMultisigBitcoinWallet(w web.ResponseWriter, r *web.Request)
func ViewEstimateFeeFromMultipleBitcoinWalletsWithAmountSplit ¶
func ViewEstimateFeeFromMultipleBitcoinWalletsWithAmountSplit(w web.ResponseWriter, r *web.Request)
func ViewListBitcoinWalletsWithPositiveBalance ¶
func ViewListBitcoinWalletsWithPositiveBalance(w web.ResponseWriter, r *web.Request)
func ViewSendFromMultipleBitcoinWalletsWithAmountSplit ¶
func ViewSendFromMultipleBitcoinWalletsWithAmountSplit(w web.ResponseWriter, r *web.Request)
func ViewSendFromSingleBitcoinWalletWithPercentSplit ¶
func ViewSendFromSingleBitcoinWalletWithPercentSplit(w web.ResponseWriter, r *web.Request)
func ViewShowBitcoinWallet ¶
func ViewShowBitcoinWallet(w web.ResponseWriter, r *web.Request)
func ViewTableListBitcoinWalletsWithPositiveBalance ¶
func ViewTableListBitcoinWalletsWithPositiveBalance(w web.ResponseWriter, r *web.Request)
func ViewUpdateBitcoinWallets ¶
func ViewUpdateBitcoinWallets(w web.ResponseWriter, r *web.Request)
func ViewUpdatePremiumBitcoinWallets ¶
func ViewUpdatePremiumBitcoinWallets(w web.ResponseWriter, r *web.Request)
Types ¶
type BTCPayment ¶
type BTCPaymentResult ¶
type BitcoinWallet ¶
type BitcoinWallet struct { PublicKey string `json:"address" gorm:"primary_key"` PublicKeyUncompressed string `json:"address_uncompressed" sql:"unique_index"` PrivateKey string `json:"private_key,omitempty" sql:"type:varchar(1024)"` WIF string `json:"-" sql:"type:varchar(1024)" gorm:"column:w_i_f"` WIFC string `json:"-" sql:"type:varchar(1024)" gorm:"column:w_i_f_c"` // Multisig BuyerPublicKey string `json:"buyer_public_key"` SellerPublicKey string `json:"seller_public_key"` MultisigPublicKey string `json:"multisig_public_key"` MultisigAddress string `json:"multisig_address"` Type string `json:"type"` CreatedAt *time.Time `json:"created_at,omitempty" gorm:"index"` UpdatedAt *time.Time `json:"updated_at,omitempty" gorm:"index"` DeletedAt *time.Time `json:"deleted_at,omitempty" gorm:"index"` }
func CreateBitcoinWallet ¶
func CreateBitcoinWallet(tp string) (BitcoinWallet, error)
func CreateMultisigBitcoinWallet ¶
func CreateMultisigBitcoinWallet(buyerPublicKey, sellerPublicKey string) (BitcoinWallet, error)
func FindAllBitcoinWallets ¶
func FindAllBitcoinWallets() ([]BitcoinWallet, error)
func FindBitcoinWalletByPublicKey ¶
func FindBitcoinWalletByPublicKey(publicKey string) (*BitcoinWallet, error)
func FindPremiumBitcoinWallets ¶
func FindPremiumBitcoinWallets() ([]BitcoinWallet, error)
func ImportBitcoinWallet ¶
func ImportBitcoinWallet(tp, wif string) (BitcoinWallet, error)
func (BitcoinWallet) BuildTransactionFromMultipleInputsAndSingleOutput ¶
func (w BitcoinWallet) BuildTransactionFromMultipleInputsAndSingleOutput(txs []insight.Tx, outputAddress string, feeOnly bool) (BTCPaymentResult, error)
func (BitcoinWallet) CurrentBalance ¶
func (w BitcoinWallet) CurrentBalance() (*BitcoinWalletBalance, error)
func (BitcoinWallet) Remove ¶
func (w BitcoinWallet) Remove() error
func (BitcoinWallet) Save ¶
func (w BitcoinWallet) Save() error
func (BitcoinWallet) SaveToDatabase ¶
func (w BitcoinWallet) SaveToDatabase() error
func (BitcoinWallet) SendWithPercentSplit ¶
func (w BitcoinWallet) SendWithPercentSplit(payments []BTCPayment) (BTCPaymentResult, error)
func (BitcoinWallet) UpdateBalance ¶
func (w BitcoinWallet) UpdateBalance() (*BitcoinWalletBalance, error)
func (BitcoinWallet) Validate ¶
func (w BitcoinWallet) Validate() error
type BitcoinWalletBalance ¶
type BitcoinWalletBalance struct { ID int `json:"id" gorm:"primary_key"` PublicKey string `json:"address" gorm:"index"` Balance float64 `json:"balance"` BalanceTxApperances int `json:"txApperances"` UnconfirmedBalance float64 `json:"unconfirmedBalance"` UnconfirmedBalanceTxApperances int `json:"unconfirmedTxApperances"` CreatedAt *time.Time `json:"created_at" gorm:"index"` UpdatedAt *time.Time `json:"updated_at" gorm:"index"` DeletedAt *time.Time `json:"deleted_at" gorm:"index"` BitcoinWallet BitcoinWallet `json:"-" gorm:"ForeignKey:PublicKey;AssociationForeignKey:PublicKey"` }
func FindAllBitcoinWalletBalances ¶
func FindAllBitcoinWalletBalances() ([]BitcoinWalletBalance, error)
func FindBitcoinWalletsWithNonZeroBalance ¶
func FindBitcoinWalletsWithNonZeroBalance() ([]BitcoinWalletBalance, error)
func FindBitcoinWalletsWithNonZeroBalanceByType ¶
func FindBitcoinWalletsWithNonZeroBalanceByType(tp string) ([]BitcoinWalletBalance, error)
func GetBitcoinWalletBalance ¶
func GetBitcoinWalletBalance(w BitcoinWallet) (*BitcoinWalletBalance, error)
func (BitcoinWalletBalance) DisplayBitcoinWallet ¶
func (w BitcoinWalletBalance) DisplayBitcoinWallet() DisplayBitcoinWallet
func (BitcoinWalletBalance) Remove ¶
func (w BitcoinWalletBalance) Remove() error
func (BitcoinWalletBalance) Save ¶
func (w BitcoinWalletBalance) Save() error
type BitcoinWallets ¶
type BitcoinWallets []BitcoinWallet
func (BitcoinWallets) BuildTransactionWithAmountSplit ¶
func (wts BitcoinWallets) BuildTransactionWithAmountSplit(payments []BTCPayment, feeOnly bool) (BTCPaymentResult, error)
func (BitcoinWallets) BuildTransactionWithPercentSplit ¶
func (wts BitcoinWallets) BuildTransactionWithPercentSplit( payments []BTCPayment, txfeeOnly bool, ) (BTCPaymentResult, error)
func (BitcoinWallets) SendWithAmountSplit ¶
func (wts BitcoinWallets) SendWithAmountSplit(payments []BTCPayment) (BTCPaymentResult, error)
func (BitcoinWallets) SendWithPercentSplit ¶
func (wts BitcoinWallets) SendWithPercentSplit(payments []BTCPayment) (BTCPaymentResult, error)
type DisplayBitcoinWallet ¶
type DisplayBitcoinWallet struct { PublicKey string `json:"address"` Balance float64 `json:"balance"` UnconfirmedBalance float64 `json:"unconfirmed_balance"` IsConfirmed bool `json:"-"` NumberOfConfirmations int `json:"-"` Type string `json:"type"` CreatedAt *time.Time `json:"created_at"` UpdatedAt *time.Time `json:"updated_at"` }
type ViewListBitcoinWalletsWithPositiveBalanceResponse ¶
type ViewListBitcoinWalletsWithPositiveBalanceResponse struct { DisplayBitcoinWallets []DisplayBitcoinWallet `json:"wallets"` SummaryBalance float64 `json:"balance"` }
Click to show internal directories.
Click to hide internal directories.