Skip to content

Commit

Permalink
Merge pull request #626 from kadena-community/chore/chainweb-stream-c…
Browse files Browse the repository at this point in the history
…lient-change-default-export

@kadena/chainweb-stream-client - Changed default export at index to named export
  • Loading branch information
Takadenoshi authored Oct 25, 2023
2 parents f6c52c3 + cf8dfb3 commit 1bf41db
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 18 deletions.
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
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 @@ -33,7 +33,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 @@ -492,5 +492,3 @@ class ChainwebStream extends EventEmitter {
this.emit('debug', debugMsg);
}
}

export default ChainwebStream;

0 comments on commit 1bf41db

Please sign in to comment.