Skip to content

Simplify fiat amount usage #343

@bumi

Description

@bumi

Using fiat amounts is still a bit complicated.

maybe we can simpify this:

const amount = await fiat.getSatoshiValue({
  amount: 0.1,
  currency: "usd",
});

const invoice = await nwcClient.makeInvoice({
  amount: amount * 1000,
  description: "Video access",
});
const invoice = await nwcClient.makeInvoice({
  amount: USD(0.1),
  description: "Video access",
});

USD is an object that can return sats and millisats values and the SDK checks if it gets a number or an object that has a toMilliSats() function or something.

this USD implementation might need to go into lightning-tools ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions