Skip to content

Commit 61ab19f

Browse files
authored
feat: update to stacks codec, support stacks 3.4 (#2487)
1 parent 5f9aa58 commit 61ab19f

35 files changed

+331
-334
lines changed

client/src/generated/schema.d.ts

Lines changed: 265 additions & 265 deletions
Large diffs are not rendered by default.

package-lock.json

Lines changed: 17 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,9 @@
9797
"@fastify/swagger": "8.15.0",
9898
"@fastify/type-provider-typebox": "4.0.0",
9999
"@hirosystems/api-toolkit": "1.12.0",
100-
"@hirosystems/stacks-encoding-native-js": "1.3.0",
101100
"@scure/base": "1.1.1",
102101
"@sinclair/typebox": "0.32.35",
102+
"@stacks/codec": "1.6.0",
103103
"@stacks/common": "6.10.0",
104104
"@stacks/encryption": "6.13.1",
105105
"@stacks/network": "6.11.3",

src/api/controllers/db-controller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
decodeClarityValueToRepr,
1010
decodeClarityValueToTypeName,
1111
decodePostConditions,
12-
} from '@hirosystems/stacks-encoding-native-js';
12+
} from '@stacks/codec';
1313

1414
import {
1515
RosettaBlock,

src/api/routes/address.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
parseDbTx,
1515
} from '../controllers/db-controller';
1616
import { InvalidRequestError, InvalidRequestErrorType, NotFoundError } from '../../errors';
17-
import { decodeClarityValueToRepr } from '@hirosystems/stacks-encoding-native-js';
17+
import { decodeClarityValueToRepr } from '@stacks/codec';
1818
import {
1919
handlePrincipalCache,
2020
handlePrincipalMempoolCache,

src/api/routes/debug.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* eslint-disable @typescript-eslint/no-non-null-assertion */
2-
import { stacksToBitcoinAddress } from '@hirosystems/stacks-encoding-native-js';
2+
import { stacksToBitcoinAddress } from '@stacks/codec';
33
import { htmlEscape } from 'escape-goat';
44
import {
55
makeSTXTokenTransfer,

src/api/routes/rosetta/construction.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ import {
5252
uintCV,
5353
} from '@stacks/transactions';
5454
import * as express from 'express';
55-
import { bitcoinToStacksAddress } from '@hirosystems/stacks-encoding-native-js';
55+
import { bitcoinToStacksAddress } from '@stacks/codec';
5656
import { StacksCoreRpcClient, getCoreNodeEndpoint } from '../../../core-rpc/client';
5757
import { DbBlock } from '../../../datastore/common';
5858
import { PgStore } from '../../../datastore/pg-store';

src/api/routes/tokens.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { getPagingQueryLimit, parsePagingQueryInput, ResourceType } from '../pagination';
22
import { isValidPrincipal } from '../../helpers';
3-
import { decodeClarityValueToRepr } from '@hirosystems/stacks-encoding-native-js';
3+
import { decodeClarityValueToRepr } from '@stacks/codec';
44
import { getAssetEventTypeString, parseDbTx } from '../controllers/db-controller';
55
import { handleChainTipCache } from '../controllers/cache-controller';
66
import { has0xPrefix } from '@hirosystems/api-toolkit';

src/api/routes/v2/helpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {
1616
getTxStatusString,
1717
parseDbTx,
1818
} from '../../../api/controllers/db-controller';
19-
import { decodeClarityValueToRepr } from '@hirosystems/stacks-encoding-native-js';
19+
import { decodeClarityValueToRepr } from '@stacks/codec';
2020
import { TransactionVersion, getAddressFromPublicKey } from '@stacks/transactions';
2121
import { SmartContractStatusList } from '../../schemas/entities/smart-contracts';
2222
import { AddressTransaction, AddressTransactionEvent } from '../../schemas/entities/addresses';

src/api/schemas/entities/post-conditions.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
import { Static, Type } from '@sinclair/typebox';
22

3-
export const PostConditionModeSchema = Type.Union([Type.Literal('allow'), Type.Literal('deny')]);
3+
export const PostConditionModeSchema = Type.Union([
4+
Type.Literal('allow'),
5+
Type.Literal('deny'),
6+
Type.Literal('originator'),
7+
]);
48

59
const PostConditionPrincipalSchema = Type.Union([
610
Type.Object({
@@ -46,7 +50,11 @@ const PostConditionFungibleAssetSchema = Type.Object({
4650

4751
const PostConditionNonFungibleAssetSchema = Type.Object({
4852
principal: PostConditionPrincipalSchema,
49-
condition_code: Type.Union([Type.Literal('sent'), Type.Literal('not_sent')]),
53+
condition_code: Type.Union([
54+
Type.Literal('sent'),
55+
Type.Literal('not_sent'),
56+
Type.Literal('maybe_sent'),
57+
]),
5058
type: Type.Literal('non_fungible'),
5159
asset_value: Type.Object({
5260
hex: Type.String(),

0 commit comments

Comments
 (0)