@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.
@@ -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 extends BaseSubstrateClient_js_1.BaseSubstrateClient {
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 extends BaseSubstrateClient_js_1.BaseSubstrateClient {
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 = 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, VersionedGenericSubstrateApi } from '@dedot/types';
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 VersionedGenericSubstrateApi = SubstrateApi> extends JsonRpcClient<ChainApi[RpcVersion], ApiEvent> implements ISubstrateClient<ChainApi[RpcVersion]> {
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[RpcVersion]['consts'];
58
- get errors(): ChainApi[RpcVersion]['errors'];
59
- get events(): ChainApi[RpcVersion]['events'];
60
- get query(): ChainApi[RpcVersion]['query'];
61
- get call(): ChainApi[RpcVersion]['call'];
62
- protected callAt(hash?: BlockHash): ChainApi[RpcVersion]['call'];
63
- get tx(): ChainApi[RpcVersion]['tx'];
64
- at<ChainApiAt extends GenericSubstrateApi = ChainApi[RpcVersion]>(hash: BlockHash): Promise<ISubstrateClientAt<ChainApiAt>>;
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
  }
@@ -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> extends BaseSubstrateClient<ChainApi> {
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;
@@ -11,7 +11,8 @@ import { BaseSubstrateClient, ensurePresence } from './BaseSubstrateClient.js';
11
11
  *
12
12
  * __Unstable, use with caution.__
13
13
  */
14
- export class DedotClient extends BaseSubstrateClient {
14
+ export class DedotClient// prettier-end-here
15
+ extends BaseSubstrateClient {
15
16
  _chainHead;
16
17
  _chainSpec;
17
18
  _txBroadcaster;
@@ -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> extends BaseSubstrateClient<ChainApi> {
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.
@@ -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 extends BaseSubstrateClient {
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.a5b1d2fb.22+a5b1d2f",
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.a5b1d2fb.22+a5b1d2f",
17
- "@dedot/providers": "0.0.1-next.a5b1d2fb.22+a5b1d2f",
18
- "@dedot/runtime-specs": "0.0.1-next.a5b1d2fb.22+a5b1d2f",
19
- "@dedot/shape": "0.0.1-next.a5b1d2fb.22+a5b1d2f",
20
- "@dedot/storage": "0.0.1-next.a5b1d2fb.22+a5b1d2f",
21
- "@dedot/types": "0.0.1-next.a5b1d2fb.22+a5b1d2f",
22
- "@dedot/utils": "0.0.1-next.a5b1d2fb.22+a5b1d2f"
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": "^11.3.1"
49
+ "@polkadot/types": "^12.0.1"
50
50
  },
51
- "gitHead": "a5b1d2fbb14107e2e5bb9de229b2707d814a02e5",
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>(carrier: Carrier<ChainApi>, currentLevel?: number, maxLevel?: number) => unknown;
14
+ export declare const newProxyChain: <ChainApi extends GenericSubstrateApi<import("@dedot/types").RpcVersion>>(carrier: Carrier<ChainApi>, currentLevel?: number, maxLevel?: number) => unknown;