-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: support reinscription transfers (#348)
* chore: progress * feat: new apply * fix: minted supply * fix: track tx counts * feat: rollbacks * fix: transfer rollbacks * fix: activity addresses * fix: multiple transfer test * fix: holders * fix: operation indexes * chore: draft * fix: style * chore: optimize migrations * fix: initial inserts * fix: get inscription endpoint * fix: rollback * fix: ordhook tests passing * chore: logging * fix: recursion refs * fix: current location comparison * fix: transfers table * test: sat reinscription transfers * fix: start applying counts * fix: tests * fix: all api tests passing * test: transfers per block reinscription * test: address transfer counts * fix: brc20 tests * chore: refactor block caches * chore: clean unused exports
- Loading branch information
Showing
48 changed files
with
1,355 additions
and
1,808 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* eslint-disable @typescript-eslint/naming-convention */ | ||
import { MigrationBuilder, ColumnDefinitions } from 'node-pg-migrate'; | ||
|
||
export const shorthands: ColumnDefinitions | undefined = undefined; | ||
|
||
export function up(pgm: MigrationBuilder): void { | ||
pgm.createTable('satoshis', { | ||
ordinal_number: { | ||
type: 'numeric', | ||
primaryKey: true, | ||
}, | ||
rarity: { | ||
type: 'text', | ||
notNull: true, | ||
}, | ||
coinbase_height: { | ||
type: 'bigint', | ||
notNull: true, | ||
}, | ||
}); | ||
pgm.createIndex('satoshis', ['rarity']); | ||
} |
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,52 @@ | ||
/* eslint-disable @typescript-eslint/naming-convention */ | ||
import { MigrationBuilder, ColumnDefinitions } from 'node-pg-migrate'; | ||
|
||
export const shorthands: ColumnDefinitions | undefined = undefined; | ||
|
||
export function up(pgm: MigrationBuilder): void { | ||
pgm.createTable('inscription_transfers', { | ||
genesis_id: { | ||
type: 'text', | ||
notNull: true, | ||
}, | ||
number: { | ||
type: 'bigint', | ||
notNull: true, | ||
}, | ||
ordinal_number: { | ||
type: 'numeric', | ||
notNull: true, | ||
}, | ||
block_height: { | ||
type: 'bigint', | ||
notNull: true, | ||
}, | ||
tx_index: { | ||
type: 'bigint', | ||
notNull: true, | ||
}, | ||
block_hash: { | ||
type: 'text', | ||
notNull: true, | ||
}, | ||
block_transfer_index: { | ||
type: 'int', | ||
notNull: true, | ||
}, | ||
}); | ||
pgm.createConstraint('inscription_transfers', 'inscription_transfers_pkey', { | ||
primaryKey: ['block_height', 'block_transfer_index'], | ||
}); | ||
pgm.createConstraint( | ||
'inscription_transfers', | ||
'inscription_transfers_locations_fk', | ||
'FOREIGN KEY(ordinal_number, block_height, tx_index) REFERENCES locations(ordinal_number, block_height, tx_index) ON DELETE CASCADE' | ||
); | ||
pgm.createConstraint( | ||
'inscription_transfers', | ||
'inscription_transfers_satoshis_fk', | ||
'FOREIGN KEY(ordinal_number) REFERENCES satoshis(ordinal_number) ON DELETE CASCADE' | ||
); | ||
pgm.createIndex('inscription_transfers', ['genesis_id']); | ||
pgm.createIndex('inscription_transfers', ['number']); | ||
} |
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,25 @@ | ||
/* eslint-disable @typescript-eslint/naming-convention */ | ||
import { MigrationBuilder, ColumnDefinitions } from 'node-pg-migrate'; | ||
|
||
export const shorthands: ColumnDefinitions | undefined = undefined; | ||
|
||
export function up(pgm: MigrationBuilder): void { | ||
pgm.createTable('inscription_recursions', { | ||
genesis_id: { | ||
type: 'text', | ||
notNull: true, | ||
}, | ||
ref_genesis_id: { | ||
type: 'text', | ||
notNull: true, | ||
}, | ||
}); | ||
pgm.createConstraint('inscription_recursions', 'inscription_recursions_pkey', { | ||
primaryKey: ['genesis_id', 'ref_genesis_id'], | ||
}); | ||
pgm.createConstraint( | ||
'inscription_recursions', | ||
'inscription_recursions_genesis_id_fk', | ||
'FOREIGN KEY(genesis_id) REFERENCES inscriptions(genesis_id) ON DELETE CASCADE' | ||
); | ||
} |
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 was deleted.
Oops, something went wrong.
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
Oops, something went wrong.