btc

package
v0.0.0-...-0269a1e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 5, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// NostrID is the ID for state of a btc client in the connection state.
	BtcID = "btc"
)

Variables

This section is empty.

Functions

func State

func State(conState jsonrpc.State) *btcState

State from a connection. If no state is present, it is initialized

Types

type Client

type Client struct {
}

Client exposes nostr related functionality

func NewClient

func NewClient() *Client

func (*Client) CreateWallet

func (c *Client) CreateWallet(ctx context.Context, conState jsonrpc.State, args CreateWallet) (*btcjson.CreateWalletResult, error)

func (*Client) EstimateSmartFee

func (c *Client) EstimateSmartFee(ctx context.Context, conState jsonrpc.State, args EstimateSmartFee) (*btcjson.EstimateSmartFeeResult, error)

func (*Client) GenerateBlocks

func (c *Client) GenerateBlocks(ctx context.Context, conState jsonrpc.State, numBlocks uint32) ([]string, error)

func (*Client) GenerateBlocksToAddress

func (c *Client) GenerateBlocksToAddress(ctx context.Context, conState jsonrpc.State, args GenerateToAddress) ([]string, error)

func (*Client) GetAccount

func (c *Client) GetAccount(ctx context.Context, conState jsonrpc.State, address string) (string, error)

func (*Client) GetAccountAddress

func (c *Client) GetAccountAddress(ctx context.Context, conState jsonrpc.State, account string) (string, error)

func (*Client) GetAddressInfo

func (c *Client) GetAddressInfo(ctx context.Context, conState jsonrpc.State, address string) (*btcjson.GetAddressInfoResult, error)

func (*Client) GetAddressesByAccount

func (c *Client) GetAddressesByAccount(ctx context.Context, conState jsonrpc.State, account string) ([]string, error)

func (*Client) GetBalance

func (c *Client) GetBalance(ctx context.Context, conState jsonrpc.State, account string) (btcutil.Amount, error)

func (*Client) GetBlockCount

func (c *Client) GetBlockCount(ctx context.Context, conState jsonrpc.State) (int64, error)

func (*Client) GetBlockHash

func (c *Client) GetBlockHash(ctx context.Context, conState jsonrpc.State, blockHeight int64) (string, error)

func (*Client) GetBlockStats

func (c *Client) GetBlockStats(ctx context.Context, conState jsonrpc.State, hash string) (*btcjson.GetBlockStatsResult, error)

func (*Client) GetBlockVerboseTx

func (c *Client) GetBlockVerboseTx(ctx context.Context, conState jsonrpc.State, hash string) (*btcjson.GetBlockVerboseTxResult, error)

func (*Client) GetChainTxStats

func (c *Client) GetChainTxStats(ctx context.Context, conState jsonrpc.State, args GetChainTxStatsNBlocksBlockHash) (*btcjson.GetChainTxStatsResult, error)

func (*Client) GetDifficulty

func (c *Client) GetDifficulty(ctx context.Context, conState jsonrpc.State) (float64, error)

func (*Client) GetMiningInfo

func (c *Client) GetMiningInfo(ctx context.Context, conState jsonrpc.State) (*btcjson.GetMiningInfoResult, error)

func (*Client) GetNewAddress

func (c *Client) GetNewAddress(ctx context.Context, conState jsonrpc.State, account string) (string, error)

func (*Client) GetNodeAddresses

func (c *Client) GetNodeAddresses(ctx context.Context, conState jsonrpc.State) ([]btcjson.GetNodeAddressesResult, error)

func (*Client) GetPeerInfo

func (c *Client) GetPeerInfo(ctx context.Context, conState jsonrpc.State) ([]btcjson.GetPeerInfoResult, error)

func (*Client) GetRawTransaction

func (c *Client) GetRawTransaction(ctx context.Context, conState jsonrpc.State, txHash string) (*btcutil.Tx, error)

func (*Client) ImportAddress

func (c *Client) ImportAddress(ctx context.Context, conState jsonrpc.State, address string) error

