docker-finance | modern accounting for the power-user

Dedicated to Michael Morgan: a beautiful, beautiful soul.

---

Internal signing keys:

  Aaron Fiore (sole author)

    - 518A22F85BEFD32BCC99C48603F90C4F35E0213E
    - 31ECA5C347A0CC0815EDE730A3EACCFCDA7E685E
    - C8187C585CB07A4DA81CC0F37318B50EBE9C0DA8

Internal repositories (rebased from):

  Staging:

    $ git log -n1 --pretty=format:"%H"
    c8e0cd66f6c89fa7b3c62f72fb524a4cc454b7b6

    $ git rev-list --max-parents=0 HEAD
    ac3863b8c234755855f1aea3a07a853122decdf2

  Private:

    $ git log -n1 --pretty=format:"%H"
    69bb3591eaa2990a9637832bb484690e00c4f926

    $ git rev-list --max-parents=0 HEAD
    a5c1cc9fb593c4cf09bc0adfef6cb6d2964511ae
This commit is contained in:
2024-03-04 03:12:40 -08:00
commit b621e87df2
505 changed files with 37687 additions and 0 deletions

View File

@@ -0,0 +1,150 @@
# docker-finance | modern accounting for the power-user
#
# Copyright (C) 2021-2024 Aaron Fiore (Founder, Evergreen Crypto LLC)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# docker-finance @DOCKER_FINANCE_VERSION@
# Documentation:
#
# 1. Replace subaccount names with the subaccount name you created during
# Environment Generation (in your Flow Layout):
#
# - For exchange accounts, this will be a single directory name
# - For blockchain-based accounts, this will be in the format:
#
# subaccount-1[:subaccount-2:...]/address
#
# Where :subaccount-2:... (and successive subaccounts) are optional
# (the final subaccount in the chain being wallet-name (per address)).
#
# 2. For cryptocurrency tickers, visit coingecko.com to get the token's ID.
# Combine the ID with the symbol, as seen below (e.g., bitcoin/BTC).
#
# 3. For account APIs, replace XXXXXXX... with your API-related information.
# Accounts below will provide unique details/caveats on API key creation.
#
# 4. Feel free to delete any unused accounts/subaccounts as needed.
# NOTE:
# The example wallet accounts/addresses used in this file:
# - were picked randomly from the blockchain and are meant to be used for
# demonstration purposes only
# - outside the realm of testing and development, have no association with
# the author or docker-finance or Evergreen Crypto LLC
# - are not endorsements of the wallet's activity or tokenomics
version: @DOCKER_FINANCE_VERSION@
@DOCKER_FINANCE_PROFILE@:
@DOCKER_FINANCE_SUBPROFILE@:
price:
#- "compound-usdt/cUSDT" # NOTE: delisted on coingecko: 2022-06-18
- "aave-usdc/aUSDC"
- "algorand/ALGO"
- "autonolas/OLAS"
- "binance-usd/BUSD"
- "bitcoin/BTC"
- "ethereum/ETH"
- "gemini-dollar/GUSD"
- "litecoin/LTC"
- "matic-network/MATIC"
- "metacade/MCADE"
- "multichain/MULTI"
- "paxos-standard/PAX"
- "paypal-usd/PYUSD"
- "tether/USDT"
- "tezos/XTZ"
- "usd-coin/USDC"
account:
# When creating a Gemini API key, create a key with only the "Auditor" role
gemini:
key: "account-XXXXXXXXXXXXXXXXXXXX"
passphrase:
secret: "XXXXXXXXXXXXXXXXXXXXXXXXXXXX"
# Use this format to fetch all supported symbols/pairs
subaccount: "exchange"
# Use this format to fetch only trades with the following symbols/pairs (all BTC pairs and only GUSD/USD pair)
#subaccount: "exchange/{BTC,gusdusd}"
# When creating a Coinbase V2 API key, select only the "wallet:accounts:read" *AND* "wallet:transactions:read" options
coinbase:
key: "XXXXXXXXXXXXXXXX"
passphrase:
secret: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
# Use this format to fetch all supported symbols/pairs
subaccount: "platform"
# Use this format to fetch only the accounts with the following symbols
#subaccount: "platform/{BTC,LTC,ETH,USDC,USD}"
coinbase-pro:
key: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
passphrase: "XXXXXXXXXXX"
secret: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX=="
subaccount: "exchange"
coinbase-wallet:
# API scanner keys can be generated at etherscan.io, polygonscan.com
# key format: blockchain1/API_KEY1,blockchain2/API_KEY2
key: "ethereum/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
passphrase:
secret:
subaccount:
ethereum:
- "phone:cb-1/0x10Bd3c5d536f69e87C8d4ECB49C01dDc9db4637b"
metamask:
# API scanner keys can be generated at etherscan.io, polygonscan.com
# key format: blockchain1/API_KEY1,blockchain2/API_KEY2
key: "ethereum/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX,polygon/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
passphrase:
secret:
subaccount:
ethereum:
- "laptop:wallet-1/0x6546d43EA6DE45EB7298A2074e239D5573cA02F3"
- "phone:wallet-1/0x236ba53B56FEE4901cdac3170D17f827DF43E969"
polygon:
- "laptop:wallet-2/0xEad0B2b6f6ab84d527569835cd7fe364e067cFFf"
ledger:
# API scanner keys can be generated at etherscan.io, polygonscan.com
# key format: blockchain1/API_KEY1,blockchain2/API_KEY2
key: "ethereum/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
passphrase:
secret:
subaccount:
algorand:
- "nano:x-1:general-1/R7U6QWS4QLDB5YLBI25TWCPW47N565FUUDP6GG5XEWAKD5INLATHIG24NE"
- "nano:x-1:general-2/LO26MYSSWSFN5U6JDXAOZN2HZ3GCQHLXYEPHRTPJDSD4A3IZUK25GCV7UM"
ethereum:
# Hypothetically used with MetaMask but stored on Ledger
- "nano:s-1:usdt-1/0x66ca49dadBA8C6584f178cf7dB67Dd6E868103Cf"
- "nano:s-1:swap-1/0x7aF0C63540F2117b475BFEE83cCb16B2b8c59351"
- "nano:s-plus-1:swap-1/0x1c23B471C65747B848f5119dE6687fF567831E92"
- "nano:x-1:misc-1/0x8360cca892d37201313AF79738551dCa1d0B537d"
tezos:
- "nano:x-1:fun-1/tz1b5qZarKoNC8X4x5cknkptN3n7XfGcxY6r"
- "nano:x-1:staking-1/tz1S1ayWDiHzmL6zFNnY1ivvUkEgDcH88cjx"
pera-wallet:
key:
passphrase:
secret:
subaccount:
algorand:
- "phone:mobile-1/55YXQ2AC7PUOOYIWUFIOGFZ7M5CBWFUDOIT7L3FMZVE7HGC3IKABL7HVOE"
- "phone:mobile-2/NKXSKLVZ5OHFEXDAVBGL4C5BVW4VJ5FHE4LAK2CSDQZTDGW5T5OVJSGAXY"
# vim: syn=yaml sw=2 sts=2 si ai et

