github.com/TrueBlocks/trueblocks-core/src/apps/chifra@v0.0.0-20241022031540-b362680128f7/internal/tokens/README.md (about)

     1  ## chifra tokens
     2  
     3  Given the address of an ERC20 token contract, the `chifra tokens` tool reports token balances for one or
     4  more additional addresses. Alternatively, the tool can report the token balances for multiple ERC20
     5  tokens for a single addresses.
     6  
     7  In normal operation the **first item** in the `address_list` is assumed to be an ERC20 token
     8  contract whose balances are being queried, whereas the remainder of the list is assumed to be
     9  addresses on which to report.
    10  
    11  In `--byAcct` mode, **all addresses** in the `address_list` are assumed to be ERC20 token contracts,
    12  except the final one which is the account whose token balances are reported.
    13  
    14  You may optionally specify one or more blocks at which to report. If no block is specified, the
    15  latest block is assumed. You may also optionally specify which parts of the token data to extract.
    16  
    17  ```[plaintext]
    18  Purpose:
    19    Retrieve token balance(s) for one or more addresses at given block(s).
    20  
    21  Usage:
    22    chifra tokens [flags] <address> <address> [address...] [block...]
    23  
    24  Arguments:
    25    addrs - two or more addresses (0x...), the first is an ERC20 token, balances for the rest are reported (required)
    26    blocks - an optional list of one or more blocks at which to report balances, defaults to 'latest'
    27  
    28  Flags:
    29    -p, --parts strings   which parts of the token information to retrieve
    30                          One or more of [ name | symbol | decimals | totalSupply | version | some | all ]
    31    -b, --by_acct         consider each address an ERC20 token except the last, whose balance is reported for each token
    32    -c, --changes         only report a balance when it changes from one block to the next
    33    -z, --no_zero         suppress the display of zero balance accounts
    34    -o, --cache           force the results of the query into the cache
    35    -D, --decache         removes related items from the cache
    36    -x, --fmt string      export format, one of [none|json*|txt|csv]
    37    -v, --verbose         enable verbose output
    38    -h, --help            display this help screen
    39  
    40  Notes:
    41    - An address must be either an ENS name or start with '0x' and be forty-two characters long.
    42    - Blocks is a space-separated list of values, a start-end range, a special, or any combination.
    43    - If the token contract(s) from which you request balances are not ERC20 compliant, the results are undefined.
    44    - If the queried node does not store historical state, the results are undefined.
    45    - Special blocks are detailed under chifra when --list.
    46    - If the --parts option is not empty, all addresses are considered tokens and each token's attributes are presented.
    47  ```
    48  
    49  Data models produced by this tool:
    50  
    51  - [token](/data-model/chainstate/#token)
    52  
    53  ### Other Options
    54  
    55  All tools accept the following additional flags, although in some cases, they have no meaning.
    56  
    57  ```[plaintext]
    58    -v, --version         display the current version of the tool
    59        --output string   write the results to file 'fn' and return the filename
    60        --append          for --output command only append to instead of replace contents of file
    61        --file string     specify multiple sets of command line options in a file
    62  ```
    63  
    64  **Note:** For the `--file string` option, you may place a series of valid command lines in a file using any
    65  valid flags. In some cases, this may significantly improve performance. A semi-colon at the start
    66  of any line makes it a comment.
    67  
    68  **Note:** If you use `--output --append` option and at the same time the `--file` option, you may not switch
    69  export formats in the command file. For example, a command file with two different commands, one with `--fmt csv`
    70  and the other with `--fmt json` will produce both invalid CSV and invalid JSON.
    71  
    72  *Copyright (c) 2024, TrueBlocks, LLC. All rights reserved. Generated with goMaker.*