assets

package
v0.34.0-beta Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TapdClient

TapdClient is a client for the Tap daemon.

func NewTapdClient

func NewTapdClient(config *TapdConfig) (*TapdClient, error)

NewTapdClient returns a new taproot assets client.

func (*TapdClient) Close

func (c *TapdClient) Close()

Close closes the client connection to the server.

func (*TapdClient) GetAssetName

func (c *TapdClient) GetAssetName(ctx context.Context,
	assetId []byte) (string, error)

GetAssetName returns the human-readable name of the asset.

func (*TapdClient) GetAssetPrice

func (c *TapdClient) GetAssetPrice(ctx context.Context, assetID string,
	peerPubkey []byte, assetAmt uint64, paymentMaxAmt btcutil.Amount) (
	btcutil.Amount, error)

GetAssetPrice returns the price of an asset in satoshis. NOTE: this currently uses the rfq process for the asset price. A future implementation should use a price oracle to not spam a peer.

func (*TapdClient) GetRfqForAsset

func (c *TapdClient) GetRfqForAsset(ctx context.Context,
	satAmount btcutil.Amount, assetId, peerPubkey []byte,
	expiry int64, feeLimitMultiplier float64) (
	*rfqrpc.PeerAcceptedSellQuote, error)

GetRfqForAsset returns a RFQ for the given asset with the given amount and to the given peer.

type TapdConfig

type TapdConfig struct {
	Activate     bool          `long:"activate" description:"Activate the Tap daemon"`
	Host         string        `long:"host" description:"The host of the Tap daemon, in the format of host:port"`
	MacaroonPath string        `long:"macaroonpath" description:"Path to the admin macaroon"`
	TLSPath      string        `long:"tlspath" description:"Path to the TLS certificate"`
	RFQtimeout   time.Duration `long:"rfqtimeout" description:"The timeout we wait for tapd peer to accept RFQ"`
}

TapdConfig is a struct that holds the configuration options to connect to a taproot assets daemon.

func DefaultTapdConfig

func DefaultTapdConfig() *TapdConfig

DefaultTapdConfig returns a default configuration to connect to a taproot assets daemon.

func DefaultTapdConfigForNetwork

func DefaultTapdConfigForNetwork(defaultTapdDir, network string) *TapdConfig

DefaultTapdConfigForNetwork returns the default tapd configuration rooted in defaultTapdDir for the given Bitcoin network. Passing the directory explicitly keeps path construction testable without accessing the user's real tapd data.

Jump to

Keyboard shortcuts

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