Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
31 changes: 31 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,34 @@
## [8.13.5](https://github.com/hirosystems/stacks-blockchain-api/compare/v8.13.4...v8.13.5) (2025-12-02)


### Bug Fixes

* support new sip-034 tenure change causes ([#2384](https://github.com/hirosystems/stacks-blockchain-api/issues/2384)) ([399908f](https://github.com/hirosystems/stacks-blockchain-api/commit/399908fd08fdaee3edc5b0820f0526378f7ab51a))

## [8.13.4](https://github.com/hirosystems/stacks-blockchain-api/compare/v8.13.3...v8.13.4) (2025-11-06)


### Bug Fixes

* upgrade to latest stacks-encoding-native-js with arm64 support ([#2376](https://github.com/hirosystems/stacks-blockchain-api/issues/2376)) ([5ab7328](https://github.com/hirosystems/stacks-blockchain-api/commit/5ab7328c4c63c270fe0c43cec45f2a5a3e84d4cf))

## [8.13.3](https://github.com/hirosystems/stacks-blockchain-api/compare/v8.13.2...v8.13.3) (2025-11-06)


### Bug Fixes

* upgrade stacks-encoding-native-js ([#2375](https://github.com/hirosystems/stacks-blockchain-api/issues/2375)) ([ae9933b](https://github.com/hirosystems/stacks-blockchain-api/commit/ae9933b1d0caf303838db621997c31f749100ff8))

## [8.13.2](https://github.com/hirosystems/stacks-blockchain-api/compare/v8.13.1...v8.13.2) (2025-10-21)


### Bug Fixes

* calculate burnchain reward reorgs correctly ([#2355](https://github.com/hirosystems/stacks-blockchain-api/issues/2355)) ([f82efbc](https://github.com/hirosystems/stacks-blockchain-api/commit/f82efbc6ddc0d98bea92c389888dfc7b5b17926b))
* do not display revoked pool delegations ([#2357](https://github.com/hirosystems/stacks-blockchain-api/issues/2357)) ([c6de314](https://github.com/hirosystems/stacks-blockchain-api/commit/c6de31493b92c4e5ae5dcc44519dcc9867886abd))
* push redis updates to a stream ([#2360](https://github.com/hirosystems/stacks-blockchain-api/issues/2360)) ([2bfacf6](https://github.com/hirosystems/stacks-blockchain-api/commit/2bfacf6ee5ef19758f0b7b24cdbd677f4d89e0ed))
* sanitize event observer strings ([#2361](https://github.com/hirosystems/stacks-blockchain-api/issues/2361)) ([2604539](https://github.com/hirosystems/stacks-blockchain-api/commit/2604539d5e94f0f2ec20d05d86aa3690dcdb1474))

## [8.13.1](https://github.com/hirosystems/stacks-blockchain-api/compare/v8.13.0...v8.13.1) (2025-09-23)


Expand Down
102 changes: 78 additions & 24 deletions client/src/generated/schema.d.ts

Large diffs are not rendered by default.

33 changes: 17 additions & 16 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
"@fastify/type-provider-typebox": "4.0.0",
"@hirosystems/api-toolkit": "1.9.0",
"@hirosystems/salt-n-pepper-client": "1.1.2",
"@hirosystems/stacks-encoding-native-js": "1.2.0",
"@scure/base": "1.1.1",
"@sinclair/typebox": "0.32.35",
"@stacks/common": "6.10.0",
Expand Down Expand Up @@ -146,7 +147,6 @@
"socket.io": "4.8.0",
"source-map-support": "0.5.21",
"split2": "3.2.2",
"stacks-encoding-native-js": "1.1.0-beta.8",
"strict-event-emitter-types": "2.0.0",
"tiny-secp256k1": "2.2.1",
"ts-unused-exports": "7.0.3",
Expand Down
12 changes: 11 additions & 1 deletion src/api/controllers/db-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
decodeClarityValueToRepr,
decodeClarityValueToTypeName,
decodePostConditions,
} from 'stacks-encoding-native-js';
} from '@hirosystems/stacks-encoding-native-js';

import {
RosettaBlock,
Expand Down Expand Up @@ -152,6 +152,16 @@ export function getTxTenureChangeCauseString(cause: number) {
return 'block_found';
case 1:
return 'extended';
case 2:
return 'extended_runtime';
case 3:
return 'extended_read_count';
case 4:
return 'extended_read_length';
case 5:
return 'extended_write_count';
case 6:
return 'extended_write_length';
default:
throw new Error(`Unexpected tenure change cause value ${cause}`);
}
Expand Down
2 changes: 1 addition & 1 deletion src/api/routes/address.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
parseDbTx,
} from '../controllers/db-controller';
import { InvalidRequestError, InvalidRequestErrorType, NotFoundError } from '../../errors';
import { decodeClarityValueToRepr } from 'stacks-encoding-native-js';
import { decodeClarityValueToRepr } from '@hirosystems/stacks-encoding-native-js';
import {
handlePrincipalCache,
handlePrincipalMempoolCache,
Expand Down
2 changes: 1 addition & 1 deletion src/api/routes/debug.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/no-non-null-assertion */
import { stacksToBitcoinAddress } from 'stacks-encoding-native-js';
import { stacksToBitcoinAddress } from '@hirosystems/stacks-encoding-native-js';
import { htmlEscape } from 'escape-goat';
import {
makeSTXTokenTransfer,
Expand Down
2 changes: 1 addition & 1 deletion src/api/routes/rosetta/construction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ import {
uintCV,
} from '@stacks/transactions';
import * as express from 'express';
import { bitcoinToStacksAddress } from 'stacks-encoding-native-js';
import { bitcoinToStacksAddress } from '@hirosystems/stacks-encoding-native-js';
import { StacksCoreRpcClient, getCoreNodeEndpoint } from '../../../core-rpc/client';
import { DbBlock } from '../../../datastore/common';
import { PgStore } from '../../../datastore/pg-store';
Expand Down
2 changes: 1 addition & 1 deletion src/api/routes/tokens.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { getPagingQueryLimit, parsePagingQueryInput, ResourceType } from '../pagination';
import { isValidPrincipal } from '../../helpers';
import { decodeClarityValueToRepr } from 'stacks-encoding-native-js';
import { decodeClarityValueToRepr } from '@hirosystems/stacks-encoding-native-js';
import { getAssetEventTypeString, parseDbTx } from '../controllers/db-controller';
import { handleChainTipCache } from '../controllers/cache-controller';
import { has0xPrefix } from '@hirosystems/api-toolkit';
Expand Down
2 changes: 1 addition & 1 deletion src/api/routes/v2/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
getTxStatusString,
parseDbTx,
} from '../../../api/controllers/db-controller';
import { decodeClarityValueToRepr } from 'stacks-encoding-native-js';
import { decodeClarityValueToRepr } from '@hirosystems/stacks-encoding-native-js';
import { TransactionVersion, getAddressFromPublicKey } from '@stacks/transactions';
import { SmartContractStatusList } from '../../schemas/entities/smart-contracts';
import { AddressTransaction, AddressTransactionEvent } from '../../schemas/entities/addresses';
Expand Down
19 changes: 15 additions & 4 deletions src/api/schemas/entities/transactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -324,10 +324,21 @@ export const TenureChangeTransactionMetadataProperties = {
previous_tenure_blocks: Type.Integer({
description: 'The number of blocks produced in the previous tenure.',
}),
cause: Type.Union([Type.Literal('block_found'), Type.Literal('extended')], {
description:
'Cause of change in mining tenure. Depending on cause, tenure can be ended or extended.',
}),
cause: Type.Union(
[
Type.Literal('block_found'),
Type.Literal('extended'),
Type.Literal('extended_runtime'),
Type.Literal('extended_read_count'),
Type.Literal('extended_read_length'),
Type.Literal('extended_write_count'),
Type.Literal('extended_write_length'),
],
{
description:
'Cause of change in mining tenure. Depending on cause, tenure can be ended or extended.',
}
),
pubkey_hash: Type.String({
description: '(Hex string) The ECDSA public key hash of the current tenure.',
}),
Expand Down
2 changes: 1 addition & 1 deletion src/api/serializers/post-conditions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
PostConditionAssetInfoID,
PostConditionPrincipal,
PostConditionPrincipalTypeID,
} from 'stacks-encoding-native-js';
} from '@hirosystems/stacks-encoding-native-js';

const assetPrincipalTypeMap = {
[PostConditionPrincipalTypeID.Origin]: 'principal_origin',
Expand Down
2 changes: 1 addition & 1 deletion src/c32-addr-cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ and for now this approach is much easier and faster.

import * as c32check from 'c32check';
import * as LruCache from 'lru-cache';
import { stacksAddressFromParts } from 'stacks-encoding-native-js';
import { stacksAddressFromParts } from '@hirosystems/stacks-encoding-native-js';

type c32AddressFn = typeof c32check.c32address;

Expand Down
2 changes: 1 addition & 1 deletion src/datastore/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ import {
PostConditionAuthFlag,
PrincipalTypeID,
TxPayloadTypeID,
} from 'stacks-encoding-native-js';
} from '@hirosystems/stacks-encoding-native-js';
import { getTxSenderAddress } from '../event-stream/reader';
import postgres = require('postgres');
import * as prom from 'prom-client';
Expand Down
2 changes: 1 addition & 1 deletion src/event-stream/bns/bns-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
ClarityValueTuple,
ClarityValueUInt,
TxPayloadTypeID,
} from 'stacks-encoding-native-js';
} from '@hirosystems/stacks-encoding-native-js';
import { SmartContractEvent } from '../core-node-message';
import { DbBnsNamespace, DbBnsName } from '../../datastore/common';
import { hexToBuffer, hexToUtf8String } from '@hirosystems/api-toolkit';
Expand Down
2 changes: 1 addition & 1 deletion src/event-stream/core-node-message.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DecodedTxResult } from 'stacks-encoding-native-js';
import { DecodedTxResult } from '@hirosystems/stacks-encoding-native-js';
import { ClarityAbi } from './contract-abi';

export enum CoreNodeEventType {
Expand Down
2 changes: 1 addition & 1 deletion src/event-stream/event-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ import {
ClarityValueStringAscii,
ClarityValueTuple,
TxPayloadTypeID,
} from 'stacks-encoding-native-js';
} from '@hirosystems/stacks-encoding-native-js';
import { BnsContractIdentifier } from './bns/bns-constants';
import {
parseNameFromContractEvent,
Expand Down
2 changes: 1 addition & 1 deletion src/event-stream/pox-event-parsing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import {
ClarityValueTuple,
ClarityValueUInt,
decodeClarityValue,
} from 'stacks-encoding-native-js';
} from '@hirosystems/stacks-encoding-native-js';
import { poxAddressToBtcAddress } from '@stacks/stacking';
import { SyntheticPoxEventName } from '../pox-helpers';
import { logger } from '../logger';
Expand Down
2 changes: 1 addition & 1 deletion src/event-stream/reader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import {
TxSpendingConditionSingleSigHashMode,
decodeClarityValueList,
ClarityValueBuffer,
} from 'stacks-encoding-native-js';
} from '@hirosystems/stacks-encoding-native-js';
import {
DbMicroblockPartial,
DbPoxSyntheticDelegateStxEvent,
Expand Down
5 changes: 4 additions & 1 deletion src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ import * as btc from 'bitcoinjs-lib';
import * as dotenv from 'dotenv-flow';
import * as http from 'http';
import * as path from 'path';
import { isValidStacksAddress, stacksToBitcoinAddress } from 'stacks-encoding-native-js';
import {
isValidStacksAddress,
stacksToBitcoinAddress,
} from '@hirosystems/stacks-encoding-native-js';
import * as stream from 'stream';
import * as ecc from 'tiny-secp256k1';
import * as util from 'util';
Expand Down
2 changes: 1 addition & 1 deletion src/import-v1/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import * as util from 'util';
import * as readline from 'readline';
import * as path from 'path';
import * as zlib from 'zlib';
import { bitcoinToStacksAddress } from 'stacks-encoding-native-js';
import { bitcoinToStacksAddress } from '@hirosystems/stacks-encoding-native-js';
import * as split2 from 'split2';
import {
DataStoreBnsBlockTxData,
Expand Down
2 changes: 1 addition & 1 deletion src/inspector-util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { Socket } from 'net';
import * as os from 'os';
import * as path from 'path';
import * as fs from 'fs';
import { startProfiler, stopProfiler } from 'stacks-encoding-native-js';
import { startProfiler, stopProfiler } from '@hirosystems/stacks-encoding-native-js';
import { logger } from './logger';
import { stopwatch, Stopwatch, timeout } from '@hirosystems/api-toolkit';

Expand Down
2 changes: 1 addition & 1 deletion src/rosetta/rosetta-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ import {
decodeClarityValueList,
ClarityValue,
ClarityValueList,
} from 'stacks-encoding-native-js';
} from '@hirosystems/stacks-encoding-native-js';
import { PgStore } from '../datastore/pg-store';
import { poxAddressToBtcAddress } from '@stacks/stacking';
import { parseRecoverableSignatureVrs } from '@stacks/common';
Expand Down
2 changes: 1 addition & 1 deletion tests/2.5/pox-4-burnchain-delegate-stx.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import { StacksNetwork } from '@stacks/network';
import { RPCClient } from 'rpc-bitcoin';
import * as supertest from 'supertest';
import { PoxContractIdentifier } from '../../src/pox-helpers';
import { ClarityValueUInt, decodeClarityValue } from 'stacks-encoding-native-js';
import { ClarityValueUInt, decodeClarityValue } from '@hirosystems/stacks-encoding-native-js';
import { decodeBtcAddress, poxAddressToBtcAddress } from '@stacks/stacking';
import { timeout } from '@hirosystems/api-toolkit';
import { AddressStxBalance } from '../../src/api/schemas/entities/addresses';
Expand Down
2 changes: 1 addition & 1 deletion tests/2.5/pox-4-burnchain-stack-stx.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import { ApiServer } from '../../src/api/init';
import { StacksNetwork } from '@stacks/network';
import { RPCClient } from 'rpc-bitcoin';
import * as supertest from 'supertest';
import { ClarityValueUInt, decodeClarityValue } from 'stacks-encoding-native-js';
import { ClarityValueUInt, decodeClarityValue } from '@hirosystems/stacks-encoding-native-js';
import { decodeBtcAddress, poxAddressToTuple } from '@stacks/stacking';
import { timeout } from '@hirosystems/api-toolkit';
import { hexToBytes } from '@stacks/common';
Expand Down
2 changes: 1 addition & 1 deletion tests/2.5/pox-4-delegate-aggregation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import {
ClarityValueTuple,
ClarityValueUInt,
decodeClarityValue,
} from 'stacks-encoding-native-js';
} from '@hirosystems/stacks-encoding-native-js';
import * as assert from 'assert';
import { hexToBytes } from '@stacks/common';
import { StackingClient } from '@stacks/stacking';
Expand Down
6 changes: 5 additions & 1 deletion tests/2.5/pox-4-delegate-revoked-stacking.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ import {
standardPrincipalCV,
uintCV,
} from '@stacks/transactions';
import { ClarityValueTuple, ClarityValueUInt, decodeClarityValue } from 'stacks-encoding-native-js';
import {
ClarityValueTuple,
ClarityValueUInt,
decodeClarityValue,
} from '@hirosystems/stacks-encoding-native-js';
import { testnetKeys } from '../../src/api/routes/debug';
import { CoreRpcPoxInfo } from '../../src/core-rpc/client';
import { DbTxStatus } from '../../src/datastore/common';
Expand Down
2 changes: 1 addition & 1 deletion tests/2.5/pox-4-delegate-stacking.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
standardPrincipalCV,
uintCV,
} from '@stacks/transactions';
import { ClarityValueTuple, ClarityValueUInt } from 'stacks-encoding-native-js';
import { ClarityValueTuple, ClarityValueUInt } from '@hirosystems/stacks-encoding-native-js';
import * as assert from 'assert';
import { StackingClient } from '@stacks/stacking';
import { getPublicKeyFromPrivate } from '@stacks/encryption';
Expand Down
2 changes: 1 addition & 1 deletion tests/api/address.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
serializeCV,
} from '@stacks/transactions';
import { createClarityValueArray } from '../../src/stacks-encoding-helpers';
import { decodeTransaction } from 'stacks-encoding-native-js';
import { decodeTransaction } from '@hirosystems/stacks-encoding-native-js';
import {
DbBlock,
DbTxTypeId,
Expand Down
5 changes: 4 additions & 1 deletion tests/api/helpers.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/* eslint-disable @typescript-eslint/no-non-null-assertion */
import * as c32check from 'c32check';
import { bitcoinToStacksAddress, stacksToBitcoinAddress } from 'stacks-encoding-native-js';
import {
bitcoinToStacksAddress,
stacksToBitcoinAddress,
} from '@hirosystems/stacks-encoding-native-js';
import * as c32AddrCache from '../../src/c32-addr-cache';
import { ADDR_CACHE_ENV_VAR } from '../../src/c32-addr-cache';
import { isValidBitcoinAddress, getUintEnvOrDefault, BitVec } from '../../src/helpers';
Expand Down
2 changes: 1 addition & 1 deletion tests/api/import-genesis.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { importV1TokenOfferingData } from '../../src/import-v1';
import { bitcoinToStacksAddress } from 'stacks-encoding-native-js';
import { bitcoinToStacksAddress } from '@hirosystems/stacks-encoding-native-js';
import { PgWriteStore } from '../../src/datastore/pg-write-store';
import { migrate } from '../utils/test-helpers';

Expand Down
2 changes: 1 addition & 1 deletion tests/api/parse-db-tx.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { migrate } from '../utils/test-helpers';
import { importEventsFromTsv } from '../../src/event-replay/event-replay';
import { decodeClarityValueList } from 'stacks-encoding-native-js';
import { decodeClarityValueList } from '@hirosystems/stacks-encoding-native-js';
import * as fs from 'fs';
import * as readline from 'readline';
import { PgSqlClient, timeout } from '@hirosystems/api-toolkit';
Expand Down
Loading