assets

package
v0.31.0-beta Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2025 License: MIT Imports: 20 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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.

Jump to

Keyboard shortcuts

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