diff --git a/packages/sdk/CHANGELOG.md b/packages/sdk/CHANGELOG.md index 0527dfbd1..be9705e25 100644 --- a/packages/sdk/CHANGELOG.md +++ b/packages/sdk/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## Unreleased + +### Fix + +- Export type `BlockItem` in the public API again, this was removed accidentally in v7.0.0. + ## 7.0.0 ### Breaking changes diff --git a/packages/sdk/src/types.ts b/packages/sdk/src/types.ts index c751d5cfa..24ba60377 100644 --- a/packages/sdk/src/types.ts +++ b/packages/sdk/src/types.ts @@ -1845,3 +1845,22 @@ export type HealthCheckResponse = isHealthy: false; message?: string; }; + +/** + * Type representing an item which is included in a block, such as account transactions, chain updates or deployments of new credentials. + */ +export type BlockItem = + | { + kind: BlockItemKind.AccountTransactionKind; + transaction: { + accountTransaction: AccountTransaction; + signatures: AccountTransactionSignature; + }; + } + | { + kind: BlockItemKind.CredentialDeploymentKind; + transaction: { + credential: TypedCredentialDeployment; + expiry: number; + }; + }; diff --git a/packages/sdk/src/wasm/deserialization.ts b/packages/sdk/src/wasm/deserialization.ts index 20d9fc9dc..2ca3d65bd 100644 --- a/packages/sdk/src/wasm/deserialization.ts +++ b/packages/sdk/src/wasm/deserialization.ts @@ -4,12 +4,7 @@ import { deserializeUint8, } from '../deserialization.js'; import { Cursor } from '../deserializationHelpers.js'; -import { - AccountTransaction, - AccountTransactionSignature, - BlockItemKind, - TypedCredentialDeployment, -} from '../types.js'; +import { BlockItem, BlockItemKind } from '../types.js'; function deserializeCredentialDeployment(serializedDeployment: Cursor) { const raw = wasm.deserializeCredentialDeployment( @@ -27,22 +22,6 @@ function deserializeCredentialDeployment(serializedDeployment: Cursor) { } } -export type BlockItem = - | { - kind: BlockItemKind.AccountTransactionKind; - transaction: { - accountTransaction: AccountTransaction; - signatures: AccountTransactionSignature; - }; - } - | { - kind: BlockItemKind.CredentialDeploymentKind; - transaction: { - credential: TypedCredentialDeployment; - expiry: number; - }; - }; - /** * Deserializes a transaction, from the binary format used to send it to the node, back into an js object. * @param serializedTransaction A buffer containing the binary transaction. It is expected to start with the version and blockItemKind.