View File

@@ -0,0 +1,54 @@
//! docker-finance | modern accounting for the power-user
//!
//! Copyright (C) 2021-2024 Aaron Fiore (Founder, Evergreen Crypto LLC)
//!
//! This program is free software: you can redistribute it and/or modify
//! it under the terms of the GNU General Public License as published by
//! the Free Software Foundation, either version 3 of the License, or
//! (at your option) any later version.
//!
//! This program is distributed in the hope that it will be useful,
//! but WITHOUT ANY WARRANTY; without even the implied warranty of
//! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
//! GNU General Public License for more details.
//!
//! You should have received a copy of the GNU General Public License
//! along with this program. If not, see <https://www.gnu.org/licenses/>.
//!
//! docker-finance @DOCKER_FINANCE_VERSION@
//!
//! Keeps track of financial metadata!
//!
//! Documentation:
//!
//! Customizable to whatever columns you so desire. Here is an example:
//!
account,label,ticker,format,date_added,safe_to_reuse,direction,should_reuse,tied_to,address,notes
coinbase:platform,USD Coin,USDC,ERC-20,2019-01-09 00:01:23,YES,IN,YES,Bob,0xXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX,*** From Bob ONLY ***
electrum:wallet-1,Bitcoin,BTC,Bech32,2022-02-02 02:02:02,YES,IN,NO,electrum:wallet-2,bc1qXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX,Equity transfer
electrum:wallet-1,Bitcoin,BTC,P2SH,2017-01-07 01:23:45,NO,OUT,NO,ABC Services LLC,3XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX,Annual subscription
electrum:wallet-1,Bitcoin,BTC,P2SH,2018-01-08 00:12:34,YES,IN,NO,ABC Services LLC,3XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX,Refund address
electrum:wallet-2,Bitcoin,BTC,Bech32,2020-01-01 02:02:02,YES,IN,YES,gemini:exchange,bc1qXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX,Equity transfer
electrum:wallet-2,Bitcoin,BTC,Bech32,2020-02-02 01:01:01,YES,IN,YES,Work,bc1qXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX,Income
electrum:wallet-2,Bitcoin,BTC,Bech32,2021-02-02 02:02:02,YES,IN,YES,Work,bc1qXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX,Income
electrum:wallet-2,Bitcoin,BTC,Bech32,2022-02-02 03:03:03,YES,IN,YES,Work,bc1qXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX,Income
electrum:wallet-2,Bitcoin,BTC,Bech32,2023-02-02 04:04:04,YES,IN,YES,Work,bc1qXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX,Income
electrum:wallet-2,Bitcoin,BTC,Bech32,2024-02-02 05:05:05,YES,IN,YES,Work,bc1qXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX,Income
gemini:exchange,Bitcoin,BTC,Bech32,2020-02-02 00:00:12,YES,IN,NO,,bc1qXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX,Equity transfer
ledger:nano:s-1:swap-1,Ethereum,ETH,,2024-01-20 16:20:59,YES,IN,YES,,0x7af0c63540f2117b475bfee83ccb16b2b8c59351,Swapping
ledger:nano:s-1:usdt-1,Ethereum,ETH,USDT,2023-12-01 14:21:11,YES,IN,YES,,0x66ca49dadba8c6584f178cf7db67dd6e868103cf,Tether only
ledger:nano:s-plus-1:swap-1,Ethereum,ETH,,2024-01-10 01:26:59,YES,IN,YES,trezor:model:one-1:mywallet,0x1c23b471c65747b848f5119de6687ff567831e92,Equity transfer
ledger:nano:x-1:fun-1,Tezos,XTZ,,2023-09-28 06:55:54,YES,IN,YES,ledger:nano:s-1:mywallet,tz1b5qZarKoNC8X4x5cknkptN3n7XfGcxY6r,Misc
ledger:nano:x-1:general-1,Algorand,ALGO,Base32,2024-01-26 11:10:25,YES,IN,YES,coinbase:platform,R7U6QWS4QLDB5YLBI25TWCPW47N565FUUDP6GG5XEWAKD5INLATHIG24NE,Trading
ledger:nano:x-1:general-2,Algorand,ALGO,Base32,2022-11-24 18:18:35 +0000,YES,IN,YES,lofty.ai:platform,LO26MYSSWSFN5U6JDXAOZN2HZ3GCQHLXYEPHRTPJDSD4A3IZUK25GCV7UM,Misc
ledger:nano:x-1:misc-1,Ethereum,ETH,,2022-11-20 04:32:11,YES,IN,YES,,0x8360cca892d37201313af79738551dca1d0b537d,Misc
ledger:nano:x-1:staking-1,Tezos,XTZ,,2021-08-12 14:30:30,YES,IN,YES,ledger:nano:s-1:mywallet,tz1S1ayWDiHzmL6zFNnY1ivvUkEgDcH88cjx,Equity transfer
metamask:laptop:wallet-1,Ethereum,ETH,,2023-02-03 03:04:23,YES,IN,YES,,0x6546d43ea6de45eb7298a2074e239d5573ca02f3,
metamask:laptop:wallet-2,Polygon,MATIC,,2023-11-04 16:51:04,YES,IN,YES,,0xead0b2b6f6ab84d527569835cd7fe364e067cfff,
metamask:phone:wallet-1,Ethereum,ETH,,2024-01-19 04:13:59,YES,IN,YES,,0x236ba53b56fee4901cdac3170d17f827df43e969,
pera-wallet:phone:mobile-1,Algorand,ALGO,Base32,2024-01-14 17:00:36,YES,IN,YES,,55YXQ2AC7PUOOYIWUFIOGFZ7M5CBWFUDOIT7L3FMZVE7HGC3IKABL7HVOE,Misc
pera-wallet:phone:mobile-2,Algorand,ALGO,Base32,2022-04-13 20:36:55,YES,IN,YES,,NKXSKLVZ5OHFEXDAVBGL4C5BVW4VJ5FHE4LAK2CSDQZTDGW5T5OVJSGAXY,Misc
trezor:model:one-1:wallet-1,Bitcoin,BTC,Bech32,2020-02-01 00:00:01,YES,IN,YES,Spending,bc1qXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX,Refund address
trezor:model:one-1:wallet-1,Bitcoin,BTC,Bech32,2020-02-02 02:02:02,YES,IN,YES,Friends,bc1qXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX,Gifts
trezor:model:t-1:wallet-1,Bitcoin,BTC,Taproot,2021-02-01 00:00:01,YES,IN,YES,Spouse,bc1pXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX,Bills
trezor:model:t-1:wallet-2,Bitcoin,BTC,Taproot,2022-02-02 02:02:02,YES,IN,YES,Spouse,bc1pXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX,Equity transfer

