Skip to content

Commit

Permalink
docs: dev guide notes on asset ids in sqlite3
Browse files Browse the repository at this point in the history
Hat tip to @aubrika for the db schema pointers. Capturing
this example in the dev guide to make it a bit easier to explore.
  • Loading branch information
conorsch committed Mar 19, 2024
1 parent dbc95be commit e7746ab
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/guide/src/dev/sql.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,13 @@ sqlite> SELECT json_object('tx_hash', quote(tx_hash)) FROM tx;

Note that because binary data is stored directly in the db (see `BLOB` in pragma),
you'll need to decode the blob as a JSON object to get readable info.

## Viewing IBC assets

To list assets that have been transferred in via IBC, query on the denom for
a prefix of `transfer/`:

```
sqlite> SELECT denom, json_object('asset_id', quote(asset_id)) FROM assets WHERE denom LIKE 'transfer/%' ;
transfer/channel-0/uosmo|{"asset_id":"X'8C8A30604A6832BF8B418AA30D512740EEA1CB36FDADA5716CED462F20F19612'"}
```

0 comments on commit e7746ab

Please sign in to comment.