Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrCurrencyNotAllowed = errors.New("currency not allowed") ErrNoSalesFound = errors.New("no sales found for the current currency and price") )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client for atomic swaps
func NewClient ¶
func NewClient(ctx context.Context, nostr *nostr.Client, eth *goethclient.Client, stellar *stellargoclient.Client) (*Client, error)
NewClient for atomic swaps
func (*Client) AttemptBuy ¶
func (c *Client) AttemptBuy(ctx context.Context, amount uint, currency string, maxPrice uint) (*Driver, error)
Attempt to buy from an already existing swap TODO: in the future this should be changed to keep listening for new sell orders
func (*Client) PlaceSellOrder ¶
func (c *Client) PlaceSellOrder(ctx context.Context, amount uint, currency string, price uint) (*Driver, error)
PlaceSellOrder on nostr relays. A sell order is always for stellar based TFT. The buying currency, as well as the price to buy 1 TFT in that currency is specified. Amount is expressed in whole TFT (= 10_000_000 stropes of TFT). Price is expressed as the smallest possible unit of the target currency.
type Driver ¶
type Driver struct {
// contains filtered or unexported fields
}
Driver for atomic swaps
type DriverStage ¶
type DriverStage = int
const ( // Initial conditions DriverStageOpenSale DriverStage = iota DriverStageStartBuy // In progress DriverStageAcceptedBuy DriverStageSetupSwap DriverStageParticipateSwap // Terminal conditions DriverStageClaimSwap DriverStageDone )
type MsgInitiateEth ¶
type MsgParticipateStellar ¶
type MsgRedeemed ¶
Click to show internal directories.
Click to hide internal directories.