View File

@@ -0,0 +1,74 @@
#!/usr/bin/env bash
# docker-finance | modern accounting for the power-user
#
# Copyright (C) 2021-2024 Aaron Fiore (Founder, Evergreen Crypto LLC)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# docker-finance @DOCKER_FINANCE_VERSION@
#
# Subprofile script
#
[ -z "$DOCKER_FINANCE_CONTAINER_CMD" ] && echo "DOCKER_FINANCE_CONTAINER_CMD not set, check installation" >&2
# NOTE: ledger-based commands ending in `\`: the escape is needed so you can add more arguments as needed
# CLI ledger
alias @DOCKER_FINANCE_SUBPROFILE@_ledger='$DOCKER_FINANCE_CONTAINER_CMD @DOCKER_FINANCE_PROFILE@/@DOCKER_FINANCE_SUBPROFILE@ ledger'
alias @DOCKER_FINANCE_SUBPROFILE@_bal='$DOCKER_FINANCE_CONTAINER_CMD @DOCKER_FINANCE_PROFILE@/@DOCKER_FINANCE_SUBPROFILE@ ledger bal \
assets liabilities \
not:desc:balances\$ not:equity:balances\$ not:archive \
'
# CLI UI
alias @DOCKER_FINANCE_SUBPROFILE@_ui='$DOCKER_FINANCE_CONTAINER_CMD @DOCKER_FINANCE_PROFILE@/@DOCKER_FINANCE_SUBPROFILE@ ledger-ui -w \
assets liabilities \
not:desc:balances\$ not:equity:balances\$ not:archive \
'
# Web UI
alias @DOCKER_FINANCE_SUBPROFILE@_web='$DOCKER_FINANCE_CONTAINER_CMD @DOCKER_FINANCE_PROFILE@/@DOCKER_FINANCE_SUBPROFILE@ ledger-web --serve --host=0.0.0.0 --base-url http://127.0.0.1:5000 --capabilities=view \
assets liabilities \
not:desc:balances\$ not:equity:balances\$ not:archive \
'
# Fetches, imports, generates taxes and reports (using defaults)
alias @DOCKER_FINANCE_SUBPROFILE@_all='$DOCKER_FINANCE_CONTAINER_CMD @DOCKER_FINANCE_PROFILE@/@DOCKER_FINANCE_SUBPROFILE@ all'
# Edit configuration files
alias @DOCKER_FINANCE_SUBPROFILE@_edit='$DOCKER_FINANCE_CONTAINER_CMD @DOCKER_FINANCE_PROFILE@/@DOCKER_FINANCE_SUBPROFILE@ edit'
# Fetch using remote APIs
alias @DOCKER_FINANCE_SUBPROFILE@_fetch='$DOCKER_FINANCE_CONTAINER_CMD @DOCKER_FINANCE_PROFILE@/@DOCKER_FINANCE_SUBPROFILE@ fetch'
# hledger-flow CSV import
alias @DOCKER_FINANCE_SUBPROFILE@_import='$DOCKER_FINANCE_CONTAINER_CMD @DOCKER_FINANCE_PROFILE@/@DOCKER_FINANCE_SUBPROFILE@ import'
# Financial metadata viewer
alias @DOCKER_FINANCE_SUBPROFILE@_meta='$DOCKER_FINANCE_CONTAINER_CMD @DOCKER_FINANCE_PROFILE@/@DOCKER_FINANCE_SUBPROFILE@ meta'
# Generate financial reports
alias @DOCKER_FINANCE_SUBPROFILE@_reports='$DOCKER_FINANCE_CONTAINER_CMD @DOCKER_FINANCE_PROFILE@/@DOCKER_FINANCE_SUBPROFILE@ reports'
# ROOT.cern / Metadata analysis / C++ interpreter
alias @DOCKER_FINANCE_SUBPROFILE@_root='$DOCKER_FINANCE_CONTAINER_CMD @DOCKER_FINANCE_PROFILE@/@DOCKER_FINANCE_SUBPROFILE@ root'
# Generate tax reports
alias @DOCKER_FINANCE_SUBPROFILE@_taxes='$DOCKER_FINANCE_CONTAINER_CMD @DOCKER_FINANCE_PROFILE@/@DOCKER_FINANCE_SUBPROFILE@ taxes'
# vim: syn=bash sw=2 sts=2 si ai et

