Documentation
¶
Index ¶
- func ConvertBtc(btc float64) uint64
- type AddrType
- type Bip9Fork
- type Bip9Stats
- type BlindRawTransactionReq
- type BlockVerbosity
- type ChainInfo
- type CreateRawTransactionReq
- type CreateWalletReq
- type DecodeRawTransactionReq
- type DumpBlindingKeyReq
- type EchoRequest
- type Elements
- func (e *Elements) BlindRawTransaction(hex string) (string, error)
- func (b *Elements) CreateRawTx(ins []*TxIn, outs []*TxOut, locktime *uint32, replaceable *bool) (string, error)
- func (b *Elements) CreateWallet(walletName string) (string, error)
- func (b *Elements) DecodeRawTx(txstring string) (*Tx, error)
- func (b *Elements) DumpBlindingKey(address string) (string, error)
- func (b *Elements) Echo() error
- func (b *Elements) Endpoint() string
- func (b *Elements) EstimateFee(blocks uint32, mode string) (*FeeResponse, error)
- func (b *Elements) FundRawTx(txstring string) (*FundRawResult, error)
- func (b *Elements) FundRawWithOptions(txstring string, options *FundRawOptions, iswitness *bool) (*FundRawResult, error)
- func (b *Elements) GenerateToAddress(address string, numBlocks uint) ([]string, error)
- func (b *Elements) GetBalance() (uint64, error)
- func (b *Elements) GetBlockHash(height uint32) (string, error)
- func (b *Elements) GetBlockHeader(blockHash string) (*GetBlockHeaderRes, error)
- func (b *Elements) GetBlockHeight() (uint64, error)
- func (b *Elements) GetChainInfo() (*ChainInfo, error)
- func (b *Elements) GetNetworkInfo() (*NetworkInfo, error)
- func (b *Elements) GetNewAddress(addrType int) (string, error)
- func (b *Elements) GetRawBlock(blockhash string) (string, error)
- func (b *Elements) GetRawtransaction(txId string) (string, error)
- func (b *Elements) GetRawtransactionWithBlockHash(txId string, blockHash string) (string, error)
- func (b *Elements) GetTxOut(txid string, vout uint32) (*TxOutResp, error)
- func (b *Elements) ImportAddress(address, label string, rescan bool) error
- func (b *Elements) ListWallets() ([]string, error)
- func (b *Elements) LoadWallet(fileName string, loadOnStartup bool) (string, error)
- func (b *Elements) NextId() *jrpc2.Id
- func (b *Elements) Ping() (bool, error)
- func (e *Elements) RawBlindRawTransaction(hex string, inputAmountBlinders []string, inputAmounts []uint64, ...) (string, error)
- func (b *Elements) SendRawTx(txstring string) (string, error)
- func (b *Elements) SendToAddress(address, amount string) (string, error)
- func (b *Elements) SendToAddressCustom(req *SendToAddrReq) (string, error)
- func (e *Elements) SetLabel(address, label string) error
- func (b *Elements) SetRpcWallet(rpcWallet string)
- func (b *Elements) SetTimeout(secs uint)
- func (b *Elements) SignRawTransactionWithWallet(hexString string) (SignRawTransactionWithWalletRes, error)
- func (e *Elements) StartUp(host string, port uint) error
- func (b *Elements) UnblindRawtransaction(hex string) (string, error)
- type EstimateFeeRequest
- type FeeResponse
- type Fork
- type FundRawOptions
- type FundRawResult
- type FundRawTransactionReq
- type GenerateToAddrRequest
- type GetBalanceRequest
- type GetBalanceRes
- type GetBlockChainInfoRequest
- type GetBlockCountReq
- type GetBlockHashRequest
- type GetBlockHeaderReq
- type GetBlockHeaderRequest
- type GetBlockHeaderRes
- type GetBlockRequest
- type GetNetworkInfoReq
- type GetNewAddressRequest
- type GetRawTransactionReq
- type GetTxOutRequest
- type ImportAddressReq
- type ListWalletsReq
- type LoadWalletReq
- type NetworkInfo
- type OutScript
- type PingRequest
- type PsbtInput
- type PsbtOutput
- type RawBlindRawTransactionReq
- type RejectObj
- type Script
- type SendRawTransactionReq
- type SendToAddrReq
- type SetLabelReq
- type SignRawTransactionWithWalletReq
- type SignRawTransactionWithWalletRes
- type Tx
- type TxError
- type TxIn
- type TxInput
- type TxOut
- type TxOutResp
- type TxOutput
- type UnblindRawTransactionReq
- type UnblindRawTransactionRes
- type WalletCreatFundedPsbtRes
- type WalletCreateFundedPsbtReq
- type WalletRes
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertBtc ¶
Types ¶
type BlindRawTransactionReq ¶
type BlindRawTransactionReq struct {
HexString string `json:"hexstring"`
}
func (*BlindRawTransactionReq) Name ¶
func (b *BlindRawTransactionReq) Name() string
type BlockVerbosity ¶
type BlockVerbosity uint16
const ( RawBlock BlockVerbosity = iota Json_TxId Json_TxData )
FIXME: support options other than just raw block data
type ChainInfo ¶
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 CreateWalletReq ¶
type CreateWalletReq struct {
WalletName string `json:"wallet_name"`
}
func (*CreateWalletReq) Name ¶
func (r *CreateWalletReq) 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 DumpBlindingKeyReq ¶
type DumpBlindingKeyReq struct {
Address string `json:"address"`
}
func (*DumpBlindingKeyReq) Name ¶
func (r *DumpBlindingKeyReq) Name() string
type EchoRequest ¶
type EchoRequest struct {
}
func (*EchoRequest) Name ¶
func (r *EchoRequest) Name() string
type Elements ¶
type Elements struct {
CookiePath string
// contains filtered or unexported fields
}
func NewElements ¶
func (*Elements) BlindRawTransaction ¶
func (*Elements) CreateRawTx ¶
func (*Elements) DumpBlindingKey ¶
func (*Elements) EstimateFee ¶
func (b *Elements) EstimateFee(blocks uint32, mode string) (*FeeResponse, error)
func (*Elements) FundRawTx ¶
func (b *Elements) FundRawTx(txstring string) (*FundRawResult, error)
Defaults to a segwit transaction
func (*Elements) FundRawWithOptions ¶
func (b *Elements) FundRawWithOptions(txstring string, options *FundRawOptions, iswitness *bool) (*FundRawResult, error)
func (*Elements) GenerateToAddress ¶
func (*Elements) GetBalance ¶
GetBalance returns balance in sats
func (*Elements) GetBlockHeader ¶
func (b *Elements) GetBlockHeader(blockHash string) (*GetBlockHeaderRes, error)
func (*Elements) GetBlockHeight ¶
func (*Elements) GetChainInfo ¶
func (*Elements) GetNetworkInfo ¶
func (b *Elements) GetNetworkInfo() (*NetworkInfo, error)
func (*Elements) GetRawBlock ¶
fetches raw block hex-string
func (*Elements) GetRawtransaction ¶
func (*Elements) GetRawtransactionWithBlockHash ¶
func (*Elements) ImportAddress ¶
func (*Elements) ListWallets ¶
func (*Elements) LoadWallet ¶
func (*Elements) RawBlindRawTransaction ¶
func (*Elements) SendToAddress ¶
func (*Elements) SendToAddressCustom ¶
func (b *Elements) SendToAddressCustom(req *SendToAddrReq) (string, error)
func (*Elements) SetRpcWallet ¶
func (*Elements) SetTimeout ¶
func (*Elements) SignRawTransactionWithWallet ¶
func (b *Elements) SignRawTransactionWithWallet(hexString string) (SignRawTransactionWithWalletRes, error)
type EstimateFeeRequest ¶
type EstimateFeeRequest struct {
Blocks uint32 `json:"conf_target"`
Mode string `json:"estimate_mode,omitempty"`
}
func (*EstimateFeeRequest) Name ¶
func (r *EstimateFeeRequest) Name() string
type FeeResponse ¶
type FeeResponse struct {
FeeRate float64 `json:"feerate,omitempty"`
Errors []string `json:"errors,omitempty"`
Blocks uint32 `json:"blocks"`
}
func (*FeeResponse) SatPerKb ¶
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 GetBalanceRequest ¶
type GetBalanceRequest struct {
}
func (*GetBalanceRequest) Name ¶
func (r *GetBalanceRequest) Name() string
type GetBalanceRes ¶
type GetBalanceRes struct {
BitcoinAmt float64 `json:"bitcoin"`
}
type GetBlockChainInfoRequest ¶
type GetBlockChainInfoRequest struct{}
func (*GetBlockChainInfoRequest) Name ¶
func (r *GetBlockChainInfoRequest) Name() string
type GetBlockCountReq ¶
type GetBlockCountReq struct{}
func (*GetBlockCountReq) Name ¶
func (r *GetBlockCountReq) Name() string
type GetBlockHashRequest ¶
type GetBlockHashRequest struct {
BlockHeight uint32 `json:"height"`
}
func (*GetBlockHashRequest) Name ¶
func (r *GetBlockHashRequest) Name() string
type GetBlockHeaderReq ¶
func (*GetBlockHeaderReq) Name ¶
func (r *GetBlockHeaderReq) Name() string
type GetBlockHeaderRequest ¶
type GetBlockHeaderRequest struct {
BlockHash string `json:"blockhash"`
}
type GetBlockHeaderRes ¶
type GetBlockHeaderRes struct {
Hash string `json:"hash"`
Confirmations uint32 `json:"confirmations"`
Height uint32 `json:"height"`
Version uint32 `json:"version"`
VersionHex string `json:"versionHex"`
Merkleroot string `json:"merkleroot"`
Time uint64 `json:"time"`
Mediantime uint64 `json:"mediantime"`
Nonce uint32 `json:"nonce"`
Bits string `json:"bits"`
Difficulty float64 `json:"difficulty"`
Chainwork string `json:"chainwork"`
NTx uint32 `json:"nTx"`
Previousblockhash string `json:"previousblockhash"`
Nextblockhash string `json:"nextblockhash"`
}
type GetBlockRequest ¶
type GetBlockRequest struct {
BlockHash string `json:"blockhash"`
// valid options: 0,1,2
Verbosity BlockVerbosity `json:"verbosity"`
}
func (*GetBlockRequest) Name ¶
func (r *GetBlockRequest) Name() string
type GetNetworkInfoReq ¶
type GetNetworkInfoReq struct {
}
func (*GetNetworkInfoReq) Name ¶
func (r *GetNetworkInfoReq) 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 ¶
type GetRawTransactionReq struct {
TxId string `json:"txid"`
Blockhash string `json:"blockhash,omitempty"`
}
func (*GetRawTransactionReq) Name ¶
func (r *GetRawTransactionReq) Name() string
type GetTxOutRequest ¶
type GetTxOutRequest struct {
TxId string `json:"txid"`
Vout uint32 `json:"n"`
IncludeMempool bool `json:"include_mempool"`
}
func (*GetTxOutRequest) Name ¶
func (r *GetTxOutRequest) Name() string
type ImportAddressReq ¶
type ImportAddressReq struct {
Address string `json:"address"`
Label string `json:"label"`
Rescan bool `json:"rescan"`
}
func (*ImportAddressReq) Name ¶
func (r *ImportAddressReq) Name() string
type ListWalletsReq ¶
type ListWalletsReq struct{}
func (*ListWalletsReq) Name ¶
func (l *ListWalletsReq) Name() string
type LoadWalletReq ¶
type LoadWalletReq struct {
FileName string `json:"filename"`
LoadOnStartup bool `json:"load_on_startup"`
}
func (*LoadWalletReq) Name ¶
func (r *LoadWalletReq) Name() string
type NetworkInfo ¶
type PingRequest ¶
type PingRequest struct{}
func (*PingRequest) Name ¶
func (r *PingRequest) Name() string
type PsbtOutput ¶
type RawBlindRawTransactionReq ¶
type RawBlindRawTransactionReq struct {
HexString string `json:"hexstring"`
InputAmountBlinders []string `json:"inputamountblinders"`
InputAmounts []uint64 `json:"inputamounts"`
InputAssets []string `json:"inputassets"`
InputAssetBlinders []string `json:"inputassetblinders"`
IgnoreBlindFail bool `json:"ignoreblindfails"`
}
func (*RawBlindRawTransactionReq) Name ¶
func (b *RawBlindRawTransactionReq) 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"`
AssetLabel string `json:"assetlabel"`
}
func (*SendToAddrReq) Name ¶
func (r *SendToAddrReq) Name() string
type SetLabelReq ¶
func (*SetLabelReq) Name ¶
func (r *SetLabelReq) Name() string
type SignRawTransactionWithWalletReq ¶
type SignRawTransactionWithWalletReq struct {
HexString string `json:"hexstring"`
}
func (*SignRawTransactionWithWalletReq) Name ¶
func (s *SignRawTransactionWithWalletReq) Name() string
type Tx ¶
type Tx struct {
TxId string `json:"txid"`
Hash string `json:"hash"`
Size uint `json:"size"`
VirtualSize uint `json:"vsize"`
DiscountVirtualSize uint `json:"discountvsize"`
Weight uint `json:"weight"`
Version uint `json:"version"`
Locktime uint32 `json:"locktime"`
Inputs []*TxInput `json:"vin"`
Outputs []*TxOutput `json:"vout"`
}
type UnblindRawTransactionReq ¶
type UnblindRawTransactionReq struct {
Hex string `json:"hex"`
}
func (*UnblindRawTransactionReq) Name ¶
func (u *UnblindRawTransactionReq) Name() string
type UnblindRawTransactionRes ¶
type UnblindRawTransactionRes struct {
Hex string `json:"hex"`
}
type WalletCreatFundedPsbtRes ¶
type WalletCreatFundedPsbtRes struct {
}
type WalletCreateFundedPsbtReq ¶
type WalletCreateFundedPsbtReq struct {
Inputs []PsbtInput `json:"inputs"`
Outputs []PsbtOutput `json:"outputs"`
}
Click to show internal directories.
Click to hide internal directories.