@polkadot/rpc-core
Advanced tools
Comparing version 14.0.1 to 14.1.1
@@ -82,3 +82,4 @@ import type { ProviderInterface } from '@polkadot/rpc-provider/types'; | ||
private _formatStorageSetEntry; | ||
private _setToCache; | ||
private _newType; | ||
} |
import { Observable, publishReplay, refCount } from 'rxjs'; | ||
import { DEFAULT_CAPACITY, LRUCache } from '@polkadot/rpc-provider'; | ||
import { rpcDefinitions } from '@polkadot/types'; | ||
@@ -55,5 +56,4 @@ import { hexToU8a, isFunction, isNull, isUndefined, lazyMethod, logger, memoize, objectSpread, u8aConcat, u8aToU8a } from '@polkadot/util'; | ||
__internal__registryDefault; | ||
__internal__storageCache = new Map(); | ||
__internal__storageCache; | ||
__internal__storageCacheHits = 0; | ||
__internal__storageCacheSize = 0; | ||
__internal__getBlockRegistry; | ||
@@ -80,2 +80,3 @@ __internal__getBlockHash; | ||
this.sections.push(...sectionNames); | ||
this.__internal__storageCache = new LRUCache(DEFAULT_CAPACITY); | ||
// decorate all interfaces, defined and user on this instance | ||
@@ -99,3 +100,4 @@ this.addUserInterfaces(userRpc); | ||
*/ | ||
disconnect() { | ||
async disconnect() { | ||
await this.__internal__storageCache.clearInterval(); | ||
return this.provider.disconnect(); | ||
@@ -113,3 +115,3 @@ } | ||
cacheHits: this.__internal__storageCacheHits, | ||
cacheSize: this.__internal__storageCacheSize | ||
cacheSize: this.__internal__storageCache.length | ||
} | ||
@@ -378,9 +380,8 @@ } | ||
const codec = this._newType(registry, blockHash, key, input, isEmpty, entryIndex); | ||
// store the retrieved result - the only issue with this cache is that there is no | ||
// clearing of it, so very long running processes (not just a couple of hours, longer) | ||
// will increase memory beyond what is allowed. | ||
this.__internal__storageCache.set(hexKey, codec); | ||
this.__internal__storageCacheSize++; | ||
this._setToCache(hexKey, codec); | ||
return codec; | ||
} | ||
_setToCache(key, value) { | ||
this.__internal__storageCache.set(key, value); | ||
} | ||
_newType(registry, blockHash, key, input, isEmpty, entryIndex = -1) { | ||
@@ -387,0 +388,0 @@ // single return value (via state.getStorage), decode the value based on the |
@@ -6,2 +6,3 @@ "use strict"; | ||
const rxjs_1 = require("rxjs"); | ||
const rpc_provider_1 = require("@polkadot/rpc-provider"); | ||
const types_1 = require("@polkadot/types"); | ||
@@ -61,5 +62,4 @@ const util_1 = require("@polkadot/util"); | ||
__internal__registryDefault; | ||
__internal__storageCache = new Map(); | ||
__internal__storageCache; | ||
__internal__storageCacheHits = 0; | ||
__internal__storageCacheSize = 0; | ||
__internal__getBlockRegistry; | ||
@@ -86,2 +86,3 @@ __internal__getBlockHash; | ||
this.sections.push(...sectionNames); | ||
this.__internal__storageCache = new rpc_provider_1.LRUCache(rpc_provider_1.DEFAULT_CAPACITY); | ||
// decorate all interfaces, defined and user on this instance | ||
@@ -105,3 +106,4 @@ this.addUserInterfaces(userRpc); | ||
*/ | ||
disconnect() { | ||
async disconnect() { | ||
await this.__internal__storageCache.clearInterval(); | ||
return this.provider.disconnect(); | ||
@@ -119,3 +121,3 @@ } | ||
cacheHits: this.__internal__storageCacheHits, | ||
cacheSize: this.__internal__storageCacheSize | ||
cacheSize: this.__internal__storageCache.length | ||
} | ||
@@ -384,9 +386,8 @@ } | ||
const codec = this._newType(registry, blockHash, key, input, isEmpty, entryIndex); | ||
// store the retrieved result - the only issue with this cache is that there is no | ||
// clearing of it, so very long running processes (not just a couple of hours, longer) | ||
// will increase memory beyond what is allowed. | ||
this.__internal__storageCache.set(hexKey, codec); | ||
this.__internal__storageCacheSize++; | ||
this._setToCache(hexKey, codec); | ||
return codec; | ||
} | ||
_setToCache(key, value) { | ||
this.__internal__storageCache.set(key, value); | ||
} | ||
_newType(registry, blockHash, key, input, isEmpty, entryIndex = -1) { | ||
@@ -393,0 +394,0 @@ // single return value (via state.getStorage), decode the value based on the |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.packageInfo = void 0; | ||
exports.packageInfo = { name: '@polkadot/rpc-core', path: typeof __dirname === 'string' ? __dirname : 'auto', type: 'cjs', version: '14.0.1' }; | ||
exports.packageInfo = { name: '@polkadot/rpc-core', path: typeof __dirname === 'string' ? __dirname : 'auto', type: 'cjs', version: '14.1.1' }; |
204
package.json
@@ -21,3 +21,3 @@ { | ||
"type": "module", | ||
"version": "14.0.1", | ||
"version": "14.1.1", | ||
"main": "./cjs/index.js", | ||
@@ -30,12 +30,28 @@ "module": "./index.js", | ||
".": { | ||
"types": "./index.d.ts", | ||
"module": "./index.js", | ||
"require": "./cjs/index.js", | ||
"default": "./index.js" | ||
"module": { | ||
"types": "./index.d.ts", | ||
"default": "./index.js" | ||
}, | ||
"require": { | ||
"types": "./cjs/index.d.ts", | ||
"default": "./cjs/index.js" | ||
}, | ||
"default": { | ||
"types": "./index.d.ts", | ||
"default": "./index.js" | ||
} | ||
}, | ||
"./bundle": { | ||
"types": "./bundle.d.ts", | ||
"module": "./bundle.js", | ||
"require": "./cjs/bundle.js", | ||
"default": "./bundle.js" | ||
"module": { | ||
"types": "./bundle.d.ts", | ||
"default": "./bundle.js" | ||
}, | ||
"require": { | ||
"types": "./cjs/bundle.d.ts", | ||
"default": "./cjs/bundle.js" | ||
}, | ||
"default": { | ||
"types": "./bundle.d.ts", | ||
"default": "./bundle.js" | ||
} | ||
}, | ||
@@ -47,70 +63,150 @@ "./package.json": { | ||
"./packageDetect": { | ||
"types": "./packageDetect.d.ts", | ||
"module": "./packageDetect.js", | ||
"require": "./cjs/packageDetect.js", | ||
"default": "./packageDetect.js" | ||
"module": { | ||
"types": "./packageDetect.d.ts", | ||
"default": "./packageDetect.js" | ||
}, | ||
"require": { | ||
"types": "./cjs/packageDetect.d.ts", | ||
"default": "./cjs/packageDetect.js" | ||
}, | ||
"default": { | ||
"types": "./packageDetect.d.ts", | ||
"default": "./packageDetect.js" | ||
} | ||
}, | ||
"./packageInfo.js": { | ||
"types": "./packageInfo.d.ts", | ||
"module": "./packageInfo.js", | ||
"require": "./cjs/packageInfo.js", | ||
"default": "./packageInfo.js" | ||
"module": { | ||
"types": "./packageInfo.d.ts", | ||
"default": "./packageInfo.js" | ||
}, | ||
"require": { | ||
"types": "./cjs/packageInfo.d.ts", | ||
"default": "./cjs/packageInfo.js" | ||
}, | ||
"default": { | ||
"types": "./packageInfo.d.ts", | ||
"default": "./packageInfo.js" | ||
} | ||
}, | ||
"./packageInfo": { | ||
"types": "./packageInfo.d.ts", | ||
"module": "./packageInfo.js", | ||
"require": "./cjs/packageInfo.js", | ||
"default": "./packageInfo.js" | ||
"module": { | ||
"types": "./packageInfo.d.ts", | ||
"default": "./packageInfo.js" | ||
}, | ||
"require": { | ||
"types": "./cjs/packageInfo.d.ts", | ||
"default": "./cjs/packageInfo.js" | ||
}, | ||
"default": { | ||
"types": "./packageInfo.d.ts", | ||
"default": "./packageInfo.js" | ||
} | ||
}, | ||
"./types": { | ||
"types": "./types/index.d.ts", | ||
"module": "./types/index.js", | ||
"require": "./cjs/types/index.js", | ||
"default": "./types/index.js" | ||
"module": { | ||
"types": "./types/index.d.ts", | ||
"default": "./types/index.js" | ||
}, | ||
"require": { | ||
"types": "./cjs/types/index.d.ts", | ||
"default": "./cjs/types/index.js" | ||
}, | ||
"default": { | ||
"types": "./types/index.d.ts", | ||
"default": "./types/index.js" | ||
} | ||
}, | ||
"./types/base": { | ||
"types": "./types/base.d.ts", | ||
"module": "./types/base.js", | ||
"require": "./cjs/types/base.js", | ||
"default": "./types/base.js" | ||
"module": { | ||
"types": "./types/base.d.ts", | ||
"default": "./types/base.js" | ||
}, | ||
"require": { | ||
"types": "./cjs/types/base.d.ts", | ||
"default": "./cjs/types/base.js" | ||
}, | ||
"default": { | ||
"types": "./types/base.d.ts", | ||
"default": "./types/base.js" | ||
} | ||
}, | ||
"./types/jsonrpc": { | ||
"types": "./types/jsonrpc.d.ts", | ||
"module": "./types/jsonrpc.js", | ||
"require": "./cjs/types/jsonrpc.js", | ||
"default": "./types/jsonrpc.js" | ||
"module": { | ||
"types": "./types/jsonrpc.d.ts", | ||
"default": "./types/jsonrpc.js" | ||
}, | ||
"require": { | ||
"types": "./cjs/types/jsonrpc.d.ts", | ||
"default": "./cjs/types/jsonrpc.js" | ||
}, | ||
"default": { | ||
"types": "./types/jsonrpc.d.ts", | ||
"default": "./types/jsonrpc.js" | ||
} | ||
}, | ||
"./util": { | ||
"types": "./util/index.d.ts", | ||
"module": "./util/index.js", | ||
"require": "./cjs/util/index.js", | ||
"default": "./util/index.js" | ||
"module": { | ||
"types": "./util/index.d.ts", | ||
"default": "./util/index.js" | ||
}, | ||
"require": { | ||
"types": "./cjs/util/index.d.ts", | ||
"default": "./cjs/util/index.js" | ||
}, | ||
"default": { | ||
"types": "./util/index.d.ts", | ||
"default": "./util/index.js" | ||
} | ||
}, | ||
"./util/drr": { | ||
"types": "./util/drr.d.ts", | ||
"module": "./util/drr.js", | ||
"require": "./cjs/util/drr.js", | ||
"default": "./util/drr.js" | ||
"module": { | ||
"types": "./util/drr.d.ts", | ||
"default": "./util/drr.js" | ||
}, | ||
"require": { | ||
"types": "./cjs/util/drr.d.ts", | ||
"default": "./cjs/util/drr.js" | ||
}, | ||
"default": { | ||
"types": "./util/drr.d.ts", | ||
"default": "./util/drr.js" | ||
} | ||
}, | ||
"./util/memo": { | ||
"types": "./util/memo.d.ts", | ||
"module": "./util/memo.js", | ||
"require": "./cjs/util/memo.js", | ||
"default": "./util/memo.js" | ||
"module": { | ||
"types": "./util/memo.d.ts", | ||
"default": "./util/memo.js" | ||
}, | ||
"require": { | ||
"types": "./cjs/util/memo.d.ts", | ||
"default": "./cjs/util/memo.js" | ||
}, | ||
"default": { | ||
"types": "./util/memo.d.ts", | ||
"default": "./util/memo.js" | ||
} | ||
}, | ||
"./util/refCountDelay": { | ||
"types": "./util/refCountDelay.d.ts", | ||
"module": "./util/refCountDelay.js", | ||
"require": "./cjs/util/refCountDelay.js", | ||
"default": "./util/refCountDelay.js" | ||
"module": { | ||
"types": "./util/refCountDelay.d.ts", | ||
"default": "./util/refCountDelay.js" | ||
}, | ||
"require": { | ||
"types": "./cjs/util/refCountDelay.d.ts", | ||
"default": "./cjs/util/refCountDelay.js" | ||
}, | ||
"default": { | ||
"types": "./util/refCountDelay.d.ts", | ||
"default": "./util/refCountDelay.js" | ||
} | ||
} | ||
}, | ||
"dependencies": { | ||
"@polkadot/rpc-augment": "14.0.1", | ||
"@polkadot/rpc-provider": "14.0.1", | ||
"@polkadot/types": "14.0.1", | ||
"@polkadot/util": "^13.1.1", | ||
"@polkadot/rpc-augment": "14.1.1", | ||
"@polkadot/rpc-provider": "14.1.1", | ||
"@polkadot/types": "14.1.1", | ||
"@polkadot/util": "^13.2.1", | ||
"rxjs": "^7.8.1", | ||
"tslib": "^2.7.0" | ||
"tslib": "^2.8.0" | ||
} | ||
} |
@@ -1,1 +0,1 @@ | ||
export const packageInfo = { name: '@polkadot/rpc-core', path: (import.meta && import.meta.url) ? new URL(import.meta.url).pathname.substring(0, new URL(import.meta.url).pathname.lastIndexOf('/') + 1) : 'auto', type: 'esm', version: '14.0.1' }; | ||
export const packageInfo = { name: '@polkadot/rpc-core', path: (import.meta && import.meta.url) ? new URL(import.meta.url).pathname.substring(0, new URL(import.meta.url).pathname.lastIndexOf('/') + 1) : 'auto', type: 'esm', version: '14.1.1' }; |
70002
48
1329
+ Added@polkadot/rpc-augment@14.1.1(transitive)
+ Added@polkadot/rpc-provider@14.1.1(transitive)
+ Added@polkadot/types@14.1.1(transitive)
+ Added@polkadot/types-augment@14.1.1(transitive)
+ Added@polkadot/types-codec@14.1.1(transitive)
+ Added@polkadot/types-create@14.1.1(transitive)
+ Added@polkadot/types-support@14.1.1(transitive)
- Removed@polkadot/rpc-augment@14.0.1(transitive)
- Removed@polkadot/rpc-provider@14.0.1(transitive)
- Removed@polkadot/types@14.0.1(transitive)
- Removed@polkadot/types-augment@14.0.1(transitive)
- Removed@polkadot/types-codec@14.0.1(transitive)
- Removed@polkadot/types-create@14.0.1(transitive)
- Removed@polkadot/types-support@14.0.1(transitive)
Updated@polkadot/rpc-augment@14.1.1
Updated@polkadot/types@14.1.1
Updated@polkadot/util@^13.2.1
Updatedtslib@^2.8.0