@polkadot/api-base 8.9.2-8 → 8.11.1

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.
@@ -11,6 +11,6 @@ const packageInfo = {
11
11
  name: '@polkadot/api-base',
12
12
  path: typeof __dirname === 'string' ? __dirname : 'auto',
13
13
  type: 'cjs',
14
- version: '8.9.2-8'
14
+ version: '8.11.1'
15
15
  };
16
16
  exports.packageInfo = packageInfo;
@@ -0,0 +1 @@
1
+ "use strict";
@@ -4,6 +4,19 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
 
7
+ var _calls = require("@polkadot/api-base/types/calls");
8
+
9
+ Object.keys(_calls).forEach(function (key) {
10
+ if (key === "default" || key === "__esModule") return;
11
+ if (key in exports && exports[key] === _calls[key]) return;
12
+ Object.defineProperty(exports, key, {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _calls[key];
16
+ }
17
+ });
18
+ });
19
+
7
20
  var _consts = require("@polkadot/api-base/types/consts");
8
21
 
9
22
  Object.keys(_consts).forEach(function (key) {
package/package.json CHANGED
@@ -20,7 +20,7 @@
20
20
  "./cjs/detectPackage.js"
21
21
  ],
22
22
  "type": "module",
23
- "version": "8.9.2-8",
23
+ "version": "8.11.1",
24
24
  "main": "./cjs/index.js",
25
25
  "module": "./index.js",
26
26
  "types": "./index.d.ts",
@@ -75,6 +75,11 @@
75
75
  "require": "./cjs/types/base.js",
76
76
  "default": "./types/base.js"
77
77
  },
78
+ "./types/calls": {
79
+ "types": "./types/calls.d.ts",
80
+ "require": "./cjs/types/calls.js",
81
+ "default": "./types/calls.js"
82
+ },
78
83
  "./types/consts": {
79
84
  "types": "./types/consts.d.ts",
80
85
  "require": "./cjs/types/consts.js",
@@ -112,10 +117,10 @@
112
117
  }
113
118
  },
114
119
  "dependencies": {
115
- "@babel/runtime": "^7.18.3",
116
- "@polkadot/rpc-core": "8.9.2-8",
117
- "@polkadot/types": "8.9.2-8",
118
- "@polkadot/util": "^9.5.2-13",
120
+ "@babel/runtime": "^7.18.6",
121
+ "@polkadot/rpc-core": "8.11.1",
122
+ "@polkadot/types": "8.11.1",
123
+ "@polkadot/util": "^9.7.1",
119
124
  "rxjs": "^7.5.5"
120
125
  }
121
126
  }
package/packageInfo.js CHANGED
@@ -5,5 +5,5 @@ export const packageInfo = {
5
5
  name: '@polkadot/api-base',
6
6
  path: (import.meta && import.meta.url) ? new URL(import.meta.url).pathname.substring(0, new URL(import.meta.url).pathname.lastIndexOf('/') + 1) : 'auto',
7
7
  type: 'esm',
8
- version: '8.9.2-8'
8
+ version: '8.11.1'
9
9
  };
package/types/base.d.ts CHANGED
@@ -29,3 +29,6 @@ export interface PaginationOptions<A = unknown> {
29
29
  startKey?: string;
30
30
  }
31
31
  export declare type DecorateMethod<ApiType extends ApiTypes, T = any> = <M extends (...args: any[]) => Observable<any>>(method: M, options?: DecorateMethodOptions) => T;
32
+ declare type AsCodec<R extends Codec | any> = R extends Codec ? R : Codec;
33
+ export declare type ReturnCodec<F extends AnyFunction> = AsCodec<ObsInnerType<ReturnType<F>>>;
34
+ export {};
@@ -0,0 +1,15 @@
1
+ import type { Observable } from 'rxjs';
2
+ import type { AnyFunction, Codec, DefinitionCallNamed } from '@polkadot/types/types';
3
+ import type { ApiTypes, ReturnCodec } from './base';
4
+ export interface AugmentedCalls<ApiType extends ApiTypes> {
5
+ }
6
+ export interface QueryableCalls<ApiType extends ApiTypes> extends AugmentedCalls<ApiType> {
7
+ [key: string]: QueryableModuleCalls<ApiType>;
8
+ }
9
+ export interface QueryableModuleCalls<ApiType extends ApiTypes> {
10
+ [key: string]: DecoratedCallBase<ApiType>;
11
+ }
12
+ export declare type DecoratedCallBase<ApiType extends ApiTypes, F extends AnyFunction = (...args: any[]) => Observable<Codec>> = ApiType extends 'rxjs' ? <T extends Codec | any = ReturnCodec<F>>(...args: Parameters<F>) => Observable<T> : <T extends Codec | any = ReturnCodec<F>>(...args: Parameters<F>) => Promise<T>;
13
+ export declare type AugmentedCall<ApiType extends ApiTypes, F extends AnyFunction = (...args: any[]) => Observable<Codec>> = DecoratedCallBase<ApiType, F> & {
14
+ meta: DefinitionCallNamed;
15
+ };
package/types/calls.js ADDED
@@ -0,0 +1 @@
1
+ export {};
package/types/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export * from '@polkadot/api-base/types/calls';
1
2
  export * from '@polkadot/api-base/types/consts';
2
3
  export * from '@polkadot/api-base/types/errors';
3
4
  export * from '@polkadot/api-base/types/events';
package/types/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  // Copyright 2017-2022 @polkadot/api authors & contributors
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  // These are augmented, do an augmentation export
4
+ export * from '@polkadot/api-base/types/calls';
4
5
  export * from '@polkadot/api-base/types/consts';
5
6
  export * from '@polkadot/api-base/types/errors';
6
7
  export * from '@polkadot/api-base/types/events';
@@ -3,7 +3,7 @@ import type { StorageKey, u64 } from '@polkadot/types';
3
3
  import type { Hash } from '@polkadot/types/interfaces';
4
4
  import type { StorageEntry } from '@polkadot/types/primitive/types';
5
5
  import type { AnyFunction, AnyTuple, Callback, Codec, IStorageKey } from '@polkadot/types/types';
6
- import type { ApiTypes, DropLast, MethodResult, ObsInnerType, PaginationOptions, PromiseOrObs, UnsubscribePromise } from './base';
6
+ import type { ApiTypes, DropLast, MethodResult, PaginationOptions, PromiseOrObs, ReturnCodec, UnsubscribePromise } from './base';
7
7
  export interface AugmentedQueries<ApiType extends ApiTypes> {
8
8
  }
9
9
  export interface QueryableStorage<ApiType extends ApiTypes> extends AugmentedQueries<ApiType> {
@@ -12,8 +12,6 @@ export interface QueryableStorage<ApiType extends ApiTypes> extends AugmentedQue
12
12
  export interface QueryableStorageAt<ApiType extends ApiTypes> extends AugmentedQueries<ApiType> {
13
13
  [key: string]: QueryableModuleStorageAt<ApiType>;
14
14
  }
15
- declare type AsCodec<R extends Codec | any> = R extends Codec ? R : Codec;
16
- declare type ReturnCodec<F extends AnyFunction> = AsCodec<ObsInnerType<ReturnType<F>>>;
17
15
  interface StorageEntryObservableMulti<R extends Codec = Codec> {
18
16
  <T extends Codec = R>(args: (unknown[] | unknown)[]): Observable<T[]>;
19
17
  }