@chainflip/rpc 1.8.6 → 1.8.7
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/HttpClient.cjs +8 -5
- package/dist/HttpClient.d.cts +0 -1
- package/dist/HttpClient.d.ts +0 -1
- package/dist/HttpClient.mjs +6 -3
- package/dist/common.cjs +3 -1
- package/dist/common.d.cts +1007 -912
- package/dist/common.d.ts +1007 -912
- package/dist/common.mjs +4 -2
- package/dist/parsers.cjs +9 -7
- package/dist/parsers.d.cts +1177 -1083
- package/dist/parsers.d.ts +1177 -1083
- package/dist/parsers.mjs +8 -6
- package/package.json +4 -4
package/dist/HttpClient.cjs
CHANGED
|
@@ -4,10 +4,9 @@ var _Clientcjs = require('./Client.cjs'); var _Clientcjs2 = _interopRequireDefau
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _commoncjs = require('./common.cjs');
|
|
7
|
-
var HttpClient = (_class = class extends _Clientcjs2.default {constructor(...args) { super(...args); _class.prototype.__init.call(this);_class.prototype.__init2.call(this);
|
|
7
|
+
var HttpClient = (_class = class extends _Clientcjs2.default {constructor(...args) { super(...args); _class.prototype.__init.call(this);_class.prototype.__init2.call(this); }
|
|
8
8
|
__init() {this.timer = null}
|
|
9
|
-
__init2() {this.
|
|
10
|
-
__init3() {this.requestMap = /* @__PURE__ */ new Map()}
|
|
9
|
+
__init2() {this.requestMap = /* @__PURE__ */ new Map()}
|
|
11
10
|
async send(request) {
|
|
12
11
|
let res;
|
|
13
12
|
try {
|
|
@@ -47,8 +46,12 @@ var HttpClient = (_class = class extends _Clientcjs2.default {constructor(...arg
|
|
|
47
46
|
const deferred = _async.deferredPromise.call(void 0, );
|
|
48
47
|
const body = this.formatRequest(method, params);
|
|
49
48
|
this.requestMap.set(body.id, { deferred, body, method });
|
|
50
|
-
if (this.timer)
|
|
51
|
-
|
|
49
|
+
if (!this.timer) {
|
|
50
|
+
this.timer = setTimeout(() => {
|
|
51
|
+
this.timer = null;
|
|
52
|
+
void this.sendBatch();
|
|
53
|
+
}, 0);
|
|
54
|
+
}
|
|
52
55
|
return deferred.promise;
|
|
53
56
|
}
|
|
54
57
|
async sendBatch() {
|
package/dist/HttpClient.d.cts
CHANGED
|
@@ -6,7 +6,6 @@ import './parsers.cjs';
|
|
|
6
6
|
|
|
7
7
|
declare class HttpClient extends Client {
|
|
8
8
|
private timer;
|
|
9
|
-
private batchDuration;
|
|
10
9
|
private requestMap;
|
|
11
10
|
protected send<const T extends RpcMethod>(request: JsonRpcRequest<T>[]): Promise<Response[]>;
|
|
12
11
|
sendRequest<const T extends RpcMethod>(method: T, ...params: RpcRequest[T]): Promise<RpcResult<T>>;
|
package/dist/HttpClient.d.ts
CHANGED
|
@@ -6,7 +6,6 @@ import './parsers.js';
|
|
|
6
6
|
|
|
7
7
|
declare class HttpClient extends Client {
|
|
8
8
|
private timer;
|
|
9
|
-
private batchDuration;
|
|
10
9
|
private requestMap;
|
|
11
10
|
protected send<const T extends RpcMethod>(request: JsonRpcRequest<T>[]): Promise<Response[]>;
|
|
12
11
|
sendRequest<const T extends RpcMethod>(method: T, ...params: RpcRequest[T]): Promise<RpcResult<T>>;
|
package/dist/HttpClient.mjs
CHANGED
|
@@ -6,7 +6,6 @@ import {
|
|
|
6
6
|
} from "./common.mjs";
|
|
7
7
|
var HttpClient = class extends Client {
|
|
8
8
|
timer = null;
|
|
9
|
-
batchDuration = 100;
|
|
10
9
|
requestMap = /* @__PURE__ */ new Map();
|
|
11
10
|
async send(request) {
|
|
12
11
|
let res;
|
|
@@ -47,8 +46,12 @@ var HttpClient = class extends Client {
|
|
|
47
46
|
const deferred = deferredPromise();
|
|
48
47
|
const body = this.formatRequest(method, params);
|
|
49
48
|
this.requestMap.set(body.id, { deferred, body, method });
|
|
50
|
-
if (this.timer)
|
|
51
|
-
|
|
49
|
+
if (!this.timer) {
|
|
50
|
+
this.timer = setTimeout(() => {
|
|
51
|
+
this.timer = null;
|
|
52
|
+
void this.sendBatch();
|
|
53
|
+
}, 0);
|
|
54
|
+
}
|
|
52
55
|
return deferred.promise;
|
|
53
56
|
}
|
|
54
57
|
async sendBatch() {
|
package/dist/common.cjs
CHANGED
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
|
|
23
|
+
|
|
23
24
|
|
|
24
25
|
|
|
25
26
|
var _parserscjs = require('./parsers.cjs');
|
|
@@ -47,7 +48,8 @@ var rpcResult = {
|
|
|
47
48
|
cf_boost_pool_details: _parserscjs.cfBoostPoolDetails,
|
|
48
49
|
cf_boost_pool_pending_fees: _parserscjs.cfBoostPoolPendingFees,
|
|
49
50
|
state_getMetadata: _parserscjs.stateGetMetadata,
|
|
50
|
-
state_getRuntimeVersion: _parserscjs.stateGetRuntimeVersion
|
|
51
|
+
state_getRuntimeVersion: _parserscjs.stateGetRuntimeVersion,
|
|
52
|
+
lp_total_balances: _parserscjs.lpTotalBalances
|
|
51
53
|
};
|
|
52
54
|
|
|
53
55
|
|