Commit Graph

110 Commits

Author SHA1 Message Date
744181776f container: completion.bash: set xtrace if debug enabled 2024-08-14 19:40:55 -07:00
e9e2ed6d88 container: finance.bash: set xtrace if debug enabled 2024-08-14 19:40:55 -07:00
bf1d9dd212 container: completion: add hledger-vui
The custom visidata UI (not `hledger-ui`).
2024-08-14 19:36:53 -07:00
550110ffd1 container: finance.bash: add hledger-vui to usage help
The custom visidata UI (not `hledger-ui`).
2024-08-14 19:36:53 -07:00
7e75bb542b container: completion: add hledger family
Since inception, the intent was to abstract the "interface" to allow for
a general-purpose CLI accounting ledger. However, there appears to be
confusion about whether the underlying implementation is `ledger`
accounting software or `hledger` accounting software.

So, making it clearer that it's `hledger` accounting software (although,
will continue to keep the `ledger` command for backwards-compatibility).
2024-08-14 19:36:53 -07:00
d06c894acb container: finance.bash: clarify hledger (not ledger)
Since inception, the intent was to abstract the "interface" to allow for
a general-purpose CLI accounting ledger. However, there appears to be
confusion about whether the underlying implementation is `ledger`
accounting software or `hledger` accounting software.

So, making it clearer that it's `hledger` accounting software (although,
will continue to keep the `ledger` command for backwards-compatibility).
2024-08-14 19:36:52 -07:00
f14adfea35 container: root: move clang-format to container base path
File needs to be in parent directory of all C++ source files.
2024-08-12 18:59:51 -07:00
6e250c7282 container: root: add plugins support
- Implements support for docker-finance C++ plugins
- Adds shell command execution wrapper
- Refactors previous loader path
  * A './' path is unnecessary and will break calls to '/' path
2024-08-12 18:59:51 -07:00
f967faeb8a container: plugins: root: add examples 2024-08-12 18:59:51 -07:00
59272e8df7 container: completion: add plugins arg type support 2024-08-12 18:36:26 -07:00
a1d02016f3 container: lib_plugins: add plugins type support
- Adds plugin type support
  * Adds pseudo-paths to help usage
  * Adds arg parsing of given plugin name
    - Prepended pseudo-paths will use repo or custom plugin
2024-08-12 18:36:26 -07:00
01737d37bf client: lib_gen: new custom plugin layout, update example plugin
- Generates new custom plugin directory layout upon `gen`
  * Allows for drop-in client-side/container-side custom plugins

- Moved container plugin example into container's plugins
  * Plugin is no longer generated upon `gen` (it's available in-repo)

- Updates plugin example
    - Provides requisite lib_finance initialization
    - Refactored, added more checks
    - Expand example case
    - Linter fixes
2024-08-12 18:30:45 -07:00
5ef5d24f3b container: bash: completion: add times 2024-08-09 18:03:31 -07:00
5eac855acf container: bash: add times / lib_times 2024-08-09 18:03:31 -07:00
bbf96b0cc2 container: bash: completion: add plugins support 2024-08-08 16:08:54 -07:00
a4f9b401d3 container: bash: add plugins support / lib_plugins
- Executes plugins within profile/subprofile context
  * Hooks into the container's global environment
2024-08-08 16:08:49 -07:00
a81790108b container: add dfi alias
- `dfi` is now primary unified command (saves fingers)
  * `docker-finance` is still available, as this is only an addition
2024-08-06 02:15:38 -07:00
46112a9d43 container: add preliminary bash autocompletion 2024-08-05 16:22:19 -07:00
d7b25e0dae php: fetch: prices: base: catch unrecoverable CoinGecko error
Thrown when 'all' years are requested without paid-plan API key.
2024-07-30 22:54:04 -07:00
f222a5e654 php: fetch: prices: crypto: throw errors with nested status 2024-07-30 22:47:57 -07:00
5609704b25 bash: lib_fetch: create prices dir if nonexistent 2024-07-30 19:02:26 -07:00
731a8c9563 hledger-flow: changelly: cost-basis comments for bitcoin.tax
Issue #51 describes at least a few undocumented bitcoin.tax issues:

  - Bicoin.tax gives unexpected cost-basis results when `Fee` is given
    with `Total` (when `Total` is given in place of `Price`). The
    expectation is that bitcoin.tax will perform the cost-basis
    calculation on `Total` when `Fee` is also given.

    However, bitcoin.tax *will* give expected cost-basis results if
    `Price` is given in place of `Total` (with `Fee` also given) *or* if
    `Total` is given *after* local cost-basis adjustments are made (but
    *without* `Fee` given).

    The rationale for why docker-finance doesn't use `Price`:

      * docker-finance has all of the `Total`s; so `Price` isn't
        necessary.

      * Local price information isn't available for most trades (and
        shouldn't be necessary since all `Total`s are available).

  - Additionally, when `Fee` is non-fiat (crypto), it now must be marked
    as a SPEND in order to be disposed (and to produce an accurate
    closing report).

  - Finally, if `FeeCurrency` *does* not match either `Symbol` or
    `Currency` (e.g., BTC-ETH w/ BNB fee), it's unknown if cost-basis
    must be calculated locally as well (if `Total` is given). Local
    calculations cannot be done because `Fee` price information is
    (almost certainly) not available for this type of trade.

Until upstream can assert that attaching the `Fee` will subsequently
adjust the cost-basis of `Total` *and* dispose of the `Fee` in the
process (while also allowing `Total` to be used in place of `Price`),
the `Fee` (and `FeeCurrency`) column(s) must not be populated and values
instead moved to SPEND (as described above).

Upstream is aware of these issues (since May) and they're in the process
of resolution. In the meantime, docker-finance work-arounds should
suffice for all trades that have a fiat `Fee` and/or a
`Fee`/`FeeCurrency` that matches one side of the trading pair.
2024-07-29 16:15:50 -07:00
f228da98d8 hledger-flow: bittrex: cost-basis work-around for bitcoin.tax
Issue #51 describes at least a few undocumented bitcoin.tax issues:

  - Bicoin.tax gives unexpected cost-basis results when `Fee` is given
    with `Total` (when `Total` is given in place of `Price`). The
    expectation is that bitcoin.tax will perform the cost-basis
    calculation on `Total` when `Fee` is also given.

    However, bitcoin.tax *will* give expected cost-basis results if
    `Price` is given in place of `Total` (with `Fee` also given) *or* if
    `Total` is given *after* local cost-basis adjustments are made (but
    *without* `Fee` given).

    The rationale for why docker-finance doesn't use `Price`:

      * docker-finance has all of the `Total`s; so `Price` isn't
        necessary.

      * Local price information isn't available for most trades (and
        shouldn't be necessary since all `Total`s are available).

  - Additionally, when `Fee` is non-fiat (crypto), it now must be marked
    as a SPEND in order to be disposed (and to produce an accurate
    closing report).

  - Finally, if `FeeCurrency` *does* not match either `Symbol` or
    `Currency` (e.g., BTC-ETH w/ BNB fee), it's unknown if cost-basis
    must be calculated locally as well (if `Total` is given). Local
    calculations cannot be done because `Fee` price information is
    (almost certainly) not available for this type of trade.

Until upstream can assert that attaching the `Fee` will subsequently
adjust the cost-basis of `Total` *and* dispose of the `Fee` in the
process (while also allowing `Total` to be used in place of `Price`),
the `Fee` (and `FeeCurrency`) column(s) must not be populated and values
instead moved to SPEND (as described above).

Upstream is aware of these issues (since May) and they're in the process
of resolution. In the meantime, docker-finance work-arounds should
suffice for all trades that have a fiat `Fee` and/or a
`Fee`/`FeeCurrency` that matches one side of the trading pair.
2024-07-29 16:15:50 -07:00
1975e1dbbb hledger-flow: coinbase: cost-basis work-around for bitcoin.tax
Issue #51 describes at least a few undocumented bitcoin.tax issues:

  - Bicoin.tax gives unexpected cost-basis results when `Fee` is given
    with `Total` (when `Total` is given in place of `Price`). The
    expectation is that bitcoin.tax will perform the cost-basis
    calculation on `Total` when `Fee` is also given.

    However, bitcoin.tax *will* give expected cost-basis results if
    `Price` is given in place of `Total` (with `Fee` also given) *or* if
    `Total` is given *after* local cost-basis adjustments are made (but
    *without* `Fee` given).

    The rationale for why docker-finance doesn't use `Price`:

      * docker-finance has all of the `Total`s; so `Price` isn't
        necessary.

      * Local price information isn't available for most trades (and
        shouldn't be necessary since all `Total`s are available).

  - Additionally, when `Fee` is non-fiat (crypto), it now must be marked
    as a SPEND in order to be disposed (and to produce an accurate
    closing report).

  - Finally, if `FeeCurrency` *does* not match either `Symbol` or
    `Currency` (e.g., BTC-ETH w/ BNB fee), it's unknown if cost-basis
    must be calculated locally as well (if `Total` is given). Local
    calculations cannot be done because `Fee` price information is
    (almost certainly) not available for this type of trade.

Until upstream can assert that attaching the `Fee` will subsequently
adjust the cost-basis of `Total` *and* dispose of the `Fee` in the
process (while also allowing `Total` to be used in place of `Price`),
the `Fee` (and `FeeCurrency`) column(s) must not be populated and values
instead moved to SPEND (as described above).

Upstream is aware of these issues (since May) and they're in the process
of resolution. In the meantime, docker-finance work-arounds should
suffice for all trades that have a fiat `Fee` and/or a
`Fee`/`FeeCurrency` that matches one side of the trading pair.
2024-07-27 00:20:40 -07:00
2c1b896951 hledger-flow: gemini: exchange: cost-basis work-around for bitcoin.tax
Issue #51 describes at least a few undocumented bitcoin.tax issues:

  - Bicoin.tax gives unexpected cost-basis results when `Fee` is given
    with `Total` (when `Total` is given in place of `Price`). The
    expectation is that bitcoin.tax will perform the cost-basis
    calculation on `Total` when `Fee` is also given.

    However, bitcoin.tax *will* give expected cost-basis results if
    `Price` is given in place of `Total` (with `Fee` also given) *or* if
    `Total` is given *after* local cost-basis adjustments are made (but
    *without* `Fee` given).

    The rationale for why docker-finance doesn't use `Price`:

      * docker-finance has all of the `Total`s; so `Price` isn't
        necessary.

      * Local price information isn't available for most trades (and
        shouldn't be necessary since all `Total`s are available).

  - Additionally, when `Fee` is non-fiat (crypto), it now must be marked
    as a SPEND in order to be disposed (and to produce an accurate
    closing report).

  - Finally, if `FeeCurrency` *does* not match either `Symbol` or
    `Currency` (e.g., BTC-ETH w/ BNB fee), it's unknown if cost-basis
    must be calculated locally as well (if `Total` is given). Local
    calculations cannot be done because `Fee` price information is
    (almost certainly) not available for this type of trade.

Until upstream can assert that attaching the `Fee` will subsequently
adjust the cost-basis of `Total` *and* dispose of the `Fee` in the
process (while also allowing `Total` to be used in place of `Price`),
the `Fee` (and `FeeCurrency`) column(s) must not be populated and values
instead moved to SPEND (as described above).

Upstream is aware of these issues (since May) and they're in the process
of resolution. In the meantime, docker-finance work-arounds should
suffice for all trades that have a fiat `Fee` and/or a
`Fee`/`FeeCurrency` that matches one side of the trading pair.
2024-07-27 00:20:31 -07:00
6d119df31b container: lib_taxes: cost-basis work-around for bitcoin.tax
Issue #51 describes at least a few undocumented bitcoin.tax issues:

  - Bicoin.tax gives unexpected cost-basis results when `Fee` is given
    with `Total` (when `Total` is given in place of `Price`). The
    expectation is that bitcoin.tax will perform the cost-basis
    calculation on `Total` when `Fee` is also given.

    However, bitcoin.tax *will* give expected cost-basis results if
    `Price` is given in place of `Total` (with `Fee` also given) *or* if
    `Total` is given *after* local cost-basis adjustments are made (but
    *without* `Fee` given).

    The rationale for why docker-finance doesn't use `Price`:

      * docker-finance has all of the `Total`s; so `Price` isn't
        necessary.

      * Local price information isn't available for most trades (and
        shouldn't be necessary since all `Total`s are available).

  - Additionally, when `Fee` is non-fiat (crypto), it now must be marked
    as a SPEND in order to be disposed (and to produce an accurate
    closing report).

  - Finally, if `FeeCurrency` *does* not match either `Symbol` or
    `Currency` (e.g., BTC-ETH w/ BNB fee), it's unknown if cost-basis
    must be calculated locally as well (if `Total` is given). Local
    calculations cannot be done because `Fee` price information is
    (almost certainly) not available for this type of trade.

Until upstream can assert that attaching the `Fee` will subsequently
adjust the cost-basis of `Total` *and* dispose of the `Fee` in the
process (while also allowing `Total` to be used in place of `Price`),
the `Fee` (and `FeeCurrency`) column(s) must not be populated and values
instead moved to SPEND (as described above).

Upstream is aware of these issues (since May) and they're in the process
of resolution. In the meantime, docker-finance work-arounds should
suffice for all trades that have a fiat `Fee` and/or a
`Fee`/`FeeCurrency` that matches one side of the trading pair.
2024-07-27 00:20:22 -07:00
e7eb92cb33 root: macro: rootlogon.C: update usage
- Adds crypto examples
- Updates/clarifies comments
2024-07-24 15:02:21 -07:00
7901421fd4 root: macro: crypto: add random.C
Generates CSPRNG numbers of various types (impl-specific).
2024-07-24 15:02:21 -07:00
480b42e273 root: test: Random: assert multiple types
- Add test cases for multiple types
- Rewrite to include new interface/impl
- Fix assertion test to not exceed error boundary
2024-07-23 22:21:41 -07:00
879eb6f785 root: src: Random: support multiple types
Allows signed/alternative-unsigned types (impl-specific).
2024-07-23 22:21:41 -07:00
1092cd4adc root: macro: crypto: add hash.C
Generates encoded digests using all available cryptographic libraries.
2024-07-23 20:28:59 -07:00
b08187abba root: macro: common: crypto: use type aliases
Will make accessing scoped tag types a breeze.
2024-07-23 20:27:20 -07:00
0b15857414 root: macro: test: reorg/refactor unit/benchmark 2024-07-23 15:16:33 -07:00
5c47cee552 root: macro: crypto: namespace refactor into common 2024-07-23 15:16:33 -07:00
c3aee1dee8 root: macro: web: namespace refactor into common 2024-07-23 15:16:33 -07:00
a0091423d1 root: macro: utility: namespace refactor into common 2024-07-23 15:16:33 -07:00
8eda51c6bc root: macro: web: crypto: refactor class name
Intended to be used only for RNG.
2024-07-23 15:16:33 -07:00
aeacc69788 root: macro: web: namespace/class name refactor 2024-07-23 15:16:33 -07:00
f8494c18b4 root: macro: web/server common code refactor 2024-07-23 15:16:33 -07:00
fbf8b7ffae root: macro: factor out common code into utility 2024-07-22 17:41:34 -07:00
09c45c794b root: macro: layout reorg, related refactor 2024-07-22 17:41:33 -07:00
c332e71fda hledger-flow: capital-one: bank: mockup: reorder columns
New column order was introduced in #80.
2024-07-20 00:31:30 -07:00
ba0e6f7f2d hledger-flow: ledger: mockup: add Status column
New column was introduced in #73.
2024-07-20 00:31:30 -07:00
64ada34fd4 hledger-flow: ethereum-based: add to Ethereum spam rules 2024-07-19 22:27:20 -07:00
de81ebac84 container: root: macro: rootlogon.C: update usage
API headers are now loaded automatically.
2024-07-17 21:34:51 -07:00
8d2389bee2 container: root: refactor using internal throw/exception handler 2024-07-17 21:34:51 -07:00
9873e63d56 container: root: add unit test for internal throw/exception handler 2024-07-17 21:34:51 -07:00
612f9e5499 container: root: add internal throw/exception handler 2024-07-17 19:45:06 -07:00
dd4100acde container: lib_finance: root: remove call via $ROOTSYS
- Ubuntu 'finance' image now has $ROOTSYS in $PATH
- Fixes breakage on Arch Linux 'finance' image
2024-07-13 19:06:17 -07:00
b4bae82ae7 container: lib_edit: refactor for clearer fatal errors
- Make known that non-zero returns are fatal errors
- Return success on success (iadd | manual)
- Add iadd to `edit` usage help
- Remove outdated comments
2024-07-11 15:42:23 -07:00