Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cli-tool): add binary support to subscribe #2948

Merged
merged 4 commits into from
Dec 20, 2024
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
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ Changes before Tatum release are not documented in this file.

#### Added

- Add binary content support to `streamr mock-data generate` command (https://github.com/streamr-dev/network/pull/2946)
- Add binary data support to `streamr stream susbcribe` (https://github.com/streamr-dev/network/pull/2948)
- Add binary data support to `streamr mock-data generate` command (https://github.com/streamr-dev/network/pull/2946)

#### Changed

Expand Down
2 changes: 1 addition & 1 deletion packages/cli-tools/bin/streamr-stream-subscribe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ interface Options extends BaseOptions {
}

createClientCommand(async (client: StreamrClient, streamId: string, options: Options) => {
const formContent = (content: unknown) => options.raw ? binaryToHex(content as Uint8Array) : content
const formContent = (content: unknown) => content instanceof Uint8Array ? binaryToHex(content) : content
const formMessage = options.withMetadata
? (content: unknown, metadata: MessageMetadata) => ({ content: formContent(content), metadata: omit(metadata, 'streamMessage') })
: (content: unknown) => formContent(content)
Expand Down
Loading