@dedot/api 0.0.1-next.a5b1d2fb.22 → 0.0.1-next.b6596712.6
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/cjs/client/BaseSubstrateClient.js +2 -2
- package/cjs/client/DedotClient.js +2 -1
- package/cjs/client/LegacyClient.js +2 -1
- package/cjs/extrinsic/submittable/utils.js +3 -2
- package/client/BaseSubstrateClient.d.ts +10 -11
- package/client/DedotClient.d.ts +2 -1
- package/client/DedotClient.js +2 -1
- package/client/LegacyClient.d.ts +2 -1
- package/client/LegacyClient.js +2 -1
- package/package.json +10 -10
- package/proxychain.d.ts +1 -1
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BaseSubstrateClient = void 0;
|
|
4
|
-
exports.ensurePresence = ensurePresence;
|
|
3
|
+
exports.BaseSubstrateClient = exports.ensurePresence = void 0;
|
|
5
4
|
const codecs_1 = require("@dedot/codecs");
|
|
6
5
|
const storage_1 = require("@dedot/storage");
|
|
7
6
|
const utils_1 = require("@dedot/utils");
|
|
@@ -14,6 +13,7 @@ const MESSAGE = 'Make sure to call `.connect()` method first before using the AP
|
|
|
14
13
|
function ensurePresence(value) {
|
|
15
14
|
return (0, utils_1.ensurePresence)(value, MESSAGE);
|
|
16
15
|
}
|
|
16
|
+
exports.ensurePresence = ensurePresence;
|
|
17
17
|
/**
|
|
18
18
|
* @name BaseSubstrateClient
|
|
19
19
|
* @description Base & shared abstraction for Substrate API Clients
|
|
@@ -14,7 +14,8 @@ const BaseSubstrateClient_js_1 = require("./BaseSubstrateClient.js");
|
|
|
14
14
|
*
|
|
15
15
|
* __Unstable, use with caution.__
|
|
16
16
|
*/
|
|
17
|
-
class DedotClient
|
|
17
|
+
class DedotClient// prettier-end-here
|
|
18
|
+
extends BaseSubstrateClient_js_1.BaseSubstrateClient {
|
|
18
19
|
_chainHead;
|
|
19
20
|
_chainSpec;
|
|
20
21
|
_txBroadcaster;
|
|
@@ -44,7 +44,8 @@ const KEEP_ALIVE_INTERVAL = 10_000; // in ms
|
|
|
44
44
|
* run().catch(console.error);
|
|
45
45
|
* ```
|
|
46
46
|
*/
|
|
47
|
-
class LegacyClient
|
|
47
|
+
class LegacyClient// prettier-end-here
|
|
48
|
+
extends BaseSubstrateClient_js_1.BaseSubstrateClient {
|
|
48
49
|
#runtimeSubscriptionUnsub;
|
|
49
50
|
#healthTimer;
|
|
50
51
|
#apiAtCache = {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isKeyringPair =
|
|
4
|
-
exports.signRaw = signRaw;
|
|
3
|
+
exports.signRaw = exports.isKeyringPair = void 0;
|
|
5
4
|
const utils_1 = require("@dedot/utils");
|
|
6
5
|
function isKeyringPair(account) {
|
|
7
6
|
return (0, utils_1.isFunction)(account.sign);
|
|
8
7
|
}
|
|
8
|
+
exports.isKeyringPair = isKeyringPair;
|
|
9
9
|
/**
|
|
10
10
|
* Sign a raw message
|
|
11
11
|
* @param signerPair
|
|
@@ -17,3 +17,4 @@ function signRaw(signerPair, raw) {
|
|
|
17
17
|
const toSignRaw = u8a.length > 256 ? (0, utils_1.blake2AsU8a)(u8a, 256) : u8a;
|
|
18
18
|
return signerPair.sign(toSignRaw, { withType: true });
|
|
19
19
|
}
|
|
20
|
+
exports.signRaw = signRaw;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { BlockHash, Hash, Metadata, PortableRegistry, RuntimeVersion } from '@dedot/codecs';
|
|
2
2
|
import type { JsonRpcProvider } from '@dedot/providers';
|
|
3
3
|
import { type IStorage } from '@dedot/storage';
|
|
4
|
-
import { GenericSubstrateApi, RpcVersion
|
|
5
|
-
import type { SubstrateApi } from '../chaintypes/index.js';
|
|
4
|
+
import { GenericSubstrateApi, RpcVersion } from '@dedot/types';
|
|
6
5
|
import { JsonRpcClient } from '../json-rpc/index.js';
|
|
7
6
|
import type { ApiEvent, ApiOptions, ISubstrateClient, ISubstrateClientAt, JsonRpcClientOptions, MetadataKey, SubstrateRuntimeVersion } from '../types.js';
|
|
8
7
|
export declare function ensurePresence<T>(value: T): NonNullable<T>;
|
|
@@ -10,7 +9,7 @@ export declare function ensurePresence<T>(value: T): NonNullable<T>;
|
|
|
10
9
|
* @name BaseSubstrateClient
|
|
11
10
|
* @description Base & shared abstraction for Substrate API Clients
|
|
12
11
|
*/
|
|
13
|
-
export declare abstract class BaseSubstrateClient<ChainApi extends
|
|
12
|
+
export declare abstract class BaseSubstrateClient<ChainApi extends GenericSubstrateApi = GenericSubstrateApi> extends JsonRpcClient<ChainApi, ApiEvent> implements ISubstrateClient<ChainApi> {
|
|
14
13
|
rpcVersion: RpcVersion;
|
|
15
14
|
protected _options: ApiOptions;
|
|
16
15
|
protected _registry?: PortableRegistry;
|
|
@@ -54,12 +53,12 @@ export declare abstract class BaseSubstrateClient<ChainApi extends VersionedGene
|
|
|
54
53
|
get registry(): PortableRegistry;
|
|
55
54
|
get genesisHash(): Hash;
|
|
56
55
|
get runtimeVersion(): SubstrateRuntimeVersion;
|
|
57
|
-
get consts(): ChainApi[
|
|
58
|
-
get errors(): ChainApi[
|
|
59
|
-
get events(): ChainApi[
|
|
60
|
-
get query(): ChainApi[
|
|
61
|
-
get call(): ChainApi[
|
|
62
|
-
protected callAt(hash?: BlockHash): ChainApi[
|
|
63
|
-
get tx(): ChainApi[
|
|
64
|
-
at<ChainApiAt extends GenericSubstrateApi = ChainApi
|
|
56
|
+
get consts(): ChainApi['consts'];
|
|
57
|
+
get errors(): ChainApi['errors'];
|
|
58
|
+
get events(): ChainApi['events'];
|
|
59
|
+
get query(): ChainApi['query'];
|
|
60
|
+
get call(): ChainApi['call'];
|
|
61
|
+
protected callAt(hash?: BlockHash): ChainApi['call'];
|
|
62
|
+
get tx(): ChainApi['tx'];
|
|
63
|
+
at<ChainApiAt extends GenericSubstrateApi = ChainApi>(hash: BlockHash): Promise<ISubstrateClientAt<ChainApiAt>>;
|
|
65
64
|
}
|
package/client/DedotClient.d.ts
CHANGED
|
@@ -11,7 +11,8 @@ import { BaseSubstrateClient } from './BaseSubstrateClient.js';
|
|
|
11
11
|
*
|
|
12
12
|
* __Unstable, use with caution.__
|
|
13
13
|
*/
|
|
14
|
-
export declare class DedotClient<ChainApi extends VersionedGenericSubstrateApi = SubstrateApi
|
|
14
|
+
export declare class DedotClient<ChainApi extends VersionedGenericSubstrateApi = SubstrateApi>// prettier-end-here
|
|
15
|
+
extends BaseSubstrateClient<ChainApi[RpcV2]> {
|
|
15
16
|
#private;
|
|
16
17
|
protected _chainHead?: ChainHead;
|
|
17
18
|
protected _chainSpec?: ChainSpec;
|
package/client/DedotClient.js
CHANGED
|
@@ -11,7 +11,8 @@ import { BaseSubstrateClient, ensurePresence } from './BaseSubstrateClient.js';
|
|
|
11
11
|
*
|
|
12
12
|
* __Unstable, use with caution.__
|
|
13
13
|
*/
|
|
14
|
-
export class DedotClient
|
|
14
|
+
export class DedotClient// prettier-end-here
|
|
15
|
+
extends BaseSubstrateClient {
|
|
15
16
|
_chainHead;
|
|
16
17
|
_chainSpec;
|
|
17
18
|
_txBroadcaster;
|
package/client/LegacyClient.d.ts
CHANGED
|
@@ -42,7 +42,8 @@ import { BaseSubstrateClient } from './BaseSubstrateClient.js';
|
|
|
42
42
|
* run().catch(console.error);
|
|
43
43
|
* ```
|
|
44
44
|
*/
|
|
45
|
-
export declare class LegacyClient<ChainApi extends VersionedGenericSubstrateApi = SubstrateApi
|
|
45
|
+
export declare class LegacyClient<ChainApi extends VersionedGenericSubstrateApi = SubstrateApi>// prettier-end-here
|
|
46
|
+
extends BaseSubstrateClient<ChainApi[RpcLegacy]> {
|
|
46
47
|
#private;
|
|
47
48
|
/**
|
|
48
49
|
* Use factory methods (`create`, `new`) to create `Dedot` instances.
|
package/client/LegacyClient.js
CHANGED
|
@@ -41,7 +41,8 @@ const KEEP_ALIVE_INTERVAL = 10_000; // in ms
|
|
|
41
41
|
* run().catch(console.error);
|
|
42
42
|
* ```
|
|
43
43
|
*/
|
|
44
|
-
export class LegacyClient
|
|
44
|
+
export class LegacyClient// prettier-end-here
|
|
45
|
+
extends BaseSubstrateClient {
|
|
45
46
|
#runtimeSubscriptionUnsub;
|
|
46
47
|
#healthTimer;
|
|
47
48
|
#apiAtCache = {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dedot/api",
|
|
3
|
-
"version": "0.0.1-next.
|
|
3
|
+
"version": "0.0.1-next.b6596712.6+b659671",
|
|
4
4
|
"description": "A delightful JavaScript/TypeScript client for Polkadot & Substrate",
|
|
5
5
|
"author": "Thang X. Vu <thang@coongcrafts.io>",
|
|
6
6
|
"homepage": "https://github.com/dedotdev/dedot",
|
|
@@ -13,13 +13,13 @@
|
|
|
13
13
|
"type": "module",
|
|
14
14
|
"sideEffects": false,
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@dedot/codecs": "0.0.1-next.
|
|
17
|
-
"@dedot/providers": "0.0.1-next.
|
|
18
|
-
"@dedot/runtime-specs": "0.0.1-next.
|
|
19
|
-
"@dedot/shape": "0.0.1-next.
|
|
20
|
-
"@dedot/storage": "0.0.1-next.
|
|
21
|
-
"@dedot/types": "0.0.1-next.
|
|
22
|
-
"@dedot/utils": "0.0.1-next.
|
|
16
|
+
"@dedot/codecs": "0.0.1-next.b6596712.6+b659671",
|
|
17
|
+
"@dedot/providers": "0.0.1-next.b6596712.6+b659671",
|
|
18
|
+
"@dedot/runtime-specs": "0.0.1-next.b6596712.6+b659671",
|
|
19
|
+
"@dedot/shape": "0.0.1-next.b6596712.6+b659671",
|
|
20
|
+
"@dedot/storage": "0.0.1-next.b6596712.6+b659671",
|
|
21
|
+
"@dedot/types": "0.0.1-next.b6596712.6+b659671",
|
|
22
|
+
"@dedot/utils": "0.0.1-next.b6596712.6+b659671"
|
|
23
23
|
},
|
|
24
24
|
"scripts": {
|
|
25
25
|
"build": "tsc --project tsconfig.build.json && tsc --project tsconfig.build.cjs.json",
|
|
@@ -46,9 +46,9 @@
|
|
|
46
46
|
},
|
|
47
47
|
"license": "Apache-2.0",
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@polkadot/types": "^
|
|
49
|
+
"@polkadot/types": "^12.0.1"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "b6596712119e3812b8af54d50f23371a3d556ad4",
|
|
52
52
|
"module": "./index.js",
|
|
53
53
|
"types": "./index.d.ts"
|
|
54
54
|
}
|
package/proxychain.d.ts
CHANGED
|
@@ -11,4 +11,4 @@ export interface Carrier<ChainApi extends GenericSubstrateApi> {
|
|
|
11
11
|
* @param currentLevel
|
|
12
12
|
* @param maxLevel
|
|
13
13
|
*/
|
|
14
|
-
export declare const newProxyChain: <ChainApi extends GenericSubstrateApi
|
|
14
|
+
export declare const newProxyChain: <ChainApi extends GenericSubstrateApi<import("@dedot/types").RpcVersion>>(carrier: Carrier<ChainApi>, currentLevel?: number, maxLevel?: number) => unknown;
|