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

feat: add BRC-20 event history endpoint #191

Merged
merged 13 commits into from
Aug 31, 2023

Conversation

janniks
Copy link
Contributor

@janniks janniks commented Aug 24, 2023

strategy

I tried to do some fancy merging of the three existing tables, but nothing worked well. I doubt a UNION will work well with the fake duplicating of the transfer event to be split into two steps.

The brc20_events will now have an entry for each operation (and two for "transfer", which is split into 1:prepare_transfertransfer which will set the funds to be "transferrable"; and 2:transfertransfer_send which will actually transfer the funds (updates both participants balances).
The entries reference the location for timestamps and more metadata.
The activity endpoint JOINs to include some relevant data from each operation (we can add more if needed without breaking changes).
Each insert<Operation> during ingest now updates the events table. Additionally, the transfer_send adds an event as well.

misc.

We should pay special attention to the migration, which has multiple steps and alters columns to not null

todo / questions

  • add more tests
  • do we prefer real enum types or is text for brc20_events.operation fine? integer instead? (enums usually don't have a large performance benefit) or should we remove the column and determine the operation tag on the fly when SELECTing by checking which fields are NOT NULL?
  • the operation filter can determine transfer from transfer_send; but should the response always have an operation of "transfer" (and determine by missing to_address, like in the BRC-20 standard); or should we rename the filter to avoid confusion, to "event" and still return an "operation" property (which always is "transfer" for transfers)?
  • should we add more filters? e.g. address

@janniks janniks temporarily deployed to Preview August 24, 2023 23:02 — with GitHub Actions Inactive
@github-actions
Copy link

github-actions bot commented Aug 24, 2023

Vercel deployment URL: https://ordinals-rjwz57o5c-blockstack.vercel.app 🚀

@janniks janniks changed the base branch from develop to brc-20 August 24, 2023 23:13
@janniks janniks force-pushed the feat/add-event-history-endpoint branch 3 times, most recently from 625b1d7 to 8836e90 Compare August 24, 2023 23:47
@janniks janniks linked an issue Aug 24, 2023 that may be closed by this pull request
@janniks janniks force-pushed the feat/add-event-history-endpoint branch from 8836e90 to 398b0e2 Compare August 25, 2023 00:00
@janniks janniks self-assigned this Aug 25, 2023
Copy link
Collaborator

@rafaelcr rafaelcr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some initial comments. The rebase from the latest brc-20 branch changes will be tricky, though. Let me know if you'd like me to help you with that.

src/api/schemas.ts Outdated Show resolved Hide resolved
migrations/1692891772000_brc20-events-types.ts.ts Outdated Show resolved Hide resolved
migrations/1692891772000_brc20-events-types.ts.ts Outdated Show resolved Hide resolved
migrations/1692891772000_brc20-events-types.ts.ts Outdated Show resolved Hide resolved
src/api/schemas.ts Outdated Show resolved Hide resolved
src/api/schemas.ts Outdated Show resolved Hide resolved
src/pg/brc20/brc20-pg-store.ts Outdated Show resolved Hide resolved
@janniks janniks force-pushed the feat/add-event-history-endpoint branch from 5d3fe1d to ed3d63a Compare August 25, 2023 14:53
@janniks janniks temporarily deployed to Preview August 25, 2023 14:53 — with GitHub Actions Inactive
@janniks janniks force-pushed the feat/add-event-history-endpoint branch from ed3d63a to 0768251 Compare August 25, 2023 14:53
@janniks janniks temporarily deployed to Preview August 25, 2023 14:53 — with GitHub Actions Inactive
@janniks janniks temporarily deployed to Preview August 25, 2023 15:19 — with GitHub Actions Inactive
@janniks janniks temporarily deployed to Preview August 25, 2023 15:30 — with GitHub Actions Inactive
@janniks janniks requested a review from rafaelcr August 25, 2023 15:34
@janniks janniks marked this pull request as ready for review August 25, 2023 15:37
@janniks janniks temporarily deployed to Preview August 25, 2023 15:56 — with GitHub Actions Inactive
migrations/1692891772000_brc20-events-types.ts Outdated Show resolved Hide resolved
src/api/init.ts Outdated Show resolved Hide resolved
src/api/schemas.ts Show resolved Hide resolved
src/api/schemas.ts Outdated Show resolved Hide resolved
src/api/util/helpers.ts Outdated Show resolved Hide resolved
src/pg/brc20/brc20-pg-store.ts Show resolved Hide resolved
src/pg/brc20/brc20-pg-store.ts Outdated Show resolved Hide resolved
src/pg/brc20/brc20-pg-store.ts Outdated Show resolved Hide resolved
src/pg/brc20/brc20-pg-store.ts Outdated Show resolved Hide resolved
src/pg/brc20/brc20-pg-store.ts Outdated Show resolved Hide resolved
@janniks janniks force-pushed the feat/add-event-history-endpoint branch from 22f37fc to 2a6d300 Compare August 29, 2023 16:38
@janniks janniks temporarily deployed to Preview August 29, 2023 16:38 — with GitHub Actions Inactive
@codecov
Copy link

codecov bot commented Aug 29, 2023

Codecov Report

❗ No coverage uploaded for pull request base (brc-20@85f5ed0). Click here to learn what that means.
The diff coverage is n/a.

❗ Current head 75771ab differs from pull request most recent head a33bda4. Consider uploading reports for the commit a33bda4 to get more accurate results

@@            Coverage Diff            @@
##             brc-20     #191   +/-   ##
=========================================
  Coverage          ?   93.81%           
=========================================
  Files             ?       51           
  Lines             ?     5352           
  Branches          ?      455           
=========================================
  Hits              ?     5021           
  Misses            ?      328           
  Partials          ?        3           

@janniks janniks requested a review from rafaelcr August 29, 2023 16:42
src/pg/brc20/brc20-pg-store.ts Outdated Show resolved Hide resolved
src/pg/brc20/types.ts Outdated Show resolved Hide resolved
@janniks janniks temporarily deployed to Preview August 29, 2023 17:53 — with GitHub Actions Inactive
@janniks janniks temporarily deployed to Preview August 29, 2023 18:36 — with GitHub Actions Inactive
Copy link
Contributor Author

@janniks janniks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgot to submit some pending comments

migrations/1692891772000_brc20-events-types.ts.ts Outdated Show resolved Hide resolved
migrations/1692891772000_brc20-events-types.ts.ts Outdated Show resolved Hide resolved
src/api/schemas.ts Outdated Show resolved Hide resolved
src/api/schemas.ts Outdated Show resolved Hide resolved
src/pg/brc20/brc20-pg-store.ts Show resolved Hide resolved
src/pg/brc20/brc20-pg-store.ts Outdated Show resolved Hide resolved
src/pg/brc20/brc20-pg-store.ts Outdated Show resolved Hide resolved
src/pg/brc20/brc20-pg-store.ts Outdated Show resolved Hide resolved
src/pg/brc20/types.ts Outdated Show resolved Hide resolved
@janniks janniks force-pushed the feat/add-event-history-endpoint branch from eb01dd5 to a90471f Compare August 29, 2023 18:52
@janniks janniks temporarily deployed to Preview August 29, 2023 18:53 — with GitHub Actions Inactive
@janniks janniks requested a review from rafaelcr August 29, 2023 18:54
@rafaelcr rafaelcr temporarily deployed to Preview August 31, 2023 04:38 — with GitHub Actions Inactive
@@ -264,53 +253,49 @@ export class Brc20PgStore extends BasePgStoreModule {
OR (l.block_height = ${location.block_height} AND l.tx_index < ${location.tx_index})
Copy link
Contributor Author

@janniks janniks Aug 31, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unclear about this (old) line. (the second OR condition)
The transfer is not valid if there is a location (transfer/inscribe) in the same block, but that came before the origin tx? Maybe I'm misunderstanding tx_index

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just looking for transfers of this inscription that happened before the current point in time (either at a past block OR at this same block but in an earlier transaction)

@rafaelcr rafaelcr temporarily deployed to Preview August 31, 2023 15:52 — with GitHub Actions Inactive
@rafaelcr rafaelcr merged commit d9967b1 into brc-20 Aug 31, 2023
4 checks passed
@rafaelcr rafaelcr deleted the feat/add-event-history-endpoint branch August 31, 2023 15:56
blockstack-devops pushed a commit that referenced this pull request Aug 31, 2023
## [1.0.0-brc-20.14](v1.0.0-brc-20.13...v1.0.0-brc-20.14) (2023-08-31)

### Features

* add BRC-20 event history endpoint ([#191](#191)) ([d9967b1](d9967b1))
@blockstack-devops
Copy link

🎉 This PR is included in version 1.0.0-brc-20.14 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

rafaelcr added a commit that referenced this pull request Sep 12, 2023
* chore: add brc20 migrations

* feat: start storing token deploys

* feat: mints with balance changes

* chore: events table draft

* feat: first balance endpoint

* fix: balances and rollbacks

* feat: token info endpoint

* feat: tokens endpoint as paginated index

* test: paginated index

* test: brc20 format

* chore: more standard validation

* fix: tick must be 4 bytes or less

* fix: invalid decimal count

* feat: mint within supply

* test: mint limit

* chore: first transfers

* test: dont exceed avail balance for transfer

* test: multiple transfers in block

* feat: first balance transfers

* fix: transfers only usable once

* refactor: extract to separate functions

* fix: remove old json content tables

* fix: balances/:address

* feat: token details

* feat: holders endpoint

* fix: introduce materialized view to count address inscriptions (#147)

* fix: introduce materialized view to count address inscriptions

* fix: make index unique

* chore(release): 0.4.15 [skip ci]

## [0.4.15](v0.4.14...v0.4.15) (2023-07-13)

### Bug Fixes

* introduce materialized view to count address inscriptions ([#147](#147)) ([2e79311](2e79311))

* refactor: move brc20 pg to separate file

* fix: add indexes for fks

* fix: remove old json schemas

* refactor: move brc-20 files to its own folder

* chore(release): 1.0.0-beta.6 [skip ci]

## [1.0.0-beta.6](v1.0.0-beta.5...v1.0.0-beta.6) (2023-07-21)

### Bug Fixes

* make etag calculation sensitive to inscription location gap fills and upserts ([#156](#156)) ([5648c9e](5648c9e))
* refresh views in parallel ([#154](#154)) ([a7674a9](a7674a9))

* chore(release): 0.4.15 [skip ci]

* introduce materialized view to count address inscriptions ([#147](#147)) ([2e79311](2e79311))

* fix: build beta image

* fix: remove unused json functions (#165)

* chore(release): 1.0.0-beta.7 [skip ci]

## [1.0.0-beta.7](v1.0.0-beta.6...v1.0.0-beta.7) (2023-07-21)

### Bug Fixes

* build beta image ([13f2c13](13f2c13))
* introduce materialized view to count address inscriptions ([#147](#147)) ([2e79311](2e79311))
* remove unused json functions ([#165](#165)) ([3eb0e24](3eb0e24))

* fix: skip db migrations during readonly mode

* chore(release): 1.0.0-beta.8 [skip ci]

## [1.0.0-beta.8](v1.0.0-beta.7...v1.0.0-beta.8) (2023-07-21)

### Bug Fixes

* skip db migrations during readonly mode ([d5157f0](d5157f0))

* fix: allow gap fills for transfers

* feat: add inscription number sort option (#168)

* chore(release): 1.0.0-beta.9 [skip ci]

## [1.0.0-beta.9](v1.0.0-beta.8...v1.0.0-beta.9) (2023-07-25)

### Features

* add inscription number sort option ([#168](#168)) ([9f4cdbc](9f4cdbc))

* feat: detect and tag recursive inscriptions (#167)

* feat: initial impl

* fix: tests

* feat: filter by recursive

* fix: tests

* fix: make migration progressive

* chore(release): 1.0.0-beta.10 [skip ci]

## [1.0.0-beta.10](v1.0.0-beta.9...v1.0.0-beta.10) (2023-07-25)

### Features

* detect and tag recursive inscriptions ([#167](#167)) ([fb36285](fb36285))

* fix: warn correctly on missing prev locations

* chore(release): 1.0.0-beta.11 [skip ci]

## [1.0.0-beta.11](v1.0.0-beta.10...v1.0.0-beta.11) (2023-07-25)

### Bug Fixes

* warn correctly on missing prev locations ([879bf55](879bf55))

* fix: rollback location pointers (#174)

* chore(release): 1.0.0-beta.12 [skip ci]

## [1.0.0-beta.12](v1.0.0-beta.11...v1.0.0-beta.12) (2023-07-31)

### Bug Fixes

* rollback location pointers ([#174](#174)) ([3c9d7f0](3c9d7f0))

* fix: optimize COUNT calculations via the use of count tables (#175)

* feat: first iteration

* fix: rollbacks

* fix: block height ranges

* fix: block hash count

* fix: add custom count support

* feat: add cursed filter

* feat: genesis address filter

* chore(release): 1.0.0-beta.13 [skip ci]

## [1.0.0-beta.13](v1.0.0-beta.12...v1.0.0-beta.13) (2023-08-01)

### Bug Fixes

* optimize COUNT calculations via the use of count tables ([#175](#175)) ([31498bd](31498bd))

* fix: add secondary sorting by inscription number (#177)

* chore(release): 1.0.0-beta.14 [skip ci]

## [1.0.0-beta.14](v1.0.0-beta.13...v1.0.0-beta.14) (2023-08-02)

### Bug Fixes

* add secondary sorting by inscription number ([#177](#177)) ([99959df](99959df))

* fix: consider `tx_index` in transfers by block endpoint (#178)

* fix: upsert warning

* fix: transfers same block

* chore(release): 1.0.0-beta.15 [skip ci]

## [1.0.0-beta.15](v1.0.0-beta.14...v1.0.0-beta.15) (2023-08-04)

### Bug Fixes

* consider `tx_index` in transfers by block endpoint ([#178](#178)) ([ed517d6](ed517d6))

* fix: only consider blessed inscriptions

* feat: brc-20 balance at block (#186)

* build: release for brc-20 branch

* chore(release): 1.0.0-brc-20.1 [skip ci]

## [1.0.0-brc-20.1](v0.4.15...v1.0.0-brc-20.1) (2023-08-17)

### ⚠ BREAKING CHANGES

* optimize transfer replay capability (#129)

### Features

* add inscription number sort option ([#168](#168)) ([9f4cdbc](9f4cdbc))
* add stats endpoint for inscription counts ([#70](#70)) ([ac18e62](ac18e62))
* brc-20 balance at block ([#186](#186)) ([ced5cb3](ced5cb3))
* detect and tag recursive inscriptions ([#167](#167)) ([fb36285](fb36285))
* first balance endpoint ([f9c6654](f9c6654))
* first balance transfers ([dd8ec07](dd8ec07))
* holders endpoint ([a01f77e](a01f77e))
* mint within supply ([c8e5820](c8e5820))
* mints with balance changes ([32e90f7](32e90f7))
* optimize transfer replay capability ([#129](#129)) ([97874cc](97874cc))
* start storing token deploys ([bf4c7f6](bf4c7f6))
* token details ([5d35d5b](5d35d5b))
* token info endpoint ([8fad6b9](8fad6b9))
* tokens endpoint as paginated index ([ae2049b](ae2049b))

### Bug Fixes

* add address column to genesis and current ([d71e1d4](d71e1d4))
* add indexes for fks ([354ddd0](354ddd0))
* add secondary sorting by inscription number ([#177](#177)) ([99959df](99959df))
* allow gap fills for transfers ([026c275](026c275))
* allow multiple transfers of an inscription in one block ([#132](#132)) ([bc545f0](bc545f0))
* auto predicate registration option ([e1ed7c7](e1ed7c7))
* balances and rollbacks ([61b4139](61b4139))
* balances/:address ([687c2e4](687c2e4))
* build beta image ([13f2c13](13f2c13))
* build event server using chainhook client library ([#105](#105)) ([ab4c795](ab4c795))
* chainhook client upgrades ([9a96492](9a96492))
* consider `tx_index` in transfers by block endpoint ([#178](#178)) ([ed517d6](ed517d6))
* introduce materialized view to count address inscriptions ([#147](#147)) ([09a95d5](09a95d5))
* invalid decimal count ([aa15b0e](aa15b0e))
* make etag calculation sensitive to inscription location gap fills and upserts ([#156](#156)) ([5648c9e](5648c9e))
* only consider blessed inscriptions ([2a4700c](2a4700c))
* optimize COUNT calculations via the use of count tables ([#175](#175)) ([31498bd](31498bd))
* refresh views in parallel ([#154](#154)) ([a7674a9](a7674a9))
* remove old json content tables ([0732048](0732048))
* remove old json schemas ([8cc7f8a](8cc7f8a))
* remove unused json functions ([#165](#165)) ([3eb0e24](3eb0e24))
* rename location pointer tables ([b84d27e](b84d27e))
* rollback location pointers ([#174](#174)) ([3c9d7f0](3c9d7f0))
* save tx_index on locations to support transfers on same block ([#145](#145)) ([30a9635](30a9635))
* skip db migrations during readonly mode ([d5157f0](d5157f0))
* tick must be 4 bytes or less ([f6fd0a6](f6fd0a6))
* transfers only usable once ([542ec34](542ec34))
* upgrade chainhook client ([cbbb951](cbbb951))
* upgrade chainhook client to 1.3.3 ([ee66f93](ee66f93))
* warn correctly on missing prev locations ([879bf55](879bf55))

* feat: add more brc20 features (#183)

* refactor: update nullish access

* feat: add deploy_timestamp to brc-20 token endpoints

* feat: add minted_supply to brc-20 token endpoints

* refactor: improve scan performance with generated lower ticker

* feat: add prefix filtering to brc20 deploy tickers

* test: add token endpoint test

---------

Co-authored-by: janniks <janniks@users.noreply.github.com>

* fix: optimize inscription and brc-20 inserts (#189)

* chore: draft optims

* chore: more optimizations

* fix: reveals and transfers in same batch

* fix: inscriptions tests pass

* fix: optimize pointer logic

* fix: cache updated_at writes

* feat: scan block concept

* fix: individual items, start transfers

* fix: all tests pass

* fix: env var brc20 processing

* feat: add admin rpc server to control brc20 scans

* style: comments

* chore(release): 1.0.0-brc-20.2 [skip ci]

## [1.0.0-brc-20.2](v1.0.0-brc-20.1...v1.0.0-brc-20.2) (2023-08-24)

### Features

* add more brc20 features ([#183](#183)) ([c1939ce](c1939ce))

### Bug Fixes

* optimize inscription and brc-20 inserts ([#189](#189)) ([3807334](3807334))

* fix: sending transfer as fee returns amt to sender

* fix: add unique indexes for mints and transfers

* chore(release): 1.0.0-brc-20.3 [skip ci]

## [1.0.0-brc-20.3](v1.0.0-brc-20.2...v1.0.0-brc-20.3) (2023-08-24)

### Bug Fixes

* add unique indexes for mints and transfers ([b428bb4](b428bb4))
* sending transfer as fee returns amt to sender ([e23012a](e23012a))

* fix: upgrade api-toolkit (#190)

* fix: upgrade api-toolkit

* fix: isProdEnv helper

* fix: refresh supplies view only if BRC-20 is enabled

* chore(release): 1.0.0-brc-20.4 [skip ci]

## [1.0.0-brc-20.4](v1.0.0-brc-20.3...v1.0.0-brc-20.4) (2023-08-25)

### Bug Fixes

* refresh supplies view only if BRC-20 is enabled ([7d6705a](7d6705a))
* upgrade api-toolkit ([#190](#190)) ([0e673a7](0e673a7))

* fix: change uniqueness constraint in locations table

* chore(release): 1.0.0-brc-20.5 [skip ci]

## [1.0.0-brc-20.5](v1.0.0-brc-20.4...v1.0.0-brc-20.5) (2023-08-25)

### Bug Fixes

* change uniqueness constraint in locations table ([9a9c5de](9a9c5de))

* fix: place a cap on max insertion size

* chore(release): 1.0.0-brc-20.6 [skip ci]

## [1.0.0-brc-20.6](v1.0.0-brc-20.5...v1.0.0-brc-20.6) (2023-08-26)

### Bug Fixes

* place a cap on max insertion size ([bef5f23](bef5f23))

* fix: guard against empty recursion refs

* fix: optimize inscription backfill indexes (#197)

* fix: add recursion backfill and temporary skip (#198)

* fix: dont update cache timestamp during ingestion (#200)

* fix: do not insert repeated recursions (#199)

* fix: do not insert repeated recursions

* chore: remove custom launch

* chore: lock commit-analyzer to 9.0.2; rm dup plugins in releaserc file

* chore: revert releaserc file

* fix: split recursion insertion into chunks (#201)

* chore(release): 1.0.0 [skip ci]

* optimize transfer replay capability (#129)

* add inscription number sort option ([#168](#168)) ([9f4cdbc](9f4cdbc))
* add stats endpoint for inscription counts ([#70](#70)) ([ac18e62](ac18e62))
* detect and tag recursive inscriptions ([#167](#167)) ([fb36285](fb36285))
* optimize transfer replay capability ([#129](#129)) ([97874cc](97874cc))

* add address column to genesis and current ([d71e1d4](d71e1d4))
* add secondary sorting by inscription number ([#177](#177)) ([99959df](99959df))
* allow multiple transfers of an inscription in one block ([#132](#132)) ([bc545f0](bc545f0))
* auto predicate registration option ([e1ed7c7](e1ed7c7))
* build beta image ([13f2c13](13f2c13))
* build event server using chainhook client library ([#105](#105)) ([ab4c795](ab4c795))
* chainhook client upgrades ([9a96492](9a96492))
* consider `tx_index` in transfers by block endpoint ([#178](#178)) ([ed517d6](ed517d6))
* introduce materialized view to count address inscriptions ([#147](#147)) ([09a95d5](09a95d5))
* make etag calculation sensitive to inscription location gap fills and upserts ([#156](#156)) ([5648c9e](5648c9e))
* optimize COUNT calculations via the use of count tables ([#175](#175)) ([31498bd](31498bd))
* refresh views in parallel ([#154](#154)) ([a7674a9](a7674a9))
* remove unused json functions ([#165](#165)) ([3eb0e24](3eb0e24))
* rename location pointer tables ([b84d27e](b84d27e))
* rollback location pointers ([#174](#174)) ([3c9d7f0](3c9d7f0))
* save tx_index on locations to support transfers on same block ([#145](#145)) ([30a9635](30a9635))
* semantic release process ([#202](#202)) ([1bd3f74](1bd3f74))
* skip db migrations during readonly mode ([d5157f0](d5157f0))
* upgrade api-toolkit ([#190](#190)) ([a691b67](a691b67))
* upgrade chainhook client ([cbbb951](cbbb951))
* upgrade chainhook client to 1.3.3 ([ee66f93](ee66f93))
* warn correctly on missing prev locations ([879bf55](879bf55))

* ci: remove debug logs on semantic release [skip ci]

* fix: attempt to optimize brc-20 scan (#204)

* fix: use cursor query for brc-20 scan

* fix: optimize content retrieval

* fix: ignore transfers that are not brc-20

* fix: semantic release

* chore(release): 1.0.0-brc-20.7 [skip ci]

## [1.0.0-brc-20.7](v1.0.0-brc-20.6...v1.0.0-brc-20.7) (2023-08-30)

### Bug Fixes

* add recursion backfill and temporary skip ([#198](#198)) ([63571ee](63571ee))
* attempt to optimize brc-20 scan ([#204](#204)) ([f6545cd](f6545cd))
* do not insert repeated recursions ([#199](#199)) ([9c8508b](9c8508b))
* dont update cache timestamp during ingestion ([#200](#200)) ([8f973a3](8f973a3))
* guard against empty recursion refs ([71ce1a5](71ce1a5))
* optimize inscription backfill indexes ([#197](#197)) ([ab2f7bf](ab2f7bf))
* semantic release ([26cd2c6](26cd2c6))
* split recursion insertion into chunks ([#201](#201)) ([4ebc106](4ebc106))

* fix: optimize brc-20 scan by minimizing string conversions (#206)

* fix: filter brc-20 content from postgres

* fix: optimize transfer insert a bit

* chore: move to pg submodule

* chore(release): 1.0.0-brc-20.8 [skip ci]

## [1.0.0-brc-20.8](v1.0.0-brc-20.7...v1.0.0-brc-20.8) (2023-08-30)

### Bug Fixes

* optimize brc-20 scan by minimizing string conversions ([#206](#206)) ([98c12c8](98c12c8))

* fix: insert ops in single queries, reduce BigNumber usage (#207)

* fix: validate mint data in pg

* fix: mint in single query

* fix: insert transfer in single query

* fix: transfer send in single query

* fix: optimize BigNumber usage

* chore(release): 1.0.0-brc-20.9 [skip ci]

## [1.0.0-brc-20.9](v1.0.0-brc-20.8...v1.0.0-brc-20.9) (2023-08-30)

### Bug Fixes

* insert ops in single queries, reduce BigNumber usage ([#207](#207)) ([ef11e34](ef11e34))

* fix: cast numbers to postgres numeric

* chore(release): 1.0.0-brc-20.10 [skip ci]

## [1.0.0-brc-20.10](v1.0.0-brc-20.9...v1.0.0-brc-20.10) (2023-08-30)

### Bug Fixes

* cast numbers to postgres numeric ([f8ae276](f8ae276))

* fix: remove supply view, calculate supply as we mint

* chore(release): 1.0.0-brc-20.11 [skip ci]

## [1.0.0-brc-20.11](v1.0.0-brc-20.10...v1.0.0-brc-20.11) (2023-08-30)

### Bug Fixes

* remove supply view, calculate supply as we mint ([36addce](36addce))

* fix: guard against null bytes

* fix: null char escaping

* chore(release): 1.0.0-brc-20.12 [skip ci]

## [1.0.0-brc-20.12](v1.0.0-brc-20.11...v1.0.0-brc-20.12) (2023-08-30)

### Bug Fixes

* guard against null bytes ([9eddbfc](9eddbfc))
* null char escaping ([8bb4954](8bb4954))

* fix: go back to individual content fetch from utf8 pg errors

* chore(release): 1.0.0-brc-20.13 [skip ci]

## [1.0.0-brc-20.13](v1.0.0-brc-20.12...v1.0.0-brc-20.13) (2023-08-31)

### Bug Fixes

* go back to individual content fetch from utf8 pg errors ([4fd530d](4fd530d))

* feat: add BRC-20 event history endpoint (#191)

* feat: add BRC-20 event history/activity ingestion and endpoint

* refactor: switch to concat for a single activity subplan for transfers

* refactor: rename prepare_transfer to transfer

* test: fix faulty test due to duplicate inscription numbers

* refactor: switch to postgres enum type

* refactor: merge multiple queries using CTEs

* test: add test with multiple participants

* refactor: add updates from pr

* test: add block height test

* refactor: merge event inserts using CTEs

* fix: use correct ids for events

* fix: migrate into events with queries

---------

Co-authored-by: janniks <janniks@users.noreply.github.com>
Co-authored-by: Rafael Cardenas <rafael@rafaelcr.com>

* chore(release): 1.0.0-brc-20.14 [skip ci]

## [1.0.0-brc-20.14](v1.0.0-brc-20.13...v1.0.0-brc-20.14) (2023-08-31)

### Features

* add BRC-20 event history endpoint ([#191](#191)) ([d9967b1](d9967b1))

* fix: remove migration queries

* chore(release): 1.0.0-brc-20.15 [skip ci]

## [1.0.0-brc-20.15](v1.0.0-brc-20.14...v1.0.0-brc-20.15) (2023-08-31)

### Bug Fixes

* remove migration queries ([f53f889](f53f889))

* fix: optimize read queries, display amounts with correct decimals (#208)

* fix: single token

* fix: token list

* fix: holders, add tests

* fix: activity sorting

* fix: display amounts with correct number of decimals

* chore(release): 1.0.0-brc-20.16 [skip ci]

## [1.0.0-brc-20.16](v1.0.0-brc-20.15...v1.0.0-brc-20.16) (2023-09-01)

### Bug Fixes

* optimize read queries, display amounts with correct decimals ([#208](#208)) ([5d6453e](5d6453e))

* fix: holders count query (#209)

* chore(release): 1.0.0-brc-20.17 [skip ci]

## [1.0.0-brc-20.17](v1.0.0-brc-20.16...v1.0.0-brc-20.17) (2023-09-01)

### Bug Fixes

* holders count query ([#209](#209)) ([254ed75](254ed75))

* fix: temporarily disable count calculation to speed up requests (#210)

* chore(release): 1.0.0-brc-20.18 [skip ci]

## [1.0.0-brc-20.18](v1.0.0-brc-20.17...v1.0.0-brc-20.18) (2023-09-01)

### Bug Fixes

* temporarily disable count calculation to speed up requests ([#210](#210)) ([640e406](640e406))

* feat: add fast ingestion mode for faster replays (#211)

* chore(release): 1.0.0-brc-20.19 [skip ci]

## [1.0.0-brc-20.19](v1.0.0-brc-20.18...v1.0.0-brc-20.19) (2023-09-04)

### Features

* add fast ingestion mode for faster replays ([#211](#211)) ([7996587](7996587))

* fix: optimize sent as fee detection

* chore(release): 1.0.0-brc-20.20 [skip ci]

## [1.0.0-brc-20.20](v1.0.0-brc-20.19...v1.0.0-brc-20.20) (2023-09-06)

### Bug Fixes

* optimize sent as fee detection ([1c9b0f4](1c9b0f4))

* fix: calculate etag correctly on status endpoint (#213)

* fix: calculate etag correctly on status endpoint

* fix: vercel build

* chore(release): 1.0.0-brc-20.21 [skip ci]

## [1.0.0-brc-20.21](v1.0.0-brc-20.20...v1.0.0-brc-20.21) (2023-09-07)

### Bug Fixes

* calculate etag correctly on status endpoint ([#213](#213)) ([f0c42e2](f0c42e2))

* fix: optimize read queries by keeping count tables, implement rollbacks (#214)

* feat: total balances table

* fix: add total balance column

* fix: return balance to sender

* fix: more than once transfer

* fix: rollbacks

* fix: use new table for token holders

* fix: ticker length check

* feat: add tx_count to tokens (#215)

* fix: use correct inscription_id for transfer_send event

* feat: add tx_count to tokens

* refactor: rename activities events

---------

Co-authored-by: janniks <janniks@users.noreply.github.com>

* feat: count for activity types

* feat: token count

* test: rollbacks

* test: ignore tickers less than 4 bytes wide

---------

Co-authored-by: janniks <6362150+janniks@users.noreply.github.com>
Co-authored-by: janniks <janniks@users.noreply.github.com>

* chore(release): 1.0.0-brc-20.22 [skip ci]

## [1.0.0-brc-20.22](v1.0.0-brc-20.21...v1.0.0-brc-20.22) (2023-09-10)

### Bug Fixes

* optimize read queries by keeping count tables, implement rollbacks ([#214](#214)) ([574d349](574d349)), closes [#215](#215)

* fix: only increase counts on valid operations

* chore(release): 1.0.0-brc-20.23 [skip ci]

## [1.0.0-brc-20.23](v1.0.0-brc-20.22...v1.0.0-brc-20.23) (2023-09-10)

### Bug Fixes

* only increase counts on valid operations ([01f0865](01f0865))

* feat: add location to activity response

* chore(release): 1.0.0-brc-20.24 [skip ci]

## [1.0.0-brc-20.24](v1.0.0-brc-20.23...v1.0.0-brc-20.24) (2023-09-10)

### Features

* add location to activity response ([580861e](580861e))

* fix: change tx_count to json number (#216)

Co-authored-by: janniks <janniks@users.noreply.github.com>

* chore(release): 1.0.0-brc-20.25 [skip ci]

## [1.0.0-brc-20.25](v1.0.0-brc-20.24...v1.0.0-brc-20.25) (2023-09-11)

### Bug Fixes

* change tx_count to json number ([#216](#216)) ([20f9415](20f9415))

* fix: ticker filter for balances (#217)

* chore(release): 1.0.0-brc-20.26 [skip ci]

## [1.0.0-brc-20.26](v1.0.0-brc-20.25...v1.0.0-brc-20.26) (2023-09-11)

### Bug Fixes

* ticker filter for balances ([#217](#217)) ([1ca3bcd](1ca3bcd))

* fix: return to sender balance calculation (#218)

* chore(release): 1.0.0-brc-20.27 [skip ci]

## [1.0.0-brc-20.27](v1.0.0-brc-20.26...v1.0.0-brc-20.27) (2023-09-12)

### Bug Fixes

* return to sender balance calculation ([#218](#218)) ([226dfe6](226dfe6))

---------

Co-authored-by: semantic-release-bot <semantic-release-bot@martynus.net>
Co-authored-by: janniks <6362150+janniks@users.noreply.github.com>
Co-authored-by: janniks <janniks@users.noreply.github.com>
Co-authored-by: Dean Chi <21262275+deantchi@users.noreply.github.com>
g0drlc added a commit to g0drlc/btc-ordinals-api that referenced this pull request Jul 14, 2024
* chore: add brc20 migrations

* feat: start storing token deploys

* feat: mints with balance changes

* chore: events table draft

* feat: first balance endpoint

* fix: balances and rollbacks

* feat: token info endpoint

* feat: tokens endpoint as paginated index

* test: paginated index

* test: brc20 format

* chore: more standard validation

* fix: tick must be 4 bytes or less

* fix: invalid decimal count

* feat: mint within supply

* test: mint limit

* chore: first transfers

* test: dont exceed avail balance for transfer

* test: multiple transfers in block

* feat: first balance transfers

* fix: transfers only usable once

* refactor: extract to separate functions

* fix: remove old json content tables

* fix: balances/:address

* feat: token details

* feat: holders endpoint

* fix: introduce materialized view to count address inscriptions (#147)

* fix: introduce materialized view to count address inscriptions

* fix: make index unique

* chore(release): 0.4.15 [skip ci]

## [0.4.15](hirosystems/ordinals-api@v0.4.14...v0.4.15) (2023-07-13)

### Bug Fixes

* introduce materialized view to count address inscriptions ([#147](hirosystems/ordinals-api#147)) ([2e79311](hirosystems/ordinals-api@2e79311))

* refactor: move brc20 pg to separate file

* fix: add indexes for fks

* fix: remove old json schemas

* refactor: move brc-20 files to its own folder

* chore(release): 1.0.0-beta.6 [skip ci]

## [1.0.0-beta.6](hirosystems/ordinals-api@v1.0.0-beta.5...v1.0.0-beta.6) (2023-07-21)

### Bug Fixes

* make etag calculation sensitive to inscription location gap fills and upserts ([#156](hirosystems/ordinals-api#156)) ([5648c9e](hirosystems/ordinals-api@5648c9e))
* refresh views in parallel ([#154](hirosystems/ordinals-api#154)) ([a7674a9](hirosystems/ordinals-api@a7674a9))

* chore(release): 0.4.15 [skip ci]

* introduce materialized view to count address inscriptions ([#147](hirosystems/ordinals-api#147)) ([2e79311](hirosystems/ordinals-api@2e79311))

* fix: build beta image

* fix: remove unused json functions (#165)

* chore(release): 1.0.0-beta.7 [skip ci]

## [1.0.0-beta.7](hirosystems/ordinals-api@v1.0.0-beta.6...v1.0.0-beta.7) (2023-07-21)

### Bug Fixes

* build beta image ([13f2c13](hirosystems/ordinals-api@13f2c13))
* introduce materialized view to count address inscriptions ([#147](hirosystems/ordinals-api#147)) ([2e79311](hirosystems/ordinals-api@2e79311))
* remove unused json functions ([#165](hirosystems/ordinals-api#165)) ([3eb0e24](hirosystems/ordinals-api@3eb0e24))

* fix: skip db migrations during readonly mode

* chore(release): 1.0.0-beta.8 [skip ci]

## [1.0.0-beta.8](hirosystems/ordinals-api@v1.0.0-beta.7...v1.0.0-beta.8) (2023-07-21)

### Bug Fixes

* skip db migrations during readonly mode ([d5157f0](hirosystems/ordinals-api@d5157f0))

* fix: allow gap fills for transfers

* feat: add inscription number sort option (#168)

* chore(release): 1.0.0-beta.9 [skip ci]

## [1.0.0-beta.9](hirosystems/ordinals-api@v1.0.0-beta.8...v1.0.0-beta.9) (2023-07-25)

### Features

* add inscription number sort option ([#168](hirosystems/ordinals-api#168)) ([9f4cdbc](hirosystems/ordinals-api@9f4cdbc))

* feat: detect and tag recursive inscriptions (#167)

* feat: initial impl

* fix: tests

* feat: filter by recursive

* fix: tests

* fix: make migration progressive

* chore(release): 1.0.0-beta.10 [skip ci]

## [1.0.0-beta.10](hirosystems/ordinals-api@v1.0.0-beta.9...v1.0.0-beta.10) (2023-07-25)

### Features

* detect and tag recursive inscriptions ([#167](hirosystems/ordinals-api#167)) ([fb36285](hirosystems/ordinals-api@fb36285))

* fix: warn correctly on missing prev locations

* chore(release): 1.0.0-beta.11 [skip ci]

## [1.0.0-beta.11](hirosystems/ordinals-api@v1.0.0-beta.10...v1.0.0-beta.11) (2023-07-25)

### Bug Fixes

* warn correctly on missing prev locations ([879bf55](hirosystems/ordinals-api@879bf55))

* fix: rollback location pointers (#174)

* chore(release): 1.0.0-beta.12 [skip ci]

## [1.0.0-beta.12](hirosystems/ordinals-api@v1.0.0-beta.11...v1.0.0-beta.12) (2023-07-31)

### Bug Fixes

* rollback location pointers ([#174](hirosystems/ordinals-api#174)) ([3c9d7f0](hirosystems/ordinals-api@3c9d7f0))

* fix: optimize COUNT calculations via the use of count tables (#175)

* feat: first iteration

* fix: rollbacks

* fix: block height ranges

* fix: block hash count

* fix: add custom count support

* feat: add cursed filter

* feat: genesis address filter

* chore(release): 1.0.0-beta.13 [skip ci]

## [1.0.0-beta.13](hirosystems/ordinals-api@v1.0.0-beta.12...v1.0.0-beta.13) (2023-08-01)

### Bug Fixes

* optimize COUNT calculations via the use of count tables ([#175](hirosystems/ordinals-api#175)) ([31498bd](hirosystems/ordinals-api@31498bd))

* fix: add secondary sorting by inscription number (#177)

* chore(release): 1.0.0-beta.14 [skip ci]

## [1.0.0-beta.14](hirosystems/ordinals-api@v1.0.0-beta.13...v1.0.0-beta.14) (2023-08-02)

### Bug Fixes

* add secondary sorting by inscription number ([#177](hirosystems/ordinals-api#177)) ([99959df](hirosystems/ordinals-api@99959df))

* fix: consider `tx_index` in transfers by block endpoint (#178)

* fix: upsert warning

* fix: transfers same block

* chore(release): 1.0.0-beta.15 [skip ci]

## [1.0.0-beta.15](hirosystems/ordinals-api@v1.0.0-beta.14...v1.0.0-beta.15) (2023-08-04)

### Bug Fixes

* consider `tx_index` in transfers by block endpoint ([#178](hirosystems/ordinals-api#178)) ([ed517d6](hirosystems/ordinals-api@ed517d6))

* fix: only consider blessed inscriptions

* feat: brc-20 balance at block (#186)

* build: release for brc-20 branch

* chore(release): 1.0.0-brc-20.1 [skip ci]

## [1.0.0-brc-20.1](hirosystems/ordinals-api@v0.4.15...v1.0.0-brc-20.1) (2023-08-17)

### ⚠ BREAKING CHANGES

* optimize transfer replay capability (#129)

### Features

* add inscription number sort option ([#168](hirosystems/ordinals-api#168)) ([9f4cdbc](hirosystems/ordinals-api@9f4cdbc))
* add stats endpoint for inscription counts ([#70](hirosystems/ordinals-api#70)) ([ac18e62](hirosystems/ordinals-api@ac18e62))
* brc-20 balance at block ([#186](hirosystems/ordinals-api#186)) ([ced5cb3](hirosystems/ordinals-api@ced5cb3))
* detect and tag recursive inscriptions ([#167](hirosystems/ordinals-api#167)) ([fb36285](hirosystems/ordinals-api@fb36285))
* first balance endpoint ([f9c6654](hirosystems/ordinals-api@f9c6654))
* first balance transfers ([dd8ec07](hirosystems/ordinals-api@dd8ec07))
* holders endpoint ([a01f77e](hirosystems/ordinals-api@a01f77e))
* mint within supply ([c8e5820](hirosystems/ordinals-api@c8e5820))
* mints with balance changes ([32e90f7](hirosystems/ordinals-api@32e90f7))
* optimize transfer replay capability ([#129](hirosystems/ordinals-api#129)) ([97874cc](hirosystems/ordinals-api@97874cc))
* start storing token deploys ([bf4c7f6](hirosystems/ordinals-api@bf4c7f6))
* token details ([5d35d5b](hirosystems/ordinals-api@5d35d5b))
* token info endpoint ([8fad6b9](hirosystems/ordinals-api@8fad6b9))
* tokens endpoint as paginated index ([ae2049b](hirosystems/ordinals-api@ae2049b))

### Bug Fixes

* add address column to genesis and current ([d71e1d4](hirosystems/ordinals-api@d71e1d4))
* add indexes for fks ([354ddd0](hirosystems/ordinals-api@354ddd0))
* add secondary sorting by inscription number ([#177](hirosystems/ordinals-api#177)) ([99959df](hirosystems/ordinals-api@99959df))
* allow gap fills for transfers ([026c275](hirosystems/ordinals-api@026c275))
* allow multiple transfers of an inscription in one block ([#132](hirosystems/ordinals-api#132)) ([bc545f0](hirosystems/ordinals-api@bc545f0))
* auto predicate registration option ([e1ed7c7](hirosystems/ordinals-api@e1ed7c7))
* balances and rollbacks ([61b4139](hirosystems/ordinals-api@61b4139))
* balances/:address ([687c2e4](hirosystems/ordinals-api@687c2e4))
* build beta image ([13f2c13](hirosystems/ordinals-api@13f2c13))
* build event server using chainhook client library ([#105](hirosystems/ordinals-api#105)) ([ab4c795](hirosystems/ordinals-api@ab4c795))
* chainhook client upgrades ([9a96492](hirosystems/ordinals-api@9a96492))
* consider `tx_index` in transfers by block endpoint ([#178](hirosystems/ordinals-api#178)) ([ed517d6](hirosystems/ordinals-api@ed517d6))
* introduce materialized view to count address inscriptions ([#147](hirosystems/ordinals-api#147)) ([09a95d5](hirosystems/ordinals-api@09a95d5))
* invalid decimal count ([aa15b0e](hirosystems/ordinals-api@aa15b0e))
* make etag calculation sensitive to inscription location gap fills and upserts ([#156](hirosystems/ordinals-api#156)) ([5648c9e](hirosystems/ordinals-api@5648c9e))
* only consider blessed inscriptions ([2a4700c](hirosystems/ordinals-api@2a4700c))
* optimize COUNT calculations via the use of count tables ([#175](hirosystems/ordinals-api#175)) ([31498bd](hirosystems/ordinals-api@31498bd))
* refresh views in parallel ([#154](hirosystems/ordinals-api#154)) ([a7674a9](hirosystems/ordinals-api@a7674a9))
* remove old json content tables ([0732048](hirosystems/ordinals-api@0732048))
* remove old json schemas ([8cc7f8a](hirosystems/ordinals-api@8cc7f8a))
* remove unused json functions ([#165](hirosystems/ordinals-api#165)) ([3eb0e24](hirosystems/ordinals-api@3eb0e24))
* rename location pointer tables ([b84d27e](hirosystems/ordinals-api@b84d27e))
* rollback location pointers ([#174](hirosystems/ordinals-api#174)) ([3c9d7f0](hirosystems/ordinals-api@3c9d7f0))
* save tx_index on locations to support transfers on same block ([#145](hirosystems/ordinals-api#145)) ([30a9635](hirosystems/ordinals-api@30a9635))
* skip db migrations during readonly mode ([d5157f0](hirosystems/ordinals-api@d5157f0))
* tick must be 4 bytes or less ([f6fd0a6](hirosystems/ordinals-api@f6fd0a6))
* transfers only usable once ([542ec34](hirosystems/ordinals-api@542ec34))
* upgrade chainhook client ([cbbb951](hirosystems/ordinals-api@cbbb951))
* upgrade chainhook client to 1.3.3 ([ee66f93](hirosystems/ordinals-api@ee66f93))
* warn correctly on missing prev locations ([879bf55](hirosystems/ordinals-api@879bf55))

* feat: add more brc20 features (#183)

* refactor: update nullish access

* feat: add deploy_timestamp to brc-20 token endpoints

* feat: add minted_supply to brc-20 token endpoints

* refactor: improve scan performance with generated lower ticker

* feat: add prefix filtering to brc20 deploy tickers

* test: add token endpoint test

---------

Co-authored-by: janniks <janniks@users.noreply.github.com>

* fix: optimize inscription and brc-20 inserts (#189)

* chore: draft optims

* chore: more optimizations

* fix: reveals and transfers in same batch

* fix: inscriptions tests pass

* fix: optimize pointer logic

* fix: cache updated_at writes

* feat: scan block concept

* fix: individual items, start transfers

* fix: all tests pass

* fix: env var brc20 processing

* feat: add admin rpc server to control brc20 scans

* style: comments

* chore(release): 1.0.0-brc-20.2 [skip ci]

## [1.0.0-brc-20.2](hirosystems/ordinals-api@v1.0.0-brc-20.1...v1.0.0-brc-20.2) (2023-08-24)

### Features

* add more brc20 features ([#183](hirosystems/ordinals-api#183)) ([c1939ce](hirosystems/ordinals-api@c1939ce))

### Bug Fixes

* optimize inscription and brc-20 inserts ([#189](hirosystems/ordinals-api#189)) ([3807334](hirosystems/ordinals-api@3807334))

* fix: sending transfer as fee returns amt to sender

* fix: add unique indexes for mints and transfers

* chore(release): 1.0.0-brc-20.3 [skip ci]

## [1.0.0-brc-20.3](hirosystems/ordinals-api@v1.0.0-brc-20.2...v1.0.0-brc-20.3) (2023-08-24)

### Bug Fixes

* add unique indexes for mints and transfers ([b428bb4](hirosystems/ordinals-api@b428bb4))
* sending transfer as fee returns amt to sender ([e23012a](hirosystems/ordinals-api@e23012a))

* fix: upgrade api-toolkit (#190)

* fix: upgrade api-toolkit

* fix: isProdEnv helper

* fix: refresh supplies view only if BRC-20 is enabled

* chore(release): 1.0.0-brc-20.4 [skip ci]

## [1.0.0-brc-20.4](hirosystems/ordinals-api@v1.0.0-brc-20.3...v1.0.0-brc-20.4) (2023-08-25)

### Bug Fixes

* refresh supplies view only if BRC-20 is enabled ([7d6705a](hirosystems/ordinals-api@7d6705a))
* upgrade api-toolkit ([#190](hirosystems/ordinals-api#190)) ([0e673a7](hirosystems/ordinals-api@0e673a7))

* fix: change uniqueness constraint in locations table

* chore(release): 1.0.0-brc-20.5 [skip ci]

## [1.0.0-brc-20.5](hirosystems/ordinals-api@v1.0.0-brc-20.4...v1.0.0-brc-20.5) (2023-08-25)

### Bug Fixes

* change uniqueness constraint in locations table ([9a9c5de](hirosystems/ordinals-api@9a9c5de))

* fix: place a cap on max insertion size

* chore(release): 1.0.0-brc-20.6 [skip ci]

## [1.0.0-brc-20.6](hirosystems/ordinals-api@v1.0.0-brc-20.5...v1.0.0-brc-20.6) (2023-08-26)

### Bug Fixes

* place a cap on max insertion size ([bef5f23](hirosystems/ordinals-api@bef5f23))

* fix: guard against empty recursion refs

* fix: optimize inscription backfill indexes (#197)

* fix: add recursion backfill and temporary skip (#198)

* fix: dont update cache timestamp during ingestion (#200)

* fix: do not insert repeated recursions (#199)

* fix: do not insert repeated recursions

* chore: remove custom launch

* chore: lock commit-analyzer to 9.0.2; rm dup plugins in releaserc file

* chore: revert releaserc file

* fix: split recursion insertion into chunks (#201)

* chore(release): 1.0.0 [skip ci]

* optimize transfer replay capability (#129)

* add inscription number sort option ([#168](hirosystems/ordinals-api#168)) ([9f4cdbc](hirosystems/ordinals-api@9f4cdbc))
* add stats endpoint for inscription counts ([#70](hirosystems/ordinals-api#70)) ([ac18e62](hirosystems/ordinals-api@ac18e62))
* detect and tag recursive inscriptions ([#167](hirosystems/ordinals-api#167)) ([fb36285](hirosystems/ordinals-api@fb36285))
* optimize transfer replay capability ([#129](hirosystems/ordinals-api#129)) ([97874cc](hirosystems/ordinals-api@97874cc))

* add address column to genesis and current ([d71e1d4](hirosystems/ordinals-api@d71e1d4))
* add secondary sorting by inscription number ([#177](hirosystems/ordinals-api#177)) ([99959df](hirosystems/ordinals-api@99959df))
* allow multiple transfers of an inscription in one block ([#132](hirosystems/ordinals-api#132)) ([bc545f0](hirosystems/ordinals-api@bc545f0))
* auto predicate registration option ([e1ed7c7](hirosystems/ordinals-api@e1ed7c7))
* build beta image ([13f2c13](hirosystems/ordinals-api@13f2c13))
* build event server using chainhook client library ([#105](hirosystems/ordinals-api#105)) ([ab4c795](hirosystems/ordinals-api@ab4c795))
* chainhook client upgrades ([9a96492](hirosystems/ordinals-api@9a96492))
* consider `tx_index` in transfers by block endpoint ([#178](hirosystems/ordinals-api#178)) ([ed517d6](hirosystems/ordinals-api@ed517d6))
* introduce materialized view to count address inscriptions ([#147](hirosystems/ordinals-api#147)) ([09a95d5](hirosystems/ordinals-api@09a95d5))
* make etag calculation sensitive to inscription location gap fills and upserts ([#156](hirosystems/ordinals-api#156)) ([5648c9e](hirosystems/ordinals-api@5648c9e))
* optimize COUNT calculations via the use of count tables ([#175](hirosystems/ordinals-api#175)) ([31498bd](hirosystems/ordinals-api@31498bd))
* refresh views in parallel ([#154](hirosystems/ordinals-api#154)) ([a7674a9](hirosystems/ordinals-api@a7674a9))
* remove unused json functions ([#165](hirosystems/ordinals-api#165)) ([3eb0e24](hirosystems/ordinals-api@3eb0e24))
* rename location pointer tables ([b84d27e](hirosystems/ordinals-api@b84d27e))
* rollback location pointers ([#174](hirosystems/ordinals-api#174)) ([3c9d7f0](hirosystems/ordinals-api@3c9d7f0))
* save tx_index on locations to support transfers on same block ([#145](hirosystems/ordinals-api#145)) ([30a9635](hirosystems/ordinals-api@30a9635))
* semantic release process ([#202](hirosystems/ordinals-api#202)) ([1bd3f74](hirosystems/ordinals-api@1bd3f74))
* skip db migrations during readonly mode ([d5157f0](hirosystems/ordinals-api@d5157f0))
* upgrade api-toolkit ([#190](hirosystems/ordinals-api#190)) ([a691b67](hirosystems/ordinals-api@a691b67))
* upgrade chainhook client ([cbbb951](hirosystems/ordinals-api@cbbb951))
* upgrade chainhook client to 1.3.3 ([ee66f93](hirosystems/ordinals-api@ee66f93))
* warn correctly on missing prev locations ([879bf55](hirosystems/ordinals-api@879bf55))

* ci: remove debug logs on semantic release [skip ci]

* fix: attempt to optimize brc-20 scan (#204)

* fix: use cursor query for brc-20 scan

* fix: optimize content retrieval

* fix: ignore transfers that are not brc-20

* fix: semantic release

* chore(release): 1.0.0-brc-20.7 [skip ci]

## [1.0.0-brc-20.7](hirosystems/ordinals-api@v1.0.0-brc-20.6...v1.0.0-brc-20.7) (2023-08-30)

### Bug Fixes

* add recursion backfill and temporary skip ([#198](hirosystems/ordinals-api#198)) ([63571ee](hirosystems/ordinals-api@63571ee))
* attempt to optimize brc-20 scan ([#204](hirosystems/ordinals-api#204)) ([f6545cd](hirosystems/ordinals-api@f6545cd))
* do not insert repeated recursions ([#199](hirosystems/ordinals-api#199)) ([9c8508b](hirosystems/ordinals-api@9c8508b))
* dont update cache timestamp during ingestion ([#200](hirosystems/ordinals-api#200)) ([8f973a3](hirosystems/ordinals-api@8f973a3))
* guard against empty recursion refs ([71ce1a5](hirosystems/ordinals-api@71ce1a5))
* optimize inscription backfill indexes ([#197](hirosystems/ordinals-api#197)) ([ab2f7bf](hirosystems/ordinals-api@ab2f7bf))
* semantic release ([26cd2c6](hirosystems/ordinals-api@26cd2c6))
* split recursion insertion into chunks ([#201](hirosystems/ordinals-api#201)) ([4ebc106](hirosystems/ordinals-api@4ebc106))

* fix: optimize brc-20 scan by minimizing string conversions (#206)

* fix: filter brc-20 content from postgres

* fix: optimize transfer insert a bit

* chore: move to pg submodule

* chore(release): 1.0.0-brc-20.8 [skip ci]

## [1.0.0-brc-20.8](hirosystems/ordinals-api@v1.0.0-brc-20.7...v1.0.0-brc-20.8) (2023-08-30)

### Bug Fixes

* optimize brc-20 scan by minimizing string conversions ([#206](hirosystems/ordinals-api#206)) ([98c12c8](hirosystems/ordinals-api@98c12c8))

* fix: insert ops in single queries, reduce BigNumber usage (#207)

* fix: validate mint data in pg

* fix: mint in single query

* fix: insert transfer in single query

* fix: transfer send in single query

* fix: optimize BigNumber usage

* chore(release): 1.0.0-brc-20.9 [skip ci]

## [1.0.0-brc-20.9](hirosystems/ordinals-api@v1.0.0-brc-20.8...v1.0.0-brc-20.9) (2023-08-30)

### Bug Fixes

* insert ops in single queries, reduce BigNumber usage ([#207](hirosystems/ordinals-api#207)) ([ef11e34](hirosystems/ordinals-api@ef11e34))

* fix: cast numbers to postgres numeric

* chore(release): 1.0.0-brc-20.10 [skip ci]

## [1.0.0-brc-20.10](hirosystems/ordinals-api@v1.0.0-brc-20.9...v1.0.0-brc-20.10) (2023-08-30)

### Bug Fixes

* cast numbers to postgres numeric ([f8ae276](hirosystems/ordinals-api@f8ae276))

* fix: remove supply view, calculate supply as we mint

* chore(release): 1.0.0-brc-20.11 [skip ci]

## [1.0.0-brc-20.11](hirosystems/ordinals-api@v1.0.0-brc-20.10...v1.0.0-brc-20.11) (2023-08-30)

### Bug Fixes

* remove supply view, calculate supply as we mint ([36addce](hirosystems/ordinals-api@36addce))

* fix: guard against null bytes

* fix: null char escaping

* chore(release): 1.0.0-brc-20.12 [skip ci]

## [1.0.0-brc-20.12](hirosystems/ordinals-api@v1.0.0-brc-20.11...v1.0.0-brc-20.12) (2023-08-30)

### Bug Fixes

* guard against null bytes ([9eddbfc](hirosystems/ordinals-api@9eddbfc))
* null char escaping ([8bb4954](hirosystems/ordinals-api@8bb4954))

* fix: go back to individual content fetch from utf8 pg errors

* chore(release): 1.0.0-brc-20.13 [skip ci]

## [1.0.0-brc-20.13](hirosystems/ordinals-api@v1.0.0-brc-20.12...v1.0.0-brc-20.13) (2023-08-31)

### Bug Fixes

* go back to individual content fetch from utf8 pg errors ([4fd530d](hirosystems/ordinals-api@4fd530d))

* feat: add BRC-20 event history endpoint (#191)

* feat: add BRC-20 event history/activity ingestion and endpoint

* refactor: switch to concat for a single activity subplan for transfers

* refactor: rename prepare_transfer to transfer

* test: fix faulty test due to duplicate inscription numbers

* refactor: switch to postgres enum type

* refactor: merge multiple queries using CTEs

* test: add test with multiple participants

* refactor: add updates from pr

* test: add block height test

* refactor: merge event inserts using CTEs

* fix: use correct ids for events

* fix: migrate into events with queries

---------

Co-authored-by: janniks <janniks@users.noreply.github.com>
Co-authored-by: Rafael Cardenas <rafael@rafaelcr.com>

* chore(release): 1.0.0-brc-20.14 [skip ci]

## [1.0.0-brc-20.14](hirosystems/ordinals-api@v1.0.0-brc-20.13...v1.0.0-brc-20.14) (2023-08-31)

### Features

* add BRC-20 event history endpoint ([#191](hirosystems/ordinals-api#191)) ([d9967b1](hirosystems/ordinals-api@d9967b1))

* fix: remove migration queries

* chore(release): 1.0.0-brc-20.15 [skip ci]

## [1.0.0-brc-20.15](hirosystems/ordinals-api@v1.0.0-brc-20.14...v1.0.0-brc-20.15) (2023-08-31)

### Bug Fixes

* remove migration queries ([f53f889](hirosystems/ordinals-api@f53f889))

* fix: optimize read queries, display amounts with correct decimals (#208)

* fix: single token

* fix: token list

* fix: holders, add tests

* fix: activity sorting

* fix: display amounts with correct number of decimals

* chore(release): 1.0.0-brc-20.16 [skip ci]

## [1.0.0-brc-20.16](hirosystems/ordinals-api@v1.0.0-brc-20.15...v1.0.0-brc-20.16) (2023-09-01)

### Bug Fixes

* optimize read queries, display amounts with correct decimals ([#208](hirosystems/ordinals-api#208)) ([5d6453e](hirosystems/ordinals-api@5d6453e))

* fix: holders count query (#209)

* chore(release): 1.0.0-brc-20.17 [skip ci]

## [1.0.0-brc-20.17](hirosystems/ordinals-api@v1.0.0-brc-20.16...v1.0.0-brc-20.17) (2023-09-01)

### Bug Fixes

* holders count query ([#209](hirosystems/ordinals-api#209)) ([254ed75](hirosystems/ordinals-api@254ed75))

* fix: temporarily disable count calculation to speed up requests (#210)

* chore(release): 1.0.0-brc-20.18 [skip ci]

## [1.0.0-brc-20.18](hirosystems/ordinals-api@v1.0.0-brc-20.17...v1.0.0-brc-20.18) (2023-09-01)

### Bug Fixes

* temporarily disable count calculation to speed up requests ([#210](hirosystems/ordinals-api#210)) ([640e406](hirosystems/ordinals-api@640e406))

* feat: add fast ingestion mode for faster replays (#211)

* chore(release): 1.0.0-brc-20.19 [skip ci]

## [1.0.0-brc-20.19](hirosystems/ordinals-api@v1.0.0-brc-20.18...v1.0.0-brc-20.19) (2023-09-04)

### Features

* add fast ingestion mode for faster replays ([#211](hirosystems/ordinals-api#211)) ([7996587](hirosystems/ordinals-api@7996587))

* fix: optimize sent as fee detection

* chore(release): 1.0.0-brc-20.20 [skip ci]

## [1.0.0-brc-20.20](hirosystems/ordinals-api@v1.0.0-brc-20.19...v1.0.0-brc-20.20) (2023-09-06)

### Bug Fixes

* optimize sent as fee detection ([1c9b0f4](hirosystems/ordinals-api@1c9b0f4))

* fix: calculate etag correctly on status endpoint (#213)

* fix: calculate etag correctly on status endpoint

* fix: vercel build

* chore(release): 1.0.0-brc-20.21 [skip ci]

## [1.0.0-brc-20.21](hirosystems/ordinals-api@v1.0.0-brc-20.20...v1.0.0-brc-20.21) (2023-09-07)

### Bug Fixes

* calculate etag correctly on status endpoint ([#213](hirosystems/ordinals-api#213)) ([f0c42e2](hirosystems/ordinals-api@f0c42e2))

* fix: optimize read queries by keeping count tables, implement rollbacks (#214)

* feat: total balances table

* fix: add total balance column

* fix: return balance to sender

* fix: more than once transfer

* fix: rollbacks

* fix: use new table for token holders

* fix: ticker length check

* feat: add tx_count to tokens (#215)

* fix: use correct inscription_id for transfer_send event

* feat: add tx_count to tokens

* refactor: rename activities events

---------

Co-authored-by: janniks <janniks@users.noreply.github.com>

* feat: count for activity types

* feat: token count

* test: rollbacks

* test: ignore tickers less than 4 bytes wide

---------

Co-authored-by: janniks <6362150+janniks@users.noreply.github.com>
Co-authored-by: janniks <janniks@users.noreply.github.com>

* chore(release): 1.0.0-brc-20.22 [skip ci]

## [1.0.0-brc-20.22](hirosystems/ordinals-api@v1.0.0-brc-20.21...v1.0.0-brc-20.22) (2023-09-10)

### Bug Fixes

* optimize read queries by keeping count tables, implement rollbacks ([#214](hirosystems/ordinals-api#214)) ([574d349](hirosystems/ordinals-api@574d349)), closes [#215](hirosystems/ordinals-api#215)

* fix: only increase counts on valid operations

* chore(release): 1.0.0-brc-20.23 [skip ci]

## [1.0.0-brc-20.23](hirosystems/ordinals-api@v1.0.0-brc-20.22...v1.0.0-brc-20.23) (2023-09-10)

### Bug Fixes

* only increase counts on valid operations ([01f0865](hirosystems/ordinals-api@01f0865))

* feat: add location to activity response

* chore(release): 1.0.0-brc-20.24 [skip ci]

## [1.0.0-brc-20.24](hirosystems/ordinals-api@v1.0.0-brc-20.23...v1.0.0-brc-20.24) (2023-09-10)

### Features

* add location to activity response ([580861e](hirosystems/ordinals-api@580861e))

* fix: change tx_count to json number (#216)

Co-authored-by: janniks <janniks@users.noreply.github.com>

* chore(release): 1.0.0-brc-20.25 [skip ci]

## [1.0.0-brc-20.25](hirosystems/ordinals-api@v1.0.0-brc-20.24...v1.0.0-brc-20.25) (2023-09-11)

### Bug Fixes

* change tx_count to json number ([#216](hirosystems/ordinals-api#216)) ([20f9415](hirosystems/ordinals-api@20f9415))

* fix: ticker filter for balances (#217)

* chore(release): 1.0.0-brc-20.26 [skip ci]

## [1.0.0-brc-20.26](hirosystems/ordinals-api@v1.0.0-brc-20.25...v1.0.0-brc-20.26) (2023-09-11)

### Bug Fixes

* ticker filter for balances ([#217](hirosystems/ordinals-api#217)) ([1ca3bcd](hirosystems/ordinals-api@1ca3bcd))

* fix: return to sender balance calculation (#218)

* chore(release): 1.0.0-brc-20.27 [skip ci]

## [1.0.0-brc-20.27](hirosystems/ordinals-api@v1.0.0-brc-20.26...v1.0.0-brc-20.27) (2023-09-12)

### Bug Fixes

* return to sender balance calculation ([#218](hirosystems/ordinals-api#218)) ([226dfe6](hirosystems/ordinals-api@226dfe6))

---------

Co-authored-by: semantic-release-bot <semantic-release-bot@martynus.net>
Co-authored-by: janniks <6362150+janniks@users.noreply.github.com>
Co-authored-by: janniks <janniks@users.noreply.github.com>
Co-authored-by: Dean Chi <21262275+deantchi@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Get BRC-20 Activity at a given block-height
3 participants