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

@kadena/chainweb-stream-client - Changed default export at index to named export #626

Merged
merged 5 commits into from
Oct 25, 2023
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
5 changes: 5 additions & 0 deletions .changeset/modern-clocks-look.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@kadena/chainweb-stream-client': patch
---

Changed default export at index to named export
Takadenoshi marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@kadena/chainweb-stream-client",
"comment": "Changed default export at index to named export",
"type": "patch"
}
],
"packageName": "@kadena/chainweb-stream-client"
}
24 changes: 12 additions & 12 deletions packages/libs/chainweb-stream-client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ yarn add @kadena/chainweb-stream-client
## Usage

```js
import ChainwebStreamClient from '@kadena/chainweb-stream-client';
import { ChainwebStreamClient } from '@kadena/chainweb-stream-client';

const client = new ChainwebStreamClient({
network: 'mainnet01',
Expand All @@ -63,17 +63,17 @@ Find more detailed examples under `src/examples`.

## Constructor Options

| Key | Required | Description | Example Values | | |
| ----------------- | :------: | --------------------------------------------------------------- | ----------------------- | --------- | ----- |
| network | Yes | Chainweb network | \`mainnet01 | testnet04 | ...\` |
| type | Yes | Transaction type to stream (event/account) | \`event | account\` | |
| id | Yes | Account ID or module/event name | `k:abcdef01234..` | | |
| host | Yes | Chainweb-stream backend URL | `http://localhost:4000` | | |
| limit | No | Initial data load limit | 100 | | |
| connectTimeout | No | Connection timeout in ms | 10_000 | | |
| heartbeatTimeout | No | Stale connection timeout in ms | 30_000 | | |
| maxReconnects | No | How many reconnections to attempt before giving up | 5 | | |
| confirmationDepth | No | How many confirmations for a transaction to be considered final | 6 | | |
| Key | Required | Description | Example Values |
| ----------------- | :------: | --------------------------------------------------------------- | --------------------------- |
| network | Yes | Chainweb network | `mainnet01`/`testnet04`/... |
| type | Yes | Transaction type to stream (event/account) | `event`/`account` |
| id | Yes | Account ID or module/event name | `k:abcdef01234..` |
| host | Yes | Chainweb-stream backend URL | `http://localhost:4000` |
| limit | No | Initial data load limit | 100 |
| connectTimeout | No | Connection timeout in ms | 10_000 |
| heartbeatTimeout | No | Stale connection timeout in ms | 30_000 |
| maxReconnects | No | How many reconnections to attempt before giving up | 5 |
| confirmationDepth | No | How many confirmations for a transaction to be considered final | 6 |

## Considerations ⚠️

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import EventEmitter from 'eventemitter2';

// @alpha (undocumented)
class ChainwebStream extends EventEmitter {
export class ChainwebStreamClient extends EventEmitter {
constructor({ network, host, type, id, limit, connectTimeout, maxReconnects, heartbeatTimeout, confirmationDepth, }: IChainwebStreamConstructorArgs);
// (undocumented)
confirmationDepth: number;
Expand All @@ -31,7 +31,6 @@ class ChainwebStream extends EventEmitter {
// (undocumented)
type: ChainwebStreamType;
}
export default ChainwebStream;

// @alpha (undocumented)
export type ChainwebStreamType = 'event' | 'account';
Expand Down
2 changes: 1 addition & 1 deletion packages/libs/chainweb-stream-client/src/examples/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { ITransaction } from '../';
import ChainwebStreamClient from '../';
import { ChainwebStreamClient } from '../';

const client: ChainwebStreamClient = new ChainwebStreamClient({
// required
Expand Down
4 changes: 1 addition & 3 deletions packages/libs/chainweb-stream-client/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const DEFAULT_LIMIT: number = 100;
/**
* @alpha
*/
class ChainwebStream extends EventEmitter {
export class ChainwebStreamClient extends EventEmitter {
// chainweb network, e.g. mainnet01
public network: string;

Expand Down Expand Up @@ -493,5 +493,3 @@ class ChainwebStream extends EventEmitter {
this.emit('debug', debugMsg);
}
}

export default ChainwebStream;