@polkadot/rpc-core 6.6.2-14 → 6.6.2-18

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/bundle.cjs CHANGED
@@ -211,30 +211,27 @@ class RpcCore {
211
211
  for (let m = 0; m < methods.length; m++) {
212
212
  const method = methods[m];
213
213
  const def = defs[method];
214
+ const jsonrpc = def.endpoint || `${section}_${method}`;
215
+
216
+ if (!this.mapping.has(jsonrpc)) {
217
+ const isSubscription = !!def.pubsub;
214
218
 
215
- if (!this.mapping.has(def.endpoint || `${section}_${method}`)) {
216
219
  if (!this[section]) {
217
220
  this[section] = {};
218
221
  }
219
222
 
220
- (0, _util.lazyMethod)(this[section], method, () => this._createInterface(section, method, def));
223
+ this.mapping.set(jsonrpc, (0, _util.objectSpread)({}, def, {
224
+ isSubscription,
225
+ jsonrpc,
226
+ method,
227
+ section
228
+ }));
229
+ (0, _util.lazyMethod)(this[section], method, () => isSubscription ? this._createMethodSubscribe(section, method, def) : this._createMethodSend(section, method, def));
221
230
  }
222
231
  }
223
232
  }
224
233
  }
225
234
 
226
- _createInterface(section, method, def) {
227
- const isSubscription = !!def.pubsub;
228
- const jsonrpc = def.endpoint || `${section}_${method}`;
229
- this.mapping.set(jsonrpc, { ...def,
230
- isSubscription,
231
- jsonrpc,
232
- method,
233
- section
234
- });
235
- return isSubscription ? this._createMethodSubscribe(section, method, def) : this._createMethodSend(section, method, def);
236
- }
237
-
238
235
  _memomize(creator, def) {
239
236
  const memoOpts = {
240
237
  getInstanceId: () => (0, _classPrivateFieldGet2.default)(this, _instanceId)
package/bundle.d.ts CHANGED
@@ -55,7 +55,6 @@ export declare class RpcCore {
55
55
  registry: Registry;
56
56
  }>): void;
57
57
  addUserInterfaces(userRpc: Record<string, Record<string, DefinitionRpc | DefinitionRpcSub>>): void;
58
- private _createInterface;
59
58
  private _memomize;
60
59
  private _formatResult;
61
60
  private _createMethodSend;
package/bundle.js CHANGED
@@ -138,30 +138,27 @@ export class RpcCore {
138
138
  for (let m = 0; m < methods.length; m++) {
139
139
  const method = methods[m];
140
140
  const def = defs[method];
141
+ const jsonrpc = def.endpoint || `${section}_${method}`;
142
+
143
+ if (!this.mapping.has(jsonrpc)) {
144
+ const isSubscription = !!def.pubsub;
141
145
 
142
- if (!this.mapping.has(def.endpoint || `${section}_${method}`)) {
143
146
  if (!this[section]) {
144
147
  this[section] = {};
145
148
  }
146
149
 
147
- lazyMethod(this[section], method, () => this._createInterface(section, method, def));
150
+ this.mapping.set(jsonrpc, objectSpread({}, def, {
151
+ isSubscription,
152
+ jsonrpc,
153
+ method,
154
+ section
155
+ }));
156
+ lazyMethod(this[section], method, () => isSubscription ? this._createMethodSubscribe(section, method, def) : this._createMethodSend(section, method, def));
148
157
  }
149
158
  }
150
159
  }
151
160
  }
152
161
 
153
- _createInterface(section, method, def) {
154
- const isSubscription = !!def.pubsub;
155
- const jsonrpc = def.endpoint || `${section}_${method}`;
156
- this.mapping.set(jsonrpc, { ...def,
157
- isSubscription,
158
- jsonrpc,
159
- method,
160
- section
161
- });
162
- return isSubscription ? this._createMethodSubscribe(section, method, def) : this._createMethodSend(section, method, def);
163
- }
164
-
165
162
  _memomize(creator, def) {
166
163
  const memoOpts = {
167
164
  getInstanceId: () => this.#instanceId
package/package.json CHANGED
@@ -20,17 +20,17 @@
20
20
  "./detectPackage.cjs"
21
21
  ],
22
22
  "type": "module",
23
- "version": "6.6.2-14",
23
+ "version": "6.6.2-18",
24
24
  "main": "index.js",
25
25
  "dependencies": {
26
26
  "@babel/runtime": "^7.16.0",
27
- "@polkadot/rpc-provider": "6.6.2-14",
28
- "@polkadot/types": "6.6.2-14",
29
- "@polkadot/util": "^7.7.2-5",
27
+ "@polkadot/rpc-provider": "6.6.2-18",
28
+ "@polkadot/types": "6.6.2-18",
29
+ "@polkadot/util": "^7.7.2-6",
30
30
  "rxjs": "^7.4.0"
31
31
  },
32
32
  "devDependencies": {
33
- "@polkadot/keyring": "^7.7.2-5"
33
+ "@polkadot/keyring": "^7.7.2-6"
34
34
  },
35
35
  "exports": {
36
36
  ".": {
package/packageInfo.cjs CHANGED
@@ -9,6 +9,6 @@ exports.packageInfo = void 0;
9
9
  // Auto-generated by @polkadot/dev, do not edit
10
10
  const packageInfo = {
11
11
  name: '@polkadot/rpc-core',
12
- version: '6.6.2-14'
12
+ version: '6.6.2-18'
13
13
  };
14
14
  exports.packageInfo = packageInfo;
package/packageInfo.js CHANGED
@@ -3,5 +3,5 @@
3
3
  // Auto-generated by @polkadot/dev, do not edit
4
4
  export const packageInfo = {
5
5
  name: '@polkadot/rpc-core',
6
- version: '6.6.2-14'
6
+ version: '6.6.2-18'
7
7
  };