@chainflip/rpc 1.10.1 → 1.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/Client.d.cts CHANGED
@@ -18,15 +18,16 @@ type RequestMap = Map<string, {
18
18
  body: JsonRpcRequest<RpcMethod>;
19
19
  method: RpcMethod;
20
20
  }>;
21
+ type ClientOpts = {
22
+ archiveNodeUrl?: string;
23
+ };
21
24
  declare abstract class Client {
22
25
  protected readonly url: string;
23
26
  private lastRequestId;
24
27
  private timer;
25
28
  private requestMap;
26
29
  private readonly archiveNodeUrl?;
27
- constructor(url: string, opts?: {
28
- archiveNodeUrl?: string;
29
- });
30
+ constructor(url: string, opts?: ClientOpts);
30
31
  protected abstract send<const T extends RpcMethod>(data: JsonRpcRequest<T>[], clonedMap: RequestMap): Promise<void>;
31
32
  private getRequestId;
32
33
  private formatRequest;
@@ -37,4 +38,4 @@ declare abstract class Client {
37
38
  methods(): RpcMethod[];
38
39
  }
39
40
 
40
- export { type RequestMap, type Response, Client as default };
41
+ export { type ClientOpts, type RequestMap, type Response, Client as default };
package/dist/Client.d.ts CHANGED
@@ -18,15 +18,16 @@ type RequestMap = Map<string, {
18
18
  body: JsonRpcRequest<RpcMethod>;
19
19
  method: RpcMethod;
20
20
  }>;
21
+ type ClientOpts = {
22
+ archiveNodeUrl?: string;
23
+ };
21
24
  declare abstract class Client {
22
25
  protected readonly url: string;
23
26
  private lastRequestId;
24
27
  private timer;
25
28
  private requestMap;
26
29
  private readonly archiveNodeUrl?;
27
- constructor(url: string, opts?: {
28
- archiveNodeUrl?: string;
29
- });
30
+ constructor(url: string, opts?: ClientOpts);
30
31
  protected abstract send<const T extends RpcMethod>(data: JsonRpcRequest<T>[], clonedMap: RequestMap): Promise<void>;
31
32
  private getRequestId;
32
33
  private formatRequest;
@@ -37,4 +38,4 @@ declare abstract class Client {
37
38
  methods(): RpcMethod[];
38
39
  }
39
40
 
40
- export { type RequestMap, type Response, Client as default };
41
+ export { type ClientOpts, type RequestMap, type Response, Client as default };
package/dist/WsClient.cjs CHANGED
@@ -13,8 +13,8 @@ var WsClient = (_class = class extends _Clientcjs2.default {
13
13
  __init3() {this.inFlightRequestMap = /* @__PURE__ */ new Map()}
14
14
 
15
15
  __init4() {this.shouldConnect = true}
16
- constructor(url, { timeout = 3e4 } = {}) {
17
- super(url);_class.prototype.__init.call(this);_class.prototype.__init2.call(this);_class.prototype.__init3.call(this);_class.prototype.__init4.call(this);_class.prototype.__init5.call(this);_class.prototype.__init6.call(this);;
16
+ constructor(url, { timeout = 3e4, ...opts } = {}) {
17
+ super(url, opts);_class.prototype.__init.call(this);_class.prototype.__init2.call(this);_class.prototype.__init3.call(this);_class.prototype.__init4.call(this);_class.prototype.__init5.call(this);_class.prototype.__init6.call(this);;
18
18
  this.timeout = timeout;
19
19
  }
20
20
  async close() {
@@ -1,4 +1,4 @@
1
- import Client, { RequestMap } from './Client.cjs';
1
+ import Client, { ClientOpts, RequestMap } from './Client.cjs';
2
2
  import { JsonRpcRequest, RpcMethod } from './common.cjs';
3
3
  import '@chainflip/utils/async';
4
4
  import '@chainflip/utils/types';
@@ -12,9 +12,9 @@ declare class WsClient extends Client {
12
12
  private inFlightRequestMap;
13
13
  private readonly timeout;
14
14
  private shouldConnect;
15
- constructor(url: string, { timeout }?: {
15
+ constructor(url: string, { timeout, ...opts }?: {
16
16
  timeout?: number;
17
- });
17
+ } & ClientOpts);
18
18
  close(): Promise<void>;
19
19
  private connectionReady;
20
20
  private handleDisconnect;
@@ -1,4 +1,4 @@
1
- import Client, { RequestMap } from './Client.js';
1
+ import Client, { ClientOpts, RequestMap } from './Client.js';
2
2
  import { JsonRpcRequest, RpcMethod } from './common.js';
3
3
  import '@chainflip/utils/async';
4
4
  import '@chainflip/utils/types';
@@ -12,9 +12,9 @@ declare class WsClient extends Client {
12
12
  private inFlightRequestMap;
13
13
  private readonly timeout;
14
14
  private shouldConnect;
15
- constructor(url: string, { timeout }?: {
15
+ constructor(url: string, { timeout, ...opts }?: {
16
16
  timeout?: number;
17
- });
17
+ } & ClientOpts);
18
18
  close(): Promise<void>;
19
19
  private connectionReady;
20
20
  private handleDisconnect;
package/dist/WsClient.mjs CHANGED
@@ -13,8 +13,8 @@ var WsClient = class extends Client {
13
13
  inFlightRequestMap = /* @__PURE__ */ new Map();
14
14
  timeout;
15
15
  shouldConnect = true;
16
- constructor(url, { timeout = 3e4 } = {}) {
17
- super(url);
16
+ constructor(url, { timeout = 3e4, ...opts } = {}) {
17
+ super(url, opts);
18
18
  this.timeout = timeout;
19
19
  }
20
20
  async close() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chainflip/rpc",
3
- "version": "1.10.1",
3
+ "version": "1.10.2",
4
4
  "type": "module",
5
5
  "dependencies": {
6
6
  "@chainflip/utils": "0.8.6",