Documentation
¶
Index ¶
- func ConvertBtc(btc float64) uint64
- type AddrType
- type Bip9Fork
- type Bip9Stats
- type Bitcoin
- func (b *Bitcoin) CreateRawTx(ins []*TxIn, outs []*TxOut, locktime *uint32, replaceable *bool) (string, error)
- func (b *Bitcoin) DecodeRawTx(txstring string) (*Tx, error)
- func (b *Bitcoin) Echo() error
- func (b *Bitcoin) Endpoint() string
- func (b *Bitcoin) EstimateFee(blocks uint32, mode string) (*FeeResponse, error)
- func (b *Bitcoin) FundRawTx(txstring string) (*FundRawResult, error)
- func (b *Bitcoin) FundRawWithOptions(txstring string, options *FundRawOptions, iswitness *bool) (*FundRawResult, error)
- func (b *Bitcoin) GenerateToAddress(address string, numBlocks uint) ([]string, error)
- func (b *Bitcoin) GetBlockHash(height uint32) (string, error)
- func (b *Bitcoin) GetBlockHeight() (uint64, error)
- func (b *Bitcoin) GetChainInfo() (*ChainInfo, error)
- func (b *Bitcoin) GetNewAddress(addrType AddrType) (string, error)
- func (b *Bitcoin) GetRawBlock(blockhash string) (string, error)
- func (b *Bitcoin) GetRawtransaction(txId string) (string, error)
- func (b *Bitcoin) GetRawtransactionWithBlockHash(txId string, blockHash string) (string, error)
- func (b *Bitcoin) GetTxOut(txid string, vout uint32) (*TxOutResp, error)
- func (b *Bitcoin) NextId() *jrpc2.Id
- func (b *Bitcoin) Ping() (bool, error)
- func (b *Bitcoin) SendRawTx(txstring string) (string, error)
- func (b *Bitcoin) SendToAddress(address, amount string) (string, error)
- func (b *Bitcoin) SetTimeout(secs uint)
- func (b *Bitcoin) StartUp(host, bitcoinDir string, port uint) error
- type BlockVerbosity
- type ChainInfo
- type CreateRawTransactionReq
- type DecodeRawTransactionReq
- type EchoRequest
- type EstimateFeeRequest
- type FeeResponse
- type Fork
- type FundRawOptions
- type FundRawResult
- type FundRawTransactionReq
- type GenerateToAddrRequest
- type GetBlockChainInfoRequest
- type GetBlockCountReq
- type GetBlockHashRequest
- type GetBlockRequest
- type GetNewAddressRequest
- type GetRawTransactionReq
- type GetTxOutRequest
- type OutScript
- type PingRequest
- type RejectObj
- type Script
- type SendRawTransactionReq
- type SendToAddrReq
- type Tx
- type TxIn
- type TxInput
- type TxOut
- type TxOutResp
- type TxOutput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertBtc ¶ added in v0.8.1
Types ¶
type Bitcoin ¶
type Bitcoin struct {
// contains filtered or unexported fields
}
func NewBitcoin ¶
func (*Bitcoin) CreateRawTx ¶
func (*Bitcoin) EstimateFee ¶ added in v0.8.1
func (b *Bitcoin) EstimateFee(blocks uint32, mode string) (*FeeResponse, error)
func (*Bitcoin) FundRawTx ¶
func (b *Bitcoin) FundRawTx(txstring string) (*FundRawResult, error)
Defaults to a segwit transaction
func (*Bitcoin) FundRawWithOptions ¶
func (b *Bitcoin) FundRawWithOptions(txstring string, options *FundRawOptions, iswitness *bool) (*FundRawResult, error)
func (*Bitcoin) GenerateToAddress ¶
func (*Bitcoin) GetBlockHash ¶ added in v0.8.1
func (*Bitcoin) GetBlockHeight ¶ added in v0.8.3
func (*Bitcoin) GetChainInfo ¶ added in v0.8.1
func (*Bitcoin) GetRawBlock ¶ added in v0.8.1
fetches raw block hex-string
func (*Bitcoin) GetRawtransaction ¶ added in v0.8.3
func (*Bitcoin) GetRawtransactionWithBlockHash ¶ added in v0.8.3
func (*Bitcoin) SendToAddress ¶
func (*Bitcoin) SetTimeout ¶
type BlockVerbosity ¶ added in v0.8.1
type BlockVerbosity uint16
const ( RawBlock BlockVerbosity = iota Json_TxId Json_TxData )
FIXME: support options other than just raw block data
type ChainInfo ¶ added in v0.8.1
type ChainInfo struct {
Chain string `json:"chain"`
Blocks uint32 `json:"blocks"`
Headers uint32 `json:"headers"`
BestBlockHash string `json:"bestblockhash"`
Difficulty float64 `json:"difficulty"`
MedianTime uint64 `json:"mediantime"`
VerificationProgress float64 `json:"verificationprogress"`
InitialBlockDownload bool `json:"initialblockdownload"`
ChainWork string `json:"chainwork"`
SizeOnDisk uint64 `json:"size_on_disk"`
Pruned bool `json:"pruned"`
SoftForks []*Fork `json:"softforks"`
Bip9SoftForks map[string]*Bip9Fork `json:"softforks"`
Warnings string `json:"warnings"`
}
type CreateRawTransactionReq ¶
type CreateRawTransactionReq struct {
Ins []*TxIn `json:"inputs"`
Outs []json.RawMessage `json:"outputs"`
Locktime *uint32 `json:"locktime,omitempty"`
Replaceable *bool `json:"replaceable,omitempty"`
}
func (*CreateRawTransactionReq) Name ¶
func (r *CreateRawTransactionReq) Name() string
type DecodeRawTransactionReq ¶
type DecodeRawTransactionReq struct {
TxString string `json:"hexstring"`
IsWitness *bool `json:"iswitness,omitempty"`
}
func (*DecodeRawTransactionReq) Name ¶
func (r *DecodeRawTransactionReq) Name() string
type EchoRequest ¶ added in v0.8.3
type EchoRequest struct {
}
func (*EchoRequest) Name ¶ added in v0.8.3
func (r *EchoRequest) Name() string
type EstimateFeeRequest ¶ added in v0.8.1
type EstimateFeeRequest struct {
Blocks uint32 `json:"conf_target"`
Mode string `json:"estimate_mode,omitempty"`
}
func (*EstimateFeeRequest) Name ¶ added in v0.8.1
func (r *EstimateFeeRequest) Name() string
type FeeResponse ¶ added in v0.8.1
type FeeResponse struct {
FeeRate float64 `json:"feerate,omitempty"`
Errors []string `json:"errors,omitempty"`
Blocks uint32 `json:"blocks"`
}
func (*FeeResponse) SatPerKb ¶ added in v0.8.1
func (fr *FeeResponse) SatPerKb() uint64
type FundRawOptions ¶
type FundRawOptions struct {
ChangeAddress string `json:"changeAddress,omitempty"`
ChangePosition *uint `json:"changePosition,omitempty"`
ChangeType string `json:"change_type,omitempty"`
IncludeWatching *bool `json:"includeWatching,omitempty"`
LockUnspents *bool `json:"lockUnspents,omitempty"`
FeeRate string `json:"feeRate,omitempty"`
// The fee will be equally deducted from the amount of each specified output.
// Those recipients will receive less bitcoins than you enter in their
// corresponding amount field.
// If no outputs are specified here, the sender pays the fee.
// array values: The zero-based output index to deduct fee from,
// before a change output is added.
SubtractFeeFromOutputs []uint `json:"subtractFeeFromOutputs,omitempty"`
Replaceable *bool `json:"replaceable,omitempty"`
ConfirmationTarget uint `json:"conf_target,omitempty"`
EstimateMode string `json:"estimate_mode,omitempty"`
}
type FundRawResult ¶
type FundRawResult struct {
TxString string `json:"hex"`
Fee float64 `json:"fee"`
// Position of the added change output, or -1
ChangePosition int `json:"chanepos"`
}
func (*FundRawResult) HasChange ¶
func (f *FundRawResult) HasChange() bool
type FundRawTransactionReq ¶
type FundRawTransactionReq struct {
TxString string `json:"hexstring"`
Options *FundRawOptions `json:"options,omitempty"`
IsWitness *bool `json:"iswitness,omitempty"`
}
func (*FundRawTransactionReq) Name ¶
func (r *FundRawTransactionReq) Name() string
type GenerateToAddrRequest ¶
type GenerateToAddrRequest struct {
NumBlocks uint `json:"nblocks"`
Address string `json:"address"`
MaxTries uint `json:"maxtries,omitempty"`
}
func (*GenerateToAddrRequest) Name ¶
func (r *GenerateToAddrRequest) Name() string
type GetBlockChainInfoRequest ¶ added in v0.8.1
type GetBlockChainInfoRequest struct{}
func (*GetBlockChainInfoRequest) Name ¶ added in v0.8.1
func (r *GetBlockChainInfoRequest) Name() string
type GetBlockCountReq ¶ added in v0.8.3
type GetBlockCountReq struct{}
func (*GetBlockCountReq) Name ¶ added in v0.8.3
func (r *GetBlockCountReq) Name() string
type GetBlockHashRequest ¶ added in v0.8.1
type GetBlockHashRequest struct {
BlockHeight uint32 `json:"height"`
}
func (*GetBlockHashRequest) Name ¶ added in v0.8.1
func (r *GetBlockHashRequest) Name() string
type GetBlockRequest ¶ added in v0.8.1
type GetBlockRequest struct {
BlockHash string `json:"blockhash"`
// valid options: 0,1,2
Verbosity BlockVerbosity `json:"verbosity"`
}
func (*GetBlockRequest) Name ¶ added in v0.8.1
func (r *GetBlockRequest) Name() string
type GetNewAddressRequest ¶
type GetNewAddressRequest struct {
Label string `json:"label,omitempty"`
AddressType string `json:"address_type,omitempty"`
}
func (*GetNewAddressRequest) Name ¶
func (r *GetNewAddressRequest) Name() string
type GetRawTransactionReq ¶ added in v0.8.3
type GetRawTransactionReq struct {
TxId string `json:"txid"`
Blockhash string `json:"blockhash,omitempty"`
}
func (*GetRawTransactionReq) Name ¶ added in v0.8.3
func (r *GetRawTransactionReq) Name() string
type GetTxOutRequest ¶ added in v0.8.1
type GetTxOutRequest struct {
TxId string `json:"txid"`
Vout uint32 `json:"n"`
IncludeMempool bool `json:"include_mempool"`
}
func (*GetTxOutRequest) Name ¶ added in v0.8.1
func (r *GetTxOutRequest) Name() string
type PingRequest ¶
type PingRequest struct{}
func (*PingRequest) Name ¶
func (r *PingRequest) Name() string
type SendRawTransactionReq ¶
type SendRawTransactionReq struct {
TxString string `json:"hexstring"`
AllowHighFees *bool `json:"allowhighfees,omitempty"`
}
func (*SendRawTransactionReq) Name ¶
func (r *SendRawTransactionReq) Name() string
type SendToAddrReq ¶
type SendToAddrReq struct {
Address string `json:"address"`
Amount string `json:"amount"`
Comment string `json:"comment,omitempty"`
CommentTo string `json:"comment_to,omitempty"`
SubtractFeeFromAmount bool `json:"subtractfeefromamount,omitempty"`
Replaceable bool `json:"replaceable,omitempty"`
ConfirmationTarget uint `json:"conf_target,omitempty"`
FeeEstimateMode string `json:"estimate_mode,omitempty"`
}
func (*SendToAddrReq) Name ¶
func (r *SendToAddrReq) Name() string
type Tx ¶
Click to show internal directories.
Click to hide internal directories.