@polkadot/rpc-core 6.12.2-2 → 6.12.2-23
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/package.json +17 -19
- package/packageInfo.cjs +1 -1
- package/packageInfo.js +1 -1
- package/types/base.cjs +1 -0
- package/types/base.js +1 -0
- package/types/index.cjs +31 -0
- package/types/index.js +6 -0
- package/types/jsonrpc.cjs +1 -0
- package/types/jsonrpc.js +1 -0
- package/bundle.d.ts +0 -69
- package/detectPackage.d.ts +0 -1
- package/index.d.ts +0 -2
- package/packageInfo.d.ts +0 -4
- package/types.cjs +0 -18
- package/types.d.ts +0 -12
- package/types.js +0 -4
- package/types.jsonrpc.cjs +0 -10
- package/types.jsonrpc.d.ts +0 -7
- package/types.jsonrpc.js +0 -3
- package/util/drr.d.ts +0 -15
- package/util/index.d.ts +0 -3
- package/util/memo.d.ts +0 -6
- package/util/refCountDelay.d.ts +0 -3
package/package.json
CHANGED
|
@@ -20,17 +20,18 @@
|
|
|
20
20
|
"./detectPackage.cjs"
|
|
21
21
|
],
|
|
22
22
|
"type": "module",
|
|
23
|
-
"version": "6.12.2-
|
|
23
|
+
"version": "6.12.2-23",
|
|
24
24
|
"main": "index.js",
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@babel/runtime": "^7.16.5",
|
|
27
|
-
"@polkadot/rpc-provider": "6.12.2-
|
|
28
|
-
"@polkadot/types": "6.12.2-
|
|
29
|
-
"@polkadot/util": "^8.
|
|
27
|
+
"@polkadot/rpc-provider": "6.12.2-23",
|
|
28
|
+
"@polkadot/types": "6.12.2-23",
|
|
29
|
+
"@polkadot/util": "^8.2.2",
|
|
30
30
|
"rxjs": "^7.4.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@polkadot/keyring": "^8.
|
|
33
|
+
"@polkadot/keyring": "^8.2.2",
|
|
34
|
+
"@polkadot/rpc-augment": "6.12.2-23"
|
|
34
35
|
},
|
|
35
36
|
"exports": {
|
|
36
37
|
".": {
|
|
@@ -41,27 +42,28 @@
|
|
|
41
42
|
"require": "./bundle.cjs",
|
|
42
43
|
"default": "./bundle.js"
|
|
43
44
|
},
|
|
44
|
-
"./bundle.d.ts": "./bundle.d.ts",
|
|
45
45
|
"./detectPackage": {
|
|
46
46
|
"require": "./detectPackage.cjs",
|
|
47
47
|
"default": "./detectPackage.js"
|
|
48
48
|
},
|
|
49
|
-
"./detectPackage.d.ts": "./detectPackage.d.ts",
|
|
50
|
-
"./index.d.ts": "./index.d.ts",
|
|
51
49
|
"./package.json": "./package.json",
|
|
52
50
|
"./packageInfo": {
|
|
53
51
|
"require": "./packageInfo.cjs",
|
|
54
52
|
"default": "./packageInfo.js"
|
|
55
53
|
},
|
|
56
|
-
"./packageInfo.d.ts": "./packageInfo.d.ts",
|
|
57
54
|
"./README.md": "./README.md",
|
|
58
55
|
"./types": {
|
|
59
|
-
"require": "./types.cjs",
|
|
60
|
-
"default": "./types.js"
|
|
56
|
+
"require": "./types/index.cjs",
|
|
57
|
+
"default": "./types/index.js"
|
|
58
|
+
},
|
|
59
|
+
"./types/base": {
|
|
60
|
+
"require": "./types/base.cjs",
|
|
61
|
+
"default": "./types/base.js"
|
|
62
|
+
},
|
|
63
|
+
"./types/jsonrpc": {
|
|
64
|
+
"require": "./types/jsonrpc.cjs",
|
|
65
|
+
"default": "./types/jsonrpc.js"
|
|
61
66
|
},
|
|
62
|
-
"./types.d.ts": "./types.d.ts",
|
|
63
|
-
"./types.jsonrpc.d.ts": "./types.jsonrpc.d.ts",
|
|
64
|
-
"./typesonrpc.js": "./types.jsonrpc.js",
|
|
65
67
|
"./util": {
|
|
66
68
|
"require": "./util/index.cjs",
|
|
67
69
|
"default": "./util/index.js"
|
|
@@ -70,17 +72,13 @@
|
|
|
70
72
|
"require": "./util/drr.cjs",
|
|
71
73
|
"default": "./util/drr.js"
|
|
72
74
|
},
|
|
73
|
-
"./util/drr.d.ts": "./util/drr.d.ts",
|
|
74
|
-
"./util/index.d.ts": "./util/index.d.ts",
|
|
75
75
|
"./util/memo": {
|
|
76
76
|
"require": "./util/memo.cjs",
|
|
77
77
|
"default": "./util/memo.js"
|
|
78
78
|
},
|
|
79
|
-
"./util/memo.d.ts": "./util/memo.d.ts",
|
|
80
79
|
"./util/refCountDelay": {
|
|
81
80
|
"require": "./util/refCountDelay.cjs",
|
|
82
81
|
"default": "./util/refCountDelay.js"
|
|
83
|
-
}
|
|
84
|
-
"./util/refCountDelay.d.ts": "./util/refCountDelay.d.ts"
|
|
82
|
+
}
|
|
85
83
|
}
|
|
86
84
|
}
|
package/packageInfo.cjs
CHANGED
package/packageInfo.js
CHANGED
package/types/base.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
package/types/base.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/types/index.cjs
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var _jsonrpc = require("@polkadot/rpc-core/types/jsonrpc");
|
|
8
|
+
|
|
9
|
+
Object.keys(_jsonrpc).forEach(function (key) {
|
|
10
|
+
if (key === "default" || key === "__esModule") return;
|
|
11
|
+
if (key in exports && exports[key] === _jsonrpc[key]) return;
|
|
12
|
+
Object.defineProperty(exports, key, {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _jsonrpc[key];
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
var _base = require("./base.cjs");
|
|
21
|
+
|
|
22
|
+
Object.keys(_base).forEach(function (key) {
|
|
23
|
+
if (key === "default" || key === "__esModule") return;
|
|
24
|
+
if (key in exports && exports[key] === _base[key]) return;
|
|
25
|
+
Object.defineProperty(exports, key, {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function () {
|
|
28
|
+
return _base[key];
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
});
|
package/types/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
package/types/jsonrpc.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/bundle.d.ts
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import type { ProviderInterface } from '@polkadot/rpc-provider/types';
|
|
2
|
-
import type { DefinitionRpc, DefinitionRpcExt, DefinitionRpcSub, Registry } from '@polkadot/types/types';
|
|
3
|
-
export { packageInfo } from './packageInfo';
|
|
4
|
-
export * from './util';
|
|
5
|
-
/**
|
|
6
|
-
* @name Rpc
|
|
7
|
-
* @summary The API may use a HTTP or WebSockets provider.
|
|
8
|
-
* @description It allows for querying a Polkadot Client Node.
|
|
9
|
-
* WebSockets provider is recommended since HTTP provider only supports basic querying.
|
|
10
|
-
*
|
|
11
|
-
* ```mermaid
|
|
12
|
-
* graph LR;
|
|
13
|
-
* A[Api] --> |WebSockets| B[WsProvider];
|
|
14
|
-
* B --> |endpoint| C[ws://127.0.0.1:9944]
|
|
15
|
-
* ```
|
|
16
|
-
*
|
|
17
|
-
* @example
|
|
18
|
-
* <BR>
|
|
19
|
-
*
|
|
20
|
-
* ```javascript
|
|
21
|
-
* import Rpc from '@polkadot/rpc-core';
|
|
22
|
-
* import { WsProvider } from '@polkadot/rpc-provider/ws';
|
|
23
|
-
*
|
|
24
|
-
* const provider = new WsProvider('ws://127.0.0.1:9944');
|
|
25
|
-
* const rpc = new Rpc(provider);
|
|
26
|
-
* ```
|
|
27
|
-
*/
|
|
28
|
-
export declare class RpcCore {
|
|
29
|
-
#private;
|
|
30
|
-
readonly mapping: Map<string, DefinitionRpcExt>;
|
|
31
|
-
readonly provider: ProviderInterface;
|
|
32
|
-
readonly sections: string[];
|
|
33
|
-
/**
|
|
34
|
-
* @constructor
|
|
35
|
-
* Default constructor for the Api Object
|
|
36
|
-
* @param {ProviderInterface} provider An API provider using HTTP or WebSocket
|
|
37
|
-
*/
|
|
38
|
-
constructor(instanceId: string, registry: Registry, provider: ProviderInterface, userRpc?: Record<string, Record<string, DefinitionRpc | DefinitionRpcSub>>);
|
|
39
|
-
/**
|
|
40
|
-
* @description Returns the connected status of a provider
|
|
41
|
-
*/
|
|
42
|
-
get isConnected(): boolean;
|
|
43
|
-
/**
|
|
44
|
-
* @description Manually connect from the attached provider
|
|
45
|
-
*/
|
|
46
|
-
connect(): Promise<void>;
|
|
47
|
-
/**
|
|
48
|
-
* @description Manually disconnect from the attached provider
|
|
49
|
-
*/
|
|
50
|
-
disconnect(): Promise<void>;
|
|
51
|
-
/**
|
|
52
|
-
* @description Sets a registry swap (typically from Api)
|
|
53
|
-
*/
|
|
54
|
-
setRegistrySwap(registrySwap: (blockHash: Uint8Array) => Promise<{
|
|
55
|
-
registry: Registry;
|
|
56
|
-
}>): void;
|
|
57
|
-
addUserInterfaces(userRpc: Record<string, Record<string, DefinitionRpc | DefinitionRpcSub>>): void;
|
|
58
|
-
private _memomize;
|
|
59
|
-
private _formatResult;
|
|
60
|
-
private _createMethodSend;
|
|
61
|
-
private _createSubscriber;
|
|
62
|
-
private _createMethodSubscribe;
|
|
63
|
-
private _formatInputs;
|
|
64
|
-
private _formatOutput;
|
|
65
|
-
private _formatStorageData;
|
|
66
|
-
private _formatStorageSet;
|
|
67
|
-
private _formatStorageSetEntry;
|
|
68
|
-
private _newType;
|
|
69
|
-
}
|
package/detectPackage.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/index.d.ts
DELETED
package/packageInfo.d.ts
DELETED
package/types.cjs
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
var _types = require("@polkadot/rpc-core/types.jsonrpc");
|
|
8
|
-
|
|
9
|
-
Object.keys(_types).forEach(function (key) {
|
|
10
|
-
if (key === "default" || key === "__esModule") return;
|
|
11
|
-
if (key in exports && exports[key] === _types[key]) return;
|
|
12
|
-
Object.defineProperty(exports, key, {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
-
return _types[key];
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
});
|
package/types.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { Observable } from 'rxjs';
|
|
2
|
-
import type { AnyFunction, Codec, DefinitionRpc } from '@polkadot/types/types';
|
|
3
|
-
export * from '@polkadot/rpc-core/types.jsonrpc';
|
|
4
|
-
export interface RpcInterfaceMethod {
|
|
5
|
-
<T extends Codec>(...params: unknown[]): Observable<T>;
|
|
6
|
-
raw(...params: unknown[]): Observable<unknown>;
|
|
7
|
-
meta: DefinitionRpc;
|
|
8
|
-
}
|
|
9
|
-
export declare type AugmentedRpc<F extends AnyFunction> = F & {
|
|
10
|
-
raw: <T>(...params: Parameters<F>) => Observable<T>;
|
|
11
|
-
meta: DefinitionRpc;
|
|
12
|
-
};
|
package/types.js
DELETED
package/types.jsonrpc.cjs
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.__PHANTOM_RPC = void 0;
|
|
7
|
-
// Copyright 2017-2021 @polkadot/rpc-core authors & contributors
|
|
8
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
9
|
-
const __PHANTOM_RPC = 'phantom-rpc';
|
|
10
|
-
exports.__PHANTOM_RPC = __PHANTOM_RPC;
|
package/types.jsonrpc.d.ts
DELETED
package/types.jsonrpc.js
DELETED
package/util/drr.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { Observable } from 'rxjs';
|
|
2
|
-
export declare type DrrResult = <T>(source$: Observable<T>) => Observable<T>;
|
|
3
|
-
interface Options {
|
|
4
|
-
delay?: number;
|
|
5
|
-
skipChange?: boolean;
|
|
6
|
-
skipTimeout?: boolean;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Shorthand for distinctUntilChanged(), publishReplay(1) and refCount().
|
|
10
|
-
*
|
|
11
|
-
* @ignore
|
|
12
|
-
* @internal
|
|
13
|
-
*/
|
|
14
|
-
export declare const drr: ({ delay, skipChange, skipTimeout }?: Options) => DrrResult;
|
|
15
|
-
export {};
|
package/util/index.d.ts
DELETED
package/util/memo.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { Memoized } from '@polkadot/util/types';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
declare type ObsFn<T> = (...params: unknown[]) => Observable<T>;
|
|
4
|
-
/** @internal */
|
|
5
|
-
export declare function memo<T>(instanceId: string, inner: Function): Memoized<ObsFn<T>>;
|
|
6
|
-
export {};
|
package/util/refCountDelay.d.ts
DELETED