-
-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'next' into feat/init-include
- Loading branch information
Showing
73 changed files
with
1,471 additions
and
228 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
title: "Token balances" | ||
description: "This index allows indexing token balances of contracts compatible with FA1.2 or FA2 standards." | ||
network: "tezos" | ||
--- | ||
|
||
# `tezos.tzkt.token_balances` index | ||
|
||
This index allows indexing token balances of contracts compatible with [FA1.2](https://gitlab.com/tzip/tzip/-/blob/master/proposals/tzip-7/README.md) or [FA2](https://gitlab.com/tzip/tzip/-/blob/master/proposals/tzip-12/tzip-12.md) standards. You can either index transfers and cumulatively calculate balances or use this index type to fetch the latest balance information directly. | ||
|
||
```yaml [dipdup.yaml] | ||
{{ #include ../src/demo_token_balances/dipdup.yaml }} | ||
``` | ||
|
||
Callback receives `TzktTokenBalanceData` model that optionally contains the owner, token, and balance values | ||
|
||
```python | ||
{{ #include ../src/demo_token_balances/handlers/on_balance_update.py }} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Ignore all | ||
* | ||
|
||
# Add metadata and build files | ||
!demo_token_balances | ||
!pyproject.toml | ||
!pdm.lock | ||
!README.md | ||
|
||
# Add Python code | ||
!**/*.py | ||
**/.*_cache | ||
**/__pycache__ | ||
|
||
# Add configs and scripts (but not env!) | ||
!**/*.graphql | ||
!**/*.json | ||
!**/*.sql | ||
!**/*.yaml | ||
!**/*.yml | ||
!**/*.j2 | ||
!**/.keep |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Ignore all | ||
* | ||
!*/ | ||
|
||
# Add metadata and build files | ||
!demo_token_balances | ||
!.gitignore | ||
!.dockerignore | ||
!py.typed | ||
!**/Dockerfile | ||
!**/Makefile | ||
!**/pyproject.toml | ||
!**/pdm.lock | ||
!**/README.md | ||
!**/.keep | ||
|
||
# Add Python code | ||
!**/*.py | ||
**/.*_cache | ||
**/__pycache__ | ||
|
||
# Add configs and scripts (but not env!) | ||
!**/*.graphql | ||
!**/*.json | ||
!**/*.sql | ||
!**/*.yaml | ||
!**/*.yml | ||
!**/*.j2 | ||
!**/*.env.default |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# demo_token_balances | ||
|
||
TzBTC FA1.2 token balances | ||
|
||
## Installation | ||
|
||
This project is based on [DipDup](https://dipdup.io), a framework for building featureful dapps. | ||
|
||
You need a Linux/macOS system with Python 3.11 installed. Use our installer for easy setup: | ||
|
||
```bash | ||
curl -Lsf https://dipdup.io/install.py | python3 | ||
``` | ||
|
||
See the [Installation](https://dipdup.io/docs/installation) page for all options. | ||
|
||
## Usage | ||
|
||
Run the indexer in-memory: | ||
|
||
```bash | ||
dipdup run | ||
``` | ||
|
||
Store data in SQLite database: | ||
|
||
```bash | ||
dipdup -c . -c configs/dipdup.sqlite.yml run | ||
``` | ||
|
||
Or spawn a docker-compose stack: | ||
|
||
```bash | ||
cp deploy/.env.default deploy/.env | ||
# Edit .env before running | ||
docker-compose -f deploy/compose.yaml up | ||
``` | ||
|
||
## Development setup | ||
|
||
We recommend [PDM](https://pdm.fming.dev/latest/) for managing Python projects. To set up the development environment: | ||
|
||
```bash | ||
pdm install | ||
$(pdm venv activate) | ||
``` | ||
|
||
Some tools are included to help you keep the code quality high: black, ruff and mypy. | ||
|
||
```bash | ||
# Format code | ||
pdm fmt | ||
|
||
# Lint code | ||
pdm lint | ||
|
||
# Build Docker image | ||
pdm image | ||
``` | ||
|
||
Inspect the `pyproject.toml` file. It contains all the dependencies and tools used in the project. |
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
database: | ||
kind: postgres | ||
host: ${POSTGRES_HOST:-db} | ||
port: 5432 | ||
user: ${POSTGRES_USER:-dipdup} | ||
password: ${POSTGRES_PASSWORD} | ||
database: ${POSTGRES_DB:-dipdup} | ||
|
||
hasura: | ||
url: http://${HASURA_HOST:-hasura}:8080 | ||
admin_secret: ${HASURA_SECRET} | ||
allow_aggregations: true | ||
camel_case: true | ||
|
||
sentry: | ||
dsn: ${SENTRY_DSN:-""} | ||
environment: ${SENTRY_ENVIRONMENT:-""} | ||
|
||
prometheus: | ||
host: 0.0.0.0 | ||
|
||
logging: ${LOGLEVEL:-INFO} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
database: | ||
kind: sqlite | ||
path: ${SQLITE_PATH:-/tmp/demo_token_balances.sqlite} | ||
|
||
logging: ${LOGLEVEL:-INFO} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
database: | ||
kind: postgres | ||
host: ${POSTGRES_HOST:-demo_token_balances_db} | ||
port: 5432 | ||
user: ${POSTGRES_USER:-dipdup} | ||
password: ${POSTGRES_PASSWORD} | ||
database: ${POSTGRES_DB:-dipdup} | ||
|
||
hasura: | ||
url: http://${HASURA_HOST:-demo_token_balances_hasura}:8080 | ||
admin_secret: ${HASURA_SECRET} | ||
allow_aggregations: false | ||
camel_case: true | ||
|
||
sentry: | ||
dsn: ${SENTRY_DSN:-""} | ||
environment: ${SENTRY_ENVIRONMENT:-""} | ||
|
||
prometheus: | ||
host: 0.0.0.0 | ||
|
||
logging: ${LOGLEVEL:-INFO} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Run `dipdup new --replay configs/replay.yaml` to generate new project from this replay | ||
spec_version: 2.0 | ||
replay: | ||
dipdup_version: 7 | ||
template: demo_token_balances | ||
package: demo_token_balances | ||
version: 0.0.1 | ||
description: TzBTC FA1.2 token balances | ||
license: MIT | ||
name: John Doe | ||
email: [email protected] | ||
postgres_image: postgres:15 | ||
postgres_data_path: /var/lib/postgresql/data | ||
hasura_image: hasura/graphql-engine:latest | ||
line_length: 120 |
Oops, something went wrong.