func (*Client) ImportAddressRescan

func (c *Client) ImportAddressRescan(ctx context.Context, conState jsonrpc.State, args ImportAddressRescan) error

func (*Client) ImportPrivKey

func (c *Client) ImportPrivKey(ctx context.Context, conState jsonrpc.State, wif string) error

func (*Client) ImportPrivKeyLabel

func (c *Client) ImportPrivKeyLabel(ctx context.Context, conState jsonrpc.State, args ImportPrivKeyLabel) error

func (*Client) ImportPrivKeyRescan

func (c *Client) ImportPrivKeyRescan(ctx context.Context, conState jsonrpc.State, args ImportPrivKeyRescan) error

func (*Client) ImportPubKey

func (c *Client) ImportPubKey(ctx context.Context, conState jsonrpc.State, pubKey string) error

func (*Client) ImportPubKeyRescan

func (c *Client) ImportPubKeyRescan(ctx context.Context, conState jsonrpc.State, args ImportPubKeyRescan) error

func (*Client) Load

func (c *Client) Load(ctx context.Context, conState jsonrpc.State, args Load) error

func (*Client) Move

func (c *Client) Move(ctx context.Context, conState jsonrpc.State, args Move) (bool, error)

func (*Client) RenameAccount

func (c *Client) RenameAccount(ctx context.Context, conState jsonrpc.State, args RenameAccount) error

func (*Client) SendToAddress

func (c *Client) SendToAddress(ctx context.Context, conState jsonrpc.State, args SendToAddress) (string, error)

type CreateWallet

type CreateWallet struct {
	Name               string `json:"name"`
	DisablePrivateKeys bool   `json:"disable_private_keys"`
	CreateBlackWallet  bool   `json:"create_blank_wallet"`
	Passphrase         string `json:"passphrase"`
	AvoidReuse         bool   `json:"avoid_reuse"`
}

type EstimateSmartFee

type EstimateSmartFee struct {
	ConfTarget int64                        `json:"conf_target"`
	Mode       btcjson.EstimateSmartFeeMode `json:"mode"`
}

type GenerateToAddress

type GenerateToAddress struct {
	NumBlocks int64  `json:"num_blocks"`
	Address   string `json:"address"`
	MaxTries  int64  `json:"max_tries"`
}

type GetChainTxStatsNBlocksBlockHash

type GetChainTxStatsNBlocksBlockHash struct {
	AmountOfBlocks int32  `json:"amount_of_blocks"`
	BlockHashEnd   string `json:"block_hash_end"`
}

type ImportAddressRescan

type ImportAddressRescan struct {
	Address string `json:"address"`
	Account string `json:"account"`
	Rescan  bool   `json:"rescan"`
}

type ImportPrivKeyLabel

type ImportPrivKeyLabel struct {
	WIF   string `json:"wif"`
	Label string `json:"label"`
}

type ImportPrivKeyRescan

type ImportPrivKeyRescan struct {
	WIF    string `json:"wif"`
	Label  string `json:"label"`
	Rescan bool   `json:"rescan"`
}

type ImportPubKeyRescan

type ImportPubKeyRescan struct {
	PubKey string `json:"pub_key"`
	Rescan bool   `json:"rescan"`
}

type Load

type Load struct {
	Host string `json:"host"`
	User string `json:"user"`
	Pass string `json:"pass"`
}

type Move

type Move struct {
	FromAccount      string         `json:"from_account"`
	ToAccount        string         `json:"to_account"`
	Amount           btcutil.Amount `json:"amount"`
	MinConfirmations int            `json:"min_confirmations"`
	Comment          string         `json:"comment"`
}

type RenameAccount

type RenameAccount struct {
	OldAccount string `json:"old_account"`
	NewAccount string `json:"new_account"`
}

type SendToAddress

type SendToAddress struct {
	Address   string         `json:"address"`
	Amount    btcutil.Amount `json:"amount"`
	Comment   string         `json:"comment"`
	CommentTo string         `json:"comment_to"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL