Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
0e4760c
local build
rafa-stacks May 20, 2026
554a960
use codec for pox4 events
rafa-stacks May 20, 2026
3a4e3d5
table migration
rafa-stacks May 21, 2026
b6cfb47
chore: merge next
rafa-stacks May 22, 2026
ab7353d
bond schemas
rafa-stacks May 22, 2026
dc1622d
type and schema progress
rafa-stacks May 25, 2026
fed3087
rewards start
rafa-stacks May 26, 2026
c90cd50
fix: perserve block boundaries for v3 transaction cursors (#2565)
rafa-stacks May 26, 2026
438db72
chore(release): 9.0.0-next.34 [skip ci]
rafa-stacks May 26, 2026
8802e36
feat: add v3 transaction events endpoint (#2566)
rafa-stacks May 27, 2026
e39a882
fix: only modify event indexes if they dont exist (#2567)
rafa-stacks May 28, 2026
a86f092
chore(release): v9.0.0-next.35 [skip ci]
rafa-stacks May 28, 2026
32d61af
fix: decode memo as straight ascii (#2568)
rafa-stacks May 28, 2026
2b74100
chore(release): v9.0.0-next.36 [skip ci]
rafa-stacks May 28, 2026
3196532
chore: merge next
rafa-stacks May 28, 2026
32ef39b
start consuming bond events
rafa-stacks May 29, 2026
67739ff
add some position updates
rafa-stacks May 29, 2026
cf6dc4f
bond rewards init
rafa-stacks May 29, 2026
8574235
bond summaries start
rafa-stacks Jun 1, 2026
61e85a2
new bond fields
rafa-stacks Jun 1, 2026
bd3f254
calculate bond paid out data
rafa-stacks Jun 1, 2026
ff8b193
bond status
rafa-stacks Jun 1, 2026
1c31a10
bond allowlist
rafa-stacks Jun 1, 2026
2de70a5
allowlist entry for principal
rafa-stacks Jun 1, 2026
1798f10
registrations endpoints
rafa-stacks Jun 1, 2026
2a9253e
add pox4 unlock height
rafa-stacks Jun 2, 2026
a0b0175
pox4 boundary unlocks
rafa-stacks Jun 2, 2026
90dc5e9
update snp
rafa-stacks Jun 2, 2026
237c615
upgrade codec
rafa-stacks Jun 2, 2026
f61bce9
fix client version merge
rafa-stacks Jun 2, 2026
a096a74
fix ds test
rafa-stacks Jun 2, 2026
5e2571a
fix pox4 test
rafa-stacks Jun 2, 2026
8cb53b5
fix esm imports in migrations
rafa-stacks Jun 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"outputCapture": "std",
"internalConsoleOptions": "openOnSessionStart",
"env": {
"NODE_ENV": "development"
"NODE_ENV": "production"
}
},
{
Expand Down
2,006 changes: 1,885 additions & 121 deletions client/src/generated/schema.d.ts

Large diffs are not rendered by default.

54 changes: 54 additions & 0 deletions migrations/1775100000000_tx-event-pagination-indexes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import type { MigrationBuilder } from 'node-pg-migrate';

const CANONICAL_EVENT_WHERE = 'canonical = TRUE AND microblock_canonical = TRUE';

export const up = (pgm: MigrationBuilder) => {
pgm.createIndex('stx_events', ['tx_id', 'event_index'], {
name: 'stx_events_canonical_tx_id_event_index_idx',
where: CANONICAL_EVENT_WHERE,
ifNotExists: true,
});
pgm.createIndex('ft_events', ['tx_id', 'event_index'], {
name: 'ft_events_canonical_tx_id_event_index_idx',
where: CANONICAL_EVENT_WHERE,
ifNotExists: true,
});
pgm.createIndex('nft_events', ['tx_id', 'event_index'], {
name: 'nft_events_canonical_tx_id_event_index_idx',
where: CANONICAL_EVENT_WHERE,
ifNotExists: true,
});
pgm.createIndex('stx_lock_events', ['tx_id', 'event_index'], {
name: 'stx_lock_events_canonical_tx_id_event_index_idx',
where: CANONICAL_EVENT_WHERE,
ifNotExists: true,
});
pgm.createIndex('contract_logs', ['tx_id', 'event_index'], {
name: 'contract_logs_canonical_tx_id_event_index_idx',
where: CANONICAL_EVENT_WHERE,
ifNotExists: true,
});
};

export const down = (pgm: MigrationBuilder) => {
pgm.dropIndex('stx_events', [], {
name: 'stx_events_canonical_tx_id_event_index_idx',
ifExists: true,
});
pgm.dropIndex('ft_events', [], {
name: 'ft_events_canonical_tx_id_event_index_idx',
ifExists: true,
});
pgm.dropIndex('nft_events', [], {
name: 'nft_events_canonical_tx_id_event_index_idx',
ifExists: true,
});
pgm.dropIndex('stx_lock_events', [], {
name: 'stx_lock_events_canonical_tx_id_event_index_idx',
ifExists: true,
});
pgm.dropIndex('contract_logs', [], {
name: 'contract_logs_canonical_tx_id_event_index_idx',
ifExists: true,
});
};
88 changes: 88 additions & 0 deletions migrations/1779392293803_pox5-events.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
import type { MigrationBuilder } from 'node-pg-migrate';

export const up = (pgm: MigrationBuilder) => {
pgm.createTable('pox5_events', {
id: {
type: 'bigserial',
primaryKey: true,
},
event_index: {
type: 'integer',
notNull: true,
},
tx_id: {
notNull: true,
type: 'bytea',
},
tx_index: {
type: 'smallint',
notNull: true,
},
block_height: {
type: 'integer',
notNull: true,
},
index_block_hash: {
type: 'bytea',
notNull: true,
},
parent_index_block_hash: {
type: 'bytea',
notNull: true,
},
microblock_hash: {
type: 'bytea',
notNull: true,
},
microblock_sequence: {
type: 'integer',
notNull: true,
},
microblock_canonical: {
type: 'boolean',
notNull: true,
},
canonical: {
type: 'boolean',
notNull: true,
},
name: {
type: 'text',
notNull: true,
},
data: {
type: 'jsonb',
notNull: true,
},
});

pgm.createIndex(
'pox5_events',
[
{ name: 'block_height', sort: 'DESC' },
{ name: 'microblock_sequence', sort: 'DESC' },
{ name: 'tx_index', sort: 'DESC' },
{ name: 'event_index', sort: 'DESC' },
],
{
where: 'canonical = TRUE AND microblock_canonical = TRUE',
}
);
pgm.createIndex('pox5_events', 'tx_id');
pgm.createIndex('pox5_events', ['index_block_hash', 'canonical']);
pgm.createIndex('pox5_events', 'microblock_hash');

// Add pox_v5_unlock_height to pox_state table to track the unlock height for pox v5
pgm.addColumn('pox_state', {
pox_v4_unlock_height: {
type: 'bigint',
notNull: true,
default: 0,
},
});
};

export const down = (pgm: MigrationBuilder) => {
pgm.dropTable('pox5_events');
pgm.dropColumn('pox_state', 'pox_v4_unlock_height');
};
145 changes: 145 additions & 0 deletions migrations/1779487960678_bonds.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
import type { ColumnDefinitions, MigrationBuilder } from 'node-pg-migrate';

export const shorthands: ColumnDefinitions | undefined = undefined;

export const up = (pgm: MigrationBuilder) => {
pgm.createTable('bonds', {
id: {
type: 'bigserial',
primaryKey: true,
},
tx_id: {
type: 'bytea',
notNull: true,
},
tx_index: {
type: 'smallint',
notNull: true,
},
block_height: {
type: 'integer',
notNull: true,
},
index_block_hash: {
type: 'bytea',
notNull: true,
},
parent_index_block_hash: {
type: 'bytea',
notNull: true,
},
microblock_hash: {
type: 'bytea',
notNull: true,
},
microblock_sequence: {
type: 'integer',
notNull: true,
},
microblock_canonical: {
type: 'boolean',
notNull: true,
},
canonical: {
type: 'boolean',
notNull: true,
},
bond_index: {
type: 'integer',
notNull: true,
},
target_rate: {
type: 'integer',
notNull: true,
},
stx_value_ratio: {
type: 'integer',
notNull: true,
},
min_ustx_ratio: {
type: 'integer',
notNull: true,
},
early_unlock_bytes: {
type: 'text',
notNull: true,
},
early_unlock_admin: {
type: 'text',
notNull: true,
},
first_reward_cycle: {
type: 'integer',
notNull: true,
},
bond_start_height: {
type: 'integer',
notNull: true,
},
unlock_cycle: {
type: 'integer',
notNull: true,
},
unlock_burn_height: {
type: 'integer',
notNull: true,
},
btc_capacity: {
type: 'numeric',
notNull: true,
},
btc_locked: {
type: 'numeric',
notNull: true,
default: 0,
},
stx_locked: {
type: 'numeric',
notNull: true,
default: 0,
},
btc_paid_out: {
type: 'numeric',
notNull: true,
default: 0,
},
allowed_count: {
type: 'integer',
notNull: true,
default: 0,
},
registered_count: {
type: 'integer',
notNull: true,
default: 0,
},
});
pgm.createIndex(
'bonds',
[
{ name: 'block_height', sort: 'DESC' },
{ name: 'microblock_sequence', sort: 'DESC' },
{ name: 'tx_index', sort: 'DESC' },
],
{
where: 'canonical = TRUE AND microblock_canonical = TRUE',
}
);
pgm.createIndex('bonds', 'bond_index', {
where: 'canonical = TRUE AND microblock_canonical = TRUE',
});

// Add bond count to chain tip table to track the number of bonds in the chain
pgm.addColumn('chain_tip', {
bond_count: {
type: 'integer',
notNull: true,
default: 0,
},
});
};

export const down = (pgm: MigrationBuilder) => {
pgm.dropTable('bonds');
pgm.dropColumn('chain_tip', 'bond_count');
};
82 changes: 82 additions & 0 deletions migrations/1779487971367_bond-allowlist-entries.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
import type { ColumnDefinitions, MigrationBuilder } from 'node-pg-migrate';

export const shorthands: ColumnDefinitions | undefined = undefined;

export const up = (pgm: MigrationBuilder) => {
pgm.createTable('bond_allowlist_entries', {
id: {
type: 'bigserial',
primaryKey: true,
},
tx_id: {
type: 'bytea',
notNull: true,
},
tx_index: {
type: 'smallint',
notNull: true,
},
block_height: {
type: 'integer',
notNull: true,
},
index_block_hash: {
type: 'bytea',
notNull: true,
},
parent_index_block_hash: {
type: 'bytea',
notNull: true,
},
microblock_hash: {
type: 'bytea',
notNull: true,
},
microblock_sequence: {
type: 'integer',
notNull: true,
},
microblock_canonical: {
type: 'boolean',
notNull: true,
},
canonical: {
type: 'boolean',
notNull: true,
},
bond_index: {
type: 'integer',
notNull: true,
},
staker: {
type: 'string',
notNull: true,
},
max_sats: {
type: 'string',
notNull: true,
},
});

pgm.createIndex(
'bond_allowlist_entries',
[
{ name: 'block_height', sort: 'DESC' },
{ name: 'microblock_sequence', sort: 'DESC' },
{ name: 'tx_index', sort: 'DESC' },
],
{
where: 'canonical = TRUE AND microblock_canonical = TRUE',
}
);
pgm.createIndex('bond_allowlist_entries', 'bond_index', {
where: 'canonical = TRUE AND microblock_canonical = TRUE',
});
pgm.createIndex('bond_allowlist_entries', 'staker', {
where: 'canonical = TRUE AND microblock_canonical = TRUE',
});
};

export const down = (pgm: MigrationBuilder) => {
pgm.dropTable('bond_allowlist_entries');
};
Loading
Loading