View File

@@ -0,0 +1,45 @@
#!/usr/bin/env bash
# docker-finance | modern accounting for the power-user
#
# Copyright (C) 2021-2024 Aaron Fiore (Founder, Evergreen Crypto LLC)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# docker-finance @DOCKER_FINANCE_VERSION@
#
# Superscript for your custom scripts and aliases
#
PS1='\[\033[32m\]\u\[\033[00m\]@docker-finance:\[\033[1;30m\]\h \[\033[01;34m\]\w\[\033[00m\] \$ '
[[ -z "$DOCKER_FINANCE_CONTAINER_EDITOR" || -z "$DOCKER_FINANCE_CONTAINER_REPO" || -z "$DOCKER_FINANCE_CONTAINER_SHARED" || -z "$DOCKER_FINANCE_CONTAINER_CMD" ]] && echo "Environment not set, check installation" >&2
export EDITOR="$DOCKER_FINANCE_CONTAINER_EDITOR"
export PATH="$PATH:${HOME}/.local/bin:${DOCKER_FINANCE_CONTAINER_REPO}:${DOCKER_FINANCE_CONTAINER_SHARED}"
# Base command alias
alias docker-finance='$DOCKER_FINANCE_CONTAINER_CMD'
alias finance='$DOCKER_FINANCE_CONTAINER_CMD'
# Traditional aliases
alias c='clear' # or ctrl+l
alias e='exit'
alias grep='grep --color=auto'
# All subprofiles' scripts
@DOCKER_FINANCE_SUBPROFILE_SOURCE@
# vim: syn=bash sw=2 sts=2 si ai et