Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/cleanups prior to porting #3059

Merged
merged 9 commits into from
Jul 18, 2023
76 changes: 67 additions & 9 deletions docs/content/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,14 @@ paths:
schema:
type: number
format: uint64
- name: reversed
description: produce results in reverse chronological order
required: false
style: form
in: query
explode: true
schema:
type: boolean
- name: firstBlock
description: first block to export (inclusive, ignored when freshening)
required: false
Expand Down Expand Up @@ -307,6 +315,14 @@ paths:
explode: true
schema:
type: boolean
- name: balances
description: traverse the transaction history and show each change in ETH balances
required: false
style: form
in: query
explode: true
schema:
type: boolean
- name: articulate
description: articulate transactions, traces, logs, and outputs
required: false
Expand Down Expand Up @@ -431,6 +447,23 @@ paths:
explode: true
schema:
type: boolean
- name: reversed
description: produce results in reverse chronological order
required: false
style: form
in: query
explode: true
schema:
type: boolean
- name: noZero
description: >
for the --count option only, suppress the display of zero appearance accounts
required: false
style: form
in: query
explode: true
schema:
type: boolean
- name: firstBlock
description: first block to process (inclusive)
required: false
Expand All @@ -457,7 +490,7 @@ paths:
schema:
properties:
data:
description: Produces <a href="/data-model/accounts/#appearance">Appearance</a>, <a href="/data-model/accounts/#reconciliation">Reconciliation</a>, <a href="/data-model/accounts/#monitor">Monitor</a>, <a href="/data-model/accounts/#appearancecount">Appearancecount</a>, <a href="/data-model/accounts/#statement">Statement</a>, <a href="/data-model/chaindata/#transaction">Transaction</a>, <a href="/data-model/chaindata/#transfer">Transfer</a>, <a href="/data-model/chaindata/#receipt">Receipt</a>, <a href="/data-model/chaindata/#log">Log</a>, <a href="/data-model/chaindata/#trace">Trace</a>, <a href="/data-model/chaindata/#traceaction">Traceaction</a>, <a href="/data-model/chaindata/#traceresult">Traceresult</a>, <a href="/data-model/other/#function">Function</a>, and/or <a href="/data-model/other/#parameter">Parameter</a> data. Corresponds to the <a href="/chifra/accounts/#chifra-export">chifra export</a> command line.
description: Produces <a href="/data-model/accounts/#appearance">Appearance</a>, <a href="/data-model/accounts/#reconciliation">Reconciliation</a>, <a href="/data-model/accounts/#monitor">Monitor</a>, <a href="/data-model/accounts/#appearancecount">Appearancecount</a>, <a href="/data-model/accounts/#statement">Statement</a>, <a href="/data-model/chaindata/#transaction">Transaction</a>, <a href="/data-model/chaindata/#transfer">Transfer</a>, <a href="/data-model/chaindata/#receipt">Receipt</a>, <a href="/data-model/chaindata/#log">Log</a>, <a href="/data-model/chaindata/#trace">Trace</a>, <a href="/data-model/chaindata/#traceaction">Traceaction</a>, <a href="/data-model/chaindata/#traceresult">Traceresult</a>, <a href="/data-model/chainstate/#tokenbalance">Tokenbalance</a>, <a href="/data-model/other/#function">Function</a>, and/or <a href="/data-model/other/#parameter">Parameter</a> data. Corresponds to the <a href="/chifra/accounts/#chifra-export">chifra export</a> command line.
type: array
items:
oneOf:
Expand All @@ -473,6 +506,7 @@ paths:
- $ref: "#/components/schemas/trace"
- $ref: "#/components/schemas/traceAction"
- $ref: "#/components/schemas/traceResult"
- $ref: "#/components/schemas/tokenBalance"
- $ref: "#/components/schemas/function"
- $ref: "#/components/schemas/parameter"
example:
Expand Down Expand Up @@ -3348,29 +3382,53 @@ components:
description: "on-chain token-related data such as totalSupply, symbol, decimals, and individual balances for a given address at a given block"
type: object
properties:
blockNumber:
type: number
format: blknum
description: "the block at which the report is made"
transactionIndex:
type: number
format: blknum
description: "the transaction index (if applicable) at which the report is made"
timestamp:
type: number
format: timestamp
description: "the timestamp of the block"
totalSupply:
type: string
format: int256
description: "the total supply of the token contract"
address:
type: string
format: address
example: "0xa1e4...63b4"
description: "the address of the token contract"
holder:
type: string
format: address
example: "0x2910...63d2"
description: "the address for which we are reporting the token balance"
description: "the holder address for which we are reporting"
priorBalance:
type: string
format: int256
description: "the holder's asset balance at its prior appearance"
balance:
type: string
format: int256
example: "258843698360318500"
description: "the balance at the address at the given block height"
address:
description: "the holder's asset balance at the given block height"
diff:
type: string
format: address
example: "0xa1e4...63b4"
description: "the address of the token contract being queried"
format: int256
description: "the difference#&44; if any#&44; between the prior and current balance"
name:
type: string
example: "The DAO Original"
example: "GitCoin"
description: "the name of the token contract, if available"
symbol:
type: string
example: "GTC"
description: "the symbol for this token contract"
description: "the symbol of the token contract"
decimals:
type: number
format: uint64
Expand Down
7 changes: 7 additions & 0 deletions docs/content/chifra/accounts.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ Flags:
-s, --silent freshen the monitor only (no reporting)
-c, --first_record uint the first record to process (default 1)
-e, --max_records uint the maximum number of records to process (default 250)
-E, --reversed produce results in reverse chronological order
-F, --first_block uint first block to export (inclusive, ignored when freshening)
-L, --last_block uint last block to export (inclusive, ignored when freshening)
-x, --fmt string export format, one of [none|json*|txt|csv]
Expand Down Expand Up @@ -117,6 +118,7 @@ Flags:
-n, --neighbors export the neighbors of the given address
-C, --accounting attach accounting records to the exported data (applies to transactions export only)
-A, --statements for the accounting options only, export only statements
-b, --balances traverse the transaction history and show each change in ETH balances
-a, --articulate articulate transactions, traces, logs, and outputs
-o, --cache write transactions to the cache (see notes)
-R, --cache_traces write traces to the cache (see notes)
Expand All @@ -131,6 +133,8 @@ Flags:
One of [ in | out | zero ]
-y, --factory for --traces only, report addresses created by (or self-destructed by) the given address(es)
-u, --unripe export transactions labeled upripe (i.e. less than 28 blocks old)
-E, --reversed produce results in reverse chronological order
-z, --no_zero for the --count option only, suppress the display of zero appearance accounts
-F, --first_block uint first block to process (inclusive)
-L, --last_block uint last block to process (inclusive)
-x, --fmt string export format, one of [none|json*|txt|csv]
Expand All @@ -144,6 +148,8 @@ Notes:
- The --logs option is significantly faster if you provide an --emitter or a --topic.
- Neighbors include every address that appears in any transaction in which the export address also appears.
- If provided, --max_records dominates, also, if provided, --first_record overrides --first_block.
- The --first_record and --max_record options are zero-based (as are the block options).
- The _block and _record options are ignored when used with the --count option.
```

Data models produced by this tool:
Expand All @@ -160,6 +166,7 @@ Data models produced by this tool:
- [trace](/data-model/chaindata/#trace)
- [traceaction](/data-model/chaindata/#traceaction)
- [traceresult](/data-model/chaindata/#traceresult)
- [tokenbalance](/data-model/chainstate/#tokenbalance)
- [function](/data-model/other/#function)
- [parameter](/data-model/other/#parameter)

Expand Down
2 changes: 1 addition & 1 deletion docs/content/chifra/admin.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ Arguments:
One or more of [ index | blooms | blocks | txs | traces | monitors | names | abis | recons | slurps | staging | unripe | maps | some | all ]

Flags:
-c, --first_record uint the first record to process (default 1)
-c, --first_record uint the first record to process
-e, --max_records uint the maximum number of records to process (default 10000)
-x, --fmt string export format, one of [none|json*|txt|csv]
-v, --verbose enable verbose (increase detail with --log_level)
Expand Down
46 changes: 27 additions & 19 deletions docs/content/data-model/chainstate.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,27 @@ The data model displays the token balance records for the `chifra tokens` tool.
The following commands produce and manage TokenBalances:

- [chifra tokens](/chifra/chainstate/#chifra-tokens)
- [chifra export](/chifra/accounts/#chifra-export)

TokenBalances consist of the following fields:

| Field | Description | Type |
| ---------- | ------------------------------------------------------------ | ------- |
| holder | the address for which we are reporting the token balance | address |
| balance | the balance at the address at the given block height | int256 |
| address | the address of the token contract being queried | address |
| name | the name of the token contract, if available | string |
| symbol | the symbol for this token contract | string |
| decimals | the number of decimals for the token contract | uint64 |
| isContract | `true` if the address is a smart contract, `false` otherwise | bool |
| isErc20 | `true` if the address is an ERC20, `false` otherwise | bool |
| isErc721 | `true` if the address is an ERC720, `false` otherwise | bool |
| Field | Description | Type |
| ---------------- | --------------------------------------------------------------------- | --------- |
| blockNumber | the block at which the report is made | blknum |
| transactionIndex | the transaction index (if applicable) at which the report is made | blknum |
| timestamp | the timestamp of the block | timestamp |
| totalSupply | the total supply of the token contract | int256 |
| address | the address of the token contract | address |
| holder | the holder address for which we are reporting | address |
| priorBalance | the holder's asset balance at its prior appearance | int256 |
| balance | the holder's asset balance at the given block height | int256 |
| diff | the difference#&44; if any#&44; between the prior and current balance | int256 |
| name | the name of the token contract, if available | string |
| symbol | the symbol of the token contract | string |
| decimals | the number of decimals for the token contract | uint64 |
| isContract | `true` if the address is a smart contract, `false` otherwise | bool |
| isErc20 | `true` if the address is an ERC20, `false` otherwise | bool |
| isErc721 | `true` if the address is an ERC720, `false` otherwise | bool |

## EthCall

Expand Down Expand Up @@ -94,11 +101,12 @@ EthCalls consist of the following fields:

This documentation mentions the following basic data types.

| Type | Description | Notes |
| ------- | ----------------------------------- | ----------- |
| address | an '0x'-prefixed 20-byte hex string | lowercase |
| blknum | an alias for a uint64 | |
| bool | either `true`, `false`, `1`, or `0` | |
| int256 | a signed big number | as a string |
| string | a normal character string | |
| uint64 | a 64-bit unsigned integer | |
| Type | Description | Notes |
| --------- | ----------------------------------- | -------------- |
| address | an '0x'-prefixed 20-byte hex string | lowercase |
| blknum | an alias for a uint64 | |
| bool | either `true`, `false`, `1`, or `0` | |
| int256 | a signed big number | as a string |
| string | a normal character string | |
| timestamp | a 64-bit unsigned integer | Unix timestamp |
| uint64 | a 64-bit unsigned integer | |
6 changes: 6 additions & 0 deletions docs/readmes/accounts-export.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Flags:
-n, --neighbors export the neighbors of the given address
-C, --accounting attach accounting records to the exported data (applies to transactions export only)
-A, --statements for the accounting options only, export only statements
-b, --balances traverse the transaction history and show each change in ETH balances
-a, --articulate articulate transactions, traces, logs, and outputs
-o, --cache write transactions to the cache (see notes)
-R, --cache_traces write traces to the cache (see notes)
Expand All @@ -50,6 +51,8 @@ Flags:
One of [ in | out | zero ]
-y, --factory for --traces only, report addresses created by (or self-destructed by) the given address(es)
-u, --unripe export transactions labeled upripe (i.e. less than 28 blocks old)
-E, --reversed produce results in reverse chronological order
-z, --no_zero for the --count option only, suppress the display of zero appearance accounts
-F, --first_block uint first block to process (inclusive)
-L, --last_block uint last block to process (inclusive)
-x, --fmt string export format, one of [none|json*|txt|csv]
Expand All @@ -63,6 +66,8 @@ Notes:
- The --logs option is significantly faster if you provide an --emitter or a --topic.
- Neighbors include every address that appears in any transaction in which the export address also appears.
- If provided, --max_records dominates, also, if provided, --first_record overrides --first_block.
- The --first_record and --max_record options are zero-based (as are the block options).
- The _block and _record options are ignored when used with the --count option.
```

