Giter VIP home page Giter VIP logo

ln-accounting's Introduction

LND Harmony Accounting

Show LN sends and receives in Harmony format

npm version Coverage Status Build Status

getAccountingReport

Get an accounting summary of wallet

Note: Chain fees does not include chain fees paid to close channels

{
  [after]: <Records Created After ISO 8601 Date>
  [before]: <Records Created Before ISO 8601 Date>
  [category]: <Category Filter String>
  currency: <Base Currency Type String>
  [fiat]: <Fiat Currency Type String>
  lnd: <Authenticated LND gRPC API Object>
  [network]: <Network Name String>
  [rate]: <Exchange Function> ({currency, date, fiat}, cbk) => (err, {cents})
  [rate_provider]: <Fiat Rate Provider String> coindesk || coingecko
  request: <Request Function>
}

@returns via cbk or Promise
{
  [chain_fees]: [{
    [amount]: <Amount Number>
    [asset]: <Asset Type String>
    [created_at]: <ISO 8601 Date String>
    [external_id]: <External Reference Id String>
    [from_id]: <Source Id String>
    [id]: <Record Id String>
    [notes]: <Notes String>
    [to_id]: <Destination Id String>
    [type]: <Record Type String>
  }]
  [chain_fees_csv]: <CSV String>
  [chain_sends]: [{
    [amount]: <Amount Number>
    [asset]: <Asset Type String>
    [created_at]: <ISO 8601 Date String>
    [external_id]: <External Reference Id String>
    [from_id]: <Source Id String>
    [id]: <Record Id String>
    [notes]: <Notes String>
    [to_id]: <Destination Id String>
    [type]: <Record Type String>
  }]
  [chain_sends_csv]: <CSV String>
  [forwards]: [{
    [amount]: <Amount Number>
    [asset]: <Asset Type String>
    [created_at]: <ISO 8601 Date String>
    [external_id]: <External Reference Id String>
    [from_id]: <Source Id String>
    [id]: <Record Id String>
    [notes]: <Notes String>
    [to_id]: <Destination Id String>
    [type]: <Record Type String>
  }]
  [forwards_csv]: <CSV String>
  [invoices]: [{
    [amount]: <Amount Number>
    [asset]: <Asset Type String>
    [created_at]: <ISO 8601 Date String>
    [external_id]: <External Reference Id String>
    [from_id]: <Source Id String>
    [id]: <Record Id String>
    [notes]: <Notes String>
    [to_id]: <Destination Id String>
    [type]: <Record Type String>
  }]
  [invoices_csv]: <CSV String>
  [payments]: [{
    [amount]: <Amount Number>
    [asset]: <Asset Type String>
    [created_at]: <ISO 8601 Date String>
    [external_id]: <External Reference Id String>
    [from_id]: <Source Id String>
    [id]: <Record Id String>
    [notes]: <Notes String>
    [to_id]: <Destination Id String>
    [type]: <Record Type String>
  }]
  [payments_csv]: <CSV String>
}

getChainTransactions

Get chain transactions, including sweep fees

{
  [after]: <Records Created After ISO 8601 Date>
  [before]: <Records Created Before ISO 8601 Date>
  lnd: <Authenticated LND Object>
  request: <Request Function>
}

@returns via cbk or Promise
{
  transactions: [{
    [block_id]: <Block Hash String>
    [confirmation_count]: <Confirmation Count Number>
    [confirmation_height]: <Confirmation Block Height Number>
    created_at: <Created ISO 8601 Date String>
    [description]: <Transaction Label String>
    [fee]: <Fees Paid Tokens Number>
    id: <Transaction Id String>
    is_confirmed: <Is Confirmed Bool>
    is_outgoing: <Transaction Outbound Bool>
    output_addresses: [<Address String>]
    tokens: <Tokens Including Fee Number>
    [transaction]: <Raw Transaction Hex String>
  }]
}

parseAmount

Parse a described amount into tokens

{
  amount: <Amount String>
  [variables]: {
    <Name String>: <Amount Number>
  }
}

@throws
<Error>

@returns
{
  tokens: <Tokens Number>
}

rateProviders

Rate provider source options

[<Rate Provider Name String>]

Constants:

[<Rate Provider Name String>]

ln-accounting's People

Contributors

alexbosworth avatar apotdevin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ln-accounting's Issues

sample code in readme

would be good to have some examples in the readme like ln-service repo.

I've tried this

        const lndReport = await lnAccounting.getAccountingReport({lnd, currency: 'BTC', request: test, category: 'chain-fees'  })
        console.log('lnAccounting ', lnAccounting)

it returns

{
json: true,
url: 'https://mempool.space/api/tx/xxx'
}

not clear to me what request function should be.

my expectation is to get a list of received onchain transactions, onchain fees paid over a certain interval...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.