diff --git a/.changeset/modern-clocks-look.md b/.changeset/modern-clocks-look.md new file mode 100644 index 0000000000..2286b1d125 --- /dev/null +++ b/.changeset/modern-clocks-look.md @@ -0,0 +1,5 @@ +--- +'@kadena/chainweb-stream-client': patch +--- + +Changed default export at index to named export diff --git a/common/changes/@kadena/chainweb-stream-client/chore-chainweb-stream-client-change-default-export_2023-07-19-12-19.json b/common/changes/@kadena/chainweb-stream-client/chore-chainweb-stream-client-change-default-export_2023-07-19-12-19.json new file mode 100644 index 0000000000..d5efbfbfc3 --- /dev/null +++ b/common/changes/@kadena/chainweb-stream-client/chore-chainweb-stream-client-change-default-export_2023-07-19-12-19.json @@ -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" +} \ No newline at end of file diff --git a/packages/libs/chainweb-stream-client/README.md b/packages/libs/chainweb-stream-client/README.md index ee8c6ed3aa..4b3567022e 100644 --- a/packages/libs/chainweb-stream-client/README.md +++ b/packages/libs/chainweb-stream-client/README.md @@ -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', @@ -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 ⚠️ diff --git a/packages/libs/chainweb-stream-client/etc/chainweb-stream-client.api.md b/packages/libs/chainweb-stream-client/etc/chainweb-stream-client.api.md index 5c86f63889..879becedf8 100644 --- a/packages/libs/chainweb-stream-client/etc/chainweb-stream-client.api.md +++ b/packages/libs/chainweb-stream-client/etc/chainweb-stream-client.api.md @@ -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; @@ -31,7 +31,6 @@ class ChainwebStream extends EventEmitter { // (undocumented) type: ChainwebStreamType; } -export default ChainwebStream; // @alpha (undocumented) export type ChainwebStreamType = 'event' | 'account'; diff --git a/packages/libs/chainweb-stream-client/src/examples/index.ts b/packages/libs/chainweb-stream-client/src/examples/index.ts index d374eac264..e7aac1943d 100644 --- a/packages/libs/chainweb-stream-client/src/examples/index.ts +++ b/packages/libs/chainweb-stream-client/src/examples/index.ts @@ -1,5 +1,5 @@ import type { ITransaction } from '../'; -import ChainwebStreamClient from '../'; +import { ChainwebStreamClient } from '../'; const client: ChainwebStreamClient = new ChainwebStreamClient({ // required diff --git a/packages/libs/chainweb-stream-client/src/index.ts b/packages/libs/chainweb-stream-client/src/index.ts index eb396ab9a6..60eae0859d 100644 --- a/packages/libs/chainweb-stream-client/src/index.ts +++ b/packages/libs/chainweb-stream-client/src/index.ts @@ -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; @@ -492,5 +492,3 @@ class ChainwebStream extends EventEmitter { this.emit('debug', debugMsg); } } - -export default ChainwebStream;