Data models produced by this tool:
Expand All @@ -79,6 +84,7 @@ Data models produced by this tool:
- [trace](/data-model/chaindata/#trace)
- [traceaction](/data-model/chaindata/#traceaction)
- [traceresult](/data-model/chaindata/#traceresult)
- [tokenbalance](/data-model/chainstate/#tokenbalance)
- [function](/data-model/other/#function)
- [parameter](/data-model/other/#parameter)

Expand Down
1 change: 1 addition & 0 deletions docs/readmes/accounts-list.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Flags:
-s, --silent freshen the monitor only (no reporting)
-c, --first_record uint the first record to process (default 1)
-e, --max_records uint the maximum number of records to process (default 250)
-E, --reversed produce results in reverse chronological order
-F, --first_block uint first block to export (inclusive, ignored when freshening)
-L, --last_block uint last block to export (inclusive, ignored when freshening)
-x, --fmt string export format, one of [none|json*|txt|csv]
Expand Down
2 changes: 1 addition & 1 deletion docs/readmes/admin-status.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Arguments:
One or more of [ index | blooms | blocks | txs | traces | monitors | names | abis | recons | slurps | staging | unripe | maps | some | all ]

Flags:
-c, --first_record uint the first record to process (default 1)
-c, --first_record uint the first record to process
-e, --max_records uint the maximum number of records to process (default 10000)
-x, --fmt string export format, one of [none|json*|txt|csv]
-v, --verbose enable verbose (increase detail with --log_level)
Expand Down
40 changes: 32 additions & 8 deletions docs/templates/api/components.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1156,29 +1156,53 @@ components:
description: "on-chain token-related data such as totalSupply, symbol, decimals, and individual balances for a given address at a given block"
type: object
properties:
blockNumber:
type: number
format: blknum
description: "the block at which the report is made"
transactionIndex:
type: number
format: blknum
description: "the transaction index (if applicable) at which the report is made"
timestamp:
type: number
format: timestamp
description: "the timestamp of the block"
totalSupply:
type: string
format: int256
description: "the total supply of the token contract"
address:
type: string
format: address
example: "0xa1e4...63b4"
description: "the address of the token contract"
holder:
type: string
format: address
example: "0x2910...63d2"
description: "the address for which we are reporting the token balance"
description: "the holder address for which we are reporting"
priorBalance:
type: string
format: int256
description: "the holder's asset balance at its prior appearance"
balance:
type: string
format: int256
example: "258843698360318500"
description: "the balance at the address at the given block height"
address:
description: "the holder's asset balance at the given block height"
diff:
type: string
format: address
example: "0xa1e4...63b4"
description: "the address of the token contract being queried"
format: int256
description: "the difference#&44; if any#&44; between the prior and current balance"
name:
type: string
example: "The DAO Original"
example: "GitCoin"
description: "the name of the token contract, if available"
symbol:
type: string
example: "GTC"
description: "the symbol for this token contract"
description: "the symbol of the token contract"
decimals:
type: number
format: uint64
Expand Down
Loading